Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3027433pxx; Sun, 1 Nov 2020 19:56:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzK56lWwbWxghpWC/tfkEAlLqKmePRisH2uthxrb0mizklhHU1MAd1mGYU7jG7ilNffw0fY X-Received: by 2002:a17:906:76d5:: with SMTP id q21mr14040048ejn.415.1604289399308; Sun, 01 Nov 2020 19:56:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604289399; cv=none; d=google.com; s=arc-20160816; b=yQbmkNbMB0HvhecmmnZvorFFOq6ztE6QKRizbQ7XTKPTl9XWl2jI53AdubJ3T4GrnZ xfG3Fmk9h5HL3hlrT1grXMZ45BrrVJiIgQHVAg+lwqRlyAlJVxFiOy+SZb7cu8F+1VY5 G2yOgkT8+s+fzgXxD3i517Jy8D14XyGMyYjI81AnVjN5TiZENbzPeqtcdgvDkK7q0Oc4 G4HY8VOPq6KsnKyWJm5zfd12nWfA/BW+5SGNgSaktl25pRZzdr5IbpSgknFbaPyEahHZ vmzli4qg/vaqX7HygJcz6fP7oefkSY1g7zdaaJvkkF990o5T1IAkB8NMk032i7LkzFab Dhuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=wSgczscNbFcRjEyNMLYXmEYULtMgZMLCTGG5SshOBiY=; b=YNCJJCRGmteGcj/pDYKBarzEWm5oF+D5633CcNPd4CZX4ZagBtQZ1osYMWKyAYesBS BjVqhvw8758LXTELTV8/e3VNXEomG0UpL7P/PTkrXPakCfzr9VWSqWXjnNrWKWMszF5C d+vtmpqQ9owKDhpxHs3DTQrDCbn1rd2UOKjyzkIgfTRRW0WlKCDnXRfbkkipBExjwzQF L2hzGY5y5mu+Q/tEI/aUupZOjwn12ws8TSncMaJnX/XQwEdTv7FsWshA4hpkP/4Y756n LHx+L1ma49O5rC2/yAgUoyX0PJU9oOW9Zuilx+/zRxSC9JbJHuPInqv2naoa99vhYtuW CkAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=cdtabpl6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si11058238ejm.262.2020.11.01.19.56.16; Sun, 01 Nov 2020 19:56:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=cdtabpl6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727765AbgKBDyz (ORCPT + 99 others); Sun, 1 Nov 2020 22:54:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbgKBDyz (ORCPT ); Sun, 1 Nov 2020 22:54:55 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B04FC0617A6 for ; Sun, 1 Nov 2020 19:54:55 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id 72so3219192pfv.7 for ; Sun, 01 Nov 2020 19:54:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wSgczscNbFcRjEyNMLYXmEYULtMgZMLCTGG5SshOBiY=; b=cdtabpl6R/iK85GMfzSkdQaG/jsXK34iwl/TuEWJpnT9OVZu/404BQBW4+qpGmct1h A62KGUmgL6p92CTHsbbSiE63Qr5KyDcAYgyPhFc/svWK7lX7su0qBmhGErmQNTPlVlvD o1Af0b0B0Hre8nPyhZVkBJdZVYGgYNv8QVo8E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wSgczscNbFcRjEyNMLYXmEYULtMgZMLCTGG5SshOBiY=; b=hHkwoYx8u99ST9Tx3vknFyo9++rq1IoOn6U0L5JMJOS2wR3ObKkebH6PEjqbsA9sMt c9DEHuH3A2ea7/Xh0509R3rL/OJFSZyGhlsKqGNemtOY5LrMwLORe5oNGjlHq+mQJ76B 8Yvtq0qx1zNpbQy3z1jQBwHWLLXQBlBZv0pVQkMFIDoAAe+hOUGi9XXv7oL/N78IGo9s +je2g8LiNfGmfpC2Ik97swmEzJoVayWmPcDWV7948xMvs2TcgmeJC9gF03hTX7TYhY81 kA+PaKBShhcFPv0tiGk129rxAouMD9rEq6LNDjNV8jNMYQdd3hqfFpshG+skR05d+VhG nrNA== X-Gm-Message-State: AOAM5314pO+H3ad2wfmZheOepXvg6P+SslwkRDIsg5VndCIMcObH9k37 N7UCRVPDVdPqhPPTnSoPkqVmOw== X-Received: by 2002:aa7:91cf:0:b029:18a:9972:1aa9 with SMTP id z15-20020aa791cf0000b029018a99721aa9mr10873546pfa.46.1604289294415; Sun, 01 Nov 2020 19:54:54 -0800 (PST) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y5sm5655711pfc.165.2020.11.01.19.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2020 19:54:53 -0800 (PST) From: Rayagonda Kokatanur To: Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Wolfram Sang , Florian Fainelli , Brendan Higgins , Andy Shevchenko , Lori Hikichi , Dhananjay Phadke , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Rayagonda Kokatanur Subject: [PATCH v3 1/6] i2c: iproc: handle Master aborted error Date: Mon, 2 Nov 2020 09:24:28 +0530 Message-Id: <20201102035433.6774-2-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201102035433.6774-1-rayagonda.kokatanur@broadcom.com> References: <20201102035433.6774-1-rayagonda.kokatanur@broadcom.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000089845e05b317b56b" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000089845e05b317b56b Handle Master aborted error by flushing tx and rx fifo and reinitializing the hw. Signed-off-by: Rayagonda Kokatanur Acked-by: Ray Jui --- drivers/i2c/busses/i2c-bcm-iproc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index d8295b1c379d..834a98caeada 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -93,6 +93,7 @@ #define S_CMD_STATUS_MASK 0x07 #define S_CMD_STATUS_SUCCESS 0x0 #define S_CMD_STATUS_TIMEOUT 0x5 +#define S_CMD_STATUS_MASTER_ABORT 0x7 #define IE_OFFSET 0x38 #define IE_M_RX_FIFO_FULL_SHIFT 31 @@ -311,9 +312,10 @@ static void bcm_iproc_i2c_check_slave_status( return; val = (val >> S_CMD_STATUS_SHIFT) & S_CMD_STATUS_MASK; - if (val == S_CMD_STATUS_TIMEOUT) { - dev_err(iproc_i2c->device, "slave random stretch time timeout\n"); - + if (val == S_CMD_STATUS_TIMEOUT || val == S_CMD_STATUS_MASTER_ABORT) { + dev_err(iproc_i2c->device, (val == S_CMD_STATUS_TIMEOUT) ? + "slave random stretch time timeout\n" : + "Master aborted read transaction\n"); /* re-initialize i2c for recovery */ bcm_iproc_i2c_enable_disable(iproc_i2c, false); bcm_iproc_i2c_slave_init(iproc_i2c, true); -- 2.17.1 --00000000000089845e05b317b56b Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQVwYJKoZIhvcNAQcCoIIQSDCCEEQCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg2sMIIE6DCCA9CgAwIBAgIOSBtqCRO9gCTKXSLwFPMwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UE CxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT Ckdsb2JhbFNpZ24wHhcNMTYwNjE1MDAwMDAwWhcNMjQwNjE1MDAwMDAwWjBdMQswCQYDVQQGEwJC RTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEzMDEGA1UEAxMqR2xvYmFsU2lnbiBQZXJzb25h bFNpZ24gMiBDQSAtIFNIQTI1NiAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA tpZok2X9LAHsYqMNVL+Ly6RDkaKar7GD8rVtb9nw6tzPFnvXGeOEA4X5xh9wjx9sScVpGR5wkTg1 fgJIXTlrGESmaqXIdPRd9YQ+Yx9xRIIIPu3Jp/bpbiZBKYDJSbr/2Xago7sb9nnfSyjTSnucUcIP ZVChn6hKneVGBI2DT9yyyD3PmCEJmEzA8Y96qT83JmVH2GaPSSbCw0C+Zj1s/zqtKUbwE5zh8uuZ p4vC019QbaIOb8cGlzgvTqGORwK0gwDYpOO6QQdg5d03WvIHwTunnJdoLrfvqUg2vOlpqJmqR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