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: 257948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06DE4C433E1 for ; Mon, 17 Aug 2020 08:54:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA661207DF for ; Mon, 17 Aug 2020 08:54:47 +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 S1728210AbgHQIyo (ORCPT ); Mon, 17 Aug 2020 04:54:44 -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: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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: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: 257947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E3DBC433DF for ; Mon, 17 Aug 2020 08:55:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DED75207DF for ; Mon, 17 Aug 2020 08:55:00 +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 S1727086AbgHQIy5 (ORCPT ); Mon, 17 Aug 2020 04:54:57 -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: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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: 257945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 763A6C433E1 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 51A252067C 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 S1728210AbgHQIy4 (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: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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: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: 257946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6FBEC433DF for ; Mon, 17 Aug 2020 08:55:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C465920829 for ; Mon, 17 Aug 2020 08:55:14 +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 S1728646AbgHQIzM (ORCPT ); Mon, 17 Aug 2020 04:55:12 -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: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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;