Patch "spi: davinci: Unset POWERDOWN bit when releasing resources" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    spi: davinci: Unset POWERDOWN bit when releasing resources

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     spi-davinci-unset-powerdown-bit-when-releasing-resou.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 068f6dda9789b0c804e5456ec56e897c033d4d85
Author: Bastien Curutchet <bastien.curutchet@xxxxxxxxxxx>
Date:   Mon Jun 24 09:17:45 2024 +0200

    spi: davinci: Unset POWERDOWN bit when releasing resources
    
    [ Upstream commit 1762dc01fc78ef5f19693e9317eae7491c6c7e1b ]
    
    On the OMAPL138, the SPI reference clock is provided by the Power and
    Sleep Controller (PSC). The PSC's datasheet says that 'some peripherals
    have special programming requirements and additional recommended steps
    you must take before you can invoke the PSC module state transition'. I
    didn't find more details in documentation but it appears that PSC needs
    the SPI to clear the POWERDOWN bit before disabling the clock. Indeed,
    when this bit is set, the PSC gets stuck in transitions from enable to
    disable state.
    
    Clear the POWERDOWN bit when releasing driver's resources
    
    Signed-off-by: Bastien Curutchet <bastien.curutchet@xxxxxxxxxxx>
    Link: https://patch.msgid.link/20240624071745.17409-1-bastien.curutchet@xxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index be3998104bfbb..f7e8b5efa50e5 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -984,6 +984,9 @@ static int davinci_spi_probe(struct platform_device *pdev)
 	return ret;
 
 free_dma:
+	/* This bit needs to be cleared to disable dpsi->clk */
+	clear_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
+
 	if (dspi->dma_rx) {
 		dma_release_channel(dspi->dma_rx);
 		dma_release_channel(dspi->dma_tx);
@@ -1013,6 +1016,9 @@ static void davinci_spi_remove(struct platform_device *pdev)
 
 	spi_bitbang_stop(&dspi->bitbang);
 
+	/* This bit needs to be cleared to disable dpsi->clk */
+	clear_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
+
 	if (dspi->dma_rx) {
 		dma_release_channel(dspi->dma_rx);
 		dma_release_channel(dspi->dma_tx);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux