diff options
author | Thierry Reding <treding@nvidia.com> | 2015-07-03 08:56:46 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2015-08-13 07:47:49 -0400 |
commit | 9e532b3ad9a7fc5f00d29c766439ffbdcc403146 (patch) | |
tree | fd6ea2378378a77902d4f795bb339ab6d1880cc5 | |
parent | 3227166c3bd64dc3a44b7a1bf79efff34ec27aa3 (diff) |
drm/tegra: dpaux: Disable interrupt when detached
When the DPAUX isn't attached to an SOR the interrupts are not useful.
This also prevents a race that could potentially cause a crash on driver
removal.
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/drm/tegra/dpaux.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 909072d95077..224a7dc8e4ed 100644 --- a/drivers/gpu/drm/tegra/dpaux.c +++ b/drivers/gpu/drm/tegra/dpaux.c | |||
@@ -352,6 +352,8 @@ static int tegra_dpaux_probe(struct platform_device *pdev) | |||
352 | return err; | 352 | return err; |
353 | } | 353 | } |
354 | 354 | ||
355 | disable_irq(dpaux->irq); | ||
356 | |||
355 | dpaux->aux.transfer = tegra_dpaux_transfer; | 357 | dpaux->aux.transfer = tegra_dpaux_transfer; |
356 | dpaux->aux.dev = &pdev->dev; | 358 | dpaux->aux.dev = &pdev->dev; |
357 | 359 | ||
@@ -468,8 +470,10 @@ int tegra_dpaux_attach(struct tegra_dpaux *dpaux, struct tegra_output *output) | |||
468 | enum drm_connector_status status; | 470 | enum drm_connector_status status; |
469 | 471 | ||
470 | status = tegra_dpaux_detect(dpaux); | 472 | status = tegra_dpaux_detect(dpaux); |
471 | if (status == connector_status_connected) | 473 | if (status == connector_status_connected) { |
474 | enable_irq(dpaux->irq); | ||
472 | return 0; | 475 | return 0; |
476 | } | ||
473 | 477 | ||
474 | usleep_range(1000, 2000); | 478 | usleep_range(1000, 2000); |
475 | } | 479 | } |
@@ -482,6 +486,8 @@ int tegra_dpaux_detach(struct tegra_dpaux *dpaux) | |||
482 | unsigned long timeout; | 486 | unsigned long timeout; |
483 | int err; | 487 | int err; |
484 | 488 | ||
489 | disable_irq(dpaux->irq); | ||
490 | |||
485 | err = regulator_disable(dpaux->vdd); | 491 | err = regulator_disable(dpaux->vdd); |
486 | if (err < 0) | 492 | if (err < 0) |
487 | return err; | 493 | return err; |