All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: Arnd Bergmann <arnd@arndb.de>,
	Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: heiko@sntech.de, David Airlie <airlied@gmail.com>,
	Rob Clark <robdclark@gmail.com>, Rob Herring <robh+dt@kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Grant Likely <grant.likely@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	John Stultz <john.stultz@linaro.org>,
	Rom Lemarchand <romlem@google.com>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-api@vger.kernel.org, linux-rockchip@lists.infradead.org,
	dianders@chromium.org, marcheu@chromium.org, dbehr@chromium.org,
	olof@lixom.net, djkurtz@chromium.org, xjq@rock-chips.com,
	kfx@rock-chips.com, cym@rock-chips.com, cf@rock-chips.com,
	zyw@rock-chips.com, xxm@rock-chips.com, huangtao@rock-chips.com,
	kever.yang@rock-chips.com, yxj@rock-chips.com, wxt@r.NULL.NULL,
	ock-chips.com@NULL.NULL, xw@rock-chips.com
Subject: Re: [PATCH v4 1/5] drm/rockchip: Add basic drm driver
Date: Tue, 23 Sep 2014 15:09:37 +0800	[thread overview]
Message-ID: <54211CB1.6050002@rock-chips.com> (raw)
In-Reply-To: <3102396.6rAQmqkXXM@wuerfel>

On 2014年09月22日 23:54, Arnd Bergmann wrote:
> On Monday 22 September 2014 17:15:06 Boris BREZILLON wrote:
>>>> +
>>>> +   /* TODO(djkurtz): fetch the mapping start/size from somewhere */
>>>> +   mapping = arm_iommu_create_mapping(&platform_bus_type, 0x10000000,
>>>> +                                      SZ_1G);
>>>> +   if (IS_ERR(mapping)) {
>>>> +           ret = PTR_ERR(mapping);
>>>> +           goto err_config_cleanup;
>>>> +   }
>>>> +
>>>> +   dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>>> This is the default coherent mask. If you call this function, you
>>> should normally check the return value, or call dma_set_mask first,
>>> which you apparently don't do here, and in another place in this
>>> patch.
>> By "This is the default mask" do you mean it shouldn't be called at
>> all ? Cause I ran into some trouble when not calling this in my
>> atmel-hlcdc driver.
> We used to get this wrong in the of_platform code, but it should
> work now.
>
>> Actually, in my case the platform device is created by the MFD core
>> which seems to let the coherent_dma_mask uninitialized.
> That may well be different, but it seems like a good idea to allow
> the MFD core to set this up as well.
>
> In general, we expect that devices that are capable of doing DMA
> start with a 32-bit mask for both dma_mask and dma_coherent_mask,
> and a driver that requires a smaller masks or wants a larger mask
> has to call the appropriate interface to set these, and check the
> return value.
so I think we can use dma_set_mask_and_coherent(...) to set dma_mask and 
dma_coherent_mark
at the same time, and check the return value.
> 	Arnd
>
>
>



WARNING: multiple messages have this Message-ID (diff)
From: Mark yao <mark.yao@rock-chips.com>
To: Arnd Bergmann <arnd@arndb.de>,
	Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: heiko@sntech.de, David Airlie <airlied@gmail.com>,
	Rob Clark <robdclark@gmail.com>, Rob Herring <robh+dt@kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Grant Likely <grant.likely@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	John Stultz <john.stultz@linaro.org>,
	Rom Lemarchand <romlem@google.com>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-api@vger.kernel.org, linux-rockchip@lists.infradead.org,
	dianders@chromium.org, marcheu@chromium.org, dbehr@chromium.org,
	olof@lixom.net, djkurtz@chromium.org, xjq@rock-chips.com,
	kfx@rock-chips.com, cym@rock-chips.com, cf@rock-chips.com,
	zyw@rock-chips.com, xxm@rock-chips.com, huang
Subject: Re: [PATCH v4 1/5] drm/rockchip: Add basic drm driver
Date: Tue, 23 Sep 2014 15:09:37 +0800	[thread overview]
Message-ID: <54211CB1.6050002@rock-chips.com> (raw)
In-Reply-To: <3102396.6rAQmqkXXM@wuerfel>

