diff mbox series

[06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback

Message ID 20240212123233.1230090-7-cristian.marussi@arm.com (mailing list archive)
State New, archived
Headers show
Series Add SCMI core checks for notification support. | expand

Commit Message

Cristian Marussi Feb. 12, 2024, 12:32 p.m. UTC
Add a preliminary check to verify if Clock-related notify enable commands
are supported at all by the running platform, and then provide the callback
needed to allow the core SCMI notification subsytem to fine-grain check if
a specific resource domain supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 drivers/firmware/arm_scmi/clock.c | 47 ++++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 4 deletions(-)

Comments

kernel test robot Feb. 12, 2024, 11 p.m. UTC | #1
Hi Cristian,

kernel test robot noticed the following build errors:

[auto build test ERROR on soc/for-next]
[also build test ERROR on linus/master v6.8-rc4 next-20240212]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Marussi/firmware-arm_scmi-Check-for-notification-support/20240212-203727
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link:    https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi%40arm.com
patch subject: [PATCH 06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240213/202402130607.H0A5KJ1C-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402130607.H0A5KJ1C-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402130607.H0A5KJ1C-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/firmware/arm_scmi/clock.c: In function 'scmi_clk_notify_supported':
>> drivers/firmware/arm_scmi/clock.c:853:15: error: implicit declaration of function 'scmi_clock_domain_lookup' [-Werror=implicit-function-declaration]
     853 |         clk = scmi_clock_domain_lookup(ci, src_id);
         |               ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/firmware/arm_scmi/clock.c:853:13: warning: assignment to 'struct scmi_clock_info *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     853 |         clk = scmi_clock_domain_lookup(ci, src_id);
         |             ^
   cc1: some warnings being treated as errors


vim +/scmi_clock_domain_lookup +853 drivers/firmware/arm_scmi/clock.c

   842	
   843	static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
   844					      u8 evt_id, u32 src_id)
   845	{
   846		bool supported;
   847		struct scmi_clock_info *clk;
   848		struct clock_info *ci = ph->get_priv(ph);
   849	
   850		if (evt_id >= ARRAY_SIZE(evt_2_cmd))
   851			return false;
   852	
 > 853		clk = scmi_clock_domain_lookup(ci, src_id);
   854		if (IS_ERR(clk))
   855			return false;
   856	
   857		if (evt_id == SCMI_EVENT_CLOCK_RATE_CHANGED)
   858			supported = clk->rate_changed_notifications;
   859		else
   860			supported = clk->rate_change_requested_notifications;
   861	
   862		return supported;
   863	}
   864
kernel test robot Feb. 12, 2024, 11:20 p.m. UTC | #2
Hi Cristian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on soc/for-next]
[also build test WARNING on linus/master v6.8-rc4 next-20240212]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Marussi/firmware-arm_scmi-Check-for-notification-support/20240212-203727
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link:    https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi%40arm.com
patch subject: [PATCH 06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240213/202402130758.vkfAqrx0-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402130758.vkfAqrx0-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402130758.vkfAqrx0-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/firmware/arm_scmi/clock.c:853:8: error: implicit declaration of function 'scmi_clock_domain_lookup' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           clk = scmi_clock_domain_lookup(ci, src_id);
                 ^
>> drivers/firmware/arm_scmi/clock.c:853:6: warning: incompatible integer to pointer conversion assigning to 'struct scmi_clock_info *' from 'int' [-Wint-conversion]
           clk = scmi_clock_domain_lookup(ci, src_id);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.


vim +853 drivers/firmware/arm_scmi/clock.c

   842	
   843	static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
   844					      u8 evt_id, u32 src_id)
   845	{
   846		bool supported;
   847		struct scmi_clock_info *clk;
   848		struct clock_info *ci = ph->get_priv(ph);
   849	
   850		if (evt_id >= ARRAY_SIZE(evt_2_cmd))
   851			return false;
   852	
 > 853		clk = scmi_clock_domain_lookup(ci, src_id);
   854		if (IS_ERR(clk))
   855			return false;
   856	
   857		if (evt_id == SCMI_EVENT_CLOCK_RATE_CHANGED)
   858			supported = clk->rate_changed_notifications;
   859		else
   860			supported = clk->rate_change_requested_notifications;
   861	
   862		return supported;
   863	}
   864
