All of lore.kernel.org
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: hancockr@shaw.ca, alan@lxorguk.ukuu.org.uk, jeff@garzik.org
Subject: + libata-warn-if-speed-limited-due-to-40-wire-cable.patch added to -mm tree
Date: Mon, 12 Feb 2007 21:16:15 -0800	[thread overview]
Message-ID: <200702130516.l1D5GFSL022429@shell0.pdx.osdl.net> (raw)


The patch titled
     libata: warn if speed limited due to 40-wire cable
has been added to the -mm tree.  Its filename is
     libata-warn-if-speed-limited-due-to-40-wire-cable.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: libata: warn if speed limited due to 40-wire cable
From: Robert Hancock <hancockr@shaw.ca>

Print an explicit warning when a device's UDMA mode is limited due to a
40-wire cable being detected, so that users have some idea why their device
isn't running as fast as it should.

This moves the application of the drive's mode masks before the cable rule,
so that can tell whether the rate is being limited by the cable and not the
drive or controller.

I haven't tested whether the message actually shows up, as my system isn't
horked in this manner..

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/ata/libata-core.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff -puN drivers/ata/libata-core.c~libata-warn-if-speed-limited-due-to-40-wire-cable drivers/ata/libata-core.c
--- a/drivers/ata/libata-core.c~libata-warn-if-speed-limited-due-to-40-wire-cable
+++ a/drivers/ata/libata-core.c
@@ -3319,22 +3319,24 @@ static void ata_dev_xfermask(struct ata_
 	xfer_mask = ata_pack_xfermask(ap->pio_mask,
 				      ap->mwdma_mask, ap->udma_mask);
 
+	/* drive modes available */
+	xfer_mask &= ata_pack_xfermask(dev->pio_mask,
+				       dev->mwdma_mask, dev->udma_mask);
+	xfer_mask &= ata_id_xfermask(dev->id);
+
 	/* Apply cable rule here.  Don't apply it early because when
 	 * we handle hot plug the cable type can itself change.
+	 * Unknown or 80 wire cables reported host side are checked
+	 * drive side as well. Cases where we know a 40wire cable
+	 * is used safely for 80 are not checked here.
 	 */
-	if (ap->cbl == ATA_CBL_PATA40)
-		xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA);
-	/* Apply drive side cable rule. Unknown or 80 pin cables reported
-	 * host side are checked drive side as well. Cases where we know a
-	 * 40wire cable is used safely for 80 are not checked here.
-	 */
-        if (ata_drive_40wire(dev->id) && (ap->cbl == ATA_CBL_PATA_UNK || ap->cbl == ATA_CBL_PATA80))
+	if ((xfer_mask & (0xF8 << ATA_SHIFT_UDMA)) &&
+	    ((ap->cbl == ATA_CBL_PATA40) ||
+	     (ata_drive_40wire(dev->id) &&
+	      (ap->cbl == ATA_CBL_PATA_UNK || ap->cbl == ATA_CBL_PATA80)))) {
+	      	ata_dev_printk(dev, KERN_WARNING, "limited to UDMA2 due to 40-wire cable\n");
 		xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA);
-
-
-	xfer_mask &= ata_pack_xfermask(dev->pio_mask,
-				       dev->mwdma_mask, dev->udma_mask);
-	xfer_mask &= ata_id_xfermask(dev->id);
+	}
 
 	/*
 	 *	CFA Advanced TrueIDE timings are not allowed on a shared
_

Patches currently in -mm which might be from hancockr@shaw.ca are

origin.patch
libata-warn-if-speed-limited-due-to-40-wire-cable.patch

                 reply	other threads:[~2007-02-13  5:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200702130516.l1D5GFSL022429@shell0.pdx.osdl.net \
    --to=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hancockr@shaw.ca \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@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.