Received: by 10.213.65.68 with SMTP id h4csp881278imn; Tue, 27 Mar 2018 10:30:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx49rchzEyR3U80mTfOyJ9IAlqTxMgJbJJXa8/Q5oal+r9u5282+DUNiM7i7Dd92Dc+rGxwp6 X-Received: by 2002:a17:902:33c2:: with SMTP id b60-v6mr227121plc.222.1522171800273; Tue, 27 Mar 2018 10:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171800; cv=none; d=google.com; s=arc-20160816; b=sqK3cFA8n1NZfg35ajmAgzrLveOn3QX56YQdeOW5M+i0Hh9NV7NyVCCOiE+v3cbgvj wwc6TjPRVQVEISBbHvOlw4gzoxSiWLRbMVouOR8Xf7hdjaX0CTzFOkHJPok8f+Pl2Y+7 R+a8zqiuNk2RuzUMivvMqA4ODA7EDEdJCjca5PC+xDhP00BKAhNHua9pYJUvdaiHdnf9 JeZWGfZVxnH1u5RkAoRb/8R3Pr2PNrbYxFYpl+sQleY2ejy72y2GvtxyN+lOmf73iDJi ExWK5klmJlN1WuyTLwC/Sq2uU2xm2SlfOYWAEtappj51hL0Ab7iS7eC6sMdEKl4Iitvy xWVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=u7zD8W0zcekjgmCdBvauc5gDm1yNKEwMcTjiDHQS3+k=; b=uvkc0jO/PnV8XJAFi5mU0DEHGUCjauO8wXRvjUZ4SU9RSD5Og/c2WKzF9hitANnqpr rJ7bgqOc0kiSlZQw2TIE7s6A8YimjSFpw7UdHICx/KcA4QeV5wD3TaM6HZRJcNaXy1fc ZB5dWR2x4zOorX6jJGjfCv89UwKJXuoivM/ArrRCRzENT4wDz3TK+QVNT1Qjk/y6Er9q Migli6AOLnDBqoQE4BlzXJpQkhDu7M2J/Alz6vV5DHCGHh3b5I+9vgwofRtfduQnp2ky xci+dKOUMCEiy+zhJBl0rolEW1nugUqAoHRLNQcpkZghM5dxvYHE2cJTkzBPPiIHgY/Q QOgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si1118565pgs.22.2018.03.27.10.29.45; Tue, 27 Mar 2018 10:30:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754689AbeC0R1n (ORCPT + 99 others); Tue, 27 Mar 2018 13:27:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45788 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754705AbeC0Qg3 (ORCPT ); Tue, 27 Mar 2018 12:36:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4EA00EF8; Tue, 27 Mar 2018 16:36:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Rossak , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH 4.14 027/101] clk: sunxi-ng: a31: Fix CLK_OUT_* clock ops Date: Tue, 27 Mar 2018 18:26:59 +0200 Message-Id: <20180327162751.654694029@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chen-Yu Tsai commit 5682e268350f9eccdbb04006605c1b7068a7b323 upstream. When support for the A31/A31s CCU was first added, the clock ops for the CLK_OUT_* clocks was set to the wrong type. The clocks are MP-type, but the ops was set for div (M) clocks. This went unnoticed until now. This was because while they are different clocks, their data structures aligned in a way that ccu_div_ops would access the second ccu_div_internal and ccu_mux_internal structures, which were valid, if not incorrect. Furthermore, the use of these CLK_OUT_* was for feeding a precise 32.768 kHz clock signal to the WiFi chip. This was achievable by using the parent with the same clock rate and no divider. So the incorrect divider setting did not affect this usage. Commit 946797aa3f08 ("clk: sunxi-ng: Support fixed post-dividers on MP style clocks") added a new field to the ccu_mp structure, which broke the aforementioned alignment. Now the system crashes as div_ops tries to look up a nonexistent table. Reported-by: Philipp Rossak Tested-by: Philipp Rossak Fixes: c6e6c96d8fa6 ("clk: sunxi-ng: Add A31/A31s clocks") Cc: Signed-off-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Signed-off-by: Greg Kroah-Hartman --- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c +++ b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c @@ -750,7 +750,7 @@ static struct ccu_mp out_a_clk = { .features = CCU_FEATURE_FIXED_PREDIV, .hw.init = CLK_HW_INIT_PARENTS("out-a", clk_out_parents, - &ccu_div_ops, + &ccu_mp_ops, 0), }, }; @@ -771,7 +771,7 @@ static struct ccu_mp out_b_clk = { .features = CCU_FEATURE_FIXED_PREDIV, .hw.init = CLK_HW_INIT_PARENTS("out-b", clk_out_parents, - &ccu_div_ops, + &ccu_mp_ops, 0), }, }; @@ -792,7 +792,7 @@ static struct ccu_mp out_c_clk = { .features = CCU_FEATURE_FIXED_PREDIV, .hw.init = CLK_HW_INIT_PARENTS("out-c", clk_out_parents, - &ccu_div_ops, + &ccu_mp_ops, 0), }, };