Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp905578rdb; Sun, 18 Feb 2024 18:52:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXfeLCt9YNDwzKtyh3XoMByy3s/GdyLuSALkDS82VtAlFzpOPlTN6/YEhuO5SGp8yxRJgpeOVUOzl+2E/sPy9xr5yiLmoJ81x8mrO0fZw== X-Google-Smtp-Source: AGHT+IFplEN6PnUqeI7BPmHbdyRpNrcq+DFxjlGUflaLbddMphXp5M9RGlYttxXmGnKO4Q7jxgl0 X-Received: by 2002:a81:6d07:0:b0:608:397b:26e0 with SMTP id i7-20020a816d07000000b00608397b26e0mr1397302ywc.11.1708311176466; Sun, 18 Feb 2024 18:52:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708311176; cv=pass; d=google.com; s=arc-20160816; b=UreehGpBIlmaRHF4tWLDxcMLWrkLeAyYySkt2Dk8wbwFDEx4FVEFk1WL1CgepIymRA wYOJFpGiW1y1cEc89HOlzlurJl0LJsLMaJ39z8v6gPxZkksffMbdPKAVV9Ujqs4i4NuE mg+GnNIZsDYIe87OOS+IlH/s4Is2ugS1bYa2dGwBrBuSP9+DatMVOZdOXRR/DfEMeezj G0R0P8rmYymd3qx4FTKPjkzrVnELZEfsdBmNdAOeUgWO4acZJgHc61BOJzJz7VyFT6sf OPQFktIWL3eCM63/9vb7rweKUIyOl4L0Fr0ARwkC92M3ds/P7fS1dOHKogTjZjkj/0uD QMHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=MwHIYfrCdyT3ImSsELmu7NrumbOmiTQNH7OVZnTwsZ0=; fh=KvlmMlYU6hJPNAmS/PyRMzws0t/uZqTxduKJAzzXlVQ=; b=BaKC6mg1D6KGmO533D143xqFohXcTry0DC/c4TGuh8T9HATPGdc2AHOsEkKSSRG7V5 dIJ5j+iFnN3ly7bc73xxiCoVo6i//M/pJM+K6smgiB36ACLt5myPyKARLKNgvEysvrB+ 6e/NTxm/6EFVdQJvDb2Y+5X0/vmRl+2HoYyhQQc5Vh1A+Mt4dwcHGodsBo2Fqu3TAf8B WJWsZ/T2S1qoYrrSmIooXsZpIPrHCI8XefkOmD38hyxb8b4K1HnmeaLmDB+CpNQBBKlp oBMCnpt/ogNU4Pw49YlzmKDRctzgF82gaQcrV5oEB7fYEApZ/UKRbKWv59OpGcbknDLJ /m1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-70664-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70664-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q13-20020ac8450d000000b0042c57017211si5009799qtn.113.2024.02.18.18.52.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 18:52:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70664-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-70664-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70664-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3929B1C2124B for ; Mon, 19 Feb 2024 02:52:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7398257D; Mon, 19 Feb 2024 02:52:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2A5720F1; Mon, 19 Feb 2024 02:52:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708311169; cv=none; b=edkhAkOUTwvrMSGLR/QzU3Kxfm/VTXl6IcSBYx3bOzZGQGCHIB+tlbnfvonJjp2+qejS97A4DtWGWUBWS9Ftgy+XgkglVBMZu1perytWV32dymGsq+gVP9ys1lo/h4mCuYOcnr4ap8Ulkk+YdLTZheO8hqAkHWmszeHFG4XRdgg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708311169; c=relaxed/simple; bh=/5quQyLZ0qlAalvNxnek0ybbYAycaAWEuCwqEblZfek=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Wg2CZ8VmBLizPIxwLAU/yYSadd93ZchzBFU41vlGkNEE4obwBlfs+GSgKhe3bxG330wilmbQGolIgMnIFrzCrVmIHrKuPS4tK51ac+jNkDBTpH5i1coZ60PbFz4V2bB/8yUdZNlGDFldQ+2HDc5MUCD1yYhz8bqYV4UQyhPzsGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 81CE4FEC; Sun, 18 Feb 2024 18:53:20 -0800 (PST) Received: from [10.162.43.127] (a077893.blr.arm.com [10.162.43.127]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B10943F766; Sun, 18 Feb 2024 18:52:36 -0800 (PST) Message-ID: Date: Mon, 19 Feb 2024 08:22:33 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V4 05/11] coresight: replicator: Move ACPI support from AMBA driver to platform driver Content-Language: en-US To: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Cc: Lorenzo Pieralisi , Sudeep Holla , Mike Leach , James Clark , Maxime Coquelin , Alexandre Torgue , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-stm32@st-md-mailman.stormreply.com References: <20240123054608.1790189-1-anshuman.khandual@arm.com> <20240123054608.1790189-6-anshuman.khandual@arm.com> From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/15/24 16:55, Suzuki K Poulose wrote: > On 15/02/2024 11:23, Suzuki K Poulose wrote: >> Hi Anshuman >> >> On 23/01/2024 05:46, Anshuman Khandual wrote: >>> Add support for the dynamic replicator device in the platform driver, which >>> can then be used on ACPI based platforms. This change would now allow >>> runtime power management for repliacator devices on ACPI based systems. >>> >>> The driver would try to enable the APB clock if available. Also, rename the >>> code to reflect the fact that it now handles both static and dynamic >>> replicators. >>> >>> Cc: Lorenzo Pieralisi >>> Cc: Sudeep Holla >>> Cc: Suzuki K Poulose >>> Cc: Mike Leach >>> Cc: James Clark >>> Cc: linux-acpi@vger.kernel.org >>> Cc: linux-arm-kernel@lists.infradead.org >>> Cc: linux-kernel@vger.kernel.org >>> Cc: coresight@lists.linaro.org >>> Tested-by: Sudeep Holla # Boot and driver probe only >>> Acked-by: Sudeep Holla # For ACPI related changes >>> Signed-off-by: Anshuman Khandual >> >> I think the patch is doing three different things: >> >> 1) Use new helper to register/remove AMBA/Platform drivers >> 2) Refactor replicator_probe() to make sure it can be reused for platform/amba driver, by moving the pm_runtime_put() to the callers. >> 3) Actually moving the ACPI driver to Platform driver >> >> While (1) and (3) are obvious, (2) gave me hard time to review this >> patch, without proper description. If you don't mind, are you able to >> split the patch and add proper description of the 3 changes mentioned >> above. >> > > You could even move (1) for all the existing drivers into a single patch > or even fold it with the patch that introduces the helpers. That way it There are only two existing coresight devices with both AMBA and platform drivers available i.e replicator and funnel. Such devices could use these new helpers right from the beginning. As you mentioned earlier such changes might be folded back into the patch adding the helpers. But coresight devices such as catu, tpiu, tmc, stm and debug don't have platform drivers to begin with. Hence the helpers could only be used in their respective patches adding platform drivers. > is cleaner and easier to review. And (2) & (3) could be in the same patch for each driver, but please add something in the description for (2). Please find the updated commit message here, does this look okay ? coresight: replicator: Move ACPI support from AMBA driver to platform driver Add support for the dynamic replicator device in the platform driver, which can then be used on ACPI based platforms. This change would now allow runtime power management for replicator devices on ACPI based systems. The driver would try to enable the APB clock if available. Also, rename the code to reflect the fact that it now handles both static and dynamic replicators. But first this refactors replicator_probe() making sure it can be used both for platform and AMBA drivers, by moving the pm_runtime_put() to the callers.