From: Wolfram Sang <wsa@the-dreams.de>
To: minyard@acm.org, Jean Delvare <jdelvare@suse.de>
Cc: linux-i2c@vger.kernel.org, Corey Minyard <cminyard@mvista.com>
Subject: Re: [PATCH] i2c-smbus: Don't report duplicate alerts
Date: Thu, 3 Mar 2016 21:57:54 +0100 [thread overview]
Message-ID: <20160303205754.GE1711@katana> (raw)
In-Reply-To: <1453222848-20457-1-git-send-email-minyard@acm.org>
[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]
On Tue, Jan 19, 2016 at 11:00:48AM -0600, minyard@acm.org wrote:
> From: Corey Minyard <cminyard@mvista.com>
>
> Getting the same alert twice in a row is legal and normal,
> especially on a fast device (like running in qemu). Kind of
> like interrupts. So don't report duplicate alerts, and deliver
> them normally.
>
> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Looks plausible to me, but I never used SMBALERT myself. Any chance this
can cause a regression? Jean, what do you think?
> ---
> drivers/i2c/i2c-smbus.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
> index 94765a8..cecd423 100644
> --- a/drivers/i2c/i2c-smbus.c
> +++ b/drivers/i2c/i2c-smbus.c
> @@ -75,7 +75,6 @@ static void smbus_alert(struct work_struct *work)
> {
> struct i2c_smbus_alert *alert;
> struct i2c_client *ara;
> - unsigned short prev_addr = 0; /* Not a valid address */
>
> alert = container_of(work, struct i2c_smbus_alert, alert);
> ara = alert->ara;
> @@ -99,18 +98,12 @@ static void smbus_alert(struct work_struct *work)
> data.flag = status & 1;
> data.addr = status >> 1;
>
> - if (data.addr == prev_addr) {
> - dev_warn(&ara->dev, "Duplicate SMBALERT# from dev "
> - "0x%02x, skipping\n", data.addr);
> - break;
> - }
> dev_dbg(&ara->dev, "SMBALERT# from dev 0x%02x, flag %d\n",
> data.addr, data.flag);
>
> /* Notify driver for the device which issued the alert */
> device_for_each_child(&ara->adapter->dev, &data,
> smbus_do_alert);
> - prev_addr = data.addr;
> }
>
> /* We handled all alerts; re-enable level-triggered IRQs */
> --
> 2.5.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-03-03 21:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 17:00 [PATCH] i2c-smbus: Don't report duplicate alerts minyard
2016-03-03 20:57 ` Wolfram Sang [this message]
2016-03-04 10:15 ` Jean Delvare
2016-04-27 14:28 ` Corey Minyard
2016-06-19 12:06 ` Wolfram Sang
2016-06-20 9:31 ` Benjamin Tissoires
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=20160303205754.GE1711@katana \
--to=wsa@the-dreams.de \
--cc=cminyard@mvista.com \
--cc=jdelvare@suse.de \
--cc=linux-i2c@vger.kernel.org \
--cc=minyard@acm.org \
/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 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).