• Subject: [edk2] [PATCH v2] EmbeddedPkg/MmcDxe: Add alignment for ECSD data
  • Author: Jun Nie
  • Date: June 12, 2017, 1:59 a.m.
  • Patches: 1 / 1
Changeset
EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 +
1 file changed, 1 insertion(+)
Git apply log
Switched to a new branch '1497232768-8993-1-git-send-email-jun.nie@linaro.org'
Applying: EmbeddedPkg/MmcDxe: Add alignment for ECSD data
Using index info to reconstruct a base tree...
error: patch failed: EmbeddedPkg/Universal/MmcDxe/Mmc.h:319
error: EmbeddedPkg/Universal/MmcDxe/Mmc.h: patch does not apply
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.
Patch failed at 0001 EmbeddedPkg/MmcDxe: Add alignment for ECSD data
The copy of the patch that failed is found in:
   /var/tmp/tmpfj2lm8dj/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Failed to apply patch:
[edk2] [PATCH v2] EmbeddedPkg/MmcDxe: Add alignment for ECSD data
[edk2] [PATCH v2] EmbeddedPkg/MmcDxe: Add alignment for ECSD data
Posted by Jun Nie, 5 weeks ago
Add alignment for ECSD data for DMA access. Otherwise
the data is corrupted on Sanechips platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
index 8a7d5a3..6e3ab17 100644
--- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h
+++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
@@ -319,6 +319,7 @@ typedef struct  {
   OCR       OCRData;
   CID       CIDData;
   CSD       CSDData;
+  UINT64    Pad;                              // For 8 bytes alignment of ECSDData
   ECSD      ECSDData;                         // MMC V4 extended card specific
 } CARD_INFO;
 
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] EmbeddedPkg/MmcDxe: Add alignment for ECSD data
Posted by Leif Lindholm, 5 weeks ago
On Mon, Jun 12, 2017 at 09:59:28AM +0800, Jun Nie wrote:
> Add alignment for ECSD data for DMA access. Otherwise
> the data is corrupted on Sanechips platform.

I never did see a reply to my proposed solution, and the below is not
it. Can you explain why you prefer this one?

/
    Leif

> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
> index 8a7d5a3..6e3ab17 100644
> --- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h
> +++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
> @@ -319,6 +319,7 @@ typedef struct  {
>    OCR       OCRData;
>    CID       CIDData;
>    CSD       CSDData;
> +  UINT64    Pad;                              // For 8 bytes alignment of ECSDData
>    ECSD      ECSDData;                         // MMC V4 extended card specific
>  } CARD_INFO;
>  
> -- 
> 1.9.1
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] EmbeddedPkg/MmcDxe: Add alignment for ECSD data
Posted by Andrew Fish, 5 weeks ago
> On Jun 12, 2017, at 8:53 AM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> 
> On Mon, Jun 12, 2017 at 09:59:28AM +0800, Jun Nie wrote:
>> Add alignment for ECSD data for DMA access. Otherwise
>> the data is corrupted on Sanechips platform.
> 
> I never did see a reply to my proposed solution, and the below is not
> it. Can you explain why you prefer this one?
> 

And it is still exposed to enum optimization changing the alignment of the structure. 

Thanks,

Andrew Fish

> /
>    Leif
> 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Jun Nie <jun.nie@linaro.org>
>> ---
>> EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
>> index 8a7d5a3..6e3ab17 100644
>> --- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h
>> +++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
>> @@ -319,6 +319,7 @@ typedef struct  {
>>   OCR       OCRData;
>>   CID       CIDData;
>>   CSD       CSDData;
>> +  UINT64    Pad;                              // For 8 bytes alignment of ECSDData
>>   ECSD      ECSDData;                         // MMC V4 extended card specific
>> } CARD_INFO;
>> 
>> -- 
>> 1.9.1
>> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] EmbeddedPkg/MmcDxe: Add alignment for ECSD data
Posted by Jun Nie, 5 weeks ago
2017-06-12 23:53 GMT+08:00 Leif Lindholm <leif.lindholm@linaro.org>:
> On Mon, Jun 12, 2017 at 09:59:28AM +0800, Jun Nie wrote:
>> Add alignment for ECSD data for DMA access. Otherwise
>> the data is corrupted on Sanechips platform.
>
> I never did see a reply to my proposed solution, and the below is not
> it. Can you explain why you prefer this one?
>
> /
>     Leif

Sorry, just see your email because that thread is not highlighted for
new email in gmail for unknown reason.
I have concern that "UINT64 VENDOR_SPECIFIC_FIELD[8]" cannot secure
the ECSD alignment because it is not the first member. Changing the
first member to "UINT64 RESERVED_1[2]" shall secure the alignment. But
I preferred Pad method. It is more readable if all ECSD member are
UINT8 type. It is also more clear to add alignment info in CARD_INFO,
just before ECSD member.
I do not get point of Andrew, maybe he share the same concern.

Jun

>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Jun Nie <jun.nie@linaro.org>
>> ---
>>  EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
>> index 8a7d5a3..6e3ab17 100644
>> --- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h
>> +++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
>> @@ -319,6 +319,7 @@ typedef struct  {
>>    OCR       OCRData;
>>    CID       CIDData;
>>    CSD       CSDData;
>> +  UINT64    Pad;                              // For 8 bytes alignment of ECSDData
>>    ECSD      ECSDData;                         // MMC V4 extended card specific
>>  } CARD_INFO;
>>
>> --
>> 1.9.1
>>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel