FAILED: patch "[PATCH] spi: bcm63xx: disable clock on resume failure" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 2b62c2c134fa32d9d3a9e7323c8ac74518eeb4ac
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090843-repaint-untwist-90f3@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2b62c2c134fa32d9d3a9e7323c8ac74518eeb4ac Mon Sep 17 00:00:00 2001
From: Can Peng <[email protected]>
Date: Tue, 4 Aug 2026 15:18:31 +0800
Subject: [PATCH] spi: bcm63xx: disable clock on resume failure
bcm63xx_spi_resume() enables the controller clock before restarting the SPI controller queue.
If spi_controller_resume() fails, the function currently reports success and leaves the clock enabled. Propagate the error and disable the clock before returning.
drivers/spi/spi-bcm63xx.c +5 -1
@@ -653,7 +653,11 @@ static int bcm63xx_spi_resume(struct device *dev)if (ret)return ret; -spi_controller_resume (host); + ret =spi_controller_resume (host); +if (ret) { +clk_disable_unprepare (bs->clk); +return ret; + }return 0 ; }
Sasha Levin
maintainerPATCH 1/2 spi: bcm63xx: switch to use modern name
From: Yang Yingliang <[email protected]>
[ Upstream commit 1a9e76190f72e4e3aaf7eb89da22876846ff9b3d ]
Change legacy name master to modern name host or controller.
No functional changed.
Stable-dep-of: 2b62c2c134fa ("spi: bcm63xx: disable clock on resume failure")
--- drivers/spi/spi-bcm63xx.c | 68 +++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 34 deletions(-)
drivers/spi/spi-bcm63xx.c +34 -34
@@ -196,7 +196,7 @@ static const unsigned int bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = {static void bcm63xx_spi_setup_transfer (struct spi_device *spi,struct spi_transfer *t) { -struct bcm63xx_spi *bs =spi_master_get_devdata (spi->master); +struct bcm63xx_spi *bs =spi_controller_get_devdata (spi->controller);u8 clk_cfg, reg;int i;
@@ -227,7 +227,7 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi,static int bcm63xx_txrx_bufs (struct spi_device *spi,struct spi_transfer *first,unsigned int num_transfers) { -struct bcm63xx_spi *bs =spi_master_get_devdata (spi->master); +struct bcm63xx_spi *bs =spi_controller_get_devdata (spi->controller);u16 msg_ctl;u16 cmd;unsigned int i, timeout =0 , prepend_len =0 , len =0 ;
@@ -336,10 +336,10 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,return 0 ; } -static int bcm63xx_spi_transfer_one (struct spi_master *master, +static int bcm63xx_spi_transfer_one (struct spi_controller *host,struct spi_message *m) { -struct bcm63xx_spi *bs =spi_master_get_devdata (master); +struct bcm63xx_spi *bs =spi_controller_get_devdata (host);struct spi_transfer *t, *first =NULL ;struct spi_device *spi = m->spi;int status =0 ;
@@ -409,18 +409,18 @@ static int bcm63xx_spi_transfer_one(struct spi_master *master, } exit: m->status = status; -spi_finalize_current_message (master); +spi_finalize_current_message (host);return 0 ; } -/* This driver supports single master mode only. Hence +/* This driver supports single host mode only. Hence * CMD_DONE is the only interrupt we care about */ static irqreturn_t bcm63xx_spi_interrupt (int irq,void *dev_id) { -struct spi_master *master = (struct spi_master *)dev_id; -struct bcm63xx_spi *bs =spi_master_get_devdata (master); +struct spi_controller *host = (struct spi_controller *)dev_id; +struct bcm63xx_spi *bs =spi_controller_get_devdata (host);u8 intr;/* Read interupts and clear them immediately */
@@ -437,7 +437,7 @@ static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id)static size_t bcm63xx_spi_max_length (struct spi_device *spi) { -struct bcm63xx_spi *bs =spi_master_get_devdata (spi->master); +struct bcm63xx_spi *bs =spi_controller_get_devdata (spi->controller);return bs->fifo_size; }
@@ -505,7 +505,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)const unsigned long *bcm63xx_spireg;struct device *dev = &pdev->dev;int irq, bus_num; -struct spi_master *master; +struct spi_controller *host;struct clk *clk;struct bcm63xx_spi *bs;int ret;
@@ -551,16 +551,16 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)if (IS_ERR (reset))return PTR_ERR (reset); - master =spi_alloc_master (dev,sizeof (*bs)); -if (!master) { + host =spi_alloc_host (dev,sizeof (*bs)); +if (!host) {dev_err (dev,"out of memory\n" );return -ENOMEM ; } - bs =spi_master_get_devdata (master); + bs =spi_controller_get_devdata (host);init_completion (&bs->done); -platform_set_drvdata (pdev, master); +platform_set_drvdata (pdev, host); bs->pdev = pdev; r =platform_get_resource (pdev,IORESOURCE_MEM ,0 );
@@ -576,21 +576,21 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) bs->fifo_size = bs->reg_offsets[SPI_MSG_DATA_SIZE ]; ret =devm_request_irq (&pdev->dev, irq, bcm63xx_spi_interrupt,0 , - pdev->name, master); + pdev->name, host);if (ret) {dev_err (dev,"unable to request irq\n" ); goto out_err; } - master->dev.of_node = dev->of_node; - master->bus_num = bus_num; - master->num_chipselect = num_cs; - master->transfer_one_message = bcm63xx_spi_transfer_one; - master->mode_bits =MODEBITS ; - master->bits_per_word_mask =SPI_BPW_MASK (8 ); - master->max_transfer_size = bcm63xx_spi_max_length; - master->max_message_size = bcm63xx_spi_max_length; - master->auto_runtime_pm = true; + host->dev.of_node = dev->of_node; + host->bus_num = bus_num; + host->num_chipselect = num_cs; + host->transfer_one_message = bcm63xx_spi_transfer_one; + host->mode_bits =MODEBITS ; + host->bits_per_word_mask =SPI_BPW_MASK (8 ); + host->max_transfer_size = bcm63xx_spi_max_length; + host->max_message_size = bcm63xx_spi_max_length; + host->auto_runtime_pm = true; bs->msg_type_shift = bs->reg_offsets[SPI_MSG_TYPE_SHIFT ]; bs->msg_ctl_width = bs->reg_offsets[SPI_MSG_CTL_WIDTH ]; bs->tx_io = (u8 *)(bs->regs + bs->reg_offsets[SPI_MSG_DATA ]);
@@ -614,7 +614,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) goto out_clk_disable;/* register and we are done */ - ret =devm_spi_register_master (dev, master); + ret =devm_spi_register_controller (dev, host);if (ret) {dev_err (dev,"spi register failed\n" ); goto out_clk_disable;
@@ -628,14 +628,14 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) out_clk_disable:clk_disable_unprepare (clk); out_err: -spi_master_put (master); +spi_controller_put (host);return ret; }static int bcm63xx_spi_remove (struct platform_device *pdev) { -struct spi_master *master =platform_get_drvdata (pdev); -struct bcm63xx_spi *bs =spi_master_get_devdata (master); +struct spi_controller *host =platform_get_drvdata (pdev); +struct bcm63xx_spi *bs =spi_controller_get_devdata (host);/* reset spi block */ bcm_spi_writeb (bs,0 ,SPI_INT_MASK );
@@ -649,10 +649,10 @@ static int bcm63xx_spi_remove(struct platform_device *pdev)#ifdef CONFIG_PM_SLEEP static int bcm63xx_spi_suspend (struct device *dev) { -struct spi_master *master =dev_get_drvdata (dev); -struct bcm63xx_spi *bs =spi_master_get_devdata (master); +struct spi_controller *host =dev_get_drvdata (dev); +struct bcm63xx_spi *bs =spi_controller_get_devdata (host); -spi_master_suspend (master); +spi_controller_suspend (host);clk_disable_unprepare (bs->clk);
@@ -661,15 +661,15 @@ static int bcm63xx_spi_suspend(struct device *dev)static int bcm63xx_spi_resume (struct device *dev) { -struct spi_master *master =dev_get_drvdata (dev); -struct bcm63xx_spi *bs =spi_master_get_devdata (master); +struct spi_controller *host =dev_get_drvdata (dev); +struct bcm63xx_spi *bs =spi_controller_get_devdata (host);int ret; ret =clk_prepare_enable (bs->clk);if (ret)return ret; -spi_master_resume (master); +spi_controller_resume (host);return 0 ; }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 spi: bcm63xx: disable clock on resume failure
From: Can Peng <[email protected]>
[ Upstream commit 2b62c2c134fa32d9d3a9e7323c8ac74518eeb4ac ]
bcm63xx_spi_resume() enables the controller clock before restarting the SPI controller queue.
If spi_controller_resume() fails, the function currently reports success and leaves the clock enabled. Propagate the error and disable the clock before returning.
--- drivers/spi/spi-bcm63xx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/spi/spi-bcm63xx.c +5 -1
@@ -669,7 +669,11 @@ static int bcm63xx_spi_resume(struct device *dev)if (ret)return ret; -spi_controller_resume (host); + ret =spi_controller_resume (host); +if (ret) { +clk_disable_unprepare (bs->clk); +return ret; + }return 0 ; }
Signature · 1 line
2.53.0