From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Lu Subject: [PATCH] libata: fix ata_dma_enabled Date: Mon, 03 Dec 2012 09:04:20 +0800 Message-ID: <50BBFA94.2070105@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com ([192.55.52.88]:11571 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754280Ab2LCBEB (ORCPT ); Sun, 2 Dec 2012 20:04:01 -0500 Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Jeff Garzik Cc: Borislav Petkov , Dutra Julio , Phillip Wood , Tejun Heo , Alan Cox , Szymon Janc , Bernd Buschinski , linux-ide@vger.kernel.org ata_dma_enabled should check if device is either using multi word DMA or ultra DMA instead of checking 0xff, as dma_mode 0 is not a valid dma mode either. This patch fixes the following bug: https://bugzilla.kernel.org/show_bug.cgi?id=49151 Reported-by: Phillip Wood Signed-off-by: Aaron Lu Tested-by: Dutra Julio Tested-by: Szymon Janc Tested-by: Bernd Buschinski Cc: --- include/linux/libata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/libata.h b/include/linux/libata.h index 77eeeda..2444695 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1617,7 +1617,7 @@ static inline int ata_using_udma(struct ata_device *adev) static inline int ata_dma_enabled(struct ata_device *adev) { - return (adev->dma_mode == 0xFF ? 0 : 1); + return ata_using_mwdma(adev) || ata_using_udma(adev); } /************************************************************************** -- 1.8.0.1.2.gd1eded4