NetBSD Problem Report #10805

Received: (qmail 2886 invoked from network); 10 Aug 2000 17:28:49 -0000
Message-Id: <200008101728.CAA07922@oak.zero.ad.jp>
Date: Fri, 11 Aug 2000 02:24:46 +0900
From: kazz <zaa83571@oak.zero.ad.jp>
To: gnats-bugs@gnats.netbsd.org
Subject: Mitsumi CR-4804TE ATAPI CDRW not detected by 1.4.2 kernel

>Number:         10805
>Category:       kern
>Synopsis:       Mitsumi CR-4804TE ATAPI CDRW not detected by 1.4.2 kernel
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    bouyer
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 10 17:29:01 +0000 2000
>Closed-Date:    Mon May 25 19:21:41 +0000 2020
>Last-Modified:  Mon May 25 19:21:41 +0000 2020
>Originator:     Kazuhiko Fukuhara
>Release:        1.4.2
>Organization:
>Environment:
System: NetBSD hannibal 1.4.2 NetBSD 1.4.2 (Bikini) #1: Mon May 29 16:17:26 JST
2000 root@hannibal:/usr/src/sys/arch/i386/compile/Bikini i386

>Description:
Mitsumi CR-4804TE ATAPI CDRW fails detect at boot time.

>How-To-Repeat:
Boot time.

>Fix:
A temporary patch.
Case CR-4804TE drive that connect to secondly IDE interface.
CR-4804TE is unable RST bit reset by WD register.

--- usr/src.orig/sys/dev/ic/wdc.c	Wed Feb  2 08:30:28 2000
+++ usr/src/sys/dev/ic/wdc.c	Mon Apr 17 14:37:37 2000
@@ -207,6 +207,9 @@
 	}

 	/* assert SRST, wait for reset to complete */
+/*CR-4804TE patch*/
+if (chp->channel != 1) {
+/*END CR-4804TE patch*/
 	bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
 	    WDSD_IBM);
 	delay(10);
@@ -221,6 +224,14 @@
 	delay(10);

 	ret_value = __wdcwait_reset(chp, ret_value);
+/*CR-4804TE patch*/
+} else {
+  for (drive = 0; drive < 2; drive++) {
+    wdccommandshort(chp, drive, ATAPI_SOFT_RESET);
+    wait_for_unbusy(chp, WDC_RESET_WAIT);
+  }
+} 
+/*END CR-4804TE patch*/
 	WDCDEBUG_PRINT(("%s:%d: after reset, ret_value=0x%d\n",
 	    chp->wdc ? chp->wdc->sc_dev.dv_xname : "wdcprobe", chp->channel,
 	    ret_value), DEBUG_PROBE);
@@ -571,6 +582,9 @@
 {
 	int drv_mask1, drv_mask2;

+/*CR-4804TE patch*/
+if (chp->channel != 1) {
+/*END CR-4804TE patch*/
 	bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
 	    WDSD_IBM); /* master */
 	bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
@@ -582,6 +596,14 @@
 	(void) bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_error);
 	bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
 	    WDCTL_4BIT);
+/*CR-4804TE patch*/
+} else {
+  int drive;
+  for (drive = 0; drive < 2; drive++) {
+    wdccommandshort(chp, drive, ATAPI_SOFT_RESET);
+    wait_for_unbusy(chp, WDC_RESET_WAIT);
+  }   
+}

 	drv_mask1 = (chp->ch_drive[0].drive_flags & DRIVE) ? 0x01:0x00;
 	drv_mask1 |= (chp->ch_drive[1].drive_flags & DRIVE) ? 0x02:0x00;

--- usr/src.orig/sys/dev/ata/ata_wdc.c	Sun Jan 23 21:26:01 2000
+++ usr/src/sys/dev/ata/ata_wdc.c	Sun Jul 16 18:41:02 2000
@@ -431,6 +431,8 @@
 		dma_flags |= (ata_bio->flags & ATA_POLL) ?  WDC_DMA_POLL : 0;
 	}

