[edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect

Giri Mudusuru via groups.io posted 1 patch 12 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect
Posted by Giri Mudusuru via groups.io 12 months ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4394

Fix DumpCapabilityReg() debug log to print 64 bit capability instead of 32 bit pointer

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Andrew Fish <afish@apple.com>
Signed-off-by: Giri Mudusuru <girim@apple.com>
---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index aab6815328..2e7497a89d 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -30,7 +30,7 @@ DumpCapabilityReg (
   //
   // Dump Capability Data
   //
-  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%x ==\n", Slot, Capability));
+  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%llx ==\n", Slot, *(UINT64 *)Capability));
   DEBUG ((DEBUG_INFO, "   Timeout Clk Freq  %d%a\n", Capability->TimeoutFreq, (Capability->TimeoutUnit) ? "MHz" : "KHz"));
   DEBUG ((DEBUG_INFO, "   Base Clk Freq     %dMHz\n", Capability->BaseClkFreq));
   DEBUG ((DEBUG_INFO, "   Max Blk Len       %dbytes\n", 512 * (1 << Capability->MaxBlkLen)));
-- 
2.39.2 (Apple Git-144)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104785): https://edk2.groups.io/g/devel/message/104785
Mute This Topic: https://groups.io/mt/98846217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect
Posted by Wu, Hao A 11 months, 3 weeks ago
Thanks for the patch, inline comment below:


> -----Original Message-----
> From: Giri Mudusuru <girim@apple.com>
> Sent: Friday, May 12, 2023 5:55 PM
> To: devel@edk2.groups.io
> Cc: Giri Mudusuru <girim@apple.com>; Wu, Hao A <hao.a.wu@intel.com>; Ni,
> Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Andrew Fish <afish@apple.com>
> Subject: [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug
> print is incorrect
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4394
> 
> Fix DumpCapabilityReg() debug log to print 64 bit capability instead of 32 bit
> pointer
> 
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Andrew Fish <afish@apple.com>
> Signed-off-by: Giri Mudusuru <girim@apple.com>
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> index aab6815328..2e7497a89d 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> @@ -30,7 +30,7 @@ DumpCapabilityReg (
>    //
> 
>    // Dump Capability Data
> 
>    //
> 
> -  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%x ==\n", Slot,
> Capability));
> 
> +  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%llx ==\n", Slot,
> *(UINT64 *)Capability));


Please help to use %p for printing pointers.

Best Regards,
Hao Wu


> 
>    DEBUG ((DEBUG_INFO, "   Timeout Clk Freq  %d%a\n", Capability-
> >TimeoutFreq, (Capability->TimeoutUnit) ? "MHz" : "KHz"));
> 
>    DEBUG ((DEBUG_INFO, "   Base Clk Freq     %dMHz\n", Capability-
> >BaseClkFreq));
> 
>    DEBUG ((DEBUG_INFO, "   Max Blk Len       %dbytes\n", 512 * (1 <<
> Capability->MaxBlkLen)));
> 
> --
> 2.39.2 (Apple Git-144)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104959): https://edk2.groups.io/g/devel/message/104959
Mute This Topic: https://groups.io/mt/98846217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect
Posted by Giri Mudusuru via groups.io 11 months, 3 weeks ago
> Please help to use %p for printing pointers.
Thanks for approvals. To clarify the value is 64-bit capability register value.

Thanks,
-Giri

