Re: [RFC][PATCHSET] non-recursive pathname resolution
On Wed, May 06, 2015 at 12:59:47AM +0100, Al Viro wrote: > It is passing xfstests and LTP, plus some basic "create a twisted forest > of symlinks and walk it" tests, but yes, it obviously needs more beating. > I'll push everything up to #76 into -next tonight (with the changes you > asked for). [snip] > AFAICS, the above should suffice, modulo teaching ->follow_link() instances > to fail with ECHILD when called in RCU mode and then teaching some of them > _not_ to. Note that fast symlinks would be fine without the last part and > that covers most of the actual use... FWIW, right now vfs.git#link_path_walk seems to be working and doing just that - there's still some reordering to do in the new parts of queue, and right now it's dropping out of RCU mode as soon as it runs into a non-trivial symlink (== not a fast one), but the common case is handled without dropping out of RCU mode until the very end. I'll do reordering tomorrow (along with adding the missing documentation, etc.) and post the result for review, then into -next it goes... Right now it's 107 commits on top of what already went into mainline (1 from dhowells, 6 from neilb, the rest from me), so it's going to be another patchbomb from hell ;-/ Missing bits: teaching ->follow_link() to try and remain in RCU mode (IMO it should be getting (dentry, inode, ) and have RCU mode indicated by dentry == NULL), figuring out what to do with automounts (I really think that ->d_automount() is worth offloading via schedule_work() or something similar) and more testing/profiling/tuning the inlining/etc. -- 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 1/3] perf probe: Remove length limitation for showing available variables
On 2015/05/09 18:55, He Kuang wrote: > Use struct strbuf instead of bare char[] to remove the length limitation > of variables in variable_list, so they will not disappear due to > overlength, and make preparation for adding more description for > variables. > Looks good to me! Acked-by: Masami Hiramatsu Thank you, > Signed-off-by: He Kuang > --- > tools/perf/util/dwarf-aux.c| 50 > +++--- > tools/perf/util/dwarf-aux.h| 4 ++-- > tools/perf/util/probe-finder.c | 17 -- > 3 files changed, 34 insertions(+), 37 deletions(-) > > diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c > index 16d46e2..737c9db 100644 > --- a/tools/perf/util/dwarf-aux.c > +++ b/tools/perf/util/dwarf-aux.c > @@ -848,19 +848,17 @@ Dwarf_Die *die_find_member(Dwarf_Die *st_die, const > char *name, > /** > * die_get_typename - Get the name of given variable DIE > * @vr_die: a variable DIE > - * @buf: a buffer for result type name > - * @len: a max-length of @buf > + * @buf: a strbuf for result type name > * > - * Get the name of @vr_die and stores it to @buf. Return the actual length > - * of type name if succeeded. Return -E2BIG if @len is not enough long, and > - * Return -ENOENT if failed to find type name. > + * Get the name of @vr_die and stores it to @buf. Return 0 if succeeded. > + * and Return -ENOENT if failed to find type name. > * Note that the result will stores typedef name if possible, and stores > * "*(function_type)" if the type is a function pointer. > */ > -int die_get_typename(Dwarf_Die *vr_die, char *buf, int len) > +int die_get_typename(Dwarf_Die *vr_die, struct strbuf *buf) > { > Dwarf_Die type; > - int tag, ret, ret2; > + int tag, ret; > const char *tmp = ""; > > if (__die_get_real_type(vr_die, ) == NULL) > @@ -871,8 +869,8 @@ int die_get_typename(Dwarf_Die *vr_die, char *buf, int > len) > tmp = "*"; > else if (tag == DW_TAG_subroutine_type) { > /* Function pointer */ > - ret = snprintf(buf, len, "(function_type)"); > - return (ret >= len) ? -E2BIG : ret; > + strbuf_addf(buf, "(function_type)"); > + return 0; > } else { > if (!dwarf_diename()) > return -ENOENT; > @@ -883,39 +881,35 @@ int die_get_typename(Dwarf_Die *vr_die, char *buf, int > len) > else if (tag == DW_TAG_enumeration_type) > tmp = "enum "; > /* Write a base name */ > - ret = snprintf(buf, len, "%s%s", tmp, dwarf_diename()); > - return (ret >= len) ? -E2BIG : ret; > - } > - ret = die_get_typename(, buf, len); > - if (ret > 0) { > - ret2 = snprintf(buf + ret, len - ret, "%s", tmp); > - ret = (ret2 >= len - ret) ? -E2BIG : ret2 + ret; > + strbuf_addf(buf, "%s%s", tmp, dwarf_diename()); > + return 0; > } > + ret = die_get_typename(, buf); > + if (ret == 0) > + strbuf_addf(buf, "%s", tmp); > + > return ret; > } > > /** > * die_get_varname - Get the name and type of given variable DIE > * @vr_die: a variable DIE > - * @buf: a buffer for type and variable name > - * @len: the max-length of @buf > + * @buf: a strbuf for type and variable name > * > * Get the name and type of @vr_die and stores it in @buf as "type\tname". > */ > -int die_get_varname(Dwarf_Die *vr_die, char *buf, int len) > +int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf) > { > - int ret, ret2; > + int ret; > > - ret = die_get_typename(vr_die, buf, len); > + ret = die_get_typename(vr_die, buf); > if (ret < 0) { > pr_debug("Failed to get type, make it unknown.\n"); > - ret = snprintf(buf, len, "(unknown_type)"); > - } > - if (ret > 0) { > - ret2 = snprintf(buf + ret, len - ret, "\t%s", > - dwarf_diename(vr_die)); > - ret = (ret2 >= len - ret) ? -E2BIG : ret2 + ret; > + strbuf_addf(buf, "(unknown_type)"); > } > - return ret; > + > + strbuf_addf(buf, "\t%s", dwarf_diename(vr_die)); > + > + return 0; > } > > diff --git a/tools/perf/util/dwarf-aux.h b/tools/perf/util/dwarf-aux.h > index 50a3cdc..60676fd 100644 > --- a/tools/perf/util/dwarf-aux.h > +++ b/tools/perf/util/dwarf-aux.h > @@ -117,8 +117,8 @@ extern Dwarf_Die *die_find_member(Dwarf_Die *st_die, > const char *name, > Dwarf_Die *die_mem); > > /* Get the name of given variable DIE */ > -extern int die_get_typename(Dwarf_Die *vr_die, char *buf, int len); > +extern int die_get_typename(Dwarf_Die *vr_die, struct strbuf *buf); > > /* Get the name and type of given variable DIE, stored as "type\tname" */ > -extern int die_get_varname(Dwarf_Die *vr_die, char *buf, int len); > +extern int die_get_varname(Dwarf_Die *vr_die, struct
Re: [PATCH v2 3/3] perf probe: Show better error message when failed to find variable
On 2015/05/09 18:55, He Kuang wrote: > Indicate to check variable location range in error message when we got > failed to find the variable. > > Before this patch: > > $ perf probe --add 'generic_perform_write+118 bytes' > Failed to find the location of bytes at this address. >Perhaps, it has been optimized out. > Error: Failed to add events. > > After this patch: > $ perf probe --add 'generic_perform_write+118 bytes' > Failed to find the location of bytes at this address. >Perhaps, it has been optimized out. >Use -V with --range option to show variable location range. > Error: Failed to add events. OK, this helps users :) Acked-by: Masami Hiramatsu Thank you, > > Signed-off-by: He Kuang > --- > tools/perf/util/probe-finder.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c > index 30a1a1b..2b91323 100644 > --- a/tools/perf/util/probe-finder.c > +++ b/tools/perf/util/probe-finder.c > @@ -532,7 +532,9 @@ static int convert_variable(Dwarf_Die *vr_die, struct > probe_finder *pf) > >sp_die, pf->tvar); > if (ret == -ENOENT || ret == -EINVAL) > pr_err("Failed to find the location of %s at this address.\n" > -" Perhaps, it has been optimized out.\n", pf->pvar->var); > +" Perhaps, it has been optimized out.\n" > +" Use -V with --range option to show variable location > range.\n", > +pf->pvar->var); > else if (ret == -ENOTSUP) > pr_err("Sorry, we don't support this variable location yet.\n"); > else if (ret == 0 && pf->pvar->field) { > -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu...@hitachi.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 v2 2/3] perf probe: Add --range option to show variable location range
On 2015/05/09 18:55, He Kuang wrote: > It is not easy for users to get the accurate byte offset or the line > number where a local variable can be probed. With '--range' option, > local variables in scope of the probe point are showed with byte offset > range, and can be added according to this range information. > > For example, there are some variables in function > generic_perform_write(): > > > 0 ssize_t generic_perform_write(struct file *file, > 1 struct iov_iter *i, loff_t pos) > 2 { > 3 struct address_space *mapping = file->f_mapping; > 4 const struct address_space_operations *a_ops = mapping->a_ops; > ... > 42 status = a_ops->write_begin(file, mapping, pos, bytes, > flags, >, ); > 44 if (unlikely(status < 0)) > > But we got failed when we try to probe the variable 'a_ops' at line 42 > or 44. > > $ perf probe --add 'generic_perform_write:42 a_ops' > Failed to find the location of a_ops at this address. > Perhaps, it has been optimized out. > > This is because source code do not match assembly, so a variable may not > be available in the sourcecode line where it presents. After this patch, > we can lookup the accurate byte offset range of a variable, 'INV' > indicates that this variable is not valid at the given point, but > available in scope: > > $ perf probe --vars 'generic_perform_write:42' --range > Available variables at generic_perform_write:42 > @ > [INV] ssize_t written @ > [INV] struct address_space_operations*a_ops > @ > [VAL] (unknown_type) fsdata > @ > [VAL] loff_t pos > @ > [VAL] long intstatus > @ > [VAL] long unsigned int bytes > @ > [VAL] struct address_space* mapping > @ > [VAL] struct iov_iter*i > @ > [VAL] struct page*page > @ > Thanks, this looks easier to understand :) [...] > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c > index dcca551..30a1a1b 100644 > --- a/tools/perf/util/probe-finder.c > +++ b/tools/perf/util/probe-finder.c > @@ -43,6 +43,9 @@ > /* Kprobe tracer basic type is up to u64 */ > #define MAX_BASIC_TYPE_BITS 64 > > +/* Variable location invalid at addr but valid in scope */ > +#define VARIABLE_LOCATION_INVALID_AT_ADDR-1 Hmm, could you use -ERANGE instead of this? Other part is OK for me. Thank you! > + > /* Dwarf FL wrappers */ > static char *debuginfo_path; /* Currently dummy */ > > @@ -177,7 +180,7 @@ static int convert_variable_location(Dwarf_Die *vr_die, > Dwarf_Addr addr, > Dwarf_Word offs = 0; > bool ref = false; > const char *regs; > - int ret; > + int ret, ret2 = 0; > > if (dwarf_attr(vr_die, DW_AT_external, ) != NULL) > goto static_var; > @@ -187,9 +190,19 @@ static int convert_variable_location(Dwarf_Die *vr_die, > Dwarf_Addr addr, > return -EINVAL; /* Broken DIE ? */ > if (dwarf_getlocation_addr(, addr, , , 1) <= 0) { > ret = dwarf_entrypc(sp_die, ); > - if (ret || addr != tmp || > - dwarf_tag(vr_die) != DW_TAG_formal_parameter || > - dwarf_highpc(sp_die, )) > + if (ret) > + return -ENOENT; > + > + if (probe_conf.show_location_range && > + (dwarf_tag(vr_die) == DW_TAG_variable)) { > + ret2 = VARIABLE_LOCATION_INVALID_AT_ADDR; > + } else if (addr != tmp || > + dwarf_tag(vr_die) != DW_TAG_formal_parameter) { > + return -ENOENT; > + } > + > + ret = dwarf_highpc(sp_die, ); > + if (ret) > return -ENOENT; > /* >* This is fuzzed by fentry mcount. We try to find the > @@ -210,7 +223,7 @@ found: > if (op->atom == DW_OP_addr) { > static_var: > if (!tvar) > - return 0; > + return ret2; > /* Static variables on memory (not stack), make @varname */ > ret = strlen(dwarf_diename(vr_die)); > tvar->value = zalloc(ret + 2); > @@ -220,7 +233,7 @@ static_var: > tvar->ref = alloc_trace_arg_ref((long)offs); > if (tvar->ref == NULL) > return -ENOMEM; > - return 0; > + return ret2; > } > > /* If this is based on frame buffer, set the offset */ > @@ -250,7 +263,7 @@ static_var: > } > > if (!tvar) > - return 0; > + return ret2; > > regs = get_arch_regstr(regn); > if (!regs) { > @@ -269,7 +282,7 @@ static_var: > if (tvar->ref ==
Re: Re: [PATCH perf/core v2 0/4] perf-probe code cleanup and support wildcard for probe points
On 2015/05/09 4:38, Arnaldo Carvalho de Melo wrote: > Em Fri, May 08, 2015 at 10:03:26AM +0900, Masami Hiramatsu escreveu: >> Hi, >> >> Here is a patches for wild card support. I've added two patches to >> reduce API parameters by introducing probe_conf. This simplifies >> --no-inlines option. (Thanks Arnaldo!) >> >> Changes from v1: >> - Update for the latest perf/core >> - Use perf_probe_event.target instead of passing it as an independent >>parameter [1/4] >> - Introduce probe_conf for configuring parameters of probe-finder and >>probe-event [2/4] >> >> Thank you, >> >> --- >> >> Masami Hiramatsu (4): >> perf probe: Use perf_probe_event.target instead of passing as an >> argument >> perf probe: Introduce probe_conf global configs >> perf-probe: Add --no-inlines option to avoid searching inline functions >> perf-probe: Support glob wildcards for function name > > Excellent stuff! Thanks, all tested. Thank you for this good example! :) Using this with perf-trace is certainly nice usage. Thank you! > > And here is the example I used to test it plus other goodies: > > System wide syscall tracing + kmalloc* kernel functions with its parameters, > filtering the pid of the sshd session to the test machine, to avoid a feedback > loop: > > [root@ssdandy ~]# perf probe --no-inlines --add 'kmalloc* $params' > Added new events: > probe:kmalloc_order (on kmalloc* with $params) > probe:kmalloc_order_trace (on kmalloc* with $params) > probe:kmalloc_slab (on kmalloc* with $params) > probe:kmalloc_large_node (on kmalloc* with $params) > > You can now use it in all perf tools, such as: > > perf record -e probe:kmalloc_large_node -aR sleep 1 > > [root@ssdandy ~]# perf trace --ev probe:kmalloc* --filter-pids 27206 > 0.000 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) > 0.010 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) > 0.343 ( ): probe:kmalloc_slab:(81198ab0) size=0x98 > flags=0x10) > 73.254 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) > 73.259 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) > 89.510 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >192.295 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >205.520 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >205.524 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >260.034 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >260.039 ( ): probe:kmalloc_slab:(81198ab0) size=0x300 > flags=0x10220) >307.779 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >307.784 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >362.450 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >362.455 ( ): probe:kmalloc_slab:(81198ab0) size=0x300 > flags=0x10220) >380.507 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >380.511 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >409.663 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >409.668 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >464.868 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >464.874 ( ): probe:kmalloc_slab:(81198ab0) size=0x300 > flags=0x10220) >499.303 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >512.083 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >512.088 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >585.349 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >585.354 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >614.513 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >614.518 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >669.706 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >669.710 ( ): probe:kmalloc_slab:(81198ab0) size=0x300 > flags=0x10220) >716.927 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >716.932 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >790.181 ( ): probe:kmalloc_slab:(81198ab0) size=0x1c0 > flags=0x10220) >790.185 ( ): probe:kmalloc_slab:(81198ab0) size=0x2c0 > flags=0x10220) >818.857 ( 0.000 ms): tuned/837 ...
Re: [PATCH 3/3] perf probe: Add --range option to show variable location range
On 2015/05/09 16:41, He Kuang wrote: > > On 2015/5/8 22:08, Masami Hiramatsu wrote: >> On 2015/05/08 21:23, He Kuang wrote: >>> It is not easy for users to get the accurate byte offset or the line >>> number where a local variable can be probed. With '--range' option, >>> local variables in scope of the probe point are showed with byte offset >>> range, and can be added according to this range information. >> Interesting idea :) >> >>> For example, there are some variables in function >>> generic_perform_write(): >>> >>> >>>0 ssize_t generic_perform_write(struct file *file, >>>1 struct iov_iter *i, loff_t pos) >>>2 { >>>3 struct address_space *mapping = file->f_mapping; >>>4 const struct address_space_operations *a_ops = mapping->a_ops; >>>... >>>42 status = a_ops->write_begin(file, mapping, pos, >>> bytes, flags, >>> , ); >>>44 if (unlikely(status < 0)) >>> >>> But we got failed when we try to probe the variable 'a_ops' at line 42 >>> or 44. >>> >>>$ perf probe --add 'generic_perform_write:42 a_ops' >>>Failed to find the location of a_ops at this address. >>> Perhaps, it has been optimized out. >> Yeah, right. That's why I've introduced --vars option. >> >>> This is because source code do not match assembly, so a variable may not >>> be available in the sourcecode line where it presents. After this patch, >>> we can lookup the accurate byte offset range of a variable, 'INV' >>> indicates that this variable is not valid at the given point, but >>> available in scope: >>> >>>$ perf probe --vars 'generic_perform_write:42' --range >>>Available variables at generic_perform_write:42 >>> @ >>> [INV] ssize_t written [byte offset]: <324-331> >>> [INV] struct address_space_operations*a_ops >>> [byte offset]: <55-61>,<170-176>,<223-246> >>> [VAL] (unknown_type) fsdata [byte offset]: >>> <70-307>,<346-411> >>> [VAL] loff_t pos [byte offset]: >>> <0-286>,<286-336>,<346-411> >>> [VAL] long intstatus [byte offset]: >>> <83-342>,<346-411> >>> [VAL] long unsigned int bytes [byte offset]: >>> <122-311>,<320-338>,<346-403>,<403-411> >>> [VAL] struct address_space* mapping [byte offset]: >>> <35-344>,<346-411> >>> [VAL] struct iov_iter*i [byte offset]: >>> <0-340>,<346-411> >>> [VAL] struct page*page[byte offset]: >>> <70-307>,<346-411> >> OK, at first, I don't like frequently repeated "[byte offset]", I prefer to >> show the function name+[offset range], like below :) >> >> [INV] ssize_t written @ >> [INV] struct address_space_operations*a_ops >> <@generic_perform_write+[55-61,170-176,223-246]> > > OK. > >> >> By the way, 'generic_perform_write+170' may be different from >> given line, is that OK? > > I think the prefix '[INV]' indicates that difference. > > Before this patch, we should reference objdump, dwarf-info, then > dwarf-loc to find the valid range of a variable. Sometimes we > want to view more than one variables by adding one probe event, > to find a place two or more variables all valid is difficult. Yes, I think this looks good idea to trace variables :) > > This patch gives an overview of the valid ranges of variables in > scope, in most case, if we just want to find a place to probe > variables, the location range result is just enough. And we can > use the result offset to locate the assembly code of the accurate > meaning of a variable from objdump easily. OK, but please note that the optimizer sometimes arranges code sequence different from the source code. So I recommend to ensure the address is actually where you imagine, by using perf probe -l :) Thank you, -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu...@hitachi.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 v2] ARM: net: add JIT support for loads from struct seccomp_data.
From: Nicolas Schichan Date: Thu, 7 May 2015 15:00:13 +0200 > Signed-off-by: Nicolas Schichan > --- > > This patch was first sent as part of a serie modifying the core > seccomp code to allow the use of the classic BPF JIT. As the core > changes have been submitted to netdev by Daniel Borkmann, it is now > time to re-submit this patch separately. > > While not physically dependent of the core seccomp changes they are > needed for the code added in this patch to be triggered. Where would you like this to be applied, my tree? This is an ongoing situation, where people have traditionally not consistently wanted bpf JIT patches to go into the networking tree. So I beg everyone posting such things to netdev to be _clear_ and _explicit_ about whether you expect me to integrate the patch or not. Thanks. -- 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] net: deinline netif_tx_stop_queue() and netif_tx_stop_all_queues()
From: Denys Vlasenko Date: Thu, 7 May 2015 13:41:10 +0200 > These functions compile to ~60 bytes of machine code each. As others have suggested, just kill the WARN_ON(). -- 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: rename eisa_set_level_irq to elcr_set_level_irq
On Sat, 9 May 2015, Paul Gortmaker wrote: > This routine has been around for over a decade, but with EISA > being dead and abandoned for about twice that long, the name can > be kind of confusing. The function is going at the PIC Edge/Level > Configuration Registers (ELCR), so rename it as such and mentally > decouple it from the long since dead EISA bus. > > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: x...@kernel.org > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: Pavel Machek > Cc: Bjorn Helgaas > Signed-off-by: Paul Gortmaker > --- > > [This was in the "delete EISA bus supoort for x86" series, but since > we aren't going to apply that, we might as well steal this from it.] Reviewed-by: Maciej W. Rozycki FWIW it looks good to me, thanks. Especially for reusing the good parts of your original change. :) While cleaning this stuff up you might as well consider getting rid of the embedded numeric 0x4d0 port reference too and adding macros like PIC_MASTER_ELCR and PIC_SLAVE_ELCR to to use them... > diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c > index 5dc6ca5e1741..9bd115484745 100644 > --- a/arch/x86/pci/irq.c > +++ b/arch/x86/pci/irq.c > @@ -146,19 +146,20 @@ static void __init pirq_peer_trick(void) > > /* > * Code for querying and setting of IRQ routes on various interrupt routers. > + * PIC Edge/Level Control Registers (ELCR) 0x4d0 & 0x4d1. > */ > > -void eisa_set_level_irq(unsigned int irq) > +void elcr_set_level_irq(unsigned int irq) > { > unsigned char mask = 1 << (irq & 7); > unsigned int port = 0x4d0 + (irq >> 3); ... here, and a bunch of places elsewhere. Your change is of course good as it stands though, that would have to be a separate clean-up anyway. Maciej -- 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] net: fec: add support of ethtool get_regs
From: Philippe Reynes Date: Sun, 10 May 2015 00:16:21 +0200 > Hi Fabio, > > On 09/05/15 23:59, Fabio Estevam wrote: >> Philippe, >> >> On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux >> wrote: >> >>> Using memcpy_fromio() to copy device registers is not a good idea - >>> it can use a variable access size which can cause bus faults. >> >> An example on how memcpy_fromio() can be avoided in get_regs: >> drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c > > Thanks for pointing me this example. I've already send a patch, > and I've used drivers/net/ethernet/freescale/gianfar_ethtool.c > as example. I hope it's a good example too. I think you need to be much more careful and conservative in your implementation. You should skip I/O addresses that don't have defined registers at those offsets for the chip in question. Also, you should _very_ carefully evaluate each and every register you dump and potentially skip certain registers which have strong negative side effects if read arbitrarily. For example, dumping the interrupt status register could cause pending interrupt status to be cleared, and thus cause the driver to lose interrupts and subsequently packet processing will hang. -- 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:hello
hello buone notizie per voi Portatile, macchina fotografica, cellulare, moto , la spedizione è gratuita samsung s6, 320euro w e b: swewaoo . com N�r��yb�X��ǧv�^�){.n�+{zX����ܨ}���Ơz�:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf��^jǫy�m��@A�a��� 0��h���i
[PATCH] x86: rename eisa_set_level_irq to elcr_set_level_irq
This routine has been around for over a decade, but with EISA being dead and abandoned for about twice that long, the name can be kind of confusing. The function is going at the PIC Edge/Level Configuration Registers (ELCR), so rename it as such and mentally decouple it from the long since dead EISA bus. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x...@kernel.org Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Machek Cc: Bjorn Helgaas Signed-off-by: Paul Gortmaker --- [This was in the "delete EISA bus supoort for x86" series, but since we aren't going to apply that, we might as well steal this from it.] arch/x86/include/asm/hw_irq.h | 3 +-- arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/pci/irq.c| 13 +++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 1f88e719fa78..b58bc1d8bfa6 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h @@ -191,8 +191,7 @@ static inline void unlock_vector_lock(void) {} extern atomic_t irq_err_count; extern atomic_t irq_mis_count; -/* EISA */ -extern void eisa_set_level_irq(unsigned int irq); +extern void elcr_set_level_irq(unsigned int irq); /* SMP */ extern __visible void smp_apic_timer_interrupt(struct pt_regs *); diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 271293ad89d7..e49ee24da85e 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -608,7 +608,7 @@ static int acpi_register_gsi_pic(struct device *dev, u32 gsi, * Make sure all (legacy) PCI IRQs are set as level-triggered. */ if (trigger == ACPI_LEVEL_SENSITIVE) - eisa_set_level_irq(gsi); + elcr_set_level_irq(gsi); #endif return gsi; diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index 5dc6ca5e1741..9bd115484745 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c @@ -146,19 +146,20 @@ static void __init pirq_peer_trick(void) /* * Code for querying and setting of IRQ routes on various interrupt routers. + * PIC Edge/Level Control Registers (ELCR) 0x4d0 & 0x4d1. */ -void eisa_set_level_irq(unsigned int irq) +void elcr_set_level_irq(unsigned int irq) { unsigned char mask = 1 << (irq & 7); unsigned int port = 0x4d0 + (irq >> 3); unsigned char val; - static u16 eisa_irq_mask; + static u16 elcr_irq_mask; - if (irq >= 16 || (1 << irq) & eisa_irq_mask) + if (irq >= 16 || (1 << irq) & elcr_irq_mask) return; - eisa_irq_mask |= (1 << irq); + elcr_irq_mask |= (1 << irq); printk(KERN_DEBUG "PCI: setting IRQ %u as level-triggered\n", irq); val = inb(port); if (!(val & mask)) { @@ -965,11 +966,11 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { msg = "found"; - eisa_set_level_irq(irq); + elcr_set_level_irq(irq); } else if (newirq && r->set && (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { if (r->set(pirq_router_dev, dev, pirq, newirq)) { - eisa_set_level_irq(newirq); + elcr_set_level_irq(newirq); msg = "assigned"; irq = newirq; } -- 2.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/
Re: [Linux-nvdimm] [PATCH v2 08/20] libnd, nd_acpi: regions (block-data-window, persistent memory, volatile memory)
On Mon, May 4, 2015 at 1:26 PM, Toshi Kani wrote: > On Tue, 2015-04-28 at 14:24 -0400, Dan Williams wrote: > : >> + >> +static int nd_acpi_register_region(struct acpi_nfit_desc *acpi_desc, >> + struct nfit_spa *nfit_spa) >> +{ >> + static struct nd_mapping nd_mappings[ND_MAX_MAPPINGS]; >> + struct acpi_nfit_spa *spa = nfit_spa->spa; >> + struct nfit_memdev *nfit_memdev; >> + struct nd_region_desc ndr_desc; >> + int spa_type, count = 0; >> + struct resource res; >> + u16 spa_index; >> + >> + spa_type = nfit_spa_type(spa); >> + spa_index = spa->spa_index; >> + if (spa_index == 0) { >> + dev_dbg(acpi_desc->dev, "%s: detected invalid spa index\n", >> + __func__); >> + return 0; >> + } >> + >> + memset(, 0, sizeof(res)); >> + memset(_mappings, 0, sizeof(nd_mappings)); >> + memset(_desc, 0, sizeof(ndr_desc)); >> + res.start = spa->spa_base; >> + res.end = res.start + spa->spa_length - 1; >> + ndr_desc.res = >> + ndr_desc.provider_data = nfit_spa; >> + ndr_desc.attr_groups = nd_acpi_region_attribute_groups; >> + list_for_each_entry(nfit_memdev, _desc->memdevs, list) { >> + struct acpi_nfit_memdev *memdev = nfit_memdev->memdev; >> + struct nd_mapping *nd_mapping; >> + struct nd_dimm *nd_dimm; >> + >> + if (memdev->spa_index != spa_index) >> + continue; > > The libnd does not support memdev->flags, which contains "Memory Device > State Flags" defined in Table 5-129 of ACPI 6.0. In case of major > errors, we should only allow a failed NVDIMM be accessed with read-only > for possible data recovery (or not allow any access when the data is > completely lost), and should not let users operate normally over the > corrupted data until the error is dealt properly. I agree with setting read-only access when these flags show that the battery is not ready to persist new writes, but I don't think we should block access in the case where the restore from flash failed. If the data is potentially corrupted we should log that fact, but otherwise enable access. I.e. potentially corrupt data is better than unavailable data. It's up to filesystem or application to maintain its own checksums to catch data corruption. > Can you set memdev->flags to nd_region(_desc) so that the pmem driver > can check the status in nd_pmem_probe()? nd_pmem_probe() can then set > the disk read-only or fail probing, and log errors accordingly. Will do. -- 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: Fix mkcapflags.sh bash-ism again
On Mon, Apr 27, 2015 at 03:21:02PM +, sylvain.bertr...@gmail.com wrote: > While compiling linux, dash shell reports a bash-ism: > > /src/linux-4.0/arch/x86/kernel/cpu/mkcapflags.sh: 9: > /src/linux-4.0/arch/x86/kernel/cpu/mkcapflags.sh: Syntax error: "(" unexpected > > See: > http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_05 > > Cc: Ingo Molnar > Signed-off-by: Sylvain BERTRAND > --- > Forgot that fix: > --- a/arch/x86/kernel/cpu/mkcapflags.sh > +++ b/arch/x86/kernel/cpu/mkcapflags.sh > @@ -6,7 +6,7 @@ > IN=$1 > OUT=$2 > > -function dump_array() > +dump_array() > { > ARRAY=$1 > SIZE=$2 What's up with this patch? regards, -- Sylvain -- 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/
[Resend][PATCH] PM / tick: Add tracepoints for suspend-to-idle diagnostics
From: Rafael J. Wysocki Add suspend/resume tracepoints to tick_freeze() and tick_unfreeze() to catch when timekeeping is suspended and resumed during suspend-to-idle so as to be able to check whether or not we enter the "frozen" state and to measure the time spent in it. Signed-off-by: Rafael J. Wysocki --- Sorry for the duplication, but I messed up the Thomas' address in the previous one. --- kernel/time/tick-common.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) Index: linux-pm/kernel/time/tick-common.c === --- linux-pm.orig/kernel/time/tick-common.c +++ linux-pm/kernel/time/tick-common.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -457,10 +458,13 @@ void tick_freeze(void) raw_spin_lock(_freeze_lock); tick_freeze_depth++; - if (tick_freeze_depth == num_online_cpus()) + if (tick_freeze_depth == num_online_cpus()) { + trace_suspend_resume(TPS("timekeeping_freeze"), +smp_processor_id(), true); timekeeping_suspend(); - else + } else { tick_suspend_local(); + } raw_spin_unlock(_freeze_lock); } @@ -478,10 +482,13 @@ void tick_unfreeze(void) { raw_spin_lock(_freeze_lock); - if (tick_freeze_depth == num_online_cpus()) + if (tick_freeze_depth == num_online_cpus()) { timekeeping_resume(); - else + trace_suspend_resume(TPS("timekeeping_freeze"), +smp_processor_id(), false); + } else { tick_resume_local(); + } tick_freeze_depth--; -- 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] sched / idle: Call default_idle_call() from cpuidle_enter_state()
From: Rafael J. Wysocki The check of the cpuidle_enter() return value against -EBUSY made in call_cpuidle() will not be necessary any more if cpuidle_enter_state() calls default_idle_call() directly when it is about to return -EBUSY, so make that happen and eliminate the check. Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/cpuidle.c |4 +++- include/linux/cpuidle.h |1 + kernel/sched/idle.c | 20 +++- 3 files changed, 11 insertions(+), 14 deletions(-) Index: linux-pm/drivers/cpuidle/cpuidle.c === --- linux-pm.orig/drivers/cpuidle/cpuidle.c +++ linux-pm/drivers/cpuidle/cpuidle.c @@ -167,8 +167,10 @@ int cpuidle_enter_state(struct cpuidle_d * local timer will be shut down. If a local timer is used from another * CPU as a broadcast timer, this call may fail if it is not available. */ - if (broadcast && tick_broadcast_enter()) + if (broadcast && tick_broadcast_enter()) { + default_idle_call(); return -EBUSY; + } /* Take note of the planned idle state. */ sched_idle_set_state(target_state); Index: linux-pm/kernel/sched/idle.c === --- linux-pm.orig/kernel/sched/idle.c +++ linux-pm/kernel/sched/idle.c @@ -76,12 +76,13 @@ void __weak arch_cpu_idle(void) local_irq_enable(); } -static void default_idle_call(void) +/** + * default_idle_call - Default CPU idle routine. + * + * To use when the cpuidle framework cannot be used. + */ +void default_idle_call(void) { - /* -* We can't use the cpuidle framework, let's use the default idle -* routine. -*/ if (current_clr_polling_and_test()) local_irq_enable(); else @@ -91,8 +92,6 @@ static void default_idle_call(void) static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev, int next_state) { - int entered_state; - /* Fall back to the default arch idle method on errors. */ if (next_state < 0) { default_idle_call(); @@ -114,12 +113,7 @@ static int call_cpuidle(struct cpuidle_d * This function will block until an interrupt occurs and will take * care of re-enabling the local interrupts */ - entered_state = cpuidle_enter(drv, dev, next_state); - - if (entered_state == -EBUSY) - default_idle_call(); - - return entered_state; + return cpuidle_enter(drv, dev, next_state); } /** Index: linux-pm/include/linux/cpuidle.h === --- linux-pm.orig/include/linux/cpuidle.h +++ linux-pm/include/linux/cpuidle.h @@ -202,6 +202,7 @@ static inline struct cpuidle_driver *cpu /* kernel/sched/idle.c */ extern void sched_idle_set_state(struct cpuidle_state *idle_state); +extern void default_idle_call(void); #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a); -- 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] sched / idle: Call idle_set_state() from cpuidle_enter_state()
From: Rafael J. Wysocki Introduce a wrapper function around idle_set_state() called sched_idle_set_state() that will pass this_rq() to it as the first argument and make cpuidle_enter_state() call the new function before and after entering the target state. At the same time, remove direct invocations of idle_set_state() from call_cpuidle(). This will allow the invocation of default_idle_call() to be moved from call_cpuidle() to cpuidle_enter_state() safely and call_cpuidle() to be simplified a bit as a result. Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/cpuidle.c |6 ++ include/linux/cpuidle.h |3 +++ kernel/sched/idle.c | 15 +-- 3 files changed, 18 insertions(+), 6 deletions(-) Index: linux-pm/kernel/sched/idle.c === --- linux-pm.orig/kernel/sched/idle.c +++ linux-pm/kernel/sched/idle.c @@ -15,6 +15,15 @@ #include "sched.h" +/** + * sched_idle_set_state - Record idle state for the current CPU. + * @idle_state: State to record. + */ +void sched_idle_set_state(struct cpuidle_state *idle_state) +{ + idle_set_state(this_rq(), idle_state); +} + static int __read_mostly cpu_idle_force_poll; void cpu_idle_poll_ctrl(bool enable) @@ -100,9 +109,6 @@ static int call_cpuidle(struct cpuidle_d return -EBUSY; } - /* Take note of the planned idle state. */ - idle_set_state(this_rq(), >states[next_state]); - /* * Enter the idle state previously returned by the governor decision. * This function will block until an interrupt occurs and will take @@ -110,9 +116,6 @@ static int call_cpuidle(struct cpuidle_d */ entered_state = cpuidle_enter(drv, dev, next_state); - /* The cpu is no longer idle or about to enter idle. */ - idle_set_state(this_rq(), NULL); - if (entered_state == -EBUSY) default_idle_call(); Index: linux-pm/drivers/cpuidle/cpuidle.c === --- linux-pm.orig/drivers/cpuidle/cpuidle.c +++ linux-pm/drivers/cpuidle/cpuidle.c @@ -170,6 +170,9 @@ int cpuidle_enter_state(struct cpuidle_d if (broadcast && tick_broadcast_enter()) return -EBUSY; + /* Take note of the planned idle state. */ + sched_idle_set_state(target_state); + trace_cpu_idle_rcuidle(index, dev->cpu); time_start = ktime_get(); @@ -178,6 +181,9 @@ int cpuidle_enter_state(struct cpuidle_d time_end = ktime_get(); trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); + /* The cpu is no longer idle or about to enter idle. */ + sched_idle_set_state(NULL); + if (broadcast) { if (WARN_ON_ONCE(!irqs_disabled())) local_irq_disable(); Index: linux-pm/include/linux/cpuidle.h === --- linux-pm.orig/include/linux/cpuidle.h +++ linux-pm/include/linux/cpuidle.h @@ -200,6 +200,9 @@ static inline struct cpuidle_driver *cpu struct cpuidle_device *dev) {return NULL; } #endif +/* kernel/sched/idle.c */ +extern void sched_idle_set_state(struct cpuidle_state *idle_state); + #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a); #else -- 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/3] cpuidle: Select a different state on tick_broadcast_enter() failures
From: Rafael J. Wysocki If tick_broadcast_enter() fails in cpuidle_enter_state(), try to find another idle state to enter instead of invoking default_idle_call() immediately and returning -EBUSY which should increase the chances of saving some energy in those cases. Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/cpuidle.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) Index: linux-pm/drivers/cpuidle/cpuidle.c === --- linux-pm.orig/drivers/cpuidle/cpuidle.c +++ linux-pm/drivers/cpuidle/cpuidle.c @@ -73,7 +73,10 @@ int cpuidle_play_dead(void) } static int find_deepest_state(struct cpuidle_driver *drv, - struct cpuidle_device *dev, bool freeze) + struct cpuidle_device *dev, + unsigned int max_latency, + unsigned int forbidden_flags, + bool freeze) { unsigned int latency_req = 0; int i, ret = freeze ? -1 : CPUIDLE_DRIVER_STATE_START - 1; @@ -83,6 +86,8 @@ static int find_deepest_state(struct cpu struct cpuidle_state_usage *su = >states_usage[i]; if (s->disabled || su->disable || s->exit_latency <= latency_req + || s->exit_latency > max_latency + || (s->flags & forbidden_flags) || (freeze && !s->enter_freeze)) continue; @@ -100,7 +105,7 @@ static int find_deepest_state(struct cpu int cpuidle_find_deepest_state(struct cpuidle_driver *drv, struct cpuidle_device *dev) { - return find_deepest_state(drv, dev, false); + return find_deepest_state(drv, dev, UINT_MAX, 0, false); } static void enter_freeze_proper(struct cpuidle_driver *drv, @@ -139,7 +144,7 @@ int cpuidle_enter_freeze(struct cpuidle_ * that interrupts won't be enabled when it exits and allows the tick to * be frozen safely. */ - index = find_deepest_state(drv, dev, true); + index = find_deepest_state(drv, dev, UINT_MAX, 0, true); if (index >= 0) enter_freeze_proper(drv, dev, index); @@ -168,8 +173,13 @@ int cpuidle_enter_state(struct cpuidle_d * CPU as a broadcast timer, this call may fail if it is not available. */ if (broadcast && tick_broadcast_enter()) { - default_idle_call(); - return -EBUSY; + index = find_deepest_state(drv, dev, target_state->exit_latency, + CPUIDLE_FLAG_TIMER_STOP, false); + if (index < 0) { + default_idle_call(); + return -EBUSY; + } + target_state = >states[index]; } /* Take note of the planned idle state. */ -- 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] cpuidle: updates related to tick_broadcast_enter() failures
On Saturday, May 09, 2015 10:33:05 PM Rafael J. Wysocki wrote: > On Saturday, May 09, 2015 10:11:41 PM Rafael J. Wysocki wrote: > > On Saturday, May 09, 2015 11:19:16 AM Preeti U Murthy wrote: > > > Hi Rafael, > > > > > > On 05/08/2015 07:48 PM, Rafael J. Wysocki wrote: > > > > [cut] > > > > > >> > > > >> + /* Take note of the planned idle state. */ > > > >> + idle_set_state(smp_processor_id(), target_state); > > > > > > > > And I wouldn't do this either. > > > > > > > > The behavior here is pretty much as though the driver demoted the state > > > > chosen > > > > by the governor and we don't call idle_set_state() again in those cases. > > > > > > Why is this wrong? > > > > It is not "wrong", but incomplete, because demotions done by the cpuidle > > driver > > should also be taken into account in the same way. > > > > But I'm seeing that the recent patch of mine that made cpuidle_enter_state() > > call default_idle_call() was a mistake, because it might confuse > > find_idlest_cpu() > > significantly as to what state the CPU is in. I'll drop that one for now. > > OK, done. > > So after I've dropped it I think we need to do three things: > (1) Move the idle_set_state() calls to cpuidle_enter_state(). > (2) Make cpuidle_enter_state() call default_idle_call() again, but this time > do that *before* it has called idle_set_state() for target_state. > (3) Introduce demotion as per my last patch. > > Let me cut patches for that. Done as per the above and the patches follow in replies to this messge. All on top of the current linux-next branch of the linux-pm.git tree. -- 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/
[PATCH] PM / tick: Add tracepoints for suspend-to-idle diagnostics
From: Rafael J. Wysocki Add suspend/resume tracepoints to tick_freeze() and tick_unfreeze() to catch when timekeeping is suspended and resumed during suspend-to-idle so as to be able to check whether or not we enter the "frozen" state and to measure the time spent in it. Signed-off-by: Rafael J. Wysocki --- kernel/time/tick-common.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) Index: linux-pm/kernel/time/tick-common.c === --- linux-pm.orig/kernel/time/tick-common.c +++ linux-pm/kernel/time/tick-common.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -457,10 +458,13 @@ void tick_freeze(void) raw_spin_lock(_freeze_lock); tick_freeze_depth++; - if (tick_freeze_depth == num_online_cpus()) + if (tick_freeze_depth == num_online_cpus()) { + trace_suspend_resume(TPS("timekeeping_freeze"), +smp_processor_id(), true); timekeeping_suspend(); - else + } else { tick_suspend_local(); + } raw_spin_unlock(_freeze_lock); } @@ -478,10 +482,13 @@ void tick_unfreeze(void) { raw_spin_lock(_freeze_lock); - if (tick_freeze_depth == num_online_cpus()) + if (tick_freeze_depth == num_online_cpus()) { timekeeping_resume(); - else + trace_suspend_resume(TPS("timekeeping_freeze"), +smp_processor_id(), false); + } else { tick_resume_local(); + } tick_freeze_depth--; -- 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 v3 20/33] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
On Sat, 2015-05-09 at 23:19 +0200, Mateusz Kulikowski wrote: > Fix most of remaining PREFER_PR_LEVEL warnings in rtllib. > Replace printk() with netdev_* if possible, pr_* in other cases. > All pr_* use __func__ to easily trace message back to rtllib It's more common to use %s: and not %s(): but it's generally even better not to use these at all and use dynamic_debug to add the function name when desired. > diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c > b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c [] > @@ -69,7 +69,7 @@ static void *rtllib_ccmp_init(int key_idx) > > priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); > if (IS_ERR(priv->tfm)) { > - pr_debug("rtllib_crypt_ccmp: could not allocate crypto API > aes\n"); > + pr_debug("%s(): could not allocate crypto API aes\n", __func__); > priv->tfm = NULL; > goto fail; > } > diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c > b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c [] > @@ -630,12 +623,10 @@ static int rtllib_michael_mic_verify(struct sk_buff > *skb, int keyidx, > struct rtllib_hdr_4addr *hdr; > > hdr = (struct rtllib_hdr_4addr *) skb->data; > - printk(KERN_DEBUG > -"%s: Michael MIC verification failed for MSDU from %pM > keyidx=%d\n", > -skb->dev ? skb->dev->name : "N/A", hdr->addr2, > -keyidx); > - printk(KERN_DEBUG "%d\n", > -memcmp(mic, skb->data + skb->len - 8, 8) != 0); > + pr_debug("%s: Michael MIC verification failed for MSDU from %pM > keyidx=%d\n", > + skb->dev ? skb->dev->name : "N/A", hdr->addr2, > + keyidx); Not that it's necessary, but are this and below missing __func__? > diff --git a/drivers/staging/rtl8192e/rtllib_rx.c > b/drivers/staging/rtl8192e/rtllib_rx.c [] > @@ -346,8 +346,9 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, > struct sk_buff *skb, > res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); > atomic_dec(>refcnt); > if (res < 0) { > - printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed > (SA= %pM keyidx=%d)\n", > -ieee->dev->name, hdr->addr2, keyidx); > + netdev_dbg(ieee->dev, > +"MSDU decryption/MIC verification failed (SA= %pM > keyidx=%d)\n", > +hdr->addr2, keyidx); > return -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/
Re: [PATCH v3 01/33] staging: rtl8192e: Declare ethernet addresses as __aligned(2)
On Sat, 2015-05-09 at 23:18 +0200, Mateusz Kulikowski wrote: > Add __aligned(2) into ethernet addresses allocated on stack or in non-packed > structures. Use ETH_ALEN as array length in places where it was hardcoded to > 6. [] > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c > b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c [] > @@ -321,7 +321,8 @@ static void rtl8192_read_eeprom_info(struct net_device > *dev) > u8 ICVer8192, ICVer8256; > u16 i, usValue, IC_Version; > u16 EEPROMId; > - u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01}; > + u8 bMac_Tmp_Addr[ETH_ALEN] __aligned(2) = {0x00, 0xe0, 0x4c, > +0x00, 0x00, 0x01}; While this is safe, as this follows a u16, it's unnecessary. Also, ideally, this would be u8 foo[ETH_ALEN] = { 1, 2, 3, 4, 5, 6 }; or just left on a single line. > diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c > b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c [] > @@ -2573,8 +2573,9 @@ static int rtl8192_ioctl(struct net_device *dev, struct > ifreq *rq, int cmd) > int ret = -1; > struct rtllib_device *ieee = priv->rtllib; > u32 key[4]; > - u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; > - u8 zero_addr[6] = {0}; > + u8 broadcast_addr[ETH_ALEN] __aligned(2) = {0xff, 0xff, 0xff, > + 0xff, 0xff, 0xff}; > + u8 zero_addr[ETH_ALEN] __aligned(2) = {0}; If these are used only in tests, these are probably better being removed and using is__ether_addr or maybe if these used in things other than tests, being converted to static const so they are not reinitialized on each call of the function. -- 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] net: fec: add support of ethtool get_regs
Hi Fabio, On 09/05/15 23:59, Fabio Estevam wrote: Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux wrote: Using memcpy_fromio() to copy device registers is not a good idea - it can use a variable access size which can cause bus faults. An example on how memcpy_fromio() can be avoided in get_regs: drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c Thanks for pointing me this example. I've already send a patch, and I've used drivers/net/ethernet/freescale/gianfar_ethtool.c as example. I hope it's a good example too. Regards, Fabio Estevam Regards, Philippe -- 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] staging: rtl8192e: Change cpu_to_le16 to le16_to_cpu
On Sat, May 09, 2015 at 10:27:16PM +0200, Arno Tiemersma wrote: > Since the function auth_parse returns a u16, and > struct rtllib_authentication.status is defined as an __le16, it seems > that > > return cpu_to_le16(a->status); > > should be > > return le16_to_cpu(a->status); > > This change silences the following sparse warnings: > drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: > warning: cast from restricted __le16 > drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: > warning: incorrect type in return expression (different base types) > drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: > expected unsigned short > drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: > got restricted __le16 [usertype] > > Signed-off-by: Arno Tiemersma Your patch seems reasonable. The caller only cares about zero non-zero. It feels like there are a bunch of endian bugs which Sparse misses in this file. For example, ->frame_ctl is endian but it's never converted and it's compared against cpu endian in the switch statements. (I haven't double checked. Do your own homework before sending patches). regards, dan carpenter -- 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] ASoC: codecs-ac97: make selectable in config
Make generic ASoC AC'97 CODEC selectable in config. This way this driver can be used for platforms which don't need specialized AC'97 CODEC drivers but which are not directly selectable in config themselves (for example DT based ones). Signed-off-by: Maciej Szmigiero --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -16,7 +16,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_88PM860X if MFD_88PM860X select SND_SOC_L3 select SND_SOC_AB8500_CODEC if ABX500_CORE - select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS + select SND_SOC_AC97_CODEC select SND_SOC_AD1836 if SPI_MASTER select SND_SOC_AD193X_SPI if SPI_MASTER select SND_SOC_AD193X_I2C if I2C @@ -212,8 +212,9 @@ config SND_SOC_AB8500_CODEC tristate config SND_SOC_AC97_CODEC - tristate + tristate "Build generic ASoC AC97 CODEC driver" select SND_AC97_CODEC + select SND_SOC_AC97_BUS config SND_SOC_AD1836 tristate -- 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] ASoC: codecs-ac97: Remove rate constraints
Remove rate constraints from generic ASoC AC'97 CODEC. Supported rates should be detected and constrained anyway by AC'97 generic code - was tested with VT1613 CODEC and iMX6 SSI controller. This way this driver can be used for platforms which don't need specialized AC'97 CODEC drivers while at the same avoiding code duplication from implementing equivalent functionality in a controller driver. Signed-off-by: Maciej Szmigiero --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -44,10 +44,6 @@ static int ac97_prepare(struct snd_pcm_substream *substream, return snd_ac97_set_rate(ac97, reg, substream->runtime->rate); } -#define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ - SNDRV_PCM_RATE_48000) - static const struct snd_soc_dai_ops ac97_dai_ops = { .prepare= ac97_prepare, }; @@ -58,13 +54,13 @@ static struct snd_soc_dai_driver ac97_dai = { .stream_name = "AC97 Playback", .channels_min = 1, .channels_max = 2, - .rates = STD_AC97_RATES, + .rates = SNDRV_PCM_RATE_KNOT, .formats = SND_SOC_STD_AC97_FMTS,}, .capture = { .stream_name = "AC97 Capture", .channels_min = 1, .channels_max = 2, - .rates = STD_AC97_RATES, + .rates = SNDRV_PCM_RATE_KNOT, .formats = SND_SOC_STD_AC97_FMTS,}, .ops = _dai_ops, }; -- 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/7] Xen / ACPI / processor: Remove unneeded NULL check in xen_acpi_processor_enable()
On Tue, May 05, 2015 at 11:29:05AM +0100, Stefano Stabellini wrote: > CC'ing Konrad and David. > > On Tue, 5 May 2015, Hanjun Guo wrote: > > Before xen_acpi_processor_enable() is called, struct acpi_processor *pr is > > allocated in xen_acpi_processor_add() and checked if it's NULL, so no need > > to check again when passed to xen_acpi_processor_enable(), just remove it. Sounds right. > > > > Signed-off-by: Hanjun Guo > > CC: Boris Ostrovsky > > CC: Stefano Stabellini > > --- > > drivers/xen/xen-acpi-cpuhotplug.c | 8 +--- > > 1 file changed, 1 insertion(+), 7 deletions(-) > > > > diff --git a/drivers/xen/xen-acpi-cpuhotplug.c > > b/drivers/xen/xen-acpi-cpuhotplug.c > > index 5a62aa0..f4a3694 100644 > > --- a/drivers/xen/xen-acpi-cpuhotplug.c > > +++ b/drivers/xen/xen-acpi-cpuhotplug.c > > @@ -46,13 +46,7 @@ static int xen_acpi_processor_enable(struct acpi_device > > *device) > > unsigned long long value; > > union acpi_object object = { 0 }; > > struct acpi_buffer buffer = { sizeof(union acpi_object), }; > > - struct acpi_processor *pr; > > - > > - pr = acpi_driver_data(device); > > - if (!pr) { > > - pr_err(PREFIX "Cannot find driver data\n"); > > - return -EINVAL; > > - } > > + struct acpi_processor *pr = acpi_driver_data(device); > > > > if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) { > > /* Declared with "Processor" statement; match ProcessorID */ > > -- > > 1.9.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/
Re: [alsa-devel] [PATCH] ASoC: codecs-ac97: Remove rate constraints
Hi Fabio, W dniu 09.05.2015 01:47, Fabio Estevam pisze: > Hi Maciej, > (..) > > Please keep me on Cc when you submit further ac97 patches / udoo dts, > so that I can help testing them. > > Thanks, > > Fabio Estevam Thank you for your kind words, naturally I will keep you CCed. Best regards, Maciej Szmigiero -- 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] net: fec: add support of ethtool get_regs
Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux wrote: > Using memcpy_fromio() to copy device registers is not a good idea - > it can use a variable access size which can cause bus faults. An example on how memcpy_fromio() can be avoided in get_regs: drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c Regards, Fabio Estevam -- 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 00/10] evacuate struct page from the block layer, introduce __pfn_t
On Fri, May 08, 2015 at 11:02:28PM -0400, Rik van Riel wrote: > On 05/08/2015 09:14 PM, Linus Torvalds wrote: > > On Fri, May 8, 2015 at 9:59 AM, Rik van Riel wrote: > >> > >> However, for persistent memory, all of the files will be "in memory". > > > > Yes. However, I doubt you will find a very sane rw filesystem that > > then also makes them contiguous and aligns them at 2MB boundaries. > > > > Anything is possible, I guess, but things like that are *hard*. The > > fragmentation issues etc cause it to a really challenging thing. > > The TLB performance bonus of accessing the large files with > large pages may make it worthwhile to solve that hard problem. FWIW, for DAX ththe filesystem allocation side is already mostly solved - this is just an allocation alignment hint, analogous to RAID stripe alignment. We don't need to reinvent the wheel here. i.e. On XFS, use a 2MB stripe unit for the fs, a 2MB extent size hint for files you want to use large pages on and you'll get 2MB sized and aligned allocations from the filesystem for as long as there are such freespace regions available. 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/
[PATCH v2] net: fec: add support of ethtool get_regs
This enables the ethtool's "-d" and "--register-dump" options for fec devices. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/freescale/fec_main.c | 28 1 files changed, 28 insertions(+), 0 deletions(-) Changelog: v2: (thanks Russell King and David Miler for the feedback) - don't use memcpy_fromio to copy registers diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 66d47e4..5875913 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2118,6 +2118,32 @@ static void fec_enet_get_drvinfo(struct net_device *ndev, strlcpy(info->bus_info, dev_name(>dev), sizeof(info->bus_info)); } +static int fec_enet_get_regs_len(struct net_device *ndev) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + struct resource *r; + int s = 0; + + r = platform_get_resource(fep->pdev, IORESOURCE_MEM, 0); + if (r) { + s = resource_size(r); + } + + return s; +} + +static void fec_enet_get_regs(struct net_device *ndev, + struct ethtool_regs *regs, void *regbuf) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + u32 __iomem *theregs = (u32 __iomem *) fep->hwp; + u32 *buf = (u32 *)regbuf; + int i; + + for (i = 0; i < regs->len / sizeof(u32); i++) + buf[i] = readl([i]); +} + static int fec_enet_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) { @@ -2515,6 +2541,8 @@ static const struct ethtool_ops fec_enet_ethtool_ops = { .get_settings = fec_enet_get_settings, .set_settings = fec_enet_set_settings, .get_drvinfo= fec_enet_get_drvinfo, + .get_regs_len = fec_enet_get_regs_len, + .get_regs = fec_enet_get_regs, .nway_reset = fec_enet_nway_reset, .get_link = ethtool_op_get_link, .get_coalesce = fec_enet_get_coalesce, -- 1.7.4.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: [net-next PATCH v3 4/4] net: macb: Add change_mtu callback with jumbo support
From: Harini Katakam Date: Wed, 6 May 2015 22:27:18 +0530 > Add macb_change_mtu callback; if jumbo frame support is present allow > mtu size changes upto (jumbo max length allowed - headers). > > Signed-off-by: Harini Katakam > Reviewed-by: Punnaiah Choudary Kalluri Applied. -- 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: [net-next PATCH v3 3/4] net: macb: Add support for jumbo frames
From: Harini Katakam Date: Wed, 6 May 2015 22:27:17 +0530 > Enable jumbo frame support for Zynq Ultrascale+ MPSoC. > Update the NWCFG register and descriptor length masks accordingly. > Jumbo max length register should be set according to support in SoC; it is > set to 10240 for Zynq Ultrascale+ MPSoC. > > Signed-off-by: Harini Katakam > Reviewed-by: Punnaiah Choudary Kalluri Applied. -- 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: [net-next PATCH v3 2/4] net: macb: Add compatible string for Zynq Ultrascale+ MPSoC
From: Harini Katakam Date: Wed, 6 May 2015 22:27:16 +0530 > Add compatible string and config structure for Zynq Ultrascale+ MPSoC > > Signed-off-by: Harini Katakam > Reviewed-by: Punnaiah Choudary Kalluri Applied. -- 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: [net-next PATCH v3 1/4] devicetree: Add compatible string for Zynq Ultrascale+ MPSoC
From: Harini Katakam Date: Wed, 6 May 2015 22:27:15 +0530 > Add "cdns,zynqmp-gem" to be used for Zynq Ultrascale+ MPSoC. > > Signed-off-by: Harini Katakam > Reviewed-by: Punnaiah Choudary Kalluri Applied. -- 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] ARM: net fix emit_udiv() for BPF_ALU | BPF_DIV | BPF_K intruction.
From: Nicolas Schichan Date: Wed, 6 May 2015 18:31:56 +0200 > In that case, emit_udiv() will be called with rn == ARM_R0 (r_scratch) > and loading rm first into ARM_R0 will result in jit_udiv() function > being called the same dividend and divisor. Fix that by loading rn > first into ARM_R1 and then rm into ARM_R0. > > Signed-off-by: Nicolas Schichan > Cc: # v3.13+ > Fixes: aee636c4809f (bpf: do not use reciprocal divide) Do you want me to push this via my net tree? -- 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] net: fec: add support of ethtool get_regs
From: Russell King - ARM Linux Date: Sat, 9 May 2015 22:17:46 +0100 > On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote: >> +static void fec_enet_get_regs(struct net_device *ndev, >> + struct ethtool_regs *regs, void *regbuf) >> +{ >> +struct fec_enet_private *fep = netdev_priv(ndev); >> + >> +memcpy_fromio(regbuf, fep->hwp, regs->len); > > Using memcpy_fromio() to copy device registers is not a good idea - > it can use a variable access size which can cause bus faults. Agreed. -- 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 v3 02/33] staging: rtl8192e: Fix PREFER_ETHER_ADDR_COPY warnings
Replace memcpy() with ether_addr_copy() where possible to make checkpatch.pl happy. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +- drivers/staging/rtl8192e/rtl819x_BAProc.c | 13 +++--- drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 19 drivers/staging/rtl8192e/rtllib_rx.c | 46 +- drivers/staging/rtl8192e/rtllib_softmac.c | 64 +- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 +- drivers/staging/rtl8192e/rtllib_tx.c | 24 +- 7 files changed, 89 insertions(+), 83 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index a3fbbb9..eb803dc 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -384,7 +384,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) *(u16 *)(>dev_addr[i]) = usValue; } } else { - memcpy(dev->dev_addr, bMac_Tmp_Addr, 6); + ether_addr_copy(dev->dev_addr, bMac_Tmp_Addr); } RT_TRACE(COMP_INIT, "Permanent Address = %pM\n", diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 26258ea..5b72bce 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -18,6 +18,7 @@ **/ #include #include +#include #include "rtllib.h" #include "rtl819x_BA.h" @@ -103,10 +104,10 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, BAReq = (struct rtllib_hdr_3addr *)skb_put(skb, sizeof(struct rtllib_hdr_3addr)); - memcpy(BAReq->addr1, Dst, ETH_ALEN); - memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN); + ether_addr_copy(BAReq->addr1, Dst); + ether_addr_copy(BAReq->addr2, ieee->dev->dev_addr); - memcpy(BAReq->addr3, ieee->current_network.bssid, ETH_ALEN); + ether_addr_copy(BAReq->addr3, ieee->current_network.bssid); BAReq->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT); tag = (u8 *)skb_put(skb, 9); @@ -167,9 +168,9 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, Delba = (struct rtllib_hdr_3addr *) skb_put(skb, sizeof(struct rtllib_hdr_3addr)); - memcpy(Delba->addr1, dst, ETH_ALEN); - memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN); - memcpy(Delba->addr3, ieee->current_network.bssid, ETH_ALEN); + ether_addr_copy(Delba->addr1, dst); + ether_addr_copy(Delba->addr2, ieee->dev->dev_addr); + ether_addr_copy(Delba->addr3, ieee->current_network.bssid); Delba->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT); tag = (u8 *)skb_put(skb, 6); diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c index eda68b9..9ec2b48 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "rtllib.h" @@ -533,20 +534,20 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) switch (le16_to_cpu(hdr11->frame_ctl) & (RTLLIB_FCTL_FROMDS | RTLLIB_FCTL_TODS)) { case RTLLIB_FCTL_TODS: - memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */ - memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */ + ether_addr_copy(hdr, hdr11->addr3); /* DA */ + ether_addr_copy(hdr + ETH_ALEN, hdr11->addr2); /* SA */ break; case RTLLIB_FCTL_FROMDS: - memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */ - memcpy(hdr + ETH_ALEN, hdr11->addr3, ETH_ALEN); /* SA */ + ether_addr_copy(hdr, hdr11->addr1); /* DA */ + ether_addr_copy(hdr + ETH_ALEN, hdr11->addr3); /* SA */ break; case RTLLIB_FCTL_FROMDS | RTLLIB_FCTL_TODS: - memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */ - memcpy(hdr + ETH_ALEN, hdr11->addr4, ETH_ALEN); /* SA */ + ether_addr_copy(hdr, hdr11->addr3); /* DA */ + ether_addr_copy(hdr + ETH_ALEN, hdr11->addr4); /* SA */ break; case 0: - memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */ - memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */ + ether_addr_copy(hdr, hdr11->addr1); /* DA */ + ether_addr_copy(hdr + ETH_ALEN, hdr11->addr2); /* SA */ break; } @@ -599,7 +600,7 @@ static void rtllib_michael_mic_failure(struct net_device *dev, else ev.flags |= IW_MICFAILURE_PAIRWISE; ev.src_addr.sa_family = ARPHRD_ETHER; -
[PATCH v3 06/33] staging: rtl8192e: Remove rtllib_crypt.[ch]
It is neither compiled nor used in rtl8192e. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_crypt.c | 254 drivers/staging/rtl8192e/rtllib_crypt.h | 34 - 2 files changed, 288 deletions(-) delete mode 100644 drivers/staging/rtl8192e/rtllib_crypt.c delete mode 100644 drivers/staging/rtl8192e/rtllib_crypt.h diff --git a/drivers/staging/rtl8192e/rtllib_crypt.c b/drivers/staging/rtl8192e/rtllib_crypt.c deleted file mode 100644 index 1e6ae9b..000 --- a/drivers/staging/rtl8192e/rtllib_crypt.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Host AP crypto routines - * - * Copyright (c) 2002-2003, Jouni Malinen - * Portions Copyright (C) 2004, Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. - * - */ - -#include -#include -#include -#include -#include - -#include "rtllib.h" - -struct rtllib_crypto_alg { - struct list_head list; - struct lib80211_crypto_ops *ops; -}; - - -struct rtllib_crypto { - struct list_head algs; - spinlock_t lock; -}; - -static struct rtllib_crypto *hcrypt; - -void rtllib_crypt_deinit_entries(struct lib80211_crypt_info *info, - int force) -{ - struct list_head *ptr, *n; - struct lib80211_crypt_data *entry; - - for (ptr = info->crypt_deinit_list.next, n = ptr->next; -ptr != >crypt_deinit_list; ptr = n, n = ptr->next) { - entry = list_entry(ptr, struct lib80211_crypt_data, list); - - if (atomic_read(>refcnt) != 0 && !force) - continue; - - list_del(ptr); - - if (entry->ops) - entry->ops->deinit(entry->priv); - kfree(entry); - } -} -EXPORT_SYMBOL(rtllib_crypt_deinit_entries); - -void rtllib_crypt_deinit_handler(unsigned long data) -{ - struct lib80211_crypt_info *info = (struct lib80211_crypt_info *)data; - unsigned long flags; - - spin_lock_irqsave(info->lock, flags); - rtllib_crypt_deinit_entries(info, 0); - if (!list_empty(>crypt_deinit_list)) { - printk(KERN_DEBUG - "%s: entries remaining in delayed crypt deletion list\n", - info->name); - info->crypt_deinit_timer.expires = jiffies + HZ; - add_timer(>crypt_deinit_timer); - } - spin_unlock_irqrestore(info->lock, flags); - -} -EXPORT_SYMBOL(rtllib_crypt_deinit_handler); - -void rtllib_crypt_delayed_deinit(struct lib80211_crypt_info *info, -struct lib80211_crypt_data **crypt) -{ - struct lib80211_crypt_data *tmp; - unsigned long flags; - - if (*crypt == NULL) - return; - - tmp = *crypt; - *crypt = NULL; - - /* must not run ops->deinit() while there may be pending encrypt or -* decrypt operations. Use a list of delayed deinits to avoid needing -* locking. -*/ - - spin_lock_irqsave(info->lock, flags); - list_add(>list, >crypt_deinit_list); - if (!timer_pending(>crypt_deinit_timer)) { - info->crypt_deinit_timer.expires = jiffies + HZ; - add_timer(>crypt_deinit_timer); - } - spin_unlock_irqrestore(info->lock, flags); -} -EXPORT_SYMBOL(rtllib_crypt_delayed_deinit); - -int rtllib_register_crypto_ops(struct lib80211_crypto_ops *ops) -{ - unsigned long flags; - struct rtllib_crypto_alg *alg; - - if (hcrypt == NULL) - return -1; - - alg = kzalloc(sizeof(*alg), GFP_KERNEL); - if (alg == NULL) - return -ENOMEM; - - alg->ops = ops; - - spin_lock_irqsave(>lock, flags); - list_add(>list, >algs); - spin_unlock_irqrestore(>lock, flags); - - printk(KERN_DEBUG "rtllib_crypt: registered algorithm '%s'\n", - ops->name); - - return 0; -} -EXPORT_SYMBOL(rtllib_register_crypto_ops); - -int rtllib_unregister_crypto_ops(struct lib80211_crypto_ops *ops) -{ - unsigned long flags; - struct list_head *ptr; - struct rtllib_crypto_alg *del_alg = NULL; - - if (hcrypt == NULL) - return -1; - - spin_lock_irqsave(>lock, flags); - for (ptr = hcrypt->algs.next; ptr != >algs; ptr = ptr->next) { - struct rtllib_crypto_alg *alg = - (struct rtllib_crypto_alg *) ptr; - if (alg->ops == ops) { - list_del(>list); - del_alg = alg; - break; - } - } - spin_unlock_irqrestore(>lock, flags); - - if (del_alg) { - printk(KERN_DEBUG "rtllib_crypt: unregistered algorithm '%s'\n", - ops->name);
[PATCH v3 08/33] staging: rtl8192e: Remove RTLLIB_ERROR() and RTLLIB_WARNING()
Use pr_* where needed (rtllib init code). Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h| 2 -- drivers/staging/rtl8192e/rtllib_module.c | 8 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 3674c8b..5f47d75 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -701,8 +701,6 @@ do { \ #define RTLLIB_DL_TRACE (1<<29) #define RTLLIB_DL_DATA(1<<30) #define RTLLIB_DL_ERR (1<<31) -#define RTLLIB_ERROR(f, a...) pr_err("rtllib: " f, ## a) -#define RTLLIB_WARNING(f, a...) pr_warn("rtllib: " f, ## a) #define RTLLIB_DEBUG_INFO(f, a...) RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a) #define RTLLIB_DEBUG_WX(f, a...) RTLLIB_DEBUG(RTLLIB_DL_WX, f, ## a) diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c index 32cc8df..b8c7df5 100644 --- a/drivers/staging/rtl8192e/rtllib_module.c +++ b/drivers/staging/rtl8192e/rtllib_module.c @@ -107,7 +107,7 @@ struct net_device *alloc_rtllib(int sizeof_priv) dev = alloc_etherdev(sizeof(struct rtllib_device) + sizeof_priv); if (!dev) { - RTLLIB_ERROR("Unable to network device.\n"); + pr_err("Unable to allocate net_device.\n"); return NULL; } ieee = (struct rtllib_device *)netdev_priv_rsl(dev); @@ -116,8 +116,7 @@ struct net_device *alloc_rtllib(int sizeof_priv) err = rtllib_networks_allocate(ieee); if (err) { - RTLLIB_ERROR("Unable to allocate beacon storage: %d\n", - err); + pr_err("Unable to allocate beacon storage: %d\n", err); goto failed; } rtllib_networks_initialize(ieee); @@ -240,8 +239,7 @@ static int __init rtllib_init(void) rtllib_debug_level = debug; rtllib_proc = proc_mkdir(DRV_NAME, init_net.proc_net); if (rtllib_proc == NULL) { - RTLLIB_ERROR("Unable to create " DRV_NAME - " proc directory\n"); + pr_err("Unable to create " DRV_NAME " proc directory\n"); return -EIO; } e = proc_create("debug_level", S_IRUGO | S_IWUSR, rtllib_proc, ); -- 1.8.4.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 v3 10/33] staging: rtl8192e: Simplify rtllib_proces_probe_response()
- Extract frame_ctl once and use it as variable. - Drop endian conversion in is_beacon() function (used in simplified function only) - Simplify debug messages - Invert STYPE checks in debug messages - it is valid as only BEACON and PROBE_RESP are allowed Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_rx.c | 37 +++- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 286e374..e553b1f 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2430,9 +2430,9 @@ static inline void update_network(struct rtllib_network *dst, dst->BssCcxVerNumber = src->BssCcxVerNumber; } -static inline int is_beacon(__le16 fc) +static inline int is_beacon(u16 fc) { - return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == RTLLIB_STYPE_BEACON); + return (WLAN_FC_GET_STYPE(fc) == RTLLIB_STYPE_BEACON); } static int IsPassiveChannel(struct rtllib_device *rtllib, u8 channel) @@ -2473,6 +2473,7 @@ static inline void rtllib_process_probe_response( short renew; struct rtllib_network *network = kzalloc(sizeof(struct rtllib_network), GFP_ATOMIC); + u16 frame_ctl = le16_to_cpu(beacon->header.frame_ctl); if (!network) return; @@ -2501,12 +2502,9 @@ static inline void rtllib_process_probe_response( if (rtllib_network_init(ieee, beacon, network, stats)) { RTLLIB_DEBUG_SCAN("Dropped '%s' ( %pM) via %s.\n", escape_essid(info_element->data, - info_element->len), - beacon->header.addr3, - WLAN_FC_GET_STYPE( - le16_to_cpu(beacon->header.frame_ctl)) == - RTLLIB_STYPE_PROBE_RESP ? - "PROBE RESPONSE" : "BEACON"); + info_element->len), beacon->header.addr3, + is_beacon(frame_ctl) ? "BEACON" : +"PROBE RESPONSE"); goto free_network; } @@ -2514,8 +2512,7 @@ static inline void rtllib_process_probe_response( if (!rtllib_legal_channel(ieee, network->channel)) goto free_network; - if (WLAN_FC_GET_STYPE(le16_to_cpu(beacon->header.frame_ctl)) == - RTLLIB_STYPE_PROBE_RESP) { + if (WLAN_FC_GET_STYPE(frame_ctl) == RTLLIB_STYPE_PROBE_RESP) { if (IsPassiveChannel(ieee, network->channel)) { netdev_info(ieee->dev, "GetScanInfo(): For Global Domain, filter probe response at channel(%d).\n", @@ -2548,7 +2545,7 @@ static inline void rtllib_process_probe_response( else ieee->current_network.buseprotection = false; } - if (is_beacon(beacon->header.frame_ctl)) { + if (is_beacon(frame_ctl)) { if (ieee->state >= RTLLIB_LINKED) ieee->LinkDetectInfo.NumRecvBcnInPeriod++; } @@ -2585,22 +2582,18 @@ static inline void rtllib_process_probe_response( RTLLIB_DEBUG_SCAN("Adding '%s' ( %pM) via %s.\n", escape_essid(network->ssid, network->ssid_len), network->bssid, - WLAN_FC_GET_STYPE( - le16_to_cpu(beacon->header.frame_ctl)) == - RTLLIB_STYPE_PROBE_RESP ? - "PROBE RESPONSE" : "BEACON"); + is_beacon(frame_ctl) ? "BEACON" : +"PROBE RESPONSE"); memcpy(target, network, sizeof(*target)); list_add_tail(>list, >network_list); if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) rtllib_softmac_new_net(ieee, network); } else { RTLLIB_DEBUG_SCAN("Updating '%s' ( %pM) via %s.\n", - escape_essid(target->ssid, - target->ssid_len), target->bssid, - WLAN_FC_GET_STYPE( - le16_to_cpu(beacon->header.frame_ctl)) == - RTLLIB_STYPE_PROBE_RESP ? - "PROBE RESPONSE" : "BEACON"); + escape_essid(target->ssid, target->ssid_len), + target->bssid, + is_beacon(frame_ctl) ? "BEACON" : +
[PATCH v3 09/33] staging: rtl8192e: Remove RTLLIB_DEBUG_WX()
Use netdev_dbg() instead of RTLLIB_DEBUG_WX(). Rewrite some messages to be more readable. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h| 1 - drivers/staging/rtl8192e/rtllib_wx.c | 33 - 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 5f47d75..4edbc87 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -703,7 +703,6 @@ do { \ #define RTLLIB_DL_ERR (1<<31) #define RTLLIB_DEBUG_INFO(f, a...) RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a) -#define RTLLIB_DEBUG_WX(f, a...) RTLLIB_DEBUG(RTLLIB_DL_WX, f, ## a) #define RTLLIB_DEBUG_SCAN(f, a...) RTLLIB_DEBUG(RTLLIB_DL_SCAN, f, ## a) #define RTLLIB_DEBUG_STATE(f, a...) RTLLIB_DEBUG(RTLLIB_DL_STATE, f, ## a) #define RTLLIB_DEBUG_MGMT(f, a...) RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a) diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 6234aae..c2c5f0d 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -266,7 +266,7 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee, int i = 0; int err = 0; - RTLLIB_DEBUG_WX("Getting scan\n"); + netdev_dbg(ieee->dev, "Getting scan\n"); down(>wx_sem); spin_lock_irqsave(>lock, flags); @@ -293,7 +293,7 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee, wrqu->data.length = ev - extra; wrqu->data.flags = 0; - RTLLIB_DEBUG_WX("exit: %d networks returned.\n", i); + netdev_dbg(ieee->dev, "%s(): %d networks returned.\n", __func__, i); return err; } @@ -311,7 +311,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, int i, key, key_provided, len; struct lib80211_crypt_data **crypt; - RTLLIB_DEBUG_WX("SET_ENCODE\n"); + netdev_dbg(ieee->dev, "%s()\n", __func__); key = erq->flags & IW_ENCODE_INDEX; if (key) { @@ -324,16 +324,16 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, key = ieee->crypt_info.tx_keyidx; } - RTLLIB_DEBUG_WX("Key: %d [%s]\n", key, key_provided ? + netdev_dbg(ieee->dev, "Key: %d [%s]\n", key, key_provided ? "provided" : "default"); crypt = >crypt_info.crypt[key]; if (erq->flags & IW_ENCODE_DISABLED) { if (key_provided && *crypt) { - RTLLIB_DEBUG_WX("Disabling encryption on key %d.\n", - key); + netdev_dbg(ieee->dev, + "Disabling encryption on key %d.\n", key); lib80211_crypt_delayed_deinit(>crypt_info, crypt); } else - RTLLIB_DEBUG_WX("Disabling encryption.\n"); + netdev_dbg(ieee->dev, "Disabling encryption.\n"); /* Check all the keys to see if any are still configured, * and if no key index was provided, de-init them all @@ -405,9 +405,9 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, if (len > erq->length) memset(sec.keys[key] + erq->length, 0, len - erq->length); - RTLLIB_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n", - key, escape_essid(sec.keys[key], len), - erq->length, len); + netdev_dbg(ieee->dev, "Setting key %d to '%s' (%d:%d bytes)\n", + key, escape_essid(sec.keys[key], len), erq->length, + len); sec.key_sizes[key] = len; (*crypt)->ops->set_key(sec.keys[key], len, NULL, (*crypt)->priv); @@ -436,8 +436,8 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, /* No key data - just set the default TX key index */ if (key_provided) { - RTLLIB_DEBUG_WX("Setting key %d to default Tx key.\n", - key); + netdev_dbg(ieee->dev, + "Setting key %d as default Tx key.\n", key); ieee->crypt_info.tx_keyidx = key; sec.active_key = key; sec.flags |= SEC_ACTIVE_KEY; @@ -449,7 +449,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, WLAN_AUTH_SHARED_KEY; sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY; sec.flags |= SEC_AUTH_MODE; - RTLLIB_DEBUG_WX("Auth: %s\n", sec.auth_mode == WLAN_AUTH_OPEN ? + netdev_dbg(ieee->dev, "Auth: %s\n", sec.auth_mode == WLAN_AUTH_OPEN ? "OPEN" : "SHARED
[PATCH v3 05/33] staging: rtl8192e: Replace memcmp() with ether_addr_equal_unaligned()
Use dedicated macro to compare ethernet addresses in probe_rq_parse(). Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_softmac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index dccb642..bc934ed 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1852,7 +1852,8 @@ static short probe_rq_parse(struct rtllib_device *ieee, struct sk_buff *skb, return -1; /* corrupted */ bssid_match = - (memcmp(header->addr3, ieee->current_network.bssid, ETH_ALEN) != 0) && + (!ether_addr_equal_unaligned(header->addr3, + ieee->current_network.bssid)) && (!is_broadcast_ether_addr(header->addr3)); if (bssid_match) return -1; -- 1.8.4.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 v3 03/33] staging: rtl8192e: Mark unaligned memcpy()
Comment unaligned memcpy() that trigger PREFER_ETHER_ADDR_COPY checkpatch.pl warning. It will prevent accidential "Fix" to ether_addr_copy(). Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_rx.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index ebb328d..65e4d13 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -488,15 +488,19 @@ void rtllib_indicate_packets(struct rtllib_device *ieee, struct rtllib_rxb **prx * and replace EtherType */ skb_pull(sub_skb, SNAP_SIZE); - memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN); - memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN); + memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, + ETH_ALEN); /* Must be unaligned */ + memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, + ETH_ALEN); /* Must be unaligned */ } else { u16 len; /* Leave Ethernet header part of hdr and full payload */ len = sub_skb->len; memcpy(skb_push(sub_skb, 2), , 2); - memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN); - memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN); + memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, + ETH_ALEN); /* Must be unaligned */ + memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, + ETH_ALEN); /* Must be unaligned */ } /* Indicate the packets to upper layer */ @@ -781,15 +785,15 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb, rxb->subframes[0] = sub_skb; - memcpy(rxb->src, src, ETH_ALEN); - memcpy(rxb->dst, dst, ETH_ALEN); + memcpy(rxb->src, src, ETH_ALEN); /* Must stay unaligned */ + memcpy(rxb->dst, dst, ETH_ALEN); /* Must stay unaligned */ rxb->subframes[0]->dev = ieee->dev; return 1; } rxb->nr_subframes = 0; - memcpy(rxb->src, src, ETH_ALEN); - memcpy(rxb->dst, dst, ETH_ALEN); + memcpy(rxb->src, src, ETH_ALEN); /* Must stay unaligned */ + memcpy(rxb->dst, dst, ETH_ALEN); /* Must stay unaligned */ while (skb->len > ETHERNET_HEADER_SIZE) { /* Offset 12 denote 2 mac address */ nSubframe_Length = *((u16 *)(skb->data + 12)); -- 1.8.4.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 v3 11/33] staging: rtl8192e: Remove RTLLIB_DEBUG_SCAN()
Use netdev_dbg() instead, remove duplicated logs. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h| 1 - drivers/staging/rtl8192e/rtllib_rx.c | 101 --- drivers/staging/rtl8192e/rtllib_wx.c | 12 +++-- 3 files changed, 54 insertions(+), 60 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 4edbc87..f7b741e 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -703,7 +703,6 @@ do { \ #define RTLLIB_DL_ERR (1<<31) #define RTLLIB_DEBUG_INFO(f, a...) RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a) -#define RTLLIB_DEBUG_SCAN(f, a...) RTLLIB_DEBUG(RTLLIB_DL_SCAN, f, ## a) #define RTLLIB_DEBUG_STATE(f, a...) RTLLIB_DEBUG(RTLLIB_DL_STATE, f, ## a) #define RTLLIB_DEBUG_MGMT(f, a...) RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a) #define RTLLIB_DEBUG_FRAG(f, a...) RTLLIB_DEBUG(RTLLIB_DL_FRAG, f, ## a) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index e553b1f..9b57c7e 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2103,8 +2103,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, break; case MFIE_TYPE_HT_CAP: - RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_CAP: %d bytes\n", -info_element->len); + netdev_dbg(ieee->dev, "MFIE_TYPE_HT_CAP: %d bytes\n", + info_element->len); tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); if (tmp_htcap_len != 0) { network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; @@ -2130,8 +2130,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, case MFIE_TYPE_HT_INFO: - RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_INFO: %d bytes\n", -info_element->len); + netdev_dbg(ieee->dev, "MFIE_TYPE_HT_INFO: %d bytes\n", + info_element->len); tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN); if (tmp_htinfo_len) { network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE; @@ -2146,8 +2146,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, break; case MFIE_TYPE_AIRONET: - RTLLIB_DEBUG_SCAN("MFIE_TYPE_AIRONET: %d bytes\n", -info_element->len); + netdev_dbg(ieee->dev, "MFIE_TYPE_AIRONET: %d bytes\n", + info_element->len); if (info_element->len > IE_CISCO_FLAG_POSITION) { network->bWithAironetIE = true; @@ -2169,8 +2169,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, break; case MFIE_TYPE_COUNTRY: - RTLLIB_DEBUG_SCAN("MFIE_TYPE_COUNTRY: %d bytes\n", -info_element->len); + netdev_dbg(ieee->dev, "MFIE_TYPE_COUNTRY: %d bytes\n", + info_element->len); rtllib_extract_country_ie(ieee, info_element, network, network->bssid); break; @@ -2277,10 +2277,9 @@ static inline int rtllib_network_init( } if (network->mode == 0) { - RTLLIB_DEBUG_SCAN("Filtered out '%s (%pM)' network.\n", -escape_essid(network->ssid, - network->ssid_len), -network->bssid); + netdev_dbg(ieee->dev, "Filtered out '%s (%pM)' network.\n", + escape_essid(network->ssid, network->ssid_len), + network->bssid); return 1; } @@ -2478,33 +2477,32 @@ static inline void rtllib_process_probe_response( if (!network) return; - RTLLIB_DEBUG_SCAN( - "'%s' ( %pM ): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", - escape_essid(info_element->data, info_element->len), - beacon->header.addr3, - (le16_to_cpu(beacon->capability) & (1<<0xf)) ? '1' : '0', - (le16_to_cpu(beacon->capability) & (1<<0xe)) ? '1' : '0', - (le16_to_cpu(beacon->capability) & (1<<0xd)) ? '1' : '0', - (le16_to_cpu(beacon->capability) & (1<<0xc)) ? '1' : '0', - (le16_to_cpu(beacon->capability) & (1<<0xb)) ? '1' : '0', - (le16_to_cpu(beacon->capability) & (1<<0xa)) ? '1' :
[PATCH v3 16/33] staging: rtl8192e: Remove RTLLIB_DEBUG()
- Use netdev_dbg or netdev_vdbg instead of RTLLIB_DEBUG() - Reformat some messages for better readability - Remove RTLLIB_DEBUG messages that make no sense Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl819x_BAProc.c | 35 + drivers/staging/rtl8192e/rtl819x_HTProc.c | 21 ++--- drivers/staging/rtl8192e/rtl819x_TSProc.c | 35 + drivers/staging/rtl8192e/rtllib.h | 5 --- drivers/staging/rtl8192e/rtllib_rx.c | 52 +-- 5 files changed, 67 insertions(+), 81 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 7d72c19..39d28e3 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -84,9 +84,9 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, u8 *tag = NULL; u16 len = ieee->tx_headroom + 9; - RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, -">%s(), frame(%d) sentd to: %pM, ieee->dev:%p\n", -__func__, type, Dst, ieee->dev); + netdev_dbg(ieee->dev, "%s(): frame(%d) sentd to: %pM, ieee->dev:%p\n", + __func__, type, Dst, ieee->dev); + if (pBA == NULL) { netdev_warn(ieee->dev, "pBA is NULL\n"); return NULL; @@ -148,9 +148,8 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, u16 len = 6 + ieee->tx_headroom; if (net_ratelimit()) - RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, -">%s(), ReasonCode(%d) sentd to: %pM\n", -__func__, ReasonCode, dst); + netdev_dbg(ieee->dev, "%s(): ReasonCode(%d) sentd to: %pM\n", + __func__, ReasonCode, dst); memset(, 0, 2); @@ -186,9 +185,6 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, tag += 2; RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len); - if (net_ratelimit()) - RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "<=%s()\n", -__func__); return skb; } @@ -203,8 +199,7 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, RT_TRACE(COMP_DBG, ">to send ADDBAREQ!\n"); softmac_mgmt_xmit(skb, ieee); } else { - RTLLIB_DEBUG(RTLLIB_DL_ERR, -"alloc skb error in function %s()\n", __func__); + netdev_dbg(ieee->dev, "Failed to generate ADDBAReq packet.\n"); } } @@ -217,8 +212,7 @@ static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst, if (skb) softmac_mgmt_xmit(skb, ieee); else - RTLLIB_DEBUG(RTLLIB_DL_ERR, -"alloc skb error in function %s()\n", __func__); + netdev_dbg(ieee->dev, "Failed to generate ADDBARsp packet.\n"); } static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst, @@ -231,8 +225,7 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst, if (skb) softmac_mgmt_xmit(skb, ieee); else - RTLLIB_DEBUG(RTLLIB_DL_ERR, -"alloc skb error in function %s()\n", __func__); + netdev_dbg(ieee->dev, "Failed to generate DELBA packet.\n"); } int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) @@ -374,20 +367,20 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) if (pAdmittedBA->bValid == true) { - RTLLIB_DEBUG(RTLLIB_DL_BA, -"OnADDBARsp(): Recv ADDBA Rsp. Drop because already admit it!\n"); + netdev_dbg(ieee->dev, "%s(): ADDBA response already admitted\n", + __func__); return -1; } else if ((pPendingBA->bValid == false) || (*pDialogToken != pPendingBA->DialogToken)) { netdev_warn(ieee->dev, - "%s(): Recv ADDBA Rsp. BA invalid, DELBA!\n", + "%s(): ADDBA Rsp. BA invalid, DELBA!\n", __func__); ReasonCode = DELBA_REASON_UNKNOWN_BA; goto OnADDBARsp_Reject; } else { - RTLLIB_DEBUG(RTLLIB_DL_BA, -"OnADDBARsp(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n", -*pStatusCode); + netdev_dbg(ieee->dev, + "%s(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n", + __func__, *pStatusCode); DeActivateBAEntry(ieee, pPendingBA); } diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c
[PATCH v3 04/33] staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param()
Move MFIE_TYPE_GENERIC handler to rtllib_parse_mife_generic() function. Code was not altered significantly, therefore in some places it generates LONG_LINE checkpatch.pl warnings. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_rx.c | 364 +-- 1 file changed, 178 insertions(+), 186 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 65e4d13..c286523 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1743,6 +1743,181 @@ static inline void rtllib_extract_country_ie( } +static void rtllib_parse_mife_generic(struct rtllib_device *ieee, + struct rtllib_info_element *info_element, + struct rtllib_network *network, + u16 *tmp_htcap_len, + u16 *tmp_htinfo_len) +{ + u16 ht_realtek_agg_len = 0; + u8 ht_realtek_agg_buf[MAX_IE_LEN]; + + if (!rtllib_parse_qos_info_param_IE(info_element, network)) + return; + + if (info_element->len >= 4 && + info_element->data[0] == 0x00 && info_element->data[1] == 0x50 && + info_element->data[2] == 0xf2 && info_element->data[3] == 0x01) { + network->wpa_ie_len = min(info_element->len + 2, + MAX_WPA_IE_LEN); + memcpy(network->wpa_ie, info_element, network->wpa_ie_len); + return; + } + + if (info_element->len == 7 && info_element->data[0] == 0x00 && + info_element->data[1] == 0xe0 && info_element->data[2] == 0x4c && + info_element->data[3] == 0x01 && info_element->data[4] == 0x02) + network->Turbo_Enable = 1; + + if (*tmp_htcap_len == 0) { + if (info_element->len >= 4 && info_element->data[0] == 0x00 && + info_element->data[1] == 0x90 && + info_element->data[2] == 0x4c && + info_element->data[3] == 0x033) { + *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); + if (*tmp_htcap_len != 0) { + network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; + network->bssht.bdHTCapLen = min_t(u16, *tmp_htcap_len, sizeof(network->bssht.bdHTCapBuf)); + memcpy(network->bssht.bdHTCapBuf, + info_element->data, + network->bssht.bdHTCapLen); + } + } + if (*tmp_htcap_len != 0) { + network->bssht.bdSupportHT = true; + network->bssht.bdHT1R = struct ht_capab_ele *)(network->bssht.bdHTCapBuf))->MCS[1]) == 0); + } else { + network->bssht.bdSupportHT = false; + network->bssht.bdHT1R = false; + } + } + + + if (*tmp_htinfo_len == 0) { + if (info_element->len >= 4 && info_element->data[0] == 0x00 && + info_element->data[1] == 0x90 && + info_element->data[2] == 0x4c && + info_element->data[3] == 0x034) { + *tmp_htinfo_len = min_t(u8, info_element->len, + MAX_IE_LEN); + if (*tmp_htinfo_len != 0) { + network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; + network->bssht.bdHTInfoLen = min_t(u16, *tmp_htinfo_len, sizeof(network->bssht.bdHTInfoBuf)); + memcpy(network->bssht.bdHTInfoBuf, + info_element->data, + network->bssht.bdHTInfoLen); + } + + } + } + + if (ieee->aggregation) { + if (network->bssht.bdSupportHT) { + if (info_element->len >= 4 && + info_element->data[0] == 0x00 && + info_element->data[1] == 0xe0 && + info_element->data[2] == 0x4c && + info_element->data[3] == 0x02) { + ht_realtek_agg_len = min_t(u8, + info_element->len, + MAX_IE_LEN); + memcpy(ht_realtek_agg_buf, info_element->data, + info_element->len); + } + if (ht_realtek_agg_len >= 5) { + network->realtek_cap_exit = true; + network->bssht.bdRT2RTAggregation = true; + + if
[PATCH v3 18/33] staging: rtl8192e: Remove remains of RTLLIB_*_DEBUG() (including proc entry)
Remove rest of rtllib "debug" system - it is no longer used - proper netdev_* functions are used in most cases. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h| 45 -- drivers/staging/rtl8192e/rtllib_module.c | 55 2 files changed, 100 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 0ee0107..8c614e0 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -641,51 +641,6 @@ enum wireless_network_type { #define OUI_SUBTYPE_WMM_PARAM 1 #define OUI_SUBTYPE_QOS_CAPABI 5 -/* debug macros */ -/* To use the debug system; - * - * If you are defining a new debug classification, simply add it to the #define - * list here in the form of: - * - * #define RTLLIB_DL_ VALUE - * - * shifting value to the left one bit from the previous entry. should be - * the name of the classification (for example, WEP) - * - * You then need to either add a RTLLIB__DEBUG() macro definition for your - * classification, or use RTLLIB_DEBUG(RTLLIB_DL_, ...) whenever you want - * to send output to that classification. - * - * To add your debug level to the list of levels seen when you perform - * - * % cat /proc/net/ipw/debug_level - * - * you simply need to add your entry to the ipw_debug_levels array. - */ - -#define RTLLIB_DL_INFO (1<<0) -#define RTLLIB_DL_WX (1<<1) -#define RTLLIB_DL_SCAN (1<<2) -#define RTLLIB_DL_STATE (1<<3) -#define RTLLIB_DL_MGMT (1<<4) -#define RTLLIB_DL_FRAG (1<<5) -#define RTLLIB_DL_EAP (1<<6) -#define RTLLIB_DL_DROP (1<<7) - -#define RTLLIB_DL_TX (1<<8) -#define RTLLIB_DL_RX (1<<9) - -#define RTLLIB_DL_HT (1<<10) -#define RTLLIB_DL_BA (1<<11) -#define RTLLIB_DL_TS (1<<12) -#define RTLLIB_DL_QOS (1<<13) -#define RTLLIB_DL_REORDER (1<<14) -#define RTLLIB_DL_IOT (1<<15) -#define RTLLIB_DL_IPS (1<<16) -#define RTLLIB_DL_TRACE (1<<29) -#define RTLLIB_DL_DATA(1<<30) -#define RTLLIB_DL_ERR (1<<31) - #ifndef ETH_P_PAE #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ #define ETH_P_IP 0x0800 /* Internet Protocol packet */ diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c index b61035b..845d9b8 100644 --- a/drivers/staging/rtl8192e/rtllib_module.c +++ b/drivers/staging/rtl8192e/rtllib_module.c @@ -196,68 +196,13 @@ void free_rtllib(struct net_device *dev) } EXPORT_SYMBOL(free_rtllib); -u32 rtllib_debug_level; -static int debug = RTLLIB_DL_ERR; -static struct proc_dir_entry *rtllib_proc; - -static int show_debug_level(struct seq_file *m, void *v) -{ - seq_printf(m, "0x%08X\n", rtllib_debug_level); - - return 0; -} - -static ssize_t write_debug_level(struct file *file, const char __user *buffer, -size_t count, loff_t *ppos) -{ - unsigned long val; - int err = kstrtoul_from_user(buffer, count, 0, ); - - if (err) - return err; - rtllib_debug_level = val; - return count; -} - -static int open_debug_level(struct inode *inode, struct file *file) -{ - return single_open(file, show_debug_level, NULL); -} - -static const struct file_operations fops = { - .open = open_debug_level, - .read = seq_read, - .llseek = seq_lseek, - .write = write_debug_level, - .release = single_release, -}; - static int __init rtllib_init(void) { - struct proc_dir_entry *e; - - rtllib_debug_level = debug; - rtllib_proc = proc_mkdir(DRV_NAME, init_net.proc_net); - if (rtllib_proc == NULL) { - pr_err("Unable to create " DRV_NAME " proc directory\n"); - return -EIO; - } - e = proc_create("debug_level", S_IRUGO | S_IWUSR, rtllib_proc, ); - if (!e) { - remove_proc_entry(DRV_NAME, init_net.proc_net); - rtllib_proc = NULL; - return -EIO; - } return 0; } static void __exit rtllib_exit(void) { - if (rtllib_proc) { - remove_proc_entry("debug_level", rtllib_proc); - remove_proc_entry(DRV_NAME, init_net.proc_net); - rtllib_proc = NULL; - } } module_init(rtllib_init); -- 1.8.4.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 v3 17/33] staging: rtl8192e: Remove RTLLIB_DEBUG_DATA()
Use print_hex_dump_bytes() if VERBOSE_DEBUG is enabled. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl819x_BAProc.c | 20 drivers/staging/rtl8192e/rtl819x_HTProc.c | 7 +-- drivers/staging/rtl8192e/rtllib.h | 11 --- drivers/staging/rtl8192e/rtllib_tx.c | 5 - 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 39d28e3..25765b8 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -133,7 +133,10 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, tag += 2; } - RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len); +#ifdef VERBOSE_DEBUG + print_hex_dump_bytes("rtllib_ADDBA(): ", DUMP_PREFIX_NONE, skb->data, +skb->len); +#endif return skb; } @@ -184,7 +187,10 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, put_unaligned_le16(ReasonCode, tag); tag += 2; - RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len); +#ifdef VERBOSE_DEBUG + print_hex_dump_bytes("rtllib_DELBA(): ", DUMP_PREFIX_NONE, skb->data, +skb->len); +#endif return skb; } @@ -246,7 +252,10 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) return -1; } - RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len); +#ifdef VERBOSE_DEBUG + print_hex_dump_bytes("rtllib_rx_ADDBAReq(): ", DUMP_PREFIX_NONE, +skb->data, skb->len); +#endif req = (struct rtllib_hdr_3addr *) skb->data; tag = (u8 *)req; @@ -442,7 +451,10 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) return -1; } - RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len); +#ifdef VERBOSE_DEBUG + print_hex_dump_bytes("rtllib_rx_DELBA(): ", DUMP_PREFIX_NONE, skb->data, +skb->len); +#endif delba = (struct rtllib_hdr_3addr *)skb->data; dst = (u8 *)(>addr2[0]); delba += sizeof(struct rtllib_hdr_3addr); diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 584f7a9..3edd5d1 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -553,8 +553,11 @@ void HTOnAssocRsp(struct rtllib_device *ieee) else pPeerHTInfo = (struct ht_info_ele *)(pHTInfo->PeerHTInfoBuf); - RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA | RTLLIB_DL_HT, pPeerHTCap, - sizeof(struct ht_capab_ele)); + +#ifdef VERBOSE_DEBUG + print_hex_dump_bytes("HTOnAssocRsp(): ", DUMP_PREFIX_NONE, +pPeerHTCap, sizeof(struct ht_capab_ele)); +#endif HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth), (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset)); pHTInfo->bCurTxBW40MHz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ? diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index e294234..0ee0107 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -642,17 +642,6 @@ enum wireless_network_type { #define OUI_SUBTYPE_QOS_CAPABI 5 /* debug macros */ -extern u32 rtllib_debug_level; - -#define RTLLIB_DEBUG_DATA(level, data, datalen)\ - do {\ - if ((rtllib_debug_level & (level)) == (level)) {\ - printk(KERN_DEBUG "rtllib: %s()\n", __func__); \ - print_hex_dump_bytes(KERN_DEBUG, DUMP_PREFIX_NONE, \ -data, datalen); \ - } \ - } while (0) - /* To use the debug system; * * If you are defining a new debug classification, simply add it to the #define diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index d0672f0..05cf95c 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -260,7 +260,10 @@ static int rtllib_classify(struct sk_buff *skb, u8 bIsAmsdu) if (eth->h_proto != htons(ETH_P_IP)) return 0; - RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA, skb->data, skb->len); +#ifdef VERBOSE_DEBUG + print_hex_dump_bytes("rtllib_classify(): ", DUMP_PREFIX_NONE, skb->data, +skb->len); +#endif ip = ip_hdr(skb); switch (ip->tos & 0xfc) { case 0x20: -- 1.8.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
[PATCH v3 14/33] staging: rtl8192e: Remove RTLLIB_DEBUG_MGMT()
- Use netdev_dbg() instead of RTLLIB_DEBUG_MGMT() - Remove RTLLIB_DEBUG_MGMT() - Pass net_device to auth_parse(), auth_rq_parse() and assoc_rq_parse() - Remove duplicated messages Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h | 2 - drivers/staging/rtl8192e/rtllib_rx.c | 71 +++ drivers/staging/rtl8192e/rtllib_softmac.c | 50 ++ 3 files changed, 58 insertions(+), 65 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index a9b9cb9..faf94b4 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -703,8 +703,6 @@ do { \ #define RTLLIB_DL_ERR (1<<31) #define RTLLIB_DEBUG_INFO(f, a...) RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a) -#define RTLLIB_DEBUG_MGMT(f, a...) RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a) - #ifndef ETH_P_PAE #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ #define ETH_P_IP 0x0800 /* Internet Protocol packet */ diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 1efdace..1c4eec2 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1925,8 +1925,8 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, if (info_element->len > 4 && info_element->data[0] == 0x00 && info_element->data[1] == 0x50 && info_element->data[2] == 0xf2 && info_element->data[3] == 0x04) { - RTLLIB_DEBUG_MGMT("MFIE_TYPE_WZC: %d bytes\n", - info_element->len); + netdev_dbg(ieee->dev, "MFIE_TYPE_WZC: %d bytes\n", + info_element->len); network->wzc_ie_len = min(info_element->len+2, MAX_WZC_IE_LEN); memcpy(network->wzc_ie, info_element, network->wzc_ie_len); } @@ -1947,10 +1947,10 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, while (length >= sizeof(*info_element)) { if (sizeof(*info_element) + info_element->len > length) { - RTLLIB_DEBUG_MGMT("Info elem: parse failed: info_element->len + 2 > left : info_element->len+2=%zd left=%d, id=%d.\n", -info_element->len + -sizeof(*info_element), -length, info_element->id); + netdev_dbg(ieee->dev, + "Info elem: parse failed: info_element->len + 2 > left : info_element->len+2=%zd left=%d, id=%d.\n", + info_element->len + sizeof(*info_element), + length, info_element->id); /* We stop processing but don't return an error here * because some misbehaviour APs break this rule. ie. * Orinoco AP1000. @@ -1973,8 +1973,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, memset(network->ssid + network->ssid_len, 0, IW_ESSID_MAX_SIZE - network->ssid_len); - RTLLIB_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", -network->ssid, network->ssid_len); + netdev_dbg(ieee->dev, "MFIE_TYPE_SSID: '%s' len=%d.\n", + network->ssid, network->ssid_len); break; case MFIE_TYPE_RATES: @@ -2001,8 +2001,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, } } - RTLLIB_DEBUG_MGMT("MFIE_TYPE_RATES: '%s' (%d)\n", -rates_str, network->rates_len); + netdev_dbg(ieee->dev, "MFIE_TYPE_RATES: '%s' (%d)\n", + rates_str, network->rates_len); break; case MFIE_TYPE_RATES_EX: @@ -2024,22 +2024,22 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, } } - RTLLIB_DEBUG_MGMT("MFIE_TYPE_RATES_EX: '%s' (%d)\n", -rates_str, network->rates_ex_len); + netdev_dbg(ieee->dev, "MFIE_TYPE_RATES_EX: '%s' (%d)\n", + rates_str, network->rates_ex_len); break; case MFIE_TYPE_DS_SET: - RTLLIB_DEBUG_MGMT("MFIE_TYPE_DS_SET: %d\n", -info_element->data[0]); + netdev_dbg(ieee->dev, "MFIE_TYPE_DS_SET: %d\n", + info_element->data[0]);
[PATCH v3 01/33] staging: rtl8192e: Declare ethernet addresses as __aligned(2)
Add __aligned(2) into ethernet addresses allocated on stack or in non-packed structures. Use ETH_ALEN as array length in places where it was hardcoded to 6. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 3 ++- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 +++-- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 7 --- drivers/staging/rtl8192e/rtl819x_Qos.h | 4 ++-- drivers/staging/rtl8192e/rtl819x_TS.h | 2 +- drivers/staging/rtl8192e/rtllib.h | 10 +- drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 3 ++- drivers/staging/rtl8192e/rtllib_rx.c | 6 +- drivers/staging/rtl8192e/rtllib_softmac.c | 8 drivers/staging/rtl8192e/rtllib_tx.c | 3 ++- 10 files changed, 30 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index aad5cc9..a3fbbb9 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -321,7 +321,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) u8 ICVer8192, ICVer8256; u16 i, usValue, IC_Version; u16 EEPROMId; - u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01}; + u8 bMac_Tmp_Addr[ETH_ALEN] __aligned(2) = {0x00, 0xe0, 0x4c, + 0x00, 0x00, 0x01}; RT_TRACE(COMP_INIT, "> rtl8192_read_eeprom_info\n"); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 47b5aad..bcf3b46 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -2573,8 +2573,9 @@ static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) int ret = -1; struct rtllib_device *ieee = priv->rtllib; u32 key[4]; - u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - u8 zero_addr[6] = {0}; + u8 broadcast_addr[ETH_ALEN] __aligned(2) = {0xff, 0xff, 0xff, + 0xff, 0xff, 0xff}; + u8 zero_addr[ETH_ALEN] __aligned(2) = {0}; struct iw_point *p = >u.data; struct ieee_param *ipw = NULL; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 8d6a109..5aa6c57 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -193,7 +193,7 @@ static int r8192_wx_force_mic_error(struct net_device *dev, #define MAX_ADHOC_PEER_NUM 64 struct adhoc_peer_entry { - unsigned char MacAddr[ETH_ALEN]; + unsigned char MacAddr[ETH_ALEN] __aligned(2); unsigned char WirelessMode; unsigned char bCurTxBW40MHz; }; @@ -987,8 +987,9 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ret = rtllib_wx_set_encode_ext(ieee, info, wrqu, extra); { - u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - u8 zero[6] = {0}; + u8 broadcast_addr[ETH_ALEN] __aligned(2) = {0xff, 0xff, 0xff, + 0xff, 0xff, 0xff}; + u8 zero[ETH_ALEN] __aligned(2) = {0}; u32 key[4] = {0}; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct iw_point *encoding = >encoding; diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h index 55ef7ec..4bdb176 100644 --- a/drivers/staging/rtl8192e/rtl819x_Qos.h +++ b/drivers/staging/rtl8192e/rtl819x_Qos.h @@ -255,8 +255,8 @@ union qos_tclas { u8 Priority; u8 ClassifierType; u8 Mask; - u8 SrcAddr[6]; - u8 DstAddr[6]; + u8 SrcAddr[ETH_ALEN] __aligned(2); + u8 DstAddr[ETH_ALEN] __aligned(2); u16 Type; } TYPE0_ETH; diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h index 8601b1a..28c91fb 100644 --- a/drivers/staging/rtl8192e/rtl819x_TS.h +++ b/drivers/staging/rtl8192e/rtl819x_TS.h @@ -35,7 +35,7 @@ struct ts_common_info { struct list_headList; struct timer_list SetupTimer; struct timer_list InactTimer; - u8 Addr[6]; + u8 Addr[ETH_ALEN] __aligned(2); union tspec_body TSpec; union qos_tclas TClass[TCLAS_NUM]; u8 TClasProc; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index bfec4fd..3674c8b 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++
[PATCH v3 12/33] staging: rtl8192e: Remove RTLLIB_DEBUG_(FRAG|EAP|DROP|STATE|TX|RX)()
Use netdev_dbg() instead. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h| 6 drivers/staging/rtl8192e/rtllib_rx.c | 58 drivers/staging/rtl8192e/rtllib_tx.c | 5 ++-- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index f7b741e..12a4b1f 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -703,13 +703,7 @@ do { \ #define RTLLIB_DL_ERR (1<<31) #define RTLLIB_DEBUG_INFO(f, a...) RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a) -#define RTLLIB_DEBUG_STATE(f, a...) RTLLIB_DEBUG(RTLLIB_DL_STATE, f, ## a) #define RTLLIB_DEBUG_MGMT(f, a...) RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a) -#define RTLLIB_DEBUG_FRAG(f, a...) RTLLIB_DEBUG(RTLLIB_DL_FRAG, f, ## a) -#define RTLLIB_DEBUG_EAP(f, a...) RTLLIB_DEBUG(RTLLIB_DL_EAP, f, ## a) -#define RTLLIB_DEBUG_DROP(f, a...) RTLLIB_DEBUG(RTLLIB_DL_DROP, f, ## a) -#define RTLLIB_DEBUG_TX(f, a...) RTLLIB_DEBUG(RTLLIB_DL_TX, f, ## a) -#define RTLLIB_DEBUG_RX(f, a...) RTLLIB_DEBUG(RTLLIB_DL_RX, f, ## a) #define RTLLIB_DEBUG_QOS(f, a...) RTLLIB_DEBUG(RTLLIB_DL_QOS, f, ## a) #ifndef ETH_P_PAE diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 9b57c7e..edd0a86 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -69,9 +69,9 @@ rtllib_frag_cache_find(struct rtllib_device *ieee, unsigned int seq, entry = >frag_cache[tid][i]; if (entry->skb != NULL && time_after(jiffies, entry->first_frag_time + 2 * HZ)) { - RTLLIB_DEBUG_FRAG( - "expiring fragment cache entry seq=%u last_frag=%u\n", - entry->seq, entry->last_frag); + netdev_dbg(ieee->dev, + "expiring fragment cache entry seq=%u last_frag=%u\n", + entry->seq, entry->last_frag); dev_kfree_skb_any(entry->skb); entry->skb = NULL; } @@ -187,8 +187,9 @@ static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee, hdr->addr1); if (entry == NULL) { - RTLLIB_DEBUG_FRAG( - "could not invalidate fragment cache entry (seq=%u)\n", seq); + netdev_dbg(ieee->dev, + "Couldn't invalidate fragment cache entry (seq=%u)\n", + seq); return -1; } @@ -305,11 +306,12 @@ rtllib_rx_frame_decrypt(struct rtllib_device *ieee, struct sk_buff *skb, res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); atomic_dec(>refcnt); if (res < 0) { - RTLLIB_DEBUG_DROP( - "decryption failed (SA= %pM) res=%d\n", hdr->addr2, res); + netdev_dbg(ieee->dev, "decryption failed (SA= %pM) res=%d\n", + hdr->addr2, res); if (res == -2) - RTLLIB_DEBUG_DROP("Decryption failed ICV mismatch (key %d)\n", -skb->data[hdrlen + 3] >> 6); + netdev_dbg(ieee->dev, + "Decryption failed ICV mismatch (key %d)\n", + skb->data[hdrlen + 3] >> 6); ieee->ieee_stats.rx_discards_undecryptable++; return -1; } @@ -844,7 +846,8 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb, sub_skb->dev = ieee->dev; rxb->subframes[rxb->nr_subframes++] = sub_skb; if (rxb->nr_subframes >= MAX_SUBFRAME_COUNT) { - RTLLIB_DEBUG_RX("ParseSubframe(): Too many Subframes! Packets dropped!\n"); + netdev_dbg(ieee->dev, + "ParseSubframe(): Too many Subframes! Packets dropped!\n"); break; } skb_pull(skb, nSubframe_Length); @@ -995,9 +998,9 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc, stype != RTLLIB_STYPE_DATA_CFACKPOLL && stype != RTLLIB_STYPE_QOS_DATA) { if (stype != RTLLIB_STYPE_NULLFUNC) - RTLLIB_DEBUG_DROP( - "RX: dropped data frame with no data (type=0x%02x, subtype=0x%02x)\n", - type, stype); + netdev_dbg(ieee->dev, + "RX: dropped data frame with no data (type=0x%02x, subtype=0x%02x)\n", +
[PATCH v3 19/33] staging: rtl8192e: Remove assert() macro
Assert macro printed warning message (and was used once). Remove it, and add netdev_warn() in place where it was called. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 +++-- drivers/staging/rtl8192e/rtllib_debug.h | 8 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index bcf3b46..36c150d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1885,8 +1885,9 @@ void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, return; } - assert(queue_index != TXCMD_QUEUE); - + if (queue_index != TXCMD_QUEUE) + netdev_warn(dev, "%s(): queue index != TXCMD_QUEUE\n", + __func__); memcpy((unsigned char *)(skb->cb), , sizeof(dev)); skb_push(skb, priv->rtllib->tx_headroom); diff --git a/drivers/staging/rtl8192e/rtllib_debug.h b/drivers/staging/rtl8192e/rtllib_debug.h index 6df8df1..42e88d6 100644 --- a/drivers/staging/rtl8192e/rtllib_debug.h +++ b/drivers/staging/rtl8192e/rtllib_debug.h @@ -76,12 +76,4 @@ do { \ printk(KERN_DEBUG DRV_NAME ":" x "\n", ##args);\ } while (0) -#define assert(expr) \ -do { \ - if (!(expr)) {\ - pr_info("Assertion failed! %s,%s,%s,line=%d\n", \ - #expr, __FILE__, __func__, __LINE__); \ - } \ -} while (0) - #endif -- 1.8.4.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 v3 20/33] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
Fix most of remaining PREFER_PR_LEVEL warnings in rtllib. Replace printk() with netdev_* if possible, pr_* in other cases. All pr_* use __func__ to easily trace message back to rtllib Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +- drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 63 drivers/staging/rtl8192e/rtllib_rx.c | 5 ++- 3 files changed, 31 insertions(+), 39 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c index 7d486e8..3b596b2 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c @@ -69,7 +69,7 @@ static void *rtllib_ccmp_init(int key_idx) priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(priv->tfm)) { - pr_debug("rtllib_crypt_ccmp: could not allocate crypto API aes\n"); + pr_debug("%s(): could not allocate crypto API aes\n", __func__); priv->tfm = NULL; goto fail; } diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c index 9ec2b48..d4882a3 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c @@ -68,8 +68,8 @@ static void *rtllib_tkip_init(int key_idx) priv->tx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(priv->tx_tfm_arc4)) { - printk(KERN_DEBUG - "rtllib_crypt_tkip: could not allocate crypto API arc4\n"); + pr_debug("%s(): could not allocate crypto API arc4\n", +__func__); priv->tx_tfm_arc4 = NULL; goto fail; } @@ -77,8 +77,8 @@ static void *rtllib_tkip_init(int key_idx) priv->tx_tfm_michael = crypto_alloc_hash("michael_mic", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(priv->tx_tfm_michael)) { - printk(KERN_DEBUG - "rtllib_crypt_tkip: could not allocate crypto API michael_mic\n"); + pr_debug("%s(): could not allocate crypto API michael_mic\n", +__func__); priv->tx_tfm_michael = NULL; goto fail; } @@ -86,8 +86,8 @@ static void *rtllib_tkip_init(int key_idx) priv->rx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(priv->rx_tfm_arc4)) { - printk(KERN_DEBUG - "rtllib_crypt_tkip: could not allocate crypto API arc4\n"); + pr_debug("%s(): could not allocate crypto API arc4\n", +__func__); priv->rx_tfm_arc4 = NULL; goto fail; } @@ -95,8 +95,8 @@ static void *rtllib_tkip_init(int key_idx) priv->rx_tfm_michael = crypto_alloc_hash("michael_mic", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(priv->rx_tfm_michael)) { - printk(KERN_DEBUG - "rtllib_crypt_tkip: could not allocate crypto API michael_mic\n"); + pr_debug("%s: could not allocate crypto API michael_mic\n", +__func__); priv->rx_tfm_michael = NULL; goto fail; } @@ -403,24 +403,21 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) keyidx = pos[3]; if (!(keyidx & (1 << 5))) { if (net_ratelimit()) { - printk(KERN_DEBUG - "TKIP: received packet without ExtIV flag from %pM\n", - hdr->addr2); + pr_debug("%s(): received packet without ExtIV flag from %pM\n", +__func__, hdr->addr2); } return -2; } keyidx >>= 6; if (tkey->key_idx != keyidx) { - printk(KERN_DEBUG - "TKIP: RX tkey->key_idx=%d frame keyidx=%d priv=%p\n", - tkey->key_idx, keyidx, priv); + pr_debug("%s(): RX tkey->key_idx=%d frame keyidx=%d priv=%p\n", +__func__, tkey->key_idx, keyidx, priv); return -6; } if (!tkey->key_set) { if (net_ratelimit()) { - printk(KERN_DEBUG - "TKIP: received packet from %pM with keyid=%d that does not have a configured key\n", - hdr->addr2, keyidx); + pr_debug("%s(): received packet from %pM with keyid=%d that does not have a configured key\n", +__func__, hdr->addr2, keyidx); } return -3; } @@ -433,10 +430,9 @@ static int
[PATCH v3 28/33] staging: rtl8192e: Replace ?: with max
Warninig is printed if precision is lost - it can't happen at moment as all get_key implementations return either -1 or small buffers. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_wx.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 2ac1617..22bea5a 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -510,7 +510,10 @@ int rtllib_wx_get_encode(struct rtllib_device *ieee, return 0; } len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv); - erq->length = (len >= 0 ? len : 0); + if (len > U16_MAX) + netdev_err(ieee->dev, "Too long key returned.\n"); + + erq->length = max(len, 0); erq->flags |= IW_ENCODE_ENABLED; -- 1.8.4.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 v3 27/33] staging: rtl8192e: Replace ?: with min_t
Replace :? with min_t for readability. Remove check that is always false. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 8 +--- drivers/staging/rtl8192e/rtllib_wx.c | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index d5e13a5..86f52ac7 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -454,13 +454,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, proto_started = ieee->proto_started; - len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length : - IW_ESSID_MAX_SIZE; - - if (len > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; - goto out; - } + len = min_t(__u16, wrqu->essid.length, IW_ESSID_MAX_SIZE); if (ieee->iw_mode == IW_MODE_MONITOR) { ret = -1; diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 2812a77..2ac1617 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -851,8 +851,7 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len) if ((eid == MFIE_TYPE_GENERIC) && (!memcmp([2], wps_oui, 4))) { - ieee->wps_ie_len = (len < MAX_WZC_IE_LEN) ? (len) : - (MAX_WZC_IE_LEN); + ieee->wps_ie_len = min_t(size_t, len, MAX_WZC_IE_LEN); buf = kmemdup(ie, ieee->wps_ie_len, GFP_KERNEL); if (buf == NULL) return -ENOMEM; -- 1.8.4.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 v3 21/33] staging: rtl8192e: Fix LONG_LINE warnings
Fix most of simple LONG_LINE warnings. None of the changes should affect behaviour of code, so several modifications are included in this patch: - Code is reindented where needed - Local variable names are compacted (priv -> p) - Unnecessary casts are removed - Nested ifs are replaced with logical and - a = b = c = d expressions are split - Replace if/then series with clamp_t() - Removed unneeded scopes Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/dot11d.h | 4 +- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 22 +-- .../staging/rtl8192e/rtl8192e/r8192E_firmware.c| 29 ++-- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 4 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 191 + drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 3 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 3 +- drivers/staging/rtl8192e/rtl819x_TSProc.c | 21 ++- drivers/staging/rtl8192e/rtllib_rx.c | 171 +++--- drivers/staging/rtl8192e/rtllib_softmac.c | 36 ++-- drivers/staging/rtl8192e/rtllib_tx.c | 41 ++--- 12 files changed, 314 insertions(+), 214 deletions(-) diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h index aad3394..69e0f8f 100644 --- a/drivers/staging/rtl8192e/dot11d.h +++ b/drivers/staging/rtl8192e/dot11d.h @@ -74,8 +74,8 @@ static inline void cpMacAddr(unsigned char *des, unsigned char *src) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa)\ - ether_addr_equal_unaligned(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, \ - __pTa) +ether_addr_equal_unaligned( \ + GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \ cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index eb803dc..dd42097 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -30,7 +30,8 @@ #include "rtl_dm.h" #include "rtl_wx.h" -static int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI, EDCAPARA_VO}; +static int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI, +EDCAPARA_VO}; void rtl8192e_start_beacon(struct net_device *dev) { @@ -187,22 +188,21 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 variable, u8 *val) u8 u1bAIFS; u32 u4bAcParam; u8 mode = priv->rtllib->mode; - struct rtllib_qos_parameters *qos_parameters = + struct rtllib_qos_parameters *qop = >rtllib->current_network.qos_data.parameters; - u1bAIFS = qos_parameters->aifs[pAcParam] * + u1bAIFS = qop->aifs[pAcParam] * ((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime; dm_init_edca_turbo(dev); - u4bAcParam = (((le16_to_cpu( - qos_parameters->tx_op_limit[pAcParam])) << -AC_PARAM_TXOP_LIMIT_OFFSET) | -((le16_to_cpu(qos_parameters->cw_max[pAcParam])) << -AC_PARAM_ECW_MAX_OFFSET) | -((le16_to_cpu(qos_parameters->cw_min[pAcParam])) << -AC_PARAM_ECW_MIN_OFFSET) | -(((u32)u1bAIFS) << AC_PARAM_AIFS_OFFSET)); + u4bAcParam = (le16_to_cpu(qop->tx_op_limit[pAcParam]) << + AC_PARAM_TXOP_LIMIT_OFFSET) | + ((le16_to_cpu(qop->cw_max[pAcParam])) << +AC_PARAM_ECW_MAX_OFFSET) | + ((le16_to_cpu(qop->cw_min[pAcParam])) << +AC_PARAM_ECW_MIN_OFFSET) | + (((u32)u1bAIFS) << AC_PARAM_AIFS_OFFSET); RT_TRACE(COMP_DBG, "%s():HW_VAR_AC_PARAM eACI:%x:%x\n", __func__, eACI, u4bAcParam); diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c index c465f87..02c5b0a 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c @@ -230,7 +230,7 @@ bool init_firmware(struct net_device *dev) u32 file_length = 0; u8 *mapped_file = NULL; - u8 init_step = 0; + u8 i = 0; enum opt_rst_type rst_opt = OPT_SYSTEM_RESET; enum firmware_init_step starting_state = FW_INIT_STEP0_BOOT; @@ -250,10 +250,9 @@ bool init_firmware(struct net_device *dev)
[PATCH v3 31/33] staging: rtl8192e: Replace RT_TRACE(COMP_ERR, ...) with netdev_*
- Use netdev_* with log level depending on how serious error is - Rework some messages to be more readable - Pass net_device where needed for pretty prints Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c | 24 +++-- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 31 --- .../staging/rtl8192e/rtl8192e/r8192E_firmware.c| 13 +-- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 100 ++--- drivers/staging/rtl8192e/rtl8192e/rtl_cam.c| 18 ++-- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 65 ++ drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 4 +- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 14 ++- 8 files changed, 127 insertions(+), 142 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c index f080a91..facc6f1 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c @@ -47,8 +47,8 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev, 0x0e, bMask12Bits, 0x021); } else { - RT_TRACE(COMP_ERR, -"PHY_SetRF8256Bandwidth(): unknown hardware version\n"); + netdev_warn(dev, "%s(): Unknown HW version.\n", + __func__); } break; @@ -66,16 +66,15 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev, 0x0e, bMask12Bits, 0x0e1); } else { - RT_TRACE(COMP_ERR, -"PHY_SetRF8256Bandwidth(): unknown hardware version\n"); + netdev_warn(dev, "%s(): Unknown HW version.\n", + __func__); } break; default: - RT_TRACE(COMP_ERR, -"PHY_SetRF8256Bandwidth(): unknown Bandwidth: %#X\n", -Bandwidth); + netdev_err(dev, "%s(): Unknown bandwidth: %#X\n", + __func__, Bandwidth); break; } @@ -139,9 +138,8 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev) rtStatus = rtl8192_phy_checkBBAndRF(dev, HW90_BLOCK_RF, (enum rf90_radio_path)eRFPath); if (!rtStatus) { - RT_TRACE(COMP_ERR, -"PHY_RF8256_Config():Check Radio[%d] Fail!!\n", -eRFPath); + netdev_err(dev, "%s(): Failed to check RF Path %d.\n", + __func__, eRFPath); goto phy_RF8256_Config_ParaFile_Fail; } @@ -227,9 +225,9 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev) } if (ret) { - RT_TRACE(COMP_ERR, -"phy_RF8256_Config_ParaFile():Radio[%d] Fail!!", -eRFPath); + netdev_err(dev, + "%s(): Failed to initialize RF Path %d.\n", + __func__, eRFPath); goto phy_RF8256_Config_ParaFile_Fail; } diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index dd42097..fc58dfe 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -328,8 +328,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) EEPROMId = eprom_read(dev, 0); if (EEPROMId != RTL8190_EEPROM_ID) { - RT_TRACE(COMP_ERR, "EEPROM ID is invalid:%x, %x\n", -EEPROMId, RTL8190_EEPROM_ID); + netdev_err(dev, "%s(): Invalid EEPROM ID: %x\n", __func__, + EEPROMId); priv->AutoloadFailFlag = true; } else { priv->AutoloadFailFlag = false; @@ -738,9 +738,8 @@ start: else if (priv->pFirmware->firmware_status == FW_STATUS_5_READY) ulRegRead |= CPU_GEN_FIRMWARE_RESET; else - RT_TRACE(COMP_ERR, -"ERROR in %s(): undefined firmware state(%d)\n", -__func__, priv->pFirmware->firmware_status); + netdev_err(dev, "%s(): undefined firmware state: %d.\n", + __func__, priv->pFirmware->firmware_status); write_nic_dword(dev, CPU_GEN, ulRegRead); @@ -756,7 +755,7 @@
[PATCH v3 29/33] staging: rtl8192e: Remove unneeded RT_TRACE(COMP_ERR,...)
This messages are not needed, as failure is reported earlier in code. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c | 1 - drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c index 01d2201..f080a91 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c @@ -239,7 +239,6 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev) return true; phy_RF8256_Config_ParaFile_Fail: - RT_TRACE(COMP_ERR, "PHY Initialization failed\n"); return false; } diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c index 02c5b0a..54e430e 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c @@ -171,7 +171,6 @@ static bool CPUcheck_firmware_ready(struct net_device *dev) return rt_status; CPUCheckFirmwareReady_Fail: - RT_TRACE(COMP_ERR, "ERR in %s()\n", __func__); rt_status = false; return rt_status; -- 1.8.4.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 v3 13/33] staging: rtl8192e: Remove RTLLIB_DEBUG_QOS()
- Pass extra argument (rtllib_device) to rtllib_parse_qos_info_param_IE() and update_network() - Replace RTLLIB_DEBUG_QOS() with netdev_dbg() - Remove RTLLIB_DEBUG_QOS() Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h| 1 - drivers/staging/rtl8192e/rtllib_rx.c | 26 ++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 12a4b1f..a9b9cb9 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -704,7 +704,6 @@ do { \ #define RTLLIB_DEBUG_INFO(f, a...) RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a) #define RTLLIB_DEBUG_MGMT(f, a...) RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a) -#define RTLLIB_DEBUG_QOS(f, a...) RTLLIB_DEBUG(RTLLIB_DL_QOS, f, ## a) #ifndef ETH_P_PAE #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index edd0a86..1efdace 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1661,9 +1661,10 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info * parameters element. check the information element length to decide * which type to read */ -static int rtllib_parse_qos_info_param_IE(struct rtllib_info_element +static int rtllib_parse_qos_info_param_IE(struct rtllib_device *ieee, + struct rtllib_info_element *info_element, -struct rtllib_network *network) + struct rtllib_network *network) { int rc = 0; struct rtllib_qos_information_element qos_info_element; @@ -1688,7 +1689,7 @@ static int rtllib_parse_qos_info_param_IE(struct rtllib_info_element } if (rc == 0) { - RTLLIB_DEBUG_QOS("QoS is supported\n"); + netdev_dbg(ieee->dev, "QoS is supported\n"); network->qos_data.supported = 1; } return rc; @@ -1765,7 +1766,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, u16 ht_realtek_agg_len = 0; u8 ht_realtek_agg_buf[MAX_IE_LEN]; - if (!rtllib_parse_qos_info_param_IE(info_element, network)) + if (!rtllib_parse_qos_info_param_IE(ieee, info_element, network)) return; if (info_element->len >= 4 && @@ -2325,7 +2326,8 @@ static inline int is_same_network(struct rtllib_network *src, } -static inline void update_network(struct rtllib_network *dst, +static inline void update_network(struct rtllib_device *ieee, + struct rtllib_network *dst, struct rtllib_network *src) { int qos_active; @@ -2399,12 +2401,12 @@ static inline void update_network(struct rtllib_network *dst, sizeof(struct rtllib_qos_data)); if (dst->qos_data.supported == 1) { if (dst->ssid_len) - RTLLIB_DEBUG_QOS - ("QoS the network %s is QoS supported\n", - dst->ssid); + netdev_dbg(ieee->dev, + "QoS the network %s is QoS supported\n", + dst->ssid); else - RTLLIB_DEBUG_QOS - ("QoS the network is QoS supported\n"); + netdev_dbg(ieee->dev, + "QoS the network is QoS supported\n"); } dst->qos_data.active = qos_active; dst->qos_data.old_param_count = old_param; @@ -2540,7 +2542,7 @@ static inline void rtllib_process_probe_response( spin_lock_irqsave(>lock, flags); if (is_same_network(>current_network, network, (network->ssid_len ? 1 : 0))) { - update_network(>current_network, network); + update_network(ieee, >current_network, network); if ((ieee->current_network.mode == IEEE_N_24G || ieee->current_network.mode == IEEE_G) && ieee->current_network.berp_info_valid) { @@ -2610,7 +2612,7 @@ static inline void rtllib_process_probe_response( network->ssid_len) == 0) && (ieee->state == RTLLIB_NOLINK renew = 1; - update_network(target, network); + update_network(ieee, target, network); if (renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)) rtllib_softmac_new_net(ieee, network); } -- 1.8.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
[PATCH v3 32/33] staging: rtl8192e: Fix trivial LONG_LINE errors
Reindent lines to make checkpatch happy. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 83 +++--- drivers/staging/rtl8192e/rtllib_rx.c | 18 --- 2 files changed, 65 insertions(+), 36 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index a921857..d480229 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -403,16 +403,16 @@ static void dm_check_rate_adaptive(struct net_device *dev) ((bshort_gi_enabled) ? BIT31 : 0); if (pra->ratr_state == DM_RATR_STA_HIGH) { - HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ? + HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; + LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ? (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); } else if (pra->ratr_state == DM_RATR_STA_LOW) { - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ? + HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; + LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ? (pra->low2high_rssi_thresh_for_ra40M) : (pra->low2high_rssi_thresh_for_ra20M); } else { - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ? + HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; + LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ? (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); } @@ -749,7 +749,8 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) "Avg_TSSI_Meas_from_driver = %d\n", Avg_TSSI_Meas_from_driver); TSSI_13dBm = priv->TSSI_13dBm; - RT_TRACE(COMP_POWER_TRACKING, "TSSI_13dBm = %d\n", TSSI_13dBm); + RT_TRACE(COMP_POWER_TRACKING, "TSSI_13dBm = %d\n", +TSSI_13dBm); if (Avg_TSSI_Meas_from_driver > TSSI_13dBm) delta = Avg_TSSI_Meas_from_driver - TSSI_13dBm; @@ -828,11 +829,13 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) "priv->CCKPresentAttentuation = %d\n", priv->CCKPresentAttentuation); - if (priv->CCKPresentAttentuation_difference <= -12 || priv->CCKPresentAttentuation_difference >= 24) { + if (priv->CCKPresentAttentuation_difference <= -12 || + priv->CCKPresentAttentuation_difference >= 24) { priv->rtllib->bdynamic_txpower_enable = true; write_nic_byte(dev, Pw_Track_Flag, 0); write_nic_byte(dev, FW_Busy_Flag, 0); - RT_TRACE(COMP_POWER_TRACKING, "tx power track--->limited\n"); + RT_TRACE(COMP_POWER_TRACKING, +"tx power track--->limited\n"); return; } @@ -1233,18 +1236,28 @@ static void dm_bb_initialgain_restore(struct net_device *dev) return; rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8); - rtl8192_setBBreg(dev, rOFDM0_XAAGCCore1, bit_mask, (u32)priv->initgain_backup.xaagccore1); - rtl8192_setBBreg(dev, rOFDM0_XBAGCCore1, bit_mask, (u32)priv->initgain_backup.xbagccore1); - rtl8192_setBBreg(dev, rOFDM0_XCAGCCore1, bit_mask, (u32)priv->initgain_backup.xcagccore1); - rtl8192_setBBreg(dev, rOFDM0_XDAGCCore1, bit_mask, (u32)priv->initgain_backup.xdagccore1); + rtl8192_setBBreg(dev, rOFDM0_XAAGCCore1, bit_mask, +(u32)priv->initgain_backup.xaagccore1); + rtl8192_setBBreg(dev, rOFDM0_XBAGCCore1, bit_mask, +(u32)priv->initgain_backup.xbagccore1); + rtl8192_setBBreg(dev, rOFDM0_XCAGCCore1, bit_mask, +(u32)priv->initgain_backup.xcagccore1); + rtl8192_setBBreg(dev, rOFDM0_XDAGCCore1, bit_mask, +(u32)priv->initgain_backup.xdagccore1); bit_mask = bMaskByte2; -
[PATCH v3 33/33] staging: rtl8192e: rtl8192E_suspend(): Fix WOL reporting
WOL capability was reported in an awkward way - print it nicely. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/rtl_pm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c index ca6ecfc..e4908672 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c @@ -57,10 +57,8 @@ int rtl8192E_suspend(struct pci_dev *pdev, pm_message_t state) write_nic_byte(dev, MacBlkCtrl, 0xa); } out_pci_suspend: - netdev_info(dev, "r8192E support WOL call??\n"); - if (priv->rtllib->bSupportRemoteWakeUp) - RT_TRACE(COMP_POWER, -"r8192E support WOL call!!.\n"); + netdev_info(dev, "WOL is %s\n", priv->rtllib->bSupportRemoteWakeUp ? + "Supported" : "Not supported"); pci_save_state(pdev); pci_disable_device(pdev); pci_enable_wake(pdev, pci_choose_state(pdev, state), -- 1.8.4.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 v3 30/33] staging: rtl8192e: rtl8192_phy_checkBBAndRF(): Don't check MAC
This function never supported checking of MAC block. Instead of printing several warnings - print it once and exit. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 0765c97..6c4832c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -504,13 +504,15 @@ bool rtl8192_phy_checkBBAndRF(struct net_device *dev, WriteAddr[HW90_BLOCK_RF] = 0x3; RT_TRACE(COMP_PHY, "===>%s(), CheckBlock:%d\n", __func__, CheckBlock); + + if (CheckBlock == HW90_BLOCK_MAC) { + netdev_warn(dev, "%s(): No checks available for MAC block.\n", + __func__); + return ret; + } + for (i = 0; i < CheckTimes; i++) { switch (CheckBlock) { - case HW90_BLOCK_MAC: - RT_TRACE(COMP_ERR, -"PHY_CheckBBRFOK(): Never Write 0x100 here!"); - break; - case HW90_BLOCK_PHY0: case HW90_BLOCK_PHY1: write_nic_dword(dev, WriteAddr[CheckBlock], -- 1.8.4.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 v3 24/33] staging: rtl8192e: Fix OOM_MESSAGE warnings
Remove alloc failed messages where not needed to make checkpatch.pl happy. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl819x_BAProc.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 25765b8..60f536c 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -92,10 +92,8 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, return NULL; } skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) { - netdev_err(ieee->dev, "Can't alloc skb for ADDBA_REQ\n"); + if (skb == NULL) return NULL; - } memset(skb->data, 0, sizeof(struct rtllib_hdr_3addr)); @@ -160,10 +158,8 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, DelbaParamSet.field.TID = pBA->BaParamSet.field.TID; skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) { - netdev_err(ieee->dev, "Can't alloc skb for DELBA_REQ\n"); + if (skb == NULL) return NULL; - } skb_reserve(skb, ieee->tx_headroom); -- 1.8.4.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 v3 22/33] staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param()
Take out MIFE_TYPE_HT_CAP processing into separate function - rtllib_parse_mfie_ht_cap() Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_rx.c | 49 +--- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 0843027..2b337c4 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1984,6 +1984,33 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, } } +static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, +struct rtllib_network *network, +u16 *tmp_htcap_len) +{ + struct bss_ht *ht = >bssht; + + *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); + if (*tmp_htcap_len != 0) { + ht->bdHTSpecVer = HT_SPEC_VER_EWC; + ht->bdHTCapLen = min_t(u16, *tmp_htcap_len, + sizeof(ht->bdHTCapBuf)); + memcpy(ht->bdHTCapBuf, info_element->data, ht->bdHTCapLen); + + ht->bdSupportHT = true; + ht->bdHT1R = struct ht_capab_ele *) + ht->bdHTCapBuf))->MCS[1]) == 0; + + ht->bdBandWidth = (enum ht_channel_width) +(((struct ht_capab_ele *) +(ht->bdHTCapBuf))->ChlWidth); + } else { + ht->bdSupportHT = false; + ht->bdHT1R = false; + ht->bdBandWidth = HT_CHANNEL_WIDTH_20; + } +} + int rtllib_parse_info_param(struct rtllib_device *ieee, struct rtllib_info_element *info_element, u16 length, @@ -2165,27 +2192,9 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, case MFIE_TYPE_HT_CAP: netdev_dbg(ieee->dev, "MFIE_TYPE_HT_CAP: %d bytes\n", info_element->len); - tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); - if (tmp_htcap_len != 0) { - network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; - network->bssht.bdHTCapLen = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf) ? - sizeof(network->bssht.bdHTCapBuf) : tmp_htcap_len; - memcpy(network->bssht.bdHTCapBuf, - info_element->data, - network->bssht.bdHTCapLen); - network->bssht.bdSupportHT = true; - network->bssht.bdHT1R = struct ht_capab_ele *) - network->bssht.bdHTCapBuf))->MCS[1]) == 0; - - network->bssht.bdBandWidth = (enum ht_channel_width) -(((struct ht_capab_ele *) - (network->bssht.bdHTCapBuf))->ChlWidth); - } else { - network->bssht.bdSupportHT = false; - network->bssht.bdHT1R = false; - network->bssht.bdBandWidth = HT_CHANNEL_WIDTH_20; - } + rtllib_parse_mfie_ht_cap(info_element, network, +_htcap_len); break; -- 1.8.4.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 v3 25/33] staging: rtl8192e: Remove unused rtl_crypto.h
This header is not used - remove it to make driver code smaller. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h | 382 - 1 file changed, 382 deletions(-) delete mode 100644 drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h b/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h deleted file mode 100644 index ee57c0f..000 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Scatterlist Cryptographic API. - * - * Copyright (c) 2002 James Morris - * Copyright (c) 2002 David S. Miller (da...@redhat.com) - * - * Portions derived from Cryptoapi, by Alexander Kjeldaas - * and Nettle, by Niels M鰈ler. - * - * 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 the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - */ -#ifndef _LINUX_CRYPTO_H -#define _LINUX_CRYPTO_H - -#include -#include -#include -#include -#include -#include -#include - -#define crypto_register_alg crypto_register_alg_rsl -#define crypto_unregister_alg crypto_unregister_alg_rsl -#define crypto_alloc_tfm crypto_alloc_tfm_rsl -#define crypto_free_tfm crypto_free_tfm_rsl -#define crypto_alg_available crypto_alg_available_rsl - -/* - * Algorithm masks and types. - */ -#define CRYPTO_ALG_TYPE_MASK 0x00ff -#define CRYPTO_ALG_TYPE_CIPHER 0x0001 -#define CRYPTO_ALG_TYPE_DIGEST 0x0002 -#define CRYPTO_ALG_TYPE_COMPRESS 0x0004 - -/* - * Transform masks and values (for crt_flags). - */ -#define CRYPTO_TFM_MODE_MASK 0x00ff -#define CRYPTO_TFM_REQ_MASK0x000fff00 -#define CRYPTO_TFM_RES_MASK0xfff0 - -#define CRYPTO_TFM_MODE_ECB0x0001 -#define CRYPTO_TFM_MODE_CBC0x0002 -#define CRYPTO_TFM_MODE_CFB0x0004 -#define CRYPTO_TFM_MODE_CTR0x0008 - -#define CRYPTO_TFM_REQ_WEAK_KEY0x0100 -#define CRYPTO_TFM_RES_WEAK_KEY0x0010 -#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x0020 -#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x0040 -#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x0080 -#define CRYPTO_TFM_RES_BAD_FLAGS 0x0100 - -/* - * Miscellaneous stuff. - */ -#define CRYPTO_UNSPEC 0 -#define CRYPTO_MAX_ALG_NAME64 - -struct scatterlist; - -/* - * Algorithms: modular crypto algorithm implementations, managed - * via crypto_register_alg() and crypto_unregister_alg(). - */ -struct cipher_alg { - unsigned int cia_min_keysize; - unsigned int cia_max_keysize; - int (*cia_setkey)(void *ctx, const u8 *key, - unsigned int keylen, u32 *flags); - void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); - void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); -}; - -struct digest_alg { - unsigned int dia_digestsize; - void (*dia_init)(void *ctx); - void (*dia_update)(void *ctx, const u8 *data, unsigned int len); - void (*dia_final)(void *ctx, u8 *out); - int (*dia_setkey)(void *ctx, const u8 *key, - unsigned int keylen, u32 *flags); -}; - -struct compress_alg { - int (*coa_init)(void *ctx); - void (*coa_exit)(void *ctx); - int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); - int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); -}; - -#define cra_cipher cra_u.cipher -#define cra_digest cra_u.digest -#define cra_compress cra_u.compress - -struct crypto_alg { - struct list_head cra_list; - u32 cra_flags; - unsigned int cra_blocksize; - unsigned int cra_ctxsize; - const char cra_name[CRYPTO_MAX_ALG_NAME]; - - union { - struct cipher_alg cipher; - struct digest_alg digest; - struct compress_alg compress; - } cra_u; - - struct module *cra_module; -}; - -/* - * Algorithm registration interface. - */ -int crypto_register_alg(struct crypto_alg *alg); -int crypto_unregister_alg(struct crypto_alg *alg); - -/* - * Algorithm query interface. - */ -int crypto_alg_available(const char *name, u32 flags); - -/* - * Transforms: user-instantiated objects which encapsulate algorithms - * and core processing logic. Managed via crypto_alloc_tfm() and - * crypto_free_tfm(), as well as the various helpers below. - */ -struct crypto_tfm; - -struct cipher_tfm { - void *cit_iv; - unsigned int cit_ivsize; - u32 cit_mode; - int (*cit_setkey)(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen); - int (*cit_encrypt)(struct crypto_tfm *tfm, -
[PATCH v3 26/33] staging: rtl8192e: Replace ?: with max_t
Improve readability and make checkpatch happy. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 2b337c4..5a08935 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1689,7 +1689,7 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info qos_param->aifs[aci] = (ac_params->aci_aifsn) & 0x0f; /* WMM spec P.11: The minimum value for AIFSN shall be 2 */ - qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2 : qos_param->aifs[aci]; + qos_param->aifs[aci] = max_t(u8, qos_param->aifs[aci], 2); qos_param->cw_min[aci] = cpu_to_le16(ac_params->ecw_min_max & 0x0F); -- 1.8.4.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 v3 15/33] staging: rtl8192e: Remove RTLLIB_DEBUG_INFO()
Use pr_debug() instead. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtllib.h| 1 - drivers/staging/rtl8192e/rtllib_module.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index faf94b4..f059153 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -701,7 +701,6 @@ do { \ #define RTLLIB_DL_TRACE (1<<29) #define RTLLIB_DL_DATA(1<<30) #define RTLLIB_DL_ERR (1<<31) -#define RTLLIB_DEBUG_INFO(f, a...) RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a) #ifndef ETH_P_PAE #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c index b8c7df5..b61035b 100644 --- a/drivers/staging/rtl8192e/rtllib_module.c +++ b/drivers/staging/rtl8192e/rtllib_module.c @@ -103,7 +103,7 @@ struct net_device *alloc_rtllib(int sizeof_priv) struct net_device *dev; int i, err; - RTLLIB_DEBUG_INFO("Initializing...\n"); + pr_debug("rtllib: Initializing...\n"); dev = alloc_etherdev(sizeof(struct rtllib_device) + sizeof_priv); if (!dev) { -- 1.8.4.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 v3 23/33] staging: rtl8192e: Remove unimplemented iwpriv handlers
Remove the following private variables: - force_mic_error - changes force_mic_error that is not used - radio - changes sw_radio_on that is not used - adhoc_peer_list - unimplemented - firm_ver - unimplemented Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 86 ++-- drivers/staging/rtl8192e/rtllib.h| 1 - 4 files changed, 4 insertions(+), 85 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index c7c03f3..5ef87ba 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1118,7 +1118,6 @@ static void rtl8192_init_priv_variable(struct net_device *dev) priv->bDriverIsGoingToUnload = false; priv->being_init_adapter = false; priv->initialized_at_probe = false; - priv->sw_radio_on = true; priv->bdisable_nic = false; priv->bfirst_init = false; priv->txringcount = 64; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 0640e76..6127e92 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -626,7 +626,6 @@ struct r8192_priv { u8 RegCWinMin; u8 keepAliveLevel; - boolsw_radio_on; boolbHwRadioOff; boolpwrdown; boolblinked_ingpio; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 2ae2885..f1c066d 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -175,48 +175,6 @@ static int r8192_wx_force_reset(struct net_device *dev, } -static int r8192_wx_force_mic_error(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = rtllib_priv(dev); - struct rtllib_device *ieee = priv->rtllib; - - down(>wx_sem); - - RT_TRACE(COMP_DBG, "%s(): force mic error !\n", __func__); - ieee->force_mic_error = true; - up(>wx_sem); - return 0; - -} - -#define MAX_ADHOC_PEER_NUM 64 -struct adhoc_peer_entry { - unsigned char MacAddr[ETH_ALEN] __aligned(2); - unsigned char WirelessMode; - unsigned char bCurTxBW40MHz; -}; -struct adhoc_peers_info { - struct adhoc_peer_entry Entry[MAX_ADHOC_PEER_NUM]; - unsigned char num; -}; - -static int r8192_wx_get_adhoc_peers(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - return 0; -} - - -static int r8191se_wx_get_firm_version(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *wrqu, char *extra) -{ - return 0; -} - static int r8192_wx_adapter_power_status(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -247,28 +205,6 @@ static int r8192_wx_adapter_power_status(struct net_device *dev, return 0; } -static int r8192se_wx_set_radio(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = rtllib_priv(dev); - - down(>wx_sem); - - netdev_info(dev, "%s(): set radio ! extra is %d\n", __func__, *extra); - if ((*extra != 0) && (*extra != 1)) { - RT_TRACE(COMP_ERR, -"%s(): set radio an err value,must 0(radio off) or 1(radio on)\n", -__func__); - up(>wx_sem); - return -1; - } - priv->sw_radio_on = *extra; - up(>wx_sem); - return 0; - -} - static int r8192se_wx_set_lps_awake_interval(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -1241,21 +1177,10 @@ static const struct iw_priv_args r8192_private_args[] = { SIOCIWFIRSTPRIV + 0x3, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "forcereset" }, { - SIOCIWFIRSTPRIV + 0x4, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "force_mic_error" - }, { - SIOCIWFIRSTPRIV + 0x5, - IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT|IW_PRIV_SIZE_FIXED|1, - "firm_ver" - }, { SIOCIWFIRSTPRIV + 0x6, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED|1, IW_PRIV_TYPE_NONE, "set_power" }, { - SIOCIWFIRSTPRIV + 0x9, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED|1, IW_PRIV_TYPE_NONE, - "radio" -
[PATCH v3 07/33] staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*()
Replace all RTLLIB_DEBUG(RTLLIB_DL_ERR, *) calls with netdev_err() for errors that really should be reported to user. Use netdev_warn() for the rest. Rephrase some of the messages to make them more readable/compact. Signed-off-by: Mateusz Kulikowski --- drivers/staging/rtl8192e/rtl819x_BAProc.c| 79 +--- drivers/staging/rtl8192e/rtl819x_HTProc.c| 23 drivers/staging/rtl8192e/rtl819x_TSProc.c| 19 --- drivers/staging/rtl8192e/rtllib_rx.c | 15 -- drivers/staging/rtl8192e/rtllib_softmac.c| 6 +-- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 6 +-- 6 files changed, 75 insertions(+), 73 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 5b72bce..7d72c19 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -88,12 +88,12 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, ">%s(), frame(%d) sentd to: %pM, ieee->dev:%p\n", __func__, type, Dst, ieee->dev); if (pBA == NULL) { - RTLLIB_DEBUG(RTLLIB_DL_ERR, "pBA is NULL\n"); + netdev_warn(ieee->dev, "pBA is NULL\n"); return NULL; } skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); if (skb == NULL) { - RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); + netdev_err(ieee->dev, "Can't alloc skb for ADDBA_REQ\n"); return NULL; } @@ -159,7 +159,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); if (skb == NULL) { - RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); + netdev_err(ieee->dev, "Can't alloc skb for DELBA_REQ\n"); return NULL; } @@ -247,10 +247,9 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) struct rx_ts_record *pTS = NULL; if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) { - RTLLIB_DEBUG(RTLLIB_DL_ERR, -" Invalid skb len in BAREQ(%d / %d)\n", -(int)skb->len, -(int)(sizeof(struct rtllib_hdr_3addr) + 9)); + netdev_warn(ieee->dev, "Invalid skb len in BAREQ(%d / %d)\n", + (int)skb->len, + (int)(sizeof(struct rtllib_hdr_3addr) + 9)); return -1; } @@ -270,24 +269,24 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) (ieee->pHTInfo->bCurrentHTSupport == false) || (ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) { rc = ADDBA_STATUS_REFUSED; - RTLLIB_DEBUG(RTLLIB_DL_ERR, -"Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", -ieee->current_network.qos_data.active, -ieee->pHTInfo->bCurrentHTSupport); + netdev_warn(ieee->dev, + "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", + ieee->current_network.qos_data.active, + ieee->pHTInfo->bCurrentHTSupport); goto OnADDBAReq_Fail; } if (!GetTs(ieee, (struct ts_common_info **)(), dst, (u8)(pBaParamSet->field.TID), RX_DIR, true)) { rc = ADDBA_STATUS_REFUSED; - RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __func__); + netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); goto OnADDBAReq_Fail; } pBA = >RxAdmittedBARecord; if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED) { rc = ADDBA_STATUS_INVALID_PARAM; - RTLLIB_DEBUG(RTLLIB_DL_ERR, -"BA Policy is not correct in %s()\n", __func__); + netdev_warn(ieee->dev, "%s(): BA Policy is not correct\n", + __func__); goto OnADDBAReq_Fail; } @@ -334,10 +333,9 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) u16 ReasonCode; if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) { - RTLLIB_DEBUG(RTLLIB_DL_ERR, -"Invalid skb len in BARSP(%d / %d)\n", -(int)skb->len, -(int)(sizeof(struct rtllib_hdr_3addr) + 9)); + netdev_warn(ieee->dev, "Invalid skb len in BARSP(%d / %d)\n", + (int)skb->len, + (int)(sizeof(struct rtllib_hdr_3addr) + 9)); return -1; } rsp
[PATCH v3 00/33] staging: rtl8192e: Fix more checkpatch.pl warnings
This series applies some of review comments by Dan (thanks!) as well as does further cleanups. Further series will probably focus more on changing driver architecture into something that may get accepted into -wireless. This series should apply cleanly to staging-testing(7192a5dd5) branches. One changeset - #14 will not apply cleanly if the following patch will be applied: [PATCH v2] staging: rtl8192e: Change cpu_to_le16 to le16_to_cpu It should apply via 3-way merge (only one line of context is different) Target tested on netbook with rtl8192e card vs Linus master (1a9f064f): - Module load/unload - Interface up/down - Network scanning - Connect to WPA2 network + ping route I've found one bug in the driver (it happens also on master) - rtllib doesn't handle rmmod of active (WPA) r8192e_pci - module refcount drops below 0. Built-tested for each patch in series on staging-testing New changes (patch numbers are valid for v3): - #6 Removal of rtllib_crypt.[ch] - unused files are bad - #10 Simplification of rtllib_proces_probe_response - fixing LONG_LINES in process - #24 Fix new checkpatch warnings (OOM_MESSAGE) - #25 Remove another unused file (rtl_crypto.h) - #26-#28 Replace ?: expression with min/max macros - #29 Remove unused debug messages - #30 Simplify/Optimize rtl8192_phy_checkBBAndRF() - #31 Replace RT_TRACE(COMP_ERR,...) with netdev_* errors - this are error messages that were (and should be) displayed, with this patch it will be clearly visible where they belong (+log levels were changed to more appropriate). - #32 Trivial reindentations - #33 Simplify awkward WoL reporting in rtl8192E_suspend() What happened to v2 changesets (patch numbers are valid for v2 unless noted): - Patches 1-9 were already applied by Greg - Thanks! - Patch 10 was split and reworked into v3 patches: 1, 2, 3 - Patches 11, 12 were cherry-picked into v3 patches 4, 5 - Patch 13 became a series of patches removing whole RTLLIB_* debug "system" (v3 patches 7-9, 11-19, 20). Where possible netdev_* was used, but in some cases it would look awkward so I left with pr_* - Patch 14 was cherry-picked into v3 patch 21 (Again - thanks for patience Dan) - Patches 15, 17, 18, 19, 20 were thrown out - they fix some LONG_LINE warnings, but it's not worth it as readability of code goes down - I will remove remaining warnings while refactoring the driver - Patch 16 was cherry-picked into v3 patch 22 - Patch 21 was cherry-picked into v3 patch 23 Notes from v2: New cleanup patchset for rtl8192e. It fixes (mostly) checkpatch.pl warnings. When applied, checkpatch.pl warning count drops to 34 (from ). It should apply cleanly to staging-next/testing (c610f7f7) branches. Series was smoke tested on rtl8192e card vs staging-next: - Module load/unload - Interface up/down Most of changes are related to checkpatch.pl with the exception of - bugfix - staging: rtl8192e: Fix DeviceID in rtl8192_pci_findadapter() This is clearly (in my opinion) typo - I checked two rtl8192e cards from different vendors and both had DeviceID == 0x8192. - Removal of unimplemented/unused iwpriv handlers - they just give false sense of hope to iwpriv user Additional changes in v2: - Fix (most) LONG_LINE warnings - Replace memcpy() with custom macro - later __aligned(2) will be added to structures (where possible) - I prefer not to do this change before I have working hardware. Unfortunantely these cards are grumpy and refuse to enable radio in PC mPCIe slot (even after soldering W_DISABLE override and using two different antenna sets) - Fix (most) remaining PREFER_PR_LEVEL warnings Notes from v1: This series of patches fixes another set of checkpatch.pl warnings. Most of the patches are trivial, with the exception of #8, #7 and #5; Driver logic should not be affected. Some of the patches cause LONG_LINE warnings, but fix has to wait until I do more driver refactorings (It's hard to keep line length when variable names have 30 characters). Mateusz Kulikowski (33): staging: rtl8192e: Declare ethernet addresses as __aligned(2) staging: rtl8192e: Fix PREFER_ETHER_ADDR_COPY warnings staging: rtl8192e: Mark unaligned memcpy() staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param() staging: rtl8192e: Replace memcmp() with ether_addr_equal_unaligned() staging: rtl8192e: Remove rtllib_crypt.[ch] staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*() staging: rtl8192e: Remove RTLLIB_ERROR() and RTLLIB_WARNING() staging: rtl8192e: Remove RTLLIB_DEBUG_WX() staging: rtl8192e: Simplify rtllib_proces_probe_response() staging: rtl8192e: Remove RTLLIB_DEBUG_SCAN() staging: rtl8192e: Remove RTLLIB_DEBUG_(FRAG|EAP|DROP|STATE|TX|RX)() staging: rtl8192e: Remove RTLLIB_DEBUG_QOS() staging: rtl8192e: Remove RTLLIB_DEBUG_MGMT() staging: rtl8192e: Remove RTLLIB_DEBUG_INFO() staging: rtl8192e: Remove RTLLIB_DEBUG() staging: rtl8192e: Remove RTLLIB_DEBUG_DATA() staging:
Re: [PATCH] net: fec: add support of ethtool get_regs
On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote: > +static void fec_enet_get_regs(struct net_device *ndev, > + struct ethtool_regs *regs, void *regbuf) > +{ > + struct fec_enet_private *fep = netdev_priv(ndev); > + > + memcpy_fromio(regbuf, fep->hwp, regs->len); Using memcpy_fromio() to copy device registers is not a good idea - it can use a variable access size which can cause bus faults. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. -- 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] init.h: mark init functions hot instead of cold
On Sat, May 09, 2015 at 02:17:39AM -0700, Andi Kleen wrote: > On Sat, May 09, 2015 at 12:45:01AM +0200, Rasmus Villemoes wrote: > > attribute((cold)) causes gcc to optimize the function for size rather > > than speed. But since __init functions will be discarded anyway, I > > don't see why memory should be a concern. On the contrary, everybody > > It makes the bzImage smaller. > A lot of people on smaller systems are interested in flash size. True, but people interested in flash size can set CONFIG_CC_OPTIMIZE_FOR_SIZE. I would propose dropping "cold" and *not* adding "hot"; just let __init functions get default optimizations. People who set CONFIG_CC_OPTIMIZE_FOR_SIZE should get similar size optimizations, and people who don't will get GCC's normal optimizations, which should provide much of the improved boot performance Rasmus observed. Rasmus, can you confirm that just dropping cold 1) doesn't make the kernel larger when building with CONFIG_CC_OPTIMIZE_FOR_SIZE, and 2) gives approximately the same 2% performance benefit you observed? > > wants their box to boot faster. Using the opposite attribute, hot, > > causes gcc to optimize the functions more aggressively, possibly at > > the expense of larger (.init).text. A completely unscientific test > > showed about 2% faster boot time: I booted a kernel in qemu with and > > without this patch five times each; the boot times were very stable in > > each case, so I think the 2% is ok, but of course only applies to that > > specific .config running in a virtual machine on my hardware. > > 2% on boot is basically noise. I disagree; there are people working on shaving milliseconds from boot. - Josh Triplett -- 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 net-next] test: bpf: extend "load 64-bit immediate" testcase
On 05/09/2015 10:14 AM, Xi Wang wrote: Extend the testcase to catch a signedness bug in the arm64 JIT: test_bpf: #58 load 64-bit immediate jited:1 ret -1 != 1 FAIL (1 times) This is useful to ensure other JITs won't have a similar bug. Link: https://lkml.org/lkml/2015/5/8/458 Cc: Alexei Starovoitov Cc: Will Deacon Signed-off-by: Xi Wang Acked-by: Daniel Borkmann -- 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] sh: Wire up missing syscalls
The related warnings: CALLscripts/checksyscalls.sh :1229:2: warning: #warning syscall sched_setattr not implemented [-Wcpp] :1232:2: warning: #warning syscall sched_getattr not implemented [-Wcpp] :1235:2: warning: #warning syscall renameat2 not implemented [-Wcpp] :1238:2: warning: #warning syscall seccomp not implemented [-Wcpp] :1241:2: warning: #warning syscall getrandom not implemented [-Wcpp] :1244:2: warning: #warning syscall memfd_create not implemented [-Wcpp] :1247:2: warning: #warning syscall bpf not implemented [-Wcpp] :1250:2: warning: #warning syscall execveat not implemented [-Wcpp] Signed-off-by: Chen Gang --- arch/sh/include/uapi/asm/unistd_32.h | 10 +- arch/sh/include/uapi/asm/unistd_64.h | 10 +- arch/sh/kernel/syscalls_32.S | 8 arch/sh/kernel/syscalls_64.S | 8 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/arch/sh/include/uapi/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h index d13a1d6..be5052e 100644 --- a/arch/sh/include/uapi/asm/unistd_32.h +++ b/arch/sh/include/uapi/asm/unistd_32.h @@ -380,7 +380,15 @@ #define __NR_process_vm_writev 366 #define __NR_kcmp 367 #define __NR_finit_module 368 +#define __NR_sched_setattr 369 +#define __NR_sched_getattr 370 +#define __NR_renameat2 371 +#define __NR_seccomp 372 +#define __NR_getrandom 373 +#define __NR_memfd_create 374 +#define __NR_bpf 375 +#define __NR_execveat 376 -#define NR_syscalls 369 +#define NR_syscalls 377 #endif /* __ASM_SH_UNISTD_32_H */ diff --git a/arch/sh/include/uapi/asm/unistd_64.h b/arch/sh/include/uapi/asm/unistd_64.h index e6820c8..decc1b8 100644 --- a/arch/sh/include/uapi/asm/unistd_64.h +++ b/arch/sh/include/uapi/asm/unistd_64.h @@ -400,7 +400,15 @@ #define __NR_process_vm_writev 377 #define __NR_kcmp 378 #define __NR_finit_module 379 +#define __NR_sched_setattr 380 +#define __NR_sched_getattr 381 +#define __NR_renameat2 382 +#define __NR_seccomp 383 +#define __NR_getrandom 384 +#define __NR_memfd_create 385 +#define __NR_bpf 386 +#define __NR_execveat 387 -#define NR_syscalls 380 +#define NR_syscalls 388 #endif /* __ASM_SH_UNISTD_64_H */ diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 734234b..39ddd5c 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S @@ -386,3 +386,11 @@ ENTRY(sys_call_table) .long sys_process_vm_writev .long sys_kcmp .long sys_finit_module + .long sys_sched_setattr + .long sys_sched_getattr /* 370 */ + .long sys_renameat2 + .long sys_seccomp + .long sys_getrandom + .long sys_memfd_create + .long sys_bpf /* 375 */ + .long sys_execveat diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S index 579fcb9..793d140 100644 --- a/arch/sh/kernel/syscalls_64.S +++ b/arch/sh/kernel/syscalls_64.S @@ -406,3 +406,11 @@ sys_call_table: .long sys_process_vm_writev .long sys_kcmp .long sys_finit_module + .long sys_sched_setattr /* 380 */ + .long sys_sched_getattr + .long sys_renameat2 + .long sys_seccomp + .long sys_getrandom + .long sys_memfd_create /* 385 */ + .long sys_bpf + .long sys_execveat -- 1.9.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/
[PATCH] imx27: dt: only map 1 Kbyte for fec registers
According to the imx27 documentation, fec has a 1 Kbyte memory space map, spitted in two regions of 512 bytes. The first one for control/status registers, and the second one for event/statistic registers. So, we don't need to map 16 Kbyte for registers, 1 Kbyte is enough. Signed-off-by: Philippe Reynes --- arch/arm/boot/dts/imx27.dtsi |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi index 6951b66..56bb917 100644 --- a/arch/arm/boot/dts/imx27.dtsi +++ b/arch/arm/boot/dts/imx27.dtsi @@ -533,7 +533,7 @@ fec: ethernet@1002b000 { compatible = "fsl,imx27-fec"; - reg = <0x1002b000 0x4000>; + reg = <0x1002b000 0x400>; interrupts = <50>; clocks = < IMX27_CLK_FEC_IPG_GATE>, < IMX27_CLK_FEC_AHB_GATE>; -- 1.7.4.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] net: fec: add support of ethtool get_regs
This enables the ethtool's "-d" and "--register-dump" options for fec devices. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/freescale/fec_main.c | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 66d47e4..07aee1f 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2118,6 +2118,28 @@ static void fec_enet_get_drvinfo(struct net_device *ndev, strlcpy(info->bus_info, dev_name(>dev), sizeof(info->bus_info)); } +static int fec_enet_get_regs_len(struct net_device *ndev) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + struct resource *r; + int s = 0; + + r = platform_get_resource(fep->pdev, IORESOURCE_MEM, 0); + if (r) { + s = resource_size(r); + } + + return s; +} + +static void fec_enet_get_regs(struct net_device *ndev, + struct ethtool_regs *regs, void *regbuf) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + + memcpy_fromio(regbuf, fep->hwp, regs->len); +} + static int fec_enet_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) { @@ -2515,6 +2537,8 @@ static const struct ethtool_ops fec_enet_ethtool_ops = { .get_settings = fec_enet_get_settings, .set_settings = fec_enet_set_settings, .get_drvinfo= fec_enet_get_drvinfo, + .get_regs_len = fec_enet_get_regs_len, + .get_regs = fec_enet_get_regs, .nway_reset = fec_enet_nway_reset, .get_link = ethtool_op_get_link, .get_coalesce = fec_enet_get_coalesce, -- 1.7.4.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: Hardware spec prevents optimal performance in device driver
One Thousand Gnomes wrote: > Mason wrote: > >> I'm writing a device driver for a serial-ish kind of device. >> I'm interested in the TX side of the problem. (I'm working on >> an ARM Cortex A9 system by the way.) >> >> There's a 16-byte TX FIFO. Data is queued to the FIFO by writing >> {1,2,4} bytes to a TX{8,16,32} memory-mapped register. >> Reading the TX_DEPTH register returns the current queue depth. >> >> The TX_READY IRQ is asserted when (and only when) TX_DEPTH >> transitions from 1 to 0. > > If the last statement is correct then your performance is probably always > going to suck unless there is additional invisible queueing beyond the > visible FIFO. Do you agree with my assessment that the current semantics for TX_READY lead to a race condition, unless we limit ourselves to a single (atomic) write between interrupts? > FIFOs on sane serial ports either have an adjustable threshold or fire > when its some way off empty. That way our normal flow is that you take > the TX interrupt before the port empties so you can fill it back up. This is where I must be missing something obvious. As far as I can see, the race condition still exists, even if the hardware provides a TX threshold. Suppose we set the threshold to 4, then write 4-byte words to the queue. TX_READY may fire between two writes if the CPU is very slow (unlikely) or is required to do something else (more likely). Thus in the ISR, I can't tell exactly what happened, and I cannot signal something clear to the other thread. What am I missing? BTW, I checked the HW spec. There's a RX thresh, but no TX thresh. > On that kind of port I'd expect optimal to probably be something like > writing 4 bytes until < 4 is left, and repeating that until your own > transmit queue is < 4 bytes and the write the dribble. To keep the data flowing between FIFO and device. I agree. > You don't normally want to perfectly fill the FIFO, you just want to ram > stuff into it efficiently with sufficient hardware queue and latency of > response that the queue never empties. Beyond that it doesn't matter. Well there's another dimension to optimize: minimizing IRQs to the CPU. And completely filling the FIFO achieves that. Interrupting once for every 12 bytes sounds better than interrupting once for every 4 or 8 bytes, don't you agree? What am I missing? Regards. -- 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] netxen_nic: use spin_[un]lock_bh around tx_clean_lock (2)
From: Tony Camuso Date: Wed, 6 May 2015 09:09:18 -0400 > This patch should have been part of the previous patch having the > same summary. See http://marc.info/?l=linux-kernel=143039470103795=2 > Unfortunately, I didn't check to see where else this lock was used before > submitting that patch. This should take care of it for netxen_nic, as I > did a thorough search this time. > > To recap from the original patch; although testing this driver with > DEBUG_LOCKDEP and DEBUG_SPINLOCK enabled did not produce any traces, > it would be more prudent in the case of tx_clean_lock to use _bh > versions of spin_[un]lock, since this lock is manipulated in both > the process and softirq contexts. > > This patch was tested for functionality and regressions with netperf > and DEBUG_LOCKDEP and DEBUG_SPINLOCK enabled. > > Signed-off-by: Tony Camuso Applied, thanks. -- 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 v6 00/12] ARM: vf610m4: Add Vybrid Cortex-M4 support
It took me a bit longer than expected to come up with the 6th revision of the patchset. Support for irq domain hierarchy for generic chip turned out to be not as easy as thought, the changes lead to build errors when building without domain hierarchy, sorry about that Jason. However, in this patchset I propose adding the helper function irq_domain_set_info even when there is no irq domain hierarchy support. People familiar with that code (Jason, Marc), could you have a look at that and tell me whether that is acceptable? I also thought about other ways, e.g. create a second map functions in generic chip which support domain hierarchy only. But this new helper looks like the most straight forward way to me... Otherwise, I stripped down the To list as suggested by Arnd. Shawn, when the IRQ stuff is ok, could you pick that patchset up as Arnd suggested? I guess the IRQ stuff still should go through Jason's tree directly (Patch 1-4)? The patchset has proven to be working on the Cortex-M4 of the Vybrid SoC using a Colibri VF61 module. Also compiled with allmodconfig and without IRQ domain support, which worked fine this time. Note: This patchset has dependencies on "ARM: ARMv7-M: Enlarge vector table up to 256 entries" (Maxime Coquelin), which is in Russels patch system marked as applied (8340/1). Changes since v5: - Remove unnecessary empty lines in Kconfig - Add non-hierarchy helper irq_domain_set_info - Rebased on v4.1-rc1 Changes since v4: - Added ARM_SINGLE_ARMV7M as top-level config symbol for ARMv7-M architectures - Cleaned up unnecessary selects within SOC_VF610 - Added linux,stdout-path to device tree Changes since v3: - Added dependency IRQ_DOMAIN_HIERARCHY for ARM_NVIC - Fix MSCM IR disable function check - Remove "ARM: imx: depend MXC debug board on 3DS machines", the patch has been merged Changes since v2: - Update MSCM patches to merged version of MSCM interrupt router - Use the GPLv2/X11 dual license in the new device tree files - Drop SD controller in device tree (initramfs works now and is probably more appropriate for most cases) - Disable GPIO nodes since the A5 is using them - Drop CONFIG_ prefixes in Kconfig changes for MXC_DEBUG_BOARD - Drop vector table resizing in favor of Maxime Coquelin's patch (https://lkml.org/lkml/2015/2/20/399) - Remove !MMU dependency for ARCH_EFM32 since its part of ARCH_MULTI_V7M - Rebased on v4.0-rc1 Changes since v1: - Remove MSCM driver - Support irq domain hierarchy with NVIC irq controller - Extend MSCM interrupt router with NVIC as parent in the irq domain hierarchy - Rebased on v3.19-rc1 with MSCM driver - NVIC: Register only the amount of IRQ's which vectors are available for Changes since RFC: - Unified addruart calls for MMU/!MMU - Add MSCM support along with routable IRQ support in NVIC - Rebased on Shawns for-next tree which made some changes obsolete (mainly the Vybrid SoC device tree files in for-next are already prepared for Cortex-M4 support) - Removed SRC_GPR3 hack, this is now part of a mini boot-loader: https://github.com/falstaff84/vf610m4bootldr Stefan Agner (12): irqdomain: Add non-hierarchy helper irq_domain_set_info genirq: generic chip: support hierarchy domain irqchip: nvic: support hierarchy irq domain irqchip: vf610-mscm: support NVIC parent ARM: ARMv7M: define size of vector table for Vybrid clocksource: add dependencies for Vybrid pit clocksource ARM: unify MMU/!MMU addruart calls ARM: introduce ARM_SINGLE_ARMV7M for ARMv7-M platforms ARM: efm32: use ARM_SINGLE_ARMV7M ARM: vf610: enable Cortex-M4 configuration on Vybrid SoC ARM: dts: add support for Vybrid running on Cortex-M4 ARM: vf610m4: add defconfig for Linux on Vybrids Cortex-M4 Documentation/devicetree/bindings/arm/fsl.txt | 3 + arch/arm/Kconfig | 41 ++- arch/arm/Kconfig.debug| 2 +- arch/arm/boot/dts/Makefile| 1 + arch/arm/boot/dts/vf610m4-colibri.dts | 99 +++ arch/arm/boot/dts/vf610m4.dtsi| 50 ++ arch/arm/configs/efm32_defconfig | 1 + arch/arm/configs/vf610m4_defconfig| 42 arch/arm/include/debug/efm32.S| 2 +- arch/arm/kernel/debug.S | 2 +- arch/arm/mach-imx/Kconfig | 38 +- arch/arm/mach-imx/Makefile.boot | 0 arch/arm/mach-imx/mach-vf610.c| 1 + arch/arm/mm/Kconfig | 1 + drivers/clocksource/Kconfig | 2 + drivers/irqchip/Kconfig | 1 + drivers/irqchip/irq-nvic.c| 28 +++- drivers/irqchip/irq-vf610-mscm-ir.c | 32 +++-- include/linux/irqdomain.h | 8 +-- kernel/irq/generic-chip.c | 5 +- kernel/irq/irqdomain.c| 21 ++ 21 files changed, 328 insertions(+),
[GIT PULL] arm-soc fixes for 4.1-rc2
The following changes since commit 5ebe6afaf0057ac3eaeb98defd5456894b446d22: Linux 4.1-rc2 (2015-05-03 19:22:23 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git tags/fixes-for-linus for you to fetch changes up to c9d862c48c48883a4327ae82f4a6de1eef928d60: MAINTAINERS: add Conexant Digicolor machines entry (2015-05-08 19:00:53 +0200) ARM: SoC fixes for 4.1-rc2 A few patches have come up since the merge window. The largest one is a rewrite of the PXA lubbock/mainstone IRQ handling. This was already broken in 2011 by a change to the GPIO code and only noticed now. The other changes contained here are: MAINTAINERS file updates: - Ray Jui and Scott Branden are now co-maintainers for some of the mach-bcm chips, while Christian Daudt and Marc Carino have stepped down. - Andrew Victor is no longer maintaining at91. Instead, Alexandre Belloni now becomes an official maintainer, after having done a bulk of the work for a while. - Baruch Siach, who added the mach-digicolor platform in 4.1 is now listed as maintainer - The git URL for mach-socfpga has changed Bug fixes: - Three bug fixes for new rockchip rk3288 code - A regression fix to make SD card support work on certain ux500 boards - multiple smaller dts fixes for imx, omap, mvebu, and shmobile - a regression fiix for omap3 power consumption - a fix for regression in the ARM CCI bus driver Configuration changes: - more imx platforms are now enabled in multi_v7_defconfig Arnd Bergmann (8): Merge tag 'v4.1-rockchip-socfixes1' of git://git.kernel.org/.../mmind/linux-rockchip into fixes Merge tag 'imx-fixes-4.1' of git://git.kernel.org/.../shawnguo/linux into fixes Merge tag 'fixes-for-v4.1-rc2' of https://github.com/rjarzmik/linux into fixes Merge tag 'mvebu-fixes-4.1' of git://git.infradead.org/linux-mvebu into fixes Merge tag 'arm-soc/for-4.1/maintainers' of http://github.com/broadcom/stblinux into fixes Merge tag 'omap-for-v4.1/fixes-rc1' of git://git.kernel.org/.../tmlind/linux-omap into fixes Merge tag 'renesas-fixes-for-v4.1' of git://git.kernel.org/.../horms/renesas into fixes Merge tag 'stericsson-fixes-v4.1' of git://git.kernel.org/.../linusw/linux-stericsson into fixes Baruch Siach (1): MAINTAINERS: add Conexant Digicolor machines entry Chris Zhong (2): ARM: rockchip: disable dapswjdp during suspend ARM: rockchip: fix undefined instruction of reset_ctrl_regs Dinh Nguyen (1): MAINTAINERS: socfpga: update the git repo for SoCFPGA Fabio Estevam (2): ARM: dts: imx23-olinuxino: Fix polarity of LED GPIO ARM: multi_v7_defconfig: Select more FSL SoCs Felipe Balbi (2): ARM: dts: am437x-sk: fix for new newhaven display module revision ARM: dts: am437x-sk: reduce col-scan-delay-us Florian Fainelli (3): MAINTAINERS: Update mach-bcm maintainers list MAINTAINERS: Remove Christian Daudt for mach-bcm MAINTAINERS: Update brcmstb entry Gregory CLEMENT (1): ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC Grygorii Strashko (1): ARM: dts: am57xx-beagle-x15: Fix IRQ type for mcp7941x Heiko Stuebner (1): rockchip: make sure timer7 is enabled on rk3288 platforms Illia Smyrnov (1): bus: omap_l3_noc: Fix offset for DRA7 CLK1_HOST_CLK1_2 instance Laurent Pinchart (1): ARM: shmobile: koelsch: Fix adv7511 IRQ sensing Marek Vasut (1): ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name Mark Salter (1): drivers: CCI: fix used_mask init in validate_group() Markus Pargmann (1): ARM: dts: imx25: Add #pwm-cells to pwm4 Nicolas Ferre (1): MAINTAINERS: replace an AT91 maintainer Nishanth Menon (4): ARM: dts: am57xx-beagle-x15: Fix RTC aliases ARM: dts: am57xx-beagle-x15: Switch UART mux pins ARM: dts: am57xx-beagle-x15: Switch GPIO fan number ARM: dts: dra7: Fix efuse register size for ABB Pavel Machek (1): ARM: dts: OMAP3-N900: Add microphone bias voltages Philipp Zabel (1): ARM: dts: imx6: phyFLEX: USB VBUS control is active-high Robert Jarzmik (3): ARM: pxa: pxa_cplds: add lubbock and mainstone IO ARM: pxa: mainstone: use new pxa_cplds driver ARM: pxa: lubbock: use new pxa_cplds driver Roger Quadros (1): ARM: omap2plus_defconfig: Enable EXTCON_USB_GPIO Sebastian Reichel (1): ARM: dts: omap3: Add #iommu-cells to isp and iva iommu Shawn Guo (1): ARM: dts: imx6qdl-sabreauto: remove pinctrl-assert-gpios Stefan Wahren (1): ARM: dts: imx23-olinuxino: Fix dr_mode of usb0 Suman Anna (1): bus: omap_l3_noc: Fix master id address decoding for OMAP5 Tony Lindgren (1): ARM: OMAP2+: Fix omap off idle power consumption creeping up Ulf Hansson (3): ARM: ux500: Move GPIO regulator for
[PATCH v6 04/12] irqchip: vf610-mscm: support NVIC parent
Support the NVIC interrupt controller as node parent of the MSCM interrupt router. On the dual-core variants of Vybird (VF6xx), the NVIC interrupt controller is used by the Cortex-M4. To support running Linux on this core too, MSCM needs NVIC parent support too. Signed-off-by: Stefan Agner --- drivers/irqchip/irq-vf610-mscm-ir.c | 32 ++-- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-vf610-mscm-ir.c b/drivers/irqchip/irq-vf610-mscm-ir.c index 9521057..40b7d8d 100644 --- a/drivers/irqchip/irq-vf610-mscm-ir.c +++ b/drivers/irqchip/irq-vf610-mscm-ir.c @@ -47,6 +47,7 @@ struct vf610_mscm_ir_chip_data { void __iomem *mscm_ir_base; u16 cpu_mask; u16 saved_irsprc[MSCM_IRSPRC_NUM]; + bool is_nvic; }; static struct vf610_mscm_ir_chip_data *mscm_ir_data; @@ -91,6 +92,7 @@ static void vf610_mscm_ir_enable(struct irq_data *data) { irq_hw_number_t hwirq = data->hwirq; struct vf610_mscm_ir_chip_data *chip_data = data->chip_data; + struct irq_data *parent = data->parent_data; u16 irsprc; irsprc = readw_relaxed(chip_data->mscm_ir_base + MSCM_IRSPRC(hwirq)); @@ -101,17 +103,25 @@ static void vf610_mscm_ir_enable(struct irq_data *data) writew_relaxed(chip_data->cpu_mask, chip_data->mscm_ir_base + MSCM_IRSPRC(hwirq)); - irq_chip_unmask_parent(data); + if (parent->chip->irq_enable) + parent->chip->irq_enable(parent); + else + parent->chip->irq_unmask(parent); + } static void vf610_mscm_ir_disable(struct irq_data *data) { irq_hw_number_t hwirq = data->hwirq; struct vf610_mscm_ir_chip_data *chip_data = data->chip_data; + struct irq_data *parent = data->parent_data; writew_relaxed(0x0, chip_data->mscm_ir_base + MSCM_IRSPRC(hwirq)); - irq_chip_mask_parent(data); + if (parent->chip->irq_disable) + parent->chip->irq_disable(parent); + else + parent->chip->irq_mask(parent); } static struct irq_chip vf610_mscm_ir_irq_chip = { @@ -143,10 +153,17 @@ static int vf610_mscm_ir_domain_alloc(struct irq_domain *domain, unsigned int vi domain->host_data); gic_data.np = domain->parent->of_node; - gic_data.args_count = 3; - gic_data.args[0] = GIC_SPI; - gic_data.args[1] = irq_data->args[0]; - gic_data.args[2] = irq_data->args[1]; + + if (mscm_ir_data->is_nvic) { + gic_data.args_count = 1; + gic_data.args[0] = irq_data->args[0]; + } else { + gic_data.args_count = 3; + gic_data.args[0] = GIC_SPI; + gic_data.args[1] = irq_data->args[0]; + gic_data.args[2] = irq_data->args[1]; + } + return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, _data); } @@ -199,6 +216,9 @@ static int __init vf610_mscm_ir_of_init(struct device_node *node, goto out_unmap; } + if (of_device_is_compatible(domain->parent->of_node, "arm,armv7m-nvic")) + mscm_ir_data->is_nvic = true; + cpu_pm_register_notifier(_ir_notifier_block); return 0; -- 2.4.0 -- 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 v6 02/12] genirq: generic chip: support hierarchy domain
Use the new helper function irq_domain_set_info to make sure the function irq_domain_set_hwirq_and_chip is being called, which is crucial to save irqdomain specific data to irq_data. Signed-off-by: Stefan Agner --- kernel/irq/generic-chip.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index 61024e8..15b370d 100644 --- a/kernel/irq/generic-chip.c +++ b/kernel/irq/generic-chip.c @@ -360,7 +360,7 @@ static struct lock_class_key irq_nested_lock_class; int irq_map_generic_chip(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw_irq) { - struct irq_data *data = irq_get_irq_data(virq); + struct irq_data *data = irq_domain_get_irq_data(d, virq); struct irq_domain_chip_generic *dgc = d->gc; struct irq_chip_generic *gc; struct irq_chip_type *ct; @@ -405,8 +405,7 @@ int irq_map_generic_chip(struct irq_domain *d, unsigned int virq, else data->mask = 1 << idx; - irq_set_chip_and_handler(virq, chip, ct->handler); - irq_set_chip_data(virq, gc); + irq_domain_set_info(d, virq, hw_irq, chip, gc, ct->handler, NULL, NULL); irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set); return 0; } -- 2.4.0 -- 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 v6 07/12] ARM: unify MMU/!MMU addruart calls
Remove the needless differences between MMU/!MMU addruart calls. This allows to use the same addruart macro on SoC level. Useful for SoC consisting of multiple CPUs with and without MMU such as Freescale Vybrid. Signed-off-by: Stefan Agner --- arch/arm/include/debug/efm32.S | 2 +- arch/arm/kernel/debug.S| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/debug/efm32.S b/arch/arm/include/debug/efm32.S index 2265a19..660fa1e 100644 --- a/arch/arm/include/debug/efm32.S +++ b/arch/arm/include/debug/efm32.S @@ -16,7 +16,7 @@ #defineUARTn_TXDATA0x0034 - .macro addruart, rx, tmp + .macro addruart, rx, tmp, tmp2 ldr \rx, =(CONFIG_DEBUG_UART_PHYS) /* diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S index 78c91b5..ea9646c 100644 --- a/arch/arm/kernel/debug.S +++ b/arch/arm/kernel/debug.S @@ -35,7 +35,7 @@ #else /* !CONFIG_MMU */ .macro addruart_current, rx, tmp1, tmp2 - addruart\rx, \tmp1 + addruart\rx, \tmp1, \tmp2 .endm #endif /* CONFIG_MMU */ -- 2.4.0 -- 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 v6 06/12] clocksource: add dependencies for Vybrid pit clocksource
Add the minimal dependencies required to use the Vybrid PIT clocksource driver. Those are not part of the SoC dependencies. Acked-by: Daniel Lezcano Signed-off-by: Stefan Agner --- drivers/clocksource/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 51d7865f..9626c40 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -174,6 +174,8 @@ config FSL_FTM_TIMER config VF_PIT_TIMER bool + select CLKSRC_MMIO + select CLKSRC_OF help Support for Period Interrupt Timer on Freescale Vybrid Family SoCs. -- 2.4.0 -- 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 v6 03/12] irqchip: nvic: support hierarchy irq domain
Add support for hierarchy irq domains. This is required to stack the MSCM interrupt router and the NVIC controller found in Vybrid SoC. Signed-off-by: Stefan Agner --- drivers/irqchip/Kconfig| 1 + drivers/irqchip/irq-nvic.c | 28 +++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 6de62a9..99b9a97 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -30,6 +30,7 @@ config ARM_GIC_V3_ITS config ARM_NVIC bool select IRQ_DOMAIN + select IRQ_DOMAIN_HIERARCHY select GENERIC_IRQ_CHIP config ARM_VIC diff --git a/drivers/irqchip/irq-nvic.c b/drivers/irqchip/irq-nvic.c index 4ff0805..5fac910 100644 --- a/drivers/irqchip/irq-nvic.c +++ b/drivers/irqchip/irq-nvic.c @@ -49,6 +49,31 @@ nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs) handle_IRQ(irq, regs); } +static int nvic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, + unsigned int nr_irqs, void *arg) +{ + int i, ret; + irq_hw_number_t hwirq; + unsigned int type = IRQ_TYPE_NONE; + struct of_phandle_args *irq_data = arg; + + ret = irq_domain_xlate_onecell(domain, irq_data->np, irq_data->args, + irq_data->args_count, , ); + if (ret) + return ret; + + for (i = 0; i < nr_irqs; i++) + irq_map_generic_chip(domain, virq + i, hwirq + i); + + return 0; +} + +static const struct irq_domain_ops nvic_irq_domain_ops = { + .xlate = irq_domain_xlate_onecell, + .alloc = nvic_irq_domain_alloc, + .free = irq_domain_free_irqs_top, +}; + static int __init nvic_of_init(struct device_node *node, struct device_node *parent) { @@ -70,7 +95,8 @@ static int __init nvic_of_init(struct device_node *node, irqs = NVIC_MAX_IRQ; nvic_irq_domain = - irq_domain_add_linear(node, irqs, _generic_chip_ops, NULL); + irq_domain_add_linear(node, irqs, _irq_domain_ops, NULL); + if (!nvic_irq_domain) { pr_warn("Failed to allocate irq domain\n"); return -ENOMEM; -- 2.4.0 -- 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 v6 08/12] ARM: introduce ARM_SINGLE_ARMV7M for ARMv7-M platforms
This introduces a new top level config symbol ARM_SINGLE_ARMV7M for non-MMU, ARMv7-M platforms. It also support multiple ARMv7-M platforms in one kernel image since the cores share the same basic memory layout and interrupt controller. However, this works only if the combined platforms also have a similar (main) memory layout. Signed-off-by: Stefan Agner --- arch/arm/Kconfig | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 45df48b..2361efc 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -329,6 +329,19 @@ config ARCH_MULTIPLATFORM select SPARSE_IRQ select USE_OF +config ARM_SINGLE_ARMV7M + bool "ARMv7-M based platforms (Cortex-M0/M3/M4)" + depends on !MMU + select ARCH_WANT_OPTIONAL_GPIOLIB + select ARM_NVIC + select CLKSRC_OF + select COMMON_CLK + select CPU_V7M + select GENERIC_CLOCKEVENTS + select NO_IOPORT_MAP + select SPARSE_IRQ + select USE_OF + config ARCH_REALVIEW bool "ARM Ltd. RealView family" select ARCH_WANT_OPTIONAL_GPIOLIB -- 2.4.0 -- 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 v6 09/12] ARM: efm32: use ARM_SINGLE_ARMV7M
Use the new config symbol ARM_SINGLE_ARMV7M which groups config symbols used by modern ARMv7-M platforms. It also support multiple ARMv7-M platforms in one kernel image. However, this only works if the combined platforms share the same (main) memory layout. Signed-off-by: Stefan Agner --- arch/arm/Kconfig | 28 ++-- arch/arm/configs/efm32_defconfig | 1 + 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2361efc..d1c035d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -411,24 +411,6 @@ config ARCH_EBSA110 Ethernet interface, two PCMCIA sockets, two serial ports and a parallel port. -config ARCH_EFM32 - bool "Energy Micro efm32" - depends on !MMU - select ARCH_REQUIRE_GPIOLIB - select ARM_NVIC - select AUTO_ZRELADDR - select CLKSRC_OF - select COMMON_CLK - select CPU_V7M - select GENERIC_CLOCKEVENTS - select NO_DMA - select NO_IOPORT_MAP - select SPARSE_IRQ - select USE_OF - help - Support for Energy Micro's (now Silicon Labs) efm32 Giant Gecko - processors. - config ARCH_EP93XX bool "EP93xx-based" select ARCH_HAS_HOLES_MEMORYMODEL @@ -963,6 +945,16 @@ source "arch/arm/mach-w90x900/Kconfig" source "arch/arm/mach-zynq/Kconfig" +# ARMv7-M architecture +config ARCH_EFM32 + bool "Energy Micro efm32" + depends on ARM_SINGLE_ARMV7M + select ARCH_REQUIRE_GPIOLIB + select AUTO_ZRELADDR + help + Support for Energy Micro's (now Silicon Labs) efm32 Giant Gecko + processors. + # Definitions to make life easier config ARCH_ACORN bool diff --git a/arch/arm/configs/efm32_defconfig b/arch/arm/configs/efm32_defconfig index c4c17e3..e969f78 100644 --- a/arch/arm/configs/efm32_defconfig +++ b/arch/arm/configs/efm32_defconfig @@ -16,6 +16,7 @@ CONFIG_EMBEDDED=y # CONFIG_IOSCHED_DEADLINE is not set # CONFIG_IOSCHED_CFQ is not set # CONFIG_MMU is not set +CONFIG_ARM_SINGLE_ARMV7M=y CONFIG_ARCH_EFM32=y CONFIG_SET_MEM_PARAM=y CONFIG_DRAM_BASE=0x8800 -- 2.4.0 -- 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 v6 10/12] ARM: vf610: enable Cortex-M4 configuration on Vybrid SoC
This patch allows to build the Kernel for Vybrid (VF6xx) SoC when ARMv7-M CPU is selected. The resulting image runs on the secondary Cortex-M4 core. This core has equally access to all peripherals as the main Cortex-A5 core. However, there is no resource control mechanism, hence when both cores are used simultaneously, orthogonal device tree's are required. The boot CPU is dependent on the SoC variant. The available boards use mostly variants where the Cortex-A5 is the primary and hence the boot CPU. Booting the secondary Cortex-M4 CPU needs SoC specific registers written. There is no in kernel support for this right now, a external userspace utility called "m4boot" can be used to boot the kernel: m4boot xipImage initramfs.cpio.lzo vf610m4-colibri.dtb Signed-off-by: Stefan Agner --- Documentation/devicetree/bindings/arm/fsl.txt | 3 +++ arch/arm/Kconfig.debug| 2 +- arch/arm/mach-imx/Kconfig | 38 +++ arch/arm/mach-imx/Makefile.boot | 0 arch/arm/mach-imx/mach-vf610.c| 1 + 5 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 arch/arm/mach-imx/Makefile.boot diff --git a/Documentation/devicetree/bindings/arm/fsl.txt b/Documentation/devicetree/bindings/arm/fsl.txt index a5462b6..2a3ba73 100644 --- a/Documentation/devicetree/bindings/arm/fsl.txt +++ b/Documentation/devicetree/bindings/arm/fsl.txt @@ -81,12 +81,15 @@ Freescale Vybrid Platform Device Tree Bindings For the Vybrid SoC familiy all variants with DDR controller are supported, which is the VF5xx and VF6xx series. Out of historical reasons, in most places the kernel uses vf610 to refer to the whole familiy. +The compatible string "fsl,vf610m4" is used for the secondary Cortex-M4 +core support. Required root node compatible property (one of them): - compatible = "fsl,vf500"; - compatible = "fsl,vf510"; - compatible = "fsl,vf600"; - compatible = "fsl,vf610"; +- compatible = "fsl,vf610m4"; Freescale LS1021A Platform Device Tree Bindings diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 0c12ffb..cb39834 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1562,7 +1562,7 @@ config UNCOMPRESS_INCLUDE string default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \ PLAT_SAMSUNG || ARCH_EFM32 || \ - ARCH_SHMOBILE_LEGACY + ARCH_SHMOBILE_LEGACY || SOC_VF610 default "mach/uncompress.h" config EARLY_PRINTK diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 3a3d3e9..2e3c458 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -1,5 +1,5 @@ menuconfig ARCH_MXC - bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 + bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M select ARCH_REQUIRE_GPIOLIB select ARM_CPU_SUSPEND if PM select CLKSRC_MMIO @@ -496,10 +496,10 @@ config MACH_VPR200 endif -if ARCH_MULTI_V5 - comment "Device tree only" +if ARCH_MULTI_V5 + config SOC_IMX25 bool "i.MX25 support" select ARCH_MXC_IOMUX_V3 @@ -512,7 +512,7 @@ endif if ARCH_MULTI_V7 -comment "Device tree only" +comment "Cortex-A platforms" config SOC_IMX5 bool @@ -582,10 +582,24 @@ config SOC_IMX6SX help This enables support for Freescale i.MX6 SoloX processor. +config SOC_LS1021A + bool "Freescale LS1021A support" + select ARM_GIC + select HAVE_ARM_ARCH_TIMER + select PCI_DOMAINS if PCI + select ZONE_DMA if ARM_LPAE + help + This enables support for Freescale LS1021A processor. + +endif + +comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms" + +if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M + config SOC_VF610 bool "Vybrid Family VF610 support" - select IRQ_DOMAIN_HIERARCHY - select ARM_GIC + select ARM_GIC if ARCH_MULTI_V7 select PINCTRL_VF610 select PL310_ERRATA_769419 if CACHE_L2X0 select SMP_ON_UP if SMP @@ -599,7 +613,7 @@ choice default VF_USE_ARM_GLOBAL_TIMER config VF_USE_ARM_GLOBAL_TIMER - bool "Use ARM Global Timer" + bool "Use ARM Global Timer" if ARCH_MULTI_V7 select ARM_GLOBAL_TIMER select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK help @@ -613,16 +627,6 @@ choice endchoice -config SOC_LS1021A - bool "Freescale LS1021A support" - select ARM_GIC - select HAVE_ARM_ARCH_TIMER - select PCI_DOMAINS if PCI - select ZONE_DMA if ARM_LPAE - - help - This enables support for Freescale LS1021A processor. - endif source "arch/arm/mach-imx/devices/Kconfig" diff --git
[PATCH v6 12/12] ARM: vf610m4: add defconfig for Linux on Vybrids Cortex-M4
Add defconfig for Linux on Vybrid (vf610) on the secondary Cortex- M4 CPU. The use of a XIP image has been tested which needs to be loaded (e.g. using the custom m4boot loader) to the end of the available RAM at address 0x8f00. The Cortex-M4 has a code-alias which makes sure that the instructions get fetched through the code bus (alias starts at 0x0080 => 0x8080 in system address). Hence, to get optimal performance, use 0x0f00 as XIP_PHYS_ADDR. This address is additionally shifted by the length of the minimal loader which is inserted by m4boot. Currently, this offset is 0x80. The standard DRAM base address is configured to 0x8C00, which gives the Cortex-M4 48MiB of RAM. Signed-off-by: Stefan Agner --- arch/arm/configs/vf610m4_defconfig | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 arch/arm/configs/vf610m4_defconfig diff --git a/arch/arm/configs/vf610m4_defconfig b/arch/arm/configs/vf610m4_defconfig new file mode 100644 index 000..aeb2482 --- /dev/null +++ b/arch/arm/configs/vf610m4_defconfig @@ -0,0 +1,42 @@ +CONFIG_NAMESPACES=y +CONFIG_BLK_DEV_INITRD=y +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZ4 is not set +CONFIG_KALLSYMS_ALL=y +CONFIG_EMBEDDED=y +# CONFIG_MMU is not set +CONFIG_ARM_SINGLE_ARMV7M=y +CONFIG_ARCH_MXC=y +CONFIG_SOC_VF610=y +CONFIG_SET_MEM_PARAM=y +CONFIG_DRAM_BASE=0x8c00 +CONFIG_FLASH_MEM_BASE=0x8f00 +CONFIG_FLASH_SIZE=0x0100 +CONFIG_CMDLINE="console=/dev/ttyLP2" +CONFIG_XIP_KERNEL=y +CONFIG_XIP_PHYS_ADDR=0x0f80 +CONFIG_BINFMT_FLAT=y +CONFIG_BINFMT_ZFLAT=y +CONFIG_BINFMT_SHARED_FLAT=y +# CONFIG_SUSPEND is not set +# CONFIG_UEVENT_HELPER is not set +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FIRMWARE_IN_KERNEL is not set +# CONFIG_ALLOW_DEV_COREDUMP is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=4 +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_SERIO is not set +CONFIG_SERIAL_FSL_LPUART=y +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y +# CONFIG_HW_RANDOM is not set +CONFIG_MFD_SYSCON=y +# CONFIG_HID is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_MISC_FILESYSTEMS is not set +# CONFIG_FTRACE is not set -- 2.4.0 -- 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 v6 11/12] ARM: dts: add support for Vybrid running on Cortex-M4
This adds an initial device tree to run Linux on the Cortex-M4 on the Vybrid based Colibri VF61 module. Signed-off-by: Stefan Agner --- arch/arm/boot/dts/Makefile| 1 + arch/arm/boot/dts/vf610m4-colibri.dts | 99 +++ arch/arm/boot/dts/vf610m4.dtsi| 50 ++ 3 files changed, 150 insertions(+) create mode 100644 arch/arm/boot/dts/vf610m4-colibri.dts create mode 100644 arch/arm/boot/dts/vf610m4.dtsi diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 86217db..32806fd 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -319,6 +319,7 @@ dtb-$(CONFIG_SOC_LS1021A) += \ dtb-$(CONFIG_SOC_VF610) += \ vf500-colibri-eval-v3.dtb \ vf610-colibri-eval-v3.dtb \ + vf610m4-colibri.dtb \ vf610-cosmic.dtb \ vf610-twr.dtb dtb-$(CONFIG_ARCH_MXS) += \ diff --git a/arch/arm/boot/dts/vf610m4-colibri.dts b/arch/arm/boot/dts/vf610m4-colibri.dts new file mode 100644 index 000..2931a80 --- /dev/null +++ b/arch/arm/boot/dts/vf610m4-colibri.dts @@ -0,0 +1,99 @@ +/* + * Device tree for Colibri VF61 Cortex-M4 support + * + * Copyright (C) 2015 Stefan Agner + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "vf610m4.dtsi" + +/ { + model = "VF610 Cortex-M4"; + compatible = "fsl,vf610m4"; + + chosen { + bootargs = "console=ttyLP2,115200 clk_ignore_unused init=/linuxrc rw"; + linux,stdout-path = ""; + }; + + memory { + reg = <0x8c00 0x300>; + }; +}; + + { + status = "disabled"; +}; + + { + status = "disabled"; +}; + + { + status = "disabled"; +}; + + { + status = "disabled"; +}; + + { + status = "disabled"; +}; + + { + pinctrl-names = "default"; + pinctrl-0 = <_uart2>; + status = "okay"; +}; + + { + vf610-colibri { + pinctrl_uart2: uart2grp { + fsl,pins = < + VF610_PAD_PTD0__UART2_TX0x21a2 + VF610_PAD_PTD1__UART2_RX0x21a1 + VF610_PAD_PTD2__UART2_RTS 0x21a2 + VF610_PAD_PTD3__UART2_CTS 0x21a1 + >; + }; + }; +}; diff --git a/arch/arm/boot/dts/vf610m4.dtsi b/arch/arm/boot/dts/vf610m4.dtsi new file mode 100644 index 000..9ffe2eb --- /dev/null +++ b/arch/arm/boot/dts/vf610m4.dtsi @@ -0,0 +1,50 @@ +/* + * Device tree for VF6xx Cortex-M4 support + * + * Copyright (C) 2015 Stefan Agner + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation;
[PATCH v6 05/12] ARM: ARMv7M: define size of vector table for Vybrid
Vybrids has 112 peripherial interrupts which can be routed to the Cortex-M4's NVIC interrupt controller. Signed-off-by: Stefan Agner --- arch/arm/mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 3937af0..527ea03 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -609,6 +609,7 @@ config CPUV7M_NUM_IRQ depends on CPU_V7M default 90 if ARCH_STM32 default 38 if ARCH_EFM32 + default 112 if SOC_VF610 default 240 help This option indicates the number of interrupts connected to the NVIC. -- 2.4.0 -- 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 v6 01/12] irqdomain: Add non-hierarchy helper irq_domain_set_info
This adds the helper irq_domain_set_info() in a non-domain hierarchy variant. This allows to use the helper for generic chip since not all chips using generic chip support domain hierarchy. Signed-off-by: Stefan Agner --- include/linux/irqdomain.h | 8 kernel/irq/irqdomain.c| 21 + 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 676d730..744ac0e 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -258,6 +258,10 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr, /* V2 interfaces to support hierarchy IRQ domains. */ extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, unsigned int virq); +extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, + irq_hw_number_t hwirq, struct irq_chip *chip, + void *chip_data, irq_flow_handler_t handler, + void *handler_data, const char *handler_name); #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, unsigned int flags, unsigned int size, @@ -281,10 +285,6 @@ extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain, irq_hw_number_t hwirq, struct irq_chip *chip, void *chip_data); -extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, - irq_hw_number_t hwirq, struct irq_chip *chip, - void *chip_data, irq_flow_handler_t handler, - void *handler_data, const char *handler_name); extern void irq_domain_reset_irq_data(struct irq_data *irq_data); extern void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq, diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 7fac311..41bf6dc 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1232,6 +1232,27 @@ struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, return (irq_data && irq_data->domain == domain) ? irq_data : NULL; } +/** + * irq_domain_set_info - Set the complete data for a @virq in @domain + * @domain:Interrupt domain to match + * @virq: IRQ number + * @hwirq: The hardware interrupt number + * @chip: The associated interrupt chip + * @chip_data: The associated interrupt chip data + * @handler: The interrupt flow handler + * @handler_data: The interrupt flow handler data + * @handler_name: The interrupt handler name + */ +void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, +irq_hw_number_t hwirq, struct irq_chip *chip, +void *chip_data, irq_flow_handler_t handler, +void *handler_data, const char *handler_name) +{ + irq_set_chip_and_handler_name(virq, chip, handler, handler_name); + irq_set_chip_data(virq, chip_data); + irq_set_handler_data(virq, handler_data); +} + static void irq_domain_check_hierarchy(struct irq_domain *domain) { } -- 2.4.0 -- 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 v2] staging: rtl8192e: Change cpu_to_le16 to le16_to_cpu
Since the function auth_parse returns a u16, and struct rtllib_authentication.status is defined as an __le16, it seems that return cpu_to_le16(a->status); should be return le16_to_cpu(a->status); This change silences the following sparse warnings: drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: warning: cast from restricted __le16 drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: warning: incorrect type in return expression (different base types) drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: expected unsigned short drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: got restricted __le16 [usertype] Signed-off-by: Arno Tiemersma --- v2 since I did not have the right e-mail address for Mateusz Kulikowski drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 8f5e88b..98afd3b 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1814,7 +1814,7 @@ static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen) return -ENOMEM; } } - return cpu_to_le16(a->status); + return le16_to_cpu(a->status); } static int auth_rq_parse(struct sk_buff *skb, u8 *dest) -- 2.1.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 1/1] suspend: delete sys_sync()
On Sat, 09 May 2015, Alan Stern wrote: > On Fri, 8 May 2015, Rafael J. Wysocki wrote: > > My current view on that is that whether or not to do a sync() before > > suspending > > ultimately is a policy decision and should belong to user space as such > > (modulo > > the autosleep situation when user space may not know when the suspend is > > going > > to happen). > > > > Moreover, user space is free to do as many sync()s before suspending as it > > wants to and the question here is whether or not the *kernel* should sync() > > in the suspend code path. > > > > Since we pretty much can demonstrate that having just one sync() in there is > > not sufficient in general, should we put two of them in there? Or just > > remove the existing one and leave it to user space entirely? > > I don't know about the advantages of one sync over two. But how about > adding a "syncs_before_suspend" (or just "syncs") sysfs attribute that > takes a small numeric value? The default can be 0, and the user could > set it to 1 or 2 (or higher). IMO it would be much safer to both have that knob, and to set it to keep the current behavior as the default. Userspace will adapt and change that knob to whatever is sufficient based on what it does before signaling the kernel to suspend. A regression in sync-before-suspend is sure to cause data loss episodes, after all. And, as far as bikeshedding goes, IMHO syncs_before_suspend is self-explanatory, which would be a very good reason to use it instead of the shorter requires-you-to-know-what-it-is-about "syncs". -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh -- 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] staging: rtl8192e: Change cpu_to_le16 to le16_to_cpu
Since the function auth_parse returns a u16, and struct rtllib_authentication.status is defined as an __le16, it seems that return cpu_to_le16(a->status); should be return le16_to_cpu(a->status); This change silences the following sparse warnings: drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: warning: cast from restricted __le16 drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: warning: incorrect type in return expression (different base types) drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: expected unsigned short drivers/staging/rtl8192e/rtllib_softmac.c:1817:16: got restricted __le16 [usertype] Signed-off-by: Arno Tiemersma --- drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 8f5e88b..98afd3b 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1814,7 +1814,7 @@ static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen) return -ENOMEM; } } - return cpu_to_le16(a->status); + return le16_to_cpu(a->status); } static int auth_rq_parse(struct sk_buff *skb, u8 *dest) -- 2.1.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 V3] cpuidle: Handle tick_broadcast_enter() failure gracefully
On Saturday, May 09, 2015 10:11:41 PM Rafael J. Wysocki wrote: > On Saturday, May 09, 2015 11:19:16 AM Preeti U Murthy wrote: > > Hi Rafael, > > > > On 05/08/2015 07:48 PM, Rafael J. Wysocki wrote: > > [cut] > > > >> > > >> +/* Take note of the planned idle state. */ > > >> +idle_set_state(smp_processor_id(), target_state); > > > > > > And I wouldn't do this either. > > > > > > The behavior here is pretty much as though the driver demoted the state > > > chosen > > > by the governor and we don't call idle_set_state() again in those cases. > > > > Why is this wrong? > > It is not "wrong", but incomplete, because demotions done by the cpuidle > driver > should also be taken into account in the same way. > > But I'm seeing that the recent patch of mine that made cpuidle_enter_state() > call default_idle_call() was a mistake, because it might confuse > find_idlest_cpu() > significantly as to what state the CPU is in. I'll drop that one for now. OK, done. So after I've dropped it I think we need to do three things: (1) Move the idle_set_state() calls to cpuidle_enter_state(). (2) Make cpuidle_enter_state() call default_idle_call() again, but this time do that *before* it has called idle_set_state() for target_state. (3) Introduce demotion as per my last patch. Let me cut patches for that. -- 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/
[PATCH] irqchip: tegra: fix wrong data being passed as the irqdomain chip data
The irq chip functions use the irq chipdata directly as the base register address of the controller, so this should be passed in instead of a pointer to the array address holding the base address. This fixes Tegra20 CPUidle as now the un-/masking of IRQs at the LIC level works again, but more importantly it fixes the resulting memory corruption. Signed-off-by: Lucas Stach --- This is an important fix and should go into 4.1. --- drivers/irqchip/irq-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c index 51c485d..f67bbd8 100644 --- a/drivers/irqchip/irq-tegra.c +++ b/drivers/irqchip/irq-tegra.c @@ -264,7 +264,7 @@ static int tegra_ictlr_domain_alloc(struct irq_domain *domain, irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i, _ictlr_chip, - >base[ictlr]); + info->base[ictlr]); } parent_args = *args; -- 2.1.0 -- 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] net: macb: Handle the RXUBR interrupt on all devices
From: Nathan Sullivan Date: Tue, 5 May 2015 15:00:25 -0500 > The same hardware issue the at91 must work around applies to at least the > Zynq ethernet, and possibly more devices. The driver also needs to handle > the RXUBR interrupt since it turns it on with MACB_RX_INT_FLAGS anyway. > > Signed-off-by: Nathan Sullivan Applied, thank you. -- 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/2] net/rds: RDS-TCP robustness fixes
From: Sowmini Varadhan Date: Tue, 5 May 2015 15:20:50 -0400 > > This patch-set contains bug fixes for state-recovery at the RDS > layer when the underlying transport is TCP and the TCP state at one > of the endpoints is reset > > V2 changes: DaveM comments to reduce memory footprint, follow > NFS/RPC model where possible. Added test-case #3 > > Without the changes in this set, when one of the endpoints is reset, > the existing code does not correctly clean up RDS socket state for stale > connections, resulting in some unstable, timing-dependant behavior on > the wire, including an infinite exchange of 3WHs back-and-forth, and a > resulting potential to never converge RDS state. ... Yeah this looks a lot better, series applied, thanks. -- 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/