NetBSD Problem Report #56574

From www@netbsd.org  Fri Dec 24 19:28:57 2021
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 1E3691A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 24 Dec 2021 19:28:57 +0000 (UTC)
Message-Id: <20211224192856.3AE311A923C@mollari.NetBSD.org>
Date: Fri, 24 Dec 2021 19:28:56 +0000 (UTC)
From: nia@pkgsrc.org
Reply-To: nia@pkgsrc.org
To: gnats-bugs@NetBSD.org
Subject: uaudio at ehci (not xhci) only outputs rapid gunfire noises in 9.99.93
X-Send-Pr-Version: www-1.0

>Number:         56574
>Category:       kern
>Synopsis:       uaudio at ehci (not xhci) only outputs rapid gunfire noises in 9.99.93
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    skrll
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 24 19:30:01 +0000 2021
>Closed-Date:    Mon Dec 27 11:13:38 +0000 2021
>Last-Modified:  Mon Dec 27 11:13:38 +0000 2021
>Originator:     nia
>Release:        current
>Organization:
The NetBSD Foundation
>Environment:
NetBSD amnesia 9.99.93 NetBSD 9.99.93 (GENERIC) #26: Fri Dec 24 15:39:11 CET 2021  nia@amnesia:/home/nia/obj/sys/arch/amd64/compile/GENERIC amd6
>Description:
A recent regression causes uaudio at ehci to only output rapid gunfire
noises instead of sweet tunes. All of my USB audio devices behave
identically in this regard.

I suspect this is related to recent ehci changes in current since
the problems can't be observed with xhci.
>How-To-Repeat:
Set ECHI mode in BIOS and $ audiocfg test 1

>Fix:
Use xhci

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Fri, 24 Dec 2021 22:22:22 +0000
Responsible-Changed-Why:
take


From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/56574: uaudio at ehci (not xhci) only outputs rapid gunfire
 noises in 9.99.93
Date: Fri, 24 Dec 2021 22:25:58 +0000

 This is a multi-part message in MIME format.
 --------------96500818F4B3ECFABC258C47
 Content-Type: text/plain; charset=utf-8; format=flowed
 Content-Transfer-Encoding: 7bit

 Does this fix it?

 Thanks
 Nick

 --------------96500818F4B3ECFABC258C47
 Content-Type: text/x-patch; charset=UTF-8;
  name="ehci.c.diff"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
  filename="ehci.c.diff"

 Index: sys/dev/usb/ehci.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/sys/dev/usb/ehci.c,v
 retrieving revision 1.298
 diff -u -p -r1.298 ehci.c
 =2D-- sys/dev/usb/ehci.c	23 Dec 2021 11:03:48 -0000	1.298
 +++ sys/dev/usb/ehci.c	24 Dec 2021 22:24:54 -0000
 @@ -4414,12 +4414,16 @@ ehci_device_fs_isoc_transfer(struct usbd
  		    EHCI_SITD_SET_LEN(xfer->ux_frlengths[i]));

  		/* Set page0 index and offset - TP and T-offset are set below */
 -		sitd->sitd.sitd_buffer[0] =3D htole32(DMAADDR(dma_buf, offs));
 +		const bus_addr_t sba =3D DMAADDR(dma_buf, offs);
 +		sitd->sitd.sitd_buffer[0] =3D htole32(BUS_ADDR_LO32(sitdba));
 +		sitd->sitd.sitd_buffer_hi[0] =3D htole32(BUS_ADDR_HI32(sitdba));

  		offs +=3D xfer->ux_frlengths[i];

 +		const bus_addr_t eba =3D DMAADDR(dma_buf, offs - 1);
  		sitd->sitd.sitd_buffer[1] =3D
 -		    htole32(EHCI_SITD_SET_BPTR(DMAADDR(dma_buf, offs - 1)));
 +		    htole32(EHCI_SITD_SET_BPTR(BUS_ADDR_LO32(eba)));
 +		sitd->sitd.sitd_buffer_hi[1] =3D htole32(BUS_ADDR_HI32(eba));

  		u_int huba __diagused =3D dev->ud_myhsport->up_parent->ud_addr;


 --------------96500818F4B3ECFABC258C47--

From: nia <nia@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/56574: uaudio at ehci (not xhci) only outputs rapid gunfire
 noises in 9.99.93
Date: Fri, 24 Dec 2021 22:50:49 +0000

 The patch appears to work (with the typo fixed), thanks.

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56574 CVS commit: src/sys/dev/usb
Date: Fri, 24 Dec 2021 22:56:56 +0000

 Module Name:	src
 Committed By:	nia
 Date:		Fri Dec 24 22:56:56 UTC 2021

 Modified Files:
 	src/sys/dev/usb: ehci.c

 Log Message:
 ehci(4): fix PR kern/56574: uaudio at ehci (not xhci) only outputs
 rapid gunfire (patch from nick)


 To generate a diff of this commit:
 cvs rdiff -u -r1.298 -r1.299 src/sys/dev/usb/ehci.c

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

State-Changed-From-To: open->closed
State-Changed-By: nia@NetBSD.org
State-Changed-When: Mon, 27 Dec 2021 11:13:38 +0000
State-Changed-Why:
fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.