From patchwork Mon May 9 02:32:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinliang Liu X-Patchwork-Id: 67335 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1373778qge; Sun, 8 May 2016 19:24:27 -0700 (PDT) X-Received: by 10.66.78.73 with SMTP id z9mr46472029paw.4.1462760667069; Sun, 08 May 2016 19:24:27 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id u4si34473773pfu.157.2016.05.08.19.24.26; Sun, 08 May 2016 19:24:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14ADC6E09C; Mon, 9 May 2016 02:24:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id E93E06E09C for ; Mon, 9 May 2016 02:24:22 +0000 (UTC) Received: by mail-pa0-x236.google.com with SMTP id r5so68578464pag.1 for ; Sun, 08 May 2016 19:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CIoI1ifm3Yv1cgkPIBRfg3KZHW9T8mz20sjifQrtZtQ=; b=g/eWaRp9+yltUlpIMS2yR9c8v0F27zYo9rHP0utK6EydB2ixPELrVA+MeW2dgCAdi1 3zwIq7DyLS1d7WlBiIAe/SblOkiFO43barEJlyCm5d/1BOVI8QmzIQh+Plkb+QGRYMZ/ yXnuURiSbLGgBzJUMygAe7Fc7LsDs7nmGjLwo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CIoI1ifm3Yv1cgkPIBRfg3KZHW9T8mz20sjifQrtZtQ=; b=WUPSsqDnWUNX8QtEbc03fe/VQvgfa4nVYavV1Tc8jjWO1a/AJJ92R5fTACB78HZvMT R9SmVxIsU222EfXkDwXDdDEnj54EGW/Jn0GM3YXweIU9tq5MNAhKao7432TG/mt/NDtj nhgAlioN7zWmc6Gbf8r//EMW6KdmrFWuUg5y73i5QH4LmZSO6NE4vNNDquISoRMbyS2Y zFj5g89eNYzNABce0Izf76+OT77zvDGLtoluF0gYXg9WjksWJpM4QInnFe7/OX43zIgG c57DUBFzlO5jVHQHC95Srd7Zpgt3HE+xz7v+fu6BLOPxn0hcpvu+oihO6/sGmNQ5vPa2 YY+Q== X-Gm-Message-State: AOPr4FUxv3LQKnYJdrYGLJSUah2XNsty63kGK47P0tUQfqvNh2hc1GhQh8FGyhaWAnVbfNUP X-Received: by 10.66.65.235 with SMTP id a11mr46460198pat.155.1462760662212; Sun, 08 May 2016 19:24:22 -0700 (PDT) Received: from HTSAT-OPENLAB-SERVER.localdomain ([219.134.81.243]) by smtp.gmail.com with ESMTPSA id q70sm36066597pfj.81.2016.05.08.19.24.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 May 2016 19:24:21 -0700 (PDT) From: Xinliang Liu To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/hisilicon: Fix no DRM_INFO is printed issue Date: Mon, 9 May 2016 10:32:08 +0800 Message-Id: <1462761128-106487-4-git-send-email-xinliang.liu@linaro.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1462761128-106487-1-git-send-email-xinliang.liu@linaro.org> References: <1462761128-106487-1-git-send-email-xinliang.liu@linaro.org> MIME-Version: 1.0 Cc: daniel.vetter@ffwll.ch, juha_efku@dnainternet.net, daniel.vetter@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch fixed the bellow no DRM_INFO is printed issue: if (!delay_count) DRM_INFO("phylock and phystopstateclklane is not ready.\n"); The above info will not printed, under certain circumstances: If ((BIT(0) | BIT(2)) & val) is never true, break will not happen and delay_count will be max u32 value (?), and no DRM_INFO is printed. Also if ((BIT(0) | BIT(2)) & val) is true at the last possible loop round, break happens, but now delay_count is already zero ( because of earlier delay_count-- ) and DRM_INFO is erroneously printed. Thanks to Juha Leppänen, he reports to me this issue. Signed-off-by: Xinliang Liu Reported-by: Juha Leppänen --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index bfbc2159250d..998452ad0fcb 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -430,12 +430,13 @@ static void dsi_set_mipi_phy(void __iomem *base, * wait for phy's clock ready */ delay_count = 100; - while (delay_count--) { + while (delay_count) { val = readl(base + PHY_STATUS); if ((BIT(0) | BIT(2)) & val) break; udelay(1); + delay_count--; } if (!delay_count)