Message ID | 20231116-feature_poe-v1-7-be48044bf249@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3229145vqg; Thu, 16 Nov 2023 06:02:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+eRxrkTFsRj58ImI5UeEAxStZs+N/K+9KXsw1ykYmxpQQ+40sNWre3AN0dT5qjJvpyU42 X-Received: by 2002:a05:6870:b254:b0:1ef:9292:1dcc with SMTP id b20-20020a056870b25400b001ef92921dccmr858284oam.14.1700143373638; Thu, 16 Nov 2023 06:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700143373; cv=none; d=google.com; s=arc-20160816; b=DsB1aa+BCy5P5I5HZH5EhC6uX6jQnJX4/sog9W9HVrGtVJedG3SWSv3WYFHKO9P4En /uLte6LZVrHR2uoIbr16UyvOy25eU+8orGObsnwkPt/KEsA3PiU2QXKTbjafy2uvm4A0 uUSSQdFG8dzxqYrd4U4pIIIXpwxZv+C0wk43taE1KIKfWjcOV9snqbBRmbpdD5f8qfLZ iRWNQSNSCflDyn+CO7RU3pbkCZ1z6Qf/pYSjkjOq5QRM18fEN3+u2sqs0fzr783ZFyVW rajPwu8VjfM9t5ekFKdAych59uxgnAbOMQ+SD2Drydwzgez43S/YwGBv0I8FjmtwBSCT JPoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=OI8MkD291CkzowE8oOm7BtXKSZyE48TtKxrx2423dGY=; fh=Pq7utEzs3KbaBDGtrjfUXzjEIBPT1l1o0fhVtCU5Oyc=; b=Hhy52IOb27RPAfTFRuYFUtmhK5wm/fmKLq/ZN02t3ssfeg7AM2FWIai3B6MT/+fqMG ssuxtZHSGCGMvdQHfQSRvi+cTlHGICYnv8pXBtwSIg8G4tSvuUSudB5+DPVXaFRzX1tv r2yQzrTPPcj83SMujw+Nna8z/QL7z+/EUxYjQNyrnonaNLeTz3C7kfWYCOnUY6uC3kmf bjhuoJbwQUiKXY6aSkdJySOYG0UbGCAJDT36rrIr11QfBnLK9T6/ELUvjRTQ8TeOs+5i bptE2PGGTLo0JSx5O3+s9bvQsULzgmNdgk78XffA21uNXon8tKyLoIh+R+gKYOnq8V2q 6rMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PqFyl7tH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ot7-20020a056870cc8700b001dd0f0f9444si4432698oab.160.2023.11.16.06.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:02:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PqFyl7tH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E19CC82159E6; Thu, 16 Nov 2023 06:02:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345359AbjKPOCW (ORCPT <rfc822;jaysivo@gmail.com> + 30 others); Thu, 16 Nov 2023 09:02:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345305AbjKPOCG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Nov 2023 09:02:06 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F154719D; Thu, 16 Nov 2023 06:02:02 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C20DA2000C; Thu, 16 Nov 2023 14:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700143321; 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=OI8MkD291CkzowE8oOm7BtXKSZyE48TtKxrx2423dGY=; b=PqFyl7tHI5VwR2GOARvmf21vfQJHzN4P4RzOkxQxMv/UTvrX/e3gfY2i1BuwBYzgU2HXw2 lpEasKjgsNYMeifH1bMhFgS+ymFEBYOO0TDxk4SMS/LByS/HLdZVZD+4lfJ6Gm+Y62t7Qm 29AzrWMpxyePVxBNxcU2QdrL2i68FVQxyUABYG4R93h/VRz08kQvAqEGpEJhYQLWifTYUm sWOjvTISFLqnLdrC+O3TsAkpDzwf+jlsSjYn+WM6IJsaKwzDfFTkTu+Ngb1M1Os34QhxHY DIEejjoeiJAIVw+O67XZ/k5q4tztZ5ma6YaR+uNWnZocCJ74R8RRLycrre1aOw== From: Kory Maincent <kory.maincent@bootlin.com> Date: Thu, 16 Nov 2023 15:01:39 +0100 Subject: [PATCH net-next 7/9] firmware_loader: Expand Firmware upload error codes MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231116-feature_poe-v1-7-be48044bf249@bootlin.com> References: <20231116-feature_poe-v1-0-be48044bf249@bootlin.com> In-Reply-To: <20231116-feature_poe-v1-0-be48044bf249@bootlin.com> To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jonathan Corbet <corbet@lwn.net>, Luis Chamberlain <mcgrof@kernel.org>, Russ Weight <russ.weight@linux.dev>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Kory Maincent <kory.maincent@bootlin.com> X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 06:02:34 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782729537970391385 X-GMAIL-MSGID: 1782729537970391385 |
Series |
net: Add support for Power over Ethernet (PoE)
|
|
Commit Message
Köry Maincent
Nov. 16, 2023, 2:01 p.m. UTC
No error code are available to signal an invalid firmware content.
Drivers that can check the firmware content validity can not return this
specific failure to the user-space
Expand the firmware error code with an additional code:
- "firmware invalid" code which can be used when the provided firmware
is invalid
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
drivers/base/firmware_loader/sysfs_upload.c | 1 +
include/linux/firmware.h | 2 ++
2 files changed, 3 insertions(+)
Comments
On Thu, Nov 16, 2023 at 03:01:39PM +0100, Kory Maincent wrote: > No error code are available to signal an invalid firmware content. > Drivers that can check the firmware content validity can not return this > specific failure to the user-space > > Expand the firmware error code with an additional code: > - "firmware invalid" code which can be used when the provided firmware > is invalid > > Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Acked-by: Luis Chamberlain <mcgrof@kernel.org> Luis
On Thu, Nov 16, 2023 at 03:01:39PM +0100, Kory Maincent wrote: > No error code are available to signal an invalid firmware content. > Drivers that can check the firmware content validity can not return this > specific failure to the user-space > > Expand the firmware error code with an additional code: > - "firmware invalid" code which can be used when the provided firmware > is invalid > > Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> > --- > drivers/base/firmware_loader/sysfs_upload.c | 1 + > include/linux/firmware.h | 2 ++ > 2 files changed, 3 insertions(+) Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
On Thu, Nov 16, 2023 at 03:01:39PM +0100, Kory Maincent wrote: > No error code are available to signal an invalid firmware content. > Drivers that can check the firmware content validity can not return this > specific failure to the user-space > > Expand the firmware error code with an additional code: > - "firmware invalid" code which can be used when the provided firmware > is invalid > > Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> This would be rather helpful to me for some stuff that I am currently working on and was hoping to send to Arnd for inclusion in 6.8: https://lore.kernel.org/all/20231020-series-uncooked-077b107af3ae@spud/ I'm currently returning a "HW_ERROR" for something that this would fit the bill for (in mpfs_auto_update_write()). What would the ETA for this stuff landing via the net tree be? Since I am not a netdev contributor its hard to tell how controversial these patches are! Cheers, Conor.
> This would be rather helpful to me for some stuff that I am currently > working on and was hoping to send to Arnd for inclusion in 6.8: > https://lore.kernel.org/all/20231020-series-uncooked-077b107af3ae@spud/ > > I'm currently returning a "HW_ERROR" for something that this would fit > the bill for (in mpfs_auto_update_write()). What would the ETA for this > stuff landing via the net tree be? > Since I am not a netdev contributor its hard to tell how controversial > these patches are! It already has the needed ACKs, so it could be merged anytime. However, it seems like two different subsystems are interested in it. So rather than merge it via netdev, it might make sense to merge it via its normal tree, driver-core. Then ask for a stable branch which can be pulled into netdev and arm-soc. Andrew
On Thu, 16 Nov 2023 22:56:10 +0100 Andrew Lunn <andrew@lunn.ch> wrote: > > This would be rather helpful to me for some stuff that I am currently > > working on and was hoping to send to Arnd for inclusion in 6.8: > > https://lore.kernel.org/all/20231020-series-uncooked-077b107af3ae@spud/ > > > > I'm currently returning a "HW_ERROR" for something that this would fit > > the bill for (in mpfs_auto_update_write()). What would the ETA for this > > stuff landing via the net tree be? > > Since I am not a netdev contributor its hard to tell how controversial > > these patches are! > > It already has the needed ACKs, so it could be merged > anytime. However, it seems like two different subsystems are > interested in it. So rather than merge it via netdev, it might make > sense to merge it via its normal tree, driver-core. Then ask for a > stable branch which can be pulled into netdev and arm-soc. Ok, I will remove this patch from this series in v2 and send it through normal tree. Regards,
diff --git a/drivers/base/firmware_loader/sysfs_upload.c b/drivers/base/firmware_loader/sysfs_upload.c index a0af8f5f13d8..829270067d16 100644 --- a/drivers/base/firmware_loader/sysfs_upload.c +++ b/drivers/base/firmware_loader/sysfs_upload.c @@ -27,6 +27,7 @@ static const char * const fw_upload_err_str[] = { [FW_UPLOAD_ERR_INVALID_SIZE] = "invalid-file-size", [FW_UPLOAD_ERR_RW_ERROR] = "read-write-error", [FW_UPLOAD_ERR_WEAROUT] = "flash-wearout", + [FW_UPLOAD_ERR_FW_INVALID] = "firmware-invalid", }; static const char *fw_upload_progress(struct device *dev, diff --git a/include/linux/firmware.h b/include/linux/firmware.h index de7fea3bca51..0311858b46ce 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -27,6 +27,7 @@ struct firmware { * @FW_UPLOAD_ERR_INVALID_SIZE: invalid firmware image size * @FW_UPLOAD_ERR_RW_ERROR: read or write to HW failed, see kernel log * @FW_UPLOAD_ERR_WEAROUT: FLASH device is approaching wear-out, wait & retry + * @FW_UPLOAD_ERR_FW_INVALID: invalid firmware file * @FW_UPLOAD_ERR_MAX: Maximum error code marker */ enum fw_upload_err { @@ -38,6 +39,7 @@ enum fw_upload_err { FW_UPLOAD_ERR_INVALID_SIZE, FW_UPLOAD_ERR_RW_ERROR, FW_UPLOAD_ERR_WEAROUT, + FW_UPLOAD_ERR_FW_INVALID, FW_UPLOAD_ERR_MAX };