linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: linux-ide@vger.kernel.org, jeff@garzik.org, davem@davemloft.net
Subject: [PATCH 1/6] pata_via: Blacklist some combinations of Transcend Flash and via
Date: Mon, 30 Nov 2009 13:22:43 +0000	[thread overview]
Message-ID: <20091130132243.27236.69356.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091130132005.27236.77890.stgit@localhost.localdomain>

Reported by Mikulas Patocka.

VIA VT82C586B + Transcend TS64GSSD25-M v0826 does not work in UDMA mode

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/ata/pata_via.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)


diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 520d5a3..78eac27 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -337,6 +337,32 @@ static void via_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 }
 
 /**
+ *	via_mode_filter		-	filter buggy device/mode pairs
+ *	@dev: ATA device
+ *	@mask: Mode bitmask
+ *
+ *	We need to apply some minimal filtering for old controllers and at least
+ *	one breed of Transcend SSD. Return the updated mask.
+ */
+
+static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask)
+{
+	struct ata_host *host = dev->link->ap->host;
+	const struct via_isa_bridge *config = host->private_data;
+	unsigned char model_num[ATA_ID_PROD_LEN + 1];
+
+	if (config->id == PCI_DEVICE_ID_VIA_82C586_0) {
+		ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
+		if (strcmp(model_num, "TS64GSSD25-M") == 0) {
+			ata_dev_printk(dev, KERN_WARNING,
+	"disabling UDMA mode due to reported lockups with this device.\n");
+			mask &= ~ ATA_MASK_UDMA;
+		}
+	}
+	return ata_bmdma_mode_filter(dev, mask);
+}
+
+/**
  *	via_tf_load - send taskfile registers to host controller
  *	@ap: Port to which output is sent
  *	@tf: ATA taskfile register set
@@ -427,6 +453,7 @@ static struct ata_port_operations via_port_ops = {
 	.prereset	= via_pre_reset,
 	.sff_tf_load	= via_tf_load,
 	.port_start	= via_port_start,
+	.mode_filter	= via_mode_filter,
 };
 
 static struct ata_port_operations via_port_ops_noirq = {


  reply	other threads:[~2009-11-30 13:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 13:22 [PATCH 0/6] ATA driver updates Alan Cox
2009-11-30 13:22 ` Alan Cox [this message]
2009-11-30 13:22 ` [PATCH 2/6] pata_sis: Implement MWDMA for the UDMA 133 capable chips Alan Cox
2009-12-07 13:26   ` Sergei Shtylyov
2009-12-07 15:05     ` Bartlomiej Zolnierkiewicz
2009-12-07 15:11       ` Bartlomiej Zolnierkiewicz
2009-12-07 15:36       ` Bartlomiej Zolnierkiewicz
2009-12-07 15:53         ` Bartlomiej Zolnierkiewicz
2009-12-07 16:34       ` Bartlomiej Zolnierkiewicz
2009-12-07 17:53         ` Alan Cox
2009-12-07 18:36           ` Bartlomiej Zolnierkiewicz
2009-11-30 13:22 ` [PATCH 3/6] cmd64x: implement serialization as per notes Alan Cox
2009-11-30 13:23 ` [PATCH 4/6] pata: Update experimental tags Alan Cox
2009-11-30 13:23 ` [PATCH 5/6] pata_ali: Fix regression with old devices Alan Cox
2009-11-30 13:23 ` [PATCH 6/6] pata_piccolo: Driver for old Toshiba chipsets Alan Cox
2009-12-03  7:36   ` Jeff Garzik
2009-12-03  9:10     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091130132243.27236.69356.stgit@localhost.localdomain \
    --to=alan@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).