[PATCH 2/2] Revert "Revert "ide: try to use PIO Mode 0 during probe if possible""

Previous thread: [PATCH] Include hrtimer.h for ANSI compliance by Thomas DuBuisson on Tuesday, October 6, 2009 - 3:20 pm. (2 messages)

Next thread: [PATCH 0/2] two ide fixes for -rc4 by Bartlomiej Zolnierkiewicz on Tuesday, October 6, 2009 - 3:27 pm. (5 messages)
From: Bartlomiej Zolnierkiewicz
Date: Tuesday, October 6, 2009 - 3:27 pm

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] Revert "Revert "ide: try to use PIO Mode 0 during probe if possible""

This reverts commit 24df31acaff8465d797f0006437b45ad0f2a5cb1.

The root cause of reported system hangs was (now fixed) sis5513 bug
and not "ide: try to use PIO Mode 0 during probe if possible" change
(commit 6029336426a2b43e4bc6f4a84be8789a047d139e) so the revert was
incorrect (it simply replaced one regression with the other one).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Ramos <joao.ramos@inov.pt>
Cc: David Fries <david@fries.net>
Cc: d.stussy@yahoo.com
---
 drivers/ide/ide-probe.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 4d76ba4..63c53d6 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1046,6 +1046,15 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
 		if (port_ops && port_ops->init_dev)
 			port_ops->init_dev(drive);
 	}
+
+	ide_port_for_each_dev(i, drive, hwif) {
+		/*
+		 * default to PIO Mode 0 before we figure out
+		 * the most suited mode for the attached device
+		 */
+		if (port_ops && port_ops->set_pio_mode)
+			port_ops->set_pio_mode(drive, 0);
+	}
 }
 
 static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
-- 
1.6.5.rc2

--

From: David Miller
Date: Tuesday, October 6, 2009 - 3:41 pm

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

What is this older "regression" fixed by the PIO-0 change?

You're not explaining it and neither does the commit message for the
PIO-0 change.

Please, fill us in :-)
--

From: Bartlomiej Zolnierkiewicz
Date: Tuesday, October 6, 2009 - 3:52 pm

It does:

| Subject: [PATCH] sis5513: fix PIO setup for ATAPI devices
| 
| Clear prefetch setting before potentially (re-)enabling it in
| config_drive_art_rwp() so the transition of the device type on
| the port from ATA to ATAPI (i.e. during warm-plug operation)
| is handled correctly.


Just connect the dots.. :)
--

From: David Miller
Date: Tuesday, October 6, 2009 - 3:57 pm

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Sorry, I wasn't clear.

I'm talking about commit 6029336426a2b43e4bc6f4a84be8789a047d139e, it
doesn't say why we want to try PIO 0 mode during probe.

What was the regression fixed by that change?

--

From: Bartlomiej Zolnierkiewicz
Date: Tuesday, October 6, 2009 - 4:13 pm

For the same reason that libata wants it.

Many embedded controllers/platforms will have junk PIO timings set initially.

Now that your manager's ambition is satisfied could you please go help
some other subsystem for the moment so we can fix ide in the meantime? :)
--

From: David Miller
Date: Tuesday, October 6, 2009 - 4:34 pm

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Thanks, that helps a lot.

When David reports back on testing I'll push this stuff around
and queue up patch #1 for -stable.
--

Previous thread: [PATCH] Include hrtimer.h for ANSI compliance by Thomas DuBuisson on Tuesday, October 6, 2009 - 3:20 pm. (2 messages)

Next thread: [PATCH 0/2] two ide fixes for -rc4 by Bartlomiej Zolnierkiewicz on Tuesday, October 6, 2009 - 3:27 pm. (5 messages)