From nobody Sat Feb 7 09:03:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85157+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85157+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1640155811; cv=none; d=zohomail.com; s=zohoarc; b=W/4mwm0cbbxSd0bEaj48hoQpfgBvnAXj22cVfPMCoiocY5eAmV6IWVyobCL/Vo8Fw+8RgMgdnBK1b4b/gX+GgBXRTGiLQuaJ4it1DduBNK8rFkKmDoutXA5wFZm6UjBPsjpdjbjM6Trz2dO0yfekc3+nleJBmVUfRS0MI7OW1LE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640155811; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=xv/oOjWZmFWqm4XNT5P1UgL6KhX/tJ0E7RMs6oy/o3k=; b=Pk7dUNpw5OoUNuFqL0g02OwYYrUg3aouXHp0VO0n1K9UozI6aOTxs2p02nufnD8VQMP7KAWUtqL34yyhle23lOEGvwspqiKUfFCG3ZAsU+fbONGuZxCX+1iAN2CDj/Uk3uLHHUnF/PzlTcsdPPevG0i8/go7SH0PgstlE8Vo1go= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85157+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 164015581109537.771304566771164; Tue, 21 Dec 2021 22:50:11 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id xfGyYY1788612xw5wCRBv9H3; Tue, 21 Dec 2021 22:50:10 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web09.16425.1640155809359774372 for ; Tue, 21 Dec 2021 22:50:10 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10205"; a="240511716" X-IronPort-AV: E=Sophos;i="5.88,225,1635231600"; d="scan'208";a="240511716" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2021 22:50:08 -0800 X-IronPort-AV: E=Sophos;i="5.88,225,1635231600"; d="scan'208";a="664181882" X-Received: from kxinfux-mobl2.gar.corp.intel.com ([10.213.42.103]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2021 22:50:06 -0800 From: "VincentX Ke" To: devel@edk2.groups.io Cc: VincentX Ke , Hao A Wu , Ray Ni , Ian Chiu , Maggie Chu Subject: [edk2-devel] [PATCH v5 1/3] MdeModulePkg: Replace with UFS_UNIT_DESC to fix timeout problem Date: Wed, 22 Dec 2021 14:48:17 +0800 Message-Id: <20211222064819.1827-2-vincentx.ke@intel.com> In-Reply-To: <20211222064819.1827-1-vincentx.ke@intel.com> References: <20211222064819.1827-1-vincentx.ke@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,vincentx.ke@intel.com X-Gm-Message-State: BCOutUOCqJi1INgpuCJJiUUVx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1640155810; bh=csE8lNoH7V0XmpGVDhWX33/bLh+S3sdbUas7sNaJdqg=; h=Cc:Date:From:Reply-To:Subject:To; b=afLitwU/Vc0VCB2fnXw2Gzr9vAWZM4YYaxa79dDOWOt1iElz41bAA5iY/oCW6xgFX0S 0fYw1jaHFM1Pk7fXJCbKck8F7TMtl7FZDO05mYUQLPrbIGaMU/eoSS/BQkTLATNv6Oz7W 9qTWli3OiM1xkkW0bdIkZha5eBAlcSxBiJo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1640155813173100002 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3714 Replace with UFS_UNIT_DESC to fix response timeout problem. Cc: Hao A Wu Cc: Ray Ni Cc: Ian Chiu Cc: Maggie Chu Signed-off-by: VincentX Ke --- .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c b/MdeModule= Pkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c index b331c0f3e3..b8651ff998 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -1037,9 +1037,9 @@ InitializeUfsBlockIoPeim ( UFS_PEIM_HC_PRIVATE_DATA *Private; EDKII_UFS_HOST_CONTROLLER_PPI *UfsHcPpi; UINT32 Index; - UFS_CONFIG_DESC Config; UINTN MmioBase; UINT8 Controller; + UFS_UNIT_DESC UnitDescriptor; =20 // // Shadow this PEIM to run from memory @@ -1126,19 +1126,18 @@ InitializeUfsBlockIoPeim ( } =20 // - // Get Ufs Device's Lun Info by reading Configuration Descriptor. + // Check if 8 common luns are active and set corresponding bit mask. // - Status =3D UfsRwDeviceDesc (Private, TRUE, UfsConfigDesc, 0, 0, &Confi= g, sizeof (UFS_CONFIG_DESC)); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Ufs Get Configuration Descriptor Error, Status= =3D %r\n", Status)); - Controller++; - continue; - } - for (Index =3D 0; Index < UFS_PEIM_MAX_LUNS; Index++) { - if (Config.UnitDescConfParams[Index].LunEn !=3D 0) { - Private->Luns.BitMask |=3D (BIT0 << Index); + Status =3D UfsRwDeviceDesc (Private, TRUE, UfsUnitDesc, (UINT8)Index= , 0, &UnitDescriptor, sizeof (UFS_UNIT_DESC)); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Fail to read UFS Unit Descriptor, Index =3D = %X, Status =3D %r\n", Index, Status)); + continue; + } + + if (UnitDescriptor.LunEn =3D=3D 0x1) { DEBUG ((DEBUG_INFO, "Ufs %d Lun %d is enabled\n", Controller, Inde= x)); + Private->Luns.BitMask |=3D (BIT0 << Index); } } =20 --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85157): https://edk2.groups.io/g/devel/message/85157 Mute This Topic: https://groups.io/mt/87893937/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-