From patchwork Fri Oct 12 10:57:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10638503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FD2614E2 for ; Fri, 12 Oct 2018 10:58:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BF252B47D for ; Fri, 12 Oct 2018 10:58:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D3452B481; Fri, 12 Oct 2018 10:58:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E70672B47D for ; Fri, 12 Oct 2018 10:58:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728157AbeJLSa3 (ORCPT ); Fri, 12 Oct 2018 14:30:29 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38407 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727652AbeJLSa3 (ORCPT ); Fri, 12 Oct 2018 14:30:29 -0400 Received: by mail-ed1-f68.google.com with SMTP id c1-v6so11104024ede.5 for ; Fri, 12 Oct 2018 03:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JUE9nkjqSQQ1yADmzQqcJcVV2JzgB7i0rngshvDGYXc=; b=AC0byGek1j0w3uZdye1IdWYf8eAAj/qbFbf3qyxWWx/yDpoJtoIlgHsYeoIMg1588a xBvFQeuzsaLghXAJGWvAvIl82ibYlhZ05k/Qjh8ye02bLenN6+JqcXE+Tdt6erCeI9U4 q5dBzUl/aGxAXXJQO+uC0px7bKc1IkN7/JOFw= 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=JUE9nkjqSQQ1yADmzQqcJcVV2JzgB7i0rngshvDGYXc=; b=KwLHt+1HX+oOld5/8F9TkIhIFQ30qK0BzOWNBe4tsxUL6ddsObJCMwkB0svysZGvx0 s/duScw8rxkMHCvGh7p7kUSjlqHRzWU7McOEQl+Ax23H5yJGO+03LaggrBcEqlQPSw8W Hw0pY3sEI1pSAW4KuVNsJjrGervmTQ5vTFOd/PyDbwwqBBsw6uHyjFEgoxlH5GwgimwP rNfdWx1mT/6dZxFgjCbfOswDQLpVgltRm+qErcBQDeebeRUAXGeqWhoTqA3DWEUCRQvS 1vyP75t3cKPT69drSgUxo0L5btXB4Ahlutc1skZPkTsFdOKWl3DJKsh03BUvY/wR6/CD f/xA== X-Gm-Message-State: ABuFfogPkk3wFe2wuMwi0QV1PtVN2rWv5BEnatVwBheAbh6ryM1eQXr9 cw1qa3sNxHxsI29DnsUN0jc/pHHhsYN1Og== X-Google-Smtp-Source: ACcGV62tXxJXO96fBli2dIesCHEFqheGHgUYhHLIofcA65f492Uqcm/Pnzr6zVqzlTa9W9Eneb2E9A== X-Received: by 2002:aa7:d2d0:: with SMTP id k16-v6mr8291915edr.292.1539341915325; Fri, 12 Oct 2018 03:58:35 -0700 (PDT) Received: from dhcp-135-24-192-142.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id m25-v6sm451198edc.86.2018.10.12.03.58.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 03:58:34 -0700 (PDT) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S Subject: [PATCH 12/19] megaraid_sas: Remove spin lock for dpc operation Date: Fri, 12 Oct 2018 03:57:26 -0700 Message-Id: <1539341853-26814-13-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1539341853-26814-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> References: <1539341853-26814-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Optimization - No need to hold hba_lock in dpc context for reading atomic variable. Signed-off-by: Shivasharan S --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 774e1c619ab2..e4c47e9d994c 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3573,18 +3573,13 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr) { struct megasas_instance *instance = (struct megasas_instance *)instance_addr; - unsigned long flags; u32 count, MSIxIndex; count = instance->msix_vectors > 0 ? instance->msix_vectors : 1; /* If we have already declared adapter dead, donot complete cmds */ - spin_lock_irqsave(&instance->hba_lock, flags); - if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) { - spin_unlock_irqrestore(&instance->hba_lock, flags); + if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) return; - } - spin_unlock_irqrestore(&instance->hba_lock, flags); for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) complete_cmd_fusion(instance, MSIxIndex);