Commit 33c929c0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux

Pull device tree bug fixes from Grant Likely:
 "This branch contains the following bug fixes:
   - Fix locking vs. interrupts. Bug caught by lockdep checks
   - Fix parsing of cpp #line directive output by dtc
   - Fix 'make clean' for dtc temporary files.

  There is also a commit that regenerates the dtc lexer and parser files
  with Bison 2.5.  The only purpose of this commit is to separate the
  functional change in the dtc bug fix from the code generation change
  caused by a different Bison version"

* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
  dtc: ensure #line directives don't consume data from the next line
  dtc: Update generated files to output from Bison 2.5
  of: Fix locking vs. interrupts
  kbuild: make sure we clean up DTB temporary files
parents 25e33ed9 706b78f3
...@@ -54,6 +54,7 @@ EXPORT_SYMBOL(of_set_property_mutex); ...@@ -54,6 +54,7 @@ EXPORT_SYMBOL(of_set_property_mutex);
int of_set_property(struct device_node *dp, const char *name, void *val, int len) int of_set_property(struct device_node *dp, const char *name, void *val, int len)
{ {
struct property **prevp; struct property **prevp;
unsigned long flags;
void *new_val; void *new_val;
int err; int err;
...@@ -64,7 +65,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len ...@@ -64,7 +65,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
err = -ENODEV; err = -ENODEV;
mutex_lock(&of_set_property_mutex); mutex_lock(&of_set_property_mutex);
raw_spin_lock(&devtree_lock); raw_spin_lock_irqsave(&devtree_lock, flags);
prevp = &dp->properties; prevp = &dp->properties;
while (*prevp) { while (*prevp) {
struct property *prop = *prevp; struct property *prop = *prevp;
...@@ -91,7 +92,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len ...@@ -91,7 +92,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
} }
prevp = &(*prevp)->next; prevp = &(*prevp)->next;
} }
raw_spin_unlock(&devtree_lock); raw_spin_unlock_irqrestore(&devtree_lock, flags);
mutex_unlock(&of_set_property_mutex); mutex_unlock(&of_set_property_mutex);
/* XXX Upate procfs if necessary... */ /* XXX Upate procfs if necessary... */
......
...@@ -192,14 +192,15 @@ EXPORT_SYMBOL(of_find_property); ...@@ -192,14 +192,15 @@ EXPORT_SYMBOL(of_find_property);
struct device_node *of_find_all_nodes(struct device_node *prev) struct device_node *of_find_all_nodes(struct device_node *prev)
{ {
struct device_node *np; struct device_node *np;
unsigned long flags;
raw_spin_lock(&devtree_lock); raw_spin_lock_irqsave(&devtree_lock, flags);
np = prev ? prev->allnext : of_allnodes; np = prev ? prev->allnext : of_allnodes;
for (; np != NULL; np = np->allnext) for (; np != NULL; np = np->allnext)
if (of_node_get(np)) if (of_node_get(np))
break; break;
of_node_put(prev); of_node_put(prev);
raw_spin_unlock(&devtree_lock); raw_spin_unlock_irqrestore(&devtree_lock, flags);
return np; return np;
} }
EXPORT_SYMBOL(of_find_all_nodes); EXPORT_SYMBOL(of_find_all_nodes);
...@@ -421,8 +422,9 @@ struct device_node *of_get_next_available_child(const struct device_node *node, ...@@ -421,8 +422,9 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
struct device_node *prev) struct device_node *prev)
{ {
struct device_node *next; struct device_node *next;
unsigned long flags;
raw_spin_lock(&devtree_lock); raw_spin_lock_irqsave(&devtree_lock, flags);
next = prev ? prev->sibling : node->child; next = prev ? prev->sibling : node->child;
for (; next; next = next->sibling) { for (; next; next = next->sibling) {
if (!__of_device_is_available(next)) if (!__of_device_is_available(next))
...@@ -431,7 +433,7 @@ struct device_node *of_get_next_available_child(const struct device_node *node, ...@@ -431,7 +433,7 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
break; break;
} }
of_node_put(prev); of_node_put(prev);
raw_spin_unlock(&devtree_lock); raw_spin_unlock_irqrestore(&devtree_lock, flags);
return next; return next;
} }
EXPORT_SYMBOL(of_get_next_available_child); EXPORT_SYMBOL(of_get_next_available_child);
...@@ -735,13 +737,14 @@ EXPORT_SYMBOL_GPL(of_modalias_node); ...@@ -735,13 +737,14 @@ EXPORT_SYMBOL_GPL(of_modalias_node);
struct device_node *of_find_node_by_phandle(phandle handle) struct device_node *of_find_node_by_phandle(phandle handle)
{ {
struct device_node *np; struct device_node *np;
unsigned long flags;
raw_spin_lock(&devtree_lock); raw_spin_lock_irqsave(&devtree_lock, flags);
for (np = of_allnodes; np; np = np->allnext) for (np = of_allnodes; np; np = np->allnext)
if (np->phandle == handle) if (np->phandle == handle)
break; break;
of_node_get(np); of_node_get(np);
raw_spin_unlock(&devtree_lock); raw_spin_unlock_irqrestore(&devtree_lock, flags);
return np; return np;
} }
EXPORT_SYMBOL(of_find_node_by_phandle); EXPORT_SYMBOL(of_find_node_by_phandle);
......
...@@ -149,7 +149,7 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ ...@@ -149,7 +149,7 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
ld_flags = $(LDFLAGS) $(ldflags-y) ld_flags = $(LDFLAGS) $(ldflags-y)
dtc_cpp_flags = -Wp,-MD,$(depfile).pre -nostdinc \ dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \
-I$(srctree)/arch/$(SRCARCH)/boot/dts \ -I$(srctree)/arch/$(SRCARCH)/boot/dts \
-I$(srctree)/arch/$(SRCARCH)/boot/dts/include \ -I$(srctree)/arch/$(SRCARCH)/boot/dts/include \
-undef -D__DTS__ -undef -D__DTS__
...@@ -265,13 +265,13 @@ quiet_cmd_dtc = DTC $@ ...@@ -265,13 +265,13 @@ quiet_cmd_dtc = DTC $@
cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \ $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
-i $(dir $<) $(DTC_FLAGS) \ -i $(dir $<) $(DTC_FLAGS) \
-d $(depfile).dtc $(dtc-tmp) ; \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre $(depfile).dtc > $(depfile) cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
$(obj)/%.dtb: $(src)/%.dts FORCE $(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc) $(call if_changed_dep,dtc)
dtc-tmp = $(subst $(comma),_,$(dot-target).dts) dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
# Bzip2 # Bzip2
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
...@@ -71,7 +71,7 @@ static int pop_input_file(void); ...@@ -71,7 +71,7 @@ static int pop_input_file(void);
push_input_file(name); push_input_file(name);
} }
<*>^"#"(line)?{WS}+[0-9]+{WS}+{STRING}({WS}+[0-9]+)? { <*>^"#"(line)?[ \t]+[0-9]+[ \t]+{STRING}([ \t]+[0-9]+)? {
char *line, *tmp, *fn; char *line, *tmp, *fn;
/* skip text before line # */ /* skip text before line # */
line = yytext; line = yytext;
......
This diff is collapsed.
This diff is collapsed.
/* A Bison parser, made by GNU Bison 2.5. */
/* A Bison parser, made by GNU Bison 2.4.1. */ /* Bison interface for Yacc-like parsers in C
/* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -70,7 +68,7 @@ ...@@ -70,7 +68,7 @@
typedef union YYSTYPE typedef union YYSTYPE
{ {
/* Line 1676 of yacc.c */ /* Line 2068 of yacc.c */
#line 40 "dtc-parser.y" #line 40 "dtc-parser.y"
char *propnodename; char *propnodename;
...@@ -94,8 +92,8 @@ typedef union YYSTYPE ...@@ -94,8 +92,8 @@ typedef union YYSTYPE
/* Line 1676 of yacc.c */ /* Line 2068 of yacc.c */
#line 99 "dtc-parser.tab.h" #line 97 "dtc-parser.tab.h"
} YYSTYPE; } YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment