From: Michael Schmitz <schmitzmic@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org
Cc: linux-m68k@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] scsi: gvp11: add module parameter for DMA transfer bit mask
Date: Wed, 30 Aug 2023 12:47:13 +1200 [thread overview]
Message-ID: <bd54d374-a388-258b-19ad-ac3417057a8a@gmail.com> (raw)
In-Reply-To: <31a63180-ffdc-4b5c-8bc6-3be4728a8463@app.fastmail.com>
Thanks Arnd!
Cheers,
Michael
On 30/08/23 12:14, Arnd Bergmann wrote:
> On Tue, Aug 29, 2023, at 18:25, Michael Schmitz wrote:
>>>> +module_param(gvp11_xfer_mask, int, 0444);
>>>> +MODULE_PARM_DESC(gvp11_xfer_mask, "DMA mask (0xff000000 == 24 bit DMA)");
>>>> +
>>> I think the comment is the wrong way round, it should be
>>> 0x00ffffff in this case, which also matches the default
>>> mask for ZORRO_PROD_GVP_SERIES_II, in the match table:
>>>
>>> static struct zorro_device_id gvp11_zorro_tbl[] = {
>>> { ZORRO_PROD_GVP_COMBO_030_R3_SCSI, ~0x00ffffff },
>>> { ZORRO_PROD_GVP_SERIES_II, ~0x00ffffff },
>>> { ZORRO_PROD_GVP_GFORCE_030_SCSI, ~0x01ffffff },
>>> { ZORRO_PROD_GVP_A530_SCSI, ~0x01ffffff },
>>> { ZORRO_PROD_GVP_COMBO_030_R4_SCSI, ~0x01ffffff },
>>> { ZORRO_PROD_GVP_A1291, ~0x07ffffff },
>>> { ZORRO_PROD_GVP_GFORCE_040_SCSI_1, ~0x07ffffff },
>>> { 0 }
>>> };
>> gvp11_xfer_mask works inverse to what you'd expect (and inverse to what
>> a DMA mask usually is defined as). DMA can _not_ be used if (address &
>> gvp11_xfer_mask) isn't zero. See code in dma_setup() for details.
>>
>> All those definitions have a '~' prefix, for that very reason.
>>
>> I agree it isn't intuitive, and caused a little head scratching when
>> preparing this patch. But I believe it is correct.
>>
>> Now you could argue to shift the bit mask inversion to gvp11_probe() or
>> even dma_setup() instead to rule out such confusion in future, but that
>> would be an actual code change and would benefit from testing on at
>> least one of these boards IMO. Not sure how easy that will be.
> Ok, I see now. Let's leave the patch as it is then.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
next prev parent reply other threads:[~2023-08-30 0:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-29 21:45 [PATCH] scsi: gvp11: add module parameter for DMA transfer bit mask Michael Schmitz
2023-08-29 22:05 ` Arnd Bergmann
2023-08-29 22:25 ` Michael Schmitz
2023-08-30 0:14 ` Arnd Bergmann
2023-08-30 0:47 ` Michael Schmitz [this message]
2023-08-30 7:32 ` Geert Uytterhoeven
2023-08-30 7:52 ` 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=bd54d374-a388-258b-19ad-ac3417057a8a@gmail.com \
--to=schmitzmic@gmail.com \
--cc=arnd@arndb.de \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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