diff mbox series

[alsa-devel@alsa-project.org:,[PATCH,3/5] ASoC: mediatek: mt8195-afe-pcm: Simplify runtime PM during probe]

Message ID ZFMF2cD3nPgpZOpa@finisterre.sirena.org.uk
State New
Headers show
Series None | expand

Commit Message

Mark Brown May 4, 2023, 1:09 a.m. UTC
Hi,

Here's another mail (one of several in this series) that got completely
mangled by the alsa-project.org mailman to the point of unusability.  I
didn't see any response to my last mail about this, is there any news on
fixing mailman to not do this?  It's extremely disruptive to working
with lore.

Thanks,
Mark
Use devm_pm_runtime_enable() and pm_runtime_resume_and_get() to
to simplify the probe function.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

Comments

Takashi Iwai May 4, 2023, 7:58 a.m. UTC | #1
On Thu, 04 May 2023 09:35:38 +0200,
Takashi Iwai wrote:
> 
> On Thu, 04 May 2023 03:09:45 +0200,
> Mark Brown wrote:
> > 
> > Hi,
> > 
> > Here's another mail (one of several in this series) that got completely
> > mangled by the alsa-project.org mailman to the point of unusability.  I
> > didn't see any response to my last mail about this, is there any news on
> > fixing mailman to not do this?  It's extremely disruptive to working
> > with lore.
> 
> It seems that alsa-project.org mailman re-sends the post with
> xxx@alsa-project.org address sometimes, indeed.  I don't know the
> condition, but now I noticed it while checking the pending approvals.

And, I guess it happens when a post comes from a non-subscriber.
(But not sure whether this happens always...)
It waits for approval, but also mangles the sender address and co.
This behavior is new after the mail server update.

> Those that appeared in the list wrongly were likely the posts I
> approved without knowing them being superfluously resent ones.
> 
> Jaroslav, could you check your mailman configuration?

So, please check the configuration.  As of now, the post from
non-subscriber becomes confusing and unusable for b4.


thanks,

Takashi

> 
> 
> thanks,
> 
> Takashi
> 
> > Thanks,
> > Mark
> > Subject: [PATCH 3/5] ASoC: mediatek: mt8195-afe-pcm: Simplify runtime PM during probe
> > From: AngeloGioacchino Del Regno via Alsa-devel <alsa-devel@alsa-project.org>
> > Date: Wed, 03 May 2023 13:34:11 +0200
> > Message-Id: <168311377075.26.14919941665402646886@mailman-core.alsa-project.org>
> > MIME-Version: 1.0
> > Content-Transfer-Encoding: 7bit
> > 
> > Use devm_pm_runtime_enable() and pm_runtime_resume_and_get() to
> > to simplify the probe function.
> > 
> > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > ---
> >  sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 22 ++++++++++++----------
> >  1 file changed, 12 insertions(+), 10 deletions(-)
> > 
> > diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
> > index 9e45efeada55..a54c16e0aa05 100644
> > --- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
> > +++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
> > @@ -3179,16 +3179,16 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
> >  
> >  	mt8195_afe_parse_of(afe, pdev->dev.of_node);
> >  
> > -	pm_runtime_enable(dev);
> > -	if (!pm_runtime_enabled(dev)) {
> > -		ret = mt8195_afe_runtime_resume(dev);
> > -		if (ret)
> > -			return ret;
> > -	}
> > -
> >  	/* enable clock for regcache get default value from hw */
> >  	afe_priv->pm_runtime_bypass_reg_ctl = true;
> > -	pm_runtime_get_sync(dev);
> > +
> > +	ret = devm_pm_runtime_enable(dev);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = pm_runtime_resume_and_get(dev);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Failed to resume device\n");
> >  
> >  	afe->regmap = devm_regmap_init_mmio(&pdev->dev, afe->base_addr,
> >  					    &mt8195_afe_regmap_config);
> > @@ -3238,7 +3238,10 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
> >  
> >  	mt8195_afe_init_registers(afe);
> >  
> > -	pm_runtime_put_sync(dev);
> > +	ret = pm_runtime_put_sync(dev);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Failed to suspend device\n");
> > +
> >  	afe_priv->pm_runtime_bypass_reg_ctl = false;
> >  
> >  	regcache_cache_only(afe->regmap, true);
> > @@ -3248,7 +3251,6 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
> >  
> >  err_pm_put:
> >  	pm_runtime_put_sync(dev);
> > -	pm_runtime_disable(dev);
> >  
> >  	return ret;
> >  }
> > -- 
> > 2.40.1
Geraldo Nascimento May 5, 2023, 8:38 p.m. UTC | #2
On Thu, May 04, 2023 at 10:09:45AM +0900, Mark Brown wrote:
> Hi,
> 
> Here's another mail (one of several in this series) that got completely
> mangled by the alsa-project.org mailman to the point of unusability.  I
> didn't see any response to my last mail about this, is there any news on
> fixing mailman to not do this?  It's extremely disruptive to working
> with lore.

