From patchwork Mon Jun 23 17:17:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 32383 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8583620540 for ; Mon, 23 Jun 2014 17:17:26 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id ij19sf23431293vcb.2 for ; Mon, 23 Jun 2014 10:17:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:date:message-id :subject:from:to:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=XYrkMT7HFvO0O3BmQIr8qM3g/ZEZsBwTH2QujTu+qX8=; b=Q3jlJQuhS0SNyKp4BRYDe1V74p3klZmHleevKOmmYIZNobQL+pfyp1x8mHYU11G+rk Bq3eB6cOo5icnZ0nV8/U5pZI3TnYa1cO0lWapaDtqrKLurL0sy98s/tvSYKhG2L9Hxqw tfPg3YBNzsyGgaK9QBQeeef5BrPgXRghKzV054tFq7+8qc98bwC8JX7p3HHkKfdbfWO4 DV5WwFlRQpEKXfWRXfJckCOfS3Jp+YN04Md1uh4obeFpOJqS6o+KBk/gsObjzNpHqeUV 4XrOiY/hl7zHPnCUV4GfccKVZeRYALBITaTEMptpRLfY+YE98KVIQDVfYpvSKjI+rk4s ax3Q== X-Gm-Message-State: ALoCoQlIOvaxtt9fLXXdmM0oBv2a/Jsx9doj3WeuMiEZ36F/9TcPcpzkrL5hYKJPcnpaBDwX4GCC X-Received: by 10.58.209.227 with SMTP id mp3mr10291961vec.29.1403543846360; Mon, 23 Jun 2014 10:17:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.225 with SMTP id o88ls1946504qge.88.gmail; Mon, 23 Jun 2014 10:17:26 -0700 (PDT) X-Received: by 10.58.82.106 with SMTP id h10mr1768273vey.60.1403543846258; Mon, 23 Jun 2014 10:17:26 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id tg13si9387120vdb.99.2014.06.23.10.17.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 10:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lf12so6221405vcb.4 for ; Mon, 23 Jun 2014 10:17:26 -0700 (PDT) X-Received: by 10.58.220.230 with SMTP id pz6mr20628486vec.9.1403543846167; Mon, 23 Jun 2014 10:17:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp146671vcb; Mon, 23 Jun 2014 10:17:25 -0700 (PDT) X-Received: by 10.67.22.33 with SMTP id hp1mr30205039pad.134.1403543845437; Mon, 23 Jun 2014 10:17:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hm7si20672563pac.213.2014.06.23.10.17.24; Mon, 23 Jun 2014 10:17:24 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756440AbaFWRRI (ORCPT + 8 others); Mon, 23 Jun 2014 13:17:08 -0400 Received: from mail-ob0-f178.google.com ([209.85.214.178]:39104 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756408AbaFWRRE (ORCPT ); Mon, 23 Jun 2014 13:17:04 -0400 Received: by mail-ob0-f178.google.com with SMTP id wn1so4291442obc.37 for ; Mon, 23 Jun 2014 10:17:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.60.225 with SMTP id k1mr3338251obr.48.1403543823624; Mon, 23 Jun 2014 10:17:03 -0700 (PDT) Received: by 10.182.33.100 with HTTP; Mon, 23 Jun 2014 10:17:03 -0700 (PDT) Date: Mon, 23 Jun 2014 19:17:03 +0200 Message-ID: Subject: Regression on Integrator after commit 07e461cd7 From: Linus Walleij To: Grant Likely , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi Grant, The Integrators are not booting after commit 07e461cd7e73a84f0e3757932b93cc80976fd749 "of: Ensure unique names without sacrificing determinism" i.e. these device trees: arch/arm/boot/dts/integratorap.dts arch/arm/boot/dts/integratorcp.dts It hangs very early boot at one time with the message: Error: unrecognized/unsupported processor variant (0x41069262). Reverting that patch (manually) makes the platform boot again, so it's definately caused by that. Can you see what is wrong with these device trees, like if it's something obvious that the code is not expecting? It's like it cannot build the tree or something. My revert does not look very nice but looks like this: commit be15147f12a72b7bc63a8e18a2edd74123bcb5f0 Author: Linus Walleij Date: Mon Jun 23 18:59:58 2014 +0200 Revert "of: Ensure unique names without sacrificing determinism" This reverts commit 07e461cd7e73a84f0e3757932b93cc80976fd749. Conflicts: drivers/of/platform.c } /** I have no real idea of how the OF core works so I'm a bit in the blue here :-/ Any help appreciated! Yours, Linus Walleij --- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 6c48d73a7fd7..71581921c1f3 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -64,35 +64,37 @@ EXPORT_SYMBOL(of_find_device_by_node); * of_device_make_bus_id - Use the device node data to assign a unique name * @dev: pointer to device structure that is linked to a device tree node * - * This routine will first try using the translated bus address to - * derive a unique name. If it cannot, then it will prepend names from - * parent nodes until a unique name can be derived. + * This routine will first try using either the dcr-reg or the reg property + * value to derive a unique name. As a last resort it will use the node + * name followed by a unique number. */ void of_device_make_bus_id(struct device *dev) { + static atomic_t bus_no_reg_magic; struct device_node *node = dev->of_node; const __be32 *reg; u64 addr; + int magic; - /* Construct the name, using parent nodes if necessary to ensure uniqueness */ - while (node->parent) { - /* - * If the address can be translated, then that is as much - * uniqueness as we need. Make it the first component and return - */ - reg = of_get_property(node, "reg", NULL); - if (reg && (addr = of_translate_address(node, reg)) != OF_BAD_ADDR) { - dev_set_name(dev, dev_name(dev) ? "%llx.%s:%s" : "%llx.%s", - (unsigned long long)addr, node->name, - dev_name(dev)); + /* + * For MMIO, get the physical address + */ + reg = of_get_property(node, "reg", NULL); + if (reg) { + addr = of_translate_address(node, reg); + if (addr != OF_BAD_ADDR) { + dev_set_name(dev, "%llx.%s", + (unsigned long long)addr, node->name); return; } - - /* format arguments only used if dev_name() resolves to NULL */ - dev_set_name(dev, dev_name(dev) ? "%s:%s" : "%s", - strrchr(node->full_name, '/') + 1, dev_name(dev)); - node = node->parent; } + + /* + * No BusID, use the node name and add a globally incremented + * counter (and pray...) + */ + magic = atomic_add_return(1, &bus_no_reg_magic); + dev_set_name(dev, "%s.%d", node->name, magic - 1);