linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: DPC: Clear AER status bits before disabling port containment
@ 2018-05-16 21:33 Alexandru Gagniuc
  2018-05-16 22:44 ` Sinan Kaya
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandru Gagniuc @ 2018-05-16 21:33 UTC (permalink / raw)
  To: bhelgaas
  Cc: alex_gagniuc, austin_bolen, shyam_iyer, Alexandru Gagniuc,
	Keith Busch, Sinan Kaya, Dongdong Liu, linux-pci, linux-kernel

AER status bits are sticky, and they survive system resets. Downstream
devices are usually taken care of after re-enumerating the downstream
busses, as the AER bits are cleared during probe().

However, nothing clears the bits of the port which contained the
error. These sticky bits may leave some BIOSes to think that something
bad happened, and print ominous messages on next boot. To prevent this,
tidy up the AER status bits before releasing containment.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 drivers/pci/pcie/dpc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index 8c57d607e603..bf82d6936556 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
 		dpc->rp_pio_status = 0;
 	}
 
+	/* DPC event made a mess of our AER status bits. Clean them up. */
+	pci_cleanup_aer_error_status_regs(pdev);
+	/* TODO: Should we also use aer_print_error to log the event? */
+
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
 		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
 
-- 
2.14.3

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

* Re: [PATCH] PCI: DPC: Clear AER status bits before disabling port containment
  2018-05-16 21:33 [PATCH] PCI: DPC: Clear AER status bits before disabling port containment Alexandru Gagniuc
@ 2018-05-16 22:44 ` Sinan Kaya
  2018-05-16 23:12   ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Sinan Kaya @ 2018-05-16 22:44 UTC (permalink / raw)
  To: Alexandru Gagniuc, bhelgaas
  Cc: alex_gagniuc, austin_bolen, shyam_iyer, Keith Busch,
	Dongdong Liu, linux-pci, linux-kernel

On 5/16/2018 5:33 PM, Alexandru Gagniuc wrote:
> AER status bits are sticky, and they survive system resets. Downstream
> devices are usually taken care of after re-enumerating the downstream
> busses, as the AER bits are cleared during probe().
> 
> However, nothing clears the bits of the port which contained the
> error. These sticky bits may leave some BIOSes to think that something
> bad happened, and print ominous messages on next boot. To prevent this,
> tidy up the AER status bits before releasing containment.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> ---
>  drivers/pci/pcie/dpc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> index 8c57d607e603..bf82d6936556 100644
> --- a/drivers/pci/pcie/dpc.c
> +++ b/drivers/pci/pcie/dpc.c
> @@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
>  		dpc->rp_pio_status = 0;
>  	}
>  
> +	/* DPC event made a mess of our AER status bits. Clean them up. */
> +	pci_cleanup_aer_error_status_regs(pdev);
> +	/* TODO: Should we also use aer_print_error to log the event? */
> +
>  	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
>  		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
>  
> 

I think Keith has a patch to fix this. It was under review at some point.

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

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

* Re: [PATCH] PCI: DPC: Clear AER status bits before disabling port containment
  2018-05-16 22:44 ` Sinan Kaya
@ 2018-05-16 23:12   ` Keith Busch
  2018-06-19 21:57     ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2018-05-16 23:12 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: Alexandru Gagniuc, bhelgaas, alex_gagniuc, austin_bolen,
	shyam_iyer, Dongdong Liu, linux-pci, linux-kernel

On Wed, May 16, 2018 at 06:44:22PM -0400, Sinan Kaya wrote:
> On 5/16/2018 5:33 PM, Alexandru Gagniuc wrote:
> > AER status bits are sticky, and they survive system resets. Downstream
> > devices are usually taken care of after re-enumerating the downstream
> > busses, as the AER bits are cleared during probe().
> > 
> > However, nothing clears the bits of the port which contained the
> > error. These sticky bits may leave some BIOSes to think that something
> > bad happened, and print ominous messages on next boot. To prevent this,
> > tidy up the AER status bits before releasing containment.
> > 
> > Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> > ---
> >  drivers/pci/pcie/dpc.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> > index 8c57d607e603..bf82d6936556 100644
> > --- a/drivers/pci/pcie/dpc.c
> > +++ b/drivers/pci/pcie/dpc.c
> > @@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
> >  		dpc->rp_pio_status = 0;
> >  	}
> >  
> > +	/* DPC event made a mess of our AER status bits. Clean them up. */
> > +	pci_cleanup_aer_error_status_regs(pdev);
> > +	/* TODO: Should we also use aer_print_error to log the event? */
> > +
> >  	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
> >  		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
> >  
> > 
> 
> I think Keith has a patch to fix this. It was under review at some point.

Right, I do intend to following up on this, but I've had some trouble
finding time the last few weeks. Sorry about that, things will clear up
for me shortly.

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

