The patch is good to me.

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

Best Regards,
Hao Wu

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Cinnamon Shia
> Sent: Monday, June 06, 2016 12:08 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A; el...@hpe.com; Tian, Feng; Zeng, Star
> Subject: [edk2] [PATCH] MdeModulePkg/AtaBusDxe: Fix some ATA hard drives
> cannot be discovered
> 
> If there is no multiplier, the DEV bit of the ATA device register would
> always be set. It causes that some ATA hard drives don't response the
> ATA identity command sent to them.
> 
> Below is the description about DEV bit in ATA spec:
> A device is selected when the DEV bit of the Device register is equal to
> the device number assigned to the device by means of a Device 0/Device 1
> jumper or switch, or use of the CSEL signal.
> 
> Below is the description about DEV bit in SATA spec:
> When the DEV bit in the Device register is set to one, selecting the
> non-existent Device 1, the host adapter shall respond to register reads
> and writes as specified for a Device 0 with no Device 1 present, as
> defined in the ATA/ATAPI-5 standard.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cinnamon Shia <cinnamon.s...@hpe.com>
> ---
>  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> index a3008f9..a3739fc 100644
> --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> @@ -11,6 +11,7 @@
>    Cylinder register.
> 
>    Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
> +  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions of the BSD
> License
>    which accompanies this distribution.  The full text of the license may be 
> found
> at
> @@ -413,7 +414,7 @@ DiscoverAtaDevice (
>    //
>    Acb = ZeroMem (&AtaDevice->Acb, sizeof (EFI_ATA_COMMAND_BLOCK));
>    Acb->AtaCommand = ATA_CMD_IDENTIFY_DRIVE;
> -  Acb->AtaDeviceHead = (UINT8) (BIT7 | BIT6 | BIT5 | (AtaDevice-
> >PortMultiplierPort << 4));
> +  Acb->AtaDeviceHead = (UINT8) (BIT7 | BIT6 | BIT5 | (AtaDevice-
> >PortMultiplierPort == 0xFFFF ? 0 : (AtaDevice->PortMultiplierPort << 4)));
> 
>    //
>    // Prepare for ATA pass through packet.
> --
> 2.8.1.windows.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

Reply via email to