Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4666618rdb; Tue, 12 Dec 2023 06:15:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6vc2+NkvmhD/+Kz/GM5nuE4T0QYyDIQphMeoQy/FDg7j0e5nxbv6ouffQqYzQeE5gBSHj X-Received: by 2002:a05:6a00:4783:b0:6ce:2731:5f7c with SMTP id dh3-20020a056a00478300b006ce27315f7cmr2555152pfb.59.1702390547686; Tue, 12 Dec 2023 06:15:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702390547; cv=none; d=google.com; s=arc-20160816; b=tGP5BypoVuHCVKcscpezAleGBs5F1znsfiryurHKUF3SAWFd05BdhSM3uONBFmmDLK +9y2nc9b3pJ7yXBhK5N7+7cBzQNlmZ/5YaqbLc+BrLTdT6CBCl6oFlI3R0Y1MzMWGrsw 4BuLyUKzou7jrrXIXrqxqXKDtkzNi3QismBCzfkMfFnC4JezlghsYborw16vgbE2z2l6 eXeteq0ipusc3iB8VvU3J30vi347NYZlKgdKSVdldJjJgQ0PfK9nXhCjKDHqYV1jbnKY k7MSGEYUTpM33zZ5CU3BlFZUcKM4WRUzqe8WyEyEBZTR0+B28mZ44W9wuktcnGvA5k2y t4iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2Mh2qDQ2BnIE77ZUIc2OFxoJNF+oKWs9zHZFCHodkks=; fh=W2pHPIJPqCP8HsXFXoA7ZzEbMb5czJzPDgB2sMvpzSo=; b=PpcAyB00IoA6V9dP4kxYy7vu4pBV5MzWK11JtwnRmjm6ma/bB7ALvb38gYa+K+YhXG RzZZBgGKSzqUEqeQvEUURSN9EL7emSOHktr9EBc8aaaaqC9x1qrSrNmOQdrGbCttje3y aksLGwUSa5NK0f64k270883ftvUTe5fD32eGNOBcuhf7loywzXaWuKDD37CZRdLwKFIJ Vca+uJZMrAKgFQXgLX0y/nE6KJfqVHO/62KQ0pLcd8dIEMxOi+G+WScknn0N+CSAQu8R NQsrifwM4MTjyLsQLinjKqKq7zqxGkb3+RZC45owc51DuL9qHpzQ+4AtJCQnqSShciya IdlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xf5jImnR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o2-20020a655202000000b005be095b2545si7840472pgp.183.2023.12.12.06.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:15:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xf5jImnR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DEF3B8074514; Tue, 12 Dec 2023 06:15:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376451AbjLLOPX (ORCPT + 99 others); Tue, 12 Dec 2023 09:15:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232555AbjLLOPW (ORCPT ); Tue, 12 Dec 2023 09:15:22 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 007C6AC; Tue, 12 Dec 2023 06:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702390529; x=1733926529; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=+CyqDkty4gAG4dffVL639tJHtioITjzlgMZMq9sVuE8=; b=Xf5jImnRTqabHtGef0ftPMQKhN0T6DwfeGW61tbFD3uHlbfQ8E8oTXkD xEdcN7evttzKBs7yllOIZz/HUTi7XwWx6RsSzfmzkzUU8CQob38go+Ipk pOWiWhnrVOFW+eOVQX37+ywtJ0AZH4oHhTj1n9HmeW4mkuwr8WoG1QMMF 331kdOOhViLGT23GgSXFkaEDuQYYWaGvckbnHiFrJonDCDtI4fJJ2iOGO 9uuLyCHYmgaCCid6hloZqeADhEnUR//9Qxz7kVXXdvesWgmJXMmw5whqf d2zNUezd/4aWloUTQUsES8CIU5Sw7QPlY/80wwzRM3XLmO6zOf1mJilUV A==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="16364166" X-IronPort-AV: E=Sophos;i="6.04,270,1695711600"; d="scan'208";a="16364166" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 06:15:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="802484555" X-IronPort-AV: E=Sophos;i="6.04,270,1695711600"; d="scan'208";a="802484555" Received: from kuha.fi.intel.com ([10.237.72.185]) by orsmga008.jf.intel.com with SMTP; 12 Dec 2023 06:15:25 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 12 Dec 2023 16:15:24 +0200 Date: Tue, 12 Dec 2023 16:15:24 +0200 From: Heikki Krogerus To: Javier Carrasco Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] usb: typec: tipd: add function to request firmware Message-ID: References: <20231207-tps6598x_update-v1-0-dc21b5301d91@wolfvision.net> <20231207-tps6598x_update-v1-2-dc21b5301d91@wolfvision.net> <196acb44-fb0d-45b6-a9c3-b5a289a41917@wolfvision.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <196acb44-fb0d-45b6-a9c3-b5a289a41917@wolfvision.net> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 06:15:39 -0800 (PST) Hi, On Fri, Dec 08, 2023 at 07:58:52PM +0100, Javier Carrasco wrote: > Hi Heikki, > > On 08.12.23 15:55, Heikki Krogerus wrote: > > >> + ret = request_firmware(fw, firmware_name, tps->dev); > >> + if (ret) { > >> + dev_err(tps->dev, "failed to retrieve \"%s\"\n", firmware_name); > >> + /* probe deferring in case the file system is not ready */ > >> + return (ret == -ENOENT) ? -EPROBE_DEFER : ret; > > > > It's more likely that the firmware really isn't available, and it will > > never be available in this case. I think there is only one place in > > kernel where failing request_firmware() can lead to deferred probe > > (drivers/tee/optee/smc_abi.c) and there the code can actually see the > > system state - that's actually the condition. > > > > So just return dev_err_probe() here: > > > > ret = request_firmware(fw, firmware_name, tps->dev); > > if (ret) > > return dev_err_probe(tps->dev, ret, "failed to retrieve \"%s\"", firmware_name); > > > Thank you for your feedback. > > This solution arose from a real use case: in the system I am using to > test the tps65987d, the filesystem is not ready when the probe function > is called. If I just return on -ENOENT, the device will never get the > update. Just like all the other devices that require firmware. This driver is no different from the others, and it is also not the only one that needs the firmware only in special cases. Just make the firmware part of your ramdisk, or build the driver as a module. Are these firmwares available linux-firmware (or are the going to be)? https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git thanks, -- heikki