Re: [RFC net] net: dsa: Add missing reference counting

2020-05-07 Thread Andrew Lunn
On Wed, May 06, 2020 at 02:24:14PM -0700, Florian Fainelli wrote: > > > On 5/5/2020 2:23 PM, Vivien Didelot wrote: > > On Tue, 5 May 2020 14:02:53 -0700, Florian Fainelli > > wrote: > >> If we are probed through platform_data we would be intentionally > >> dropping the reference count on maste

Re: [RFC net] net: dsa: Add missing reference counting

2020-05-06 Thread Vladimir Oltean
On Thu, 7 May 2020 at 01:45, Florian Fainelli wrote: > > > > On 5/6/2020 2:40 PM, Vladimir Oltean wrote: > > Hi Florian, > > > > On Thu, 7 May 2020 at 00:24, Florian Fainelli wrote: > >> > >> > >> > >> On 5/5/2020 2:23 PM, Vivien Didelot wrote: > >>> On Tue, 5 May 2020 14:02:53 -0700, Florian Fa

Re: [RFC net] net: dsa: Add missing reference counting

2020-05-06 Thread Florian Fainelli
On 5/6/2020 2:40 PM, Vladimir Oltean wrote: > Hi Florian, > > On Thu, 7 May 2020 at 00:24, Florian Fainelli wrote: >> >> >> >> On 5/5/2020 2:23 PM, Vivien Didelot wrote: >>> On Tue, 5 May 2020 14:02:53 -0700, Florian Fainelli >>> wrote: If we are probed through platform_data we would b

Re: [RFC net] net: dsa: Add missing reference counting

2020-05-06 Thread Vladimir Oltean
Hi Florian, On Thu, 7 May 2020 at 00:24, Florian Fainelli wrote: > > > > On 5/5/2020 2:23 PM, Vivien Didelot wrote: > > On Tue, 5 May 2020 14:02:53 -0700, Florian Fainelli > > wrote: > >> If we are probed through platform_data we would be intentionally > >> dropping the reference count on mast

Re: [RFC net] net: dsa: Add missing reference counting

2020-05-06 Thread Florian Fainelli
On 5/5/2020 2:23 PM, Vivien Didelot wrote: > On Tue, 5 May 2020 14:02:53 -0700, Florian Fainelli > wrote: >> If we are probed through platform_data we would be intentionally >> dropping the reference count on master after dev_to_net_device() >> incremented it. If we are probed through Device

Re: [RFC net] net: dsa: Add missing reference counting

2020-05-05 Thread Vivien Didelot
On Tue, 5 May 2020 14:02:53 -0700, Florian Fainelli wrote: > If we are probed through platform_data we would be intentionally > dropping the reference count on master after dev_to_net_device() > incremented it. If we are probed through Device Tree, > of_find_net_device() does not do a dev_hold()

[RFC net] net: dsa: Add missing reference counting

2020-05-05 Thread Florian Fainelli
If we are probed through platform_data we would be intentionally dropping the reference count on master after dev_to_net_device() incremented it. If we are probed through Device Tree, of_find_net_device() does not do a dev_hold() at all. Ensure that the DSA master device is properly reference coun