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: 9041001 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B7F58BF29F for ; Mon, 9 May 2016 02:24:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7F412012D for ; Mon, 9 May 2016 02:24:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E5AAD200F2 for ; Mon, 9 May 2016 02:24:26 +0000 (UTC) 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" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)