lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <PA4PR04MB9222A8B83329A105DD1BEFD09A1EA@PA4PR04MB9222.eurprd04.prod.outlook.com>
Date:   Mon, 21 Aug 2023 16:23:08 +0000
From:   Huibin Shi <henrys@...icom-usa.com>
To:     Guenter Roeck <linux@...ck-us.net>
CC:     Henry Shi <henryshi2018@...il.com>,
        "hbshi69@...mail.com" <hbshi69@...mail.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
        "hdegoede@...hat.com" <hdegoede@...hat.com>,
        "markgross@...nel.org" <markgross@...nel.org>,
        "jdelvare@...e.com" <jdelvare@...e.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "platform-driver-x86@...r.kernel.org" 
        <platform-driver-x86@...r.kernel.org>,
        "linux-hwmon@...r.kernel.org" <linux-hwmon@...r.kernel.org>,
        "hb_shi2003@...oo.com" <hb_shi2003@...oo.com>,
        Wen Wang <wenw@...icom-usa.com>
Subject: RE: [PATCH] Add Silicom Platform Driver

Hi Guenter,

OK, I see your point. I will make the change to let driver return milli-degrees return (reg >> 16) * 100.

The 32 bits register exposed by micro-controller has its upper 16 bits represent temperature.

Thanks
Henry

-----Original Message-----
From: Guenter Roeck <groeck7@...il.com> On Behalf Of Guenter Roeck
Sent: Monday, August 21, 2023 12:09 PM
To: Huibin Shi <henrys@...icom-usa.com>
Cc: Henry Shi <henryshi2018@...il.com>; hbshi69@...mail.com; tglx@...utronix.de; mingo@...hat.com; bp@...en8.de; dave.hansen@...ux.intel.com; x86@...nel.org; hpa@...or.com; hdegoede@...hat.com; markgross@...nel.org; jdelvare@...e.com; linux-kernel@...r.kernel.org; platform-driver-x86@...r.kernel.org; linux-hwmon@...r.kernel.org; hb_shi2003@...oo.com; Wen Wang <wenw@...icom-usa.com>
Subject: Re: [PATCH] Add Silicom Platform Driver

Caution: This is an external email. Please take care when clicking links or opening attachments.


On Mon, Aug 21, 2023 at 03:48:33PM +0000, Huibin Shi wrote:
> Guenter,
>
> See my comments below.
>
> Thanks
> Henry
>
> -----Original Message-----
> From: Guenter Roeck <groeck7@...il.com> On Behalf Of Guenter Roeck
> Sent: Saturday, August 19, 2023 10:36 AM
> To: Huibin Shi <henrys@...icom-usa.com>
> Cc: Henry Shi <henryshi2018@...il.com>; hbshi69@...mail.com; 
> tglx@...utronix.de; mingo@...hat.com; bp@...en8.de; 
> dave.hansen@...ux.intel.com; x86@...nel.org; hpa@...or.com; 
> hdegoede@...hat.com; markgross@...nel.org; jdelvare@...e.com; 
> linux-kernel@...r.kernel.org; platform-driver-x86@...r.kernel.org; 
> linux-hwmon@...r.kernel.org; hb_shi2003@...oo.com; Wen Wang 
> <wenw@...icom-usa.com>
> Subject: Re: [PATCH] Add Silicom Platform Driver
>
> Caution: This is an external email. Please take care when clicking links or opening attachments.
>
>
> On Sat, Aug 19, 2023 at 02:20:32PM +0000, Huibin Shi wrote:
> > Hi Guenter,
> >
> > Thanks for your comments. Probably, I should not resubmit patch too rushed. I will add version number to subject and change log in cover letter for next resubmission.
> >
> > See my comments below. Please let me know whether you accept my explanation.
> >
> > Henry
> > -----Original Message-----
> [ ... ]
>
> > > +
> > > +static u32 temp_get(void)
> > > +{
> > > +     u32 reg;
> > > +
> > > +     mutex_lock(&mec_io_mutex);
> > > +     /* Select memory region */
> > > +     outb(IO_REG_BANK, EC_ADDR_MSB);
> > > +     outb(0xc, EC_ADDR_LSB);
> > > +     /* Get current data from the address */
> > > +     reg = inl(MEC_DATA(DEFAULT_CHAN_LO));
> > > +     mutex_unlock(&mec_io_mutex);
> > > +
> > > +     return (reg >> 16) / 10;
> >
> > The hwmon ABI expects temperatures to be reported in milli-degrees C.
> > The above sets the maximum temperature to 65,535 / 10 = 6,553 milli-degrees or 6.553 degrees C. It is very unlikely that this is correct.
> >
> > Again, I commented on this before.
> >
> > Henry: this is due to an internal implementation of MIcor-controller firmware, instead of putting real temperature to the register, it put (real temperature * 10 ) to the register. So, in order to report correct temperature to user space application, the read value is divided by 10, then report to user space.
> >
> > Please let me know if you accept this. If not, I can change the code, but let user space application to do adjustment.
>
> No, I do not accept this. I do not believe that the maximum temperature reported by the microcontroller is 6.553 degrees C. I suspect it reports 10th of degrees C. In that case, the number reported should be multiplied by 100 to make it milli-degrees C as expected by the ABI.
>
> Henry: OK, I will remove "/10" in driver, and let user space application (or script) to the calculation.
>

Sorry, I completely fail to understand why you refuse to follow the ABI.
The temperature must be reported in milli-degrees C, not in some arbitrary unit, period.

FWIW, that really deserves a NACK now.



Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