Skip to contentSkip to conversation

Three small UFS driver patches

PATCH Applied Bart Van Assche 3 participants 7 messages Apr 1 – Apr 9

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author reviewer
#0 lore raw

cover Three small UFS driver patches

Hi Martin,

Please consider this series of three small patches for the next merge window.

Thanks,

Bart.

Bart Van Assche (3):
ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()
ufs: core: Remove an include directive from ufshcd-crypto.h
ufs: core: Make the header files self-contained

 drivers/ufs/core/ufs-debugfs.h         | 3 +++
 drivers/ufs/core/ufs-fault-injection.h | 2 ++
 drivers/ufs/core/ufs-mcq.c             | 8 ++++++++
 drivers/ufs/core/ufshcd-crypto.h       | 1 -
 4 files changed, 13 insertions(+), 1 deletion(-)
author reviewer
#1 lore raw

PATCH 1/3 ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()

Document the aspects of ufshcd_mcq_compl_all_cqes_lock() that are nontrivial in a comment block above this function.

---
 drivers/ufs/core/ufs-mcq.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/ufs/core/ufs-mcq.c +8 -0
index 1b3062577945..c1b1d67a1ddc 100644
@@ -322,6 +322,14 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,
 	}
 }
 
+/*
+ * This function is called from the UFS error handler with the UFS host
+ * controller disabled (HCE = 0). Reading host controller registers, e.g. the
+ * CQ tail pointer (CQTPy), may not be safe with the host controller disabled.
+ * Hence, iterate over all completion queue entries. This won't result in
+ * double completions because ufshcd_mcq_process_cqe() clears a CQE after it
+ * has been processed.
+ */
 void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,
 				    struct ufs_hw_queue *hwq)
 {
author reviewer
#3 lore raw

PATCH 2/3 ufs: core: Remove an include directive from ufshcd-crypto.h

In reply to Bart Van Assche

Nothing in the ufshcd-crypto.h header file depends on the ufshcd-priv.h header file. Hence, stop including that header file. This include directive was introduced by commit 4bc26113c603 ("scsi: ufs: Split the ufshcd.h header file").

---
 drivers/ufs/core/ufshcd-crypto.h | 1 -
 1 file changed, 1 deletion(-)
drivers/ufs/core/ufshcd-crypto.h +0 -1
index c148a5194378..8f66db94e179 100644
@@ -8,7 +8,6 @@
 
 #include <scsi/scsi_cmnd.h>
 #include <ufs/ufshcd.h>
-#include "ufshcd-priv.h"
 #include <ufs/ufshci.h>
 
 #ifdef CONFIG_SCSI_UFS_CRYPTO
author reviewer
#4 lore raw

PATCH 3/3 ufs: core: Make the header files self-contained

In reply to Bart Van Assche

Add the include directives and forward declarations that are missing from the UFS core header files. This prevents compilation failures if include directives are reordered.

---
 drivers/ufs/core/ufs-debugfs.h         | 3 +++
 drivers/ufs/core/ufs-fault-injection.h | 2 ++
 2 files changed, 5 insertions(+)
drivers/ufs/core/ufs-debugfs.h +3 -0
index 97548a3f90eb..e5bba9671862 100644
@@ -5,6 +5,9 @@
 #ifndef __UFS_DEBUGFS_H__
 #define __UFS_DEBUGFS_H__
 
+#include <linux/init.h>
+#include <linux/types.h>
+
 struct ufs_hba;
 
 #ifdef CONFIG_DEBUG_FS
drivers/ufs/core/ufs-fault-injection.h +2 -0
index 996a35769781..d0c870e19f0e 100644
@@ -6,6 +6,8 @@
 #include <linux/kconfig.h>
 #include <linux/types.h>
 
+struct ufs_hba;
+
 #ifdef CONFIG_SCSI_UFS_FAULT_INJECTION
 void ufs_fault_inject_hba_init(struct ufs_hba *hba);
 bool ufs_trigger_eh(struct ufs_hba *hba);
#6 lore raw
In reply to Bart Van Assche
Quoted 4 lines · Bart Van Assche

Please consider this series of three small patches for the next merge window.

Thanks,

Quoted 8 lines

Bart.

Bart Van Assche (3):
ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()
ufs: core: Remove an include directive from ufshcd-crypto.h
ufs: core: Make the header files self-contained

[...]

Applied to 7.1/scsi-queue, thanks!

[1/3] ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()

      https://git.kernel.org/mkp/scsi/c/1373df88d535
[2/3] ufs: core: Remove an include directive from ufshcd-crypto.h
      https://git.kernel.org/mkp/scsi/c/efa1f6a9d7ce
[3/3] ufs: core: Make the header files self-contained
      https://git.kernel.org/mkp/scsi/c/6daa8dd03745
Signature · 1 line
Martin K. Petersen