From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Vivien Didelot <vivien.didelot@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: sja1105: Print the reset reason
Date: Thu, 14 Nov 2019 18:04:55 +0100 [thread overview]
Message-ID: <20191114170455.GS10875@lunn.ch> (raw)
In-Reply-To: <CA+h21ho84nWHcH0R+3oUBjShW65Ks63q1N+8CeNbDEa8tXkoow@mail.gmail.com>
On Thu, Nov 14, 2019 at 02:53:21PM +0200, Vladimir Oltean wrote:
> Hi Andrew,
>
> On Wed, 13 Nov 2019 at 05:53, Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Tue, Nov 12, 2019 at 11:22:00PM +0200, Vladimir Oltean wrote:
> > > Sometimes it can be quite opaque even for me why the driver decided to
> > > reset the switch. So instead of adding dump_stack() calls each time for
> > > debugging, just add a reset reason to sja1105_static_config_reload
> > > calls which gets printed to the console.
> >
> > > +int sja1105_static_config_reload(struct sja1105_private *priv,
> > > + enum sja1105_reset_reason reason)
> > > {
> > > struct ptp_system_timestamp ptp_sts_before;
> > > struct ptp_system_timestamp ptp_sts_after;
> > > @@ -1405,6 +1413,10 @@ int sja1105_static_config_reload(struct sja1105_private *priv)
> > > out_unlock_ptp:
> > > mutex_unlock(&priv->ptp_data.lock);
> > >
> > > + dev_info(priv->ds->dev,
> > > + "Reset switch and programmed static config. Reason: %s\n",
> > > + sja1105_reset_reasons[reason]);
> >
> > If this is for debugging, maybe dev_dbg() would be better?
> >
> > Andrew
>
> This should not be a debugging print, a reset is an important event in
> the life of the switch and I would like the user to be aware of it.
> When I said "debugging" I meant "figure out the reason why it needed
> to reset this time".
Ah, O.K.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
prev parent reply other threads:[~2019-11-14 17:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 21:22 [PATCH net-next] net: dsa: sja1105: Print the reset reason Vladimir Oltean
2019-11-12 21:27 ` Florian Fainelli
2019-11-13 3:53 ` David Miller
2019-11-13 3:53 ` Andrew Lunn
2019-11-14 12:53 ` Vladimir Oltean
2019-11-14 17:04 ` Andrew Lunn [this message]
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=20191114170455.GS10875@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.