linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
@ 2021-07-02 12:23 Matthias Schiffer
  2021-07-02 12:23 ` [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

Updated patch series:

- A number of new patches (more hardware support and a few fixes)
- Patches 1-3 have gained Fixes tags
- Patch 2 depends on 1, so maybe we can push the GPIO patch through the
  MFD tree to keep them together?
- The change in patch 7 was somewhat controversial. I've added a
  warning, but it is the last patch of the series, so it doesn't affect
  the rest of the series if it is rejected.


Matthias Schiffer (7):
  gpio: tqmx86: really make IRQ optional
  mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  mfd: tqmx86: remove incorrect TQMx90UC board ID
  mfd: tqmx86: fix typo in "platform"
  mfd: tqmx86: add support for TQMx110EB and TQMxE40x
  mfd: tqmx86: add support for TQ-Systems DMI IDs
  mfd: tqmx86: assume 24MHz LPC clock for unknown boards

 drivers/gpio/gpio-tqmx86.c |  6 ++---
 drivers/mfd/tqmx86.c       | 48 ++++++++++++++++++++++++++++++--------
 2 files changed, 41 insertions(+), 13 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
@ 2021-07-02 12:23 ` Matthias Schiffer
  2021-07-02 13:45   ` Andrew Lunn
  2021-07-02 12:23 ` [PATCH v2 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

The tqmx86 MFD driver was passing IRQ 0 for "no IRQ" in the past. This
causes warnings with newer kernels.

Prepare the gpio-tqmx86 driver for the fixed MFD driver by handling a
missing IRQ properly.

Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2: add Fixes line

The "irq != -ENXIO" check can be removed again if
platform_get_irq_optional() is modified to return 0 when no IRQ is
found; the current code will work with both -ENXIO and 0 returns.


 drivers/gpio/gpio-tqmx86.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c
index 5022e0ad0fae..0f5d17f343f1 100644
--- a/drivers/gpio/gpio-tqmx86.c
+++ b/drivers/gpio/gpio-tqmx86.c
@@ -238,8 +238,8 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
 	struct resource *res;
 	int ret, irq;
 
-	irq = platform_get_irq(pdev, 0);
-	if (irq < 0)
+	irq = platform_get_irq_optional(pdev, 0);
+	if (irq < 0 && irq != -ENXIO)
 		return irq;
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
@@ -278,7 +278,7 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(&pdev->dev);
 
-	if (irq) {
+	if (irq > 0) {
 		struct irq_chip *irq_chip = &gpio->irq_chip;
 		u8 irq_status;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
  2021-07-02 12:23 ` [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
@ 2021-07-02 12:23 ` Matthias Schiffer
  2021-07-02 13:52   ` Andrew Lunn
  2021-07-02 12:23 ` [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

The driver was registering IRQ 0 when no IRQ was set. This leads to
warnings with newer kernels.

Clear the resource flags, so no resource is registered at all in this
case.

Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2: add Fixes line

Andy recommended to use IORESOURCE_DISABLED instead, but this doesn't
have any effect for platform_get_irq(), so I'm resubmitting this patch
without functional changes. Grepping for '\.flags = 0;' shows other
drivers doing the same.


 drivers/mfd/tqmx86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index ddddf08b6a4c..732013f40e4e 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -209,6 +209,8 @@ static int tqmx86_probe(struct platform_device *pdev)
 
 		/* Assumes the IRQ resource is first. */
 		tqmx_gpio_resources[0].start = gpio_irq;
+	} else {
+		tqmx_gpio_resources[0].flags = 0;
 	}
 
 	ocores_platfom_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
  2021-07-02 12:23 ` [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
  2021-07-02 12:23 ` [PATCH v2 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
@ 2021-07-02 12:23 ` Matthias Schiffer
  2021-07-02 13:56   ` Andrew Lunn
  2021-07-02 12:23 ` [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

No TQMx90UC exists at the moment, and it is undecided whether ID 10 will
be used eventually (and if it is, how that SoM will be named).

Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2: new patch

 drivers/mfd/tqmx86.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 732013f40e4e..9b65dbedc1bb 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -35,7 +35,6 @@
 #define TQMX86_REG_BOARD_ID_E39x	7
 #define TQMX86_REG_BOARD_ID_70EB	8
 #define TQMX86_REG_BOARD_ID_80UC	9
-#define TQMX86_REG_BOARD_ID_90UC	10
 #define TQMX86_REG_BOARD_REV	0x21
 #define TQMX86_REG_IO_EXT_INT	0x26
 #define TQMX86_REG_IO_EXT_INT_NONE		0
@@ -128,8 +127,6 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
 		return "TQMx70EB";
 	case TQMX86_REG_BOARD_ID_80UC:
 		return "TQMx80UC";
-	case TQMX86_REG_BOARD_ID_90UC:
-		return "TQMx90UC";
 	default:
 		return "Unknown";
 	}
@@ -142,7 +139,6 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
 	case TQMX86_REG_BOARD_ID_60EB:
 	case TQMX86_REG_BOARD_ID_70EB:
 	case TQMX86_REG_BOARD_ID_80UC:
-	case TQMX86_REG_BOARD_ID_90UC:
 		return 24000;
 	case TQMX86_REG_BOARD_ID_E39M:
 	case TQMX86_REG_BOARD_ID_E39C:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform"
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (2 preceding siblings ...)
  2021-07-02 12:23 ` [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
@ 2021-07-02 12:23 ` Matthias Schiffer
  2021-07-02 14:00   ` Andrew Lunn
  2021-07-02 12:23 ` [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x Matthias Schiffer
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

Rename variable from "ocores_platfom_data" to "ocores_platform_data".

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2: new patch

 drivers/mfd/tqmx86.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 9b65dbedc1bb..ff1bdb742e3f 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -76,7 +76,7 @@ static struct i2c_board_info tqmx86_i2c_devices[] = {
 	},
 };
 
-static struct ocores_i2c_platform_data ocores_platfom_data = {
+static struct ocores_i2c_platform_data ocores_platform_data = {
 	.num_devices = ARRAY_SIZE(tqmx86_i2c_devices),
 	.devices = tqmx86_i2c_devices,
 };
@@ -84,8 +84,8 @@ static struct ocores_i2c_platform_data ocores_platfom_data = {
 static const struct mfd_cell tqmx86_i2c_soft_dev[] = {
 	{
 		.name = "ocores-i2c",
-		.platform_data = &ocores_platfom_data,
-		.pdata_size = sizeof(ocores_platfom_data),
+		.platform_data = &ocores_platform_data,
+		.pdata_size = sizeof(ocores_platform_data),
 		.resources = tqmx_i2c_soft_resources,
 		.num_resources = ARRAY_SIZE(tqmx_i2c_soft_resources),
 	},
@@ -209,7 +209,7 @@ static int tqmx86_probe(struct platform_device *pdev)
 		tqmx_gpio_resources[0].flags = 0;
 	}
 
-	ocores_platfom_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
+	ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
 
 	if (i2c_det == TQMX86_REG_I2C_DETECT_SOFT) {
 		err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (3 preceding siblings ...)
  2021-07-02 12:23 ` [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
@ 2021-07-02 12:23 ` Matthias Schiffer
  2021-07-02 14:01   ` Andrew Lunn
  2021-07-02 12:23 ` [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs Matthias Schiffer
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

Add the board IDs for the TQMx110EB and the TQMxE40x family. All use a
24MHz LPC clock.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2:
- add more new modules
- explicitly list each module for LPC clock

 drivers/mfd/tqmx86.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index ff1bdb742e3f..9eb05b3ef573 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -35,6 +35,11 @@
 #define TQMX86_REG_BOARD_ID_E39x	7
 #define TQMX86_REG_BOARD_ID_70EB	8
 #define TQMX86_REG_BOARD_ID_80UC	9
+#define TQMX86_REG_BOARD_ID_110EB	11
+#define TQMX86_REG_BOARD_ID_E40M	12
+#define TQMX86_REG_BOARD_ID_E40S	13
+#define TQMX86_REG_BOARD_ID_E40C1	14
+#define TQMX86_REG_BOARD_ID_E40C2	15
 #define TQMX86_REG_BOARD_REV	0x21
 #define TQMX86_REG_IO_EXT_INT	0x26
 #define TQMX86_REG_IO_EXT_INT_NONE		0
@@ -127,6 +132,16 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
 		return "TQMx70EB";
 	case TQMX86_REG_BOARD_ID_80UC:
 		return "TQMx80UC";
+	case TQMX86_REG_BOARD_ID_110EB:
+		return "TQMx110EB";
+	case TQMX86_REG_BOARD_ID_E40M:
+		return "TQMxE40M";
+	case TQMX86_REG_BOARD_ID_E40S:
+		return "TQMxE40S";
+	case TQMX86_REG_BOARD_ID_E40C1:
+		return "TQMxE40C1";
+	case TQMX86_REG_BOARD_ID_E40C2:
+		return "TQMxE40C2";
 	default:
 		return "Unknown";
 	}
@@ -139,6 +154,11 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
 	case TQMX86_REG_BOARD_ID_60EB:
 	case TQMX86_REG_BOARD_ID_70EB:
 	case TQMX86_REG_BOARD_ID_80UC:
+	case TQMX86_REG_BOARD_ID_110EB:
+	case TQMX86_REG_BOARD_ID_E40M:
+	case TQMX86_REG_BOARD_ID_E40S:
+	case TQMX86_REG_BOARD_ID_E40C1:
+	case TQMX86_REG_BOARD_ID_E40C2:
 		return 24000;
 	case TQMX86_REG_BOARD_ID_E39M:
 	case TQMX86_REG_BOARD_ID_E39C:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (4 preceding siblings ...)
  2021-07-02 12:23 ` [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x Matthias Schiffer
@ 2021-07-02 12:23 ` Matthias Schiffer
  2021-07-02 14:01   ` Andrew Lunn
  2021-07-02 12:23 ` [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards Matthias Schiffer
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

Newer TQMx86 modules use TQ-Systems instead of TQ-Group as their vendor
ID.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2: new patch

 drivers/mfd/tqmx86.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 9eb05b3ef573..58f35c8b5a45 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -271,6 +271,14 @@ static const struct dmi_system_id tqmx86_dmi_table[] __initconst = {
 		},
 		.callback = tqmx86_create_platform_device,
 	},
+	{
+		.ident = "TQMX86",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "TQ-Systems"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TQMx"),
+		},
+		.callback = tqmx86_create_platform_device,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(dmi, tqmx86_dmi_table);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (5 preceding siblings ...)
  2021-07-02 12:23 ` [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs Matthias Schiffer
@ 2021-07-02 12:23 ` Matthias Schiffer
  2021-07-02 14:04   ` Andrew Lunn
  2021-07-02 13:41 ` [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Andrew Lunn
  2021-07-16  9:20 ` Lee Jones
  8 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-02 12:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

All future TQMx86 modules should use a 24MHz LPC clock. Warn about
unknown boards, but assume this is the case.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2:
- Separated from TQMxE40M support patch
- Add warning for unknown boards


 drivers/mfd/tqmx86.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 58f35c8b5a45..7ae906ff8e35 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -147,7 +147,7 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
 	}
 }
 
-static int tqmx86_board_id_to_clk_rate(u8 board_id)
+static int tqmx86_board_id_to_clk_rate(struct device *dev, u8 board_id)
 {
 	switch (board_id) {
 	case TQMX86_REG_BOARD_ID_50UC:
@@ -168,7 +168,9 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
 	case TQMX86_REG_BOARD_ID_E38C:
 		return 33000;
 	default:
-		return 0;
+		dev_warn(dev, "unknown board %d, assuming 24MHz LPC clock\n",
+			 board_id);
+		return 24000;
 	}
 }
 
@@ -229,7 +231,7 @@ static int tqmx86_probe(struct platform_device *pdev)
 		tqmx_gpio_resources[0].flags = 0;
 	}
 
-	ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
+	ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(dev, board_id);
 
 	if (i2c_det == TQMX86_REG_I2C_DETECT_SOFT) {
 		err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (6 preceding siblings ...)
  2021-07-02 12:23 ` [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards Matthias Schiffer
@ 2021-07-02 13:41 ` Andrew Lunn
  2021-07-05  7:13   ` Matthias Schiffer
  2021-07-16  9:20 ` Lee Jones
  8 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 13:41 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:46PM +0200, Matthias Schiffer wrote:
> Updated patch series:
> 
> - A number of new patches (more hardware support and a few fixes)
> - Patches 1-3 have gained Fixes tags
> - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
>   MFD tree to keep them together?
> - The change in patch 7 was somewhat controversial. I've added a
>   warning, but it is the last patch of the series, so it doesn't affect
>   the rest of the series if it is rejected.

Hi Matthias

Nice to see the vendor involved. That does not happen enough.

Please split these into fixes and new features. They go into different
trees, so splitting them makes it easier for the maintainers.

I would also suggest splitting the patches per subsystem, and send
them to the specific subsystem maintainer. The exception would be when
there is cross subsystem dependencies.

     Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional
  2021-07-02 12:23 ` [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
@ 2021-07-02 13:45   ` Andrew Lunn
  2021-07-02 14:14     ` Andy Shevchenko
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 13:45 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:47PM +0200, Matthias Schiffer wrote:
> The tqmx86 MFD driver was passing IRQ 0 for "no IRQ" in the past. This
> causes warnings with newer kernels.
> 
> Prepare the gpio-tqmx86 driver for the fixed MFD driver by handling a
> missing IRQ properly.
> 
> Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

The system i was using this on made use of interrupts, so i never
tested with it missing.

It is a shame platform_get_irq_optional() does something different to
all the other _optional() calls :-(

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  2021-07-02 12:23 ` [PATCH v2 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
@ 2021-07-02 13:52   ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 13:52 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:48PM +0200, Matthias Schiffer wrote:
> The driver was registering IRQ 0 when no IRQ was set. This leads to
> warnings with newer kernels.
> 
> Clear the resource flags, so no resource is registered at all in this
> case.
> 
> Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> 
> v2: add Fixes line
> 
> Andy recommended to use IORESOURCE_DISABLED instead, but this doesn't
> have any effect for platform_get_irq(), so I'm resubmitting this patch
> without functional changes. Grepping for '\.flags = 0;' shows other
> drivers doing the same.

IORESOURCE_DISABLED seems to have an odd meaning. It seems to be about
ACPI and the resource needs to be enabled before it can be used.

So .flags = 0 seems reasonable.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID
  2021-07-02 12:23 ` [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
@ 2021-07-02 13:56   ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 13:56 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:49PM +0200, Matthias Schiffer wrote:
> No TQMx90UC exists at the moment, and it is undecided whether ID 10 will
> be used eventually (and if it is, how that SoM will be named).

This was in the vendor code i was given. I just blindly kept it, since
i don't know anything except about the one system i had.

> Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")

I'm not sure this meets the stable requirements:

https://www.kernel.org/doc/html/v4.10/process/stable-kernel-rules.html

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform"
  2021-07-02 12:23 ` [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
@ 2021-07-02 14:00   ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 14:00 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:50PM +0200, Matthias Schiffer wrote:
> Rename variable from "ocores_platfom_data" to "ocores_platform_data".
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> 
> v2: new patch
> 
>  drivers/mfd/tqmx86.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
> index 9b65dbedc1bb..ff1bdb742e3f 100644
> --- a/drivers/mfd/tqmx86.c
> +++ b/drivers/mfd/tqmx86.c
> @@ -76,7 +76,7 @@ static struct i2c_board_info tqmx86_i2c_devices[] = {
>  	},
>  };
>  
> -static struct ocores_i2c_platform_data ocores_platfom_data = {
> +static struct ocores_i2c_platform_data ocores_platform_data = {

Ah. Missed that in the vendor code :-(

FYI: I used tqmx86-drivers_1.3. If you have any fixes in later
versions, you might want to submit patches.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x
  2021-07-02 12:23 ` [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x Matthias Schiffer
@ 2021-07-02 14:01   ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 14:01 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:51PM +0200, Matthias Schiffer wrote:
> Add the board IDs for the TQMx110EB and the TQMxE40x family. All use a
> 24MHz LPC clock.
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs
  2021-07-02 12:23 ` [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs Matthias Schiffer
@ 2021-07-02 14:01   ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 14:01 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:52PM +0200, Matthias Schiffer wrote:
> Newer TQMx86 modules use TQ-Systems instead of TQ-Group as their vendor
> ID.
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards
  2021-07-02 12:23 ` [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards Matthias Schiffer
@ 2021-07-02 14:04   ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2021-07-02 14:04 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, Jul 02, 2021 at 02:23:53PM +0200, Matthias Schiffer wrote:
> All future TQMx86 modules should use a 24MHz LPC clock. Warn about
> unknown boards, but assume this is the case.
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional
  2021-07-02 13:45   ` Andrew Lunn
@ 2021-07-02 14:14     ` Andy Shevchenko
  0 siblings, 0 replies; 21+ messages in thread
From: Andy Shevchenko @ 2021-07-02 14:14 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Matthias Schiffer, Linus Walleij, Bartosz Golaszewski, Lee Jones,
	open list:GPIO SUBSYSTEM, Linux Kernel Mailing List

On Fri, Jul 2, 2021 at 4:45 PM Andrew Lunn <andrew@lunn.ch> wrote:
> On Fri, Jul 02, 2021 at 02:23:47PM +0200, Matthias Schiffer wrote:
> > The tqmx86 MFD driver was passing IRQ 0 for "no IRQ" in the past. This
> > causes warnings with newer kernels.
> >
> > Prepare the gpio-tqmx86 driver for the fixed MFD driver by handling a
> > missing IRQ properly.

...

> It is a shame platform_get_irq_optional() does something different to
> all the other _optional() calls :-(

Exactly my point when I proposed the change to it!

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
  2021-07-02 13:41 ` [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Andrew Lunn
@ 2021-07-05  7:13   ` Matthias Schiffer
  0 siblings, 0 replies; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-05  7:13 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Linus Walleij, Bartosz Golaszewski, Lee Jones, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 2021-07-02 at 15:41 +0200, Andrew Lunn wrote:
> On Fri, Jul 02, 2021 at 02:23:46PM +0200, Matthias Schiffer wrote:
> > Updated patch series:
> > 
> > - A number of new patches (more hardware support and a few fixes)
> > - Patches 1-3 have gained Fixes tags
> > - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> >   MFD tree to keep them together?
> > - The change in patch 7 was somewhat controversial. I've added a
> >   warning, but it is the last patch of the series, so it doesn't affect
> >   the rest of the series if it is rejected.
> 
> Hi Matthias
> 
> Nice to see the vendor involved. That does not happen enough.
> 
> Please split these into fixes and new features. They go into different
> trees, so splitting them makes it easier for the maintainers.
> 
> I would also suggest splitting the patches per subsystem, and send
> them to the specific subsystem maintainer. The exception would be when
> there is cross subsystem dependencies.
> 
>      Andrew

Hi Andrew,

thanks for the quick review.

As mentioned in the cover letter, patch 2 depends on 1, so I think it
would make sense to push all through the MFD tree, including the GPIO
fix.

I guess patches 5 and 6 would be covered by the "new device IDs and
quirks" rule of the stable kernel rules. Does that mean they should
also go through the "fixes" rather than the "next" branch, making 4 and
7 the only ones for "next"?

Should I add "Cc: stable@vger.kernel.org" to all patches for the
"fixes" tree?

Kind regards,
Matthias


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
  2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (7 preceding siblings ...)
  2021-07-02 13:41 ` [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Andrew Lunn
@ 2021-07-16  9:20 ` Lee Jones
  2021-07-16  9:23   ` Matthias Schiffer
  8 siblings, 1 reply; 21+ messages in thread
From: Lee Jones @ 2021-07-16  9:20 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 02 Jul 2021, Matthias Schiffer wrote:

> Updated patch series:
> 
> - A number of new patches (more hardware support and a few fixes)
> - Patches 1-3 have gained Fixes tags
> - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
>   MFD tree to keep them together?
> - The change in patch 7 was somewhat controversial. I've added a
>   warning, but it is the last patch of the series, so it doesn't affect
>   the rest of the series if it is rejected.
> 
> 
> Matthias Schiffer (7):
>   gpio: tqmx86: really make IRQ optional
>   mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
>   mfd: tqmx86: remove incorrect TQMx90UC board ID
>   mfd: tqmx86: fix typo in "platform"
>   mfd: tqmx86: add support for TQMx110EB and TQMxE40x
>   mfd: tqmx86: add support for TQ-Systems DMI IDs
>   mfd: tqmx86: assume 24MHz LPC clock for unknown boards
> 
>  drivers/gpio/gpio-tqmx86.c |  6 ++---
>  drivers/mfd/tqmx86.c       | 48 ++++++++++++++++++++++++++++++--------
>  2 files changed, 41 insertions(+), 13 deletions(-)

Patches look good.

Could you please collect up Andrew's acks, remove the suggested Fixes:
lines and resubmit please?

I'll quickly apply them once resent (probably Monday - if you get them
out today).

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
  2021-07-16  9:20 ` Lee Jones
@ 2021-07-16  9:23   ` Matthias Schiffer
  2021-07-16  9:42     ` Lee Jones
  0 siblings, 1 reply; 21+ messages in thread
From: Matthias Schiffer @ 2021-07-16  9:23 UTC (permalink / raw)
  To: Lee Jones
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 2021-07-16 at 10:20 +0100, Lee Jones wrote:
> On Fri, 02 Jul 2021, Matthias Schiffer wrote:
> 
> > Updated patch series:
> > 
> > - A number of new patches (more hardware support and a few fixes)
> > - Patches 1-3 have gained Fixes tags
> > - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> >   MFD tree to keep them together?
> > - The change in patch 7 was somewhat controversial. I've added a
> >   warning, but it is the last patch of the series, so it doesn't affect
> >   the rest of the series if it is rejected.
> > 
> > 
> > Matthias Schiffer (7):
> >   gpio: tqmx86: really make IRQ optional
> >   mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
> >   mfd: tqmx86: remove incorrect TQMx90UC board ID
> >   mfd: tqmx86: fix typo in "platform"
> >   mfd: tqmx86: add support for TQMx110EB and TQMxE40x
> >   mfd: tqmx86: add support for TQ-Systems DMI IDs
> >   mfd: tqmx86: assume 24MHz LPC clock for unknown boards
> > 
> >  drivers/gpio/gpio-tqmx86.c |  6 ++---
> >  drivers/mfd/tqmx86.c       | 48 ++++++++++++++++++++++++++++++--------
> >  2 files changed, 41 insertions(+), 13 deletions(-)
> 
> Patches look good.
> 
> Could you please collect up Andrew's acks, remove the suggested Fixes:
> lines and resubmit please?

Are you referring to the Fixes: line in "[PATCH v2 3/7] mfd: tqmx86:
remove incorrect TQMx90UC board ID"?

> 
> I'll quickly apply them once resent (probably Monday - if you get them
> out today).
> 

Thanks, I'll try to get it done today.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
  2021-07-16  9:23   ` Matthias Schiffer
@ 2021-07-16  9:42     ` Lee Jones
  0 siblings, 0 replies; 21+ messages in thread
From: Lee Jones @ 2021-07-16  9:42 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 16 Jul 2021, Matthias Schiffer wrote:

> On Fri, 2021-07-16 at 10:20 +0100, Lee Jones wrote:
> > On Fri, 02 Jul 2021, Matthias Schiffer wrote:
> > 
> > > Updated patch series:
> > > 
> > > - A number of new patches (more hardware support and a few fixes)
> > > - Patches 1-3 have gained Fixes tags
> > > - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
> > >   MFD tree to keep them together?
> > > - The change in patch 7 was somewhat controversial. I've added a
> > >   warning, but it is the last patch of the series, so it doesn't affect
> > >   the rest of the series if it is rejected.
> > > 
> > > 
> > > Matthias Schiffer (7):
> > >   gpio: tqmx86: really make IRQ optional
> > >   mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
> > >   mfd: tqmx86: remove incorrect TQMx90UC board ID
> > >   mfd: tqmx86: fix typo in "platform"
> > >   mfd: tqmx86: add support for TQMx110EB and TQMxE40x
> > >   mfd: tqmx86: add support for TQ-Systems DMI IDs
> > >   mfd: tqmx86: assume 24MHz LPC clock for unknown boards
> > > 
> > >  drivers/gpio/gpio-tqmx86.c |  6 ++---
> > >  drivers/mfd/tqmx86.c       | 48 ++++++++++++++++++++++++++++++--------
> > >  2 files changed, 41 insertions(+), 13 deletions(-)
> > 
> > Patches look good.
> > 
> > Could you please collect up Andrew's acks, remove the suggested Fixes:
> > lines and resubmit please?
> 
> Are you referring to the Fixes: line in "[PATCH v2 3/7] mfd: tqmx86:
> remove incorrect TQMx90UC board ID"?

I'm referring to the lines that Andrew said did not qualify.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-07-16  9:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 12:23 [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
2021-07-02 12:23 ` [PATCH v2 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
2021-07-02 13:45   ` Andrew Lunn
2021-07-02 14:14     ` Andy Shevchenko
2021-07-02 12:23 ` [PATCH v2 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
2021-07-02 13:52   ` Andrew Lunn
2021-07-02 12:23 ` [PATCH v2 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
2021-07-02 13:56   ` Andrew Lunn
2021-07-02 12:23 ` [PATCH v2 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
2021-07-02 14:00   ` Andrew Lunn
2021-07-02 12:23 ` [PATCH v2 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x Matthias Schiffer
2021-07-02 14:01   ` Andrew Lunn
2021-07-02 12:23 ` [PATCH v2 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs Matthias Schiffer
2021-07-02 14:01   ` Andrew Lunn
2021-07-02 12:23 ` [PATCH v2 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards Matthias Schiffer
2021-07-02 14:04   ` Andrew Lunn
2021-07-02 13:41 ` [PATCH v2 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Andrew Lunn
2021-07-05  7:13   ` Matthias Schiffer
2021-07-16  9:20 ` Lee Jones
2021-07-16  9:23   ` Matthias Schiffer
2021-07-16  9:42     ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).