Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp823327pxb; Wed, 27 Oct 2021 13:08:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxmcCcNE0F0JDj3HBXJLbB2YZQE9Gu/HG7xCLho7uNdcDjINgR3EYMCb7ca/McwPrdBxrx X-Received: by 2002:a05:6a00:140c:b0:447:96be:2ade with SMTP id l12-20020a056a00140c00b0044796be2ademr34249116pfu.26.1635365289047; Wed, 27 Oct 2021 13:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635365289; cv=none; d=google.com; s=arc-20160816; b=0WPLMswImetjLAIiOIvPOUoe2RA2WO3A9Bsh2ItF/SN5hIGD6/zZEyQDytcEWyAIok VW1xV5bdS4p7RPAdV4vNkIxi9PbfBjeYrxREWDNQ7VC/u9fcC9atOSAHQt6h6EtCIMVp gmX1a6uMlS1cx9/9ijTiOd75jq4QQ/RdsdDDXPlvGuVTKXQe0aGboVUQLxHAlPmaAlyr bqnJQgeCH3chkaW+cRzd7bUKffcAoaQ7ApK9FNZZ8+dEa6r9PSeT94C/oqWZNtd+4VPe 1vysggW7IDwq/Jd8eu5xdRmCX+IvjtwPuc1XTumdD+h4nOp8GURtYgmvAeKvYP7LW8CB GZew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=fmh/zRJH+0A5G0WlcvlGxl0zJnfMvNEjvdgBV5G3+2w=; b=T+A3zSRMk1mhNEp3+9lqFGy9I2/QEE9Iafqba0Igc+Q899HcsfEepmPnzCGTlC16bd keLJlzNRbSh1wZy1Du82yFBS9wtUxxp76BAiLBzw03PrEJ/dfSu1N4JfZEiz4WyZKmsp xnBmrEre99/kyNvisgDHYEAbICSkrBrRJ0NXJosFyQapvhCNwQKmqF29lcDlqOKWbyyq iU12yyWUWJLYN89O+mOE3xsbK4SQ32+irw8SjvLyhWTfviD2Kx4rStPPZE8OoHZ9Ri6/ L3oLBe4t0d8P56fZVA4X9TH3Zn4ZlpTEZDucOOaGri33kQSP1uakTjJdNK9e80u5snw+ IEbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSBQVwGM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si1515157plg.186.2021.10.27.13.07.55; Wed, 27 Oct 2021 13:08:09 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSBQVwGM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240432AbhJ0HX6 (ORCPT + 99 others); Wed, 27 Oct 2021 03:23:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:34162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240455AbhJ0HX4 (ORCPT ); Wed, 27 Oct 2021 03:23:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 992126109E; Wed, 27 Oct 2021 07:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635319291; bh=AuW3QkBS5Hsr9hfHspFW41KpdMXremTDQB0r9HDoJaE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mSBQVwGMA7izM44EQzRy8mm+KTKEdV0ECmckETRGFgcE4kFc6c8F/Si04HwfSvLhE +uDP6GLqYe3//wsn0JZ5LXg6McgZ+ouoSJRmOi24D4oTCZ+cACVHCvsgajxD8AlMWs rsc5WHO35KFA0xDGtwIV0uj/+eGEXAJ9IoKDVQx9VxqMlZyBrKzQxrsz8jta7tTk/A 8xezZ0ljK2HWvi1G/4vUVVSaKsrfmnzYcNevx4WWHq/jU25Md7OnMhTN5xCRUsS4Ay VAbRzjDkauWYK2vq2HXGY4QwHTKijYRWve1VY2QSWE1Xb1qjc1ze95ptEGTB/rw0x0 C+mrxTa+s5CWg== Date: Wed, 27 Oct 2021 08:21:26 +0100 From: Mauro Carvalho Chehab To: Michael Turquette , Stephen Boyd Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Manivannan Sadhasivam , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] clk: fix the need of booking clk_ignore_unused=true on embedded devs Message-ID: <20211027082126.57dab8fc@sal.lan> In-Reply-To: References: X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stephen/Michael, Gentile ping. Regards, Mauro Em Thu, 7 Oct 2021 14:06:53 +0200 Mauro Carvalho Chehab escreveu: > Currently, the only way to boot a Kernel with drivers built as modules on embedded > devices like HiKey 970 is to pass clk_ignore_unused=true as a modprobe parameter. > > There are two separate issues: > > 1. the clk's core calls clk_disable_unused() too early. By the time this > function is called, only the builtin drivers were already probed/initialized. > Drivers built as modules will only be probed afterwards. > > This cause a race condition and boot instability, as the clk core will try > to disable clocks while the drivers built as modules are still being > probed and initialized. > > I suspect that the same problem used to happen at the regulator's core, > as there's a code that waits for 30 seconds before disabling unused > regulators; > > 2. there are some gate clocks defined at HiKey 970 that should always be on, > as otherwise the system will hang, or the filesystem I/O will stop. > > Ps.: > I submitted already 3 or 4 versions of patches for HiKey 970 clock, but > they're all unreliable, due to the race conditions at the clk core due to (1). > > Patch 1 solves the issue with the clk core. > Patch 2 solves the HiKey 970 specific issues. > > Mauro Carvalho Chehab (2): > clk: wait for extra time before disabling unused clocks > clk: clk-hi3670: mark some clocks as CLK_IS_CRITICAL > > drivers/clk/clk.c | 51 +++++++++++++++++++----------- > drivers/clk/hisilicon/clk-hi3670.c | 24 +++++++------- > 2 files changed, 44 insertions(+), 31 deletions(-) >