On 2014年09月22日 23:54, Arnd Bergmann wrote:
> On Monday 22 September 2014 17:15:06 Boris BREZILLON wrote:
>>>> +
>>>> +   /* TODO(djkurtz): fetch the mapping start/size from somewhere */
>>>> +   mapping = arm_iommu_create_mapping(&platform_bus_type, 0x10000000,
>>>> +                                      SZ_1G);
>>>> +   if (IS_ERR(mapping)) {
>>>> +           ret = PTR_ERR(mapping);
>>>> +           goto err_config_cleanup;
>>>> +   }
>>>> +
>>>> +   dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>>> This is the default coherent mask. If you call this function, you
>>> should normally check the return value, or call dma_set_mask first,
>>> which you apparently don't do here, and in another place in this
>>> patch.
>> By "This is the default mask" do you mean it shouldn't be called at
>> all ? Cause I ran into some trouble when not calling this in my
>> atmel-hlcdc driver.
> We used to get this wrong in the of_platform code, but it should
> work now.
>
>> Actually, in my case the platform device is created by the MFD core
>> which seems to let the coherent_dma_mask uninitialized.
> That may well be different, but it seems like a good idea to allow
> the MFD core to set this up as well.
>
> In general, we expect that devices that are capable of doing DMA
> start with a 32-bit mask for both dma_mask and dma_coherent_mask,
> and a driver that requires a smaller masks or wants a larger mask
> has to call the appropriate interface to set these, and check the
> return value.
so I think we can use dma_set_mask_and_coherent(...) to set dma_mask and 
dma_coherent_mark
at the same time, and check the return value.
> 	Arnd
>
>
>



  reply	other threads:[~2014-09-23  7:09 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 10:47 [PATCH v4 0/5] Add drm driver for Rockchip Socs Mark yao
2014-09-22 10:47 ` Mark yao
2014-09-22 10:48 ` [PATCH v4 1/5] drm/rockchip: Add basic drm driver Mark yao
2014-09-22 13:24   ` Boris BREZILLON
2014-09-22 13:24     ` Boris BREZILLON
2014-09-23  5:59     ` Mark yao
2014-09-23  5:59       ` Mark yao
2014-09-22 14:43   ` Arnd Bergmann
2014-09-22 14:43     ` Arnd Bergmann
2014-09-22 15:15     ` Boris BREZILLON
2014-09-22 15:15       ` Boris BREZILLON
2014-09-22 15:54       ` Arnd Bergmann
2014-09-22 15:54         ` Arnd Bergmann
2014-09-23  7:09         ` Mark yao [this message]
2014-09-23  7:09           ` Mark yao
2014-09-23  8:11           ` Arnd Bergmann
2014-09-23  8:11             ` Arnd Bergmann
2014-09-23  7:05     ` Mark yao
2014-09-23  7:05       ` Mark yao
2014-09-22 19:10   ` Rob Clark
2014-09-22 19:10     ` Rob Clark
2014-09-23  6:50     ` Mark yao
2014-09-23  6:50       ` Mark yao
2014-09-24  8:20   ` Daniel Vetter
2014-09-24  8:20     ` Daniel Vetter
2014-09-24  9:31     ` Mark yao
2014-09-24  9:31       ` Mark yao
2014-09-24 11:20       ` Daniel Vetter
2014-09-24 11:20         ` Daniel Vetter
2014-09-25  0:54         ` Mark yao
2014-09-25 19:30           ` Daniel Vetter
2014-09-25 19:30             ` Daniel Vetter
2014-09-22 10:50 ` [PATCH v4 2/5] dt-bindings: video: Add for rockchip display subsytem Mark yao
2014-09-22 10:57 ` [PATCH v4 3/5] dt-bindings: video: Add documentation for rockchip vop Mark yao
2014-09-22 10:57   ` Mark yao
2014-09-22 10:58 ` [PATCH v4 4/5] dt-bindings: video: Add documentation for rockchip edp Mark yao
2014-09-22 10:58   ` Mark yao
2014-09-22 11:02 ` [PATCH v4 5/5] drm/rockchip: Add support for Rockchip Soc EDP Mark yao
2014-09-22 11:02   ` Mark yao
2014-09-22 19:20   ` Rob Clark
2014-09-22 19:20     ` Rob Clark
2014-09-23  8:47     ` cym
2014-09-23  8:47       ` cym
2014-09-23 13:56       ` Rob Clark
2014-09-23 13:56         ` Rob Clark
2014-09-23 23:35         ` Rob Clark
2014-09-23 23:35           ` Rob Clark
2014-09-24 10:30           ` jeff chen
2014-09-24 10:30             ` jeff chen

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=54211CB1.6050002@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=airlied@gmail.com \
    --cc=arnd@arndb.de \
    --cc=boris.brezillon@free-electrons.com \
    --cc=cf@rock-chips.com \
    --cc=cym@rock-chips.com \
    --cc=dbehr@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=djkurtz@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=john.stultz@linaro.org \
    --cc=kever.yang@rock-chips.com \
    --cc=kfx@rock-chips.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=marcheu@chromium.org \
    --cc=mark.rutland@arm.com \
    --cc=ock-chips.com@NULL.NULL \
    --cc=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=rdunlap@infradead.org \
    --cc=robdclark@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=romlem@google.com \
    --cc=wxt@r.NULL.NULL \
    --cc=xjq@rock-chips.com \
    --cc=xw@rock-chips.com \
    --cc=xxm@rock-chips.com \
    --cc=yxj@rock-chips.com \
    --cc=zyw@rock-chips.com \
    /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.