[Skiboot] [RFC PATCH 2/5] pci: Don't create -T location codes on non-FSP machines

Daniel Axtens dja at axtens.net
Fri Aug 21 13:13:35 AEST 2015


On Thu, 2015-08-20 at 11:29 +1000, Benjamin Herrenschmidt wrote:
> This is a temporary workaround. We disable the code that adds the
> "-T" portion of the location code to network devices on non-FSP machines.
> 
> This code is a bit fragile, and it does incorrect things on dual-slot
> mezzanines such as the one in Habanero. If we need to support this
> on OpenPower, we will need to add a concept of sibling slots to the
> infrastructure to properly handle the numbering.
> 

The entire code is a messy hack that happens to work but isn't correct
in the general case. (I know this because I wrote it.)

We ultimately need a better way of correctly numbering ports on network
adapters - I think Ben suggested this was usually done by some (Forth?)
code on the card?

> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> ---
>  core/pci.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/core/pci.c b/core/pci.c
> index 479c435..1c2247e 100644
> --- a/core/pci.c
> +++ b/core/pci.c
> @@ -1180,7 +1180,11 @@ static void pci_add_loc_code(struct dt_node *np, struct pci_device *pd)
>  	class_code = dt_prop_get_u32(np, "class-code");
>  	class = class_code >> 16;
>  	sub = (class_code >> 8) & 0xff;
> -	if (class == 0x02 && sub == 0x00) {
> +
> +	/* XXX Don't do that on openpower for now, we will need to sort things
> +	 * out later, otherwise the mezzanine slot on Habanero gets weird results
> +	 */
> +	if (class == 0x02 && sub == 0x00 && fsp_present()) {
>  		/* There's usually several spaces at the end of the property.
>  		   Test for, but don't rely on, that being the case */
>  		len = strlen(blcode);

-- 
Regards,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 860 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20150821/b7961d22/attachment.sig>


More information about the Skiboot mailing list