Hotjoin require clock running and enable SLVSTART irq.
Add module parameter 'hotjoin' to disable hotjoin and enable runtime_pm to
save power.
Signed-off-by: Frank Li <[email protected]>
---
drivers/i3c/master/svc-i3c-master.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index 18bc277edc8a..f0d99b029e5f 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -128,6 +128,9 @@
/* This parameter depends on the implementation and may be tuned */
#define SVC_I3C_FIFO_SIZE 16
+static bool hotjoin = true;
+module_param(hotjoin, bool, S_IRUGO | S_IWUSR);
+
struct svc_i3c_cmd {
u8 addr;
bool rnw;
@@ -1623,8 +1626,12 @@ static int svc_i3c_master_probe(struct platform_device *pdev)
if (ret)
goto rpm_disable;
- pm_runtime_mark_last_busy(&pdev->dev);
- pm_runtime_put_autosuspend(&pdev->dev);
+ if (hotjoin) {
+ svc_i3c_master_enable_interrupts(master, SVC_I3C_MINT_SLVSTART);
+ } else {
+ pm_runtime_mark_last_busy(&pdev->dev);
+ pm_runtime_put_autosuspend(&pdev->dev);
+ }
return 0;
--
2.34.1
On Mon, 2023-10-16 at 11:46 -0400, Frank Li wrote:
> Hotjoin require clock running and enable SLVSTART irq.
> Add module parameter 'hotjoin' to disable hotjoin and enable runtime_pm to
> save power.
[]
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
[]
> @@ -128,6 +128,9 @@
> /* This parameter depends on the implementation and may be tuned */
> #define SVC_I3C_FIFO_SIZE 16
>
> +static bool hotjoin = true;
> +module_param(hotjoin, bool, S_IRUGO | S_IWUSR);
Might be nicer using 0644
Consider using checkpatch --strict on the series.
Hi Frank,
[email protected] wrote on Mon, 16 Oct 2023 11:46:28 -0400:
> Hotjoin require clock running and enable SLVSTART irq.
> Add module parameter 'hotjoin' to disable hotjoin and enable runtime_pm to
> save power.
I am really not a big fan of the use of modules parameters. Maybe it
makes sense here. Alex, a better idea?
Thanks,
Miquèl
On Tue, Oct 17, 2023 at 04:04:57PM +0200, Miquel Raynal wrote:
> Hi Frank,
>
> [email protected] wrote on Mon, 16 Oct 2023 11:46:28 -0400:
>
> > Hotjoin require clock running and enable SLVSTART irq.
> > Add module parameter 'hotjoin' to disable hotjoin and enable runtime_pm to
> > save power.
>
> I am really not a big fan of the use of modules parameters. Maybe it
> makes sense here. Alex, a better idea?
Maybe we can create sys entry to enable/disable hotjoin. I think i3c
should default support hotjoin, but it exist user case that needn't hj and
want more aggressive power saving.
If create /sys/ entry, it need change driver/i3c/master.c.
Frank
>
> Thanks,
> Miqu?l
Hello,
On 17/10/2023 10:51:25-0400, Frank Li wrote:
> On Tue, Oct 17, 2023 at 04:04:57PM +0200, Miquel Raynal wrote:
> > Hi Frank,
> >
> > [email protected] wrote on Mon, 16 Oct 2023 11:46:28 -0400:
> >
> > > Hotjoin require clock running and enable SLVSTART irq.
> > > Add module parameter 'hotjoin' to disable hotjoin and enable runtime_pm to
> > > save power.
> >
> > I am really not a big fan of the use of modules parameters. Maybe it
> > makes sense here. Alex, a better idea?
>
> Maybe we can create sys entry to enable/disable hotjoin. I think i3c
> should default support hotjoin, but it exist user case that needn't hj and
> want more aggressive power saving.
>
> If create /sys/ entry, it need change driver/i3c/master.c.
>
If this can be changed dynamically, I guess ideally, we should be able
to set it independently per controller so it could be disabled on a bus
but kept enabled on others.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com