[PATCH 3/3] perf tools: Disable user space callchain/stack for function trace event

2014-03-02 Thread Jiri Olsa
User space callchains and user space stack dump were disabled
for function trace event. Mailing list discussions:
  http://marc.info/?t=13930208651r=1w=2
  http://marc.info/?t=13930143733r=1w=2

Catching up with perf and disabling user space callchains and
DWARF unwind (uses user stack dump) for function trace event.

Adding following warnings when callchains are used
for function trace event:

  # perf record -g -e ftrace:function ...
  Disabling user space callchains for function trace event.
  ...

  # ./perf record --call-graph=dwarf -e ftrace:function ...
  Cannot use DWARF unwind for function trace event, falling back to 
framepointers.
  Disabling user space callchains for function trace event.
  ...

Signed-off-by: Jiri Olsa jo...@redhat.com
Cc: Peter Zijlstra a.p.zijls...@chello.nl
Cc: Paul Mackerras pau...@samba.org
Cc: Ingo Molnar mi...@redhat.com
Cc: Arnaldo Carvalho de Melo a...@ghostprotocols.net
Cc: H. Peter Anvin h...@zytor.com
Cc: Vince Weaver vincent.wea...@maine.edu
Cc: Steven Rostedt rost...@goodmis.org
---
 tools/perf/util/evsel.c | 41 ++---
 tools/perf/util/evsel.h | 18 ++
 2 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index adc94dd..26b67b1 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -500,6 +500,34 @@ int perf_evsel__group_desc(struct perf_evsel *evsel, char 
*buf, size_t size)
return ret;
 }
 
+static void
+perf_evsel__config_callgraph(struct perf_evsel *evsel,
+struct record_opts *opts)
+{
+   bool function = perf_evsel__is_function_event(evsel);
+   struct perf_event_attr *attr = evsel-attr;
+
+   perf_evsel__set_sample_bit(evsel, CALLCHAIN);
+
+   if (opts-call_graph == CALLCHAIN_DWARF) {
+   if (!function) {
+   perf_evsel__set_sample_bit(evsel, REGS_USER);
+   perf_evsel__set_sample_bit(evsel, STACK_USER);
+   attr-sample_regs_user = PERF_REGS_MASK;
+   attr-sample_stack_user = opts-stack_dump_size;
+   attr-exclude_callchain_user = 1;
+   } else {
+   pr_info(Cannot use DWARF unwind for function trace 
event,
+falling back to framepointers.\n);
+   }
+   }
+
+   if (function) {
+   pr_info(Disabling user space callchains for function trace 
event.\n);
+   attr-exclude_callchain_user = 1;
+   }
+}
+
 /*
  * The enable_on_exec/disabled value strategy:
  *
@@ -595,17 +623,8 @@ void perf_evsel__config(struct perf_evsel *evsel, struct 
record_opts *opts)
attr-mmap_data = track;
}
 
-   if (opts-call_graph_enabled) {
-   perf_evsel__set_sample_bit(evsel, CALLCHAIN);
-
-   if (opts-call_graph == CALLCHAIN_DWARF) {
-   perf_evsel__set_sample_bit(evsel, REGS_USER);
-   perf_evsel__set_sample_bit(evsel, STACK_USER);
-   attr-sample_regs_user = PERF_REGS_MASK;
-   attr-sample_stack_user = opts-stack_dump_size;
-   attr-exclude_callchain_user = 1;
-   }
-   }
+   if (opts-call_graph_enabled)
+   perf_evsel__config_callgraph(evsel, opts);
 
if (target__has_cpu(opts-target))
perf_evsel__set_sample_bit(evsel, CPU);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index f1b3256..0c9926c 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -315,6 +315,24 @@ static inline bool perf_evsel__is_group_event(struct 
perf_evsel *evsel)
return perf_evsel__is_group_leader(evsel)  evsel-nr_members  1;
 }
 
+/**
+ * perf_evsel__is_function_event - Return whether given evsel is a function
+ * trace event
+ *
+ * @evsel - evsel selector to be tested
+ *
+ * Return %true if event is function trace event
+ */
+static inline bool perf_evsel__is_function_event(struct perf_evsel *evsel)
+{
+#define FUNCTION_EVENT ftrace:function
+
+   return evsel-name 
+  !strncmp(FUNCTION_EVENT, evsel-name, sizeof(FUNCTION_EVENT));
+
+#undef FUNCTION_EVENT
+}
+
 struct perf_attr_details {
bool freq;
bool verbose;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] perf: Disallow user space stack dump for function trace event

2014-03-02 Thread Jiri Olsa
Disabling user space stack dump for function trace event.

Recent issues with user space callchains processing within
page fault handler tracing showed as Peter said 'there's
just too much fail surface'.

The user space stack dump is just another source of the this issue.

Related list discussions:
  http://marc.info/?t=13930208651r=1w=2
  http://marc.info/?t=13930143733r=1w=2

Suggested-by: Peter Zijlstra a.p.zijls...@chello.nl
Signed-off-by: Jiri Olsa jo...@redhat.com
Cc: Peter Zijlstra a.p.zijls...@chello.nl
Cc: Paul Mackerras pau...@samba.org
Cc: Ingo Molnar mi...@redhat.com
Cc: Arnaldo Carvalho de Melo a...@ghostprotocols.net
Cc: H. Peter Anvin h...@zytor.com
Cc: Vince Weaver vincent.wea...@maine.edu
Cc: Steven Rostedt rost...@goodmis.org
---
 kernel/trace/trace_event_perf.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index d5e01c3..c894614 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -42,6 +42,13 @@ static int perf_trace_event_perm(struct ftrace_event_call 
*tp_event,
 */
if (!p_event-attr.exclude_callchain_user)
return -EINVAL;
+
+   /*
+* Same reason to disable user stack dump as for user space
+* callchains above.
+*/
+   if (p_event-attr.sample_type  PERF_SAMPLE_STACK_USER)
+   return -EINVAL;
}
 
/* No tracing, just counting, so no obvious leak */
-- 
1.8.3.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/3] perf: Disable user space dumps for function trace event

2014-03-02 Thread Jiri Olsa
hi,
recent issues with user space callchains processing within
page fault handler tracing showed as Peter said 'there's
just too much fail surface'.

Related list discussions:
  http://marc.info/?t=13930208651r=1w=2
  http://marc.info/?t=13930143733r=1w=2

Disabling user space callchain and stack dump for
function trace event. Plus updating the perf tool
to keep up with those changes.

Reachable here:

thanks,
jirka


Cc: Peter Zijlstra a.p.zijls...@chello.nl
Cc: Paul Mackerras pau...@samba.org
Cc: Ingo Molnar mi...@redhat.com
Cc: Arnaldo Carvalho de Melo a...@ghostprotocols.net
Cc: H. Peter Anvin h...@zytor.com
Cc: Vince Weaver vincent.wea...@maine.edu
Cc: Steven Rostedt rost...@goodmis.org
---
Jiri Olsa (3):
  perf: Disallow user space callchains for function trace event
  perf: Disallow user space stack dump for function trace event
  perf tools: Disable user space callchain/stack for function trace event

 kernel/trace/trace_event_perf.c | 22 +++---
 tools/perf/util/evsel.c | 41 ++---
 tools/perf/util/evsel.h | 18 ++
 3 files changed, 67 insertions(+), 14 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: perf_fuzzer compiled for x32 causes reboot

2014-03-02 Thread Vince Weaver
On Fri, 28 Feb 2014, Steven Rostedt wrote:
 On Fri, 28 Feb 2014 18:34:00 -0500 (EST)
 Vince Weaver vincent.wea...@maine.edu wrote:
 
 But perf_event bug finder is a much more prestigious title than
 college professor ;-)

yes, it's something to fall back on if/when I get denied tenure :)

I do enjoy tracking down bugs like this, it's why I spend a lot of time on 
it when I should probably be doing other things.

 BTW, is the perf_fuzzer code posted somewhere? It sounds like it can be
 really useful for us to do our own testing too.

yes, code is fully available though possibly not publicized well.  I 
posted the full info later in the thread as I seem to be responding to 
e-mails in reverse order today for some reason.

Vince
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] scripts/checkpatch.pl: to give more detailed warning message in case printk is used in any patch

2014-03-02 Thread Yogesh Chaudhari
On 2 March 2014 21:19, Levente Kurusa le...@linux.com wrote:
 Hi,

 2014-03-02 16:40 GMT+01:00 Joe Perches j...@perches.com:
 On Sun, 2014-03-02 at 16:20 +0100, Levente Kurusa wrote:
 IMHO, this message is too big. The one we already have is nice and clean.
 I would simply do: s/netdev/[subsystem]/ or something among the lines.

 maybe:

 Prefer [subsystem eg: netdev]_$level2 then dev_$level2 then pr_$level to 
 printk(KERN_$orig ...\n

 Excellent, that looks the best and combines the best of two worlds.


 or reference the stackoverflow link


 And what if that disappears? Might as well write this to
 Documentation/CodingStyle
 as I have previously mentioned. Yogesh, you want to do this or should I?

I will send in a new patch with both the script file and the
documentation modifications.


 --
 Regards,
 Levente Kurusa


Regards
Yogesh

-- 
DREAM IT, CODE IT
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v21 00/12] Add 32 bit VDSO time function support

2014-03-02 Thread Andy Lutomirski
On Sun, Mar 2, 2014 at 2:47 AM, Ingo Molnar mi...@kernel.org wrote:

 * Stefani Seibold stef...@seibold.net wrote:

 This patch add the functions vdso_gettimeofday(), vdso_clock_gettime()
 and vdso_time() to the 32 bit VDSO.

 What I'm missing from all the series is any trace of the significant
 review and debug work that Andy Lutomirski did for the series. Please
 add Acked-by or Reviewed-by tags to credit his contributions, as
 appropriate. (if Andy is fine with that.)


I'm okay w/ Reviewed-by, except for the patch for 32-bit vdso on
64-bit, which I haven't really reviewed (nor do I feel fully qualified
to review it -- it's a bit of a core change, and I'd prefer for
someone involved in that code to comment on it).

For the patches I wrote, From would be nice :)

OTOH, hpa may prefer incremental patches, now that this lives in tip.

--Andy
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/3] perf: Disable user space dumps for function trace event

2014-03-02 Thread Jiri Olsa
On Sun, Mar 02, 2014 at 04:56:37PM +0100, Jiri Olsa wrote:
 hi,
 recent issues with user space callchains processing within
 page fault handler tracing showed as Peter said 'there's
 just too much fail surface'.
 
 Related list discussions:
   http://marc.info/?t=13930208651r=1w=2
   http://marc.info/?t=13930143733r=1w=2
 
 Disabling user space callchain and stack dump for
 function trace event. Plus updating the perf tool
 to keep up with those changes.
 

Reachable here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/function_trace_fixies_1

jirka
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] x86: Introduce BOOT_EFI and BOOT_CF9 into the reboot sequence loop

2014-03-02 Thread H. Peter Anvin
We are unambiguously dead after BIOS.  There is no retry possible...

On March 2, 2014 2:39:02 AM PST, Li, Aubrey aubrey...@linux.intel.com wrote:
Patch refined as below, welcome any comments.

Thanks,
-Aubrey

[PATCH] x86/reboot: Introduce all of the known reboot methods into the
default list

Reboot is the last service linux OS provides to the end user. We are
supposed to make this function more robust than today. This patch adds
all of the known reboot methods into the default attempt list. The
machines requiring reboot=efi or reboot=p or reboot=bios get a chance
to reboot automatically now.

If there is a new reboot method emerged, we are supposed to add it to
the default list as well, instead of adding the endless dmidecode
entry.

If one method required is in the default list in this patch but the
machine reboot still hangs, that means some methods ahead of the
required method cause the system hangs, then reboot the machine by
passing reboot= arguments and submit the reboot dmidecode table quirk.

We are supposed to remove the reboot dmidecode table from the kernel,
but to be safe, we keep it. This patch prevents us from adding more.
If you happened to have a machine listed in the reboot dmidecode
table and this patch makes reboot work on your machine, please submit
a patch to remove the quirk.

Signed-off-by: Aubrey Li aubrey...@intel.com
---
 arch/x86/kernel/reboot.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index c752cb4..807007f 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -464,9 +464,12 @@ void __attribute__((weak))
mach_reboot_fixups(void)
  * 2) If still alive, write to the keyboard controller
  * 3) If still alive, write to the ACPI reboot register again
  * 4) If still alive, write to the keyboard controller again
+ * 5) If still alive, call the EFI runtime service to reboot
+ * 6) If still alive, write to the PCI IO port 0xCF9 to reboot
+ * 7) If still alive, inform BIOS to do a proper reboot
  *
* If the machine is still alive at this stage, it gives up. We default
to
- * following the same pattern, except that if we're still alive after
(4) we'll
+ * following the same pattern, except that if we're still alive after
(7) we'll
* try to force a triple fault and then cycle between hitting the
keyboard
  * controller and doing that
  */
@@ -502,7 +505,7 @@ static void native_machine_emergency_restart(void)
   attempt = 1;
   reboot_type = BOOT_ACPI;
   } else {
-  reboot_type = BOOT_TRIPLE;
+  reboot_type = BOOT_EFI;
   }
   break;

@@ -516,7 +519,7 @@ static void native_machine_emergency_restart(void)
   case BOOT_BIOS:
   machine_real_restart(MRR_BIOS);

-  reboot_type = BOOT_KBD;
+  reboot_type = BOOT_TRIPLE;
   break;

   case BOOT_ACPI:
@@ -530,7 +533,7 @@ static void native_machine_emergency_restart(void)
EFI_RESET_WARM :
EFI_RESET_COLD,
EFI_SUCCESS, 0, NULL);
-  reboot_type = BOOT_KBD;
+  reboot_type = BOOT_CF9;
   break;

   case BOOT_CF9:
@@ -548,7 +551,7 @@ static void native_machine_emergency_restart(void)
   outb(cf9|reboot_code, 0xcf9);
   udelay(50);
   }
-  reboot_type = BOOT_KBD;
+  reboot_type = BOOT_BIOS;
   break;
   }
   }

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] perf: Disallow user space stack dump for function trace event

2014-03-02 Thread Steven Rostedt
On Sun,  2 Mar 2014 16:56:39 +0100
Jiri Olsa jo...@redhat.com wrote:

 Disabling user space stack dump for function trace event.
 
 Recent issues with user space callchains processing within
 page fault handler tracing showed as Peter said 'there's
 just too much fail surface'.
 
 The user space stack dump is just another source of the this issue.
 
 Related list discussions:
   http://marc.info/?t=13930208651r=1w=2
   http://marc.info/?t=13930143733r=1w=2

For Linux git change logs, it's more preferable to use the kernel.org
link (it may go to the same place, but at least kernel.org has more
control of where it goes in the future).

Link: 
http://lkml.kernel.org/r/alpine.deb.2.10.1402211521040.6...@vincent-weaver-1.um.maine.edu

-- Steve

 
 Suggested-by: Peter Zijlstra a.p.zijls...@chello.nl
 Signed-off-by: Jiri Olsa jo...@redhat.com
 Cc: Peter Zijlstra a.p.zijls...@chello.nl
 Cc: Paul Mackerras pau...@samba.org
 Cc: Ingo Molnar mi...@redhat.com
 Cc: Arnaldo Carvalho de Melo a...@ghostprotocols.net
 Cc: H. Peter Anvin h...@zytor.com
 Cc: Vince Weaver vincent.wea...@maine.edu
 Cc: Steven Rostedt rost...@goodmis.org
 ---
  kernel/trace/trace_event_perf.c | 7 +++
  1 file changed, 7 insertions(+)
 
 diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
 index d5e01c3..c894614 100644
 --- a/kernel/trace/trace_event_perf.c
 +++ b/kernel/trace/trace_event_perf.c
 @@ -42,6 +42,13 @@ static int perf_trace_event_perm(struct ftrace_event_call 
 *tp_event,
*/
   if (!p_event-attr.exclude_callchain_user)
   return -EINVAL;
 +
 + /*
 +  * Same reason to disable user stack dump as for user space
 +  * callchains above.
 +  */
 + if (p_event-attr.sample_type  PERF_SAMPLE_STACK_USER)
 + return -EINVAL;
   }
  
   /* No tracing, just counting, so no obvious leak */

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Four people decided the fate of debian with systemd. Bad faith likely

2014-03-02 Thread One Thousand Gnomes
On Sat, 01 Mar 2014 21:12:25 +
disbandtechc...@tfwno.gf wrote:

 FOUR people made a decision that would once have required
 thousands of votes. FOUR votes overrideds the decision
 debian took before the tech-ctte dictatorship to standardize
 on system V init rather than bsd style init scripts

Wrong mailing list. The kernel doesn't care what init system you use.
Make is really quite good for parallel init in fact.

If you want to fork Debian just *go away and do it*

Alan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] soc: Introduce drivers/soc place-holder for SOC specific drivers

2014-03-02 Thread One Thousand Gnomes
On Fri, 28 Feb 2014 18:18:38 -0500
Santosh Shilimkar santosh.shilim...@ti.com wrote:

 Based on earlier thread https://lkml.org/lkml/2013/10/7/662; and
 further discussion at Kernel Summit'2013, it was agreed to create
 'driver/soc' for drivers which are quite SOC specific.
 
 Lets take the discussion forward with this patch.

So what happens if you put something in say soc/banana and 3 months later
the same IP block shows up in two other devices both of which have their
own soc/ directory already ?

What happens when the same blocks shows up on both a SoC and
later externally ?

Where does a soc specifc gpio driver go ?

It seems to me we've got a lot of confusion here because drivers/ is
split by type, and we've also got arch/* machine specific drivers and
we've got drivers/platform which is intended as far as I can see for
everything you'd put in drivers/soc except for that which goes in arch/*
anyway.

If QMSS is arm specific why isn't it in arch/arm, if it's not why isn't
it in drivers/platform ?

Just trying to understand the point of drivers/soc. 

Alan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 0/7] ARM: dts: omap3-gta04: Various devicetree updates

2014-03-02 Thread Tony Lindgren
* Marek Belisko ma...@goldelico.com [140301 06:02]:
 This updated series fix issue with proper gta04 booting in 3.14 kernel
 and add various devices to devicetree.
 
 Changes from V1: 
 - removed fixes which was merged to 3.14 already
 - add bma180 accelerometer + booting fix
 
 Marek Belisko (2):
   ARM: dts: omap3-gta04: Add ti,omap36xx to compatible property to avoid
 problems with booting
   ARM: dts: omap3-gta04: Add touchscreen properties
 
 NeilBrown (5):
   ARM: dts: omap3-gta04: Add support for magnetometer
   ARM: dts: omap3-gta04: Add twl4030 charger
   ARM: dts: omap3-gta04: Add basic sound support
   ARM: dts: omap3-gta04: Enable mmc2 for wifi
   ARM: dts: omap3-gta04: Add bma180 accelerometer
 
  arch/arm/boot/dts/omap3-gta04.dts | 53 
 +--
  1 file changed, 51 insertions(+), 2 deletions(-)

Thanks for updating these, I'll take the first one into
omap-for-v3.14/fixes and the rest into omap-for-v3.15/dt.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Turn off the bubble machine.

2014-03-02 Thread Gene Heskett
Greetings;

Something is stuck in a loop someplace and I am now being bombarded by 
reject messages from:

Hi. This is the qmail-send program at mail.wdtv.com.
I'm afraid I wasn't able to deliver your message to the following 
addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

imir...@alum.mit.edu:
CNAME lookup failed temporarily. (#4.4.3)
I'm not going to try again; this message has been in the queue too long.

--- Below this line is a copy of the message.

Return-Path: ghesk...@wdtv.com
Received: (qmail 13855 invoked by uid 509); 23 Feb 2014 09:12:26 -0500
Received: from xxx.xxx.xxx.xxx (ghesk...@wdtv.com@xxx.xxx.xxx.xxx) by 
mail.wdtv.com (envelope-from ghesk...@wdtv.com, uid 508) with qmail-
scanner-2.01 
 (clamdscan: 0.88.7/2478. spamassassin: 3.1.7.  
 Clear:RC:0(xxx.xxx.xxx.xxx):SA:0(1.6/5.0):. 
 Processed in 0.58892 secs); 23 Feb 2014 14:12:26 -
X-Spam-Status: No, score=1.6 required=5.0
X-Spam-Level: +
Received: from unknown (HELO coyote.localnet) 
(ghesk...@wdtv.com@xxx.xxx.xxx.xxx)
  by mail.wdtv.com with SMTP; 23 Feb 2014 09:12:26 -0500
From: Gene Heskett ghesk...@wdtv.com
To: Mike Galbraith bitbuc...@online.de
Subject: Re: It BOOTS! 3.13.5 that is.
Date: Sun, 23 Feb 2014 09:12:18 -0500
Cc: Ilia Mirkin imir...@alum.mit.edu,
 linux-kernel@vger.kernel.org linux-kernel@vger.kernel.org
References: 20140022.20370.ghesk...@wdtv.com 
1393135859.30960.8.ca...@marge.simpson.net 
201402230803.31091.ghesk...@wdtv.com
In-Reply-To: 201402230803.31091.ghesk...@wdtv.com
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset=windows-1256
Content-Transfer-Encoding: 7bit
Message-Id: 201402230912.19049.ghesk...@wdtv.com

I am getting about 2 or 3 of these a day. Since about 24 hours after this 
original posting.  So Ilia Mirkin imir...@alum.mit.edu, please do 
whatever it takes to stop this.

Thank You.

Cheers, Gene
-- 
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
Genes Web page http://geneslinuxbox.net:6309/gene

NOTICE: Will pay 100 USD for an HP-4815A defective but
complete probe assembly.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] sched/deadline: Fix regression in cpudl_find.

2014-03-02 Thread Reiter Wolfgang
When using CONFIG_FTRACE_SELFTEST=y and CONFIG_FTRACE_STARTUP_TEST=y
best_cpu is -1 and passed to function cpumask_check which takes
unsigned int.
Fix order of test arguments to avoid oops.
Regression was introduced in commit 82b95800b256205cff2eeab5bbd03430d2d0f20d.

Signed-off-by: Reiter Wolfgang wr0112...@gmail.com
---
 kernel/sched/cpudeadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c
index 5b8838b..a8571e0 100644
--- a/kernel/sched/cpudeadline.c
+++ b/kernel/sched/cpudeadline.c
@@ -117,7 +117,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p,
}
 
 out:
-   WARN_ON(!cpu_present(best_cpu)  best_cpu != -1);
+   WARN_ON(best_cpu != -1  !cpu_present(best_cpu));
 
return best_cpu;
 }
-- 
1.8.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] scripts/checkpatch.pl: to give more detailed warning message in case printk is used in any patch

2014-03-02 Thread Joe Perches
On Sun, 2014-03-02 at 21:51 +0530, Yogesh Chaudhari wrote:
 I will send in a new patch with both the script file and the
 documentation modifications.

Separate patches please.
Changes to CodingStyle generally bring another
round of comments.


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: set Pentium M as PAE capable

2014-03-02 Thread Roland Kletzing
great to see that we have an enhaced version of the initial quick`n`dirty patch
now. i just tested it on ubuntu 13.10 with kernel from 14.04 repository 
(complete 
package build).

