From patchwork Tue Apr 25 10:01:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 9697819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE37D6020A for ; Tue, 25 Apr 2017 10:07:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9986228438 for ; Tue, 25 Apr 2017 10:07:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E6B2285E7; Tue, 25 Apr 2017 10:07:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 23A4028438 for ; Tue, 25 Apr 2017 10:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=YRqtQs5KC+NHNJ/lOUfjKLFg2kYZzTz5zw8tY7hco3g=; b=fVO1bEGBV283OM FYPczQ+vzjrIftHhFFSvp+ktQMv1OA0dEf0I4aDzF7aM7rdFkVoWxynnuK+FXr1MlMFfoqwJ86cuW QL+QExpQrT5Qjv2CxHZO2al8nrER4iEb8hO7Ttv5O5DS7tTgiCg8WD+9k1JqxjAZRyqEONJLo+LjC 28xemVI+Q6Vchiua79VyOrtHz1p2cpM0ZZnmetFmbQGYEBaizes2wQPhUgbHGo+7sB9ZbTbsymNGx JS2fULF4yo+4+bMzgXpxDslq14AD4jqIa9ZQWItK2EdIZc76/iX0OLOcca49Ag8yWqL+55BBhOZ4V fi3xT7PlLlAh8UlQcDDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d2xNA-0005qE-CF; Tue, 25 Apr 2017 10:07:04 +0000 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174] helo=mx0b-0016f401.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2xN6-0005nb-CE for linux-arm-kernel@lists.infradead.org; Tue, 25 Apr 2017 10:07:01 +0000 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v3PA4pe6004060; Tue, 25 Apr 2017 03:06:31 -0700 Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2a04hkn68u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2017 03:06:31 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 25 Apr 2017 03:06:30 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Tue, 25 Apr 2017 03:06:30 -0700 Received: from xhacker (unknown [10.37.131.0]) by maili.marvell.com (Postfix) with ESMTP id EFFDB3F703F; Tue, 25 Apr 2017 03:06:28 -0700 (PDT) Date: Tue, 25 Apr 2017 18:01:51 +0800 From: Jisheng Zhang To: Peter Chen , , , , "Arnd Bergmann" , Catalin Marinas Subject: [RFC] usb: chipidea: set dma_ops for the created ci_hdrc platform_device Message-ID: <20170425180151.0f03ca0e@xhacker> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-25_04:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704250183 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170425_030700_433278_29ADFE29 X-CRM114-Status: UNSURE ( 7.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felipe Balbi Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi all, After commit 1dccb598df549 ("arm64: simplify dma_get_ops"), the chipidea driver can't work any more on Marvell Berlin arm64 platforms, the reason is the created ci_hdrc platform_device's dma_ops is dummy_dma_ops, so all dma related operations will fail. The fix I can think of would be something as below: And I noticed that dwc3 has the same issue[1], and as pointed out in its discussion, the patch can't fix None-DT platforms, so could you please guide me what's the proper fix which can be mainlined? Any suggestion is appreciated! Thanks, Jisheng [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-April/425079.html diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 047afdbb7049..acb80457603c 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -786,6 +787,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev, pdev->dev.dma_mask = dev->dma_mask; pdev->dev.dma_parms = dev->dma_parms; dma_set_coherent_mask(&pdev->dev, dev->coherent_dma_mask); + of_dma_configure(&pdev->dev, dev->of_node); ret = platform_device_add_resources(pdev, res, nres); if (ret)