mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Peter Mamonov <pmamonov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] usb: host: ehci: distinguish DMA addresses
Date: Thu, 5 Mar 2020 20:14:54 +0300	[thread overview]
Message-ID: <20200305171453.GA24026@localhost.localdomain> (raw)
In-Reply-To: <20200305133205.GV3335@pengutronix.de>

On Thu, Mar 05, 2020 at 02:32:05PM +0100, Sascha Hauer wrote:
> On Thu, Feb 27, 2020 at 08:26:46PM +0300, Peter Mamonov wrote:
> > This patch adds translation from CPU to DMA addresses, which is required for
> > proper operation on certain architectures like MIPS.
> > 
> > This patch also fixes the bug introduced by 4350744bf5 "usb: ehci-hcd: port
> > periodic transactions implementation from the u-boot", which is still present
> > in the original U-Boot code:
> > 
> > 	td->qt_buffer[0] =
> > 		cpu_to_hc32((unsigned long)buffer + i * elementsize);
> > 	td->qt_buffer[1] =
> > 		cpu_to_hc32((td->qt_buffer[0] + 0x1000) & ~0xfff);
> > 	...
> > 
> > In case of a big-endian CPU 0x1000 is added to the byte-swapped value
> > `td->qt_buffer[0]`, the result is byte swapped once again and stored to
> > `td->qt_buffer[1]`. This results in erroneous values being stored in
> > `td->qt_buffer[1..4]`.
> > 
> > N.B.: This patch needs some testing on architectures different from MIPS.
> 
> I tested it on ARM. Yup, it works.

Thanks!

Peter

> 
> Applied, thanks
> 
> Sascha
> 
> 
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2020-03-05 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 17:26 Peter Mamonov
2020-03-05 13:32 ` Sascha Hauer
2020-03-05 17:14   ` Peter Mamonov [this message]

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=20200305171453.GA24026@localhost.localdomain \
    --to=pmamonov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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