cron job: media_tree daily build: WARNINGS

2013-09-20 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Sat Sep 21 04:00:16 CEST 2013
git branch: test
git hash:   f66b2a1c7f2ae3fb0d5b67d07ab4f5055fd3cf16
gcc version:i686-linux-gcc (GCC) 4.8.1
sparse version: 0.4.5-rc1
host hardware:  x86_64
host os:3.10.1

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: OK
linux-2.6.32.27-i686: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.10.1-i686: OK
linux-3.1.10-i686: OK
linux-3.11.1-i686: OK
linux-3.12-rc1-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-2.6.31.14-x86_64: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12-rc1-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
apps: WARNINGS
spec-git: OK
ABI WARNING: change for arm-at91
ABI WARNING: change for arm-davinci
ABI WARNING: change for arm-exynos
ABI WARNING: change for arm-mx
ABI WARNING: change for arm-omap
ABI WARNING: change for arm-omap1
ABI WARNING: change for arm-pxa
ABI WARNING: change for blackfin
ABI WARNING: change for i686
ABI WARNING: change for m32r
ABI WARNING: change for mips
ABI WARNING: change for powerpc64
ABI WARNING: change for sh
ABI WARNING: change for x86_64
sparse version: 0.4.5-rc1
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[su3000]Montage M88DS3000 demodulator firmware confusion

2013-09-20 Thread Olcay Korkmaz
Hi

I have a su3000 dvb-s2 usb device it's supported by linux, device also
require dvb-fe-su3000.fw firmware to work but it can work with
dvbsky's firmware it's name was dvb-fe-ds300x.fw

What is the difference between dvb-fe-ds3000.fw and dvb-fe-ds300x.fw
is there any own version number on firmware

Regards
-- 
Olcay K.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
Hey,

On Fri, Sep 20, 2013 at 03:00:18PM +0100, Russell King - ARM Linux wrote:
> Another would be if subsystem maintainers are happy that I carry them,
> I can add the acks, and then later on towards the end of the cycle,
> provide a branch subsystem maintainers could pull.
> 
> Or... if you can think of something easier...

I'm happy with the latter method and it's likely that you'll end up
carrying at least some of the patches through your tree anyway.
Please feel free to add my acks to all libata related patches and
carry them through your tree.

Thanks and have fun routing.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: add driver for dual LED Flash, lm3560.

2013-09-20 Thread Sakari Ailus
Hi Daniel,

A few more comments.

