Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1678835imu; Wed, 28 Nov 2018 13:18:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/UqGvayc3y//wSicZwvtkQELh+qsaDBpDw9GmmU+gIcDARDO8GixTQV2fFjCPbWsokaYmKg X-Received: by 2002:a63:1a4b:: with SMTP id a11mr34869382pgm.254.1543439896900; Wed, 28 Nov 2018 13:18:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543439896; cv=none; d=google.com; s=arc-20160816; b=GNXnvmEIRwGva35Y9BUCYiTjwxOhn5wbVyDPLM9rsiuiUrRP5bAUAGjRPhnWUREKDS lbUXaJ9+V3SXxxMV3pDhqb3s+EiVfnJmUeG6mjd3J0zZ6DfnGRw7hIe6xIY8FpYovyBu sXubv2OR8WcTTdaZm9Tvh6RjaBTmbjI8njhyDimc4r/zSSa1LqR0xZkwDlKHF2+52xgq t9SKa3XYnce4fvK0hCvircfkqudFEld34rj9I1N7woFF1iQj86KBZKIgpRdw3iha7FAX Qp8WCwUKzj/4Ym456vXSF5WDqTId+llUcf4qSo1mgF5wmz/5X0tfJev6bligfmRKz2FU qN5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IiNaVtKhvmS19HLFHQeYpsd8hxsgA80ROtxZu4ccph4=; b=jD7blosIp+wY598att3gvBD1VYj0fkAWCu6+WguoWShQD8hts3StwGTLfeibweXsHS nUpcAL9HkD0eMtCyFKR+RZFPc6YGBBLodTBbb16k3C662LU7WSQKGU0cAld+hZYjrjgI OzJceU1y2sU8g24XKdW067GrLbEjWK7IEqeni8xjfw3zOFpxLlvYyoYZW9JTqdWtB0F5 TQtdyBkt8RGkeAUCZ+NmL8qB7VjwonjBoxkC1q9UtqFhUU/nhDugds5/DKSOQjLa+ZVf wBgpm2fPZBAUjEgDzeTWJ5K4agGrzZ4E2NcMQxiYHJNvR5asOTgNaegDzPfFVsF8w/jG 3veA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="J/h+if3q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si2924526ply.409.2018.11.28.13.18.01; Wed, 28 Nov 2018 13:18:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="J/h+if3q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726498AbeK2ITq (ORCPT + 99 others); Thu, 29 Nov 2018 03:19:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:39372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726188AbeK2ITp (ORCPT ); Thu, 29 Nov 2018 03:19:45 -0500 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 116D12133F; Wed, 28 Nov 2018 21:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543439806; bh=eToAFo4MzrP94ConyJkWrG02WSbR735hlb6Wlk7Jq3c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=J/h+if3qpvhT6dcleEF1JzFNBfpx8jYf1F1XWHwDFFkx/pDnaP5Hw2AJaeNmIHLeT oz+6geOBMUN96SOgeIOF4uOQNPBG2ZalhyHJ913abCDj4vWiLde3ZoUD04YoSazIGK GhKNglxG/b09vgIovxQLSVhn4CQAegi3LYQd2Lgw= Received: by mail-qk1-f182.google.com with SMTP id y78so6972467qka.12; Wed, 28 Nov 2018 13:16:46 -0800 (PST) X-Gm-Message-State: AA+aEWZWmaMHxlAO0rrwSV1ti2j4EwF34XUpnxY7YeokV2S1XAQK3JyC arU3nn1iqGONIrrC6rQlPiBst9UfQRE8CCLbng== X-Received: by 2002:ae9:edd8:: with SMTP id c207mr34364085qkg.184.1543439805217; Wed, 28 Nov 2018 13:16:45 -0800 (PST) MIME-Version: 1.0 References: <20181128193636.254378-1-brendanhiggins@google.com> <20181128193636.254378-17-brendanhiggins@google.com> In-Reply-To: <20181128193636.254378-17-brendanhiggins@google.com> From: Rob Herring Date: Wed, 28 Nov 2018 15:16:34 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC v3 16/19] arch: um: make UML unflatten device tree when testing To: Brendan Higgins Cc: Greg Kroah-Hartman , Kees Cook , "Luis R. Rodriguez" , shuah@kernel.org, Joel Stanley , Michael Ellerman , Joe Perches , brakmo@fb.com, Steven Rostedt , "Bird, Timothy" , Kevin Hilman , Julia Lawall , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, "linux-kernel@vger.kernel.org" , Jeff Dike , Richard Weinberger , linux-um@lists.infradead.org, Daniel Vetter , dri-devel , Dan Williams , linux-nvdimm , Kieran Bingham , Frank Rowand , knut.omang@oracle.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 28, 2018 at 1:38 PM Brendan Higgins wrote: > > Make UML unflatten any present device trees when running KUnit tests. > > Signed-off-by: Brendan Higgins > --- > arch/um/kernel/um_arch.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c > index a818ccef30ca2..bd58ae3bf4148 100644 > --- a/arch/um/kernel/um_arch.c > +++ b/arch/um/kernel/um_arch.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -347,6 +348,9 @@ void __init setup_arch(char **cmdline_p) > read_initrd(); > > paging_init(); > +#if IS_ENABLED(CONFIG_OF_UNITTEST) > + unflatten_device_tree(); > +#endif Kind of strange to have this in the arch code. I'd rather have this in the unittest code if possible. Can we have an initcall conditional on CONFIG_UM in the unittest do this? Side note, use a C if with IS_ENABLED() whenever possible instead of pre-processor #if. I'll take a fix separately as it was on my todo to fix. I've got the unit tests running in a gitlab CI job now[1]. Rob [1] https://gitlab.com/robherring/linux-dt-unittest/pipelines