linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: rockchip: Correct the register value for clearing client interrupts
@ 2016-08-29 21:14 Brian Norris
  2016-08-29 23:57 ` Bjorn Helgaas
  2016-08-31 13:07 ` Bjorn Helgaas
  0 siblings, 2 replies; 4+ messages in thread
From: Brian Norris @ 2016-08-29 21:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-kernel, Brian Norris, Shawn Lin, Wenrui Li, Heiko Stuebner,
	linux-pci, linux-rockchip, Brian Norris

I'm pretty sure the bitwise 'or' was meant for the value parameter, not
the register parameter.

This resolves an interrupt storm, where if we receive any client IRQs
(e.g., correctable errors), we fail to ever clear them properly, so they
reoccur indefinitely.

Fixes: 199410f6270e ("PCI: rockchip: Add Rockchip PCIe controller support")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Cc: Shawn Lin <shawn.lin@rock-chips.com>
---
Patched against git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/host-rockchip

 drivers/pci/host/pcie-rockchip.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 8fb47ee9eaee..e77aec3cc869 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -689,9 +689,10 @@ static irqreturn_t rockchip_pcie_client_irq_handler(int irq, void *arg)
 			      PCIE_CLIENT_INT_MSG | PCIE_CLIENT_INT_HOT_RST |
 			      PCIE_CLIENT_INT_DPA | PCIE_CLIENT_INT_FATAL_ERR |
 			      PCIE_CLIENT_INT_NFATAL_ERR |
-			      PCIE_CLIENT_INT_CORR_ERR),
-			      PCIE_CLIENT_INT_STATUS |
-			      PCIE_CLIENT_INT_PHY);
+			      PCIE_CLIENT_INT_CORR_ERR |
+			      PCIE_CLIENT_INT_PHY),
+		   PCIE_CLIENT_INT_STATUS);
+
 	return IRQ_HANDLED;
 }
 
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: rockchip: Correct the register value for clearing client interrupts
  2016-08-29 21:14 [PATCH] PCI: rockchip: Correct the register value for clearing client interrupts Brian Norris
@ 2016-08-29 23:57 ` Bjorn Helgaas
  2016-08-31  0:58   ` Shawn Lin
  2016-08-31 13:07 ` Bjorn Helgaas
  1 sibling, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2016-08-29 23:57 UTC (permalink / raw)
  To: Brian Norris
  Cc: Bjorn Helgaas, linux-kernel, Brian Norris, Shawn Lin, Wenrui Li,
	Heiko Stuebner, linux-pci, linux-rockchip

On Mon, Aug 29, 2016 at 02:14:11PM -0700, Brian Norris wrote:
> I'm pretty sure the bitwise 'or' was meant for the value parameter, not
> the register parameter.
> 
> This resolves an interrupt storm, where if we receive any client IRQs
> (e.g., correctable errors), we fail to ever clear them properly, so they
> reoccur indefinitely.
> 
> Fixes: 199410f6270e ("PCI: rockchip: Add Rockchip PCIe controller support")
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Cc: Shawn Lin <shawn.lin@rock-chips.com>

Shawn, please confirm.  If this patch is correct, I'll fold it into
the initial commit that adds the driver.

> ---
> Patched against git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/host-rockchip
> 
>  drivers/pci/host/pcie-rockchip.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 8fb47ee9eaee..e77aec3cc869 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -689,9 +689,10 @@ static irqreturn_t rockchip_pcie_client_irq_handler(int irq, void *arg)
>  			      PCIE_CLIENT_INT_MSG | PCIE_CLIENT_INT_HOT_RST |
>  			      PCIE_CLIENT_INT_DPA | PCIE_CLIENT_INT_FATAL_ERR |
>  			      PCIE_CLIENT_INT_NFATAL_ERR |
> -			      PCIE_CLIENT_INT_CORR_ERR),
> -			      PCIE_CLIENT_INT_STATUS |
> -			      PCIE_CLIENT_INT_PHY);
> +			      PCIE_CLIENT_INT_CORR_ERR |
> +			      PCIE_CLIENT_INT_PHY),
> +		   PCIE_CLIENT_INT_STATUS);
> +
>  	return IRQ_HANDLED;
>  }
>  
> -- 
> 2.8.0.rc3.226.g39d4020
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: rockchip: Correct the register value for clearing client interrupts
  2016-08-29 23:57 ` Bjorn Helgaas
