diff mbox series

i2c-qup: reduce verbosity on DMA channel not found messages

Message ID 1516138534-30842-2-git-send-email-austinwc@codeaurora.org
State Changes Requested
Headers show
Series i2c-qup: reduce verbosity on DMA channel not found messages | expand

Commit Message

Christ, Austin Jan. 16, 2018, 9:35 p.m. UTC
From: Sinan Kaya <okaya@codeaurora.org>

QDF2400 product doesn't have any BAM DMA attached to the I2C channel. This
causes code to spit an unnecessary error message during boot.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Austin Christ <austinwc@codeaurora.org>
---
 drivers/i2c/busses/i2c-qup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Timur Tabi Jan. 31, 2018, 4:54 p.m. UTC | #1
On Tue, Jan 16, 2018 at 3:35 PM, Austin Christ <austinwc@codeaurora.org> wrote:
> From: Sinan Kaya <okaya@codeaurora.org>
>
> QDF2400 product doesn't have any BAM DMA attached to the I2C channel. This
> causes code to spit an unnecessary error message during boot.

If that's the case, then qup->is_dma should be false, and then this
code should never be executed.

Wouldn't it be better if qup_i2c_probe() is modified to detect a
QDF2400 and not even try to enable DMA?  There's already code like
that for device tree:

    if (of_device_is_compatible(pdev->dev.of_node, "qcom,i2c-qup-v1.1.1")) {
        qup->adap.algo = &qup_i2c_algo;
        qup->adap.quirks = &qup_i2c_quirks;
    else
    ...
        qup->adap.algo = &qup_i2c_algo_v2;
        ret = qup_i2c_req_dma(qup);

On QDF2400, you should never be calling qup_i2c_req_dma() in the first place.
Christ, Austin March 13, 2018, 7:45 p.m. UTC | #2
Withdrawing patch.

After review, the correct solution to the unnecessary logging seen on 
some targets is to provide a different path through the probe function 
for ACPI devices.

A more correct patch will be sent soon.


On 1/16/2018 2:35 PM, Austin Christ wrote:
> From: Sinan Kaya <okaya@codeaurora.org>
> 
> QDF2400 product doesn't have any BAM DMA attached to the I2C channel. This
> causes code to spit an unnecessary error message during boot.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> Signed-off-by: Austin Christ <austinwc@codeaurora.org>
> ---
>   drivers/i2c/busses/i2c-qup.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
> index 08f8e01..c28d267 100644
> --- a/drivers/i2c/busses/i2c-qup.c
> +++ b/drivers/i2c/busses/i2c-qup.c
> @@ -666,7 +666,7 @@ static int qup_i2c_req_dma(struct qup_i2c_dev *qup)
>   		if (IS_ERR(qup->btx.dma)) {
>   			err = PTR_ERR(qup->btx.dma);
>   			qup->btx.dma = NULL;
> -			dev_err(qup->dev, "\n tx channel not available");
> +			dev_info(qup->dev, "\n tx channel not available");
>   			return err;
>   		}
>   	}
> @@ -674,7 +674,7 @@ static int qup_i2c_req_dma(struct qup_i2c_dev *qup)
>   	if (!qup->brx.dma) {
>   		qup->brx.dma = dma_request_slave_channel_reason(qup->dev, "rx");
>   		if (IS_ERR(qup->brx.dma)) {
> -			dev_err(qup->dev, "\n rx channel not available");
> +			dev_info(qup->dev, "\n rx channel not available");
>   			err = PTR_ERR(qup->brx.dma);
>   			qup->brx.dma = NULL;
>   			qup_i2c_rel_dma(qup);
>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 08f8e01..c28d267 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -666,7 +666,7 @@  static int qup_i2c_req_dma(struct qup_i2c_dev *qup)
 		if (IS_ERR(qup->btx.dma)) {
 			err = PTR_ERR(qup->btx.dma);
 			qup->btx.dma = NULL;
-			dev_err(qup->dev, "\n tx channel not available");
+			dev_info(qup->dev, "\n tx channel not available");
 			return err;
 		}
 	}
@@ -674,7 +674,7 @@  static int qup_i2c_req_dma(struct qup_i2c_dev *qup)
 	if (!qup->brx.dma) {
 		qup->brx.dma = dma_request_slave_channel_reason(qup->dev, "rx");
 		if (IS_ERR(qup->brx.dma)) {
-			dev_err(qup->dev, "\n rx channel not available");
+			dev_info(qup->dev, "\n rx channel not available");
 			err = PTR_ERR(qup->brx.dma);
 			qup->brx.dma = NULL;
 			qup_i2c_rel_dma(qup);