From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com ([209.85.128.46]) by ewsd; Tue Oct 27 16:00:32 -0400 2020 Received: by mail-wm1-f46.google.com with SMTP id d3so2691433wma.4 for <9front@9front.org>; Tue, 27 Oct 2020 13:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=offblast-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=lUtM5dbWMvQEEfOPXraHawNbyDWoTQs10xq+Use1X30=; b=mDy8CvzwmoM2acdchjVFiorAHrq+z0GISAmBO3LpRtWSvqI8N+JO+JFdWPZmjh0W2E fWSOlgzKvFmnKe242yTVp08BwmdYN88rnTTY2lcYZr1+pXjg8u5wVXhx7lqG9ytTvc2g qaqnQ8e9zHK2PsxNsnYgHM2/SF7nNZGvQJHcmvakv6Og5zRShQY4aHWaJQHyvMTvwI43 SQx3t8eBKyFC84nm+Gn6f7pUe7DQP33EzHXUcPyn3gQlQyxm16R+x3yEiIhsRUlcmf5S gNPNk7Y+nJznfl/gsFl05zsQu9qRML11eKAr6mu1bGoYFTPfAIyU3NLnRuBYpF/zhYvw v1Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=lUtM5dbWMvQEEfOPXraHawNbyDWoTQs10xq+Use1X30=; b=OPpyQXNYyNFe8akEiJY6OI3+d5a67VhOi3xPDJ2iVxmBFJztNRDuMxwRKB8OYj8VAR 9ganiNQW5Sa+P//oeDK7Xld+1nYD91+YDKmTx4ZvHf5TqFKdHRKkZJ1Ti0cnF9Veohhs 5f9bR3bal3JT3xE25ZN+eUQxAgR3LPC7nVHo5RDQtthCqsKzKmNYC/E/4Es9GIkplIFt 7HSElEyg2ArcjPzKyWuMlsVVJu6lEGgADCF+nf+pHOy3HrX/pLwLwLuf0CJ2zdnkpg7j ac+Mputgfn+OjscioR1c1uuNo9hDaFiyqeAYEE+sUqdBzvMwwNsgX7xSCroB90O4UovT Sj4w== X-Gm-Message-State: AOAM531jp0S8Jj0g7oh9rvMUoeAGdkr0UQQChr7gh97OXkOldFJ96eGo 2kdaBbknOobhFmxb8fjYCy+keNpi29AxL6ixFJZ3P7u2quoGZg== X-Google-Smtp-Source: ABdhPJz6c0zUFeCrnDRwFcukvDivfqHJFJ8xDB8v8Pa2BcFhqr8zK+tLMHsyIZjGBGd0PBIJ/thvhdipmZYVfMUysd0= X-Received: by 2002:a1c:3503:: with SMTP id c3mr4321080wma.43.1603828827303; Tue, 27 Oct 2020 13:00:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Owens Date: Tue, 27 Oct 2020 13:00:16 -0700 Message-ID: Subject: Re: [9front] bug: audiohda broken in qemu To: 9front@9front.org Content-Type: text/plain; charset="UTF-8" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: structured scale-out app-based self-signing enhancement solution should be fixed in http://code.9front.org/hg/plan9front/rev/0e47f4a0c4d6. On Tue, Oct 27, 2020 at 3:53 AM Nick Owens wrote: > > following up on my previous idea, i enabled RIRB interrupts but clear > them in hdacmd, with RINTCNT set to 1. this seems to work. > > http://okturing.com/src/9629/body > > is there any way to improve this? > > On Tue, Oct 27, 2020 at 3:23 AM Nick Owens wrote: > > > > On Tue, Oct 27, 2020 at 2:48 AM wrote: > > > > > > very odd, because we dont even use IRB interrupts at all. > > > in hdacmd(), you can see we just poll the irb write > > > pointer instead... > > > > > > note also that the irb ring has a variable size, it > > > can go from 2, 16 to 256 entries. so programming that > > > register with a out of range value might be a bad idea. > > > > > > i wonder why it fails with intcnt = 1, it seems the response > > > counter is never reset in qemu so just bumping the count > > > will just then make it fail after 0xC0 responses? > > > > > > maybe you can try running the vendor command in a loop > > > with your change and see if it starts failing once we > > > reach the count? > > > > yes, running Getparm in enumcodec() in a loop (0xC0+n times) leads to > > driver probing failure: > > > > intel-hda: read CORBWP : 0xbf (ffff) > > intel-hda: write CORBWP : 0xc0 (ffff) > > intel-hda: intel_hda_corb_run: [rp 0xc0] verb 0x000f0000 > > hda-duplex: hda_audio_command: nid 0 (root), verb 0xf00, payload 0x0 > > intel-hda: intel_hda_response: [wp 0xc0] response 0x1af40022, extra > > 0x0 > > intel-hda: intel_hda_response: rirb count reached (192) > > intel-hda: intel_hda_corb_run: corb ring empty > > intel-hda: read RIRBWP : 0xc0 (ffff) > > intel-hda: previous register op repeated 1 times > > intel-hda: read CORBRP : 0xc0 (ffff) > > intel-hda: read CORBWP : 0xc0 (ffff) > > intel-hda: write CORBWP : 0xc1 (ffff) > > intel-hda: intel_hda_corb_run: rirb count reached > > intel-hda: read RIRBWP : 0xc0 (ffff) > > #A0: no audio codecs found > > > > > > > > the fix might be that we need to clear the response > > > interrupt status flag in rirbsts (bit 0) after or > > > before each command? > > > > FWICT qemu only resets the RIRB counter *if* you had RIRB interrupts > > on previously, and we arent using RIRB interrupts: > > > > https://git.qemu.org/?p=qemu.git;a=blob;f=hw/audio/intel-hda.c;h=4330213fff167071800216c49607c5f18022cc20;hb=HEAD#l555 > > > > so what is the solution here? use RIRB interrupts? > > > > > > > > -- > > > cinap