[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191113035321.GC16688@lunn.ch>
Date: Wed, 13 Nov 2019 04:53:21 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Vladimir Oltean <olteanv@...il.com>
Cc: f.fainelli@...il.com, vivien.didelot@...il.com,
davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: dsa: sja1105: Print the reset reason
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
Powered by blists - more mailing lists