+/*problem ATAPI CD-RW*/
+#if 0
 	/*
 	 * if we missed an interrupt in a PIO transfer, reset and restart.
 	 * Don't try to continue transfer, we may have missed cycles.
@@ -440,6 +442,7 @@
 		wdc_ata_bio_done(chp, xfer);
 		return 1;
 	}
+#endif

 	/* Ack interrupt done by wait_for_unbusy */
 	if (wait_for_unbusy(chp,
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: bouyer 
State-Changed-When: Fri Aug 2 07:50:37 PDT 2002 
State-Changed-Why:  
Hi, 
does this problem still exists with 1.5.3 or 1.6_BETA ? 

From: "Perry E. Metzger" <perry@piermont.com>
To: zaa83571@oak.zero.ad.jp
Cc: gnats-bugs@gnats.netbsd.org, perry@piermont.com, bouyer@netbsd.org
Subject: Re: kern/10805
Date: 05 Apr 2003 14:52:48 -0500

 >Synopsis:       Mitsumi CR-4804TE ATAPI CDRW not detected by 1.4.2 kernel

 I'm cleaning out old trouble reports. Is this problem still present in
 NetBSD? There have been two major releases since the ticket was filed...

 Perry

From: Magnus Henoch <mange@freemail.hu>
To: gnats-bugs@netbsd.org
Cc: perry@piermont.com
Subject: Re: kern/10805
Date: Fri, 11 Apr 2003 23:33:09 +0200

 This problem does exist with NetBSD/i386 1.6 and my particular
 computer.  It has a DVD reader at secondary master, and a CDRW at
 secondary slave.  NetBSD would only occasionally detect the CDRW,
 though when it does the drive works correctly.

 I adapted the patch in the PR to the 1.6 kernel source, and now
 the CDRW is consistently detected.  Please note that I do not
 understand the code; I just put the conditionals where they
 seemed to belong.

 Would dmesg output be of any help?

 Patch for 1.6 kernel:
 diff -ru /usr/src/sys/dev/ata/ata_wdc.c sys/dev/ata/ata_wdc.c
 --- /usr/src/sys/dev/ata/ata_wdc.c	Tue Apr 23 22:41:13 2002
 +++ sys/dev/ata/ata_wdc.c	Fri Apr 11 18:55:48 2003
 @@ -490,6 +490,8 @@
  		panic("wdc_ata_bio_intr: bad state\n");
  	}

 +/*problem ATAPI CD-RW*/
 +#if 0
  	/*
  	 * if we missed an interrupt in a PIO transfer, reset and restart.
  	 * Don't try to continue transfer, we may have missed cycles.
 @@ -499,6 +501,7 @@
  		wdc_ata_bio_done(chp, xfer);
  		return 1;
  	}
 +#endif

  	/* Ack interrupt done by wait_for_unbusy */
  	if (wait_for_unbusy(chp,
 diff -ru /usr/src/sys/dev/ic/wdc.c sys/dev/ic/wdc.c
 --- /usr/src/sys/dev/ic/wdc.c	Fri Apr 11 18:46:45 2003
 +++ sys/dev/ic/wdc.c	Fri Apr 11 19:23:09 2003
 @@ -228,6 +228,9 @@

  	if (chp->wdc && (chp->wdc->cap & WDC_CAPABILITY_SELECT))
  		chp->wdc->select(chp,0);
 +/*CR-4804TE patch*/
 +if (chp->channel != 1) {
 +/*END CR-4804TE patch*/
  	/* assert SRST, wait for reset to complete */
  	bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
  	    WDSD_IBM);
 @@ -243,6 +246,14 @@
  	delay(10);

  	ret_value = __wdcwait_reset(chp, ret_value);
 +/*CR-4804TE patch*/
 +} else {
 +  for (drive = 0; drive < 2; drive++) {
 +    wdccommandshort(chp, drive, ATAPI_SOFT_RESET);
 +    wait_for_unbusy(chp, WDC_RESET_WAIT);
 +  }
 +} 
 +/*END CR-4804TE patch*/
  	WDCDEBUG_PRINT(("%s:%d: after reset, ret_value=0x%d\n",
  	    chp->wdc ? chp->wdc->sc_dev.dv_xname : "wdcprobe", chp->channel,
  	    ret_value), DEBUG_PROBE);
 @@ -762,6 +773,9 @@

  	if (chp->wdc->cap & WDC_CAPABILITY_SELECT)
  		chp->wdc->select(chp,0);
 +/*CR-4804TE patch*/
 +if (chp->channel != 1) {
 +/*END CR-4804TE patch*/
  	bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
  	    WDSD_IBM); /* master */
  	bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
 @@ -773,6 +787,14 @@
  	(void) bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_error);
  	bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
  	    WDCTL_4BIT);
 +/*CR-4804TE patch*/
 +} else {
 +  int drive;
 +  for (drive = 0; drive < 2; drive++) {
 +    wdccommandshort(chp, drive, ATAPI_SOFT_RESET);
 +    wait_for_unbusy(chp, WDC_RESET_WAIT);
 +  }   
 +}

  	drv_mask1 = (chp->ch_drive[0].drive_flags & DRIVE) ? 0x01:0x00;
  	drv_mask1 |= (chp->ch_drive[1].drive_flags & DRIVE) ? 0x02:0x00;
State-Changed-From-To: feedback->open 
State-Changed-By: perry 
State-Changed-When: Sat Apr 12 08:14:29 PDT 2003 
State-Changed-Why:  
The user has provided a patch, so we are no longer awaiting more 
information from them. 


Responsible-Changed-From-To: kern-bug-people->bouyer 
Responsible-Changed-By: perry 
Responsible-Changed-When: Sat Apr 12 08:14:29 PDT 2003 
Responsible-Changed-Why:  
Manuel agreed to handle this PR. 
State-Changed-From-To: open->closed
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Mon, 25 May 2020 19:21:41 +0000
State-Changed-Why:
Hardware no longer relevant.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.