Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: New panic in wdc_ata_bio_intr



Can you try attached patch?

Jaromir

2017-10-11 1:04 GMT+02:00 Chavdar Ivanov <ci4ic4%gmail.com@localhost>:
The timeouts when running under VirtualBox disappeared, but of course the panic on my T61p remains.

Chavdar Ivanov

On Tue, 10 Oct 2017 at 22:40 Jaromír Doleček <jaromir.dolecek%gmail.com@localhost> wrote:
Hey,

can you try with dev/scsipi/atapi_wdc.c 1.128? That should resolve the timeouts for atapi, at least it did for me.

Jaromir

2017-10-10 8:08 GMT+02:00 Rares Aioanei <bsdlisten%gmail.com@localhost>:
I get that also on VBox, except it doesn't try to add cd0a as a swap
device, nor does it show an endless stream of "lost interrupt"
messages; eventually I get a login prompt. This is with yesterday's
latest -CURRENT.

On Sun, Oct 8, 2017 at 5:17 PM, Chavdar Ivanov <ci4ic4%gmail.com@localhost> wrote:
> I tried the same kernel on a VirtualBox guest - it doesn't crash, but one
> gets endless
>
> piixide0:1:0: lost interrupt
>         type: atapi tc_bcount: 0 tc_skip: 0
>
> stream of messages. Also /etc/rc.d/swap2 start hangs while trying to add
> /dev/cd0a as a dump device... as shown by ktruss.
>
> Weird.
>
> Chavdar
>
> On Sun, 8 Oct 2017 at 11:55 Chavdar Ivanov <ci4ic4%gmail.com@localhost> wrote:
>>
>> System updated about two hours ago. I am getting:
>>
>> ....
>> wd0 at atabus0 drive 0
>> wd0: <Hitachi HTS725032A9A364>
>> wd0: drive supports 16-sector PIO transfers, LBA48 addressing
>> wd0: 298 GB, 620181 cyl, 16 head, 63 sec, 512 bytes/sect x 625142448
>> sectors
>> piixide0:0:0: bad state 0 in wdc_ata_bio_intr
>> panic: wdc_ata_bio_intr: bad state
>> fatal breakpoint trap in supervisor mode
>> trap type 1 code 0 rip 0xffffffff8021c0c5 cs 0x8 rflags 0x246 cr2 0 ilevel
>> 0x8 rsp 0xffffe40040003c38
>> curlwp 0xffffe4013bb27840 pid 0.2 lowest kstack 0xffffe400400002c0
>> Stopped at pid 0.2 (system) at netbsd:breakpoint+0x5: leave
>> db{0}> bt
>> breakpoint() at netbsd:breakpoint+0x5
>> vpanic() at netbsd:vpanic+0x140
>> snprintf() at netbsd:snprintf
>> wdc_ata_bio_poll() at netbsd:wdc_ata_bio_poll
>> intr_biglock_wrapper() at netbsd:intr_biglock_wrapper+0x1d
>> Xintr_ioapic_edge10() at netbsd:Xintr_ioapic_edge10+0xee
>> --- interrupt ---
>> x86_mwait() at netbsd:x86_mwait+0xd
>> acpicpu_cstate_idel_enter() at netbsd:acpicpu_cstate_idle_enter+0xdb
>> acpicpu_cstate_idle() at netbsd:acpicpu_cstate_idle+0xb6
>> idle_loop() at netbsd:idle_loop+0x18c
>> db{0}>
>> ....
>>
>> (that is on my usual ThinkPad T61p).
>>
>> Couldn't get a crash dump.
>>
>> Chavdar Ivanov
>>
>


Index: ata_wdc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/ata_wdc.c,v
retrieving revision 1.107
diff -u -p -r1.107 ata_wdc.c
--- ata_wdc.c	8 Oct 2017 13:35:03 -0000	1.107
+++ ata_wdc.c	14 Oct 2017 14:22:20 -0000
@@ -618,14 +623,13 @@ wdc_ata_bio_poll(struct ata_channel *chp
 }
 
 static int
-wdc_ata_bio_intr(struct ata_channel *chp, struct ata_xfer *xfer, int is)
+wdc_ata_bio_intr(struct ata_channel *chp, struct ata_xfer *xfer, int irq)
 {
 	struct atac_softc *atac = chp->ch_atac;
 	struct wdc_softc *wdc = CHAN_TO_WDC(chp);
 	struct ata_bio *ata_bio = &xfer->c_bio;
 	struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
 	int drv_err, tfd;
-	bool poll = ((xfer->c_flags & C_POLL) != 0);
 
 	ATADEBUG_PRINT(("wdc_ata_bio_intr %s:%d:%d\n",
 	    device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive),
@@ -659,8 +663,9 @@ wdc_ata_bio_intr(struct ata_channel *chp
 #endif
 
 	/* Ack interrupt done by wdc_wait_for_unbusy */
-	if (wdc_wait_for_unbusy(chp, poll ? ATA_DELAY : 0, AT_POLL, &tfd) < 0) {
-		if (!poll && (xfer->c_flags & C_TIMEOU) == 0) {
+	if (wdc_wait_for_unbusy(chp,
+	    (irq == 0) ? ATA_DELAY : 0, AT_POLL, &tfd) < 0) {
+		if (!irq && (xfer->c_flags & C_TIMEOU) == 0) {
 			ata_channel_unlock(chp);
 			return 0; /* IRQ was not for us */
 		}


Home | Main Index | Thread Index | Old Index