From patchwork Thu Nov 5 01:25:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 37717 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id A0560B7B9B for ; Thu, 5 Nov 2009 12:25:32 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758422AbZKEBZZ (ORCPT ); Wed, 4 Nov 2009 20:25:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758424AbZKEBZZ (ORCPT ); Wed, 4 Nov 2009 20:25:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35026 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758417AbZKEBZY (ORCPT ); Wed, 4 Nov 2009 20:25:24 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nA51PM7b020062; Wed, 4 Nov 2009 20:25:22 -0500 Received: from hs20-bc2-1.build.redhat.com (hs20-bc2-1.build.redhat.com [10.10.28.34]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nA51PLVM020831 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Nov 2009 20:25:22 -0500 Received: from hs20-bc2-1.build.redhat.com (localhost.localdomain [127.0.0.1]) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1) with ESMTP id nA51PLk8022375; Wed, 4 Nov 2009 20:25:21 -0500 Received: from localhost (mpatocka@localhost) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1/Submit) with ESMTP id nA51PLAr022369; Wed, 4 Nov 2009 20:25:21 -0500 X-Authentication-Warning: hs20-bc2-1.build.redhat.com: mpatocka owned process doing -bs Date: Wed, 4 Nov 2009 20:25:21 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@hs20-bc2-1.build.redhat.com To: David Miller cc: linux-ide@vger.kernel.org, Alan Cox Subject: [PATCH] Don't use UDMA on VIA UDMA33 controller with Transcend SSD In-Reply-To: <20091026121804.3789c4c0@lxorguk.ukuu.org.uk> Message-ID: References: <200910221144.04471.bzolnier@gmail.com> <200910231644.29919.bzolnier@gmail.com> <20091023175157.3a898525@lxorguk.ukuu.org.uk> <4AE1E78A.2090801@ru.mvista.com> <20091023192250.600edc9b@lxorguk.ukuu.org.uk> <20091026121804.3789c4c0@lxorguk.ukuu.org.uk> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Hi Here is another patch for SSD for VIA UDMA33. Alan, please backport it into libata. Mikulas --- Don't use UDMA on VIA UDMA33 controller with Transcend SSD The computer locks up if Transcend SSD runs in any of UDMA modes. It doesn't lockup with different brand SSD, so this is specific to Transcend. Signed-off-by: Mikulas Patocka --- drivers/ide/via82cxxx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6.31.5-fast/drivers/ide/via82cxxx.c =================================================================== --- linux-2.6.31.5-fast.orig/drivers/ide/via82cxxx.c 2009-05-29 22:36:58.000000000 +0200 +++ linux-2.6.31.5-fast/drivers/ide/via82cxxx.c 2009-11-04 22:32:55.000000000 +0100 @@ -195,6 +195,21 @@ static void via_set_pio_mode(ide_drive_t via_set_drive(drive, XFER_PIO_0 + pio); } +static u8 via_udma_filter(ide_drive_t *drive) +{ + char *m = (char *)&drive->id[ATA_ID_PROD]; + + /* + * Restrict UDMA for Transcend flash cards. + * On VIA 33, UDMA locks up. On VIA 133, it works. I can't test other + * controllers. + */ + if (!memcmp(m, "TS", 2) && drive->hwif->ultra_mask == ATA_UDMA2) + return 0; + + return drive->hwif->ultra_mask; +} + static struct via_isa_bridge *via_config_find(struct pci_dev **isa) { struct via_isa_bridge *via_config; @@ -372,6 +387,7 @@ static const struct ide_port_ops via_por .set_pio_mode = via_set_pio_mode, .set_dma_mode = via_set_drive, .cable_detect = via82cxxx_cable_detect, + .udma_filter = via_udma_filter, }; static const struct ide_port_info via82cxxx_chipset __devinitdata = {