Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp344775pxb; Wed, 20 Jan 2021 08:19:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoinh7ngHA1rXiAV6DEaPXjJbzKDE7MFwPeTTNY2GHEdKjnjhnOreDsHcSM3OqvC/wfoqZ X-Received: by 2002:aa7:d959:: with SMTP id l25mr7890035eds.55.1611159564992; Wed, 20 Jan 2021 08:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611159564; cv=none; d=google.com; s=arc-20160816; b=knd8rndVDB3ZYo7KEjmIEojVjbcaHW4lUurO3bnagbwz1WsV0ZX6H9mt0R5ZFF7C+W BsGItiw/g3dj9o/yltq7saNX3/fUZ9dLUBOjHMtWh/KIw4qzxXm7l/SefW++tj2qsmnI VHYOb72IX+5p0MSjCnJCRP0ma5QQLAA/4srzbtUuFiNmdtUi50/HzWYQS5CCElyP+UsY JomFV9AYFzg9NOPAtiEuJzPm2EPvzlE9WoVqRMffZc7lprHZBgG8BnjCZXs32yPHfymN NVuq7mRhDCD7tdipmnZaGO/KnvZlEDG1UwBFZQFi/wGE5KGF2AmKYzHsdZuvkf+tOKJH RVrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0C3+sfq+a0rLxiNKWF3M7m9sTfirHdR2u+2uvZJF1uo=; b=MqhHAkri1ePiKIO6UeY4pv+pVChc5VSN3z1lESucNpbUwSYEPPGDyR7YgvJylmZZ7U R8Hd4FK2aDX04RDc7TyW1jgUk+bFELPvivHrc3NKxu/hdQCxfWqfErC0oCtCtbf2GbR9 K4aIzGlNMoW8E9K/ttsVMk+ghEEsVuzCPDlmFJ7pB/ULne0cgUSkizedGZp2NxZ0Blwo nxEKB4Fo+3tJDSZ65QaGeIhAgjZYEWCP739DcONfoCOouuIhIE5zXMrsX3ABfRf0bwSq YmlDBdW3cGrclIQU0QXXz6x1BIZgFzpBK54Ji8zZn2ytB4KH8GIwr4wMl9c1p7Tue1Lt sKZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gx19si800373ejb.371.2021.01.20.08.18.59; Wed, 20 Jan 2021 08:19:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391446AbhATQPz (ORCPT + 99 others); Wed, 20 Jan 2021 11:15:55 -0500 Received: from inva020.nxp.com ([92.121.34.13]:54940 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390773AbhATQPM (ORCPT ); Wed, 20 Jan 2021 11:15:12 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1C4141A0A74; Wed, 20 Jan 2021 17:14:22 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0FA461A013D; Wed, 20 Jan 2021 17:14:22 +0100 (CET) Received: from localhost (fsr-ub1664-175.ea.freescale.net [10.171.82.40]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id EEC892039A; Wed, 20 Jan 2021 17:14:21 +0100 (CET) Date: Wed, 20 Jan 2021 18:14:21 +0200 From: Abel Vesa To: Sascha Hauer Cc: Adam Ford , arm-soc , Adam Ford-BE , Aisheng Dong , Michael Turquette , Stephen Boyd , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Linus Walleij , Jerome Brunet , linux-clk , Linux Kernel Mailing List Subject: Re: [PATCH V3] clk: imx: Fix reparenting of UARTs not associated with sdout Message-ID: <20210120161421.h3yng57m3fetwwih@fsr-ub1664-175> References: <20210115182909.314756-1-aford173@gmail.com> <20210118125204.hxsanoohwvdtdvym@fsr-ub1664-175> <20210120144454.f6b72lnasw4q3bde@fsr-ub1664-175> <20210120151305.GC19063@pengutronix.de> <20210120152813.x2pbs5vprevkly23@fsr-ub1664-175> <20210120155001.GD19063@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210120155001.GD19063@pengutronix.de> User-Agent: NeoMutt/20180622 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-01-20 16:50:01, Sascha Hauer wrote: > On Wed, Jan 20, 2021 at 05:28:13PM +0200, Abel Vesa wrote: > > On 21-01-20 16:13:05, Sascha Hauer wrote: > > > Hi Abel, > > > > > > On Wed, Jan 20, 2021 at 04:44:54PM +0200, Abel Vesa wrote: > > > > On 21-01-18 08:00:43, Adam Ford wrote: > > > > > On Mon, Jan 18, 2021 at 6:52 AM Abel Vesa wrote: > > > > ... > > > > > > > > > > > > > > > > > > > TBH, I'm against the idea of having to call consumer API from a clock provider driver. > > > > > > I'm still investigating a way of moving the uart clock control calls in drivers/serial/imx, > > > > > > where they belong. > > > > > > > > > > That makes sense. > > > > > > > > > > > > > Just a thought. The uart clock used for console remains on from u-boot, > > > > so maybe it's enough to just add the CLK_IGNORE_UNUSED flag to all the > > > > uart root clocks and remove the prepare/enable calls for uart clocks > > > > for good. I don't really have a way to test it right now, but maybe > > > > you could give it a try. > > > > > > That would mean that UART clocks will never be disabled, regardless of > > > whether they are used for console or not. That doesn't sound very > > > appealing. > > > > AFAIK, the only uart clock that is enabled by u-boot is the one used for > > the console. Later on, when the serial driver probes, it will enable it itself. > > > > Unless I'm missing something, this is exactly what we need. > > It might enable it, but with CLK_IGNORE_UNUSED the clock won't be > disabled again when a port is closed after usage OK, tell me what I'm getting wrong in the following scenario: U-boot leaves the console uart clock enabled. All the other ones are disabled. Kernel i.MX clk driver registers the uart clocks with flag CLK_IGNORE_UNUSED. Serial driver probes, then enables/disables the clocks when the port opens/closes. The clk_disable_unused will ignore the uart clocks entirely due to the flag.