From patchwork Fri Dec 20 20:21:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 304284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 984632C0078 for ; Sat, 21 Dec 2013 07:23:01 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vu6b3-0002A4-Ov; Fri, 20 Dec 2013 20:22:57 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vu6ZJ-0001LN-Oc for kernel-team@lists.ubuntu.com; Fri, 20 Dec 2013 20:21:09 +0000 Received: from c-67-160-231-162.hsd1.ca.comcast.net ([67.160.231.162] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Vu6ZJ-00080M-IQ; Fri, 20 Dec 2013 20:21:09 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1Vu6ZH-00052v-8G; Fri, 20 Dec 2013 12:21:07 -0800 From: Kamal Mostafa To: Marc Kleine-Budde Subject: [3.8.y.z extended stable] Patch "can: flexcan: use correct clock as base for bit rate calculation" has been added to staging queue Date: Fri, 20 Dec 2013 12:21:07 -0800 Message-Id: <1387570867-19366-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.3.2 X-Extended-Stable: 3.8 Cc: Kamal Mostafa , kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled can: flexcan: use correct clock as base for bit rate calculation to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue This patch is scheduled to be released in version 3.8.13.15. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.8.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ------ From 699f24ad32342f64f51df98521131ab2de25a612 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Mon, 25 Nov 2013 22:15:20 +0100 Subject: can: flexcan: use correct clock as base for bit rate calculation commit 1a3e5173f5e72cbf7f0c8927b33082e361c16d72 upstream. The flexcan IP core uses the peripheral clock ("per") as basic clock for the bit timing calculation. However the driver uses the the wrong clock ("ipg"). This leads to wrong bit rates if the rates on both clock are different. This patch fixes the problem by using the correct clock for the bit rate calculation. Signed-off-by: Marc Kleine-Budde Signed-off-by: Kamal Mostafa --- drivers/net/can/flexcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.3.2 diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 4c90a27..b12fce6 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -1010,7 +1010,6 @@ static int flexcan_probe(struct platform_device *pdev) err = PTR_ERR(clk_ipg); goto failed_clock; } - clock_freq = clk_get_rate(clk_ipg); clk_per = devm_clk_get(&pdev->dev, "per"); if (IS_ERR(clk_per)) { @@ -1018,6 +1017,7 @@ static int flexcan_probe(struct platform_device *pdev) err = PTR_ERR(clk_per); goto failed_clock; } + clock_freq = clk_get_rate(clk_per); } mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);