Received: by 10.223.185.116 with SMTP id b49csp1811385wrg; Sat, 17 Feb 2018 05:55:24 -0800 (PST) X-Google-Smtp-Source: AH8x2259+sW3vOuAUjyc1p8cA/n3FJq21D/znt5epCN6kqZjghmDHlPY+fBD+jr8hqf2kfQZOnx2 X-Received: by 2002:a17:902:9306:: with SMTP id bc6-v6mr8783767plb.29.1518875724771; Sat, 17 Feb 2018 05:55:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518875724; cv=none; d=google.com; s=arc-20160816; b=XHKre5BI3+IZ4nqCoqnH1u8/WfkMku6uGA5BLafe2Qljp/0eU+Cw51n16u6GWaC7Yj hzICTtozYSXNO50kV8izcpjiEEC6qREVMh7Bn7WwbrgWLXTVVcTNZACm1ABTxKQv+1gY 9oR6jOqtLl0V9w37xGofagyT2Qp/BV0dox+tYutcQ1ix6mtmiBtkXFzFItayf3KCpQ/K 2lyztBUQPz2/Wqkn2Adeti7H4ewZixeAz843QZSllVfTcsiF3T5vFfVNldYjWJmvjPy/ CGzLZUjUDe3NIbzLe9+/mK3+r9r4q4tJzyMw8fi4qKR347dBktJVXIq4OjvBlpgDtFoS T8Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=3VNn2RLb9Q1jh5F0/FxXYTgLEGdjRZrDMzoTtdrJKNw=; b=MJhfySkacGFBEHgyVu0fsJ+uFmGMeYSYYFswrIRXwzjjWISaZJSe0evHIjZSehAgVk QDjooBf1uueMQkWjdUpmFfM0ruubQilE+YGJmW2WuLIgM6KXslL7RCQpvzZr94buhwjr kOAijDvdpYhSHG6JiY7ThvBPMpq3BWIDV0qwll77hVFnU2MyXwdoJoJAZyPVvogMb0sg 6nZJNGmMjIDnD3F3DZwnvNX6l3L2X8DraoXHz8SaLJNVmj3pxNCXR9gdSlX1qM6cBlBd xYRxG+K0gCBug6b25LUHh/IDvtCekdACsYsHDVWskJUCMev/03XZyzAVLtge4FEfmoDS AksQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HDtUvvyg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h61-v6si1460858pld.816.2018.02.17.05.55.10; Sat, 17 Feb 2018 05:55:24 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HDtUvvyg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751212AbeBQNyX (ORCPT + 99 others); Sat, 17 Feb 2018 08:54:23 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:41319 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbeBQNyU (ORCPT ); Sat, 17 Feb 2018 08:54:20 -0500 Received: by mail-wr0-f193.google.com with SMTP id f14so988519wre.8; Sat, 17 Feb 2018 05:54:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3VNn2RLb9Q1jh5F0/FxXYTgLEGdjRZrDMzoTtdrJKNw=; b=HDtUvvygluRA2lfaTm6s0TdPmAicOG9Zl4NK0uEkVdQnY8OIr/M4OlAjF4JFtGM2VN DEMC54N2a6ELvRJFt0Qfy7j4VNtBI8pAMHgXpt8/8h3MfTJsNuSX6yV6sW5VkQz7ItKo jeV9kR3m/N81UlYazLBp5FXM3zKBb4jl0/bDJVul8vTjAv5E5mN66bPphA+5sx8T3Qsa OA1/fCIX76pk2B64hoGqFg7hM3/pIVh5z8+XKxdwBonLWYAIndTvb6+yq/+4T3H9+H/2 Rd9a4XG/01kJjN7NHlSD1tMnGYRPJs1HcvmWGBdm9UlLYC5err83Je/b5RmVGOwTjdA6 nAng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3VNn2RLb9Q1jh5F0/FxXYTgLEGdjRZrDMzoTtdrJKNw=; b=rlRoVReFw+LKMXaDZ6g0vf/ZirZmK69LnKAwypKxL14ynzFS3hnJxCcLr22CskbPJU 7F2QKCzIGplNrhb8o4aJqw/kAEtwZ5TUqyHwJpKoIocJw7ttTWl7MUglagJsHujZ2KG1 IYwdOH1J5n3QgIUW19nZdlNwkxq1ev6NMJ5igJGU/CkLzUDAIB0ZOPinvCPONyYoCWoR MUIiD6ax9WTTEQF+4diycq9+312o3NCkJVdG5AHkAUOtV67E4wJdv+8SKei4AkZRhXBl hxSs3o8YLDWSn8cNZSbVsNVT3in8eHK5BnFsXBbF650XaTzh+MoTrFOhiiRzqoc02mRN coRQ== X-Gm-Message-State: APf1xPBbj7n73lbMVd/fM3ckLWjzfkFHsGMNFyMGeWZjvZOkcnWUpehS NcrpXo6nXrNHZrskihf6BCDj7zgT X-Received: by 10.223.149.68 with SMTP id 62mr1600086wrs.249.1518875658737; Sat, 17 Feb 2018 05:54:18 -0800 (PST) Received: from [192.168.2.62] (p578F04D2.dip0.t-ipconnect.de. [87.143.4.210]) by smtp.gmail.com with ESMTPSA id z78sm29625778wrc.53.2018.02.17.05.54.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Feb 2018 05:54:18 -0800 (PST) Subject: Re: [PATCH] clk: sunxi-ng: a31: Fix CLK_OUT_* clock ops To: Chen-Yu Tsai , Maxime Ripard , Michael Turquette , Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20180217130504.8668-1-wens@csie.org> From: Philipp Rossak Message-ID: <694c5137-0020-bb62-68c7-f9729c101462@gmail.com> Date: Sat, 17 Feb 2018 14:54:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180217130504.8668-1-wens@csie.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17.02.2018 14:05, Chen-Yu Tsai wrote: > 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 > Fixes: c6e6c96d8fa6 ("clk: sunxi-ng: Add A31/A31s clocks") > Cc: > Signed-off-by: Chen-Yu Tsai Tested-by: Philipp Rossak > --- > > Philipp, can you give this a test and report if this fixes thing? > I don't have any A31/A31s boards online to test this. > Thanks! That fixes that bug! Philipp > --- > drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c > index 72b16ed1012b..3b97f60540ad 100644 > --- 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), > }, > }; >