Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp513326imp; Wed, 20 Feb 2019 04:20:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IY5zCxX9nuwmZHjxAfyctWpzzQoJlO4/4BZdVHap/EjldKap1b7DyR8UgdZ/7upligXZSfV X-Received: by 2002:a17:902:290b:: with SMTP id g11mr7879049plb.269.1550665224040; Wed, 20 Feb 2019 04:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550665224; cv=none; d=google.com; s=arc-20160816; b=KoZfAt2KL7x1jQpCItJm1KYLOuMHH1RD/3s/Vr4W3sCRC/IGJWeDvxgIX4Ejrzpj2P 20HDAJ3d7wj1OTCPfB9D8dM91lcwFb3nVIVxpNxEDkKMn+C8BPcHLMYvNCdPK3mCT8kt PyfdDUEXmhVW5zjRngrUem7tRqa/bu9hyCqw8+/8nm+bocnpaeDSwA8CpyFMEKpLZV5k Rbu2jDrYeNuxvC7CEzc9fAX+uZiCGZI1oVs4H3j12e77gYlmhOPPG4m+tMsmp3vZ8adp 6T4d2Bj3y5dz9B2eLGo2I4fnZlzmPNTbx0skd2yDdpKgjAL3F0VwY21543Gh8AU5DTxP EcPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=/kfCYe07jyCGlpL3Hvj+WhugqHjmB90vsNFEonxlA78=; b=WrLo0DAI22nEuBI4nPQNF+UQYldBcjzmUH1rtaWqWEEBAquqYQQL34bD10nqb3/6zq N/eXVgPYJ5ffdRxsPjVyDdrNVxfA4802xNSF8RNywxoIIMUpehWNVcvqhjKYZVdufAlr jyUnlqt4dFEatIKsRGcZnL+yNp8w03krhAvZF9xiM9kEKFCiK44Cn8U4Nnwg4u9/s+sl nA8iFsHu/6LlizcBDP+Hgn2/FZE6BTDmzCpGXNbddPuZnJ3euMSMt/ZKJqku9LdZ120b Xzxmc8gN19XAhBNBwUzwLPFsOi6icPH3nI7zXfZPhMzpivlY4AGLeAQTtUr530LUyfud GQnA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si19608716pgr.379.2019.02.20.04.20.08; Wed, 20 Feb 2019 04:20:24 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727723AbfBTMSv convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Feb 2019 07:18:51 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:43699 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726209AbfBTMSv (ORCPT ); Wed, 20 Feb 2019 07:18:51 -0500 Received: by mail-ot1-f66.google.com with SMTP id n71so39730471ota.10 for ; Wed, 20 Feb 2019 04:18:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sa/JSEFisTFu1HSh6mXUgmI35uoeZqcAsVq08MXQDzc=; b=XrTcrmX1JLaE/GDH+PkPKj3/wCcbsA0yCH+1ynMqv+DiGgBPl8IYmzvvd6+xV9C0TJ 2zdKnoyLKATi3acU0Vpd/MeYv6ku35U5jimA+jr5eFoMH28G+NNV3rbgSw51azvJHa8e qY0C93duIlPHixpC6eDak221VTnc47Y9Pol7gyI1fzr6N0zS0MStB7ZAuPJbJDz89o1k SGpZpozeWpPeI9m0znty8kB4M9Eqp/qpIOt+H4WkVeU5gjMHrAdcPffXgwQmVeVsjd0I vTDxMxiFhbWXNwFMcf5xWsidnStZ3KwQyF55WsDGYflCnFJmDj3/VFSs85n5rYmShJiI 1Rbw== X-Gm-Message-State: AHQUAuaQhqZLT/IFW5K4jv5i5YQRtMaIqCEU4cYOyzQ8XBYFBMNtt3i0 tm4VSSfOHznfBFaXacPC4gCWSo8K3eQ8ERZpz5E= X-Received: by 2002:aca:6046:: with SMTP id u67mr714767oib.84.1550665130503; Wed, 20 Feb 2019 04:18:50 -0800 (PST) MIME-Version: 1.0 References: <20190216164512.9525-1-mans@mansr.com> <20190220113506.11009-1-mans@mansr.com> <20190220115117.GK4072@localhost> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 20 Feb 2019 13:18:39 +0100 Message-ID: Subject: Re: [PATCH] platform: set of_node in platform_device_register_full() To: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= Cc: Johan Hovold , "Rafael J. Wysocki" , Greg Kroah-Hartman , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 1:12 PM Måns Rullgård wrote: > > Johan Hovold writes: > > > On Wed, Feb 20, 2019 at 11:35:06AM +0000, Mans Rullgard wrote: > >> If the provided fwnode is an OF node, set dev.of_node as well. > >> > >> Some drivers are just shims that create extra "glue" devices with the > >> DT device as parent and have the real driver bind to these. In these > >> cases, the glue device needs to get a reference to the original DT node > >> in order for the main driver to access properties and child nodes. > >> > >> For example, the sunxi-musb driver creates such a glue device using > >> platform_device_register_full(). Consequently, devices attached to > >> this USB interface don't get associated with DT nodes, if present, > >> the way they do with EHCI. > >> > >> This change will allow sunxi-musb and similar driver to easily > >> propagate the DT node to child devices as required. > > > > Just a drive-by comment, didn't look to closely at this patch, but this > > all sounds familiar. > > > > Note that if both platform devices are bound to drivers you may end up > > with some resources like pinctrl which are handled automatically by > > driver core at probe time to be requested twice (and failing the second > > time). > > > > Take a look at 4e75e1d7dac9 ("driver core: add helper to reuse a > > device-tree node"), which provides a means to avoid this, and > > 49484abd93ab ("USB: musb: dsps: propagate device-tree node"). > > Thanks, and ugh. So we should be setting the of_node_reused flag when > this is the case. It's easy for the musb-dsps driver since it doesn't > use platform_device_register_full() and can do this before the > device_add() call. How can we convey that this flag needs to be set? Through pdevinfo I guess?