Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3755715pxt; Tue, 10 Aug 2021 10:33:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC9gw6iabSjpn6k885q/dzZ0k4/jjwfzxsaVG8OjBdeY3j3O7TubH6vayw4LsATOLf4axn X-Received: by 2002:aa7:da19:: with SMTP id r25mr6298159eds.247.1628616838896; Tue, 10 Aug 2021 10:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628616838; cv=none; d=google.com; s=arc-20160816; b=imWOQMQby+i3Xcf5P8ahbS35kocsH8V2Xf231pBoue/ISc99CrzOCVMXgTrAftJSpl dST8288lOx0Json9LWCGFDdWbIGqld8TzRvkEBC+YOsf0i7lSc3eiY0+hubIDGImp7UG j/YptwncIj1FJqkDUgzNiOZ8D+SZpzODB1yXovxBri/rtLoy4wcO7pN7J68/8jPG2V+H iRLnIUwYsyvPmI9sdDxgs1avjWcZrwGsKuTUBnLXYMT7Q4bXN5bVawY28ptHJE79TkN+ V9nIHA4u2JihBBizT/OAqlPT1xrcf1J8QhhHPlydAghyKm7r6OJSwlLVSKz1XTiCkjAp Y89A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JUpYvQVAiR5wLC75NqonaAGgmDg0Zrp1e+9DYPpjqnY=; b=r9lSy8u98OgEXng0aM//tJJRtmcY2s2k5mTrJukmDqn5xJC3wsSFQhMdk5LcpAcjl9 NPQjFxU9qCRHyaTP43vswKu84ktZnJ+w3IGNxT8zDu5TxthwSHt0VKrwBmBd8FQnJ+wx Juq/vfM3r+wWqGgI7mjTUxkDejv2zEBPSoO3NkiVBZGj8ixprL+4XinY/lVpWDwoQeNv h1ut+nXLDCUY417G2WdKnkKKzw7QswVc7texNlvtGVo72XTWCxTBIbd+pJVEl3AYTh2D b/zYJAt1E+oKQyZhvy4fkzClvZAtx2yyxODlLEaNrVnJ4UnpFNUAYfrQ5kmg3Ah9KwJK ZNbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="cF/QfKpd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si25364637ejy.385.2021.08.10.10.33.33; Tue, 10 Aug 2021 10:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="cF/QfKpd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231173AbhHJRcT (ORCPT + 99 others); Tue, 10 Aug 2021 13:32:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:59682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbhHJRcO (ORCPT ); Tue, 10 Aug 2021 13:32:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 944B060E09; Tue, 10 Aug 2021 17:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616712; bh=7cN6JxXR7MAzSg5RK7Yhmrr6zef6rU1dCBeoBfaTzBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cF/QfKpdFmqad1ft/42uRV8e4nwpdp73dZkOttnugpXCifNvjLTsjDTretUwvtj3y h4GSBLAHtlJa3r30S/LgmEbt89V2pb4ZUrYNfKk/Gvfluh/D2IeIZJOynxkHpGPuJj uHnlEfbQ23sy5Q+UdkfTFJ/u62/8RKuGBJsb3jZo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dario Binacchi , Gabriel Fernandez , Stephen Boyd , Sasha Levin Subject: [PATCH 4.19 06/54] clk: stm32f4: fix post divisor setup for I2S/SAI PLLs Date: Tue, 10 Aug 2021 19:30:00 +0200 Message-Id: <20210810172944.393009103@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172944.179901509@linuxfoundation.org> References: <20210810172944.179901509@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dario Binacchi [ Upstream commit 24b5b1978cd5a80db58e2a19db2f9c36fe8d4f7a ] Enabling the framebuffer leads to a system hang. Running, as a debug hack, the store_pan() function in drivers/video/fbdev/core/fbsysfs.c without taking the console_lock, allows to see the crash backtrace on the serial line. ~ # echo 0 0 > /sys/class/graphics/fb0/pan [ 9.719414] Unhandled exception: IPSR = 00000005 LR = fffffff1 [ 9.726937] CPU: 0 PID: 49 Comm: sh Not tainted 5.13.0-rc5 #9 [ 9.733008] Hardware name: STM32 (Device Tree Support) [ 9.738296] PC is at clk_gate_is_enabled+0x0/0x28 [ 9.743426] LR is at stm32f4_pll_div_set_rate+0xf/0x38 [ 9.748857] pc : [<0011e4be>] lr : [<0011f9e3>] psr: 0100000b [ 9.755373] sp : 00bc7be0 ip : 00000000 fp : 001f3ac4 [ 9.760812] r10: 002610d0 r9 : 01efe920 r8 : 00540560 [ 9.766269] r7 : 02e7ddb0 r6 : 0173eed8 r5 : 00000000 r4 : 004027c0 [ 9.773081] r3 : 0011e4bf r2 : 02e7ddb0 r1 : 0173eed8 r0 : 1d3267b8 [ 9.779911] xPSR: 0100000b [ 9.782719] CPU: 0 PID: 49 Comm: sh Not tainted 5.13.0-rc5 #9 [ 9.788791] Hardware name: STM32 (Device Tree Support) [ 9.794120] [<0000afa1>] (unwind_backtrace) from [<0000a33f>] (show_stack+0xb/0xc) [ 9.802421] [<0000a33f>] (show_stack) from [<0000a8df>] (__invalid_entry+0x4b/0x4c) The `pll_num' field in the post_div_data configuration contained a wrong value which also referenced an uninitialized hardware clock when clk_register_pll_div() was called. Fixes: 517633ef630e ("clk: stm32f4: Add post divisor for I2S & SAI PLLs") Signed-off-by: Dario Binacchi Reviewed-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20210725160725.10788-1-dariobin@libero.it Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-stm32f4.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c index 294850bdc195..61de486dec41 100644 --- a/drivers/clk/clk-stm32f4.c +++ b/drivers/clk/clk-stm32f4.c @@ -454,7 +454,7 @@ struct stm32f4_pll { struct stm32f4_pll_post_div_data { int idx; - u8 pll_num; + int pll_idx; const char *name; const char *parent; u8 flag; @@ -485,13 +485,13 @@ static const struct clk_div_table post_divr_table[] = { #define MAX_POST_DIV 3 static const struct stm32f4_pll_post_div_data post_div_data[MAX_POST_DIV] = { - { CLK_I2SQ_PDIV, PLL_I2S, "plli2s-q-div", "plli2s-q", + { CLK_I2SQ_PDIV, PLL_VCO_I2S, "plli2s-q-div", "plli2s-q", CLK_SET_RATE_PARENT, STM32F4_RCC_DCKCFGR, 0, 5, 0, NULL}, - { CLK_SAIQ_PDIV, PLL_SAI, "pllsai-q-div", "pllsai-q", + { CLK_SAIQ_PDIV, PLL_VCO_SAI, "pllsai-q-div", "pllsai-q", CLK_SET_RATE_PARENT, STM32F4_RCC_DCKCFGR, 8, 5, 0, NULL }, - { NO_IDX, PLL_SAI, "pllsai-r-div", "pllsai-r", CLK_SET_RATE_PARENT, + { NO_IDX, PLL_VCO_SAI, "pllsai-r-div", "pllsai-r", CLK_SET_RATE_PARENT, STM32F4_RCC_DCKCFGR, 16, 2, 0, post_divr_table }, }; @@ -1499,7 +1499,7 @@ static void __init stm32f4_rcc_init(struct device_node *np) post_div->width, post_div->flag_div, post_div->div_table, - clks[post_div->pll_num], + clks[post_div->pll_idx], &stm32f4_clk_lock); if (post_div->idx != NO_IDX) -- 2.30.2