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

    Dan Carpenter
     

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

    Guenter Roeck
     

24 Jan, 2020

6 commits


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 usa

    extracted 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

    Thomas Gleixner
     

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

    Katsumi Sato
     

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

    Julia Lawall
     

03 Jul, 2015

1 commit


20 Oct, 2014

1 commit


30 Jan, 2014

1 commit


12 Aug, 2013

2 commits


22 Jun, 2013

1 commit


08 Apr, 2013

1 commit


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

    Guenter Roeck
     

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

    Jean Delvare
     
  • 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

    Jean Delvare
     

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

    Bill Pemberton
     
  • 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

    Bill Pemberton
     
  • 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

    Bill Pemberton
     

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

    Jean Delvare
     

22 Jul, 2012

1 commit


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 with

    error: $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

    Uwe Kleine-König
     

19 Mar, 2012

2 commits


13 Mar, 2012

3 commits


09 Feb, 2012

1 commit


05 Feb, 2012

1 commit


30 Jan, 2012

1 commit


06 Jan, 2012

1 commit


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

    Guenter Roeck
     

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

    Jean Delvare
     
  • 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

    Jean Delvare
     
  • 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

    Jean Delvare