Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6658490ybn; Mon, 30 Sep 2019 01:26:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfob26on0jwonb9vbkDQ7VKHNgmDQGL3n4CpauYy8GWYJiCeZSmjVCuBkvyrtJXXLu1qLF X-Received: by 2002:a17:906:a44e:: with SMTP id cb14mr18194672ejb.277.1569831963068; Mon, 30 Sep 2019 01:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569831963; cv=none; d=google.com; s=arc-20160816; b=0LJx0lTGvRjsDKFBVg5sEBRzZZTx5G97yOlwGcbxXn5nbDUbl9Qx5EKdj57AeZB6Yl FPhVwnkhpiqn+gx3DReyC8udGotwGp1Hy4pKWTP7EM0GDjq7/sVwMt+v88GAR+eRrNTz 3L1UqZRDL8NHwCdOIXW6cA+leW9ZcwhGdE7nX1tAnbRqd1srQJ3XcqQnWpe5gaaoS9nV AFECh9DzfDC6GjVPFaIzLGhUjXWitw70ha1Y21/5g7HU5MFMs7TsCfoHL4v+S47CNq8S DjwiXTDOOSmxj5R+bq8h1Dm1eQKwEhqQ6VrZA56YvI4+w+6KYqDNUEzwcNZUT2ZgewWO T2AA== 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=eUrejGB2jTrsHWK+x65Vhx7Oqte2kExU80wcqs9+O8c=; b=WSRd1OqB29kdb6Lkg6X3Ywm++oxtHPVszqo6xNw4u5WqaMmWo+2dAEvot001fFKrVM APBcrUA4HYH0PL/ZpxhkQKPmr+ViiHsZ0Biq6PI3ixlcySu67OPhZk85Sv5M94Txciar ScaI0lKiQLDhGCmWlSC6Euqq/k6YkW0ylhi0qNoq7Ovu93P0tKujN/EKmEvqqWpjEHdz mKCiJ2JajpT7vivcjiPSEZ+Mj0mEsDwj+agH7wTNNsG6/D9EWSQjL+39x8h8TuwLjauO Msnu1BSlzN/mnCmvF96Jts1+O6gMwJFGmXIRpDIPoC2QsFp49LoKrlLGvVc0KESzHIaB 587w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=N9do07O7; 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 c12si6670015edb.394.2019.09.30.01.25.38; Mon, 30 Sep 2019 01:26:03 -0700 (PDT) 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=N9do07O7; 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 S1729996AbfI3IXL (ORCPT + 99 others); Mon, 30 Sep 2019 04:23:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55114 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726425AbfI3IXL (ORCPT ); Mon, 30 Sep 2019 04:23:11 -0400 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=eUrejGB2jTrsHWK+x65Vhx7Oqte2kExU80wcqs9+O8c=; b=N9do07O7Hzkk3KQpRo+5O9qvD xUqHFklPpKe6Nqgjf9GIXkTCmoIIBqy7SCTn9cO4AhsCLaWx7Fo4plAN0peHey6S5Ze6ZI1ioQCSG 7/pvOrAQX7qGR/n5OuzA2EOjNwln0V+QIDECng/YOS2wSeMg0aYN3xJ6ww6ppblIsMchevEv3zyrj +LimRELxYS6JWSsoXKz86g0BRriyXwuCY1T3SFFiZdDr6HDlnU53vGW5DJtcuBTY0LE9G0ZY/nOrF 0fmQCibgFDj/m0T9TByR7ikb8b9KZoVuMV0guPOZ4mXr0CcIbTs5WbyhWrgjFx6LcVbiPhmTEuciQ 73/duYuaA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iEqxa-0001og-GL; Mon, 30 Sep 2019 08:23:10 +0000 Date: Mon, 30 Sep 2019 01:23:10 -0700 From: Christoph Hellwig To: Nicolas Boichat Cc: Shik Chen , Linux Media Mailing List , Tomasz Figa , notify@kernel.org, Keiichi Watanabe , Ricky Liang , Mauro Carvalho Chehab , Laurent Pinchart , lkml , kieran.bingham@ideasonboard.com, Vlastimil Babka , Christoph Lameter , Christoph Hellwig Subject: Re: [PATCH] media: uvcvideo: Use streaming DMA APIs to transfer buffers Message-ID: <20190930082310.GA1750@infradead.org> References: <20190802131226.123800-1-shik@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 28, 2019 at 11:33:16AM +0800, Nicolas Boichat wrote: > > +static gfp_t uvc_alloc_gfp_flags(struct device *dev) > > +{ > > + u64 mask = dma_get_mask(dev); > > + > > + if (dev->bus_dma_mask) > > + mask &= dev->bus_dma_mask; > > + > > + if (mask < DMA_BIT_MASK(32) && IS_ENABLED(CONFIG_ZONE_DMA)) > > + return GFP_DMA; > > + > > + if (mask < DMA_BIT_MASK(64)) { > > + if (IS_ENABLED(CONFIG_ZONE_DMA32)) > > + return GFP_DMA32; > > We're hitting issues with this on 64-bit ARM platform, where > ZONE_DMA32 is enabled (default), the kmalloc allocation with GFP_DMA32 > fails. > > There is no slab cache for GFP_DMA32, so those calls are expected to > fail, AFAICT there are no other (working) kmalloc(..., .. | GFP_DMA32) > users in the kernel, so I don't think we want to add a cache. If this > helps, some discussion here why the cache wasn't added: > https://lore.kernel.org/patchwork/patch/1009563/#1198622 And drivers really have no business looking at the dma mask. I have a plan for dma_alloc_pages API that could replace that cruft, but until then please use GFP_KERNEL and let the dma subsystem bounce buffer if needed.