Could be done.. but, I don't want to constrain the ADMA APRD/CPB area in
that way (there are some dual-socket Opteron boxes with this controller,
forcing an allocation below 4GB for this could force a non-optimal node
allocation I think..) To do this I'd have to raise the mask for the APRD
allocation, drop it again, then raise it again in ADMA mode, which is
kind of ugly.
I don't think it really matters. The table isn't too big and it's not
like access to the table has any processor locality. Maybe it's better
to allocate to the same node as the irq but raising DMA mask doesn't
help at all.
I think performance impact is nil either way but even in highly unlikely
case it has any impact, allocating PRDs under 4G should be better as it
avoids DAC cycles on the bus. But again, this is just irrelevant.
I'd say just allocate everything under 4G.
Also, I'd rather not allocate the legacy PRD at all if we're in ADMA
mode. That way, if some bug causes us to try and do legacy DMA in ADMA
mode, we'll crash from null pointer dereference instead of potentially
transferring incorrect data (as we had in this case) and corrupting things.
Yeap, I can agree with this. But can you add BUG_ON()/WARN_ON() at
places instead? I know blanking pointers feel safer but I think it's
best to keep resource allocation / release in ->port_start/stop().