Commit 69f5eb7
scsi: ufs: core: Move the ufshcd_device_init(hba, true) call
ufshcd_async_scan() is called (asynchronously) only by ufshcd_init().
Move the ufshcd_device_init(hba, true) call from ufshcd_async_scan()
into ufshcd_init(). This patch prepares for moving both scsi_add_host()
calls into ufshcd_add_scsi_host(). Calling ufshcd_device_init() from
ufshcd_init() without holding hba->host_sem is safe. This is safe
because hba->host_sem serializes core code and sysfs callbacks. The
ufshcd_device_init() call is moved before the scsi_add_host() call and
hence happens before any SCSI sysfs attributes are created.
Since ufshcd_device_init() may call scsi_add_host(), only call
scsi_add_host() from ufshcd_add_scsi_host() if the SCSI host has not yet
been added by ufshcd_device_init().
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20241016201249.2256266-8-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent 639e204 commit 69f5eb7
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8891 | 8891 | | |
8892 | 8892 | | |
8893 | 8893 | | |
8894 | | - | |
8895 | | - | |
8896 | | - | |
| 8894 | + | |
8897 | 8895 | | |
8898 | 8896 | | |
8899 | 8897 | | |
| |||
10364 | 10362 | | |
10365 | 10363 | | |
10366 | 10364 | | |
10367 | | - | |
| 10365 | + | |
| 10366 | + | |
10368 | 10367 | | |
10369 | 10368 | | |
10370 | 10369 | | |
| |||
10593 | 10592 | | |
10594 | 10593 | | |
10595 | 10594 | | |
| 10595 | + | |
| 10596 | + | |
| 10597 | + | |
| 10598 | + | |
| 10599 | + | |
10596 | 10600 | | |
10597 | 10601 | | |
10598 | 10602 | | |
| |||
0 commit comments