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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 321B6CCA47C for ; Fri, 3 Jun 2022 20:02:51 +0000 (UTC) Received: from localhost ([::1]:45422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDVS-0006kG-5R for qemu-devel@archiver.kernel.org; Fri, 03 Jun 2022 16:02:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNH-0005xs-OJ; Fri, 03 Jun 2022 15:54:25 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:52501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNG-000895-5t; Fri, 03 Jun 2022 15:54:23 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 58E3A3200958; Fri, 3 Jun 2022 15:54:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 03 Jun 2022 15:54:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286058; x= 1654372458; bh=wW5gFL/gfJnFS2/hmfyGz4hsdcQqlSYQJ7WqS1ZhXxU=; b=a iqLFS0xFi6PuJtz8wgOd1Aac8AIlp9Q0xtylN+te8IlFxnOHutQhS4O4D7SdgLsa zvo6NywFV4p/scDrLqhLF5gRw3CcVHQWIXMDTnkKvdGv6uo3v9lpPYsqaAOlCdWC ppGuc6s8YKS5Ld8oFUYhTMeYjmREb/6CIkavkfBLRfO6yXSCUZ7ov8/fhvo/j2wv ff+hz/RAZozl+CMsv+m9pytFD5iIu645hQS/7opMBQ4erCk2xgU82zcfU0zVMXvz iaFuGliHMThwas1AeOl9Tir5KfzJFwjgkDEpD82xKCbko33VZUBakHbVFn8L71oB V8ws0z50Vu8zAHCTMxjjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286058; x=1654372458; bh=wW5gFL/gfJnFS 2/hmfyGz4hsdcQqlSYQJ7WqS1ZhXxU=; b=L9SVCH9mIZz9th7cm5qQsZUdSRzLO 1NLiGoURZAtewodSJiihBKgn8Ey1MfaNUERevcJ5TmLsvr0cPeuBRB+FQ6SUJ4xF rG2dbdho9zSj2aBaNMOpmITi/s2RIzkmAH9ktL1n5L4cDScDPUsZxpe9N9WI4Oj0 favddstrKtbT2YNFRadvg3508FHkdHltff2z1LkePul8gyfGJWocMWueuUBaBm6n P8OpxNXvxxKoC6KCv7mep8xkKVJ5EhZyX3p9bWLhZEZNMC7YfJCdzFOcSgkW6aF2 lrZAqmVylD8q6xr3PUIm0ylxWioJQy+zRs22FT+ybrAgd8bjBS3xL89RA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:16 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen , zhenwei pi Subject: [PULL 04/11] hw/nvme: fix smart aen Date: Fri, 3 Jun 2022 21:53:47 +0200 Message-Id: <20220603195354.705516-5-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event(). Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning") Acked-by: zhenwei pi Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 08574c4dcbc8..a2f6069f7fe1 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -5325,7 +5325,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeRequest *req) if ((n->temperature >= n->features.temp_thresh_hi) || (n->temperature <= n->features.temp_thresh_low)) { - nvme_smart_event(n, NVME_AER_INFO_SMART_TEMP_THRESH); + nvme_smart_event(n, NVME_SMART_TEMPERATURE); } break; -- 2.36.1