From nobody Mon Sep 23 09:40:15 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XByg72Z5gz511ZZ for ; Mon, 23 Sep 2024 09:41:23 +0000 (UTC) (envelope-from mail@eseipi.net) Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [IPv6:2001:41d0:203:375::aa]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XByg620d2z4ZxS for ; Mon, 23 Sep 2024 09:41:22 +0000 (UTC) (envelope-from mail@eseipi.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=eseipi.net header.s=key1 header.b=yFqGlOu8; dmarc=pass (policy=quarantine) header.from=eseipi.net; spf=pass (mx1.freebsd.org: domain of mail@eseipi.net designates 2001:41d0:203:375::aa as permitted sender) smtp.mailfrom=mail@eseipi.net Date: Mon, 23 Sep 2024 09:40:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eseipi.net; s=key1; t=1727084474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=PUbQFSuCDfmyMNHtM6iMC6V9b5zi7ynIgRvb8KrXiJE=; b=yFqGlOu8tHbispkFwsiYogZLeN71Jp6p31vs+zEkM5VcO6+mOHuzva4Jg7mC9AJQzPvYm7 MGVH0aCnl7/4BJwgh85gt3HcrrX+y+0/qs6X5E7dVtcyvpbtiKsHRJchp5dp3IT0ThFCaQ kLCuGlMrNP1Eac6W3lwZu37FWxgF1IT/YZ5+ZsJzJzGozgmKhxbOVYKJb3346nGPN61FX1 AJ7Tn14mY1o3cffE7m6Vuz9DcuzX/oeClLrsHazgY1vh3tPfTRT1SgXQoQwVTe8oSFgoaY 7I89Y+JdrvRiWrR1QkhcaXsFFSjDKYXCs+icP2skAhv5kU0rYsqpGqWVru5/FA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Alexey Sukhoguzov To: freebsd-hackers@freebsd.org Subject: nvme(4): some non-operational power states are broken Message-ID: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Migadu-Flow: FLOW_OUT X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.994]; DMARC_POLICY_ALLOW(-0.50)[eseipi.net,quarantine]; R_SPF_ALLOW(-0.20)[+ip6:2001:41d0:203:375::/64]; R_DKIM_ALLOW(-0.20)[eseipi.net:s=key1]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16276, ipnet:2001:41d0::/32, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; TO_DN_NONE(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[eseipi.net:+] X-Rspamd-Queue-Id: 4XByg620d2z4ZxS X-Spamd-Bar: --- Hi, My NVMe controller is Toshiba XG5, and it has 6 power states: the first three (0-2) are normal and the last three (3-5) are NOPS. Here is 'nvmecontrol power -l nvme0' output: # Max pwr Enter Lat Exit Lat RT RL WT WL Idle Pwr Act Pwr Workloadd -- -------- --------- --------- -- -- -- -- -------- -------- -- 0: 8.0000W 0.000ms 0.000ms 0 0 0 0 0.0000W 0.0000W 0 1: 3.9000W 0.000ms 0.000ms 1 1 1 1 0.0000W 0.0000W 0 2: 2.0000W 0.000ms 0.000ms 2 2 2 2 0.0000W 0.0000W 0 3: 0.0500W* 1.500ms 1.500ms 3 3 3 3 0.0000W 0.0000W 0 4: 0.0050W* 6.000ms 14.000ms 4 4 4 4 0.0000W 0.0000W 0 5: 0.0030W* 50.000ms 80.000ms 5 5 5 5 0.0000W 0.0000W 0 The problem is that only one of the NOPS is working as expected (state 3). Another two (states 4-5) skyrocket the controller's power consumption far beyond normal (0-2) power states do, and far beyond reasonable. For example, when the controller is in state 3, my system consumes about 3-3.5 W at idle (according to acpiconf with laptop power cable unplugged), in states 0-2 - about 4 W, and in states 4-5 consumption is approaching 6 W. Thus, the NVMe becomes the hottest part of the system (>50C, still idle), and it eats up almost half of the battery alone. Linux doesn't have this issue, so it seems to be nvme(4) related. All the above data is collected on 14.1-RELEASE Live USB with no filesystem mounted. 15-CURRENT has the same problem. Any ideas what it might be? Regards, Alexey