> On May 17, 2023, at 9:49 AM, Wu, Hao A <hao.a.wu@intel.com> wrote:
> 
> Thanks for the patch, inline comment below:
> 
> 
>> -----Original Message-----
>> From: Giri Mudusuru <girim@apple.com>
>> Sent: Friday, May 12, 2023 5:55 PM
>> To: devel@edk2.groups.io
>> Cc: Giri Mudusuru <girim@apple.com>; Wu, Hao A <hao.a.wu@intel.com>; Ni,
>> Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
>> <gaoliming@byosoft.com.cn>; Andrew Fish <afish@apple.com>
>> Subject: [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug
>> print is incorrect
>> 
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4394
>> 
>> Fix DumpCapabilityReg() debug log to print 64 bit capability instead of 32 bit
>> pointer
>> 
>> Cc: Hao A Wu <hao.a.wu@intel.com>
>> Cc: Ray Ni <ray.ni@intel.com>
>> Cc: Jian J Wang <jian.j.wang@intel.com>
>> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>> Cc: Andrew Fish <afish@apple.com>
>> Signed-off-by: Giri Mudusuru <girim@apple.com>
>> ---
>> MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
>> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
>> index aab6815328..2e7497a89d 100644
>> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
>> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
>> @@ -30,7 +30,7 @@ DumpCapabilityReg (
>>   //
>> 
>>   // Dump Capability Data
>> 
>>   //
>> 
>> -  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%x ==\n", Slot,
>> Capability));
>> 
>> +  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%llx ==\n", Slot,
>> *(UINT64 *)Capability));
> 
> 
> Please help to use %p for printing pointers.
> 
> Best Regards,
> Hao Wu
> 
> 
>> 
>>   DEBUG ((DEBUG_INFO, "   Timeout Clk Freq  %d%a\n", Capability-
>>> TimeoutFreq, (Capability->TimeoutUnit) ? "MHz" : "KHz"));
>> 
>>   DEBUG ((DEBUG_INFO, "   Base Clk Freq     %dMHz\n", Capability-
>>> BaseClkFreq));
>> 
>>   DEBUG ((DEBUG_INFO, "   Max Blk Len       %dbytes\n", 512 * (1 <<
>> Capability->MaxBlkLen)));
>> 
>> --
>> 2.39.2 (Apple Git-144)
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104983): https://edk2.groups.io/g/devel/message/104983
Mute This Topic: https://groups.io/mt/98846217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect
Posted by Wu, Hao A 11 months, 1 week ago
Merged via:
PR - https://github.com/tianocore/edk2/pull/4439
Commit - https://github.com/tianocore/edk2/commit/e1f5c6249af08c1df2c6257e4bb6abbf6134318c

Best Regards,
Hao Wu

> -----Original Message-----
> From: Giri Mudusuru <girim@apple.com>
> Sent: Thursday, May 18, 2023 2:01 AM
> To: Wu, Hao A <hao.a.wu@intel.com>
> Cc: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>;
> Andrew Fish <afish@apple.com>; Giri Mudusuru <girim@apple.com>
> Subject: Re: [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability
> debug print is incorrect
> 
> > Please help to use %p for printing pointers.
> Thanks for approvals. To clarify the value is 64-bit capability register value.
> 
> Thanks,
> -Giri
> 
> > On May 17, 2023, at 9:49 AM, Wu, Hao A <hao.a.wu@intel.com> wrote:
> >
> > Thanks for the patch, inline comment below:
> >
> >
> >> -----Original Message-----
> >> From: Giri Mudusuru <girim@apple.com>
> >> Sent: Friday, May 12, 2023 5:55 PM
> >> To: devel@edk2.groups.io
> >> Cc: Giri Mudusuru <girim@apple.com>; Wu, Hao A
> <hao.a.wu@intel.com>;
> >> Ni, Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>;
> >> Gao, Liming <gaoliming@byosoft.com.cn>; Andrew Fish
> <afish@apple.com>
> >> Subject: [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability
> debug
> >> print is incorrect
> >>
> >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4394
> >>
> >> Fix DumpCapabilityReg() debug log to print 64 bit capability instead
> >> of 32 bit pointer
> >>
> >> Cc: Hao A Wu <hao.a.wu@intel.com>
> >> Cc: Ray Ni <ray.ni@intel.com>
> >> Cc: Jian J Wang <jian.j.wang@intel.com>
> >> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> >> Cc: Andrew Fish <afish@apple.com>
> >> Signed-off-by: Giri Mudusuru <girim@apple.com>
> >> ---
> >> MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> >> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> >> index aab6815328..2e7497a89d 100644
> >> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> >> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> >> @@ -30,7 +30,7 @@ DumpCapabilityReg (
> >>   //
> >>
> >>   // Dump Capability Data
> >>
> >>   //
> >>
> >> -  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%x ==\n", Slot,
> >> Capability));
> >>
> >> +  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%llx ==\n",
> >> + Slot,
> >> *(UINT64 *)Capability));
> >
> >
> > Please help to use %p for printing pointers.
> >
> > Best Regards,
> > Hao Wu
> >
> >
> >>
> >>   DEBUG ((DEBUG_INFO, "   Timeout Clk Freq  %d%a\n", Capability-
> >>> TimeoutFreq, (Capability->TimeoutUnit) ? "MHz" : "KHz"));
> >>
> >>   DEBUG ((DEBUG_INFO, "   Base Clk Freq     %dMHz\n", Capability-
> >>> BaseClkFreq));
> >>
> >>   DEBUG ((DEBUG_INFO, "   Max Blk Len       %dbytes\n", 512 * (1 <<
> >> Capability->MaxBlkLen)));
> >>
> >> --
> >> 2.39.2 (Apple Git-144)
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105357): https://edk2.groups.io/g/devel/message/105357
Mute This Topic: https://groups.io/mt/98846217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect
Posted by Ard Biesheuvel 11 months, 3 weeks ago
On Wed, 17 May 2023 at 06:19, Wu, Hao A <hao.a.wu@intel.com> wrote:
>
> Thanks for the patch, inline comment below:
>
>
> > -----Original Message-----
> > From: Giri Mudusuru <girim@apple.com>
> > Sent: Friday, May 12, 2023 5:55 PM
> > To: devel@edk2.groups.io
> > Cc: Giri Mudusuru <girim@apple.com>; Wu, Hao A <hao.a.wu@intel.com>; Ni,
> > Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> > <gaoliming@byosoft.com.cn>; Andrew Fish <afish@apple.com>
> > Subject: [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug
> > print is incorrect
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4394
> >
> > Fix DumpCapabilityReg() debug log to print 64 bit capability instead of 32 bit
> > pointer
> >
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Andrew Fish <afish@apple.com>
> > Signed-off-by: Giri Mudusuru <girim@apple.com>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

> > ---
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > index aab6815328..2e7497a89d 100644
> > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > @@ -30,7 +30,7 @@ DumpCapabilityReg (
> >    //
> >
> >    // Dump Capability Data
> >
> >    //
> >
> > -  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%x ==\n", Slot,
> > Capability));
> >
> > +  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%llx ==\n", Slot,
> > *(UINT64 *)Capability));
>
>
> Please help to use %p for printing pointers.
>

