Re: [PATCH 6.1] i2c: lpi2c: Avoid calling clk_get_rate during transfer

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

 



[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 4268254a39484fc11ba991ae148bacbe75d9cc0a

WARNING: Author mismatch between patch and upstream commit:
Backport author: bin.lan.cn@xxxxxxxxxxxxxxxxx
Commit author: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>


Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.6.y | Present (different SHA1: d038693e08ad)
6.1.y | Not found

Note: The patch differs from the upstream commit:
---
1:  4268254a39484 ! 1:  3d20023e353b7 i2c: lpi2c: Avoid calling clk_get_rate during transfer
    @@ Metadata
      ## Commit message ##
         i2c: lpi2c: Avoid calling clk_get_rate during transfer
     
    +    [ Upstream commit 4268254a39484fc11ba991ae148bacbe75d9cc0a ]
    +
         Instead of repeatedly calling clk_get_rate for each transfer, lock
         the clock rate and cache the value.
         A deadlock has been observed while adding tlv320aic32x4 audio codec to
    @@ Commit message
         Reviewed-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
         Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
         Signed-off-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
    +    [ Don't call devm_clk_rate_exclusive_get() for devm_clk_rate_exclusive_get()
    +      does not exist in v6.1. ]
    +    Signed-off-by: Bin Lan <bin.lan.cn@xxxxxxxxxxxxx>
     
      ## drivers/i2c/busses/i2c-imx-lpi2c.c ##
     @@ drivers/i2c/busses/i2c-imx-lpi2c.c: struct lpi2c_imx_struct {
    @@ drivers/i2c/busses/i2c-imx-lpi2c.c: static int lpi2c_imx_config(struct lpi2c_imx
      	lpi2c_imx_set_mode(lpi2c_imx);
      
     -	clk_rate = clk_get_rate(lpi2c_imx->clks[0].clk);
    --	if (!clk_rate)
    --		return -EINVAL;
     +	clk_rate = lpi2c_imx->rate_per;
    - 
    ++
      	if (lpi2c_imx->mode == HS || lpi2c_imx->mode == ULTRA_FAST)
      		filt = 0;
    + 	else
     @@ drivers/i2c/busses/i2c-imx-lpi2c.c: static int lpi2c_imx_probe(struct platform_device *pdev)
      	if (ret)
      		return ret;
      
    -+	/*
    -+	 * Lock the parent clock rate to avoid getting parent clock upon
    -+	 * each transfer
    -+	 */
    -+	ret = devm_clk_rate_exclusive_get(&pdev->dev, lpi2c_imx->clks[0].clk);
    -+	if (ret)
    -+		return dev_err_probe(&pdev->dev, ret,
    -+				     "can't lock I2C peripheral clock rate\n");
    -+
     +	lpi2c_imx->rate_per = clk_get_rate(lpi2c_imx->clks[0].clk);
     +	if (!lpi2c_imx->rate_per)
     +		return dev_err_probe(&pdev->dev, -EINVAL,
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Success   |




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux