Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4788592pxu; Wed, 21 Oct 2020 05:33:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKBHHr+WphZcR9DQeylKKXG7nL7wPItQc+Qz3cg1JKlHEYiFTUa6lX3LmqCNWxNSCNps4A X-Received: by 2002:a17:906:d1c3:: with SMTP id bs3mr2284159ejb.246.1603283614006; Wed, 21 Oct 2020 05:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603283613; cv=none; d=google.com; s=arc-20160816; b=uUNIizFSE+uGcJOdWYpMezl1pTPhrwDxiz6/AeqPbzdhW+XmuHv4Okjbt5p1nAUWq3 hZFBcnFxnAZeVyFC3BYkR6iLQRfgFMyQVDPL4wi/IPyrcpXqZyXHkOr2hwQVOT1Awk/O P5aqAsZkN/9mzBXbCXQXbVPjIGPChioIFzW2bp8cRGWU8TRXIR2J8LYo7QDaOmzSGoYX yuJgxwMs64iYo6OAY3V/E2wpB9NPSEPjKY0WoaTfm/wxBq2UA4boZsohtG1ek8KXOgep HtMVQaKIl4lUZi/Rzca0dqclAZGiY3/p8V/2eQRRaT6rskgvL6j5ugDhbg7qYjSmVFOk DHlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=inv16vTmSLCCTJJlX3UIQMTG5fhdTc/3STov5C2dOHA=; b=vU2n5qf6vH0FOuAfDElmQX+6Aq2Zn8xACDSo7T3glaXbldH3XzsX0jloG5l8bpUIQM E2ka/ekLjQVKd95q0ZkmJH3DEL9PxKFxKfiqCHIoZy4Co4Y1+qVaV3FCpVxmvd/ehTCm htNI+PYnWuL+y8WA4+v4+sd1H5eXXwmL1L+0xnvDjFrffoHDNtFb8AyIpfhKgHxy86DM RXUjVoXupjHXyDIq2WR3MzTGFGMIbRmbzQi3JE3HWobudJ+QGnBdsExAn+R9cf82n8eX ng+QRsKRyIsSKEUDYppXq89eci8QxkEej8oPdN8RWqQ39RAWbs623Jx6fgVS4NMOlZ1Z JTYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uxBPJcrs; 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 e9si1148834ejd.398.2020.10.21.05.33.08; Wed, 21 Oct 2020 05:33:33 -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=uxBPJcrs; 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 S2440402AbgJUFSv (ORCPT + 99 others); Wed, 21 Oct 2020 01:18:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:55122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440398AbgJUFSv (ORCPT ); Wed, 21 Oct 2020 01:18:51 -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 5701D21D6C; Wed, 21 Oct 2020 05:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603257531; bh=C8dQdkv3mlE3dSkLdyzKxia49yjugNb94xNvwlhOYvs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uxBPJcrsFjytd1NxCXM4vBfjEbsNA5N+NXUBfjDsBTKdc1Y0tikAgrL6fTKwG2v+c i08g7msZHFBkOiEc14xz9jKKmRpx7MUaBMn6CIDoCVHFcshuLrVcVeIeqeWFDYLuot 1dzDNThqqMXy1z6r0x5nlmEvoTxAE0op1DIZh1Kw= Date: Wed, 21 Oct 2020 07:19:31 +0200 From: Greg Kroah-Hartman To: Furquan Shaikh Cc: linux-kernel@vger.kernel.org, Prashant Malani , Arthur Heymans , Patrick Rudolph , Ard Biesheuvel , dlaurie@google.com Subject: Re: [PATCH] firmware: gsmi: Drop the use of dma_pool_* API functions Message-ID: <20201021051931.GA967331@kroah.com> References: <20201021050141.377787-1-furquan@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201021050141.377787-1-furquan@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 10:01:41PM -0700, Furquan Shaikh wrote: > GSMI driver uses dma_pool_* API functions for buffer allocation > because it requires that the SMI buffers are allocated within 32-bit > physical address space. However, this does not work well with IOMMU > since there is no real device and hence no domain associated with the > device. > > Since this is not a real device, it does not require any device > address(IOVA) for the buffer allocations. The only requirement is to > ensure that the physical address allocated to the buffer is within > 32-bit physical address space. This change allocates a page using > `get_zeroed_page()` and passes in GFP_DMA32 flag to ensure that the > page allocation is done in the DMA32 zone. All the buffer allocation > requests for gsmi_buf are then satisfed using this pre-allocated page > for the device. Are you sure that "GFP_DMA32" really does what you think it does? A "normal" call with GFP_KERNEL" will give you memory that is properly dma-able. We should not be adding new GFP_DMA* users in the kernel in these days, just call dma_alloc*() and you should be fine. thanks, greg k-h