mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Johan Hovold <johan@kernel.org>, Zijun Hu <quic_zijuhu@quicinc.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Johan Hovold <johan+linaro@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] PM: sleep: wakeirq: Fix a serious logical error in dev_pm_disarm_wake_irq()
Date: Thu, 10 Oct 2024 21:24:34 +0800	[thread overview]
Message-ID: <d1438cf0-8bea-4125-a046-6e4abfbba2fd@icloud.com> (raw)
In-Reply-To: <ZvqigTC7RvngLpme@hovoldconsulting.com>

On 2024/9/30 21:07, Johan Hovold wrote:
> On Sat, Sep 28, 2024 at 02:26:27AM -0700, Zijun Hu wrote:
>> IT is a serious logical error for dev_pm_disarm_wake_irq() not to disable
>> the wake irq enabled by dev_pm_arm_wake_irq()
> 
> You need to explain *why* you believe this is an error.
> 

thank you for code review.
sorry to give reply late due to travel.

by convention, dev_pm_disarm_wake_irq() needs to undo the jobs done by
dev_pm_arm_wake_irq(). but actually it does not do that.

>> fixed by simply correcting
>> the wrong if condition.
> 
> Your commit message is basically just claims "P is wrong, fix P", which
> doesn't really explain anything.
> 
> Writing good commit messages explaining what the problem is is not just
> required because this is a collaborative project where others need to
> understand your reasoning, but it also forces you as the author to think
> through your changes, which can often prevent broken patches from being
> submitted in the first place.
> 

thanks for these good suggestions and will follow it for further patches
(^^)(^^)

>> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
>> ---
>> List relevant commits as following:
>>
>> johan+linaro@kernel.org  2023-07-13
>> Commit: 8527beb12087 ("PM: sleep: wakeirq: fix wake irq arming")
>>
>> tony@atomide.com  2018-02-09
>> Commit: 69728051f5bf ("PM / wakeirq: Fix unbalanced IRQ enable for wakeirq")
>>
>> The former commit fixes the later.
> 
> These references are relevant, but you need to include them in your
> commit messages (above ---) and explain why.
> 

got it, thank you

>> ---
>>  drivers/base/power/wakeirq.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
>> index 5a5a9e978e85..8b15f9a0e8f9 100644
>> --- a/drivers/base/power/wakeirq.c
>> +++ b/drivers/base/power/wakeirq.c
>> @@ -356,7 +356,7 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
>>  		disable_irq_wake(wirq->irq);
>>  
>>  		if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED &&
>> -		    !(wirq->status & WAKE_IRQ_DEDICATED_ENABLED))
>> +		    (wirq->status & WAKE_IRQ_DEDICATED_ENABLED))
>>  			disable_irq_nosync(wirq->irq);
> 
> I think the current code works as intended.
>

thank you for this point and let me do more investigation.
(^^)

>>  	}
>>  }
> 
> Johan


      reply	other threads:[~2024-10-10 13:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-28  9:26 Zijun Hu
2024-09-28 10:50 ` Greg Kroah-Hartman
2024-09-28 16:08   ` quic_zijuhu
2024-09-30 13:07 ` Johan Hovold
2024-10-10 13:24   ` Zijun Hu [this message]

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=d1438cf0-8bea-4125-a046-6e4abfbba2fd@icloud.com \
    --to=zijun_hu@icloud.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan+linaro@kernel.org \
    --cc=johan@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=quic_zijuhu@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=tony@atomide.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

all inboxes | Powered by JetHome®