Re: [PATCH v1 3/4] scsi - convert mvme146_scsi.c to platform device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 9, 2022 at 2:10 AM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:
>
> Convert the mvme147_scsi driver to a platform device driver.
> This is required for conversion of the driver to the DMA API.
>
> CC: linux-scsi@xxxxxxxxxxxxxxx
> Link: https://lore.kernel.org/r/6d1d88ee-1cf6-c735-1e6d-bafd2096e322@xxxxxxxxx
> Signed-off-by: Michael Schmitz <schmitzmic@xxxxxxxxx>

The patch looks correct to me, but the type cast for the address doesn't
seem right:

> -       regs.SASR = (volatile unsigned char *)0xfffe4000;
> -       regs.SCMD = (volatile unsigned char *)0xfffe4001;
>
> -       hdata = shost_priv(mvme147_shost);
> +       mvme147_inst->base = mres->start;
> +       mvme147_inst->irq = ires->start;
> +
> +       regs.SASR = (volatile unsigned char *)mres->start;
> +       regs.SCMD = (volatile unsigned char *)(mres->start)+0x1;

A resource would pass a phys_addr_t token, but the driver expects a
virtual address that should be an __iomem pointer. The MMIO area
already gets mapped into virtual addresses in arch/m68k/kernel/head.S,
so it makes sense to skip the extra ioremap() and just use the address,
but then you can't pass it as an IORESOUCRE_MEM token and should
use platform_data with the pointer instead.

The alternative is to do it the normal way and pass the physical address
as a resource, that you can pass into devm_platform_ioremap_resource()
or a similar helper.

       Arnd



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux