Em 21-09-2011 09:38, Rajashekhara, Sudhakar escreveu:
Hi,

On Wed, Aug 31, 2011 at 17:47:43, Aníbal Almeida Pinto wrote:
Hi,

I am using the OMAP L138 logic evaluation board with 3.0.0 linux-davinci
kernel.

To the default configuration I have added spi support and build the
spi_davinci as a module.

After the boards boot I was able to insmod davinci_spi.ko but when tried
to make rmmod davinci_spi.ko the board halted.

Anyone have reported this ?

Inserting printk on davinci_spi remove function it appears to be on
clk_disable.


I also noticed this issue. When I debugged this I found out that, the
SPI driver enables the local low-power mode. This is achieved by setting
the POWERDOWN bit (9th bit) in SPIGCR1 register.

In local low-power mode, clock to SPI internal logic is stopped. At this
point of time, doing a clk_disable() is not behaving properly. When SPI
is not in low-power mode, clk_disable() works fine. So for rmmod to work,
you need to remove all references to SPIGCR1_POWERDOWN_MASK in the code.

Please test this at your end and let me know the outcome. If it is working,
then I can submit a patch to the list which takes care of this.

If I apply the patch attached I can make rmmod of the spi davinci driver.

The procedure that I have tested :

# insmod davinci_spi.ko
spi_davinci spi_davinci.1: DMA: supported
spi_davinci spi_davinci.1: DMA: RX channel: 18, TX channel: 19, event queue: 0
spi_davinci spi_davinci.1: Controller at 0xfef0e000

# rmmod davinci_spi.ko

But can't insmod it again :

# insmod davinci_spi.ko
Unable to request DMA channel for SPI RX
Trying to free nonexistent resource <0000000001f0e000-0000000001f0e000>
spi_davinci: probe of spi_davinci.1 failed with error -11
insmod: can't insert 'davinci_spi.ko': No such device



Thanks,
Sudhakar



554c554
< //	clear_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
---
> 	clear_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
705c705
< //	set_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
---
> 	set_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
947c947
< //	set_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
---
> 	set_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK);
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to