linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] i8k: Fix non-SMP operation
@ 2014-06-21 15:08 Guenter Roeck
  0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2014-06-21 15:08 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, Greg Kroah-Hartman,
	Arnd Bergmann, Guenter Roeck

Commit f36fdb9f0266 (i8k: Force SMM to run on CPU 0) adds support
for multi-core CPUs to the driver. Unfortunately, that causes it
to fail loading if compiled without SMP support, at least on
32 bit kernels. Kernel log shows "i8k: unable to get SMM Dell
signature", and function i8k_smm is found to return -EINVAL.

Testing revealed that the culprit is the missing return value check
of set_cpus_allowed_ptr.

Fixes: f36fdb9f0266 (i8k: Force SMM to run on CPU 0)
Reported-by: Jim Bos <jim876-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
Tested-by: Jim Bos <jim876-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # 3.14+
Signed-off-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
---
 drivers/char/i8k.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index d915707..93dcad0 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -138,7 +138,9 @@ static int i8k_smm(struct smm_regs *regs)
 	if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
 		return -ENOMEM;
 	cpumask_copy(old_mask, &current->cpus_allowed);
-	set_cpus_allowed_ptr(current, cpumask_of(0));
+	rc = set_cpus_allowed_ptr(current, cpumask_of(0));
+	if (rc)
+		goto out;
 	if (smp_processor_id() != 0) {
 		rc = -EBUSY;
 		goto out;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/5] i8k: Fix non-SMP operation
@ 2014-06-21 18:53 Andreas Mohr
       [not found] ` <20140621185359.GA18900-p/qQFhXj4MHA4IYVXhSI5GHfThorsUsI@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Mohr @ 2014-06-21 18:53 UTC (permalink / raw)
  Cc: linux-kernel, linux-api, Greg Kroah-Hartman, Arnd Bergmann,
	Guenter Roeck

Hi,

I'd like to say Thank You for this fix especially and the series in
general, as the (proud??) owner of an I8K (yes you read that right).

My review of your impressive series ended up fine
(I'm sure I'm now missing some official tag somewhere...).

I haven't done runtime evaluation yet though.

Thanks again,

Andreas Mohr

-- 
GNU/Linux. It's not the software that's free, it's you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/5] i8k: Fix non-SMP operation
       [not found] ` <20140621185359.GA18900-p/qQFhXj4MHA4IYVXhSI5GHfThorsUsI@public.gmane.org>
@ 2014-06-23 17:53   ` Guenter Roeck
  0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2014-06-23 17:53 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA, Greg Kroah-Hartman,
	Arnd Bergmann

On 06/21/2014 11:53 AM, Andreas Mohr wrote:
> Hi,
>
> I'd like to say Thank You for this fix especially and the series in
> general, as the (proud??) owner of an I8K (yes you read that right).
>
> My review of your impressive series ended up fine
> (I'm sure I'm now missing some official tag somewhere...).
>
Hi Andreas,

You could send a Reviewed-by: tag as response to each of the patches;
I am sure that would help. Tested-by: would be even better, of course.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-23 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-21 18:53 [PATCH 1/5] i8k: Fix non-SMP operation Andreas Mohr
     [not found] ` <20140621185359.GA18900-p/qQFhXj4MHA4IYVXhSI5GHfThorsUsI@public.gmane.org>
2014-06-23 17:53   ` Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2014-06-21 15:08 Guenter Roeck

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).