From patchwork Tue Feb 11 10:39:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13970025 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 33E62C0219B for ; Tue, 11 Feb 2025 10:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5A8RVRjBK7H8bCZinYcme/5PJTGf7uIF6oMOSyxCJUQ=; b=LBKZqcyyKTN4WJ2NrK9FqnWPb8 q5+6JXLAZ+ARO/AErImE8bDAU16bwOqWcKzR3APANZyzbrRZrw//KKXFgG/vNKZpfkJcJ34iW4EC6 ePq7LoeQsaBqZQfipc27o5Nnvntp2+TxvYPkGeKdyTasUAOzxJq/nuGXz4ygbaTqliPNtxOKyl0jw MkZAws2iOoFDmw8jpfINXyYX4cWbTGbSBFn/eecjazTPIb/Xjb0qcjao1cxvUMJVi81MgxyF+lbkB XKwGt89WZ6U/00NZtIdScLCuwZgk0nqwQ8tw5sl/GcM/wSfiC0lYGSumUywVeu4e5Cv2+VbUrI5cH MQi8Me9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thnm3-00000003PUP-2io8; Tue, 11 Feb 2025 10:45:51 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thngu-00000003NsD-0bnz for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2025 10:40:33 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43944c51e41so20256895e9.0 for ; Tue, 11 Feb 2025 02:40:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739270430; x=1739875230; 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=5A8RVRjBK7H8bCZinYcme/5PJTGf7uIF6oMOSyxCJUQ=; b=cAqboRCBCp6ip1wYQtAuZc/O1YwT3lUfBT8kcvLp1ZEaPRWyvGCmj+hRkXNAHemaMP qpM3TuI8/xOsNLZ1uVY+nNAIA/XmWlRhEA9E7plq/7yHhmKNEiOz7PvFk/FWTEUnM+P7 K1+WGxMoF3ZYJGBBy/SJBpjupjzMQQ2B73Z4ZxvcoSGg/RW8JK/jf34rD2uoerH8NFfd tF9uLWnj2iTsTb97M6cjgMPSbZjJVw0yqjn4Cx4XotDfEQbw2T2hCZWdy+zdPudztrmw 1jEPfdQlv86i/yTRcKQnCRK0ju7sA1XRlNB+KYOa8lViYavk7nlXpbVelHdMAxA/X1vw 2tZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739270430; x=1739875230; 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=5A8RVRjBK7H8bCZinYcme/5PJTGf7uIF6oMOSyxCJUQ=; b=rX6jaM/8401WcsQrUIQ8LSeeKXwW+9q7CPEdPnMTalXeq0qc/1ugOCQO5vVD9VS4++ 9I5fC/hW8AeWY4H2E9IDSN6aUuoau9zSQbXEol/haJCq7Y2o+OutZHwbNVMCBjslKBnk cD4i+dElL8VM++mP17Dxc34Shvwg4hoKH5nTDOkhzp/dKraOAxO+shKbJ1Cd+04eseZY QLyooSCFwE7neEGpOFD2l7YJFbmBF5DjqagGB8JiCItXX63p2pnF1/cPdEI7WtSHEIyB gN4HCchPkpg6hy18VcjEAAoseuTT9HH1NnSNpEkb99B5zDrRAMR7vfnHS4OZl79MjYv+ O17g== X-Forwarded-Encrypted: i=1; AJvYcCWBJIngCCqJIEnvHIEhvEJv6hxPq6e9fX78pJU4BMfBkV1RcFGFqohxix3N1dgFiahsUMPz+OCO/8fwBdi1qG/D@lists.infradead.org X-Gm-Message-State: AOJu0YxwrOsZRTb6ZGNnL2SczVi9W9/iaVGYdGY3K8atWXehbGmkQgMv oEuqtCVqZLgUN5rIF0jpmfP6FCGv+y+xcuIuFiucuxqslD/zwNaX2gLXFWq+B9Q= X-Gm-Gg: ASbGncsCcWK9J/BFBIn5lOYU4nYfNU3NmBCXHkU5eRXuQy+QRHIU46C73zt5CJRPw++ HBGpS4+IjQWB2OsgTdH4QIf7eNxIbTwCV02qCLQTgqjNtl1d6tC95RfEsRCQy2knRUwpY3BM8Yk gd+5CohztQ++Px5dXy4sgDUIE8TNGUvtN9YWN8JCvkkoc9YPWHwCKmYdhGmtX+BKOOltgORXezP y1K6WC7wNm5Zt+1UywuGYkGDLDaK7I9Uz12s/Dy54nqIaShX5u9IFa9bca2ZTiYWWWQftC5rOOq QX5uY84nl+e1 X-Google-Smtp-Source: AGHT+IHsAnh1dHvEt+uOlGshWjb+DFPLFBYIUXSAhkCj/7Y+istcriVGonzZp0irFU33oYSY1ss5Eg== X-Received: by 2002:a05:600c:5128:b0:439:473d:a3dc with SMTP id 5b1f17b1804b1-439473da569mr60088295e9.31.1739270430353; Tue, 11 Feb 2025 02:40:30 -0800 (PST) Received: from pop-os.. ([145.224.65.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd02e2a90sm10456047f8f.98.2025.02.11.02.40.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 02:40:30 -0800 (PST) From: James Clark To: lcherian@marvell.com, coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 1/7] coresight: Rename coresight_{set,clear}_claim_tags() Date: Tue, 11 Feb 2025 10:39:37 +0000 Message-Id: <20250211103945.967495-2-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211103945.967495-1-james.clark@linaro.org> References: <20250211103945.967495-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250211_024032_182469_A9FF6608 X-CRM114-Status: GOOD ( 12.42 ) 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 These look like they set the whole tags register as one value, but they only set and clear the self hosted bit using a SET/CLR bits mechanism. Rename the functions to reflect this better. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 0a9380350fb5..523dbb381f90 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -142,14 +142,14 @@ static inline bool coresight_is_claimed_any(struct coresight_device *csdev) return coresight_read_claim_tags(csdev) != 0; } -static inline void coresight_set_claim_tags(struct coresight_device *csdev) +static inline void coresight_set_self_claim_tag(struct coresight_device *csdev) { csdev_access_relaxed_write32(&csdev->access, CORESIGHT_CLAIM_SELF_HOSTED, CORESIGHT_CLAIMSET); isb(); } -static inline void coresight_clear_claim_tags(struct coresight_device *csdev) +static inline void coresight_clear_self_claim_tag(struct coresight_device *csdev) { csdev_access_relaxed_write32(&csdev->access, CORESIGHT_CLAIM_SELF_HOSTED, CORESIGHT_CLAIMCLR); @@ -174,11 +174,11 @@ int coresight_claim_device_unlocked(struct coresight_device *csdev) if (coresight_is_claimed_any(csdev)) return -EBUSY; - coresight_set_claim_tags(csdev); + coresight_set_self_claim_tag(csdev); if (coresight_is_claimed_self_hosted(csdev)) return 0; - /* There was a race setting the tags, clean up and fail */ - coresight_clear_claim_tags(csdev); + /* There was a race setting the tag, clean up and fail */ + coresight_clear_self_claim_tag(csdev); return -EBUSY; } EXPORT_SYMBOL_GPL(coresight_claim_device_unlocked); @@ -199,7 +199,7 @@ int coresight_claim_device(struct coresight_device *csdev) EXPORT_SYMBOL_GPL(coresight_claim_device); /* - * coresight_disclaim_device_unlocked : Clear the claim tags for the device. + * coresight_disclaim_device_unlocked : Clear the claim tag for the device. * Called with CS_UNLOCKed for the component. */ void coresight_disclaim_device_unlocked(struct coresight_device *csdev) @@ -209,7 +209,7 @@ void coresight_disclaim_device_unlocked(struct coresight_device *csdev) return; if (coresight_is_claimed_self_hosted(csdev)) - coresight_clear_claim_tags(csdev); + coresight_clear_self_claim_tag(csdev); else /* * The external agent may have not honoured our claim From patchwork Tue Feb 11 10:39:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13970044 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 99A7CC0219B for ; Tue, 11 Feb 2025 11:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2zZ0OrtQMgfnUz7Pqgs5oe7tlQZDOHSDEQQYtTNC+PI=; b=E782obnLouykFsfk0caeWlfniQ 3Nk4Lr77De6s3t64piuzLfAVlqZ1J7FEI80SYlrdOPgCMhaiD3Tq/YK7jmWUBlBJccbn3rXFAjKz1 4fKqL/27Hq85zSVm9u+I5hD7muj1bG9vVcdrwhlDNYYwCJQZmWz4G04gTywt1s73cFDJ52K1qxhJ/ VaHFAGdmqLTZTLPsaHq7xztPTL+sVKyUR8ryGYZBb5I49wnGDzvYW2T054Fb+CFncGa5IZlNJkLon BQQd+VEBBZYqrotxarbCdoCiSpW9We1ztSZe+JimKe1AOWfTT1lT0PZLrS60CJia8eBCF9mxjmQkB yJKN1glg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thort-00000003f7B-0pYN; Tue, 11 Feb 2025 11:55:57 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thngx-00000003NtF-47iE for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2025 10:40:37 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso37010905e9.3 for ; Tue, 11 Feb 2025 02:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739270434; x=1739875234; 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=2zZ0OrtQMgfnUz7Pqgs5oe7tlQZDOHSDEQQYtTNC+PI=; b=GHVEN29U1V6yJJOeiRCCfqgUpIkpBjcJ2Ay0kmJWVtmUgiYM0JYxCAqm6MMKfIqmJo q1nNcIZJZbS8NpapVvSQtirRHpiGfBG6jmFlnzcIz+nJb6Y8iR9rEWsRqbnNTCYGofDq dqBVkkOnC6igtcDPSlgLTNqdweQ083l8P1tvuK6xz6uS4Hh6wGiNjTcdMcyDkmxPckTo aLtmfpwGliL9iVn7dHNzTDZb5hrLzS0Wk5Z/Md/P7q93tUoPS1CH5TfNdoe3VKpUUMdu GLYPS7jWhXvuWNaAd6tyOqR9PELDOzPHANaeOK1/sqTLll5Eq8y6peyaXkbMPxt+PdTn decg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739270434; x=1739875234; 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=2zZ0OrtQMgfnUz7Pqgs5oe7tlQZDOHSDEQQYtTNC+PI=; b=nb3rHfMFzpejOHSwmgwcjrJ7c4eZ6FdOluKpOY1lTLo2+sOJ8BQyDhDpIoqHt36+qH sYDn39dcWN68moX71Ou+chwd2KccIaZjw8J3WHminGFKpB8qZf/CI/6RbsfBQdsU/gG0 RlYBJBmrRJRbGPpBC6yhK7dlPzg4556Y/bw+MVwadcXD643QKLgOYrMrrM1fnXWGuxvn vBoWiWEf9/++XhsFLEsVAPEAAXHwU9Jxd4jyWb6WL4K7VKTnXFS5N+K5SJRuZ5voCy9H A5Dpex6qPZhECpPsIQUERfDskMQuTQF85ppHKaYeFVyrtSW2h3P3CMzkkErkiicVECzQ /k+A== X-Forwarded-Encrypted: i=1; AJvYcCXdE+5E9PS9yABEhIMTQm2ugwAoLy4pIGD8HY5MlCwJiE6ZZNY16RnboV3wqHMBAVDZqo0UCiwUiHCfMxE7LTcW@lists.infradead.org X-Gm-Message-State: AOJu0YwAmBEC/9p+400PcYxGKscxpUHtfZ/26MGUxzblbInsHcm4BOqw p10xJzn3Br7qEknjHA0CrkTp4earC0p1utTq/Ttaz6hchX7KQ+tX1m5XUqf2lzc= X-Gm-Gg: ASbGncszQNS3EMAmfGdz3/7pb9t/wZ7hu3fUFmXi9T8NPRPwnaUn2BsjAYbPCYTKVpV 0OM7GF9OmUw2D0kEZYqtql9+YBCAtIgHWi6p/C7M0gn1liEZhckJakrHSFJohlYFc/9RGh+u/72 iFKCazYoX/uT2X4c4atE6DP/r8B3M+9rauO0XrmUuVFVGExFbTvgF+V6Ej7/fTHPf+k4wxru98T QyovEZZpxvZZa04mXlJaXZzqf4B4raAK+HDFMLJH0zAoT0k43UsXzzMAHlLADYZL7UicNcjT9v/ YRBljTpPU8jT X-Google-Smtp-Source: AGHT+IG1QC0ZJB8Dsyjrd4BKscl8IOtVtmsqNcKjSxhkXZoFddZatFd1vyjkzTkufMPdlU+5dsOvHQ== X-Received: by 2002:a05:600c:5494:b0:439:5016:3867 with SMTP id 5b1f17b1804b1-43950163b9amr16347735e9.23.1739270433358; Tue, 11 Feb 2025 02:40:33 -0800 (PST) Received: from pop-os.. ([145.224.65.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd02e2a90sm10456047f8f.98.2025.02.11.02.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 02:40:33 -0800 (PST) From: James Clark To: lcherian@marvell.com, coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 2/7] coresight: Convert disclaim functions to take a struct cs_access Date: Tue, 11 Feb 2025 10:39:38 +0000 Message-Id: <20250211103945.967495-3-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211103945.967495-1-james.clark@linaro.org> References: <20250211103945.967495-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250211_024036_023714_37A8842D X-CRM114-Status: GOOD ( 19.43 ) 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 The self hosted claim tag will be reset on device probe in a later commit. We'll want to do this before coresight_register() is called so won't have a coresight_device and have to use cs_access instead. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-catu.c | 2 +- drivers/hwtracing/coresight/coresight-core.c | 45 ++++++++----------- .../hwtracing/coresight/coresight-cti-core.c | 6 +-- drivers/hwtracing/coresight/coresight-etb10.c | 2 +- .../coresight/coresight-etm3x-core.c | 4 +- .../coresight/coresight-etm4x-core.c | 2 +- .../hwtracing/coresight/coresight-funnel.c | 2 +- .../coresight/coresight-replicator.c | 4 +- .../hwtracing/coresight/coresight-tmc-etf.c | 8 ++-- .../hwtracing/coresight/coresight-tmc-etr.c | 4 +- include/linux/coresight.h | 4 +- 11 files changed, 38 insertions(+), 45 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index 275cc0d9f505..d9259c0b6e64 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -474,7 +474,7 @@ static int catu_disable_hw(struct catu_drvdata *drvdata) struct coresight_device *csdev = drvdata->csdev; catu_write_control(drvdata, 0); - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); if (catu_wait_for_ready(drvdata)) { dev_info(dev, "Timeout while waiting for READY\n"); rc = -EAGAIN; diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 523dbb381f90..a669872b4118 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -127,31 +127,31 @@ coresight_find_out_connection(struct coresight_device *csdev, return ERR_PTR(-ENODEV); } -static inline u32 coresight_read_claim_tags(struct coresight_device *csdev) +static inline u32 coresight_read_claim_tags(struct csdev_access *csa) { - return csdev_access_relaxed_read32(&csdev->access, CORESIGHT_CLAIMCLR); + return csdev_access_relaxed_read32(csa, CORESIGHT_CLAIMCLR); } -static inline bool coresight_is_claimed_self_hosted(struct coresight_device *csdev) +static inline bool coresight_is_claimed_self_hosted(struct csdev_access *csa) { - return coresight_read_claim_tags(csdev) == CORESIGHT_CLAIM_SELF_HOSTED; + return coresight_read_claim_tags(csa) == CORESIGHT_CLAIM_SELF_HOSTED; } static inline bool coresight_is_claimed_any(struct coresight_device *csdev) { - return coresight_read_claim_tags(csdev) != 0; + return coresight_read_claim_tags(&csdev->access) != 0; } -static inline void coresight_set_self_claim_tag(struct coresight_device *csdev) +static inline void coresight_set_self_claim_tag(struct csdev_access *csa) { - csdev_access_relaxed_write32(&csdev->access, CORESIGHT_CLAIM_SELF_HOSTED, + csdev_access_relaxed_write32(csa, CORESIGHT_CLAIM_SELF_HOSTED, CORESIGHT_CLAIMSET); isb(); } -static inline void coresight_clear_self_claim_tag(struct coresight_device *csdev) +static inline void coresight_clear_self_claim_tag(struct csdev_access *csa) { - csdev_access_relaxed_write32(&csdev->access, CORESIGHT_CLAIM_SELF_HOSTED, + csdev_access_relaxed_write32(csa, CORESIGHT_CLAIM_SELF_HOSTED, CORESIGHT_CLAIMCLR); isb(); } @@ -174,11 +174,11 @@ int coresight_claim_device_unlocked(struct coresight_device *csdev) if (coresight_is_claimed_any(csdev)) return -EBUSY; - coresight_set_self_claim_tag(csdev); - if (coresight_is_claimed_self_hosted(csdev)) + coresight_set_self_claim_tag(&csdev->access); + if (coresight_is_claimed_self_hosted(&csdev->access)) return 0; /* There was a race setting the tag, clean up and fail */ - coresight_clear_self_claim_tag(csdev); + coresight_clear_self_claim_tag(&csdev->access); return -EBUSY; } EXPORT_SYMBOL_GPL(coresight_claim_device_unlocked); @@ -202,14 +202,10 @@ EXPORT_SYMBOL_GPL(coresight_claim_device); * coresight_disclaim_device_unlocked : Clear the claim tag for the device. * Called with CS_UNLOCKed for the component. */ -void coresight_disclaim_device_unlocked(struct coresight_device *csdev) +void coresight_disclaim_device_unlocked(struct csdev_access *csa) { - - if (WARN_ON(!csdev)) - return; - - if (coresight_is_claimed_self_hosted(csdev)) - coresight_clear_self_claim_tag(csdev); + if (coresight_is_claimed_self_hosted(csa)) + coresight_clear_self_claim_tag(csa); else /* * The external agent may have not honoured our claim @@ -220,14 +216,11 @@ void coresight_disclaim_device_unlocked(struct coresight_device *csdev) } EXPORT_SYMBOL_GPL(coresight_disclaim_device_unlocked); -void coresight_disclaim_device(struct coresight_device *csdev) +void coresight_disclaim_device(struct csdev_access *csa) { - if (WARN_ON(!csdev)) - return; - - CS_UNLOCK(csdev->access.base); - coresight_disclaim_device_unlocked(csdev); - CS_LOCK(csdev->access.base); + CS_UNLOCK(csa->base); + coresight_disclaim_device_unlocked(csa); + CS_LOCK(csa->base); } EXPORT_SYMBOL_GPL(coresight_disclaim_device); diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwtracing/coresight/coresight-cti-core.c index d2b5a5718c29..073f67a41af9 100644 --- a/drivers/hwtracing/coresight/coresight-cti-core.c +++ b/drivers/hwtracing/coresight/coresight-cti-core.c @@ -175,7 +175,7 @@ static int cti_disable_hw(struct cti_drvdata *drvdata) writel_relaxed(0, drvdata->base + CTICONTROL); config->hw_enabled = false; - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); CS_LOCK(drvdata->base); spin_unlock(&drvdata->spinlock); return ret; @@ -683,7 +683,7 @@ static int cti_cpu_pm_notify(struct notifier_block *nb, unsigned long cmd, /* CTI regs all static - we have a copy & nothing to save */ drvdata->config.hw_powered = false; if (drvdata->config.hw_enabled) - coresight_disclaim_device(csdev); + coresight_disclaim_device(&csdev->access); break; case CPU_PM_ENTER_FAILED: @@ -746,7 +746,7 @@ static int cti_dying_cpu(unsigned int cpu) spin_lock(&drvdata->spinlock); drvdata->config.hw_powered = false; if (drvdata->config.hw_enabled) - coresight_disclaim_device(drvdata->csdev); + coresight_disclaim_device(&drvdata->csdev->access); spin_unlock(&drvdata->spinlock); return 0; } diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index aea9ac9c4bd0..d8bc3e776c88 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -344,7 +344,7 @@ static void etb_disable_hw(struct etb_drvdata *drvdata) { __etb_disable_hw(drvdata); etb_dump_hw(drvdata); - coresight_disclaim_device(drvdata->csdev); + coresight_disclaim_device(&drvdata->csdev->access); } static int etb_disable(struct coresight_device *csdev) diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c index c103f4c70f5d..509f53b69e42 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c @@ -599,7 +599,7 @@ static void etm_disable_hw(void *info) config->cntr_val[i] = etm_readl(drvdata, ETMCNTVRn(i)); etm_set_pwrdwn(drvdata); - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); CS_LOCK(drvdata->base); @@ -624,7 +624,7 @@ static void etm_disable_perf(struct coresight_device *csdev) * power down the tracer. */ etm_set_pwrdwn(drvdata); - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); CS_LOCK(drvdata->base); diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index dd8c74f893db..45b30a4b3eba 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -922,7 +922,7 @@ static void etm4_disable_hw(void *info) etm4x_relaxed_read32(csa, TRCCNTVRn(i)); } - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); etm4_cs_lock(drvdata, csa); dev_dbg(&drvdata->csdev->dev, diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 8faf51469bb8..e986922d555b 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -116,7 +116,7 @@ static void dynamic_funnel_disable_hw(struct funnel_drvdata *drvdata, /* Disclaim the device if none of the slaves are now active */ if (!(functl & FUNNEL_ENSx_MASK)) - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); CS_LOCK(drvdata->base); } diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index a1181c9048c0..5d42a9a8c460 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -54,7 +54,7 @@ static void dynamic_replicator_reset(struct replicator_drvdata *drvdata) if (!coresight_claim_device_unlocked(csdev)) { writel_relaxed(0xff, drvdata->base + REPLICATOR_IDFILTER0); writel_relaxed(0xff, drvdata->base + REPLICATOR_IDFILTER1); - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); } CS_LOCK(drvdata->base); @@ -167,7 +167,7 @@ static void dynamic_replicator_disable(struct replicator_drvdata *drvdata, if ((readl_relaxed(drvdata->base + REPLICATOR_IDFILTER0) == 0xff) && (readl_relaxed(drvdata->base + REPLICATOR_IDFILTER1) == 0xff)) - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); CS_LOCK(drvdata->base); } diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index d4f641cd9de6..1e4d874a8448 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -53,7 +53,7 @@ static int tmc_etb_enable_hw(struct tmc_drvdata *drvdata) rc = __tmc_etb_enable_hw(drvdata); if (rc) - coresight_disclaim_device(drvdata->csdev); + coresight_disclaim_device(&drvdata->csdev->access); return rc; } @@ -99,7 +99,7 @@ static void __tmc_etb_disable_hw(struct tmc_drvdata *drvdata) static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata) { __tmc_etb_disable_hw(drvdata); - coresight_disclaim_device(drvdata->csdev); + coresight_disclaim_device(&drvdata->csdev->access); } static int __tmc_etf_enable_hw(struct tmc_drvdata *drvdata) @@ -136,7 +136,7 @@ static int tmc_etf_enable_hw(struct tmc_drvdata *drvdata) rc = __tmc_etf_enable_hw(drvdata); if (rc) - coresight_disclaim_device(drvdata->csdev); + coresight_disclaim_device(&drvdata->csdev->access); return rc; } @@ -148,7 +148,7 @@ static void tmc_etf_disable_hw(struct tmc_drvdata *drvdata) tmc_flush_and_stop(drvdata); tmc_disable_hw(drvdata); - coresight_disclaim_device_unlocked(csdev); + coresight_disclaim_device_unlocked(&csdev->access); CS_LOCK(drvdata->base); } diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index a48bb85d0e7f..7ba4f79191de 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1066,7 +1066,7 @@ static int tmc_etr_enable_hw(struct tmc_drvdata *drvdata, rc = __tmc_etr_enable_hw(drvdata); if (rc) { drvdata->etr_buf = NULL; - coresight_disclaim_device(drvdata->csdev); + coresight_disclaim_device(&drvdata->csdev->access); } } @@ -1156,7 +1156,7 @@ static void __tmc_etr_disable_hw(struct tmc_drvdata *drvdata) void tmc_etr_disable_hw(struct tmc_drvdata *drvdata) { __tmc_etr_disable_hw(drvdata); - coresight_disclaim_device(drvdata->csdev); + coresight_disclaim_device(&drvdata->csdev->access); /* Reset the ETR buf used by hardware */ drvdata->etr_buf = NULL; } diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 17276965ff1d..937931d107e0 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -653,8 +653,8 @@ extern int coresight_timeout(struct csdev_access *csa, u32 offset, extern int coresight_claim_device(struct coresight_device *csdev); extern int coresight_claim_device_unlocked(struct coresight_device *csdev); -extern void coresight_disclaim_device(struct coresight_device *csdev); -extern void coresight_disclaim_device_unlocked(struct coresight_device *csdev); +extern void coresight_disclaim_device(struct csdev_access *csa); +extern void coresight_disclaim_device_unlocked(struct csdev_access *csa); extern char *coresight_alloc_device_name(struct coresight_dev_list *devs, struct device *dev); From patchwork Tue Feb 11 10:39:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13970026 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 626EDC0219D for ; Tue, 11 Feb 2025 10:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SuiN1rfKfscB8sMfW2+d+Ei1aGExcejRdUcNsTvpxwA=; b=Bnu2a3lFfNCxHxqslF3wt1kD+t aEKeHfb/IsY6OOt1SWS9ACThZoFy5tDX5JZXwr4VG108WSvwO9aM6G3diTdTufEDf5d8D7XVme3y4 M1A/b3xkfmIYE1SykpiKtAcluQesxsicdQZCqFEqYF8D6c7COQxFe3EhPdY/enFGeD4jYMeetFAxE wnDT8oKTnCY+ePAlojlHV0ri6o6Kbx7+dzChK0nM0z8Jlayn0fMmZAYbmrEXbnCdaSXP8K0uk1NTV cN3tPt2mhmNBJZ+lBIq2KSrfG9SmWSBwfpUWNXkfLL8XYzrRhDWAKPp+j7AbRWcodFB9tsGVjoc6a AmEYaBYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thnoo-00000003Prp-2FgX; Tue, 11 Feb 2025 10:48:42 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thngz-00000003Ntw-2PEy for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2025 10:40:38 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43948021a45so16334795e9.1 for ; Tue, 11 Feb 2025 02:40:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739270436; x=1739875236; 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=SuiN1rfKfscB8sMfW2+d+Ei1aGExcejRdUcNsTvpxwA=; b=NwRocIJ4pkNO2H0ljn74StA94nPSMkSW5Pu9Pfpc4msAKjvLQ3ANLHJQl9LEFyucyL ewdnvKkJT9SMELqodR8iqHhzJAFZv5lkFZT6O/Jn6UWFGs+TFUryNwu/TWM2hRtx4cDJ yr/Iq+ZUAyB4zrOd99Y72urYWIm0TNNp+RGt83cgKyPatMfT7suoIKaGJ8GkoXNHJGel BU9uElTaSOhpy18dDOxwmHlqKjQKsS9EFloxGppK79+KEpwVSiNjmvCU4QAjr5KTd5iY g6EcSSweb+vONiquuWV+5SBowHliMKWVin3smCFrV17/BhUw8+rj3kzafjGuNKvAqrHH 6qqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739270436; x=1739875236; 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=SuiN1rfKfscB8sMfW2+d+Ei1aGExcejRdUcNsTvpxwA=; b=LvGJhGeXBTKIazPvEiAmYwEffHqFAkUFNQelSsHwUT4R1bzyTHK0etbESg6YNmphsw odsP37FPpXosXvC6TL9r1xVLZ/0ZdLGghzCch4m7K6DjBlsm0y16Q4vXgfSqtHzsjEwh TNzRnEujCd87twZPYNjy8hegHd9f0A5/8KwihghbAtNr5wZNwf3Ch7WQryyb5Md3J/Q0 PheDNp+K3i/oaxOZB7dKWNFmgZ70hvFHPZzZqQ1/G9kfuoiomNFAeg10QahDwOwDgBIV b0OGtVjL4/FRlf/xrbsp2sPmI3t0zZ+aW4I9Dxkx+Wmd/yjPH9nLHAX0Idl4pm4LBP8u M3Jw== X-Forwarded-Encrypted: i=1; AJvYcCWph+d1jYrormCOOh65WhIKC7wXos/tKBn4jP/aE2AGSufM7/9lVZao2bz/oG9M8Yfeioz1q4VOZhioFFt//yct@lists.infradead.org X-Gm-Message-State: AOJu0YwXiUJIwv5ATROuhMsRqyI23pls8MmLsnLIAfFYIrEFKItxAtCs dPawjEIDDvtR+Wz4l7xCB4K3o0lfcGgeGs8BglQCQ5dv+3goCHX9EbZNxT2zrTg= X-Gm-Gg: ASbGnctGfUSgvYNDrCx3boUvDvGhlh4KrkENm0l2ly40F7LeVSsMxJSKIjT8bvrt7HW XMjPW7LxSgeDIV6pwcH5QSlb7VMF6PWopmjfPDTdgwzQHMwe/tpg2SC2PVfVbhB9IZpCZ7Zvj8P VpE8ntGoYikscu2Rc7+vYtOsx0aK3h6rLSfmTTleSIKuOXLdivOJBUVz1aoF56L8w8vc8lw4DCH wCZFInp7wNum0mfeq+Tpt7+4N2JOHY//NnEu/cQcAmOY5tDoGNRV9V7cLsdHDj8jDRtdCdbcXBy GvloUvgWQwxm X-Google-Smtp-Source: AGHT+IE1hxIA+zty0IDfgAoUxOjIOrc1e6B7eBLp0wuK/35clgp+dxoPGKaDdwuWgNf5QUZVkobIVA== X-Received: by 2002:a05:600c:4e43:b0:439:33c5:386c with SMTP id 5b1f17b1804b1-43933c538ffmr110046565e9.5.1739270436244; Tue, 11 Feb 2025 02:40:36 -0800 (PST) Received: from pop-os.. ([145.224.65.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd02e2a90sm10456047f8f.98.2025.02.11.02.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 02:40:35 -0800 (PST) From: James Clark To: lcherian@marvell.com, coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 3/7] coresight: Only check bottom two claim bits Date: Tue, 11 Feb 2025 10:39:39 +0000 Message-Id: <20250211103945.967495-4-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211103945.967495-1-james.clark@linaro.org> References: <20250211103945.967495-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250211_024037_614034_EE3B7B58 X-CRM114-Status: GOOD ( 13.76 ) 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 The use of the whole register and == could break the claim mechanism if any of the other bits are used in the future. The referenced doc "PSCI - ARM DEN 0022D" also says to only read and clear the bottom two bits. Use FIELD_GET() to extract only the relevant part. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-core.c | 3 ++- drivers/hwtracing/coresight/coresight-priv.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index a669872b4118..7b53165c93af 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -129,7 +129,8 @@ coresight_find_out_connection(struct coresight_device *csdev, static inline u32 coresight_read_claim_tags(struct csdev_access *csa) { - return csdev_access_relaxed_read32(csa, CORESIGHT_CLAIMCLR); + return FIELD_GET(CORESIGHT_CLAIM_MASK, + csdev_access_relaxed_read32(csa, CORESIGHT_CLAIMCLR)); } static inline bool coresight_is_claimed_self_hosted(struct csdev_access *csa) diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index 05f891ca6b5c..cc7ff1e36ef4 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -35,6 +35,7 @@ extern const struct device_type coresight_dev_type[]; * Coresight device CLAIM protocol. * See PSCI - ARM DEN 0022D, Section: 6.8.1 Debug and Trace save and restore. */ +#define CORESIGHT_CLAIM_MASK GENMASK(1, 0) #define CORESIGHT_CLAIM_SELF_HOSTED BIT(1) #define TIMEOUT_US 100 From patchwork Tue Feb 11 10:39:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13970027 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 956BFC0219D for ; Tue, 11 Feb 2025 10:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sKjlxs2/NLZM1oTa5EiDclwanqKKN/FNJx7pDcED3LQ=; b=1un6AciYGhLTqQauF2dae8uEUA tXyTLZZqhmlhSGd/k9ybYPe6eTKDS7k5PAQTYoEDDQqxWX6J1cPC0dCUU6RtKOq6Vg+R4VGQAvCZa xGi4YQhxyVaUzx5qIc+Jr+k3GtRxDca6rwoHRX/cGd0ieMHAeG2hQmKV/OoGi3owCxWT+LBA1HgbB 7fBKuwtQf6/NOSDkOCcr+zsYcUNDOUMuequX1z3CDkGGYxe7mGcc8lylTA7Cy2gNRaFn8JM61jics a9CHnA5HWrLe9GXDOxX0og5KwOLifoPp6wU9cpynjjrm5cKtgAKCMdLwbkQgcaAaAjlRVIliiW+H9 20PfTmEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thnqC-00000003Q84-0sFX; Tue, 11 Feb 2025 10:50:08 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thnh2-00000003NvF-3U7V for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2025 10:40:42 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so53406665e9.3 for ; Tue, 11 Feb 2025 02:40:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739270439; x=1739875239; 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=sKjlxs2/NLZM1oTa5EiDclwanqKKN/FNJx7pDcED3LQ=; b=eqGWkm5z5Bb7C2L31i/c8Gkrzc6Z3Wq7Agn99F2uNSkmcAGN0O+r9sGOeAr3Z0Acrh Wlg1yGJIMD2ePzoZLbBay5WlX8oveyUKuNcqYT3jSSy7a/0HMPggUjUZuVj1SFZ5C/bx BQbUh8+n4vuj0HuJD8/QuyWhjuVCYoOYx/7YUW/vPn7eCtF77MHPNeN83zhh1j8elTum HAJuZShiMhLFhNWxQ+LXxhaEnd9yx2oKbnLqkLv4/ccp/J+XLsNb69+ANybnewRVGbGo L8rIQIrn9YQ85IRoZG9k2E+6pZPkC9aLGakTeJgUy6vhtt0k0RU6c2tMAjWxifqXFBTp zrSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739270439; x=1739875239; 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=sKjlxs2/NLZM1oTa5EiDclwanqKKN/FNJx7pDcED3LQ=; b=Re0QlLQFCvE4nabvGJJU8VJdMVi60rljta278xx0lWGjGDZeWZnXYYl/fK5vIq32YV pZqBFeUZ8wlnvRjsrbSfb2Qr7WqACSLuKn3Av27qLNLCtv3dzmbsf5fHEVNESGSLjalE zLYsFpzuliM9OJ4Kc2LD0UyZNz9TpxO4LZCg951r8HfzY802z293zGv7z9yCkBQ96qgz ujNcphcMg8E8byOMfJylq2Vq8G8qKuwW0lhev5A2VVWW8PTyLS7UiNrnUuF+6KHuM6pS j2l9ReHDxdYzwJMMbuoakOFkTXSFADZdo/ztKQ4TJH399OF82h92lyDXxibYnSWCq0vo 0gsw== X-Forwarded-Encrypted: i=1; AJvYcCWLVN5JwtRE6g2tl5CLl/+1IseRDKnER3namYfux51rdRxY4y7a5EQx8ODQ5f6nwbrIeHbzxCkmoPSEQVBmJAnR@lists.infradead.org X-Gm-Message-State: AOJu0Yyd+D516WSy+s8PvhDsgx4aUvcYTERD+cX60RE+SRAe7CEqVFkV XLJAztyQOby6ccVhcQ5SWxI0aeL9RBrw7UTYqv6Qpt3S53UochWUJVZ8mSEoWRA= X-Gm-Gg: ASbGncvO5fIYkchmiwQt5N55EhFdx0YtyAionp2zIhr0I3Lsbgb4TA5j1qmyUWvnNEN 5Ox2/xAufU1msDJFPYY2BHeXdVPxUQPMv396ppP5fUw0rGmZlstWEXXcONp625vNWJjqewsdqAI WmhsuNbISgeJqBRI6OAIKpD1CTPwt5WeOH7/gaKFrp1PiKjCCa1DLuWt8tcUyEWvpRrvMHcyE2o bFa0e0+QXnnenRNAOK9bk9Ug6tJx8ZDUvFxndet5S34+zdNxK/qxjBDPb2+rS0EtFVq4B6JnRaM VXMsZxr0/2o/ X-Google-Smtp-Source: AGHT+IHoYKN0xK20CRb2BG7n5QKE/mgzwqqJVxGvuUHYmxPDnLSwWVoOeaDFYouJ/QTG+TlYqu4pkQ== X-Received: by 2002:a7b:cb88:0:b0:431:58cd:b259 with SMTP id 5b1f17b1804b1-43924a27b05mr156406225e9.31.1739270439183; Tue, 11 Feb 2025 02:40:39 -0800 (PST) Received: from pop-os.. ([145.224.65.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd02e2a90sm10456047f8f.98.2025.02.11.02.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 02:40:38 -0800 (PST) From: James Clark To: lcherian@marvell.com, coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 4/7] coresight: Add claim tag warnings and debug messages Date: Tue, 11 Feb 2025 10:39:40 +0000 Message-Id: <20250211103945.967495-5-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211103945.967495-1-james.clark@linaro.org> References: <20250211103945.967495-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250211_024040_867672_451ECF6B X-CRM114-Status: GOOD ( 16.87 ) 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 Add a dev_dbg() message so that external debugger conflicts are more visible. There are multiple reasons for -EBUSY so a message for this particular one could be helpful. Add errors for and enumerate all the other cases that are impossible. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-core.c | 48 ++++++++++++-------- drivers/hwtracing/coresight/coresight-priv.h | 5 +- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 7b53165c93af..7fe5d5d432c4 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -133,16 +133,6 @@ static inline u32 coresight_read_claim_tags(struct csdev_access *csa) csdev_access_relaxed_read32(csa, CORESIGHT_CLAIMCLR)); } -static inline bool coresight_is_claimed_self_hosted(struct csdev_access *csa) -{ - return coresight_read_claim_tags(csa) == CORESIGHT_CLAIM_SELF_HOSTED; -} - -static inline bool coresight_is_claimed_any(struct coresight_device *csdev) -{ - return coresight_read_claim_tags(&csdev->access) != 0; -} - static inline void coresight_set_self_claim_tag(struct csdev_access *csa) { csdev_access_relaxed_write32(csa, CORESIGHT_CLAIM_SELF_HOSTED, @@ -169,18 +159,40 @@ static inline void coresight_clear_self_claim_tag(struct csdev_access *csa) */ int coresight_claim_device_unlocked(struct coresight_device *csdev) { + int tag; + struct csdev_access *csa; + if (WARN_ON(!csdev)) return -EINVAL; - if (coresight_is_claimed_any(csdev)) + csa = &csdev->access; + tag = coresight_read_claim_tags(csa); + + switch (tag) { + case CORESIGHT_CLAIM_FREE: + coresight_set_self_claim_tag(csa); + if (coresight_read_claim_tags(csa) == CORESIGHT_CLAIM_SELF_HOSTED) + return 0; + + /* There was a race setting the tag, clean up and fail */ + coresight_clear_self_claim_tag(csa); return -EBUSY; - coresight_set_self_claim_tag(&csdev->access); - if (coresight_is_claimed_self_hosted(&csdev->access)) - return 0; - /* There was a race setting the tag, clean up and fail */ - coresight_clear_self_claim_tag(&csdev->access); - return -EBUSY; + case CORESIGHT_CLAIM_EXTERNAL: + /* External debug is an expected state, so log and report BUSY */ + dev_dbg(&csdev->dev, "Busy: Claimed by external debugger"); + return -EBUSY; + + default: + case CORESIGHT_CLAIM_SELF_HOSTED: + case CORESIGHT_CLAIM_INVALID: + /* + * Warn here because we clear a lingering self hosted tag + * on probe, so other tag combinations are impossible. + */ + dev_err_once(&csdev->dev, "Invalid claim tag state: %x", tag); + return -EBUSY; + } } EXPORT_SYMBOL_GPL(coresight_claim_device_unlocked); @@ -205,7 +217,7 @@ EXPORT_SYMBOL_GPL(coresight_claim_device); */ void coresight_disclaim_device_unlocked(struct csdev_access *csa) { - if (coresight_is_claimed_self_hosted(csa)) + if (coresight_read_claim_tags(csa) == CORESIGHT_CLAIM_SELF_HOSTED) coresight_clear_self_claim_tag(csa); else /* diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index cc7ff1e36ef4..a83113225797 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -36,7 +36,10 @@ extern const struct device_type coresight_dev_type[]; * See PSCI - ARM DEN 0022D, Section: 6.8.1 Debug and Trace save and restore. */ #define CORESIGHT_CLAIM_MASK GENMASK(1, 0) -#define CORESIGHT_CLAIM_SELF_HOSTED BIT(1) +#define CORESIGHT_CLAIM_FREE 0 +#define CORESIGHT_CLAIM_EXTERNAL 1 +#define CORESIGHT_CLAIM_SELF_HOSTED 2 +#define CORESIGHT_CLAIM_INVALID 3 #define TIMEOUT_US 100 #define BMVAL(val, lsb, msb) ((val & GENMASK(msb, lsb)) >> lsb) From patchwork Tue Feb 11 10:39:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13970028 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 33D3FC0219B for ; Tue, 11 Feb 2025 10:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mq2yuNxgYvmlFHK8kUNExyKdrcQ68pV8lBs/vzGd9Qk=; b=K7iosFeU7o1eOPN71OQ6MC/kd9 TjoD7lzu4w8r6aQayXfVg7BrydHuySdySyNZDcjdyNLIKluJuBoDtASjYiWp80VNM8LUmurtLpbHi mVuIXAv2sQjgy31W+zcBdg1Y2g7eNl0m+IKAXuhugPrDcfsCmd8b+fj98nuhtM5qWODSQddfrOGi6 Yyj4DjvgKcQjOLmHiZsWDT31iu6MMZBCwh8PwKpeQtnZZAWvujyjmmMdxLYX8p1WHDqDmahz+QRyw x1MSpJHbLK5nLBpS2bt76C49Lyu6bijMmAQ0hFRUkFSuE1zA3OdZ/eMUCK5/kMbrHvIK3wBtTtV61 PW9CYnpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thnrZ-00000003QP4-3aPf; Tue, 11 Feb 2025 10:51:33 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thnh5-00000003NxA-3zDb for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2025 10:40:45 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38dd93ace00so1375684f8f.1 for ; Tue, 11 Feb 2025 02:40:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739270442; x=1739875242; 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=mq2yuNxgYvmlFHK8kUNExyKdrcQ68pV8lBs/vzGd9Qk=; b=eR0cMre+1FzNORY342tiudZJ3WLX3/D9/RueeQMC9+hSXOo1a9Q9Tk0FlqWhgifIGU QFzmEhHzqVCBgSgwA+RO85YJ8VHq430Hq04cidZQbI9fEVxtun1YVT4Yku1t5KFZnIdX iH8kj0F4JCr7TrtHHwtYyp30/ccM68DwNlbphwGqrCzqrL4UoAOjAqlWKKEp9lC/re/n P29GYjG0kies36FlUepDKclQ9vtqkwmxzcVqBG1DCIuVkID8v5B5ZPCnbVMY/OerXhqs qRjfjf9/xNtYQirdlAKQBTEGMnk3d7wYAnQWHVCp/S3V17+agSx8uLrW/YmNzClpb/BU jkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739270442; x=1739875242; 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=mq2yuNxgYvmlFHK8kUNExyKdrcQ68pV8lBs/vzGd9Qk=; b=dFaPHQcQePfylnIWpauoMjk3euY0ZxEkdXXh0LuJ8dTcoQ//QOfWivjmqAuzX+Y54T Tn1bFV7kNj0LklOMplyYhpF0LS6eeT4EIgKSNiRkqdc+O1rgEkZB8OzgGe712vRWSWPO 3o7uuT+VNmV1IjdMxl57ZuxDrfnwihtKBBL65R71qoKXpHabLX39rzNXz2fUkO7faeMQ JWaJz2ouridZC2hoboNMSjWU9i4/PkGIVCSKIC3GFq7x1qGYerfciKAAkTkIZIjy6uPY UwTfAvwF0NSfA6gdncencRCzIdNsehoeeQPryiFXvkwJunKVSo5GmMiIL21NTQAjPDne qeCQ== X-Forwarded-Encrypted: i=1; AJvYcCXfm/m4PIjk1j1a5YViMxfA0BdwhrlTzfWhYlXwH9nsMkdOi+8xYHb5IYjHk2YwqGd/HX/wnHLyiYVnT9Qm6uyD@lists.infradead.org X-Gm-Message-State: AOJu0YwMyWpBS0ls8N4Suun66ogiKUzrMpREtqKP5u0vwDAAhfgHCm/6 MGpXADuSDnvVlYMuNiWPvhWFT7vCU2wpYNDBuGpUYvnro1psXZ+m0hKs7j1uS7c= X-Gm-Gg: ASbGncs/krOU3HKjoA02+IpRqcjDNVLNAsG//P19wYCVgLCQI3vHL2kMXuoWwwb6RSy r9SZqhWUU+vBk720d8HX7k7PRaw6MxPzkyH+klNvb8TE9syv0bSAh0CUd6YlpjuQkOLO5Qzhmxi 5VZi/m3b4ddGXxjtnMeId9+9kwapcW4UWmM740MvqucdRaZms+2xKe3nV60tRF8sK4YM2Ed96yS ihYSdYMfhw7Fsq3Q3MY4biIt8XwMbvirbZXUdjaxmeGJLHpT0NndHmDeEQ/0OBn+mqolpCVoPRW GDXE8IG+t5mC X-Google-Smtp-Source: AGHT+IHtNNw9kps89Ef5g9lEwJ3sKBZ5nK8SGzKs6tj6r0kcmS4zP+Yxly2l/qcnZuMUHS5vBCNvRg== X-Received: by 2002:a05:6000:184e:b0:38d:e3fd:a9aa with SMTP id ffacd0b85a97d-38de3fda9c9mr2385131f8f.42.1739270442289; Tue, 11 Feb 2025 02:40:42 -0800 (PST) Received: from pop-os.. ([145.224.65.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd02e2a90sm10456047f8f.98.2025.02.11.02.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 02:40:41 -0800 (PST) From: James Clark To: lcherian@marvell.com, coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 5/7] coresight: Clear self hosted claim tag on probe Date: Tue, 11 Feb 2025 10:39:41 +0000 Message-Id: <20250211103945.967495-6-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211103945.967495-1-james.clark@linaro.org> References: <20250211103945.967495-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250211_024044_032631_45B6FAE0 X-CRM114-Status: GOOD ( 23.88 ) 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 This can be left behind from a crashed kernel after a kexec so clear it when probing each device. Similarly to coresight_disclaim_device_unlocked(), only clear it if it's already set to avoid races with an external debugger. We need a csdev_access struct in etm_init_arch_data() so just replace the iomem pointer with a full csdev_access struct. This means all usages need to be updated to go through csa->base. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-catu.c | 1 + drivers/hwtracing/coresight/coresight-core.c | 48 +++++++++++++++---- .../hwtracing/coresight/coresight-cti-core.c | 2 + drivers/hwtracing/coresight/coresight-etb10.c | 2 + drivers/hwtracing/coresight/coresight-etm.h | 6 +-- .../coresight/coresight-etm3x-core.c | 28 +++++------ .../coresight/coresight-etm3x-sysfs.c | 8 ++-- .../coresight/coresight-etm4x-core.c | 2 + .../hwtracing/coresight/coresight-funnel.c | 2 + .../coresight/coresight-replicator.c | 1 + .../hwtracing/coresight/coresight-tmc-core.c | 1 + include/linux/coresight.h | 3 ++ 12 files changed, 73 insertions(+), 31 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index d9259c0b6e64..575c2d247a90 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -558,6 +558,7 @@ static int __catu_probe(struct device *dev, struct resource *res) catu_desc.subtype.helper_subtype = CORESIGHT_DEV_SUBTYPE_HELPER_CATU; catu_desc.ops = &catu_ops; + coresight_reset_claim(&catu_desc.access); drvdata->csdev = coresight_register(&catu_desc); if (IS_ERR(drvdata->csdev)) ret = PTR_ERR(drvdata->csdev); diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 7fe5d5d432c4..97f33ffad05e 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -212,20 +212,48 @@ int coresight_claim_device(struct coresight_device *csdev) EXPORT_SYMBOL_GPL(coresight_claim_device); /* - * coresight_disclaim_device_unlocked : Clear the claim tag for the device. + * Clear the claim tag for the device. + * Returns an error if the device wasn't already claimed. + */ +int coresight_reset_claim(struct csdev_access *csa) +{ + int ret; + + CS_UNLOCK(csa->base); + ret = coresight_reset_claim_unlocked(csa); + CS_LOCK(csa->base); + return ret; +} +EXPORT_SYMBOL_GPL(coresight_reset_claim); + +/* + * Clear the claim tag for the device. Called with CS_UNLOCKed for the component. + * Returns an error if the device wasn't already claimed. + */ +int coresight_reset_claim_unlocked(struct csdev_access *csa) +{ + if (coresight_read_claim_tags(csa) == CORESIGHT_CLAIM_SELF_HOSTED) { + coresight_clear_self_claim_tag(csa); + return 0; + } + + return -EINVAL; +} +EXPORT_SYMBOL_GPL(coresight_reset_claim_unlocked); + +/* + * coresight_disclaim_device_unlocked : Clear the claim tag for the device + * and warn if the device wasn't already claimed. * Called with CS_UNLOCKed for the component. */ void coresight_disclaim_device_unlocked(struct csdev_access *csa) { - if (coresight_read_claim_tags(csa) == CORESIGHT_CLAIM_SELF_HOSTED) - coresight_clear_self_claim_tag(csa); - else - /* - * The external agent may have not honoured our claim - * and has manipulated it. Or something else has seriously - * gone wrong in our driver. - */ - WARN_ON_ONCE(1); + /* + * Warn if the external agent hasn't honoured our claim + * and has manipulated it. Or something else has seriously + * gone wrong in our driver. + */ + WARN_ON_ONCE(coresight_reset_claim_unlocked(csa)); } EXPORT_SYMBOL_GPL(coresight_disclaim_device_unlocked); diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwtracing/coresight/coresight-cti-core.c index 073f67a41af9..389a72362f0c 100644 --- a/drivers/hwtracing/coresight/coresight-cti-core.c +++ b/drivers/hwtracing/coresight/coresight-cti-core.c @@ -931,6 +931,8 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) cti_desc.ops = &cti_ops; cti_desc.groups = drvdata->ctidev.con_groups; cti_desc.dev = dev; + + coresight_reset_claim(&cti_desc.access); drvdata->csdev = coresight_register(&cti_desc); if (IS_ERR(drvdata->csdev)) { ret = PTR_ERR(drvdata->csdev); diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index d8bc3e776c88..b598b2c0c9bb 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -772,6 +772,8 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id) desc.pdata = pdata; desc.dev = dev; desc.groups = coresight_etb_groups; + + coresight_reset_claim(&desc.access); drvdata->csdev = coresight_register(&desc); if (IS_ERR(drvdata->csdev)) return PTR_ERR(drvdata->csdev); diff --git a/drivers/hwtracing/coresight/coresight-etm.h b/drivers/hwtracing/coresight/coresight-etm.h index e02c3ea972c9..a89736309c27 100644 --- a/drivers/hwtracing/coresight/coresight-etm.h +++ b/drivers/hwtracing/coresight/coresight-etm.h @@ -229,7 +229,7 @@ struct etm_config { * @config: structure holding configuration parameters. */ struct etm_drvdata { - void __iomem *base; + struct csdev_access csa; struct clk *atclk; struct coresight_device *csdev; spinlock_t spinlock; @@ -260,7 +260,7 @@ static inline void etm_writel(struct etm_drvdata *drvdata, "invalid CP14 access to ETM reg: %#x", off); } } else { - writel_relaxed(val, drvdata->base + off); + writel_relaxed(val, drvdata->csa.base + off); } } @@ -274,7 +274,7 @@ static inline unsigned int etm_readl(struct etm_drvdata *drvdata, u32 off) "invalid CP14 access to ETM reg: %#x", off); } } else { - val = readl_relaxed(drvdata->base + off); + val = readl_relaxed(drvdata->csa.base + off); } return val; diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c index 509f53b69e42..0b010683b883 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c @@ -86,9 +86,9 @@ static void etm_set_pwrup(struct etm_drvdata *drvdata) { u32 etmpdcr; - etmpdcr = readl_relaxed(drvdata->base + ETMPDCR); + etmpdcr = readl_relaxed(drvdata->csa.base + ETMPDCR); etmpdcr |= ETMPDCR_PWD_UP; - writel_relaxed(etmpdcr, drvdata->base + ETMPDCR); + writel_relaxed(etmpdcr, drvdata->csa.base + ETMPDCR); /* Ensure pwrup completes before subsequent cp14 accesses */ mb(); isb(); @@ -101,9 +101,9 @@ static void etm_clr_pwrup(struct etm_drvdata *drvdata) /* Ensure pending cp14 accesses complete before clearing pwrup */ mb(); isb(); - etmpdcr = readl_relaxed(drvdata->base + ETMPDCR); + etmpdcr = readl_relaxed(drvdata->csa.base + ETMPDCR); etmpdcr &= ~ETMPDCR_PWD_UP; - writel_relaxed(etmpdcr, drvdata->base + ETMPDCR); + writel_relaxed(etmpdcr, drvdata->csa.base + ETMPDCR); } /** @@ -365,7 +365,7 @@ static int etm_enable_hw(struct etm_drvdata *drvdata) struct etm_config *config = &drvdata->config; struct coresight_device *csdev = drvdata->csdev; - CS_UNLOCK(drvdata->base); + CS_UNLOCK(drvdata->csa.base); rc = coresight_claim_device_unlocked(csdev); if (rc) @@ -427,7 +427,7 @@ static int etm_enable_hw(struct etm_drvdata *drvdata) etm_clr_prog(drvdata); done: - CS_LOCK(drvdata->base); + CS_LOCK(drvdata->csa.base); dev_dbg(&drvdata->csdev->dev, "cpu: %d enable smp call done: %d\n", drvdata->cpu, rc); @@ -589,7 +589,7 @@ static void etm_disable_hw(void *info) struct etm_config *config = &drvdata->config; struct coresight_device *csdev = drvdata->csdev; - CS_UNLOCK(drvdata->base); + CS_UNLOCK(drvdata->csa.base); etm_set_prog(drvdata); /* Read back sequencer and counters for post trace analysis */ @@ -601,7 +601,7 @@ static void etm_disable_hw(void *info) etm_set_pwrdwn(drvdata); coresight_disclaim_device_unlocked(&csdev->access); - CS_LOCK(drvdata->base); + CS_LOCK(drvdata->csa.base); dev_dbg(&drvdata->csdev->dev, "cpu: %d disable smp call done\n", drvdata->cpu); @@ -614,7 +614,7 @@ static void etm_disable_perf(struct coresight_device *csdev) if (WARN_ON_ONCE(drvdata->cpu != smp_processor_id())) return; - CS_UNLOCK(drvdata->base); + CS_UNLOCK(drvdata->csa.base); /* Setting the prog bit disables tracing immediately */ etm_set_prog(drvdata); @@ -626,7 +626,7 @@ static void etm_disable_perf(struct coresight_device *csdev) etm_set_pwrdwn(drvdata); coresight_disclaim_device_unlocked(&csdev->access); - CS_LOCK(drvdata->base); + CS_LOCK(drvdata->csa.base); /* * perf will release trace ids when _free_aux() @@ -772,7 +772,7 @@ static void etm_init_arch_data(void *info) /* Make sure all registers are accessible */ etm_os_unlock(drvdata); - CS_UNLOCK(drvdata->base); + CS_UNLOCK(drvdata->csa.base); /* First dummy read */ (void)etm_readl(drvdata, ETMPDSR); @@ -803,9 +803,10 @@ static void etm_init_arch_data(void *info) drvdata->nr_ext_out = BMVAL(etmccr, 20, 22); drvdata->nr_ctxid_cmp = BMVAL(etmccr, 24, 25); + coresight_reset_claim_unlocked(&drvdata->csa); etm_set_pwrdwn(drvdata); etm_clr_pwrup(drvdata); - CS_LOCK(drvdata->base); + CS_LOCK(drvdata->csa.base); } static int __init etm_hp_setup(void) @@ -866,8 +867,7 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id) if (IS_ERR(base)) return PTR_ERR(base); - drvdata->base = base; - desc.access = CSDEV_ACCESS_IOMEM(base); + desc.access = drvdata->csa = CSDEV_ACCESS_IOMEM(base); spin_lock_init(&drvdata->spinlock); diff --git a/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c index 68c644be9813..af566b62785c 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm3x-sysfs.c @@ -50,11 +50,11 @@ static ssize_t etmsr_show(struct device *dev, pm_runtime_get_sync(dev->parent); spin_lock_irqsave(&drvdata->spinlock, flags); - CS_UNLOCK(drvdata->base); + CS_UNLOCK(drvdata->csa.base); val = etm_readl(drvdata, ETMSR); - CS_LOCK(drvdata->base); + CS_LOCK(drvdata->csa.base); spin_unlock_irqrestore(&drvdata->spinlock, flags); pm_runtime_put(dev->parent); @@ -949,9 +949,9 @@ static ssize_t seq_curr_state_show(struct device *dev, pm_runtime_get_sync(dev->parent); spin_lock_irqsave(&drvdata->spinlock, flags); - CS_UNLOCK(drvdata->base); + CS_UNLOCK(drvdata->csa.base); val = (etm_readl(drvdata, ETMSQR) & ETM_SQR_MASK); - CS_LOCK(drvdata->base); + CS_LOCK(drvdata->csa.base); spin_unlock_irqrestore(&drvdata->spinlock, flags); pm_runtime_put(dev->parent); diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 45b30a4b3eba..3609bb74c4ec 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -1337,6 +1337,8 @@ static void etm4_init_arch_data(void *info) drvdata->nrseqstate = FIELD_GET(TRCIDR5_NUMSEQSTATE_MASK, etmidr5); /* NUMCNTR, bits[30:28] number of counters available for tracing */ drvdata->nr_cntr = FIELD_GET(TRCIDR5_NUMCNTR_MASK, etmidr5); + + coresight_reset_claim_unlocked(csa); etm4_cs_lock(drvdata, csa); cpu_detect_trace_filtering(drvdata); } diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index e986922d555b..be2a47636ef3 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -255,6 +255,7 @@ static int funnel_probe(struct device *dev, struct resource *res) drvdata->base = base; desc.groups = coresight_funnel_groups; desc.access = CSDEV_ACCESS_IOMEM(base); + coresight_reset_claim(&desc.access); } dev_set_drvdata(dev, drvdata); @@ -272,6 +273,7 @@ static int funnel_probe(struct device *dev, struct resource *res) desc.ops = &funnel_cs_ops; desc.pdata = pdata; desc.dev = dev; + drvdata->csdev = coresight_register(&desc); if (IS_ERR(drvdata->csdev)) { ret = PTR_ERR(drvdata->csdev); diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index 5d42a9a8c460..679a36effbe8 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -284,6 +284,7 @@ static int replicator_probe(struct device *dev, struct resource *res) desc.pdata = dev->platform_data; desc.dev = dev; + coresight_reset_claim(&desc.access); drvdata->csdev = coresight_register(&desc); if (IS_ERR(drvdata->csdev)) { ret = PTR_ERR(drvdata->csdev); diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c index e9876252a789..5ac4e3c706ac 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -558,6 +558,7 @@ static int __tmc_probe(struct device *dev, struct resource *res) dev->platform_data = pdata; desc.pdata = pdata; + coresight_reset_claim(&desc.access); drvdata->csdev = coresight_register(&desc); if (IS_ERR(drvdata->csdev)) { ret = PTR_ERR(drvdata->csdev); diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 937931d107e0..11808aee9d1d 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -655,6 +655,9 @@ extern int coresight_claim_device_unlocked(struct coresight_device *csdev); extern void coresight_disclaim_device(struct csdev_access *csa); extern void coresight_disclaim_device_unlocked(struct csdev_access *csa); +int coresight_reset_claim_unlocked(struct csdev_access *csa); +int coresight_reset_claim(struct csdev_access *csa); + extern char *coresight_alloc_device_name(struct coresight_dev_list *devs, struct device *dev); From patchwork Tue Feb 11 10:39:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13970029 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 1BC80C0219B for ; Tue, 11 Feb 2025 10:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GiAjqwaZ3nVAqdonpuvRAIrXGlb67ZZwtpDS9DyJjAk=; b=kk70oSWwPb4MWVhfbkG1Mqeli7 tpw07IZH/W5bObLruWbHEFWv7hbzfk+H9iW0xcBTMAsRuS8Ap1sZCl/TrwZPJqu78ziX85voezJlF bhRM9JWq4Wa9JCxwjkbgJX115GSXjhERG4PvK+28KS+wyjpniJJ++MCGewBpMzLFr39G1do2nqboy Nvf03pBNeZVGaGKV6zjjxPn6IZS4Y28boqPuiy6h/EhdNSp8Mq5PoZzmChUXHsop+wxBHf/C9W6EB 7GEATQHrjHG76rkjnVoehfSwkusdYKaAAkHa3NjTin/1P466AzZlSa6SOGVv+T5qD0rnpRYVUSa4k hIsySDDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thnsx-00000003Qd4-24d5; Tue, 11 Feb 2025 10:52:59 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thnh9-00000003NyE-0dDa for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2025 10:40:48 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-38ddc36b81dso1470686f8f.1 for ; Tue, 11 Feb 2025 02:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739270445; x=1739875245; 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=GiAjqwaZ3nVAqdonpuvRAIrXGlb67ZZwtpDS9DyJjAk=; b=HNUFhpFQnV82xix+Yu88/5OetBjsEIV9JJs5xHj+gp9x3TK2KD0+xuDOcybggkYSgd RqCtcdXzS8bhDA+tBiSJQecC6a+Er6msO9I7pO5xkO9aNynX6XIP1M5LOJxIcFDDY7C7 R0ujYWQUlJEeqQqEJT1KNu5rkAv5TQl+p8VrxsbcQk2Z/mDLLS9jGF2PFRrs8qquIab9 L7SAYXzZ/5vunciGf9p66AAgdSyss90jqBHTfCqj024oN8ERYhDb3edo/aa4JqU3Ay5S hzdJYYoBJQI0aJbEhNipE5lqbBh/2cbBTyT9YEeySX7tvqVYDrmIteDJlImUEgslpZ+k ZPhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739270445; x=1739875245; 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=GiAjqwaZ3nVAqdonpuvRAIrXGlb67ZZwtpDS9DyJjAk=; b=k9qr2z//X9i3Egczz4QtOZReJCpm4HYieL/HQwU4qEqRjZ/0qpphrTeBeG7w3C8Lya RjrVqKjv42ohTlpikZzwrdIQlVBzZbqkmA85JPmGwrf0VUWhQyyIbFmqDPJkqfz1BiRA 7TrmY/dbx5Cpe+Nt73iV+3VD+41Nn1BalP6PkVN4NJtA8zzsxYoYjnRJtbGv0GdoghRL 8Jj1RpKJFrqYvI1JOaWDRUIcBwQkqid+z+TIaSpzDzzFENtraVfWrPN7AgCtWdkeEfps xfXSZIj32mt+CfDKrapWw7D/gV4rakumCVDm4jOeOvjgf3lfr0xauHjrphRNRcdEO1Ir 8dow== X-Forwarded-Encrypted: i=1; AJvYcCX+oiyBtxCsK0CjQtsfVmEl15wHYl0g4AHDbKMlt61OU+FRi6JFBmBjI02CZqLlJRdxO2feuUXoynNuHwE/FDG+@lists.infradead.org X-Gm-Message-State: AOJu0YwvxcUSBKIDxMbuZHv70BXRRHiOdXWMdBMjPPnKTkuQWngsDlhY nCx+ODgERBXP/8SRNm50wXagNnZgkbgO9kP3pkMVTFXPNS95hG098VLpGSDZXSI= X-Gm-Gg: ASbGncuI03wW8FCfx2keJQQsk8BLPmFahblGqy2T+0ZAcIjeAaSqZ/to8HKh9/MTd3P vHFg6B1++3akJZDcwkcAOr0tWRg51Nhs7BfMyCAGv2y7FRJdaHX0eMfttTsKhy+pkujyILL9Wwj wfwC4/neRZgi/tm1DtevKnMl8XuUa678ujVwqojh2oFhzBuESOLkHT2nwNKXJiuNtod88Qqb37h ZY15QOl438/yXZ/OErllpZvb0jEtkRQQc+zAfVcWYyyfjOiNz9+mF7odlr5Hj2qQA3vukrsWM3i MJ02zKmh2Csf X-Google-Smtp-Source: AGHT+IGgTwnyMCtIap9ZY8KzTWT5DVFlEG9774Oxb163Wm6vhcjGY3fwrwpitF2Snldpk+ufZi/Ukg== X-Received: by 2002:a05:6000:18a5:b0:38d:c74f:4234 with SMTP id ffacd0b85a97d-38de43cdd15mr2255727f8f.29.1739270445265; Tue, 11 Feb 2025 02:40:45 -0800 (PST) Received: from pop-os.. ([145.224.65.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd02e2a90sm10456047f8f.98.2025.02.11.02.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 02:40:44 -0800 (PST) From: James Clark To: lcherian@marvell.com, coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 6/7] coresight: Remove inlines from static function definitions Date: Tue, 11 Feb 2025 10:39:42 +0000 Message-Id: <20250211103945.967495-7-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211103945.967495-1-james.clark@linaro.org> References: <20250211103945.967495-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250211_024047_197514_830063AE X-CRM114-Status: GOOD ( 21.57 ) 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 These are all static and in one compilation unit so the inline has no effect on the binary. Except if FTRACE is enabled, then some functions which were already not inlined now get the nops added which allows them to be traced. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-catu.c | 11 ++++---- drivers/hwtracing/coresight/coresight-core.c | 16 ++++++------ drivers/hwtracing/coresight/coresight-etb10.c | 2 +- .../coresight/coresight-etm4x-core.c | 8 +++--- .../coresight/coresight-etm4x-sysfs.c | 4 +-- .../hwtracing/coresight/coresight-platform.c | 26 +++++++++---------- .../coresight/coresight-replicator.c | 2 +- drivers/hwtracing/coresight/coresight-stm.c | 6 ++--- .../coresight/coresight-syscfg-configfs.c | 2 +- .../hwtracing/coresight/coresight-tmc-core.c | 8 +++--- .../hwtracing/coresight/coresight-tmc-etr.c | 16 +++++------- drivers/hwtracing/coresight/coresight-trbe.c | 18 ++++++------- 12 files changed, 58 insertions(+), 61 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index 575c2d247a90..ffa08ea3c296 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -113,9 +113,8 @@ typedef u64 cate_t; * containing the data page pointer for @offset. If @daddrp is not NULL, * @daddrp points the DMA address of the beginning of the table. */ -static inline cate_t *catu_get_table(struct tmc_sg_table *catu_table, - unsigned long offset, - dma_addr_t *daddrp) +static cate_t *catu_get_table(struct tmc_sg_table *catu_table, unsigned long offset, + dma_addr_t *daddrp) { unsigned long buf_size = tmc_sg_table_buf_size(catu_table); unsigned int table_nr, pg_idx, pg_offset; @@ -165,12 +164,12 @@ static void catu_dump_table(struct tmc_sg_table *catu_table) } #else -static inline void catu_dump_table(struct tmc_sg_table *catu_table) +static void catu_dump_table(struct tmc_sg_table *catu_table) { } #endif -static inline cate_t catu_make_entry(dma_addr_t addr) +static cate_t catu_make_entry(dma_addr_t addr) { return addr ? CATU_VALID_ENTRY(addr) : 0; } @@ -390,7 +389,7 @@ static const struct attribute_group *catu_groups[] = { }; -static inline int catu_wait_for_ready(struct catu_drvdata *drvdata) +static int catu_wait_for_ready(struct catu_drvdata *drvdata) { struct csdev_access *csa = &drvdata->csdev->access; diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 97f33ffad05e..396218819f26 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -127,20 +127,20 @@ coresight_find_out_connection(struct coresight_device *csdev, return ERR_PTR(-ENODEV); } -static inline u32 coresight_read_claim_tags(struct csdev_access *csa) +static u32 coresight_read_claim_tags(struct csdev_access *csa) { return FIELD_GET(CORESIGHT_CLAIM_MASK, csdev_access_relaxed_read32(csa, CORESIGHT_CLAIMCLR)); } -static inline void coresight_set_self_claim_tag(struct csdev_access *csa) +static void coresight_set_self_claim_tag(struct csdev_access *csa) { csdev_access_relaxed_write32(csa, CORESIGHT_CLAIM_SELF_HOSTED, CORESIGHT_CLAIMSET); isb(); } -static inline void coresight_clear_self_claim_tag(struct csdev_access *csa) +static void coresight_clear_self_claim_tag(struct csdev_access *csa) { csdev_access_relaxed_write32(csa, CORESIGHT_CLAIM_SELF_HOSTED, CORESIGHT_CLAIMCLR); @@ -610,7 +610,7 @@ struct coresight_device *coresight_get_sink_by_id(u32 id) * Return true in successful case and power up the device. * Return false when failed to get reference of module. */ -static inline bool coresight_get_ref(struct coresight_device *csdev) +static bool coresight_get_ref(struct coresight_device *csdev) { struct device *dev = csdev->dev.parent; @@ -629,7 +629,7 @@ static inline bool coresight_get_ref(struct coresight_device *csdev) * * @csdev: The coresight device to decrement a reference from. */ -static inline void coresight_put_ref(struct coresight_device *csdev) +static void coresight_put_ref(struct coresight_device *csdev) { struct device *dev = csdev->dev.parent; @@ -808,7 +808,7 @@ void coresight_release_path(struct list_head *path) } /* return true if the device is a suitable type for a default sink */ -static inline bool coresight_is_def_sink_type(struct coresight_device *csdev) +static bool coresight_is_def_sink_type(struct coresight_device *csdev) { /* sink & correct subtype */ if (((csdev->type == CORESIGHT_DEV_TYPE_SINK) || @@ -1362,8 +1362,8 @@ EXPORT_SYMBOL_GPL(coresight_unregister); * * Returns the index of the entry, when found. Otherwise, -ENOENT. */ -static inline int coresight_search_device_idx(struct coresight_dev_list *dict, - struct fwnode_handle *fwnode) +static int coresight_search_device_idx(struct coresight_dev_list *dict, + struct fwnode_handle *fwnode) { int i; diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index b598b2c0c9bb..de6d3a6fb828 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -95,7 +95,7 @@ struct etb_drvdata { static int etb_set_buffer(struct coresight_device *csdev, struct perf_output_handle *handle); -static inline unsigned int etb_get_buffer_depth(struct etb_drvdata *drvdata) +static unsigned int etb_get_buffer_depth(struct etb_drvdata *drvdata) { return readl_relaxed(drvdata->base + ETB_RAM_DEPTH_REG); } diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 3609bb74c4ec..9e7d423c1ae9 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -84,7 +84,7 @@ static int etm4_probe_cpu(unsigned int cpu); * TRCIDR4.NUMPC > 0b0000 . * TRCSSCSR.PC == 0b1 */ -static inline bool etm4x_sspcicrn_present(struct etmv4_drvdata *drvdata, int n) +static bool etm4x_sspcicrn_present(struct etmv4_drvdata *drvdata, int n) { return (n < drvdata->nr_ss_cmp) && drvdata->nr_pe && @@ -185,7 +185,7 @@ static void etm_write_os_lock(struct etmv4_drvdata *drvdata, isb(); } -static inline void etm4_os_unlock_csa(struct etmv4_drvdata *drvdata, +static void etm4_os_unlock_csa(struct etmv4_drvdata *drvdata, struct csdev_access *csa) { WARN_ON(drvdata->cpu != smp_processor_id()); @@ -1035,7 +1035,7 @@ static const struct coresight_ops etm4_cs_ops = { .source_ops = &etm4_source_ops, }; -static inline bool cpu_supports_sysreg_trace(void) +static bool cpu_supports_sysreg_trace(void) { u64 dfr0 = read_sysreg_s(SYS_ID_AA64DFR0_EL1); @@ -1343,7 +1343,7 @@ static void etm4_init_arch_data(void *info) cpu_detect_trace_filtering(drvdata); } -static inline u32 etm4_get_victlr_access_type(struct etmv4_config *config) +static u32 etm4_get_victlr_access_type(struct etmv4_config *config) { return etm4_get_access_type(config) << __bf_shf(TRCVICTLR_EXLEVEL_MASK); } diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index a9f19629f3f8..0465c32f7ed4 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -2440,7 +2440,7 @@ static u32 etmv4_cross_read(const struct etmv4_drvdata *drvdata, u32 offset) return reg.data; } -static inline u32 coresight_etm4x_attr_to_offset(struct device_attribute *attr) +static u32 coresight_etm4x_attr_to_offset(struct device_attribute *attr) { struct dev_ext_attribute *eattr; @@ -2464,7 +2464,7 @@ static ssize_t coresight_etm4x_reg_show(struct device *dev, return scnprintf(buf, PAGE_SIZE, "0x%x\n", val); } -static inline bool +static bool etm4x_register_implemented(struct etmv4_drvdata *drvdata, u32 offset) { switch (offset) { diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index 8192ba3279f0..0db64c5f4995 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -139,7 +139,7 @@ coresight_find_csdev_by_fwnode(struct fwnode_handle *r_fwnode) EXPORT_SYMBOL_GPL(coresight_find_csdev_by_fwnode); #ifdef CONFIG_OF -static inline bool of_coresight_legacy_ep_is_input(struct device_node *ep) +static bool of_coresight_legacy_ep_is_input(struct device_node *ep) { return of_property_read_bool(ep, "slave-mode"); } @@ -159,7 +159,7 @@ static struct device_node *of_coresight_get_port_parent(struct device_node *ep) return parent; } -static inline struct device_node * +static struct device_node * of_coresight_get_output_ports_node(const struct device_node *node) { return of_get_child_by_name(node, "out-ports"); @@ -327,14 +327,14 @@ static int of_get_coresight_platform_data(struct device *dev, return 0; } #else -static inline int +static int of_get_coresight_platform_data(struct device *dev, struct coresight_platform_data *pdata) { return -ENOENT; } -static inline int of_coresight_get_cpu(struct device *dev) +static int of_coresight_get_cpu(struct device *dev) { return -ENODEV; } @@ -356,7 +356,7 @@ static const guid_t coresight_graph_uuid = GUID_INIT(0x3ecbc8b6, 0x1d0e, 0x4fb3, #define ACPI_CORESIGHT_LINK_SLAVE 0 #define ACPI_CORESIGHT_LINK_MASTER 1 -static inline bool is_acpi_guid(const union acpi_object *obj) +static bool is_acpi_guid(const union acpi_object *obj) { return (obj->type == ACPI_TYPE_BUFFER) && (obj->buffer.length == 16); } @@ -365,24 +365,24 @@ static inline bool is_acpi_guid(const union acpi_object *obj) * acpi_guid_matches - Checks if the given object is a GUID object and * that it matches the supplied the GUID. */ -static inline bool acpi_guid_matches(const union acpi_object *obj, +static bool acpi_guid_matches(const union acpi_object *obj, const guid_t *guid) { return is_acpi_guid(obj) && guid_equal((guid_t *)obj->buffer.pointer, guid); } -static inline bool is_acpi_dsd_graph_guid(const union acpi_object *obj) +static bool is_acpi_dsd_graph_guid(const union acpi_object *obj) { return acpi_guid_matches(obj, &acpi_graph_uuid); } -static inline bool is_acpi_coresight_graph_guid(const union acpi_object *obj) +static bool is_acpi_coresight_graph_guid(const union acpi_object *obj) { return acpi_guid_matches(obj, &coresight_graph_uuid); } -static inline bool is_acpi_coresight_graph(const union acpi_object *obj) +static bool is_acpi_coresight_graph(const union acpi_object *obj) { const union acpi_object *graphid, *guid, *links; @@ -469,7 +469,7 @@ static inline bool is_acpi_coresight_graph(const union acpi_object *obj) * }, // End of ACPI Graph Property * }) */ -static inline bool acpi_validate_dsd_graph(const union acpi_object *graph) +static bool acpi_validate_dsd_graph(const union acpi_object *graph) { int i, n; const union acpi_object *rev, *nr_graphs; @@ -553,7 +553,7 @@ acpi_get_dsd_graph(struct acpi_device *adev, struct acpi_buffer *buf) return NULL; } -static inline bool +static bool acpi_validate_coresight_graph(const union acpi_object *cs_graph) { int nlinks; @@ -794,14 +794,14 @@ acpi_get_coresight_platform_data(struct device *dev, #else -static inline int +static int acpi_get_coresight_platform_data(struct device *dev, struct coresight_platform_data *pdata) { return -ENOENT; } -static inline int acpi_coresight_get_cpu(struct device *dev) +static int acpi_coresight_get_cpu(struct device *dev) { return -ENODEV; } diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index 679a36effbe8..9f27374f1310 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -63,7 +63,7 @@ static void dynamic_replicator_reset(struct replicator_drvdata *drvdata) /* * replicator_reset : Reset the replicator configuration to sane values. */ -static inline void replicator_reset(struct replicator_drvdata *drvdata) +static void replicator_reset(struct replicator_drvdata *drvdata) { if (drvdata->base) dynamic_replicator_reset(drvdata); diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index b581a30a1cd9..5decc87d1fba 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -290,7 +290,7 @@ static const struct coresight_ops stm_cs_ops = { .source_ops = &stm_source_ops, }; -static inline bool stm_addr_unaligned(const void *addr, u8 write_bytes) +static bool stm_addr_unaligned(const void *addr, u8 write_bytes) { return ((unsigned long)addr & (write_bytes - 1)); } @@ -674,7 +674,7 @@ static int of_stm_get_stimulus_area(struct device *dev, struct resource *res) return of_address_to_resource(np, index, res); } #else -static inline int of_stm_get_stimulus_area(struct device *dev, +static int of_stm_get_stimulus_area(struct device *dev, struct resource *res) { return -ENOENT; @@ -718,7 +718,7 @@ static int acpi_stm_get_stimulus_area(struct device *dev, struct resource *res) return rc; } #else -static inline int acpi_stm_get_stimulus_area(struct device *dev, +static int acpi_stm_get_stimulus_area(struct device *dev, struct resource *res) { return -ENOENT; diff --git a/drivers/hwtracing/coresight/coresight-syscfg-configfs.c b/drivers/hwtracing/coresight/coresight-syscfg-configfs.c index 213b4159b062..2b40e556be87 100644 --- a/drivers/hwtracing/coresight/coresight-syscfg-configfs.c +++ b/drivers/hwtracing/coresight/coresight-syscfg-configfs.c @@ -10,7 +10,7 @@ #include "coresight-syscfg-configfs.h" /* create a default ci_type. */ -static inline struct config_item_type *cscfg_create_ci_type(void) +static struct config_item_type *cscfg_create_ci_type(void) { struct config_item_type *ci_type; diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c index 5ac4e3c706ac..2e3354b5c5c7 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -164,8 +164,8 @@ static int tmc_open(struct inode *inode, struct file *file) return 0; } -static inline ssize_t tmc_get_sysfs_trace(struct tmc_drvdata *drvdata, - loff_t pos, size_t len, char **bufpp) +static ssize_t tmc_get_sysfs_trace(struct tmc_drvdata *drvdata, loff_t pos, size_t len, + char **bufpp) { switch (drvdata->config_type) { case TMC_CONFIG_TYPE_ETB: @@ -359,7 +359,7 @@ static const struct attribute_group *coresight_etr_groups[] = { NULL, }; -static inline bool tmc_etr_can_use_sg(struct device *dev) +static bool tmc_etr_can_use_sg(struct device *dev) { int ret; u8 val_u8; @@ -389,7 +389,7 @@ static inline bool tmc_etr_can_use_sg(struct device *dev) return false; } -static inline bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata) +static bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata) { u32 auth = readl_relaxed(drvdata->base + TMC_AUTHSTATUS); diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 7ba4f79191de..0d4e3af0d4b5 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -124,7 +124,7 @@ struct etr_sg_table { * If we spill over to a new page for mapping 1 entry, we could as * well replace the link entry of the previous page with the last entry. */ -static inline unsigned long __attribute_const__ +static unsigned long __attribute_const__ tmc_etr_sg_table_entries(int nr_pages) { unsigned long nr_sgpages = nr_pages * ETR_SG_PAGES_PER_SYSPAGE; @@ -238,13 +238,13 @@ static int tmc_pages_alloc(struct tmc_pages *tmc_pages, return -ENOMEM; } -static inline long +static long tmc_sg_get_data_page_offset(struct tmc_sg_table *sg_table, dma_addr_t addr) { return tmc_pages_get_offset(&sg_table->data_pages, addr); } -static inline void tmc_free_table_pages(struct tmc_sg_table *sg_table) +static void tmc_free_table_pages(struct tmc_sg_table *sg_table) { if (sg_table->table_vaddr) vunmap(sg_table->table_vaddr); @@ -480,7 +480,7 @@ static void tmc_etr_sg_table_dump(struct etr_sg_table *etr_table) dev_dbg(sg_table->dev, "******* End of Table *****\n"); } #else -static inline void tmc_etr_sg_table_dump(struct etr_sg_table *etr_table) {} +static void tmc_etr_sg_table_dump(struct etr_sg_table *etr_table) {} #endif /* @@ -815,10 +815,8 @@ void tmc_etr_remove_catu_ops(void) } EXPORT_SYMBOL_GPL(tmc_etr_remove_catu_ops); -static inline int tmc_etr_mode_alloc_buf(int mode, - struct tmc_drvdata *drvdata, - struct etr_buf *etr_buf, int node, - void **pages) +static int tmc_etr_mode_alloc_buf(int mode, struct tmc_drvdata *drvdata, struct etr_buf *etr_buf, + int node, void **pages) { int rc = -EINVAL; @@ -936,7 +934,7 @@ static ssize_t tmc_etr_buf_get_data(struct etr_buf *etr_buf, return etr_buf->ops->get_data(etr_buf, (u64)offset, len, bufpp); } -static inline s64 +static s64 tmc_etr_buf_insert_barrier_packet(struct etr_buf *etr_buf, u64 offset) { ssize_t len; diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c index 919804b12a67..e9a19ef52359 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -159,22 +159,22 @@ static void trbe_check_errata(struct trbe_cpudata *cpudata) } } -static inline bool trbe_has_erratum(struct trbe_cpudata *cpudata, int i) +static bool trbe_has_erratum(struct trbe_cpudata *cpudata, int i) { return (i < TRBE_ERRATA_MAX) && test_bit(i, cpudata->errata); } -static inline bool trbe_may_overwrite_in_fill_mode(struct trbe_cpudata *cpudata) +static bool trbe_may_overwrite_in_fill_mode(struct trbe_cpudata *cpudata) { return trbe_has_erratum(cpudata, TRBE_WORKAROUND_OVERWRITE_FILL_MODE); } -static inline bool trbe_may_write_out_of_range(struct trbe_cpudata *cpudata) +static bool trbe_may_write_out_of_range(struct trbe_cpudata *cpudata) { return trbe_has_erratum(cpudata, TRBE_WORKAROUND_WRITE_OUT_OF_RANGE); } -static inline bool trbe_needs_drain_after_disable(struct trbe_cpudata *cpudata) +static bool trbe_needs_drain_after_disable(struct trbe_cpudata *cpudata) { /* * Errata affected TRBE implementation will need TSB CSYNC and @@ -184,7 +184,7 @@ static inline bool trbe_needs_drain_after_disable(struct trbe_cpudata *cpudata) return trbe_has_erratum(cpudata, TRBE_NEEDS_DRAIN_AFTER_DISABLE); } -static inline bool trbe_needs_ctxt_sync_after_enable(struct trbe_cpudata *cpudata) +static bool trbe_needs_ctxt_sync_after_enable(struct trbe_cpudata *cpudata) { /* * Errata affected TRBE implementation will need an additional @@ -195,7 +195,7 @@ static inline bool trbe_needs_ctxt_sync_after_enable(struct trbe_cpudata *cpudat return trbe_has_erratum(cpudata, TRBE_NEEDS_CTXT_SYNC_AFTER_ENABLE); } -static inline bool trbe_is_broken(struct trbe_cpudata *cpudata) +static bool trbe_is_broken(struct trbe_cpudata *cpudata) { return trbe_has_erratum(cpudata, TRBE_IS_BROKEN); } @@ -207,13 +207,13 @@ static int trbe_alloc_node(struct perf_event *event) return cpu_to_node(event->cpu); } -static inline void trbe_drain_buffer(void) +static void trbe_drain_buffer(void) { tsb_csync(); dsb(nsh); } -static inline void set_trbe_enabled(struct trbe_cpudata *cpudata, u64 trblimitr) +static void set_trbe_enabled(struct trbe_cpudata *cpudata, u64 trblimitr) { /* * Enable the TRBE without clearing LIMITPTR which @@ -229,7 +229,7 @@ static inline void set_trbe_enabled(struct trbe_cpudata *cpudata, u64 trblimitr) isb(); } -static inline void set_trbe_disabled(struct trbe_cpudata *cpudata) +static void set_trbe_disabled(struct trbe_cpudata *cpudata) { u64 trblimitr = read_sysreg_s(SYS_TRBLIMITR_EL1); From patchwork Tue Feb 11 10:39:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13970030 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 234D1C021A5 for ; Tue, 11 Feb 2025 10:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FLT+7yARFu+ZZe2jU+yKN61UJYeQ0L2gWO4wNTXz1Ac=; b=jj/upFCZC6CT+aFtoKVDlc2ZWp 1NqFuHZWsbdjaa6xHngGFQOb3vKKabE7CQhUM92q3UqlWHgaDCK35cBAiK+j0izpYUVE2IjwC7rkC Uv+XXUamPF/o90FXcnpntvL5vXiNmms4m7MiXRswaJKl4Z7Sw8Cb056YSDwsijWC9FMRm8YYErU7Y 5Bs/+Hk8p9Dz4IpjUPRTyApHRT111s+m0hZYw03UYMcJv2fx6jw4tVMqmGmTO1JQk2mOp52SlibRh Nsg3Jn0T6m8QwV6LzV+QHUbnY4x9/nmHPwvlPyL2RKYGH131SjNf7S+KB5rrDjlKpELBrW5QPAdXt iqV1zz0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thnvj-00000003R8V-3A8d; Tue, 11 Feb 2025 10:55:51 +0000 Received: from mail-wm1-f52.google.com ([209.85.128.52]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thnhC-00000003O0M-0uI6 for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2025 10:40:51 +0000 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso37013355e9.3 for ; Tue, 11 Feb 2025 02:40:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739270448; x=1739875248; 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=FLT+7yARFu+ZZe2jU+yKN61UJYeQ0L2gWO4wNTXz1Ac=; b=PGIl4ioaWMtnFzruSmqNN00L+/8FzW+7sTaxOF9UtY6XEFRIPLSjOuq5noCiQuAHRP xjfJ6YOqHDZD4Zqe0N34Il8GfEsXXKvFjAYgr8ACgjLBFngn/GKKT7P2JE2prHSnff6F W1Za6LIG7RP3ITFgl5+QevylJMEPFv5MtY6nzvTVwemXp2ExtpBb7vEJDSFH5gknZdy0 Be8Am+A8xAaYVpaYDPUnyeClUbfi8e/ngrhdo4io0z57EO0mlkZB33Btdw4zl8ZO7jNf Q/+3NgxVspxzXxU7rQGm9O9kuzdf6Xc5te1HzsWc0HwAbHuGzEfhDwayRQsnfK4bMx/H UW7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739270448; x=1739875248; 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=FLT+7yARFu+ZZe2jU+yKN61UJYeQ0L2gWO4wNTXz1Ac=; b=Lcwonu7oApijU1kf2A5iT7jbJZjCs9AxZUrJBJDt0KsX9YyK5gzp+bS5RlgD/ywx0N wpRMKMCoYebid4uMK1m3nmVWiCgIzwYKgW5xUh+2eU0N4oZAVhH1AeexwoRSmkBkCgzA rPmOklfwuYlUbAoYTjAbUrvL/LocMvFfYVt7Etz54rGH9gNbvZuNMtR1a1kz6s1+tk7l l+4tORFPSzgzkrep0V/YP0e8ujkUQuq+vdrriJi3ILW4p5ZjRQTJxoEVicJXq2166g2h vAo7MU5Tl5bcgEm5VuUT2EP+8O60vt4yY9q+Br0IJSlrXtlTeLYqSRDcwhrjswDL8j2c FzRw== X-Forwarded-Encrypted: i=1; AJvYcCWrWGqinpkFtl7y545l4s1uru+zC0xXOXiW6mK/V37UznSd4hAxmYYJuQJbviI4qPU9mfWEgsaSTDxwXDroJBA7@lists.infradead.org X-Gm-Message-State: AOJu0Yx29lchIovGuz8CJo5fR6gEsKtF5Fva69apI2xmDhaD/EpDgtAh wGEQGHZZ3e1Qz05wV8pvjoQo5ZtUu3X6DFb8a8PTIA0vx4YIS4xjsTQL21y/s0k= X-Gm-Gg: ASbGnctEC6UBN5vCxbmgt2E3ySgUA8vVmOG0H0IZHy3EORepsQM1GklyLLQZWILXHJ4 epzsI9EHcVs4ZwlXYGsllBiapqU9EQv27LpOmAyF7HrgFXb5b8zYjFhAC1zPune3MG/fupN6jPA EzKHWoshCxQUk4amkX7cb7YdbHNJF8mBK3eyDTS18csMrjm8h+89AEJyliaTrFgiRUZNTW3KHKn xuEEgpaz0woLvoM0PztOf56hnkIzb5H59cBmgQZ6Ot2FQjtYJrGylYiQBQMmkjVZbJAJLgGTEvw /RHAnUImTIwA X-Google-Smtp-Source: AGHT+IGy0JfOP/A4JgJKJRQpoAKt5qMwRlzYsOwuh7SYJBs/gpNnWiLYzgaWj+n9Q0QUYJ0DnLVjhw== X-Received: by 2002:a5d:6da1:0:b0:38d:d946:db15 with SMTP id ffacd0b85a97d-38dd946de79mr6670134f8f.5.1739270448056; Tue, 11 Feb 2025 02:40:48 -0800 (PST) Received: from pop-os.. ([145.224.65.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd02e2a90sm10456047f8f.98.2025.02.11.02.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 02:40:47 -0800 (PST) From: James Clark To: lcherian@marvell.com, coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 7/7] coresight: Remove extern from function declarations Date: Tue, 11 Feb 2025 10:39:43 +0000 Message-Id: <20250211103945.967495-8-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211103945.967495-1-james.clark@linaro.org> References: <20250211103945.967495-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250211_024050_252160_EA39EC7C X-CRM114-Status: GOOD ( 11.91 ) 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 Function declarations are extern by default so remove the extra noise and inconsistency. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-priv.h | 14 ++++----- include/linux/coresight.h | 33 +++++++++----------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index a83113225797..e09071a720f0 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -57,10 +57,8 @@ struct cs_off_attribute { u32 off; }; -extern ssize_t coresight_simple_show32(struct device *_dev, - struct device_attribute *attr, char *buf); -extern ssize_t coresight_simple_show_pair(struct device *_dev, - struct device_attribute *attr, char *buf); +ssize_t coresight_simple_show32(struct device *_dev, struct device_attribute *attr, char *buf); +ssize_t coresight_simple_show_pair(struct device *_dev, struct device_attribute *attr, char *buf); #define coresight_simple_reg32(name, offset) \ (&((struct cs_off_attribute[]) { \ @@ -155,8 +153,8 @@ void coresight_remove_links(struct coresight_device *orig, u32 coresight_get_sink_id(struct coresight_device *csdev); #if IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM3X) -extern int etm_readl_cp14(u32 off, unsigned int *val); -extern int etm_writel_cp14(u32 off, u32 val); +int etm_readl_cp14(u32 off, unsigned int *val); +int etm_writel_cp14(u32 off, u32 val); #else static inline int etm_readl_cp14(u32 off, unsigned int *val) { return 0; } static inline int etm_writel_cp14(u32 off, u32 val) { return 0; } @@ -167,8 +165,8 @@ struct cti_assoc_op { void (*remove)(struct coresight_device *csdev); }; -extern void coresight_set_cti_ops(const struct cti_assoc_op *cti_op); -extern void coresight_remove_cti_ops(void); +void coresight_set_cti_ops(const struct cti_assoc_op *cti_op); +void coresight_remove_cti_ops(void); /* * Macros and inline functions to handle CoreSight UCI data and driver diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 11808aee9d1d..2b43698c0b25 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -642,26 +642,23 @@ static inline void coresight_set_mode(struct coresight_device *csdev, local_set(&csdev->mode, new_mode); } -extern struct coresight_device * -coresight_register(struct coresight_desc *desc); -extern void coresight_unregister(struct coresight_device *csdev); -extern int coresight_enable_sysfs(struct coresight_device *csdev); -extern void coresight_disable_sysfs(struct coresight_device *csdev); -extern int coresight_timeout(struct csdev_access *csa, u32 offset, - int position, int value); - -extern int coresight_claim_device(struct coresight_device *csdev); -extern int coresight_claim_device_unlocked(struct coresight_device *csdev); - -extern void coresight_disclaim_device(struct csdev_access *csa); -extern void coresight_disclaim_device_unlocked(struct csdev_access *csa); +struct coresight_device *coresight_register(struct coresight_desc *desc); +void coresight_unregister(struct coresight_device *csdev); +int coresight_enable_sysfs(struct coresight_device *csdev); +void coresight_disable_sysfs(struct coresight_device *csdev); +int coresight_timeout(struct csdev_access *csa, u32 offset, int position, int value); + +int coresight_claim_device(struct coresight_device *csdev); +int coresight_claim_device_unlocked(struct coresight_device *csdev); + +void coresight_disclaim_device(struct csdev_access *csa); +void coresight_disclaim_device_unlocked(struct csdev_access *csa); int coresight_reset_claim_unlocked(struct csdev_access *csa); int coresight_reset_claim(struct csdev_access *csa); -extern char *coresight_alloc_device_name(struct coresight_dev_list *devs, - struct device *dev); +char *coresight_alloc_device_name(struct coresight_dev_list *devs, struct device *dev); -extern bool coresight_loses_context_with_cpu(struct device *dev); +bool coresight_loses_context_with_cpu(struct device *dev); u32 coresight_relaxed_read32(struct coresight_device *csdev, u32 offset); u32 coresight_read32(struct coresight_device *csdev, u32 offset); @@ -674,8 +671,8 @@ void coresight_relaxed_write64(struct coresight_device *csdev, u64 val, u32 offset); void coresight_write64(struct coresight_device *csdev, u64 val, u32 offset); -extern int coresight_get_cpu(struct device *dev); -extern int coresight_get_static_trace_id(struct device *dev, u32 *id); +int coresight_get_cpu(struct device *dev); +int coresight_get_static_trace_id(struct device *dev, u32 *id); struct coresight_platform_data *coresight_get_platform_data(struct device *dev); struct coresight_connection *