Skip to contentSkip to conversation

mailbox: zynqmp-ipi: Make polling period configurable

PATCH In review Ben Levinsky 2 participants 2 messages Jul 18, 2024 – Jul 19, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mailbox: zynqmp-ipi: Make polling period configurable

There are cases where remote that is acking mailbox message can take longer than the default tx_poll_period value. Therefore, enable this to be mutable.

Added tx_poll_period field while inserting the module to set the poll period for ack after sending mailbox message.

---
v2: Made param a module_param_named mutable arg as opposed to compiled option

---
 drivers/mailbox/zynqmp-ipi-mailbox.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/mailbox/zynqmp-ipi-mailbox.c +8 -1
index 4acf5612487c..521d08b9ab47 100644
@@ -64,6 +64,13 @@
 
 #define MAX_SGI 16
 
+/*
+ * Module parameters
+ */
+static int tx_poll_period = 5;
+module_param_named(tx_poll_period, tx_poll_period, int, 0644);
+MODULE_PARM_DESC(tx_poll_period, "Poll period waiting for ack after send.");
+
 /**
  * struct zynqmp_ipi_mchan - Description of a Xilinx ZynqMP IPI mailbox channel
  * @is_opened: indicate if the IPI channel is opened
@@ -537,7 +544,7 @@ static int zynqmp_ipi_mbox_probe(struct zynqmp_ipi_mbox *ipi_mbox,
 	mbox->num_chans = 2;
 	mbox->txdone_irq = false;
 	mbox->txdone_poll = true;
-	mbox->txpoll_period = 5;
+	mbox->txpoll_period = tx_poll_period;
 	mbox->of_xlate = zynqmp_ipi_of_xlate;
 	chans = devm_kzalloc(mdev, 2 * sizeof(*chans), GFP_KERNEL);
 	if (!chans)
Signature · 1 line
2.25.1
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 32 lines · Ben Levinsky

There are cases where remote that is acking mailbox message can take longer than the default tx_poll_period value. Therefore, enable this to be mutable.

Added tx_poll_period field while inserting the module to set the poll period for ack after sending mailbox message.

---
v2: Made param a module_param_named mutable arg as opposed to compiled option

---
  drivers/mailbox/zynqmp-ipi-mailbox.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/mailbox/zynqmp-ipi-mailbox.c +7 -0
index 4acf5612487c..521d08b9ab47 100644
@@ -64,6 +64,13 @@
 
  #define MAX_SGI 16
 
+/*
+ * Module parameters
+ */
+static int tx_poll_period = 5;
+module_param_named(tx_poll_period, tx_poll_period, int, 0644);
+MODULE_PARM_DESC(tx_poll_period, "Poll period waiting for ack after send.");
+
  /**
   * struct zynqmp_ipi_mchan - Description of a Xilinx ZynqMP IPI mailbox channel
   * @is_opened: indicate if the IPI channel is opened

drivers/mailbox/zynqmp-ipi-mailbox.c static int zynqmp_ipi_mbox_probe(struct zynqmp_ipi_mbox *ipi_mbox, · line 550

Quoted 8 lines
drivers/mailbox/zynqmp-ipi-mailbox.c +1 -1
@@ -537,7 +544,7 @@ static int zynqmp_ipi_mbox_probe(struct zynqmp_ipi_mbox *ipi_mbox,
  	mbox->num_chans = 2;
  	mbox->txdone_irq = false;
  	mbox->txdone_poll = true;
-	mbox->txpoll_period = 5;
+	mbox->txpoll_period = tx_poll_period;
  	mbox->of_xlate = zynqmp_ipi_of_xlate;
  	chans = devm_kzalloc(mdev, 2 * sizeof(*chans), GFP_KERNEL);
  	if (!chans)

Thanks,
Michal