From patchwork Thu Oct 19 16:42:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 10017705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 650F960224 for ; Thu, 19 Oct 2017 16:42:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 557C028B64 for ; Thu, 19 Oct 2017 16:42:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4970A28D49; Thu, 19 Oct 2017 16:42:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBF0328B64 for ; Thu, 19 Oct 2017 16:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753456AbdJSQmc (ORCPT ); Thu, 19 Oct 2017 12:42:32 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44742 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753096AbdJSQmb (ORCPT ); Thu, 19 Oct 2017 12:42:31 -0400 Received: by mail-wr0-f194.google.com with SMTP id z55so2907988wrz.1; Thu, 19 Oct 2017 09:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d2QPQyjMsXWSkJdc6MMuWv4m8CSK75I6LdWz80n+/Ss=; b=ZQnmCskCEXFpZ9xB29DzAXRI806939rD1rzpHrb6yLBgp6tAgEf89t05rzxrxY24ja 6CRziKGeAtc9yc8d5eElb6ilw/o0fTxan14KKq9nAr6FwAX9Y/f2fSqp1AAuDHglNcAa UaiAbttnwnCKV9uSNnecbMa6HYixa/ydhNW0zlC61vGANH9x11jCXneYW5Z8jUbrlaSP Jx3uqWDcFlA2EAbZCy4NQqVPKz5HNZfOlBjq1Yk8Xk+uit8xjSN+0JqXqq3OIeqgq5s7 SFgDikgYWQLHSKh2EPR/3O/GcTr6ZD/JWrAA50Uh61wS43yTNqkFoeNDlcYyjrDaaUwn 1XKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=d2QPQyjMsXWSkJdc6MMuWv4m8CSK75I6LdWz80n+/Ss=; b=RY2Pc70eMgeJ3v9LTHKhXqGNJxnhwDQi0uutS74oFg/OnemB5gMzFBQdoO/ijF79Gi AInZ+EFl54R43CDN+Xd3Rh1MT2Gkw+Laac070v6YCerlwlg543liFwAS6d2R8aNSiTk9 RRfLvRENulNefSIpsttIKKl7n1Z4EmlY6e9RLUZwCo5NddPrP1qfMe9q65P0wb2iWPPM R5gDpSEh6j/gZnmXBbkCaghSn3RYM25432S7GJKfYla2F1Ekqp0tzS8Vk7FrE84WuZH0 bULUkKoi6J7XaEsm2ReHr0Y67Yx4mA+aKZXu2pp1w0IYVqTsTPDRzvrrkMBRPQvFPURX Zqig== X-Gm-Message-State: AMCzsaWyKZDmY8IkSGLLj9OkotyXHFRVJFokxS3QLpMxVESAFsmWRjSE eMhDdRe1Ols38JucKL8FQ6E= X-Google-Smtp-Source: ABhQp+SVHoozNQppF8L1oHU5pClXYmgoXIuauAQ3bGmoW8Qx3qqyczsG5oZHSgioxLFtitvowYP2tA== X-Received: by 10.223.192.135 with SMTP id d7mr2051950wrf.128.1508431349818; Thu, 19 Oct 2017 09:42:29 -0700 (PDT) Received: from localhost.localdomain (146.187.3.109.rev.sfr.net. [109.3.187.146]) by smtp.gmail.com with ESMTPSA id a195sm1458905wme.34.2017.10.19.09.42.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 09:42:29 -0700 (PDT) From: Romain Izard To: Boris Brezillon , Michael Turquette , Stephen Boyd , Alexandre Belloni , Nicolas Ferre , Ludovic Desroches Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Romain Izard Subject: [PATCH v5 2/3] clk: at91: pmc: Save SCSR during suspend Date: Thu, 19 Oct 2017 18:42:06 +0200 Message-Id: <20171019164207.32717-3-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171019164207.32717-1-romain.izard.pro@gmail.com> References: <20171019164207.32717-1-romain.izard.pro@gmail.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The contents of the System Clock Status Register (SCSR) needs to be restored into the System Clock Enable Register (SCER). As the bootloader will restore some clocks by itself, the issue can be missed as only the USB controller, the LCD controller, the Image Sensor controller and the programmable clocks will be impacted. Fix the obvious typo in the suspend/resume code, as the IMR register does not need to be saved twice. Signed-off-by: Romain Izard Acked-by: Nicolas Ferre --- drivers/clk/at91/pmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index 5c2b26de303e..07dc2861ad3f 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c @@ -86,7 +86,7 @@ static int pmc_suspend(void) { int i; - regmap_read(pmcreg, AT91_PMC_IMR, &pmc_cache.scsr); + regmap_read(pmcreg, AT91_PMC_SCSR, &pmc_cache.scsr); regmap_read(pmcreg, AT91_PMC_PCSR, &pmc_cache.pcsr0); regmap_read(pmcreg, AT91_CKGR_UCKR, &pmc_cache.uckr); regmap_read(pmcreg, AT91_CKGR_MOR, &pmc_cache.mor); @@ -129,7 +129,7 @@ static void pmc_resume(void) if (pmc_cache.pllar != tmp) pr_warn("PLLAR was not configured properly by the firmware\n"); - regmap_write(pmcreg, AT91_PMC_IMR, pmc_cache.scsr); + regmap_write(pmcreg, AT91_PMC_SCER, pmc_cache.scsr); regmap_write(pmcreg, AT91_PMC_PCER, pmc_cache.pcsr0); regmap_write(pmcreg, AT91_CKGR_UCKR, pmc_cache.uckr); regmap_write(pmcreg, AT91_CKGR_MOR, pmc_cache.mor);