diff mbox series

[v6,1/6] firmware: xilinx: add register notifier in zynqmp firmware

Message ID 20211025082350.10881-2-abhyuday.godhasara@xilinx.com (mailing list archive)
State New, archived
Headers show
Series Add Xilinx Event Management Driver | expand

Commit Message

Abhyuday Godhasara Oct. 25, 2021, 8:23 a.m. UTC
In zynqmp-firmware, register notifier is not supported, add support of
register notifier in zynqmp-firmware.

Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
---
Changes in v6:
- Minor fix

Changes in v5:
- None

Changes in v4:
- Rebase on latest tree

Changes in v3:
- None

Changes in v2:
- Removed updated copyright year from unchanged files.
---
 drivers/firmware/xilinx/zynqmp.c     | 23 +++++++++++++++++++++++
 include/linux/firmware/xlnx-zynqmp.h | 11 ++++++++++-
 2 files changed, 33 insertions(+), 1 deletion(-)

Comments

Greg KH Oct. 25, 2021, 8:34 a.m. UTC | #1
On Mon, Oct 25, 2021 at 01:23:45AM -0700, Abhyuday Godhasara wrote:
> In zynqmp-firmware, register notifier is not supported, add support of
> register notifier in zynqmp-firmware.
> 
> Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
> Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
> Acked-by: Michal Simek <michal.simek@xilinx.com>
> ---
> Changes in v6:
> - Minor fix


That is vague, what got "fixed" here?

thanks,

greg k-h
Abhyuday Godhasara Oct. 25, 2021, 11:53 a.m. UTC | #2
Hi Greg,

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Monday, October 25, 2021 2:05 PM
> To: Abhyuday Godhasara <agodhasa@xilinx.com>
> Cc: Michal Simek <michals@xilinx.com>; Rajan Vaja <RAJANV@xilinx.com>;
> Manish Narani <MNARANI@xilinx.com>; zou_wei@huawei.com; Sai Krishna
> Potthuri <lakshmis@xilinx.com>; Jiaying Liang <jliang@xilinx.com>; Jiaying Liang
> <jliang@xilinx.com>; linux-kernel@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; Tejas Patel <TEJASP@xilinx.com>
> Subject: Re: [PATCH v6 1/6] firmware: xilinx: add register notifier in zynqmp
> firmware
> 
> On Mon, Oct 25, 2021 at 01:23:45AM -0700, Abhyuday Godhasara wrote:
> > In zynqmp-firmware, register notifier is not supported, add support of
> > register notifier in zynqmp-firmware.
> >
> > Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
> > Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
> > Acked-by: Michal Simek <michal.simek@xilinx.com>
> > ---
> > Changes in v6:
> > - Minor fix
> 
> 
> That is vague, what got "fixed" here?
[Abhyuday] During rebase of patches on your tree couple of lines code was get mixed unintendedly in xlnx-zynqmp.h header file due to use of "git am -3".
I corrected the below code which was wrong in previous patch v5.
+static inline int zynqmp_pm_register_notifier(const u32 node, const u32 event,
+					      const u32 wake, const u32 enable) {
+	return -ENODEV;
+}

In v5 it was like below, which is wrong
static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address)
static inline int zynqmp_pm_register_notifier(const u32 node, const u32 event,
					      const u32 wake, const u32 enable) {
	return -ENODEV;
}
So, the body was missing here for zynqmp_pm_load_pdi in v5.

Thanks,
Abhyuday

> 
> thanks,
> 
> greg k-h
Greg KH Oct. 25, 2021, 12:03 p.m. UTC | #3
On Mon, Oct 25, 2021 at 11:53:17AM +0000, Abhyuday Godhasara wrote:
> Hi Greg,
> 
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Monday, October 25, 2021 2:05 PM
> > To: Abhyuday Godhasara <agodhasa@xilinx.com>
> > Cc: Michal Simek <michals@xilinx.com>; Rajan Vaja <RAJANV@xilinx.com>;
> > Manish Narani <MNARANI@xilinx.com>; zou_wei@huawei.com; Sai Krishna
> > Potthuri <lakshmis@xilinx.com>; Jiaying Liang <jliang@xilinx.com>; Jiaying Liang
> > <jliang@xilinx.com>; linux-kernel@vger.kernel.org; linux-arm-
> > kernel@lists.infradead.org; Tejas Patel <TEJASP@xilinx.com>
> > Subject: Re: [PATCH v6 1/6] firmware: xilinx: add register notifier in zynqmp
> > firmware
> > 
> > On Mon, Oct 25, 2021 at 01:23:45AM -0700, Abhyuday Godhasara wrote:
> > > In zynqmp-firmware, register notifier is not supported, add support of
> > > register notifier in zynqmp-firmware.
> > >
> > > Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
> > > Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
> > > Acked-by: Michal Simek <michal.simek@xilinx.com>
> > > ---
> > > Changes in v6:
> > > - Minor fix
> > 
> > 
> > That is vague, what got "fixed" here?
> [Abhyuday] During rebase of patches on your tree couple of lines code was get mixed unintendedly in xlnx-zynqmp.h header file due to use of "git am -3".
> I corrected the below code which was wrong in previous patch v5.
> +static inline int zynqmp_pm_register_notifier(const u32 node, const u32 event,
> +					      const u32 wake, const u32 enable) {
> +	return -ENODEV;
> +}
> 
> In v5 it was like below, which is wrong
> static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address)
> static inline int zynqmp_pm_register_notifier(const u32 node, const u32 event,
> 					      const u32 wake, const u32 enable) {
> 	return -ENODEV;
> }
> So, the body was missing here for zynqmp_pm_load_pdi in v5.

And why did you not describe this in the changelog text?  That is what I
was asking about here.  Please be specific, as reviewers need to know
this type of thing.

thanks,

greg k-h
Abhyuday Godhasara Oct. 25, 2021, 12:11 p.m. UTC | #4
Hi Greg,

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Monday, October 25, 2021 5:33 PM
> To: Abhyuday Godhasara <agodhasa@xilinx.com>
> Cc: Michal Simek <michals@xilinx.com>; Rajan Vaja <RAJANV@xilinx.com>;
> Manish Narani <MNARANI@xilinx.com>; zou_wei@huawei.com; Sai Krishna
> Potthuri <lakshmis@xilinx.com>; Jiaying Liang <jliang@xilinx.com>; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Tejas Patel
> <TEJASP@xilinx.com>
> Subject: Re: [PATCH v6 1/6] firmware: xilinx: add register notifier in zynqmp
> firmware
> 
> On Mon, Oct 25, 2021 at 11:53:17AM +0000, Abhyuday Godhasara wrote:
> > Hi Greg,
> >
> > > -----Original Message-----
> > > From: Greg KH <gregkh@linuxfoundation.org>
> > > Sent: Monday, October 25, 2021 2:05 PM
> > > To: Abhyuday Godhasara <agodhasa@xilinx.com>
> > > Cc: Michal Simek <michals@xilinx.com>; Rajan Vaja
> > > <RAJANV@xilinx.com>; Manish Narani <MNARANI@xilinx.com>;
> > > zou_wei@huawei.com; Sai Krishna Potthuri <lakshmis@xilinx.com>;
> > > Jiaying Liang <jliang@xilinx.com>; Jiaying Liang
> > > <jliang@xilinx.com>; linux-kernel@vger.kernel.org; linux-arm-
> > > kernel@lists.infradead.org; Tejas Patel <TEJASP@xilinx.com>
> > > Subject: Re: [PATCH v6 1/6] firmware: xilinx: add register notifier
> > > in zynqmp firmware
> > >
> > > On Mon, Oct 25, 2021 at 01:23:45AM -0700, Abhyuday Godhasara wrote:
> > > > In zynqmp-firmware, register notifier is not supported, add
> > > > support of register notifier in zynqmp-firmware.
> > > >
> > > > Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
> > > > Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
> > > > Acked-by: Michal Simek <michal.simek@xilinx.com>
> > > > ---
> > > > Changes in v6:
> > > > - Minor fix
> > >
> > >
> > > That is vague, what got "fixed" here?
> > [Abhyuday] During rebase of patches on your tree couple of lines code was
> get mixed unintendedly in xlnx-zynqmp.h header file due to use of "git am -3".
> > I corrected the below code which was wrong in previous patch v5.
> > +static inline int zynqmp_pm_register_notifier(const u32 node, const u32
> event,
> > +					      const u32 wake, const u32 enable)
> {
> > +	return -ENODEV;
> > +}
> >
> > In v5 it was like below, which is wrong static inline int
> > zynqmp_pm_load_pdi(const u32 src, const u64 address) static inline int
> > zynqmp_pm_register_notifier(const u32 node, const u32 event,
> > 					      const u32 wake, const u32 enable)
> {
> > 	return -ENODEV;
> > }
> > So, the body was missing here for zynqmp_pm_load_pdi in v5.
> 
> And why did you not describe this in the changelog text?  That is what I was
> asking about here.  Please be specific, as reviewers need to know this type of
> thing.
[Abhyuday] Just to avoid longer change log I added it as "Minor fix" this time, but will be taken care this type of things from next time.
Are you expecting the v7 for this time ?

