From patchwork Mon May 27 14:25:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13675437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5F77C25B79 for ; Mon, 27 May 2024 14:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IuxB/3rEjEhEbfcPce1IUmIKWNHnyB7NMb0tzJ+U1OA=; b=uOkqaw8Wy0GV7R nH7REgpuqguVk80mwZX4dlI/7VQpZfnxI48YZp5cGcNBQLGKylgYXQHwc7wp4SPO+VB4mUSR7CYsV 4p0QRLdTg5Yse/g+aTHZxtx+yiPact0S1o9mr7aJqntdjpHEf2gMK6wV8YBMUcoKunbkyTSYZMG9i YFKUQzzpSrWH/Qk/DZOnR5S43wEJNkCdJVnLDlJQ3gT9KlHF0tbI9+S/pnhftSWXudj/ljSWv6gyJ S0XTBJoEKMWdUL5cMk/GH8rtHatq8NLw7BO9CXLFYSdwCbck+1EboSzozHdX9a6BABj9E13nyRWlL YeXv55TkBYQ3xpaiDrgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBbIz-0000000FMCf-3ZxR; Mon, 27 May 2024 14:26:29 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBbIk-0000000FM2B-3WaC for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2024 14:26:16 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5295c65d3fdso2875328e87.0 for ; Mon, 27 May 2024 07:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819972; x=1717424772; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p4GCCTlIOT/1pc4oKXuIbqiN9A8llTw5QQ9hWjk7xes=; b=h9D89tzn0zgkCKdot2BVNYcLeM1H1PSCLqRVu2gfxxS6o9z3RPR5OI8OqGojg2RGTF URvvWRATGCSVIcyjkpl9m5XcXy3vSeuyGdCt+CTnUm5SnJJ0BEq1Kaz7gXGMgp/ViuQL c8b0uHjEE4D5VHX4WnPgAizHLD/AwQV8A9cqOvoK/fVnK7fxwocnll20RT12rgoaXkNY u13r/tnkEeeEh3iIPNzTFRxcl4/q7Y95mE29BWn5mPC1qVllQtC6aqsakk+VUrGfmdJS 7Rhucp62CQMw85oAd/4/8tZ+6pXnCKq7KSk3XsnG/8f/254f/RhkCMzn2Q38J98ggNoj dw0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819972; x=1717424772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p4GCCTlIOT/1pc4oKXuIbqiN9A8llTw5QQ9hWjk7xes=; b=cDtOLelmV46RJQVkfnwONy7E8qprKmLqY5YeekUjjfKUo1IWV8YVrAjNgCfwSLSCLH pyxyNFwDWQRjLe3PyNRP8jLf3tlMrr4uAV/BfkeJ8ci6zNGcxtqq/BsvT3b0VO3vTg/U fAhwoOkgunKwBXeoe9F2jA1qU2MTuGjuwvo2AdtKL3nFPLIcyIY8AtgWIlbT3bN5fsZu pGMWMx6Haz99Bp6VRHBq2xaCZY+P/qzxMoC09nyG9I8TuKDxhKwbbi4WxIWitf9SLFsR nzhaqlD2ahQFslXPcAwe++9AjqvTdnNhtAXLv9IroL9bPs+abSz8xrs1nS+QB5ybQ5Mn BqPA== X-Forwarded-Encrypted: i=1; AJvYcCV8blMQB3hpctSga3XdPOTs8pmKKtwyUnPntHntnfZIvQtXwWP5fN0S8j74EYydomKu2pX21Yg6O6dZdxiCdo5/1nL9OlrJaT2JHQ24WOZ0BUn+CUU= X-Gm-Message-State: AOJu0YxFqKJ0sQCHshbMbORJhkxHtn5xu2YBHTZmGi8ElmnQgou7Lkss IEhgleuYaMXldxGp7TgGXRIaR1U2/Xlz0p+rTfhB+1vFILbSldrLq3l0DvlEucg= X-Google-Smtp-Source: AGHT+IGBURZMgZ64X0UKam0G5PlXXXeQ2dC+7S7QNY89ucqJb86w8XI5Zqsgk9t8jyaoT8/KyxTQXg== X-Received: by 2002:a19:5e10:0:b0:51f:c38b:149c with SMTP id 2adb3069b0e04-527ef3ff4d1mr4004141e87.10.1716819972310; Mon, 27 May 2024 07:26:12 -0700 (PDT) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-529711fa7f3sm562002e87.258.2024.05.27.07.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:26:11 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , linux-pm@vger.kernel.org Cc: Lorenzo Pieralisi , Nikunj Kela , Prasad Sodagudi , Maulik Shah , Daniel Lezcano , Krzysztof Kozlowski , Ulf Hansson , linux-rt-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/7] pmdomain: core: Use dev_name() instead of kobject_get_path() in debugfs Date: Mon, 27 May 2024 16:25:53 +0200 Message-Id: <20240527142557.321610-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527142557.321610-1-ulf.hansson@linaro.org> References: <20240527142557.321610-1-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240527_072614_944076_F363FC23 X-CRM114-Status: GOOD ( 14.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Using kobject_get_path() means a dynamic memory allocation gets done, which doesn't work on a PREEMPT_RT based configuration while holding genpd's raw spinlock. To fix the problem, let's convert into using the simpler dev_name(). This means the information about the path doesn't get presented in debugfs, but hopefully this shouldn't be an issue. Signed-off-by: Ulf Hansson --- Changes in v2: - New patch. --- drivers/pmdomain/core.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 454fccc38df1..90a65bd09d52 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -3182,7 +3182,6 @@ static int genpd_summary_one(struct seq_file *s, [GENPD_STATE_OFF] = "off" }; struct pm_domain_data *pm_data; - const char *kobj_path; struct gpd_link *link; char state[16]; int ret; @@ -3215,16 +3214,9 @@ static int genpd_summary_one(struct seq_file *s, } list_for_each_entry(pm_data, &genpd->dev_list, list_node) { - kobj_path = kobject_get_path(&pm_data->dev->kobj, - genpd_is_irq_safe(genpd) ? - GFP_ATOMIC : GFP_KERNEL); - if (kobj_path == NULL) - continue; - - seq_printf(s, "\n %-50s ", kobj_path); + seq_printf(s, "\n %-50s ", dev_name(pm_data->dev)); rtpm_status_str(s, pm_data->dev); perf_status_str(s, pm_data->dev); - kfree(kobj_path); } seq_puts(s, "\n"); @@ -3393,23 +3385,14 @@ static int devices_show(struct seq_file *s, void *data) { struct generic_pm_domain *genpd = s->private; struct pm_domain_data *pm_data; - const char *kobj_path; int ret = 0; ret = genpd_lock_interruptible(genpd); if (ret) return -ERESTARTSYS; - list_for_each_entry(pm_data, &genpd->dev_list, list_node) { - kobj_path = kobject_get_path(&pm_data->dev->kobj, - genpd_is_irq_safe(genpd) ? - GFP_ATOMIC : GFP_KERNEL); - if (kobj_path == NULL) - continue; - - seq_printf(s, "%s\n", kobj_path); - kfree(kobj_path); - } + list_for_each_entry(pm_data, &genpd->dev_list, list_node) + seq_printf(s, "%s\n", dev_name(pm_data->dev)); genpd_unlock(genpd); return ret;