kernel test robot Feb. 13, 2024, 2:58 a.m. UTC | #3
Hi Cristian,

kernel test robot noticed the following build errors:

[auto build test ERROR on soc/for-next]
[also build test ERROR on linus/master v6.8-rc4 next-20240212]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Marussi/firmware-arm_scmi-Check-for-notification-support/20240212-203727
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link:    https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi%40arm.com
patch subject: [PATCH 06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project c08b90c50bcac9f3f563c79491c8dbcbe7c3b574)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402131047.2NVZWHma-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/firmware/arm_scmi/clock.c:853:8: error: call to undeclared function 'scmi_clock_domain_lookup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     853 |         clk = scmi_clock_domain_lookup(ci, src_id);
         |               ^
>> drivers/firmware/arm_scmi/clock.c:853:6: error: incompatible integer to pointer conversion assigning to 'struct scmi_clock_info *' from 'int' [-Wint-conversion]
     853 |         clk = scmi_clock_domain_lookup(ci, src_id);
         |             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   2 errors generated.


vim +/scmi_clock_domain_lookup +853 drivers/firmware/arm_scmi/clock.c

   842	
   843	static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
   844					      u8 evt_id, u32 src_id)
   845	{
   846		bool supported;
   847		struct scmi_clock_info *clk;
   848		struct clock_info *ci = ph->get_priv(ph);
   849	
   850		if (evt_id >= ARRAY_SIZE(evt_2_cmd))
   851			return false;
   852	
 > 853		clk = scmi_clock_domain_lookup(ci, src_id);
   854		if (IS_ERR(clk))
   855			return false;
   856	
   857		if (evt_id == SCMI_EVENT_CLOCK_RATE_CHANGED)
   858			supported = clk->rate_changed_notifications;
   859		else
   860			supported = clk->rate_change_requested_notifications;
   861	
   862		return supported;
   863	}
   864
Cristian Marussi Feb. 13, 2024, 8:49 a.m. UTC | #4
On Tue, Feb 13, 2024 at 10:58:23AM +0800, kernel test robot wrote:
> Hi Cristian,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on soc/for-next]
> [also build test ERROR on linus/master v6.8-rc4 next-20240212]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 

Hi,

this series, as stated in the cover-letter, is based off the current tip of

	sudeep/for-next/scmi/updates

and particularly needs commit:

	9c5bc650031e firmware: arm_scmi: Rework clock domain info lookups

from there, since it contains the missing scmi_clock_domain_lookup().

Not_sure/dont_known if there is any way to convey this "based-on-branch"
info to your/any CI at the moment.

Thanks,
Cristian

