Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp457140lqp; Sat, 13 Apr 2024 04:50:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUP9dnKRCJn7zBV/RvtLrWYiCYpDOouF3wzVxv6r5chTBGcM/c9NbKgma9fctsDERnyt+gUlf2rf8Gpy21sxsSR+Y496FmJyrY3PG0iQw== X-Google-Smtp-Source: AGHT+IGYi6F1uJNkzJmNdkYhvlZyX4QDFnRQiunxxZ0IGANMbjOgD1lJydHd1BoWs9rAOLas+bnf X-Received: by 2002:a17:906:f28d:b0:a51:b19d:b1d with SMTP id gu13-20020a170906f28d00b00a51b19d0b1dmr3175999ejb.33.1713009055219; Sat, 13 Apr 2024 04:50:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713009055; cv=pass; d=google.com; s=arc-20160816; b=yN/OZ1LbqyA4txU9EgwGldwDRmGC6oWpDIHvjsWnt3IKfDWh6j0NqDp7j/vkh2X5NZ 9pq3cD16PI7oTrRQFpkfh/PgPTQycRHq586jyB9DSOTuzBY+zGqzS3sevAhjXjfixXzw HfdM2Duo/fRWr2zztJ/zstV4QpNJV+K5f6HH9/z+saQNQuWP3l0ckLR1SeWlwG7v8e+s LSbX9mEs2QW6hryFCtx4hOL2lJHyfJ3FsTt74WCiTep6GUbz0hm3G7Vu2aPuk30vX8N8 PNrCBziTcqvmDnGGu7CeDwo80Se9HTWV1hwufIlfJXckUbBtGU3u4KAhR80/e4CX12kq FBbg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=C/i+RNq5Pzo3i3TYLnj/DsICAobD6rQqS8xqCwClBB8=; fh=TjEqUJrdxAgLcPjMVwXD1tyZIu1hyvxzQK92zwjQc8E=; b=Pvj+TR+Im0TkAnWwayF505h87uTaWI5EPtb/920pruwUfbMEZIBijYaDlqOO7yK6hH rB0vn1wzgZDAb38T2AMZlqY0Xsv2B+JEbP3KT1rwh9BeaDJ+ZKahG8L0/X3ycpSMNiiG c32ah4tE922CimVTKrWOCgyidWStZsrFdWUewsaRN4VR571n3Q3nHod9+nhm4V2K8FDF IJKGhYfnZhOm9CoxOIjqF03vecP3oPIFh4VFpD2v+upmoANRJZpdcTtMLXm0wyUMZlsK /aoPXw4VlFacPGDQuWuOznk7pI0zv+bwPYXQsP/amM58a5O0dgLgVKXD3kxDix3q2ODb aUGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=UPNMQpXN; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-143725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143725-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ht19-20020a170907609300b00a52385938b6si1588761ejc.70.2024.04.13.04.50.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 04:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=UPNMQpXN; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-143725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143725-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.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 am.mirrors.kernel.org (Postfix) with ESMTPS id EDE741F22093 for ; Sat, 13 Apr 2024 11:50:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C578F3FB9A; Sat, 13 Apr 2024 11:50:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="UPNMQpXN" Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE94F1C2A5 for ; Sat, 13 Apr 2024 11:50:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713009048; cv=none; b=D0uQq3V3Y4snNMBjl1sTi69/6IOwbNIiCDVPcotdJkD8zwJ7YxNKlVjU8YG10+WqSfXtA9ZvWrkNDe1EACmKWG6w/oee6fgpRjelFl786LMtYIWK5HPb9OCcJvqxvNc+UJhjgtSXnxVH8IzmCEzTSXYS2AM5rH9eeI0H8yz1Llo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713009048; c=relaxed/simple; bh=PtC7jHiLyTKBTG9iP7AvPgc+6ZXScdOk3HuslgLZ8wE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YeEFbdFq1r1q/xJbVpYP49ML7zmsLtYmqapQ2NjB2Ov3r9XiWghkeIIIaCw7gH7U8zL9BjYhUj0jwOxEfLfXy2/ad/AlhR/afTHkbsWObDsI8qD8gylOb3ibI6ogaxmFRuPP1L9kKPSiO5R2xbUzS83Y9mbCU5rUJdriIlgt/Hw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=UPNMQpXN; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=C/i+R Nq5Pzo3i3TYLnj/DsICAobD6rQqS8xqCwClBB8=; b=UPNMQpXNGkCqNPfm/uiqr 2JLtqx5FZ36szmAX/TW6XXOB3u/8XlO7c1ZjCSGYrO542eBkWiM9MfDktyvIqC9w NfF9P5APJbRxV5gLjeh2MHduBSbPEPpeQOolaVPxVYgvglUD9sO0rfvbCpsIBf+9 NBiH31uQOjv+9dDiQgAofE= Received: from ProDesk.. (unknown [58.22.7.114]) by gzga-smtp-mta-g3-5 (Coremail) with SMTP id _____wD3n+hVcRpmDvQVBA--.50814S2; Sat, 13 Apr 2024 19:49:45 +0800 (CST) From: Andy Yan To: boris.brezillon@collabora.com Cc: daniel@ffwll.ch, airlied@gmail.com, liviu.dudau@arm.com, maarten.lankhorst@linux.intel.com, steven.price@arm.com, tzimmermann@suse.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Andy Yan Subject: [PATCH] drm/panthor: Add defer probe for firmware load Date: Sat, 13 Apr 2024 19:49:38 +0800 Message-Id: <20240413114938.740631-1-andyshrk@163.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wD3n+hVcRpmDvQVBA--.50814S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruryxWryrCr4fKF1rKw1kuFg_yoWDtwc_CF 4jyr1fXw48Ga4qqF1vka129Fy2kF4rZF1kZanYq34fCrnrGasrt39Fqry3W3y5WF10vasr ua4UXr40krW7CjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU84v3UUUUUU== X-CM-SenderInfo: 5dqg52xkunqiywtou0bp/xtbBEBu-XmVODWy+XAABsD 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. 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) + ret = -EPROBE_DEFER; + goto err_unplug_fw; + } ret = panthor_vm_active(fw->vm); if (ret) -- 2.34.1