Hi Mark,

Are you complaining about the added headers in the message? Because the
patch itself didn't look mangled from my side. From my understanding,
Jaroslav had to start mangling mail addresses due to strict DMARC rules
which make some servers reject the message from alsa-devel.

Thanks,
Geraldo Nascimento

> 
> Thanks,
> Mark
Mark Brown May 6, 2023, 12:13 a.m. UTC | #3
On Fri, May 05, 2023 at 05:38:28PM -0300, Geraldo Nascimento wrote:
> On Thu, May 04, 2023 at 10:09:45AM +0900, Mark Brown wrote:

> > Here's another mail (one of several in this series) that got completely
> > mangled by the alsa-project.org mailman to the point of unusability.  I
> > didn't see any response to my last mail about this, is there any news on
> > fixing mailman to not do this?  It's extremely disruptive to working
> > with lore.

> Are you complaining about the added headers in the message? Because the
> patch itself didn't look mangled from my side. From my understanding,
> Jaroslav had to start mangling mail addresses due to strict DMARC rules
> which make some servers reject the message from alsa-devel.

Not just the headers in the message, the author information for the mail
also got rewritten.  Try applying the patches with git am...
Geraldo Nascimento May 6, 2023, 2:17 a.m. UTC | #4
On Sat, May 06, 2023 at 09:13:06AM +0900, Mark Brown wrote:
> On Fri, May 05, 2023 at 05:38:28PM -0300, Geraldo Nascimento wrote:
> > On Thu, May 04, 2023 at 10:09:45AM +0900, Mark Brown wrote:
> 
> > > Here's another mail (one of several in this series) that got completely
> > > mangled by the alsa-project.org mailman to the point of unusability.  I
> > > didn't see any response to my last mail about this, is there any news on
> > > fixing mailman to not do this?  It's extremely disruptive to working
> > > with lore.
> 
> > Are you complaining about the added headers in the message? Because the
> > patch itself didn't look mangled from my side. From my understanding,
> > Jaroslav had to start mangling mail addresses due to strict DMARC rules
> > which make some servers reject the message from alsa-devel.
> 
> Not just the headers in the message, the author information for the mail
> also got rewritten.  Try applying the patches with git am...

Mark, I think Jaroslav can change the behaviour in the the added Headers in the
body of the message (the added Headers in the body have e.g. the correct From:
email information).

If the message body *starts* with the "From:", "Subject:" and "Date:" fields
I think git-am will pickup the correct information from the body instead of from
the mangled headers.

Hopefully...

Good luck,
Geraldo Nascimento
Mark Brown May 7, 2023, 11:33 p.m. UTC | #5
On Fri, May 05, 2023 at 11:17:19PM -0300, Geraldo Nascimento wrote:
> On Sat, May 06, 2023 at 09:13:06AM +0900, Mark Brown wrote:

> > Not just the headers in the message, the author information for the mail
> > also got rewritten.  Try applying the patches with git am...

> Mark, I think Jaroslav can change the behaviour in the the added Headers in the
> body of the message (the added Headers in the body have e.g. the correct From:
> email information).

> If the message body *starts* with the "From:", "Subject:" and "Date:" fields
> I think git-am will pickup the correct information from the body instead of from
> the mangled headers.

> Hopefully...

No, it absolutely doesn't work properly - I only noticed this was
happening because b4/lore keep picking the copy from alsa-devel which is
mangled to the point of not being usable.
Geraldo Nascimento May 7, 2023, 11:38 p.m. UTC | #6
On Mon, May 08, 2023 at 08:33:59AM +0900, Mark Brown wrote:
> On Fri, May 05, 2023 at 11:17:19PM -0300, Geraldo Nascimento wrote:
> > On Sat, May 06, 2023 at 09:13:06AM +0900, Mark Brown wrote:
> 
> > > Not just the headers in the message, the author information for the mail
> > > also got rewritten.  Try applying the patches with git am...
> 
> > Mark, I think Jaroslav can change the behaviour in the the added Headers in the
> > body of the message (the added Headers in the body have e.g. the correct From:
> > email information).
> 
> > If the message body *starts* with the "From:", "Subject:" and "Date:" fields
> > I think git-am will pickup the correct information from the body instead of from
> > the mangled headers.
> 
> > Hopefully...
> 
> No, it absolutely doesn't work properly - I only noticed this was
> happening because b4/lore keep picking the copy from alsa-devel which is
> mangled to the point of not being usable.

Hi Mark, sorry to hear that. The fact mailman is disrupting your
workflow as ASoC maintainer is alarming, and I hope you and Jaroslav can
work out a solution. But besides my suggestion that the added headers in
the body of the message *start* with at least the correct "From:" field,
I can't be of much help.

Thanks for the hard work,
Geraldo Nascimento
Takashi Iwai May 8, 2023, 7:52 a.m. UTC | #7
On Thu, 04 May 2023 09:58:44 +0200,
Takashi Iwai wrote:
> 
> On Thu, 04 May 2023 09:35:38 +0200,
> Takashi Iwai wrote:
> > 
> > On Thu, 04 May 2023 03:09:45 +0200,
> > Mark Brown wrote:
> > > 
> > > Hi,
> > > 
> > > Here's another mail (one of several in this series) that got completely
> > > mangled by the alsa-project.org mailman to the point of unusability.  I
> > > didn't see any response to my last mail about this, is there any news on
> > > fixing mailman to not do this?  It's extremely disruptive to working
> > > with lore.
> > 
> > It seems that alsa-project.org mailman re-sends the post with
> > xxx@alsa-project.org address sometimes, indeed.  I don't know the
> > condition, but now I noticed it while checking the pending approvals.
> 
> And, I guess it happens when a post comes from a non-subscriber.
> (But not sure whether this happens always...)
> It waits for approval, but also mangles the sender address and co.
> This behavior is new after the mail server update.

Jaroslav, could you investigate it?  I checked again, and it seems
that all "approved" posts from non-subscribers are modified to the
sender addresses with alsa-project.org.  I guess there must be some
option to prevent it.


Takashi

> > Those that appeared in the list wrongly were likely the posts I
> > approved without knowing them being superfluously resent ones.
> > 
> > Jaroslav, could you check your mailman configuration?
> 
> So, please check the configuration.  As of now, the post from
> non-subscriber becomes confusing and unusable for b4.
> 
> 
> thanks,
> 
> Takashi
> 
> > 
> > 
> > thanks,
> > 
> > Takashi
> > 
> > > Thanks,
> > > Mark
> > > Subject: [PATCH 3/5] ASoC: mediatek: mt8195-afe-pcm: Simplify runtime PM during probe
> > > From: AngeloGioacchino Del Regno via Alsa-devel <alsa-devel@alsa-project.org>
> > > Date: Wed, 03 May 2023 13:34:11 +0200
> > > Message-Id: <168311377075.26.14919941665402646886@mailman-core.alsa-project.org>
> > > MIME-Version: 1.0
> > > Content-Transfer-Encoding: 7bit
> > > 
> > > Use devm_pm_runtime_enable() and pm_runtime_resume_and_get() to
> > > to simplify the probe function.
> > > 
> > > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > > ---
> > >  sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 22 ++++++++++++----------
> > >  1 file changed, 12 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
> > > index 9e45efeada55..a54c16e0aa05 100644
> > > --- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
> > > +++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
> > > @@ -3179,16 +3179,16 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
> > >  
> > >  	mt8195_afe_parse_of(afe, pdev->dev.of_node);
> > >  
> > > -	pm_runtime_enable(dev);
> > > -	if (!pm_runtime_enabled(dev)) {
> > > -		ret = mt8195_afe_runtime_resume(dev);
> > > -		if (ret)
> > > -			return ret;
> > > -	}
> > > -
> > >  	/* enable clock for regcache get default value from hw */
> > >  	afe_priv->pm_runtime_bypass_reg_ctl = true;
> > > -	pm_runtime_get_sync(dev);
> > > +
> > > +	ret = devm_pm_runtime_enable(dev);
> > > +	if (ret)
> > > +		return ret;
> > > +
> > > +	ret = pm_runtime_resume_and_get(dev);
> > > +	if (ret)
> > > +		return dev_err_probe(dev, ret, "Failed to resume device\n");
> > >  
> > >  	afe->regmap = devm_regmap_init_mmio(&pdev->dev, afe->base_addr,
> > >  					    &mt8195_afe_regmap_config);
> > > @@ -3238,7 +3238,10 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
> > >  
> > >  	mt8195_afe_init_registers(afe);
> > >  
> > > -	pm_runtime_put_sync(dev);
> > > +	ret = pm_runtime_put_sync(dev);
> > > +	if (ret)
> > > +		return dev_err_probe(dev, ret, "Failed to suspend device\n");
> > > +
> > >  	afe_priv->pm_runtime_bypass_reg_ctl = false;
> > >  
> > >  	regcache_cache_only(afe->regmap, true);
> > > @@ -3248,7 +3251,6 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
> > >  
> > >  err_pm_put:
> > >  	pm_runtime_put_sync(dev);
> > > -	pm_runtime_disable(dev);
> > >  
> > >  	return ret;
> > >  }
> > > -- 
> > > 2.40.1
Jaroslav Kysela May 9, 2023, 7:12 a.m. UTC | #8
On 08. 05. 23 9:52, Takashi Iwai wrote:
> On Thu, 04 May 2023 09:58:44 +0200,
> Takashi Iwai wrote:
>>
>> On Thu, 04 May 2023 09:35:38 +0200,
>> Takashi Iwai wrote:
>>>
>>> On Thu, 04 May 2023 03:09:45 +0200,
>>> Mark Brown wrote:
>>>>
>>>> Hi,
>>>>
>>>> Here's another mail (one of several in this series) that got completely
>>>> mangled by the alsa-project.org mailman to the point of unusability.  I
>>>> didn't see any response to my last mail about this, is there any news on
>>>> fixing mailman to not do this?  It's extremely disruptive to working
>>>> with lore.
>>>
>>> It seems that alsa-project.org mailman re-sends the post with
>>> xxx@alsa-project.org address sometimes, indeed.  I don't know the
>>> condition, but now I noticed it while checking the pending approvals.
>>
>> And, I guess it happens when a post comes from a non-subscriber.
>> (But not sure whether this happens always...)
>> It waits for approval, but also mangles the sender address and co.
>> This behavior is new after the mail server update.
> 
> Jaroslav, could you investigate it?  I checked again, and it seems
> that all "approved" posts from non-subscribers are modified to the
> sender addresses with alsa-project.org.  I guess there must be some
> option to prevent it.

The answer is DMARC. And the "mangling" applies only to senders which domains 
have restricted DMARC settings (reject or quarantine) - collabora.com has 
quarantine. More information:

https://lore.kernel.org/alsa-devel/6f003598-4cae-a521-233f-2c19eb439359@perex.cz/

I am open to any suggestions, but the default mailman settings (do not do 
anything) causes that some (mostly gmail) users do not receive their e-mails 
because the ALSA's mail server has a bad reputation. Many companies are using 
the google mail service for their domains nowadays.

The information is not lost - the original e-mail is just encapsulated (as an 
attachmnent) to new with the "allowed from" header for DMARC. But yes, it 
requires some more work (reply to the attachment, update scripts).

					Jaroslav
Mark Brown May 9, 2023, 9:37 a.m. UTC | #9
On Tue, May 09, 2023 at 09:12:55AM +0200, Jaroslav Kysela wrote:
> On 08. 05. 23 9:52, Takashi Iwai wrote:

[alsa-devel rewriting mails in a way that renders them useless with b4]

> > Jaroslav, could you investigate it?  I checked again, and it seems
> > that all "approved" posts from non-subscribers are modified to the
> > sender addresses with alsa-project.org.  I guess there must be some
> > option to prevent it.

> The answer is DMARC. And the "mangling" applies only to senders which
> domains have restricted DMARC settings (reject or quarantine) -
> collabora.com has quarantine. More information:

> https://lore.kernel.org/alsa-devel/6f003598-4cae-a521-233f-2c19eb439359@perex.cz/

> I am open to any suggestions, but the default mailman settings (do not do
> anything) causes that some (mostly gmail) users do not receive their e-mails
> because the ALSA's mail server has a bad reputation. Many companies are
> using the google mail service for their domains nowadays.

> The information is not lost - the original e-mail is just encapsulated (as
> an attachmnent) to new with the "allowed from" header for DMARC. But yes, it
> requires some more work (reply to the attachment, update scripts).

