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: 4378981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4FB029F314 for ; Wed, 18 Jun 2014 19:11:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC2EE202FE for ; Wed, 18 Jun 2014 19:11:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 212462016C for ; Wed, 18 Jun 2014 19:11:08 +0000 (UTC) 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 (/) 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-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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();