netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: f.fainelli@gmail.com, vivien.didelot@gmail.com,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: sja1105: Print the reset reason
Date: Wed, 13 Nov 2019 04:53:21 +0100	[thread overview]
Message-ID: <20191113035321.GC16688@lunn.ch> (raw)
In-Reply-To: <20191112212200.5572-1-olteanv@gmail.com>

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

  parent reply	other threads:[~2019-11-13  3:53 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 [this message]
2019-11-14 12:53   ` Vladimir Oltean
2019-11-14 17:04     ` Andrew Lunn

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=20191113035321.GC16688@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 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).