linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alim Akhtar <alim.akhtar@samsung.com>
To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: JBottomley@odin.com, vinholikatti@gmail.com,
	amit.daniel@samsung.com, essuuj@gmail.com,
	devicetree@vger.kernel.org
Subject: [PATCH v3 07/13] scsi: ufs: add specific callback for nexus type
Date: Thu, 01 Oct 2015 13:39:24 +0530	[thread overview]
Message-ID: <1443686970-28104-8-git-send-email-alim.akhtar@samsung.com> (raw)
In-Reply-To: <1443686970-28104-1-git-send-email-alim.akhtar@samsung.com>

From: Seungwon Jeon <essuuj@gmail.com>

Some host controller needs nexus type information for handling
command. This change adds specific callback function to support
vendor's implementation.

Signed-off-by: Seungwon Jeon <essuuj@gmail.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c |    6 ++++++
 drivers/scsi/ufs/ufshcd.h |    6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 07659be..46f92fe 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1378,6 +1378,8 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
 
 	/* issue command to the controller */
 	spin_lock_irqsave(hba->host->host_lock, flags);
+	if (hba->vops && hba->vops->specify_nexus_t_xfer_req)
+		hba->vops->specify_nexus_t_xfer_req(hba, tag, lrbp->cmd);
 	ufshcd_send_command(hba, tag);
 out_unlock:
 	spin_unlock_irqrestore(hba->host->host_lock, flags);
@@ -1578,6 +1580,8 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
 	hba->dev_cmd.complete = &wait;
 
 	spin_lock_irqsave(hba->host->host_lock, flags);
+	if (hba->vops && hba->vops->specify_nexus_t_xfer_req)
+		hba->vops->specify_nexus_t_xfer_req(hba, tag, lrbp->cmd);
 	ufshcd_send_command(hba, tag);
 	spin_unlock_irqrestore(hba->host->host_lock, flags);
 
@@ -3849,6 +3853,8 @@ static int ufshcd_issue_tm_cmd(struct ufs_hba *hba, int lun_id, int task_id,
 	task_req_upiup->input_param2 = cpu_to_be32(task_id);
 
 	/* send command to the controller */
+	if (hba->vops && hba->vops->specify_nexus_t_tm_req)
+		hba->vops->specify_nexus_t_tm_req(hba, free_slot, tm_function);
 	__set_bit(free_slot, &hba->outstanding_tasks);
 	ufshcd_writel(hba, 1 << free_slot, REG_UTP_TASK_REQ_DOOR_BELL);
 
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index a4543c8..75af314 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -257,6 +257,9 @@ struct ufs_pwr_mode_info {
  * @pwr_change_notify: called before and after a power mode change
  *			is carried out to allow vendor spesific capabilities
  *			to be set.
+ * @specify_nexus_t_xfer_req:
+ * @specify_nexus_t_tm_req: called before command is issued to allow vendor
+ *			specific handling to be set for nexus type.
  * @suspend: called during host controller PM callback
  * @resume: called during host controller PM callback
  */
@@ -273,6 +276,9 @@ struct ufs_hba_variant_ops {
 	int	(*pwr_change_notify)(struct ufs_hba *,
 					bool, struct ufs_pa_layer_attr *,
 					struct ufs_pa_layer_attr *);
+	void	(*specify_nexus_t_xfer_req)(struct ufs_hba *,
+					    int, struct scsi_cmnd *);
+	void	(*specify_nexus_t_tm_req)(struct ufs_hba *, int, u8);
 	int     (*suspend)(struct ufs_hba *, enum ufs_pm_op);
 	int     (*resume)(struct ufs_hba *, enum ufs_pm_op);
 };
-- 
1.7.10.4


  parent reply	other threads:[~2015-10-01  8:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01  8:09 [PATCH v3 00/13] exynos-ufs: add support for Exynos Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 01/13] Documentation: samsung-phy: Add dt bindings for UFS Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 02/13] phy: exynos-ufs: add UFS PHY driver for EXYNOS SoC Alim Akhtar
2015-10-01  8:41   ` kbuild test robot
2015-10-01  8:41   ` [PATCH] phy: exynos-ufs: fix platform_no_drv_owner.cocci warnings kbuild test robot
2015-10-01 11:04   ` [RFC PATCH] phy: exynos-ufs: exynos_ufs_phy_calibrate() can be static kbuild test robot
2015-10-13 11:38     ` Alim Akhtar
2015-10-13 12:58       ` [kbuild-all] " Fengguang Wu
2015-10-13 14:02       ` Kishon Vijay Abraham I
2015-10-01 11:04   ` [PATCH v3 02/13] phy: exynos-ufs: add UFS PHY driver for EXYNOS SoC kbuild test robot
2015-10-01  8:09 ` [PATCH v3 03/13] scsi: ufs: add quirk to contain unconformable utrd field Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 04/13] scsi: ufs: add quirk to fix mishandling utrlclr/utmrlclr Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 05/13] scsi: ufs: add quirk not to allow reset of interrupt aggregation Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 06/13] scsi: ufs: add quirk to enable host controller without hce Alim Akhtar
2015-10-01  8:09 ` Alim Akhtar [this message]
2015-10-01  8:09 ` [PATCH v3 08/13] scsi: ufs: add add specific callback for hibern8 Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 09/13] scsi: ufs: make ufshcd_config_pwr_mode of non-static func Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 10/13] scsi: ufs: return value of pwr_change_notify Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 11/13] Documentation: devicetree: ufs: Add DT bindings for exynos UFS host controller Alim Akhtar
2015-10-01 11:37   ` Arnd Bergmann
2015-10-13 11:36     ` Alim Akhtar
2015-10-13 12:10       ` Arnd Bergmann
2015-10-01  8:09 ` [PATCH v3 12/13] scsi: ufs-exynos: add UFS host support for Exynos SoCs Alim Akhtar
2015-10-01 12:12   ` Arnd Bergmann
2015-10-13 11:19     ` Alim Akhtar
2015-10-13 11:38       ` Arnd Bergmann
2015-10-13 11:45         ` Alim Akhtar
2015-10-01  8:09 ` [PATCH v3 13/13] scsi: ufs: Add exynos ufs platform data Alim Akhtar
2015-10-01 10:04   ` kbuild test robot
2015-10-01 10:14   ` kbuild test robot
2015-10-01 10:46   ` kbuild test robot
2015-10-01 11:29     ` Arnd Bergmann
2015-10-05  8:14       ` Alim Akhtar
2015-10-05  9:06         ` Arnd Bergmann
2015-10-05 14:11           ` Rob Herring
2015-10-05 14:47             ` Arnd Bergmann
2015-10-05 15:20             ` Alim Akhtar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443686970-28104-8-git-send-email-alim.akhtar@samsung.com \
    --to=alim.akhtar@samsung.com \
    --cc=JBottomley@odin.com \
    --cc=amit.daniel@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=essuuj@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=vinholikatti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).