Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2530163rwl; Fri, 6 Jan 2023 07:39:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXuopywY5l4RepacvMXkbULNU1fV0h6pGzBPdMOkgWTJKt11RbAqYQUCpfKFEAhC4lLQy/Cl X-Received: by 2002:a17:906:b35a:b0:7c0:98d0:f433 with SMTP id cd26-20020a170906b35a00b007c098d0f433mr42812317ejb.75.1673019579080; Fri, 06 Jan 2023 07:39:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673019579; cv=none; d=google.com; s=arc-20160816; b=ozc9GydwLhSZdTAvx0KcU0lJZjA2rpMtz51U0hI5THrTYaQiWF6H50zODUQScDWwUs PkDjEMy8BJ7F5+Vk7W1wML/Yu33ZmJKaf9KEP5It8YewGanmjms6dxCMYVll4F6txHRp vyHGcV3DJMjozoP52FhXspFfkj74mYEGK2Yb5WfJd9uI7VlXjrsson3AUQBzhb4siymv cJFiXXsvVoMHWASwOrWmlltU6Fy9cXziDXLWJEAcgvn3FHNJNULZsjkXwejcXiTeI1yw +oXerjmptn6hdpaJN0NnvfN7JET9BHbSgrddrTmJezuKvkcC/FXlFP31iExuhWkU+ceG /VYQ== 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 :message-id:date:subject:cc:to:from; bh=rWHGO1h9Z9waxdHDVJeIpZheFFqSPJA4hWkroX0tVIk=; b=0ct66Ir0I2btIvdya3tt8kw6Z6G7MTCUSR1AEu86EB5wEVKBOJIt2OfVOY4cye9wmX lN0/AQGzoUm4Qny0uz7dZiTCxztIjVU56rdbNBV8vi6gY8YKYyL4MR4/zyWxF3iFG0Vg f+aBg7eeahgXRqUOOadPRdYvQGf6PUzWAN3xHgRtIbd0emMBHO3RVz6nhC1+r+dzORvW 5ALio7Zev1xUEJ64MOVjOCLb1JdTbVIIIs8lq/VwMm3T4EWFgReNnJ1aSJ+AiJAl1pjN xhDNJcmXQJcJfXKY/klG0Sh44EYrrK25R8iJOHFibmFHW1P1dK/DIwzC92C3HXrZTe7s xprg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf11-20020a1709077f0b00b007c083c69ec3si2004232ejc.155.2023.01.06.07.39.25; Fri, 06 Jan 2023 07:39:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233287AbjAFPXp (ORCPT + 56 others); Fri, 6 Jan 2023 10:23:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbjAFPXl (ORCPT ); Fri, 6 Jan 2023 10:23:41 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D264045666 for ; Fri, 6 Jan 2023 07:23:39 -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 454F8113E; Fri, 6 Jan 2023 07:24:21 -0800 (PST) Received: from e126815.warwick.arm.com (e126815.arm.com [10.32.32.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D0C8A3F71A; Fri, 6 Jan 2023 07:23:37 -0800 (PST) From: James Clark To: coresight@lists.linaro.org, quic_jinlmao@quicinc.com, suzuki.poulose@arm.com, mike.leach@linaro.org Cc: James Clark , Mathieu Poirier , Leo Yan , Alexander Shishkin , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] coresight: cti: Add PM runtime call in enable_store Date: Fri, 6 Jan 2023 15:23:27 +0000 Message-Id: <20230106152331.1374973-1-james.clark@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This should be a slight improvement on Jinlong's previous version. Now it's not possible to trigger the error message from pm_runtime_put() by calling disable twice. It's also similar to the original pre-breaking change version where pm_runtime_put() was only called if the device was actually disabled, but with one difference: Previously pm_runtime_put() was only called once for the last disable call, but because of the reference counting in pm_runtime, it should have been called once for each enable call. This meant that the clock would have never been disabled if there were ever multiple enable calls. This is now fixed. The third commit is a refactor and doesn't need to be backported. I removed one of the atomic types because it didn't appear to be required. Maybe it was added for a reason which I'm not aware of, if so it should be pretty easy to drop that change. James Clark (2): coresight: cti: Prevent negative values of enable count coresight: cti: Remove atomic type from enable_req_count Mao Jinlong (1): coresight: cti: Add PM runtime call in enable_store .../hwtracing/coresight/coresight-cti-core.c | 23 ++++++++++++------- .../hwtracing/coresight/coresight-cti-sysfs.c | 15 +++++++++--- drivers/hwtracing/coresight/coresight-cti.h | 2 +- 3 files changed, 28 insertions(+), 12 deletions(-) base-commit: c767c34740132ffc478226864a7461493cdc2413 -- 2.25.1