LinuxPPC-Dev Archive on lore.kernel.org
 help / Atom feed
* [PATCH] powerpc/powernv: Escalate reset when IODA reset fails
@ 2019-02-01  0:42 Oliver O'Halloran
  2019-02-04  4:44 ` Alexey Kardashevskiy
  2019-02-08 13:02 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Oliver O'Halloran @ 2019-02-01  0:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Oliver O'Halloran

The IODA reset is used to flush out any OS controlled state from the PHB.
This reset can fail if a PHB fatal error has occurred in early boot,
probably due to a because of a bad device. We already do a fundemental
reset of the device in some cases, so this patch just adds a test to force
a full reset if firmware reports an error when performing the IODA reset.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 1d6406a..53982f8 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -3943,9 +3943,12 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
 	 * shutdown PCI devices correctly. We already got IODA table
 	 * cleaned out. So we have to issue PHB reset to stop all PCI
 	 * transactions from previous kernel. The ppc_pci_reset_phbs
-	 * kernel parameter will force this reset too.
+	 * kernel parameter will force this reset too. Additionally,
+	 * if the IODA reset above failed then use a bigger hammer.
+	 * This can happen if we get a PHB fatal error in very early
+	 * boot.
 	 */
-	if (is_kdump_kernel() || pci_reset_phbs) {
+	if (is_kdump_kernel() || pci_reset_phbs || rc) {
 		pr_info("  Issue PHB reset ...\n");
 		pnv_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
 		pnv_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
-- 
2.9.4


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

* Re: [PATCH] powerpc/powernv: Escalate reset when IODA reset fails
  2019-02-01  0:42 [PATCH] powerpc/powernv: Escalate reset when IODA reset fails Oliver O'Halloran
@ 2019-02-04  4:44 ` Alexey Kardashevskiy
  2019-02-04  6:04   ` Oliver
  2019-02-08 13:02 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2019-02-04  4:44 UTC (permalink / raw)
  To: Oliver O'Halloran, linuxppc-dev



On 01/02/2019 11:42, Oliver O'Halloran wrote:
> The IODA reset is used to flush out any OS controlled state from the PHB.
> This reset can fail if a PHB fatal error has occurred in early boot,
> probably due to a because of a bad device. We already do a fundemental
> reset of the device in some cases, so this patch just adds a test to force
> a full reset if firmware reports an error when performing the IODA reset.
> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

I am pretty sure I already saw this :-/

ah, anyway

Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>




> ---
>  arch/powerpc/platforms/powernv/pci-ioda.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> index 1d6406a..53982f8 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -3943,9 +3943,12 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
>  	 * shutdown PCI devices correctly. We already got IODA table
>  	 * cleaned out. So we have to issue PHB reset to stop all PCI
>  	 * transactions from previous kernel. The ppc_pci_reset_phbs
> -	 * kernel parameter will force this reset too.
> +	 * kernel parameter will force this reset too. Additionally,
> +	 * if the IODA reset above failed then use a bigger hammer.
> +	 * This can happen if we get a PHB fatal error in very early
> +	 * boot.
>  	 */
> -	if (is_kdump_kernel() || pci_reset_phbs) {
> +	if (is_kdump_kernel() || pci_reset_phbs || rc) {
>  		pr_info("  Issue PHB reset ...\n");
>  		pnv_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
>  		pnv_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
> 

-- 
Alexey

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

* Re: [PATCH] powerpc/powernv: Escalate reset when IODA reset fails
  2019-02-04  4:44 ` Alexey Kardashevskiy
@ 2019-02-04  6:04   ` Oliver
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver @ 2019-02-04  6:04 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: linuxppc-dev

On Mon, Feb 4, 2019 at 3:45 PM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>
>
>
> On 01/02/2019 11:42, Oliver O'Halloran wrote:
> > The IODA reset is used to flush out any OS controlled state from the PHB.
> > This reset can fail if a PHB fatal error has occurred in early boot,
> > probably due to a because of a bad device. We already do a fundemental
> > reset of the device in some cases, so this patch just adds a test to force
> > a full reset if firmware reports an error when performing the IODA reset.
> >
> > Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
>
> I am pretty sure I already saw this :-/

Uh yeah, looks like I posted it a while ago and forgot I did.

>
> ah, anyway
>
> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>
>
>
>
> > ---
> >  arch/powerpc/platforms/powernv/pci-ioda.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> > index 1d6406a..53982f8 100644
> > --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> > +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> > @@ -3943,9 +3943,12 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
> >        * shutdown PCI devices correctly. We already got IODA table
> >        * cleaned out. So we have to issue PHB reset to stop all PCI
> >        * transactions from previous kernel. The ppc_pci_reset_phbs
> > -      * kernel parameter will force this reset too.
> > +      * kernel parameter will force this reset too. Additionally,
> > +      * if the IODA reset above failed then use a bigger hammer.
> > +      * This can happen if we get a PHB fatal error in very early
> > +      * boot.
> >        */
> > -     if (is_kdump_kernel() || pci_reset_phbs) {
> > +     if (is_kdump_kernel() || pci_reset_phbs || rc) {
> >               pr_info("  Issue PHB reset ...\n");
> >               pnv_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
> >               pnv_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
> >
>
> --
> Alexey

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

* Re: powerpc/powernv: Escalate reset when IODA reset fails
  2019-02-01  0:42 [PATCH] powerpc/powernv: Escalate reset when IODA reset fails Oliver O'Halloran
  2019-02-04  4:44 ` Alexey Kardashevskiy
@ 2019-02-08 13:02 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2019-02-08 13:02 UTC (permalink / raw)
  To: Oliver O'Halloran, linuxppc-dev; +Cc: Oliver O'Halloran

On Fri, 2019-02-01 at 00:42:01 UTC, Oliver O'Halloran wrote:
> The IODA reset is used to flush out any OS controlled state from the PHB.
> This reset can fail if a PHB fatal error has occurred in early boot,
> probably due to a because of a bad device. We already do a fundemental
> reset of the device in some cases, so this patch just adds a test to force
> a full reset if firmware reports an error when performing the IODA reset.
> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/b174b4fb919d118d9ac546b99a69574d

cheers

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-01  0:42 [PATCH] powerpc/powernv: Escalate reset when IODA reset fails Oliver O'Halloran
2019-02-04  4:44 ` Alexey Kardashevskiy
2019-02-04  6:04   ` Oliver
2019-02-08 13:02 ` Michael Ellerman

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org linuxppc-dev@archiver.kernel.org
	public-inbox-index linuxppc-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox