[PATCH] Staging: comedi: pcmuio: fix bare use of 'unsigned'

2016-06-21 Thread Ravishankar Karkala Mallikarjunayya
This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya 
---
 drivers/staging/comedi/drivers/pcmuio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/pcmuio.c 
b/drivers/staging/comedi/drivers/pcmuio.c
index 7ea8130..8ad64f2 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev,
 
 static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
  struct comedi_subdevice *s,
- unsigned triggered)
+ unsigned int triggered)
 {
struct pcmuio_private *devpriv = dev->private;
int asic = pcmuio_subdevice_to_asic(s);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/2] staging: comedi: addi_apci_3501: cleanup driver

2016-06-21 Thread Ian Abbott

On 20/06/16 19:12, H Hartley Sweeten wrote:

The timer/counter subdevice in this driver is broken and it really
doesn't add much use if it did work.

Remove the timer/counter support and add the missing comedi driver
comment block.

H Hartley Sweeten (2):
  staging: comedi: addi_apci_3501: remove timer/counter subdevice support
  staging: comedi: addi_apci_3501: add a comedi driver comment block

 .../comedi/drivers/addi-data/hwdrv_apci3501.c  | 141 -
 drivers/staging/comedi/drivers/addi_apci_3501.c|  85 +
 2 files changed, 29 insertions(+), 197 deletions(-)
 delete mode 100644 drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c



Thanks Hartley!

Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/9] staging: comedi: fix comedi driver comment blocks

2016-06-21 Thread Ian Abbott

On 20/06/16 19:39, H Hartley Sweeten wrote:

Fix the checkpatch.pl issues with the comment blocks that are used to
automatically generate documentation in Comedi and Comedilib.

H Hartley Sweeten (9):
  staging: comedi: das08_cs: fix block comments
  staging: comedi: ni_670x: fix block comment issues
  staging: comedi: ni_pcimio: fix block comments
  staging: comedi: ni_mio_cs: fix block comments
  staging: comedi: ni_daq_dio24: fix block comments
  staging: comedi: ni_atmio: fix block comments
  staging: comedi: ni_atmio16d: fix block comments
  staging: comedi: ni_pcidio: fix block comments
  staging: comedi: ni_at_a2150: fix block comments

 drivers/staging/comedi/drivers/das08_cs.c |  73 +
 drivers/staging/comedi/drivers/ni_670x.c  |  62 
 drivers/staging/comedi/drivers/ni_at_a2150.c  | 103 ++--
 drivers/staging/comedi/drivers/ni_atmio.c | 165 ++--
 drivers/staging/comedi/drivers/ni_atmio16d.c  | 106 ++---
 drivers/staging/comedi/drivers/ni_daq_dio24.c |  58 +++
 drivers/staging/comedi/drivers/ni_mio_cs.c|  67 
 drivers/staging/comedi/drivers/ni_pcidio.c|  95 +--
 drivers/staging/comedi/drivers/ni_pcimio.c| 216 +-
 9 files changed, 450 insertions(+), 495 deletions(-)



Thanks Hartley!

Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/3] staging : comedi : s626: fix type issues.

2016-06-21 Thread Ian Abbott

On 21/06/16 07:38, Ravishankar Karkala Mallikarjunayya wrote:

This fixes up a type issues like
i.e Prefer kernel type 'u8' over 'uint8_t'
Prefer kernel type 'u16' over 'uint16_t'
Prefer kernel type 'u32' over 'uint32_t'
Prefer kernel type 's16' over 'int16_t'
Prefer kernel type 's32' over 'int32_t'
found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya 
---
Change log v1->v2
- No Change
---
 drivers/staging/comedi/drivers/s626.c | 178 +-
 1 file changed, 89 insertions(+), 89 deletions(-)


The patch looks fine, but needs to be rebased as it no longer applies to 
"linux-next", or to Greg's "staging-testing" (and "staging-next") branches.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 2/3] Staging: comedi: s626: Fix Warning issues.

2016-06-21 Thread Ian Abbott

On 21/06/16 07:38, Ravishankar Karkala Mallikarjunayya wrote:

This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya 
---
Change log v1->v2
- No Change
---
 drivers/staging/comedi/drivers/s626.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)



This one no longer applies, as it has already been fixed in Greg's 
"staging-testing" and "staging-next" branches, and in the "linux-next" 
repository.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 3/3] Staging: comedi: s626: fix line over 80 characters issue

2016-06-21 Thread Ian Abbott

On 21/06/16 07:44, Ravishankar Karkala Mallikarjunayya wrote:

This fixes up a line over 80 characters issues found by
the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya 
---
Change log v1->v2
- No Change
---
 drivers/staging/comedi/drivers/s626.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/s626.c 
b/drivers/staging/comedi/drivers/s626.c
index f6806ae..73196c7 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -2500,7 +2500,8 @@ static int s626_initialize(struct comedi_device *dev)
for (i = 0; i < 2; i++) {
writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT);
s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2);
-   ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 
0);
+   ret = comedi_timeout(dev, NULL,
+NULL, s626_i2c_handshake_eoc, 0);
if (ret)
return ret;
}



Thanks!  This one applies cleanly without the other two patches in the 
series.


Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: pcmuio: fix bare use of 'unsigned'

2016-06-21 Thread Ian Abbott

On 21/06/16 11:16, Ravishankar Karkala Mallikarjunayya wrote:

This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya 
---
 drivers/staging/comedi/drivers/pcmuio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/pcmuio.c 
b/drivers/staging/comedi/drivers/pcmuio.c
index 7ea8130..8ad64f2 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev,

 static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
  struct comedi_subdevice *s,
- unsigned triggered)
+ unsigned int triggered)
 {
struct pcmuio_private *devpriv = dev->private;
int asic = pcmuio_subdevice_to_asic(s);



Thanks, but this one has already been fixed in the "linux-next" 
repository and in Greg's "staging" repository.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch] staging: comedi: dt2811: fix a precedence bug

2016-06-21 Thread Dan Carpenter
Bitwise | has higher precedence than ?: so we need to add some
parenthesis for this to work as intended.

Fixes: 7c9574090d30 ('staging: comedi: dt2811: simplify A/D reference 
configuration')
Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/comedi/drivers/dt2811.c 
b/drivers/staging/comedi/drivers/dt2811.c
index 904f6377..8bbd938 100644
--- a/drivers/staging/comedi/drivers/dt2811.c
+++ b/drivers/staging/comedi/drivers/dt2811.c
@@ -588,8 +588,8 @@ static int dt2811_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE |
- (it->options[2] == 1) ? SDF_DIFF :
- (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND;
+ ((it->options[2] == 1) ? SDF_DIFF :
+  (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND);
s->n_chan   = (it->options[2] == 1) ? 8 : 16;
s->maxdata  = 0x0fff;
s->range_table  = board->is_pgh ? &dt2811_pgh_ai_ranges
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch] staging: comedi: dt2811: fix a precedence bug

2016-06-21 Thread Ian Abbott

On 21/06/16 12:46, Dan Carpenter wrote:

Bitwise | has higher precedence than ?: so we need to add some
parenthesis for this to work as intended.

Fixes: 7c9574090d30 ('staging: comedi: dt2811: simplify A/D reference 
configuration')
Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/comedi/drivers/dt2811.c 
b/drivers/staging/comedi/drivers/dt2811.c
index 904f6377..8bbd938 100644
--- a/drivers/staging/comedi/drivers/dt2811.c
+++ b/drivers/staging/comedi/drivers/dt2811.c
@@ -588,8 +588,8 @@ static int dt2811_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
s = &dev->subdevices[0];
s->type  = COMEDI_SUBD_AI;
s->subdev_flags  = SDF_READABLE |
- (it->options[2] == 1) ? SDF_DIFF :
- (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND;
+ ((it->options[2] == 1) ? SDF_DIFF :
+  (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND);
s->n_chan= (it->options[2] == 1) ? 8 : 16;
s->maxdata   = 0x0fff;
s->range_table   = board->is_pgh ? &dt2811_pgh_ai_ranges



Nice catch, thanks!

Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: esp8089: add new driver

2016-06-21 Thread Greg KH
On Tue, Jun 21, 2016 at 07:35:24AM +0800, Icenowy Zheng wrote:
> The driver is only a working port of a badly written driver extracted from an 
> old and vendor-specified kernel source.
> I cannot promise the code style (although I did indent -kr -i8).
> I cannot also promise the effect.

I don't understand this at all, sorry.

Why should we accept this driver?  Who is going to maintain it?  What
needs to be done to it?

And why are you top-posting?  :)

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch] staging: comedi: dt2811: fix a precedence bug

2016-06-21 Thread walter harms


Am 21.06.2016 15:56, schrieb Ian Abbott:
> On 21/06/16 12:46, Dan Carpenter wrote:
>> Bitwise | has higher precedence than ?: so we need to add some
>> parenthesis for this to work as intended.
>>
>> Fixes: 7c9574090d30 ('staging: comedi: dt2811: simplify A/D reference
>> configuration')
>> Signed-off-by: Dan Carpenter 
>>
>> diff --git a/drivers/staging/comedi/drivers/dt2811.c
>> b/drivers/staging/comedi/drivers/dt2811.c
>> index 904f6377..8bbd938 100644
>> --- a/drivers/staging/comedi/drivers/dt2811.c
>> +++ b/drivers/staging/comedi/drivers/dt2811.c
>> @@ -588,8 +588,8 @@ static int dt2811_attach(struct comedi_device
>> *dev, struct comedi_devconfig *it)
>>  s = &dev->subdevices[0];
>>  s->type= COMEDI_SUBD_AI;
>>  s->subdev_flags= SDF_READABLE |
>> -  (it->options[2] == 1) ? SDF_DIFF :
>> -  (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND;
>> +  ((it->options[2] == 1) ? SDF_DIFF :
>> +   (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND);
>>  s->n_chan= (it->options[2] == 1) ? 8 : 16;
>>  s->maxdata= 0x0fff;
>>  s->range_table= board->is_pgh ? &dt2811_pgh_ai_ranges
>>
> 

perhaps we can improve readability with something like that (untested):

switch(it->options[2]) {
case 1:
 s->subdev_flags= SDF_READABLE|SDF_DIFF;
 break;
case 2:
 s->subdev_flags= SDF_READABLE|SDF_COMMON;
 break;
default:
 s->subdev_flags=SDF_READABLE|SDF_GROUND;
}

so everyone has a chance to see what is going on.

just my 2 cents,

re,
 wh


> Nice catch, thanks!
> 
> Reviewed-by: Ian Abbott 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 2/2] staging: wilc1000: Replace kthread with workqueue for host interface

2016-06-21 Thread Arnd Bergmann
On Monday, June 20, 2016 3:40:19 PM CEST Binoy Jayan wrote:
> Deconstruct the kthread / message_queue logic, replacing it with
> create_singlethread_workqueue() / queue_work() setup, by adding a
> 'struct work_struct' to 'struct host_if_msg'. The current kthread
> hostIFthread() is converted to a work queue helper with the name
> 'host_if_work'.
> 
> Signed-off-by: Binoy Jayan 
> Reviewed-by: Arnd Bergmann 

Hi Binoy,

You made a mistake here in adding the 'Reviewed-by:' tag before I replied with
that tag. I did a review of an earlier version and you addressed the comments
that I had for that, but you can only add the tag after I send that reply.

That said, the patch looks very good to me, and I see no remaining
problems that would prevent it from getting merged (after Atmel have tested
it), just a couple of things that would make it easier to review:

> +static int wilc_enqueue_cmd(struct host_if_msg *msg);
> +static void host_if_work(struct work_struct *work);

A small comment on coding style: we try to avoid forward declaration for local
functions. Instead, you can reorder the code to have the callee first. This
is the order which most readers will expect, and having no forward declarations
in the code makes it more likely that there are no recursions that would
be problematic for stack overflow.

>  /*!
>   *  @author  syounan
> @@ -336,95 +276,19 @@ static int wilc_mq_destroy(struct message_queue *mq)
>   *  @notecopied from FLO glue implementatuion
>   *  @version 1.0
>   */
> -static int wilc_mq_send(struct message_queue *mq,
> -  const void *send_buf, u32 send_buf_size)
> +static int wilc_enqueue_cmd(struct host_if_msg *msg)

I think this API change can be done as a separate patch: the mq and 
send_buf_size
arguments are both constant for all callers, so you can have one patch just
removes them and renames the function, to make the patch that does the
tricky rework smaller.


> - }
> + if (msg->id == HOST_IF_MSG_CONNECT &&
> + msg->vif->hif_drv->usr_scan_req.scan_result) {
> + wilc_enqueue_cmd(msg);
> + usleep_range(2 * 1000, 2 * 1000);
> + goto end;
> + }
>  
> - switch (msg.id) {
> - case HOST_IF_MSG_SCAN:

A similar trick could apply here: we can leave the switch()
indented at the original level by putting it in an 'else'
clause. This again makes the patch shorter and easier to
review, and the optional reformatting can be done as a follow-up.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/3] staging: lowmemorykiller: select the task with maximum rss to kill

2016-06-21 Thread David Rientjes
On Tue, 21 Jun 2016, Ganesh Mahendran wrote:

> Current task selecting logic in LMK does not fully aware of the memory
> pressure. It may select the task with maximum score adj, but with
> least tasksize.
> 
> For example, if min_score_adj is 200, and there are 2 tasks in system:
>task a: score adj 500, tasksize 200M
>task b: score adj 1000, tasksize 1M
> Current LMK logic will select *task b*. But now the system already have
> much memory pressure.
> 
> We should select the task with maximum task from all the tasks which
> score adj >= min_score_adj.
> 

Unfortunately, I'm not sure that we can get away with this although I 
agree that it is a better result (kill a large process, avoid lowmem or 
oom for longer).

It changes the kill order for systems that have already fine-tuned their 
oom_score_adj settings and can regress because of this change.  If systems 
really want task b to be killed above, this breaks and they have no 
immediate way of fixing it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] [media] v4l: vsp1: Split pad operations between rpf and wpf

2016-06-21 Thread Niklas Söderlund
This is done in preparation to move s_stream from v4l2_subdev_video_ops
to v4l2_subdev_pad_ops. Only wpf implements s_stream so it will no
longer be possible to share the v4l2_subdev_pad_ops once s_stream is
moved.

Suggested-by: Laurent Pinchart 
Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/vsp1/vsp1_rpf.c  | 12 +-
 drivers/media/platform/vsp1/vsp1_rwpf.c | 40 +
 drivers/media/platform/vsp1/vsp1_rwpf.h | 20 +
 drivers/media/platform/vsp1/vsp1_wpf.c  | 12 +-
 4 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c 
b/drivers/media/platform/vsp1/vsp1_rpf.c
index 49168db..fabe8b2 100644
--- a/drivers/media/platform/vsp1/vsp1_rpf.c
+++ b/drivers/media/platform/vsp1/vsp1_rpf.c
@@ -38,8 +38,18 @@ static inline void vsp1_rpf_write(struct vsp1_rwpf *rpf,
  * V4L2 Subdevice Operations
  */
 
+const struct v4l2_subdev_pad_ops vsp1_rpf_pad_ops = {
+   .init_cfg = vsp1_entity_init_cfg,
+   .enum_mbus_code = vsp1_rwpf_enum_mbus_code,
+   .enum_frame_size = vsp1_rwpf_enum_frame_size,
+   .get_fmt = vsp1_subdev_get_pad_format,
+   .set_fmt = vsp1_rwpf_set_format,
+   .get_selection = vsp1_rwpf_get_selection,
+   .set_selection = vsp1_rwpf_set_selection,
+};
+
 static struct v4l2_subdev_ops rpf_ops = {
-   .pad= &vsp1_rwpf_pad_ops,
+   .pad= &vsp1_rpf_pad_ops,
 };
 
 /* 
-
diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.c 
b/drivers/media/platform/vsp1/vsp1_rwpf.c
index 3b6e032..ff03b9c 100644
--- a/drivers/media/platform/vsp1/vsp1_rwpf.c
+++ b/drivers/media/platform/vsp1/vsp1_rwpf.c
@@ -31,9 +31,9 @@ struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
  * V4L2 Subdevice Pad Operations
  */
 
-static int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
-   struct v4l2_subdev_pad_config *cfg,
-   struct v4l2_subdev_mbus_code_enum *code)
+int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
+struct v4l2_subdev_pad_config *cfg,
+struct v4l2_subdev_mbus_code_enum *code)
 {
static const unsigned int codes[] = {
MEDIA_BUS_FMT_ARGB_1X32,
@@ -48,9 +48,9 @@ static int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev 
*subdev,
return 0;
 }
 
-static int vsp1_rwpf_enum_frame_size(struct v4l2_subdev *subdev,
-struct v4l2_subdev_pad_config *cfg,
-struct v4l2_subdev_frame_size_enum *fse)
+int vsp1_rwpf_enum_frame_size(struct v4l2_subdev *subdev,
+ struct v4l2_subdev_pad_config *cfg,
+ struct v4l2_subdev_frame_size_enum *fse)
 {
struct vsp1_rwpf *rwpf = to_rwpf(subdev);
 
@@ -59,9 +59,9 @@ static int vsp1_rwpf_enum_frame_size(struct v4l2_subdev 
*subdev,
   rwpf->max_height);
 }
 
-static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
-   struct v4l2_subdev_pad_config *cfg,
-   struct v4l2_subdev_format *fmt)
+int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
+struct v4l2_subdev_pad_config *cfg,
+struct v4l2_subdev_format *fmt)
 {
struct vsp1_rwpf *rwpf = to_rwpf(subdev);
struct v4l2_subdev_pad_config *config;
@@ -113,9 +113,9 @@ static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
return 0;
 }
 
-static int vsp1_rwpf_get_selection(struct v4l2_subdev *subdev,
-  struct v4l2_subdev_pad_config *cfg,
-  struct v4l2_subdev_selection *sel)
+int vsp1_rwpf_get_selection(struct v4l2_subdev *subdev,
+   struct v4l2_subdev_pad_config *cfg,
+   struct v4l2_subdev_selection *sel)
 {
struct vsp1_rwpf *rwpf = to_rwpf(subdev);
struct v4l2_subdev_pad_config *config;
@@ -150,9 +150,9 @@ static int vsp1_rwpf_get_selection(struct v4l2_subdev 
*subdev,
return 0;
 }
 
-static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
-  struct v4l2_subdev_pad_config *cfg,
-  struct v4l2_subdev_selection *sel)
+int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
+   struct v4l2_subdev_pad_config *cfg,
+   struct v4l2_subdev_selection *sel)
 {
struct vsp1_rwpf *rwpf = to_rwpf(subdev);
struct v4l2_subdev_pad_config *config;
@@ -209,16 +209,6 @@ static int vsp1_rwpf_set_selection(struct v4l2_subdev 
*subdev,
return 0;
 }
 
-const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
-   .init_cfg = vsp1_entity_init_cfg,
-   .enum_mbus_code = vsp1_rwpf_enum_mbus_cod

[PATCH 0/2] move s_stream from v4l2_subdev_video_ops to move s_stream from v4l2_subdev_pad_ops

2016-06-21 Thread Niklas Söderlund
Hi all,

This series moves s_stream from struct v4l2_subdev_video_ops to struct
v4l2_subdev_pad_ops. The reason for this is that there are devices 
(adv7482 for example) which can support more then one video pipeline 
connected to two different output pads to run simultaneously. In order 
to be able to be able to start and stop streams on a pad level the 
s_stream operation needs to be extended with a pad argument.

The series is based on the master branch of the media_tree.

It have been suggested by both Laurent Pinchart and Hans Verkuil that if 
a pad aware s_stream is needed the operation should be moved from the 
video struct to the pad ops struct and not just add a s_stream to the 
pad ops struct.

The change to v4l framework is trivial and only moves s_stream between 
the two structs and adds a 'pad' argument. The majority of the changes 
is updating all users of the s_stream operation to use the one from 
v4l2_subdev_pad_ops.

Patch 1/2 is a preparation of the vsp1 driver where the 
v4l2_subdev_video_ops struct was shared by two devices which no longer 
can be shared since only one of them implements s_stream.

Patch 2/2 moves the s_stream operation between the struct and updates 
all users. The callers have primarily been updated using Coccinelle 
patch which is attached to this cover letter.

After the spatch run all changes have been manually reviewed and struct 
v4l2_subdev_pad_ops have been added to drivers which previously did not 
have one. Likewise struct v4l2_subdev_video_ops which became 'empty' 
after removing s_stream have been removed. A few drivers needed some 
code to me moved around (most notably s5k4ecgx) for ordering but nothing 
in the code itself have changed while moving it except to update calls 
to s_stream to use the pad version.

I have tested this series to the best of my ability by building 
allyesconfig configurations for arm, arm64 and x86_64. I have also 
tested on a R-Car Koelsch board (rcar-vin and adv7180).

cut
@ rule1 @
identifier fn, s;
@@

 struct v4l2_subdev_video_ops s = { .s_stream = fn, };

@@
identifier rule1.fn, rule1.s;
@@

 struct v4l2_subdev_video_ops s = {
-.s_stream = fn,
 };

@@
identifier rule1.fn, s;
@@

 struct v4l2_subdev_pad_ops s = {
+.s_stream = fn,
 };

@@
identifier rule1.fn, a, b;
symbol pad;
@@

-fn(struct v4l2_subdev *a, int b)
+fn(struct v4l2_subdev *a, unsigned int pad, int b)
 {
 ...
 }

@@
identifier rule1.fn;
expression e1, e2;
@@

-fn(e1, e2);
+fn(e1, 0, e2);

@@
expression e1, e2;
symbol video, pad, s_stream;
@@

-v4l2_subdev_call(e1, video, s_stream, e2);
+v4l2_subdev_call(e1, pad, s_stream, 0, e2);

@@
expression e1, e2, e3;
symbol video, pad, s_stream;
@@

-e3 = v4l2_subdev_call(e1, video, s_stream, e2);
+e3 = v4l2_subdev_call(e1, pad, s_stream, 0, e2);

@@
expression e1, e2;
@@

-call_all(e1, video, s_stream, e2);
+call_all(e1, pad, s_stream, 0, e2);

@@
expression e1, e2, e3;
symbol video, pad, s_stream;
@@

-ivtv_call_hw(e1, e2, video, s_stream, e3);
+ivtv_call_hw(e1, e2, pad, s_stream, 0, e3);

@@
expression e1, e2, e3, e4;
symbol video, pad, s_stream;
@@

-e1 = v4l2_device_call_until_err(e2, e3, video, s_stream, e4);
+e1 = v4l2_device_call_until_err(e2, e3, pad, s_stream, 0, e4);

@@
expression e2, e3, e4;
symbol video, pad, s_stream;
@@

-v4l2_device_call_until_err(e2, e3, video, s_stream, e4);
+v4l2_device_call_until_err(e2, e3, pad, s_stream, 0, e4);

@@
expression e1, e2, e3;
symbol video, pad, s_stream;
@@

-v4l2_device_call_all(e1, e2, video, s_stream, e3);
+v4l2_device_call_all(e1, e2, pad, s_stream, 0, e3);

@@
expression e1, e2;
symbol video, pad, s_stream;
@@

-cx25840_call(e1, video, s_stream, e2);
+cx25840_call(e1, pad, s_stream, 0, e2);
cut

Niklas Söderlund (2):
  [media] v4l: vsp1: Split pad operations between rpf and wpf
  [media] v4l: subdev: move s_stream from v4l2_subdev_video_ops to
v4l2_subdev_pad_ops

 drivers/media/dvb-frontends/au8522_decoder.c   |   9 +-
 drivers/media/i2c/ad9389b.c|   7 +-
 drivers/media/i2c/adv7180.c|   5 +-
 drivers/media/i2c/adv7183.c|   5 +-
 drivers/media/i2c/adv7511.c|   7 +-
 drivers/media/i2c/ak881x.c |   5 +-
 drivers/media/i2c/bt819.c  |   9 +-
 drivers/media/i2c/cx25840/cx25840-core.c   |   5 +-
 drivers/media/i2c/ks0127.c |   9 +-
 drivers/media/i2c/m5mols/m5mols_core.c |  19 +--
 drivers/media/i2c/mt9m032.c|   5 +-
 drivers/media/i2c/mt9p031.c|   9 +-
 drivers/media/i2c/mt9t001.c|   9 +-
 drivers/media/i2c/mt9v032.c|   9 +-
 drivers/media/i2c/noon010pc30.c|   6 +-
 drivers/media/i2c/ov2659.c |   8 +-
 drivers/media/i2c/ov9650.c |   4 +-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c   |   5 +-
 dr

2016 SPAIN EUROMILLION ONLINE AWARD

2016-06-21 Thread Maria Loronzo Garcia
Attn: Lucky Winner,   

  FINAL AWARD 
NOTIFICATIONS!!!
This is to inform you on the release of the EUROMILLONES LOTTERY PROGRAM held 
on the  16th of June  2016. Due to mix up of some numbers and emails, the 
results were released on the 17th of  June  2016.
Your email attached to ticket number 214-1781-501 with serial number 7216-05 
drew the lucky numbers of  26—37-61-79-63-45 which consequently won the lottery 
in the 3rd category.
You have therefore been approved for a lump sum payout of  Ђ2, 490.000.00  (TWO 
MILLION , FOUR HUNDRED AND NINETY THOUSAND EUROS ONLY),
 
Your fund is now on a security deposited with a bank and insured with your 
email serial number 7216-05.  Due to mix up of some numbers and emails , we ask 
that you keep this award from public notice until your claim has been processed 
and money remitted to your account as this is part of our security protocol to 
avoid double claiming or unwarranted taking advantage of this program by 
participants.
 
To begin your lottery claim, please contact  your claims agent  Dr, Pablo 
Sanchez the Foreign operations manager of  REAL SEGUROS  S. A. On Tel: 
+34-603-255-976, Email : realsegu...@mail.com, For the processing and 
remittance of your winning prize money to a designation of your choice.
 
Remember, all price money must be claimed not later than,  30th  of  July, 
2016. After this date all funds will be returned to the MINISTERIO DE ECONOMIA 
Y HACIENDA  as unclaimed. And also be informed that 5 % of your Lottery Winning 
belongs to REAL  SEGUROS  S. A. Because they are your claims agent. This 5 % 
will be remitted after you have received your winnings because the money is 
insured.  Your claims agent requires  your details mentioned below to precesse 
your winning
 
Name __Address   ___
 
Date of Birth ___ Occupation __
 
Telephone Nє  __ Email serial Nє __
 
 
Congratulation once again.
 
Thank you.
Madam, Julia Gomez
Responder
AVE, DE SANFRANCISCO, 20 E-28830,
MADRID, SPAIN
Tel: +34-698-238-766
Fax +34-911-881-416
Email : spaineuromill...@gmail.com
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/3] staging: lowmemorykiller: change lowmem_adj to lowmem_score_adj

2016-06-21 Thread Ganesh Mahendran
Hi, David:

On Tue, Jun 21, 2016 at 01:27:40PM -0700, David Rientjes wrote:
> On Tue, 21 Jun 2016, Ganesh Mahendran wrote:
> 
> > om_adj is deprecated, and in lowmemorykiller module, we use score adj
> > to do the comparing.
> > ---
> > oom_score_adj = p->signal->oom_score_adj;
> > if (oom_score_adj < min_score_adj) {
> > task_unlock(p);
> > continue;
> > }
> > ---
> > 
> > This patch makes the variable name consistent with the usage.
> > 
> 
> Umm, I don't think you can just remove a parameter to a module and replace 
> it with something that has a different unit and not think that userspace 
> will break as a result.

You are right, this change will break android AMS which will set the LMK
watermark via /sys/module/lowmemorykiller/parameters/adj.

Please help to review below change. Only make the varialbe name consistent
with the variable usage.

--
>From 394872fc1993a04ae471b10d7f971d4544812ec4 Mon Sep 17 00:00:00 2001
From: Ganesh Mahendran 
Date: Wed, 22 Jun 2016 10:53:13 +0800
Subject: [PATCH v2] staging: lowmemorykiller: make variable name consistent with
 the varialbe usage

LMK use oom_score_adj to do the comparing. But the variable name is
*_adj. This patch makes thevarialbe name consistent with the varialb
usage to avoid ambiguity.

*_adj -> *_score_adj

Signed-off-by: Ganesh Mahendran 
---
v2:
  do not change user API - David
---
 drivers/staging/android/lowmemorykiller.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
index 24d2745..6568bbf 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -44,14 +44,15 @@
 #include 
 
 static u32 lowmem_debug_level = 1;
-static short lowmem_adj[6] = {
+
+static short lowmem_score_adj[6] = {
0,
-   1,
-   6,
-   12,
+   58,
+   352,
+   705,
 };
 
-static int lowmem_adj_size = 4;
+static int lowmem_score_adj_size = 4;
 static int lowmem_minfree[6] = {
3 * 512,/* 6MB */
2 * 1024,   /* 8MB */
@@ -89,20 +90,20 @@ static unsigned long lowmem_scan(struct shrinker *s, struct 
shrink_control *sc)
int minfree = 0;
int selected_tasksize = 0;
short selected_oom_score_adj;
-   int array_size = ARRAY_SIZE(lowmem_adj);
+   int array_size = ARRAY_SIZE(lowmem_score_adj);
int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
int other_file = global_page_state(NR_FILE_PAGES) -
global_page_state(NR_SHMEM) -
total_swapcache_pages();
 
-   if (lowmem_adj_size < array_size)
-   array_size = lowmem_adj_size;
+   if (lowmem_score_adj_size < array_size)
+   array_size = lowmem_score_adj_size;
if (lowmem_minfree_size < array_size)
array_size = lowmem_minfree_size;
for (i = 0; i < array_size; i++) {
minfree = lowmem_minfree[i];
if (other_free < minfree && other_file < minfree) {
-   min_score_adj = lowmem_adj[i];
+   min_score_adj = lowmem_score_adj[i];
break;
}
}
@@ -165,7 +166,7 @@ static unsigned long lowmem_scan(struct shrinker *s, struct 
shrink_control *sc)
if (selected->mm)
task_set_lmk_waiting(selected);
task_unlock(selected);
-   lowmem_print(1, "Killing '%s' (%d), adj %hd,\n"
+   lowmem_print(1, "Killing '%s' (%d), score adj %hd,\n"
 "   to free %ldkB on behalf of '%s' (%d) 
because\n"
 "   cache %ldkB is below limit %ldkB for 
oom_score_adj %hd\n"
 "   Free memory is %ldkB above reserved\n",
@@ -205,7 +206,7 @@ device_initcall(lowmem_init);
  * bootargs behaviour is to continue using module_param here.
  */
 module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
-module_param_array_named(adj, lowmem_adj, short, &lowmem_adj_size,
+module_param_array_named(adj, lowmem_score_adj, short, &lowmem_score_adj_size,
 S_IRUGO | S_IWUSR);
 module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
 S_IRUGO | S_IWUSR);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] staging: lowmemorykiller: count anon pages only when we have swap devices

2016-06-21 Thread Ganesh Mahendran
Hi, David:

On Tue, Jun 21, 2016 at 01:22:00PM -0700, David Rientjes wrote:
> On Tue, 21 Jun 2016, Ganesh Mahendran wrote:
> 
> > lowmem_count() should only count anon pages when we have swap device.
> > 
> 
> Why?

I make a mistake. I thought lowmem_count will return the shrinkalbe page
of a process.

> 
> > Signed-off-by: Ganesh Mahendran 
> > ---
> >  drivers/staging/android/lowmemorykiller.c | 12 
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/staging/android/lowmemorykiller.c 
> > b/drivers/staging/android/lowmemorykiller.c
> > index 6da9260..1d8de47 100644
> > --- a/drivers/staging/android/lowmemorykiller.c
> > +++ b/drivers/staging/android/lowmemorykiller.c
> > @@ -73,10 +73,14 @@ static unsigned long lowmem_deathpending_timeout;
> >  static unsigned long lowmem_count(struct shrinker *s,
> >   struct shrink_control *sc)
> >  {
> > -   return global_page_state(NR_ACTIVE_ANON) +
> > -   global_page_state(NR_ACTIVE_FILE) +
> > -   global_page_state(NR_INACTIVE_ANON) +
> > -   global_page_state(NR_INACTIVE_FILE);
> > +   unsigned long freeable = global_page_state(NR_ACTIVE_FILE) +
> > +   global_page_state(NR_INACTIVE_FILE);
> > +
> > +   if (get_nr_swap_pages() > 0)
> > +   freeable += global_page_state(NR_ACTIVE_ANON) +
> > +   global_page_state(NR_INACTIVE_ANON);
> > +
> > +   return freeable;
> >  }
> >  
> >  static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control 
> > *sc)
> 
> Shouldn't this be advertising the amount of memory that is freeable by 
> killing the process with the highest priority oom_score_adj?  It's not 
> legitimate to say it can free all anon and file memory if nothing is oom 
> killable, so this function is wrong both originally and with your patched 
> version.

Yes, so should we just simply return 1 to make do_shrink_slab() go ahead?
Then lowmem_scan() will do the real job to scan all the process.

Thanks.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/3] staging: lowmemorykiller: select the task with maximum rss to kill

2016-06-21 Thread Ganesh Mahendran
Hi, David:

On Tue, Jun 21, 2016 at 01:14:36PM -0700, David Rientjes wrote:
> On Tue, 21 Jun 2016, Ganesh Mahendran wrote:
> 
> > Current task selecting logic in LMK does not fully aware of the memory
> > pressure. It may select the task with maximum score adj, but with
> > least tasksize.
> > 
> > For example, if min_score_adj is 200, and there are 2 tasks in system:
> >task a: score adj 500, tasksize 200M
> >task b: score adj 1000, tasksize 1M
> > Current LMK logic will select *task b*. But now the system already have
> > much memory pressure.
> > 
> > We should select the task with maximum task from all the tasks which
> > score adj >= min_score_adj.
> > 
> 
> Unfortunately, I'm not sure that we can get away with this although I 
> agree that it is a better result (kill a large process, avoid lowmem or 
> oom for longer).

Yes, from our testing with this patch applied, system works more smoothly,
and user have better experience.

> 
> It changes the kill order for systems that have already fine-tuned their 
> oom_score_adj settings and can regress because of this change.  If systems 
> really want task b to be killed above, this breaks and they have no 
> immediate way of fixing it.

I think the processes with score_adj >= min_score_adj are all acceptable
if we kill them. In android products, LMK does the main job to free memory
when system is hard to shrink file/anon pages. If LMK does not free enough 
memory,
the system will be very slow before OOM is triggered. During this period, user 
will
have bad experience.

So LMK need to work effectivly to let system running smoothly, as user 
experience
is very important for android system.

Thanks.



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel