Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp845788imj; Thu, 7 Feb 2019 12:49:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IYIuYICMKTh1aqbScKTmk3kTEXm8Xzt/b+8utCdTTJXjipR96dpbUBN8rSVavT45HwWwUOU X-Received: by 2002:a17:902:bf44:: with SMTP id u4mr3486870pls.5.1549572558925; Thu, 07 Feb 2019 12:49:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549572558; cv=none; d=google.com; s=arc-20160816; b=zPMiRGrB2Gha3rTmVK0Mrl/6SAYi6zPnYIXLmO26ziGddknIv4211jXusEykCSRmDn iVXpEiZjOa5yfM4dHT0Gke8JjdPnlx9xhZ7vKyJVpJaI8i/w09TsxGahAj4+WF3bPJ4W qM9Ah+EcN+OUitb7cHTCMnqeV+yMV8JZ3MybQ4pl+dkZ6AcSn6/VJAKjnvk4f3YNdslz v7VvvlO+d9sZnV0nL1SwLw/I14iCdZIZS5kYdCVrXzmfcYKEW3+xZHWzicQsdIbT5Ldq m55EZInCUKdAttccNfd4yjNtDKespQYU7z7cNPJqS0kW456H8frtlcE8H4jamMzA3bLr kBmw== 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:dkim-signature; bh=bEHNsOwIgj2itCnyGzcvVjHB+SGmRzUaNDbsBFafgJY=; b=xCKWFiPnY8zFjXW/KtjP9IXKOX196RmJge9sezM5un0OKEas9hUkydbsn8KZo8BcCa ApnjnuWkkYXWQh2/G5GWaKbsO1/ReFe77PxInOydVpKdV9tNbZXKne5vjh1Y19oFMY0l nzllzxvaQX6mIT27LCbzyukw8xpXC1i9Jv6kiyZfSV2RnWRzkiZ/HBV7x/DNFvNhTcK8 zHApMBJBbqP0RET2dGQhUsKgCrZJZQv/JQ7xciUNJBOf+SX0HzmEYyREBPdMRvmZkSZH 5cJAfRph4DDu/jXiLlV6AO/6CTRYse6djtAztniKM3WIm05dF9Fw2SX9YfJsl16N/wxS VDKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=a3w+mGLw; 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 h11si4052829pgp.518.2019.02.07.12.49.03; Thu, 07 Feb 2019 12:49:18 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=a3w+mGLw; 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 S1727472AbfBGUrd (ORCPT + 99 others); Thu, 7 Feb 2019 15:47:33 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:37226 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbfBGUrd (ORCPT ); Thu, 7 Feb 2019 15:47:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bEHNsOwIgj2itCnyGzcvVjHB+SGmRzUaNDbsBFafgJY=; b=a3w+mGLwkOd/LnmT1Kr17k8Ac iiSGnFoBQOvfQLItyqgAN5qfcm7xBZ1vMohHj+l/Mb86wTUG5ei8jRwOKQQr19RHICdtX+XBgnSPm ngWzQav+9byDRbJdC2L4Qt9dIA8BaiScsgkiNmCNFItcDrxdFfUL52noO6o/1wn/uMzK7HUaLlWpu +xc6VTs+Hb9K7rp9XlNqEH0fSbhdA65dTkFojxq87skezQMas/XHUvr3wXBm0xyO0mMNUqsB7deR1 hv7BMXw4MXdmqNRRb0lxu2L+R8nxalxpbbSjt9wzmoLAHETncwDBKhlTMSEA3l9iJ3vDvY4yGYgoV XgrmgX6dA==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1grqa3-00060N-Hd; Thu, 07 Feb 2019 20:47:31 +0000 Date: Thu, 7 Feb 2019 12:47:30 -0800 From: Darren Hart To: Christoph Hellwig Cc: 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: <20190207204730.GA21530@wrath> References: <20190129073409.7247-1-hch@lst.de> <20190201231559.GC105752@fedora.eng.vmware.com> <20190202171659.GA3324@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190202171659.GA3324@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 02, 2019 at 06:16:59PM +0100, Christoph Hellwig wrote: > 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. > Thanks Christoph, merged to for-next. -- Darren Hart VMware Open Source Technology Center