From patchwork Mon Oct 9 13:37:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13413752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0996E95A8E for ; Mon, 9 Oct 2023 13:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377305AbjJINi3 (ORCPT ); Mon, 9 Oct 2023 09:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377262AbjJINiT (ORCPT ); Mon, 9 Oct 2023 09:38:19 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1FBBD6; Mon, 9 Oct 2023 06:38:16 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3231dff4343so2704816f8f.0; Mon, 09 Oct 2023 06:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696858695; x=1697463495; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6V3Yp/K15xx7ev3Qhf5+/0w5en07kzL7Wskfo0+HBPw=; b=UxJZQwArtVkHQzamLIPvEe663j4D0jo6HtE9vQh/LrnJzFcFYtU25Nzxnob6pOk3Gk 4egl3DLrDqiQSyDw2NUjwXey9kUzWurxQw4ks+PKbEAToL0sIcOsylh5xkN+24s+zAjd 2WQ5ORcBJSIWOSRKFrbOtkBqewXNcU783ZmgaKvjyXkGntmn8Gy/iQaYLG/UnKOg2ZuO hoyVDMvD0afeA3o42fgIwwyCfsvzCCGuLoOzTjChqU/RQUm4D5icsDl1wCbDjiyyk6In 6ZYSHcU/wZxYs79vcaBF0tVZsFXKrq76LsyAm8WwW8ho4fVZBJmvet6INXHv+ABtasnu 7OZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696858695; x=1697463495; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6V3Yp/K15xx7ev3Qhf5+/0w5en07kzL7Wskfo0+HBPw=; b=nWrMomLpGlV5saC422/KqrGKZ+7bNYEoq+ZwpjK+2Wlwo8VGXqGYnrmjYzSEt/w7eY 5JELrUKwk2ozHDvZY0XUPijUpzGGVE2jCLUrsiu6ZfNWb7XYXrS+rP6OrTys9yXshSXO SubQt99LTd2zigiBQ+j3Ebn43pkcT74RU7oU47b0Z+PwyhBV3s4ShuN6aUtuLH0hWP1/ 6D2ZAR7riDF07ucXw1ISU09l3v2tomblcZTIhsVbKKUCuPVhVcwqtVSI07zkWhxflU7N ow1hEmm05qB10SJk3Uge+xUCEk7kr7I9geE1x/Uhle03lCEDKEvCD9JPTNwA8KrGuDVk KHCA== X-Gm-Message-State: AOJu0YzThK7Scl28FPBO/nFbmnovPL82Fp+3hMPvYCRFWZCtRaQ1Lpqx vi+HKgGfWjhcBgT1HaZbAIg= X-Google-Smtp-Source: AGHT+IEg5HTR+xDE3IzwD0pbfXpmjGlWQO4VcUmgAYjzp1NHs11O05PimyYF9rp+Ru7+he92h2hBgA== X-Received: by 2002:a05:6000:1112:b0:317:6734:c2ae with SMTP id z18-20020a056000111200b003176734c2aemr9423512wrw.11.1696858695077; Mon, 09 Oct 2023 06:38:15 -0700 (PDT) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id t4-20020a0560001a4400b0032763287473sm9746160wry.75.2023.10.09.06.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 06:38:14 -0700 (PDT) From: Christian Marangi To: Jason Gunthorpe , Leon Romanovsky , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Chris Snook , Raju Rangoju , Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Douglas Miller , Nick Child , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Haren Myneni , Rick Lindsley , Dany Madden , Thomas Falcon , Tariq Toukan , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Krzysztof Halasa , Kalle Valo , Jeff Johnson , Gregory Greenman , Chandrashekar Devegowda , Intel Corporation , Chiranjeevi Rapolu , Liu Haijun , M Chetan Kumar , Ricardo Martinez , Loic Poulain , Sergey Ryazanov , Johannes Berg , Christian Marangi , Yuanjun Gong , Alex Elder , Bhupesh Sharma , Simon Horman , Rob Herring , Bailey Forrest , Junfeng Guo , "Gustavo A. R. Silva" , Ziwei Xiao , Rushil Gupta , Thomas Gleixner , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Krzysztof Kozlowski , Yuri Karpov , Andrew Lunn , Zheng Zengkai , Dawei Li , Anjaneyulu , Benjamin Berg , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [net-next v3 5/5] netdev: use napi_schedule bool instead of napi_schedule_prep/__napi_schedule Date: Mon, 9 Oct 2023 15:37:54 +0200 Message-Id: <20231009133754.9834-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009133754.9834-1-ansuelsmth@gmail.com> References: <20231009133754.9834-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Replace if condition of napi_schedule_prep/__napi_schedule and use bool from napi_schedule directly where possible. Signed-off-by: Christian Marangi --- Changes v3: - Drop toshiba change and rework in separate patch --- drivers/net/ethernet/atheros/atlx/atl1.c | 4 +--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c index 02aa6fd8ebc2..a9014d7932db 100644 --- a/drivers/net/ethernet/atheros/atlx/atl1.c +++ b/drivers/net/ethernet/atheros/atlx/atl1.c @@ -2446,7 +2446,7 @@ static int atl1_rings_clean(struct napi_struct *napi, int budget) static inline int atl1_sched_rings_clean(struct atl1_adapter* adapter) { - if (!napi_schedule_prep(&adapter->napi)) + if (!napi_schedule(&adapter->napi)) /* It is possible in case even the RX/TX ints are disabled via IMR * register the ISR bits are set anyway (but do not produce IRQ). * To handle such situation the napi functions used to check is @@ -2454,8 +2454,6 @@ static inline int atl1_sched_rings_clean(struct atl1_adapter* adapter) */ return 0; - __napi_schedule(&adapter->napi); - /* * Disable RX/TX ints via IMR register if it is * allowed. NAPI handler must reenable them in same diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c index 23b5a0adcbd6..146bc7bd14fb 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c @@ -1660,9 +1660,7 @@ irqreturn_t iwl_pcie_irq_rx_msix_handler(int irq, void *dev_id) IWL_DEBUG_ISR(trans, "[%d] Got interrupt\n", entry->entry); local_bh_disable(); - if (napi_schedule_prep(&rxq->napi)) - __napi_schedule(&rxq->napi); - else + if (!napi_schedule(&rxq->napi)) iwl_pcie_clear_irq(trans, entry->entry); local_bh_enable();