Netdev List
 help / color / mirror / Atom feed
* Re: [E1000-devel] recent e100 fixes cause kernel panic?
From: Stephen Hemminger @ 2010-03-19 20:16 UTC (permalink / raw)
  To: Jesse Brandeburg
  Cc: Ed Ravin, roger.oksanen, e1000-devel@lists.sourceforge.net,
	Stephen Hemminger, netdev@vger.kernel.org
In-Reply-To: <1269027740.3029.33.camel@jbrandeb-mobl3.amr.corp.intel.com>

On Fri, 19 Mar 2010 12:42:20 -0700
Jesse Brandeburg <jesse.brandeburg@intel.com> wrote:

> Added netdev, the place to talk about in-kernel driver problems.
> 
> On Thu, 2010-03-11 at 22:39 -0700, Stephen Hemminger wrote:
> > ----- "Ed Ravin" <eravin@panix.com> wrote:
> > 
> > > I'm using the Vyatta "kenwood" Linux distribution, which is currently
> > > at 2.6.31-1.  I upgraded to their latest version, and began seeing
> > > kernel
> > > panics shortly after starting to use ssh/scp on the network connected
> > > to
> > > an e100 NIC.  I was able to reproduce the problem immediately after
> > > booting up - sometimes it even crashed during the boot.
> > > 
> > > One of the crash logs is attached.
> 
> Ed, thanks for the report, looks like these patches introduced a new
> problem.  e100 hardware has a tricky data structure that seems to cause
> some problems for (particularly arm) some cpu architectures.
> 
> > > 
> > > Since the problem seemed to be related to e100.c, I reverted the two
> > > commits to e100.c that had taken place since I last built the kernel
> > > for this box:
> > > 
> > >   Author: Roger Oksanen <roger.oksanen@cs.helsinki.fi>
> > >   Date:   Fri Dec 18 20:18:21 2009 -0800
> > >   e100: Fix broken cbs accounting due to missing memset.
> > > 
> > >   Author: Roger Oksanen <roger.oksanen@cs.helsinki.fi>
> > >   Date:   Sun Nov 29 17:17:29 2009 -0800
> > >   e100: Use pci pool to work around GFP_ATOMIC order 5 memory
> > > allocation failu
> > > 
> > > I rebuilt the kernel and it's not panicking anymore.
> 
> so you just reverted both, and its good news things are working again,
> but can you try one or the other and let us know if things still break
> for you?
> 
> > The Vyatta kernel for 2.6.31 is based on the 2.6.31.10 + unionfs.
> > These two patches came from the 2.6.31.10 -stable update.
> 
> This is the only report of this issue I have heard so far, so something
> must be a little unique to your system or workload such that the driver
> works mostly.
> 
> I'm looking more closely into the panic trace now, maybe I can figure it
> out from there.
> 

Davem found one thing, the memset wasn't initializing the whole maximum possible
tx ring.

-- 

^ permalink raw reply

* Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module
From: Wolfgang Grandegger @ 2010-03-19 20:13 UTC (permalink / raw)
  To: Ira W. Snyder
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, sameo-VuQAYsv1563Yd54FQh9/CA
In-Reply-To: <20100319200325.GE13672-lulEs6mt1IksTUYHLfqkUA@public.gmane.org>

Ira W. Snyder wrote:
> On Fri, Mar 19, 2010 at 04:45:09PM +0100, Wolfgang Grandegger wrote:
>> Ira W. Snyder wrote:
>>> On Fri, Mar 19, 2010 at 10:01:14AM +0100, Wolfgang Grandegger wrote:
>>>> Hi Ira,
>>>>
>>>> we already discussed this patch on the SocketCAN mailing list and there
>>>> are just a few minor issues and the request to add support for the new
>>>> "berr-reporting" option, if feasible. See:
>>>>
>>>>   commit 52c793f24054f5dc30d228e37e0e19cc8313f086
>>>>   Author: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
>>>>   Date:   Mon Feb 22 22:21:17 2010 +0000
>>>>
>>>>     can: netlink support for bus-error reporting and counters
>>>>     
>>>>     This patch makes the bus-error reporting configurable and allows to
>>>>     retrieve the CAN TX and RX bus error counters via netlink interface.
>>>>     I have added support for the SJA1000. The TX and RX bus error counters
>>>>     are also copied to the data fields 6..7 of error messages when state
>>>>     changes are reported.
>>>>
>>>> Should not be a big deal.
>>>>
>>> I think this patch came along since my last post of the driver. I must
>>> have missed it. I'll try and add support.
>> No problem, it's really new. Just just need to enable BEI depending on
>> CAN_CTRLMODE_BERR_REPORTING.
>>
> 
> I have one final question about this.
> 
> The documentation for the firmware isn't very specific here. I believe
> that in order to get any kind of error messages, I need the bus error
> feature turned on. What is the expected behavior of an SJA1000 with the
> BEI (bus error interrupt) turned off? Will you still get warning
> messages for ERROR_ACTIVE -> ERROR_PASSIVE state transitions?

Yes. State transitions are enabled with EI and EPI.

> I'm not sure how I would go about testing this feature, either. Ideas?

Send messages without cable connected and watch the error messages with
"candump any,0:0,#ffffffff". With "ip ... berr-reporting on" you should
see additional bus-errors.

> I also noticed that I can enable "self test mode" and "listen only mode"
> using the same firmware command. It appears that there are netlink
> messages for this as well. Should I try and support these, too? I don't
> really have any use for them (yet). I assume "self test mode" is
> equivalent to "loopback mode" in the netlink messages.

List-only is straight forward while "self test mode" is not exactly like
"loopback mode", IIRC. Feel free to send a follow-up patch when you have
time for a thorough implementation and testing. It's also on my to-do
list for the SJA1000.

Wolfgang.

> 
> Thanks,
> Ira
> 
> 

^ permalink raw reply

* Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module
From: Ira W. Snyder @ 2010-03-19 20:03 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linux-kernel, socketcan-core, netdev, sameo
In-Reply-To: <4BA39C05.8050800@grandegger.com>

On Fri, Mar 19, 2010 at 04:45:09PM +0100, Wolfgang Grandegger wrote:
> Ira W. Snyder wrote:
> > On Fri, Mar 19, 2010 at 10:01:14AM +0100, Wolfgang Grandegger wrote:
> >> Hi Ira,
> >>
> >> we already discussed this patch on the SocketCAN mailing list and there
> >> are just a few minor issues and the request to add support for the new
> >> "berr-reporting" option, if feasible. See:
> >>
> >>   commit 52c793f24054f5dc30d228e37e0e19cc8313f086
> >>   Author: Wolfgang Grandegger <wg@grandegger.com>
> >>   Date:   Mon Feb 22 22:21:17 2010 +0000
> >>
> >>     can: netlink support for bus-error reporting and counters
> >>     
> >>     This patch makes the bus-error reporting configurable and allows to
> >>     retrieve the CAN TX and RX bus error counters via netlink interface.
> >>     I have added support for the SJA1000. The TX and RX bus error counters
> >>     are also copied to the data fields 6..7 of error messages when state
> >>     changes are reported.
> >>
> >> Should not be a big deal.
> >>
> > 
> > I think this patch came along since my last post of the driver. I must
> > have missed it. I'll try and add support.
> 
> No problem, it's really new. Just just need to enable BEI depending on
> CAN_CTRLMODE_BERR_REPORTING.
> 

I have one final question about this.

The documentation for the firmware isn't very specific here. I believe
that in order to get any kind of error messages, I need the bus error
feature turned on. What is the expected behavior of an SJA1000 with the
BEI (bus error interrupt) turned off? Will you still get warning
messages for ERROR_ACTIVE -> ERROR_PASSIVE state transitions?

I'm not sure how I would go about testing this feature, either. Ideas?

I also noticed that I can enable "self test mode" and "listen only mode"
using the same firmware command. It appears that there are netlink
messages for this as well. Should I try and support these, too? I don't
really have any use for them (yet). I assume "self test mode" is
equivalent to "loopback mode" in the netlink messages.

Thanks,
Ira

^ permalink raw reply

* [PATCH] Cosmetic:Partially remove deprecated __initcall() and change to
From: Justin P. Mattock @ 2010-03-19 19:51 UTC (permalink / raw)
  To: trivial
  Cc: linux-arm-kernel, linux-audit, uclinux-dist-devel,
	linux-cris-kernel, linux-ia64, linux-mips, linux-parisc,
	linux-s390, selinux, sparclinux, x86, netdev, linux-kernel,
	Justin P. Mattock

After doing some things on a small issue,
I noticed through web surfing, that there were patches
submitted pertaining that __initcall is deprecated,
and device_initcall should be used.

So as a change of subject(since what I was looking at
was frustrating me),I decided to grep the whole tree
and make the change(partially).

Currently I'm running this patch on my system, kernel compiles
without any errors or warnings.(thought there would be a speed increase
but didn't see much(if any)).
Biggest problem I have though is testing this on other hardware types
(I only have a macbook,and an iMac).
So please if you have the access to other arch/hardware types please
test.

Now what I mean by partially is the __initcall function is still
there, so(if any) userspace apps/libs depend on this it's there
so they dont break and/or any other subsystem, that needs time
to make the changes.

Note:
the remaining files that still have __initcall in them are:
(according to grep)

arch/um/include/shared/init.h
include/linux/init.h
scripts/checkpatch.pl

either I or somebody else, can change this(although a bit
concerned about breaking things).

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
 Documentation/DocBook/kernel-hacking.tmpl    |    4 ++--
 Documentation/cpu-freq/cpu-drivers.txt       |    2 +-
 Documentation/kbuild/makefiles.txt           |    2 +-
 arch/arm/mach-at91/leds.c                    |    2 +-
 arch/arm/mach-clps711x/p720t.c               |    2 +-
 arch/arm/mach-ebsa110/leds.c                 |    2 +-
 arch/arm/mach-footbridge/cats-hw.c           |    2 +-
 arch/arm/mach-footbridge/ebsa285-leds.c      |    2 +-
 arch/arm/mach-footbridge/netwinder-hw.c      |    2 +-
 arch/arm/mach-footbridge/netwinder-leds.c    |    2 +-
 arch/arm/mach-ks8695/leds.c                  |    2 +-
 arch/arm/mach-omap1/leds.c                   |    2 +-
 arch/arm/mach-omap1/pm.c                     |    2 +-
 arch/arm/mach-orion5x/db88f5281-setup.c      |    2 +-
 arch/arm/mach-orion5x/rd88f5182-setup.c      |    2 +-
 arch/arm/mach-pxa/generic.c                  |    2 +-
 arch/arm/mach-pxa/pxa25x.c                   |    2 +-
 arch/arm/mach-shark/leds.c                   |    2 +-
 arch/blackfin/kernel/bfin_gpio.c             |    2 +-
 arch/blackfin/mach-common/pm.c               |    2 +-
 arch/cris/arch-v10/kernel/debugport.c        |    2 +-
 arch/cris/arch-v10/kernel/fasttimer.c        |    2 +-
 arch/cris/arch-v10/mm/init.c                 |    2 +-
 arch/cris/arch-v32/kernel/fasttimer.c        |    2 +-
 arch/cris/arch-v32/kernel/pinmux.c           |    2 +-
 arch/cris/arch-v32/kernel/signal.c           |    2 +-
 arch/cris/arch-v32/mach-a3/io.c              |    2 +-
 arch/cris/arch-v32/mach-a3/pinmux.c          |    2 +-
 arch/cris/arch-v32/mach-fs/io.c              |    2 +-
 arch/cris/arch-v32/mach-fs/pinmux.c          |    2 +-
 arch/cris/kernel/profile.c                   |    2 +-
 arch/cris/kernel/time.c                      |    2 +-
 arch/cris/kernel/traps.c                     |    2 +-
 arch/frv/kernel/gdb-stub.c                   |    2 +-
 arch/frv/kernel/pm-mb93093.c                 |    2 +-
 arch/frv/kernel/pm.c                         |    2 +-
 arch/frv/kernel/sysctl.c                     |    2 +-
 arch/h8300/kernel/gpio.c                     |    2 +-
 arch/ia64/hp/sim/simeth.c                    |    2 +-
 arch/ia64/hp/sim/simserial.c                 |    2 +-
 arch/ia64/kernel/audit.c                     |    2 +-
 arch/ia64/kernel/crash.c                     |    2 +-
 arch/ia64/kernel/cyclone.c                   |    2 +-
 arch/ia64/kernel/perfmon.c                   |    2 +-
 arch/ia64/kernel/setup.c                     |    2 +-
 arch/ia64/kernel/uncached.c                  |    2 +-
 arch/ia64/kernel/unwind.c                    |    2 +-
 arch/ia64/mm/init.c                          |    2 +-
 arch/mips/Makefile                           |    2 +-
 arch/mips/kernel/unaligned.c                 |    2 +-
 arch/mips/lasat/sysctl.c                     |    2 +-
 arch/mips/math-emu/cp1emu.c                  |    2 +-
 arch/mips/nxp/pnx8550/common/proc.c          |    2 +-
 arch/mips/sibyte/sb1250/bus_watcher.c        |    2 +-
 arch/mn10300/kernel/gdb-stub.c               |    2 +-
 arch/mn10300/kernel/mn10300-serial.c         |    2 +-
 arch/mn10300/kernel/profile.c                |    2 +-
 arch/parisc/kernel/pci-dma.c                 |    2 +-
 arch/parisc/kernel/pdc_chassis.c             |    2 +-
 arch/powerpc/kernel/audit.c                  |    2 +-
 arch/powerpc/kernel/idle.c                   |    2 +-
 arch/powerpc/kernel/irq.c                    |    2 +-
 arch/powerpc/kernel/proc_powerpc.c           |    2 +-
 arch/powerpc/kernel/prom.c                   |    4 ++--
 arch/powerpc/kernel/rtas-proc.c              |    2 +-
 arch/powerpc/kernel/rtasd.c                  |    2 +-
 arch/powerpc/kernel/sysfs.c                  |    2 +-
 arch/powerpc/kernel/tau_6xx.c                |    2 +-
 arch/powerpc/kernel/vio.c                    |    2 +-
 arch/powerpc/platforms/iseries/lpevents.c    |    2 +-
 arch/powerpc/platforms/iseries/mf.c          |    2 +-
 arch/powerpc/platforms/iseries/proc.c        |    2 +-
 arch/powerpc/platforms/iseries/viopath.c     |    2 +-
 arch/powerpc/platforms/pseries/eeh.c         |    2 +-
 arch/powerpc/platforms/pseries/hvCall_inst.c |    2 +-
 arch/powerpc/platforms/pseries/power.c       |    2 +-
 arch/powerpc/platforms/pseries/ras.c         |    2 +-
 arch/powerpc/platforms/pseries/reconfig.c    |    2 +-
 arch/powerpc/xmon/xmon.c                     |    2 +-
 arch/s390/appldata/appldata_base.c           |    2 +-
 arch/s390/kernel/audit.c                     |    2 +-
 arch/s390/kernel/compat_exec_domain.c        |    2 +-
 arch/s390/kernel/ipl.c                       |    2 +-
 arch/s390/kernel/topology.c                  |    2 +-
 arch/sh/boards/board-edosk7760.c             |    2 +-
 arch/sh/boards/board-sh7785lcr.c             |    2 +-
 arch/sh/boards/mach-cayman/setup.c           |    2 +-
 arch/sh/boards/mach-landisk/setup.c          |    2 +-
 arch/sh/boards/mach-r2d/setup.c              |    2 +-
 arch/sh/boards/mach-sdk7786/setup.c          |    2 +-
 arch/sh/boards/mach-se/7206/setup.c          |    2 +-
 arch/sh/boards/mach-se/7751/setup.c          |    2 +-
 arch/sh/boards/mach-sh03/setup.c             |    2 +-
 arch/sh/kernel/traps_64.c                    |    2 +-
 arch/sparc/kernel/apc.c                      |    2 +-
 arch/sparc/kernel/audit.c                    |    2 +-
 arch/sparc/kernel/mdesc.c                    |    2 +-
 arch/sparc/kernel/pmc.c                      |    2 +-
 arch/um/drivers/mconsole_kern.c              |    8 ++++----
 arch/um/drivers/net_kern.c                   |    2 +-
 arch/um/drivers/stderr_console.c             |    2 +-
 arch/um/drivers/ubd_kern.c                   |    4 ++--
 arch/um/kernel/exitcode.c                    |    2 +-
 arch/um/kernel/physmem.c                     |    2 +-
 arch/um/os-Linux/aio.c                       |    4 ++--
 arch/um/os-Linux/skas/mem.c                  |    2 +-
 arch/um/os-Linux/skas/process.c              |    2 +-
 arch/um/os-Linux/umid.c                      |    2 +-
 arch/um/sys-i386/tls.c                       |    2 +-
 arch/x86/kernel/audit_64.c                   |    2 +-
 arch/x86/kernel/tlb_uv.c                     |    4 ++--
 arch/x86/kernel/vsyscall_64.c                |    4 ++--
 arch/x86/mm/dump_pagetables.c                |    2 +-
 arch/x86/vdso/vdso32-setup.c                 |    4 ++--
 arch/x86/vdso/vma.c                          |    2 +-
 arch/xtensa/platforms/iss/console.c          |    2 +-
 drivers/net/arm/am79c961a.c                  |    2 +-
 drivers/net/hamradio/baycom_epp.c            |    1 +
 drivers/net/hamradio/baycom_par.c            |    1 +
 drivers/net/hamradio/baycom_ser_fdx.c        |    1 +
 drivers/net/hamradio/baycom_ser_hdx.c        |    1 +
 drivers/s390/char/sclp_cmd.c                 |    2 +-
 drivers/s390/char/sclp_config.c              |    2 +-
 drivers/s390/char/sclp_cpi_sys.c             |    2 +-
 drivers/s390/char/sclp_vt220.c               |    2 +-
 drivers/s390/cio/blacklist.c                 |    2 +-
 drivers/staging/rtl8192u/ieee80211/api.c     |    2 +-
 fs/aio.c                                     |    2 +-
 fs/compat_ioctl.c                            |    2 +-
 ipc/ipc_sysctl.c                             |    2 +-
 ipc/mqueue.c                                 |    2 +-
 ipc/util.c                                   |    2 +-
 kernel/audit.c                               |    2 +-
 kernel/audit_tree.c                          |    2 +-
 kernel/dma.c                                 |    2 +-
 kernel/futex.c                               |    2 +-
 kernel/lockdep_proc.c                        |    2 +-
 kernel/pid_namespace.c                       |    2 +-
 kernel/posix-cpu-timers.c                    |    2 +-
 kernel/posix-timers.c                        |    2 +-
 kernel/resource.c                            |    2 +-
 kernel/sched_debug.c                         |    2 +-
 kernel/time/timer_list.c                     |    2 +-
 kernel/time/timer_stats.c                    |    2 +-
 kernel/tracepoint.c                          |    2 +-
 kernel/utsname_sysctl.c                      |    2 +-
 lib/audit.c                                  |    2 +-
 lib/debugobjects.c                           |    2 +-
 mm/bounce.c                                  |    2 +-
 mm/memory.c                                  |    2 +-
 mm/mm_init.c                                 |    2 +-
 mm/slab.c                                    |    2 +-
 mm/slub.c                                    |    2 +-
 mm/swapfile.c                                |    2 +-
 net/ipv4/syncookies.c                        |    2 +-
 net/ipv4/sysctl_net_ipv4.c                   |    2 +-
 security/keys/proc.c                         |    2 +-
 security/selinux/hooks.c                     |    2 +-
 security/selinux/netif.c                     |    2 +-
 security/selinux/netlink.c                   |    2 +-
 security/selinux/netnode.c                   |    2 +-
 security/selinux/netport.c                   |    2 +-
 security/selinux/selinuxfs.c                 |    2 +-
 security/selinux/ss/services.c               |    2 +-
 security/smack/smackfs.c                     |    2 +-
 sound/last.c                                 |    2 +-
 166 files changed, 176 insertions(+), 172 deletions(-)

diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
index 7b3f493..a682709 100644
--- a/Documentation/DocBook/kernel-hacking.tmpl
+++ b/Documentation/DocBook/kernel-hacking.tmpl
@@ -734,7 +734,7 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
   </sect1>
 
   <sect1 id="routines-init-again">
-   <title><function>__initcall()</function>/<function>module_init()</function>
+   <title><function>device_initcall()</function>/<function>module_init()</function>
     <filename class="headerfile">include/linux/init.h</filename></title>
    <para>
     Many parts of the kernel are well served as a module
@@ -750,7 +750,7 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
     function is to be called at module insertion time (if the file is
     compiled as a module), or at boot time: if the file is not
     compiled as a module the <function>module_init()</function> macro
-    becomes equivalent to <function>__initcall()</function>, which
+    becomes equivalent to <function>device_initcall()</function>, which
     through linker magic ensures that the function is called on boot.
    </para>
 
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
index 6c30e93..12bb6e4 100644
--- a/Documentation/cpu-freq/cpu-drivers.txt
+++ b/Documentation/cpu-freq/cpu-drivers.txt
@@ -41,7 +41,7 @@ on what is necessary:
 1.1 Initialization
 ------------------
 
-First of all, in an __initcall level 7 (module_init()) or later
+First of all, in an device_initcall level 7 (module_init()) or later
 function check whether this kernel runs on the right CPU and the right
 chipset. If so, register a struct cpufreq_driver with the CPUfreq core
 using cpufreq_register_driver()
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 71c602d..645ea71 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -159,7 +159,7 @@ more details, with real examples.
 	built-in.o and succeeding instances will be ignored.
 
 	Link order is significant, because certain functions
-	(module_init() / __initcall) will be called during boot in the
+	(module_init() / device_initcall) will be called during boot in the
 	order they appear. So keep in mind that changing the link
 	order may e.g. change the order in which your SCSI
 	controllers are detected, and thus your disks are renumbered.
diff --git a/arch/arm/mach-at91/leds.c b/arch/arm/mach-at91/leds.c
index 0415a83..08e342d 100644
--- a/arch/arm/mach-at91/leds.c
+++ b/arch/arm/mach-at91/leds.c
@@ -179,7 +179,7 @@ static int __init leds_init(void)
 	return 0;
 }
 
