From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com ([209.85.221.68]) by ewsd; Tue Oct 27 06:54:03 -0400 2020 Received: by mail-wr1-f68.google.com with SMTP id x7so1362021wrl.3 for <9front@9front.org>; Tue, 27 Oct 2020 03:54:00 -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=nxvPenoMOnLDEd0YDeMIKtuwJX5ZZeaKk2xZgOZb5sY=; b=rPE9RyA0p4mDkJn8B4BDlDrZQ/2eKiGnErg5prr74saXf47hGYbPIb3jOe92/EOMmj KCMfiDZoU9LLai/M4E0hrTtWnKwjvPPjYuf2sMnQRcei7367gk6/9McGqLBStod720An JBtBZkMzZUA7ngxL4xC+1LUz3OoMKl/zLLoJlpiWDaFVU936+DgwOrPA7y/Z2xiBq/+l EaDYLZ+QXYTlnQTsNWmlUfQriE7b5qYyAuJ8DxK9DQqhvRxarxnJtIRYoYNVES64L5E2 V0XouNK88V+UYqE67U2/bVWRSnkLe7jDZW2pDdXJHu+eLo3a7xB+zq5Bb5UIztMrePi/ iykw== 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=nxvPenoMOnLDEd0YDeMIKtuwJX5ZZeaKk2xZgOZb5sY=; b=hqLL0lgryRNtvWJMd0kTHXPdWDRAwg3EqLFWujwD9vaBW/GwcQ+FINguHE41oFMpjo wvgMd9ATZSXzVf/ltK+lyhWfcI7RXMkA8wK+hi2ownuGEGq9CYQKyJsKJ9RMemxG77GI nK5JBdeiA5a7trCo+iyamHlLuxf5KqmSzo2AOfhqjLu5bnbPVvS3BaX15FVJNWTMdkXY jdcbY+ZBT9U7T3MsqRMGw65VQljqtlpbiwpfQdBO62wNEZVHxIMBQ6NSXuOrORlf/w5n F4FqodYh3ENFZg/eJzl0Dbd19f8DMdxOIJgmYlru2b8bG4m2CYnXU2X0pBfqpeRV8XlF jfGg== X-Gm-Message-State: AOAM530LtMpaP9fUl4iJBwUds79lqHwnMwPqmAE3o+W+Uq37JgeLiiRl FSQUbwdJwx+ABSj59FKRc8qJayD+pfH1AqhKOkWNTXHzpVyUIg== X-Google-Smtp-Source: ABdhPJzKFUh4lg0MZWepprUAjhM/ckwZXxHkAT3S3fRlpWBTCpMzWpTZ7nbUpr7R5BEXdZf1sVLo9Y9BzxiWOVPGIhs= X-Received: by 2002:adf:e744:: with SMTP id c4mr2118462wrn.222.1603796039710; Tue, 27 Oct 2020 03:53:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Owens Date: Tue, 27 Oct 2020 03:53:47 -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: mobile blockchain cache browser reduce/map locator 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