Re: [PATCH v2 2/5] m68k - set up platform device for mvme147_scsi

Arnd Bergmann
2022-07-12T08:13:12Z

On Tue, Jul 12, 2022 at 9:58 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> +
> +static const struct resource mvme147_scsi_rsrc[] __initconst = {
> + DEFINE_RES_MEM(MVME147_SCSI_BASE, 0xff),

Still the wrong size?

> + DEFINE_RES_IRQ(MVME147_IRQ_SCSI_PORT),
> +};
> +
> +int __init mvme147_platform_init(void)
> +{
> + struct platform_device *pdev;
> + int rv = 0;
> +
> + pdev = platform_device_register_simple("mvme147-scsi", -1,
> + mvme147_scsi_rsrc, ARRAY_SIZE(mvme147_scsi_rsrc));

I think you actually have to use platform_device_register_full() to pass
a DMA mask here: As I understand it, the dma_set_mask_and_coherent()
call in the driver fails if the device is not already marked as dma
capable by having an initial mask set.

The way this normally works is that the device gets created with a mask
that reflects the capabilities of the bus, while the driver sets a mask
based on what it wants to program into the device, and the dma-mapping
interfaces ensure that we only use the intersection of those.

Arnd