Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1108891imm; Wed, 1 Aug 2018 10:19:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeiB+iDAWtABNTK4PfjCy03BJ1HXhx4JV4LksuWwly983Hb7Y7z8RKL+fshjTdynBSF0jgE X-Received: by 2002:a17:902:be07:: with SMTP id r7-v6mr26292766pls.124.1533143957853; Wed, 01 Aug 2018 10:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533143957; cv=none; d=google.com; s=arc-20160816; b=nkvYqBJYUVSKZOTQ8k5ouE0it1pMW0r6B7wg9X6d/g/d+8glK3Sk5caUJAMVUr77q8 JfTlGrOy2ogwo3qC0sxw5v4tFlMqt8a31KwYUNtdSYCrOgRU/xzO051GuuUWN4UXAklA B8ESx2CP6e54/6SP4CnVIYH18MhPTk5+iq0eKTAIcsM5AntP9bAkXYKAKwPQp/CbD+5U /Of/yaXre5FTf4g1C9yZ4Sy2+m/kYCOzVYA7LJ267qwRIi3I8uIhlK+dguGvwLAWgaJR qyBisnPwEWClcv1tgQzo9MzcoAUAT7m51LBl94ohzLToqW40d4oC1TBjQcgOZYOrGM3K o0Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=y1jVElUwG+1KLm+vdRogiBVzxsOvZx2jGiF5WptEc4Q=; b=Ll/AuxnDu3xdPtfJY06JpRZshRXDTNxr9yvUHRtxSczToXwQOhSMrqolLjA4Red9QS BrFguSCFayxEYNJJ0RZ20Z3wIzceGc8/TBCH8t9AaNHiT5Tc/ag7GtqJGhQllVor3LFQ wpxghUwQZzSbnwrpLslsfGSMtcsE0HvisgxeBCM7l9e08muflB5NjHzbEosJmIvl2HXQ j99sKYH6qwFb6ehZpwlTOj7bQSuA2nHUr6KypNAM+bBBXHA8SGZJsXDx6/ebOfzDmXDE 0fGFCnTbItHV3Ab30gH3hJZADCr/dtbTi2bnU1bJJdwM0d88uFFzjMPtCTGkYkoZVtmg 7ZXw== 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 i7-v6si15011731plt.433.2018.08.01.10.19.03; Wed, 01 Aug 2018 10:19:17 -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 S2404739AbeHATEU (ORCPT + 99 others); Wed, 1 Aug 2018 15:04:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46488 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404028AbeHATET (ORCPT ); Wed, 1 Aug 2018 15:04:19 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BA7EAC96; Wed, 1 Aug 2018 17:17:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Subhash Jadavani , Maya Erez , Can Guo , Asutosh Das , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 118/246] scsi: ufs: fix exception event handling Date: Wed, 1 Aug 2018 18:50:28 +0200 Message-Id: <20180801165017.364818946@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maya Erez [ Upstream commit 2e3611e9546c2ed4def152a51dfd34e8dddae7a5 ] 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 Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4947,6 +4947,7 @@ static void ufshcd_exception_event_handl 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", @@ -4960,6 +4961,7 @@ static void ufshcd_exception_event_handl ufshcd_bkops_exception_event_handler(hba); out: + scsi_unblock_requests(hba->host); pm_runtime_put_sync(hba->dev); return; }