-__initcall(leds_init);
+device_initcall(leds_init);
 
 
 void __init at91_init_leds(u8 cpu_led, u8 timer_led)
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index 0d94a30..1047b23 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -121,5 +121,5 @@ static int p720t_hw_init(void)
 	return 0;
 }
 
-__initcall(p720t_hw_init);
+device_initcall(p720t_hw_init);
 
diff --git a/arch/arm/mach-ebsa110/leds.c b/arch/arm/mach-ebsa110/leds.c
index 6a6ea57..8b57907 100644
--- a/arch/arm/mach-ebsa110/leds.c
+++ b/arch/arm/mach-ebsa110/leds.c
@@ -48,4 +48,4 @@ static int __init leds_init(void)
 	return 0;
 }
 
-__initcall(leds_init);
+device_initcall(leds_init);
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index 1b996b2..1b616e5 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -69,7 +69,7 @@ static int __init cats_hw_init(void)
 	return 0;
 }
 
-__initcall(cats_hw_init);
+device_initcall(cats_hw_init);
 
 /*
  * CATS uses soft-reboot by default, since
diff --git a/arch/arm/mach-footbridge/ebsa285-leds.c b/arch/arm/mach-footbridge/ebsa285-leds.c
index 4e10090..f162fb2 100644
--- a/arch/arm/mach-footbridge/ebsa285-leds.c
+++ b/arch/arm/mach-footbridge/ebsa285-leds.c
@@ -136,4 +136,4 @@ static int __init leds_init(void)
 	return 0;
 }
 
-__initcall(leds_init);
+device_initcall(leds_init);
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index ac7ffa6..090b4cf 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -623,7 +623,7 @@ static int __init nw_hw_init(void)
 	return 0;
 }
 
-__initcall(nw_hw_init);
+device_initcall(nw_hw_init);
 
 /*
  * Older NeTTroms either do not provide a parameters
diff --git a/arch/arm/mach-footbridge/netwinder-leds.c b/arch/arm/mach-footbridge/netwinder-leds.c
index 00269fe..f504682 100644
--- a/arch/arm/mach-footbridge/netwinder-leds.c
+++ b/arch/arm/mach-footbridge/netwinder-leds.c
@@ -136,4 +136,4 @@ static int __init leds_init(void)
 	return 0;
 }
 
-__initcall(leds_init);
+device_initcall(leds_init);
diff --git a/arch/arm/mach-ks8695/leds.c b/arch/arm/mach-ks8695/leds.c
index 184ef74..97c3828 100644
--- a/arch/arm/mach-ks8695/leds.c
+++ b/arch/arm/mach-ks8695/leds.c
@@ -90,4 +90,4 @@ static int __init leds_init(void)
 	return 0;
 }
 
-__initcall(leds_init);
+device_initcall(leds_init);
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
index 277f356..bd447fa 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -63,4 +63,4 @@ omap_leds_init(void)
 	return 0;
 }
 
-__initcall(omap_leds_init);
+device_initcall(omap_leds_init);
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index b1d3f9f..fda5f60 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -724,4 +724,4 @@ static int __init omap_pm_init(void)
 
 	return 0;
 }
-__initcall(omap_pm_init);
+device_initcall(omap_pm_init);
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index d318bea..0c76893 100644
--- a/arch/arm/mach-orion5x/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -197,7 +197,7 @@ static int __init db88f5281_7seg_init(void)
 	return 0;
 }
 
-__initcall(db88f5281_7seg_init);
+device_initcall(db88f5281_7seg_init);
 
 /*****************************************************************************
  * PCI
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index a04f9e4..43e9a49 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -130,7 +130,7 @@ static int __init rd88f5182_dbgled_init(void)
 	return 0;
 }
 
-__initcall(rd88f5182_dbgled_init);
+device_initcall(rd88f5182_dbgled_init);
 
 #endif
 
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 3126a35..1d44a9a 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -12,7 +12,7 @@
  * published by the Free Software Foundation.
  *
  * Since this file should be linked before any other machine specific file,
- * the __initcall() here will be executed first.  This serves as default
+ * the device_initcall() here will be executed first.  This serves as default
  * initialization stuff for PXA machines which can be overridden later if
  * need be.
  */
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 0b9ad30..b0df545 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -12,7 +12,7 @@
  * published by the Free Software Foundation.
  *
  * Since this file should be linked before any other machine specific file,
- * the __initcall() here will be executed first.  This serves as default
+ * the device_initcall() here will be executed first.  This serves as default
  * initialization stuff for PXA machines which can be overridden later if
  * need be.
  */
diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c
index c9e32de..511693a 100644
--- a/arch/arm/mach-shark/leds.c
+++ b/arch/arm/mach-shark/leds.c
@@ -163,4 +163,4 @@ static int __init leds_init(void)
 	return 0;
 }
 
-__initcall(leds_init);
+device_initcall(leds_init);
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index a174596..bc5ba54 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -1285,7 +1285,7 @@ static __init int gpio_register_proc(void)
 		proc_gpio->read_proc = gpio_proc_read;
 	return proc_gpio != NULL;
 }
-__initcall(gpio_register_proc);
+device_initcall(gpio_register_proc);
 #endif
 
 #ifdef CONFIG_GPIOLIB
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index 8837be4..dc36d3a 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -266,4 +266,4 @@ static int __init bfin_pm_init(void)
 	return 0;
 }
 
-__initcall(bfin_pm_init);
+device_initcall(bfin_pm_init);
diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c
index 99851ba..0348977 100644
--- a/arch/cris/arch-v10/kernel/debugport.c
+++ b/arch/cris/arch-v10/kernel/debugport.c
@@ -564,4 +564,4 @@ init_etrax_debug(void)
 #endif
 	return 0;
 }
-__initcall(init_etrax_debug);
+device_initcall(init_etrax_debug);
diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c
index 5ff08a8..b991462 100644
--- a/arch/cris/arch-v10/kernel/fasttimer.c
+++ b/arch/cris/arch-v10/kernel/fasttimer.c
@@ -879,4 +879,4 @@ int fast_timer_init(void)
   }
 	return 0;
 }
-__initcall(fast_timer_init);
+device_initcall(fast_timer_init);
diff --git a/arch/cris/arch-v10/mm/init.c b/arch/cris/arch-v10/mm/init.c
index baa746c..908d829 100644
--- a/arch/cris/arch-v10/mm/init.c
+++ b/arch/cris/arch-v10/mm/init.c
@@ -217,7 +217,7 @@ __init init_ioremap(void)
 	return 0;
 }
 
-__initcall(init_ioremap);
+device_initcall(init_ioremap);
 
 /* Helper function for the two below */
 
diff --git a/arch/cris/arch-v32/kernel/fasttimer.c b/arch/cris/arch-v32/kernel/fasttimer.c
index 111caa1..221bcea 100644
--- a/arch/cris/arch-v32/kernel/fasttimer.c
+++ b/arch/cris/arch-v32/kernel/fasttimer.c
@@ -833,4 +833,4 @@ int fast_timer_init(void)
   }
 	return 0;
 }
-__initcall(fast_timer_init);
+device_initcall(fast_timer_init);
diff --git a/arch/cris/arch-v32/kernel/pinmux.c b/arch/cris/arch-v32/kernel/pinmux.c
index f6f3637..c2dfcd3 100644
--- a/arch/cris/arch-v32/kernel/pinmux.c
+++ b/arch/cris/arch-v32/kernel/pinmux.c
@@ -226,4 +226,4 @@ crisv32_pinmux_dump(void)
 	}
 }
 
-__initcall(crisv32_pinmux_init);
+device_initcall(crisv32_pinmux_init);
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index 372d0ca..d1e1b4e 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -672,4 +672,4 @@ cris_init_signal(void)
 	return 0;
 }
 
-__initcall(cris_init_signal);
+device_initcall(cris_init_signal);
diff --git a/arch/cris/arch-v32/mach-a3/io.c b/arch/cris/arch-v32/mach-a3/io.c
index 090ceb9..ea40a9b 100644
--- a/arch/cris/arch-v32/mach-a3/io.c
+++ b/arch/cris/arch-v32/mach-a3/io.c
@@ -95,7 +95,7 @@ static int __init crisv32_io_init(void)
 	return ret;
 }
 
-__initcall(crisv32_io_init);
+device_initcall(crisv32_io_init);
 
 int crisv32_io_get(struct crisv32_iopin *iopin,
 	unsigned int port, unsigned int pin)
diff --git a/arch/cris/arch-v32/mach-a3/pinmux.c b/arch/cris/arch-v32/mach-a3/pinmux.c
index 18648ef..14bbc78 100644
--- a/arch/cris/arch-v32/mach-a3/pinmux.c
+++ b/arch/cris/arch-v32/mach-a3/pinmux.c
@@ -383,4 +383,4 @@ crisv32_pinmux_dump(void)
 	}
 }
 
-__initcall(crisv32_pinmux_init);
+device_initcall(crisv32_pinmux_init);
diff --git a/arch/cris/arch-v32/mach-fs/io.c b/arch/cris/arch-v32/mach-fs/io.c
index a695866..fce8438 100644
--- a/arch/cris/arch-v32/mach-fs/io.c
+++ b/arch/cris/arch-v32/mach-fs/io.c
@@ -128,7 +128,7 @@ static int __init crisv32_io_init(void)
 	return ret;
 }
 
-__initcall(crisv32_io_init);
+device_initcall(crisv32_io_init);
 
 int crisv32_io_get(struct crisv32_iopin *iopin,
 		   unsigned int port, unsigned int pin)
diff --git a/arch/cris/arch-v32/mach-fs/pinmux.c b/arch/cris/arch-v32/mach-fs/pinmux.c
index 38f29ee..751f991 100644
--- a/arch/cris/arch-v32/mach-fs/pinmux.c
+++ b/arch/cris/arch-v32/mach-fs/pinmux.c
@@ -306,4 +306,4 @@ void crisv32_pinmux_dump(void)
 	}
 }
 
-__initcall(crisv32_pinmux_init);
+device_initcall(crisv32_pinmux_init);
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c
index 9aa5711..2472f3f 100644
--- a/arch/cris/kernel/profile.c
+++ b/arch/cris/kernel/profile.c
@@ -82,4 +82,4 @@ __init init_cris_profile(void)
 	return 0;
 }
 
-__initcall(init_cris_profile);
+device_initcall(init_cris_profile);
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c
index a05dd31..7554e96 100644
--- a/arch/cris/kernel/time.c
+++ b/arch/cris/kernel/time.c
@@ -160,4 +160,4 @@ __init init_udelay(void)
 	return 0;
 }
 
-__initcall(init_udelay);
+device_initcall(init_udelay);
diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c
index 541efbf..8f77b68 100644
--- a/arch/cris/kernel/traps.c
+++ b/arch/cris/kernel/traps.c
@@ -177,7 +177,7 @@ oops_nmi_register(void)
 	return 0;
 }
 
-__initcall(oops_nmi_register);
+device_initcall(oops_nmi_register);
 
 #endif
 
diff --git a/arch/frv/kernel/gdb-stub.c b/arch/frv/kernel/gdb-stub.c
index 7ca8a6b..71d564c 100644
--- a/arch/frv/kernel/gdb-stub.c
+++ b/arch/frv/kernel/gdb-stub.c
@@ -2017,7 +2017,7 @@ static int __init gdbstub_postinit(void)
 	return 0;
 } /* end gdbstub_postinit() */
 
-__initcall(gdbstub_postinit);
+device_initcall(gdbstub_postinit);
 #endif
 
 /*****************************************************************************/
diff --git a/arch/frv/kernel/pm-mb93093.c b/arch/frv/kernel/pm-mb93093.c
index eaa7b58..3caa348 100644
--- a/arch/frv/kernel/pm-mb93093.c
+++ b/arch/frv/kernel/pm-mb93093.c
@@ -61,5 +61,5 @@ static int __init mb93093_pm_init(void)
 	return 0;
 }
 
-__initcall(mb93093_pm_init);
+device_initcall(mb93093_pm_init);
 
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index 5fa3889..b1aad48 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -348,6 +348,6 @@ static int __init pm_init(void)
 	return 0;
 }
 
-__initcall(pm_init);
+device_initcall(pm_init);
 
 #endif
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 035516c..3280f8b 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -217,4 +217,4 @@ static int __init frv_sysctl_init(void)
 	return 0;
 }
 
-__initcall(frv_sysctl_init);
+device_initcall(frv_sysctl_init);
diff --git a/arch/h8300/kernel/gpio.c b/arch/h8300/kernel/gpio.c
index 6a25dd5..6ea7dd9 100644
--- a/arch/h8300/kernel/gpio.c
+++ b/arch/h8300/kernel/gpio.c
@@ -164,7 +164,7 @@ static __init int register_proc(void)
 	return proc_gpio != NULL;
 }
 
-__initcall(register_proc);
+device_initcall(register_proc);
 #endif
 
 void __init h8300_gpio_init(void)
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index 7e81966..e669908 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -524,4 +524,4 @@ set_multicast_list(struct net_device *dev)
 	printk(KERN_WARNING "%s: set_multicast_list called\n", dev->name);
 }
 
-__initcall(simeth_probe);
+device_initcall(simeth_probe);
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 2bef526..470c0a1 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -980,5 +980,5 @@ simrs_init (void)
 }
 
 #ifndef MODULE
-__initcall(simrs_init);
+device_initcall(simrs_init);
 #endif
diff --git a/arch/ia64/kernel/audit.c b/arch/ia64/kernel/audit.c
index 96a9d18..c7d79ba 100644
--- a/arch/ia64/kernel/audit.c
+++ b/arch/ia64/kernel/audit.c
@@ -57,4 +57,4 @@ static int __init audit_classes_init(void)
 	return 0;
 }
 
-__initcall(audit_classes_init);
+device_initcall(audit_classes_init);
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index b942f40..07218af 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -282,5 +282,5 @@ machine_crash_setup(void)
 	return 0;
 }
 
-__initcall(machine_crash_setup);
+device_initcall(machine_crash_setup);
 
diff --git a/arch/ia64/kernel/cyclone.c b/arch/ia64/kernel/cyclone.c
index 71e3586..66fb97e 100644
--- a/arch/ia64/kernel/cyclone.c
+++ b/arch/ia64/kernel/cyclone.c
@@ -125,4 +125,4 @@ int __init init_cyclone_clock(void)
 	return 0;
 }
 
-__initcall(init_cyclone_clock);
+device_initcall(init_cyclone_clock);
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 703062c..cb7199a 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -6700,7 +6700,7 @@ pfm_init(void)
 	return 0;
 }
 
-__initcall(pfm_init);
+device_initcall(pfm_init);
 
 /*
  * this function is called before pfm_init()
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 41ae6a5..8322a01 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -243,7 +243,7 @@ static int __init register_memory(void)
 	return 0;
 }
 
-__initcall(register_memory);
+device_initcall(register_memory);
 
 
 #ifdef CONFIG_KEXEC
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index a595823..4a9812f 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -279,4 +279,4 @@ static int __init uncached_init(void)
 	return 0;
 }
 
-__initcall(uncached_init);
+device_initcall(uncached_init);
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index b6c0e63..62de896 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -2223,7 +2223,7 @@ create_gate_table (void)
 	return 0;
 }
 
-__initcall(create_gate_table);
+device_initcall(create_gate_table);
 
 void __init
 unw_init (void)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index ed41759..da31b31 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -716,4 +716,4 @@ per_linux32_init(void)
 	return 0;
 }
 
-__initcall(per_linux32_init);
+device_initcall(per_linux32_init);
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 2f2eac2..0341a9e 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -534,7 +534,7 @@ load-$(CONFIG_SGI_IP32)		+= 0xffffffff80004000
 #
 # This is a LIB so that it links at the end, and initcalls are later
 # the sequence; but it is built as an object so that modules don't get
-# removed (as happens, even if they have __initcall/module_init)
+# removed (as happens, even if they have device_initcall/module_init)
 #
 core-$(CONFIG_SIBYTE_BCM112X)	+= arch/mips/sibyte/sb1250/
 core-$(CONFIG_SIBYTE_BCM112X)	+= arch/mips/sibyte/common/
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index 69b039c..7233ac8 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -567,5 +567,5 @@ static int __init debugfs_unaligned(void)
 		return -ENOMEM;
 	return 0;
 }
-__initcall(debugfs_unaligned);
+device_initcall(debugfs_unaligned);
 #endif
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index d87ffd0..6cc8d2f 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -285,4 +285,4 @@ static int __init lasat_register_sysctl(void)
 	return 0;
 }
 
-__initcall(lasat_register_sysctl);
+device_initcall(lasat_register_sysctl);
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 8f2f8e9..3936be4 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -1325,5 +1325,5 @@ static int __init debugfs_fpuemu(void)
 
 	return 0;
 }
-__initcall(debugfs_fpuemu);
+device_initcall(debugfs_fpuemu);
 #endif
diff --git a/arch/mips/nxp/pnx8550/common/proc.c b/arch/mips/nxp/pnx8550/common/proc.c
index af094cd..9a10d8c 100644
--- a/arch/mips/nxp/pnx8550/common/proc.c
+++ b/arch/mips/nxp/pnx8550/common/proc.c
@@ -108,4 +108,4 @@ static int pnx8550_proc_init( void )
 	return 0;
 }
 
-__initcall(pnx8550_proc_init);
+device_initcall(pnx8550_proc_init);
diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c
index 45274bd..e8e7f23 100644
--- a/arch/mips/sibyte/sb1250/bus_watcher.c
+++ b/arch/mips/sibyte/sb1250/bus_watcher.c
@@ -255,4 +255,4 @@ int __init sibyte_bus_watcher(void)
 	return 0;
 }
 
-__initcall(sibyte_bus_watcher);
+device_initcall(sibyte_bus_watcher);
diff --git a/arch/mn10300/kernel/gdb-stub.c b/arch/mn10300/kernel/gdb-stub.c
index 41b1170..22e0613 100644
--- a/arch/mn10300/kernel/gdb-stub.c
+++ b/arch/mn10300/kernel/gdb-stub.c
@@ -1884,7 +1884,7 @@ static int __init gdbstub_postinit(void)
 	return 0;
 }
 
-__initcall(gdbstub_postinit);
+device_initcall(gdbstub_postinit);
 #endif
 
 /*
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c
index ef34d5a..9cada2f 100644
--- a/arch/mn10300/kernel/mn10300-serial.c
+++ b/arch/mn10300/kernel/mn10300-serial.c
@@ -1350,7 +1350,7 @@ static int __init mn10300_serial_init(void)
 	return ret;
 }
 
-__initcall(mn10300_serial_init);
+device_initcall(mn10300_serial_init);
 
 
 #ifdef CONFIG_MN10300_TTYSM_CONSOLE
diff --git a/arch/mn10300/kernel/profile.c b/arch/mn10300/kernel/profile.c
index 20d7d03..e799032 100644
--- a/arch/mn10300/kernel/profile.c
+++ b/arch/mn10300/kernel/profile.c
@@ -48,4 +48,4 @@ static __init int profile_init(void)
 	return 0;
 }
 
-__initcall(profile_init);
+device_initcall(profile_init);
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index c07f618..e7c12c0 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -410,7 +410,7 @@ pcxl_dma_init(void)
 	return 0;
 }
 
-__initcall(pcxl_dma_init);
+device_initcall(pcxl_dma_init);
 
 static void * pa11_dma_alloc_consistent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag)
 {
diff --git a/arch/parisc/kernel/pdc_chassis.c b/arch/parisc/kernel/pdc_chassis.c
index d47ba1a..35ad4cb 100644
--- a/arch/parisc/kernel/pdc_chassis.c
+++ b/arch/parisc/kernel/pdc_chassis.c
@@ -295,7 +295,7 @@ static int __init pdc_chassis_create_procfs(void)
 	return 0;
 }
 
-__initcall(pdc_chassis_create_procfs);
+device_initcall(pdc_chassis_create_procfs);
 
 #endif /* CONFIG_PROC_FS */
 #endif /* CONFIG_PDC_CHASSIS_WARN */
diff --git a/arch/powerpc/kernel/audit.c b/arch/powerpc/kernel/audit.c
index a4dab7c..e721e2e 100644
--- a/arch/powerpc/kernel/audit.c
+++ b/arch/powerpc/kernel/audit.c
@@ -80,4 +80,4 @@ static int __init audit_classes_init(void)
 	return 0;
 }
 
-__initcall(audit_classes_init);
+device_initcall(audit_classes_init);
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 049dda6..694861f 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -134,5 +134,5 @@ register_powersave_nap_sysctl(void)
 
 	return 0;
 }
-__initcall(register_powersave_nap_sysctl);
+device_initcall(register_powersave_nap_sysctl);
 #endif
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 64f6f20..2e97ae9 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -1203,7 +1203,7 @@ static int __init irq_debugfs_init(void)
 
 	return 0;
 }
-__initcall(irq_debugfs_init);
+device_initcall(irq_debugfs_init);
 #endif /* CONFIG_VIRQ_DEBUG */
 
 #ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c
index 1ed3b8d..f53bdca 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -91,7 +91,7 @@ static int __init proc_ppc64_init(void)
 
 	return 0;
 }
-__initcall(proc_ppc64_init);
+device_initcall(proc_ppc64_init);
 
 #endif /* CONFIG_PPC64 */
 
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 05131d6..628d6df 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -845,7 +845,7 @@ static int __init prom_reconfig_setup(void)
 {
 	return pSeries_reconfig_notifier_register(&prom_reconfig_nb);
 }
-__initcall(prom_reconfig_setup);
+device_initcall(prom_reconfig_setup);
 #endif
 
 /* Find the device node for a given logical cpu number, also returns the cpu
@@ -909,5 +909,5 @@ static int __init export_flat_device_tree(void)
 
 	return 0;
 }
-__initcall(export_flat_device_tree);
+device_initcall(export_flat_device_tree);
 #endif
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 8777fb0..7578df5 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -279,7 +279,7 @@ static int __init proc_rtas_init(void)
 	return 0;
 }
 
-__initcall(proc_rtas_init);
+device_initcall(proc_rtas_init);
 
 static int parse_number(const char __user *p, size_t count, unsigned long *val)
 {
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index 2e4832a..1bfd919 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -508,7 +508,7 @@ static int __init rtas_init(void)
 
 	return 0;
 }
-__initcall(rtas_init);
+device_initcall(rtas_init);
 
 static int __init surveillance_setup(char *str)
 {
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index e235e52..6ddb889 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -92,7 +92,7 @@ static int __init smt_setup(void)
 	of_node_put(options);
 	return 0;
 }
-__initcall(smt_setup);
+device_initcall(smt_setup);
 
 static int __init setup_smt_snooze_delay(char *str)
 {
diff --git a/arch/powerpc/kernel/tau_6xx.c b/arch/powerpc/kernel/tau_6xx.c
index a753b72..a38d207 100644
--- a/arch/powerpc/kernel/tau_6xx.c
+++ b/arch/powerpc/kernel/tau_6xx.c
@@ -248,7 +248,7 @@ int __init TAU_init(void)
 	return 0;
 }
 
-__initcall(TAU_init);
+device_initcall(TAU_init);
 
 /*
  * return current temp
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 77f6421..c74aae9 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1303,7 +1303,7 @@ static int __init vio_bus_init(void)
 
 	return 0;
 }
-__initcall(vio_bus_init);
+device_initcall(vio_bus_init);
 
 static ssize_t name_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index b0f8a85..66bc6ff 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -337,5 +337,5 @@ static int __init proc_lpevents_init(void)
 		    &proc_lpevents_operations);
 	return 0;
 }
-__initcall(proc_lpevents_init);
+device_initcall(proc_lpevents_init);
 
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 6617915..d140c09 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1299,7 +1299,7 @@ static int __init mf_proc_init(void)
 	return 0;
 }
 
-__initcall(mf_proc_init);
+device_initcall(mf_proc_init);
 
 #endif /* CONFIG_PROC_FS */
 
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index 0676368..1e9ac90 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -117,4 +117,4 @@ static int __init iseries_proc_init(void)
 		    &proc_titantod_operations);
 	return 0;
 }
-__initcall(iseries_proc_init);
+device_initcall(iseries_proc_init);
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 5aea94f..daac760 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -186,7 +186,7 @@ static int __init vio_proc_init(void)
 	proc_create("iSeries/config", 0, NULL, &proc_viopath_operations);
         return 0;
 }
-__initcall(vio_proc_init);
+device_initcall(vio_proc_init);
 
 /* See if a given LP is active.  Allow for invalid lps to be passed in
  * and just return invalid
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 7df7fbb..cb72726 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1287,4 +1287,4 @@ static int __init eeh_init_proc(void)
 		proc_create("ppc64/eeh", 0, NULL, &proc_eeh_operations);
 	return 0;
 }
-__initcall(eeh_init_proc);
+device_initcall(eeh_init_proc);
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 1fefae7..ca1b4e2 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -164,4 +164,4 @@ static int __init hcall_inst_init(void)
 
 	return 0;
 }
-__initcall(hcall_inst_init);
+device_initcall(hcall_inst_init);
diff --git a/arch/powerpc/platforms/pseries/power.c b/arch/powerpc/platforms/pseries/power.c
index 6d62662..0eafaf8 100644
--- a/arch/powerpc/platforms/pseries/power.c
+++ b/arch/powerpc/platforms/pseries/power.c
@@ -77,5 +77,5 @@ static int __init apo_pm_init(void)
 {
 	return (sysfs_create_file(power_kobj, &auto_poweron_attr.attr));
 }
-__initcall(apo_pm_init);
+device_initcall(apo_pm_init);
 #endif
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index d20b96e..247bad9 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -152,7 +152,7 @@ static int __init init_ras_IRQ(void)
 
 	return 0;
 }
-__initcall(init_ras_IRQ);
+device_initcall(init_ras_IRQ);
 
 /*
  * Handle power subsystem events (EPOW).
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index a2305d2..d82ca6c 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -557,4 +557,4 @@ static int proc_ppc64_create_ofdt(void)
 
 	return 0;
 }
-__initcall(proc_ppc64_create_ofdt);
+device_initcall(proc_ppc64_create_ofdt);
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 8bad7d5..cd1ce39 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2751,7 +2751,7 @@ static int __init setup_xmon_sysrq(void)
 	register_sysrq_key('x', &sysrq_xmon_op);
 	return 0;
 }
-__initcall(setup_xmon_sysrq);
+device_initcall(setup_xmon_sysrq);
 #endif /* CONFIG_MAGIC_SYSRQ */
 
 static int __initdata xmon_early, xmon_off;
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 5c91995..af7ccb3 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -659,7 +659,7 @@ out_driver:
 	return rc;
 }
 
-__initcall(appldata_init);
+device_initcall(appldata_init);
 
 /**************************** init / exit <END> ******************************/
 
diff --git a/arch/s390/kernel/audit.c b/arch/s390/kernel/audit.c
index f4932c2..8a9023a 100644
--- a/arch/s390/kernel/audit.c
+++ b/arch/s390/kernel/audit.c
@@ -75,4 +75,4 @@ static int __init audit_classes_init(void)
 	return 0;
 }
 
-__initcall(audit_classes_init);
+device_initcall(audit_classes_init);
diff --git a/arch/s390/kernel/compat_exec_domain.c b/arch/s390/kernel/compat_exec_domain.c
index 914d494..e0715f6 100644
--- a/arch/s390/kernel/compat_exec_domain.c
+++ b/arch/s390/kernel/compat_exec_domain.c
@@ -26,4 +26,4 @@ static int __init s390_init (void)
 	return 0;
 }
 
-__initcall(s390_init);
+device_initcall(s390_init);
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 7eedbbc..19906a7 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -1806,7 +1806,7 @@ static int __init s390_ipl_init(void)
 	return 0;
 }
 
-__initcall(s390_ipl_init);
+device_initcall(s390_ipl_init);
 
 static void __init strncpy_skip_quote(char *dst, char *src, int n)
 {
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 14ef6f0..1a1d7ee 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -291,7 +291,7 @@ out:
 	update_cpu_core_map();
 	return rc;
 }
-__initcall(init_topology_update);
+device_initcall(init_topology_update);
 
 void __init s390_init_cpu_topology(void)
 {
diff --git a/arch/sh/boards/board-edosk7760.c b/arch/sh/boards/board-edosk7760.c
index 35dc099..f47ac82 100644
--- a/arch/sh/boards/board-edosk7760.c
+++ b/arch/sh/boards/board-edosk7760.c
@@ -182,7 +182,7 @@ static int __init init_edosk7760_devices(void)
 	return platform_add_devices(edosk7760_devices,
 				    ARRAY_SIZE(edosk7760_devices));
 }
-__initcall(init_edosk7760_devices);
+device_initcall(init_edosk7760_devices);
 
 /*
  * The Machine Vector
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
index fe7e686..ee65ff0 100644
--- a/arch/sh/boards/board-sh7785lcr.c
+++ b/arch/sh/boards/board-sh7785lcr.c
@@ -284,7 +284,7 @@ static int __init sh7785lcr_devices_setup(void)
 	return platform_add_devices(sh7785lcr_devices,
 				    ARRAY_SIZE(sh7785lcr_devices));
 }
-__initcall(sh7785lcr_devices_setup);
+device_initcall(sh7785lcr_devices_setup);
 
 /* Initialize IRQ setting */
 void __init init_sh7785lcr_IRQ(void)
diff --git a/arch/sh/boards/mach-cayman/setup.c b/arch/sh/boards/mach-cayman/setup.c
index 7e8216a..e89e8e1 100644
--- a/arch/sh/boards/mach-cayman/setup.c
+++ b/arch/sh/boards/mach-cayman/setup.c
@@ -165,7 +165,7 @@ static int __init smsc_superio_setup(void)
 
 	return 0;
 }
-__initcall(smsc_superio_setup);
+device_initcall(smsc_superio_setup);
 
 static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len)
 {
diff --git a/arch/sh/boards/mach-landisk/setup.c b/arch/sh/boards/mach-landisk/setup.c
index 50337ac..62f26f4 100644
--- a/arch/sh/boards/mach-landisk/setup.c
+++ b/arch/sh/boards/mach-landisk/setup.c
@@ -83,7 +83,7 @@ static int __init landisk_devices_setup(void)
 				    ARRAY_SIZE(landisk_devices));
 }
 
-__initcall(landisk_devices_setup);
+device_initcall(landisk_devices_setup);
 
 static void __init landisk_setup(char **cmdline_p)
 {
diff --git a/arch/sh/boards/mach-r2d/setup.c b/arch/sh/boards/mach-r2d/setup.c
index b84df6a..4b98a52 100644
--- a/arch/sh/boards/mach-r2d/setup.c
+++ b/arch/sh/boards/mach-r2d/setup.c
@@ -258,7 +258,7 @@ static int __init rts7751r2d_devices_setup(void)
 	return platform_add_devices(rts7751r2d_devices,
 				    ARRAY_SIZE(rts7751r2d_devices));
 }
-__initcall(rts7751r2d_devices_setup);
+device_initcall(rts7751r2d_devices_setup);
 
 static void rts7751r2d_power_off(void)
 {
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c
index f094ea2..ddcc73d 100644
--- a/arch/sh/boards/mach-sdk7786/setup.c
+++ b/arch/sh/boards/mach-sdk7786/setup.c
@@ -132,7 +132,7 @@ static int __init sdk7786_devices_setup(void)
 
 	return sdk7786_i2c_setup();
 }
-__initcall(sdk7786_devices_setup);
+device_initcall(sdk7786_devices_setup);
 
 static int sdk7786_mode_pins(void)
 {
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c
index 8f5c65d..91d0823 100644
--- a/arch/sh/boards/mach-se/7206/setup.c
+++ b/arch/sh/boards/mach-se/7206/setup.c
@@ -77,7 +77,7 @@ static int __init se7206_devices_setup(void)
 {
 	return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
 }
-__initcall(se7206_devices_setup);
+device_initcall(se7206_devices_setup);
 
 /*
  * The Machine Vector
diff --git a/arch/sh/boards/mach-se/7751/setup.c b/arch/sh/boards/mach-se/7751/setup.c
index 5057251..69e1479 100644
--- a/arch/sh/boards/mach-se/7751/setup.c
+++ b/arch/sh/boards/mach-se/7751/setup.c
@@ -48,7 +48,7 @@ static int __init se7751_devices_setup(void)
 {
 	return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
 }
-__initcall(se7751_devices_setup);
+device_initcall(se7751_devices_setup);
 
 /*
  * The Machine Vector
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c
index af4a0c0..d4f79b2 100644
--- a/arch/sh/boards/mach-sh03/setup.c
+++ b/arch/sh/boards/mach-sh03/setup.c
@@ -96,7 +96,7 @@ static int __init sh03_devices_setup(void)
 
 	return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
 }
-__initcall(sh03_devices_setup);
+device_initcall(sh03_devices_setup);
 
 static struct sh_machine_vector mv_sh03 __initmv = {
 	.mv_name		= "Interface (CTP/PCI-SH03)",
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index e3f92eb..0868d8d 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -923,7 +923,7 @@ static int __init init_sysctl(void)
 	return 0;
 }
 
-__initcall(init_sysctl);
+device_initcall(init_sysctl);
 
 
 asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs)
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index 71ec90b..768b51b 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -188,4 +188,4 @@ static int __init apc_init(void)
  * and is easiest to ioremap when SBus is already
  * initialized, so we install ourselves thusly:
  */
-__initcall(apc_init);
+device_initcall(apc_init);
diff --git a/arch/sparc/kernel/audit.c b/arch/sparc/kernel/audit.c
index 8fff0ac..4be9a78 100644
--- a/arch/sparc/kernel/audit.c
+++ b/arch/sparc/kernel/audit.c
@@ -80,4 +80,4 @@ static int __init audit_classes_init(void)
 	return 0;
 }
 
-__initcall(audit_classes_init);
+device_initcall(audit_classes_init);
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index cdc91d9..0fb5a9c 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -903,7 +903,7 @@ static int __init mdesc_misc_init(void)
 	return misc_register(&mdesc_misc);
 }
 
-__initcall(mdesc_misc_init);
+device_initcall(mdesc_misc_init);
 
 void __init sun4v_mdesc_init(void)
 {
diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c
index 5e4563d..74a99b5 100644
--- a/arch/sparc/kernel/pmc.c
+++ b/arch/sparc/kernel/pmc.c
@@ -93,4 +93,4 @@ static int __init pmc_init(void)
  * and is easiest to ioremap when SBus is already
  * initialized, so we install ourselves thusly:
  */
-__initcall(pmc_init);
+device_initcall(pmc_init);
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index de317d0..c55fa3a 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -493,7 +493,7 @@ static int __init mem_mc_init(void)
 	return 0;
 }
 
-__initcall(mem_mc_init);
+device_initcall(mem_mc_init);
 
 #define CONFIG_BUF_SIZE 64
 
@@ -816,7 +816,7 @@ static int __init mconsole_init(void)
 	return 1;
 }
 
-__initcall(mconsole_init);
+device_initcall(mconsole_init);
 
 static ssize_t mconsole_proc_write(struct file *file,
 		const char __user *buffer, size_t count, loff_t *pos)
@@ -873,7 +873,7 @@ void unlock_notify(void)
 	spin_unlock(&notify_spinlock);
 }
 
-__initcall(create_proc_mconsole);
+device_initcall(create_proc_mconsole);
 
 #define NOTIFY "notify:"
 
@@ -923,7 +923,7 @@ static int add_notifier(void)
 	return 0;
 }
 
-__initcall(add_notifier);
+device_initcall(add_notifier);
 
 char *mconsole_notify_socket(void)
 {
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index a74245a..3864903 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -824,7 +824,7 @@ static int uml_net_init(void)
 	return 0;
 }
 
-__initcall(uml_net_init);
+device_initcall(uml_net_init);
 
 static void close_devices(void)
 {
diff --git a/arch/um/drivers/stderr_console.c b/arch/um/drivers/stderr_console.c
index d07a97f..29eb7ce 100644
--- a/arch/um/drivers/stderr_console.c
+++ b/arch/um/drivers/stderr_console.c
@@ -59,4 +59,4 @@ static int __init unregister_stderr(void)
 	return 0;
 }
 
-__initcall(unregister_stderr);
+device_initcall(unregister_stderr);
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index c1ff690..d5de090 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1010,7 +1010,7 @@ static int __init ubd_mc_init(void)
 	return 0;
 }
 
-__initcall(ubd_mc_init);
+device_initcall(ubd_mc_init);
 
 static int __init ubd0_init(void)
 {
@@ -1024,7 +1024,7 @@ static int __init ubd0_init(void)
 	return 0;
 }
 
-__initcall(ubd0_init);
+device_initcall(ubd0_init);
 
 /* Used in ubd_init, which is an initcall */
 static struct platform_driver ubd_driver = {
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c
index 829df49..cb05ff8 100644
--- a/arch/um/kernel/exitcode.c
+++ b/arch/um/kernel/exitcode.c
@@ -75,4 +75,4 @@ static int make_proc_exitcode(void)
 	return 0;
 }
 
-__initcall(make_proc_exitcode);
+device_initcall(make_proc_exitcode);
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index a1a9090..87537f0 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -209,4 +209,4 @@ static int setup_iomem(void)
 	return 0;
 }
 
-__initcall(setup_iomem);
+device_initcall(setup_iomem);
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index 57e3d46..337437e 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -343,13 +343,13 @@ static int init_aio(void)
 }
 
 /*
- * The reason for the __initcall/__uml_exitcall asymmetry is that init_aio
+ * The reason for the device_initcall/__uml_exitcall asymmetry is that init_aio
  * needs to be called when the kernel is running because it calls run_helper,
  * which needs get_free_page.  exit_aio is a __uml_exitcall because the generic
  * kernel does not run __exitcalls on shutdown, and can't because many of them
  * break when called outside of module unloading.
  */
-__initcall(init_aio);
+device_initcall(init_aio);
 
 static void exit_aio(void)
 {
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
index d261f17..a0a816a 100644
--- a/arch/um/os-Linux/skas/mem.c
+++ b/arch/um/os-Linux/skas/mem.c
@@ -46,7 +46,7 @@ static int __init init_syscall_regs(void)
 	return 0;
 }
 
-__initcall(init_syscall_regs);
+device_initcall(init_syscall_regs);
 
 extern int proc_mm;
 
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index d6e0a22..25ef142 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -473,7 +473,7 @@ static int __init init_thread_regs(void)
 	return 0;
 }
 
-__initcall(init_thread_regs);
+device_initcall(init_thread_regs);
 
 int copy_context_skas0(unsigned long new_stack, int pid)
 {
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index a27defb..23f7b37 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -326,7 +326,7 @@ static int __init make_umid_init(void)
 	return 0;
 }
 
-__initcall(make_umid_init);
+device_initcall(make_umid_init);
 
 int __init umid_file_name(char *name, char *buf, int len)
 {
diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c
index c6c7131..b285fd7 100644
--- a/arch/um/sys-i386/tls.c
+++ b/arch/um/sys-i386/tls.c
@@ -393,4 +393,4 @@ static int __init __setup_host_supports_tls(void)
 	return 0;
 }
 
-__initcall(__setup_host_supports_tls);
+device_initcall(__setup_host_supports_tls);
diff --git a/arch/x86/kernel/audit_64.c b/arch/x86/kernel/audit_64.c
index 06d3e5a..bab6ddc 100644
--- a/arch/x86/kernel/audit_64.c
+++ b/arch/x86/kernel/audit_64.c
@@ -78,4 +78,4 @@ static int __init audit_classes_init(void)
 	return 0;
 }
 
-__initcall(audit_classes_init);
+device_initcall(audit_classes_init);
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 364d015..eb71685 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -860,5 +860,5 @@ static int __init uv_bau_init(void)
 
 	return 0;
 }
-__initcall(uv_bau_init);
-__initcall(uv_ptc_init);
+device_initcall(uv_bau_init);
+device_initcall(uv_ptc_init);
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 1c0c6ab..df45aaf 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -244,7 +244,7 @@ static ctl_table kernel_root_table2[] = {
 };
 #endif
 
-/* Assume __initcall executes before all user space. Hopefully kmod
+/* Assume device_initcall executes before all user space. Hopefully kmod
    doesn't violate that. We'll find out if it does. */
 static void __cpuinit vsyscall_set_cpu(int cpu)
 {
@@ -306,4 +306,4 @@ static int __init vsyscall_init(void)
 	return 0;
 }
 
-__initcall(vsyscall_init);
+device_initcall(vsyscall_init);
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
index a725b7f..a84535d 100644
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -349,7 +349,7 @@ static int pt_dump_init(void)
 	return 0;
 }
 
-__initcall(pt_dump_init);
+device_initcall(pt_dump_init);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Arjan van de Ven <arjan@linux.intel.com>");
 MODULE_DESCRIPTION("Kernel debugging helper that dumps pagetables");
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index 02b442e..6c73b85 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -374,7 +374,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 
 #ifdef CONFIG_X86_64
 
-__initcall(sysenter_setup);
+device_initcall(sysenter_setup);
 
 #ifdef CONFIG_SYSCTL
 /* Register vsyscall32 into the ABI table */
@@ -405,7 +405,7 @@ static __init int ia32_binfmt_init(void)
 	register_sysctl_table(abi_root_table2);
 	return 0;
 }
-__initcall(ia32_binfmt_init);
+device_initcall(ia32_binfmt_init);
 #endif
 
 #else  /* CONFIG_X86_32 */
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index 21e1aeb..860addc 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -73,7 +73,7 @@ static int __init init_vdso_vars(void)
 	vdso_enabled = 0;
 	return -ENOMEM;
 }
-__initcall(init_vdso_vars);
+device_initcall(init_vdso_vars);
 
 struct linux_binprm;
 
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
index e60a1f5..cdf1715 100644
--- a/arch/xtensa/platforms/iss/console.c
+++ b/arch/xtensa/platforms/iss/console.c
@@ -248,7 +248,7 @@ static __exit void rs_exit(void)
 }
 
 
-/* We use `late_initcall' instead of just `__initcall' as a workaround for
+/* We use `late_initcall' instead of just `device_initcall' as a workaround for
  * the fact that (1) simcons_tty_init can't be called before tty_init,
  * (2) tty_init is called via `module_init', (3) if statically linked,
  * module_init == device_init, and (4) there's no ordering of init lists.
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index f1f58c5..cc2c734 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -775,4 +775,4 @@ static int __init am79c961_init(void)
 	return platform_driver_register(&am79c961_driver);
 }
 
-__initcall(am79c961_init);
+device_initcall(am79c961_init);
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index a3c0dc9..fc6f80e 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -35,6 +35,7 @@
  *                    removed some pre-2.2 kernel compatibility cruft
  *   0.6  10.08.1999  Check if parport can do SPP and is safe to access during interrupt contexts
  *   0.7  12.02.2000  adapted to softnet driver interface
+ *   0.8  03.18.2010  update deprecated __initcall to device_initcall
  *
  */
 
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index 5f5af9a..f2ddffa 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -64,6 +64,7 @@
  *   0.8  12.02.2000  adapted to softnet driver interface
  *                    removed direct parport access, uses parport driver methods
  *   0.9  03.07.2000  fix interface name handling
+ *   0.10 03.18.2010  update deprecated __initcall to device_initcall
  */
 
 /*****************************************************************************/
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index 0cab992..d90ad93 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -67,6 +67,7 @@
  *   0.8  10.08.1999  use module_init/module_exit
  *   0.9  12.02.2000  adapted to softnet driver interface
  *   0.10 03.07.2000  fix interface name handling
+ *   0.11 03.18.2010  update deprecated __initcall to device_initcall
  */
 
 /*****************************************************************************/
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 1686f6d..3033cae 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -57,6 +57,7 @@
  *   0.8  10.08.1999  use module_init/module_exit
  *   0.9  12.02.2000  adapted to softnet driver interface
  *   0.10 03.07.2000  fix interface name handling
+ *   0.11 03.18.2010  update deprecated __initcall to device_initcall
  */
 
 /*****************************************************************************/
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index b3beab6..642b3bf 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -628,7 +628,7 @@ out:
 	free_page((unsigned long) sccb);
 	return rc;
 }
-__initcall(sclp_detect_standby_memory);
+device_initcall(sclp_detect_standby_memory);
 
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
diff --git a/drivers/s390/char/sclp_config.c b/drivers/s390/char/sclp_config.c
index b497afe..c257eb3 100644
--- a/drivers/s390/char/sclp_config.c
+++ b/drivers/s390/char/sclp_config.c
@@ -87,4 +87,4 @@ static int __init sclp_conf_init(void)
 	return rc;
 }
 
-__initcall(sclp_conf_init);
+device_initcall(sclp_conf_init);
diff --git a/drivers/s390/char/sclp_cpi_sys.c b/drivers/s390/char/sclp_cpi_sys.c
index 62c2647..1ebb83c 100644
--- a/drivers/s390/char/sclp_cpi_sys.c
+++ b/drivers/s390/char/sclp_cpi_sys.c
@@ -426,4 +426,4 @@ static int __init cpi_init(void)
 	return rc;
 }
 
-__initcall(cpi_init);
+device_initcall(cpi_init);
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 3796ffd..deff553 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -707,7 +707,7 @@ out_driver:
 	put_tty_driver(driver);
 	return rc;
 }
-__initcall(sclp_vt220_tty_init);
+device_initcall(sclp_vt220_tty_init);
 
 static void __sclp_vt220_flush_buffer(void)
 {
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index 7eab9ab..363fd02 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -398,6 +398,6 @@ cio_ignore_proc_init (void)
 	return 0;
 }
 
-__initcall (cio_ignore_proc_init);
+device_initcall(cio_ignore_proc_init);
 
 #endif /* CONFIG_PROC_FS */
diff --git a/drivers/staging/rtl8192u/ieee80211/api.c b/drivers/staging/rtl8192u/ieee80211/api.c
index c627d02..156d867 100644
--- a/drivers/staging/rtl8192u/ieee80211/api.c
+++ b/drivers/staging/rtl8192u/ieee80211/api.c
@@ -229,7 +229,7 @@ static int __init init_crypto(void)
 	return 0;
 }
 
-__initcall(init_crypto);
+device_initcall(init_crypto);
 
 /*
 EXPORT_SYMBOL_GPL(crypto_register_alg);
diff --git a/fs/aio.c b/fs/aio.c
index 1cf12b3..80ddf44 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -92,7 +92,7 @@ static int __init aio_setup(void)
 
 	return 0;
 }
-__initcall(aio_setup);
+device_initcall(aio_setup);
 
 static void aio_free_ring(struct kioctx *ctx)
 {
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 6d55b61..b579a82 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1780,4 +1780,4 @@ static int __init init_sys32_ioctl(void)
 		init_sys32_ioctl_cmp, NULL);
 	return 0;
 }
-__initcall(init_sys32_ioctl);
+device_initcall(init_sys32_ioctl);
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 56410fa..3d59d44 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -209,4 +209,4 @@ static int __init ipc_sysctl_init(void)
 	return 0;
 }
 
-__initcall(ipc_sysctl_init);
+device_initcall(ipc_sysctl_init);
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index e4e3f04..c58ca57 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1322,4 +1322,4 @@ out_sysctl:
 	return error;
 }
 
-__initcall(init_mqueue_fs);
+device_initcall(init_mqueue_fs);
diff --git a/ipc/util.c b/ipc/util.c
index 79ce84e..d82ec6c 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -106,7 +106,7 @@ static int __init ipc_init(void)
 	register_ipcns_notifier(&init_ipc_ns);
 	return 0;
 }
-__initcall(ipc_init);
+device_initcall(ipc_init);
 
 /**
  *	ipc_init_ids		-	initialise IPC identifiers
diff --git a/kernel/audit.c b/kernel/audit.c
index 78f7f86..d489f47 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -989,7 +989,7 @@ static int __init audit_init(void)
 
 	return 0;
 }
-__initcall(audit_init);
+device_initcall(audit_init);
 
 /* Process kernel command-line parameter at boot time.  audit=0 or audit=1. */
 static int __init audit_enable(char *str)
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index 028e856..e54d2c6 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -919,4 +919,4 @@ static int __init audit_tree_init(void)
 
 	return 0;
 }
-__initcall(audit_tree_init);
+device_initcall(audit_tree_init);
diff --git a/kernel/dma.c b/kernel/dma.c
index f903189..b54e161 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -153,7 +153,7 @@ static int __init proc_dma_init(void)
 	return 0;
 }
 
-__initcall(proc_dma_init);
+device_initcall(proc_dma_init);
 #endif
 
 EXPORT_SYMBOL(request_dma);
diff --git a/kernel/futex.c b/kernel/futex.c
index e7a35f1..94efb8c 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2670,4 +2670,4 @@ static int __init futex_init(void)
 
 	return 0;
 }
-__initcall(futex_init);
+device_initcall(futex_init);
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
index d4aba4f..a4088c9 100644
--- a/kernel/lockdep_proc.c
+++ b/kernel/lockdep_proc.c
@@ -687,5 +687,5 @@ static int __init lockdep_proc_init(void)
 	return 0;
 }
 
-__initcall(lockdep_proc_init);
+device_initcall(lockdep_proc_init);
 
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 79aac93..2c7b5e7 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -189,4 +189,4 @@ static __init int pid_namespaces_init(void)
 	return 0;
 }
 
-__initcall(pid_namespaces_init);
+device_initcall(pid_namespaces_init);
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index 1a22dfd..036d64e 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -1727,4 +1727,4 @@ static __init int init_posix_cpu_timers(void)
 
 	return 0;
 }
-__initcall(init_posix_cpu_timers);
+device_initcall(init_posix_cpu_timers);
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 00d1fda..e8c2d04 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -309,7 +309,7 @@ static __init int init_posix_timers(void)
 	return 0;
 }
 
-__initcall(init_posix_timers);
+device_initcall(init_posix_timers);
 
 static void schedule_next_timer(struct k_itimer *timr)
 {
diff --git a/kernel/resource.c b/kernel/resource.c
index 2d5be5d..e678177 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -136,7 +136,7 @@ static int __init ioresources_init(void)
 	proc_create("iomem", 0, NULL, &proc_iomem_operations);
 	return 0;
 }
-__initcall(ioresources_init);
+device_initcall(ioresources_init);
 
 #endif /* CONFIG_PROC_FS */
 
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 67f95aa..c17988b 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -379,7 +379,7 @@ static int __init init_sched_debug_procfs(void)
 	return 0;
 }
 
-__initcall(init_sched_debug_procfs);
+device_initcall(init_sched_debug_procfs);
 
 void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
 {
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index bdfb8dd..962b3b2 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -296,4 +296,4 @@ static int __init init_timer_list_procfs(void)
 		return -ENOMEM;
 	return 0;
 }
-__initcall(init_timer_list_procfs);
+device_initcall(init_timer_list_procfs);
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c
index 2f3b585..517552b 100644
--- a/kernel/time/timer_stats.c
+++ b/kernel/time/timer_stats.c
@@ -422,4 +422,4 @@ static int __init init_tstats_procfs(void)
 		return -ENOMEM;
 	return 0;
 }
-__initcall(init_tstats_procfs);
+device_initcall(init_tstats_procfs);
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index cc89be5..c4d12e8 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -580,7 +580,7 @@ static int init_tracepoints(void)
 {
 	return register_module_notifier(&tracepoint_module_nb);
 }
-__initcall(init_tracepoints);
+device_initcall(init_tracepoints);
 
 #endif /* CONFIG_MODULES */
 
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c
index a2cd77e..7cbb001 100644
--- a/kernel/utsname_sysctl.c
+++ b/kernel/utsname_sysctl.c
@@ -111,4 +111,4 @@ static int __init utsname_sysctl_init(void)
 	return 0;
 }
 
-__initcall(utsname_sysctl_init);
+device_initcall(utsname_sysctl_init);
diff --git a/lib/audit.c b/lib/audit.c
index 8e7dc1c..26f41a9 100644
--- a/lib/audit.c
+++ b/lib/audit.c
@@ -63,4 +63,4 @@ static int __init audit_classes_init(void)
 	return 0;
 }
 
-__initcall(audit_classes_init);
+device_initcall(audit_classes_init);
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index a9a8996..ee41495 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -666,7 +666,7 @@ err:
 
 	return -ENOMEM;
 }
-__initcall(debug_objects_init_debugfs);
+device_initcall(debug_objects_init_debugfs);
 
 #else
 static inline void debug_objects_init_debugfs(void) { }
diff --git a/mm/bounce.c b/mm/bounce.c
index a2b76a5..b6df140 100644
--- a/mm/bounce.c
+++ b/mm/bounce.c
@@ -39,7 +39,7 @@ static __init int init_emergency_pool(void)
 	return 0;
 }
 
-__initcall(init_emergency_pool);
+device_initcall(init_emergency_pool);
 
 /*
  * highmem version, map in to vec
diff --git a/mm/memory.c b/mm/memory.c
index 5b7f200..b39f34e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3231,7 +3231,7 @@ static int __init gate_vma_init(void)
 	gate_vma.vm_flags |= VM_ALWAYSDUMP;
 	return 0;
 }
-__initcall(gate_vma_init);
+device_initcall(gate_vma_init);
 #endif
 
 struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 4e0e265..6586ce5 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -149,4 +149,4 @@ static int __init mm_sysfs_init(void)
 	return 0;
 }
 
-__initcall(mm_sysfs_init);
+device_initcall(mm_sysfs_init);
diff --git a/mm/slab.c b/mm/slab.c
index a9f325b..891218c 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1597,7 +1597,7 @@ static int __init cpucache_init(void)
 		start_cpu_timer(cpu);
 	return 0;
 }
-__initcall(cpucache_init);
+device_initcall(cpucache_init);
 
 /*
  * Interface to system's page allocator. No need to hold the cache-lock.
diff --git a/mm/slub.c b/mm/slub.c
index b364844..a048aa5 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4577,7 +4577,7 @@ static int __init slab_sysfs_init(void)
 	return 0;
 }
 
-__initcall(slab_sysfs_init);
+device_initcall(slab_sysfs_init);
 #endif
 
 /*
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 6cd0a8f..c1e2b6d 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1764,7 +1764,7 @@ static int __init procswaps_init(void)
 	proc_create("swaps", 0, NULL, &proc_swaps_operations);
 	return 0;
 }
-__initcall(procswaps_init);
+device_initcall(procswaps_init);
 #endif /* CONFIG_PROC_FS */
 
 #ifdef MAX_SWAPFILES_CHECK
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 5c24db4..5bdd7d2 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -32,7 +32,7 @@ static __init int init_syncookies(void)
 	get_random_bytes(syncookie_secret, sizeof(syncookie_secret));
 	return 0;
 }
-__initcall(init_syncookies);
+device_initcall(init_syncookies);
 
 #define COOKIEBITS 24	/* Upper bits store count */
 #define COOKIEMASK (((__u32)1 << COOKIEBITS) - 1)
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index c1bc074..6e61075 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -748,4 +748,4 @@ static __init int sysctl_ipv4_init(void)
 	return 0;
 }
 
-__initcall(sysctl_ipv4_init);
+device_initcall(sysctl_ipv4_init);
diff --git a/security/keys/proc.c b/security/keys/proc.c
index 9d01021..9412316 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -83,7 +83,7 @@ static int __init key_proc_init(void)
 
 } /* end key_proc_init() */
 
-__initcall(key_proc_init);
+device_initcall(key_proc_init);
 
 /*****************************************************************************/
 /*
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 5feecb4..db02af5 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -5783,7 +5783,7 @@ out:
 	return err;
 }
 
-__initcall(selinux_nf_ip_init);
+device_initcall(selinux_nf_ip_init);
 
 #ifdef CONFIG_SECURITY_SELINUX_DISABLE
 static void selinux_nf_ip_exit(void)
diff --git a/security/selinux/netif.c b/security/selinux/netif.c
index b4e14bc..9f89a94 100644
--- a/security/selinux/netif.c
+++ b/security/selinux/netif.c
@@ -315,5 +315,5 @@ static __init int sel_netif_init(void)
 	return err;
 }
 
-__initcall(sel_netif_init);
+device_initcall(sel_netif_init);
 
diff --git a/security/selinux/netlink.c b/security/selinux/netlink.c
index 1ae5564..403b707 100644
--- a/security/selinux/netlink.c
+++ b/security/selinux/netlink.c
@@ -113,4 +113,4 @@ static int __init selnl_init(void)
 	return 0;
 }
 
-__initcall(selnl_init);
+device_initcall(selnl_init);
diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c
index 7100072..e7ae484 100644
--- a/security/selinux/netnode.c
+++ b/security/selinux/netnode.c
@@ -344,4 +344,4 @@ static __init int sel_netnode_init(void)
 	return ret;
 }
 
-__initcall(sel_netnode_init);
+device_initcall(sel_netnode_init);
diff --git a/security/selinux/netport.c b/security/selinux/netport.c
index fe7fba6..94c29f4 100644
--- a/security/selinux/netport.c
+++ b/security/selinux/netport.c
@@ -278,4 +278,4 @@ static __init int sel_netport_init(void)
 	return ret;
 }
 
-__initcall(sel_netport_init);
+device_initcall(sel_netport_init);
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index cd191bb..03eb7d8 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1730,7 +1730,7 @@ static int __init init_sel_fs(void)
 	return err;
 }
 
-__initcall(init_sel_fs);
+device_initcall(init_sel_fs);
 
 #ifdef CONFIG_SECURITY_SELINUX_DISABLE
 void exit_sel_fs(void)
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index cf27b3e..e7eb598 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -2964,7 +2964,7 @@ static int __init aurule_init(void)
 
 	return err;
 }
-__initcall(aurule_init);
+device_initcall(aurule_init);
 
 #ifdef CONFIG_NETLABEL
 /**
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index aeead75..8faf43e 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -1366,4 +1366,4 @@ static int __init init_smk_fs(void)
 	return err;
 }
 
-__initcall(init_smk_fs);
+device_initcall(init_smk_fs);
diff --git a/sound/last.c b/sound/last.c
index bdd0857..5efc26a 100644
--- a/sound/last.c
+++ b/sound/last.c
@@ -38,4 +38,4 @@ static int __init alsa_sound_last_init(void)
 	return 0;
 }
 
-__initcall(alsa_sound_last_init);
+device_initcall(alsa_sound_last_init);
-- 
1.6.5.GIT


^ permalink raw reply related

* Re: [PATCH 1/3] pci: fix return value from pcix_get_max_mmrbc()
From: Jesse Barnes @ 2010-03-19 19:42 UTC (permalink / raw)
  To: Dean Nelson; +Cc: netdev, linux-pci
In-Reply-To: <20100310032640.6331.39506.send-patch@aqua>

On Tue, 9 Mar 2010 22:26:40 -0500
Dean Nelson <dnelson@redhat.com> wrote:

> For the PCI_X_STATUS register, pcix_get_max_mmrbc() is returning an incorrect
> value, which is based on:
> 
> 	(stat & PCI_X_STATUS_MAX_READ) >> 12
> 
> Valid return values are 512, 1024, 2048, 4096, which correspond to a 'stat'
> (masked and right shifted by 21) of 0, 1, 2, 3, respectively.
> 
> A right shift by 11 would generate the correct return value when 'stat' (masked
> and right shifted by 21) has a value of 1 or 2. But for a value of 0 or 3 it's
> not possible to generate the correct return value by only right shifting.
> 
> Fix is based on pcix_get_mmrbc()'s similar dealings with the PCI_X_CMD register.
> 
> Signed-off-by: Dean Nelson <dnelson@redhat.com>
> 
> ---
> 
>  drivers/pci/pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 5b548ae..1decd4f 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -2571,7 +2571,7 @@ int pcix_get_max_mmrbc(struct pci_dev *dev)
>  	if (err)
>  		return -EINVAL;
>  
> -	return (stat & PCI_X_STATUS_MAX_READ) >> 12;
> +	return 512 << ((stat & PCI_X_STATUS_MAX_READ) >> 21);
>  }
>  EXPORT_SYMBOL(pcix_get_max_mmrbc);

Applied this series, thanks Dean.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply

* Re: [E1000-devel] recent e100 fixes cause kernel panic?
From: Jesse Brandeburg @ 2010-03-19 19:42 UTC (permalink / raw)
  To: Ed Ravin, roger.oksanen
  Cc: e1000-devel@lists.sourceforge.net, Stephen Hemminger,
	netdev@vger.kernel.org
In-Reply-To: <12968172.251031268372359953.JavaMail.root@tahiti.vyatta.com>

Added netdev, the place to talk about in-kernel driver problems.

On Thu, 2010-03-11 at 22:39 -0700, Stephen Hemminger wrote:
> ----- "Ed Ravin" <eravin@panix.com> wrote:
> 
> > I'm using the Vyatta "kenwood" Linux distribution, which is currently
> > at 2.6.31-1.  I upgraded to their latest version, and began seeing
> > kernel
> > panics shortly after starting to use ssh/scp on the network connected
> > to
> > an e100 NIC.  I was able to reproduce the problem immediately after
> > booting up - sometimes it even crashed during the boot.
> > 
> > One of the crash logs is attached.

Ed, thanks for the report, looks like these patches introduced a new
problem.  e100 hardware has a tricky data structure that seems to cause
some problems for (particularly arm) some cpu architectures.

> > 
> > Since the problem seemed to be related to e100.c, I reverted the two
> > commits to e100.c that had taken place since I last built the kernel
> > for this box:
> > 
> >   Author: Roger Oksanen <roger.oksanen@cs.helsinki.fi>
> >   Date:   Fri Dec 18 20:18:21 2009 -0800
> >   e100: Fix broken cbs accounting due to missing memset.
> > 
> >   Author: Roger Oksanen <roger.oksanen@cs.helsinki.fi>
> >   Date:   Sun Nov 29 17:17:29 2009 -0800
> >   e100: Use pci pool to work around GFP_ATOMIC order 5 memory
> > allocation failu
> > 
> > I rebuilt the kernel and it's not panicking anymore.

so you just reverted both, and its good news things are working again,
but can you try one or the other and let us know if things still break
for you?

> The Vyatta kernel for 2.6.31 is based on the 2.6.31.10 + unionfs.
> These two patches came from the 2.6.31.10 -stable update.

This is the only report of this issue I have heard so far, so something
must be a little unique to your system or workload such that the driver
works mostly.

I'm looking more closely into the panic trace now, maybe I can figure it
out from there.

-- 
Jesse Brandeburg
This email sent via Evolution, powered by Linux


^ permalink raw reply

* ( PROPOSAL ) DOWNLOAD, READ AND GET BACK TO ME. MR.VICTOR EDWARD.
From: Mr.Victor Edward @ 2010-03-19 18:28 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 74 bytes --]


BUSSINESS PROPOSAL DOWN LOAD, READ AND GET BACK TO ME. MR.VICTOR EDWARD.

[-- Attachment #2: Confidential business proposal.jpg --]
[-- Type: image/jpeg, Size: 163944 bytes --]

^ permalink raw reply

* Re: [PATCH 1/3] mfd: add support for Janz CMOD-IO PCI MODULbus Carrier Board
From: Ira W. Snyder @ 2010-03-19 18:22 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20100319163849.GB30409-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>

On Fri, Mar 19, 2010 at 05:38:51PM +0100, Samuel Ortiz wrote:
> Hi Ira,
> 
> Some comments below:
> 
> On Thu, Mar 18, 2010 at 09:38:42AM -0700, Ira W. Snyder wrote:
> > +/* Module Parameters */
> > +static unsigned int num_modules = CMODIO_MAX_MODULES;
> > +static unsigned char *modules[CMODIO_MAX_MODULES] = {
> > +	"janz-ican3",
> > +	"janz-ican3",
> > +	"",
> > +	"janz-ttl",
> > +};
> That's not very nice, but I honestly dont know how to make it less ugly...
> At least this should be all left blank by default, as Wolfgang hinted.
> 

