* [PATCH 0/2] Convert Atari Falcon IDE driver to platform device @ 2019-07-01 22:02 Michael Schmitz 2019-07-01 22:02 ` [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port Michael Schmitz 2019-07-01 22:02 ` [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device Michael Schmitz 0 siblings, 2 replies; 10+ messages in thread From: Michael Schmitz @ 2019-07-01 22:02 UTC (permalink / raw) To: linux-m68k, linux-ide; +Cc: geert, b.zolnierkie As suggested by Geert, at least one of the drivers available for the Falcon IDE interface should be converted to a platform device driver (to enable module autoloading by the Debian installer). Add platform device for Falcon IDE (patch 1), and rewrite the present libata driver to make use of that device (patch 2). Tested on ARAnyM with driver builtin. Cheers, Michael ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port 2019-07-01 22:02 [PATCH 0/2] Convert Atari Falcon IDE driver to platform device Michael Schmitz @ 2019-07-01 22:02 ` Michael Schmitz 2019-07-02 12:50 ` Bartlomiej Zolnierkiewicz 2019-09-03 12:40 ` Geert Uytterhoeven 2019-07-01 22:02 ` [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device Michael Schmitz 1 sibling, 2 replies; 10+ messages in thread From: Michael Schmitz @ 2019-07-01 22:02 UTC (permalink / raw) To: linux-m68k, linux-ide; +Cc: geert, b.zolnierkie, Michael Schmitz Autoloading of Falcon IDE driver modules requires converting these drivers to platform drivers. Add platform device for Falcon IDE interface in Atari platform setup code in preparation for this. Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> -- Changes from RFC - fix region size (spotted by Szymon Bieganski <S.Bieganski@chello.nl>) - define IDE interface address in atari/config.c, create platform device always (suggested by Geert Uytterhoeven <geert@linux-m68k.org>) --- arch/m68k/atari/config.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index ca8469e..c10533c 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -896,6 +896,25 @@ static void isp1160_delay(struct device *dev, int delay) }; #endif +/* + * Falcon IDE interface + */ + +#define FALCON_IDE_BASE 0xfff00000 + +static const struct resource atari_falconide_rsrc[] __initconst = { + { + .flags = IORESOURCE_MEM, + .start = FALCON_IDE_BASE, + .end = FALCON_IDE_BASE+0x39, + }, + { + .flags = IORESOURCE_IRQ, + .start = IRQ_MFP_FSCSI, + .end = IRQ_MFP_FSCSI, + }, +}; + int __init atari_platform_init(void) { int rv = 0; @@ -939,6 +958,10 @@ int __init atari_platform_init(void) atari_scsi_tt_rsrc, ARRAY_SIZE(atari_scsi_tt_rsrc)); #endif + if (ATARIHW_PRESENT(IDE)) + platform_device_register_simple("pata_falcon", -1, + atari_falconide_rsrc, ARRAY_SIZE(atari_falconide_rsrc)); + return rv; } -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port 2019-07-01 22:02 ` [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port Michael Schmitz @ 2019-07-02 12:50 ` Bartlomiej Zolnierkiewicz 2019-09-03 12:40 ` Geert Uytterhoeven 1 sibling, 0 replies; 10+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2019-07-02 12:50 UTC (permalink / raw) To: Michael Schmitz; +Cc: linux-m68k, linux-ide, geert On 7/2/19 12:02 AM, Michael Schmitz wrote: > Autoloading of Falcon IDE driver modules requires converting > these drivers to platform drivers. > > Add platform device for Falcon IDE interface in Atari platform > setup code in preparation for this. > > Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port 2019-07-01 22:02 ` [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port Michael Schmitz 2019-07-02 12:50 ` Bartlomiej Zolnierkiewicz @ 2019-09-03 12:40 ` Geert Uytterhoeven 1 sibling, 0 replies; 10+ messages in thread From: Geert Uytterhoeven @ 2019-09-03 12:40 UTC (permalink / raw) To: Michael Schmitz; +Cc: Linux/m68k, linux-ide, Bartlomiej Zolnierkiewicz Hi Michael, On Tue, Jul 2, 2019 at 12:02 AM Michael Schmitz <schmitzmic@gmail.com> wrote: > Autoloading of Falcon IDE driver modules requires converting > these drivers to platform drivers. > > Add platform device for Falcon IDE interface in Atari platform > setup code in preparation for this. > > Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> > > -- > > Changes from RFC > > - fix region size (spotted by Szymon Bieganski <S.Bieganski@chello.nl>) > - define IDE interface address in atari/config.c, create platform device > always (suggested by Geert Uytterhoeven <geert@linux-m68k.org>) Thanks for the update! Looks good to me. However, with just this patch applied, pata_falcon fails with: pata_falcon: Atari Falcon PATA controller pata_falcon: resources busy To avoid bisection issues, probably both patches should be combined into a single patch. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device 2019-07-01 22:02 [PATCH 0/2] Convert Atari Falcon IDE driver to platform device Michael Schmitz 2019-07-01 22:02 ` [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port Michael Schmitz @ 2019-07-01 22:02 ` Michael Schmitz 2019-07-02 12:51 ` Bartlomiej Zolnierkiewicz 2019-09-03 12:44 ` Geert Uytterhoeven 1 sibling, 2 replies; 10+ messages in thread From: Michael Schmitz @ 2019-07-01 22:02 UTC (permalink / raw) To: linux-m68k, linux-ide; +Cc: geert, b.zolnierkie, Michael Schmitz The Atari platform device setup now provides a platform device for the Falcon IDE interface. Use this in place of the simple platform device set up in the old pata_falcon probe code. Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> --- drivers/ata/pata_falcon.c | 39 +++++++++++++++++++++++++++------------ 1 files changed, 27 insertions(+), 12 deletions(-) diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c index 41e0d6a..1ff6fcb 100644 --- a/drivers/ata/pata_falcon.c +++ b/drivers/ata/pata_falcon.c @@ -120,23 +120,21 @@ static int pata_falcon_set_mode(struct ata_link *link, .set_mode = pata_falcon_set_mode, }; -static int pata_falcon_init_one(void) +static int __init pata_falcon_init_one(struct platform_device *pdev) { + struct resource *res; struct ata_host *host; struct ata_port *ap; - struct platform_device *pdev; void __iomem *base; - if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE)) - return -ENODEV; - - pr_info(DRV_NAME ": Atari Falcon PATA controller\n"); + dev_info(&pdev->dev, ": Atari Falcon PATA controller\n"); - pdev = platform_device_register_simple(DRV_NAME, 0, NULL, 0); - if (IS_ERR(pdev)) - return PTR_ERR(pdev); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -ENODEV; - if (!devm_request_mem_region(&pdev->dev, ATA_HD_BASE, 0x40, DRV_NAME)) { + if (!devm_request_mem_region(&pdev->dev, res->start, + resource_size(res), DRV_NAME)) { pr_err(DRV_NAME ": resources busy\n"); return -EBUSY; } @@ -152,7 +150,7 @@ static int pata_falcon_init_one(void) ap->flags |= ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_IORDY; ap->flags |= ATA_FLAG_PIO_POLLING; - base = (void __iomem *)ATA_HD_BASE; + base = (void __iomem *)res->start; ap->ioaddr.data_addr = base; ap->ioaddr.error_addr = base + 1 + 1 * 4; ap->ioaddr.feature_addr = base + 1 + 1 * 4; @@ -174,9 +172,26 @@ static int pata_falcon_init_one(void) return ata_host_activate(host, 0, NULL, 0, &pata_falcon_sht); } -module_init(pata_falcon_init_one); +static int __exit pata_falcon_remove_one(struct platform_device *pdev) +{ + struct ata_host *host = platform_get_drvdata(pdev); + + ata_host_detach(host); + + return 0; +} + +static struct platform_driver pata_falcon_driver = { + .remove = __exit_p(pata_falcon_remove_one), + .driver = { + .name = "atari-falcon-ide", + }, +}; + +module_platform_driver_probe(pata_falcon_driver, pata_falcon_init_one); MODULE_AUTHOR("Bartlomiej Zolnierkiewicz"); MODULE_DESCRIPTION("low-level driver for Atari Falcon PATA"); MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:atari-falcon-ide"); MODULE_VERSION(DRV_VERSION); -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device 2019-07-01 22:02 ` [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device Michael Schmitz @ 2019-07-02 12:51 ` Bartlomiej Zolnierkiewicz 2019-07-30 11:59 ` John Paul Adrian Glaubitz 2019-09-03 12:44 ` Geert Uytterhoeven 1 sibling, 1 reply; 10+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2019-07-02 12:51 UTC (permalink / raw) To: Michael Schmitz; +Cc: linux-m68k, linux-ide, geert On 7/2/19 12:02 AM, Michael Schmitz wrote: > The Atari platform device setup now provides a platform device > for the Falcon IDE interface. Use this in place of the simple platform > device set up in the old pata_falcon probe code. > > Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device 2019-07-02 12:51 ` Bartlomiej Zolnierkiewicz @ 2019-07-30 11:59 ` John Paul Adrian Glaubitz 0 siblings, 0 replies; 10+ messages in thread From: John Paul Adrian Glaubitz @ 2019-07-30 11:59 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz, Michael Schmitz; +Cc: linux-m68k, linux-ide, geert Hi! On 7/2/19 2:51 PM, Bartlomiej Zolnierkiewicz wrote: > On 7/2/19 12:02 AM, Michael Schmitz wrote: >> The Atari platform device setup now provides a platform device >> for the Falcon IDE interface. Use this in place of the simple platform >> device set up in the old pata_falcon probe code. >> >> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> > > Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Have these patches been pushed to any tree yet? Thanks, Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device 2019-07-01 22:02 ` [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device Michael Schmitz 2019-07-02 12:51 ` Bartlomiej Zolnierkiewicz @ 2019-09-03 12:44 ` Geert Uytterhoeven 2019-09-25 3:59 ` Michael Schmitz 1 sibling, 1 reply; 10+ messages in thread From: Geert Uytterhoeven @ 2019-09-03 12:44 UTC (permalink / raw) To: Michael Schmitz; +Cc: Linux/m68k, linux-ide, Bartlomiej Zolnierkiewicz Hi Michael, On Tue, Jul 2, 2019 at 12:02 AM Michael Schmitz <schmitzmic@gmail.com> wrote: > The Atari platform device setup now provides a platform device > for the Falcon IDE interface. Use this in place of the simple platform > device set up in the old pata_falcon probe code. > > Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> Thanks for your patch! > --- a/drivers/ata/pata_falcon.c > +++ b/drivers/ata/pata_falcon.c > @@ -120,23 +120,21 @@ static int pata_falcon_set_mode(struct ata_link *link, > .set_mode = pata_falcon_set_mode, > }; > > -static int pata_falcon_init_one(void) > +static int __init pata_falcon_init_one(struct platform_device *pdev) > { > + struct resource *res; > struct ata_host *host; > struct ata_port *ap; > - struct platform_device *pdev; > void __iomem *base; > > - if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE)) > - return -ENODEV; > - > - pr_info(DRV_NAME ": Atari Falcon PATA controller\n"); > + dev_info(&pdev->dev, ": Atari Falcon PATA controller\n"); > > - pdev = platform_device_register_simple(DRV_NAME, 0, NULL, 0); > - if (IS_ERR(pdev)) > - return PTR_ERR(pdev); > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + if (!res) > + return -ENODEV; > > - if (!devm_request_mem_region(&pdev->dev, ATA_HD_BASE, 0x40, DRV_NAME)) { ATA_HD_BASE is now unused, and can be removed. > + if (!devm_request_mem_region(&pdev->dev, res->start, > + resource_size(res), DRV_NAME)) { > pr_err(DRV_NAME ": resources busy\n"); dev_err(&pdev->dev, "resources busy\n"); > return -EBUSY; > } > @@ -174,9 +172,26 @@ static int pata_falcon_init_one(void) > return ata_host_activate(host, 0, NULL, 0, &pata_falcon_sht); > } > > -module_init(pata_falcon_init_one); > +static int __exit pata_falcon_remove_one(struct platform_device *pdev) > +{ > + struct ata_host *host = platform_get_drvdata(pdev); > + > + ata_host_detach(host); > + > + return 0; > +} > + > +static struct platform_driver pata_falcon_driver = { > + .remove = __exit_p(pata_falcon_remove_one), > + .driver = { > + .name = "atari-falcon-ide", > + }, > +}; > + > +module_platform_driver_probe(pata_falcon_driver, pata_falcon_init_one); This doesn't seem to work in the builtin case (e.g. atari_defconfig with ide replaced by ata): no hard drives are detected. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device 2019-09-03 12:44 ` Geert Uytterhoeven @ 2019-09-25 3:59 ` Michael Schmitz 2019-11-04 10:31 ` Geert Uytterhoeven 0 siblings, 1 reply; 10+ messages in thread From: Michael Schmitz @ 2019-09-25 3:59 UTC (permalink / raw) To: Geert Uytterhoeven; +Cc: Linux/m68k, linux-ide, Bartlomiej Zolnierkiewicz Hi Geert, thanks for your feedback! Am 04.09.2019 um 00:44 schrieb Geert Uytterhoeven: > Hi Michael, > > On Tue, Jul 2, 2019 at 12:02 AM Michael Schmitz <schmitzmic@gmail.com> wrote: >> The Atari platform device setup now provides a platform device >> for the Falcon IDE interface. Use this in place of the simple platform >> device set up in the old pata_falcon probe code. >> >> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> > > Thanks for your patch! > >> --- a/drivers/ata/pata_falcon.c >> +++ b/drivers/ata/pata_falcon.c >> @@ -120,23 +120,21 @@ static int pata_falcon_set_mode(struct ata_link *link, >> .set_mode = pata_falcon_set_mode, >> }; >> >> -static int pata_falcon_init_one(void) >> +static int __init pata_falcon_init_one(struct platform_device *pdev) >> { >> + struct resource *res; >> struct ata_host *host; >> struct ata_port *ap; >> - struct platform_device *pdev; >> void __iomem *base; >> >> - if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE)) >> - return -ENODEV; >> - >> - pr_info(DRV_NAME ": Atari Falcon PATA controller\n"); >> + dev_info(&pdev->dev, ": Atari Falcon PATA controller\n"); >> >> - pdev = platform_device_register_simple(DRV_NAME, 0, NULL, 0); >> - if (IS_ERR(pdev)) >> - return PTR_ERR(pdev); >> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> + if (!res) >> + return -ENODEV; >> >> - if (!devm_request_mem_region(&pdev->dev, ATA_HD_BASE, 0x40, DRV_NAME)) { > > ATA_HD_BASE is now unused, and can be removed. Right - well spotted! > >> + if (!devm_request_mem_region(&pdev->dev, res->start, >> + resource_size(res), DRV_NAME)) { >> pr_err(DRV_NAME ": resources busy\n"); > > dev_err(&pdev->dev, "resources busy\n"); I stole that from pata_gayle, Bartlomiej may want to fix it there as well? >> return -EBUSY; >> } > >> @@ -174,9 +172,26 @@ static int pata_falcon_init_one(void) >> return ata_host_activate(host, 0, NULL, 0, &pata_falcon_sht); >> } >> >> -module_init(pata_falcon_init_one); >> +static int __exit pata_falcon_remove_one(struct platform_device *pdev) >> +{ >> + struct ata_host *host = platform_get_drvdata(pdev); >> + >> + ata_host_detach(host); >> + >> + return 0; >> +} >> + >> +static struct platform_driver pata_falcon_driver = { >> + .remove = __exit_p(pata_falcon_remove_one), >> + .driver = { >> + .name = "atari-falcon-ide", >> + }, >> +}; >> + >> +module_platform_driver_probe(pata_falcon_driver, pata_falcon_init_one); > > This doesn't seem to work in the builtin case (e.g. atari_defconfig with > ide replaced by ata): no hard drives are detected. Due to a dumb naming mismatch between driver and platform code (shouldn't have rushed this right before going on leave). This would have made the driver fail in the modular case as well. I'll fix that along with adding some error checking in the Atari platform init code. Regarding the potential bisection issue with this series - that ought to be fixed as well by renaming the platform resource to match what the new driver expects. I'd rather leave the two patches separate so the Atari platform code one can go through your tree. Cheers, Michael > > Gr{oetje,eeting}s, > > Geert > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device 2019-09-25 3:59 ` Michael Schmitz @ 2019-11-04 10:31 ` Geert Uytterhoeven 0 siblings, 0 replies; 10+ messages in thread From: Geert Uytterhoeven @ 2019-11-04 10:31 UTC (permalink / raw) To: Michael Schmitz; +Cc: Linux/m68k, linux-ide, Bartlomiej Zolnierkiewicz Hi Michael, On Wed, Sep 25, 2019 at 5:59 AM Michael Schmitz <schmitzmic@gmail.com> wrote: > Am 04.09.2019 um 00:44 schrieb Geert Uytterhoeven: > > On Tue, Jul 2, 2019 at 12:02 AM Michael Schmitz <schmitzmic@gmail.com> wrote: > >> The Atari platform device setup now provides a platform device > >> for the Falcon IDE interface. Use this in place of the simple platform > >> device set up in the old pata_falcon probe code. > >> > >> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> > >> +module_platform_driver_probe(pata_falcon_driver, pata_falcon_init_one); > > > > This doesn't seem to work in the builtin case (e.g. atari_defconfig with > > ide replaced by ata): no hard drives are detected. > > Due to a dumb naming mismatch between driver and platform code > (shouldn't have rushed this right before going on leave). This would > have made the driver fail in the modular case as well. > > I'll fix that along with adding some error checking in the Atari > platform init code. OK. > Regarding the potential bisection issue with this series - that ought to > be fixed as well by renaming the platform resource to match what the new > driver expects. I'd rather leave the two patches separate so the Atari > platform code one can go through your tree. No it isn't: the resource is still busy, and probing fails. Hence I'll merge them. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-11-04 10:31 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-07-01 22:02 [PATCH 0/2] Convert Atari Falcon IDE driver to platform device Michael Schmitz 2019-07-01 22:02 ` [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port Michael Schmitz 2019-07-02 12:50 ` Bartlomiej Zolnierkiewicz 2019-09-03 12:40 ` Geert Uytterhoeven 2019-07-01 22:02 ` [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device Michael Schmitz 2019-07-02 12:51 ` Bartlomiej Zolnierkiewicz 2019-07-30 11:59 ` John Paul Adrian Glaubitz 2019-09-03 12:44 ` Geert Uytterhoeven 2019-09-25 3:59 ` Michael Schmitz 2019-11-04 10:31 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).