Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1973574pxk; Mon, 14 Sep 2020 00:54:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFp9dRN6e7CvKbtIZ18tUtIofOW7rAwQ5ChJrL5vfVzWhWAUxRQD7ZC5oSpk2s5U4mZeuM X-Received: by 2002:a17:906:344e:: with SMTP id d14mr13868294ejb.42.1600070045574; Mon, 14 Sep 2020 00:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600070045; cv=none; d=google.com; s=arc-20160816; b=lk96pMZB6iTvCeigSPcFvbG7dkXFrJsdSeA59NCKabM9AI4pT77857X3rnrQv8hWBY cdSM7/U5CTBGyqMUkWepM+fjhyA4G41sh9ONEFPbl+ntPBuC+FOoQcH49RVbVdUgO5QV 1S4u5STOn177kODR+3gv+6P8M6PwKhYrAyVDyFXfNo1XlQ7K31zES+Vu1kIuprrPxm16 dGe54WaAuDFar+bB/13VRAUY5FOIFAdenegZO94bXavKyW6bveyhOFmECeQnyWtqtlpg +EWy6ArPQ8md78sv/LVVaHebVpNv0iu86x0J3vTYdJVgEusWokeqV9jFjOETqFh52ELW 2Myg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BRNwh1UdWRD4Q3DNb769HppWzW4+Zk5CE7tXG+zPIyc=; b=YmeHEmWEGSxwaSDRoh93A/03IwxD70TY9GcxiNF3Vr+WnPnAVMPkO9v7dkVcwp7cfb SDEM5uOkQYJ6hswZdv5VZWYDdo20zwCat8SjTiGeqZG0kYAlxNHDcLsHwhs9S1j/cQpQ MQEWHUI27CvgJK8kkhe4zvzCoTEWIW1aSM2vnKuMSk8P6Lq4sDCouu3hkvfG0U1O6QSY h/jLw6iscBcMAd3eEpIWci2Vjl+7Si005A+xd8qMtwkCn9PYiIoalW5J0oYnm2TAxUhJ r5MtFDZKrTubG/QFtRlYnkGDUUFDzqWeklnBd1usT6N/oOVelA1ZcznJUX1AcpMIyJWw ibwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MUh+xMZ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd28si6548539ejb.302.2020.09.14.00.53.43; Mon, 14 Sep 2020 00:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MUh+xMZ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbgINHvr (ORCPT + 99 others); Mon, 14 Sep 2020 03:51:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:48106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbgINHvl (ORCPT ); Mon, 14 Sep 2020 03:51:41 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC8C720829; Mon, 14 Sep 2020 07:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600069900; bh=sLEmFEgLgQ6VIFDmYtTYiby9H19HNBdE2pb0auPAfNs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MUh+xMZ+3cK9OUG8yLvWphyyGhj7Or4v1gE0rD6UnExgdRYqIRszoy75p+Ht77soV dBzl7yjyDdoIBZvIAv/a8hHLpP7ud29rOK5ermxXFAxrIPMqc1KVs5mSVKaY1fISmm jyLnRqaaow9iBmMY+4C7qFm71KH/+bqz89eLJRHQ= Date: Mon, 14 Sep 2020 09:51:40 +0200 From: Greg Kroah-Hartman To: Christoph Hellwig Cc: iommu@lists.linux-foundation.org, Russell King , Santosh Shilimkar , Jim Quinlan , Nathan Chancellor , Florian Fainelli , Robin Murphy , Rob Herring , Frank Rowand , Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 5/6] usb: don't inherity DMA properties for USB devices Message-ID: <20200914075140.GA1033580@kroah.com> References: <20200914073343.1579578-1-hch@lst.de> <20200914073343.1579578-6-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200914073343.1579578-6-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 09:33:42AM +0200, Christoph Hellwig wrote: > As the comment in usb_alloc_dev correctly states, drivers can't use > the DMA API on usb device, and at least calling dma_set_mask on them > is highly dangerous. Unlike what the comment states upper level drivers > also can't really use the presence of a dma mask to check for DMA > support, as the dma_mask is set by default for most busses. > > Setting the dma_mask comes from "[PATCH] usbcore dma updates (and doc)" > in BitKeeper times, as it seems like it was primarily for setting the > NETIF_F_HIGHDMA flag in USB drivers, something that has long been > fixed up since. > > Setting the dma_pfn_offset comes from commit b44bbc46a8bb > ("usb: core: setup dma_pfn_offset for USB devices and, interfaces"), > which worked around the fact that the scsi_calculate_bounce_limits > functions wasn't going through the proper driver interface to query > DMA information, but that function was removed in commit 21e07dba9fb1 > ("scsi: reduce use of block bounce buffers") years ago. > > Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman