File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1647,6 +1647,8 @@ static int ast_dp501_output_init(struct ast_device *ast)
1647
1647
static int ast_astdp_connector_helper_get_modes (struct drm_connector * connector )
1648
1648
{
1649
1649
void * edid ;
1650
+ struct drm_device * dev = connector -> dev ;
1651
+ struct ast_device * ast = to_ast_device (dev );
1650
1652
1651
1653
int succ ;
1652
1654
int count ;
@@ -1655,17 +1657,26 @@ static int ast_astdp_connector_helper_get_modes(struct drm_connector *connector)
1655
1657
if (!edid )
1656
1658
goto err_drm_connector_update_edid_property ;
1657
1659
1660
+ /*
1661
+ * Protect access to I/O registers from concurrent modesetting
1662
+ * by acquiring the I/O-register lock.
1663
+ */
1664
+ mutex_lock (& ast -> ioregs_lock );
1665
+
1658
1666
succ = ast_astdp_read_edid (connector -> dev , edid );
1659
1667
if (succ < 0 )
1660
- goto err_kfree ;
1668
+ goto err_mutex_unlock ;
1669
+
1670
+ mutex_unlock (& ast -> ioregs_lock );
1661
1671
1662
1672
drm_connector_update_edid_property (connector , edid );
1663
1673
count = drm_add_edid_modes (connector , edid );
1664
1674
kfree (edid );
1665
1675
1666
1676
return count ;
1667
1677
1668
- err_kfree :
1678
+ err_mutex_unlock :
1679
+ mutex_unlock (& ast -> ioregs_lock );
1669
1680
kfree (edid );
1670
1681
err_drm_connector_update_edid_property :
1671
1682
drm_connector_update_edid_property (connector , NULL );
You can’t perform that action at this time.
0 commit comments