All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Müllner" <christoph.muellner@theobroma-systems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] bouncebuf: Add DMA validation check to addr_aligned().
Date: Tue, 7 May 2019 15:48:28 +0200	[thread overview]
Message-ID: <c91801a3-2356-73c8-36f3-1a47a398d854@theobroma-systems.com> (raw)
In-Reply-To: <6722138c-bbb2-e9eb-4321-4be99b2aee10@denx.de>



On 07.05.19 15:05, Marek Vasut wrote:
> On 5/7/19 11:05 AM, Christoph Muellner wrote:
>> Currently addr_aligned() performs an alignment and a length check
>> to validate the DMA address. However, some machines have stricter
>> restrictions of DMA-able addresses.
>>
>> This patch adds a call to mach_addr_is_dmaable() to honor this
>> machine specific restrictions.
>>
>> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
>> ---
>>
>>  common/bouncebuf.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/common/bouncebuf.c b/common/bouncebuf.c
>> index a7098e2caf..26ddf30ea2 100644
>> --- a/common/bouncebuf.c
>> +++ b/common/bouncebuf.c
>> @@ -26,6 +26,12 @@ static int addr_aligned(struct bounce_buffer *state)
>>  		return 0;
>>  	}
>>  
>> +	/* Check if valid DMA address. */
>> +	if (!mach_addr_is_dmaable((ulong)state->user_buffer)) {
> 
> Is the cast necessary ?

Of course not.
Will be fixed in v2.

Thanks!

> 
>> +		debug("Buffer address is not DMA-able\n");
>> +		return 0;
>> +	}
>> +
>>  	/* Aligned */
>>  	return 1;
>>  }
>>
> 
> 

  reply	other threads:[~2019-05-07 13:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  9:05 [U-Boot] [PATCH 1/3] board_f: Add mach specific DMA address check function Christoph Muellner
2019-05-07  9:05 ` [U-Boot] [PATCH 2/3] bouncebuf: Add DMA validation check to addr_aligned() Christoph Muellner
2019-05-07 13:05   ` Marek Vasut
2019-05-07 13:48     ` Christoph Müllner [this message]
2019-05-07 13:52       ` Christoph Müllner
2019-05-07 13:53         ` Marek Vasut
2019-05-07 14:01           ` Christoph Müllner
2019-05-07 15:04             ` Marek Vasut
2019-05-07 15:22               ` Christoph Müllner
2019-05-07 15:56                 ` Marek Vasut
2019-05-07 16:02                   ` Christoph Müllner
2019-05-18 16:08   ` Simon Glass
2019-06-04  3:23     ` [U-Boot] [PATCH 2/3] bouncebuf: Add DMA validation check to addr_aligned().【请注意,邮件由u-boot-bounces@lists.denx.de代发】 addr_aligned() Kever Yang
2019-07-04 20:43       ` Heiko Stübner
2019-07-06 17:16         ` Simon Glass
2019-07-06 18:04           ` Heiko Stuebner
2019-08-22 23:12             ` Heiko Stuebner
2019-05-07  9:05 ` [U-Boot] [PATCH 3/3] rk3399: Add restriction for DMA-able addresses Christoph Muellner
2019-06-04  3:07   ` Kever Yang
2019-06-04  3:09 ` [U-Boot] [PATCH 1/3] board_f: Add mach specific DMA address check function Kever Yang

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=c91801a3-2356-73c8-36f3-1a47a398d854@theobroma-systems.com \
    --to=christoph.muellner@theobroma-systems.com \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.