From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbdAZO1H (ORCPT ); Thu, 26 Jan 2017 09:27:07 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35699 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752485AbdAZO1F (ORCPT ); Thu, 26 Jan 2017 09:27:05 -0500 Message-ID: <1485440821.2442.8.camel@baylibre.com> Subject: Re: [PATCH] clk: meson8b: fix clk81 register address From: Jerome Brunet To: Michael Turquette , Stephen Boyd , Kevin Hilman , Carlo Caione Cc: linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Thu, 26 Jan 2017 15:27:01 +0100 In-Reply-To: <1485341586-2929-1-git-send-email-jbrunet@baylibre.com> References: <1485341586-2929-1-git-send-email-jbrunet@baylibre.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-01-25 at 11:53 +0100, Jerome Brunet wrote: > During meson8b clock probe, clk81 register address is fixed twice. > First using the meson8b_clk_gates array, then by directly changing > meson8b_clk81 register. > > As a result meson8b_clk81.reg = HHI_MPEG_CLK_CNTL + clk_base + > clk_base. > > Fixed by just removing the second fixup. > > Fixes: e31a1900c1ff ("meson: clk: Add support for clock gates") > Signed-off-by: Jerome Brunet > --- >  Patch based on khilman/linux-amlogic.git master branch. > >  I don't have a meson8b HW so this patch so this patch has not been >  tested on real HW. I got my hands on an odroidc1 and I have been to test this. With clk_base @ 0xf0965000: * without the patch: clk81.reg = 0xe12ca174 * with the patch: clk81.reg = 0xf0965174 (expected result) In the past, we probably did not see this because clk81 is the mother of all the other clock gate around the SoC so it is very likely that u- boot opened this gate for us. > >  drivers/clk/meson/meson8b.c | 1 - >  1 file changed, 1 deletion(-) > > diff --git a/drivers/clk/meson/meson8b.c > b/drivers/clk/meson/meson8b.c > index 3f1be46cbb33..888494d4fb8a 100644 > --- a/drivers/clk/meson/meson8b.c > +++ b/drivers/clk/meson/meson8b.c > @@ -607,7 +607,6 @@ static int meson8b_clkc_probe(struct > platform_device *pdev) >   /* Populate the base address for the MPEG clks */ >   meson8b_mpeg_clk_sel.reg = clk_base + > (u32)meson8b_mpeg_clk_sel.reg; >   meson8b_mpeg_clk_div.reg = clk_base + > (u32)meson8b_mpeg_clk_div.reg; > - meson8b_clk81.reg = clk_base + (u32)meson8b_clk81.reg; >   >   /* Populate base address for gates */ >   for (i = 0; i < ARRAY_SIZE(meson8b_clk_gates); i++)