On Wed, Sep 11, 2013 at 04:45:31PM +0900, Daniel Jeong wrote:
...
> +struct lm3560_flash {
> + struct lm3560_platform_data *pdata;
> + struct regmap *regmap;
> + struct mutex power_lock;
> + int power_count;
> +
> + enum v4l2_flash_led_mode led_mode;
> + u8 fault;

If you have common properties, you can use v4l2_ctrl_add_handler() to get a
reference of a contro (or controls) from another handler. No tricks needed.

I thik it'd still make sense to 

> + /* LED1 */
> + struct v4l2_ctrl_handler ctrls_led1;
> + struct v4l2_subdev subdev_led1;
> + /* LED2 */
> + struct v4l2_ctrl_handler ctrls_led2;
> + struct v4l2_subdev subdev_led2;
> +};
> +
> +/* i2c access */
> +static int lm3560_read(struct lm3560_flash *flash, unsigned int reg)
> +{
> + int rval;
> + unsigned int reg_val;
> +
> + rval = regmap_read(flash->regmap, reg, ®_val);
> + if (rval < 0)
> + return rval;
> + return reg_val & 0xFF;

What does lm3650_read() actually do for you?

> +}
> +
> +static int lm3560_update(struct lm3560_flash *flash,
> + unsigned int reg, unsigned int mask, unsigned int data)
> +{
> + return regmap_update_bits(flash->regmap, reg, mask, data);
> +}
> +
> +/* enable mode control */
> +static int lm3560_mode_ctrl(struct lm3560_flash *flash)
> +{
> + int rval = 0;
> +
> + rval = lm3560_update(flash, REG_FLASH_TOUT,
> +   PEAK_I_MASK, flash->pdata->peak);
> + if (rval < 0)
> + return rval;
> +
> + switch (flash->led_mode) {
> + case V4L2_FLASH_LED_MODE_NONE:
> + rval = lm3560_update(flash,
> +  REG_ENABLE, ENABLE_MODE_MASK, MODE_SHDN);
> + break;
> + case V4L2_FLASH_LED_MODE_TORCH:
> + rval = lm3560_update(flash,
> +  REG_ENABLE, ENABLE_MODE_MASK, MODE_TORCH);
> + break;
> + case V4L2_FLASH_LED_MODE_FLASH:
> + rval = lm3560_update(flash,
> +  REG_ENABLE, ENABLE_MODE_MASK, MODE_FLASH);
> + break;
> + }
> +
> + return rval;
> +}
> +
> +/* led1/2  enable/disable */
> +static int lm3560_enable_ctrl(struct lm3560_flash *flash,
> +   enum lm3560_led_id led_no, bool on)
f> +{
> + int rval = 0;
> +
> + if (led_no == LM3560_LED1) {
> + if (on == true)
> + rval = lm3560_update(flash, REG_ENABLE,
> +  LED1_ENABLE_MASK, LED1_ENABLE);
> + else
> + rval = lm3560_update(flash,
> +  REG_ENABLE, LED1_ENABLE_MASK, 0);
> + } else {
> + if (on == true)
> + rval = lm3560_update(flash, REG_ENABLE,
> +  LED2_ENABLE_MASK, LED2_ENABLE);
> + else
> + rval = lm3560_update(flash,
> +  REG_ENABLE, LED2_ENABLE_MASK, 0);
> + }
> + return rval;
> +}
> +
> +/* torch1/2 brightness control */
> +static int lm3560_torch_brt_ctrl(struct lm3560_flash *flash,
> +  enum lm3560_led_id led_no, unsigned int brt)
> +{
> + int rval;
> + u8 br_bits;
> +
> + if (brt < LM3560_TORCH_BRT_MIN) {
> + rval = lm3560_enable_ctrl(flash, led_no, false);
> + goto out;
> + } else {
> + rval = lm3560_enable_ctrl(flash, led_no, true);
> + }
> +
> + br_bits = LM3560_TORCH_BRT_uA_TO_REG(brt);
> + if (led_no == LM3560_LED1) {
> + rval = lm3560_update(flash, REG_TORCH_BR,
> +  TORCH1_BR_MASK, TORCH1_BR_DATA(br_bits));
> + if (rval < 0)
> + goto out;
> + } else {
> + rval = lm3560_update(flash, REG_TORCH_BR,
> +  TORCH2_BR_MASK, TORCH2_BR_DATA(br_bits));
> + if (rval < 0)
> + goto out;
> + }
> +out:
> + return rval;
> +}
> +
> +/* flash1/2 brightness control */
> +static int lm3560_flash_brt_ctrl(struct lm3560_flash *flash,
> +  enum lm3560_led_id led_no, unsigned int brt)
> +{
> + int rval;
> + u8 br_bits;
> +
> + if (brt < LM3560_FLASH_BRT_MIN) {
> + rval = lm3560_enable_ctrl(flash, led_no, false);
> + goto out;
> + } else {
> + rval = lm3560_enable_ctrl(flash, led_no, true);
> + }
> +
> + br_bits = LM3560_FLASH_BRT_uA_TO_REG(brt);
> + if (led_no == LM3560_LED1) {
> + rval = lm3560_update(flash, REG_FLASH_BR,
> +  FLASH1_BR_MASK, FLASH1_BR_DATA(br_bits));
> + if (rval < 0)
> + goto out;
> + } else {
> + rval = lm3560_update(flash, REG_FLASH_BR,
> +  

Re: [PATCH 1/4] media: Add pad flag MEDIA_PAD_FL_MUST_CONNECT

2013-09-20 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Thursday 19 September 2013 01:01:05 Sakari Ailus wrote:
> Pads that set this flag must be connected by an active link for the entity
> to stream.
> 
> Signed-off-by: Sakari Ailus 
> Acked-by: Sylwester Nawrocki 
> ---
>  Documentation/DocBook/media/v4l/media-ioc-enum-links.xml |8 
>  include/uapi/linux/media.h   |1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml
> b/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml index
> 355df43..59b212a 100644
> --- a/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml
> +++ b/Documentation/DocBook/media/v4l/media-ioc-enum-links.xml
> @@ -134,6 +134,14 @@
>   Output pad, relative to the entity. Output pads source data
>   and are origins of links.
> 
> +   
> + MEDIA_PAD_FL_MUST_CONNECT
> + A pad must be connected with an enabled link for the

s/A pad/The pad/ ?

> + entity to be able to stream. There could be temporary reasons
> + (e.g. device configuration dependent) for the pad to need
> + connecting; the absence of the flag won't say there
> + may not be any.

I believe the description doesn't make it very explicit that a MUST_CONNECT 
pad with no existing link is valid, as opposed to existing links with no 
enabled link, which would be invalid. Do you think we should fix that ?

> +   
>   
>
>  
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index ed49574..d847c76 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -98,6 +98,7 @@ struct media_entity_desc {
> 
>  #define MEDIA_PAD_FL_SINK(1 << 0)
>  #define MEDIA_PAD_FL_SOURCE  (1 << 1)
> +#define MEDIA_PAD_FL_MUST_CONNECT(1 << 2)
> 
>  struct media_pad_desc {
>   __u32 entity;   /* entity ID */
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] omap3isp: Mark which pads must connect

2013-09-20 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Thursday 19 September 2013 01:01:07 Sakari Ailus wrote:
> Mark pads that must be connected.
> 
> Signed-off-by: Sakari Ailus 
> ---
>  drivers/media/platform/omap3isp/ispccdc.c|3 ++-
>  drivers/media/platform/omap3isp/ispccp2.c|3 ++-
>  drivers/media/platform/omap3isp/ispcsi2.c|3 ++-
>  drivers/media/platform/omap3isp/isppreview.c |3 ++-
>  drivers/media/platform/omap3isp/ispresizer.c |3 ++-
>  drivers/media/platform/omap3isp/ispstat.c|2 +-
>  drivers/media/platform/omap3isp/ispvideo.c   |6 --
>  7 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/ispccdc.c
> b/drivers/media/platform/omap3isp/ispccdc.c index 907a205..a99dd0a 100644
> --- a/drivers/media/platform/omap3isp/ispccdc.c
> +++ b/drivers/media/platform/omap3isp/ispccdc.c
> @@ -2484,7 +2484,8 @@ static int ccdc_init_entities(struct isp_ccdc_device
> *ccdc) v4l2_set_subdevdata(sd, ccdc);
>   sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;
> 
> - pads[CCDC_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> + pads[CCDC_PAD_SINK].flags = MEDIA_PAD_FL_SINK
> + | MEDIA_PAD_FL_MUST_CONNECT;

What about aligning the | to the = ? With that change here and below,

Acked-by: Laurent Pinchart 

>   pads[CCDC_PAD_SOURCE_VP].flags = MEDIA_PAD_FL_SOURCE;
>   pads[CCDC_PAD_SOURCE_OF].flags = MEDIA_PAD_FL_SOURCE;
> 
> diff --git a/drivers/media/platform/omap3isp/ispccp2.c
> b/drivers/media/platform/omap3isp/ispccp2.c index e716514..2c652d3 100644
> --- a/drivers/media/platform/omap3isp/ispccp2.c
> +++ b/drivers/media/platform/omap3isp/ispccp2.c
> @@ -1076,7 +1076,8 @@ static int ccp2_init_entities(struct isp_ccp2_device
> *ccp2) v4l2_set_subdevdata(sd, ccp2);
>   sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> 
> - pads[CCP2_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> + pads[CCP2_PAD_SINK].flags = MEDIA_PAD_FL_SINK
> + | MEDIA_PAD_FL_MUST_CONNECT;
>   pads[CCP2_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
> 
>   me->ops = &ccp2_media_ops;
> diff --git a/drivers/media/platform/omap3isp/ispcsi2.c
> b/drivers/media/platform/omap3isp/ispcsi2.c index 6db245d..58e40b9 100644
> --- a/drivers/media/platform/omap3isp/ispcsi2.c
> +++ b/drivers/media/platform/omap3isp/ispcsi2.c
> @@ -1245,7 +1245,8 @@ static int csi2_init_entities(struct isp_csi2_device
> *csi2) sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> 
>   pads[CSI2_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
> - pads[CSI2_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> + pads[CSI2_PAD_SINK].flags = MEDIA_PAD_FL_SINK
> + | MEDIA_PAD_FL_MUST_CONNECT;
> 
>   me->ops = &csi2_media_ops;
>   ret = media_entity_init(me, CSI2_PADS_NUM, pads, 0);
> diff --git a/drivers/media/platform/omap3isp/isppreview.c
> b/drivers/media/platform/omap3isp/isppreview.c index cd8831a..bdb8fd7
> 100644
> --- a/drivers/media/platform/omap3isp/isppreview.c
> +++ b/drivers/media/platform/omap3isp/isppreview.c
> @@ -2283,7 +2283,8 @@ static int preview_init_entities(struct
> isp_prev_device *prev) v4l2_ctrl_handler_setup(&prev->ctrls);
>   sd->ctrl_handler = &prev->ctrls;
> 
> - pads[PREV_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> + pads[PREV_PAD_SINK].flags = MEDIA_PAD_FL_SINK
> + | MEDIA_PAD_FL_MUST_CONNECT;
>   pads[PREV_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
> 
>   me->ops = &preview_media_ops;
> diff --git a/drivers/media/platform/omap3isp/ispresizer.c
> b/drivers/media/platform/omap3isp/ispresizer.c index d11fb26..6509d66
> 100644
> --- a/drivers/media/platform/omap3isp/ispresizer.c
> +++ b/drivers/media/platform/omap3isp/ispresizer.c
> @@ -1701,7 +1701,8 @@ static int resizer_init_entities(struct isp_res_device
> *res) v4l2_set_subdevdata(sd, res);
>   sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> 
> - pads[RESZ_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> + pads[RESZ_PAD_SINK].flags = MEDIA_PAD_FL_SINK
> + | MEDIA_PAD_FL_MUST_CONNECT;
>   pads[RESZ_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
> 
>   me->ops = &resizer_media_ops;
> diff --git a/drivers/media/platform/omap3isp/ispstat.c
> b/drivers/media/platform/omap3isp/ispstat.c index 61e17f9..a75407c 100644
> --- a/drivers/media/platform/omap3isp/ispstat.c
> +++ b/drivers/media/platform/omap3isp/ispstat.c
> @@ -1067,7 +1067,7 @@ static int isp_stat_init_entities(struct ispstat
> *stat, const char *name, subdev->flags |= V4L2_SUBDEV_FL_HAS_EVENTS |
> V4L2_SUBDEV_FL_HAS_DEVNODE; v4l2_set_subdevdata(subdev, stat);
> 
> - stat->pad.flags = MEDIA_PAD_FL_SINK;
> + stat->pad.flags = MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_MUST_CONNECT;
>   me->ops = NULL;
> 
>   return media_entity_init(me, 1, &stat->pad, 0);
> diff --git a/drivers/media/platform/omap3isp/ispvideo.c
> b/drivers/media/platform/omap3isp/ispvideo.c index a908d00..1b0311c 100644
> --- a/drivers/media/platform/omap3isp/ispvideo.c
> +++ b/drivers/media/platform/omap3isp

Re: [PATCH 2/4] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNECT flag

2013-09-20 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Thursday 19 September 2013 01:01:06 Sakari Ailus wrote:
> Do not allow streaming if a pad with MEDIA_PAD_FL_MUST_CONNECT flag is not
> connected by an active link.
> 
> This patch makes it possible to avoid drivers having to check for the most
> common case of link state validation: a sink pad that must be connected.
> 
> Signed-off-by: Sakari Ailus 
> Tested-by: Sylwester Nawrocki 
> ---
>  drivers/media/media-entity.c |   41 ---
>  1 file changed, 34 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index 2c286c3..a996e0a 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -235,6 +235,8 @@ __must_check int media_entity_pipeline_start(struct
> media_entity *entity, media_entity_graph_walk_start(&graph, entity);
> 
>   while ((entity = media_entity_graph_walk_next(&graph))) {
> + DECLARE_BITMAP(active, entity->num_pads);
> + DECLARE_BITMAP(has_no_links, entity->num_pads);
>   unsigned int i;
> 
>   entity->stream_count++;
> @@ -248,21 +250,46 @@ __must_check int media_entity_pipeline_start(struct
> media_entity *entity, if (!entity->ops || !entity->ops->link_validate)
>   continue;
> 
> + bitmap_zero(active, entity->num_pads);
> + bitmap_fill(has_no_links, entity->num_pads);
> +
>   for (i = 0; i < entity->num_links; i++) {
>   struct media_link *link = &entity->links[i];
> -
> - /* Is this pad part of an enabled link? */
> - if (!(link->flags & MEDIA_LNK_FL_ENABLED))
> - continue;
> -
> - /* Are we the sink or not? */
> - if (link->sink->entity != entity)
> + struct media_pad *pad = link->sink->entity == entity
> + ? link->sink : link->source;

What about aligning the ? to the = ? With that change,

Acked-by: Laurent Pinchart 

> +
> + /* Mark that a pad is connected by a link. */
> + bitmap_clear(has_no_links, pad->index, 1);
> +
> + /*
> +  * Pads that either do not need to connect or
> +  * are connected through an enabled link are
> +  * fine.
> +  */
> + if (!(pad->flags & MEDIA_PAD_FL_MUST_CONNECT) ||
> + link->flags & MEDIA_LNK_FL_ENABLED)
> + bitmap_set(active, pad->index, 1);
> +
> + /*
> +  * Link validation will only take place for
> +  * sink ends of the link that are enabled.
> +  */
> + if (link->sink != pad ||
> + !(link->flags & MEDIA_LNK_FL_ENABLED))
>   continue;
> 
>   ret = entity->ops->link_validate(link);
>   if (ret < 0 && ret != -ENOIOCTLCMD)
>   goto error;
>   }
> +
> + /* Either no links or validated links are fine. */
> + bitmap_or(active, active, has_no_links, entity->num_pads);
> +
> + if (!bitmap_full(active, entity->num_pads)) {
> + ret = -EPIPE;
> + goto error;
> + }
>   }
> 
>   mutex_unlock(&mdev->graph_mutex);
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/7] staging: media/lirc: switch to use gpiolib

2013-09-20 Thread Linus Walleij
On Fri, Sep 13, 2013 at 9:14 AM, Linus Walleij  wrote:
> Hi Mauro,
>
> On Tue, Sep 10, 2013 at 2:31 PM, Linus Walleij  
> wrote:
>
>> The lirc serial module has special hooks to work with NSLU2,
>> switch these over to use gpiolib, as that is available on the
>> ixp4 platform.
>>
>> Not even compile tested as there is no way to select this
>> driver from menuconfig on the ixp4 platform.
>>
>> Cc: Imre Kaloz 
>> Cc: Krzysztof Halasa 
>> Cc: Alexandre Courbot 
>> Cc: Greg Kroah-Hartman 
>> Signed-off-by: Linus Walleij 
>> ---
>> Hi Greg: I'm seeking an ACK on this patch to take it through
>> the GPIO tree as part of a clean-up attempt to remove custom
>> GPIO APIs.
>
> Could you ACK this patch if it looks OK to you?

Mauro, ping on this.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] saa7134: Fix crash when device is closed before streamoff

2013-09-20 Thread Simon Farnsworth
pm_qos_remove_request was not called on video_release, resulting in the PM
core's list of requests being corrupted when the file handle was freed.

This has no immediate symptoms, but later in operation, the kernel will
panic as the PM core dereferences a dangling pointer.

Signed-off-by: Simon Farnsworth 
Cc: sta...@vger.kernel.org
---

I didn't notice this when I first implemented the pm_qos_request as the
userspace I was using always called streamoff before closing the
device. I've since changed userspace components, and hit the kernel panic.

 drivers/media/pci/saa7134/saa7134-video.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/saa7134/saa7134-video.c 
b/drivers/media/pci/saa7134/saa7134-video.c
index e12bbd8..fb60da8 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -1455,6 +1455,7 @@ static int video_release(struct file *file)
 
/* stop video capture */
if (res_check(fh, RESOURCE_VIDEO)) {
+   pm_qos_remove_request(&dev->qos_request);
videobuf_streamoff(&fh->cap);
res_free(dev,fh,RESOURCE_VIDEO);
}
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Vážení E-mail užívateľa;

2013-09-20 Thread WebSupport Team

Vážení E-mail užívateľa;

Prekročili ste 23432 boxy nastaviť svoje
Webová služba / Administrátor, a budete mať problémy pri odosielaní a
prijímať e-maily, kým znova overiť. Musíte aktualizovať kliknutím na
odkaz nižšie a vyplňte údaje pre overenie vášho účtu
Prosím,   kliknite na odkaz nižšie alebo skopírovať vložiť do
e-prehliadač pre overenie Schránky.

http://webmailupdateonline2341.jimdo.com/


Pozor!
Ak tak neurobíte, budú mať obmedzený prístup k e-mailu schránky. Ak
sa
nepodarí aktualizovať svoj ​​účet do troch dní od aktualizácie
oznámenia,
bude váš účet natrvalo uzavretá.
S pozdravom,
System Administrator ®
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8] s5k5baf: add camera sensor driver

2013-09-20 Thread Mark Rutland
On Fri, Sep 06, 2013 at 11:31:06AM +0100, Andrzej Hajda wrote:
> Driver for Samsung S5K5BAF UXGA 1/5" 2M CMOS Image Sensor
> with embedded SoC ISP.
> The driver exposes the sensor as two V4L2 subdevices:
> - S5K5BAF-CIS - pure CMOS Image Sensor, fixed 1600x1200 format,
>   no controls.
> - S5K5BAF-ISP - Image Signal Processor, formats up to 1600x1200,
>   pre/post ISP cropping, downscaling via selection API, controls.
> 
> Signed-off-by: Sylwester Nawrocki 
> Signed-off-by: Andrzej Hajda 
> Signed-off-by: Kyungmin Park 
> ---
> Hi,
> 
> This is the 8th iteration of the patch.
> I have applied suggestions from Laurent, Sylwester and Mark, thanks.
> One exeception, I have left static struct v4l2_rect s5k5baf_cis_rect
> not const due to fact its address is passed to function which could
> modify its arguments, of course it never modifies s5k5baf_cis_rect.
> 
> Regards
> Andrzej
> 
> v8
> - improved description of data-lanes binding,
> - added algorithm caching,
> - added comments to functions,
> - video bus type checking moved to probe,
> - clk_get/put moved to probe,
> - moved streaming checking under mutex,
> - use proper functions for endian conversion,
> - probe returns -EPROBE_DEFER in case it cannot get clock,
> - v4l2_async_unregister_subdev is called on remove,
> - cosmetic changes
> 
> v7
> - changed description of 'clock-frequency' DT property
> 
> v6
> - endpoint node presence is now optional,
> - added asynchronous subdev registration support and clock
>   handling,
> - use named gpios in DT bindings
> 
> v5
> - removed hflip/vflip device tree properties
> 
> v4
> - GPL changed to GPLv2,
> - bitfields replaced by u8,
> - cosmetic changes,
> - corrected s_stream flow,
> - gpio pins are no longer exported,
> - added I2C addresses to subdev names,
> - CIS subdev registration postponed after
>   succesfull HW initialization,
> - added enums for pads,
> - selections are initialized only during probe,
> - default resolution changed to 1600x1200,
> - state->error pattern removed from few other functions,
> - entity link creation moved to registered callback.
> 
> v3:
> - narrowed state->error usage to i2c and power errors,
> - private gain controls replaced by red/blue balance user controls,
> - added checks to devicetree gpio node parsing
> 
> v2:
> - lower-cased driver name,
> - removed underscore from regulator names,
> - removed platform data code,
> - v4l controls grouped in anonymous structs,
> - added s5k5baf_clear_error function,
> - private controls definitions moved to uapi header file,
> - added v4l2-controls.h reservation for private controls,
> - corrected subdev registered/unregistered code,
> - .log_status sudbev op set to v4l2 helper,
> - moved entity link creation to probe routines,
> - added cleanup on error to probe function.
> ---
>  .../devicetree/bindings/media/samsung-s5k5baf.txt  |   58 +
>  MAINTAINERS|7 +
>  drivers/media/i2c/Kconfig  |7 +
>  drivers/media/i2c/Makefile |1 +
>  drivers/media/i2c/s5k5baf.c| 2050 
> 
>  5 files changed, 2123 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/media/samsung-s5k5baf.txt
>  create mode 100644 drivers/media/i2c/s5k5baf.c
> 
> diff --git a/Documentation/devicetree/bindings/media/samsung-s5k5baf.txt 
> b/Documentation/devicetree/bindings/media/samsung-s5k5baf.txt
> new file mode 100644
> index 000..7704a1e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/samsung-s5k5baf.txt
> @@ -0,0 +1,58 @@
> +Samsung S5K5BAF UXGA 1/5" 2M CMOS Image Sensor with embedded SoC ISP
> +
> +
> +Required properties:
> +
> +- compatible : "samsung,s5k5baf";
> +- reg: I2C slave address of the sensor;
> +- vdda-supply: analog power supply 2.8V (2.6V to 3.0V);
> +- vddreg-supply  : regulator input power supply 1.8V (1.7V to 1.9V)
> +   or 2.8V (2.6V to 3.0);
> +- vddio-supply   : I/O power supply 1.8V (1.65V to 1.95V)
> +   or 2.8V (2.5V to 3.1V);
> +- stbyn-gpios: GPIO connected to STDBYN pin;
> +- rstn-gpios : GPIO connected to RSTN pin;
> +- clocks : the sensor's master clock specifier (from the common
> +   clock bindings);
> +- clock-names: must be "mclk";

I'd reword this slightly:

- clocks: clock-specifiers (per the common clock bindings) for the
  clocks described in clock-names
- clock-names: should include "mclk" for the sensor's master clock

> +
> +Optional properties:
> +
> +- clock-frequency : the frequency at which the "mclk" clock should be
> +   configured to operate, in Hz; if this property is not
> +   specified default 24 MHz value will be used.
> +
> +The device node should contain one 'port' child node with one child 
> 'endpoint'
> +node, according to the bindings de

Re: [PATCH 24/51] DMA-API: dma: pl330: add dma_set_mask_and_coherent() call

2013-09-20 Thread Heiko Stübner
Am Donnerstag, 19. September 2013, 23:49:01 schrieb Russell King:
> The DMA API requires drivers to call the appropriate dma_set_mask()
> functions before doing any DMA mapping.  Add this required call to
> the AMBA PL08x driver.
^--- copy and paste error - should of course be PL330


> Signed-off-by: Russell King 
> ---
>  drivers/dma/pl330.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index a562d24..df8b10f 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2903,6 +2903,10 @@ pl330_probe(struct amba_device *adev, const struct
> amba_id *id)
> 
>   pdat = dev_get_platdata(&adev->dev);
> 
> + ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
> +
>   /* Allocate a new DMAC and its Channels */
>   pdmac = devm_kzalloc(&adev->dev, sizeof(*pdmac), GFP_KERNEL);
>   if (!pdmac) {

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Felipe Balbi
Hi,

On Fri, Sep 20, 2013 at 02:49:38PM +0100, Russell King - ARM Linux wrote:
> On Fri, Sep 20, 2013 at 08:11:25AM -0500, Felipe Balbi wrote:
> > Hi,
> > 
> > On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote:
> > > Use platform_device_register_full() for those drivers which can, to
> > > avoid messing directly with DMA masks.  This can only be done when
> > > the driver does not need to access the allocated musb platform device
> > > from within its callbacks, which may be called during the musb
> > > device probing.
> > > 
> > > Signed-off-by: Russell King 
> > 
> > you want me to carry this one through my tree or you prefer getting my
> > Acked-by ? Either way works for me:
> > 
> > Acked-by: Felipe Balbi 
> > 
> > there's also the third option of me setting up a branch with only this
> > patch and we both merge it, that'd also work.
> 
> I think this patch is sufficiently stand-alone that it should be fine
> if you want to take it through your tree.  That may be better in the
> long run to avoid conflicts with this patch and any future work in
> this area during this cycle.

awesome, i'll take this one early next week.

-- 
balbi


signature.asc
Description: Digital signature


[PATCH 16/51] DMA-API: ppc: vio.c: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 arch/powerpc/kernel/vio.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 78a3506..96b6c97 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1413,8 +1413,7 @@ struct vio_dev *vio_register_device_node(struct 
device_node *of_node)
 
/* needed to ensure proper operation of coherent allocations
 * later, in case driver doesn't set it explicitly */
-   dma_set_mask(&viodev->dev, DMA_BIT_MASK(64));
-   dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64));
+   dma_set_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64));
}
 
/* register with generic device framework */
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 23/51] DMA-API: dma: pl08x: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask()
functions before doing any DMA mapping.  Add this required call to
the AMBA PL08x driver.

Signed-off-by: Russell King 
---
 drivers/dma/amba-pl08x.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index fce46c5..e51a983 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2055,6 +2055,11 @@ static int pl08x_probe(struct amba_device *adev, const 
struct amba_id *id)
if (ret)
return ret;
 
+   /* Ensure that we can do DMA */
+   ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   goto out_no_pl08x;
+
/* Create the driver state holder */
pl08x = kzalloc(sizeof(*pl08x), GFP_KERNEL);
if (!pl08x) {
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: add driver for dual LED Flash, lm3560.

2013-09-20 Thread Sakari Ailus
Hi Daniel,

Thanks for the patch! It's very nice and clean in general. I've got a few
comments below.

On Wed, Sep 11, 2013 at 04:45:31PM +0900, Daniel Jeong wrote:
>  This patch includes the driver for the LM3560, dual LED Flash.
>  The LM3560 has two 1A constant current drivers for high current
>  white LEDs. It is controlled via an I2C compatible interface(up to 400kHz).
>  And each flash, torch brightness and enable/disable LED can be controlled
>  independantly. But flash timeout and operation mode are shared.
> 
> Signed-off-by: Daniel Jeong 
> ---
>  drivers/media/i2c/Kconfig  |9 +
>  drivers/media/i2c/Makefile |1 +
>  drivers/media/i2c/lm3560.c |  716 
> 
>  include/media/lm3560.h |  103 +++
>  4 files changed, 829 insertions(+)
>  create mode 100644 drivers/media/i2c/lm3560.c
>  create mode 100644 include/media/lm3560.h
> 
> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
> index d18be19..75c8a03 100644
> --- a/drivers/media/i2c/Kconfig
> +++ b/drivers/media/i2c/Kconfig
> @@ -621,6 +621,15 @@ config VIDEO_AS3645A
> This is a driver for the AS3645A and LM3555 flash controllers. It has
> build in control for flash, torch and indicator LEDs.
>  
> +config VIDEO_LM3560
> + tristate "LM3560 dual flash driver support"
> + depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
> + depends on MEDIA_CAMERA_SUPPORT
> + select REGMAP_I2C
> + ---help---
> +   This is a driver for the lm3560 dual flash controllers. It controls
> +   flash, torch LEDs.
> +
>  comment "Video improvement chips"
>  
>  config VIDEO_UPD64031A
> diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
> index 9f462df..e03f177 100644
> --- a/drivers/media/i2c/Makefile
> +++ b/drivers/media/i2c/Makefile
> @@ -70,6 +70,7 @@ obj-$(CONFIG_VIDEO_S5K4ECGX)+= s5k4ecgx.o
>  obj-$(CONFIG_VIDEO_S5C73M3)  += s5c73m3/
>  obj-$(CONFIG_VIDEO_ADP1653)  += adp1653.o
>  obj-$(CONFIG_VIDEO_AS3645A)  += as3645a.o
> +obj-$(CONFIG_VIDEO_LM3560)   += lm3560.o
>  obj-$(CONFIG_VIDEO_SMIAPP_PLL)   += smiapp-pll.o
>  obj-$(CONFIG_VIDEO_AK881X)   += ak881x.o
>  obj-$(CONFIG_VIDEO_IR_I2C)  += ir-kbd-i2c.o
> diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c
> new file mode 100644
> index 000..7721e2e
> --- /dev/null
> +++ b/drivers/media/i2c/lm3560.c
> @@ -0,0 +1,716 @@
> +/*
> + * drivers/media/i2c/lm3560.c
> + * General device driver for TI LM3560, Dual FLASH LED Driver
> + *
> + * Copyright (C) 2013 Texas Instruments
> + *
> + * Contact: Daniel Jeong 
> + *  LDD-MLP 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

Please rearrange ascendingly according to the full path name.

> +/* registers definitions */
> +#define REG_ENABLE   0x10
> +#define REG_TORCH_BR 0xA0
> +#define REG_FLASH_BR 0xB0
> +#define REG_FLASH_TOUT   0xC0
> +#define REG_FLAG 0xD0
> +#define REG_CONFIG1  0xE0

How about aligning the register addresses (and masks and bits below)?

Lower case hex would be preferred I guess.

> +/* LED1 */
> +#define LED1_ENABLE 0x08
> +#define LED1_ENABLE_MASK 0x08
> +#define FLASH1_BR_DATA(_br) (_br<<0)
> +#define FLASH1_BR_MASK   0x0F
> +#define TORCH1_BR_DATA(_br) (_br<<0)
> +#define TORCH1_BR_MASK   0x07
> +
> +/* LED2 */
> +#define LED2_ENABLE 0x10
> +#define LED2_ENABLE_MASK 0x10
> +#define FLASH2_BR_DATA(_br) (_br<<4)
> +#define FLASH2_BR_MASK   0xF0
> +#define TORCH2_BR_DATA(_br) (_br<<3)
> +#define TORCH2_BR_MASK   0x38

Could you define the flash/torch br_data and br_mask bits as a function of
the led number instead? Using 0 and 1 probably is a good idea.

Same for LED enable register addresses.

> +/* Configuration */
> +#define ENABLE_MODE_MASK 0x03
> +#define FLASH_TOUT_MASK 0x1F
> +#define STROBE_EN_MASK 0x04
> +#define STROBE_EN_DATA(_config) (_config<<2)
> +#define PEAK_I_MASK 0x60
> +
> +/* Fault Mask */
> +#define FAULT_TIMEOUT (1<<0)
> +#define FAULT_OVERTEMP (1<<1)
> +#define FAULT_SHORT_CIRCUIT (1<<2)
> +
> +#define to_lm3560_led_flash(sd, _id)\
> + container_of(sd, struct lm3560_flash, subdev_led##_id)
> +
> +enum led_enable {
> + MODE

Re: [RFCv3 PATCH 05/10] v4l2: add a motion detection event.

2013-09-20 Thread Sakari Ailus
On Thu, Aug 22, 2013 at 12:14:19PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> Signed-off-by: Hans Verkuil 

Acked-by: Sakari Ailus 

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFCv4 PATCH] v4l2-compat-ioctl32: add g/s_matrix support.

2013-09-20 Thread Sakari Ailus
Hi Hans,

On Fri, Aug 23, 2013 at 02:15:30PM +0200, Hans Verkuil wrote:
> Update of RFCv3 PATCH 03/10 from the "Matrix and Motion Detection support"
> patch series. This time I've actually tested it, and as a bonus found a
> bug in the G/S_SUBDEV_EDID32 handling as well.
> 
> Regards,
> 
>   Hans
> 
> [PATCH] v4l2-compat-ioctl32: add g/s_matrix support.
> 
> Also fix a copy_to_user bug in put_v4l2_subdev_edid32(): the user and kernel
> pointers were used the wrong way around.
> 
> Signed-off-by: Hans Verkuil 
> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c |   50 
> -
>  1 file changed, 49 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c 
> b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> index 8f7a6a4..8fb3e86 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -772,11 +772,40 @@ static int put_v4l2_subdev_edid32(struct 
> v4l2_subdev_edid *kp, struct v4l2_subde
>   put_user(kp->start_block, &up->start_block) ||
>   put_user(kp->blocks, &up->blocks) ||
>   put_user(tmp, &up->edid) ||
> - copy_to_user(kp->reserved, up->reserved, sizeof(kp->reserved)))
> + copy_to_user(up->reserved, kp->reserved, sizeof(kp->reserved)))

This warrants to be a separate patch. Is this bug present in released kenrel
versions?

>   return -EFAULT;
>   return 0;
>  }
>  
> +struct v4l2_matrix32 {
> + __u32 type;
> + struct v4l2_rect rect;
> + compat_caddr_t matrix;
> + __u32 reserved[16];
> +} __attribute__ ((packed));
> +
> +static int get_v4l2_matrix32(struct v4l2_matrix *kp, struct v4l2_matrix32 
> __user *up)

How about splitting the lines that go over 80?

Acked-by: Sakari Ailus 

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks

2013-09-20 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 02:21:37AM +0100, Ben Hutchings wrote:
> On Thu, 2013-09-19 at 22:25 +0100, Russell King wrote:
> [...]
> > -dma_set_coherent_mask() will always be able to set the same or a
> > -smaller mask as dma_set_mask(). However for the rare case that a
> > +The coherent coherent mask will always be able to set the same or a
> > +smaller mask as the streaming mask. However for the rare case that a
> [...]
> 
> The new wording doesn't make sense; a mask doesn't set itself.  I would
> suggest:
> 
> "The coherent mask can always be set to the same or a smaller mask than
> the streaming mask."

Yes, the original sentence is not particularly good, but I think even
your modified version can be interpreted as "a mask setting itself"
for all the same reasons that the original can be (which mask does "same"
refer to?)

Even so, I prefer your version.  Thanks. :)
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 07:16:52AM -0500, Tejun Heo wrote:
> On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote:
> > The correct way for a driver to specify the coherent DMA mask is
> > not to directly access the field in the struct device, but to use
> > dma_set_coherent_mask().  Only arch and bus code should access this
> > member directly.
> > 
> > Convert all direct write accesses to using the correct API.
> > 
> > Signed-off-by: Russell King 
> 
> Acked-by: Tejun Heo 
> 
> The patch is pretty widely spread.  I don't mind how it gets routed
> but what's the plan?

The plan is... I'm going to try and avoid going through the hell of
re-posting this patch series to all the recipients another time...
(It's taken some 17 hours and lots of hand holding to get this patch
set out without exim jumping off a cliff into deep OOM - soo deep that
even the OOM killer doesn't run and the CPU is 100% idle because
every single process stuck in an uninterruptible sleep waiting for
every other process to free some memory - ouch!)

I know that dealing with this patch set will be a problem due to how
widespread this is, but much of the driver level changes come down to
depending on a couple of patches.  One solution would be if I published
a branch with just the dependencies in, which subsystem maintainers
could pull, and then apply the appropriate patches on top.

Another would be if subsystem maintainers are happy that I carry them,
I can add the acks, and then later on towards the end of the cycle,
provide a branch subsystem maintainers could pull.

Or... if you can think of something easier...
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 08:11:25AM -0500, Felipe Balbi wrote:
> Hi,
> 
> On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote:
> > Use platform_device_register_full() for those drivers which can, to
> > avoid messing directly with DMA masks.  This can only be done when
> > the driver does not need to access the allocated musb platform device
> > from within its callbacks, which may be called during the musb
> > device probing.
> > 
> > Signed-off-by: Russell King 
> 
> you want me to carry this one through my tree or you prefer getting my
> Acked-by ? Either way works for me:
> 
> Acked-by: Felipe Balbi 
> 
> there's also the third option of me setting up a branch with only this
> patch and we both merge it, that'd also work.

I think this patch is sufficiently stand-alone that it should be fine
if you want to take it through your tree.  That may be better in the
long run to avoid conflicts with this patch and any future work in
this area during this cycle.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Felipe Balbi
Hi,

On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote:
> Use platform_device_register_full() for those drivers which can, to
> avoid messing directly with DMA masks.  This can only be done when
> the driver does not need to access the allocated musb platform device
> from within its callbacks, which may be called during the musb
> device probing.
> 
> Signed-off-by: Russell King 

you want me to carry this one through my tree or you prefer getting my
Acked-by ? Either way works for me:

Acked-by: Felipe Balbi 

there's also the third option of me setting up a branch with only this
patch and we both merge it, that'd also work.

cheers

-- 
balbi


signature.asc
Description: Digital signature


[PATCH 09/51] DMA-API: net: broadcom/b44: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/net/ethernet/broadcom/b44.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/b44.c 
b/drivers/net/ethernet/broadcom/b44.c
index 9b017d9..b4d2018 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -2183,8 +2183,7 @@ static int b44_init_one(struct ssb_device *sdev,
goto err_out_free_dev;
}
 
-   if (dma_set_mask(sdev->dma_dev, DMA_BIT_MASK(30)) ||
-   dma_set_coherent_mask(sdev->dma_dev, DMA_BIT_MASK(30))) {
+   if (dma_set_mask_and_coherent(sdev->dma_dev, DMA_BIT_MASK(30))) {
dev_err(sdev->dev,
"Required 30BIT DMA mask unsupported by the system\n");
goto err_out_powerdown;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 38/51] DMA-API: staging: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
The correct way for a driver to specify the coherent DMA mask is
not to directly access the field in the struct device, but to use
dma_set_coherent_mask().  Only arch and bus code should access this
member directly.

Convert all direct write accesses to using the correct API.

Signed-off-by: Russell King 
---
 drivers/staging/dwc2/platform.c|5 +++--
 drivers/staging/imx-drm/imx-drm-core.c |8 ++--
 drivers/staging/imx-drm/ipuv3-crtc.c   |4 +++-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/dwc2/platform.c b/drivers/staging/dwc2/platform.c
index 44cce2f..1d68c49 100644
--- a/drivers/staging/dwc2/platform.c
+++ b/drivers/staging/dwc2/platform.c
@@ -100,8 +100,9 @@ static int dwc2_driver_probe(struct platform_device *dev)
 */
if (!dev->dev.dma_mask)
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
-   if (!dev->dev.coherent_dma_mask)
-   dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
+   if (retval)
+   return retval;
 
irq = platform_get_irq(dev, 0);
if (irq < 0) {
diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
index 47c5888..847f430 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -805,6 +805,12 @@ static struct drm_driver imx_drm_driver = {
 
 static int imx_drm_platform_probe(struct platform_device *pdev)
 {
+   int ret;
+
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
+
imx_drm_device->dev = &pdev->dev;
 
return drm_platform_init(&imx_drm_driver, pdev);
@@ -847,8 +853,6 @@ static int __init imx_drm_init(void)
goto err_pdev;
}
 
-   imx_drm_pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32),
-
ret = platform_driver_register(&imx_drm_pdrv);
if (ret)
goto err_pdrv;
diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c 
b/drivers/staging/imx-drm/ipuv3-crtc.c
index 6fd37a7..9e73e8d 100644
--- a/drivers/staging/imx-drm/ipuv3-crtc.c
+++ b/drivers/staging/imx-drm/ipuv3-crtc.c
@@ -523,7 +523,9 @@ static int ipu_drm_probe(struct platform_device *pdev)
if (!pdata)
return -EINVAL;
 
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
ipu_crtc = devm_kzalloc(&pdev->dev, sizeof(*ipu_crtc), GFP_KERNEL);
if (!ipu_crtc)
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 37/51] DMA-API: usb: use new dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
Signed-off-by: Russell King 
---
 drivers/usb/chipidea/ci_hdrc_imx.c |4 +---
 drivers/usb/dwc3/dwc3-exynos.c |4 +---
 drivers/usb/host/ehci-atmel.c  |4 +---
 drivers/usb/host/ehci-omap.c   |4 +---
 drivers/usb/host/ehci-orion.c  |4 +---
 drivers/usb/host/ehci-platform.c   |5 ++---
 drivers/usb/host/ehci-s5p.c|4 +---
 drivers/usb/host/ehci-spear.c  |4 +---
 drivers/usb/host/ehci-tegra.c  |4 +---
 drivers/usb/host/ohci-at91.c   |4 +---
 drivers/usb/host/ohci-exynos.c |4 +---
 drivers/usb/host/ohci-nxp.c|3 +--
 drivers/usb/host/ohci-octeon.c |3 +--
 drivers/usb/host/ohci-omap3.c  |4 +---
 drivers/usb/host/ohci-pxa27x.c |4 +---
 drivers/usb/host/ohci-spear.c  |4 +---
 drivers/usb/host/uhci-platform.c   |4 +---
 17 files changed, 18 insertions(+), 49 deletions(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c 
b/drivers/usb/chipidea/ci_hdrc_imx.c
index bf33bd3..af731db 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -121,9 +121,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 
pdata.phy = data->phy;
 
-   if (!pdev->dev.dma_mask)
-   pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
-   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
goto err_clk;
 
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index c10b324..8b20c70 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -119,9 +119,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
 * Since shared usb code relies on it, set it here for now.
 * Once we move to full device tree support this will vanish off.
 */
-   if (!dev->dma_mask)
-   dev->dma_mask = &dev->coherent_dma_mask;
-   ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+   ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (ret)
goto err1;
 
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 5831a88..8e7323e 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -90,9 +90,7 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
 * Since shared usb code relies on it, set it here for now.
 * Once we have dma capability bindings this can go away.
 */
-   if (!pdev->dev.dma_mask)
-   pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
-   retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (retval)
goto fail_create_hcd;
 
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index d0759c5..6fa82d6 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -144,9 +144,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 * Since shared usb code relies on it, set it here for now.
 * Once we have dma capability bindings this can go away.
 */
-   if (!dev->dma_mask)
-   dev->dma_mask = &dev->coherent_dma_mask;
-   ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+   ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (ret)
return ret;
 
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 5870206..2ba7673 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -180,9 +180,7 @@ static int ehci_orion_drv_probe(struct platform_device 
*pdev)
 * set. Since shared usb code relies on it, set it here for
 * now. Once we have dma capability bindings this can go away.
 */
-   if (!pdev->dev.dma_mask)
-   pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
-   err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err)
goto err1;
 
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 5b0cd2d..7f30b71 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -89,9 +89,8 @@ static int ehci_platform_probe(struct platform_device *dev)
 */
if (!dev_get_platdata(&dev->dev))
dev->dev.platform_data = &ehci_platform_defaults;
-   if (!dev->dev.dma_mask)
-   dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
-   err = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
+
+   err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
if (err)
return err;
 
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 10d6a2e

[PATCH 36/51] DMA-API: usb: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
The correct way for a driver to specify the coherent DMA mask is
not to directly access the field in the struct device, but to use
dma_set_coherent_mask().  Only arch and bus code should access this
member directly.

Convert all direct write accesses to using the correct API.

Signed-off-by: Russell King 
---
 drivers/usb/chipidea/ci_hdrc_imx.c |5 +++--
 drivers/usb/dwc3/dwc3-exynos.c |5 +++--
 drivers/usb/gadget/lpc32xx_udc.c   |4 +++-
 drivers/usb/host/ehci-atmel.c  |5 +++--
 drivers/usb/host/ehci-octeon.c |4 +++-
 drivers/usb/host/ehci-omap.c   |8 +---
 drivers/usb/host/ehci-orion.c  |5 +++--
 drivers/usb/host/ehci-platform.c   |7 ---
 drivers/usb/host/ehci-s5p.c|5 +++--
 drivers/usb/host/ehci-spear.c  |5 +++--
 drivers/usb/host/ehci-tegra.c  |5 +++--
 drivers/usb/host/ohci-at91.c   |7 ---
 drivers/usb/host/ohci-exynos.c |5 +++--
 drivers/usb/host/ohci-nxp.c|4 +++-
 drivers/usb/host/ohci-octeon.c |4 +++-
 drivers/usb/host/ohci-omap3.c  |8 +---
 drivers/usb/host/ohci-pxa27x.c |6 --
 drivers/usb/host/ohci-spear.c  |5 +++--
 drivers/usb/host/uhci-platform.c   |5 +++--
 19 files changed, 64 insertions(+), 38 deletions(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c 
b/drivers/usb/chipidea/ci_hdrc_imx.c
index 74d998d..bf33bd3 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -123,8 +123,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
-   if (!pdev->dev.coherent_dma_mask)
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   goto err_clk;
 
if (data->usbmisc_data) {
ret = imx_usbmisc_init(data->usbmisc_data);
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 2f2e88a..c10b324 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -121,8 +121,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
 */
if (!dev->dma_mask)
dev->dma_mask = &dev->coherent_dma_mask;
-   if (!dev->coherent_dma_mask)
-   dev->coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+   if (ret)
+   goto err1;
 
platform_set_drvdata(pdev, exynos);
 
diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
index 67128be..6a2a65a 100644
--- a/drivers/usb/gadget/lpc32xx_udc.c
+++ b/drivers/usb/gadget/lpc32xx_udc.c
@@ -3078,7 +3078,9 @@ static int __init lpc32xx_udc_probe(struct 
platform_device *pdev)
 udc->isp1301_i2c_client->addr);
 
pdev->dev.dma_mask = &lpc32xx_usbd_dmamask;
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (retval)
+   goto resource_fail;
 
udc->board = &lpc32xx_usbddata;
 
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 3b645ff..5831a88 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -92,8 +92,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
 */
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
-   if (!pdev->dev.coherent_dma_mask)
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (retval)
+   goto fail_create_hcd;
 
hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c
index ab0397e..4c528b2 100644
--- a/drivers/usb/host/ehci-octeon.c
+++ b/drivers/usb/host/ehci-octeon.c
@@ -116,8 +116,10 @@ static int ehci_octeon_drv_probe(struct platform_device 
*pdev)
 * We can DMA from anywhere. But the descriptors must be in
 * the lower 4GB.
 */
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
pdev->dev.dma_mask = &ehci_octeon_dma_mask;
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
hcd = usb_create_hcd(&ehci_octeon_hc_driver, &pdev->dev, "octeon");
if (!hcd)
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 78b01fa..d0759c5 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -104,7 +104,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
struct resource *res;
struct usb_hcd  *hcd;
void __iomem *regs;
-   int ret = -ENODEV;
+   int ret;
int irq;
 

[PATCH 34/51] DMA-API: net: octeon: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence:
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
bypasses the architectures check on the DMA mask.  It can be replaced
with dma_coerce_mask_and_coherent(), avoiding the direct initialization
of this mask.

Signed-off-by: Russell King 
---
 drivers/net/ethernet/octeon/octeon_mgmt.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c 
b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 622aa75..2006a07 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -1552,8 +1552,9 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
 
p->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
 
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
-   pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
+   result = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+   if (result)
+   goto err;
 
netif_carrier_off(netdev);
result = register_netdev(netdev);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 33/51] DMA-API: net: nxp/lpc_eth: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence:
pldat->pdev->dev.coherent_dma_mask = 0x;
pldat->pdev->dev.dma_mask = &pldat->pdev->dev.coherent_dma_mask;
bypasses the architectures check on the DMA mask.  It can be replaced
with dma_coerce_mask_and_coherent(), avoiding the direct initialization
of this mask.

Signed-off-by: Russell King 
---
 drivers/net/ethernet/nxp/lpc_eth.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/nxp/lpc_eth.c 
b/drivers/net/ethernet/nxp/lpc_eth.c
index a061b93..ba3ca18 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1399,8 +1399,10 @@ static int lpc_eth_drv_probe(struct platform_device 
*pdev)
}
 
if (pldat->dma_buff_base_v == 0) {
-   pldat->pdev->dev.coherent_dma_mask = 0x;
-   pldat->pdev->dev.dma_mask = &pldat->pdev->dev.coherent_dma_mask;
+   ret = dma_coerce_mask_and_coherent(&pdev->dev, 
DMA_BIT_MASK(32));
+   if (ret)
+   goto err_out_free_irq;
+
pldat->dma_buff_size = PAGE_ALIGN(pldat->dma_buff_size);
 
/* Allocate a chunk of memory for the DMA ethernet buffers
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 32/51] DMA-API: mmc: sdhci-acpi: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence:
dev->dma_mask = &dev->coherent_dma_mask;
dev->coherent_dma_mask = dma_mask;
bypasses the architectures check on the DMA mask.  It can be replaced
with dma_coerce_mask_and_coherent(), avoiding the direct initialization
of this mask.

Signed-off-by: Russell King 
---
 drivers/mmc/host/sdhci-acpi.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index cdd4ce0..ef19874 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -310,8 +310,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
dma_mask = DMA_BIT_MASK(32);
}
 
-   dev->dma_mask = &dev->coherent_dma_mask;
-   dev->coherent_dma_mask = dma_mask;
+   err = dma_coerce_mask_and_coherent(dev, dma_mask);
+   if (err)
+   goto err_free;
}
 
if (c->slot) {
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Sehr geehrte Empfänger

2013-09-20 Thread Western Union Office®

Sehr geehrte Empfänger
Sie haben als der einzige Begünstigte der Summe der dreihunderttausend Euro 
(€300.000,00 Eur) ausgewählt wurde, die hier in WESTERN UNION Büro von der 
UN-Organisation für Sie hinterlegt ist.
Kontaktieren Sie bitte uns für Ansprüche Email:cliamswud...@outlook.com


KundendienstWestern Union Office ®
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/51] DMA-API: net: b43: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/net/wireless/b43/dma.c |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index c51d2dc..1d7982a 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -1065,12 +1065,9 @@ static int b43_dma_set_mask(struct b43_wldev *dev, u64 
mask)
/* Try to set the DMA mask. If it fails, try falling back to a
 * lower mask, as we can always also support a lower one. */
while (1) {
-   err = dma_set_mask(dev->dev->dma_dev, mask);
-   if (!err) {
-   err = dma_set_coherent_mask(dev->dev->dma_dev, mask);
-   if (!err)
-   break;
-   }
+   err = dma_set_mask_and_coherent(dev->dev->dma_dev, mask);
+   if (!err)
+   break;
if (mask == DMA_BIT_MASK(64)) {
mask = DMA_BIT_MASK(32);
fallback = true;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
On Fri, Sep 20, 2013 at 07:16:52AM -0500, Tejun Heo wrote:
> On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote:
> > The correct way for a driver to specify the coherent DMA mask is
> > not to directly access the field in the struct device, but to use
> > dma_set_coherent_mask().  Only arch and bus code should access this
> > member directly.
> > 
> > Convert all direct write accesses to using the correct API.
> > 
> > Signed-off-by: Russell King 
> 
> Acked-by: Tejun Heo 
> 
> The patch is pretty widely spread.  I don't mind how it gets routed
> but what's the plan?

Hmm... maybe hte pata_ixp4xx_cf.c part should be moved to the one
which updates pata_octeon_cf.c?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote:
> The correct way for a driver to specify the coherent DMA mask is
> not to directly access the field in the struct device, but to use
> dma_set_coherent_mask().  Only arch and bus code should access this
> member directly.
> 
> Convert all direct write accesses to using the correct API.
> 
> Signed-off-by: Russell King 

Acked-by: Tejun Heo 

The patch is pretty widely spread.  I don't mind how it gets routed
but what's the plan?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 31/51] DMA-API: media: omap3isp: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence:
isp->raw_dmamask = DMA_BIT_MASK(32);
isp->dev->dma_mask = &isp->raw_dmamask;
isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
bypasses the architectures check on the DMA mask.  It can be replaced
with dma_coerce_mask_and_coherent(), avoiding the direct initialization
of this mask.

Signed-off-by: Russell King 
---
 drivers/media/platform/omap3isp/isp.c |6 +++---
 drivers/media/platform/omap3isp/isp.h |3 ---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index df3a0ec..1c36080 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2182,9 +2182,9 @@ static int isp_probe(struct platform_device *pdev)
isp->pdata = pdata;
isp->ref_count = 0;
 
-   isp->raw_dmamask = DMA_BIT_MASK(32);
-   isp->dev->dma_mask = &isp->raw_dmamask;
-   isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_coerce_mask_and_coherent(isp->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
platform_set_drvdata(pdev, isp);
 
diff --git a/drivers/media/platform/omap3isp/isp.h 
b/drivers/media/platform/omap3isp/isp.h
index cd3eff4..ce65d3a 100644
--- a/drivers/media/platform/omap3isp/isp.h
+++ b/drivers/media/platform/omap3isp/isp.h
@@ -152,7 +152,6 @@ struct isp_xclk {
  * @mmio_base_phys: Array with physical L4 bus addresses for ISP register
  *  regions.
  * @mmio_size: Array with ISP register regions size in bytes.
- * @raw_dmamask: Raw DMA mask
  * @stat_lock: Spinlock for handling statistics
  * @isp_mutex: Mutex for serializing requests to ISP.
  * @crashed: Bitmask of crashed entities (indexed by entity ID)
@@ -190,8 +189,6 @@ struct isp_device {
unsigned long mmio_base_phys[OMAP3_ISP_IOMEM_LAST];
resource_size_t mmio_size[OMAP3_ISP_IOMEM_LAST];
 
-   u64 raw_dmamask;
-
/* ISP Obj */
spinlock_t stat_lock;   /* common lock for statistic drivers */
struct mutex isp_mutex; /* For handling ref_count field */
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 29/51] DMA-API: ata: pata_octeon_cf: convert to use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
Convert this code sequence:
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
to use dma_coerce_mask_and_coherent() to avoid bypassing the architecture
check on the DMA mask.

Signed-off-by: Russell King 
---
 drivers/ata/pata_octeon_cf.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index c51bbb9..6231d43 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -1014,8 +1014,9 @@ static int octeon_cf_probe(struct platform_device *pdev)
}
cf_port->c0 = ap->ioaddr.ctl_addr;
 
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
-   pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
+   rv = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+   if (rv)
+   return ret;
 
ata_port_desc(ap, "cmd %p ctl %p", base, ap->ioaddr.ctl_addr);
 
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 30/51] DMA-API: dma: dw_dmac.c: convert to use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
This code sequence:
if (!pdev->dev.dma_mask) {
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
}
bypasses the architectures check on the DMA mask.  It can be replaced
with dma_coerce_mask_and_coherent(), avoiding the direct initialization
of this mask.

Signed-off-by: Russell King 
---
 drivers/dma/dw/platform.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index e35d975..453822c 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -191,11 +191,9 @@ static int dw_probe(struct platform_device *pdev)
if (IS_ERR(chip->regs))
return PTR_ERR(chip->regs);
 
-   /* Apply default dma_mask if needed */
-   if (!dev->dma_mask) {
-   dev->dma_mask = &dev->coherent_dma_mask;
-   dev->coherent_dma_mask = DMA_BIT_MASK(32);
-   }
+   err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+   if (err)
+   return err;
 
pdata = dev_get_platdata(dev);
if (!pdata)
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-20 Thread Russell King
This code sequence is unsafe in modules:

static u64 mask = DMA_BIT_MASK(something);
...
if (!dev->dma_mask)
dev->dma_mask = &mask;

as if a module is reloaded, the mask will be pointing at the original
module's mask address, and this can lead to oopses.  Moreover, they
all follow this with:

if (!dev->coherent_dma_mask)
dev->coherent_dma_mask = mask;

where 'mask' is the same value as the statically defined mask, and this
bypasses the architecture's check on whether the DMA mask is possible.

Fix these issues by using the new dma_coerce_coherent_and_mask()
function.

Signed-off-by: Russell King 
---
 sound/arm/pxa2xx-pcm.c  |9 +++--
 sound/soc/atmel/atmel-pcm.c |   11 ---
 sound/soc/blackfin/bf5xx-ac97-pcm.c |   11 ---
 sound/soc/blackfin/bf5xx-i2s-pcm.c  |   10 --
 sound/soc/davinci/davinci-pcm.c |9 +++--
 sound/soc/fsl/fsl_dma.c |9 +++--
 sound/soc/fsl/mpc5200_dma.c |   10 --
 sound/soc/jz4740/jz4740-pcm.c   |   12 
 sound/soc/kirkwood/kirkwood-dma.c   |9 +++--
 sound/soc/nuc900/nuc900-pcm.c   |9 -
 sound/soc/omap/omap-pcm.c   |   11 ---
 sound/soc/pxa/pxa2xx-pcm.c  |   11 ---
 sound/soc/s6000/s6000-pcm.c |9 +++--
 sound/soc/samsung/dma.c |   11 ---
 sound/soc/samsung/idma.c|   11 ---
 15 files changed, 55 insertions(+), 97 deletions(-)

diff --git a/sound/arm/pxa2xx-pcm.c b/sound/arm/pxa2xx-pcm.c
index 69a2455..fb3b76f 100644
--- a/sound/arm/pxa2xx-pcm.c
+++ b/sound/arm/pxa2xx-pcm.c
@@ -83,8 +83,6 @@ static struct snd_pcm_ops pxa2xx_pcm_ops = {
.mmap   = pxa2xx_pcm_mmap,
 };
 
-static u64 pxa2xx_pcm_dmamask = 0x;
-
 int pxa2xx_pcm_new(struct snd_card *card, struct pxa2xx_pcm_client *client,
   struct snd_pcm **rpcm)
 {
@@ -100,10 +98,9 @@ int pxa2xx_pcm_new(struct snd_card *card, struct 
pxa2xx_pcm_client *client,
pcm->private_data = client;
pcm->private_free = pxa2xx_pcm_free_dma_buffers;
 
-   if (!card->dev->dma_mask)
-   card->dev->dma_mask = &pxa2xx_pcm_dmamask;
-   if (!card->dev->coherent_dma_mask)
-   card->dev->coherent_dma_mask = 0x;
+   ret = dma_coerce_mask_and_coherent_mask(card->dev, DMA_BIT_MASK(32));
+   if (ret)
+   goto out;
 
if (play) {
int stream = SNDRV_PCM_STREAM_PLAYBACK;
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
index 3109db7..fbb87e3 100644
--- a/sound/soc/atmel/atmel-pcm.c
+++ b/sound/soc/atmel/atmel-pcm.c
@@ -68,18 +68,15 @@ int atmel_pcm_mmap(struct snd_pcm_substream *substream,
 }
 EXPORT_SYMBOL_GPL(atmel_pcm_mmap);
 
-static u64 atmel_pcm_dmamask = DMA_BIT_MASK(32);
-
 int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd)
 {
struct snd_card *card = rtd->card->snd_card;
struct snd_pcm *pcm = rtd->pcm;
-   int ret = 0;
+   int ret;
 
-   if (!card->dev->dma_mask)
-   card->dev->dma_mask = &atmel_pcm_dmamask;
-   if (!card->dev->coherent_dma_mask)
-   card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
pr_debug("atmel-pcm: allocating PCM playback DMA buffer\n");
diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c 
b/sound/soc/blackfin/bf5xx-ac97-pcm.c
index 53f8408..1d4c676 100644
--- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
@@ -415,19 +415,16 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm 
*pcm)
}
 }
 
-static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
-
 static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd)
 {
struct snd_card *card = rtd->card->snd_card;
struct snd_pcm *pcm = rtd->pcm;
-   int ret = 0;
+   int ret;
 
pr_debug("%s enter\n", __func__);
-   if (!card->dev->dma_mask)
-   card->dev->dma_mask = &bf5xx_pcm_dmamask;
-   if (!card->dev->coherent_dma_mask)
-   card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c 
b/sound/soc/blackfin/bf5xx-i2s-pcm.c
index 9cb4a80..2a5b434 100644
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -323,18 +323,16 @@ static struct snd_pcm_ops bf5xx_pcm_i2s_ops = {
.silence= bf5xx_pcm_silence,
 };
 
-static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
-
 static int bf5xx_pcm_i2s_new(struct snd_soc_pcm

[PATCH 26/51] DMA-API: usb: ohci-sa1111: add a note about DMA masks

2013-09-20 Thread Russell King
Add a comment to explain why this driver doesn't call any of the DMA
API dma_set_mask() functions.

Signed-off-by: Russell King 
---
 drivers/usb/host/ohci-sa.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ohci-sa.c b/drivers/usb/host/ohci-sa.c
index 17b2a7d..aa9e127 100644
--- a/drivers/usb/host/ohci-sa.c
+++ b/drivers/usb/host/ohci-sa.c
@@ -185,6 +185,12 @@ static int ohci_hcd_sa_probe(struct sa_dev *dev)
if (usb_disabled())
return -ENODEV;
 
+   /*
+* We don't call dma_set_mask_and_coherent() here because the
+* DMA mask has already been appropraitely setup by the core
+* SA- bus code (which includes bug workarounds.)
+*/
+
hcd = usb_create_hcd(&ohci_sa_hc_driver, &dev->dev, "sa");
if (!hcd)
return -ENOMEM;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 27/51] DMA-API: provide a helper to setup DMA masks

2013-09-20 Thread Russell King
Many drivers contain code such as:

dev->dma_mask = &dev->coherent_dma_mask;
dev->coherent_dma_mask = MASK;

Let's move this pattern out of drivers and have the DMA API provide a
helper for it.  This helper uses dma_set_mask_and_coherent() to allow
platform issues to be properly dealt with via dma_set_mask()/
dma_is_supported().

Signed-off-by: Russell King 
---
 include/linux/dma-mapping.h |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ec951f9..27d1421 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -111,6 +111,16 @@ static inline int dma_set_mask_and_coherent(struct device 
*dev, u64 mask)
return rc;
 }
 
+/*
+ * Similar to the above, except it deals with the case where the device
+ * does not have dev->dma_mask appropriately setup.
+ */
+static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask)
+{
+   dev->dma_mask = &dev->coherent_dma_mask;
+   return dma_set_mask_and_coherent(dev, mask);
+}
+
 extern u64 dma_get_required_mask(struct device *dev);
 
 static inline unsigned int dma_get_max_seg_size(struct device *dev)
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 21/51] DMA-API: usb: ssb-hcd: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/usb/host/ssb-hcd.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ssb-hcd.c b/drivers/usb/host/ssb-hcd.c
index 74af2c6..0196f76 100644
--- a/drivers/usb/host/ssb-hcd.c
+++ b/drivers/usb/host/ssb-hcd.c
@@ -163,8 +163,7 @@ static int ssb_hcd_probe(struct ssb_device *dev,
 
/* TODO: Probably need checks here; is the core connected? */
 
-   if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) ||
-   dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32)))
+   if (dma_set_mask_and_coherent(dev->dma_dev, DMA_BIT_MASK(32)))
return -EOPNOTSUPP;
 
usb_dev = kzalloc(sizeof(struct ssb_hcd_device), GFP_KERNEL);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 25/51] DMA-API: video: clcd: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask()
functions before doing any DMA mapping.  Add this required call to
the AMBA PL08x driver.

Signed-off-by: Russell King 
---
 drivers/video/amba-clcd.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index 0a2cce7..afe4702 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -10,6 +10,7 @@
  *
  *  ARM PrimeCell PL110 Color LCD Controller
  */
+#include 
 #include 
 #include 
 #include 
@@ -551,6 +552,10 @@ static int clcdfb_probe(struct amba_device *dev, const 
struct amba_id *id)
if (!board)
return -EINVAL;
 
+   ret = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   goto out;
+
ret = amba_request_regions(dev, NULL);
if (ret) {
printk(KERN_ERR "CLCD: unable to reserve regs region\n");
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 20/51] DMA-API: usb: bcma: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/usb/host/bcma-hcd.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c
index df13d42..205f4a3 100644
--- a/drivers/usb/host/bcma-hcd.c
+++ b/drivers/usb/host/bcma-hcd.c
@@ -227,8 +227,7 @@ static int bcma_hcd_probe(struct bcma_device *dev)
 
/* TODO: Probably need checks here; is the core connected? */
 
-   if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) ||
-   dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32)))
+   if (dma_set_mask_and_coherent(dev->dma_dev, DMA_BIT_MASK(32)))
return -EOPNOTSUPP;
 
usb_dev = kzalloc(sizeof(struct bcma_hcd_device), GFP_KERNEL);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 15/51] DMA-API: net: b43legacy: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/net/wireless/b43legacy/dma.c |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/b43legacy/dma.c 
b/drivers/net/wireless/b43legacy/dma.c
index 42eb26c..b2ed179 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -806,12 +806,9 @@ static int b43legacy_dma_set_mask(struct b43legacy_wldev 
*dev, u64 mask)
/* Try to set the DMA mask. If it fails, try falling back to a
 * lower mask, as we can always also support a lower one. */
while (1) {
-   err = dma_set_mask(dev->dev->dma_dev, mask);
-   if (!err) {
-   err = dma_set_coherent_mask(dev->dev->dma_dev, mask);
-   if (!err)
-   break;
-   }
+   err = dma_set_mask_and_coherent(dev->dev->dma_dev, mask);
+   if (!err)
+   break;
if (mask == DMA_BIT_MASK(64)) {
mask = DMA_BIT_MASK(32);
fallback = true;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/51] DMA-API: net: broadcom/bnx2x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 2f8dbbb..e6c3e66 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12072,13 +12072,9 @@ static int bnx2x_set_coherency_mask(struct bnx2x *bp)
 {
struct device *dev = &bp->pdev->dev;
 
-   if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) {
+   if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)) == 0) {
bp->flags |= USING_DAC_FLAG;
-   if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) {
-   dev_err(dev, "dma_set_coherent_mask failed, 
aborting\n");
-   return -EIO;
-   }
-   } else if (dma_set_mask(dev, DMA_BIT_MASK(32)) != 0) {
+   } else if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)) != 0) {
dev_err(dev, "System does not support DMA, aborting\n");
return -EIO;
}
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 19/51] DMA-API: media: dt3155v4l: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/staging/media/dt3155v4l/dt3155v4l.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c 
b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index 90d6ac4..081407b 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -901,10 +901,7 @@ dt3155_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
int err;
struct dt3155_priv *pd;
 
-   err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
-   if (err)
-   return -ENODEV;
-   err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err)
return -ENODEV;
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 17/51] DMA-API: block: nvme-core: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/block/nvme-core.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index da52092..26d03fa 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1949,12 +1949,9 @@ static int nvme_dev_map(struct nvme_dev *dev)
if (pci_request_selected_regions(pdev, bars, "nvme"))
goto disable_pci;
 
-   if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)))
-   dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
-   else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)))
-   dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
-   else
-   goto disable_pci;
+   if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) &&
+   dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
+   goto disable;
 
pci_set_drvdata(pdev, dev);
dev->bar = ioremap(pci_resource_start(pdev, 0), 8192);
@@ -2168,6 +2165,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
 
INIT_LIST_HEAD(&dev->namespaces);
dev->pci_dev = pdev;
+
result = nvme_set_instance(dev);
if (result)
goto free;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/51] DMA-API: net: intel/e1000: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/net/ethernet/intel/e1000/e1000_main.c |9 ++---
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c 
b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 59ad007..34672f8 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1018,19 +1018,14 @@ static int e1000_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
 */
pci_using_dac = 0;
if ((hw->bus_type == e1000_bus_type_pcix) &&
-   !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
-   /* according to DMA-API-HOWTO, coherent calls will always
-* succeed if the set call did
-*/
-   dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
+   !dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
pci_using_dac = 1;
} else {
-   err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+   err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
pr_err("No usable DMA config, aborting\n");
goto err_dma;
}
-   dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
}
 
netdev->netdev_ops = &e1000_netdev_ops;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 18/51] DMA-API: staging: et131x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/staging/et131x/et131x.c |   17 ++---
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index f73e58f..98edfa8 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -4797,21 +4797,8 @@ static int et131x_pci_setup(struct pci_dev *pdev,
pci_set_master(pdev);
 
/* Check the DMA addressing support of this device */
-   if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
-   rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
-   if (rc < 0) {
-   dev_err(&pdev->dev,
- "Unable to obtain 64 bit DMA for consistent 
allocations\n");
-   goto err_release_res;
-   }
-   } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
-   rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
-   if (rc < 0) {
-   dev_err(&pdev->dev,
- "Unable to obtain 32 bit DMA for consistent 
allocations\n");
-   goto err_release_res;
-   }
-   } else {
+   if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
+   dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
dev_err(&pdev->dev, "No usable DMA addressing method\n");
rc = -EIO;
goto err_release_res;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/51] DMA-API: net: sfc/efx.c: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/net/ethernet/sfc/efx.c |   12 +---
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 07c9bc4..2e27837 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1121,7 +1121,7 @@ static int efx_init_io(struct efx_nic *efx)
 */
while (dma_mask > 0x7fffUL) {
if (dma_supported(&pci_dev->dev, dma_mask)) {
-   rc = dma_set_mask(&pci_dev->dev, dma_mask);
+   rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
if (rc == 0)
break;
}
@@ -1134,16 +1134,6 @@ static int efx_init_io(struct efx_nic *efx)
}
netif_dbg(efx, probe, efx->net_dev,
  "using DMA mask %llx\n", (unsigned long long) dma_mask);
-   rc = dma_set_coherent_mask(&pci_dev->dev, dma_mask);
-   if (rc) {
-   /* dma_set_coherent_mask() is not *allowed* to
-* fail with a mask that dma_set_mask() accepted,
-* but just in case...
-*/
-   netif_err(efx, probe, efx->net_dev,
- "failed to set consistent DMA mask\n");
-   goto fail2;
-   }
 
efx->membase_phys = pci_resource_start(efx->pci_dev, EFX_MEM_BAR);
rc = pci_request_region(pci_dev, EFX_MEM_BAR, "sfc");
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/51] DMA-API: net: emulex/benet: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/net/ethernet/emulex/benet/be_main.c |   12 ++--
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c 
b/drivers/net/ethernet/emulex/benet/be_main.c
index 3224d28..2084151 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4335,19 +4335,11 @@ static int be_probe(struct pci_dev *pdev, const struct 
pci_device_id *pdev_id)
adapter->netdev = netdev;
SET_NETDEV_DEV(netdev, &pdev->dev);
 
-   status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+   status = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (!status) {
-   status = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
-   if (status < 0) {
-   dev_err(&pdev->dev, "dma_set_coherent_mask failed\n");
-   goto free_netdev;
-   }
netdev->features |= NETIF_F_HIGHDMA;
} else {
-   status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
-   if (!status)
-   status = dma_set_coherent_mask(&pdev->dev,
-  DMA_BIT_MASK(32));
+   status = dma_set_mask_and_coherent(&pdev->dev, 
DMA_BIT_MASK(32));
if (status) {
dev_err(&pdev->dev, "Could not set PCI DMA Mask\n");
goto free_netdev;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 24/51] DMA-API: dma: pl330: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask()
functions before doing any DMA mapping.  Add this required call to
the AMBA PL08x driver.

Signed-off-by: Russell King 
---
 drivers/dma/pl330.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index a562d24..df8b10f 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2903,6 +2903,10 @@ pl330_probe(struct amba_device *adev, const struct 
amba_id *id)
 
pdat = dev_get_platdata(&adev->dev);
 
+   ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
+
/* Allocate a new DMAC and its Channels */
pdmac = devm_kzalloc(&adev->dev, sizeof(*pdmac), GFP_KERNEL);
if (!pdmac) {
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 22/51] DMA-API: amba: get rid of separate dma_mask

2013-09-20 Thread Russell King
AMBA Primecell devices always treat streaming and coherent DMA exactly
the same, so there's no point in having the masks separated.

Signed-off-by: Russell King 
---
 drivers/amba/bus.c   |6 +-
 drivers/of/platform.c|3 ---
 include/linux/amba/bus.h |2 --
 3 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index c670727..c4876ac 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -552,7 +552,6 @@ amba_aphb_device_add(struct device *parent, const char 
*name,
if (!dev)
return ERR_PTR(-ENOMEM);
 
-   dev->dma_mask = dma_mask;
dev->dev.coherent_dma_mask = dma_mask;
dev->irq[0] = irq1;
dev->irq[1] = irq2;
@@ -619,7 +618,7 @@ static void amba_device_initialize(struct amba_device *dev, 
const char *name)
dev_set_name(&dev->dev, "%s", name);
dev->dev.release = amba_device_release;
dev->dev.bus = &amba_bustype;
-   dev->dev.dma_mask = &dev->dma_mask;
+   dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
dev->res.name = dev_name(&dev->dev);
 }
 
@@ -663,9 +662,6 @@ int amba_device_register(struct amba_device *dev, struct 
resource *parent)
amba_device_initialize(dev, dev->dev.init_name);
dev->dev.init_name = NULL;
 
-   if (!dev->dev.coherent_dma_mask && dev->dma_mask)
-   dev_warn(&dev->dev, "coherent dma mask is unset\n");
-
return amba_device_add(dev, parent);
 }
 
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 9b439ac..54382ba 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -284,9 +284,6 @@ static struct amba_device *of_amba_device_create(struct 
device_node *node,
else
of_device_make_bus_id(&dev->dev);
 
-   /* setup amba-specific device info */
-   dev->dma_mask = ~0;
-
/* Allow the HW Peripheral ID to be overridden */
prop = of_get_property(node, "arm,primecell-periphid", NULL);
if (prop)
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 43ec7e2..682df0e 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -30,7 +30,6 @@ struct amba_device {
struct device   dev;
struct resource res;
struct clk  *pclk;
-   u64 dma_mask;
unsigned intperiphid;
unsigned intirq[AMBA_NR_IRQS];
 };
@@ -131,7 +130,6 @@ struct amba_device name##_device = {
\
 struct amba_device name##_device = {   \
.dev = __AMBA_DEV(busid, data, ~0ULL),  \
.res = DEFINE_RES_MEM(base, SZ_4K), \
-   .dma_mask = ~0ULL,  \
.irq = irqs,\
.periphid = id, \
 }
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
The correct way for a driver to specify the coherent DMA mask is
not to directly access the field in the struct device, but to use
dma_set_coherent_mask().  Only arch and bus code should access this
member directly.

Convert all direct write accesses to using the correct API.

Signed-off-by: Russell King 
---
 drivers/ata/pata_ixp4xx_cf.c |5 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c  |6 +-
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |5 +++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 1ec53f8..ddf470c 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -144,6 +144,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
struct ata_host *host;
struct ata_port *ap;
struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev);
+   int ret;
 
cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -157,7 +158,9 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
return -ENOMEM;
 
/* acquire resources and fill host */
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index bb82ef7..81192d0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -286,7 +286,11 @@ static struct drm_driver exynos_drm_driver = {
 
 static int exynos_drm_platform_probe(struct platform_device *pdev)
 {
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   int ret;
+
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
return drm_platform_init(&exynos_drm_driver, pdev);
 }
diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c 
b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index acf6678..701c4c1 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -664,8 +664,9 @@ static int omap_dmm_probe(struct platform_device *dev)
}
 
/* set dma mask for device */
-   /* NOTE: this is a workaround for the hwmod not initializing properly */
-   dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   goto fail;
 
omap_dmm->dummy_pa = page_to_phys(omap_dmm->dummy_page);
 
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Russell King
Use platform_device_register_full() for those drivers which can, to
avoid messing directly with DMA masks.  This can only be done when
the driver does not need to access the allocated musb platform device
from within its callbacks, which may be called during the musb
device probing.

Signed-off-by: Russell King 
---
 drivers/usb/musb/am35x.c|   50 ++
 drivers/usb/musb/da8xx.c|   49 ++---
 drivers/usb/musb/davinci.c  |   48 ++--
 drivers/usb/musb/tusb6010.c |   49 ++---
 4 files changed, 68 insertions(+), 128 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 5c310c6..790b22b 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -89,7 +89,6 @@ struct am35x_glue {
struct clk  *phy_clk;
struct clk  *clk;
 };
-#define glue_to_musb(g)platform_get_drvdata(g->musb)
 
 /*
  * am35x_musb_enable - enable interrupts
@@ -452,14 +451,18 @@ static const struct musb_platform_ops am35x_ops = {
.set_vbus   = am35x_musb_set_vbus,
 };
 
-static u64 am35x_dmamask = DMA_BIT_MASK(32);
+static const struct platform_device_info am35x_dev_info = {
+   .name   = "musb-hdrc",
+   .id = PLATFORM_DEVID_AUTO,
+   .dma_mask   = DMA_BIT_MASK(32),
+};
 
 static int am35x_probe(struct platform_device *pdev)
 {
struct musb_hdrc_platform_data  *pdata = dev_get_platdata(&pdev->dev);
struct platform_device  *musb;
struct am35x_glue   *glue;
-
+   struct platform_device_info pinfo;
struct clk  *phy_clk;
struct clk  *clk;
 
@@ -471,12 +474,6 @@ static int am35x_probe(struct platform_device *pdev)
goto err0;
}
 
-   musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
-   if (!musb) {
-   dev_err(&pdev->dev, "failed to allocate musb device\n");
-   goto err1;
-   }
-
phy_clk = clk_get(&pdev->dev, "fck");
if (IS_ERR(phy_clk)) {
dev_err(&pdev->dev, "failed to get PHY clock\n");
@@ -503,12 +500,7 @@ static int am35x_probe(struct platform_device *pdev)
goto err6;
}
 
-   musb->dev.parent= &pdev->dev;
-   musb->dev.dma_mask  = &am35x_dmamask;
-   musb->dev.coherent_dma_mask = am35x_dmamask;
-
glue->dev   = &pdev->dev;
-   glue->musb  = musb;
glue->phy_clk   = phy_clk;
glue->clk   = clk;
 
@@ -516,22 +508,17 @@ static int am35x_probe(struct platform_device *pdev)
 
platform_set_drvdata(pdev, glue);
 
-   ret = platform_device_add_resources(musb, pdev->resource,
-   pdev->num_resources);
-   if (ret) {
-   dev_err(&pdev->dev, "failed to add resources\n");
-   goto err7;
-   }
-
-   ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
-   if (ret) {
-   dev_err(&pdev->dev, "failed to add platform_data\n");
-   goto err7;
-   }
-
-   ret = platform_device_add(musb);
-   if (ret) {
-   dev_err(&pdev->dev, "failed to register musb device\n");
+   pinfo = am35x_dev_info;
+   pinfo.parent = &pdev->dev;
+   pinfo.res = pdev->resource;
+   pinfo.num_res = pdev->num_resources;
+   pinfo.data = pdata;
+   pinfo.size_data = sizeof(*pdata);
+
+   glue->musb = musb = platform_device_register_full(&pinfo);
+   if (IS_ERR(musb)) {
+   ret = PTR_ERR(musb);
+   dev_err(&pdev->dev, "failed to register musb device: %d\n", 
ret);
goto err7;
}
 
@@ -550,9 +537,6 @@ static int am35x_probe(struct platform_device *pdev)
clk_put(phy_clk);
 
 err3:
-   platform_device_put(musb);
-
-err1:
kfree(glue);
 
 err0:
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index d9ddf41..2f2c1cb 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -472,7 +472,11 @@ static const struct musb_platform_ops da8xx_ops = {
.set_vbus   = da8xx_musb_set_vbus,
 };
 
-static u64 da8xx_dmamask = DMA_BIT_MASK(32);
+static const struct platform_device_info da8xx_dev_info = {
+   .name   = "musb-hdrc",
+   .id = PLATFORM_DEVID_AUTO,
+   .dma_mask   = DMA_BIT_MASK(32),
+};
 
 static int da8xx_probe(struct platform_device *pdev)
 {
@@ -480,7 +484,7 @@ static int da8xx_probe(struct platform_device *pdev)
struct musb_hdrc_platform_data  *pdata = dev_get_platdata(&pdev->dev);
struct platform_device  *musb;
struct da8xx_glue   *glue;
-
+   struct platform_device_info pinfo;
   

[PATCH 46/51] ARM: DMA-API: better handing of DMA masks for coherent allocations

2013-09-20 Thread Russell King
We need to start treating DMA masks as something which is specific to
the bus that the device resides on, otherwise we're going to hit all
sorts of nasty issues with LPAE and 32-bit DMA controllers in >32-bit
systems, where memory is offset from PFN 0.

In order to start doing this, we convert the DMA mask to a PFN using
the device specific dma_to_pfn() macro.  This is the reverse of the
pfn_to_dma() macro which is used to get the DMA address for the device.

This gives us a PFN mask, which we can then check against the PFN
limit of the DMA zone.

Signed-off-by: Russell King 
---
 arch/arm/mm/dma-mapping.c |   49 
 arch/arm/mm/init.c|2 +
 arch/arm/mm/mm.h  |2 +
 3 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index f5e1a84..13d55e1 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -173,10 +173,30 @@ static u64 get_coherent_dma_mask(struct device *dev)
return 0;
}
 
-   if ((~mask) & (u64)arm_dma_limit) {
-   dev_warn(dev, "coherent DMA mask %#llx is smaller "
-"than system GFP_DMA mask %#llx\n",
-mask, (u64)arm_dma_limit);
+   /*
+* If the mask allows for more memory than we can address,
+* and we actually have that much memory, then fail the
+* allocation.
+*/
+   if (sizeof(mask) != sizeof(dma_addr_t) &&
+   mask > (dma_addr_t)~0 &&
+   dma_to_pfn(dev, ~0) > arm_dma_pfn_limit) {
+   dev_warn(dev, "Coherent DMA mask %#llx is larger than 
dma_addr_t allows\n",
+mask);
+   dev_warn(dev, "Driver did not use or check the return 
value from dma_set_coherent_mask()?\n");
+   return 0;
+   }
+
+   /*
+* Now check that the mask, when translated to a PFN,
+* fits within the allowable addresses which we can
+* allocate.
+*/
+   if (dma_to_pfn(dev, mask) < arm_dma_pfn_limit) {
+   dev_warn(dev, "Coherent DMA mask %#llx (pfn %#lx-%#lx) 
covers a smaller range of system memory than the DMA zone pfn 0x0-%#lx\n",
+mask,
+dma_to_pfn(dev, 0), dma_to_pfn(dev, mask) + 1,
+arm_dma_pfn_limit + 1);
return 0;
}
}
@@ -1007,8 +1027,27 @@ void arm_dma_sync_sg_for_device(struct device *dev, 
struct scatterlist *sg,
  */
 int dma_supported(struct device *dev, u64 mask)
 {
-   if (mask < (u64)arm_dma_limit)
+   unsigned long limit;
+
+   /*
+* If the mask allows for more memory than we can address,
+* and we actually have that much memory, then we must
+* indicate that DMA to this device is not supported.
+*/
+   if (sizeof(mask) != sizeof(dma_addr_t) &&
+   mask > (dma_addr_t)~0 &&
+   dma_to_pfn(dev, ~0) > arm_dma_pfn_limit)
+   return 0;
+
+   /*
+* Translate the device's DMA mask to a PFN limit.  This
+* PFN number includes the page which we can DMA to.
+*/
+   limit = dma_to_pfn(dev, mask);
+
+   if (limit < arm_dma_pfn_limit)
return 0;
+
return 1;
 }
 EXPORT_SYMBOL(dma_supported);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index febaee7..8aab24f 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -218,6 +218,7 @@ EXPORT_SYMBOL(arm_dma_zone_size);
  * so a successful GFP_DMA allocation will always satisfy this.
  */
 phys_addr_t arm_dma_limit;
+unsigned long arm_dma_pfn_limit;
 
 static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long 
*hole,
unsigned long dma_size)
@@ -240,6 +241,7 @@ void __init setup_dma_zone(const struct machine_desc *mdesc)
arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1;
} else
arm_dma_limit = 0x;
+   arm_dma_pfn_limit = arm_dma_limit >> PAGE_SHIFT;
 #endif
 }
 
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index d5a4e9a..d5a982d 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -81,8 +81,10 @@ extern __init void add_static_vm_early(struct static_vm 
*svm);
 
 #ifdef CONFIG_ZONE_DMA
 extern phys_addr_t arm_dma_limit;
+extern unsigned long arm_dma_pfn_limit;
 #else
 #define arm_dma_limit ((phys_addr_t)~0)
+#define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT)
 #endif
 
 extern phys_addr_t arm_lowmem_limit;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 45/51] DMA-API: firmware/google/gsmi.c: avoid direct access to DMA masks

