From: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc/powernv: Add pci_reset_phbs parameter to issue a PHB reset
Date: Thu, 9 Nov 2017 19:33:56 -0200 [thread overview]
Message-ID: <f534cf16-d7f8-cfbb-5f81-df7b297683b9@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171025152754.25166-1-gpiccoli@linux.vnet.ibm.com>
On 10/25/2017 01:27 PM, 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 pci_reset_phbs parameter to perform such reset
> when desired by the user.
>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
> ---
> v2: changed name of the parameter [ben/mpe suggestion].
>
> The patch was implemented against powerpc/next.
Hi Michael/Ben...any thoughts about this one?
Thanks in advance!
>
> 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..6070e0d4a7f3 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("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 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);
>
next prev parent reply other threads:[~2017-11-09 21:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-25 15:27 [PATCH v2] powerpc/powernv: Add pci_reset_phbs parameter to issue a PHB reset Guilherme G. Piccoli
2017-11-09 21:33 ` Guilherme G. Piccoli [this message]
2017-11-13 4:25 ` Michael Ellerman
2017-11-16 3:49 ` Balbir Singh
2017-11-16 12:14 ` Guilherme G. Piccoli
2017-11-21 2:35 ` Balbir Singh
2017-12-06 19:28 ` Guilherme G. Piccoli
2017-12-08 12:03 ` Michael Ellerman
2017-12-08 18:43 ` Guilherme G. Piccoli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f534cf16-d7f8-cfbb-5f81-df7b297683b9@linux.vnet.ibm.com \
--to=gpiccoli@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).