RE: [PATCH v2 3/4] net: stmmac: add support for Intel Quark X1000

From: Kweh, Hock Leong
Date: Mon Sep 15 2014 - 08:43:59 EST


> -----Original Message-----
> From: David Miller [mailto:davem@xxxxxxxxxxxxx]
> Sent: Saturday, September 13, 2014 6:14 AM
> From: Kweh Hock Leong <hock.leong.kweh@xxxxxxxxx>
> Date: Thu, 11 Sep 2014 16:38:39 +0800
>
> > + if ((!strcmp(quark_x1000_phy_info[i].board_name,
> board_name)) &&
> > + quark_x1000_phy_info[i].pci_func_num == func_num)
>
> It is entirely erroneous to identify a device by it's _PHYSICAL_ geographic
> location on the PCI bus.
>
> Please get rid of this PCI function number comparison and if necessary find
> another means of identification.

Hi David,

Here is some background of this work. Intel Quark X1000 has 2 stmmac Ethernet IP
built in the SoC. They both are using the same PCI DEVICE ID number. The only things
to differentiate them is PCI BUS DEVICE FUNCTION (Bus:Dev:Func) number which are
fix numbers 00:20:6 for port 1 and 00:20:7 for port 2 stated in Quark X1000 datasheet.
(https://communities.intel.com/docs/DOC-23092 page 44 & 97)

When I was looking into making the code to upstream, I do think about is there a better
identification way to do it? But, my mind still brought me back to this PCI FUNC number.

So, i would like to understand the concern of using PCI FUNC number and also would like
to see is there any advices, suggestion or pointer to deal with the scenario here.

Appreciate to the comments sharing. Thanks.


Regards,
Wilson
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/