Copying in Konstantin - as I said this is massively disruptive to using
b4 with anything that's been mangled, to the point where the messages
are unusable without substantial manual mangling (and signature
verification fails too).  It'd be more usable to just not have the
messages from the list getting to lore and manually bounce patches to
the list.  

Is it possible to take steps to improve the reptuation of the ALSA
servers so this isn't needed, or could we migrate the lists elsewhere (I
know we set up linux-sound@vger at one point with the idea of
migrating).
Mark Brown May 9, 2023, 2:35 p.m. UTC | #10
On Tue, May 09, 2023 at 11:54:18AM +0200, Jaroslav Kysela wrote:

> The signature is correct in the encapsulated original e-mail. The b4 should
> be improved in my opinion.

It's not b4 that's the issue here except in that it causes me to fetch
copies of the message that went to the list instead of my inbox which
didn't get mangled by the list.  git am just does not understand what's
happening with attachments.  For example for:

   168198605952.26.13645408104113633580@mailman-core.alsa-project.org

if I try to apply it the top of the commit message looks like:

| commit 8f0e0ee514b189cf7b4e7fa09581e3f1d246fa09 (HEAD -> tmp)
| Author: Richard Fitzgerald via Alsa-devel <alsa-devel@alsa-project.org>
| Date:   Thu Apr 20 11:20:43 2023 +0100
|
|     ASoC: cs35l56: Remove duplicate mbox log messages
|    
|     Received: by alsa1.perex.cz (Postfix, from userid 50401)
|             id 7A47CF80155; Thu, 20 Apr 2023 12:20:56 +0200 (CEST)
|     X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on alsa1.perex.cz

with all the headers dumped in there which is just completely mangled.
Note the rewritten author.  

mutt also represents this incredibly badly, it just shows the
"attachment" as the body of the message with all the headers dumped in
like they're just plain text in the body of the mail - I wouldn't have
thought this was an attachment if it hadn't been mentioned in this
thread, none of the atacment UI shows.  To reverse the mangling you have
to view attachments then save the root of the message to a folder.  AIUI
mutt assumes that whatever the root of the message is is intended to be
the message body and does the best it can to display it as such.

Lore *does* show the body of the message as an attachment.

> As you see, the header and all signatures are correct in the attachment:

None of our tooling or processes understand this, they're working with
the top level message.

> > Is it possible to take steps to improve the reptuation of the ALSA
> > servers so this isn't needed, or could we migrate the lists elsewhere (I

> It is not possible to talk with gmail administrators. I tried that several
> times. The outgoing ALSA server is not on any spam list.

I know there is a lot of discussion going round about which hoops to
jump through to play nice with gmail, I don't know if there's any new
stuff that's come up there recently.

> > know we set up linux-sound@vger at one point with the idea of
> > migrating).

> I guess that the vger servers have similar issues, because servers with
> DMARC enabled on the ingress side can reject e-mails. It's related to e-mail
> standards.

The issue I'm seeing here is the rewriting which I'm not aware of any
other lists having turned on, even infradead ones which are also mailman
based.  Either they're just tolerating people having issues with gmail
(which seems reasonable TBH) or they're jumping through some additional
hoops to avoid issues.

I believe vger does sometimes manage some backchannel which probably
helps it somewhat.
Jaroslav Kysela May 9, 2023, 6:03 p.m. UTC | #11
On 09. 05. 23 16:35, Mark Brown wrote:
> On Tue, May 09, 2023 at 11:54:18AM +0200, Jaroslav Kysela wrote:
> 
>> The signature is correct in the encapsulated original e-mail. The b4 should
>> be improved in my opinion.
> 
> It's not b4 that's the issue here except in that it causes me to fetch
> copies of the message that went to the list instead of my inbox which
> didn't get mangled by the list.  git am just does not understand what's

b4 can detect, if the e-mail is wrapped and use only the wrapped message. The 
wrapping is the correct semantics per mailman 3 not mangling (see [1]).

https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/handlers/docs/dmarc-mitigations.html

> happening with attachments.  For example for:
> 
>     168198605952.26.13645408104113633580@mailman-core.alsa-project.org
> 
> if I try to apply it the top of the commit message looks like:
> 
> | commit 8f0e0ee514b189cf7b4e7fa09581e3f1d246fa09 (HEAD -> tmp)
> | Author: Richard Fitzgerald via Alsa-devel <alsa-devel@alsa-project.org>
> | Date:   Thu Apr 20 11:20:43 2023 +0100
> |
> |     ASoC: cs35l56: Remove duplicate mbox log messages
> |
> |     Received: by alsa1.perex.cz (Postfix, from userid 50401)
> |             id 7A47CF80155; Thu, 20 Apr 2023 12:20:56 +0200 (CEST)
> |     X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on alsa1.perex.cz
> 
> with all the headers dumped in there which is just completely mangled.
> Note the rewritten author.

You should apply the wrapped message not the capsule.

> mutt also represents this incredibly badly, it just shows the
> "attachment" as the body of the message with all the headers dumped in
> like they're just plain text in the body of the mail - I wouldn't have
> thought this was an attachment if it hadn't been mentioned in this
> thread, none of the atacment UI shows.  To reverse the mangling you have
> to view attachments then save the root of the message to a folder.  AIUI
> mutt assumes that whatever the root of the message is is intended to be
> the message body and does the best it can to display it as such.

I think that you can configure the tool to process this attachment in mutt.

> Lore *does* show the body of the message as an attachment.

Yes, the original message is in the attachment - no information is lost.

>> As you see, the header and all signatures are correct in the attachment:
> 
> None of our tooling or processes understand this, they're working with
> the top level message.
> 
>>> Is it possible to take steps to improve the reptuation of the ALSA
>>> servers so this isn't needed, or could we migrate the lists elsewhere (I
> 
>> It is not possible to talk with gmail administrators. I tried that several
>> times. The outgoing ALSA server is not on any spam list.
> 
> I know there is a lot of discussion going round about which hoops to
> jump through to play nice with gmail, I don't know if there's any new
> stuff that's come up there recently.
> 
>>> know we set up linux-sound@vger at one point with the idea of
>>> migrating).
> 
>> I guess that the vger servers have similar issues, because servers with
>> DMARC enabled on the ingress side can reject e-mails. It's related to e-mail
>> standards.
> 
> The issue I'm seeing here is the rewriting which I'm not aware of any
> other lists having turned on, even infradead ones which are also mailman
> based.  Either they're just tolerating people having issues with gmail
> (which seems reasonable TBH) or they're jumping through some additional
> hoops to avoid issues.

I checked infradead and they're using mailman 2. Mailman 2 does not support 
DMARC mitigation.

> I believe vger does sometimes manage some backchannel which probably
> helps it somewhat.

Using a non-standard mechanism is not a big win.

DMARC is a internet standard - see RFC7489, RFC8616. It means that the mailing 
lists cannot send e-mails with From from other domains which have restricted 
policies set by *their* administrators. So basically, all mail servers 
violates this if they keep the From header. Mailman 3 implemented several 
types of mitigations and the message wrap is the best one in my eyes. The 
mangling of the From header or reject e-mails from those senders is even worse 
(see [1]).

When I turn off the mitigation in mailman, my ALSA server will have bad 
reputation for gmail users soon in an unpredictable manner. I also saw that 
ATT incoming mail servers had similar issues. We can expect that the list of 
the ingress SMTP servers not accepting e-mails based on the DMARC policy will 
grow. It's something that we don't have under control.

If we don't find that it's time to move forward and accept this policy, I can 
turn off the mitigation, but in a cost that gmail (and soon maybe other) users 
will bomb me (they already did last years) that the ALSA mail server does not 
deliver e-mails for them. Are we a community on internet or not?

Ideally, we should start upgrade and fix our tools...

Let me just know, if you (and Takashi) insist to turn the mitigation off after 
this discussion. I'll do so...

					Jaroslav

[1] 
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/handlers/docs/dmarc-mitigations.html
Konstantin Ryabitsev May 9, 2023, 6:26 p.m. UTC | #12
On Tue, May 09, 2023 at 08:03:39PM +0200, Jaroslav Kysela wrote:
> DMARC is a internet standard - see RFC7489, RFC8616. It means that the
> mailing lists cannot send e-mails with From from other domains which have
> restricted policies set by *their* administrators. So basically, all mail
> servers violates this if they keep the From header.

This is not correct. Operating a mailing list server is perfectly
DMARC-compliant as long as:

- messages have DKIM signatures
- ML software doesn't modify any of the signed headers
- ML software doesn't touch the body

