From patchwork Thu Oct 31 22:48:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janne Grunau X-Patchwork-Id: 2004906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=jannau.net header.i=@jannau.net header.a=rsa-sha256 header.s=fm2 header.b=oBHfkhiT; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=m3KQWZFX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XffmM33Wwz1xwc for ; Fri, 1 Nov 2024 10:08:03 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 77FA288DEA; Fri, 1 Nov 2024 00:07:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=jannau.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=jannau.net header.i=@jannau.net header.b="oBHfkhiT"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="m3KQWZFX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2835A88E0F; Fri, 1 Nov 2024 00:07:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5E27088DEA for ; Fri, 1 Nov 2024 00:07:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=jannau.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=j@jannau.net Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3F47C1140128; Thu, 31 Oct 2024 19:07:51 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Thu, 31 Oct 2024 19:07:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jannau.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm2; t=1730416071; x=1730502471; bh=Ms fYyqNyNn6wcfxl+6IM/K56OGGrWNoakg0hEqPm4mM=; b=oBHfkhiTZqSN937tFH CSs3x3InaTz1e4gEcjIzvshxk8lu72vyhslM20fNTw0tcAJS7CF+3rbie0GHjxKe zX9qw07As89NfxAm1ViGenYUQFY5w7M+qM/E2fIfOlrWdC8vl/c4lxxvQAEsmhZW 1E+2fhtbtY4+pXSZvJLqe6Hscgg0JLfmuh9wpOp50CEMgqpB1VKADqlYO+ABOSTB 4SMrhba4DU4imUEepJAuO/6m7cmnF9l13iOLN9FG563tmVxswF9vhT3ZM2Oy90lk gYN166MiDx9KCagjoTtqbag93/zDxfMXXacg/xuCSLzgz8Cds0NMWOXZ6HMRNM2y Q/TA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1730416071; x=1730502471; bh=MsfYyqNyNn6wcfxl+6IM/K56OGGr WNoakg0hEqPm4mM=; b=m3KQWZFX91PiC2mMENjF+qkndxiW2XsJRJkxp+gQ3NhH EBIa6m34+JGoSAXC2ijBWFngLdkhwGPu5OYM2Z27P09A3djz6q4ey+alrEllp1Gq 8i705crTGiWnvrIU0SVWblpT7NfOLGdL2HVeAW4Tb/+5osUiI37vgSJkdv7Gl91G hr8jTAPvmEokG9pAEETz6sPOkI72CajToTO5HuhihMjuZt2t0qoFK+t+Fow6uUWW oo9mJCV2IfQ+zE08nrqK/4iGqsuocUm0VcbEdAFw/lCqpA6nOIjVu6zzXi4skr1n ZI5Fw6lZCyS8MMEO1kYfhnSWvhWySzUVeOol1GfyFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekkedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffufffkgggtgffvvefosehtjeertdertdejnecu hfhrohhmpeflrghnnhgvucfirhhunhgruhcuoehjsehjrghnnhgruhdrnhgvtheqnecugg ftrfgrthhtvghrnhephfdtueduleejffduvdehkeeutdefhfdtvdeiieegheffleefvedv hfeggeegffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepjhesjhgrnhhnrghurdhnvghtpdhnsggprhgtphhtthhopeeipdhmohguvgepshhm thhpohhuthdprhgtphhtthhopehkvghtthgvnhhishesohhpvghnsghsugdrohhrghdprh gtphhtthhopehtrhhinhhisehkohhnshhulhhkohdrtghomhdprhgtphhtthhopeighihp rhhonhdrghhlphhksehgmhigrdguvgdprhgtphhtthhopehilhhirghsrdgrphgrlhhoug himhgrsheslhhinhgrrhhordhorhhgpdhrtghpthhtohepuhdqsghoohhtsehlihhsthhs rdguvghngidruggvpdhrtghpthhtohepjhesjhgrnhhnrghurdhnvght X-ME-Proxy: Feedback-ID: i47b949f6:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Oct 2024 19:07:50 -0400 (EDT) From: Janne Grunau Subject: [PATCH 0/2] Fix device removal order for Apple dart iommu Date: Thu, 31 Oct 2024 23:48:00 +0100 Message-Id: <20241031-iommu_apple_dart_ordering-v1-0-8a6877946d6b@jannau.net> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIACAJJGcC/x3MQQqDMBBA0avIrBtworHiVUoJwYw6UJMwqSKId ze4fIv/T8gkTBmG6gShnTPHUICvCsbFhZkU+2LQtW6xblBxXNfNupR+ZL2Tv43iyyLMypieOt2 90aCG0iehiY/n/fle1w2f1ruaawAAAA== X-Change-ID: 20241031-iommu_apple_dart_ordering-558e62671512 To: Mark Kettenis , Tom Rini , Heinrich Schuchardt , Ilias Apalodimas Cc: u-boot@lists.denx.de, Janne Grunau X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=824; i=j@jannau.net; s=yk2024; h=from:subject:message-id; bh=LiXKjFyturHNnI1p+Cn4BwXjEsJNBiXFLU+Hx4crCgs=; b=owGbwMvMwCW2UNrmdq9+ahrjabUkhnQVTgUFS5Xdx+ZbLe35/tjv2Me1fGseG599EDn/NZPAh Pme187zdpSwMIhxMciKKbIkab/sYFhdoxhT+yAMZg4rE8gQBi5OAZhIgTfDd5/U7Mm5Uqzpk9wW SV2f2BOWPyHVqDTQo+TVhlWmVzRVGP4XRDsVtVbU3tkZwG0z79ieDdaxjSfqtS88ydwwdZZK/Hk +AA== X-Developer-Key: i=j@jannau.net; a=openpgp; fpr=8B336A6BE4E5695E89B8532B81E806F586338419 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Starting with v2024.10 dev_iommu_dma_unmap calls during device removal trigger a NULL pointer dereference since the the iommu device is removed before its user. The sparsely used DM_FLAG_VITAL flag is intended for this dependency. This series adds it to the Apple dart iommu driver and implements the two phased device removal to the EFI loader. Signed-off-by: Janne Grunau --- Janne Grunau (2): iommu: apple: Mark device with DM_FLAG_VITAL efi_loader: remove non vital devices first drivers/iommu/apple_dart.c | 2 +- lib/efi_loader/efi_boottime.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) --- base-commit: 1d147b74f437fb0e85821e8271fe52bc5fd30194 change-id: 20241031-iommu_apple_dart_ordering-558e62671512 Best regards,