From: m-karicheri2@ti.com (Murali Karicheri)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/4] of: move of_dma_configure() to device,c to help re-use
Date: Thu, 8 Jan 2015 14:26:36 -0500 [thread overview]
Message-ID: <54AED9EC.1020703@ti.com> (raw)
In-Reply-To: <3861625.CJ6m15sZMh@wuerfel>
On 01/08/2015 03:40 AM, Arnd Bergmann wrote:
> On Wednesday 07 January 2015 17:37:56 Rob Herring wrote:
>> On Wed, Jan 7, 2015 at 12:49 PM, Murali Karicheri<m-karicheri2@ti.com> wrote:
>>
>>> + ret = of_dma_get_range(np,&dma_addr,&paddr,&size);
>>> + if (ret< 0) {
>>> + dma_addr = offset = 0;
>>> + size = dev->coherent_dma_mask + 1;
>>
>> If coherent_dma_mask is DMA_BIT_MASK(64), then you will overflow and
>> have a size of 0. There may also be a problem when the mask is only
>> 32-bit type.
>
> The mask is always a 64-bit type, it's not optional. But you are right,
> the 64-bit mask case is broken, so I guess we have to fix it differently
> by always passing the smaller value into arch_setup_dma_ops and
> adapting that function instead.
Arnd,
What is the smaller value you are referring to in the below code?
between *dev->dma_mask and size from DT? But overflow can still happen
when size is to be calculated in arch_setup_dma_ops() for Non DT case or
when DT size is configured to be equivalent of DMA_BIT_MASK(64) + 1. Can
we discuss the code change you have in mind when you get a chance?
Murali
>
> Arnd
--
Murali Karicheri
Linux Kernel, Texas Instruments
next prev parent reply other threads:[~2015-01-08 19:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-07 18:49 [PATCH v3 0/4] PCI: get DMA configuration from parent device Murali Karicheri
2015-01-07 18:49 ` [PATCH v3 1/4] of: iommu: add ptr to OF node arg to of_iommu_configure() Murali Karicheri
2015-01-07 23:30 ` Rob Herring
2015-01-08 18:29 ` Murali Karicheri
2015-01-07 18:49 ` [PATCH v3 2/4] of: move of_dma_configure() to device, c to help re-use Murali Karicheri
2015-01-07 23:37 ` Rob Herring
2015-01-08 8:40 ` Arnd Bergmann
2015-01-08 19:26 ` Murali Karicheri [this message]
2015-01-08 22:24 ` Arnd Bergmann
2015-01-08 23:44 ` [PATCH v3 2/4] of: move of_dma_configure() to device,c " Murali Karicheri
2015-01-09 0:05 ` [PATCH v3 2/4] of: move of_dma_configure() to device, c " Arnd Bergmann
2015-01-09 15:34 ` Rob Herring
2015-01-23 18:19 ` [PATCH v3 2/4] of: move of_dma_configure() to device,c " Murali Karicheri
2015-01-23 18:35 ` [PATCH v3 2/4] of: move of_dma_configure() to device, c " Rob Herring
2015-01-07 18:49 ` [PATCH v3 3/4] of/pci: add of_pci_dma_configure() update dma configuration Murali Karicheri
2015-01-08 16:06 ` Will Deacon
2015-01-08 19:52 ` Murali Karicheri
2015-01-08 22:25 ` Arnd Bergmann
2015-01-08 22:46 ` Murali Karicheri
2015-01-09 11:32 ` Will Deacon
2015-01-07 18:49 ` [PATCH v3 4/4] PCI: update dma configuration from DT Murali Karicheri
2015-01-07 21:18 ` [PATCH v3 0/4] PCI: get DMA configuration from parent device Arnd Bergmann
2015-01-07 23:04 ` Murali Karicheri
2015-01-08 8:56 ` Arnd Bergmann
2015-01-08 15:54 ` Will Deacon
2015-01-08 22:27 ` Arnd Bergmann
2015-01-08 22:46 ` Murali Karicheri
2015-01-07 23:05 ` Murali Karicheri
2015-01-07 23:08 ` Bjorn Helgaas
2015-01-08 15:52 ` Murali Karicheri
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=54AED9EC.1020703@ti.com \
--to=m-karicheri2@ti.com \
--cc=linux-arm-kernel@lists.infradead.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).