Thanks,
Abhyuday

> 
> thanks,
> 
> greg k-h
Abhyuday Godhasara Oct. 26, 2021, 7:19 a.m. UTC | #5
Hi Greg,

> -----Original Message-----
> From: Abhyuday Godhasara
> Sent: Monday, October 25, 2021 5:42 PM
> To: 'Greg KH' <gregkh@linuxfoundation.org>
> Cc: Michal Simek <michals@xilinx.com>; Rajan Vaja <RAJANV@xilinx.com>;
> Manish Narani <MNARANI@xilinx.com>; zou_wei@huawei.com; Sai Krishna
> Potthuri <lakshmis@xilinx.com>; Jiaying Liang <jliang@xilinx.com>; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Tejas Patel
> <TEJASP@xilinx.com>
> Subject: RE: [PATCH v6 1/6] firmware: xilinx: add register notifier in zynqmp
> firmware
> 
> Hi Greg,
> 
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Monday, October 25, 2021 5:33 PM
> > To: Abhyuday Godhasara <agodhasa@xilinx.com>
> > Cc: Michal Simek <michals@xilinx.com>; Rajan Vaja <RAJANV@xilinx.com>;
> > Manish Narani <MNARANI@xilinx.com>; zou_wei@huawei.com; Sai Krishna
> > Potthuri <lakshmis@xilinx.com>; Jiaying Liang <jliang@xilinx.com>;
> > linux- kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> > Tejas Patel <TEJASP@xilinx.com>
> > Subject: Re: [PATCH v6 1/6] firmware: xilinx: add register notifier in
> > zynqmp firmware
> >
> > On Mon, Oct 25, 2021 at 11:53:17AM +0000, Abhyuday Godhasara wrote:
> > > Hi Greg,
> > >
> > > > -----Original Message-----
> > > > From: Greg KH <gregkh@linuxfoundation.org>
> > > > Sent: Monday, October 25, 2021 2:05 PM
> > > > To: Abhyuday Godhasara <agodhasa@xilinx.com>
> > > > Cc: Michal Simek <michals@xilinx.com>; Rajan Vaja
> > > > <RAJANV@xilinx.com>; Manish Narani <MNARANI@xilinx.com>;
> > > > zou_wei@huawei.com; Sai Krishna Potthuri <lakshmis@xilinx.com>;
> > > > Jiaying Liang <jliang@xilinx.com>; Jiaying Liang
> > > > <jliang@xilinx.com>; linux-kernel@vger.kernel.org; linux-arm-
> > > > kernel@lists.infradead.org; Tejas Patel <TEJASP@xilinx.com>
> > > > Subject: Re: [PATCH v6 1/6] firmware: xilinx: add register
> > > > notifier in zynqmp firmware
> > > >
> > > > On Mon, Oct 25, 2021 at 01:23:45AM -0700, Abhyuday Godhasara wrote:
> > > > > In zynqmp-firmware, register notifier is not supported, add
> > > > > support of register notifier in zynqmp-firmware.
> > > > >
> > > > > Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
> > > > > Signed-off-by: Abhyuday Godhasara
> > > > > <abhyuday.godhasara@xilinx.com>
> > > > > Acked-by: Michal Simek <michal.simek@xilinx.com>
> > > > > ---
> > > > > Changes in v6:
> > > > > - Minor fix
> > > >
> > > >
> > > > That is vague, what got "fixed" here?
> > > [Abhyuday] During rebase of patches on your tree couple of lines
> > > code was
> > get mixed unintendedly in xlnx-zynqmp.h header file due to use of "git am -
> 3".
> > > I corrected the below code which was wrong in previous patch v5.
> > > +static inline int zynqmp_pm_register_notifier(const u32 node, const
> > > +u32
> > event,
> > > +					      const u32 wake, const u32 enable)
> > {
> > > +	return -ENODEV;
> > > +}
> > >
> > > In v5 it was like below, which is wrong static inline int
> > > zynqmp_pm_load_pdi(const u32 src, const u64 address) static inline
> > > int zynqmp_pm_register_notifier(const u32 node, const u32 event,
> > > 					      const u32 wake, const u32 enable)
> > {
> > > 	return -ENODEV;
> > > }
> > > So, the body was missing here for zynqmp_pm_load_pdi in v5.
> >
> > And why did you not describe this in the changelog text?  That is what
> > I was asking about here.  Please be specific, as reviewers need to
> > know this type of thing.
> [Abhyuday] Just to avoid longer change log I added it as "Minor fix" this time,
> but will be taken care this type of things from next time.
> Are you expecting the v7 for this time ?
[Abhyuday] Submitted v7 with updated cover latter and version history as per suggestion.


Thanks,
Abhyuday

> 
> Thanks,
> Abhyuday
> 
> >
> > thanks,
> >
> > greg k-h
diff mbox series

Patch

diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index a3cadbaf3cba..6e653e9cea2d 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1053,6 +1053,29 @@  int zynqmp_pm_aes_engine(const u64 address, u32 *out)
 }
 EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine);
 
+/**
+ * zynqmp_pm_register_notifier() - PM API for register a subsystem
+ *                                to be notified about specific
+ *                                event/error.
+ * @node:	Node ID to which the event is related.
+ * @event:	Event Mask of Error events for which wants to get notified.
+ * @wake:	Wake subsystem upon capturing the event if value 1
+ * @enable:	Enable the registration for value 1, disable for value 0
+ *
+ * This function is used to register/un-register for particular node-event
+ * combination in firmware.
+ *
+ * Return: Returns status, either success or error+reason
+ */
+
+int zynqmp_pm_register_notifier(const u32 node, const u32 event,
+				const u32 wake, const u32 enable)
+{
+	return zynqmp_pm_invoke_fn(PM_REGISTER_NOTIFIER, node, event,
+				   wake, enable, NULL);
+}
+EXPORT_SYMBOL_GPL(zynqmp_pm_register_notifier);
+
 /**
  * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart
  * @type:	Shutdown or restart? 0 for shutdown, 1 for restart
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
index 56b426fe020c..96aaadc44c3f 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -2,7 +2,7 @@ 
 /*
  * Xilinx Zynq MPSoC Firmware layer
  *
- *  Copyright (C) 2014-2019 Xilinx
+ *  Copyright (C) 2014-2021 Xilinx
  *
  *  Michal Simek <michal.simek@xilinx.com>
  *  Davorin Mista <davorin.mista@aggios.com>
@@ -66,6 +66,7 @@ 
 
 enum pm_api_id {
 	PM_GET_API_VERSION = 1,
+	PM_REGISTER_NOTIFIER = 5,
 	PM_SYSTEM_SHUTDOWN = 12,
 	PM_REQUEST_NODE = 13,
 	PM_RELEASE_NODE = 14,
@@ -416,6 +417,8 @@  int zynqmp_pm_pinctrl_get_config(const u32 pin, const u32 param,
 int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
 				 u32 value);
 int zynqmp_pm_load_pdi(const u32 src, const u64 address);
+int zynqmp_pm_register_notifier(const u32 node, const u32 event,
+				const u32 wake, const u32 enable);
 #else
 static inline int zynqmp_pm_get_api_version(u32 *version)
 {
@@ -632,6 +635,12 @@  static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address)
 {
 	return -ENODEV;
 }
+
+static inline int zynqmp_pm_register_notifier(const u32 node, const u32 event,
+					      const u32 wake, const u32 enable)
+{
+	return -ENODEV;
+}
 #endif
 
 #endif /* __FIRMWARE_ZYNQMP_H__ */