From patchwork Mon May 13 14:46:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 10942405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A40B4912 for ; Tue, 14 May 2019 07:40:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93A0728609 for ; Tue, 14 May 2019 07:40:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91FB128694; Tue, 14 May 2019 07:40:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 051742864F for ; Tue, 14 May 2019 07:40:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 949C58922B; Tue, 14 May 2019 07:40:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 930ED89EB4 for ; Mon, 13 May 2019 14:46:26 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id h17so6913808pgv.0 for ; Mon, 13 May 2019 07:46:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=hDlLp8gwqnQ16UXEzX9Fg7JeC4W1dA1vA7VjX4loo84=; b=RB5hy88KnkusvtzUKfsIfZqa/o2X2Qg25gUpvNP0iZCGi5PDaSf1DiHFgG4+wJUbhS p9n4VonlOh073xU3cexiD6mnrXIVUfb3MHUheR/9EkF3tOiOn99ToWvUQjA+bGgkvABK /eoEtqRdDNak88uIuEvKfkbZHwB3fMTRMW3lOJzKbHvqKBgJBqDEHLWyOVhab94B8E3x RRxeICi/uNqzPq/8FHdTiID+ePvoMY7lfZOhpZ8YkPYgw5j3IQwT3vxYVOwkFNO3+xzc cYerRR8aaheC9/6snQvS+Hvjha7vIUzgxvtegyC2WtNVlLiBimGFRjE+oXRgX8pX1ffo OSKg== X-Gm-Message-State: APjAAAXJWyJuJIsxXgFzdc1vImQKmej7x+FVGLsgF+FuWFT0lUwAdL6D KgU0p06qZJcj4O6n9n9lJVO8bFzb X-Google-Smtp-Source: APXvYqzzzKQrUcOIQAOnu8TxTyv4WlQpQe+3fg6rcjWThxHbMUApW44a0tOe/dwk7j4A3kW8QMGZ+A== X-Received: by 2002:a63:e645:: with SMTP id p5mr31283713pgj.4.1557758785882; Mon, 13 May 2019 07:46:25 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e62sm17928873pfa.50.2019.05.13.07.46.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 07:46:24 -0700 (PDT) From: Guenter Roeck To: Eric Anholt Subject: [PATCH] drm/pl111: Initialize clock spinlock early Date: Mon, 13 May 2019 07:46:21 -0700 Message-Id: <1557758781-23586-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Tue, 14 May 2019 07:40:44 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=hDlLp8gwqnQ16UXEzX9Fg7JeC4W1dA1vA7VjX4loo84=; b=nTvATzP8y/LakwhSQ2DIU1KrlhMsKpIwBwryGeJMQIrmAnjalB6jhX7fO2R02kh8jg X/RdM0CtJ6rLAUfW9nMloT9NuWt6b+i609Cj8+5iHOo8pysmnrYf52+YjAqrfjUmZiyg /ZJK52Vi5J2nE34G3SURY8GBFUE2k5vMbrro3L1ARN9pplHxP62PaXelCyBq3xakOSf7 2+tsUFTS3lo6D9JO7JD2vAXJ9DTL7SCmYPvCfc/M/EowNnxu3lOyIaco6JDXo3al3mFM r741hMrA4DcsGNtXK6ot4kHwBcLjmmjj8Z90rAJKnogexEO9DQbBRbDsnIZCWQqVKT3o j/iw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Guenter Roeck MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The following warning is seen on systems with broken clock divider. INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 1 Comm: swapper Not tainted 5.1.0-09698-g1fb3b52 #1 Hardware name: ARM Integrator/CP (Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x18) [] (show_stack) from [] (dump_stack+0x18/0x24) [] (dump_stack) from [] (register_lock_class+0x674/0x6f8) [] (register_lock_class) from [] (__lock_acquire+0x68/0x2128) [] (__lock_acquire) from [] (lock_acquire+0x110/0x21c) [] (lock_acquire) from [] (_raw_spin_lock+0x34/0x48) [] (_raw_spin_lock) from [] (pl111_display_enable+0xf8/0x5fc) [] (pl111_display_enable) from [] (drm_atomic_helper_commit_modeset_enables+0x1ec/0x244) Since commit eedd6033b4c8 ("drm/pl111: Support variants with broken clock divider"), the spinlock is not initialized if the clock divider is broken. Initialize it earlier to fix the problem. Fixes: eedd6033b4c8 ("drm/pl111: Support variants with broken clock divider") Cc: Linus Walleij Signed-off-by: Guenter Roeck --- drivers/gpu/drm/pl111/pl111_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index 0c5d391f0a8f..4501597f30ab 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -531,14 +531,15 @@ pl111_init_clock_divider(struct drm_device *drm) dev_err(drm->dev, "CLCD: unable to get clcdclk.\n"); return PTR_ERR(parent); } + + spin_lock_init(&priv->tim2_lock); + /* If the clock divider is broken, use the parent directly */ if (priv->variant->broken_clockdivider) { priv->clk = parent; return 0; } parent_name = __clk_get_name(parent); - - spin_lock_init(&priv->tim2_lock); div->init = &init; ret = devm_clk_hw_register(drm->dev, div);