From patchwork Tue Oct 3 14:51:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13407898 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 C4A9DE776FD for ; Tue, 3 Oct 2023 18:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240834AbjJCSgz (ORCPT ); Tue, 3 Oct 2023 14:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240810AbjJCSgx (ORCPT ); Tue, 3 Oct 2023 14:36:53 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80021AC; Tue, 3 Oct 2023 11:36:47 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40651a72807so12648845e9.1; Tue, 03 Oct 2023 11:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696358206; x=1696963006; 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=6gyQNJ2XnyFpWZfsSOVQ7NTvT9jbamCtiO1RkGRSocs=; b=H1s3zgciXLCZusBZWw3ADVu1lzKUhWWNECQpIat/xTggEO+yE+mK4UOFYPAfR2ScK6 oSvgGsDKEc5AC5gQ2kNhAU2vdREUdFfDfQXxMQSC9QuI2f75ObGWvhii4IuLhYfR1Y1g aAMUIv11aBKdGJ6RlZmi30JqnUZ7CGLBPbKiHslF3cZYEJYyuliBhKUVjRoj7NizrJf9 sBXR3e2bnpnlAyAPWHT9xBDJiCyFpjJDZoUHNBwatfU426Fn/JQLdtxBFUEt0BlvZsz6 KzKGDqX00CB7XebouXwmR+7o+B1psqtrcM02VnSmkUzoCDfEdYGKrK0GSAg8JxuzKgEc Z+zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696358206; x=1696963006; 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=6gyQNJ2XnyFpWZfsSOVQ7NTvT9jbamCtiO1RkGRSocs=; b=mpuOlkrTI3hBjfNnWHRt7s3ocaOE0oOFRgjeRRKywiQi0rvG8I5pJjSbhX47S6hiy2 iw1nsj3vDCnMYKMx1Gl6V9Q0/unhmEA7kXWo9bctnkhDZDiY87ZGhBzo480eDMO/xmlA BQgf+VN+wu0d0ImBQVQVgvWLWTCjz5PWUbsFY0TsM6sAPiBN2srnZsv0tRKlun7VMzjW JElPkyRjhmskjM/5Sv3akBKhZ+uGdsaB+apzw24F+8QzirQwMPAHU3YoP4g5pQ+f07Sq YECkZnsMsidDyECKlXT1WthtU1DGSE/JEw8RksXv1L2prsmsFhdiFxI6z3yh3DpR7YMr PQAQ== X-Gm-Message-State: AOJu0YzdieaH3XKXpPmGDGQCOF0Z/Rc1Z7ZbvGzEhjoSK9SFJ7FYyXut euSPcKlUGDEctHqvOLpTtk0= X-Google-Smtp-Source: AGHT+IEYiqmB3FHX80gX8tQMzI8kEwWFIYbZ3oxXBoRCokmvLgveVRe6BiL4NPRW0r5qNgswYRjDHQ== X-Received: by 2002:a05:600c:22ce:b0:405:4c3a:796f with SMTP id 14-20020a05600c22ce00b004054c3a796fmr308411wmg.2.1696358205305; Tue, 03 Oct 2023 11:36:45 -0700 (PDT) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id k15-20020a7bc40f000000b004013797efb6sm10147400wmi.9.2023.10.03.11.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 11:36:45 -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 , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Nick Child , 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 , Simon Horman , Rob Herring , Ziwei Xiao , Rushil Gupta , Coco Li , Thomas Gleixner , Junfeng Guo , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Wei Fang , Krzysztof Kozlowski , Yuri Karpov , Zhengchao Shao , Andrew Lunn , Zheng Zengkai , Lee Jones , Maximilian Luz , "Rafael J. Wysocki" , 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 PATCH v2 4/4] netdev: use napi_schedule bool instead of napi_schedule_prep/__napi_schedule Date: Tue, 3 Oct 2023 16:51:50 +0200 Message-Id: <20231003145150.2498-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231003145150.2498-1-ansuelsmth@gmail.com> References: <20231003145150.2498-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 --- drivers/net/ethernet/atheros/atlx/atl1.c | 4 +--- drivers/net/ethernet/toshiba/tc35815.c | 4 +--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 4 +--- 3 files changed, 3 insertions(+), 9 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/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c index 14cf6ecf6d0d..a8b8a0e13f9a 100644 --- a/drivers/net/ethernet/toshiba/tc35815.c +++ b/drivers/net/ethernet/toshiba/tc35815.c @@ -1436,9 +1436,7 @@ static irqreturn_t tc35815_interrupt(int irq, void *dev_id) if (!(dmactl & DMA_IntMask)) { /* disable interrupts */ tc_writel(dmactl | DMA_IntMask, &tr->DMA_Ctl); - if (napi_schedule_prep(&lp->napi)) - __napi_schedule(&lp->napi); - else { + if (!napi_schedule(&lp->napi)) { printk(KERN_ERR "%s: interrupt taken in poll\n", dev->name); BUG(); 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();