public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
To: Lucas Kannebley Tavares <lucaskt@linux•vnet.ibm.com>
Cc: David Airlie <airlied@linux•ie>,
	linux-pci@vger•kernel.org, dri-devel@lists•freedesktop.org,
	Brian King <brking@linux•vnet.ibm.com>,
	Thadeu Cascardo <cascardo@linux•vnet.ibm.com>,
	Bjorn Helgaas <bhelgaas@google•com>,
	Alex Deucher <alexander.deucher@amd•com>,
	linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCHv2 3/3] ppc64: implemented pcibios_get_speed_cap_mask
Date: Wed, 20 Mar 2013 06:39:47 +0100	[thread overview]
Message-ID: <1363757987.18880.31.camel@pasglop> (raw)
In-Reply-To: <1363757079-23550-4-git-send-email-lucaskt@linux.vnet.ibm.com>

On Wed, 2013-03-20 at 02:24 -0300, Lucas Kannebley Tavares wrote:
> Implementation of a architecture-specific pcibios_get_speed_cap_mask.
> This implementation detects bus capabilities based on OF
> ibm,pcie-link-speed-stats property.

The problem with your approach is that it's not a runtime detection...

If the pseries machine is compiled into the kernel binary, it will
override pcibios_get_speed_cap_mask() using the device-tree, regardless
of whether the machine is currently booted on a pseries machine or not.

This wouldn't be a big problem if the pseries
pcibios_get_speed_cap_mask() was capable of doing a fallback to the
generic one if the device-tree property is absent but that isn't the
case.

I think what you need to do is:

  - Make it so the generic one can be called by the override. This can
look a bit tricky but it's better that way. One way to do it is to have
the actual implementation be in a __pci_* variant called by the weak
pcibios_* variant

  - Move the powerpc on to arch/powerpc/kernel/pci-common.c and make
it call a ppc_md.pcibios_get_speed_cap_mask(). If the hook is absent
(NULL), make it call the generic one

  - pseries can then populate the hook in ppc_md. with its custom
variant.

Cheers,
Ben.

  reply	other threads:[~2013-03-20  5:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20  5:24 [PATCHv2 0/3] PCI Speed Cap Fixes for ppc64 Lucas Kannebley Tavares
2013-03-20  5:24 ` [PATCHv2 1/3] pci: added pcie_get_speed_cap_mask function Lucas Kannebley Tavares
2013-03-26 18:39   ` Bjorn Helgaas
2013-03-27 15:25     ` Benjamin Herrenschmidt
2013-03-27 16:58       ` Bjorn Helgaas
2013-03-20  5:24 ` [PATCHv2 2/3] drm: removed drm_pcie_get_speed_cap_mask function Lucas Kannebley Tavares
2013-03-20  5:24 ` [PATCHv2 3/3] ppc64: implemented pcibios_get_speed_cap_mask Lucas Kannebley Tavares
2013-03-20  5:39   ` Benjamin Herrenschmidt [this message]
2013-03-20 15:34 ` [PATCHv2 0/3] PCI Speed Cap Fixes for ppc64 Jerome Glisse

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=1363757987.18880.31.camel@pasglop \
    --to=benh@kernel$(echo .)crashing.org \
    --cc=airlied@linux$(echo .)ie \
    --cc=alexander.deucher@amd$(echo .)com \
    --cc=bhelgaas@google$(echo .)com \
    --cc=brking@linux$(echo .)vnet.ibm.com \
    --cc=cascardo@linux$(echo .)vnet.ibm.com \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=linux-pci@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=lucaskt@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