Page MenuHomeFreeBSD

D58947.diff
No OneTemporary

D58947.diff

diff --git a/sys/dev/ufshci/ufshci_ctrlr.c b/sys/dev/ufshci/ufshci_ctrlr.c
--- a/sys/dev/ufshci/ufshci_ctrlr.c
+++ b/sys/dev/ufshci/ufshci_ctrlr.c
@@ -151,10 +151,11 @@
/* TODO: Configure Background Operations */
/*
- * If the reset is due to a timeout, it is already attached to the SIM
- * and does not need to be attached again.
+ * A reset normally arrives after the SIM is attached. But if the
+ * first start attempt failed early, the reset path runs without a
+ * SIM. Attach it whenever it does not exist yet.
*/
- if (!resetting && ufshci_sim_attach(ctrlr) != 0) {
+ if (ctrlr->ufshci_sim == NULL && ufshci_sim_attach(ctrlr) != 0) {
ufshci_ctrlr_fail(ctrlr);
return;
}
diff --git a/sys/dev/ufshci/ufshci_sim.c b/sys/dev/ufshci/ufshci_sim.c
--- a/sys/dev/ufshci/ufshci_sim.c
+++ b/sys/dev/ufshci/ufshci_sim.c
@@ -454,6 +454,10 @@
uint64_t scsi_lun;
uint64_t timeout;
+ /* The reset path can get here before the SIM is attached. */
+ if (ctrlr->ufshci_sim == NULL)
+ return (NULL);
+
scsi_lun = ufshci_sim_translate_ufs_to_scsi_lun(wlun);
if (xpt_create_path(&path, /*periph*/ NULL,

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 14, 8:41 AM (2 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40739834
Default Alt Text
D58947.diff (1 KB)

Event Timeline