Re: [PATCH v2 1/3] mfd: tqmx86: do not access I2C_DETECT register through io_base

From: Lee Jones
Date: Fri Mar 03 2023 - 07:04:44 EST


On Mon, 20 Feb 2023, Matthias Schiffer wrote:

> The I2C_DETECT register is at IO port 0x1a7, which is outside the range
> passed to devm_ioport_map() for io_base, and was only working because
> there aren't actually any bounds checks for IO port accesses.
>
> Extending the range does not seem like a good solution here, as it would
> then conflict with the IO resource assigned to the I2C controller. As
> this is just a one-off access during probe, use a simple inb() instead.
>
> While we're at it, drop the unused define TQMX86_REG_I2C_INT_EN.
>
> Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
> ---
>
> Notes:
> v2: add comment regarding use of inb() as suggested by Andrew
>
> drivers/mfd/tqmx86.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]