From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C8F73E717F for ; Fri, 1 May 2026 16:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777653886; cv=none; b=TbvIb7VgjapMMQDRynEoKbRFXOWgCeCnNuoFmXJdF77iC+CaA3ItY03+nzV5NC3J/X9YdOGjguFp4wxyT0uooVApguoUs1DHvI2C2PtBg9yW9Ovcic9OUOqv5b2Pc0+iJ/KLyiu/XGI0XSRuc6pmYy6853W0MuIAwrxTQIjNyDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777653886; c=relaxed/simple; bh=cFWWhwoS5kUugop5s2E2Y27sXXbdSB+Fv+uFBsCdyGA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bHUW5MnSfiKaztEfdPgsM+bGvdFdirfbX+juUVtLOMHNk3mZARjomGsZmYYNTYYeFkAu14vwh2m73HriaaZQQYk3N6IVZTZi7TAV4yV+MZ656aZcZ+Q4no/JYnwVUXas4i9nvbbTwmWBpZUyziCXJ/02Z3VolCD8ND9q7kHYyR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VaYJDyB5; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VaYJDyB5" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4838c15e3cbso17498025e9.3 for ; Fri, 01 May 2026 09:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777653879; x=1778258679; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YFKgnGVpgDshMV7VC8MHuBkzlplZIxMD8nfPKak4+2c=; b=VaYJDyB53SNxzlhv9XUFKDf2F+5gDTrM3oH2LVI0ODc+HJnDrFwpQf2jgCyJVtpk2v xD+vua2XGSEEOzEFLupNeE9V6ZiOYnY4q6QQ1QUZKCb63EkcSEORwRVVO1BgxeuGS3Pw mUVrIGDMLKg8082HRuAtWK5iYhj9W0l0k5HgxevQfBUzL3eqtHChiotaXMi3H0OPJShI Z/cMfm3yskt5Rqi6a2YoSY5Blz4WAm61bCurWgQoEM+7UxBqQlPNANfhznDkeq0JlIMf 5E+lX4BPly3H6Zgd+X286PEyH0Um/+8BZPaSTNXmYl07mRNRacPPou2J2v3hZacAMXo4 OPkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777653879; x=1778258679; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YFKgnGVpgDshMV7VC8MHuBkzlplZIxMD8nfPKak4+2c=; b=AqDlHcOOaGT6eMYiCcQHn4wr4UerwUJe9TZCat6NH8ht9rXjw2OQ0geuyvw0Tg48tm shqH1MaSAkQrFjYv5FwFg/UcTqhSlqED4wXRAFmMUCn/gZIKSnAV13lDq+7It5nZqKWv F/HDswJz3XLtrcFhryA1rKffYk/NnaU6UmeGdFXB7MN8ADPVvt75iRuwJkW4OFTJY9Su G1ABl6Hu+6BHmyuo7vb/JvYyrpXtIjka9Q7uoyQmwTabFRTHqlMH2TxDV9uJb9/s6THR /tN1uuQ0ehhoIzglzbRbuymbiDvm/yNKBfy0mArWEcjVPHhhNiPEAJMPyfVZpWyUHE11 sqLw== X-Forwarded-Encrypted: i=1; AFNElJ9YvKzOM39VZSj3OMDdYoel1p4Y6C8oL3Iii0zkawCDUnWpo7zHs4BkeqoaJmHzWYxCaKi7T+N+bDjmh+I=@vger.kernel.org X-Gm-Message-State: AOJu0YzBnWaMTvyj3LYtSBiKf/aFKvT4ffaE3+87NeojRgSE958R34ok G7fTVBF59MwwAKoFNRp6/WPVfW+yIal5/8KUrxmuLO38eFRhmN8tlGae4Ijdm1VykK4= X-Gm-Gg: AeBDievCifeBfVUT5nFsom2gBrUQna2r7Yq9d2kHxQdmxmFIdEn4XzXuuZl8EdRN2AT C7goyPKcv5XMQCCaU46+CnlLOYmrnuOHtf9gpgMiH9MUKJ+cx1LihDQNSTXYDkIiC2jzVz1t0ti /r6Bfj3ssYqFsbMWXVPYU235p+Z6/V7ZPFaC3tsz4/oakjUyUatCkIqcdtDc7kC+f4YPfTBmPLp I/xAbrKmo0gIdP9gJ8a67lyn44W7UceX6M5/hP/p9Mz/i21DSs4bOTKZSqkkS9um+DJ60V/VaHy itD+ZWO+oLzn6cNpRpPQPy0gv1yS+ExvM7+WVo3O004lt2gowP3tFoaNq8ItAAYsLRUW5FCf4GN FoGtVObnnhiuhqgy9c+kY7IzVSLFFY84CNN8gwpRYyL/iBFkGoVUAguSHLO2sKmEYLS1oWR3e4i 1KDbgBnFIY9qbvNWQEGi0bABebGNnrGdAoQgca+8k= X-Received: by 2002:a05:600c:3e87:b0:48a:58ae:9938 with SMTP id 5b1f17b1804b1-48a8eb991c7mr59860665e9.19.1777653878734; Fri, 01 May 2026 09:44:38 -0700 (PDT) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8feec2b6sm16014105e9.25.2026.05.01.09.44.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 May 2026 09:44:38 -0700 (PDT) Message-ID: <700f09c7-c9a5-42e2-b9f9-31f9f703890a@linaro.org> Date: Fri, 1 May 2026 17:44:36 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] coresight: ete: Always save state on power down To: Leo Yan , Suzuki K Poulose Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mike Leach , Alexander Shishkin , Mathieu Poirier References: <20260428-james-cs-ete-pm_save_enable-v1-0-c7a90ca6f43b@linaro.org> <20260428-james-cs-ete-pm_save_enable-v1-1-c7a90ca6f43b@linaro.org> <20260501135053.GA2674113@e132581.arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20260501135053.GA2674113@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 01/05/2026 2:50 pm, Leo Yan wrote: > On Fri, May 01, 2026 at 10:43:09AM +0100, James Clark wrote: > > [...] > >>>> +static int etm4_init_pm_save(struct device *dev, struct >>>> etmv4_drvdata *drvdata) >>>> +{ >>>> +    if (etm4x_is_ete(drvdata)) { >>>> +        /* >>>> +         * Always do PM save for ETE. It always uses system registers >>>> +         * which will be lost on CPU power down. >>>> +         */ >>>> +        pm_save_enable = PARAM_PM_SAVE_SELF_HOSTED; >>> >>> Should we do this instead based on if the ETM/ETE is accessed via sys >>> instructions ? That would cover all implementations? >>> >>> >>> Suzuki >>> >> >> I did discuss that with Leo but we thought it might be a riskier change as >> ETM is older and nobody has reported any issues, and there is already the DT >> option to fix it that way. Turning it on by default could cause some >> performance regressions. Although it's only if the ETM is in use, so the >> impact is minimal. >> >> In reality it probably does make sense as it's highly unlikely that sysreg >> ETM wouldn't need saving, so it might make some platforms with misconfigured >> DTs more stable. >> >> I can send another version if you think it makes sense, what do you think >> Leo? > > If extend a bit for ACPI context, it is fine for save / restore based on > sys reg implemenation. This is most nature way for support ACPI? > > We can limit "arm,coresight-loses-context-with-cpu" for only ETM + > MMIO mode. > Does that end up looking something like this? ETE is always !MMIO so we don't need to check for it explicitly: /* * Force PM save for ACPI as it has no way to enable it, and for * sysreg based ETMs (and ETE which is always sysreg) because they are * likely to lose state. */ if (!init_arg->csa->io_mem || is_acpi_device_node(fwnode)) pm_save_enable = PARAM_PM_SAVE_SELF_HOSTED; > BTW, when respin, could you consider the approach for not changing > pm_save_enable. We simply take it as a global parameter, and calculate PM > mode for each CPU. But it is not necessary to write the PM mode back to > pm_save_enable. > > Thanks, > Leo Yep will do.