linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Jens Axboe <axboe@kernel.dk>, LKML <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <lenb@kernel.org>,
	inux-pm@vger.kernel.org
Subject: Re: Bug: d0e936adbd22 crashes at boot
Date: Fri, 03 Sep 2021 07:13:16 -0700	[thread overview]
Message-ID: <c56cde110210bec6537fe69b495334c6c70c814e.camel@linux.intel.com> (raw)
In-Reply-To: <942f4041-e4e7-1b08-3301-008ab37ff5b8@kernel.dk>

Hi Axboe,

Thanks for reporting.
On Fri, 2021-09-03 at 07:36 -0600, Jens Axboe wrote:
> Hi,
> 
> Booting Linus's tree causes a crash on my laptop, an x1 gen9. This was
> a bit
> difficult to pin down as it crashes before the display is up, but I
> managed
> to narrow it down to:
> 
> commit d0e936adbd2250cb03f2e840c6651d18edc22ace
> Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Date:   Thu Aug 19 19:40:06 2021 -0700
> 
>     cpufreq: intel_pstate: Process HWP Guaranteed change notification
> 
> which crashes with a NULL pointer deref in notify_hwp_interrupt() ->
> queue_delayed_work_on().
> 
> Reverting this change makes the laptop boot fine again.
> 
Does this change fixes your issue?

diff --git a/drivers/cpufreq/intel_pstate.c
b/drivers/cpufreq/intel_pstate.c
index b4ffe6c8a0d0..6a3c6f60ad12 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1650,7 +1650,10 @@ void notify_hwp_interrupt(void)
                return;
 
        cpudata = all_cpu_data[this_cpu];
-       schedule_delayed_work_on(this_cpu, &cpudata->hwp_notify_work,
msecs_to_jiffies(10));
+       if (cpudata)
+               schedule_delayed_work_on(this_cpu, &cpudata-
>hwp_notify_work, msecs_to_jiffies(10));
+       else
+               wrmsrl(MSR_HWP_STATUS, 0);
 }
 
 static void intel_pstate_enable_hwp_interrupt(struct cpudata *cpudata)


Thanks,
Srinivas


  reply	other threads:[~2021-09-03 14:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 13:36 Bug: d0e936adbd22 crashes at boot Jens Axboe
2021-09-03 14:13 ` Srinivas Pandruvada [this message]
2021-09-03 14:15   ` Jens Axboe
2021-09-03 14:38     ` Srinivas Pandruvada
2021-09-03 15:00       ` Jens Axboe
2021-09-03 15:11         ` Srinivas Pandruvada
2021-09-03 18:00         ` Srinivas Pandruvada
2021-09-03 20:41           ` Jens Axboe
2021-09-03 20:57             ` Jens Axboe
2021-09-03 22:38               ` Srinivas Pandruvada

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=c56cde110210bec6537fe69b495334c6c70c814e.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=inux-pm@vger.kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.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;
as well as URLs for NNTP newsgroup(s).