From nobody Sun May 5 18:57:09 2024 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+84795+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+84795+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639464824; cv=none; d=zohomail.com; s=zohoarc; b=mhKhi/vAFLNSed4XUw2nEYFeopbS7TtawG+nfO7ThHXwnyGMIQB+sEpfBXFIIbmung3S086/HW25HSgANtlr7w/2ZCDBQYJWnVHl79pp0unF1jsfuoRPSOrhOkSYSD+pD5OE0SN1WGRW3rCvcfRdyg4SCq2j8lH3804i9f6j8qo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639464824; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=vDdxjndmSXTnxId3XounA1LG3VWWwCMP76FXRUcjL3o=; b=eGcHKjgW6SeNolS8NaHnvDxXcZBtmzCoJq97E8Le6kUmm1QchRQsh5c0ozb0bu8xH8bJPclByOPPrdi8nZXfyUKmA2sVs6v0gb73KoP7ZrscctuhrdJkAf7aCrjeyYPsRDY3bEH1+7WDP+sB5Oj40Z0SMqCKps7l2uctaNLgSwU= 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+84795+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 1639464824171384.772424694978; Mon, 13 Dec 2021 22:53:44 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4FyZYY1788612xxPD9KX1cfd; Mon, 13 Dec 2021 22:53:43 -0800 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.23029.1639464822568551151 for ; Mon, 13 Dec 2021 22:53:43 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="263050812" X-IronPort-AV: E=Sophos;i="5.88,204,1635231600"; d="scan'208";a="263050812" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 22:51:04 -0800 X-IronPort-AV: E=Sophos;i="5.88,204,1635231600"; d="scan'208";a="681938550" X-Received: from kxinfux-win10.gar.corp.intel.com ([10.227.107.41]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 22:51:02 -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] MdeModulePkg: Replace with UfsUnitDesc to fix response timeout problem. Date: Tue, 14 Dec 2021 14:50:14 +0800 Message-Id: <20211214065014.14912-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: YOiz2x76PUO5d7a9L8Ptef0Xx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639464823; bh=BdSm9zIPPZcENma7nKGVObOwklBKIbc49bijXF9Svdc=; h=Cc:Date:From:Reply-To:Subject:To; b=GA4i0hptAWRkHf/BIlx10n/5y+32BZm0SQ7/M3Y9ZPepFHHly3jLIQPwXw5dfdUdiKr LtTpoYRdNqdD6gQK56m1tV4k9I/yGH58AsGNP7W95VUq5rjm9dzJtkFB4/q/z5qHY99BR k4E9lMFQzrHMM3m9nywNEMH+mNQhLu5XRwg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639464824866100001 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 | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c b/MdeModule= Pkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c index b331c0f3e3..3a55348cac 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c @@ -1037,9 +1037,10 @@ 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; + UINT32 UnitDescriptorSize; =20 // // Shadow this PEIM to run from memory @@ -1126,19 +1127,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) { + UnitDescriptorSize =3D sizeof (UFS_UNIT_DESC); + for (Index =3D 0; Index < 8; Index++) { + Status =3D UfsRwDeviceDesc (Private, TRUE, UfsUnitDesc, (UINT8) Inde= x, 0, &UnitDescriptor, UnitDescriptorSize); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to read unit descriptor, index =3D %X= , status =3D %r\n", Index, Status)); + continue; + } + if (UnitDescriptor.LunEn =3D=3D 0x1) { + DEBUG ((DEBUG_INFO, "UFS LUN %X is enabled\n", Index)); Private->Luns.BitMask |=3D (BIT0 << Index); - DEBUG ((DEBUG_INFO, "Ufs %d Lun %d is enabled\n", Controller, Inde= x)); } } =20 --=20 2.18.0.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 (#84795): https://edk2.groups.io/g/devel/message/84795 Mute This Topic: https://groups.io/mt/87716515/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-