From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752224AbaL3KNu (ORCPT ); Tue, 30 Dec 2014 05:13:50 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:58332 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751948AbaL3KNr (ORCPT ); Tue, 30 Dec 2014 05:13:47 -0500 From: Arnd Bergmann To: Sneeker Yeh Cc: Felipe Balbi , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Greg Kroah-Hartman , Mathias Nyman , Grant Likely , Alan Stern , Paul Bolle , Hans de Goede , Thomas Pugliese , David Mosberger , Peter Griffin , Sylwester Nawrocki , Andrew Bresticker , Gregory CLEMENT , Yoshihiro Shimoda , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Andy Green , Jassi Brar , Sneeker Yeh Subject: Re: [PATCH 2/3] usb: dwc3: add Fujitsu Specific Glue layer Date: Tue, 30 Dec 2014 11:12:51 +0100 Message-ID: <1456155.YPH2fYoGgF@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1418695828-605-1-git-send-email-Sneeker.Yeh@tw.fujitsu.com> <20141222155936.GB12815@saruman> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:yqUZZ07mJsIzIfb5z0rTq4oxC5IR2QonwKm0VDELdfUey4FoPop SPEeYBLRMx259wmOAQCdC9gomHy7wYKNfdp685smCe9Cn2XbmNAeIkesfUYg+WzQeEBQe3/ gS48tJF9xG4itOLqZljJDCFaNI8SG4Ji2w7vVVD2W60iujmvzWDOViLoluLf4tqatOO+J7W sAOTrfeWo/FouWv709fTA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 29 December 2014 01:52:04 Sneeker Yeh wrote: > > > +static int dwc3_mb86s70_remove_child(struct device *dev, void *unused) > > > +{ > > > + struct platform_device *pdev = to_platform_device(dev); > > > + > > > + of_device_unregister(pdev); > > > + > > > + return 0; > > > +} > > > + > > > +static u64 dwc3_mb86s70_dma_mask = DMA_BIT_MASK(32); > > > > why ? Use dma_coerce_mask_and_coherent(). > > > > okay. Actually that is still wrong: we use dma_coerce_mask_and_coherent() to annotate drivers that have traditionally been forcing their own dma mask by some other means and that need to be changed to something proper (after finding out why they did it in the first place). Since this is about a child device, the correct interface is to use platform_device_register_full(). Note that this will still only work on machines that have no dma offset, iommu, swiotlb, special coherency requirements, or ones that need a platform specific dma_map_ops. To make any of those work, the driver would need to be changed to pass the correct device pointer into any dma-mapping interfaces, so the settings can get set by the platform code. We will need to do that for arm64 I assume. Arnd