Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2568947lqp; Mon, 25 Mar 2024 02:59:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUL0gyx2DtFbXMkqxq4N7xFaOb2CGoD9hkOyTpFq/ttC8VDe3zJt5q+cGfOA4gxZXZnuW215J6WBIpnhQCMIkNWsHpiGGwERL6E06VI1A== X-Google-Smtp-Source: AGHT+IE95iMqb1+NZ/rA6VaBU54CTkZ7pf3Vyr2rJR7Bd9f5oNjzXLVu9/yecJG30n3fslZgd4Ii X-Received: by 2002:ac8:7f0d:0:b0:431:4cef:5a8 with SMTP id f13-20020ac87f0d000000b004314cef05a8mr6066743qtk.11.1711360796633; Mon, 25 Mar 2024 02:59:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711360796; cv=pass; d=google.com; s=arc-20160816; b=IHaMO9Y/L73K6KQ2ftr6RmfB2HPow18wLQMMU5bLVwCfL08o+xYJc0hCi+bmAQ9FFS 0BOcBJN19j2fJCWrTaoGYwklN5EOwBVnB0y23NsLhNRQ+4j6ao4DHM6Z3E13CrxD0lPA hKTCvzVJen/6s3/tkdWSJi+sTzjASKVm3hhdz93a/gggNiL2yP3jkicbOtnwiFvEeNCl aROAsEmgmH4dpIVVchaEg1l49K6AdUMMuNE8yHRQFXlpoP5URftdnwMllQrGNWfhLkJ+ ry60DneM0gDNHiGg6xdS8CkcYA/2jDVlXDZ1NyJDVQnZlDgHPsF4G5z/tV+c+RFOTaFw MdUA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=63Rz2qiuxid8zSdREmOtOlSgzwUtPOpZBGkAhbAVjBo=; fh=PahuNMbNcED2tncpKPpx2dmDbxhfmByEV/2R01KyMvs=; b=GpiQEZti2Hwz5x0TobpodyNJ/jJavkYfcUxNNYfwOdmHrCY5XQnH0/i4N5CdB89Ds/ ACMA4gSdFwAqPN+rMykPsIFghiwCI8MSebMvE/b+0a6vP5a5j2XbJXR8WQIdQzGSpIlL jGY6ByclxJhHPfJSON444Kbody8DsMVoS/AVtcSrb8Iib2II4pITMnunWrkMVlxuX9GM WjeCUZZK6TfqX+uPG+BANRDZFQL/E/yLhSnhHGu871NQ6GTvR+Tx8REdQ0SgAIkw4c9N bCWRJSLb1/YwjVJK9ch2Bgoz7L++p8ufFsa/OPgD4S1js8/DF4AK7TbezrIE4IJla5Tw Rh6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VTT2pFn1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115993-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p14-20020a05622a00ce00b004313f52bbd0si4639999qtw.111.2024.03.25.02.59.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VTT2pFn1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115993-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3F6651C32068 for ; Mon, 25 Mar 2024 09:59:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 399E6171092; Mon, 25 Mar 2024 03:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VTT2pFn1" 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 A451F238F26; Sun, 24 Mar 2024 23:18:48 +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=1711322329; cv=none; b=l2wDnJ7OHMLOb7Y1ld6CUq58Xa2nU5inJitXUNUKLXLLI+1WNv2IqohiF+pgmmPTiNkr5yauis6ei2jpvSEhq3NjBZjIJ8nQYbvrjHzhpgS5rp9F1j6hKiwQ2/qBDVavxyrfSwbuKNj+cRkhORAfd2+CrptMWFkMdmfraIKAibo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322329; c=relaxed/simple; bh=Tf/BdClWZkjm4ty8prHKaV6TYXiJjuqx+5eyai5/hKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VLFCcyqh4uOs/pcDipYLkLmUF7SXcxiMGbH3dRCR+42u9g7JKArRT7xpNpWq5hTGhJxClMDUXqM4skZO4t9HAIeOwJiqYW8P7khhORkEDtz+Cf1v0K8yy4tSVcgjKyMjim5A0SVjPlPZ9Veq1N8g35CVDUA0UBoCUglRkmb5RX8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VTT2pFn1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE14AC43601; Sun, 24 Mar 2024 23:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322328; bh=Tf/BdClWZkjm4ty8prHKaV6TYXiJjuqx+5eyai5/hKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VTT2pFn1Mbq+QeJx75kiW6mJgk+wLjqsQfMqnOwV1NRyPH9zzuz/HVVoidiA8+Yi8 24VbSMVfX5F7im9RlRxs02dPIU5mHTsc50EessSzSjgm1huION8MRy2FN02BtWhBn0 PcsDH8kSzBK1saAqD7Q1Mgzg5AjEFIL9ZtRjzCk6b/DYpjak0DZysQRvCEQpJpoVXE ht1Fs+9IgYe07FH4/JmSFg1dzom9mabHFy07gjfjNU+oRyE+pbvMF8YwpKdtkEWwDJ zq0CelgzQ2nasbzr1TN8RowcDg2IxyFLybZzQPBJUrrItVObi4W7mlOoEkBOUECvz0 orKKLKZE1gHPg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Sasha Levin Subject: [PATCH 6.1 411/451] nvme: add the Apple shared tag workaround to nvme_alloc_io_tag_set Date: Sun, 24 Mar 2024 19:11:27 -0400 Message-ID: <20240324231207.1351418-412-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Christoph Hellwig [ Upstream commit 93b24f579c392bac2e491fee79ad5ce5a131992e ] Add the apple shared tag workaround to nvme_alloc_io_tag_set to prepare for using that helper in the PCIe driver. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Stable-dep-of: de105068fead ("nvme: fix reconnection fail due to reserved tag allocation") Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 98a8d90feb37d..951c8946701aa 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -5029,7 +5029,13 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, memset(set, 0, sizeof(*set)); set->ops = ops; set->queue_depth = ctrl->sqsize + 1; - if (ctrl->ops->flags & NVME_F_FABRICS) + /* + * Some Apple controllers requires tags to be unique across admin and + * the (only) I/O queue, so reserve the first 32 tags of the I/O queue. + */ + if (ctrl->quirks & NVME_QUIRK_SHARED_TAGS) + set->reserved_tags = NVME_AQ_DEPTH; + else if (ctrl->ops->flags & NVME_F_FABRICS) set->reserved_tags = NVMF_RESERVED_TAGS; set->numa_node = ctrl->numa_node; set->flags = BLK_MQ_F_SHOULD_MERGE; -- 2.43.0