From: "Paul" <paul.grimes@amd.com>
To: Laszlo Ersek <lersek@redhat.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Zhiguang Liu <zhiguang.liu@intel.com>,
"Grimes, Paul" <Paul.Grimes@amd.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] MdePkg: Correcting EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT definition
Date: Fri, 28 Aug 2020 18:39:35 +0000 [thread overview]
Message-ID: <BYAPR12MB31595C89A0036D7AD9A6555DFC520@BYAPR12MB3159.namprd12.prod.outlook.com> (raw)
In-Reply-To: <12ee54f0-976f-239c-81c7-3c6e71cc8892@redhat.com>
[AMD Public Use]
Thanks for the feedback, Lazlo. I agree with your point on the optimal format for these #defines. I think it would be best to submit the current patch as is given that the same feedback could (should?) be applied to various other #defines in the file,
eg:
EFI_ACPI_DMA_BUS_MASTER_MASK 0x04, which only applies to Bit 2 and
EFI_ACPI_IRQ_POLARITY_MASK 0x08, ... Bit 3 and
EFI_ACPI_IRQ_MODE 0x01, ... bit 0
IMO if these defines were to be updated for clarity, it should probably be done for the whole file in a separate commit.
Thanks,
Paul
-----Original Message-----
From: Laszlo Ersek <lersek@redhat.com>
Sent: Friday, August 28, 2020 10:06 AM
To: devel@edk2.groups.io; Grimes, Paul <Paul.Grimes@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] MdePkg: Correcting EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT definition
[CAUTION: External Email]
On 08/27/20 22:40, Paul wrote:
> In Acpi10.h, EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT is defined as 0x10, but
> should be 0x02 per the ACPI Specification.
>
> REF:https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> bugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2937&data=02%7C01%7Cp
> aul.grimes%40amd.com%7C82b28bb6544a4612fc1108d84b749dc6%7C3dd8961fe488
> 4e608e11a82d994e183d%7C0%7C0%7C637342311528396385&sdata=7vHYIHHaJU
> 4yrXzAWtv5xTf%2BQfclAUBusz278%2F6I%2BRY%3D&reserved=0
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Signed-off-by: Paul G <paul.grimes@amd.com>
> ---
> MdePkg/Include/IndustryStandard/Acpi10.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdePkg/Include/IndustryStandard/Acpi10.h
> b/MdePkg/Include/IndustryStandard/Acpi10.h
> index fa06eefbb6e6..adeb5ae8c219 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi10.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi10.h
> @@ -358,7 +358,7 @@ typedef struct {
> #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
>
> #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
>
> #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
>
> -#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10
>
> +#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x02
>
>
>
> //
>
> // IO Information
>
Good catch. The ACPI spec text was likely cut n' pasted into the edk2 source, and then prefixed with "0x". The spec says,
"""
Bits [1:0] DMA transfer type preference, _SIZ
00 8-bit only
01 8- and 16-bit
10 16-bit only
11 Reserved
"""
but that's in binary, not in hexadecimal.
In fact, the leading zero on *all four* macros (including
EFI_ACPI_DMA_TRANSFER_TYPE_MASK) is misleading. In hex, the leading zero in the current macros stands for bits [7:4], which are completely irrelevant for the _SIZ bit-field in the DMA Descriptor. So optimally we'd have
#define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x3
#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x0
#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x1
#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x2
But I agree the current patch is OK too:
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
I also agree it's a bugfix and should be merged now.
Thanks
Laszlo
next prev parent reply other threads:[~2020-08-28 18:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-27 20:40 [PATCH v1 0/1] Fix for define error in Acpi10.h paul.grimes
2020-08-27 20:40 ` [PATCH v1 1/1] MdePkg: Correcting EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT definition Paul
2020-08-28 0:57 ` 回复: [edk2-devel] " gaoliming
2020-08-28 1:50 ` Andrew Fish
2020-08-28 19:09 ` Paul
2020-08-28 19:23 ` Paul
2020-08-30 1:37 ` 回复: " gaoliming
2020-08-28 1:26 ` Zhiguang Liu
2020-08-28 17:05 ` [edk2-devel] " Laszlo Ersek
2020-08-28 18:39 ` Paul [this message]
2020-08-30 1:02 ` 回复: " gaoliming
2020-08-31 8:22 ` Laszlo Ersek
2020-09-02 8:58 ` Laszlo Ersek
2020-09-02 15:12 ` Paul
2020-09-07 13:58 ` Philippe Mathieu-Daudé
2020-09-08 8:10 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BYAPR12MB31595C89A0036D7AD9A6555DFC520@BYAPR12MB3159.namprd12.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox