All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Kewei Xu <kewei.xu@mediatek.com>
Cc: matthias.bgg@gmail.com, robh+dt@kernel.org,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	srv_heupstream@mediatek.com, leilk.liu@mediatek.com,
	qii.wang@mediatek.com, liguo.zhang@mediatek.com,
	caiyu.chen@mediatek.com, ot_daolong.zhu@mediatek.com,
	yuhan.wei@mediatek.com
Subject: Re: [PATCH v7 3/7] i2c: mediatek: Dump i2c/dma register when a timeout occurs
Date: Sat, 2 Oct 2021 08:37:28 +0200	[thread overview]
Message-ID: <YVf+KCztQI9XrdEq@kunai> (raw)
In-Reply-To: <20210917101416.20760-4-kewei.xu@mediatek.com>

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]


> @@ -837,6 +839,57 @@ static int mtk_i2c_set_speed(struct mtk_i2c *i2c, unsigned int parent_clk)
>  	return 0;
>  }

> +static void i2c_dump_register(struct mtk_i2c *i2c)
> +{
> +	dev_err(i2c->dev, "SLAVE_ADDR: 0x%x, INTR_MASK: 0x%x\n",
> +		mtk_i2c_readw(i2c, OFFSET_SLAVE_ADDR),
> +		mtk_i2c_readw(i2c, OFFSET_INTR_MASK));

I think this is too verbose and should be a debugging only patch not
really suited for upstream. But if you like it this way, then keep
the verbosity. However, dev_err is too strong, this really needs to be
dev_dbg. Timeouts can happen on an I2C bus, think about an EEPROM in a
long erase cycle while you want to read it. Perfectly normal.


>  	if (ret == 0) {
> -		dev_dbg(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr);
> +		dev_err(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr);
> +		i2c_dump_register(i2c);

Needs to stay dev_dbg as well.


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

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: Kewei Xu <kewei.xu@mediatek.com>
Cc: matthias.bgg@gmail.com, robh+dt@kernel.org,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	srv_heupstream@mediatek.com, leilk.liu@mediatek.com,
	qii.wang@mediatek.com, liguo.zhang@mediatek.com,
	caiyu.chen@mediatek.com, ot_daolong.zhu@mediatek.com,
	yuhan.wei@mediatek.com
Subject: Re: [PATCH v7 3/7] i2c: mediatek: Dump i2c/dma register when a timeout occurs
Date: Sat, 2 Oct 2021 08:37:28 +0200	[thread overview]
Message-ID: <YVf+KCztQI9XrdEq@kunai> (raw)
In-Reply-To: <20210917101416.20760-4-kewei.xu@mediatek.com>


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


> @@ -837,6 +839,57 @@ static int mtk_i2c_set_speed(struct mtk_i2c *i2c, unsigned int parent_clk)
>  	return 0;
>  }

> +static void i2c_dump_register(struct mtk_i2c *i2c)
> +{
> +	dev_err(i2c->dev, "SLAVE_ADDR: 0x%x, INTR_MASK: 0x%x\n",
> +		mtk_i2c_readw(i2c, OFFSET_SLAVE_ADDR),
> +		mtk_i2c_readw(i2c, OFFSET_INTR_MASK));

I think this is too verbose and should be a debugging only patch not
really suited for upstream. But if you like it this way, then keep
the verbosity. However, dev_err is too strong, this really needs to be
dev_dbg. Timeouts can happen on an I2C bus, think about an EEPROM in a
long erase cycle while you want to read it. Perfectly normal.


>  	if (ret == 0) {
> -		dev_dbg(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr);
> +		dev_err(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr);
> +		i2c_dump_register(i2c);

Needs to stay dev_dbg as well.


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

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

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: Kewei Xu <kewei.xu@mediatek.com>
Cc: matthias.bgg@gmail.com, robh+dt@kernel.org,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	srv_heupstream@mediatek.com, leilk.liu@mediatek.com,
	qii.wang@mediatek.com, liguo.zhang@mediatek.com,
	caiyu.chen@mediatek.com, ot_daolong.zhu@mediatek.com,
	yuhan.wei@mediatek.com
Subject: Re: [PATCH v7 3/7] i2c: mediatek: Dump i2c/dma register when a timeout occurs
Date: Sat, 2 Oct 2021 08:37:28 +0200	[thread overview]
Message-ID: <YVf+KCztQI9XrdEq@kunai> (raw)
In-Reply-To: <20210917101416.20760-4-kewei.xu@mediatek.com>


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


> @@ -837,6 +839,57 @@ static int mtk_i2c_set_speed(struct mtk_i2c *i2c, unsigned int parent_clk)
>  	return 0;
>  }

> +static void i2c_dump_register(struct mtk_i2c *i2c)
> +{
> +	dev_err(i2c->dev, "SLAVE_ADDR: 0x%x, INTR_MASK: 0x%x\n",
> +		mtk_i2c_readw(i2c, OFFSET_SLAVE_ADDR),
> +		mtk_i2c_readw(i2c, OFFSET_INTR_MASK));

I think this is too verbose and should be a debugging only patch not
really suited for upstream. But if you like it this way, then keep
the verbosity. However, dev_err is too strong, this really needs to be
dev_dbg. Timeouts can happen on an I2C bus, think about an EEPROM in a
long erase cycle while you want to read it. Perfectly normal.


>  	if (ret == 0) {
> -		dev_dbg(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr);
> +		dev_err(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr);
> +		i2c_dump_register(i2c);

Needs to stay dev_dbg as well.


[-- 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

  reply	other threads:[~2021-10-02  6:37 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 10:14 [PATCH v7 0/7] Introducing an attribute to select the time setting Kewei Xu
2021-09-17 10:14 ` Kewei Xu
2021-09-17 10:14 ` Kewei Xu
2021-09-17 10:14 ` [PATCH v7 1/7] i2c: mediatek: fixing the incorrect register offset Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-10-02  6:28   ` Wolfram Sang
2021-10-02  6:28     ` Wolfram Sang
2021-10-02  6:28     ` Wolfram Sang
2021-09-17 10:14 ` [PATCH v7 2/7] i2c: mediatek: Reset the handshake signal between i2c and dma Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-10-02  6:30   ` Wolfram Sang
2021-10-02  6:30     ` Wolfram Sang
2021-10-02  6:30     ` Wolfram Sang
2021-10-08  6:19     ` Kewei Xu
2021-10-08  6:19       ` Kewei Xu
2021-10-08  6:19       ` Kewei Xu
2021-09-17 10:14 ` [PATCH v7 3/7] i2c: mediatek: Dump i2c/dma register when a timeout occurs Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-10-02  6:37   ` Wolfram Sang [this message]
2021-10-02  6:37     ` Wolfram Sang
2021-10-02  6:37     ` Wolfram Sang
2021-10-08  7:13     ` Kewei Xu
2021-10-08  7:13       ` Kewei Xu
2021-10-08  7:13       ` Kewei Xu
2021-09-17 10:14 ` [PATCH v7 4/7] dt-bindings: i2c: add attribute use-default-timing Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14 ` [PATCH v7 5/7] i2c: mediatek: Add OFFSET_EXT_CONF setting back Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-10-02  6:40   ` Wolfram Sang
2021-10-02  6:40     ` Wolfram Sang
2021-10-02  6:40     ` Wolfram Sang
2021-09-17 10:14 ` [PATCH v7 6/7] i2c: mediatek: Isolate speed setting via dts for special devices Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-10-02  6:40   ` Wolfram Sang
2021-10-02  6:40     ` Wolfram Sang
2021-10-02  6:40     ` Wolfram Sang
2021-10-08  8:47     ` Kewei Xu
2021-10-08  8:47       ` Kewei Xu
2021-10-08  8:47       ` Kewei Xu
2021-10-11 10:56       ` Wolfram Sang
2021-10-11 10:56         ` Wolfram Sang
2021-10-11 10:56         ` Wolfram Sang
2021-11-29 12:49         ` Wolfram Sang
2021-11-29 12:49           ` Wolfram Sang
2021-11-29 12:49           ` Wolfram Sang
2021-12-18  9:44           ` Kewei Xu
2021-12-18  9:44             ` Kewei Xu
2021-12-18  9:44             ` Kewei Xu
2021-12-18 10:17             ` Wolfram Sang
2021-12-18 10:17               ` Wolfram Sang
2021-12-18 10:17               ` Wolfram Sang
2021-09-17 10:14 ` [PATCH v7 7/7] i2c: mediatek: modify bus speed calculation formula Kewei Xu
2021-09-17 10:14   ` Kewei Xu
2021-09-17 10:14   ` Kewei Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVf+KCztQI9XrdEq@kunai \
    --to=wsa@the-dreams.de \
    --cc=caiyu.chen@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kewei.xu@mediatek.com \
    --cc=leilk.liu@mediatek.com \
    --cc=liguo.zhang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=ot_daolong.zhu@mediatek.com \
    --cc=qii.wang@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=srv_heupstream@mediatek.com \
    --cc=yuhan.wei@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.