[Skiboot] [PATCH] pci: Add -Tn to SAS adapter's loc-code

Ananth N Mavinakayanahalli ananth at linux.vnet.ibm.com
Fri Mar 3 13:20:52 AEDT 2017


On Fri, Mar 03, 2017 at 10:54:42AM +1100, Gavin Shan wrote:
> This adds -Tn to the device-tree node's loc-code property for SAS
> adaptr as we did for ethernet adapter in commit 6558adff01bb ("
> Add -Tn to ibm,loc-code for ethernet adaptors"). "n" represents
> the function number of the PCI device.

This would mean that the "n" would not necessarily be contiguous or
start from 0 -- like what phyp does. Is that OK?

> Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
> ---
>  core/pci.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/core/pci.c b/core/pci.c
> index 9889dbf..6c8f65c 100644
> --- a/core/pci.c
> +++ b/core/pci.c
> @@ -1288,7 +1288,9 @@ static void pci_add_loc_code(struct dt_node *np, struct pci_device *pd)
>  	/* 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()) {
> +	if (fsp_present() &&
> +	    ((class == 0x02 && sub == 0x00) ||	/* Ethernet */
> +	     (class == 0x01 && sub == 0x07))) {	/* SAS      */
>  		/* 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);
> -- 
> 2.7.4
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot



More information about the Skiboot mailing list