2008-08-01 16:19:43

by Yang, Bo

[permalink] [raw]
Subject: [PATCH 1/4] scsi: megaraid_sas - Add the dumy readl to force PCI flush

MegaRAID SAS Driver get unexpected Interrupt. Add the dumy readl to force PCI flush will fix this issue.

Signed-off-by Bo Yang<[email protected]>

---
drivers/scsi/megaraid/megaraid_sas.c | 6 ++++++
1 files changed, 6 insertions(+)

diff -rupN linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c
--- linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c 2008-07-31 12:00:58.000000000 -0400
+++ linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c 2008-07-31 12:30:35.000000000 -0400
@@ -198,6 +198,9 @@ megasas_clear_intr_xscale(struct megasas
*/
writel(status, &regs->outbound_intr_status);

+ /* Dummy readl to force pci flush */
+ readl(&regs->outbound_intr_status);
+
return 0;
}

@@ -293,6 +296,9 @@ megasas_clear_intr_ppc(struct megasas_re
*/
writel(status, &regs->outbound_doorbell_clear);

+ /* Dummy readl to force pci flush */
+ readl(&regs->outbound_doorbell_clear);
+
return 0;
}
/**


2008-08-05 00:42:00

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 1/4] scsi: megaraid_sas - Add the dumy readl to force PCI flush

On Fri, 1 Aug 2008 10:19:07 -0600 "Yang, Bo" <[email protected]> wrote:

> MegaRAID SAS Driver get unexpected Interrupt. Add the dumy readl to force PCI flush will fix this issue.
>
> Signed-off-by Bo Yang<[email protected]>
>
> ---
> drivers/scsi/megaraid/megaraid_sas.c | 6 ++++++
> 1 files changed, 6 insertions(+)
>
> diff -rupN linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c
> --- linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c 2008-07-31 12:00:58.000000000 -0400
> +++ linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c 2008-07-31 12:30:35.000000000 -0400
> @@ -198,6 +198,9 @@ megasas_clear_intr_xscale(struct megasas
> */
> writel(status, &regs->outbound_intr_status);
>
> + /* Dummy readl to force pci flush */
> + readl(&regs->outbound_intr_status);
> +
> return 0;
> }
>
> @@ -293,6 +296,9 @@ megasas_clear_intr_ppc(struct megasas_re
> */
> writel(status, &regs->outbound_doorbell_clear);
>
> + /* Dummy readl to force pci flush */
> + readl(&regs->outbound_doorbell_clear);
> +
> return 0;
> }
> /**

These patches all had their tabs replaced with spaces. I fixed them up.

Please always run checkpatch on all patches. checkpatch found this:

ERROR: Macros with complex values should be enclosed in parenthesis
#182: FILE: drivers/scsi/megaraid/megaraid_sas.h:586:
+#define MFI_GEN2_ENABLE_INTERRUPT_MASK 0x00000001 | 0x00000004

which is a potential source of bugs. I queued a patch to fix that also.

2008-08-05 12:29:45

by Yang, Bo

[permalink] [raw]
Subject: RE: [PATCH 1/4] scsi: megaraid_sas - Add the dumy readl to force PCI flush

Thanks Andrew.

Bo Yang

________________________________________
From: Andrew Morton [[email protected]]
Sent: Monday, August 04, 2008 8:41 PM
To: Yang, Bo
Cc: '[email protected]'; '[email protected]'; '[email protected]'; '[email protected]'; Patro, Sumant; Austria, Winston; [email protected]
Subject: Re: [PATCH 1/4] scsi: megaraid_sas - Add the dumy readl to force PCI flush

On Fri, 1 Aug 2008 10:19:07 -0600 "Yang, Bo" <[email protected]> wrote:

> MegaRAID SAS Driver get unexpected Interrupt. Add the dumy readl to force PCI flush will fix this issue.
>
> Signed-off-by Bo Yang<[email protected]>
>
> ---
> drivers/scsi/megaraid/megaraid_sas.c | 6 ++++++
> 1 files changed, 6 insertions(+)
>
> diff -rupN linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c
> --- linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c 2008-07-31 12:00:58.000000000 -0400
> +++ linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c 2008-07-31 12:30:35.000000000 -0400
> @@ -198,6 +198,9 @@ megasas_clear_intr_xscale(struct megasas
> */
> writel(status, &regs->outbound_intr_status);
>
> + /* Dummy readl to force pci flush */
> + readl(&regs->outbound_intr_status);
> +
> return 0;
> }
>
> @@ -293,6 +296,9 @@ megasas_clear_intr_ppc(struct megasas_re
> */
> writel(status, &regs->outbound_doorbell_clear);
>
> + /* Dummy readl to force pci flush */
> + readl(&regs->outbound_doorbell_clear);
> +
> return 0;
> }
> /**

These patches all had their tabs replaced with spaces. I fixed them up.

Please always run checkpatch on all patches. checkpatch found this:

ERROR: Macros with complex values should be enclosed in parenthesis
#182: FILE: drivers/scsi/megaraid/megaraid_sas.h:586:
+#define MFI_GEN2_ENABLE_INTERRUPT_MASK 0x00000001 | 0x00000004

which is a potential source of bugs. I queued a patch to fix that also.

2008-08-10 15:03:53

by James Bottomley

[permalink] [raw]
Subject: RE: [PATCH 1/4] scsi: megaraid_sas - Add the dumy readl to force PCI flush

On Tue, 2008-08-05 at 06:27 -0600, Yang, Bo wrote:
> Thanks Andrew.

So could we have the corrected patch, please ... at least the pci
posting flush fix looks like a pure bug fix that's a rc candidate.

James

2008-08-10 19:41:01

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 1/4] scsi: megaraid_sas - Add the dumy readl to force PCI flush

On Sun, 10 Aug 2008 10:03:36 -0500 James Bottomley <[email protected]> wrote:

> On Tue, 2008-08-05 at 06:27 -0600, Yang, Bo wrote:
> > Thanks Andrew.
>
> So could we have the corrected patch, please ... at least the pci
> posting flush fix looks like a pure bug fix that's a rc candidate.
>

I'll send them over now.