Skip to content

Enable i2c-xiic and add upstream patches#564

Open
domingo-nexthop wants to merge 3 commits intosonic-net:masterfrom
nexthop-ai:domingo.i2c-xiic-patch
Open

Enable i2c-xiic and add upstream patches#564
domingo-nexthop wants to merge 3 commits intosonic-net:masterfrom
nexthop-ai:domingo.i2c-xiic-patch

Conversation

@domingo-nexthop
Copy link
Copy Markdown
Contributor

@domingo-nexthop domingo-nexthop commented Apr 21, 2026

Include the i2c-xiic driver and backport kernel patches from linux 7.0.

Patches added (in series order, each cherry-picked from upstream;
v6.12.41 lacks 73db799bf5ef so 0001 is needed by 0010 and 0013):

Resolves sonic-net/sonic-linux-kernel#543

Resolves sonic-net/sonic-linux-kernel#544

@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop domingo-nexthop changed the title add i2c-xiic patches Enable i2c-xiic and add upstream patches Apr 22, 2026
@domingo-nexthop domingo-nexthop marked this pull request as ready for review April 22, 2026 00:09
@domingo-nexthop domingo-nexthop requested a review from a team as a code owner April 22, 2026 00:09
Copy link
Copy Markdown
Contributor

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the description of the merge/pull request is not copied when submitting, so please add the text to the commit, and also use the full name in the Signed-off-by line there.

Lastly, instead of the tag Fixes, please use Resolves: when referencing issues.

@@ -0,0 +1,107 @@
From d1520f927851bb76f562d2fd1067acc55179e866 Mon Sep 17 00:00:00 2001
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, how to do it with b4, but as the patches are in Linus’ branch master, please generate the patches from this, so the upstream commit hashes are used. The command below should do the trick:

git format-patch -7 dd0422eb1566a823587ede7780aef9c9c7a45b04

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I updated the commit hashes of the patch files. Note that the patches come from master and so won't apply cleanly to the 6.12 sonic-linux-kernel. They are a bit different and won't match master exactly, despite the same commit hashes.

Applying patch 0001-i2c-xiic-switch-to-devres-managed-APIs.patch
4 out of 7 hunks FAILED
Patch 0001-i2c-xiic-switch-to-devres-managed-APIs.patch does not apply (enforce with -f)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good observation. No idea, if this will cause more confusion later on compared to just having the commit hash in the commit message body. @saiarcot895, what do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with having the master branch commit hash either in the From line or in the commit body. When checking if a patch has been upstreamed, I'll use whatever's available.

@mssonicbld
Copy link
Copy Markdown

/azp run

@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from 375ec17 to 5660848 Compare April 26, 2026 00:00
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop
Copy link
Copy Markdown
Contributor Author

Regarding the commit message, I will update the commit message before squash merge

@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from 5660848 to abef9ef Compare April 26, 2026 00:05
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from abef9ef to 144b7dc Compare April 26, 2026 00:05
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop
Copy link
Copy Markdown
Contributor Author

I updated the commit message and the sign-off line. Thank you!

@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from 144b7dc to 95ac758 Compare April 26, 2026 00:07
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from 95ac758 to c5d970e Compare April 26, 2026 00:25
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop
Copy link
Copy Markdown
Contributor Author

Hi @saiarcot895 would you be able to review this change too? Thank you in advance.

Copy link
Copy Markdown
Contributor

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too improve it even more, you could also put possibly new Linux log messages to the sonic-linux-kernel commit message, or document some commands how to verify that the i2c-xiic device works properly.

Anyway, for me this looks good, and @saiarcot895 needs to decide how to handle the upstream commit hashes.

In my opinion, these patches should also go into the stable series as it fixes a hardware quirk, but the cosmetic improvement patches might raise objections. (The reality also contradicts the document a little in my experience.) Anyway, you could ask Andy and Greg, what they think.

