Re: [PATCH v2] rust: helpers: Remove volatile qualifier from io helpers
From: Arnd Bergmann
Date: Tue Apr 15 2025 - 12:54:16 EST
On Tue, Apr 15, 2025, at 18:28, Miguel Ojeda wrote:
> On Sat, Apr 12, 2025 at 2:54 AM FUJITA Tomonori <fujita.tomonori@xxxxxxxxx> wrote:
>>
>> /home/fujita/git/linux-rust/arch/um/include/asm/io.h:19:42: note: passing argument to parameter 'addr' here
>> 19 | static inline void iounmap(void __iomem *addr)
>> | ^
>> 1 error generated.
>>
>> Fixes: ce30d94e6855 ("rust: add `io::{Io, IoRaw}` base types")
>> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
>
> I don't particularly like having different signatures than the other
> side (since we could e.g. eventually have a check that they match
> etc.), but given v1 it seems they could also be eventually gone from
> the C side anyway.
Rihgt, I tried this last week when it came up first, removing the
'volatile' annotations in the asm-generic/io.h header and then
all the ones that caused build regressions on arm/arm64/x86
randconfig and allmodconfig builds. This patch is a little
longer than my original version as I did run into a few
regressions later.
As far as I can tell, none of these volatile annotations have
any actual effect, and most of them date back to ancient kernels
where this may have been required.
Leaving it out of the rust interface is clearly the right way,
and it shouldn't be too hard to upstream the changes below
when we need to, but I also don't see any priority to send these.
If anyone wants to help out, I can send them the whole patch.
Arnd
arch/sh/include/cpu-sh4/cpu/sh7786.h | 2 +-
arch/x86/include/asm/io.h | 14 +-
arch/x86/include/asm/uv/uv_hub.h | 2 +-
arch/x86/lib/iomem.c | 18 +-
arch/x86/mm/ioremap.c | 5 +-
drivers/accel/qaic/qaic_timesync.c | 4 +-
drivers/atm/fore200e.c | 12 +-
drivers/atm/fore200e.h | 10 +-
drivers/char/agp/amd-k7-agp.c | 4 +-
drivers/char/agp/ati-agp.c | 6 +-
drivers/char/agp/nvidia-agp.c | 5 +-
drivers/char/agp/sworks-agp.c | 4 +-
drivers/media/pci/bt8xx/bt878.c | 2 +-
drivers/media/pci/bt8xx/bt878.h | 2 +-
drivers/media/pci/ivtv/ivtv-driver.h | 8 +-
drivers/media/pci/ivtv/ivtv-firmware.c | 10 +-
drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +-
drivers/media/pci/ivtv/ivtv-mailbox.c | 6 +-
drivers/media/pci/ivtv/ivtvfb.c | 2 +-
drivers/mtd/devices/spear_smi.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 5 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 4 +-
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h | 4 +-
drivers/net/ethernet/via/via-velocity.h | 184 ++++++------
drivers/net/wireless/ath/wil6210/fw.c | 4 +-
drivers/net/wireless/ath/wil6210/main.c | 8 +-
drivers/net/wireless/ath/wil6210/wil6210.h | 6 +-
drivers/scsi/aacraid/aacraid.h | 5 +-
drivers/scsi/aacraid/rx.c | 2 +-
drivers/scsi/aic7xxx/aic79xx_osm.h | 2 +-
drivers/scsi/aic7xxx/aic7xxx_osm.h | 2 +-
drivers/scsi/megaraid/megaraid_sas.h | 2 +-
drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
drivers/scsi/mpi3mr/mpi3mr.h | 2 +-
drivers/scsi/mpi3mr/mpi3mr_fw.c | 4 +-
drivers/scsi/mpt3sas/mpt3sas_base.c | 7 +-
drivers/scsi/nsp32_io.h | 52 ++--
drivers/scsi/qla1280.c | 4 +-
drivers/scsi/qla2xxx/qla_def.h | 18 +-
drivers/scsi/qla2xxx/qla_inline.h | 2 +-
drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
drivers/spi/spi-s3c64xx.c | 4 +-
drivers/staging/sm750fb/sm750.h | 6 +-
drivers/video/fbdev/imsttfb.c | 4 +-
drivers/video/fbdev/kyro/STG4000InitDevice.c | 4 +-
drivers/video/fbdev/kyro/STG4000Interface.h | 26 +-
drivers/video/fbdev/kyro/STG4000OverlayDevice.c | 10 +-
drivers/video/fbdev/kyro/STG4000Ramdac.c | 6 +-
drivers/video/fbdev/kyro/STG4000Reg.h | 376 ++++++++++++------------
drivers/video/fbdev/kyro/STG4000VTG.c | 8 +-
drivers/video/fbdev/nvidia/nv_type.h | 38 +--
drivers/video/fbdev/nvidia/nvidia.c | 9 +-
drivers/video/fbdev/riva/fbdev.c | 2 +-
drivers/video/fbdev/riva/nv_driver.c | 26 +-
drivers/video/fbdev/riva/riva_hw.h | 60 ++--
drivers/video/fbdev/savage/savagefb.h | 4 +-
drivers/video/fbdev/vga16fb.c | 2 +-
include/asm-generic/io.h | 136 ++++-----
include/asm-generic/video.h | 22 +-
include/linux/io-64-nonatomic-hi-lo.h | 12 +-
include/linux/io-64-nonatomic-lo-hi.h | 12 +-
include/linux/io.h | 2 +-
include/video/neomagic.h | 2 +-
lib/check_signature.c | 2 +-
lib/iomem_copy.c | 6 +-
lib/trace_readwrite.c | 8 +-
mm/ioremap.c | 4 +-
tools/testing/nvdimm/test/iomap.c | 2 +-
tools/testing/nvdimm/test/nfit_test.h | 2 +-
69 files changed, 613 insertions(+), 623 deletions(-)