From patchwork Thu Jan 4 12:57:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10144699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96E606034B for ; Thu, 4 Jan 2018 12:57:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 849722817F for ; Thu, 4 Jan 2018 12:57:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7986728635; Thu, 4 Jan 2018 12:57:45 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 260A42817F for ; Thu, 4 Jan 2018 12:57:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbeADM5o (ORCPT ); Thu, 4 Jan 2018 07:57:44 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:36814 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752717AbeADM5m (ORCPT ); Thu, 4 Jan 2018 07:57:42 -0500 Received: by mail-qk0-f196.google.com with SMTP id g123so1779189qka.3 for ; Thu, 04 Jan 2018 04:57:42 -0800 (PST) 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=f3wBLS6DPfYK64cN0QUKDgMB5Gld41/TueXIwwFMstI=; b=Quw6r17SUhXTiZACTUo8eG2OHVgKcn0RbGv8cqiv92XTP+BFZZRvPd5G4mpcFhZFlz XGKCWpENqJBmxYwc+/RIw64+Fthn4pMBx5dlZAmuoNqHMzvKYoPOlprdHIyg1SqD97Bm Q4zH2qwQFh6mD+HbMRJgN33/aVAI7b0KmX31s= 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=f3wBLS6DPfYK64cN0QUKDgMB5Gld41/TueXIwwFMstI=; b=ML7TasoP5Dg7ifQO3VqE1adRn2zKoI3xPYbnVehpSotR1Po9pYXr81a0C07j/ed5Tm I78TJpe4ZHrKR0lCROkIhd9LxwA1FhfvsHqiK3Er7bQ7rw3/RDKHd4qoj3Cuq0lNi6qC wzRCx/HhESk7hHu18Rw1FveuDl0f7uC40U8wFtmBQTulBjaBV3TR/4lIVyi+kfzRotoY F+aee9nYhjt/kcqnd+XZLOUM/HvxfGtyVKguJRPTWPPReIXT7jIDITAhCjvQx5ifbNyz g1V9c/fbW8dThvKUoQSf5VWN68jy9eaX5l+6X6p2gDuU5DPS59JvTca3aagdbLkV7d6H 1ymw== X-Gm-Message-State: AKGB3mIZn7GHIckywF5CyrwU2E36oi+HC88/7elJ7/W0CklF2WJwGPRj yXj/OW+kjU4JOON/7HlcZqHVnNzV X-Google-Smtp-Source: ACJfBov6Ffwp69bRQrlg9ktrLVyMvvZNYhR8nIJGPESKlOCYJDlLJ9C/sk54g4RaTcxfbRSQuhSXlg== X-Received: by 10.55.82.5 with SMTP id g5mr6224519qkb.241.1515070661672; Thu, 04 Jan 2018 04:57:41 -0800 (PST) Received: from dhcp-135-24-192-103.dhcp.broadcom.net ([192.19.239.250]) by smtp.googlemail.com with ESMTPSA id v58sm2064328qtk.18.2018.01.04.04.57.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 04:57:41 -0800 (PST) From: Suganath Prabu S To: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, chaitra.basappa@broadcom.com, Hannes Reinecke , Hannes Reinecke , Suganath Prabu S Subject: [Resend 03/11] mpt3sas: separate out _base_recovery_check() Date: Thu, 4 Jan 2018 04:57:03 -0800 Message-Id: <1515070631-14740-4-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1515070631-14740-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1515070631-14740-1-git-send-email-suganath-prabu.subramani@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 From: Hannes Reinecke No functional change. Signed-off-by: Hannes Reinecke Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_base.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 464a11e..55aa80c 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -2873,6 +2873,19 @@ mpt3sas_base_get_smid_hpr(struct MPT3SAS_ADAPTER *ioc, u8 cb_idx) return smid; } +static void +_base_recovery_check(struct MPT3SAS_ADAPTER *ioc) +{ + /* + * See _wait_for_commands_to_complete() call with regards to this code. + */ + if (ioc->shost_recovery && ioc->pending_io_count) { + if (ioc->pending_io_count == 1) + wake_up(&ioc->reset_wq); + ioc->pending_io_count--; + } +} + /** * mpt3sas_base_free_smid - put smid back on free_list * @ioc: per adapter object @@ -2898,15 +2911,7 @@ mpt3sas_base_free_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid) list_add(&ioc->scsi_lookup[i].tracker_list, &ioc->free_list); spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); - /* - * See _wait_for_commands_to_complete() call with regards - * to this code. - */ - if (ioc->shost_recovery && ioc->pending_io_count) { - if (ioc->pending_io_count == 1) - wake_up(&ioc->reset_wq); - ioc->pending_io_count--; - } + _base_recovery_check(ioc); return; } else if (smid < ioc->internal_smid) { /* hi-priority */