All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: "Tobias Müller" <Tobias_Mueller@twam.info>
Cc: linux-ide@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: 40-wire cable detected when directly connected
Date: Sat, 12 Jan 2008 12:26:48 +0900	[thread overview]
Message-ID: <47883378.9060507@gmail.com> (raw)
In-Reply-To: <47875755.4000109@twam.info>

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

[cc'ing Alan, thanks for the information on the other message]

Tobias Müller wrote:
> Tejun Heo schrieb:
>> I don't know very well about CF but does it even fill UDMA/33?  What
>> does 'dd if=/dev/sdc of=/dev/null bs=1M count=16 iflag=direct' say?  You
>> can increase count for more reliable result.
> 
> 16+0 Datensätze ein
> 16+0 Datensätze aus
> 16777216 Bytes (17 MB) kopiert, 0,561688 s, 29,9 MB/s

Hmmm... yeah, it almost fills UDMA/33.  I wonder whether it would go higher.

> And hdparm -I /dev/sdc says it should be compatible to udma5.
> 
>         DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4

Please apply the attached patch and specify libata.force_cbl=80 as
kernel boot parameter.  If you load libata from initrd or after boot you
need to pass 'force_cbl=80' as module parameter.  How you do it depends
on your distro.

Thanks.

-- 
tejun

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2180 bytes --]

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4753a18..8c93878 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -119,6 +119,10 @@ int libata_noacpi = 0;
 module_param_named(noacpi, libata_noacpi, int, 0444);
 MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in probe/suspend/resume when set");
 
+int libata_force_cbl = 0;
+module_param_named(force_cbl, libata_force_cbl, int, 0644);
+MODULE_PARM_DESC(force_cbl, "force PATA cable type (0=keep, 40=40c, 80=80c)");
+
 MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("Library module for ATA devices");
 MODULE_LICENSE("GPL");
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 21a81cd..7e53215 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2296,9 +2296,27 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
 
 	/* PDIAG- should have been released, ask cable type if post-reset */
 	if (ata_is_host_link(link) && ap->ops->cable_detect &&
-	    (ehc->i.flags & ATA_EHI_DID_RESET))
+	    (ehc->i.flags & ATA_EHI_DID_RESET)) {
 		ap->cbl = ap->ops->cable_detect(ap);
 
+		if (!(ap->flags & ATA_FLAG_SATA) && libata_force_cbl) {
+			switch (libata_force_cbl) {
+			case 40:
+				ata_port_printk(ap, KERN_INFO, "forcing 40c\n");
+				ap->cbl = ATA_CBL_PATA40;
+				break;
+			case 80:
+				ata_port_printk(ap, KERN_INFO, "forcing 80c\n");
+				ap->cbl = ATA_CBL_PATA80;
+				break;
+			default:
+				ata_port_printk(ap, KERN_WARNING,
+						"invalid force_cbl value %d\n",
+						libata_force_cbl);
+			}
+		}
+	}
+
 	/* Configure new devices forward such that user doesn't see
 	 * device detection messages backwards.
 	 */
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index bbe59c2..b990a8d 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -60,6 +60,7 @@ extern int atapi_dmadir;
 extern int atapi_passthru16;
 extern int libata_fua;
 extern int libata_noacpi;
+extern int libata_force_cbl;
 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
 extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
 			   u64 block, u32 n_block, unsigned int tf_flags,

  reply	other threads:[~2008-01-12  3:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 17:24 40-wire cable detected when directly connected Tobias Müller
2008-01-11  3:53 ` Tejun Heo
2008-01-11 11:47   ` Tobias Müller
2008-01-12  3:26     ` Tejun Heo [this message]
2008-01-12 13:40       ` Tobias Müller
2008-01-13  6:06         ` Tejun Heo
2008-01-12 14:38     ` Bartlomiej Zolnierkiewicz
2008-01-12 14:29       ` Tobias Müller
2008-01-12 16:09         ` Bartlomiej Zolnierkiewicz
2008-01-12 16:14           ` Bartlomiej Zolnierkiewicz
2008-01-12 16:22           ` Tobias Müller
2008-01-12 17:23           ` Tobias Müller
2008-01-11 13:56   ` Alan Cox

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=47883378.9060507@gmail.com \
    --to=htejun@gmail.com \
    --cc=Tobias_Mueller@twam.info \
    --cc=alan@lxorguk.ukuu.org.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.