From patchwork Mon Aug 17 08:28:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716921 X-Patchwork-Delegate: jgg@ziepe.ca 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 05924109B for ; Mon, 17 Aug 2020 08:29:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0DCD20658 for ; Mon, 17 Aug 2020 08:29:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hiDC4kHB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728537AbgHQI3J (ORCPT ); Mon, 17 Aug 2020 04:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728476AbgHQI3B (ORCPT ); Mon, 17 Aug 2020 04:29:01 -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 88047C061388; Mon, 17 Aug 2020 01:29:01 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id v15so7767268pgh.6; Mon, 17 Aug 2020 01:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XENeoBCKyWTtiUl0dpWZasQXBk+ronARsAja9/yaUcY=; b=hiDC4kHBdr9sGRb0O49pn7dK1h1n/1aohypTOAdIhkxy+HaIoti9xyh+c0fQwri9Hh 0i5ea2wAD6wJ1xki3DyGHyOt0GObl6K7/smyA04qbHyj2Uzd7BSAEkkgg7qi/bOTN2fY rnZlw8+ywWhYRGdn9qQ1n9wkZvTLpsUpsjPX6qf7JX6Uk9os1RJgZ7iNVIKr0pq+3pAQ dwyL5AzSAD4VMesHn2rCWgE+po3gUZgrS5oFvgPz5An23jEVAKspUGCCJ6JU+PyT2D+H FGJeMYH3nESiSaZ/aW0IDnmhW0Lwhnm009Wk5iU3Zxhx/iLK8agDlMQBfP9SoIXFE/qy Pxpw== 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=XENeoBCKyWTtiUl0dpWZasQXBk+ronARsAja9/yaUcY=; b=kW4W6Psm37muVadEjawKS9qCjZeW1u0a+5OXZ1PHCBnNtbtDKoCg/iXAeMDoRi3yj3 XdhDrW1zG5qSFABuqtFoXnU96X0q+Vv44CI1dDZQ1b+8VxOnqHcZPAzLWhVTv+8y075R eZLRZPtHg8ilZP9a20UUMH9Dx8IXxmp9cj0Yt++9sgp4EZXmlZfFLeBixrcAqYblpFoz Gq2ZIUW8bv/O352NdadK+yse9BIBO/3AjDavNz3vJwR1sm1ThYl49ayfvGrxCkUw6FXa 7/0ImF3tdrK3iNEetItEvUvG/F34K8ERrh4zqSsqvaQxjyUWIJBW3xJ+HxHNDW/Ie/wm umXw== X-Gm-Message-State: AOAM530rptWADfvF9hAabeBN8wlsSfKa4t+1WyZmMBwefEyQ/cqGOYPo F8Z6OZIVL8UE4Ja6e/FYAeY= X-Google-Smtp-Source: ABdhPJwDlt4tay3WDgrh7aIeyF6ut8/vBFV4jzLg2Yi/J2EtXODMALsepndnffA7lYPYM2qANeRmjw== X-Received: by 2002:a65:4786:: with SMTP id e6mr9186339pgs.258.1597652940902; Mon, 17 Aug 2020 01:29:00 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r7sm18948102pfl.186.2020.08.17.01.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:29:00 -0700 (PDT) From: Allen Pais To: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com, somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com, nareshkumar.pbs@broadcom.com Cc: keescook@chromium.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 1/5] infiniband: bnxt_re: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:58:40 +0530 Message-Id: <20200817082844.21700-2-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082844.21700-1-allen.lkml@gmail.com> References: <20200817082844.21700-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/infiniband/hw/bnxt_re/qplib_fp.c | 7 +++---- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 ++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 117b42349a28..62b01582aa1c 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -295,9 +295,9 @@ static void __wait_for_all_nqes(struct bnxt_qplib_cq *cq, u16 cnq_events) } } -static void bnxt_qplib_service_nq(unsigned long data) +static void bnxt_qplib_service_nq(struct tasklet_struct *t) { - struct bnxt_qplib_nq *nq = (struct bnxt_qplib_nq *)data; + struct bnxt_qplib_nq *nq = from_tasklet(nq, t, nq_tasklet); struct bnxt_qplib_hwq *hwq = &nq->hwq; int num_srqne_processed = 0; int num_cqne_processed = 0; @@ -448,8 +448,7 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx, nq->msix_vec = msix_vector; if (need_init) - tasklet_init(&nq->nq_tasklet, bnxt_qplib_service_nq, - (unsigned long)nq); + tasklet_setup(&nq->nq_tasklet, bnxt_qplib_service_nq); else tasklet_enable(&nq->nq_tasklet); diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index 4e211162acee..7261be29fb09 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -50,7 +50,7 @@ #include "qplib_sp.h" #include "qplib_fp.h" -static void bnxt_qplib_service_creq(unsigned long data); +static void bnxt_qplib_service_creq(struct tasklet_struct *t); /* Hardware communication channel */ static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie) @@ -79,7 +79,7 @@ static int __block_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie) goto done; do { mdelay(1); /* 1m sec */ - bnxt_qplib_service_creq((unsigned long)rcfw); + bnxt_qplib_service_creq(&rcfw->creq.creq_tasklet); } while (test_bit(cbit, cmdq->cmdq_bitmap) && --count); done: return count ? 0 : -ETIMEDOUT; @@ -369,10 +369,10 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, } /* SP - CREQ Completion handlers */ -static void bnxt_qplib_service_creq(unsigned long data) +static void bnxt_qplib_service_creq(struct tasklet_struct *t) { - struct bnxt_qplib_rcfw *rcfw = (struct bnxt_qplib_rcfw *)data; - struct bnxt_qplib_creq_ctx *creq = &rcfw->creq; + struct bnxt_qplib_creq_ctx *creq = from_tasklet(creq, t, creq_tasklet); + struct bnxt_qplib_rcfw *rcfw = container_of(creq, typeof(*rcfw), creq); u32 type, budget = CREQ_ENTRY_POLL_BUDGET; struct bnxt_qplib_hwq *hwq = &creq->hwq; struct creq_base *creqe; @@ -685,8 +685,7 @@ int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector, creq->msix_vec = msix_vector; if (need_init) - tasklet_init(&creq->creq_tasklet, - bnxt_qplib_service_creq, (unsigned long)rcfw); + tasklet_setup(&creq->creq_tasklet, bnxt_qplib_service_creq); else tasklet_enable(&creq->creq_tasklet); rc = request_irq(creq->msix_vec, bnxt_qplib_creq_irq, 0, From patchwork Mon Aug 17 08:28:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716929 X-Patchwork-Delegate: jgg@ziepe.ca 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 B4788109B for ; Mon, 17 Aug 2020 08:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97F0520758 for ; Mon, 17 Aug 2020 08:29:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nFhwiyKY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728542AbgHQI3U (ORCPT ); Mon, 17 Aug 2020 04:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbgHQI3G (ORCPT ); Mon, 17 Aug 2020 04:29:06 -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 4A490C061388; Mon, 17 Aug 2020 01:29:06 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id bh1so7130883plb.12; Mon, 17 Aug 2020 01:29: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=QbVmlo1JjJ+fo8Hrfp8jbDzD1XVMcpN4Uy9zDhtnXEE=; b=nFhwiyKYaN/p+nU496vwSTlNS/FvdfpnsO6ojTqcfaaQIxhpU62MP0r36KyEfgjbuZ E5Ow/NgfXHWYWsW+B/sUCnJ/wuB5rTEBzk1IfQBuRLoSSrsheDkqAe/DZgM4wFBl/2Ds xtrse3ZP2DeVHgpQ6PIKhoroSVqKswJU2+P+pkwDv6+zAsqGBR+beTorlXyS/HthOx7U eT66Z9cOigVFmhSrgcQeo4s+CZ1+H5yN6VpYaWLUDOlUClVUiyeRnG1o9xVenmw7YfK6 3JZEtC7Sa1iDnxtgnhj++0WdpcmglaLtacJVUkctt6fj8LDVOuQtDz4qoRyQB+oEAcwb C0Vw== 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=QbVmlo1JjJ+fo8Hrfp8jbDzD1XVMcpN4Uy9zDhtnXEE=; b=EzZy6COB3jW5Hp3Wxrj4RXWMm/RPFowLrqEaFbN7iANmt+FlkHVtgDtcu8btaECjMM DzXLyJUZM3v48iXRwSum169cfKcwGu0Skl3CgIir2u9HjFcSMk//LnT46zTcfKBDuCQV DzJB8sBLjk/IvwTnIXVW5iS61xEZ4bcmWi5z5aY/ntUMGHjSD818ORaszWZgxOnB4HXv vivfCAP18nNrnikJY0E64XOQ7cmnkqSduku34Bv6gSjxtzyW4kViBP6maFuWPV8v6wx3 uW2JlVrB9AUB99+NpaAmQoUJiWkAzMn1wWXIaEUZsS6DlfKt5EYCFFLrzyk76Ih3PUPC /WXA== X-Gm-Message-State: AOAM532udhKA9WR3RekmOmnqLx2CVLRIpTY1Hv3zHGQ6fEei/LehAnDk gwjmby7COnDFni5vYJVamWA= X-Google-Smtp-Source: ABdhPJyC0bW2sgtvg/KVBfYQhWrpGYO2POIZoL9zNCf+4WS0K+wAiFEcIL3nyF4QiNrd2JhYhPgLeg== X-Received: by 2002:a17:90a:c201:: with SMTP id e1mr11467481pjt.142.1597652945070; Mon, 17 Aug 2020 01:29:05 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r7sm18948102pfl.186.2020.08.17.01.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:29:04 -0700 (PDT) From: Allen Pais To: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com, somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com, nareshkumar.pbs@broadcom.com Cc: keescook@chromium.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 2/5] infiniband: hfi1: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:58:41 +0530 Message-Id: <20200817082844.21700-3-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082844.21700-1-allen.lkml@gmail.com> References: <20200817082844.21700-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/infiniband/hw/hfi1/sdma.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index 04575c9afd61..a307d4c8b15a 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c @@ -232,11 +232,11 @@ static const struct sdma_set_state_action sdma_action_table[] = { static void sdma_complete(struct kref *); static void sdma_finalput(struct sdma_state *); static void sdma_get(struct sdma_state *); -static void sdma_hw_clean_up_task(unsigned long); +static void sdma_hw_clean_up_task(struct tasklet_struct *); static void sdma_put(struct sdma_state *); static void sdma_set_state(struct sdma_engine *, enum sdma_states); static void sdma_start_hw_clean_up(struct sdma_engine *); -static void sdma_sw_clean_up_task(unsigned long); +static void sdma_sw_clean_up_task(struct tasklet_struct *); static void sdma_sendctrl(struct sdma_engine *, unsigned); static void init_sdma_regs(struct sdma_engine *, u32, uint); static void sdma_process_event( @@ -545,9 +545,10 @@ static void sdma_err_progress_check(struct timer_list *t) schedule_work(&sde->err_halt_worker); } -static void sdma_hw_clean_up_task(unsigned long opaque) +static void sdma_hw_clean_up_task(struct tasklet_struct *t) { - struct sdma_engine *sde = (struct sdma_engine *)opaque; + struct sdma_engine *sde = from_tasklet(sde, t, + sdma_hw_clean_up_task); u64 statuscsr; while (1) { @@ -604,9 +605,9 @@ static void sdma_flush_descq(struct sdma_engine *sde) sdma_desc_avail(sde, sdma_descq_freecnt(sde)); } -static void sdma_sw_clean_up_task(unsigned long opaque) +static void sdma_sw_clean_up_task(struct tasklet_struct *t) { - struct sdma_engine *sde = (struct sdma_engine *)opaque; + struct sdma_engine *sde = from_tasklet(sde, t, sdma_sw_clean_up_task); unsigned long flags; spin_lock_irqsave(&sde->tail_lock, flags); @@ -1454,11 +1455,10 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) sde->tail_csr = get_kctxt_csr_addr(dd, this_idx, SD(TAIL)); - tasklet_init(&sde->sdma_hw_clean_up_task, sdma_hw_clean_up_task, - (unsigned long)sde); - - tasklet_init(&sde->sdma_sw_clean_up_task, sdma_sw_clean_up_task, - (unsigned long)sde); + tasklet_setup(&sde->sdma_hw_clean_up_task, + sdma_hw_clean_up_task); + tasklet_setup(&sde->sdma_sw_clean_up_task, + sdma_sw_clean_up_task); INIT_WORK(&sde->err_halt_worker, sdma_err_halt_wait); INIT_WORK(&sde->flush_worker, sdma_field_flush); From patchwork Mon Aug 17 08:28:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716927 X-Patchwork-Delegate: jgg@ziepe.ca 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 8B3201392 for ; Mon, 17 Aug 2020 08:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70F1E20658 for ; Mon, 17 Aug 2020 08:29:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KsknIix+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728488AbgHQI3U (ORCPT ); Mon, 17 Aug 2020 04:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728538AbgHQI3K (ORCPT ); Mon, 17 Aug 2020 04:29:10 -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 11A72C061389; Mon, 17 Aug 2020 01:29:10 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id o5so7779115pgb.2; Mon, 17 Aug 2020 01:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kyykNXsE3aRum/D2mjnzWellPPbjCSwid9aYW2g2QvM=; b=KsknIix+Gt+AYiYSlj18kVAXTvxTjw5Y60M7D48aZobxD9xP453Z7a7cKXyjfVJUeN ut7gPar2PpD28gu0ptnZlbKzyg5ZK7UuUK2RvihxbacbWSLyHvBVItNrH8coeXMkVaPC 0Zljij06SGwwNg/+YEpASuPxvBbw4AdlwkEfPwTk/M+EPWcY9HDNQZiOlOMiQBNGIqNM iteBU5UWXzJalq8QrP80K8M2giC9OHXzpCsYzOX1m63dBQlOMJdBBo8YB7y4bU0Qi4Dw d63xIip7q96+OiZBRmgNE4ADsaXqXdPwXixrJAs7L+jCqWckaguNLis91EgR1rWH1lg0 7s3Q== 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=kyykNXsE3aRum/D2mjnzWellPPbjCSwid9aYW2g2QvM=; b=Yij8fk/esB0SLUVE/xXzcO+6RvLgpEg2UEnT4RkOTu/tJzDyN1DsbwrrxMZyUNqh/g qRdqBKO9k/AeyFFfMH6r9X/Zijjr5U9ZpFW04kj+BXdFHH48D6/Q5P7U3OHCQxik5FIW AlMzoiVIOiyOqX3aD831srZBEVNJObv2zrV1PD1VPIYGqpIr8Dnh451L1kxdTpQXyFOv w6azmn6HQBJZTJtsZ6+fC86LepNBjhk5Hk7wFs/flBx2lN/0tPeXTW9AE7hHU7RlPNJc zMWxABX1SUhOpoGl20ox0Ck3aFetfnwe//Eg9wn5Qhkt6EiCa/c6k+dAKmoBMCulV+R6 mPNg== X-Gm-Message-State: AOAM530w+5DrE2pElQlZtwdGbUhdqWhX450v6AQsxAL+2RMVhJaPyFGF KcfLtD8negcpLFvzsbwEe/o= X-Google-Smtp-Source: ABdhPJy9ZwzA3R8MBV5JgPU6iNWe82hPxsU/PzmwJHW4XyWHbM7285nXXrL2GFd30HQIHMG6Q2GJ2A== X-Received: by 2002:a63:36c6:: with SMTP id d189mr8696158pga.392.1597652949647; Mon, 17 Aug 2020 01:29:09 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r7sm18948102pfl.186.2020.08.17.01.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:29:09 -0700 (PDT) From: Allen Pais To: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com, somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com, nareshkumar.pbs@broadcom.com Cc: keescook@chromium.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 3/5] infiniband: i40iw: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:58:42 +0530 Message-Id: <20200817082844.21700-4-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082844.21700-1-allen.lkml@gmail.com> References: <20200817082844.21700-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/infiniband/hw/i40iw/i40iw_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c index 9c96ece5e7f3..229a0658ff18 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_main.c +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c @@ -192,9 +192,9 @@ static void i40iw_enable_intr(struct i40iw_sc_dev *dev, u32 msix_id) * i40iw_dpc - tasklet for aeq and ceq 0 * @data: iwarp device */ -static void i40iw_dpc(unsigned long data) +static void i40iw_dpc(struct tasklet_struct *t) { - struct i40iw_device *iwdev = (struct i40iw_device *)data; + struct i40iw_device *iwdev = from_tasklet(iwdev, t, dpc_tasklet); if (iwdev->msix_shared) i40iw_process_ceq(iwdev, iwdev->ceqlist); @@ -206,9 +206,9 @@ static void i40iw_dpc(unsigned long data) * i40iw_ceq_dpc - dpc handler for CEQ * @data: data points to CEQ */ -static void i40iw_ceq_dpc(unsigned long data) +static void i40iw_ceq_dpc(struct tasklet_struct *t) { - struct i40iw_ceq *iwceq = (struct i40iw_ceq *)data; + struct i40iw_ceq *iwceq = from_tasklet(iwceq, t, dpc_tasklet); struct i40iw_device *iwdev = iwceq->iwdev; i40iw_process_ceq(iwdev, iwceq); @@ -689,10 +689,10 @@ static enum i40iw_status_code i40iw_configure_ceq_vector(struct i40iw_device *iw enum i40iw_status_code status; if (iwdev->msix_shared && !ceq_id) { - tasklet_init(&iwdev->dpc_tasklet, i40iw_dpc, (unsigned long)iwdev); + tasklet_setup(&iwdev->dpc_tasklet, i40iw_dpc); status = request_irq(msix_vec->irq, i40iw_irq_handler, 0, "AEQCEQ", iwdev); } else { - tasklet_init(&iwceq->dpc_tasklet, i40iw_ceq_dpc, (unsigned long)iwceq); + tasklet_setup(&iwceq->dpc_tasklet, i40iw_ceq_dpc); status = request_irq(msix_vec->irq, i40iw_ceq_handler, 0, "CEQ", iwceq); } @@ -841,7 +841,7 @@ static enum i40iw_status_code i40iw_configure_aeq_vector(struct i40iw_device *iw u32 ret = 0; if (!iwdev->msix_shared) { - tasklet_init(&iwdev->dpc_tasklet, i40iw_dpc, (unsigned long)iwdev); + tasklet_setup(&iwdev->dpc_tasklet, i40iw_dpc); ret = request_irq(msix_vec->irq, i40iw_irq_handler, 0, "i40iw", iwdev); } if (ret) { From patchwork Mon Aug 17 08:28:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716925 X-Patchwork-Delegate: jgg@ziepe.ca 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 05AED109B for ; Mon, 17 Aug 2020 08:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC3202063A for ; Mon, 17 Aug 2020 08:29:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SNWSPMws" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728357AbgHQI3T (ORCPT ); Mon, 17 Aug 2020 04:29:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728230AbgHQI3O (ORCPT ); Mon, 17 Aug 2020 04:29:14 -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 D9510C06138A; Mon, 17 Aug 2020 01:29:13 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id g15so3241986plj.6; Mon, 17 Aug 2020 01:29:13 -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=mpTvLV2skT2BsbjdvmvS7WbpiU8WJnm3QiU8cdWEdZ4=; b=SNWSPMwsXxcDYbomSRcnWgDAgrZhmhBy8lduJbQaXMy+E9NVBYG03V3AkFcWRmPMvl 3YRVv+7y+pwFpXYmXN/FA9JNpbFfc15APZ0olb5+4LfFYvYkI2ULJPYTtbJw4zpBR7Xb zRu2Fo+vvj/P2ySD7JB2GzVdKKNri4936It09heU52HVUE2NjTL74SZmLUH/qLjUPZp0 Tra4yxkqiRvg30v9O+rxuRiz6/cO4nQCL7FBR+LPi5yJ0NBFm2uLriS0r0vslsbYNcmi N2qL+Z1uEq2ami3M/o0u1zjiFGE7w1IMzyfDoJJW8doGP26pfIfxiiB3+677/1Rwcna1 kFHw== 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=mpTvLV2skT2BsbjdvmvS7WbpiU8WJnm3QiU8cdWEdZ4=; b=VF7KeOV//SixubgXnDzLRcMSR3/vtOcvPmsmoJxt68jSL6loK9E1k5j3bz1AvXjpL+ R/xvICq4GI0dx1WJaC+VncNbiATFwV4JcCtMF+JjF16XeiMjQy/1PXOgH99o9MPU/+5+ e9v9e/0tw4x3ppAybDDGsbvulSDoSPlo0g1sDYN4+rIJhJMozck2kbaActPMHRpnhDqS N3FnqIFgVSRpSB+lvDS5jFAiX1kC3LBaJqtwktUL5xn7aGaL8Z5fNUMhk3oQsZKkSK34 wsx/jB/43w5HNXLdh/Z1vEckUGeWzCw8nj8Z4MPOuNHCol7DY2xnTJJnYWA4wIdOKpD9 hbsg== X-Gm-Message-State: AOAM532Nq5Fq5t8JvbEhsy1y+63P4vxsKJVNhOBNwrB1RXK3OmAZWGUC Z0CSrr51FHo7ILwLov3odSo= X-Google-Smtp-Source: ABdhPJzJfA4xlE8UeGwJ9+bgNisAJobpuTK3w/8/kC6OJBAqNyzXiJgEaqpAI3iSlFmnqryEyLwp/Q== X-Received: by 2002:a17:902:c151:: with SMTP id 17mr9914837plj.228.1597652953478; Mon, 17 Aug 2020 01:29:13 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r7sm18948102pfl.186.2020.08.17.01.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:29:13 -0700 (PDT) From: Allen Pais To: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com, somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com, nareshkumar.pbs@broadcom.com Cc: keescook@chromium.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 4/5] infiniband: qib: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:58:43 +0530 Message-Id: <20200817082844.21700-5-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082844.21700-1-allen.lkml@gmail.com> References: <20200817082844.21700-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/infiniband/hw/qib/qib_iba7322.c | 7 +++---- drivers/infiniband/hw/qib/qib_sdma.c | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c index 8bcbc884e5b6..0f6f021e0562 100644 --- a/drivers/infiniband/hw/qib/qib_iba7322.c +++ b/drivers/infiniband/hw/qib/qib_iba7322.c @@ -1733,9 +1733,9 @@ static noinline void handle_7322_errors(struct qib_devdata *dd) return; } -static void qib_error_tasklet(unsigned long data) +static void qib_error_tasklet(struct tasklet_struct *t) { - struct qib_devdata *dd = (struct qib_devdata *)data; + struct qib_devdata *dd = from_tasklet(dd, t, error_tasklet); handle_7322_errors(dd); qib_write_kreg(dd, kr_errmask, dd->cspec->errormask); @@ -3537,8 +3537,7 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend) for (i = 0; i < ARRAY_SIZE(redirect); i++) qib_write_kreg(dd, kr_intredirect + i, redirect[i]); dd->cspec->main_int_mask = mask; - tasklet_init(&dd->error_tasklet, qib_error_tasklet, - (unsigned long)dd); + tasklet_setup(&dd->error_tasklet, qib_error_tasklet); } /** diff --git a/drivers/infiniband/hw/qib/qib_sdma.c b/drivers/infiniband/hw/qib/qib_sdma.c index 99e11c347130..eece0d4ce6c7 100644 --- a/drivers/infiniband/hw/qib/qib_sdma.c +++ b/drivers/infiniband/hw/qib/qib_sdma.c @@ -62,7 +62,7 @@ static void sdma_get(struct qib_sdma_state *); static void sdma_put(struct qib_sdma_state *); static void sdma_set_state(struct qib_pportdata *, enum qib_sdma_states); static void sdma_start_sw_clean_up(struct qib_pportdata *); -static void sdma_sw_clean_up_task(unsigned long); +static void sdma_sw_clean_up_task(struct tasklet_struct *); static void unmap_desc(struct qib_pportdata *, unsigned); static void sdma_get(struct qib_sdma_state *ss) @@ -119,9 +119,10 @@ static void clear_sdma_activelist(struct qib_pportdata *ppd) } } -static void sdma_sw_clean_up_task(unsigned long opaque) +static void sdma_sw_clean_up_task(struct tasklet_struct *t) { - struct qib_pportdata *ppd = (struct qib_pportdata *) opaque; + struct qib_pportdata *ppd = from_tasklet(ppd, t, + sdma_sw_clean_up_task); unsigned long flags; spin_lock_irqsave(&ppd->sdma_lock, flags); @@ -436,8 +437,7 @@ int qib_setup_sdma(struct qib_pportdata *ppd) INIT_LIST_HEAD(&ppd->sdma_activelist); - tasklet_init(&ppd->sdma_sw_clean_up_task, sdma_sw_clean_up_task, - (unsigned long)ppd); + tasklet_setup(&ppd->sdma_sw_clean_up_task, sdma_sw_clean_up_task); ret = dd->f_init_sdma_regs(ppd); if (ret) From patchwork Mon Aug 17 08:28:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 11716935 X-Patchwork-Delegate: jgg@ziepe.ca 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 6C7D6109B 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 5400720658 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="MMpOJ+RW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgHQI3g (ORCPT ); Mon, 17 Aug 2020 04:29:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726842AbgHQI3S (ORCPT ); Mon, 17 Aug 2020 04:29:18 -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 E683BC061388; Mon, 17 Aug 2020 01:29:17 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id o13so7787788pgf.0; Mon, 17 Aug 2020 01:29:17 -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=vUxE5IeTrT0uCQB6Hz6X7n59nqYPK8f19l5eZsLWZHk=; b=MMpOJ+RWvTnu+RVdki2iQGVC8V89OH3VVXnGu/Y1RXOtkejr+GGOhHI3zVcflDZCqq g9v5dZss8ljsyK8YQZwsh20zKQzUtQa1GyansxULKF1ZunW/QCxnhgebjLu5MRqyTX+K kM3JBkP/wxurYrtpjJ1sUceO8AZi2c7hmKKgwsAD1BW+Y5QqjzW3hhyYmrS6uluFyaYn TDwFAbsuaWgLI6llChgHaLRJZHwXc/6xfUFeHSDkaLh3Eh88+iUYlP4M9g1jAznBqzxH r5reKQ0qB6hMVsvEpbk1WTLzXzSVwmKB3ShvqyfuP7COb5jgcZYAx7616Lg8HNsYNqbA u2qQ== 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=vUxE5IeTrT0uCQB6Hz6X7n59nqYPK8f19l5eZsLWZHk=; b=LiTwPuu9J2/suUnm75QvMsoKawgR2rw00jMKR6oZw3bX5IM88Sxm9YOZTjcRvKyE20 zItdk2fdR6uxT8A1kcg8yNN07S/Pz8klw4qcdYt2KwJRUQf+8jSdxm0Q4F2MsDNgiMCe gsASQz8dmVVuZXTlv2532IlN0Nfwg/hqYOwf5D25TZQ8BSmGWgEubEbAk7PGWNgB+/TG A/PwEI9Zl3YBe3P0LlfTdhu48en/w1xUGIA5FEeB7y3ggdvfEyYOi3EF+Hh9pVlAJOql f+6sIHEkZcVZIQ8YXk3XnbumMjVcOibDxcYTNRIXex9A+mFyOseLdifppFvHBAIIyxQR 6URA== X-Gm-Message-State: AOAM532t9pcncnk5KLLWu99jC19sCOuUXAx/ptRcwh4T8TUngc7Sazao p9GSZkSM3SOEx0EuRsAA6jhUUnRO4ypo9w== X-Google-Smtp-Source: ABdhPJyYs1aNn2mn1IdIEBv6VUmsXeEGAWZ/8yu4FckGc55qa1H6aT4QyV5onP+w/yrk5eNfiI4cfA== X-Received: by 2002:a05:6a00:228f:: with SMTP id f15mr10444046pfe.222.1597652957399; Mon, 17 Aug 2020 01:29:17 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r7sm18948102pfl.186.2020.08.17.01.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:29:16 -0700 (PDT) From: Allen Pais To: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com, somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com, nareshkumar.pbs@broadcom.com Cc: keescook@chromium.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 5/5] infiniband: rxe: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:58:44 +0530 Message-Id: <20200817082844.21700-6-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082844.21700-1-allen.lkml@gmail.com> References: <20200817082844.21700-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/infiniband/sw/rxe/rxe_cq.c | 6 +++--- drivers/infiniband/sw/rxe/rxe_task.c | 8 ++++---- drivers/infiniband/sw/rxe/rxe_task.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c index ad3090131126..f232fd03d19a 100644 --- a/drivers/infiniband/sw/rxe/rxe_cq.c +++ b/drivers/infiniband/sw/rxe/rxe_cq.c @@ -66,9 +66,9 @@ int rxe_cq_chk_attr(struct rxe_dev *rxe, struct rxe_cq *cq, return -EINVAL; } -static void rxe_send_complete(unsigned long data) +static void rxe_send_complete(struct tasklet_struct *t) { - struct rxe_cq *cq = (struct rxe_cq *)data; + struct rxe_cq *cq = from_tasklet(cq, t, comp_task); unsigned long flags; spin_lock_irqsave(&cq->cq_lock, flags); @@ -107,7 +107,7 @@ int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe, cq->is_dying = false; - tasklet_init(&cq->comp_task, rxe_send_complete, (unsigned long)cq); + tasklet_setup(&cq->comp_task, rxe_send_complete); spin_lock_init(&cq->cq_lock); cq->ibcq.cqe = cqe; diff --git a/drivers/infiniband/sw/rxe/rxe_task.c b/drivers/infiniband/sw/rxe/rxe_task.c index 08f05ac5f5d5..f7c944d2f987 100644 --- a/drivers/infiniband/sw/rxe/rxe_task.c +++ b/drivers/infiniband/sw/rxe/rxe_task.c @@ -55,12 +55,12 @@ int __rxe_do_task(struct rxe_task *task) * a second caller finds the task already running * but looks just after the last call to func */ -void rxe_do_task(unsigned long data) +void rxe_do_task(struct tasklet_struct *t) { int cont; int ret; unsigned long flags; - struct rxe_task *task = (struct rxe_task *)data; + struct rxe_task *task = from_tasklet(task, t, tasklet); spin_lock_irqsave(&task->state_lock, flags); switch (task->state) { @@ -123,7 +123,7 @@ int rxe_init_task(void *obj, struct rxe_task *task, snprintf(task->name, sizeof(task->name), "%s", name); task->destroyed = false; - tasklet_init(&task->tasklet, rxe_do_task, (unsigned long)task); + tasklet_setup(&task->tasklet, rxe_do_task); task->state = TASK_STATE_START; spin_lock_init(&task->state_lock); @@ -159,7 +159,7 @@ void rxe_run_task(struct rxe_task *task, int sched) if (sched) tasklet_schedule(&task->tasklet); else - rxe_do_task((unsigned long)task); + rxe_do_task(&task->tasklet); } void rxe_disable_task(struct rxe_task *task) diff --git a/drivers/infiniband/sw/rxe/rxe_task.h b/drivers/infiniband/sw/rxe/rxe_task.h index 08ff42d451c6..f69fbb2dd09f 100644 --- a/drivers/infiniband/sw/rxe/rxe_task.h +++ b/drivers/infiniband/sw/rxe/rxe_task.h @@ -80,7 +80,7 @@ int __rxe_do_task(struct rxe_task *task); * work to do someone must reschedule the task before * leaving */ -void rxe_do_task(unsigned long data); +void rxe_do_task(struct tasklet_struct *t); /* run a task, else schedule it to run as a tasklet, The decision * to run or schedule tasklet is based on the parameter sched.