From patchwork Sat Apr 22 03:09:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 13220886 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D41F7C7618E for ; Sat, 22 Apr 2023 03:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbjDVDLh (ORCPT ); Fri, 21 Apr 2023 23:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbjDVDLG (ORCPT ); Fri, 21 Apr 2023 23:11:06 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C737626A0 for ; Fri, 21 Apr 2023 20:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682133027; x=1713669027; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=znHqkqwNSuPjPucEYriJEO69qZyzeo3RyG1Oz5gXgTc=; b=YgCNuCDbUXZo/p5Py0LTqfkHgqUisu3lFawkDBzTzCzNiRdPwXbjrzUi xznzfgGQvHnDXiq6tkGbL1TTMyrGCLlmrVesShBFcWn7DnTwwUo0n1uvf oeWfSmUSrKRheJc2cfn/4elP4/ZahFbh54UNXH3BMPUr8nk51XwnoWxod nHTYOyevIa/hs1w01dEZtP+ys14NJUpTZrcI1jP3G0cJRjt83yHnWcBU2 iqcUtFilfjd9XShQEPDC+BMPdgD7cJhT3IJbjfzcJ5JDNfI7XslcJsnNx ybZ0riezPNsLchDukGT1XOvuAzboa7U7qWan7fYwzKuY+MKQ5CDthaUvr w==; X-IronPort-AV: E=McAfee;i="6600,9927,10687"; a="343609095" X-IronPort-AV: E=Sophos;i="5.99,216,1677571200"; d="scan'208";a="343609095" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 20:10:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10687"; a="757092345" X-IronPort-AV: E=Sophos;i="5.99,216,1677571200"; d="scan'208";a="757092345" Received: from jwostman-mobl2.amr.corp.intel.com (HELO [192.168.1.200]) ([10.212.111.101]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 20:10:03 -0700 From: Vishal Verma Subject: [PATCH ndctl 0/5] cxl: firmware update support for libcxl and cxl-cli Date: Fri, 21 Apr 2023 21:09:58 -0600 Message-Id: <20230405-vv-fw_update-v1-0-722a7a5baea3@intel.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAZQQ2QC/x2NywrDIBAAfyXsOQtW66H9lVKCjzXZy1Y0MYWQf 6/pcRiGOaBSYarwHA4o1LjyRzrcxgHC4mQm5NgZtNJG3ZXF1jDt05ajWwkfykZtTQreeOiJd5X QFydhuaJMElnmy+RCib//0et9nj9T3Xq1eAAAAA== To: linux-cxl@vger.kernel.org Cc: nvdimm@lists.linux.dev, Alison Schofield , Ira Weiny , Dave Jiang , Dan Williams , Vishal Verma X-Mailer: b4 0.13-dev-2eb1a X-Developer-Signature: v=1; a=openpgp-sha256; l=2475; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=znHqkqwNSuPjPucEYriJEO69qZyzeo3RyG1Oz5gXgTc=; b=owGbwMvMwCXGf25diOft7jLG02pJDCnOAVw7LYQrLbT0bPpvvfgW1LP+QGhp0lfmXxNED9tlm zI/nfmzo5SFQYyLQVZMkeXvno+Mx+S25/MEJjjCzGFlAhnCwMUpABPZP4/hf2FynOnGqOXes/0Z 8vdOutITqKcxW7WV3en51DPe59m5jRgZWl787Pu0QPPuYZaIVJHtCoU1gk99jRTcPVM0172vmbW KAQA= X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org Patch 1 is a preparatory patch that teaches memdev based commands to filter their operand memdevs by bus. This helps restricting unit test operations to the cxl_test bus. Patches 2 and 3 add firmware information to the CXL memdev listing. This is derived from the 'Get FW Info' mailbox command as well as state information in the kernel's firmware loader mechanism in sysfs. Patch 4 adds the libcxl APIs to perform a firmware update, and to cancel an in-progress update, and the cxl-cli command to use these APIs to start, wait for, and cancel firmware updates. A man page for the new command is added as well. Patch 5 adds a unit test to exercise all the features described above in a cxl_test environment. Signed-off-by: Vishal Verma --- Vishal Verma (5): cxl/memdev.c: allow filtering memdevs by bus cxl/list: print firmware info in memdev listings cxl/fw_loader: add APIs to get current state of the FW loader mechanism cxl: add an update-firmware command test/cxl-update-firmware: add a unit test for firmware update Documentation/cxl/cxl-disable-memdev.txt | 2 + Documentation/cxl/cxl-enable-memdev.txt | 2 + Documentation/cxl/cxl-free-dpa.txt | 2 + Documentation/cxl/cxl-read-labels.txt | 2 + Documentation/cxl/cxl-reserve-dpa.txt | 2 + Documentation/cxl/cxl-set-partition.txt | 2 + Documentation/cxl/cxl-write-labels.txt | 3 + cxl/lib/private.h | 36 ++++ cxl/lib/libcxl.c | 304 +++++++++++++++++++++++++++++++ cxl/builtin.h | 1 + cxl/filter.h | 5 + cxl/libcxl.h | 36 ++++ cxl/cxl.c | 1 + cxl/filter.c | 19 ++ cxl/json.c | 97 ++++++++++ cxl/list.c | 3 + cxl/memdev.c | 77 +++++++- Documentation/cxl/meson.build | 1 + cxl/lib/libcxl.sym | 10 + test/cxl-update-firmware.sh | 195 ++++++++++++++++++++ test/meson.build | 2 + 21 files changed, 801 insertions(+), 1 deletion(-) --- base-commit: b830c4af984e72e5849c0705669aad2ffa19db13 change-id: 20230405-vv-fw_update-905d253fcb3b Best regards,