Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4345040imm; Tue, 11 Sep 2018 10:26:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYfw7lwq1mvRki0/OgZqWqzAyZQzmTf5xBB3T28Boc7kNyvbVN9fzS0MbbR0DJYDwd4UZXk X-Received: by 2002:a63:586:: with SMTP id 128-v6mr29485800pgf.169.1536686784162; Tue, 11 Sep 2018 10:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536686784; cv=none; d=google.com; s=arc-20160816; b=zCf18vRfdOn1JKPXoS5ndbw02F9mLRT7fwNlpsZP2MVyVMY9Acc+VffIkfjhGL8QaT vIW3u1sr8z1LPYw/36ySDtBLOyclouwInRqIEarH1mSuUuVt6kn0L8BqsBrEF41Z74Vk XgNpTbrFndz4A6o5DhVNmNu2DzRE/K1j4KzwkffGevfgdqS+aQtybnQ5KN1rbw5Ime1o lE+w0p60Ul4q3XnI49oONFyJlPnk/RDaGjHi4Sl9wjST4BI/4tJV8JbqQHCG67DC/HNq SskI//T9L0vnlsqVIo14MkEicDPsi2cxtXRA4WSiQkcj3AqBgbEfTQPZQ2TZ3D+rJ+Ra Telw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tnZDfr5csmZ8Qs+HOUfb9PLl5Tfza2qrsw7k99YYvCk=; b=EYqs/AEzvPvpseW/dkkGc6RZlc/wayGiqsz3Wb/SsawxM3qTQkTKBYdk2tGAkkSJrM 4K74tH9f9ROLNES2iiiTuy3AVYZaNWyHaxfZwIsmvAKjQm2egaiRy4LfOTylpsSlqnJC 1uje2m1X0QlTYTDX8LL0cqSJbr6H1E4fDIw88r5IsECYBqEaH45nvJ90m9unXiMceVFY uN2andimm3CIB8ax2l8qI60Wrze9zdxzeshvPDCUgNryhmBpKcRvt5B6bFVzrGR+tXMD keenNXjEJxnymvXI0Jxo6g6xTCG4f/lAYmtaVb0EU51iQQgntjLlbNq1yUKrRDYEmFMr QLTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=RUYUIjtg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12-v6si19454189pls.53.2018.09.11.10.26.05; Tue, 11 Sep 2018 10:26:24 -0700 (PDT) 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=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=RUYUIjtg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728078AbeIKWZp (ORCPT + 99 others); Tue, 11 Sep 2018 18:25:45 -0400 Received: from mail-bn3nam01on0137.outbound.protection.outlook.com ([104.47.33.137]:48928 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726943AbeIKWZo (ORCPT ); Tue, 11 Sep 2018 18:25:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavecomp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tnZDfr5csmZ8Qs+HOUfb9PLl5Tfza2qrsw7k99YYvCk=; b=RUYUIjtguEI+UZlcDiRi7kPzkq0Wj+3aXxigWTUpSEkumQ2Ej/2D7Bgi/X8YE3qwr1x3TesBQy/OH+6tkIH3913ipxeRi4lJdeAgH56AcrKxvRCvnVQ2JrrnNDVGEq9EmJdXMUT+PPLp3uRF7rJ0fm1XyNRbgs24h9qxObTVack= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; Received: from localhost (2601:647:4100:4687:76db:7cfe:65a3:6aea) by BN7PR08MB4931.namprd08.prod.outlook.com (2603:10b6:408:28::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Tue, 11 Sep 2018 17:23:42 +0000 Date: Tue, 11 Sep 2018 10:23:38 -0700 From: Paul Burton To: Mathieu Malaterre Cc: Linux-MIPS , Paul Cercueil , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Frank Rowand , Jaedon Shin , Rob Herring , "# v4 . 11" Subject: Re: [PATCH 2/2] MIPS: Fix CONFIG_CMDLINE handling Message-ID: <20180911172338.xdqmkmp3brut4ish@pburton-laptop> References: <20180907185414.2630-1-paul.burton@mips.com> <20180907185414.2630-2-paul.burton@mips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Originating-IP: [2601:647:4100:4687:76db:7cfe:65a3:6aea] X-ClientProxiedBy: BL0PR02CA0088.namprd02.prod.outlook.com (2603:10b6:208:51::29) To BN7PR08MB4931.namprd08.prod.outlook.com (2603:10b6:408:28::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf362691-d919-4d5f-3e76-08d6180b52b8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BN7PR08MB4931; X-Microsoft-Exchange-Diagnostics: 1;BN7PR08MB4931;3:nIMj8U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nNnUMqjSBxDfyP2NdVvohLmVIl3gZrU+kwqqM57fnsJS7Nwg9b+Fac053Bv+46oaNsOd7U9wBblIOhk7RULRnA3x;4:fwsM4kctnEyfrTDqzKFNDGZrY30NyfR8FhBA48kQbhjC1SKo+4uMzFLcPqlpmpiQJHWfHdTu6ynyLC1N7jihsBs77jvXFcZSlBhF828khf5yJda/kgj2hiSZH15wZqnz/VD6TTe+AtgO/wX9/lbuXDpax4GtbGK6pKOwg8h5hGS3e5J5d38N7v9kmx7MtT4U2k97dajk2Hqq4MJyg2X4L7R2ryaynyeb1PyfvBrRPV+eAZ1uVF0KZ6Pn/YLVCrpLc//HK567FsA5mVxY+RcKhw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:BN7PR08MB4931;BCL:0;PCL:0;RULEID:;SRVR:BN7PR08MB4931; X-Forefront-PRVS: 0792DBEAD0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(7916004)(136003)(346002)(376002)(396003)(366004)(39840400004)(199004)(189003)(81166006)(81156014)(46003)(53546011)(50466002)(386003)(7736002)(106356001)(105586002)(42882007)(6666003)(16526019)(6246003)(68736007)(6916009)(8936002)(186003)(486006)(316002)(23726003)(16586007)(11346002)(446003)(1076002)(58126008)(6116002)(476003)(54906003)(47776003)(2906002)(478600001)(76176011)(4326008)(6496006)(305945005)(52116002)(52396003)(39060400002)(44832011)(33896004)(5660300001)(33716001)(25786009)(6486002)(76506005)(8676002)(97736004)(14444005)(9686003)(229853002)(53936002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN7PR08MB4931;H:localhost;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN7PR08MB4931;23:O/DxZvgMKENmhco1lQEOG8JGdfa1SBT6FFVdoDYq1?= =?us-ascii?Q?6Y9pah1z+Bo6xxz/jZNjOGN6XTN9kUy1v8fIb0uQxnhhlGdfQzT9EtqD2QJg?= =?us-ascii?Q?rMkictG9rgDy0ZAr4GmQYxgLCb3szX2b/i3DqBW4CNRdTmnJAphMd0cNnczX?= =?us-ascii?Q?6AiKPdwAEkTXTCGDfez8ABicrCNKG534FX4oohludw/DmsxHcnqLC+6N0FpG?= =?us-ascii?Q?LkhIS6Bv4sY95UjBUc8/FjjGktW4ndNYvcyRfC9QK4BGsmYJTPX3e0+JeVJZ?= =?us-ascii?Q?iOkJ2MZRfYy7hovjg0otflVOS0sMh9esmVp85NlEeR6XDYsygJ1Uv53L20nY?= =?us-ascii?Q?5Q1GTsBuJi4SmsckENYMe1l4oNAbDBTnhvopSnxmiuSCNMYZPNNv1tA74J7e?= =?us-ascii?Q?1FeNGwkdszmmFlVMAb2yVt4jSqtJ7EsTnyN4Vwkjmx5+t4WJnyhWlL8up8p/?= =?us-ascii?Q?ImLISgylIW6JzEPYzuYH7E6HnMa01iGa5oeOxNUBSY4In1MEu0GRpSoX0JbJ?= =?us-ascii?Q?v++sDmGXyLogTh+L2PlwD8QN1N4dFFHRjmKoxOnadlwsdXXLD7o88Yw6CMN/?= =?us-ascii?Q?mMIdusOtQf+i9icWvYcHXKLQ8p+/4cdBTJ+CGjXT+9nb9dHG+/rtAD4Mglfm?= =?us-ascii?Q?mXuzy2/rVcuemcDXb59MLqdodgVKjXjZ1J1uIIkwejuOeISCabpzLff4YEvG?= =?us-ascii?Q?12geyEypX3VmKcCvpW0PvZRfMLLkAydx7Q5a81OWrB0IbnE+5BR6P3q+Bd7B?= =?us-ascii?Q?Dmgi8WUbEsfpoGViRyNhKEGizdKAz+HpoW9Y6NowOjqLwl6VAF6oTr354Hyq?= =?us-ascii?Q?NoZfmSHnTdUCjdBuSU/lStSfGrsyMP30ck9mqfbS9zkT1LRchWipn/oDc39M?= =?us-ascii?Q?Aj5QScXaH4SKMK6JmMbxZujL42k2RpevWLzROgohmgEydMwljHGtvYly8Dmk?= =?us-ascii?Q?qR6nnwKddN1n2qOfOEl8PLrcwFtjZZqqSqHKJ/uitrE8Qln4R9Xk0uZvr/Ci?= =?us-ascii?Q?ROxwY39p2de+y7yK7op6VAg/HNb+jYiRjiyT5Lenhlmk8DPFbTCg4xm6OJN3?= =?us-ascii?Q?QBRWwceR9OvVIez20PKSoiAgLOFkLHnlB8xxRuqqjOhZMsDLgakurMhwhGJ1?= =?us-ascii?Q?OjulJeIVuapS1FOkw53ufB6R/ozscN3I9vCifSkA2Xq472lQVHrxAZsnqUrs?= =?us-ascii?Q?8PHDPkZWb20/26f03kBoIg6hRRr/LGUifMVPplTp/PYEDIBH75EkUvtMw9Ns?= =?us-ascii?Q?XJXG7+etbnur4GVuxzAKDNM0kkw7TrG5JUwLtd0fp7JG56qZ6zO1NMGF7RbX?= =?us-ascii?Q?V79jeXhmdLytdIEhuRu+ReH8HD0wxW1UpLUmSSc0T44?= X-Microsoft-Antispam-Message-Info: CD90r6igtleh2Jg+AhLcws5Dj1gEyWhhZwB48ab5rbMW7xWXJBGETHUWF3iV6O6co/it9Z4lGzEmo3uFAXAfv8I4auXta7jE4Zkng9Z89gDgV9nJI6ia1iKLWxnDJYKkUY86YYtccdTJLcUANNgN/0b3fBHH8DTa7YSecQQFI/YH/N3/wq9x9kVYzRvfnfV0+bw2ryBHzircgNk2SfgmS9WmImmP6h3hVvL6B2KrkyudsYMDj0qEaFPA4GRNxm4ckjxOGzQmkRTakPCHLbJudlVw/LFspj8iyaysrdp7q+NukAMgYHkScr2/8gsqJeaGhLrc4VgP50BLunLYJLZ3mL1cjOcHwllqfoZQA6QyTGk= X-Microsoft-Exchange-Diagnostics: 1;BN7PR08MB4931;6:0RjYQSFdnRvQ/RFR9roTyNTif6Z+tffHjFWlHQCmN7tqzeUYOL1pw1a3IR/b85GMcTKYRzneguVZZYfndCAtgRuTOmFwXwyBOit0vtRidE8cMPn9Iygx8kDdTCnChPq0wyMlFVZRKRfFarn5nqUBHDnZxZr12EJZE40rBBEb5OKAVYIiPwMpiBaneDTChMjvXaKRFXJAodWA3T/dMI/qBt/7/EKLXqNN/gZ5UIwDujSqIfu7iNTuu7J2+uWIkQuYBDi32wPGA5UtLwAnIe8S6WY8t7kTHF395NZ8/5DCbds5jJ4LooGsDXv77Gy+5bB/y8CJYlZzytCoJU/+cA7UHgCWdqMcEDlwnTqHqjZHEkqcJoNdpRUzJ8qu67dDXGNRInhvKiMqszEDWuqCBfSVA+anNC6LmNBBpRY+XHGRgEilBKWo0iAb3oBg8++usYJ/te3OYiUd1jwdRRTgMWiXIg==;5:LGt2goXkz24GAYPD+Z1YvOYAO6+Gk0YtAbg5TmlxGxNY1xK3X24v/mBkO0SjWZhxiQjUsYwCzif8RtnQFdKIAIQkR2CT77YJ94+gGA41mLK5LCgZ+ZRIYPTHmOIEkaEiBF8zYK3YYzGtb2dfNXHfCS2nWMjqGGtlbV9tPmakhMo=;7:Yow/NMODJ6fs6Fdp7k5U97ZtSIb2Zk3BQ8SgO5uYxmu+8rEo8O5Ljz71b4IUn1LIvQWVfb+sARVhlpGSusVXYVAJvlDKPsEUYbSf8Gf1JD5A1rE2948QeeMOwwwLz7+Bf0kDmS6ve0WNkymhDRt3wtjNa1eht1i2MZp0meMcMzf6ZEjPWXLC5EjHC/6lSIMMGqTmq5BN8aiIe2EA53zumk+MDKdssjHazNwZEmuHVuEMrYL7c5XYtZSFZyzEkd58 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 17:23:42.8755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf362691-d919-4d5f-3e76-08d6180b52b8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR08MB4931 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthieu, On Mon, Sep 10, 2018 at 02:09:21PM +0200, Mathieu Malaterre wrote: > On Fri, Sep 7, 2018 at 8:55 PM Paul Burton wrote: > > Commit 8ce355cf2e38 ("MIPS: Setup boot_command_line before > > plat_mem_setup") fixed a problem for systems which have > > CONFIG_CMDLINE_BOOL=y & use a DT with a chosen node that has either no > > bootargs property or an empty one. In this configuration > > early_init_dt_scan_chosen() copies CONFIG_CMDLINE into > > boot_command_line, but the MIPS code doesn't know this so it appends > > CONFIG_CMDLINE (via builtin_cmdline) to boot_command_line again. The > > result is that boot_command_line contains the arguments from > > CONFIG_CMDLINE twice. > > > > That commit took the approach of simply setting up boot_command_line > > from the MIPS code before early_init_dt_scan_chosen() runs, causing it > > not to copy CONFIG_CMDLINE to boot_command_line if a chosen node with no > > bootargs property is found. > > > > Unfortunately this is problematic for systems which do have a non-empty > > bootargs property & CONFIG_CMDLINE_BOOL=y. There > > early_init_dt_scan_chosen() will overwrite boot_command_line with the > > arguments from DT, which means we lose those from CONFIG_CMDLINE > > entirely. This breaks CONFIG_MIPS_CMDLINE_DTB_EXTEND. If we have > > CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER or > > CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND selected and the DT has a bootargs > > property which we should ignore, it will instead be honoured breaking > > those configurations too. > > > > Fix this by reverting commit 8ce355cf2e38 ("MIPS: Setup > > boot_command_line before plat_mem_setup") to restore the former > > behaviour, and fixing the CONFIG_CMDLINE duplication issue by instead > > providing a no-op implementation of early_init_dt_fixup_cmdline_arch() > > to prevent early_init_dt_scan_chosen() from using CONFIG_CMDLINE. > > Sorry I cannot test this patch ATM. I've simply CCed Paul C. just in case. Thanks - for the record I did test on a Ci20, though I was booting using my ci20-usb-boot tool which doesn't currently provide a command line to the kernel. CONFIG_CMDLINE didn't get duplicated though. I'll get back to a v2 for this & hopefully get it fixed up for 4.19, but it might take a little while because my son was just born on Saturday :) Thanks, Paul