From patchwork Fri Oct 21 16:59:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 78696 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1399994qge; Fri, 21 Oct 2016 09:59:30 -0700 (PDT) X-Received: by 10.98.207.195 with SMTP id b186mr3320963pfg.66.1477069170184; Fri, 21 Oct 2016 09:59:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x86si3433943pff.54.2016.10.21.09.59.27; Fri, 21 Oct 2016 09:59:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1754986AbcJUQ70 (ORCPT + 10 others); Fri, 21 Oct 2016 12:59:26 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:34847 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751271AbcJUQ7Z (ORCPT ); Fri, 21 Oct 2016 12:59:25 -0400 Received: by mail-pf0-f180.google.com with SMTP id s8so59699432pfj.2 for ; Fri, 21 Oct 2016 09:59:25 -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:in-reply-to; bh=NhOK3bzSisvWdryI/5Sn59G7NCRWt6Xbg0FjidHUd74=; b=hDN7Bc8puGsdNYh+kFSTlFFaOCePCLUxeJ9k72XbUQDUtK0EUE2lptiigRIgbui8Wc sYEAL4rWo1+2cFvTIh/+TbbYDP6bh93UL9ybZDys0g7yPiBSc+rA+bDSAFjQ5ROe/hDU thy1YYgTwfNF0MRalbvPIfwpKWR7LYEq53lec= 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:in-reply-to; bh=NhOK3bzSisvWdryI/5Sn59G7NCRWt6Xbg0FjidHUd74=; b=IozuUCdulVHj+j5UJ/ytMSINV/dzh8ANQABX5poPs+2tDlzeBAm68cI3HQIWiKpBsG EfqNyTs5I/S0ay9EloCpHR4fhdwu3fNw9nD/fEilUyB3augWi/K2RcjtSi/9/olNmeFX dVXQcoqwCZIr8DsnFYHrgABmC75fujpWBOzt04tsj7fhmApCCgMneFSeMoq2dJMBKBOg wI5UkRdszM1mVHvFv3mVvfIrBsxLUHIBtD0m3+ER22vlchA7vVpPiYXPxZ7ElWNhQoDh QzF/7CVwVG39c3gM6LSY9wrgd/q6Ms8cvA0wyvZLMoU3tlpJ2MGxOS6o+ZoE9OTJ43xw LgPw== X-Gm-Message-State: ABUngvfMjdg0O84dIQ3y7teoNcu1juyHB9lrEcOYygzVLlgOTmIWg+QNMwtEYphl+l8z8ZL6 X-Received: by 10.99.140.90 with SMTP id q26mr2409607pgn.112.1477069163335; Fri, 21 Oct 2016 09:59:23 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id k89sm6508942pfg.6.2016.10.21.09.59.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Oct 2016 09:59:22 -0700 (PDT) From: Bjorn Andersson To: Peter Chen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stephen Boyd Subject: [RESEND PATCH] usb: chipidea: Configure DMA properties and ops from DT Date: Fri, 21 Oct 2016 09:59:19 -0700 Message-Id: <1477069159-12399-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456119133-16114-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org hcd_alloc_coherent() and usb_alloc_coherent() ends up allocating coherent memory on behalf of ci_hdrc driver. But as the ci_hdrc is instantiated manually it will not have any dma_mem or dma_ops assigned, which makes the dma_alloc_coherent() fail on some platforms (e.g. arm64). This patch solves this by assigning the dma_mem and dma_ops based on the parent's DeviceTree node. Cc: Stephen Boyd Signed-off-by: Bjorn Andersson --- Hi Peter, After (once more) debugging why USB doesn't work up on the 64-bit Qualcomm systems I realized that we never concluded on this patch. Unfortunately I can't find it in my mailbox either, so resending it to restart the discussion. Regards, Bjorn drivers/usb/chipidea/core.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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/chipidea/core.c b/drivers/usb/chipidea/core.c index 69426e644d17..6218d83cca25 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -837,6 +838,9 @@ struct platform_device *ci_hdrc_add_device(struct device *dev, pdev->dev.dma_parms = dev->dma_parms; dma_set_coherent_mask(&pdev->dev, dev->coherent_dma_mask); + if (IS_ENABLED(CONFIG_OF) && dev->of_node) + of_dma_configure(&pdev->dev, dev->of_node); + ret = platform_device_add_resources(pdev, res, nres); if (ret) goto err;