Why? The point of this patch is that we are not interested in the
pointer, only in the value that it points to.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104973): https://edk2.groups.io/g/devel/message/104973
Mute This Topic: https://groups.io/mt/98846217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect
Posted by Wu, Hao A 11 months, 3 weeks ago
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ard
> Biesheuvel
> Sent: Wednesday, May 17, 2023 7:46 PM
> To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@intel.com>
> Cc: Giri Mudusuru <girim@apple.com>; Ni, Ray <ray.ni@intel.com>; Wang,
> Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>;
> Andrew Fish <afish@apple.com>
> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC
> capability debug print is incorrect
> 
> On Wed, 17 May 2023 at 06:19, Wu, Hao A <hao.a.wu@intel.com> wrote:
> >
> > Thanks for the patch, inline comment below:
> >
> >
> > > -----Original Message-----
> > > From: Giri Mudusuru <girim@apple.com>
> > > Sent: Friday, May 12, 2023 5:55 PM
> > > To: devel@edk2.groups.io
> > > Cc: Giri Mudusuru <girim@apple.com>; Wu, Hao A
> <hao.a.wu@intel.com>;
> > > Ni, Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>;
> > > Gao, Liming <gaoliming@byosoft.com.cn>; Andrew Fish
> > > <afish@apple.com>
> > > Subject: [PATCH] MdeModulePkg SdMmcPciHcDxe: SD/MMC capability
> debug
> > > print is incorrect
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4394
> > >
> > > Fix DumpCapabilityReg() debug log to print 64 bit capability instead
> > > of 32 bit pointer
> > >
> > > Cc: Hao A Wu <hao.a.wu@intel.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > Cc: Jian J Wang <jian.j.wang@intel.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Andrew Fish <afish@apple.com>
> > > Signed-off-by: Giri Mudusuru <girim@apple.com>
> 
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
> 
> > > ---
> > >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > index aab6815328..2e7497a89d 100644
> > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > @@ -30,7 +30,7 @@ DumpCapabilityReg (
> > >    //
> > >
> > >    // Dump Capability Data
> > >
> > >    //
> > >
> > > -  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%x ==\n",
> > > Slot, Capability));
> > >
> > > +  DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%llx ==\n",
> > > + Slot,
> > > *(UINT64 *)Capability));
> >
> >
> > Please help to use %p for printing pointers.
> >
> 
> Why? The point of this patch is that we are not interested in the pointer, only
> in the value that it points to.


Thanks.
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104974): https://edk2.groups.io/g/devel/message/104974
Mute This Topic: https://groups.io/mt/98846217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-