Agreed, I've made the change in my tree.

> > +/*
> > + * Subdevice Support
> > + */
> Please use the mfd-core API for building and registering platform sub devices.
> The pieces of code below should shrink significantly.
> 

Using this framework, how is it possible to create  the devices that I
do down below. For each subdevice, I need three resources:

1) MODULbus registers -- PCI BAR3 + (0x200 * module_num)
2) PLX Control Registers -- PCI BAR4
3) IRQ

Specifically, the way IORESOURCE_MEM resources are copied seems wrong.
They start at the base address of only one resource and use the offsets
provided in the struct mfd_cell. See the if-statement at
drivers/mfd/mfd-core.c line 48.

I need two use two different parent resources. The mfd_add_devices()
function doesn't support this.

> > +static int cmodio_remove_subdev(struct device *dev, void *data)
> > +{
> > +	platform_device_unregister(to_platform_device(dev));
> > +	return 0;
> > +}
> > +
> > +static void cmodio_subdev_release(struct device *dev)
> > +{
> > +	kfree(to_platform_device(dev));
> > +}
> > +
> > +static struct platform_device *cmodio_create_subdev(struct cmodio_device *priv,
> > +						    char *name,
> > +						    unsigned int res_count,
> > +						    unsigned int pdata_size)
> > +{
> > +	struct platform_device *pdev;
> > +	size_t res_size;
> > +
> > +	res_size = sizeof(struct resource) * res_count;
> > +	pdev = kzalloc(sizeof(*pdev) + res_size + pdata_size, GFP_KERNEL);
> > +	if (!pdev)
> > +		return NULL;
> > +
> > +	pdev->dev.release = cmodio_subdev_release;
> > +	pdev->dev.parent = &priv->pdev->dev;
> > +	pdev->name = name;
> > +
> > +	if (res_count) {
> > +		pdev->resource = (struct resource *)(pdev + 1);
> > +		pdev->num_resources = res_count;
> > +	}
> > +
> > +	if (pdata_size)
> > +		pdev->dev.platform_data = (void *)(pdev + 1) + res_size;
> > +
> > +	return pdev;
> > +}
> > +
> > +/* Create a memory resource for a subdevice */
> > +static void cmodio_create_mem(struct resource *parent, struct resource *res,
> > +			      resource_size_t offset, resource_size_t size)
> > +{
> > +	res->flags = IORESOURCE_MEM;
> > +	res->parent = parent;
> > +	res->start = parent->start + offset;
> > +	res->end = parent->start + offset + size - 1;
> > +}
> > +
> > +/* Create an IRQ resource for a subdevice */
> > +static void cmodio_create_irq(struct resource *res, unsigned int irq)
> > +{
> > +	res->flags = IORESOURCE_IRQ;
> > +	res->parent = NULL;
> > +	res->start = irq;
> > +	res->end = irq;
> > +}
> > +
> > +static int __devinit cmodio_probe_subdevice(struct cmodio_device *priv,
> > +					    char *name, unsigned int modno)
> > +{
> > +	struct janz_platform_data *pdata;
> > +	struct platform_device *pdev;
> > +	resource_size_t offset, size;
> > +	struct pci_dev *pci;
> > +	int ret;
> > +
> > +	pci = priv->pdev;
> > +	pdev = cmodio_create_subdev(priv, name, 3, sizeof(*pdata));
> > +	if (!pdev) {
> > +		dev_err(&pci->dev, "MODULbus slot %d alloc failed\n", modno);
> > +		ret = -ENOMEM;
> > +		goto out_return;
> > +	}
> > +
> > +	pdata = pdev->dev.platform_data;
> > +	pdata->modno = modno;
> > +	pdev->id = priv->subdev_id++;
> > +
> > +	/* MODULbus registers -- PCI BAR3 is big-endian MODULbus access */
> > +	offset = CMODIO_MODULBUS_SIZE * modno;
> > +	size = CMODIO_MODULBUS_SIZE;
> > +	cmodio_create_mem(&pci->resource[3], &pdev->resource[0], offset, size);
> > +
> > +	/* PLX Control Registers -- PCI BAR4 is interrupt and other registers */
> > +	offset = 0;
> > +	size = resource_size(&pci->resource[4]);
> > +	cmodio_create_mem(&pci->resource[4], &pdev->resource[1], offset, size);
> > +
> > +	/* IRQ */
> > +	cmodio_create_irq(&pdev->resource[2], pci->irq);
> > +
> > +	/* Register the device */
> > +	ret = platform_device_register(pdev);
> > +	if (ret) {
> > +		dev_err(&pci->dev, "MODULbus slot %d register failed\n", modno);
> > +		goto out_free;
> > +	}
> > +
> > +	return 0;
> > +
> > +out_free:
> > +	cmodio_subdev_release(&pdev->dev);
> > +out_return:
> > +	return ret;
> > +}
> > +
> > +/* Probe each submodule using kernel parameters */
> > +static int __devinit cmodio_probe_submodules(struct cmodio_device *priv)
> > +{
> > +	char *name;
> > +	int i;
> > +
> > +	for (i = 0; i < num_modules; i++) {
> > +		name = modules[i];
> > +		if (!strcmp(name, ""))
> > +			continue;
> > +
> > +		dev_dbg(&priv->pdev->dev, "MODULbus %d: name %s\n", i, name);
> > +		cmodio_probe_subdevice(priv, name, i);
> > +	}
> > +
> > +	return 0;
> > +}
> 
> 
> > +/*
> > + * PCI Driver
> > + */
> > +
> > +static int __devinit cmodio_pci_probe(struct pci_dev *dev,
> > +				      const struct pci_device_id *id)
> > +{
> > +	struct cmodio_device *priv;
> > +	int ret;
> > +
> > +	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> > +	if (!priv) {
> > +		dev_err(&dev->dev, "unable to allocate private data\n");
> > +		ret = -ENOMEM;
> > +		goto out_return;
> > +	}
> > +
> > +	pci_set_drvdata(dev, priv);
> > +	priv->pdev = dev;
> > +
> > +	/* Hardware Initialization */
> > +	ret = pci_enable_device(dev);
> > +	if (ret) {
> > +		dev_err(&dev->dev, "unable to enable device\n");
> > +		goto out_free_priv;
> > +	}
> > +
> > +	pci_set_master(dev);
> > +	ret = pci_request_regions(dev, DRV_NAME);
> > +	if (ret) {
> > +		dev_err(&dev->dev, "unable to request regions\n");
> > +		goto out_pci_disable_device;
> > +	}
> > +
> > +	/* Onboard configuration registers */
> > +	priv->ctrl = pci_ioremap_bar(dev, 4);
> Why 4 ?
> 
> 

Because that is how the device works ;) There is a comment up above that
describes them as the "PLX control registers". Are you suggesting that I
add a comment here too?

I think lots of other PCI devices just use hard-coded numbers here.
They're device specific. You won't be able to program for the device at
all if you don't know the meaning of each PCI BAR.

> > +#define PCI_VENDOR_ID_JANZ		0x13c3
> That probably belongs to pci_ids.h
> 

Should I add a patch to the series for this?

Thanks,
Ira

^ permalink raw reply

* Re: [RFC] GTSM for IPv6
From: Pekka Savola @ 2010-03-19 18:02 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David Miller,
	YOSHIFUJI Hideaki / 吉藤英明, netdev
In-Reply-To: <20100319095640.42c8d82d@nehalam>

On Fri, 19 Mar 2010, Stephen Hemminger wrote:
> Also RFC doesn't explicitly address GTSM on IPV6.
> Maybe the RFC editors think the problem will magically no longer exist
> in IPv6 world because everyone will be using IPsec.

Hmm. When I was editing the RFC, I seem to have put in some text about 
IPv6 (i.e. difference in TTL vs Hop Count naming).  As far as I know, 
there is no other difference :-)

In IPV6_MIN_HOPS hops would seem to point toward the "number of hops" 
which is logically the opposite: 255-$value.  So maybe 
IPV6_MIN_HOPCOUNT is better. But I can live with it either way :-)

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings

^ permalink raw reply

* Re: Add PGM protocol support to the IP stack
From: Andi Kleen @ 2010-03-19 17:18 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: David Miller, netdev, linux-kernel
In-Reply-To: <alpine.DEB.2.00.1003181245050.23010@router.home>

Christoph Lameter <cl@linux-foundation.org> writes:
>
> I know about the openpgm implementation. Openpbm does this at the user
> level and requires linking to a library. It is essentially a communication
> protocol done in user space. It has privilege issues because it has to
> create PGM packets via a raw socket.

That seems like a poor reason alone to put something into the kernel
Perhaps you rather need some way to have unpriviledged raw sockets?

The classical way to do this is to start suid root, only open
the socket and then drop privileges.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply

* [RFC] GTSM for IPv6
From: Stephen Hemminger @ 2010-03-19 16:56 UTC (permalink / raw)
  To: David Miller,
	YOSHIFUJI Hideaki / 吉藤英明; +Cc: netdev

This patch implements Generalized TTL Security Mechanism for IPv6.
It is not tested, but I am putting it out to get feedback about:
  * is this the API (setsockout IPV6_MIN_HOPS) that we want to use
  * compatibility with IPv4
  * minor growth of socket packet info structure

Also RFC doesn't explicitly address GTSM on IPV6.
Maybe the RFC editors think the problem will magically no longer exist
in IPv6 world because everyone will be using IPsec.


---
 include/linux/in6.h      |    3 +++
 include/linux/ipv6.h     |    3 ++-
 net/ipv6/ipv6_sockglue.c |   12 ++++++++++++
 net/ipv6/tcp_ipv6.c      |   17 ++++++++++++++---
 4 files changed, 31 insertions(+), 4 deletions(-)

--- a/net/ipv6/tcp_ipv6.c	2010-03-19 09:05:48.038329597 -0700
+++ b/net/ipv6/tcp_ipv6.c	2010-03-19 09:51:12.293647330 -0700
@@ -349,6 +349,12 @@ static void tcp_v6_err(struct sk_buff *s
 	if (sk->sk_state == TCP_CLOSE)
 		goto out;
 
+	np = inet6_sk(sk);
+	if (ipv6_hdr(skb)->hop_limit < np->min_hops) {
+		NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
+		goto out;
+	}
+
 	tp = tcp_sk(sk);
 	seq = ntohl(th->seq);
 	if (sk->sk_state != TCP_LISTEN &&
@@ -357,8 +363,6 @@ static void tcp_v6_err(struct sk_buff *s
 		goto out;
 	}
 
-	np = inet6_sk(sk);
-
 	if (type == ICMPV6_PKT_TOOBIG) {
 		struct dst_entry *dst = NULL;
 
@@ -1675,6 +1679,7 @@ ipv6_pktoptions:
 static int tcp_v6_rcv(struct sk_buff *skb)
 {
 	struct tcphdr *th;
+	struct ipv6hdr *hdr;
 	struct sock *sk;
 	int ret;
 	struct net *net = dev_net(skb->dev);
@@ -1701,12 +1706,13 @@ static int tcp_v6_rcv(struct sk_buff *sk
 		goto bad_packet;
 
 	th = tcp_hdr(skb);
+	hdr = ipv6_hdr(skb);
 	TCP_SKB_CB(skb)->seq = ntohl(th->seq);
 	TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
 				    skb->len - th->doff*4);
 	TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq);
 	TCP_SKB_CB(skb)->when = 0;
-	TCP_SKB_CB(skb)->flags = ipv6_get_dsfield(ipv6_hdr(skb));
+	TCP_SKB_CB(skb)->flags = ipv6_get_dsfield(hdr);
 	TCP_SKB_CB(skb)->sacked = 0;
 
 	sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest);
@@ -1717,6 +1723,11 @@ process:
 	if (sk->sk_state == TCP_TIME_WAIT)
 		goto do_time_wait;
 
+	if (hdr->hop_limit < inet6_sk(sk)->min_hops) {
+		NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
+		goto discard_and_relse;
+	}
+
 	if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))
 		goto discard_and_relse;
 
--- a/include/linux/in6.h	2010-03-19 09:40:24.788957033 -0700
+++ b/include/linux/in6.h	2010-03-19 09:41:41.432704471 -0700
@@ -265,6 +265,9 @@ struct in6_flowlabel_req {
 #define IPV6_PREFER_SRC_CGA		0x0008
 #define IPV6_PREFER_SRC_NONCGA		0x0800
 
+/* RFC5082: Generalized Ttl Security Mechanism */
+#define IPV6_MIN_HOPS		73
+
 /*
  * Multicast Routing:
  * see include/linux/mroute6.h.
--- a/include/linux/ipv6.h	2010-03-19 09:26:17.368329255 -0700
+++ b/include/linux/ipv6.h	2010-03-19 09:27:03.929206412 -0700
@@ -348,6 +348,7 @@ struct ipv6_pinfo {
 						 * 010: prefer public address
 						 * 100: prefer care-of address
 						 */
+	__u8			min_hops;
 	__u8			tclass;
 
 	__u32			dst_cookie;
--- a/net/ipv6/ipv6_sockglue.c	2010-03-19 09:35:40.488016906 -0700
+++ b/net/ipv6/ipv6_sockglue.c	2010-03-19 09:39:57.948026685 -0700
@@ -766,6 +766,14 @@ pref_skip_coa:
 
 		break;
 	    }
+	case IPV6_MIN_HOPS:
+		if (optlen < sizeof(int))
+			goto e_inval;
+		if (val < 0 || val > 255)
+			goto e_inval;
+		np->min_hops = val;
+		retv = 0;
+		break;
 	}
 
 	release_sock(sk);
@@ -1114,6 +1122,10 @@ static int do_ipv6_getsockopt(struct soc
 			val |= IPV6_PREFER_SRC_HOME;
 		break;
 
+	case IPV6_MIN_HOPS:
+		val = np->min_hops;
+		break;
+
 	default:
 		return -ENOPROTOOPT;
 	}

^ permalink raw reply

* Re: [PATCH 1/3] mfd: add support for Janz CMOD-IO PCI MODULbus Carrier Board
From: Samuel Ortiz @ 2010-03-19 16:38 UTC (permalink / raw)
  To: Ira W. Snyder; +Cc: linux-kernel, netdev, socketcan-core
In-Reply-To: <1268930324-29841-2-git-send-email-iws@ovro.caltech.edu>

Hi Ira,

Some comments below:

On Thu, Mar 18, 2010 at 09:38:42AM -0700, Ira W. Snyder wrote:
> +/* Module Parameters */
> +static unsigned int num_modules = CMODIO_MAX_MODULES;
> +static unsigned char *modules[CMODIO_MAX_MODULES] = {
> +	"janz-ican3",
> +	"janz-ican3",
> +	"",
> +	"janz-ttl",
> +};
That's not very nice, but I honestly dont know how to make it less ugly...
At least this should be all left blank by default, as Wolfgang hinted.

> +/*
> + * Subdevice Support
> + */
Please use the mfd-core API for building and registering platform sub devices.
The pieces of code below should shrink significantly.

