From patchwork Thu Jul 16 17:57:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668221 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 73692913 for ; Thu, 16 Jul 2020 17:59:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 482A1205CB for ; Thu, 16 Jul 2020 17:59:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xtGebvqC"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GmCJWH1X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 482A1205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AKpHuQ5zhVOpCjpH/3ZdnnkK6c4iV9FRBUyCAb/kuYk=; b=xtGebvqCODRvk+mgHpUMg01JZ zmckBUU3y2G1GtcMFcJBgbhMAfIVr/Q4jdOoK+qOwJZOWGDkxfeWY8m/tCUaM1LRSRaVpTizRIqFG tDcVsFbL2TSmiJ7OHbeGV5Dld0klYOcwxJm0xKPZ6xdtjHz/CkPYi7PIX9YnKG1tONZWpOXm1KR/P XNKCzrDpkblQRj/R+DTlpfammGntWldSHR6wUlKhyYwA6C3MFHSwPS/q4frj9TBGienPwyq7sTMqT 4dvkrxwkDkfbfxMsDcU8D6tYwjUbxJ6saOMWf7eTH0Ei54HJBViWcek+woZRKEoKIeZSbQXBjm1uC WIzfsLyrg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88t-0003Dk-Bz; Thu, 16 Jul 2020 17:57:59 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88l-0003Af-Fl for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:57:52 +0000 Received: by mail-pl1-x643.google.com with SMTP id t6so4192966plo.3 for ; Thu, 16 Jul 2020 10:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hS53mE0Vv7croCiD5u+mcHlgXOwL7wOyDKsRaFLtYpo=; b=GmCJWH1XL5w53PpJcehXecLm0QathMlrMoCWRzAHuruUnPZ77amJFA94/UO7IYqh/P qVqQUdElT7iRLQjK3kkX/4TLKy//7rHCtHKo4Tdz3hKBo8JwYCED/WrxhdrBpAjFBeS0 2iMuEbyFObTZC3yLaby6G4s1rdu+hoBSfllm0UUsOPZZEF8frhfFoT5uaWOxCI/xf70G TuPdy7eNKrnGWcHzj4SnRUU+JyyZ+zrXacnQao58wWQQGdh9ok/8JvK3sL3y+xsU11Bk G4Pd3aT4yMgQa8nUx6bE4XtznB43Kqr5T+uBlq0GK/huVI+5dqYuHrneMRnkwc23rGL/ cfEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hS53mE0Vv7croCiD5u+mcHlgXOwL7wOyDKsRaFLtYpo=; b=ASe89x2mlURTjR3P/7uWeDQnf1A8649O2S0GfLZgxSPWz9ZAbq0gDOzJSoe5TrSsx/ v7zwWsvLK7KJetc3rXUFKCBICki7iMJoQ8xm/gSA/LCCrfdMovVole+qK5asgfWQ3FUY CYiqLsWfXoKA3gTUwOjGEtPz4hYWDZNCJNRXopyEv39TxER16xU0UHWgwRZjWhq1gRqi UTzQpE+jKJDkXfGECRieHJCzIjkSdhvmitT+wrrGKEPa9dHkW9aYXV1HjkhOupd1UNCM +DKl50EEooErOWF+cKjInt2wkE/h65cjgN/tmylhbxJi+J3iPHMvfxrfoGT8eEimQ9Bt iCMw== X-Gm-Message-State: AOAM533RoGw9JQ947A99+qnTsx2XDC/LEB3znGwLp83KmNc2qubUSDb1 sLNFgmSDV0MjpnehfbiX3Nzkmg== X-Google-Smtp-Source: ABdhPJxNdsAbb9QlCozs0FIq0Ut+cTGS94o3oSBgcrvY3xbukRQaKRsDVuiHVPiCYxScljvY4CbhQQ== X-Received: by 2002:a17:90b:19c5:: with SMTP id nm5mr6092893pjb.155.1594922269412; Thu, 16 Jul 2020 10:57:49 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:48 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 01/17] coresight: replicator: Use CS_AMBA_ID macro for id table Date: Thu, 16 Jul 2020 11:57:30 -0600 Message-Id: <20200716175746.3338735-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135751_559538_0BEFE77E X-CRM114-Status: GOOD ( 10.68 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sai Prakash Ranjan Use CS_AMBA_ID macro for dynamic replicator AMBA id table instead of open coding. Signed-off-by: Sai Prakash Ranjan Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-replicator.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index e7dc1c31d20d..c619b456f55a 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -348,16 +348,9 @@ static int dynamic_replicator_probe(struct amba_device *adev, } static const struct amba_id dynamic_replicator_ids[] = { - { - .id = 0x000bb909, - .mask = 0x000fffff, - }, - { - /* Coresight SoC-600 */ - .id = 0x000bb9ec, - .mask = 0x000fffff, - }, - { 0, 0 }, + CS_AMBA_ID(0x000bb909), + CS_AMBA_ID(0x000bb9ec), /* Coresight SoC-600 */ + {}, }; static struct amba_driver dynamic_replicator_driver = { From patchwork Thu Jul 16 17:57:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668223 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 156956C1 for ; Thu, 16 Jul 2020 17:59:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBE32205CB for ; Thu, 16 Jul 2020 17:59:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3kiu7Lcx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hQSsfuhp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBE32205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n+g7C7zL3yMYuz2f75eZyLVJnsF0TZ1HwfeyTA5uKR0=; b=3kiu7LcxHEhdqWzSqIuHgWvIc Mf+p+4H++Wo2q4Ab78zL/qsPLNd0cod9dkQR9+OzQb4x/rUwUJVGgHN/tarc8vQ3ATV52pYAySUzB 7v6W1NrpeoHfQpooljg5Zx277/6JZwFSOmQvrtL9PMEdW5koTCPQ/8m7DxSlDIcrj/88He+L7LAOc mewxlP1+9Bv8Bw74+Q9O9SLAQC2YOZVemPoyDNpiTQ1TPF2OljVRi+MOZY+qqNhPZ6WBBzfABIDK8 X3s/BWY6PPzSLKwtZgtn5cRztdHpyOb2cD+yGLX2mAKUxSj5AW+3rjzvpfQgcXbf3dcVt+ga/6lET f3nmz1H6g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw892-0003HP-VM; Thu, 16 Jul 2020 17:58:09 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88m-0003Az-9G for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:57:53 +0000 Received: by mail-pf1-x441.google.com with SMTP id j20so4036997pfe.5 for ; Thu, 16 Jul 2020 10:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QIJMPlAtev0fULGbL/QU+8g9x861FDOFqL00/Bq3uts=; b=hQSsfuhplWqPTXiswra9tSpT8ju7DwJwENZt/dOv8slvEfVnqY0nFZL+GwdEA2yr9Q xL3MIwHT4w8jmvICWPZnInj69n5FULou3YosjhBnK3JuE2VN3Txwaddt80iaRFL/R8ZW F2zIYvv0WZiKJfQiDG9C9ekCPiitzrjcc1w+55/UT1s+9TkpEQnQP1Xt4cJbnAk1xFHg 07pmNMdvjtShBWV2ezzI0IHOcXbkUSp75rlgKjBbM39YacYnoDssBDRivkpTvswV+dme lFZzpzI0dyF8rzfZOOOqHAhDDWsnZFo87shMaDjsko3uSaZZ3FZBoNOGTXs4UJsWEoIO tZKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QIJMPlAtev0fULGbL/QU+8g9x861FDOFqL00/Bq3uts=; b=eo3OwRbmqke3I+a6kwrLmPqlNijPcZOdr4r1eTFNDhYVdhwEkgvuhoHJFrmo+UnEuj PCx+61vnfS6TZP6TBvvZkGs/Z7StgKhY+mCLLUP5xoTAM45y5LtQitY3P3Zuw1NEfuiL 31tHBRA0rtNMwFnWW/0kjWFYIUfysGitWO/pFmeWZMQSCE9ZZneGW/kqgoIdgQEVcgaf NJx4nchA8cgTiDn8YYnj7TMX7nF6I1TUoGg+/XvxotAysJVkRszxcQrh3IxT5JOLUigi zv2ohgKQnAlu3yWc+E0ALsIqTeGKKrPWLHngtTVXz8CwQ9YuhgNWLVtZNIiKvMp2JVdC AlhA== X-Gm-Message-State: AOAM532Y6dwyBOqB2WdlrlwwTuT1piACtHND/KTwRTcQRWHRavNRxL7r WIlAtrfsSLGEXV+4sZ6H0OMjXg== X-Google-Smtp-Source: ABdhPJzy2mFQxFlx+jY44z7apVSeYKJmKglfu31Ow5KUZ+F/HiDBpC9/HBJKih4IRH46r9/eTUByuw== X-Received: by 2002:a63:4b1d:: with SMTP id y29mr5382546pga.264.1594922270551; Thu, 16 Jul 2020 10:57:50 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:50 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 02/17] coresight: catu: Use CS_AMBA_ID macro for id table Date: Thu, 16 Jul 2020 11:57:31 -0600 Message-Id: <20200716175746.3338735-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135752_394260_70809CC4 X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sai Prakash Ranjan Use CS_AMBA_ID macro for coresight catu AMBA id table instead of open coding. Signed-off-by: Sai Prakash Ranjan Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-catu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index 16ebf38a9f66..1801804a7762 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -568,10 +568,7 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id) } static struct amba_id catu_ids[] = { - { - .id = 0x000bb9ee, - .mask = 0x000fffff, - }, + CS_AMBA_ID(0x000bb9ee), {}, }; From patchwork Thu Jul 16 17:57:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668227 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9B676C1 for ; Thu, 16 Jul 2020 17:59:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B931B2070E for ; Thu, 16 Jul 2020 17:59:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2VPd8hvZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yjwxZ6UU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B931B2070E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bcZRSq6RN9+Df9IjlxgMzU9eAAJl1/swY8Puvk9yuk4=; b=2VPd8hvZMkl4D4U0BNjPeko3J JPDN3Jslf9kro2KeWwF60bVUs6yLWMCO0BXO9BUdM+e6o0Fp+C5gyoCEgHwC9Q2VvXDo+bCJvy20Q +2DBAPgD35dBDNdnbo9g7Wg7uBv0bkQlnXooQdHmKJsXBeeUfAsFc5COtIGUYTyOLTAVS1CpNTiR0 KpqV6WF8XqY/2qKOv9pfmzDwM4lepwaWALnrI23eHkO/cFld+3Z3IMIRXHe1sCRpM1l9klajr6m6O SRkbkb6R1aZ72KibQa+4BQGU2uMI30EBREu3RdRQ0Q61TKaXSH7uFtupZYp3z8cpv5vf4wLbCJegG YLPKH59yw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw89A-0003LL-QQ; Thu, 16 Jul 2020 17:58:16 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88n-0003Bk-OF for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:57:55 +0000 Received: by mail-pl1-x642.google.com with SMTP id b9so4196002plx.6 for ; Thu, 16 Jul 2020 10:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Ql0KmK96dvPiqRbLM5Bw9OLrn39h71WcEuMmlwtztU=; b=yjwxZ6UUH0o8ssNX/8M1k6CPkS0ZBKcUmlvsLEkFzAewJoHpGilYnKNeJIZcX/Lb8u jdk25rxMRyzeG4jBtBGeElz0c7pEuiXKmigpey2tNOPshQ1uqe8Qmx3i9LHyQYz+RH9s PkC9rNs+XMR199+VwQpRxA3F8GbTcsMlA/4FQm8PGM3iIiER7H70GaB9f930sl11Uz72 yPYshKCggeZ/rAZ+O39bpzQzA+4xrFFznyDojJEPqwWr2CyRlEgRm1I901Z7iLymcAof jr4xA0n/zY5cXq/CU54mSUMGuB3KXAMINsadAGHgBQUQOba2hAydLT3vhluMUYomGuq3 gyIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3Ql0KmK96dvPiqRbLM5Bw9OLrn39h71WcEuMmlwtztU=; b=nWvh7MvfcbBGN/SGB1pGZICK9Oy/GeEUsnLTwlfuq10wYFfGcC6fpCjUeYRjzR46aQ d2LhdqjVHb+PSFGZFaFFpczFUnrmJuNIj8HinSoh5V9MdY7IKZPuALH/XWxwFzZbVNdG ih27GVqkWeRJCHUQEUuLIooop27hspKLF0MXI2mwm0TEXsvklI+qLqtwnnAcDfKpUS2E 9GR/j7nmQzuchooSL4KHOFhJJVbnLI1B7/1gF87eRhRkCX9lhYH/gH/vPxF7NH4L35gX AYJUy6b+AvmmA6DOj+vuv60GndW9p7VZsM9SYFQlsvfmfVZ3o93+emT9t3Anv7it8rlB B8kQ== X-Gm-Message-State: AOAM533z0H3OGMedhYQFy8qd+igdFz6Kb2riwQR5HXP9UmBFaiR6eow6 DSj7ilsIq+gsfUQepg5wXud9XA== X-Google-Smtp-Source: ABdhPJzhol99fFgQHIrdGDLqAS089tJU2cdWbM++HQO2pS/fVCHTHPisB6US1icqGaBffIPndYwUgg== X-Received: by 2002:a17:90a:304d:: with SMTP id q13mr6009872pjl.73.1594922271706; Thu, 16 Jul 2020 10:57:51 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:51 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 03/17] coresight: etm4x: Add support to skip trace unit power up Date: Thu, 16 Jul 2020 11:57:32 -0600 Message-Id: <20200716175746.3338735-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135753_858258_4311856A X-CRM114-Status: GOOD ( 14.65 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tingwei Zhang On some Qualcomm Technologies Inc. SoCs like SC7180, there exists a hardware errata where the APSS (Application Processor SubSystem)/CPU watchdog counter is stopped when the trace unit power up ETM register is set (TRCPDCR.PU = 1). Since the ETMs share the same power domain as that of respective CPU cores, they are powered on when the CPU core is powered on. So we can skip powering up of trace unit after checking for this errata via new property called "qcom,skip-power-up". Signed-off-by: Tingwei Zhang Co-developed-by: Sai Prakash Ranjan Signed-off-by: Sai Prakash Ranjan Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 27 ++++++++++++------- drivers/hwtracing/coresight/coresight-etm4x.h | 3 +++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 0c35cd5e0d1d..2290f41f0074 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -196,12 +196,14 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) writel_relaxed(config->vmid_mask0, drvdata->base + TRCVMIDCCTLR0); writel_relaxed(config->vmid_mask1, drvdata->base + TRCVMIDCCTLR1); - /* - * Request to keep the trace unit powered and also - * emulation of powerdown - */ - writel_relaxed(readl_relaxed(drvdata->base + TRCPDCR) | TRCPDCR_PU, - drvdata->base + TRCPDCR); + if (!drvdata->skip_power_up) { + /* + * Request to keep the trace unit powered and also + * emulation of powerdown + */ + writel_relaxed(readl_relaxed(drvdata->base + TRCPDCR) | + TRCPDCR_PU, drvdata->base + TRCPDCR); + } /* Enable the trace unit */ writel_relaxed(1, drvdata->base + TRCPRGCTLR); @@ -476,10 +478,12 @@ static void etm4_disable_hw(void *info) CS_UNLOCK(drvdata->base); - /* power can be removed from the trace unit now */ - control = readl_relaxed(drvdata->base + TRCPDCR); - control &= ~TRCPDCR_PU; - writel_relaxed(control, drvdata->base + TRCPDCR); + if (!drvdata->skip_power_up) { + /* power can be removed from the trace unit now */ + control = readl_relaxed(drvdata->base + TRCPDCR); + control &= ~TRCPDCR_PU; + writel_relaxed(control, drvdata->base + TRCPDCR); + } control = readl_relaxed(drvdata->base + TRCPRGCTLR); @@ -1468,6 +1472,9 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) return -ENOMEM; } + if (fwnode_property_present(dev_fwnode(dev), "qcom,skip-power-up")) + drvdata->skip_power_up = true; + /* Validity for the resource is already checked by the AMBA core */ base = devm_ioremap_resource(dev, res); if (IS_ERR(base)) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 4a695bf90582..72c9a55e67df 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -407,6 +407,8 @@ struct etmv4_save_state { * @config: structure holding configuration parameters. * @save_state: State to be preserved across power loss * @state_needs_restore: True when there is context to restore after PM exit + * @skip_power_up: Indicates if an implementation can skip powering up + * the trace unit. */ struct etmv4_drvdata { void __iomem *base; @@ -454,6 +456,7 @@ struct etmv4_drvdata { struct etmv4_config config; struct etmv4_save_state *save_state; bool state_needs_restore; + bool skip_power_up; }; /* Address comparator access types */ From patchwork Thu Jul 16 17:57:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668225 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99010913 for ; Thu, 16 Jul 2020 17:59:53 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E3FB205CB for ; Thu, 16 Jul 2020 17:59:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CB5jQMe+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EUx9PAZE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E3FB205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LKXciRyZ/7LfAwJHdEI6FjLE8agx+C/kOhzY0t0CWOg=; b=CB5jQMe+++e1+afab/c6oKFM7 gRfUZRWFohQVVQ0IDc0IEiRtFyDCZwHRVG4hhpQFDKXmrCh2Km9MmFP8ir4wvVpXTn0L7ZY+MySkE HXrmCQODa/Z13Ri6t1/t0NJUxCzrEthj3NSQcyesPwQLtLmdSXW1t0Z44ZwcEr6JqgdPNbNqAfFnE LW1AjqAyh5JTQ7nL7NkXYMybSbkAXAWeLBV9H+wdSi9oGk5CxE9NjtXzwTcu47zmYlFkDN3ZQtjmo GeAb/dHlnA7/VO1mRg6WS/HGWLMZ6eISLI04eNtucPQDA6JsraiTky/0IU7xloy1pnWXb+t2eL2xV 6/wg0Racw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw89F-0003Mq-Kt; Thu, 16 Jul 2020 17:58:21 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88p-0003CN-1k for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:57:56 +0000 Received: by mail-pg1-x542.google.com with SMTP id p3so5228213pgh.3 for ; Thu, 16 Jul 2020 10:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6CUCgECes9PSwzPvxgNDPC8fb6g30vN5Y0CnnZoS0IE=; b=EUx9PAZEvLYDfVMi7lYKwjKzszVB8iZZ6yzhRMpMpYKhkdOYdDA9pNjV7V/1/35IUx Jger4Agh0DOVT66q4+GtNK7HJQIW+7inwS7Q5NnVepWB3qF/XDR24E26orr0mOy7mgFf 5EE/QcaiKAwyyFjAysOqsoxgnI4ZRGSMyp1PrffmAeXGymRxNB+ZB7FxRcBuU/WVyM6b Y/3NdlMv9ljK5kg2nVwS5TMWx06Uu4ZEOf1N79D1AzsPjZ2OQNf6kdITnNnQMHDigGTy Rh990qSmVvEqko8DhVDLcgwoXerR8ERBDinf32wsFzEOGreUlAdOyMVpBap4XXvEu3B2 2vjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6CUCgECes9PSwzPvxgNDPC8fb6g30vN5Y0CnnZoS0IE=; b=SRLJLg9tGmQ6YZfNW44p+mJ3gWuTjiSrs4DUlJSODYsiA91tcE9tzmhUdYwt//lZO1 2of9XShRTmrPOZGtW4lMJZSVbCNV6as2hzx+cDhOnK1aXIhPL3osOjYnwsmItcXmY4+8 Pjna31gIwuJlWGWIKNPpgyhJUGpM4zVXB2sxVMCD8aFCf2kChhvvaBTfzLLi8PJ+6Lgs 8TubdohE0IgvKJ5pVeZpqTjMNmqtT6gm0S3K6n+60lEyFpK5z9wzeXJFUbZbgxxExuMZ Y3krsm7f7JADErWBNtts1uehNS1XERVsJoDYoHgvgjw0Jb+R7W7HUjE6i6/m28dBs4Aw 8zKQ== X-Gm-Message-State: AOAM530fVaIE0MdViSmtyFwHtnns2vp9SN/S5Om8IuUpaMOGEodKLgX1 FwP9Tv/Hgybxw1iNS4lg9RAW3w== X-Google-Smtp-Source: ABdhPJys46c1O0sISsUMZ+cCRL50oiGQ9HteTFN1C6LpeS5cyX737uGtbG/aEqa5lq8zy4Z6PEvYwQ== X-Received: by 2002:a63:6dc1:: with SMTP id i184mr5235745pgc.345.1594922272936; Thu, 16 Jul 2020 10:57:52 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:52 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 04/17] dt-bindings: arm: coresight: Add support to skip trace unit power up Date: Thu, 16 Jul 2020 11:57:33 -0600 Message-Id: <20200716175746.3338735-5-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135755_187486_875CA55D X-CRM114-Status: GOOD ( 10.74 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tingwei Zhang Add "qcom,skip-power-up" property to identify systems which can skip powering up of trace unit since they share the same power domain as their CPU core. This is required to identify such systems with hardware errata which stops the CPU watchdog counter when the power up bit is set (TRCPDCR.PU). Signed-off-by: Tingwei Zhang Co-developed-by: Sai Prakash Ranjan Signed-off-by: Sai Prakash Ranjan Reviewed-by: Rob Herring Signed-off-by: Mathieu Poirier --- Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt index 846f6daae71b..e4b2eda0b53b 100644 --- a/Documentation/devicetree/bindings/arm/coresight.txt +++ b/Documentation/devicetree/bindings/arm/coresight.txt @@ -108,6 +108,13 @@ its hardware characteristcs. * arm,cp14: must be present if the system accesses ETM/PTM management registers via co-processor 14. + * qcom,skip-power-up: boolean. Indicates that an implementation can + skip powering up the trace unit. TRCPDCR.PU does not have to be set + on Qualcomm Technologies Inc. systems since ETMs are in the same power + domain as their CPU cores. This property is required to identify such + systems with hardware errata where the CPU watchdog counter is stopped + when TRCPDCR.PU is set. + * Optional property for TMC: * arm,buffer-size: size of contiguous buffer space for TMC ETR From patchwork Thu Jul 16 17:57:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668231 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B968D913 for ; Thu, 16 Jul 2020 18:00:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CD8C205CB for ; Thu, 16 Jul 2020 18:00:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VW1MqmL7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fRQ/wqfS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CD8C205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LWc1Dug8AMDaMeVtBeNUq+iawaixPO3jDSj9SiCEb+g=; b=VW1MqmL7s6Bv0GvpHWW2YfjMz KdEAW0xU4aGJPjSiGfRgE0RVwJOAThmTtvUlZOQ+gYnjpUHDwD8zrQzrBqUGTAUHIAE3FgTSqjbdE JjDrhkQsClCJYPMZzXOe8DnZtAnuEnaduO5S0ZeW/hVY1zEnMv37VuOqP74Cw6j96cXm2A4uweXRB 69w4Xhq2U/mLyKucly1w5tuZYKT/kb7KheIuaJ1CM6JgXVB5b9Ansjw26ttug5xmvIbO0h+slsj7O 1msIPdQo2U38tfdPdveBo2m1aSPlW7mm4BF4sGLu5qhOLqMECCl5olwc4bP7X0jlygyme7zUCxSOG euq3b6G4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw89K-0003OH-TD; Thu, 16 Jul 2020 17:58:27 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88q-0003Cn-0O for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:57:58 +0000 Received: by mail-pg1-x544.google.com with SMTP id m22so5193266pgv.9 for ; Thu, 16 Jul 2020 10:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2d+sEY43gd12a7QTvlcUY239vONltJOS2Dk8APZEC9Y=; b=fRQ/wqfS8VOEP4J6LgXNcKiEC8tXyn+AhmVIr7BManDGhknpuFG7bq9cElAieDpW9m gg2K0kOLcev5l1nM5jMhOj6Kap+UWYKKe+L7+MM13mvwTK3ymWqpxESMwDbMBo+zf+e2 f7Bpu92ng7kCef8nJiWKEX0yRkk1rEk3KbPit9FGNFJ+MTyOujfebSwBF8ewKQducxH4 e/I220nxKOb2qcWN8eiSkS3RMZvXaTYaham1LrUoF90c7I/e0R/mq1n/+nuJMAgaW89Q KqT4lEOkE91IwLDOWwGX0qy54gsnaRBbcTFbnvA6U6TcXJ2UMVr5fExyNR4/6aijBjlU Y0qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2d+sEY43gd12a7QTvlcUY239vONltJOS2Dk8APZEC9Y=; b=Z4f0wIX3ZMqqz55vzAJtSJV3iCQIw6m1IPEczcO3BQo/ju6fnNJetLm0pvWXvbFIlF yU0RPdoB9sBoXPgrXTzLYJANmSnusuG2GIprXqPIGuJscuXq9rYJ9xylaQnaTueSBhdg BZinM52EG5Gn1VELDwhkQadrY16m2ps22ZhUal5REyGw/Ch6NdaigxE3wePdWao9KBll EDyjSetWi5SNPdc6uqVlVJBuIP6hdjEcKiBK+Bwn6MsEpcR/HLS/GXjCW/x2AkoJpIxz 64FHIoPuDgcPPQuCB4TJbpSYFDcH6F27jhqPzeqLog/GONLOK1vnFOAKNCbfuOg1zoCk tJWg== X-Gm-Message-State: AOAM5327OQ7zwrR84Yb1aRm10/zp1Zk47cbA58PvsJvRD0EFE+MZdeX1 L7p6gZ+uLoxYxyFTkCRR8owB2w== X-Google-Smtp-Source: ABdhPJxOYXuyTa/77jfnqwaGuTbTAe0IJ8c53ez6gutEkaTpUTp3g7eMHLAA/e50ehvWVEjkFNF8ng== X-Received: by 2002:a63:1f45:: with SMTP id q5mr5206433pgm.240.1594922274050; Thu, 16 Jul 2020 10:57:54 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:53 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 05/17] coresight: replicator: Reset replicator if context is lost Date: Thu, 16 Jul 2020 11:57:34 -0600 Message-Id: <20200716175746.3338735-6-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135757_182016_818BABBD X-CRM114-Status: GOOD ( 17.17 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sai Prakash Ranjan On some QCOM SoCs, replicators in Always-On domain loses its context as soon as the clock is disabled. Currently as a part of pm_runtime workqueue, clock is disabled after the replicator is initialized by amba_pm_runtime_suspend assuming that context is not lost which is not true for replicators with such limitations. So add a new property "qcom,replicator-loses-context" to identify such replicators and reset them. Suggested-by: Mike Leach Reviewed-by: Mike Leach Signed-off-by: Sai Prakash Ranjan Signed-off-by: Mathieu Poirier --- .../coresight/coresight-replicator.c | 55 +++++++++++++------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index c619b456f55a..78acf29c49ca 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -32,12 +33,14 @@ DEFINE_CORESIGHT_DEVLIST(replicator_devs, "replicator"); * @atclk: optional clock for the core parts of the replicator. * @csdev: component vitals needed by the framework * @spinlock: serialize enable/disable operations. + * @check_idfilter_val: check if the context is lost upon clock removal. */ struct replicator_drvdata { void __iomem *base; struct clk *atclk; struct coresight_device *csdev; spinlock_t spinlock; + bool check_idfilter_val; }; static void dynamic_replicator_reset(struct replicator_drvdata *drvdata) @@ -66,29 +69,43 @@ static int dynamic_replicator_enable(struct replicator_drvdata *drvdata, int inport, int outport) { int rc = 0; - u32 reg; - - switch (outport) { - case 0: - reg = REPLICATOR_IDFILTER0; - break; - case 1: - reg = REPLICATOR_IDFILTER1; - break; - default: - WARN_ON(1); - return -EINVAL; - } + u32 id0val, id1val; CS_UNLOCK(drvdata->base); - if ((readl_relaxed(drvdata->base + REPLICATOR_IDFILTER0) == 0xff) && - (readl_relaxed(drvdata->base + REPLICATOR_IDFILTER1) == 0xff)) + id0val = readl_relaxed(drvdata->base + REPLICATOR_IDFILTER0); + id1val = readl_relaxed(drvdata->base + REPLICATOR_IDFILTER1); + + /* + * Some replicator designs lose context when AMBA clocks are removed, + * so have a check for this. + */ + if (drvdata->check_idfilter_val && id0val == 0x0 && id1val == 0x0) + id0val = id1val = 0xff; + + if (id0val == 0xff && id1val == 0xff) rc = coresight_claim_device_unlocked(drvdata->base); + if (!rc) { + switch (outport) { + case 0: + id0val = 0x0; + break; + case 1: + id1val = 0x0; + break; + default: + WARN_ON(1); + rc = -EINVAL; + } + } + /* Ensure that the outport is enabled. */ - if (!rc) - writel_relaxed(0x00, drvdata->base + reg); + if (!rc) { + writel_relaxed(id0val, drvdata->base + REPLICATOR_IDFILTER0); + writel_relaxed(id1val, drvdata->base + REPLICATOR_IDFILTER1); + } + CS_LOCK(drvdata->base); return rc; @@ -239,6 +256,10 @@ static int replicator_probe(struct device *dev, struct resource *res) desc.groups = replicator_groups; } + if (fwnode_property_present(dev_fwnode(dev), + "qcom,replicator-loses-context")) + drvdata->check_idfilter_val = true; + dev_set_drvdata(dev, drvdata); pdata = coresight_get_platform_data(dev); From patchwork Thu Jul 16 17:57:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668229 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 656411392 for ; Thu, 16 Jul 2020 18:00:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13BEB205CB for ; Thu, 16 Jul 2020 18:00:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="t9Rk0nND"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f2mk+ScH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13BEB205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=z0qYL6CIaEdvxPFrfUoT6GzipUe+Mj5Efoy2wdVGOy8=; b=t9Rk0nNDjBSwyoRaYV2RgEzKy U3IdYKiTsb0H4430X3tl5AtsPp8YZScfN9Q3WS9Tv93w1uqllGZi4TIPPCGItQczKVbF30Ynru+80 EVDJ3nwBPZiK7Q8at5oiQjiDjEgt4PhX0ObqsgPFPpFh2v8cYR3zg8iKu6fCeSLF/D6vvLiJgpcK5 FQJkpV+cg6CNMvJQlHoFDjX43KhHMsCvj3EQqDU6WDW+UlC/73h2ubIsWolUC1OlZ0qHLZJIPbHaW co3vSGKTiFxm7nkI+GCOC3gat66IEOm4S8wSNWgeKRk/0VmapVX0z1+dXUhTFFYN6ny1X5vNW+2A0 3ZE4mNMVA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw89P-0003Qa-3v; Thu, 16 Jul 2020 17:58:31 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88r-0003DI-9P for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:57:58 +0000 Received: by mail-pf1-x443.google.com with SMTP id m9so4044965pfh.0 for ; Thu, 16 Jul 2020 10:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fc82J7yG5dHQnIPy4fbjBz1DSeFLAwJAy3bcByoYyNU=; b=f2mk+ScHrJY/8yWO1fFX7pRFLPSpclTmHFu/l/bO7KGcaKqrho+LMh7Bj2oLTkJKJK f0SbVEndl5NV2aGNtzvwJom/y0tgfn1SxFupgdp+ukDFauCyTZDKjhxThEyQp7hu8S9H ccvukAGNht422B1rVYn+OYup7iF+Kwjg5hGHLK9zrrz0/fyjX0xBEnHtnT70zEsquV0j tB3YmX9SurH1RSFquy8n8Q1uKn+9EC7An5Hshp4FSn4feZgrZA3mCQawNVyPUC8AW9Qp XjDTnsJisnr9iBVPIIzVlb9H00q6XIvr9Er0bx2l4zlI15IT++aZthlscaqa8NdS9LLc vk1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fc82J7yG5dHQnIPy4fbjBz1DSeFLAwJAy3bcByoYyNU=; b=fNsRpBtlX7d3FakPN/2I5hDie7+6WRjodUqppmFGSOAoZOgBqrTLrW+be6o+XCRt/b zUuCLBG/ImPWdmpP6uxC9a35rJYoVRVk5HDHpj0YxUwn5FqZvQB9wW3X1hpSzcQZuRFs UsfeP/wSQfzDj9ULnRs4U65net8+a968XP2v0D4LKmeoj5bEYkKVBpYVdjtf+mYrq/2o o+Vlnb0EciDYoa+z9tK9cXbMDKSfspOd4Czw693nTDq12g2s4YgYWOP/D/JP8qfPIWt1 H/rw35uDEYiVomY8mp4KT62nNygkZObpckD7w7CF1QdU2ZABCBn3MRdjRgbD355+8MY4 2xXw== X-Gm-Message-State: AOAM5307ij1iDaNw87RmylCQmDKwpCb4P4q/yjadoXHjtCAePEJSpQIs uqAQpgei4Qeveval6BLjWfF7ZA== X-Google-Smtp-Source: ABdhPJwH9zipg2NoeiWLeS/i1D0Xzp60T85iwhgW/Jr11NOJZr5KiqtR6bUILzHv4XLdJXokOGdqPg== X-Received: by 2002:a65:43c9:: with SMTP id n9mr5084546pgp.452.1594922275200; Thu, 16 Jul 2020 10:57:55 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:54 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 06/17] dt-bindings: arm: coresight: Add optional property to replicators Date: Thu, 16 Jul 2020 11:57:35 -0600 Message-Id: <20200716175746.3338735-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135757_469954_261A5E4D X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sai Prakash Ranjan Add an optional boolean property "qcom,replicator-loses-context" to identify replicators which loses context when AMBA clocks are removed in certain configurable replicator designs. Signed-off-by: Sai Prakash Ranjan Reviewed-by: Mike Leach Acked-by: Rob Herring Signed-off-by: Mathieu Poirier --- Documentation/devicetree/bindings/arm/coresight.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt index e4b2eda0b53b..d711676b4a51 100644 --- a/Documentation/devicetree/bindings/arm/coresight.txt +++ b/Documentation/devicetree/bindings/arm/coresight.txt @@ -128,6 +128,12 @@ its hardware characteristcs. * interrupts : Exactly one SPI may be listed for reporting the address error +* Optional property for configurable replicators: + + * qcom,replicator-loses-context: boolean. Indicates that the replicator + will lose register context when AMBA clock is removed which is observed + in some replicator designs. + Graph bindings for Coresight ------------------------------- From patchwork Thu Jul 16 17:57:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668233 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A4901392 for ; Thu, 16 Jul 2020 18:00:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D642207BC for ; Thu, 16 Jul 2020 18:00:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZSJvK/Yc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jJWP65hl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D642207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m8NjQp+sEGqZLqniE0/05LzwWWgbzlgH93Pr3W0hY9M=; b=ZSJvK/YcMaEN/ygPQe4T5g2Ix U152E3cX/B9BWlh1rsmTq8XQazjV/iNEHPOycjoCNEINjHkpHTxUiinlfNr/lmX9vCYhOzQ+pCybh prlvS991IdLMP57t+/aYtNF7ZJ0oJCk5bK+OTfGIn/lxyqt4wrS1U4BYkdSFQAgEjxRyqYhFcF/lr 9Cp3XdTtux8BSRWhzpxGbUfALCg7eXyQFPvIqodVHRMc0UxIUkHMoMj5jrxR2iQp46+JuOeZ2wNhX pmsG1KKF4tfCEWhbng7hfIpQQcuqNsMg2WT8TLzpyrqkCl+BvkPm1dFbuTbKf9b5ZBudt6yN3GfI8 uULwPGBvw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw89X-0003TG-AI; Thu, 16 Jul 2020 17:58:39 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88s-0003DK-Eq for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:02 +0000 Received: by mail-pl1-x644.google.com with SMTP id t6so4193103plo.3 for ; Thu, 16 Jul 2020 10:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L9CsMjiHr19XNd/X0TT3qrgDad5rrN0wvHdrCt2oHdA=; b=jJWP65hlFPfTs9rQWOqearAfdN1sNrBlpughSVbYqkHsj4vwzfvygygpr4pSqWB3CH lzTQDodDlWnfty9XhRg7Sp8j9rsiXayqSnPKY+mu8N7lmGzoIbgUywhl1i2ZIMHI+AG9 GBVtgwK5ZTlzWcr/H4mR5RHpQP+PFYaz9Xr/FGrja6i/6INykft8sz5PdGfGtaieSYsZ UMPy3Zq5x6pOmdtpcdsun12k2Jrs2QkpRSpoFFNgJErELnSl9M2ncMgNR1AAvPGsbPOa v5oNKMffEn2ap3kQ5s4dRgkbEfZJvUKe4tdu6vnRGXJGt03ZozCCVBltWiMwg+e7+/x1 qU3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L9CsMjiHr19XNd/X0TT3qrgDad5rrN0wvHdrCt2oHdA=; b=GYgkJtNYPum2rqQ8I9uFytEDoRop7k1ni6McYPL6gD/m5K35Cl+P7BWxF4cOlKxj9M QiEqAmFDF60zmDGr33jpSfE2rCNIstMx/J3B/t5upLtVzIccxf6pgX4lORTKb7QDKl7C VmYgSmn+48oehVM1W4gHkiwj4Mc9dPElxaq2Gd9PtWr44zP99KBCqTR1pnfrN7tYQQf0 W2a8kXoiQue7eMiR80+4V0vCA6sE6ra02KYgu9KQamZI0UfstbDdOi9VvNX2Dwi0sqAC kOEd/krDITky9kFW17LE0A95LGrm8wm8rUceA0NuOKjQeH6RoTP7jzKirYmmxnWlFRqv uLCw== X-Gm-Message-State: AOAM530uL3JaMqizoE1VTtuXVwFofhOo8oyVzEfrYHZu3nrSXbrMZ14S XEWqYiSkqO94RJfqoExfV3wa/w== X-Google-Smtp-Source: ABdhPJz+HHmjxLLa6Xd3BQg/PX1xr51SKbv6NmefaV1ewMQ7gijpdNvM1k9e23R+sjNjLZq5eHJ1IA== X-Received: by 2002:a17:90b:4ace:: with SMTP id mh14mr6126241pjb.139.1594922276445; Thu, 16 Jul 2020 10:57:56 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:55 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 07/17] coresight: Use devm_kcalloc() in coresight_alloc_conns() Date: Thu, 16 Jul 2020 11:57:36 -0600 Message-Id: <20200716175746.3338735-8-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135758_669793_B7EFB993 X-CRM114-Status: GOOD ( 10.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:644 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Xu Wang A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". Signed-off-by: Xu Wang Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-platform.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index e4912abda3aa..bfd44231d7ad 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -27,9 +27,8 @@ static int coresight_alloc_conns(struct device *dev, struct coresight_platform_data *pdata) { if (pdata->nr_outport) { - pdata->conns = devm_kzalloc(dev, pdata->nr_outport * - sizeof(*pdata->conns), - GFP_KERNEL); + pdata->conns = devm_kcalloc(dev, pdata->nr_outport, + sizeof(*pdata->conns), GFP_KERNEL); if (!pdata->conns) return -ENOMEM; } From patchwork Thu Jul 16 17:57:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668245 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B329C913 for ; Thu, 16 Jul 2020 18:01:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 881B820578 for ; Thu, 16 Jul 2020 18:01:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cMgLwFUB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o68eu0ic" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 881B820578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SsGLjetzKWnyQNeMyZOrf5sav7MSFX0H3jsWfAjeXLE=; b=cMgLwFUBoZ3nGA2F4dMH6CRrq WB7lmQShqCYtP83QfSHMYCyuU75jgYAJkzGR9dqvxCvzM5/xCSWQE/Qs4/WV0J5t92c+ltNh2gZ9k 2TT2n+cU/3XFYZ2c3N6+3MhkiMdgk/XLHRLZvceBnSlDuSUwy28rtljlIJey5G/ccbX2mXD8Zqs/E dJJwmhbhowJjkYysrmuUc2l9uzuTPKEB5pZ4Tt5dXqiLBjNDiUKMMZ8pevTT5XHaHz9Hr8C9FpUuA BpIOK4QaqBZZasbIO9PoEkQiRUNU1TWE5UguZpxDBLDlMixcdLspHUuGPppTMWCMGVUoNusdD/KxW iHwqXCI0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8A1-0003d2-0q; Thu, 16 Jul 2020 17:59:09 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88t-0003EE-NO for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:03 +0000 Received: by mail-pj1-x1042.google.com with SMTP id gc15so3211596pjb.0 for ; Thu, 16 Jul 2020 10:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7ntzqo0z0qf+cR4v7KdjMHEQuDVs75ykDqjEPQSKy7c=; b=o68eu0icfikOdqQVgMSPcd+yRPjyelDM/eqAUHzrS1fWBPUhi0S7HxnAvNEWgu8+yB YIbmF3tCh9DU//mObAxS1WrnHo1jPgxeBJ7HDL7Y8KF+1XEEUR4joOUzw6F4+Dh8566b eZ5RWbxlwwqBkSrQsR4z3+oghoOoh1lh5kBlf/rJt3rF1Q43EObqhXmatXrbhBoDB95V MHlW+mYcxAlFxutnubx2zb7Uat/DlWjxPFFq1QFlAJMz1QggdIHceje1SHaxXz7jo48p JVTs7FKO5IV/+EH9vCfhoq0G8f/MpEG9cNMogUrl8LK+PINdFj9n1aUay/tvbD/F3YgE TwEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7ntzqo0z0qf+cR4v7KdjMHEQuDVs75ykDqjEPQSKy7c=; b=DB9XQad5xtmjllOd2szmdyFOXpEqDEiRwd+oL6JZTX+Xw0WzzUci+uNYFJ8ykquYyi iDDNb3OHkyxGpFrZzeyP9lqcWgtQB2vwHCmfX74wqc7BGbkjHrZL+QojkxgSlrgkzDDz fbTPZT53I8xNByzZ6YdPWN+ZVIJyO2v1z+SP/s9QbXC/88NFF2hwwuYZXCqcZURw9I5x /OtomM0fHElFfHlLXP/kwObZudxx7t5nr4xGds/fZVbxVtZdT/AKwRKwY4Ooes9SqENv GSM/BagrmhzL7Cri+gnOA7yvyVk3IqIAdw1suKlo0yuGcqWsuZ0OiatW+1nCS/AhPB6v 1tKg== X-Gm-Message-State: AOAM530iyC1mLWRiCvX7nX1wth1VO73ZuzYaWqf0s77YRsQwpxH/teur c6VSTW34SvLd7T6vjowUyJSCVw== X-Google-Smtp-Source: ABdhPJyK3iPsltY6lF8MfVl7jzkcV8uxNvprcWp392RRPOPnJ04g1++iugw/ZYfM/fyjgZucirmVEw== X-Received: by 2002:a17:902:c24a:: with SMTP id 10mr4717137plg.82.1594922277647; Thu, 16 Jul 2020 10:57:57 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:57 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 08/17] coresight: Drop double check for ACPI companion device Date: Thu, 16 Jul 2020 11:57:37 -0600 Message-Id: <20200716175746.3338735-9-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135800_579479_4A9483CB X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1042 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Andy Shevchenko acpi_dev_get_resources() does perform the NULL pointer check against ACPI companion device which is given as function parameter. Thus, there is no need to duplicate this check in the caller. Signed-off-by: Andy Shevchenko Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-stm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index b908ca104645..673d2f56ed1e 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -727,8 +727,6 @@ static int acpi_stm_get_stimulus_area(struct device *dev, struct resource *res) struct acpi_device *adev = ACPI_COMPANION(dev); - if (!adev) - return -ENODEV; rc = acpi_dev_get_resources(adev, &res_list, NULL, NULL); if (rc < 0) return rc; From patchwork Thu Jul 16 17:57:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76CFA913 for ; Thu, 16 Jul 2020 18:01:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44DB520578 for ; Thu, 16 Jul 2020 18:01:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WeJys/KJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="M2LwIBQd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44DB520578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Oj3vjiFpxdRbTxKptDQvUYQG+UC6m4KYwjSqH5GwjQw=; b=WeJys/KJ3nM1XlfSAMqREimdT C+K5ojGbQ8dNqQjUWd03+YgrgTjeMUskoYdAYkbIQ/3JSLR7SfhreCjpGGgkG/adEP/lrVSyfOPto mlJzBY8yO15RMShkFoSfvX6frpRta8JYx7N1G+Tcd29K/E6D6veouCwOL4ScW+5+6kdk9oJLn+o+m T7y7gsRUUG91wRJ9p1Q+OnxfBljHJp2w7b2zDK5CqyuEqm2qfQVqslm++wNl0Tb96kkrn6ItHfmvr u63BWwNDr+7MSbE7uWmS7b/CjMCV0dyYASUxRepjO4FR24xqdcoYqQZyWpyWT7D7ITtLObMI4ELjN RxoQvlo1w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8AH-0003mE-Ga; Thu, 16 Jul 2020 17:59:25 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88u-0003F6-Mv for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:04 +0000 Received: by mail-pg1-x544.google.com with SMTP id m22so5193345pgv.9 for ; Thu, 16 Jul 2020 10:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IHDoN/BAPcUfN+U/oUh0Gxf3i/wqb1dGrY4pCKb8kz4=; b=M2LwIBQdC8BPjZVVUuNr0tCHPphTQ9ICLdXXsDvmMuQLJxi/eFEOEq3UbJ8+BiQqcY rgXcn7TtE6/yLWhJMyBN9RF4pvX06rZNTIkZbLSoNIQ5iZzdQVV6vuN19qujPL06Tbm9 HX0+F40SeO2TgON/1f65nkxyI5Y2zBKh0JL3TfENkx+uqbUssjMhFgk8q0qz7RhRsUSr 3G+pGSfRhN7OjewVaUwRJtPm2S7kOpFZpY+zg7GjuDIkOYpqjn1u3eIU3DnYeSyDcjPO +A/TCn1jihH0ZfjNzg3TkcZfCCIFJJp4IBAGnZ7JN8ZHQtvEDCDY4IaY6dGKLhq+7qyK 0tDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IHDoN/BAPcUfN+U/oUh0Gxf3i/wqb1dGrY4pCKb8kz4=; b=ieB3XjA7R0e2HZoBwl9eDm14j1PgAXE9IAE9xXBAG2lDgsilHfBVvIONMOB7WTvNxc 4pzeQrCqDh/Obl/FIoepv+9IpdKOd4MmfPye8H4130VaycVyzCkF0KKg27wl3aG+JgB6 2Ab3LpJo+chJFwSSRtU8848pAzs+Qh1xUB/yxJ+KxXUVTMC+aUtAWL1656kc5hC3X0hs gCwwpn7zPJGES4KxIbAW8V+zjJzf6PTJAcNrSkCuOXStnR0/jW7YDZVqj+L44UysSx3Q j9n5QlZH+71M7N3OrkJ+4iFGgsQT2F3WilWiSycZcG+GwiLJU3uVkuUngcBFRFxw48OR LfhQ== X-Gm-Message-State: AOAM531UDfPvbAM+hnie1NcBPBppJ1rDm7q8RR3jFmgN13nS5CmcDnCy Giadn8ZKKffGHn1YMrTpofVFkA== X-Google-Smtp-Source: ABdhPJyXPl51mGTF/c57zf28jvbXSB666r2jV19fWnE92ZpfF4pLuTJO32tr2jd7DIUWm9/U/JWn5A== X-Received: by 2002:a63:5a01:: with SMTP id o1mr5118567pgb.337.1594922278903; Thu, 16 Jul 2020 10:57:58 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:58 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 09/17] coresight: etmv4: Fix resource selector constant Date: Thu, 16 Jul 2020 11:57:38 -0600 Message-Id: <20200716175746.3338735-10-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135800_831696_5B68E721 X-CRM114-Status: GOOD ( 11.46 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Mike Leach ETMv4 max resource selector constant incorrectly set to 16. Updated to the correct 32 value, and adjustments made to limited code using it. Signed-off-by: Mike Leach Fixes: 2e1cdfe184b52 ("coresight-etm4x: Adding CoreSight ETM4x driver") Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 72c9a55e67df..7da022e87218 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -133,7 +133,7 @@ #define ETMv4_MAX_CTXID_CMP 8 #define ETM_MAX_VMID_CMP 8 #define ETM_MAX_PE_CMP 8 -#define ETM_MAX_RES_SEL 16 +#define ETM_MAX_RES_SEL 32 #define ETM_MAX_SS_CMP 8 #define ETM_ARCH_V4 0x40 @@ -325,7 +325,7 @@ struct etmv4_save_state { u32 trccntctlr[ETMv4_MAX_CNTR]; u32 trccntvr[ETMv4_MAX_CNTR]; - u32 trcrsctlr[ETM_MAX_RES_SEL * 2]; + u32 trcrsctlr[ETM_MAX_RES_SEL]; u32 trcssccr[ETM_MAX_SS_CMP]; u32 trcsscsr[ETM_MAX_SS_CMP]; From patchwork Thu Jul 16 17:57:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668239 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BBAE1392 for ; Thu, 16 Jul 2020 18:01:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C68A020578 for ; Thu, 16 Jul 2020 18:01:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hJjw9TeJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="R5QkqraC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C68A020578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=I20bR4G8j8lw6IMPj0qPGIe7QPB844GGFrWngv3jjeI=; b=hJjw9TeJkOO102dj3evfMEMp1 bpxWxNkJsVpujpxBALu30aIikcSI5dDE9uiiwz9HBJVcBf2kNGCBeiBtTuN7sejx/sB0GBk9Mn8Yb kDv2YGp68dv0UlxI+5/dC5QLve1nw/GekLmRqF1Fb/J+XJ5GqHwrG44R2EoeVdZqJ6ur28Jv5dUyJ 9dvMg3h1vtPe0QeqeJapFELMEzoy2o7jOl0pNxxHp0FIs3WCx8+8vpn0tNBmzNAobmrAsnFHfnHOk 32fUD+vfwDw+H8HDSwKguYEFY8cm69DhM8j3AJ4JFKEIcNbVqxQertWmQGxaRcxCfrO2awkNFyQag Oo0gGvZMw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8AM-0003pR-6a; Thu, 16 Jul 2020 17:59:30 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88w-0003FX-1V for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:05 +0000 Received: by mail-pj1-x1041.google.com with SMTP id k5so5036941pjg.3 for ; Thu, 16 Jul 2020 10:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M8ZVM9AOAXxNoSAkg37qiYuGNEa/r3piyJp/YtA+jBA=; b=R5QkqraCPr8jSlGMGX8A7B19OlZpVtJ2ZAavuNdKEHbGYWuojbjCqzaO4uwnB7lhcc ABIbO0cyvwG1JrtbnB38df3WJ01JC0hVM9stAPZtYoWR/T1bnW5Ew2ThAyxgHiBcJRC9 +YcgbIhWpM+Px+S0xy9esgRyYyv+bkuo/+IE/FPyoHny0ugzcek6vF41qXvY1yZGX0rz xO10B02DT3ohsbKCKQpSDrL9MnnzPMsc9C1zhndvYcerhIwePw46HyExt4rswmQlxMIX UW4yhNWtvLhi1rGgWjQfnPeObwMvN+3nH5Hqwzj3oVy+x9dHnouR+qito3UhPRfeeIUz 0auA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M8ZVM9AOAXxNoSAkg37qiYuGNEa/r3piyJp/YtA+jBA=; b=AvqKqqiF/jgWUeRMjtYXlIhCaMCcPcbXJfTVQdnXmFjrNv7reGM9S+OdBSrWIRCLve 1yXvIqmN8gdeskwKvKuysSGiEoipJcwZmgPzleMo9jdtrfCWsiyZFn00eqHZ1yH3aB/K Tz257dWlkN8fTXK6XExIoVD5wYR9WC18khMQY3ZjhOMyqxeAgxWwi/EVpP32V0oyZEKG XdHHb87ca8B/T6wFslz0J4vMo9fsS6FSt24EllSfmGY8QLlrrv82p+v+O4uuleNhS8H+ WIsG2IGRExOIjT3C2RmniBjfv5hC4KjNR5fhchiMXvK3WqBmLnAQPXsYs0eZbMf1mO6t M4Tw== X-Gm-Message-State: AOAM531dilkCCsVj+gn8Nygv+S7etjq0vQ7xQri5nHy5yIt/coOgrafz fFffijIU61ImnqJLca/9h7PvWQ== X-Google-Smtp-Source: ABdhPJylUrdzU24B4NFN2owcImL/lZlrrJYG/4IqzRgktsSnzL7khBf2I/NVOOGZLm34CvBAqpNwiw== X-Received: by 2002:a17:90a:fef:: with SMTP id 102mr6141106pjz.104.1594922280032; Thu, 16 Jul 2020 10:58:00 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:57:59 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 10/17] coresight: etmv4: Counter values not saved on disable Date: Thu, 16 Jul 2020 11:57:39 -0600 Message-Id: <20200716175746.3338735-11-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135802_193478_C935B1FB X-CRM114-Status: GOOD ( 10.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1041 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Mike Leach The counter value registers change during operation, however this change is not reflected in the values seen by the user in sysfs. This fixes the issue by reading back the values on disable. Signed-off-by: Mike Leach Fixes: 2e1cdfe184b52 ("coresight-etm4x: Adding CoreSight ETM4x driver") Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 2290f41f0074..2d732af8b3e7 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -511,6 +511,12 @@ static void etm4_disable_hw(void *info) readl_relaxed(drvdata->base + TRCSSCSRn(i)); } + /* read back the current counter values */ + for (i = 0; i < drvdata->nr_cntr; i++) { + config->cntr_val[i] = + readl_relaxed(drvdata->base + TRCCNTVRn(i)); + } + coresight_disclaim_device_unlocked(drvdata->base); CS_LOCK(drvdata->base); From patchwork Thu Jul 16 17:57:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668237 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E07171510 for ; Thu, 16 Jul 2020 18:01:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8392F20578 for ; Thu, 16 Jul 2020 18:01:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3VLBuB/8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rGuaU4z6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8392F20578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XoOtRNe2u75Wv/tZn2Myf01NwEcSRVDxSZw3cvX6xSc=; b=3VLBuB/8zmXe5Q8xLzIwqOhjO O0rEXF3ub64sl5mEDNCSVzq2IUOeUv8ez+nzvQrXuqnd9N7eVxBBbsTSGaUfE+bkxOcK3jXtdN04C RxTfOWULbiD9B879Cyw4g6GJnqGQr0UAUXYHW9F0wbYaPGsuqVUlkrvPT6Eq6PhfrzFkvY52rP/M+ KmvfF+W9HJ5DIp7VnZcfr6ZevPTQkvXaPbcIAMrcDdj/IG431H1tx492CUj+PijrACeI8XtLuUiFS 3ogwDxeaCMOKWBCL9xOO8E+v7xbsc/Tcb8Om0UKbS0OvKG+1eEvRLJccp3xUzKS+biDJ4O9RU3+7b wl+SVN6sA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8AQ-0003sN-N2; Thu, 16 Jul 2020 17:59:34 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88x-0003Fp-65 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:07 +0000 Received: by mail-pl1-x641.google.com with SMTP id 72so4202793ple.0 for ; Thu, 16 Jul 2020 10:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kjdBs3nvqTbrvsExhfBAIyxRlnIH3iouOyia37yKdxQ=; b=rGuaU4z6xLjR8PHAzUx+xEfbPcQlQjFiUa8DwtYPyJJcAqGbp19Jz74rEyJe+2hSix 0DHB7w2sa2LeDSi9BlSfk+2QzmGO472nT52TGDFKow9U1+MMbV+qkjEWI0eL734UaWqg GsRXCdJHbmQcFMH5cuI0k0xqYY9YmXC+QyhQ1oIXjd1FxGAClFFqEa49gvrs1xKgydko nfjH4rUiQvfyZuLO0JzebkZLcJkJ1llvxzUV+nVgLKmDCM50Aoq7od687HCv6FCLwYmy pLiL0QZAUxikn2ff/Uu5RLraslpPl5cjd9QIbWn3hRON2nWyTrHjkYt7KQtU44YEODxz Kl9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kjdBs3nvqTbrvsExhfBAIyxRlnIH3iouOyia37yKdxQ=; b=Eksjgv9+f9eitcJTtyL9t0DyuEXL+LlLszmtnRVRLFUFZu4Kty6raIey2UbQ7vkvMp AqnmMRZYo/6lS29JI2XvfHVoUqO09moKrcJOjwo1pWsLgm11LhRKhLo4LbDk4QX7E6rf 2LlI067NzWqDMbHdXmpWb26Tjqj8vq5cIjZANzSrR1V6cCdnqxPdDR21dB5X9BBNQ4Hv BvmGN5Gl+RyyrsyYY3JizGI1wVL5oYxgXcoV/UYO/LLl+nfBS3EuGl/kiSZF8aAnTjec 6HWnrTN13KioX7A39rXhU5UbbpphsJWtdpAKjClAr/J7X9q8HWPpaqEROtXic8SVpPb+ WtiA== X-Gm-Message-State: AOAM533LO8cW583HF+m+Gx9DVvUA62cL/4Pivz9KZuXUvssdWh8TtDtB 2JfOmDaxf0XU8D5xj/UQuacAlQ== X-Google-Smtp-Source: ABdhPJx3JAA1Crd2xnj2CyfCxZA9l7Zeg0f+Hc0xGZ99nBAnkjz004iTqZPj9wzY6OPyNsfSiaIEfQ== X-Received: by 2002:a17:90a:8082:: with SMTP id c2mr5915875pjn.204.1594922281214; Thu, 16 Jul 2020 10:58:01 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:00 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 11/17] coresight: Fix comment in main header file Date: Thu, 16 Jul 2020 11:57:40 -0600 Message-Id: <20200716175746.3338735-12-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135803_423118_64A805CD X-CRM114-Status: GOOD ( 11.85 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:641 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Mike Leach Comment for an elemnt in the coresight_device structure appears to have been corrupted and makes no sense. Fix this before making further changes. Signed-off-by: Mike Leach Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- include/linux/coresight.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/coresight.h b/include/linux/coresight.h index e3e9f0e3a878..84dc695e87d4 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -179,7 +179,8 @@ struct coresight_sysfs_link { * @enable: 'true' if component is currently part of an active path. * @activated: 'true' only if a _sink_ has been activated. A sink can be * activated but not yet enabled. Enabling for a _sink_ - * appens when a source has been selected for that it. + * happens when a source has been selected and a path is enabled + * from source to that sink. * @ea: Device attribute for sink representation under PMU directory. * @ect_dev: Associated cross trigger device. Not part of the trace data * path or connections. From patchwork Thu Jul 16 17:57:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668243 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 232281392 for ; Thu, 16 Jul 2020 18:01:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAA2D20578 for ; Thu, 16 Jul 2020 18:01:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b40/t/Jx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ANIWgaib" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAA2D20578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sl7uPOdarwj/Aqgr0uC9w1SIFvdokBUjNePpIeqYK48=; b=b40/t/JxWBWRZitn8Zq1HJ42V 0+epN+F0pyj5aoRATrUGoTQWJXDgCPd1d1cbM/3/FA3TOaBJ2VcnUKeA8/J+Za0zcnsr4EZlewK+C LrqTT6+o8OrzsghUmg4C9W9Dw0L9OJrjfWp5kIsZtLWwjnoCtoggE4kdo7a8G/+/eFbLteZ/TsTCP JhTmqyc+PtJrHbdOqSVwKS3KaTSjxVmMYUGJKnZiSWnkndP/12vLCZRD+G0lTjEQjs5DpDlfhXoCB l4OH+owCSgxh1llO7yR66/bvTc9d3AxdWe+lgK6op7+m2Z/28Yag+ISd0dxkvtG6KNOCcaA4B/urx +XC+eeQZg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8AZ-0003yM-7x; Thu, 16 Jul 2020 17:59:43 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88y-0003GL-5m for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:08 +0000 Received: by mail-pl1-x642.google.com with SMTP id 72so4202812ple.0 for ; Thu, 16 Jul 2020 10:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DqC/o+OJQTj83pbaJvj7SPqPQZtDsMDV59x7+pLCqqQ=; b=ANIWgaibkmjOeNnR+uMMVASzWtiRcUNiGA0UPCdZoeS+RhcTg1tUJ3Dw7SiZRSl6wT XsFdR3ANy9IoiUcSGxJWctobOM8x0JWn2k/RBY77KY8lhyoYeypK/KUGyK0tz/bgdiub Hw4mhFEmr9g9LqB1J0/6cXHLoOTlSDdf2qH5a5jYn2z4N2PcEqfxaI/WVA+06N6hrzeC mf2cCjMbsYn76nPYIPC8vOvefiFil8jCqgBUf04nFGV0GwftO64PBxvc8/l8Rdj0FB3l e22A7vonLd2I6Q6hDPgoGFVCSkwMLLOi2bs5IilvxYTiUGjOrh18K8PHtPiCoxyNo6WD 2WgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DqC/o+OJQTj83pbaJvj7SPqPQZtDsMDV59x7+pLCqqQ=; b=p/f7VbBsP/m0ysaArW+Q9Gd6sv9sQPcsKPszV+K/MUDnyCHWMdWizGBnh0FZ53I6t1 nolboypp9BK3rq8Trv1WLcyBc30aEc3Wp8fdTrPqu3reyLDyJdCGIsXCN8kuM38QrjWA Uv7y8pn2fMhSC1lwg31J3zkkfaQo/Jju9/J/+6COQpg2PO+4mHkxxuhSqiVq4Cr0JVDj 1s/un/pGrIiEygsUtnHCTFn7hgezvSCnV4eHTQhu9kIdB8BtYQK+EbJwlTzqNcNf4GkN 4d8qnWpTBU71TvmPFHKHEgpU9X6LdXrgKK/DbyDSw5KcNG0N47TZVGQLRJ9ATJi8q6vu 9jfg== X-Gm-Message-State: AOAM533vaS3ojx8M+fsd16IXUPFxUNnBi5Fz5sd8rcAe8PDRR4xeqboH x+L6AcCdkiPtVTruOoVx4ecT5A== X-Google-Smtp-Source: ABdhPJwfkN3hNZVBDdOBEPPIKG1KUzpPvpCYs5beX3oWRVCB9y/gfDCvr/rhxRtHViFfD76VgJaq8g== X-Received: by 2002:a17:90a:350e:: with SMTP id q14mr6048446pjb.155.1594922282395; Thu, 16 Jul 2020 10:58:02 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:01 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 12/17] coresight: tmc: Add shutdown callback for TMC ETR Date: Thu, 16 Jul 2020 11:57:41 -0600 Message-Id: <20200716175746.3338735-13-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135804_378269_1D986063 X-CRM114-Status: GOOD ( 17.17 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sai Prakash Ranjan Implement a shutdown callback to ensure ETR hardware is properly shutdown in reboot/shutdown path. This is required for ETR which has SMMU address translation enabled like on SC7180 SoC and few others. If the hardware is still accessing memory after SMMU translation is disabled as part of SMMU shutdown callback in system reboot or shutdown path, then IOVAs(I/O virtual address) which it was using will go on the bus as the physical addresses which might result in unknown crashes (NoC/interconnect errors). So we make sure from this shutdown callback that the ETR is shutdown before SMMU translation is disabled and device_link in SMMU driver will take care of ordering of shutdown callbacks such that SMMU shutdown callback is not called before any of its consumer shutdown callbacks. Signed-off-by: Sai Prakash Ranjan Signed-off-by: Mathieu Poirier --- .../hwtracing/coresight/coresight-tmc-etr.c | 2 +- drivers/hwtracing/coresight/coresight-tmc.c | 23 +++++++++++++++++++ drivers/hwtracing/coresight/coresight-tmc.h | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 625882bc8b08..b29c2db94d96 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1110,7 +1110,7 @@ static void __tmc_etr_disable_hw(struct tmc_drvdata *drvdata) } -static void tmc_etr_disable_hw(struct tmc_drvdata *drvdata) +void tmc_etr_disable_hw(struct tmc_drvdata *drvdata) { __tmc_etr_disable_hw(drvdata); /* Disable CATU device if this ETR is connected to one */ diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index 39fba1d16e6e..b13ce0daa572 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -538,6 +538,28 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) return ret; } +static void tmc_shutdown(struct amba_device *adev) +{ + unsigned long flags; + struct tmc_drvdata *drvdata = amba_get_drvdata(adev); + + spin_lock_irqsave(&drvdata->spinlock, flags); + + if (drvdata->mode == CS_MODE_DISABLED) + goto out; + + if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) + tmc_etr_disable_hw(drvdata); + + /* + * We do not care about coresight unregister here unlike remove + * callback which is required for making coresight modular since + * the system is going down after this. + */ +out: + spin_unlock_irqrestore(&drvdata->spinlock, flags); +} + static const struct amba_id tmc_ids[] = { CS_AMBA_ID(0x000bb961), /* Coresight SoC 600 TMC-ETR/ETS */ @@ -556,6 +578,7 @@ static struct amba_driver tmc_driver = { .suppress_bind_attrs = true, }, .probe = tmc_probe, + .shutdown = tmc_shutdown, .id_table = tmc_ids, }; builtin_amba_driver(tmc_driver); diff --git a/drivers/hwtracing/coresight/coresight-tmc.h b/drivers/hwtracing/coresight/coresight-tmc.h index 71de978575f3..6e8d2dc33d17 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.h +++ b/drivers/hwtracing/coresight/coresight-tmc.h @@ -268,6 +268,7 @@ ssize_t tmc_etb_get_sysfs_trace(struct tmc_drvdata *drvdata, /* ETR functions */ int tmc_read_prepare_etr(struct tmc_drvdata *drvdata); int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata); +void tmc_etr_disable_hw(struct tmc_drvdata *drvdata); extern const struct coresight_ops tmc_etr_cs_ops; ssize_t tmc_etr_get_sysfs_trace(struct tmc_drvdata *drvdata, loff_t pos, size_t len, char **bufpp); From patchwork Thu Jul 16 17:57:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668241 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8BD2C1392 for ; Thu, 16 Jul 2020 18:01:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E32D20578 for ; Thu, 16 Jul 2020 18:01:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nSBKF7dc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OpzV4NaE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E32D20578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5Gjs2f+ljvCWcjOJy18vM3fzcK8rQLtbGTY9sdQ9OsM=; b=nSBKF7dcvKD32Uto3J6FDcMPW XEt68rD6N9aXvHlsbh+m6x7+uBje3bGXUvIKPFMe+2PMAM0bVBrnh6xhOHHQIgFY3Wsg99l/6dxD0 Oe2u8bThWuVOjmSDxRWebZLb3b7Oj00D1fAZIxCp5YT8LkDVz99goXTPiR9AA0hVNFg7HVbfPLoKu o/E38Fkc9l8PIsH+ulmld0e2KA50UbLwqzURlg1aa6WL4Ff0YjHsE8ffKLmg2iAhjM3SqP4NrV5sV uj+1LM4YvVOtjXInor5dS16c0W4wPOtms3W29WnJQAxZqn1PNdCWSMNYoiYkSwbx0Zi/ASILfmqaz ctvOa+MbQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8Ah-00043l-C8; Thu, 16 Jul 2020 17:59:51 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw88z-0003Gu-C9 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:09 +0000 Received: by mail-pj1-x1042.google.com with SMTP id gc9so5183739pjb.2 for ; Thu, 16 Jul 2020 10:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x3lU9ESZHuY6IEHfi+MuYyjVp7DZTndB82CCyaqDX50=; b=OpzV4NaEaleDpzdmRuAlQoctrlccSk50yNj/iHO6/e30lFopQzd8JfMxVZYLX5/LsW uWa0DxkuRN52CblDPJCSlP5aVkxySbnxOjTjnT2ebW1wvbB3RqTKZTt47QMcV4zGg3Ue YfMEX1H2DTX7MJHtTGc5DuyF9g6v29VB0IDJYqTwyeRW6tbl0bIW7ETXLKoDeRmsXzAS 9X+ShfCtSD/2/Fot9vyO1405SKZz9mqXoFyE1YFgw0JdOn6/BaDP/z89C+R1ut6Jrwyb 9VmXw9ux5L2Sb1lB2peR8E2QtmzQIbnoWs/zZ/FXkgrDep6HpKmMGM/u9rZhFETgKWTd Rwgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x3lU9ESZHuY6IEHfi+MuYyjVp7DZTndB82CCyaqDX50=; b=QZkH89+Mcyp50XfPjnlKbtL8Q0S2LC2joP89FCmE09jMR/A3QPIqx6IM4C60eb1RaH 92qZ4WHGB3hsLwALyKf2ynCeU+IXjNg2WtxzrcuJqaazrA6jzluu9r1vIFd+ifjkhqZj kwU5mfRzQ/Auk70ySdClJcXTh6lEWr/WKqMAloLBK0y1Yct8CxmQ7YpPSysfjkmFfF6I GKKo8nA5e9V9/rualh/KCJsLs47NvFlsosSdamvmCUao+FxOXP0mtPR55qkOyF6mSzXM y6QX2oxnsb5zaGmtIgGW9F2YM9/63b4dX2qiypZU9Mmxn4zLgeOGhHv55R7SFHBImWRu wuaA== X-Gm-Message-State: AOAM533JkjvnvdpRwmzGHRk2KPdMrOONxtEPUoc3lzHbBmc3HcoC4xeV +bwdUXysbguinux0VaoYanzNKqe9zh0= X-Google-Smtp-Source: ABdhPJyrf32tbmnyjqzXiZO51+mdup0SSwcihqJ7sJL0YzYpFeCipl+8isBV5TqypB0/A6ZAZQNBBQ== X-Received: by 2002:a17:90b:4c8b:: with SMTP id my11mr6093377pjb.153.1594922283580; Thu, 16 Jul 2020 10:58:03 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:03 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 13/17] coresight: tmc: Fix TMC mode read in tmc_read_unprepare_etb() Date: Thu, 16 Jul 2020 11:57:42 -0600 Message-Id: <20200716175746.3338735-14-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135805_924505_FAB41F84 X-CRM114-Status: GOOD ( 12.83 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1042 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sai Prakash Ranjan Reading TMC mode register without proper coresight power management can lead to exceptions like the one in the call trace below in tmc_read_unprepare_etb() when the trace data is read after the sink is disabled. So fix this by having a check for coresight sysfs mode before reading TMC mode management register in tmc_read_unprepare_etb() similar to tmc_read_prepare_etb(). SError Interrupt on CPU6, code 0xbe000411 -- SError pstate: 80400089 (Nzcv daIf +PAN -UAO) pc : tmc_read_unprepare_etb+0x74/0x108 lr : tmc_read_unprepare_etb+0x54/0x108 sp : ffffff80d9507c30 x29: ffffff80d9507c30 x28: ffffff80b3569a0c x27: 0000000000000000 x26: 00000000000a0001 x25: ffffff80cbae9550 x24: 0000000000000010 x23: ffffffd07296b0f0 x22: ffffffd0109ee028 x21: 0000000000000000 x20: ffffff80d19e70e0 x19: ffffff80d19e7080 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: dfffffd000000001 x9 : 0000000000000000 x8 : 0000000000000002 x7 : ffffffd071d0fe78 x6 : 0000000000000000 x5 : 0000000000000080 x4 : 0000000000000001 x3 : ffffffd071d0fe98 x2 : 0000000000000000 x1 : 0000000000000004 x0 : 0000000000000001 Kernel panic - not syncing: Asynchronous SError Interrupt Fixes: 4525412a5046 ("coresight: tmc: making prepare/unprepare functions generic") Reported-by: Mike Leach Signed-off-by: Sai Prakash Ranjan Tested-by: Mike Leach Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 36cce2bfb744..6375504ba8b0 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -639,15 +639,14 @@ int tmc_read_unprepare_etb(struct tmc_drvdata *drvdata) spin_lock_irqsave(&drvdata->spinlock, flags); - /* There is no point in reading a TMC in HW FIFO mode */ - mode = readl_relaxed(drvdata->base + TMC_MODE); - if (mode != TMC_MODE_CIRCULAR_BUFFER) { - spin_unlock_irqrestore(&drvdata->spinlock, flags); - return -EINVAL; - } - /* Re-enable the TMC if need be */ if (drvdata->mode == CS_MODE_SYSFS) { + /* There is no point in reading a TMC in HW FIFO mode */ + mode = readl_relaxed(drvdata->base + TMC_MODE); + if (mode != TMC_MODE_CIRCULAR_BUFFER) { + spin_unlock_irqrestore(&drvdata->spinlock, flags); + return -EINVAL; + } /* * The trace run will continue with the same allocated trace * buffer. As such zero-out the buffer so that we don't end From patchwork Thu Jul 16 17:57:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42AE717C5 for ; Thu, 16 Jul 2020 18:05:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06D422070E for ; Thu, 16 Jul 2020 18:05:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kpI0VTTZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uqXCgL2C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06D422070E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4zZxdK/v6bzqiqkdRZFEYcA2THa4iZiikX00Hm6tlik=; b=kpI0VTTZ39MusNcvay5+VQ3T1 OpqunjKb62XkYPaRDs5OYN6WMBF6Spn48goRxKwAYJCKDCtHeCcfd4xa7/5MBVy51D1IqMo8qyOyi rX+rp9vEoguswITx/gYu2hPczHjHSHSdWqWeNr2nEorN3MIgc3pam04X8DJZQo/pddTjq/4PYZPFz OOH8zK9iQW949ZU049SvN7495Snu8vpB+L8twgR4oFbIYiuh+1F/RtswWEw91sOe3xLr1qT0V+u57 zKxbuzAYAYagvDu3Ivc2atOLWI+9QvhcJKD8VCpDRCRGZ9ekLVAj9ceqsyAtQCqrDpuUWjqinDv94 +FKR2zFTg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8B7-0004MG-Mj; Thu, 16 Jul 2020 18:00:17 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw890-0003HN-Tk for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:12 +0000 Received: by mail-pj1-x1043.google.com with SMTP id gc9so5183762pjb.2 for ; Thu, 16 Jul 2020 10:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oscPAjtaFuuauy6j4n+8DCRJWWBSQ0QskJ25gcI0x54=; b=uqXCgL2CyNM8Mz12hEpY56bXQtb1lRUAqBmXJLumrK24eSXji/kISejOxdycfsFaxy ni7fYeqK2EEXtBiO+YESiePlVrzvIrn+qddz0qqJd4Ut2S0PWPJ/6O/mkxx441WITEw5 0D1z4YwgFh1efSXqzvnK6mWtliOj7Zx+8s1MfverOfiTjYbq4HjWHFbqFRh4Iecc5rMr YnsF7GS6gyP41fpPLljJkVaJfXp0747Z/k0XfTgw9zi73mEJy1q/Z3LIwGSNWfJsg06v 4nkrJrJbsDW0IDf5KxeJbATm6SrIp7Fml+IYnaqpKHoKPrDdUoPKX5wJKMnqAyNXfbyb OJ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oscPAjtaFuuauy6j4n+8DCRJWWBSQ0QskJ25gcI0x54=; b=IGUmYffc+OagcEBJXkCu+XFE28t8oJQIorNWwz+MevtgdeiLTagSwK3HvWFGI51Vu7 DL3z1CZ1nHfvNV3FK/sXmNfxzOOTNjoJ5SodWnGZ/KHdsWuZ57ZpIrXjcb+TCXQF+5kJ r9eAkoTs7drUdkKuYau22HmVll7whUJFEaSRZIzrnHbKBaRP6DbUKTNhGBSVkubr415K jeAJaiYRsgUATliGDmTA5tGkvEYupFzxZEpzAhbOEwZ7pKUJ7j5hT7CGm5xJ2gPBvp3F 1ac7ZYgfamEoJ9qEYtnpk6L7BW8mIZ4vEvOhkp6aOr8TOI4LYlvSAs2ajbjcQgLBZ6bx tRlw== X-Gm-Message-State: AOAM531qa+AzfQjZ0Bp7mS0IP39RJc4869LghnHZaVr0N84kb2YagliZ o2IqFJZZiBpsfINDfMVt7kP0JmrLIlA= X-Google-Smtp-Source: ABdhPJzbd2eTV1emu8G+RoQFFPQd7QltAAzyYiFhxKt1JjS4zDonmaVLlqb+rGPqSp7qAUVj7M1vAg== X-Received: by 2002:a17:90a:bc98:: with SMTP id x24mr5467172pjr.63.1594922284782; Thu, 16 Jul 2020 10:58:04 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:04 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 14/17] coresight: Add default sink selection to CoreSight base Date: Thu, 16 Jul 2020 11:57:43 -0600 Message-Id: <20200716175746.3338735-15-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135807_087535_44E2A387 X-CRM114-Status: GOOD ( 27.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1043 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Mike Leach Adds a method to select a suitable sink connected to a given source. In cases where no sink is defined, the coresight_find_default_sink routine can search from a given source, through the child connections until a suitable sink is found. The suitability is defined in by the sink coresight_dev_subtype on the CoreSight device, and the distance from the source by counting connections. Higher value subtype is preferred - where these are equal, shorter distance from source is used as a tie-break. This allows for default sink to be discovered were none is specified (e.g. perf command line) Signed-off-by: Mike Leach Suggested-by: Suzuki K Poulose Reviewed-by: Leo Yan Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-priv.h | 2 + drivers/hwtracing/coresight/coresight.c | 166 +++++++++++++++++++ include/linux/coresight.h | 3 + 3 files changed, 171 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index 36c943ae94d5..f2dc625ea585 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -150,6 +150,8 @@ int coresight_enable_path(struct list_head *path, u32 mode, void *sink_data); struct coresight_device *coresight_get_sink(struct list_head *path); struct coresight_device *coresight_get_enabled_sink(bool reset); struct coresight_device *coresight_get_sink_by_id(u32 id); +struct coresight_device * +coresight_find_default_sink(struct coresight_device *csdev); struct list_head *coresight_build_path(struct coresight_device *csdev, struct coresight_device *sink); void coresight_release_path(struct list_head *path); diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index f3efbb3b2b4d..e9c90f2de34a 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -769,6 +769,171 @@ void coresight_release_path(struct list_head *path) path = NULL; } +/* 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) +{ + /* sink & correct subtype */ + if (((csdev->type == CORESIGHT_DEV_TYPE_SINK) || + (csdev->type == CORESIGHT_DEV_TYPE_LINKSINK)) && + (csdev->subtype.sink_subtype >= CORESIGHT_DEV_SUBTYPE_SINK_BUFFER)) + return true; + return false; +} + +/** + * coresight_select_best_sink - return the best sink for use as default from + * the two provided. + * + * @sink: current best sink. + * @depth: search depth where current sink was found. + * @new_sink: new sink for comparison with current sink. + * @new_depth: search depth where new sink was found. + * + * Sinks prioritised according to coresight_dev_subtype_sink, with only + * subtypes CORESIGHT_DEV_SUBTYPE_SINK_BUFFER or higher being used. + * + * Where two sinks of equal priority are found, the sink closest to the + * source is used (smallest search depth). + * + * return @new_sink & update @depth if better than @sink, else return @sink. + */ +static struct coresight_device * +coresight_select_best_sink(struct coresight_device *sink, int *depth, + struct coresight_device *new_sink, int new_depth) +{ + bool update = false; + + if (!sink) { + /* first found at this level */ + update = true; + } else if (new_sink->subtype.sink_subtype > + sink->subtype.sink_subtype) { + /* found better sink */ + update = true; + } else if ((new_sink->subtype.sink_subtype == + sink->subtype.sink_subtype) && + (*depth > new_depth)) { + /* found same but closer sink */ + update = true; + } + + if (update) + *depth = new_depth; + return update ? new_sink : sink; +} + +/** + * coresight_find_sink - recursive function to walk trace connections from + * source to find a suitable default sink. + * + * @csdev: source / current device to check. + * @depth: [in] search depth of calling dev, [out] depth of found sink. + * + * This will walk the connection path from a source (ETM) till a suitable + * sink is encountered and return that sink to the original caller. + * + * If current device is a plain sink return that & depth, otherwise recursively + * call child connections looking for a sink. Select best possible using + * coresight_select_best_sink. + * + * return best sink found, or NULL if not found at this node or child nodes. + */ +static struct coresight_device * +coresight_find_sink(struct coresight_device *csdev, int *depth) +{ + int i, curr_depth = *depth + 1, found_depth = 0; + struct coresight_device *found_sink = NULL; + + if (coresight_is_def_sink_type(csdev)) { + found_depth = curr_depth; + found_sink = csdev; + if (csdev->type == CORESIGHT_DEV_TYPE_SINK) + goto return_def_sink; + /* look past LINKSINK for something better */ + } + + /* + * Not a sink we want - or possible child sink may be better. + * recursively explore each port found on this element. + */ + for (i = 0; i < csdev->pdata->nr_outport; i++) { + struct coresight_device *child_dev, *sink = NULL; + int child_depth = curr_depth; + + child_dev = csdev->pdata->conns[i].child_dev; + if (child_dev) + sink = coresight_find_sink(child_dev, &child_depth); + + if (sink) + found_sink = coresight_select_best_sink(found_sink, + &found_depth, + sink, + child_depth); + } + +return_def_sink: + /* return found sink and depth */ + if (found_sink) + *depth = found_depth; + return found_sink; +} + +/** + * coresight_find_default_sink: Find a sink suitable for use as a + * default sink. + * + * @csdev: starting source to find a connected sink. + * + * Walks connections graph looking for a suitable sink to enable for the + * supplied source. Uses CoreSight device subtypes and distance from source + * to select the best sink. + * + * If a sink is found, then the default sink for this device is set and + * will be automatically used in future. + * + * Used in cases where the CoreSight user (perf / sysfs) has not selected a + * sink. + */ +struct coresight_device * +coresight_find_default_sink(struct coresight_device *csdev) +{ + int depth = 0; + + /* look for a default sink if we have not found for this device */ + if (!csdev->def_sink) + csdev->def_sink = coresight_find_sink(csdev, &depth); + return csdev->def_sink; +} + +static int coresight_remove_sink_ref(struct device *dev, void *data) +{ + struct coresight_device *sink = data; + struct coresight_device *source = to_coresight_device(dev); + + if (source->def_sink == sink) + source->def_sink = NULL; + return 0; +} + +/** + * coresight_clear_default_sink: Remove all default sink references to the + * supplied sink. + * + * If supplied device is a sink, then check all the bus devices and clear + * out all the references to this sink from the coresight_device def_sink + * parameter. + * + * @csdev: coresight sink - remove references to this from all sources. + */ +static void coresight_clear_default_sink(struct coresight_device *csdev) +{ + if ((csdev->type == CORESIGHT_DEV_TYPE_SINK) || + (csdev->type == CORESIGHT_DEV_TYPE_LINKSINK)) { + bus_for_each_dev(&coresight_bustype, NULL, csdev, + coresight_remove_sink_ref); + } +} + /** coresight_validate_source - make sure a source has the right credentials * @csdev: the device structure for a source. * @function: the function this was called from. @@ -1358,6 +1523,7 @@ void coresight_unregister(struct coresight_device *csdev) etm_perf_del_symlink_sink(csdev); /* Remove references of that device in the topology */ coresight_remove_conns(csdev); + coresight_clear_default_sink(csdev); coresight_release_platform_data(csdev, csdev->pdata); device_unregister(&csdev->dev); } diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 84dc695e87d4..58fffdecdbfd 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -48,6 +48,7 @@ enum coresight_dev_subtype_sink { CORESIGHT_DEV_SUBTYPE_SINK_NONE, CORESIGHT_DEV_SUBTYPE_SINK_PORT, CORESIGHT_DEV_SUBTYPE_SINK_BUFFER, + CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM, }; enum coresight_dev_subtype_link { @@ -182,6 +183,7 @@ struct coresight_sysfs_link { * happens when a source has been selected and a path is enabled * from source to that sink. * @ea: Device attribute for sink representation under PMU directory. + * @def_sink: cached reference to default sink found for this device. * @ect_dev: Associated cross trigger device. Not part of the trace data * path or connections. * @nr_links: number of sysfs links created to other components from this @@ -200,6 +202,7 @@ struct coresight_device { /* sink specific fields */ bool activated; /* true only if a sink is part of a path */ struct dev_ext_attribute *ea; + struct coresight_device *def_sink; /* cross trigger handling */ struct coresight_device *ect_dev; /* sysfs links between components */ From patchwork Thu Jul 16 17:57:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668247 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39DA9913 for ; Thu, 16 Jul 2020 18:01:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01B4720578 for ; Thu, 16 Jul 2020 18:01:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oSOriS2q"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YTCux+Vp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01B4720578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UxvaVlIsNzKI9TyYgQZy7su3vz3zv9uG4TN4SFBSCGY=; b=oSOriS2qRIEkGJw1JHJvYpbdq lhi2+reN/AXJqr2MWyqE88PzmC4POjL3ty/ptjqeVkfJBset1+/9lS5hF1i32gMqmJrwja0BojTMq 8wg5kT/xPvugHQvW3Gp9GW64TzYVwOPm+TC7wpC4ug99KmwfeqHKB/TANVBSeDprhGx1xycua96M/ Gn2PBYvMGfrRXw+wdNkAiXYa5UqICZB+k6V9LeCKbhmqRay6RT1RBqzB603GAeaFOaZYmv1pllSF5 WW4ztCw9D7c7DU7v5U/Qer4rYA3DQSNDhB8rsTnJTan3mrSz/ypCNhdEqzzE0R5Mql1RRzryu8VvO WQu49yyDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8An-000488-MK; Thu, 16 Jul 2020 17:59:57 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw892-0003Hw-25 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:11 +0000 Received: by mail-pf1-x444.google.com with SMTP id a14so4038295pfi.2 for ; Thu, 16 Jul 2020 10:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1zuc2Jwn7whLMiPkB+y18oQdc+kQ2tGfn27YIBMHRT4=; b=YTCux+VpdNSFBkGPBOZTb+8Cn0dTcPtDau4IOmLy+KQ5ab3daLpiidHq59Ngt3QTe8 yJW9z3D7nDKKjCWm0VQdbSdpbedrhYTQ2Sk7EmgZZTdlqx23SuYSr0doA3BWmxMWnXPv Gg+cJQxPlcM9h6Fb7VjBB2QZsVg4KIO60Sv9BlEfbL03/phbw7aO47AitnLYKIdIcxsS IWIBLL75mTffEfJOBW84KDk1Rtr4vAzGZ1nhY8m6B6SzdO0ype4Mx+Kklzz/4eUb1vtQ AWrJdhif9++rFKkQrqOe4tFuByhEuJ112iqppLu428bwiJhrFFONd3suyrm8sbIFehYw CXbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1zuc2Jwn7whLMiPkB+y18oQdc+kQ2tGfn27YIBMHRT4=; b=X0l3O4nNG1bitTVJU0PKxVBYjwQEz3E9HPU+JrfMIrpVGT6nLyHpPrpa0WQ9Cb0Euu Lw7BWZstih0z9q8iW/DemOeBu1aVs6EuqyDVz6Z4m3w2wQ+HeC58A8ONu6Nm+EGgvBlr j/iINqte5t5vsI13ptJZsN1TgjUcYunbbbWaa1lL5Az3IS3eOSp6ngxY1013yHA+bcOR k7ayaraEwwZJfTdMhI3abLx5TDAUejDeQGrEL7yyq3BKhZcRJZv6zEbfQnUfmmvxoeg6 yCPQqrvyqA/h5GZgVbIhU6BpnHpQigbzgTo7KVmEdHnS75B5D3H/tmsVt2gCXuVKSgnG p2ng== X-Gm-Message-State: AOAM531rzXyBVSHBaCvY2NIm/iDIaKjo4bUjS9s8aOVt0flDO1OA83/U OkWbSf/WTAlbrn8g44m7IoWUIqIwpb4= X-Google-Smtp-Source: ABdhPJzNUBhjFNrzmUMh/7NbKU6k1bX4eugxV9s91yEJmqd82RZfmtGEDjxqx1XiXqnmfSjKY5E/DQ== X-Received: by 2002:a62:d103:: with SMTP id z3mr4353443pfg.317.1594922286045; Thu, 16 Jul 2020 10:58:06 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:05 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 15/17] coresight: tmc: Update sink types for default selection Date: Thu, 16 Jul 2020 11:57:44 -0600 Message-Id: <20200716175746.3338735-16-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135808_200656_05C2EEB8 X-CRM114-Status: GOOD ( 10.51 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Mike Leach An additional sink subtype is added to differentiate ETB/ETF buffer sinks and ETR type system memory sinks. This allows the prioritised selection of default sinks. Signed-off-by: Mike Leach Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index b13ce0daa572..7040d583bed9 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -484,7 +484,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) break; case TMC_CONFIG_TYPE_ETR: desc.type = CORESIGHT_DEV_TYPE_SINK; - desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_BUFFER; + desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM; desc.ops = &tmc_etr_cs_ops; ret = tmc_etr_setup_caps(dev, devid, coresight_get_uci_data(id)); @@ -496,6 +496,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) break; case TMC_CONFIG_TYPE_ETF: desc.type = CORESIGHT_DEV_TYPE_LINKSINK; + desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_BUFFER; desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_FIFO; desc.ops = &tmc_etf_cs_ops; dev_list = &etf_devs; From patchwork Thu Jul 16 17:57:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21F12722 for ; Thu, 16 Jul 2020 18:05:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAF0F2070E for ; Thu, 16 Jul 2020 18:05:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WMhPPzkl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OmeYpK0w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAF0F2070E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cvQfG6DhXQODUIYcw4z/WdaXtNr9QnbozM6i2CzFMCQ=; b=WMhPPzklZhc0RmPY8F9WQXjc+ F0ipdhwarBIuSWptIkYtSvMrsGjbJSRC6GCoa4C4TzOMpQ0GdMdAwnhrQc7sS7K4X1FkNElvMxw62 5wm6ayraa9c0dLmyJMLi20SUWOovceTv4tnMwW24aHE4Jqeaw7GPePYWlGjCwccB52z0ZtPK02ZKL MOOUHrlw8xK/EftJXxqGiC9IFMdykoisJo8KvSGII5VhppNHoyLWieMnupo2xU+E6QUsubkcNshmS zDqntTcfKGvLtrFWGaXyrWCIZdUuPy4S52GIMiJCEMgsXbpWkzd6LRSRfSbFuLTUE2S479Mrf2rlO UABgknFcw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8Az-0004Fz-5R; Thu, 16 Jul 2020 18:00:09 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw893-0003IP-2V for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:12 +0000 Received: by mail-pj1-x1043.google.com with SMTP id t15so5039566pjq.5 for ; Thu, 16 Jul 2020 10:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8T+MoLWAP8/J+zNBYiFvQYBlIRTzpOrL1hDOxZpt034=; b=OmeYpK0wSp0IFqrdJgKfLsdkXvybR+tUuAW3Ire4TxeWBpW9CT4FjZnTK9Puhq6Xvu Q8EuNjPDQuQr98GHBA8a78I8h9vAZFn0bpLI4C5Bk2ACA8nepwkYSgjf+jfm4MIVI7cr w3YG7bi00yHdhSFJCNznHnoaa/NhDRAR0JBUrMQvhsw+9z34LTWGRd+58O7ZRyE91etE jbBnd/mLC2+oWOJz83U0+7F5bVjVovttRTZKJwSsjxCxbeIO/0lhVhOvbx835Gmv5acn Taa5TVvhK3xqpyCba/f/fl/7csRrfIL4l9IkQR6IXeW2syAx63IfkSCoBYkoJHy9u1JV Up9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8T+MoLWAP8/J+zNBYiFvQYBlIRTzpOrL1hDOxZpt034=; b=VxCqssCLp+iupxTVl/T9NPu+j6XWAl/4EaPBztP+cxIzIGEf5LycXF/0UhFOqiylr7 auwIxhyvzDpxOjXLMSbONm3m6DdE0OjYjbyR3nlHS9yHVqUiQ3ZN6E9klAinqVOJj1SX i4KrQ0UFIM2zc+tutfea0z+0DEvycBt/VXgYODWvW6vnmwGpue6pzSh2kVM0iWcCOwsJ kZ9qetRLzHNQw6O4TQMeoHjpWNqmE1i89dg97z3yu2OWosB49K/3nYbsPKBqHxM/Oc6T isansBYCDfsNEFC7EOXdd+JPyAsFhex9p5T2rM/1EjZSS+heeUmQz6ZFG57+m3wC+zY+ 5fxA== X-Gm-Message-State: AOAM531Bhweyw+2XnSRGrhxDaadO2MYv+Z6EuJ63pA64jqaByWjLu+j/ NjyLVBY31Tb1LSTBBV7Wmym8hndW7UM= X-Google-Smtp-Source: ABdhPJwALAlq+NgQmA/wEgmqCSfxdGZeSnPppHL2l/Ly5LKyG9SeX/n8LcyhLuDBQBtqqtfH2Gu8jQ== X-Received: by 2002:a17:90a:1b2c:: with SMTP id q41mr6107469pjq.195.1594922287194; Thu, 16 Jul 2020 10:58:07 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:06 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 16/17] coresight: etm: perf: Add default sink selection to etm perf Date: Thu, 16 Jul 2020 11:57:45 -0600 Message-Id: <20200716175746.3338735-17-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135809_267602_6D7FD869 X-CRM114-Status: GOOD ( 15.23 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1043 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Mike Leach Add default sink selection to the perf trace handling in the etm driver. Uses the select default sink infrastructure to select a sink for the perf session, if no other sink is specified. Signed-off-by: Mike Leach Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- .../hwtracing/coresight/coresight-etm-perf.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 84f1dcb69827..1a3169e69bb1 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -226,9 +226,6 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, sink = coresight_get_enabled_sink(true); } - if (!sink) - goto err; - mask = &event_data->mask; /* @@ -253,6 +250,16 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, continue; } + /* + * No sink provided - look for a default sink for one of the + * devices. At present we only support topology where all CPUs + * use the same sink [N:1], so only need to find one sink. The + * coresight_build_path later will remove any CPU that does not + * attach to the sink, or if we have not found a sink. + */ + if (!sink) + sink = coresight_find_default_sink(csdev); + /* * Building a path doesn't enable it, it simply builds a * list of devices from source to sink that can be @@ -267,6 +274,10 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, *etm_event_cpu_path_ptr(event_data, cpu) = path; } + /* no sink found for any CPU - cannot trace */ + if (!sink) + goto err; + /* If we don't have any CPUs ready for tracing, abort */ cpu = cpumask_first(mask); if (cpu >= nr_cpu_ids) From patchwork Thu Jul 16 17:57:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668257 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A19D617C5 for ; Thu, 16 Jul 2020 18:05:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 724352070E for ; Thu, 16 Jul 2020 18:05:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d7KSFvao"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n+xtw+U8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 724352070E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3yJgXMo1ecTngqQ8DuiE6SfPV6+SJhq/jsWjWVvfXog=; b=d7KSFvaoeoI1HsXvxY07PhlfO 1NH5mDoxUnhlSkF374W/fDeW4uEkBdhEYcjHobp141OP/rUdFh5sDVQeBhKSH7vl1/Va9ZF7THtYC ec69jQIZTrXLELTwraY5gxPnPk7B727375HTjIYDYv9bkjde35QULIXAkvBmCPBnQzVQHbfvkjgmw pA344bRr3RmtP3pDKszkzrdrAeUc//nFpO/dUKH0tlWOv6+hkuiz3KdjamCxndD7jDrvROK0ewz0V bFO99tOimJvJ8RII8tAFYMH6AG2u/3FO0aQAh5BGEuyKVKnmszup4JnhTxPdkd1Tew9I0Vyb0O1nN U7Dcb4V9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8BK-0004VA-Nf; Thu, 16 Jul 2020 18:00:30 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw894-0003Iu-7V for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:13 +0000 Received: by mail-pg1-x543.google.com with SMTP id o13so5229783pgf.0 for ; Thu, 16 Jul 2020 10:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U4pO0P/7t2x3XMhQAF12Ntbg1zwFRbA41/6HlrU49KM=; b=n+xtw+U8Q+ljJOBG4f2CisJhYDp+utumcxugE4GXha/wIv7E+tv6gDGUH0B58mGG1+ Btmps1dleZ35BloPER8hd3/1aVlXhbS1Q5SA2A+Ix98T9ZgjixLxT9T84YN1tZ6DaAk8 ZZfo8vedv7K6dBauzu9segHkm+/Vj6+q6ZH6VdSDHjnGv8VpMC6oH4InMI/lBk5yEUJR vCThVYTiOaRveH5vwaMIsX0UBZvGUyW59Oq5csKZfg12RAroE5DZ915CRuZCGjzlqY4x TpJJpGlWdbsudCORPeziUnMeB1SKo/daIQuOmj5/bh3BcYcXMTfQJGkk2h6n5vi+y7wr p4Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U4pO0P/7t2x3XMhQAF12Ntbg1zwFRbA41/6HlrU49KM=; b=XfBwqHnS8UlcXWAR92wn5KaH+I4r//ufKSr43zMZ6Z3fQO69tcVDKGFNkzH8U/SbG8 tt33CIHI3H55UQVZjkssnAj4JcjFq1sXA8UnoiuBddKRsIvGDbnXSRlYMId8qwjUR4w8 B0wPR8yP2qMhpmka6E8WZuL4q8uPayPc+4SLBMzpesl44iO6jayTX/SFmpTw9UnFv0vA jaZIli83blGhsqnKBSYiALZm3MB9XF8XFDOR22NPyOhQS5EcNnaRTwB7g58txYwX9es+ Wu4UagfQd38bZYegq6cGFLUA9BNB6Pe/AlDWvCOJv6hSNtZJ4I336xD+HCTwDuFRyi7B DuCg== X-Gm-Message-State: AOAM533ERsnYWw2cGv4EHYS5S8PL7+TUSZOY8OqK1kPXz3P9CKttx8Y5 trUhxTNKE/hABjJ0PLpSsJWVkA== X-Google-Smtp-Source: ABdhPJxpFrgHN50ogFyNKEUp1pNfg4H8ehNwV4QoFIXVOttjnnobtibo8O/n0umAQwZEf+I3+rLasA== X-Received: by 2002:a62:6446:: with SMTP id y67mr4757651pfb.299.1594922288377; Thu, 16 Jul 2020 10:58:08 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:07 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 17/17] coresight: etm4x: Fix save/restore during cpu idle Date: Thu, 16 Jul 2020 11:57:46 -0600 Message-Id: <20200716175746.3338735-18-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135810_382471_2843B4BB X-CRM114-Status: GOOD ( 12.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Suzuki K Poulose The ETM state save/restore incorrectly reads/writes some of the 64bit registers (e.g, address comparators, vmid/cid comparators etc.) using 32bit accesses. Ensure we use the appropriate width accessors for the registers. Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states") Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 16 ++++++++-------- drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 2d732af8b3e7..6d7d2169bfb2 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1206,8 +1206,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { - state->trcacvr[i] = readl(drvdata->base + TRCACVRn(i)); - state->trcacatr[i] = readl(drvdata->base + TRCACATRn(i)); + state->trcacvr[i] = readq(drvdata->base + TRCACVRn(i)); + state->trcacatr[i] = readq(drvdata->base + TRCACATRn(i)); } /* @@ -1218,10 +1218,10 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) */ for (i = 0; i < drvdata->numcidc; i++) - state->trccidcvr[i] = readl(drvdata->base + TRCCIDCVRn(i)); + state->trccidcvr[i] = readq(drvdata->base + TRCCIDCVRn(i)); for (i = 0; i < drvdata->numvmidc; i++) - state->trcvmidcvr[i] = readl(drvdata->base + TRCVMIDCVRn(i)); + state->trcvmidcvr[i] = readq(drvdata->base + TRCVMIDCVRn(i)); state->trccidcctlr0 = readl(drvdata->base + TRCCIDCCTLR0); state->trccidcctlr1 = readl(drvdata->base + TRCCIDCCTLR1); @@ -1319,18 +1319,18 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { - writel_relaxed(state->trcacvr[i], + writeq_relaxed(state->trcacvr[i], drvdata->base + TRCACVRn(i)); - writel_relaxed(state->trcacatr[i], + writeq_relaxed(state->trcacatr[i], drvdata->base + TRCACATRn(i)); } for (i = 0; i < drvdata->numcidc; i++) - writel_relaxed(state->trccidcvr[i], + writeq_relaxed(state->trccidcvr[i], drvdata->base + TRCCIDCVRn(i)); for (i = 0; i < drvdata->numvmidc; i++) - writel_relaxed(state->trcvmidcvr[i], + writeq_relaxed(state->trcvmidcvr[i], drvdata->base + TRCVMIDCVRn(i)); writel_relaxed(state->trccidcctlr0, drvdata->base + TRCCIDCCTLR0); diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 7da022e87218..b8283e1d6d88 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -334,7 +334,7 @@ struct etmv4_save_state { u64 trcacvr[ETM_MAX_SINGLE_ADDR_CMP]; u64 trcacatr[ETM_MAX_SINGLE_ADDR_CMP]; u64 trccidcvr[ETMv4_MAX_CTXID_CMP]; - u32 trcvmidcvr[ETM_MAX_VMID_CMP]; + u64 trcvmidcvr[ETM_MAX_VMID_CMP]; u32 trccidcctlr0; u32 trccidcctlr1; u32 trcvmidcctlr0;