diff options
author | Jani Nikula <ext-jani.1.nikula@nokia.com> | 2010-04-12 03:06:14 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-08-03 08:18:48 -0400 |
commit | 2c2fc151245df37dba17f4ae1760bfa97e4fd3c5 (patch) | |
tree | 59f9a374414d17392a20ea3d9d954c751fa9a44e /drivers | |
parent | ee52c0ae68c42c5a0c26462b141a521fcc70849a (diff) |
OMAP: DSS2: Taal: Change DSI bus locking to avoid deadlock in ESD work
Move dsi_bus_lock/unlock() out of taal_power_on/off() to avoid deadlock
in taal_esd_work().
Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 4e594bb50f4b..137bad23a64e 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -672,8 +672,6 @@ static int taal_power_on(struct omap_dss_device *dssdev) | |||
672 | /* it seems we have to wait a bit until taal is ready */ | 672 | /* it seems we have to wait a bit until taal is ready */ |
673 | msleep(5); | 673 | msleep(5); |
674 | 674 | ||
675 | dsi_bus_lock(); | ||
676 | |||
677 | r = omapdss_dsi_display_enable(dssdev); | 675 | r = omapdss_dsi_display_enable(dssdev); |
678 | if (r) { | 676 | if (r) { |
679 | dev_err(&dssdev->dev, "failed to enable DSI\n"); | 677 | dev_err(&dssdev->dev, "failed to enable DSI\n"); |
@@ -744,8 +742,6 @@ static int taal_power_on(struct omap_dss_device *dssdev) | |||
744 | 742 | ||
745 | omapdss_dsi_vc_enable_hs(TCH, true); | 743 | omapdss_dsi_vc_enable_hs(TCH, true); |
746 | 744 | ||
747 | dsi_bus_unlock(); | ||
748 | |||
749 | return 0; | 745 | return 0; |
750 | err: | 746 | err: |
751 | dev_err(&dssdev->dev, "error while enabling panel, issuing HW reset\n"); | 747 | dev_err(&dssdev->dev, "error while enabling panel, issuing HW reset\n"); |
@@ -754,8 +750,6 @@ err: | |||
754 | 750 | ||
755 | omapdss_dsi_display_disable(dssdev); | 751 | omapdss_dsi_display_disable(dssdev); |
756 | err0: | 752 | err0: |
757 | dsi_bus_unlock(); | ||
758 | |||
759 | return r; | 753 | return r; |
760 | } | 754 | } |
761 | 755 | ||
@@ -764,8 +758,6 @@ static void taal_power_off(struct omap_dss_device *dssdev) | |||
764 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | 758 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); |
765 | int r; | 759 | int r; |
766 | 760 | ||
767 | dsi_bus_lock(); | ||
768 | |||
769 | cancel_delayed_work(&td->esd_work); | 761 | cancel_delayed_work(&td->esd_work); |
770 | 762 | ||
771 | r = taal_dcs_write_0(DCS_DISPLAY_OFF); | 763 | r = taal_dcs_write_0(DCS_DISPLAY_OFF); |
@@ -784,8 +776,6 @@ static void taal_power_off(struct omap_dss_device *dssdev) | |||
784 | omapdss_dsi_display_disable(dssdev); | 776 | omapdss_dsi_display_disable(dssdev); |
785 | 777 | ||
786 | td->enabled = 0; | 778 | td->enabled = 0; |
787 | |||
788 | dsi_bus_unlock(); | ||
789 | } | 779 | } |
790 | 780 | ||
791 | static int taal_enable(struct omap_dss_device *dssdev) | 781 | static int taal_enable(struct omap_dss_device *dssdev) |
@@ -802,7 +792,12 @@ static int taal_enable(struct omap_dss_device *dssdev) | |||
802 | goto err; | 792 | goto err; |
803 | } | 793 | } |
804 | 794 | ||
795 | dsi_bus_lock(); | ||
796 | |||
805 | r = taal_power_on(dssdev); | 797 | r = taal_power_on(dssdev); |
798 | |||
799 | dsi_bus_unlock(); | ||
800 | |||
806 | if (r) | 801 | if (r) |
807 | goto err; | 802 | goto err; |
808 | 803 | ||
@@ -825,9 +820,13 @@ static void taal_disable(struct omap_dss_device *dssdev) | |||
825 | 820 | ||
826 | mutex_lock(&td->lock); | 821 | mutex_lock(&td->lock); |
827 | 822 | ||
823 | dsi_bus_lock(); | ||
824 | |||
828 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | 825 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) |
829 | taal_power_off(dssdev); | 826 | taal_power_off(dssdev); |
830 | 827 | ||
828 | dsi_bus_unlock(); | ||
829 | |||
831 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; | 830 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; |
832 | 831 | ||
833 | mutex_unlock(&td->lock); | 832 | mutex_unlock(&td->lock); |
@@ -847,7 +846,12 @@ static int taal_suspend(struct omap_dss_device *dssdev) | |||
847 | goto err; | 846 | goto err; |
848 | } | 847 | } |
849 | 848 | ||
849 | dsi_bus_lock(); | ||
850 | |||
850 | taal_power_off(dssdev); | 851 | taal_power_off(dssdev); |
852 | |||
853 | dsi_bus_unlock(); | ||
854 | |||
851 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; | 855 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; |
852 | 856 | ||
853 | mutex_unlock(&td->lock); | 857 | mutex_unlock(&td->lock); |
@@ -872,7 +876,12 @@ static int taal_resume(struct omap_dss_device *dssdev) | |||
872 | goto err; | 876 | goto err; |
873 | } | 877 | } |
874 | 878 | ||
879 | dsi_bus_lock(); | ||
880 | |||
875 | r = taal_power_on(dssdev); | 881 | r = taal_power_on(dssdev); |
882 | |||
883 | dsi_bus_unlock(); | ||
884 | |||
876 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | 885 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; |
877 | 886 | ||
878 | mutex_unlock(&td->lock); | 887 | mutex_unlock(&td->lock); |