From patchwork Mon Jun 6 05:56:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 69368 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1322369qgf; Sun, 5 Jun 2016 22:57:01 -0700 (PDT) X-Received: by 10.66.6.35 with SMTP id x3mr22700519pax.135.1465192621262; Sun, 05 Jun 2016 22:57:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x123si26265233pfb.235.2016.06.05.22.57.01; Sun, 05 Jun 2016 22:57:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750963AbcFFF4q (ORCPT + 5 others); Mon, 6 Jun 2016 01:56:46 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:33627 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743AbcFFF4p (ORCPT ); Mon, 6 Jun 2016 01:56:45 -0400 Received: by mail-pf0-f177.google.com with SMTP id y124so3859043pfy.0 for ; Sun, 05 Jun 2016 22:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Wh90zUZgBgmo3BV58b6aaHVvFyWKBXXLWf1Rzzgi138=; b=UJlrc+jtFH+xMlVH6OvECp4L2+Vg6YYJih6jIb2j8t7qvpkmMDFNOeUgKBdVoXgyFT KkE+Xe0uU0P9jsSe1eG087hjlpK/BME54+6AmPiOjOye+A5whj5FLbe8ZjzohIg4j3dE O5ciqknW0/yETCxhg2HzCC2jqBZr0tQLMa1lU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Wh90zUZgBgmo3BV58b6aaHVvFyWKBXXLWf1Rzzgi138=; b=dS9D5Llx2iYEQeC1dQ66as7uW0cu+8wqTZqSgAH0YkzIs6fkNmOchASuMG4Ld0IpZg WtZU+0bb4JIizL1m78bdId4q8rEWmEIsjvr3Cz/vfcUaurdbw+hiMgEAvhmnQa4P+vrq AeHY6yYDCProTetcCjNLZPv9MsV85eot8CNrvvDXG00ai00UY9oXB46UyE9OB0l9GTik MXY56+35dwBmbqcTYVXCFHdhfLlw8bdfwSeyaLjUyv1tBaAmN4J7mQpGEkv74h/K4MBA Yg/wO6/qhnvP5nrPHXW3ZLbExa4yX65kHvEvPpC0DmP/yqtSjKeTku5gjriti2INHF0Y a0zg== X-Gm-Message-State: ALyK8tLiMGsLF7itBWNNoymXhR5obahESVafwZs0LqkolvdUOf8CctUW3lxz1sHouonVA84N X-Received: by 10.98.25.212 with SMTP id 203mr23279432pfz.94.1465192604293; Sun, 05 Jun 2016 22:56:44 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id t77sm24116762pfa.71.2016.06.05.22.56.41 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Jun 2016 22:56:43 -0700 (PDT) From: Baolin Wang To: balbi@kernel.org, gregkh@linuxfoundation.org Cc: broonie@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org Subject: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device Date: Mon, 6 Jun 2016 13:56:11 +0800 Message-Id: <3f7a77848164a753b8918925f69aa0fd6c985850.1465192322.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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(+) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 + dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask); xhci->dev.parent = dwc->dev;