From patchwork Fri Dec 6 01:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 13896266 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) (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 C8C3B154BEA for ; Fri, 6 Dec 2024 01:53:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.153.30 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733450015; cv=none; b=KgthTxw3qzfz4GFy9y7GdBEC+sYhif2LnDx4WoVMCDOif4TmLrJbwYEVrVCusQXR30uE1E1KRiTmHW1NovBzOFevcGofaDg2s4psdRTYSW9dExXwD8SOqkZnaRK/C0srrDURC0HJU7Cm1nu8AwVFJK/g0Z6R3lxeGjHZLjdJogo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733450015; c=relaxed/simple; bh=a6bic9lWReIENxTHeZoG8ChH6lXRFB7Rkje1NanJ8/Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Qui16kqdNuoGa6xZnS26+j5+HplkphPqOoDABt09Mtl5MGBXJmlCWLU0jSYJQXRBmf2nBqHdAI22Y19GF3ODk3gZLrZk7f+m68hsEBx6TSRDle29G2a9c8/lcFUsDMHrbkvgkcP+KM7i1lx6BzRwC0V9M0SUEJ41bJfIhTRsp0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=meta.com; spf=pass smtp.mailfrom=meta.com; dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com header.b=QpbdAmJk; arc=none smtp.client-ip=67.231.153.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=meta.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=meta.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com header.b="QpbdAmJk" Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.18.1.2/8.18.1.2) with ESMTP id 4B605dJ8013872 for ; Thu, 5 Dec 2024 17:53:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=s2048-2021-q4; bh=aqSWgHfWMagd/tVBxU1j+3PESQendeFXQhXEUWomWZI=; b=QpbdAmJkjzgF iYh3gGcrBDjNQGDCBSqOonvTJo9dHOHxO5skvx61cilBsjAGLYhg2i0kDvjAutvl TB0NzDbaLrSj2TftKl5ETJu05MWWmf2dFjLDCff1rI/r4o+1Xp9067sHobFlgQWg lqTVpswYJE4snjQ8YP5gn0GVukU95RqiZNroCilgxmIq4Vp1O4YVu54Jf/Vub8uV 5QhzQfUWj93gckRapfcZVqQ6+/PxLBeQhIkjYaR4vDpXKCzdDs7D201SX1s4Zzio JeNOSvGY8o3KkBYxu68SyLYzlY39I2LRJLa3XJDp3C95Z96RqU2sgSfJKJFJFTk8 4EB0Rqbe9w== Received: from mail.thefacebook.com ([163.114.134.16]) by m0001303.ppops.net (PPS) with ESMTPS id 43bmrwh5m0-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 05 Dec 2024 17:53:32 -0800 (PST) Received: from twshared11082.06.ash8.facebook.com (2620:10d:c085:208::7cb7) by mail.thefacebook.com (2620:10d:c08b:78::2ac9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1544.11; Fri, 6 Dec 2024 01:53:24 +0000 Received: by devbig638.nha1.facebook.com (Postfix, from userid 544533) id 4791315B2115A; Thu, 5 Dec 2024 17:53:09 -0800 (PST) From: Keith Busch To: , , , , , CC: , , Keith Busch Subject: [PATCHv11 08/10] nvme: add a nvme_get_log_lsi helper Date: Thu, 5 Dec 2024 17:53:06 -0800 Message-ID: <20241206015308.3342386-9-kbusch@meta.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241206015308.3342386-1-kbusch@meta.com> References: <20241206015308.3342386-1-kbusch@meta.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: UYqJ3QP0CgkHY_7hpEsbo9-VQJmEkCdg X-Proofpoint-ORIG-GUID: UYqJ3QP0CgkHY_7hpEsbo9-VQJmEkCdg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-05_03,2024-10-04_01,2024-09-30_01 From: Christoph Hellwig For log pages that need to pass in a LSI value, while at the same time not touching all the existing nvme_get_log callers. Signed-off-by: Christoph Hellwig Signed-off-by: Keith Busch --- drivers/nvme/host/core.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 571d4106d256d..36c44be98e38c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -150,6 +150,8 @@ static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl, unsigned nsid); static void nvme_update_keep_alive(struct nvme_ctrl *ctrl, struct nvme_command *cmd); +static int nvme_get_log_lsi(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, + u8 lsp, u8 csi, void *log, size_t size, u64 offset, u16 lsi); void nvme_queue_scan(struct nvme_ctrl *ctrl) { @@ -3074,8 +3076,8 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) return ret; } -int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi, - void *log, size_t size, u64 offset) +static int nvme_get_log_lsi(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, + u8 lsp, u8 csi, void *log, size_t size, u64 offset, u16 lsi) { struct nvme_command c = { }; u32 dwlen = nvme_bytes_to_numd(size); @@ -3089,10 +3091,18 @@ int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi, c.get_log_page.lpol = cpu_to_le32(lower_32_bits(offset)); c.get_log_page.lpou = cpu_to_le32(upper_32_bits(offset)); c.get_log_page.csi = csi; + c.get_log_page.lsi = cpu_to_le16(lsi); return nvme_submit_sync_cmd(ctrl->admin_q, &c, log, size); } +int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi, + void *log, size_t size, u64 offset) +{ + return nvme_get_log_lsi(ctrl, nsid, log_page, lsp, csi, log, size, + offset, 0); +} + static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi, struct nvme_effects_log **log) {