From patchwork Tue May 26 12:59:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1298008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49WYyn6BfVz9sTR; Tue, 26 May 2020 23:02:25 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jdZDo-0005FY-9z; Tue, 26 May 2020 13:02:20 +0000 Received: from mail-pl1-f193.google.com ([209.85.214.193]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jdZDH-0004oo-D5 for kernel-team@lists.ubuntu.com; Tue, 26 May 2020 13:01:47 +0000 Received: by mail-pl1-f193.google.com with SMTP id d3so8670530pln.1 for ; Tue, 26 May 2020 06:01:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3FyRIkm6lbGGBWH/C9CS0xjY1cn5f05y3Qa6lIpBKqg=; b=BmLWq4Eogp5+DOpybweGz81mKFJY/1aG4+O5dktGgWkgiVqNebT4MXhhDEIMtWnNHC minGNy4UbzvxPWFnyj3kDgCjOjwf3R8RLE2ZR1lfFNxrmepyOMAIt6Rb5uCRc/n0XiJC 018YTSFzMtdbyKGPwHsomCl7efyTHQD+bE/DcV0YHz4DtkyKLrxMGbfNgn79l6a0qJ/N iQEFpsJm2C9rAjLeNWtopowFc4A2M5BwJW63xKq6bOVjbYUsItAew6BE1qbHvrz7hQkO qnmKhXMtGPMrZ0VJEO1V32505S+PgnE4eLmKtL5bWSYXAdamgX6Ej763EV6TMUODPqlN YmpQ== X-Gm-Message-State: AOAM5312NaMo5zv+zH+vxQVJSsPNkLen822QiFYWCm9upGfJCvXyriVd XQUFDaU36AYDWAY2MRGB/bhSMHwuyoA= X-Google-Smtp-Source: ABdhPJz9do5/YHZyFEa+jTjgTA9WMIVNggclOjRZlDtbh0fVSXb+oAutZ9LlQH53GmzFaX3V/qS5Jw== X-Received: by 2002:a17:90a:ce17:: with SMTP id f23mr27472792pju.51.1590498104319; Tue, 26 May 2020 06:01:44 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id v5sm15713647pjy.4.2020.05.26.06.01.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 06:01:43 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 37/42][SRU][U] UBUNTU: SAUCE: iommu/omap: Add check for iommu group when no IOMMU in use Date: Tue, 26 May 2020 20:59:49 +0800 Message-Id: <20200526125954.237403-38-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200526125954.237403-1-vicamo.yang@canonical.com> References: <20200526125954.237403-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Tero Kristo via iommu BugLink: https://bugs.launchpad.net/bugs/1876707 Most of the devices in OMAP family of SoCs are not using IOMMU. The patch for converting the OMAP IOMMU to use generic IOMMU bus probe functionality failed to add a check for this, so add it here. Fixes: c822b37cac48 ("iommu/omap: Remove orphan_dev tracking") Reported-by: Tomi Valkeinen Signed-off-by: Tero Kristo Link: https://lore.kernel.org/r/20200518111057.23140-1-t-kristo@ti.com Signed-off-by: Joerg Roedel (cherry picked from commit 46b14fc61bfa409efe95a7752a5dba361d753c66 iommu/next) Signed-off-by: You-Sheng Yang --- drivers/iommu/omap-iommu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 6699fe6d9e06..5a9ba815863b 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1726,6 +1726,9 @@ static struct iommu_group *omap_iommu_device_group(struct device *dev) struct omap_iommu_arch_data *arch_data = dev->archdata.iommu; struct iommu_group *group = ERR_PTR(-EINVAL); + if (!arch_data) + return ERR_PTR(-ENODEV); + if (arch_data->iommu_dev) group = iommu_group_ref_get(arch_data->iommu_dev->group);