Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1764678lqa; Mon, 29 Apr 2024 20:24:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVua4B1coCewvONsVgWhFBTjjebqzao9jljkyoizIByG0/GzYoP79OGKtE+164Uv9VGAXVHK0tL9noftJmrmhLVBS5WL1voF24JJoqscQ== X-Google-Smtp-Source: AGHT+IEhuHimYD1QRtfxwPF+xcj2z7oLLLgAsJRosY8HuZKMcC2aT2Vmb46muIDGSy+sF530ZJnV X-Received: by 2002:a17:90a:db56:b0:29b:c9ac:c563 with SMTP id u22-20020a17090adb5600b0029bc9acc563mr1386192pjx.19.1714447450048; Mon, 29 Apr 2024 20:24:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714447450; cv=pass; d=google.com; s=arc-20160816; b=lWLbhujGcrqtfUp22vDevRVboyIxKikrm0xDkkR1uRufya/Y25IaKNXKdS1A+DbCm4 l5XNf+D9LHIngiKwtvSSdGCTWqRu6os6d+oxg8VvstpZGJcW6w7f/K0hvl8H+DNbaD0G evw6Ssov9RkRP0rytYt8zP6n4LplZQkusvr8Su2J06HYuUI2t/dJ5YVQfwYYhXXqbCU8 oSnij2CU9fgwgX08+yG2athyBRCZ7SDYjvhbeRuNoSrUfylL2LSIPa79qehj5IHjxTKt S2p0h8iRNUXaK/zxxmL5xWERL6Od+W3cb2ftwh/nD15wtTGbQhS6c4V8XXoVVHL3yycN iY7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=K5tDOhZV/RMmYptMjwFpoxPV30/Pg0UFZBx+4INaqHM=; fh=MUR88bFMIx3vFKp/j9Y9fWtpE04vvnu3U9YY6g14FHI=; b=FF/heFfh3+0rdJ7XqwklvHRSUMkTk+9MRzqZCQ7f9FuGR35Hlrw16AaJM9Bllt18A9 Vz3+shhzK2oIsru7trQE9txxom/dFPtwp17wTDNKsFBt5gUVw/jAfPNuc4u194ZQva1U hYVQMyAO1U+vzGu9A8LFRIJAG3MGtuqPJnk3AVAmxn0A3ttAOFWidlKQUlsAzBxJMETv yuA0tAEhSds1fI9KluNVuyrlA9z7tes6Q8yRWOIm2Z9bs5tc25M6IUB0zA8tX2RP3GHb g9HDk84VAbvlzXQMc8yTNmbFr/xXCKFwp/ROpokk0VHucPH7dS38wP7phlrSPOBdgVR7 6Mbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sSkKNiCX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163286-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ng17-20020a17090b1a9100b002af49ea6474si10724877pjb.121.2024.04.29.20.24.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 20:24:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sSkKNiCX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163286-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id ECF3DB22821 for ; Tue, 30 Apr 2024 03:22:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6074610A3E; Tue, 30 Apr 2024 03:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sSkKNiCX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 851A81094E; Tue, 30 Apr 2024 03:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714447359; cv=none; b=f9gkeK4rmFwQqX0QniidS/dfoxj7zYziF9dCjiGswBYjTAX8gXZV7xB2/x+8N0/6vvPqwfIbCYXPxRP7h68zrsTCGON8xMOIfSZJPv/HCodB5IjZzvn30lyxCSmIzGKIUL48Jn1epK4I75aDvZL/5qekcwfuJ6Gdg9G04RzQMHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714447359; c=relaxed/simple; bh=/KpxBWy5mcEbkG7pQG0EPzcysWGUzPXDj0gBvqYdums=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TFaH6jjxIGKmFb2SeoIxsnJoJ2sWcAIKH/wbv77MtLukM64jllim8rWP/Fr3X7FsTkRLH9VJ4JDrHBxnab8iVEdn60K1zzgRWTcV/bywr3cy9WdRJb2oWIsGPpttJcgQf9Yr+hbOwwwB9DMvXrbTeRmxgJOg6DkAyvs5eSEWGo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sSkKNiCX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CD91C116B1; Tue, 30 Apr 2024 03:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714447359; bh=/KpxBWy5mcEbkG7pQG0EPzcysWGUzPXDj0gBvqYdums=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sSkKNiCXpCcc/7pJ8gWMm5YCd3auiyTbpRyptUCMgG9FzN5zkVbZipqaxbdF3hPpx Geb61osFpYAPFdZvAxNGqTo5mLEMYXsyGz9fJGTOQKB4dNXfiAX3WjwYmz8tnaFfdD PbLFmVrwVAth+rr/5SZExtgs9UjWdtgAEGGxBbbeqdyHbLTA6xT2G6T1WL21orpZnE KzuJ9S8IryK8WpoCwKQH39ME1RvEXSwUt+981BiNi0hf4zixOLWsbwp9cB7tNZ7PJM XZLyDW94V+cfABtIkA1burVDaEciei33GzNeWzjSShKkOHpSXM8fzG7k/IDuKX3glu uTZzRAVgqnlFw== Date: Mon, 29 Apr 2024 20:22:37 -0700 From: Jakub Kicinski To: Danielle Ratson Cc: , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH net-next v5 09/10] ethtool: Add ability to flash transceiver modules' firmware Message-ID: <20240429202237.6bbd2cb3@kernel.org> In-Reply-To: <20240424133023.4150624-10-danieller@nvidia.com> References: <20240424133023.4150624-1-danieller@nvidia.com> <20240424133023.4150624-10-danieller@nvidia.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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 24 Apr 2024 16:30:22 +0300 Danielle Ratson wrote: > +static int > +module_flash_fw_schedule(struct net_device *dev, const char *file_name, > + struct ethtool_module_fw_flash_params *params, > + struct netlink_ext_ack *extack) > +{ > + struct ethtool_module_fw_flash *module_fw; > + int err; > + > + err = __module_flash_fw_schedule(dev, extack); > + if (err < 0) > + return err; Basic dev validation should probably be called directly from ethnl_act_module_fw_flash() rather than two functions down. > + module_fw = kzalloc(sizeof(*module_fw), GFP_KERNEL); > + if (!module_fw) > + return -ENOMEM; > + > + module_fw->params = *params; > + err = request_firmware_direct(&module_fw->fw, file_name, &dev->dev); > + if (err) { > + NL_SET_ERR_MSG(extack, > + "Failed to request module firmware image"); > + goto err_request_firmware; Please name the labels after the actions they perform. > + } > + > + err = module_flash_fw_work_init(module_fw, dev, extack); > + if (err < 0) { > + NL_SET_ERR_MSG(extack, > + "Flashing module firmware is not supported by this device"); This overwrites the more accurate extack msg already set by module_flash_fw_work_init() > + goto err_work_init; > + }