From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH v1 1/6] iommu/dmar: Fix crash on boot when DMAR is disabled Date: Wed, 22 Feb 2017 17:51:47 +0200 Message-ID: <1487778707.20145.20.camel@linux.intel.com> References: <20170215144226.34519-1-andriy.shevchenko@linux.intel.com> <20170222112617.GD4154@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170222112617.GD4154-l3A5Bk7waGM@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: Joerg Roedel Cc: Mika Westerberg , "Rafael J . Wysocki" , David Woodhouse , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: iommu@lists.linux-foundation.org On Wed, 2017-02-22 at 12:26 +0100, Joerg Roedel wrote: > Hi Andy, > > On Wed, Feb 15, 2017 at 04:42:21PM +0200, Andy Shevchenko wrote: > > By default CONFIG_INTEL_IOMMU_DEFAULT_ON is not set and thus > > dmar_disabled variable is set. > > > > Intel IOMMU driver based on above doesn't set intel_iommu_enabled > > variable. > > > > The commit b0119e870837 ("iommu: Introduce new 'struct > > iommu_device'") > > mistakenly assumes it never happens and tries to unregister not ever > > registered resources, which crashes the kernel at boot time: > > > > BUG: unable to handle kernel NULL pointer dereference at > > 0000000000000008 > > IP: iommu_device_unregister+0x31/0x60 > > > > Make unregister procedure conditional in free_iommu(). > > > > Fixes: b0119e870837 ("iommu: Introduce new 'struct iommu_device'") > > Cc: Joerg Roedel > > Signed-off-by: Andy Shevchenko > > Thanks for the patch, I applied it and will send it upstream asap. Thanks! Any comments on the rest? I would like to send v2. -- Andy Shevchenko Intel Finland Oy