Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Rosen Penev <rosenp@gmail.com>
Cc: Niklas Cassel <cassel@kernel.org>,
	Andy Shevchenko <andy@kernel.org>,
	linux-ide@vger.kernel.org, Damien Le Moal <dlemoal@kernel.org>,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] ata: pata_mpc52xx: switch to non-devm request_irq for proper ordering
Date: Wed, 10 Jun 2026 13:39:44 +0300	[thread overview]
Message-ID: <aik-8EhMkKFz8tyX@ashevche-desk.local> (raw)
In-Reply-To: <CAKxU2N9kAe4Yc1iE7r0Gw=CyQWuaWwwN5uUBV_J0szAF90G3BQ@mail.gmail.com>

On Tue, Jun 09, 2026 at 02:17:24PM -0700, Rosen Penev wrote:
> On Tue, Jun 9, 2026 at 1:36 AM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > On Tue, Jun 09, 2026 at 09:20:35AM +0200, Niklas Cassel wrote:
> > > On Mon, Jun 08, 2026 at 02:47:15PM -0700, Rosen Penev wrote:

...

> > > Andy, since you gave a talk about this recently.
> > > Surely there must be a better way than to migrate away from the device
> > > managed APIs.
> >
> > Thank for Cc'ing me.
> >
> > > Do you have some suggestion?
> >
> > This patch either way (are we going to devm fully or rollback to non-devm)
> > is half-baked.
> Note the fixes tag. The purpose is to get this backported.

See what I wrote below.

> > What I may suggest here is to extend this patch to cover the second
> > problematic place (*) and make it as a fix for backporting.

^^^

> > After that one may carefully go and finish converting probe to devm_*().
> >
> > *) https://elixir.bootlin.com/linux/v7.1-rc7/source/drivers/ata/pata_mpc52xx.c#L733
> > The call of irq_of_parse_and_map() should be moved after devm_kzalloc().
> > So, this fix should do what it does + the above.
> Doesn't matter much. task_irq gets requested, not ata_irq.

It matters, it's about memory allocation. It should go after devm_kzalloc().

> > P.S.
> > Someone may tide up this driver a lot, but this is out of the scope of
> > this patch. FWIW, the brief list of potential refactoring patches
> > based on probe (in unsorted order):
> > - use devm_platform_ioremap_resource()

> Done in later patch in this series.

Cool! Any plans for the rest?

> > - moving towards device_property_read_*()
> > - using dev_err_probe()
> > - use temporary variable to hold struct device pointer
> > - use fwnode_irq_get()
> > - apply multipliers from units.h and time.h (like HZ_PER_MHZ)
> > - moving to a new struct dev_pm_ops and pm_sleep_ptr() macro

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-06-10 10:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 21:47 [PATCH 0/4] ata: pata_mpc52xx: fix cleanup ordering and modernize Rosen Penev
2026-06-08 21:47 ` [PATCH 1/4] ata: pata_mpc52xx: switch to non-devm request_irq for proper ordering Rosen Penev
2026-06-08 21:59   ` sashiko-bot
2026-06-09  7:20   ` Niklas Cassel
2026-06-09  8:36     ` Andy Shevchenko
2026-06-09 21:17       ` Rosen Penev
2026-06-10 10:39         ` Andy Shevchenko [this message]
2026-06-08 21:47 ` [PATCH 2/4] ata: pata_mpc52xx: remove redundant irq_dispose_mapping calls Rosen Penev
2026-06-08 21:47 ` [PATCH 3/4] ata: pata_mpc52xx: convert to platform_get_irq() Rosen Penev
2026-06-08 21:47 ` [PATCH 4/4] ata: pata_mpc52xx: use devm_platform_get_and_ioremap_resource Rosen Penev

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=aik-8EhMkKFz8tyX@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=andy@kernel.org \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rosenp@gmail.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