linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dirk Brandewie <dirk.brandewie@gmail.com>
To: Nathan Zimmer <nzimmer@sgi.com>
Cc: Dirk Brandewie <dirk.brandewie@gmail.com>,
	sedat.dilek@gmail.com, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Dirk Brandewie <dirk.j.brandewie@intel.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	cpufreq@vger.kernel.org, Linux PM list <linux-pm@vger.kernel.org>,
	Lists linaro-kernel <linaro-kernel@lists.linaro.org>
Subject: Re: linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref]
Date: Mon, 15 Apr 2013 10:42:09 -0700	[thread overview]
Message-ID: <516C3BF1.6050902@gmail.com> (raw)
In-Reply-To: <516C3868.40903@sgi.com>

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 <rjw@sisk.pl> wrote:
>>>> On Friday, April 12, 2013 11:08:37 PM Sedat Dilek wrote:
>>>>> On Fri, Apr 12, 2013 at 6:27 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>>>> On Fri, Apr 12, 2013 at 5:45 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>>>>> On Fri, Apr 12, 2013 at 4:24 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>>>>>> On Fri, Apr 12, 2013 at 10:23 AM, Viresh Kumar <viresh.kumar@linaro.org>
>>>>>>>> wrote:
>>>>>>>>> On 10 April 2013 11:44, Sedat Dilek <sedat.dilek@gmail.com> 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


  reply	other threads:[~2013-04-15 17:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+icZUU_K9PiFMqMsOEk1+c2DX8LrUojZptPiRVarv4dcB2qFA@mail.gmail.com>
2013-04-09 14:03 ` linux-next: Tree for Apr 9 [cpufreq: NULL pointer deref] Rafael J. Wysocki
2013-04-09 14:04   ` Sedat Dilek
2013-04-09 14:56     ` Viresh Kumar
2013-04-09 14:59       ` Sedat Dilek
2013-04-09 16:08       ` Sedat Dilek
2013-04-09 16:51         ` Viresh Kumar
2013-04-09 16:57           ` Sedat Dilek
2013-04-09 18:26           ` Sedat Dilek
2013-04-09 18:29             ` Sedat Dilek
2013-04-09 18:39               ` Sedat Dilek
2013-04-09 20:26                 ` Sedat Dilek
2013-04-10  5:41           ` Sedat Dilek
2013-04-10  5:53             ` Sedat Dilek
2013-04-10  6:14               ` Sedat Dilek
2013-04-12  8:23                 ` Viresh Kumar
2013-04-12 14:24                   ` Sedat Dilek
2013-04-12 15:45                     ` Sedat Dilek
2013-04-12 16:27                       ` Sedat Dilek
2013-04-12 21:08                         ` Sedat Dilek
2013-04-12 22:51                           ` Rafael J. Wysocki
2013-04-13  9:55                             ` Sedat Dilek
2013-04-15 16:07                               ` Dirk Brandewie
2013-04-15 16:13                                 ` Sedat Dilek
2013-04-15 17:22                                 ` Viresh Kumar
2013-04-15 17:51                                   ` Sedat Dilek
2013-04-15 17:57                                     ` Sedat Dilek
2013-04-15 18:07                                       ` Sedat Dilek
2013-04-15 18:01                                     ` Dirk Brandewie
2013-04-17 14:04                                   ` Sedat Dilek
2013-04-17 16:14                                     ` Rafael J. Wysocki
2013-04-21 23:30                                   ` Rafael J. Wysocki
2013-04-22  3:14                                     ` Viresh Kumar
2013-04-22 12:00                                       ` Rafael J. Wysocki
2013-04-15 17:27                                 ` Nathan Zimmer
2013-04-15 17:42                                   ` Dirk Brandewie [this message]
2013-04-15 18:05                                     ` Nathan Zimmer
2013-04-09 14:59   ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516C3BF1.6050902@gmail.com \
    --to=dirk.brandewie@gmail.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=dirk.j.brandewie@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nzimmer@sgi.com \
    --cc=rjw@sisk.pl \
    --cc=sedat.dilek@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).