From patchwork Mon Aug 17 08:54:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717235 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 5A7A915E6 for ; Mon, 17 Aug 2020 08:54:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4249020758 for ; Mon, 17 Aug 2020 08:54:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WmbN/sEc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727900AbgHQIye (ORCPT ); Mon, 17 Aug 2020 04:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgHQIyd (ORCPT ); Mon, 17 Aug 2020 04:54:33 -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 421F2C061388; Mon, 17 Aug 2020 01:54:33 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id ep8so7377463pjb.3; Mon, 17 Aug 2020 01:54:33 -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=nOJuhLui4k7rvz/wos+0nsCIYbwj7zan4woC4Ksv4tU=; b=WmbN/sEcHhuhCQ5aYnsNMtgOfzo7imWBnx5Crm1NhU5y5BmwSjvzdXxZ0ifIsV6mAX QJRV2IIBMTTzUUwaWwLo5sD9jQdAcitrBnSJo4h101GQpXbNMyYwA+rnuXyFPVMc2jeL xMnCTpldluKCOE5Wplbkyky5t1Rm0K12cZUvsQgL0pUhiOvYdw2SvvzBMgm7xXSbyHGu XwGTxij5YikrfxMI6lMJNzz+0rcD3uzIiI8UqxO1+n8TgCMG7RyupeLeeZCnYT5zm6wj KjUOtzdKJd18oBZVvIeFaFe54yfZAi1zwvKAFB9C+7oL3N7c+hvUqBr0YZ3NkrIreJ6M +cMQ== 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=nOJuhLui4k7rvz/wos+0nsCIYbwj7zan4woC4Ksv4tU=; b=Z9jdDmXQej0ZREVoopNNgCxWwkSMprOiiFZouICkDbA77hH05L/BpEklKUBTCY3q8h tnIFU/hio3AL8wAlN60uqpRHv65BggDaNUpT1jjabmARtDIJF6iWd74Krew9mfLDAeUn S3OcU3l9OMthxQGwv21Gspd1o/8HeCrw1r7rIHqCklW6UTLydXK7QuRTtEnLbpAEYi5u O+Ye+na1XaTdYd2H2xmuzfem/0Lp+PhwkOEc5D0gTONqcqxTx/L4X3LoeIIEQ9jrOVKw ExJ9QhQDAPvqdHbC4egBQzxGEaJB28KfP+bwF3nsNJLoZ0ZpByiseYZfdEzNrinJ1g12 7fMg== X-Gm-Message-State: AOAM532dONyKQUJtk2wda8JxWBneBAVB3Ep0qPMk2FtSHYNNO9QpqZxm UAAivsdmyo5arf0a2u3lqP4= X-Google-Smtp-Source: ABdhPJw0P1ye0j2Opb2/IQN8p1LCLJGojSk4DSVYAKSXBrIS17h5vBynZuXvCPJffCyh7ajJeAgK/g== X-Received: by 2002:a17:90b:f09:: with SMTP id br9mr11691708pjb.11.1597654472576; Mon, 17 Aug 2020 01:54:32 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:54:32 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 1/8] scsi: aic94xx: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:02 +0530 Message-Id: <20200817085409.25268-2-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/aic94xx/aic94xx_hwi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.c b/drivers/scsi/aic94xx/aic94xx_hwi.c index 9256ab7b2522..1e4d32246cb9 100644 --- a/drivers/scsi/aic94xx/aic94xx_hwi.c +++ b/drivers/scsi/aic94xx/aic94xx_hwi.c @@ -248,7 +248,7 @@ static void asd_get_max_scb_ddb(struct asd_ha_struct *asd_ha) /* ---------- Done List initialization ---------- */ -static void asd_dl_tasklet_handler(unsigned long); +static void asd_dl_tasklet_handler(struct tasklet_struct *t); static int asd_init_dl(struct asd_ha_struct *asd_ha) { @@ -261,8 +261,7 @@ static int asd_init_dl(struct asd_ha_struct *asd_ha) asd_ha->seq.dl = asd_ha->seq.actual_dl->vaddr; asd_ha->seq.dl_toggle = ASD_DEF_DL_TOGGLE; asd_ha->seq.dl_next = 0; - tasklet_init(&asd_ha->seq.dl_tasklet, asd_dl_tasklet_handler, - (unsigned long) asd_ha); + tasklet_setup(&asd_ha->seq.dl_tasklet, asd_dl_tasklet_handler); return 0; } @@ -711,9 +710,9 @@ static void asd_chip_reset(struct asd_ha_struct *asd_ha) /* ---------- Done List Routines ---------- */ -static void asd_dl_tasklet_handler(unsigned long data) +static void asd_dl_tasklet_handler(struct tasklet_struct *t) { - struct asd_ha_struct *asd_ha = (struct asd_ha_struct *) data; + struct asd_ha_struct *asd_ha = from_tasklet(asd_ha, t, seq.dl_tasklet); struct asd_seq_data *seq = &asd_ha->seq; unsigned long flags; From patchwork Mon Aug 17 08:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717243 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 4E449109B for ; Mon, 17 Aug 2020 08:54:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3581320758 for ; Mon, 17 Aug 2020 08:54:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cl8bVgyV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728163AbgHQIym (ORCPT ); Mon, 17 Aug 2020 04:54:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728152AbgHQIyh (ORCPT ); Mon, 17 Aug 2020 04:54:37 -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 73911C061388; Mon, 17 Aug 2020 01:54:37 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 189so7158484pgg.13; Mon, 17 Aug 2020 01:54:37 -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=6trBPHS9S/UpnG7t9zPTQG9eTrRzdIZ0hGY6nWo8pT0=; b=cl8bVgyVtDdOuybu7ntzDzVYdGgYTFj4kXvX/Q/SW7SNmWNG4ijca7Pi51LL43Gy/c fGmqeOrUZHiD3EXKBc/QB0aYtBdni4rBXpzCBtH6DHxHnP0p4hcHbp54foY8Sf9y5bq1 3Jr8lSpeanDwpaxSHPeZ2vU/UrVw8OrgNvdEWSjKhiCQibLJLVl+qpOUY/i3UM8ISxRa VrzoCdHHjq1gC10tv6f4hGmwJF3QrZga15f8nH30xEgER7SLCE804KzeVHXGJMwIM4vn YEHygXBdktDk+IzpzxcEfWqY0x8wg0pO/uAHTO90jm8c860oZFr6aXzGTj603h7Tb52o BUiw== 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=6trBPHS9S/UpnG7t9zPTQG9eTrRzdIZ0hGY6nWo8pT0=; b=lhL2YPpv1FtpfGme7tWbq1jJ2eDudGaDY8/Ud2EMxUuqtsgzWh3NIE0ELE11l6N++Q bvc3l5NnXScJ7oze+OijOeqkAPkaDt5TRolCI76PBeBBzqsSnOlMmwq+ycAmco1976A3 ssPNPw9+0gfPwHTWqDa8NpF/KVOloiUDNIk3O3qfk3nvU1LsHZIY7FWnTUAoQAE0jLBA qnlpneXpFZ+JYpvQDTwbSUEFNhcMQ+7NSk+owuYofJ0QkYBFExb8Mgi/bGdAiuuufVgi RnwhqJrXQvQEvC2CkHzb3ByYMtyO/B7SOlwZqQa0bkDHjt4obLNQogA6sL93WsH+1v8t F2Og== X-Gm-Message-State: AOAM531mxDNfJoIjGlpHc7LVOJxhbd9xzwSj/nQ74f2m/GVdJOiKUQe/ gqICIRSUtHU20wBWaQ4PiXE= X-Google-Smtp-Source: ABdhPJwjAV9PFZKFZKeGA8kArDIlyD0PRcA0bJOuTXRTyct2hX3bCII6uKRIp7rPH/jH1Bjpszui/A== X-Received: by 2002:a62:52d6:: with SMTP id g205mr10856808pfb.144.1597654477011; Mon, 17 Aug 2020 01:54:37 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:54:36 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 2/8] scsi: esas2r: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:03 +0530 Message-Id: <20200817085409.25268-3-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/esas2r/esas2r.h | 2 +- drivers/scsi/esas2r/esas2r_init.c | 4 +--- drivers/scsi/esas2r/esas2r_main.c | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r.h b/drivers/scsi/esas2r/esas2r.h index e30d2f1f5368..b99434e24868 100644 --- a/drivers/scsi/esas2r/esas2r.h +++ b/drivers/scsi/esas2r/esas2r.h @@ -992,7 +992,7 @@ int esas2r_write_vda(struct esas2r_adapter *a, const char *buf, long off, int esas2r_read_fs(struct esas2r_adapter *a, char *buf, long off, int count); int esas2r_write_fs(struct esas2r_adapter *a, const char *buf, long off, int count); -void esas2r_adapter_tasklet(unsigned long context); +void esas2r_adapter_tasklet(struct tasklet_struct *t); irqreturn_t esas2r_interrupt(int irq, void *dev_id); irqreturn_t esas2r_msi_interrupt(int irq, void *dev_id); void esas2r_kickoff_timer(struct esas2r_adapter *a); diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index eb7d139ffc00..55387c14fb8d 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c @@ -401,9 +401,7 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid, return 0; } - tasklet_init(&a->tasklet, - esas2r_adapter_tasklet, - (unsigned long)a); + tasklet_setup(&a->tasklet, esas2r_adapter_tasklet); /* * Disable chip interrupts to prevent spurious interrupts diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index 7b49e2e9fcde..7ffa9406ab4d 100644 --- a/drivers/scsi/esas2r/esas2r_main.c +++ b/drivers/scsi/esas2r/esas2r_main.c @@ -1546,9 +1546,9 @@ void esas2r_complete_request_cb(struct esas2r_adapter *a, } /* Run tasklet to handle stuff outside of interrupt context. */ -void esas2r_adapter_tasklet(unsigned long context) +void esas2r_adapter_tasklet(struct tasklet_struct *t) { - struct esas2r_adapter *a = (struct esas2r_adapter *)context; + struct esas2r_adapter *a = from_tasklet(a, t, tasklet); if (unlikely(test_bit(AF2_TIMER_TICK, &a->flags2))) { clear_bit(AF2_TIMER_TICK, &a->flags2); From patchwork Mon Aug 17 08:54:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717245 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 C85B9109B for ; Mon, 17 Aug 2020 08:54:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC6F820758 for ; Mon, 17 Aug 2020 08:54:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qY0wk6y6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728169AbgHQIyv (ORCPT ); Mon, 17 Aug 2020 04:54:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbgHQIyl (ORCPT ); Mon, 17 Aug 2020 04:54:41 -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 ABD78C061389; Mon, 17 Aug 2020 01:54:41 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id x6so7784771pgx.12; Mon, 17 Aug 2020 01:54:41 -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=Q36TS0sUnDMWUt2GWNB4ozlnAPMkx3+GdsGrlLJvyUA=; b=qY0wk6y66ZaeR4Ik6lL6VtoLZmgBgtp5nin3lqqytvLvmbT9wsAyhbO8E4OpD5B+Nm 1hkMXEiwWtCCsIHI4AmpbwM33MJZbtpAqQYksbiZvj1dQyEtlWBvtF+4GTjDDKh3m75s 8on/Xsvkp/Y2IDYryebzXgdHix+mFb5mAoSIoQvgIWC9m8u6CfEOGcW71BOewmaU7dtx FDKnYtF2A4SItoNphG0VIEHJScBwAcjZbHrTQKQKp2294Sg9iQxp1vR4MYm8XbtyeMJ1 hQz7opO6/6DnjhdN76BL+Shs/7lnEJrpVmxNeTJ3gLQb+JMPNYwwF/nZyF4zmipK3Ej7 J+2w== 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=Q36TS0sUnDMWUt2GWNB4ozlnAPMkx3+GdsGrlLJvyUA=; b=IF1cbngHWeohNNfeHDajk5M0JlNfcuQr3K4V3Icf3lBzkVswQ20rxn6yqCrOHBZYrr r3te5jY0cx/Twgi8++yFJiGngHSf+jLOh1GNehGiEvIk8fDcc6DHTGtbqp2dWHr6NZto eAWJwclIAVgsZmUEfIjWoV59aZfFSlLJaYvpDxjRxaXNPKczFJ42eMPwh1cGRo8CMNjR 7UeGSBFv1PRcjnV1VSDC4rlUUZ0lvJMU555EJlPEw/fAHFl5QgALUwkNdhx5xnWyUkJD 8fIx+qFRQ6Fi+MIvyuu+VuSDii34ssMdTOv8DfxmNNn9/9Ttk2STPwAkoIoPuCJebdU4 DAIA== X-Gm-Message-State: AOAM532nz0ine7KIOg6aVrVbFK0HNz9nL0PBqVtrdNxBI8avsLb7m7jF Ys/nMwWFmACY9wn5ltp+JBI= X-Google-Smtp-Source: ABdhPJwugm3uTp6xVlvRewYLNL21rtoTNfXQQpwjA6HA2B4WYeL3q8Y+n9+Tf0JfjsAOk1YejRXuaA== X-Received: by 2002:a63:4621:: with SMTP id t33mr4926312pga.32.1597654481179; Mon, 17 Aug 2020 01:54:41 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:54:40 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 3/8] scsi: ibmvscsi: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:04 +0530 Message-Id: <20200817085409.25268-4-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/ibmvscsi/ibmvfc.c | 6 +++--- drivers/scsi/ibmvscsi/ibmvscsi.c | 8 ++++---- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 7 +++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 77f4d37d5bd6..50f025cdabbd 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -3204,9 +3204,9 @@ static irqreturn_t ibmvfc_interrupt(int irq, void *dev_instance) * Returns: * Nothing **/ -static void ibmvfc_tasklet(void *data) +static void ibmvfc_tasklet(struct tasklet_struct *t) { - struct ibmvfc_host *vhost = data; + struct ibmvfc_host *vhost = from_tasklet(vhost, t, tasklet); struct vio_dev *vdev = to_vio_dev(vhost->dev); struct ibmvfc_crq *crq; struct ibmvfc_async_crq *async; @@ -4676,7 +4676,7 @@ static int ibmvfc_init_crq(struct ibmvfc_host *vhost) retrc = 0; - tasklet_init(&vhost->tasklet, (void *)ibmvfc_tasklet, (unsigned long)vhost); + tasklet_setup(&vhost->tasklet, (void *)ibmvfc_tasklet); if ((rc = request_irq(vdev->irq, ibmvfc_interrupt, 0, IBMVFC_NAME, vhost))) { dev_err(dev, "Couldn't register irq 0x%x. rc=%d\n", vdev->irq, rc); diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index b1f3017b6547..46b818daa957 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -208,9 +208,10 @@ static int ibmvscsi_send_crq(struct ibmvscsi_host_data *hostdata, * ibmvscsi_task: - Process srps asynchronously * @data: ibmvscsi_host_data of host */ -static void ibmvscsi_task(void *data) +static void ibmvscsi_task(struct tasklet_struct *t) { - struct ibmvscsi_host_data *hostdata = (struct ibmvscsi_host_data *)data; + struct ibmvscsi_host_data *hostdata = from_tasklet(hostdata, t, + srp_task); struct vio_dev *vdev = to_vio_dev(hostdata->dev); struct viosrp_crq *crq; int done = 0; @@ -366,8 +367,7 @@ static int ibmvscsi_init_crq_queue(struct crq_queue *queue, queue->cur = 0; spin_lock_init(&queue->lock); - tasklet_init(&hostdata->srp_task, (void *)ibmvscsi_task, - (unsigned long)hostdata); + tasklet_setup(&hostdata->srp_task, ibmvscsi_task); if (request_irq(vdev->irq, ibmvscsi_handle_event, diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index d9e94e81da01..e62fd6c67001 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3328,9 +3328,9 @@ static int ibmvscsis_rdma(struct ibmvscsis_cmd *cmd, struct scatterlist *sg, * * Note: this is an edge triggered interrupt. It can not be shared. */ -static void ibmvscsis_handle_crq(unsigned long data) +static void ibmvscsis_handle_crq(struct tasklet_struct *t) { - struct scsi_info *vscsi = (struct scsi_info *)data; + struct scsi_info *vscsi = from_tasklet(vscsi, t, work_task); struct viosrp_crq *crq; long rc; bool ack = true; @@ -3541,8 +3541,7 @@ static int ibmvscsis_probe(struct vio_dev *vdev, dev_dbg(&vscsi->dev, "probe hrc %ld, client partition num %d\n", hrc, vscsi->client_data.partition_number); - tasklet_init(&vscsi->work_task, ibmvscsis_handle_crq, - (unsigned long)vscsi); + tasklet_setup(&vscsi->work_task, ibmvscsis_handle_crq); init_completion(&vscsi->wait_idle); init_completion(&vscsi->unconfig); From patchwork Mon Aug 17 08:54:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717269 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 34994618 for ; Mon, 17 Aug 2020 08:55:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18F422067C for ; Mon, 17 Aug 2020 08:55:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ARN7DkZq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728537AbgHQIy4 (ORCPT ); Mon, 17 Aug 2020 04:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726837AbgHQIyq (ORCPT ); Mon, 17 Aug 2020 04:54:46 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7C6AC061388; Mon, 17 Aug 2020 01:54:45 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id m71so7910724pfd.1; Mon, 17 Aug 2020 01:54:45 -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=lDmZSaB9SDsuHRMCoS4mSkpLKS8AQi0WM0y0umCFAfM=; b=ARN7DkZqBaOJ2CSCPA2npO8s8jVmPE2GVZq8gro0ceYQ+wn+he80p3n41djo7NzhnV 6l6ji36C0sm/yXaeqpiF2Y2MDBJSCBsXmRg0UdNHMGZTJHQIefxQpZi4lATRCpNvgThF KdjNkwZCbZLWYTCnrOJm7+O27kCFnASn7iELJo3fUKcgQMjeF0V0SETxxE8p/Fq5zAOj V0Oj5K5yzDgnI2EcVA8xvEBTiO+aF/4GF13g7Sa9j1wiwtU7e0bwUtsZEN1QlGs6hOIu pIx6oaHry1qw0DGPvp9GRBbMnc1+igxjEHLSPVicFCGea7pkEPH1b7/FFiZZXaL6Q6Nz cRrA== 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=lDmZSaB9SDsuHRMCoS4mSkpLKS8AQi0WM0y0umCFAfM=; b=IC2Qd069WTcHRirDbXIpSRHvJ6Yke4YkUDpO5WIB2rM3ZmV3b0M+4C14LgM+aZ2Yc5 P0aRKUpgaEFGxb57+t52Cayw8Sfqwdoz1wvoQEG3KO4oNpixcdrR2RK00GIqaluwJzVs tkq/+xEmgMCeP2DwmJ1H6hl6KfxM3BPHnWe5Zk4M5Su7cIo63oKBxxifUUcz0x/HPeIg BFfJsnG/IEWgVMgfT05q8tN/pr87x4qK9cAEhpR5gEC2oyD/xvi692CpzpuMoB7wGSEN DmlNtakZZh7iD4poyqIh+T1CEwIQvJ/dkYkRxi3amvUAQaRfuK2L7wdadtotibDhrLpm 8u0Q== X-Gm-Message-State: AOAM531k7ZcqeAzJwu0V7i46noYi3Rbu6XzxEjNV738MNANPRjeCvef2 2M2pv9UWR2/t66YueIHPaCADX4H6WFUxAw== X-Google-Smtp-Source: ABdhPJyVPcS+QO1XpTezGIF49izLpHDxWvhsJOVJBH8xcafcgG3FsCBY46X4INpr0WC4C/0DkTVuJA== X-Received: by 2002:a63:67c5:: with SMTP id b188mr8533979pgc.412.1597654485371; Mon, 17 Aug 2020 01:54:45 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:54:44 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 4/8] scsi: isci: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:05 +0530 Message-Id: <20200817085409.25268-5-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/isci/host.c | 4 ++-- drivers/scsi/isci/host.h | 2 +- drivers/scsi/isci/init.c | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index 7b5deae68d33..599adebd039e 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c @@ -1113,9 +1113,9 @@ void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_ta * @data: This parameter specifies the ISCI host object * */ -void isci_host_completion_routine(unsigned long data) +void isci_host_completion_routine(struct tasklet_struct *t) { - struct isci_host *ihost = (struct isci_host *)data; + struct isci_host *ihost = from_tasklet(ihost, t, completion_tasklet); u16 active; spin_lock_irq(&ihost->scic_lock); diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index 6bc3f022630a..6abe23682d9b 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h @@ -478,7 +478,7 @@ void isci_tci_free(struct isci_host *ihost, u16 tci); void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task); int isci_host_init(struct isci_host *); -void isci_host_completion_routine(unsigned long data); +void isci_host_completion_routine(struct tasklet_struct *t); void isci_host_deinit(struct isci_host *); void sci_controller_disable_interrupts(struct isci_host *ihost); bool sci_controller_has_remote_devices_stopping(struct isci_host *ihost); diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 085e285f427d..32a0117b5ff4 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c @@ -511,8 +511,7 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) init_waitqueue_head(&ihost->eventq); ihost->sas_ha.dev = &ihost->pdev->dev; ihost->sas_ha.lldd_ha = ihost; - tasklet_init(&ihost->completion_tasklet, - isci_host_completion_routine, (unsigned long)ihost); + tasklet_setup(&ihost->completion_tasklet, isci_host_completion_routine); /* validate module parameters */ /* TODO: kill struct sci_user_parameters and reference directly */ From patchwork Mon Aug 17 08:54:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717273 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 C0DAD15E6 for ; Mon, 17 Aug 2020 08:55:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A90692067C for ; Mon, 17 Aug 2020 08:55:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="loCQsImr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728496AbgHQIy4 (ORCPT ); Mon, 17 Aug 2020 04:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbgHQIyx (ORCPT ); Mon, 17 Aug 2020 04:54:53 -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 8C394C061388; Mon, 17 Aug 2020 01:54:53 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id mw10so7378201pjb.2; Mon, 17 Aug 2020 01:54: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=yq+b5nPjc4iZMxReL6k7yjDpixSDgaW+QE7HBoO3x5k=; b=loCQsImr30+2ucixIdXtUZyrsxcpF9c9ekbfECYqaiqjPXRc1D2R25LSxmM22pxWyU X8Zpx7DDyKIexKOQEly53OTTQSi4SPuWNa55LAAofpgDunXjZ0ymnlziD86amt6Ya2Ba iG8ecGAB86SnRZndrVePVFVGuxF8qdd1Dt2UHzrm1rG5ZjueLEkZZn9Aggnw3/M+rwbm nFw7IjkjVF9S+Ykiw8Verw6GhxQYJshZGNs4of9Xf6ve+DKzbSiXN4cuurHkXaPL171o USZ1jmPQLZ8cImyN2plZOFXqBAUd0Jc9lca+jZ7MqQ8k25vVEecxfJlEGNgzGFX7uTip h/8Q== 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=yq+b5nPjc4iZMxReL6k7yjDpixSDgaW+QE7HBoO3x5k=; b=RXXkOeJKRBvJ8MzweQC70lGHo7yKXi58oc0Qazj2bGM4DbYjxqvJs01qEMabc3Di6/ WTlOCHOqoGOEJAEAGPZ0HmCemj8G4qjuZIvUe/t4rV2iZsKsC2X8CL1mgWiRqfRH9x6B OPXBOrgpgPw0LtRoAISMrwBZ+NaG3q5NSstI2DNHmHOcpdzgFGBndgjVeV9s3/t0ZM3B gxp3CGAi515t/g0ynE/yo5fTHqlIYZeA4btiwuoRgRT7AW6d6noGnRntdwh2zB94FZt0 uCw6kKcqAohqpMgERptzviPK9qGWjMT8vq/p/90tQzMncYv0l3WndQgINVVP9PiUjMRz nFTw== X-Gm-Message-State: AOAM533netJkPO4rPIcVy6HjMzzcBMnNC/yRsFnIlrFBwQLjVfFLZqjW VdGcRjEO51V6aQ+lsGifMwM= X-Google-Smtp-Source: ABdhPJy8TyZl8UDeVE5PjNQnDPaUpnMNoPVRID812Vgnf927pC7NbQzFDhCan7ziLkYRXhbjzmsnXg== X-Received: by 2002:a17:90a:e292:: with SMTP id d18mr11895790pjz.181.1597654493079; Mon, 17 Aug 2020 01:54:53 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:54:52 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 5/8] scsi: megaraid: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:06 +0530 Message-Id: <20200817085409.25268-6-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/megaraid/megaraid_mbox.c | 9 ++++----- drivers/scsi/megaraid/megaraid_sas.h | 2 +- drivers/scsi/megaraid/megaraid_sas_base.c | 16 +++++++--------- drivers/scsi/megaraid/megaraid_sas_fusion.c | 14 +++++++------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 19469a2c0ea3..47b2d8045c9d 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -119,7 +119,7 @@ static void megaraid_mbox_prepare_epthru(adapter_t *, scb_t *, static irqreturn_t megaraid_isr(int, void *); -static void megaraid_mbox_dpc(unsigned long); +static void megaraid_mbox_dpc(struct tasklet_struct *t); static ssize_t megaraid_sysfs_show_app_hndl(struct device *, struct device_attribute *attr, char *); static ssize_t megaraid_sysfs_show_ldnum(struct device *, struct device_attribute *attr, char *); @@ -878,8 +878,7 @@ megaraid_init_mbox(adapter_t *adapter) } // setup tasklet for DPC - tasklet_init(&adapter->dpc_h, megaraid_mbox_dpc, - (unsigned long)adapter); + tasklet_setup(&adapter->dpc_h, megaraid_mbox_dpc); con_log(CL_DLEVEL1, (KERN_INFO "megaraid mbox hba successfully initialized\n")); @@ -2168,9 +2167,9 @@ megaraid_isr(int irq, void *devp) * it is being called. */ static void -megaraid_mbox_dpc(unsigned long devp) +megaraid_mbox_dpc(struct tasklet_struct *t) { - adapter_t *adapter = (adapter_t *)devp; + adapter_t *adapter = from_tasklet(adapter, t, dpc_h); mraid_device_t *raid_dev; struct list_head clist; struct scatterlist *sgl; diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 5e4137f10e0e..ce361b2b9f14 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2531,7 +2531,7 @@ struct megasas_instance_template { int (*check_reset)(struct megasas_instance *, \ struct megasas_register_set __iomem *); irqreturn_t (*service_isr)(int irq, void *devp); - void (*tasklet)(unsigned long); + void (*tasklet)(struct tasklet_struct *t); u32 (*init_adapter)(struct megasas_instance *); u32 (*build_and_issue_cmd) (struct megasas_instance *, struct scsi_cmnd *); diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 861f7140f52e..dba60cc1cf41 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -217,7 +217,7 @@ megasas_init_adapter_mfi(struct megasas_instance *instance); u32 megasas_build_and_issue_cmd(struct megasas_instance *instance, struct scsi_cmnd *scmd); -static void megasas_complete_cmd_dpc(unsigned long instance_addr); +static void megasas_complete_cmd_dpc(struct tasklet_struct *t); int wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd, int seconds); @@ -2217,14 +2217,14 @@ megasas_check_and_restore_queue_depth(struct megasas_instance *instance) * * Tasklet to complete cmds */ -static void megasas_complete_cmd_dpc(unsigned long instance_addr) +static void megasas_complete_cmd_dpc(struct tasklet_struct *t) { u32 producer; u32 consumer; u32 context; struct megasas_cmd *cmd; - struct megasas_instance *instance = - (struct megasas_instance *)instance_addr; + struct megasas_instance *instance = from_tasklet(instance, t, + isr_tasklet); unsigned long flags; /* If we have already declared adapter dead, donot complete cmds */ @@ -2769,7 +2769,7 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance) * Call cmd completion routine. Cmd to be * be completed directly without depending on isr. */ - megasas_complete_cmd_dpc((unsigned long)instance); + megasas_complete_cmd_dpc(&instance->isr_tasklet); } msleep(1000); @@ -6180,8 +6180,7 @@ static int megasas_init_fw(struct megasas_instance *instance) dev_info(&instance->pdev->dev, "RDPQ mode\t: (%s)\n", instance->is_rdpq ? "enabled" : "disabled"); - tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet, - (unsigned long)instance); + tasklet_setup(&instance->isr_tasklet, instance->instancet->tasklet); /* * Below are default value for legacy Firmware. @@ -7719,8 +7718,7 @@ megasas_resume(struct pci_dev *pdev) if (megasas_get_ctrl_info(instance) != DCMD_SUCCESS) goto fail_init_mfi; - tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet, - (unsigned long)instance); + tasklet_setup(&instance->isr_tasklet, instance->instancet->tasklet); if (instance->msix_vectors ? megasas_setup_irqs_msix(instance, 0) : diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 0824410f78f8..67b07660971a 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3705,15 +3705,15 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget) /** * megasas_complete_cmd_dpc_fusion - Completes command - * @instance_addr: Adapter soft state address + * @t: Instance of the tasklet being run * * Tasklet to complete cmds */ static void -megasas_complete_cmd_dpc_fusion(unsigned long instance_addr) +megasas_complete_cmd_dpc_fusion(struct tasklet_struct *t) { - struct megasas_instance *instance = - (struct megasas_instance *)instance_addr; + struct megasas_instance *instance = from_tasklet(instance, t, + isr_tasklet); u32 count, MSIxIndex; count = instance->msix_vectors > 0 ? instance->msix_vectors : 1; @@ -4062,7 +4062,7 @@ megasas_wait_for_outstanding_fusion(struct megasas_instance *instance, if (reason == MFI_IO_TIMEOUT_OCR) { dev_info(&instance->pdev->dev, "MFI command is timed out\n"); - megasas_complete_cmd_dpc_fusion((unsigned long)instance); + megasas_complete_cmd_dpc_fusion(&instance->isr_tasklet); if (instance->snapdump_wait_time) megasas_trigger_snap_dump(instance); retval = 1; @@ -4078,7 +4078,7 @@ megasas_wait_for_outstanding_fusion(struct megasas_instance *instance, "FW in FAULT state Fault code:0x%x subcode:0x%x func:%s\n", abs_state & MFI_STATE_FAULT_CODE, abs_state & MFI_STATE_FAULT_SUBCODE, __func__); - megasas_complete_cmd_dpc_fusion((unsigned long)instance); + megasas_complete_cmd_dpc_fusion(&instance->isr_tasklet); if (instance->requestorId && reason) { dev_warn(&instance->pdev->dev, "SR-IOV Found FW in FAULT" " state while polling during" @@ -4122,7 +4122,7 @@ megasas_wait_for_outstanding_fusion(struct megasas_instance *instance, } } - megasas_complete_cmd_dpc_fusion((unsigned long)instance); + megasas_complete_cmd_dpc_fusion(&instance->isr_tasklet); outstanding = atomic_read(&instance->fw_outstanding); if (!outstanding) goto out; From patchwork Mon Aug 17 08:54:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717265 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 0456E618 for ; Mon, 17 Aug 2020 08:55:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD8062067C for ; Mon, 17 Aug 2020 08:55:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O1KR3V0x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728391AbgHQIzS (ORCPT ); Mon, 17 Aug 2020 04:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728605AbgHQIy5 (ORCPT ); Mon, 17 Aug 2020 04:54:57 -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 AFD4CC061388; Mon, 17 Aug 2020 01:54:57 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id t6so7379296pjr.0; Mon, 17 Aug 2020 01:54:57 -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=MVeuxsGilJwDL1o41vPJ1mEVYW9QRgNmhG//SeEinm0=; b=O1KR3V0xt4SN/ZoKkNI3dZUiICUjTsddCUbWlu6xJyQX2dkRzE5xFbbKhZZeergtlg 63B9sFolljH7d9AXSVyuoNmD9Q8TbIxjlqgVN1gA6PoSC9b9poCTF/1nQqgD8wGFfgqv /rgl9fAJezU0La98PCZfWBtdnG9+7Vm5DcXYbtsUFyNkrx2X3wt3KyyY/h02l1HQOapd s40GTgbKIEbOXV10TZKdgkaJbUNxiL5WwlskC2ReFPqW2G8RzC04aUhYsBr3YD6dtC13 KyCNUe1CeZT5tlB06UxZoBocmfFpHearUksDtHK/nURWZ12LzTuMTrPO6Rg1UbAMUl8O ayAQ== 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=MVeuxsGilJwDL1o41vPJ1mEVYW9QRgNmhG//SeEinm0=; b=ZOJIPz0/RYHkmpzFDLayGgqcBoqhMzYsDJEy69ctUf0PoF+wmCCrrDKLjlP4Oq9KN0 hzVXAItZmzhAeuc3exzcyT7Rck6Tk8HJWpI2v+Po+yx+SftjXwOlEB8SUMBRxJXC1ujq aveT07z/4TIgTa5usuPXvFb0SJuA+qhkMtma9lAcO9/uOMj6CUPJ9V/rQqwD582p7u7N u4kfV4awJ/Jo5SVzVYTaNfnmKgz2a8/REOqLCyyJD/gb6W9tDcv9uvxkrD9T2iAhozJu 8AyuWp87iS9Md3ZPMr8fawYJ3gLsIpVIHdJ7tTmfHXerng/ItwpmQCXIZOotFlpOTRFn V1PA== X-Gm-Message-State: AOAM532n7VFh7WgaFu8ZTt+ds0j5lFx6zwDfA3JK/fIIFkgPaEVSxkI9 wFzW0NbuCSSQDF1AE8SzSLA= X-Google-Smtp-Source: ABdhPJwTYhGdSFSvnvbCYxYT5raIJmcHlwmf7/MdtOZWzcK9+tdf9lhZ8Svj9gLMlxhtozJBDyxnlQ== X-Received: by 2002:a17:902:b28b:: with SMTP id u11mr10332716plr.317.1597654497255; Mon, 17 Aug 2020 01:54:57 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:54:56 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 6/8] scsi: mvsas: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:07 +0530 Message-Id: <20200817085409.25268-7-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/mvsas/mv_init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 978f5283c883..53b2d463fa13 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -147,13 +147,14 @@ static void mvs_free(struct mvs_info *mvi) } #ifdef CONFIG_SCSI_MVSAS_TASKLET -static void mvs_tasklet(unsigned long opaque) +static void mvs_tasklet(struct tasklet_struct *t) { u32 stat; u16 core_nr, i = 0; struct mvs_info *mvi; - struct sas_ha_struct *sha = (struct sas_ha_struct *)opaque; + struct mvs_prv_info *mpi = from_tasklet(mpi, t, mv_tasklet); + struct sas_ha_struct *sha = pci_get_drvdata(mpi->mvi[0]->pdev); core_nr = ((struct mvs_prv_info *)sha->lldd_ha)->n_host; mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[0]; @@ -564,8 +565,7 @@ static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent) } while (nhost < chip->n_host); mpi = (struct mvs_prv_info *)(SHOST_TO_SAS_HA(shost)->lldd_ha); #ifdef CONFIG_SCSI_MVSAS_TASKLET - tasklet_init(&(mpi->mv_tasklet), mvs_tasklet, - (unsigned long)SHOST_TO_SAS_HA(shost)); + tasklet_setup(&(mpi->mv_tasklet), mvs_tasklet); #endif mvs_post_sas_ha_init(shost, chip); From patchwork Mon Aug 17 08:54:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717255 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 7CBB6618 for ; Mon, 17 Aug 2020 08:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5EDAA2067C for ; Mon, 17 Aug 2020 08:55:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ofjCFlkN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728631AbgHQIzE (ORCPT ); Mon, 17 Aug 2020 04:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728622AbgHQIzB (ORCPT ); Mon, 17 Aug 2020 04:55:01 -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 E3B29C061388; Mon, 17 Aug 2020 01:55:01 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id f193so7890970pfa.12; Mon, 17 Aug 2020 01:55: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=WjN5WWXKRu0qRTJkEfYiBM+eZY8od27NJFEvfztfXRw=; b=ofjCFlkN/L/yMi6bvgjpuN80ewdc1vauKYTHb0JDCi+gGyAogsMKHoCjWUHna0G0MH ehGBUvt/QDfoWk2Tr8j5kVVTFIgnubDUvC/bIXrkNLZlk0iu7RGcoqeonLQCaMs8Q3oT xVf0I6P/nipMxqUMsl5CU7l+CX0ok6bWA++6o/1CpYI8NR6vnpHQNB59Av0lIn3X1lCr sX61J1nSBD/6eRyCfvzEJVB7wE8w8sbuOsWAu7qQ/pilkE5IkarzBQcCSkG2tvl/CPT9 1nMInHgJS6MZkidBJVPE+NpVwtCL5wKq0i5RUuXsaiCPj5qPB9gsukMSkvm696sy7AwN h9dA== 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=WjN5WWXKRu0qRTJkEfYiBM+eZY8od27NJFEvfztfXRw=; b=XfgNwsVoDMmFT2AqZcngD2uYkL6B5pIzWt8lJ27ZKYaMLY4xwKPeLNYGBHcNZLzZfb SpyPBt6ftaV740F5655N4kQ8kBRMDalVtQeWo7wZgo5M8US1mI3W/jPifxVgY6tst0SB +DTSvvpsml6E3hcwIFA0NJnjYUPH0kcJfDevSNH3SddxcKkByKTovGkjGMsa0OxS2ZHo zu/dZoJg0BZxAj8Jv34kXpTJTtUjjPQtMZIWAO+sHM8B83RY+Tn7bapPZvwPcJ8PQOJ9 g0PexIyULQ6wIMNsn6KLG/aBve3+fRJO7ZjBDOdGCcv+sy+KJIYb5aU8nF6ZvhktyeEl czrQ== X-Gm-Message-State: AOAM5322M8ood0/U7lxgyjdF+FNN4LLowLxLK8qzfldV9Qycxc+ZCX2y duTgzzqgUvZ7tlEfujgcy8U= X-Google-Smtp-Source: ABdhPJySr0zfutgkvfKUUoarg3CG+N1D+i82umIzTCLTVEsE1cA/pi9o2wbaw0OwYm1JnLOMpGUzAw== X-Received: by 2002:aa7:959c:: with SMTP id z28mr10771954pfj.223.1597654501440; Mon, 17 Aug 2020 01:55:01 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:55:00 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 7/8] scsi: pm8001: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:08 +0530 Message-Id: <20200817085409.25268-8-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/pm8001/pm8001_init.c | 55 ++++++++++++++++++------------- drivers/scsi/pm8001/pm8001_sas.h | 6 +++- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 20fa96cbc9d3..818816c8b295 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -187,12 +187,15 @@ static void pm8001_free(struct pm8001_hba_info *pm8001_ha) * @opaque: the passed general host adapter struct * Note: pm8001_tasklet is common for pm8001 & pm80xx */ -static void pm8001_tasklet(unsigned long opaque) +static void pm8001_tasklet(struct tasklet_struct *t) { - struct pm8001_hba_info *pm8001_ha; + struct tsk_param *tsk_param = from_tasklet(tsk_param, t, tasklet); + struct pm8001_hba_info *pm8001_ha = container_of(tsk_param, + typeof(*pm8001_ha), + tasklet[tsk_param->irq_id]); struct isr_param *irq_vector; - irq_vector = (struct isr_param *)opaque; + irq_vector = &pm8001_ha->irq_vector[tsk_param->irq_id]; pm8001_ha = irq_vector->drv_inst; if (unlikely(!pm8001_ha)) BUG_ON(1); @@ -221,7 +224,7 @@ static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque) if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha)) return IRQ_NONE; #ifdef PM8001_USE_TASKLET - tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]); + tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id].tasklet); #else ret = PM8001_CHIP_DISP->isr(pm8001_ha, irq_vector->irq_id); #endif @@ -246,7 +249,7 @@ static irqreturn_t pm8001_interrupt_handler_intx(int irq, void *dev_id) return IRQ_NONE; #ifdef PM8001_USE_TASKLET - tasklet_schedule(&pm8001_ha->tasklet[0]); + tasklet_schedule(&pm8001_ha->tasklet[0].tasklet); #else ret = PM8001_CHIP_DISP->isr(pm8001_ha, 0); #endif @@ -507,13 +510,16 @@ static struct pm8001_hba_info *pm8001_pci_alloc(struct pci_dev *pdev, #ifdef PM8001_USE_TASKLET /* Tasklet for non msi-x interrupt handler */ if ((!pdev->msix_cap || !pci_msi_enabled()) - || (pm8001_ha->chip_id == chip_8001)) - tasklet_init(&pm8001_ha->tasklet[0], pm8001_tasklet, - (unsigned long)&(pm8001_ha->irq_vector[0])); - else - for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) - tasklet_init(&pm8001_ha->tasklet[j], pm8001_tasklet, - (unsigned long)&(pm8001_ha->irq_vector[j])); + || (pm8001_ha->chip_id == chip_8001)) { + pm8001_ha->tasklet[0].irq_id = 0; + tasklet_setup(&pm8001_ha->tasklet[0].tasklet, pm8001_tasklet); + } else { + for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) { + pm8001_ha->tasklet[j].irq_id = j; + tasklet_setup(&pm8001_ha->tasklet[j].tasklet, + pm8001_tasklet); + } + } #endif pm8001_ioremap(pm8001_ha); if (!pm8001_alloc(pm8001_ha, ent)) @@ -1162,10 +1168,10 @@ static void pm8001_pci_remove(struct pci_dev *pdev) /* For non-msix and msix interrupts */ if ((!pdev->msix_cap || !pci_msi_enabled()) || (pm8001_ha->chip_id == chip_8001)) - tasklet_kill(&pm8001_ha->tasklet[0]); + tasklet_kill(&pm8001_ha->tasklet[0].tasklet); else for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) - tasklet_kill(&pm8001_ha->tasklet[j]); + tasklet_kill(&pm8001_ha->tasklet[j].tasklet); #endif scsi_host_put(pm8001_ha->shost); pm8001_free(pm8001_ha); @@ -1212,10 +1218,10 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state) /* For non-msix and msix interrupts */ if ((!pdev->msix_cap || !pci_msi_enabled()) || (pm8001_ha->chip_id == chip_8001)) - tasklet_kill(&pm8001_ha->tasklet[0]); + tasklet_kill(&pm8001_ha->tasklet[0].tasklet); else for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) - tasklet_kill(&pm8001_ha->tasklet[j]); + tasklet_kill(&pm8001_ha->tasklet[j].tasklet); #endif device_state = pci_choose_state(pdev, state); pm8001_printk("pdev=0x%p, slot=%s, entering " @@ -1281,13 +1287,16 @@ static int pm8001_pci_resume(struct pci_dev *pdev) #ifdef PM8001_USE_TASKLET /* Tasklet for non msi-x interrupt handler */ if ((!pdev->msix_cap || !pci_msi_enabled()) || - (pm8001_ha->chip_id == chip_8001)) - tasklet_init(&pm8001_ha->tasklet[0], pm8001_tasklet, - (unsigned long)&(pm8001_ha->irq_vector[0])); - else - for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) - tasklet_init(&pm8001_ha->tasklet[j], pm8001_tasklet, - (unsigned long)&(pm8001_ha->irq_vector[j])); + (pm8001_ha->chip_id == chip_8001)) { + pm8001_ha->tasklet[0].irq_id = 0; + tasklet_setup(&pm8001_ha->tasklet[0].tasklet, pm8001_tasklet); + } else { + for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) { + pm8001_ha->tasklet[j].irq_id = j; + tasklet_setup(&pm8001_ha->tasklet[j].tasklet, + pm8001_tasklet); + } + } #endif PM8001_CHIP_DISP->interrupt_enable(pm8001_ha, 0); if (pm8001_ha->chip_id != chip_8001) { diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index ae7ba9b3c4bc..6dbaa394a08b 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h @@ -494,6 +494,10 @@ struct isr_param { struct pm8001_hba_info *drv_inst; u32 irq_id; }; +struct tsk_param { + struct tasklet_struct tasklet; + u32 irq_id; +}; struct pm8001_hba_info { char name[PM8001_NAME_LENGTH]; struct list_head list; @@ -549,7 +553,7 @@ struct pm8001_hba_info { [PM8001_NAME_LENGTH+1+3+1]; #endif #ifdef PM8001_USE_TASKLET - struct tasklet_struct tasklet[PM8001_MAX_MSIX_VEC]; + struct tsk_param tasklet[PM8001_MAX_MSIX_VEC]; #endif u32 logging_level; u32 link_rate; From patchwork Mon Aug 17 08:54:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 11717261 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 C1B81109B for ; Mon, 17 Aug 2020 08:55:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A485120758 for ; Mon, 17 Aug 2020 08:55:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="q2RqlflI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbgHQIzL (ORCPT ); Mon, 17 Aug 2020 04:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728640AbgHQIzG (ORCPT ); Mon, 17 Aug 2020 04:55:06 -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 4857FC061388; Mon, 17 Aug 2020 01:55:06 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id m71so7911119pfd.1; Mon, 17 Aug 2020 01:55: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=i3YmxLHQm4C9rpRDNyqYBl1hzYIOBuXCpBG9eSqKocA=; b=q2RqlflIosSWjEW5ihBRffG2ydwOfneUbuVPVIL0V607PveCwS51neeFaDxHEru92A GPu+J3VM9xNFWMCAM/fm74Q9+6JPkYqpWfXkiP8BqUnjWXA1poZxUbd4787LZ0v+Xu3M lvc8qTZTaUaVZ+5Sqsy1CjGA7YLKVsPKqtIzofNCD4pfpT00xOfxiU2tDd4Ye9b1ISOy D+A0zgBsBSwJsoSRKsftsx/X+ATutKj9lwKDgFlDWHsrbwpo9Ajy8eaYBPhWaBMe+oLT ugAKpcR28ytIp/TofY9ZLsjij9EkYWxlgG3Avk39Bd+m1Fr74uMRrmrfU150hk0aS9ij KVzQ== 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=i3YmxLHQm4C9rpRDNyqYBl1hzYIOBuXCpBG9eSqKocA=; b=KB0n2apoU6MOfGFtxfwgeu2uGz/CP16VAe/yUUd8p33Sqw8IoFQVXZ4yCT5THD14ar eruoqRkYKCVJbpRg7o4coVt33P1iKp2XVm1d9GUQPYSxB2rRfEue8jVMQ5zk24aShnqu 7KD2UC/XAVa2tiCmRG59aNaN/d4PnVYLRj9sb/GYMkk2kMGWAinHPL+7NL1lQhZdCL1H c7glL+77hiJqmTSsOmHr5xeWWMe2r7PPbVC+WrZPxUI5UZ2yEopOky5Aps5nqR3VQOTl GquwJLmoTZI/fQmIJiuWcIySND42SQ4J9G5D1j99CalDgKQTdLHvt0972qAPZV7tOl+b 4GzA== X-Gm-Message-State: AOAM532SNZCDuIkucGMdyszXCeDUoXWPp66QWx/We5NairdR1JOebI/Y gea9H6r9i6hboE4HLcfllX0= X-Google-Smtp-Source: ABdhPJwFE528F8McvzPMZNZ9fzvA/dqHQ1qHYLBTKwXGtLq3IheQPon7tMzbcyScOIfbM/xxS7FitA== X-Received: by 2002:a63:3d06:: with SMTP id k6mr9544204pga.316.1597654505767; Mon, 17 Aug 2020 01:55:05 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id x12sm18236990pff.48.2020.08.17.01.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:55:05 -0700 (PDT) From: Allen Pais To: jejb@linux.ibm.com, martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com Cc: keescook@chromium.org, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais , Romain Perier Subject: [PATCH 8/8] scsi: pmcraid: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:24:09 +0530 Message-Id: <20200817085409.25268-9-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085409.25268-1-allen.cryptic@gmail.com> References: <20200817085409.25268-1-allen.cryptic@gmail.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/scsi/pmcraid.c | 29 +++++++++++++++-------------- drivers/scsi/pmcraid.h | 9 +++++++-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index aa9ae2ae8579..b7bbefcbb11d 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -4198,7 +4198,7 @@ static irqreturn_t pmcraid_isr_msix(int irq, void *dev_id) } } - tasklet_schedule(&(pinstance->isr_tasklet[hrrq_id])); + tasklet_schedule(&(pinstance->isr_tasklet[hrrq_id]).tasklet); return IRQ_HANDLED; } @@ -4267,7 +4267,7 @@ static irqreturn_t pmcraid_isr(int irq, void *dev_id) pinstance->int_regs.ioa_host_interrupt_clr_reg); tasklet_schedule( - &(pinstance->isr_tasklet[hrrq_id])); + &(pinstance->isr_tasklet[hrrq_id].tasklet)); } } @@ -4380,20 +4380,20 @@ static void pmcraid_worker_function(struct work_struct *workp) * Return Value * None */ -static void pmcraid_tasklet_function(unsigned long instance) +static void pmcraid_tasklet_function(struct tasklet_struct *t) { - struct pmcraid_isr_param *hrrq_vector; - struct pmcraid_instance *pinstance; + struct pmcraid_tsk_param *tsk_param = from_tasklet(tsk_param, t, + tasklet); + int id = tsk_param->isr_tasklet_id; + struct pmcraid_instance *pinstance = container_of(tsk_param, + typeof(*pinstance), + isr_tasklet[id]); unsigned long hrrq_lock_flags; unsigned long pending_lock_flags; unsigned long host_lock_flags; spinlock_t *lockp; /* hrrq buffer lock */ - int id; u32 resp; - hrrq_vector = (struct pmcraid_isr_param *)instance; - pinstance = hrrq_vector->drv_inst; - id = hrrq_vector->hrrq_id; lockp = &(pinstance->hrrq_lock[id]); /* loop through each of the commands responded by IOA. Each HRRQ buf is @@ -4882,10 +4882,11 @@ static int pmcraid_allocate_config_buffers(struct pmcraid_instance *pinstance) static void pmcraid_init_tasklets(struct pmcraid_instance *pinstance) { int i; - for (i = 0; i < pinstance->num_hrrq; i++) - tasklet_init(&pinstance->isr_tasklet[i], - pmcraid_tasklet_function, - (unsigned long)&pinstance->hrrq_vector[i]); + for (i = 0; i < pinstance->num_hrrq; i++) { + pinstance->isr_tasklet[i].isr_tasklet_id = i; + tasklet_setup(&pinstance->isr_tasklet[i].tasklet, + pmcraid_tasklet_function); + } } /** @@ -4900,7 +4901,7 @@ static void pmcraid_kill_tasklets(struct pmcraid_instance *pinstance) { int i; for (i = 0; i < pinstance->num_hrrq; i++) - tasklet_kill(&pinstance->isr_tasklet[i]); + tasklet_kill(&pinstance->isr_tasklet[i].tasklet); } /** diff --git a/drivers/scsi/pmcraid.h b/drivers/scsi/pmcraid.h index 15c962108075..68dab849d4c1 100644 --- a/drivers/scsi/pmcraid.h +++ b/drivers/scsi/pmcraid.h @@ -617,6 +617,11 @@ struct pmcraid_isr_param { u8 hrrq_id; /* hrrq entry index */ }; +/* Tasklet parameters (one for each enabled tasklet) */ +struct pmcraid_tsk_param { + struct tasklet_struct tasklet; + u8 isr_tasklet_id; /* isr_tasklet entry index */ +}; /* AEN message header sent as part of event data to applications */ struct pmcraid_aen_msg { @@ -752,8 +757,8 @@ struct pmcraid_instance { spinlock_t free_pool_lock; /* free pool lock */ spinlock_t pending_pool_lock; /* pending pool lock */ - /* Tasklet to handle deferred processing */ - struct tasklet_struct isr_tasklet[PMCRAID_NUM_MSIX_VECTORS]; + /* Tasklet parameters and tasklets to handle deferred processing */ + struct pmcraid_tsk_param isr_tasklet[PMCRAID_NUM_MSIX_VECTORS]; /* Work-queue (Shared) for deferred reset processing */ struct work_struct worker_q;