Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1435621 > unrolled thread
| Started by | Eduardo Valentin <edubezval@gmail.com> |
|---|---|
| First post | 2016-07-01 23:00 +0200 |
| Last post | 2016-07-01 23:00 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 1/1] thermal: core: call thermal_zone_device_update() after mode update Eduardo Valentin <edubezval@gmail.com> - 2016-07-01 23:00 +0200
| From | Eduardo Valentin <edubezval@gmail.com> |
|---|---|
| Date | 2016-07-01 23:00 +0200 |
| Subject | Re: [PATCH 1/1] thermal: core: call thermal_zone_device_update() after mode update |
| Message-ID | <rQdHA-2R6-11@gated-at.bofh.it> |
On Thu, Jun 23, 2016 at 02:27:12PM +0200, Rafael J. Wysocki wrote: > On Wed, Jun 22, 2016 at 7:06 AM, Eduardo Valentin <edubezval@gmail.com> wrote: > > Because several drivers do the following pattern: > > .set_mode() > > ... > > local_data->mode = new_mode; > > thermal_zone_device_update(tz); > > > > makes sense to simply do the thermal_zone_device_update() > > in thermal core, after setting the new mode. > > > > Also, this patch also remove deadlocks on drivers that > > call thermal_zone_device_update() on .set_mode(), > > as .set_mode() is now called always with tz->lock held. > > To me, this part of the patch is way more important than the > optimization mentioned before. > > Apparently, the problem is that drivers deadlock, because the > thermal_zone_device_update() invoked from ->set_mode() is called under > tz->lock. > > So to address that problem you make the core call > thermal_zone_device_update() after ->set_mode() outside of tz->lock > and the drivers don't have to do it any more. > > Is that correct? Yes this is correct. The optimization is simply a consequence of the bug fix, as reported by Keerthy. > > Thanks, > Rafael
Back to top | Article view | linux.kernel
csiph-web