Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3742317yba; Tue, 7 May 2019 06:26:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOwJ5zPPL4k6SfnuJ2cO9y548IJ+04PR32Rr6r3p57z0+Jb3KCfJO4jAXHZCr3zx58auyt X-Received: by 2002:a62:be17:: with SMTP id l23mr41373369pff.241.1557235566719; Tue, 07 May 2019 06:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557235566; cv=none; d=google.com; s=arc-20160816; b=Y5rRmJrAZl5vf3thkK0vbZ7RC0wLLLZtHiGm+nDpilHjj+DksmZh05XenILTJN4kSj dADbYuYEqctov6SdqaR2c1uEHHJeATUBMYQt3+R3qjbJrUDUYip3SIF6ODn3nVhWWCFB w7hehxCBApNcifz1Csn7hFiW1RR4gs3K1p+Q9oe9YefbeKEqfEd8MGtMU5c3VZkMD1G0 dgAz0bR5K0CJlUP+n03OTC+JGmeIKcir6Bq/86GWPsXjlUHFJXChoc5Vn9AJFkazXTNt bI+pRS/ToZWojBdPmaMvxjsExkKuIax0af9JPswFMNDNpekoyBuM828twCeA3BvCvyC/ UWag== 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=m2ATEnqF+MoRp7NGdFpgjVVkWebNVtv9lCZEPHklYVE=; b=yyRN6fdRsq6/uA+5/S9vBLTXpE3hawo7bAPSZFXPal791uZE4Hc+jsBZbkyrsXILCD vhwn5ZhsDLXrP8XzcaGRSOay9FKcHmyT8J/suuLjzdtkXmX+FCnLFye7VbJ07Mf+P8Nn zoBa8CzSuX0zTSRNHwNg6iWSZQzkquwvQ4J7phVqMmu9u9XW7X0gvWGILKk6DdtgZWyr s4bSi8y0idcvyuo2q1878WfWq1tHMT9/fm+A3t6B4YirnKv2K/VI8RK8Q+neJ2z6zpav kGRaG5KW6wDxNvx2UWoTpT7rOVcubdUxttocPxb88zn5pi94aZh/cYTElXGVqsbsLuuF G9gA== 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 z29si20596182pgl.584.2019.05.07.06.25.49; Tue, 07 May 2019 06:26:06 -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 S1726569AbfEGNYw convert rfc822-to-8bit (ORCPT + 99 others); Tue, 7 May 2019 09:24:52 -0400 Received: from unicorn.mansr.com ([81.2.72.234]:57168 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbfEGNYv (ORCPT ); Tue, 7 May 2019 09:24:51 -0400 Received: by unicorn.mansr.com (Postfix, from userid 51770) id C494E14180; Tue, 7 May 2019 14:24:49 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Marek Szyprowski Cc: 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] usb: core: verify devicetree nodes for disabled interfaces References: <20190507125615.9381-1-m.szyprowski@samsung.com> Date: Tue, 07 May 2019 14:24:49 +0100 In-Reply-To: <20190507125615.9381-1-m.szyprowski@samsung.com> (Marek Szyprowski's message of "Tue, 07 May 2019 14:56:15 +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: > Commit 01fdf179f4b0 ("usb: core: skip interfaces disabled in devicetree") > add support for disabling given USB device interface by adding nodes to > the USB host controller device. The mentioned commit however identifies > the given USB interface node only by the 'reg' property in the host > controller children nodes and then checks for their the 'status'. The USB > device interface nodes however also has to have a 'compatible' property as > described in Documentation/devicetree/bindings/usb/usb-device.txt. This is > important, because USB host controller might have 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. This conflicts with the proposed > approach and verifying for the presence of the compatible property fixes > this issue without changing the devicetree bindings and the way the PHY > controllers are handled by Exynos EHCI/OHCI drivers. > > Reported-by: Markus Reichl > Fixes: 01fdf179f4b0 ("usb: core: skip interfaces disabled in devicetree") > Signed-off-by: Marek Szyprowski > --- > drivers/usb/core/message.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c > index 82239f27c4cc..cd455c4add25 100644 > --- a/drivers/usb/core/message.c > +++ b/drivers/usb/core/message.c > @@ -2007,6 +2007,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration) > struct usb_interface *intf = cp->interface[i]; > > if (intf->dev.of_node && > + of_device_is_compatible(intf->dev.of_node, NULL) && > !of_device_is_available(intf->dev.of_node)) { > dev_info(&dev->dev, "skipping disabled interface %d\n", > intf->cur_altsetting->desc.bInterfaceNumber); > -- This doesn't look right. of_device_is_compatible() with a NULL compat argument always returns zero. There also seems to be a broader incompatibility between the generic USB bindings and the use of child nodes in the Exynos bindings. -- M?ns Rullg?rd