works as expected ! hopefully ubuntu #930447 can now be closed soon and the 
patch
will quickly find it´s way into trusty tahr. this is important, because windows 
xp 
is EOL`ed on 8th of april, and there will probably be lot`s of users with older 
notebooks try switching to lubuntu/xubuntu or whatever PAE-only distro. 
( https://wiki.ubuntu.com/TrustyTahr/ReleaseSchedule )

i would recommend adding the newly introduced param to Documentation/kernel-
parameters.txt , though.

Thanks for your work !

Tested-by: Roland Kletzing devz...@web.de


root@ubuntu:/etc# uname -a
Linux ubuntu 3.13.0-14-generic #34 SMP Sat Mar 1 21:27:33 CET 2014 i686 i686 
i686 GNU/Linux
root@ubuntu:/etc# dmesg |grep -C2 -i pae
[0.00] pcpu-alloc: [0] 0
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 127870
[0.00] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.13.0-14-generic 
root=UUID=9ee2e971-296c-4605-a26a-4f9854106ef8 ro 
crashkernel=384M-2G:64M,2G-:128M acpi=off forcepae
[0.00] PID hash table entries: 2048 (order: 1, 8192 bytes)
[0.00] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
--
[0.005403] Initializing cgroup subsys perf_event
[0.005465] Initializing cgroup subsys hugetlb
[0.005571] PAE forced!
[0.005627] Disabling lock debugging due to kernel taint
[0.005697] mce: CPU supports 5 MCE banks

root@ubuntu:/etc# cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model   : 9
model name  : Intel(R) Celeron(R) M processor 1300MHz
stepping: 5
microcode   : 0x45
cpu MHz : 1300.136
cache size  : 512 KB
physical id : 0
siblings: 1
core id : 0
cpu cores   : 1
apicid  : 0
initial apicid  : 0
fdiv_bug: no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
clflush dts acpi mmx fxsr sse sse2 tm pbe bts
bogomips: 2600.27
clflush size: 64
cache_alignment : 64
address sizes   : 36 bits physical, 32 bits virtual
power management:



On Fri, Feb 28, 2014 at 03:27:50PM +0300, Dennis Mungai wrote:
 Hello people,
 
 Note that revisions of the Dothan core were released in the first quarter
 of 2005 with the *Sonoma* chipsets and supported a 533 MT/s FSB and NX-bit
 (and PAE support required for it was enabled, unlike earlier Pentium Ms
 that had it disabled). These processors include the 730M (1.6 GHz), 740M
 (1.73 GHz), 750M (1.86 GHz), 760M (2.0 GHz) and 770M (2.13 GHz). These
 models all have a TDP of 27 W and a 2 MB L2 cache.
 
 These CPUs should have PAE enabled. Only earlier versions of the Pentium M
 ( Older Dothans and the Banias core) do not have PAE support, officially.
 
 -Dennis.

Good point, patch updated to not show the warning if PAE is already
enabled.

Signed-off-by: Chris Bainbridge chris.bainbri...@gmail.com

 */
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Turn off the bubble machine.

2014-03-02 Thread Ilia Mirkin
On Sun, Mar 2, 2014 at 1:27 PM, Gene Heskett ghesk...@wdtv.com wrote:
 Greetings;

 Something is stuck in a loop someplace and I am now being bombarded by
 reject messages from:

 Hi. This is the qmail-send program at mail.wdtv.com.
 I'm afraid I wasn't able to deliver your message to the following
 addresses.
 This is a permanent error; I've given up. Sorry it didn't work out.

 imir...@alum.mit.edu:
 CNAME lookup failed temporarily. (#4.4.3)
 I'm not going to try again; this message has been in the queue too long.

 --- Below this line is a copy of the message.

 Return-Path: ghesk...@wdtv.com
 Received: (qmail 13855 invoked by uid 509); 23 Feb 2014 09:12:26 -0500
 Received: from xxx.xxx.xxx.xxx (ghesk...@wdtv.com@xxx.xxx.xxx.xxx) by
 mail.wdtv.com (envelope-from ghesk...@wdtv.com, uid 508) with qmail-
 scanner-2.01
  (clamdscan: 0.88.7/2478. spamassassin: 3.1.7.
  Clear:RC:0(xxx.xxx.xxx.xxx):SA:0(1.6/5.0):.
  Processed in 0.58892 secs); 23 Feb 2014 14:12:26 -
 X-Spam-Status: No, score=1.6 required=5.0
 X-Spam-Level: +
 Received: from unknown (HELO coyote.localnet)
 (ghesk...@wdtv.com@xxx.xxx.xxx.xxx)
   by mail.wdtv.com with SMTP; 23 Feb 2014 09:12:26 -0500
 From: Gene Heskett ghesk...@wdtv.com
 To: Mike Galbraith bitbuc...@online.de
 Subject: Re: It BOOTS! 3.13.5 that is.
 Date: Sun, 23 Feb 2014 09:12:18 -0500
 Cc: Ilia Mirkin imir...@alum.mit.edu,
  linux-kernel@vger.kernel.org linux-kernel@vger.kernel.org
 References: 20140022.20370.ghesk...@wdtv.com
 1393135859.30960.8.ca...@marge.simpson.net
 201402230803.31091.ghesk...@wdtv.com
 In-Reply-To: 201402230803.31091.ghesk...@wdtv.com
 MIME-Version: 1.0
 Content-Type: Text/Plain;
   charset=windows-1256
 Content-Transfer-Encoding: 7bit
 Message-Id: 201402230912.19049.ghesk...@wdtv.com

 I am getting about 2 or 3 of these a day. Since about 24 hours after this
 original posting.  So Ilia Mirkin imir...@alum.mit.edu, please do
 whatever it takes to stop this.

Sounds like an issue on your end, TBH (or rather, mail.wdtv.com).
alum.mit.edu is not a CNAME and has its own MX records (which in turn
point to A records). I'm not aware of anyone else with this problem
(or at least they haven't told me about it). In any case, I have no
control over alum.mit.edu. If you earnestly believe that it's
something wrong on the MIT end (and I'm _fairly_ sure it's not, based
on the message you sent), you can try contacting n...@mit.edu.

Cheers,

  -ilia
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Bug in fs/kernfs/dir.c comment or code?

2014-03-02 Thread Richard Cochran
I stumbled across this in fs/kernfs/dir.c:39.

/* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
if (hash  1)
hash += 2;
if (hash = INT_MAX)
hash = INT_MAX - 1;

Shouldn't that be (hash  2), or is 1 not reserved?

Thanks,
Richard
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv4 4/7] hwspinlock/core: add common OF helpers

2014-03-02 Thread Bjorn Andersson
On Sat, Mar 1, 2014 at 9:14 PM, Ohad Ben-Cohen o...@wizery.com wrote:
 On Mon, Feb 10, 2014 at 9:14 PM, Suman Anna s-a...@ti.com wrote:
 On 02/07/2014 04:49 PM, Bjorn Andersson wrote:
 It seems to be standard practice to pass the error value back to the
 consumer, so you should
 return ERR_PTR(ret); here instead of the NULL...


 I have modelled the return values in this function based on the return
 values in the existing hwspin_lock_request interfaces. I would need to
 change those functions as well.

 Ohad,
 Do you have any objections to the return code convention change?

 Unless strictly needed, I prefer we don't switch to the ERR_PTR code
 convention, as it reduces code readability and increases chances of
 user bugs.

 In our case, switching to ERR_PTR and friends seems only to optimize a
 few error paths, and I'm not sure it's a big win over simplicity.

When introducing the ability to reference a hwspin lock via a phandle
in device tree it makes a big difference to be able to differ between
the case of initialization failed or device not yet probed; so
that the client knows if it should fail or retry later.

Regards,
Bjorn
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/9] drivers: staging: rtl8187se: fixed checkpatch.pl errors

2014-03-02 Thread axel . rasmussen1
On Saturday 01 March 2014 9:36:31 PM Joe Perches wrote:
 On Sat, 2014-03-01 at 22:22 -0700, Axel Rasmussen wrote:
  The definition of the driver's ChannelPlan array produced a large number
  of checkpatch.pl errors. This patch fixes all of them by adding spaces
  and wrapping the resulting overly-long lines.
 
 I think the current code is better.
 
  diff --git a/drivers/staging/rtl8187se/r8180_core.c
  b/drivers/staging/rtl8187se/r8180_core.c
 []
 
  @@ -2242,17 +2242,44 @@ static void watch_dog_adaptive(unsigned long data)
 
 [for instance]
 
   static struct rtl8187se_channel_list channel_plan_list[] = {
  
  -   {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64},19}, /* FCC 
  */
 
 []
 
  +   /* FCC */
  +   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40,
  +   44, 48, 52, 56, 60, 64}, 19},
 
 If you really do this, it may be better to
 remove the len variable and test for != 0
 instead of channel_plan_list[].len
 
 So instead of:
 
 drivers/staging/rtl8187se/r8180_core.c:
   for (i = 0; i  channel_plan_list[channel_plan].len; 
 i++) {
 Maybe:
   for (i = 0; channel_plan_list[channel_plan].channel[i]; 
 i++) {

True, removing the length and using a 0 terminating element would simplify the 
channel plan list, allowing it to just be a list of arrays, rather than a list 
of structs. The one thing I'd be curious about is, judging by the driver's TODO 
file, it seems that its existing private ieee80211 implementation is going to 
be replaced with one that already exists elsewhere in the kernel, so the entire 
channel plan list may disappear at that point? If true, I'm not sure it's worth 
doing anything very complicated to the existing implementation.

Maybe someone can confirm that this channel plan list will go away once the 
driver is integrated with drivers/net/wireless/rtl818x? Otherwise, I can alter 
this patch to replace struct rtl8187se_channel_list with a simple array of 
channels.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC 0/3] clk: CCF clock primitives + custom IO accessors

2014-03-02 Thread Gerhard Sittig
On Fri, Feb 28, 2014 at 15:34 -0800, Soren Brinkmann wrote:
 
 [ MMIO registers assumed for clock control modules, but I2C
 communication may be involved in other hardware, individual for
 a (set of) clock(s) and not for an architecture or platform ]
 
 Does anybody have a good idea how we could avoid all this code
 duplication while enabling usage of the clock primitives with different
 IO accessors?
 Especially the divider and mux primitive have a lot of code that would
 be painful to maintain twice.

Hasn't past discussion already reached the point where code
duplication of the clock control logic was considered
undesirable, and low level ops were outlined?  I.e. extending
the compile time decision for a specific clk_{read,write}l()
implementation by another potential redirection that is specific
to a clock item?

Re-submitting a series which duplicates complete clock types,
while the difference is only in how registers get accessed, is
quite saddening.


 In the next step, I encountered a divider clock whose divider is stored
 in 2 I2C registers. So now, the simple IO access replacement doesn't
 work anymore either since this clock needs 2 registers to be read and
 then shifting around the bitfields accordingly.

Are the registers adjacent and contain only bit fields for one
clock?  Or do registers share parameters for several clocks, or
are not adjacent?

In the former case you may use a table from divider value to
bit pattern to read/write.  In the latter case, the clock
control module is rather special, and may not be easily get
mapped to the common primitives.  Unless the ll_ops can implement
the required special handling.


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/9] block: Make generic_make_request handle arbitrary sized bios

2014-03-02 Thread Muthu Kumar
Kent,
The blk_queue_split(), splits a bio into at most two bios right? So,
if the original bio spans larger space than two bios can cover
(restriction by the lower driver in the stack), this might not work?
Am I reading it incorrectly?

Thanks!

Regards,
Muthu



On Wed, Feb 26, 2014 at 3:39 PM, Kent Overstreet k...@daterainc.com wrote:
 The way the block layer is currently written, it goes to great lengths
 to avoid having to split bios; upper layer code (such as bio_add_page())
 checks what the underlying device can handle and tries to always create
 bios that don't need to be split.

 But this approach becomes unwieldy and eventually breaks down with
 stacked devices and devices with dynamic limits, and it adds a lot of
 complexity. If the block layer could split bios as needed, we could
 eliminate a lot of complexity elsewhere - particularly in stacked
 drivers. Code that creates bios can then create whatever size bios are
 convenient, and more importantly stacked drivers don't have to deal with
 both their own bio size limitations and the limitations of the
 (potentially multiple) devices underneath them.  In the future this will
 let us delete merge_bvec_fn and a bunch of other code.

 We do this by adding calls to blk_queue_split() to the various
 make_request functions that need it - a few can already handle arbitrary
 size bios. Note that we add the call _after_ any call to blk_queue_bounce();
 this means that blk_queue_split() and blk_recalc_rq_segments() don't need to 
 be
 concerned with bouncing affecting segment merging.

 Some make_request_fns were simple enough to audit and verify they don't
 need blk_queue_split() calls. The skipped ones are:

  * nfhd_make_request (arch/m68k/emu/nfblock.c)
  * axon_ram_make_request (arch/powerpc/sysdev/axonram.c)
  * simdisk_make_request (arch/xtensa/platforms/iss/simdisk.c)
  * brd_make_request (ramdisk - drivers/block/brd.c)
  * loop_make_request
  * null_queue_bio
  * bcache's make_request fns

 Some others are almost certainly safe to remove now, but will be left for 
 future
 patches.

 Signed-off-by: Kent Overstreet k...@daterainc.com
 Cc: Jens Axboe ax...@kernel.dk
 Cc: Neil Brown ne...@suse.de
 Cc: Alasdair Kergon a...@redhat.com
 Cc: dm-de...@redhat.com
 Cc: Lars Ellenberg drbd-...@lists.linbit.com
 Cc: drbd-u...@lists.linbit.com
 Cc: Asai Thambi S P asamymuth...@micron.com
 Cc: Sam Bradshaw sbrads...@micron.com
 Cc: Matthew Wilcox wi...@linux.intel.com
 Cc: linux-n...@lists.infradead.org
 Cc: Jiri Kosina jkos...@suse.cz
 Cc: Geoff Levand ge...@infradead.org
 Cc: Jim Paris j...@jtan.com
 Cc: Joshua Morris josh.h.mor...@us.ibm.com
 Cc: Philip Kelleher pjk1...@linux.vnet.ibm.com
 Cc: Minchan Kim minc...@kernel.org
 Cc: Nitin Gupta ngu...@vflare.org
 Cc: Martin Schwidefsky schwidef...@de.ibm.com
 Cc: Heiko Carstens heiko.carst...@de.ibm.com
 Cc: Peng Tao bergw...@gmail.com
 ---
  block/blk-core.c|  19 ++--
  block/blk-merge.c   | 150 
 ++--
  block/blk-mq.c  |   2 +
  drivers/block/drbd/drbd_req.c   |   2 +
  drivers/block/mtip32xx/mtip32xx.c   |   6 +-
  drivers/block/nvme-core.c   |   2 +
  drivers/block/pktcdvd.c |   6 +-
  drivers/block/ps3vram.c |   2 +
  drivers/block/rsxx/dev.c|   2 +
  drivers/block/umem.c|   2 +
  drivers/block/zram/zram_drv.c   |   2 +
  drivers/md/dm.c |   2 +
  drivers/md/md.c |   2 +
  drivers/s390/block/dcssblk.c|   2 +
  drivers/s390/block/xpram.c  |   2 +
  drivers/staging/lustre/lustre/llite/lloop.c |   2 +
  include/linux/blkdev.h  |   3 +
  17 files changed, 185 insertions(+), 23 deletions(-)

 diff --git a/block/blk-core.c b/block/blk-core.c
 index 853f927492..d3b0782ec3 100644
 --- a/block/blk-core.c
 +++ b/block/blk-core.c
 @@ -581,6 +581,10 @@ struct request_queue *blk_alloc_queue_node(gfp_t 
 gfp_mask, int node_id)
 if (q-id  0)
 goto fail_c;

 +   q-bio_split = bioset_create(4, 0);
 +   if (!q-bio_split)
 +   goto fail_id;
 +
 q-backing_dev_info.ra_pages =
 (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
 q-backing_dev_info.state = 0;
 @@ -590,7 +594,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t 
 gfp_mask, int node_id)

 err = bdi_init(q-backing_dev_info);
 if (err)
 -   goto fail_id;
 +   goto fail_split;

 setup_timer(q-backing_dev_info.laptop_mode_wb_timer,
 laptop_mode_timer_fn, (unsigned long) q);
 @@ -635,6 +639,8 @@ struct request_queue *blk_alloc_queue_node(gfp_t 
 gfp_mask, int node_id)

  fail_bdi:
 bdi_destroy(q-backing_dev_info);
 +fail_split:
 +   bioset_free(q-bio_split);
  fail_id:
   

Re: Turn off the bubble machine.

2014-03-02 Thread Gene Heskett
On Sunday 02 March 2014, Ilia Mirkin wrote:
On Sun, Mar 2, 2014 at 1:27 PM, Gene Heskett ghesk...@wdtv.com wrote:
 Greetings;
 
 Something is stuck in a loop someplace and I am now being bombarded by
 reject messages from:
 
 Hi. This is the qmail-send program at mail.wdtv.com.
 I'm afraid I wasn't able to deliver your message to the following
 addresses.
 This is a permanent error; I've given up. Sorry it didn't work out.
 
 imir...@alum.mit.edu:
 CNAME lookup failed temporarily. (#4.4.3)
 I'm not going to try again; this message has been in the queue too
 long.
 
 --- Below this line is a copy of the message.
 
 Return-Path: ghesk...@wdtv.com
 Received: (qmail 13855 invoked by uid 509); 23 Feb 2014 09:12:26 -0500
 Received: from xxx.xxx.xxx.xxx (ghesk...@wdtv.com@xxx.xxx.xxx.xxx) by
 mail.wdtv.com (envelope-from ghesk...@wdtv.com, uid 508) with qmail-
 scanner-2.01
 
  (clamdscan: 0.88.7/2478. spamassassin: 3.1.7.
  Clear:RC:0(xxx.xxx.xxx.xxx):SA:0(1.6/5.0):.
  Processed in 0.58892 secs); 23 Feb 2014 14:12:26 -
 
 X-Spam-Status: No, score=1.6 required=5.0
 X-Spam-Level: +
 Received: from unknown (HELO coyote.localnet)
 (ghesk...@wdtv.com@xxx.xxx.xxx.xxx)
 
   by mail.wdtv.com with SMTP; 23 Feb 2014 09:12:26 -0500
 
 From: Gene Heskett ghesk...@wdtv.com
 To: Mike Galbraith bitbuc...@online.de
 Subject: Re: It BOOTS! 3.13.5 that is.
 Date: Sun, 23 Feb 2014 09:12:18 -0500
 Cc: Ilia Mirkin imir...@alum.mit.edu,
 
  linux-kernel@vger.kernel.org linux-kernel@vger.kernel.org
 
 References: 20140022.20370.ghesk...@wdtv.com
 1393135859.30960.8.ca...@marge.simpson.net
 201402230803.31091.ghesk...@wdtv.com
 In-Reply-To: 201402230803.31091.ghesk...@wdtv.com
 MIME-Version: 1.0
 Content-Type: Text/Plain;
 
   charset=windows-1256
 
 Content-Transfer-Encoding: 7bit
 Message-Id: 201402230912.19049.ghesk...@wdtv.com
 
 I am getting about 2 or 3 of these a day. Since about 24 hours after
 this original posting.  So Ilia Mirkin imir...@alum.mit.edu, please
 do whatever it takes to stop this.

Sounds like an issue on your end, TBH (or rather, mail.wdtv.com).
alum.mit.edu is not a CNAME and has its own MX records (which in turn
point to A records). I'm not aware of anyone else with this problem
(or at least they haven't told me about it). In any case, I have no
control over alum.mit.edu. If you earnestly believe that it's
something wrong on the MIT end (and I'm _fairly_ sure it's not, based
on the message you sent), you can try contacting n...@mit.edu.

Cheers,

  -ilia

Thanks for responding so quickly Ilia.

It seems to me that if you are on this list, you or mit.edu should expect 
to get Cc's and such, effectively private emails from other members of the 
list.  But for qmail to repeatedly send me I give up bounces is something 
I have not encountered in all the time we've had this server setup, dating 
from 1999.

Where its at I have no clue, so I am making a little noise in hopes there 
might be a clue in the responses.  So this is also being sent to 
n...@mit.edu.  And I am wondering if that will bounce. :)

Cheers, Gene
-- 
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
Genes Web page http://geneslinuxbox.net:6309/gene

NOTICE: Will pay 100 USD for an HP-4815A defective but
complete probe assembly.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] Consistently use xrealloc instead of realloc

2014-03-02 Thread xypron . glpk
From: Heinrich Schuchardt xypron.g...@gmx.de

fdtput.c:
Replace the remaining call to realloc by xrealloc.
Some redundant lines in encode_value can be saved.

Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de
---
 fdtput.c |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fdtput.c b/fdtput.c
index 5226a4e..2a8d674 100644
--- a/fdtput.c
+++ b/fdtput.c
@@ -96,12 +96,7 @@ static int encode_value(struct display_info *disp, char 
**arg, int arg_count,
/* enlarge our value buffer by a suitable margin if needed */
if (upto + len  value_size) {
value_size = (upto + len) + 500;
-   value = realloc(value, value_size);
-   if (!value) {
-   fprintf(stderr, Out of mmory: cannot alloc 
-   %d bytes\n, value_size);
-   return -1;
-   }
+   value = xrealloc(value, value_size);
}
 
ptr = value + upto;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] Remove duplicate assignment

2014-03-02 Thread xypron . glpk
From: Heinrich Schuchardt xypron.g...@gmx.de

Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de
---
 tests/testutils.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/testutils.c b/tests/testutils.c
index f185133..521f4f1 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -144,7 +144,6 @@ int nodename_eq(const char *s1, const char *s2)
 {
int len = strlen(s2);
 
-   len = strlen(s2);
if (strncmp(s1, s2, len) != 0)
return 0;
if (s1[len] == '\0')
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 5/5] phy: mvebu-sata: prepare new Dove DT Kconfig variable

2014-03-02 Thread Sebastian Hesselbarth

On 03/01/2014 02:38 PM, Kishon Vijay Abraham I wrote:

On Saturday 01 March 2014 02:03 PM, Sebastian Hesselbarth wrote:

DT-enabled Dove will move over from ARCH_DOVE in mach-dove to
MACH_DOVE in
mach-mvebu. As non-DT ARCH_DOVE will stay to rot for a while, add a new
DT-only MACH_DOVE Kconfig.

Signed-off-by: Sebastian Hesselbarth sebastian.hesselba...@gmail.com
---
Kishon,

Mark Brown requested to take the corresponding ASoC patch through
his tree. Therefore, I have split the former patch into individual
subsystem
patches. This patch also received an update, to not break bisectability
we add DT-enabled MACH_DOVE and maintain ARCH_DOVE, which is non-DT only
after conversion. ARCH_DOVE will be removed, when legacy mach-dove will
be removed.


Cool.. Should this patch be going through PHY tree?


Yes, please pick it up.

Thanks,
  Sebastian

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] soc: Introduce drivers/soc place-holder for SOC specific drivers

2014-03-02 Thread Olof Johansson
On Sun, Mar 02, 2014 at 05:12:06PM +, One Thousand Gnomes wrote:
 On Fri, 28 Feb 2014 18:18:38 -0500
 Santosh Shilimkar santosh.shilim...@ti.com wrote:
 
  Based on earlier thread https://lkml.org/lkml/2013/10/7/662; and
  further discussion at Kernel Summit'2013, it was agreed to create
  'driver/soc' for drivers which are quite SOC specific.
  
  Lets take the discussion forward with this patch.
 
 So what happens if you put something in say soc/banana and 3 months later
 the same IP block shows up in two other devices both of which have their
 own soc/ directory already ?

This isn't so much about IP blocks as about all the other glue logic and
management functions that vendors so far seem to implement in their own ways.

I don't remember the name we agreed on, I don't think it was drivers/soc --
partly because naming it that brings up the kinds of questions you have.
Paul took it upon himself to start sorting this out (and merge through us on
arm-soc), so he hopefully remembers better than me. :)

 What happens when the same blocks shows up on both a SoC and
 later externally ?
 
 Where does a soc specifc gpio driver go ?

drivers/gpio, of course. This isn't changing that.

 It seems to me we've got a lot of confusion here because drivers/ is
 split by type, and we've also got arch/* machine specific drivers and
 we've got drivers/platform which is intended as far as I can see for
 everything you'd put in drivers/soc except for that which goes in arch/*
 anyway.
 
 If QMSS is arm specific why isn't it in arch/arm, if it's not why isn't
 it in drivers/platform ?

drivers/platform are for specific vendor platforms. I.e. various laptop
vendors, a few server vendors, etc. Code for a whole silicon vendor's driver
does not belong there.

 Just trying to understand the point of drivers/soc. 

Shortcutting most of the discussion by focusing on this question. ;)

We've been struggling to find a home for some of the code that we want to keep
in the kernel tree, and we sat down to talk with (among others) Greg at KS to
try to figure out how to move forward.

The code isn't the pure drivers. Those we find homes for. GPIO, for example, is
a clear choice: they go under drivers/gpio. IRQ controllers under
drivers/irqchip, etc. We've been good at finding the places for these,
including making new homes for them where none was before (pinctrl and clk
subsystems come to mind).

The type of code we were still looking for a home for is the glue code that
tends to be shared between drivers. For example, on a communication chip it
might be queue managers that are shared between SATA, DMA engine, Ethernet
controllers, crypto engines, etc. There's no obvious place for us to locate
that today. Most of this code is handled like a library with the drivers
calling into it.

So, again, it's not for drivers as much as for shared management code. It will
not be used for drivers (the Keystone patch adds an actual driver, so we need
to talk about that as well :).

And as with all other code in the kernel: If we find that more than one
vendor has something compatible, we make them refactor and share the
code when we discover it. It's a method we use now and it's working pretty
well.

Finally, your question on why we're not locating this under arch/*? It's not
architecture-dependent code, some vendors have several SoCs that are very
similar but with different cores of different architectures (MIPS, ARM,
PowerPC, ARM64, etc). So a location outside of arch/ is needed.


-Olof
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/9] block: Make generic_make_request handle arbitrary sized bios

2014-03-02 Thread Muthu Kumar
Never mind...

The following code covers it:


+   if (split) {
+   bio_chain(split, *bio);
+   generic_make_request(*bio);
+   *bio = split;
+   }


My other question is, can we avoid calling the queue_split from
individual drivers make_request()? Can we move the functionality into
generic_make_request()?

Thanks.

Regards,
Muthu


On Sun, Mar 2, 2014 at 12:31 PM, Muthu Kumar muthu.l...@gmail.com wrote:
 Kent,
 The blk_queue_split(), splits a bio into at most two bios right? So,
 if the original bio spans larger space than two bios can cover
 (restriction by the lower driver in the stack), this might not work?
 Am I reading it incorrectly?

 Thanks!

 Regards,
 Muthu



 On Wed, Feb 26, 2014 at 3:39 PM, Kent Overstreet k...@daterainc.com wrote:
 The way the block layer is currently written, it goes to great lengths
 to avoid having to split bios; upper layer code (such as bio_add_page())
 checks what the underlying device can handle and tries to always create
 bios that don't need to be split.

 But this approach becomes unwieldy and eventually breaks down with
 stacked devices and devices with dynamic limits, and it adds a lot of
 complexity. If the block layer could split bios as needed, we could
 eliminate a lot of complexity elsewhere - particularly in stacked
 drivers. Code that creates bios can then create whatever size bios are
 convenient, and more importantly stacked drivers don't have to deal with
 both their own bio size limitations and the limitations of the
 (potentially multiple) devices underneath them.  In the future this will
 let us delete merge_bvec_fn and a bunch of other code.

 We do this by adding calls to blk_queue_split() to the various
 make_request functions that need it - a few can already handle arbitrary
 size bios. Note that we add the call _after_ any call to blk_queue_bounce();
 this means that blk_queue_split() and blk_recalc_rq_segments() don't need to 
 be
 concerned with bouncing affecting segment merging.

 Some make_request_fns were simple enough to audit and verify they don't
 need blk_queue_split() calls. The skipped ones are:

  * nfhd_make_request (arch/m68k/emu/nfblock.c)
  * axon_ram_make_request (arch/powerpc/sysdev/axonram.c)
  * simdisk_make_request (arch/xtensa/platforms/iss/simdisk.c)
  * brd_make_request (ramdisk - drivers/block/brd.c)
  * loop_make_request
  * null_queue_bio
  * bcache's make_request fns

 Some others are almost certainly safe to remove now, but will be left for 
 future
 patches.

 Signed-off-by: Kent Overstreet k...@daterainc.com
 Cc: Jens Axboe ax...@kernel.dk
 Cc: Neil Brown ne...@suse.de
 Cc: Alasdair Kergon a...@redhat.com
 Cc: dm-de...@redhat.com
 Cc: Lars Ellenberg drbd-...@lists.linbit.com
 Cc: drbd-u...@lists.linbit.com
 Cc: Asai Thambi S P asamymuth...@micron.com
 Cc: Sam Bradshaw sbrads...@micron.com
 Cc: Matthew Wilcox wi...@linux.intel.com
 Cc: linux-n...@lists.infradead.org
 Cc: Jiri Kosina jkos...@suse.cz
 Cc: Geoff Levand ge...@infradead.org
 Cc: Jim Paris j...@jtan.com
 Cc: Joshua Morris josh.h.mor...@us.ibm.com
 Cc: Philip Kelleher pjk1...@linux.vnet.ibm.com
 Cc: Minchan Kim minc...@kernel.org
 Cc: Nitin Gupta ngu...@vflare.org
 Cc: Martin Schwidefsky schwidef...@de.ibm.com
 Cc: Heiko Carstens heiko.carst...@de.ibm.com
 Cc: Peng Tao bergw...@gmail.com
 ---
  block/blk-core.c|  19 ++--
  block/blk-merge.c   | 150 
 ++--
  block/blk-mq.c  |   2 +
  drivers/block/drbd/drbd_req.c   |   2 +
  drivers/block/mtip32xx/mtip32xx.c   |   6 +-
  drivers/block/nvme-core.c   |   2 +
  drivers/block/pktcdvd.c |   6 +-
  drivers/block/ps3vram.c |   2 +
  drivers/block/rsxx/dev.c|   2 +
  drivers/block/umem.c|   2 +
  drivers/block/zram/zram_drv.c   |   2 +
  drivers/md/dm.c |   2 +
  drivers/md/md.c |   2 +
  drivers/s390/block/dcssblk.c|   2 +
  drivers/s390/block/xpram.c  |   2 +
  drivers/staging/lustre/lustre/llite/lloop.c |   2 +
  include/linux/blkdev.h  |   3 +
  17 files changed, 185 insertions(+), 23 deletions(-)

 diff --git a/block/blk-core.c b/block/blk-core.c
 index 853f927492..d3b0782ec3 100644
 --- a/block/blk-core.c
 +++ b/block/blk-core.c
 @@ -581,6 +581,10 @@ struct request_queue *blk_alloc_queue_node(gfp_t 
 gfp_mask, int node_id)
 if (q-id  0)
 goto fail_c;

 +   q-bio_split = bioset_create(4, 0);
 +   if (!q-bio_split)
 +   goto fail_id;
 +
 q-backing_dev_info.ra_pages =
 (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
 q-backing_dev_info.state = 0;
 @@ -590,7 +594,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t 
 gfp_mask, int node_id)

 

Re: Re: [PATCH] x86: set Pentium M as PAE capable

2014-03-02 Thread Andreas Mohr
Hi,

   /*
 +  * PAE CPUID bug: Pentium M reports no PAE but has PAE
 +  */

Ain't that a tad strongly/incorrectly worded?

It's probably not certain whether that's a bug.
Prior content in this discussion suggested that the flag might have been
intentionally not advertised, due to not being of sufficient quality
yet in these revisions.
Also, it's not definite that it has PAE in a usable form.

So what about rewording it into an issue, e.g. something like:

PAE CPUID issue: most Pentium M report no PAE but may have PAE
implemented at a potentially usable quality level.

Thank you very much for this important deescalation work of the quite annoying
PAE compat issue! (Pentium M, AMD Geode, VIA C7, (=?) Pentium II, ...)

(BTW, would it be possible to transform Linux's PAE support into
boot-config or even fully runtime-detectable boot switching to
(non-)PAE, similar to or exceeding what XP offers with its static
boot-time flag?
Last time I checked PAE support config defines were spread over ~ 40
kernel source files though :-((()

Andreas Mohr
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: set Pentium M as PAE capable

2014-03-02 Thread H. Peter Anvin
On 03/02/2014 12:56 PM, Andreas Mohr wrote:
 
 (BTW, would it be possible to transform Linux's PAE support into
 boot-config or even fully runtime-detectable boot switching to
 (non-)PAE, similar to or exceeding what XP offers with its static
 boot-time flag?
 Last time I checked PAE support config defines were spread over ~ 40
 kernel source files though :-((()
 

As far as I know the static boottime flag in Windows simply loads one
of several possible kernels.

-hpa


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: set Pentium M as PAE capable

2014-03-02 Thread Dave Jones
On Sun, Mar 02, 2014 at 09:56:19PM +0100, Andreas Mohr wrote:

  (BTW, would it be possible to transform Linux's PAE support into
  boot-config or even fully runtime-detectable boot switching to
  (non-)PAE, similar to or exceeding what XP offers with its static
  boot-time flag?
  Last time I checked PAE support config defines were spread over ~ 40
  kernel source files though :-((()

It would be a considerable amount of work to make it a runtime thing.
Ten years ago, maybe it would be worth the effort perhaps, but I'd
suggest just letting 32-bit slowly die instead of doing dramatic overhauls
that will no doubt introduce a bunch of regressions in code that's been
notoriously awful to debug issues in during the past.

Dave

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v21 00/12] Add 32 bit VDSO time function support

2014-03-02 Thread H. Peter Anvin
On 03/02/2014 08:32 AM, Andy Lutomirski wrote:
 
 OTOH, hpa may prefer incremental patches, now that this lives in tip.
 

The branch currently in -tip is dead, so it is not an issue either way.

-hpa


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: set Pentium M as PAE capable

2014-03-02 Thread Borislav Petkov
On Sun, Mar 02, 2014 at 04:02:01PM -0500, Dave Jones wrote:
 It would be a considerable amount of work to make it a runtime thing.
 Ten years ago, maybe it would be worth the effort perhaps, but I'd
 suggest just letting 32-bit slowly die instead of doing dramatic
 overhauls that will no doubt introduce a bunch of regressions in code
 that's been notoriously awful to debug issues in during the past.

Amen!

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] staging: dgap: remove unneeded status variables

2014-03-02 Thread Alexey Khoroshilov
dgap_driver_start and dgap_Major_Control_Registered are used
to keep status of initialization of the driver as a whole and its Major 
Control.
But the code that checks them is executed once on module init/unload.
That makes no sense in these variables as far as their values are predictable
at any time.

Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru
---
 drivers/staging/dgap/dgap.c | 97 -
 1 file changed, 42 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index cbce457..5271856 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -254,9 +254,6 @@ static int dgap_poll_tick = 20; /* Poll interval - 20 
ms */
 /*
  * Static vars.
  */
-static int dgap_Major_Control_Registered = FALSE;
-static uint dgap_driver_start = FALSE;
-
 static struct class *dgap_class;
 
 static struct board_t *dgap_BoardsByMajor[256];
@@ -561,61 +558,54 @@ static int dgap_start(void)
int rc = 0;
unsigned long flags;
 
-   if (dgap_driver_start == FALSE) {
+   /*
+* make sure that the globals are
+* init'd before we do anything else
+*/
+   dgap_init_globals();
 
-   dgap_driver_start = TRUE;
+   dgap_NumBoards = 0;
 
-   /*
-* make sure that the globals are
-* init'd before we do anything else
-*/
-   dgap_init_globals();
+   pr_info(For the tools package please visit http://www.digi.com\n;);
 
-   dgap_NumBoards = 0;
+   /*
+* Register our base character device into the kernel.
+* This allows the download daemon to connect to the downld device
+* before any of the boards are init'ed.
+*/
 
-   pr_info(For the tools package please visit 
http://www.digi.com\n;);
+   /*
+* Register management/dpa devices
+*/
+   rc = register_chrdev(DIGI_DGAP_MAJOR, dgap, DgapBoardFops);
+   if (rc  0)
+   return rc;
 
-   /*
-* Register our base character device into the kernel.
-* This allows the download daemon to connect to the downld 
device
-* before any of the boards are init'ed.
-*/
-   if (!dgap_Major_Control_Registered) {
-   /*
-* Register management/dpa devices
-*/
-   rc = register_chrdev(DIGI_DGAP_MAJOR, dgap, 
DgapBoardFops);
-   if (rc  0)
-   return rc;
-
-   dgap_class = class_create(THIS_MODULE, dgap_mgmt);
-   device_create(dgap_class, NULL,
-   MKDEV(DIGI_DGAP_MAJOR, 0),
-   NULL, dgap_mgmt);
-   dgap_Major_Control_Registered = TRUE;
-   }
+   dgap_class = class_create(THIS_MODULE, dgap_mgmt);
+   device_create(dgap_class, NULL,
+   MKDEV(DIGI_DGAP_MAJOR, 0),
+   NULL, dgap_mgmt);
 
-   /*
-* Init any global tty stuff.
-*/
-   rc = dgap_tty_preinit();
+   /*
+* Init any global tty stuff.
+*/
+   rc = dgap_tty_preinit();
 
-   if (rc  0)
-   return rc;
+   if (rc  0)
+   return rc;
 
-   /* Start the poller */
-   DGAP_LOCK(dgap_poll_lock, flags);
-   init_timer(dgap_poll_timer);
-   dgap_poll_timer.function = dgap_poll_handler;
-   dgap_poll_timer.data = 0;
-   dgap_poll_time = jiffies + dgap_jiffies_from_ms(dgap_poll_tick);
-   dgap_poll_timer.expires = dgap_poll_time;
-   DGAP_UNLOCK(dgap_poll_lock, flags);
+   /* Start the poller */
+   DGAP_LOCK(dgap_poll_lock, flags);
+   init_timer(dgap_poll_timer);
+   dgap_poll_timer.function = dgap_poll_handler;
+   dgap_poll_timer.data = 0;
+   dgap_poll_time = jiffies + dgap_jiffies_from_ms(dgap_poll_tick);
+   dgap_poll_timer.expires = dgap_poll_time;
+   DGAP_UNLOCK(dgap_poll_lock, flags);
 
-   add_timer(dgap_poll_timer);
+   add_timer(dgap_poll_timer);
 
-   dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
-   }
+   dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
 
return rc;
 }
@@ -677,13 +667,10 @@ void dgap_cleanup_module(void)
 
dgap_remove_driver_sysfiles(dgap_driver);
 
-
-   if (dgap_Major_Control_Registered) {
-   device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
-   device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 1));
-   class_destroy(dgap_class);
-   unregister_chrdev(DIGI_DGAP_MAJOR, dgap);
-   }
+   device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
+ 

[PATCH 3/3] staging: dgap: fix error handling in dgap_init_module()

2014-03-02 Thread Alexey Khoroshilov
No need to call pci_unregister_driver() if pci_register_driver() failed.

Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru
---
 drivers/staging/dgap/dgap.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index b4157d7..510e8b3 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -535,18 +535,13 @@ int dgap_init_module(void)
 * If something went wrong in the scan, bail out of driver.
 */
if (rc  0) {
-   /* Only unregister the pci driver if it was actually 
registered. */
-   if (dgap_NumBoards)
-   pci_unregister_driver(dgap_driver);
-   else
-   printk(WARNING: dgap driver load failed.  No DGAP 
boards found.\n);
-
dgap_cleanup_module();
-   } else {
-   dgap_create_driver_sysfiles(dgap_driver);
-   dgap_driver_state = DRIVER_READY;
+   return rc;
}
 
+   dgap_create_driver_sysfiles(dgap_driver);
+   dgap_driver_state = DRIVER_READY;
+
return rc;
 }
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] staging: dgap: implement proper error handling in dgap_start()

2014-03-02 Thread Alexey Khoroshilov
dgap_start() ignored errors in class_create() and device_create().
The patch implements proper error handling.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru
---
 drivers/staging/dgap/dgap.c | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 5271856..b4157d7 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -557,6 +557,7 @@ static int dgap_start(void)
 {
int rc = 0;
unsigned long flags;
+   struct device *device;
 
/*
 * make sure that the globals are
@@ -582,9 +583,18 @@ static int dgap_start(void)
return rc;
 
dgap_class = class_create(THIS_MODULE, dgap_mgmt);
-   device_create(dgap_class, NULL,
+   if (IS_ERR(dgap_class)) {
+   rc = PTR_ERR(dgap_class);
+   goto failed_class;
+   }
+
+   device = device_create(dgap_class, NULL,
MKDEV(DIGI_DGAP_MAJOR, 0),
NULL, dgap_mgmt);
+   if (IS_ERR(device)) {
+   rc = PTR_ERR(device);
+   goto failed_device;
+   }
 
/*
 * Init any global tty stuff.
@@ -592,7 +602,7 @@ static int dgap_start(void)
rc = dgap_tty_preinit();
 
if (rc  0)
-   return rc;
+   goto failed_tty;
 
/* Start the poller */
DGAP_LOCK(dgap_poll_lock, flags);
@@ -608,6 +618,14 @@ static int dgap_start(void)
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
 
return rc;
+
+failed_tty:
+   device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
+failed_device:
+   class_destroy(dgap_class);
+failed_class:
+   unregister_chrdev(DIGI_DGAP_MAJOR, dgap);
+   return rc;
 }
 
 /*
-- 
1.8.3.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Input: atkbd - add LED triggers for keyboard state

2014-03-02 Thread Jason A. Donenfeld
Many new laptop keyboards aren't shipping with LEDs in the keys for
caps lock, num lock, and scroll lock. They do, however, ship with many LEDs
for specialized functions that mostly go non-utilized by any current
Linux drivers. Having a caps lock LED is very helpful in early boot full
disk encryption, where a fancy GUI is not available to show that caps
lock is activated.

This patch wires in the caps, num, and scroll lock states of the
keyboard into the generic LED trigger subsystem, so that integrators can
have different LEDs activated on caps/num/scroll lock state changes.

Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com
---
 drivers/input/keyboard/atkbd.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 2626773..15061bf 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -28,6 +28,7 @@
 #include linux/libps2.h
 #include linux/mutex.h
 #include linux/dmi.h
+#include linux/leds.h
 
 #define DRIVER_DESCAT and PS/2 keyboard driver
 
@@ -302,6 +303,12 @@ static const unsigned int xl_table[] = {
ATKBD_RET_NAK, ATKBD_RET_HANJA, ATKBD_RET_HANGEUL,
 };
 
+#ifdef CONFIG_LEDS_TRIGGERS
+struct led_trigger *capsl_led_trigger = 0;
+struct led_trigger *numl_led_trigger = 0;
+struct led_trigger *scrolll_led_trigger = 0;
+#endif
+
 /*
  * Checks if we should mangle the scancode to extract 'release' bit
  * in translated mode.
@@ -559,6 +566,12 @@ static int atkbd_set_leds(struct atkbd *atkbd)
if (ps2_command(atkbd-ps2dev, param, ATKBD_CMD_SETLEDS))
return -1;
 
+#ifdef CONFIG_LEDS_TRIGGERS
+   led_trigger_event(capsl_led_trigger, test_bit(LED_CAPSL, dev-led) ? 
LED_FULL : LED_OFF);
+   led_trigger_event(numl_led_trigger, test_bit(LED_NUML, dev-led) ? 
LED_FULL : LED_OFF);
+   led_trigger_event(scrolll_led_trigger, test_bit(LED_SCROLLL, dev-led) 
? LED_FULL : LED_OFF);
+#endif
+
if (atkbd-extra) {
param[0] = 0;
param[1] = (test_bit(LED_COMPOSE, dev-led) ? 0x01 : 0)
@@ -1781,12 +1794,25 @@ static const struct dmi_system_id 
atkbd_dmi_quirk_table[] __initconst = {
 static int __init atkbd_init(void)
 {
dmi_check_system(atkbd_dmi_quirk_table);
+#ifdef CONFIG_LEDS_TRIGGERS
+   led_trigger_register_simple(caps-lock, capsl_led_trigger);
+   led_trigger_register_simple(num-lock, numl_led_trigger);
+   led_trigger_register_simple(scroll-lock, scrolll_led_trigger);
+#endif
 
return serio_register_driver(atkbd_drv);
 }
 
 static void __exit atkbd_exit(void)
 {
+#ifdef CONFIG_LEDS_TRIGGERS
+   led_trigger_unregister_simple(capsl_led_trigger);
+   capsl_led_trigger = 0;
+   led_trigger_unregister_simple(numl_led_trigger);
+   numl_led_trigger = 0;
+   led_trigger_unregister_simple(scrolll_led_trigger);
+   scrolll_led_trigger = 0;
+#endif
serio_unregister_driver(atkbd_drv);
 }
 
-- 
1.8.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ip_set: remove extraneous log message

2014-03-02 Thread Jason A. Donenfeld
This code path is hit everytime a new network namespace is created,
which means it runs everytime I start Chromium, resulting in needless
noise in my logs. This message doesn't add very much at all, and isn't
triggered at the correct place anyway, so this patch simply removes it.

Signed-off-by: Jason A. Donenfeld ja...@zx2c4.com
---
 net/netfilter/ipset/ip_set_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/netfilter/ipset/ip_set_core.c 
b/net/netfilter/ipset/ip_set_core.c
index de770ec..283f197 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -1945,7 +1945,6 @@ ip_set_net_init(struct net *net)
return -ENOMEM;
inst-is_deleted = 0;
rcu_assign_pointer(inst-ip_set_list, list);
-   pr_notice(ip_set: protocol %u\n, IPSET_PROTOCOL);
return 0;
 }
 
-- 
1.8.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: set Pentium M as PAE capable

2014-03-02 Thread Andreas Mohr
On Sun, Mar 02, 2014 at 10:04:19PM +0100, Borislav Petkov wrote:
 On Sun, Mar 02, 2014 at 04:02:01PM -0500, Dave Jones wrote:
  It would be a considerable amount of work to make it a runtime thing.
  Ten years ago, maybe it would be worth the effort perhaps, but I'd
  suggest just letting 32-bit slowly die instead of doing dramatic
  overhauls that will no doubt introduce a bunch of regressions in code
  that's been notoriously awful to debug issues in during the past.
 
 Amen!

Did I just smell two or three historically burnt fingers? ;)

While that was slightly disheartening, thanks for the very fast clarification,
Dave et al.!

Andreas Mohr
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH]sched/rt: Reduce race between inc_rt_group and do_sched_rt_period_timer

2014-03-02 Thread Kirill Tkhai
Function do_sched_rt_period_timer() iterates through runqueues sequentially.
This makes it racy with inc_rt_group(). Sometimes when timer callback is
running we may skip hrtimer restart.

On the one hand it's not good to skip bandwidth timer. On the other hand,
there is no simple fix to complitelly get rid of the race.

So, let's use a fix, which is fast and simple and almost complitelly
reduces the race. It makes race probability very small.

Signed-off-by: Kirill Tkhai tk...@yandex.ru
CC: Peter Zijlstra pet...@infradead.org
CC: Ingo Molnar mi...@redhat.com
---
 kernel/sched/rt.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index facc824..db5303f 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -923,11 +923,23 @@ static void update_curr_rt(struct rq *rq)
rt_rq = rt_rq_of_se(rt_se);
 
if (sched_rt_runtime(rt_rq) != RUNTIME_INF) {
+   bool exceed;
raw_spin_lock(rt_rq-rt_runtime_lock);
rt_rq-rt_time += delta_exec;
-   if (sched_rt_runtime_exceeded(rt_rq))
-   resched_task(curr);
+   exceed = sched_rt_runtime_exceeded(rt_rq);
raw_spin_unlock(rt_rq-rt_runtime_lock);
+
+   if (exceed) {
+   resched_task(curr);
+   /*
+* The pair do_sched_rt_period_timer() and
+* inc_rt_group() is racy. Sometimes we may
+* have enqueued task and stopped timer
+* at this point. We reduce the race and
+* make its probability extremely small.
+*/
+   start_rt_bandwidth(sched_rt_bandwidth(rt_rq));
+   }
}
}
 }
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] Update source code location for dtc in manual.txt

2014-03-02 Thread xypron . glpk
From: Heinrich Schuchardt xypron.g...@gmx.de

The information about the location of the source code of the
device tree compiler was inaccurate.

Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de
---
 Documentation/manual.txt |   21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/Documentation/manual.txt b/Documentation/manual.txt
index 65c8540..0a8e6d5 100644
--- a/Documentation/manual.txt
+++ b/Documentation/manual.txt
@@ -30,25 +30,22 @@ I - dtc, the device tree compiler
 
 1) Sources
 
-Source code for the Device Tree Compiler can be found at jdl.com.
-The gitweb interface is:
+Source code for the Device Tree Compiler can be found at git.kernel.org.
 
-http://git.jdl.com/gitweb/
+The upstream repository is here:
 
-The repository is here:
+git://git.kernel.org/pub/scm/utils/dtc/dtc.git
+https://git.kernel.org/pub/scm/utils/dtc/dtc.git
 
-git://www.jdl.com/software/dtc.git
-http://www.jdl.com/software/dtc.git
+The gitweb interface for the upstream respository is:
 
-Tarballs of the 1.0.0 and latest releases are here:
-
-http://www.jdl.com/software/dtc-v1.2.0.tgz
-http://www.jdl.com/software/dtc-latest.tgz
+https://git.kernel.org/cgit/utils/dtc/dtc.git/ 
 
 1.1) Submitting Patches
 
-Patches should be sent to j...@jdl.com, and CC'ed to
-devicetree-disc...@lists.ozlabs.org.
+Patches should be sent to the maintainers as determined with
+scripts/get_maintainer.pl of the Linux Kernel source and CC'ed to
+devicetree-compi...@vger.kernel.org.
 
 2) Description
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: set Pentium M as PAE capable

2014-03-02 Thread Gene Heskett
On Sunday 02 March 2014, Dave Jones wrote:
On Sun, Mar 02, 2014 at 09:56:19PM +0100, Andreas Mohr wrote:
  (BTW, would it be possible to transform Linux's PAE support into
  boot-config or even fully runtime-detectable boot switching to
  (non-)PAE, similar to or exceeding what XP offers with its static
  boot-time flag?
  Last time I checked PAE support config defines were spread over ~ 40
  kernel source files though :-((()

It would be a considerable amount of work to make it a runtime thing.
Ten years ago, maybe it would be worth the effort perhaps, but I'd
suggest just letting 32-bit slowly die instead of doing dramatic
overhauls that will no doubt introduce a bunch of regressions in code
that's been notoriously awful to debug issues in during the past.

   Dave

There is a fly in that soup Dave, and that is the speed in a truly real 
time required environment.  IRQ latencies once the 32 bit scene have been 
left behind, either by PAE or a full 64 bit build are not at all well 
defined, and are of sufficient magnitudes in terms of the timing jitter, as 
to nearly destroy our ability to use software step generation to control 
our machine tools.  A motor being stepped every 200 microseconds (thats 
actually slow) will lose 50% of its available torque if the timing jitter 
in the step issuance is 10% of the period.

We routinely expect 2 to 3 u-s jitters on an Atom board running a 32 bit, 
RTAI enhanced build of what is by now a 5 year old kernel.  This is 
extremely board sensitive, and that same kernel running on this 4 core 
phenom, cannot stay inside of 40 u-s.  A case of more horsepower not being 
a good deal at all.

OTOH, we (LinuxCNC) are a very small user group. I just want to make you 
aware that we exist. We do retrofits mostly, because our software can make 
the part faster, but I would estimate there are 5 to 10k machines out there 
in the major manufacturing scene running our software, and that they 
include some of the heaviest hitters in the auto making business.

Cheers, Gene
-- 
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
Genes Web page http://geneslinuxbox.net:6309/gene

NOTICE: Will pay 100 USD for an HP-4815A defective but
complete probe assembly.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] Staging driver fixes for 3.14-rc5

2014-03-02 Thread Greg KH
The following changes since commit cfbf8d4857c26a8a307fb7cd258074c9dcd8c691:

  Linux 3.14-rc4 (2014-02-23 17:40:03 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ 
tags/staging-3.14-rc5

for you to fetch changes up to 9f4a9b83f13544df61efd3645308f64205dc8db9:

  Merge iio fixes into staging-linus (2014-03-02 14:04:01 -0800)



Staging tree fixes for 3.14-rc5

Here are a few IIO fixes, and a new device id for a staging driver for
3.14-rc5.  All have been in linux-next for a while, I did a final merge
to get the IIO fixes into this tree, they were incorrectly in the
char-misc tree for a few weeks, and I forgot to tell you to pull them
from there.  This makes it a single pull request for you.

Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org


Beomho Seo (2):
  iio: cm36651: Fix read/write integration time function.
  iio: cm32181: Change cm32181 ambient light sensor driver

Denis CIOCCA (1):
  iio:gyro: bug on L3GD20H gyroscope support

Greg Kroah-Hartman (4):
  Merge tag 'iio-fixes-for-3.14c' of git://git.kernel.org/.../jic23/iio 
into char-misc-linus
  Merge 3.14-rc4 into char-misc-linus
  Merge tag 'fixes-for-3.14d' of git://git.kernel.org/.../jic23/iio into 
staging-linus
  Merge iio fixes into staging-linus

Juergen Beisert (1):
  staging:iio:adc:MXS:LRADC: fix touchscreen statemachine

Manu Gupta (1):
  staging: r8188eu: Add new device ID

 drivers/iio/gyro/Kconfig|  2 +-
 drivers/iio/gyro/st_gyro.h  |  1 -
 drivers/iio/gyro/st_gyro_core.c |  9 +++---
 drivers/iio/gyro/st_gyro_i2c.c  |  1 -
 drivers/iio/gyro/st_gyro_spi.c  |  1 -
 drivers/iio/light/cm32181.c | 16 +-
 drivers/iio/light/cm36651.c | 45 +++--
 drivers/staging/iio/adc/mxs-lradc.c |  1 +
 drivers/staging/rtl8188eu/os_dep/usb_intf.c |  1 +
 9 files changed, 38 insertions(+), 39 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] Driver core fix for 3.14-rc5

2014-03-02 Thread Greg KH
The following changes since commit 6d0abeca3242a88cab8232e4acd7e2bf088f3bc2:

  Linux 3.14-rc3 (2014-02-16 13:30:25 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/ 
tags/driver-core-3.14-rc5

for you to fetch changes up to fed95bab8d29b928fcf6225be72d37ded452e8a2:

  sysfs: fix namespace refcnt leak (2014-02-25 07:37:52 -0800)


Driver core fix for 3.14-rc5

Here is a single sysfs fix for 3.14-rc5.  It fixes a reported problem
with the namespace code in sysfs.

Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org


Li Zefan (1):
  sysfs: fix namespace refcnt leak

 fs/kernfs/mount.c  | 8 +++-
 fs/sysfs/mount.c   | 5 +++--
 include/linux/kernfs.h | 9 +
 3 files changed, 15 insertions(+), 7 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] USB fixes for 3.14-rc5

2014-03-02 Thread Greg KH
The following changes since commit cfbf8d4857c26a8a307fb7cd258074c9dcd8c691:

  Linux 3.14-rc4 (2014-02-23 17:40:03 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ 
tags/usb-3.14-rc5

for you to fetch changes up to a1227f3c1030e96ebc51d677d2f636268845c5fb:

  usb: ehci: fix deadlock when threadirqs option is used (2014-02-26 15:46:42 
-0800)


USB fixes for 3.14-rc5

Here are 2 USB patches for 3.14-rc5, one a new device id, and the other
fixes a reported problem with threaded irqs and the USB EHCI driver.

Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org


Joerg Dorchain (1):
  USB: ftdi_sio: add Cressi Leonardo PID

Stanislaw Gruszka (1):
  usb: ehci: fix deadlock when threadirqs option is used

 drivers/usb/host/ehci-hcd.c   | 13 ++---
 drivers/usb/serial/ftdi_sio.c |  2 ++
 drivers/usb/serial/ftdi_sio_ids.h |  6 ++
 3 files changed, 18 insertions(+), 3 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] x86: Introduce BOOT_EFI and BOOT_CF9 into the reboot sequence loop

2014-03-02 Thread Li, Aubrey
On 2014/3/3 0:52, H. Peter Anvin wrote:
 We are unambiguously dead after BIOS.  There is no retry possible...

No really. Given that we add all of the known methods into the default
list, and BIOS is the last method, if your system hits BIOS, that means
ACPI/KBD/EFI/PCI can't make your system reboot, so BIOS should make it
work.

If you have a system can't be rebooted by all of the known methods, we
have to figure out how to make reboot work and add the new methods.

Does this make sense?

Thanks,
-Aubrey


 
 On March 2, 2014 2:39:02 AM PST, Li, Aubrey aubrey...@linux.intel.com 
 wrote:
 Patch refined as below, welcome any comments.

 Thanks,
 -Aubrey

 [PATCH] x86/reboot: Introduce all of the known reboot methods into the
 default list

 Reboot is the last service linux OS provides to the end user. We are
 supposed to make this function more robust than today. This patch adds
 all of the known reboot methods into the default attempt list. The
 machines requiring reboot=efi or reboot=p or reboot=bios get a chance
 to reboot automatically now.

 If there is a new reboot method emerged, we are supposed to add it to
 the default list as well, instead of adding the endless dmidecode
 entry.

 If one method required is in the default list in this patch but the
 machine reboot still hangs, that means some methods ahead of the
 required method cause the system hangs, then reboot the machine by
 passing reboot= arguments and submit the reboot dmidecode table quirk.

 We are supposed to remove the reboot dmidecode table from the kernel,
 but to be safe, we keep it. This patch prevents us from adding more.
 If you happened to have a machine listed in the reboot dmidecode
 table and this patch makes reboot work on your machine, please submit
 a patch to remove the quirk.

 Signed-off-by: Aubrey Li aubrey...@intel.com
 ---
 arch/x86/kernel/reboot.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

 diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
 index c752cb4..807007f 100644
 --- a/arch/x86/kernel/reboot.c
 +++ b/arch/x86/kernel/reboot.c
 @@ -464,9 +464,12 @@ void __attribute__((weak))
 mach_reboot_fixups(void)
  * 2) If still alive, write to the keyboard controller
  * 3) If still alive, write to the ACPI reboot register again
  * 4) If still alive, write to the keyboard controller again
 + * 5) If still alive, call the EFI runtime service to reboot
 + * 6) If still alive, write to the PCI IO port 0xCF9 to reboot
 + * 7) If still alive, inform BIOS to do a proper reboot
  *
 * If the machine is still alive at this stage, it gives up. We default
 to
 - * following the same pattern, except that if we're still alive after
 (4) we'll
 + * following the same pattern, except that if we're still alive after
 (7) we'll
 * try to force a triple fault and then cycle between hitting the
 keyboard
  * controller and doing that
  */
 @@ -502,7 +505,7 @@ static void native_machine_emergency_restart(void)
  attempt = 1;
  reboot_type = BOOT_ACPI;
  } else {
 -reboot_type = BOOT_TRIPLE;
 +reboot_type = BOOT_EFI;
  }
  break;

 @@ -516,7 +519,7 @@ static void native_machine_emergency_restart(void)
  case BOOT_BIOS:
  machine_real_restart(MRR_BIOS);

 -reboot_type = BOOT_KBD;
 +reboot_type = BOOT_TRIPLE;
  break;

  case BOOT_ACPI:
 @@ -530,7 +533,7 @@ static void native_machine_emergency_restart(void)
   EFI_RESET_WARM :
   EFI_RESET_COLD,
   EFI_SUCCESS, 0, NULL);
 -reboot_type = BOOT_KBD;
 +reboot_type = BOOT_CF9;
  break;

  case BOOT_CF9:
 @@ -548,7 +551,7 @@ static void native_machine_emergency_restart(void)
  outb(cf9|reboot_code, 0xcf9);
  udelay(50);
  }
 -reboot_type = BOOT_KBD;
 +reboot_type = BOOT_BIOS;
  break;
  }
  }
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[char-misc 3.14] mei: me: do not reset when less than expected data is received

2014-03-02 Thread Tomas Winkler
There is a race in ME hardware between data copy for host and interrupt
delivery. An interrupt can be delivered prior to whole data copied for the
host to read but rather then going trough the reset we just merely need to
wait for the next interrupt.

The bug is visible in read/write stress with multiple connections per client

This is a regression caused as a side effect of the commit:
commit 544f94601409653f07ae6e22d4a39e3a90dceead
mei: do not run reset flow from the interrupt thread

Signed-off-by: Tomas Winkler tomas.wink...@intel.com
---
 drivers/misc/mei/hw-me.c | 9 +
 drivers/misc/mei/interrupt.c | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 6f656c0..50d8b53 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -510,7 +510,16 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void 
*dev_id)
break;
dev_dbg(dev-pdev-dev, slots to read = %08x\n, slots);
rets = mei_irq_read_handler(dev, complete_list, slots);
+   /* There is a race between ME write and interrupt delivery:
+* Not all data is always available immediately after the
+* interrupt, so try to read again on the next interrupt.
+*/
+   if (rets == -ENODATA)
+   break;
+
if (rets  dev-dev_state != MEI_DEV_RESETTING) {
+   dev_err(dev-pdev-dev, mei_irq_read_handler ret = 
%d.\n,
+   rets);
schedule_work(dev-reset_work);
goto end;
}
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index f0fbb51..c677438 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -323,7 +323,7 @@ int mei_irq_read_handler(struct mei_device *dev,
dev_err(dev-pdev-dev, less data available than 
length=%08x.\n,
*slots);
/* we can't read the message */
-   ret = -ERANGE;
+   ret = -ENODATA;
goto end;
}
 
-- 
1.8.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] x86: Introduce BOOT_EFI and BOOT_CF9 into the reboot sequence loop

2014-03-02 Thread Matthew Garrett
On Mon, Mar 03, 2014 at 06:13:47AM +0800, Li, Aubrey wrote:

 If you have a system can't be rebooted by all of the known methods, we
 have to figure out how to make reboot work and add the new methods.

The only methods used by Windows are the keyboard controller, the ACPI 
registers and (according to your results) the EFI reboot mechanism. If 
none of those work under Linux but Windows is able to reboot 
successfully then we don't need to add new methods, we need to find out 
why the existing methods don't work.

-- 
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Four people decided the fate of debian with systemd. Bad faith likely - SysV is fine

2014-03-02 Thread NoTo CTTE
You say nothing because there is nothing that you can say.

Simplicity is beautiful, and it works.

Systemd is a nightmare, but you are using politics and psyops to push it on
every single linux user, every distro, everywhere.

I showed you code that does your vaunted concurrent boot systemdde in a few
lines of shell.

That simplicity was the way unix and linux was, before the windows programmers
and the govt funded companies sunk their teeth into linux.

You know what  does.
I guess not, you're too new to gnu.

--- y...@marupa.net wrote:

From: y...@marupa.net
To: usspookslovesys...@muchomail.com
Subject: Re: Four people decided the fate of debian with systemd. Bad faith 
likely - SysV is fine
Date: Sun, 02 Mar 2014 16:15:41 -0600

On Sunday, March 02, 2014 02:12:48 PM NoTo CTTE wrote:
 System V is NOT hard to maintain
 The scripts were written YEARS ago. They're fine. They do NOT need to be
 changed. Debian SysV has concurrent boot aswell.
 
 Systemd is a poison apple. 200k lines of unaudited root privlege code. A
 consulting service to go along with this new _operating system_
 
 Here's an under 100 line init with concurrent boot:
 
 #include signal.h
 #include unistd.h
 
 int main()
 {
 sigset_t set;
 int status;
 
 if (getpid() != 1) return 1;
 
 sigfillset(set);
 sigprocmask(SIG_BLOCK, set, 0);
 
 if (fork()) for (;;) wait(status);
 
 sigprocmask(SIG_UNBLOCK, set, 0);
 
 setsid();
 setpgid(0, 0);
 return execve(/etc/rc, (char *[]){ rc, 0 }, (char *[]){ 0 });
 }
 
 /etc/rc is a shell script
 syslogd  getty ; udev ; network-config ; sshd  cron  nginx
 
 see how much bullsht systemd is.
 
 
 _
 The Free Email with so much more!
 = http://www.MuchoMail.com =

It'd be almost too easy to mock a laughable post like this, but I'll let 
someone else do it. It's just not fun anymore.

Conrad




_
The Free Email with so much more!
= http://www.MuchoMail.com =
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Four people decided the fate of debian with systemd. Bad faith likely - SysV is fine

2014-03-02 Thread yaro

Fine, I'll just poke at this reply since it's that asinine. But this is 
probably my last post in this thread since the idiocy from this poster has 
gone from curiously amusing to stupidly annoying.

By the way, I noticed you changed your fake email at least once in this 
thread. I'm guessing you noticed people are starting to block you. Ever think 
why?

On Sunday, March 02, 2014 02:23:52 PM NoTo CTTE wrote:
 You say nothing because there is nothing that you can say.
 

I say nothing because you're just insulting my intelligence.

 Simplicity is beautiful, and it works.
 

Initscripts are not simple. At all. Have you even looked at an initscript? I'm 
thinking no.

 Systemd is a nightmare, 

Why? What makes it a nightmare? Have you even used systemd or are you just 
trolling?

 but you are using politics and psyops to push it on
 every single linux user, every distro, everywhere.
 

Uh... no, I gave valid technical reasons why systemd is better. Dependency-
based concurrent boot with cgroups control. And that's just ONE reason.

You're the one coming on here making paranoid claims about systemd being an 
attempt to conquer Linux. I didn't make any political claims at any point in 
this entire thread.

 I showed you code that does your vaunted concurrent boot systemdde in a
 few lines of shell.
 

That's not shell, that's C. You don't even know what a shall script is, I'm 
thinking.

Also, it doesn't do concurrency at all the same way as systemd does. Do you 
even know how SysV and systemd work? I'm guessing, again, no.

 That simplicity was the way unix and linux was, before the windows
 programmers and the govt funded companies sunk their teeth into linux.
 

Hahaha. Initscripts are NOT simple. Please. PLEASE, do yourself a favor and 
actually look at an initscript. Educate yourself. You're making yourself look 
like an idiot.

 You know what  does.
 I guess not, you're too new to gnu.
 

Don't presume to know how long I've been using Linux. Judging by your complete 
and utter lack of technical knowledge I'm willing to bet I've been using Linux 
and the GNU toolchain a heck of a lot longer than you have.

 --- y...@marupa.net wrote:
 
 From: y...@marupa.net
 To: usspookslovesys...@muchomail.com
 Subject: Re: Four people decided the fate of debian with systemd. Bad faith
 likely - SysV is fine Date: Sun, 02 Mar 2014 16:15:41 -0600
 
 On Sunday, March 02, 2014 02:12:48 PM NoTo CTTE wrote:
  System V is NOT hard to maintain

Clearly you never wrote a shell script or tried to fix one. I have. I've also 
worked with unit files. It's no contest that systemd unit files are much 
simpler 
and easier to work with,

  The scripts were written YEARS ago. They're fine. They do NOT need to be
  changed. Debian SysV has concurrent boot aswell.
  

As concurrent as initscripts can safely get, which isn't that far. And hell 
yes they need to be changed. Ever administrate a Debian Stable server? I 
welcome a change to systemd on my server, way less hassle.

  Systemd is a poison apple. 200k lines of unaudited root privlege code. A
  consulting service to go along with this new _operating system_
  

Who says it's unaudited? You? Do you know how much work the DDs put into 
supporting their packages? I don't think you do.

What new operating system?

Are you aware SysV also runs with root privileges? And it probably exposes the 
system to more hazards given how many more processes it has to spawn over the 
courseof just ONE initscript?

  Here's an under 100 line init with concurrent boot:
  
  #include signal.h
  #include unistd.h
  
  int main()
  {
  sigset_t set;
  int status;
  
  if (getpid() != 1) return 1;
  
  sigfillset(set);
  sigprocmask(SIG_BLOCK, set, 0);
  
  if (fork()) for (;;) wait(status);
  
  sigprocmask(SIG_UNBLOCK, set, 0);
  
  setsid();
  setpgid(0, 0);
  return execve(/etc/rc, (char *[]){ rc, 0 }, (char *[]){ 0 });
  }

The above is not an initscript. I'll concede it's a poorly thought out init 
with a badly implemented concurrency setup, but your attempt to make systemd's 
concurrency look like nothing special is laughable.

  
  /etc/rc is a shell script
  syslogd  getty ; udev ; network-config ; sshd  cron  nginx

Your point? What's so great about shell scripts? They're overcomplex, hard to 
maintain, difficult to test and debug, spend more time in boilerplate than 
system management, and are prone to failure. Nothign I say here is new/

  
  see how much bullsht systemd is.

I see how much bullshit your claims are.

  
  
  _
  The Free Email with so much more!
  = http://www.MuchoMail.com =
 
 It'd be almost too easy to mock a laughable post like this, but I'll let
 someone else do it. It's just not fun anymore.
 
 Conrad
 
 
 
 
 _
 The Free Email with so much more!
 = http://www.MuchoMail.com =

--
To unsubscribe from this list: send the line 

Re: Bug#727708: Call for Votes on init system coupling

2014-03-02 Thread NoTo CTTE
Why should we believe you or the bullshit excuses given in the article?

The fact is, last year none of this crap was needed.
Now it suddenly is.
Furthermore gnome stole libgtk from the gimp project recently
and then they made an incompatable libgtk 3.0.

And now they're requiring all these bullshit daemons, and systemd.

This is a political coup. We are being lead by the nose.
Notice the arguments from the gnome and systemd people are always the same
across all forums, for years.

It is for your own good
You must join the modern era
They know better than us and we must join.
Over and over again for the past year or two.

I think these are the same people.
Fake personas, or directed by their employers.

They should be thrown out, we should recongise them for what they are.

Real, traditional linux includes
sysv or bsd style init (or openrc).
libgtk2 (not 3). 
gnome2 (not 3).

And no systemd.

We should also take heed of Snowden's documents which show that
the United States government, which is an evil force that 
blows up and burns alive little girls and boys in afghanistan
iraq and elsewhere, had and has a program to subvert technology
and software projects everywhere.

Systemd and its shills are likely part of this.
They should be thrown out of our community distributions.
Pretty much anything by redhat is harmful nowadays.
And anyone associated.

--- r...@debian.org wrote:

From: Russ Allbery r...@debian.org
To: Thorsten Glaser t...@mirbsd.de
Cc: 727...@bugs.debian.org
Subject: Bug#727708: Call for Votes on init system coupling
Date: Sun, 02 Mar 2014 12:26:31 -0800

Thorsten Glaser t...@mirbsd.de writes:
 Russ Allbery dixit:

 But when providing project-wide guidance, we have an obligation to
 worry about the error conditions as well.  If multiple logind
 implementations do *not* materialize, or if they do materialize but
 then people lose interest

 I question why logind is needed in the first place.  Current-day systems
 are getting way too complex and complicated; we did not need something
 like this a few months ago either.

The link that Colin posted provides a fairly good summary of why logind is
attractive from the perspective of a GNOME maintainer.

-- 
Russ Allbery (r...@debian.org)   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to debian-ctte-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/87vbvwfitk@windlord.stanford.edu





_
The Free Email with so much more!
= http://www.MuchoMail.com =
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] x86: Introduce BOOT_EFI and BOOT_CF9 into the reboot sequence loop

2014-03-02 Thread Li, Aubrey
On 2014/3/3 6:26, Matthew Garrett wrote:
 On Mon, Mar 03, 2014 at 06:13:47AM +0800, Li, Aubrey wrote:
 
 If you have a system can't be rebooted by all of the known methods, we
 have to figure out how to make reboot work and add the new methods.
 
 The only methods used by Windows are the keyboard controller, the ACPI 
 registers and (according to your results) the EFI reboot mechanism. If 
 none of those work under Linux but Windows is able to reboot 
 successfully then we don't need to add new methods, we need to find out 
 why the existing methods don't work.
 

One example in my hand is, 32bit windows calls 32bit EFI firware, so
reboot works. However, I installed 64bit linux on this 32bit EFI
machine, so none of ACPI/KBD/EFI works.

Other cases even if we figured out why ACPI/KBD/EFI don't work, we still
have to make our change in the linux kernel, because we can't change
firmware.

So, if you are still suggesting we add EFI only, please let me know your
plan about adding dmidecode table and if it's acceptable to add new
tables, I have three waiting: ASUS-T100, Dell Venue 8 Pro, and Dell
Venue 11 Pro.

Or if you don't want to keep adding the dmidecode, please let me know
your plan so that I don't want to keep driving this patch.

Thanks,
-Aubrey
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[git pull] drm fixes

2014-03-02 Thread Dave Airlie

Hi Linus,

Not a huge amount happening, some MAINTAINERS updates, radeon, vmwgfx and 
tegra fixes,

Dave.

The following changes since commit 75936c65dda54a08d9124f24f8725f86a4adc286:

  Merge tag 'ttm-fixes-3.14-2014-02-18' of 
git://people.freedesktop.org/~thomash/linux into drm-fixes (2014-02-19 08:21:26 
+1000)

are available in the git repository at:


  git://people.freedesktop.org/~airlied/linux drm-fixes

for you to fetch changes up to d668ca1cc6b9b6d2f1ce2f7b158cbe919cc782dc:

  Merge branch 'drm-fixes-3.14' of git://people.freedesktop.org/~agd5f/linux 
into drm-fixes (2014-03-03 09:04:41 +1000)



Alex Deucher (7):
  MAINTAINERS: add entry for drm radeon driver
  MAINTAINERS: update drm git tree entry
  drm/radeon: print the supported atpx function mask
  drm/radeon: disable pll sharing for DP on DCE4.1
  drm/radeon: fix audio disable on dce6+
  drm/radeon: change audio enable logic
  drm/radeon: enable speaker allocation setup on dce3.2

Alexey Khoroshilov (1):
  drm/vmwgfx: avoid null pointer dereference at failure paths

Christian König (1):
  drm/radeon: fix missing bo reservation

Dave Airlie (3):
  Merge tag 'drm/for-3.14-rc3' of git://anongit.freedesktop.org/tegra/linux 
into drm-fixes
  Merge tag 'vmwgfx-fixes-3.14-2014-03-02' of 
git://people.freedesktop.org/~thomash/linux into drm-fixes
  Merge branch 'drm-fixes-3.14' of 
git://people.freedesktop.org/~agd5f/linux into drm-fixes

Dmitry Osipenko (1):
  drm/tegra: Add guard to avoid double disable/enable of RGB outputs

Erik Faye-Lund (1):
  gpu: host1x: do not check previously handled gathers

Jerome Glisse (1):
  drm/radeon: free uvd ring on unload

Paul Bolle (1):
  drm/tegra: fix typo 'CONFIG_TEGRA_DRM_FBDEV'

Thomas Hellstrom (2):
  drm/vmwgfx: Remove some unused surface formats
  drm/vmwgfx: Make sure backing mobs are cleared when allocated. Update 
driver date.

 MAINTAINERS  | 12 +-
 drivers/gpu/drm/radeon/atombios_crtc.c   | 16 -
 drivers/gpu/drm/radeon/dce6_afmt.c   | 15 +++-
 drivers/gpu/drm/radeon/evergreen.c   |  2 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c  | 26 -
 drivers/gpu/drm/radeon/r600_audio.c  | 14 ++-
 drivers/gpu/drm/radeon/r600_hdmi.c   | 15 ++--
 drivers/gpu/drm/radeon/radeon.h  |  6 +
 drivers/gpu/drm/radeon/radeon_atpx_handler.c |  3 ++-
 drivers/gpu/drm/radeon/radeon_kms.c  |  6 +
 drivers/gpu/drm/radeon/radeon_uvd.c  |  2 ++
 drivers/gpu/drm/radeon/rv770.c   |  2 +-
 drivers/gpu/drm/tegra/drm.c  |  2 +-
 drivers/gpu/drm/tegra/rgb.c  | 11 +
 drivers/gpu/drm/vmwgfx/svga3d_reg.h  |  7 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h  |  2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_mob.c  | 35 +++-
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c |  3 +--
 drivers/gpu/host1x/job.c |  2 +-
 19 files changed, 118 insertions(+), 63 deletions(-)

Re: [patch] x86: Introduce BOOT_EFI and BOOT_CF9 into the reboot sequence loop

2014-03-02 Thread Matthew Garrett
On Mon, Mar 03, 2014 at 06:45:15AM +0800, Li, Aubrey wrote:

 One example in my hand is, 32bit windows calls 32bit EFI firware, so
 reboot works. However, I installed 64bit linux on this 32bit EFI
 machine, so none of ACPI/KBD/EFI works.

Yes. The correct fix for that is to ensure that the 64-bit kernel can 
make 32-bit runtime services calls.

 Other cases even if we figured out why ACPI/KBD/EFI don't work, we still
 have to make our change in the linux kernel, because we can't change
 firmware.

That's correct, yes. If Windows is able to reboot the system and Linux 
is not, then that's a bug in the Linux kernel.

 So, if you are still suggesting we add EFI only, please let me know your
 plan about adding dmidecode table and if it's acceptable to add new
 tables, I have three waiting: ASUS-T100, Dell Venue 8 Pro, and Dell
 Venue 11 Pro.

I don't think it's acceptable to add DMI entries to the reboot table. I 
think you should add the EFI call (since we expect that to work now), 
and I have no objection to adding cf9 to the end of the list if we have 
standard PCI io ports (Windows doesn't do it, but we can hardly make 
things worse).

-- 
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/5] Staging: cxt1e1: Fix line length over 80 characters in hwprobe.c

2014-03-02 Thread DaeSeok Youn
sorry for late reply.

I will resend patches which couldn't be applied to stating-next branch.

Thanks.
Daeseok Youn.


2014-03-01 7:19 GMT+09:00 Greg KH gre...@linuxfoundation.org:
 On Fri, Feb 28, 2014 at 04:33:49PM +0900, DaeSeok Youn wrote:
 OK. sorry.
 I will send again.

 Please resend all 3 of these, I've applied the first 2.

 thanks,

 greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC][PATCH 0/5] arch: atomic rework

2014-03-02 Thread Paul E. McKenney
On Sun, Mar 02, 2014 at 04:05:52AM -0600, Peter Sewell wrote:
 On 1 March 2014 08:03, Paul E. McKenney paul...@linux.vnet.ibm.com wrote:
  On Sat, Mar 01, 2014 at 04:06:34AM -0600, Peter Sewell wrote:
  Hi Paul,
 
  On 28 February 2014 18:50, Paul E. McKenney paul...@linux.vnet.ibm.com 
  wrote:
   On Thu, Feb 27, 2014 at 12:53:12PM -0800, Paul E. McKenney wrote:
   On Thu, Feb 27, 2014 at 11:47:08AM -0800, Linus Torvalds wrote:
On Thu, Feb 27, 2014 at 11:06 AM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 3.  The comparison was against another RCU-protected pointer,
 where that other pointer was properly fetched using one
 of the RCU primitives.  Here it doesn't matter which pointer
 you use.  At least as long as the rcu_assign_pointer() for
 that other pointer happened after the last update to the
 pointed-to structure.

 I am a bit nervous about #3.  Any thoughts on it?
   
I think that it might be worth pointing out as an example, and saying
that code like
   
   p = atomic_read(consume);
   X;
   q = atomic_read(consume);
   Y;
   if (p == q)
data = p-val;
   
then the access of p-val is constrained to be data-dependent on
*either* p or q, but you can't really tell which, since the compiler
can decide that the values are interchangeable.
   
