Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2644357rdb; Mon, 4 Dec 2023 03:41:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyM1j1ytIIaKDROxEpJ1cFDyIOIMSg+RT90Ry6x6Q/ohxagotFKxXlpBnJ2/tQxGcJa5tR X-Received: by 2002:a05:6a20:8f1b:b0:187:a65c:d994 with SMTP id b27-20020a056a208f1b00b00187a65cd994mr26334217pzk.30.1701690102716; Mon, 04 Dec 2023 03:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701690102; cv=none; d=google.com; s=arc-20160816; b=fokL0jyAmhgnr9LZhZydT8gBxRAz85QuODylAx2Rz/f8QdyH1IA6XKSa8w3aeTClGI yWaYdbymSKyGXsf9R+Wmo0GnLqqTUv/x5bV+1GNQnr0aISJV5KhASjs4F1U+lFbfFw/a 4PVlZvzU9p2THrgjdafszHmfoEXwcpyKqNUwvo0JA266fBMy8Z/Ys3mnU8kHmAie3W6Z FRiOXiqkFVcxUot/Xddb5BI7YckZOWpZn2YSS/L/IfamDNaNM5KyhUinxC92nzS1My1z lxYp+2/fCM2CGd+AGgl/gSXijimcYgXoanJfi25CzUEZC42y4w6i0/FBSaXvxoRkbvPE zv0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=v0mdkgsEGP7Ao5cXgYQm+zvOPEs5niB/Adttgv24n98=; fh=l68PHOz8wCGAVhNbc7b7WRmCk6v2AZYuyfEpbkA5hWs=; b=UlGuqm2sQFo+/cLtgiD7LGUtx74ofKnoUWK/hk5aVC8ij546P0u8mlMiO878jfzu9G SavF3HD6qiw6nw+Ngk1rlPe5Ltcez3PcT+7nOqXecwDZL/L3MlFSjVye5QMgHNAdiCZ1 I6KKvY+s+lEHpdEMy9uwqPSZYEpFBK7A/Om1dvGrz5gjMmhy61//6YLL0mddZq54CgFr zQLvDRPzzuhnV/CbpEA9hktsgL7WAMFJkx3aAydvaYq8sRK52Xo8utP9orQ81JhC9All +DenQ9oCicOucxUk8Ka/K1IQBRIAsIGq108cN8qmjr+XXKWSjGe6ZSUu2lZQjFhXR7mi 0g/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id y29-20020a056a00181d00b006cdec3b3b1fsi7474031pfa.235.2023.12.04.03.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 03:41:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DE0B38067624; Mon, 4 Dec 2023 03:41:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbjLDLlE (ORCPT + 99 others); Mon, 4 Dec 2023 06:41:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232798AbjLDLkl (ORCPT ); Mon, 4 Dec 2023 06:40:41 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2395BD2; Mon, 4 Dec 2023 03:40:48 -0800 (PST) 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 2FE49152B; Mon, 4 Dec 2023 03:41:35 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3DCBA3F6C4; Mon, 4 Dec 2023 03:40:46 -0800 (PST) Date: Mon, 4 Dec 2023 11:40:43 +0000 From: Sudeep Holla To: James Clark Cc: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, Sudeep Holla , Lorenzo Pieralisi , Mike Leach , 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 Subject: Re: [PATCH V2 5/7] coresight: tmc: Move ACPI support from AMBA driver to platform driver Message-ID: References: <20231201062053.1268492-1-anshuman.khandual@arm.com> <20231201062053.1268492-6-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 03:41:20 -0800 (PST) On Mon, Dec 04, 2023 at 10:54:15AM +0000, James Clark wrote: > > > On 01/12/2023 06:20, Anshuman Khandual wrote: > > Add support for the tmc devices in the platform driver, which can then be > > used on ACPI based platforms. This change would now allow runtime power > > management for ACPI based systems. The driver would try to enable the APB > > clock if available. > > > [...] > > -module_amba_driver(tmc_driver); > > +static int tmc_platform_probe(struct platform_device *pdev) > > +{ > > + struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > + struct tmc_drvdata *drvdata; > > + int ret = 0; > > + > > + drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); > > + if (!drvdata) > > + return -ENOMEM; > > + > > + drvdata->pclk = coresight_get_enable_apb_pclk(&pdev->dev); > > + if (IS_ERR(drvdata->pclk)) > > + return -ENODEV; > > + > > + dev_set_drvdata(&pdev->dev, drvdata); > > + pm_runtime_get_noresume(&pdev->dev); > > + pm_runtime_set_active(&pdev->dev); > > + pm_runtime_enable(&pdev->dev); > > + > > + ret = __tmc_probe(&pdev->dev, res, NULL); > > + if (ret) { > > + pm_runtime_put_noidle(&pdev->dev); > > + pm_runtime_disable(&pdev->dev); > > + } > > I'm not sure if these pm_runtime()s are right because there is already a > put inside of __tmc_probe() if it fails. If you unload and then reload > all the coresight modules with these patches you get these errors which > are new: > Ah good find. I have just tested with ACPI and these modules as built-in to be more specific. -- Regards, Sudeep