* [PATCH v7 0/6] i2c: xiic: use generic device property accessors
@ 2026-01-29 21:43 Abdurrahman Hussain via B4 Relay
2026-01-29 21:43 ` [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems Abdurrahman Hussain via B4 Relay
` (6 more replies)
0 siblings, 7 replies; 24+ messages in thread
From: Abdurrahman Hussain via B4 Relay @ 2026-01-29 21:43 UTC (permalink / raw)
To: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree, Abdurrahman Hussain, Andrew Lunn
Switch to generic device property accessors.
Switch to managed devm_ functions to simplify error handling.
Skip clock setup on non-OF systems where clock cannot be provided.
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
Changes in v7:
- Drop the dt-bindings patch.
- Skip clock setup on non-OF systems.
- Minor commit body rewording.
- Applied code-review trailers with `b4 trailers -u`
- Link to v6: https://lore.kernel.org/r/20260127-i2c-xiic-v6-0-e82e2f6f657c@nexthop.ai
Changes in v6:
- Cosmetic changes to address the comments.
- Added a patch to use resource format specifier in debug log.
- Link to v5: https://lore.kernel.org/r/20260126-i2c-xiic-v5-0-88a16a28721c@nexthop.ai
Changes in v5:
- Reorder the cosmetic patch to be the last in the series.
- Added a documentation patch to describe the optional clock.
- Minor commit body rewording.
- Link to v4: https://lore.kernel.org/r/20260123-i2c-xiic-v4-0-4a3eba3510ce@nexthop.ai
Changes in v4:
- Reorder the cosmetic patch to be the first in the series.
- Amend the mutex_init patch to also switch to the managed pm_runtime_
variant.
- Link to v3: https://lore.kernel.org/r/20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai
Changes in v3:
- Reorder the "optional clock" patch to be the first in the series.
- Add a patch to switch to devm_mutex_init().
- Remove dup message in error path.
- Cosmetic: use temporary dev variable.
- Link to v2: https://lore.kernel.org/r/20260122-i2c-xiic-v2-0-134f5d743e8b@nexthop.ai
Changes in v2:
- Split the patch into two independent changes.
- Added struct device *dev at the top of probe() and remove() to re-use.
- Switched to device_set_node(...)
---
Abdurrahman Hussain (6):
i2c: xiic: skip input clock setup on non-OF systems
i2c: xiic: switch to devres managed APIs
i2c: xiic: remove duplicate error message
i2c: xiic: switch to generic device property accessors
i2c: xiic: cosmetic cleanup
i2c xiic: cosmetic: use resource format specifier in debug log
drivers/i2c/busses/i2c-xiic.c | 98 +++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 56 deletions(-)
---
base-commit: 63804fed149a6750ffd28610c5c1c98cce6bd377
change-id: 20260122-i2c-xiic-3ba89ff5ea93
Best regards,
--
Abdurrahman Hussain <abdurrahman@nexthop.ai>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
@ 2026-01-29 21:43 ` Abdurrahman Hussain via B4 Relay
2026-01-29 22:43 ` Andrew Lunn
2026-01-31 10:10 ` Andy Shevchenko
2026-01-29 21:43 ` [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs Abdurrahman Hussain via B4 Relay
` (5 subsequent siblings)
6 siblings, 2 replies; 24+ messages in thread
From: Abdurrahman Hussain via B4 Relay @ 2026-01-29 21:43 UTC (permalink / raw)
To: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree, Abdurrahman Hussain
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
The xiic driver supports operation without explicit clock configuration
when clocks cannot be specified via firmware, such as on ACPI-based
systems. This behavior is implemented in xiic_setclk(), which returns
early when either i2c_clk or input_clk are zero.
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
drivers/i2c/busses/i2c-xiic.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 28015d77599d..912a94d4d080 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1423,6 +1423,7 @@ MODULE_DEVICE_TABLE(of, xiic_of_match);
static int xiic_i2c_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct xiic_i2c *i2c;
struct xiic_i2c_platform_data *pdata;
const struct of_device_id *match;
@@ -1464,10 +1465,12 @@ static int xiic_i2c_probe(struct platform_device *pdev)
mutex_init(&i2c->lock);
spin_lock_init(&i2c->atomic_lock);
- i2c->clk = devm_clk_get_enabled(&pdev->dev, NULL);
- if (IS_ERR(i2c->clk))
- return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
- "failed to enable input clock.\n");
+ if (is_of_node(dev->fwnode)) {
+ i2c->clk = devm_clk_get_enabled(dev, NULL);
+ if (IS_ERR(i2c->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
+ "failed to enable input clock.\n");
+ }
i2c->dev = &pdev->dev;
pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT);
--
2.52.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
2026-01-29 21:43 ` [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems Abdurrahman Hussain via B4 Relay
@ 2026-01-29 21:43 ` Abdurrahman Hussain via B4 Relay
2026-01-30 10:48 ` Jonathan Cameron
2026-01-31 10:31 ` Andy Shevchenko
2026-01-29 21:43 ` [PATCH v7 3/6] i2c: xiic: remove duplicate error message Abdurrahman Hussain via B4 Relay
` (4 subsequent siblings)
6 siblings, 2 replies; 24+ messages in thread
From: Abdurrahman Hussain via B4 Relay @ 2026-01-29 21:43 UTC (permalink / raw)
To: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree, Abdurrahman Hussain
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Simplify the error code paths by switching to devres managed helper
functions.
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
drivers/i2c/busses/i2c-xiic.c | 28 +++++++++++-----------------
1 file changed, 11 insertions(+), 17 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 912a94d4d080..a480cbb86d93 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1462,7 +1462,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
DRIVER_NAME " %s", pdev->name);
- mutex_init(&i2c->lock);
+ ret = devm_mutex_init(dev, &i2c->lock);
+ if (ret)
+ return ret;
+
spin_lock_init(&i2c->atomic_lock);
if (is_of_node(dev->fwnode)) {
@@ -1475,8 +1478,9 @@ static int xiic_i2c_probe(struct platform_device *pdev)
i2c->dev = &pdev->dev;
pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT);
pm_runtime_use_autosuspend(i2c->dev);
- pm_runtime_set_active(i2c->dev);
- pm_runtime_enable(i2c->dev);
+ ret = devm_pm_runtime_set_active_enabled(dev);
+ if (ret)
+ return ret;
/* SCL frequency configuration */
i2c->input_clk = clk_get_rate(i2c->clk);
@@ -1492,7 +1496,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (ret < 0) {
dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
- goto err_pm_disable;
+ return ret;
}
i2c->singlemaster =
@@ -1511,16 +1515,14 @@ static int xiic_i2c_probe(struct platform_device *pdev)
i2c->endianness = BIG;
ret = xiic_reinit(i2c);
- if (ret < 0) {
- dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n");
- goto err_pm_disable;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "Cannot xiic_reinit\n");
/* add i2c adapter to i2c tree */
ret = i2c_add_adapter(&i2c->adap);
if (ret) {
xiic_deinit(i2c);
- goto err_pm_disable;
+ return ret;
}
if (pdata) {
@@ -1532,12 +1534,6 @@ static int xiic_i2c_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n",
(unsigned long)res->start, irq, i2c->i2c_clk);
- return 0;
-
-err_pm_disable:
- pm_runtime_disable(&pdev->dev);
- pm_runtime_set_suspended(&pdev->dev);
-
return ret;
}
@@ -1558,8 +1554,6 @@ static void xiic_i2c_remove(struct platform_device *pdev)
xiic_deinit(i2c);
pm_runtime_put_sync(i2c->dev);
- pm_runtime_disable(&pdev->dev);
- pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
}
--
2.52.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v7 3/6] i2c: xiic: remove duplicate error message
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
2026-01-29 21:43 ` [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems Abdurrahman Hussain via B4 Relay
2026-01-29 21:43 ` [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs Abdurrahman Hussain via B4 Relay
@ 2026-01-29 21:43 ` Abdurrahman Hussain via B4 Relay
2026-01-30 10:49 ` Jonathan Cameron
2026-01-29 21:43 ` [PATCH v7 4/6] i2c: xiic: switch to generic device property accessors Abdurrahman Hussain via B4 Relay
` (3 subsequent siblings)
6 siblings, 1 reply; 24+ messages in thread
From: Abdurrahman Hussain via B4 Relay @ 2026-01-29 21:43 UTC (permalink / raw)
To: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree, Abdurrahman Hussain, Andrew Lunn
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
The devm_request_threaded_irq() already prints an error message. Remove
the duplicate.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
drivers/i2c/busses/i2c-xiic.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index a480cbb86d93..ca5685660e45 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1493,11 +1493,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
xiic_process, IRQF_ONESHOT,
pdev->name, i2c);
-
- if (ret < 0) {
- dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
+ if (ret)
return ret;
- }
i2c->singlemaster =
of_property_read_bool(pdev->dev.of_node, "single-master");
--
2.52.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v7 4/6] i2c: xiic: switch to generic device property accessors
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
` (2 preceding siblings ...)
2026-01-29 21:43 ` [PATCH v7 3/6] i2c: xiic: remove duplicate error message Abdurrahman Hussain via B4 Relay
@ 2026-01-29 21:43 ` Abdurrahman Hussain via B4 Relay
2026-01-29 21:43 ` [PATCH v7 5/6] i2c: xiic: cosmetic cleanup Abdurrahman Hussain via B4 Relay
` (2 subsequent siblings)
6 siblings, 0 replies; 24+ messages in thread
From: Abdurrahman Hussain via B4 Relay @ 2026-01-29 21:43 UTC (permalink / raw)
To: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree, Abdurrahman Hussain
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Use generic device property accessors.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
drivers/i2c/busses/i2c-xiic.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index ca5685660e45..3578c00d6404 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -27,7 +27,6 @@
#include <linux/platform_data/i2c-xiic.h>
#include <linux/io.h>
#include <linux/slab.h>
-#include <linux/of.h>
#include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/iopoll.h>
@@ -1408,7 +1407,6 @@ static const struct i2c_adapter xiic_adapter = {
.algo = &xiic_algorithm,
};
-#if defined(CONFIG_OF)
static const struct xiic_version_data xiic_2_00 = {
.quirks = DYNAMIC_MODE_READ_BROKEN_BIT,
};
@@ -1419,14 +1417,13 @@ static const struct of_device_id xiic_of_match[] = {
{},
};
MODULE_DEVICE_TABLE(of, xiic_of_match);
-#endif
static int xiic_i2c_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct xiic_i2c *i2c;
struct xiic_i2c_platform_data *pdata;
- const struct of_device_id *match;
+ const struct xiic_version_data *data;
struct resource *res;
int ret, irq;
u8 i;
@@ -1436,12 +1433,9 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (!i2c)
return -ENOMEM;
- match = of_match_node(xiic_of_match, pdev->dev.of_node);
- if (match && match->data) {
- const struct xiic_version_data *data = match->data;
-
+ data = device_get_match_data(dev);
+ if (data)
i2c->quirks = data->quirks;
- }
i2c->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(i2c->base))
@@ -1458,7 +1452,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
i2c->adap = xiic_adapter;
i2c_set_adapdata(&i2c->adap, i2c);
i2c->adap.dev.parent = &pdev->dev;
- i2c->adap.dev.of_node = pdev->dev.of_node;
+ device_set_node(&i2c->adap.dev, dev_fwnode(dev));
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
DRIVER_NAME " %s", pdev->name);
@@ -1484,8 +1478,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
/* SCL frequency configuration */
i2c->input_clk = clk_get_rate(i2c->clk);
- ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
- &i2c->i2c_clk);
+ ret = device_property_read_u32(dev, "clock-frequency", &i2c->i2c_clk);
/* If clock-frequency not specified in DT, do not configure in SW */
if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ)
i2c->i2c_clk = 0;
@@ -1496,8 +1489,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (ret)
return ret;
- i2c->singlemaster =
- of_property_read_bool(pdev->dev.of_node, "single-master");
+ i2c->singlemaster = device_property_read_bool(dev, "single-master");
/*
* Detect endianness
--
2.52.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
` (3 preceding siblings ...)
2026-01-29 21:43 ` [PATCH v7 4/6] i2c: xiic: switch to generic device property accessors Abdurrahman Hussain via B4 Relay
@ 2026-01-29 21:43 ` Abdurrahman Hussain via B4 Relay
2026-01-31 14:35 ` Dan Carpenter
2026-01-29 21:43 ` [PATCH v7 6/6] i2c xiic: cosmetic: use resource format specifier in debug log Abdurrahman Hussain via B4 Relay
2026-01-29 22:36 ` [PATCH v7 0/6] i2c: xiic: use generic device property accessors Andrew Lunn
6 siblings, 1 reply; 24+ messages in thread
From: Abdurrahman Hussain via B4 Relay @ 2026-01-29 21:43 UTC (permalink / raw)
To: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree, Abdurrahman Hussain
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Re-use dev pointer instead of referencing &pdev->dev everywhere.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
drivers/i2c/busses/i2c-xiic.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 3578c00d6404..37a15065db60 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1429,7 +1429,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
u8 i;
u32 sr;
- i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
+ i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
if (!i2c)
return -ENOMEM;
@@ -1445,13 +1445,13 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
- pdata = dev_get_platdata(&pdev->dev);
+ pdata = dev_get_platdata(dev);
/* hook up driver to tree */
platform_set_drvdata(pdev, i2c);
i2c->adap = xiic_adapter;
i2c_set_adapdata(&i2c->adap, i2c);
- i2c->adap.dev.parent = &pdev->dev;
+ i2c->adap.dev.parent = dev;
device_set_node(&i2c->adap.dev, dev_fwnode(dev));
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
DRIVER_NAME " %s", pdev->name);
@@ -1465,13 +1465,14 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (is_of_node(dev->fwnode)) {
i2c->clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(i2c->clk))
- return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
+ return dev_err_probe(dev, PTR_ERR(i2c->clk),
"failed to enable input clock.\n");
}
- i2c->dev = &pdev->dev;
- pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT);
- pm_runtime_use_autosuspend(i2c->dev);
+ i2c->dev = dev;
+
+ pm_runtime_set_autosuspend_delay(dev, XIIC_PM_TIMEOUT);
+ pm_runtime_use_autosuspend(dev);
ret = devm_pm_runtime_set_active_enabled(dev);
if (ret)
return ret;
@@ -1483,9 +1484,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ)
i2c->i2c_clk = 0;
- ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
- xiic_process, IRQF_ONESHOT,
- pdev->name, i2c);
+ ret = devm_request_threaded_irq(dev, irq, NULL, xiic_process,
+ IRQF_ONESHOT, pdev->name, i2c);
if (ret)
return ret;
@@ -1520,7 +1520,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
i2c_new_client_device(&i2c->adap, pdata->devices + i);
}
- dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n",
+ dev_dbg(dev, "mmio %08lx irq %d scl clock frequency %d\n",
(unsigned long)res->start, irq, i2c->i2c_clk);
return ret;
@@ -1528,22 +1528,22 @@ static int xiic_i2c_probe(struct platform_device *pdev)
static void xiic_i2c_remove(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct xiic_i2c *i2c = platform_get_drvdata(pdev);
int ret;
/* remove adapter & data */
i2c_del_adapter(&i2c->adap);
- ret = pm_runtime_get_sync(i2c->dev);
-
- if (ret < 0)
- dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n",
+ ret = pm_runtime_get_sync(dev);
+ if (ret)
+ dev_warn(dev, "Failed to activate device for removal (%pe)\n",
ERR_PTR(ret));
else
xiic_deinit(i2c);
- pm_runtime_put_sync(i2c->dev);
- pm_runtime_dont_use_autosuspend(&pdev->dev);
+ pm_runtime_put_sync(dev);
+ pm_runtime_dont_use_autosuspend(dev);
}
static const struct dev_pm_ops xiic_dev_pm_ops = {
--
2.52.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v7 6/6] i2c xiic: cosmetic: use resource format specifier in debug log
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
` (4 preceding siblings ...)
2026-01-29 21:43 ` [PATCH v7 5/6] i2c: xiic: cosmetic cleanup Abdurrahman Hussain via B4 Relay
@ 2026-01-29 21:43 ` Abdurrahman Hussain via B4 Relay
2026-01-31 10:55 ` Andy Shevchenko
2026-01-29 22:36 ` [PATCH v7 0/6] i2c: xiic: use generic device property accessors Andrew Lunn
6 siblings, 1 reply; 24+ messages in thread
From: Abdurrahman Hussain via B4 Relay @ 2026-01-29 21:43 UTC (permalink / raw)
To: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree, Abdurrahman Hussain
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Use standard resource format specifier %pR in debug log.
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
drivers/i2c/busses/i2c-xiic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 37a15065db60..b24b7a7bab8c 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1520,8 +1520,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
i2c_new_client_device(&i2c->adap, pdata->devices + i);
}
- dev_dbg(dev, "mmio %08lx irq %d scl clock frequency %d\n",
- (unsigned long)res->start, irq, i2c->i2c_clk);
+ dev_dbg(dev, "mmio %pR irq %d scl clock frequency %d\n",
+ res, irq, i2c->i2c_clk);
return ret;
}
--
2.52.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH v7 0/6] i2c: xiic: use generic device property accessors
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
` (5 preceding siblings ...)
2026-01-29 21:43 ` [PATCH v7 6/6] i2c xiic: cosmetic: use resource format specifier in debug log Abdurrahman Hussain via B4 Relay
@ 2026-01-29 22:36 ` Andrew Lunn
2026-01-31 10:57 ` Andy Shevchenko
6 siblings, 1 reply; 24+ messages in thread
From: Andrew Lunn @ 2026-01-29 22:36 UTC (permalink / raw)
To: abdurrahman
Cc: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Shevchenko, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
> Skip clock setup on non-OF systems where clock cannot be provided.
I think 'cannot' is wrong here. Non-OF system technically could
provide a clock, using whatever binding method they use. Not having a
clock simply appears to be a limitation of your implementation.
Andrew
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-01-29 21:43 ` [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems Abdurrahman Hussain via B4 Relay
@ 2026-01-29 22:43 ` Andrew Lunn
2026-01-29 23:29 ` Abdurrahman Hussain
2026-01-31 10:10 ` Andy Shevchenko
1 sibling, 1 reply; 24+ messages in thread
From: Andrew Lunn @ 2026-01-29 22:43 UTC (permalink / raw)
To: abdurrahman
Cc: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Shevchenko, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
On Thu, Jan 29, 2026 at 09:43:13PM +0000, Abdurrahman Hussain via B4 Relay wrote:
> From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>
> The xiic driver supports operation without explicit clock configuration
> when clocks cannot be specified via firmware, such as on ACPI-based
> systems.
Are you saying it is technically impossible to specify a clock in
ACPI?
Maybe a more accurate would be:
The xiic driver supports operation without explicit clock
configuration when the clocks are not specified via firmware, such as
when the ACPI tables are missing the description of the clocks.
Andrew
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-01-29 22:43 ` Andrew Lunn
@ 2026-01-29 23:29 ` Abdurrahman Hussain
2026-01-31 10:12 ` Andy Shevchenko
0 siblings, 1 reply; 24+ messages in thread
From: Abdurrahman Hussain @ 2026-01-29 23:29 UTC (permalink / raw)
To: Andrew Lunn
Cc: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Shevchenko, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
> On Jan 29, 2026, at 2:43 PM, Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Thu, Jan 29, 2026 at 09:43:13PM +0000, Abdurrahman Hussain via B4 Relay wrote:
>> From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>>
>> The xiic driver supports operation without explicit clock configuration
>> when clocks cannot be specified via firmware, such as on ACPI-based
>> systems.
>
> Are you saying it is technically impossible to specify a clock in
> ACPI?
>
> Maybe a more accurate would be:
>
> The xiic driver supports operation without explicit clock
> configuration when the clocks are not specified via firmware, such as
> when the ACPI tables are missing the description of the clocks.
>
> Andrew
Actually, ACPI (since 6.5) added a ClockInput() macro that can be added to
_CRS of a device node. The ACPI subsystem in kernel could parse these and
convert into proper clocks integrated with the CCF. But, AFAIK, this idea was
rejected in the past. So, technically, it's the kernel that lacks support on
ACPI systems.
What about this wording then:
The xiic driver supports operation without explicit clock configuration when
the clocks specified via firmware are ignored, such as on ACPI systems.
Abdurrahman
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs
2026-01-29 21:43 ` [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs Abdurrahman Hussain via B4 Relay
@ 2026-01-30 10:48 ` Jonathan Cameron
2026-01-31 10:31 ` Andy Shevchenko
1 sibling, 0 replies; 24+ messages in thread
From: Jonathan Cameron @ 2026-01-30 10:48 UTC (permalink / raw)
To: Abdurrahman Hussain via B4 Relay
Cc: abdurrahman, Michal Simek, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Andy Shevchenko,
linux-arm-kernel, linux-i2c, linux-kernel, devicetree
On Thu, 29 Jan 2026 21:43:14 +0000
Abdurrahman Hussain via B4 Relay <devnull+abdurrahman.nexthop.ai@kernel.org> wrote:
> From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>
> Simplify the error code paths by switching to devres managed helper
> functions.
>
> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
> ---
> drivers/i2c/busses/i2c-xiic.c | 28 +++++++++++-----------------
> 1 file changed, 11 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index 912a94d4d080..a480cbb86d93 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -1462,7 +1462,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
> snprintf(i2c->adap.name, sizeof(i2c->adap.name),
> DRIVER_NAME " %s", pdev->name);
>
> - mutex_init(&i2c->lock);
> + ret = devm_mutex_init(dev, &i2c->lock);
> + if (ret)
> + return ret;
> +
> spin_lock_init(&i2c->atomic_lock);
>
> if (is_of_node(dev->fwnode)) {
> @@ -1475,8 +1478,9 @@ static int xiic_i2c_probe(struct platform_device *pdev)
> i2c->dev = &pdev->dev;
> pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT);
> pm_runtime_use_autosuspend(i2c->dev);
> - pm_runtime_set_active(i2c->dev);
> - pm_runtime_enable(i2c->dev);
> + ret = devm_pm_runtime_set_active_enabled(dev);
> + if (ret)
> + return ret;
>
> /* SCL frequency configuration */
> i2c->input_clk = clk_get_rate(i2c->clk);
> @@ -1492,7 +1496,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
>
> if (ret < 0) {
> dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
> - goto err_pm_disable;
> + return ret;
return dev_err_probe();
> }
>
> i2c->singlemaster =
> @@ -1511,16 +1515,14 @@ static int xiic_i2c_probe(struct platform_device *pdev)
> i2c->endianness = BIG;
>
> ret = xiic_reinit(i2c);
> - if (ret < 0) {
> - dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n");
> - goto err_pm_disable;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "Cannot xiic_reinit\n");
>
> /* add i2c adapter to i2c tree */
> ret = i2c_add_adapter(&i2c->adap);
> if (ret) {
> xiic_deinit(i2c);
> - goto err_pm_disable;
> + return ret;
> }
>
> if (pdata) {
> @@ -1532,12 +1534,6 @@ static int xiic_i2c_probe(struct platform_device *pdev)
> dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n",
> (unsigned long)res->start, irq, i2c->i2c_clk);
>
> - return 0;
> -
> -err_pm_disable:
> - pm_runtime_disable(&pdev->dev);
> - pm_runtime_set_suspended(&pdev->dev);
> -
> return ret;
> }
>
> @@ -1558,8 +1554,6 @@ static void xiic_i2c_remove(struct platform_device *pdev)
> xiic_deinit(i2c);
>
> pm_runtime_put_sync(i2c->dev);
> - pm_runtime_disable(&pdev->dev);
> - pm_runtime_set_suspended(&pdev->dev);
> pm_runtime_dont_use_autosuspend(&pdev->dev);
> }
>
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 3/6] i2c: xiic: remove duplicate error message
2026-01-29 21:43 ` [PATCH v7 3/6] i2c: xiic: remove duplicate error message Abdurrahman Hussain via B4 Relay
@ 2026-01-30 10:49 ` Jonathan Cameron
0 siblings, 0 replies; 24+ messages in thread
From: Jonathan Cameron @ 2026-01-30 10:49 UTC (permalink / raw)
To: Abdurrahman Hussain via B4 Relay
Cc: abdurrahman, Michal Simek, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Andy Shevchenko,
linux-arm-kernel, linux-i2c, linux-kernel, devicetree,
Andrew Lunn
On Thu, 29 Jan 2026 21:43:15 +0000
Abdurrahman Hussain via B4 Relay <devnull+abdurrahman.nexthop.ai@kernel.org> wrote:
> From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>
> The devm_request_threaded_irq() already prints an error message. Remove
> the duplicate.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
> ---
> drivers/i2c/busses/i2c-xiic.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index a480cbb86d93..ca5685660e45 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -1493,11 +1493,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
> ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> xiic_process, IRQF_ONESHOT,
> pdev->name, i2c);
> -
> - if (ret < 0) {
> - dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
> + if (ret)
> return ret;
Ah ok. I'd be tempted to drop that before the previous patch then we don't
have the dance that I guess was there to reduce churn.
> - }
>
> i2c->singlemaster =
> of_property_read_bool(pdev->dev.of_node, "single-master");
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-01-29 21:43 ` [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems Abdurrahman Hussain via B4 Relay
2026-01-29 22:43 ` Andrew Lunn
@ 2026-01-31 10:10 ` Andy Shevchenko
1 sibling, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-01-31 10:10 UTC (permalink / raw)
To: abdurrahman
Cc: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree
On Thu, Jan 29, 2026 at 09:43:13PM +0000, Abdurrahman Hussain via B4 Relay wrote:
> The xiic driver supports operation without explicit clock configuration
> when clocks cannot be specified via firmware, such as on ACPI-based
> systems. This behavior is implemented in xiic_setclk(), which returns
> early when either i2c_clk or input_clk are zero.
...
> - i2c->clk = devm_clk_get_enabled(&pdev->dev, NULL);
> - if (IS_ERR(i2c->clk))
> - return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
> - "failed to enable input clock.\n");
> + if (is_of_node(dev->fwnode)) {
Avoid dereferencing fwnode. Use dev_fwnode() API.
> + i2c->clk = devm_clk_get_enabled(dev, NULL);
> + if (IS_ERR(i2c->clk))
> + return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
> + "failed to enable input clock.\n");
> + }
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-01-29 23:29 ` Abdurrahman Hussain
@ 2026-01-31 10:12 ` Andy Shevchenko
2026-02-01 1:30 ` Abdurrahman Hussain
0 siblings, 1 reply; 24+ messages in thread
From: Andy Shevchenko @ 2026-01-31 10:12 UTC (permalink / raw)
To: Abdurrahman Hussain
Cc: Andrew Lunn, Michal Simek, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
On Thu, Jan 29, 2026 at 03:29:45PM -0800, Abdurrahman Hussain wrote:
> > On Jan 29, 2026, at 2:43 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> > On Thu, Jan 29, 2026 at 09:43:13PM +0000, Abdurrahman Hussain via B4 Relay wrote:
> >> The xiic driver supports operation without explicit clock configuration
> >> when clocks cannot be specified via firmware, such as on ACPI-based
> >> systems.
> >
> > Are you saying it is technically impossible to specify a clock in
> > ACPI?
> >
> > Maybe a more accurate would be:
> >
> > The xiic driver supports operation without explicit clock
> > configuration when the clocks are not specified via firmware, such as
> > when the ACPI tables are missing the description of the clocks.
>
> Actually, ACPI (since 6.5) added a ClockInput() macro that can be added to
> _CRS of a device node. The ACPI subsystem in kernel could parse these and
> convert into proper clocks integrated with the CCF. But, AFAIK, this idea was
> rejected in the past.
Rejected by which side? CCF?
Because specification still has that.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs
2026-01-29 21:43 ` [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs Abdurrahman Hussain via B4 Relay
2026-01-30 10:48 ` Jonathan Cameron
@ 2026-01-31 10:31 ` Andy Shevchenko
1 sibling, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-01-31 10:31 UTC (permalink / raw)
To: abdurrahman
Cc: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree
On Thu, Jan 29, 2026 at 09:43:14PM +0000, Abdurrahman Hussain via B4 Relay wrote:
> Simplify the error code paths by switching to devres managed helper
> functions.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 6/6] i2c xiic: cosmetic: use resource format specifier in debug log
2026-01-29 21:43 ` [PATCH v7 6/6] i2c xiic: cosmetic: use resource format specifier in debug log Abdurrahman Hussain via B4 Relay
@ 2026-01-31 10:55 ` Andy Shevchenko
0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-01-31 10:55 UTC (permalink / raw)
To: abdurrahman
Cc: Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree
On Thu, Jan 29, 2026 at 09:43:18PM +0000, Abdurrahman Hussain via B4 Relay wrote:
> Use standard resource format specifier %pR in debug log.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 0/6] i2c: xiic: use generic device property accessors
2026-01-29 22:36 ` [PATCH v7 0/6] i2c: xiic: use generic device property accessors Andrew Lunn
@ 2026-01-31 10:57 ` Andy Shevchenko
0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-01-31 10:57 UTC (permalink / raw)
To: Andrew Lunn
Cc: abdurrahman, Michal Simek, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
On Thu, Jan 29, 2026 at 11:36:20PM +0100, Andrew Lunn wrote:
> > Skip clock setup on non-OF systems where clock cannot be provided.
>
> I think 'cannot' is wrong here. Non-OF system technically could
> provide a clock, using whatever binding method they use. Not having a
> clock simply appears to be a limitation of your implementation.
Abdurrahman, can you rebase the series to move DT and clock changes to be the
last in it? This way we can move forward with the cleanups that have no
objections.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
2026-01-29 21:43 ` [PATCH v7 5/6] i2c: xiic: cosmetic cleanup Abdurrahman Hussain via B4 Relay
@ 2026-01-31 14:35 ` Dan Carpenter
2026-02-01 2:14 ` Abdurrahman Hussain
0 siblings, 1 reply; 24+ messages in thread
From: Dan Carpenter @ 2026-01-31 14:35 UTC (permalink / raw)
To: oe-kbuild, Abdurrahman Hussain via B4 Relay, Michal Simek,
Andi Shyti, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: lkp, oe-kbuild-all, Andy Shevchenko, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree, Abdurrahman Hussain
Hi Abdurrahman,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Abdurrahman-Hussain-via-B4-Relay/i2c-xiic-skip-input-clock-setup-on-non-OF-systems/20260130-054653
base: 63804fed149a6750ffd28610c5c1c98cce6bd377
patch link: https://lore.kernel.org/r/20260129-i2c-xiic-v7-5-727e434897ef%40nexthop.ai
patch subject: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
config: i386-randconfig-141-20260130 (https://download.01.org/0day-ci/archive/20260131/202601311615.10yziOui-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch version: v0.5.0-8994-gd50c5a4c
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202601311615.10yziOui-lkp@intel.com/
smatch warnings:
drivers/i2c/busses/i2c-xiic.c:1539 xiic_i2c_remove() warn: pm_runtime_get_sync() also returns 1 on success
vim +1539 drivers/i2c/busses/i2c-xiic.c
e190a0c389e601 Uwe Kleine-König 2023-05-08 1529 static void xiic_i2c_remove(struct platform_device *pdev)
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1530 {
2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1531 struct device *dev = &pdev->dev;
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1532 struct xiic_i2c *i2c = platform_get_drvdata(pdev);
36ecbcab84d023 Shubhrajyoti Datta 2016-03-02 1533 int ret;
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1534
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1535 /* remove adapter & data */
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1536 i2c_del_adapter(&i2c->adap);
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1537
2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1538 ret = pm_runtime_get_sync(dev);
2557b4ba04df79 Abdurrahman Hussain 2026-01-29 @1539 if (ret)
2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1540 dev_warn(dev, "Failed to activate device for removal (%pe)\n",
810199f7315604 Uwe Kleine-König 2022-10-19 1541 ERR_PTR(ret));
pm_runtime_get_sync() can return 1 on success. Perhaps use
pm_runtime_resume_and_get()?
810199f7315604 Uwe Kleine-König 2022-10-19 1542 else
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1543 xiic_deinit(i2c);
810199f7315604 Uwe Kleine-König 2022-10-19 1544
2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1545 pm_runtime_put_sync(dev);
2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1546 pm_runtime_dont_use_autosuspend(dev);
e1d5b6598cdc33 Richard Röjfors 2010-02-11 1547 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-01-31 10:12 ` Andy Shevchenko
@ 2026-02-01 1:30 ` Abdurrahman Hussain
2026-02-02 13:21 ` Andrew Lunn
0 siblings, 1 reply; 24+ messages in thread
From: Abdurrahman Hussain @ 2026-02-01 1:30 UTC (permalink / raw)
To: Andy Shevchenko, Abdurrahman Hussain
Cc: Andrew Lunn, Michal Simek, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
On Sat Jan 31, 2026 at 10:12 AM UTC, Andy Shevchenko wrote:
> On Thu, Jan 29, 2026 at 03:29:45PM -0800, Abdurrahman Hussain wrote:
>> > On Jan 29, 2026, at 2:43 PM, Andrew Lunn <andrew@lunn.ch> wrote:
>> > On Thu, Jan 29, 2026 at 09:43:13PM +0000, Abdurrahman Hussain via B4 Relay wrote:
>
>> >> The xiic driver supports operation without explicit clock configuration
>> >> when clocks cannot be specified via firmware, such as on ACPI-based
>> >> systems.
>> >
>> > Are you saying it is technically impossible to specify a clock in
>> > ACPI?
>> >
>> > Maybe a more accurate would be:
>> >
>> > The xiic driver supports operation without explicit clock
>> > configuration when the clocks are not specified via firmware, such as
>> > when the ACPI tables are missing the description of the clocks.
>>
>> Actually, ACPI (since 6.5) added a ClockInput() macro that can be added to
>> _CRS of a device node. The ACPI subsystem in kernel could parse these and
>> convert into proper clocks integrated with the CCF. But, AFAIK, this idea was
>> rejected in the past.
>
> Rejected by which side? CCF?
> Because specification still has that.
I think the argument was that on ACPI based systems clocks are "owned"
by AML and there could be syncronizations issuebetween AML and the OS.
See https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1712165.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
2026-01-31 14:35 ` Dan Carpenter
@ 2026-02-01 2:14 ` Abdurrahman Hussain
2026-02-01 22:23 ` Uwe Kleine-König
0 siblings, 1 reply; 24+ messages in thread
From: Abdurrahman Hussain @ 2026-02-01 2:14 UTC (permalink / raw)
To: Dan Carpenter
Cc: oe-kbuild, Abdurrahman Hussain via B4 Relay, Michal Simek,
Andi Shyti, Rob Herring, Uwe Kleine-König,
Krzysztof Kozlowski, Conor Dooley, lkp, oe-kbuild-all,
Andy Shevchenko, linux-arm-kernel, linux-i2c, linux-kernel,
devicetree
> On Jan 31, 2026, at 6:35 AM, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> Hi Abdurrahman,
>
> kernel test robot noticed the following build warnings:
>
> url: https://github.com/intel-lab-lkp/linux/commits/Abdurrahman-Hussain-via-B4-Relay/i2c-xiic-skip-input-clock-setup-on-non-OF-systems/20260130-054653
> base: 63804fed149a6750ffd28610c5c1c98cce6bd377
> patch link: https://lore.kernel.org/r/20260129-i2c-xiic-v7-5-727e434897ef%40nexthop.ai
> patch subject: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
> config: i386-randconfig-141-20260130 (https://download.01.org/0day-ci/archive/20260131/202601311615.10yziOui-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> smatch version: v0.5.0-8994-gd50c5a4c
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202601311615.10yziOui-lkp@intel.com/
>
> smatch warnings:
> drivers/i2c/busses/i2c-xiic.c:1539 xiic_i2c_remove() warn: pm_runtime_get_sync() also returns 1 on success
>
> vim +1539 drivers/i2c/busses/i2c-xiic.c
>
> e190a0c389e601 Uwe Kleine-König 2023-05-08 1529 static void xiic_i2c_remove(struct platform_device *pdev)
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1530 {
> 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1531 struct device *dev = &pdev->dev;
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1532 struct xiic_i2c *i2c = platform_get_drvdata(pdev);
> 36ecbcab84d023 Shubhrajyoti Datta 2016-03-02 1533 int ret;
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1534
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1535 /* remove adapter & data */
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1536 i2c_del_adapter(&i2c->adap);
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1537
> 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1538 ret = pm_runtime_get_sync(dev);
> 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 @1539 if (ret)
> 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1540 dev_warn(dev, "Failed to activate device for removal (%pe)\n",
> 810199f7315604 Uwe Kleine-König 2022-10-19 1541 ERR_PTR(ret));
>
>
> pm_runtime_get_sync() can return 1 on success. Perhaps use
> pm_runtime_resume_and_get()?
>
> 810199f7315604 Uwe Kleine-König 2022-10-19 1542 else
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1543 xiic_deinit(i2c);
> 810199f7315604 Uwe Kleine-König 2022-10-19 1544
> 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1545 pm_runtime_put_sync(dev);
> 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1546 pm_runtime_dont_use_autosuspend(dev);
> e1d5b6598cdc33 Richard Röjfors 2010-02-11 1547 }
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
>
This maybe a false positive.
The following commit switched from pm_runtime_resume_and_get() to
pm_runtime_get_sync():
commit 810199f7315604b i2c: xiic: Make sure to disable clock on .remove()
Uwe, Michal, can you guys comment on this?
Regards,
Abdurrahman
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
2026-02-01 2:14 ` Abdurrahman Hussain
@ 2026-02-01 22:23 ` Uwe Kleine-König
2026-02-02 2:06 ` Abdurrahman Hussain
0 siblings, 1 reply; 24+ messages in thread
From: Uwe Kleine-König @ 2026-02-01 22:23 UTC (permalink / raw)
To: Abdurrahman Hussain
Cc: Dan Carpenter, oe-kbuild, Abdurrahman Hussain via B4 Relay,
Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, lkp, oe-kbuild-all, Andy Shevchenko,
linux-arm-kernel, linux-i2c, linux-kernel, devicetree
[-- Attachment #1: Type: text/plain, Size: 4161 bytes --]
Hello,
On Sat, Jan 31, 2026 at 06:14:58PM -0800, Abdurrahman Hussain wrote:
> > On Jan 31, 2026, at 6:35 AM, Dan Carpenter <dan.carpenter@linaro.org> wrote:
> > kernel test robot noticed the following build warnings:
> >
> > url: https://github.com/intel-lab-lkp/linux/commits/Abdurrahman-Hussain-via-B4-Relay/i2c-xiic-skip-input-clock-setup-on-non-OF-systems/20260130-054653
> > base: 63804fed149a6750ffd28610c5c1c98cce6bd377
> > patch link: https://lore.kernel.org/r/20260129-i2c-xiic-v7-5-727e434897ef%40nexthop.ai
> > patch subject: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
> > config: i386-randconfig-141-20260130 (https://download.01.org/0day-ci/archive/20260131/202601311615.10yziOui-lkp@intel.com/config)
> > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> > smatch version: v0.5.0-8994-gd50c5a4c
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> > | Closes: https://lore.kernel.org/r/202601311615.10yziOui-lkp@intel.com/
> >
> > smatch warnings:
> > drivers/i2c/busses/i2c-xiic.c:1539 xiic_i2c_remove() warn: pm_runtime_get_sync() also returns 1 on success
> >
> > vim +1539 drivers/i2c/busses/i2c-xiic.c
> >
> > e190a0c389e601 Uwe Kleine-König 2023-05-08 1529 static void xiic_i2c_remove(struct platform_device *pdev)
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1530 {
> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1531 struct device *dev = &pdev->dev;
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1532 struct xiic_i2c *i2c = platform_get_drvdata(pdev);
> > 36ecbcab84d023 Shubhrajyoti Datta 2016-03-02 1533 int ret;
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1534
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1535 /* remove adapter & data */
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1536 i2c_del_adapter(&i2c->adap);
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1537
> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1538 ret = pm_runtime_get_sync(dev);
> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 @1539 if (ret)
> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1540 dev_warn(dev, "Failed to activate device for removal (%pe)\n",
> > 810199f7315604 Uwe Kleine-König 2022-10-19 1541 ERR_PTR(ret));
> >
> >
> > pm_runtime_get_sync() can return 1 on success. Perhaps use
> > pm_runtime_resume_and_get()?
> >
> > 810199f7315604 Uwe Kleine-König 2022-10-19 1542 else
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1543 xiic_deinit(i2c);
> > 810199f7315604 Uwe Kleine-König 2022-10-19 1544
> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1545 pm_runtime_put_sync(dev);
> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1546 pm_runtime_dont_use_autosuspend(dev);
> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1547 }
> >
> > --
> > 0-DAY CI Kernel Test Service
> > https://github.com/intel/lkp-tests/wiki
> >
>
> This maybe a false positive.
It's not.
The blamed commit 2557b4ba04df ("i2c: xiic: cosmetic cleanup") has:
- ret = pm_runtime_get_sync(i2c->dev);
-
- if (ret < 0)
- dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n",
+ ret = pm_runtime_get_sync(dev);
+ if (ret)
+ dev_warn(dev, "Failed to activate device for removal (%pe)\n",
ERR_PTR(ret));
So we need
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 37a15065db60..a5334b7c46d8 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1536,7 +1536,7 @@ static void xiic_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(&i2c->adap);
ret = pm_runtime_get_sync(dev);
- if (ret)
+ if (ret < 0)
dev_warn(dev, "Failed to activate device for removal (%pe)\n",
ERR_PTR(ret));
else
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
2026-02-01 22:23 ` Uwe Kleine-König
@ 2026-02-02 2:06 ` Abdurrahman Hussain
0 siblings, 0 replies; 24+ messages in thread
From: Abdurrahman Hussain @ 2026-02-02 2:06 UTC (permalink / raw)
To: Uwe Kleine-König, Abdurrahman Hussain
Cc: Dan Carpenter, oe-kbuild, Abdurrahman Hussain via B4 Relay,
Michal Simek, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, lkp, oe-kbuild-all, Andy Shevchenko,
linux-arm-kernel, linux-i2c, linux-kernel, devicetree
On Sun Feb 1, 2026 at 10:23 PM UTC, Uwe Kleine-König wrote:
> Hello,
>
> On Sat, Jan 31, 2026 at 06:14:58PM -0800, Abdurrahman Hussain wrote:
>> > On Jan 31, 2026, at 6:35 AM, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>> > kernel test robot noticed the following build warnings:
>> >
>> > url: https://github.com/intel-lab-lkp/linux/commits/Abdurrahman-Hussain-via-B4-Relay/i2c-xiic-skip-input-clock-setup-on-non-OF-systems/20260130-054653
>> > base: 63804fed149a6750ffd28610c5c1c98cce6bd377
>> > patch link: https://lore.kernel.org/r/20260129-i2c-xiic-v7-5-727e434897ef%40nexthop.ai
>> > patch subject: [PATCH v7 5/6] i2c: xiic: cosmetic cleanup
>> > config: i386-randconfig-141-20260130 (https://download.01.org/0day-ci/archive/20260131/202601311615.10yziOui-lkp@intel.com/config)
>> > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
>> > smatch version: v0.5.0-8994-gd50c5a4c
>> >
>> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> > the same patch/commit), kindly add following tags
>> > | Reported-by: kernel test robot <lkp@intel.com>
>> > | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
>> > | Closes: https://lore.kernel.org/r/202601311615.10yziOui-lkp@intel.com/
>> >
>> > smatch warnings:
>> > drivers/i2c/busses/i2c-xiic.c:1539 xiic_i2c_remove() warn: pm_runtime_get_sync() also returns 1 on success
>> >
>> > vim +1539 drivers/i2c/busses/i2c-xiic.c
>> >
>> > e190a0c389e601 Uwe Kleine-König 2023-05-08 1529 static void xiic_i2c_remove(struct platform_device *pdev)
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1530 {
>> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1531 struct device *dev = &pdev->dev;
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1532 struct xiic_i2c *i2c = platform_get_drvdata(pdev);
>> > 36ecbcab84d023 Shubhrajyoti Datta 2016-03-02 1533 int ret;
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1534
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1535 /* remove adapter & data */
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1536 i2c_del_adapter(&i2c->adap);
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1537
>> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1538 ret = pm_runtime_get_sync(dev);
>> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 @1539 if (ret)
>> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1540 dev_warn(dev, "Failed to activate device for removal (%pe)\n",
>> > 810199f7315604 Uwe Kleine-König 2022-10-19 1541 ERR_PTR(ret));
>> >
>> >
>> > pm_runtime_get_sync() can return 1 on success. Perhaps use
>> > pm_runtime_resume_and_get()?
>> >
>> > 810199f7315604 Uwe Kleine-König 2022-10-19 1542 else
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1543 xiic_deinit(i2c);
>> > 810199f7315604 Uwe Kleine-König 2022-10-19 1544
>> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1545 pm_runtime_put_sync(dev);
>> > 2557b4ba04df79 Abdurrahman Hussain 2026-01-29 1546 pm_runtime_dont_use_autosuspend(dev);
>> > e1d5b6598cdc33 Richard Röjfors 2010-02-11 1547 }
>> >
>> > --
>> > 0-DAY CI Kernel Test Service
>> > https://github.com/intel/lkp-tests/wiki
>> >
>>
>> This maybe a false positive.
>
> It's not.
>
> The blamed commit 2557b4ba04df ("i2c: xiic: cosmetic cleanup") has:
>
> - ret = pm_runtime_get_sync(i2c->dev);
> -
> - if (ret < 0)
> - dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n",
> + ret = pm_runtime_get_sync(dev);
> + if (ret)
> + dev_warn(dev, "Failed to activate device for removal (%pe)\n",
> ERR_PTR(ret));
>
> So we need
>
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index 37a15065db60..a5334b7c46d8 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -1536,7 +1536,7 @@ static void xiic_i2c_remove(struct platform_device *pdev)
> i2c_del_adapter(&i2c->adap);
>
> ret = pm_runtime_get_sync(dev);
> - if (ret)
> + if (ret < 0)
> dev_warn(dev, "Failed to activate device for removal (%pe)\n",
> ERR_PTR(ret));
> else
>
> Best regards
> Uwe
Hi Uwe,
Yes, indeed, I missed that. Thanks for pointing it out!
Best regards,
Abdurrahman
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-02-01 1:30 ` Abdurrahman Hussain
@ 2026-02-02 13:21 ` Andrew Lunn
2026-02-02 18:26 ` Abdurrahman Hussain
0 siblings, 1 reply; 24+ messages in thread
From: Andrew Lunn @ 2026-02-02 13:21 UTC (permalink / raw)
To: Abdurrahman Hussain
Cc: Andy Shevchenko, Michal Simek, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
On Sat, Jan 31, 2026 at 08:30:40PM -0500, Abdurrahman Hussain wrote:
> On Sat Jan 31, 2026 at 10:12 AM UTC, Andy Shevchenko wrote:
> > On Thu, Jan 29, 2026 at 03:29:45PM -0800, Abdurrahman Hussain wrote:
> >> > On Jan 29, 2026, at 2:43 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> >> > On Thu, Jan 29, 2026 at 09:43:13PM +0000, Abdurrahman Hussain via B4 Relay wrote:
> >
> >> >> The xiic driver supports operation without explicit clock configuration
> >> >> when clocks cannot be specified via firmware, such as on ACPI-based
> >> >> systems.
> >> >
> >> > Are you saying it is technically impossible to specify a clock in
> >> > ACPI?
> >> >
> >> > Maybe a more accurate would be:
> >> >
> >> > The xiic driver supports operation without explicit clock
> >> > configuration when the clocks are not specified via firmware, such as
> >> > when the ACPI tables are missing the description of the clocks.
> >>
> >> Actually, ACPI (since 6.5) added a ClockInput() macro that can be added to
> >> _CRS of a device node. The ACPI subsystem in kernel could parse these and
> >> convert into proper clocks integrated with the CCF. But, AFAIK, this idea was
> >> rejected in the past.
> >
> > Rejected by which side? CCF?
> > Because specification still has that.
>
> I think the argument was that on ACPI based systems clocks are "owned"
> by AML and there could be syncronizations issuebetween AML and the OS.
>
> See https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1712165.html
Doesn't that just mean there needs to be a call into AML to request it
take an action on a clock? Otherwise, why even have ClockInput()? This
link is to quite an old thread, 2018, where as ClockInput seems to be
pretty new.
The fact ClockInput() exists, means at some point somebody will
implement it. Once it has been implemented, somebody might need to use
it with xiic? Because it is mandatory in DT, and there is no ACPI
binding document for xiic, they could make it mandatory in ACPI as
well. And then your device breaks.
By putting in the commit message something like:
Currently Linux does not implement ACPI ClockInput to describe clock
resources, unlike DT. However the xiic driver is happy if something
magically enables the clock before the driver probes, and does not
turn it off again. The clock should always be considered optional for
ACPI.
That should act has a hint to future developers hacking on xiic not to
make it mandatory.
Andrew
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems
2026-02-02 13:21 ` Andrew Lunn
@ 2026-02-02 18:26 ` Abdurrahman Hussain
0 siblings, 0 replies; 24+ messages in thread
From: Abdurrahman Hussain @ 2026-02-02 18:26 UTC (permalink / raw)
To: Andrew Lunn
Cc: Andy Shevchenko, Michal Simek, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-i2c,
linux-kernel, devicetree
> On Feb 2, 2026, at 5:21 AM, Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Sat, Jan 31, 2026 at 08:30:40PM -0500, Abdurrahman Hussain wrote:
>> On Sat Jan 31, 2026 at 10:12 AM UTC, Andy Shevchenko wrote:
>>> On Thu, Jan 29, 2026 at 03:29:45PM -0800, Abdurrahman Hussain wrote:
>>>>> On Jan 29, 2026, at 2:43 PM, Andrew Lunn <andrew@lunn.ch> wrote:
>>>>> On Thu, Jan 29, 2026 at 09:43:13PM +0000, Abdurrahman Hussain via B4 Relay wrote:
>>>
>>>>>> The xiic driver supports operation without explicit clock configuration
>>>>>> when clocks cannot be specified via firmware, such as on ACPI-based
>>>>>> systems.
>>>>>
>>>>> Are you saying it is technically impossible to specify a clock in
>>>>> ACPI?
>>>>>
>>>>> Maybe a more accurate would be:
>>>>>
>>>>> The xiic driver supports operation without explicit clock
>>>>> configuration when the clocks are not specified via firmware, such as
>>>>> when the ACPI tables are missing the description of the clocks.
>>>>
>>>> Actually, ACPI (since 6.5) added a ClockInput() macro that can be added to
>>>> _CRS of a device node. The ACPI subsystem in kernel could parse these and
>>>> convert into proper clocks integrated with the CCF. But, AFAIK, this idea was
>>>> rejected in the past.
>>>
>>> Rejected by which side? CCF?
>>> Because specification still has that.
>>
>> I think the argument was that on ACPI based systems clocks are "owned"
>> by AML and there could be syncronizations issuebetween AML and the OS.
>>
>> See https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1712165.html
>
> Doesn't that just mean there needs to be a call into AML to request it
> take an action on a clock? Otherwise, why even have ClockInput()? This
> link is to quite an old thread, 2018, where as ClockInput seems to be
> pretty new.
>
> The fact ClockInput() exists, means at some point somebody will
> implement it. Once it has been implemented, somebody might need to use
> it with xiic? Because it is mandatory in DT, and there is no ACPI
> binding document for xiic, they could make it mandatory in ACPI as
> well. And then your device breaks.
>
That makes sense. I might have misread the thread and came to the wrong
conclusion that converting ClockInput() into a CCF clocks was
undesirable. Thank you for clarifying. Maybe I can start looking into adding
support for this after this series is merged.
> By putting in the commit message something like:
>
> Currently Linux does not implement ACPI ClockInput to describe clock
> resources, unlike DT. However the xiic driver is happy if something
> magically enables the clock before the driver probes, and does not
> turn it off again. The clock should always be considered optional for
> ACPI.
>
> That should act has a hint to future developers hacking on xiic not to
> make it mandatory.
>
Yes, that is much more clear and concise! I am going to use this paragraph
verbatim in the commit message. Thanks for all the feedback, Andrew!
Best regards,
Abdurrahman
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2026-02-02 18:26 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 21:43 [PATCH v7 0/6] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
2026-01-29 21:43 ` [PATCH v7 1/6] i2c: xiic: skip input clock setup on non-OF systems Abdurrahman Hussain via B4 Relay
2026-01-29 22:43 ` Andrew Lunn
2026-01-29 23:29 ` Abdurrahman Hussain
2026-01-31 10:12 ` Andy Shevchenko
2026-02-01 1:30 ` Abdurrahman Hussain
2026-02-02 13:21 ` Andrew Lunn
2026-02-02 18:26 ` Abdurrahman Hussain
2026-01-31 10:10 ` Andy Shevchenko
2026-01-29 21:43 ` [PATCH v7 2/6] i2c: xiic: switch to devres managed APIs Abdurrahman Hussain via B4 Relay
2026-01-30 10:48 ` Jonathan Cameron
2026-01-31 10:31 ` Andy Shevchenko
2026-01-29 21:43 ` [PATCH v7 3/6] i2c: xiic: remove duplicate error message Abdurrahman Hussain via B4 Relay
2026-01-30 10:49 ` Jonathan Cameron
2026-01-29 21:43 ` [PATCH v7 4/6] i2c: xiic: switch to generic device property accessors Abdurrahman Hussain via B4 Relay
2026-01-29 21:43 ` [PATCH v7 5/6] i2c: xiic: cosmetic cleanup Abdurrahman Hussain via B4 Relay
2026-01-31 14:35 ` Dan Carpenter
2026-02-01 2:14 ` Abdurrahman Hussain
2026-02-01 22:23 ` Uwe Kleine-König
2026-02-02 2:06 ` Abdurrahman Hussain
2026-01-29 21:43 ` [PATCH v7 6/6] i2c xiic: cosmetic: use resource format specifier in debug log Abdurrahman Hussain via B4 Relay
2026-01-31 10:55 ` Andy Shevchenko
2026-01-29 22:36 ` [PATCH v7 0/6] i2c: xiic: use generic device property accessors Andrew Lunn
2026-01-31 10:57 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox