The patch titled SCSI/megaraid: fix MMIO casts has been added to the -mm tree. Its filename is scsi-megaraid-fix-mmio-casts.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: SCSI/megaraid: fix MMIO casts From: Jeff Garzik <jeff@xxxxxxxxxx> megaraid's MMIO RD*/WR* macros directly call readl() and writel() with an 'unsigned long' argument. This throws a warning, but is otherwise OK because the 'unsigned long' is really the result of ioremap(). This setup is also OK because the variable can hold an ioremap cookie /or/ a PCI I/O port (PIO). However, to fix the warning thrown when readl() and writel() are passed an unsigned long cookie, I introduce 'void __iomem *mmio_base', holding the same value as 'base'. This will silence the warnings, and also cause an oops whenever these MMIO-only functions are ever accidentally passed an I/O address. Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/scsi/megaraid.c | 13 ++++++++----- drivers/scsi/megaraid.h | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff -puN drivers/scsi/megaraid.c~scsi-megaraid-fix-mmio-casts drivers/scsi/megaraid.c --- a/drivers/scsi/megaraid.c~scsi-megaraid-fix-mmio-casts +++ a/drivers/scsi/megaraid.c @@ -73,10 +73,10 @@ static unsigned short int max_mbox_busy_ module_param(max_mbox_busy_wait, ushort, 0); MODULE_PARM_DESC(max_mbox_busy_wait, "Maximum wait for mailbox in microseconds if busy (default=MBOX_BUSY_WAIT=10)"); -#define RDINDOOR(adapter) readl((adapter)->base + 0x20) -#define RDOUTDOOR(adapter) readl((adapter)->base + 0x2C) -#define WRINDOOR(adapter,value) writel(value, (adapter)->base + 0x20) -#define WROUTDOOR(adapter,value) writel(value, (adapter)->base + 0x2C) +#define RDINDOOR(adapter) readl((adapter)->mmio_base + 0x20) +#define RDOUTDOOR(adapter) readl((adapter)->mmio_base + 0x2C) +#define WRINDOOR(adapter,value) writel(value, (adapter)->mmio_base + 0x20) +#define WROUTDOOR(adapter,value) writel(value, (adapter)->mmio_base + 0x2C) /* * Global variables @@ -1386,7 +1386,8 @@ megaraid_isr_memmapped(int irq, void *de handled = 1; - while( RDINDOOR(adapter) & 0x02 ) cpu_relax(); + while( RDINDOOR(adapter) & 0x02 ) + cpu_relax(); mega_cmd_done(adapter, completed, nstatus, status); @@ -4672,6 +4673,8 @@ megaraid_probe_one(struct pci_dev *pdev, host->host_no, mega_baseport, irq); adapter->base = mega_baseport; + if (flag & BOARD_MEMMAP) + adapter->mmio_base = (void __iomem *) mega_baseport; INIT_LIST_HEAD(&adapter->free_list); INIT_LIST_HEAD(&adapter->pending_list); diff -puN drivers/scsi/megaraid.h~scsi-megaraid-fix-mmio-casts drivers/scsi/megaraid.h --- a/drivers/scsi/megaraid.h~scsi-megaraid-fix-mmio-casts +++ a/drivers/scsi/megaraid.h @@ -801,7 +801,8 @@ typedef struct { clustering is available */ u32 flag; - unsigned long base; + unsigned long base; + void __iomem *mmio_base; /* mbox64 with mbox not aligned on 16-byte boundry */ mbox64_t *una_mbox64; _ Patches currently in -mm which might be from jeff@xxxxxxxxxx are origin.patch git-acpi.patch git-cpufreq.patch git-input.patch git-libata-all.patch pata_cs5530-suspend-resume-support-tweak.patch pata_sil680-suspend-resume-tidy.patch initializer-entry-defined-twice-in-pata_rz1000.patch ata_piix-ide-mode-sata-patch-for-intel-ich9.patch via-pata-controller-xfer-fixes.patch via-pata-controller-xfer-fixes-fix.patch ahci-ati-sb600-sata-support-for-various-modes.patch git-mtd.patch libphy-dont-do-that.patch update-smc91x-driver-with-arm-versatile-board-info.patch 8139too-force-media-setting-fix.patch bonding-incorrect-bonding-state-reported-via-ioctl.patch declance-fix-pmax-and-pmad-support.patch declance-fix-pmax-and-pmad-support-fix.patch declance-support-the-i-o-asic-lance-w-o-turbochannel.patch tulip-fix-shutdown-dma-irq-race.patch add-cppflags-to-byteorderh-check.patch git-ioat.patch serial-handle-pci_enable_device-failure-upon-resume.patch git-pciseg.patch pci-device-ensure-sysdata-initialised-v2.patch git-scsi-misc.patch mpt-fusion-handle-pci-layer-error-on-resume.patch i2o-more-error-checking.patch pnp-handle-sysfs-errors.patch rtc-handle-sysfs-errors.patch sound-oss-emu10k1-handle-userspace-copy-errors.patch spi-improve-sysfs-compiler-complaint-handling.patch remove-double-cast-to-same-type.patch via82cxxx-handle-error-condition-properly.patch drm-handle-pci_enable_device-failure.patch isdn-fix-warnings.patch scsi-megaraid-fix-mmio-casts.patch usb-fix-ohcih-over-use-warnings.patch atyfb-rivafb-minor-fixes.patch md-conditionalize-some-code.patch user-of-the-jiffies-rounding-patch-ata-subsystem.patch e1000-printk-warning-fixes.patch git-gccbug.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html