From patchwork Mon Aug 17 08:24:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5F361392 for ; Mon, 17 Aug 2020 08:25:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDE0820758 for ; Mon, 17 Aug 2020 08:25:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sRB8R0mF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbgHQIZA (ORCPT ); Mon, 17 Aug 2020 04:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbgHQIYz (ORCPT ); Mon, 17 Aug 2020 04:24: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 A7EBEC061388; Mon, 17 Aug 2020 01:24:55 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id i10so2227686pgk.1; Mon, 17 Aug 2020 01:24: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; bh=U6kvtvahmst982l1SHnIdlPVTNs/K0Y5vkr0Zrgcbuc=; b=sRB8R0mF9f4I67M2vJjyOzq5HGOLhCwIYyJApLgBpnOvMgv9SObv1CuqoerN2lpagu 3H1IMXBzE+dZbgcDpqRB7MjwtkDlohqJ/sN4S3D//2oLIMlDg9VLkzVibeyVBjC+ncFi pfc9AX7nnkE34sGzhXzgCG036rnkXe9hA721AJ6njKPcXQzgWjwCiwG5UTHheZBPt0Cn xFADoAgnj5Rk4CLpl9CXmhZi3LSe+fZIt7wNuX6N0TxPc37aXsRaYUpuDr7/y071m/iI i0bBC2JcJiy+5QIpzwI5/1j/Hn+pBqI9lf4HiH+UvSifqCWQWzoGH+00Xy5We5cg91OY j6Lw== 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; bh=U6kvtvahmst982l1SHnIdlPVTNs/K0Y5vkr0Zrgcbuc=; b=iPyh8NmUZnFRZzhY998hr+ailjSyJd+JOJaC2HL98KTyYKH2Cg85uGC9948eyYWo+1 QlqFau+B6VZ+ztSZ9R+daJmtDrYJ7RLqd2yEcivyEMNlzivhMFjdN+LwbgQQn5WctZna MAnvJ9jT641HpCBpebPBriIZuVU++wK7NnHcyN+BtkJ1zkHFVkY/fM5+F6s2Q84LP5Aa rn2QnYIIJyCajeu9p/dWryanh7yN5eU/syCXTO/52NDBxJAqpMnhpINsi9NmARR9DneZ b3OJVdmSic3QPaHMxEqQyoQEYH+rT1Q3kAcRnaoaFQ3NdVlTE2NWeBTcEaxejJQysIEN y11w== X-Gm-Message-State: AOAM5316Jpr3tw7ILAjpM22G7CbOC7QSDoMMx8WBx9Kbs2vEF+yBXrlf T6YgXpAPDc93GYMo3nS9f2g= X-Google-Smtp-Source: ABdhPJyeeK7R8O+e+zrG4p84BODgyo/hoS+OJR9A7pYB1XGWzEAoUBeuR9leHrthUrODwRqKFFFWTg== X-Received: by 2002:a65:63ca:: with SMTP id n10mr9480913pgv.252.1597652695193; Mon, 17 Aug 2020 01:24:55 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:24:54 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:14 +0530 Message-Id: <20200817082434.21176-2-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/alteon/acenic.c | 9 +++++---- drivers/net/ethernet/alteon/acenic.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c index ac86fcae1582..8a4c2319953d 100644 --- a/drivers/net/ethernet/alteon/acenic.c +++ b/drivers/net/ethernet/alteon/acenic.c @@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue) } -static void ace_tasklet(unsigned long arg) +static void ace_tasklet(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *) arg; - struct ace_private *ap = netdev_priv(dev); + struct ace_private *ap = from_tasklet(ap, t, ace_tasklet); + struct net_device *dev = (struct net_device *)((char *)ap - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); int cur_size; cur_size = atomic_read(&ap->cur_rx_bufs); @@ -2269,7 +2270,7 @@ static int ace_open(struct net_device *dev) /* * Setup the bottom half rx ring refill handler */ - tasklet_init(&ap->ace_tasklet, ace_tasklet, (unsigned long)dev); + tasklet_setup(&ap->ace_tasklet, ace_tasklet); return 0; } diff --git a/drivers/net/ethernet/alteon/acenic.h b/drivers/net/ethernet/alteon/acenic.h index c670067b1541..4b02c705859c 100644 --- a/drivers/net/ethernet/alteon/acenic.h +++ b/drivers/net/ethernet/alteon/acenic.h @@ -776,7 +776,7 @@ static int ace_open(struct net_device *dev); static netdev_tx_t ace_start_xmit(struct sk_buff *skb, struct net_device *dev); static int ace_close(struct net_device *dev); -static void ace_tasklet(unsigned long dev); +static void ace_tasklet(struct tasklet_struct *t); static void ace_dump_trace(struct ace_private *ap); static void ace_set_multicast_list(struct net_device *dev); static int ace_change_mtu(struct net_device *dev, int new_mtu); From patchwork Mon Aug 17 08:24:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D97651392 for ; Mon, 17 Aug 2020 08:25:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8FC5207DF for ; Mon, 17 Aug 2020 08:25:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f//x7xuv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728092AbgHQIZL (ORCPT ); Mon, 17 Aug 2020 04:25:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728072AbgHQIZG (ORCPT ); Mon, 17 Aug 2020 04:25:06 -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 8A417C061388; Mon, 17 Aug 2020 01:25:06 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id e4so7465784pjd.0; Mon, 17 Aug 2020 01:25:06 -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; bh=iS/I7F7iLH4P7XaKsE2RuxyA++Ynk+63kexjhzrgu3g=; b=f//x7xuv0lBVzdaFReczKgvFf3Jv08BNDHs3X9r445HEBf6fBDmsh3ZbuOpCfcIuOR 0VTxXVgw/TPEVcLo0iZ96JXY+ZC9FWCuCBtBqHOZ+DrMhD/UZSieOgFiKfUE7fcUL+1s Kp6nZjaR2KuT1DcEr/+JmtRKCZfYEz+u8X6o5390pIaKnD/w9tYrNmRZFmnFYKAcInFM MM7ts+zXVcia6hGMYhqGWGGXzUcJ/0y0KGROR+zgPH9jlEU7ATbmICNRvASqiNl2b9x3 DYzKOqJBu+SZmg2K7Vav4/toPy72kNLIHsS/L2prHKFmUi8E5bqPRZ8WiRCWotM1jyhM Z65g== 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; bh=iS/I7F7iLH4P7XaKsE2RuxyA++Ynk+63kexjhzrgu3g=; b=uPaw1mwujhOVdaQaT/0lVp3jBl7xquBZhjpUlkdtS3oilr2WsQXLq8jFIZ7WVc/Lto u3P74DNoexXyApGJLmabpnjnZiG/F5g0IrY/9GiJl70vFdQKKJLjFPF2LaugGfWidXsd alHGoMHMOcnEVpSo2BRmH/unzB57NnVznL6Pcukd7x0kUnTZG16+ekspHcypMq/c0ehy OatuewTFiEMnrdj6kDGseGxmAiP2M9MsExZ+ZYi+sye+7gGP4WHC4Y0H40Nh/t6MSc+6 N3g4Yg2JV12ZIFaqrfuH+kHhdA/yB97x5Snl0nJYP7n3cFn8xQhucSi+tXnsf1NPjRDZ Ps8Q== X-Gm-Message-State: AOAM530sIVSJRjy5MXwZ9pKmWEtUvu0N4Ml5xqDPzsnPpv9rtGjKTFDF 8gnMxh5FKG2Uxiq5bxzGW55NZDPlaJ2P/Q== X-Google-Smtp-Source: ABdhPJwwhSw/ROxYTyacDvKXgkj0MEKilrfJDG0UEI8CrqFUmCZzhDtmibnMhMazL0vVNFnR/N6zvQ== X-Received: by 2002:a17:90a:d901:: with SMTP id c1mr11690123pjv.175.1597652706152; Mon, 17 Aug 2020 01:25:06 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:05 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 02/20] ethernet: amd: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:16 +0530 Message-Id: <20200817082434.21176-4-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 43294a148f8a..cc56086b7c51 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 Aug 17 08:24:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716859 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A942109B for ; Mon, 17 Aug 2020 08:25:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41D712078D for ; Mon, 17 Aug 2020 08:25:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k6TcpdBk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728072AbgHQIZT (ORCPT ); Mon, 17 Aug 2020 04:25:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbgHQIZM (ORCPT ); Mon, 17 Aug 2020 04:25:12 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F13C061388; Mon, 17 Aug 2020 01:25:12 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id t11so7142780plr.5; Mon, 17 Aug 2020 01:25:12 -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; bh=//0cU4D4ygspSBbtP32AytW3V0GobkPQnAIy8h5tGFQ=; b=k6TcpdBke/4ra4r69REycQPL5SXj2DVcOiJbAczGGHueHEcC8s5DLSbYPyZ3sBEAgM y6n6KwEZ10tmEj0hJyZj+ZUYnx2AAO4FbQErR1urJcgd6CwQtt6SUK4oX2t4DMNH7AsB CbLz39wd3i6EDj07z5/nx5rmHJuQwPjPQk57LqcXNWR3qPmQS0mrSt7tkH4nUSiaCar6 uQ3FOaahy6No3eSkYQb2q3/4/YKj5hjwFbI9jF8Y5y2lw0Yt0rBl2yXZu9X7QBz0+5P/ EQ8vunq+SiqEyr6McmwaZ4SuG+5AViw8t5/1ME+LzUe74E8+sPcNl06lzsn77sRGjBd5 t40A== 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; bh=//0cU4D4ygspSBbtP32AytW3V0GobkPQnAIy8h5tGFQ=; b=CpNELGuDfUNz7ckuNA9UcLTkIFeMWgED1MNml+MChaR+1KhmgxloeU93aXOEkm22hi gBtxljRCu/FQtKhw+hB0YYdvNOqQvH5duGM+K0tJ+1D3nF+KkohIun7flhwtTuGAx6Ti tzUbeEnjFf7q2PQS34m1wety6VFeQ6p9VwE6gU5sA2zHqjlf9rPNB03HNRV/s+XAVoXf rluVN2qJFIz2Cn4bZDgFFr/7yYyehNQmy2wXmlIeHqCLf8yk+3A5MObspiKL5TYocpYT WeMYatLBw348f8IklCXrlfOV4EIGJU+vzdylK6yGvSzKHuNL3bDM/kjBNYdDIDeZjQ0S Ahog== X-Gm-Message-State: AOAM533YNfX7wN3cIknoAKJR0rzYMJb1aoSgcHVwYP7OA+KrJYFuoU0N 5ALGfJWf2104pu85mCtTwaE= X-Google-Smtp-Source: ABdhPJy/kN3PQGQOz7LcO/GIU86/ehe4vLYAl+7eOVcgh49ZDG6UFRQWvhti77fCOLiIhfqDvSIvsw== X-Received: by 2002:a17:902:5997:: with SMTP id p23mr10460861pli.277.1597652712379; Mon, 17 Aug 2020 01:25:12 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:11 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 03/20] broadcom: cnic: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:17 +0530 Message-Id: <20200817082434.21176-5-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/broadcom/cnic.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index c5cca63b8571..e1e8c012d501 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -3009,10 +3009,10 @@ static int cnic_service_bnx2(void *data, void *status_blk) return cnic_service_bnx2_queues(dev); } -static void cnic_service_bnx2_msix(unsigned long data) +static void cnic_service_bnx2_msix(struct tasklet_struct *t) { - struct cnic_dev *dev = (struct cnic_dev *) data; - struct cnic_local *cp = dev->cnic_priv; + struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task); + struct cnic_dev *dev = cp->dev; cp->last_status_idx = cnic_service_bnx2_queues(dev); @@ -3134,10 +3134,10 @@ static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info) return last_status; } -static void cnic_service_bnx2x_bh(unsigned long data) +static void cnic_service_bnx2x_bh(struct tasklet_struct *t) { - struct cnic_dev *dev = (struct cnic_dev *) data; - struct cnic_local *cp = dev->cnic_priv; + struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task); + struct cnic_dev *dev = cp->dev; struct bnx2x *bp = netdev_priv(dev->netdev); u32 status_idx, new_status_idx; @@ -4458,8 +4458,7 @@ static int cnic_init_bnx2_irq(struct cnic_dev *dev) CNIC_WR(dev, base + BNX2_HC_CMD_TICKS_OFF, (64 << 16) | 220); cp->last_status_idx = cp->status_blk.bnx2->status_idx; - tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2_msix, - (unsigned long) dev); + tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2_msix); err = cnic_request_irq(dev); if (err) return err; @@ -4868,8 +4867,7 @@ static int cnic_init_bnx2x_irq(struct cnic_dev *dev) struct cnic_eth_dev *ethdev = cp->ethdev; int err = 0; - tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2x_bh, - (unsigned long) dev); + tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2x_bh); if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) err = cnic_request_irq(dev); From patchwork Mon Aug 17 08:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBBD415E4 for ; Mon, 17 Aug 2020 08:29:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B30B720758 for ; Mon, 17 Aug 2020 08:29:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GD0jFjVi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728156AbgHQIZ0 (ORCPT ); Mon, 17 Aug 2020 04:25:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbgHQIZS (ORCPT ); Mon, 17 Aug 2020 04:25:18 -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 A2284C061388; Mon, 17 Aug 2020 01:25:18 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id d4so7337459pjx.5; Mon, 17 Aug 2020 01:25:18 -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; bh=T6lw+n9mQmkGn1p4WLHa0fO/vue0T8wJx0TGHG4/TuE=; b=GD0jFjVi/z5Qdah7xQgj1sPqFYzpZzvzuXxRK6j9Ts6HatcSx8QcxeClItWCnE9yPM TneoDWoc1aDFZUV/C7XdZN01xNS5gKlqaWa8qFqGwTRcLQpFjGLZtoeDgvTAsU3Tu2H4 HxKcwnAidW6Xj3zSP9sA6h3W0oJ406IcX6vPGuUID3oa18sIQ0t8Pv3JufwgJS5rDnu7 +C3GyY+cjMGWxpQTHTFRgp/prP8LhGiZErDB+Q4h5ZMFbxgxxFxgU7oA9DwWSdQ+YGQP TGppYZKTVNwYSmSX7L7A6KlSmqdibrdDbNAeuEJp+t5SyfsggLkehmwHjgLPyedU7cDz Bx9w== 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; bh=T6lw+n9mQmkGn1p4WLHa0fO/vue0T8wJx0TGHG4/TuE=; b=Ngovg0gTz40jg98OnQ+ZOdaCBqNom9hmnSM5vDQSlcuLXLvx8m8wWra4i+yWhFCIS6 as1nxwcCDe/S0J6v/6A5nr3Ukq3HOi3iR5mP0j/etFW+Nis2gbZ9ZapZmQXvmUgFPlKn oXjhSwRzv4TXvBR8wyrouDNxPypEkQX+m7HngdikWh2NAB8bb0XfRIxbBwpjF8+DiurS 2LWE7S+3W/slO8sg+w6UpT92gBcV2p3F79+Z4zdzVpzEJNi7ZxoTGJApM8r8SDlTyTrw Kfe3DpfhHCNLvC9nVLt0ORWmQ5lAM3ktg/xXEBxyLuip5PS5rx3Fi+h/NeMYsz83EhWs 9yWw== X-Gm-Message-State: AOAM530g+zGgzSIkHnDHOeuflHGpDLmKO2oFp5jsZDHMlR3j05M4dugA Y1NOLQ6lnPZVFA9KoiOajEY= X-Google-Smtp-Source: ABdhPJwDu5TYQAHATbCMVLUlf01g8fgt2E844DH0xvZjDgKdXuiUZDlH44A95OBtxXadmTX7B9NAlg== X-Received: by 2002:a17:902:343:: with SMTP id 61mr7899243pld.274.1597652718233; Mon, 17 Aug 2020 01:25:18 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:17 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 04/20] ethernet: cadence: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:18 +0530 Message-Id: <20200817082434.21176-6-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 Aug 17 08:24:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716939 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 414FA1392 for ; Mon, 17 Aug 2020 08:29:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24C4320758 for ; Mon, 17 Aug 2020 08:29:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gp0tN+rA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726842AbgHQI3m (ORCPT ); Mon, 17 Aug 2020 04:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbgHQIZY (ORCPT ); Mon, 17 Aug 2020 04:25:24 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0DC7C061388; Mon, 17 Aug 2020 01:25:24 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id s14so1163851plp.4; Mon, 17 Aug 2020 01:25:24 -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; bh=YNvMy4AuY+7swgSlQS3LYVsoHEcImnFolbz565rcKCo=; b=gp0tN+rAx/ViPmdFY3zUwZzTzj/Mg191vxLR90RxlqxOVPK45tXw3AbH1absvhOybR L6XttLKa2rjCShl6MqYQ44QfUdD3CVHD/k57/uefx7mFbw+dvycMW2owDft3AzCYyaXg Y1BmBIF3uILRsHaMGOz6on8xFypoYQ+YpP9K7zS9WIdsZr2rdHgI+e3rRrY/Y1ehFs4z YLfJwdzquI3XniXWrq0BcbCg8tEUFTyHrJPXLn3HnBveGGnmRIaVf9eeW9Dea/WmD2Mg zUc8GkJfzCMUzMW2uxsTdDJiiIf52wovdrIoBeC0iJpmdGWJJbAGwIplKpTw7jseeePb MyVQ== 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; bh=YNvMy4AuY+7swgSlQS3LYVsoHEcImnFolbz565rcKCo=; b=XI8vejuvSaBrM6ivB/n9RK8AfZqN7e+fTvSEA/TtfCjpV1YeQtzSbItVjJu6NaAjg3 On8ef1AySMdCnqvwqZeB0TLJr5RKk/Dj0e8RIjXk4irx8MzXUiPggIN1FPHFlBNJAdRG h4S0fJY/rtqpRIk98T9WJ+sxtTrjIsQ6e07ysRUDN5+yLXaTL6nvH4K+YY7GdWYsTfxm Ylm0HQr0wJV1thlt1rsKlnh1tksDcX2Svo9HWWMu1Vw9HFCKmsZMGrYMscODBsVxv629 k8/g8U1mn8JziVfRWVFMwBZaBYwchf2VndHAd/gtUUktiB+nu723iloiiapzGOtCKpkd ygFw== X-Gm-Message-State: AOAM532Qe2Uewhu8V7Tgr0W+pIyzWqeOK5beEnxTNhv0XymOSyQGQfwa Hd5d94zqOj2CufcKjiYYm04= X-Google-Smtp-Source: ABdhPJzHbNppt+UgUbbnFLVZ8W8+Njht8c/Lw3IR0qTaF2iala6YGQd/m/DGKcMclr2bZnj1397x2A== X-Received: by 2002:a17:90b:11c4:: with SMTP id gv4mr11263497pjb.198.1597652724297; Mon, 17 Aug 2020 01:25:24 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:23 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 05/20] ethernet: cavium: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:19 +0530 Message-Id: <20200817082434.21176-7-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/cavium/liquidio/lio_main.c | 12 ++++++------ drivers/net/ethernet/cavium/liquidio/octeon_main.h | 1 + drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 8 ++++---- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 10 ++++------ drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 4 ++-- drivers/net/ethernet/cavium/thunder/nicvf_queues.h | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c index e73bc211779a..41c5f4c6ca22 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c @@ -161,13 +161,13 @@ static int liquidio_set_vf_link_state(struct net_device *netdev, int vfidx, static struct handshake handshake[MAX_OCTEON_DEVICES]; static struct completion first_stage; -static void octeon_droq_bh(unsigned long pdev) +static void octeon_droq_bh(struct tasklet_struct *t) { int q_no; int reschedule = 0; - struct octeon_device *oct = (struct octeon_device *)pdev; - struct octeon_device_priv *oct_priv = - (struct octeon_device_priv *)oct->priv; + struct octeon_device_priv *oct_priv = from_tasklet(oct_priv, t, + droq_tasklet); + struct octeon_device *oct = oct_priv->dev; for (q_no = 0; q_no < MAX_OCTEON_OUTPUT_QUEUES(oct); q_no++) { if (!(oct->io_qmask.oq & BIT_ULL(q_no))) @@ -4194,8 +4194,7 @@ static int octeon_device_init(struct octeon_device *octeon_dev) /* Initialize the tasklet that handles output queue packet processing.*/ dev_dbg(&octeon_dev->pci_dev->dev, "Initializing droq tasklet\n"); - tasklet_init(&oct_priv->droq_tasklet, octeon_droq_bh, - (unsigned long)octeon_dev); + tasklet_setup(&oct_priv->droq_tasklet, octeon_droq_bh); /* Setup the interrupt handler and record the INT SUM register address */ @@ -4299,6 +4298,7 @@ static int octeon_device_init(struct octeon_device *octeon_dev) complete(&handshake[octeon_dev->octeon_id].init); atomic_set(&octeon_dev->status, OCT_DEV_HOST_OK); + oct_priv->dev = octeon_dev; return 0; } diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_main.h b/drivers/net/ethernet/cavium/liquidio/octeon_main.h index 073d0647b439..5b4cb725f60f 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_main.h +++ b/drivers/net/ethernet/cavium/liquidio/octeon_main.h @@ -39,6 +39,7 @@ struct octeon_device_priv { /** Tasklet structures for this device. */ struct tasklet_struct droq_tasklet; unsigned long napi_mask; + struct octeon_device *dev; }; /** This structure is used by NIC driver to store information required diff --git a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c index 3e17ce0d2314..c745ace07fc3 100644 --- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c +++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c @@ -315,9 +315,9 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p) netif_wake_queue(p->netdev); } -static void octeon_mgmt_clean_tx_tasklet(unsigned long arg) +static void octeon_mgmt_clean_tx_tasklet(struct tasklet_struct *t) { - struct octeon_mgmt *p = (struct octeon_mgmt *)arg; + struct octeon_mgmt *p = from_tasklet(p, t, tx_clean_tasklet); octeon_mgmt_clean_tx_buffers(p); octeon_mgmt_enable_tx_irq(p); } @@ -1489,8 +1489,8 @@ static int octeon_mgmt_probe(struct platform_device *pdev) skb_queue_head_init(&p->tx_list); skb_queue_head_init(&p->rx_list); - tasklet_init(&p->tx_clean_tasklet, - octeon_mgmt_clean_tx_tasklet, (unsigned long)p); + tasklet_setup(&p->tx_clean_tasklet, + octeon_mgmt_clean_tx_tasklet); netdev->priv_flags |= IFF_UNICAST_FLT; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index c1378b5c780c..11112b58c88f 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -985,9 +985,9 @@ static int nicvf_poll(struct napi_struct *napi, int budget) * * As of now only CQ errors are handled */ -static void nicvf_handle_qs_err(unsigned long data) +static void nicvf_handle_qs_err(struct tasklet_struct *t) { - struct nicvf *nic = (struct nicvf *)data; + struct nicvf *nic = from_tasklet(nic, t, qs_err_task); struct queue_set *qs = nic->qs; int qidx; u64 status; @@ -1493,12 +1493,10 @@ int nicvf_open(struct net_device *netdev) } /* Init tasklet for handling Qset err interrupt */ - tasklet_init(&nic->qs_err_task, nicvf_handle_qs_err, - (unsigned long)nic); + tasklet_setup(&nic->qs_err_task, nicvf_handle_qs_err); /* Init RBDR tasklet which will refill RBDR */ - tasklet_init(&nic->rbdr_task, nicvf_rbdr_task, - (unsigned long)nic); + tasklet_setup(&nic->rbdr_task, nicvf_rbdr_task); INIT_DELAYED_WORK(&nic->rbdr_work, nicvf_rbdr_work); /* Configure CPI alorithm */ diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c index a45223f0cca5..7a141ce32e86 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c @@ -460,9 +460,9 @@ void nicvf_rbdr_work(struct work_struct *work) } /* In Softirq context, alloc rcv buffers in atomic mode */ -void nicvf_rbdr_task(unsigned long data) +void nicvf_rbdr_task(struct tasklet_struct *t) { - struct nicvf *nic = (struct nicvf *)data; + struct nicvf *nic = from_tasklet(nic, t, rbdr_task); nicvf_refill_rbdr(nic, GFP_ATOMIC); if (nic->rb_alloc_fail) { diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h index 2460451fc48f..8453defc296c 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h @@ -348,7 +348,7 @@ void nicvf_xdp_sq_doorbell(struct nicvf *nic, struct snd_queue *sq, int sq_num); struct sk_buff *nicvf_get_rcv_skb(struct nicvf *nic, struct cqe_rx_t *cqe_rx, bool xdp); -void nicvf_rbdr_task(unsigned long data); +void nicvf_rbdr_task(struct tasklet_struct *t); void nicvf_rbdr_work(struct work_struct *work); void nicvf_enable_intr(struct nicvf *nic, int int_type, int q_idx); From patchwork Mon Aug 17 08:24:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716933 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D423A109B for ; Mon, 17 Aug 2020 08:29:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B66E220758 for ; Mon, 17 Aug 2020 08:29:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JKs6NWf0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728127AbgHQIZe (ORCPT ); Mon, 17 Aug 2020 04:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgHQIZb (ORCPT ); Mon, 17 Aug 2020 04:25:31 -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 D3A96C061388; Mon, 17 Aug 2020 01:25:30 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 189so7127443pgg.13; Mon, 17 Aug 2020 01:25:30 -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; bh=D1aAuZf9AutjEPnD50DCVOQS+d/LorwrTFVRcP8QmrM=; b=JKs6NWf0vnjktIoAD+8hDbWr3FtmUc9bzqVlfLCwWBZjwHv+2lkp9Dt5867df+0KPJ qN52iAZFSKF+EgP/Gopv2oJH282/a9k3AvH1cnmLwxpmykSQf4fvLr0yK2WvpaPcmMy/ kxqiGDTf/ypIINy/9AsP+FHMdmLfIFBch/HVd95MzP8G+CQiqVfQKVQVKiDhM0SLuFwx 3nQi8/X/5Aq9X8hhpX+lla4EEOd0bc53ZlDlHwg0ORo0MOPb5wTNtyKPFGFr8wQZyikm 996XaRO/oaL27tvInl/efvr+UsIX4+NTP72lLp5aEqbcp8B4q1+vqK0wet9HbRFeQBnP tvIQ== 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; bh=D1aAuZf9AutjEPnD50DCVOQS+d/LorwrTFVRcP8QmrM=; b=XsJTq6cFrdmnulhLXd3mJm9rm0ROKTdIV6rNUxK6mikPU3u1vcvl3bpS7MOo/LYVrw 6qD4K2KSJy6QQRkFgd9MmFHZUvC61x/SisPA8KmNNRMfg9oWbDV9Yr+F5ME5/cfXdlaC 5ncJX6AqdI9DjOD2A2tq5l3cA7dCdcGsNvtgWXB1XlI3Sd88JHeVpimFxqqvpEwHUBOe IShVzi+oY+H81f0rqDCyIgwbxFdubTnZNaZwxXTWv6SEuyNE4cs0elJk+zYQOk6+XfZb n8JcAbgFtmNIjv4Zb4MdgPeAEjmf1lRtQYThg/MFmfS8e7ebHqhhKuz9vQXVpcyt1QXz 98Tg== X-Gm-Message-State: AOAM5335fZPZNd6C5qmvaaY6de1p3SNY+geGPSBS7imdQ4omEce+kJb3 d6Op6e9cZJDzIoz0/4k1G6Q= X-Google-Smtp-Source: ABdhPJwRNhGVFfrT+4KXAK4vpPuqUG4S51cq+a0x5Buc2BD841a4hjMMe5sXIW8wgdf6LPNclkcTlg== X-Received: by 2002:a63:544e:: with SMTP id e14mr9101091pgm.90.1597652730383; Mon, 17 Aug 2020 01:25:30 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:29 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 06/20] ethernet: chelsio: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:20 +0530 Message-Id: <20200817082434.21176-8-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 | 14 ++++++-------- drivers/net/ethernet/chelsio/cxgb4/sge.c | 12 ++++++------ 3 files changed, 20 insertions(+), 18 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..f2c5da465db5 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c @@ -1520,10 +1520,10 @@ static int ctrl_xmit(struct adapter *adap, struct sge_txq *q, * * 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); @@ -1737,10 +1737,10 @@ again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK); * * 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 d2b587d1670a..e668e17711c8 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -2660,11 +2660,11 @@ static int ctrl_xmit(struct sge_ctrl_txq *q, struct sk_buff *skb) * * 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,9 +2961,9 @@ static int ofld_xmit(struct sge_uld_txq *q, struct sk_buff *skb) * * 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 */ @@ -4576,7 +4576,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; } @@ -4666,7 +4666,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 Aug 17 08:24:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B979D109B for ; Mon, 17 Aug 2020 08:28:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C2B720658 for ; Mon, 17 Aug 2020 08:28:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jZLuecL8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728138AbgHQIZk (ORCPT ); Mon, 17 Aug 2020 04:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728155AbgHQIZg (ORCPT ); Mon, 17 Aug 2020 04:25:36 -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 A509FC061388; Mon, 17 Aug 2020 01:25:36 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id mw10so7346717pjb.2; Mon, 17 Aug 2020 01:25:36 -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; bh=t98B3iZn1A9NLqkiUAje/weBgNoNpyefzZebYfgmTtE=; b=jZLuecL8IeUDv5a24d46K3rjLGWcoQJj69HmdPY/DPKCZxH5u+GyxjZZU0tHjy6TcL q4HpfCzSZMtxa61vEN7/e/eDdpbmaZVqSDB73eonA+uwHWobDX7xGEC0NjwH81/fXTVK 7ff3VxfI4HmSAE+59SQ7UN6yt952R0GQc/s9UOWICylm4KiIaXzaPAUDZFNUpWcFYUQ4 h4QkOSWETXpxWR04vhc42wXGtQl7Pflsu2sYnuQWpvyDpJoPvYC6WGr5KRgcK/CANL8x VKrhuEQhsp7U8rTTGURn1Uij6MXbcuyNQQ9WVswpOdCZJH1lpE33edBog9aESZmbcyLV crfA== 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; bh=t98B3iZn1A9NLqkiUAje/weBgNoNpyefzZebYfgmTtE=; b=ew/NFMYo4yOg+f5YNKkp0JqgLNC2D5+EsSy84q/hdcZUT7iks3vWMfr5Q69C960QrQ kdsTl4xLi/m0ZDxv+vQir9FNzhrAMPI8YSbGimgxbNleyZYu5vrskLEYARHbqd/um52p gfprTsai93UwRdFP32tPh2gm8QBHi0NZt45R1UI0fksdaVg0Nggb1IagqfdoeHlSi3Oi WlOrZsRnVmp4EjtnspGMG9VnZd+GT2QSp1CzHbPFz99QR/HJNTe/4624g+7Sww1tDuod cLVV0cUqp8ZSQ+A7TkgibIguAwvCWlLejl6ix/MyXesquR0IjoR+ypoJxgPn1e7Mbeq6 YR9Q== X-Gm-Message-State: AOAM533SWs+mVWRRLc3hfKVnPFoa7+Ai/j7tk7EqCIiDTbmbf7i3Einz KsrjOp4QcJ3/O1n1VrJlGaE= X-Google-Smtp-Source: ABdhPJw4UfJp6v93zOfVhpwON1MyO9yehUVd0VaAZcFPqK5ou/peSYq27nwwshI4OGpbk3ZqbHihsw== X-Received: by 2002:a17:90a:ff85:: with SMTP id hf5mr11460448pjb.79.1597652736154; Mon, 17 Aug 2020 01:25:36 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:35 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 07/20] ethernet: dlink: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:21 +0530 Message-Id: <20200817082434.21176-9-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/dlink/sundance.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c index b3f8597e77aa..58022396b053 100644 --- a/drivers/net/ethernet/dlink/sundance.c +++ b/drivers/net/ethernet/dlink/sundance.c @@ -429,8 +429,8 @@ static void init_ring(struct net_device *dev); static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); static int reset_tx (struct net_device *dev); static irqreturn_t intr_handler(int irq, void *dev_instance); -static void rx_poll(unsigned long data); -static void tx_poll(unsigned long data); +static void rx_poll(struct tasklet_struct *t); +static void tx_poll(struct tasklet_struct *t); static void refill_rx (struct net_device *dev); static void netdev_error(struct net_device *dev, int intr_status); static void netdev_error(struct net_device *dev, int intr_status); @@ -537,8 +537,8 @@ static int sundance_probe1(struct pci_dev *pdev, np->msg_enable = (1 << debug) - 1; spin_lock_init(&np->lock); spin_lock_init(&np->statlock); - tasklet_init(&np->rx_tasklet, rx_poll, (unsigned long)dev); - tasklet_init(&np->tx_tasklet, tx_poll, (unsigned long)dev); + tasklet_setup(&np->rx_tasklet, rx_poll); + tasklet_setup(&np->tx_tasklet, tx_poll); ring_space = dma_alloc_coherent(&pdev->dev, TX_TOTAL_SIZE, &ring_dma, GFP_KERNEL); @@ -1054,10 +1054,9 @@ static void init_ring(struct net_device *dev) } } -static void tx_poll (unsigned long data) +static void tx_poll(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = netdev_priv(dev); + struct netdev_private *np = from_tasklet(np, t, tx_tasklet); unsigned head = np->cur_task % TX_RING_SIZE; struct netdev_desc *txdesc = &np->tx_ring[(np->cur_tx - 1) % TX_RING_SIZE]; @@ -1312,10 +1311,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) return IRQ_RETVAL(handled); } -static void rx_poll(unsigned long data) +static void rx_poll(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = netdev_priv(dev); + struct netdev_private *np = from_tasklet(np, t, rx_tasklet); + struct net_device *dev = (struct net_device *)((char *)np - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); int entry = np->cur_rx % RX_RING_SIZE; int boguscnt = np->budget; void __iomem *ioaddr = np->base; From patchwork Mon Aug 17 08:24:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716915 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D69E31392 for ; Mon, 17 Aug 2020 08:28:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE8FB20758 for ; Mon, 17 Aug 2020 08:28:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="InxMEUwY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728155AbgHQIZs (ORCPT ); Mon, 17 Aug 2020 04:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728285AbgHQIZm (ORCPT ); Mon, 17 Aug 2020 04:25:42 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD99C061388; Mon, 17 Aug 2020 01:25:42 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id kr4so7457565pjb.2; Mon, 17 Aug 2020 01:25:42 -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; bh=39RvJQz8ipypvoPM9UBQxK34sqwXBw2fpRHeH1750N4=; b=InxMEUwYzhx+GnG4B1eM3y4duNRfyx1CZB/Ws7HUtFocxH7jTVin6brUpn0347NKxY G2vDtc6Jn/U+dIZO/rs8meMl8+D5kFk0pTu+Kq8iKPzEQX6z2YVKdlxtJGEdNAEfX4gs HzG5sxEy9yHpH9i/XYP/zjlfTFVttJpEeuCBLjoMmzrtbLpjW8/3H8wGNJLZJLWaX2ZL GRS+u1RdIHn/f/qA2wjdhyEjO3m2RbZX3lxe9fGOEVpBO6OpU5T6MjohvX+6vnKmyZwA CV1bKneiCat0Wl7RPi6Q7NLdBUFgwZJupvGI6vmFPrpDARH658prdsAMmX5pzSXVradm FHVw== 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; bh=39RvJQz8ipypvoPM9UBQxK34sqwXBw2fpRHeH1750N4=; b=E5GF4UyazdeOOrb7ieQs1EVpUwZWmr2wtaZxOgt+kb3DThwQ/AaihHHppIxx2JDm6E PX0ZRgX/kA2b/GXwK1t1DF+wj53e07QQpTe0MAu5dh9noPWjOcFM5NIXCwWBYfCDjdzy DN3Z9c4OXXMkhh7i0hsUMzWCpfm4kWRCBCsMaTgEVNKLB+dWp+wLfVMr9fqC/ob7N46f 1DqnkE/Wioz+YXh5fLwSTxfnPzPbTUDSgV74S9bnsd//bBL6FVRcfBX8UrK0L0UkDW1B /AjUnhnw0jmn0e2i5LJH/ovNKX1T6g5vQ7bjzRCJ351fpUIT9NznXeBfsD4oqsF0G3L7 cicQ== X-Gm-Message-State: AOAM532XJorQoueLY+cFaBfIQVvg3NWtLrdK1VpGbOY5S+t64kbLOVY5 BRnTbvzMtJTxKBV5jQVm4N4= X-Google-Smtp-Source: ABdhPJwv5/9VRVYulpBw4/bIATV1JwJ7vrwdzGannOz/rXuZqIamAy8BJXZR+zXTAlce5mRSmFRAtg== X-Received: by 2002:a17:90b:100e:: with SMTP id gm14mr11408110pjb.39.1597652741860; Mon, 17 Aug 2020 01:25:41 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:41 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 08/20] ethernet: hinic: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:22 +0530 Message-Id: <20200817082434.21176-10-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 Aug 17 08:24:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716917 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 933A0109B for ; Mon, 17 Aug 2020 08:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78BB520758 for ; Mon, 17 Aug 2020 08:28:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tSp/51Vb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728419AbgHQI2i (ORCPT ); Mon, 17 Aug 2020 04:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728104AbgHQIZs (ORCPT ); Mon, 17 Aug 2020 04:25:48 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC144C061388; Mon, 17 Aug 2020 01:25:47 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id y10so5574649plr.11; Mon, 17 Aug 2020 01:25: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; bh=D/Mkx0k3buW6nMMz3cj3YWbXhyfw6abwbH3pFqES0j8=; b=tSp/51VbeSEu3dHGWXjYT/NQzG6Ptsjimy1nJUoATyHiHCcmg9eo9jc9IaiQERQ5Nb iJAIIF6kNiA5Kd5aBC89NdU0cLtr7LWwAU+vRwMSSvoATCgF7tWwsvtG0wOy0xB8tR9/ uOAPcGvqdMIfqbFOiERkTgq5S7X+z4sS3ug7MnwdPATua5rWEURHlk4bziUaJs2Yjlsb vWNz9vVRd5LVHKlFP5bfXX+bJKOEIpgIa0s/1Mg//6L3c221wwHGJElufgvzxMAdDM+e EvVviBBP45IMyXnW+2hgOqqTLP6sEvrQhnYgq1S+mB1staPKH7MXoRECZYP4+f3temKw OJDw== 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; bh=D/Mkx0k3buW6nMMz3cj3YWbXhyfw6abwbH3pFqES0j8=; b=IHwXcZEKTJ8xD21/nljgfBwe/ZWO3WKfVx2p0GU5fe4afsoOm2xlfLfOHBzVIMBlpK wBbTHrfGfFrpiXR4gBQ6+5+H6W6MDMI4FHvhvJtU06gi7uAY1iOchyLBhumtyjwkp/6W k94q0EjfyB58WAMvl5vSxNFG2xCdIGS7DydY/ry5ZN68VKAZKwwbi8DLo+lJvoNlfUCB vVlcCxfJ8p/dmsVRuyPmmXSqPIJYY53GwQCr7pAgILEIA+JzDLUtyB+mFpv/PY803nSY BETUol654Qi2v6yJUkZL/WE3/04hO20w09YI9WzALGcqBsAOY2dHrVPe2LXgB4Yk7XN5 6c7w== X-Gm-Message-State: AOAM5337sh8b2Kv94GLH+gDPp6K9XeEkust3/EsQ3Q/GIZzzo9tI4bng IIZcoGJsTPJ0HSSHezHjQEE= X-Google-Smtp-Source: ABdhPJzYryo5CXUtCOTUoLLG1O0Nlya6EIJjoKSX670WNzdCiD+322/w/djTW43/04u8aHuCOv3Ndg== X-Received: by 2002:a17:90b:3197:: with SMTP id hc23mr11406806pjb.110.1597652747547; Mon, 17 Aug 2020 01:25:47 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:47 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 09/20] ethernet: ehea: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:23 +0530 Message-Id: <20200817082434.21176-11-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/ehea/ehea_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 0273fb7a9d01..f3d104fec7e9 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -1212,9 +1212,9 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) } } -static void ehea_neq_tasklet(unsigned long data) +static void ehea_neq_tasklet(struct tasklet_struct *t) { - struct ehea_adapter *adapter = (struct ehea_adapter *)data; + struct ehea_adapter *adapter = from_tasklet(adapter, t, neq_tasklet); struct ehea_eqe *eqe; u64 event_mask; @@ -3417,8 +3417,7 @@ static int ehea_probe_adapter(struct platform_device *dev) goto out_free_ad; } - tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet, - (unsigned long)adapter); + tasklet_setup(&adapter->neq_tasklet, ehea_neq_tasklet); ret = ehea_create_device_sysfs(dev); if (ret) From patchwork Mon Aug 17 08:24:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716863 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FD51109B for ; Mon, 17 Aug 2020 08:26:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36A3B2063A for ; Mon, 17 Aug 2020 08:26:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hG2G6TIw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728328AbgHQIZ4 (ORCPT ); Mon, 17 Aug 2020 04:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbgHQIZx (ORCPT ); Mon, 17 Aug 2020 04:25:53 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A74A1C061388; Mon, 17 Aug 2020 01:25:53 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d19so7755380pgl.10; Mon, 17 Aug 2020 01:25:53 -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; bh=iIAfZhwD4u3KlLMECiacU1MTufzkqZbS33SY7LcQr7A=; b=hG2G6TIwKMJXy2HRahBQraJOgltWGzLG9JNMpZ4RSRhs60XANefCGvnE5soeTXpm4f 8W7Y1YPZgS9l2UmuOoypi4PZ1qdPVFJ7QEteda3ogrOSn5313M/EE7BZgy5sZrFHhrui KdAhYg0gLgoy5pBrKOtjZKJGxtOE+4FM1rRssMpDabVK+1mj2agBXV7RnGvo3Sx7vvv/ 0qRK+BXn24CXmouDGXQ2sXFDJUTEkNWdlyk/l+2QSR8ANbeQbj1pMPLjbCHHoaPzPyjG PaFqIMtn8VpzTLw8Vd06NvM257eWA0mBFfDHBaMuUka7/3j5nCdVQi91g8S89hQuYSye dqZw== 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; bh=iIAfZhwD4u3KlLMECiacU1MTufzkqZbS33SY7LcQr7A=; b=dO9onWG2PDjPteApDsRRrlbaP3SELq1IlLkkWQh9jSDO2ii6zy3xiTmV5ni32Tuh/0 77zZaIIwAiqJTtzW+CC74F1/waQYmOqNrq0K8h95tN2LUXtymWvbpv1leikfhvRWSHaV 94UICcPFicCtg3oYS8YAKOhTi/sd8pHTtNY/SvPXlo4Wm5C/r4oyaJJdbyNywVrfkdGZ xVYgRDYYOsdFuJXtdGe3Jg1g2I9q7ahoiEZQQ+X9HbgMjWmSuG7JqDPUVazBOZdUwLSj YDipVV4wWIxP7G4LI92XBgXBz+tkA5MxB9hW6cBrNwOsI2WdAwt2yhYzdkIOtqi+1KEG evOg== X-Gm-Message-State: AOAM530bXA2HpAwNnzOLNGZRR9cMZgN29kcyXHsenLVIzXBuSS9PjfE5 p7xE44otWogc720J6ovTOqI= X-Google-Smtp-Source: ABdhPJyHdid6AeC6n0Zvp88ugK0l2FhFHXTm5Bvo/3+IlJzMqY2dzIOg8iBwBCBZqkwkbk4eX5A4Ng== X-Received: by 2002:aa7:80d6:: with SMTP id a22mr10784840pfn.275.1597652753273; Mon, 17 Aug 2020 01:25:53 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:52 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 10/20] ethernet: ibmvnic: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:24 +0530 Message-Id: <20200817082434.21176-12-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 5afb3c9c52d2..7c565e167521 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4797,9 +4797,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; @@ -4934,8 +4934,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 Aug 17 08:24:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 783C31392 for ; Mon, 17 Aug 2020 08:28:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A1CF20758 for ; Mon, 17 Aug 2020 08:28:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kSZoZKRG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728366AbgHQI0D (ORCPT ); Mon, 17 Aug 2020 04:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbgHQIZ7 (ORCPT ); Mon, 17 Aug 2020 04:25:59 -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 A49A2C061388; Mon, 17 Aug 2020 01:25:59 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 128so7765146pgd.5; Mon, 17 Aug 2020 01:25:59 -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; bh=2lWTwfGunDOTtwrs6ILJYDdQIZghCfDlVzunIeUIAUk=; b=kSZoZKRGgALpz+rZ1rW4PeRUO4mvrUjXHJCHKyxtMUtQUhXwaE9HJJ7el6oyO7OOQx lXYshzblUOVqLabYIbGjttJclIN9gL3539pLtVDVK9JXTdhavTDEE3dsHqQ5wAYvlJPy zvkZWlPoZQb9yg30asCxwKCpGAcuPV9/8kTJ+1TY4ad6Zzb4Ra7b/q56IrzacHNUHvj9 J388zqCTJYUc5/LAGQo1JI7xxtfYsX26N4YZZTlao2oCGpP2BHYHLWlMz7LFAzJYYk/h lVdADjdY4TLYRC2sTeADdTJhfjj6RSC9e3ufqO6H6bYUDH14JYwZeP1ykSFvmTO9/oGI C3Dw== 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; bh=2lWTwfGunDOTtwrs6ILJYDdQIZghCfDlVzunIeUIAUk=; b=NJBgJ6Zw/oIfaPsiUEFQ1gFEMV/KM7mt+ckM6X+H6rFBirlS8gc1alQxLXNLNRumi3 +cdk0FrUBH9aHQKu6CzxFoRj8jqZ7GH6Z3YfOrEM8abMJDa13zX9sXj5dXkmL0vwM6e6 PCdn0OFn9Rcsid8d69RGSelYJq8XsN6sILv3NGuCJc/sPxVeNyyxXcK0+a1VKEllFGwl TGw+i77PC3eL69aF4EsNITSNwVfcz21mt62YHuLx/8fyhgyiqL56Xe0/NAHX9xPe0Kwx 8hbrWVCWCNxpes9QW4S7kzoxEhWt4c7IfaxV81VFuRvxGfoA3ZLi5EVijBR60xNBYQng w60g== X-Gm-Message-State: AOAM531M4hBn0dg3tmbL50ZXyDnw+DKKmpyk/V/JtB0B+RUz+fsnwDLh FzdCQEctGCa4m+O6te796D4= X-Google-Smtp-Source: ABdhPJyiyk1L76pQbEM7KTHPtWb5CWW9jSXriZUpVIGgsJyJ/Z/vcZJfa1sOQ3p1ZAwHDvISchf1Ig== X-Received: by 2002:a63:1822:: with SMTP id y34mr9759847pgl.364.1597652759213; Mon, 17 Aug 2020 01:25:59 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:58 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 11/20] ethernet: jme: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:25 +0530 Message-Id: <20200817082434.21176-13-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/jme.c | 40 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index ddc757680089..e9efe074edc1 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c @@ -1187,9 +1187,9 @@ jme_shutdown_nic(struct jme_adapter *jme) } static void -jme_pcc_tasklet(unsigned long arg) +jme_pcc_tasklet(struct tasklet_struct *t) { - struct jme_adapter *jme = (struct jme_adapter *)arg; + struct jme_adapter *jme = from_tasklet(jme, t, pcc_task); struct net_device *netdev = jme->dev; if (unlikely(test_bit(JME_FLAG_SHUTDOWN, &jme->flags))) { @@ -1265,10 +1265,9 @@ jme_stop_shutdown_timer(struct jme_adapter *jme) jwrite32f(jme, JME_APMC, apmc); } -static void -jme_link_change_tasklet(unsigned long arg) +static void jme_link_change_tasklet(struct tasklet_struct *t) { - struct jme_adapter *jme = (struct jme_adapter *)arg; + struct jme_adapter *jme = from_tasklet(jme, t, linkch_task); struct net_device *netdev = jme->dev; int rc; @@ -1345,9 +1344,9 @@ jme_link_change_tasklet(unsigned long arg) } static void -jme_rx_clean_tasklet(unsigned long arg) +jme_rx_clean_tasklet(struct tasklet_struct *t) { - struct jme_adapter *jme = (struct jme_adapter *)arg; + struct jme_adapter *jme = from_tasklet(jme, t, rxclean_task); struct dynpcc_info *dpi = &(jme->dpi); jme_process_receive(jme, jme->rx_ring_size); @@ -1380,9 +1379,9 @@ jme_poll(JME_NAPI_HOLDER(holder), JME_NAPI_WEIGHT(budget)) } static void -jme_rx_empty_tasklet(unsigned long arg) +jme_rx_empty_tasklet(struct tasklet_struct *t) { - struct jme_adapter *jme = (struct jme_adapter *)arg; + struct jme_adapter *jme = from_tasklet(jme, t, rxempty_task); if (unlikely(atomic_read(&jme->link_changing) != 1)) return; @@ -1392,7 +1391,7 @@ jme_rx_empty_tasklet(unsigned long arg) netif_info(jme, rx_status, jme->dev, "RX Queue Full!\n"); - jme_rx_clean_tasklet(arg); + jme_rx_clean_tasklet(&jme->rxclean_task); while (atomic_read(&jme->rx_empty) > 0) { atomic_dec(&jme->rx_empty); @@ -1416,10 +1415,9 @@ jme_wake_queue_if_stopped(struct jme_adapter *jme) } -static void -jme_tx_clean_tasklet(unsigned long arg) +static void jme_tx_clean_tasklet(struct tasklet_struct *t) { - struct jme_adapter *jme = (struct jme_adapter *)arg; + struct jme_adapter *jme = from_tasklet(jme, t, txclean_task); struct jme_ring *txring = &(jme->txring[0]); struct txdesc *txdesc = txring->desc; struct jme_buffer_info *txbi = txring->bufinf, *ctxbi, *ttxbi; @@ -1834,14 +1832,10 @@ jme_open(struct net_device *netdev) jme_clear_pm_disable_wol(jme); JME_NAPI_ENABLE(jme); - tasklet_init(&jme->linkch_task, jme_link_change_tasklet, - (unsigned long) jme); - tasklet_init(&jme->txclean_task, jme_tx_clean_tasklet, - (unsigned long) jme); - tasklet_init(&jme->rxclean_task, jme_rx_clean_tasklet, - (unsigned long) jme); - tasklet_init(&jme->rxempty_task, jme_rx_empty_tasklet, - (unsigned long) jme); + tasklet_setup(&jme->linkch_task, jme_link_change_tasklet); + tasklet_setup(&jme->txclean_task, jme_tx_clean_tasklet); + tasklet_setup(&jme->rxclean_task, jme_rx_clean_tasklet); + tasklet_setup(&jme->rxempty_task, jme_rx_empty_tasklet); rc = jme_request_irq(jme); if (rc) @@ -3040,9 +3034,7 @@ jme_init_one(struct pci_dev *pdev, atomic_set(&jme->tx_cleaning, 1); atomic_set(&jme->rx_empty, 1); - tasklet_init(&jme->pcc_task, - jme_pcc_tasklet, - (unsigned long) jme); + tasklet_setup(&jme->pcc_task, jme_pcc_tasklet); jme->dpi.cur = PCC_P1; jme->reg_ghc = 0; From patchwork Mon Aug 17 08:24:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30024109B for ; Mon, 17 Aug 2020 08:27:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1889D20658 for ; Mon, 17 Aug 2020 08:27:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FPU+w3ND" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728270AbgHQI0R (ORCPT ); Mon, 17 Aug 2020 04:26:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbgHQI0G (ORCPT ); Mon, 17 Aug 2020 04:26:06 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22EF5C061388; Mon, 17 Aug 2020 01:26:05 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id d4so7338233pjx.5; Mon, 17 Aug 2020 01:26:05 -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; bh=cL9JEmBEHVr7j+h/t21HJyCd1D6huw3HDaRf1+0pC7c=; b=FPU+w3NDPol567vC+h/ZbTlRf2kz8vO1fFt9hvJys9Ppxj1YeH8QP1vbGeucslM6P0 Im1necIo+mxJGaKwhjo+ScTY3KUflAYspI4/wzqj1sWuvWLhM6e9CoyKQjR3vWs1ikX2 PJ3SFrUqKBN7RrjeFJC5ScMlVN4+/BGn0dqN80T1Cm4XmoQT/wlra+F7rGPNWJAiesRI ArrrkVKF8Uu38hcYnKkiFG0HM1hqETjnLfmDrVnENXPGFquqETDot1namxUVLPK7p2Dj 0l319BCnw7iS/FBOzZeUsQrgv1jRKBX8OLhkOu5HWCW7yfhayCha6zoXqXzv0eMxW7Fo m8EQ== 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; bh=cL9JEmBEHVr7j+h/t21HJyCd1D6huw3HDaRf1+0pC7c=; b=iwmD+PIuEo1aQITUyQ5odq+UtZby8yrZLOqvOwp9lpldt7MMLy4ArgxW2S6eMuGj0u uHfgpf9//zX2yNcV647ZB33PJBBMDSem4/etxegLjD5CRJcVXwQKGL/GNuLGYZFymYXT HO8Mlztm2LXVs7Amz0bXwbkm2A9tSgwuswoi2PmtEhN6bEH4HKybLMqzTERb8V51gS6M yUCicmnUDkCK/CoWvHzznXgA+uAHor9eIgpgKAHIQ6ksVWLP7F3xtkApoN71u/PWs2x6 2i3HWfXlSv0818kjrhYAy9juhjvBGDQ3zt6Y2iNomabGjBZDE6iWw4aTyys5LgKDO49k 4g6Q== X-Gm-Message-State: AOAM530qLkXtLAlheIv+33TJoHVVu3mH07B/kEAsPt3q6iZoKJrTT4LQ 2jCgUZ4fWnpn/5pWvJOxebA= X-Google-Smtp-Source: ABdhPJwIeOMMqSxIZ7onJbrSMiRju8pATc7y+zI7a+Unpdh2nCA4eorIzXR73r8269HMrnvzGnz7Cg== X-Received: by 2002:a17:90a:8589:: with SMTP id m9mr11878650pjn.109.1597652764728; Mon, 17 Aug 2020 01:26:04 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:04 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 12/20] ethernet: marvell: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:26 +0530 Message-Id: <20200817082434.21176-14-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 b792f6306a64..55fe901d3562 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 Aug 17 08:24:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12989109B for ; Mon, 17 Aug 2020 08:28:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE6C6207DF for ; Mon, 17 Aug 2020 08:28:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="otat+96Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbgHQI0P (ORCPT ); Mon, 17 Aug 2020 04:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbgHQI0L (ORCPT ); Mon, 17 Aug 2020 04:26:11 -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 156D2C061389; Mon, 17 Aug 2020 01:26:11 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id j21so7758563pgi.9; Mon, 17 Aug 2020 01:26:11 -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; bh=LRELbPqR4H2GsBf42vIj1N6+LHAP+fOiPedK4s80ki0=; b=otat+96QX4E0shqrTefnR4GkOB49aUvSVKbnL7/VBjiLwDUlTvRWjTURZXsja58sCq RHI2HzvFXCMGwE3+hpW1aNPhIflGrGkqdnjyoODzpOHL00DkFTHOLVovno6ajHOHxvk4 ChRza9d/UxgbEG5Ihwte7Am1DQ8pkbnmu8CdfLJqT0bIk4INOw7Ukkpe73aUBBe1IYyH vywyBC6P6iGhEtUsh4aEKbxirc7op1DN65LIkbp/J4PK2n6kLDmuml93c/zq4lQyzWTY qpErDD3GEJmlIu5V258akBqIkv63IYrvsGyddqRuUs86U81ZgH5dAix6eJn4TMGI3Oul 3pgQ== 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; bh=LRELbPqR4H2GsBf42vIj1N6+LHAP+fOiPedK4s80ki0=; b=e65fz3SKV3Kko+MM4BH3isyAcchhVPmXYxZ73Bn4DUPVVeS8D+c/jmAG9n6WC51n7t nAtUcQo0lyJZAV+6o0kPcjPTuwn0HyvpeovF7KI6O1HdCreeUfIRVT3E1/1vl1Ds4piY 3pn8kTYhRXl5ssr+g/2LEFpP2b5V6A9ZF8UPCxE9SWdkhnn008z71pVEo3CZSdPrF8nV dw7gMx+jpi6vQ3e3UahO4/hWHmm2m9nKdg+AWP6i50nysSMSowUoJW5ZTYU5PqUjm8ok 9u1Sd7nZfw4nC3Oi2zQMkxrYXDey9AEpdr74Zh9zcMXX1lure7lwHgH08uFPGHEhzrjT ssxQ== X-Gm-Message-State: AOAM532BHOuKVaQsJULWH75U5M/whIYodC5Uof7kukLT8ValO+DBggZ7 sWIo54Ul2BrvbSHnLtjwVfM= X-Google-Smtp-Source: ABdhPJw9JscYSDr2Eabd11czCU5vzlDfIp8vk9Zn+NV6Awwm3kesY5jR5XHrbatn2NNjcsgM1aiNew== X-Received: by 2002:a63:ee12:: with SMTP id e18mr8907549pgi.1.1597652770583; Mon, 17 Aug 2020 01:26:10 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:10 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 13/20] ethernet: mellanox: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:27 +0530 Message-Id: <20200817082434.21176-15-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/mellanox/mlx4/cq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx4/eq.c | 3 +-- drivers/net/ethernet/mellanox/mlx4/mlx4.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/cq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 3 +-- drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c | 7 +++---- drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h | 2 +- drivers/net/ethernet/mellanox/mlxsw/pci.c | 12 ++++++------ 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/cq.c b/drivers/net/ethernet/mellanox/mlx4/cq.c index 65f8a4b6ed0c..3b8576b9c2f9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/cq.c @@ -55,11 +55,11 @@ #define TASKLET_MAX_TIME 2 #define TASKLET_MAX_TIME_JIFFIES msecs_to_jiffies(TASKLET_MAX_TIME) -void mlx4_cq_tasklet_cb(unsigned long data) +void mlx4_cq_tasklet_cb(struct tasklet_struct *t) { unsigned long flags; unsigned long end = jiffies + TASKLET_MAX_TIME_JIFFIES; - struct mlx4_eq_tasklet *ctx = (struct mlx4_eq_tasklet *)data; + struct mlx4_eq_tasklet *ctx = from_tasklet(ctx, t, task); struct mlx4_cq *mcq, *temp; spin_lock_irqsave(&ctx->lock, flags); diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index ae305c2e9225..9e48509ed3b2 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c @@ -1057,8 +1057,7 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, INIT_LIST_HEAD(&eq->tasklet_ctx.list); INIT_LIST_HEAD(&eq->tasklet_ctx.process_list); spin_lock_init(&eq->tasklet_ctx.lock); - tasklet_init(&eq->tasklet_ctx.task, mlx4_cq_tasklet_cb, - (unsigned long)&eq->tasklet_ctx); + tasklet_setup(&eq->tasklet_ctx.task, mlx4_cq_tasklet_cb); return err; diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index 527b52e48276..64bed7ac3836 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h @@ -1217,7 +1217,7 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev); int mlx4_comm_cmd(struct mlx4_dev *dev, u8 cmd, u16 param, u16 op, unsigned long timeout); -void mlx4_cq_tasklet_cb(unsigned long data); +void mlx4_cq_tasklet_cb(struct tasklet_struct *t); void mlx4_cq_completion(struct mlx4_dev *dev, u32 cqn); void mlx4_cq_event(struct mlx4_dev *dev, u32 cqn, int event_type); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cq.c b/drivers/net/ethernet/mellanox/mlx5/core/cq.c index 8379b24cb838..df3e4938ecdd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c @@ -42,11 +42,11 @@ #define TASKLET_MAX_TIME 2 #define TASKLET_MAX_TIME_JIFFIES msecs_to_jiffies(TASKLET_MAX_TIME) -void mlx5_cq_tasklet_cb(unsigned long data) +void mlx5_cq_tasklet_cb(struct tasklet_struct *t) { unsigned long flags; unsigned long end = jiffies + TASKLET_MAX_TIME_JIFFIES; - struct mlx5_eq_tasklet *ctx = (struct mlx5_eq_tasklet *)data; + struct mlx5_eq_tasklet *ctx = from_tasklet(ctx, t, task); struct mlx5_core_cq *mcq; struct mlx5_core_cq *temp; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 31ef9f8420c8..ec38405d467f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -788,8 +788,7 @@ static int create_comp_eqs(struct mlx5_core_dev *dev) INIT_LIST_HEAD(&eq->tasklet_ctx.list); INIT_LIST_HEAD(&eq->tasklet_ctx.process_list); spin_lock_init(&eq->tasklet_ctx.lock); - tasklet_init(&eq->tasklet_ctx.task, mlx5_cq_tasklet_cb, - (unsigned long)&eq->tasklet_ctx); + tasklet_setup(&eq->tasklet_ctx.task, mlx5_cq_tasklet_cb); eq->irq_nb.notifier_call = mlx5_eq_comp_int; param = (struct mlx5_eq_param) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c index 831d2c39e153..9f6d97eae0ae 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c @@ -388,9 +388,9 @@ static inline void mlx5_fpga_conn_cqes(struct mlx5_fpga_conn *conn, mlx5_fpga_conn_arm_cq(conn); } -static void mlx5_fpga_conn_cq_tasklet(unsigned long data) +static void mlx5_fpga_conn_cq_tasklet(struct tasklet_struct *t) { - struct mlx5_fpga_conn *conn = (void *)data; + struct mlx5_fpga_conn *conn = from_tasklet(conn, t, cq.tasklet); if (unlikely(!conn->qp.active)) return; @@ -478,8 +478,7 @@ static int mlx5_fpga_conn_create_cq(struct mlx5_fpga_conn *conn, int cq_size) conn->cq.mcq.comp = mlx5_fpga_conn_cq_complete; conn->cq.mcq.irqn = irqn; conn->cq.mcq.uar = fdev->conn_res.uar; - tasklet_init(&conn->cq.tasklet, mlx5_fpga_conn_cq_tasklet, - (unsigned long)conn); + tasklet_setup(&conn->cq.tasklet, mlx5_fpga_conn_cq_tasklet); mlx5_fpga_dbg(fdev, "Created CQ #0x%x\n", conn->cq.mcq.cqn); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h index 4aaca7400fb2..078a7cc29bf0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h @@ -77,7 +77,7 @@ int mlx5_eq_add_cq(struct mlx5_eq *eq, struct mlx5_core_cq *cq); void mlx5_eq_del_cq(struct mlx5_eq *eq, struct mlx5_core_cq *cq); struct mlx5_eq_comp *mlx5_eqn2comp_eq(struct mlx5_core_dev *dev, int eqn); struct mlx5_eq *mlx5_get_async_eq(struct mlx5_core_dev *dev); -void mlx5_cq_tasklet_cb(unsigned long data); +void mlx5_cq_tasklet_cb(struct tasklet_struct *t); struct cpumask *mlx5_eq_comp_cpumask(struct mlx5_core_dev *dev, int ix); u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq_comp *eq); diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c index 1c64b03ff48e..641cdd81882b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c @@ -620,9 +620,9 @@ static char *mlxsw_pci_cq_sw_cqe_get(struct mlxsw_pci_queue *q) return elem; } -static void mlxsw_pci_cq_tasklet(unsigned long data) +static void mlxsw_pci_cq_tasklet(struct tasklet_struct *t) { - struct mlxsw_pci_queue *q = (struct mlxsw_pci_queue *) data; + struct mlxsw_pci_queue *q = from_tasklet(q, t, tasklet); struct mlxsw_pci *mlxsw_pci = q->pci; char *cqe; int items = 0; @@ -733,9 +733,9 @@ static char *mlxsw_pci_eq_sw_eqe_get(struct mlxsw_pci_queue *q) return elem; } -static void mlxsw_pci_eq_tasklet(unsigned long data) +static void mlxsw_pci_eq_tasklet(struct tasklet_struct *t) { - struct mlxsw_pci_queue *q = (struct mlxsw_pci_queue *) data; + struct mlxsw_pci_queue *q = from_tasklet(q, t, tasklet); struct mlxsw_pci *mlxsw_pci = q->pci; u8 cq_count = mlxsw_pci_cq_count(mlxsw_pci); unsigned long active_cqns[BITS_TO_LONGS(MLXSW_PCI_CQS_MAX)]; @@ -792,7 +792,7 @@ struct mlxsw_pci_queue_ops { struct mlxsw_pci_queue *q); void (*fini)(struct mlxsw_pci *mlxsw_pci, struct mlxsw_pci_queue *q); - void (*tasklet)(unsigned long data); + void (*tasklet)(struct tasklet_struct *t); u16 (*elem_count_f)(const struct mlxsw_pci_queue *q); u8 (*elem_size_f)(const struct mlxsw_pci_queue *q); u16 elem_count; @@ -855,7 +855,7 @@ static int mlxsw_pci_queue_init(struct mlxsw_pci *mlxsw_pci, char *mbox, q->pci = mlxsw_pci; if (q_ops->tasklet) - tasklet_init(&q->tasklet, q_ops->tasklet, (unsigned long) q); + tasklet_setup(&q->tasklet, q_ops->tasklet); mem_item->size = MLXSW_PCI_AQ_SIZE; mem_item->buf = pci_alloc_consistent(mlxsw_pci->pdev, From patchwork Mon Aug 17 08:24:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66394109B for ; Mon, 17 Aug 2020 08:26:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ED102063A for ; Mon, 17 Aug 2020 08:26:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LBLxHBYX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728412AbgHQI0X (ORCPT ); Mon, 17 Aug 2020 04:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbgHQI0S (ORCPT ); Mon, 17 Aug 2020 04:26:18 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 809D8C061388; Mon, 17 Aug 2020 01:26:18 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id s14so1164890plp.4; Mon, 17 Aug 2020 01:26:18 -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; bh=NGc9GivMW4Gl2PZYS1sshtdVeD119m/l6GvQX46weos=; b=LBLxHBYXHHShApS1V6EqhqlERMx39IJoGg9XyyNS0xxKKPf7wzJlvUp7OZH7MsJNbk Hhy8KpiRMnmdXLU49x03cAV9Hb30GjB3mLnkNXIVN7t7SxDQ0pzRJNjp101YiuBGrc6h +OaSLNfkE2xI7g79vNgCQ+sgLmy75Y0bBKtNhkfSvXuudjABMDUQL5Enx7nI0chgO32d t5Vq04PRATxJxYQ15CIpAo/xswWJNmoEItx+gz7uWetOIqMKbHGTpI5tFRruhMbNCxzv d36pjAk2F3GLgsY9HZ1tEBwdbzTGHHfWhsaWugChVMUm6Bu0PrSMhwW9pPUh7m5In5hF 8d0w== 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; bh=NGc9GivMW4Gl2PZYS1sshtdVeD119m/l6GvQX46weos=; b=WbehfnymTJS+u/d4NtI1QlPz8bVfbZnnukB/8Dmkm7zzrQDKwUv0uSpi1YFNI6+sxs yZ72oSii+Ayeg7m7c0V4MpeGJfyTQirk8cpW/AUeQuzHSxY95hz9CROweSEgOcat4Pcf ByfCHyJK8Nyjhd6mRDLsJOFXNh414yJRztuZAtb6/DsiKFV1/YoeoBz8sg+nNyjZNH2i 05hDaw7kmrQrryG26Tide2RvnV3vwev+aOK7Y76i+QouvBae/sNh4FYXkXjc471vL7dD 55aGbE8n6mFr7vunfROoFAiul2hxEcqg6jzAm1ei6uh/bbl5gLQ0EW0xm1uJGUxXWniw TTtw== X-Gm-Message-State: AOAM531tIP2JDNXu3V/jpXaJVFJ0H5/xd8YK4tt2KCoYPmN3N7d97v4T xcPcmcWDcIrKk8NEGgEKgG0= X-Google-Smtp-Source: ABdhPJwRCnCkq0qh6UezjQA0oYu6vWfa6QDQxH8Q19OL3Crbp/QUQGdhIqlSJxXrujdjDsmyU1xEDw== X-Received: by 2002:a17:90b:208:: with SMTP id fy8mr11168449pjb.131.1597652778097; Mon, 17 Aug 2020 01:26:18 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:17 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 14/20] ethernet: micrel: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:28 +0530 Message-Id: <20200817082434.21176-16-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 | 19 ++++++++++--------- drivers/net/ethernet/micrel/ksz884x.c | 14 ++++++-------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c index f3f6dfe3eddc..8fd32f98c494 100644 --- a/drivers/net/ethernet/micrel/ks8842.c +++ b/drivers/net/ethernet/micrel/ks8842.c @@ -587,10 +587,11 @@ 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 = (struct net_device *)((char *)adapter - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); 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 +721,11 @@ 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 = (struct net_device *)((char *)adapter - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); u16 isr; unsigned long flags; u16 entry_bank; @@ -953,8 +955,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 +1174,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 Aug 17 08:24:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AC34109B for ; Mon, 17 Aug 2020 08:27:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72F5D20658 for ; Mon, 17 Aug 2020 08:27:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XNx3Kz/k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726361AbgHQI1T (ORCPT ); Mon, 17 Aug 2020 04:27:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbgHQI0Z (ORCPT ); Mon, 17 Aug 2020 04:26:25 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9861AC061388; Mon, 17 Aug 2020 01:26:25 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id t6so7348674pjr.0; Mon, 17 Aug 2020 01:26:25 -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; bh=Df7yxK//cmVxvAkf6cXduXiAsh32H2X5cVsb6K8GHGM=; b=XNx3Kz/kSLSRc7VTJus4z7RYdORZ86+CFl9HXiWO+FTTDyVpTDjj3setW6Q8pT38mh NmOs1/ct0cRXsbBeRTwvx4W1afRcRX6p+G7YG0U9cG5hRYgnLqPpAHCICNeXp8/3MONy Xb3t+Azgude6qcZ6sxW9JZsKZzsk9pUn+LymdgQuENerjmXXr6xtfYbelZuiw41dEIdz P0wXQ2PtBLxCES+dmV6SBamPReFvL3SyU1HWQp3U4mxHPklRPF+So6pXcy8/wvv8Fb3R /UdfL3Ca2orJ4GrTPiExKanCPWj2W3yP+gt/KsqbHMJLz7Lpae2Pp5SYue11557317bf LDcw== 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; bh=Df7yxK//cmVxvAkf6cXduXiAsh32H2X5cVsb6K8GHGM=; b=faxjoWPYRJnQEW9g98fuS9hx49aen021prBJqSg+9Eq/93V1rFw0xg0bRDsrbHPoDE dt2u2T9TYOmkYd7J7Bdg4GeKEiiHXr4UI/jmtZqPzKLucFAEXYUrwPj+LAREWqHgBSaq kvi11bji5LD5HyzGc06BgriiTl8l62lRGykiDmgdP8y2AL4nObVTUk4TJzKoSMroXPYU PLfNwyqo3LeQhtm0XllrLlxCyGQkvTO68x/Co1lhb9GxmdeGYLyVPcPmss67+Iwv69L2 lmfLgvffNhLOADkg14adjiJaTrF98VyFp2hjZ0BklXPhY+lD2BdEKiOfpFSg0omM/bas GlGQ== X-Gm-Message-State: AOAM532Fa1R2v7yLmI/uSomPL2OeHpS2LYcXNFnovMASPy3yBIlnALHL te9GO2oPmUimVnqQKKQt26g= X-Google-Smtp-Source: ABdhPJy25qZkwLdPxae9MaYOKgL9LadrOvMoVqZOA4GCkZihBoxS6mmIhsQz13i9lJFXT11QTvGjjQ== X-Received: by 2002:a17:902:264:: with SMTP id 91mr10638591plc.88.1597652785215; Mon, 17 Aug 2020 01:26:25 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:24 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 15/20] ethernet: natsemi: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:29 +0530 Message-Id: <20200817082434.21176-17-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/natsemi/ns83820.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c index 8e24c7acf79b..9157c1bffc79 100644 --- a/drivers/net/ethernet/natsemi/ns83820.c +++ b/drivers/net/ethernet/natsemi/ns83820.c @@ -923,10 +923,10 @@ static void rx_irq(struct net_device *ndev) spin_unlock_irqrestore(&info->lock, flags); } -static void rx_action(unsigned long _dev) +static void rx_action(struct tasklet_struct *t) { - struct net_device *ndev = (void *)_dev; - struct ns83820 *dev = PRIV(ndev); + struct ns83820 *dev = from_tasklet(dev, t, rx_tasklet); + struct net_device *ndev = dev->ndev; rx_irq(ndev); writel(ihr, dev->base + IHR); @@ -1927,7 +1927,7 @@ static int ns83820_init_one(struct pci_dev *pci_dev, SET_NETDEV_DEV(ndev, &pci_dev->dev); INIT_WORK(&dev->tq_refill, queue_refill); - tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)ndev); + tasklet_setup(&dev->rx_tasklet, rx_action); err = pci_enable_device(pci_dev); if (err) { From patchwork Mon Aug 17 08:24:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716885 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92A86109B for ; Mon, 17 Aug 2020 08:27:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AD3420658 for ; Mon, 17 Aug 2020 08:27:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="R1csLVhA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728317AbgHQI0f (ORCPT ); Mon, 17 Aug 2020 04:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728036AbgHQI0b (ORCPT ); Mon, 17 Aug 2020 04:26:31 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C187C061389; Mon, 17 Aug 2020 01:26:31 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id k13so7122010plk.13; Mon, 17 Aug 2020 01:26: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; bh=sk5rpeS55SBVIoCz+MRV7vl3Lfu/wV4G0MR5a0P4VHA=; b=R1csLVhAJxc3yHfRuiOVfIM1K1da22Ewqk4d+S/8PeGJ+32fz7zhRbnJDPHJJDKTdz 0HXIvVZM3am+i1sKz3hJwGy+Hli5AXl4Fb58zCp5uP0o3pJy80XMhYkUYI8bKRzc0a0o x2TKcQ+dmZMMxwrb2J5ATfaA13xUGsPJruvFtyp4VyUwo47tTFqIxVatUxhNaH4YQfv/ mLR9OJhnOIPZ1lAuRwbu8D8nldBsUf/goYQQw3AvOSROT7WNe/UrLkPwTGNuZWTZULaS LEE21diiOErwWO2gIY0BjuOb8+ndEMhUNA/J5gB5GjdJoiJkQeHR/akuo2r5p+ATFRRP 5D4Q== 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; bh=sk5rpeS55SBVIoCz+MRV7vl3Lfu/wV4G0MR5a0P4VHA=; b=XaJrdYSQwl96jOBU6ce+kj6GENjm3nEv8l8xZnkL6Yg/4nhxsW2OJeEGnbxNXw8yiA 4u178yeR4k9urCe3DVw19yhlfD6QphQRsa2UP+qKaS40pwjIiNGl7HNHq0dCfOAZEtrQ Di1vBKVYz8llo19/PZW7G8wRJXTqyTXLW8FxOM2RWNlAYmi5szGeP2pOQ3RNMl/DUES5 n4wAqDbv1Ndg9/cJ0+h6veMBokBAPiofZNWUOn5NJQKyNJAlUYNi3/jXL0JIKa8bTCfF PxUig3j4y53A1YXlQ7jeBEp5C0he0OwTT2LFoy4sCPkpk0DmKILBZpnVOu0m+/q9fvxK oRsw== X-Gm-Message-State: AOAM531IiBJx28HeZi5hes0JRao5JCj1TRqvFj0vxVMbRiWmijIIbhb8 1cX2YLkZgnO5Tu5IuiWK7n0= X-Google-Smtp-Source: ABdhPJxel0tdqet5sG9IVVMDhmbxE47JSymBZcwF/5VCrNzd2cjfx/50fzzPWqn2s+vAy5zva75SdQ== X-Received: by 2002:a17:90b:3197:: with SMTP id hc23mr11408391pjb.110.1597652790990; Mon, 17 Aug 2020 01:26:30 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:30 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 16/20] ethernet: netronome: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:30 +0530 Message-Id: <20200817082434.21176-18-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 Reviewed-by: Simon Horman --- 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 39ee23e8c0bf..1dcd24d899f5 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 Aug 17 08:24:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0969215E4 for ; Mon, 17 Aug 2020 08:27:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6AB020658 for ; Mon, 17 Aug 2020 08:27:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EMmUPSbN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728453AbgHQI0j (ORCPT ); Mon, 17 Aug 2020 04:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726361AbgHQI0i (ORCPT ); Mon, 17 Aug 2020 04:26:38 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BA70C061388; Mon, 17 Aug 2020 01:26:38 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id f10so7131539plj.8; Mon, 17 Aug 2020 01:26:38 -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; bh=o0FMk4NSKHdON29FQ/delLJrHAtl7s1b3Zn2ITn/KyQ=; b=EMmUPSbN+4ipANeDlXBtAnB3UwDY9H6TP8yOz6wWku97mB6+sfEUFOlpE72g1O6h+G eKrUOejHzvHY6tyzDx+IDTwXdbaK3zLGMU/M598ekvxCtnC/7d5d6ZCR/ZcR2UAv3fbe VACi+Zor+zAIOATP/Yas9HdBtd3o20TU5dAvVWXl0gbWV28T+49O1BKHmxBFxvmklfmt SPVaLg+2T0xkD0oIgr1nz1XfAk640XPjM5ZOfmUjy+0G9gOsCqrDT81YmPmeM6i4QCL5 edf5DD3C4xCx1GBFsyuZiKQ42c55kRmRuEvQqQ6C2gxiwS4bNYibBkfB32keH/g72ew7 ErFQ== 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; bh=o0FMk4NSKHdON29FQ/delLJrHAtl7s1b3Zn2ITn/KyQ=; b=ojYs/Cb17MCxM0S8grC8fWkahlgIj1brbIY+WupEzSEeJPnHXFtEuDSUwAr3RXrdZc egAbyBfs6J27bZZCoeVWtHFvMM4bPhLZdOGaExw88uU9SR6EPfMCsWOhczcCtkYFlmAz eK44YyVYEJGaIY5xuUp+cCM8xPLJzH/AR4zArtIrRbJIjGCo9xuBVdY99Ya3cPqGOUhB NEUQX9DoYATJyLyC5lLPJ4JSw/ntUDRud1oC2sDQmDOovVzw7D6CNWJ4+k+okMJGq8il tMV0dSRDaKIROySXR0tNqia+yCKuOfjCB7fwdc512wtdbgV+3fAsXSxkRWLpnAe69vrg iqaQ== X-Gm-Message-State: AOAM531sDdsiqUu0gtsRL3kWkrG1Zugu4XMG47Gxu/MdFWHugr0IyEY3 pyXxvryyv+BAZOer9611Fxo= X-Google-Smtp-Source: ABdhPJybXxJ+dBHrJmIu3dZ4nk6KLcetVg87DxiqclRyCqvNLKi590hC96D0VCcPHISVJroeNA4prQ== X-Received: by 2002:a17:90a:eb17:: with SMTP id j23mr11335001pjz.151.1597652797309; Mon, 17 Aug 2020 01:26:37 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:36 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 17/20] ethernet: ni: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:31 +0530 Message-Id: <20200817082434.21176-19-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/ni/nixge.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index 4075f5e59955..a6861df9904f 100644 --- a/drivers/net/ethernet/ni/nixge.c +++ b/drivers/net/ethernet/ni/nixge.c @@ -787,9 +787,9 @@ static irqreturn_t nixge_rx_irq(int irq, void *_ndev) return IRQ_HANDLED; } -static void nixge_dma_err_handler(unsigned long data) +static void nixge_dma_err_handler(struct tasklet_struct *t) { - struct nixge_priv *lp = (struct nixge_priv *)data; + struct nixge_priv *lp = from_tasklet(lp, t, dma_err_tasklet); struct nixge_hw_dma_bd *cur_p; struct nixge_tx_skb *tx_skb; u32 cr, i; @@ -879,8 +879,7 @@ static int nixge_open(struct net_device *ndev) phy_start(phy); /* Enable tasklets for Axi DMA error handling */ - tasklet_init(&priv->dma_err_tasklet, nixge_dma_err_handler, - (unsigned long)priv); + tasklet_setup(&priv->dma_err_tasklet, nixge_dma_err_handler); napi_enable(&priv->napi); From patchwork Mon Aug 17 08:24:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E2E91392 for ; Mon, 17 Aug 2020 08:26:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3046220658 for ; Mon, 17 Aug 2020 08:26:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="q2oQHhau" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbgHQI0t (ORCPT ); Mon, 17 Aug 2020 04:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726361AbgHQI0o (ORCPT ); Mon, 17 Aug 2020 04:26:44 -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 CF612C061388; Mon, 17 Aug 2020 01:26:43 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id x25so7879036pff.4; Mon, 17 Aug 2020 01:26:43 -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; bh=6qyozdS/HY6iP3pJn34oXGwxmex8vXqKSC7ndq5S0+E=; b=q2oQHhau5wkJr9NInhJu5fE2VdKCd1EkLjYux32PbZTXlQngJzWocDupZm/kBW2Kiz dFj+fxNqeU9gSpwMAnm5ifUK/UvC7G6Gz7w+dO+f67FuU68h3NHlc/QIBv4tkgmBOEd7 gC5PgRXq4foSSBUP8Ab+lUlYTcA38ELa9LmZo3Pl1jS7EK0eSdBng6Z+p87nMU2Ge9kG fSao/+V4n2LBre36fqGn0jExgpz6kiLkzkE4jBQAahoM4dG5hAZRh3jcvIFSO+xF2o5J JrrQaglNJraJ/mK529ZCW8IYLwkEjfJ2NlNWIC5/DZoaoNel88Kv0sDoOCkUFsyN4dH1 cwGA== 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; bh=6qyozdS/HY6iP3pJn34oXGwxmex8vXqKSC7ndq5S0+E=; b=ipvCIJMIQZPMxf0XNt+36Z89Z/bDD6hxO1LWthGJlxDsFF4WGeVJwy31x0Tukd6WeS D8feK+fdTcGDv1ZGOLGqrhNFHobNeL3xvHGT5OPzGxX2NP3BlJ5hAQx/LlSPW/dHrULv VzNo9qQLtfQkCRpcfEzV4i6X2XHPIlJ1y362pvsf9SnkY6lZnUhTJ+kl3e76alCUyRiG +EW+z+iZiH1I7Law9sDnWKOk2X8kcGsy571bwbXdqyAdFhogFjnnA8bO+wbwVdQR2kb6 DS7XieDekh+Fk3dxc70OHnUACHeHRPrOuGxRv9PInTcv767aI57L6hNaDWW4zNzsPkuE ECmw== X-Gm-Message-State: AOAM530ohIw8Py5seFmZ/BuhcRH4ypXIwC0MDF+zaWB4i1W8sOfyLnCv 8xvrnq9e3q4nOFYt9GIfoT4= X-Google-Smtp-Source: ABdhPJwI0phYYxx8YzI2dUOWNrvQuNzl0QthOzgIy2DqMXnDA6ActFZPLcCUpF3zts7NRwPiPvawcQ== X-Received: by 2002:aa7:9e4e:: with SMTP id z14mr10775659pfq.60.1597652803372; Mon, 17 Aug 2020 01:26:43 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:42 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 18/20] ethernet: qlogic: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:32 +0530 Message-Id: <20200817082434.21176-20-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 2558cb680db3..4c4dd4e88fb1 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 Aug 17 08:24:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716881 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80CCD109B for ; Mon, 17 Aug 2020 08:27:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67DA220658 for ; Mon, 17 Aug 2020 08:27:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mVxdCAml" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727053AbgHQI1A (ORCPT ); Mon, 17 Aug 2020 04:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728007AbgHQI0t (ORCPT ); Mon, 17 Aug 2020 04:26:49 -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 36F16C061388; Mon, 17 Aug 2020 01:26:49 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id d22so7870247pfn.5; Mon, 17 Aug 2020 01:26:49 -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; bh=3SmzZTvbfXannYWzT1vvdfD+eue2ti3PQmFQt1sGqfI=; b=mVxdCAmlrwsYQJZWYKoyLuTHqKET9xgnJHVg1b42wEWATRvgN28vjs+9yxPGjjBj3q +BiTp1jESGn24Bvj7NdntB1gnuMTn62rZA4PSbpZd50xaRScVHCvIcGK1CGMN+NYrofh Zekg7tIE6a7JaiyzGOp+nzfFogg3zuhdg4c42EsDm26wgB0apPiElsclleFZiMioqKfD VwjM710zSNPJtu0FfHP/jI89WSWw0coLa+WZmZoA8uVe7Mwp7bvOcum3capp11m8AWJb 3/0K3H9ZhgQY1g0rj9s7ZxkyHWX3iaCNd+wsx8X4cWxiC8OJPL7q43XkcFApldAcZDcZ 9mwQ== 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; bh=3SmzZTvbfXannYWzT1vvdfD+eue2ti3PQmFQt1sGqfI=; b=VvDW7k+wLHWksNUGVap1FREKiRERtUr2uyPHKsoivTtFfs7STo2aDBhe1JGWMsmsWk xc7jeihOojbJQg4qwftmhrCrnjJXJDG1MEz0ZrERgZXxsa6OhNklN/g19oyPu9XhR6YP vG8hq0IoHX9uD6JppblaSbn8Y3plLSdOgEeqGZ8P4eu20hQpasvTK7DoLrMCpF3NbaQN JHUl9M/LcJJGCf1m8/z6oNtA880GrelzY/Dd5uYKaS2mk2hK7YHmNMnMFJOsBnLZu3Dm tinC+rzm62dLNYeVXqUtDdbejGnCWc3BbSVtboqagicvUZiHiNoW8LoFW5f62B+Mhi4D da6Q== X-Gm-Message-State: AOAM532+2NiRvquUEhQuUk19uhq71yyOCGlbjpDMB03zzYKKJ5XJL8FS Zdir0jU3KxdI5sQN0Y9YrU0= X-Google-Smtp-Source: ABdhPJye0HaIKIHr1tF33YyLaOR04c2pC3AzFAUznRzYhHDdY6IPyjwJWo+RevYkvnDPWaqS7Tie5A== X-Received: by 2002:aa7:9d04:: with SMTP id k4mr10414244pfp.256.1597652808813; Mon, 17 Aug 2020 01:26:48 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:48 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 19/20] ethernet: silan: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:33 +0530 Message-Id: <20200817082434.21176-21-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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/silan/sc92031.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/silan/sc92031.c b/drivers/net/ethernet/silan/sc92031.c index f94078f8ebe5..8d56eca5be17 100644 --- a/drivers/net/ethernet/silan/sc92031.c +++ b/drivers/net/ethernet/silan/sc92031.c @@ -829,10 +829,11 @@ static void _sc92031_link_tasklet(struct net_device *dev) } } -static void sc92031_tasklet(unsigned long data) +static void sc92031_tasklet(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct sc92031_priv *priv = netdev_priv(dev); + struct sc92031_priv *priv = from_tasklet(priv, t, tasklet); + struct net_device *dev = (struct net_device *)((char *)priv - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); void __iomem *port_base = priv->port_base; u32 intr_status, intr_mask; @@ -1108,7 +1109,7 @@ static void sc92031_poll_controller(struct net_device *dev) disable_irq(irq); if (sc92031_interrupt(irq, dev) != IRQ_NONE) - sc92031_tasklet((unsigned long)dev); + sc92031_tasklet(&priv->tasklet); enable_irq(irq); } #endif @@ -1446,7 +1447,7 @@ static int sc92031_probe(struct pci_dev *pdev, const struct pci_device_id *id) spin_lock_init(&priv->lock); priv->port_base = port_base; priv->pdev = pdev; - tasklet_init(&priv->tasklet, sc92031_tasklet, (unsigned long)dev); + tasklet_setup(&priv->tasklet, sc92031_tasklet); /* Fudge tasklet count so the call to sc92031_enable_interrupts at * sc92031_open will work correctly */ tasklet_disable_nosync(&priv->tasklet); From patchwork Mon Aug 17 08:24:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716879 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6229F1392 for ; Mon, 17 Aug 2020 08:27:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49B5920658 for ; Mon, 17 Aug 2020 08:27:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tdpwarCY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727961AbgHQI1A (ORCPT ); Mon, 17 Aug 2020 04:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726361AbgHQI04 (ORCPT ); Mon, 17 Aug 2020 04:26:56 -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 A99A7C061388; Mon, 17 Aug 2020 01:26:55 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id u128so7871609pfb.6; Mon, 17 Aug 2020 01:26: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; bh=lVv9KH9OHYQxfiTtM7sr/yrxc3VHJHaRO2GRJfzHnA0=; b=tdpwarCYYV8gEQ5ZksyKAt24uXKiAXb9mffYCIfGOHo6XRdKn3E/4d0a7jNVUxQglq SV6/7fuATPb///IcuEDDTQy3TJ09Q1W87uRD8n3gBQVMDEY+AhZVua01ADz8gmMn4X6i nfm9It6IQbwseLhnOfwPJUrm1lyCdalOqlvSZVMv0KDkIDIe3qq850RJhPZX578LBRk3 JOWeQLhC13jRH9ekm9SPnhrPyqSRYvPEVa8c8KfC1fyiaQebuzhJeeCTmaDDyw7hnXW7 3sd06wpWx4FeZO9QIEMGU9dvOliR2qloKLNMr/vJ1TEZEJxwBBUuWHb/5Cro85mZTxbd o4Vg== 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; bh=lVv9KH9OHYQxfiTtM7sr/yrxc3VHJHaRO2GRJfzHnA0=; b=tN0Izqryc8O/LRMyDMffTokJAp367WEnE2twMKsNrxaf6F1gsZVnvKX45kFh14bf/H ATPmqigs4CpkEYQhdMLagHT3a/ZniIxgKFJfHXQ9BtirmUZkHPd2g88B4F2pH8b522/U xbus5LILGkDdEuGM15ng1srXAJx13R4Uki6gbVjGz1g2XMYM2+L20JfQSSAO/VW3Q2C0 yIRPg4jfabaeVoc6LxfRsob73z7yEaGu4po5H0XqgMajSEYb7rFjdGvg404JiH0QrOwH BdGapTHwqvr071zhQW8Tj4/7o++ru1N1syLvO/+gA6kQ2wNowYTVLe0B6olA+n+90Jfg spVQ== X-Gm-Message-State: AOAM532WZwOKN8HMLdymEsnT/STxspUGxKI8X9iUac0dk4Fd3tq15sYK RcOZSCg23dytQ/mk3QCjBjQ= X-Google-Smtp-Source: ABdhPJwxI7njVddj/NNf3D82oUgJzonLqIGa7AYU/tTYlx3E4MoM1tP++tr/dbSigeWK25H0FtOm/g== X-Received: by 2002:a63:ee12:: with SMTP id e18mr8908728pgi.1.1597652814950; Mon, 17 Aug 2020 01:26:54 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:26:54 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 20/20] ethernet: smsc: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:34 +0530 Message-Id: <20200817082434.21176-22-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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;