> +static int cmodio_remove_subdev(struct device *dev, void *data)
> +{
> +	platform_device_unregister(to_platform_device(dev));
> +	return 0;
> +}
> +
> +static void cmodio_subdev_release(struct device *dev)
> +{
> +	kfree(to_platform_device(dev));
> +}
> +
> +static struct platform_device *cmodio_create_subdev(struct cmodio_device *priv,
> +						    char *name,
> +						    unsigned int res_count,
> +						    unsigned int pdata_size)
> +{
> +	struct platform_device *pdev;
> +	size_t res_size;
> +
> +	res_size = sizeof(struct resource) * res_count;
> +	pdev = kzalloc(sizeof(*pdev) + res_size + pdata_size, GFP_KERNEL);
> +	if (!pdev)
> +		return NULL;
> +
> +	pdev->dev.release = cmodio_subdev_release;
> +	pdev->dev.parent = &priv->pdev->dev;
> +	pdev->name = name;
> +
> +	if (res_count) {
> +		pdev->resource = (struct resource *)(pdev + 1);
> +		pdev->num_resources = res_count;
> +	}
> +
> +	if (pdata_size)
> +		pdev->dev.platform_data = (void *)(pdev + 1) + res_size;
> +
> +	return pdev;
> +}
> +
> +/* Create a memory resource for a subdevice */
> +static void cmodio_create_mem(struct resource *parent, struct resource *res,
> +			      resource_size_t offset, resource_size_t size)
> +{
> +	res->flags = IORESOURCE_MEM;
> +	res->parent = parent;
> +	res->start = parent->start + offset;
> +	res->end = parent->start + offset + size - 1;
> +}
> +
> +/* Create an IRQ resource for a subdevice */
> +static void cmodio_create_irq(struct resource *res, unsigned int irq)
> +{
> +	res->flags = IORESOURCE_IRQ;
> +	res->parent = NULL;
> +	res->start = irq;
> +	res->end = irq;
> +}
> +
> +static int __devinit cmodio_probe_subdevice(struct cmodio_device *priv,
> +					    char *name, unsigned int modno)
> +{
> +	struct janz_platform_data *pdata;
> +	struct platform_device *pdev;
> +	resource_size_t offset, size;
> +	struct pci_dev *pci;
> +	int ret;
> +
> +	pci = priv->pdev;
> +	pdev = cmodio_create_subdev(priv, name, 3, sizeof(*pdata));
> +	if (!pdev) {
> +		dev_err(&pci->dev, "MODULbus slot %d alloc failed\n", modno);
> +		ret = -ENOMEM;
> +		goto out_return;
> +	}
> +
> +	pdata = pdev->dev.platform_data;
> +	pdata->modno = modno;
> +	pdev->id = priv->subdev_id++;
> +
> +	/* MODULbus registers -- PCI BAR3 is big-endian MODULbus access */
> +	offset = CMODIO_MODULBUS_SIZE * modno;
> +	size = CMODIO_MODULBUS_SIZE;
> +	cmodio_create_mem(&pci->resource[3], &pdev->resource[0], offset, size);
> +
> +	/* PLX Control Registers -- PCI BAR4 is interrupt and other registers */
> +	offset = 0;
> +	size = resource_size(&pci->resource[4]);
> +	cmodio_create_mem(&pci->resource[4], &pdev->resource[1], offset, size);
> +
> +	/* IRQ */
> +	cmodio_create_irq(&pdev->resource[2], pci->irq);
> +
> +	/* Register the device */
> +	ret = platform_device_register(pdev);
> +	if (ret) {
> +		dev_err(&pci->dev, "MODULbus slot %d register failed\n", modno);
> +		goto out_free;
> +	}
> +
> +	return 0;
> +
> +out_free:
> +	cmodio_subdev_release(&pdev->dev);
> +out_return:
> +	return ret;
> +}
> +
> +/* Probe each submodule using kernel parameters */
> +static int __devinit cmodio_probe_submodules(struct cmodio_device *priv)
> +{
> +	char *name;
> +	int i;
> +
> +	for (i = 0; i < num_modules; i++) {
> +		name = modules[i];
> +		if (!strcmp(name, ""))
> +			continue;
> +
> +		dev_dbg(&priv->pdev->dev, "MODULbus %d: name %s\n", i, name);
> +		cmodio_probe_subdevice(priv, name, i);
> +	}
> +
> +	return 0;
> +}


> +/*
> + * PCI Driver
> + */
> +
> +static int __devinit cmodio_pci_probe(struct pci_dev *dev,
> +				      const struct pci_device_id *id)
> +{
> +	struct cmodio_device *priv;
> +	int ret;
> +
> +	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> +	if (!priv) {
> +		dev_err(&dev->dev, "unable to allocate private data\n");
> +		ret = -ENOMEM;
> +		goto out_return;
> +	}
> +
> +	pci_set_drvdata(dev, priv);
> +	priv->pdev = dev;
> +
> +	/* Hardware Initialization */
> +	ret = pci_enable_device(dev);
> +	if (ret) {
> +		dev_err(&dev->dev, "unable to enable device\n");
> +		goto out_free_priv;
> +	}
> +
> +	pci_set_master(dev);
> +	ret = pci_request_regions(dev, DRV_NAME);
> +	if (ret) {
> +		dev_err(&dev->dev, "unable to request regions\n");
> +		goto out_pci_disable_device;
> +	}
> +
> +	/* Onboard configuration registers */
> +	priv->ctrl = pci_ioremap_bar(dev, 4);
Why 4 ?


> +#define PCI_VENDOR_ID_JANZ		0x13c3
That probably belongs to pci_ids.h

Cheers,
Samuel.
-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply

* Re: [Uclinux-dist-devel] [PATCH] can: bfin_can: switch to common Blackfin can header
From: Mike Frysinger @ 2010-03-19 16:23 UTC (permalink / raw)
  To: Hartkopp, Oliver (K-EFFI/P)
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA, Thuermann, Urs, Dr. (K-EFFI/I),
	David Miller, uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b
In-Reply-To: <26B4E6A46012A1469B4EB3BC2A7CAAEC44EF47-2ISBvSz7ubqzqAecw3LaLo+MsED4In1V@public.gmane.org>

On Fri, Mar 19, 2010 at 02:56, Hartkopp, Oliver (K-EFFI/P) wrote:
> your patch is just a cleanup and definitely not mission-critical.

ive already explained the background for when the patch can be merged.
 please read the whole thread before jumping in.
-mike

^ permalink raw reply

* [PATCH] igb: Add support for 82576 ET2 Quad Port Server Adapter
From: Jeff Kirsher @ 2010-03-19 16:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Carolyn Wyborny, Jeff Kirsher

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/e1000_82575.c |    1 +
 drivers/net/igb/e1000_hw.h    |    1 +
 drivers/net/igb/igb_main.c    |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 9d7fa2f..0bc990e 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -94,6 +94,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 	case E1000_DEV_ID_82576_FIBER:
 	case E1000_DEV_ID_82576_SERDES:
 	case E1000_DEV_ID_82576_QUAD_COPPER:
+	case E1000_DEV_ID_82576_QUAD_COPPER_ET2:
 	case E1000_DEV_ID_82576_SERDES_QUAD:
 		mac->type = e1000_82576;
 		break;
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 4480052..82a533f 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -41,6 +41,7 @@ struct e1000_hw;
 #define E1000_DEV_ID_82576_FIBER              0x10E6
 #define E1000_DEV_ID_82576_SERDES             0x10E7
 #define E1000_DEV_ID_82576_QUAD_COPPER        0x10E8
+#define E1000_DEV_ID_82576_QUAD_COPPER_ET2    0x1526
 #define E1000_DEV_ID_82576_NS                 0x150A
 #define E1000_DEV_ID_82576_NS_SERDES          0x1518
 #define E1000_DEV_ID_82576_SERDES_QUAD        0x150D
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 0ed25f0..45a0e4f 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -72,6 +72,7 @@ static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES_QUAD), board_82575 },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER_ET2), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 },


^ permalink raw reply related

* Re: [Bug 14470] New: freez in TCP stack
From: Ilpo Järvinen @ 2010-03-19 15:52 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Miller, eric.dumazet, Stephen Hemminger, Netdev, kolo,
	bugzilla-daemon
In-Reply-To: <20100318140424.aaf3ec24.akpm@linux-foundation.org>

On Thu, 18 Mar 2010, Andrew Morton wrote:

> On Wed, 02 Dec 2009 22:24:46 -0800 (PST)
> David Miller <davem@davemloft.net> wrote:
> 
> > From: "Ilpo J__rvinen" <ilpo.jarvinen@helsinki.fi>
> > Date: Thu, 26 Nov 2009 23:54:53 +0200 (EET)
> > 
> > > [PATCH] tcp: clear hints to avoid a stale one (nfs only affected?)
> > 
> > Ok, since Linus just released 2.6.32 I'm tossing this into net-next-2.6
> > so it gets wider exposure.
> > 
> > I still want to see test results from the bug reporter, and if it fixes
> > things we can toss this into -stable too.
> 
> Despite my request to take this to email, quite a few people have been
> jumping onto this report via bugzilla:
> http://bugzilla.kernel.org/show_bug.cgi?id=14470
> 
> Bit of a pita, but it'd be worth someone taking a look to ensure that
> we're all talking about the same bug.

Could one try with this debug patch:

http://marc.info/?l=linux-kernel&m=126624014117610&w=2

It should prevent crashing too.

-- 
 i.

^ permalink raw reply

* Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module
From: Wolfgang Grandegger @ 2010-03-19 15:45 UTC (permalink / raw)
  To: Ira W. Snyder; +Cc: linux-kernel, socketcan-core, netdev, sameo
In-Reply-To: <20100319151914.GB13672@ovro.caltech.edu>

Ira W. Snyder wrote:
> On Fri, Mar 19, 2010 at 10:01:14AM +0100, Wolfgang Grandegger wrote:
>> Hi Ira,
>>
>> we already discussed this patch on the SocketCAN mailing list and there
>> are just a few minor issues and the request to add support for the new
>> "berr-reporting" option, if feasible. See:
>>
>>   commit 52c793f24054f5dc30d228e37e0e19cc8313f086
>>   Author: Wolfgang Grandegger <wg@grandegger.com>
>>   Date:   Mon Feb 22 22:21:17 2010 +0000
>>
>>     can: netlink support for bus-error reporting and counters
>>     
>>     This patch makes the bus-error reporting configurable and allows to
>>     retrieve the CAN TX and RX bus error counters via netlink interface.
>>     I have added support for the SJA1000. The TX and RX bus error counters
>>     are also copied to the data fields 6..7 of error messages when state
>>     changes are reported.
>>
>> Should not be a big deal.
>>
> 
> I think this patch came along since my last post of the driver. I must
> have missed it. I'll try and add support.

No problem, it's really new. Just just need to enable BEI depending on
CAN_CTRLMODE_BERR_REPORTING.

>> More inline...
>>
>> Ira W. Snyder wrote:
>>> The Janz VMOD-ICAN3 is a MODULbus daughterboard which fits onto any
>>> MODULbus carrier board. It is an intelligent CAN controller with a
>>> microcontroller and associated firmware.
>>>
>>> Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
>>> Cc: socketcan-core@lists.berlios.de
>>> Cc: netdev@vger.kernel.org
>>> ---
>>>  drivers/net/can/Kconfig      |   10 +
>>>  drivers/net/can/Makefile     |    1 +
>>>  drivers/net/can/janz-ican3.c | 1659 ++++++++++++++++++++++++++++++++++++++++++
>>>  3 files changed, 1670 insertions(+), 0 deletions(-)
>>>  create mode 100644 drivers/net/can/janz-ican3.c
>>>
>>> diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
>>> index 05b7517..2c5227c 100644
>>> --- a/drivers/net/can/Kconfig
>>> +++ b/drivers/net/can/Kconfig
>>> @@ -63,6 +63,16 @@ config CAN_BFIN
>>>  	  To compile this driver as a module, choose M here: the
>>>  	  module will be called bfin_can.
>>>  
>>> +config CAN_JANZ_ICAN3
>>> +	tristate "Janz VMOD-ICAN3 Intelligent CAN controller"
>>> +	depends on CAN_DEV && MFD_JANZ_CMODIO
>>> +	---help---
>>> +	  Driver for Janz VMOD-ICAN3 Intelligent CAN controller module, which
>>> +	  connects to a MODULbus carrier board.
>>> +
>>> +	  This driver can also be built as a module. If so, the module will be
>>> +	  called janz-ican3.ko.
>>> +
>>>  source "drivers/net/can/mscan/Kconfig"
>>>  
>>>  source "drivers/net/can/sja1000/Kconfig"
>>> diff --git a/drivers/net/can/Makefile b/drivers/net/can/Makefile
>>> index 7a702f2..9047cd0 100644
>>> --- a/drivers/net/can/Makefile
>>> +++ b/drivers/net/can/Makefile
>>> @@ -15,5 +15,6 @@ obj-$(CONFIG_CAN_AT91)		+= at91_can.o
>>>  obj-$(CONFIG_CAN_TI_HECC)	+= ti_hecc.o
>>>  obj-$(CONFIG_CAN_MCP251X)	+= mcp251x.o
>>>  obj-$(CONFIG_CAN_BFIN)		+= bfin_can.o
>>> +obj-$(CONFIG_CAN_JANZ_ICAN3)	+= janz-ican3.o
>>>  
>>>  ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
>>> diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
>>> new file mode 100644
>>> index 0000000..94d4995
>>> --- /dev/null
>>> +++ b/drivers/net/can/janz-ican3.c
>> [snip]
>>  +struct ican3_dev {
>>> +
>>> +	/* must be the first member */
>>> +	struct can_priv can;
>>> +
>>> +	/* CAN network device */
>>> +	struct net_device *ndev;
>>> +	struct napi_struct napi;
>>> +
>>> +	/* Device for printing */
>>> +	struct device *dev;
>>> +
>>> +	/* module number */
>>> +	unsigned int num;
>>> +
>>> +	/* base address of registers and IRQ */
>>> +	struct janz_cmodio_onboard_regs __iomem *ctrl;
>>> +	struct ican3_dpm_control *dpmctrl;
>>> +	void __iomem *dpm;
>>> +	int irq;
>>> +
>>> +	/* old and new style host interface */
>>> +	unsigned int iftype;
>>> +	spinlock_t lock;
>> Please describe what the lock is used for.
>>
>>> +	/* new host interface */
>>> +	unsigned int rx_int;
>>> +	unsigned int rx_num;
>>> +	unsigned int tx_num;
>>> +
>>> +	/* fast host interface */
>>> +	unsigned int fastrx_start;
>>> +	unsigned int fastrx_int;
>>> +	unsigned int fastrx_num;
>>> +	unsigned int fasttx_start;
>>> +	unsigned int fasttx_num;
>>> +
>>> +	/* first free DPM page */
>>> +	unsigned int free_page;
>>> +};
>> [snip]
>>> +static void ican3_to_can_frame(struct ican3_dev *mod,
>>> +			       struct ican3_fast_desc *desc,
>>> +			       struct can_frame *cf)
>>> +{
>>> +	if ((desc->command & ICAN3_CAN_TYPE_MASK) == ICAN3_CAN_TYPE_SFF) {
>>> +		dev_dbg(mod->dev, "%s: old frame format\n", __func__);
>> This prints a debug message for every message which is not really
>> useful for the user. Please remove.
>>
>>> +		if (desc->data[1] & ICAN3_SFF_RTR)
>>> +			cf->can_id |= CAN_RTR_FLAG;
>>> +
>>> +		cf->can_id |= desc->data[0] << 3;
>>> +		cf->can_id |= (desc->data[1] & 0xe0) >> 5;
>>> +		cf->can_dlc = desc->data[1] & ICAN3_CAN_DLC_MASK;
>>> +		memcpy(cf->data, &desc->data[2], sizeof(cf->data));
>>> +	} else {
>>> +		dev_dbg(mod->dev, "%s: new frame format\n", __func__);
>> Ditto.
>>
>>> +		cf->can_dlc = desc->data[0] & ICAN3_CAN_DLC_MASK;
>>> +		if (desc->data[0] & ICAN3_EFF_RTR)
>>> +			cf->can_id |= CAN_RTR_FLAG;
>>> +
>>> +		if (desc->data[0] & ICAN3_EFF) {
>>> +			cf->can_id |= CAN_EFF_FLAG;
>>> +			cf->can_id |= desc->data[2] << 21; /* 28-21 */
>>> +			cf->can_id |= desc->data[3] << 13; /* 20-13 */
>>> +			cf->can_id |= desc->data[4] << 5;  /* 12-5  */
>>> +			cf->can_id |= (desc->data[5] & 0xf8) >> 3;
>>> +		} else {
>>> +			cf->can_id |= desc->data[2] << 3;  /* 10-3  */
>>> +			cf->can_id |= desc->data[3] >> 5;  /* 2-0   */
>>> +		}
>>> +
>>> +		memcpy(cf->data, &desc->data[6], sizeof(cf->data));
>>> +	}
>>> +}
>>> +
>>> +static void can_frame_to_ican3(struct ican3_dev *mod,
>>> +			       struct can_frame *cf,
>>> +			       struct ican3_fast_desc *desc)
>>> +{
>>> +	/* clear out any stale data in the descriptor */
>>> +	memset(desc->data, 0, sizeof(desc->data));
>>> +
>>> +	/* we always use the extended format, with the ECHO flag set */
>>> +	desc->command = ICAN3_CAN_TYPE_EFF;
>>> +	desc->data[0] |= cf->can_dlc;
>>> +	desc->data[1] |= ICAN3_ECHO;
>>> +
>>> +	if (cf->can_id & CAN_RTR_FLAG)
>>> +		desc->data[0] |= ICAN3_EFF_RTR;
>>> +
>>> +	/* pack the id into the correct places */
>>> +	if (cf->can_id & CAN_EFF_FLAG) {
>>> +		dev_dbg(mod->dev, "%s: extended frame\n", __func__);
>> Ditto.
>>
>>> +		desc->data[0] |= ICAN3_EFF;
>>> +		desc->data[2] = (cf->can_id & 0x1fe00000) >> 21; /* 28-21 */
>>> +		desc->data[3] = (cf->can_id & 0x001fe000) >> 13; /* 20-13 */
>>> +		desc->data[4] = (cf->can_id & 0x00001fe0) >> 5;  /* 12-5  */
>>> +		desc->data[5] = (cf->can_id & 0x0000001f) << 3;  /* 4-0   */
>>> +	} else {
>>> +		dev_dbg(mod->dev, "%s: standard frame\n", __func__);
>> Ditto.
>>
>>> +		desc->data[2] = (cf->can_id & 0x7F8) >> 3; /* bits 10-3 */
>>> +		desc->data[3] = (cf->can_id & 0x007) << 5; /* bits 2-0  */
>>> +	}
>>> +
>>> +	/* copy the data bits into the descriptor */
>>> +	memcpy(&desc->data[6], cf->data, sizeof(cf->data));
>>> +}
>> [snip]
>>> +/*
>>> + * Handle CAN Event Indication Messages from the firmware
>>> + *
>>> + * The ICAN3 firmware provides the values of some SJA1000 registers when it
>>> + * generates this message. The code below is largely copied from the
>>> + * drivers/net/can/sja1000/sja1000.c file, and adapted as necessary
>>> + */
>>> +static int ican3_handle_cevtind(struct ican3_dev *mod, struct ican3_msg *msg)
>>> +{
>>> +	struct net_device *dev = mod->ndev;
>>> +	struct net_device_stats *stats = &dev->stats;
>>> +	enum can_state state = mod->can.state;
>>> +	struct can_frame *cf;
>>> +	struct sk_buff *skb;
>>> +	u8 status, isrc;
>>> +
>>> +	/* we can only handle the SJA1000 part */
>>> +	if (msg->data[1] != CEVTIND_CHIP_SJA1000) {
>>> +		dev_err(mod->dev, "unable to handle errors on non-SJA1000\n");
>>> +		return -ENODEV;
>>> +	}
>>> +
>>> +	/* check the message length for sanity */
>>> +	if (msg->len < 6) {
>>> +		dev_err(mod->dev, "error message too short\n");
>>> +		return -EINVAL;
>>> +	}
>>> +
>>> +	skb = alloc_can_err_skb(dev, &cf);
>>> +	if (skb == NULL)
>>> +		return -ENOMEM;
>>> +
>>> +	isrc = msg->data[0];
>>> +	status = msg->data[3];
>>> +
>>> +	/* data overrun interrupt */
>>> +	if (isrc == CEVTIND_DOI || isrc == CEVTIND_LOST) {
>> Here and for the other errors below a dev_dbg() would be useful. Please
>> check sja1000.c.
>>
>>> +		cf->can_id |= CAN_ERR_CRTL;
>>> +		cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
>>> +		stats->rx_over_errors++;
>>> +		stats->rx_errors++;
>>> +		dev_info(mod->dev, "%s: overflow frame generated\n", __func__);
>> s/dev_info/dev_dbg/ ?
>>
> 
> Whoops, a leftover from debugging. Will change to dev_dbg().
> 
>>> +	}
>>> +
>>> +	/* error warning interrupt */
>>> +	if (isrc == CEVTIND_EI) {
>>> +		if (status & SR_BS) {
>>> +			state = CAN_STATE_BUS_OFF;
>>> +			cf->can_id |= CAN_ERR_BUSOFF;
>>> +			can_bus_off(dev);
>>> +		} else if (status & SR_ES) {
>>> +			state = CAN_STATE_ERROR_WARNING;
>>> +		} else {
>>> +			state = CAN_STATE_ERROR_ACTIVE;
>>> +		}
>>> +	}
>>> +
>>> +	/* bus error interrupt */
>>> +	if (isrc == CEVTIND_BEI) {
>>> +		u8 ecc = msg->data[2];
>> Add an empty line, please.
>>
>>> +		mod->can.can_stats.bus_error++;
>>> +		stats->rx_errors++;
>>> +		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
>>> +
>>> +		switch (ecc & ECC_MASK) {
>>> +		case ECC_BIT:
>>> +			cf->data[2] |= CAN_ERR_PROT_BIT;
>>> +			break;
>>> +		case ECC_FORM:
>>> +			cf->data[2] |= CAN_ERR_PROT_FORM;
>>> +			break;
>>> +		case ECC_STUFF:
>>> +			cf->data[2] |= CAN_ERR_PROT_STUFF;
>>> +			break;
>>> +		default:
>>> +			cf->data[2] |= CAN_ERR_PROT_UNSPEC;
>>> +			cf->data[3] = ecc & ECC_SEG;
>>> +			break;
>>> +		}
>>> +
>>> +		if ((ecc & ECC_DIR) == 0)
>>> +			cf->data[2] |= CAN_ERR_PROT_TX;
>>> +	}
>>> +
>>> +	if (state != mod->can.state && (state == CAN_STATE_ERROR_WARNING ||
>>> +					state == CAN_STATE_ERROR_PASSIVE)) {
>>> +		u8 rxerr = msg->data[4];
>>> +		u8 txerr = msg->data[5];
>> Ditto.
>>
>>> +		cf->can_id |= CAN_ERR_CRTL;
>>> +		if (state == CAN_STATE_ERROR_WARNING) {
>>> +			mod->can.can_stats.error_warning++;
>>> +			cf->data[1] = (txerr > rxerr) ?
>>> +				CAN_ERR_CRTL_TX_WARNING :
>>> +				CAN_ERR_CRTL_RX_WARNING;
>>> +		} else {
>>> +			mod->can.can_stats.error_passive++;
>>> +			cf->data[1] = (txerr > rxerr) ?
>>> +				CAN_ERR_CRTL_TX_PASSIVE :
>>> +				CAN_ERR_CRTL_RX_PASSIVE;
>>> +		}
>>> +	}
>>> +
>>> +	mod->can.state = state;
>>> +	stats->rx_errors++;
>>> +	stats->rx_bytes += cf->can_dlc;
>>> +	netif_rx(skb);
>>> +	return 0;
>>> +}
>> [snip]
>>> +static irqreturn_t ican3_irq(int irq, void *dev_id)
>>> +{
>>> +	struct ican3_dev *mod = dev_id;
>>> +	u8 stat;
>>> +
>>> +	/*
>>> +	 * The interrupt status register on this device reports interrupts
>>> +	 * as zeroes instead of using ones like most other devices
>>> +	 */
>>> +	stat = ioread8(&mod->ctrl->int_disable) & (1 << mod->num);
>>> +	if (stat == (1 << mod->num))
>>> +		return IRQ_NONE;
>>> +
>>> +	dev_dbg(mod->dev, "IRQ: module %d\n", mod->num);
>> Please remove this dev_dbg() as well.
>>
>> [snip]
>>> +/*
>>> + * Startup an ICAN module, bringing it into fast mode
>>> + */
>>> +static int __devinit ican3_startup_module(struct ican3_dev *mod)
>>> +{
>>> +	int ret;
>>> +
>>> +	ret = ican3_reset_module(mod);
>>> +	if (ret) {
>>> +		dev_err(mod->dev, "unable to reset module\n");
>>> +		return ret;
>>> +	}
>>> +
>>> +	/* re-enable interrupts so we can send messages */
>>> +	iowrite8(1 << mod->num, &mod->ctrl->int_enable);
>>> +
>>> +	ret = ican3_msg_connect(mod);
>>> +	if (ret) {
>>> +		dev_err(mod->dev, "unable to connect to module\n");
>>> +		return ret;
>>> +	}
>>> +
>>> +	ican3_init_new_host_interface(mod);
>>> +	ret = ican3_msg_newhostif(mod);
>>> +	if (ret) {
>>> +		dev_err(mod->dev, "unable to switch to new-style interface\n");
>>> +		return ret;
>>> +	}
>>> +
>>> +	ret = ican3_set_termination(mod, true);
>>> +	if (ret) {
>>> +		dev_err(mod->dev, "unable to enable termination\n");
>>> +		return ret;
>>> +	}
>>
>> Could you please allow the user to disable termination, e.g. via module parameter
>> "bus_termination=0" in case he uses a cable with built-in termination.
>>
> 
> What would you think about a sysfs node instead, so it could be changed
> at runtime, on a per-daughtercard basis? Do you think enabling bus
> termination is a good default? IMO, it is a pretty safe default for most
> users.

I have no problem with the default. There should just be a way to
disable termination somehow. A dev_info(dev, "CAN bus termination
enabled") would furthermore make clear, that it's active. Setting
termination via SysFS is the better solution, of course, as it's per
device. It might even be useful to handle this in future in a common way
via CAN_CTRLMODE_BUS_TERMINATION.

Wolfgang.

^ permalink raw reply

* [PATCH net-next-2.6] tcp: Add SNMP counter for DEFER_ACCEPT
From: Eric Dumazet @ 2010-03-19 15:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Its currently hard to diagnose when ACK frames are dropped because an
application set TCP_DEFER_ACCEPT on its listening socket.

See http://bugzilla.kernel.org/show_bug.cgi?id=15507

This patch adds a SNMP value, named TCPDeferAcceptDrop

netstat -s | grep TCPDeferAcceptDrop
    TCPDeferAcceptDrop: 0

This counter is incremented every time we drop a pure ACK frame received
by a socket in SYN_RECV state because its SYNACK retrans count is lower
than defer_accept value.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 include/linux/snmp.h     |    1 +
 net/ipv4/proc.c          |    1 +
 net/ipv4/tcp_minisocks.c |    1 +
 3 files changed, 3 insertions(+)

diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 4435d10..d2a9aa3 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -227,6 +227,7 @@ enum
 	LINUX_MIB_SACKSHIFTFALLBACK,
 	LINUX_MIB_TCPBACKLOGDROP,
 	LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */
+	LINUX_MIB_TCPDEFERACCEPTDROP,
 	__LINUX_MIB_MAX
 };
 
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 4f1f337..3dc9914 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -251,6 +251,7 @@ static const struct snmp_mib snmp4_net_list[] = {
 	SNMP_MIB_ITEM("TCPSackShiftFallback", LINUX_MIB_SACKSHIFTFALLBACK),
 	SNMP_MIB_ITEM("TCPBacklogDrop", LINUX_MIB_TCPBACKLOGDROP),
 	SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP),
+	SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP),
 	SNMP_MIB_SENTINEL
 };
 
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 4199bc6..32f9627 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -671,6 +671,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
 	if (req->retrans < inet_csk(sk)->icsk_accept_queue.rskq_defer_accept &&
 	    TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) {
 		inet_rsk(req)->acked = 1;
+		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPDEFERACCEPTDROP);
 		return NULL;
 	}
 



^ permalink raw reply related

* Re: [PATCH 1/3] mfd: add support for Janz CMOD-IO PCI MODULbus Carrier Board
From: Wolfgang Grandegger @ 2010-03-19 15:35 UTC (permalink / raw)
  To: Ira W. Snyder
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, sameo-VuQAYsv1563Yd54FQh9/CA
In-Reply-To: <20100319151326.GA13672-lulEs6mt1IksTUYHLfqkUA@public.gmane.org>

Ira W. Snyder wrote:
> On Fri, Mar 19, 2010 at 10:13:10AM +0100, Wolfgang Grandegger wrote:
>> Ira W. Snyder wrote:
>>> The Janz CMOD-IO PCI MODULbus carrier board is a PCI to MODULbus bridge,
>>> which may host many different types of MODULbus daughterboards, including
>>> CAN and GPIO controllers.
>>>
>>> Signed-off-by: Ira W. Snyder <iws-lulEs6mt1IksTUYHLfqkUA@public.gmane.org>
>>> Cc: Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
>> You can add my "Reviewed-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>".
>>
>> Just one concern:
>>
>>> ---
>>>  drivers/mfd/Kconfig       |    8 +
>>>  drivers/mfd/Makefile      |    1 +
>>>  drivers/mfd/janz-cmodio.c |  339 +++++++++++++++++++++++++++++++++++++++++++++
>>>  include/linux/mfd/janz.h  |   54 +++++++
>>>  4 files changed, 402 insertions(+), 0 deletions(-)
>>>  create mode 100644 drivers/mfd/janz-cmodio.c
>>>  create mode 100644 include/linux/mfd/janz.h
>>>
>>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>>> index 8782978..f1858d7 100644
>>> --- a/drivers/mfd/Kconfig
>>> +++ b/drivers/mfd/Kconfig
>>> @@ -27,6 +27,14 @@ config MFD_SM501_GPIO
>>>  	 lines on the SM501. The platform data is used to supply the
>>>  	 base number for the first GPIO line to register.
>>>  
>>> +config MFD_JANZ_CMODIO
>>> +	tristate "Support for Janz CMOD-IO PCI MODULbus Carrier Board"
>>> +	---help---
>>> +	  This is the core driver for the Janz CMOD-IO PCI MODULbus
>>> +	  carrier board. This device is a PCI to MODULbus bridge which may
>>> +	  host many different types of MODULbus daughterboards, including
>>> +	  CAN and GPIO controllers.
>>> +
>>>  config MFD_ASIC3
>>>  	bool "Support for Compaq ASIC3"
>>>  	depends on GENERIC_HARDIRQS && GPIOLIB && ARM
>>> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
>>> index e09eb48..e8fa905 100644
>>> --- a/drivers/mfd/Makefile
>>> +++ b/drivers/mfd/Makefile
>>> @@ -3,6 +3,7 @@
>>>  #
>>>  
>>>  obj-$(CONFIG_MFD_SM501)		+= sm501.o
>>> +obj-$(CONFIG_MFD_JANZ_CMODIO)	+= janz-cmodio.o
>>>  obj-$(CONFIG_MFD_ASIC3)		+= asic3.o tmio_core.o
>>>  obj-$(CONFIG_MFD_SH_MOBILE_SDHI)		+= sh_mobile_sdhi.o
>>>  
>>> diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
>>> new file mode 100644
>>> index 0000000..914280e
>>> --- /dev/null
>>> +++ b/drivers/mfd/janz-cmodio.c
>>> @@ -0,0 +1,339 @@
>>> +/*
>>> + * Janz CMOD-IO MODULbus Carrier Board PCI Driver
>>> + *
>>> + * Copyright (c) 2010 Ira W. Snyder <iws-lulEs6mt1IksTUYHLfqkUA@public.gmane.org>
>>> + *
>>> + * Lots of inspiration and code was copied from drivers/mfd/sm501.c
>>> + *
>>> + * 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.
>>> + */
>>> +
>>> +#include <linux/kernel.h>
>>> +#include <linux/module.h>
>>> +#include <linux/init.h>
>>> +#include <linux/pci.h>
>>> +#include <linux/interrupt.h>
>>> +#include <linux/delay.h>
>>> +#include <linux/platform_device.h>
>>> +
>>> +#include <linux/mfd/janz.h>
>>> +
>>> +#define DRV_NAME "janz-cmodio"
>>> +
>>> +/* Size of each MODULbus module in PCI BAR4 */
>>> +#define CMODIO_MODULBUS_SIZE	0x200
>>> +
>>> +/* Maximum number of MODULbus modules on a CMOD-IO carrier board */
>>> +#define CMODIO_MAX_MODULES	4
>>> +
>>> +/* Module Parameters */
>>> +static unsigned int num_modules = CMODIO_MAX_MODULES;
>>> +static unsigned char *modules[CMODIO_MAX_MODULES] = {
>>> +	"janz-ican3",
>>> +	"janz-ican3",
>>> +	"",
>>> +	"janz-ttl",
>>> +};
>> This is probably not a good default but just your private configuration.
>>
> 
> Yep, that's the configuration I have. Do you have any suggestions for a
> better default? I could make them all blank strings, which means "no
> daughtercard in this slot". That is my only idea for a different
> default.

That's probably better. And if no boards are defined via module
parameter, return with an error and print an error message telling the
user what to do. Also maybe s/""/"empty"/ and a better the
MODULE_DESCRIPTION could be useful.

Wolfgang.

^ permalink raw reply

* Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module
From: Ira W. Snyder @ 2010-03-19 15:19 UTC (permalink / raw)
  To: Wolfgang Grandegger
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, sameo-VuQAYsv1563Yd54FQh9/CA
In-Reply-To: <4BA33D5A.8070000-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

On Fri, Mar 19, 2010 at 10:01:14AM +0100, Wolfgang Grandegger wrote:
> Hi Ira,
> 
> we already discussed this patch on the SocketCAN mailing list and there
> are just a few minor issues and the request to add support for the new
> "berr-reporting" option, if feasible. See:
> 
>   commit 52c793f24054f5dc30d228e37e0e19cc8313f086
>   Author: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
>   Date:   Mon Feb 22 22:21:17 2010 +0000
> 
>     can: netlink support for bus-error reporting and counters
>     
>     This patch makes the bus-error reporting configurable and allows to
>     retrieve the CAN TX and RX bus error counters via netlink interface.
>     I have added support for the SJA1000. The TX and RX bus error counters
>     are also copied to the data fields 6..7 of error messages when state
>     changes are reported.
> 
> Should not be a big deal.
> 

I think this patch came along since my last post of the driver. I must
have missed it. I'll try and add support.

