From patchwork Fri Jun 3 11:50:41 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: 69241 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp221460qgf; Fri, 3 Jun 2016 04:51:20 -0700 (PDT) X-Received: by 10.66.237.69 with SMTP id va5mr4805063pac.49.1464954680255; Fri, 03 Jun 2016 04:51:20 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si5408403paw.80.2016.06.03.04.51.19; Fri, 03 Jun 2016 04:51:20 -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 S1752196AbcFCLvS (ORCPT + 5 others); Fri, 3 Jun 2016 07:51:18 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34801 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751802AbcFCLvR (ORCPT ); Fri, 3 Jun 2016 07:51:17 -0400 Received: by mail-pa0-f54.google.com with SMTP id bz2so14161803pad.1 for ; Fri, 03 Jun 2016 04:51:17 -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=yA97XoOIBkz0EdKBNrxurwiytYpoXSCB07rf/hrjUU8=; b=eKv1HtzWq9y+dokIIgY98+u8Ca5WPwaZ1pIoVQDq/8Vbl7tPgRxipXKXctuBpHDIMo CYQ3N3fCsmOYo96XGe2xb6Ngo3SiBFbQ/KdH7L36lWWQgKNEnJ+sUlEIKNDGZivBNfet lBYY4+EMCL7METfH0l+zQST9wqA0AWHZdJqKM= 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=yA97XoOIBkz0EdKBNrxurwiytYpoXSCB07rf/hrjUU8=; b=dUxfQRc1b0nJT1hfJWZbOiYdjJ+YrtZr7bwNAoHByDBblH6qz/0AFqbCjsYVuZNDqL 6hpoJJ7Wbsd0CXn0TKQEuOqBLbojR2ZmGsbkL/1YVisNywYtgakmE+AFSF5O3ufUYLxz JWP6YJ9RrIqEghPZRnVmdWZBtt7ALGwexzC4H+2VoJN/pmT/KDKbyWbWnhNPrNolHcv4 bTaYfHax+Kj5d05qyZLQhC1VV+oTg7Tp2aJ/LI+hoyxo5R6pmXMJ0w8+6zy0FsRt/mNd HgGoNKmGnbYwWEWMvmPA78m6h9aD2CDJnh+T1zXhBDXj5AhFWhPGdJBPVml0guNFXMOq cA1g== X-Gm-Message-State: ALyK8tIqfGMFb8WfOm6qKyg/0nw7FWA2ljq1Apt5rED/MgmXEXfexZZZAyHw/OEgQHlRIK3C X-Received: by 10.66.132.103 with SMTP id ot7mr4914418pab.60.1464954676868; Fri, 03 Jun 2016 04:51:16 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id fd8sm5505054pac.23.2016.06.03.04.51.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Jun 2016 04:51:16 -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] usb: dwc3: host: Set the dma_ops for xhci device Date: Fri, 3 Jun 2016 19:50:41 +0800 Message-Id: <080a90edd87ecddc9ef004bd836b77de1fbf210b.1464954454.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 It will be failed when xhci device set the dma mask, if the xhci device dma_ops is dummy. Thus set the xhci device dma_ops from the parent device. Signed-off-by: Baolin Wang --- drivers/usb/dwc3/host.c | 3 +++ 1 file changed, 3 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..7ce55c9 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -32,6 +32,9 @@ int dwc3_host_init(struct dwc3 *dwc) return -ENOMEM; } + if (get_dma_ops(&xhci->dev) == get_dma_ops(NULL)) + xhci->dev.archdata.dma_ops = get_dma_ops(dwc->dev); + dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask); xhci->dev.parent = dwc->dev;