All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
To: Jiri Slaby <jslaby@suse.cz>, stable@vger.kernel.org
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Gavin Shan <gwshan@linux.vnet.ibm.com>
Subject: Re: [patch added to 3.12-stable] powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism
Date: Tue, 12 Jul 2016 09:35:49 -0300	[thread overview]
Message-ID: <5784E425.8070706@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160712094129.25202-39-jslaby@suse.cz>

On 07/12/2016 06:41 AM, Jiri Slaby wrote:
> From: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
>
> This patch has been added to the 3.12 stable tree. If you have any
> objections, please let us know.
>

Jiri, thanks for letting me know. If you added this on 3.12, you need to 
add another commit (that has a fix to this one): 8a934efe9434 
("powerpc/pseries: Fix PCI config address for DDW")

I'm not sure if you already added 8a934efe9434, but in any case I found 
useful to warn you.

Cheers,


Guilherme


> ===============
>
> commit 8445a87f7092bc8336ea1305be9306f26b846d93 upstream.
>
> Commit 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
> changed the pci_dn struct by removing its EEH-related members.
> As part of this clean-up, DDW mechanism was modified to read the device
> configuration address from eeh_dev struct.
>
> As a consequence, now if we disable EEH mechanism on kernel command-line
> for example, the DDW mechanism will fail, generating a kernel oops by
> dereferencing a NULL pointer (which turns to be the eeh_dev pointer).
>
> This patch just changes the configuration address calculation on DDW
> functions to a manual calculation based on pci_dn members instead of
> using eeh_dev-based address.
>
> No functional changes were made. This was tested on pSeries, both
> in PHyp and qemu guest.
>
> Fixes: 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
>   arch/powerpc/platforms/pseries/iommu.c | 24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
> index 261c5095d5d3..88cbecbdbd6f 100644
> --- a/arch/powerpc/platforms/pseries/iommu.c
> +++ b/arch/powerpc/platforms/pseries/iommu.c
> @@ -861,7 +861,8 @@ machine_arch_initcall(pseries, find_existing_ddw_windows);
>   static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
>   			struct ddw_query_response *query)
>   {
> -	struct eeh_dev *edev;
> +	struct device_node *dn;
> +	struct pci_dn *pdn;
>   	u32 cfg_addr;
>   	u64 buid;
>   	int ret;
> @@ -872,11 +873,10 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
>   	 * Retrieve them from the pci device, not the node with the
>   	 * dma-window property
>   	 */
> -	edev = pci_dev_to_eeh_dev(dev);
> -	cfg_addr = edev->config_addr;
> -	if (edev->pe_config_addr)
> -		cfg_addr = edev->pe_config_addr;
> -	buid = edev->phb->buid;
> +	dn = pci_device_to_OF_node(dev);
> +	pdn = PCI_DN(dn);
> +	buid = pdn->phb->buid;
> +	cfg_addr = (pdn->busno << 8) | pdn->devfn;
>
>   	ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query,
>   		  cfg_addr, BUID_HI(buid), BUID_LO(buid));
> @@ -890,7 +890,8 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
>   			struct ddw_create_response *create, int page_shift,
>   			int window_shift)
>   {
> -	struct eeh_dev *edev;
> +	struct device_node *dn;
> +	struct pci_dn *pdn;
>   	u32 cfg_addr;
>   	u64 buid;
>   	int ret;
> @@ -901,11 +902,10 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
>   	 * Retrieve them from the pci device, not the node with the
>   	 * dma-window property
>   	 */
> -	edev = pci_dev_to_eeh_dev(dev);
> -	cfg_addr = edev->config_addr;
> -	if (edev->pe_config_addr)
> -		cfg_addr = edev->pe_config_addr;
> -	buid = edev->phb->buid;
> +	dn = pci_device_to_OF_node(dev);
> +	pdn = PCI_DN(dn);
> +	buid = pdn->phb->buid;
> +	cfg_addr = (pdn->busno << 8) | pdn->devfn;
>
>   	do {
>   		/* extra outputs are LIOBN and dma-addr (hi, lo) */
>


  reply	other threads:[~2016-07-12 12:36 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  9:40 [patch added to 3.12-stable] macintosh/therm_windtunnel: Export I2C module alias information Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] drivers: macintosh: rack-meter: limit idle ticks to total ticks Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] KVM: x86: fix OOPS after invalid KVM_SET_DEBUGREGS Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] ARM: fix PTRACE_SETVFPREGS on SMP systems Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] powerpc: Fix definition of SIAR and SDAR registers Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] powerpc: Use privileged SPR number for MMCR2 Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] parisc: Fix pagefault crash in unaligned __get_user() call Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] ecryptfs: forbid opening files without mmap handler Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] fix d_walk()/non-delayed __d_free() race Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: don't move to non-existent next rule Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: validate targets of jumps Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: add and use xt_check_entry_offsets Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: kill check_entry helper Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: assert minimum target size Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: add compat version of xt_check_entry_offsets Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: check standard target size too Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: check for bogus target offset Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: validate all offsets and sizes in a rule Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: x_tables: don't reject valid target size on some architectures Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: arp_tables: simplify translate_compat_table args Jiri Slaby
2016-07-12  9:40 ` [patch added to 3.12-stable] netfilter: ip_tables: " Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] netfilter: ip6_tables: " Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] netfilter: x_tables: xt_compat_match_from_user doesn't need a retval Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] netfilter: ensure number of counters is >0 in do_replace() Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] netfilter: x_tables: do compat validation via translate_table Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] Revert "netfilter: ensure number of counters is >0 in do_replace()" Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] netfilter: x_tables: introduce and use xt_copy_counters_from_user Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] crypto: ux500 - memmove the right size Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] sit: correct IP protocol used in ipip6_err Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] ipmr/ip6mr: Initialize the last assert time of mfc entries Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] net: alx: Work around the DMA RX overflow issue Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] usb: quirks: Add no-lpm quirk for Acer C120 LED Projector Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] usb: musb: Stop bulk endpoint while queue is rotated Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] usb: musb: Ensure rx reinit occurs for shared_fifo endpoints Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] mac80211: mesh: flush mesh paths unconditionally Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] mac80211_hwsim: Add missing check for HWSIM_ATTR_SIGNAL Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] IB/mlx4: Properly initialize GRH TClass and FlowLabel in AHs Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism Jiri Slaby
2016-07-12 12:35   ` Guilherme G. Piccoli [this message]
2016-07-12 13:03     ` Jiri Slaby
2016-07-12 13:20       ` Guilherme G. Piccoli
2016-07-12  9:41 ` [patch added to 3.12-stable] powerpc/pseries: Fix PCI config address for DDW Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] powerpc/tm: Always reclaim in start_thread() for exec() class syscalls Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] USB: EHCI: declare hostpc register as zero-length array Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] x86, build: copy ldlinux.c32 to image.iso Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] kprobes/x86: Clear TF bit in fault on single-stepping Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] x86/amd_nb: Fix boot crash on non-AMD systems Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] make nfs_atomic_open() call d_drop() on all ->open_context() errors Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] NFS: Fix another OPEN_DOWNGRADE bug Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] ARM: 8578/1: mm: ensure pmd_present only checks the valid bit Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] mm: Export migrate_page_move_mapping and migrate_page_copy Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] UBIFS: Implement ->migratepage() Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] scsi: remove scsi_end_request Jiri Slaby
2016-07-12  9:41 ` [patch added to 3.12-stable] scsi_lib: correctly retry failed zero length REQ_TYPE_FS commands Jiri Slaby

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=5784E425.8070706@linux.vnet.ibm.com \
    --to=gpiccoli@linux.vnet.ibm.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=jslaby@suse.cz \
    --cc=mpe@ellerman.id.au \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.