Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813889/?format=api
{ "id": 813889, "url": "http://patchwork.ozlabs.org/api/patches/813889/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/1505403549-12992-1-git-send-email-claudio.foellmi@ergon.ch/", "project": { "id": 35, "url": "http://patchwork.ozlabs.org/api/projects/35/?format=api", "name": "Linux I2C development", "link_name": "linux-i2c", "list_id": "linux-i2c.vger.kernel.org", "list_email": "linux-i2c@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1505403549-12992-1-git-send-email-claudio.foellmi@ergon.ch>", "list_archive_url": null, "date": "2017-09-14T15:39:09", "name": "i2c-omap: Trigger bus recovery in lockup case", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "895ac2845c58502196dcbeb72db968020f1371f4", "submitter": { "id": 72366, "url": "http://patchwork.ozlabs.org/api/people/72366/?format=api", "name": "Claudio Foellmi", "email": "claudio.foellmi@ergon.ch" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-i2c/patch/1505403549-12992-1-git-send-email-claudio.foellmi@ergon.ch/mbox/", "series": [ { "id": 3129, "url": "http://patchwork.ozlabs.org/api/series/3129/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=3129", "date": "2017-09-14T15:39:09", "name": "i2c-omap: Trigger bus recovery in lockup case", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3129/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/813889/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813889/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-i2c-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-i2c-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xtNJL61Glz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 01:49:38 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751370AbdINPtg (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 14 Sep 2017 11:49:36 -0400", "from mx2.ergon.ch ([87.239.214.74]:56363 \"EHLO mx2.ergon.ch\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751255AbdINPtg (ORCPT <rfc822;linux-i2c@vger.kernel.org>);\n\tThu, 14 Sep 2017 11:49:36 -0400", "from mahler.ergon.ch ([87.239.208.18])\n\tby mx2.ergon.ch with ESMTP; 14 Sep 2017 17:39:46 +0200", "from crespo.ergon.ch (crespo.ergon.ch [87.239.211.231])\n\tby mahler.ergon.ch (Postfix) with ESMTP id 6A71BEE83;\n\tThu, 14 Sep 2017 17:39:46 +0200 (MEST)" ], "X-Greylist": "delayed 588 seconds by postgrey-1.27 at vger.kernel.org;\n\tThu, 14 Sep 2017 11:49:35 EDT", "X-IronPort-AV": "E=Sophos;i=\"5.42,393,1500933600\"; d=\"scan'208\";a=\"469001\"", "From": "Claudio Foellmi <claudio.foellmi@ergon.ch>", "To": "Tony Lindgren <tony@atomide.com>", "Cc": "Claudio Foellmi <claudio.foellmi@ergon.ch>,\n\tAaro Koskinen <aaro.koskinen@iki.fi>,\n\tWolfram Sang <wsa@the-dreams.de>, linux-omap@vger.kernel.org,\n\tlinux-i2c@vger.kernel.org", "Subject": "[PATCH] i2c-omap: Trigger bus recovery in lockup case", "Date": "Thu, 14 Sep 2017 17:39:09 +0200", "Message-Id": "<1505403549-12992-1-git-send-email-claudio.foellmi@ergon.ch>", "X-Mailer": "git-send-email 2.7.4", "Sender": "linux-i2c-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-i2c.vger.kernel.org>", "X-Mailing-List": "linux-i2c@vger.kernel.org" }, "content": "A very conservative check for bus activity (to prevent interference\nin multimaster setups) prevented the bus recovery methods from being\ntriggered in the case that SDA or SCL was stuck low.\nThis defeats the purpose of the recovery mechanism, which was introduced\nfor exactly this situation (a slave device keeping SDA pulled down).\n\nNote that bus lockups can persist across reboots. The only other options\nare to reset or power cycle the offending slave device, and many i2c\nslaves do not even have a reset pin.\n\nIf we see that one of the lines is low for the entire timeout duration,\nwe can actually be sure that there is no other master driving the bus.\nIt is therefore save for us to attempt a bus recovery.\n\nSigned-off-by: Claudio Foellmi <claudio.foellmi@ergon.ch>\n---\nCaveat: It turns out I don't have the hardware to fully test the\nrecovery mechanism. My faulty i2c slave device actually pulls down SCL,\nnot SDA (so the recovery will not succeed in my case).\nBut by directly connecting SDA to ground, I could at least make sure\nthe recovery function gets called after applying this patch.\n\n drivers/i2c/busses/i2c-omap.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c\nindex 1ebb5e9..4b25fd1 100644\n--- a/drivers/i2c/busses/i2c-omap.c\n+++ b/drivers/i2c/busses/i2c-omap.c\n@@ -563,8 +563,13 @@ static int omap_i2c_wait_for_bb_valid(struct omap_i2c_dev *omap)\n \t\t}\n \n \t\tif (time_after(jiffies, timeout)) {\n+\t\t\t/*\n+\t\t\t * SDA or SCL were low for the entire timeout without\n+\t\t\t * any activity detected. Most likely, a slave is\n+\t\t\t * locking up the bus with no master driving the clock.\n+\t\t\t */\n \t\t\tdev_warn(omap->dev, \"timeout waiting for bus ready\\n\");\n-\t\t\treturn -ETIMEDOUT;\n+\t\t\treturn i2c_recover_bus(&omap->adapter);\n \t\t}\n \n \t\tmsleep(1);\n", "prefixes": [] }