[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1388682306-30859-68-git-send-email-kamal@canonical.com>
Date: Thu, 2 Jan 2014 09:04:42 -0800
From: Kamal Mostafa <kamal@...onical.com>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...ts.ubuntu.com
Cc: Marc Kleine-Budde <mkl@...gutronix.de>,
Kamal Mostafa <kamal@...onical.com>
Subject: [PATCH 3.8 67/91] can: flexcan: use correct clock as base for bit rate calculation
3.8.13.15 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <mkl@...gutronix.de>
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 <mkl@...gutronix.de>
Signed-off-by: Kamal Mostafa <kamal@...onical.com>
---
drivers/net/can/flexcan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists