[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <F54AEECA5E2B9541821D670476DAE19C2B7E8827@PGSMSX102.gar.corp.intel.com>
Date: Mon, 8 Sep 2014 03:10:43 +0000
From: "Kweh, Hock Leong" <hock.leong.kweh@...el.com>
To: 'David Miller' <davem@...emloft.net>
CC: "'peppe.cavallaro@...com'" <peppe.cavallaro@...com>,
"'netdev@...r.kernel.org'" <netdev@...r.kernel.org>,
"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
"Ong, Boon Leong" <boon.leong.ong@...el.com>,
'Rayagond K' <rayagond@...avyalabs.com>
Subject: RE: [PATCH 1/4] net: stmmac: enhance to support multiple device
instances
> -----Original Message-----
> From: Kweh, Hock Leong
> Sent: Saturday, August 30, 2014 11:48 AM
> To: David Miller
> Cc: peppe.cavallaro@...com; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; Ong, Boon Leong; Rayagond K
> Subject: RE: [PATCH 1/4] net: stmmac: enhance to support multiple device
> instances
>
> > From: David Miller [mailto:davem@...emloft.net]
> > Sent: Saturday, August 30, 2014 11:06 AM
> > > From: Kweh Hock Leong <hock.leong.kweh@...el.com>
> > >Date: Wed, 27 Aug 2014 18:32:26 +0800
> > >
> > > +static int instance_id = 1;
> >
> > Don't do this instance stuff. Instead pull in some identifier that
> > can come from elsewhere.
>
> Regarding this, I would like to open up a discussion here. This "instance_id"
> actually is used for registering the mdio bus as a bus id. The original code use
> "1" for the bus id. If the system plug in more than one stmmac pci cards, I
> believe there is conflict on the mdio bus registration. So introduce this static
> global variable is to increase the bus id starting from "1" base on how many
> stmmac pci cards being plugged in.
>
> So, to change the "instance_id" by using some identifier, the only thing come
> to my mind is pci_dev->devfn number. Is anyone have concern about using
> devfn number as an mdio bus id ?
Hi David and everyone,
Just gently ping to see if any concern about the above discussion that
removing the instance_id and use the PCI_DEVID number for the mdio bus
number registration as showed below:
-static void stmmac_default_data(void)
+static void stmmac_default_data(struct plat_stmmacenet_data *plat_dat,
+ struct pci_dev *pdev)
{
- plat_dat.bus_id = 1;
+ plat_dat->bus_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
Looking forward to get inputs from you guys. I will send the 2nd version
by this Wed if no one have concern to this. Thanks.
Regards,
Wilson
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists