mbox series

[v2,0/4] Add more devm_ functions to simplify probe path in drivers/spi/atmel-quadspi.c

Message ID 20250124085221.766303-4-csokas.bence@prolan.hu (mailing list archive)
Headers show
Series Add more devm_ functions to simplify probe path in drivers/spi/atmel-quadspi.c | expand

Message

Csókás Bence Jan. 24, 2025, 8:52 a.m. UTC
The probe function of the atmel-quadspi driver got quite convoluted,
especially since the addition of SAMA7G5 support, that was forward-ported
from an older vendor kernel. To alleivate this - and similar problems in
the future - an effort was made to migrate as many functions as possible,
to their devm_ managed counterparts. The few functions, which did not yet
have a devm_ variant, are added in patch 1 and 2 of this series. Patch 3
and 4 then use these APIs to simplify and fix the probe() function.

Change in v2: rebased onto Linus' master, which is:
commit bc8198dc7ebc ("Merge tag 'sched_ext-for-6.14' of
 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext")

Bence Csókás (4):
  dma: Add devm_dma_request_chan()
  pm: runtime: Add new devm functions
  spi: atmel-quadspi: Use `devm_dma_request_chan()`
  spi: atmel-quadspi: Fix unbalanced pm_runtime by using devm_ API

 drivers/base/power/runtime.c | 36 +++++++++++++++++++++
 drivers/dma/dmaengine.c      | 30 +++++++++++++++++
 drivers/spi/atmel-quadspi.c  | 62 ++++++++++--------------------------
 include/linux/dmaengine.h    |  7 ++++
 include/linux/pm_runtime.h   |  4 +++
 5 files changed, 93 insertions(+), 46 deletions(-)

Comments

Alexander Dahl Jan. 24, 2025, 9:08 a.m. UTC | #1
Hello,

Am Fri, Jan 24, 2025 at 09:52:16AM +0100 schrieb Bence Csókás:
> The probe function of the atmel-quadspi driver got quite convoluted,
> especially since the addition of SAMA7G5 support, that was forward-ported
> from an older vendor kernel. To alleivate this - and similar problems in
> the future - an effort was made to migrate as many functions as possible,
> to their devm_ managed counterparts. The few functions, which did not yet
> have a devm_ variant, are added in patch 1 and 2 of this series. Patch 3
> and 4 then use these APIs to simplify and fix the probe() function.
> 
> Change in v2: rebased onto Linus' master, which is:
> commit bc8198dc7ebc ("Merge tag 'sched_ext-for-6.14' of
>  git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext")

You can pass '--base master' or '--base=auto' to `git format-patch`
which adds a machine readable line to your patch or cover letter like
this:

base-commit: bc8198dc7ebc492ec3e9fa1617dcdfbe98e73b17

This way tools can find out which commit your series was based on.
See for reasoning:

https://people.kernel.org/monsieuricon/all-patches-must-include-base-commit-info

I'll look into your patch series in February, after my holidays.

Greets
Alex
Csókás Bence Jan. 24, 2025, 10:50 a.m. UTC | #2
Hi,

On 2025. 01. 24. 10:08, Alexander Dahl wrote:
> You can pass '--base master' or '--base=auto' to `git format-patch`
> which adds a machine readable line to your patch or cover letter like
> this:
> 
> base-commit: bc8198dc7ebc492ec3e9fa1617dcdfbe98e73b17
> 
> This way tools can find out which commit your series was based on.
> See for reasoning:
> 
> https://people.kernel.org/monsieuricon/all-patches-must-include-base-commit-info

Thanks for the tip!

> I'll look into your patch series in February, after my holidays.

Hmm, if my calculations are correct, 6.14-rc1 comes out on 2nd Feb, so 
does that mean that this series will be pushed to -rc2? Then -rc1 will 
have the mismatched PM calls...

Bence