From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylwester Nawrocki Subject: Re: [PATCHv3 2/2] phy: exynos5-usbdrd: Calibrate LOS levels for exynos5420/5800 Date: Thu, 05 Oct 2017 14:28:24 +0200 Message-ID: <88cf66cc-0bca-3ad9-183b-d55f7f258028@samsung.com> References: <6935498c-9788-14e6-844f-f9e8288026dc@samsung.com> <1507205511-23048-1-git-send-email-andrzej.p@samsung.com> <1507205511-23048-3-git-send-email-andrzej.p@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <1507205511-23048-3-git-send-email-andrzej.p-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> Content-language: en-GB Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andrzej Pietrasiewicz , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Marek Szyprowski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Kukjin Kim , Russell King , Mark Rutland , Rob Herring , Kishon Vijay Abraham I , Felipe Balbi , Greg Kroah-Hartman List-Id: devicetree@vger.kernel.org On 10/05/2017 02:11 PM, Andrzej Pietrasiewicz wrote: > +static int crport_handshake(struct exynos5_usbdrd_phy *phy_drd, > + u32 val, u32 cmd) > +{ > + u32 usec = 100; > + unsigned int result; > + > + writel(val | cmd, phy_drd->reg_phy + EXYNOS5_DRD_PHYREG0); > + > + do { > + result = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYREG1); > + if (result & PHYREG1_CR_ACK) > + break; > + > + udelay(1); > + } while (usec-- > 0); It looks like you could use readl_poll_timeout_atomic() macro instead of these polling loops. -- Regards, Sylwester -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html