From nobody Wed Nov 5 09:04:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499748232142264.8287115145124; Mon, 10 Jul 2017 21:43:52 -0700 (PDT) Received: from localhost ([::1]:44129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUn1a-00064r-V7 for importer@patchew.org; Tue, 11 Jul 2017 00:43:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUmxp-0002nW-0k for qemu-devel@nongnu.org; Tue, 11 Jul 2017 00:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUmxo-0007kY-3k for qemu-devel@nongnu.org; Tue, 11 Jul 2017 00:39:57 -0400 Received: from ozlabs.org ([103.22.144.67]:45285) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUmxn-0007jU-Nv; Tue, 11 Jul 2017 00:39:56 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3x68Vx16sTz9t0j; Tue, 11 Jul 2017 14:39:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1499747961; bh=4BDFhZ5fpFuzcJMA8FXRVve0dWpYAB4ngjlebdTltz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZHRachvzef3rna1PXwWzqammKaaPkJYRIol37Ajpy958W7/WUy4AWyMjgHMJ6P27l Izv25h/92n/k52Vijel7EQnYoVPbLh40yN6Gw+QRtYPjbOgphD1USGabpbCU8J0rzI t5mZHtGrI20arjl3hISoBPbKK3KZ4iJITVqDCUgw= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 11 Jul 2017 14:39:06 +1000 Message-Id: <20170711043917.1757-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170711043917.1757-1-david@gibson.dropbear.id.au> References: <20170711043917.1757-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 06/17] spapr: Leave DR-indicator management to the guest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, surajjs@au1.ibm.com, aik@ozlabs.ru, sbobroff@au1.ibm.com, groug@kaod.org, agraf@suse.de, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The DR-indicator is essentially a "virtual LED" attached to a hotpluggable device, which the guest can set to various states for the attention of the operator or management layers. It's mostly guest managed, except that we once-off set it to ACTIVE/INACTIVE in the attach/detach path. While that makes certain sense, there's no indication in PAPR that the hypervisor should do this, and the drmgr code on the guest side doesn't appear to need it (it will already set the indicator to ACTIVE on hotplug, and INACTIVE on remove). So, leave the DR-indicator entirely to the guest; the only thing we need to do is ensure it's in a sane state on reset. Signed-off-by: David Gibson Reviewed-by: Laurent Vivier Reviewed-by: Greg Kurz --- hw/ppc/spapr_drc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index bd40b84..22d4d81 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -353,8 +353,6 @@ void spapr_drc_attach(sPAPRDRConnector *drc, DeviceStat= e *d, void *fdt, } g_assert(fdt || coldplug); =20 - drc->dr_indicator =3D SPAPR_DR_INDICATOR_ACTIVE; - drc->dev =3D d; drc->fdt =3D fdt; drc->fdt_start_offset =3D fdt_start_offset; @@ -372,8 +370,6 @@ void spapr_drc_attach(sPAPRDRConnector *drc, DeviceStat= e *d, void *fdt, =20 static void spapr_drc_release(sPAPRDRConnector *drc) { - drc->dr_indicator =3D SPAPR_DR_INDICATOR_INACTIVE; - /* Calling release callbacks based on spapr_drc_type(drc). */ switch (spapr_drc_type(drc)) { case SPAPR_DR_CONNECTOR_TYPE_CPU: @@ -454,12 +450,14 @@ static void reset(DeviceState *d) if (spapr_drc_type(drc) !=3D SPAPR_DR_CONNECTOR_TYPE_PCI) { drc->allocation_state =3D SPAPR_DR_ALLOCATION_STATE_USABLE; } + drc->dr_indicator =3D SPAPR_DR_INDICATOR_ACTIVE; } else { /* Otherwise device is absent, but might be hotplugged */ drc->isolation_state =3D SPAPR_DR_ISOLATION_STATE_ISOLATED; if (spapr_drc_type(drc) !=3D SPAPR_DR_CONNECTOR_TYPE_PCI) { drc->allocation_state =3D SPAPR_DR_ALLOCATION_STATE_UNUSABLE; } + drc->dr_indicator =3D SPAPR_DR_INDICATOR_INACTIVE; } } =20 --=20 2.9.4