All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH] ide-pmac: fix drive->init_speed reporting
Date: Sun, 22 Jul 2007 20:19:03 +0200	[thread overview]
Message-ID: <200707222019.03684.bzolnier@gmail.com> (raw)


pmac_ide_tune_chipset() don't set drive->init_speed.

Fix it by setting drive->{current,init}_speed in pmac_ide_do_setfeature()
and clean up pmac_ide_{tune_chipset,mdma_enable,udma_enable}().

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
Goes before "[PATCH] ide-pmac: PIO mode setup fixes (take 2)" patch
in the IDE quilt tree.

 drivers/ide/ppc/pmac.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Index: b/drivers/ide/ppc/pmac.c
===================================================================
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -602,6 +602,9 @@ out:
 				drive->id->dma_1word |= 0x0101; break;
 			default: break;
 		}
+		if (!drive->init_speed)
+			drive->init_speed = command;
+		drive->current_speed = command;
 	}
 	enable_irq(hwif->irq);
 	return result;
@@ -974,7 +977,6 @@ static int pmac_ide_tune_chipset(ide_dri
 		return ret;
 		
 	pmac_ide_do_update_timings(drive);	
-	drive->current_speed = speed;
 
 	return 0;
 }
@@ -1725,11 +1727,6 @@ pmac_ide_mdma_enable(ide_drive_t *drive,
 	/* Apply timings to controller */
 	*timings = timing_local[0];
 	*timings2 = timing_local[1];
-	
-	/* Set speed info in drive */
-	drive->current_speed = mode;	
-	if (!drive->init_speed)
-		drive->init_speed = mode;
 
 	return 1;
 }
@@ -1781,11 +1778,6 @@ pmac_ide_udma_enable(ide_drive_t *drive,
 	*timings = timing_local[0];
 	*timings2 = timing_local[1];
 
-	/* Set speed info in drive */
-	drive->current_speed = mode;	
-	if (!drive->init_speed)
-		drive->init_speed = mode;
-
 	return 1;
 }
 

             reply	other threads:[~2007-07-22 18:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-22 18:19 Bartlomiej Zolnierkiewicz [this message]
2007-07-22 21:50 ` [PATCH] ide-pmac: fix drive->init_speed reporting Benjamin Herrenschmidt
2007-07-23 21:20   ` Bartlomiej Zolnierkiewicz
2007-07-22 23:55 ` ide patches Benjamin Herrenschmidt
2007-07-23  1:21   ` Benjamin Herrenschmidt
2007-07-23  1:57     ` Benjamin Herrenschmidt
2007-07-23  2:01       ` Benjamin Herrenschmidt
2007-07-23 13:50         ` Sergei Shtylyov
2007-07-23 21:49           ` Benjamin Herrenschmidt
2007-07-23 21:22         ` Bartlomiej Zolnierkiewicz
2007-07-23 22:00           ` Benjamin Herrenschmidt
2007-07-29 10:48           ` Sergei Shtylyov
2007-07-29 14:39             ` Bartlomiej Zolnierkiewicz
2007-07-23 13:16       ` Sergei Shtylyov
2007-07-23 21:48         ` Benjamin Herrenschmidt
2007-07-23 22:06           ` Sergei Shtylyov
2007-07-23 22:08             ` Benjamin Herrenschmidt

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=200707222019.03684.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=benh@kernel.crashing.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 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.