2013-04-09 13:56:08

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tuesday, April 09, 2013 02:47:39 PM Sedat Dilek wrote:
> On Tue, Apr 9, 2013 at 11:30 AM, Stephen Rothwell <[email protected]> wrote:
> > Hi all,
> >
> > Changes since 20130408:
> >
> > The vfs tree still had its build failure so I used the version from
> > next-20130405.
> >
> > The wireless-next tree lost its build failure.
> >
> > The mfd tree still had its build failure so I used the version from
> > next-20130405.
> >
> > The ftrace tree gained a conflict against Linus' tree.
> >
> > The arm-soc tree gained conflicts against the omap_dss2 and gpio-lw trees.
> >
> > ----------------------------------------------------------------------------
> >
>
> On reboot I see hanging cpufreq with the help of kdb/kgdb?
> See screenshot.
>
> I have also a screenshot with next-20130326, so this issue seems not to be new.

This is during CPU offline. Does it only happen on reboot? What about trying
to offline/online CPUs from sysfs?

Rafael


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.


2013-04-09 14:04:56

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 4:03 PM, Rafael J. Wysocki <[email protected]> wrote:
> On Tuesday, April 09, 2013 02:47:39 PM Sedat Dilek wrote:
>> On Tue, Apr 9, 2013 at 11:30 AM, Stephen Rothwell <[email protected]> wrote:
>> > Hi all,
>> >
>> > Changes since 20130408:
>> >
>> > The vfs tree still had its build failure so I used the version from
>> > next-20130405.
>> >
>> > The wireless-next tree lost its build failure.
>> >
>> > The mfd tree still had its build failure so I used the version from
>> > next-20130405.
>> >
>> > The ftrace tree gained a conflict against Linus' tree.
>> >
>> > The arm-soc tree gained conflicts against the omap_dss2 and gpio-lw trees.
>> >
>> > ----------------------------------------------------------------------------
>> >
>>
>> On reboot I see hanging cpufreq with the help of kdb/kgdb?
>> See screenshot.
>>
>> I have also a screenshot with next-20130326, so this issue seems not to be new.
>
> This is during CPU offline. Does it only happen on reboot? What about trying
> to offline/online CPUs from sysfs?
>

I have seen it on reboots.
How to online/offline from sysfs?

- Sedat -

> Rafael
>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.

2013-04-09 14:56:45

by Viresh Kumar

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 9 April 2013 19:34, Sedat Dilek <[email protected]> wrote:
> I have seen it on reboots.
> How to online/offline from sysfs?

offline a cpu "x" with:

echo 0 > /sys/devices/system/cpu/cpux/online

and online with echo 1 > to same location.

2013-04-09 14:59:12

by Viresh Kumar

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 9 April 2013 19:33, Rafael J. Wysocki <[email protected]> wrote:
> On Tuesday, April 09, 2013 02:47:39 PM Sedat Dilek wrote:
>> On reboot I see hanging cpufreq with the help of kdb/kgdb?
>> See screenshot.
>>
>> I have also a screenshot with next-20130326, so this issue seems not to be new.
>
> This is during CPU offline. Does it only happen on reboot? What about trying
> to offline/online CPUs from sysfs?

Sorry Sedat but i can't find your original mail with attachments/logs.
Can you please send them to me and others again?

2013-04-09 14:59:26

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 4:56 PM, Viresh Kumar <[email protected]> wrote:
> On 9 April 2013 19:34, Sedat Dilek <[email protected]> wrote:
>> I have seen it on reboots.
>> How to online/offline from sysfs?
>
> offline a cpu "x" with:
>
> echo 0 > /sys/devices/system/cpu/cpux/online
>
> and online with echo 1 > to same location.

Eh, yeah I re-remember it now :-).
I will try with next-20130328 which boots fine here and hope the
hanging on reboot and in running system is OK.

next-20130409 is broken due to vfs-next issues (see Linux-Next ML).
Will try that first...

- Sedat -

2013-04-09 16:08:50

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 4:56 PM, Viresh Kumar <[email protected]> wrote:
> On 9 April 2013 19:34, Sedat Dilek <[email protected]> wrote:
>> I have seen it on reboots.
>> How to online/offline from sysfs?
>
> offline a cpu "x" with:
>
> echo 0 > /sys/devices/system/cpu/cpux/online
>
> and online with echo 1 > to same location.

With x=3 the system gets in an unuseable state.

root# echo 0 > /sys/devices/system/cpu/cpu3/online

I could not write my reply and had to do a hard/cold reboot.
The dmesg log I saw looked similiar to my digicam-shot.

- Sedat -

2013-04-09 16:51:13

by Viresh Kumar

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
> With x=3 the system gets in an unuseable state.
>
> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>
> I could not write my reply and had to do a hard/cold reboot.
> The dmesg log I saw looked similiar to my digicam-shot.

Few things i need from you. First is output of cpufreq-info. Then
all the steps you did to reproduce above? Removed any other cpus?

I am not able to find next-20130326 tag in my repo, only have 23 and 28.
Can you debug it a bit to find exact line of code causing this issue using
objdump?

HINT: Documentation/BUG-HUNTING..

Give me line numbers of both of these functions: __cpufreq_governor() and
__cpufreq_remove_dev().

2013-04-09 16:57:53

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>> With x=3 the system gets in an unuseable state.
>>
>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>
>> I could not write my reply and had to do a hard/cold reboot.
>> The dmesg log I saw looked similiar to my digicam-shot.
>
> Few things i need from you. First is output of cpufreq-info. Then
> all the steps you did to reproduce above? Removed any other cpus?
>
> I am not able to find next-20130326 tag in my repo, only have 23 and 28.
> Can you debug it a bit to find exact line of code causing this issue using
> objdump?
>
> HINT: Documentation/BUG-HUNTING..
>

next-20130326 see...

[1] http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tag/?id=next-20130326

objdump of file?

> Give me line numbers of both of these functions: __cpufreq_governor() and
> __cpufreq_remove_dev().

I must checkout by myself and jump on next-20130326.
Unfortunately, I have it installed but have no binaries and deleted
the branch from my local GIT branch.

Still on the fs/pipe issue from vfs-next :-).
I guess I have a working follow-up patch, still compiling.

- Sedat -

2013-04-09 18:27:08

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>> With x=3 the system gets in an unuseable state.
>>
>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>
>> I could not write my reply and had to do a hard/cold reboot.
>> The dmesg log I saw looked similiar to my digicam-shot.
>
> Few things i need from you. First is output of cpufreq-info. Then
> all the steps you did to reproduce above? Removed any other cpus?
>
> I am not able to find next-20130326 tag in my repo, only have 23 and 28.
> Can you debug it a bit to find exact line of code causing this issue using
> objdump?
>
> HINT: Documentation/BUG-HUNTING..
>
> Give me line numbers of both of these functions: __cpufreq_governor() and
> __cpufreq_remove_dev().

I have recompiled next-20130326 and the REGRESSION is still reproducible.

Attached are my dmesg, kernel-config, tarball of my drivers/cpufreq
build-dir, objdump of cpufreq_governor.o and the list of my current
amd64-toolchain.

Hope this helps you!

Regards,
- Sedat -


Attachments:
dmesg_3.9.0-rc4-next20130326-1-iniza-small_broken.txt (56.53 kB)
config-3.9.0-rc4-next20130326-1-iniza-small (109.04 kB)
drivers-cpufreq_from-dileks.tar.xz (165.10 kB)
drivers-cpufreq_from-dileks.tar.xz.sha256sum (101.00 B)
HOST-AND-BUILD-TOOLCHAIN_from-dileks.txt (2.96 kB)
cpufreq_governor_o--disassemble-all.txt (40.91 kB)
Download all attachments

2013-04-09 18:30:01

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 8:26 PM, Sedat Dilek <[email protected]> wrote:
> On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
>> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>>> With x=3 the system gets in an unuseable state.
>>>
>>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>>
>>> I could not write my reply and had to do a hard/cold reboot.
>>> The dmesg log I saw looked similiar to my digicam-shot.
>>
>> Few things i need from you. First is output of cpufreq-info. Then
>> all the steps you did to reproduce above? Removed any other cpus?
>>
>> I am not able to find next-20130326 tag in my repo, only have 23 and 28.
>> Can you debug it a bit to find exact line of code causing this issue using
>> objdump?
>>
>> HINT: Documentation/BUG-HUNTING..
>>
>> Give me line numbers of both of these functions: __cpufreq_governor() and
>> __cpufreq_remove_dev().
>
> I have recompiled next-20130326 and the REGRESSION is still reproducible.
>
> Attached are my dmesg, kernel-config, tarball of my drivers/cpufreq
> build-dir, objdump of cpufreq_governor.o and the list of my current
> amd64-toolchain.
>
> Hope this helps you!
>
> Regards,
> - Sedat -

$ cd linux-next/

$ objdump --disassemble-all drivers/cpufreq/cpufreq.o >
/tmp/cpufreq_o--disassemble-all.txt

...attached.

- Sedat -


Attachments:
cpufreq_o--disassemble-all.txt (187.14 kB)

2013-04-09 18:39:24

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 8:29 PM, Sedat Dilek <[email protected]> wrote:
> On Tue, Apr 9, 2013 at 8:26 PM, Sedat Dilek <[email protected]> wrote:
>> On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
>>> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>>>> With x=3 the system gets in an unuseable state.
>>>>
>>>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>>>
>>>> I could not write my reply and had to do a hard/cold reboot.
>>>> The dmesg log I saw looked similiar to my digicam-shot.
>>>
>>> Few things i need from you. First is output of cpufreq-info. Then
>>> all the steps you did to reproduce above? Removed any other cpus?
>>>
>>> I am not able to find next-20130326 tag in my repo, only have 23 and 28.
>>> Can you debug it a bit to find exact line of code causing this issue using
>>> objdump?
>>>
>>> HINT: Documentation/BUG-HUNTING..
>>>
>>> Give me line numbers of both of these functions: __cpufreq_governor() and
>>> __cpufreq_remove_dev().
>>
>> I have recompiled next-20130326 and the REGRESSION is still reproducible.
>>
>> Attached are my dmesg, kernel-config, tarball of my drivers/cpufreq
>> build-dir, objdump of cpufreq_governor.o and the list of my current
>> amd64-toolchain.
>>
>> Hope this helps you!
>>
>> Regards,
>> - Sedat -
>
> $ cd linux-next/
>
> $ objdump --disassemble-all drivers/cpufreq/cpufreq.o >
> /tmp/cpufreq_o--disassemble-all.txt
>
> ...attached.
>
> - Sedat -

Hmm, I remembered Thorsten Glaser told be to pass also "-Mintel"
parameter ("-D" shortform for "--disassemble-all"):

$ objdump -D -Mintel drivers/cpufreq/cpufreq.o > /tmp/cpufreq_o-D-Mintel.txt

File attached.

Hope this helps you.

- Sedat -


Attachments:
cpufreq_o-D-Mintel.txt (191.59 kB)

2013-04-09 20:26:43

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 8:39 PM, Sedat Dilek <[email protected]> wrote:
> On Tue, Apr 9, 2013 at 8:29 PM, Sedat Dilek <[email protected]> wrote:
>> On Tue, Apr 9, 2013 at 8:26 PM, Sedat Dilek <[email protected]> wrote:
>>> On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
>>>> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>>>>> With x=3 the system gets in an unuseable state.
>>>>>
>>>>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>>>>
>>>>> I could not write my reply and had to do a hard/cold reboot.
>>>>> The dmesg log I saw looked similiar to my digicam-shot.
>>>>
>>>> Few things i need from you. First is output of cpufreq-info. Then
>>>> all the steps you did to reproduce above? Removed any other cpus?
>>>>
>>>> I am not able to find next-20130326 tag in my repo, only have 23 and 28.
>>>> Can you debug it a bit to find exact line of code causing this issue using
>>>> objdump?
>>>>
>>>> HINT: Documentation/BUG-HUNTING..
>>>>
>>>> Give me line numbers of both of these functions: __cpufreq_governor() and
>>>> __cpufreq_remove_dev().
>>>
>>> I have recompiled next-20130326 and the REGRESSION is still reproducible.
>>>
>>> Attached are my dmesg, kernel-config, tarball of my drivers/cpufreq
>>> build-dir, objdump of cpufreq_governor.o and the list of my current
>>> amd64-toolchain.
>>>
>>> Hope this helps you!
>>>
>>> Regards,
>>> - Sedat -
>>
>> $ cd linux-next/
>>
>> $ objdump --disassemble-all drivers/cpufreq/cpufreq.o >
>> /tmp/cpufreq_o--disassemble-all.txt
>>
>> ...attached.
>>
>> - Sedat -
>
> Hmm, I remembered Thorsten Glaser told be to pass also "-Mintel"
> parameter ("-D" shortform for "--disassemble-all"):
>
> $ objdump -D -Mintel drivers/cpufreq/cpufreq.o > /tmp/cpufreq_o-D-Mintel.txt
>
> File attached.
>
> Hope this helps you.
>
> - Sedat -

The issue was also seen with a vfs-next-fixed Linux-Next (next-20130409).

- Sedat -

[ 2454.415601] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000030
[ 2454.421017] IP: [<ffffffff8156fefa>] __cpufreq_governor+0x1a/0x100
[ 2454.423777] PGD c6219067 PUD c620d067 PMD 0
[ 2454.426360] Oops: 0000 [#1] SMP
[ 2454.428850] Modules linked in: btrfs xor zlib_deflate raid6_pq xfs
libcrc32c snd_hda_codec_hdmi snd_hda_codec_realtek coretemp kvm_intel
kvm snd_hda_intel snd_hda_codec arc4 iwldvm snd_hwdep joydev i915
snd_pcm ghash_clmulni_intel mac80211 aesni_intel parport_pc
snd_page_alloc xts rfcomm snd_seq_midi aes_x86_64 bnep ppdev
snd_seq_midi_event lrw snd_rawmidi gf128mul snd_seq i2c_algo_bit
ablk_helper uvcvideo iwlwifi cryptd drm_kms_helper snd_timer drm
videobuf2_vmalloc snd_seq_device psmouse btusb videobuf2_memops snd
videobuf2_core microcode bluetooth cfg80211 soundcore videodev
samsung_laptop serio_raw wmi lp mac_hid video lpc_ich parport
hid_generic r8169 usbhid hid
[ 2454.440355] CPU 3
[ 2454.440386] Pid: 5409, comm: bash Not tainted
3.9.0-rc6-next20130409-4-iniza-small #1 SAMSUNG ELECTRONICS CO., LTD.
530U3BI/530U4BI/530U4BH/530U3BI/530U4BI/530U4BH
[ 2454.446497] RIP: 0010:[<ffffffff8156fefa>] [<ffffffff8156fefa>]
__cpufreq_governor+0x1a/0x100
[ 2454.449734] RSP: 0018:ffff8800c624bca8 EFLAGS: 00010282
[ 2454.452977] RAX: ffffffff81cc16c0 RBX: ffff880118038200 RCX: 00000001820001fa
[ 2454.456260] RDX: 00000001820001fb RSI: 0000000000000000 RDI: ffff880118038200
[ 2454.459567] RBP: ffff8800c624bcc8 R08: 0000000000000000 R09: ffffea000461fc80
[ 2454.462797] R10: ffffffff81346139 R11: 0000000000000246 R12: 0000000000000005
[ 2454.465940] R13: ffff88011facc348 R14: 0000000000010b40 R15: 0000000000000003
[ 2454.468999] FS: 00007f4e705f7700(0000) GS:ffff88011fac0000(0000)
knlGS:0000000000000000
[ 2454.472097] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2454.475132] CR2: 0000000000000030 CR3: 00000000c621e000 CR4: 00000000000407e0
[ 2454.478206] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 2454.481288] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 2454.484362] Process bash (pid: 5409, threadinfo ffff8800c624a000,
task ffff88005f969740)
[ 2454.487463] Stack:
[ 2454.490545] 0000000000010b40 0000000000000003 ffff880118038200
0000000000000003
[ 2454.493713] ffff8800c624bd38 ffffffff81570bdd ffffffff81cda920
ffff8800c624be04
[ 2454.496899] ffffffff816abb28 ffffffff00000001 0000000000000003
0000000000010b48
[ 2454.500101] Call Trace:
[ 2454.503265] [<ffffffff81570bdd>] __cpufreq_remove_dev.isra.12+0x25d/0x390
[ 2454.506402] [<ffffffff816abb28>] ? powernowk8_cpu_init_on_cpu+0xa9/0xa9
[ 2454.509527] [<ffffffff816ab04a>] cpufreq_cpu_callback+0x47/0x5c
[ 2454.512636] [<ffffffff816c180d>] notifier_call_chain+0x4d/0x70
[ 2454.515716] [<ffffffff810833ee>] __raw_notifier_call_chain+0xe/0x10
[ 2454.518781] [<ffffffff8105b930>] __cpu_notify+0x20/0x40
[ 2454.521823] [<ffffffff8169bd91>] _cpu_down+0x81/0x280
[ 2454.524858] [<ffffffff8169bfc5>] cpu_down+0x35/0x50
[ 2454.527900] [<ffffffff8169fff3>] store_online+0x63/0xc0
[ 2454.530958] [<ffffffff8144d288>] dev_attr_store+0x18/0x30
[ 2454.534039] [<ffffffff812077bf>] sysfs_write_file+0xef/0x170
[ 2454.537127] [<ffffffff8119418e>] vfs_write+0xce/0x1e0
[ 2454.540223] [<ffffffff81194672>] SyS_write+0x52/0xa0
[ 2454.543315] [<ffffffff811b0df0>] ? __close_fd+0x90/0xc0
[ 2454.546406] [<ffffffff816c5e5d>] system_call_fastpath+0x1a/0x1f
[ 2454.549495] Code: c3 49 c7 c6 ea ff ff ff eb e2 0f 1f 80 00 00 00
00 66 66 66 66 90 55 48 89 e5 41 54 41 89 f4 53 48 89 fb 48 83 ec 10
48 8b 77 68 <8b> 46 30 85 c0 74 09 3b 47 54 0f 82 a0 00 00 00 48 8b 7e
48 e8
[ 2454.556603] RIP [<ffffffff8156fefa>] __cpufreq_governor+0x1a/0x100
[ 2454.560102] RSP <ffff8800c624bca8>
[ 2454.563569] CR2: 0000000000000030
[ 2454.581144] ---[ end trace 62364c4fbb57b30b ]---
- EOT -

2013-04-10 05:41:24

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>> With x=3 the system gets in an unuseable state.
>>
>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>
>> I could not write my reply and had to do a hard/cold reboot.
>> The dmesg log I saw looked similiar to my digicam-shot.
>
> Few things i need from you. First is output of cpufreq-info. Then
> all the steps you did to reproduce above? Removed any other cpus?
>

Here is the output of cpufreq-info of the stable distro-kernel I am using.
If you need the one from the "BROKEN" kernel, please let me know.

- Sedat -


Attachments:
cpufreq-info_3.2.0-40-generic.txt (3.58 kB)

2013-04-10 05:53:36

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Wed, Apr 10, 2013 at 7:41 AM, Sedat Dilek <[email protected]> wrote:
> On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
>> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>>> With x=3 the system gets in an unuseable state.
>>>
>>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>>
>>> I could not write my reply and had to do a hard/cold reboot.
>>> The dmesg log I saw looked similiar to my digicam-shot.
>>
>> Few things i need from you. First is output of cpufreq-info. Then
>> all the steps you did to reproduce above? Removed any other cpus?
>>
>
> Here is the output of cpufreq-info of the stable distro-kernel I am using.
> If you need the one from the "BROKEN" kernel, please let me know.
>
> - Sedat -

Hmm, I see that the kernel-sources itself ships a...

./tools/power/cpupower/utils/cpufreq-info.c

IIRC current 'make deb-pkg' does not build the tools, but I have seen
a patch on linux-kbuild ML.
Can I build cpufreq-info.c afterwards? Do I need a already-compiled build-dir?

Thanks in advance for answering my questions.

BTW, I have found a nice article on LWN "cpupowerutils - cpufrequtils
extended with quite some features" (see [1]).

- Sedat -

[1] http://lwn.net/Articles/433002/

2013-04-10 06:14:11

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Wed, Apr 10, 2013 at 7:53 AM, Sedat Dilek <[email protected]> wrote:
> On Wed, Apr 10, 2013 at 7:41 AM, Sedat Dilek <[email protected]> wrote:
>> On Tue, Apr 9, 2013 at 6:51 PM, Viresh Kumar <[email protected]> wrote:
>>> On 9 April 2013 21:38, Sedat Dilek <[email protected]> wrote:
>>>> With x=3 the system gets in an unuseable state.
>>>>
>>>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>>>
>>>> I could not write my reply and had to do a hard/cold reboot.
>>>> The dmesg log I saw looked similiar to my digicam-shot.
>>>
>>> Few things i need from you. First is output of cpufreq-info. Then
>>> all the steps you did to reproduce above? Removed any other cpus?
>>>
>>
>> Here is the output of cpufreq-info of the stable distro-kernel I am using.
>> If you need the one from the "BROKEN" kernel, please let me know.
>>
>> - Sedat -
>
> Hmm, I see that the kernel-sources itself ships a...
>
> ./tools/power/cpupower/utils/cpufreq-info.c
>
> IIRC current 'make deb-pkg' does not build the tools, but I have seen
> a patch on linux-kbuild ML.

I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
deb-pkg'" from February 2012.
Can't say what happened to it...

- Sedat -

[1] http://lists.debian.org/debian-kernel/2012/02/msg01009.html

> Can I build cpufreq-info.c afterwards? Do I need a already-compiled build-dir?
>
> Thanks in advance for answering my questions.
>
> BTW, I have found a nice article on LWN "cpupowerutils - cpufrequtils
> extended with quite some features" (see [1]).
>
> - Sedat -
>
> [1] http://lwn.net/Articles/433002/

2013-04-12 08:23:41

by Viresh Kumar

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
> deb-pkg'" from February 2012.
> Can't say what happened to it...

Sedat,

Sorry for being late. I am down with Fever and throat infection since few days.
Still struggling with it..

There are few things i tried. Firstly the tag: next-20130326 is bad as there are
some bad commits in cpufreq core in it.

I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
just hanged.

Then i tried Rafael's linux-next branch

079576f Merge branch 'pm-cpufreq-next' into linux-next

And couldn't find any issues with it. I am easily able to remove/add cpus at
runtime..

Can you give this branch a try?

--
viresh

2013-04-12 14:24:23

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]> wrote:
> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
>> deb-pkg'" from February 2012.
>> Can't say what happened to it...
>
> Sedat,
>
> Sorry for being late. I am down with Fever and throat infection since few days.
> Still struggling with it..
>
> There are few things i tried. Firstly the tag: next-20130326 is bad as there are
> some bad commits in cpufreq core in it.
>
> I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
> just hanged.
>
> Then i tried Rafael's linux-next branch
>
> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>
> And couldn't find any issues with it. I am easily able to remove/add cpus at
> runtime..
>
> Can you give this branch a try?
>

OK, you seem to be well again, nice to hear.

I was doing the whole week spring-cleaning in the apartment of my parents.
Now, I have some minutes for a compilation run.

I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
mask" could be the correct fix, but will try the GIT branch you have
mentioned.

- Sedat -

[1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199

> --
> viresh

2013-04-12 15:45:43

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]> wrote:
> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]> wrote:
>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
>>> deb-pkg'" from February 2012.
>>> Can't say what happened to it...
>>
>> Sedat,
>>
>> Sorry for being late. I am down with Fever and throat infection since few days.
>> Still struggling with it..
>>
>> There are few things i tried. Firstly the tag: next-20130326 is bad as there are
>> some bad commits in cpufreq core in it.
>>
>> I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
>> just hanged.
>>
>> Then i tried Rafael's linux-next branch
>>
>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>
>> And couldn't find any issues with it. I am easily able to remove/add cpus at
>> runtime..
>>
>> Can you give this branch a try?
>>
>
> OK, you seem to be well again, nice to hear.
>
> I was doing the whole week spring-cleaning in the apartment of my parents.
> Now, I have some minutes for a compilation run.
>
> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
> mask" could be the correct fix, but will try the GIT branch you have
> mentioned.
>
> - Sedat -
>
> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>

Both BROKEN here, specific pm-next commitid and pulling
pm.git#linux-next into next-20130411 (see attached files).

Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of this all?

- Sedat -

[1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b

>> --
>> viresh


Attachments:
dmesg_3.9.0-rc6-1-pmnext079576f-small_BROKEN.txt (57.26 kB)
config-3.9.0-rc6-1-pmnext079576f-small (107.22 kB)
config-3.9.0-rc6-next20130411-3-iniza-small (109.63 kB)
dmesg_3.9.0-rc6-next20130411-3-iniza-small_BROKEN.txt (57.63 kB)
Download all attachments

2013-04-12 16:27:30

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <[email protected]> wrote:
> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]> wrote:
>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]> wrote:
>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
>>>> deb-pkg'" from February 2012.
>>>> Can't say what happened to it...
>>>
>>> Sedat,
>>>
>>> Sorry for being late. I am down with Fever and throat infection since few days.
>>> Still struggling with it..
>>>
>>> There are few things i tried. Firstly the tag: next-20130326 is bad as there are
>>> some bad commits in cpufreq core in it.
>>>
>>> I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
>>> just hanged.
>>>
>>> Then i tried Rafael's linux-next branch
>>>
>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>>
>>> And couldn't find any issues with it. I am easily able to remove/add cpus at
>>> runtime..
>>>
>>> Can you give this branch a try?
>>>
>>
>> OK, you seem to be well again, nice to hear.
>>
>> I was doing the whole week spring-cleaning in the apartment of my parents.
>> Now, I have some minutes for a compilation run.
>>
>> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
>> mask" could be the correct fix, but will try the GIT branch you have
>> mentioned.
>>
>> - Sedat -
>>
>> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>>
>
> Both BROKEN here, specific pm-next commitid and pulling
> pm.git#linux-next into next-20130411 (see attached files).
>
> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of this all?
>

[ CC Nathan ]

NO, wrong assumption.

2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
"cpufreq: convert cpufreq_driver to using RCU"
2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
__cpufreq_governor() with correct policy->cpus mask"
2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge branch
'pm-cpufreq-next' into linux-next

- Sedat -


> - Sedat -
>
> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>
>>> --
>>> viresh


Attachments:
dmesg_3.9.0-rc6-1-revertcpufreqrcu-small_BROKEN.txt (57.50 kB)

2013-04-12 21:08:45

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek <[email protected]> wrote:
> On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <[email protected]> wrote:
>> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]> wrote:
>>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]> wrote:
>>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
>>>>> deb-pkg'" from February 2012.
>>>>> Can't say what happened to it...
>>>>
>>>> Sedat,
>>>>
>>>> Sorry for being late. I am down with Fever and throat infection since few days.
>>>> Still struggling with it..
>>>>
>>>> There are few things i tried. Firstly the tag: next-20130326 is bad as there are
>>>> some bad commits in cpufreq core in it.
>>>>
>>>> I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
>>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
>>>> just hanged.
>>>>
>>>> Then i tried Rafael's linux-next branch
>>>>
>>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>>>
>>>> And couldn't find any issues with it. I am easily able to remove/add cpus at
>>>> runtime..
>>>>
>>>> Can you give this branch a try?
>>>>
>>>
>>> OK, you seem to be well again, nice to hear.
>>>
>>> I was doing the whole week spring-cleaning in the apartment of my parents.
>>> Now, I have some minutes for a compilation run.
>>>
>>> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
>>> mask" could be the correct fix, but will try the GIT branch you have
>>> mentioned.
>>>
>>> - Sedat -
>>>
>>> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>>>
>>
>> Both BROKEN here, specific pm-next commitid and pulling
>> pm.git#linux-next into next-20130411 (see attached files).
>>
>> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of this all?
>>
>
> [ CC Nathan ]
>
> NO, wrong assumption.
>
> 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
> "cpufreq: convert cpufreq_driver to using RCU"
> 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
> __cpufreq_governor() with correct policy->cpus mask"
> 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge branch
> 'pm-cpufreq-next' into linux-next
>
> - Sedat -
>
>
>> - Sedat -
>>
>> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>>
>>>> --
>>>> viresh

[ TO Dirk (Author of Intel pstate driver) ]

With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!

My kernel-config and dmesg are attached.

- Sedat -


Attachments:
dmesg_3.9.0-rc6-2-pmnext079576f-small_CONFIG_X86_INTEL_PSTATE-n.txt (53.62 kB)
config-3.9.0-rc6-2-pmnext079576f-small (107.23 kB)
Download all attachments

2013-04-12 22:43:54

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek <[email protected]> wrote:
> > On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <[email protected]> wrote:
> >> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]> wrote:
> >>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]> wrote:
> >>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
> >>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
> >>>>> deb-pkg'" from February 2012.
> >>>>> Can't say what happened to it...
> >>>>
> >>>> Sedat,
> >>>>
> >>>> Sorry for being late. I am down with Fever and throat infection since few days.
> >>>> Still struggling with it..
> >>>>
> >>>> There are few things i tried. Firstly the tag: next-20130326 is bad as there are
> >>>> some bad commits in cpufreq core in it.
> >>>>
> >>>> I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
> >>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
> >>>> just hanged.
> >>>>
> >>>> Then i tried Rafael's linux-next branch
> >>>>
> >>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
> >>>>
> >>>> And couldn't find any issues with it. I am easily able to remove/add cpus at
> >>>> runtime..
> >>>>
> >>>> Can you give this branch a try?
> >>>>
> >>>
> >>> OK, you seem to be well again, nice to hear.
> >>>
> >>> I was doing the whole week spring-cleaning in the apartment of my parents.
> >>> Now, I have some minutes for a compilation run.
> >>>
> >>> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
> >>> mask" could be the correct fix, but will try the GIT branch you have
> >>> mentioned.
> >>>
> >>> - Sedat -
> >>>
> >>> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
> >>>
> >>
> >> Both BROKEN here, specific pm-next commitid and pulling
> >> pm.git#linux-next into next-20130411 (see attached files).
> >>
> >> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of this all?
> >>
> >
> > [ CC Nathan ]
> >
> > NO, wrong assumption.
> >
> > 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
> > "cpufreq: convert cpufreq_driver to using RCU"
> > 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
> > __cpufreq_governor() with correct policy->cpus mask"
> > 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge branch
> > 'pm-cpufreq-next' into linux-next
> >
> > - Sedat -
> >
> >
> >> - Sedat -
> >>
> >> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
> >>
> >>>> --
> >>>> viresh
>
> [ TO Dirk (Author of Intel pstate driver) ]
>
> With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!
>
> My kernel-config and dmesg are attached.

You're seeing a trouble with a new driver, then, so that's not a regression.

Thanks for taking the time to debug this!

Rafael


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

2013-04-13 09:55:59

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Sat, Apr 13, 2013 at 12:51 AM, Rafael J. Wysocki <[email protected]> wrote:
> On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
>> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek <[email protected]> wrote:
>> > On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <[email protected]> wrote:
>> >> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]> wrote:
>> >>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]> wrote:
>> >>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>> >>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
>> >>>>> deb-pkg'" from February 2012.
>> >>>>> Can't say what happened to it...
>> >>>>
>> >>>> Sedat,
>> >>>>
>> >>>> Sorry for being late. I am down with Fever and throat infection since few days.
>> >>>> Still struggling with it..
>> >>>>
>> >>>> There are few things i tried. Firstly the tag: next-20130326 is bad as there are
>> >>>> some bad commits in cpufreq core in it.
>> >>>>
>> >>>> I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
>> >>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
>> >>>> just hanged.
>> >>>>
>> >>>> Then i tried Rafael's linux-next branch
>> >>>>
>> >>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>> >>>>
>> >>>> And couldn't find any issues with it. I am easily able to remove/add cpus at
>> >>>> runtime..
>> >>>>
>> >>>> Can you give this branch a try?
>> >>>>
>> >>>
>> >>> OK, you seem to be well again, nice to hear.
>> >>>
>> >>> I was doing the whole week spring-cleaning in the apartment of my parents.
>> >>> Now, I have some minutes for a compilation run.
>> >>>
>> >>> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
>> >>> mask" could be the correct fix, but will try the GIT branch you have
>> >>> mentioned.
>> >>>
>> >>> - Sedat -
>> >>>
>> >>> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>> >>>
>> >>
>> >> Both BROKEN here, specific pm-next commitid and pulling
>> >> pm.git#linux-next into next-20130411 (see attached files).
>> >>
>> >> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of this all?
>> >>
>> >
>> > [ CC Nathan ]
>> >
>> > NO, wrong assumption.
>> >
>> > 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
>> > "cpufreq: convert cpufreq_driver to using RCU"
>> > 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
>> > __cpufreq_governor() with correct policy->cpus mask"
>> > 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge branch
>> > 'pm-cpufreq-next' into linux-next
>> >
>> > - Sedat -
>> >
>> >
>> >> - Sedat -
>> >>
>> >> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>> >>
>> >>>> --
>> >>>> viresh
>>
>> [ TO Dirk (Author of Intel pstate driver) ]
>>
>> With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!
>>
>> My kernel-config and dmesg are attached.
>
> You're seeing a trouble with a new driver, then, so that's not a regression.
>

What do you mean by this?

What are the next steps to get this fixed?

- Sedat -

> Thanks for taking the time to debug this!
>
> Rafael
>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.

2013-04-15 16:07:17

by Dirk Brandewie

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 04/13/2013 02:55 AM, Sedat Dilek wrote:
> On Sat, Apr 13, 2013 at 12:51 AM, Rafael J. Wysocki <[email protected]> wrote:
>> On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
>>> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek <[email protected]> wrote:
>>>> On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <[email protected]> wrote:
>>>>> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]> wrote:
>>>>>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]> wrote:
>>>>>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>>>>>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
>>>>>>>> deb-pkg'" from February 2012.
>>>>>>>> Can't say what happened to it...
>>>>>>>
>>>>>>> Sedat,
>>>>>>>
>>>>>>> Sorry for being late. I am down with Fever and throat infection since few days.
>>>>>>> Still struggling with it..
>>>>>>>
>>>>>>> There are few things i tried. Firstly the tag: next-20130326 is bad as there are
>>>>>>> some bad commits in cpufreq core in it.
>>>>>>>
>>>>>>> I then tried latest linux-next/master on my Thinkpad (model name : Intel(R)
>>>>>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
>>>>>>> just hanged.
>>>>>>>
>>>>>>> Then i tried Rafael's linux-next branch
>>>>>>>
>>>>>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>>>>>>
>>>>>>> And couldn't find any issues with it. I am easily able to remove/add cpus at
>>>>>>> runtime..
>>>>>>>
>>>>>>> Can you give this branch a try?
>>>>>>>
>>>>>>
>>>>>> OK, you seem to be well again, nice to hear.
>>>>>>
>>>>>> I was doing the whole week spring-cleaning in the apartment of my parents.
>>>>>> Now, I have some minutes for a compilation run.
>>>>>>
>>>>>> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
>>>>>> mask" could be the correct fix, but will try the GIT branch you have
>>>>>> mentioned.
>>>>>>
>>>>>> - Sedat -
>>>>>>
>>>>>> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>>>>>>
>>>>>
>>>>> Both BROKEN here, specific pm-next commitid and pulling
>>>>> pm.git#linux-next into next-20130411 (see attached files).
>>>>>
>>>>> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of this all?
>>>>>
>>>>
>>>> [ CC Nathan ]
>>>>
>>>> NO, wrong assumption.
>>>>
>>>> 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
>>>> "cpufreq: convert cpufreq_driver to using RCU"
>>>> 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
>>>> __cpufreq_governor() with correct policy->cpus mask"
>>>> 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge branch
>>>> 'pm-cpufreq-next' into linux-next
>>>>
>>>> - Sedat -
>>>>
>>>>
>>>>> - Sedat -
>>>>>
>>>>> [1] http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>>>>>
>>>>>>> --
>>>>>>> viresh
>>>
>>> [ TO Dirk (Author of Intel pstate driver) ]
>>>
>>> With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!
>>>
>>> My kernel-config and dmesg are attached.
>>
>> You're seeing a trouble with a new driver, then, so that's not a regression.
>>

This IS a regression.

If the intel_pstate driver is being used __cpufreq_governor() should NOT be
called intel_pstate does not implement the target() callback.

Nathan's commit 5800043b2 changed the fence around the call to
__cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.

@@ -1007,9 +1068,12 @@ static int __cpufreq_remove_dev(struct device *dev,
struct subsys_interface *sif
unsigned int cpu = dev->id, ret, cpus;
unsigned long flags;
struct cpufreq_policy *data;
+ struct cpufreq_driver *driver;
struct kobject *kobj;
struct completion *cmp;
struct device *cpu_dev;
+ bool has_target;
+ int (*exit)(struct cpufreq_policy *policy);

pr_debug("%s: unregistering CPU %u\n", __func__, cpu);

@@ -1025,14 +1089,19 @@ static int __cpufreq_remove_dev(struct device *dev,
struct subsys_interface *sif
return -EINVAL;
}

- if (cpufreq_driver->target)
+ rcu_read_lock();
+ driver = rcu_dereference(cpufreq_driver);
+ has_target = driver->target ? true : false;
+ exit = driver->exit;
+ if (has_target)
__cpufreq_governor(data, CPUFREQ_GOV_STOP);

#ifdef CONFIG_HOTPLUG_CPU
- if (!cpufreq_driver->setpolicy)
+ if (!driver->setpolicy)
strncpy(per_cpu(cpufreq_cpu_governor, cpu),
data->governor->name, CPUFREQ_NAME_LEN);
#endif
+ rcu_read_unlock();

WARN_ON(lock_policy_rwsem_write(cpu));
cpus = cpumask_weight(data->cpus);



>
> What do you mean by this?
>
> What are the next steps to get this fixed?
>
> - Sedat -
>
>> Thanks for taking the time to debug this!
>>
>> Rafael
>>
>>
>> --
>> I speak only for myself.
>> Rafael J. Wysocki, Intel Open Source Technology Center.

2013-04-15 16:13:48

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Mon, Apr 15, 2013 at 6:07 PM, Dirk Brandewie
<[email protected]> wrote:
> On 04/13/2013 02:55 AM, Sedat Dilek wrote:
>>
>> On Sat, Apr 13, 2013 at 12:51 AM, Rafael J. Wysocki <[email protected]> wrote:
>>>
>>> On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
>>>>
>>>> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek <[email protected]>
>>>> wrote:
>>>>>
>>>>> On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <[email protected]>
>>>>> wrote:
>>>>>>
>>>>>> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]>
>>>>>> wrote:
>>>>>>>
>>>>>>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar
>>>>>>> <[email protected]> wrote:
>>>>>>>>
>>>>>>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>>>>>>>>>
>>>>>>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with
>>>>>>>>> 'make
>>>>>>>>> deb-pkg'" from February 2012.
>>>>>>>>> Can't say what happened to it...
>>>>>>>>
>>>>>>>>
>>>>>>>> Sedat,
>>>>>>>>
>>>>>>>> Sorry for being late. I am down with Fever and throat infection
>>>>>>>> since few days.
>>>>>>>> Still struggling with it..
>>>>>>>>
>>>>>>>> There are few things i tried. Firstly the tag: next-20130326 is bad
>>>>>>>> as there are
>>>>>>>> some bad commits in cpufreq core in it.
>>>>>>>>
>>>>>>>> I then tried latest linux-next/master on my Thinkpad (model name
>>>>>>>> : Intel(R)
>>>>>>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
>>>>>>>> just hanged.
>>>>>>>>
>>>>>>>> Then i tried Rafael's linux-next branch
>>>>>>>>
>>>>>>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>>>>>>>
>>>>>>>> And couldn't find any issues with it. I am easily able to remove/add
>>>>>>>> cpus at
>>>>>>>> runtime..
>>>>>>>>
>>>>>>>> Can you give this branch a try?
>>>>>>>>
>>>>>>>
>>>>>>> OK, you seem to be well again, nice to hear.
>>>>>>>
>>>>>>> I was doing the whole week spring-cleaning in the apartment of my
>>>>>>> parents.
>>>>>>> Now, I have some minutes for a compilation run.
>>>>>>>
>>>>>>> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
>>>>>>> mask" could be the correct fix, but will try the GIT branch you have
>>>>>>> mentioned.
>>>>>>>
>>>>>>> - Sedat -
>>>>>>>
>>>>>>> [1]
>>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>>>>>>>
>>>>>>
>>>>>> Both BROKEN here, specific pm-next commitid and pulling
>>>>>> pm.git#linux-next into next-20130411 (see attached files).
>>>>>>
>>>>>> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of
>>>>>> this all?
>>>>>>
>>>>>
>>>>> [ CC Nathan ]
>>>>>
>>>>> NO, wrong assumption.
>>>>>
>>>>> 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
>>>>> "cpufreq: convert cpufreq_driver to using RCU"
>>>>> 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
>>>>> __cpufreq_governor() with correct policy->cpus mask"
>>>>> 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge branch
>>>>> 'pm-cpufreq-next' into linux-next
>>>>>
>>>>> - Sedat -
>>>>>
>>>>>
>>>>>> - Sedat -
>>>>>>
>>>>>> [1]
>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>>>>>>
>>>>>>>> --
>>>>>>>> viresh
>>>>
>>>>
>>>> [ TO Dirk (Author of Intel pstate driver) ]
>>>>
>>>> With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!
>>>>
>>>> My kernel-config and dmesg are attached.
>>>
>>>
>>> You're seeing a trouble with a new driver, then, so that's not a
>>> regression.
>>>
>
> This IS a regression.
>
> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
> called intel_pstate does not implement the target() callback.
>

So the "if (has_target)" line has to be put some lines above or what
is your proposal?

- Sedat -

> Nathan's commit 5800043b2 changed the fence around the call to
> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>
> @@ -1007,9 +1068,12 @@ static int __cpufreq_remove_dev(struct device *dev,
> struct subsys_interface *sif
> unsigned int cpu = dev->id, ret, cpus;
> unsigned long flags;
> struct cpufreq_policy *data;
> + struct cpufreq_driver *driver;
> struct kobject *kobj;
> struct completion *cmp;
> struct device *cpu_dev;
> + bool has_target;
> + int (*exit)(struct cpufreq_policy *policy);
>
> pr_debug("%s: unregistering CPU %u\n", __func__, cpu);
>
> @@ -1025,14 +1089,19 @@ static int __cpufreq_remove_dev(struct device *dev,
> struct subsys_interface *sif
> return -EINVAL;
> }
>
> - if (cpufreq_driver->target)
> + rcu_read_lock();
> + driver = rcu_dereference(cpufreq_driver);
> + has_target = driver->target ? true : false;
> + exit = driver->exit;
> + if (has_target)
> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>
> #ifdef CONFIG_HOTPLUG_CPU
> - if (!cpufreq_driver->setpolicy)
> + if (!driver->setpolicy)
> strncpy(per_cpu(cpufreq_cpu_governor, cpu),
> data->governor->name, CPUFREQ_NAME_LEN);
> #endif
> + rcu_read_unlock();
>
> WARN_ON(lock_policy_rwsem_write(cpu));
> cpus = cpumask_weight(data->cpus);
>
>
>
>
>>
>> What do you mean by this?
>>
>> What are the next steps to get this fixed?
>>
>> - Sedat -
>>
>>> Thanks for taking the time to debug this!
>>>
>>> Rafael
>>>
>>>
>>> --
>>> I speak only for myself.
>>> Rafael J. Wysocki, Intel Open Source Technology Center.
>
>

2013-04-15 17:22:33

by Viresh Kumar

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
> called intel_pstate does not implement the target() callback.
>
> Nathan's commit 5800043b2 changed the fence around the call to
> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.

No it isn't.

> + if (has_target)
> __cpufreq_governor(data, CPUFREQ_GOV_STOP);

As it has taken care of this limitation.

BUT some of my earlier patches haven't. :(
Here is the fix (Sedat please try this and give your tested-by, use the attached
patch as gmail might break what i am copying in mail)..

Sorry for being late in fixing this issue, i am still down with Tonsil infection
and fever.. Today only i got some power to fix it after seeing Dirk's mail.

Your tested-by may help me to recover quickly :)

@Rafael: I will probably be down for one more week and so not doing any
reviews for now... I do check important mails sent directly to me though.

------------x----------------------x------------------

From: Viresh Kumar <[email protected]>
Date: Mon, 15 Apr 2013 22:43:57 +0530
Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
target()

Some cpufreq drivers implement their own governor and so don't need us to call
generic governors interface via __cpufreq_governor(). Few recent commits haven't
obeyed this law well and we saw some regressions.

This patch tries to fix this issue.

Signed-off-by: Viresh Kumar <[email protected]>
---
drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 3564947..a6f6595 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
cpu, unsigned int sibling,
struct device *dev)
{
struct cpufreq_policy *policy;
- int ret = 0;
+ int ret = 0, has_target = 0;
unsigned long flags;

policy = cpufreq_cpu_get(sibling);
WARN_ON(!policy);

- __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
+ rcu_read_lock();
+ has_target = !!rcu_dereference(cpufreq_driver)->target;
+ rcu_read_unlock();
+
+ if (has_target)
+ __cpufreq_governor(policy, CPUFREQ_GOV_STOP);

lock_policy_rwsem_write(sibling);

@@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
cpu, unsigned int sibling,

unlock_policy_rwsem_write(sibling);

- __cpufreq_governor(policy, CPUFREQ_GOV_START);
- __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
+ if (has_target) {
+ __cpufreq_governor(policy, CPUFREQ_GOV_START);
+ __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
+ }

ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
if (ret) {
@@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
*dev, struct subsys_interface *sif

/* If cpu is last user of policy, free policy */
if (cpus == 1) {
- __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
+ if (has_target)
+ __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);

lock_policy_rwsem_read(cpu);
kobj = &data->kobj;


Attachments:
0001-cpufreq-Don-t-call-__cpufreq_governor-for-drivers-wi.patch (2.23 kB)

2013-04-15 17:27:10

by Nathan Zimmer

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 04/15/2013 11:07 AM, Dirk Brandewie wrote:
> On 04/13/2013 02:55 AM, Sedat Dilek wrote:
>> On Sat, Apr 13, 2013 at 12:51 AM, Rafael J. Wysocki <[email protected]> wrote:
>>> On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
>>>> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek
>>>> <[email protected]> wrote:
>>>>> On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek
>>>>> <[email protected]> wrote:
>>>>>> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek
>>>>>> <[email protected]> wrote:
>>>>>>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar
>>>>>>> <[email protected]> wrote:
>>>>>>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>>>>>>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package
>>>>>>>>> with 'make
>>>>>>>>> deb-pkg'" from February 2012.
>>>>>>>>> Can't say what happened to it...
>>>>>>>>
>>>>>>>> Sedat,
>>>>>>>>
>>>>>>>> Sorry for being late. I am down with Fever and throat infection
>>>>>>>> since few days.
>>>>>>>> Still struggling with it..
>>>>>>>>
>>>>>>>> There are few things i tried. Firstly the tag: next-20130326 is
>>>>>>>> bad as there are
>>>>>>>> some bad commits in cpufreq core in it.
>>>>>>>>
>>>>>>>> I then tried latest linux-next/master on my Thinkpad (model
>>>>>>>> name : Intel(R)
>>>>>>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My
>>>>>>>> ubuntu
>>>>>>>> just hanged.
>>>>>>>>
>>>>>>>> Then i tried Rafael's linux-next branch
>>>>>>>>
>>>>>>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>>>>>>>
>>>>>>>> And couldn't find any issues with it. I am easily able to
>>>>>>>> remove/add cpus at
>>>>>>>> runtime..
>>>>>>>>
>>>>>>>> Can you give this branch a try?
>>>>>>>>
>>>>>>>
>>>>>>> OK, you seem to be well again, nice to hear.
>>>>>>>
>>>>>>> I was doing the whole week spring-cleaning in the apartment of
>>>>>>> my parents.
>>>>>>> Now, I have some minutes for a compilation run.
>>>>>>>
>>>>>>> I guess "cpufreq: Call __cpufreq_governor() with correct
>>>>>>> policy->cpus
>>>>>>> mask" could be the correct fix, but will try the GIT branch you
>>>>>>> have
>>>>>>> mentioned.
>>>>>>>
>>>>>>> - Sedat -
>>>>>>>
>>>>>>> [1]
>>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>>>>>>>
>>>>>>
>>>>>> Both BROKEN here, specific pm-next commitid and pulling
>>>>>> pm.git#linux-next into next-20130411 (see attached files).
>>>>>>
>>>>>> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause
>>>>>> of this all?
>>>>>>
>>>>>
>>>>> [ CC Nathan ]
>>>>>
>>>>> NO, wrong assumption.
>>>>>
>>>>> 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
>>>>> "cpufreq: convert cpufreq_driver to using RCU"
>>>>> 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
>>>>> __cpufreq_governor() with correct policy->cpus mask"
>>>>> 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge
>>>>> branch
>>>>> 'pm-cpufreq-next' into linux-next
>>>>>
>>>>> - Sedat -
>>>>>
>>>>>
>>>>>> - Sedat -
>>>>>>
>>>>>> [1]
>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>>>>>>
>>>>>>>> --
>>>>>>>> viresh
>>>>
>>>> [ TO Dirk (Author of Intel pstate driver) ]
>>>>
>>>> With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!
>>>>
>>>> My kernel-config and dmesg are attached.
>>>
>>> You're seeing a trouble with a new driver, then, so that's not a
>>> regression.
>>>
>
> This IS a regression.
>
> If the intel_pstate driver is being used __cpufreq_governor() should
> NOT be
> called intel_pstate does not implement the target() callback.
>
> Nathan's commit 5800043b2 changed the fence around the call to
> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>
> @@ -1007,9 +1068,12 @@ static int __cpufreq_remove_dev(struct device
> *dev, struct subsys_interface *sif
> unsigned int cpu = dev->id, ret, cpus;
> unsigned long flags;
> struct cpufreq_policy *data;
> + struct cpufreq_driver *driver;
> struct kobject *kobj;
> struct completion *cmp;
> struct device *cpu_dev;
> + bool has_target;
> + int (*exit)(struct cpufreq_policy *policy);
>
> pr_debug("%s: unregistering CPU %u\n", __func__, cpu);
>
> @@ -1025,14 +1089,19 @@ static int __cpufreq_remove_dev(struct device
> *dev, struct subsys_interface *sif
> return -EINVAL;
> }
>
> - if (cpufreq_driver->target)
> + rcu_read_lock();
> + driver = rcu_dereference(cpufreq_driver);
> + has_target = driver->target ? true : false;
> + exit = driver->exit;
> + if (has_target)
> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>
> #ifdef CONFIG_HOTPLUG_CPU
> - if (!cpufreq_driver->setpolicy)
> + if (!driver->setpolicy)
> strncpy(per_cpu(cpufreq_cpu_governor, cpu),
> data->governor->name, CPUFREQ_NAME_LEN);
> #endif
> + rcu_read_unlock();
>
> WARN_ON(lock_policy_rwsem_write(cpu));
> cpus = cpumask_weight(data->cpus);
>

I am not clear at what is at issue. Are you saying __cpufreq_governor
can change the value of cpufreq_driver->target? I hadn't thought that
was allowed but if it is the code would need to be fixed.

Nate

2013-04-15 17:42:15

by Dirk Brandewie

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 04/15/2013 10:27 AM, Nathan Zimmer wrote:
> On 04/15/2013 11:07 AM, Dirk Brandewie wrote:
>> On 04/13/2013 02:55 AM, Sedat Dilek wrote:
>>> On Sat, Apr 13, 2013 at 12:51 AM, Rafael J. Wysocki <[email protected]> wrote:
>>>> On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
>>>>> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek <[email protected]> wrote:
>>>>>> On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <[email protected]> wrote:
>>>>>>> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <[email protected]> wrote:
>>>>>>>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <[email protected]>
>>>>>>>> wrote:
>>>>>>>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]> wrote:
>>>>>>>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package with 'make
>>>>>>>>>> deb-pkg'" from February 2012.
>>>>>>>>>> Can't say what happened to it...
>>>>>>>>>
>>>>>>>>> Sedat,
>>>>>>>>>
>>>>>>>>> Sorry for being late. I am down with Fever and throat infection since
>>>>>>>>> few days.
>>>>>>>>> Still struggling with it..
>>>>>>>>>
>>>>>>>>> There are few things i tried. Firstly the tag: next-20130326 is bad as
>>>>>>>>> there are
>>>>>>>>> some bad commits in cpufreq core in it.
>>>>>>>>>
>>>>>>>>> I then tried latest linux-next/master on my Thinkpad (model name
>>>>>>>>> : Intel(R)
>>>>>>>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My ubuntu
>>>>>>>>> just hanged.
>>>>>>>>>
>>>>>>>>> Then i tried Rafael's linux-next branch
>>>>>>>>>
>>>>>>>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>>>>>>>>
>>>>>>>>> And couldn't find any issues with it. I am easily able to remove/add
>>>>>>>>> cpus at
>>>>>>>>> runtime..
>>>>>>>>>
>>>>>>>>> Can you give this branch a try?
>>>>>>>>>
>>>>>>>>
>>>>>>>> OK, you seem to be well again, nice to hear.
>>>>>>>>
>>>>>>>> I was doing the whole week spring-cleaning in the apartment of my parents.
>>>>>>>> Now, I have some minutes for a compilation run.
>>>>>>>>
>>>>>>>> I guess "cpufreq: Call __cpufreq_governor() with correct policy->cpus
>>>>>>>> mask" could be the correct fix, but will try the GIT branch you have
>>>>>>>> mentioned.
>>>>>>>>
>>>>>>>> - Sedat -
>>>>>>>>
>>>>>>>> [1]
>>>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Both BROKEN here, specific pm-next commitid and pulling
>>>>>>> pm.git#linux-next into next-20130411 (see attached files).
>>>>>>>
>>>>>>> Is "cpufreq: convert cpufreq_driver to using RCU" the root cause of this
>>>>>>> all?
>>>>>>>
>>>>>>
>>>>>> [ CC Nathan ]
>>>>>>
>>>>>> NO, wrong assumption.
>>>>>>
>>>>>> 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
>>>>>> "cpufreq: convert cpufreq_driver to using RCU"
>>>>>> 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
>>>>>> __cpufreq_governor() with correct policy->cpus mask"
>>>>>> 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge branch
>>>>>> 'pm-cpufreq-next' into linux-next
>>>>>>
>>>>>> - Sedat -
>>>>>>
>>>>>>
>>>>>>> - Sedat -
>>>>>>>
>>>>>>> [1]
>>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>>>>>>>
>>>>>>>
>>>>>>>>> --
>>>>>>>>> viresh
>>>>>
>>>>> [ TO Dirk (Author of Intel pstate driver) ]
>>>>>
>>>>> With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!
>>>>>
>>>>> My kernel-config and dmesg are attached.
>>>>
>>>> You're seeing a trouble with a new driver, then, so that's not a regression.
>>>>
>>
>> This IS a regression.
>>
>> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
>> called intel_pstate does not implement the target() callback.
>>
>> Nathan's commit 5800043b2 changed the fence around the call to
>> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>>
>> @@ -1007,9 +1068,12 @@ static int __cpufreq_remove_dev(struct device *dev,
>> struct subsys_interface *sif
>> unsigned int cpu = dev->id, ret, cpus;
>> unsigned long flags;
>> struct cpufreq_policy *data;
>> + struct cpufreq_driver *driver;
>> struct kobject *kobj;
>> struct completion *cmp;
>> struct device *cpu_dev;
>> + bool has_target;
>> + int (*exit)(struct cpufreq_policy *policy);
>>
>> pr_debug("%s: unregistering CPU %u\n", __func__, cpu);
>>
>> @@ -1025,14 +1089,19 @@ static int __cpufreq_remove_dev(struct device *dev,
>> struct subsys_interface *sif
>> return -EINVAL;
>> }
>>
>> - if (cpufreq_driver->target)
>> + rcu_read_lock();
>> + driver = rcu_dereference(cpufreq_driver);
>> + has_target = driver->target ? true : false;
>> + exit = driver->exit;
>> + if (has_target)
>> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>>
>> #ifdef CONFIG_HOTPLUG_CPU
>> - if (!cpufreq_driver->setpolicy)
>> + if (!driver->setpolicy)
>> strncpy(per_cpu(cpufreq_cpu_governor, cpu),
>> data->governor->name, CPUFREQ_NAME_LEN);
>> #endif
>> + rcu_read_unlock();
>>
>> WARN_ON(lock_policy_rwsem_write(cpu));
>> cpus = cpumask_weight(data->cpus);
>>
>
> I am not clear at what is at issue. Are you saying __cpufreq_governor can
> change the value of cpufreq_driver->target? I hadn't thought that was allowed
> but if it is the code would need to be fixed.
>

Sorry I think pointing to your patch may have red herring see viresh's mail.

The issue is that __cpufreq_governor() is being called when intel_pstate is the
scaling driver intel_pstate does not implement ->target(). From the stack
trace it looked like this was happening in __cpufreq_remove_dev() so I "assumed"
it was the first instance of the target fence that was failing.

I am rebuilding using the next tree with viresh's patch I will let you know what
I find sorry for the noise.

--Dirk
> Nate

2013-04-15 17:51:57

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Mon, Apr 15, 2013 at 7:22 PM, Viresh Kumar <[email protected]> wrote:
> On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
>> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
>> called intel_pstate does not implement the target() callback.
>>
>> Nathan's commit 5800043b2 changed the fence around the call to
>> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>
> No it isn't.
>
>> + if (has_target)
>> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>
> As it has taken care of this limitation.
>
> BUT some of my earlier patches haven't. :(
> Here is the fix (Sedat please try this and give your tested-by, use the attached
> patch as gmail might break what i am copying in mail)..
>
> Sorry for being late in fixing this issue, i am still down with Tonsil infection
> and fever.. Today only i got some power to fix it after seeing Dirk's mail.
>
> Your tested-by may help me to recover quickly :)
>

Hehe.
Me myself and I was today chez-mon-docteur... Let's see the results on Thursday.
Again, get well soon.

Tested against...

"BROKEN" Linux-Next (next-20130411) with attached patchset (incl.
your cpufreq-next-fixes).

Test-Case...

CONFIG_X86_INTEL_PSTATE=y

root# echo 0 > /sys/devices/system/cpu/cpu3/online

Tested-by: Sedat Dilek <[email protected]>

...did not test on-reboot-case.

( Dirk promised to test as well... )

- Sedat -

> @Rafael: I will probably be down for one more week and so not doing any
> reviews for now... I do check important mails sent directly to me though.
>
> ------------x----------------------x------------------
>
> From: Viresh Kumar <[email protected]>
> Date: Mon, 15 Apr 2013 22:43:57 +0530
> Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
> target()
>
> Some cpufreq drivers implement their own governor and so don't need us to call
> generic governors interface via __cpufreq_governor(). Few recent commits haven't
> obeyed this law well and we saw some regressions.
>
> This patch tries to fix this issue.
>
> Signed-off-by: Viresh Kumar <[email protected]>
> ---
> drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 3564947..a6f6595 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
> cpu, unsigned int sibling,
> struct device *dev)
> {
> struct cpufreq_policy *policy;
> - int ret = 0;
> + int ret = 0, has_target = 0;
> unsigned long flags;
>
> policy = cpufreq_cpu_get(sibling);
> WARN_ON(!policy);
>
> - __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
> + rcu_read_lock();
> + has_target = !!rcu_dereference(cpufreq_driver)->target;
> + rcu_read_unlock();
> +
> + if (has_target)
> + __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>
> lock_policy_rwsem_write(sibling);
>
> @@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
> cpu, unsigned int sibling,
>
> unlock_policy_rwsem_write(sibling);
>
> - __cpufreq_governor(policy, CPUFREQ_GOV_START);
> - __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> + if (has_target) {
> + __cpufreq_governor(policy, CPUFREQ_GOV_START);
> + __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> + }
>
> ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
> if (ret) {
> @@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
> *dev, struct subsys_interface *sif
>
> /* If cpu is last user of policy, free policy */
> if (cpus == 1) {
> - __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
> + if (has_target)
> + __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>
> lock_policy_rwsem_read(cpu);
> kobj = &data->kobj;


Attachments:
dmesg_3.9.0-rc6-next20130411-4-iniza-small_after-cpu3-offline.txt (53.08 kB)
config-3.9.0-rc6-next20130411-4-iniza-small (109.63 kB)
3.9.0-rc6-next20130411-4-iniza-small.patch (4.26 kB)
Download all attachments

2013-04-15 17:57:22

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Mon, Apr 15, 2013 at 7:51 PM, Sedat Dilek <[email protected]> wrote:
> On Mon, Apr 15, 2013 at 7:22 PM, Viresh Kumar <[email protected]> wrote:
>> On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
>>> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
>>> called intel_pstate does not implement the target() callback.
>>>
>>> Nathan's commit 5800043b2 changed the fence around the call to
>>> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>>
>> No it isn't.
>>
>>> + if (has_target)
>>> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>>
>> As it has taken care of this limitation.
>>
>> BUT some of my earlier patches haven't. :(
>> Here is the fix (Sedat please try this and give your tested-by, use the attached
>> patch as gmail might break what i am copying in mail)..
>>
>> Sorry for being late in fixing this issue, i am still down with Tonsil infection
>> and fever.. Today only i got some power to fix it after seeing Dirk's mail.
>>
>> Your tested-by may help me to recover quickly :)
>>
>
> Hehe.
> Me myself and I was today chez-mon-docteur... Let's see the results on Thursday.
> Again, get well soon.
>
> Tested against...
>
> "BROKEN" Linux-Next (next-20130411) with attached patchset (incl.
> your cpufreq-next-fixes).
>
> Test-Case...
>
> CONFIG_X86_INTEL_PSTATE=y
>
> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>
> Tested-by: Sedat Dilek <[email protected]>
>
> ...did not test on-reboot-case.
>
> ( Dirk promised to test as well... )
>

Might be interesting as an extra-confirmation:

root# echo 1 > /sys/devices/system/cpu/cpu3/online

[ dmesg ]

[ 556.101961] smpboot: Booting Node 0 Processor 3 APIC 0x3
[ 556.113158] Disabled fast string operations
[ 556.116621] Intel pstate controlling: cpu 3

- Sedat -

> - Sedat -
>
>> @Rafael: I will probably be down for one more week and so not doing any
>> reviews for now... I do check important mails sent directly to me though.
>>
>> ------------x----------------------x------------------
>>
>> From: Viresh Kumar <[email protected]>
>> Date: Mon, 15 Apr 2013 22:43:57 +0530
>> Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
>> target()
>>
>> Some cpufreq drivers implement their own governor and so don't need us to call
>> generic governors interface via __cpufreq_governor(). Few recent commits haven't
>> obeyed this law well and we saw some regressions.
>>
>> This patch tries to fix this issue.
>>
>> Signed-off-by: Viresh Kumar <[email protected]>
>> ---
>> drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
>> 1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 3564947..a6f6595 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
>> cpu, unsigned int sibling,
>> struct device *dev)
>> {
>> struct cpufreq_policy *policy;
>> - int ret = 0;
>> + int ret = 0, has_target = 0;
>> unsigned long flags;
>>
>> policy = cpufreq_cpu_get(sibling);
>> WARN_ON(!policy);
>>
>> - __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>> + rcu_read_lock();
>> + has_target = !!rcu_dereference(cpufreq_driver)->target;
>> + rcu_read_unlock();
>> +
>> + if (has_target)
>> + __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>>
>> lock_policy_rwsem_write(sibling);
>>
>> @@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
>> cpu, unsigned int sibling,
>>
>> unlock_policy_rwsem_write(sibling);
>>
>> - __cpufreq_governor(policy, CPUFREQ_GOV_START);
>> - __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
>> + if (has_target) {
>> + __cpufreq_governor(policy, CPUFREQ_GOV_START);
>> + __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
>> + }
>>
>> ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
>> if (ret) {
>> @@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
>> *dev, struct subsys_interface *sif
>>
>> /* If cpu is last user of policy, free policy */
>> if (cpus == 1) {
>> - __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>> + if (has_target)
>> + __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>>
>> lock_policy_rwsem_read(cpu);
>> kobj = &data->kobj;

2013-04-15 18:01:33

by Dirk Brandewie

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 04/15/2013 10:51 AM, Sedat Dilek wrote:
> On Mon, Apr 15, 2013 at 7:22 PM, Viresh Kumar <[email protected]> wrote:
>> On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
>>> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
>>> called intel_pstate does not implement the target() callback.
>>>
>>> Nathan's commit 5800043b2 changed the fence around the call to
>>> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>>
>> No it isn't.
>>
>>> + if (has_target)
>>> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>>
>> As it has taken care of this limitation.
>>
>> BUT some of my earlier patches haven't. :(
>> Here is the fix (Sedat please try this and give your tested-by, use the attached
>> patch as gmail might break what i am copying in mail)..
>>
>> Sorry for being late in fixing this issue, i am still down with Tonsil infection
>> and fever.. Today only i got some power to fix it after seeing Dirk's mail.
>>
>> Your tested-by may help me to recover quickly :)
>>
>
> Hehe.
> Me myself and I was today chez-mon-docteur... Let's see the results on Thursday.
> Again, get well soon.
>
> Tested against...
>
> "BROKEN" Linux-Next (next-20130411) with attached patchset (incl.
> your cpufreq-next-fixes).
>
> Test-Case...
>
> CONFIG_X86_INTEL_PSTATE=y
>
> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>
> Tested-by: Sedat Dilek <[email protected]>
>
> ...did not test on-reboot-case.
>
> ( Dirk promised to test as well... )
>

Tested with:
while true
do
echo 0 > online
echo 1 > online
done
For several minutes and rebooting several times seems to have fixed the
issue.

Nathan, Sorry for calling out your patch erroneously I should have paid closer
attention.

Viresh you can add my Tested-by:

Thanks
--Dirk
> - Sedat -
>
>> @Rafael: I will probably be down for one more week and so not doing any
>> reviews for now... I do check important mails sent directly to me though.
>>
>> ------------x----------------------x------------------
>>
>> From: Viresh Kumar <[email protected]>
>> Date: Mon, 15 Apr 2013 22:43:57 +0530
>> Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
>> target()
>>
>> Some cpufreq drivers implement their own governor and so don't need us to call
>> generic governors interface via __cpufreq_governor(). Few recent commits haven't
>> obeyed this law well and we saw some regressions.
>>
>> This patch tries to fix this issue.
>>
>> Signed-off-by: Viresh Kumar <[email protected]>
>> ---
>> drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
>> 1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 3564947..a6f6595 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
>> cpu, unsigned int sibling,
>> struct device *dev)
>> {
>> struct cpufreq_policy *policy;
>> - int ret = 0;
>> + int ret = 0, has_target = 0;
>> unsigned long flags;
>>
>> policy = cpufreq_cpu_get(sibling);
>> WARN_ON(!policy);
>>
>> - __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>> + rcu_read_lock();
>> + has_target = !!rcu_dereference(cpufreq_driver)->target;
>> + rcu_read_unlock();
>> +
>> + if (has_target)
>> + __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>>
>> lock_policy_rwsem_write(sibling);
>>
>> @@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
>> cpu, unsigned int sibling,
>>
>> unlock_policy_rwsem_write(sibling);
>>
>> - __cpufreq_governor(policy, CPUFREQ_GOV_START);
>> - __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
>> + if (has_target) {
>> + __cpufreq_governor(policy, CPUFREQ_GOV_START);
>> + __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
>> + }
>>
>> ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
>> if (ret) {
>> @@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
>> *dev, struct subsys_interface *sif
>>
>> /* If cpu is last user of policy, free policy */
>> if (cpus == 1) {
>> - __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>> + if (has_target)
>> + __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>>
>> lock_policy_rwsem_read(cpu);
>> kobj = &data->kobj;

2013-04-15 18:05:13

by Nathan Zimmer

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 04/15/2013 12:42 PM, Dirk Brandewie wrote:
> On 04/15/2013 10:27 AM, Nathan Zimmer wrote:
>> On 04/15/2013 11:07 AM, Dirk Brandewie wrote:
>>> On 04/13/2013 02:55 AM, Sedat Dilek wrote:
>>>> On Sat, Apr 13, 2013 at 12:51 AM, Rafael J. Wysocki <[email protected]>
>>>> wrote:
>>>>> On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
>>>>>> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek
>>>>>> <[email protected]> wrote:
>>>>>>> On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek
>>>>>>> <[email protected]> wrote:
>>>>>>>> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek
>>>>>>>> <[email protected]> wrote:
>>>>>>>>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar
>>>>>>>>> <[email protected]>
>>>>>>>>> wrote:
>>>>>>>>>> On 10 April 2013 11:44, Sedat Dilek <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>> I found this "[RFC PATCH] kbuild: Build linux-tools package
>>>>>>>>>>> with 'make
>>>>>>>>>>> deb-pkg'" from February 2012.
>>>>>>>>>>> Can't say what happened to it...
>>>>>>>>>>
>>>>>>>>>> Sedat,
>>>>>>>>>>
>>>>>>>>>> Sorry for being late. I am down with Fever and throat
>>>>>>>>>> infection since
>>>>>>>>>> few days.
>>>>>>>>>> Still struggling with it..
>>>>>>>>>>
>>>>>>>>>> There are few things i tried. Firstly the tag: next-20130326
>>>>>>>>>> is bad as
>>>>>>>>>> there are
>>>>>>>>>> some bad commits in cpufreq core in it.
>>>>>>>>>>
>>>>>>>>>> I then tried latest linux-next/master on my Thinkpad (model name
>>>>>>>>>> : Intel(R)
>>>>>>>>>> Core(TM) i7-2640M CPU @ 2.80GHz) and couldn't boot it up. My
>>>>>>>>>> ubuntu
>>>>>>>>>> just hanged.
>>>>>>>>>>
>>>>>>>>>> Then i tried Rafael's linux-next branch
>>>>>>>>>>
>>>>>>>>>> 079576f Merge branch 'pm-cpufreq-next' into linux-next
>>>>>>>>>>
>>>>>>>>>> And couldn't find any issues with it. I am easily able to
>>>>>>>>>> remove/add
>>>>>>>>>> cpus at
>>>>>>>>>> runtime..
>>>>>>>>>>
>>>>>>>>>> Can you give this branch a try?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> OK, you seem to be well again, nice to hear.
>>>>>>>>>
>>>>>>>>> I was doing the whole week spring-cleaning in the apartment of
>>>>>>>>> my parents.
>>>>>>>>> Now, I have some minutes for a compilation run.
>>>>>>>>>
>>>>>>>>> I guess "cpufreq: Call __cpufreq_governor() with correct
>>>>>>>>> policy->cpus
>>>>>>>>> mask" could be the correct fix, but will try the GIT branch
>>>>>>>>> you have
>>>>>>>>> mentioned.
>>>>>>>>>
>>>>>>>>> - Sedat -
>>>>>>>>>
>>>>>>>>> [1]
>>>>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=e4969ebac83fdea78d89c779331396728a4e6199
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> Both BROKEN here, specific pm-next commitid and pulling
>>>>>>>> pm.git#linux-next into next-20130411 (see attached files).
>>>>>>>>
>>>>>>>> Is "cpufreq: convert cpufreq_driver to using RCU" the root
>>>>>>>> cause of this
>>>>>>>> all?
>>>>>>>>
>>>>>>>
>>>>>>> [ CC Nathan ]
>>>>>>>
>>>>>>> NO, wrong assumption.
>>>>>>>
>>>>>>> 2013-04-12 18:04 Sedat Dilek o [revert-cpufreq-rcu] Revert
>>>>>>> "cpufreq: convert cpufreq_driver to using RCU"
>>>>>>> 2013-04-12 18:04 Sedat Dilek o Revert "cpufreq: Call
>>>>>>> __cpufreq_governor() with correct policy->cpus mask"
>>>>>>> 2013-04-11 23:24 Rafael J. Wysocki M─┐ [pm-next-079576f] Merge
>>>>>>> branch
>>>>>>> 'pm-cpufreq-next' into linux-next
>>>>>>>
>>>>>>> - Sedat -
>>>>>>>
>>>>>>>
>>>>>>>> - Sedat -
>>>>>>>>
>>>>>>>> [1]
>>>>>>>> http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5800043b2488a1c4c6e859af860644d37419d58b
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> viresh
>>>>>>
>>>>>> [ TO Dirk (Author of Intel pstate driver) ]
>>>>>>
>>>>>> With CONFIG_X86_INTEL_PSTATE=n (unset) I do not see the call-trace!
>>>>>>
>>>>>> My kernel-config and dmesg are attached.
>>>>>
>>>>> You're seeing a trouble with a new driver, then, so that's not a
>>>>> regression.
>>>>>
>>>
>>> This IS a regression.
>>>
>>> If the intel_pstate driver is being used __cpufreq_governor() should
>>> NOT be
>>> called intel_pstate does not implement the target() callback.
>>>
>>> Nathan's commit 5800043b2 changed the fence around the call to
>>> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant
>>> hunk.
>>>
>>> @@ -1007,9 +1068,12 @@ static int __cpufreq_remove_dev(struct device
>>> *dev,
>>> struct subsys_interface *sif
>>> unsigned int cpu = dev->id, ret, cpus;
>>> unsigned long flags;
>>> struct cpufreq_policy *data;
>>> + struct cpufreq_driver *driver;
>>> struct kobject *kobj;
>>> struct completion *cmp;
>>> struct device *cpu_dev;
>>> + bool has_target;
>>> + int (*exit)(struct cpufreq_policy *policy);
>>>
>>> pr_debug("%s: unregistering CPU %u\n", __func__, cpu);
>>>
>>> @@ -1025,14 +1089,19 @@ static int __cpufreq_remove_dev(struct
>>> device *dev,
>>> struct subsys_interface *sif
>>> return -EINVAL;
>>> }
>>>
>>> - if (cpufreq_driver->target)
>>> + rcu_read_lock();
>>> + driver = rcu_dereference(cpufreq_driver);
>>> + has_target = driver->target ? true : false;
>>> + exit = driver->exit;
>>> + if (has_target)
>>> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>>>
>>> #ifdef CONFIG_HOTPLUG_CPU
>>> - if (!cpufreq_driver->setpolicy)
>>> + if (!driver->setpolicy)
>>> strncpy(per_cpu(cpufreq_cpu_governor, cpu),
>>> data->governor->name, CPUFREQ_NAME_LEN);
>>> #endif
>>> + rcu_read_unlock();
>>>
>>> WARN_ON(lock_policy_rwsem_write(cpu));
>>> cpus = cpumask_weight(data->cpus);
>>>
>>
>> I am not clear at what is at issue. Are you saying
>> __cpufreq_governor can
>> change the value of cpufreq_driver->target? I hadn't thought that
>> was allowed
>> but if it is the code would need to be fixed.
>>
>
> Sorry I think pointing to your patch may have red herring see viresh's
> mail.
>
> The issue is that __cpufreq_governor() is being called when
> intel_pstate is the
> scaling driver intel_pstate does not implement ->target(). From the stack
> trace it looked like this was happening in __cpufreq_remove_dev() so I
> "assumed"
> it was the first instance of the target fence that was failing.
>
> I am rebuilding using the next tree with viresh's patch I will let you
> know what
> I find sorry for the noise.
>
> --Dirk
>> Nate
>
No worries. I would rather see extra noise from linux-next then extra
bugs in the mainline.

2013-04-15 18:07:47

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Mon, Apr 15, 2013 at 7:57 PM, Sedat Dilek <[email protected]> wrote:
> On Mon, Apr 15, 2013 at 7:51 PM, Sedat Dilek <[email protected]> wrote:
>> On Mon, Apr 15, 2013 at 7:22 PM, Viresh Kumar <[email protected]> wrote:
>>> On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
>>>> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
>>>> called intel_pstate does not implement the target() callback.
>>>>
>>>> Nathan's commit 5800043b2 changed the fence around the call to
>>>> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>>>
>>> No it isn't.
>>>
>>>> + if (has_target)
>>>> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>>>
>>> As it has taken care of this limitation.
>>>
>>> BUT some of my earlier patches haven't. :(
>>> Here is the fix (Sedat please try this and give your tested-by, use the attached
>>> patch as gmail might break what i am copying in mail)..
>>>
>>> Sorry for being late in fixing this issue, i am still down with Tonsil infection
>>> and fever.. Today only i got some power to fix it after seeing Dirk's mail.
>>>
>>> Your tested-by may help me to recover quickly :)
>>>
>>
>> Hehe.
>> Me myself and I was today chez-mon-docteur... Let's see the results on Thursday.
>> Again, get well soon.
>>
>> Tested against...
>>
>> "BROKEN" Linux-Next (next-20130411) with attached patchset (incl.
>> your cpufreq-next-fixes).
>>
>> Test-Case...
>>
>> CONFIG_X86_INTEL_PSTATE=y
>>
>> root# echo 0 > /sys/devices/system/cpu/cpu3/online
>>
>> Tested-by: Sedat Dilek <[email protected]>
>>
>> ...did not test on-reboot-case.
>>

Reboot is also fine here.

>> ( Dirk promised to test as well... )
>>

Dirk confirmed your patch works for him.
Good!

- Sedat -

>
> Might be interesting as an extra-confirmation:
>
> root# echo 1 > /sys/devices/system/cpu/cpu3/online
>
> [ dmesg ]
>
> [ 556.101961] smpboot: Booting Node 0 Processor 3 APIC 0x3
> [ 556.113158] Disabled fast string operations
> [ 556.116621] Intel pstate controlling: cpu 3
>
> - Sedat -
>
>> - Sedat -
>>
>>> @Rafael: I will probably be down for one more week and so not doing any
>>> reviews for now... I do check important mails sent directly to me though.
>>>
>>> ------------x----------------------x------------------
>>>
>>> From: Viresh Kumar <[email protected]>
>>> Date: Mon, 15 Apr 2013 22:43:57 +0530
>>> Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
>>> target()
>>>
>>> Some cpufreq drivers implement their own governor and so don't need us to call
>>> generic governors interface via __cpufreq_governor(). Few recent commits haven't
>>> obeyed this law well and we saw some regressions.
>>>
>>> This patch tries to fix this issue.
>>>
>>> Signed-off-by: Viresh Kumar <[email protected]>
>>> ---
>>> drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
>>> 1 file changed, 13 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>>> index 3564947..a6f6595 100644
>>> --- a/drivers/cpufreq/cpufreq.c
>>> +++ b/drivers/cpufreq/cpufreq.c
>>> @@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
>>> cpu, unsigned int sibling,
>>> struct device *dev)
>>> {
>>> struct cpufreq_policy *policy;
>>> - int ret = 0;
>>> + int ret = 0, has_target = 0;
>>> unsigned long flags;
>>>
>>> policy = cpufreq_cpu_get(sibling);
>>> WARN_ON(!policy);
>>>
>>> - __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>>> + rcu_read_lock();
>>> + has_target = !!rcu_dereference(cpufreq_driver)->target;
>>> + rcu_read_unlock();
>>> +
>>> + if (has_target)
>>> + __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>>>
>>> lock_policy_rwsem_write(sibling);
>>>
>>> @@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
>>> cpu, unsigned int sibling,
>>>
>>> unlock_policy_rwsem_write(sibling);
>>>
>>> - __cpufreq_governor(policy, CPUFREQ_GOV_START);
>>> - __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
>>> + if (has_target) {
>>> + __cpufreq_governor(policy, CPUFREQ_GOV_START);
>>> + __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
>>> + }
>>>
>>> ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
>>> if (ret) {
>>> @@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
>>> *dev, struct subsys_interface *sif
>>>
>>> /* If cpu is last user of policy, free policy */
>>> if (cpus == 1) {
>>> - __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>>> + if (has_target)
>>> + __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>>>
>>> lock_policy_rwsem_read(cpu);
>>> kobj = &data->kobj;

2013-04-17 14:04:52

by Sedat Dilek

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Mon, Apr 15, 2013 at 7:22 PM, Viresh Kumar <[email protected]> wrote:
> On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
>> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
>> called intel_pstate does not implement the target() callback.
>>
>> Nathan's commit 5800043b2 changed the fence around the call to
>> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>
> No it isn't.
>
>> + if (has_target)
>> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>
> As it has taken care of this limitation.
>
> BUT some of my earlier patches haven't. :(
> Here is the fix (Sedat please try this and give your tested-by, use the attached
> patch as gmail might break what i am copying in mail)..
>
> Sorry for being late in fixing this issue, i am still down with Tonsil infection
> and fever.. Today only i got some power to fix it after seeing Dirk's mail.
>
> Your tested-by may help me to recover quickly :)
>
> @Rafael: I will probably be down for one more week and so not doing any
> reviews for now... I do check important mails sent directly to me though.
>

Hi Viresh,

can you sent a separate patch on this (with Reported/Tested-by#s)?
AFAICS this is not in pm.git#linux-next?

Regards,
- Sedat -

> ------------x----------------------x------------------
>
> From: Viresh Kumar <[email protected]>
> Date: Mon, 15 Apr 2013 22:43:57 +0530
> Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
> target()
>
> Some cpufreq drivers implement their own governor and so don't need us to call
> generic governors interface via __cpufreq_governor(). Few recent commits haven't
> obeyed this law well and we saw some regressions.
>
> This patch tries to fix this issue.
>
> Signed-off-by: Viresh Kumar <[email protected]>
> ---
> drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 3564947..a6f6595 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
> cpu, unsigned int sibling,
> struct device *dev)
> {
> struct cpufreq_policy *policy;
> - int ret = 0;
> + int ret = 0, has_target = 0;
> unsigned long flags;
>
> policy = cpufreq_cpu_get(sibling);
> WARN_ON(!policy);
>
> - __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
> + rcu_read_lock();
> + has_target = !!rcu_dereference(cpufreq_driver)->target;
> + rcu_read_unlock();
> +
> + if (has_target)
> + __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>
> lock_policy_rwsem_write(sibling);
>
> @@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
> cpu, unsigned int sibling,
>
> unlock_policy_rwsem_write(sibling);
>
> - __cpufreq_governor(policy, CPUFREQ_GOV_START);
> - __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> + if (has_target) {
> + __cpufreq_governor(policy, CPUFREQ_GOV_START);
> + __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> + }
>
> ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
> if (ret) {
> @@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
> *dev, struct subsys_interface *sif
>
> /* If cpu is last user of policy, free policy */
> if (cpus == 1) {
> - __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
> + if (has_target)
> + __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>
> lock_policy_rwsem_read(cpu);
> kobj = &data->kobj;

2013-04-17 16:07:07

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Wednesday, April 17, 2013 04:04:46 PM Sedat Dilek wrote:
> On Mon, Apr 15, 2013 at 7:22 PM, Viresh Kumar <[email protected]> wrote:
> > On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
> >> If the intel_pstate driver is being used __cpufreq_governor() should NOT be
> >> called intel_pstate does not implement the target() callback.
> >>
> >> Nathan's commit 5800043b2 changed the fence around the call to
> >> __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
> >
> > No it isn't.
> >
> >> + if (has_target)
> >> __cpufreq_governor(data, CPUFREQ_GOV_STOP);
> >
> > As it has taken care of this limitation.
> >
> > BUT some of my earlier patches haven't. :(
> > Here is the fix (Sedat please try this and give your tested-by, use the attached
> > patch as gmail might break what i am copying in mail)..
> >
> > Sorry for being late in fixing this issue, i am still down with Tonsil infection
> > and fever.. Today only i got some power to fix it after seeing Dirk's mail.
> >
> > Your tested-by may help me to recover quickly :)
> >
> > @Rafael: I will probably be down for one more week and so not doing any
> > reviews for now... I do check important mails sent directly to me though.
> >
>
> Hi Viresh,
>
> can you sent a separate patch on this (with Reported/Tested-by#s)?
> AFAICS this is not in pm.git#linux-next?

That's because I'm traveling and not pushing things to the tree. I'll start
doing that again on Saturday. Till then, please apply the Viresh's patch
on top of linux-next.

Thanks,
Rafael


> > ------------x----------------------x------------------
> >
> > From: Viresh Kumar <[email protected]>
> > Date: Mon, 15 Apr 2013 22:43:57 +0530
> > Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
> > target()
> >
> > Some cpufreq drivers implement their own governor and so don't need us to call
> > generic governors interface via __cpufreq_governor(). Few recent commits haven't
> > obeyed this law well and we saw some regressions.
> >
> > This patch tries to fix this issue.
> >
> > Signed-off-by: Viresh Kumar <[email protected]>
> > ---
> > drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
> > 1 file changed, 13 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 3564947..a6f6595 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
> > cpu, unsigned int sibling,
> > struct device *dev)
> > {
> > struct cpufreq_policy *policy;
> > - int ret = 0;
> > + int ret = 0, has_target = 0;
> > unsigned long flags;
> >
> > policy = cpufreq_cpu_get(sibling);
> > WARN_ON(!policy);
> >
> > - __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
> > + rcu_read_lock();
> > + has_target = !!rcu_dereference(cpufreq_driver)->target;
> > + rcu_read_unlock();
> > +
> > + if (has_target)
> > + __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
> >
> > lock_policy_rwsem_write(sibling);
> >
> > @@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
> > cpu, unsigned int sibling,
> >
> > unlock_policy_rwsem_write(sibling);
> >
> > - __cpufreq_governor(policy, CPUFREQ_GOV_START);
> > - __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> > + if (has_target) {
> > + __cpufreq_governor(policy, CPUFREQ_GOV_START);
> > + __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> > + }
> >
> > ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
> > if (ret) {
> > @@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
> > *dev, struct subsys_interface *sif
> >
> > /* If cpu is last user of policy, free policy */
> > if (cpus == 1) {
> > - __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
> > + if (has_target)
> > + __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
> >
> > lock_policy_rwsem_read(cpu);
> > kobj = &data->kobj;
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

2013-04-21 23:22:51

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Monday, April 15, 2013 10:52:28 PM Viresh Kumar wrote:
> On 15 April 2013 21:37, Dirk Brandewie <[email protected]> wrote:
> > If the intel_pstate driver is being used __cpufreq_governor() should NOT be
> > called intel_pstate does not implement the target() callback.
> >
> > Nathan's commit 5800043b2 changed the fence around the call to
> > __cpufreq_governor() in __cpufreq_remove_dev() here is the relevant hunk.
>
> No it isn't.
>
> > + if (has_target)
> > __cpufreq_governor(data, CPUFREQ_GOV_STOP);
>
> As it has taken care of this limitation.
>
> BUT some of my earlier patches haven't. :(
> Here is the fix (Sedat please try this and give your tested-by, use the attached
> patch as gmail might break what i am copying in mail)..
>
> Sorry for being late in fixing this issue, i am still down with Tonsil infection
> and fever.. Today only i got some power to fix it after seeing Dirk's mail.
>
> Your tested-by may help me to recover quickly :)
>
> @Rafael: I will probably be down for one more week and so not doing any
> reviews for now... I do check important mails sent directly to me though.
>
> ------------x----------------------x------------------
>
> From: Viresh Kumar <[email protected]>
> Date: Mon, 15 Apr 2013 22:43:57 +0530
> Subject: [PATCH] cpufreq: Don't call __cpufreq_governor() for drivers without
> target()
>
> Some cpufreq drivers implement their own governor and so don't need us to call
> generic governors interface via __cpufreq_governor(). Few recent commits haven't
> obeyed this law well and we saw some regressions.
>
> This patch tries to fix this issue.
>
> Signed-off-by: Viresh Kumar <[email protected]>

Applied to linux-pm.git/linux-next, although please check the result, because
the patchwork version of the patch wasn't quite applicable and I fixed it up
manually.

Thanks,
Rafael


> ---
> drivers/cpufreq/cpufreq.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 3564947..a6f6595 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -858,13 +858,18 @@ static int cpufreq_add_policy_cpu(unsigned int
> cpu, unsigned int sibling,
> struct device *dev)
> {
> struct cpufreq_policy *policy;
> - int ret = 0;
> + int ret = 0, has_target = 0;
> unsigned long flags;
>
> policy = cpufreq_cpu_get(sibling);
> WARN_ON(!policy);
>
> - __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
> + rcu_read_lock();
> + has_target = !!rcu_dereference(cpufreq_driver)->target;
> + rcu_read_unlock();
> +
> + if (has_target)
> + __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>
> lock_policy_rwsem_write(sibling);
>
> @@ -877,8 +882,10 @@ static int cpufreq_add_policy_cpu(unsigned int
> cpu, unsigned int sibling,
>
> unlock_policy_rwsem_write(sibling);
>
> - __cpufreq_governor(policy, CPUFREQ_GOV_START);
> - __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> + if (has_target) {
> + __cpufreq_governor(policy, CPUFREQ_GOV_START);
> + __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
> + }
>
> ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
> if (ret) {
> @@ -1146,7 +1153,8 @@ static int __cpufreq_remove_dev(struct device
> *dev, struct subsys_interface *sif
>
> /* If cpu is last user of policy, free policy */
> if (cpus == 1) {
> - __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
> + if (has_target)
> + __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
>
> lock_policy_rwsem_read(cpu);
> kobj = &data->kobj;
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

2013-04-22 03:14:33

by Viresh Kumar

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On 22 April 2013 05:00, Rafael J. Wysocki <[email protected]> wrote:
> Applied to linux-pm.git/linux-next, although please check the result, because
> the patchwork version of the patch wasn't quite applicable and I fixed it up
> manually.

Yes it looks fine and that's why i have attached the patch with my
email earlier.

2013-04-22 11:52:02

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]

On Monday, April 22, 2013 08:44:30 AM Viresh Kumar wrote:
> On 22 April 2013 05:00, Rafael J. Wysocki <[email protected]> wrote:
> > Applied to linux-pm.git/linux-next, although please check the result, because
> > the patchwork version of the patch wasn't quite applicable and I fixed it up
> > manually.
>
> Yes it looks fine and that's why i have attached the patch with my
> email earlier.

Yes, I forgot about the attachment and saw it again only after I had applied
the patch.

Thanks,
Rafael


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.