From patchwork Sat Jun 24 11:14:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zang Leigang X-Patchwork-Id: 9807759 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 745C760382 for ; Sat, 24 Jun 2017 11:15:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BA23286D7 for ; Sat, 24 Jun 2017 11:15:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EA1328788; Sat, 24 Jun 2017 11:15:18 +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=-6.9 required=2.0 tests=BAYES_00,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 44418286D7 for ; Sat, 24 Jun 2017 11:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751305AbdFXLPQ (ORCPT ); Sat, 24 Jun 2017 07:15:16 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:8375 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbdFXLPP (ORCPT ); Sat, 24 Jun 2017 07:15:15 -0400 Received: from 172.30.72.56 (EHLO DGGEML401-HUB.china.huawei.com) ([172.30.72.56]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id APY88542; Sat, 24 Jun 2017 19:15:12 +0800 (CST) Received: from kirin.host.huawei.com (10.184.169.118) by DGGEML401-HUB.china.huawei.com (10.3.17.32) with Microsoft SMTP Server id 14.3.301.0; Sat, 24 Jun 2017 19:15:07 +0800 From: Zang Leigang To: , , CC: Subject: [PATCH] scsi: ufs: flush eh_work when eh_work scheduled. Date: Sat, 24 Jun 2017 19:14:32 +0800 Message-ID: <20170624111432.11852-1-zangleigang@hisilicon.com> X-Mailer: git-send-email 2.13.0 MIME-Version: 1.0 X-Originating-IP: [10.184.169.118] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.594E49C0.0125, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 332ea15a512f323688417dda73b5d57c 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 Forget a condition: eh_work scheduled but do not start to work. Signed-off-by: Zang Leigang Reviewed-by: Subhash Jadavani diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e050dcea1bea..a2dff12713fc 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5807,7 +5807,8 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd) do { spin_lock_irqsave(hba->host->host_lock, flags); if (!(work_pending(&hba->eh_work) || - hba->ufshcd_state == UFSHCD_STATE_RESET)) + hba->ufshcd_state == UFSHCD_STATE_RESET || + hba->ufshcd_state == UFSHCD_STATE_EH_SCHEDULED)) break; spin_unlock_irqrestore(hba->host->host_lock, flags); dev_dbg(hba->dev, "%s: reset in progress\n", __func__);