From: Eric Anholt <eric@anholt.net>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: linux-kernel@vger.kernel.org,
Jassi Brar <jassisinghbrar@gmail.com>,
linux-rpi-kernel@lists.infradead.org
Subject: Re: [PATCH] mailbox/bcm2835: Fix mailbox full detection.
Date: Thu, 28 May 2015 14:46:46 -0700 [thread overview]
Message-ID: <878uc8pe7t.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <55677E6F.7070504@wwwdotorg.org>
[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]
Stephen Warren <swarren@wwwdotorg.org> writes:
> On 05/13/2015 02:10 PM, Eric Anholt wrote:
>> With the VC reader blocked and the ARM writing, MAIL0_STA reads empty
>> permanently while MAIL1_STA goes from empty (0x40000000) to non-empty
>> (0x00000001-0x00000007) to full (0x80000008).
>>
>> This bug ended up having no effect on us, because all of our
>> transactions in the client driver were synchronous and under a mutex.
>
> If you could get someone at the RPi Foundation or Broadcom to update the
> register descriptions and example code at the following URLs, that would
> be rather useful. Otherwise, this code will appear incorrect when
> compared against the documentation:
>
> https://github.com/raspberrypi/firmware/wiki/Mailboxes
> ("Mailbox registers" at the bottom)
>
> https://github.com/raspberrypi/firmware/wiki/Accessing-mailboxes
> ("Sample code")
Since it's a wiki, I went ahead and edited the first one. Hopefully
that clarifies how the c++ in the other page is supposed to be used.
>> diff --git a/drivers/mailbox/bcm2835-mailbox.c b/drivers/mailbox/bcm2835-mailbox.c
>
>> @@ -117,7 +118,7 @@ static bool bcm2835_last_tx_done(struct mbox_chan *link)
>> bool ret;
>>
>> spin_lock(&mbox->lock);
>> - ret = !(readl(mbox->regs + MAIL0_STA) & ARM_MS_FULL);
>> + ret = !(readl(mbox->regs + MAIL1_STA) & ARM_MS_FULL);
>
> What does "tx done" mean semantically?
>
> If "tx done" means "remote side received all our messages", then surely
> this should check MAIL1_STA for emptiness, which is different to the
> "not full" check implemented here?
>
> If "tx done" means "there's space to transmit more messages", then
> consider this:
The mailbox core appears to use this hook as "there's space to transmit
more messages." The name does seem really confusing.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2015-05-28 21:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 20:10 Eric Anholt
2015-05-28 20:45 ` Stephen Warren
2015-05-28 21:46 ` Eric Anholt [this message]
2015-05-29 7:06 ` Jassi Brar
2015-05-29 7:25 ` Jassi Brar
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=878uc8pe7t.fsf@eliezer.anholt.net \
--to=eric@anholt.net \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=swarren@wwwdotorg.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
all inboxes | Powered by JetHome®