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:23:45 -0400 2020 Received: by mail-wr1-f68.google.com with SMTP id t9so1209728wrq.11 for <9front@9front.org>; Tue, 27 Oct 2020 03:23:42 -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=Gm4RyZAsedUlH8NWWJ8LaBOw71SMA1SIFQftmbp35wc=; b=Yt4VObdW+wAaLUAuP5ZtWvDBFWiJZZ9RiA32/XCTDjzJSfQe++J6ZetTLXwq0WruXa 59pOuf8wJN4xahHy/S/ujWLdD4ByFluAbrBMNeYMbVatLPrOG5RqV8WsNC5B6og6E7lA s5yZmN7IvQsQrDhn0oikt58lrcOX/0LGzjM7CZV9hsLPrwI7UtGAP0ItIzynPbayRTWb 1iF4wmxjIduxsgMdwzkoaV2cdyc1tfzZbhT5r5jXElfvNLlzqdyeoL+Dou95wuJjCvY1 cURUQ3n0DlBhmvLl9cyAL53DAOH93Jz+GF7r0stFIP5Q9Mm61FAHiv6LxQGLTGbRpGY0 tGhw== 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=Gm4RyZAsedUlH8NWWJ8LaBOw71SMA1SIFQftmbp35wc=; b=hsOozXJtvWhgdxv8xZu+mThR4BDJWe4QudoUV7WDZPT0oaStgH2Wh/9665QdmelBSZ 5n6S7yt3tKC+KszJgEPGHoVdjJd7bC51XdDK1iKABgwvJnYvR6r1cksyvEjWhtXMsBRE IdRKXho9UH4CEBFWLFjlW6iJlRPf5ov6Ry1F+qHSwDHyDW7pzWs4DUBcMLTolSb6gAtX VDkg9dMSYSyWhj3cWxaXQqQAU8APsCF3J9SQ/G63eAUyFBEia6C2rvlgwZPfrvOwI6cW L+456Rd6tA9k840PMRIHjj5SZwTo/oD0KLNhEKUl8gl0lxE3QISVzHrf/DgwS+YM78Wy +Grw== X-Gm-Message-State: AOAM530W+ou/oZVesafnR2D9mNFdcWc1lwSZB5LPel6pejz63lKS6zQq JeCKMASzRmp+oDj6sd8lrmjqGe7ATO8j2pot/K4fzUUTqJjQPw== X-Google-Smtp-Source: ABdhPJzI3fDm+4klhb6NtWR5pmGKrDVu2zAxMsOo9nJ8YmcSyylSowGBwgFO9N3qt4q7X9QxkzeKWc3MMG2GOEgjirE= X-Received: by 2002:adf:818b:: with SMTP id 11mr1939779wra.74.1603794221233; Tue, 27 Oct 2020 03:23:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Owens Date: Tue, 27 Oct 2020 03:23:30 -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: social scripting-based method method-based manager 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