Skip to contentSkip to conversation

pmd_alloc() usage incorrect?

DISCUSSION Grant Grundler 2 participants 2 messages Oct 9, 2005 – Oct 10, 2005

lore
Share & tools
lore
#0 lore raw

Hi,
I stumbled across what looks like incorrect code in arch/ppc/kernel/dma-mapping.c:

static int __init dma_alloc_init(void)
{
...

        do {
                pgd = pgd_offset(&init_mm, CONSISTENT_BASE);
                pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE);
                if (!pmd) {

...

Doesn't pmd_alloc() want a pud_t * for the second parameter? ie also need to call pud_alloc() or the equivalent.

I've very little clue how this works...just looking at different bits of code in my quest to understand it well enough to enable USE_HPPA_IOREMAP in include/asm-parisc/io.h.

ciao,
grant

#1 lore raw
Quoted 11 lines · Grant Grundler

Hi,
I stumbled across what looks like incorrect code in arch/ppc/kernel/dma-mapping.c:

static int __init dma_alloc_init(void)
{
...

        do {
                pgd = pgd_offset(&init_mm, CONSISTENT_BASE);
                pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE);
                if (!pmd) {
Quoted 8 lines

...

Doesn't pmd_alloc() want a pud_t * for the second parameter? ie also need to call pud_alloc() or the equivalent.

I've very little clue how this works...just looking at different bits of code in my quest to understand it well enough to enable USE_HPPA_IOREMAP in include/asm-parisc/io.h.

In theory you are right... However, ppc32 uses a 2 level page tables, so this doesn't matter, pud is folded into pgd (and pmd too in fact, you probably don't need it neither). It would still be nicer to do the full conversion to pud types though.

Ben.