From patchwork Wed Sep 27 08:35:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 9973453 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 CE0F46037F for ; Wed, 27 Sep 2017 08:40:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA1602911D for ; Wed, 27 Sep 2017 08:40:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A066F29123; Wed, 27 Sep 2017 08:40:25 +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 277A029118 for ; Wed, 27 Sep 2017 08:40:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752662AbdI0IkG (ORCPT ); Wed, 27 Sep 2017 04:40:06 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:44489 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752507AbdI0IgP (ORCPT ); Wed, 27 Sep 2017 04:36:15 -0400 Received: by mail-wm0-f66.google.com with SMTP id m127so19142038wmm.1; Wed, 27 Sep 2017 01:36:14 -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=VMVZIQ8pz24rAf20i7VD7Yx6q8OXgegF3SlG2/l5kwPDi1oYRsZwDUsOxeQrjtSHb+ cOIxHwnkY8jhmBAO54j84yXjkhRDwmbySpEOOXH7Zn1QNOsdaOEjidPyGC4qZRnu09Tv z5TDsK/dACqCdmuuto21cYPeI8dBXwRPoNOOEYToLGEg1DQkOPVaHVRW91CzzeS5sZdN Z0bGjC7k320V/gX2UIcyVV7jvH15pPcdmbi8LnJWwdhg5jWr4Emfwd8JMVXhR88LQC7f aVBOw6lXL6KrKtLsm6dIQPuISTAqMW7YTCqg2w23lg/JXL5a4ovAR3ND4wsl5semneE0 v9eQ== 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=L/zhHsDF5RncRv9yxbW7xCsu7bELK8mTqWjgX1N4enPFGL/U6WGSf7GpQ37e32SsnZ 5GKhrEawHGUZm6emmER5Dw9vzA7S4haDn2KPxkQ1BEtRtQpTRXHL55YX4TFkHdwkgfdg 2vW6wH1N0sQ8lTo75TeH3tNi0uLweogaTMhQk+I5XXzE8tSQBGtYaF7aazOrWQBquVTO +IlKWlR4M/NSJ3j9GlX5c+47g1g3TUfefWh3bO7un0ggLh8ZsZcunmotOP+lbHLctRqj et1tooVGyk1fHFQlS+J130ExJqEwqB7WjNd04ho53GiLbRs/n4LNM7syd7fmgGkyATe4 7gjA== X-Gm-Message-State: AHPjjUhQaz/tXc+TKMGniFGH9S0O6PV/I4tHK13uoH0gwQPcEpJus7Cj o+0oaZYU9XaZ+JBfDxh+ypM= X-Google-Smtp-Source: AOwi7QD1ghKsWG1bCPnOiOYKdTWvM6QgK0pPRzH9I+TPhUCK2Wp9q2v/boBapy7/WwIJLPgP4a0poQ== X-Received: by 10.28.100.3 with SMTP id y3mr827542wmb.69.1506501373904; Wed, 27 Sep 2017 01:36:13 -0700 (PDT) Received: from localhost.localdomain (146.187.3.109.rev.sfr.net. [109.3.187.146]) by smtp.gmail.com with ESMTPSA id r6sm9699900wrg.40.2017.09.27.01.36.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Sep 2017 01:36:13 -0700 (PDT) From: Romain Izard To: Boris Brezillon , Michael Turquette , Stephen Boyd , Lee Jones , Wenyou Yang , Josh Wu , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen , Thierry Reding , Richard Genoud , Greg Kroah-Hartman , Jiri Slaby , Alan Stern , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-pwm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, Romain Izard Subject: [PATCH v3 2/8] clk: at91: pmc: Save SCSR during suspend Date: Wed, 27 Sep 2017 10:35:49 +0200 Message-Id: <20170927083555.16580-3-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170927083555.16580-1-romain.izard.pro@gmail.com> References: <20170927083555.16580-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);