Re: [PATCH v5 2/2] i2c: hisi: Add I2C bus recovery support
From: yubowen (H)
Date: Thu Oct 29 2026 - 22:39:48 EST
在 2026/10/27 18:51, Andi Shyti 写道:
Hi Bowen,Thank you for the feedback, I be back with V6.
the patch looks good and it can be taken without 1/2.
Just few nitpicks,
...
+static int hisi_i2c_get_bus_recovery_res(struct hisi_i2c_controller *ctlr,/res0/res/
+ struct platform_device *pdev)
+{
+ struct resource *res0;
+return PTR_ERR(ctlr->sctrl_addr);
+ res0 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+
+ if (!res0 || resource_size(res0) != HISI_I2C_RECOVERY_REG_SIZE)
+ return -ENODEV;
+
+ ctlr->sctrl_addr = devm_ioremap_resource(&pdev->dev, res0);
+ if (IS_ERR(ctlr->sctrl_addr)) {
+ ctlr->sctrl_addr = NULL;
+ return -ENOMEM;
+ }...
+
+ return 0;
+}
static int hisi_i2c_start_xfer(struct hisi_i2c_controller *ctlr)I would use here dev_dbg(...);
{
struct i2c_msg *msg = ctlr->msgs;
@@ -496,6 +634,10 @@ static int hisi_i2c_probe(struct platform_device *pdev)
hisi_i2c_configure_bus(ctlr);
+ ret = hisi_i2c_recovery_init(ctlr);
+ if (ret)
+ dev_info(ctlr->dev, "I2C bus recovery not available\n");
If it's OK with you, I can change the ones above and apply,
otherwise, please send a v6.
Andi
+
adapter = &ctlr->adapter;
snprintf(adapter->name, sizeof(adapter->name),
"HiSilicon I2C Controller %s", dev_name(dev));
--
2.33.0
Best Regards,
Bowen