+ spi_mpc83xxc-underclocking-hotfix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     spi_mpc83xx.c underclocking hotfix
has been added to the -mm tree.  Its filename is
     spi_mpc83xxc-underclocking-hotfix.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: spi_mpc83xx.c underclocking hotfix
From: Clifford Wolf <clifford@xxxxxxxxxxx>

The MPC83xx SPI controller clock divider can divide the system clock by not
more then 1024.  The spi_mpc83xx driver does not check this and silently
writes garbage to the SPI controller registers when asked to run at lower
frequencies.  I've tried to run the SPI on a 266MHz MPC8349E with 100kHz
for debugging a bus problem and suddenly was confronted with a 2nd problem
to debug..  ;-)

The patch adds an additional check which avoids writing garbage to the SPI
controller registers and warn the user about it.  This might help others to
avoid simmilar problems.

Cc: Kumar Gala <galak@xxxxxxxxxxxxxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/spi/spi_mpc83xx.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN drivers/spi/spi_mpc83xx.c~spi_mpc83xxc-underclocking-hotfix drivers/spi/spi_mpc83xx.c
--- a/drivers/spi/spi_mpc83xx.c~spi_mpc83xxc-underclocking-hotfix
+++ a/drivers/spi/spi_mpc83xx.c
@@ -158,6 +158,12 @@ static void mpc83xx_spi_chipselect(struc
 
 		if ((mpc83xx_spi->sysclk / spi->max_speed_hz) >= 64) {
 			u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 64);
+			if (pm > 0x0f) {
+				printk(KERN_WARNING "MPC83xx SPI: SPICLK can't be less then a SYSCLK/1024!\n"
+						"Requested SPICLK is %d Hz. Will use %d Hz instead.\n",
+						spi->max_speed_hz, mpc83xx_spi->sysclk / 1024);
+				pm = 0x0f;
+			}
 			regval |= SPMODE_PM(pm) | SPMODE_DIV16;
 		} else {
 			u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 4);
_

Patches currently in -mm which might be from clifford@xxxxxxxxxxx are

spi_mpc83xxc-underclocking-hotfix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux