Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2997094imm; Sun, 1 Jul 2018 10:00:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqG8f8RJe5E8Sj0rTM2RiJ1h5C+VYoNn2QOCD1PxI56JcXc6ukVJrQwwVi6XLe1XAUPmEl X-Received: by 2002:a62:a8e:: with SMTP id 14-v6mr22222161pfk.57.1530464404470; Sun, 01 Jul 2018 10:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464404; cv=none; d=google.com; s=arc-20160816; b=jHtzKbsxBQLGAX/ds1Drs5DU89uajRJ6CSzpyWRKs4KRHX/Ua+GfQv83NohySOkMWS wD55b6U/v1oonAmVEXDfrgcKNYQqgHpzdQaoWfrMBKXVAWfoABPJLT9wvusFHAPzPWzO 4j0X0MZSrI8xa1N47+wxW0/UmmKjaovdEHPGpjv8RqCWAHMUBGv/OOTDfkjzeUHRp+Xt eCYIB0yLntp3yU/i6eiKAFh/XgnCfLfPFxLB7sIcdtZGCySC8g9Vx8y8bGlBVw4LjveX enJJfvFPsExaV/oXvabC+jlW6jKRcGtwXKu5fVEM1c5oT76xQkjstaJtZmCle50PUXTa s8xw== 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=q+PPZQOq4SHenv0npWhyNuby3H8yKuydEhvrZzhA2/4=; b=HV9LQun32ycOJ5pMUkMcGsFrpthlAQkj+7vV7yR77VLSOawkct+XySOMwdmQrLTCfw 9NqapE0n19hGCV6pjFeSoDOfVq2VXdMDeJAtg+bxqrQ4i8nqLnqisoqbVnMWRFSXRZ2K enyLv8GLPv8WLUQgku9/sgYBrusaNHOi95PQcrODtOCVnbwpKb03ea//EFUp2t+X4q7n rsuD1Kdg/3mJXGqsaiRnHgUu0DarCsBOK2XM/GY73wvifipbW+plhZBy2fCE95GSqJtR 6NJfbssd8NG0YFFYv7quCLKVFn//kSslOo3hlPR9czV+n05pBDDmjXn5KBEQ67qCtQOA sHsw== 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 p21-v6si14493704plq.94.2018.07.01.09.59.49; Sun, 01 Jul 2018 10:00:04 -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 S965096AbeGAQ6t (ORCPT + 99 others); Sun, 1 Jul 2018 12:58:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37992 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031419AbeGAQoM (ORCPT ); Sun, 1 Jul 2018 12:44:12 -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 CAA9B92B; Sun, 1 Jul 2018 16:44:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Trimarchi , Jagan Teki , Maxime Ripard , Alexandre Belloni Subject: [PATCH 4.17 149/220] rtc: sun6i: Fix bit_idx value for clk_register_gate Date: Sun, 1 Jul 2018 18:22:53 +0200 Message-Id: <20180701160914.530061737@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Trimarchi commit 09018d4bd7994c2c9f775029bc24589bc85f76fa upstream. clk-gate core will take bit_idx through clk_register_gate and then do clk_gate_ops by using BIT(bit_idx), but rtc-sun6i is passing bit_idx as BIT(bit_idx) it becomes BIT(BIT(bit_idx) which is wrong and eventually external gate clock is not enabling. This patch fixed by passing bit index and the original change introduced from below commit. "rtc: sun6i: Add support for the external oscillator gate" (sha1: 17ecd246414b3a0fe0cb248c86977a8bda465b7b) Signed-off-by: Michael Trimarchi Fixes: 17ecd246414b ("rtc: sun6i: Add support for the external oscillator gate") Cc: stable@vger.kernel.org Signed-off-by: Jagan Teki Acked-by: Maxime Ripard Signed-off-by: Alexandre Belloni Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-sun6i.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -74,7 +74,7 @@ #define SUN6I_ALARM_CONFIG_WAKEUP BIT(0) #define SUN6I_LOSC_OUT_GATING 0x0060 -#define SUN6I_LOSC_OUT_GATING_EN BIT(0) +#define SUN6I_LOSC_OUT_GATING_EN_OFFSET 0 /* * Get date values @@ -255,7 +255,7 @@ static void __init sun6i_rtc_clk_init(st &clkout_name); rtc->ext_losc = clk_register_gate(NULL, clkout_name, rtc->hw.init->name, 0, rtc->base + SUN6I_LOSC_OUT_GATING, - SUN6I_LOSC_OUT_GATING_EN, 0, + SUN6I_LOSC_OUT_GATING_EN_OFFSET, 0, &rtc->lock); if (IS_ERR(rtc->ext_losc)) { pr_crit("Couldn't register the LOSC external gate\n");