> url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Marussi/firmware-arm_scmi-Check-for-notification-support/20240212-203727
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
> patch link:    https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi%40arm.com
> patch subject: [PATCH 06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback
> config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/config)
> compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project c08b90c50bcac9f3f563c79491c8dbcbe7c3b574)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202402131047.2NVZWHma-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/firmware/arm_scmi/clock.c:853:8: error: call to undeclared function 'scmi_clock_domain_lookup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>      853 |         clk = scmi_clock_domain_lookup(ci, src_id);
>          |               ^
> >> drivers/firmware/arm_scmi/clock.c:853:6: error: incompatible integer to pointer conversion assigning to 'struct scmi_clock_info *' from 'int' [-Wint-conversion]
>      853 |         clk = scmi_clock_domain_lookup(ci, src_id);
>          |             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    2 errors generated.
> 
> 
> vim +/scmi_clock_domain_lookup +853 drivers/firmware/arm_scmi/clock.c
> 
>    842	
>    843	static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
>    844					      u8 evt_id, u32 src_id)
>    845	{
>    846		bool supported;
>    847		struct scmi_clock_info *clk;
>    848		struct clock_info *ci = ph->get_priv(ph);
>    849	
>    850		if (evt_id >= ARRAY_SIZE(evt_2_cmd))
>    851			return false;
>    852	
>  > 853		clk = scmi_clock_domain_lookup(ci, src_id);
>    854		if (IS_ERR(clk))
>    855			return false;
>    856	
>    857		if (evt_id == SCMI_EVENT_CLOCK_RATE_CHANGED)
>    858			supported = clk->rate_changed_notifications;
>    859		else
>    860			supported = clk->rate_change_requested_notifications;
>    861	
>    862		return supported;
>    863	}
>    864	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
Nikunj Kela Feb. 13, 2024, 6:24 p.m. UTC | #5
On 2/13/2024 12:49 AM, Cristian Marussi wrote:
> On Tue, Feb 13, 2024 at 10:58:23AM +0800, kernel test robot wrote:
>> Hi Cristian,
>>
>> kernel test robot noticed the following build errors:
>>
>> [auto build test ERROR on soc/for-next]
>> [also build test ERROR on linus/master v6.8-rc4 next-20240212]
>> [If your patch is applied to the wrong git tree, kindly drop us a note.
>> And when submitting patch, we suggest to use '--base' as documented in
>> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>>
> Hi,
>
> this series, as stated in the cover-letter, is based off the current tip of
>
> 	sudeep/for-next/scmi/updates
>
> and particularly needs commit:
>
> 	9c5bc650031e firmware: arm_scmi: Rework clock domain info lookups
>
> from there, since it contains the missing scmi_clock_domain_lookup().
>
> Not_sure/dont_known if there is any way to convey this "based-on-branch"
> info to your/any CI at the moment.
>
> Thanks,
> Cristian
Maybe add supdeep's tree in MAINTAINERS and use 'base-commit'.
>> url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Marussi/firmware-arm_scmi-Check-for-notification-support/20240212-203727
>> base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
>> patch link:    https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi%40arm.com
>> patch subject: [PATCH 06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback
>> config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/config)
>> compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project c08b90c50bcac9f3f563c79491c8dbcbe7c3b574)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202402131047.2NVZWHma-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>>>> drivers/firmware/arm_scmi/clock.c:853:8: error: call to undeclared function 'scmi_clock_domain_lookup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>>       853 |         clk = scmi_clock_domain_lookup(ci, src_id);
>>           |               ^
>>>> drivers/firmware/arm_scmi/clock.c:853:6: error: incompatible integer to pointer conversion assigning to 'struct scmi_clock_info *' from 'int' [-Wint-conversion]
>>       853 |         clk = scmi_clock_domain_lookup(ci, src_id);
>>           |             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>     2 errors generated.
>>
>>
>> vim +/scmi_clock_domain_lookup +853 drivers/firmware/arm_scmi/clock.c
>>
>>     842	
>>     843	static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
>>     844					      u8 evt_id, u32 src_id)
>>     845	{
>>     846		bool supported;
>>     847		struct scmi_clock_info *clk;
>>     848		struct clock_info *ci = ph->get_priv(ph);
>>     849	
>>     850		if (evt_id >= ARRAY_SIZE(evt_2_cmd))
>>     851			return false;
>>     852	
>>   > 853		clk = scmi_clock_domain_lookup(ci, src_id);
>>     854		if (IS_ERR(clk))
>>     855			return false;
>>     856	
>>     857		if (evt_id == SCMI_EVENT_CLOCK_RATE_CHANGED)
>>     858			supported = clk->rate_changed_notifications;
>>     859		else
>>     860			supported = clk->rate_change_requested_notifications;
>>     861	
>>     862		return supported;
>>     863	}
>>     864	
>>
>> -- 
>> 0-DAY CI Kernel Test Service
>> https://github.com/intel/lkp-tests/wiki
Cristian Marussi Feb. 14, 2024, 6:21 p.m. UTC | #6
On Tue, Feb 13, 2024 at 10:24:48AM -0800, Nikunj Kela wrote:
> 
> On 2/13/2024 12:49 AM, Cristian Marussi wrote:
> > On Tue, Feb 13, 2024 at 10:58:23AM +0800, kernel test robot wrote:
> > > Hi Cristian,
> > > 
> > > kernel test robot noticed the following build errors:
> > > 
> > > [auto build test ERROR on soc/for-next]
> > > [also build test ERROR on linus/master v6.8-rc4 next-20240212]
> > > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > > And when submitting patch, we suggest to use '--base' as documented in
> > > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> > > 
> > Hi,
> > 
> > this series, as stated in the cover-letter, is based off the current tip of
> > 
> > 	sudeep/for-next/scmi/updates
> > 
> > and particularly needs commit:
> > 
> > 	9c5bc650031e firmware: arm_scmi: Rework clock domain info lookups
> > 
> > from there, since it contains the missing scmi_clock_domain_lookup().
> > 
> > Not_sure/dont_known if there is any way to convey this "based-on-branch"
> > info to your/any CI at the moment.
> > 
> > Thanks,
> > Cristian
> Maybe add supdeep's tree in MAINTAINERS and use 'base-commit'.

