Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-06 Thread Huang Rui
On Sat, Jun 04, 2016 at 07:55:08AM -0700, Guenter Roeck wrote: > On 06/03/2016 11:29 AM, Borislav Petkov wrote: > >On Fri, Jun 03, 2016 at 11:18:36AM -0700, Guenter Roeck wrote: > >>I like this version. Applied, though it would be nice to get a > >>Tested-by: or Acked-by: from someone at AMD. I'll

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-04 Thread Guenter Roeck
On 06/03/2016 11:29 AM, Borislav Petkov wrote: On Fri, Jun 03, 2016 at 11:18:36AM -0700, Guenter Roeck wrote: I like this version. Applied, though it would be nice to get a Tested-by: or Acked-by: from someone at AMD. I'll hold back until early next week before sending it to Linus. If it makes

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-03 Thread Borislav Petkov
On Fri, Jun 03, 2016 at 11:18:36AM -0700, Guenter Roeck wrote: > I like this version. Applied, though it would be nice to get a > Tested-by: or Acked-by: from someone at AMD. I'll hold back until > early next week before sending it to Linus. If it makes you feel any better: I have the affected har

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-03 Thread Guenter Roeck
e: Wed, 1 Jun 2016 11:36:13 +0200 > Subject: [PATCH] hwmon: (fam15h_power) Disable preemption when reading > registers > > We need to read a bunch of registers on each compute unit and possibly > on the current CPU too. Disable preemption around it. Otherwise, you > get: >

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-02 Thread Borislav Petkov
On Thu, Jun 02, 2016 at 09:58:30AM +0200, Borislav Petkov wrote: > Ha, very nice! Let me try it. Yap, much better than opencoding on_each_cpu_mask() :-) --- From: Borislav Petkov Date: Wed, 1 Jun 2016 11:36:13 +0200 Subject: [PATCH] hwmon: (fam15h_power) Disable preemption when read

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-02 Thread Borislav Petkov
On Thu, Jun 02, 2016 at 09:47:54AM +0200, Thomas Gleixner wrote: > What's wrong with using: > >on_each_cpu_mask() > > Which does all that magic for you? Ha, very nice! Let me try it. Thanks! -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- To unsubscribe

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-02 Thread Thomas Gleixner
On Thu, 2 Jun 2016, Borislav Petkov wrote: > static int read_registers(struct fam15h_power_data *data) > { > - int this_cpu, ret, cpu; > int core, this_core; > cpumask_var_t mask; > + int ret, cpu; > > ret = zalloc_cpumask_var(&mask, GFP_KERNEL); > if (!ret) > @@

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-02 Thread Borislav Petkov
ATCH] hwmon: (fam15h_power) Disable preemption when reading registers We need to read a bunch of registers on each compute unit and possibly on the current CPU too. Disable preemption around it. Otherwise, you get: BUG: using smp_processor_id() in preemptible [] code: systemd-udevd/327

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-01 Thread Guenter Roeck
On Wed, Jun 01, 2016 at 03:41:26PM +0200, Borislav Petkov wrote: > On Wed, Jun 01, 2016 at 06:22:59AM -0700, Guenter Roeck wrote: > > An explanation would be helpful. Is this a bug fix ? > > That's a good point - yes, it is necessary. Both smp_processor_id() > *and* smp_call_function_many() need t

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-01 Thread Huang, Ray
Sent from my iPad > On Jun 1, 2016, at 11:27 PM, Huang, Ray wrote: > > > >>> On Jun 1, 2016, at 9:23 PM, Guenter Roeck wrote: >>> >>> On 06/01/2016 03:04 AM, Borislav Petkov wrote: >>> From: Borislav Petkov >>> >>> We need to read a bunch of registers on each compute unit and possibly >>>

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-01 Thread Huang, Ray
> On Jun 1, 2016, at 9:23 PM, Guenter Roeck wrote: > >> On 06/01/2016 03:04 AM, Borislav Petkov wrote: >> From: Borislav Petkov >> >> We need to read a bunch of registers on each compute unit and possibly >> on the current CPU too. Disable preemption around it. > > An explanation would be he

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-01 Thread Borislav Petkov
On Wed, Jun 01, 2016 at 06:22:59AM -0700, Guenter Roeck wrote: > An explanation would be helpful. Is this a bug fix ? That's a good point - yes, it is necessary. Both smp_processor_id() *and* smp_call_function_many() need to be called with preemption disabled. It did fire the BUG thing in check_p

Re: [PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-01 Thread Guenter Roeck
On 06/01/2016 03:04 AM, Borislav Petkov wrote: From: Borislav Petkov We need to read a bunch of registers on each compute unit and possibly on the current CPU too. Disable preemption around it. An explanation would be helpful. Is this a bug fix ? I would like to get a confirmation from someo

[PATCH] hwmon: (fam15h_power) Disable preemption when reading registers

2016-06-01 Thread Borislav Petkov
From: Borislav Petkov We need to read a bunch of registers on each compute unit and possibly on the current CPU too. Disable preemption around it. Signed-off-by: Borislav Petkov Cc: Rui Huang Cc: Sherry Hurwitz Cc: Guenter Roeck --- drivers/hwmon/fam15h_power.c | 10 ++ 1 file chang