From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796167249; b=GsC5vDrt+ogEOq/dwK2c/M8vS9NEc8FN4BQqiWId5/sAnhgJFvrm6E4h1oYEdrI4l+Nd AdyBe7+de7UeBCWJhu7zHnPlVZz6xNpWHLuQVn5YWrNuVglCeAwDSxrCNHIxDf6VIbwuF pHVelTqlEJXX4+L8bhMRccZlaJzP8mDZbfqwf8NoBVpld2zOUt/RoDt408cxn+9uC5+Rl 9aAYjtnwkrz2cIjhBLjHQ/cDR9ortDfweB/rn3ujBPwt6HlvnimIYt5AFnZh6Ihl2o5UU 8fLtPqLcrSRzxIBxp+2LJ+JvhCI1A/t41qAzKbbvaEv0wOk+bZfAOZp2sZ+wJhrfXuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796167249; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:From: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=mfiH55ppseg0rxU2SvNJ60fqQIfy0MqjUQVfws6Cm/s=; b=e8ZU5ZwX2jH162yaL5WNnywN+evt0srffrH4EH9UsCUcWsBpmeEwJ2DGPaBo498MgFHX NNKMy0uReUvWzrtuo9ExT5KQrnwpOOUuG/PLUhIjqIJaBinH5KPN2peJl73w0+4FxM0MY 2N42dCeC0SnVGLDhMyJbwCKH22eK14JO6VgEEnNMYcNZRPkVKgG3kvEm8WU0E8sDXfNgp cXTA3y7YZw5lzWUH0DeIMADAtSsKCgAVjudgot5Rzw0Ib81pe2ctEmzdpxFEfDD4GQUSr qedZ79ISL3PNqt0x9/zrnYEdHUM8fu+n9ejgqz7j5j7b/eEijAc0jiPXErStw3wZ94w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FoaFUiVx; arc=none smtp.remote-ip=192.198.163.11 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD817606A31A for ; Tue, 1 Dec 2026 23:20:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AD817606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FoaFUiVx DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796167249; x=1827703249; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=mfiH55ppseg0rxU2SvNJ60fqQIfy0MqjUQVfws6Cm/s=; b=FoaFUiVxZkOKK2pqef8O+xQpLdodsLTIplfYWHDGzmL59ADa6UOMugId W9PFnUCTCuqccGztc+x0ryHSsAP6RToZX9tPExHg8m6Sp0VBVv7UH13QA qeSk+dKs0I19oTV/0vOMykpklbYufY292NIgPStOrzvi6qW+ipZRxlF+H T0TqjPJeTmdptRlTeKTTWF+5DqZxGsaWfD+QTSbvGPjpVEqZppbFusr9R GSMA1htfhnVbNVGyi0W7kaca+mE/ZERdiu6k+oIx0fvDMeJXrQXG7GNIL PhTvU2UU9FEXkC1bEVpE9PZAbd7BLMKIDziLVyen3xavpBQ8KuWBUEVcd w==; X-CSE-ConnectionGUID: WKqt0lXiSICF7zTb6SjJlg== X-CSE-MsgGUID: 9r3u1znxSoGnfJYkFgb4NQ== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="4977440" X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="4977440" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 15:20:49 -0800 X-CSE-ConnectionGUID: o/Pg22g7S6aW8SixLyx+2g== X-CSE-MsgGUID: irTy8523RyWYJBbzz2x0eg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="13207552" Received: from gmitchel-mobl2.amr.corp.intel.com (HELO [10.125.111.29]) ([10.125.111.29]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 15:20:48 -0800 Message-ID: <59a544bf-3897-40c5-bf41-90d9e9806aa2@intel.com> Date: Tue, 1 Dec 2026 16:20:46 -0700 X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 3/4] cxl/memdev: Add firmware_activate to activate firmware without a reset To: Davidlohr Bueso , Unsung Lee Cc: linux-cxl@vger.kernel.org, Jonathan Cameron , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , John Groves References: <20261125124358.3583223-1-unsung0317@gmail.com> <20261125124358.3583223-4-unsung0317@gmail.com> <20261127200544.nzz2kbxcwuns5zv6@offworld> From: Dave Jiang Content-Language: en-US In-Reply-To: <20261127200544.nzz2kbxcwuns5zv6@offworld> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 11/27/26 1:05 PM, Davidlohr Bueso wrote: > On Wed, 25 Nov 2026, Unsung Lee wrote: > >> +What:        /sys/bus/cxl/devices/memX/firmware_activate >> +Date:        November, 2026 >> +KernelVersion:    v7.6 >> +Contact:    linux-cxl@vger.kernel.org >> +Description: >> +        (WO) Write a firmware slot number to activate the firmware in >> +        that slot now, without a reset ("online" activation in the >> +        Activate FW command). Firmware uploaded through >> +        /sys/class/firmware/memX/ is set up for activation on the next >> +        cold reset; this attribute lets userspace switch to it earlier. >> +        Like sanitize, this requires the device to be disabled, that >> +        is, not actively decoding any HPA ranges, so the caller has to >> +        take its memory offline and destroy its regions first. The >> +        write fails with EOPNOTSUPP if the device does not support >> +        online activation, EINVAL for an invalid or already active >> +        slot, and EBUSY if the device is decoding memory, a firmware >> +        upload or a sanitize is in progress, or a different slot is set >> +        up for activation on the next cold reset. Only the decoders of >> +        this host are checked. If the device fails the command, the >> +        write fails with the error of the mailbox command: ENXIO for >> +        most device errors, including a device still busy with an >> +        earlier activation, or ETIMEDOUT if the command does not >> +        complete in time. While the device activates, committing a >> +        region on it fails with EBUSY. If the command times out, the >> +        device may still be activating. Until a later write finds the >> +        slot running or an activation succeeds, committing a region >> +        still fails with EBUSY, a firmware upload fails with the error >> +        device-busy, and sanitize and secure erase fail with EBUSY. If >> +        the device ends up keeping its old firmware, this lasts until >> +        cxl_pci is bound again; firmware can be uploaded again after >> +        that. If the device still reports another slot set up for >> +        activation on the next cold reset after the online activation, >> +        a warning is logged. The firmware_version attribute is read >> +        once at probe and is not updated by an online activation; the >> +        version of each slot is available from the Get FW Info command. >> +        If this file is not present, the device does not support >> +        firmware update. > > EWAYTOOLONG ... please less specific details about return codes and comparisons > with with other ABI files. Agreed. And it reads AI generated. In general for commit logs, comments, and documentation, AI tends to be way too wordy on the verbiage. Please rewrite it so it's easily readable for a human and gets to the point. Providing a possible example below. I used an agent to rework it. Feel free to modify further with what Davidlohr asked. What: /sys/bus/cxl/devices/memX/firmware_activate Date: November, 2026 KernelVersion: v7.6 Contact: linux-cxl@vger.kernel.org Description: (WO) Write a slot number to activate its firmware now, with no reset (online Activate FW). Otherwise firmware uploaded through /sys/class/firmware/memX/ activates on the next cold reset. Absent if the device does not support firmware update. Offline the device's memory and destroy its regions first. Only this host's decoders are checked. EOPNOTSUPP: no online activation support. EINVAL: invalid or already active slot. EBUSY: device decoding memory, upload or sanitize in progress, or another slot pending for cold reset. ENXIO: most device errors, including an earlier activation still running. ETIMEDOUT: command timed out. Region commit fails with EBUSY during activation. After ETIMEDOUT, region commit, sanitize and secure erase (EBUSY) and firmware upload (device-busy) stay blocked until a later write finds the slot running or an activation succeeds. If the old firmware stays, rebind cxl_pci to clear this. A warning is logged if another slot is still pending for cold reset afterward. firmware_version is not updated; read slot versions with Get FW Info. > > Thanks, > Davidlohr