NetBSD Problem Report #59078

From www@netbsd.org  Sun Feb 16 17:05:01 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0CE711A923D
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 Feb 2025 17:05:01 +0000 (UTC)
Message-Id: <20250216170459.8D8721A923E@mollari.NetBSD.org>
Date: Sun, 16 Feb 2025 17:04:59 +0000 (UTC)
From: capa150@gmail.com
Reply-To: capa150@gmail.com
To: gnats-bugs@NetBSD.org
Subject: UDMA drive mode too high for Blue and White G3 using PCI IDE controller card
X-Send-Pr-Version: www-1.0

>Number:         59078
>Category:       port-macppc
>Synopsis:       UDMA drive mode too high for Blue and White G3 using PCI IDE controller card
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 16 17:10:00 +0000 2025
>Last-Modified:  Mon Feb 17 19:05:03 +0000 2025
>Originator:     Chris tucker
>Release:        10.1
>Organization:
>Environment:
NetBSD netbsd 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/macppc/compile/GENERIC macppc
>Description:
This problem affected my Blue and White G3 with a Sonnet PCI IDE controller card.

The problem relates both to the kernel in the installer, and also the regular kernel.

During installation and also during post-installation normal operation there's hundreds of repeated errors along the llines of "wd0: aborted command, interface CRC error" "wd0c: error reading fsbn".

Photo of such error here: https://ctucker.neocities.org/crc-netbsd-error.jpg

The problem does not manifest when using the onboard IDE controller. However, the onboard IDE controller causes rndctl to sometimes crash the computer, which is why I switched to the Sonnet PCI IDE controller, which works correctly with rndctl. (see NetBSD Problem Report #59014 for more information)

Despite the CRC warnings, the install does work, and the computer does run, but the screen gets filled with hundreds of warnings and runs much slower than normal.
>How-To-Repeat:
Run the netbsd installer or run a installed netbsd instance on a blue and white G3 fitted with a Sonnet PCI IDE card.
>Fix:
I believe the problem is due to the netbsd kernel accessing my UDMA IDE hard disk in UDMA mode 6 (ATA/133), but my Blue and White G3 specifications indicate the Mac is designed for UDMA mode 2 (ATA/33).

The Mac can't handle the higher speed and thus complains profusely.

I resolved the problem by modifying the kernel on BOTH the installer kernel and the regular kernel to limit the UDMA mode to mode 2 with this line in the kernel config:

wd*    at atabus? drive ? flags 0x0aac

(default line uses the flag 0x0000)

I notice that netbsd/macppc includes several different kernels such as netbsd-GENERIC, netbsd-GENERIC_601, netbsd-POWERMAC_G5. Perhaps you could create another such kernel like netbsd-GENERIC-BLUE-AND-WHITE-PCI-CARD (lol).

I suppose the problem may affect more machines than just the Blue-and-White.

(An alternate solution might be to change how the cmdide driver (the Blue-and-white motherboard IDE controller) works so that it doesn't cause the rndctrl error to manifest. There's something about rndctrl that causes the drive to error, although the cmd chipset is known to be wonky).

>Audit-Trail:
From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59078 CVS commit: src/sys
Date: Mon, 17 Feb 2025 19:01:05 +0000

 Module Name:	src
 Committed By:	jakllsch
 Date:		Mon Feb 17 19:01:04 UTC 2025

 Modified Files:
 	src/sys/arch/i386/conf: LEGACY
 	src/sys/dev/ata: ata.c files.ata

 Log Message:
 Restore ATA DMA mode downgrade support everywhere; it's a necessary part
 of any system supporting (parallel) ATA DMA.  There is hardware out there,
 including cobalt, macppc, and sparc64 where this functionality is
 necessary to avoid non-functional disks, either in as-shipped hardware
 configurations or with add-in cards, or perhaps just with compromised
 IDE/PATA cables.

 Should address:
   PR 58767
   PR 59023
   PR 59078

 If anyone really insists on not having this support they can now turn it
 off themselves with `options ATA_NO_DOWNGRADE_MODE`


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/conf/LEGACY
 cvs rdiff -u -r1.170 -r1.171 src/sys/dev/ata/ata.c
 cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ata/files.ata

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.