Skip to contentSkip to conversation

hpsa: do not attempt to read from a write-only register

PATCH In review Stephen M. Cameron 2 participants 5 messages Jul 8, 2011 – Jul 11, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hpsa: do not attempt to read from a write-only register

From: Stephen M. Cameron <[email protected]>

Most smartarrays tolerate it, but a few new ones don't.

---
 drivers/scsi/hpsa.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/hpsa.h +1 -1
index 6d8dcd4..7f53cea 100644
@@ -214,7 +214,7 @@ static void SA5_submit_command(struct ctlr_info *h,
 	dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
 		c->Header.Tag.lower);
 	writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
-	(void) readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+	(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
 	h->commands_outstanding++;
 	if (h->commands_outstanding > h->max_outstanding)
 		h->max_outstanding = h->commands_outstanding;
#1 lore raw
Quoted 14 lines · On Fri, 08 Jul 2011 14:59:26 -0500 "Stephen M. Cameron"…

From: Stephen M. Cameron <[email protected]>

Most smartarrays tolerate it, but a few new ones don't.

---
 drivers/scsi/hpsa.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/hpsa.h +0 -0
index 6d8dcd4..7f53cea 100644

drivers/scsi/hpsa.h static void SA5_submit_command(struct ctlr_info *h, · line 220

Quoted 8 lines
drivers/scsi/hpsa.h +1 -1
@@ -214,7 +214,7 @@ static void SA5_submit_command(struct ctlr_info *h,
 	dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
 		c->Header.Tag.lower);
 	writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
-	(void) readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+	(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
 	h->commands_outstanding++;
 	if (h->commands_outstanding > h->max_outstanding)
 		h->max_outstanding = h->commands_outstanding;

The changelog forgot to tell us the user-visible effects of the bug. That was really really bad of it. Bad changelog. No bone for you.

#2 lore raw
Quoted 12 lines · Andrew Morton
Quoted 9 lines · On Fri, 08 Jul 2011 14:59:26 -0500 "Stephen M. Cameron"…

From: Stephen M. Cameron <[email protected]>

Most smartarrays tolerate it, but a few new ones don't.

---
 drivers/scsi/hpsa.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines

drivers/scsi/hpsa.h static void SA5_submit_command(struct ctlr_info *h, · line 220

Quoted 13 lines
drivers/scsi/hpsa.h +1 -1
index 6d8dcd4..7f53cea 100644
@@ -214,7 +214,7 @@ static void SA5_submit_command(struct ctlr_info *h,
 	dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
 		c->Header.Tag.lower);
 	writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
-	(void) readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+	(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
 	h->commands_outstanding++;
 	if (h->commands_outstanding > h->max_outstanding)
 		h->max_outstanding = h->commands_outstanding;

The changelog forgot to tell us the user-visible effects of the bug. That was really really bad of it. Bad changelog. No bone for you.

Oh, sorry. When the controller doesn't tolerate the bug, the firmware on it locks up. No interrupts are received, no commands complete. I/o on that controller grinds to a halt.

I can resubmit if you like.

-- steve

#3 lore raw
Quoted 30 lines · On Mon, 11 Jul 2011 15:51:24 -0500 [email protected] wrote:
Quoted 12 lines · Andrew Morton
Quoted 9 lines · On Fri, 08 Jul 2011 14:59:26 -0500 "Stephen M. Cameron"…

From: Stephen M. Cameron <[email protected]>

Most smartarrays tolerate it, but a few new ones don't.

---
 drivers/scsi/hpsa.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines

drivers/scsi/hpsa.h static void SA5_submit_command(struct ctlr_info *h, · line 220

Quoted 13 lines
drivers/scsi/hpsa.h +1 -1
index 6d8dcd4..7f53cea 100644
@@ -214,7 +214,7 @@ static void SA5_submit_command(struct ctlr_info *h,
 	dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
 		c->Header.Tag.lower);
 	writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
-	(void) readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+	(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
 	h->commands_outstanding++;
 	if (h->commands_outstanding > h->max_outstanding)
 		h->max_outstanding = h->commands_outstanding;

The changelog forgot to tell us the user-visible effects of the bug. That was really really bad of it. Bad changelog. No bone for you.

Quoted 3 lines

Oh, sorry. When the controller doesn't tolerate the bug, the firmware on it locks up. No interrupts are received, no commands complete. I/o on that controller grinds to a halt.

OK, that was important.

Presumably you'd like those newer controllers to work with older kernels? In which case we should mark the patch for -stable backporting?

I've done that to my copy and have updated the changelog.

Quoted 1 line

I can resubmit if you like.

I have two other needed-in-3.0 scsi patches. I'll send all three Jameswards now.

#4 lore raw
Quoted 37 lines · Andrew Morton
Quoted 30 lines · On Mon, 11 Jul 2011 15:51:24 -0500 [email protected] wrote:
Quoted 12 lines · Andrew Morton
Quoted 9 lines · On Fri, 08 Jul 2011 14:59:26 -0500 "Stephen M. Cameron"…

From: Stephen M. Cameron <[email protected]>

Most smartarrays tolerate it, but a few new ones don't.

---
 drivers/scsi/hpsa.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines

drivers/scsi/hpsa.h static void SA5_submit_command(struct ctlr_info *h, · line 220

Quoted 13 lines
drivers/scsi/hpsa.h +1 -1
index 6d8dcd4..7f53cea 100644
@@ -214,7 +214,7 @@ static void SA5_submit_command(struct ctlr_info *h,
 	dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
 		c->Header.Tag.lower);
 	writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
-	(void) readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+	(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
 	h->commands_outstanding++;
 	if (h->commands_outstanding > h->max_outstanding)
 		h->max_outstanding = h->commands_outstanding;

The changelog forgot to tell us the user-visible effects of the bug. That was really really bad of it. Bad changelog. No bone for you.

Quoted 3 lines

Oh, sorry. When the controller doesn't tolerate the bug, the firmware on it locks up. No interrupts are received, no commands complete. I/o on that controller grinds to a halt.

Quoted 5 lines

OK, that was important.

Presumably you'd like those newer controllers to work with older kernels? In which case we should mark the patch for -stable backporting?

Yes.

Quoted 7 lines

I've done that to my copy and have updated the changelog.

Quoted 1 line

I can resubmit if you like.

I have two other needed-in-3.0 scsi patches. I'll send all three Jameswards now.