Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1658677 > unrolled thread

[PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support

Started byAdrian Hunter <adrian.hunter@intel.com>
First post2017-06-06 13:50 +0200
Last post2017-06-08 11:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support Adrian Hunter <adrian.hunter@intel.com> - 2017-06-06 13:50 +0200
    Re: [PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support Christoph Hellwig <hch@infradead.org> - 2017-06-07 15:20 +0200
      Re: [PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support Joao Pinto <Joao.Pinto@synopsys.com> - 2017-06-08 11:40 +0200

#1658677 — [PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support

FromAdrian Hunter <adrian.hunter@intel.com>
Date2017-06-06 13:50 +0200
Subject[PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support
Message-ID<tPl9M-8gs-19@gated-at.bofh.it>
Add PCI id and variant ops for Intel CNL UFS host controller.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/scsi/ufs/ufshcd-pci.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c
index 0dcff829f8b6..925b0ec7ec54 100644
--- a/drivers/scsi/ufs/ufshcd-pci.c
+++ b/drivers/scsi/ufs/ufshcd-pci.c
@@ -37,6 +37,41 @@
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 
+static int ufs_intel_disable_lcc(struct ufs_hba *hba)
+{
+	u32 attr = UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE);
+	u32 lcc_enable = 0;
+
+	ufshcd_dme_get(hba, attr, &lcc_enable);
+	if (lcc_enable)
+		ufshcd_dme_set(hba, attr, 0);
+
+	return 0;
+}
+
+static int ufs_intel_link_startup_notify(struct ufs_hba *hba,
+					 enum ufs_notify_change_status status)
+{
+	int err = 0;
+
+	switch (status) {
+	case PRE_CHANGE:
+		err = ufs_intel_disable_lcc(hba);
+		break;
+	case POST_CHANGE:
+		break;
+	default:
+		break;
+	}
+
+	return err;
+}
+
+static struct ufs_hba_variant_ops ufs_intel_cnl_hba_vops = {
+	.name                   = "intel-pci",
+	.link_startup_notify	= ufs_intel_link_startup_notify,
+};
+
 #ifdef CONFIG_PM_SLEEP
 /**
  * ufshcd_pci_suspend - suspend power management function
@@ -139,6 +174,8 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)
 		return err;
 	}
 
+	hba->vops = (struct ufs_hba_variant_ops *)id->driver_data;
+
 	err = ufshcd_init(hba, mmio_base, pdev->irq);
 	if (err) {
 		dev_err(&pdev->dev, "Initialization failed\n");
@@ -163,6 +200,7 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)
 
 static const struct pci_device_id ufshcd_pci_tbl[] = {
 	{ PCI_VENDOR_ID_SAMSUNG, 0xC00C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ PCI_VDEVICE(INTEL, 0x9DFA), (kernel_ulong_t)&ufs_intel_cnl_hba_vops },
 	{ }	/* terminate list */
 };
 
-- 
1.9.1

[toc] | [next] | [standalone]


#1659789

FromChristoph Hellwig <hch@infradead.org>
Date2017-06-07 15:20 +0200
Message-ID<tPJ2q-77i-25@gated-at.bofh.it>
In reply to#1658677
On Tue, Jun 06, 2017 at 02:35:31PM +0300, Adrian Hunter wrote:
> Add PCI id and variant ops for Intel CNL UFS host controller.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

It would be great if we could fold tc-dwc-g210-pci into ufshcd-pci the
same way.

[toc] | [prev] | [next] | [standalone]


#1660983

FromJoao Pinto <Joao.Pinto@synopsys.com>
Date2017-06-08 11:40 +0200
Message-ID<tQ254-2wu-25@gated-at.bofh.it>
In reply to#1659789
Hello to all,

Às 2:16 PM de 6/7/2017, Christoph Hellwig escreveu:
> On Tue, Jun 06, 2017 at 02:35:31PM +0300, Adrian Hunter wrote:
>> Add PCI id and variant ops for Intel CNL UFS host controller.
> 
> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> It would be great if we could fold tc-dwc-g210-pci into ufshcd-pci the
> same way.
> 

I have forward the suggestion to the person on charge of UFS driver maintenance
at Synopsys. We will definitely have a look at it!

Thanks,
Joao

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web