mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Levinsky <ben.levinsky@amd.com>
To: <jassisinghbrar@gmail.com>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <michal.simek@amd.com>,
	<tanmay.shah@amd.com>
Subject: [PATCH] mailbox: zynqmp-ipi: Make polling period configurable from kconfig
Date: Tue, 16 Jul 2024 14:50:37 -0700	[thread overview]
Message-ID: <20240716215037.3667214-1-ben.levinsky@amd.com> (raw)

The polling period for ZynqMP IPI Mailbox is currently hard-coded to
five milliseconds. To avoid patching this when modifying the value, the
value is now set with default that can be overwritten from kconfig
prompt.

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
---
 drivers/mailbox/Kconfig              | 12 ++++++++++++
 drivers/mailbox/zynqmp-ipi-mailbox.c |  9 ++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
index 3b8842c4a340..c87a92400616 100644
--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -259,6 +259,18 @@ config ZYNQMP_IPI_MBOX
 	  message to the IPI buffer and will access the IPI control
 	  registers to kick the other processor or enquire status.
 
+config ZYNQMP_IPI_MBOX_POLL_PERIOD
+	int
+	prompt "ZynqMP IPI Mailbox driver polling period"
+	default 5
+	depends on ZYNQMP_IPI_MBOX
+	help
+	  By default the Xilinx-AMD IPI mailbox driver has a polling period
+	  of five milliseconds. If this option is set then the provided value
+	  will be used.
+
+	  Leave as default if not sure.
+
 config SUN6I_MSGBOX
 	tristate "Allwinner sun6i/sun8i/sun9i/sun50i Message Box"
 	depends on ARCH_SUNXI || COMPILE_TEST
diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c
index 4acf5612487c..df540e2b9dbe 100644
--- a/drivers/mailbox/zynqmp-ipi-mailbox.c
+++ b/drivers/mailbox/zynqmp-ipi-mailbox.c
@@ -64,6 +64,13 @@
 
 #define MAX_SGI 16
 
+/* Polling period in milliseconds. */
+#ifndef CONFIG_ZYNQMP_IPI_MBOX_POLL_PERIOD
+#define ZYNQMP_IPI_MBOX_POLL_PERIOD (5U)
+#else
+#define ZYNQMP_IPI_MBOX_POLL_PERIOD CONFIG_ZYNQMP_IPI_MBOX_POLL_PERIOD
+#endif
+
 /**
  * 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 = ZYNQMP_IPI_MBOX_POLL_PERIOD;
 	mbox->of_xlate = zynqmp_ipi_of_xlate;
 	chans = devm_kzalloc(mdev, 2 * sizeof(*chans), GFP_KERNEL);
 	if (!chans)
-- 
2.25.1


             reply	other threads:[~2024-07-16 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 21:50 Ben Levinsky [this message]
2024-07-17  6:05 ` Michal Simek

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=20240716215037.3667214-1-ben.levinsky@amd.com \
    --to=ben.levinsky@amd.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=tanmay.shah@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®