2013-09-20 Thread Russell King
This driver doesn't need to directly access DMA masks if it uses the
platform_device_register_full() API rather than
platform_device_register_simple() - the former function can initialize
the DMA mask appropriately.

Signed-off-by: Russell King 
---
 drivers/firmware/google/gsmi.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index 6eb535f..e5a67b2 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -764,6 +764,13 @@ static __init int gsmi_system_valid(void)
 static struct kobject *gsmi_kobj;
 static struct efivars efivars;
 
+static const struct platform_device_info gsmi_dev_info = {
+   .name   = "gsmi",
+   .id = -1,
+   /* SMI callbacks require 32bit addresses */
+   .dma_mask   = DMA_BIT_MASK(32),
+};
+
 static __init int gsmi_init(void)
 {
unsigned long flags;
@@ -776,7 +783,7 @@ static __init int gsmi_init(void)
gsmi_dev.smi_cmd = acpi_gbl_FADT.smi_command;
 
/* register device */
-   gsmi_dev.pdev = platform_device_register_simple("gsmi", -1, NULL, 0);
+   gsmi_dev.pdev = platform_device_register_full(&gsmi_dev_info);
if (IS_ERR(gsmi_dev.pdev)) {
printk(KERN_ERR "gsmi: unable to register platform device\n");
return PTR_ERR(gsmi_dev.pdev);
@@ -785,10 +792,6 @@ static __init int gsmi_init(void)
/* SMI access needs to be serialized */
spin_lock_init(&gsmi_dev.lock);
 
-   /* SMI callbacks require 32bit addresses */
-   gsmi_dev.pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
-   gsmi_dev.pdev->dev.dma_mask =
-   &gsmi_dev.pdev->dev.coherent_dma_mask;
ret = -ENOMEM;
gsmi_dev.dma_pool = dma_pool_create("gsmi", &gsmi_dev.pdev->dev,
 GSMI_BUF_SIZE, GSMI_BUF_ALIGN, 0);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 47/51] ARM: 7794/1: block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit()

2013-09-20 Thread Russell King
From: Santosh Shilimkar 

The blk_queue_bounce_limit() API parameter 'dma_mask' is actually the
maximum address the device can handle rather than a dma_mask. Rename
it accordingly to avoid it being interpreted as dma_mask.

No functional change.

The idea is to fix the bad assumptions about dma_mask wherever it could
be miss-interpreted.

Signed-off-by: Santosh Shilimkar 
Signed-off-by: Russell King 
---
 block/blk-settings.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index c50ecf0..026c151 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -195,17 +195,17 @@ EXPORT_SYMBOL(blk_queue_make_request);
 /**
  * blk_queue_bounce_limit - set bounce buffer limit for queue
  * @q: the request queue for the device
- * @dma_mask: the maximum address the device can handle
+ * @max_addr: the maximum address the device can handle
  *
  * Description:
  *Different hardware can have different requirements as to what pages
  *it can do I/O directly to. A low level driver can call
  *blk_queue_bounce_limit to have lower memory pages allocated as bounce
- *buffers for doing I/O to pages residing above @dma_mask.
+ *buffers for doing I/O to pages residing above @max_addr.
  **/
-void blk_queue_bounce_limit(struct request_queue *q, u64 dma_mask)
+void blk_queue_bounce_limit(struct request_queue *q, u64 max_addr)
 {
-   unsigned long b_pfn = dma_mask >> PAGE_SHIFT;
+   unsigned long b_pfn = max_addr >> PAGE_SHIFT;
int dma = 0;
 
q->bounce_gfp = GFP_NOIO;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 48/51] ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev) helper function

2013-09-20 Thread Russell King
From: Santosh Shilimkar 

Most of the kernel assumes that PFN0 is the start of the physical
memory (RAM). This assumptions is not true on most of the ARM SOCs
and hence and if one try to update the ARM port to follow the assumptions,
we end of breaking the dma bounce limit for few block layer drivers.
One such example is trying to unify the meaning of max*_pfn on ARM
as the bootmem layer expects, breaks few block layer driver dma
bounce limit.

To fix this problem, we introduce dma_max_pfn(dev) generic helper with
a possibility of override from the architecture code. The helper converts
a DMA bitmask of bits to a block PFN number. In all the generic cases,
it is just  "dev->dma_mask >> PAGE_SHIFT" and hence default behavior
is maintained as is.

Subsequent patches will make use of the helper. No functional change.

Signed-off-by: Santosh Shilimkar 
Signed-off-by: Russell King 
---
 include/linux/dma-mapping.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 27d1421..fd4aee2 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -153,6 +153,13 @@ static inline int dma_set_seg_boundary(struct device *dev, 
unsigned long mask)
return -EIO;
 }
 
+#ifndef dma_max_pfn
+static inline unsigned long dma_max_pfn(struct device *dev)
+{
+   return *dev->dma_mask >> PAGE_SHIFT;
+}
+#endif
+
 static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flag)
 {
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 49/51] ARM: 7796/1: scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-20 Thread Russell King
From: Santosh Shilimkar 

DMA bounce limit is the maximum direct DMA'able memory beyond which
bounce buffers has to be used to perform dma operations. SCSI driver
relies on dma_mask but its calculation is based on max_*pfn which
don't have uniform meaning across architectures. So make use of
dma_max_pfn() which is expected to return the DMAable maximum pfn
value across architectures.

Signed-off-by: Santosh Shilimkar 
Signed-off-by: Russell King 
---
 drivers/scsi/scsi_lib.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index d1549b7..7bd7f0d 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1684,7 +1684,7 @@ u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost)
 
host_dev = scsi_get_device(shost);
if (host_dev && host_dev->dma_mask)
-   bounce_limit = *host_dev->dma_mask;
+   bounce_limit = dma_max_pfn(host_dev) << PAGE_SHIFT;
 
return bounce_limit;
 }
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 50/51] ARM: 7797/1: mmc: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-20 Thread Russell King
From: Santosh Shilimkar 

DMA bounce limit is the maximum direct DMA'able memory beyond which
bounce buffers has to be used to perform dma operations. MMC queue layr
relies on dma_mask but its calculation is based on max_*pfn which
don't have uniform meaning across architectures. So make use of
dma_max_pfn() which is expected to return the DMAable maximum pfn
value across architectures.

Signed-off-by: Santosh Shilimkar 
Signed-off-by: Russell King 
---
 drivers/mmc/card/queue.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index fa9632e..357bbc5 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -196,7 +197,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card 
*card,
struct mmc_queue_req *mqrq_prev = &mq->mqrq[1];
 
if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
-   limit = *mmc_dev(host)->dma_mask;
+   limit = dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT;
 
mq->card = card;
mq->queue = blk_init_queue(mmc_request_fn, lock);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 51/51] ARM: 7805/1: mm: change max*pfn to include the physical offset of memory

2013-09-20 Thread Russell King
From: Santosh Shilimkar 

Most of the kernel code assumes that max*pfn is maximum pfns because
the physical start of memory is expected to be PFN0. Since this
assumption is not true on ARM architectures, the meaning of max*pfn
is number of memory pages. This is done to keep drivers happy which
are making use of of these variable to calculate the dma bounce limit
using dma_mask.

Now since we have a architecture override possibility for DMAable
maximum pfns, lets make meaning of max*pfns as maximum pnfs on ARM
as well.

Signed-off-by: Santosh Shilimkar 
Signed-off-by: Russell King 
---
 arch/arm/include/asm/dma-mapping.h |8 
 arch/arm/mm/init.c |   10 --
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/dma-mapping.h 
b/arch/arm/include/asm/dma-mapping.h
index 5b579b9..863cd84 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -64,6 +64,7 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void 
*addr)
 {
return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
 }
+
 #else
 static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
 {
@@ -86,6 +87,13 @@ static inline dma_addr_t virt_to_dma(struct device *dev, 
void *addr)
 }
 #endif
 
+/* The ARM override for dma_max_pfn() */
+static inline unsigned long dma_max_pfn(struct device *dev)
+{
+   return PHYS_PFN_OFFSET + dma_to_pfn(dev, *dev->dma_mask);
+}
+#define dma_max_pfn(dev) dma_max_pfn(dev)
+
 /*
  * DMA errors are defined by all-bits-set in the DMA address.
  */
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 8aab24f..d50533c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -426,12 +426,10 @@ void __init bootmem_init(void)
 * This doesn't seem to be used by the Linux memory manager any
 * more, but is used by ll_rw_block.  If we can get rid of it, we
 * also get rid of some of the stuff above as well.
-*
-* Note: max_low_pfn and max_pfn reflect the number of _pages_ in
-* the system, not the maximum PFN.
 */
-   max_low_pfn = max_low - PHYS_PFN_OFFSET;
-   max_pfn = max_high - PHYS_PFN_OFFSET;
+   min_low_pfn = min;
+   max_low_pfn = max_low;
+   max_pfn = max_high;
 }
 
 /*
@@ -537,7 +535,7 @@ static inline void free_area_high(unsigned long pfn, 
unsigned long end)
 static void __init free_highpages(void)
 {
 #ifdef CONFIG_HIGHMEM
-   unsigned long max_low = max_low_pfn + PHYS_PFN_OFFSET;
+   unsigned long max_low = max_low_pfn;
struct memblock_region *mem, *res;
 
/* set highmem page free */
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [media-workshop] Kernel Summit Media Mini-summit attendees on Oct 23 in Edinburgh

2013-09-20 Thread Mauro Carvalho Chehab
Em Fri, 20 Sep 2013 09:59:28 +0200
Hans de Goede  escreveu:

> Hi,
> 
> Sorry for replying in the midst of the thread I deleted
> the beginning before realizing I should respond.
> 
> > On 09/17/13 19:08, Mauro Carvalho Chehab wrote:
> >> Hi,
> >>
> >> I'm trying to consolidate the list of interested people on
> >> participating at this year's the media mini-summit. From what I got
> >> from the discussions, we have, so far:
> >>
> >>Benjamin Gaignard 
> >>Guennadi Liakhovetski 
> >>Hans Verkuil 
> >>Hugues FRUCHET 
> >>Laurent Pinchart 
> >>Mauro Carvalho Chehab 
> >>Michael Krufky 
> >>Oliver Schinagl 
> >>Pawel Osciak 
> >>Peter Senna Tschudin 
> >>Ricardo Ribalda Delgado 
> >>Sakari Ailus 
> >>
> >> Please let me know if I'm missing someone, or if one of the above
> >> won't be able to go to the meeting, as my plan is to send the
> >> invitations tomorrow.
> 
> I'll be in Edinburgh for kvm-forum and I would like to attend the meeting,
> at least the parts about the userspace libraries.

Ok.

I'll add your name to the list of atendees.

Regards,
Mauro

> 
> Regards,
> 
> Hans (de Goede)
> 
> ___
> media-workshop mailing list
> media-works...@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/media-workshop




Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: adv7343: fix the DT binding properties

2013-09-20 Thread Sylwester Nawrocki
Hi Prabhakar,

On 09/20/2013 10:11 AM, Prabhakar Lad wrote:
> OK I will, just send out a fix up patch which fixes the mismatch between
> names for the rc-cycle, and later send out a patch which removes the
> platform data usage for next release with proper DT bindings.

I think the binding need to be fully corrected now, I just meant to not
touch the board file, i.e. leave non-dt support unchanged.

> I'm OK with making regulator properties as optional, But still it would
> change the meaning of what DT is, we know that the VDD/VDD_IO .. etc
> pins are required properties (but still making them as optional) :-(
> 
> I think there might several devices where this situation may arise so
> just thinking of a alternative solution.
> 
> say we have property 'software-regulator' which takes true/false(0/1)
> If set to true we make the regulators as required property or else we
> assume it is handled and ignore it ?

I don't think this is a good idea. You would have to add a similar platform 
data flag for non-dt, it doesn't sound right. I can see two options here: 

1. Make the regulator properties mandatory and, e.g. define a fixed 
   voltage GPIO regulator in DT with an empty 'gpio' property. Then
   pass a phandle to that regulator in the adv7343 *-supply properties.
   For non-dt similarly a fixed voltage regulator(s) and voltage 
   supplies  would need to be defined in the board files.

2. Make the properties optional and use (devm_)regulator_get_optional()
   calls in the driver (a recently added function). I must admit I don't 
   fully understand description of this function, it currently looks 
   pretty much same as (devm_)regulator_get(). Thus the driver would 
   need to be handling regulator supplies only when non ERR_PTR() is 
   returned from regulator_get_optional() and otherwise assume a non 
   critical error. There is already quite a few example occurrences of 
   regulator_get_optional() usage.

--
Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/1] [media] radio-sf16fmr2: Remove redundant dev_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
---
 drivers/media/radio/radio-sf16fmr2.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/radio/radio-sf16fmr2.c 
b/drivers/media/radio/radio-sf16fmr2.c
index f1e3714..448cac9 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -295,7 +295,6 @@ static void fmr2_remove(struct fmr2 *fmr2)
 static int fmr2_isa_remove(struct device *pdev, unsigned int ndev)
 {
fmr2_remove(dev_get_drvdata(pdev));
-   dev_set_drvdata(pdev, NULL);
 
return 0;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 9/9] [media] pci: ngene: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
---
 drivers/media/pci/ngene/ngene-core.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/ngene/ngene-core.c 
b/drivers/media/pci/ngene/ngene-core.c
index 37ebc42..8402ed6 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -1648,7 +1648,6 @@ void ngene_remove(struct pci_dev *pdev)
cxd_detach(dev);
ngene_stop(dev);
ngene_release_buffers(dev);
-   pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev);
 }
 
@@ -1702,6 +1701,5 @@ fail1:
ngene_release_buffers(dev);
 fail0:
pci_disable_device(pci_dev);
-   pci_set_drvdata(pci_dev, NULL);
return stat;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/9] [media] pci: saa7164: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
Cc: Steven Toth 
---
 drivers/media/pci/saa7164/saa7164-core.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/pci/saa7164/saa7164-core.c 
b/drivers/media/pci/saa7164/saa7164-core.c
index d37ee37..41adf26 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1439,7 +1439,6 @@ static void saa7164_finidev(struct pci_dev *pci_dev)
 
/* unregister stuff */
free_irq(pci_dev->irq, dev);
-   pci_set_drvdata(pci_dev, NULL);
 
mutex_lock(&devlist);
list_del(&dev->devlist);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/9] [media] pci: bt878: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
---
 drivers/media/pci/bt8xx/bt878.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c
index 66eb0ba..2bd2483 100644
--- a/drivers/media/pci/bt8xx/bt878.c
+++ b/drivers/media/pci/bt8xx/bt878.c
@@ -563,7 +563,6 @@ static void bt878_remove(struct pci_dev *pci_dev)
bt->shutdown = 1;
bt878_mem_free(bt);
 
