From 84b8be31d0c9c613d3c98e8db58dd5861ae58cac Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 12 Feb 2012 04:02:33 +0100 Subject: [PATCH] sdide: fix lba48 transition bug --- sys/src/9/pc/sdide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/src/9/pc/sdide.c b/sys/src/9/pc/sdide.c index d70b06a1f..58a86b8af 100644 --- a/sys/src/9/pc/sdide.c +++ b/sys/src/9/pc/sdide.c @@ -1275,7 +1275,7 @@ static uchar cmd48[256] = { }; enum{ - Last28 = (1<<28) - 1 - 1, + Last28 = (1<<28) - 1, }; static int @@ -1286,7 +1286,7 @@ atageniostart(Drive* drive, uvlong lba) int as, c, cmdport, ctlport, h, len, s, use48; use48 = 0; - if((drive->flags&Lba48always) || lba > Last28 || drive->count > 256){ + if((drive->flags&Lba48always) || (lba+drive->count) > Last28 || drive->count > 256){ if((drive->feat & Dllba) == 0) return -1; use48 = 1;