From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (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 85CDD2030A for ; Thu, 30 Jul 2026 00:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785369690; cv=none; b=PxePEpeaj2q9LC2CslO/0ClONCvxnvFJtHnBiIN4X4S+X4MUV9jxtui+4USmgXm2N1JBX5Lm5VVvo0cA32z0yAaXLHia8NZN9gzUu/Kp6RmCireyDbNEMQUa65r4HFOM7NpOGk7xUGuLMae8dLvwOT9cslsk+bnqFb6PyW20Uww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785369690; c=relaxed/simple; bh=X4LPeoMMlBSNPr6M5Sul0jO8cVThr4s5+/VMaLeTHEQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G1NdD0kipBf05CkTc8I9nNFpurcZPXLfNuV0fW7jtFMsnhIKaKchMV5hr1tJR3gIwoEdjr/MRgBMeFQnotxbyNjzp3sBw2b4tCkANT8I7MyQ9xsET+n/lyxbqaxkB2a5XgOVnmkoW4cjS93zTzu3fCT5q7gbSSlrfdeip7FbCiU= 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=odOfWrYB; arc=none smtp.client-ip=209.85.128.178 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="odOfWrYB" Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-80814edb536so25562177b3.2 for ; Wed, 29 Jul 2026 17:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785369688; x=1785974488; 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=nAq/JwzA/qGSSA38u08YVkDTzAiY1egMCTFF3E/QBPM=; b=odOfWrYBYAQ6scs1iat1bm+kcHveh7TZbwpEdeX/ZB4Vwg7+2vaj0/DiWAs3wptmLY qs5joWnaZNULz/FiOlG+tKQ7shDI35NPdgCdE2tkzy8YTqynjpAmqnUKTgqwmF1i9bO1 5fSjSTBP5+Qh5jU/J/nCsoYdLiSYQDiTFtUeIaRNmCNW1HNfrPr2IGUzEaFGIu3ItIqj 4jMPkyIB8oD5sN2W0dvNG54bFuUyFRw2MxCcOuD6sGZlQ3aWWxbBLII3Kxt+kAf/qGMl QsDVLqGNH4R8KsKBoXHxj7lZCaDzM81PhTDik7NKP2yDLFEi3qJz1+92CoscakRueWmw 3jvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785369688; x=1785974488; 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=nAq/JwzA/qGSSA38u08YVkDTzAiY1egMCTFF3E/QBPM=; b=mKIpaljC/21wyOgPP5zQIAvkuWXWEVqqbPC4RGzwa+D1dPTmNaSz3OeqMmuH25RfPj K/OKKCfQW+pq/8wRnzwX3GRpccPU7rp+YH7iuQXxt8AnB5yp1mz3pgalC7KUVIOF+dZm gKaP9K9IAg/sbEi+IWP79GZ088TD5BgJ3kUf/fagkl674pBWb1/BbSmaqkZMTihkanSi pMqtRrhsPdyHlx6r94IdjJoViRbaWU4dTrliwcbKJMswEu69s30RgKK22IQuj0djZkB1 225V8oBJ7aDHzgJUk1XS9Lb3hhXFfkiZ+TF68rypaTFJQy5ftZM1jiUXfIDc16FKhR9r DLUg== X-Forwarded-Encrypted: i=1; AHgh+RozZJP6/VPbK0wOiIp81FOIub4ty71O+3iGS1j2I2G/cDumf+ABo3YJzOr7pfxxsMnNlfim+fkKNZXN1AU=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2M5EZUIVWFEeBsDtmHS98HKCFAy6V0Xr2tmEUqbmAO5KN0GP4 TV+xYhDqfyX5a44QLZUWMjOliut99z43GvZOYM5gb8kzDvU+Cs1Ai1v+ X-Gm-Gg: AR+sD10wtIAboqevtZW+JIYUpOnCbL9B/dJB7OdxC9Q111eqF3+j81XS5z+1xaz4i4V tSDdqDiN1z3V6X4nUWi660FRfaDafbXeEFvEjB9zkik/c3J2AGUMWx7r0JzmVlJcvaX1hLtEDDr usOP3p9mE9lWC473fKQ29PQEi6ITVIq+s/VBOvIYBV9q3sStxv2K/dSE15wvyrUjuUsMvP5r9Tp iDSw408lXFnvXSAAaKLiRjlahcunPA9MhcbtzoZ0VrOiF2DzJGxXVkPXr+bRGBIHy14wsGnmdoZ e77dwc9EkFnCxgzVxptTv+3M5NaExAE+fTnhPGxcZ09yZFmaGniCiwML+rTXf9H4Z1lWwaHA7Ii PA7dVHL5rZGf38JEczY5QMNCQfc/VffpfxXtp0eqL8HujsIejBpg1KU8gQyx1kZzjBtzQAnk0Kw zUHSaFYS7RDMEKzh0TODxQtsSenCb9G5Wkyp2vwEgoDjArdcouSz4vDbQ99diz1ytL3m+Tfyj2+ kcGclz9YrmL7AhP6DP+kZqWGw== X-Received: by 2002:a05:690c:dc9:b0:81e:ae6d:caef with SMTP id 00721157ae682-81fb8b44433mr1924497b3.46.1785369688447; Wed, 29 Jul 2026 17:01:28 -0700 (PDT) Received: from got-milk ([107.198.84.185]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81fb8b08ceesm874567b3.43.2026.07.29.17.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2026 17:01:27 -0700 (PDT) Date: Wed, 29 Jul 2026 17:01:25 -0700 From: Paul Sherman To: Paul Walmsley Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, hchauhan@ventanamicro.com, apatel@ventanamicro.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: sbi: fix errno mapping for SBI_ERR_ALREADY_* error codes Message-ID: References: <20260727221508.5179-1-shermanpauldylan@gmail.com> <8760a4fc-fde1-85be-174d-dc6dc6012265@kernel.org> 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: <8760a4fc-fde1-85be-174d-dc6dc6012265@kernel.org> Hi, On Wed, Jul 29, 2026 at 12:43:30PM -0600, Paul Walmsley wrote: > It looks like -EALREADY is defined as "connection already in progress," > which doesn't quite map to the meaning of these errors, here. > > https://en.cppreference.com/cpp/error/errno_macros You're right that the POSIX description is networking-specific. My reasoning was that it was the closest existing errno expressing "the requested operation was unnecessary because the target was already in the requested state." If you think another errno is a better fit I'm happy to respin with that mapping. > Does this patch fix anything or change any behavior? Yes, concretely. Today SBI_ERR_ALREADY_STARTED falls through to -ENOTSUPP, so callers cannot distinguish "already running" from an unsupported SBI implementation. The companion patch updates cpu_ops_sbi.c to recognize the translated errno and treat the "already started" response as success, which fixes the boot-hart bringup path on many-hart multi-node platforms like SG2042 where firmware releases all harts simultaneously before SBI HSM state is established. > I don't think the comment is a good idea; it creates one more artifact > that can get out of sync with the code. We'd just expect people to read > the code, I think. Agreed, dropping it in v2. Thanks, Paul