9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
To: 9front@9front.org
Subject: Re: bug: audiohda broken in qemu
Date: Tue, 27 Oct 2020 01:16:43 -0700	[thread overview]
Message-ID: <20201027081643.GA103807@alice> (raw)
In-Reply-To: <CAH_zEu4b-hgkL-XKKeJsXyF+v7DhU6xac5Lj9U2tjTwq8o2cBA@mail.gmail.com>

Nick Owens <mischief@offblast.org> once said:
> i looked a bit at this 'rirb count reached' message and surmised that
> we needed to change RINTCNT. i looked at the linux driver and they set
> it to 1, and to 0xC0 for some 'quirky' cards. i tried 1 but that just
> makes subsequent commands after Getparam/Vendorid fail, but setting it
> to 0xC0 made all commands work and the device is enumerated, and
> #A/audio works.
>
> diff --git a/sys/src/9/pc/audiohda.c b/sys/src/9/pc/audiohda.c
> --- a/sys/src/9/pc/audiohda.c
> +++ b/sys/src/9/pc/audiohda.c
> @@ -1732,6 +1732,7 @@ hdastart(Ctlr *ctlr)
>      csr32(ctlr, Rirblbase) = pa;
>      csr32(ctlr, Rirbubase) = pa >> 32;
>      csr16(ctlr, Rirbwp) = Rirbptrrst;
> +    csr16(ctlr, Rintcnt) = 0xC0;
>      csr8(ctlr, Rirbctl) = Rirbdma;
>      waitup8(ctlr, Rirbctl, Rirbdma, Rirbdma);
>
> note that i have no idea what i am doing.

That's weird. There are two ways to figure out if there are responses
in the response input ring buffer (RIRB): either enable interrupts or
poll the write pointer. We do the latter and set the Rirbint field to
zero in the Rirbctl register. The value of Rintcnt should not matter
at all if RIRB interrupts are disabled.

Which method are they using in Linux?

  Anthony


  reply	other threads:[~2020-10-27  8:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27  4:39 Nick Owens
2020-10-27  8:16 ` Anthony Martin [this message]
2020-10-27  9:04   ` Anthony Martin
2020-10-27  9:30   ` [9front] " Nick Owens
2020-10-27  9:48 ` [9front] " cinap_lenrek
2020-10-27 10:23   ` Nick Owens
2020-10-27 10:53     ` Nick Owens
2020-10-27 20:00       ` Nick Owens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201027081643.GA103807@alice \
    --to=ality@pbrane.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).