From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 802B423392A for ; Fri, 17 Jul 2026 00:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784249493; cv=none; b=Qni17aBq3pkBFKHodcDn3shbq9MiSgryWzISPWTUhNzKDcXPKLgzbW16/EpsZtDBKyzrXYNN7swBqZdT4/klR3DrwAHlLURaDO9chamx0Re7ajjA0lX2mvf+xe47tTJb7XqZgUblcg74bfno4Y8YcSlZizOR78ym4IQH57PcpEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784249493; c=relaxed/simple; bh=nxsIxaColH4FU/6dYR5y44KYHvc+YgtvMDtw8tDXb9w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NoPn9NNjLzxTV9o0bC+WZsNdGxnnYyd5qUDwri04ff1mbOQv5RyPy0N2lP7Gf7ah/5lBdu03AVl6UbQCehuhLiqGIuF2WU4kOsVoCSTKVMqKIk9NxNJ8HOCYMypa0vQT00+SO5wu9/W6tw7rLN22dbb0LDJBEvxK1fKrzAvoyYo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=eNHVwnj0; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=hZnl1V/A; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eNHVwnj0"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="hZnl1V/A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784249490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A4gq93nDWMHOeVQGnXcHpqoGzD9LIBQdwZhTDM+lfGk=; b=eNHVwnj0W+zMikl0KVO47LasEJy6+X5luZkJ4nI0BkdPQBCYHlGqzx6sczqO0H1kf2MzlA MDLuI9L7boyWNp9ur/GIPwvN+rdzhlYn+ywEtql4h51kc1C9xn+mBues/mPmM1EcmxAlYX ehFQm+ptke9vbz2MlMYkLomdcj5DkSE= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-530-jESKu1K0N7OFXm3ng2p_0w-1; Thu, 16 Jul 2026 20:51:27 -0400 X-MC-Unique: jESKu1K0N7OFXm3ng2p_0w-1 X-Mimecast-MFC-AGG-ID: jESKu1K0N7OFXm3ng2p_0w_1784249486 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2cce870a060so129814205ad.2 for ; Thu, 16 Jul 2026 17:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784249486; x=1784854286; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=A4gq93nDWMHOeVQGnXcHpqoGzD9LIBQdwZhTDM+lfGk=; b=hZnl1V/AMxtVWPohXsZN8YC8BPFZc8uxCF2/+LkbgCGo97+E7PsTDLBP7KWwczg5VK 7hX5xLRGaPXitte4J7ORauJCAlp9iizpthz+YAL1DtaCLZNNXNhazq8aAD19Ku1h32AG 8ioJIddTzyMUi44GcgqqDnA3UBAIoPmnS1XnZTw6zhECxnurEhopjMuYx3twCZeBxMsm X2DFVzobdrSL8vTQ+RiSx1cyaExXiT6w+KH+Fd5BzXjlIUzET3GxVy7RD10HWMr/liuV 7e623pO0BaHHmuLHSp0b8CUfIsP+JwPdZSLFEi+xlhniR1zHRxo5XanEZscqXVGb9r76 j18w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784249486; x=1784854286; h=content-transfer-encoding:content-type: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:content-type; bh=A4gq93nDWMHOeVQGnXcHpqoGzD9LIBQdwZhTDM+lfGk=; b=T0x8eRxaorDDJARBZ8YxB+a4fiRsw8NUnDRbp8N4rmmq+qMk37mJl6MwTuub8yV3vf 5g3AtuZPw50dNtPNigXN5CNUp1QY/ihhbCb8ZEnDZVGAJG6BtMZs3Ei23TzqU+9pcuDo V8L9h7E3HcT0PWBKvq/QwvULVGKlBSPNbZL7jqPtlQNP+n80O/eZSaASI3cXBrFuSANN JXqwg7uHCRiqaCjFoWOeRSqRMyNl9sflE5PJ9ACupQvPjNoBnNgQ4Iybx11cI8iIAsjX ysdSeugoIQjVn2P6hnvvd4YOkej12vXRBlKz/QK1JypcPLyEuowQu/+rNV6r1Cjh+qQn btuQ== X-Forwarded-Encrypted: i=1; AHgh+RrMpgKUkBAFMUtVZELlabKM4mze63WuPu+GxHlKmTkyStuGs00H/iNS3xlHyexROZ+H9F8hxX/Og2Ll8uo=@vger.kernel.org X-Gm-Message-State: AOJu0YyTbvehyucR99zTW+AHqt+gObbWHxx99NYR0aADXC9GBHzYl2Ay bute0mEAkIVgLClg1+cS/NXKKJ9V7/3FKvCOKvZuxBrXF9iKzGOE+vIrxJstc3JPcNSXhtwtRkD k1Y6acG9qnY4WZaAAcklYxfn5w+eDkzZrg9Skqp9pcBsnBxiPDxGW9gEJrXXLJ1XO/r5JH2ZeKQ == X-Gm-Gg: AfdE7ck2RkuCMjKHcxpMRym98MBq32RvntsC8+G4/Eg434CF1vOMxcZxUomDctNOOPR AEiKq9RAKSB3c5/3v4MpZhWymLgCqy6mkD36nVPToQN3uRN3J/EJ+AbHBJT9l4pnp0dejRps4GH 49edp9N1kav94tuQczCi/4eiwG3UzsmXu4dCPZ0uUHNcyz9d/njFqeXBgjy5megBjsaPclACyNr AQdbYgk1n7s5G+D4hruBBwHRDcywyaKSguNkHB86wXk+1krY5uiC/KEqH9mnXRF1/lE7TqS8FzE eCKNpdIll4yQnSod7p9Fq0Q3lTHPeXyK7rHUBdtbWaJft4veAj/kn5S1VY5jbJ4nhoJtwOPPXEE HxPmYp/Y8kM6ou4i+TlXNszBbnnkcShp9tay9Oqw+WhA= X-Received: by 2002:a17:902:d588:b0:2c9:e86e:a9f5 with SMTP id d9443c01a7336-2cf348669c4mr4415485ad.18.1784249486441; Thu, 16 Jul 2026 17:51:26 -0700 (PDT) X-Received: by 2002:a17:902:d588:b0:2c9:e86e:a9f5 with SMTP id d9443c01a7336-2cf348669c4mr4415235ad.18.1784249486009; Thu, 16 Jul 2026 17:51:26 -0700 (PDT) Received: from [192.168.68.51] (n175-34-8-244.mrk21.qld.optusnet.com.au. [175.34.8.244]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13cd428b2d3sm13233307c88.5.2026.07.16.17.51.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Jul 2026 17:51:24 -0700 (PDT) Message-ID: <589790ee-d5b3-4460-99e0-003ef9903dcd@redhat.com> Date: Fri, 17 Jul 2026 10:51:18 +1000 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 v1 02/11] arm_mpam: Restore the error interrupt enable from mpam_cpu_online() To: Ben Horgan Cc: james.morse@arm.com, reinette.chatre@intel.com, fenghuay@nvidia.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dave.martin@arm.com, andre.przywara@arm.com References: <20260710115546.29644-1-ben.horgan@arm.com> <20260710115546.29644-3-ben.horgan@arm.com> <519cddd8-d67a-4aef-afdf-97c933b73f82@redhat.com> Content-Language: en-US From: Gavin Shan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Ben, On 7/16/26 6:59 PM, Ben Horgan wrote: > On 7/16/26 04:59, Gavin Shan wrote: >> On 7/10/26 9:55 PM, Ben Horgan wrote: >>> When all CPUs affine to an MSC are offline the MSC may lose register state >>> which the driver then restores when an affine CPU comes back online. The >>> error interrupt enable, MPAMF_ECR.INTEN, is missed. >>> >>> Restore MPAMF_ECR at CPU online. >>> >>> Fixes: 49aa621c4dca ("arm_mpam: Register and enable IRQs") >>> Signed-off-by: Ben Horgan >>> --- >>>   drivers/resctrl/mpam_devices.c | 8 +++++++- >>>   1 file changed, 7 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c >>> index 82966ca2a631..acfa9a4dc2fc 100644 >>> --- a/drivers/resctrl/mpam_devices.c >>> +++ b/drivers/resctrl/mpam_devices.c >>> @@ -1852,8 +1852,14 @@ static int mpam_cpu_online(unsigned int cpu) >>>           if (msc->reenable_error_ppi) >>>               _enable_percpu_irq(&msc->reenable_error_ppi); >>>   -        if (atomic_fetch_inc(&msc->online_refs) == 0) >>> +        if (atomic_fetch_inc(&msc->online_refs) == 0) { >>> +            mutex_lock(&msc->error_irq_lock); >>> +            if (msc->error_irq_hw_enabled) >>> +                mpam_touch_msc(msc, mpam_enable_msc_ecr, msc); >>> +            mutex_unlock(&msc->error_irq_lock); >>> + >>>               mpam_reprogram_msc(msc); >>> +        } >>>       } >>> >> >> I don't understand how this happened that MPAMF_ECR gets lost, but msc->error_irq_hw_enabled >> is kept as true. mpam_disable_msc_ecr() is triggered in __mpam_irq_handler() or mpam_unregister_irqs(). >> Both are related to mpam_broken_work, which is invoked to disable the driver completely. >> I don't see how MPAMF_ECR is cleared at CPU offline time. > > The reasoning is the same as to why mpam_reprogram_msc() is already run here. When all the CPUs > affine to an MSC at a cache are offline then the cache instance and so the MSC might be switched off > and lose register state. Hence, any registers we rely on need to set when the MSC comes back online. > For PSCI_CPU_SUSPEND this needs to be handled by the firmware and for PSCI_CPU_OFF the driver > handles it. Does that make any more sense? > Ok. You mean PSCI_CPU_OFF on the last associated CPU enforces a power-off on the MSC either? In this case, the commit messages need to be clearer with something below. When all the associated CPUs to an MSC are offline, possibly caused by PSCI_CPU_OFF, the power supply to the MSC can be cut off and all registers, including MPAMF_ECR.INTEN, are lost. Afterwards, we need to explicitly set MPAMF_ECR.INTEN when the first associated CPU becomes online and the power supply to the MSC is recovered. Restore MPAMF_ECR.INTEN in mpam_cpu_online() when the first associated CPU of the MSC becomes online > Thanks, > > Ben > >> >>>       if (mpam_resctrl_enabled) >> Thanks, Gavin