From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F313C433DB for ; Thu, 28 Jan 2021 07:52:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9D6D06146D for ; Thu, 28 Jan 2021 07:52:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D6D06146D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5264-0007On-At for qemu-devel@archiver.kernel.org; Thu, 28 Jan 2021 02:52:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l520I-00086f-HW for qemu-devel@nongnu.org; Thu, 28 Jan 2021 02:46:11 -0500 Received: from 2.mo51.mail-out.ovh.net ([178.33.255.19]:57769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l520F-0001Tu-5V for qemu-devel@nongnu.org; Thu, 28 Jan 2021 02:46:10 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.109.146.249]) by mo51.mail-out.ovh.net (Postfix) with ESMTPS id D216F25F264; Thu, 28 Jan 2021 08:46:02 +0100 (CET) Received: from kaod.org (37.59.142.103) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 28 Jan 2021 08:46:01 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-103G005c4938a37-9af3-4be5-b539-1e46df94340d, E57BA53B85CD0AA8C573FC380C1E6825DC018892) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Subject: Re: [PATCH 4/7] ppc/pnv: Simplify pnv_bmc_create() To: Joel Stanley References: <20210126171059.307867-1-clg@kaod.org> <20210126171059.307867-5-clg@kaod.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <9ea1ce11-15ba-3eea-f7a4-b036a9db841f@kaod.org> Date: Thu, 28 Jan 2021 08:46:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.103] X-ClientProxiedBy: DAG9EX1.mxp5.local (172.16.2.81) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 748b7f0c-dd9a-4511-9061-a0b6dff79531 X-Ovh-Tracer-Id: 7762516909986712483 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrvdelgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkffffgggjggtgfhisehtkeertddtfeejnecuhfhrohhmpeevrogurhhitggpnfgvpgfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepjeekudeuudevleegudeugeekleffveeludejteffiedvledvgfekueefudehheefnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrddutdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehgrhhouhhgsehkrghougdrohhrgh Received-SPF: pass client-ip=178.33.255.19; envelope-from=clg@kaod.org; helo=2.mo51.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU Developers , qemu-ppc@nongnu.org, Greg Kurz , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 1/28/21 1:46 AM, Joel Stanley wrote: > On Tue, 26 Jan 2021 at 17:14, Cédric Le Goater wrote: >> >> and reuse pnv_bmc_set_pnor() to share the setting of the PNOR. >> >> Signed-off-by: Cédric Le Goater >> --- >> hw/ppc/pnv_bmc.c | 7 +------ >> 1 file changed, 1 insertion(+), 6 deletions(-) >> >> diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c >> index 67ebb16c4d5f..86d16b493539 100644 >> --- a/hw/ppc/pnv_bmc.c >> +++ b/hw/ppc/pnv_bmc.c >> @@ -260,13 +260,8 @@ IPMIBmc *pnv_bmc_create(PnvPnor *pnor) >> Object *obj; >> >> obj = object_new(TYPE_IPMI_BMC_SIMULATOR); >> - object_ref(OBJECT(pnor)); >> - object_property_add_const_link(obj, "pnor", OBJECT(pnor)); > > I assume it's ok to move the link set to after the realise of the BMC object? When 2 objects need to be linked, one has to be realized first. I suppose this is why it is allowed but I am not expert in that area. Greg ? That was the case already when defining a "ipmi-bmc-sim" device on the command line. C. >> qdev_realize(DEVICE(obj), NULL, &error_fatal); >> - >> - /* Install the HIOMAP protocol handlers to access the PNOR */ >> - ipmi_sim_register_netfn(IPMI_BMC_SIMULATOR(obj), IPMI_NETFN_OEM, >> - &hiomap_netfn); >> + pnv_bmc_set_pnor(IPMI_BMC(obj), pnor); >> >> return IPMI_BMC(obj); >> } >> -- >> 2.26.2 >> >>