Hi, On Wed, Sep 21, 2011 at 15:06:29, Aníbal Almeida Pinto wrote: > 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 >
I see that during module removal, the driver is not doing the following: edma_free_channel(dspi->dma.tx_channel); edma_free_channel(dspi->dma.rx_channel); edma_free_slot(dspi->dma.dummy_param_slot); Even after adding the above lines, I was not able to do the insmod again because for me, the m25p80 device was already registered. I am not sure whether you are using the same interface. If yes, you need to figure out how to handle that. Thanks, Sudhakar _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
