public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman•id.au>
To: Sam Bobroff <sbobroff@linux•ibm.com>, linuxppc-dev@lists•ozlabs.org
Cc: aik@ozlabs•ru, oohall@gmail•com, tyreld@linux•vnet.ibm.com
Subject: Re: [PATCH v5 01/12] powerpc/64: Adjust order in pcibios_init()
Date: Wed, 28 Aug 2019 14:24:49 +1000 (AEST)	[thread overview]
Message-ID: <46JCM52SJqz9sNy@ozlabs.org> (raw)
In-Reply-To: <4506b0489eabd0921a3587d90bd44c7683f3472d.1565930772.git.sbobroff@linux.ibm.com>

On Fri, 2019-08-16 at 04:48:05 UTC, Sam Bobroff wrote:
> The pcibios_init() function for PowerPC 64 currently calls
> pci_bus_add_devices() before pcibios_resource_survey(). This means
> that at boot time, when the pcibios_bus_add_device() hooks are called
> by pci_bus_add_devices(), device resources have not been allocated and
> they are unable to perform EEH setup, so a separate pass is needed.
> 
> This patch adjusts that order so that it will become possible to
> consolidate the EEH setup work into a single location.
> 
> The only functional change is to execute pcibios_resource_survey()
> (excepting ppc_md.pcibios_fixup(), see below) before
> pci_bus_add_devices() instead of after it.
> 
> Because pcibios_scan_phb() and pci_bus_add_devices() are called
> together in a loop, this must be broken into one loop for each call.
> Then the call to pcibios_resource_survey() is moved up in between
> them. This changes the ordering but because pcibios_resource_survey()
> also calls ppc_md.pcibios_fixup(), that call is extracted out into
> pcibios_init() to where pcibios_resource_survey() was, so that it is
> not moved.
> 
> The only other caller of pcibios_resource_survey() is the PowerPC 32
> version of pcibios_init(), and therefore, that is modified to call
> ppc_md.pcibios_fixup() right after pcibios_resource_survey() so that
> there is no functional change there at all.
> 
> The re-arrangement will cause very few side-effects because at this
> stage in the boot, pci_bus_add_devices() does very little:
> - pci_create_sysfs_dev_files() does nothing (no sysfs yet)
> - pci_proc_attach_device() does nothing (no proc yet)
> - device_attach() does nothing (no drivers yet)
> This leaves only the pci_final_fixup calls, D3 support, and marking
> the device as added. Of those, only the pci_final_fixup calls have the
> potential to be affected by resource allocation.
> 
> The only pci_final_fixup handlers that touch resources seem to be one
> for x86 (pci_amd_enable_64bit_bar()), and a PowerPC 32 platform driver
> (quirk_final_uli1575()), neither of which use this pcibios_init()
> function. Even if they did, it would almost certainly be a bug, under
> the current ordering, to rely on or make changes to resources before
> they were allocated.
> 
> Signed-off-by: Sam Bobroff <sbobroff@linux•ibm.com>
> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs•ru>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/3f068aae7a958555533847af88705b5629f31600

cheers

  reply	other threads:[~2019-08-28  4:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16  4:48 [PATCH v5 00/12] Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 01/12] powerpc/64: Adjust order in pcibios_init() Sam Bobroff
2019-08-28  4:24   ` Michael Ellerman [this message]
2019-08-16  4:48 ` [PATCH v5 02/12] powerpc/eeh: Clear stale EEH_DEV_NO_HANDLER flag Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 03/12] powerpc/eeh: Improve debug messages around device addition Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 04/12] powerpc/eeh: Initialize EEH address cache earlier Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 05/12] powerpc/eeh: EEH for pSeries hot plug Sam Bobroff
2019-08-21  3:28   ` Michael Ellerman
2019-08-22  6:17     ` [PATCH] powerpc/eeh: Fixup EEH for pSeries hotplug Sam Bobroff
2019-09-19 20:28   ` [PATCH v5 05/12] powerpc/eeh: EEH for pSeries hot plug Nathan Lynch
2019-09-19 23:27     ` Oliver O'Halloran
2019-09-19 23:44       ` Nathan Lynch
2019-09-23  5:00     ` Sam Bobroff
2019-09-23 18:01       ` Nathan Lynch
2019-08-16  4:48 ` [PATCH v5 06/12] powerpc/eeh: Refactor around eeh_probe_devices() Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 07/12] powerpc/eeh: Add bdfn field to eeh_dev Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 08/12] powerpc/eeh: Introduce EEH edev logging macros Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 09/12] powerpc/eeh: Convert log messages to eeh_edev_* macros Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 10/12] powerpc/eeh: Fix crash when edev->pdev changes Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 11/12] powerpc/eeh: Remove unused return path from eeh_pe_dev_traverse() Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 12/12] powerpc/eeh: Slightly simplify eeh_add_to_parent_pe() Sam Bobroff

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=46JCM52SJqz9sNy@ozlabs.org \
    --to=patch-notifications@ellerman$(echo .)id.au \
    --cc=aik@ozlabs$(echo .)ru \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=oohall@gmail$(echo .)com \
    --cc=sbobroff@linux$(echo .)ibm.com \
    --cc=tyreld@linux$(echo .)vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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