Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/xe/i2c: Fix the interrupt handling" failed to apply to 7.3-stable tree

PATCH Sasha Levin 1 participant 1 message Nov 7

Subsystems (3)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

The patch below does not apply to the 7.3-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-7.3.y
git checkout FETCH_HEAD
git cherry-pick -x a55b76b8bc2c49b11d753c1c6d06ec3a2c61c85e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 7.3.y' 'HEAD^..'

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From a55b76b8bc2c49b11d753c1c6d06ec3a2c61c85e Mon Sep 17 00:00:00 2001
From: Heikki Krogerus <[email protected]>
Date: Tue, 11 Aug 2026 14:10:07 +0200
Subject: [PATCH] drm/xe/i2c: Fix the interrupt handling

The platforms that support the interrupt from the I2C adapter can not handle the amount of interrupts the adapter generates because of the way the IRQ is routed in the hardware. The I2C controller driver has to be kept in polling mode because of that.

The AMC MCU can still generate critical alerts that have to be handled. The interrupt from SMBus Alert is left enabled and handled separately in the Xe. The alerts from the AMC will cause the device to be declared wedged for now.

---
 drivers/gpu/drm/xe/Makefile           |   4 +-
 drivers/gpu/drm/xe/regs/xe_i2c_regs.h |   2 +
 drivers/gpu/drm/xe/xe_amc.c           | 197 ++++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_amc.h           |  25 ++++
 drivers/gpu/drm/xe/xe_i2c.c           | 128 +++++++----------
 drivers/gpu/drm/xe/xe_i2c.h           |  13 +-
 6 files changed, 282 insertions(+), 87 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_amc.c
 create mode 100644 drivers/gpu/drm/xe/xe_amc.h
drivers/gpu/drm/xe/Makefile +3 -1
index 7ac3954737f9d..adc2de37e7682 100644
@@ -154,7 +154,9 @@ xe-y += xe_bb.o \
 	xe_wait_user_fence.o \
 	xe_wopcm.o
 
-xe-$(CONFIG_I2C)	+= xe_i2c.o
+xe-$(CONFIG_I2C)	+= xe_i2c.o \
+			   xe_amc.o
+
 xe-$(CONFIG_DRM_XE_GPUSVM) += xe_svm.o
 xe-$(CONFIG_DRM_GPUSVM) += xe_userptr.o
 
drivers/gpu/drm/xe/regs/xe_i2c_regs.h +2 -0
index f2e455e2bfe45..37550e4a20f80 100644
@@ -20,4 +20,6 @@
 #define I2C_CONFIG_CMD			XE_REG(I2C_CONFIG_SPACE_OFFSET + PCI_COMMAND)
 #define I2C_CONFIG_PMCSR		XE_REG(I2C_CONFIG_SPACE_OFFSET + 0x84)
 
+#define I2C_REG(reg)			XE_REG((reg) + I2C_MEM_SPACE_OFFSET)
+
 #endif /* _XE_I2C_REGS_H_ */
drivers/gpu/drm/xe/xe_amc.c new file +197 -0

197 lines not on this page · raw message

drivers/gpu/drm/xe/xe_amc.h new file +25 -0
new file mode 100644
index 0000000000000..b1d5311fee536
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _XE_AMC_H_
+#define _XE_AMC_H_
+
+#include <linux/i2c.h>
+
+#include "xe_device.h"
+
+struct xe_i2c;
+
+static inline struct xe_device *i2c_adapter_to_xe_device(struct i2c_adapter *adapter)
+{
+	return kdev_to_xe_device(adapter->dev.parent->parent);
+}
+
+static inline struct xe_device *i2c_client_to_xe_device(struct i2c_client *client)
+{
+	return i2c_adapter_to_xe_device(client->adapter);
+}
+
+int xe_amc_init(struct xe_i2c *i2c);
+void xe_amc_exit(struct xe_i2c *i2c);
+void xe_amc_handle_alert(struct xe_i2c *i2c);
+
+#endif /* _XE_AMC_H_ */
drivers/gpu/drm/xe/xe_i2c.c +48 -80

209 lines not on this page · raw message

drivers/gpu/drm/xe/xe_i2c.h +7 -6
index 425d8160835f4..b200966b00484 100644
@@ -11,18 +11,21 @@ struct device;
 struct fwnode_handle;
 struct i2c_adapter;
 struct i2c_client;
-struct irq_domain;
 struct platform_device;
+struct xe_amc;
 struct xe_device;
 struct xe_mmio;
 
-#define XE_I2C_MAX_CLIENTS		3
-
 #define XE_I2C_EP_COOKIE_DEVICE		0xde
 
 /* Endpoint Capabilities */
 #define XE_I2C_EP_CAP_IRQ		BIT(0)
 
+enum XE_I2C_CLIENT {
+	XE_I2C_CLIENT_AMC = 1,
+	XE_I2C_MAX_CLIENTS = 3,
+};
+
 struct xe_i2c_endpoint {
 	u8 cookie;
 	u8 capabilities;
@@ -38,13 +41,11 @@ struct xe_i2c {
 	struct notifier_block bus_notifier;
 	struct work_struct work;
 
-	struct irq_domain *irqdomain;
-	int adapter_irq;
-
 	struct xe_i2c_endpoint ep;
 	struct device *drm_dev;
 
 	struct xe_mmio *mmio;
+	struct xe_amc *amc;
 };
 
 #if IS_ENABLED(CONFIG_I2C)
Signature · 1 line
2.53.0