RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-03-24 Thread Florian Fainelli
On March 24, 2016 2:16:30 PM PDT, bryan.whiteh...@microchip.com wrote: >> -Original Message- >Hi Andrew, > >Sorry to bother you with this. But I'm having major difficulty with >getting my dsa driver entry points called. > >Here is what I've done so far. > >I copied

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-03-24 Thread Andrew Lunn
> It appears the dsa.c is not able to attach my underlying net > device. And that seems to be due to it is unable to find the > mdio_bus. > So I modified my net device driver so that in probe it calls > of_mdiobus_register instead of mdiobus_register. > And of_mdiobus_register seems to be

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-03-24 Thread Bryan.Whitehead
> -Original Message- > From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Friday, February 19, 2016 3:14 PM > > I'm not yet sure how it attaches to the underlying Ethernet driver. > > The DSA core does that for you. If you look at the device tree > binding: > > dsa@0 { >

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-19 Thread Bryan.Whitehead
Thanks Andrew, Your tips are much appreciated. Bryan

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-19 Thread Andrew Lunn
On Fri, Feb 19, 2016 at 07:29:46PM +, bryan.whiteh...@microchip.com wrote: > > From: Andrew Lunn [mailto:and...@lunn.ch] > > Sent: Tuesday, February 16, 2016 5:16 PM > > > > You are already 1/2 way to a DSA driver, since you have a MAC driver. So i > > agree with David, do it right and add a

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-19 Thread Bryan.Whitehead
> From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Tuesday, February 16, 2016 5:16 PM > > You are already 1/2 way to a DSA driver, since you have a MAC driver. So i > agree with David, do it right and add a simple DSA driver. > Andrew, I've done a little research on DSA. I've read

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Andrew Lunn
> Even if your driver does not support tagging Looking at the data sheet, it looks like the hardware does support tagging. You add an extra "VLAN" tag, whos bits have very little to do with VLANs. So a new tag implementation will be needed, but that is not hard. Andrew

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Florian Fainelli
On 16/02/16 14:15, Andrew Lunn wrote: >> I just spoke with my manager, and we would like to change the target >> device from LAN9352 to LAN9250. The LAN9250 is the same as the >> LAN9352 but without the switch. It has one mac and one phy. > > It is not so easy to get an overview from the website,

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Andrew Lunn
> I just spoke with my manager, and we would like to change the target > device from LAN9352 to LAN9250. The LAN9250 is the same as the > LAN9352 but without the switch. It has one mac and one phy. It is not so easy to get an overview from the website, but it looks like: LAN9250 - one port

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Lino Sanfilippo
On 12.02.2016 20:10, bryan.whiteh...@microchip.com wrote: > Lino, > > Regarding "a matching smp_rmb() in the irq handler" > There is a smp_wmb() in the irq handler, since in both cases we are forcing a > write operation on software_irq_signal. > > I suppose using atomic operations on

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread David Miller
From: Date: Tue, 16 Feb 2016 21:37:40 + > Again, I'd like to change our target device to LAN9250, which is just an > Ethernet controller with no switch. > > Will a driver for that device be more easily accepted? No, please just implement your driver

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread David Miller
From: Date: Tue, 16 Feb 2016 21:32:20 + > I just spoke with my manager, and we would like to change the target > device from LAN9352 to LAN9250. The LAN9250 is the same as the > LAN9352 but without the switch. It has one mac and one phy. > > Since there is no

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Bryan.Whitehead
> From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Tuesday, February 16, 2016 3:58 PM > > I believe I can make the physical phys accessible through ethertool. > > Would that be reasonable? > > How, you have no netdev to attach them to? > > There was a nice presentation at netdev last week by

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Bryan.Whitehead
> From: David Miller [mailto:da...@davemloft.net] > Sent: Tuesday, February 16, 2016 3:53 PM > >> > >> I do not think, with all the infrastructure we have, that we should > >> accept pure ethernet drivers for such devices any more. > >> > >> About year ago I would have responded differently, but

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Andrew Lunn
> I believe I can make the physical phys accessible through > ethertool. Would that be reasonable? How, you have no netdev to attach them to? There was a nice presentation at netdev last week by Mellanox about their switches. I don't know if the video is available yet, but that shows the correct

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread David Miller
C21958; f.faine...@gmail.com; netdev@vger.kernel.org >> Subject: Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver >> >> From: Andrew Lunn <and...@lunn.ch> >> Date: Tue, 16 Feb 2016 21:36:25 +0100 >> >> > So this is the discussion we need to have. >> > &g

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Bryan.Whitehead
> -Original Message- > From: David Miller [mailto:da...@davemloft.net] > Sent: Tuesday, February 16, 2016 3:44 PM > To: and...@lunn.ch > Cc: Bryan Whitehead - C21958; f.faine...@gmail.com; netdev@vger.kernel.org > Subject: Re: [PATCH net-next,V2] Add LAN9352 Etherne

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread David Miller
From: Andrew Lunn Date: Tue, 16 Feb 2016 21:36:25 +0100 > So this is the discussion we need to have. > > The interface to the outside work is the two switch ports with real > PHYs. What you are implementing is an Ethernet driver for an internal > port connected to the switch.

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Andrew Lunn
On Tue, Feb 16, 2016 at 07:41:46PM +, bryan.whiteh...@microchip.com wrote: > Andrew, > > At this point, I am not tasked with implementing switch features, > which would likely take a long time to complete. So this is the discussion we need to have. The interface to the outside work is the

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Andrew Lunn
So you mean mdiobus_scan() http://lxr.free-electrons.com/source/drivers/net/phy/mdio_bus.c#L349 actually finds three PHY devices. Two are real phys with magnetics and somewhere to attach a copper cable, and one is virtual. This is non-obvious. I think it would be good to add some ASCII art to

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread David Miller
Please stop top-posting. Thank you.

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread David Miller
From: Date: Tue, 16 Feb 2016 19:34:26 + > Hi Andrew, > > You can find my comments below wrapped in ... Do not do this. Please reply to emails appropriately, which means proper quotation and no top-posting. Look at how other people reply to postings on

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Bryan.Whitehead
a single port ethernet controller. Bryan -Original Message- From: Andrew Lunn [mailto:and...@lunn.ch] Sent: Friday, February 12, 2016 12:18 PM To: Bryan Whitehead - C21958 Cc: f.faine...@gmail.com; da...@davemloft.net; netdev@vger.kernel.org Subject: Re: [PATCH net-next,V2] Add LAN9352

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-16 Thread Bryan.Whitehead
Hi Andrew, You can find my comments below wrapped in ... -Original Message- From: Andrew Lunn [mailto:and...@lunn.ch] Sent: Friday, February 12, 2016 12:11 PM To: Bryan Whitehead - C21958 Cc: da...@davemloft.net; netdev@vger.kernel.org Subject: Re: [PATCH net-next,V2] Add LAN9352

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-12 Thread Andrew Lunn
> At this point my plan is to just get a basic Ethernet controller > driver submitted, and later work on switch features. They are not really separable. The linux way of dealing with switches is to model each port as a net device. So you should have a lan0 device and a lan1 device for this two

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-12 Thread Bryan.Whitehead
- From: Andrew Lunn [mailto:and...@lunn.ch] Sent: Thursday, February 11, 2016 4:55 PM To: Bryan Whitehead - C21958 Cc: da...@davemloft.net; netdev@vger.kernel.org Subject: Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver On Thu, Feb 11, 2016 at 06:58:52PM +, bryan.whiteh...@microchip.com

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-12 Thread Andrew Lunn
On Fri, Feb 12, 2016 at 04:51:49PM +, bryan.whiteh...@microchip.com wrote: > Hi Andrew, > > Sorry I still did not make this clear. And I'm not sure I understand your > question so I'll try to explain again, but please give me feedback if it's > still not clear. > > Also you can reference

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-12 Thread Bryan.Whitehead
, and later work on switch features. Regards, Bryan -Original Message- From: Andrew Lunn [mailto:and...@lunn.ch] Sent: Friday, February 12, 2016 2:21 AM To: Florian Fainelli Cc: Bryan Whitehead - C21958; da...@davemloft.net; netdev@vger.kernel.org Subject: Re: [PATCH net-next,V2] Add LAN9352

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-12 Thread Bryan.Whitehead
set. Thanks, Bryan -Original Message- From: Lino Sanfilippo [mailto:linosanfili...@gmx.de] Sent: Thursday, February 11, 2016 7:14 PM To: Bryan Whitehead - C21958; da...@davemloft.net Cc: netdev@vger.kernel.org Subject: Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver Hi, > +s

