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,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 3EA41C433E0 for ; Tue, 23 Feb 2021 16:00:58 +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 C2FD664DF3 for ; Tue, 23 Feb 2021 16:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2FD664DF3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu 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 388B16E9C8; Tue, 23 Feb 2021 16:00:57 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by gabe.freedesktop.org (Postfix) with SMTP id 537D16E9E1 for ; Tue, 23 Feb 2021 16:00:55 +0000 (UTC) Received: (qmail 1264176 invoked by uid 1000); 23 Feb 2021 11:00:54 -0500 Date: Tue, 23 Feb 2021 11:00:54 -0500 From: Alan Stern To: Thomas Zimmermann Subject: Re: [PATCH v3] drm: Use USB controller's DMA mask when importing dmabufs Message-ID: <20210223160054.GC1261797@rowland.harvard.edu> References: <20210223105842.27011-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 , hdegoede@redhat.com, gregkh@linuxfoundation.org, 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 use > > of udev->bus->controller here looks a bit suspicious. As the old USB > > code (before the commit 6eb0233ec2d0) indicated, it was rather > > usb->bus->sysdev that was used for the DMA mask, and it's also the one > > 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 original > 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 the 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 that it could go into the -stable kernels with no trouble. Alan Stern _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel