History

spi: orion: runtime PM fixes

Johan Hovold <johan@kernel.org> says: This series fixes some runtime PM related issues in the orion driver. Included is also a related clean up.

Mark Brown committed 6 months ago

Commit 8370f1b2 parents a1d50a3 fa5061d1 file · +11 −2Browse files

Unified · Split

drivers/spi/spi-orion.c+11−2
@@ -648,8 +648,8 @@ static int orion_spi_probe(struct platform_device *pdev) · 647 unmodified lines
648648 struct orion_spi *spi;
649649 struct resource *r;
650650 unsigned long tclk_hz;
651− int status = 0;
652651 struct device_node *np;
652+ int status;
653653
654654 host = spi_alloc_host(&pdev->dev, sizeof(*spi));
655655 if (host == NULL) {
@@ -774,6 +774,7 @@ static int orion_spi_probe(struct platform_device *pdev) · 118 unmodified lines
774774 pm_runtime_set_active(&pdev->dev);
775775 pm_runtime_use_autosuspend(&pdev->dev);
776776 pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
777+ pm_runtime_get_noresume(&pdev->dev);
777778 pm_runtime_enable(&pdev->dev);
778779
779780 status = orion_spi_reset(spi);
@@ -784,10 +785,15 @@ static int orion_spi_probe(struct platform_device *pdev) · 4 unmodified lines
784785 if (status < 0)
785786 goto out_rel_pm;
786787
787− return status;
788+ pm_runtime_put_autosuspend(&pdev->dev);
789+
790+ return 0;
788791
789792 out_rel_pm:
790793 pm_runtime_disable(&pdev->dev);
794+ pm_runtime_put_noidle(&pdev->dev);
795+ pm_runtime_set_suspended(&pdev->dev);
796+ pm_runtime_dont_use_autosuspend(&pdev->dev);
791797 out_rel_axi_clk:
792798 clk_disable_unprepare(spi->axi_clk);
793799 out:
@@ -811,6 +817,9 @@ static void orion_spi_remove(struct platform_device *pdev) · 17 unmodified lines
811817 spi_controller_put(host);
812818
813819 pm_runtime_disable(&pdev->dev);
820+ pm_runtime_put_noidle(&pdev->dev);
821+ pm_runtime_set_suspended(&pdev->dev);
822+ pm_runtime_dont_use_autosuspend(&pdev->dev);
814823 }
815824
816825 MODULE_ALIAS("platform:" DRIVER_NAME);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t