All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Singh <rahul.singh@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com, rahul.singh@arm.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v4 10/11] xen/arm: smmuv3: Replace linux functions with xen functions.
Date: Fri,  8 Jan 2021 14:46:30 +0000	[thread overview]
Message-ID: <85c1bdd22dc6f50c9d1dfd73e0ddf83c2c307dcf.1610115608.git.rahul.singh@arm.com> (raw)
In-Reply-To: <cover.1610115608.git.rahul.singh@arm.com>
In-Reply-To: <cover.1610115608.git.rahul.singh@arm.com>

Replace all Linux device tree handling function with the XEN
functions.

Replace all Linux ktime function with the XEN time functions.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
---
Changes in v3:
 - This patch is introduce in this version.
Changes in V4:
 - Move this patch one patch earlier so that there is no need to remove
   the code.
---
 xen/drivers/passthrough/arm/smmu-v3.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c
index f5f8b4c981..2dfadc6a65 100644
--- a/xen/drivers/passthrough/arm/smmu-v3.c
+++ b/xen/drivers/passthrough/arm/smmu-v3.c
@@ -682,7 +682,7 @@ static void parse_driver_options(struct arm_smmu_device *smmu)
 	int i = 0;
 
 	do {
-		if (of_property_read_bool(smmu->dev->of_node,
+		if (dt_property_read_bool(smmu->dev->of_node,
 						arm_smmu_options[i].prop)) {
 			smmu->options |= arm_smmu_options[i].opt;
 			dev_notice(smmu->dev, "option %s\n",
@@ -754,17 +754,17 @@ static void queue_inc_prod(struct arm_smmu_ll_queue *q)
  */
 static int queue_poll_cons(struct arm_smmu_queue *q, bool sync, bool wfe)
 {
-	ktime_t timeout;
+	s_time_t timeout;
 	unsigned int delay = 1, spin_cnt = 0;
 
 	/* Wait longer if it's a CMD_SYNC */
-	timeout = ktime_add_us(ktime_get(), sync ?
+	timeout = NOW() + MICROSECS(sync ?
 					    ARM_SMMU_CMDQ_SYNC_TIMEOUT_US :
 					    ARM_SMMU_POLL_TIMEOUT_US);
 
 	while (queue_sync_cons_in(q),
 	      (sync ? !queue_empty(&q->llq) : queue_full(&q->llq))) {
-		if (ktime_compare(ktime_get(), timeout) > 0)
+		if ((NOW() > timeout) > 0)
 			return -ETIMEDOUT;
 
 		if (wfe) {
@@ -990,13 +990,13 @@ static void arm_smmu_cmdq_issue_cmd(struct arm_smmu_device *smmu,
  */
 static int __arm_smmu_sync_poll_msi(struct arm_smmu_device *smmu, u32 sync_idx)
 {
-	ktime_t timeout;
+	s_time_t timeout;
 	u32 val;
 
-	timeout = ktime_add_us(ktime_get(), ARM_SMMU_CMDQ_SYNC_TIMEOUT_US);
+	timeout = NOW() + MICROSECS(ARM_SMMU_CMDQ_SYNC_TIMEOUT_US);
 	val = smp_cond_load_acquire(&smmu->sync_count,
 				    (int)(VAL - sync_idx) >= 0 ||
-				    !ktime_before(ktime_get(), timeout));
+				    !(NOW() < timeout));
 
 	return (int)(val - sync_idx) < 0 ? -ETIMEDOUT : 0;
 }
@@ -2649,7 +2649,7 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev,
 	u32 cells;
 	int ret = -EINVAL;
 
-	if (of_property_read_u32(dev->of_node, "#iommu-cells", &cells))
+	if (!dt_property_read_u32(dev->of_node, "#iommu-cells", &cells))
 		dev_err(dev, "missing #iommu-cells property\n");
 	else if (cells != 1)
 		dev_err(dev, "invalid #iommu-cells value (%d)\n", cells);
-- 
2.17.1



  parent reply	other threads:[~2021-01-08 14:52 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 14:46 [PATCH v4 00/11] xen/arm: Add support for SMMUv3 driver Rahul Singh
2021-01-08 14:46 ` [PATCH v4 01/11] xen/arm: smmuv3: Import the SMMUv3 driver from Linux Rahul Singh
2021-01-08 23:42   ` Stefano Stabellini
2021-01-15 11:55   ` Julien Grall
2021-01-08 14:46 ` [PATCH v4 02/11] xen/arm: Revert atomic operation related command-queue insertion patch Rahul Singh
2021-01-08 23:43   ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 03/11] xen/arm: smmuv3: Revert patch related to XArray Rahul Singh
2021-01-08 23:43   ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 04/11] xen/arm: smmuv3: Remove support for Stage-1 translation on SMMUv3 Rahul Singh
2021-01-08 23:52   ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 05/11] xen/arm: smmuv3: Remove Linux specific code that is not usable in XEN Rahul Singh
2021-01-08 23:56   ` Stefano Stabellini
2021-01-12 11:38   ` Bertrand Marquis
2021-01-08 14:46 ` [PATCH v4 06/11] xen/device-tree: Add dt_property_match_string helper Rahul Singh
2021-01-08 23:57   ` Stefano Stabellini
2021-01-12 11:38   ` Bertrand Marquis
2021-01-08 14:46 ` [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function Rahul Singh
2021-01-09  1:44   ` Stefano Stabellini
2021-01-12 11:35   ` Bertrand Marquis
2021-01-15 12:16   ` Julien Grall
2021-01-18 15:32     ` Rahul Singh
2021-01-08 14:46 ` [PATCH v4 08/11] xen/compiler: import 'fallthrough' keyword from linux Rahul Singh
2021-01-09  1:44   ` Stefano Stabellini
2021-01-12 11:36   ` Bertrand Marquis
2021-01-12 11:41   ` Jan Beulich
2021-01-12 23:30     ` Stefano Stabellini
2021-01-12 23:40       ` Stefano Stabellini
2021-01-14  9:04       ` Jan Beulich
2021-01-14 23:47         ` Stefano Stabellini
2021-01-15 12:14           ` Rahul Singh
2021-01-15 13:09             ` Jan Beulich
2021-01-15 17:56               ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 09/11] xen/arm: smmuv3: Use fallthrough pseudo-keyword Rahul Singh
2021-01-09  1:44   ` Stefano Stabellini
2021-01-09 18:57     ` Rahul Singh
2021-01-12 11:34   ` Bertrand Marquis
2021-01-15 12:18   ` Julien Grall
2021-01-18 15:33     ` Rahul Singh
2021-01-08 14:46 ` Rahul Singh [this message]
2021-01-09  1:44   ` [PATCH v4 10/11] xen/arm: smmuv3: Replace linux functions with xen functions Stefano Stabellini
2021-01-12 11:35   ` Bertrand Marquis
2021-01-08 14:46 ` [PATCH v4 11/11] xen/arm: smmuv3: Add support for SMMUv3 driver Rahul Singh
2021-01-09  1:45   ` Stefano Stabellini
2021-01-11 16:09   ` Oleksandr
2021-01-11 16:39     ` Oleksandr
2021-01-18 15:33       ` Rahul Singh
2021-01-18 16:20         ` Oleksandr
2021-01-18 16:57           ` Rahul Singh
2021-01-19 14:43             ` Oleksandr
2021-01-19 14:53               ` Rahul Singh
2021-01-12  9:41     ` Rahul Singh
2021-01-12 20:59       ` Oleksandr
2021-01-15 12:38         ` Rahul Singh
2021-01-15 12:40           ` Julien Grall
2021-01-15 12:37   ` Julien Grall

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=85c1bdd22dc6f50c9d1dfd73e0ddf83c2c307dcf.1610115608.git.rahul.singh@arm.com \
    --to=rahul.singh@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.