From patchwork Wed Jun 18 19:07:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 361741 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 95C16140086 for ; Thu, 19 Jun 2014 05:11:25 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxLDb-0002Q6-5r; Wed, 18 Jun 2014 19:08:23 +0000 Received: from mail-vc0-x232.google.com ([2607:f8b0:400c:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxLDY-0002Nn-5m for linux-arm-kernel@lists.infradead.org; Wed, 18 Jun 2014 19:08:20 +0000 Received: by mail-vc0-f178.google.com with SMTP id ij19so1241726vcb.37 for ; Wed, 18 Jun 2014 12:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=3yEXyBY1vRP9KntBGrq62BC5sEVzFjevzftaY8OG7g0=; b=t/HoOqNpJAbSOvGNNmbnvNfQSXBsyCnsDi5IKN+wQSnGajboOWExIoeCk6BKf9CM29 YSHZXCTBeMsR8FzMK6v/zoERm+aMgFSOkMyDt7yRG2kyvKw6nZNVDz35ASNbPMjMpK7l mEJ4IdXY9mSYcH9jvigUmFYk42JUC7T6f+boqE1+tYz9DxJ7ywKZPqTtKMDEf6O1pg7n 8ddtLxXriU/jvc44tuK5R0y2No7t0HJAM3vDAN52FIHLRwUAIJZIdcj8vzRnpyfb/lOE wV6OE2+fkZlN0opDJxtuN+FiTbe7rha815CElXYyvuvACiEpVgQ+cokLZlfRy53k5rXV 7UmQ== X-Received: by 10.220.166.211 with SMTP id n19mr395869vcy.69.1403118475713; Wed, 18 Jun 2014 12:07:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.50.132 with HTTP; Wed, 18 Jun 2014 12:07:35 -0700 (PDT) In-Reply-To: <1403110464-29646-1-git-send-email-pali.rohar@gmail.com> References: <1403110464-29646-1-git-send-email-pali.rohar@gmail.com> From: Rob Herring Date: Wed, 18 Jun 2014 14:07:35 -0500 Message-ID: Subject: Re: [PATCH] ARM: /proc/cpuinfo: Use DT machine name when possible To: =?UTF-8?Q?Pali_Roh=C3=A1r?= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140618_120820_299633_0285C609 X-CRM114-Status: GOOD ( 16.32 ) X-Spam-Score: -0.6 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400c:c03:0:0:0:232 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Ivaylo Dimitrov , Russell King , Sebastian Reichel , Will Deacon , "linux-kernel@vger.kernel.org" , Santosh Shilimkar , Pavel Machek , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On Wed, Jun 18, 2014 at 11:54 AM, Pali Rohár wrote: > Machine name from board description is some generic name on DT kernel. > DT provides machine name property which is specific for board, so use > it instead generic one when possible. > > Signed-off-by: Pali Rohár > --- > arch/arm/kernel/setup.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > index 8a16ee5..fbc7b4f 100644 > --- a/arch/arm/kernel/setup.c > +++ b/arch/arm/kernel/setup.c > @@ -875,10 +875,13 @@ void __init setup_arch(char **cmdline_p) > > setup_processor(); > mdesc = setup_machine_fdt(__atags_pointer); > - if (!mdesc) > + if (mdesc) > + machine_name = of_flat_dt_get_machine_name(); > + else > mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type); > machine_desc = mdesc; > - machine_name = mdesc->name; > + if (!machine_name) > + machine_name = mdesc->name; > > if (mdesc->reboot_mode != REBOOT_HARD) > reboot_mode = mdesc->reboot_mode; I did a similar patch previously[1]. Like my original patch, your patch unconditionally changes the name which could be considered part of the userspace ABI. It's arguably not good practice for userspace to depend on the name, but there are likely cases that do. So I think this needs to be optional and only use the DT name if the machine desc name is NULL. So something like the below and then change the machine descriptors you care about. The default generic DT machine desc should definitely be changed. I had a follow-up discussion with Grant about his concerns in the thread about knowing which machine desc used to boot. He said he was okay if just the machine desc address is printed out. if (mdesc->reboot_mode != REBOOT_HARD) reboot_mode = mdesc->reboot_mode; [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/208878.html Acked-by: Pavel Machek diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 50e198c..1479250 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -887,7 +887,7 @@ void __init setup_arch(char **cmdline_p) if (!mdesc) mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type); machine_desc = mdesc; - machine_name = mdesc->name; + machine_name = mdesc->name ? mdesc->name : of_flat_dt_get_machine_name();