Title: [8747] trunk: [#5836] run spi flash with dma mode enabled fails to mount.
Revision
8747
Author
hennerich
Date
2010-05-21 09:20:38 -0400 (Fri, 21 May 2010)

Log Message

[#5836] run spi flash with dma mode enabled fails to mount.
 
Some peripherals may generate an error interrupt shortly after the 
Data Interrupt, due to the fact that the peripheral isn't serviced fast
enough.
In most cases this doesn't harm and is expected behavior.
On Blackfin priority driven nested interrupts the Error interrupt 
(with the current priority) overtakes the Data Interrupt. 
This hasn't been a problem on most parts since you simply don't request
the 
ERROR interrupt (or leave it disabled while there is an expected
ERROR/STATUS 
indication) and do the peripheral status checking in the data interrupt.
On BF537/6/4 the ERROR interrupt can't be enabled on peripheral basis, 
once you enable the ERROR interrupt for one peripheral, it automatically 
enables it for all peripherals.

Therefore lower the multiplexed ERROR interrupt priority
and deal with ERROR/STATUS flags in the Data Interrupt.

Modified Paths

Diff

Modified: trunk/arch/blackfin/configs/BF537-STAMP_defconfig (8746 => 8747)


--- trunk/arch/blackfin/configs/BF537-STAMP_defconfig	2010-05-21 12:44:00 UTC (rev 8746)
+++ trunk/arch/blackfin/configs/BF537-STAMP_defconfig	2010-05-21 13:20:38 UTC (rev 8747)
@@ -230,7 +230,7 @@
 # Priority
 #
 CONFIG_IRQ_DMA_ERROR=7
-CONFIG_IRQ_ERROR=7
+CONFIG_IRQ_ERROR=11
 CONFIG_IRQ_CAN_RX=11
 CONFIG_IRQ_CAN_TX=11
 CONFIG_IRQ_PROG_INTA=12

Modified: trunk/arch/blackfin/mach-bf537/Kconfig (8746 => 8747)


--- trunk/arch/blackfin/mach-bf537/Kconfig	2010-05-21 12:44:00 UTC (rev 8746)
+++ trunk/arch/blackfin/mach-bf537/Kconfig	2010-05-21 13:20:38 UTC (rev 8747)
@@ -14,8 +14,8 @@
 	int "IRQ_DMA_ERROR Generic"
 	default 7
 config IRQ_ERROR
-	int "IRQ_ERROR: CAN MAC SPORT0 SPORT1 SPI UART0 UART1"
-	default 7
+	int "IRQ_ERROR: PPI CAN MAC SPORT0 SPORT1 SPI UART0 UART1"
+	default 11
 config IRQ_RTC
 	int "IRQ_RTC"
 	default 8

Modified: trunk/drivers/spi/spi_bfin5xx.c (8746 => 8747)


--- trunk/drivers/spi/spi_bfin5xx.c	2010-05-21 12:44:00 UTC (rev 8746)
+++ trunk/drivers/spi/spi_bfin5xx.c	2010-05-21 13:20:38 UTC (rev 8747)
@@ -504,6 +504,15 @@
 		"in dma_irq_handler dmastat:0x%x spistat:0x%x\n",
 		dmastat, spistat);
 
+	if (drv_data->rx != NULL) {
+		u16 cr = read_CTRL(drv_data);
+		/* discard old RX data and clear RXS */
+		bfin_spi_dummy_read(drv_data);
+		write_CTRL(drv_data, cr & ~BIT_CTL_ENABLE); /* Disable SPI */
+		write_CTRL(drv_data, cr & ~BIT_CTL_TIMOD); /* Restore State */
+		write_STAT(drv_data, BIT_STAT_CLR); /* Clear Status */
+	}
+
 	clear_dma_irqstat(drv_data->dma_channel);
 
 	/*
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to