From: Lennert Buytenhek Date: Mon, 29 Jan 2007 12:28:47 +0000 (+0100) Subject: ata_if_xfermask() word 51 fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7a0f1c8a4b1052da7efc7715e2e557255b632712;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ata_if_xfermask() word 51 fix If word 53 bit 1 isn't set, the maximum PIO mode is indicated by the upper 8 bits of word 51, not the lower 8 bits. Fixes PIO mode detection on old Compact Flash cards. Signed-off-by: Lennert Buytenhek Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index a388a8df0043..cf707029352e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -1037,7 +1037,7 @@ static unsigned int ata_id_xfermask(const u16 *id) * the PIO timing number for the maximum. Turn it into * a mask. */ - u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; + u8 mode = (id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF; if (mode < 5) /* Valid PIO range */ pio_mask = (2 << mode) - 1; else