2023-10-16 15:47:19

by Frank Li

[permalink] [raw]
Subject: [PATCH 1/5] i3c: master: svc: enable hotjoin default

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


2023-10-17 06:49:08

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 1/5] i3c: master: svc: enable hotjoin default

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.

2023-10-17 14:05:17

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH 1/5] i3c: master: svc: enable hotjoin default

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

2023-10-17 15:07:31

by Frank Li

[permalink] [raw]
Subject: Re: [PATCH 1/5] i3c: master: svc: enable hotjoin default

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

2023-10-17 22:22:48

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH 1/5] i3c: master: svc: enable hotjoin default

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