mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avri Altman <Avri.Altman@wdc.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Julian Calaby <julian.calaby@gmail.com>,
	Avi Shchislowski <Avi.Shchislowski@wdc.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: RE: [PATCH 0/5] scsi: ufs: ufs device as a temperature sensor
Date: Thu, 6 Feb 2020 22:21:10 +0000	[thread overview]
Message-ID: <MN2PR04MB69913DA014B665CFAC3AF8FFFC1D0@MN2PR04MB6991.namprd04.prod.outlook.com> (raw)
In-Reply-To: <20200206204218.GA23857@roeck-us.net>

> 
> On Thu, Feb 06, 2020 at 07:32:12PM +0000, Avri Altman wrote:
> > Hi Julian,
> >
> > >
> > >
> > > Hi Avri,
> > >
> > > On Fri, Feb 7, 2020 at 12:41 AM Avri Altman <Avri.Altman@wdc.com>
> wrote:
> > > >
> > > > >
> > > > > Hi Avri,
> > > > >
> > > > > On Thu, Feb 6, 2020 at 11:08 PM Avri Altman
> <Avri.Altman@wdc.com>
> > > > > wrote:
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > Hi Avi,
> > > > > > >
> > > > > > > On Thu, Feb 6, 2020 at 9:48 PM Avi Shchislowski
> > > > > > > <Avi.Shchislowski@wdc.com> wrote:
> > > > > > > >
> > > > > > > > As it become evident that the hwmon is not a viable option to
> > > > > implement
> > > > > > > ufs thermal notification, I would appreciate some concrete
> comments
> > > of
> > > > > this
> > > > > > > series.
> > > > > > >
> > > > > > > That isn't my reading of this thread.
> > > > > > >
> > > > > > > You have two options:
> > > > > > > 1. extend drivetemp if that makes sense for this particular
> application.
> > > > > > > 2. follow the model of other devices that happen to have a built-in
> > > > > > > temperature sensor and expose the hwmon compatible attributes
> as
> > > a
> > > > > > > subdevice
> > > > > > >
> > > > > > > It appears that option 1 isn't viable, so what about option 2?
> > > > > > This will require to export the ufs device management commands,
> > > > > > Which is privet to the ufs driver.
> > > > > >
> > > > > > This is not a viable option as well, because it will allow unrestricted
> > > access
> > > > > > (Including format etc.) to the storage device.
> > > > > >
> > > > > > Sorry for not making it clearer before.
> > > > >
> > > > > I should have clarified further: I meant having the UFS device
> > > > > register a HWMON driver using this API:
> > > > > https://www.kernel.org/doc/html/latest/hwmon/hwmon-kernel-
> > > api.html
> > > > >
> > > > > *Not* writing a separate HWMON driver that uses some private
> > > interface.
> > > > Ok.
> > > > Just one last question:
> > > > The ufs spec requires to be able to react upon an exception event from
> the
> > > device.
> > > > The thermal core provides an api in the form of
> > > thermal_notify_framework().
> > > > What would be the hwmon equivalent for that?
> > >
> > > My understanding is that HWMON is just a standardised way to report
> > > hardware sensor data to userspace. There are "alarm" files that can be
> > > used to report fault conditions, so any action taken would have to be
> > > either managed by userspace or configured using thermal zones
> > > configured in the hardware's devicetree.
> > Those "alarms" are  implemented as part of the modules under
> drivers/hwmon/ isn't it?
> > We already established that this is not an option for the ufs driver.
> 
> You have established nothing. What exactly is not an option ?
> To create alarm attributes ? No one forces you to create any of those
> if you don't want to.
> 
> >
> > >
> > > thermal_notify_framework() is a way to notify the "other side" of a
> > > thermal zone to do something to reduce the temperature of that zone.
> > > E.g. spin up a fan or switch to a lower-power state to cool a CPU.
> > > Looking at your code, you're only implementing the "sensor" side of
> > > the thermal zone functionality, so your calls to
> > > thermal_notify_framework() won't do anything.
> > Right.  The thermal core allows to react to such notifications,
> > Provided that the thermal zone device has a governor defined,
> > And/or notify ops etc.
> >
> > Should the current patches implement those callbacks or not,
> > Can be discussed during their review process.
> > But the important thing is that the thermal core support it in an intuitive
> and simple way,
> > While the hwmon doesn't.
> >
> > We are indifference with respect of which subsystem to use.
> 
> Not really. Quite the opposite; you are quite obviously heavily
> opposed to a hwmon driver.
> 
> > The thermal core was our first choice because we bumped into it,
> > Looking for a way to raise thermal exceptions.
> > It provides the functionality we need, and other devices uses it,
> > Why the insistence not to use it?
> >
> 
> As mentioned before, the hwmon subsystem lets you create a bridge
> to the thermal subsystem, it creates standard attributes to report
> temperatures instead of the private ones your patch provides,
> and it would result in simpler code.
> 
> Why the insistence to _not_ use the hwmon subsystem ?
I am not. Please, guide me through it - 
We'll register a hwmon device and implement its read ops.
Since read is confined to the ufs driver, we'll still need to have the ufs-thermal module that we've created.
Next we need to respond to a thermal exception event raised by the device - 
We are expected to pass such notification onward, for whatever governor/mind to  take an applicable action,
Should such mind exists.  How do I do that?

> 
> Guenter

  reply	other threads:[~2020-02-06 22:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02 10:46 Avi Shchislowski
2020-02-02 10:46 ` [PATCH 1/5] scsi: ufs: Add ufs thermal support Avi Shchislowski
2020-02-02 10:46 ` [PATCH 2/5] scsi: ufs: export ufshcd_enable_ee Avi Shchislowski
2020-02-02 10:46 ` [PATCH 3/5] scsi: ufs: enable thermal exception event Avi Shchislowski
2020-02-02 10:46 ` [PATCH 4/5] scsi: ufs-thermal: implement thermal file ops Avi Shchislowski
2020-02-02 10:46 ` [PATCH 5/5] scsi: ufs: temperature atrributes add to ufs_sysfs Avi Shchislowski
2020-02-02 19:21 ` [PATCH 0/5] scsi: ufs: ufs device as a temperature sensor Guenter Roeck
2020-02-03 11:57   ` Avi Shchislowski
2020-02-03 14:47     ` Guenter Roeck
2020-02-03 21:29       ` Avri Altman
2020-02-03 21:47         ` Guenter Roeck
2020-02-04  6:17           ` Avri Altman
2020-02-06 10:40             ` Avi Shchislowski
2020-02-06 11:39               ` Julian Calaby
2020-02-06 12:08                 ` Avri Altman
2020-02-06 12:41                   ` Julian Calaby
2020-02-06 13:40                     ` Avri Altman
2020-02-06 15:49                       ` Julian Calaby
2020-02-06 19:32                         ` Avri Altman
2020-02-06 20:42                           ` Guenter Roeck
2020-02-06 22:21                             ` Avri Altman [this message]
2020-02-07  0:47                           ` Julian Calaby
2020-02-03  8:51 ` [EXT] " Bean Huo (beanhuo)
  -- strict thread matches above, loose matches on Subject: below --
2020-02-02 15:47 Avi Shchislowski
2020-02-02  7:41 Avi Shchislowski

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=MN2PR04MB69913DA014B665CFAC3AF8FFFC1D0@MN2PR04MB6991.namprd04.prod.outlook.com \
    --to=avri.altman@wdc.com \
    --cc=Avi.Shchislowski@wdc.com \
    --cc=alim.akhtar@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=julian.calaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=martin.petersen@oracle.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

all inboxes | Powered by JetHome®