* [PATCH v3] powerpc/powernv: Add ppc_pci_reset_phbs parameter to issue a PHB reset
@ 2017-11-17 18:58 Guilherme G. Piccoli
2018-01-22 3:34 ` [v3] " Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Guilherme G. Piccoli @ 2017-11-17 18:58 UTC (permalink / raw)
To: linuxppc-dev; +Cc: gpiccoli, paulus, mpe, benh, bsingharora
During a kdump kernel boot in PowerPC, we request a reset of the PHBs
to the FW. It makes sense, since if we are booting a kdump kernel it
means we had some trouble before and we cannot rely in the adapters'
health; they could be in a bad state, hence the reset is needed.
But this reset is useful not only in kdump - there are situations,
specially when debugging drivers, that we could break an adapter in
a way it requires such reset. One can tell to just go ahead and
reboot the machine, but happens that many times doing kexec is much
faster, and so preferable than a full power cycle.
This patch adds the ppc_pci_reset_phbs parameter to perform such reset.
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
---
* v3: Changed parameter name, adding prefix "ppc_" [mpe suggestion]
arch/powerpc/platforms/powernv/pci-ioda.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index fb5cd7511189..19f1b0021585 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -89,6 +89,7 @@ void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level,
}
static bool pnv_iommu_bypass_disabled __read_mostly;
+static bool pci_reset_phbs __read_mostly;
static int __init iommu_setup(char *str)
{
@@ -110,6 +111,14 @@ static int __init iommu_setup(char *str)
}
early_param("iommu", iommu_setup);
+static int __init pci_reset_phbs_setup(char *str)
+{
+ pci_reset_phbs = true;
+ return 0;
+}
+
+early_param("ppc_pci_reset_phbs", pci_reset_phbs_setup);
+
static inline bool pnv_pci_is_m64(struct pnv_phb *phb, struct resource *r)
{
/*
@@ -4014,9 +4023,10 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
* If we're running in kdump kernel, the previous kernel never
* 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.
+ * transactions from previous kernel. The ppc_pci_reset_phbs
+ * kernel parameter will force this reset too.
*/
- if (is_kdump_kernel()) {
+ if (is_kdump_kernel() || pci_reset_phbs) {
pr_info(" Issue PHB reset ...\n");
pnv_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
pnv_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
--
2.15.0.rc0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [v3] powerpc/powernv: Add ppc_pci_reset_phbs parameter to issue a PHB reset
2017-11-17 18:58 [PATCH v3] powerpc/powernv: Add ppc_pci_reset_phbs parameter to issue a PHB reset Guilherme G. Piccoli
@ 2018-01-22 3:34 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-01-22 3:34 UTC (permalink / raw)
To: Guilherme G. Piccoli, linuxppc-dev; +Cc: paulus, gpiccoli
On Fri, 2017-11-17 at 18:58:59 UTC, "Guilherme G. Piccoli" wrote:
> During a kdump kernel boot in PowerPC, we request a reset of the PHBs
> to the FW. It makes sense, since if we are booting a kdump kernel it
> means we had some trouble before and we cannot rely in the adapters'
> health; they could be in a bad state, hence the reset is needed.
>
> But this reset is useful not only in kdump - there are situations,
> specially when debugging drivers, that we could break an adapter in
> a way it requires such reset. One can tell to just go ahead and
> reboot the machine, but happens that many times doing kexec is much
> faster, and so preferable than a full power cycle.
>
> This patch adds the ppc_pci_reset_phbs parameter to perform such reset.
>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/45baee1416a0086dccaa8a94c70e67
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-22 3:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 18:58 [PATCH v3] powerpc/powernv: Add ppc_pci_reset_phbs parameter to issue a PHB reset Guilherme G. Piccoli
2018-01-22 3:34 ` [v3] " Michael Ellerman
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).