From patchwork Thu Nov 3 19:51:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13030936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73C0BC433FE for ; Thu, 3 Nov 2022 19:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sJkmxnF65fdyiCtORghxSAhhhKWNHS0/VXwB9YlbXW4=; b=zq9G9RmoAF3xPq 6j2Z766Zw9BEpzIl4KUk8UbGOgDXV1TmOTKnYBQZjiSi/JgmM8uNrcjDnRoDb2QAe8Tb8U/6Q8aQA 5U8Jp9FxOK7bC+lSB4pkNkJjQgGO/awUog54f9vjyoAmgcYQVVpaGCGJTdJZJNo64aG4qp0SYiikk mnhSm9iclAdXYi4e4NYVqP7zLYX96XxRJY49DZVSjQgDUGdQnazmAminUgxA1cqGv5XhcJXqC9rDi EmFoFafc6BQBc86gwSvMQj6SxVH5HQjQtP87abDHiE9zWbaxldPlYZJb2x14twummv9tXmIR+rcKg nMsWTDZ0f8iVdnutX3IQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqgFv-001Ssm-Ah; Thu, 03 Nov 2022 19:52:06 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqgFr-001SpQ-Q2 for linux-arm-kernel@lists.infradead.org; Thu, 03 Nov 2022 19:52:01 +0000 Received: by mail-ej1-x62a.google.com with SMTP id n12so8102119eja.11 for ; Thu, 03 Nov 2022 12:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dSoY1RFfLiYGbG6PVIWaPMns1WQq6G1mUH0o4v3ezJs=; b=jXb0goUM1eMoI1vo0YE498npOwxh/JsIH3dtk03GixxejFSVByMt5Dl6Oj9UpEy2W9 Pf8lK5SE9nKJLqX7fqqHjAKN4x8cTWoBC/ZO7NmVESWXWlgiku667ugCRTUlki6fNW62 4aJsr84+PNy515JKoqpLImWu/5xN8FtmAHgQKjqLtggAsm39S7frbEXGlFG59qD144CR 7+lrhEeKGAsBbKo5uOUH426MhT6SnUzT2vBvRxhCUrKOJtrcUrJovRbrtKy0VNuT5kOS Jfw13SRy0c7DWpiQN9LurfnyRJQXmhFBacMlSISHuC7N78xKzzX9rDrxxcNd6dhhmr1g DxIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dSoY1RFfLiYGbG6PVIWaPMns1WQq6G1mUH0o4v3ezJs=; b=fLVSb8niITa19mLdzcg2MG4kcOyNsd9G6zvz2X7KKAnJBjlcF4zKED5SE+dWEoLWCd B88UPov6OwIxfj5zzvmGNtl1BP4/4/naTst1zMgo5bwF0nPCOFnl9lsEfqhUm920W+Yr DIDPsyb2WjQTJYtqwrQlmrBKnd22VWgYawGaju1RbB+OC891k7cd948PwtEw5ifZSat7 UDXOgTU3+D49kcVuimtWVpLb6G2XQZa3OGDrR71f1uA9Y6NpfvKZ7O74FXH0PwiPiUYN 6cmUDzOGjErexejDEhbjBhvDHPgaC1+wNTIkBV4zO2AyvLZVGSR4muMswVm3WAAnu9xw 6JoA== X-Gm-Message-State: ACrzQf27mFyQmtV+t4UKbve2IfYtoajC7hbzShWnK6x+JHSvh6Yrp1r2 LHPnoMsS0v1obfr8drzCgGdLsA== X-Google-Smtp-Source: AMsMyM7oHxP/WKbsDall/gZqsAjIooBN50fjNtXMSu/4PKkO5F+CS5IHBjfjNr2w+TaIs3Ggwoj52g== X-Received: by 2002:a17:906:730d:b0:78e:9ca5:3269 with SMTP id di13-20020a170906730d00b0078e9ca53269mr31172648ejc.366.1667505115999; Thu, 03 Nov 2022 12:51:55 -0700 (PDT) Received: from localhost (cgw.msart-bajzova4.ke.cust.o2bs.sk. [90.176.4.227]) by smtp.gmail.com with ESMTPSA id j14-20020a1709062a0e00b007415f8ffcbbsm870386eje.98.2022.11.03.12.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 12:51:55 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Sumit Semwal , Alim Akhtar , Janghyuck Kim , Cho KyongHo , Daniel Mentz , David Virag , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 0/6] iommu/exynos: Convert to a module Date: Thu, 3 Nov 2022 20:51:48 +0100 Message-Id: <20221103195154.21495-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_125159_900291_609DB3B6 X-CRM114-Status: GOOD ( 15.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As exynos-iommu driver is not a critical platform driver, it can be converted to a loadable module to avoid loading it on non-Exynos platforms in order to improve the RAM footprint. This patch series converts it to a module and does some related cleanups. IOMMU/DMA specifics were taken into the account, so remove/exit methods weren't added. There are two drivers using CONFIG_EXYNOS_IOMMU in their code: DRM_EXYNOS and S5P_MFC. Both were checked, and only a slight change was needed for S5P_MFC driver (patch #6). Changes in v2: - Extracted the "shutdown" method addition into a separate patch - Added MODULE_DEVICE_TABLE(of, ...) to support hot-plug loading - Added MODULE_ALIAS("platform:exynos-sysmmu") - Added fix for S5P_MFC driver to work correctly with EXYNOS_IOMMU=m - Fixed checkpatch coding style suggestion with "--strict" flag - Rebased on top of most recent joro/iommu.git:next Sam Protsenko (6): iommu: Export iommu_group_default_domain() API iommu/exynos: Fix retval on getting clocks in probe iommu/exynos: Modularize the driver iommu/exynos: Implement shutdown driver method iommu/exynos: Rearrange the platform driver code media: platform: Use IS_ENABLED() to check EXYNOS_IOMMU in s5p_mfc drivers/iommu/Kconfig | 2 +- drivers/iommu/exynos-iommu.c | 355 +++++++++--------- drivers/iommu/iommu.c | 1 + .../platform/samsung/s5p-mfc/s5p_mfc_iommu.h | 4 +- 4 files changed, 191 insertions(+), 171 deletions(-)