Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp979492lqd; Thu, 25 Apr 2024 02:26:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYq0yWxTBe2fBorALcThwbaI26mrjF1+mRA2EzDAAFEly8TYE6wWe1ou4ZpgpoBt3KxRFbilhd7Ye4nwIeVKWfnjjJNiIkzpSZKlX/fA== X-Google-Smtp-Source: AGHT+IG5ydYZVZBZYves9vFGYVwo/1WBjJi8glhKriDN0YNCXHDVUP3uP1yetZmJ+D3XRjcbVWB5 X-Received: by 2002:a05:6358:4b52:b0:17e:53f9:6985 with SMTP id ks18-20020a0563584b5200b0017e53f96985mr7553318rwc.14.1714037212227; Thu, 25 Apr 2024 02:26:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714037212; cv=pass; d=google.com; s=arc-20160816; b=fdX3krDroCdT3WXup6njLIkB5vbo7QvtSAJOgU4aerLlYSqb3/xe3lHch4/hNVqV+o mo9yjpqIFwmTSWAVfHr+hxnWzS2Pn4/8zzZdP6tuR0eXIgxF0i34SJKnvryMrpRl7o6M 6IxLOihZ6Qh8y2A/DZ5gLCdb9L/hRDHVynkjJkcyLLn17qcpHXg8GK94s1qJwudswfFj ovLmR2ESEvaevKN5JefAzUHwutD5NHWYb+m1ytxqdbcjU+e+zfsoVRQn8T5yT5l1Hnen qHetOVdcSzkayvpSOCUyNohFU3Yac5gnJr+xcHNQhXENixZO5GHghLtTCKte728ix46w RCNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=AxVOqCleBMDIW/ByJ67k7KAL9izw4KY+nAlh60+o9Hs=; fh=f9fR5/P7gwKDQ2aubq/bAS/rCHO2YgyFsB5NScnS7nU=; b=to8Q1W5a2mNNXWTT9h+mJ3s7M0lQ54CjKU0mRlRbJ1S5pFntE2r6lyBI4+BEGm2a7f V5IKkkz+qWScEmgrqATc6ZWwIn1iNCphU4W1/UxPSpHv9ewWDM3IaNZjCO0oNSvj5OdK yHZdSVH0pbtp4vLe5O/Pfe4kpy5DDHF04+mtZw/QSwDry+/8N+dM06jf/dafdrNqpdrz qFf9ag21p8Dh2GgFSkpyROx+rt7KZLICYKO2sj4T8V45YUEEhVCm5yh5+IGkmE0xU/8y FeZY0FxmQr0n2UTzOw+IksE8VDDszBe5V5WpMVC6wX14QjHNKa1G07+mCsFa2bXgJzxU Ehaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OtLCn4zr; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-158292-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158292-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j17-20020a63e751000000b005dc927ee322si12892928pgk.683.2024.04.25.02.26.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 02:26:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158292-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OtLCn4zr; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-158292-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158292-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CFA79283A67 for ; Thu, 25 Apr 2024 09:26:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D11684FD4; Thu, 25 Apr 2024 09:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OtLCn4zr" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 E641F84FC8 for ; Thu, 25 Apr 2024 09:22:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714036980; cv=none; b=mf/QLvIKSdZzwWqNRF6ByiiKJNaCY/1XGg2Kh1GLCgFBFL7QbiF7wHcrargm3R4Cl1h/KrDsDZuBbJb0sTD2mx/b/FvjMDJE02GadFcXhXPq4bWslapfj4rP+Xr8Xmj82be1BgRjf/5iyagAj+glDn3GAixyjEbNhUXSkzHv1wY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714036980; c=relaxed/simple; bh=Lcgg3hvKGEDl4Y9urblPbKPzWGNtZjBouwoTCr4upUM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=AZgZyT+QQfL9/koaVvxVpXRmlAx3qjCMTV1/oNstUlejugCoimcSANTTl23cY5yZDrvMNMMl1Lt3tikjour8WKgf4z9y8jkNBwO7+xnCxViPtPHfTCJ++NCR9U5vWLaocXku+R5j6UIvtl0cRCgaVWMh/4Lepwp8/Bd02hSKCF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OtLCn4zr; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714036977; 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: in-reply-to:in-reply-to:references:references; bh=AxVOqCleBMDIW/ByJ67k7KAL9izw4KY+nAlh60+o9Hs=; b=OtLCn4zr0BTQwF7PvFeugRZtbg+3RA3rW/yeFDoCXwOMgF1vXMXVVPht3uKcHfx4huiPOc T9qnBbZ/YsjJKJphVc1ltVZCnWqGyS+Y8Qnay0HylcttxItH31EpgLdE7BpU+AI2VYvId1 xlxr7ByKN2D4JGEXCcH+pwLPQ9AtWrI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-a88wwS7iPzqU-fdWEQ82pQ-1; Thu, 25 Apr 2024 05:22:56 -0400 X-MC-Unique: a88wwS7iPzqU-fdWEQ82pQ-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-41ab7cdccd2so3837995e9.1 for ; Thu, 25 Apr 2024 02:22:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714036975; x=1714641775; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AxVOqCleBMDIW/ByJ67k7KAL9izw4KY+nAlh60+o9Hs=; b=kwRB++TQ68ExXXN7wUFCXH/t9q2JiZHurYdCS53JJ14ljliZZIQ9I8obkzUH6IF11T Ia0Qloy3cx2I5AMFE+J7Yz9/ySyORGMrV99fY6RRj8YDOzRdowap2hKAuTRmsPkv18lS xfsNQZEzwzpgReL0XVKqYgYD7lByV2GZ9j9+ZHfGoTzkHSF60lC/m65P1TeMnTu7SfiY yiuprJj5wO/DfEt5E5EW/Nj6RFhNvBRzS/beA/7czVQOuOptvzHl5lD0GSWkeuHfDEfQ etafPnQNFLCLJW8OjQHWwPhogjVFaXbwaB5iuVqDrdXpnaFVndGjM8QcrPsKCuYwt3Ya bnng== X-Forwarded-Encrypted: i=1; AJvYcCVhn8uzzSTCoMAl+k/XE2EihGsyMktHJlZ+H1Hbag6ruCSQovN7rZPXMH0ec5qhMsWEbNGuXF/DXX3odZN798nWbg4pxmUSpifTZka4 X-Gm-Message-State: AOJu0YxKbBSf7TYeYeu+aMSIDiFqo+qXy9/PJEdnbnxUwjzqL76h4SlE m1boxso1UuW+Rgix+F+MbgVWYjhcyHSM5vS/AKUO/tzFEJG5mQyRc+lC28EvvaWlbl4ouCd+jbd epMgjL2PHckgNnD6OWrt+V422Ij8CKExFR7UrYvB0/QlwMcz2em745QR0y2HuhA== X-Received: by 2002:a05:600c:a47:b0:41b:4d5d:9687 with SMTP id c7-20020a05600c0a4700b0041b4d5d9687mr783434wmq.24.1714036975230; Thu, 25 Apr 2024 02:22:55 -0700 (PDT) X-Received: by 2002:a05:600c:a47:b0:41b:4d5d:9687 with SMTP id c7-20020a05600c0a4700b0041b4d5d9687mr783420wmq.24.1714036974803; Thu, 25 Apr 2024 02:22:54 -0700 (PDT) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id e6-20020a05600c4e4600b0041b43e301e8sm1716682wmq.42.2024.04.25.02.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 02:22:54 -0700 (PDT) From: Javier Martinez Canillas To: Steven Price , Andy Yan , boris.brezillon@collabora.com Cc: daniel@ffwll.ch, airlied@gmail.com, liviu.dudau@arm.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Andy Yan Subject: Re: [PATCH] drm/panthor: Add defer probe for firmware load In-Reply-To: <54e4a174-dea7-4588-b8a6-0310c210ffce@arm.com> References: <20240413114938.740631-1-andyshrk@163.com> <54e4a174-dea7-4588-b8a6-0310c210ffce@arm.com> Date: Thu, 25 Apr 2024 11:22:53 +0200 Message-ID: <87frv9zthu.fsf@minerva.mail-host-address-is-not-set> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Steven Price writes: Hello Steven, > On 13/04/2024 12:49, Andy Yan wrote: >> From: Andy Yan >> >> The firmware in the rootfs will not be accessible until we >> are in the SYSTEM_RUNNING state, so return EPROBE_DEFER until >> that point. >> This let the driver can load firmware when it is builtin. > > The usual solution is that the firmware should be placed in the > initrd/initramfs if the module is included there (or built-in). The same > issue was brought up regarding the powervr driver: > > https://lore.kernel.org/dri-devel/20240109120604.603700-1-javierm@redhat.com/T/ > > I'm not sure if that ever actually reached a conclusion though. The > question was deferred to Greg KH but I didn't see Greg actually getting > involved in the thread. > Correct, there was not conclusion reached in that thread. >> Signed-off-by: Andy Yan >> --- >> >> drivers/gpu/drm/panthor/panthor_fw.c | 11 ++++++++++- >> 1 file changed, 10 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c >> index 33c87a59834e..25e375f8333c 100644 >> --- a/drivers/gpu/drm/panthor/panthor_fw.c >> +++ b/drivers/gpu/drm/panthor/panthor_fw.c >> @@ -1336,8 +1336,17 @@ int panthor_fw_init(struct panthor_device *ptdev) >> } >> >> ret = panthor_fw_load(ptdev); >> - if (ret) >> + if (ret) { >> + /* >> + * The firmware in the rootfs will not be accessible until we >> + * are in the SYSTEM_RUNNING state, so return EPROBE_DEFER until >> + * that point. >> + */ >> + if (system_state < SYSTEM_RUNNING) > > This should really only be in the case where ret == -ENOENT - any other > error and the firmware is apparently present but broken in some way, so > there's no point deferring. > > I also suspect we'd need some change in panthor_fw_load() to quieten > error messages if we're going to defer on this, in which case it might > make more sense to move this logic into that function. > In the thread you referenced I suggested to add that logic in request_firmware() (or add a new request_firmware_defer() helper function) that changes the request firmare behaviour to return -EPROBE_DEFER instead of -ENOENT. Since as you mentioned, this isn't specific to panthor and an issue that I also faced with the powervr driver. -- Best regards, Javier Martinez Canillas Core Platforms Red Hat