From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-x229.google.com (mail-qk0-x229.google.com [IPv6:2607:f8b0:400d:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AF96C819D7 for ; Fri, 6 Jan 2017 00:31:01 -0800 (PST) Received: by mail-qk0-x229.google.com with SMTP id s140so45452096qke.0 for ; Fri, 06 Jan 2017 00:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QU0YTAKlC1s2C8bshQpz43i7Q2Xzk/oSfDlN7Yw5QyE=; b=S4ITrhue55bdhWVt66PH6zUzrolcG/nXLmduMCLPIVlk3/+vUZ6qBPJc8sHzBGe9bT sFTosUKIwhVM0svLNT/ADRv3g6dlt6IBnBD0pAB7xIxIRkpvxaqZ0FYe/OCaJyNcWNBm 0pwDwHYMcsf5PkYZ+L0CBti7IsBzg5WVFIwjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QU0YTAKlC1s2C8bshQpz43i7Q2Xzk/oSfDlN7Yw5QyE=; b=d+eXdpJ2A54Oy2U88AaHBaulnxNWjaY9atnI9ue32EE2xkg4buSTu5mKIClIlwRySB 1H1o/yBE1qLUDMrCQH/WFfY8LT7xJi6ii05ENkLW5fIy6a3UZKu2bCS00i/kzDAiF4Gv c+QcwNu45WW8DKmWwhGw17fJZJzo/K9g6XGcr2HCDmkFmcgE72nvNfgTo8p9NxZUQFuQ n7athjjrKvEPqGsQezFufLcGzIbQsmaB83Nq9Ljneiu2fSrbhviZUtLYi2Wr+g3YIokX d/nqaoMdZ909q5PRFay5H6Vav45ou+1u056WG5RrbuUVjyuV3cVFZfJcbQ2A3Qx1Y1hm x+3w== X-Gm-Message-State: AIkVDXL8gaguZBoDxbWeflpgIqe0d5jhxPwHsJdbipbOeajrdPKKpGXiLTH2wpkcNN8Gf5xjl3D+GrSONDqdMFVx X-Received: by 10.55.133.199 with SMTP id h190mr82563018qkd.302.1483691460757; Fri, 06 Jan 2017 00:31:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.41.114 with HTTP; Fri, 6 Jan 2017 00:31:00 -0800 (PST) In-Reply-To: <7F1BAD85ADEA444D97065A60D2E97EE5699A6090@SHSMSX101.ccr.corp.intel.com> References: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> <1483685538-11058-10-git-send-email-haojian.zhuang@linaro.org> <7F1BAD85ADEA444D97065A60D2E97EE5699A6090@SHSMSX101.ccr.corp.intel.com> From: Haojian Zhuang Date: Fri, 6 Jan 2017 16:31:00 +0800 Message-ID: To: "Tian, Feng" Cc: "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" Subject: Re: [PATCH 9/9] ScsiDisk: retry if device detected power failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 08:31:01 -0000 Content-Type: text/plain; charset=UTF-8 Hi Feng, Yes, it's a bit redudant. Let's ignore it. Best Regards Haojian On 6 January 2017 at 16:22, Tian, Feng wrote: > Hi, Haojian > > We have handled ASC code 0x29 at DetectMediaParsingSenseKeys(). TestUnitReady will retry if it's that case. > > So I don't understand this fix. > > Thanks > Feng > > -----Original Message----- > From: Haojian Zhuang [mailto:haojian.zhuang@linaro.org] > Sent: Friday, January 6, 2017 2:52 PM > To: Tian, Feng ; leif.lindholm@linaro.org; ard.biesheuvel@linaro.org; edk2-devel@lists.01.org > Cc: Haojian Zhuang > Subject: [PATCH 9/9] ScsiDisk: retry if device detected power failure > > If device detected power failure, just retry. This operation is common in linux kernel. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Haojian Zhuang > --- > MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c > index b5eff25..a7b62ec 100644 > --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c > +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c > @@ -2251,6 +2251,12 @@ ScsiDiskTestUnitReady ( > if (SenseDataLength != 0) { > *NumberOfSenseKeys = SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA); > *SenseDataArray = ScsiDiskDevice->SenseData; > + if (((*SenseDataArray)->Sense_Key == EFI_SCSI_SK_UNIT_ATTENTION) && > + ((*SenseDataArray)->Addnl_Sense_Code == 0x29) && > + ((*SenseDataArray)->Addnl_Sense_Code_Qualifier == 0)) { > + *NeedRetry = TRUE; > + return EFI_NOT_READY; > + } > return EFI_SUCCESS; > } > > -- > 2.7.4 >