[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+h21ho84nWHcH0R+3oUBjShW65Ks63q1N+8CeNbDEa8tXkoow@mail.gmail.com>
Date: Thu, 14 Nov 2019 14:53:21 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Andrew Lunn <andrew@...n.ch>
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
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".
Thanks,
-Vladimir
Powered by blists - more mailing lists