Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1211865rdb; Fri, 16 Feb 2024 08:27:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWGurkuKZvoIlLpM+KfDwU+2ZyJxB3NBnavMzwMV/604c+11xa5svqkHNRrfPWotNjKZif2Vu04M9L2phL2ngT7DYxdhi5YJg+AIfwCYQ== X-Google-Smtp-Source: AGHT+IE+XwI6lY8+5jR/z8sI+SW1eSFdyxg3h345MWWB/g1hPh1mT+c154yrqsyL7kmCFJTvcOYY X-Received: by 2002:a17:906:2894:b0:a3d:7f87:16e7 with SMTP id o20-20020a170906289400b00a3d7f8716e7mr3730242ejd.8.1708100866139; Fri, 16 Feb 2024 08:27:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708100866; cv=pass; d=google.com; s=arc-20160816; b=VgGh08y1WYnEIW27pEgCYi/V8G+rWcq7DMo9AEmmG/s3ywnmPqEgUVlyBMYdcF62GD QeWhS/TB628nhZDUfGorPHOSfH8CZh6k4msrduna+PQEGyCJytXETGBijd65wSqpxwrw VmX8n3JXAxBKhgR6jXvYaTaTyuSZVclk816T5pncK9P1gLW1nVfZR2uQj7D8Pu5+0nbp OPB7aQ+Fd74yFQAauNTFTljCOLSRLvgfcO//Y3/ykMHjQL/6WjofKyEJGyddzZCvEPV9 +MXfVRlXCQ75rbHOEYIq/IlBQKgj17Hw/z1O3k2F8SL0uLi6lVh9/TdC/hic9pChOjmw tcOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=44tIHP3e27m9mssG+F+MhxgHY8yrYPkp9JDOgoTDz6k=; fh=MZG6pKA+9tTMpW7BHo8YRJ16b+wdGWWu/CcMcvfjF+Q=; b=0H0eutaAGQBbzyVGmyfGTz/f/LnsZgT8H2KbemX1HqLYo3f5uYRHeuDxcutZ/VRUSZ D/CLaKLhJ59787kdjmnvtK9nXdowLFwauk736MS+sjUHZQrX1weERzu3imN7XXOxyn5E PB8tvn0wNb8mdn017w8qxJNdyFxDb4cbxXLeYWdD+AYN/tYxGJvn/tOpTQEf3jo3BOVv oN/cZYW6KAlOtEos1CquBbad5c+umsyqwJPENc61RhH6XgXzL7OzobXZqIHN0jhxYLVD guGoAl5SRcW167T4BBTNfnjqstXYyoKutAnVBiFm45LzX+9DDmgdg0zk24xnHnDnUlDd xe6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GTlNlHgB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-68957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v12-20020a1709063bcc00b00a3e0b6e201asi16345ejf.1036.2024.02.16.08.27.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 08:27:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GTlNlHgB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-68957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E563F1F237B4 for ; Fri, 16 Feb 2024 16:26:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD8EA12FF6F; Fri, 16 Feb 2024 16:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GTlNlHgB" Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB31A12FF6D for ; Fri, 16 Feb 2024 16:26:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708100806; cv=none; b=NlVvzAa6ESt3834E3Ja5QaVsuoSU7LC7byLrt7ak9a3WFF2Mg3pr9jtkgdNwmj41nmkzXUVL4rqi8w6JrGsO4Kn6cNbwitBOzgva9ko2WLKIvI6oZ1sYtGcCjdr5vuQT9kPNtt1hdAv+Y5bhyNyS2utHC9ucjQmYbb4uQx+oU6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708100806; c=relaxed/simple; bh=LcZm2kWHQ4w78fgPQiXn6fezOQZ4PZIfAqO2QKgVre4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=amF8hTc0DvBdjRAfEbbvGRhg1+nwGT1bGGvl0QHNX0Ka3AXxCqFS369P07/gOtkM0yjtWzqpuXhB/ZvFnzaNMv+/G5xpwyVZG3XzZX/q3FGgCZWWeOhb+aIG/YTGJjaVN/NWadEYKSymn6+tGyF/xb++6gZtfYf2PVskuvwyYgU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GTlNlHgB; arc=none smtp.client-ip=209.85.219.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-dcbd1d4904dso2373449276.3 for ; Fri, 16 Feb 2024 08:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708100803; x=1708705603; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=44tIHP3e27m9mssG+F+MhxgHY8yrYPkp9JDOgoTDz6k=; b=GTlNlHgBjngckS2bqahEVfaHLmZT7hItTbsRUPRkylEaTS3U0rg1cZ7MBDcSDzQVW6 HnCoAEOq4cKV0xelIa8Hr4kciMMYPmKat7L2Bav7DXzj1VAmVJxgFrs1rJsNP0Rxc8Rx Tk3L8+4lVEkBhWSMGN4kapsJR00FXmEhddi4HgdtTSFuhdAthJRmW+p8ZQZvgCmJP/JE 7VBoyM4eR1yOOCRt3/SNR/2H1VD8DKnV0IH5KvzcoQv+fej3ML3ddZEExOv7xlQ8GNOi QeptJG7C3epNKhif52dnDqQLFqmeAD8iySp0sz+2lGFz7X+BYCnbAWwnX3EAGfb0TBQ0 JKwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708100803; x=1708705603; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=44tIHP3e27m9mssG+F+MhxgHY8yrYPkp9JDOgoTDz6k=; b=RsEtlxZ4w4C5csa1VILGzrBqc0IR0+5FWPClGoktrvlz09LvyAFytIfBzmywPAgL1N VEfrcZx8jREidqv3FpzPdlHTlZlmPKagPoKVKZTyg5sw7VXbgO8L1r296s6GiZjaxG+r qICklMHVL9JpulMkE5sO90Ch/NeGOs1g5QG/yGFRQ8Gkl9LScEdOItV/7tRua8dVdoQN tsi1oSPx2z33etJY8EEzF6vF+OrwEAVO8HJ2pin040noCkzGvNM/Tg3LRn26/7gx2Ez+ SiMyQxq/NXoRjfZbP822h79BtWTjvfT6Dqg4L4VzspNzjmBMi0PbVKW7SQymNv4FlSKL nXzw== X-Forwarded-Encrypted: i=1; AJvYcCUke5k7aCzTjrfNmUOh2nU3Lq2tmqnnkiBCfFbfAFBbAf4usmQs3NHfPVO4D7jqFMDCw3cssbwWmnQgFMoyp0L3L87bAq5vO/+4F2hV X-Gm-Message-State: AOJu0YwPhSG+lI6D7U99A2cTVo6tJeQQ14H1GHyFpLJt/kuMmrwBIxE+ nKLAGhc3TqM/GK06Y/Vz27PiB9r9p7k/ygd2KNmMyNTVRIyV/Mj3uI54RwdLRD5YkdRVrQx6q2w 3hI8pJxL5goClYlnBnNziAZiVNa4b0O5eIos/gw== X-Received: by 2002:a25:2002:0:b0:dcc:9e88:b1a with SMTP id g2-20020a252002000000b00dcc9e880b1amr4736884ybg.7.1708100802770; Fri, 16 Feb 2024 08:26:42 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122-ipq5332-nsscc-v4-0-19fa30019770@quicinc.com> <20240122-ipq5332-nsscc-v4-2-19fa30019770@quicinc.com> <7a69a68d-44c2-4589-b286-466d2f2a0809@lunn.ch> <11fda059-3d8d-4030-922a-8fef16349a65@quicinc.com> <17e2400e-6881-4e9e-90c2-9c4f77a0d41d@lunn.ch> <8c9ee34c-a97b-4acf-a093-9ac2afc28d0e@quicinc.com> In-Reply-To: <8c9ee34c-a97b-4acf-a093-9ac2afc28d0e@quicinc.com> From: Dmitry Baryshkov Date: Fri, 16 Feb 2024 18:26:31 +0200 Message-ID: Subject: Re: [PATCH v4 2/8] clk: qcom: ipq5332: enable few nssnoc clocks in driver probe To: Kathiravan Thirumoorthy Cc: Andrew Lunn , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Catalin Marinas , Will Deacon , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" On Fri, 16 Feb 2024 at 17:33, Kathiravan Thirumoorthy wrote: > > > > On 2/14/2024 8:14 PM, Andrew Lunn wrote: > > On Wed, Feb 14, 2024 at 02:49:41PM +0530, Kathiravan Thirumoorthy wrote: > >> > >> > >> On 1/26/2024 1:35 AM, Andrew Lunn wrote: > >>> On Mon, Jan 22, 2024 at 11:26:58AM +0530, Kathiravan Thirumoorthy wrote: > >>>> gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, gcc_nssnoc_nsscc_clk are > >>>> enabled by default and it's RCG is properly configured by bootloader. > >>> > >>> Which bootloader? Mainline barebox? > >> > >> > >> Thanks for taking time to review the patches. I couldn't get time to respond > >> back, sorry for the delay. > >> > >> I was referring to the U-boot which is delivered as part of the QSDK. I will > >> call it out explicitly in the next patch. > > > > I've never used QSDK u-boot, so i can only make comments based on my > > experience with other vendors build of u-boot. That experience is, its > > broken for my use cases, and i try to replace it as soon as possible > > with upstream. > > > > I generally want to TFTP boot the kernel and the DT blob. Sometimes > > vendor u-boot has networking disabled. Or the TFTP client is > > missing. If it is there, the IP addresses are fixed, and i don't want > > to modify my network to make it compatible with the vendor > > requirements. If the IP addresses can be configured, sometimes there > > is no FLASH support so its not possible to actually write the > > configuration to FLASH so that it does the right thing on reboot > > etc... > > > > Often the vendor u-boot is a black box, no sources. Can you give me a > > git URL for the u-boot in QSDK? If the sources are open, i could at > > least rebuild it with everything turned on. > > > You can get the source at > https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016/-/tree/NHSS.QSDK.12.2?ref_type=heads > > You should be able to TFTP the images, write into the flash and > configure the IP and so on... > > > > > > But still, it is better that Linux makes no assumptions about what the > > boot loader has done. That makes it much easier to change the > > bootloader. > > > >>>> Some of the NSS clocks needs these clocks to be enabled. To avoid > >>>> these clocks being disabled by clock framework, drop these entries > >>>> from the clock table and enable it in the driver probe itself. > >>> > >>> If they are critical clocks, i would expect a device to reference > >>> them. The CCF only disabled unused clocks in late_initcall_sync(), > >>> which means all drivers should of probed and taken a reference on any > >>> clocks they require. > >> > >> > >> Some of the NSSCC clocks are enabled by bootloaders and CCF disables the > >> same (because currently there are no consumers for these clocks available in > >> the tree. These clocks are consumed by the Networking drivers which are > >> being upstreamed). > > > > If there is no network drivers, you don't need clocks to the > > networking hardware. So CCF turning them off seems correct. > > > Yeah agree with your comments. > > QSDK's u-boot enables the network support, so the required NSSCC clocks > are turned ON and left it in ON state. CCF tries to disables the unused > NSSCC clocks but system goes for reboot. > > > Reason being, to access the NSSCC clocks, these GCC clocks > (gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, gcc_nssnoc_nsscc_clk) > should be turned ON. But CCF disables these clocks as well due to the > lack of consumer. This means that NSSCC is also a consumer of those clocks. Please fix both DT and nsscc driver to handle NSSNOC clocks. > > Once you have actual drivers, this should solve itself, the drivers > > will consume the clocks. > > > Given that, NSSCC is being built as module, there is no issue in booting > the kernel. But if you do insmod of the nsscc-ipq5332.ko, system will > reset. > > Without the networking drivers, there is no need to install this module. > And as you stated, once the drivers are available, there will be no issues. > > So can I explain the shortcomings of installing this module without the > networking drivers in cover letter and drop this patch all together? No. Using allyesconfig or allmodconfig and installing the full modules set should work. > >> However looking back, gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, > >> gcc_nssnoc_nsscc_clk are consumed by the networking drivers only. So is it > >> okay to drop these clocks from the GCC driver and add it back once the > >> actual consumer needs it? > > > > But why should you remove them. If nothing is using them, they should > > be turned off. > > > > Andrew > -- With best wishes Dmitry