The SCSI mid-level takes a pessimistic view and assumes one of your
SCSI controllers is ISA. According to Rubini there is another issue.
That
GFP_DMA flag also guarantees that when you get more than PAGE_SIZE bytes
(32Kbytes for instance) then seen from the DMA chip's memory space it is
contiguous. So when you drop that flag, I believe you need to "walk"
the returned buffer and check it.
Perhaps people could comment on whether the following code is
appropriate
for that:
static int chk_cont(char * bvp, int sz)
{
int k;
unsigned long bus_addr = virt_to_bus(bvp);
for (k = PAGE_SIZE; k < sz; k += PAGE_SIZE) {
bus_addr += PAGE_SIZE;
bvp += PAGE_SIZE;
if (bus_addr != virt_to_bus(bvp))
break;
}
return (k >= sz) ? sz : k;
/* return (sz < PAGE_SIZE) ? sz : PAGE_SIZE; <<< testing */
}
Will non-contiguous allocation every occur on the i386 architecture?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/