netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] net-sysfs: allow changing sysfs carrier when interface is down
Date: Thu, 2 Jun 2022 16:26:18 +0000	[thread overview]
Message-ID: <b4b1b8519ef9bfef0d09aeea7ab8f89e531130c8.camel@infinera.com> (raw)
In-Reply-To: <20220602085645.5ecff73f@hermes.local>

On Thu, 2022-06-02 at 08:56 -0700, Stephen Hemminger wrote:
> On Thu, 2 Jun 2022 09:22:34 +0000
> Joakim Tjernlund <Joakim.Tjernlund@infinera.com> wrote:
> 
> > On Wed, 2022-06-01 at 18:01 -0700, Jakub Kicinski wrote:
> > > On Thu, 2 Jun 2022 02:35:23 +0200 Joakim Tjernlund wrote:  
> > > > UP/DOWN and carrier are async events and it makes sense one can
> > > > adjust carrier in sysfs before bringing the interface up.  
> > > 
> > > Can you explain your use case?  
> > 
> > Sure, our HW has config/state changes that makes it impossible for net driver
> > to touch and registers or TX pkgs(can result in System Error exception in worst case.
> > 
> > So the user space app handlings this needs to make sure that even if say dchp
> > brings an I/F up, there can be no HW access by the driver.
> > To do that, carrier needs to be controlled before I/F is brought up.
> > 
> > Carrier reflects actual link status and this kan change at any time. I honestly
> > don't understand why you would prevent sysfs access to carrier just
> > because I/F is down? 
> > 
> > >   
> > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > > Cc: stable@vger.kernel.org  
> > > 
> > > Seems a little too risky of a change to push into stable.  
> > 
> > The change is minimal and only allows access to carrier when I/F is also down.
> > I think this is a kernel bug and should go to stable too.
> > 
> 
> For many devices when device is down, the phy is turned off so the
> state of carrier is either always down or undefined.
> 
> That is why the code had the check originally.
> 

Maybe so but it seems to me that this limitation was put in place without much thought.
Here an app takes on the role to manage carrier for that device and the app should be free
to manage the carrier as it see best.

Are there some use cases that must deny sysfs carrier access to its own carrier? 

 Jocke


  reply	other threads:[~2022-06-02 16:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  0:35 [PATCH] net-sysfs: allow changing sysfs carrier when interface is down Joakim Tjernlund
2022-06-02  1:01 ` Jakub Kicinski
2022-06-02  9:22   ` Joakim Tjernlund
2022-06-02 15:56     ` Stephen Hemminger
2022-06-02 16:26       ` Joakim Tjernlund [this message]
2022-06-02 16:57         ` Jakub Kicinski
2022-06-02 17:15           ` Joakim Tjernlund
2022-06-02 17:52             ` Jakub Kicinski
2022-06-02 18:01               ` Joakim Tjernlund
2022-06-05 18:50                 ` Andrew Lunn
2022-06-07 11:52                   ` Joakim Tjernlund
2022-06-02 18:14               ` Stephen Hemminger
2022-06-02 17:56             ` Stephen Hemminger
2022-06-02 18:09               ` Joakim Tjernlund
2022-06-02 18:38                 ` Joakim Tjernlund

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=b4b1b8519ef9bfef0d09aeea7ab8f89e531130c8.camel@infinera.com \
    --to=joakim.tjernlund@infinera.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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;
as well as URLs for NNTP newsgroup(s).