[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191114170455.GS10875@lunn.ch>
Date: Thu, 14 Nov 2019 18:04:55 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
"David S. Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: sja1105: Print the reset reason
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@...n.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@...n.ch>
Andrew
Powered by blists - more mailing lists