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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 78318C433DB for ; Tue, 23 Feb 2021 17:30:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B84E64E83 for ; Tue, 23 Feb 2021 17:30:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232920AbhBWRau (ORCPT ); Tue, 23 Feb 2021 12:30:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:47692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232810AbhBWRat (ORCPT ); Tue, 23 Feb 2021 12:30:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B85C264E85; Tue, 23 Feb 2021 17:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614101408; bh=0sov8GotWsBDdlLayNbjA2epe830T2G9FtT8QS8zYxs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UX492ZtzutLmQXcQymKcC+ZlGihNg9kUBARJmIwwfVTRXEuflcUwn/rpCL6vWAG8d rnt04Q6rCx8qCf5NsDLtGcY8i3eHPqVD3JGmm2w5F2cl84qYvRnmTCYV+LdpiddEnH BLFQAujOP0PZbTfpXu6XAsfMYWY6qd3GbFVnFmYk= Date: Tue, 23 Feb 2021 18:30:05 +0100 From: Greg KH To: Alan Stern Cc: Thomas Zimmermann , Takashi Iwai , Mathias Nyman , airlied@linux.ie, Sebastian Andrzej Siewior , Oliver Neukum , Johan Hovold , hdegoede@redhat.com, Christoph Hellwig , dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Thomas Gleixner , Andy Shevchenko , sean@poorly.run, christian.koenig@amd.com Subject: Re: [PATCH v3] drm: Use USB controller's DMA mask when importing dmabufs Message-ID: References: <20210223105842.27011-1-tzimmermann@suse.de> <20210223160054.GC1261797@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210223160054.GC1261797@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 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. Yes, sorry for not being clear, that is what I think would make the most sense, then all USB drivers could use it easily and it can be changed in one location if the DMA logic ever changes. thanks, greg k-h