Re: [RFT][PATCH] generic device DMA implementation

James Bottomley (James.Bottomley@SteelEye.com)
Fri, 27 Dec 2002 15:47:30 -0600


david-b@pacbell.net said:
> - DMA mapping calls still return no errors; so BUG() out instead?

That's actually an open question. The line of least resistance (which is what
I followed) is to do what the pci_ API does (i.e. BUG()).

It's not clear to me that adding error returns rather than BUGging would buy
us anything (because now all the drivers have to know about the errors and
process them).

> Consider systems where DMA-able memory is limited (like SA-1111,
> to 1 MByte); clearly it should be possible for these calls to
> fail, when they can't allocate a bounce buffer. Or (see below)
> when an invalid argument is provided to a dma mapping call.

That's pretty much an edge case. I'm not opposed to putting edge cases in the
api (I did it for dma_alloc_noncoherent() to help parisc), but I don't think
the main line should be affected unless there's a good case for it.

Perhaps there is a compromise where the driver flags in the struct
device_driver that it wants error returns otherwise it takes the default
behaviour (i.e. no error return checking and BUG if there's a problem).

James

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