Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp538117imu; Mon, 26 Nov 2018 14:38:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/XR9zhITFL4n6FnVAWswU/ds+xSVApHhO73+PRlo+A0RAAKcU4R8MMn+Ny0G4iIrujN6hRb X-Received: by 2002:a63:e4d:: with SMTP id 13mr24916833pgo.369.1543271903612; Mon, 26 Nov 2018 14:38:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543271903; cv=none; d=google.com; s=arc-20160816; b=i23jzlEGWbT5cwBtilyezrk3tUwTrTK3/5PHbGz4lMuwBfbZTcWcR6Mv6lw5d0XSd9 2NtGA32SwrGINZaWNgb1Gim/XEFLmUKTYjoxWOsUbVRIn3QmRC9aNsxI4Ekx2aAlRQQc 7pusDr6UzZTYB6D03pVBDZYEg/hK4Vcu0AJ0Ep4O2A/8mBaunCqlepGsXVQPaKjArSZE MR/ApPhZ/ZbbFofPk1dIobQdP4NBZoBH/Gd3KcgiE73W0801LCKnc0qizPYXhpA0Sr9N kB/qKHCvW1EMGO2a7Y1d4HBWyoz++GBWjtfWLhXQdY9xlrDfAmQAIt5D2QpHcCYXM7mv AqAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=x86V4v3jMutNqSp60Q7Rwi/ortJ/HllH/EjM/MGs3ZQ=; b=uS2RwN+ll/WSfz4WCqraQUYv9lv1ixSXPHB6jdcpsSjpVDxdfMZB4n4H5v1oa0t74r 9De6+lhN7uXce47Sp5kCPpynPSwDYHd2mwDIU6+O3IKD89p4F6IfcW1kRb1is7q73Tm/ 0wfmQ1SowUzdk6BShT4bnh009cqGhi8eroEl1eZ0v+AOVKx0/8lnJ4YyEhjp3bLR2KEU zH9j6hhWNSQ9/nrZlyHmopIEVqFDGG3sqnx7M8I0janYaQm+TBX1AI/Up3ML7krQg9Zu C7wV+47nZkYuVtbAacr3QsPqa0FlZ6Ih8jIE2FFRSwDjK1OVGPaexzy+6j9z18Ol12fD KEHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p66si1720515pfp.144.2018.11.26.14.38.08; Mon, 26 Nov 2018 14:38:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbeK0Jc5 (ORCPT + 99 others); Tue, 27 Nov 2018 04:32:57 -0500 Received: from mail5.windriver.com ([192.103.53.11]:59874 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbeK0Jc4 (ORCPT ); Tue, 27 Nov 2018 04:32:56 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id wAQMVvpu002166 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 26 Nov 2018 14:32:07 -0800 Received: from yow-cube1.wrs.com (128.224.56.98) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.408.0; Mon, 26 Nov 2018 14:31:46 -0800 From: Paul Gortmaker To: Joerg Roedel CC: , , Paul Gortmaker , Alexandre Courbot , Daniel Kurtz , Heiko Stuebner , Hiroshi Doyu , Honghui Zhang , Jeffy Chen , Laurent Pinchart , Matthias Brugger , Nate Watterson , Rob Clark , Robin Murphy , Simon Xue , Stepan Moskovchenko , Stephen Warren , Thierry Reding , Will Deacon , , , , , Subject: [PATCH 0/9] iommu: clean up/remove modular stuff from non-modules. Date: Mon, 26 Nov 2018 17:31:29 -0500 Message-ID: <1543271498-28966-1-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The work here represents a scan over the iommu dir, looking for files/drivers that have nothing to do with a modular use case, but are using modular infrastructure regardless. We are trying to make driver code consistent with the Makefiles/Kconfigs that control them. This means not using modular functions/macros for drivers that can never be built as a module. I've done this in other subsystem dirs already, and some of this has already happened in drivers/iommu by others; such as 98b72b94def9 ("iommu/rockchip: Prohibit unbind and remove"). Using modular infrastructure in non-modules might seem harmless, but some of the downfalls this leads to are: (1) it is easy to accidentally write unused module_exit and remove code (2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it (3) it requires the include of the module.h header file which in turn includes nearly everything else, thus adding to CPP overhead. (4) it gets copied/replicated into other drivers and spreads quickly. The last two commits (arm-smmu related ones) deserve an extra mention, and I put them at the end in case they want to be deferred for later or altered. Normally a "module-ectomy" allows us to delete the ".remove" function, as per the rockchip commit above, but ... A kexec commit (7aa8619a66ae) tried to improve reliability by trying to shutdown the iommu in the compromised/crashing kernel, but of course the better solution is to have the recovery kernel be able to handle all of the possible initial conditions. It appears this was done later in the commit b63b3439b856 - but I don't know if that means relying on an orderly shutdown is no longer required - I don't have the platform and am only going on what is in git history. So, as the kexec commit recycled the ".remove" handle to also be the ".shutdown" handle, in this series the remove function was renamed to shutdown, and the ".remove" handle was deleted. This was IMHO the most back compatible way to make this update. If the reliance on the compromised kernel to run ".shutdown" is no longer necessary, then it can be removed in a future change. Patches were build tested on top of next-20181122 for ARM, ARM64, x86-64 on an allyesconfig. Paul. --- Cc: Alexandre Courbot Cc: Daniel Kurtz Cc: Heiko Stuebner Cc: Hiroshi Doyu Cc: Honghui Zhang Cc: Jeffy Chen Cc: Joerg Roedel Cc: Laurent Pinchart Cc: Matthias Brugger Cc: Nate Watterson Cc: Rob Clark Cc: Robin Murphy Cc: Simon Xue Cc: Stepan Moskovchenko Cc: Stephen Warren Cc: Thierry Reding Cc: Will Deacon Cc: iommu@lists.linux-foundation.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-arm-msm@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-tegra@vger.kernel.org Paul Gortmaker (9): iommu: audit and remove any unnecessary uses of module.h iommu: rockchip: make it explicitly non-modular iommu: msm_iommu: make it explicitly non-modular iommu: mtk_iommu: make it explicitly non-modular iommu: ipmmu-vmsa: make it explicitly non-modular iommu: qcom_iommu: make it explicitly non-modular iommu: tegra-gart: make it explicitly non-modular iommu: arm-smmu: make it explicitly non-modular iommu: arm-smmu-v3: make it explicitly non-modular drivers/iommu/arm-smmu-v3.c | 25 +++++++++---------------- drivers/iommu/arm-smmu.c | 32 +++++++++++++------------------- drivers/iommu/iommu-sysfs.c | 2 +- drivers/iommu/iommu.c | 3 ++- drivers/iommu/ipmmu-vmsa.c | 16 +++------------- drivers/iommu/msm_iommu.c | 13 +++---------- drivers/iommu/mtk_iommu_v1.c | 15 +++------------ drivers/iommu/qcom_iommu.c | 16 ++-------------- drivers/iommu/rockchip-iommu.c | 13 ++++++------- drivers/iommu/tegra-gart.c | 37 +++++++------------------------------ 10 files changed, 49 insertions(+), 123 deletions(-) -- 2.7.4