diff mbox series

[v1,1/5] ASoC: Intel: bytcht_cx2072x: Replace open coded acpi_dev_put()

Message ID 20230102203037.16120-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 7baff1a9debc5f4ff0d6bc1496358e251f66e396
Headers show
Series [v1,1/5] ASoC: Intel: bytcht_cx2072x: Replace open coded acpi_dev_put() | expand

Commit Message

Andy Shevchenko Jan. 2, 2023, 8:30 p.m. UTC
Instead of calling put_device(&adev->dev) where adev is a pointer
to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case
some other code will be added which may use that pointer. We need
to keep a reference as long as we use the pointer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/intel/boards/bytcht_cx2072x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pierre-Louis Bossart Jan. 3, 2023, 3:08 p.m. UTC | #1
On 1/2/23 14:30, Andy Shevchenko wrote:
> Instead of calling put_device(&adev->dev) where adev is a pointer
> to an ACPI device, use specific call, i.e. acpi_dev_put().
> 
> Also move it out of the conditional to make it more visible in case
> some other code will be added which may use that pointer. We need
> to keep a reference as long as we use the pointer.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Answering for the series: we should make the change across all Intel
machine drivers. I see at least four cases that were missed

bytcr_rt5640.c:         put_device(&adev->dev);
bytcr_rt5651.c:         put_device(&adev->dev);
bytcr_wm5102.c: put_device(&adev->dev);
sof_es8336.c:           put_device(&adev->dev);


> ---
>  sound/soc/intel/boards/bytcht_cx2072x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/boards/bytcht_cx2072x.c b/sound/soc/intel/boards/bytcht_cx2072x.c
> index 41cec67157b6..9942a2de6f7a 100644
> --- a/sound/soc/intel/boards/bytcht_cx2072x.c
> +++ b/sound/soc/intel/boards/bytcht_cx2072x.c
> @@ -253,9 +253,9 @@ static int snd_byt_cht_cx2072x_probe(struct platform_device *pdev)
>  	if (adev) {
>  		snprintf(codec_name, sizeof(codec_name), "i2c-%s",
>  			 acpi_dev_name(adev));
> -		put_device(&adev->dev);
>  		byt_cht_cx2072x_dais[dai_index].codecs->name = codec_name;
>  	}
> +	acpi_dev_put(adev);
>  
>  	/* override platform name, if required */
>  	ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_cx2072x_card,
Andy Shevchenko Jan. 4, 2023, 10:29 a.m. UTC | #2
On Tue, Jan 03, 2023 at 09:08:20AM -0600, Pierre-Louis Bossart wrote:
> On 1/2/23 14:30, Andy Shevchenko wrote:
> > Instead of calling put_device(&adev->dev) where adev is a pointer
> > to an ACPI device, use specific call, i.e. acpi_dev_put().
> > 
> > Also move it out of the conditional to make it more visible in case
> > some other code will be added which may use that pointer. We need
> > to keep a reference as long as we use the pointer.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Answering for the series: we should make the change across all Intel
> machine drivers. I see at least four cases that were missed
> 
> bytcr_rt5640.c:         put_device(&adev->dev);
> bytcr_rt5651.c:         put_device(&adev->dev);
> bytcr_wm5102.c: put_device(&adev->dev);
> sof_es8336.c:           put_device(&adev->dev);

Aren't they (they all problematic, btw) covered by the fixes series
https://lore.kernel.org/r/20230102203014.16041-1-andriy.shevchenko@linux.intel.com?
Pierre-Louis Bossart Jan. 4, 2023, 2:15 p.m. UTC | #3
On 1/4/23 04:29, Andy Shevchenko wrote:
> On Tue, Jan 03, 2023 at 09:08:20AM -0600, Pierre-Louis Bossart wrote:
>> On 1/2/23 14:30, Andy Shevchenko wrote:
>>> Instead of calling put_device(&adev->dev) where adev is a pointer
>>> to an ACPI device, use specific call, i.e. acpi_dev_put().
>>>
>>> Also move it out of the conditional to make it more visible in case
>>> some other code will be added which may use that pointer. We need
>>> to keep a reference as long as we use the pointer.
>>>
>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>
>> Answering for the series: we should make the change across all Intel
>> machine drivers. I see at least four cases that were missed
>>
>> bytcr_rt5640.c:         put_device(&adev->dev);
>> bytcr_rt5651.c:         put_device(&adev->dev);
>> bytcr_wm5102.c: put_device(&adev->dev);
>> sof_es8336.c:           put_device(&adev->dev);
> 
> Aren't they (they all problematic, btw) covered by the fixes series
> https://lore.kernel.org/r/20230102203014.16041-1-andriy.shevchenko@linux.intel.com?

They are indeed, but if you group AMD-related patches with Intel ones,
it's only human for reviewers to skip the thread entirely, even more so
when catching up with email on January 3 :-)

For this series

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mark Brown Jan. 4, 2023, 4:42 p.m. UTC | #4
On Wed, Jan 04, 2023 at 08:15:27AM -0600, Pierre-Louis Bossart wrote:

> For this series

> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

According to b4 you've only acked the first patch here because Andy
doesn't send cover letters :/
Andy Shevchenko Jan. 4, 2023, 4:45 p.m. UTC | #5
On Wed, Jan 04, 2023 at 08:15:27AM -0600, Pierre-Louis Bossart wrote:
> On 1/4/23 04:29, Andy Shevchenko wrote:
> > On Tue, Jan 03, 2023 at 09:08:20AM -0600, Pierre-Louis Bossart wrote:
> >> On 1/2/23 14:30, Andy Shevchenko wrote:
> >>> Instead of calling put_device(&adev->dev) where adev is a pointer
> >>> to an ACPI device, use specific call, i.e. acpi_dev_put().
> >>>
> >>> Also move it out of the conditional to make it more visible in case
> >>> some other code will be added which may use that pointer. We need
> >>> to keep a reference as long as we use the pointer.
> >>>
> >>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >>
> >> Answering for the series: we should make the change across all Intel
> >> machine drivers. I see at least four cases that were missed
> >>
> >> bytcr_rt5640.c:         put_device(&adev->dev);
> >> bytcr_rt5651.c:         put_device(&adev->dev);
> >> bytcr_wm5102.c: put_device(&adev->dev);
> >> sof_es8336.c:           put_device(&adev->dev);
> > 
> > Aren't they (they all problematic, btw) covered by the fixes series
> > https://lore.kernel.org/r/20230102203014.16041-1-andriy.shevchenko@linux.intel.com?
> 
> They are indeed, but if you group AMD-related patches with Intel ones,
> it's only human for reviewers to skip the thread entirely, even more so
> when catching up with email on January 3 :-)

Ah, I will try to remember to split also by platform (there are not many that's
why I decided to group them by the problem type only).

> For this series
> 
> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Thank you and HNY!
Andy Shevchenko Jan. 4, 2023, 4:48 p.m. UTC | #6
On Wed, Jan 04, 2023 at 04:42:28PM +0000, Mark Brown wrote:
> On Wed, Jan 04, 2023 at 08:15:27AM -0600, Pierre-Louis Bossart wrote:
> 
> > For this series
> 
> > Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> According to b4 you've only acked the first patch here because Andy
> doesn't send cover letters :/

Is b4 capable to spread tags from cover letter to the whole series?
(Sorry, I'm a bit outdated with all Swiss-knife possibilities that
 b4 provides)
Mark Brown Jan. 4, 2023, 5:16 p.m. UTC | #7
On Wed, Jan 04, 2023 at 06:48:11PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 04, 2023 at 04:42:28PM +0000, Mark Brown wrote:

> > According to b4 you've only acked the first patch here because Andy
> > doesn't send cover letters :/

> Is b4 capable to spread tags from cover letter to the whole series?
> (Sorry, I'm a bit outdated with all Swiss-knife possibilities that
>  b4 provides)

Yes, it does that.
Andy Shevchenko Jan. 4, 2023, 6:55 p.m. UTC | #8
On Wed, Jan 04, 2023 at 05:16:04PM +0000, Mark Brown wrote:
> On Wed, Jan 04, 2023 at 06:48:11PM +0200, Andy Shevchenko wrote:
> > On Wed, Jan 04, 2023 at 04:42:28PM +0000, Mark Brown wrote:
> 
> > > According to b4 you've only acked the first patch here because Andy
> > > doesn't send cover letters :/
> 
> > Is b4 capable to spread tags from cover letter to the whole series?
> > (Sorry, I'm a bit outdated with all Swiss-knife possibilities that
> >  b4 provides)
> 
> Yes, it does that.

