Re: [PATCH v4 0/2] cpufreq: intel_pstate: Implement passive mode with HWP enabled

Srinivas Pandruvada
2020-08-01T16:39:35Z

[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]

On Tue, 2020-07-28 at 17:09 +0200, Rafael J. Wysocki wrote:
> Hi All,
>
> On Monday, July 27, 2020 5:13:40 PM CEST Rafael J. Wysocki wrote:
> > On Thursday, July 16, 2020 7:37:04 PM CEST Rafael J. Wysocki wrote:
> > > This really is a v2 of this patch:
> > >
> > > https://patchwork.kernel.org/patch/11663271/
> > >
> > > with an extra preceding cleanup patch to avoid making unrelated
> > > changes in the
> > > [2/2].
> >
I applied this series along with
[PATCH] cpufreq: intel_pstate: Fix EPP setting via sysfs in active mode
on 5.8 latest master (On top of raw epp patchset).

When intel_pstate=passive from kernel command line then it is fine, no
crash. But switch dynamically, crashed:
Attached crash.txt. I may need to try your linux-pm tree.

Then after some playing I reached a state when I monitor MSR 0x774:
while true; do rdmsr 0x774; sleep 1; done
80002704
...
...
ff000101
ff000101
ff000101
ff000101
ff000101
ff000101
ff000101
ff000101

Don't have a recipe to reproduce this.

Thanks,
Srinivas

> > Almost the same as before, but the first patch has been reworked to
> > handle
> > errors in store_energy_performance_preference() correctly and
> > rebased on top
> > of the current linux-pm.git branch.
> >
> > No functional changes otherwise.
>
> One more update of the second patch.
>
> Namely, I realized that the hwp_dynamic_boost sysfs switch was
> present in the
> passive mode after the v3 (and the previous versions) of that patch
> which isn't
> correct, so this modifies it to avoid exposing hwp_dynamic_boost in
> the passive
> mode.
>
> The first patch is the same as in the v2.
>
> Thanks!
>
>
>

[-- Attachment #2: crash.txt --]
[-- Type: text/plain, Size: 5520 bytes --]

[ 232.483420] BUG: kernel NULL pointer dereference, address: 0000000000000030
[ 232.483435] #PF: supervisor read access in kernel mode
[ 232.483441] #PF: error_code(0x0000) - not-present page
[ 232.483446] PGD 0 P4D 0
[ 232.483457] Oops: 0000 [#1] SMP NOPTI
[ 232.483469] CPU: 7 PID: 2064 Comm: bash Tainted: G W 5.8.0-rc6+ #6
[ 232.483474] Hardware name: Dell Inc. XPS 13 7390 2-in-1/06CDVY, BIOS 1.3.1 03/02/2020
[ 232.483491] RIP: 0010:sysfs_remove_file_ns+0x6/0x20
[ 232.483500] Code: ff 4c 89 e7 e8 bb ce ff ff 4c 89 ef e8 43 f9 1d 00 41 5c 41 5d 5d c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 1f 44 00 00 55 <48> 8b 7f 30 48 8b 36 48 89 e5 e8 cb e2 ff ff 5d c3 66 0f 1f 84 00
[ 232.483507] RSP: 0018:ffffaa37c1c93df8 EFLAGS: 00010246
[ 232.483514] RAX: 0000000000000001 RBX: 0000000000000007 RCX: 0000000000000008
[ 232.483519] RDX: 0000000000000000 RSI: ffffffffa87f1f60 RDI: 0000000000000000
[ 232.483524] RBP: ffffaa37c1c93e18 R08: 0000000000000000 R09: ffffffffa791ff00
[ 232.483529] R10: ffff8a15bc0f3600 R11: 0000000000000001 R12: 0000000000000008
[ 232.483533] R13: ffff8a15b3059197 R14: fffffffffffffff2 R15: ffff8a159f945020
[ 232.483541] FS: 00007f068a3d4740(0000) GS:ffff8a15bf7c0000(0000) knlGS:0000000000000000
[ 232.483547] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 232.483552] CR2: 0000000000000030 CR3: 000000046ec78004 CR4: 0000000000760ee0
[ 232.483557] PKRU: 55555554
[ 232.483561] Call Trace:
[ 232.483581] ? intel_pstate_driver_cleanup+0xbd/0xd0
[ 232.483590] store_status+0x9b/0x180
[ 232.483603] kobj_attr_store+0x12/0x20
[ 232.483610] sysfs_kf_write+0x3e/0x50
[ 232.483623] kernfs_fop_write+0xda/0x1b0
[ 232.483636] vfs_write+0xc9/0x200
[ 232.483647] ksys_write+0x67/0xe0
[ 232.483657] __x64_sys_write+0x1a/0x20
[ 232.483668] do_syscall_64+0x52/0xc0
[ 232.483680] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 232.483689] RIP: 0033:0x7f068a4e8057
[ 232.483693] Code: Bad RIP value.
[ 232.483699] RSP: 002b:00007ffe0d4faec8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 232.483705] RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007f068a4e8057
[ 232.483710] RDX: 0000000000000008 RSI: 000055b52e3a6700 RDI: 0000000000000001
[ 232.483715] RBP: 000055b52e3a6700 R08: 000000000000000a R09: 0000000000000007
[ 232.483719] R10: 000055b52cca5017 R11: 0000000000000246 R12: 0000000000000008
[ 232.483724] R13: 00007f068a5c36a0 R14: 00007f068a5c44a0 R15: 00007f068a5c38a0
[ 232.483735] Modules linked in: msr rfcomm ccm cmac algif_hash algif_skcipher af_alg wacom usbhid hid_multitouch bnep hid_sensor_als hid_sensor_incl_3d hid_sensor_accel_3d hid_sensor_magn_3d hid_sensor_gyro_3d hid_sensor_rotation hid_sensor_trigger industrialio_triggered_buffer kfifo_buf hid_sensor_iio_common industrialio hid_sensor_custom x86_pkg_temp_thermal hid_sensor_hub intel_powerclamp hid_generic intel_ishtp_loader snd_sof_pci snd_sof_intel_byt intel_ishtp_hid snd_sof_intel_ipc dell_laptop dell_wmi cros_ec_ishtp snd_sof_intel_hda_common mei_hdcp rtsx_pci_sdmmc intel_rapl_msr intel_wmi_thunderbolt coretemp wmi_bmof dell_smbios snd_soc_hdac_hda cros_ec snd_sof_xtensa_dsp snd_sof_intel_hda snd_sof kvm_intel dell_wmi_descriptor snd_hda_codec_hdmi dcdbas snd_hda_ext_core dell_smm_hwmon nls_iso8859_1 snd_soc_acpi_intel_match kvm snd_hda_codec_realtek snd_soc_acpi snd_hda_codec_generic iwlmvm ledtrig_audio snd_soc_core crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel
[ 232.483821] crypto_simd cryptd snd_compress glue_helper ac97_bus snd_pcm_dmaengine rapl mac80211 intel_cstate snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core joydev snd_hwdep snd_pcm libarc4 efi_pstore iwlwifi btusb snd_seq_midi snd_seq_midi_event btrtl snd_rawmidi btbcm btintel snd_seq bluetooth cfg80211 snd_seq_device snd_timer snd i2c_i801 i2c_smbus ucsi_acpi processor_thermal_device typec_ucsi intel_rapl_common intel_lpss_pci intel_lpss idma64 rtsx_pci soundcore mei_me ecdh_generic mei intel_ish_ipc ecc i2c_hid intel_ishtp intel_soc_dts_iosf typec virt_dma wmi hid int3403_thermal soc_button_array int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel sparse_keymap acpi_pad acpi_tad sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm psmouse nvme nvme_core input_leds serio_raw mac_hid video pinctrl_icelake pinctrl_intel
[ 232.483940] CR2: 0000000000000030
[ 232.483950] ---[ end trace 31db41bab6fdff6f ]---
[ 233.812260] RIP: 0010:sysfs_remove_file_ns+0x6/0x20
[ 233.812281] Code: ff 4c 89 e7 e8 bb ce ff ff 4c 89 ef e8 43 f9 1d 00 41 5c 41 5d 5d c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 1f 44 00 00 55 <48> 8b 7f 30 48 8b 36 48 89 e5 e8 cb e2 ff ff 5d c3 66 0f 1f 84 00
[ 233.812292] RSP: 0018:ffffaa37c1c93df8 EFLAGS: 00010246
[ 233.812302] RAX: 0000000000000001 RBX: 0000000000000007 RCX: 0000000000000008
[ 233.812308] RDX: 0000000000000000 RSI: ffffffffa87f1f60 RDI: 0000000000000000
[ 233.812313] RBP: ffffaa37c1c93e18 R08: 0000000000000000 R09: ffffffffa791ff00
[ 233.812318] R10: ffff8a15bc0f3600 R11: 0000000000000001 R12: 0000000000000008
[ 233.812323] R13: ffff8a15b3059197 R14: fffffffffffffff2 R15: ffff8a159f945020
[ 233.812331] FS: 00007f068a3d4740(0000) GS:ffff8a15bf7c0000(0000) knlGS:0000000000000000
[ 233.812337] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 233.812343] CR2: 0000000000000030 CR3: 000000046ec78004 CR4: 0000000000760ee0
[ 233.812349] PKRU: 55555554