public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH v2 2/5] m68k - set up platform device for mvme147_scsi
Date: Tue, 12 Jul 2022 21:28:23 +1200	[thread overview]
Message-ID: <4faebfc0-4fc4-aff6-a507-293d755893ba@gmail.com> (raw)
In-Reply-To: <7b652abd-3094-e0c8-d8fb-087c60c51fa2@gmail.com>

Hi Arnd,

Am 12.07.2022 um 21:07 schrieb Michael Schmitz:
> Hi Arnd,
>
> Am 12.07.2022 um 20:12 schrieb Arnd Bergmann:
>> 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?
>
> Too true - forgot to fix that, sorry.
>
>>
>>> +       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.
>
> I'll take a look at that - if true, this requires the amiga-a3000-scsi
> platform device set-up be changed in the same way (the gvp11 and a2091
> drivers inherit the DMA mask from the Zorro bus default, so ought to
> work OK).

I think we are good with using platform_device_register_simple():

setup_pdev_dma_masks() sets the DMA mask to 32 bit when allocating a new 
platform device, and platform_device_register_full() only changes that 
when passed in a non-zero mask in pdevinfo.

platform_device_register_simple() leaves the pdevinfo mask zero, so the 
32 bit default set in setup_pdev_dma_masks() survives.

Cheers,

	Michael

>
> Cheers,
>
>     Michael
>
>> 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
>>

  reply	other threads:[~2022-07-12  9:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  7:58 [PATCH v2 0/5] Convert m68k MVME147 WD33C93 SCSI driver to DMA API Michael Schmitz
2022-07-12  7:58 ` [PATCH v2 1/5] m68k - add MVME147 SCSI base address to mvme147hw.h Michael Schmitz
2022-07-12  7:58 ` [PATCH v2 2/5] m68k - set up platform device for mvme147_scsi Michael Schmitz
2022-07-12  8:12   ` Arnd Bergmann
2022-07-12  9:07     ` Michael Schmitz
2022-07-12  9:28       ` Michael Schmitz [this message]
2022-07-13  2:05         ` Michael Schmitz
2022-07-12  7:58 ` [PATCH v2 3/5] m68k - add MMIO ioremap support for mvme147 Michael Schmitz
2022-07-12  7:58 ` [PATCH v2 4/5] scsi - convert mvme147.c driver to platform device Michael Schmitz
2022-07-12  7:58 ` [PATCH v2 5/5] scsi - convert mvme147.c driver to DMA API Michael Schmitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4faebfc0-4fc4-aff6-a507-293d755893ba@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=arnd@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox