Received: by 10.192.165.148 with SMTP id m20csp1709349imm; Thu, 3 May 2018 04:15:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpPFDbEhf2qMkJIfV80eg3JK2IdT1otXRLzJpNlt4kqgt/nC6sfr3wQnCfFcBGFcCJMlwl5 X-Received: by 10.98.152.29 with SMTP id q29mr2286775pfd.65.1525346140215; Thu, 03 May 2018 04:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525346140; cv=none; d=google.com; s=arc-20160816; b=j+1n5QdE701090j5V9+lddzIIyQTD9uU8qIqpYNEs8lFYkAG3A7sEJ6cDZ0RG4chlc AfHMi8xAEiP5htOeKiFY0ddAIJOfRhgYKwwUh75NzYYlA+9gPwqiz55CvSOBja4AZFXZ TH0hMplyuUkV7Qe9rOytuTUn6G4lHyO2VpKYeMZNKZspLHgr4IxHwSJ2tT2jDaIgMMsM MrKPw+AvccPRi9Ap156GaDSJ2ArGTiEICUsrlwUWTwK7xbuy150MH6HGwkiZmm2fLUVG VEbJNvSFFDD1OsL57RJZYlzCGB8m+UQCc8V1iAA+uLWPlljb3IwYLPlQpoW+qUz2SCAu CysA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=K222Jx7hCUUUjDgHba6317f0H93frY0ZwCunXoKhx+Y=; b=WvdD1x6Xvr+nTKW6PIYB70c+tOxZz3rF7w1cw5VFxHtVhQ2qEO2XXJNht0mnwD+eqs ZUdY0jN9fQfVFCLADLj72PpaQkNIqziIeEcDOinAtTU2lxbVzvm+33HP18JfzA0Adh5y T4xdRarc1C8ciTIiwLjbGBFyw/FH0+P/DFxhQgcMX4Lk7ZL/ejx/6JzqZTTdxGvQxBTD cgN1Pm28P+Y5C04rNItDbfE986Ek4XbbwF3b+yHQ2E9QFPSJGttl5sc4b67axCswUt21 L+jrA6bzZxumaBDgNg3U0JXZgr0D7Ha8gr/+xgiPKC9DwtWFhx+SwOpU8JKdclO4ZyF0 q1AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i65si14641326pfb.343.2018.05.03.04.15.26; Thu, 03 May 2018 04:15:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751628AbeECLOZ (ORCPT + 99 others); Thu, 3 May 2018 07:14:25 -0400 Received: from alexa-out-tai-01.qualcomm.com ([103.229.16.226]:12748 "EHLO alexa-out-tai-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbeECLOP (ORCPT ); Thu, 3 May 2018 07:14:15 -0400 X-IronPort-AV: E=Sophos;i="5.49,358,1520870400"; d="scan'208";a="443707" Received: from ironmsg02-tai.qualcomm.com ([10.249.140.7]) by alexa-out-tai-01.qualcomm.com with ESMTP; 03 May 2018 19:07:54 +0800 X-IronPort-AV: E=McAfee;i="5900,7806,8881"; a="7390446" Received: from asutoshd-linux.qualcomm.com ([10.206.24.163]) by ironmsg02-tai.qualcomm.com with ESMTP; 03 May 2018 19:07:39 +0800 Received: by asutoshd-linux.qualcomm.com (Postfix, from userid 92687) id 371C62E8A; Thu, 3 May 2018 16:37:38 +0530 (IST) From: Asutosh Das To: subhashj@codeaurora.org, cang@codeaurora.org, vivek.gautam@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, asutoshd@codeaurora.org, linux-mmc@vger.kernel.org Cc: linux-scsi@vger.kernel.org, Maya Erez , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 04/10] scsi: ufs: fix exception event handling Date: Thu, 3 May 2018 16:37:16 +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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.