Commit f3e60a2
committed
fbdev: mxc_hdmi: hotplug: lock fb_info before modification
When an HDMI hotplug interrupt occurs, it schedules hotplug_worker(),
which indirectly makes one or more calls to fb_videomode_to_var() that
modify the fb_info struct associated with the HDMI connection. These can
occur concurrently with the handling of an FBIOPUT_VSCREENINFO ioctl
which also reads, modifies, and writes the same fields of fb_info,
leading to race conditions.
This patch holds the fb_info lock in mxc_hdmi_cable_connected() while
calling mxc_hdmi_set_mode(), eliminating those race conditions.
All of the hogplug handler's calls to fb_videomode_to_var() happen
either directly or indirectly from mxc_hdmi_set_mode(), which is called
from only one place, in mxc_hdmi_cable_connected(). That seems like the
most convenient, least invasive, easiest to get right place to take and
release the fb_info lock.1 parent 04b05c5 commit f3e60a2
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1974 | 1974 | | |
1975 | 1975 | | |
1976 | 1976 | | |
| 1977 | + | |
1977 | 1978 | | |
| 1979 | + | |
1978 | 1980 | | |
1979 | 1981 | | |
1980 | 1982 | | |
| |||
0 commit comments