-K
Chen-Yu Tsai May 10, 2023, 3:01 a.m. UTC | #13
On Wed, May 10, 2023 at 1:52 AM Geraldo Nascimento
<geraldogabriel@gmail.com> wrote:
>
> On Tue, May 09, 2023 at 09:12:55AM +0200, Jaroslav Kysela wrote:
> > I am open to any suggestions, but the default mailman settings (do not do
> > anything) causes that some (mostly gmail) users do not receive their e-mails
> > because the ALSA's mail server has a bad reputation. Many companies are using
> > the google mail service for their domains nowadays.
> >
>
> As a GMail user, I can confirm that I'm not seeing any more bounces
> after mangling started. Usually it'd bounce and I'd have to login to the
> web interface to turn back on my subscription, a real pain.

FWIW the dri-devel mailing list seems to implement an alternative strategy
for dealing with Gmail and co. bouncing messages. If it gets bounces it will
send a separate "bounce probe" email including details about what bounced.
It will not just deactivate a subscription due to bounces.

Also, ALSA's mailing list now requires a subscriber to register a user
account to resume delivery is a bit annoying.


ChenYu
Jaroslav Kysela May 10, 2023, 6:17 a.m. UTC | #14
On 10. 05. 23 5:58, Geraldo Nascimento wrote:
> On Wed, May 10, 2023 at 11:05:59AM +0900, Mark Brown wrote:
>> AFAICT the only other option is munging the From without enclosing the
>> message in a wrapper?  That's potentially marginally less harmful but
>> it's still going to break things badly enough that I'm not sure it's a
>> worthwhile improvement.
> 
> The readymade mitigations for DMARC in mailman 3 are
> "munge_from" and "wrap_message". The fact "wrap_message" messes
> around with signatures in mutt is definitely not a good sign,
> and "munge_from" will change the author's email and name from
> the perspective of git-am.
> 
> The middle way could be to patch mailman 3 to "munge_from" while adding
> the correct "From:" as the first thing in the body of the message if it
> doesn't contain one already. This will make git-am pickup the correct
> author's details and it should be some simple logic.

Unfortunately, changing the message body will break the DKIM message integrity 
(body hash)...

				Jaroslav
Konstantin Ryabitsev May 10, 2023, 3:13 p.m. UTC | #15
On Wed, May 10, 2023 at 08:17:30AM +0200, Jaroslav Kysela wrote:
> > The middle way could be to patch mailman 3 to "munge_from" while adding
> > the correct "From:" as the first thing in the body of the message if it
> > doesn't contain one already. This will make git-am pickup the correct
> > author's details and it should be some simple logic.
> 
> Unfortunately, changing the message body will break the DKIM message
> integrity (body hash)...

If you change the From: header, the DKIM signature doesn't matter any more, so
this will work just fine.

-K
Jaroslav Kysela May 10, 2023, 4:19 p.m. UTC | #16
On 10. 05. 23 17:34, Konstantin Ryabitsev wrote:

> So, I'm just going to repeat this: operating a mailing list and remaining
> DMARC compliant is perfectly possible, provided:
> 
> - the original message is DKIM-signed
> - all existing headers are unmodified
> - the message body is unmodified

Example of e-mail which is rejected by google's mx servers:

https://lore.kernel.org/alsa-devel/20230510142227.32945-1-vitalyr@opensource.cirrus.com/raw

 From the postfix e-mail queue:

https://gist.github.com/perexg/ac06eacd8b3a8f741ef5602ec748e0a8

SMTP error:

reason=host alt1.aspmx.l.google.com[142.251.9.27] said: 550-5.7.26 
Unauthenticated email from cirrus.com is not accepted due to domain's 
550-5.7.26 DMARC policy. Please contact the administrator of cirrus.com domain 
550-5.7.26 if this was a legitimate mail. Please visit 550-5.7.26 
https://support.google.com/mail/answer/2451690 to learn about the 450 4.7.26 
DMARC initiative. mz11-20020a1709071b8b00b009665976cbddsi3525670ejc.170 - 
gsmtp (in reply to end of DATA command)

				Jaroslav
Geraldo Nascimento May 10, 2023, 5:15 p.m. UTC | #17
On Wed, May 10, 2023 at 11:13:15AM -0400, Konstantin Ryabitsev wrote:
> On Wed, May 10, 2023 at 08:17:30AM +0200, Jaroslav Kysela wrote:
> > > The middle way could be to patch mailman 3 to "munge_from" while adding
> > > the correct "From:" as the first thing in the body of the message if it
> > > doesn't contain one already. This will make git-am pickup the correct
> > > author's details and it should be some simple logic.
> > 
> > Unfortunately, changing the message body will break the DKIM message
> > integrity (body hash)...
> 
> If you change the From: header, the DKIM signature doesn't matter any more, so
> this will work just fine.

Hi Konstantin,

I'm reading RFC 6377 from September 2001, "DKIM and Mailing Lists", and
the approach you say would work just fine I think is covered on section
5.7.,  "Signature Removal Issues".

Regards,
Geraldo Nascimento

> 
> -K
Jaroslav Kysela May 10, 2023, 6:38 p.m. UTC | #18
On 10. 05. 23 18:43, Konstantin Ryabitsev wrote:
> On Wed, May 10, 2023 at 06:19:15PM +0200, Jaroslav Kysela wrote:
>> On 10. 05. 23 17:34, Konstantin Ryabitsev wrote:
>>
>>> So, I'm just going to repeat this: operating a mailing list and remaining
>>> DMARC compliant is perfectly possible, provided:
>>>
>>> - the original message is DKIM-signed
>>> - all existing headers are unmodified
>>> - the message body is unmodified
>>
>> Example of e-mail which is rejected by google's mx servers:
>>
>> https://lore.kernel.org/alsa-devel/20230510142227.32945-1-vitalyr@opensource.cirrus.com/raw
> 
> Thank you for this example -- it plainly illustrates the problem, which is
> that Mailman 3 mangles messages.
> 
> If you compare the above message with the message that passed via vger, you
> will notice what went wrong:
> 
>      -CC:     <alsa-devel@alsa-project.org>, <patches@opensource.cirrus.com>,
>      -        <linux-kernel@vger.kernel.org>,
>      -        Vitaly Rodionov <vitalyr@opensource.cirrus.com>
>      +CC: alsa-devel@alsa-project.org, patches@opensource.cirrus.com,
>      + linux-kernel@vger.kernel.org, Vitaly Rodionov <vitalyr@opensource.cirrus.com>
> 
> For some bizarre reason Mailman-3 decided to make the CC header "more pretty"
> by stripping the angle brackets around addresses. Since it's a DKIM-signed
> header, this invalidates the signature and results in DMARC violations.
> 
> The answer, unfortunately, is to stop using Mailman-3. It's not usable for
> patch-based workflows.

Whoops. It seems that mm3 guys knows about it:

https://gitlab.com/mailman/mailman/-/merge_requests/1039

I tried to apply the noted workaround. Crossing fingers.

Thank you for your help.

						Jaroslav
Mark Brown May 11, 2023, 5:58 a.m. UTC | #19
On Wed, May 10, 2023 at 08:38:03PM +0200, Jaroslav Kysela wrote:
> On 10. 05. 23 18:43, Konstantin Ryabitsev wrote:

> > Thank you for this example -- it plainly illustrates the problem, which is
> > that Mailman 3 mangles messages.

> Whoops. It seems that mm3 guys knows about it:

> https://gitlab.com/mailman/mailman/-/merge_requests/1039

> I tried to apply the noted workaround. Crossing fingers.

> Thank you for your help.

That's great - hopefully that resolves everything!
diff mbox series

Patch

diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
index 9e45efeada55..a54c16e0aa05 100644
--- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
+++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
@@ -3179,16 +3179,16 @@  static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
 
 	mt8195_afe_parse_of(afe, pdev->dev.of_node);
 
-	pm_runtime_enable(dev);
-	if (!pm_runtime_enabled(dev)) {
-		ret = mt8195_afe_runtime_resume(dev);
-		if (ret)
-			return ret;
-	}
-
 	/* enable clock for regcache get default value from hw */
 	afe_priv->pm_runtime_bypass_reg_ctl = true;
-	pm_runtime_get_sync(dev);
+
+	ret = devm_pm_runtime_enable(dev);
+	if (ret)
+		return ret;
+
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to resume device\n");
 
 	afe->regmap = devm_regmap_init_mmio(&pdev->dev, afe->base_addr,
 					    &mt8195_afe_regmap_config);
@@ -3238,7 +3238,10 @@  static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
 
 	mt8195_afe_init_registers(afe);
 
-	pm_runtime_put_sync(dev);
+	ret = pm_runtime_put_sync(dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to suspend device\n");
+
 	afe_priv->pm_runtime_bypass_reg_ctl = false;
 
 	regcache_cache_only(afe->regmap, true);
@@ -3248,7 +3251,6 @@  static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
 
 err_pm_put:
 	pm_runtime_put_sync(dev);
-	pm_runtime_disable(dev);
 
 	return ret;
 }