Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp649546pxf; Thu, 25 Mar 2021 10:46:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkwME6+p8uB0JwPFuGLRfypjCzzj6XxM9cdgM8l9ydrGGsHr+Yni5uY2BJr3usqT3DSy8c X-Received: by 2002:a17:906:4b0e:: with SMTP id y14mr10550155eju.393.1616694364631; Thu, 25 Mar 2021 10:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616694364; cv=none; d=google.com; s=arc-20160816; b=PcQUuCl91vhbTXNFwjObyN6VPvGJR5As3JgTLmbqh0zQoqZEks/Ve1k6lyHnRRs3dV 1nGovFNJmR+lwhk2Al04PVO7aNzISiMIH8GhdoBfqllkmJZZsgiXk/3ZQDqKm5Naqmcj OHCm1PmvFmH0viTM2iJw2FtEF5K2JqC9aU/UFX3dqW/MuUjo5GcAVh0M4VcI70Sd/v5p WpnfOE5D6RRS9qbqcAwW1zNWTJYtafCsIIbWnV/hSTvIZuW4crb+4BIsLtUB9G2VD3Xj +gV228I9wtJXhKRwhzTaqc6PDiVPBEwIY2WRgcRyRzBu1VuoyE7H7DMfTZa4Zaa2Uz2q OOsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3gCpsLZI+esPLtqzUPjddXNwNQSIy4z2upHFO1a+cvw=; b=W4wAXjF2o53oaIMtq1vaykMW5FxsvLWpJvczZj09ffQKpeaW8HuD1ql4AIqCdKSIiK DapHvpyyCxybOXCF9AMKrrOTjzl2MIc+2+Eo6hXarr2sA7J94WvW1Jcx+5PKDSwjTTrg cMWAkIDcL3ncg03vMeTGRRg0VBpmQ+q4NG8uAts1TfLxLbSTewW77PYz0GbHtczMSnXn wnGZE+GyFI6rmBO2BQkomzP51wo8wXNlM8as2KNoaqlbPAJ9/FkdYeyLSGD0yTtlZ5Z8 MSDe8NhOiUDj/w3WNgnGceMXboy6yRntTZe5YTUdWh4suqjoqsVcS40e3qBgFLlpVnTu z0sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si4819792ejj.20.2021.03.25.10.45.40; Thu, 25 Mar 2021 10:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230140AbhCYRmf (ORCPT + 99 others); Thu, 25 Mar 2021 13:42:35 -0400 Received: from foss.arm.com ([217.140.110.172]:55098 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229979AbhCYRmR (ORCPT ); Thu, 25 Mar 2021 13:42:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 20CB5143D; Thu, 25 Mar 2021 10:42:17 -0700 (PDT) Received: from [10.57.50.37] (unknown [10.57.50.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CED793F718; Thu, 25 Mar 2021 10:42:14 -0700 (PDT) Subject: Re: [PATCH 1/2] iommu/mediatek-v1: Alloc building as module To: Will Deacon , Yong Wu Cc: Joerg Roedel , Matthias Brugger , Tomasz Figa , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, Krzysztof Kozlowski , youlin.pei@mediatek.com, Nicolas Boichat , anan.sun@mediatek.com, chao.hao@mediatek.com References: <20210323055801.16885-1-yong.wu@mediatek.com> <20210325171614.GA15433@willie-the-truck> From: Robin Murphy Message-ID: <6fb1f2b1-3b85-ee91-a447-8aca8f4057d6@arm.com> Date: Thu, 25 Mar 2021 17:42:09 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210325171614.GA15433@willie-the-truck> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ^^Nit: presumably you meant "Allow" in the subject. On 2021-03-25 17:16, Will Deacon wrote: > On Tue, Mar 23, 2021 at 01:58:00PM +0800, Yong Wu wrote: >> This patch only adds support for building the IOMMU-v1 driver as module. >> Correspondingly switch the config to tristate. >> >> Signed-off-by: Yong Wu >> --- >> rebase on v5.12-rc2. >> --- >> drivers/iommu/Kconfig | 2 +- >> drivers/iommu/mtk_iommu_v1.c | 9 ++++----- >> 2 files changed, 5 insertions(+), 6 deletions(-) > > Both of these patches look fine to me, but you probably need to check > the setting of MODULE_OWNER after: > > https://lore.kernel.org/r/f4de29d8330981301c1935e667b507254a2691ae.1616157612.git.robin.murphy@arm.com Right, furthermore I would rather expect these patches on their own to hit the problem that my patch tries to avoid - where since mtk_iommu_ops is const, the current version of iommu_device_set_ops() is liable to blow up trying to write to rodata. In fact I do wonder a little why that wasn't happening already - maybe the compiler is clever enough to tell that the assignment is redundant when THIS_MODULE == 0, and elides it :/ Robin.