From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (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 CB0DA3CEB93 for ; Fri, 3 Apr 2026 18:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775239672; cv=none; b=G6LTyeBFFssjyKgux29yzGCVoll1ey4W/S6RscIRtuG4aLLnA1jZZUXBFMDrXNZuIwXuEtIRety/YZssTUep6I8lKDh1Lrx7fv9EDHMWMSXutc4A9HdVFQxwGp0oAZ2yhCI75Id0UydMXB9ud4EaG2/ylfvfrl2RqZKVN2ExzQg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775239672; c=relaxed/simple; bh=UFPWSEdBYNvmgOvcN99SS0anBY+f8Mv9diH3OxTcOTY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fRZxujByMZfhgIwpBz6uZ6AmRVFf7Cb8F1vXYVY6oOkRLEFSZA0j48RVdfRl9P/K2w1a65eCHJ5CdPSLNSqoOSNZ1nomH8QIj5VWVDukF+DQm+Vq3iKyZQjfdsecj0RW/6iVrqllxmMpYvBLZ0hyQfLbsFEROsOIHo6IIA49o70= 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=XTYzGhnz; arc=none smtp.client-ip=74.125.82.51 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="XTYzGhnz" Received: by mail-dl1-f51.google.com with SMTP id a92af1059eb24-12a80c36350so2491910c88.1 for ; Fri, 03 Apr 2026 11:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775239670; x=1775844470; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=XYS8rrk/W9xmmpVLtPf6SPDq6V5JZhKXUApyjYv6jfU=; b=XTYzGhnzcWGiLo+VIC5LKWuBaAiimDScN1VOv8TmEx4OBMEztOwhjuaN81sNhU+Tzv vuplG6XC57dRGHSKKn/vzdDien75/d4iYiNTsP49Sirnl76MVhGNKvy0LnS4FC/YmNhs TyMYXGUbOr/soQYjbpPOumwKe3ueG+sBFRPpwQ2z9cZrb2hXTsYhLRnO1KoLiOwlv4EB EIL0zcK+TXn5p/rcDi3L3WjhPehD9V13qBVaeU40lZplZDTrAxw2jKmoxbVqdpG8+iAd utL/u+SqlKBW5Tkgv7oxBTZmGBddhONOv+Hln1EVcwiZL7meGE5Uc1S1RmyhMl4qX2JE ZDXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775239670; x=1775844470; h=in-reply-to:content-transfer-encoding:content-disposition :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; bh=XYS8rrk/W9xmmpVLtPf6SPDq6V5JZhKXUApyjYv6jfU=; b=YakSl0Ui/ZaD8/vIvK4VPcGGpP5SlI9YcbB/CWA3HOAggJZ3ZNw/mb680r80KuCztK OJTfmXU0oem51MVxlwUImlgThuTtUkFsDwSahdoIW68Pt0mgY7UvXViSM3EE6bulu6QJ gdtIPII0fdEUJpTeNcFEbNO/SJ6bVqwVfbOAdsYEQzpa6k99l7ZLGvGOt16DgKT7KknO /B4b8mH0DewQtMdfVxj42evIlxC5lF+hjHhJdfl6wqNlT6Vq8S+XG+3e/ZZtxf/NmKp7 8UUlRZMQARg4sVnLpFQezDKVdjdC0KA4d2pucXcx9idkHeUp88hBEoX3PMVkL8I5tc4A vC+w== X-Forwarded-Encrypted: i=1; AJvYcCXdwzUpD6X4tooB5r8zrVvQWJ5xfolwkqhby0EktYmdm3l3ZyV7eJ+XM9RZUlDp6pBfrZIe3NM5527j4+g=@vger.kernel.org X-Gm-Message-State: AOJu0Yzwm66F92Ba4VI6PMgBkKQdwDwCqmVgJY9oGxQysGffW8cUgEB4 zXcOQ1PhJYSDT62a/UYZN6URUPc5lzZiC9+y2o8bsrP5MqztKraKsT0l X-Gm-Gg: ATEYQzzXSGVg/KHazRvPp7AZKo1uOjicaZeA9QwwGOFJr/fPpke4IexuD3Bap9VEAkU /NZNLab7jUAT9fxJagdnQCbFpN97ksuI9/06jfeE7z5QWtOstZNkNYJ1LDo6/gKYZMsma3aE4fW qH0ZH0Rxv4/5JsrOaakU3zQkBFlnIPw/XiEybeZscRC76JkZzKtke/yHXvGSx4O5SO3z5oFaiYk vwrwWktF7IhEJT7eOhBWaY0jv+MI+pzNLSlOzRQ1OVpJQcsJ7Lh0+kMZL/5fPJB0igd7ZVlSiHL /Bdguhy/lkOrkptQwF5PiYouruAZGDl/Jb6JdRXkeifJYhEIiNPtscRKijI/lkiRw+T0tWx84gh 8Q+98qQmhJHRGusZ7yVuo34UAGOjUms7e0mxggr6RLkSEqi91BrdkNiyZBIf/AOTnjp1oXsL8Xy gsDGR1lgyLSTjfFVr2zhWgPLiLOjG6gTxnCTq2jJiJfMMpeHN85NDv5z804n2+NIiw X-Received: by 2002:a05:7022:43a8:b0:119:e569:f609 with SMTP id a92af1059eb24-12bfb6ecd57mr1666933c88.2.1775239669720; Fri, 03 Apr 2026 11:07:49 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:2357:9278:e4dd:85f2]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12bede7f004sm5079641c88.13.2026.04.03.11.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:07:49 -0700 (PDT) Date: Fri, 3 Apr 2026 11:07:32 -0700 From: Dmitry Torokhov To: Bartosz Golaszewski Cc: Andy Shevchenko , Bartosz Golaszewski , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Mika Westerberg , Andy Shevchenko , Linus Walleij , Hans de Goede , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Len Brown , linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH v2 1/4] software node: return -ENXIO when referenced swnode is not registered yet Message-ID: References: <20260402-baytrail-real-swnode-v2-0-6f5054a4cc07@oss.qualcomm.com> <20260402-baytrail-real-swnode-v2-1-6f5054a4cc07@oss.qualcomm.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 Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Apr 03, 2026 at 09:29:38AM +0200, Bartosz Golaszewski wrote: > On Thu, Apr 2, 2026 at 10:43 PM Dmitry Torokhov > wrote: > > > > On Thu, Apr 02, 2026 at 04:35:34PM +0300, Andy Shevchenko wrote: > > > On Thu, Apr 02, 2026 at 02:54:26PM +0200, Bartosz Golaszewski wrote: > > > > It's possible that at the time of resolving a reference to a remote > > > > software node, the node we know exists is not yet registered as a full > > > > firmware node. We currently return -ENOENT in this case but the same > > > > error code is also returned in some other cases, like the reference > > > > property with given name not existing in the property list of the local > > > > software node. > > > > > > > > It makes sense to let users know that we're dealing with an unregistered > > > > software node so that they can defer probe - the situation is somewhat > > > > similar to there existing a firmware node to which no device is bound > > > > yet - which is valid grounds for probe deferral. To that end: use -ENXIO > > > > which stands for "No such device or address". > > > > > > This error code is also too generic to my taste. What about alternative(s)? > > > EADDRNOTAVAIL > > > ENOTCONN > > > > > > (The brief grep shows that the second one might suit slightly better than the > > > first one by existing use cases.) > > > > We are in the core of the driver core. Why not simply use -EPROBE_DEFER > > to which all users will resolve this error to and call it a day? > > > > Because -EPROBE_DEFER only makes sense in probe() context, while > fwnode_get_reference_args() may be called in many other situations. Exactly same argument applies to your follow-up change: gpiod_get() returning -EPROBE_DEFER only makes sense in probe context but it may be called in many other situations. Are you planning to change all places where gpiolib returns -EPROBE_DEFER to something else just in case it might be called outside of probe context? -EPROBE_DEFER should have been called -ENOTREADY from the beginning and then we would not have this argument. Or, even better, we should have used -EAGAIN. But it is just a name, semantics does not really change. We want to signal that something is not ready and the operation needs be repeated. Currently we contorting ourselves by using yet another error code that everyone will either convert to -EPORBE_DEFER or will handle like -EAGAIN. > I think ENOTCONN as "not connected" makes sense, though the string Why is it better? Most of users of -ENOTCONN are in networking code so it is somewhat unexpected to have other APIs return it. > representation says: "Transport endpoint is not connected" which > doesn't spell out quite the same thing. Yes, because it is really for networking/sockets handling. Thanks. -- Dmitryp