From nobody Sun Feb 8 14:52:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602691156; cv=none; d=zohomail.com; s=zohoarc; b=BWUtm8/WEleGD61WKWS67rqzGcYImX/r5Ayl0i/F7ThBoHPmq/JUQ09hwBqJG0+Mfa/htJEOLu4hbkT94MbCJEouyyuWCdjclLzSAxQHNZD3jIlx1DiDM1UTQTDHAMjNORvh1cdDq1DWymaNP3YHKS2kbJqGBE4d2sTZPR19cNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602691156; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=QyCXoVZFq8inv3p7sgwPGouRR8crt3jaKhnpEZxJyes=; b=VKiFXW4p1gs29jVFmhV+U+8HykyYt39cAB58FV2QqstLCthed0CT/dz6E9p0HKbhHgarqbFK6hpAdHcX7bWlsFysOD5x/i2aC1IcDrsa96JBpGpThw7dhvAyKEeDBPPMzy/bzlj5n06sHflmKGTpcIfogfzjJiPlgCh+0l0vywI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 160269115661264.0338301908622; Wed, 14 Oct 2020 08:59:16 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-3oLUb-XkP8-asZ0Q0I09og-1; Wed, 14 Oct 2020 11:59:13 -0400 Received: by mail-wr1-f69.google.com with SMTP id b11so1559179wrm.3 for ; Wed, 14 Oct 2020 08:59:13 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id g139sm158863wme.2.2020.10.14.08.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 08:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602691155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QyCXoVZFq8inv3p7sgwPGouRR8crt3jaKhnpEZxJyes=; b=YhMzEXOMcnTON3CWth/lsU8MDORmHceNklEIGFmmRV17mM4oBqKEBySmKFy6o8xh4oYIKr sWH7T67NjciDu5RalrKguyuxzPVlHEvCOjhhD7l4tbeMV2yerZMQVFgwSIkefW1BuJyIR7 R/vsUtvTyIK4uvaaeDHnKa3HCciY8Zc= X-MC-Unique: 3oLUb-XkP8-asZ0Q0I09og-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QyCXoVZFq8inv3p7sgwPGouRR8crt3jaKhnpEZxJyes=; b=tYxVy8flmfydj0pDAcILDMNJxIlqvXS44b81MpZAKopGWTnup05FtANiFR9KEw5+XK iOM/SOEU5KWisE2Tx3MKmHLxFmhUhf3wZkwNhLZsEcMtCXAIKsR8gYdT7KUtf6ARf0q3 Ico4BsNcpN0r9wWazmksKLBB8z84AeUGi4J/jejzdi3B3Y0XZmAT1gnN5evIXWpyoeT7 LdzzHuHtkjvm5TecENgjj+Ig3Cifyequ3NQwPW+us1g9O7iq+kSbrqy8lkZRADknjqPn Ek5LNcmagQ2eR1zNmtPJnKWhugUUGSH0LDcgSHY2sjTIoyPlSg2EEV9T7owOeg5evbb8 ug2w== X-Gm-Message-State: AOAM530DYKANW0dRDqo25MV2yqNMskgGp6ZlpigNrrB9Ae0X+J4geKoI b2VwCrheSz2JD32ITMB4mFrhKSn67sM4Qf0+bzMv8wLFjkXpnRoOiXlZVckD3/zvYVPVyDQyR/3 bqge5Fn4tTe8WnQ== X-Received: by 2002:a5d:558e:: with SMTP id i14mr6742854wrv.40.1602691152731; Wed, 14 Oct 2020 08:59:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvgeZSzRI+G99Y25lH/EWje7a/1IUyrssbWQ/uBHCdOCDXF42aJI52Cwfl/+kF6VcXix3tAA== X-Received: by 2002:a5d:558e:: with SMTP id i14mr6742838wrv.40.1602691152595; Wed, 14 Oct 2020 08:59:12 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Fam Zheng , Stefan Hajnoczi , Kevin Wolf , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 12/15] block/nvme: Simplify device reset Date: Wed, 14 Oct 2020 17:58:07 +0200 Message-Id: <20201014155810.102841-13-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201014155810.102841-1-philmd@redhat.com> References: <20201014155810.102841-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Avoid multiple endianess conversion by using device endianess. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index fad727416ee..299fc82f40f 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -747,7 +747,7 @@ static int nvme_init(BlockDriverState *bs, const char *= device, int namespace, timeout_ms =3D MIN(500 * NVME_CAP_TO(cap), 30000); =20 /* Reset device to get a clean state. */ - regs->cc =3D cpu_to_le32(le32_to_cpu(regs->cc) & 0xFE); + regs->cc &=3D const_le32(0xFE); /* Wait for CSTS.RDY =3D 0. */ deadline =3D qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + timeout_ms * SCA= LE_MS; while (NVME_CSTS_RDY(le32_to_cpu(regs->csts))) { --=20 2.26.2