Re: [PATCH 03/33] staging: vc04_services: Remove REMOTE_EVENT_T typedef

2018-12-12 Thread Dan Carpenter
On Tue, Dec 11, 2018 at 07:31:00PM +0100, Dominic Braun wrote:
> Typedefing structs is not encouraged in the kernel.
> 
> The removal of typedefs was requested in interface/vchi/TODO in commit
> 7626e002225a4c1b9455689b1f22909dfeff43ca.

When you mention a commit then use this format:

"requested in interface/vchi/TODO in commit 7626e002225a ("staging:
vchiq: add more tasks to the TODO list")"

But really the sentence doesn't add anything.  Removing typedefs is
a kernel wide thing, not a driver specific requirement.

> 
> Signed-off-by: Dominic Braun 
> Signed-off-by: Tobias Büttner 
> ---
>  .../interface/vchiq_arm/vchiq_2835_arm.c   |  2 +-
>  .../vc04_services/interface/vchiq_arm/vchiq_core.c |  9 +
>  .../vc04_services/interface/vchiq_arm/vchiq_core.h | 14 +++---
>  3 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git 
> a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 
> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> index 5601d167ac60..76e87cda130c 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> @@ -234,7 +234,7 @@ vchiq_platform_get_arm_state(VCHIQ_STATE_T *state)
>  }
>  
>  void
> -remote_event_signal(REMOTE_EVENT_T *event)
> +remote_event_signal(struct remote_event_struct *event)
  ^^^

The struct on the end of this name is redundant.  Maybe name it
something based on what type of remote event it is like
vc04_remote_event?  I don't know.  To me just remote_event is fine also.

regards,
dan carpenter



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


Re: [PATCH 02/11] staging: iio: adt7316: invert the logic of the check for an ldac pin

2018-12-12 Thread Dan Carpenter
On Tue, Dec 11, 2018 at 05:54:54PM -0700, Jeremy Fertic wrote:
> ADT7316_DA_EN_VIA_DAC_LDCA is set when the dac and ldac registers are being
> used to update the dacs instead of the ldac pin. ADT7516_SEL_AIN3 is an adc
> input that shares the ldac pin. Only set these bits if an ldac pin is not
> being used.
> 
> Signed-off-by: Jeremy Fertic 

Huh...  This bug has always been there...

Fixes: 35f6b6b86ede ("staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver")

regards,
dan carpenter


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


Re: [PATCH 04/11] staging: iio: adt7316: fix handling of dac high resolution option

2018-12-12 Thread Dan Carpenter
On Tue, Dec 11, 2018 at 05:54:56PM -0700, Jeremy Fertic wrote:
> @@ -651,10 +649,12 @@ static ssize_t adt7316_store_da_high_resolution(struct 
> device *dev,
>   u8 config3;
>   int ret;
>  
> + if (chip->id == ID_ADT7318 || chip->id == ID_ADT7519)
> + return -EPERM;

return -EINVAL is more appropriate than -EPERM.

regards,
dan carpenter

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


Re: [PATCH 10/11] staging: iio: adt7316: change interpretation of write to dac update mode

2018-12-12 Thread Dan Carpenter
On Tue, Dec 11, 2018 at 05:55:02PM -0700, Jeremy Fertic wrote:
> Based on the output of adt7316_show_all_DAC_update_modes() and
> adt7316_show_DAC_update_mode(), adt7316_store_DAC_update_mode() should
> expect the user to enter an integer input from 0 to 3. The user input is
> currently expected to account for the actual bit positions in the register.
> For example, choosing option 3 would require a write of 0x30 (actually 48
> since it expects base 10). To address this inconsistency, create a shift
> macro to be used in the valid input check as well as the calculation for
> the register write.
> 
> Signed-off-by: Jeremy Fertic 
> ---
> I'm not sure if this patch is appropriate since it's making a user visible
> change. I've included it since the driver is still in staging.

We don't want to break user space, but I agree with you that applying
this patch is probably the right thing.

regards,
dan carpenter


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


Re: [PATCH 01/33] staging: vc04_services: Remove DUMP_CONTEXT_T typedef

2018-12-12 Thread Greg Kroah-Hartman
On Tue, Dec 11, 2018 at 07:30:58PM +0100, Dominic Braun wrote:
> Typedefing structs is not encouraged in the kernel.
> 
> The removal of typedefs was requested in interface/vchi/TODO in commit
> 7626e002225a4c1b9455689b1f22909dfeff43ca.
> 
> Signed-off-by: Dominic Braun 
> Signed-off-by: Tobias Büttner 
> ---
>  .../vc04_services/interface/vchiq_arm/vchiq_arm.c| 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c 
> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index f28f681192dd..7f670852102d 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -153,12 +153,12 @@ struct vchiq_instance_struct {
>   VCHIQ_DEBUGFS_NODE_T debugfs_node;
>  };
>  
> -typedef struct dump_context_struct {
> +struct dump_context_struct {

Like Dan pointed out, don't name your structs "struct foo_struct" that's
just wasted text.  It should just be "struct foo".

thanks,

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


[bug report] staging: wilc1000: handle scan operation callback from cfg80211 context

2018-12-12 Thread Dan Carpenter
Hello Ajay Singh,

The patch 8f1a0ac1eba7: "staging: wilc1000: handle scan operation
callback from cfg80211 context" from Dec 2, 2018, leads to the
following static checker warning:

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:562 scan()
error: NULL dereference inside function 'wilc_scan()'

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
   541  if (request->n_channels <= MAX_NUM_SCANNED_NETWORKS) {
   542  for (i = 0; i < request->n_channels; i++) {
   543  u16 freq = request->channels[i]->center_freq;
   544  
   545  scan_ch_list[i] = 
ieee80211_frequency_to_channel(freq);
   546  }
   547  
   548  if (request->n_ssids >= 1) {
   549  if (wilc_wfi_cfg_alloc_fill_ssid(request,
   550   &hidden_ntwk)) 
{
   551  ret = -ENOMEM;
   552  goto out;
   553  }
   554  
   555  ret = wilc_scan(vif, WILC_FW_USER_SCAN,
   556  WILC_FW_ACTIVE_SCAN, 
scan_ch_list,
   557  request->n_channels,
   558  (const u8 *)request->ie,
   559  request->ie_len, 
cfg_scan_result,
   560  (void *)priv, &hidden_ntwk);
   561  } else {
   562  ret = wilc_scan(vif, WILC_FW_USER_SCAN,
   563  WILC_FW_ACTIVE_SCAN, 
scan_ch_list,
   564  request->n_channels,
   565  (const u8 *)request->ie,
   566  request->ie_len, 
cfg_scan_result,
   567  (void *)priv, NULL);
  
The old code used to have a check for NULL.

   568  }
   569  } else {
   570  netdev_err(priv->dev, "Requested scanned channels 
over\n");
   571  }

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


Re: [PATCH] staging: mt7621-pci: Fix checkpatch errors

2018-12-12 Thread Greg KH
On Mon, Dec 10, 2018 at 03:23:06PM +0800, yuhui zhang wrote:
> This patch fixes the following checkpatch.pl errors in the
> drivers/staging/mt7621-pci:
> ERROR: space required after that ')'.
> ERROR: space required after that '='.
> 
> Signed-off-by: zhangyuhui 
> ---
>  drivers/staging/mt7621-pci/pci-mt7621.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

You sent this same patch 4 times.  Or at least I think it is the same
patch, I really do not know...

Please resend, properly, to the correct mailing lists and people, this
patch only one time.

Also, you need to fix up your from: and signed-off-by lines to match up.

thanks,

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


Re: [PATCH] staging: convert to DEFINE_SHOW_ATTRIBUTE

2018-12-12 Thread Greg KH
On Sun, Dec 09, 2018 at 11:27:42AM -0500, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Yangtao Li 
> ---
>  drivers/staging/fwserial/fwserial.c   | 32 +++
>  drivers/staging/greybus/loopback.c| 16 ++
>  drivers/staging/rtlwifi/debug.c   | 23 -
>  .../staging/unisys/visorhba/visorhba_main.c   | 14 +---
>  .../interface/vchiq_arm/vchiq_debugfs.c   | 14 +---
>  5 files changed, 14 insertions(+), 85 deletions(-)


Please break this up into one-patch-per-driver, so that the correct
people can properly review it, and you don't send patches out to people
who have no interested in other drivers.

thanks,

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


Re: [PATCH 10/11] staging: iio: adt7316: change interpretation of write to dac update mode

2018-12-12 Thread Jonathan Cameron



On 12 December 2018 08:31:32 GMT, Dan Carpenter  
wrote:
>On Tue, Dec 11, 2018 at 05:55:02PM -0700, Jeremy Fertic wrote:
>> Based on the output of adt7316_show_all_DAC_update_modes() and
>> adt7316_show_DAC_update_mode(), adt7316_store_DAC_update_mode()
>should
>> expect the user to enter an integer input from 0 to 3. The user input
>is
>> currently expected to account for the actual bit positions in the
>register.
>> For example, choosing option 3 would require a write of 0x30
>(actually 48
>> since it expects base 10). To address this inconsistency, create a
>shift
>> macro to be used in the valid input check as well as the calculation
>for
>> the register write.
>> 
>> Signed-off-by: Jeremy Fertic 
>> ---
>> I'm not sure if this patch is appropriate since it's making a user
>visible
>> change. I've included it since the driver is still in staging.
>
>We don't want to break user space, but I agree with you that applying
>this patch is probably the right thing.
>
>regards,
>dan carpenter

This driver breaks the standard abi in loads of ways. It is going to change 
userspace interface
 a lot before it is ready to move out of staging. That includes this particular 
interface almost
 certainly being completely replaced.  Hence good to move towards something 
sensible.  Don't worry at all
 about userapace ABI breaks in this one!

Jonathan

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: erofs: remove __EROFS_BIT

2018-12-12 Thread Chao Yu
On 2018-12-12 1:57, Gao Xiang wrote:
> It's better to use pre-calculated values to make
> on-disk definition more straight-forward and human-readable.
> 
> Since there is the only one user, let's remove
> __EROFS_BIT entirely.
> 
> Suggested-by: Joe Perches 
> Signed-off-by: Gao Xiang 

It looks this patch has been merged, anyway

Reviewed-by: Chao Yu 

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


Re: [PATCH] staging: erofs: remove __EROFS_BIT

2018-12-12 Thread Gao Xiang
Hi Chao,

On 2018/12/12 19:22, Chao Yu wrote:
> On 2018-12-12 1:57, Gao Xiang wrote:
>> It's better to use pre-calculated values to make
>> on-disk definition more straight-forward and human-readable.
>>
>> Since there is the only one user, let's remove
>> __EROFS_BIT entirely.
>>
>> Suggested-by: Joe Perches 
>> Signed-off-by: Gao Xiang 
> It looks this patch has been merged, anyway
> 
> Reviewed-by: Chao Yu 
> 
> Thanks,

Thanks for kindly review :)
Yesterday Joe Perches made a suggestion and then I sent a patch to fix that...

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


[PATCH v2] staging:erofs: Fix alignment issues

2018-12-12 Thread Aaron Strahlberger
Fix of `CHECK: Alignment should match open parenthesis` issues, reported by
checkpatch.pl

Signed-off-by: Aaron Strahlberger 
Signed-off-by: Julius Wiedmann 
Signed-off-by: Dominik Huber 
---
 drivers/staging/erofs/dir.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
index e44ca93dcdc6..e1955703ab8f 100644
--- a/drivers/staging/erofs/dir.c
+++ b/drivers/staging/erofs/dir.c
@@ -24,8 +24,8 @@ static const unsigned char erofs_filetype_table[EROFS_FT_MAX] 
= {
 };
 
 static int erofs_fill_dentries(struct dir_context *ctx,
-   void *dentry_blk, unsigned int *ofs,
-   unsigned int nameoff, unsigned int maxsize)
+  void *dentry_blk, unsigned int *ofs,
+  unsigned int nameoff, unsigned int maxsize)
 {
struct erofs_dirent *de = dentry_blk;
const struct erofs_dirent *end = dentry_blk + nameoff;
@@ -69,8 +69,8 @@ static int erofs_fill_dentries(struct dir_context *ctx,
 #endif
 
if (!dir_emit(ctx, de_name, de_namelen,
-   le64_to_cpu(de->nid), d_type))
-   /* stoped by some reason */
+ le64_to_cpu(de->nid), d_type))
+   /* stopped by some reason */
return 1;
++de;
*ofs += sizeof(struct erofs_dirent);
@@ -104,9 +104,9 @@ static int erofs_readdir(struct file *f, struct dir_context 
*ctx)
nameoff = le16_to_cpu(de->nameoff);
 
if (unlikely(nameoff < sizeof(struct erofs_dirent) ||
-   nameoff >= PAGE_SIZE)) {
+nameoff >= PAGE_SIZE)) {
errln("%s, invalid de[0].nameoff %u",
-   __func__, nameoff);
+ __func__, nameoff);
 
err = -EIO;
goto skip_this;
-- 
2.19.2

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


[PATCH v2] staging:erofs: Remove __EROFS_BIT macro

2018-12-12 Thread Aaron Strahlberger
The `__EROFS_BIT` macro is used only once, do define the
`EROFS_I_DATA_MAPPING_BIT` constant. This Patch removes this
macro and expands it in the place it is used.

Signed-off-by: Aaron Strahlberger 
Signed-off-by: Julius Wiedmann 
Signed-off-by: Dominik Huber 
---
 drivers/staging/erofs/erofs_fs.h | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/erofs/erofs_fs.h b/drivers/staging/erofs/erofs_fs.h
index d4bffa2852b3..da5562df847b 100644
--- a/drivers/staging/erofs/erofs_fs.h
+++ b/drivers/staging/erofs/erofs_fs.h
@@ -38,10 +38,6 @@ struct erofs_super_block {
 /* 80 */__u8 reserved2[48]; /* 128 bytes */
 } __packed;
 
-#define __EROFS_BIT(_prefix, _cur, _pre)   enum {  \
-   _prefix ## _cur ## _BIT = _prefix ## _pre ## _BIT + \
-   _prefix ## _pre ## _BITS }
-
 /*
  * erofs inode data mapping:
  * 0 - inode plain without inline data A:
@@ -58,11 +54,14 @@ enum {
EROFS_INODE_LAYOUT_INLINE,
EROFS_INODE_LAYOUT_MAX
 };
+
 #define EROFS_I_VERSION_BITS1
 #define EROFS_I_DATA_MAPPING_BITS   3
 
 #define EROFS_I_VERSION_BIT 0
-__EROFS_BIT(EROFS_I_, DATA_MAPPING, VERSION);
+enum {
+   EROFS_I_DATA_MAPPING_BIT = EROFS_I_VERSION_BIT + EROFS_I_VERSION_BITS
+}
 
 struct erofs_inode_v1 {
 /*  0 */__le16 i_advise;
-- 
2.19.2

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


Re: [PATCH v2] staging:erofs: Fix alignment issues

2018-12-12 Thread Gao Xiang
Hi Aaron,

On 2018/12/12 20:00, Aaron Strahlberger wrote:
> Fix of `CHECK: Alignment should match open parenthesis` issues, reported by
> checkpatch.pl
> 
> Signed-off-by: Aaron Strahlberger 
> Signed-off-by: Julius Wiedmann 
> Signed-off-by: Dominik Huber 
> ---
>  drivers/staging/erofs/dir.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
> index e44ca93dcdc6..e1955703ab8f 100644
> --- a/drivers/staging/erofs/dir.c
> +++ b/drivers/staging/erofs/dir.c
> @@ -24,8 +24,8 @@ static const unsigned char 
> erofs_filetype_table[EROFS_FT_MAX] = {
>  };
>  
>  static int erofs_fill_dentries(struct dir_context *ctx,
> - void *dentry_blk, unsigned int *ofs,
> - unsigned int nameoff, unsigned int maxsize)
> +void *dentry_blk, unsigned int *ofs,
> +unsigned int nameoff, unsigned int maxsize)
>  {
>   struct erofs_dirent *de = dentry_blk;
>   const struct erofs_dirent *end = dentry_blk + nameoff;
> @@ -69,8 +69,8 @@ static int erofs_fill_dentries(struct dir_context *ctx,
>  #endif
>  
>   if (!dir_emit(ctx, de_name, de_namelen,
> - le64_to_cpu(de->nid), d_type))
> - /* stoped by some reason */
> +   le64_to_cpu(de->nid), d_type))
> + /* stopped by some reason */

It seems Greg has merged part of your previous patch,
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/erofs?h=staging-testing&id=019ec6c14fbdfaeb361c84f68158fb9097f41004

Anyway, I can locally apply it by 3-way merge, and it looks good to me apart 
from that

Reviewed-by: Gao Xiang 

Thanks,
Gao Xiang

>   return 1;
>   ++de;
>   *ofs += sizeof(struct erofs_dirent);
> @@ -104,9 +104,9 @@ static int erofs_readdir(struct file *f, struct 
> dir_context *ctx)
>   nameoff = le16_to_cpu(de->nameoff);
>  
>   if (unlikely(nameoff < sizeof(struct erofs_dirent) ||
> - nameoff >= PAGE_SIZE)) {
> +  nameoff >= PAGE_SIZE)) {
>   errln("%s, invalid de[0].nameoff %u",
> - __func__, nameoff);
> +   __func__, nameoff);
>  
>   err = -EIO;
>   goto skip_this;
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] staging: most: Documentation: add information to driver_usage file

2018-12-12 Thread Christian Gromm
This patch updates driver_usage.txt file to reflect the latest changes
that this patch set introduces.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/Documentation/driver_usage.txt | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/most/Documentation/driver_usage.txt 
b/drivers/staging/most/Documentation/driver_usage.txt
index bb9b4e8..da7a8f4 100644
--- a/drivers/staging/most/Documentation/driver_usage.txt
+++ b/drivers/staging/most/Documentation/driver_usage.txt
@@ -142,8 +142,9 @@ Cdev component example:
 
 Sound component example:
 
-The sound component needs an additional parameter to determine the audio
-resolution that is going to be used. The following formats are available:
+The sound component needs additional parameters to determine the audio
+resolution that is going to be used and to trigger the registration of a
+sound card with ALSA. The following audio formats are available:
 
- "1x8" (Mono)
- "2x16" (16-bit stereo)
@@ -151,9 +152,18 @@ resolution that is going to be used. The following formats 
are available:
- "2x32" (32-bit stereo)
- "6x16" (16-bit surround 5.1)
 
-$ echo "mdev0:ep_81:sound:most51_playback.6x16" >$(DRV_DIR)/add_link
+To make the sound module create a sound card and register it with ALSA the
+string "create" needs to be attached to the module parameter section of the
+configuration string. To create a sound card with with two playback devices
+(linked to channel ep01 and ep02) and one capture device (linked to channel
+ep83) the following is written to the add_link file:
 
+$ echo "mdev0:ep01:sound:most51_playback.6x16" >$(DRV_DIR)/add_link
+$ echo "mdev0:ep02:sound:most_playback.2x16" >$(DRV_DIR)/add_link
+$ echo "mdev0:ep83:sound:most_capture.2x16.create" >$(DRV_DIR)/add_link
 
+The link names (most51_playback, most_playback and most_capture) will
+become the names of the PCM devices of the sound card.
 
Section 2.3 USB Padding
 
-- 
2.7.4

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


[PATCH 2/6] staging: most: sound: correct label name

2018-12-12 Thread Christian Gromm
This patch fixes the lable name that is used to jump to error
handling section of function audio_probe_channel() in case
something went wrong.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/sound/sound.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/most/sound/sound.c 
b/drivers/staging/most/sound/sound.c
index 41bcd2c..6db726b 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -649,7 +649,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
}
channel = kzalloc(sizeof(*channel), GFP_KERNEL);
if (!channel)
-   goto err_free_card;
+   goto err_free_adpt;
channel->card = adpt->card;
channel->cfg = cfg;
channel->iface = iface;
@@ -661,13 +661,13 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
ret = audio_set_hw_params(&channel->pcm_hardware, ch_num, sample_res,
  cfg);
if (ret)
-   goto err_free_card;
+   goto err_free_adpt;
 
ret = snd_pcm_new(adpt->card, card_name, adpt->pcm_dev_idx,
  playback_count, capture_count, &pcm);
 
if (ret < 0)
-   goto err_free_card;
+   goto err_free_adpt;
 
pcm->private_data = channel;
 
@@ -676,12 +676,12 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
if (create) {
ret = snd_card_register(adpt->card);
if (ret < 0)
-   goto err_free_card;
+   goto err_free_adpt;
adpt->registered = true;
}
return 0;
 
-err_free_card:
+err_free_adpt:
release_adapter(adpt);
return ret;
 }
-- 
2.7.4

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


[PATCH 4/6] staging: most: sound: use static name for ALSA card

2018-12-12 Thread Christian Gromm
This patch uses a static name for the sound card's short name and
long name. Having the card names configurable doesn't make sense
anymore, as the card represents the same physical hardware.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/sound/sound.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/sound/sound.c 
b/drivers/staging/most/sound/sound.c
index 988cc55..bdf870f 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -622,14 +622,14 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
adpt->pcm_dev_idx = 0;
INIT_LIST_HEAD(&adpt->dev_list);
iface->priv = adpt;
-   ret = snd_card_new(&iface->dev, -1, device_name, THIS_MODULE,
+   ret = snd_card_new(&iface->dev, -1, "INIC", THIS_MODULE,
   sizeof(*channel), &adpt->card);
if (ret < 0)
return ret;
snprintf(adpt->card->driver, sizeof(adpt->card->driver),
 "%s", DRIVER_NAME);
snprintf(adpt->card->shortname, sizeof(adpt->card->shortname),
-"Microchip MOST:%d", adpt->card->number);
+"Microchip INIC");
snprintf(adpt->card->longname, sizeof(adpt->card->longname),
 "%s at %s, ch %d", adpt->card->shortname, iface->description,
 channel_id);
-- 
2.7.4

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


[PATCH 3/6] staging: most: sound: rename variable

2018-12-12 Thread Christian Gromm
Since the channels of a MOST device are now being represented as
individual PCM devices of one sound card, the variable card_name is not
suitable anymore to describe them. Therefore, this patch renames the
variable to device_name.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/sound/sound.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/most/sound/sound.c 
b/drivers/staging/most/sound/sound.c
index 6db726b..988cc55 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -471,14 +471,14 @@ static const struct snd_pcm_ops pcm_ops = {
.page   = snd_pcm_lib_get_vmalloc_page,
 };
 
-static int split_arg_list(char *buf, char **card_name, u16 *ch_num,
+static int split_arg_list(char *buf, char **device_name, u16 *ch_num,
  char **sample_res, u8 *create)
 {
char *num;
int ret;
 
-   *card_name = strsep(&buf, ".");
-   if (!*card_name) {
+   *device_name = strsep(&buf, ".");
+   if (!*device_name) {
pr_err("Missing sound card name\n");
return -EIO;
}
@@ -587,7 +587,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
int capture_count = 0;
int ret;
int direction;
-   char *card_name;
+   char *device_name;
u16 ch_num;
u8 create = 0;
char *sample_res;
@@ -600,7 +600,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
return -EINVAL;
}
 
-   ret = split_arg_list(arg_list, &card_name, &ch_num, &sample_res,
+   ret = split_arg_list(arg_list, &device_name, &ch_num, &sample_res,
 &create);
if (ret < 0)
return ret;
@@ -622,7 +622,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
adpt->pcm_dev_idx = 0;
INIT_LIST_HEAD(&adpt->dev_list);
iface->priv = adpt;
-   ret = snd_card_new(&iface->dev, -1, card_name, THIS_MODULE,
+   ret = snd_card_new(&iface->dev, -1, device_name, THIS_MODULE,
   sizeof(*channel), &adpt->card);
if (ret < 0)
return ret;
@@ -663,14 +663,14 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
if (ret)
goto err_free_adpt;
 
-   ret = snd_pcm_new(adpt->card, card_name, adpt->pcm_dev_idx,
+   ret = snd_pcm_new(adpt->card, device_name, adpt->pcm_dev_idx,
  playback_count, capture_count, &pcm);
 
if (ret < 0)
goto err_free_adpt;
 
pcm->private_data = channel;
-
+   snprintf(pcm->name, sizeof(device_name), device_name);
snd_pcm_set_ops(pcm, direction, &pcm_ops);
 
if (create) {
-- 
2.7.4

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


[PATCH 5/6] staging: most: sound: remove channel number from ALSA card's long name

2018-12-12 Thread Christian Gromm
Adding the channel number to the name of the sound card is wrong,
as the card does not represent a single streaming channel of the
MOST device.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/sound/sound.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/most/sound/sound.c 
b/drivers/staging/most/sound/sound.c
index bdf870f..fbfdbc1 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -631,8 +631,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
snprintf(adpt->card->shortname, sizeof(adpt->card->shortname),
 "Microchip INIC");
snprintf(adpt->card->longname, sizeof(adpt->card->longname),
-"%s at %s, ch %d", adpt->card->shortname, iface->description,
-channel_id);
+"%s at %s", adpt->card->shortname, iface->description);
 skip_adpt_alloc:
if (get_channel(iface, channel_id)) {
pr_err("channel (%s:%d) is already linked\n",
-- 
2.7.4

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


[PATCH 0/6] staging: most: sound: change sound card layout

2018-12-12 Thread Christian Gromm
Currently, for every synchronous channel allocated on MOST an extra sound
card is being created and registered with ALSA. From a logical point of
view this fails to reflect the actual condition, as all channels originate
in the same physical device. This patch series introduces a way to map this
layout and creates only one sound card per registered MOST device that has
multiple PCM devices to access the individual MOST channels. 

Christian Gromm (6):
  staging: most: sound: create one sound card w/ multiple PCM devices
per MOST device
  staging: most: sound: correct label name
  staging: most: sound: rename variable
  staging: most: sound: use static name for ALSA card
  staging: most: sound: remove channel number from ALSA card's long name
  staging: most: Documentation: add information to driver_usage file

 .../staging/most/Documentation/driver_usage.txt|  16 ++-
 drivers/staging/most/sound/sound.c | 142 ++---
 2 files changed, 107 insertions(+), 51 deletions(-)

-- 
2.7.4

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


[PATCH 1/6] staging: most: sound: create one sound card w/ multiple PCM devices per MOST device

2018-12-12 Thread Christian Gromm
This patch avoids that a sound card is created and registered with ALSA
every time a channel is being linked. Instead the channels are hooked on
the same card, which is registered not until the final link has been added
to the component.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/sound/sound.c | 127 +
 1 file changed, 87 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/most/sound/sound.c 
b/drivers/staging/most/sound/sound.c
index 89b02fc..41bcd2c 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -20,7 +21,6 @@
 
 #define DRIVER_NAME "sound"
 
-static struct list_head dev_list;
 static struct core_component comp;
 
 /**
@@ -56,6 +56,17 @@ struct channel {
void (*copy_fn)(void *alsa, void *most, unsigned int bytes);
 };
 
+struct sound_adapter {
+   struct list_head dev_list;
+   struct most_interface *iface;
+   struct snd_card *card;
+   struct list_head list;
+   bool registered;
+   int pcm_dev_idx;
+};
+
+static struct list_head adpt_list;
+
 #define MOST_PCM_INFO (SNDRV_PCM_INFO_MMAP | \
   SNDRV_PCM_INFO_MMAP_VALID | \
   SNDRV_PCM_INFO_BATCH | \
@@ -157,9 +168,10 @@ static void most_to_alsa_copy32(void *alsa, void *most, 
unsigned int bytes)
 static struct channel *get_channel(struct most_interface *iface,
   int channel_id)
 {
+   struct sound_adapter *adpt = iface->priv;
struct channel *channel, *tmp;
 
-   list_for_each_entry_safe(channel, tmp, &dev_list, list) {
+   list_for_each_entry_safe(channel, tmp, &adpt->dev_list, list) {
if ((channel->iface == iface) && (channel->id == channel_id))
return channel;
}
@@ -460,7 +472,7 @@ static const struct snd_pcm_ops pcm_ops = {
 };
 
 static int split_arg_list(char *buf, char **card_name, u16 *ch_num,
- char **sample_res)
+ char **sample_res, u8 *create)
 {
char *num;
int ret;
@@ -479,6 +491,9 @@ static int split_arg_list(char *buf, char **card_name, u16 
*ch_num,
*sample_res = strsep(&buf, ".\n");
if (!*sample_res)
goto err;
+
+   if (buf && !strcmp(buf, "create"))
+   *create = 1;
return 0;
 
 err:
@@ -536,6 +551,19 @@ static int audio_set_hw_params(struct snd_pcm_hardware 
*pcm_hw,
return 0;
 }
 
+static void release_adapter(struct sound_adapter *adpt)
+{
+   struct channel *channel, *tmp;
+
+   list_for_each_entry_safe(channel, tmp, &adpt->dev_list, list) {
+   list_del(&channel->list);
+   kfree(channel);
+   }
+   snd_card_free(adpt->card);
+   list_del(&adpt->list);
+   kfree(adpt);
+}
+
 /**
  * audio_probe_channel - probe function of the driver module
  * @iface: pointer to interface instance
@@ -553,7 +581,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
   char *arg_list)
 {
struct channel *channel;
-   struct snd_card *card;
+   struct sound_adapter *adpt;
struct snd_pcm *pcm;
int playback_count = 0;
int capture_count = 0;
@@ -561,6 +589,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
int direction;
char *card_name;
u16 ch_num;
+   u8 create = 0;
char *sample_res;
 
if (!iface)
@@ -571,6 +600,40 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
return -EINVAL;
}
 
+   ret = split_arg_list(arg_list, &card_name, &ch_num, &sample_res,
+&create);
+   if (ret < 0)
+   return ret;
+
+   list_for_each_entry(adpt, &adpt_list, list) {
+   if (adpt->iface == iface && adpt->registered)
+   return -ENOSPC;
+   if (!adpt->registered) {
+   adpt->pcm_dev_idx++;
+   goto skip_adpt_alloc;
+   }
+   }
+   adpt = kzalloc(sizeof(*adpt), GFP_KERNEL);
+   if (!adpt)
+   return -ENOMEM;
+
+   adpt->iface = iface;
+   adpt->registered = false;
+   adpt->pcm_dev_idx = 0;
+   INIT_LIST_HEAD(&adpt->dev_list);
+   iface->priv = adpt;
+   ret = snd_card_new(&iface->dev, -1, card_name, THIS_MODULE,
+  sizeof(*channel), &adpt->card);
+   if (ret < 0)
+   return ret;
+   snprintf(adpt->card->driver, sizeof(adpt->card->driver),
+"%s", DRIVER_NAME);
+   snprintf(adpt->card->shortname, sizeof(adpt->card->shortname),
+"Microchip MOST:%d", adpt->card->number);
+   snprintf(adpt->card->longname, sizeof(adpt->card->longname),
+   

Re: [PATCH v2] staging:erofs: Remove __EROFS_BIT macro

2018-12-12 Thread Gao Xiang
Hi Aaron,

On 2018/12/12 20:02, Aaron Strahlberger wrote:
> The `__EROFS_BIT` macro is used only once, do define the
> `EROFS_I_DATA_MAPPING_BIT` constant. This Patch removes this
> macro and expands it in the place it is used.
> 
> Signed-off-by: Aaron Strahlberger 
> Signed-off-by: Julius Wiedmann 
> Signed-off-by: Dominik Huber 
> ---
>  drivers/staging/erofs/erofs_fs.h | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)

> +
>  #define EROFS_I_VERSION_BITS1
>  #define EROFS_I_DATA_MAPPING_BITS   3
>  
>  #define EROFS_I_VERSION_BIT 0
> -__EROFS_BIT(EROFS_I_, DATA_MAPPING, VERSION);
> +enum {
> + EROFS_I_DATA_MAPPING_BIT = EROFS_I_VERSION_BIT + EROFS_I_VERSION_BITS
> +}

Thanks for your patch. I have fixed it yesterday,
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/erofs?h=staging-testing&id=ccd9c19c7ae165c70221b0a4927c31a56e395658

EROFS_I_DATA_MAPPING_BIT = EROFS_I_VERSION_BIT + EROFS_I_VERSION_BITS is not 
straight-forward as well for erofs on-disk format definition,
fix it to a plain number.

Thanks,
Gao Xiang

>  
>  struct erofs_inode_v1 {
>  /*  0 */__le16 i_advise;
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging:erofs: Fix alignment issues

2018-12-12 Thread Gao Xiang


On 2018/12/12 20:11, Gao Xiang wrote:
> Hi Aaron,
> 
> On 2018/12/12 20:00, Aaron Strahlberger wrote:
>> Fix of `CHECK: Alignment should match open parenthesis` issues, reported by
>> checkpatch.pl
>>
>> Signed-off-by: Aaron Strahlberger 
>> Signed-off-by: Julius Wiedmann 
>> Signed-off-by: Dominik Huber 
>> ---
>>  drivers/staging/erofs/dir.c | 12 ++--
>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
>> index e44ca93dcdc6..e1955703ab8f 100644
>> --- a/drivers/staging/erofs/dir.c
>> +++ b/drivers/staging/erofs/dir.c
>> @@ -24,8 +24,8 @@ static const unsigned char 
>> erofs_filetype_table[EROFS_FT_MAX] = {
>>  };
>>  
>>  static int erofs_fill_dentries(struct dir_context *ctx,
>> -void *dentry_blk, unsigned int *ofs,
>> -unsigned int nameoff, unsigned int maxsize)
>> +   void *dentry_blk, unsigned int *ofs,
>> +   unsigned int nameoff, unsigned int maxsize)
>>  {
>>  struct erofs_dirent *de = dentry_blk;
>>  const struct erofs_dirent *end = dentry_blk + nameoff;
>> @@ -69,8 +69,8 @@ static int erofs_fill_dentries(struct dir_context *ctx,
>>  #endif
>>  
>>  if (!dir_emit(ctx, de_name, de_namelen,
>> -le64_to_cpu(de->nid), d_type))
>> -/* stoped by some reason */
>> +  le64_to_cpu(de->nid), d_type))
>> +/* stopped by some reason */
> It seems Greg has merged part of your previous patch,
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/erofs?h=staging-testing&id=019ec6c14fbdfaeb361c84f68158fb9097f41004
> 
> Anyway, I can locally apply it by 3-way merge, and it looks good to me apart 
> from that
> 
> Reviewed-by: Gao Xiang 
> 

By the way, the subject line could be better as "staging: erofs: Fix alignment 
issues" rather than "staging:erofs: Fix alignment issues"

Thanks,
Gao Xiang

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


Re: [PATCH v1] binder: implement binderfs

2018-12-12 Thread Christian Brauner
> On Fri, Dec 7, 2018 at 3:26 PM Christian Brauner  wrote:
> >
> > As discussed at Linux Plumbers Conference 2018 in Vancouver [1] this is the
> > implementation of binderfs.
> >
> > binderfs is a backwards-compatible filesystem for Android's binder ipc
> > mechanism. Each ipc namespace will mount a new binderfs instance. Mounting
> > binderfs multiple times at different locations in the same ipc namespace
> > will not cause a new super block to be allocated and hence it will be the
> > same filesystem instance.
> > Each new binderfs mount will have its own set of binder devices only
> > visible in the ipc namespace it has been mounted in. All devices in a new
> > binderfs mount will follow the scheme binder%d and numbering will always
> > start at 0.
> >
> > /* Backwards compatibility */
> > Devices requested in the Kconfig via CONFIG_ANDROID_BINDER_DEVICES for the
> > initial ipc namespace will work as before. They will be registered via
> > misc_register() and appear in the devtmpfs mount. Specifically, the
> > standard devices binder, hwbinder, and vndbinder will all appear in their
> > standard locations in /dev. Mounting or unmounting the binderfs mount in
> > the initial ipc namespace will have no effect on these devices, i.e. they
> > will neither show up in the binderfs mount nor will they disappear when the
> > binderfs mount is gone.
> >
> > /* binder-control */
> > Each new binderfs instance comes with a binder-control device. No other
> > devices will be present at first. The binder-control device can be used to
> > dynamically allocate binder devices. All requests operate on the binderfs
> > mount the binder-control device resides in:
> > - BINDER_CTL_ADD
> >   Allocate a new binder device.
> > Assuming a new instance of binderfs has been mounted at /dev/binderfs via
> > mount -t binderfs binderfs /dev/binderfs. Then a request to create a new
> > binder device can be made via:
> >
> > struct binderfs_device device = {0};
> > snprintf(device.name, BINDERFS_MAX_NAME, "%s", "my-device");
> > int fd = open("/dev/binderfs/binder-control", O_RDWR);
> > ioctl(fd, BINDER_CTL_ADD, &device);
> >
> > binderfs will then allocate a new minor number and create the device
> > "my-device".
> > The struct binderfs_device will then be used to return the major and minor
> > number, for the device.
> > Binderfs devices can simply be removed via unlink().
> >
> > /* Implementation details */
> > - When binderfs is registered as a new filesystem it will dynamically
> >   allocate a new major number. The allocated major number will be returned
> >   in struct binderfs_device when a new binder device is allocated.
> >   Minor numbers that have been given out are tracked in a global idr struct
> >   that is capped at BINDERFS_MAX_MINOR. The minor number tracker is
> >   protected by a global mutex. This is the only point of contention between
> >   binderfs mounts.
> > - Each binderfs super block has its own struct binderfs_info that tracks
> >   specific details about a binderfs instance: the ipc namespace, the dentry
> >   of the binder-control device, the root uid and gid of the user namespace
> >   the binderfs instance was mounted in.
> > - binderfs can be mounted by user namespace root in a non-initial user
> >   namespace. The devices will be owned by user namespace root.
> > - New binder devices associated with a binderfs mount do not use the
> >   full misc_register() infrastructure. The misc_register() infrastructure
> >   can only create new devices in the host's devtmpfs mount. binderfs does
> >   however only make devices appear under its own mountpoint and thus
> >   allocates new character devices nodes from the inode of the root dentry
> >   of the super block. This will have the side-effect that binderfs specific
> >   device nodes do not appear in sysfs. This behavior is similar to devpts
> >   allocated pts devices and has no effect on the functionality of the ipc
> >   mechanism itself.
> >
> > /* Create a new binder device in a binderfs mount */
> > sudo mkdir /dev/binderfs
> > sudo mount -t binder binder /dev/binderfs
> >
> >  #define _GNU_SOURCE
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >
> >  int main(int argc, char *argv[])
> >  {
> >  int fd, ret, saved_errno;
> >  struct binderfs_device device = { 0 };
> >
> >  if (argc < 2)
> >  exit(EXIT_FAILURE);
> >
> >  strncpy(device.name, argv[1], sizeof(device.name));
> >
> >  fd = open("/dev/binderfs/binder-control", O_RDONLY | O_CLOEXEC);
> >  if (fd < 0) {
> >  printf("%s - Failed to open binder-control device\n",
> > strerror(errno));
> >  exit(EXIT_FAILURE);
> >  }
> >
> >  ret = ioctl(fd, BINDER_CTL_ADD, &device);
> >  saved_errno = errno;
> >  close(fd);
> >  errno = saved_errn

Re: [linux-sunxi] [PATCH v2 1/2] media: v4l: Add definitions for the HEVC slice format and controls

2018-12-12 Thread Paul Kocialkowski
Hi,

On Wed, 2018-12-05 at 21:59 +0100, Jernej Škrabec wrote:
> Hi!
> 
> Dne petek, 23. november 2018 ob 14:02:08 CET je Paul Kocialkowski napisal(a):
> > This introduces the required definitions for HEVC decoding support with
> > stateless VPUs. The controls associated to the HEVC slice format provide
> > the required meta-data for decoding slices extracted from the bitstream.
> > 
> > This interface comes with the following limitations:
> > * No custom quantization matrices (scaling lists);
> > * Support for a single temporal layer only;
> > * No slice entry point offsets support;
> > * No conformance window support;
> > * No VUI parameters support;
> > * No support for SPS extensions: range, multilayer, 3d, scc, 4 bits;
> > * No support for PPS extensions: range, multilayer, 3d, scc, 4 bits.
> > 
> > Signed-off-by: Paul Kocialkowski 
> > ---
> 
> 
> 
> > diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c
> > b/drivers/media/v4l2-core/v4l2-ctrls.c index e96c453208e8..9af17815ecc3
> > 100644
> > --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> > +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> > @@ -913,6 +913,9 @@ const char *v4l2_ctrl_get_name(u32 id)
> > case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD: return "HEVC 
> > Size of
> > Length Field"; case V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES: return
> > "Reference Frames for a P-Frame"; case
> > V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR:  return "Prepend SPS and 
> > PPS 
> to
> > IDR"; + case V4L2_CID_MPEG_VIDEO_HEVC_SPS:  return 
> > "HEVC Sequence
> > Parameter Set"; +   case V4L2_CID_MPEG_VIDEO_HEVC_PPS:  
> > return "HEVC 
> Picture
> > Parameter Set"; +   case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS: 
> > return 
> "HEVC
> > Slice Parameters";
> > 
> > /* CAMERA controls */
> > /* Keep the order of the 'case's the same as in v4l2-controls.h! */
> > @@ -1320,6 +1323,15 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum
> > v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS:
> > *type = V4L2_CTRL_TYPE_H264_DECODE_PARAMS;
> > break;
> > +   case V4L2_CID_MPEG_VIDEO_HEVC_SPS:
> > +   *type = V4L2_CTRL_TYPE_HEVC_SPS;
> > +   break;
> > +   case V4L2_CID_MPEG_VIDEO_HEVC_PPS:
> > +   *type = V4L2_CTRL_TYPE_HEVC_PPS;
> > +   break;
> > +   case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS:
> > +   *type = V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS;
> > +   break;
> > default:
> > *type = V4L2_CTRL_TYPE_INTEGER;
> > break;
> > @@ -1692,6 +1704,11 @@ static int std_validate(const struct v4l2_ctrl *ctrl,
> > u32 idx, case V4L2_CTRL_TYPE_H264_DECODE_PARAMS:
> > return 0;
> > 
> > +   case V4L2_CTRL_TYPE_HEVC_SPS:
> > +   case V4L2_CTRL_TYPE_HEVC_PPS:
> > +   case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS:
> > +   return 0;
> > +
> > default:
> > return -EINVAL;
> > }
> > @@ -2287,6 +2304,15 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct
> > v4l2_ctrl_handler *hdl, case V4L2_CTRL_TYPE_H264_DECODE_PARAMS:
> > elem_size = sizeof(struct v4l2_ctrl_h264_decode_param);
> > break;
> > +   case V4L2_CTRL_TYPE_HEVC_SPS:
> > +   elem_size = sizeof(struct v4l2_ctrl_hevc_sps);
> > +   break;
> > +   case V4L2_CTRL_TYPE_HEVC_PPS:
> > +   elem_size = sizeof(struct v4l2_ctrl_hevc_pps);
> > +   break;
> > +   case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS:
> > +   elem_size = sizeof(struct v4l2_ctrl_hevc_slice_params);
> > +   break;
> > default:
> > if (type < V4L2_CTRL_COMPOUND_TYPES)
> > elem_size = sizeof(s32);
> > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
> > b/drivers/media/v4l2-core/v4l2-ioctl.c index aa63f1794272..7bec91c6effe
> > 100644
> > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > @@ -1321,6 +1321,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> > case V4L2_PIX_FMT_VP8:  descr = "VP8"; break;
> > case V4L2_PIX_FMT_VP9:  descr = "VP9"; break;
> > case V4L2_PIX_FMT_HEVC: descr = "HEVC"; break; /* aka 
> > H.265 */
> > +   case V4L2_PIX_FMT_HEVC_SLICE:   descr = "HEVC Parsed Slice 
> > Data"; break;
> > case V4L2_PIX_FMT_FWHT: descr = "FWHT"; break; /* used 
> > in vicodec */
> > case V4L2_PIX_FMT_CPIA1:descr = "GSPCA CPiA YUV"; break;
> > case V4L2_PIX_FMT_WNVA: descr = "WNVA"; break;
> > diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
> > index b4ca95710d2d..11664c5c3706 100644
> > --- a/include/media/v4l2-ctrls.h
> > +++ b/include/media/v4l2-ctrls.h
> > @@ -48,6 +48,9 @@ struct poll_table_struct;
> >   * @p_h264_scal_mtrx:  Pointer to a struct 
> v4l2_ctrl_h264_scaling_matrix.
> >   * @p_h264_slice_param:Pointer to a struct 

Lets Work Together

2018-12-12 Thread Mr Peter OWEN




Good Day,
Hope you are doing great Today.I have a proposed BUSINESS DEAL that  
will benefit both parties. This is legitimate,legal and your  
personality will not be compromised.Please Reply to me ONLY if you are  
interested and consider your self capable for details.


Sincerely,

Peter OWEN


This message was sent using IMP, the Internet Messaging Program.

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


Lets Work Together

2018-12-12 Thread Mr Peter OWEN




Good Day,
Hope you are doing great Today.I have a proposed BUSINESS DEAL that  
will benefit both parties. This is legitimate,legal and your  
personality will not be compromised.Please Reply to me ONLY if you are  
interested and consider your self capable for details.


Sincerely,

Peter OWEN


This message was sent using IMP, the Internet Messaging Program.

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


[PATCH] Staging: rtl8723bs: Fix code style issue in rtl8723bs driver

2018-12-12 Thread Hardik Singh Rathore
Add space between 'else' and '{' to solve code style issue
in all the files for rtl8723bs driver.

Signed-off-by: Hardik Singh Rathore 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c   | 24 ++---
 drivers/staging/rtl8723bs/core/rtw_cmd.c  | 36 +++
 drivers/staging/rtl8723bs/core/rtw_debug.c|  2 +-
 drivers/staging/rtl8723bs/core/rtw_efuse.c|  6 +-
 .../staging/rtl8723bs/core/rtw_ieee80211.c| 26 ++---
 .../staging/rtl8723bs/core/rtw_ioctl_set.c| 16 ++--
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 38 
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 94 +--
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c  |  6 +-
 drivers/staging/rtl8723bs/core/rtw_recv.c | 34 +++
 drivers/staging/rtl8723bs/core/rtw_security.c |  6 +-
 drivers/staging/rtl8723bs/core/rtw_sta_mgt.c  |  2 +-
 .../staging/rtl8723bs/core/rtw_wlan_util.c| 26 ++---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 22 ++---
 drivers/staging/rtl8723bs/hal/hal_btcoex.c|  4 +-
 15 files changed, 171 insertions(+), 171 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 330cd21c21bd..cbbfef389874 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -91,7 +91,7 @@ static void update_BCNTIM(struct adapter *padapter)
 
/* append TIM IE from dst_ie offset */
dst_ie = p;
-   } else{
+   } else {
tim_ielen = 0;
 
/* calucate head_len */
@@ -323,7 +323,7 @@ void expire_timeout_chk(struct adapter *padapter)
psta->state
);
updated = ap_free_sta(padapter, psta, false, 
WLAN_REASON_DEAUTH_LEAVING);
-   } else{
+   } else {
/* TODO: Aging mechanism to digest frames in sleep_q to 
avoid running out of xmitframe */
if (psta->sleepq_len > 
(NR_XMITFRAME/pstapriv->asoc_list_cnt)
&& padapter->xmitpriv.free_xmitframe_cnt < ((
@@ -457,7 +457,7 @@ void add_RATid(struct adapter *padapter, struct sta_info 
*psta, u8 rssi_level)
__func__, psta->mac_id, psta->raid, shortGIrate, 
tx_ra_bitmap);
 
rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg, rssi_level);
-   } else{
+   } else {
DBG_871X("station aid %d exceed the max number\n", psta->aid);
}
 }
@@ -538,7 +538,7 @@ void update_bmc_sta(struct adapter *padapter)
psta->state = _FW_LINKED;
spin_unlock_bh(&psta->lock);
 
-   } else{
+   } else {
DBG_871X("add_RATid_bmc_sta error!\n");
}
 }
@@ -633,7 +633,7 @@ void update_sta_info_apmode(struct adapter *padapter, 
struct sta_info *psta)
SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | 
STBC_HT_CAP_TX));
DBG_871X("Enable HT Tx STBC for STA(%d)\n", psta->aid);
}
-   } else{
+   } else {
phtpriv_sta->ampdu_enable = false;
 
phtpriv_sta->sgi_20m = false;
@@ -695,7 +695,7 @@ static void update_ap_info(struct adapter *padapter, struct 
sta_info *psta)
phtpriv_ap->sgi_40m = true;
 
psta->qos_option = true;
-   } else{
+   } else {
phtpriv_ap->ampdu_enable = false;
 
phtpriv_ap->sgi_20m = false;
@@ -1215,7 +1215,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
if ((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
(psecuritypriv->wpa2_pairwise_cipher & 
WPA_CIPHER_CCMP)) {
pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
-   } else{
+   } else {
pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
}
 
@@ -1961,7 +1961,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
update_beacon(padapter, 0xFF, NULL, true);
}
}
-   } else{
+   } else {
if (psta->no_short_preamble_set) {
psta->no_short_preamble_set = 0;
 
@@ -1986,7 +1986,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
update_beacon(padapter, _ERPINFO_IE_, NULL, 
true);
}
}
-   } else{
+   } else {
if (psta->nonerp_set) {
psta->nonerp_set = 0;
 
@@ -2011,7 +2011,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
update_beacon(padapter, 0xFF, NULL, true);
 

Re: [PATCH 1/6] staging: most: sound: create one sound card w/ multiple PCM devices per MOST device

2018-12-12 Thread Dan Carpenter
On Wed, Dec 12, 2018 at 01:15:26PM +0100, Christian Gromm wrote:
> This patch avoids that a sound card is created and registered with ALSA
> every time a channel is being linked. Instead the channels are hooked on
> the same card, which is registered not until the final link has been added
> to the component.
> 
> Signed-off-by: Christian Gromm 
> ---
>  drivers/staging/most/sound/sound.c | 127 
> +
>  1 file changed, 87 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/staging/most/sound/sound.c 
> b/drivers/staging/most/sound/sound.c
> index 89b02fc..41bcd2c 100644
> --- a/drivers/staging/most/sound/sound.c
> +++ b/drivers/staging/most/sound/sound.c
> @@ -10,6 +10,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -20,7 +21,6 @@
>  
>  #define DRIVER_NAME "sound"
>  
> -static struct list_head dev_list;
>  static struct core_component comp;
>  
>  /**
> @@ -56,6 +56,17 @@ struct channel {
>   void (*copy_fn)(void *alsa, void *most, unsigned int bytes);
>  };
>  
> +struct sound_adapter {
> + struct list_head dev_list;
> + struct most_interface *iface;
> + struct snd_card *card;
> + struct list_head list;
> + bool registered;
> + int pcm_dev_idx;
> +};
> +
> +static struct list_head adpt_list;
> +
>  #define MOST_PCM_INFO (SNDRV_PCM_INFO_MMAP | \
>  SNDRV_PCM_INFO_MMAP_VALID | \
>  SNDRV_PCM_INFO_BATCH | \
> @@ -157,9 +168,10 @@ static void most_to_alsa_copy32(void *alsa, void *most, 
> unsigned int bytes)
>  static struct channel *get_channel(struct most_interface *iface,
>  int channel_id)
>  {
> + struct sound_adapter *adpt = iface->priv;
>   struct channel *channel, *tmp;
>  
> - list_for_each_entry_safe(channel, tmp, &dev_list, list) {
> + list_for_each_entry_safe(channel, tmp, &adpt->dev_list, list) {
>   if ((channel->iface == iface) && (channel->id == channel_id))
>   return channel;
>   }
> @@ -460,7 +472,7 @@ static const struct snd_pcm_ops pcm_ops = {
>  };
>  
>  static int split_arg_list(char *buf, char **card_name, u16 *ch_num,
> -   char **sample_res)
> +   char **sample_res, u8 *create)
>  {
>   char *num;
>   int ret;
> @@ -479,6 +491,9 @@ static int split_arg_list(char *buf, char **card_name, 
> u16 *ch_num,
>   *sample_res = strsep(&buf, ".\n");
>   if (!*sample_res)
>   goto err;
> +
> + if (buf && !strcmp(buf, "create"))
> + *create = 1;

This comes from userspace, right?  So we're adding a new API?

>   return 0;
>  
>  err:
> @@ -536,6 +551,19 @@ static int audio_set_hw_params(struct snd_pcm_hardware 
> *pcm_hw,
>   return 0;
>  }
>  
> +static void release_adapter(struct sound_adapter *adpt)
> +{
> + struct channel *channel, *tmp;
> +
> + list_for_each_entry_safe(channel, tmp, &adpt->dev_list, list) {
> + list_del(&channel->list);
> + kfree(channel);
> + }
> + snd_card_free(adpt->card);
> + list_del(&adpt->list);
> + kfree(adpt);
> +}
> +
>  /**
>   * audio_probe_channel - probe function of the driver module
>   * @iface: pointer to interface instance
> @@ -553,7 +581,7 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>  char *arg_list)
>  {
>   struct channel *channel;
> - struct snd_card *card;
> + struct sound_adapter *adpt;
>   struct snd_pcm *pcm;
>   int playback_count = 0;
>   int capture_count = 0;
> @@ -561,6 +589,7 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>   int direction;
>   char *card_name;
>   u16 ch_num;
> + u8 create = 0;
>   char *sample_res;
>  
>   if (!iface)
> @@ -571,6 +600,40 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>   return -EINVAL;
>   }
>  
> + ret = split_arg_list(arg_list, &card_name, &ch_num, &sample_res,
> +  &create);
> + if (ret < 0)
> + return ret;
> +
> + list_for_each_entry(adpt, &adpt_list, list) {
> + if (adpt->iface == iface && adpt->registered)
> + return -ENOSPC;
> + if (!adpt->registered) {

This is very confusing and I'm sorry but I don't think it even works...

:(

We add new allocations to the &adpt_list, but then if audio_probe_channel()
fails, then we free "adpt" in the error handling.  But we don't remove
the adpt from the list so now if we iterate through the list again it's
a use after free.

It would be easy enought to remove the item from the list, but really my
issue is that I don't understand what we're trying to do here.  It looks
like this patch changes the user space interface and adds a "create"
argument?  I just think that's not a good API design.

Re: [PATCH 3/6] staging: most: sound: rename variable

2018-12-12 Thread Dan Carpenter
On Wed, Dec 12, 2018 at 01:15:28PM +0100, Christian Gromm wrote:
> @@ -587,7 +587,7 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>   int capture_count = 0;
>   int ret;
>   int direction;
> - char *card_name;
> + char *device_name;
^

>   u16 ch_num;
>   u8 create = 0;
>   char *sample_res;
> @@ -600,7 +600,7 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>   return -EINVAL;
>   }
>  
> - ret = split_arg_list(arg_list, &card_name, &ch_num, &sample_res,
> + ret = split_arg_list(arg_list, &device_name, &ch_num, &sample_res,
>&create);
>   if (ret < 0)
>   return ret;
> @@ -622,7 +622,7 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>   adpt->pcm_dev_idx = 0;
>   INIT_LIST_HEAD(&adpt->dev_list);
>   iface->priv = adpt;
> - ret = snd_card_new(&iface->dev, -1, card_name, THIS_MODULE,
> + ret = snd_card_new(&iface->dev, -1, device_name, THIS_MODULE,
>  sizeof(*channel), &adpt->card);
>   if (ret < 0)
>   return ret;
> @@ -663,14 +663,14 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>   if (ret)
>   goto err_free_adpt;
>  
> - ret = snd_pcm_new(adpt->card, card_name, adpt->pcm_dev_idx,
> + ret = snd_pcm_new(adpt->card, device_name, adpt->pcm_dev_idx,
> playback_count, capture_count, &pcm);
>  
>   if (ret < 0)
>   goto err_free_adpt;
>  
>   pcm->private_data = channel;
> -
> + snprintf(pcm->name, sizeof(device_name), device_name);
^^^

This change was not described in the commit message and it's not
correct.  sizeof(device_name) is sizeof(long).  We should be taking
sizeof(pcm->name) which is 80. 

>   snd_pcm_set_ops(pcm, direction, &pcm_ops);
>  
>   if (create) {

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


Re: [PATCH 6/6] staging: most: Documentation: add information to driver_usage file

2018-12-12 Thread Dan Carpenter
On Wed, Dec 12, 2018 at 01:15:31PM +0100, Christian Gromm wrote:
> diff --git a/drivers/staging/most/Documentation/driver_usage.txt 
> b/drivers/staging/most/Documentation/driver_usage.txt
> index bb9b4e8..da7a8f4 100644
> --- a/drivers/staging/most/Documentation/driver_usage.txt
> +++ b/drivers/staging/most/Documentation/driver_usage.txt
> @@ -142,8 +142,9 @@ Cdev component example:
>  
>  Sound component example:
>  
> -The sound component needs an additional parameter to determine the audio
> -resolution that is going to be used. The following formats are available:
> +The sound component needs additional parameters to determine the audio
> +resolution that is going to be used and to trigger the registration of a
> +sound card with ALSA. The following audio formats are available:
>  
>   - "1x8" (Mono)
>   - "2x16" (16-bit stereo)
> @@ -151,9 +152,18 @@ resolution that is going to be used. The following 
> formats are available:
>   - "2x32" (32-bit stereo)
>   - "6x16" (16-bit surround 5.1)
>  
> -$ echo "mdev0:ep_81:sound:most51_playback.6x16" >$(DRV_DIR)/add_link
> +To make the sound module create a sound card and register it with ALSA the
> +string "create" needs to be attached to the module parameter section of the
> +configuration string. To create a sound card with with two playback devices
> +(linked to channel ep01 and ep02) and one capture device (linked to channel
> +ep83) the following is written to the add_link file:
>  
> +$ echo "mdev0:ep01:sound:most51_playback.6x16" >$(DRV_DIR)/add_link
> +$ echo "mdev0:ep02:sound:most_playback.2x16" >$(DRV_DIR)/add_link
> +$ echo "mdev0:ep83:sound:most_capture.2x16.create" 
> >$(DRV_DIR)/add_link
>  
> +The link names (most51_playback, most_playback and most_capture) will
> +become the names of the PCM devices of the sound card.

So this patchset does break userspace...  Which is allowed sometimes in
staging, but it's better to point it out in the original commit which
causes the breakage.

But really I don't like this API at all...  It feels like something
from decades ago.  There has to be a better way than this.

Unfortunately, I'm not clever enough to give you useful suggestions...

regards,
dan carpenter

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


Re: [PATCH 1/6] staging: most: sound: create one sound card w/ multiple PCM devices per MOST device

2018-12-12 Thread Christian.Gromm
On Mi, 2018-12-12 at 17:21 +0300, Dan Carpenter wrote:
> On Wed, Dec 12, 2018 at 01:15:26PM +0100, Christian Gromm wrote:
> > 
> > This patch avoids that a sound card is created and registered with
> > ALSA
> > every time a channel is being linked. Instead the channels are
> > hooked on
> > the same card, which is registered not until the final link has
> > been added
> > to the component.
> > 
> > Signed-off-by: Christian Gromm 
> > ---
> >  drivers/staging/most/sound/sound.c | 127
> > +
> >  1 file changed, 87 insertions(+), 40 deletions(-)
> > 
> > diff --git a/drivers/staging/most/sound/sound.c
> > b/drivers/staging/most/sound/sound.c
> > index 89b02fc..41bcd2c 100644
> > --- a/drivers/staging/most/sound/sound.c
> > +++ b/drivers/staging/most/sound/sound.c
> > @@ -10,6 +10,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -20,7 +21,6 @@
> >  
> >  #define DRIVER_NAME "sound"
> >  
> > -static struct list_head dev_list;
> >  static struct core_component comp;
> >  
> >  /**
> > @@ -56,6 +56,17 @@ struct channel {
> >     void (*copy_fn)(void *alsa, void *most, unsigned int
> > bytes);
> >  };
> >  
> > +struct sound_adapter {
> > +   struct list_head dev_list;
> > +   struct most_interface *iface;
> > +   struct snd_card *card;
> > +   struct list_head list;
> > +   bool registered;
> > +   int pcm_dev_idx;
> > +};
> > +
> > +static struct list_head adpt_list;
> > +
> >  #define MOST_PCM_INFO (SNDRV_PCM_INFO_MMAP | \
> >        SNDRV_PCM_INFO_MMAP_VALID | \
> >        SNDRV_PCM_INFO_BATCH | \
> > @@ -157,9 +168,10 @@ static void most_to_alsa_copy32(void *alsa,
> > void *most, unsigned int bytes)
> >  static struct channel *get_channel(struct most_interface *iface,
> >        int channel_id)
> >  {
> > +   struct sound_adapter *adpt = iface->priv;
> >     struct channel *channel, *tmp;
> >  
> > -   list_for_each_entry_safe(channel, tmp, &dev_list, list) {
> > +   list_for_each_entry_safe(channel, tmp, &adpt->dev_list,
> > list) {
> >     if ((channel->iface == iface) && (channel->id ==
> > channel_id))
> >     return channel;
> >     }
> > @@ -460,7 +472,7 @@ static const struct snd_pcm_ops pcm_ops = {
> >  };
> >  
> >  static int split_arg_list(char *buf, char **card_name, u16
> > *ch_num,
> > -     char **sample_res)
> > +     char **sample_res, u8 *create)
> >  {
> >     char *num;
> >     int ret;
> > @@ -479,6 +491,9 @@ static int split_arg_list(char *buf, char
> > **card_name, u16 *ch_num,
> >     *sample_res = strsep(&buf, ".\n");
> >     if (!*sample_res)
> >     goto err;
> > +
> > +   if (buf && !strcmp(buf, "create"))
> > +   *create = 1;
> This comes from userspace, right?  So we're adding a new API?
> 

An additional field is added to the configuration parameter,
which is provided by user space.
This seemed to be less painful than adding a new sysfs
file and make the configuration even more complicated. 

> > 
> >     return 0;
> >  
> >  err:
> > @@ -536,6 +551,19 @@ static int audio_set_hw_params(struct
> > snd_pcm_hardware *pcm_hw,
> >     return 0;
> >  }
> >  
> > +static void release_adapter(struct sound_adapter *adpt)
> > +{
> > +   struct channel *channel, *tmp;
> > +
> > +   list_for_each_entry_safe(channel, tmp, &adpt->dev_list,
> > list) {
> > +   list_del(&channel->list);
> > +   kfree(channel);
> > +   }
> > +   snd_card_free(adpt->card);
> > +   list_del(&adpt->list);
> > +   kfree(adpt);
> > +}
> > +
> >  /**
> >   * audio_probe_channel - probe function of the driver module
> >   * @iface: pointer to interface instance
> > @@ -553,7 +581,7 @@ static int audio_probe_channel(struct
> > most_interface *iface, int channel_id,
> >        char *arg_list)
> >  {
> >     struct channel *channel;
> > -   struct snd_card *card;
> > +   struct sound_adapter *adpt;
> >     struct snd_pcm *pcm;
> >     int playback_count = 0;
> >     int capture_count = 0;
> > @@ -561,6 +589,7 @@ static int audio_probe_channel(struct
> > most_interface *iface, int channel_id,
> >     int direction;
> >     char *card_name;
> >     u16 ch_num;
> > +   u8 create = 0;
> >     char *sample_res;
> >  
> >     if (!iface)
> > @@ -571,6 +600,40 @@ static int audio_probe_channel(struct
> > most_interface *iface, int channel_id,
> >     return -EINVAL;
> >     }
> >  
> > +   ret = split_arg_list(arg_list, &card_name, &ch_num,
> > &sample_res,
> > +    &create);
> > +   if (ret < 0)
> > j+  return ret;
> > +
> > +   list_for_each_entry(adpt, &adpt_list, list) {
> > +   if (adpt->iface == iface && adpt->registered)
> > +   return -ENOSPC;
> > +   if (!adpt->registered) {
> This is very confusing and I'm sorry but I don't think it even
> works...
> 
> :(
> 
> We add new allocations to the &adpt

Re: [PATCH 3/6] staging: most: sound: rename variable

2018-12-12 Thread Christian.Gromm
On Mi, 2018-12-12 at 17:26 +0300, Dan Carpenter wrote:
> On Wed, Dec 12, 2018 at 01:15:28PM +0100, Christian Gromm wrote:
> > 
> > @@ -587,7 +587,7 @@ static int audio_probe_channel(struct
> > most_interface *iface, int channel_id,
> >     int capture_count = 0;
> >     int ret;
> >     int direction;
> > -   char *card_name;
> > +   char *device_name;
> ^
> 
> > 
> >     u16 ch_num;
> >     u8 create = 0;
> >     char *sample_res;
> > @@ -600,7 +600,7 @@ static int audio_probe_channel(struct
> > most_interface *iface, int channel_id,
> >     return -EINVAL;
> >     }
> >  
> > -   ret = split_arg_list(arg_list, &card_name, &ch_num,
> > &sample_res,
> > +   ret = split_arg_list(arg_list, &device_name, &ch_num,
> > &sample_res,
> >      &create);
> >     if (ret < 0)
> >     return ret;
> > @@ -622,7 +622,7 @@ static int audio_probe_channel(struct
> > most_interface *iface, int channel_id,
> >     adpt->pcm_dev_idx = 0;
> >     INIT_LIST_HEAD(&adpt->dev_list);
> >     iface->priv = adpt;
> > -   ret = snd_card_new(&iface->dev, -1, card_name,
> > THIS_MODULE,
> > +   ret = snd_card_new(&iface->dev, -1, device_name,
> > THIS_MODULE,
> >        sizeof(*channel), &adpt->card);
> >     if (ret < 0)
> >     return ret;
> > @@ -663,14 +663,14 @@ static int audio_probe_channel(struct
> > most_interface *iface, int channel_id,
> >     if (ret)
> >     goto err_free_adpt;
> >  
> > -   ret = snd_pcm_new(adpt->card, card_name, adpt-
> > >pcm_dev_idx,
> > +   ret = snd_pcm_new(adpt->card, device_name, adpt-
> > >pcm_dev_idx,
> >       playback_count, capture_count, &pcm);
> >  
> >     if (ret < 0)
> >     goto err_free_adpt;
> >  
> >     pcm->private_data = channel;
> > -
> > +   snprintf(pcm->name, sizeof(device_name), device_name);
> ^^^
> 
> This change was not described in the commit message and it's not
> correct.  sizeof(device_name) is sizeof(long).  We should be taking
> sizeof(pcm->name) which is 80. 
> 
Right, this needs to be a separate patch.
Missed that one while interactively staging the individual changes. 

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


Re: [PATCH] staging: vchiq: rework remove_event handling

2018-12-12 Thread Nicolas Saenz Julienne
On Tue, 2018-12-11 at 15:20 +0100, Arnd Bergmann wrote:
> On Tue, Dec 11, 2018 at 1:36 PM Nicolas Saenz Julienne
>  wrote:
> > On Mon, 2018-12-10 at 22:11 +0100, Arnd Bergmann wrote:
> > > @@ -447,26 +444,26 @@ remote_event_wait(VCHIQ_STATE_T *state,
> > > REMOTE_EVENT_T *event)
> > >  }
> > > 
> > >  static inline void
> > > -remote_event_signal_local(VCHIQ_STATE_T *state, REMOTE_EVENT_T
> > > *event)
> > > +remote_event_signal_local(wait_queue_head_t *wq, REMOTE_EVENT_T
> > > *event)
> > >  {
> > >   event->armed = 0;
> > > - complete((struct completion *)((char *)state + event-
> > > >event));
> > > + wake_up_all(wq);
> > 
> > Shouldn't this just be "wake_up(wq)"?
> 
> I wasn't entirely sure if we could get with more than one thread
> waiting
> for the wakeup. With the semaphore or completion that would already
> be broken because we'd only wake up one of them, but I was hoping
> to stay on the safe side with wake_up_all().

You're right. Had a look at the code and there shouldn't be more than
one thread waiting. wake_up_all() looks OK.

Reviewed-by: Nicolas Saenz Julienne 

Regards,
Nicolas


signature.asc
Description: This is a digitally signed message part
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: adt7316: drop unnecessary initialization of variables

2018-12-12 Thread Hardik Singh Rathore
Initialization is unnecessary when the variable is written before it is
read. There were some occasions in which the driver would initialize `ret'
during declaration without need.

Purely a cosmetic change with no functional impact.

Signed-off-by: Hardik Singh Rathore 
---
 drivers/staging/iio/addac/adt7316-i2c.c | 6 +++---
 drivers/staging/iio/addac/adt7316-spi.c | 4 ++--
 drivers/staging/iio/addac/adt7316.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/iio/addac/adt7316-i2c.c 
b/drivers/staging/iio/addac/adt7316-i2c.c
index 473e5e34ec00..48736c0ab0ef 100644
--- a/drivers/staging/iio/addac/adt7316-i2c.c
+++ b/drivers/staging/iio/addac/adt7316-i2c.c
@@ -47,7 +47,7 @@ static int adt7316_i2c_read(void *client, u8 reg, u8 *data)
 static int adt7316_i2c_write(void *client, u8 reg, u8 data)
 {
struct i2c_client *cl = client;
-   int ret = 0;
+   int ret;
 
ret = i2c_smbus_write_byte_data(cl, reg, data);
if (ret < 0)
@@ -59,7 +59,7 @@ static int adt7316_i2c_write(void *client, u8 reg, u8 data)
 static int adt7316_i2c_multi_read(void *client, u8 reg, u8 count, u8 *data)
 {
struct i2c_client *cl = client;
-   int i, ret = 0;
+   int i, ret;
 
if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR;
@@ -78,7 +78,7 @@ static int adt7316_i2c_multi_read(void *client, u8 reg, u8 
count, u8 *data)
 static int adt7316_i2c_multi_write(void *client, u8 reg, u8 count, u8 *data)
 {
struct i2c_client *cl = client;
-   int i, ret = 0;
+   int i, ret;
 
if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR;
diff --git a/drivers/staging/iio/addac/adt7316-spi.c 
b/drivers/staging/iio/addac/adt7316-spi.c
index 5cd22743e140..f524b4ccf5c7 100644
--- a/drivers/staging/iio/addac/adt7316-spi.c
+++ b/drivers/staging/iio/addac/adt7316-spi.c
@@ -27,7 +27,7 @@ static int adt7316_spi_multi_read(void *client, u8 reg, u8 
count, u8 *data)
 {
struct spi_device *spi_dev = client;
u8 cmd[2];
-   int ret = 0;
+   int ret;
 
if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR;
@@ -56,7 +56,7 @@ static int adt7316_spi_multi_write(void *client, u8 reg, u8 
count, u8 *data)
 {
struct spi_device *spi_dev = client;
u8 buf[ADT7316_REG_MAX_ADDR + 2];
-   int i, ret = 0;
+   int i, ret;
 
if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR;
diff --git a/drivers/staging/iio/addac/adt7316.c 
b/drivers/staging/iio/addac/adt7316.c
index 2f8a122f475d..2d1e707a8676 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -2104,7 +2104,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus 
*bus,
struct adt7316_chip_info *chip;
struct iio_dev *indio_dev;
unsigned short *adt7316_platform_data = dev->platform_data;
-   int ret = 0;
+   int ret;
 
indio_dev = devm_iio_device_alloc(dev, sizeof(*chip));
if (!indio_dev)
-- 
2.17.1

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


[PATCH] staging: iio: ad7816: drop unnecessary initialization of variables

2018-12-12 Thread Hardik Singh Rathore
Initialization is unnecessary when the variable is written before it is
read. There were some occasions in which the driver would initialize `ret'
during declaration without need.

Signed-off-by: Hardik Singh Rathore 
---
 drivers/staging/iio/adc/ad7816.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 5209651a1b25..ee50e7296795 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -65,7 +65,7 @@ enum ad7816_type {
 static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
 {
struct spi_device *spi_dev = chip->spi_dev;
-   int ret = 0;
+   int ret;
__be16 buf;
 
gpiod_set_value(chip->rdwr_pin, 1);
@@ -106,7 +106,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, 
u16 *data)
 static int ad7816_spi_write(struct ad7816_chip_info *chip, u8 data)
 {
struct spi_device *spi_dev = chip->spi_dev;
-   int ret = 0;
+   int ret;
 
gpiod_set_value(chip->rdwr_pin, 1);
gpiod_set_value(chip->rdwr_pin, 0);
@@ -354,8 +354,7 @@ static int ad7816_probe(struct spi_device *spi_dev)
 {
struct ad7816_chip_info *chip;
struct iio_dev *indio_dev;
-   int ret = 0;
-   int i;
+   int i, ret;
 
indio_dev = devm_iio_device_alloc(&spi_dev->dev, sizeof(*chip));
if (!indio_dev)
-- 
2.17.1

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


[PATCH 1/3] staging: vchiq: switch to wait_for_completion_killable

2018-12-12 Thread Nicolas Saenz Julienne
This fixes f27e47bc6b8b ("staging: vchiq: use completions instead of
semaphores") as it neglected the subtle down_interruptible() macro
override in vchiq_killable.h. Hence all completions should be killable
instead of interruptible.

Fixes: f27e47bc6b8b ("staging: vchiq: use completions instead of semaphores")
Reported-by: Arnd Bergmann 
Signed-off-by: Nicolas Saenz Julienne 
---
 .../interface/vchiq_arm/vchiq_arm.c   | 21 +--
 .../interface/vchiq_arm/vchiq_core.c  | 21 +--
 .../interface/vchiq_arm/vchiq_util.c  |  6 +++---
 3 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index f28f681192dd..227c208dd122 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -559,8 +559,7 @@ add_completion(VCHIQ_INSTANCE_T instance, VCHIQ_REASON_T 
reason,
vchiq_log_trace(vchiq_arm_log_level,
"%s - completion queue full", __func__);
DEBUG_COUNT(COMPLETION_QUEUE_FULL_COUNT);
-   if (wait_for_completion_interruptible(
-   &instance->remove_event)) {
+   if (wait_for_completion_killable( &instance->remove_event)) {
vchiq_log_info(vchiq_arm_log_level,
"service_callback interrupted");
return VCHIQ_RETRY;
@@ -671,7 +670,7 @@ service_callback(VCHIQ_REASON_T reason, VCHIQ_HEADER_T 
*header,
}
 
DEBUG_TRACE(SERVICE_CALLBACK_LINE);
-   if (wait_for_completion_interruptible(
+   if (wait_for_completion_killable(
&user_service->remove_event)
!= 0) {
vchiq_log_info(vchiq_arm_log_level,
@@ -1006,7 +1005,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
   has been closed until the client library calls the
   CLOSE_DELIVERED ioctl, signalling close_event. */
if (user_service->close_pending &&
-   wait_for_completion_interruptible(
+   wait_for_completion_killable(
&user_service->close_event))
status = VCHIQ_RETRY;
break;
@@ -1182,7 +1181,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
 
DEBUG_TRACE(AWAIT_COMPLETION_LINE);
mutex_unlock(&instance->completion_mutex);
-   rc = wait_for_completion_interruptible(
+   rc = wait_for_completion_killable(
&instance->insert_event);
mutex_lock(&instance->completion_mutex);
if (rc != 0) {
@@ -1351,7 +1350,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
do {
spin_unlock(&msg_queue_spinlock);
DEBUG_TRACE(DEQUEUE_MESSAGE_LINE);
-   if (wait_for_completion_interruptible(
+   if (wait_for_completion_killable(
&user_service->insert_event)) {
vchiq_log_info(vchiq_arm_log_level,
"DEQUEUE_MESSAGE interrupted");
@@ -2356,7 +2355,7 @@ vchiq_keepalive_thread_func(void *v)
while (1) {
long rc = 0, uc = 0;
 
-   if (wait_for_completion_interruptible(&arm_state->ka_evt)
+   if (wait_for_completion_killable(&arm_state->ka_evt)
!= 0) {
vchiq_log_error(vchiq_susp_log_level,
"%s interrupted", __func__);
@@ -2606,7 +2605,7 @@ block_resume(VCHIQ_ARM_STATE_T *arm_state)
write_unlock_bh(&arm_state->susp_res_lock);
vchiq_log_info(vchiq_susp_log_level, "%s wait for previously "
"blocked clients", __func__);
-   if (wait_for_completion_interruptible_timeout(
+   if (wait_for_completion_killable_timeout(
&arm_state->blocked_blocker, timeout_val)
<= 0) {
vchiq_log_error(vchiq_susp_log_level, "%s wait for "
@@ -2632,7 +2631,7 @@ block_resume(VCHIQ_ARM_STATE_T *arm_state)
write_unlock_bh(&arm_state->susp_res_lock);
vchiq_log_info(vchiq_susp_log_level, "%s wait for resume",
__func__);
-   if (wait_for_comp

[PATCH 0/3] staging: vchiq: fix completion routines & semaphores

2018-12-12 Thread Nicolas Saenz Julienne
As pointed out by Arnd Bergman[1] there where some issues on how I
converted semaphores to completion routines. I wasn't aware of a
macro override happening in vchiq_killable.h, which was changing
down_interruptible()'s meaning.

This patch changes all completions so they use the proper APIs and gets
rid of vchiq_killable.h. I took into account Arnd's commit to avoid
merge conflicts.

[1] https://www.spinics.net/lists/arm-kernel/msg694422.html
===

Nicolas Saenz Julienne (3):
  staging: vchiq: switch to wait_for_completion_killable
  staging: vchiq_2835_arm: quit using custom down_interruptible()
  staging: vchiq: delete vchiq_killable.h

 .../interface/vchiq_arm/vchiq_2835_arm.c  |  3 +-
 .../interface/vchiq_arm/vchiq_arm.c   | 22 
 .../interface/vchiq_arm/vchiq_connected.c |  1 -
 .../interface/vchiq_arm/vchiq_core.c  | 22 
 .../interface/vchiq_arm/vchiq_killable.h  | 55 ---
 .../interface/vchiq_arm/vchiq_util.c  |  7 +--
 6 files changed, 24 insertions(+), 86 deletions(-)
 delete mode 100644 
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_killable.h

-- 
2.19.2

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


[PATCH 3/3] staging: vchiq: delete vchiq_killable.h

2018-12-12 Thread Nicolas Saenz Julienne
There are no users for that header file.

Signed-off-by: Nicolas Saenz Julienne 
---
 .../interface/vchiq_arm/vchiq_2835_arm.c  |  1 -
 .../interface/vchiq_arm/vchiq_arm.c   |  1 -
 .../interface/vchiq_arm/vchiq_connected.c |  1 -
 .../interface/vchiq_arm/vchiq_core.c  |  1 -
 .../interface/vchiq_arm/vchiq_killable.h  | 55 ---
 .../interface/vchiq_arm/vchiq_util.c  |  1 -
 6 files changed, 60 deletions(-)
 delete mode 100644 
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_killable.h

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 691038cdfdab..66fbb9ff551a 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -48,7 +48,6 @@
 
 #include "vchiq_arm.h"
 #include "vchiq_connected.h"
-#include "vchiq_killable.h"
 #include "vchiq_pagelist.h"
 
 #define MAX_FRAGMENTS (VCHIQ_NUM_CURRENT_BULKS * 2)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 227c208dd122..acc7b07c7291 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -55,7 +55,6 @@
 #include "vchiq_ioctl.h"
 #include "vchiq_arm.h"
 #include "vchiq_debugfs.h"
-#include "vchiq_killable.h"
 
 #define DEVICE_NAME "vchiq"
 
diff --git 
a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 7ea29665bd0c..7d64e2ed7b42 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -33,7 +33,6 @@
 
 #include "vchiq_connected.h"
 #include "vchiq_core.h"
-#include "vchiq_killable.h"
 #include 
 #include 
 
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index afe2aa5ac3e9..31e69b445b4c 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -32,7 +32,6 @@
  */
 
 #include "vchiq_core.h"
-#include "vchiq_killable.h"
 
 #define VCHIQ_SLOT_HANDLER_STACK 8192
 
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_killable.h 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_killable.h
deleted file mode 100644
index 778063ba312a..
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_killable.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (c) 2010-2012 Broadcom. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions, and the following disclaimer,
- *without modification.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- * 3. The names of the above-listed copyright holders may not be used
- *to endorse or promote products derived from this software without
- *specific prior written permission.
- *
- * ALTERNATIVELY, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2, as published by the Free
- * Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef VCHIQ_KILLABLE_H
-#define VCHIQ_KILLABLE_H
-
-#include 
-#include 
-
-#define SHUTDOWN_SIGS   (sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGQUIT) 
| sigmask(SIGTRAP) | sigmask(SIGSTOP) | sigmask(SIGCONT))
-
-static inline int __must_check down_interruptible_killable(struct semaphore 
*sem)
-{
-   /* Allow interception of killable signals only. We don't want to be 
interrupted by harmless signals like SIGALRM */
-  

[PATCH 2/3] staging: vchiq_2835_arm: quit using custom down_interruptible()

2018-12-12 Thread Nicolas Saenz Julienne
vchi_killable.h overrides down_interruptible() by implementing a
function similar to down_killable(). To make things simpler we turn
calls to down_interruptible() into kernel's implementation of
down_killable().

Signed-off-by: Nicolas Saenz Julienne 
---
 .../staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index ecee54a31f8d..691038cdfdab 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -543,7 +543,7 @@ create_pagelist(char __user *buf, size_t count, unsigned 
short type)
(g_cache_line_size - 1 {
char *fragments;
 
-   if (down_interruptible(&g_free_fragments_sema) != 0) {
+   if (down_killable(&g_free_fragments_sema)) {
cleanup_pagelistinfo(pagelistinfo);
return NULL;
}
-- 
2.19.2

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


Re: [PATCH 0/3] staging: vchiq: fix completion routines & semaphores

2018-12-12 Thread Arnd Bergmann
On Wed, Dec 12, 2018 at 7:54 PM Nicolas Saenz Julienne
 wrote:
>
> As pointed out by Arnd Bergman[1] there where some issues on how I
> converted semaphores to completion routines. I wasn't aware of a
> macro override happening in vchiq_killable.h, which was changing
> down_interruptible()'s meaning.
>
> This patch changes all completions so they use the proper APIs and gets
> rid of vchiq_killable.h. I took into account Arnd's commit to avoid
> merge conflicts.
>

Reviewed-by: Arnd Bergmann 

Thanks for the follow-up!

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


Re: [PATCH] staging: erofs: Add a blank line after declarations

2018-12-12 Thread Gao Xiang
Hi Sungkyung,

On 2018/12/12 23:50, Sungkyung Kim wrote:
> Fix a warning from checkpathch.pl: 'Missing a blank line after
> declarations'
> 
> Signed-off-by: Sungkyung Kim 
> ---
>  drivers/staging/erofs/inode.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
> index 04c61a9d7b76..82b6ad5badff 100644
> --- a/drivers/staging/erofs/inode.c
> +++ b/drivers/staging/erofs/inode.c
> @@ -278,6 +278,7 @@ struct inode *erofs_iget(struct super_block *sb,
>   if (inode->i_state & I_NEW) {
>   int err;
>   struct erofs_vnode *vi = EROFS_V(inode);
> +

Thanks for your patch, is there a only one 'Missing a blank line after 
declarations' in erofs?

If not, could you have time check the other files? That is my personal thought, 
and
I cc-ed the staging mailing list as well.

Thanks,
Gao Xiang

>   vi->nid = nid;
>  
>   err = fill_inode(inode, isdir);
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Hello...

2018-12-12 Thread Susan Williams
Hi,
How are you? I must confess that you're a nice looking gentle man on your 
profile.Are you married?, Can we be friends? 
Susan.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: erofs: Add a blank line after declarations

2018-12-12 Thread Gao Xiang


On 2018/12/13 11:29, 김성경 wrote:
> Thank you. I appreciate it for your prompt reply.
> 
> 
> As a result of checking through 'checkpatch.pl ', there 
> was only one coding style problem in 'erofs / inode.c' file.
> 
> 
> I will check for other files and send the patch file soon.

Yes, if you confirm that this is the only one place, I think this patch is ok 
for me personally. :)

Thanks,
Gao Xiang

> 
> 
> Thanks,
> 
> Sungkyung Kim 
> 
> 
> 2018년 12월 13일 (목) 오전 10:51, Gao Xiang  >님이 작성:
> 
> Hi Sungkyung,
> 
> On 2018/12/12 23:50, Sungkyung Kim wrote:
> > Fix a warning from checkpathch.pl : 'Missing a 
> blank line after
> > declarations'
> >
> > Signed-off-by: Sungkyung Kim  >
> > ---
> >  drivers/staging/erofs/inode.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/staging/erofs/inode.c 
> b/drivers/staging/erofs/inode.c
> > index 04c61a9d7b76..82b6ad5badff 100644
> > --- a/drivers/staging/erofs/inode.c
> > +++ b/drivers/staging/erofs/inode.c
> > @@ -278,6 +278,7 @@ struct inode *erofs_iget(struct super_block *sb,
> >       if (inode->i_state & I_NEW) {
> >               int err;
> >               struct erofs_vnode *vi = EROFS_V(inode);
> > +
> 
> Thanks for your patch, is there a only one 'Missing a blank line after 
> declarations' in erofs?
> 
> If not, could you have time check the other files? That is my personal 
> thought, and
> I cc-ed the staging mailing list as well.
> 
> Thanks,
> Gao Xiang
> 
> >               vi->nid = nid;
> > 
> >               err = fill_inode(inode, isdir);
> >
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH AUTOSEL 4.19 02/73] Input: hyper-v - fix wakeup from suspend-to-idle

2018-12-12 Thread Sasha Levin
From: Vitaly Kuznetsov 

[ Upstream commit 10f91c73cc41ceead210a905dbd196398e99c7d2 ]

It makes little sense but still possible to put Hyper-V guests into
suspend-to-idle state. To wake them up two wakeup sources were registered
in the past: hyperv-keyboard and hid-hyperv. However, since
commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
to pm_wakeup_hard_event() API as these devices are actually the only
possible way to wakeup Hyper-V guests.

Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from 
suspend-to-idle)
Reviewed-by: Rafael J. Wysocki 
Acked-by: K. Y. Srinivasan 
Acked-by: Jiri Kosina 
Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: Dmitry Torokhov 
Signed-off-by: Sasha Levin 
---
 drivers/hid/hid-hyperv.c  | 2 +-
 drivers/input/serio/hyperv-keyboard.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
index b372854cf38d..704049e62d58 100644
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -309,7 +309,7 @@ static void mousevsc_on_receive(struct hv_device *device,
hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
 input_dev->input_buf, len, 1);
 
-   pm_wakeup_event(&input_dev->device->device, 0);
+   pm_wakeup_hard_event(&input_dev->device->device);
 
break;
default:
diff --git a/drivers/input/serio/hyperv-keyboard.c 
b/drivers/input/serio/hyperv-keyboard.c
index 47a0e81a2989..a8b9be3e28db 100644
--- a/drivers/input/serio/hyperv-keyboard.c
+++ b/drivers/input/serio/hyperv-keyboard.c
@@ -177,7 +177,7 @@ static void hv_kbd_on_receive(struct hv_device *hv_dev,
 * state because the Enter-UP can trigger a wakeup at once.
 */
if (!(info & IS_BREAK))
-   pm_wakeup_event(&hv_dev->device, 0);
+   pm_wakeup_hard_event(&hv_dev->device);
 
break;
 
-- 
2.19.1

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


[PATCH AUTOSEL 4.14 02/41] Input: hyper-v - fix wakeup from suspend-to-idle

2018-12-12 Thread Sasha Levin
From: Vitaly Kuznetsov 

[ Upstream commit 10f91c73cc41ceead210a905dbd196398e99c7d2 ]

It makes little sense but still possible to put Hyper-V guests into
suspend-to-idle state. To wake them up two wakeup sources were registered
in the past: hyperv-keyboard and hid-hyperv. However, since
commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
to pm_wakeup_hard_event() API as these devices are actually the only
possible way to wakeup Hyper-V guests.

Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from 
suspend-to-idle)
Reviewed-by: Rafael J. Wysocki 
Acked-by: K. Y. Srinivasan 
Acked-by: Jiri Kosina 
Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: Dmitry Torokhov 
Signed-off-by: Sasha Levin 
---
 drivers/hid/hid-hyperv.c  | 2 +-
 drivers/input/serio/hyperv-keyboard.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
index 6039f071fab1..5f1de24206ab 100644
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -309,7 +309,7 @@ static void mousevsc_on_receive(struct hv_device *device,
hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
 input_dev->input_buf, len, 1);
 
-   pm_wakeup_event(&input_dev->device->device, 0);
+   pm_wakeup_hard_event(&input_dev->device->device);
 
break;
default:
diff --git a/drivers/input/serio/hyperv-keyboard.c 
b/drivers/input/serio/hyperv-keyboard.c
index 25151d9214e0..55288a026e4e 100644
--- a/drivers/input/serio/hyperv-keyboard.c
+++ b/drivers/input/serio/hyperv-keyboard.c
@@ -177,7 +177,7 @@ static void hv_kbd_on_receive(struct hv_device *hv_dev,
 * state because the Enter-UP can trigger a wakeup at once.
 */
if (!(info & IS_BREAK))
-   pm_wakeup_event(&hv_dev->device, 0);
+   pm_wakeup_hard_event(&hv_dev->device);
 
break;
 
-- 
2.19.1

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