Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 157326 | Differences between
and this patch

Collapse All | Expand All

(-)linuxorg/drivers/scsi/libata-core.c (-13 / +18 lines)
Lines 2271-2281 Link Here
2271
 *	Sleep until ATA Status register bit BSY clears,
2271
 *	Sleep until ATA Status register bit BSY clears,
2272
 *	or a timeout occurs.
2272
 *	or a timeout occurs.
2273
 *
2273
 *
2274
 *	LOCKING: None.
2274
 *     LOCKING:
2275
 *     Kernel thread context (may sleep).
2276
 *
2277
 *     RETURNS:
2278
 *     0 on success, -errno otherwise.
2275
 */
2279
 */
2276
2280
int ata_busy_sleep(struct ata_port *ap,
2277
unsigned int ata_busy_sleep (struct ata_port *ap,
2281
                  unsigned long tmout_pat, unsigned long tmout)
2278
			     unsigned long tmout_pat, unsigned long tmout)
2279
{
2282
{
2280
	unsigned long timer_start, timeout;
2283
	unsigned long timer_start, timeout;
2281
	u8 status;
2284
	u8 status;
Lines 2283-2307 Link Here
2283
	status = ata_busy_wait(ap, ATA_BUSY, 300);
2286
	status = ata_busy_wait(ap, ATA_BUSY, 300);
2284
	timer_start = jiffies;
2287
	timer_start = jiffies;
2285
	timeout = timer_start + tmout_pat;
2288
	timeout = timer_start + tmout_pat;
2286
	while ((status & ATA_BUSY) && (time_before(jiffies, timeout))) {
2289
        while (status != 0xff && (status & ATA_BUSY) &&
2290
               time_before(jiffies, timeout)) {
2287
		msleep(50);
2291
		msleep(50);
2288
		status = ata_busy_wait(ap, ATA_BUSY, 3);
2292
		status = ata_busy_wait(ap, ATA_BUSY, 3);
2289
	}
2293
	}
2290
2294
2291
	if (status & ATA_BUSY)
2295
        if (status != 0xff && (status & ATA_BUSY))
2292
		ata_port_printk(ap, KERN_WARNING,
2296
		ata_port_printk(ap, KERN_WARNING,
2293
				"port is slow to respond, please be patient\n");
2297
				"port is slow to respond, please be patient\n");
2294
2298
2295
	timeout = timer_start + tmout;
2299
	timeout = timer_start + tmout;
2296
	while ((status & ATA_BUSY) && (time_before(jiffies, timeout))) {
2300
	while (status != 0xff && (status & ATA_BUSY) &&
2297
		msleep(50);
2301
	       time_before(jiffies, timeout)) {
2298
		status = ata_chk_status(ap);
2302
		status = ata_chk_status(ap);
2299
	}
2303
	}
2300
2304
2305
        if (status == 0xff)
2306
               return -ENODEV;
2307
2301
	if (status & ATA_BUSY) {
2308
	if (status & ATA_BUSY) {
2302
		ata_port_printk(ap, KERN_ERR, "port failed to respond "
2309
		ata_port_printk(ap, KERN_ERR, "port failed to respond "
2303
				"(%lu secs)\n", tmout / HZ);
2310
				"(%lu secs)\n", tmout / HZ);
2304
		return 1;
2311
		return -EBUSY;
2305
	}
2312
	}
2306
2313
2307
	return 0;
2314
	return 0;
Lines 2392-2401 Link Here
2392
	 * the bus shows 0xFF because the odd clown forgets the D7
2399
	 * the bus shows 0xFF because the odd clown forgets the D7
2393
	 * pulldown resistor.
2400
	 * pulldown resistor.
2394
	 */
2401
	 */
2395
	if (ata_check_status(ap) == 0xFF) {
2402
        if (ata_check_status(ap) == 0xFF)
2396
		ata_port_printk(ap, KERN_ERR, "SRST failed (status 0xFF)\n");
2403
               return 0;
2397
		return AC_ERR_OTHER;
2398
	}
2399
2404
2400
	ata_bus_post_reset(ap, devmask);
2405
	ata_bus_post_reset(ap, devmask);
2401
2406
(-)linuxorg/include/linux/libata.h (-6 / +4 lines)
Lines 703-711 Link Here
703
				pm_message_t mesg);
703
				pm_message_t mesg);
704
extern void ata_host_set_resume(struct ata_host_set *host_set);
704
extern void ata_host_set_resume(struct ata_host_set *host_set);
705
extern int ata_ratelimit(void);
705
extern int ata_ratelimit(void);
706
extern unsigned int ata_busy_sleep(struct ata_port *ap,
706
extern int ata_busy_sleep(struct ata_port *ap,
707
				   unsigned long timeout_pat,
707
                         unsigned long timeout_pat, unsigned long timeout);
708
				   unsigned long timeout);
709
extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
708
extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
710
				void *data, unsigned long delay);
709
				void *data, unsigned long delay);
711
extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
710
extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
Lines 1020-1027 Link Here
1020
		udelay(10);
1019
		udelay(10);
1021
		status = ata_chk_status(ap);
1020
		status = ata_chk_status(ap);
1022
		max--;
1021
		max--;
1023
	} while ((status & bits) && (max > 0));
1022
        } while (status != 0xff && (status & bits) && (max > 0));
1024
1025
	return status;
1023
	return status;
1026
}
1024
}
1027
1025
Lines 1041-1047 Link Here
1041
{
1039
{
1042
	u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1040
	u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1043
1041
1044
	if (status & (ATA_BUSY | ATA_DRQ)) {
1042
	if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) {
1045
		unsigned long l = ap->ioaddr.status_addr;
1043
		unsigned long l = ap->ioaddr.status_addr;
1046
		if (ata_msg_warn(ap))
1044
		if (ata_msg_warn(ap))
1047
			printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n",
1045
			printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n",

Return to bug 157326