All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	netdev@vger.kernel.org,
	Gregory Clement <gregory.clement@bootlin.com>,
	Jason Cooper <jason@lakedaemon.net>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [RFC PATCH 2/6] phy: armada38x: add common phy support
Date: Mon, 12 Nov 2018 18:03:31 +0100	[thread overview]
Message-ID: <20181112170331.GB5075@lunn.ch> (raw)
In-Reply-To: <E1gMBMi-00089Q-7S@rmk-PC.armlinux.org.uk>

> +static int a38x_comphy_poll(struct a38x_comphy_lane *lane,
> +			    unsigned int offset, u32 mask, u32 value)
> +{
> +	unsigned int timeout = 10;
> +	u32 val;
> +
> +	while (1) {
> +		val = readl_relaxed(lane->base + offset);
> +		if ((val & mask) == value)
> +			return 0;
> +		if (!timeout--)
> +			break;
> +		udelay(10);
> +	}

Hi Russell

Maybe use one of the readx_poll_timeout() variants?

      Andrew

WARNING: multiple messages have this Message-ID (diff)
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 2/6] phy: armada38x: add common phy support
Date: Mon, 12 Nov 2018 18:03:31 +0100	[thread overview]
Message-ID: <20181112170331.GB5075@lunn.ch> (raw)
In-Reply-To: <E1gMBMi-00089Q-7S@rmk-PC.armlinux.org.uk>

> +static int a38x_comphy_poll(struct a38x_comphy_lane *lane,
> +			    unsigned int offset, u32 mask, u32 value)
> +{
> +	unsigned int timeout = 10;
> +	u32 val;
> +
> +	while (1) {
> +		val = readl_relaxed(lane->base + offset);
> +		if ((val & mask) == value)
> +			return 0;
> +		if (!timeout--)
> +			break;
> +		udelay(10);
> +	}

Hi Russell

Maybe use one of the readx_poll_timeout() variants?

      Andrew

  reply	other threads:[~2018-11-13  2:57 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 12:29 [RFC PATCH 0/6] Armada 38x comphy driver to support 2.5Gbps networking Russell King - ARM Linux
2018-11-12 12:29 ` Russell King - ARM Linux
2018-11-12 12:30 ` [RFC PATCH 1/6] dt-bindings: phy: Armada 38x common phy bindings Russell King
2018-11-12 12:30   ` Russell King
2018-12-03 23:53   ` Rob Herring
2018-12-03 23:53     ` Rob Herring
2018-11-12 12:30 ` [RFC PATCH 2/6] phy: armada38x: add common phy support Russell King
2018-11-12 12:30   ` Russell King
2018-11-12 17:03   ` Andrew Lunn [this message]
2018-11-12 17:03     ` Andrew Lunn
2018-11-14  8:42   ` Kishon Vijay Abraham I
2018-11-14  8:42     ` Kishon Vijay Abraham I
2018-11-14  8:42     ` Kishon Vijay Abraham I
2018-11-15 10:02   ` Maxime Chevallier
2018-11-15 10:02     ` Maxime Chevallier
2018-11-12 12:30 ` [RFC PATCH 3/6] ARM: dts: add description for Armada 38x common phy Russell King
2018-11-12 12:30   ` Russell King
2018-11-15 10:02   ` Maxime Chevallier
2018-11-15 10:02     ` Maxime Chevallier
2018-11-12 12:31 ` [RFC PATCH 4/6] dt-bindings: update mvneta binding document Russell King
2018-11-12 12:31   ` Russell King
2018-12-03 23:54   ` Rob Herring
2018-12-03 23:54     ` Rob Herring
2018-12-05 11:00     ` Russell King - ARM Linux
2018-12-05 11:00       ` Russell King - ARM Linux
2018-12-05 15:30       ` Rob Herring
2018-12-05 15:30         ` Rob Herring
2018-12-07  4:07         ` Kishon Vijay Abraham I
2018-12-07  4:07           ` Kishon Vijay Abraham I
2018-12-07 10:41           ` Russell King - ARM Linux
2018-12-07 10:41             ` Russell King - ARM Linux
2018-12-07 11:13             ` Kishon Vijay Abraham I
2018-12-07 11:13               ` Kishon Vijay Abraham I
2018-12-07 11:33               ` Russell King - ARM Linux
2018-12-07 11:33                 ` Russell King - ARM Linux
2018-12-07 12:00                 ` Kishon Vijay Abraham I
2018-12-07 12:00                   ` Kishon Vijay Abraham I
2018-12-07 12:17                   ` Russell King - ARM Linux
2018-12-07 12:17                     ` Russell King - ARM Linux
2018-11-12 12:31 ` [RFC PATCH 5/6] net: marvell: neta: add support for 2500base-X Russell King
2018-11-12 12:31   ` Russell King
2018-11-14  8:48   ` Kishon Vijay Abraham I
2018-11-14  8:48     ` Kishon Vijay Abraham I
2018-11-14  8:48     ` Kishon Vijay Abraham I
2018-11-14 11:11     ` Russell King - ARM Linux
2018-11-14 11:11       ` Russell King - ARM Linux
2018-11-21  9:38       ` Kishon Vijay Abraham I
2018-11-21  9:38         ` Kishon Vijay Abraham I
2018-11-15 10:02   ` Maxime Chevallier
2018-11-15 10:02     ` Maxime Chevallier
2018-11-12 12:31 ` [RFC PATCH 6/6] ARM: dts: clearfog: add comphy settings for Ethernet interfaces Russell King
2018-11-12 12:31   ` Russell King
2018-11-15 10:02   ` Maxime Chevallier
2018-11-15 10:02     ` Maxime Chevallier
2018-11-14  8:09 ` [RFC PATCH 0/6] Armada 38x comphy driver to support 2.5Gbps networking Kishon Vijay Abraham I
2018-11-14  8:09   ` Kishon Vijay Abraham I
2018-11-14  8:09   ` Kishon Vijay Abraham I
2018-11-14 10:56   ` Russell King - ARM Linux
2018-11-14 10:56     ` Russell King - ARM Linux
2018-11-21  9:41     ` Kishon Vijay Abraham I
2018-11-21  9:41       ` Kishon Vijay Abraham I
2018-11-15 10:02 ` Maxime Chevallier
2018-11-15 10:02   ` Maxime Chevallier

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=20181112170331.GB5075@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=jason@lakedaemon.net \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@free-electrons.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 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.