Thanks Nikunj, I'll try with base-commit.
Cristian

> > > url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Marussi/firmware-arm_scmi-Check-for-notification-support/20240212-203727
> > > base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
> > > patch link:    https://lore.kernel.org/r/20240212123233.1230090-7-cristian.marussi%40arm.com
> > > patch subject: [PATCH 06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback
> > > config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/config)
> > > compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project c08b90c50bcac9f3f563c79491c8dbcbe7c3b574)
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402131047.2NVZWHma-lkp@intel.com/reproduce)
> > > 
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202402131047.2NVZWHma-lkp@intel.com/
> > > 
> > > All errors (new ones prefixed by >>):
> > > 
> > > > > drivers/firmware/arm_scmi/clock.c:853:8: error: call to undeclared function 'scmi_clock_domain_lookup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> > >       853 |         clk = scmi_clock_domain_lookup(ci, src_id);
> > >           |               ^
> > > > > drivers/firmware/arm_scmi/clock.c:853:6: error: incompatible integer to pointer conversion assigning to 'struct scmi_clock_info *' from 'int' [-Wint-conversion]
> > >       853 |         clk = scmi_clock_domain_lookup(ci, src_id);
> > >           |             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >     2 errors generated.
> > > 
> > > 
> > > vim +/scmi_clock_domain_lookup +853 drivers/firmware/arm_scmi/clock.c
> > > 
> > >     842	
> > >     843	static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
> > >     844					      u8 evt_id, u32 src_id)
> > >     845	{
> > >     846		bool supported;
> > >     847		struct scmi_clock_info *clk;
> > >     848		struct clock_info *ci = ph->get_priv(ph);
> > >     849	
> > >     850		if (evt_id >= ARRAY_SIZE(evt_2_cmd))
> > >     851			return false;
> > >     852	
> > >   > 853		clk = scmi_clock_domain_lookup(ci, src_id);
> > >     854		if (IS_ERR(clk))
> > >     855			return false;
> > >     856	
> > >     857		if (evt_id == SCMI_EVENT_CLOCK_RATE_CHANGED)
> > >     858			supported = clk->rate_changed_notifications;
> > >     859		else
> > >     860			supported = clk->rate_change_requested_notifications;
> > >     861	
> > >     862		return supported;
> > >     863	}
> > >     864	
> > > 
> > > -- 
> > > 0-DAY CI Kernel Test Service
> > > https://github.com/intel/lkp-tests/wiki
diff mbox series

Patch

diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index 959e48aba1b5..85eda5db40ba 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -158,6 +158,8 @@  struct clock_info {
 	u32 version;
 	int num_clocks;
 	int max_async_req;
+	bool notify_rate_changed_cmd;
+	bool notify_rate_change_requested_cmd;
 	atomic_t cur_async_req;
 	struct scmi_clock_info *clk;
 	int (*clock_config_set)(const struct scmi_protocol_handle *ph,
@@ -204,6 +206,17 @@  scmi_clock_protocol_attributes_get(const struct scmi_protocol_handle *ph,
 	}
 
 	ph->xops->xfer_put(ph, t);
+
+	if (!ret) {
+		if (!ph->hops->protocol_msg_check(ph, CLOCK_RATE_NOTIFY, NULL))
+			ci->notify_rate_changed_cmd = true;
+
+		if (!ph->hops->protocol_msg_check(ph,
+						  CLOCK_RATE_CHANGE_REQUESTED_NOTIFY,
+						  NULL))
+			ci->notify_rate_change_requested_cmd = true;
+	}
+
 	return ret;
 }
 
@@ -329,13 +342,14 @@  scmi_clock_get_permissions(const struct scmi_protocol_handle *ph, u32 clk_id,
 }
 
 static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
-				     u32 clk_id, struct scmi_clock_info *clk,
+				     u32 clk_id, struct clock_info *cinfo,
 				     u32 version)
 {
 	int ret;
 	u32 attributes;
 	struct scmi_xfer *t;
 	struct scmi_msg_resp_clock_attributes *attr;
+	struct scmi_clock_info *clk = cinfo->clk + clk_id;
 
 	ret = ph->xops->xfer_get_init(ph, CLOCK_ATTRIBUTES,
 				      sizeof(clk_id), sizeof(*attr), &t);
@@ -368,9 +382,11 @@  static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
 						    NULL, clk->name,
 						    SCMI_MAX_STR_SIZE);
 
-		if (SUPPORTS_RATE_CHANGED_NOTIF(attributes))
+		if (cinfo->notify_rate_changed_cmd &&
+		    SUPPORTS_RATE_CHANGED_NOTIF(attributes))
 			clk->rate_changed_notifications = true;
-		if (SUPPORTS_RATE_CHANGE_REQUESTED_NOTIF(attributes))
+		if (cinfo->notify_rate_change_requested_cmd &&
+		    SUPPORTS_RATE_CHANGE_REQUESTED_NOTIF(attributes))
 			clk->rate_change_requested_notifications = true;
 		if (SUPPORTS_PARENT_CLOCK(attributes))
 			scmi_clock_possible_parents(ph, clk_id, clk);
@@ -896,6 +912,28 @@  static const struct scmi_clk_proto_ops clk_proto_ops = {
 	.parent_get = scmi_clock_get_parent,
 };
 
+static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
+				      u8 evt_id, u32 src_id)
+{
+	bool supported;
+	struct scmi_clock_info *clk;
+	struct clock_info *ci = ph->get_priv(ph);
+
+	if (evt_id >= ARRAY_SIZE(evt_2_cmd))
+		return false;
+
+	clk = scmi_clock_domain_lookup(ci, src_id);
+	if (IS_ERR(clk))
+		return false;
+
+	if (evt_id == SCMI_EVENT_CLOCK_RATE_CHANGED)
+		supported = clk->rate_changed_notifications;
+	else
+		supported = clk->rate_change_requested_notifications;
+
+	return supported;
+}
+
 static int scmi_clk_rate_notify(const struct scmi_protocol_handle *ph,
 				u32 clk_id, int message_id, bool enable)
 {
@@ -980,6 +1018,7 @@  static const struct scmi_event clk_events[] = {
 };
 
 static const struct scmi_event_ops clk_event_ops = {
+	.is_notify_supported = scmi_clk_notify_supported,
 	.get_num_sources = scmi_clk_get_num_sources,
 	.set_notify_enabled = scmi_clk_set_notify_enabled,
 	.fill_custom_report = scmi_clk_fill_custom_report,
@@ -1021,7 +1060,7 @@  static int scmi_clock_protocol_init(const struct scmi_protocol_handle *ph)
 	for (clkid = 0; clkid < cinfo->num_clocks; clkid++) {
 		struct scmi_clock_info *clk = cinfo->clk + clkid;
 
-		ret = scmi_clock_attributes_get(ph, clkid, clk, version);
+		ret = scmi_clock_attributes_get(ph, clkid, cinfo, version);
 		if (!ret)
 			scmi_clock_describe_rates_get(ph, clkid, clk);
 	}