-   pci_set_drvdata(pci_dev, NULL);
pci_disable_device(pci_dev);
return;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/9] [media] pci: mantis: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
Cc: Manu Abraham 
---
 drivers/media/pci/mantis/mantis_pci.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/mantis/mantis_pci.c 
b/drivers/media/pci/mantis/mantis_pci.c
index a846036..9e89e04 100644
--- a/drivers/media/pci/mantis/mantis_pci.c
+++ b/drivers/media/pci/mantis/mantis_pci.c
@@ -143,7 +143,6 @@ fail1:
 
 fail0:
dprintk(MANTIS_ERROR, 1, "ERROR: <%d> exiting", ret);
-   pci_set_drvdata(pdev, NULL);
return ret;
 }
 EXPORT_SYMBOL_GPL(mantis_pci_init);
@@ -161,7 +160,6 @@ void mantis_pci_exit(struct mantis_pci *mantis)
}
 
pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
 }
 EXPORT_SYMBOL_GPL(mantis_pci_exit);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/9] [media] pci: cx88: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
---
 drivers/media/pci/cx88/cx88-alsa.c  |2 --
 drivers/media/pci/cx88/cx88-mpeg.c  |1 -
 drivers/media/pci/cx88/cx88-video.c |1 -
 3 files changed, 4 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 4a3f96e..11d0692 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -935,8 +935,6 @@ static void cx88_audio_finidev(struct pci_dev *pci)
 
snd_card_free((void *)card);
 
-   pci_set_drvdata(pci, NULL);
-
devno--;
 }
 
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c
index e31a75f..684eff5 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -520,7 +520,6 @@ static void cx8802_fini_common(struct cx8802_dev *dev)
 
/* unregister stuff */
free_irq(dev->pci->irq, dev);
-   pci_set_drvdata(dev->pci, NULL);
 
/* free memory */
btcx_riscmem_free(dev->pci,&dev->mpegq.stopper);
diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index 356725c..1aed764 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1922,7 +1922,6 @@ static void cx8800_finidev(struct pci_dev *pci_dev)
 
free_irq(pci_dev->irq, dev);
cx8800_unregister_video(dev);
-   pci_set_drvdata(pci_dev, NULL);
 
/* free memory */
btcx_riscmem_free(dev->pci,&dev->vidq.stopper);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/9] [media] pci: dm1105: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
Cc: Igor M. Liplianin 
---
 drivers/media/pci/dm1105/dm1105.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/dm1105/dm1105.c 
b/drivers/media/pci/dm1105/dm1105.c
index ab797fe..e985e3b 100644
--- a/drivers/media/pci/dm1105/dm1105.c
+++ b/drivers/media/pci/dm1105/dm1105.c
@@ -1178,7 +1178,6 @@ err_pci_release_regions:
 err_pci_disable_device:
pci_disable_device(pdev);
 err_kfree:
-   pci_set_drvdata(pdev, NULL);
kfree(dev);
return ret;
 }
@@ -1211,7 +1210,6 @@ static void dm1105_remove(struct pci_dev *pdev)
pci_iounmap(pdev, dev->io_mem);
pci_release_regions(pdev);
pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
dm1105_devcount--;
kfree(dev);
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/9] [media] pci: pluto2: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
Cc: Andreas Oberritter 
---
 drivers/media/pci/pluto2/pluto2.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/pluto2/pluto2.c 
b/drivers/media/pci/pluto2/pluto2.c
index 4938285..8164d74 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -736,7 +736,6 @@ err_pci_release_regions:
 err_pci_disable_device:
pci_disable_device(pdev);
 err_kfree:
-   pci_set_drvdata(pdev, NULL);
kfree(pluto);
goto out;
 }
@@ -765,7 +764,6 @@ static void pluto2_remove(struct pci_dev *pdev)
pci_iounmap(pdev, pluto->io_mem);
pci_release_regions(pdev);
pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
kfree(pluto);
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/9] [media] pci: pt1: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
Cc: Takahito HIRANO 
---
 drivers/media/pci/pt1/pt1.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 75ce142..db887b0 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -1076,7 +1076,6 @@ static void pt1_remove(struct pci_dev *pdev)
pt1_update_power(pt1);
pt1_cleanup_adapters(pt1);
i2c_del_adapter(&pt1->i2c_adap);
-   pci_set_drvdata(pdev, NULL);
kfree(pt1);
pci_iounmap(pdev, regs);
pci_release_regions(pdev);
@@ -1198,7 +1197,6 @@ err_i2c_del_adapter:
 err_pt1_cleanup_adapters:
pt1_cleanup_adapters(pt1);
 err_kfree:
-   pci_set_drvdata(pdev, NULL);
kfree(pt1);
 err_pci_iounmap:
pci_iounmap(pdev, regs);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/9] [media] pci: flexcop: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat 
Cc: Patrick Boettcher 
---
 drivers/media/pci/b2c2/flexcop-pci.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/b2c2/flexcop-pci.c 
b/drivers/media/pci/b2c2/flexcop-pci.c
index 447afbd..8b5e0b3 100644
--- a/drivers/media/pci/b2c2/flexcop-pci.c
+++ b/drivers/media/pci/b2c2/flexcop-pci.c
@@ -319,7 +319,6 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
 
 err_pci_iounmap:
pci_iounmap(fc_pci->pdev, fc_pci->io_mem);
-   pci_set_drvdata(fc_pci->pdev, NULL);
 err_pci_release_regions:
pci_release_regions(fc_pci->pdev);
 err_pci_disable_device:
@@ -332,7 +331,6 @@ static void flexcop_pci_exit(struct flexcop_pci *fc_pci)
if (fc_pci->init_state & FC_PCI_INIT) {
free_irq(fc_pci->pdev->irq, fc_pci);
pci_iounmap(fc_pci->pdev, fc_pci->io_mem);
-   pci_set_drvdata(fc_pci->pdev, NULL);
pci_release_regions(fc_pci->pdev);
pci_disable_device(fc_pci->pdev);
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] [media] pci: cx88-alsa: Use module_pci_driver

2013-09-20 Thread Sachin Kamat
module_pci_driver removes some boilerplate and makes code simpler.

Signed-off-by: Sachin Kamat 
---
 drivers/media/pci/cx88/cx88-alsa.c |   25 +
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 05428bf..11d0692 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -949,27 +949,4 @@ static struct pci_driver cx88_audio_pci_driver = {
.remove   = cx88_audio_finidev,
 };
 
-/
-   LINUX MODULE INIT
- /
-
-/*
- * module init
- */
-static int __init cx88_audio_init(void)
-{
-   printk(KERN_INFO "cx2388x alsa driver version %s loaded\n",
-  CX88_VERSION);
-   return pci_register_driver(&cx88_audio_pci_driver);
-}
-
-/*
- * module remove
- */
-static void __exit cx88_audio_fini(void)
-{
-   pci_unregister_driver(&cx88_audio_pci_driver);
-}
-
-module_init(cx88_audio_init);
-module_exit(cx88_audio_fini);
+module_pci_driver(cx88_audio_pci_driver);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] [media] pci: cx88-mpeg: Use module_pci_driver

2013-09-20 Thread Sachin Kamat
module_pci_driver removes some boilerplate and makes code simpler.

Signed-off-by: Sachin Kamat 
Cc: Jelle Foks 
---
 drivers/media/pci/cx88/cx88-mpeg.c |   14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c
index 86d2008..684eff5 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -902,20 +902,8 @@ static struct pci_driver cx8802_pci_driver = {
.remove   = cx8802_remove,
 };
 
-static int __init cx8802_init(void)
-{
-   printk(KERN_INFO "cx88/2: cx2388x MPEG-TS Driver Manager version %s 
loaded\n",
-  CX88_VERSION);
-   return pci_register_driver(&cx8802_pci_driver);
-}
-
-static void __exit cx8802_fini(void)
-{
-   pci_unregister_driver(&cx8802_pci_driver);
-}
+module_pci_driver(cx8802_pci_driver);
 
-module_init(cx8802_init);
-module_exit(cx8802_fini);
 EXPORT_SYMBOL(cx8802_buf_prepare);
 EXPORT_SYMBOL(cx8802_buf_queue);
 EXPORT_SYMBOL(cx8802_cancel_buffers);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] [media] pci: cx88-video: Use module_pci_driver

2013-09-20 Thread Sachin Kamat
module_pci_driver removes some boilerplate and makes code simpler.

Signed-off-by: Sachin Kamat 
Cc: Gerd Knorr 
---
 drivers/media/pci/cx88/cx88-video.c |   15 +--
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index d3c2c7f..1aed764 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -2038,17 +2038,4 @@ static struct pci_driver cx8800_pci_driver = {
 #endif
 };
 
-static int __init cx8800_init(void)
-{
-   printk(KERN_INFO "cx88/0: cx2388x v4l2 driver version %s loaded\n",
-  CX88_VERSION);
-   return pci_register_driver(&cx8800_pci_driver);
-}
-
-static void __exit cx8800_fini(void)
-{
-   pci_unregister_driver(&cx8800_pci_driver);
-}
-
-module_init(cx8800_init);
-module_exit(cx8800_fini);
+module_pci_driver(cx8800_pci_driver);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: adv7343: fix the DT binding properties

2013-09-20 Thread Prabhakar Lad
Hi Sylwester,

On Fri, Sep 20, 2013 at 1:19 AM, Sylwester Nawrocki
 wrote:
> On 09/19/2013 06:06 PM, Prabhakar Lad wrote:
>>
>> On Mon, Sep 16, 2013 at 9:54 PM, Stephen Warren
>> wrote:
>>>
>>> On 09/13/2013 11:23 PM, Prabhakar Lad wrote:

 On Sat, Sep 14, 2013 at 4:16 AM, Stephen Warren
 wrote:
>
> On 09/13/2013 05:57 AM, Prabhakar Lad wrote:
>>
>> From: "Lad, Prabhakar"
>>
>> This patch fixes the DT binding properties of adv7343 decoder.
>> The pdata which was being read from the DT property, is removed
>> as this can done internally in the driver using cable detection
>> register.
>>
>> This patch also removes the pdata of ADV7343 which was passed from
>> DA850 machine.
>
>
>> diff --git a/Documentation/devicetree/bindings/media/i2c/adv7343.txt
>> b/Documentation/devicetree/bindings/media/i2c/adv7343.txt
>
>
>>   Required Properties :
>>   - compatible: Must be "adi,adv7343"
>> +- reg: I2C device address.
>> +- vddio-supply: I/O voltage supply.
>> +- vddcore-supply: core voltage supply.
>> +- vaa-supply: Analog power supply.
>> +- pvdd-supply: PLL power supply.
>
>
> Old DTs won't contain those properties. This breaks the DT ABI if those
> properties are required. Is that acceptable?


 As of now adv7343 via DT binding is not enabled in any platforms
 so this wont break any DT ABI.
>>>
>>>
>>> Well, if the binding has already been written, it technically already is
>>> an ABI. Perhaps the binding can be fixed if it isn't in use yet, but
>>> this is definitely not the correct approach to DT.
>
>
> The binding got merged for 3.12-rc1 and the intention of this patch was
> to correct that binding. There we some issues like mismatch between names
> of properties documented and used in the driver.
>
> After Mark's suggestion Prabhakar removed some properties and the platform
> data usage altogether. IMHO there should be only minimal changes in that
> "fixup" patch, i.e. no platform data usage should be removed. Perhaps it
> is fine since that's just code removal. I guess it is better to do this
> sort of cleanup for the next kernel release.
>
OK I will, just send out a fix up patch which fixes the mismatch between
names for the rc-cycle, and later send out a patch which removes the
platform data usage for next release with proper DT bindings.

> Also I believe the argument of backward compatibility shouldn't really be
> considered here. The $subject patch is supposed to correct the binding
> before it becomes and ABI.
>
>
> If it is, I think we should document that older versions of the binding
> didn't require those properties, so they may in fact be missing.
>
> I note that this patch doesn't actually update the driver to
> regulator_get() anything. Shouldn't it?


 As of now the driver isn’t enabling/accepting the regulators,
 so should I add those in DT properties or not ?
>>>
>>>
>>> The binding should describe the HW, not what the driver does/doesn't yet
>>> do. I wrote the above because it looked like the driver was broken, not
>>> to encourage you to remove properties from the binding.
>>
>> OK
>>
>>> How does the
>>> driver work if it doesn't enable the required regulators though, I
>>> wonder? I suppose the boards this driver has been tested on all must
>>> used fixed (non-SW-controlled) regulators.
>>>
>> on all the boards on which this decoder is connected the power to it
>> is provided by static circuit and not by regulators, So for this how would
>> you suggest to add the DT nodes for regulators ?
>
>
> I believe the regulator DT properties should be made optional. Since some
> (actually all upstream) boards don't bother with software controlled
> regulators. We might have specified them and have defined relevant fixed
> regulator(s) in DT. But I doubt it is sensible, given that it may never
> happen in practice the regulators are required to be controlled by software
> through the regulators API. Such devices can often be put in a low power
> mode by a write to one of the registers, where their supply current is at
> uA level. Looking at the datasheet ADV7343 has SLEEP_MODE in which its
> typical current consumption is 5 uA.
>
> That said the chip could be supplied from shared voltage regulators and
> the driver would then have to properly request and enable the regulators.
>
> Anyway I'm inclined to make the regulator properties optional.
>
I'm OK with making regulator properties as optional, But still it would
change the meaning of what DT is, we know that the VDD/VDD_IO .. etc
pins are required properties (but still making them as optional) :-(

I think there might several devices where this situation may arise so
just thinking of a alternative solution.

say we have property 'software-regulator' which takes true/false(0/1)
If set to true we make the regulators as required property or else we
assume it is handled a

Re: [media-workshop] Kernel Summit Media Mini-summit attendees on Oct 23 in Edinburgh

2013-09-20 Thread Hans de Goede

Hi,

Sorry for replying in the midst of the thread I deleted
the beginning before realizing I should respond.


On 09/17/13 19:08, Mauro Carvalho Chehab wrote:

Hi,

I'm trying to consolidate the list of interested people on
participating at this year's the media mini-summit. From what I got
from the discussions, we have, so far:

Benjamin Gaignard 
Guennadi Liakhovetski 
Hans Verkuil 
Hugues FRUCHET 
Laurent Pinchart 
Mauro Carvalho Chehab 
Michael Krufky 
Oliver Schinagl 
Pawel Osciak 
Peter Senna Tschudin 
Ricardo Ribalda Delgado 
Sakari Ailus 

Please let me know if I'm missing someone, or if one of the above
won't be able to go to the meeting, as my plan is to send the
invitations tomorrow.


I'll be in Edinburgh for kvm-forum and I would like to attend the meeting,
at least the parts about the userspace libraries.

Regards,

Hans (de Goede)
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html