From patchwork Tue Jan 19 17:00:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 59992 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2722198lbb; Tue, 19 Jan 2016 10:01:31 -0800 (PST) X-Received: by 10.66.102.40 with SMTP id fl8mr35949476pab.136.1453226491806; Tue, 19 Jan 2016 10:01:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d82si48919393pfb.108.2016.01.19.10.01.31; Tue, 19 Jan 2016 10:01:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932616AbcASSBa (ORCPT + 1 other); Tue, 19 Jan 2016 13:01:30 -0500 Received: from vms173023pub.verizon.net ([206.46.173.23]:58390 "EHLO vms173023pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932414AbcASSBa (ORCPT ); Tue, 19 Jan 2016 13:01:30 -0500 Received: from serve.minyard.net ([173.57.176.17]) by vms173023.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0O1700F8RLXH0150@vms173023.mailsrvcs.net> for linux-i2c@vger.kernel.org; Tue, 19 Jan 2016 11:00:58 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=MtGvkDue c=1 sm=1 tr=0 a=bXmWQgKa9n63w7XTPFb8JQ==:117 a=N54-gffFAAAA:8 a=HL3alpDKAAAA:8 a=oR5dmqMzAAAA:8 a=7aQ_Q-yQQ-AA:10 a=fk1lIlRQAAAA:8 a=dHOXHzH-lTFidCCaC2oA:9 a=k3mKsOdLHEno-8OS:21 a=PHeD1RFVluCCq7UD:21 Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 643BC6BB; Tue, 19 Jan 2016 11:00:53 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 1D2BA300758; Tue, 19 Jan 2016 11:00:53 -0600 (CST) From: minyard@acm.org To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: Corey Minyard Subject: [PATCH] i2c-smbus: Don't report duplicate alerts Date: Tue, 19 Jan 2016 11:00:48 -0600 Message-id: <1453222848-20457-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.5.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Corey Minyard 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 --- drivers/i2c/i2c-smbus.c | 7 ------- 1 file changed, 7 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */