From patchwork Fri Dec 22 07:31:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10128901 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 E332460318 for ; Fri, 22 Dec 2017 07:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D630F29EE0 for ; Fri, 22 Dec 2017 07:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB02829FCE; Fri, 22 Dec 2017 07:32:26 +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 5196929EE0 for ; Fri, 22 Dec 2017 07:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754013AbdLVHcZ (ORCPT ); Fri, 22 Dec 2017 02:32:25 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:46626 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753590AbdLVHcZ (ORCPT ); Fri, 22 Dec 2017 02:32:25 -0500 Received: by mail-wr0-f193.google.com with SMTP id g17so17904611wrd.13 for ; Thu, 21 Dec 2017 23:32:24 -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=m4Axlh8dO2WTNWcUmycZSC8z8FlJEnNGCkxPhxVlJVw=; b=URpv/KRiMYaIwWxG8ghCCcq2YlBN5SqfAisWQVb4VyPyLEhkftG6N5ATQAUJVstOkm 2xRYuGr0O2ke/CX5fNr+g7U7zRrceiY25lQj1Wj0kFNll083OVZUCzavDLBaP6JI3n3g 52IZ00pVQs3elmwcFwYTD4F7tHGUo+M82GhnU= 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=m4Axlh8dO2WTNWcUmycZSC8z8FlJEnNGCkxPhxVlJVw=; b=jZeIQ6MuPgidEcv27NOe4iRqkoAoEIk48OUfo2tWOaHlWhHCP92k75/a8NY3Vd0rtj KiHLMa8n9T+M164flvajpzT1LkVawz9SgbUiWn7ZmYqSUoZmpWF4GWhDhrUgIRHDVToP eWG/JtZ+toMSG4UhPfJ5L4MX4HDD5xqgpqPDcQv1K7ZtvaXAG8r+WpU+Zr/QFhY19gWR UFLVopli+rQQ4lVBk3sObiSeJUqbx5QjIvN7Z8la0BaKrtcvym01/r/AN1XfaSl+Jy8N nOJkvwtF+Ud8fyKN7uqGb2rW8wdo5a5Oxxe+c2i7IjlMFgMK97Eqf45knMw8AGftx/bS pRlw== X-Gm-Message-State: AKGB3mJ/u8dz0uOzl0+m9MAEmuKsMGwt5ZbnET3AtgFk6J+e+mpa+FuU 2ZhPnWPqZoczQ5W8sGlwu1GeSYfl X-Google-Smtp-Source: ACJfBotbgVE2qRP4JQMsG36+X53UJn2jmZIlll49HZiAjTP7wjS97E9HjGHkZSizlA1wibzYqYRSiw== X-Received: by 10.223.149.69 with SMTP id 63mr15144272wrs.89.1513927943584; Thu, 21 Dec 2017 23:32:23 -0800 (PST) Received: from dhcp-135-24-192-103.dhcp.broadcom.net ([192.19.239.250]) by smtp.googlemail.com with ESMTPSA id b7sm10379462wrd.69.2017.12.21.23.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 23:32:22 -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, Hannes Reinecke , Suganath Prabu S , Chaitra P B Subject: [PATCH 03/11] mpt3sas: separate out _base_recovery_check() Date: Thu, 21 Dec 2017 23:31:39 -0800 Message-Id: <1513927907-19735-4-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1513927907-19735-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1513927907-19735-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: Suganath Prabu S Signed-off-by: Chaitra P B --- 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 5a9ad26..35d36a9 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 */