9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <9fans@hamnavoe.com>
To: 9fans@9fans.net
Subject: Re: [9fans] Raspberry Pi 4
Date: Thu, 25 Jul 2019 11:02:06 +0100	[thread overview]
Message-ID: <78df3ccd94cc441e3047a7698e43398b@hamnavoe.com> (raw)
In-Reply-To: <CBA57E1486BAEF74750CB5A25D52D441@felloff.net>

> no, i wish. only reading linux source and deciphering device tree
> mazes. :(

Supposedly a h/w manual is being edited now.

> i think theres a bug with the dma code tho. you actually need to
> invalidate caches *AFTER* the hw completed because the
> core can speculatively prefetch memory and bring it into the
> cache before the hardware is done writing memory. iirc the
> code just cleans/invalidates BEFORE issuing the dma operation.

I fixed this a long time ago, but you might have missed it because
I call cachedinvse in the device drivers after return from dmawait,
instead of doing it in the dma code itself.

Your dmaflush code doesn't look to me like it will do the right
thing if the dma buffer isn't cache aligned.  (Could this ever be
the case in the 9front kernel?)  Suppose dma starts, cpu prefetches
some old data into the cache line overlapping the start of the dma
buffer, then dma completes.  Your dmaflush then calls cachedwbse
which writes back the pre-fetched data, overwriting the new data
which dma wrote to memory.

Anyway this doesn't seem relevant for ether4330 because I get the
same trouble using pio instead of dma.




  reply	other threads:[~2019-07-25 10:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  9:35 cinap_lenrek
2019-07-25 10:02 ` Richard Miller [this message]
2019-07-25 10:04   ` Richard Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-09-25 20:58 Richard Miller
2019-09-29 20:32 ` David du Colombier
2019-08-25 11:09 Richard Miller
2019-07-25 11:41 cinap_lenrek
2019-07-25 11:19 cinap_lenrek
2019-07-25  7:37 cinap_lenrek
2019-07-25  9:15 ` Richard Miller
2019-07-18 13:32 Richard Miller
2019-07-19  9:19 ` hiro
2019-07-19  9:41   ` Richard Miller
2019-07-19  9:45     ` hiro
2019-07-19  9:49       ` Richard Miller

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=78df3ccd94cc441e3047a7698e43398b@hamnavoe.com \
    --to=9fans@hamnavoe.com \
    --cc=9fans@9fans.net \
    /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).