All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Rood <benjaminjrood@gmail.com>
To: linux-scsi@vger.kernel.org, xjtuwjp@gmail.com,
	James.Bottomley@HansenPartnership.com, hare@suse.de
Cc: Benjamin Rood <brood@attotech.com>
Subject: [PATCH v2 7/9] pm80xx: wait a minimum of 500ms before issuing commands to SPCv
Date: Mon,  2 Nov 2015 15:42:29 -0500	[thread overview]
Message-ID: <1446496949-1980-1-git-send-email-brood@attotech.com> (raw)
In-Reply-To: <CAD+HZHU-2V0R1uRAqauxFWuSsC0qGLsGCoVrBgmbhp2LADbfdg@mail.gmail.com>

The documentation for the 8070 and 8072 SPCv chip explicitly states that
a minimum of 500ms must elapse before issuing commands, otherwise the
SPCv may not process them and the firmware may get into an unrecoverable
state requiring a reboot.  While the Linux guys will probably think this
is 'racy', it is called out in the chip documentation and inserting this
delay makes power management function properly.

Signed-off-by: Benjamin Rood <brood@attotech.com>
---
Changes from v1 -> v2:
	-Used mdelay(500) instead of a loop to facilitate required delay
	-Added comment as to why this behavior exists

 drivers/scsi/pm8001/pm8001_init.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 7ce7ea3..d147c41 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -1243,6 +1243,19 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
 		for (i = 1; i < pm8001_ha->number_of_intr; i++)
 			PM8001_CHIP_DISP->interrupt_enable(pm8001_ha, i);
 	}
+
+	/* Chip documentation for the 8070 and 8072 SPCv    */
+	/* states that a 500ms minimum delay is required    */
+	/* before issuing commands.  Otherwise, the firmare */
+	/* will enter an unrecoverable state.               */
+
+	if (pm8001_ha->chip_id == chip_8070 ||
+		pm8001_ha->chip_id == chip_8072) {
+		mdelay(500);
+	}
+
+	/* Spin up the PHYs */
+
 	pm8001_ha->flags = PM8001F_RUN_TIME;
 	for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
 		pm8001_ha->phy[i].enable_completion = &completion;
-- 
2.4.3


  reply	other threads:[~2015-11-02 20:42 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 ` [PATCH 1/8] pm80xx: configure PHY settings based on subsystem vendor ID Benjamin Rood
2015-11-02  7:51   ` 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     ` Benjamin Rood [this message]
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=1446496949-1980-1-git-send-email-brood@attotech.com \
    --to=benjaminjrood@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=brood@attotech.com \
    --cc=hare@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.