From patchwork Thu Oct 22 04:46:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 7462391 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 21088BEEA4 for ; Thu, 22 Oct 2015 04:49:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BA0220980 for ; Thu, 22 Oct 2015 04:49:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 561AC2097D for ; Thu, 22 Oct 2015 04:49:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zp7mm-00033Z-Ix; Thu, 22 Oct 2015 04:47:32 +0000 Received: from mail-bl2on0075.outbound.protection.outlook.com ([65.55.169.75] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zp7mW-0002wc-9p for linux-arm-kernel@lists.infradead.org; Thu, 22 Oct 2015 04:47:17 +0000 Received: from BN1AFFO11FD046.protection.gbl (10.58.52.32) by BN1AFFO11HUB006.protection.gbl (10.58.52.116) with Microsoft SMTP Server (TLS) id 15.1.300.4; Thu, 22 Oct 2015 04:46:54 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; grandegger.com; dkim=none (message not signed) header.d=none;grandegger.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BN1AFFO11FD046.mail.protection.outlook.com (10.58.53.61) with Microsoft SMTP Server (TLS) id 15.1.300.4 via Frontend Transport; Thu, 22 Oct 2015 04:46:53 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1Zp7m8-0003mH-Tl; Wed, 21 Oct 2015 21:46:52 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1Zp7m8-00060A-M7; Wed, 21 Oct 2015 21:46:52 -0700 Received: from [172.23.64.207] (helo=xhd-lin64re117.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1Zp7lQ-00054y-J7; Wed, 21 Oct 2015 21:46:08 -0700 Received: by xhd-lin64re117.xilinx.com (Postfix, from userid 13614) id C6BE12090A; Thu, 22 Oct 2015 10:16:07 +0530 (IST) From: Kedareswara rao Appana To: , , , , , Subject: [PATCH 2/2] can: xilinx: fix bug in bus error handling Date: Thu, 22 Oct 2015 10:16:03 +0530 Message-ID: <1445489163-11045-2-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1445489163-11045-1-git-send-email-appanad@xilinx.com> References: <1445489163-11045-1-git-send-email-appanad@xilinx.com> X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21892.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD046; 1:JIjedYs/4kRZ/y9BqtQk523fvrJcmcsMHS05y+y92h5TTTNp3qcsFNurA0a1k2ltPkfLU1RE4hcjPRPs75NN1agVWmlOg+pXLhPpeCNCp+j3eKm4fJgGnbKCShNEqzIOkZD/LJUlSQlHcoyxIO3Af2y4db4BgrVWgSAySegBO5q/5I29YbrEmjH6avG2XGs4QL00fGz1PwfEBeEplvm4lk9ZS3PMM8GUnjW4kOJrCfQGEUUPVFy+zm/cSVGni5GNdLdvSsscosavWDie5OPX8CoBFIhY8oMHO3QjAQ32KhvL8XAO8QIlNa8J4QLpoRHYkpjeJXaHjqTgYlm67bMb4o37CqL7/6aucNlErg34mcWr5brEFusJbbd58ahODDg8EISddn1Tt0wC5UXwG9qsVQ== X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(19580395003)(92566002)(48376002)(45336002)(36386004)(5007970100001)(19580405001)(87936001)(5001770100001)(81156007)(6806005)(63266004)(90966002)(46386002)(50466002)(46102003)(33646002)(11100500001)(5001960100002)(42186005)(106466001)(76176999)(52956003)(229853001)(4001450100002)(189998001)(7049001)(2201001)(5003940100001)(86362001)(2950100001)(5008740100001)(50226001)(50986999)(103686003)(36756003)(64706001)(47776003)(107986001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1AFFO11HUB006; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11HUB006; 2:pYRnpg5eI84pm9ZP+oqVWOCosXrtpmX5v8+L/lUWD5ygl1W4IO/BT19BC6xrB+Rr0ZrB/qGa77kFPMNM4JfNPaKJaZ1mcb65PDKiv5jmVLLQE9BbRsTS2voGrMiImF/CSjCCG/0v8l5Pv5cunxx/+W/smfVZ11kCg2jtLShiEQ8=; 3:zfUWac8Wq4/6PABVhZ1DF7QbfKx2PFGuVhSVQI3Q3QC8mtvJODqUcjfJit8jnr5eNMypgmMAKKkMl4B0P5WdiZie9uU0CgyO9UJ30QgkQBEdfXOOCsl8zSF5feQvqW4yl7j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Qx+BwOuF/BmjW13XfzQ9KvFMVucaIyyckecESrL6QnPJPLLGsuQvxBUirdglafUlKcUn8J5w7TAA5rCznBCgJkdZIYxQvMqtRedz9TMySToT07Lf7MjdtshMEdpZC+3OJJcviasGPb0rWvdOFyJCSEf0vp82/+42AOf3meXTjEXot68VqsICtjW7t9KHm9jUVMD2f6H51ciRD4wtGRQlkaux7x2Vbc8j+th/k5aO9au5uERtjZ5ZmETQE6NuDmqkiBhUJvc40emxqJ0qV7N9XAjTrKwgaD0dE2PozMjG2wYTpi/xC+pZFy62Xdz2rM5EOEeqb4hgSFfiKeBj6cnk6s+7lk7RzKj6YeslumzjqFKQkCcKxmab/63iEA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10115024)(102215023); SRVR:BN1AFFO11HUB006; BCL:0; PCL:0; RULEID:; SRVR:BN1AFFO11HUB006; X-Forefront-PRVS: 0737B96801 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1AFFO11HUB006; 23:lWjkR5vRmm0d+uXR/0y2SCnD4qH3JveBp5+jLtz?= =?us-ascii?Q?+sCcb1WGNaMdBKx2iG9PdP2c0vDmKeZ5AWOUBh0MCvG+28YvVE30C4Bt0n/x?= =?us-ascii?Q?W/JizdKZrX8D1w2jYnu+tvsbvIKzPVipS1z2R7WbLpr5iKX+TLAeaKM16wSY?= =?us-ascii?Q?4ZYDJnklJLUhLWtIhHZx8nAqTnBnr8A2rMoItNZ7pwmjdmYhhxk0nyI7mWvT?= =?us-ascii?Q?uFQgzQ/WSPl+iIqfqGMQgjncjNuQTbfZTU516zDPyw2P6yA/kEqd8e5fT7/W?= =?us-ascii?Q?1SiVNMnsM8ufyIfLW/AkxO39u5z6uY1Z9LfPos/Burz2BOkjyN+mUzuWuA9a?= =?us-ascii?Q?+HK9TBIk0TpBGLfuUiAzfmJcN/CWgf7PHzgOqF8Ap0X4OqFIN5MTcqver/qO?= =?us-ascii?Q?9cAjHzSxCReuJwZ3QDvZosifmswZnHQ0GBh21hLdWeKsMcIdQqAHZA+mwYtN?= =?us-ascii?Q?ZaN1exUFY23jkYejDGUAtuAnoQnaZKoGIxPqeVd+OEiJY95ssukbATelfDID?= =?us-ascii?Q?7Zjv7iLA6Imm8gHBftgLpSggiXO/VmaPe/jQz0G6eFxzH5pfvV/KnTNA7SPz?= =?us-ascii?Q?cE6C5EK6GwfQ4ayIvJvVW5LouqpksTP3YUFmXvhRcws9CRHRniKPBiRofPx0?= =?us-ascii?Q?JZWO/lVSzOOKPWV8jOkrrj8BoWuKg/uuSHQi/WIO+b7E2pQB98SkeB71YCil?= =?us-ascii?Q?2NmTrzflBiNbzLXAyLZWLZzkwr5Zxv9j4tnIM2/vnp7xL2mZn71AVTtzuJKh?= =?us-ascii?Q?pwTFkYSandXrsvFEG+0yl9ZPypMjrL4ZLRMIMrNvtA8TBu89yQ3vxH30dCRO?= =?us-ascii?Q?pJvhQJN8fkqaLUjMZdkCbnalYFURQtYgQFCEl3NBup3mM+w6vNrwvwKguSkY?= =?us-ascii?Q?bCHGF4r5ldXquYkIFLwzgUwQDBqN5gOn3YPbmDix0b1fKOqweY1U/hns7by7?= =?us-ascii?Q?FVbrFSx/tk8sVjPp4aQ7/17BQT/0cmT7mqzVFNJNHJ76BSNYYqID+3yjoFZ3?= =?us-ascii?Q?VIS4E4SXMJF6NQjQNCz97rKMk8M/zb40v5/EMMWKH25H5jx8GDso+1Og8SMb?= =?us-ascii?Q?e7hADzWZWQf4+Zjfg5gHbbxynnTSVBlOVey6++jO7ULDB0uHjEfbon7PSgzy?= =?us-ascii?Q?izfbQrpqZc5WCH+NUXqwU2MF6NkRLu4z22bUHyeF80GF4trZo7A7KQVGadOd?= =?us-ascii?Q?4avbnTruDW7LeO6t1VLCAeQDgdSvYuF1COPfU?= X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11HUB006; 5:7xbIXLZn00MioGkurAZRyoJb4IGkz/ZlRzS3y92YNRp03uhOXi0TqzmyFP2RHctQIcIqXDXD/UBPin+ztf3R4sj6sgc2rq/WFMkZ7jDSbwjTLkCI9mbRTgshYqb7HgttFfiD0c+ZCPvh0RtUFKB+6g==; 24:SDPeTf/ig0MCzu1Na0NpjjZwVoow6U3Lj57TadMbWG0yVVUEfqG8JfVGuSFSJPhuCKcQ9xd95T8rCGMcOmWP/cPgNvNEBU8l1n+OnQVe2c0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2015 04:46:53.6840 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1AFFO11HUB006 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151021_214716_728108_D076A696 X-CRM114-Status: GOOD ( 13.23 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-can@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simply resetting the peripheral on bus off condition is not enough, Because we also need to re-initialize the whole device. This patch fixes this issue. Signed-off-by: Kedareswara rao Appana --- drivers/net/can/xilinx_can.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index 055d6f3..9aeb85f 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -529,6 +529,8 @@ static int xcan_rx(struct net_device *ndev) return 1; } +static void xcan_chip_stop(struct net_device *ndev); + /** * xcan_err_interrupt - error frame Isr * @ndev: net_device pointer @@ -558,8 +560,9 @@ static void xcan_err_interrupt(struct net_device *ndev, u32 isr) if (isr & XCAN_IXR_BSOFF_MASK) { priv->can.state = CAN_STATE_BUS_OFF; priv->can.can_stats.bus_off++; - /* Leave device in Config Mode in bus-off state */ - priv->write_reg(priv, XCAN_SRR_OFFSET, XCAN_SRR_RESET_MASK); + /* Re-initialize the whole device in bus-off state */ + xcan_chip_stop(ndev); + xcan_chip_start(ndev); can_bus_off(ndev); if (skb) cf->can_id |= CAN_ERR_BUSOFF;