From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933300AbcIHMPI (ORCPT ); Thu, 8 Sep 2016 08:15:08 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:61910 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932385AbcIHMPG (ORCPT ); Thu, 8 Sep 2016 08:15:06 -0400 From: Arnd Bergmann To: Grygorii Strashko Cc: Felipe Balbi , Peter Chen , Leo Li , Russell King - ARM Linux , Catalin Marinas , Yoshihiro Shimoda , "linux-usb@vger.kernel.org" , Sekhar Nori , lkml , Stuart Yoder , Scott Wood , David Fisher , "Thang Q. Nguyen" , Alan Stern , Greg Kroah-Hartman , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev Date: Thu, 08 Sep 2016 14:14:50 +0200 Message-ID: <3028577.HpC29kEMTB@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <01a5728b-9ea7-3ccf-34e8-7602a654306b@ti.com> References: <87d1keirlu.fsf@linux.intel.com> <01a5728b-9ea7-3ccf-34e8-7602a654306b@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:BYnPujaIem7c0qFu2tDwiugfFs/Y9IlwnnzsjyxYFNAjGiwza5J G39v29ScMhwyddzYownv8WAYW2ZpkA8LzD4CvKqI9Gig+8qa9c63pm0gAzitys1aPnakWBb afhdtDCmdYpEHXldA+40lE1a6Irjj+PHHCQ5cqB//EVutawCnrZmWvoTXRUw7VLqixQs+g1 Z8WER1/kZw+SyMSY1SMZg== X-UI-Out-Filterresults: notjunk:1;V01:K0:KhSpk7zukf0=:mj5FKijIxvUKi+ebG0W8oY HrDnZzeAUE88aEfCeJ6Tv97mzgYgovTJX4COXa6quKIUkWn95oLtgUFXxHSj74XXXpbHFfZis i33Nni4nYEzDI2c4GBAfuNci0CC2JCb8lYjd4ZcDRdp0Nfcql6MEPIlmvQNJjYa/nybeM3SH4 XNldyCPW7wYWz+rfPs93/wGMwlCZWdX35t8tYVzHsaOrvBbSRwrOKnaxbnqv6qSqry05gJ3Ma ZnV7PIlafLvlh/gBf+qe6mB80qs0AePjcjZ5n+qM1uriwYq/uecE+JN1VJt1pe31CoslxD6M7 voJWF8Px4a5+moqeNRgRoiKmpl+x9aOXyRGjqpwg3zNOMusJe0UpS5N8FkNacziv0Mi/ANtQW ZD/BWJJi4Iygn+8AqUja0yNOXzWHdC1oUWKzNZrCMgSPFHPVZol/dcjEq6MDDC6KQvNCRJxxz k1io8EIZkEuKaVtw8lqz0/mRNuogg/PszOKf0HelVDtjZyY1YKV65DQTeDVfltnwtb4sEma9y 4MRjN5Qww67JOaXi0EK4lFbRrimrLdUNhxOhMkf38fsNJXxRD23S7ZWTE12vPxQvV5IDbh0nD aO6PpVQ1pYKLGn0XzzfbT+l6AM8DXwUnZI8ga/sFN/KIba1rpzrUyYr6q7iDAbjMbxjaaBgAd dTVPjoDSYlwdunK36D65UDuwW9a850e97YikmuDQKZhEsq+ugrE4HlL3pcp3RuHLItyF02Va9 MR5ybpMKYy1l+9hV Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, September 8, 2016 3:02:56 PM CEST Grygorii Strashko wrote: > dwc3: probe() > if (!&pdev->dev->of_node) > legacy case - hard-code DMA props > dwc->sysdev = &pdev->dev; The PCI case will fall into this too, as we almost never have an ->of_node pointer for a PCI device. Do we actually have any legacy dwc3 users in Linux that are neither DT nor PCI based? Maybe we can just skip that. > else > dev = &pdev->dev; > do { > if (is_device_dma_capable(dev)) { > dwc->sysdev = dev; > break; > } > dev = dev->parent; > while (dev); > ^this cycle can be limited in depth (2 for PCI) Right, this could work by itself and looks generic enough. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Thu, 08 Sep 2016 14:14:50 +0200 Subject: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: <01a5728b-9ea7-3ccf-34e8-7602a654306b@ti.com> References: <87d1keirlu.fsf@linux.intel.com> <01a5728b-9ea7-3ccf-34e8-7602a654306b@ti.com> Message-ID: <3028577.HpC29kEMTB@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thursday, September 8, 2016 3:02:56 PM CEST Grygorii Strashko wrote: > dwc3: probe() > if (!&pdev->dev->of_node) > legacy case - hard-code DMA props > dwc->sysdev = &pdev->dev; The PCI case will fall into this too, as we almost never have an ->of_node pointer for a PCI device. Do we actually have any legacy dwc3 users in Linux that are neither DT nor PCI based? Maybe we can just skip that. > else > dev = &pdev->dev; > do { > if (is_device_dma_capable(dev)) { > dwc->sysdev = dev; > break; > } > dev = dev->parent; > while (dev); > ^this cycle can be limited in depth (2 for PCI) Right, this could work by itself and looks generic enough. Arnd