mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: balbi@ti.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux USB Mailing List <linux-usb@vger.kernel.org>
Subject: Re: DeviceTree and children devices
Date: Mon, 24 Oct 2011 11:12:45 +0300	[thread overview]
Message-ID: <20111024081244.GD15288@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <CACxGe6v0kHNyO81XapR=jGEa8ZgJrUxN2EEiqW7c18NdurGNkg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1898 bytes --]

On Mon, Oct 24, 2011 at 09:58:39AM +0200, Grant Likely wrote:
> On Mon, Oct 24, 2011 at 9:49 AM, Felipe Balbi <balbi@ti.com> wrote:
> > On Mon, Oct 24, 2011 at 09:41:24AM +0200, Grant Likely wrote:
> >> On Mon, Oct 24, 2011 at 09:42:28AM +0300, Felipe Balbi wrote:
> >> > then I can drop the dwc3 platform_device allocation and all of that
> >> > resource copying, etc.
> >> >
> >> > What do you think ?
> >>
> >> Looks reasonable to me.  of_platform_populate() should be able to
> >> handle the device generation for you here.
> >
> > Ok cool I looking into that and it handles everything I need. There are
> > only three issues which I see:
> >
> > a) it hardcoded DMA mask to 32-bit. Right ?
> > b) it's not using dma_set_coherent_mask()
> > c) in case parent is a valid pointer, shouldn't it copy DMA mask from
> >        parent ?
> >
> > I mean (doesn't solve (a) above):
> >
> > diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> > index ed5a6d3..172d4a9 100644
> > --- a/drivers/of/platform.c
> > +++ b/drivers/of/platform.c
> > @@ -204,7 +204,12 @@ struct platform_device *of_platform_device_create_pdata(
> >  #if defined(CONFIG_MICROBLAZE)
> >        dev->archdata.dma_mask = 0xffffffffUL;
> >  #endif
> > -       dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > +
> > +       if (parent)
> > +               dma_set_coherent_mask(&dev->dev, parent->coherent_dma_mask);
> > +       else
> > +               dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
> > +
> 
> Right, this does need to be fixed.  The existing code just matched
> what the historical powerpc code did, but it is certainly not correct.

should I send patch above correctly ? Or do you want to also solve
32-bit coherent mask altogether ? What are your plans for that ? Add a
separate property to pass coherent_mask size (32-bit, 64-bit, etc) ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2011-10-24  8:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24  6:42 Felipe Balbi
2011-10-24  7:41 ` Grant Likely
2011-10-24  7:49   ` Felipe Balbi
2011-10-24  7:58     ` Grant Likely
2011-10-24  8:12       ` Felipe Balbi [this message]
2011-10-24  8:23         ` Grant Likely

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=20111024081244.GD15288@legolas.emea.dhcp.ti.com \
    --to=balbi@ti.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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®