* Re: [PATCH] PCI: DPC: Clear AER status bits before disabling port containment
  2018-05-16 23:12   ` Keith Busch
@ 2018-06-19 21:57     ` Bjorn Helgaas
  2018-06-26 20:51       ` Alex G.
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2018-06-19 21:57 UTC (permalink / raw)
  To: Keith Busch
  Cc: Sinan Kaya, Alexandru Gagniuc, bhelgaas, alex_gagniuc,
	austin_bolen, shyam_iyer, Dongdong Liu, linux-pci, linux-kernel

On Wed, May 16, 2018 at 05:12:21PM -0600, Keith Busch wrote:
> On Wed, May 16, 2018 at 06:44:22PM -0400, Sinan Kaya wrote:
> > On 5/16/2018 5:33 PM, Alexandru Gagniuc wrote:
> > > AER status bits are sticky, and they survive system resets. Downstream
> > > devices are usually taken care of after re-enumerating the downstream
> > > busses, as the AER bits are cleared during probe().
> > > 
> > > However, nothing clears the bits of the port which contained the
> > > error. These sticky bits may leave some BIOSes to think that something
> > > bad happened, and print ominous messages on next boot. To prevent this,
> > > tidy up the AER status bits before releasing containment.
> > > 
> > > Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> > > ---
> > >  drivers/pci/pcie/dpc.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> > > index 8c57d607e603..bf82d6936556 100644
> > > --- a/drivers/pci/pcie/dpc.c
> > > +++ b/drivers/pci/pcie/dpc.c
> > > @@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
> > >  		dpc->rp_pio_status = 0;
> > >  	}
> > >  
> > > +	/* DPC event made a mess of our AER status bits. Clean them up. */
> > > +	pci_cleanup_aer_error_status_regs(pdev);
> > > +	/* TODO: Should we also use aer_print_error to log the event? */
> > > +
> > >  	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
> > >  		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
> > >  
> > > 
> > 
> > I think Keith has a patch to fix this. It was under review at some point.
> 
> Right, I do intend to following up on this, but I've had some trouble
> finding time the last few weeks. Sorry about that, things will clear up
> for me shortly.

I'll drop this (Alexandru's) patch for now, waiting for your update, Keith.

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

* Re: [PATCH] PCI: DPC: Clear AER status bits before disabling port containment
  2018-06-19 21:57     ` Bjorn Helgaas
@ 2018-06-26 20:51       ` Alex G.
  0 siblings, 0 replies; 5+ messages in thread
From: Alex G. @ 2018-06-26 20:51 UTC (permalink / raw)
  To: Bjorn Helgaas, Keith Busch
  Cc: Sinan Kaya, bhelgaas, alex_gagniuc, austin_bolen, shyam_iyer,
	Dongdong Liu, linux-pci, linux-kernel



On 06/19/2018 04:57 PM, Bjorn Helgaas wrote:
> On Wed, May 16, 2018 at 05:12:21PM -0600, Keith Busch wrote:
>> On Wed, May 16, 2018 at 06:44:22PM -0400, Sinan Kaya wrote:
>>> On 5/16/2018 5:33 PM, Alexandru Gagniuc wrote:
>>>> AER status bits are sticky, and they survive system resets. Downstream
>>>> devices are usually taken care of after re-enumerating the downstream
>>>> busses, as the AER bits are cleared during probe().
>>>>
>>>> However, nothing clears the bits of the port which contained the
>>>> error. These sticky bits may leave some BIOSes to think that something
>>>> bad happened, and print ominous messages on next boot. To prevent this,
>>>> tidy up the AER status bits before releasing containment.
>>>>
>>>> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
>>>> ---
>>>>  drivers/pci/pcie/dpc.c | 4 ++++
>>>>  1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
>>>> index 8c57d607e603..bf82d6936556 100644
>>>> --- a/drivers/pci/pcie/dpc.c
>>>> +++ b/drivers/pci/pcie/dpc.c
>>>> @@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
>>>>  		dpc->rp_pio_status = 0;
>>>>  	}
>>>>  
>>>> +	/* DPC event made a mess of our AER status bits. Clean them up. */
>>>> +	pci_cleanup_aer_error_status_regs(pdev);
>>>> +	/* TODO: Should we also use aer_print_error to log the event? */
>>>> +
>>>>  	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
>>>>  		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
>>>>  
>>>>
>>>
>>> I think Keith has a patch to fix this. It was under review at some point.
>>
>> Right, I do intend to following up on this, but I've had some trouble
>> finding time the last few weeks. Sorry about that, things will clear up
>> for me shortly.
> 
> I'll drop this (Alexandru's) patch for now, waiting for your update, Keith.

I wonder if clearing AER status bits is mutually exclusive with
refactoring other parts of DPC handling?

Alex

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

end of thread, other threads:[~2018-06-26 20:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 21:33 [PATCH] PCI: DPC: Clear AER status bits before disabling port containment Alexandru Gagniuc
2018-05-16 22:44 ` Sinan Kaya
2018-05-16 23:12   ` Keith Busch
2018-06-19 21:57     ` Bjorn Helgaas
2018-06-26 20:51       ` Alex G.

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).