mtd_dataflash cause udev hang

Samba Siva Reddy A sambasiva.a at siennaecad.com
Tue Jun 25 07:21:28 EDT 2013


Hi,

I am working on the at91sam9x5 boards. I added the DataFLash partitions
on board-sam9x5.c file.

It hangs while booting up the board after Starting udev message and
after that getting the following messages.

Starting udev

udevd (672): /proc/672/oom_adj is deprecated, please use

/proc/672/oom_score_adj

instead.

then these traces come out.

udevd[672]: worker [688] unexpectedly returned with status 0x0100

udevd[672]: worker [688] failed while handling

'/devices/virtual/block/loop0'

udevd[672]: worker [691] unexpectedly returned with status 0x0100

udevd[672]: worker [691] failed while handling

'/devices/virtual/block/loop1'

udevd[672]: worker [692] unexpectedly returned with status 0x0100


1.  Enable and ported the DMA Engine code from 2.6.39 kernel to

      3.2.6 kernel.


2. Added the below code snippet for avoiding the stack overflow

   while writing data to the dataFlash. I attached the file for your

   reference.


   static void *adjust_buffer_location(struct device *dev, void *buf) {

          if (likely(buf < high_memory)) {

           return buf;

           }

           else

           {

                   struct page *pg;

   

                   pg = vmalloc_to_page(buf);

                   if (pg == 0)

                   {

                           dev_err(dev, "failed to vmalloc_to_page\n");

   return NULL;

                   }

           return page_address(pg) + ((size_t)buf & ~PAGE_MASK);

           }

   }

   

   static int

   atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer) {

   

   

       ptr = adjust_buffer_location(dev,(void *)xfer->tx_buf);

                   if(ptr)

                   xfer->tx_dma = dma_map_single(dev,

                                   ptr, xfer->len,

                                   DMA_TO_DEVICE);

                   if (dma_mapping_error(dev, xfer->tx_dma))

                           return -ENOMEM;

           }

           if (xfer->rx_buf) {

                   ptr=adjust_buffer_location(dev, xfer->rx_buf);

                   if(ptr)

                   xfer->rx_dma = dma_map_single(dev,

                                   ptr, xfer->len,

                                   DMA_FROM_DEVICE);

   

   }

Could you please help any one on this issue.

Regards
Samba




More information about the linux-mtd mailing list