From patchwork Mon Sep 14 07:29:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEFE5C2BC11 for ; Mon, 14 Sep 2020 07:30:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94B1421BE5 for ; Mon, 14 Sep 2020 07:30:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UlWNs8He" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725958AbgINHaL (ORCPT ); Mon, 14 Sep 2020 03:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbgINHaB (ORCPT ); Mon, 14 Sep 2020 03:30:01 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EDDFC06174A for ; Mon, 14 Sep 2020 00:30:01 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id v14so3566805pjd.4 for ; Mon, 14 Sep 2020 00:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ENDIM6dnvSAiFtaN1D3BYH8eMYv3Y8ssamdogUTlFwI=; b=UlWNs8HeAReRuUxmTmSQgFZV3smy3z0lgDpSze0qzC+0954LOBP18VlteG4/8DNwtT ZhIVJ4D5aiT7rOCrc3aMiqTR5m+z0NufFtUgKXYlbyxmYQSkQH+e4iP6d+By+ebe7qMD FPrj1Kz8aKbkGVHUZXaOezJT0gcvJVBIOXtEAPe/oTh8dAxvAItXL8sJaCS64mhqkbFd 2Kj6aNmTMubgzHniC2dkq9s7wQXVkBujfjZZwvBXCiABHUN2j1nKzykt1kC/AhnMSkjg /o2EGEVY50OEtsf5et4LQJYQRIoy3zxBibdrxeTAsir0lnUbRyGeBqxunnqYBcH7iKS3 OVhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ENDIM6dnvSAiFtaN1D3BYH8eMYv3Y8ssamdogUTlFwI=; b=udKpECw+mqtBiJOVIfASAHFUZiyatSEWa7pqeYnLXETYXtn+ut5HD3HTImWgmPy2gp 7Vp/6yBJhHjoDELOR7dESsYk3KsCVOeUaNPdKuFipCBZmEr9BUi3WmjBLl4J2UDIq0gx 8kUFwqS9KNdQIsID5KpjlSVCZAKKkm7pn05oFnrMDuWIkl4Elt766yQDCfyYKWE3LiEm TIZpvBPIiMnd7d2DQSd4AD8bTDWasMPDlEb6XLx/LpJUcLYGJePMhqIqHoo/iBGVNIp5 dV+gfEPTaOgyKHs5t1R+jhBoHw6sW3XZnC+bjQaowHrVAwuxsjw2jTBq+k01nQ+RxYIR 6YAQ== X-Gm-Message-State: AOAM531sUGo7bMWnpOgYGCS6+Fl/z6BIUS+69/SBz3qlKdpIGBVsNpBy TahAskQc637WwSbjzN+5aSw= X-Google-Smtp-Source: ABdhPJxuon8x+XNgQZJGew0diVAHTFmXcRG3ceOCegYsDCksytqapfuPJKP1fR3UdXyYkrSZ1y9NoQ== X-Received: by 2002:a17:90a:d704:: with SMTP id y4mr13393876pju.159.1600068600629; Mon, 14 Sep 2020 00:30:00 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:00 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 02/20] net: amd-xgbe: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:21 +0530 Message-Id: <20200914072939.803280-3-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 19 +++++++++---------- drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 11 +++++------ drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 11 +++++------ 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 4ba75551cb17..2709a2db5657 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -403,9 +403,9 @@ static bool xgbe_ecc_ded(struct xgbe_prv_data *pdata, unsigned long *period, return false; } -static void xgbe_ecc_isr_task(unsigned long data) +static void xgbe_ecc_isr_task(struct tasklet_struct *t) { - struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; + struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_ecc); unsigned int ecc_isr; bool stop = false; @@ -468,14 +468,14 @@ static irqreturn_t xgbe_ecc_isr(int irq, void *data) if (pdata->isr_as_tasklet) tasklet_schedule(&pdata->tasklet_ecc); else - xgbe_ecc_isr_task((unsigned long)pdata); + xgbe_ecc_isr_task(&pdata->tasklet_ecc); return IRQ_HANDLED; } -static void xgbe_isr_task(unsigned long data) +static void xgbe_isr_task(struct tasklet_struct *t) { - struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; + struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_dev); struct xgbe_hw_if *hw_if = &pdata->hw_if; struct xgbe_channel *channel; unsigned int dma_isr, dma_ch_isr; @@ -582,7 +582,7 @@ static void xgbe_isr_task(unsigned long data) /* If there is not a separate ECC irq, handle it here */ if (pdata->vdata->ecc_support && (pdata->dev_irq == pdata->ecc_irq)) - xgbe_ecc_isr_task((unsigned long)pdata); + xgbe_ecc_isr_task(&pdata->tasklet_ecc); /* If there is not a separate I2C irq, handle it here */ if (pdata->vdata->i2c_support && (pdata->dev_irq == pdata->i2c_irq)) @@ -607,7 +607,7 @@ static irqreturn_t xgbe_isr(int irq, void *data) if (pdata->isr_as_tasklet) tasklet_schedule(&pdata->tasklet_dev); else - xgbe_isr_task((unsigned long)pdata); + xgbe_isr_task(&pdata->tasklet_dev); return IRQ_HANDLED; } @@ -991,9 +991,8 @@ static int xgbe_request_irqs(struct xgbe_prv_data *pdata) unsigned int i; int ret; - tasklet_init(&pdata->tasklet_dev, xgbe_isr_task, (unsigned long)pdata); - tasklet_init(&pdata->tasklet_ecc, xgbe_ecc_isr_task, - (unsigned long)pdata); + tasklet_setup(&pdata->tasklet_dev, xgbe_isr_task); + tasklet_setup(&pdata->tasklet_ecc, xgbe_ecc_isr_task); ret = devm_request_irq(pdata->dev, pdata->dev_irq, xgbe_isr, 0, netdev_name(netdev), pdata); diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c b/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c index 4d9062d35930..22d4fc547a0a 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c @@ -274,9 +274,9 @@ static void xgbe_i2c_clear_isr_interrupts(struct xgbe_prv_data *pdata, XI2C_IOREAD(pdata, IC_CLR_STOP_DET); } -static void xgbe_i2c_isr_task(unsigned long data) +static void xgbe_i2c_isr_task(struct tasklet_struct *t) { - struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; + struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_i2c); struct xgbe_i2c_op_state *state = &pdata->i2c.op_state; unsigned int isr; @@ -324,7 +324,7 @@ static irqreturn_t xgbe_i2c_isr(int irq, void *data) if (pdata->isr_as_tasklet) tasklet_schedule(&pdata->tasklet_i2c); else - xgbe_i2c_isr_task((unsigned long)pdata); + xgbe_i2c_isr_task(&pdata->tasklet_i2c); return IRQ_HANDLED; } @@ -369,7 +369,7 @@ static void xgbe_i2c_set_target(struct xgbe_prv_data *pdata, unsigned int addr) static irqreturn_t xgbe_i2c_combined_isr(struct xgbe_prv_data *pdata) { - xgbe_i2c_isr_task((unsigned long)pdata); + xgbe_i2c_isr_task(&pdata->tasklet_i2c); return IRQ_HANDLED; } @@ -462,8 +462,7 @@ static int xgbe_i2c_start(struct xgbe_prv_data *pdata) /* If we have a separate I2C irq, enable it */ if (pdata->dev_irq != pdata->i2c_irq) { - tasklet_init(&pdata->tasklet_i2c, xgbe_i2c_isr_task, - (unsigned long)pdata); + tasklet_setup(&pdata->tasklet_i2c, xgbe_i2c_isr_task); ret = devm_request_irq(pdata->dev, pdata->i2c_irq, xgbe_i2c_isr, 0, pdata->i2c_name, diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c index 8a3a60bb2688..93ef5a30cb8d 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c @@ -688,9 +688,9 @@ static void xgbe_an73_isr(struct xgbe_prv_data *pdata) } } -static void xgbe_an_isr_task(unsigned long data) +static void xgbe_an_isr_task(struct tasklet_struct *t) { - struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; + struct xgbe_prv_data *pdata = from_tasklet(pdata, t, tasklet_an); netif_dbg(pdata, intr, pdata->netdev, "AN interrupt received\n"); @@ -715,14 +715,14 @@ static irqreturn_t xgbe_an_isr(int irq, void *data) if (pdata->isr_as_tasklet) tasklet_schedule(&pdata->tasklet_an); else - xgbe_an_isr_task((unsigned long)pdata); + xgbe_an_isr_task(&pdata->tasklet_an); return IRQ_HANDLED; } static irqreturn_t xgbe_an_combined_isr(struct xgbe_prv_data *pdata) { - xgbe_an_isr_task((unsigned long)pdata); + xgbe_an_isr_task(&pdata->tasklet_an); return IRQ_HANDLED; } @@ -1414,8 +1414,7 @@ static int xgbe_phy_start(struct xgbe_prv_data *pdata) /* If we have a separate AN irq, enable it */ if (pdata->dev_irq != pdata->an_irq) { - tasklet_init(&pdata->tasklet_an, xgbe_an_isr_task, - (unsigned long)pdata); + tasklet_setup(&pdata->tasklet_an, xgbe_an_isr_task); ret = devm_request_irq(pdata->dev, pdata->an_irq, xgbe_an_isr, 0, pdata->an_name, From patchwork Mon Sep 14 07:29:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2DC5C433E2 for ; Mon, 14 Sep 2020 07:30:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADC0D217BA for ; Mon, 14 Sep 2020 07:30:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EOA6pEVN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726045AbgINHaV (ORCPT ); Mon, 14 Sep 2020 03:30:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbgINHaJ (ORCPT ); Mon, 14 Sep 2020 03:30:09 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5A05C061788 for ; Mon, 14 Sep 2020 00:30:08 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id c196so12017415pfc.0 for ; Mon, 14 Sep 2020 00:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=htQObXixxwaiINxkL0CCtd2DyfiXYaJaLxNSxLo3xak=; b=EOA6pEVNg9tsVywbfoluXq3VG7pm5+A6AVxel11ogIogem44L4nco9Z0UbN8UR9PyH 5zXSg/p6zq3TwmIUqsg8eif0HC29VL/ExJ+Qaol0LrSJOD7barvmU/5ae5I2wv+/jZ7K QnzS+C7hNKbmY6zyUFmGJgLwkstCT7jzpe338ATMuyRdRcnIFNpMS+Z7pmmbSi8Zq//g Bh7ryj/hk2wB0krfXNEcHPvK0j+ekG3GmWMXvYUZmu89Fg2jbKxB6yZPlKgKg3BKiPOH xQ45L3/Hqy0oCe6WFBmV4FNb1gPhZz68cjdGyxe9Xe82FeeTQeS44RconPDML2eQdqAU 10mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=htQObXixxwaiINxkL0CCtd2DyfiXYaJaLxNSxLo3xak=; b=iOFiu5XRzh5AFVTkpvv+vDOR4t6IDcGmir0r5FSjETQ4JRal7i4YmdQdF7UJ3+SLFk 1IUHrw+4hf/9JX7EUQK9jnTlPFWPNAZ6xJOH4V/kM/YR6fSShrYhaPXl1GB8YWy+nLrc 7lxfR3Z77pAkRH3mQqgAZitlqSN/cV7pHknHtZU6GeHp793H5erlFfoyyNA1RVn+dFaN VzgZvIgXqEjmIL+sopqOYSregIEZ/YBWlsdIG8BTu4UW94EKB2ghtzx/YKC3lD74OBWL 9AICAT54dEdbnzSxLYiXeN0xQ7tCt1qHpb+KToyYUHQz6MNa+5EEQqXMmyHfDjywLe8m 0pig== X-Gm-Message-State: AOAM532jda5GyvQ0Ktro/THkVbS6/xvVyt6xXRN/uW/PM2i0fUFx133+ S2tW7Jww4CVPRHM4BDEYSJ4= X-Google-Smtp-Source: ABdhPJwX+HAqER6fOqRBWvJgerV5Ev1lqArdG93j7tG19i7v+EcCc9X6o9Y5RVP13DVGtDPLkXI0Cg== X-Received: by 2002:a63:161e:: with SMTP id w30mr9739417pgl.255.1600068608373; Mon, 14 Sep 2020 00:30:08 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:07 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 04/20] net: macb: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:23 +0530 Message-Id: <20200914072939.803280-5-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/cadence/macb_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 6761f404b8aa..830c537bc08c 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -1466,9 +1466,9 @@ static int macb_poll(struct napi_struct *napi, int budget) return work_done; } -static void macb_hresp_error_task(unsigned long data) +static void macb_hresp_error_task(struct tasklet_struct *t) { - struct macb *bp = (struct macb *)data; + struct macb *bp = from_tasklet(bp, t, hresp_err_tasklet); struct net_device *dev = bp->dev; struct macb_queue *queue; unsigned int q; @@ -4560,8 +4560,7 @@ static int macb_probe(struct platform_device *pdev) goto err_out_unregister_mdio; } - tasklet_init(&bp->hresp_err_tasklet, macb_hresp_error_task, - (unsigned long)bp); + tasklet_setup(&bp->hresp_err_tasklet, macb_hresp_error_task); netdev_info(dev, "Cadence %s rev 0x%08x at 0x%08lx irq %d (%pM)\n", macb_is_gem(bp) ? "GEM" : "MACB", macb_readl(bp, MID), From patchwork Mon Sep 14 07:29:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 882FFC433E2 for ; Mon, 14 Sep 2020 07:30:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45F9720756 for ; Mon, 14 Sep 2020 07:30:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rR0+wGoT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbgINHam (ORCPT ); Mon, 14 Sep 2020 03:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbgINHaQ (ORCPT ); Mon, 14 Sep 2020 03:30:16 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67DCBC06174A for ; Mon, 14 Sep 2020 00:30:16 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id b124so11832118pfg.13 for ; Mon, 14 Sep 2020 00:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9iKDMGFwxmVymk36amEjUHjxbmRd1jFiTa9g1VE08kA=; b=rR0+wGoTnghNP7LYAscx71GS5aDLncMuZQrAXjMpkgPchB9UIdDiPTQwyu2wDADF+/ YFeV30uLUnk4UvFAr4Kq4CafKxsdFu6WpbK6Nfsnz9OpYmZ6noT4gHzbJ82nPHbe7zwg /QOALjlAsRhTwf1AjXfhQcmIa2zpEx5AZJ4QZqUG9zqej+rzajSE8f6neWUW0tL4p3yy pJAfTl5DQG2LnADp+3p3noyfqxgRGkcGGfc2GYCAXLBJ5ASSUh0336nrsjXs/nHOscdj UKMevBlZ9txOWIyscaJtR/p3/aR/rmOXtW94Uwu/UI3uOzt8OYN37wKCBUJoEPQSfwwj FsUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9iKDMGFwxmVymk36amEjUHjxbmRd1jFiTa9g1VE08kA=; b=GyyELXuBrhWRy4W+msd/BoHfHfqwbJbI3mAM9Db117Z4OAecLQhOJguZye6deC4fRa NMMJV3hSS7sCBDravOZeB+SZOw3UwLuIgIUcfCMJM7g3OYtRfK0YEhlOrKzwwfmisb3n rYSf+pi0lxHf266mO1YLxtUNITL/E9usRpFsw7HNcDNPjuGytTpVh8TyJL2CzBM+zOeR VxkftOuaDSBBwoOB1sbzR9kKVakVDbUeizmQHEtEPVq1k/tFVgGph61joccSJ+15Wqe1 CRDUug3iwv0etOhpiCRqHlcbVdCij9fbjSXhz33P0MpL4VkzPnLSVRfovutMRO04tBgA lm4A== X-Gm-Message-State: AOAM532C/mgMN9E1HyJn5+H/eKO7LLsyZUiFDlEADzKlN5DAA4N63SG/ zmo/2e73a/0RXrLJIL3wxLc= X-Google-Smtp-Source: ABdhPJx1izw+AKJxK3KIGxRuSM4KyvJgzG19u+xQkWfdqhaaFQnM/qxrqLRTpSKQnSo0cKIJiRf14w== X-Received: by 2002:a65:624e:: with SMTP id q14mr10190777pgv.307.1600068615949; Mon, 14 Sep 2020 00:30:15 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:15 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 06/20] chelsio: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:25 +0530 Message-Id: <20200914072939.803280-7-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/chelsio/cxgb/sge.c | 12 ++++++++---- drivers/net/ethernet/chelsio/cxgb3/sge.c | 18 ++++++++---------- drivers/net/ethernet/chelsio/cxgb4/sge.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c index 47b5c8e2104b..5f999187038c 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c @@ -239,8 +239,10 @@ struct sched { unsigned int num; /* num skbs in per port queues */ struct sched_port p[MAX_NPORTS]; struct tasklet_struct sched_tsk;/* tasklet used to run scheduler */ + struct sge *sge; }; -static void restart_sched(unsigned long); + +static void restart_sched(struct tasklet_struct *t); /* @@ -378,7 +380,8 @@ static int tx_sched_init(struct sge *sge) return -ENOMEM; pr_debug("tx_sched_init\n"); - tasklet_init(&s->sched_tsk, restart_sched, (unsigned long) sge); + tasklet_setup(&s->sched_tsk, restart_sched); + s->sge = sge; sge->tx_sched = s; for (i = 0; i < MAX_NPORTS; i++) { @@ -1301,9 +1304,10 @@ static inline void reclaim_completed_tx(struct sge *sge, struct cmdQ *q) * Called from tasklet. Checks the scheduler for any * pending skbs that can be sent. */ -static void restart_sched(unsigned long arg) +static void restart_sched(struct tasklet_struct *t) { - struct sge *sge = (struct sge *) arg; + struct sched *s = from_tasklet(s, t, sched_tsk); + struct sge *sge = s->sge; struct adapter *adapter = sge->adapter; struct cmdQ *q = &sge->cmdQ[0]; struct sk_buff *skb; diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c index 6dabbf1502c7..4dadb04276d5 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c @@ -1516,14 +1516,14 @@ static int ctrl_xmit(struct adapter *adap, struct sge_txq *q, /** * restart_ctrlq - restart a suspended control queue - * @qs: the queue set cotaining the control queue + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx control queue. */ -static void restart_ctrlq(unsigned long data) +static void restart_ctrlq(struct tasklet_struct *t) { struct sk_buff *skb; - struct sge_qset *qs = (struct sge_qset *)data; + struct sge_qset *qs = from_tasklet(qs, t, txq[TXQ_CTRL].qresume_tsk); struct sge_txq *q = &qs->txq[TXQ_CTRL]; spin_lock(&q->lock); @@ -1733,14 +1733,14 @@ again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK); /** * restart_offloadq - restart a suspended offload queue - * @qs: the queue set cotaining the offload queue + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx offload queue. */ -static void restart_offloadq(unsigned long data) +static void restart_offloadq(struct tasklet_struct *t) { struct sk_buff *skb; - struct sge_qset *qs = (struct sge_qset *)data; + struct sge_qset *qs = from_tasklet(qs, t, txq[TXQ_OFLD].qresume_tsk); struct sge_txq *q = &qs->txq[TXQ_OFLD]; const struct port_info *pi = netdev_priv(qs->netdev); struct adapter *adap = pi->adapter; @@ -3084,10 +3084,8 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, skb_queue_head_init(&q->txq[i].sendq); } - tasklet_init(&q->txq[TXQ_OFLD].qresume_tsk, restart_offloadq, - (unsigned long)q); - tasklet_init(&q->txq[TXQ_CTRL].qresume_tsk, restart_ctrlq, - (unsigned long)q); + tasklet_setup(&q->txq[TXQ_OFLD].qresume_tsk, restart_offloadq); + tasklet_setup(&q->txq[TXQ_CTRL].qresume_tsk, restart_ctrlq); q->fl[0].gen = q->fl[1].gen = 1; q->fl[0].size = p->fl_size; diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 869431a1eedd..af4839e7c07e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -2660,15 +2660,15 @@ static int ctrl_xmit(struct sge_ctrl_txq *q, struct sk_buff *skb) /** * restart_ctrlq - restart a suspended control queue - * @data: the control queue to restart + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx control queue. */ -static void restart_ctrlq(unsigned long data) +static void restart_ctrlq(struct tasklet_struct *t) { struct sk_buff *skb; unsigned int written = 0; - struct sge_ctrl_txq *q = (struct sge_ctrl_txq *)data; + struct sge_ctrl_txq *q = from_tasklet(q, t, qresume_tsk); spin_lock(&q->sendq.lock); reclaim_completed_tx_imm(&q->q); @@ -2961,13 +2961,13 @@ static int ofld_xmit(struct sge_uld_txq *q, struct sk_buff *skb) /** * restart_ofldq - restart a suspended offload queue - * @data: the offload queue to restart + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx offload queue. */ -static void restart_ofldq(unsigned long data) +static void restart_ofldq(struct tasklet_struct *t) { - struct sge_uld_txq *q = (struct sge_uld_txq *)data; + struct sge_uld_txq *q = from_tasklet(q, t, qresume_tsk); spin_lock(&q->sendq.lock); q->full = 0; /* the queue actually is completely empty now */ @@ -4580,7 +4580,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq, init_txq(adap, &txq->q, FW_EQ_CTRL_CMD_EQID_G(ntohl(c.cmpliqid_eqid))); txq->adap = adap; skb_queue_head_init(&txq->sendq); - tasklet_init(&txq->qresume_tsk, restart_ctrlq, (unsigned long)txq); + tasklet_setup(&txq->qresume_tsk, restart_ctrlq); txq->full = 0; return 0; } @@ -4670,7 +4670,7 @@ int t4_sge_alloc_uld_txq(struct adapter *adap, struct sge_uld_txq *txq, txq->q.q_type = CXGB4_TXQ_ULD; txq->adap = adap; skb_queue_head_init(&txq->sendq); - tasklet_init(&txq->qresume_tsk, restart_ofldq, (unsigned long)txq); + tasklet_setup(&txq->qresume_tsk, restart_ofldq); txq->full = 0; txq->mapping_err = 0; return 0; From patchwork Mon Sep 14 07:29:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28D9EC433E2 for ; Mon, 14 Sep 2020 07:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF42020756 for ; Mon, 14 Sep 2020 07:30:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ThzXhUyL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726094AbgINHa6 (ORCPT ); Mon, 14 Sep 2020 03:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbgINHaZ (ORCPT ); Mon, 14 Sep 2020 03:30:25 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF5EFC06178A for ; Mon, 14 Sep 2020 00:30:23 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id u13so10851652pgh.1 for ; Mon, 14 Sep 2020 00:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JO+T9dbCdHvGYLM7G+u1+Z2xx4BQwKAORkQ/sO6UQkE=; b=ThzXhUyLHORpKwbQSBro4e7lObLX4X0q2Mac1ocPSEppHEddJpaR6LbRx92SRH1Gtl yqexmYedRx5O9I97wFdzTv5/DJCVNaiDzkOwuP3tgYBthmW3h3Ml5/jxpye5lLANFJIO 4dV4uf+SzPkS9QHs4kVomHv3v/PM3yb6epBtxaMlOUXKkNqa9knd5jzX5yO6aBd81bjg qA/uAM8BFGqKPYHX/71Ccik1eu+yoU51S79KEhH5OCCJE0zVg4AQleY+C0Hoax7BbqVB EFpX2MJ91ONvyw+YTHqTSt8X2mKqJKKPkeacHNb+ErMoQ/L6nyol267Qwu3U4Y4OPB+O T98w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JO+T9dbCdHvGYLM7G+u1+Z2xx4BQwKAORkQ/sO6UQkE=; b=MM3Wia2XHp4SHLZ7R50mufUAfOhsvyA2EnOS8mfzT0IT4cN8dmJHZLE6Ijl6uuFr0H RDHrMmqziuMzSMYI3ZtETwwF/h+Ntdkk99Y/Yaqh24KCgCDdA+Zz0ZcjJE42UhCI+pPU CQlpvsRJcHxhUom/Hsz93KkUZfsS//APHnmvy3ftdyeYXwy3GvMArYky8TD7QGQjZCkM B6tokVUcTzpxENhaMq38zyif5p5LzsKgWkq5tcO/rd3MyGwAjV3V4evMSOgT/MMDNQxY whFZQVrPglNsIwSRk+aIQ2it9ZNPZcT10CxGw3EsvDHMl4BbiwY7ypIKVK+BVnbXgHKN D1Og== X-Gm-Message-State: AOAM5324v2XPPMspaGEvk+bY2U/S+RQyZOSf1590+4UAdwCJOKsOIKPY ByxnJY6Nsv9XbSt/E3xoBz0= X-Google-Smtp-Source: ABdhPJyiNkbXb/Wrgz4FOiRWp47YN1uP9O1iJDzlOmEE4bGiyPEX0xetGC4vucxG5+yn1OOF19KyTg== X-Received: by 2002:a63:4b63:: with SMTP id k35mr10108706pgl.142.1600068623620; Mon, 14 Sep 2020 00:30:23 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:23 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 08/20] net: hinic: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:27 +0530 Message-Id: <20200914072939.803280-9-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c index ca8cb68a8d20..f304a5b16d75 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c @@ -370,9 +370,9 @@ static void eq_irq_work(struct work_struct *work) * ceq_tasklet - the tasklet of the EQ that received the event * @ceq_data: the eq **/ -static void ceq_tasklet(unsigned long ceq_data) +static void ceq_tasklet(struct tasklet_struct *t) { - struct hinic_eq *ceq = (struct hinic_eq *)ceq_data; + struct hinic_eq *ceq = from_tasklet(ceq, t, ceq_tasklet); eq_irq_handler(ceq); } @@ -782,8 +782,7 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwif *hwif, INIT_WORK(&aeq_work->work, eq_irq_work); } else if (type == HINIC_CEQ) { - tasklet_init(&eq->ceq_tasklet, ceq_tasklet, - (unsigned long)eq); + tasklet_setup(&eq->ceq_tasklet, ceq_tasklet); } /* set the attributes of the msix entry */ From patchwork Mon Sep 14 07:29:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF723C43461 for ; Mon, 14 Sep 2020 07:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7884A20756 for ; Mon, 14 Sep 2020 07:31:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iDdq5CPC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726106AbgINHbE (ORCPT ); Mon, 14 Sep 2020 03:31:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbgINHac (ORCPT ); Mon, 14 Sep 2020 03:30:32 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC12EC06178C for ; Mon, 14 Sep 2020 00:30:31 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id mm21so5018308pjb.4 for ; Mon, 14 Sep 2020 00:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2CEMibo/3pmE65avwd9BlqeQS4O/HCjh0nWtrS3bnHs=; b=iDdq5CPCzBjGutOfWaZWd00hg/HoXVOyh2qzixV7oyXpWrh30ir0NWeHg5+NL9WqPy cxqipdlssfErkqL283sfmk9DICHleVUWSf6WPq8+HzF1IGCWYb9dw/vCugODrAkYFUa4 om3Iev6HrzziCQuT5HjxCQqwZyXiCbP4gx0j6FppbHtKvUttXu71QqArZ0DiVIMwDMRO 4Wl6c6GEeQpVph7prYkOrCuWBSpZh+l/mPAkmZ4ajnUcZYNXAqlAO0TTxT3Jbm487fw/ 6Yu3rme5+BIZw0+yWyJq28YvdtwNPKaD0RgRixR77G2bKsCZoluq4hFAT3f9QISG1Uf8 4ZRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2CEMibo/3pmE65avwd9BlqeQS4O/HCjh0nWtrS3bnHs=; b=h0rRXFxZl3Nl4g3qjusW99f9a+MF/rX7YwE/XIoFcUPZuqB/e2eOztuNvYOsVflhD6 feW9TAJuicoYs5CWnqz84Fe00g7pcIdVq0gzDgkxxKspePiLTmOxDgOpB8hS5omaNt7d XzozD5SHZBO2Nl1QNMM5v7exZbZGgX6hIo0IHvsFjVKdEeoFMYHWrxZQRTLgRWKKbAKr nJMLD1nUUOvi1HLPIccW+W2rNwAnvtwDYJewOkAD1WgfHQrZ9RYJE/U9d0d5L4yFBQ+o p0t14uRF3crhxOWBxUMWnOrz5j6JOAGzWM+76mgGkFd1XoS8RIfMVS01mgKWWIXr4vgj T4Ng== X-Gm-Message-State: AOAM531Cw2ijneRAwv12IOZsHL0a/r8duwVxBtyNRbG3dzNlK6JviD9p 4EP+bLJgrZjSxTHF/pZU4nk= X-Google-Smtp-Source: ABdhPJwi2ULttJ/1Qe2K2uamjuS6Nl62EMp/k5pcuUAhsBFvr7aNn1pxzDD31/EcZTENkN+9JsG6cQ== X-Received: by 2002:a17:90a:fa8b:: with SMTP id cu11mr12639092pjb.10.1600068631561; Mon, 14 Sep 2020 00:30:31 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:31 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 10/20] ibmvnic: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:29 +0530 Message-Id: <20200914072939.803280-11-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/ibm/ibmvnic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index d3a774331afc..1a3e65bae17f 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4810,9 +4810,9 @@ static irqreturn_t ibmvnic_interrupt(int irq, void *instance) return IRQ_HANDLED; } -static void ibmvnic_tasklet(void *data) +static void ibmvnic_tasklet(struct tasklet_struct *t) { - struct ibmvnic_adapter *adapter = data; + struct ibmvnic_adapter *adapter = from_tasklet(adapter, t, tasklet); struct ibmvnic_crq_queue *queue = &adapter->crq; union ibmvnic_crq *crq; unsigned long flags; @@ -4947,8 +4947,7 @@ static int init_crq_queue(struct ibmvnic_adapter *adapter) retrc = 0; - tasklet_init(&adapter->tasklet, (void *)ibmvnic_tasklet, - (unsigned long)adapter); + tasklet_setup(&adapter->tasklet, (void *)ibmvnic_tasklet); netdev_dbg(adapter->netdev, "registering irq 0x%x\n", vdev->irq); snprintf(crq->name, sizeof(crq->name), "ibmvnic-%x", From patchwork Mon Sep 14 07:29:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35F92C43461 for ; Mon, 14 Sep 2020 07:31:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEA8920756 for ; Mon, 14 Sep 2020 07:31:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hP3gQfbr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726119AbgINHbV (ORCPT ); Mon, 14 Sep 2020 03:31:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726063AbgINHak (ORCPT ); Mon, 14 Sep 2020 03:30:40 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E77C061788 for ; Mon, 14 Sep 2020 00:30:39 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id o16so5024813pjr.2 for ; Mon, 14 Sep 2020 00:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bTZLpe1Z4Prl4QDL59Sva1UVH5F2B9wvbDVNz1voc8s=; b=hP3gQfbrNLudxBTEM2L/fPQ8c/gIXMjrbcM8aZlxK6vy6KWCwQaVlKHdcmF1Nnrwpa bFrPr4F7etpEQoeeTBED1i/S3lzGJ6M8DeBjjIMoyt3cKnDmAgjkC1iCO5DsEM12i/Ps oeIQmFgvNQ0lcPXNFvjm2+c2GghHFPUfmnqeG7iuzNDUIFjmRnBb3Yc2hSsUzgRxvKEM ff9r5iRux8zcSbRT+Z+pBVaQmOUsUxJQK43YMxeI8fuK6pqu2EjIbKHr3Yz59Ssinq9W /o2CLC1FlUNIbLSxgqSr5KhM4YyA5FECKIP3WimbC8GXRZI65aa/pWMzGn1OaRqeOITh olCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bTZLpe1Z4Prl4QDL59Sva1UVH5F2B9wvbDVNz1voc8s=; b=H0ghtDLByhbCow1m+KV60ddnQhhT5NW7Vz4Pw7c+MJK4Wm5QXmqMXGTM0JmdwKV4ip rkQ6PVOuQieMFBlrqiXTyM75D6kkD6ghQIKrxMg8FYmuS/a48euqN1q3vh6W5WvqAqIG KqNdx+/t6OurzpPoUkNtNdNi92HzosCrm5B3QHiS6oWUA0sEZmtA3S9PIf+CecdlctIZ uTnbBVTV1cg8Mp62F5jctCAbaZQqNhAl62CzQQ8fXLjFPLXrTmOhIvaDjLs+yPPhXNEC WPP36zxjwBX1LNTtkqZHwv/A2qezi0hGXC3//YnYNBc0cwU7W4zvhiHRSaT27mSFbDmA sKyA== X-Gm-Message-State: AOAM533U/EEFO4+jOOVBsIbnDituS0e3hHucOet56gZn2XjyDpYK9YnJ MAsJxHiF4y9IEdMNq35PfKY= X-Google-Smtp-Source: ABdhPJzEgi9WzX/HpoE1cQFgxLdDcLr4o7c/r0AUs+uvCOhX6rvTeO6j4B0B3gl7YW2CJDhNEUHdjg== X-Received: by 2002:a17:90a:ea0c:: with SMTP id w12mr12723348pjy.65.1600068639336; Mon, 14 Sep 2020 00:30:39 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:38 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 12/20] net: skge: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:31 +0530 Message-Id: <20200914072939.803280-13-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/marvell/skge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index 6a930351cb23..8a9c0f490bfb 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c @@ -3338,9 +3338,9 @@ static void skge_error_irq(struct skge_hw *hw) * because accessing phy registers requires spin wait which might * cause excess interrupt latency. */ -static void skge_extirq(unsigned long arg) +static void skge_extirq(struct tasklet_struct *t) { - struct skge_hw *hw = (struct skge_hw *) arg; + struct skge_hw *hw = from_tasklet(hw, t, phy_task); int port; for (port = 0; port < hw->ports; port++) { @@ -3927,7 +3927,7 @@ static int skge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) hw->pdev = pdev; spin_lock_init(&hw->hw_lock); spin_lock_init(&hw->phy_lock); - tasklet_init(&hw->phy_task, skge_extirq, (unsigned long) hw); + tasklet_setup(&hw->phy_task, skge_extirq); hw->regs = ioremap(pci_resource_start(pdev, 0), 0x4000); if (!hw->regs) { From patchwork Mon Sep 14 07:29:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F285FC433E2 for ; Mon, 14 Sep 2020 07:31:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A85E421D24 for ; Mon, 14 Sep 2020 07:31:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LtL6kIZY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726129AbgINHba (ORCPT ); Mon, 14 Sep 2020 03:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbgINHar (ORCPT ); Mon, 14 Sep 2020 03:30:47 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856ABC06174A for ; Mon, 14 Sep 2020 00:30:47 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id mm21so5018741pjb.4 for ; Mon, 14 Sep 2020 00:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TWaq6bxLpQJZ/zgZGuC4pdM84E+FX91GixyZIz1H00g=; b=LtL6kIZYy+dCikd4hEqcaIhD+aLpxc1BIlg/P/FDcMZNVwpYZy0cy9Lg1WWedFZLs8 9FSZoez1Sq7FCzqvcLkDW31sSkmtMNl1sDjERU9p1ZVF0sTQfqHOhjhCWNxtG6C+uMeC Jzlh9BfkdwSra99eTDWJiFBCL5PHQZQbC5hdissFvE27ZO4Un27F60tVAgBFvSUP2GP3 J6Cc+DS3cQju3mKAmSfBjdUMW0nI2VuTwq8BhQAj8okF/F0q3cktzUn2kmv8xS/U5NVG WR82S4f52hknNC96evBJYYy24UzUo6jxXQYUKUDtehSQZQELV/pOu9iN3e0jYfdFGc9h hzKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TWaq6bxLpQJZ/zgZGuC4pdM84E+FX91GixyZIz1H00g=; b=Gd2YAGXZmPPV5Camy7h0Brvtx6b10WIy6BdRNFUuq/8SRnZ7Wfk+aaC0wZlJ9TK6oi TJTRUVVf0g8bbydO8OGC1Q5hycI5Pe5wlaeX9JCfxPont6G+idlZ32Yk7QgQ0UtLB699 YmC/+iaeTnZBD7o06JRE8gqXi/A/NY8c9c7tyZndbZWD+4tzQHzBoG4PcX3HB5WBHFYm ngy6dv1vuRb/tiPVkvbfi2oZfSV4vmILXAIbZMc0X88aoK2gd9klYPOKn45BrtmnMmAb r6qiDziG1PVvIe/KdmIYx38eCbL6SxtFLkiRSzEpaZEJkS9masLdhWXoKLn/+P5KoGKZ BzpQ== X-Gm-Message-State: AOAM533LPTOK3tjmEm3S4rwkILUdfgnx+YtqPblX8Dmy2TI1tZlggeXj 4R1P7Xzaub8HhqkAfaui3Jk= X-Google-Smtp-Source: ABdhPJw5sPRJ0yM+90b1kMbcq6j7aeRs4V//zmMc/zoDUDnIVHZagq3V5cSVS495uL7XcouJrvNN6A== X-Received: by 2002:a17:90a:db49:: with SMTP id u9mr12604541pjx.90.1600068647166; Mon, 14 Sep 2020 00:30:47 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:46 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 14/20] net: micrel: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:33 +0530 Message-Id: <20200914072939.803280-15-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/micrel/ks8842.c | 17 ++++++++--------- drivers/net/ethernet/micrel/ksz884x.c | 14 ++++++-------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c index f3f6dfe3eddc..caa251d0e381 100644 --- a/drivers/net/ethernet/micrel/ks8842.c +++ b/drivers/net/ethernet/micrel/ks8842.c @@ -587,10 +587,10 @@ static int __ks8842_start_new_rx_dma(struct net_device *netdev) return err; } -static void ks8842_rx_frame_dma_tasklet(unsigned long arg) +static void ks8842_rx_frame_dma_tasklet(struct tasklet_struct *t) { - struct net_device *netdev = (struct net_device *)arg; - struct ks8842_adapter *adapter = netdev_priv(netdev); + struct ks8842_adapter *adapter = from_tasklet(adapter, t, dma_rx.tasklet); + struct net_device *netdev = adapter->netdev; struct ks8842_rx_dma_ctl *ctl = &adapter->dma_rx; struct sk_buff *skb = ctl->skb; dma_addr_t addr = sg_dma_address(&ctl->sg); @@ -720,10 +720,10 @@ static void ks8842_handle_rx_overrun(struct net_device *netdev, netdev->stats.rx_fifo_errors++; } -static void ks8842_tasklet(unsigned long arg) +static void ks8842_tasklet(struct tasklet_struct *t) { - struct net_device *netdev = (struct net_device *)arg; - struct ks8842_adapter *adapter = netdev_priv(netdev); + struct ks8842_adapter *adapter = from_tasklet(adapter, t, tasklet); + struct net_device *netdev = adapter->netdev; u16 isr; unsigned long flags; u16 entry_bank; @@ -953,8 +953,7 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev) goto err; } - tasklet_init(&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet, - (unsigned long)netdev); + tasklet_setup(&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet); return 0; err: @@ -1173,7 +1172,7 @@ static int ks8842_probe(struct platform_device *pdev) adapter->dma_tx.channel = -1; } - tasklet_init(&adapter->tasklet, ks8842_tasklet, (unsigned long)netdev); + tasklet_setup(&adapter->tasklet, ks8842_tasklet); spin_lock_init(&adapter->lock); netdev->netdev_ops = &ks8842_netdev_ops; diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index bb646b65cc95..5130507bbf54 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c @@ -5159,9 +5159,9 @@ static int dev_rcv_special(struct dev_info *hw_priv) return received; } -static void rx_proc_task(unsigned long data) +static void rx_proc_task(struct tasklet_struct *t) { - struct dev_info *hw_priv = (struct dev_info *) data; + struct dev_info *hw_priv = from_tasklet(hw_priv, t, rx_tasklet); struct ksz_hw *hw = &hw_priv->hw; if (!hw->enabled) @@ -5181,9 +5181,9 @@ static void rx_proc_task(unsigned long data) } } -static void tx_proc_task(unsigned long data) +static void tx_proc_task(struct tasklet_struct *t) { - struct dev_info *hw_priv = (struct dev_info *) data; + struct dev_info *hw_priv = from_tasklet(hw_priv, t, tx_tasklet); struct ksz_hw *hw = &hw_priv->hw; hw_ack_intr(hw, KS884X_INT_TX_MASK); @@ -5436,10 +5436,8 @@ static int prepare_hardware(struct net_device *dev) rc = request_irq(dev->irq, netdev_intr, IRQF_SHARED, dev->name, dev); if (rc) return rc; - tasklet_init(&hw_priv->rx_tasklet, rx_proc_task, - (unsigned long) hw_priv); - tasklet_init(&hw_priv->tx_tasklet, tx_proc_task, - (unsigned long) hw_priv); + tasklet_setup(&hw_priv->rx_tasklet, rx_proc_task); + tasklet_setup(&hw_priv->tx_tasklet, tx_proc_task); hw->promiscuous = 0; hw->all_multi = 0; From patchwork Mon Sep 14 07:29:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01D8CC43461 for ; Mon, 14 Sep 2020 07:31:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4C58217BA for ; Mon, 14 Sep 2020 07:31:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oV++FYTo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726137AbgINHbf (ORCPT ); Mon, 14 Sep 2020 03:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726092AbgINHaz (ORCPT ); Mon, 14 Sep 2020 03:30:55 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C3CC06174A for ; Mon, 14 Sep 2020 00:30:55 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id l191so10830085pgd.5 for ; Mon, 14 Sep 2020 00:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qT4S1d0PIzJi7Pt12HUmsjoVbhYttOXthzRcyAOM0aM=; b=oV++FYTo9fgJw5E37PdECA3/lbpfh1lD8De7MIkz/Gh99kkWYC9cW1AFIFdhhFlf/A LbsC9AZ07EL/A4Dma7dfieKMXn/wQ9+A7DGC6ELBFqJ6CBbCbZxhzztLPNpNSlklT6vb cxGT5QtvbZyqGE9/Sz8S2ChbuYdUdms8hsnJo2CaGUKAJ45Kmu5rDVMmHwHrKLCSgaxt +0ANznepYl6WQAjAf6D73yzCcTB4aN06MQC7hdTIvjcyCqiUUUHIQY+bbpA6M8e17TWl 7wK+D6afeqHOz7bg4o74YJHIySftAhYXK3FeGLd/m6ysEjd90gJMRZwfGm8GgeTGijX4 8SQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qT4S1d0PIzJi7Pt12HUmsjoVbhYttOXthzRcyAOM0aM=; b=FTy9osIAUVP6ibMmbRT52PRnhZcAOfnKYDVoK2annVGwUR72eqJsaHJmszf6ZgQWYq SnFYVXQe1OlLZb3pTiQemfSJZe+khDLCOROd+PKLZTrK8tj0/l+ld41YAUdjKmaygeJN /Z/09XR+YF58IlyBBtwG7lNnXLBFAtDc2yVCzv3SlPW2F7cQScPHkr0xxgg9n75Gqw2Y KdKso32BykwX2y8cPkMSXb+lRfnm3BdzxqGcRVA8O0GLU7FQ88zB1oSWf/S9WXB2pKi5 pM1oaadK+NGtLOj76zjwFpDl4iBpdvVgM90ZqlDpYtRxcsza5w2zWPvXokE464aVYLHn vn3A== X-Gm-Message-State: AOAM53245of3RDn/VC+uGsfgPiYU9UQvscubvsr9z+HaSC+ILD972HL7 tsOxjbydbLfHJ9DI5g+3Oig= X-Google-Smtp-Source: ABdhPJy1b46v2X7HOZiB2vNcKz30lcVFWAfTmU5ukTi3mVSoc26WpKFRdJodQur24IRFkwhmFXJ01w== X-Received: by 2002:a62:7c0f:: with SMTP id x15mr12222480pfc.7.1600068655335; Mon, 14 Sep 2020 00:30:55 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:30:54 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 16/20] nfp: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:35 +0530 Message-Id: <20200914072939.803280-17-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 21ea22694e47..b150da43adb2 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -2287,9 +2287,9 @@ static bool nfp_ctrl_rx(struct nfp_net_r_vector *r_vec) return budget; } -static void nfp_ctrl_poll(unsigned long arg) +static void nfp_ctrl_poll(struct tasklet_struct *t) { - struct nfp_net_r_vector *r_vec = (void *)arg; + struct nfp_net_r_vector *r_vec = from_tasklet(r_vec, t, tasklet); spin_lock(&r_vec->lock); nfp_net_tx_complete(r_vec->tx_ring, 0); @@ -2337,8 +2337,7 @@ static void nfp_net_vecs_init(struct nfp_net *nn) __skb_queue_head_init(&r_vec->queue); spin_lock_init(&r_vec->lock); - tasklet_init(&r_vec->tasklet, nfp_ctrl_poll, - (unsigned long)r_vec); + tasklet_setup(&r_vec->tasklet, nfp_ctrl_poll); tasklet_disable(&r_vec->tasklet); } From patchwork Mon Sep 14 07:29:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1AFDC43461 for ; Mon, 14 Sep 2020 07:31:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57B5F2192A for ; Mon, 14 Sep 2020 07:31:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nLge9+/f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726153AbgINHbo (ORCPT ); Mon, 14 Sep 2020 03:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbgINHbD (ORCPT ); Mon, 14 Sep 2020 03:31:03 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFD6BC061788 for ; Mon, 14 Sep 2020 00:31:02 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id n14so11875555pff.6 for ; Mon, 14 Sep 2020 00:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4pvqiAF/2hxgxDrlvN/6Nw0fmCS9vrU/LfosPmNZwNc=; b=nLge9+/foq24qWLq8+CpURdHBq0A1uSqkMxcDualUB4peA+mPLtzQa2rbwR4HotIkG ClT0p7nuq1kYIO+BnrpLbNQr5PTafWkTkQ7XQ8RVecmX1fcAPzVUvz6dpc+DLO9M+X9F KZ1mCAs9Dnr2nxW+T99v5qEMuMncoPP5awB9uGIrtpEFr9xo0iaOvEnJe4EF3VsIeRcp VgnTh1TmhBp/5q4Xn+8eYyVRgAMDBNU9O5eU0OdMEAjNLcCiiRbibiI3msdXI/brsh8K OS7E99CgcLNRiYtJmCrcYk6aukTrcnV/qwe5edv3BZi/pgZaDJ9JDwV6MPVc9XumtKSo eTUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4pvqiAF/2hxgxDrlvN/6Nw0fmCS9vrU/LfosPmNZwNc=; b=Qkoxoy6FcZDgj4wMo7MNZdgjgFCxIH8pUykKIECbhGwuagGjeu2okYxbr7cjppiAOT pNXAWXaOWpJ2fTolMc65HdfKj0hWBoU86z55+lYqoeuPVMQEC1dpcf28s717srtu7xjW OGosq00OUM+fHaSdzdSmtcIFk/5nyMeJQfcG1u7N0H0b34XUG0YBCTBpNAoT0C2LCIeK uug5LUX+w8gjUwg41+Jawg/qjUfZktExnC+5Okk382mcjKvgSDs6wV3b9kZDhNGAEMle VRufTuW3NV2QfwIYkKnmn++mAU1NHAH766bpuqJiD/Wa1ODv1CNYTC/IzwJ3EXSapOcO XdXg== X-Gm-Message-State: AOAM533h7gBkC81EhLC5MYgmQdh7QdPrORYWsUrs3/w1mQErGWhrL7Jx rmAadra7vZ5fOSxUYrf0MnE= X-Google-Smtp-Source: ABdhPJzTajTwM5nJLvJADMJEK0uXB+Vi1hOCifNZLW7i2KhYcD5KiyBT8ZqP5bVR07R6afCbfj1Mdw== X-Received: by 2002:a17:902:8306:b029:d0:cbe1:e7aa with SMTP id bd6-20020a1709028306b02900d0cbe1e7aamr13462616plb.27.1600068662478; Mon, 14 Sep 2020 00:31:02 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:31:02 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 18/20] qed: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:37 +0530 Message-Id: <20200914072939.803280-19-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/qlogic/qed/qed.h | 2 +- drivers/net/ethernet/qlogic/qed/qed_int.c | 27 +++------------------- drivers/net/ethernet/qlogic/qed/qed_int.h | 2 +- drivers/net/ethernet/qlogic/qed/qed_main.c | 14 +++++------ 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed.h b/drivers/net/ethernet/qlogic/qed/qed.h index b2a7b53ee760..22bc4ec7859a 100644 --- a/drivers/net/ethernet/qlogic/qed/qed.h +++ b/drivers/net/ethernet/qlogic/qed/qed.h @@ -572,7 +572,7 @@ struct qed_hwfn { struct qed_consq *p_consq; /* Slow-Path definitions */ - struct tasklet_struct *sp_dpc; + struct tasklet_struct sp_dpc; bool b_sp_dpc_enabled; struct qed_ptt *p_main_ptt; diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/ethernet/qlogic/qed/qed_int.c index f8c5a864812d..578935f643b8 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_int.c +++ b/drivers/net/ethernet/qlogic/qed/qed_int.c @@ -1216,9 +1216,9 @@ static void qed_sb_ack_attn(struct qed_hwfn *p_hwfn, barrier(); } -void qed_int_sp_dpc(unsigned long hwfn_cookie) +void qed_int_sp_dpc(struct tasklet_struct *t) { - struct qed_hwfn *p_hwfn = (struct qed_hwfn *)hwfn_cookie; + struct qed_hwfn *p_hwfn = from_tasklet(p_hwfn, t, sp_dpc); struct qed_pi_info *pi_info = NULL; struct qed_sb_attn_info *sb_attn; struct qed_sb_info *sb_info; @@ -2285,34 +2285,14 @@ u64 qed_int_igu_read_sisr_reg(struct qed_hwfn *p_hwfn) static void qed_int_sp_dpc_setup(struct qed_hwfn *p_hwfn) { - tasklet_init(p_hwfn->sp_dpc, - qed_int_sp_dpc, (unsigned long)p_hwfn); + tasklet_setup(&p_hwfn->sp_dpc, qed_int_sp_dpc); p_hwfn->b_sp_dpc_enabled = true; } -static int qed_int_sp_dpc_alloc(struct qed_hwfn *p_hwfn) -{ - p_hwfn->sp_dpc = kmalloc(sizeof(*p_hwfn->sp_dpc), GFP_KERNEL); - if (!p_hwfn->sp_dpc) - return -ENOMEM; - - return 0; -} - -static void qed_int_sp_dpc_free(struct qed_hwfn *p_hwfn) -{ - kfree(p_hwfn->sp_dpc); - p_hwfn->sp_dpc = NULL; -} - int qed_int_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) { int rc = 0; - rc = qed_int_sp_dpc_alloc(p_hwfn); - if (rc) - return rc; - rc = qed_int_sp_sb_alloc(p_hwfn, p_ptt); if (rc) return rc; @@ -2326,7 +2306,6 @@ void qed_int_free(struct qed_hwfn *p_hwfn) { qed_int_sp_sb_free(p_hwfn); qed_int_sb_attn_free(p_hwfn); - qed_int_sp_dpc_free(p_hwfn); } void qed_int_setup(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.h b/drivers/net/ethernet/qlogic/qed/qed_int.h index 86809d7bc2de..c5550e96bbe1 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_int.h +++ b/drivers/net/ethernet/qlogic/qed/qed_int.h @@ -140,7 +140,7 @@ int qed_int_sb_release(struct qed_hwfn *p_hwfn, * @param p_hwfn - pointer to hwfn * */ -void qed_int_sp_dpc(unsigned long hwfn_cookie); +void qed_int_sp_dpc(struct tasklet_struct *t); /** * @brief qed_int_get_num_sbs - get the number of status diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index f39f629242a1..9352c2f52ecd 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c @@ -841,7 +841,7 @@ static irqreturn_t qed_single_int(int irq, void *dev_instance) /* Slowpath interrupt */ if (unlikely(status & 0x1)) { - tasklet_schedule(hwfn->sp_dpc); + tasklet_schedule(&hwfn->sp_dpc); status &= ~0x1; rc = IRQ_HANDLED; } @@ -887,7 +887,7 @@ int qed_slowpath_irq_req(struct qed_hwfn *hwfn) id, cdev->pdev->bus->number, PCI_SLOT(cdev->pdev->devfn), hwfn->abs_pf_id); rc = request_irq(cdev->int_params.msix_table[id].vector, - qed_msix_sp_int, 0, hwfn->name, hwfn->sp_dpc); + qed_msix_sp_int, 0, hwfn->name, &hwfn->sp_dpc); } else { unsigned long flags = 0; @@ -919,8 +919,8 @@ static void qed_slowpath_tasklet_flush(struct qed_hwfn *p_hwfn) * enable function makes this sequence a flush-like operation. */ if (p_hwfn->b_sp_dpc_enabled) { - tasklet_disable(p_hwfn->sp_dpc); - tasklet_enable(p_hwfn->sp_dpc); + tasklet_disable(&p_hwfn->sp_dpc); + tasklet_enable(&p_hwfn->sp_dpc); } } @@ -949,7 +949,7 @@ static void qed_slowpath_irq_free(struct qed_dev *cdev) break; synchronize_irq(cdev->int_params.msix_table[i].vector); free_irq(cdev->int_params.msix_table[i].vector, - cdev->hwfns[i].sp_dpc); + &cdev->hwfns[i].sp_dpc); } } else { if (QED_LEADING_HWFN(cdev)->b_int_requested) @@ -968,11 +968,11 @@ static int qed_nic_stop(struct qed_dev *cdev) struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; if (p_hwfn->b_sp_dpc_enabled) { - tasklet_disable(p_hwfn->sp_dpc); + tasklet_disable(&p_hwfn->sp_dpc); p_hwfn->b_sp_dpc_enabled = false; DP_VERBOSE(cdev, NETIF_MSG_IFDOWN, "Disabled sp tasklet [hwfn %d] at %p\n", - i, p_hwfn->sp_dpc); + i, &p_hwfn->sp_dpc); } } From patchwork Mon Sep 14 07:29:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 260947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D72AC43461 for ; Mon, 14 Sep 2020 07:31:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B10C21D24 for ; Mon, 14 Sep 2020 07:31:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HEiXkWLT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725968AbgINHbu (ORCPT ); Mon, 14 Sep 2020 03:31:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726113AbgINHbO (ORCPT ); Mon, 14 Sep 2020 03:31:14 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8FFCC06174A for ; Mon, 14 Sep 2020 00:31:10 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id u13so10853197pgh.1 for ; Mon, 14 Sep 2020 00:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L8c5AXStNe687nRDosmsTqhQY6wvDsSDeLTv0bL8ci8=; b=HEiXkWLTnBuYJIKkhVIyz367t29/tXCH9Q7u2BSfGHFak5YaAJ+W1iN/DOoJdyKG2m Wjn271sXG4sVNZp43eu5D/xQw6pESCMP97sc0SiJtW7ozU4wnpWF8cXhmcIylGQE4G+L b+oossZRdhpx5wd8xZO7hdrDyw1Awzb8ub3bdJ+gr7+FS1ixTquct52C5XlYy9SZkWUZ p87mY2wSSprUkiUB2Zsu22mvnKIlCt4JoHNx5TLCYgRG3Anlgi7++HwxVG06MHd6r1Pf vXoOflc7BS/9cz9jq85ymWwAuGfXlqR732SWsStwB6CsIid+c0GGGo4T6raFsf/jCnnK PKew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L8c5AXStNe687nRDosmsTqhQY6wvDsSDeLTv0bL8ci8=; b=fb2MS/1ShDs2BkkQBl3c3X8F12hnRDWNB7oB1eFckQIJSN5mJqo+l7huSK55hRDA9+ pcyVYqgkEkMxc382j4PnbI8SEJRSjqjMDH14XaLc+QjPI+KHPQwvQuCdVCf55K36sf0R z4yIJaUe/5HRW/7bC1bfWbxlndJRBMfyG4b92LweRQj+jYxXRiUFIHKIrvgo+wZKe80t XajkvP0LeKHEb9d0wodpyukK6uQvWVBUj/bpac58BYe3fokE21iIh1+2EMdWQ7RorYEm I3Hw3EstpUdSgi//atiKjg8A2RYHLAf33bDt6pHV8ho3OPQ8rpVYkCi/7RUvqPzYzf4W pwYg== X-Gm-Message-State: AOAM533G2778llzbZ0RfA/IaqwSX4WsykR8j/95duOHwOEdkQUzOCjnB m7s4AT6rSpkaxMVZ269SQ7ZeTNhJaVFtRQ== X-Google-Smtp-Source: ABdhPJybntRH2z5HVizbtluDaKOjhlph3GHl7kI82VAZ2z9yltgUELgM9VIbDjPY1eLrL8jBlAPd0w== X-Received: by 2002:a63:5e01:: with SMTP id s1mr5494476pgb.421.1600068670510; Mon, 14 Sep 2020 00:31:10 -0700 (PDT) Received: from localhost.localdomain ([49.207.192.250]) by smtp.gmail.com with ESMTPSA id a16sm7609057pgh.48.2020.09.14.00.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 00:31:10 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [net-next v3 20/20] net: smc91x: convert tasklets to use new tasklet_setup() API Date: Mon, 14 Sep 2020 12:59:39 +0530 Message-Id: <20200914072939.803280-21-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914072939.803280-1-allen.lkml@gmail.com> References: <20200914072939.803280-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/smsc/smc91x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 1c4fea9c3ec4..7e585aa3031c 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c @@ -535,10 +535,10 @@ static inline void smc_rcv(struct net_device *dev) /* * This is called to actually send a packet to the chip. */ -static void smc_hardware_send_pkt(unsigned long data) +static void smc_hardware_send_pkt(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct smc_local *lp = netdev_priv(dev); + struct smc_local *lp = from_tasklet(lp, t, tx_task); + struct net_device *dev = lp->dev; void __iomem *ioaddr = lp->base; struct sk_buff *skb; unsigned int packet_no, len; @@ -688,7 +688,7 @@ smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) * Allocation succeeded: push packet to the chip's own memory * immediately. */ - smc_hardware_send_pkt((unsigned long)dev); + smc_hardware_send_pkt(&lp->tx_task); } return NETDEV_TX_OK; @@ -1965,7 +1965,7 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, dev->netdev_ops = &smc_netdev_ops; dev->ethtool_ops = &smc_ethtool_ops; - tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); + tasklet_setup(&lp->tx_task, smc_hardware_send_pkt); INIT_WORK(&lp->phy_configure, smc_phy_configure); lp->dev = dev; lp->mii.phy_id_mask = 0x1f;