mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 07:31:45 +00:00
scsi: libsas: Resume SAS host for phy reset or enable via sysfs
Currently if a phy reset or enable phy is issued via sysfs when controller is suspended, those operations will be ignored as SAS_HA_REGISTERED is cleared. If RPM is enabled then we may aggressively suspend automatically. In this case it may be difficult to enable or reset a phy via sysfs, so resume the host in these scenarios. Link: https://lore.kernel.org/r/1657823002-139010-6-git-send-email-john.garry@huawei.com Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
7e15334f5d
commit
1e82e4627a
@ -531,6 +531,7 @@ static int queue_phy_reset(struct sas_phy *phy, int hard_reset)
|
|||||||
if (!d)
|
if (!d)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
pm_runtime_get_sync(ha->dev);
|
||||||
/* libsas workqueue coordinates ata-eh reset with discovery */
|
/* libsas workqueue coordinates ata-eh reset with discovery */
|
||||||
mutex_lock(&d->event_lock);
|
mutex_lock(&d->event_lock);
|
||||||
d->reset_result = 0;
|
d->reset_result = 0;
|
||||||
@ -544,6 +545,7 @@ static int queue_phy_reset(struct sas_phy *phy, int hard_reset)
|
|||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
rc = d->reset_result;
|
rc = d->reset_result;
|
||||||
mutex_unlock(&d->event_lock);
|
mutex_unlock(&d->event_lock);
|
||||||
|
pm_runtime_put_sync(ha->dev);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -558,6 +560,7 @@ static int queue_phy_enable(struct sas_phy *phy, int enable)
|
|||||||
if (!d)
|
if (!d)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
pm_runtime_get_sync(ha->dev);
|
||||||
/* libsas workqueue coordinates ata-eh reset with discovery */
|
/* libsas workqueue coordinates ata-eh reset with discovery */
|
||||||
mutex_lock(&d->event_lock);
|
mutex_lock(&d->event_lock);
|
||||||
d->enable_result = 0;
|
d->enable_result = 0;
|
||||||
@ -571,6 +574,7 @@ static int queue_phy_enable(struct sas_phy *phy, int enable)
|
|||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
rc = d->enable_result;
|
rc = d->enable_result;
|
||||||
mutex_unlock(&d->event_lock);
|
mutex_unlock(&d->event_lock);
|
||||||
|
pm_runtime_put_sync(ha->dev);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user