RE: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-12 Thread Bryan.Whitehead
: netdev@vger.kernel.org; Andrew Lunn Subject: Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver On 11/02/16 10:58, bryan.whiteh...@microchip.com wrote: > This is the initial submission of an ethernet driver for the Microchip > LAN9352. > > The LAN9352 is a 2-Port 10/100 Managed Eth

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-11 Thread Andrew Lunn
On Thu, Feb 11, 2016 at 06:18:25PM -0800, Florian Fainelli wrote: > On 11/02/16 10:58, bryan.whiteh...@microchip.com wrote: > > This is the initial submission of an ethernet driver for > > the Microchip LAN9352. > > > > The LAN9352 is a 2-Port 10/100 Managed Ethernet Switch with > > 16-Bit

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-11 Thread Lino Sanfilippo
Hi, > +static int mchp9352_open(struct net_device *dev) > +{ > + > + MCHP_TRACE(pdata, ifup, "Testing irq handler using IRQ %d", dev->irq); > + pdata->software_irq_signal = 0; > + > + /* Testing irq handler */ > + smp_wmb(); Should not there at least be a matching smp_rmb() in

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-11 Thread Andrew Lunn
On Thu, Feb 11, 2016 at 06:58:52PM +, bryan.whiteh...@microchip.com wrote: > This is the initial submission of an ethernet driver for > the Microchip LAN9352. > > The LAN9352 is a 2-Port 10/100 Managed Ethernet Switch with > 16-Bit Non-PCI CPU Interface. The CPU interface includes a basic >

Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

2016-02-11 Thread Florian Fainelli
On 11/02/16 10:58, bryan.whiteh...@microchip.com wrote: > This is the initial submission of an ethernet driver for > the Microchip LAN9352. > > The LAN9352 is a 2-Port 10/100 Managed Ethernet Switch with > 16-Bit Non-PCI CPU Interface. The CPU interface includes a basic > ethernet controller