Skip to contentSkip to conversation

MIPS and pci_alloc_consistent()?

DISCUSSION Shuanglin Wang 2 participants 2 messages Oct 9, 2001 – Oct 10, 2001 MIPS

lore
Share & tools
lore
#0 lore raw

I tried to use the pci_alloc_consistent() to allocate one-page DMA'able memory for my device driver. But, when booting up the system, it was always failed to execute the pci_alloc_consistent() by showing some memory errors.

I traced the code to the function __alloc_page() in the file mm/page_alloc.c, and found the system called "wakeup_kswapd()". But at that time, the kswapd process pointer is a NULL pointer and the wakeup-related codes don't check the pointer is NULL or not, so the system was stopped because of dereferencing the null pointer.

I'm working on a MIPS SEAD-2 board using Linux kernel 2.4.3 MIPS distrinution.
Anybody has some ideas about the problem? Or are there other convenient methods to allocate DMA'able memory?

Thanks,

--
Shuanglin Wang
Atmel Multimedia & Communications
3800 Gateway Centre, Suite 311
Morrisville, NC 27560

#1 lore raw
Quoted 10 lines · Shuanglin Wang

I tried to use the pci_alloc_consistent() to allocate one-page DMA'able memory for my device driver. But, when booting up the system, it was always failed to execute the pci_alloc_consistent() by showing some memory errors.

I traced the code to the function __alloc_page() in the file mm/page_alloc.c, and found the system called "wakeup_kswapd()". But at that time, the kswapd process pointer is a NULL pointer and the wakeup-related codes don't check the pointer is NULL or not, so the system was stopped because of dereferencing the null pointer.

This sounds like either memory corruption has overwritten the kernel pointer or you're trying to use pci_alloc_consistent before the memory managment is initialized.

Quoted 2 lines

Anybody has some ideas about the problem? Or are there other convenient methods to allocate DMA'able memory?

Anything else than the pci_alloc_* functions isn't portable.

Ralf