public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Xue, Shengfeng" <xueshengfeng@byosoft.com.cn>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Liang, PanlingX" <panlingx.liang@intel.com>,
	"Xue, ShengfengX" <shengfengx.xue@intel.com>
Subject: Re: [PATCH V4] MdeModulePkg/PciBusDxe: Improve the flow of testing support attributes
Date: Fri, 24 Sep 2021 06:14:04 +0000	[thread overview]
Message-ID: <CY4PR1101MB20726B519277D7C81857D71A8CA49@CY4PR1101MB2072.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1b51d351316704a1af8d38d95adb393aaf7b4565.1632463138.git.xueshengfeng@byosoft.com.cn>

You can only carry "Reviewed-by" when the person replied "Reviewed-by: ...".
Reviewing the patch and providing comments don't mean you get the "Reviewed-by".

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: xueshengfeng <xueshengfeng@byosoft.com.cn>
> Sent: Friday, September 24, 2021 2:03 PM
> To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Wu, Hao A <hao.a.wu@intel.com>
> Cc: Liang, PanlingX <panlingx.liang@intel.com>; Xue, ShengfengX <shengfengx.xue@intel.com>
> Subject: [PATCH V4] MdeModulePkg/PciBusDxe: Improve the flow of testing support attributes
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3635
> 
> Currently, in order to test the supported attributes,
> the PciTestSupportedAttribute() will set the command register
> to 0x27 (EFI_PCI_COMMAND_IO_SPACE, EFI_PCI_COMMAND_MEMORY_SPACE,
> EFI_PCI_COMMAND_BUS_MASTER, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) firstly,
> and then read back to check whether these attributes are
> set successfully in the device.
> This will cause the other enabled bits
>  (other than EFI_PCI_COMMAND_IO_SPACE,EFI_PCI_COMMAND_MEMORY_SPACE,
>  EFI_PCI_COMMAND_BUS_MASTER,EFI_PCI_COMMAND_VGA_PALETTE_SNOOP)
>  be cleared for a short of time
>  This patch fixes this issue by keeping the origina
>  enabled bits when setting 0x27.
> 
> Signed-off-by: xueshengfeng <xueshengfeng@byosoft.com.cn>
> Reviewed-by: Ray <ray.ni@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> index db1b35f8ef..3a238d4e46 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> @@ -933,6 +933,7 @@ PciTestSupportedAttribute (
>    )
>  {
>    EFI_TPL OldTpl;
> +  UINT16  CommandValue;
> 
>    //
>    // Preserve the original value
> @@ -943,10 +944,12 @@ PciTestSupportedAttribute (
>    // Raise TPL to high level to disable timer interrupt while the BAR is probed
>    //
>    OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
> +  CommandValue = *Command | *OldCommand;
> 
> -  PCI_SET_COMMAND_REGISTER (PciIoDevice, *Command);
> -  PCI_READ_COMMAND_REGISTER (PciIoDevice, Command);
> +  PCI_SET_COMMAND_REGISTER (PciIoDevice, CommandValue);
> +  PCI_READ_COMMAND_REGISTER (PciIoDevice, &CommandValue);
> 
> +  *Command = *Command & CommandValue;
>    //
>    // Write back the original value
>    //
> --
> 2.31.1.windows.1
> 
> 
> 


           reply	other threads:[~2021-09-24  6:14 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1b51d351316704a1af8d38d95adb393aaf7b4565.1632463138.git.xueshengfeng@byosoft.com.cn>]

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=CY4PR1101MB20726B519277D7C81857D71A8CA49@CY4PR1101MB2072.namprd11.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