From patchwork Thu Aug 23 17:12:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Kundr=C3=A1t?= X-Patchwork-Id: 961544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=cesnet.cz Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=cesnet.cz header.i=@cesnet.cz header.b="XVJIErbz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41xBDb10dTz9s4v for ; Fri, 24 Aug 2018 03:27:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbeHWU5w (ORCPT ); Thu, 23 Aug 2018 16:57:52 -0400 Received: from office2.cesnet.cz ([195.113.144.244]:58784 "EHLO office2.cesnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726429AbeHWU5w (ORCPT ); Thu, 23 Aug 2018 16:57:52 -0400 Received: from localhost (unknown [IPv6:2001:718:1:2c:7d03:949b:de91:81b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id E617340005D; Thu, 23 Aug 2018 19:27:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2; t=1535045226; bh=umkr28YmLdlFtqIlDL5MykcZvvAO/wmFHc2Zjx6CK3Q=; h=Resent-Date:Resent-From:Resent-To:Resent-Cc:From:Date:Subject:To: Cc; b=XVJIErbzIZIyzNo56J7EAXrtdUmZfjKA3EVL69fk5ho0mtalMn4d8K5tMttOyXZwK VyJqdh0kdcr1nfvF5UORscLW9w3YnRYULzfRU5T/l36mHxERnnpeEPuBPiIZXjEThh il2pRwfWKc+EbCi+NTtMuaG1lBMRnBtZI1nqZVag= Message-Id: <914a22e9d2435d2b6ccd68d1756b9e3b3777cc26.1535045074.git.jan.kundrat@cesnet.cz> From: =?utf-8?q?Jan_Kundr=C3=A1t?= Date: Thu, 23 Aug 2018 19:12:00 +0200 Subject: [PATCH] i2c: mv64xxx: better error description for stuck slaves MIME-Version: 1.0 To: linux-i2c@vger.kernel.org Cc: Gregory CLEMENT , Philipp Zabel , Hans de Goede , Thomas Petazzoni , Hezi Shahmoon Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The datasheet lists this value explicitly, so it is better to show what exactly is going on rather than falling back to a generic message. That generic message was correct and included all details, but at the same time it required one to dig the datasheet to understand that 0x00 = "slave touched the bus when it should not have done so". Signed-off-by: Jan Kundrát --- drivers/i2c/busses/i2c-mv64xxx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index a5a95ea5b81a..469374ded7ae 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c @@ -317,6 +317,14 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) drv_data->rc = -ENXIO; break; + case MV64XXX_I2C_STATUS_BUS_ERR: /* 0x00 */ + dev_warn(&drv_data->adapter.dev, + "bus error: slave has driven SDA/SCL unexpectedly\n"); + drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; + mv64xxx_i2c_hw_init(drv_data); + drv_data->rc = -EIO; + break; + default: dev_err(&drv_data->adapter.dev, "mv64xxx_i2c_fsm: Ctlr Error -- state: 0x%x, "