mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
UPSTREAM: scsi: ufs: Invert the return value of ufshcd_is_hba_active()
It is confusing that ufshcd_is_hba_active() returns 'true' if the HBA is
not active. Clear up this confusion by inverting the return value of
ufshcd_is_hba_active(). This patch does not change any functionality.
Link: https://lore.kernel.org/r/20220419225811.4127248-12-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit acbbfe484f)
Change-Id: I83dadb18f36b9f96846f5224705dc6ef1f780f62
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Bart Van Assche
parent
1a042f80d2
commit
19a799fc71
@@ -929,12 +929,11 @@ static inline void ufshcd_hba_start(struct ufs_hba *hba)
|
||||
* ufshcd_is_hba_active - Get controller state
|
||||
* @hba: per adapter instance
|
||||
*
|
||||
* Returns false if controller is active, true otherwise
|
||||
* Returns true if and only if the controller is active.
|
||||
*/
|
||||
static inline bool ufshcd_is_hba_active(struct ufs_hba *hba)
|
||||
{
|
||||
return (ufshcd_readl(hba, REG_CONTROLLER_ENABLE) & CONTROLLER_ENABLE)
|
||||
? false : true;
|
||||
return ufshcd_readl(hba, REG_CONTROLLER_ENABLE) & CONTROLLER_ENABLE;
|
||||
}
|
||||
|
||||
u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba)
|
||||
@@ -4621,7 +4620,7 @@ static int ufshcd_hba_execute_hce(struct ufs_hba *hba)
|
||||
int retry_inner;
|
||||
|
||||
start:
|
||||
if (!ufshcd_is_hba_active(hba))
|
||||
if (ufshcd_is_hba_active(hba))
|
||||
/* change controller state to "reset state" */
|
||||
ufshcd_hba_stop(hba);
|
||||
|
||||
@@ -4647,7 +4646,7 @@ start:
|
||||
|
||||
/* wait for the host controller to complete initialization */
|
||||
retry_inner = 50;
|
||||
while (ufshcd_is_hba_active(hba)) {
|
||||
while (!ufshcd_is_hba_active(hba)) {
|
||||
if (retry_inner) {
|
||||
retry_inner--;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user