From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f52.google.com (mail-yx1-f52.google.com [74.125.224.52]) (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 C748835F61E for ; Thu, 30 Jul 2026 01:43:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785375806; cv=none; b=q/nH4I1/p/djmzgj+FsMLVD3ReVHF2zQZ7BD9Ti3KIyppO83NaF2wq1AP/YRQi4MoXpzMCMA0UOTwU0CXwh8Svru47YAjLJXHAS3HgYXbjeFCFTjl4N6aCWYYHhGqhhMzziba8PoIjyE3XRqk/4LVGnoiRv9FW+SWfDq+FOiC7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785375806; c=relaxed/simple; bh=fWH5nL7XeLRUXJpfKXPBfmY43kerM/oZvGm1zo8ZBfw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f9XVjGqNYifkhy7pHF3DJXetx+c++8V9XLV5E7274wuz4Gx+pMWYfJ9QpESyTP4N1PbYPSzgiI7Nn+SQQAWEMxfPj6TaQLRGbazFJu0NzHFMjIsrRgSG9DRi8AhIdzRNZCYapofX5ubbjS1e+8YhZ5vZC/Nwqgm7T7Lk0L8T3FU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mIE97n1G; arc=none smtp.client-ip=74.125.224.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mIE97n1G" Received: by mail-yx1-f52.google.com with SMTP id 956f58d0204a3-66899fe9077so2304659d50.1 for ; Wed, 29 Jul 2026 18:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785375804; x=1785980604; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=mZFvilolEPcJsZBCt856hM7K+hVSmGldnUoUJCZFhgI=; b=mIE97n1GhIzkta2zhlEpdDQNHpQbZIJL7bhzlhIqU0tpWWxbesESYMtSJEypc3C7fs rpJi/tDRmEKXu7LFdEL53a085PFbUMo2Un+QjHFdJ3LY/9fpdtDCa3N7I2ARVROK1VDL HODkroTekdcF36k1VqBapgRxbu6ggc3qwXowsB/TElMDIYKXHtHskZh6lITsqgLT7wyR oZAHP+V56OyVtQQ2MwvVM6VuUcCXLX2vwLTDKiFjhCWJDvXFoe5U1Pis+OoT9FxEkX+h r1LCxLSOiWxQYnG73lGMREKkHCpuw+vCcWHySdS91Lw0Idb7oBYNrmyj3AS1FGkwfE+y R54w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785375804; x=1785980604; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mZFvilolEPcJsZBCt856hM7K+hVSmGldnUoUJCZFhgI=; b=Jzz1ohACJwqCq//mJZpE705q4ngqjnWIPIqYQK+hXbYdeS2gD3+n76Vq4dIWuRqpr1 JwFmVGTH3y0XoCGdAHGQM7DJDPAXZ2X0HAZUV+4sxgWGUsHPGPnWYZhoql3JaQVoFyiI U+fszqyUlH6MDOSs7srZbl6vZCNRd5EEAn6Eo+HASzZHCKPDxzMN591iRN1EAbS4J00Y OJ/5I5aGPOqeHa4/H4S/gE3ORL8ucaGFbb0A2umXBxM0m/2weS2iVWB9T+HR5yZ/0Omd sKIg8n4571BxapT/ivFN5xiCXXp1vav85ocPyRa2llkeVbtzDMkP4tjB6vTUl7duqi3K BV1Q== X-Forwarded-Encrypted: i=1; AHgh+RrCqJWjG4yzcWD4BUwRG6vnV8Ufqgg48xd4oiNfRpqPD1PSGRqRoi5eAsIP7jmfaecGeHPVcOXG5urIc90=@vger.kernel.org X-Gm-Message-State: AOJu0Yza/GV5sFxVlqos8OjWfywSAwt3Msbm9FMdo2nWr31xOjnC1zuB j/izVtcPr4Fj2QmMB6BndXUfxWEfKC62y36iCpDHpyApcOTHtEAKYUmj X-Gm-Gg: AR+sD11w5UO2G9bGCFJAZH3OXX3hsuBYfBnL37ji/t5Q9OIWbYtSTH8ReFGrez/mD5B Q/sFoNbWRA83xukhELwGznyYk83OisBF8Uwxtx2fR7a9RtK1+TAF0JwzLtNJOgGHAhvH9MWcR5W 6hd5sbt+mXAexwBs6Shm/8dgwSVxQW4Ci/m+hyg4YqmcLFxKGPtPT73oflrOgv26SrnKVTV0AO+ vW8Ro26qQORx2vLJPsMExr2pUz1MhrtMkyCFkPdbHjUdEdjS1XEk53KKTRJCQkBd7wz+aKYSm1y tmza3DXik1OIGgJzu+YVfTQyNlXy4gsrN5ADvt+oKdGJTRC2b3xh33dUq5nIi92GaWCMDJLno7u +6LCLbKesThgf61yD8wxnGyPp9jlcdkN+oOgfd1FNkbo3m4qVCtgY+WBau8JOkzUmiYIr+D9dDW CiTx0Oq13sOajvpALcx7Xg7/gekVltiinDb22PQ0Twc5z8c3SFQ5kWUIb4mW/AsotBooRztFTD/ vldIFqfCQh9CC+SAx0NqyKB X-Received: by 2002:a53:c0ce:0:b0:668:9f36:5484 with SMTP id 956f58d0204a3-6692f76adadmr248588d50.87.1785375803719; Wed, 29 Jul 2026 18:43:23 -0700 (PDT) Received: from got-milk ([107.198.84.185]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-6692c7479c9sm386842d50.7.2026.07.29.18.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2026 18:43:23 -0700 (PDT) Date: Wed, 29 Jul 2026 18:43:20 -0700 From: Paul Sherman To: Samuel Holland Cc: palmer@dabbelt.com, pjw@kernel.org, alex@ghiti.fr, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: smp: fix non-SPINWAIT secondary hart rendezvous for fw_dynamic platforms Message-ID: References: <20260729083414.39339-1-shermanpauldylan@gmail.com> <51f32966-86a2-456e-9e45-c9bf8add0676@sifive.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <51f32966-86a2-456e-9e45-c9bf8add0676@sifive.com> Hi Samuel, Thank you for the explanation and the pointer to the boot protocol documentation. On Wed, Jul 29, 2026 at 05:13:56PM -0500, Samuel Holland wrote: > > There is no need to handle SBI_ERR_ALREADY_STARTED because the contract for the > "ordered booting" entry method (see > https://kernel.org/doc/html/latest/arch/riscv/boot.html#kernel-entry) requires > that only one hart is in the STARTED state when the kernel begins executing. I agree that the documented ordered booting contract requires only one hart to enter the kernel initially, and that HART_START should therefore not return SBI_ERR_ALREADY_STARTED. > It sounds like your firmware implements something closer to the > RISCV_BOOT_SPINWAIT entry method, so if you disable CONFIG_RISCV_BOOT_SPINWAIT, > it is unsurprising that there would be problems. On the SG2042 platform I'm investigating, however, that is the behavior I'm observing on shipping hardware. My investigation so far has focused on making Linux recover from that situation. Based on your reply, I'm now wondering whether the more appropriate fix is in the platform firmware or OpenSBI instead. > Why doesn't your firmware do that? Can you fix your firmware? Is your expectation that platforms exhibiting this behavior should be corrected to satisfy the ordered booting contract, rather than Linux handling SBI_ERR_ALREADY_STARTED defensively? Thanks, Paul