public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vivien Didelot <vivien.didelot@gmail.com>
Cc: netdev@vger.kernel.org, olteanv@gmail.com,
	Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC net] net: dsa: Add missing reference counting
Date: Wed, 6 May 2020 14:24:14 -0700	[thread overview]
Message-ID: <d681a82b-5d4b-457f-56de-3a439399cb3d@gmail.com> (raw)
In-Reply-To: <20200505172302.GB1170406@t480s.localdomain>



On 5/5/2020 2:23 PM, Vivien Didelot wrote:
> On Tue,  5 May 2020 14:02:53 -0700, Florian Fainelli <f.fainelli@gmail.com> 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() at all.
>>
>> Ensure that the DSA master device is properly reference counted by
>> holding it as soon as the CPU port is successfully initialized and later
>> released during dsa_switch_release_ports(). dsa_get_tag_protocol() does
>> a short de-reference, so we hold and release the master at that time,
>> too.
>>
>> Fixes: 83c0afaec7b7 ("net: dsa: Add new binding implementation")
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
> 
Andrew, Vladimir, any thoughts on that?
-- 
Florian

  reply	other threads:[~2020-05-06 21:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 21:02 [RFC net] net: dsa: Add missing reference counting Florian Fainelli
2020-05-05 21:23 ` Vivien Didelot
2020-05-06 21:24   ` Florian Fainelli [this message]
2020-05-06 21:40     ` Vladimir Oltean
2020-05-06 22:45       ` Florian Fainelli
2020-05-06 23:32         ` Vladimir Oltean
2020-05-07 13:02     ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d681a82b-5d4b-457f-56de-3a439399cb3d@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox