From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 4801B3BCD24 for ; Wed, 10 Jun 2026 09:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.208.41 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781085367; cv=pass; b=Fec5dh1N5He5skWX/GviOACrZ8ViYEzKtKeZcCrP10QDNc1R0pPLjNFENtHeei0EY3aElhOrKbq/bQRvkOBLz2VT/iA/KjkNiSS2FDQSjy2Pn6jnIp5NE1AXXxSdBC2OmbXRWVySSMO9xvKcw3aK1wVg7yIlnSrJ68f5kOvy8Qc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781085367; c=relaxed/simple; bh=hZNp1wzl7aMol0obQLeujStExhwYmp321tYBENr5gfk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZB4fSYT1FinuGGU/47QFk67l+4nzyv0qTluDZchXJ0ZgbizlVCD7adAgvs+lQf/xArjk1PkFgtFgQ+RGXmcYQiabG/mY9UtQiXnQtUFJW6LxlYLvW7aAiuOtDJQtIiW1QnNTuoDT7BT0qKt9B6/IX1/dVl03GNDhiUFhbkPrqrA= ARC-Authentication-Results:i=2; 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=LJyl9nYe; arc=pass smtp.client-ip=209.85.208.41 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="LJyl9nYe" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-68c1630159bso7441081a12.2 for ; Wed, 10 Jun 2026 02:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781085365; cv=none; d=google.com; s=arc-20240605; b=Kw61F/RXE/Y5MthbxWY1JPhHtusUbcYG8jsm8PUowg/sNBOTsDGaMBMZuPFD+Cu4o/ +dyXronFHekpx2KGOF/iMHWYFh1UJ+AZHcuFbnv9mRn8DKi7DiDo/WJgakdxDsE164I3 gGcaJAm+w1Vph4fMqRAhl5YFx44V/9FZK7qjZ+ziZnyMNya97ipTYdBoA1HmOIxthzGH qkeCP23Yh6o8ZOG7bCJQNkTF87CY8sA9jbplNZOA3oWmTX1CgpjmvRfViqV+p41wmi+J ksNmrw0Ld5cYec3pI3qXwoQIb6348DHUCt2V6jSpQTS2oEq5LjFVp55PG/7i0dCS4waZ c5Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=CmlGB8tR+Cv/jqDrTQc1t9bnzwkfYB6t+ePs6hjw60w=; fh=GiwwFFBOZq3NN0gBHvw7LqftvK7qmB9W+SO0ddzu93g=; b=dDAm++wDoWyg26tGMiKSn3jF0dSPUCzzel8D/ab88SO5s8nJ+BwjMM/7r7oidituuT qWyUu6ZZJIttZmXsJ6CiijPzoz2B17MY/J8eitCSG+3dhvWZ7IB9EqvWh64kGrua7I3M xB44yUc/hWJsh2h+sPE/gAoGqQCAjpVKjAGXChnXLTGMUfIi2OgzDEhAjGZL3PFJZDDh qrI6iWyFzCnXVmc1GqKIRp0TQndeujpXoyrfHkCBHxIsBqb1Y8rCsb35NiMi5pq6coGW B6sNeBKJhSClyBUTPJCATzww01Nn3VCgmho5KDalyBpXAXdjcoyDTGPG4Fivv85nTzfk 36ig==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781085365; x=1781690165; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CmlGB8tR+Cv/jqDrTQc1t9bnzwkfYB6t+ePs6hjw60w=; b=LJyl9nYekUQk8o5/09+acieQM8M72nvIR6T8Iy4gh+Q2qH3MQuqgJIXTS80vqnNYh7 TBWLPZfdCxfHIwqGPf1dI5dDlIkNWLb7QTpkJSEtd3bFJmlSY3xb/TIZGB8sPQQm/Nhv iP/gvzutuRHm7N2/kIjbyFXFnzIEftqpQk2ySUVqQ2kyc9SBXy69jeRAi9xmjkLCSsvO 7Ipdemze8b577dmaOXNj1GH1qoC2NMqAE0OnK2BXwppSR4I23dVCbbc+fPkkLceAXcW3 sX8/G0oIfCnK3aQEBpNxVjt70CwwV+Mimu2tp/SGJ9Oqdvw9Ke9S0JN4gzMd0tBfpZXf nurg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781085365; x=1781690165; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CmlGB8tR+Cv/jqDrTQc1t9bnzwkfYB6t+ePs6hjw60w=; b=hIanESZ466NRXidzFhpkG0ZYS3TCIjloELYxM+JaspfUlnRs3NKhqc5w6u2Wuq7Fw5 x6oKLHWR15UkD0vDdNhzf1xIIeS4V2qgP0wKQuaqjCoHlL+VZlBChOXyETuhzYYej1yC xoRE8/KJ3EaOg1Ai7PQfGoBLc7YuFgE1ocsAdKU4ZuQCpRQZIkB/NVILt0YIAh1iGg2D oOUf7+GcsVBqhWxI1Vhd7dfhi48QaIikw0bKXNmMqHdPjdnswL6eJXo3zsJt3dHcCai+ NvXlrvvEd+lQf/sjIfgFzFL+Z9fvhj4pEH23sDM9wGTT325giPf90B7x7nzt1id6EA2z 2Ypw== X-Forwarded-Encrypted: i=1; AFNElJ+JCtNkjjJRYqJUig1xxtf8J9NcLjGplhfp/kgBo2NKA+YIYRpuBQRpi7AGVGkCFA2R5cdHoaBsbS8rKWs=@vger.kernel.org X-Gm-Message-State: AOJu0YwOGskUXZ/RWeWKbl+OfOM2pHbnQuwu4ayCJC3z/MOr6fW+TWn8 n4ruLqCdFNsFvug+WV0wSqOUye89R4EcrHWGrWAD6QSVgEAknlC/M/uvkEcyfHZ6CmiCg9902mo zT+24GtBc7y2/YKb5pJAoyfR0/3s8FxvWEWCXDaSjig== X-Gm-Gg: Acq92OEK1dYWlCixYxzfHwHeMwh3FmUOqFUoW75r4UKyG5AF0lbqzkAwBmbA/wmD6p1 ys2tSw/eMzcJMO/OGfoUpg7j7P8sIboVjStLjvK0JBhkU7RJNX8POPkdIrdOpMhnN59Z1l85IhB d3D9Sf0xq4wJX6PXNHdHBqEwEDOIDluJszqQvdCntP51gN5Tnlg6TsYHjLtkAYCHVktpI55J3uG BTvJFV8lecx641Qf+4MziE+fVwKv5zKQGTvEMwif5TLvT1bkJVwBQtjkcMyzGzRfbUt40rzD2QR wPtdA6X9uaDAhwpKETlw8vyNbthafr0B26d4f4jv7L5+cY7A415l X-Received: by 2002:a05:6402:26ca:b0:68e:66da:c39c with SMTP id 4fb4d7f45d1cf-68fa52595a9mr11429014a12.24.1781085364631; Wed, 10 Jun 2026 02:56:04 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260605-exynos-pmu-cpuhp-idle-fixes-v1-0-0cd05c81a82d@linaro.org> <20260605-exynos-pmu-cpuhp-idle-fixes-v1-1-0cd05c81a82d@linaro.org> In-Reply-To: <20260605-exynos-pmu-cpuhp-idle-fixes-v1-1-0cd05c81a82d@linaro.org> From: Peter Griffin Date: Wed, 10 Jun 2026 10:55:51 +0100 X-Gm-Features: AVVi8Cefu1n2MWDEUi6aR9N7alNw0lKukQb9HTmuDkQk8K2PjK6RnQfXSI6M9T4 Message-ID: Subject: Re: [PATCH 1/3] soc: samsung: exynos-pmu: use target cpu ID in hotplug callbacks To: Alexey Klimov Cc: Krzysztof Kozlowski , Alim Akhtar , Sam Protsenko , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sashiko Content-Type: text/plain; charset="UTF-8" Hi Alexey, Thanks for your patch. On Fri, 5 Jun 2026 at 21:19, Alexey Klimov wrote: > > The CPU hotplug state callbacks __gs101_cpu_pmu_online() and > __gs101_cpu_pmu_offline() currently partially use smp_processor_id() to > determine the target register offset for the CPU inform hints. This may > be fine for cpuidle flow but broken for cpu hotplug where the target > cpu is passed as an argument and could be different from cpu where > that is executing (e.g. CPU 0 offlining CPU 1), meaning that > smp_processor_id() returns the id of local CPU but hotplug flow > deals with another CPU core undergoing the transition. This was intentional. The powermode hint is always programmed based on the currently executing CPU core in the gs101 downstream code (for both CPU Idle and CPU hotplug paths). See https://android.googlesource.com/kernel/google-modules/raviole-device/+/refs/heads/android-gs-raviole-mainline/drivers/soc/google/cal-if/pmucal_powermode.c#15 and the pmu_intr_gen is done based on the actual CPU being enabled/disabled. It's possible Exynos850 requires something different. I suggest checking the equivalent function in the e850 downstream kernel. > > This causes the pmu driver to write power down and power on configuration > hints to the wrong hardware registers, messing up the power state of active > cores and failing to configure the target core. Fix this by removing the > cpuhint variable entirely and utilizing the target 'cpu' argument passed > to the callbacks by the hotplug core infrastructure. Unfortunately I think you're introducing the bug you describe with this patch. regards, Peter > > Reported-by: Sashiko > Closes: https://sashiko.dev/#/patchset/20260513-exynos850-cpuhotplug-v4-0-54fec5f65362@linaro.org?part=3 > Fixes: 598995027b91 ("soc: samsung: exynos-pmu: enable CPU hotplug support for gs101") > Cc: stable@vger.kernel.org > Signed-off-by: Alexey Klimov > --- > drivers/soc/samsung/exynos-pmu.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c > index d58376c38179..6e635872247a 100644 > --- a/drivers/soc/samsung/exynos-pmu.c > +++ b/drivers/soc/samsung/exynos-pmu.c > @@ -235,11 +235,10 @@ EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap_by_phandle); > static int __gs101_cpu_pmu_online(unsigned int cpu) > __must_hold(&pmu_context->cpupm_lock) > { > - unsigned int cpuhint = smp_processor_id(); > u32 reg, mask; > > /* clear cpu inform hint */ > - regmap_write(pmu_context->pmureg, GS101_CPU_INFORM(cpuhint), > + regmap_write(pmu_context->pmureg, GS101_CPU_INFORM(cpu), > CPU_INFORM_CLEAR); > > mask = BIT(cpu); > @@ -296,12 +295,10 @@ static int gs101_cpuhp_pmu_online(unsigned int cpu) > static int __gs101_cpu_pmu_offline(unsigned int cpu) > __must_hold(&pmu_context->cpupm_lock) > { > - unsigned int cpuhint = smp_processor_id(); > u32 reg, mask; > > /* set cpu inform hint */ > - regmap_write(pmu_context->pmureg, GS101_CPU_INFORM(cpuhint), > - CPU_INFORM_C2); > + regmap_write(pmu_context->pmureg, GS101_CPU_INFORM(cpu), CPU_INFORM_C2); > > mask = BIT(cpu); > regmap_update_bits(pmu_context->pmuintrgen, GS101_GRP2_INTR_BID_ENABLE, > > -- > 2.51.0 >