as cinap noted, the previous patch was wrong. pass in the sector size instead of using 512. the Sfis already has a sector size, but it doesn't tell us which one we're using. this is not a problem for the nix version of the same code, so i'm going to ignore this ugly for now. /sys/src/9 should adopt the same code. Reference: /n/atom/patch/applied/pcahci4ks Date: Sat Jan 25 14:46:19 CET 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/9/pc/sdiahci.c Sat Jan 25 14:42:43 2014 +++ /sys/src/9/pc/sdiahci.c Sat Jan 25 14:42:43 2014 @@ -1507,7 +1507,7 @@ } static Alist* -ahcibuild(Aportm *m, int rw, void *data, uint n, vlong lba) +ahcibuild(Aportm *m, int rw, void *data, uint ss, uint n, vlong lba) { uchar *c; uint flags; @@ -1519,7 +1519,7 @@ flags = Lpref; if(rw == SDwrite) flags |= Lwrite; - mkalist(m, flags, data, n); + mkalist(m, flags, data, ss*n); return l; } @@ -1750,7 +1750,7 @@ if(n > max) n = max; qlock(&d->portm); - ahcibuild(&d->portm, rw, data, n*u->secsize, lba); + ahcibuild(&d->portm, rw, data, d->secsize, n, lba); status = io(d, Pdma, 5000, 0); qunlock(&d->portm); switch(status){