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] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 21 Dec 2014 03:47:15 -0800
From:	Guenter Roeck <linux@...ck-us.net>
To:	Pali Rohár <pali.rohar@...il.com>
CC:	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, Valdis.Kletnieks@...edu,
	Steven Honeyman <stevenhoneyman@...il.com>,
	Jean Delvare <jdelvare@...e.de>,
	Gabriele Mazzotta <gabriele.mzt@...il.com>,
	Jochen Eisinger <jochen@...guin-breeder.org>
Subject: Re: [PATCH v2 1/2] i8k: Autodetect maximal fan speed and fan RPM
 multiplier

On 12/21/2014 01:13 AM, Pali Rohár wrote:
> On Saturday 20 December 2014 19:38:32 Guenter Roeck wrote:
>>> +	if (fan_mult <= 0) {
>>
>> Wonder what to do in the < 0 case. It might be better to make
>> the variable and the module parameter an unsigned int to
>> cover that case, since a negative multiplier doesn't really
>> make sense. Same for fan_max.
>>
>
> In some other kernel modules negative value means autodetect. I
> think we can do that too.
>
But 0 already implies autodetect, so that would be redundant.

>>> +		/*
>>> +		 * Autodetect fan multiplier for each fan based on
>>> nominal rpm +		 * First set default fan multiplier for each
>>> fan +		 * And if it reports rpm value too high then set
>>> multiplier to 1 +		 *
>>> +		 * Try also setting multiplier from current rpm, but
> this
>>> will +		 * work only in case when fan is not turned off. It
>>> is better +		 * then nothing for machines which does not
>>> support nominal rpm +		 * SMM function.
>>> +		 */
>>> +		for (fan = 0; fan < ARRAY_SIZE(i8k_fan_mult); ++fan) {
>>> +			i8k_fan_mult[fan] = I8K_FAN_DEFAULT_MULT;
>>> +			if (i8k_get_fan_speed(fan) > I8K_FAN_MAX_RPM) {
>>> +				i8k_fan_mult[fan] = 1;
>>> +				continue;
>>> +			}
>>
>> What if i8k_get_fan_speed(fan) returns an error ? Doesn't that
>> imply that the fan does not exist, and that you would not
>> need the second loop in the first place ?
>>
>
> See my other email "[PATCH] i8k: Add support for fan labels". DOS
> binary check for fan presence by another function. I bet it is
> because fan could have same problem as temperature sensors. If
> fan is on GPU and GPU is turned off reading fan rpm will fail.
> But my laptop (with GPU which can be turned on/off) does not have
> GPU fan so this is just my assumption.
>
Good point.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