Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932962AbbFJDKE (ORCPT ); Tue, 9 Jun 2015 23:10:04 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:34107 "EHLO e23smtp02.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932694AbbFJDJ7 (ORCPT ); Tue, 9 Jun 2015 23:09:59 -0400 From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , Benjamin Herrenschmidt , Michael Ellerman , linux-kernel@vger.kernel.org Subject: [PATCH kernel] powerpc/powernv: Fix crash when CONFIG_IOMMU_API is off Date: Wed, 10 Jun 2015 13:08:54 +1000 Message-Id: <1433905734-988-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.4.0.rc3.8.gfb3e7d5 In-Reply-To: <1433852588.18194.1.camel@ellerman.id.au> References: <1433852588.18194.1.camel@ellerman.id.au> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061003-0005-0000-0000-000001EEEBD8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1224 Lines: 37 The code introduced in "[PATCH kernel v12 17/34] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group" checks that an IOMMU group was registered for the specific table group which is not true when CONFIG_IOMMU_API is off as iommu_register_group() is a stub in this case. This makes BUG_ON conditional. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 4b4c583..a57554a 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -624,8 +624,9 @@ long pnv_pci_link_table_and_group(int node, int num, BUG_ON(!tbl); BUG_ON(!table_group); +#ifdef CONFIG_IOMMU_API BUG_ON(!table_group->group); - +#endif tgl = kzalloc_node(sizeof(struct iommu_table_group_link), GFP_KERNEL, node); if (!tgl) -- 2.4.0.rc3.8.gfb3e7d5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/