lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220726104516.127032-1-goodjob.kwon@samsung.com>
Date:   Tue, 26 Jul 2022 19:45:17 +0900
From:   Gyunghoon Kwon <goodjob.kwon@...sung.com>
To:     jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc:     alim.akhtar@...sung.com, avri.altman@....com,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Gyunghoon Kwon <goodjob.kwon@...sung.com>
Subject: [PATCH] scsi: ufs: introduce dev_cmd_notify callback

Some UFS host controller may need to synchronize dev command among
UFS host controllers.

Signed-off-by: Gyunghoon Kwon <goodjob.kwon@...sung.com>
---
 drivers/scsi/ufs/ufshcd.c |  2 ++
 drivers/scsi/ufs/ufshcd.h | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 823ecd99eb2c..02d0350ee1a2 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2942,8 +2942,10 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
 
 	ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr);
 
+	ufshcd_vops_dev_cmd_notify(hba, PRE_CHANGE);
 	ufshcd_send_command(hba, tag);
 	err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout);
+	ufshcd_vops_dev_cmd_notify(hba, POST_CHANGE);
 	ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP,
 				    (struct utp_upiu_req *)lrbp->ucd_rsp_ptr);
 
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 34c5db101f14..f13b6cdfbe1d 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -320,6 +320,7 @@ struct ufs_pwr_mode_info {
  * @device_reset: called to issue a reset pulse on the UFS device
  * @program_key: program or evict an inline encryption key
  * @event_notify: called to notify important events
+ * @dev_cmd_notify: called to notify device management request is issued
  */
 struct ufs_hba_variant_ops {
 	const char *name;
@@ -357,6 +358,8 @@ struct ufs_hba_variant_ops {
 			       const union ufs_crypto_cfg_entry *cfg, int slot);
 	void	(*event_notify)(struct ufs_hba *hba,
 				enum ufs_event_type evt, void *data);
+	void	(*dev_cmd_notify)(struct ufs_hba *hba,
+			       enum ufs_notify_change_status);
 };
 
 /* clock gating state  */
@@ -1354,6 +1357,13 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
 		hba->vops->config_scaling_param(hba, profile, data);
 }
 
+static inline void ufshcd_vops_dev_cmd_notify(struct ufs_hba *hba,
+					enum ufs_notify_change_status status)
+{
+	if (hba->vops && hba->vops->dev_cmd_notify)
+		hba->vops->dev_cmd_notify(hba, status);
+}
+
 extern struct ufs_pm_lvl_states ufs_pm_lvl_states[];
 
 /*
-- 
2.37.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