From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 3/5] dma-direct: refine dma_direct_alloc zone selection Date: Thu, 27 Sep 2018 17:41:17 +0200 Message-ID: <20180927154117.GA10956@lst.de> References: <20180920185247.20037-1-hch@lst.de> <20180920185247.20037-4-hch@lst.de> <20180927153028.GD10566@lst.de> <2b98d7b2-bf74-ccc9-881a-a91e2c9949c3@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <2b98d7b2-bf74-ccc9-881a-a91e2c9949c3-5wv7dgnIgG8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Robin Murphy Cc: Benjamin Herrenschmidt , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Greg Kroah-Hartman , linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Christoph Hellwig List-Id: iommu@lists.linux-foundation.org On Thu, Sep 27, 2018 at 04:38:31PM +0100, Robin Murphy wrote: > On 27/09/18 16:30, Christoph Hellwig wrote: >> On Thu, Sep 27, 2018 at 03:30:20PM +0100, Robin Murphy wrote: >>>> +static gfp_t __dma_direct_optimal_gfp_mask(struct device *dev, u64 >>>> dma_mask, >>>> + u64 *phys_mask) >>>> +{ >>>> + if (force_dma_unencrypted()) >>>> + *phys_mask = __dma_to_phys(dev, dma_mask); >>>> + else >>>> + *phys_mask = dma_to_phys(dev, dma_mask); >>> >>> Maybe make phys_to_dma_direct() take u64 instead of phys_addr_t so we can >>> reuse it here? >> >> This is a dma_to_phys and not a phys_to_dma. > > Ugh, clearly it's time to stop reviewing patches for today... sorry :( I actually made the same mistake when writing it.. ALthough I'd really like to see some feedback from you on the arm64 swiotlb series once you had more cofee ;-)