Re: [edk2] [PATCH 2/2] MdeModulePkg: Check D2H register status in AhciPioTransfer

Subject: Re: [edk2] [PATCH 2/2] MdeModulePkg: Check D2H register status in AhciPioTransfer

From: "A. Sava" <asava.dev@gmail.com>

To: edk2-devel@lists.sourceforge.net

Date: 2014-08-13 18:02:28

Hi Feng,

Sounds like situation with Marvell is similar to Qemu.

As I wrote earlier in this thread, Qemu also doesn't use PIO Setup FIS, it puts only D2H FIS at the end of a PIO command. That's why Reza checked if there are other controllers that behave similarly, and he found that Marvell would be one.

So, for both of them, it means that your patch will not break out at all, as it will never get to check:
if (PrdCount == DataCount) { .. }

Cheers,
A. Sava


On Wed, Aug 13, 2014 at 4:04 AM, Tian, Feng <feng.tian@intel.com> wrote:
Hi, Reza

Thanks for your effort, Reza. I made a little coding style enhancement based on your proposed patch. please help view it.

PS: I am a little curious on "some Marvel controllers use D2H only instead of PIO Setup FIS". If it's that case, does it mean current logic will never break out the loop? Do we need enhance code to handle this?

Thanks
Feng

-----Original Message-----
From: Reza Jelveh [mailto:reza.jelveh@tuhh.de]
Sent: Tuesday, August 12, 2014 19:10
To: Tian, Feng
Cc: edk2-devel@lists.sourceforge.net; agraf@suse.de
Subject: Re: [edk2] [PATCH 2/2] MdeModulePkg: Check D2H register status in AhciPioTransfer

On 11/08/14 01:07, Tian, Feng wrote:
> Hi, Reza
>
> IMHO, it should jump out the loop at the below point if we put break statement inside the new if.
>
> PrdCount = *(volatile UINT32 *) (&(AhciRegisters->AhciCmdList[0].AhciCmdPrdbc));
> if (PrdCount == DataCount) {
> break;
> }
>
> As I have no the test env, could you help me verify if it's true?

I see what you mean now. Yes, this works fine, I also found out that apparently some Marvel controllers use D2H only instead of PIO Setup FIS.
Intel controllers don't have that problem.

I have adjusted the patch according to your suggestion.

------------------------------------------------------------------------------

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel