From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 926F7C433E1 for ; Wed, 19 Aug 2020 15:01:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60E052076E for ; Wed, 19 Aug 2020 15:01:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YD5ECiwg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60E052076E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Arpxf4WB6DErO86pOZ0Wj8EIOukxMVgbjDJVE0VT85A=; b=YD5ECiwgEBNogF+Y2L5pdF9uK jblNTkAm/+d5hKn+EJ00VXiu12X80wN2lGkJYeH/Vp50i+0ruG3xvkyvFVhJWnkxi40egH4OexyYv MkB49LmRuMYPXzukTU3CvwvO5zAKCUCNp20UhQgPHqcfXYcV6lIxce3+WA1QboQSxbnHc3ric/lHR nHj9h8rmZU9Il3G9ekE3kImaTZwaQZg9bpeGIZI96Du4dxyJjPaeuPLCWq0c/U8lGqYy1/BokDgdN dbMNx2tnACftWfx5L8hBDJXSHlZj6fGEorRCpT9q80b5PCMhgj36UpvuHqoFyYqs6/PI/93HPrLh2 OEBdFBEtQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8PZT-0001Ex-AU; Wed, 19 Aug 2020 15:00:11 +0000 Received: from netrider.rowland.org ([192.131.102.5]) by merlin.infradead.org with smtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8PZJ-00019M-8S for linux-arm-kernel@lists.infradead.org; Wed, 19 Aug 2020 15:00:07 +0000 Received: (qmail 183296 invoked by uid 1000); 19 Aug 2020 10:59:57 -0400 Date: Wed, 19 Aug 2020 10:59:57 -0400 From: Alan Stern To: Chunfeng Yun Subject: Re: [PATCH 10/10] usb: udc: net2280: convert to readl_poll_timeout_atomic() Message-ID: <20200819145957.GA183103@rowland.harvard.edu> References: <1597840865-26631-1-git-send-email-chunfeng.yun@mediatek.com> <1597840865-26631-10-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1597840865-26631-10-git-send-email-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200819_110001_496975_3ED62EE8 X-CRM114-Status: GOOD ( 18.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , Lee Jones , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 19, 2020 at 08:41:05PM +0800, Chunfeng Yun wrote: > Use readl_poll_timeout_atomic() to simplify code > > Cc: Alan Stern > Cc: Felipe Balbi > Signed-off-by: Chunfeng Yun > --- > drivers/usb/gadget/udc/net2280.c | 21 ++++++++++----------- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c > index 7530bd9..f1a21f4 100644 > --- a/drivers/usb/gadget/udc/net2280.c > +++ b/drivers/usb/gadget/udc/net2280.c > @@ -52,6 +52,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -360,18 +361,16 @@ static inline void enable_pciirqenb(struct net2280_ep *ep) > static int handshake(u32 __iomem *ptr, u32 mask, u32 done, int usec) > { > u32 result; > + int ret; > > - do { > - result = readl(ptr); > - if (result == ~(u32)0) /* "device unplugged" */ > - return -ENODEV; > - result &= mask; > - if (result == done) > - return 0; > - udelay(1); > - usec--; > - } while (usec > 0); > - return -ETIMEDOUT; > + ret = readl_poll_timeout_atomic(ptr, result, > + ((result & mask) == done || > + result == U32_MAX), > + 1, usec); > + if (result == U32_MAX) /* device unplugged */ > + return -ENODEV; > + > + return ret; > } > > static const struct usb_ep_ops net2280_ep_ops; > -- Acked-by: Alan Stern However, I noticed that the kerneldoc for readl_poll_timeout_atomic() is out of date. Can you fix it up? Alan Stern _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel