From: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
To: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
James Ralston
<james.d.ralston-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Andras BALI <drewie-Y8qEzhMunLyT9ig0jae3mg@public.gmane.org>
Subject: Re: [PATCH v3 3/4] tsod: New hwmon driver for Temperature Sensors on DIMM
Date: Wed, 17 Jul 2013 16:13:52 -0700 [thread overview]
Message-ID: <CALCETrX+-Jj0rpMeKetVCrWmR01mPM4j6AX1qnOSuFYV5mt45Q@mail.gmail.com> (raw)
In-Reply-To: <20130717230909.GB2120-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
On Wed, Jul 17, 2013 at 4:09 PM, Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> wrote:
> On Wed, Jul 17, 2013 at 03:49:24PM -0700, Andy Lutomirski wrote:
>> On Wed, Jul 17, 2013 at 3:19 PM, Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> wrote:
>> > On Wed, Jul 17, 2013 at 01:53:07PM -0700, Andy Lutomirski wrote:
>> >> Signed-off-by: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
>> >> ---
>> >
>> > Why don't you just use the existing jc42 driver ?
>>
>> Failure to notice it. *sigh*. I assumed that any driver for this
>> device would have "tsod" or "TSOD" somewhere greppable. I'll at least
>> send a patch to improve the description.
>>
>> That being said, the jc42 driver *writes*. The iMC controller
>> (AFAICS) uses the data from the TSOD for things like dynamically
>> adjusting the DRAM refresh interval and IMO the kernel has no business
>> at all writing to any registers on the TSOD on this platform. (FWIW,
>> I tried fiddling with the critical threshold and my box didn't blow up
>> or report thermal trip events. But still, this scares me a bit.)
>>
> I don't see a problem with that. If the i2c controller supports writes, one can
> perform the write from user space with i2cset, so what is the problem ? Besides,
> jc42 compliant temperature sensors expect to be written to in order to set the
> temperature limits. If you don't like that, you don't have to do it.
Fair enough.
>
>> If I modify the i2c_imc driver to add .class = I2C_CLASS_SPD and get
>> rid of the TSOD probing and load the jc42 module, then it can't
>> actually find my TSODs (because the i2c core isn't capable of probing
>> on the iMC bus). If I manually add the device, it works.
>>
> You mean it doesn't support the SMBus quick command ? Did you set
> I2C_CLASS_HWMON as well, or just I2C_CLASS_SPD ?
I didn't set I2C_CLASS_HWMON (and I won't -- jc42 is the only hwmon
driver that should ever probe this bus). The adapter only supports
read byte/word data, write byte/word data, and write byte. (I'm
pretty sure that the hardware is capable of initiating a read byte
transaction, but not under software control. I have no idea why write
byte is there without read byte being available, so I didn't implement
it. I think it's so that you can reset the pointer register after
reading something else, but this is pointless because you don't know
what to reset it to. This hardware is not exactly a thing of beauty,
but I'm stuck with it.)
>
> If you have the ability to use i2c_board_info, the failure to auto-detect the
> devices should not really matter. In that case you can just use one of the other
> methods to instantiate the i2c devices.
See my other post about dimm_bus.
>
>> But I'd like to keep the enumeration code I wrote around, since the
>> main point of this exercise is to enumerate things that aren't
>> actually hwmon devices. But I don't want random sensors scripts
>> reprogramming the hardware. Is the some magic I can work (or should
>> add) with i2c_board_info to force the jc42 driver into a read-only
>> mode?
>>
> Again, that is user space code doing the write, which you can control without
> reverting to a "private" driver. That the driver permits the write doesn't mean
> you have to use it. The only write it always performs is to enable the sensor if
> it is disabled .. which presumably should be ok even for you, since otherwise
> loading the driver doesn't make any sense in the first place.
>
OK, I'm convinced. I'll scrap my tsod driver.
--Andy
next prev parent reply other threads:[~2013-07-17 23:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 20:53 [PATCH v3 0/4] iMC SMBUS, TSOD hwmon devices, and eeprom modalias Andy Lutomirski
[not found] ` <cover.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-17 20:53 ` [PATCH v3 1/4] i2c: Add DIMM bus code Andy Lutomirski
[not found] ` <b8e50b55358b4f0cd1db96174a9e6a2e69780359.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-17 22:23 ` Guenter Roeck
[not found] ` <20130717222349.GD990-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-07-17 23:04 ` Andy Lutomirski
[not found] ` <CALCETrVCotmG2PCQUF1BaAcbvnysMbS-kE4SJHoSokgzaML0jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-18 0:57 ` Andy Lutomirski
2013-07-17 20:53 ` [PATCH v3 2/4] i2c_imc: New driver for Intel's iMC, found on LGA2011 chips Andy Lutomirski
2013-07-17 20:53 ` [PATCH v3 3/4] tsod: New hwmon driver for Temperature Sensors on DIMM Andy Lutomirski
[not found] ` <f358329ff1dd3c3c272cadb4a358a5587cb28e18.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-17 22:19 ` Guenter Roeck
[not found] ` <20130717221902.GC990-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-07-17 22:49 ` Andy Lutomirski
[not found] ` <CALCETrWQF6p+DveuOxfMhp0r_CrvF=+FOmvfkF-TQ2NVgJ_2aA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-17 23:09 ` Guenter Roeck
[not found] ` <20130717230909.GB2120-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-07-17 23:13 ` Andy Lutomirski [this message]
2013-07-17 20:53 ` [PATCH v3 4/4] eeprom: Add a MODULE_DEVICE_TABLE Andy Lutomirski
[not found] ` <5661ebb4676a4d20678f369df3a2da5d587e9100.1374093761.git.luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2013-07-18 7:11 ` Jean Delvare
[not found] ` <20130718091116.6757e088-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-07-18 16:15 ` Andy Lutomirski
[not found] ` <CALCETrX9Et-D+C9qJ9Ou46UyuWdqD6SN+PSu6RKDwnVogE=jZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-18 20:31 ` Jean Delvare
[not found] ` <20130718223125.63e03635-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-07-18 20:44 ` Andy Lutomirski
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=CALCETrX+-Jj0rpMeKetVCrWmR01mPM4j6AX1qnOSuFYV5mt45Q@mail.gmail.com \
--to=luto-klttt9wpgjjwatoyat5jvq@public.gmane.org \
--cc=drewie-Y8qEzhMunLyT9ig0jae3mg@public.gmane.org \
--cc=james.d.ralston-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
/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).