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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 A207EC4743E for ; Sun, 6 Jun 2021 19:14:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83E3361287 for ; Sun, 6 Jun 2021 19:14:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230425AbhFFTQT (ORCPT ); Sun, 6 Jun 2021 15:16:19 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:57925 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231409AbhFFTPc (ORCPT ); Sun, 6 Jun 2021 15:15:32 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 16EFA13CA; Sun, 6 Jun 2021 15:13:39 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute3.internal (MEProxy); Sun, 06 Jun 2021 15:13:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=mime-version:message-id:in-reply-to:references:date:from:to :cc:subject:content-type; s=fm1; bh=MvwFPayhTcEWvcEKv5TmWDsTvmr0 uW8J60CdljadmjU=; b=npM9QM3gszq8Ill6wwP/SEkE4LhInrBY4dFbI9BhX0dD kKD2bcY8I5mJpeCkwo3fhY+88TRsYuJLy8Xf27Qe/d+0z6yQIwqcOgbmI3uJD1NE 081ARB9ehTaeq/RdI6uVNmS9fYJnJP0AXvB4pLE3XpakWIwMPJUG1D4P8+XtHwmb BPP5eGdW6MB0dw2/dqTriTRxXVYy8fEwNisAH3tCUsp1uqJzofDY3Rh7kPqOU9Bg pG7sDigVZIi8d+Pu50uKOHRMjokZkYmv4JVFdILB1c6ioKhadtZgSzOUHTFo4ey0 NeEqVDF2VahZ4QNBS7/dtxuh/rTUkJcY+htPe0itoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=MvwFPa yhTcEWvcEKv5TmWDsTvmr0uW8J60CdljadmjU=; b=vE6KlurLNw53dkBYH8EL2n 9Jkl/4Hz3XbvsZ1KXAUCTPZRdWBPTzQLOD4Zlp04/gZDoNVsnyh0Mb+qJpiUlk8/ Snd+qkuYOBDDFlI00sIDWshBOnvwDQS6AYTpz2IIYTMtkamu+hjRWjj3OZ18d019 6liUA6na4BjR18xbSby1QculoUE+y4PIgIxKcyIudhOnwmzYCJMhARiXswSU8Hea zGYVY4dr41SMtiJwTZaGt218eFTB+Scn5MeFXBDI7FiftalgOsC+D/ybuYBfTbTZ QYIEoJbYzatA1eavW1UvM66o9S+GeN8I54ah2Yf2GTezcA/0dvgh5gEL0/e1U8Nw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedthedgudefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfufhv vghnucfrvghtvghrfdcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrf grthhtvghrnhepgfeigeeiffeuhfettdejgfetjeetfeelfefgfefgvddvtdfghfffudeh vdefkeffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshhvvghnsehsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2FE7F51C0060; Sun, 6 Jun 2021 15:13:37 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20210606103656.71079-1-sven@svenpeter.dev> Date: Sun, 06 Jun 2021 21:13:17 +0200 From: "Sven Peter" To: "Arnd Bergmann" Cc: "USB list" , "Felipe Balbi" , "Greg Kroah-Hartman" , "Linux Kernel Mailing List" Subject: Re: [PATCH v2] usb: dwc3: support 64 bit DMA in platform driver Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 6, 2021, at 17:43, Arnd Bergmann wrote: > On Sun, Jun 6, 2021 at 12:36 PM Sven Peter wrote: > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > > index b6e53d8212cd..4930541a8984 100644 > > --- a/drivers/usb/dwc3/core.c > > +++ b/drivers/usb/dwc3/core.c > > @@ -1545,6 +1545,21 @@ static int dwc3_probe(struct platform_device *pdev) > > > > dwc3_get_properties(dwc); > > > > + /* Try to set 64-bit DMA first */ > > + if (!dwc->sysdev->dma_mask) > > + /* Platform did not initialize dma_mask */ > > + ret = dma_coerce_mask_and_coherent(dwc->sysdev, > > + DMA_BIT_MASK(64)); > > + else > > + ret = dma_set_mask_and_coherent(dwc->sysdev, DMA_BIT_MASK(64)); > > + > > + /* If seting 64-bit DMA mask fails, fall back to 32-bit DMA mask */ > > + if (ret) { > > + ret = dma_set_mask_and_coherent(dwc->sysdev, DMA_BIT_MASK(32)); > > + if (ret) > > + return ret; > > + } > > Please drop the dma_coerce_mask_and_coherent() code path as well: if > the device is marked as non-DMA capable in the platform, it's better have > it not be usable at all than to assume a particular bus property that may > or may not be present on that bus. > > The 32-bit mask is the default on all buses you might see a dwc3 controller > on, so you can drop that as well, and just leave the > dma_set_mask_and_coherent(). > > Arnd > Makes sense, will drop the two things for v3. Thanks, Sven