[edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Always do S.M.A.R.T. check if device support

gaoliming posted 1 patch 2 years, 4 months ago
Failed in applying to current master (apply log)
.../Bus/Ata/AtaAtapiPassThru/AhciMode.c       | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
[edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Always do S.M.A.R.T. check if device support
Posted by gaoliming 2 years, 4 months ago
If S.M.A.R.T. has been enabled, it can be checked.

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
---
 .../Bus/Ata/AtaAtapiPassThru/AhciMode.c       | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
index 1053695b3b..a2831de65c 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
@@ -1833,18 +1833,17 @@ AhciAtaSmartSupport (
                    ATA_ATAPI_TIMEOUT,
                    NULL
                    );
-
-        if (!EFI_ERROR (Status)) {
-          Status = AhciAtaSmartReturnStatusCheck (
-                     PciIo,
-                     AhciRegisters,
-                     (UINT8)Port,
-                     (UINT8)PortMultiplier,
-                     AtaStatusBlock
-                     );
-        }
       }
     }
+
+    AhciAtaSmartReturnStatusCheck (
+      PciIo,
+      AhciRegisters,
+      (UINT8)Port,
+      (UINT8)PortMultiplier,
+      AtaStatusBlock
+      );
+    
     DEBUG ((EFI_D_INFO, "Enabled S.M.A.R.T feature at port [%d] PortMultiplier [%d]!\n",
             Port, PortMultiplier));
   }
-- 
2.27.0.windows.1




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82967): https://edk2.groups.io/g/devel/message/82967
Mute This Topic: https://groups.io/mt/86735618/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Always do S.M.A.R.T. check if device support
Posted by Wu, Hao A 2 years, 4 months ago
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> gaoliming
> Sent: Monday, November 1, 2021 5:46 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Always do
> S.M.A.R.T. check if device support
> 
> If S.M.A.R.T. has been enabled, it can be checked.


A minor comment. I think the log message can be refined a little bit to:
If S.M.A.R.T. is supported, it can be checked.

The code change looks good to me:
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> 
> Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>  .../Bus/Ata/AtaAtapiPassThru/AhciMode.c       | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> index 1053695b3b..a2831de65c 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> @@ -1833,18 +1833,17 @@ AhciAtaSmartSupport (
>                     ATA_ATAPI_TIMEOUT,
>                     NULL
>                     );
> -
> -        if (!EFI_ERROR (Status)) {
> -          Status = AhciAtaSmartReturnStatusCheck (
> -                     PciIo,
> -                     AhciRegisters,
> -                     (UINT8)Port,
> -                     (UINT8)PortMultiplier,
> -                     AtaStatusBlock
> -                     );
> -        }
>        }
>      }
> +
> +    AhciAtaSmartReturnStatusCheck (
> +      PciIo,
> +      AhciRegisters,
> +      (UINT8)Port,
> +      (UINT8)PortMultiplier,
> +      AtaStatusBlock
> +      );
> +
>      DEBUG ((EFI_D_INFO, "Enabled S.M.A.R.T feature at port [%d]
> PortMultiplier [%d]!\n",
>              Port, PortMultiplier));
>    }
> --
> 2.27.0.windows.1
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83087): https://edk2.groups.io/g/devel/message/83087
Mute This Topic: https://groups.io/mt/86735618/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Always do S.M.A.R.T. check if device support
Posted by gaoliming 2 years, 4 months ago
Hao: 
  Thanks for your comment. I will update the commit log. 

Thanks
Liming
> -----邮件原件-----
> 发件人: Wu, Hao A <hao.a.wu@intel.com>
> 发送时间: 2021年11月2日 11:17
> 收件人: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> 抄送: Ni, Ray <ray.ni@intel.com>
> 主题: RE: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Always do
> S.M.A.R.T. check if device support
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > gaoliming
> > Sent: Monday, November 1, 2021 5:46 PM
> > To: devel@edk2.groups.io
> > Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>
> > Subject: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Always do
> > S.M.A.R.T. check if device support
> >
> > If S.M.A.R.T. has been enabled, it can be checked.
> 
> 
> A minor comment. I think the log message can be refined a little bit to:
> If S.M.A.R.T. is supported, it can be checked.
> 
> The code change looks good to me:
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > ---
> >  .../Bus/Ata/AtaAtapiPassThru/AhciMode.c       | 19
> +++++++++----------
> >  1 file changed, 9 insertions(+), 10 deletions(-)
> >
> > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > index 1053695b3b..a2831de65c 100644
> > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > @@ -1833,18 +1833,17 @@ AhciAtaSmartSupport (
> >                     ATA_ATAPI_TIMEOUT,
> >                     NULL
> >                     );
> > -
> > -        if (!EFI_ERROR (Status)) {
> > -          Status = AhciAtaSmartReturnStatusCheck (
> > -                     PciIo,
> > -                     AhciRegisters,
> > -                     (UINT8)Port,
> > -                     (UINT8)PortMultiplier,
> > -                     AtaStatusBlock
> > -                     );
> > -        }
> >        }
> >      }
> > +
> > +    AhciAtaSmartReturnStatusCheck (
> > +      PciIo,
> > +      AhciRegisters,
> > +      (UINT8)Port,
> > +      (UINT8)PortMultiplier,
> > +      AtaStatusBlock
> > +      );
> > +
> >      DEBUG ((EFI_D_INFO, "Enabled S.M.A.R.T feature at port [%d]
> > PortMultiplier [%d]!\n",
> >              Port, PortMultiplier));
> >    }
> > --
> > 2.27.0.windows.1
> >
> >
> >
> >
> > 
> >





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83316): https://edk2.groups.io/g/devel/message/83316
Mute This Topic: https://groups.io/mt/86810220/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-