> More inline...
> 
> Ira W. Snyder wrote:
> > The Janz VMOD-ICAN3 is a MODULbus daughterboard which fits onto any
> > MODULbus carrier board. It is an intelligent CAN controller with a
> > microcontroller and associated firmware.
> > 
> > Signed-off-by: Ira W. Snyder <iws-lulEs6mt1IksTUYHLfqkUA@public.gmane.org>
> > Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
> > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > ---
> >  drivers/net/can/Kconfig      |   10 +
> >  drivers/net/can/Makefile     |    1 +
> >  drivers/net/can/janz-ican3.c | 1659 ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 1670 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/net/can/janz-ican3.c
> > 
> > diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
> > index 05b7517..2c5227c 100644
> > --- a/drivers/net/can/Kconfig
> > +++ b/drivers/net/can/Kconfig
> > @@ -63,6 +63,16 @@ config CAN_BFIN
> >  	  To compile this driver as a module, choose M here: the
> >  	  module will be called bfin_can.
> >  
> > +config CAN_JANZ_ICAN3
> > +	tristate "Janz VMOD-ICAN3 Intelligent CAN controller"
> > +	depends on CAN_DEV && MFD_JANZ_CMODIO
> > +	---help---
> > +	  Driver for Janz VMOD-ICAN3 Intelligent CAN controller module, which
> > +	  connects to a MODULbus carrier board.
> > +
> > +	  This driver can also be built as a module. If so, the module will be
> > +	  called janz-ican3.ko.
> > +
> >  source "drivers/net/can/mscan/Kconfig"
> >  
> >  source "drivers/net/can/sja1000/Kconfig"
> > diff --git a/drivers/net/can/Makefile b/drivers/net/can/Makefile
> > index 7a702f2..9047cd0 100644
> > --- a/drivers/net/can/Makefile
> > +++ b/drivers/net/can/Makefile
> > @@ -15,5 +15,6 @@ obj-$(CONFIG_CAN_AT91)		+= at91_can.o
> >  obj-$(CONFIG_CAN_TI_HECC)	+= ti_hecc.o
> >  obj-$(CONFIG_CAN_MCP251X)	+= mcp251x.o
> >  obj-$(CONFIG_CAN_BFIN)		+= bfin_can.o
> > +obj-$(CONFIG_CAN_JANZ_ICAN3)	+= janz-ican3.o
> >  
> >  ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
> > diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
> > new file mode 100644
> > index 0000000..94d4995
> > --- /dev/null
> > +++ b/drivers/net/can/janz-ican3.c
> [snip]
>  +struct ican3_dev {
> > +
> > +	/* must be the first member */
> > +	struct can_priv can;
> > +
> > +	/* CAN network device */
> > +	struct net_device *ndev;
> > +	struct napi_struct napi;
> > +
> > +	/* Device for printing */
> > +	struct device *dev;
> > +
> > +	/* module number */
> > +	unsigned int num;
> > +
> > +	/* base address of registers and IRQ */
> > +	struct janz_cmodio_onboard_regs __iomem *ctrl;
> > +	struct ican3_dpm_control *dpmctrl;
> > +	void __iomem *dpm;
> > +	int irq;
> > +
> > +	/* old and new style host interface */
> > +	unsigned int iftype;
> > +	spinlock_t lock;
> 
> Please describe what the lock is used for.
> 
> > +	/* new host interface */
> > +	unsigned int rx_int;
> > +	unsigned int rx_num;
> > +	unsigned int tx_num;
> > +
> > +	/* fast host interface */
> > +	unsigned int fastrx_start;
> > +	unsigned int fastrx_int;
> > +	unsigned int fastrx_num;
> > +	unsigned int fasttx_start;
> > +	unsigned int fasttx_num;
> > +
> > +	/* first free DPM page */
> > +	unsigned int free_page;
> > +};
> 
> [snip]
> > +static void ican3_to_can_frame(struct ican3_dev *mod,
> > +			       struct ican3_fast_desc *desc,
> > +			       struct can_frame *cf)
> > +{
> > +	if ((desc->command & ICAN3_CAN_TYPE_MASK) == ICAN3_CAN_TYPE_SFF) {
> > +		dev_dbg(mod->dev, "%s: old frame format\n", __func__);
> 
> This prints a debug message for every message which is not really
> useful for the user. Please remove.
> 
> > +		if (desc->data[1] & ICAN3_SFF_RTR)
> > +			cf->can_id |= CAN_RTR_FLAG;
> > +
> > +		cf->can_id |= desc->data[0] << 3;
> > +		cf->can_id |= (desc->data[1] & 0xe0) >> 5;
> > +		cf->can_dlc = desc->data[1] & ICAN3_CAN_DLC_MASK;
> > +		memcpy(cf->data, &desc->data[2], sizeof(cf->data));
> > +	} else {
> > +		dev_dbg(mod->dev, "%s: new frame format\n", __func__);
> 
> Ditto.
> 
> > +		cf->can_dlc = desc->data[0] & ICAN3_CAN_DLC_MASK;
> > +		if (desc->data[0] & ICAN3_EFF_RTR)
> > +			cf->can_id |= CAN_RTR_FLAG;
> > +
> > +		if (desc->data[0] & ICAN3_EFF) {
> > +			cf->can_id |= CAN_EFF_FLAG;
> > +			cf->can_id |= desc->data[2] << 21; /* 28-21 */
> > +			cf->can_id |= desc->data[3] << 13; /* 20-13 */
> > +			cf->can_id |= desc->data[4] << 5;  /* 12-5  */
> > +			cf->can_id |= (desc->data[5] & 0xf8) >> 3;
> > +		} else {
> > +			cf->can_id |= desc->data[2] << 3;  /* 10-3  */
> > +			cf->can_id |= desc->data[3] >> 5;  /* 2-0   */
> > +		}
> > +
> > +		memcpy(cf->data, &desc->data[6], sizeof(cf->data));
> > +	}
> > +}
> > +
> > +static void can_frame_to_ican3(struct ican3_dev *mod,
> > +			       struct can_frame *cf,
> > +			       struct ican3_fast_desc *desc)
> > +{
> > +	/* clear out any stale data in the descriptor */
> > +	memset(desc->data, 0, sizeof(desc->data));
> > +
> > +	/* we always use the extended format, with the ECHO flag set */
> > +	desc->command = ICAN3_CAN_TYPE_EFF;
> > +	desc->data[0] |= cf->can_dlc;
> > +	desc->data[1] |= ICAN3_ECHO;
> > +
> > +	if (cf->can_id & CAN_RTR_FLAG)
> > +		desc->data[0] |= ICAN3_EFF_RTR;
> > +
> > +	/* pack the id into the correct places */
> > +	if (cf->can_id & CAN_EFF_FLAG) {
> > +		dev_dbg(mod->dev, "%s: extended frame\n", __func__);
> 
> Ditto.
> 
> > +		desc->data[0] |= ICAN3_EFF;
> > +		desc->data[2] = (cf->can_id & 0x1fe00000) >> 21; /* 28-21 */
> > +		desc->data[3] = (cf->can_id & 0x001fe000) >> 13; /* 20-13 */
> > +		desc->data[4] = (cf->can_id & 0x00001fe0) >> 5;  /* 12-5  */
> > +		desc->data[5] = (cf->can_id & 0x0000001f) << 3;  /* 4-0   */
> > +	} else {
> > +		dev_dbg(mod->dev, "%s: standard frame\n", __func__);
> 
> Ditto.
> 
> > +		desc->data[2] = (cf->can_id & 0x7F8) >> 3; /* bits 10-3 */
> > +		desc->data[3] = (cf->can_id & 0x007) << 5; /* bits 2-0  */
> > +	}
> > +
> > +	/* copy the data bits into the descriptor */
> > +	memcpy(&desc->data[6], cf->data, sizeof(cf->data));
> > +}
> 
> [snip]
> > +/*
> > + * Handle CAN Event Indication Messages from the firmware
> > + *
> > + * The ICAN3 firmware provides the values of some SJA1000 registers when it
> > + * generates this message. The code below is largely copied from the
> > + * drivers/net/can/sja1000/sja1000.c file, and adapted as necessary
> > + */
> > +static int ican3_handle_cevtind(struct ican3_dev *mod, struct ican3_msg *msg)
> > +{
> > +	struct net_device *dev = mod->ndev;
> > +	struct net_device_stats *stats = &dev->stats;
> > +	enum can_state state = mod->can.state;
> > +	struct can_frame *cf;
> > +	struct sk_buff *skb;
> > +	u8 status, isrc;
> > +
> > +	/* we can only handle the SJA1000 part */
> > +	if (msg->data[1] != CEVTIND_CHIP_SJA1000) {
> > +		dev_err(mod->dev, "unable to handle errors on non-SJA1000\n");
> > +		return -ENODEV;
> > +	}
> > +
> > +	/* check the message length for sanity */
> > +	if (msg->len < 6) {
> > +		dev_err(mod->dev, "error message too short\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	skb = alloc_can_err_skb(dev, &cf);
> > +	if (skb == NULL)
> > +		return -ENOMEM;
> > +
> > +	isrc = msg->data[0];
> > +	status = msg->data[3];
> > +
> > +	/* data overrun interrupt */
> > +	if (isrc == CEVTIND_DOI || isrc == CEVTIND_LOST) {
> 
> Here and for the other errors below a dev_dbg() would be useful. Please
> check sja1000.c.
> 
> > +		cf->can_id |= CAN_ERR_CRTL;
> > +		cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
> > +		stats->rx_over_errors++;
> > +		stats->rx_errors++;
> > +		dev_info(mod->dev, "%s: overflow frame generated\n", __func__);
> 
> s/dev_info/dev_dbg/ ?
> 

Whoops, a leftover from debugging. Will change to dev_dbg().

> > +	}
> > +
> > +	/* error warning interrupt */
> > +	if (isrc == CEVTIND_EI) {
> > +		if (status & SR_BS) {
> > +			state = CAN_STATE_BUS_OFF;
> > +			cf->can_id |= CAN_ERR_BUSOFF;
> > +			can_bus_off(dev);
> > +		} else if (status & SR_ES) {
> > +			state = CAN_STATE_ERROR_WARNING;
> > +		} else {
> > +			state = CAN_STATE_ERROR_ACTIVE;
> > +		}
> > +	}
> > +
> > +	/* bus error interrupt */
> > +	if (isrc == CEVTIND_BEI) {
> > +		u8 ecc = msg->data[2];
> 
> Add an empty line, please.
> 
> > +		mod->can.can_stats.bus_error++;
> > +		stats->rx_errors++;
> > +		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
> > +
> > +		switch (ecc & ECC_MASK) {
> > +		case ECC_BIT:
> > +			cf->data[2] |= CAN_ERR_PROT_BIT;
> > +			break;
> > +		case ECC_FORM:
> > +			cf->data[2] |= CAN_ERR_PROT_FORM;
> > +			break;
> > +		case ECC_STUFF:
> > +			cf->data[2] |= CAN_ERR_PROT_STUFF;
> > +			break;
> > +		default:
> > +			cf->data[2] |= CAN_ERR_PROT_UNSPEC;
> > +			cf->data[3] = ecc & ECC_SEG;
> > +			break;
> > +		}
> > +
> > +		if ((ecc & ECC_DIR) == 0)
> > +			cf->data[2] |= CAN_ERR_PROT_TX;
> > +	}
> > +
> > +	if (state != mod->can.state && (state == CAN_STATE_ERROR_WARNING ||
> > +					state == CAN_STATE_ERROR_PASSIVE)) {
> > +		u8 rxerr = msg->data[4];
> > +		u8 txerr = msg->data[5];
> 
> Ditto.
> 
> > +		cf->can_id |= CAN_ERR_CRTL;
> > +		if (state == CAN_STATE_ERROR_WARNING) {
> > +			mod->can.can_stats.error_warning++;
> > +			cf->data[1] = (txerr > rxerr) ?
> > +				CAN_ERR_CRTL_TX_WARNING :
> > +				CAN_ERR_CRTL_RX_WARNING;
> > +		} else {
> > +			mod->can.can_stats.error_passive++;
> > +			cf->data[1] = (txerr > rxerr) ?
> > +				CAN_ERR_CRTL_TX_PASSIVE :
> > +				CAN_ERR_CRTL_RX_PASSIVE;
> > +		}
> > +	}
> > +
> > +	mod->can.state = state;
> > +	stats->rx_errors++;
> > +	stats->rx_bytes += cf->can_dlc;
> > +	netif_rx(skb);
> > +	return 0;
> > +}
> 
> [snip]
> > +static irqreturn_t ican3_irq(int irq, void *dev_id)
> > +{
> > +	struct ican3_dev *mod = dev_id;
> > +	u8 stat;
> > +
> > +	/*
> > +	 * The interrupt status register on this device reports interrupts
> > +	 * as zeroes instead of using ones like most other devices
> > +	 */
> > +	stat = ioread8(&mod->ctrl->int_disable) & (1 << mod->num);
> > +	if (stat == (1 << mod->num))
> > +		return IRQ_NONE;
> > +
> > +	dev_dbg(mod->dev, "IRQ: module %d\n", mod->num);
> 
> Please remove this dev_dbg() as well.
> 
> [snip]
> > +/*
> > + * Startup an ICAN module, bringing it into fast mode
> > + */
> > +static int __devinit ican3_startup_module(struct ican3_dev *mod)
> > +{
> > +	int ret;
> > +
> > +	ret = ican3_reset_module(mod);
> > +	if (ret) {
> > +		dev_err(mod->dev, "unable to reset module\n");
> > +		return ret;
> > +	}
> > +
> > +	/* re-enable interrupts so we can send messages */
> > +	iowrite8(1 << mod->num, &mod->ctrl->int_enable);
> > +
> > +	ret = ican3_msg_connect(mod);
> > +	if (ret) {
> > +		dev_err(mod->dev, "unable to connect to module\n");
> > +		return ret;
> > +	}
> > +
> > +	ican3_init_new_host_interface(mod);
> > +	ret = ican3_msg_newhostif(mod);
> > +	if (ret) {
> > +		dev_err(mod->dev, "unable to switch to new-style interface\n");
> > +		return ret;
> > +	}
> > +
> > +	ret = ican3_set_termination(mod, true);
> > +	if (ret) {
> > +		dev_err(mod->dev, "unable to enable termination\n");
> > +		return ret;
> > +	}
> 
> 
> Could you please allow the user to disable termination, e.g. via module parameter
> "bus_termination=0" in case he uses a cable with built-in termination.
> 

What would you think about a sysfs node instead, so it could be changed
at runtime, on a per-daughtercard basis? Do you think enabling bus
termination is a good default? IMO, it is a pretty safe default for most
users.

> [snip]
> > +static int __devinit ican3_probe(struct platform_device *pdev)
> > +{
> > +	struct janz_platform_data *pdata;
> > +	struct net_device *ndev;
> > +	struct ican3_dev *mod;
> > +	struct resource *res;
> > +	struct device *dev;
> > +	int ret;
> > +
> > +	pdata = pdev->dev.platform_data;
> > +	if (!pdata)
> > +		return -ENXIO;
> > +
> > +	dev_dbg(&pdev->dev, "probe: module number %d\n", pdata->modno);
> > +
> > +	/* save the struct device for printing */
> > +	dev = &pdev->dev;
> > +
> > +	/* allocate the CAN device and private data */
> > +	ndev = alloc_candev(sizeof(*mod), 0);
> > +	if (!ndev) {
> > +		dev_err(dev, "unable to allocate CANdev\n");
> > +		ret = -ENOMEM;
> > +		goto out_return;
> > +	}
> > +
> > +	platform_set_drvdata(pdev, ndev);
> > +	mod = netdev_priv(ndev);
> > +	mod->ndev = ndev;
> > +	mod->dev = &pdev->dev;
> > +	mod->num = pdata->modno;
> > +	netif_napi_add(ndev, &mod->napi, ican3_napi, ICAN3_RX_BUFFERS);
> > +	spin_lock_init(&mod->lock);
> > +
> > +	/* the first unallocated page in the DPM is 9 */
> > +	mod->free_page = DPM_FREE_START;
> > +
> > +	ndev->netdev_ops = &ican3_netdev_ops;
> > +	ndev->flags |= IFF_ECHO;
> > +	SET_NETDEV_DEV(ndev, &pdev->dev);
> > +
> > +	mod->can.clock.freq = 8000000;
> 
> Please use a constant here.
> [snip]
> 
> Please fix and resubmit with my:
> 
> "Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>"
> 
> for the SocketCAN part.
> 

Thanks for the review!
Ira

^ permalink raw reply

* Re: [PATCH 1/3] mfd: add support for Janz CMOD-IO PCI MODULbus Carrier Board
From: Ira W. Snyder @ 2010-03-19 15:13 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linux-kernel, socketcan-core, netdev, sameo
In-Reply-To: <4BA34026.8010806@grandegger.com>

On Fri, Mar 19, 2010 at 10:13:10AM +0100, Wolfgang Grandegger wrote:
> Ira W. Snyder wrote:
> > The Janz CMOD-IO PCI MODULbus carrier board is a PCI to MODULbus bridge,
> > which may host many different types of MODULbus daughterboards, including
> > CAN and GPIO controllers.
> > 
> > Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
> > Cc: Samuel Ortiz <sameo@linux.intel.com>
> 
> You can add my "Reviewed-by: Wolfgang Grandegger <wg@grandegger.com>".
> 
> Just one concern:
> 
> > ---
> >  drivers/mfd/Kconfig       |    8 +
> >  drivers/mfd/Makefile      |    1 +
> >  drivers/mfd/janz-cmodio.c |  339 +++++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/mfd/janz.h  |   54 +++++++
> >  4 files changed, 402 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/mfd/janz-cmodio.c
> >  create mode 100644 include/linux/mfd/janz.h
> > 
> > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > index 8782978..f1858d7 100644
> > --- a/drivers/mfd/Kconfig
> > +++ b/drivers/mfd/Kconfig
> > @@ -27,6 +27,14 @@ config MFD_SM501_GPIO
> >  	 lines on the SM501. The platform data is used to supply the
> >  	 base number for the first GPIO line to register.
> >  
> > +config MFD_JANZ_CMODIO
> > +	tristate "Support for Janz CMOD-IO PCI MODULbus Carrier Board"
> > +	---help---
> > +	  This is the core driver for the Janz CMOD-IO PCI MODULbus
> > +	  carrier board. This device is a PCI to MODULbus bridge which may
> > +	  host many different types of MODULbus daughterboards, including
> > +	  CAN and GPIO controllers.
> > +
> >  config MFD_ASIC3
> >  	bool "Support for Compaq ASIC3"
> >  	depends on GENERIC_HARDIRQS && GPIOLIB && ARM
> > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> > index e09eb48..e8fa905 100644
> > --- a/drivers/mfd/Makefile
> > +++ b/drivers/mfd/Makefile
> > @@ -3,6 +3,7 @@
> >  #
> >  
> >  obj-$(CONFIG_MFD_SM501)		+= sm501.o
> > +obj-$(CONFIG_MFD_JANZ_CMODIO)	+= janz-cmodio.o
> >  obj-$(CONFIG_MFD_ASIC3)		+= asic3.o tmio_core.o
> >  obj-$(CONFIG_MFD_SH_MOBILE_SDHI)		+= sh_mobile_sdhi.o
> >  
> > diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
> > new file mode 100644
> > index 0000000..914280e
> > --- /dev/null
> > +++ b/drivers/mfd/janz-cmodio.c
> > @@ -0,0 +1,339 @@
> > +/*
> > + * Janz CMOD-IO MODULbus Carrier Board PCI Driver
> > + *
> > + * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu>
> > + *
> > + * Lots of inspiration and code was copied from drivers/mfd/sm501.c
> > + *
> > + * 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.
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/init.h>
> > +#include <linux/pci.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/delay.h>
> > +#include <linux/platform_device.h>
> > +
> > +#include <linux/mfd/janz.h>
> > +
> > +#define DRV_NAME "janz-cmodio"
> > +
> > +/* Size of each MODULbus module in PCI BAR4 */
> > +#define CMODIO_MODULBUS_SIZE	0x200
> > +
> > +/* Maximum number of MODULbus modules on a CMOD-IO carrier board */
> > +#define CMODIO_MAX_MODULES	4
> > +
> > +/* Module Parameters */
> > +static unsigned int num_modules = CMODIO_MAX_MODULES;
> > +static unsigned char *modules[CMODIO_MAX_MODULES] = {
> > +	"janz-ican3",
> > +	"janz-ican3",
> > +	"",
> > +	"janz-ttl",
> > +};
> 
> This is probably not a good default but just your private configuration.
> 

Yep, that's the configuration I have. Do you have any suggestions for a
better default? I could make them all blank strings, which means "no
daughtercard in this slot". That is my only idea for a different
default.

Thanks for the review!
Ira

^ permalink raw reply

* [PATCH v2] if_tunnel.h: add missing ams/byteorder.h include
From: Paulius Zaleckas @ 2010-03-19 15:09 UTC (permalink / raw)
  To: davem; +Cc: contact, eric.dumazet, Fred.L.Templin, netdev, linux-kernel

When compiling userspace application which includes
if_tunnel.h and uses GRE_* defines you will get undefined
reference to __cpu_to_be16.

Fix this by adding missing #include <asm/byteorder.h>

Cc: stable@kernel.org
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
---

 include/linux/if_tunnel.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 1822d63..16b92d0 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -2,6 +2,7 @@
 #define _IF_TUNNEL_H_
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #ifdef __KERNEL__
 #include <linux/ip.h>

^ permalink raw reply related

* [PATCH] if_tunnel.h: add missing ams/byteorder.h include
From: Paulius Zaleckas @ 2010-03-19 15:04 UTC (permalink / raw)
  To: davem; +Cc: contact, eric.dumazet, Fred.L.Templin, netdev, linux-kernel

From: None <None>

When compiling userspace application which includes
if_tunnel.h and uses GRE_* defines you will get undefined
reference to __cpu_to_be16.

Fix this by adding missing #include <asm/byteorder.h>

Cc: stable@kernel.org
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
---

 include/linux/if_tunnel.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 1822d63..16b92d0 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -2,6 +2,7 @@
 #define _IF_TUNNEL_H_
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #ifdef __KERNEL__
 #include <linux/ip.h>

^ permalink raw reply related

* Re: [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
From: Patrick McHardy @ 2010-03-19 14:56 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: David Miller, Linux Netdev List
In-Reply-To: <20100319144707.GD2811@psychotron.redhat.com>

Jiri Pirko wrote:
> Fri, Mar 19, 2010 at 03:42:24PM CET, kaber@trash.net wrote:
>   
>
>   
>> Ignore the new NETDEV_PRE_TYPE_CHANGE event in rtnetlink_event() since
>> there have been no changes userspace needs to be notified of.
>>
>> Also add a comment to the netdev notifier event definitions to remind
>> people to update the exclusion list when adding new event types.
>
> Hmm, didn't have a clue this is needed. Anyway, original
> "NETDEV_BONDING_OLDTYPE" and "NETDEV_BONDING_NEWTYPE" weren't here either.

Its not strictly needed, it just avoids sending events without new
information.


> Also you might want to add "NETDEV_POST_TYPE_CHANGE".

I left this out on purpose since userspace might be interested in the
type change.

^ permalink raw reply

* Re: [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
From: Jiri Pirko @ 2010-03-19 14:47 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David Miller, Linux Netdev List
In-Reply-To: <4BA38D50.4090909@trash.net>

Fri, Mar 19, 2010 at 03:42:24PM CET, kaber@trash.net wrote:
>

>Ignore the new NETDEV_PRE_TYPE_CHANGE event in rtnetlink_event() since
>there have been no changes userspace needs to be notified of.
>
>Also add a comment to the netdev notifier event definitions to remind
>people to update the exclusion list when adding new event types.

Hmm, didn't have a clue this is needed. Anyway, original
"NETDEV_BONDING_OLDTYPE" and "NETDEV_BONDING_NEWTYPE" weren't here either.
Also you might want to add "NETDEV_POST_TYPE_CHANGE".

Jirka

>
>Signed-off-by: Patrick McHardy <kaber@trash.net>
>---
> include/linux/notifier.h |    5 ++++-
> net/core/rtnetlink.c     |    1 +
> 2 files changed, 5 insertions(+), 1 deletions(-)
>
>diff --git a/include/linux/notifier.h b/include/linux/notifier.h
>index f3635fc..9c5d3fa 100644
>--- a/include/linux/notifier.h
>+++ b/include/linux/notifier.h
>@@ -182,7 +182,10 @@ static inline int notifier_to_errno(int ret)
>  *	VC switch chains (for loadable kernel svgalib VC switch helpers) etc...
>  */
>  
>-/* netdevice notifier chain */
>+/* netdevice notifier chain. Please remember to update the rtnetlink
>+ * notification exclusion list in rtnetlink_event() when adding new
>+ * types.
>+ */
> #define NETDEV_UP	0x0001	/* For now you can't veto a device up/down */
> #define NETDEV_DOWN	0x0002
> #define NETDEV_REBOOT	0x0003	/* Tell a protocol stack a network interface
>diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
>index e1121f0..ffc6cf3 100644
>--- a/net/core/rtnetlink.c
>+++ b/net/core/rtnetlink.c
>@@ -1513,6 +1513,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi
> 	case NETDEV_POST_INIT:
> 	case NETDEV_REGISTER:
> 	case NETDEV_CHANGE:
>+	case NETDEV_PRE_TYPE_CHANGE:
> 	case NETDEV_GOING_DOWN:
> 	case NETDEV_UNREGISTER:
> 	case NETDEV_UNREGISTER_BATCH:
>-- 
>1.6.5.7
>


^ permalink raw reply

* Re: [Bugme-new] [Bug 15507] New: kernel misses 3rd part of tcp handshake (ACK), stays in SYN_RECV state
From: Eric Dumazet @ 2010-03-19 14:46 UTC (permalink / raw)
  To: Joshua Roys; +Cc: Andrew Morton, netdev, bugzilla-daemon, bugme-daemon
In-Reply-To: <4BA365BA.4040309@gmail.com>

Le vendredi 19 mars 2010 à 07:53 -0400, Joshua Roys a écrit :

> 
> Gah!  You've got to be kidding :)  If that's what it is, close the 
> bug...  and I'll go read some man-pages!

So I checked FC12 httpd and yes, it does use DEFER_ACCEPT (setting val
to 1 second).


So you hit a problem that was corrected by following commit.

Time to bug RedHat I suppose...



commit d1b99ba41d6c5aa1ed2fc634323449dd656899e9
Author: Julian Anastasov <ja@ssi.bg>
Date:   Mon Oct 19 10:01:56 2009 +0000

    tcp: accept socket after TCP_DEFER_ACCEPT period
    
    Willy Tarreau and many other folks in recent years
    were concerned what happens when the TCP_DEFER_ACCEPT period
    expires for clients which sent ACK packet. They prefer clients
    that actively resend ACK on our SYN-ACK retransmissions to be
    converted from open requests to sockets and queued to the
    listener for accepting after the deferring period is finished.
    Then application server can decide to wait longer for data
    or to properly terminate the connection with FIN if read()
    returns EAGAIN which is an indication for accepting after
    the deferring period. This change still can have side effects
    for applications that expect always to see data on the accepted
    socket. Others can be prepared to work in both modes (with or
    without TCP_DEFER_ACCEPT period) and their data processing can
    ignore the read=EAGAIN notification and to allocate resources for
    clients which proved to have no data to send during the deferring
    period. OTOH, servers that use TCP_DEFER_ACCEPT=1 as flag (not
    as a timeout) to wait for data will notice clients that didn't
    send data for 3 seconds but that still resend ACKs.
    Thanks to Willy Tarreau for the initial idea and to
    Eric Dumazet for the review and testing the change.
    
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 624c3c9..4c03598 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -641,8 +641,8 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
        if (!(flg & TCP_FLAG_ACK))
                return NULL;
 
-       /* If TCP_DEFER_ACCEPT is set, drop bare ACK. */
-       if (inet_csk(sk)->icsk_accept_queue.rskq_defer_accept &&
+       /* While TCP_DEFER_ACCEPT is active, drop bare ACK. */
+       if (req->retrans < inet_csk(sk)->icsk_accept_queue.rskq_defer_accept &&
            TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) {
                inet_rsk(req)->acked = 1;
                return NULL;




^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox