All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: sudeep.holla@arm.com, mturquette@baylibre.com, sboyd@kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, ranjani.vaidyanathan@nxp.com,
	glen.wienecke@nxp.com, nitin.garg_3@nxp.com,
	chuck.cannon@nxp.com, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH V2 2/2] clk: scmi: support state_ctrl_forbidden
Date: Wed, 10 Jan 2024 15:40:25 +0000	[thread overview]
Message-ID: <ZZ66adlVpON9zVbH@pluto> (raw)
In-Reply-To: <20231207093345.581048-2-peng.fan@oss.nxp.com>

On Thu, Dec 07, 2023 at 05:33:45PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Some clocks may exported to linux, while those clocks are not allowed
> to configure by Linux. For example:
> 

Hi,

> SYS_CLK1-----
>              \
> 	     --MUX--->MMC1_CLK
>              /
> SYS_CLK2-----
> 
> MMC1 needs set parent, so SYS_CLK1 and SYS_CLK2 are exported to Linux,
> then the clk propagation will touch SYS_CLK1 or SYS_CLK2.
> So we need bypass the failure for SYS_CLK1 or SYS_CLK2 when enable
> the clock of MMC1.
> 


So I was puzzled a bit at first (as said) by the fact that here we
silently swallow the failure if the SCMI Clock cannot be disabled, BUT
then I spotted in include/linux/clk.h

	/**
	 * clk_enable - inform the system when the clock source should be running.
	 * @clk: clock source
	 *
	 * If the clock can not be enabled/disabled, this should return success.

...so I suppose it is fine for the CLK framework at the end.

My next remaining question is why are you not doing the same when
(ret == -EACCES && clk->info->state_ctrl_forbidden) for atomic_ops ?

I.e. in:

	clk-scmi.c::static int scmi_clk_atomic_enable(struct clk_hw *hw)

Any particular reason (beside not needing it in your particular case...)

Thanks,
Cristian


WARNING: multiple messages have this Message-ID (diff)
From: Cristian Marussi <cristian.marussi@arm.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: sudeep.holla@arm.com, mturquette@baylibre.com, sboyd@kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, ranjani.vaidyanathan@nxp.com,
	glen.wienecke@nxp.com, nitin.garg_3@nxp.com,
	chuck.cannon@nxp.com, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH V2 2/2] clk: scmi: support state_ctrl_forbidden
Date: Wed, 10 Jan 2024 15:40:25 +0000	[thread overview]
Message-ID: <ZZ66adlVpON9zVbH@pluto> (raw)
In-Reply-To: <20231207093345.581048-2-peng.fan@oss.nxp.com>

On Thu, Dec 07, 2023 at 05:33:45PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Some clocks may exported to linux, while those clocks are not allowed
> to configure by Linux. For example:
> 

Hi,

> SYS_CLK1-----
>              \
> 	     --MUX--->MMC1_CLK
>              /
> SYS_CLK2-----
> 
> MMC1 needs set parent, so SYS_CLK1 and SYS_CLK2 are exported to Linux,
> then the clk propagation will touch SYS_CLK1 or SYS_CLK2.
> So we need bypass the failure for SYS_CLK1 or SYS_CLK2 when enable
> the clock of MMC1.
> 


So I was puzzled a bit at first (as said) by the fact that here we
silently swallow the failure if the SCMI Clock cannot be disabled, BUT
then I spotted in include/linux/clk.h

	/**
	 * clk_enable - inform the system when the clock source should be running.
	 * @clk: clock source
	 *
	 * If the clock can not be enabled/disabled, this should return success.

...so I suppose it is fine for the CLK framework at the end.

My next remaining question is why are you not doing the same when
(ret == -EACCES && clk->info->state_ctrl_forbidden) for atomic_ops ?

I.e. in:

	clk-scmi.c::static int scmi_clk_atomic_enable(struct clk_hw *hw)

Any particular reason (beside not needing it in your particular case...)

Thanks,
Cristian


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-01-10 15:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  9:33 [PATCH V2 1/2] firmware: arm_scmi: clock: implement get permissions Peng Fan (OSS)
2023-12-07  9:33 ` Peng Fan (OSS)
2023-12-07  9:33 ` [PATCH V2 2/2] clk: scmi: support state_ctrl_forbidden Peng Fan (OSS)
2023-12-07  9:33   ` Peng Fan (OSS)
2024-01-10 15:40   ` Cristian Marussi [this message]
2024-01-10 15:40     ` Cristian Marussi
2024-01-11  0:07     ` Peng Fan
2024-01-11  0:07       ` Peng Fan
2024-01-09  1:06 ` [PATCH V2 1/2] firmware: arm_scmi: clock: implement get permissions Peng Fan
2024-01-09  1:06   ` Peng Fan
2024-01-09  8:43   ` Cristian Marussi
2024-01-09  8:43     ` Cristian Marussi
2024-01-10 15:19 ` Cristian Marussi
2024-01-10 15:19   ` Cristian Marussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZZ66adlVpON9zVbH@pluto \
    --to=cristian.marussi@arm.com \
    --cc=chuck.cannon@nxp.com \
    --cc=glen.wienecke@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nitin.garg_3@nxp.com \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=ranjani.vaidyanathan@nxp.com \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.