From patchwork Sun Mar 7 17:07:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 12120863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48DD8C43381 for ; Sun, 7 Mar 2021 17:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A5A26502E for ; Sun, 7 Mar 2021 17:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232559AbhCGRIV (ORCPT ); Sun, 7 Mar 2021 12:08:21 -0500 Received: from aposti.net ([89.234.176.197]:40118 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232535AbhCGRHz (ORCPT ); Sun, 7 Mar 2021 12:07:55 -0500 From: Paul Cercueil To: Michael Turquette , Stephen Boyd , Ulf Hansson , Russell King Cc: od@zcrc.me, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mmc@vger.kernel.org, Paul Cercueil Subject: [PATCH 0/2] mmc: jz4740: Support PLL frequency changes Date: Sun, 7 Mar 2021 17:07:40 +0000 Message-Id: <20210307170742.70949-1-paul@crapouillou.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Hi, This set of two patches enables the MMC driver to cope with the main PLL updating its rate, typically when the CPU frequency is being updated. The first patch introduces clk_get_first_to_set_rate(), which will allow the MMC driver to get a pointer to the clock that will effectively be modified when calling clk_set_rate(); this is required to avoid a chicken-and-egg situation with the clock notifier. If accepted, this function will be reused in a few more drivers which need to perform the same operation. The patch to the MMC driver adds a atomic/mutex couple so that the frequency change will happen when we know that the controller is not in use. Cheers, -Paul Paul Cercueil (2): clk: Add clk_get_first_to_set_rate mmc: jz4740: Add support for monitoring PLL clock rate changes drivers/clk/clk.c | 9 +++++ drivers/mmc/host/jz4740_mmc.c | 70 ++++++++++++++++++++++++++++++++++- include/linux/clk.h | 16 ++++++++ 3 files changed, 94 insertions(+), 1 deletion(-)