public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn•ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux•com>
Cc: David Miller <davem@davemloft•net>,
	netdev <netdev@vger•kernel.org>,
	Florian Fainelli <f.fainelli@gmail•com>,
	Guenter Roeck <linux@roeck-us•net>
Subject: Re: [PATCH net-next 0/2] Move hwmon support out of switch and into PHYs.
Date: Wed, 11 Jan 2017 18:37:41 +0100	[thread overview]
Message-ID: <20170111173741.GB13033@lunn.ch> (raw)
In-Reply-To: <87vatljzlo.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>

On Wed, Jan 11, 2017 at 12:06:11PM -0500, Vivien Didelot wrote:
> Hi Andrew,
> 
> Andrew Lunn <andrew@lunn•ch> writes:
> 
> > Marvell Ethernet switches contain temperature sensors. They are inside
> > the embedded PHYs. Move the code into the PHY driver, so that discrete
> > PHY drivers also export there temperature sensor.
> 
> This message is not correct. The Marvell Ethernet switches contain only
> one temperature sensor for the entire chip (please adjust the cover
> letter and commit messages when you respin.)

Agreed.

> The temperature and threshold are accessed through the embedded PHY
> registers of any port, as long as the port is not disabled.

This is not correct. Each PHY has its own threshold registers. They
can be different, even if they are applied to one shared sensor.  One
PHY can be in alarm state, while others are not, due to different
thresholds.

> Even unlikely to be used, an interrupt can be generated when the
> temperature exceeds a certain threshold. It should be enabled on only
> one port at a time since there is only one temperature sensor.

Actually, since each PHY can have a different threshold, it would in
theory be possible to have different PHYs generating interrupts at
different thresholds.

However, at the moment, there is no code to enable interrupts for
temperature alarms. I also don't see any need to add such code, since
there is nowhere in HWMON to actively report such an alarm condition.

There is potentially an issue sometime down the road, if we were to
enable the temperature threshold interrupt. It is not clear what
happens if two PHYs have the same threshold conditions and this
threshold is crossed. Do all PHYs trigger an interrupt? Does only one?
Do none? I would prefer investigating and solving such issues if and
when it is decided to enable the interrupt.

> To sum up briefly, the temperature chip is physically inside the switch
> chip, but its access is via the embedded PHYs of the switch.

There is one temperature sensor in the chip, which each embedded PHY
shares for reporting the current temperature. It appears that
everything but the sensor is duplicated in each embedded PHY.

       Andrew

  reply	other threads:[~2017-01-11 17:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11  1:03 [PATCH net-next 0/2] Move hwmon support out of switch and into PHYs Andrew Lunn
2017-01-11  1:03 ` [PATCH net-next 1/2] phy: marvell: Add support for temperature sensor Andrew Lunn
2017-01-11 15:09   ` Andrew Lunn
2017-01-11 16:29     ` Sergei Shtylyov
2017-01-11  1:03 ` [PATCH net-next 2/2] net: dsa: Remove hwmon support Andrew Lunn
2017-01-11 17:06 ` [PATCH net-next 0/2] Move hwmon support out of switch and into PHYs Vivien Didelot
2017-01-11 17:37   ` Andrew Lunn [this message]
2017-01-11 17:55     ` Florian Fainelli
2017-01-11 19:19       ` Andrew Lunn
2017-01-11 18:00     ` Guenter Roeck
2017-01-11 19:16       ` Andrew Lunn
2017-01-11 20:00         ` Guenter Roeck

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=20170111173741.GB13033@lunn.ch \
    --to=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=linux@roeck-us$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=vivien.didelot@savoirfairelinux$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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