Re: [PATCH v2] scsi: ufs: core: Add ufshcd_send_bsg_uic_cmd() for UFS BSG
From: Bean Huo
Date: Wed Nov 13 2024 - 13:21:37 EST
On Wed, 2024-11-13 at 19:14 +0800, Ziqi Chen wrote:
> User layer applications can send UIC GET/SET commands via the BSG
> framework, and if the user layer application sends a UIC SET command
> to the PA_PWRMODE attribute, a power mode change shall be initiated
> in UniPro and two interrupts shall be triggered if the power mode is
> successfully changed, i.e., UIC Command Completion interrupt and UIC
> Power Mode interrupt.
>
> The current UFS BSG code calls ufshcd_send_uic_cmd() directly, with
> which the second interrupt, i.e., UIC Power Mode interrupt, shall be
> treated as unhandled interrupt. In addition, after the UIC command is
> completed, user layer application has to poll UniPro and/or M-PHY
> state
> machine to confirm the power mode change is finished.
>
> Add a new wrapper function ufshcd_send_bsg_uic_cmd() and call it from
> ufs_bsg_request() so that if a UIC SET command is targeting the
> PA_PWRMODE
> attribute it can be redirected to ufshcd_uic_pwr_ctrl().
>
> Signed-off-by: Can Guo <quic_cang@xxxxxxxxxxx>
> Signed-off-by: Ziqi Chen <quic_ziqichen@xxxxxxxxxxx>
Mabye this should be a bug fix.
Reviewed-by: Bean Huo <beanhuo@xxxxxxxxxx>