@ 2016-08-31  0:58   ` Shawn Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn Lin @ 2016-08-31  0:58 UTC (permalink / raw)
  To: Bjorn Helgaas, Brian Norris
  Cc: shawn.lin, Bjorn Helgaas, linux-kernel, Brian Norris, Wenrui Li,
	Heiko Stuebner, linux-pci, linux-rockchip

On 2016/8/30 7:57, Bjorn Helgaas wrote:
> On Mon, Aug 29, 2016 at 02:14:11PM -0700, Brian Norris wrote:
>> I'm pretty sure the bitwise 'or' was meant for the value parameter, not
>> the register parameter.
>>
>> This resolves an interrupt storm, where if we receive any client IRQs
>> (e.g., correctable errors), we fail to ever clear them properly, so they
>> reoccur indefinitely.
>>
>> Fixes: 199410f6270e ("PCI: rockchip: Add Rockchip PCIe controller support")
>> Signed-off-by: Brian Norris <briannorris@chromium.org>
>> Cc: Shawn Lin <shawn.lin@rock-chips.com>
>
> Shawn, please confirm.  If this patch is correct, I'll fold it into
> the initial commit that adds the driver.

yes, Brian's patch is correct. I probably didn't notice this as
the client interrput on EVB-rev1 board which I was using is broken, so
my SSD didn't actually yelled at this irqstorm.


Brain, thanks for fixing this.

>
>> ---
>> Patched against git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/host-rockchip
>>
>>  drivers/pci/host/pcie-rockchip.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
>> index 8fb47ee9eaee..e77aec3cc869 100644
>> --- a/drivers/pci/host/pcie-rockchip.c
>> +++ b/drivers/pci/host/pcie-rockchip.c
>> @@ -689,9 +689,10 @@ static irqreturn_t rockchip_pcie_client_irq_handler(int irq, void *arg)
>>  			      PCIE_CLIENT_INT_MSG | PCIE_CLIENT_INT_HOT_RST |
>>  			      PCIE_CLIENT_INT_DPA | PCIE_CLIENT_INT_FATAL_ERR |
>>  			      PCIE_CLIENT_INT_NFATAL_ERR |
>> -			      PCIE_CLIENT_INT_CORR_ERR),
>> -			      PCIE_CLIENT_INT_STATUS |
>> -			      PCIE_CLIENT_INT_PHY);
>> +			      PCIE_CLIENT_INT_CORR_ERR |
>> +			      PCIE_CLIENT_INT_PHY),
>> +		   PCIE_CLIENT_INT_STATUS);
>> +
>>  	return IRQ_HANDLED;
>>  }
>>
>> --
>> 2.8.0.rc3.226.g39d4020
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
Best Regards
Shawn Lin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: rockchip: Correct the register value for clearing client interrupts
  2016-08-29 21:14 [PATCH] PCI: rockchip: Correct the register value for clearing client interrupts Brian Norris
  2016-08-29 23:57 ` Bjorn Helgaas
@ 2016-08-31 13:07 ` Bjorn Helgaas
  1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2016-08-31 13:07 UTC (permalink / raw)
  To: Brian Norris
  Cc: Bjorn Helgaas, linux-kernel, Brian Norris, Shawn Lin, Wenrui Li,
	Heiko Stuebner, linux-pci, linux-rockchip

On Mon, Aug 29, 2016 at 02:14:11PM -0700, Brian Norris wrote:
> I'm pretty sure the bitwise 'or' was meant for the value parameter, not
> the register parameter.
> 
> This resolves an interrupt storm, where if we receive any client IRQs
> (e.g., correctable errors), we fail to ever clear them properly, so they
> reoccur indefinitely.
> 
> Fixes: 199410f6270e ("PCI: rockchip: Add Rockchip PCIe controller support")
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Cc: Shawn Lin <shawn.lin@rock-chips.com>

I folded this into the initial commit, since Shawn confirmed it is correct.

> ---
> Patched against git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/host-rockchip
> 
>  drivers/pci/host/pcie-rockchip.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 8fb47ee9eaee..e77aec3cc869 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -689,9 +689,10 @@ static irqreturn_t rockchip_pcie_client_irq_handler(int irq, void *arg)
>  			      PCIE_CLIENT_INT_MSG | PCIE_CLIENT_INT_HOT_RST |
>  			      PCIE_CLIENT_INT_DPA | PCIE_CLIENT_INT_FATAL_ERR |
>  			      PCIE_CLIENT_INT_NFATAL_ERR |
> -			      PCIE_CLIENT_INT_CORR_ERR),
> -			      PCIE_CLIENT_INT_STATUS |
> -			      PCIE_CLIENT_INT_PHY);
> +			      PCIE_CLIENT_INT_CORR_ERR |
> +			      PCIE_CLIENT_INT_PHY),
> +		   PCIE_CLIENT_INT_STATUS);
> +
>  	return IRQ_HANDLED;
>  }
>  
> -- 
> 2.8.0.rc3.226.g39d4020
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-31 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-29 21:14 [PATCH] PCI: rockchip: Correct the register value for clearing client interrupts Brian Norris
2016-08-29 23:57 ` Bjorn Helgaas
2016-08-31  0:58   ` Shawn Lin
2016-08-31 13:07 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).