Message ID | 1394533830-30150-21-git-send-email-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Mar 11, 2014 at 8:30 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > There's not really any value in stating that no locking is needed. And > even if the comment is useful, a check for the right mutex at the > beginning of the function is better since that can't be ingored as > easily as a bit of documentation. > > Note that drm_mode_probed_add in drm_crtc.c is also changed, the next > patch will move this into drm_modes.c > > v2: Don't add locking WARN_ONs where it is not strictly required (i.e. > the two functions to validate/prune mode lists). This made radeon blow up hard, I kinda expect other drivers also, >Mar 20 01:14:21 crydee kernel: ------------[ cut here ]------------ Mar 20 01:14:21 crydee kernel: WARNING: CPU: 3 PID: 882 at /home/airlied/kernel/linux-2.6/drivers/gpu/drm/drm_crtc.c:94 drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm]() Mar 20 01:14:21 crydee kernel: Modules linked in: firewire_ohci firewire_core crc_itu_t ehci_pci ohci_pci ehci_hcd ohci_hcd radeon(+) hwmon i2c_algo_bit drm_kms_helper ttm drm i2c_core Mar 20 01:14:21 crydee kernel: CPU: 3 PID: 882 Comm: systemd-udevd Not tainted 3.14.0-rc7+ #67 Mar 20 01:14:21 crydee kernel: Hardware name: Gigabyte Technology Co., Ltd. GA-A75M-UD2H/GA-A75M-UD2H, BIOS F4 09/16/2011 Mar 20 01:14:21 crydee kernel: 0000000000000000 ffff88022311f9c8 ffffffff814b5b21 0000000000000000 Mar 20 01:14:21 crydee kernel: ffff88022311fa00 ffffffff81039e11 ffffffffa001882f ffff880036b92000 Mar 20 01:14:21 crydee kernel: ffff880224c85000 ffff880224c85690 0000000000000000 ffff88022311fa10 Mar 20 01:14:21 crydee kernel: Call Trace: Mar 20 01:14:21 crydee kernel: [<ffffffff814b5b21>] dump_stack+0x4d/0x66 Mar 20 01:14:21 crydee kernel: [<ffffffff81039e11>] warn_slowpath_common+0x7a/0x93 Mar 20 01:14:21 crydee kernel: [<ffffffffa001882f>] ? drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm] Mar 20 01:14:21 crydee kernel: [<ffffffff81039ec9>] warn_slowpath_null+0x15/0x17 Mar 20 01:14:21 crydee kernel: [<ffffffffa001882f>] drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm] Mar 20 01:14:21 crydee kernel: [<ffffffffa00853b4>] drm_helper_disable_unused_functions+0x11/0x103 [drm_kms_helper] Mar 20 01:14:21 crydee kernel: [<ffffffffa00c39ed>] radeon_fbdev_init+0xb2/0xcf [radeon] Mar 20 01:14:21 crydee kernel: [<ffffffffa00bf623>] radeon_modeset_init+0x763/0x951 [radeon] Mar 20 01:14:21 crydee kernel: [<ffffffffa00a21f3>] radeon_driver_load_kms+0xc5/0x171 [radeon] Mar 20 01:14:21 crydee kernel: [<ffffffffa0013c53>] drm_dev_register+0x7f/0xf8 [drm] Mar 20 01:14:21 crydee kernel: [<ffffffffa0015e12>] drm_get_pci_dev+0xfe/0x1c8 [drm] Mar 20 01:14:21 crydee kernel: [<ffffffff81078ac0>] ? trace_hardirqs_on+0xd/0xf Mar 20 01:14:21 crydee kernel: [<ffffffffa009f341>] radeon_pci_probe+0xa8/0xaf [radeon] Mar 20 01:14:21 crydee kernel: [<ffffffff81285376>] local_pci_probe+0x38/0x7d Mar 20 01:14:21 crydee kernel: [<ffffffff81285481>] pci_device_probe+0xc6/0xec Mar 20 01:14:21 crydee kernel: [<ffffffff813149a5>] driver_probe_device+0x98/0x1b3 Mar 20 01:14:21 crydee kernel: [<ffffffff81314b54>] __driver_attach+0x5c/0x7e Mar 20 01:14:21 crydee kernel: [<ffffffff81314af8>] ? __device_attach+0x38/0x38 Mar 20 01:14:21 crydee kernel: [<ffffffff813130ae>] bus_for_each_dev+0x79/0x83 Mar 20 01:14:21 crydee kernel: [<ffffffff8131452c>] driver_attach+0x19/0x1b Mar 20 01:14:21 crydee kernel: [<ffffffff813141ee>] bus_add_driver+0x109/0x1d3 Mar 20 01:14:21 crydee kernel: [<ffffffff81315095>] driver_register+0x89/0xc5 Mar 20 01:14:21 crydee kernel: [<ffffffff81284acd>] __pci_register_driver+0x5b/0x5e Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1000>] ? 0xffffffffa01c0fff Mar 20 01:14:21 crydee kernel: [<ffffffffa0015f45>] drm_pci_init+0x69/0xec [drm] Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1000>] ? 0xffffffffa01c0fff Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1097>] radeon_init+0x97/0xb5 [radeon] Dave.
On Thu, Mar 20, 2014 at 11:31:26AM +1000, Dave Airlie wrote: > On Tue, Mar 11, 2014 at 8:30 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > > There's not really any value in stating that no locking is needed. And > > even if the comment is useful, a check for the right mutex at the > > beginning of the function is better since that can't be ingored as > > easily as a bit of documentation. > > > > Note that drm_mode_probed_add in drm_crtc.c is also changed, the next > > patch will move this into drm_modes.c > > > > v2: Don't add locking WARN_ONs where it is not strictly required (i.e. > > the two functions to validate/prune mode lists). > > This made radeon blow up hard, I kinda expect other drivers also, > > > >Mar 20 01:14:21 crydee kernel: ------------[ cut here ]------------ > Mar 20 01:14:21 crydee kernel: WARNING: CPU: 3 PID: 882 at > /home/airlied/kernel/linux-2.6/drivers/gpu/drm/drm_crtc.c:94 > drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm]() > Mar 20 01:14:21 crydee kernel: Modules linked in: firewire_ohci > firewire_core crc_itu_t ehci_pci ohci_pci ehci_hcd ohci_hcd radeon(+) > hwmon i2c_algo_bit drm_kms_helper ttm drm i2c_core > Mar 20 01:14:21 crydee kernel: CPU: 3 PID: 882 Comm: systemd-udevd Not > tainted 3.14.0-rc7+ #67 > Mar 20 01:14:21 crydee kernel: Hardware name: Gigabyte Technology Co., > Ltd. GA-A75M-UD2H/GA-A75M-UD2H, BIOS F4 09/16/2011 > Mar 20 01:14:21 crydee kernel: 0000000000000000 ffff88022311f9c8 > ffffffff814b5b21 0000000000000000 > Mar 20 01:14:21 crydee kernel: ffff88022311fa00 ffffffff81039e11 > ffffffffa001882f ffff880036b92000 > Mar 20 01:14:21 crydee kernel: ffff880224c85000 ffff880224c85690 > 0000000000000000 ffff88022311fa10 > Mar 20 01:14:21 crydee kernel: Call Trace: > Mar 20 01:14:21 crydee kernel: [<ffffffff814b5b21>] dump_stack+0x4d/0x66 > Mar 20 01:14:21 crydee kernel: [<ffffffff81039e11>] > warn_slowpath_common+0x7a/0x93 > Mar 20 01:14:21 crydee kernel: [<ffffffffa001882f>] ? > drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm] > Mar 20 01:14:21 crydee kernel: [<ffffffff81039ec9>] > warn_slowpath_null+0x15/0x17 > Mar 20 01:14:21 crydee kernel: [<ffffffffa001882f>] > drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm] > Mar 20 01:14:21 crydee kernel: [<ffffffffa00853b4>] > drm_helper_disable_unused_functions+0x11/0x103 [drm_kms_helper] > Mar 20 01:14:21 crydee kernel: [<ffffffffa00c39ed>] > radeon_fbdev_init+0xb2/0xcf [radeon] > Mar 20 01:14:21 crydee kernel: [<ffffffffa00bf623>] > radeon_modeset_init+0x763/0x951 [radeon] > Mar 20 01:14:21 crydee kernel: [<ffffffffa00a21f3>] > radeon_driver_load_kms+0xc5/0x171 [radeon] > Mar 20 01:14:21 crydee kernel: [<ffffffffa0013c53>] > drm_dev_register+0x7f/0xf8 [drm] > Mar 20 01:14:21 crydee kernel: [<ffffffffa0015e12>] > drm_get_pci_dev+0xfe/0x1c8 [drm] > Mar 20 01:14:21 crydee kernel: [<ffffffff81078ac0>] ? trace_hardirqs_on+0xd/0xf > Mar 20 01:14:21 crydee kernel: [<ffffffffa009f341>] > radeon_pci_probe+0xa8/0xaf [radeon] > Mar 20 01:14:21 crydee kernel: [<ffffffff81285376>] local_pci_probe+0x38/0x7d > Mar 20 01:14:21 crydee kernel: [<ffffffff81285481>] pci_device_probe+0xc6/0xec > Mar 20 01:14:21 crydee kernel: [<ffffffff813149a5>] > driver_probe_device+0x98/0x1b3 > Mar 20 01:14:21 crydee kernel: [<ffffffff81314b54>] __driver_attach+0x5c/0x7e > Mar 20 01:14:21 crydee kernel: [<ffffffff81314af8>] ? __device_attach+0x38/0x38 > Mar 20 01:14:21 crydee kernel: [<ffffffff813130ae>] bus_for_each_dev+0x79/0x83 > Mar 20 01:14:21 crydee kernel: [<ffffffff8131452c>] driver_attach+0x19/0x1b > Mar 20 01:14:21 crydee kernel: [<ffffffff813141ee>] bus_add_driver+0x109/0x1d3 > Mar 20 01:14:21 crydee kernel: [<ffffffff81315095>] driver_register+0x89/0xc5 > Mar 20 01:14:21 crydee kernel: [<ffffffff81284acd>] > __pci_register_driver+0x5b/0x5e > Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1000>] ? 0xffffffffa01c0fff > Mar 20 01:14:21 crydee kernel: [<ffffffffa0015f45>] > drm_pci_init+0x69/0xec [drm] > Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1000>] ? 0xffffffffa01c0fff > Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1097>] > radeon_init+0x97/0xb5 [radeon] > > Dave. i915 gets 3 distinct WARNs from this patch.
On Sat, Mar 22, 2014 at 7:45 AM, Ben Widawsky <ben@bwidawsk.net> wrote: > On Thu, Mar 20, 2014 at 11:31:26AM +1000, Dave Airlie wrote: >> On Tue, Mar 11, 2014 at 8:30 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote: >> > There's not really any value in stating that no locking is needed. And >> > even if the comment is useful, a check for the right mutex at the >> > beginning of the function is better since that can't be ingored as >> > easily as a bit of documentation. >> > >> > Note that drm_mode_probed_add in drm_crtc.c is also changed, the next >> > patch will move this into drm_modes.c >> > >> > v2: Don't add locking WARN_ONs where it is not strictly required (i.e. >> > the two functions to validate/prune mode lists). >> >> This made radeon blow up hard, I kinda expect other drivers also, >> >> >> >Mar 20 01:14:21 crydee kernel: ------------[ cut here ]------------ >> Mar 20 01:14:21 crydee kernel: WARNING: CPU: 3 PID: 882 at >> /home/airlied/kernel/linux-2.6/drivers/gpu/drm/drm_crtc.c:94 >> drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm]() >> Mar 20 01:14:21 crydee kernel: Modules linked in: firewire_ohci >> firewire_core crc_itu_t ehci_pci ohci_pci ehci_hcd ohci_hcd radeon(+) >> hwmon i2c_algo_bit drm_kms_helper ttm drm i2c_core >> Mar 20 01:14:21 crydee kernel: CPU: 3 PID: 882 Comm: systemd-udevd Not >> tainted 3.14.0-rc7+ #67 >> Mar 20 01:14:21 crydee kernel: Hardware name: Gigabyte Technology Co., >> Ltd. GA-A75M-UD2H/GA-A75M-UD2H, BIOS F4 09/16/2011 >> Mar 20 01:14:21 crydee kernel: 0000000000000000 ffff88022311f9c8 >> ffffffff814b5b21 0000000000000000 >> Mar 20 01:14:21 crydee kernel: ffff88022311fa00 ffffffff81039e11 >> ffffffffa001882f ffff880036b92000 >> Mar 20 01:14:21 crydee kernel: ffff880224c85000 ffff880224c85690 >> 0000000000000000 ffff88022311fa10 >> Mar 20 01:14:21 crydee kernel: Call Trace: >> Mar 20 01:14:21 crydee kernel: [<ffffffff814b5b21>] dump_stack+0x4d/0x66 >> Mar 20 01:14:21 crydee kernel: [<ffffffff81039e11>] >> warn_slowpath_common+0x7a/0x93 >> Mar 20 01:14:21 crydee kernel: [<ffffffffa001882f>] ? >> drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm] >> Mar 20 01:14:21 crydee kernel: [<ffffffff81039ec9>] >> warn_slowpath_null+0x15/0x17 >> Mar 20 01:14:21 crydee kernel: [<ffffffffa001882f>] >> drm_warn_on_modeset_not_all_locked+0x48/0x76 [drm] >> Mar 20 01:14:21 crydee kernel: [<ffffffffa00853b4>] >> drm_helper_disable_unused_functions+0x11/0x103 [drm_kms_helper] >> Mar 20 01:14:21 crydee kernel: [<ffffffffa00c39ed>] >> radeon_fbdev_init+0xb2/0xcf [radeon] >> Mar 20 01:14:21 crydee kernel: [<ffffffffa00bf623>] >> radeon_modeset_init+0x763/0x951 [radeon] >> Mar 20 01:14:21 crydee kernel: [<ffffffffa00a21f3>] >> radeon_driver_load_kms+0xc5/0x171 [radeon] >> Mar 20 01:14:21 crydee kernel: [<ffffffffa0013c53>] >> drm_dev_register+0x7f/0xf8 [drm] >> Mar 20 01:14:21 crydee kernel: [<ffffffffa0015e12>] >> drm_get_pci_dev+0xfe/0x1c8 [drm] >> Mar 20 01:14:21 crydee kernel: [<ffffffff81078ac0>] ? trace_hardirqs_on+0xd/0xf >> Mar 20 01:14:21 crydee kernel: [<ffffffffa009f341>] >> radeon_pci_probe+0xa8/0xaf [radeon] >> Mar 20 01:14:21 crydee kernel: [<ffffffff81285376>] local_pci_probe+0x38/0x7d >> Mar 20 01:14:21 crydee kernel: [<ffffffff81285481>] pci_device_probe+0xc6/0xec >> Mar 20 01:14:21 crydee kernel: [<ffffffff813149a5>] >> driver_probe_device+0x98/0x1b3 >> Mar 20 01:14:21 crydee kernel: [<ffffffff81314b54>] __driver_attach+0x5c/0x7e >> Mar 20 01:14:21 crydee kernel: [<ffffffff81314af8>] ? __device_attach+0x38/0x38 >> Mar 20 01:14:21 crydee kernel: [<ffffffff813130ae>] bus_for_each_dev+0x79/0x83 >> Mar 20 01:14:21 crydee kernel: [<ffffffff8131452c>] driver_attach+0x19/0x1b >> Mar 20 01:14:21 crydee kernel: [<ffffffff813141ee>] bus_add_driver+0x109/0x1d3 >> Mar 20 01:14:21 crydee kernel: [<ffffffff81315095>] driver_register+0x89/0xc5 >> Mar 20 01:14:21 crydee kernel: [<ffffffff81284acd>] >> __pci_register_driver+0x5b/0x5e >> Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1000>] ? 0xffffffffa01c0fff >> Mar 20 01:14:21 crydee kernel: [<ffffffffa0015f45>] >> drm_pci_init+0x69/0xec [drm] >> Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1000>] ? 0xffffffffa01c0fff >> Mar 20 01:14:21 crydee kernel: [<ffffffffa01c1097>] >> radeon_init+0x97/0xb5 [radeon] >> >> Dave. > > i915 gets 3 distinct WARNs from this patch. You've tested with latest -nightly? Should all be addressed now for i915, one patch in dinq and 3 in drm-next. If not then please show the remaining backtraces. -Daniel
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index ea620f4cf6c7..353ff6398c36 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -730,6 +730,8 @@ EXPORT_SYMBOL(drm_crtc_index); void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode) { + WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); + list_add_tail(&mode->head, &connector->probed_modes); } EXPORT_SYMBOL(drm_mode_probed_add); diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 4892194937f3..be86fed30fda 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -42,9 +42,6 @@ * drm_mode_debug_printmodeline - print a mode to dmesg * @mode: mode to print * - * LOCKING: - * none. - * * Describe @mode using DRM_DEBUG. */ void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) @@ -69,9 +66,6 @@ EXPORT_SYMBOL(drm_mode_debug_printmodeline); * @interlaced:Whether the interlace is supported * @margins: whether to add margins or not * - * LOCKING: - * none. - * * return the modeline based on CVT algorithm * * This function is called to generate the modeline based on CVT algorithm @@ -294,9 +288,6 @@ EXPORT_SYMBOL(drm_cvt_mode); * @GTF_K: extended GTF formula parameters * @GTF_2J: extended GTF formula parameters * - * LOCKING. - * none. - * * return the modeline based on full GTF algorithm. * * GTF feature blocks specify C and J in multiples of 0.5, so we pass them @@ -479,9 +470,6 @@ EXPORT_SYMBOL(drm_gtf_mode_complex); * @interlaced :whether the interlace is supported * @margins :whether the margin is supported * - * LOCKING. - * none. - * * return the modeline based on GTF algorithm * * This function is to create the modeline based on the GTF algorithm. @@ -584,9 +572,6 @@ EXPORT_SYMBOL_GPL(of_get_drm_display_mode); * drm_mode_set_name - set the name on a mode * @mode: name will be set in this mode * - * LOCKING: - * None. - * * Set the name of @mode to a standard format. */ void drm_mode_set_name(struct drm_display_mode *mode) @@ -603,9 +588,6 @@ EXPORT_SYMBOL(drm_mode_set_name); * drm_mode_width - get the width of a mode * @mode: mode * - * LOCKING: - * None. - * * Return @mode's width (hdisplay) value. * * FIXME: is this needed? @@ -624,9 +606,6 @@ EXPORT_SYMBOL(drm_mode_width); * drm_mode_height - get the height of a mode * @mode: mode * - * LOCKING: - * None. - * * Return @mode's height (vdisplay) value. * * FIXME: is this needed? @@ -643,9 +622,6 @@ EXPORT_SYMBOL(drm_mode_height); /** drm_mode_hsync - get the hsync of a mode * @mode: mode * - * LOCKING: - * None. - * * Return @modes's hsync rate in kHz, rounded to the nearest int. */ int drm_mode_hsync(const struct drm_display_mode *mode) @@ -670,9 +646,6 @@ EXPORT_SYMBOL(drm_mode_hsync); * drm_mode_vrefresh - get the vrefresh of a mode * @mode: mode * - * LOCKING: - * None. - * * Return @mode's vrefresh rate in Hz or calculate it if necessary. * * FIXME: why is this needed? shouldn't vrefresh be set already? @@ -713,9 +686,6 @@ EXPORT_SYMBOL(drm_mode_vrefresh); * @p: mode * @adjust_flags: a combination of adjustment flags * - * LOCKING: - * None. - * * Setup the CRTC modesetting parameters for @p, adjusting if necessary. * * - The CRTC_INTERLACE_HALVE_V flag can be used to halve vertical timings of @@ -790,9 +760,6 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo); * @dst: mode to overwrite * @src: mode to copy * - * LOCKING: - * None. - * * Copy an existing mode into another mode, preserving the object id and * list head of the destination mode. */ @@ -812,9 +779,6 @@ EXPORT_SYMBOL(drm_mode_copy); * @dev: drm_device to allocate the duplicated mode for * @mode: mode to duplicate * - * LOCKING: - * None. - * * Just allocate a new mode, copy the existing mode into it, and return * a pointer to it. Used to create new instances of established modes. */ @@ -838,9 +802,6 @@ EXPORT_SYMBOL(drm_mode_duplicate); * @mode1: first mode * @mode2: second mode * - * LOCKING: - * None. - * * Check to see if @mode1 and @mode2 are equivalent. * * RETURNS: @@ -869,9 +830,6 @@ EXPORT_SYMBOL(drm_mode_equal); * @mode1: first mode * @mode2: second mode * - * LOCKING: - * None. - * * Check to see if @mode1 and @mode2 are equivalent, but * don't check the pixel clocks nor the stereo layout. * @@ -907,9 +865,6 @@ EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo); * @maxY: maximum height * @maxPitch: max pitch * - * LOCKING: - * Caller must hold a lock protecting @mode_list. - * * The DRM device (@dev) has size and pitch limits. Here we validate the * modes we probed for @dev against those limits and set their status as * necessary. @@ -939,9 +894,6 @@ EXPORT_SYMBOL(drm_mode_validate_size); * @mode_list: list of modes to check * @verbose: be verbose about it * - * LOCKING: - * Caller must hold a lock protecting @mode_list. - * * Once mode list generation is complete, a caller can use this routine to * remove invalid modes from a mode list. If any of the modes have a * status other than %MODE_OK, they are removed from @mode_list and freed. @@ -971,9 +923,6 @@ EXPORT_SYMBOL(drm_mode_prune_invalid); * @lh_a: list_head for first mode * @lh_b: list_head for second mode * - * LOCKING: - * None. - * * Compare two modes, given by @lh_a and @lh_b, returning a value indicating * which is better. * @@ -1007,9 +956,6 @@ static int drm_mode_compare(void *priv, struct list_head *lh_a, struct list_head * drm_mode_sort - sort mode list * @mode_list: list to sort * - * LOCKING: - * Caller must hold a lock protecting @mode_list. - * * Sort @mode_list by favorability, putting good modes first. */ void drm_mode_sort(struct list_head *mode_list) @@ -1022,9 +968,6 @@ EXPORT_SYMBOL(drm_mode_sort); * drm_mode_connector_list_update - update the mode list for the connector * @connector: the connector to update * - * LOCKING: - * Caller must hold a lock protecting @mode_list. - * * This moves the modes from the @connector probed_modes list * to the actual mode list. It compares the probed mode against the current * list and only adds different modes. All modes unverified after this point @@ -1036,6 +979,8 @@ void drm_mode_connector_list_update(struct drm_connector *connector) struct drm_display_mode *pmode, *pt; int found_it; + WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); + list_for_each_entry_safe(pmode, pt, &connector->probed_modes, head) { found_it = 0;
There's not really any value in stating that no locking is needed. And even if the comment is useful, a check for the right mutex at the beginning of the function is better since that can't be ingored as easily as a bit of documentation. Note that drm_mode_probed_add in drm_crtc.c is also changed, the next patch will move this into drm_modes.c v2: Don't add locking WARN_ONs where it is not strictly required (i.e. the two functions to validate/prune mode lists). Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/gpu/drm/drm_crtc.c | 2 ++ drivers/gpu/drm/drm_modes.c | 59 ++------------------------------------------- 2 files changed, 4 insertions(+), 57 deletions(-)