Linux-Next discussions
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Igor Korotin <igor.korotin@linux.dev>
Cc: Andi Shyti <andi.shyti@kernel.org>,
	Carlos Song <carlos.song@nxp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Pei Xiao <xiaopei01@kylinos.cn>
Subject: linux-next: manual merge of the i2c-rust tree with the origin tree
Date: Thu, 10 Sep 2026 15:21:28 +0100	[thread overview]
Message-ID: <aqK86A1SuLKQP5Gi@sirena.org.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 3804 bytes --]

Hi all,

Today's linux-next merge of the i2c-rust tree got a conflict in:

  drivers/i2c/busses/i2c-imx-lpi2c.c

between commits:

  d1f112e2fa9b7 ("i2c: busses: drop redundant dev_err_probe() around irq helpers")
  cbd043b00ee3f ("i2c: imx-lpi2c: properly unwind resources on probe failure")
  a4c419356a333 ("i2c: imx-lpi2c: reset controller in probe stage")
  27c9445be86b1 ("i2c: imx-lpi2c: avoid accessing target registers on master-only controllers")

from the origin tree and commits:

  d2b83deba536d ("i2c: busses: drop redundant dev_err_probe() around irq helpers")
  c19f6f452664a ("i2c: imx-lpi2c: properly unwind resources on probe failure")
  90311787f483a ("i2c: imx-lpi2c: reset controller in probe stage")

from the i2c-rust tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined drivers/i2c/busses/i2c-imx-lpi2c.c
index 1cfd7a4c82370,e1a4338bc51e9..0000000000000
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@@ -29,7 -29,6 +29,7 @@@
  
  #define DRIVER_NAME "imx-lpi2c"
  
 +#define LPI2C_VERID	0x00	/* i2c version ID */
  #define LPI2C_PARAM	0x04	/* i2c RX/TX FIFO size */
  #define LPI2C_MCR	0x10	/* i2c contrl register */
  #define LPI2C_MSR	0x14	/* i2c status register */
@@@ -137,9 -136,6 +137,9 @@@
  #define I2C_PM_LONG_TIMEOUT_MS	1000 /* Avoid dead lock caused by big clock prepare lock */
  #define I2C_DMA_THRESHOLD	8 /* bytes */
  
 +/* Bit 0 indicates the presence of the target feature */
 +#define VERID_FEATURE_TARGET_PRESENT	BIT(0)
 +
  enum lpi2c_imx_mode {
  	STANDARD,	/* 100+Kbps */
  	FAST,		/* 400+Kbps */
@@@ -198,7 -194,6 +198,7 @@@ struct lpi2c_imx_struct 
  	bool			can_use_dma;
  	struct lpi2c_imx_dma	*dma;
  	struct i2c_client	*target;
 +	bool			target_supported;
  	int			irq;
  	const struct imx_lpi2c_hwdata *hwdata;
  };
@@@ -1335,10 -1330,6 +1335,10 @@@ static int lpi2c_imx_register_target(st
  	struct lpi2c_imx_struct *lpi2c_imx = i2c_get_adapdata(client->adapter);
  	int ret;
  
 +	/* Reject target-mode registration on controllers that don't support it. */
 +	if (!lpi2c_imx->target_supported)
 +		return -EOPNOTSUPP;
 +
  	if (lpi2c_imx->target)
  		return -EBUSY;
  
@@@ -1555,23 -1546,13 +1555,13 @@@ static int lpi2c_imx_probe(struct platf
  	pm_runtime_enable(&pdev->dev);
  
  	/*
- 	 * Reset all internal controller registers to avoid effects of any
- 	 * state left over from a previous stage (e.g. the bootloader).
- 	 *
- 	 * The Master block (MCR) is present on every controller, so reset it
- 	 * unconditionally. VERID shows whether the target feature is supported.
- 	 * Do not touch the Target block (SCR) on a master-only controller to
- 	 * avoid an asynchronous SError.
+ 	 * Reset all internal controller registers of both Master and Target
+ 	 * to avoid effects of previous status.
  	 */
  	writel(MCR_RST, lpi2c_imx->base + LPI2C_MCR);
+ 	writel(SCR_RST, lpi2c_imx->base + LPI2C_SCR);
  	writel(0, lpi2c_imx->base + LPI2C_MCR);
- 
- 	lpi2c_imx->target_supported = !!(readl(lpi2c_imx->base + LPI2C_VERID) &
- 					 VERID_FEATURE_TARGET_PRESENT);
- 	if (lpi2c_imx->target_supported) {
- 		writel(SCR_RST, lpi2c_imx->base + LPI2C_SCR);
- 		writel(0, lpi2c_imx->base + LPI2C_SCR);
- 	}
+ 	writel(0, lpi2c_imx->base + LPI2C_SCR);
  
  	ret = devm_request_irq(&pdev->dev, lpi2c_imx->irq, lpi2c_imx_isr, IRQF_NO_SUSPEND,
  			       pdev->name, lpi2c_imx);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

                 reply	other threads:[~2026-09-10 14:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqK86A1SuLKQP5Gi@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=carlos.song@nxp.com \
    --cc=igor.korotin@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=xiaopei01@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox