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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACEFFC4332F for ; Thu, 15 Dec 2022 17:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbiLORku (ORCPT ); Thu, 15 Dec 2022 12:40:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbiLORkt (ORCPT ); Thu, 15 Dec 2022 12:40:49 -0500 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6279A11C0E; Thu, 15 Dec 2022 09:40:48 -0800 (PST) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1441d7d40c6so152231fac.8; Thu, 15 Dec 2022 09:40:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mOGeJCS8aseFoPpUkMU2Y4kwt5b3YZhRZvuAq9SJfKA=; b=nQfBcdq4P4kJOFZbn3Xs8Wdi8qfKjljPBeoP/rdg94nEpEAQ4i1BJz7GAAnVKnD0Iy OZrsVZPxc2DC+Y5+mjUVVJ9QpG6jH0PxbXOxlsM/Iuoto8ujw+4k7gKJnFHq9BQuCk8m zTJXihtqAeRlGNKNabx5boIaSWhh1C2UgSj5NBUf9qZ/yPQh4Kzt7Q8BAnq0bl9aR29n 6FnV/SXRh+ueH/jHCCnlCi3jDtpk+pG3goHaJykPQmChTexo0YqTsXZ3J0mpyJGAUx74 uS3Yfi3ujovNmAX55+NpHb1xsbqSN5G3wTGIRlTpsZ/fGaAfEjvyvQT2RILD+qOLH9hC lPiw== X-Gm-Message-State: ANoB5plvtpTpM9FJTJ0jqaldxgmPNDJXTUgICYyhyuscnwghKQutQYeo oIriOh5xxXGqU9M4opLuCind8o4A4Q== X-Google-Smtp-Source: AA0mqf5h6CDTjYTwJacILJW30d37epd29oSWO8w00AjAR8sBcTn2iUkKrX0wxIRE86d0fVPdqaeslA== X-Received: by 2002:a05:6871:4387:b0:144:ae30:1bb7 with SMTP id lv7-20020a056871438700b00144ae301bb7mr15094587oab.48.1671126047572; Thu, 15 Dec 2022 09:40:47 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id r22-20020a056870581600b00143c7a9bdb0sm4263731oap.27.2022.12.15.09.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 09:40:47 -0800 (PST) Received: (nullmailer pid 260537 invoked by uid 1000); Thu, 15 Dec 2022 17:40:46 -0000 Date: Thu, 15 Dec 2022 11:40:46 -0600 From: Rob Herring To: Alexander Sverdlin Cc: Linus Walleij , Frank Rowand , Lukasz Majewski , Arnd Bergmann , devicetree@vger.kernel.org, Nikita Shubin , Rob Herring , linux-kernel@vger.kernel.org, Hartley Sweeten Subject: Re: [PATCH] of: fdt: Honor CONFIG_CMDLINE* even without /chosen node Message-ID: <167112600086.259523.16908827852183615525.robh@kernel.org> References: <11af73e05bad75e4ef49067515e3214f6d944b3d.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11af73e05bad75e4ef49067515e3214f6d944b3d.camel@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, 12 Dec 2022 00:58:17 +0100, Alexander Sverdlin wrote: > I do not read a strict requirement on /chosen node in either ePAPR or in > Documentation/devicetree. Help text for CONFIG_CMDLINE and > CONFIG_CMDLINE_EXTEND doesn't make their behavior explicitly dependent on > the presence of /chosen or the presense of /chosen/bootargs. > > However the early check for /chosen and bailing out in > early_init_dt_scan_chosen() skips CONFIG_CMDLINE handling which is not > really related to /chosen node or the particular method of passing cmdline > from bootloader. > > This leads to counterintuitive combinations (assuming > CONFIG_CMDLINE_EXTEND=y): > > a) bootargs="foo", CONFIG_CMDLINE="bar" => cmdline=="foo bar" > b) /chosen missing, CONFIG_CMDLINE="bar" => cmdline=="" > c) bootargs="", CONFIG_CMDLINE="bar" => cmdline==" bar" > > Move CONFIG_CMDLINE handling outside of early_init_dt_scan_chosen() so that > cases b and c above result in the same cmdline. > > Signed-off-by: Alexander Sverdlin > --- > drivers/of/fdt.c | 40 ++++++++++++++++++++-------------------- > 1 file changed, 20 insertions(+), 20 deletions(-) > Applied, thanks!