From patchwork Tue May 7 12:56:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 163533 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp1309836ilm; Tue, 7 May 2019 05:56:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxBzkXVJz6G9/3d+ga6L0tXbijpCp9Xxi8C+4ch5zFR0yhu1pAWRmHrASkecEip+TTAAuh X-Received: by 2002:a17:902:7797:: with SMTP id o23mr7901730pll.147.1557233794044; Tue, 07 May 2019 05:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557233794; cv=none; d=google.com; s=arc-20160816; b=sMg4+77FhHaD9zo2BX55UtEsOiIVggVwayHgECoQxrKHH7zpmsq3lE3SBp8T58q86m BYFQLexGg11AoWWlH3X6PZaqMn5F+nwVU1sENsDX+k7HPhWLpTJ+HI0RFcwr9KS0/qwh uDiqyw5qgwMhqLG/HsG6sNk+N7hiVPWHqB255iOTIbuNCF8pe4zAup5EwR59ISUVWNZZ 6WjJxMNC7RKtz2HRRn2Syy0JDst2StWn24X+nUpv9lndydHMBtfYhPWUm7GyBSws2Pf/ 7s3v3bg120c8OgN0GFIF3nTle/oqD7AKP/Jb6DC5Wl+Qvwy7N5yVJP7U1BGphTac/wwl yp+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=xUjT1aKwWvPSI6nVT4VtoO7jy++v6QMY5/tvZAbO3t0=; b=UXpZg2B7DD7baq2/HOAFjqawvlGN0F2xC//WIaBoz4MvA6dK0e6eF8tggcsW8OhL/6 iaTpKY19dQBwJgCBS5fUnU8ABlxTe1khwD8TtRaniH2IYgrmRq+pXoZ8kZejaF8HNPzY KB0GiIF5AEZiZzHV99Mt7P3Rv66o2PHRokPkpS+ssVqtgPnT8fulCIga5GnyoPjU8sh9 ZGKLK95GORE/5Vu35eP8F1spgLp4kNxfGz24v3VyxyF14sTllTFSkTcB61wgxT7wYiiX /U9ziOCMXeSb4z8ja0wgPaTca+67D7zM4trXu3vSbRWFJNw+/KVs5kyPTpmLokwEoYnl 3OJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KpxrKWes; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si18566117pgw.70.2019.05.07.05.56.33; Tue, 07 May 2019 05:56:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KpxrKWes; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbfEGM4d (ORCPT + 3 others); Tue, 7 May 2019 08:56:33 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:48121 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbfEGM4d (ORCPT ); Tue, 7 May 2019 08:56:33 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190507125631euoutp02e6b6639ad8400dbe5083f21c39356db9~cZ_IC4Gj02423324233euoutp02g; Tue, 7 May 2019 12:56:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190507125631euoutp02e6b6639ad8400dbe5083f21c39356db9~cZ_IC4Gj02423324233euoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1557233791; bh=xUjT1aKwWvPSI6nVT4VtoO7jy++v6QMY5/tvZAbO3t0=; h=From:To:Cc:Subject:Date:References:From; b=KpxrKWesAN50VLLKddrB9PB3wK4lTEW97WTVdo4ZTKJmXtFtcIstb3G2B4L1lxfYT GhxnsbIwUfaB+jfYRKUDOPiJ4jJXPqzggWW0SjMrAamPbofNUKq6ZAEaljvKtSKUu6 hwaBO001G6X7CgSSd10NADcLzj6RDZmuLO1yDcz0= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190507125631eucas1p145b5499a857fcf20e1c4429f28bede47~cZ_HoxoSf1873518735eucas1p1i; Tue, 7 May 2019 12:56:31 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id DA.04.04325.E7081DC5; Tue, 7 May 2019 13:56:30 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190507125630eucas1p1c5fd171a8dc2a6b8eb9dd317fe245f0c~cZ_GuytwV1097010970eucas1p1Y; Tue, 7 May 2019 12:56:30 +0000 (GMT) X-AuditID: cbfec7f5-b8fff700000010e5-46-5cd1807e2c82 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D6.B6.04140.E7081DC5; Tue, 7 May 2019 13:56:30 +0100 (BST) Received: from AMDC2765.DIGITAL.local ([106.120.51.73]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PR4001CRXA2KE30@eusync1.samsung.com>; Tue, 07 May 2019 13:56:30 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Mans Rullgard , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Markus Reichl , Krzysztof Kozlowski Subject: [PATCH] usb: core: verify devicetree nodes for disabled interfaces Date: Tue, 07 May 2019 14:56:15 +0200 Message-id: <20190507125615.9381-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsWy7djPc7p1DRdjDH7OMbLYOGM9q0Xz4vVs FufPb2C3uLxrDpvFjPP7mCwWLWtltnh55Aejxdojd9ktfjyczuTA6XHrTr3HplWdbB77565h 93hz+hS7R9+WVYwenzfJBbBFcdmkpOZklqUW6dslcGWcb57JVHCcr+J0607WBsYVPF2MnBwS AiYS7/u/sYDYQgIrGCWubGPuYuQCsj8zSmz4MY0dpqhh9ktGiMQyRokZb1tZIJz/jBKrt24A q2ITMJToetvFBmKLCCRIHNn8nhnEZhboZpL4skwAxBYW8JY4t/0M2DoWAVWJDdvWMoLYvAI2 Eq0bPjNCbJOXWL3hANgZEgKNbBLTDs1kgUi4SFx88BeqSEbi8uRuFoiiZkaJh+fWskM4PYwS l5tmQFVZSxw+fpEV4gw+iUnbpgON5QCK80p0tAlBlHhI9B7+AhYWEoiV2LY1aAKj+AJGhlWM 4qmlxbnpqcXGeanlesWJucWleel6yfm5mxiBsXb63/GvOxj3/Uk6xCjAwajEw/ui4GKMEGti WXFl7iFGCQ5mJRHexGfnYoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzVjM8iBYSSE8sSc1OTS1I LYLJMnFwSjUw8rjcLf7UX8r5LmWDZkz1aWbujXfuCuxe9njPt0cJR9Y/qio4U/7RZt1kS9sz s+4/2zfperKqSeIZ9dkSDycKfeuYesv5dMyhVQvOBa3N5w46/f7ArcsZW/SfdneK3L6kv+RQ wVXhRuv+oO/n11qlnBcy8+L7cMj90W222jlaNw7+9JgiKXhsrb0SS3FGoqEWc1FxIgCcaiYm sQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLJMWRmVeSWpSXmKPExsVy+t/xy7p1DRdjDL6dYLPYOGM9q0Xz4vVs FufPb2C3uLxrDpvFjPP7mCwWLWtltnh55Aejxdojd9ktfjyczuTA6XHrTr3HplWdbB77565h 93hz+hS7R9+WVYwenzfJBbBFcdmkpOZklqUW6dslcGWcb57JVHCcr+J0607WBsYVPF2MnBwS AiYSDbNfMoLYQgJLGCUmPbLqYuQCshuZJFb+nMQGkmATMJToetsFZosIJEgsebuZHaSIWaCb SaK56TcrSEJYwFvi3PYzLCA2i4CqxIZta8Gm8grYSLRu+MwIsU1eYvWGA8wTGLkWMDKsYhRJ LS3OTc8tNtIrTswtLs1L10vOz93ECAyUbcd+btnB2PUu+BCjAAejEg/vi4KLMUKsiWXFlbmH GCU4mJVEeBOfnYsR4k1JrKxKLcqPLyrNSS0+xCjNwaIkztshcDBGSCA9sSQ1OzW1ILUIJsvE wSnVwNgQdtXALI491JP9TPHPh+Hya5jCZultFT7YuIp5H8sUY+lTO+doTOx3ZDm735hD9vrX 5Kf3drV1cxkzfC7UyXNzNb88Y6trxv43KwVlbnQszFh18hjL0eULSw66fDwY7Xgj9J2QqfWr hsf361ZNvv79n+/mzck3+N8fqWgQvhsgF/dlwvSr+ZlKLMUZiYZazEXFiQBdkFXGEAIAAA== X-CMS-MailID: 20190507125630eucas1p1c5fd171a8dc2a6b8eb9dd317fe245f0c CMS-TYPE: 201P X-CMS-RootMailID: 20190507125630eucas1p1c5fd171a8dc2a6b8eb9dd317fe245f0c References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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(+) -- 2.17.1 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);