From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH] ide: Fix ata_id_has_dword_io to return DWORD I/O support properly Date: Thu, 18 Dec 2008 20:24:56 +0300 Message-ID: <494A8768.4080100@ru.mvista.com> References: <494A5BBF.8000807@inf.tu-dresden.de> <494A837A.50801@garzik.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from h155.mvista.com ([63.81.120.155]:28315 "EHLO imap.sh.mvista.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751553AbYLRRY3 (ORCPT ); Thu, 18 Dec 2008 12:24:29 -0500 In-Reply-To: <494A837A.50801@garzik.org> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Jeff Garzik Cc: Mario Schwalbe , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, Linux IDE mailing list Hello. Jeff Garzik wrote: >> This patch fixes ata_id_has_dword_io to return 1 (supported) if >> the drive is compliant to ATA2 or newer and evaluates the config >> word for older drives. >> Signed-off-by: Mario Schwalbe >> diff --git a/include/linux/ata.h b/include/linux/ata.h >> index a53318b..d0d6a9c 100644 >> --- a/include/linux/ata.h >> +++ b/include/linux/ata.h >> @@ -700,12 +700,12 @@ static inline int ata_id_has_tpm(const u16 *id) >> static inline int ata_id_has_dword_io(const u16 *id) >> { >> - /* ATA 8 reuses this flag for "trusted" computing */ >> - if (ata_id_major_version(id) > 7) >> - return 0; >> - if (id[ATA_ID_DWORD_IO] & (1 << 0)) >> - return 1; >> - return 0; >> + /* This flag is defined up to ATA1 and deprecated since then >> + (ATA 8 reuses this flag for "trusted" computing). */ >> + if (ata_id_major_version(id) <= 1) >> + return (id[ATA_ID_DWORD_IO] & (1 << 0)) != 0; >> + /* later revision drives support DWORD I/O just fine */ >> + return 1; > This seems like a risky assumption... Not at all, I think. It's total mystery how "DWORD I/O" could've been even (not) supported by a *drive* at all. Support of "DWORD I/O" is a property of the PATA controller. Frankly speaking, I don't think that this function is at all useful... > Jeff MBR, Sergei