I cannot for the life of me come up with a situation where this would
matter, though. If X contains a fence, then that fence will be a
stronger ordering than anything the consume through p would
guarantee anyway. And if X does *not* contain a fence, then the
atomic reads of p and q are unordered *anyway*, so then whether the
ordering to the access through p is through p or q is kind of
irrelevant. No?
  
   I can make a contrived litmus test for it, but you are right, the only
   time you can see it happen is when X has no barriers, in which case
   you don't have any ordering anyway -- both the compiler and the CPU can
   reorder the loads into p and q, and the read from p-val can, as you 
   say,
   come from either pointer.
  
   For whatever it is worth, hear is the litmus test:
  
   T1:   p = kmalloc(...);
 if (p == NULL)
 deal_with_it();
 p-a = 42;  /* Each field in its own cache line. */
 p-b = 43;
 p-c = 44;
 atomic_store_explicit(gp1, p, memory_order_release);
 p-b = 143;
 p-c = 144;
 atomic_store_explicit(gp2, p, memory_order_release);
  
   T2:   p = atomic_load_explicit(gp2, memory_order_consume);
 r1 = p-b;  /* Guaranteed to get 143. */
 q = atomic_load_explicit(gp1, memory_order_consume);
 if (p == q) {
 /* The compiler decides that q-c is same as p-c. */
 r2 = p-c; /* Could get 44 on weakly order system. */
 }
  
   The loads from gp1 and gp2 are, as you say, unordered, so you get what
   you get.
  
   And publishing a structure via one RCU-protected pointer, updating it,
   then publishing it via another pointer seems to me to be asking for
   trouble anyway.  If you really want to do something like that and still
   see consistency across all the fields in the structure, please put a 
   lock
   in the structure and use it to guard updates and accesses to those 
   fields.
  
   And here is a patch documenting the restrictions for the current Linux
   kernel.  The rules change a bit due to rcu_dereference() acting a bit
   differently than atomic_load_explicit(p, memory_order_consume).
  
   Thoughts?
 
  That might serve as informal documentation for linux kernel
  programmers about the bounds on the optimisations that you expect
  compilers to do for common-case RCU code - and I guess that's what you
  intend it to be for.   But I don't see how one can make it precise
  enough to serve as a language definition, so that compiler people
  could confidently say yes, we respect that, which I guess is what
  you really need.  As a useful criterion, we should aim for something
  precise enough that in a verified-compiler context you can
  mathematically prove that the compiler will satisfy it  (even though
  that won't happen anytime soon for GCC), and that analysis tool
  authors can actually know what they're working with.   All this stuff   
  about you should avoid cancellation, and avoid masking with just a
  small number of bits is just too vague.
 
  Understood, and yes, this is intended to document current compiler
  behavior for the Linux kernel community.  It would not make sense to show
  it to the C11 or C++11 communities, except perhaps as an informational
  piece on current practice.
 
  The basic problem is that the compiler may be doing sophisticated
  reasoning with a bunch of non-local knowledge that it's deduced from
  the code, neither of which are well-understood, and here we have to
  identify some envelope, 

Re: [patch] x86: Introduce BOOT_EFI and BOOT_CF9 into the reboot sequence loop

2014-03-02 Thread Li, Aubrey
On 2014/3/3 7:11, Matthew Garrett wrote:

 So, if you are still suggesting we add EFI only, please let me know your
 plan about adding dmidecode table and if it's acceptable to add new
 tables, I have three waiting: ASUS-T100, Dell Venue 8 Pro, and Dell
 Venue 11 Pro.
 
 I don't think it's acceptable to add DMI entries to the reboot table. I 
 think you should add the EFI call (since we expect that to work now), 
 and I have no objection to adding cf9 to the end of the list if we have 
 standard PCI io ports (Windows doesn't do it, but we can hardly make 
 things worse).
 
Windows doesn't do because there is no 32/64 mixed windows and EFI on
the planet. Since the silicon is actually 64 bit, I failed to see a
reason to refuse the user install 64bit linux on it. So we encountered a
case windows didn't.

So, you didn't mention BOOT_BIOS, if you don't want to add BOOT_BIOS,
and you also don't like DMI entires, how do you want to deal with the
machines requiring BOOT_BIOS to reboot their machine?

Thanks,
-Aubrey
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ACPI/Sleep: pm_power_off need more sanity check to be installed

2014-03-02 Thread Rafael J. Wysocki
On Sunday, March 02, 2014 08:53:57 AM Li, Aubrey wrote:
 On 2014/3/2 8:39, Rafael J. Wysocki wrote:
  On Saturday, March 01, 2014 06:24:23 AM Li, Aubrey wrote:
  Do we still want to set this if the check below fails?  If so, then why?
 
  We know \_S5_ is valid. The fault is sleep registers, not S5 ACPI object
 
  Hi Rafael, do you still have any concern?
  
  Well, I simply don't think we should say that it is supported if we aren't
  going to do anything with it.
  
 
 Make sense to me. Patch refined as below:
 
 Sleep control and status registers need santity check as well before
 ACPI install acpi_power_off to pm_power_off hook. The checking code in
 acpi_enter_sleep_state() is too late, we should not allow a not-working
 pm_power_off function hooked.
 
 Signed-off-by: Aubrey Li aubrey...@intel.com

Queued up for 3.15 (with minor changes), thanks!

 
 ---
  drivers/acpi/sleep.c |7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
 index b718806..0abfbb1 100644
 --- a/drivers/acpi/sleep.c
 +++ b/drivers/acpi/sleep.c
 @@ -807,7 +807,12 @@ int __init acpi_sleep_init(void)
   acpi_sleep_hibernate_setup();
 
   status = acpi_get_sleep_type_data(ACPI_STATE_S5, type_a, type_b);
 - if (ACPI_SUCCESS(status)) {
 + /*
 +  * Check both ACPI S5 object and ACPI sleep registers to
 +  * install pm_power_off_prepare/pm_power_off hook
 +  */
 + if (ACPI_SUCCESS(status)  acpi_gbl_FADT.sleep_control.address 
 + acpi_gbl_FADT.sleep_status.address) {
   sleep_states[ACPI_STATE_S5] = 1;
   pm_power_off_prepare = acpi_power_off_prepare;
   pm_power_off = acpi_power_off;
 -- 1.7.10.4
 --
 To unsubscribe from this list: send the line unsubscribe linux-acpi in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6 07/22] Replace the XIP page fault handler with the DAX page fault handler

2014-03-02 Thread Dave Chinner
On Fri, Feb 28, 2014 at 03:20:31PM -0500, Matthew Wilcox wrote:
 On Fri, Feb 28, 2014 at 10:49:31AM -0700, Toshi Kani wrote:
  On Tue, 2014-02-25 at 09:18 -0500, Matthew Wilcox wrote:
   Instead of calling aops-get_xip_mem from the fault handler, the
   filesystem passes a get_block_t that is used to find the appropriate
   blocks.
   :
   +static int do_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
   + get_block_t get_block)
   +{
   + struct file *file = vma-vm_file;
   + struct inode *inode = file_inode(file);
   + struct address_space *mapping = file-f_mapping;
   + struct buffer_head bh;
   + unsigned long vaddr = (unsigned long)vmf-virtual_address;
   + sector_t block;
   + pgoff_t size;
   + unsigned long pfn;
   + int error;
   +
   + size = (i_size_read(inode) + PAGE_SIZE - 1)  PAGE_SHIFT;
   + if (vmf-pgoff = size)
   + return VM_FAULT_SIGBUS;
   +
   + memset(bh, 0, sizeof(bh));
   + block = (sector_t)vmf-pgoff  (PAGE_SHIFT - inode-i_blkbits);
   + bh.b_size = PAGE_SIZE;
   + error = get_block(inode, block, bh, 0);
   + if (error || bh.b_size  PAGE_SIZE)
   + return VM_FAULT_SIGBUS;
  
  I am learning the code and have some questions.
 
 Hi Toshi,
 
 Glad to see you're looking at it.  Let me try to help ...
 
  The original code,
  xip_file_fault(), jumps to found: and calls vm_insert_mixed() when
  get_xip_mem(,,0,,) succeeded.  If get_xip_mem() returns -ENODATA, it
  calls either get_xip_mem(,,1,,) or xip_sparse_page().  In this new
  function, it looks to me that get_block(,,,0) returns 0 for both cases
  (success and -ENODATA previously), which are dealt in the same way.  Is
  that right?  If so, is there any reason for the change?
 
 Yes, get_xip_mem() returned -ENODATA for a hole.  That was a suboptimal
 interface because filesystems are actually capable of returning more
 information than that, eg how long the hole is (ext4 *doesn't*, but I
 consider that to be a bug).
 
 I don't get to decide what the get_block() interface looks like.  It's the
 standard way that the VFS calls back into the filesystem and has been
 around for probably close to twenty years at this point.  I'm still trying
 to understand exactly what the contract is for get_blocks() ... I have
 a document that I'm working on to try to explain it, but it's tough going!
 
  Also, isn't it
  possible to call get_block(,,,1) even if get_block(,,,0) found a block?
 
 The code in question looks like this:
 
 error = get_block(inode, block, bh, 0);
 if (error || bh.b_size  PAGE_SIZE)
 goto sigbus;
 
 if (!buffer_written(bh)  !vmf-cow_page) {
 if (vmf-flags  FAULT_FLAG_WRITE) {
 error = get_block(inode, block, bh, 1);
 
 where buffer_written is defined as:
 return buffer_mapped(bh)  !buffer_unwritten(bh);
 
 Doing some boolean algebra, that's:
 
   if (!buffer_mapped || buffer_unwritten)
 
 In either case, we want to tell the filesystem that we're writing to
 this block.  At least, that's my current understanding of the get_block()
 interface.  I'm open to correction here!

I've got a rewritten version on this that doesn't require two calls
to get_block() that I wrote while prototyping the XFS code. It also
fixes all the misunderstandings about what get_block() actually does
and returns so it works correctly with XFS.

I need to port it forward to your new patch set (hopefully later
this week), so don't spend too much time trying to work out exactly
what this code needs to do...

Cheers,

Dave.
-- 
Dave Chinner
da...@fromorbit.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 6/8] ACPI: use platform bus as the default bus for _HID enumeration

2014-03-02 Thread Rafael J. Wysocki
On Wednesday, February 26, 2014 05:11:12 PM Zhang Rui wrote:
 Because of the growing demand for enumerating ACPI devices to platform bus,
 this patch changes the code to enumerate ACPI devices with _HID/_CID to
 platform bus by default, unless the device already has a scan handler 
 attached.
 
 Signed-off-by: Zhang Rui rui.zh...@intel.com
 ---
  drivers/acpi/acpi_platform.c |   28 
  drivers/acpi/scan.c  |   12 ++--
  2 files changed, 6 insertions(+), 34 deletions(-)
 
 diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
 index dbfe49e..33376a9 100644
 --- a/drivers/acpi/acpi_platform.c
 +++ b/drivers/acpi/acpi_platform.c
 @@ -22,24 +22,6 @@
  
  ACPI_MODULE_NAME(platform);
  
 -/*
 - * The following ACPI IDs are known to be suitable for representing as
 - * platform devices.
 - */
 -static const struct acpi_device_id acpi_platform_device_ids[] = {
 -
 - { PNP0D40 },
 - { ACPI0003 },
 - { VPC2004 },
 - { BCM4752 },
 -
 - /* Intel Smart Sound Technology */
 - { INT33C8 },
 - { 80860F28 },
 -
 - { }
 -};
 -
  /**
   * acpi_create_platform_device - Create platform device for ACPI device node
   * @adev: ACPI device node to create a platform device for.
 @@ -125,13 +107,3 @@ int acpi_create_platform_device(struct acpi_device *adev,
   kfree(resources);
   return 1;
  }
 -
 -static struct acpi_scan_handler platform_handler = {
 - .ids = acpi_platform_device_ids,
 - .attach = acpi_create_platform_device,
 -};
 -
 -void __init acpi_platform_init(void)
 -{
 - acpi_scan_add_handler(platform_handler);
 -}
 diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
 index 5967338..61af32e 100644
 --- a/drivers/acpi/scan.c
 +++ b/drivers/acpi/scan.c
 @@ -2022,14 +2022,15 @@ static int acpi_scan_attach_handler(struct 
 acpi_device *device)
   handler = acpi_scan_match_handler(hwid-id, devid);
   if (handler) {
   ret = handler-attach(device, devid);
 - if (ret  0) {
 + if (ret  0)
   device-handler = handler;
 - break;
 - } else if (ret  0) {
 - break;
 - }
 + if (ret)
 + goto end;
   }
   }
 +end:
 + if (!list_empty(device-pnp.ids)  !device-handler)

I'm a bit concerned that this check will create platform devices for too many
ACPI device objects.  Shouldn't we require that _HID or at least _CID is
present for that?

 + acpi_create_platform_device(device, NULL);
   return ret;
  }
  
 @@ -2185,7 +2186,6 @@ int __init acpi_scan_init(void)
   acpi_pci_root_init();
   acpi_pci_link_init();
   acpi_processor_init();
 - acpi_platform_init();
   acpi_lpss_init();
   acpi_cmos_rtc_init();
   acpi_container_init();
 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC][PATCH 0/5] arch: atomic rework

2014-03-02 Thread Peter Sewell
On 2 March 2014 23:20, Paul E. McKenney paul...@linux.vnet.ibm.com wrote:
 On Sun, Mar 02, 2014 at 04:05:52AM -0600, Peter Sewell wrote:
 On 1 March 2014 08:03, Paul E. McKenney paul...@linux.vnet.ibm.com wrote:
  On Sat, Mar 01, 2014 at 04:06:34AM -0600, Peter Sewell wrote:
  Hi Paul,
 
  On 28 February 2014 18:50, Paul E. McKenney paul...@linux.vnet.ibm.com 
  wrote:
   On Thu, Feb 27, 2014 at 12:53:12PM -0800, Paul E. McKenney wrote:
   On Thu, Feb 27, 2014 at 11:47:08AM -0800, Linus Torvalds wrote:
On Thu, Feb 27, 2014 at 11:06 AM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 3.  The comparison was against another RCU-protected pointer,
 where that other pointer was properly fetched using one
 of the RCU primitives.  Here it doesn't matter which 
 pointer
 you use.  At least as long as the rcu_assign_pointer() for
 that other pointer happened after the last update to the
 pointed-to structure.

 I am a bit nervous about #3.  Any thoughts on it?
   
I think that it might be worth pointing out as an example, and saying
that code like
   
   p = atomic_read(consume);
   X;
   q = atomic_read(consume);
   Y;
   if (p == q)
data = p-val;
   
then the access of p-val is constrained to be data-dependent on
*either* p or q, but you can't really tell which, since the compiler
can decide that the values are interchangeable.
   
I cannot for the life of me come up with a situation where this would
matter, though. If X contains a fence, then that fence will be a
stronger ordering than anything the consume through p would
guarantee anyway. And if X does *not* contain a fence, then the
atomic reads of p and q are unordered *anyway*, so then whether the
ordering to the access through p is through p or q is kind of
irrelevant. No?
  
   I can make a contrived litmus test for it, but you are right, the only
   time you can see it happen is when X has no barriers, in which case
   you don't have any ordering anyway -- both the compiler and the CPU can
   reorder the loads into p and q, and the read from p-val can, as you 
   say,
   come from either pointer.
  
   For whatever it is worth, hear is the litmus test:
  
   T1:   p = kmalloc(...);
 if (p == NULL)
 deal_with_it();
 p-a = 42;  /* Each field in its own cache line. */
 p-b = 43;
 p-c = 44;
 atomic_store_explicit(gp1, p, memory_order_release);
 p-b = 143;
 p-c = 144;
 atomic_store_explicit(gp2, p, memory_order_release);
  
   T2:   p = atomic_load_explicit(gp2, memory_order_consume);
 r1 = p-b;  /* Guaranteed to get 143. */
 q = atomic_load_explicit(gp1, memory_order_consume);
 if (p == q) {
 /* The compiler decides that q-c is same as p-c. */
 r2 = p-c; /* Could get 44 on weakly order system. */
 }
  
   The loads from gp1 and gp2 are, as you say, unordered, so you get what
   you get.
  
   And publishing a structure via one RCU-protected pointer, updating it,
   then publishing it via another pointer seems to me to be asking for
   trouble anyway.  If you really want to do something like that and still
   see consistency across all the fields in the structure, please put a 
   lock
   in the structure and use it to guard updates and accesses to those 
   fields.
  
   And here is a patch documenting the restrictions for the current Linux
   kernel.  The rules change a bit due to rcu_dereference() acting a bit
   differently than atomic_load_explicit(p, memory_order_consume).
  
   Thoughts?
 
  That might serve as informal documentation for linux kernel
  programmers about the bounds on the optimisations that you expect
  compilers to do for common-case RCU code - and I guess that's what you
  intend it to be for.   But I don't see how one can make it precise
  enough to serve as a language definition, so that compiler people
  could confidently say yes, we respect that, which I guess is what
  you really need.  As a useful criterion, we should aim for something
  precise enough that in a verified-compiler context you can
  mathematically prove that the compiler will satisfy it  (even though
  that won't happen anytime soon for GCC), and that analysis tool
  authors can actually know what they're working with.   All this stuff  
   about you should avoid cancellation, and avoid masking with just a
  small number of bits is just too vague.
 
  Understood, and yes, this is intended to document current compiler
  behavior for the Linux kernel community.  It would not make sense to show
  it to the C11 or C++11 communities, except perhaps as an informational
  piece on current practice.
 
  The basic problem is that the compiler may be doing sophisticated
  reasoning with a bunch of non-local knowledge that it's deduced from
  the code, neither 

Re: [PATCH 1/1] Consistently use xrealloc instead of realloc

2014-03-02 Thread David Gibson
On Sun, Mar 02, 2014 at 09:39:01PM +0100, xypron.g...@gmx.de wrote:
 From: Heinrich Schuchardt xypron.g...@gmx.de
 
 fdtput.c:
 Replace the remaining call to realloc by xrealloc.
 Some redundant lines in encode_value can be saved.
 
 Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de

Applied, thanks.

Note that in general dtc patches should be CCed to myself and Jon
Loeliger j...@jdl.com, the dtc maintainers.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpmjfeTG0IE9.pgp
Description: PGP signature


Re: [PATCH 1/1] Remove duplicate assignment

2014-03-02 Thread David Gibson
On Sun, Mar 02, 2014 at 09:45:57PM +0100, xypron.g...@gmx.de wrote:
 From: Heinrich Schuchardt xypron.g...@gmx.de
 
 Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de

Applied, thanks.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpHTLovwaIiY.pgp
Description: PGP signature


Re: [PATCH 1/1] Update source code location for dtc in manual.txt

2014-03-02 Thread David Gibson
On Sun, Mar 02, 2014 at 10:39:14PM +0100, xypron.g...@gmx.de wrote:
 From: Heinrich Schuchardt xypron.g...@gmx.de
 
 The information about the location of the source code of the
 device tree compiler was inaccurate.
 
 Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de

Trailing whitespace removed, then applied.  Thanks.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpiPIzfz5AA3.pgp
Description: PGP signature


[PATCH 09/44] ia64: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.
This inverts also the return codes of force_sigsegv_info()
and setup_frame() to follow the kernel convention.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/ia64/kernel/signal.c | 46 +-
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index 33cab9a..6d92170 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -309,12 +309,11 @@ force_sigsegv_info (int sig, void __user *addr)
si.si_uid = from_kuid_munged(current_user_ns(), current_uid());
si.si_addr = addr;
force_sig_info(SIGSEGV, si, current);
-   return 0;
+   return 1;
 }
 
 static long
-setup_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set,
-struct sigscratch *scr)
+setup_frame(struct ksignal *ksig, sigset_t *set, struct sigscratch *scr)
 {
extern char __kernel_sigtramp[];
unsigned long tramp_addr, new_rbs = 0, new_sp;
@@ -323,7 +322,7 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t 
*info, sigset_t *set,
 
new_sp = scr-pt.r12;
tramp_addr = (unsigned long) __kernel_sigtramp;
-   if (ka-sa.sa_flags  SA_ONSTACK) {
+   if (ksig-ka.sa.sa_flags  SA_ONSTACK) {
int onstack = sas_ss_flags(new_sp);
 
if (onstack == 0) {
@@ -347,29 +346,29 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t 
*info, sigset_t *set,
 */
check_sp = (new_sp - sizeof(*frame))  -STACK_ALIGN;
if (!likely(on_sig_stack(check_sp)))
-   return force_sigsegv_info(sig, (void __user *)
+   return force_sigsegv_info(ksig-sig, (void 
__user *)
  check_sp);
}
}
frame = (void __user *) ((new_sp - sizeof(*frame))  -STACK_ALIGN);
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
-   return force_sigsegv_info(sig, frame);
+   return force_sigsegv_info(ksig-sig, frame);
 
-   err  = __put_user(sig, frame-arg0);
+   err  = __put_user(ksig-sig, frame-arg0);
err |= __put_user(frame-info, frame-arg1);
err |= __put_user(frame-sc, frame-arg2);
err |= __put_user(new_rbs, frame-sc.sc_rbs_base);
err |= __put_user(0, frame-sc.sc_loadrs); /* initialize to zero */
-   err |= __put_user(ka-sa.sa_handler, frame-handler);
+   err |= __put_user(ksig-ka.sa.sa_handler, frame-handler);
 
-   err |= copy_siginfo_to_user(frame-info, info);
+   err |= copy_siginfo_to_user(frame-info, ksig-info);
 
err |= __save_altstack(frame-sc.sc_stack, scr-pt.r12);
err |= setup_sigcontext(frame-sc, set, scr);
 
if (unlikely(err))
-   return force_sigsegv_info(sig, frame);
+   return force_sigsegv_info(ksig-sig, frame);
 
scr-pt.r12 = (unsigned long) frame - 16;   /* new stack pointer */
scr-pt.ar_fpsr = FPSR_DEFAULT; /* reset fpsr for 
signal handler */
@@ -394,22 +393,20 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t 
*info, sigset_t *set,
 
 #if DEBUG_SIG
printk(SIG deliver (%s:%d): sig=%d sp=%lx ip=%lx handler=%p\n,
-  current-comm, current-pid, sig, scr-pt.r12, frame-sc.sc_ip, 
frame-handler);
+  current-comm, current-pid, ksig-sig, scr-pt.r12, 
frame-sc.sc_ip, frame-handler);
 #endif
-   return 1;
+   return 0;
 }
 
 static long
-handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
-  struct sigscratch *scr)
+handle_signal (struct ksignal *ksig, struct sigscratch *scr)
 {
-   if (!setup_frame(sig, ka, info, sigmask_to_save(), scr))
-   return 0;
+   int ret = setup_frame(ksig, sigmask_to_save(), scr);
 
-   signal_delivered(sig, info, ka, scr-pt,
-test_thread_flag(TIF_SINGLESTEP));
+   if (!ret)
+   signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP));
 
-   return 1;
+   return ret;
 }
 
 /*
@@ -419,17 +416,16 @@ handle_signal (unsigned long sig, struct k_sigaction *ka, 
siginfo_t *info,
 void
 ia64_do_signal (struct sigscratch *scr, long in_syscall)
 {
-   struct k_sigaction ka;
-   siginfo_t info;
long restart = in_syscall;
long errno = scr-pt.r8;
+   struct ksignal ksig;
 
/*
 * This only loops in the rare cases of handle_signal() failing, in 
which case we
 * need to push through a forced SIGSEGV.
 */
while (1) {
-   int signr = get_signal_to_deliver(info, ka, scr-pt, NULL);
+   get_signal(ksig);
 
/*
 * get_signal_to_deliver() may have run a debugger (via 

[PATCH 10/44] m32r: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/m32r/kernel/signal.c | 47 ---
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index d503568..cce3fd3 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -173,17 +173,17 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, 
size_t frame_size)
return (void __user *)((sp - frame_size)  -8ul);
 }
 
-static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
-  sigset_t *set, struct pt_regs *regs)
+static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
+ struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
int err = 0;
-   int signal;
+   int signal, sig = ksig-sig;
 
-   frame = get_sigframe(ka, regs-spu, sizeof(*frame));
+   frame = get_sigframe(ksig-ka, regs-spu, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
-   goto give_sigsegv;
+   return -EFAULT;
 
signal = current_thread_info()-exec_domain
 current_thread_info()-exec_domain-signal_invmap
@@ -193,13 +193,13 @@ static int setup_rt_frame(int sig, struct k_sigaction 
*ka, siginfo_t *info,
 
err |= __put_user(signal, frame-sig);
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
err |= __put_user(frame-info, frame-pinfo);
err |= __put_user(frame-uc, frame-puc);
-   err |= copy_siginfo_to_user(frame-info, info);
+   err |= copy_siginfo_to_user(frame-info, ksig-info);
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Create the ucontext.  */
err |= __put_user(0, frame-uc.uc_flags);
@@ -208,17 +208,17 @@ static int setup_rt_frame(int sig, struct k_sigaction 
*ka, siginfo_t *info,
err |= setup_sigcontext(frame-uc.uc_mcontext, regs, set-sig[0]);
err |= __copy_to_user(frame-uc.uc_sigmask, set, sizeof(*set));
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Set up to return from userspace.  */
-   regs-lr = (unsigned long)ka-sa.sa_restorer;
+   regs-lr = (unsigned long)ksig-ka.sa.sa_restorer;
 
/* Set up registers for signal handler */
regs-spu = (unsigned long)frame;
regs-r0 = signal;  /* Arg for signal handler */
regs-r1 = (unsigned long)frame-info;
regs-r2 = (unsigned long)frame-uc;
-   regs-bpc = (unsigned long)ka-sa.sa_handler;
+   regs-bpc = (unsigned long)ksig-ka.sa.sa_handler;
 
set_fs(USER_DS);
 
@@ -228,10 +228,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
 #endif
 
return 0;
-
-give_sigsegv:
-   force_sigsegv(sig, current);
-   return -EFAULT;
 }
 
 static int prev_insn(struct pt_regs *regs)
@@ -252,9 +248,10 @@ static int prev_insn(struct pt_regs *regs)
  */
 
 static void
-handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
- struct pt_regs *regs)
+handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 {
+   int ret;
+
/* Are we from a system call? */
if (regs-syscall_nr = 0) {
/* If so, check system call restarting.. */
@@ -265,7 +262,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, 
siginfo_t *info,
break;
 
case -ERESTARTSYS:
-   if (!(ka-sa.sa_flags  SA_RESTART)) {
+   if (!(ksig-ka.sa.sa_flags  SA_RESTART)) {
regs-r0 = -EINTR;
break;
}
@@ -278,10 +275,9 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, 
siginfo_t *info,
}
 
/* Set up the stack frame */
-   if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs))
-   return;
+   ret = setup_rt_frame(ksig, sigmask_to_save(), regs);
 
-   signal_delivered(sig, info, ka, regs, 0);
+   signal_setup_done(ret, ksig, 0);
 }
 
 /*
@@ -291,9 +287,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, 
siginfo_t *info,
  */
 static void do_signal(struct pt_regs *regs)
 {
-   siginfo_t info;
-   int signr;
-   struct k_sigaction ka;
+   struct ksignal ksig;
 
/*
 * We want the common case to go fast, which
@@ -304,8 +298,7 @@ static void do_signal(struct pt_regs *regs)
if (!user_mode(regs))
return;
 
-   signr = get_signal_to_deliver(info, ka, regs, NULL);
-   if (signr  0) {
+   if (get_signal(ksig)) {
/* Re-enable any watchpoints before delivering the
 * signal 

[PATCH 14/44] mips: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/mips/include/asm/abi.h   | 10 +++
 arch/mips/kernel/signal.c | 66 ---
 arch/mips/kernel/signal32.c   | 39 ++---
 arch/mips/kernel/signal_n32.c | 20 ++---
 4 files changed, 52 insertions(+), 83 deletions(-)

diff --git a/arch/mips/include/asm/abi.h b/arch/mips/include/asm/abi.h
index 909bb69..7186bb5 100644
--- a/arch/mips/include/asm/abi.h
+++ b/arch/mips/include/asm/abi.h
@@ -13,13 +13,11 @@
 #include asm/siginfo.h
 
 struct mips_abi {
-   int (* const setup_frame)(void *sig_return, struct k_sigaction *ka,
- struct pt_regs *regs, int signr,
- sigset_t *set);
+   int (* const setup_frame)(void *sig_return, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *set);
const unsigned long signal_return_offset;
-   int (* const setup_rt_frame)(void *sig_return, struct k_sigaction *ka,
-  struct pt_regs *regs, int signr,
-  sigset_t *set, siginfo_t *info);
+   int (* const setup_rt_frame)(void *sig_return, struct ksignal *ksig,
+struct pt_regs *regs, sigset_t *set);
const unsigned long rt_signal_return_offset;
const unsigned long restart;
 };
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 5199563..e904bb1 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -372,20 +372,20 @@ badframe:
 }
 
 #ifdef CONFIG_TRAD_SIGNALS
-static int setup_frame(void *sig_return, struct k_sigaction *ka,
-  struct pt_regs *regs, int signr, sigset_t *set)
+static int setup_frame(void *sig_return, struct ksignal *ksig,
+  struct pt_regs *regs, sigset_t *set)
 {
struct sigframe __user *frame;
int err = 0;
 
-   frame = get_sigframe(ka, regs, sizeof(*frame));
+   frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
-   goto give_sigsegv;
+   return -EFAULT;
 
err |= setup_sigcontext(regs, frame-sf_sc);
err |= __copy_to_user(frame-sf_mask, set, sizeof(*set));
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
/*
 * Arguments to signal handler:
@@ -397,37 +397,32 @@ static int setup_frame(void *sig_return, struct 
k_sigaction *ka,
 * $25 and c0_epc point to the signal handler, $29 points to the
 * struct sigframe.
 */
-   regs-regs[ 4] = signr;
+   regs-regs[ 4] = ksig-sig;
regs-regs[ 5] = 0;
regs-regs[ 6] = (unsigned long) frame-sf_sc;
regs-regs[29] = (unsigned long) frame;
regs-regs[31] = (unsigned long) sig_return;
-   regs-cp0_epc = regs-regs[25] = (unsigned long) ka-sa.sa_handler;
+   regs-cp0_epc = regs-regs[25] = (unsigned long) ksig-ka.sa.sa_handler;
 
DEBUGP(SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n,
   current-comm, current-pid,
   frame, regs-cp0_epc, regs-regs[31]);
return 0;
-
-give_sigsegv:
-   force_sigsegv(signr, current);
-   return -EFAULT;
 }
 #endif
 
-static int setup_rt_frame(void *sig_return, struct k_sigaction *ka,
- struct pt_regs *regs, int signr, sigset_t *set,
- siginfo_t *info)
+static int setup_rt_frame(void *sig_return, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *set)
 {
struct rt_sigframe __user *frame;
int err = 0;
 
-   frame = get_sigframe(ka, regs, sizeof(*frame));
+   frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Create siginfo.  */
-   err |= copy_siginfo_to_user(frame-rs_info, info);
+   err |= copy_siginfo_to_user(frame-rs_info, ksig-info);
 
/* Create the ucontext.  */
err |= __put_user(0, frame-rs_uc.uc_flags);
@@ -437,7 +432,7 @@ static int setup_rt_frame(void *sig_return, struct 
k_sigaction *ka,
err |= __copy_to_user(frame-rs_uc.uc_sigmask, set, sizeof(*set));
 
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
/*
 * Arguments to signal handler:
@@ -449,22 +444,18 @@ static int setup_rt_frame(void *sig_return, struct 
k_sigaction *ka,
 * $25 and c0_epc point to the signal handler, $29 points to
 * the struct rt_sigframe.
 */
-   regs-regs[ 4] = signr;
+   regs-regs[ 4] = ksig-sig;
regs-regs[ 5] = (unsigned long) frame-rs_info;
regs-regs[ 6] = (unsigned long) frame-rs_uc;
 

[PATCH 02/44] arm64: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/arm64/include/asm/signal32.h |  7 +++---
 arch/arm64/kernel/signal.c| 48 ---
 arch/arm64/kernel/signal32.c  |  8 +++
 3 files changed, 27 insertions(+), 36 deletions(-)

diff --git a/arch/arm64/include/asm/signal32.h 
b/arch/arm64/include/asm/signal32.h
index 7c275e3..db544f1 100644
--- a/arch/arm64/include/asm/signal32.h
+++ b/arch/arm64/include/asm/signal32.h
@@ -26,8 +26,8 @@ extern const compat_ulong_t aarch32_sigret_code[6];
 
 int compat_setup_frame(int usig, struct k_sigaction *ka, sigset_t *set,
   struct pt_regs *regs);
-int compat_setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
- sigset_t *set, struct pt_regs *regs);
+int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,
+ struct pt_regs *regs);
 
 void compat_setup_restart_syscall(struct pt_regs *regs);
 #else
@@ -38,8 +38,7 @@ static inline int compat_setup_frame(int usid, struct 
k_sigaction *ka,
return -ENOSYS;
 }
 
-static inline int compat_setup_rt_frame(int usig, struct k_sigaction *ka,
-   siginfo_t *info, sigset_t *set,
+static inline int compat_setup_rt_frame(int usig, struct ksignal *ksig, 
sigset_t *set,
struct pt_regs *regs)
 {
return -ENOSYS;
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index 890a591..f6f23dd 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -239,13 +239,13 @@ static void setup_return(struct pt_regs *regs, struct 
k_sigaction *ka,
regs-regs[30] = (unsigned long)sigtramp;
 }
 
-static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
- sigset_t *set, struct pt_regs *regs)
+static int setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,
+ struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
int err = 0;
 
-   frame = get_sigframe(ka, regs);
+   frame = get_sigframe(ksig-ka, regs);
if (!frame)
return 1;
 
@@ -255,9 +255,9 @@ static int setup_rt_frame(int usig, struct k_sigaction *ka, 
siginfo_t *info,
err |= __save_altstack(frame-uc.uc_stack, regs-sp);
err |= setup_sigframe(frame, regs, set);
if (err == 0) {
-   setup_return(regs, ka, frame, usig);
-   if (ka-sa.sa_flags  SA_SIGINFO) {
-   err |= copy_siginfo_to_user(frame-info, info);
+   setup_return(regs, ksig-ka, frame, usig);
+   if (ksig-ka.sa.sa_flags  SA_SIGINFO) {
+   err |= copy_siginfo_to_user(frame-info, ksig-info);
regs-regs[1] = (unsigned long)frame-info;
regs-regs[2] = (unsigned long)frame-uc;
}
@@ -277,13 +277,12 @@ static void setup_restart_syscall(struct pt_regs *regs)
 /*
  * OK, we're invoking a handler
  */
-static void handle_signal(unsigned long sig, struct k_sigaction *ka,
- siginfo_t *info, struct pt_regs *regs)
+static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 {
struct thread_info *thread = current_thread_info();
struct task_struct *tsk = current;
sigset_t *oldset = sigmask_to_save();
-   int usig = sig;
+   int usig = ksig-sig;
int ret;
 
/*
@@ -296,13 +295,12 @@ static void handle_signal(unsigned long sig, struct 
k_sigaction *ka,
 * Set up the stack frame
 */
if (is_compat_task()) {
-   if (ka-sa.sa_flags  SA_SIGINFO)
-   ret = compat_setup_rt_frame(usig, ka, info, oldset,
-   regs);
+   if (ksig-ka.sa.sa_flags  SA_SIGINFO)
+   ret = compat_setup_rt_frame(usig, ksig, oldset, regs);
else
-   ret = compat_setup_frame(usig, ka, oldset, regs);
+   ret = compat_setup_frame(usig, ksig-ka, oldset, regs);
} else {
-   ret = setup_rt_frame(usig, ka, info, oldset, regs);
+   ret = setup_rt_frame(usig, ksig, oldset, regs);
}
 
/*
@@ -310,18 +308,14 @@ static void handle_signal(unsigned long sig, struct 
k_sigaction *ka,
 */
ret |= !valid_user_regs(regs-user_regs);
 
-   if (ret != 0) {
-   force_sigsegv(sig, tsk);
-   return;
-   }
-
/*
 * Fast forward the stepping logic so we step into the signal
 * handler.
 */
-   user_fastforward_single_step(tsk);
+   if (!ret)
+   user_fastforward_single_step(tsk);
 
-   signal_delivered(sig, info, ka, regs, 0);
+   

[PATCH 13/44] microblaze: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/microblaze/kernel/signal.c | 48 +++--
 1 file changed, 17 insertions(+), 31 deletions(-)

diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index d26d7e7..a34da52 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -156,11 +156,11 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs 
*regs, size_t frame_size)
return (void __user *)((sp - frame_size)  -8UL);
 }
 
-static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
-   sigset_t *set, struct pt_regs *regs)
+static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
+ struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
-   int err = 0;
+   int err = 0, sig = ksig-sig;
int signal;
unsigned long address = 0;
 #ifdef CONFIG_MMU
@@ -168,10 +168,10 @@ static int setup_rt_frame(int sig, struct k_sigaction 
*ka, siginfo_t *info,
pte_t *ptep;
 #endif
 
-   frame = get_sigframe(ka, regs, sizeof(*frame));
+   frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
-   goto give_sigsegv;
+   return -EFAULT;
 
signal = current_thread_info()-exec_domain
 current_thread_info()-exec_domain-signal_invmap
@@ -179,8 +179,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
? current_thread_info()-exec_domain-signal_invmap[sig]
: sig;
 
-   if (info)
-   err |= copy_siginfo_to_user(frame-info, info);
+   if (ksig-ka.sa.sa_flags  SA_SIGINFO)
+   err |= copy_siginfo_to_user(frame-info, ksig-info);
 
/* Create the ucontext. */
err |= __put_user(0, frame-uc.uc_flags);
@@ -227,7 +227,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
flush_dcache_range(address, address + 8);
 #endif
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Set up registers for signal handler */
regs-r1 = (unsigned long) frame;
@@ -237,7 +237,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
regs-r6 = (unsigned long) frame-info; /* arg 1: siginfo */
regs-r7 = (unsigned long) frame-uc; /* arg2: ucontext */
/* Offset to handle microblaze rtid r14, 0 */
-   regs-pc = (unsigned long)ka-sa.sa_handler;
+   regs-pc = (unsigned long)ksig-ka.sa.sa_handler;
 
set_fs(USER_DS);
 
@@ -247,10 +247,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
 #endif
 
return 0;
-
-give_sigsegv:
-   force_sigsegv(sig, current);
-   return -EFAULT;
 }
 
 /* Handle restarting system calls */
@@ -283,23 +279,15 @@ do_restart:
  */
 
 static void
-handle_signal(unsigned long sig, struct k_sigaction *ka,
-   siginfo_t *info, struct pt_regs *regs)
+handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 {
sigset_t *oldset = sigmask_to_save();
int ret;
 
/* Set up the stack frame */
-   if (ka-sa.sa_flags  SA_SIGINFO)
-   ret = setup_rt_frame(sig, ka, info, oldset, regs);
-   else
-   ret = setup_rt_frame(sig, ka, NULL, oldset, regs);
+   ret = setup_rt_frame(ksig, oldset, regs);
 
-   if (ret)
-   return;
-
-   signal_delivered(sig, info, ka, regs,
-   test_thread_flag(TIF_SINGLESTEP));
+   signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP));
 }
 
 /*
@@ -313,21 +301,19 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
  */
 static void do_signal(struct pt_regs *regs, int in_syscall)
 {
-   siginfo_t info;
-   int signr;
-   struct k_sigaction ka;
+   struct ksignal ksig;
+
 #ifdef DEBUG_SIG
pr_info(do signal: %p %d\n, regs, in_syscall);
pr_info(do signal2: %lx %lx %ld [%lx]\n, regs-pc, regs-r1,
regs-r12, current_thread_info()-flags);
 #endif
 
-   signr = get_signal_to_deliver(info, ka, regs, NULL);
-   if (signr  0) {
+   if (get_signal(ksig)) {
/* Whee! Actually deliver the signal. */
if (in_syscall)
-   handle_restart(regs, ka, 1);
-   handle_signal(signr, ka, info, regs);
+   handle_restart(regs, ksig.ka, 1);
+   handle_signal(ksig, regs);
return;
}
 
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Global signal cleanup, take 2

2014-03-02 Thread Richard Weinberger
This is v2 of the global signal cleanup series.

This patch series moves all remaining archs to the get_signal() and
signal_setup_done() functions. Currently these archs use open coded
variants of the said functions.  Further, unused parameters get removed
from get_signal_to_deliver(), tracehook_signal_handler() and signal_delivered().

The following archs got zero build testing:
arc, c6x, cris-v32, hexagon, metag, score, unicore, sh64.

Changes since v1:
- Dropped h8300: Use get_signal() signal_setup_done(), architecture got 
ripped out
- Dropped openrisc: Use get_signal() signal_setup_done(), merged via openrisc 
tree
- Added ack to c6x: Use get_signal() signal_setup_done()
- Added ack to hexagon: Use get_signal() signal_setup_done()
- Added ack to score: Use get_signal() signal_setup_done()
- Added a common helper to translate signals
- Fixed some build issues
- Addressed comments

Signal translation using exec_domain is in a strange state.
Some archs support it, some not, some only kind of.
I fear mostly because of copypaste developerment.
Here a small overview of my findings:

alpha:  no translation
arc:supports translation
arm:supports translation
arm64:  supports translation
avr32:  no translation
blackfin:   is confused, puts translated signal on stack frame, 
untranslated on regs-r0
c6x:no translation
cris:   no translation, quote: /* TODO what is the current-exec_domain 
stuff and invmap ? */
frv:is confused, puts translated signal on stack frame, 
untranslated on regs-gr8
hexagon:no translation
ia64:   no translation
m32r:   supports translation
m68k:   supports translation
metag:  no translation
microblaze: supports translation
mips:   no translation
mn10300:is confused, puts translated signal on stack frame, 
untranslated on regs-d0
openrisc:   no translation, quote: /* TODO what is the current-exec_domain 
stuff and invmap ? */
parisc: no translation
powerpc:no translation
s390:   supports translation
score:  no translation
sh: supports translation
sparc:  no translation
tile:   support translation
um: support translation (only x86_64)
unicore32:  support translation
x86:support translation (only ia32)
xtensa: support translation

I'm wondering on which archs exec domains (and therefore signal translation)
are fully supported.
I guess we can remove the signal translation stuff from most archs.
Maybe hch can tell us more.

The whole series can also be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git signal_v2

 arch/arc/kernel/signal.c|   52 ---
 arch/arm/kernel/signal.c|   14 
 arch/arm64/include/asm/signal32.h   |7 --
 arch/arm64/kernel/signal.c  |   55 +---
 arch/arm64/kernel/signal32.c|8 +-
 arch/avr32/kernel/signal.c  |   43 +---
 arch/blackfin/kernel/signal.c   |   42 
 arch/c6x/kernel/signal.c|   43 +---
 arch/cris/arch-v10/kernel/signal.c  |   79 +--
 arch/cris/arch-v32/kernel/signal.c  |   77 --
 arch/frv/kernel/signal.c|  122 
 arch/hexagon/kernel/signal.c|   45 +
 arch/ia64/kernel/signal.c   |   46 ++---
 arch/m32r/kernel/signal.c   |   52 +--
 arch/m68k/kernel/signal.c   |   78 +++
 arch/metag/kernel/signal.c  |   55 +++-
 arch/microblaze/kernel/signal.c |   56 +---
 arch/mips/include/asm/abi.h |   10 +-
 arch/mips/kernel/signal.c   |   66 +++
 arch/mips/kernel/signal32.c |   39 ---
 arch/mips/kernel/signal_n32.c   |   20 ++---
 arch/mn10300/kernel/signal.c|  112 +++--
 arch/parisc/kernel/signal.c |   58 +++--
 arch/powerpc/kernel/signal.c|   31 +++--
 arch/powerpc/kernel/signal.h|   12 +--
 arch/powerpc/kernel/signal_32.c |   36 --
 arch/powerpc/kernel/signal_64.c |   28 +++-
 arch/s390/kernel/compat_signal.c|   92 ++-
 arch/s390/kernel/entry.h|4 -
 arch/s390/kernel/signal.c   |   92 +--
 arch/score/kernel/signal.c  |   43 +---
 arch/sh/kernel/signal_32.c  |   94 +--
 arch/sh/kernel/signal_64.c  |   97 ++--
 arch/tile/include/asm/compat.h  |3 
 arch/tile/kernel/compat_signal.c|   37 --
 arch/tile/kernel/signal.c   |   62 +++---
 arch/um/include/shared/frame_kern.h |   12 +--
 arch/um/kernel/signal.c |   27 +++
 

[PATCH 18/44] s390: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/s390/kernel/compat_signal.c | 79 ++--
 arch/s390/kernel/entry.h |  4 +-
 arch/s390/kernel/signal.c| 79 
 3 files changed, 69 insertions(+), 93 deletions(-)

diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 8b84bc3..f6c6140 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -320,38 +320,39 @@ static inline int map_signal(int sig)
return sig;
 }
 
-static int setup_frame32(int sig, struct k_sigaction *ka,
-   sigset_t *set, struct pt_regs * regs)
+static int setup_frame32(struct ksignal *ksig, sigset_t *set,
+struct pt_regs *regs)
 {
-   sigframe32 __user *frame = get_sigframe(ka, regs, sizeof(sigframe32));
+   int sig = ksig-sig;
+   sigframe32 __user *frame = get_sigframe(ksig-ka, regs, 
sizeof(sigframe32));
 
if (frame == (void __user *) -1UL)
-   goto give_sigsegv;
+   return -EFAULT;
 
if (__copy_to_user(frame-sc.oldmask, set-sig, _SIGMASK_COPY_SIZE32))
-   goto give_sigsegv;
+   return -EFAULT;
 
if (save_sigregs32(regs, frame-sregs))
-   goto give_sigsegv;
+   return -EFAULT;
if (save_sigregs_gprs_high(regs, frame-gprs_high))
-   goto give_sigsegv;
+   return -EFAULT;
if (__put_user((unsigned long) frame-sregs, frame-sc.sregs))
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Set up to return from userspace.  If provided, use a stub
   already in userspace.  */
-   if (ka-sa.sa_flags  SA_RESTORER) {
-   regs-gprs[14] = (__u64 __force) ka-sa.sa_restorer | 
PSW32_ADDR_AMODE;
+   if (ksig-ka.sa.sa_flags  SA_RESTORER) {
+   regs-gprs[14] = (__u64 __force) ksig-ka.sa.sa_restorer | 
PSW32_ADDR_AMODE;
} else {
regs-gprs[14] = (__u64 __force) frame-retcode | 
PSW32_ADDR_AMODE;
if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
   (u16 __force __user *)(frame-retcode)))
-   goto give_sigsegv;
+   return -EFAULT;
 }
 
/* Set up backchain. */
if (__put_user(regs-gprs[15], (unsigned int __user *) frame))
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Set up registers for signal handler */
regs-gprs[15] = (__force __u64) frame;
@@ -359,7 +360,7 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
regs-psw.mask = PSW_MASK_BA |
(PSW_USER_BITS  PSW_MASK_ASC) |
(regs-psw.mask  ~PSW_MASK_ASC);
-   regs-psw.addr = (__force __u64) ka-sa.sa_handler;
+   regs-psw.addr = (__force __u64) ksig-ka.sa.sa_handler;
 
regs-gprs[2] = map_signal(sig);
regs-gprs[3] = (__force __u64) frame-sc;
@@ -376,25 +377,21 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
 
/* Place signal number on stack to allow backtrace from handler.  */
if (__put_user(regs-gprs[2], (int __force __user *) frame-signo))
-   goto give_sigsegv;
+   return -EFAULT;
return 0;
-
-give_sigsegv:
-   force_sigsegv(sig, current);
-   return -EFAULT;
 }
 
-static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
-  sigset_t *set, struct pt_regs * regs)
+static int setup_rt_frame32(struct ksignal *ksig, sigset_t *set,
+   struct pt_regs *regs)
 {
int err = 0;
-   rt_sigframe32 __user *frame = get_sigframe(ka, regs, 
sizeof(rt_sigframe32));
+   rt_sigframe32 __user *frame = get_sigframe(ksig-ka, regs, 
sizeof(rt_sigframe32));
 
if (frame == (void __user *) -1UL)
-   goto give_sigsegv;
+   return -EFAULT;
 
-   if (copy_siginfo_to_user32(frame-info, info))
-   goto give_sigsegv;
+   if (copy_siginfo_to_user32(frame-info, ksig-info))
+   return -EFAULT;
 
/* Create the ucontext.  */
err |= __put_user(UC_EXTENDED, frame-uc.uc_flags);
@@ -404,22 +401,22 @@ static int setup_rt_frame32(int sig, struct k_sigaction 
*ka, siginfo_t *info,
err |= save_sigregs_gprs_high(regs, frame-gprs_high);
err |= __copy_to_user(frame-uc.uc_sigmask, set, sizeof(*set));
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Set up to return from userspace.  If provided, use a stub
   already in userspace.  */
-   if (ka-sa.sa_flags  SA_RESTORER) {
-   regs-gprs[14] = (__u64 __force) ka-sa.sa_restorer | 
PSW32_ADDR_AMODE;
+   if (ksig-ka.sa.sa_flags  SA_RESTORER) 

[PATCH 21/44] tile: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/tile/include/asm/compat.h   |  3 +--
 arch/tile/kernel/compat_signal.c | 29 ++---
 arch/tile/kernel/signal.c| 54 ++--
 3 files changed, 40 insertions(+), 46 deletions(-)

diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h
index ffd4493..c14e36f 100644
--- a/arch/tile/include/asm/compat.h
+++ b/arch/tile/include/asm/compat.h
@@ -267,8 +267,7 @@ static inline int is_compat_task(void)
return current_thread_info()-status  TS_COMPAT;
 }
 
-extern int compat_setup_rt_frame(int sig, struct k_sigaction *ka,
-siginfo_t *info, sigset_t *set,
+extern int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set,
 struct pt_regs *regs);
 
 /* Compat syscalls. */
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c
index 19c04b5..8c5abf2 100644
--- a/arch/tile/kernel/compat_signal.c
+++ b/arch/tile/kernel/compat_signal.c
@@ -190,18 +190,18 @@ static inline void __user *compat_get_sigframe(struct 
k_sigaction *ka,
return (void __user *) sp;
 }
 
-int compat_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
- sigset_t *set, struct pt_regs *regs)
+int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set,
+ struct pt_regs *regs)
 {
unsigned long restorer;
struct compat_rt_sigframe __user *frame;
-   int err = 0;
+   int err = 0, sig = ksig-sig;
int usig;
 
-   frame = compat_get_sigframe(ka, regs, sizeof(*frame));
+   frame = compat_get_sigframe(ksig-ka, regs, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
-   goto give_sigsegv;
+   goto err;
 
usig = current_thread_info()-exec_domain
 current_thread_info()-exec_domain-signal_invmap
@@ -210,12 +210,12 @@ int compat_setup_rt_frame(int sig, struct k_sigaction 
*ka, siginfo_t *info,
: sig;
 
/* Always write at least the signal number for the stack backtracer. */
-   if (ka-sa.sa_flags  SA_SIGINFO) {
+   if (ksig-ka.sa.sa_flags  SA_SIGINFO) {
/* At sigreturn time, restore the callee-save registers too. */
-   err |= copy_siginfo_to_user32(frame-info, info);
+   err |= copy_siginfo_to_user32(frame-info, ksig-info);
regs-flags |= PT_FLAGS_RESTORE_REGS;
} else {
-   err |= __put_user(info-si_signo, frame-info.si_signo);
+   err |= __put_user(ksig-info.si_signo, frame-info.si_signo);
}
 
/* Create the ucontext.  */
@@ -226,11 +226,11 @@ int compat_setup_rt_frame(int sig, struct k_sigaction 
*ka, siginfo_t *info,
err |= setup_sigcontext(frame-uc.uc_mcontext, regs);
err |= __copy_to_user(frame-uc.uc_sigmask, set, sizeof(*set));
if (err)
-   goto give_sigsegv;
+   goto err;
 
restorer = VDSO_SYM(__vdso_rt_sigreturn);
-   if (ka-sa.sa_flags  SA_RESTORER)
-   restorer = ptr_to_compat_reg(ka-sa.sa_restorer);
+   if (ksig-ka.sa.sa_flags  SA_RESTORER)
+   restorer = ptr_to_compat_reg(ksig-ka.sa.sa_restorer);
 
/*
 * Set up registers for signal handler.
@@ -239,7 +239,7 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
 * We always pass siginfo and mcontext, regardless of SA_SIGINFO,
 * since some things rely on this (e.g. glibc's debug/segfault.c).
 */
-   regs-pc = ptr_to_compat_reg(ka-sa.sa_handler);
+   regs-pc = ptr_to_compat_reg(ksig-ka.sa.sa_handler);
regs-ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
regs-sp = ptr_to_compat_reg(frame);
regs-lr = restorer;
@@ -249,7 +249,8 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
regs-flags |= PT_FLAGS_CALLER_SAVES;
return 0;
 
-give_sigsegv:
-   signal_fault(bad setup frame, regs, frame, sig);
+err:
+   trace_unhandled_signal(bad sigreturn frame, regs,
+ (unsigned long)frame, SIGSEGV);
return -EFAULT;
 }
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c
index 2d1dbf3..27aba86 100644
--- a/arch/tile/kernel/signal.c
+++ b/arch/tile/kernel/signal.c
@@ -153,18 +153,18 @@ static inline void __user *get_sigframe(struct 
k_sigaction *ka,
return (void __user *) sp;
 }
 
-static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
-  sigset_t *set, struct pt_regs *regs)
+static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
+ struct pt_regs *regs)
 {
unsigned long restorer;
struct rt_sigframe 

[PATCH 20/44] sh: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/sh/kernel/signal_32.c | 79 ++--
 arch/sh/kernel/signal_64.c | 82 ++
 2 files changed, 64 insertions(+), 97 deletions(-)

diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index 6af6e7c..2ee67c5 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -266,17 +266,17 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, 
size_t frame_size)
 extern void __kernel_sigreturn(void);
 extern void __kernel_rt_sigreturn(void);
 
-static int setup_frame(int sig, struct k_sigaction *ka,
-   sigset_t *set, struct pt_regs *regs)
+static int setup_frame(struct ksignal *ksig, sigset_t *set,
+  struct pt_regs *regs)
 {
struct sigframe __user *frame;
-   int err = 0;
+   int err = 0, sig = ksig-sig;
int signal;
 
-   frame = get_sigframe(ka, regs-regs[15], sizeof(*frame));
+   frame = get_sigframe(ksig-ka, regs-regs[15], sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
-   goto give_sigsegv;
+   return -EFAULT;
 
signal = current_thread_info()-exec_domain
 current_thread_info()-exec_domain-signal_invmap
@@ -292,8 +292,8 @@ static int setup_frame(int sig, struct k_sigaction *ka,
 
/* Set up to return from userspace.  If provided, use a stub
   already in userspace.  */
-   if (ka-sa.sa_flags  SA_RESTORER) {
-   regs-pr = (unsigned long) ka-sa.sa_restorer;
+   if (ksig-ka.sa.sa_flags  SA_RESTORER) {
+   regs-pr = (unsigned long) ksig-ka.sa.sa_restorer;
 #ifdef CONFIG_VSYSCALL
} else if (likely(current-mm-context.vdso)) {
regs-pr = VDSO_SYM(__kernel_sigreturn);
@@ -313,7 +313,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
}
 
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
/* Set up registers for signal handler */
regs-regs[15] = (unsigned long) frame;
@@ -323,15 +323,15 @@ static int setup_frame(int sig, struct k_sigaction *ka,
 
if (current-personality  FDPIC_FUNCPTRS) {
struct fdpic_func_descriptor __user *funcptr =
-   (struct fdpic_func_descriptor __user 
*)ka-sa.sa_handler;
+   (struct fdpic_func_descriptor __user 
*)ksig-ka.sa.sa_handler;
 
err |= __get_user(regs-pc, funcptr-text);
err |= __get_user(regs-regs[12], funcptr-GOT);
} else
-   regs-pc = (unsigned long)ka-sa.sa_handler;
+   regs-pc = (unsigned long)ksig-ka.sa.sa_handler;
 
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
set_fs(USER_DS);
 
@@ -339,23 +339,19 @@ static int setup_frame(int sig, struct k_sigaction *ka,
 current-comm, task_pid_nr(current), frame, regs-pc, 
regs-pr);
 
return 0;
-
-give_sigsegv:
-   force_sigsegv(sig, current);
-   return -EFAULT;
 }
 
-static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
-  sigset_t *set, struct pt_regs *regs)
+static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
+ struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
-   int err = 0;
+   int err = 0, sig = ksig-sig;
int signal;
 
-   frame = get_sigframe(ka, regs-regs[15], sizeof(*frame));
+   frame = get_sigframe(ksig-ka, regs-regs[15], sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
-   goto give_sigsegv;
+   return -EFAULT;
 
signal = current_thread_info()-exec_domain
 current_thread_info()-exec_domain-signal_invmap
@@ -363,7 +359,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
? current_thread_info()-exec_domain-signal_invmap[sig]
: sig;
 
-   err |= copy_siginfo_to_user(frame-info, info);
+   err |= copy_siginfo_to_user(frame-info, ksig-info);
 
/* Create the ucontext.  */
err |= __put_user(0, frame-uc.uc_flags);
@@ -375,8 +371,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, 
siginfo_t *info,
 
/* Set up to return from userspace.  If provided, use a stub
   already in userspace.  */
-   if (ka-sa.sa_flags  SA_RESTORER) {
-   regs-pr = (unsigned long) ka-sa.sa_restorer;
+   if (ksig-ka.sa.sa_flags  SA_RESTORER) {
+   regs-pr = (unsigned long) ksig-ka.sa.sa_restorer;
 #ifdef CONFIG_VSYSCALL
} else if (likely(current-mm-context.vdso)) {
regs-pr = VDSO_SYM(__kernel_rt_sigreturn);
@@ -396,7 +392,7 @@ static int setup_rt_frame(int 

[PATCH 22/44] um: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/um/include/shared/frame_kern.h | 12 --
 arch/um/kernel/signal.c | 27 +-
 arch/x86/um/signal.c| 45 +
 3 files changed, 36 insertions(+), 48 deletions(-)

diff --git a/arch/um/include/shared/frame_kern.h 
b/arch/um/include/shared/frame_kern.h
index f2ca570..a5cde5c 100644
--- a/arch/um/include/shared/frame_kern.h
+++ b/arch/um/include/shared/frame_kern.h
@@ -6,14 +6,10 @@
 #ifndef __FRAME_KERN_H_
 #define __FRAME_KERN_H_
 
-extern int setup_signal_stack_sc(unsigned long stack_top, int sig,
-struct k_sigaction *ka,
-struct pt_regs *regs,
-sigset_t *mask);
-extern int setup_signal_stack_si(unsigned long stack_top, int sig,
-struct k_sigaction *ka,
-struct pt_regs *regs, struct siginfo *info,
-sigset_t *mask);
+extern int setup_signal_stack_sc(unsigned long stack_top, struct ksignal *ksig,
+struct pt_regs *regs, sigset_t *mask);
+extern int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
+struct pt_regs *regs, sigset_t *mask);
 
 #endif
 
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c
index f57e02e..4f60e4a 100644
--- a/arch/um/kernel/signal.c
+++ b/arch/um/kernel/signal.c
@@ -18,8 +18,7 @@ EXPORT_SYMBOL(unblock_signals);
 /*
  * OK, we're invoking a handler
  */
-static void handle_signal(struct pt_regs *regs, unsigned long signr,
-struct k_sigaction *ka, struct siginfo *info)
+static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 {
sigset_t *oldset = sigmask_to_save();
int singlestep = 0;
@@ -39,7 +38,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long 
signr,
break;
 
case -ERESTARTSYS:
-   if (!(ka-sa.sa_flags  SA_RESTART)) {
+   if (!(ksig-ka.sa.sa_flags  SA_RESTART)) {
PT_REGS_SYSCALL_RET(regs) = -EINTR;
break;
}
@@ -52,32 +51,28 @@ static void handle_signal(struct pt_regs *regs, unsigned 
long signr,
}
 
sp = PT_REGS_SP(regs);
-   if ((ka-sa.sa_flags  SA_ONSTACK)  (sas_ss_flags(sp) == 0))
+   if ((ksig-ka.sa.sa_flags  SA_ONSTACK)  (sas_ss_flags(sp) == 0))
sp = current-sas_ss_sp + current-sas_ss_size;
 
 #ifdef CONFIG_ARCH_HAS_SC_SIGNALS
-   if (!(ka-sa.sa_flags  SA_SIGINFO))
-   err = setup_signal_stack_sc(sp, signr, ka, regs, oldset);
+   if (!(ksig-ka.sa.sa_flags  SA_SIGINFO))
+   err = setup_signal_stack_sc(sp, ksig, regs, oldset);
else
 #endif
-   err = setup_signal_stack_si(sp, signr, ka, regs, info, oldset);
+   err = setup_signal_stack_si(sp, ksig, regs, oldset);
 
-   if (err)
-   force_sigsegv(signr, current);
-   else
-   signal_delivered(signr, info, ka, regs, singlestep);
+   signal_setup_done(err, ksig, singlestep);
 }
 
 static int kern_do_signal(struct pt_regs *regs)
 {
-   struct k_sigaction ka_copy;
-   struct siginfo info;
-   int sig, handled_sig = 0;
+   struct ksignal ksig;
+   int handled_sig = 0;
 
-   while ((sig = get_signal_to_deliver(info, ka_copy, regs, NULL))  0) {
+   while (get_signal(ksig)) {
handled_sig = 1;
/* Whee!  Actually deliver the signal.  */
-   handle_signal(regs, sig, ka_copy, info);
+   handle_signal(ksig, regs);
}
 
/* Did we come from a system call? */
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c
index 5e04a1c..79d8245 100644
--- a/arch/x86/um/signal.c
+++ b/arch/x86/um/signal.c
@@ -370,13 +370,12 @@ struct rt_sigframe
char retcode[8];
 };
 
-int setup_signal_stack_sc(unsigned long stack_top, int sig,
- struct k_sigaction *ka, struct pt_regs *regs,
- sigset_t *mask)
+int setup_signal_stack_sc(unsigned long stack_top, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *mask)
 {
struct sigframe __user *frame;
void __user *restorer;
-   int err = 0;
+   int err = 0, sig = ksig-sig;
 
/* This is the same calculation as i386 - ((sp + 4)  15) == 0 */
stack_top = ((stack_top + 4)  -16UL) - 4;
@@ -385,8 +384,8 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
return 1;
 
restorer = frame-retcode;
-   if (ka-sa.sa_flags  SA_RESTORER)
-   restorer = ka-sa.sa_restorer;
+   if 

[PATCH 19/44] score: Use get_signal() signal_setup_done()

2014-03-02 Thread Richard Weinberger
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Acked-by: Lennox Wu lennox...@gmail.com
Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/score/kernel/signal.c | 43 ++-
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c
index a00fba3..1651807 100644
--- a/arch/score/kernel/signal.c
+++ b/arch/score/kernel/signal.c
@@ -173,15 +173,15 @@ badframe:
return 0;
 }
 
-static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
-   int signr, sigset_t *set, siginfo_t *info)
+static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs,
+ sigset_t *set)
 {
struct rt_sigframe __user *frame;
int err = 0;
 
-   frame = get_sigframe(ka, regs, sizeof(*frame));
+   frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
-   goto give_sigsegv;
+   return -EFAULT;
 
/*
 * Set up the return code ...
@@ -194,7 +194,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct 
pt_regs *regs,
err |= __put_user(0x80008002, frame-rs_code + 1);
flush_cache_sigtramp((unsigned long) frame-rs_code);
 
-   err |= copy_siginfo_to_user(frame-rs_info, info);
+   err |= copy_siginfo_to_user(frame-rs_info, ksig-info);
err |= __put_user(0, frame-rs_uc.uc_flags);
err |= __put_user(NULL, frame-rs_uc.uc_link);
err |= __save_altstack(frame-rs_uc.uc_stack, regs-regs[0]);
@@ -202,26 +202,23 @@ static int setup_rt_frame(struct k_sigaction *ka, struct 
pt_regs *regs,
err |= __copy_to_user(frame-rs_uc.uc_sigmask, set, sizeof(*set));
 
if (err)
-   goto give_sigsegv;
+   return -EFAULT;
 
regs-regs[0] = (unsigned long) frame;
regs-regs[3] = (unsigned long) frame-rs_code;
-   regs-regs[4] = signr;
+   regs-regs[4] = ksig-sig;
regs-regs[5] = (unsigned long) frame-rs_info;
regs-regs[6] = (unsigned long) frame-rs_uc;
-   regs-regs[29] = (unsigned long) ka-sa.sa_handler;
-   regs-cp0_epc = (unsigned long) ka-sa.sa_handler;
+   regs-regs[29] = (unsigned long) ksig-ka.sa.sa_handler;
+   regs-cp0_epc = (unsigned long) ksig-ka.sa.sa_handler;
 
return 0;
-
-give_sigsegv:
-   force_sigsegv(signr, current);
-   return -EFAULT;
 }
 
-static void handle_signal(unsigned long sig, siginfo_t *info,
-   struct k_sigaction *ka, struct pt_regs *regs)
+static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 {
+   int ret;
+
if (regs-is_syscall) {
switch (regs-regs[4]) {
case ERESTART_RESTARTBLOCK:
@@ -229,7 +226,7 @@ static void handle_signal(unsigned long sig, siginfo_t 
*info,
regs-regs[4] = EINTR;
break;
case ERESTARTSYS:
-   if (!(ka-sa.sa_flags  SA_RESTART)) {
+   if (!(ksig-ka.sa.sa_flags  SA_RESTART)) {
regs-regs[4] = EINTR;
break;
}
@@ -245,17 +242,14 @@ static void handle_signal(unsigned long sig, siginfo_t 
*info,
/*
 * Set up the stack frame
 */
-   if (setup_rt_frame(ka, regs, sig, sigmask_to_save(), info)  0)
-   return;
+   ret = setup_rt_frame(ksig, regs, sigmask_to_save());
 
-   signal_delivered(sig, info, ka, regs, 0);
+   signal_setup_done(ret, ksig, 0);
 }
 
 static void do_signal(struct pt_regs *regs)
 {
-   struct k_sigaction ka;
-   siginfo_t info;
-   int signr;
+   struct ksignal ksig;
 
/*
 * We want the common case to go fast, which is why we may in certain
@@ -265,10 +259,9 @@ static void do_signal(struct pt_regs *regs)
if (!user_mode(regs))
return;
 
-   signr = get_signal_to_deliver(info, ka, regs, NULL);
-   if (signr  0) {
+   if (get_signal(ksig)) {
/* Actually deliver the signal.  */
-   handle_signal(signr, info, ka, regs);
+   handle_signal(ksig, regs);
return;
}
 
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/5 v3] Staging: cxt1e1: Fix line length over 80 characters in hwprobe.c

2014-03-02 Thread Daeseok Youn

clean up checkpatch.pl warnings:
 WARNING: Line length over 80 characters

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
 drivers/staging/cxt1e1/hwprobe.c |   45 --
 1 file changed, 28 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 85040bb..d6ccbd9 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -37,7 +37,8 @@ extern int  drvr_state;
 
 /* forward references */
 voidc4_stopwd(ci_t *);
-struct net_device * __init c4_add_dev(hdw_info_t *, int, unsigned long, 
unsigned long, int, int);
+struct net_device * __init c4_add_dev(hdw_info_t *, int, unsigned long,
+ unsigned long, int, int);
 
 
 struct s_hdw_info hdw_info[MAX_BOARDS];
@@ -104,24 +105,31 @@ hdw_sn_get(hdw_info_t *hi, int brdno)
addr = (long) hi-addr_mapped[1] + EEPROM_OFFSET;
 
/* read EEPROM with largest known format size... */
-   pmc_eeprom_read_buffer(addr, 0, (char *)hi-mfg_info.data, 
sizeof(FLD_TYPE2));
+   pmc_eeprom_read_buffer(addr, 0, (char *)hi-mfg_info.data,
+  sizeof(FLD_TYPE2));
 
 #if 0
{
unsigned char *ucp = (unsigned char *) hi-mfg_info.data;
 
pr_info(eeprom[00]:  %02x %02x %02x %02x  %02x %02x %02x 
%02x\n,
-   *(ucp + 0), *(ucp + 1), *(ucp + 2), *(ucp + 3), 
*(ucp + 4), *(ucp + 5), *(ucp + 6), *(ucp + 7));
+   *(ucp + 0), *(ucp + 1), *(ucp + 2), *(ucp + 3),
+   *(ucp + 4), *(ucp + 5), *(ucp + 6), *(ucp + 7));
pr_info(eeprom[08]:  %02x %02x %02x %02x  %02x %02x %02x 
%02x\n,
-   *(ucp + 8), *(ucp + 9), *(ucp + 10), *(ucp + 
11), *(ucp + 12), *(ucp + 13), *(ucp + 14), *(ucp + 15));
+   *(ucp + 8), *(ucp + 9), *(ucp + 10), *(ucp + 11),
+   *(ucp + 12), *(ucp + 13), *(ucp + 14), *(ucp + 15));
pr_info(eeprom[16]:  %02x %02x %02x %02x  %02x %02x %02x 
%02x\n,
-   *(ucp + 16), *(ucp + 17), *(ucp + 18), *(ucp + 
19), *(ucp + 20), *(ucp + 21), *(ucp + 22), *(ucp + 23));
+   *(ucp + 16), *(ucp + 17), *(ucp + 18), *(ucp + 19),
+   *(ucp + 20), *(ucp + 21), *(ucp + 22), *(ucp + 23));
pr_info(eeprom[24]:  %02x %02x %02x %02x  %02x %02x %02x 
%02x\n,
-   *(ucp + 24), *(ucp + 25), *(ucp + 26), *(ucp + 
27), *(ucp + 28), *(ucp + 29), *(ucp + 30), *(ucp + 31));
+   *(ucp + 24), *(ucp + 25), *(ucp + 26), *(ucp + 27),
+   *(ucp + 28), *(ucp + 29), *(ucp + 30), *(ucp + 31));
pr_info(eeprom[32]:  %02x %02x %02x %02x  %02x %02x %02x 
%02x\n,
-   *(ucp + 32), *(ucp + 33), *(ucp + 34), *(ucp + 
35), *(ucp + 36), *(ucp + 37), *(ucp + 38), *(ucp + 39));
+   *(ucp + 32), *(ucp + 33), *(ucp + 34), *(ucp + 35),
+   *(ucp + 36), *(ucp + 37), *(ucp + 38), *(ucp + 39));
pr_info(eeprom[40]:  %02x %02x %02x %02x  %02x %02x %02x 
%02x\n,
-   *(ucp + 40), *(ucp + 41), *(ucp + 42), *(ucp + 
43), *(ucp + 44), *(ucp + 45), *(ucp + 46), *(ucp + 47));
+   *(ucp + 40), *(ucp + 41), *(ucp + 42), *(ucp + 43),
+   *(ucp + 44), *(ucp + 45), *(ucp + 46), *(ucp + 47));
}
 #endif
 #if 0
@@ -230,10 +238,11 @@ c4_hdw_init(struct pci_dev *pdev, int found)
return 0;
}
 
-   if (pdev-bus)  /* obtain bus number */
+   /* obtain bus number */
+   if (pdev-bus)
busno = pdev-bus-number;
else
-   busno = 0;  /* default for system PCI 
inconsistency */
+   busno = 0; /* default for system PCI inconsistency */
slot = pdev-devfn  ~0x07;
 
/*
@@ -246,8 +255,8 @@ c4_hdw_init(struct pci_dev *pdev, int found)
for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++)
{
/*
-* match with board's first found interface, otherwise this is 
first
-* found
+* match with board's first found interface, otherwise this is
+* fisrt found
 */
if ((hi-pci_slot == 0xff) ||   /* new board */
((hi-pci_slot == slot)  (hi-bus == pdev-bus)))
@@ -256,13 +265,14 @@ c4_hdw_init(struct pci_dev *pdev, int found)
if (i == MAX_BOARDS)/* no match in above loop means MAX
 * exceeded */
{
-   pr_warning(exceeded number of allowed devices (%d)?\n, 
MAX_BOARDS);
+   pr_warning(exceeded number of allowed devices (%d)?\n,
+  MAX_BOARDS);
return 0;
  

[PATCH 28/44] Add translate_signal() helper

2014-03-02 Thread Richard Weinberger
Translating signals is common task. Currently many arch have this
open coded. This provides a common helper for all archs.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 include/linux/signal.h | 12 
 1 file changed, 12 insertions(+)

diff --git a/include/linux/signal.h b/include/linux/signal.h
index ef8fcfd..5dfe4c8 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -2,6 +2,8 @@
 #define _LINUX_SIGNAL_H
 
 #include linux/list.h
+#include linux/personality.h
+#include linux/thread_info.h
 #include uapi/linux/signal.h
 
 struct task_struct;
@@ -285,6 +287,16 @@ struct ksignal {
int sig;
 };
 
+static inline int translate_signal(int sig)
+{
+   struct thread_info *info = current_thread_info();
+
+   if (info-exec_domain  info-exec_domain-signal_invmap  sig  32)
+   return info-exec_domain-signal_invmap[sig];
+
+   return sig;
+}
+
 extern int get_signal(struct ksignal *ksig);
 extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping);
 extern void exit_signals(struct task_struct *tsk);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 35/44] m68k: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/m68k/kernel/signal.c | 15 ++-
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index c8e6fa8..b8a428b 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -39,7 +39,6 @@
 #include linux/unistd.h
 #include linux/stddef.h
 #include linux/highuid.h
-#include linux/personality.h
 #include linux/tty.h
 #include linux/binfmts.h
 #include linux/module.h
@@ -871,12 +870,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
if (fsize)
err |= copy_to_user (frame + 1, regs + 1, fsize);
 
-   err |= __put_user((current_thread_info()-exec_domain
-   current_thread_info()-exec_domain-signal_invmap
-   sig  32
-  ? 
current_thread_info()-exec_domain-signal_invmap[sig]
-  : sig),
- frame-sig);
+   err |= __put_user(translate_signal(sig), frame-sig);
 
err |= __put_user(regs-vector, frame-code);
err |= __put_user(frame-sc, frame-psc);
@@ -956,12 +950,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
if (fsize)
err |= copy_to_user (frame-uc.uc_extra, regs + 1, fsize);
 
-   err |= __put_user((current_thread_info()-exec_domain
-   current_thread_info()-exec_domain-signal_invmap
-   sig  32
-  ? 
current_thread_info()-exec_domain-signal_invmap[sig]
-  : sig),
- frame-sig);
+   err |= __put_user(translate_signal(sig), frame-sig);
err |= __put_user(frame-info, frame-pinfo);
err |= __put_user(frame-uc, frame-puc);
err |= copy_siginfo_to_user(frame-info, ksig-info);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 33/44] frv: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/frv/kernel/signal.c | 27 ++-
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 8e37cf2..108a74e 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -19,7 +19,6 @@
 #include linux/wait.h
 #include linux/ptrace.h
 #include linux/unistd.h
-#include linux/personality.h
 #include linux/tracehook.h
 #include asm/ucontext.h
 #include asm/uaccess.h
@@ -183,7 +182,6 @@ static inline void __user *get_sigframe(struct k_sigaction 
*ka,
 static int setup_frame(struct ksignal *ksig, sigset_t *set)
 {
struct sigframe __user *frame;
-   int rsig, sig = ksig-sig;
 
set_fs(USER_DS);
 
@@ -192,13 +190,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   rsig = sig;
-   if (sig  32 
-   __current_thread_info-exec_domain 
-   __current_thread_info-exec_domain-signal_invmap)
-   rsig = __current_thread_info-exec_domain-signal_invmap[sig];
-
-   if (__put_user(rsig, frame-sig)  0)
+   if (__put_user(translate_signal(ksig-sig), frame-sig)  0)
return -EFAULT;
 
if (setup_sigcontext(frame-sc, set-sig[0]))
@@ -246,11 +238,11 @@ static int setup_frame(struct ksignal *ksig, sigset_t 
*set)
 
__frame-sp   = (unsigned long) frame;
__frame-lr   = (unsigned long) frame-retcode;
-   __frame-gr8  = sig;
+   __frame-gr8  = ksig-sig;
 
 #if DEBUG_SIG
printk(SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n,
-  sig, current-comm, current-pid, frame, __frame-pc,
+  ksig-sig, current-comm, current-pid, frame, __frame-pc,
   frame-pretcode);
 #endif
 
@@ -264,7 +256,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
 static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
 {
struct rt_sigframe __user *frame;
-   int rsig, sig = ksig-sig;
 
set_fs(USER_DS);
 
@@ -273,13 +264,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set)
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   rsig = sig;
-   if (sig  32 
-   __current_thread_info-exec_domain 
-   __current_thread_info-exec_domain-signal_invmap)
-   rsig = __current_thread_info-exec_domain-signal_invmap[sig];
-
-   if (__put_user(rsig,frame-sig) ||
+   if (__put_user(translate_signal(ksig-sig), frame-sig) ||
__put_user(frame-info,frame-pinfo) ||
__put_user(frame-uc,  frame-puc))
return -EFAULT;
@@ -335,12 +320,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set)
 
__frame-sp  = (unsigned long) frame;
__frame-lr  = (unsigned long) frame-retcode;
-   __frame-gr8 = sig;
+   __frame-gr8 = ksig-sig;
__frame-gr9 = (unsigned long) frame-info;
 
 #if DEBUG_SIG
printk(SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n,
-  sig, current-comm, current-pid, frame, __frame-pc,
+  ksig-sig, current-comm, current-pid, frame, __frame-pc,
   frame-pretcode);
 #endif
return 0;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 31/44] arm64: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/arm64/kernel/signal.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index f6f23dd..165a72a 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -19,7 +19,6 @@
 
 #include linux/errno.h
 #include linux/signal.h
-#include linux/personality.h
 #include linux/freezer.h
 #include linux/uaccess.h
 #include linux/tracehook.h
@@ -282,16 +281,10 @@ static void handle_signal(struct ksignal *ksig, struct 
pt_regs *regs)
struct thread_info *thread = current_thread_info();
struct task_struct *tsk = current;
sigset_t *oldset = sigmask_to_save();
-   int usig = ksig-sig;
+   int usig = translate_signal(ksig-sig);
int ret;
 
/*
-* translate the signal
-*/
-   if (usig  32  thread-exec_domain  
thread-exec_domain-signal_invmap)
-   usig = thread-exec_domain-signal_invmap[usig];
-
-   /*
 * Set up the stack frame
 */
if (is_compat_task()) {
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/5 v2] staging: cxt1e1: fix checkpatch error 'assignment in if condition'

2014-03-02 Thread Daeseok Youn

checkpatch.pl error:
 ERROR: do not use assignment in if condition

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
 drivers/staging/cxt1e1/hwprobe.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index d6ccbd9..5f0e05d 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -142,8 +142,8 @@ hdw_sn_get(hdw_info_t *hi, int brdno)
hi-mfg_info.Serial[5]);
 #endif
 
-   if ((hi-promfmt = pmc_verify_cksum(hi-mfg_info.data)) == 
PROM_FORMAT_Unk)
-   {
+   hi-promfmt = pmc_verify_cksum(hi-mfg_info.data);
+   if (hi-promfmt == PROM_FORMAT_Unk) {
/* bad crc, data is suspect */
if (cxt1e1_log_level = LOG_WARN)
pr_info(%s: EEPROM cksum error\n, hi-devname);
@@ -232,8 +232,8 @@ c4_hdw_init(struct pci_dev *pdev, int found)
unsigned char busno = 0xff;
 
/* our MUSYCC chip supports two functions, 0  1 */
-   if ((fun = PCI_FUNC(pdev-devfn))  1)
-   {
+   fun = PCI_FUNC(pdev-devfn);
+   if (fun  1) {
pr_warning(unexpected devfun: 0x%x\n, pdev-devfn);
return 0;
}
@@ -380,11 +380,11 @@ c4hw_attach_all(void)
}
pci_set_master(hi-pdev[0]);
pci_set_master(hi-pdev[1]);
-   if (!(hi-ndev = c4_add_dev(hi, i, (long) hi-addr_mapped[0],
-   (long) hi-addr_mapped[1],
-   hi-pdev[0]-irq,
-   hi-pdev[1]-irq)))
-   {
+   hi-ndev = c4_add_dev(hi, i, (long) hi-addr_mapped[0],
+ (long) hi-addr_mapped[1],
+ hi-pdev[0]-irq,
+ hi-pdev[1]-irq);
+   if (!hi-ndev) {
drvr_state = SBE_DRVR_DOWN;
cleanup_ioremap();
/* NOTE: c4_add_dev() does its own device cleanup */
-- 
1.7.9.5


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Consistently use xrealloc instead of realloc

2014-03-02 Thread Heinrich Schuchardt

Note that in general dtc patches should be CCed to myself and Jon
Loeliger j...@jdl.com, the dtc maintainers.



This is the relevant section in file MAINTAINERS of Torvald's git.
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS

OPEN FIRMWARE AND FLATTENED DEVICE TREE
M:  Grant Likely grant.lik...@linaro.org
M:  Rob Herring robh...@kernel.org
L:  devicet...@vger.kernel.org
W:  http://fdt.secretlab.ca
T:  git git://git.secretlab.ca/git/linux-2.6.git
S:  Maintained
F:  drivers/of/
F:  include/linux/of*.h
F:  scripts/dtc/
K:  of_get_property
K:  of_match_table

If the information is not accurate, please, have it updated.

Best regards

Heinrich Schuchardt
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/5 v2] staging: cxt1e1: fix checkpatch errors with open brace '{'

2014-03-02 Thread Daeseok Youn

clean up checkpatch.pl error:
 ERROR: that open brace { should be on the previous line

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
 drivers/staging/cxt1e1/hwprobe.c |   62 +++---
 1 file changed, 25 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 5f0e05d..d87a011 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -58,8 +58,7 @@ show_two(hdw_info_t *hi, int brdno)
 
ci = (ci_t *)(netdev_priv(hi-ndev));
bid = sbeid_get_bdname(ci);
-   switch (hi-promfmt)
-   {
+   switch (hi-promfmt) {
case PROM_FORMAT_TYPE1:
memcpy(sn, (FLD_TYPE1 *)(hi-mfg_info.pft1.Serial), 6);
break;
@@ -159,8 +158,7 @@ prep_hdw_info(void)
hdw_info_t *hi;
int i;
 
-   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++)
-   {
+   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++) {
hi-pci_busno = 0xff;
hi-pci_slot = 0xff;
hi-pci_pin[0] = 0;
@@ -179,18 +177,15 @@ cleanup_ioremap(void)
hdw_info_t *hi;
int i;
 
-   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++)
-   {
+   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++) {
if (hi-pci_slot == 0xff)
break;
-   if (hi-addr_mapped[0])
-   {
+   if (hi-addr_mapped[0]) {
iounmap((void *)(hi-addr_mapped[0]));
release_mem_region((long) hi-addr[0], hi-len[0]);
hi-addr_mapped[0] = 0;
}
-   if (hi-addr_mapped[1])
-   {
+   if (hi-addr_mapped[1]) {
iounmap((void *)(hi-addr_mapped[1]));
release_mem_region((long) hi-addr[1], hi-len[1]);
hi-addr_mapped[1] = 0;
@@ -205,8 +200,7 @@ cleanup_devs(void)
hdw_info_t *hi;
int i;
 
-   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++)
-   {
+   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++) {
if (hi-pci_slot == 0xff || !hi-ndev)
break;
c4_stopwd(netdev_priv(hi-ndev));
@@ -252,8 +246,7 @@ c4_hdw_init(struct pci_dev *pdev, int found)
 * element, identified by slot==(0xff).  The second part of a board's
 * functionality will match the previously loaded slot/busno.
 */
-   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++)
-   {
+   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++) {
/*
 * match with board's first found interface, otherwise this is
 * fisrt found
@@ -262,17 +255,19 @@ c4_hdw_init(struct pci_dev *pdev, int found)
((hi-pci_slot == slot)  (hi-bus == pdev-bus)))
break;  /* found for-loop exit */
}
-   if (i == MAX_BOARDS)/* no match in above loop means MAX
-* exceeded */
-   {
+
+   /* no match in above loop means MAX exceeded */
+   if (i == MAX_BOARDS) {
pr_warning(exceeded number of allowed devices (%d)?\n,
   MAX_BOARDS);
return 0;
}
+
if (pdev-bus)
hi-pci_busno = pdev-bus-number;
else
hi-pci_busno = 0; /* default for system PCI inconsistency */
+
hi-pci_slot = slot;
pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, hi-pci_pin[fun]);
pci_read_config_byte(pdev, PCI_REVISION_ID, hi-revid[fun]);
@@ -311,43 +306,38 @@ c4hw_attach_all(void)
/*** scan PCI bus for all possible boards */
while ((pdev = pci_get_device(PCI_VENDOR_ID_CONEXANT,
  PCI_DEVICE_ID_CN8474,
- pdev)))
-   {
+ pdev))) {
if (c4_hdw_init(pdev, found))
found++;
}
-   if (!found)
-   {
+
+   if (!found) {
pr_warning(No boards found\n);
return -ENODEV;
}
+
/* sanity check for consistent hardware found */
-   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++)
-   {
-   if (hi-pci_slot != 0xff  (!hi-addr[0] || !hi-addr[1]))
-   {
+   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++) {
+   if (hi-pci_slot != 0xff  (!hi-addr[0] || !hi-addr[1])) {
pr_warning(%s: something very wrong with 
pci_get_device\n,
   hi-devname);
return -EIO;
}
}
/* bring board's memory regions on/line */
-   for (i = 0, hi = hdw_info; i  MAX_BOARDS; i++, hi++)
-   

[PATCH 39/44] sh: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/sh/kernel/signal_32.c | 23 ---
 arch/sh/kernel/signal_64.c | 19 ---
 2 files changed, 8 insertions(+), 34 deletions(-)

diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index 2ee67c5..9fe811b 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -20,7 +20,6 @@
 #include linux/stddef.h
 #include linux/tty.h
 #include linux/elf.h
-#include linux/personality.h
 #include linux/binfmts.h
 #include linux/io.h
 #include linux/tracehook.h
@@ -270,20 +269,13 @@ static int setup_frame(struct ksignal *ksig, sigset_t 
*set,
   struct pt_regs *regs)
 {
struct sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
-   int signal;
+   int err = 0;
 
frame = get_sigframe(ksig-ka, regs-regs[15], sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   signal = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
-
err |= setup_sigcontext(frame-sc, regs, set-sig[0]);
 
if (_NSIG_WORDS  1)
@@ -317,7 +309,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
 
/* Set up registers for signal handler */
regs-regs[15] = (unsigned long) frame;
-   regs-regs[4] = signal; /* Arg for signal handler */
+   regs-regs[4] = translate_signal(ksig-sig); /* Arg for signal handler 
*/
regs-regs[5] = 0;
regs-regs[6] = (unsigned long) frame-sc;
 
@@ -345,20 +337,13 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
  struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
-   int signal;
+   int err = 0;
 
frame = get_sigframe(ksig-ka, regs-regs[15], sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   signal = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
-
err |= copy_siginfo_to_user(frame-info, ksig-info);
 
/* Create the ucontext.  */
@@ -396,7 +381,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
 
/* Set up registers for signal handler */
regs-regs[15] = (unsigned long) frame;
-   regs-regs[4] = signal; /* Arg for signal handler */
+   regs-regs[4] = translate_signal(ksig-sig); /* Arg for signal handler 
*/
regs-regs[5] = (unsigned long) frame-info;
regs-regs[6] = (unsigned long) frame-uc;
 
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index 897abe7..693f450 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -17,7 +17,6 @@
 #include linux/signal.h
 #include linux/errno.h
 #include linux/wait.h
-#include linux/personality.h
 #include linux/ptrace.h
 #include linux/unistd.h
 #include linux/stddef.h
@@ -377,19 +376,14 @@ void sa_default_rt_restorer(void);/* See comments 
below */
 static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs 
*regs)
 {
struct sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
-   int signal;
+   int err = 0, signal;
 
frame = get_sigframe(ksig-ka, regs-regs[REG_SP], sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   signal = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
+   signal = translate_signal(ksig-sig);
 
err |= setup_sigcontext(frame-sc, regs, set-sig[0]);
 
@@ -472,19 +466,14 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t 
*set,
  struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
-   int signal;
+   int err = 0, signal;
 
frame = get_sigframe(ksig-ka, regs-regs[REG_SP], sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   signal = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
+   signal = translate_signal(ksig-sig);
 
err |= __put_user(frame-info, frame-pinfo);
err |= __put_user(frame-uc, frame-puc);
-- 
1.8.4.2

--
To unsubscribe from 

[PATCH 44/44] xtensa: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/xtensa/kernel/signal.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index 4612321..905a574 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -18,7 +18,6 @@
 #include linux/signal.h
 #include linux/errno.h
 #include linux/ptrace.h
-#include linux/personality.h
 #include linux/tracehook.h
 
 #include asm/ucontext.h
@@ -335,8 +334,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
   struct pt_regs *regs)
 {
struct rt_sigframe *frame;
-   int err = 0, sig = ksig-sig;
-   int signal;
+   int err = 0, signal;
unsigned long sp, ra, tp;
 
sp = regs-areg[1];
@@ -354,11 +352,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
return -EFAULT;
}
 
-   signal = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
+   signal = translate_signal(ksig-sig);
 
if (ksig-ka.sa.sa_flags  SA_SIGINFO) {
err |= copy_siginfo_to_user(frame-info, ksig-info);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 43/44] um/x86: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/x86/um/signal.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c
index 79d8245..1ffafa1 100644
--- a/arch/x86/um/signal.c
+++ b/arch/x86/um/signal.c
@@ -5,7 +5,6 @@
  */
 
 
-#include linux/personality.h
 #include linux/ptrace.h
 #include linux/kernel.h
 #include asm/unistd.h
@@ -504,7 +503,7 @@ int setup_signal_stack_si(unsigned long stack_top, struct 
ksignal *ksig,
  struct pt_regs *regs, sigset_t *set)
 {
struct rt_sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
+   int err = 0;
 
frame = (struct rt_sigframe __user *)
round_down(stack_top - sizeof(struct rt_sigframe), 16);
@@ -550,14 +549,8 @@ int setup_signal_stack_si(unsigned long stack_top, struct 
ksignal *ksig,
return err;
 
/* Set up registers for signal handler */
-   {
-   struct exec_domain *ed = current_thread_info()-exec_domain;
-   if (unlikely(ed  ed-signal_invmap  sig  32))
-   sig = ed-signal_invmap[sig];
-   }
-
PT_REGS_SP(regs) = (unsigned long) frame;
-   PT_REGS_DI(regs) = sig;
+   PT_REGS_DI(regs) = translate_signal(ksig-sig);
/* In case the signal handler was declared without prototypes */
PT_REGS_AX(regs) = 0;
 
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 41/44] unicore32: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/unicore32/kernel/signal.c | 31 ---
 1 file changed, 8 insertions(+), 23 deletions(-)

diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c
index 780d773..7b48572 100644
--- a/arch/unicore32/kernel/signal.c
+++ b/arch/unicore32/kernel/signal.c
@@ -11,7 +11,6 @@
  */
 #include linux/errno.h
 #include linux/signal.h
-#include linux/personality.h
 #include linux/uaccess.h
 #include linux/tracehook.h
 #include linux/elf.h
@@ -211,13 +210,9 @@ static inline void __user *get_sigframe(struct k_sigaction 
*ka,
return frame;
 }
 
-static int setup_return(struct pt_regs *regs, struct k_sigaction *ka,
-unsigned long __user *rc, void __user *frame, int usig)
+static int setup_return(struct ksignal *ksig, struct pt_regs *regs,
+   unsigned long __user *rc, void __user *frame)
 {
-   unsigned long handler = (unsigned long)ka-sa.sa_handler;
-   unsigned long retcode;
-   unsigned long asr = regs-UCreg_asr  ~PSR_f;
-
unsigned int idx = 0;
 
if (ka-sa.sa_flags  SA_SIGINFO)
@@ -227,13 +222,11 @@ static int setup_return(struct pt_regs *regs, struct 
k_sigaction *ka,
__put_user(sigreturn_codes[idx+1], rc+1))
return 1;
 
-   retcode = KERN_SIGRETURN_CODE + (idx  2);
-
-   regs-UCreg_00 = usig;
+   regs-UCreg_00 = translate_signal(ksig-sig);
regs-UCreg_sp = (unsigned long)frame;
-   regs-UCreg_lr = retcode;
-   regs-UCreg_pc = handler;
-   regs-UCreg_asr = asr;
+   regs-UCreg_lr = KERN_SIGRETURN_CODE + (idx  2);
+   regs-UCreg_pc = (unsigned long)ksig-ka.sa.sa_handler;
+   regs-UCreg_asr = regs-UCreg_asr  ~PSR_f;
 
return 0;
 }
@@ -254,7 +247,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
 
err |= setup_sigframe(frame, regs, set);
if (err == 0)
-   err |= setup_return(regs, ksig-ka, frame-retcode, frame, 
usig);
+   err |= setup_return(ksig, regs, frame-retcode, frame);
 
return err;
 }
@@ -276,7 +269,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
err |= __save_altstack(frame-sig.uc.uc_stack, regs-UCreg_sp);
err |= setup_sigframe(frame-sig, regs, set);
if (err == 0)
-   err |= setup_return(regs, ksig-ka, frame-sig.retcode, frame, 
usig);
+   err |= setup_return(ksig, regs, frame-sig.retcode, frame);
 
if (err == 0) {
/*
@@ -305,7 +298,6 @@ static void handle_signal(struct ksignal *ksig, struct 
pt_regs *regs,
struct thread_info *thread = current_thread_info();
struct task_struct *tsk = current;
sigset_t *oldset = sigmask_to_save();
-   int usig = ksig-sig;
int ret;
 
/*
@@ -329,13 +321,6 @@ static void handle_signal(struct ksignal *ksig, struct 
pt_regs *regs,
}
 
/*
-* translate the signal
-*/
-   if (usig  32  thread-exec_domain
-thread-exec_domain-signal_invmap)
-   usig = thread-exec_domain-signal_invmap[usig];
-
-   /*
 * Set up the stack frame
 */
if (ksig-ka.sa.sa_flags  SA_SIGINFO)
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 42/44] x86: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/x86/kernel/signal.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 9e5de68..cad7c49 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -18,7 +18,6 @@
 #include linux/tracehook.h
 #include linux/unistd.h
 #include linux/stddef.h
-#include linux/personality.h
 #include linux/uaccess.h
 #include linux/user-return-notifier.h
 #include linux/uprobes.h
@@ -596,12 +595,10 @@ badframe:
 static int signr_convert(int sig)
 {
 #ifdef CONFIG_X86_32
-   struct thread_info *info = current_thread_info();
-
-   if (info-exec_domain  info-exec_domain-signal_invmap  sig  32)
-   return info-exec_domain-signal_invmap[sig];
-#endif /* CONFIG_X86_32 */
+   return translate_signal(sig);
+#else /* CONFIG_X86_32 */
return sig;
+#endif
 }
 
 static int
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 40/44] tile: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/tile/kernel/compat_signal.c | 12 ++--
 arch/tile/kernel/signal.c| 12 ++--
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c
index 8c5abf2..b14e5e9 100644
--- a/arch/tile/kernel/compat_signal.c
+++ b/arch/tile/kernel/compat_signal.c
@@ -21,7 +21,6 @@
 #include linux/wait.h
 #include linux/unistd.h
 #include linux/stddef.h
-#include linux/personality.h
 #include linux/suspend.h
 #include linux/ptrace.h
 #include linux/elf.h
@@ -195,20 +194,13 @@ int compat_setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
 {
unsigned long restorer;
struct compat_rt_sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
-   int usig;
+   int err = 0;
 
frame = compat_get_sigframe(ksig-ka, regs, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto err;
 
-   usig = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
-
/* Always write at least the signal number for the stack backtracer. */
if (ksig-ka.sa.sa_flags  SA_SIGINFO) {
/* At sigreturn time, restore the callee-save registers too. */
@@ -243,7 +235,7 @@ int compat_setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
regs-ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
regs-sp = ptr_to_compat_reg(frame);
regs-lr = restorer;
-   regs-regs[0] = (unsigned long) usig;
+   regs-regs[0] = (unsigned long) translate_signal(ksig-sig);
regs-regs[1] = ptr_to_compat_reg(frame-info);
regs-regs[2] = ptr_to_compat_reg(frame-uc);
regs-flags |= PT_FLAGS_CALLER_SAVES;
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c
index 27aba86..5837ccf 100644
--- a/arch/tile/kernel/signal.c
+++ b/arch/tile/kernel/signal.c
@@ -22,7 +22,6 @@
 #include linux/wait.h
 #include linux/unistd.h
 #include linux/stddef.h
-#include linux/personality.h
 #include linux/suspend.h
 #include linux/ptrace.h
 #include linux/elf.h
@@ -158,20 +157,13 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
 {
unsigned long restorer;
struct rt_sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
-   int usig;
+   int err = 0;
 
frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto err;
 
-   usig = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
-
/* Always write at least the signal number for the stack backtracer. */
if (ksig-ka.sa.sa_flags  SA_SIGINFO) {
/* At sigreturn time, restore the callee-save registers too. */
@@ -206,7 +198,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
regs-ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
regs-sp = (unsigned long) frame;
regs-lr = restorer;
-   regs-regs[0] = (unsigned long) usig;
+   regs-regs[0] = (unsigned long) translate_signal(ksig-sig);
regs-regs[1] = (unsigned long) frame-info;
regs-regs[2] = (unsigned long) frame-uc;
regs-flags |= PT_FLAGS_CALLER_SAVES;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 38/44] s390: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/s390/kernel/compat_signal.c | 15 ++-
 arch/s390/kernel/signal.c| 15 ++-
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index f6c6140..0ac6be5 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -20,7 +20,6 @@
 #include linux/unistd.h
 #include linux/stddef.h
 #include linux/tty.h
-#include linux/personality.h
 #include linux/binfmts.h
 #include asm/ucontext.h
 #include asm/uaccess.h
@@ -310,16 +309,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * 
regs, size_t frame_size)
return (void __user *)((sp - frame_size)  -8ul);
 }
 
-static inline int map_signal(int sig)
-{
-   if (current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32)
-   return current_thread_info()-exec_domain-signal_invmap[sig];
-else
-   return sig;
-}
-
 static int setup_frame32(struct ksignal *ksig, sigset_t *set,
 struct pt_regs *regs)
 {
@@ -362,7 +351,7 @@ static int setup_frame32(struct ksignal *ksig, sigset_t 
*set,
(regs-psw.mask  ~PSW_MASK_ASC);
regs-psw.addr = (__force __u64) ksig-ka.sa.sa_handler;
 
-   regs-gprs[2] = map_signal(sig);
+   regs-gprs[2] = translate_signal(sig);
regs-gprs[3] = (__force __u64) frame-sc;
 
/* We forgot to include these in the sigcontext.
@@ -426,7 +415,7 @@ static int setup_rt_frame32(struct ksignal *ksig, sigset_t 
*set,
(regs-psw.mask  ~PSW_MASK_ASC);
regs-psw.addr = (__u64 __force) ksig-ka.sa.sa_handler;
 
-   regs-gprs[2] = map_signal(ksig-sig);
+   regs-gprs[2] = translate_signal(ksig-sig);
regs-gprs[3] = (__force __u64) frame-info;
regs-gprs[4] = (__force __u64) frame-uc;
regs-gprs[5] = task_thread_info(current)-last_break;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 0e420a1..d63272b 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -20,7 +20,6 @@
 #include linux/unistd.h
 #include linux/stddef.h
 #include linux/tty.h
-#include linux/personality.h
 #include linux/binfmts.h
 #include linux/tracehook.h
 #include linux/syscalls.h
@@ -182,16 +181,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * 
regs, size_t frame_size)
return (void __user *)((sp - frame_size)  -8ul);
 }
 
-static inline int map_signal(int sig)
-{
-   if (current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32)
-   return current_thread_info()-exec_domain-signal_invmap[sig];
-   else
-   return sig;
-}
-
 static int setup_frame(int sig, struct k_sigaction *ka,
   sigset_t *set, struct pt_regs * regs)
 {
@@ -235,7 +224,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
(regs-psw.mask  ~PSW_MASK_ASC);
regs-psw.addr = (unsigned long) ka-sa.sa_handler | PSW_ADDR_AMODE;
 
-   regs-gprs[2] = map_signal(sig);
+   regs-gprs[2] = translate_signal(sig);
regs-gprs[3] = (unsigned long) frame-sc;
 
/* We forgot to include these in the sigcontext.
@@ -302,7 +291,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
(regs-psw.mask  ~PSW_MASK_ASC);
regs-psw.addr = (unsigned long) ksig-ka.sa.sa_handler | 
PSW_ADDR_AMODE;
 
-   regs-gprs[2] = map_signal(ksig-sig);
+   regs-gprs[2] = translate_signal(ksig-sig);
regs-gprs[3] = (unsigned long) frame-info;
regs-gprs[4] = (unsigned long) frame-uc;
regs-gprs[5] = task_thread_info(current)-last_break;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 36/44] microblaze: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/microblaze/kernel/signal.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index a34da52..7bde506 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -28,7 +28,6 @@
 #include linux/ptrace.h
 #include linux/unistd.h
 #include linux/stddef.h
-#include linux/personality.h
 #include linux/percpu.h
 #include linux/linkage.h
 #include linux/tracehook.h
@@ -160,8 +159,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
  struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
-   int err = 0, sig = ksig-sig;
-   int signal;
+   int err = 0, signal;
unsigned long address = 0;
 #ifdef CONFIG_MMU
pmd_t *pmdp;
@@ -173,11 +171,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   signal = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
+   signal = translate_signal(ksig-sig);
 
if (ksig-ka.sa.sa_flags  SA_SIGINFO)
err |= copy_siginfo_to_user(frame-info, ksig-info);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 37/44] mn10300: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/mn10300/kernel/signal.c | 27 ++-
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 0c97202..de75354 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -20,7 +20,6 @@
 #include linux/unistd.h
 #include linux/stddef.h
 #include linux/tty.h
-#include linux/personality.h
 #include linux/suspend.h
 #include linux/tracehook.h
 #include asm/cacheflush.h
@@ -211,20 +210,13 @@ static int setup_frame(struct ksignal *ksig, sigset_t 
*set,
   struct pt_regs *regs)
 {
struct sigframe __user *frame;
-   int rsig, sig = ksig-sig;
 
frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   rsig = sig;
-   if (sig  32 
-   current_thread_info()-exec_domain 
-   current_thread_info()-exec_domain-signal_invmap)
-   rsig = current_thread_info()-exec_domain-signal_invmap[sig];
-
-   if (__put_user(rsig, frame-sig)  0 ||
+   if (__put_user(translate_signal(ksig-sig), frame-sig)  0 ||
__put_user(frame-sc, frame-psc)  0)
return -EFAULT;
 
@@ -260,12 +252,12 @@ static int setup_frame(struct ksignal *ksig, sigset_t 
*set,
/* set up registers for signal handler */
regs-sp = (unsigned long) frame;
regs-pc = (unsigned long) ksig-ka.sa.sa_handler;
-   regs-d0 = sig;
+   regs-d0 = ksig-sig;
regs-d1 = (unsigned long) frame-sc;
 
 #if DEBUG_SIG
printk(KERN_DEBUG SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n,
-  sig, current-comm, current-pid, frame, regs-pc,
+  ksig-sig, current-comm, current-pid, frame, regs-pc,
   frame-pretcode);
 #endif
 
@@ -279,20 +271,13 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
  struct pt_regs *regs)
 {
struct rt_sigframe __user *frame;
-   int rsig, sig = ksig-sig;
 
frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   rsig = sig;
-   if (sig  32 
-   current_thread_info()-exec_domain 
-   current_thread_info()-exec_domain-signal_invmap)
-   rsig = current_thread_info()-exec_domain-signal_invmap[sig];
-
-   if (__put_user(rsig, frame-sig) ||
+   if (__put_user(translate_signal(ksig-sig), frame-sig) ||
__put_user(frame-info, frame-pinfo) ||
__put_user(frame-uc, frame-puc) ||
copy_siginfo_to_user(frame-info, ksig-info))
@@ -332,12 +317,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
/* Set up registers for signal handler */
regs-sp = (unsigned long) frame;
regs-pc = (unsigned long) ksig-ka.sa.sa_handler;
-   regs-d0 = sig;
+   regs-d0 = ksig-sig;
regs-d1 = (long) frame-info;
 
 #if DEBUG_SIG
printk(KERN_DEBUG SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n,
-  sig, current-comm, current-pid, frame, regs-pc,
+  ksig-sig, current-comm, current-pid, frame, regs-pc,
   frame-pretcode);
 #endif
 
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 35/44] m68k: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/m68k/kernel/signal.c | 15 ++-
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index c8e6fa8..b8a428b 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -39,7 +39,6 @@
 #include linux/unistd.h
 #include linux/stddef.h
 #include linux/highuid.h
-#include linux/personality.h
 #include linux/tty.h
 #include linux/binfmts.h
 #include linux/module.h
@@ -871,12 +870,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
if (fsize)
err |= copy_to_user (frame + 1, regs + 1, fsize);
 
-   err |= __put_user((current_thread_info()-exec_domain
-   current_thread_info()-exec_domain-signal_invmap
-   sig  32
-  ? 
current_thread_info()-exec_domain-signal_invmap[sig]
-  : sig),
- frame-sig);
+   err |= __put_user(translate_signal(sig), frame-sig);
 
err |= __put_user(regs-vector, frame-code);
err |= __put_user(frame-sc, frame-psc);
@@ -956,12 +950,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
if (fsize)
err |= copy_to_user (frame-uc.uc_extra, regs + 1, fsize);
 
-   err |= __put_user((current_thread_info()-exec_domain
-   current_thread_info()-exec_domain-signal_invmap
-   sig  32
-  ? 
current_thread_info()-exec_domain-signal_invmap[sig]
-  : sig),
- frame-sig);
+   err |= __put_user(translate_signal(sig), frame-sig);
err |= __put_user(frame-info, frame-pinfo);
err |= __put_user(frame-uc, frame-puc);
err |= copy_siginfo_to_user(frame-info, ksig-info);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ACPI / hotplug / PCI: Use pci_device_is_present()

2014-03-02 Thread Rafael J. Wysocki
From: Rafael J. Wysocki rafael.j.wyso...@intel.com

Make the ACPI-based PCI hotplug (ACPIPHP) code use
pci_device_is_present() for checking if devices are present instead
of open coding the same thing.

Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
---

On top of current linux-next.

Thanks!

---
 drivers/pci/hotplug/acpiphp_glue.c |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c
===
--- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c
+++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c
@@ -668,12 +668,9 @@ static void trim_stale_devices(struct pc
alive = (ACPI_SUCCESS(status)  device_status_valid(sta))
|| acpiphp_no_hotplug(adev);
}
-   if (!alive) {
-   u32 v;
+   if (!alive)
+   alive = pci_device_is_present(dev);
 
-   /* Check if the device responds. */
-   alive = pci_bus_read_dev_vendor_id(dev-bus, dev-devfn, v, 0);
-   }
if (!alive) {
pci_stop_and_remove_bus_device(dev);
if (adev)

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 34/44] m32r: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/m32r/kernel/signal.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index cce3fd3..2673513 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -19,7 +19,6 @@
 #include linux/wait.h
 #include linux/unistd.h
 #include linux/stddef.h
-#include linux/personality.h
 #include linux/tracehook.h
 #include asm/cacheflush.h
 #include asm/ucontext.h
@@ -178,18 +177,14 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
*set,
 {
struct rt_sigframe __user *frame;
int err = 0;
-   int signal, sig = ksig-sig;
+   int signal;
 
frame = get_sigframe(ksig-ka, regs-spu, sizeof(*frame));
 
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
 
-   signal = current_thread_info()-exec_domain
-current_thread_info()-exec_domain-signal_invmap
-sig  32
-   ? current_thread_info()-exec_domain-signal_invmap[sig]
-   : sig;
+   signal = translate_signal(ksig-sig);
 
err |= __put_user(signal, frame-sig);
if (err)
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 32/44] blackfin: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/blackfin/kernel/signal.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index 1389cd3..707165a 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -8,7 +8,6 @@
 #include linux/syscalls.h
 #include linux/ptrace.h
 #include linux/tty.h
-#include linux/personality.h
 #include linux/binfmts.h
 #include linux/uaccess.h
 #include linux/tracehook.h
@@ -159,11 +158,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct 
pt_regs *regs)
 
frame = get_sigframe(ksig-ka, regs, sizeof(*frame));
 
-   err |= __put_user((current_thread_info()-exec_domain
-   current_thread_info()-exec_domain-signal_invmap
-   ksig-sig  32
-  ? current_thread_info()-exec_domain-
-  signal_invmap[ksig-sig] : ksig-sig), frame-sig);
+   err |= __put_user(translate_signal(ksig-sig), frame-sig);
 
err |= __put_user(frame-info, frame-pinfo);
err |= __put_user(frame-uc, frame-puc);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Update source code location for dtc in manual.txt

2014-03-02 Thread David Gibson
On Mon, Mar 03, 2014 at 10:42:12AM +1100, David Gibson wrote:
 On Sun, Mar 02, 2014 at 10:39:14PM +0100, xypron.g...@gmx.de wrote:
  From: Heinrich Schuchardt xypron.g...@gmx.de
  
  The information about the location of the source code of the
  device tree compiler was inaccurate.
  
  Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de
 
 Trailing whitespace removed, then applied.  Thanks.

Uh, actually, corrected some of the submission details as well.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgppfbqcL60by.pgp
Description: PGP signature


[PATCH 30/44] arm: Use translate_signal()

2014-03-02 Thread Richard Weinberger
Use the common helper instead of it's own variant.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 arch/arm/kernel/signal.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 04d6388..9c6a908 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -10,7 +10,6 @@
 #include linux/errno.h
 #include linux/random.h
 #include linux/signal.h
-#include linux/personality.h
 #include linux/uaccess.h
 #include linux/tracehook.h
 
@@ -317,17 +316,6 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, 
int framesize)
return frame;
 }
 
-/*
- * translate the signal
- */
-static inline int map_sig(int sig)
-{
-   struct thread_info *thread = current_thread_info();
-   if (sig  32  thread-exec_domain  
thread-exec_domain-signal_invmap)
-   sig = thread-exec_domain-signal_invmap[sig];
-   return sig;
-}
-
 static int
 setup_return(struct pt_regs *regs, struct ksignal *ksig,
 unsigned long __user *rc, void __user *frame)
@@ -411,7 +399,7 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
}
}
 
-   regs-ARM_r0 = map_sig(ksig-sig);
+   regs-ARM_r0 = translate_signal(ksig-sig);
regs-ARM_sp = (unsigned long)frame;
regs-ARM_lr = retcode;
regs-ARM_pc = handler;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] Consistently use xrealloc instead of realloc

2014-03-02 Thread David Gibson
On Mon, Mar 03, 2014 at 01:00:22AM +0100, Heinrich Schuchardt wrote:
 Note that in general dtc patches should be CCed to myself and Jon
 Loeliger j...@jdl.com, the dtc maintainers.
 
 
 This is the relevant section in file MAINTAINERS of Torvald's git.
 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS
 
 OPEN FIRMWARE AND FLATTENED DEVICE TREE
 M:  Grant Likely grant.lik...@linaro.org
 M:  Rob Herring robh...@kernel.org
 L:  devicet...@vger.kernel.org
 W:  http://fdt.secretlab.ca
 T:  git git://git.secretlab.ca/git/linux-2.6.git
 S:  Maintained
 F:  drivers/of/
 F:  include/linux/of*.h
 F:  scripts/dtc/
 K:  of_get_property
 K:  of_match_table
 
 If the information is not accurate, please, have it updated.

That's the maintainers information for the devicetree stuff included
in the Linux kernel tree, not for dtc as an upstream project.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgp3Aczhk82L3.pgp
Description: PGP signature


[PATCH 26/44] tracehook_signal_handler: Remove sig, info, ka and regs

2014-03-02 Thread Richard Weinberger
These parameters are nowhere used, so we can remove them.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 include/linux/tracehook.h | 8 +---
 kernel/signal.c   | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 1e98b55..c4877e3 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -133,10 +133,6 @@ static inline void tracehook_report_syscall_exit(struct 
pt_regs *regs, int step)
 
 /**
  * tracehook_signal_handler - signal handler setup is complete
- * @sig:   number of signal being delivered
- * @info:  siginfo_t of signal being delivered
- * @ka:sigaction setting that chose the handler
- * @regs:  user register state
  * @stepping:  nonzero if debugger single-step or block-step in use
  *
  * Called by the arch code after a signal handler has been set up.
@@ -146,9 +142,7 @@ static inline void tracehook_report_syscall_exit(struct 
pt_regs *regs, int step)
  * Called without locks, shortly before returning to user mode
  * (or handling more signals).
  */
-static inline void tracehook_signal_handler(int sig, siginfo_t *info,
-   const struct k_sigaction *ka,
-   struct pt_regs *regs, int stepping)
+static inline void tracehook_signal_handler(int stepping)
 {
if (stepping)
ptrace_notify(SIGTRAP);
diff --git a/kernel/signal.c b/kernel/signal.c
index bd649bd..b0a6256 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2403,7 +2403,7 @@ void signal_delivered(int sig, siginfo_t *info, struct 
k_sigaction *ka,
if (!(ka-sa.sa_flags  SA_NODEFER))
sigaddset(blocked, sig);
set_current_blocked(blocked);
-   tracehook_signal_handler(sig, info, ka, regs, stepping);
+   tracehook_signal_handler(stepping);
 }
 
 void signal_setup_done(int failed, struct ksignal *ksig, int stepping)
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


<    1   2   3   4   5   6   7   >