From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BD17C433DF for ; Thu, 27 Aug 2020 18:48:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E91122087C for ; Thu, 27 Aug 2020 18:48:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yZf8cIH2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E91122087C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=60z7VWU9/Sz9w1aFzJhwpjunV6ArViSpKqQU/aXlJcI=; b=yZf8cIH2htCDSa+P49HNJ+VVO 2CQ5kBv1mzSbsSbgJRmCFI+iJAFG6rWfNsr/wRuJG3U8JGo/ML2dPqO++IBK4/upEkobHi8T8DzeI 0/SPldXtLZG5opPchKLT2H3e/Xz7uPQ2uluEv1IcRNGFCJ2w4xA3Gc+JGgLC49LtBBjIr6U3/uwZM ujeJy1Fw1MRcZleYxtbhTv0bswiJERnDssi5xsEfekTbXgW8r/N40pCODK3FDErwqzf/vXwVApaJd hqHXvJJZEeI5y9vrJ2K3nXSwTRqOZnl7/ms3A0ZMQ6oc28BDArJdhZIFzJ2v7fx89lbK8C/H7EUJl XKM9Ev06w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBMv5-00020Y-Q3; Thu, 27 Aug 2020 18:46:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBMv3-000206-0Y for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 18:46:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F0519101E; Thu, 27 Aug 2020 11:46:39 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 579663F68F; Thu, 27 Aug 2020 11:46:38 -0700 (PDT) Subject: Re: [PATCH 2/2] usb: dwc3: Add driver for Xilinx platforms To: Manish Narani , gregkh@linuxfoundation.org, robh+dt@kernel.org, michal.simek@xilinx.com, balbi@kernel.org, p.zabel@pengutronix.de References: <1598467441-124203-1-git-send-email-manish.narani@xilinx.com> <1598467441-124203-3-git-send-email-manish.narani@xilinx.com> From: Robin Murphy Message-ID: <0927fb9f-1044-38b3-d6f3-76edffefd99c@arm.com> Date: Thu, 27 Aug 2020 19:46:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <1598467441-124203-3-git-send-email-manish.narani@xilinx.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_144641_116621_B44A6CEC X-CRM114-Status: GOOD ( 16.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-08-26 19:44, Manish Narani wrote: [...] > + /* > + * This routes the usb dma traffic to go through CCI path instead > + * of reaching DDR directly. This traffic routing is needed to > + * make SMMU and CCI work with USB dma. > + */ > + if (of_dma_is_coherent(dev->of_node) || dev->iommu_group) { > + reg = readl(priv_data->regs + XLNX_USB_COHERENCY); > + reg |= XLNX_USB_COHERENCY_ENABLE; > + writel(reg, priv_data->regs + XLNX_USB_COHERENCY); > + } This looks rather suspect - coherency should be based on coherency, not on whether an IOMMU group is present. If the device isn't described as coherent in the DT, then any SMMU mappings will end up using attributes that will downgrade traffic to be non-snooping anyway. And if the SMMU is enabled but not translating (e.g. "iommu.passthrough=1") then enabling hardware coherency when the DMA layer hasn't been told about it can potentially lead to nasty subtle problems and data loss. Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel