Re: [PATCH] Drop ISA dependencies from IRDA drivers

From: Martin Diehl
Date: Fri Jul 16 2004 - 01:14:13 EST


On 16 Jul 2004, Andi Kleen wrote:

> > Admittedly I haven't tried either, but I'm pretty sure this patch will
> > break building those drivers because they are calling irda_setup_dma -
> > which is CONFIG_ISA. Maybe this can be dropped but I don't see what's
> > wrong with !64BIT instead.
>
> Hmm, good point.
>
> !64BIT is not needed - apparently they are 64bit clean.

I think you are right - however, AFAICS this is not the point in this
case. These drivers do DMA to legacy devices (call it ISA, LPC, whatever).
The documented way for those devices without struct pci_dev is to call the
dma api functions with dev=NULL. For i386 the generic dma functions are
overwritten so they use GFP_DMA f.e. in this case.

According to include/asm-x86_64/dma-mapping.h there is no such override
for x86-64. Hence the generic implementation is used which Oopses when
called with dev=NULL in dma_alloc_coherent because it dereferences dev
unconditionally.

> The reason I want to drop the CONFIG_ISA depency is that they *should*
> be built on x86-64 too.

Yes, sure. The point is with current CONFIG_ISA requirement they cannot be
build on x86-64 - with CONFIG_ISA removed they can, but will Oops. See the
report Jean was refering to.

I agree !64BIT isn't the clean way to handle this - IMHO x86-64 needs to
support legacy devices (dev=NULL) in its dma api implementation. If it
doesn't, I don't see how these drivers might work on this arch.

Martin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/