login
Header Space

 
 

Re: [ata crash] Re: Linux 2.6.25-rc1

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>, Mark Lord <mlord@...>, Jeff Garzik <jeff@...>, Alan Cox <alan@...>
Date: Wednesday, February 13, 2008 - 5:51 am

Ingo Molnar wrote:

Does the following patch fix the above problem?  pata_isapnp is the
only one which can have NULL ctl_addr and libata SFF layer wasn't
ready for that.

Thanks.

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 4e31071..c6c04dc 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2150,6 +2150,15 @@ int ata_eh_reset(struct ata_link *link, int classify,
 			ap->ops->set_piomode(ap, dev);
 	}
 
+	if (!softreset && !hardreset) {
+		if (verbose)
+			ata_link_printk(link, KERN_INFO, "no reset method "
+					"available, skipping reset\n");
+		if (!(lflags & ATA_LFLAG_ASSUME_CLASS))
+			lflags |= ATA_LFLAG_ASSUME_ATA;
+		goto done;
+	}
+
 	/* Determine which reset to use and record in ehc->i.action.
 	 * prereset() may examine and modify it.
 	 */
@@ -2254,6 +2263,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
 		lflags |= ATA_LFLAG_ASSUME_ATA;
 	}
 
+ done:
 	ata_link_for_each_dev(dev, link) {
 		/* After the reset, the device state is PIO 0 and the
 		 * controller state is undefined.  Reset also wakes up
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 60cd4b1..93ea0db 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -56,7 +56,8 @@ u8 ata_irq_on(struct ata_port *ap)
 	ap->ctl &= ~ATA_NIEN;
 	ap->last_ctl = ap->ctl;
 
-	iowrite8(ap->ctl, ioaddr->ctl_addr);
+	if (ioaddr->ctl_addr)
+		iowrite8(ap->ctl, ioaddr->ctl_addr);
 	tmp = ata_wait_idle(ap);
 
 	ap->ops->irq_clear(ap);
@@ -81,7 +82,8 @@ void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
 	unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
 
 	if (tf->ctl != ap->last_ctl) {
-		iowrite8(tf->ctl, ioaddr->ctl_addr);
+		if (ioaddr->ctl_addr)
+			iowrite8(tf->ctl, ioaddr->ctl_addr);
 		ap->last_ctl = tf->ctl;
 		ata_wait_idle(ap);
 	}
@@ -167,13 +169,15 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
 	tf->device = ioread8(ioaddr->device_addr);
 
 	if (tf->flags & ATA_TFLAG_LBA48) {
-		iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
+		if (ioaddr->ctl_addr)
+			iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
 		tf->hob_feature = ioread8(ioaddr->error_addr);
 		tf->hob_nsect = ioread8(ioaddr->nsect_addr);
 		tf->hob_lbal = ioread8(ioaddr->lbal_addr);
 		tf->hob_lbam = ioread8(ioaddr->lbam_addr);
 		tf->hob_lbah = ioread8(ioaddr->lbah_addr);
-		iowrite8(tf->ctl, ioaddr->ctl_addr);
+		if (ioaddr->ctl_addr)
+			iowrite8(tf->ctl, ioaddr->ctl_addr);
 		ap->last_ctl = tf->ctl;
 	}
 }
@@ -352,7 +356,8 @@ void ata_bmdma_freeze(struct ata_port *ap)
 	ap->ctl |= ATA_NIEN;
 	ap->last_ctl = ap->ctl;
 
-	iowrite8(ap->ctl, ioaddr->ctl_addr);
+	if (ioaddr->ctl_addr)
+		iowrite8(ap->ctl, ioaddr->ctl_addr);
 
 	/* Under certain circumstances, some controllers raise IRQ on
 	 * ATA_NIEN manipulation.  Also, many controllers fail to mask
@@ -459,13 +464,14 @@ void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
  */
 void ata_bmdma_error_handler(struct ata_port *ap)
 {
-	ata_reset_fn_t hardreset;
+	ata_reset_fn_t softreset = NULL, hardreset = NULL;
 
-	hardreset = NULL;
+	if (ap->ioaddr.ctl_addr)
+		softreset = ata_std_softreset;
 	if (sata_scr_valid(&ap->link))
 		hardreset = sata_std_hardreset;
 
-	ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, hardreset,
+	ata_bmdma_drive_eh(ap, ata_std_prereset, softreset, hardreset,
 			   ata_std_postreset);
 }
 
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.25-rc1, Linus Torvalds, (Sun Feb 10, 8:44 pm)
[ata crash] Re: Linux 2.6.25-rc1, Ingo Molnar, (Tue Feb 12, 4:18 am)
Re: [ata crash] Re: Linux 2.6.25-rc1, Tejun Heo, (Wed Feb 13, 5:51 am)
Re: [ata crash] Re: Linux 2.6.25-rc1, Tejun Heo, (Wed Feb 20, 10:33 pm)
Re: [ata crash] Re: Linux 2.6.25-rc1, Ingo Molnar, (Thu Feb 21, 3:12 am)
Re: [ata crash] Re: Linux 2.6.25-rc1, Arjan van de Ven, (Tue Feb 12, 11:14 am)
Re: [ata crash] Re: Linux 2.6.25-rc1, Ingo Molnar, (Wed Feb 13, 5:01 am)
Re: Linux 2.6.25-rc1, Torsten Kaiser, (Mon Feb 11, 5:46 pm)
Re: Linux 2.6.25-rc1, Andrew Morton, (Mon Feb 11, 6:15 pm)
Re: Linux 2.6.25-rc1, Torsten Kaiser, (Wed Feb 13, 3:17 pm)
Re: Linux 2.6.25-rc1, Stefan Richter, (Mon Feb 11, 6:48 pm)
Re: Linux 2.6.25-rc1, Sam Ravnborg, (Mon Feb 11, 9:31 am)
[PATCH] kbuild: fix make V=1, Sam Ravnborg, (Mon Feb 11, 12:47 pm)
Re: [PATCH] kbuild: fix make V=1, Oleg Verych, (Mon Feb 11, 7:38 pm)
Re: [PATCH] kbuild: fix make V=1, Sam Ravnborg, (Tue Feb 12, 4:56 am)
Re: [PATCH] kbuild: fix make V=1, Oleg Verych, (Tue Feb 12, 5:25 am)
Re: [PATCH] kbuild: fix make V=1, Sam Ravnborg, (Tue Feb 12, 4:01 pm)
Re: [PATCH] kbuild: fix make V=1, Mike Frysinger, (Tue Feb 12, 11:07 am)
Re: [PATCH] kbuild: fix make V=1, Oleg Verych, (Tue Feb 12, 11:49 am)
Re: [PATCH] kbuild: fix make V=1, Mike Frysinger, (Tue Feb 12, 12:18 pm)
Re: [PATCH] kbuild: fix make V=1, Oleg Verych, (Tue Feb 12, 12:42 pm)
Re: Linux 2.6.25-rc1, Mike Frysinger, (Mon Feb 11, 12:17 pm)
parisc - error: 'VMALLOC_START' undeclared..., Domenico Andreoli, (Mon Feb 11, 7:19 am)
Re: parisc - error: 'VMALLOC_START' undeclared..., Adrian Bunk, (Mon Feb 11, 8:06 am)
Re: Linux 2.6.25-rc1, Brice Goglin, (Mon Feb 11, 3:39 am)
Re: Linux 2.6.25-rc1, Arjan van de Ven, (Mon Feb 11, 11:16 am)
Re: Linux 2.6.25-rc1, Gene Heskett, (Sun Feb 10, 11:14 pm)
Re: Linux 2.6.25-rc1 , syntax error near unexpected token `;', Mr. James W. Laferriere, (Sun Feb 10, 9:47 pm)
Re: Linux 2.6.25-rc1 , syntax error near unexpected token `;', Mr. James W. Laferriere, (Mon Feb 11, 11:37 pm)
Re: Linux 2.6.25-rc1, Sergio Luis, (Sun Feb 10, 9:36 pm)
speck-geostationary