NetBSD Problem Report #57362

From www@netbsd.org  Mon Apr 17 23:00:51 2023
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))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 83E471A9239
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 17 Apr 2023 23:00:51 +0000 (UTC)
Message-Id: <20230417230050.BCD401A923A@mollari.NetBSD.org>
Date: Mon, 17 Apr 2023 23:00:50 +0000 (UTC)
From: ltning-netbsd@anduin.net
Reply-To: ltning-netbsd@anduin.net
To: gnats-bugs@NetBSD.org
Subject: piixide / wd does not fall back to PIO4 after excessive DMA errors
X-Send-Pr-Version: www-1.0

>Number:         57362
>Category:       kern
>Synopsis:       piixide / wd does not fall back to PIO4 after excessive DMA errors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jdolecek
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 17 23:05:00 +0000 2023
>Closed-Date:    Sat Jan 20 13:07:25 +0000 2024
>Last-Modified:  Sat Jan 20 13:07:25 +0000 2024
>Originator:     Eirik Øverby
>Release:        10-BETA
>Organization:
Modirum
>Environment:
>Description:
On NetBSD 9.3, the IDE driver falls back to PIO4 after excessive DMA errors when reading/writing devices. This is the preferred behaviour, as some devices on older hardware will not operate correctly in DMA mode.

On NetBSD 10-BETA, the driver keeps trying to operate in DMA mode and if the device does not magically recover, hard power-off is the only way out.

It would be preferable if the driver downgrades to PIO4 like in previous versions. In my case, I have suffered (unimportant, backed-up) data loss as a result of this change.
>How-To-Repeat:
1. Obtain old hardware with PIO mode problems.
2. Install NetBSD 9.3, observe downgrade to PIO mode 4
3. Boot 10-BETA kernel, observe endless DMA errors
4. Boot 9.3 again; automatic boot may fail due to errors during fsck_ffs
>Fix:
The ability to disable DMA as a boot option would be useful; I am new to NetBSD so have not yet figured out if/how to set device driver flags during boot without recompiling kernel.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->jdolecek
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Mon, 17 Jul 2023 13:54:44 +0000
Responsible-Changed-Why:
The downgrade mode logic was disabled by default in ata.c 1.159:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/ata/ata.c?rev=1.159&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
You can probably re-enable it by adding

options 	ATA_DOWNGRADE_MODE

to your kernel and recompiling (may need to delete ata.o first, looks
like this was done withouta header file update).

jdolecek: Can this be made into something that can be configured
dynamically, so if you have a disk that is affected, it doesn't
require recompiling the kernel?


State-Changed-From-To: open->analyzed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Mon, 17 Jul 2023 13:54:44 +0000
State-Changed-Why:


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57362 CVS commit: src/sys/arch/i386/conf
Date: Mon, 17 Jul 2023 21:12:29 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Mon Jul 17 21:12:29 UTC 2023

 Modified Files:
 	src/sys/arch/i386/conf: LEGACY

 Log Message:
 i386/LEGACY: Enable ATA_DOWNGRADE_MODE.

 PR kern/57362


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/conf/LEGACY

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

State-Changed-From-To: analyzed->feedback
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Tue, 18 Jul 2023 07:20:58 +0000
State-Changed-Why:
Taylor's change to enable the ATA downgrade for LEGACY kernel should be enough.
Note the problem occurs if the hardware claims to support DMA, but actually
doesn't. There shouldn't be any SATA devices like that, and there should
be even very few ATA (IDE) devices like that.
Anything else to do?


State-Changed-From-To: feedback->closed
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Sat, 20 Jan 2024 13:07:25 +0000
State-Changed-Why:
Resolved by enabling ATA_DOWNGRADE_MODE in LEGACY kernel.
Thanks for report.


>Unformatted:

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-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.