All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] i2c: imx: DMA related fixes
@ 2018-10-18 11:26 ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: Wolfram Sang, Shawn Guo, Sascha Hauer
  Cc: Oleksij Rempel, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, linux-arm-kernel, NXP Linux Team

Current i2c-imx module prints DMA warnings which in many cases are
false positive and just confuse testers:
1. DMA is not available on chips before i.MX50
2. DMA for i2c is muxed with some other peripheral, and can be used only
for one of devices at same time. So, obvious choice it to use it with
SDHC instead of i2c.

Oleksij Rempel (3):
  ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
  i2c: imx: probe dma only only on i.MX50 and later.
  i2c: imx: don't print error if DMA is not configured

 arch/arm/boot/dts/imx6sll.dtsi |  2 +-
 drivers/i2c/busses/i2c-imx.c   | 89 +++++++++++++++++++++++++++-------
 2 files changed, 73 insertions(+), 18 deletions(-)

-- 
2.19.0

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

* [PATCH v1 0/3] i2c: imx: DMA related fixes
@ 2018-10-18 11:26 ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

Current i2c-imx module prints DMA warnings which in many cases are
false positive and just confuse testers:
1. DMA is not available on chips before i.MX50
2. DMA for i2c is muxed with some other peripheral, and can be used only
for one of devices at same time. So, obvious choice it to use it with
SDHC instead of i2c.

Oleksij Rempel (3):
  ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
  i2c: imx: probe dma only only on i.MX50 and later.
  i2c: imx: don't print error if DMA is not configured

 arch/arm/boot/dts/imx6sll.dtsi |  2 +-
 drivers/i2c/busses/i2c-imx.c   | 89 +++++++++++++++++++++++++++-------
 2 files changed, 73 insertions(+), 18 deletions(-)

-- 
2.19.0

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

* [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
  2018-10-18 11:26 ` Oleksij Rempel
@ 2018-10-18 11:26   ` Oleksij Rempel
  -1 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: Wolfram Sang, Shawn Guo, Sascha Hauer
  Cc: Oleksij Rempel, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, linux-arm-kernel, NXP Linux Team

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boot/dts/imx6sll.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
index 000e6136a9d6..3e6ffaf5f104 100644
--- a/arch/arm/boot/dts/imx6sll.dtsi
+++ b/arch/arm/boot/dts/imx6sll.dtsi
@@ -709,7 +709,7 @@
 			i2c1: i2c@21a0000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				compatible = "fs,imx6sll-i2c", "fsl,imx21-i2c";
+				compatible = "fsl,imx6sll-i2c", "fsl,imx21-i2c";
 				reg = <0x021a0000 0x4000>;
 				interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX6SLL_CLK_I2C1>;
-- 
2.19.0

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

* [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
@ 2018-10-18 11:26   ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boot/dts/imx6sll.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
index 000e6136a9d6..3e6ffaf5f104 100644
--- a/arch/arm/boot/dts/imx6sll.dtsi
+++ b/arch/arm/boot/dts/imx6sll.dtsi
@@ -709,7 +709,7 @@
 			i2c1: i2c at 21a0000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				compatible = "fs,imx6sll-i2c", "fsl,imx21-i2c";
+				compatible = "fsl,imx6sll-i2c", "fsl,imx21-i2c";
 				reg = <0x021a0000 0x4000>;
 				interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX6SLL_CLK_I2C1>;
-- 
2.19.0

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

* [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
  2018-10-18 11:26 ` Oleksij Rempel
@ 2018-10-18 11:26   ` Oleksij Rempel
  -1 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: Wolfram Sang, Shawn Guo, Sascha Hauer
  Cc: Oleksij Rempel, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, linux-arm-kernel, NXP Linux Team

The DMA support for I2C was introduced on i.MX50. So,
avoid of DMA probing on not supported versions.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/i2c/busses/i2c-imx.c | 53 ++++++++++++++++++++++++++++++++++--
 1 file changed, 51 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index c406700789e1..df013b1b6fa4 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -169,6 +169,7 @@ struct imx_i2c_hwdata {
 	unsigned		ndivs;
 	unsigned		i2sr_clr_opcode;
 	unsigned		i2cr_ien_opcode;
+	bool			has_dmamode;
 };
 
 struct imx_i2c_dma {
@@ -211,7 +212,7 @@ static const struct imx_i2c_hwdata imx1_i2c_hwdata = {
 	.ndivs			= ARRAY_SIZE(imx_i2c_clk_div),
 	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W0C,
 	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_1,
-
+	.has_dmamode		= false,
 };
 
 static const struct imx_i2c_hwdata imx21_i2c_hwdata = {
@@ -221,7 +222,17 @@ static const struct imx_i2c_hwdata imx21_i2c_hwdata = {
 	.ndivs			= ARRAY_SIZE(imx_i2c_clk_div),
 	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W0C,
 	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_1,
+	.has_dmamode		= false,
+};
 
+static const struct imx_i2c_hwdata imx50_i2c_hwdata = {
+	.devtype		= IMX21_I2C,
+	.regshift		= IMX_I2C_REGSHIFT,
+	.clk_div		= imx_i2c_clk_div,
+	.ndivs			= ARRAY_SIZE(imx_i2c_clk_div),
+	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W0C,
+	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_1,
+	.has_dmamode		= true,
 };
 
 static struct imx_i2c_hwdata vf610_i2c_hwdata = {
@@ -231,7 +242,7 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = {
 	.ndivs			= ARRAY_SIZE(vf610_i2c_clk_div),
 	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W1C,
 	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_0,
-
+	.has_dmamode		= true,
 };
 
 static const struct platform_device_id imx_i2c_devtype[] = {
@@ -241,6 +252,33 @@ static const struct platform_device_id imx_i2c_devtype[] = {
 	}, {
 		.name = "imx21-i2c",
 		.driver_data = (kernel_ulong_t)&imx21_i2c_hwdata,
+	}, {
+		.name = "imx50-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx51-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx53-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6q-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6sl-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6sll-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6sx-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6ul-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx7d-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
 	}, {
 		/* sentinel */
 	}
@@ -250,6 +288,14 @@ MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
 static const struct of_device_id i2c_imx_dt_ids[] = {
 	{ .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, },
 	{ .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, },
+	{ .compatible = "fsl,imx50-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx51-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx53-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6q-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6sl-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6sll-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6sx-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6ul-i2c", .data = &imx50_i2c_hwdata, },
 	{ .compatible = "fsl,vf610-i2c", .data = &vf610_i2c_hwdata, },
 	{ /* sentinel */ }
 };
@@ -281,6 +327,9 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	struct device *dev = &i2c_imx->adapter.dev;
 	int ret;
 
+	if (!i2c_imx->hwdata->has_dmamode)
+		return;
+
 	dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL);
 	if (!dma)
 		return;
-- 
2.19.0

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

* [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
@ 2018-10-18 11:26   ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

The DMA support for I2C was introduced on i.MX50. So,
avoid of DMA probing on not supported versions.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/i2c/busses/i2c-imx.c | 53 ++++++++++++++++++++++++++++++++++--
 1 file changed, 51 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index c406700789e1..df013b1b6fa4 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -169,6 +169,7 @@ struct imx_i2c_hwdata {
 	unsigned		ndivs;
 	unsigned		i2sr_clr_opcode;
 	unsigned		i2cr_ien_opcode;
+	bool			has_dmamode;
 };
 
 struct imx_i2c_dma {
@@ -211,7 +212,7 @@ static const struct imx_i2c_hwdata imx1_i2c_hwdata = {
 	.ndivs			= ARRAY_SIZE(imx_i2c_clk_div),
 	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W0C,
 	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_1,
-
+	.has_dmamode		= false,
 };
 
 static const struct imx_i2c_hwdata imx21_i2c_hwdata = {
@@ -221,7 +222,17 @@ static const struct imx_i2c_hwdata imx21_i2c_hwdata = {
 	.ndivs			= ARRAY_SIZE(imx_i2c_clk_div),
 	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W0C,
 	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_1,
+	.has_dmamode		= false,
+};
 
+static const struct imx_i2c_hwdata imx50_i2c_hwdata = {
+	.devtype		= IMX21_I2C,
+	.regshift		= IMX_I2C_REGSHIFT,
+	.clk_div		= imx_i2c_clk_div,
+	.ndivs			= ARRAY_SIZE(imx_i2c_clk_div),
+	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W0C,
+	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_1,
+	.has_dmamode		= true,
 };
 
 static struct imx_i2c_hwdata vf610_i2c_hwdata = {
@@ -231,7 +242,7 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = {
 	.ndivs			= ARRAY_SIZE(vf610_i2c_clk_div),
 	.i2sr_clr_opcode	= I2SR_CLR_OPCODE_W1C,
 	.i2cr_ien_opcode	= I2CR_IEN_OPCODE_0,
-
+	.has_dmamode		= true,
 };
 
 static const struct platform_device_id imx_i2c_devtype[] = {
@@ -241,6 +252,33 @@ static const struct platform_device_id imx_i2c_devtype[] = {
 	}, {
 		.name = "imx21-i2c",
 		.driver_data = (kernel_ulong_t)&imx21_i2c_hwdata,
+	}, {
+		.name = "imx50-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx51-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx53-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6q-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6sl-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6sll-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6sx-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx6ul-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
+	}, {
+		.name = "imx7d-i2c",
+		.driver_data = (kernel_ulong_t)&imx50_i2c_hwdata,
 	}, {
 		/* sentinel */
 	}
@@ -250,6 +288,14 @@ MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
 static const struct of_device_id i2c_imx_dt_ids[] = {
 	{ .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, },
 	{ .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, },
+	{ .compatible = "fsl,imx50-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx51-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx53-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6q-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6sl-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6sll-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6sx-i2c", .data = &imx50_i2c_hwdata, },
+	{ .compatible = "fsl,imx6ul-i2c", .data = &imx50_i2c_hwdata, },
 	{ .compatible = "fsl,vf610-i2c", .data = &vf610_i2c_hwdata, },
 	{ /* sentinel */ }
 };
@@ -281,6 +327,9 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	struct device *dev = &i2c_imx->adapter.dev;
 	int ret;
 
+	if (!i2c_imx->hwdata->has_dmamode)
+		return;
+
 	dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL);
 	if (!dma)
 		return;
-- 
2.19.0

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

* [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
  2018-10-18 11:26 ` Oleksij Rempel
@ 2018-10-18 11:26   ` Oleksij Rempel
  -1 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: Wolfram Sang, Shawn Guo, Sascha Hauer
  Cc: Oleksij Rempel, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, linux-arm-kernel, NXP Linux Team

At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
it is project specific configuration and not an error.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/i2c/busses/i2c-imx.c | 38 +++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index df013b1b6fa4..bd362fe07257 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -319,7 +319,7 @@ static inline unsigned char imx_i2c_read_reg(struct imx_i2c_struct *i2c_imx,
 }
 
 /* Functions for DMA support */
-static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
+static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 						dma_addr_t phy_addr)
 {
 	struct imx_i2c_dma *dma;
@@ -328,15 +328,17 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	int ret;
 
 	if (!i2c_imx->hwdata->has_dmamode)
-		return;
+		return 0;
 
 	dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL);
 	if (!dma)
-		return;
+		return -ENOMEM;
 
-	dma->chan_tx = dma_request_slave_channel(dev, "tx");
-	if (!dma->chan_tx) {
-		dev_dbg(dev, "can't request DMA tx channel\n");
+	dma->chan_tx = dma_request_chan(dev, "tx");
+	if (IS_ERR(dma->chan_tx)) {
+		ret = PTR_ERR(dma->chan_rx);
+		if (ret != -ENODEV && ret != -EPROBE_DEFER)
+			dev_err(dev, "can't request DMA tx channel (%d)\n", ret);
 		goto fail_al;
 	}
 
@@ -347,13 +349,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	dma_sconfig.direction = DMA_MEM_TO_DEV;
 	ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig);
 	if (ret < 0) {
-		dev_dbg(dev, "can't configure tx channel\n");
+		dev_err(dev, "can't configure tx channel (%d)\n", ret);
 		goto fail_tx;
 	}
 
-	dma->chan_rx = dma_request_slave_channel(dev, "rx");
-	if (!dma->chan_rx) {
-		dev_dbg(dev, "can't request DMA rx channel\n");
+	dma->chan_rx = dma_request_chan(dev, "rx");
+	if (IS_ERR(dma->chan_rx)) {
+		ret = PTR_ERR(dma->chan_rx);
+		if (ret != -ENODEV && ret != -EPROBE_DEFER)
+			dev_err(dev, "can't request DMA rx channel (%d)\n", ret);
 		goto fail_tx;
 	}
 
@@ -364,7 +368,7 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	dma_sconfig.direction = DMA_DEV_TO_MEM;
 	ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig);
 	if (ret < 0) {
-		dev_dbg(dev, "can't configure rx channel\n");
+		dev_err(dev, "can't configure rx channel (%d)\n", ret);
 		goto fail_rx;
 	}
 
@@ -373,15 +377,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	dev_info(dev, "using %s (tx) and %s (rx) for DMA transfers\n",
 		dma_chan_name(dma->chan_tx), dma_chan_name(dma->chan_rx));
 
-	return;
+	return 0;
 
 fail_rx:
 	dma_release_channel(dma->chan_rx);
 fail_tx:
 	dma_release_channel(dma->chan_tx);
 fail_al:
-	devm_kfree(dev, dma);
-	dev_info(dev, "can't use DMA, using PIO instead.\n");
+	/* return successfully if there is no dma support */
+	return ret == -ENODEV ? 0 : ret;
 }
 
 static void i2c_imx_dma_callback(void *arg)
@@ -1208,11 +1212,13 @@ static int i2c_imx_probe(struct platform_device *pdev)
 	dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res);
 	dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n",
 		i2c_imx->adapter.name);
-	dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
 
 	/* Init DMA config if supported */
-	i2c_imx_dma_request(i2c_imx, phy_addr);
+	ret = i2c_imx_dma_request(i2c_imx, phy_addr);
+	if (ret < 0)
+		goto clk_notifier_unregister;
 
+	dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
 	return 0;   /* Return OK */
 
 clk_notifier_unregister:
-- 
2.19.0

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

* [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
@ 2018-10-18 11:26   ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-18 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
it is project specific configuration and not an error.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/i2c/busses/i2c-imx.c | 38 +++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index df013b1b6fa4..bd362fe07257 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -319,7 +319,7 @@ static inline unsigned char imx_i2c_read_reg(struct imx_i2c_struct *i2c_imx,
 }
 
 /* Functions for DMA support */
-static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
+static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 						dma_addr_t phy_addr)
 {
 	struct imx_i2c_dma *dma;
@@ -328,15 +328,17 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	int ret;
 
 	if (!i2c_imx->hwdata->has_dmamode)
-		return;
+		return 0;
 
 	dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL);
 	if (!dma)
-		return;
+		return -ENOMEM;
 
-	dma->chan_tx = dma_request_slave_channel(dev, "tx");
-	if (!dma->chan_tx) {
-		dev_dbg(dev, "can't request DMA tx channel\n");
+	dma->chan_tx = dma_request_chan(dev, "tx");
+	if (IS_ERR(dma->chan_tx)) {
+		ret = PTR_ERR(dma->chan_rx);
+		if (ret != -ENODEV && ret != -EPROBE_DEFER)
+			dev_err(dev, "can't request DMA tx channel (%d)\n", ret);
 		goto fail_al;
 	}
 
@@ -347,13 +349,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	dma_sconfig.direction = DMA_MEM_TO_DEV;
 	ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig);
 	if (ret < 0) {
-		dev_dbg(dev, "can't configure tx channel\n");
+		dev_err(dev, "can't configure tx channel (%d)\n", ret);
 		goto fail_tx;
 	}
 
-	dma->chan_rx = dma_request_slave_channel(dev, "rx");
-	if (!dma->chan_rx) {
-		dev_dbg(dev, "can't request DMA rx channel\n");
+	dma->chan_rx = dma_request_chan(dev, "rx");
+	if (IS_ERR(dma->chan_rx)) {
+		ret = PTR_ERR(dma->chan_rx);
+		if (ret != -ENODEV && ret != -EPROBE_DEFER)
+			dev_err(dev, "can't request DMA rx channel (%d)\n", ret);
 		goto fail_tx;
 	}
 
@@ -364,7 +368,7 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	dma_sconfig.direction = DMA_DEV_TO_MEM;
 	ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig);
 	if (ret < 0) {
-		dev_dbg(dev, "can't configure rx channel\n");
+		dev_err(dev, "can't configure rx channel (%d)\n", ret);
 		goto fail_rx;
 	}
 
@@ -373,15 +377,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 	dev_info(dev, "using %s (tx) and %s (rx) for DMA transfers\n",
 		dma_chan_name(dma->chan_tx), dma_chan_name(dma->chan_rx));
 
-	return;
+	return 0;
 
 fail_rx:
 	dma_release_channel(dma->chan_rx);
 fail_tx:
 	dma_release_channel(dma->chan_tx);
 fail_al:
-	devm_kfree(dev, dma);
-	dev_info(dev, "can't use DMA, using PIO instead.\n");
+	/* return successfully if there is no dma support */
+	return ret == -ENODEV ? 0 : ret;
 }
 
 static void i2c_imx_dma_callback(void *arg)
@@ -1208,11 +1212,13 @@ static int i2c_imx_probe(struct platform_device *pdev)
 	dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res);
 	dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n",
 		i2c_imx->adapter.name);
-	dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
 
 	/* Init DMA config if supported */
-	i2c_imx_dma_request(i2c_imx, phy_addr);
+	ret = i2c_imx_dma_request(i2c_imx, phy_addr);
+	if (ret < 0)
+		goto clk_notifier_unregister;
 
+	dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
 	return 0;   /* Return OK */
 
 clk_notifier_unregister:
-- 
2.19.0

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

* Re: [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
  2018-10-18 11:26   ` Oleksij Rempel
@ 2018-10-18 18:43     ` Uwe Kleine-König
  -1 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-10-18 18:43 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Wolfram Sang, Sascha Hauer, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo, linux-arm-kernel, NXP Linux Team

On Thu, Oct 18, 2018 at 01:26:13PM +0200, Oleksij Rempel wrote:
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  arch/arm/boot/dts/imx6sll.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
> index 000e6136a9d6..3e6ffaf5f104 100644
> --- a/arch/arm/boot/dts/imx6sll.dtsi
> +++ b/arch/arm/boot/dts/imx6sll.dtsi
> @@ -709,7 +709,7 @@
>  			i2c1: i2c@21a0000 {
>  				#address-cells = <1>;
>  				#size-cells = <0>;
> -				compatible = "fs,imx6sll-i2c", "fsl,imx21-i2c";
> +				compatible = "fsl,imx6sll-i2c", "fsl,imx21-i2c";

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
@ 2018-10-18 18:43     ` Uwe Kleine-König
  0 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-10-18 18:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 18, 2018 at 01:26:13PM +0200, Oleksij Rempel wrote:
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  arch/arm/boot/dts/imx6sll.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
> index 000e6136a9d6..3e6ffaf5f104 100644
> --- a/arch/arm/boot/dts/imx6sll.dtsi
> +++ b/arch/arm/boot/dts/imx6sll.dtsi
> @@ -709,7 +709,7 @@
>  			i2c1: i2c at 21a0000 {
>  				#address-cells = <1>;
>  				#size-cells = <0>;
> -				compatible = "fs,imx6sll-i2c", "fsl,imx21-i2c";
> +				compatible = "fsl,imx6sll-i2c", "fsl,imx21-i2c";

Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
  2018-10-18 11:26   ` Oleksij Rempel
@ 2018-10-19  7:12     ` Uwe Kleine-König
  -1 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-10-19  7:12 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Wolfram Sang, Sascha Hauer, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo, linux-arm-kernel, NXP Linux Team

Hello Oleksij,

On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> The DMA support for I2C was introduced on i.MX50. So,
> avoid of DMA probing on not supported versions.

What is the obvious downside of trying to use DMA on i.MX21? If the
purpose is just to suppress the message

	can't request DMA tx channel

, that goes away with patch 3, too.

Note that if we agree that i.MX50 (and later) isn't compatible to
i.MX21, all device trees should be fixed accordingly. IMHO the
difference "There is a DMA engine connected only on some
implementations" doesn't give enough incentive to claim that i.MX21 and
i.MX50 must not share the compatible.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
@ 2018-10-19  7:12     ` Uwe Kleine-König
  0 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-10-19  7:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Oleksij,

On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> The DMA support for I2C was introduced on i.MX50. So,
> avoid of DMA probing on not supported versions.

What is the obvious downside of trying to use DMA on i.MX21? If the
purpose is just to suppress the message

	can't request DMA tx channel

, that goes away with patch 3, too.

Note that if we agree that i.MX50 (and later) isn't compatible to
i.MX21, all device trees should be fixed accordingly. IMHO the
difference "There is a DMA engine connected only on some
implementations" doesn't give enough incentive to claim that i.MX21 and
i.MX50 must not share the compatible.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
  2018-10-19  7:12     ` Uwe Kleine-König
@ 2018-10-19  9:01       ` Oleksij Rempel
  -1 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-19  9:01 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Wolfram Sang, Sascha Hauer, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo, linux-arm-kernel, NXP Linux Team


[-- Attachment #1.1: Type: text/plain, Size: 1207 bytes --]

On Fri, Oct 19, 2018 at 09:12:43AM +0200, Uwe Kleine-König wrote:
> Hello Oleksij,
> 
> On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> > The DMA support for I2C was introduced on i.MX50. So,
> > avoid of DMA probing on not supported versions.
> 
> What is the obvious downside of trying to use DMA on i.MX21? If the
> purpose is just to suppress the message
> 
> 	can't request DMA tx channel
> 
> , that goes away with patch 3, too.
> 
> Note that if we agree that i.MX50 (and later) isn't compatible to
> i.MX21, all device trees should be fixed accordingly. IMHO the
> difference "There is a DMA engine connected only on some
> implementations" doesn't give enough incentive to claim that i.MX21 and
> i.MX50 must not share the compatible.

I don't see any sense to do allocation and add extra probes just to find
what we already know from compatible.

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
@ 2018-10-19  9:01       ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-19  9:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 19, 2018 at 09:12:43AM +0200, Uwe Kleine-K?nig wrote:
> Hello Oleksij,
> 
> On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> > The DMA support for I2C was introduced on i.MX50. So,
> > avoid of DMA probing on not supported versions.
> 
> What is the obvious downside of trying to use DMA on i.MX21? If the
> purpose is just to suppress the message
> 
> 	can't request DMA tx channel
> 
> , that goes away with patch 3, too.
> 
> Note that if we agree that i.MX50 (and later) isn't compatible to
> i.MX21, all device trees should be fixed accordingly. IMHO the
> difference "There is a DMA engine connected only on some
> implementations" doesn't give enough incentive to claim that i.MX21 and
> i.MX50 must not share the compatible.

I don't see any sense to do allocation and add extra probes just to find
what we already know from compatible.

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20181019/0d0f381a/attachment.sig>

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

* Re: [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
  2018-10-19  9:01       ` Oleksij Rempel
@ 2018-10-19  9:21         ` Uwe Kleine-König
  -1 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-10-19  9:21 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Wolfram Sang, Sascha Hauer, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo, linux-arm-kernel, NXP Linux Team

On Fri, Oct 19, 2018 at 11:01:00AM +0200, Oleksij Rempel wrote:
> On Fri, Oct 19, 2018 at 09:12:43AM +0200, Uwe Kleine-König wrote:
> > Hello Oleksij,
> > 
> > On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> > > The DMA support for I2C was introduced on i.MX50. So,
> > > avoid of DMA probing on not supported versions.
> > 
> > What is the obvious downside of trying to use DMA on i.MX21? If the
> > purpose is just to suppress the message
> > 
> > 	can't request DMA tx channel
> > 
> > , that goes away with patch 3, too.
> > 
> > Note that if we agree that i.MX50 (and later) isn't compatible to
> > i.MX21, all device trees should be fixed accordingly. IMHO the
> > difference "There is a DMA engine connected only on some
> > implementations" doesn't give enough incentive to claim that i.MX21 and
> > i.MX50 must not share the compatible.
> 
> I don't see any sense to do allocation and add extra probes just to find
> what we already know from compatible.

I think it's perfectly fine to only notice that there is no DMA support
when trying to set it up. It has slight runtime overhead, yes, but being
able to handle imx21 and imx50 in the same way is a nice advantage that
I don't want to throw away easily.

If you care about the allocation, you can do do the calls to
dma_request_chan first and assign to local variables before the
allocation of *dma.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
@ 2018-10-19  9:21         ` Uwe Kleine-König
  0 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-10-19  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 19, 2018 at 11:01:00AM +0200, Oleksij Rempel wrote:
> On Fri, Oct 19, 2018 at 09:12:43AM +0200, Uwe Kleine-K?nig wrote:
> > Hello Oleksij,
> > 
> > On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> > > The DMA support for I2C was introduced on i.MX50. So,
> > > avoid of DMA probing on not supported versions.
> > 
> > What is the obvious downside of trying to use DMA on i.MX21? If the
> > purpose is just to suppress the message
> > 
> > 	can't request DMA tx channel
> > 
> > , that goes away with patch 3, too.
> > 
> > Note that if we agree that i.MX50 (and later) isn't compatible to
> > i.MX21, all device trees should be fixed accordingly. IMHO the
> > difference "There is a DMA engine connected only on some
> > implementations" doesn't give enough incentive to claim that i.MX21 and
> > i.MX50 must not share the compatible.
> 
> I don't see any sense to do allocation and add extra probes just to find
> what we already know from compatible.

I think it's perfectly fine to only notice that there is no DMA support
when trying to set it up. It has slight runtime overhead, yes, but being
able to handle imx21 and imx50 in the same way is a nice advantage that
I don't want to throw away easily.

If you care about the allocation, you can do do the calls to
dma_request_chan first and assign to local variables before the
allocation of *dma.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
  2018-10-19  9:21         ` Uwe Kleine-König
@ 2018-10-19 10:17           ` Oleksij Rempel
  -1 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-19 10:17 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Wolfram Sang, Sascha Hauer, linux-i2c, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo, linux-arm-kernel, NXP Linux Team


[-- Attachment #1.1: Type: text/plain, Size: 1891 bytes --]

On Fri, Oct 19, 2018 at 11:21:45AM +0200, Uwe Kleine-König wrote:
> On Fri, Oct 19, 2018 at 11:01:00AM +0200, Oleksij Rempel wrote:
> > On Fri, Oct 19, 2018 at 09:12:43AM +0200, Uwe Kleine-König wrote:
> > > Hello Oleksij,
> > > 
> > > On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> > > > The DMA support for I2C was introduced on i.MX50. So,
> > > > avoid of DMA probing on not supported versions.
> > > 
> > > What is the obvious downside of trying to use DMA on i.MX21? If the
> > > purpose is just to suppress the message
> > > 
> > > 	can't request DMA tx channel
> > > 
> > > , that goes away with patch 3, too.
> > > 
> > > Note that if we agree that i.MX50 (and later) isn't compatible to
> > > i.MX21, all device trees should be fixed accordingly. IMHO the
> > > difference "There is a DMA engine connected only on some
> > > implementations" doesn't give enough incentive to claim that i.MX21 and
> > > i.MX50 must not share the compatible.
> > 
> > I don't see any sense to do allocation and add extra probes just to find
> > what we already know from compatible.
> 
> I think it's perfectly fine to only notice that there is no DMA support
> when trying to set it up. It has slight runtime overhead, yes, but being
> able to handle imx21 and imx50 in the same way is a nice advantage that
> I don't want to throw away easily.
> 
> If you care about the allocation, you can do do the calls to
> dma_request_chan first and assign to local variables before the
> allocation of *dma.

Ok, then we can drop this patch.

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later.
@ 2018-10-19 10:17           ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-19 10:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 19, 2018 at 11:21:45AM +0200, Uwe Kleine-K?nig wrote:
> On Fri, Oct 19, 2018 at 11:01:00AM +0200, Oleksij Rempel wrote:
> > On Fri, Oct 19, 2018 at 09:12:43AM +0200, Uwe Kleine-K?nig wrote:
> > > Hello Oleksij,
> > > 
> > > On Thu, Oct 18, 2018 at 01:26:14PM +0200, Oleksij Rempel wrote:
> > > > The DMA support for I2C was introduced on i.MX50. So,
> > > > avoid of DMA probing on not supported versions.
> > > 
> > > What is the obvious downside of trying to use DMA on i.MX21? If the
> > > purpose is just to suppress the message
> > > 
> > > 	can't request DMA tx channel
> > > 
> > > , that goes away with patch 3, too.
> > > 
> > > Note that if we agree that i.MX50 (and later) isn't compatible to
> > > i.MX21, all device trees should be fixed accordingly. IMHO the
> > > difference "There is a DMA engine connected only on some
> > > implementations" doesn't give enough incentive to claim that i.MX21 and
> > > i.MX50 must not share the compatible.
> > 
> > I don't see any sense to do allocation and add extra probes just to find
> > what we already know from compatible.
> 
> I think it's perfectly fine to only notice that there is no DMA support
> when trying to set it up. It has slight runtime overhead, yes, but being
> able to handle imx21 and imx50 in the same way is a nice advantage that
> I don't want to throw away easily.
> 
> If you care about the allocation, you can do do the calls to
> dma_request_chan first and assign to local variables before the
> allocation of *dma.

Ok, then we can drop this patch.

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20181019/37dc7490/attachment.sig>

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

* Re: [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
  2018-10-18 11:26   ` Oleksij Rempel
@ 2018-10-28 22:11     ` Wolfram Sang
  -1 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2018-10-28 22:11 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Sascha Hauer, linux-i2c, Pengutronix Kernel Team, Fabio Estevam,
	Shawn Guo, linux-arm-kernel, NXP Linux Team


[-- Attachment #1.1: Type: text/plain, Size: 490 bytes --]

On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
> At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
> it is project specific configuration and not an error.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

So, the first patch is not I2C realm, and the second is dropped. No
comment about the third one?

And is maybe someone from Pengutronix interested in maintaining this
driver? Uwe maybe? That would speed up things for it...


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
@ 2018-10-28 22:11     ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2018-10-28 22:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
> At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
> it is project specific configuration and not an error.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

So, the first patch is not I2C realm, and the second is dropped. No
comment about the third one?

And is maybe someone from Pengutronix interested in maintaining this
driver? Uwe maybe? That would speed up things for it...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20181028/88739af1/attachment.sig>

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

* Re: [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
  2018-10-28 22:11     ` Wolfram Sang
@ 2018-10-29  8:07       ` Oleksij Rempel
  -1 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-29  8:07 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Sascha Hauer, linux-i2c, Pengutronix Kernel Team, Fabio Estevam,
	Shawn Guo, linux-arm-kernel, NXP Linux Team



On 28.10.18 23:11, Wolfram Sang wrote:
> On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
>> At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
>> it is project specific configuration and not an error.
>>
>> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> 
> So, the first patch is not I2C realm, and the second is dropped. No
> comment about the third one?
> 
> And is maybe someone from Pengutronix interested in maintaining this
> driver? Uwe maybe? That would speed up things for it...

Should i resend it as single patch?

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

* [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
@ 2018-10-29  8:07       ` Oleksij Rempel
  0 siblings, 0 replies; 28+ messages in thread
From: Oleksij Rempel @ 2018-10-29  8:07 UTC (permalink / raw)
  To: linux-arm-kernel



On 28.10.18 23:11, Wolfram Sang wrote:
> On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
>> At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
>> it is project specific configuration and not an error.
>>
>> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> 
> So, the first patch is not I2C realm, and the second is dropped. No
> comment about the third one?
> 
> And is maybe someone from Pengutronix interested in maintaining this
> driver? Uwe maybe? That would speed up things for it...

Should i resend it as single patch?

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

* Re: [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
  2018-10-29  8:07       ` Oleksij Rempel
@ 2018-10-29  8:54         ` Wolfram Sang
  -1 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2018-10-29  8:54 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Sascha Hauer, linux-i2c, Pengutronix Kernel Team, Fabio Estevam,
	Shawn Guo, linux-arm-kernel, NXP Linux Team


[-- Attachment #1.1: Type: text/plain, Size: 723 bytes --]

On Mon, Oct 29, 2018 at 09:07:56AM +0100, Oleksij Rempel wrote:
> 
> 
> On 28.10.18 23:11, Wolfram Sang wrote:
> > On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
> > > At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
> > > it is project specific configuration and not an error.
> > > 
> > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > 
> > So, the first patch is not I2C realm, and the second is dropped. No
> > comment about the third one?
> > 
> > And is maybe someone from Pengutronix interested in maintaining this
> > driver? Uwe maybe? That would speed up things for it...
> 
> Should i resend it as single patch?

I am fine with an ack here.


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
@ 2018-10-29  8:54         ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2018-10-29  8:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 29, 2018 at 09:07:56AM +0100, Oleksij Rempel wrote:
> 
> 
> On 28.10.18 23:11, Wolfram Sang wrote:
> > On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
> > > At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
> > > it is project specific configuration and not an error.
> > > 
> > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > 
> > So, the first patch is not I2C realm, and the second is dropped. No
> > comment about the third one?
> > 
> > And is maybe someone from Pengutronix interested in maintaining this
> > driver? Uwe maybe? That would speed up things for it...
> 
> Should i resend it as single patch?

I am fine with an ack here.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20181029/4e44cb1b/attachment.sig>

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

* Re: [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
  2018-10-18 11:26   ` Oleksij Rempel
@ 2018-10-31  7:50     ` Shawn Guo
  -1 siblings, 0 replies; 28+ messages in thread
From: Shawn Guo @ 2018-10-31  7:50 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Wolfram Sang, Sascha Hauer, NXP Linux Team,
	Pengutronix Kernel Team, Fabio Estevam, linux-arm-kernel,
	linux-i2c

On Thu, Oct 18, 2018 at 01:26:13PM +0200, Oleksij Rempel wrote:
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Applied, thanks.

> ---
>  arch/arm/boot/dts/imx6sll.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
> index 000e6136a9d6..3e6ffaf5f104 100644
> --- a/arch/arm/boot/dts/imx6sll.dtsi
> +++ b/arch/arm/boot/dts/imx6sll.dtsi
> @@ -709,7 +709,7 @@
>  			i2c1: i2c@21a0000 {
>  				#address-cells = <1>;
>  				#size-cells = <0>;
> -				compatible = "fs,imx6sll-i2c", "fsl,imx21-i2c";
> +				compatible = "fsl,imx6sll-i2c", "fsl,imx21-i2c";
>  				reg = <0x021a0000 0x4000>;
>  				interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
>  				clocks = <&clks IMX6SLL_CLK_I2C1>;
> -- 
> 2.19.0
> 

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

* [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node
@ 2018-10-31  7:50     ` Shawn Guo
  0 siblings, 0 replies; 28+ messages in thread
From: Shawn Guo @ 2018-10-31  7:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 18, 2018 at 01:26:13PM +0200, Oleksij Rempel wrote:
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Applied, thanks.

> ---
>  arch/arm/boot/dts/imx6sll.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
> index 000e6136a9d6..3e6ffaf5f104 100644
> --- a/arch/arm/boot/dts/imx6sll.dtsi
> +++ b/arch/arm/boot/dts/imx6sll.dtsi
> @@ -709,7 +709,7 @@
>  			i2c1: i2c at 21a0000 {
>  				#address-cells = <1>;
>  				#size-cells = <0>;
> -				compatible = "fs,imx6sll-i2c", "fsl,imx21-i2c";
> +				compatible = "fsl,imx6sll-i2c", "fsl,imx21-i2c";
>  				reg = <0x021a0000 0x4000>;
>  				interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
>  				clocks = <&clks IMX6SLL_CLK_I2C1>;
> -- 
> 2.19.0
> 

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

* Re: [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
  2018-10-29  8:54         ` Wolfram Sang
@ 2018-11-03 20:59           ` Uwe Kleine-König
  -1 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-11-03 20:59 UTC (permalink / raw)
  To: Wolfram Sang, Oleksij Rempel
  Cc: Sascha Hauer, linux-i2c, Pengutronix Kernel Team, Fabio Estevam,
	Shawn Guo, linux-arm-kernel, NXP Linux Team

Hello Wolfram, hello Oleksij,

On Mon, Oct 29, 2018 at 08:54:08AM +0000, Wolfram Sang wrote:
> On Mon, Oct 29, 2018 at 09:07:56AM +0100, Oleksij Rempel wrote:
> > On 28.10.18 23:11, Wolfram Sang wrote:
> > > On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
> > > > At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
> > > > it is project specific configuration and not an error.
> > > > 
> > > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > > 
> > > So, the first patch is not I2C realm, and the second is dropped. No
> > > comment about the third one?
> > > 
> > > And is maybe someone from Pengutronix interested in maintaining this
> > > driver? Uwe maybe? That would speed up things for it...
> > 
> > Should i resend it as single patch?
> 
> I am fine with an ack here.

With patch 1 dropped this patch needs adaption I think.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured
@ 2018-11-03 20:59           ` Uwe Kleine-König
  0 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2018-11-03 20:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Wolfram, hello Oleksij,

On Mon, Oct 29, 2018 at 08:54:08AM +0000, Wolfram Sang wrote:
> On Mon, Oct 29, 2018 at 09:07:56AM +0100, Oleksij Rempel wrote:
> > On 28.10.18 23:11, Wolfram Sang wrote:
> > > On Thu, Oct 18, 2018 at 01:26:15PM +0200, Oleksij Rempel wrote:
> > > > At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So
> > > > it is project specific configuration and not an error.
> > > > 
> > > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > > 
> > > So, the first patch is not I2C realm, and the second is dropped. No
> > > comment about the third one?
> > > 
> > > And is maybe someone from Pengutronix interested in maintaining this
> > > driver? Uwe maybe? That would speed up things for it...
> > 
> > Should i resend it as single patch?
> 
> I am fine with an ack here.

With patch 1 dropped this patch needs adaption I think.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

end of thread, other threads:[~2018-11-03 20:59 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 11:26 [PATCH v1 0/3] i2c: imx: DMA related fixes Oleksij Rempel
2018-10-18 11:26 ` Oleksij Rempel
2018-10-18 11:26 ` [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node Oleksij Rempel
2018-10-18 11:26   ` Oleksij Rempel
2018-10-18 18:43   ` Uwe Kleine-König
2018-10-18 18:43     ` Uwe Kleine-König
2018-10-31  7:50   ` Shawn Guo
2018-10-31  7:50     ` Shawn Guo
2018-10-18 11:26 ` [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later Oleksij Rempel
2018-10-18 11:26   ` Oleksij Rempel
2018-10-19  7:12   ` Uwe Kleine-König
2018-10-19  7:12     ` Uwe Kleine-König
2018-10-19  9:01     ` Oleksij Rempel
2018-10-19  9:01       ` Oleksij Rempel
2018-10-19  9:21       ` Uwe Kleine-König
2018-10-19  9:21         ` Uwe Kleine-König
2018-10-19 10:17         ` Oleksij Rempel
2018-10-19 10:17           ` Oleksij Rempel
2018-10-18 11:26 ` [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured Oleksij Rempel
2018-10-18 11:26   ` Oleksij Rempel
2018-10-28 22:11   ` Wolfram Sang
2018-10-28 22:11     ` Wolfram Sang
2018-10-29  8:07     ` Oleksij Rempel
2018-10-29  8:07       ` Oleksij Rempel
2018-10-29  8:54       ` Wolfram Sang
2018-10-29  8:54         ` Wolfram Sang
2018-11-03 20:59         ` Uwe Kleine-König
2018-11-03 20:59           ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.