From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: amd_iommu fallback question Date: Fri, 6 Apr 2018 20:23:29 +0200 Message-ID: <20180406182329.GA15462@8bytes.org> References: <20180405193612.GA12474@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20180405193612.GA12474-jcswGhMUV9g@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: Christoph Hellwig Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: iommu@lists.linux-foundation.org Hi Christoph, On Thu, Apr 05, 2018 at 09:36:12PM +0200, Christoph Hellwig wrote: > I've got a little question on the amd_iommu code, hope you (or someone > else on the list) can answer it. Most of the dma_map_ops methods have > a fallback for the case when get_domain() return -EINVAL, which basically > duplicates the normal no-iommu implementation, with the map_sg method > being and exception that always returns and error (return value of 0 > is an error for its calling convention). Is that an oversight? If yes > so I wonder why it hasn't been caught yet. Or is the whole fallback > code dead and can be removed? Yeah, the fall-back code is basically dead since the amd driver uses per-device dma_ops. It was just an oversight that it is not removed yet. Joerg