diff mbox

[v3] drivers:soc:fsl:qbman:qman.c: Sleep instead of stuck hacking jiffies.

Message ID 1493963118-11064-1-git-send-email-karim.eshapa@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Karim Eshapa May 5, 2017, 5:45 a.m. UTC
Use msleep() instead of stucking with
long delay will be more efficient.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
 drivers/soc/fsl/qbman/qman.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Crystal Wood June 25, 2017, 2:46 a.m. UTC | #1
On Fri, May 05, 2017 at 07:45:18AM +0200, Karim Eshapa wrote:
> Use msleep() instead of stucking with
> long delay will be more efficient.
> 
> Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
> ---
>  drivers/soc/fsl/qbman/qman.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

Acked-by: Scott Wood <oss@buserror.net>

(though the subject line should be "soc/qman: ...")

Leo, are you going to send this patch (and other qman patches) via
arm-soc?

-Scott
Leo Li June 27, 2017, 4:38 p.m. UTC | #2
> -----Original Message-----
> From: Scott Wood [mailto:oss@buserror.net]
> Sent: Saturday, June 24, 2017 9:47 PM
> To: Karim Eshapa <karim.eshapa@gmail.com>
> Cc: Roy Pledge <roy.pledge@nxp.com>; linux-kernel@vger.kernel.org;
> Claudiu Manoil <claudiu.manoil@nxp.com>; colin.king@canonical.com;
> linuxppc-dev@lists.ozlabs.org; linux-arm-kernel@lists.infradead.org; Leo Li
> <leoyang.li@nxp.com>
> Subject: Re: [v3] drivers:soc:fsl:qbman:qman.c: Sleep instead of stuck
> hacking jiffies.
> 
> On Fri, May 05, 2017 at 07:45:18AM +0200, Karim Eshapa wrote:
> > Use msleep() instead of stucking with
> > long delay will be more efficient.
> >
> > Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
> > ---
> >  drivers/soc/fsl/qbman/qman.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> Acked-by: Scott Wood <oss@buserror.net>
> 
> (though the subject line should be "soc/qman: ...")
> 
> Leo, are you going to send this patch (and other qman patches) via arm-soc?

Yes.  I can take it through the pull request for soc/fsl via arm-soc.  As mentioned in the feedback from David in another email, probably we should update the comment and commit message to mention how 10000 cycles becomes 1ms.

Regards,
Leo
diff mbox

Patch

diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index 3d891db..18d391e 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -1084,11 +1084,7 @@  static int drain_mr_fqrni(struct qm_portal *p)
 		 * entries well before the ring has been fully consumed, so
 		 * we're being *really* paranoid here.
 		 */
-		u64 now, then = jiffies;
-
-		do {
-			now = jiffies;
-		} while ((then + 10000) > now);
+		msleep(1);
 		msg = qm_mr_current(p);
 		if (!msg)
 			return 0;