Re: [PATCH 4/5] firmware: dmi: Add function to look up a handle and return DIMM size

2018-03-13 Thread Jean Delvare
On Mon, 12 Mar 2018 11:24:29 -0700, Tony Luck wrote: > When we first scan the SMBIOS table, save the size of the DIMM. > > Provide a function for other code (EDAC driver) to look up the size > of a DIMM from its SMBIOS handle. > > Signed-off-by: Tony Luck > --- >

Re: [PATCH 4/5] firmware: dmi: Add function to look up a handle and return DIMM size

2018-03-12 Thread Luck, Tony
On Sat, Mar 10, 2018 at 02:22:17PM +0100, Jean Delvare wrote: > Note that it is possible to store MB values (up to 16 MB) using kB as > the unit. The specification allows for it, and a few systems use that > option. For example [1], the DMI data of a Supermicro X8STi board looks > like: > >

Re: [PATCH 4/5] firmware: dmi: Add function to look up a handle and return DIMM size

2018-03-10 Thread Jean Delvare
Hi Tony, On Fri, 9 Mar 2018 15:03:58 -0800, Luck, Tony wrote: > I got side-tracked reading the standard with the ancient ways > used to report size back in the day when kilobytes was a > plausible unit. So I wrote code that covers all the crazy > cases. Persistant DIMMs have sizes measured in

Re: [PATCH 4/5] firmware: dmi: Add function to look up a handle and return DIMM size

2018-03-09 Thread Luck, Tony
On Fri, Mar 09, 2018 at 11:20:53AM +0100, Jean Delvare wrote: > > + else if (size & 0x8000) > > + bytes = (u64)(size & 0x7fff) << 10; > > + else if (size != 0x7fff) > > + bytes = (u64)size << 20; > > + else > > + bytes = (u64)get_unaligned((u32 *)[0x1C]) << 20;

Re: [PATCH 4/5] firmware: dmi: Add function to look up a handle and return DIMM size

2018-03-09 Thread Jean Delvare
Hi Tony, On Thu, 22 Feb 2018 11:58:10 -0800, Tony Luck wrote: > When we first scan the SMBIOS table, save the size of the DIMM. > > Provide a function for other code (EDAC driver) to look up the size > of a DIMM from its SMBIOS handle. On the principle I'm OK with the idea. My comments on the