Oh, cool to know! So it makes a lot of sense to create the cover letters
even for straightforward independent changes that are united into the
series for the easy handling.

Thank you!

P.S. Tell me if I need to resend with tags applied this time?
Mark Brown Jan. 5, 2023, 11:46 a.m. UTC | #9
On Wed, Jan 04, 2023 at 08:55:31PM +0200, Andy Shevchenko wrote:

> P.S. Tell me if I need to resend with tags applied this time?

No.
Mark Brown Jan. 6, 2023, 5:04 p.m. UTC | #10
On Mon, 02 Jan 2023 22:30:33 +0200, Andy Shevchenko wrote:
> Instead of calling put_device(&adev->dev) where adev is a pointer
> to an ACPI device, use specific call, i.e. acpi_dev_put().
> 
> Also move it out of the conditional to make it more visible in case
> some other code will be added which may use that pointer. We need
> to keep a reference as long as we use the pointer.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/5] ASoC: Intel: bytcht_cx2072x: Replace open coded acpi_dev_put()
      commit: 7baff1a9debc5f4ff0d6bc1496358e251f66e396
[2/5] ASoC: Intel: bytcht_da7213: Replace open coded acpi_dev_put()
      commit: 4afda6de02285758c9b892a2e79658966d3cfbb0
[3/5] ASoC: Intel: cht_bsw_rt5645: Replace open coded acpi_dev_put()
      commit: 5360a1c0f251b8000e9b2ea7b9f9e40c2e8f1c83
[4/5] ASoC: Intel: cht_bsw_rt5672: Replace open coded acpi_dev_put()
      commit: 6736dd4e5b58f27983ab3dba5fa96ed97768beaf
[5/5] ASoC: Intel: sof-wm8804: Replace open coded acpi_dev_put()
      commit: 892dbe0ecf658fd23e0a7255fca26a216cf54f96

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Andy Shevchenko Jan. 9, 2023, 10:55 a.m. UTC | #11
On Wed, Jan 04, 2023 at 08:15:27AM -0600, Pierre-Louis Bossart wrote:
> On 1/4/23 04:29, Andy Shevchenko wrote:
> > On Tue, Jan 03, 2023 at 09:08:20AM -0600, Pierre-Louis Bossart wrote:
> >> On 1/2/23 14:30, Andy Shevchenko wrote:

...

> >> I see at least four cases that were missed
> >>
> >> bytcr_rt5640.c:         put_device(&adev->dev);
> >> bytcr_rt5651.c:         put_device(&adev->dev);
> >> bytcr_wm5102.c: put_device(&adev->dev);
> >> sof_es8336.c:           put_device(&adev->dev);
> > 
> > Aren't they (they all problematic, btw) covered by the fixes series
> > https://lore.kernel.org/r/20230102203014.16041-1-andriy.shevchenko@linux.intel.com?
> 
> They are indeed, but if you group AMD-related patches with Intel ones,
> it's only human for reviewers to skip the thread entirely, even more so
> when catching up with email on January 3 :-)

I'm not sure what should I do about that series. Shall I split AMD and Intel
parts? (Assuming Intel will go as a series with cover letter.)
diff mbox series

Patch

diff --git a/sound/soc/intel/boards/bytcht_cx2072x.c b/sound/soc/intel/boards/bytcht_cx2072x.c
index 41cec67157b6..9942a2de6f7a 100644
--- a/sound/soc/intel/boards/bytcht_cx2072x.c
+++ b/sound/soc/intel/boards/bytcht_cx2072x.c
@@ -253,9 +253,9 @@  static int snd_byt_cht_cx2072x_probe(struct platform_device *pdev)
 	if (adev) {
 		snprintf(codec_name, sizeof(codec_name), "i2c-%s",
 			 acpi_dev_name(adev));
-		put_device(&adev->dev);
 		byt_cht_cx2072x_dais[dai_index].codecs->name = codec_name;
 	}
+	acpi_dev_put(adev);
 
 	/* override platform name, if required */
 	ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_cx2072x_card,