24 Sep, 2020
1 commit
-
Smatch has a new check for resource leaks which found a bug in probe:
drivers/hwmon/w83627ehf.c:2417 w83627ehf_probe()
warn: 'res->start' not released on lines: 2412.We need to clean up if devm_hwmon_device_register_with_info() fails.
Fixes: 266cd5835947 ("hwmon: (w83627ehf) convert to with_info interface")
Signed-off-by: Dan Carpenter
Reviewed-by: Dr. David Alan Gilbert
Link: https://lore.kernel.org/r/20200921125212.GA1128194@mwanda
Signed-off-by: Guenter Roeck
22 Feb, 2020
1 commit
-
Loading the driver on a system with W83627DHG-P crashes as follows.
w83627ehf: Found W83627DHG-P chip at 0x290
BUG: kernel NULL pointer dereference, address: 0000000000000000
PGD 0 P4D 0
Oops: 0000 [#1] SMP NOPTI
CPU: 0 PID: 604 Comm: sensors Not tainted 5.6.0-rc2-00055-gca7e1fd1026c #29
Hardware name: /D425KT, BIOS MWPNT10N.86A.0132.2013.0726.1534 07/26/2013
RIP: 0010:w83627ehf_read_string+0x27/0x70 [w83627ehf]
Code: [... ]
RSP: 0018:ffffb95980657df8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff96caaa7f5218 RCX: 0000000000000000
RDX: 0000000000000015 RSI: 0000000000000001 RDI: ffff96caa736ec08
RBP: 0000000000000000 R08: ffffb95980657e20 R09: 0000000000000001
R10: ffff96caaa635cc0 R11: 0000000000000000 R12: ffff96caa9f7cf00
R13: ffff96caa9ec3d00 R14: ffff96caa9ec3d28 R15: ffff96caa9ec3d40
FS: 00007fbc7c4e2740(0000) GS:ffff96caabc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000129d58000 CR4: 00000000000006f0
Call Trace:
? cp_new_stat+0x12d/0x160
hwmon_attr_show_string+0x37/0x70 [hwmon]
dev_attr_show+0x14/0x50
sysfs_kf_seq_show+0xb5/0x1b0
seq_read+0xcf/0x460
vfs_read+0x9b/0x150
ksys_read+0x5f/0xe0
do_syscall_64+0x48/0x190
entry_SYSCALL_64_after_hwframe+0x44/0xa9
...Temperature labels are not always present. Adjust sysfs attribute
visibility accordingly.Reported-by: Meelis Roos
Suggested-by: Dr. David Alan Gilbert
Reviewed-by: Dr. David Alan Gilbert
Cc: Meelis Roos
Cc: Dr. David Alan Gilbert
Fixes: 266cd5835947 ("hwmon: (w83627ehf) convert to with_info interface")
Signed-off-by: Guenter Roeck
24 Jan, 2020
6 commits
-
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/hwmon/w83627ehf.c: In function 'w83627ehf_check_fan_inputs':
drivers/hwmon/w83627ehf.c:1296:24: warning:
variable 'fan4min' set but not used [-Wunused-but-set-variable]commit 62000264cfa8 ("hwmon: (w83627ehf) remove nct6775 and nct6776 support")
left behind this unused variable.Reported-by: Hulk Robot
Signed-off-by: YueHaibing
Link: https://lore.kernel.org/r/20200108034514.50130-1-yuehaibing@huawei.com
Signed-off-by: Guenter Roeck -
The 2nd intrusion channel was only used on the nct6776
Signed-off-by: Dr. David Alan Gilbert
Link: https://lore.kernel.org/r/20191225023225.2785-4-linux@treblig.org
Signed-off-by: Guenter Roeck -
Now the nct677* are gone, we can clean up some flags that are
always the same now and simplify some code.Signed-off-by: Dr. David Alan Gilbert
Link: https://lore.kernel.org/r/20191225023225.2785-3-linux@treblig.org
Signed-off-by: Guenter Roeck -
The nct6775 and nct6776 are supported by the separate nct6775.c driver,
so remove the code from the w83627ehf driver.Suggested-by: Guenter Roeck
Signed-off-by: Dr. David Alan Gilbert
Link: https://lore.kernel.org/r/20191225023225.2785-2-linux@treblig.org
Signed-off-by: Guenter Roeck -
Fix sparse warning:
drivers/hwmon/w83627ehf.c:1202:1: warning:
symbol 'sensor_dev_attr_pwm1_target' was not declared. Should it be static?and many more similar messages.
Reported-by: Hulk Robot
Signed-off-by: Chen Zhou
Link: https://lore.kernel.org/r/20191213015605.172472-1-chenzhou10@huawei.com
[groeck: Dropped all but one log message from description]
Signed-off-by: Guenter Roeck -
Convert the old hwmon_device_register code to
devm_hwmon_device_register_with_info.Signed-off-by: Dr. David Alan Gilbert
Link: https://lore.kernel.org/r/20191124202030.45360-3-linux@treblig.org
Signed-off-by: Guenter Roeck
24 May, 2019
1 commit
-
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
675 mass ave cambridge ma 02139 usaextracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 441 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Michael Ellerman (powerpc)
Reviewed-by: Richard Fontana
Reviewed-by: Allison Randal
Reviewed-by: Kate Stewart
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
Signed-off-by: Greg Kroah-Hartman
02 Apr, 2017
1 commit
-
Serialize access to the hardware by using "request_muxed_region".
Call to this macro will hold off the requestor if the resource is
currently busy. "superio_enter" will return an error if call to
"request_muxed_region" fails.Signed-off-by: Katsumi Sato
Signed-off-by: Atsushi Nemoto
Signed-off-by: Guenter Roeck
03 Jan, 2017
1 commit
-
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source
code, improves readbility, and reduces the chance of inconsistencies.The conversion was done automatically using coccinelle. It was validated
by compiling both the old and the new source code and comparing its text,
data, and bss size.Signed-off-by: Julia Lawall
[groeck: Updated description]
Signed-off-by: Guenter Roeck
03 Jul, 2015
1 commit
-
Use kernel.h macro definition.
Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: Fabian Frederick
Signed-off-by: Jean Delvare
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
30 Jan, 2014
1 commit
-
Signed-off-by: Jean Delvare
12 Aug, 2013
2 commits
-
Hibernation uses its own set of callback functions, even if the code
is the same as the code used for suspend/restore.Signed-off-by: Harald Judt
Signed-off-by: Guenter Roeck -
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.Signed-off-by: Jingoo Han
Signed-off-by: Guenter Roeck
22 Jun, 2013
1 commit
-
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.Signed-off-by: Sachin Kamat
Cc: Jean Delvare
Signed-off-by: Guenter Roeck
08 Apr, 2013
1 commit
-
Cc: Corentin Labbe
Cc: Mark M. Hoffman
Cc: Fenghua Yu
Cc: Juerg Haefliger
Cc: Andreas Herrmann
Cc: Rudolf Marek
Cc: Jim Cromie
Cc: Roger Lucas
Cc: Marc Hulsman
Signed-off-by: Guenter Roeck
26 Jan, 2013
1 commit
-
SENSORS_LIMIT and the generic clamp_val have the same functionality,
and clamp_val is more efficient.This patch reduces text size by 9052 bytes and bss size by 11624 bytes
for x86_64 builds.Signed-off-by: Guenter Roeck
Acked-by: George Joseph
Acked-by: Jean Delvare
20 Dec, 2012
2 commits
-
The smatch static code analyzer complains:
drivers/hwmon/w83627ehf.c:911 w83627ehf_update_device() error: buffer overflow 'W83627EHF_REG_TEMP_OFFSET' 3 have_temp_offset can be set so the
write is never attempted with i >= 3. However this shows that the code
isn't very robust and future changes could easily introduce a buffer
overflow. So let's add a safety check to prevent that and make smatch
happy.Signed-off-by: Jean Delvare
Cc: Peter Huewe
Reviewed-by: Guenter Roeck -
On suspend some register values are lost, most notably the Value RAM
areas but also other limits and settings. Restore them on resume.Signed-off-by: Jean Delvare
Reviewed-by: Guenter Roeck
Tested-by: Guenter Roeck
29 Nov, 2012
3 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Cc: Hans de Goede
Cc: Jean Delvare
Cc: Alistair John Strachan
Cc: Fenghua Yu
Cc: Juerg Haefliger
Cc: Andreas Herrmann
Cc: Clemens Ladisch
Cc: Rudolf Marek
Cc: Jim Cromie
Cc: "Mark M. Hoffman"
Cc: Roger Lucas
Acked-by: Guenter Roeck
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Hans de Goede
Cc: Jean Delvare
Cc: Alistair John Strachan
Cc: Fenghua Yu
Cc: Juerg Haefliger
Cc: Andreas Herrmann
Cc: Clemens Ladisch
Cc: Rudolf Marek
Cc: Jim Cromie
Cc: "Mark M. Hoffman"
Cc: Roger Lucas
Acked-by: Guenter Roeck
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Hans de Goede
Cc: Jean Delvare
Cc: Alistair John Strachan
Cc: Fenghua Yu
Cc: Juerg Haefliger
Cc: Andreas Herrmann
Cc: Clemens Ladisch
Cc: Rudolf Marek
Cc: Jim Cromie
Cc: "Mark M. Hoffman"
Cc: Roger Lucas
Acked-by: Guenter Roeck
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
06 Nov, 2012
1 commit
-
Don't assume bank 0 is selected at device probe time. This may not be
the case. Force bank selection at first register access to guarantee
that we read the right registers upon driver loading.Signed-off-by: Jean Delvare
Reviewed-by: Guenter Roeck
Cc: stable@vger.kernel.org
22 Jul, 2012
1 commit
-
A case statement in nct6775_write_fan_div() is missing a break. Fix it.
This patch addresses Coverity #141439: Missing break in switch.
Signed-off-by: Guenter Roeck
Acked-by: Jean Delvare
02 Apr, 2012
1 commit
-
As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail witherror: $variablename causes a section type conflict
because a section containing const variables is marked read only and so
cannot contain non-const variables.Signed-off-by: Uwe Kleine-König
Cc: Jean Delvare
Cc: Guenter Roeck
Cc: lm-sensors@lm-sensors.org
Signed-off-by: Guenter Roeck
19 Mar, 2012
2 commits
-
Add support for temperature offset registers for CPUTIN, SYSTIN,
and AUXTIN temperatures.Signed-off-by: Guenter Roeck
Acked-by: Jean Delvare -
Cc: Jean Delvare
Signed-off-by: Guenter Roeck
13 Mar, 2012
3 commits
-
Properly set the source of temp2 for the W83627UHG. Also fix a
comment right before that, and document the W83627UHG as reporting up
to 3 temperatures.Signed-off-by: Jean Delvare
Cc: Guenter Roeck
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck -
The driver probe function leaked memory if creating the cpu0_vid attribute file
failed. Fix by converting the driver to use devm_kzalloc.Signed-off-by: Guenter Roeck
Cc: stable@vger.kernel.org # 2.6.32+
Acked-by: Jean Delvare -
NCT6775F and NCT6776F have their own set of registers for FAN_STOP_TIME. The
correct registers were used to read FAN_STOP_TIME, but writes used the wrong
registers. Fix it.Signed-off-by: Guenter Roeck
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare
09 Feb, 2012
1 commit
-
Commit ec3e5a16446fef1891611fe3bdfa5954d1ddf5e4 slipped in some duplicate code.
Remove it.Signed-off-by: Guenter Roeck
Acked-by: Jean Delvare
05 Feb, 2012
1 commit
-
NCT6776F can select fan input pins for fans 3 to 5 with a secondary set of
chip register bits. Check that second set of bits in addition to the first set
to detect if fans 3..5 are monitored.Signed-off-by: Guenter Roeck
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare
30 Jan, 2012
1 commit
-
NCT6776F only supports pwm mode for pwm2 and pwm3. Return error if an attempt
is made to set those pwm channels to DC mode.Signed-off-by: Guenter Roeck
Acked-by: Jean Delvare
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck
06 Jan, 2012
1 commit
-
replaced strict_strtol with kstrtol and
replaced strict_strtuol with kstrtuolThis satisfies checkpatch -f
Compile tested only: no warnings or errors givenSigned-off-by: Frans Meulenbroeks
Signed-off-by: Guenter Roeck
07 Nov, 2011
1 commit
-
Commit 2265cef2 (hwmon: (w83627ehf) Properly report PECI and AMD-SI
sensor types) results in kernel panic if data->temp_label was not
initialized.
The problem was found with chip W83627DHG-P.Add check if data->temp->label was set before use.
Based on incomplete patch by Alexander Beregalov.
Reported-by: Alexander Beregalov
Tested-by: Alexander Beregalov
Cc: stable@kernel.org
Signed-off-by: Guenter Roeck
Signed-off-by: Jean Delvare
04 Nov, 2011
3 commits
-
This is essentially a stripped down version of the W83627DHG. Noticeable
difference is that it is still powered with +5V, as older models, even
though the ADC resolution is 8 mV as newer models have.Thanks to Ulf Bruman (Saab Group) for doing all the testing.
Signed-off-by: Jean Delvare
Acked-by: Guenter Roeck -
The probe function has grown pretty large, I think it's time for some
cleanups, starting with these two simple ones:
* Move temp3/in6 check for the W83667HG later in the function, where
it is done for all other chip types.
* Move temperature register setting to a separate function, to avoid
code duplication.Signed-off-by: Jean Delvare
Acked-by: Guenter Roeck -
When temperature sources are PECI or AMD-SI agents, it makes no sense
to report their type as diode or thermistor. Instead we must report
their digital nature.Signed-off-by: Jean Delvare
Cc: stable@kernel.org
Acked-by: Guenter Roeck