From patchwork Thu May 3 10:35:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Asutosh Das (asd)" X-Patchwork-Id: 10377725 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 15D9F60353 for ; Thu, 3 May 2018 10:42:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BDC228EE3 for ; Thu, 3 May 2018 10:42:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1101D28F2A; Thu, 3 May 2018 10:42:05 +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.9 required=2.0 tests=BAYES_00, 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 A522F28F24 for ; Thu, 3 May 2018 10:42:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751785AbeECKmD (ORCPT ); Thu, 3 May 2018 06:42:03 -0400 Received: from alexa-out-tai-01.qualcomm.com ([103.229.16.226]:41401 "EHLO alexa-out-tai-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751799AbeECKmA (ORCPT ); Thu, 3 May 2018 06:42:00 -0400 X-IronPort-AV: E=Sophos;i="5.49,358,1520870400"; d="scan'208";a="443497" Received: from ironmsg03-tai.qualcomm.com ([10.249.140.8]) by alexa-out-tai-01.qualcomm.com with ESMTP; 03 May 2018 18:35:38 +0800 X-IronPort-AV: E=McAfee;i="5900,7806,8881"; a="7257121" Received: from asutoshd-linux.qualcomm.com ([10.206.24.163]) by ironmsg03-tai.qualcomm.com with ESMTP; 03 May 2018 18:35:32 +0800 Received: by asutoshd-linux.qualcomm.com (Postfix, from userid 92687) id BA2252E89; Thu, 3 May 2018 16:05:31 +0530 (IST) From: Asutosh Das To: asutoshd@qti.qualcomm.com, linux-mmc@vger.kernel.org Subject: [PATCH v2 04/10] scsi: ufs: fix exception event handling Date: Thu, 3 May 2018 16:05:25 +0530 Message-Id: <01e6421c38e4eb1f67f3c98a8dab44a85f791ef2.1525343531.git.asutoshd@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maya Erez The device can set the exception event bit in one of the response UPIU, for example to notify the need for urgent BKOPs operation. In such a case the host driver calls ufshcd_exception_event_handler to handle this notification. When trying to check the exception event status (for finding the cause for the exception event), the device may be busy with additional SCSI commands handling and may not respond within the 100ms timeout. To prevent that, we need to block SCSI commands during handling of exception events and allow retransmissions of the query requests, in case of timeout. Signed-off-by: Subhash Jadavani Signed-off-by: Maya Erez Signed-off-by: Can Guo Signed-off-by: Asutosh Das Reviewed-by: Subhash Jadavani Reviewed-by: Subhash Jadavani --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 6dabce8..838ba8f0 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4967,6 +4967,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work) hba = container_of(work, struct ufs_hba, eeh_work); pm_runtime_get_sync(hba->dev); + scsi_block_requests(hba->host); err = ufshcd_get_ee_status(hba, &status); if (err) { dev_err(hba->dev, "%s: failed to get exception status %d\n", @@ -4980,6 +4981,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work) ufshcd_bkops_exception_event_handler(hba); out: + scsi_unblock_requests(hba->host); pm_runtime_put_sync(hba->dev); return; }