Fix problem with hotplug state machine in coretemp driver

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZHMNZAAoJEMsfJm/On5mBJaoP/jC3CTcP4SDufSiPyAAAcjxa
 oMMbWsLhx5miI6n5sH4Zkt7Y0cXSM7OX5Zj0kSTXKRTk51eLBwLCu5KFdkhs/5pr
 p/zfG795ZIwaO0JmxTb11+BAI2qjKW3u82OopSEpHI7VFwSmet8ibaEFsOgXxKeC
 kteaVQX1Q9HoHkVlD+o/J1QOEqw/cFk6uF1GxFmv3vvurTj1YAvoTEzPepyXtrs4
 AXa//jQ4NaS47azq67G/HxJn92lAGsgJn0o4QKFiPuq+jA4vbeSkMzZWIp2j8S9f
 k+X7nZ5VyMMRss/W8+2q68FRFyP207KgcDJcTs0qEZPsdGgB4Y39RTMtzFbqEBLn
 QdLFvHrWoAmWfxWQNU7GIxO0msM9KY08M2zgUlhFV6H+aAizN57gDdU3DgVrHupV
 HVA1DncpJLWWB61ZxXdlMT3aB+9aDYxPhYl0EKJ7r3JM2DKWTklpQbrrM2FDVGz4
 4tQJ43VojfE6Q4vOxbVjHHJfSUaIvtlrWXJmTc9b2C+oyRznwU+c2xYrGqTXVQIK
 kuFEkjAvfoPwwf4qA9I+JLXJXzL7gNdqgZiWOdghifBm10TrQzBQ+RkQgA4X+lxA
 v393R3/dPf7TvutQfpoUb/+/eiwMlddJZFECX+9NbxCz+0/RlcLKmLQZB1WaT3lU
 VvXqVgfh73uQTihimBfG
 =xrK3
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fix from Guenter Roeck:
 "Fix problem with hotplug state machine in coretemp driver"

* tag 'hwmon-for-linus-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (coretemp) Handle frozen hotplug state correctly
This commit is contained in:
Linus Torvalds 2017-05-18 09:38:09 -07:00
Родитель dac94e2911 90b4f30b6d
Коммит af5d28565f
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -604,6 +604,13 @@ static int coretemp_cpu_online(unsigned int cpu)
struct cpuinfo_x86 *c = &cpu_data(cpu); struct cpuinfo_x86 *c = &cpu_data(cpu);
struct platform_data *pdata; struct platform_data *pdata;
/*
* Don't execute this on resume as the offline callback did
* not get executed on suspend.
*/
if (cpuhp_tasks_frozen)
return 0;
/* /*
* CPUID.06H.EAX[0] indicates whether the CPU has thermal * CPUID.06H.EAX[0] indicates whether the CPU has thermal
* sensors. We check this bit only, all the early CPUs * sensors. We check this bit only, all the early CPUs
@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsigned int cpu)
struct temp_data *tdata; struct temp_data *tdata;
int indx, target; int indx, target;
/*
* Don't execute this on suspend as the device remove locks
* up the machine.
*/
if (cpuhp_tasks_frozen)
return 0;
/* If the physical CPU device does not exist, just return */ /* If the physical CPU device does not exist, just return */
if (!pdev) if (!pdev)
return 0; return 0;