Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 15E7241A795; Sat, 12 Sep 2026 13:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789219450; cv=none; b=ZA1z1mJyVueCeckz39w/6nmyK/CtidqKmOE8631JKIsv48UMTddJv8FFvt2Z9bKaQuIUwiTH98hceqGrZTlxkwYx9e/4r7Lv+hHOOsNd5TOIclU6OrLtnWI/3I9A4cKj3tzG2oQbQBgiQo05KGy2bZ0/EX/3WoPX/RQw0726LP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789219450; c=relaxed/simple; bh=DxKLfA3BHI2ZaxRyaNiEpWZ+l2dbfjaWVE68NrEP/Qo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KJcFg/r/J6WaI7g5QuR70rBcqffnxcVxYDdezu8g1BUEk1Zi4mhiwUj5YJ5G4UpF9IW0pi+7/UKPhEwUbZiYSQiPdjTSaopMy3dykiAIbQEqY1jfb3C3rl5cq1AgCdgshOQamFlqP0pqZXp21bXE9mZeYmvp3I/qOxacEvZxydE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XfbGhLnx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XfbGhLnx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF9BC1F00893; Sat, 12 Sep 2026 13:24:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789219449; bh=2DVAJj8mZ+Xwuxs5q3/nu8/pQjOTc6o7UgrzWdP8uJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XfbGhLnxlX7/PVEOTVzC6UrwuCGmu4pXiCUuZWFBlH1ypeIUE7MZALtoWjwbT+9s/ 7GnUNePrB2ZNr5U38vPGt3ZUNke5C0y6Vr7XgQQ0lUzVm/UJ50T4bxHLADYmuaXWuE 5B2jWs17L5Oh5NMSJBAYchgQ3YjCDcG97cQ+INgY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sven Peter , Nick Chan , Keith Busch , Sasha Levin Subject: [PATCH 6.12 1354/1376] nvme-apple: Prevent shared tags across queues on Apple A11 Date: Sat, 12 Sep 2026 09:03:00 +0200 Message-ID: <20260912065637.710882753@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nick Chan [ Upstream commit 6fe0687245e8406bf26143bd45eb16441bbe5280 ] On Apple A11, tags of pending commands must be unique across the admin and IO queues, else the firmware crashes with "duplicate tag error for tag N", with N being the tag. Apply the existing workaround for M1 of reserving two tags for the admin queue to A11. Cc: stable@vger.kernel.org Fixes: 04d8ecf37b5e ("nvme: apple: Add Apple A11 support") Reviewed-by: Sven Peter Signed-off-by: Nick Chan Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/host/apple.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index 5f745bf615fe7..1cc222fdbf22e 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -239,7 +239,7 @@ static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q) { struct apple_nvme *anv = queue_to_apple_nvme(q); - if (q->is_adminq && anv->hw->has_lsq_nvmmu) + if (q->is_adminq) return APPLE_NVME_AQ_DEPTH; return anv->hw->max_queue_depth; @@ -317,7 +317,7 @@ static void apple_nvme_submit_cmd_t8015(struct apple_nvme_queue *q, memcpy((void *)q->sqes + (q->sq_tail << APPLE_NVME_IOSQES), cmd, sizeof(*cmd)); - if (++q->sq_tail == anv->hw->max_queue_depth) + if (++q->sq_tail == apple_nvme_queue_depth(q)) q->sq_tail = 0; writel(q->sq_tail, q->sq_db); @@ -1130,10 +1130,7 @@ static void apple_nvme_reset_work(struct work_struct *work) } /* Setup the admin queue */ - if (anv->hw->has_lsq_nvmmu) - aqa = APPLE_NVME_AQ_DEPTH - 1; - else - aqa = anv->hw->max_queue_depth - 1; + aqa = APPLE_NVME_AQ_DEPTH - 1; aqa |= aqa << 16; writel(aqa, anv->mmio_nvme + NVME_REG_AQA); writeq(anv->adminq.sq_dma_addr, anv->mmio_nvme + NVME_REG_ASQ); @@ -1316,8 +1313,7 @@ static int apple_nvme_alloc_tagsets(struct apple_nvme *anv) * both queues. The admin queue gets the first APPLE_NVME_AQ_DEPTH which * must be marked as reserved in the IO queue. */ - if (anv->hw->has_lsq_nvmmu) - anv->tagset.reserved_tags = APPLE_NVME_AQ_DEPTH; + anv->tagset.reserved_tags = APPLE_NVME_AQ_DEPTH; anv->tagset.queue_depth = anv->hw->max_queue_depth - 1; anv->tagset.timeout = NVME_IO_TIMEOUT; anv->tagset.numa_node = NUMA_NO_NODE; -- 2.53.0