Uwe Kleine-König
1d05b91ab7
hwmon: (pwm-fan) Ensure that calculation doesn't discard big period values
...
[ Upstream commit 1eda52334e6d13eb1a85f713ce06dd39342b5020 ]
With MAX_PWM being defined to 255 the code
unsigned long period;
...
period = ctx->pwm->args.period;
state.duty_cycle = DIV_ROUND_UP(pwm * (period - 1), MAX_PWM);
calculates a too small value for duty_cycle if the configured period is
big (either by discarding the 64 bit value ctx->pwm->args.period or by
overflowing the multiplication). As this results in a too slow fan and
so maybe an overheating machine better be safe than sorry and error out
in .probe.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20201215092031.152243-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-19 18:26:15 +01:00
..
2019-07-21 19:18:45 -07:00
2020-10-29 09:57:32 +01:00
2019-05-30 11:29:22 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:29:22 -07:00
2020-07-09 09:37:53 +02:00
2019-05-30 11:25:18 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:10 +02:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-06-23 18:34:11 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:42 +02:00
2019-05-24 17:36:45 +02:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:25:18 -07:00
2019-05-30 11:25:18 -07:00
2019-06-19 17:09:55 +02:00
2020-03-12 13:00:30 +01:00
2019-05-30 11:26:35 -07:00
2020-01-29 16:45:24 +01:00
2019-05-24 17:36:45 +02:00
2020-09-09 19:12:20 +02:00
2019-09-03 12:47:17 -07:00
2019-09-03 12:47:17 -07:00
2019-05-24 17:36:45 +02:00
2020-07-29 10:18:37 +02:00
2019-06-23 18:33:01 -07:00
2019-07-31 13:25:27 -06:00
2019-08-31 08:04:57 -07:00
2020-05-20 08:20:26 +02:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:39:02 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:39 -07:00
2020-07-22 09:33:14 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:43 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:47 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-07-08 18:11:32 -07:00
2019-05-24 17:39:00 +02:00
2019-05-24 17:36:45 +02:00
2020-01-29 16:45:24 +01:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:39:01 +02:00
2019-09-03 12:47:17 -07:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:17 +02:00
2020-12-30 11:51:17 +01:00
2019-05-30 11:26:37 -07:00
2020-05-02 08:48:59 +02:00
2019-09-03 12:47:17 -07:00
2020-06-22 09:31:19 +02:00
2019-09-22 09:30:30 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-06-05 17:37:04 +02:00
2019-09-04 11:06:47 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-07-08 18:11:31 -07:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2019-04-15 17:19:53 -07:00
2019-05-30 11:26:37 -07:00
2019-09-03 12:47:17 -07:00
2019-05-24 17:36:45 +02:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:37 -07:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-21 11:28:45 +02:00
2019-09-22 09:30:30 -07:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-06-23 18:33:01 -07:00
2020-07-09 09:37:53 +02:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:37 -07:00
2019-02-18 14:23:29 -08:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-16 07:56:57 -07:00
2019-05-30 11:26:37 -07:00
2020-07-29 10:18:39 +02:00
2020-01-29 16:45:30 +01:00
2020-09-03 11:26:54 +02:00
2019-09-03 12:47:17 -07:00
2019-06-05 17:37:14 +02:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2021-01-19 18:26:15 +01:00
2019-09-03 12:47:17 -07:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2020-07-29 10:18:39 +02:00
2019-06-23 18:34:11 -07:00
2019-05-30 11:26:37 -07:00
2019-04-17 10:37:23 -07:00
2019-05-24 17:39:00 +02:00
2019-09-10 11:42:56 -07:00
2019-05-24 17:36:45 +02:00
2019-09-17 16:22:26 -07:00
2019-05-24 17:36:45 +02:00
2019-06-23 18:33:01 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:38 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-06-05 17:30:30 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-09-03 12:47:17 -07:00
2019-09-03 12:47:17 -07:00
2019-09-03 12:47:17 -07:00
2019-09-03 12:47:17 -07:00
2019-06-05 17:30:30 +02:00
2019-06-05 17:30:30 +02:00
2019-06-05 17:30:30 +02:00
2019-05-21 11:28:45 +02:00