From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH v4 1/1] iommu-api: Add map_sg/unmap_sg functions Date: Wed, 6 Aug 2014 22:17:40 +0200 Message-ID: <20140806201740.GW9809@8bytes.org> References: <1406854484-3848-1-git-send-email-ohaugan@codeaurora.org> <1406854484-3848-2-git-send-email-ohaugan@codeaurora.org> <20140805151323.GB19709@laptop.dumpdata.com> <53E26127.1040805@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <53E26127.1040805-sgV2jX0FEOL9JmXXK+q4OQ@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: Olav Haugan Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, will.deacon-5wv7dgnIgG8@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-arm-msm@vger.kernel.org On Wed, Aug 06, 2014 at 10:08:55AM -0700, Olav Haugan wrote: > so you are suggesting that I check in "bus_set_iommu()" whether the > driver has set the map_sg/unmap_sg function pointers or not and if not > set it to the default? Is bus_set_iommu() the only way drivers can set > up the callbacks? This doesn't work as the iommu_ops are now const. You have to either update the iommu drivers individually to point to the default function, or you do the check in the API function itself and fall back to the default it no call-back is provided. Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 From: joro@8bytes.org (Joerg Roedel) Date: Wed, 6 Aug 2014 22:17:40 +0200 Subject: [PATCH v4 1/1] iommu-api: Add map_sg/unmap_sg functions In-Reply-To: <53E26127.1040805@codeaurora.org> References: <1406854484-3848-1-git-send-email-ohaugan@codeaurora.org> <1406854484-3848-2-git-send-email-ohaugan@codeaurora.org> <20140805151323.GB19709@laptop.dumpdata.com> <53E26127.1040805@codeaurora.org> Message-ID: <20140806201740.GW9809@8bytes.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Aug 06, 2014 at 10:08:55AM -0700, Olav Haugan wrote: > so you are suggesting that I check in "bus_set_iommu()" whether the > driver has set the map_sg/unmap_sg function pointers or not and if not > set it to the default? Is bus_set_iommu() the only way drivers can set > up the callbacks? This doesn't work as the iommu_ops are now const. You have to either update the iommu drivers individually to point to the default function, or you do the check in the API function itself and fall back to the default it no call-back is provided. Joerg