Received: by 10.223.176.5 with SMTP id f5csp2426508wra; Sun, 28 Jan 2018 20:36:02 -0800 (PST) X-Google-Smtp-Source: AH8x227uRYyfe5fRDGH8LPlu5jA8iANxFD+TD2Jefl8W6Y/FBAiRAIcaRqIJMmu8wnCugloXKVFI X-Received: by 2002:a17:902:7889:: with SMTP id q9-v6mr272036pll.114.1517200562757; Sun, 28 Jan 2018 20:36:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517200562; cv=none; d=google.com; s=arc-20160816; b=RpiMBjrLealKZa4fjWN3KAwbYfMPFY7DKV39fNZCY2xTH+LTh9wu76rb2sVeW6pvcF X8r620pZAR3vDoPjVAbOgaxQ6xYmaUJuKE9MwDPv2fwWyBC3xp5WQc7g3wfKVx95CzGn 7T0z+gzAZBRwTR1xzsyDrVNbcgR9XZhqZAM0h2XGc8p2XVGpM2lDms28kVkq610EV36M nn2uCBwP4sqpUg8BrWbOF+ZriX62Tmz4MGlS6abAI0BwXPz7ikQFXaOdxaySqwtEoCDx iBLLa9XwVzi3aro6acI6QMD08Wvlhh212yQnq+B1/yNO05arN9Evy5fawXb+X8gf3h7J hSiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6qj3zDQKyTWLL8bPW+RYed4eROegDFWiuSg+wk17+4Y=; b=GuAKSQvQvkn+iey+6WJmZBNlwxFZ8Q1InXlVZZDfVRwFcz7wLzhABUZ93bm7lgCRe0 5MY8r6WdsUbOiSQ/LnuPv4lgT4hf7bPXI07Cvz/ykwnns/d3AGfFObJlCzC8Y3J1mqfU mCOwGiEIZ20F3g2WdIHZ0+Ln5mVNt4QLHJuH2WS9TPOw0GQf0KLuDxKAp+JOjAT+6bXT +N05Xe1FRSQ/aDUgX3V9MSe3hhZQs/p++1/1p8f+V14X2rVZwJ7H866ERmZd42uTreof /AOKgG4smDtIpWN1GTqW57Yt0Qny5GAH/XYE1qXKlUk6OV4/ZLA/xE1iWQHpqjgs5AcX 9gbA== 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 n3si6687111pgu.208.2018.01.28.20.35.46; Sun, 28 Jan 2018 20:36:02 -0800 (PST) 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 S1751281AbeA2EfY (ORCPT + 99 others); Sun, 28 Jan 2018 23:35:24 -0500 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:6497 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbeA2EfW (ORCPT ); Sun, 28 Jan 2018 23:35:22 -0500 X-IronPort-AV: E=Sophos;i="5.46,429,1511856000"; d="scan'208";a="123063060" Received: from unknown (HELO ironmsg01-tai.qualcomm.com) ([10.249.140.6]) by sabertooth01.qualcomm.com with ESMTP; 28 Jan 2018 20:35:21 -0800 X-IronPort-AV: E=McAfee;i="5900,7806,8788"; a="177248" X-MGA-submission: =?us-ascii?q?MDEfI2YJ5dj20PRTPHXInwZdc2wNkvLZJf81x9?= =?us-ascii?q?94BoXghQRuyOzpgxSgOhURBCnTc7RYoAPkMYlHrTJtpKukk91djigMJQ?= =?us-ascii?q?sdVVQQ+g8xRZOv5QgMxC4DB7jJu2jQ+JEJ+OYj9raJmOG+8EAmvPy+0n?= =?us-ascii?q?01?= Received: from asutoshd-linux.qualcomm.com ([10.206.24.163]) by ironmsg01-tai.qualcomm.com with ESMTP; 28 Jan 2018 20:35:01 -0800 Received: by asutoshd-linux.qualcomm.com (Postfix, from userid 92687) id 70B651C63; Mon, 29 Jan 2018 10:05:00 +0530 (IST) From: Asutosh Das To: subhashj@codeaurora.org, cang@codeaurora.org, vivek.gautam@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Maya Erez , Asutosh Das , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/1] scsi: ufs: fix exception event handling Date: Mon, 29 Jan 2018 10:04:52 +0530 Message-Id: <1517200492-2941-1-git-send-email-asutoshd@codeaurora.org> X-Mailer: git-send-email 1.9.1 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 8af2af3..2dd488f 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4955,6 +4955,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", @@ -4968,6 +4969,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.