@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from c5d970e to d3342f1 Compare May 1, 2026 20:17
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 1, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from d3342f1 to d6fc214 Compare May 1, 2026 20:20
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Cherry-pick the i2c-xiic upstream patches
and pull in the one PM-runtime devm
helper they depend on, since v6.12.41 predates it.

Patches added (in series order, each cherry-picked from upstream;
v6.12.41 lacks 73db799bf5ef so 0006 is needed by 0010 and 0013):

- 0006-PM-runtime-Add-new-devm-functions.patch
  (stable 69a837b75edc / mainline 73db799bf5ef, in v6.12.55+)
  Adds devm_pm_runtime_set_active_enabled() and
  devm_pm_runtime_get_noresume().
  Link: https://lore.kernel.org/r/20250327195928.680771-3-csokas.bence@prolan.hu

- 0007-i2c-xiic-Relocate-xiic_i2c_runtime_suspend-and-xiic_.patch
  Link: https://lore.kernel.org/r/20241210095242.1982770-2-manikanta.guntupalli@amd.com

- 0008-i2c-xiic-Add-atomic-transfer-support.patch
  Link: https://lore.kernel.org/r/20241210095242.1982770-3-manikanta.guntupalli@amd.com

- 0009-i2c-i2c-xiic-Replace-dev_err-with-dev_err_probe-in-p.patch
  Link: https://lore.kernel.org/r/20250415183447.396277-10-e.zanda1@gmail.com

- 0010-i2c-xiic-switch-to-devres-managed-APIs.patch
  Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-1-b6c9ce4e4f3c@nexthop.ai

- 0011-i2c-xiic-remove-duplicate-error-message.patch
  Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-2-b6c9ce4e4f3c@nexthop.ai

- 0012-i2c-xiic-switch-to-generic-device-property-accessors.patch
  Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-3-b6c9ce4e4f3c@nexthop.ai

- 0013-i2c-xiic-cosmetic-cleanup.patch
  Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-4-b6c9ce4e4f3c@nexthop.ai

- 0014-i2c-xiic-cosmetic-use-resource-format-specifier-in-d.patch
  Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-5-b6c9ce4e4f3c@nexthop.ai

- 0015-i2c-xiic-use-numbered-adapter-registration.patch
  Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-6-b6c9ce4e4f3c@nexthop.ai

- 0016-i2c-xiic-skip-input-clock-setup-on-non-OF-systems.patch
  Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-7-b6c9ce4e4f3c@nexthop.ai

Also enable CONFIG_I2C_XILINX=m in config.local/amd64/config.sonic so
the driver is actually built into the SONIC kernel.

Resolves [sonic-net#543](sonic-net#543)

Resolves [sonic-net#544](sonic-net#544)

Signed-off-by: domingo-nexthop <domingo@nexthop.ai>
@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from d6fc214 to 1fa5bea Compare May 4, 2026 10:40
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

From a085b9385bfbc6b6887a9fa21f3cd40bd3811b37 Mon Sep 17 00:00:00 2001
From: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Date: Tue, 10 Dec 2024 15:22:41 +0530
Subject: [PATCH 07/22] i2c: xiic: Relocate xiic_i2c_runtime_suspend and
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having just a subset of a series included, might be confusing, but I won’t object.

Copy link
Copy Markdown
Contributor

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any new Linux logs from this module, which you could add to the commit message?

@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: domingo-nexthop <domingo@nexthop.ai>
@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from b07cade to 8bc8857 Compare May 4, 2026 14:14
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@domingo-nexthop
Copy link
Copy Markdown
Contributor Author

Please see updated PR description. I have added more upstream patches to backport the i2c-xiic driver from 7.0.

@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: domingo-nexthop <domingo@nexthop.ai>
@domingo-nexthop domingo-nexthop force-pushed the domingo.i2c-xiic-patch branch from 4bcb22c to d4e342b Compare May 4, 2026 21:28
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add patch for i2c-xiic driver to enable custom bus number Add i2c-xiic driver to sonic-linux-kernel

4 participants