Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4989256yba; Mon, 13 May 2019 03:29:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkh9HptBOesSlenl5gwPgS7KcYhjLaZpcUxiCxq9ghCmXdYpq6kes7qAxGOhlN6zFd+Uat X-Received: by 2002:aa7:820c:: with SMTP id k12mr31849195pfi.177.1557743376265; Mon, 13 May 2019 03:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557743376; cv=none; d=google.com; s=arc-20160816; b=oEK3agR5jtykDPgyDUew4B337lcvJ4Vws84TMFlUrjW/zo4yIJ0E4tdqx+5x0SGvmV nebdvyWZvbZaYimyrotgtTtlX8VlyxJmDXxhWJevkPiM0MFLUKX+R4re8L/R4u3p3wCM 5KhUdkp5cSTKjuujvXSyffP/86MyOIg9H/KzotAkQz5K1L5ruesURy9+skMlbOQiAUur 2rNpVBitOwUMtcjGJNPjwx12GhOQXBFqt4Kn23PBo1IXvQTYX0BCUtLAeW75PGFyi1+Y 3s4n9slzGgtBhWaz/5myxoUAKXU9rdvAEqmg/vZneDQtOYvGde5djYlsuOzGhT81AUA3 MnBw== 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:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=TBtSCzvvgprVahTQ17oD/gbaBevO7eX+2k5UhU1/r3w=; b=XncnciOPSMTp0JNsEA+rA6OtvziN8fHU1wbSizJOAip3JJQF/sjxI0BQVw1p666Jbc ni4pBjH0FckMSYGoY0zO9SSmObf1hcVP14tGEuiP5qDNy/QS6ka9QrwPIZ4wI03fGDsO Btxy3k4DNgqB/u7MQlMwWj6GPbDSVeSQQ7GNMAMSaCUiK6DTVq9AGMuzZJZj/a0NhWGE X97GiQp1xiGp6u3jt1EVubyQp/V+Ugl3403M2SPZFXhxa7ySX+QJiZoup1JbROzSShdx v0NEZSkHLSXzlyETwrx7UVHpdrAMqBVBc7uFBrcCjDy80ESPLbxCzaGW73QVaREjlThV L1sA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j142si2037779pfd.262.2019.05.13.03.28.48; Mon, 13 May 2019 03:29:36 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728543AbfEMKGl convert rfc822-to-8bit (ORCPT + 99 others); Mon, 13 May 2019 06:06:41 -0400 Received: from unicorn.mansr.com ([81.2.72.234]:36228 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727339AbfEMKGl (ORCPT ); Mon, 13 May 2019 06:06:41 -0400 Received: by unicorn.mansr.com (Postfix, from userid 51770) id D154B149B5; Mon, 13 May 2019 11:06:39 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Marek Szyprowski Cc: Peter Chen , "linux-usb\@vger.kernel.org" , "linux-samsung-soc\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , Markus Reichl , Krzysztof Kozlowski Subject: Re: [PATCH v3] usb: core: verify devicetree nodes for USB devices References: <20190509084726.5405-1-m.szyprowski@samsung.com> <7c5579d2-634a-d705-a451-563939957d57@samsung.com> <3544eb61-2bd8-338d-8d62-d95a775528ef@samsung.com> <5d0abe9c-613c-d39b-6746-78e5e5c2bbc5@samsung.com> Date: Mon, 13 May 2019 11:06:39 +0100 In-Reply-To: <5d0abe9c-613c-d39b-6746-78e5e5c2bbc5@samsung.com> (Marek Szyprowski's message of "Mon, 13 May 2019 12:03:18 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Marek Szyprowski writes: > Hi Peter, > > On 2019-05-13 11:23, Peter Chen wrote: >>> On 2019-05-13 11:00, Peter Chen wrote: >>>>> On 2019-05-10 05:10, Peter Chen wrote: >>>>>>> Marek Szyprowski writes: >>>>>>>> Commit 69bec7259853 ("USB: core: let USB device know device node") >>>>>>>> added support for attaching devicetree node for USB devices. The >>>>>>>> mentioned commit however identifies the given USB device node only >>>>>>>> by the >>>>> 'reg' >>>>>>>> property in the host controller children nodes. The USB device >>>>>>>> node however also has to have a 'compatible' property as described >>>>>>>> in Documentation/devicetree/bindings/usb/usb-device.txt. Lack for >>>>>>>> the 'compatible' property check might result in assigning a >>>>>>>> devicetree node, which is not intended to be the proper node for the given >>> USB device. >>>>>>>> This is important especially when USB host controller has >>>>>>>> child-nodes for other purposes. For example, Exynos EHCI and OHCI >>>>>>>> drivers already define child-nodes for each physical root hub port >>>>>>>> and assigns respective PHY controller and parameters for them. >>>>>>>> Those binding predates support for USB devicetree nodes. >>>>>>>> >>>>>>>> Checking for the proper compatibility string allows to mitigate >>>>>>>> the conflict between USB device devicetree nodes and the bindings >>>>>>>> for USB controllers with child nodes. It also fixes the >>>>>>>> side-effect of the other commits, like 01fdf179f4b0 ("usb: core: >>>>>>>> skip interfaces disabled in devicetree"), which incorrectly >>>>>>>> disables some devices on Exynos based boards. >>>>>> Hi Marek, >>>>>> >>>>>> The purpose of your patch is do not set of_node for device under USB >>>>>> controller, >>>>> right? >>>>> >>>>> Right. >>>>> >>>> Do you mind doing it at function exynos_ehci_get_phy of ehci-exynos.c? >>> I don't mind fixing it in ehci-exynos, but frankly so far I have no >>> idea how to do it. The problem is that newly created USB devices >>> get of-node pointer pointing to a node which if not intended for >>> them. How this can be fixed in ehci-exynos? >>> >> >> Can't be workaround by setting of_node as NULL for EHCI controller or >> for PHY node at exynos_ehci_get_phy? > > Ah, such workaround? I will check, but this will need to be done with > care, because have a side effect for other subsystems like regulators or > clocks. > > BTW, What's wrong with proper, full verification of USB device nodes? Your approach so far doesn't address the actual problem of a conflict between the generic USB DT bindings and those for the Exynos host controller. If you fix that, the validation issue goes away. -- M?ns Rullg?rd