* [PATCH] powerpc: iommu: fix build when neither PCI or IBMVIO is set
@ 2021-03-02 8:28 Randy Dunlap
2021-03-02 11:08 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2021-03-02 8:28 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, linuxppc-dev, kernel test robot, Anton Blanchard
When neither CONFIG_PCI nor CONFIG_IBMVIO is enabled:
../arch/powerpc/kernel/iommu.c:178:30: error: 'fail_iommu_bus_notifier' defined but not used [-Werror=unused-variable]
178 | static struct notifier_block fail_iommu_bus_notifier = {
If only that struct is bounded by 2 #if defined() phrases (PCI && IBMVIO):
../arch/powerpc/kernel/iommu.c:162:12: error: 'fail_iommu_bus_notify' defined but not used [-Werror=unused-function]
162 | static int fail_iommu_bus_notify(struct notifier_block *nb,
If that function is also guarded by 2 #if defined() phrases:
In file included from ../include/linux/dma-mapping.h:7,
from ../arch/powerpc/kernel/iommu.c:19:
../include/linux/device.h:131:26: error: 'dev_attr_fail_iommu' defined but not used [-Werror=unused-variable]
131 | struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
../arch/powerpc/kernel/iommu.c:160:8: note: in expansion of macro 'DEVICE_ATTR_RW'
160 | static DEVICE_ATTR_RW(fail_iommu);
and the snowball continues to grow.
Next I got this one:
../arch/powerpc/kernel/iommu.c: In function 'iommu_range_alloc':
../arch/powerpc/kernel/iommu.c:234:6: error: implicit declaration of function 'should_fail_iommu'; did you mean 'should_failslab'? [-Werror=implicit-function-declaration]
234 | if (should_fail_iommu(dev))
and
../arch/powerpc/kernel/iommu.c: In function 'should_fail_iommu':
../arch/powerpc/kernel/iommu.c:122:50: error: 'fail_iommu' undeclared (first use in this function)
122 | return dev->archdata.fail_iommu && should_fail(&fail_iommu, 1);
So combine CONFIG_FAIL_IOMMU && (CONFIG_PCI || CONFIG_IBMVIO)
to decide on building some of this code/data.
This came from a .config file from the kernel test robot, but it was
not for this particular build problem.
Fixes: d6b9a81b2a45 ("powerpc: IOMMU fault injection")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Anton Blanchard <anton@samba.org>
---
Found/seen in v5.12-rc1.
arch/powerpc/kernel/iommu.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--- lnx-512-rc1.orig/arch/powerpc/kernel/iommu.c
+++ lnx-512-rc1/arch/powerpc/kernel/iommu.c
@@ -115,7 +115,13 @@ static int __init setup_iommu_pool_hash(
}
subsys_initcall(setup_iommu_pool_hash);
-#ifdef CONFIG_FAIL_IOMMU
+#if defined(CONFIG_FAIL_IOMMU) && \
+ (defined(CONFIG_PCI) || defined(CONFIG_IBMVIO))
+
+static bool should_fail_iommu(struct device *dev)
+{
+ return dev->archdata.fail_iommu && should_fail(&fail_iommu, 1);
+}
static DECLARE_FAULT_ATTR(fail_iommu);
@@ -125,11 +131,6 @@ static int __init setup_fail_iommu(char
}
__setup("fail_iommu=", setup_fail_iommu);
-static bool should_fail_iommu(struct device *dev)
-{
- return dev->archdata.fail_iommu && should_fail(&fail_iommu, 1);
-}
-
static int __init fail_iommu_debugfs(void)
{
struct dentry *dir = fault_create_debugfs_attr("fail_iommu",
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] powerpc: iommu: fix build when neither PCI or IBMVIO is set
2021-03-02 8:28 [PATCH] powerpc: iommu: fix build when neither PCI or IBMVIO is set Randy Dunlap
@ 2021-03-02 11:08 ` Michael Ellerman
2021-03-06 19:44 ` Randy Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2021-03-02 11:08 UTC (permalink / raw)
To: Randy Dunlap, linux-kernel
Cc: Randy Dunlap, linuxppc-dev, kernel test robot, Anton Blanchard
Randy Dunlap <rdunlap@infradead.org> writes:
> When neither CONFIG_PCI nor CONFIG_IBMVIO is enabled:
>
> ../arch/powerpc/kernel/iommu.c:178:30: error: 'fail_iommu_bus_notifier' defined but not used [-Werror=unused-variable]
> 178 | static struct notifier_block fail_iommu_bus_notifier = {
>
> If only that struct is bounded by 2 #if defined() phrases (PCI && IBMVIO):
>
> ../arch/powerpc/kernel/iommu.c:162:12: error: 'fail_iommu_bus_notify' defined but not used [-Werror=unused-function]
> 162 | static int fail_iommu_bus_notify(struct notifier_block *nb,
>
> If that function is also guarded by 2 #if defined() phrases:
>
> In file included from ../include/linux/dma-mapping.h:7,
> from ../arch/powerpc/kernel/iommu.c:19:
> ../include/linux/device.h:131:26: error: 'dev_attr_fail_iommu' defined but not used [-Werror=unused-variable]
> 131 | struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
> ../arch/powerpc/kernel/iommu.c:160:8: note: in expansion of macro 'DEVICE_ATTR_RW'
> 160 | static DEVICE_ATTR_RW(fail_iommu);
>
> and the snowball continues to grow.
> Next I got this one:
>
> ../arch/powerpc/kernel/iommu.c: In function 'iommu_range_alloc':
> ../arch/powerpc/kernel/iommu.c:234:6: error: implicit declaration of function 'should_fail_iommu'; did you mean 'should_failslab'? [-Werror=implicit-function-declaration]
> 234 | if (should_fail_iommu(dev))
>
> and
>
> ../arch/powerpc/kernel/iommu.c: In function 'should_fail_iommu':
> ../arch/powerpc/kernel/iommu.c:122:50: error: 'fail_iommu' undeclared (first use in this function)
> 122 | return dev->archdata.fail_iommu && should_fail(&fail_iommu, 1);
>
> So combine CONFIG_FAIL_IOMMU && (CONFIG_PCI || CONFIG_IBMVIO)
> to decide on building some of this code/data.
Couldn't we just make FAIL_IOMMU depend on PCI || IBMVIO?
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] powerpc: iommu: fix build when neither PCI or IBMVIO is set
2021-03-02 11:08 ` Michael Ellerman
@ 2021-03-06 19:44 ` Randy Dunlap
0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2021-03-06 19:44 UTC (permalink / raw)
To: Michael Ellerman, linux-kernel
Cc: linuxppc-dev, kernel test robot, Anton Blanchard
On March 2, 2021 3:08:43 AM PST, Michael Ellerman <mpe@ellerman.id.au> wrote:
>Randy Dunlap <rdunlap@infradead.org> writes:
>> When neither CONFIG_PCI nor CONFIG_IBMVIO is enabled:
>>
>> ../arch/powerpc/kernel/iommu.c:178:30: error:
>'fail_iommu_bus_notifier' defined but not used
>[-Werror=unused-variable]
>> 178 | static struct notifier_block fail_iommu_bus_notifier = {
>>
>> If only that struct is bounded by 2 #if defined() phrases (PCI &&
>IBMVIO):
>>
>> ../arch/powerpc/kernel/iommu.c:162:12: error: 'fail_iommu_bus_notify'
>defined but not used [-Werror=unused-function]
>> 162 | static int fail_iommu_bus_notify(struct notifier_block *nb,
>>
>> If that function is also guarded by 2 #if defined() phrases:
>>
>> In file included from ../include/linux/dma-mapping.h:7,
>> from ../arch/powerpc/kernel/iommu.c:19:
>> ../include/linux/device.h:131:26: error: 'dev_attr_fail_iommu'
>defined but not used [-Werror=unused-variable]
>> 131 | struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
>> ../arch/powerpc/kernel/iommu.c:160:8: note: in expansion of macro
>'DEVICE_ATTR_RW'
>> 160 | static DEVICE_ATTR_RW(fail_iommu);
>>
>> and the snowball continues to grow.
>> Next I got this one:
>>
>> ../arch/powerpc/kernel/iommu.c: In function 'iommu_range_alloc':
>> ../arch/powerpc/kernel/iommu.c:234:6: error: implicit declaration of
>function 'should_fail_iommu'; did you mean 'should_failslab'?
>[-Werror=implicit-function-declaration]
>> 234 | if (should_fail_iommu(dev))
>>
>> and
>>
>> ../arch/powerpc/kernel/iommu.c: In function 'should_fail_iommu':
>> ../arch/powerpc/kernel/iommu.c:122:50: error: 'fail_iommu' undeclared
>(first use in this function)
>> 122 | return dev->archdata.fail_iommu && should_fail(&fail_iommu,
>1);
>>
>> So combine CONFIG_FAIL_IOMMU && (CONFIG_PCI || CONFIG_IBMVIO)
>> to decide on building some of this code/data.
>
>Couldn't we just make FAIL_IOMMU depend on PCI || IBMVIO?
>
>cheers
Yes, I thought of that about 5 seconds after hitting Send. But I can't do it just now -- am away from computer.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-06 20:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-02 8:28 [PATCH] powerpc: iommu: fix build when neither PCI or IBMVIO is set Randy Dunlap
2021-03-02 11:08 ` Michael Ellerman
2021-03-06 19:44 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).