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: 4404061 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 5601E9F26E for ; Mon, 23 Jun 2014 17:20:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72C9E202B8 for ; Mon, 23 Jun 2014 17:20:20 +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 794362020A for ; Mon, 23 Jun 2014 17:20:19 +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 1Wz7rz-0001A0-SN; Mon, 23 Jun 2014 17:17:27 +0000 Received: from mail-ob0-f180.google.com ([209.85.214.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wz7rx-00016q-0s for linux-arm-kernel@lists.infradead.org; Mon, 23 Jun 2014 17:17:25 +0000 Received: by mail-ob0-f180.google.com with SMTP id vb8so4310773obc.39 for ; Mon, 23 Jun 2014 10:17:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=0ro0lmDLox6w+8YZRUwMdMbJpFgBemQ4zKqNvUy/vM4=; b=Uslol+RatZ9v3TiRgBNGekLdf1nrfVlUL41suuAlNeRYpRdcCGEjNldxNJNETSYFZv 1sclQL0ZgIwP05mB1snskBze1GEnKKaqJLR/SmxdwZRweiBKtR+2HhcBl7tbeY5TZky3 Ik6qK7RYsA5bJ/A6ANqyIAT+ppwTCxc/EWRLCtecd3VcDbGFzkqAWDfSijEuM850JGUg 6hWDi9AUPV2qDESJtmB3iOd+Zd2137/Tzl57cxNzTYsnxJQ6QJ+WUdvHXcCefbHIs/v+ IHemBJ5Hl8sBVJZ8qeRvKVVA0GfpWUNv0Xglf9in27phch3wFtHHIk9F2JvUv7bFpd6O EKQA== X-Gm-Message-State: ALoCoQmUp2N7KBbJF1bxab+DuQ4q1prz/Kwk9/ejtWd6idffIm4nfVcQots2uqQiZxyCFKb5qilb 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140623_101725_118931_022397C0 X-CRM114-Status: GOOD ( 16.94 ) X-Spam-Score: -0.7 (/) 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.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 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 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);