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=-5.2 required=3.0 tests=BAYES_00, 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 DBEA4C433DB for ; Wed, 24 Feb 2021 05:59:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 5867A64DF2 for ; Wed, 24 Feb 2021 05:59:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5867A64DF2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AFFD6EA59; Wed, 24 Feb 2021 05:59:30 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE4EF6EA59 for ; Wed, 24 Feb 2021 05:59:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6F8EDADCD; Wed, 24 Feb 2021 05:59:27 +0000 (UTC) Subject: Re: [PATCH v3] drm: Use USB controller's DMA mask when importing dmabufs To: Greg KH , Alan Stern References: <20210223105842.27011-1-tzimmermann@suse.de> <20210223160054.GC1261797@rowland.harvard.edu> From: Thomas Zimmermann Message-ID: Date: Wed, 24 Feb 2021 06:59:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathias Nyman , airlied@linux.ie, Sebastian Andrzej Siewior , Oliver Neukum , Johan Hovold , dri-devel@lists.freedesktop.org, Christoph Hellwig , hdegoede@redhat.com, stable@vger.kernel.org, Thomas Gleixner , Andy Shevchenko , sean@poorly.run, christian.koenig@amd.com Content-Type: multipart/mixed; boundary="===============1659346566==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============1659346566== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nQudoPuhcJk4FGGLnlplbxIzg0LF3nFC0" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nQudoPuhcJk4FGGLnlplbxIzg0LF3nFC0 Content-Type: multipart/mixed; boundary="2IhysdsNLPfWsRC8nPxLKdv1wUERlTOmS"; protected-headers="v1" From: Thomas Zimmermann To: Greg KH , Alan Stern Cc: Mathias Nyman , hdegoede@redhat.com, Sebastian Andrzej Siewior , Oliver Neukum , Johan Hovold , dri-devel@lists.freedesktop.org, christian.koenig@amd.com, airlied@linux.ie, stable@vger.kernel.org, Thomas Gleixner , Andy Shevchenko , sean@poorly.run, Christoph Hellwig Message-ID: Subject: Re: [PATCH v3] drm: Use USB controller's DMA mask when importing dmabufs References: <20210223105842.27011-1-tzimmermann@suse.de> <20210223160054.GC1261797@rowland.harvard.edu> In-Reply-To: --2IhysdsNLPfWsRC8nPxLKdv1wUERlTOmS Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 23.02.21 um 18:30 schrieb Greg KH: > On Tue, Feb 23, 2021 at 11:00:54AM -0500, Alan Stern wrote: >> On Tue, Feb 23, 2021 at 03:06:07PM +0100, Thomas Zimmermann wrote: >>> Hi >>> >>> Am 23.02.21 um 14:44 schrieb Takashi Iwai: >> >>>> Aside from the discussion whether this "workaround" is needed, the u= se >>>> of udev->bus->controller here looks a bit suspicious. As the old US= B >>>> code (before the commit 6eb0233ec2d0) indicated, it was rather >>>> usb->bus->sysdev that was used for the DMA mask, and it's also the o= ne >>>> most of USB core code refers to. A similar question came up while >>>> fixing the same kind of bug in the media subsystem, and we concluded= >>>> that bus->sysdev is a better choice. >>> >>> Good to hear that we're not the only ones affected by this. Wrt the o= riginal >>> code, using sysdev makes even more sense. >> >> Hmmm, I had forgotten about this. So DMA masks aren't inherited after= >> all, thanks to commit 6eb0233ec2d0. That leas me to wonder how well >> usb-storage is really working these days... >> >> The impression I get is that Greg would like the USB core to export a >> function which takes struct usb_interface * as argument and returns th= e >> appropriate DMA mask value. Then instead of messing around with USB >> internals, drm_gem_prime_import_usb could just call this new function.= >> >> Adding such a utility function would be a sufficiently small change th= at >> it could go into the -stable kernels with no trouble. >=20 > Yes, sorry for not being clear, that is what I think would make the mos= t > sense, then all USB drivers could use it easily and it can be changed i= n > one location if the DMA logic ever changes. We can certainly do that. Thanks for clarifying. I'll send out an=20 updated patch soon. Best regards Thomas >=20 > thanks, >=20 > greg k-h > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --2IhysdsNLPfWsRC8nPxLKdv1wUERlTOmS-- --nQudoPuhcJk4FGGLnlplbxIzg0LF3nFC0 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmA16z0FAwAAAAAACgkQlh/E3EQov+CB jBAAg/yUvEfw4VHrUbO3gk2kOiCv+LAGGzNy8/AW08efUqHujd8Ky0TokfO5Nt1kzl8PVkLbuaJZ xLCk7215ihobbLNdzPWiaQH+8hNLJD5VGTsuS9zMnZ77WBrhxxk85rY16w9dzKUhZmlBKMQ8lfx1 4Q3jx+KTlguHBF5cCRfGp9Yw5pcQtWm4MHWsuKV3uQtqv+FRGfI8HSW0iklENkV9rJPNOc0N4FNf 4hKUOobo/6zbqso302e/l+HyAE4TIlRq94y3kJCY5XVK3zBIIQpVpfz7uNRE4kZpaNfxCGjdSLLl 2Zedw8eTETIRtX0513u1V1rbUJV6aGTi2Q6cVjwiVkchyKHNAU4whcPcELwklDfZVzTv1lOqtp/Q 99OigNNDGIc5ApMFoXPyCScQdKaOG2NKbda/CePI8DmEKCZiJHrVDxsAMKqvV4P0q/4mrzTmHg2E mzKuvJKLZgtoL/pUof22krffahoctfeqyNtmiZi1SkYzCylcFhv4bIReK8DPnmVP4oG5QjFJhnlz Kog4j0tXrNY2fwVZZQGvEx7joU/gVOlxNY6BfaKbvybvzr3qb0CRvVcl7bMYo7u60seXuddPmMVT NxC6pbeKdLRYnhyGbqvIpEg6s+TBUGnlhpyBejl2WyV2t81hKoQexQIIx/CwFF99OEUCKAlw10tY D1A= =/LxH -----END PGP SIGNATURE----- --nQudoPuhcJk4FGGLnlplbxIzg0LF3nFC0-- --===============1659346566== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1659346566==--