From nobody Thu Dec 18 11:49:18 2025 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 C341223354B for ; Mon, 13 Jan 2025 15:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736781005; cv=none; b=eEDgUK8UxwSou2hm2IhPpryGgoHdJCEbXrNFf/nskI+4ZgZ+nSXWoZ61U4FpMSxA8aveWulv+mtq9qSQ+xDVYEcOXlnULybMwYUY9YL2nw3B5EuL2MVIEtl/dNaYnjhV428nhYdWpH+2I6q3xjhFEv5oB4v+r3aqZlwKwQyh2B8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736781005; c=relaxed/simple; bh=SzXhTZuVHEIWhdoQb/oKfpe2kAA8cdBPJ8+8cpRAW4s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FfxYGHGu5qSQPvocgVOTGp04ZlqZ9Z2FHQ0zALzvFVzzy2ZRrbBuZQ+bRZs/zzF/YYLx5/qmKEruyBtZuyym8xKGVN5u9VlWjgLVqJtQ+Ki8kFSJNrqN4uJShKtNUwtBOmMF4CMwd9ubMYtvz7VcAgu30KgDNMqJiN6yCL6LgCI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=fsDy8FoW; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="fsDy8FoW" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2ee51f8c47dso5932435a91.1 for ; Mon, 13 Jan 2025 07:10:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1736781003; x=1737385803; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u0Hsw5nY2VV2swe5Pr1Kenx+oHMy+b5WI2UUJkVXiSM=; b=fsDy8FoWUWNJaNhfaR+8J9EKlwEdbQGlvRx+J2/cfUrBlWcdJYWsMMbMde0s+yvtny 0vKfjFXVU0I1tgHkToxtuM8HZ92YzTy4EU53j4sGZDN34NpnPkFYRkzFTQoemz3rdz7Z mLDL6t85YIViBkH4fKBP4/OMANtDjs44E6AZwOMCvyV6IKNf0MPRQa1GXqC4XexBDNjB ADiZKMWiM4GTIrlJ7LNPRB4/3zpH6N+hv7zVx0TNi3liAB412JEfZ/khU/bs0FxvGbxU xncYVAQ7ICtzK/CKU2ukLHAeCgu76DbqmrThlHFxatAjAEq/XC2YZ8VLr3XwlWuYSN7c g3eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736781003; x=1737385803; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u0Hsw5nY2VV2swe5Pr1Kenx+oHMy+b5WI2UUJkVXiSM=; b=lkS4Cwj28MaTWRI7faa7CXSdwU+GuDIRrIXcD/+OFtEjD0Pev8tTnnEQDMtcdb54Xk FGk3k7biIYXqbWmNGWxwP7icKRF9emqCtSK2Qs33xyEK2M9Sm+AD5t/LgQZefShjbZnl sfQevBmxbAQEdd9ivMftV6BCLHThZxXVqgb/ecarwyjuZezLHiwN55moe91z1yP9Pj5A bqEk+4wOyXDauHBm8O9alzTOt+CVFNXtDP/wlyDRB8XIByzShGKFurHAgMCqUPdZdPwV AgvDY+4r2Gsc9VO7gur8QqGmUUeic4uOlVUx+3usxx72RpasiFlpt9tKFHO/dcFPnE3e bzTQ== X-Forwarded-Encrypted: i=1; AJvYcCUz9gtasVeWJIlXRvh8jWXeG3kt/UTdQCk76dmCRj8CXB3mH8EkXrRpBmQ5uHXwPCGM0OsXvboTaUX+3SY=@vger.kernel.org X-Gm-Message-State: AOJu0YysSXoxN5BQuEmZiMrgqDtGGNOf560WR54Nojtaw7XcTsbgNDYx tkYjUrCMQ43ZanJuKQ9JWmrtxMX9Mr4ODvprB80q9pvojO8pl10RT82PwU/Zvjw= X-Gm-Gg: ASbGncvVo7qsKCPAWxyx1ubRveKZdgvj4ng+d4yZTwTTD59FnmvJp5TIpz0Di+Mac/6 0iHpt21c+V/xakbhRa1nGKWUJRCb+bpdh5POyLLexPqBTL2mdVcI9dHT9SRmP7lnIrUetJB9o32 xNstaGdlKZpQ1O8nZjbrFP0lpaskzyoj/SQblnPLj6dhS+5AjW1bjCbm4ssXkr04yg3g/Z4kv7R EJYK0dtF6NXhKa7bx6n1tabOePkH6JbarbUXmDjn1fP/Kf+3eiV+u9uXy3lXG0M6Nq07tTd5eRy N5+jeKgeE/EIn7JTz3OEp+UOH+NGLkCs4eI4+a4= X-Google-Smtp-Source: AGHT+IGTnCgi7VgxBHIj1Ps3sJHzHWXt+qnVac4HjO5mzuAuy0JYaQ9XPt91HOydRcRqdJvTiBXHUw== X-Received: by 2002:a17:90b:5448:b0:2f4:f7f8:fc8b with SMTP id 98e67ed59e1d1-2f548f1c430mr29417268a91.27.1736781003060; Mon, 13 Jan 2025 07:10:03 -0800 (PST) Received: from J9GPGXL7NT.bytedance.net ([61.213.176.56]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f54a26ae2fsm10193120a91.9.2025.01.13.07.09.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 07:10:02 -0800 (PST) From: Xu Lu To: daniel.lezcano@linaro.org, tglx@linutronix.de, anup@brainfault.org, paul.walmsley@sifive.com, palmer@dabbelt.com Cc: lihangjing@bytedance.com, xieyongji@bytedance.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Xu Lu Subject: [PATCH 5/5] irqchip/aclint-sswi: Use wmb() to order normal writes and IPI writes Date: Mon, 13 Jan 2025 23:09:33 +0800 Message-Id: <20250113150933.65121-6-luxu.kernel@bytedance.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250113150933.65121-1-luxu.kernel@bytedance.com> References: <20250113150933.65121-1-luxu.kernel@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" During an IPI procedure, we need to ensure all previous write operations are visible to other CPUs before sending a real IPI. We use wmb() barrier to ensure this as ACLINT SSWI issues IPI via mmio writes. Signed-off-by: Xu Lu --- drivers/irqchip/irq-thead-c900-aclint-sswi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/irqchip/irq-thead-c900-aclint-sswi.c b/drivers/irqchip= /irq-thead-c900-aclint-sswi.c index b0e366ade427..7246a008a0f0 100644 --- a/drivers/irqchip/irq-thead-c900-aclint-sswi.c +++ b/drivers/irqchip/irq-thead-c900-aclint-sswi.c @@ -31,6 +31,12 @@ static DEFINE_PER_CPU(void __iomem *, sswi_cpu_regs); =20 static void thead_aclint_sswi_ipi_send(unsigned int cpu) { + /* + * Ensure that stores to normal memory are visible to the other CPUs + * before issuing IPI. + */ + wmb(); + writel_relaxed(0x1, per_cpu(sswi_cpu_regs, cpu)); } =20 --=20 2.20.1