NetBSD Problem Report #58129

From www@netbsd.org  Tue Apr  9 12:14:36 2024
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 289981A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  9 Apr 2024 12:14:36 +0000 (UTC)
Message-Id: <20240409121434.1B2F51A923A@mollari.NetBSD.org>
Date: Tue,  9 Apr 2024 12:14:34 +0000 (UTC)
From: hashikaw@mail.ru
Reply-To: hashikaw@mail.ru
To: gnats-bugs@NetBSD.org
Subject: ATA_DOWNGRADE_MODE downgrade dma mode bypassing udma0
X-Send-Pr-Version: www-1.0

>Number:         58129
>Category:       kern
>Synopsis:       ATA_DOWNGRADE_MODE downgrade dma mode bypassing udma0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 09 12:15:01 +0000 2024
>Originator:     Kouichi Hashikawa
>Release:        NetBSD-current, 10
>Organization:
>Environment:
>Description:
I use the kernel with "options ATA_DOWNGRADE_MODE", then encounterd
DMA error, downgrade dma mode ... udma2 -> 1 -> pio4, bypassing udma0.

[  87.6998917] wd0a: DMA error reading fsbn 282960 of 282960-282991 (wd0 bn 797040; cn 790 tn 11 sn 27), xfer 3f68, retry 1
[  88.6998916] wd0: soft error (corrected) xfer 3f68
[  88.9199515] hptide0:1:0: lost interrupt
[ 100.2099026] 	type: ata tc_bcount: 16384 tc_skip: 0
hptide0:1:0: bus-master DMA error: missing interrupt, status=0x1
[ 100.2099026] wd0: transfer error, downgrading to Ultra-DMA mode 1
...
[ 100.2099026] wd0g: DMA error reading fsbn 2490912 of 2490912-2490943 (wd0 bn 14057712; cn 13946 tn 2 sn 18), xfer 3f68, retry 0
hptide0:1:0: lost interrupt
[ 111.2098998] 	type: ata tc_bcount: 16384 tc_skip: 0
[ 111.2098998] wd0: transfer error, downgrading to PIO mode 4

>How-To-Repeat:

>Fix:
I think...

--- src/sys/dev/ata/ata.c-1169  2023-12-03 23:14:41.382588837 +0900
+++ src/sys/dev/ata/ata.c       2024-04-09 15:19:30.463492258 +0900
@@ -1800,7 +1800,7 @@
        /*
         * If we were using Ultra-DMA mode, downgrade to the next lower mode.
         */
-       if ((drvp->drive_flags & ATA_DRIVE_UDMA) && drvp->UDMA_mode >= 2) {
+       if ((drvp->drive_flags & ATA_DRIVE_UDMA) && drvp->UDMA_mode >= 1) {
                drvp->UDMA_mode--;
                aprint_error_dev(drv_dev,
                    "transfer error, downgrading to Ultra-DMA mode %d\n",

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.