From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5068C21129447 for ; Mon, 17 Sep 2018 00:18:34 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2018 00:18:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,384,1531810800"; d="scan'208";a="233512275" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 17 Sep 2018 00:18:01 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 17 Sep 2018 00:18:01 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 17 Sep 2018 00:18:00 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.143]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.150]) with mapi id 14.03.0319.002; Mon, 17 Sep 2018 15:17:58 +0800 From: "Wu, Hao A" To: Marcin Wojtas , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Gao, Liming" , "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" , "nadavh@marvell.com" , "jsd@semihalf.com" , "tm@semihalf.com" Thread-Topic: [PATCH v3 3/3] MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot Thread-Index: AQHUTUMb8aoB3bBbAkiB0DVmq1F44aT0EZ6g Date: Mon, 17 Sep 2018 07:17:57 +0000 Message-ID: References: <1537050346-16445-1-git-send-email-mw@semihalf.com> <1537050346-16445-4-git-send-email-mw@semihalf.com> In-Reply-To: <1537050346-16445-4-git-send-email-mw@semihalf.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v3 3/3] MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 07:18:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Could you help to file a EDK2 Bugzilla tracker at: https://bugzilla.tianocore.org/enter_bug.cgi?product=3DEDK2 to have a general description of the issue you met? And reference the tracker within the commit message? Really appreciate the help, thanks in advance. With that, Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: Marcin Wojtas [mailto:mw@semihalf.com] > Sent: Sunday, September 16, 2018 6:26 AM > To: edk2-devel@lists.01.org > Cc: Tian, Feng; Kinney, Michael D; Gao, Liming; leif.lindholm@linaro.org;= Wu, > Hao A; ard.biesheuvel@linaro.org; nadavh@marvell.com; mw@semihalf.com; > jsd@semihalf.com; tm@semihalf.com > Subject: [PATCH v3 3/3] MdeModulePkg/SdMmcPciHcDxe: Execute card detect > only for RemovableSlot >=20 > Some devices can be non removable (such as eMMC) and checking > Present State Register on host controller may falsely return > an information that device is not present. Execute this > check conditionally on the SloType field value. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Marcin Wojtas > --- > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 18 > ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > index f923930..bf9869d 100644 > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > @@ -661,12 +661,18 @@ SdMmcPciHcDriverBindingStart ( > // > // Check whether there is a SD/MMC card attached > // > - Status =3D SdMmcHcCardDetect (PciIo, Slot, &MediaPresent); > - if (EFI_ERROR (Status) && (Status !=3D EFI_MEDIA_CHANGED)) { > - continue; > - } else if (!MediaPresent) { > - DEBUG ((DEBUG_INFO, "SdMmcHcCardDetect: No device attached in > Slot[%d]!!!\n", Slot)); > - continue; > + if (Private->Slot[Slot].SlotType =3D=3D RemovableSlot) { > + Status =3D SdMmcHcCardDetect (PciIo, Slot, &MediaPresent); > + if (EFI_ERROR (Status) && (Status !=3D EFI_MEDIA_CHANGED)) { > + continue; > + } else if (!MediaPresent) { > + DEBUG (( > + DEBUG_INFO, > + "SdMmcHcCardDetect: No device attached in Slot[%d]!!!\n", > + Slot > + )); > + continue; > + } > } >=20 > Status =3D SdMmcHcInitHost (Private, Slot); > -- > 2.7.4