From: Benjamin Rood <benjaminjrood@gmail.com>
To: linux-scsi@vger.kernel.org, xjtuwjp@gmail.com,
James.Bottomley@HansenPartnership.com
Cc: Benjamin Rood <brood@attotech.com>
Subject: [PATCH 1/8] pm80xx: configure PHY settings based on subsystem vendor ID
Date: Fri, 30 Oct 2015 10:53:24 -0400 [thread overview]
Message-ID: <1446216811-2248-2-git-send-email-brood@attotech.com> (raw)
In-Reply-To: <1446216811-2248-1-git-send-email-brood@attotech.com>
Previuosly, all PMC Sierra 80xx controllers are assumed to be a
motherboard controller, except if the subsystem vendor ID was equal to
PCI_VENDOR_ID_ADAPTEC. The driver then attempts to load PHY settings
from NVRAM. While this may be correct behavior for most controllers, it
does not work with Adaptec and ATTO controllers since they do not store
PHY settings in NVRAM and choose to use either custom PHY settings or chip
defaults. Loading random values from NVRAM may cause the controllers to
malfunction in this edge case.
Signed-off-by: Benjamin Rood <brood@attotech.com>
---
drivers/scsi/pm8001/pm8001_init.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 5c0356f..8c094fd 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -720,6 +720,23 @@ static int pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha)
return 0;
}
+/**
+ * pm8001_configure_phy_settings : Configures PHY settings based on vendor ID.
+ * @pm8001_ha : our hba.
+ */
+static int pm8001_configure_phy_settings(struct pm8001_hba_info *pm8001_ha)
+{
+ switch (pm8001_ha->pdev->subsystem_vendor) {
+ case PCI_VENDOR_ID_ATTO:
+ case PCI_VENDOR_ID_ADAPTEC2:
+ case 0:
+ return 0;
+
+ default:
+ return pm8001_get_phy_settings_info(pm8001_ha);
+ }
+}
+
#ifdef PM8001_USE_MSIX
/**
* pm8001_setup_msix - enable MSI-X interrupt
@@ -902,12 +919,9 @@ static int pm8001_pci_probe(struct pci_dev *pdev,
pm8001_init_sas_add(pm8001_ha);
/* phy setting support for motherboard controller */
- if (pdev->subsystem_vendor != PCI_VENDOR_ID_ADAPTEC2 &&
- pdev->subsystem_vendor != 0) {
- rc = pm8001_get_phy_settings_info(pm8001_ha);
- if (rc)
- goto err_out_shost;
- }
+ if (pm8001_configure_phy_settings(pm8001_ha))
+ goto err_out_shost;
+
pm8001_post_sas_ha_init(shost, chip);
rc = sas_register_ha(SHOST_TO_SAS_HA(shost));
if (rc)
--
2.4.3
next prev parent reply other threads:[~2015-10-30 14:53 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 14:53 [PATCH 0/8] pm80xx: Add ATTO 12Gb HBA support and fix various issues Benjamin Rood
2015-10-30 14:53 ` Benjamin Rood [this message]
2015-11-02 7:51 ` [PATCH 1/8] pm80xx: configure PHY settings based on subsystem vendor ID Hannes Reinecke
2015-11-02 8:00 ` Jack Wang
2015-10-30 14:53 ` [PATCH 2/8] pm80xx: add support for PMC Sierra 8070 and PMC Sierra 8072 SAS controllers Benjamin Rood
2015-11-02 7:51 ` Hannes Reinecke
2015-11-02 8:01 ` Jack Wang
2015-10-30 14:53 ` [PATCH 3/8] pm80xx: add ATTO PCI IDs to pm8001_pci_table Benjamin Rood
2015-11-02 7:52 ` Hannes Reinecke
2015-11-02 8:02 ` Jack Wang
2015-10-30 14:53 ` [PATCH 4/8] pm80xx: add support for ATTO devices during SAS address initiailization Benjamin Rood
2015-11-02 7:53 ` Hannes Reinecke
2015-11-02 8:06 ` Jack Wang
2015-11-02 20:39 ` [PATCH v2 4/9] " Benjamin Rood
2015-10-30 14:53 ` [PATCH 5/8] pm80xx: set PHY profiles for ATTO 12Gb SAS controllers Benjamin Rood
2015-11-02 7:57 ` Hannes Reinecke
2015-11-02 8:08 ` Jack Wang
2015-10-30 14:53 ` [PATCH 6/8] pm80xx: do not examine registers for iButton feature if ATTO adapter Benjamin Rood
2015-11-02 7:58 ` Hannes Reinecke
2015-11-02 8:08 ` Jack Wang
2015-10-30 14:53 ` [PATCH 7/8] pm80xx: wait a minimum of 500ms before issuing commands to SPCv Benjamin Rood
2015-11-02 8:00 ` Hannes Reinecke
2015-11-02 8:12 ` Jack Wang
2015-11-02 20:42 ` [PATCH v2 7/9] " Benjamin Rood
2015-10-30 14:53 ` [PATCH 8/8] pm80xx: avoid a panic if MSI(X) interrupts are disabled Benjamin Rood
2015-11-02 8:01 ` Hannes Reinecke
2015-11-02 8:12 ` Jack Wang
2015-11-03 4:44 ` [PATCH 0/8] pm80xx: Add ATTO 12Gb HBA support and fix various issues Martin K. Petersen
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=1446216811-2248-2-git-send-email-brood@attotech.com \
--to=benjaminjrood@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brood@attotech.com \
--cc=linux-scsi@vger.kernel.org \
--cc=xjtuwjp@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