Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9af9494 authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Matt Wagantall
Browse files

iopoll: remove overly-helpful helper macros, clarify naming



Some of the macros in iopoll.h might be a tad verbose or
redundant. Several of the "verbose" macros are not used anywhere in the
kernel. Based on feedback from upstream, rip out the extra "wrapper"
macros and convert callers (if any) to the lower-level ones.

Also change the `_noirq' suffix to the more idiomatic `_atomic'.

The following semantic patch was used to help identify and make the
necessary changes:

    @@
    expression addr, val, cond, timeout_us;
    @@

    - readl_tight_poll_timeout(addr, val, cond, timeout_us)
    + readl_poll_timeout(addr, val, cond, 0, timeout_us)

    @@
    expression addr, val, cond, max_reads, time_between_us;
    @@

    - readl_poll_timeout_noirq(addr, val, cond, max_reads, time_between_us)
    + readl_poll_timeout_atomic(addr, val, cond, max_reads, time_between_us)

Change-Id: Ibdb054ded59d777f38f594a2f09a12c64abdb059
[veeras@codeaurora.org: As part of 3.18 upgrade, removing all
non-display related code from this commit.
	arch/arm/mach-msm/clock-mdss-8974.c
	drivers/clk/msm/gdsc.c
	drivers/iommu/msm_iommu-v1.c
	include/linux/iopoll.h]
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 610cb178
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -458,7 +458,7 @@ int dsi_20nm_pll_lock_status(struct mdss_pll_resources *dsi_pll_res)
	int pll_locked;

	/* poll for PLL ready status */
	if (readl_poll_timeout_noirq((dsi_pll_res->pll_base +
	if (readl_poll_timeout_atomic((dsi_pll_res->pll_base +
			MMSS_DSI_PHY_PLL_RESET_SM),
			status,
			((status & BIT(5)) > 0),
@@ -466,7 +466,7 @@ int dsi_20nm_pll_lock_status(struct mdss_pll_resources *dsi_pll_res)
			DSI_PLL_POLL_TIMEOUT_US)) {
		pr_debug("DSI PLL status=%x failed to Lock\n", status);
		pll_locked = 0;
	} else if (readl_poll_timeout_noirq((dsi_pll_res->pll_base +
	} else if (readl_poll_timeout_atomic((dsi_pll_res->pll_base +
				MMSS_DSI_PHY_PLL_RESET_SM),
				status,
				((status & BIT(6)) > 0),
+1 −1
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ int dsi_pll_lock_status(struct mdss_pll_resources *dsi_pll_res)
	int pll_locked;

	/* poll for PLL ready status */
	if (readl_poll_timeout_noirq((dsi_pll_res->pll_base +
	if (readl_poll_timeout_atomic((dsi_pll_res->pll_base +
			DSI_PHY_PLL_UNIPHY_PLL_STATUS),
			status,
			((status & BIT(0)) == 1),
+1 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ static int edp_pll_lock_status(struct mdss_pll_resources *edp_pll_res)
	}

	/* poll for PLL ready status */
	if (readl_poll_timeout_noirq((edp_pll_res->pll_base + 0xc0),
	if (readl_poll_timeout_atomic((edp_pll_res->pll_base + 0xc0),
			status, ((status & BIT(0)) == 1),
			EDP_PLL_POLL_MAX_READS,
			EDP_PLL_POLL_TIMEOUT_US)) {
+2 −2
Original line number Diff line number Diff line
@@ -772,7 +772,7 @@ static int hdmi_20nm_pll_lock_status(struct mdss_pll_resources *io)
	pr_debug("%s: Waiting for PHY Ready\n", __func__);

	/* poll for PLL ready status */
	if (!readl_poll_timeout_noirq(
	if (!readl_poll_timeout_atomic(
		(io->pll_base + QSERDES_COM_RESET_SM),
		status, ((status & BIT(6)) == 1),
		HDMI_PLL_POLL_MAX_READS,
@@ -785,7 +785,7 @@ static int hdmi_20nm_pll_lock_status(struct mdss_pll_resources *io)
	}

	/* poll for PHY ready status */
	if (pll_locked && !readl_poll_timeout_noirq(
	if (pll_locked && !readl_poll_timeout_atomic(
		(io->phy_base + HDMI_PHY_STATUS),
		status, ((status & BIT(0)) == 1),
		HDMI_PLL_POLL_MAX_READS,
+3 −3
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ static int hdmi_vco_enable(struct clk *c)
	/* poll for PLL ready status */
	max_reads = 20;
	timeout_us = 100;
	if (readl_poll_timeout_noirq(
	if (readl_poll_timeout_atomic(
		(hdmi_pll_res->pll_base + HDMI_UNI_PLL_STATUS),
		status, ((status & BIT(0)) == 1), max_reads, timeout_us)) {
		pr_err("hdmi phy pll status=%x failed to Lock\n", status);
@@ -166,7 +166,7 @@ static int hdmi_vco_enable(struct clk *c)
	/* poll for PHY ready status */
	max_reads = 20;
	timeout_us = 100;
	if (readl_poll_timeout_noirq(
	if (readl_poll_timeout_atomic(
		(hdmi_pll_res->phy_base + HDMI_PHY_STATUS),
		status, ((status & BIT(0)) == 1), max_reads, timeout_us)) {
		pr_err("hdmi phy status=%x failed to Lock\n", status);
@@ -847,7 +847,7 @@ static int hdmi_pll_lock_status(struct mdss_pll_resources *hdmi_pll_res)
	}

	/* poll for PLL ready status */
	if (readl_poll_timeout_noirq(
	if (readl_poll_timeout_atomic(
			(hdmi_pll_res->phy_base + HDMI_PHY_STATUS),
			status, ((status & BIT(0)) == 1),
			HDMI_PLL_POLL_MAX_READS,