From patchwork Fri May 5 08:04:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karim Eshapa X-Patchwork-Id: 758896 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wK4Hj35tSz9s9c for ; Fri, 5 May 2017 18:07:13 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="msruJ/dK"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wK4Hj1ztbzDqKR for ; Fri, 5 May 2017 18:07:13 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="msruJ/dK"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wK4Dz6p73zDqJX for ; Fri, 5 May 2017 18:04:51 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="msruJ/dK"; dkim-atps=neutral Received: by mail-wr0-x242.google.com with SMTP id w50so3588909wrc.0 for ; Fri, 05 May 2017 01:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=szVdbYZolec7Pqj9rd8FDRNCTgWahRvaigKo545RZ5w=; b=msruJ/dKGS2qiTdt4YS6fAd1gNJ4x4voAnlwfI/BdKjVMGg6YO4LGxCNUd/ErI5YC/ /T1mBDgkI+kmrzQvx5McdugyQxkbDXmtjoKfgvcOSjiRc5AvollkPHyH4kuLv585PfN9 kLQq0zSPTiiHsgRL2/bbZmfnDTPwFy+TvoyjnoqbnyaRh/rIwo/wiHSMzOqxIeZ3iF3x HjjRveF4I75XFeNyGCgwIPulcOOPQQJYK1FlweoloopiYzgMCcL4pg7Bz+251bSC5jPw ShYaoWt+NLMdqbrjlGMGc+3GYwCU3aTvcFHTTDqGyidfx7FyQlfJYPdoYWpaiApep1YK vFNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=szVdbYZolec7Pqj9rd8FDRNCTgWahRvaigKo545RZ5w=; b=TD8RDPDj/vVefYb2Rgux+hItPiwKIYoZVuLYtrCt46FszNdGtwM/m/yq3S7Cn8O7ij wj7gJhfaFB1kLxtWrGpIXlgITdcSDeZ2Xs3c8T1e1LKpdJoY4/3gYLsDMPTxeocNgC0U 0KFdRVQ+gUndnAMKQEHtEznlhX/X2Ez5I17ANvAz9f4b/AoQXrDc3NCHqvhVFPr1Wvvd CXfpdsrQmnpLzF9OSMDACqr5JyqMG2HZR7X6yFGHewQYWFtcGjgKm/xT43Zs/ZkZv0qB keiTZf0rAWpmn6DObLtXMTKOo4D5yFfatu8wsUE7Lhn9M5189IQRbBhkbJhcWbUYRbKs gy5A== X-Gm-Message-State: AN3rC/6DuDXYrmJdL7JPV3kY6LgA84nu9gzyflPkEpAqh5yJlaXcyq3x 3T4kTcZQZtTo5Q== X-Received: by 10.223.172.149 with SMTP id o21mr28910075wrc.181.1493971488902; Fri, 05 May 2017 01:04:48 -0700 (PDT) Received: from localhost.localdomain ([156.194.27.202]) by smtp.gmail.com with ESMTPSA id y60sm4773319wrb.39.2017.05.05.01.04.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 May 2017 01:04:48 -0700 (PDT) From: Karim Eshapa To: oss@buserror.net Subject: [PATCH] drivers:soc:fsl:qbman:qman.c: Change a comment for an entry check inside drain_mr_fqrni function Date: Fri, 5 May 2017 10:04:39 +0200 Message-Id: <1493971480-14864-1-git-send-email-karim.eshapa@gmail.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Karim Eshapa , roy.pledge@nxp.com, linux-kernel@vger.kernel.org, claudiu.manoil@nxp.com, colin.king@canonical.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Change the comment for an entry check inside function drain_mr_fqrni() with sleep for sufficient period of time instead of long time proccessor cycles. Signed-off-by: Karim Eshapa --- drivers/soc/fsl/qbman/qman.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 18d391e..636a7d7 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1071,18 +1071,19 @@ static int drain_mr_fqrni(struct qm_portal *p) msg = qm_mr_current(p); if (!msg) { /* - * if MR was full and h/w had other FQRNI entries to produce, we - * need to allow it time to produce those entries once the - * existing entries are consumed. A worst-case situation - * (fully-loaded system) means h/w sequencers may have to do 3-4 - * other things before servicing the portal's MR pump, each of - * which (if slow) may take ~50 qman cycles (which is ~200 - * processor cycles). So rounding up and then multiplying this - * worst-case estimate by a factor of 10, just to be - * ultra-paranoid, goes as high as 10,000 cycles. NB, we consume - * one entry at a time, so h/w has an opportunity to produce new - * entries well before the ring has been fully consumed, so - * we're being *really* paranoid here. + * if MR was full and h/w had other FQRNI entries to + * produce, we need to allow it time to produce those + * entries once the existing entries are consumed. + * A worst-case situation (fully-loaded system) means + * h/w sequencers may have to do 3-4 other things + * before servicing the portal's MR pump, each of + * which (if slow) may take ~50 qman cycles + * (which is ~200 processor cycles). So sleep with + * 1 ms would be very efficient, after this period + * we can check if there is something produced. + * NB, we consume one entry at a time, so h/w has + * an opportunity to produce new entries well before + * the ring has been fully consumed. */ msleep(1); msg = qm_mr_current(p);