Re: [PATCH] staging: most: cdev: fix chrdev_region leak in mod_exit

2019-05-03 Thread Eugeniu Rosca
On Thu, May 02, 2019 at 07:39:20PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 24, 2019 at 09:23:43PM +0200, Eugeniu Rosca wrote:
> > From: Suresh Udipi 
> > 
> > It looks like v4.18-rc1 commit [0] which upstreams mld-1.8.0
> > commit [1] missed to fix the memory leak in mod_exit function.
> > 
> > Do it now.
> > 
> > [0] aba258b7310167 ("staging: most: cdev: fix chrdev_region leak")
> > [1] https://github.com/microchip-ais/linux/commit/a2d8f7ae7ea381
> > ("staging: most: cdev: fix leak for chrdev_region")
> > 
> > Signed-off-by: Suresh Udipi 
> > Signed-off-by: Eugeniu Rosca 
> > Acked-by: Christian Gromm 
> 
> In the future, please use the "correct" way to mark a fixup patch.  For
> this, it would be:
> Fixes: aba258b73101 ("staging: most: cdev: fix chrdev_region leak")
> 
> I'll go add it, and the needed stable tag to the patch when applying it.

Thank you for the suggestion. I'll follow it next time.

> 
> thanks,
> 
> greg k-h

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


[PATCH] staging: most: cdev: fix chrdev_region leak in mod_exit

2019-04-24 Thread Eugeniu Rosca
From: Suresh Udipi 

It looks like v4.18-rc1 commit [0] which upstreams mld-1.8.0
commit [1] missed to fix the memory leak in mod_exit function.

Do it now.

[0] aba258b7310167 ("staging: most: cdev: fix chrdev_region leak")
[1] https://github.com/microchip-ais/linux/commit/a2d8f7ae7ea381
("staging: most: cdev: fix leak for chrdev_region")

Signed-off-by: Suresh Udipi 
Signed-off-by: Eugeniu Rosca 
---
 drivers/staging/most/cdev/cdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c
index f2b347cda8b7..d5f236889021 100644
--- a/drivers/staging/most/cdev/cdev.c
+++ b/drivers/staging/most/cdev/cdev.c
@@ -549,7 +549,7 @@ static void __exit mod_exit(void)
destroy_cdev(c);
destroy_channel(c);
}
-   unregister_chrdev_region(comp.devno, 1);
+   unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE);
ida_destroy(&comp.minor_id);
class_destroy(comp.class);
 }
-- 
2.21.0

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


Re: [PATCH 16/28] staging: most: sound: call snd_card_new with struct device

2019-04-24 Thread Eugeniu Rosca
Hi Christian,

On Tue, 08 May 2018 02:46:44 -0700, Christian Gromm wrote:
> This patch is needed as function snd_card_new needs a valid
> parent device. Passing a NULL pointer leads to kernel Ooops.
> 
> Signed-off-by: Christian Gromm 
> ---
>  drivers/staging/most/core.h| 1 +
>  drivers/staging/most/sound/sound.c | 2 +-
>  drivers/staging/most/usb/usb.c | 1 +
>  3 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/core.h b/drivers/staging/most/core.h
> index 7a3c70bead19..64cc02f161e7 100644
> --- a/drivers/staging/most/core.h
> +++ b/drivers/staging/most/core.h
> @@ -230,6 +230,7 @@ struct mbo {
>   */
>  struct most_interface {
>   struct device dev;
> + struct device *driver_dev;
>   struct module *mod;
>   enum most_interface_type interface;
>   const char *description;
> diff --git a/drivers/staging/most/sound/sound.c 
> b/drivers/staging/most/sound/sound.c
> index 18f722410a63..04c18323c2ea 100644
> --- a/drivers/staging/most/sound/sound.c
> +++ b/drivers/staging/most/sound/sound.c
> @@ -590,7 +590,7 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>   if (ret < 0)
>   return ret;
>  
> - ret = snd_card_new(NULL, -1, card_name, THIS_MODULE,
> + ret = snd_card_new(&iface->dev, -1, card_name, THIS_MODULE,
>  sizeof(*channel), &card);
>   if (ret < 0)
>   return ret;
> diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
> index 5ed1dccc0839..f18726049528 100644
> --- a/drivers/staging/most/usb/usb.c
> +++ b/drivers/staging/most/usb/usb.c
> @@ -1043,6 +1043,7 @@ hdm_probe(struct usb_interface *interface, const struct 
> usb_device_id *id)
>   mdev->link_stat_timer.expires = jiffies + (2 * HZ);
>  
>   mdev->iface.mod = hdm_usb_fops.owner;
> + mdev->iface.driver_dev = &interface->dev;
>   mdev->iface.interface = ITYPE_USB;
>   mdev->iface.configure = hdm_configure_channel;
>   mdev->iface.request_netinfo = hdm_request_netinfo;

Just for your information, when mapping commits from vanilla to those
from https://github.com/microchip-ais/linux/commits/mld-1.8.0, we've
stumbled upon some subtle but striking difference between mld-1.8.0
commit [0] and v4.18-rc1 commit [1]. The latter looks like an upstreamed
version of the former. However, while commit [0] creates a new 'dev'
member in 'struct most_interface' and uses it consistently, commit [1]
creates 'driver_dev' and uses it intermixed with 'dev'.

Since we don't use aim-sound, we just signal this feedback to you
as FWIW without sending a patch (which we can't test).

[0] https://github.com/microchip-ais/linux/commit/2fef0f89f04703
("staging: most: add struct device to most interface")
[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=69c90cf1b2faf5
("staging: most: sound: call snd_card_new with struct device")

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


Re: [PATCH v4 12/12] staging: most: Documentation: update driver documentation

2019-04-17 Thread Eugeniu Rosca
Hi Chris,

We really appreciate your feedback. Thanks for that.

For us going the vanilla way roughly means backporting to v4.14:
 - v5.1-rc5 MOST state (easy/straightforward)
 - MOST patches from either
   https://github.com/CogentEmbedded/meta-rcar/
   or https://github.com/microchip-ais/meta-medialb-rcar
 - A number of patches from mld-1.8.0

>From the above list, the last step looks a bit more painful, but we
will try to deal with that.

If there are any mainline-relevant fixes developed on the way, we hope
to find some time to submit them to you and get feedback.

Best regards,
Eugeniu.

On Wed, Apr 17, 2019 at 01:45:41PM +, christian.gr...@microchip.com wrote:
> On Mo, 2019-04-15 at 23:21 +0200, Eugeniu Rosca wrote:
> > External E-Mail
> > 
> > 
> > Hello Christian, hello Andrey,
> > cc: Vladimir Barinov
> > cc: linux-renesas-soc
> > 
> > Our team currently has the requirement of adding MOST support to
> > the v4.14-based R-Car3 kernel [1], matching the level of features
> > and interfaces of mld-1.8.0 [2] release.
> > 
> > Based on a quick check [3], the mld-1.8.0 release contains 221 non-
> > merge
> > non-mainline commits. It seems like at least some (most?) of them
> > have
> > been reworked during upstreaming and are now part of vanilla, thanks
> > to
> > your efforts.
> > 
> > Since you've actively participated in pushing the out-of-tree drivers
> > to mainline, could you please share your gut feeling whether the
> > current mainline state of the MOST subsystem matches the mld-1.8.0
> > release in terms of features and interfaces?
> > 
> 
> No, it doesn't. The version upstream does not have all the bells
> and whistles the mld-1.8.0 version has, yet. Focus of the latest
> mainline commits was on the driver model and the switch to configfs.
> 
> > At first glance, such mld-1.8.0 functionalities like "flexible PCM
> > rate support" [4], as well as a number of dim2 sysfs entries [5-8]
> > appear to be missing in v5.1-rc5. Could you please feedback if these
> > have been deliberately dropped or didn't make their way for another
> > reason? What would be your recommendation between going the mld-1.8.0
> > and going the v5.1-rc5 way for MOST?
> > 
> 
> The functionalities you're referring to have _not_ intentionally been
> dropped. They will find their way into mainline. If there are urgent
> feature requests, we could prioritize them.
> 
> Bottom line is, the upstream version is the one you should be using,
> as it is going to replace the mld-1.x branch. This is exactly what we
> will soon be doing for AGL by the way.
> 
> thanks,
> Chris
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4 12/12] staging: most: Documentation: update driver documentation

2019-04-15 Thread Eugeniu Rosca
Hello Christian, hello Andrey,
cc: Vladimir Barinov
cc: linux-renesas-soc

Our team currently has the requirement of adding MOST support to
the v4.14-based R-Car3 kernel [1], matching the level of features
and interfaces of mld-1.8.0 [2] release.

Based on a quick check [3], the mld-1.8.0 release contains 221 non-merge
non-mainline commits. It seems like at least some (most?) of them have
been reworked during upstreaming and are now part of vanilla, thanks to
your efforts.

Since you've actively participated in pushing the out-of-tree drivers
to mainline, could you please share your gut feeling whether the
current mainline state of the MOST subsystem matches the mld-1.8.0
release in terms of features and interfaces?

At first glance, such mld-1.8.0 functionalities like "flexible PCM
rate support" [4], as well as a number of dim2 sysfs entries [5-8]
appear to be missing in v5.1-rc5. Could you please feedback if these
have been deliberately dropped or didn't make their way for another
reason? What would be your recommendation between going the mld-1.8.0
and going the v5.1-rc5 way for MOST?

Best regards,
Eugeniu.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/
[2] https://github.com/microchip-ais/linux/releases/tag/mld-1.8.0
[3] git rev-list --no-merges --count  \
$(git merge-base linux/master mld-1.8.0)..mld-1.8.0
221
[4] https://github.com/microchip-ais/linux/commit/8821bad23ff2
("staging: most: aim-sound: add flexible PCM rate support")
[5] https://github.com/microchip-ais/linux/commit/5030f77717a1d7
("staging: most: dim2: add sysfs property dci/node_position")
[6] https://github.com/microchip-ais/linux/commit/3a840d7b504552
("staging: most: dim2: add sysfs property dci/node_address")
[7] https://github.com/microchip-ais/linux/commit/0494ccb4bc5f39
("staging: most: dim2: add sysfs property dci/ni_state")
[8] https://github.com/microchip-ais/linux/commit/3198a5c5f0663
("staging: most: dim2: add sysfs property dci/mep_eui48")
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel