From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbcFGCLp (ORCPT ); Mon, 6 Jun 2016 22:11:45 -0400 Received: from mail-yw0-f170.google.com ([209.85.161.170]:35103 "EHLO mail-yw0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752395AbcFGCLn (ORCPT ); Mon, 6 Jun 2016 22:11:43 -0400 MIME-Version: 1.0 In-Reply-To: <8760tmcqir.fsf@linux.intel.com> References: <3f7a77848164a753b8918925f69aa0fd6c985850.1465192322.git.baolin.wang@linaro.org> <8760tmcqir.fsf@linux.intel.com> From: Baolin Wang Date: Tue, 7 Jun 2016 10:11:41 +0800 Message-ID: Subject: Re: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device To: Felipe Balbi Cc: Greg KH , Mark Brown , USB , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6 June 2016 at 22:59, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> On ARM64 platform, it will set 'dummy_dma_ops' for device dma_ops if >> it did not call 'arch_setup_dma_ops' at device creation time, that will >> cause failure when setting the dma mask for device. >> >> Thus this patch set the xhci device dma_ops from the parent device if >> the xhci device dma_ops is 'dummy_dma_ops'. >> >> Changes since v1: >> - Add CONFIG_ARM64 macro. >> >> Signed-off-by: Baolin Wang >> --- >> drivers/usb/dwc3/host.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c >> index c679f63..edb666d 100644 >> --- a/drivers/usb/dwc3/host.c >> +++ b/drivers/usb/dwc3/host.c >> @@ -32,6 +32,11 @@ int dwc3_host_init(struct dwc3 *dwc) >> return -ENOMEM; >> } >> >> +#ifdef CONFIG_ARM64 >> + if (get_dma_ops(&xhci->dev) == get_dma_ops(NULL)) >> + xhci->dev.archdata.dma_ops = get_dma_ops(dwc->dev); >> +#endif > > I don't like the ifdef and also don't like that this is done in dwc3 > itself. Seems like we need something like this done from the > platform_bus core. OK. I will try to fix this issue in platform_bus core. Thanks. > > -- > balbi -- Baolin.wang Best Regards