From kamil.lasek at citycodes.pl  Wed Oct  4 00:40:44 2023
From: kamil.lasek at citycodes.pl (Kamil Lasek)
Date: Wed,  4 Oct 2023 07:40:44 GMT
Subject: =?UTF-8?Q?Rozszerzenie_Programu_M=C3=B3j_Pr=C4=85d_5.0?=
Message-ID: <20231004084500-0.1.7v.j0mg.0.1ew5c7c57p@citycodes.pl>

Szanowni Pa?stwo!

W ramach nowej edycji programu M?j Pr?d mog? otrzyma? Pa?stwo dofinansowanie na zakup i monta? fotowoltaiki i/lub magazynu energii. Maksymalna kwota dofinansowania wynosi 58 tys. z?. 

Jako firma wyspecjalizowana w tym zakresie zajmiemy si? Pa?stwa wnioskiem o dofinansowanie oraz instalacj? i serwisem dopasowanych do Pa?stwa budynku paneli s?onecznych.

B?d? wdzi?czny za informacj? czy s? Pa?stwo zainteresowani.


Pozdrawiam,
Kamil Lasek


From umang.jain at ideasonboard.com  Sun Oct  8 23:09:06 2023
From: umang.jain at ideasonboard.com (Umang Jain)
Date: Mon,  9 Oct 2023 11:39:06 +0530
Subject: [PATCH] staging: vc04_services: vchiq_bus: Do not kfree device
Message-ID: <20231009060906.33407-1-umang.jain@ideasonboard.com>

As per device_register() documentation, this kfree() on error path will
crash. The call to put_device() is all that is needed here to free the
memory.

Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 4ac3491efe45..0076d091b9b2 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -73,7 +73,6 @@ vchiq_device_register(struct device *parent, const char *name)
 	if (ret) {
 		dev_err(parent, "Cannot register %s: %d\n", name, ret);
 		put_device(&device->dev);
-		kfree(device);
 		return NULL;
 	}
 
-- 
2.40.1



From gregkh at linuxfoundation.org  Mon Oct  9 03:16:14 2023
From: gregkh at linuxfoundation.org (Greg Kroah-Hartman)
Date: Mon, 9 Oct 2023 12:16:14 +0200
Subject: [PATCH] staging: vc04_services: vchiq_bus: Do not kfree device
In-Reply-To: <20231009060906.33407-1-umang.jain@ideasonboard.com>
References: <20231009060906.33407-1-umang.jain@ideasonboard.com>
Message-ID: <2023100902-common-myself-e3f4@gregkh>

On Mon, Oct 09, 2023 at 11:39:06AM +0530, Umang Jain wrote:
> As per device_register() documentation, this kfree() on error path will
> crash. The call to put_device() is all that is needed here to free the
> memory.
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 1 -
>  1 file changed, 1 deletion(-)

This needs a "Fixes:" tag, right?

thanks,

greg k-h


From umang.jain at ideasonboard.com  Mon Oct  9 03:47:14 2023
From: umang.jain at ideasonboard.com (Umang Jain)
Date: Mon,  9 Oct 2023 16:17:14 +0530
Subject: [PATCH v2] staging: vc04_services: vchiq_bus: Do not kfree device
Message-ID: <20231009104714.142880-1-umang.jain@ideasonboard.com>

As per device_register() documentation, this kfree() on error path will
crash. The call to put_device() is all that is needed here to free the
memory.

Fixes: 027e5703de6b ("staging: vc04_services: vchiq_arm: Add new bus type and device type")
Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 4ac3491efe45..0076d091b9b2 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -73,7 +73,6 @@ vchiq_device_register(struct device *parent, const char *name)
 	if (ret) {
 		dev_err(parent, "Cannot register %s: %d\n", name, ret);
 		put_device(&device->dev);
-		kfree(device);
 		return NULL;
 	}
 
-- 
2.40.1



From gregkh at linuxfoundation.org  Sun Oct 15 09:17:53 2023
From: gregkh at linuxfoundation.org (Greg Kroah-Hartman)
Date: Sun, 15 Oct 2023 18:17:53 +0200
Subject: [PATCH v2] staging: vc04_services: vchiq_bus: Do not kfree device
In-Reply-To: <20231009104714.142880-1-umang.jain@ideasonboard.com>
References: <20231009104714.142880-1-umang.jain@ideasonboard.com>
Message-ID: <2023101540-treason-unbounded-47b6@gregkh>

On Mon, Oct 09, 2023 at 04:17:14PM +0530, Umang Jain wrote:
> As per device_register() documentation, this kfree() on error path will
> crash. The call to put_device() is all that is needed here to free the
> memory.
> 
> Fixes: 027e5703de6b ("staging: vc04_services: vchiq_arm: Add new bus type and device type")
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> index 4ac3491efe45..0076d091b9b2 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> @@ -73,7 +73,6 @@ vchiq_device_register(struct device *parent, const char *name)
>  	if (ret) {
>  		dev_err(parent, "Cannot register %s: %d\n", name, ret);
>  		put_device(&device->dev);
> -		kfree(device);
>  		return NULL;
>  	}
>  
> -- 
> 2.40.1
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/process/submitting-patches.rst for what
  needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot


From umang.jain at ideasonboard.com  Tue Oct 17 22:12:18 2023
From: umang.jain at ideasonboard.com (Umang Jain)
Date: Wed, 18 Oct 2023 10:42:18 +0530
Subject: [PATCH 3/3] staging: vc04_services: bcm2835-camera: Drop
 MODULE_ALIAS
In-Reply-To: <20231017200511.678223-4-umang.jain@ideasonboard.com>
References: <20231017200511.678223-1-umang.jain@ideasonboard.com>
 <20231017200511.678223-4-umang.jain@ideasonboard.com>
Message-ID: <c1a71689-3541-f07b-c390-06f176d9ab5a@ideasonboard.com>

Hi,

On 10/18/23 1:35 AM, Umang Jain wrote:
> Drop MODULE_ALIAS in favour of MODULE_DEVICE_TABLE as the module
> alias should be picked from there.
>
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>   .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c  | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index c873eace1437..3c18376003ff 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -1995,9 +1995,15 @@ static void bcm2835_mmal_remove(struct vchiq_device *device)
>   	vchiq_mmal_finalise(instance);
>   }
>   
> +static const struct vchiq_bus_device_id id_table[] = {
> +	{ .name = "bcm2835-camera" }

This should be terminated with a NULL entry, sending v2 shortly.
> +};
> +MODULE_DEVICE_TABLE(vchiq_bus, id_table);
> +
>   static struct vchiq_driver bcm2835_camera_driver = {
>   	.probe		= bcm2835_mmal_probe,
>   	.remove		= bcm2835_mmal_remove,
> +	.id_table	= id_table,
>   	.driver		= {
>   		.name	= "bcm2835-camera",
>   	},
> @@ -2008,4 +2014,3 @@ module_vchiq_driver(bcm2835_camera_driver)
>   MODULE_DESCRIPTION("Broadcom 2835 MMAL video capture");
>   MODULE_AUTHOR("Vincent Sanders");
>   MODULE_LICENSE("GPL");
> -MODULE_ALIAS("bcm2835-camera");



From umang.jain at ideasonboard.com  Tue Oct 17 22:52:28 2023
From: umang.jain at ideasonboard.com (Umang Jain)
Date: Wed, 18 Oct 2023 11:22:28 +0530
Subject: [PATCH v2] staging: vc04_services: vchiq_bus: Do not kfree device
Message-ID: <20231018055228.825524-1-umang.jain@ideasonboard.com>

As per device_register() documentation, this kfree() on error path will
crash. The call to put_device() is all that is needed here to free the
memory.

Fixes: 027e5703de6b ("staging: vc04_services: vchiq_arm: Add new bus type and device type")
Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
Changes in v2:
- Add a Fixes: tag
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 4ac3491efe45..0076d091b9b2 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -73,7 +73,6 @@ vchiq_device_register(struct device *parent, const char *name)
 	if (ret) {
 		dev_err(parent, "Cannot register %s: %d\n", name, ret);
 		put_device(&device->dev);
-		kfree(device);
 		return NULL;
 	}
 

base-commit: a2fc3e8215313c8e4e42d4b2062830aaf1ef49c0
-- 
2.40.1



From laurent.pinchart at ideasonboard.com  Wed Oct 18 05:38:56 2023
From: laurent.pinchart at ideasonboard.com (Laurent Pinchart)
Date: Wed, 18 Oct 2023 15:38:56 +0300
Subject: [PATCH v2 1/3] staging: vc04_services: Support module
 autoloading using MODULE_DEVICE_TABLE
In-Reply-To: <20231018054214.824296-2-umang.jain@ideasonboard.com>
References: <20231018054214.824296-1-umang.jain@ideasonboard.com>
 <20231018054214.824296-2-umang.jain@ideasonboard.com>
Message-ID: <20231018123856.GG11118@pendragon.ideasonboard.com>

On Wed, Oct 18, 2023 at 11:12:12AM +0530, Umang Jain wrote:
> VC04 has now a independent bus vchiq_bus to register its devices.
> However, the module auto-loading for bcm2835-audio and bcm2835-camera
> currently happens through MODULE_ALIAS() macro specified explicitly.
> 
> The correct way to auto-load a module, is when the alias is picked
> out from MODULE_DEVICE_TABLE(). In order to get there, we need to
> introduce  vchiq_device_id and add relevant entries in file2alias.c
> infrastructure so that aliases can be generated. This patch targets
> adding vchiq_bus_device_id and do_vchiq_bus_entry, in order to
> generate those alias using the /script/mod/file2alias.c.
> 
> Going forward the MODULE_ALIAS() from bcm2835-camera and bcm2835-audio
> will be dropped, in favour of MODULE_DEVICE_TABLE being used there.
> 
> The alias format for vchiq_bus devices will be "vchiq_bus:<dev_name>".
> Adjust the vchiq_bus_uevent() to reflect that.

None of the other buses have a "_bus" suffix in the alias or in the
*_device_id structure name. Is there a reason to make an exception here?

> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  .../vc04_services/interface/vchiq_arm/vchiq_bus.c        | 2 +-
>  .../vc04_services/interface/vchiq_arm/vchiq_bus.h        | 3 +++
>  include/linux/mod_devicetable.h                          | 4 ++++
>  scripts/mod/devicetable-offsets.c                        | 3 +++
>  scripts/mod/file2alias.c                                 | 9 +++++++++
>  5 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> index 4ac3491efe45..b4915bd76387 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> @@ -26,7 +26,7 @@ static int vchiq_bus_uevent(const struct device *dev, struct kobj_uevent_env *en
>  {
>  	const struct vchiq_device *device = container_of_const(dev, struct vchiq_device, dev);
>  
> -	return add_uevent_var(env, "MODALIAS=%s", dev_name(&device->dev));
> +	return add_uevent_var(env, "MODALIAS=vchiq_bus:%s", dev_name(&device->dev));
>  }
>  
>  static int vchiq_bus_probe(struct device *dev)
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> index 7eaaf9a91cda..6e1fbee4b078 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> @@ -7,6 +7,7 @@
>  #define _VCHIQ_DEVICE_H
>  
>  #include <linux/device.h>
> +#include <linux/mod_devicetable.h>
>  
>  struct vchiq_device {
>  	struct device dev;
> @@ -18,6 +19,8 @@ struct vchiq_driver {
>  	int		(*resume)(struct vchiq_device *device);
>  	int		(*suspend)(struct vchiq_device *device,
>  				   pm_message_t state);
> +
> +	const struct vchiq_bus_device_id *id_table;
>  	struct device_driver driver;
>  };
>  
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index b0678b093cb2..f01e175f7f3d 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -946,4 +946,8 @@ struct cdx_device_id {
>  	__u32 override_only;
>  };
>  
> +struct vchiq_bus_device_id {
> +	char name[32];
> +};
> +
>  #endif /* LINUX_MOD_DEVICETABLE_H */
> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
> index abe65f8968dd..c9a02d2c4f9e 100644
> --- a/scripts/mod/devicetable-offsets.c
> +++ b/scripts/mod/devicetable-offsets.c
> @@ -267,5 +267,8 @@ int main(void)
>  	DEVID_FIELD(cdx_device_id, device);
>  	DEVID_FIELD(cdx_device_id, override_only);
>  
> +	DEVID(vchiq_bus_device_id);
> +	DEVID_FIELD(vchiq_bus_device_id, name);
> +
>  	return 0;
>  }
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 38120f932b0d..6908dc70b649 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -1478,6 +1478,14 @@ static int do_cdx_entry(const char *filename, void *symval,
>  	return 1;
>  }
>  
> +static int do_vchiq_bus_entry(const char *filename, void *symval, char *alias)
> +{
> +	DEF_FIELD_ADDR(symval, vchiq_bus_device_id, name);
> +	sprintf(alias, "vchiq_bus:%s", *name);
> +
> +	return 1;
> +}
> +
>  /* Does namelen bytes of name exactly match the symbol? */
>  static bool sym_is(const char *name, unsigned namelen, const char *symbol)
>  {
> @@ -1558,6 +1566,7 @@ static const struct devtable devtable[] = {
>  	{"dfl", SIZE_dfl_device_id, do_dfl_entry},
>  	{"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},
>  	{"cdx", SIZE_cdx_device_id, do_cdx_entry},
> +	{"vchiq_bus", SIZE_vchiq_bus_device_id, do_vchiq_bus_entry},
>  };
>  
>  /* Create MODULE_ALIAS() statements.

-- 
Regards,

Laurent Pinchart


From laurent.pinchart at ideasonboard.com  Wed Oct 18 05:41:13 2023
From: laurent.pinchart at ideasonboard.com (Laurent Pinchart)
Date: Wed, 18 Oct 2023 15:41:13 +0300
Subject: [PATCH v2 2/3] staging: vc04_services: bcm2835-audio: Drop
 MODULE_ALIAS
In-Reply-To: <20231018054214.824296-3-umang.jain@ideasonboard.com>
References: <20231018054214.824296-1-umang.jain@ideasonboard.com>
 <20231018054214.824296-3-umang.jain@ideasonboard.com>
Message-ID: <20231018124113.GH11118@pendragon.ideasonboard.com>

Hi Umang,

Thank you for the patch.

On Wed, Oct 18, 2023 at 11:12:13AM +0530, Umang Jain wrote:
> Drop MODULE_ALIAS in favour of MODULE_DEVICE_TABLE as the module
> alias should be dropped from there.
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
> index 06bdc7673d4b..d5bd8a36a010 100644
> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
> @@ -311,12 +311,19 @@ static int snd_bcm2835_alsa_resume(struct vchiq_device *device)
>  
>  #endif
>  
> +static struct vchiq_bus_device_id device_id_table[] = {
> +	{ .name = "bcm2835-audio" },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(vchiq_bus, device_id_table);

With the "_bus" suffix dropped (see review of 1/3),

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> +
>  static struct vchiq_driver bcm2835_alsa_driver = {
>  	.probe = snd_bcm2835_alsa_probe,
>  #ifdef CONFIG_PM
>  	.suspend = snd_bcm2835_alsa_suspend,
>  	.resume = snd_bcm2835_alsa_resume,
>  #endif
> +	.id_table = device_id_table,
>  	.driver = {
>  		.name = "bcm2835-audio",
>  	},
> @@ -326,4 +333,3 @@ module_vchiq_driver(bcm2835_alsa_driver);
>  MODULE_AUTHOR("Dom Cobley");
>  MODULE_DESCRIPTION("Alsa driver for BCM2835 chip");
>  MODULE_LICENSE("GPL");
> -MODULE_ALIAS("bcm2835-audio");

-- 
Regards,

Laurent Pinchart


From laurent.pinchart at ideasonboard.com  Wed Oct 18 05:42:29 2023
From: laurent.pinchart at ideasonboard.com (Laurent Pinchart)
Date: Wed, 18 Oct 2023 15:42:29 +0300
Subject: [PATCH v2 3/3] staging: vc04_services: bcm2835-camera: Drop
 MODULE_ALIAS
In-Reply-To: <20231018054214.824296-4-umang.jain@ideasonboard.com>
References: <20231018054214.824296-1-umang.jain@ideasonboard.com>
 <20231018054214.824296-4-umang.jain@ideasonboard.com>
Message-ID: <20231018124229.GI11118@pendragon.ideasonboard.com>

Hi Umang,

Thank you for the patch.

On Wed, Oct 18, 2023 at 11:12:14AM +0530, Umang Jain wrote:
> Drop MODULE_ALIAS in favour of MODULE_DEVICE_TABLE as the module
> alias should be picked from there.
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index c873eace1437..44901aab637b 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -1995,9 +1995,16 @@ static void bcm2835_mmal_remove(struct vchiq_device *device)
>  	vchiq_mmal_finalise(instance);
>  }
>  
> +static const struct vchiq_bus_device_id id_table[] = {
> +	{ .name = "bcm2835-camera" },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(vchiq_bus, id_table);

With the "_bus" suffix dropped (see review of 1/3),

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> +
>  static struct vchiq_driver bcm2835_camera_driver = {
>  	.probe		= bcm2835_mmal_probe,
>  	.remove		= bcm2835_mmal_remove,
> +	.id_table	= id_table,
>  	.driver		= {
>  		.name	= "bcm2835-camera",
>  	},
> @@ -2008,4 +2015,3 @@ module_vchiq_driver(bcm2835_camera_driver)
>  MODULE_DESCRIPTION("Broadcom 2835 MMAL video capture");
>  MODULE_AUTHOR("Vincent Sanders");
>  MODULE_LICENSE("GPL");
> -MODULE_ALIAS("bcm2835-camera");

-- 
Regards,

Laurent Pinchart


From gregkh at linuxfoundation.org  Wed Oct 18 06:22:18 2023
From: gregkh at linuxfoundation.org (Greg Kroah-Hartman)
Date: Wed, 18 Oct 2023 15:22:18 +0200
Subject: [PATCH v2 1/3] staging: vc04_services: Support module
 autoloading using MODULE_DEVICE_TABLE
In-Reply-To: <20231018123856.GG11118@pendragon.ideasonboard.com>
References: <20231018054214.824296-1-umang.jain@ideasonboard.com>
 <20231018054214.824296-2-umang.jain@ideasonboard.com>
 <20231018123856.GG11118@pendragon.ideasonboard.com>
Message-ID: <2023101803-blank-relative-aa47@gregkh>

On Wed, Oct 18, 2023 at 03:38:56PM +0300, Laurent Pinchart wrote:
> On Wed, Oct 18, 2023 at 11:12:12AM +0530, Umang Jain wrote:
> > VC04 has now a independent bus vchiq_bus to register its devices.
> > However, the module auto-loading for bcm2835-audio and bcm2835-camera
> > currently happens through MODULE_ALIAS() macro specified explicitly.
> > 
> > The correct way to auto-load a module, is when the alias is picked
> > out from MODULE_DEVICE_TABLE(). In order to get there, we need to
> > introduce  vchiq_device_id and add relevant entries in file2alias.c
> > infrastructure so that aliases can be generated. This patch targets
> > adding vchiq_bus_device_id and do_vchiq_bus_entry, in order to
> > generate those alias using the /script/mod/file2alias.c.
> > 
> > Going forward the MODULE_ALIAS() from bcm2835-camera and bcm2835-audio
> > will be dropped, in favour of MODULE_DEVICE_TABLE being used there.
> > 
> > The alias format for vchiq_bus devices will be "vchiq_bus:<dev_name>".
> > Adjust the vchiq_bus_uevent() to reflect that.
> 
> None of the other buses have a "_bus" suffix in the alias or in the
> *_device_id structure name. Is there a reason to make an exception here?

No, it should be dropped, good catch.

thanks,

greg k-h


From laurent.pinchart at ideasonboard.com  Thu Oct 19 04:07:10 2023
From: laurent.pinchart at ideasonboard.com (Laurent Pinchart)
Date: Thu, 19 Oct 2023 14:07:10 +0300
Subject: [PATCH v3 1/3] staging: vc04_services: Support module
 autoloading using MODULE_DEVICE_TABLE
In-Reply-To: <20231019090128.430297-2-umang.jain@ideasonboard.com>
References: <20231019090128.430297-1-umang.jain@ideasonboard.com>
 <20231019090128.430297-2-umang.jain@ideasonboard.com>
Message-ID: <20231019110710.GE14832@pendragon.ideasonboard.com>

Hi Umang,

Thank you for the patch.

On Thu, Oct 19, 2023 at 02:31:26PM +0530, Umang Jain wrote:
> VC04 has now a independent bus vchiq_bus to register its devices.
> However, the module auto-loading for bcm2835-audio and bcm2835-camera
> currently happens through MODULE_ALIAS() macro specified explicitly.
> 
> The correct way to auto-load a module, is when the alias is picked
> out from MODULE_DEVICE_TABLE(). In order to get there, we need to
> introduce  vchiq_device_id and add relevant entries in file2alias.c
> infrastructure so that aliases can be generated. This patch targets
> adding vchiq_device_id and do_vchiq_entry, in order to
> generate those alias using the /script/mod/file2alias.c.
> 
> Going forward the MODULE_ALIAS() from bcm2835-camera and bcm2835-audio
> will be dropped, in favour of MODULE_DEVICE_TABLE being used there.
> 
> The alias format for vchiq_bus devices will be "vchiq:<dev_name>".
> Adjust the vchiq_bus_uevent() to reflect that.
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  .../vc04_services/interface/vchiq_arm/vchiq_bus.c        | 2 +-
>  .../vc04_services/interface/vchiq_arm/vchiq_bus.h        | 3 +++
>  include/linux/mod_devicetable.h                          | 4 ++++
>  scripts/mod/devicetable-offsets.c                        | 3 +++
>  scripts/mod/file2alias.c                                 | 9 +++++++++
>  5 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> index 4ac3491efe45..8e40e006f14b 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
> @@ -26,7 +26,7 @@ static int vchiq_bus_uevent(const struct device *dev, struct kobj_uevent_env *en
>  {
>  	const struct vchiq_device *device = container_of_const(dev, struct vchiq_device, dev);
>  
> -	return add_uevent_var(env, "MODALIAS=%s", dev_name(&device->dev));
> +	return add_uevent_var(env, "MODALIAS=vchiq:%s", dev_name(&device->dev));
>  }
>  
>  static int vchiq_bus_probe(struct device *dev)
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> index 7eaaf9a91cda..caa6fdf25bb1 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
> @@ -7,6 +7,7 @@
>  #define _VCHIQ_DEVICE_H
>  
>  #include <linux/device.h>
> +#include <linux/mod_devicetable.h>
>  
>  struct vchiq_device {
>  	struct device dev;
> @@ -18,6 +19,8 @@ struct vchiq_driver {
>  	int		(*resume)(struct vchiq_device *device);
>  	int		(*suspend)(struct vchiq_device *device,
>  				   pm_message_t state);
> +
> +	const struct vchiq_device_id *id_table;
>  	struct device_driver driver;
>  };
>  
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index b0678b093cb2..700cbf34c3b8 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -946,4 +946,8 @@ struct cdx_device_id {
>  	__u32 override_only;
>  };
>  
> +struct vchiq_device_id {
> +	char name[32];
> +};
> +
>  #endif /* LINUX_MOD_DEVICETABLE_H */
> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
> index abe65f8968dd..e8aadc780da5 100644
> --- a/scripts/mod/devicetable-offsets.c
> +++ b/scripts/mod/devicetable-offsets.c
> @@ -267,5 +267,8 @@ int main(void)
>  	DEVID_FIELD(cdx_device_id, device);
>  	DEVID_FIELD(cdx_device_id, override_only);
>  
> +	DEVID(vchiq_device_id);
> +	DEVID_FIELD(vchiq_device_id, name);
> +
>  	return 0;
>  }
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 38120f932b0d..78dfae5a8720 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -1478,6 +1478,14 @@ static int do_cdx_entry(const char *filename, void *symval,
>  	return 1;
>  }
>  
> +static int do_vchiq_entry(const char *filename, void *symval, char *alias)
> +{
> +	DEF_FIELD_ADDR(symval, vchiq_device_id, name);
> +	sprintf(alias, "vchiq:%s", *name);
> +
> +	return 1;
> +}
> +
>  /* Does namelen bytes of name exactly match the symbol? */
>  static bool sym_is(const char *name, unsigned namelen, const char *symbol)
>  {
> @@ -1558,6 +1566,7 @@ static const struct devtable devtable[] = {
>  	{"dfl", SIZE_dfl_device_id, do_dfl_entry},
>  	{"ishtp", SIZE_ishtp_device_id, do_ishtp_entry},
>  	{"cdx", SIZE_cdx_device_id, do_cdx_entry},
> +	{"vchiq", SIZE_vchiq_device_id, do_vchiq_entry},
>  };
>  
>  /* Create MODULE_ALIAS() statements.
> -- 
> 2.40.1
> 

-- 
Regards,

Laurent Pinchart


From stefan.wahren at i2se.com  Thu Oct 19 11:18:58 2023
From: stefan.wahren at i2se.com (Stefan Wahren)
Date: Thu, 19 Oct 2023 20:18:58 +0200
Subject: [PATCH v2] staging: vc04_services: vchiq_bus: Do not kfree device
In-Reply-To: <20231018055228.825524-1-umang.jain@ideasonboard.com>
References: <20231018055228.825524-1-umang.jain@ideasonboard.com>
Message-ID: <0020ed1e-9a89-4c63-a3a2-4c506ba33865@i2se.com>

Am 18.10.23 um 07:52 schrieb Umang Jain:
> As per device_register() documentation, this kfree() on error path will
> crash. The call to put_device() is all that is needed here to free the
> memory.
> 
> Fixes: 027e5703de6b ("staging: vc04_services: vchiq_arm: Add new bus type and device type")
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>

Reviewed-by: Stefan Wahren <stefan.wahren at i2se.com>


From gopal.srivastava at sahara.in  Sun Oct 22 07:17:08 2023
From: gopal.srivastava at sahara.in (Easy Credit)
Date: Sun, 22 Oct 2023 07:17:08 -0700
Subject: Loans at your finger tip
Message-ID: <20231022141711.12FDE178AB5@mta2.sahara.in>

Looking for instant cash loans in your city? Worry not; EasyCapital presents instant loan service within 72 hours! EasyCapital offers instant loan with minimal documentation requirements.Indicate your interest and we will give you a good deal! For more info email us now. Email:julietreitmann at gmail.com



From kamil.lasek at citycodes.pl  Tue Oct 24 01:15:29 2023
From: kamil.lasek at citycodes.pl (Kamil Lasek)
Date: Tue, 24 Oct 2023 08:15:29 GMT
Subject: Wycena paneli fotowoltaicznych
Message-ID: <20231024084500-0.1.8a.l8yk.0.3rx00go3sz@citycodes.pl>

Dzie? dobry,

dostrzegam mo?liwo?? wsp??pracy z Pa?stwa firm?.

?wiadczymy kompleksow? obs?ug? inwestycji w fotowoltaik?, kt?ra obni?a koszty energii elektrycznej.

Czy s? Pa?stwo zainteresowani weryfikacj? wst?pnych propozycji?


Pozdrawiam,
Kamil Lasek


From laurent.pinchart at ideasonboard.com  Wed Oct 25 03:46:30 2023
From: laurent.pinchart at ideasonboard.com (Laurent Pinchart)
Date: Wed, 25 Oct 2023 13:46:30 +0300
Subject: [PATCH 2/2] staging: vc04_services: Drop completed TODO item
In-Reply-To: <20231025103300.340572-3-umang.jain@ideasonboard.com>
References: <20231025103300.340572-1-umang.jain@ideasonboard.com>
 <20231025103300.340572-3-umang.jain@ideasonboard.com>
Message-ID: <20231025104630.GB481@pendragon.ideasonboard.com>

On Wed, Oct 25, 2023 at 06:33:00AM -0400, Umang Jain wrote:
> Memory barries and remote_event_*() are documented.
> Drop the TODO item related to them.
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  drivers/staging/vc04_services/interface/TODO | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/TODO b/drivers/staging/vc04_services/interface/TODO
> index 9c79ed549831..2d51f6928e0f 100644
> --- a/drivers/staging/vc04_services/interface/TODO
> +++ b/drivers/staging/vc04_services/interface/TODO
> @@ -33,13 +33,6 @@ such as dev_info, dev_dbg, and friends.
>  A short top-down description of this driver's architecture (function of
>  kthreads, userspace, limitations) could be very helpful for reviewers.
>  
> -* Review and comment memory barriers
> -
> -There is a heavy use of memory barriers in this driver, it would be very
> -beneficial to go over all of them and, if correct, comment on their merits.
> -Extra points to whomever confidently reviews the remote_event_*() family of
> -functions.
> -

Is vchiq so timing sensitive that it can't afford spinlocks ?

>  * Reformat core code with more sane indentations
>  
>  The code follows the 80 characters limitation yet tends to go 3 or 4 levels of

-- 
Regards,

Laurent Pinchart


From andi.shyti at kernel.org  Tue Oct 31 04:43:39 2023
From: andi.shyti at kernel.org (Andi Shyti)
Date: Tue, 31 Oct 2023 12:43:39 +0100
Subject: [PATCH 1/2] [i2c-bcm2835] Fully clean up hardware state machine
 after a timeout
In-Reply-To: <20231030162114.3603829-2-mike.isely@cobaltdigital.com>
References: <20231030162114.3603829-1-mike.isely@cobaltdigital.com>
 <20231030162114.3603829-2-mike.isely@cobaltdigital.com>
Message-ID: <20231031114339.nutx2q2vtwbaaw6h@zenone.zhora.eu>

Hi Mike,

> When the driver detects a timeout, there's no guarantee that the ISR
> would have fired.  Thus after a timeout, it's the foreground that
> becomes responsible to reset the hardware state machine.  The change
> here just duplicates what is already implemented in the ISR.

Is this a fix? What failing here?

Can we have a feedback from Florian, Ray or Scott here?

...

>  	if (!time_left) {
> +		/* Since we can't trust the ISR to have cleaned up, do the
> +		 * full cleanup here... */

Please use the

	/*
	 * comment
	 * comment
	 */

format

>  		bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C,
>  				   BCM2835_I2C_C_CLEAR);
> +		bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, BCM2835_I2C_S_CLKT |
> +				   BCM2835_I2C_S_ERR | BCM2835_I2C_S_DONE);

I'm not sure this is really making any difference though. How
have you tested this?

Have you tried reading those registers before and understand what
went wrong?

Andi



