From patchwork Tue Jan 18 20:25:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Schofield X-Patchwork-Id: 12716854 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 2CB232CA9 for ; Tue, 18 Jan 2022 20:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642537232; x=1674073232; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+vOG/MGG3HFOK6Q+Ameq9bNgHeIQFxU/FTVdUSHEkes=; b=EYWfrf32gV0Sl8ZACISmg4uBVoKWrjRI32nf7lp9HIfijLJ4lC+ICPf7 HNSLzEdJf8joDrhmyFGsUOTtXs1J/MGkK8QnBZ5bLurJ7LwhV7m3UScBF UX/R8h26lqcNBLhfshPd2ZEeqBvxvmHXgtzv7mRqsDsNrb5+phYxNx3Ee vFq2+iSwRmdXQ9Ib09HGyYYXWveTCDzfd2Owd1EBARq4AiwdZKUQI5X+e M0UQWjY++dxw5CGDfxnuGEF+BSTX4mysqHn4ymTfi/Vhl1lv5wpQDAOMX Hp8DW+wyeQXuS8PlX958oePIS+ej9NhMNCJQcEPLaolKe8bXy8yyQ8n6O g==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="331259487" X-IronPort-AV: E=Sophos;i="5.88,298,1635231600"; d="scan'208";a="331259487" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 12:20:31 -0800 X-IronPort-AV: E=Sophos;i="5.88,298,1635231600"; d="scan'208";a="671953858" Received: from alison-desk.jf.intel.com (HELO localhost) ([10.54.74.41]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 12:20:30 -0800 From: alison.schofield@intel.com To: Ben Widawsky , Dan Williams , Ira Weiny , Vishal Verma Cc: Alison Schofield , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org Subject: [ndctl PATCH v3 3/6] libcxl: return the partition alignment field in bytes Date: Tue, 18 Jan 2022 12:25:12 -0800 Message-Id: <6e295b9c3ab676906e6f58588b54071ea968e0cd.1642535478.git.alison.schofield@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Alison Schofield Per the CXL specification, the partition alignment field reports the alignment value in multiples of 256MB. In the libcxl API, values for all capacity fields are defined to return bytes. Update the partition alignment accessor to return bytes so that it is in sync with other capacity related fields. Signed-off-by: Alison Schofield Reviewed-by: Dan Williams --- cxl/lib/libcxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c index 1fd584a..5b1fc32 100644 --- a/cxl/lib/libcxl.c +++ b/cxl/lib/libcxl.c @@ -1089,7 +1089,7 @@ CXL_EXPORT unsigned long long cxl_cmd_identify_get_partition_align( if (cmd->status < 0) return cmd->status; - return le64_to_cpu(id->partition_align); + return le64_to_cpu(id->partition_align) * CXL_CAPACITY_MULTIPLIER; } CXL_EXPORT unsigned int cxl_cmd_identify_get_label_size(struct cxl_cmd *cmd)