Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Zev Weiss <zev@bewilderbeest.net>
To: "Zoltán Kővágó" <dirty.ice.hu@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org
Subject: Re: PROBLEM: NCT6775: suspend doesn't work after updating to Linux 5.19
Date: Tue, 9 Aug 2022 13:56:21 -0700	[thread overview]
Message-ID: <YvLJ9TQeXP/miUgT@hatter.bewilderbeest.net> (raw)
In-Reply-To: <f5990ef1-4efe-d2b1-8e50-c6890526c054@gmail.com>

On Tue, Aug 09, 2022 at 01:27:48PM PDT, Zoltán Kővágó wrote:
>Hi,
>
>[1.] One line summary of the problem:
>NCT6775: suspend doesn't work after updating to Linux 5.19
>
>[2.] Full description of the problem/report:
>After updating my kernel from 5.18.11 to 5.19, I've noticed that 
>resuming after suspend no longer works: fans start up, then about a 
>second later, the computer just shuts down, leaving the USB ports 
>powered up (normally it turns them off on shutdown). The screens don't 
>turn on during this timeframe, so I can't see any useful log messages.
>
>Bisecting between 5.18 (where it still worked) and 5.19 lead me to 
>commit c3963bc0a0cf9ecb205a9d4976eb92b6df2fa3fd "hwmon: (nct6775) 
>Split core and platform driver" which looks like a refactor commit, 
>but apparently it broke something.
>

Hi Zoltán,

Thanks for the thorough bug report.  You're right that that commit was 
essentially just a refactor, though there was one slight change to the 
nct6775_suspend() function introduced during the review process that 
may perhaps have had some subtle unintended side-effects.

Can you test the following patch and report if it resolves the problem?


Thanks,
Zev

diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 446964cbae4c..da9ec6983e13 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1480,7 +1480,7 @@ static int nct6775_update_pwm_limits(struct device *dev)
  	return 0;
  }
  
-static struct nct6775_data *nct6775_update_device(struct device *dev)
+struct nct6775_data *nct6775_update_device(struct device *dev)
  {
  	struct nct6775_data *data = dev_get_drvdata(dev);
  	int i, j, err = 0;
@@ -1615,6 +1615,7 @@ static struct nct6775_data *nct6775_update_device(struct device *dev)
  	mutex_unlock(&data->update_lock);
  	return err ? ERR_PTR(err) : data;
  }
+EXPORT_SYMBOL_GPL(nct6775_update_device);
  
  /*
   * Sysfs callback functions
diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
index ab30437221ce..41c97cfacfb8 100644
--- a/drivers/hwmon/nct6775-platform.c
+++ b/drivers/hwmon/nct6775-platform.c
@@ -359,7 +359,7 @@ static int __maybe_unused nct6775_suspend(struct device *dev)
  {
  	int err;
  	u16 tmp;
-	struct nct6775_data *data = dev_get_drvdata(dev);
+	struct nct6775_data *data = nct6775_update_device(dev);
  
  	if (IS_ERR(data))
  		return PTR_ERR(data);
diff --git a/drivers/hwmon/nct6775.h b/drivers/hwmon/nct6775.h
index 93f708148e65..be41848c3cd2 100644
--- a/drivers/hwmon/nct6775.h
+++ b/drivers/hwmon/nct6775.h
@@ -196,6 +196,8 @@ static inline int nct6775_write_value(struct nct6775_data *data, u16 reg, u16 va
  	return regmap_write(data->regmap, reg, value);
  }
  
+struct nct6775_data *nct6775_update_device(struct device *dev);
+
  bool nct6775_reg_is_word_sized(struct nct6775_data *data, u16 reg);
  int nct6775_probe(struct device *dev, struct nct6775_data *data,
  		  const struct regmap_config *regmapcfg);


       reply	other threads:[~2022-08-09 21:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f5990ef1-4efe-d2b1-8e50-c6890526c054@gmail.com>
2022-08-09 20:56 ` Zev Weiss [this message]
2022-08-09 21:28   ` PROBLEM: NCT6775: suspend doesn't work after updating to Linux 5.19 Zoltán Kővágó
2022-08-09 22:34     ` Zev Weiss
2022-08-09 23:50       ` Zoltán Kővágó
2022-08-10  1:39         ` Zev Weiss
2022-08-10  3:00           ` Armin Wolf
2022-08-10  3:36             ` Guenter Roeck
2022-08-10  6:03               ` Zev Weiss
2022-08-10  7:33                 ` Guenter Roeck
2022-08-10 22:56                   ` Zev Weiss
2022-08-11  0:20                     ` Guenter Roeck
2022-08-10  8:22           ` Zoltán Kővágó
2022-08-10 22:59             ` Zev Weiss
2022-08-10  0:03       ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YvLJ9TQeXP/miUgT@hatter.bewilderbeest.net \
    --to=zev@bewilderbeest.net \
    --cc=dirty.ice.hu@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox