From nobody Fri Oct 2 01:10:39 2026 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 A46AE43B48C; Thu, 6 Aug 2026 15:28:47 +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=1786030127; cv=none; b=QzBVUlbksRDcTaXXlZaB48hgiyzfr3+mxnX0qcfLhAtJW69ekQej7e/KetardImS9rQ/VSsqifIbJkDYKYTegQ7j5EfjnxMTXPE3Um+aZb57i/lPZo6BnYEtYXOtc/PtGnbIZlGgKkRSS9mbaUyTTAsKhvcfITseJIzZIOib7/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786030127; c=relaxed/simple; bh=AuhuSDb8wKQjc4FtIZptQtimvxpq2uj7/79koaO+DOU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sebXQ0E/KrYTgZI28IFAjjhXdxZJ+746akrhgPNtRn1tkmCwjl0Vi1yfVX25bipDC6V0PgflpgnswukAkVoZSZvu4bUOFoacwjD61chgKjKkiiAH3iytKXJ3bcCcIH0rgr71Bu90o5lgrQ5PVvaJfShWxLxPS6H/jTP8L9/v2G8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nsXerGy/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nsXerGy/" Received: by smtp.kernel.org (Postfix) with ESMTPS id 55018C2BCB9; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786030127; bh=AuhuSDb8wKQjc4FtIZptQtimvxpq2uj7/79koaO+DOU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nsXerGy/+XEC9jM/LAsZsKFn9Xr9oCqsyJS4kh+1DNCaZhNI5P/8wE//hdPX3Pn7W ItOTv/NXfHHmR9qhMJYoSUBAz2Cqtvyne9fRAuwEHmmz9GZHZ5KJuZLZbvORjMEio1 EHmg5Tohbh3M1rUmbGw1t6dKLkDUMYTIyeX6FcPMdTJcf6ZHGl8/rh51K4zLxzgFTD 8n8qI0CRieF9YrKIeEIZA4LuPllBNIVKLP4nQ1A9g3W8V3U+bJatTCJqhJtWtQmsr4 TE9EHuKM/OesS/uiHFB8QGNLHfU4MtxIoQ0OmdCeGSteALWCLj/igRTzDj7b0X3UAY WiqM3ORm6r5HQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C4B8C56205; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) From: Sven Peter Date: Thu, 06 Aug 2026 17:27:33 +0200 Subject: [PATCH 1/6] nvme-apple: Destroy the admin queue on removal 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-b4-nvme-fwabi-v1-1-bde19ce8db04@kernel.org> References: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> In-Reply-To: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> To: Janne Grunau , Neal Gompa , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Arnd Bergmann Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5378; i=sven@kernel.org; h=from:subject:message-id; bh=AuhuSDb8wKQjc4FtIZptQtimvxpq2uj7/79koaO+DOU=; b=owGbwMvMwCXmIlirolUq95LxtFoSQ1bJCvXMxIjA6y8zzr5m9hWLkhSPWbX2ZeDx6y2Lyi1sV wpu817QUcrCIMbFICumyLJ9v73pk4dvBJduuvQeZg4rE8gQBi5OAZhITzIjw8/PR3/+2hfyOuLR In2JucL/butoM5V8CFQ4HSe/dtfB/hMMf2W6rYw+rZtVNv/k/V8P82KVNk094xE5LdZh4kRlH9a e/awA X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 The admin queue is allocated with blk_mq_alloc_queue() but never destroyed. nvme_free_ctrl() only drops the last reference and blk_mq_exit_queue() and blk_sync_queue() never run: the hctx is never moved to q->unused_hctx_list and the timeout timer and work stay armed on a queue that is about to be freed which will eventually oops inside blk_mq_timeout_work(). This can only be triggered when the controller fails to come up and is then immediately torn down again which is why no one ever ran into this before. Let's just copy what the pcie driver does: unquiesce and destroy the admin queue before nvme_uninit_ctrl(). With this the following WARN followed by a panic no longer happens: WARNING: block/blk-mq.c:4390 at blk_mq_release+0x194/0x238, CPU#4: kworke= r/u34:4/119 CPU: 4 UID: 0 PID: 119 Comm: kworker/u34:4 Not tainted 7.2.0-rc1-dirty #2= 48 PREEMPT Hardware name: Apple Mac mini (M1, 2020) (DT) Workqueue: nvme-wq apple_nvme_remove_dead_ctrl_work pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=3D--) pc : blk_mq_release+0x194/0x238 lr : blk_mq_release+0x58/0x238 sp : ffffc000833a3b50 x29: ffffc000833a3b50 x28: ffff80001d0450f8 x27: ffff800020c95200 x26: 0000000000000088 x25: 0000000000000000 x24: ffff800020f36805 x23: 0000000000000000 x22: ffffc00081a86878 x21: ffff800020be9c60 x20: 0000000000000000 x19: ffff800022501698 x18: 000000000000000a x17: 7365757165722066 x16: 666f7265776f7020 x15: 0000000000000000 x14: 0000000000000028 x13: 0000000000004def x12: 0000000000000003 x11: 0000000000000000 x10: 0000000000000000 x9 : ffffc000805b4fc8 x8 : ffffc00081915820 x7 : ffffc00081c4f3c8 x6 : 0000000000000001 x5 : 0000000000000004 x4 : ffff800022498d80 x3 : ffffc000833a3b14 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff800022501698 Call trace: blk_mq_release+0x194/0x238 (P) blk_put_queue+0x8c/0xf0 nvme_free_ctrl+0x4c/0x260 device_release+0x44/0x128 kobject_put+0xa0/0x120 put_device+0x1c/0x40 nvme_uninit_ctrl+0x48/0x60 apple_nvme_remove+0x54/0xb0 platform_remove+0x28/0x40 device_remove+0x54/0x98 device_release_driver_internal+ device_release_driver+0x20/0x38 apple_nvme_remove_dead_ctrl_wor process_one_work+0x1f4/0x770 worker_thread+0x1b8/0x360 kthread+0x140/0x160 ret_from_fork+0x10/0x20 irq event stamp: 448 hardirqs last enabled at (447):in_unlock_irqrestore+0x74/0x80 hardirqs last disabled at (448): [] el1_brk64+0x20/0x60 softirqs last enabled at (0): [ess+0xb28/0x2698 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace 0000000000000000 Unable to handle kernel NULL pointer dereference at virtual address 00000= 00000000000 Mem abort info: ESR =3D 0x0000000096000005 EC =3D 0x25: DABT (current EL), SET =3D 0, FnV =3D 0 EA =3D 0, S1PTW =3D 0 FSC =3D 0x05: level 1 translation fault Data abort info: ISV =3D 0, ISS =3D 0x00000005, ISS2 =3D 0x00000000 CM =3D 0, WnR =3D 0, TnD =3D 0, TagA GCS =3D 0, Overlay =3D 0, DirtyBit =3D 0, Xs =3D 0 [0000000000000000] user address Internal error: Oops: 0000000096000005 [#1] SMP CPU: 7 UID: 0 PID: 54 Comm: kwor 7.2.0-rc1-dirty #248PREEMPT Tainted: [W]=3DWARN Hardware name: Apple Mac mini (M1, 2020) (DT) Workqueue: kblockd blk_mq_timeou pstate: 01400005 (nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=3D--) pc : percpu_ref_tryget_many.cons lr : percpu_ref_tryget_many.constprop.0+0xc0/0x168 sp : ffffc000829cbce0 x29: ffffc000829cbce0 x28: ffff800020be9f48 x27: ffff800013e503c0 x26: 0000000000000108 x25: 000009c05 x23: 0000000000000000 x22: ffffc000819f5000 x21: ffff800020be9f48 x20: ffff8001deda4808 x19: ffff8000a x17: 00000000580e1fac x16: ffffc00082bbbb7c x15: 0000000000000000 x14: 0000000000000028 x13: 000000001 x11: 0000000000000000 x10: 0000000000000000 x9 : ffffc000829cbc20 x8 : ffffc00081915820 x7 : ffffc0001 x5 : ffff80001ca77d08 x4 : 0000000000000000 x3 : ffff80001ca77cb8 x2 : 0000000000000000 x1 : 000000007 Call trace: percpu_ref_tryget_many.constpro blk_mq_timeout_work+0x48/0x298 process_one_work+0x1f4/0x770 worker_thread+0x1b8/0x360 kthread+0x140/0x160 ret_from_fork+0x10/0x20 Code: 91282000 97ed44b2 17ffffd2 ---[ end trace 0000000000000000 ]--- Fixes: 5bd2927aceba ("nvme-apple: Add initial Apple SoC NVMe driver") Signed-off-by: Sven Peter Tested-by: Janne Grunau Tested-by: Joshua Peisach Tested-by: Nick Chan # pre-M1 controllers --- drivers/nvme/host/apple.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index be3b91b43ea5..321502847a2c 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -1636,6 +1636,15 @@ static void apple_nvme_remove(struct platform_device= *pdev) nvme_stop_ctrl(&anv->ctrl); nvme_remove_namespaces(&anv->ctrl); apple_nvme_disable(anv, true); + if (anv->ctrl.admin_q && !blk_queue_dying(anv->ctrl.admin_q)) { + /* + * If the controller was reset during removal, it's possible + * user requests may be waiting on a stopped queue. Start the + * queue to flush these to completion. + */ + nvme_unquiesce_admin_queue(&anv->ctrl); + blk_mq_destroy_queue(anv->ctrl.admin_q); + } nvme_uninit_ctrl(&anv->ctrl); =20 if (apple_rtkit_is_running(anv->rtk)) { --=20 2.55.0 From nobody Fri Oct 2 01:10:39 2026 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 A47C043FD2B; Thu, 6 Aug 2026 15:28:47 +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=1786030127; cv=none; b=EzDSOYe7RUzMlj7EbzXpHfeYR/d4A3XiaPiiWLinJbR1AjNMs92LGsOi8O0m8qoM02JLQx2yjBmsp4lXAXbarAYUjAip0Vh9DqRbldOADg0ccGwK8i0fMvv7ZpvTg/aKeEzM/7juCW5tg5O9m7jH5fq/NDqjoUGPA+dFNFnas8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786030127; c=relaxed/simple; bh=6Q/s+CU1jpcGZ6EF4+2fc7K8wZes4JUuaLdDIeWZEvE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VmDWg4UANg5/s0dBQViLaiXsX6jXUGlcKJIHxMS812U/1zd6lxFlfym4JYeRoEHmvzjYYAlEs09y/NiUFgjkL0T+M+Z/Z52Z3hXJbjDmaH7mDF02NT80PmqpHt9mR2j4RBzaIYm1RPLjkuQgTsANAIMcx1NC5gbZoiTsGkurW/A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bNu2pfiN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bNu2pfiN" Received: by smtp.kernel.org (Postfix) with ESMTPS id 682B3C2BCF5; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786030127; bh=6Q/s+CU1jpcGZ6EF4+2fc7K8wZes4JUuaLdDIeWZEvE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bNu2pfiNPO4rW4yxyAemjAMMYATMfOi6mdBgliZjLTQcrhoRNrlYFegVi0mkLAfJ3 MHtwE4yAHq7TF3uqkuoW2CPxToTFe2VWJ3odxjrAlnthbkuDVgHsH8DkVMhU/DJRF+ 9rWwsPdMwxBICp1+8z++18hTILaxvdZ6vJdiCOcjPAi9HdBOUq9PK0cwgc2EnJSo5A h/Hu1+8zuShRDVvIWwFnB+I/gibFlx1ioAUDv9Hn+tTlDeC5TQqW/PthHtP12dgUwc mc3pj1bW6t9uI/r7x/g3FuqarXinXS8a/fF1YpfJ9jzbggCLK40kApiezD1Z8+cUE2 +QI39Sm/avgeg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D187C56207; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) From: Sven Peter Date: Thu, 06 Aug 2026 17:27:34 +0200 Subject: [PATCH 2/6] nvme-apple: Don't set a DMA direction for commands without a data transfer 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-b4-nvme-fwabi-v1-2-bde19ce8db04@kernel.org> References: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> In-Reply-To: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> To: Janne Grunau , Neal Gompa , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Arnd Bergmann Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1006; i=sven@kernel.org; h=from:subject:message-id; bh=6Q/s+CU1jpcGZ6EF4+2fc7K8wZes4JUuaLdDIeWZEvE=; b=owGbwMvMwCXmIlirolUq95LxtFoSQ1bJCo1Ci7YTJ/Rde1f9ieC46p6heE9usf/Ngm1HjzDnu nlx87R1lLIwiHExyIopsmzfb2/65OEbwaWbLr2HmcPKBDKEgYtTACbia8bwm0VC95rI952nKy5O k+yrOnvNPvxZiqP1g4rFlnrf6tO1axj+KUirywmJL1G+vHKK1P2DUx+5l/DL5W+7ub7a6YPfq7y 5/AA= X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 Setting the DMA direction for commands that don't do any transfer likely triggered the PRP NULL check for which we needed a chicken bit. That bit has disappeared starting with macOS 15 so let's just do this correctly instead. Fixes: 5bd2927aceba ("nvme-apple: Add initial Apple SoC NVMe driver") Signed-off-by: Sven Peter Tested-by: Janne Grunau Tested-by: Joshua Peisach Tested-by: Nick Chan # pre-M1 controllers --- drivers/nvme/host/apple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index 321502847a2c..f134b5ffb774 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -324,7 +324,9 @@ static void apple_nvme_submit_cmd_t8103(struct apple_nv= me_queue *q, tcb->length =3D cmd->rw.length; tcb->command_id =3D tag; =20 - if (nvme_is_write(cmd)) + if (!cmd->common.dptr.prp1) + tcb->dma_flags =3D 0; + else if (nvme_is_write(cmd)) tcb->dma_flags =3D APPLE_ANS_TCB_DMA_TO_DEVICE; else tcb->dma_flags =3D APPLE_ANS_TCB_DMA_FROM_DEVICE; --=20 2.55.0 From nobody Fri Oct 2 01:10:39 2026 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 B461744C65C; Thu, 6 Aug 2026 15:28:47 +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=1786030127; cv=none; b=kJ57MI6sMIZFX4WIG5XwziB8/Mtuaqr/pVw1F08m0qhj20q7zeMIkoFf7RUP7LbSjAY2E5QtmGGzPEBARMyH1O5QcRNSMMIgmOaMyjb463TAzJGigbvmBL0DPw92GF+QQxZ64NsX7RugtRFbGV+UANQaLUVZ54OaYNJxKJ3cACY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786030127; c=relaxed/simple; bh=ZLJDszrW9HD7IRTiZASdqbu+USSjGBXGFe43o7bNZrE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oT525PvNpH4nZrOHzGuDLXq6xeMSopwN9UbqRlSWz0PDCkd/1auYUMSB55wGa+1U+X3HQW6L7xJK6CB4dMxbkwcm5KstfuVB4PevAfofeGNGlpVLK2k/Tp8WMjIz0wDRFxMUdWydi8ZPAviLQNh9zbQ2eGzqAMGyAk9A/HFbGSE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y9KSw6SS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y9KSw6SS" Received: by smtp.kernel.org (Postfix) with ESMTPS id 78CEBC2BCFB; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786030127; bh=ZLJDszrW9HD7IRTiZASdqbu+USSjGBXGFe43o7bNZrE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y9KSw6SS00/FkdWaCDU9ttBeuCnjmYqQurygFg7wS8q2EP1VwVUKScUZbrJ0raRvP 9xwdJxOGyKJbQT4pq57PAKXV/DGr2CU+zsoU2827PDka30p2Afnw0+iMnOz5dlNwwQ r35hP3i1Br7B+iRY2CjlSmaXXsUFjjtCWDI7TUvD/XJEFtovT2d5QMp+xq79Uuj0S5 BCoTCdy1S8K4hNi2AsiaV9H9KA7bXdRyYdwLzijHh+dQFHvOhNKgs+H16bDBkdeyUw ws/MzQY2VcMYlHVjdESr9zlgXybt9sH4VOtgyfcyizJ1k7MuSFnWBY7Ohmhv6CweCV P3jLA9FXuLPwQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F343C5AC80; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) From: Sven Peter Date: Thu, 06 Aug 2026 17:27:35 +0200 Subject: [PATCH 3/6] nvme-apple: Never set the opcode in the NVMMU TCB 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-b4-nvme-fwabi-v1-3-bde19ce8db04@kernel.org> References: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> In-Reply-To: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> To: Janne Grunau , Neal Gompa , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Arnd Bergmann Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=886; i=sven@kernel.org; h=from:subject:message-id; bh=ZLJDszrW9HD7IRTiZASdqbu+USSjGBXGFe43o7bNZrE=; b=owGbwMvMwCXmIlirolUq95LxtFoSQ1bJCs1X7mvXfs/qzv/Z+SRtRfHCDXzeYa3rU07/nnaAW 4A5xXVJRykLgxgXg6yYIsv2/famTx6+EVy66dJ7mDmsTCBDGLg4BWAiClwM/xSr2SOetRTk7dYq b5eMDpu0sOv1iupH95N6u4XWXgkMSWb4nxZbsJudseTDGu8vb72W7N96Yv9x994rH97JTROx4J+ /jh0A X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 macOS always sets this to zero and the firmware starting with macOS 15 has started to complain about what we're doing here. Fixes: 5bd2927aceba ("nvme-apple: Add initial Apple SoC NVMe driver") Signed-off-by: Sven Peter Tested-by: Janne Grunau Tested-by: Joshua Peisach Tested-by: Nick Chan # pre-M1 controllers --- drivers/nvme/host/apple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index f134b5ffb774..1ea732c3df1c 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -318,7 +318,7 @@ static void apple_nvme_submit_cmd_t8103(struct apple_nv= me_queue *q, u32 tag =3D nvme_tag_from_cid(cmd->common.command_id); struct apple_nvmmu_tcb *tcb =3D &q->tcbs[tag]; =20 - tcb->opcode =3D cmd->common.opcode; + tcb->opcode =3D 0; tcb->prp1 =3D cmd->common.dptr.prp1; tcb->prp2 =3D cmd->common.dptr.prp2; tcb->length =3D cmd->rw.length; --=20 2.55.0 From nobody Fri Oct 2 01:10:39 2026 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 C32764534BB; Thu, 6 Aug 2026 15:28:47 +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=1786030127; cv=none; b=Xh1xksEvGP7EWXYApxV3R2aLwT6M7cxFH5vw0HsJF37T4ZUAJzgWkTUXWD88n0mcnuBKYDN7qxBDrr+4d1GxcxiUsFgdtLdcZb61rmTjj+fZVh7QHxGQPz6ujUVdLL6lTq97iAJJtDqNTv3A5SlKDCvPqhvTvYrWSMmqWIsOlJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786030127; c=relaxed/simple; bh=rnfZSyqO5SxgLMFGkmg/ZiNzhEcvBz3iBs6yNUTN09k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WHVF1Ue7HVnCgroZypBLIb6/hEr2AFEDCRri1DjrFuytX345x/k6Pu4Sz61pZ8KcP41St0hjqYNiYMp0uHJnhjOxe+8n22AD4R7eyPhhQ2Y9X1b+O17vjYFmIoQHaRwhQp4/9yWQUasEU2ha/fXBuAXROKxf+eKbnNRzp6mfWUE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cXLO/y2i; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cXLO/y2i" Received: by smtp.kernel.org (Postfix) with ESMTPS id 84F7CC4AF0B; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786030127; bh=rnfZSyqO5SxgLMFGkmg/ZiNzhEcvBz3iBs6yNUTN09k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cXLO/y2iBrkRJpz1HlXGXMF5tqD4vP6yXuiJ5N/JA9d3ES3IW3qZBa4G4qlMFW0IN ANUJkZ7UyC4KE/SvOjgAnzsVTfywDMkOI1suFMLiML7oSFrApabMBQSOY4+H5cBen3 SMk2OgF/eoZO0kRL4aevw/IZT+lg3yxU50P4xN9YZXOONHft97Zfz3j/8F8b9PJpPs U9NdZt76eGqNU72tvTaOpzHs8MhJOHfphKj9tFXjTxeRy7L5bRobDl6/IQhdBclc1x 7Jr7yLihREEHH+zS90U5MWzjLeLZ2btqvHnbMgLuN439+QemAVNCfepEopBhWXKkTE GKn0kp0X/h5IQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FDD8C5AC7C; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) From: Sven Peter Date: Thu, 06 Aug 2026 17:27:36 +0200 Subject: [PATCH 4/6] nvme: Add a quirk for page aligned admin queue buffers 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-b4-nvme-fwabi-v1-4-bde19ce8db04@kernel.org> References: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> In-Reply-To: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> To: Janne Grunau , Neal Gompa , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Arnd Bergmann Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2136; i=sven@kernel.org; h=from:subject:message-id; bh=rnfZSyqO5SxgLMFGkmg/ZiNzhEcvBz3iBs6yNUTN09k=; b=owGbwMvMwCXmIlirolUq95LxtFoSQ1bJCq1E/91fzvDpvbrK9eVqntrGnKjps5NrFtdxfDy5a I3sj0t8HaUsDGJcDLJiiizb99ubPnn4RnDppkvvYeawMoEMYeDiFICJfHJm+Gf3On25DI/Ixa5f X4tCNr8yD+f50fPxgtROpovBzW1Sd0wZ/ie/4RQPl78t8tNZ/4W6Ye6eiPmrrz6cN38H27VrDle WrucCAA== X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 Apple controllers seem to require any queue buffers on the admin queue to be aligned to the NVMe controller page size. Weirdly, this constraint does not apply to the i/o queue where any alignment is fine. This has always been required on pre-M1 controllers and is required starting with macOS 15 firmware or post-M4 controllers again. On M1/M2/M3 we only got away with this because there was a chicken bit to disable this requirement. Let's add a quirk that enforces this alignment. Signed-off-by: Sven Peter Tested-by: Janne Grunau Tested-by: Joshua Peisach Tested-by: Nick Chan # pre-M1 controllers --- drivers/nvme/host/core.c | 5 ++++- drivers/nvme/host/nvme.h | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 453c1f0b2dd0..b76f4e4d8850 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2071,7 +2071,10 @@ static void nvme_set_ctrl_limits(struct nvme_ctrl *c= trl, lim->max_integrity_segments =3D ctrl->max_integrity_segments; lim->virt_boundary_mask =3D ctrl->ops->get_virt_boundary(ctrl, is_admin); lim->max_segment_size =3D UINT_MAX; - lim->dma_alignment =3D 3; + if (is_admin && (ctrl->quirks & NVME_QUIRK_ADMIN_PAGE_ALIGN)) + lim->dma_alignment =3D NVME_CTRL_PAGE_SIZE - 1; + else + lim->dma_alignment =3D 3; } =20 static bool nvme_update_disk_info(struct nvme_ns *ns, struct nvme_id_ns *i= d, diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 824651cc898d..957ded0c6f53 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -178,6 +178,11 @@ enum nvme_quirks { * Align dma pool segment size to 512 bytes */ NVME_QUIRK_DMAPOOL_ALIGN_512 =3D (1 << 22), + + /* + * Admin queue DMA buffers must be page aligned + */ + NVME_QUIRK_ADMIN_PAGE_ALIGN =3D (1 << 23), }; =20 static inline char *nvme_quirk_name(enum nvme_quirks q) @@ -229,6 +234,8 @@ static inline char *nvme_quirk_name(enum nvme_quirks q) return "broken_msi"; case NVME_QUIRK_DMAPOOL_ALIGN_512: return "dmapool_align_512"; + case NVME_QUIRK_ADMIN_PAGE_ALIGN: + return "admin_page_align"; } =20 return "unknown"; --=20 2.55.0 From nobody Fri Oct 2 01:10:39 2026 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 D4FA247AF75; Thu, 6 Aug 2026 15:28:47 +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=1786030127; cv=none; b=lUTnuVRcORz46iwwo7lT+/RJAvZsWgUrlJh+jtpoLQFo8gldcJ2AHcRcD9xiCPViyTOBtL3VdeWf00g8wIQrjBT/s39J+SaONbQcVfv5GSzUDwcyDPS+Wzvxa6Aqia1EQ8a0jmvuILNGhUTgKJnx1FeRiIEnRPZ0srO7y1o6ACY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786030127; c=relaxed/simple; bh=dAxz+dTFl0FTz8kxXwslhiRnWUyMoDrUdWvhssxEJSw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PTrHFesPEWcYGhE7zSWsfPfI+KbvAbVHSePlwK6lUEvGOK81hzeasKS7e1AUsEwILic9xOG80Wk9FY0HHN0buipaNJbVWFXxZs2YswjPzOeOk4KPnyEpZnswWMYS5JBbrB/OM1SAe46mZ5MJhEQPYxPL6st5WDoyRb7VBb+Urjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KUO6FoT0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KUO6FoT0" Received: by smtp.kernel.org (Postfix) with ESMTPS id 932C2C2BD01; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786030127; bh=dAxz+dTFl0FTz8kxXwslhiRnWUyMoDrUdWvhssxEJSw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KUO6FoT0yqyl2dQPlXccPllRhl4ypwRdrI0bAMN0cMNzqZyg8Rw+69dJWMx4hD4ry GeweXlf0T1PfqIvynTaX+z7AWV1q+NMrgrhm0Ga03DXdQhalP8+yEAe6hxEb1LcHMC zl0RBX2MyAjGdEi9MqObjaWtbsvhuNVyfLlb9OzlZunCzHXmUlDwbUyBTFWRAQIvZ4 dSIpsykUH0FQeFiOwryvDdKhVCErp7mIH9ddCLys6K60A5nvaauBGcyNelRKsXJIiW IT1lKRA3o6ZJYzgmIbXCRGakroxnggLqgz6jOwSuny2l8C0k56wwmXTYWdrppjQkmG EbGYaZIM4r+Iw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E1E3C56205; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) From: Sven Peter Date: Thu, 06 Aug 2026 17:27:37 +0200 Subject: [PATCH 5/6] nvme-apple: Require page aligned buffers on the admin queue 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-b4-nvme-fwabi-v1-5-bde19ce8db04@kernel.org> References: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> In-Reply-To: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> To: Janne Grunau , Neal Gompa , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Arnd Bergmann Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1155; i=sven@kernel.org; h=from:subject:message-id; bh=dAxz+dTFl0FTz8kxXwslhiRnWUyMoDrUdWvhssxEJSw=; b=owGbwMvMwCXmIlirolUq95LxtFoSQ1bJCu3jwav3XP1gL5oT/P+sw+uG28fLbRzP2HXuuqm9Y KqmsFZsRykLgxgXg6yYIsv2/famTx6+EVy66dJ7mDmsTCBDGLg4BWAiXNqMDF/OO2w1/yDVs+r0 lENcfPv4Ll9/LSBQE+HVtm/ril16m/4x/I+tfMy6KcTqqJiu0HneHhtxU5H1wuZSM5/OCfn/7+P TDk4A X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 Now that we have a quick to align buffers on the admin queue to the NVMe controller page size use it for Apple controllers. This fixes pre-M1 controllers, which always rejected unaligned requests, and also makes this driver work for M4 SoCs and for M1/M2/M3 SoCs that have been updated to the firmware shipped with macOS 15. Fixes: 5bd2927aceba ("nvme-apple: Add initial Apple SoC NVMe driver") Signed-off-by: Sven Peter Tested-by: Janne Grunau Tested-by: Joshua Peisach Tested-by: Nick Chan # pre-M1 controllers --- drivers/nvme/host/apple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index 1ea732c3df1c..78f89b5679e5 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -1583,7 +1583,8 @@ static struct apple_nvme *apple_nvme_alloc(struct pla= tform_device *pdev) } =20 ret =3D nvme_init_ctrl(&anv->ctrl, anv->dev, &nvme_ctrl_ops, - NVME_QUIRK_SKIP_CID_GEN | NVME_QUIRK_IDENTIFY_CNS); + NVME_QUIRK_SKIP_CID_GEN | NVME_QUIRK_IDENTIFY_CNS | + NVME_QUIRK_ADMIN_PAGE_ALIGN); if (ret) { dev_err_probe(dev, ret, "Failed to initialize nvme_ctrl"); goto put_dev; --=20 2.55.0 From nobody Fri Oct 2 01:10:39 2026 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 D4B9647AF6F; Thu, 6 Aug 2026 15:28:47 +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=1786030127; cv=none; b=dyQfnnkk7gE1cv12nVsuMTah4L17FurL3P9qLAyLlVzqpkC2lFYUJyYkf/wGelnLICYo0kQz+e36ks8JkaDEoDP7Xk3hrC6q7edqJ0Dxak+wo3kfbYOq+GBndtOj+AcAeo5NfanoMfhbKyuIaE1LDgC5rEDvmHKVFodh59p8y3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786030127; c=relaxed/simple; bh=YxBzcKnSFS/hs7Z6ZB2yAm0XU5wv5qxZmHDbDUlH1so=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JdZpEN0MSsp6z7EaIdDyh/yGASGst/3o2SpymtP3zAd1JFlprfZCpnLCQEEBP7nI5oHpn8xAFZpLK2RARWTQIaSGgsCc1U3n4H4y4iHzChExXd1SIlG4HCYJseEgGkdrpVwsS6cv+qitO5cNOUIfaasCHQjSARdJpY++MXan2BE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rIzbwdeF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rIzbwdeF" Received: by smtp.kernel.org (Postfix) with ESMTPS id A5956C2BCF7; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1786030127; bh=YxBzcKnSFS/hs7Z6ZB2yAm0XU5wv5qxZmHDbDUlH1so=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rIzbwdeF3ZCdd01M+KYWYEYL6jSkwAO4FkUwgZFiOIGgvTDC+B6zKRU8zxE6DSMAL RqwblFxs8UEbTMsxj0dbn7LBBWoIaLlsoeZZYVaPctzP1Jw3jBM8UuhMDX9Jafh0T3 0QRF/w3AlUQDfxEQqfQf7BelQdrE2wcm4kNjjfVddPbRZrA+q1w2u8UAEApPC+a+kI ktZs3fn4mC5gQVgaARpmUS86yZczTDZbM6sekoVsdxlthHXqalGopMIT1K0SE1s3zO uzJes6c7FD/Nu5EqoBER1RC8PII8yYvLSUjTNW9nuOlxtNSzyusu7f0PKxt9dqBXTW sRoVphMTNe1vw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CC1DC56208; Thu, 6 Aug 2026 15:28:47 +0000 (UTC) From: Sven Peter Date: Thu, 06 Aug 2026 17:27:38 +0200 Subject: [PATCH 6/6] nvme-apple: Drop the PRP null check chicken bit 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260806-b4-nvme-fwabi-v1-6-bde19ce8db04@kernel.org> References: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> In-Reply-To: <20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org> To: Janne Grunau , Neal Gompa , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Arnd Bergmann Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1941; i=sven@kernel.org; h=from:subject:message-id; bh=YxBzcKnSFS/hs7Z6ZB2yAm0XU5wv5qxZmHDbDUlH1so=; b=owGbwMvMwCXmIlirolUq95LxtFoSQ1bJCp3+P3XspXXZp+S/LvvxxCa4t3kKT7zkhKjNH0pcx Q/WhLF0lLIwiHExyIopsmzfb2/65OEbwaWbLr2HmcPKBDKEgYtTACYyaQIjw+qi5gKbfSf7NWV+ fK+33TfR8mlZgl6E6Ksfnx/7HNIxmMnIMD/3TkTyRp0doQ9vxm14oc5lOps3Y0Fd58ZI/ecT9Zg iuAA= X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 Now that we program the DMA direction correctly the NULL check that used to make commands fail passes. Another side effect of this bit was that non-align buffers on the admin queue were silently allowed and that's been fixed now as well and we this don't need this chicken bit anymore. More importantly, starting with the firmware installed with macOS 15, which is required for M4 but can also be installed on the previous SoCs, the controller no longer exposes this control register and any access SErrors instead. Just drop the write entirely. Fixes: 5bd2927aceba ("nvme-apple: Add initial Apple SoC NVMe driver") Signed-off-by: Sven Peter Tested-by: Janne Grunau Tested-by: Joshua Peisach Tested-by: Nick Chan # pre-M1 controllers --- drivers/nvme/host/apple.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index 78f89b5679e5..bf1c32c66153 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -47,9 +47,6 @@ #define APPLE_ANS_BOOT_STATUS 0x1300 #define APPLE_ANS_BOOT_STATUS_OK 0xde71ce55 =20 -#define APPLE_ANS_UNKNOWN_CTRL 0x24008 -#define APPLE_ANS_PRP_NULL_CHECK BIT(11) - #define APPLE_ANS_LINEAR_SQ_CTRL 0x24908 #define APPLE_ANS_LINEAR_SQ_EN BIT(0) =20 @@ -1127,17 +1124,6 @@ static void apple_nvme_reset_work(struct work_struct= *work) /* Setup the NVMMU for the maximum admin and IO queue depth */ writel(anv->hw->max_queue_depth - 1, anv->mmio_nvme + APPLE_NVMMU_NUM_TCBS); - - /* - * This is probably a chicken bit: without it all commands - * where any PRP is set to zero (including those that don't use - * that field) fail and the co-processor complains about - * "completed with err BAD_CMD-" or a "NULL_PRP_PTR_ERR" in the - * syslog - */ - writel(readl(anv->mmio_nvme + APPLE_ANS_UNKNOWN_CTRL) & - ~APPLE_ANS_PRP_NULL_CHECK, - anv->mmio_nvme + APPLE_ANS_UNKNOWN_CTRL); } =20 /* Setup the admin queue */ --=20 2.55.0