Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1880293ima; Sat, 2 Feb 2019 09:17:22 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibuyf7U6wwcrCtGW/FOX3ckidbhWB/tiSw3YNa3r9BrQ8lzcO1CcBrQTFeDV9mKx6Y9RbPz X-Received: by 2002:a65:4784:: with SMTP id e4mr6630025pgs.12.1549127842011; Sat, 02 Feb 2019 09:17:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549127841; cv=none; d=google.com; s=arc-20160816; b=V/8Bv6UAT3xryGKztE+66FP/QaRM4gOLOUaDS4s8ZeqeKI9j9oB8Yi0hZ1jr1vNLYw EFYStiHUpRUHjnPc29G9I3gHlvWd7fnIbJ9o+cXQNMlE7uBDtLXyCHp6DCAFeGMNYiIP n1fBfthPnP9wwD5wTrdV33EzcV7B32rNWJ0xppvszeJQD7R4raH7DYYx8fxNv46phky3 RozLy+2Ul24b6sTYXbUTar9kJLq3kT9APaMY8Ctwse5e4JKgL6enhHD1rUJQu2zWMnF5 bcFUz635RVlL5M5LQHOMgYw3VKHuaD2Mbf6RA7eTDqBJTwLA62pyah+tKO0vnJceOQmg 7SXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=pLEt62IsxPHCAP/zsqjdrPoLoBMZ4mJfXUjfvXzN+ao=; b=UdtPiayBIGKlEJh3suebD9tQB4rXiHdKMpF8Iv2DPkRcAsvWOh2PFviq/epJzm2Wyk bWTJs6zzsTnMikFiDbQ/EGq7TxnqPbycsfaOPOHRVGJXmb/Bhc5fNZEprrLZYrC3T3CA /fyjweJFL/4z6vr1b0ZHVpHnVtb339BH0OgjhPCT5Bi5MXGFGhTHCDvupvJycd032N2D HQYtPqRByBlsOf6Snd69u4UhnwAuU6h9hYA4oc7Q13CN5W5/VR/O+/FrJe7Eh0UjB6RZ ZUwFir0NW8vQX+xcyHcmpVJbEt7kA5QkXZPDF4YVbYjqS+NRiMgRHSYVfjjqL48/bej0 NnQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si10800747pld.36.2019.02.02.09.17.06; Sat, 02 Feb 2019 09:17:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726486AbfBBRRB (ORCPT + 99 others); Sat, 2 Feb 2019 12:17:01 -0500 Received: from verein.lst.de ([213.95.11.211]:40524 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfBBRRA (ORCPT ); Sat, 2 Feb 2019 12:17:00 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 894B968CEB; Sat, 2 Feb 2019 18:16:59 +0100 (CET) Date: Sat, 2 Feb 2019 18:16:59 +0100 From: Christoph Hellwig To: Darren Hart Cc: Christoph Hellwig , stuart.w.hayes@gmail.com, andy@infradead.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Mario_Limonciello@Dell.com Subject: Re: [PATCH] dell_rbu: stop abusing the DMA API Message-ID: <20190202171659.GA3324@lst.de> References: <20190129073409.7247-1-hch@lst.de> <20190201231559.GC105752@fedora.eng.vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190201231559.GC105752@fedora.eng.vmware.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 01, 2019 at 03:15:59PM -0800, Darren Hart wrote: > On Tue, Jan 29, 2019 at 08:34:09AM +0100, Christoph Hellwig wrote: > > For some odd reason dell_rbu actually seems to want the physical and > > not a bus address for the allocated buffer. Lets assume that actually > > is correct given that it is BIOS-related and that is a good source > > of insanity. In that case we should not use dma_alloc_coherent with > > a NULL device to allocate memory, but use GFP_DMA32 to stay under > > the 32-bit BIOS limit. > > + Mario re bios related physical address - is Christoph's assumption > correct? > > Christoph, did you observe a failure? If so, we should probably also > tag for stable. No, I've been auditing for DMA API (ab-)users that don't pass a struct device. Generally the fix was to just pass a struct device that is easily available. But dell_rbu doesn't actually seem to be a "device" in the traditional sense, and the way it uses the DMA API is really, really odd - it first does a virt_to_phys on memory allocated from the page allocator (so works with physical addresses in that case) and the retries with a dma_alloc_coherent with a NULL argument, which in no way is guaranteed to you give you something else, although for the current x86 implementation will give you the equivalent of a GFP_DMA32 page allocator allocation plus virt_to_phys.