From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH v9 03/16] iommu/exynos: fix page table maintenance Date: Wed, 14 Aug 2013 12:49:38 +0200 Message-ID: <20130814104938.GF4491@8bytes.org> References: <002701ce941a$eecebdb0$cc6c3910$@samsung.com> <1516548.d7oQuzQS7g@amdc1227> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: 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: Grant Grundler Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux Samsung SOC , Prathyush , Sachin Kamat , Tomasz Figa , Subash Patel , Linux Kernel , Linux IOMMU , Kukjin Kim , Antonios Motakis , Cho KyongHo , kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org, Linux ARM Kernel , Rahul Sharma List-Id: iommu@lists.linux-foundation.org On Thu, Aug 08, 2013 at 11:28:44AM -0700, Grant Grundler wrote: > I can't speak to the previous BUG_ON(). I believe the EADDRESSINUSE > failures could be either WARN_ON or BUG_ON. This condition is > clearly a bug in the generic IOMMU allocator and I think that's why > KyongHo Cho used BUG_ON. > > Handing out duplicate addresses will generally lead to some sort of > data corruption or other fault depending on how robust the underlying > device drivers are written. So my preference is a BUG_ON to > immediately flag this condition instead of hoping a device driver will > correctly handling the dma mapping failure (Some do, most currently > don't). > > WARN_ON() + return -EADDRESSINUSE would be a good alternative. Even if it is a real BUG condition, I don't think it is worth to stop execution at this point. It makes debugging harder and the system less reliable. I prefer to go with the WARN_ON and an error return value. Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 From: joro@8bytes.org (Joerg Roedel) Date: Wed, 14 Aug 2013 12:49:38 +0200 Subject: [PATCH v9 03/16] iommu/exynos: fix page table maintenance In-Reply-To: References: <002701ce941a$eecebdb0$cc6c3910$@samsung.com> <1516548.d7oQuzQS7g@amdc1227> Message-ID: <20130814104938.GF4491@8bytes.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Aug 08, 2013 at 11:28:44AM -0700, Grant Grundler wrote: > I can't speak to the previous BUG_ON(). I believe the EADDRESSINUSE > failures could be either WARN_ON or BUG_ON. This condition is > clearly a bug in the generic IOMMU allocator and I think that's why > KyongHo Cho used BUG_ON. > > Handing out duplicate addresses will generally lead to some sort of > data corruption or other fault depending on how robust the underlying > device drivers are written. So my preference is a BUG_ON to > immediately flag this condition instead of hoping a device driver will > correctly handling the dma mapping failure (Some do, most currently > don't). > > WARN_ON() + return -EADDRESSINUSE would be a good alternative. Even if it is a real BUG condition, I don't think it is worth to stop execution at this point. It makes debugging harder and the system less reliable. I prefer to go with the WARN_ON and an error return value. Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932618Ab3HNKts (ORCPT ); Wed, 14 Aug 2013 06:49:48 -0400 Received: from 8bytes.org ([85.214.48.195]:50324 "EHLO mail.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932467Ab3HNKto (ORCPT ); Wed, 14 Aug 2013 06:49:44 -0400 Date: Wed, 14 Aug 2013 12:49:38 +0200 From: Joerg Roedel To: Grant Grundler Cc: Tomasz Figa , Cho KyongHo , Linux ARM Kernel , Linux IOMMU , Linux Kernel , Linux Samsung SOC , devicetree@vger.kernel.org, Kukjin Kim , Prathyush , Rahul Sharma , Subash Patel , Antonios Motakis , kvmarm@lists.cs.columbia.edu, Sachin Kamat Subject: Re: [PATCH v9 03/16] iommu/exynos: fix page table maintenance Message-ID: <20130814104938.GF4491@8bytes.org> References: <002701ce941a$eecebdb0$cc6c3910$@samsung.com> <1516548.d7oQuzQS7g@amdc1227> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Wed Aug 14 12:49:42 2013 X-DSPAM-Confidence: 0.9992 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 520b60c620861088910861 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 08, 2013 at 11:28:44AM -0700, Grant Grundler wrote: > I can't speak to the previous BUG_ON(). I believe the EADDRESSINUSE > failures could be either WARN_ON or BUG_ON. This condition is > clearly a bug in the generic IOMMU allocator and I think that's why > KyongHo Cho used BUG_ON. > > Handing out duplicate addresses will generally lead to some sort of > data corruption or other fault depending on how robust the underlying > device drivers are written. So my preference is a BUG_ON to > immediately flag this condition instead of hoping a device driver will > correctly handling the dma mapping failure (Some do, most currently > don't). > > WARN_ON() + return -EADDRESSINUSE would be a good alternative. Even if it is a real BUG condition, I don't think it is worth to stop execution at this point. It makes debugging harder and the system less reliable. I prefer to go with the WARN_ON and an error return value. Joerg