Skip to content
Snippets Groups Projects
  1. May 10, 2010
  2. Apr 22, 2010
  3. Apr 16, 2010
  4. Mar 30, 2010
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  5. Mar 24, 2010
  6. Feb 04, 2010
  7. Jan 08, 2010
  8. Dec 04, 2009
  9. Dec 03, 2009
  10. Dec 02, 2009
  11. Nov 30, 2009
  12. Nov 25, 2009
  13. Nov 19, 2009
  14. Nov 18, 2009
  15. Nov 06, 2009
    • Arnd Bergmann's avatar
      net, compat_ioctl: handle socket ioctl abuses in tty drivers · 9646e7ce
      Arnd Bergmann authored
      
      Slip and a few other drivers use the same ioctl numbers on
      tty devices that are normally meant for sockets. This causes
      problems with our compat_ioctl handling that tries to convert
      the data structures in a different format.
      
      Fortunately, these five drivers all use 32 bit compatible
      data structures in the ioctl numbers, so we can just add
      a trivial compat_ioctl conversion function to each of them.
      
      SIOCSIFENCAP and SIOCGIFENCAP do not need to live in
      fs/compat_ioctl.c after this any more, and they are not
      used on any sockets.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9646e7ce
  16. Oct 18, 2009
  17. Oct 13, 2009
  18. Oct 11, 2009
  19. Sep 11, 2009
    • Julia Lawall's avatar
      drivers/net/wan: introduce missing kfree · 966a5d1b
      Julia Lawall authored
      Error handling code following a kmalloc should free the allocated data.
      
      The semantic match that finds the problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/
      
      )
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,f1,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...x...+> }
      (
      x->f1 = E
      |
       (x->f1 == NULL || ...)
      |
       f(...,x->f1,...)
      )
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      966a5d1b
  20. Sep 07, 2009
    • Krzysztof Halasa's avatar
      IXP42x HSS support for setting internal clock rate · 5dbc4650
      Krzysztof Halasa authored
      
      HSS usually uses external clocks, so it's not a big deal. Internal clock
      is used for direct DTE-DTE connections and when the DCE doesn't provide
      it's own clock.
      
      This also depends on the oscillator frequency. Intel seems to have
      calculated the clock register settings for 33.33 MHz (66.66 MHz timer
      base). Their settings seem quite suboptimal both in terms of average
      frequency (60 ppm is unacceptable for G.703 applications, their primary
      intended usage(?)) and jitter.
      
      Many (most?) platforms use a 33.333 MHz oscillator, a 10 ppm difference
      from Intel's base.
      
      Instead of creating static tables, I've created a procedure to program
      the HSS clock register. The register consists of 3 parts (A, B, C).
      The average frequency (= bit rate) is:
      66.66x MHz / (A  + (B + 1) / (C + 1))
      The procedure aims at the closest average frequency, possibly at the
      cost of increased jitter. Nobody would be able to directly drive an
      unbufferred transmitter with a HSS anyway, and the frequency error is
      what it really counts.
      
      I've verified the above with an oscilloscope on IXP425. It seems IXP46x
      and possibly IXP43x use a bit different clock generation algorithm - it
      looks like the avg frequency is:
      (on IXP465) 66.66x MHz / (A  + B / (C + 1)).
      Also they use much greater precomputed A and B - on IXP425 it would
      simply result in more jitter, but I don't know how does it work on
      IXP46x (perhaps 3 least significant bits aren't used?).
      
      Anyway it looks that they were aiming for exactly +60 ppm or -60 ppm,
      while <1 ppm is typically possible (with a synchronized clock, of
      course).
      
      The attached patch makes it possible to set almost any bit rate
      (my IXP425 533 MHz quits at > 22 Mb/s if a single port is used, and the
      minimum is ca. 65 Kb/s).
      
      This is independent of MVIP (multi-E1/T1 on one HSS) mode.
      
      Signed-off-by: default avatarKrzysztof Hałasa <khc@pm.waw.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5dbc4650
    • Krzysztof Halasa's avatar
      WAN: remove deprecated PCI_DEVICE_ID from PCI200SYN driver. · 32e6a0c8
      Krzysztof Halasa authored
      
      PCI200SYN has its own PCI subsystem device ID for 3+ years, now it's
      time to remove the generic PLX905[02] ID from the driver. Anyone with
      old EEPROM data will have to run the upgrade.
      
      Having the generic PLX905[02] (PCI-local bus bridge) ID is harmful
      as the driver tries to handle other devices based on these bridges.
      
      Signed-off-by: default avatarKrzysztof Halasa <khc@pm.waw.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32e6a0c8
    • Stephen Hemminger's avatar
      wan: dlci/sdla transmit return dehacking · 38482428
      Stephen Hemminger authored
      
      This is a brute force removal of the wierd slave interface done for
      DLCI -> SDLA transmit. Before it was using non-standard return values
      and freeing skb in caller.  This changes it to using normal return
      values, and freeing in the callee.  Luckly only one driver pair was
      doing this. Not tested on real hardware, in fact I wonder if this
      driver pair is even being used by any users.
      
      Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38482428
  21. Sep 03, 2009
    • David S. Miller's avatar
      WAN: dscc4: Fix warning pointing out a bug. · fab4e763
      David S. Miller authored
      
      Noticed by Stephen Rothwell:
      
      	Today's linux-next build (x86_64 allmodconfig gcc-4.4.0)
      	produced this warning:
      
      	drivers/net/wan/dscc4.c: In function 'dscc4_rx_skb':
      	drivers/net/wan/dscc4.c:670: warning: suggest parentheses around comparison in operand of '|'
      
      	which actually points out a bug, I think.  It is doing
      		(x & (y | z)) != y | z
      	when it probably means
      		(x & (y | z)) != (y | z)
      
      	Introduced by commit 5de3fcab
      	("WAN: bit and/or confusion").
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fab4e763
  22. Sep 01, 2009
  23. Aug 30, 2009
  24. Aug 29, 2009
  25. Aug 13, 2009
  26. Jul 08, 2009
  27. Jul 05, 2009
  28. Jun 17, 2009
  29. Jun 13, 2009
Loading