Received: by 10.213.65.68 with SMTP id h4csp865822imn; Tue, 27 Mar 2018 10:11:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/bo3t/V/S+4KYfg9KfrRp1pnESLG5jiV2Ik1KXeONKLsRmrUzj5LjWiFesl2+NLGUeVUjJ X-Received: by 10.99.142.201 with SMTP id k192mr113709pge.278.1522170700256; Tue, 27 Mar 2018 10:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522170700; cv=none; d=google.com; s=arc-20160816; b=G5ClyJRBAZmf00iwXpk5Oo4VxgSMDf0JvrFrXjvkiCmRBJGzLJZ/pdhkxedVm5mcQ3 2zUlVD171M1/nqoxKkeotVlisV7XY2s43+E9SNY09EHzKMxuWgKaz6RXqKR86QdAQn0I bmiEemHpwl1hF4oMUIL0210tg6HJS2vARv70SuYuaq3xNLrpRDPwEpo22ljuAhFevgnP RkiIINoedddBPva4GXJeRkYgsgdct5vqPwAZOZLgwFXNB4Oe74EE0QsaKeg4t66lZZyi 1rX+31heHD/o9Pul+FCk8gvbrtlBqMeaMPCuL79IHwKQgVriSWLBKxej/x+VdXTisDG3 jBwA== 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=uDuXOSdx6AV8yUglrXFzqE6rKNOs3tHcK0Glf7r2oWg=; b=poUKelvOA+goDDo4mWBpXzeAd29oD2GIGPDsYvmOMk1OZXQYp7McVj6F6zpSMCC5kX O/JYSqrtCh3Psoh+5DuSmY2BTg3/RgZhQ+PmmtAcH15FukjxXS4ImBYzLraXyDEefTE5 1T0qfk9XiaNjNueGCWjgeu6qPMr/CtdUftLOhBPt/5nyYF3Ulp9OgOdaAWLN25K09NZ0 h9f+mi2bEMD/YOMPFr4vxbYvdCYV+5a764b5zyp9abVEw7IiKgkOu8I4YhZVaGN6V8TI khFA5aDS61ROCjo6pOLiwP2c00TcBIIvJSofSeMbnNcFu370dtLg/O3ko3deGbn7zxfD MWGg== 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 m13si1118260pgs.482.2018.03.27.10.11.26; Tue, 27 Mar 2018 10:11:40 -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 S932328AbeC0Qjm (ORCPT + 99 others); Tue, 27 Mar 2018 12:39:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47274 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932303AbeC0Qjf (ORCPT ); Tue, 27 Mar 2018 12:39:35 -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 B08DC1027; Tue, 27 Mar 2018 16:39:34 +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.15 027/105] clk: sunxi-ng: a31: Fix CLK_OUT_* clock ops Date: Tue, 27 Mar 2018 18:27:07 +0200 Message-Id: <20180327162759.045645626@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@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.15-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 @@ -762,7 +762,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), }, }; @@ -783,7 +783,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), }, }; @@ -804,7 +804,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), }, };