From: Michael Schmitz <schmitzmic@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Finn Thain <fthain@linux-m68k.org>
Cc: will@sowerbutts.com, linux-m68k@vger.kernel.org, rz@linux-m68k.org
Subject: Re: [PATCH RFC v3 2/2] m68k/q40: add data_swab option for pata_falcon to byte-swap disk data
Date: Fri, 18 Aug 2023 09:28:15 +1200 [thread overview]
Message-ID: <fd7cd3b9-3f86-feb4-e9ce-aafaea272840@gmail.com> (raw)
In-Reply-To: <8bf4980e-f269-48d2-5b77-3fd6c7270bef@gmail.com>
Hi Geert,
On 18/08/23 07:21, Michael Schmitz wrote:
>
>>>> + priv->swap_mask = pata_falcon_swap_mask;
>> priv->swap_mask = pata_falcon_swap_mask >> (2 * pdev->id);
>
> The Atari platform driver data is registered with pdev->id=-1. That'll
> break here.
Confirmed.
>
> (Not sure why that choice of pdev->id, and whether it can be changed
> to 0 easily)
Seems to work OK with ID set to 0, so I'll simplify that as you suggest.
Cheers,
Michael
> Cheers,
>
> Michael
>
>
>>
>>> --- a/drivers/ata/pata_falcon.c
>>> +++ b/drivers/ata/pata_falcon.c
>>> @@ -33,6 +33,11 @@
>>> #define DRV_NAME "pata_falcon"
>>> #define DRV_VERSION "0.1.0"
>>>
>>> +static int pata_falcon_data_swab;
>>> +
>>> +module_param_named(data_swab, pata_falcon_data_swab, int, 0444);
>>> +MODULE_PARM_DESC(data_swab, "Data byte swap enable/disable bitmap
>>> (0x1==drive1, 0x2==drive2, 0x4==drive3, 0x8==drive4, default: 0)");
>>> +
>>> static const struct scsi_host_template pata_falcon_sht = {
>>> ATA_PIO_SHT(DRV_NAME),
>>> };
>>> @@ -50,7 +55,7 @@ static unsigned int pata_falcon_data_xfer(struct
>>> ata_queued_cmd *qc,
>>>
>>> if (dev->class == ATA_DEV_ATA && cmd &&
>>> !blk_rq_is_passthrough(scsi_cmd_to_rq(cmd)))
>>> - swap = 0;
>>> + swap = (int)ap->private_data & BIT(dev->devno);
>> "(uintptr_t)", to make it 64-bit clean.
>>
>> Yeah, we don't support COMPILE_TEST=y yet for PATA_FALCON.
>> BTW, looks like we don't need any of the following anymore:
>>
>> #include <asm/setup.h>
>> #include <asm/atarihw.h>
>> #include <asm/atariints.h>
>> #include <asm/atari_stdma.h>
>>
>> That leaves us with <asm/ide.h>, (which does not exist on most
>> architectures, and seems to be mostly obsolete), for the (indirectly
>> included) definitions of raw_{in,out}sw_{,swapw}()....
>>
>>> /* Transfer multiple of 2 bytes */
>>> if (rw == READ) {
>>> @@ -199,6 +204,8 @@ static int __init pata_falcon_init_one(struct
>>> platform_device *pdev)
>>> ap->ioaddr.altstatus_addr = ctl_base + io_offset;
>>> ap->ioaddr.ctl_addr = ctl_base + io_offset;
>>>
>>> + ap->private_data = (void *)((pata_falcon_data_swab >> (2 *
>>> pdev->id)) & 3);
>> "(void *)(uintptr_t)", to make it 64-bit clean.
>>
>>> +
>>> irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>>> if (irq_res && irq_res->start > 0) {
>>> irq = irq_res->start;
>> Gr{oetje,eeting}s,
>>
>> Geert
>>
next prev parent reply other threads:[~2023-08-17 21:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 3:49 [PATCH RFC v3 0/2] Q40 IDE fixes Michael Schmitz
2023-08-17 3:50 ` [PATCH RFC v3 1/2] m68k/q40: fix IO base selection for Q40 in pata_falcon.c Michael Schmitz
2023-08-17 3:50 ` [PATCH RFC v3 2/2] m68k/q40: add data_swab option for pata_falcon to byte-swap disk data Michael Schmitz
2023-08-17 10:15 ` Finn Thain
2023-08-17 11:47 ` Geert Uytterhoeven
2023-08-17 19:21 ` Michael Schmitz
2023-08-17 21:28 ` Michael Schmitz [this message]
2023-08-18 14:33 ` Geert Uytterhoeven
2023-08-18 23:53 ` Finn Thain
2023-08-21 7:46 ` Geert Uytterhoeven
2023-08-21 11:08 ` Finn Thain
2023-08-21 20:36 ` Michael Schmitz
2023-08-21 23:18 ` Finn Thain
[not found] ` <F32F62FE-2A74-4648-8BF1-0D1A1E76309B@linux-m68k.org>
2023-08-17 19:07 ` Michael Schmitz
2023-08-17 19:14 ` Michael Schmitz
2023-08-18 0:36 ` Finn Thain
2023-08-17 3:56 ` [PATCH RFC v3 0/2] Q40 IDE fixes Michael Schmitz
2023-08-17 9:20 ` William R Sowerbutts
2023-08-17 20:25 ` William R Sowerbutts
2023-08-17 21:29 ` 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=fd7cd3b9-3f86-feb4-e9ce-aafaea272840@gmail.com \
--to=schmitzmic@gmail.com \
--cc=fthain@linux-m68k.org \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=rz@linux-m68k.org \
--cc=will@sowerbutts.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