aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-06-18 03:36:46 -0400
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-06-18 03:36:46 -0400
commit0107b3cf3225aed6ddde4fa8dbcd4ed643b34f4d (patch)
tree9b9337ae627fc56a0eda43c60860765f25efaa0b
parent1c3f45ab2f7f879ea482501c83899505c31f7539 (diff)
parent9ee1c939d1cb936b1f98e8d81aeffab57bae46ab (diff)
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
-rw-r--r--CREDITS6
-rw-r--r--Documentation/DocBook/libata.tmpl156
-rw-r--r--Documentation/SubmittingPatches8
-rw-r--r--Documentation/networking/vortex.txt2
-rw-r--r--MAINTAINERS48
-rw-r--r--Makefile2
-rw-r--r--arch/arm/Kconfig6
-rw-r--r--arch/arm/boot/compressed/head-xscale.S7
-rw-r--r--arch/arm/configs/badge4_defconfig29
-rw-r--r--arch/arm/configs/h3600_defconfig24
-rw-r--r--arch/arm/configs/hackkit_defconfig22
-rw-r--r--arch/arm/kernel/entry-armv.S16
-rw-r--r--arch/arm/kernel/traps.c49
-rw-r--r--arch/arm/lib/io-writesw-armv4.S6
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c1
-rw-r--r--arch/arm/mach-pxa/lubbock.c30
-rw-r--r--arch/arm/mach-pxa/mainstone.c40
-rw-r--r--arch/arm/mach-pxa/pm.c32
-rw-r--r--arch/arm/mach-pxa/pxa25x.c33
-rw-r--r--arch/arm/mach-pxa/pxa27x.c36
-rw-r--r--arch/arm/mach-s3c2410/dma.c4
-rw-r--r--arch/arm/mach-sa1100/Kconfig2
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mm/Kconfig15
-rw-r--r--arch/arm/mm/Makefile2
-rw-r--r--arch/arm/mm/copypage-xscale.S113
-rw-r--r--arch/arm/mm/copypage-xscale.c131
-rw-r--r--arch/arm/mm/minicache.c73
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/apm.c2
-rw-r--r--arch/ia64/kernel/fsys.S4
-rw-r--r--arch/ia64/kernel/module.c10
-rw-r--r--arch/ia64/kernel/ptrace.c6
-rw-r--r--arch/ia64/kernel/setup.c3
-rw-r--r--arch/ia64/kernel/traps.c29
-rw-r--r--arch/ia64/mm/init.c19
-rw-r--r--arch/ia64/sn/kernel/setup.c4
-rw-r--r--arch/m68k/configs/amiga_defconfig15
-rw-r--r--arch/m68k/configs/apollo_defconfig7
-rw-r--r--arch/m68k/configs/atari_defconfig7
-rw-r--r--arch/m68k/configs/bvme6000_defconfig7
-rw-r--r--arch/m68k/configs/hp300_defconfig7
-rw-r--r--arch/m68k/configs/mac_defconfig7
-rw-r--r--arch/m68k/configs/mvme147_defconfig7
-rw-r--r--arch/m68k/configs/mvme16x_defconfig7
-rw-r--r--arch/m68k/configs/q40_defconfig15
-rw-r--r--arch/m68k/configs/sun3_defconfig8
-rw-r--r--arch/m68k/configs/sun3x_defconfig7
-rw-r--r--arch/m68k/defconfig7
-rw-r--r--arch/m68knommu/kernel/process.c17
-rw-r--r--arch/ppc/kernel/cputable.c11
-rw-r--r--arch/ppc/kernel/misc.S6
-rw-r--r--arch/ppc/platforms/pmac_cpufreq.c7
-rw-r--r--arch/ppc64/boot/prom.c28
-rw-r--r--arch/ppc64/configs/g5_defconfig76
-rw-r--r--arch/ppc64/configs/iSeries_defconfig62
-rw-r--r--arch/ppc64/configs/maple_defconfig70
-rw-r--r--arch/ppc64/configs/pSeries_defconfig102
-rw-r--r--arch/ppc64/defconfig104
-rw-r--r--arch/ppc64/kernel/entry.S9
-rw-r--r--arch/ppc64/kernel/head.S10
-rw-r--r--arch/ppc64/kernel/iSeries_setup.c22
-rw-r--r--arch/ppc64/kernel/idle.c8
-rw-r--r--arch/ppc64/kernel/kprobes.c18
-rw-r--r--arch/ppc64/kernel/misc.S2
-rw-r--r--arch/ppc64/kernel/process.c3
-rw-r--r--arch/ppc64/kernel/prom_init.c102
-rw-r--r--arch/ppc64/kernel/setup.c56
-rw-r--r--arch/ppc64/kernel/smp.c3
-rw-r--r--arch/ppc64/kernel/sys_ppc32.c70
-rw-r--r--arch/ppc64/kernel/syscalls.c33
-rw-r--r--arch/ppc64/kernel/sysfs.c8
-rw-r--r--arch/s390/appldata/appldata_base.c72
-rw-r--r--arch/s390/appldata/appldata_mem.c2
-rw-r--r--arch/s390/appldata/appldata_net_sum.c2
-rw-r--r--arch/s390/appldata/appldata_os.c4
-rw-r--r--arch/s390/kernel/ptrace.c55
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/um/Kconfig_char6
-rw-r--r--arch/um/drivers/Makefile6
-rw-r--r--arch/um/drivers/chan_user.c26
-rw-r--r--arch/um/drivers/mmapper_kern.c24
-rw-r--r--arch/um/drivers/net_user.c2
-rw-r--r--arch/um/drivers/slip.h23
-rw-r--r--arch/um/drivers/slip_common.c54
-rw-r--r--arch/um/drivers/slip_common.h (renamed from arch/um/drivers/slip_proto.h)47
-rw-r--r--arch/um/drivers/slip_kern.c12
-rw-r--r--arch/um/drivers/slip_user.c152
-rw-r--r--arch/um/drivers/slirp.h26
-rw-r--r--arch/um/drivers/slirp_kern.c5
-rw-r--r--arch/um/drivers/slirp_user.c104
-rw-r--r--arch/um/drivers/stderr_console.c6
-rw-r--r--arch/um/include/mconsole.h2
-rw-r--r--arch/um/include/net_user.h2
-rw-r--r--arch/um/include/os.h2
-rw-r--r--arch/um/include/sysdep-i386/ptrace.h5
-rw-r--r--arch/um/include/user_util.h3
-rw-r--r--arch/um/kernel/main.c2
-rw-r--r--arch/um/kernel/process.c49
-rw-r--r--arch/um/kernel/skas/process_kern.c7
-rw-r--r--arch/um/kernel/um_arch.c1
-rw-r--r--arch/um/os-Linux/elf_aux.c6
-rw-r--r--arch/um/os-Linux/file.c2
-rw-r--r--arch/um/scripts/Makefile.rules2
-rw-r--r--arch/x86_64/kernel/aperture.c41
-rw-r--r--drivers/atm/Makefile3
-rw-r--r--drivers/atm/fore200e.c6
-rw-r--r--drivers/atm/he.c6
-rw-r--r--drivers/atm/nicstar.c20
-rw-r--r--drivers/atm/zatm.c11
-rw-r--r--drivers/block/cfq-iosched.c9
-rw-r--r--drivers/block/elevator.c9
-rw-r--r--drivers/block/ub.c598
-rw-r--r--drivers/char/agp/agp.h2
-rw-r--r--drivers/char/agp/ali-agp.c4
-rw-r--r--drivers/char/agp/amd-k7-agp.c6
-rw-r--r--drivers/char/agp/amd64-agp.c4
-rw-r--r--drivers/char/agp/ati-agp.c6
-rw-r--r--drivers/char/agp/backend.c6
-rw-r--r--drivers/char/agp/efficeon-agp.c2
-rw-r--r--drivers/char/agp/generic.c36
-rw-r--r--drivers/char/agp/hp-agp.c4
-rw-r--r--drivers/char/agp/i460-agp.c4
-rw-r--r--drivers/char/agp/intel-agp.c21
-rw-r--r--drivers/char/agp/sgi-agp.c12
-rw-r--r--drivers/char/agp/sworks-agp.c8
-rw-r--r--drivers/char/agp/uninorth-agp.c2
-rw-r--r--drivers/char/drm/drm_pciids.h1
-rw-r--r--drivers/char/drm/radeon_irq.c5
-rw-r--r--drivers/char/mxser.c38
-rw-r--r--drivers/ieee1394/sbp2.c3
-rw-r--r--drivers/input/keyboard/atkbd.c2
-rw-r--r--drivers/input/mouse/alps.c2
-rw-r--r--drivers/macintosh/via-pmu.c6
-rw-r--r--drivers/md/dm-mpath.c3
-rw-r--r--drivers/message/i2o/i2o_block.c1
-rw-r--r--drivers/net/hamradio/baycom_epp.c126
-rw-r--r--drivers/net/irda/Kconfig2
-rw-r--r--drivers/net/iseries_veth.c9
-rw-r--r--drivers/net/pcmcia/3c574_cs.c3
-rw-r--r--drivers/net/r8169.c33
-rw-r--r--drivers/net/shaper.c86
-rw-r--r--drivers/net/tg3.c39
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c2
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_pci.c5
-rw-r--r--drivers/pci/pci-driver.c5
-rw-r--r--drivers/pci/pci.ids1
-rw-r--r--drivers/pci/probe.c2
-rw-r--r--drivers/pci/quirks.c41
-rw-r--r--drivers/scsi/Kconfig2
-rw-r--r--drivers/scsi/ata_piix.c16
-rw-r--r--drivers/scsi/libata-core.c474
-rw-r--r--drivers/scsi/libata-scsi.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c24
-rw-r--r--drivers/scsi/sata_sil.c8
-rw-r--r--drivers/scsi/scsi_scan.c1
-rw-r--r--drivers/serial/sa1100.c2
-rw-r--r--drivers/serial/vr41xx_siu.c66
-rw-r--r--drivers/usb/core/sysfs.c22
-rw-r--r--drivers/usb/host/ehci-hub.c5
-rw-r--r--drivers/usb/input/hid-core.c18
-rw-r--r--drivers/usb/media/pwc/ChangeLog143
-rw-r--r--drivers/usb/media/pwc/pwc-if.c4
-rw-r--r--drivers/usb/net/kaweth.c2
-rw-r--r--drivers/usb/net/usbnet.c2
-rw-r--r--drivers/usb/serial/Kconfig11
-rw-r--r--drivers/usb/serial/Makefile1
-rw-r--r--drivers/usb/serial/cp2101.c363
-rw-r--r--drivers/usb/serial/ftdi_sio.c118
-rw-r--r--drivers/usb/serial/option.c729
-rw-r--r--drivers/usb/storage/unusual_devs.h9
-rw-r--r--drivers/video/aty/radeon_base.c7
-rw-r--r--drivers/video/fbsysfs.c2
-rw-r--r--drivers/video/macmodes.c1
-rw-r--r--fs/binfmt_elf.c2
-rw-r--r--fs/binfmt_flat.c6
-rw-r--r--fs/cifs/CHANGES3
-rw-r--r--fs/cifs/cifsfs.h2
-rw-r--r--fs/cifs/file.c2
-rw-r--r--fs/cifs/inode.c34
-rw-r--r--fs/jbd/checkpoint.c5
-rw-r--r--fs/mpage.c5
-rw-r--r--fs/namei.c153
-rw-r--r--fs/nfs/dir.c49
-rw-r--r--fs/nfs/file.c42
-rw-r--r--include/asm-alpha/agp.h10
-rw-r--r--include/asm-arm/arch-integrator/platform.h4
-rw-r--r--include/asm-arm/arch-ixp2000/io.h16
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h2
-rw-r--r--include/asm-arm/arch-versatile/platform.h16
-rw-r--r--include/asm-arm/elf.h4
-rw-r--r--include/asm-arm26/elf.h2
-rw-r--r--include/asm-arm26/signal.h3
-rw-r--r--include/asm-h8300/kmap_types.h6
-rw-r--r--include/asm-h8300/mman.h3
-rw-r--r--include/asm-i386/agp.h10
-rw-r--r--include/asm-i386/mach-numaq/mach_ipi.h2
-rw-r--r--include/asm-ia64/agp.h10
-rw-r--r--include/asm-ia64/pgtable.h8
-rw-r--r--include/asm-ia64/processor.h10
-rw-r--r--include/asm-ppc/agp.h10
-rw-r--r--include/asm-ppc/sigcontext.h2
-rw-r--r--include/asm-ppc64/agp.h10
-rw-r--r--include/asm-ppc64/elf.h4
-rw-r--r--include/asm-ppc64/processor.h186
-rw-r--r--include/asm-ppc64/thread_info.h4
-rw-r--r--include/asm-s390/user.h2
-rw-r--r--include/asm-sparc/uaccess.h5
-rw-r--r--include/asm-sparc64/agp.h10
-rw-r--r--include/asm-x86_64/agp.h10
-rw-r--r--include/linux/acpi.h2
-rw-r--r--include/linux/if_shaper.h3
-rw-r--r--include/linux/if_tr.h2
-rw-r--r--include/linux/libata.h58
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h30
-rw-r--r--include/linux/usb.h6
-rw-r--r--include/net/ip.h1
-rw-r--r--kernel/exit.c4
-rw-r--r--kernel/posix-timers.c1
-rw-r--r--kernel/sched.c7
-rw-r--r--mm/filemap.c8
-rw-r--r--net/core/dev.c1
-rw-r--r--net/core/ethtool.c2
-rw-r--r--net/core/net-sysfs.c17
-rw-r--r--net/ipv4/af_inet.c1
-rw-r--r--net/ipv4/icmp.c9
-rw-r--r--net/ipv4/ipvs/Makefile2
-rw-r--r--net/ipv4/ipvs/ip_vs_proto.c3
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_icmp.c182
-rw-r--r--net/ipv4/multipath_drr.c2
-rw-r--r--net/ipv4/multipath_random.c2
-rw-r--r--net/ipv4/multipath_rr.c2
-rw-r--r--net/ipv4/multipath_wrandom.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_standalone.c1
-rw-r--r--net/ipv4/netfilter/ipt_recent.c10
-rw-r--r--net/ipv4/sysctl_net_ipv4.c9
-rw-r--r--net/ipv4/tcp.c2
-rw-r--r--net/ipv6/addrconf.c1
-rw-r--r--net/ipv6/icmp.c14
-rw-r--r--net/ipv6/ip6_tunnel.c1
-rw-r--r--net/ipv6/ipv6_syms.c1
-rw-r--r--net/sched/Kconfig2
-rw-r--r--net/sched/act_api.c2
-rw-r--r--net/sched/cls_basic.c3
-rw-r--r--net/sched/em_meta.c295
-rw-r--r--net/sctp/input.c49
-rw-r--r--net/sctp/ipv6.c36
-rw-r--r--net/sctp/proc.c194
-rw-r--r--net/sctp/protocol.c7
-rw-r--r--net/sctp/socket.c12
-rw-r--r--sound/usb/usbaudio.c2
-rw-r--r--sound/usb/usx2y/usbusx2y.c11
256 files changed, 4817 insertions, 2724 deletions
diff --git a/CREDITS b/CREDITS
index 9bd099d960f3..d65ffe5a4d08 100644
--- a/CREDITS
+++ b/CREDITS
@@ -2475,13 +2475,9 @@ S: Potsdam, New York 13676
2475S: USA 2475S: USA
2476 2476
2477N: Dave Neuer 2477N: Dave Neuer
2478E: dneuer@innovation-charter.com 2478E: dave.neuer@pobox.com
2479E: mr_fred_smoothie@yahoo.com
2480D: Helped implement support for Compaq's H31xx series iPAQs 2479D: Helped implement support for Compaq's H31xx series iPAQs
2481D: Other mostly minor tweaks & bugfixes 2480D: Other mostly minor tweaks & bugfixes
2482S: 325 E. Main St., Suite 3
2483S: Carnegie, PA 15105
2484S: USA
2485 2481
2486N: Michael Neuffer 2482N: Michael Neuffer
2487E: mike@i-Connect.Net 2483E: mike@i-Connect.Net
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl
index cf2fce7707da..6df1dfd18b65 100644
--- a/Documentation/DocBook/libata.tmpl
+++ b/Documentation/DocBook/libata.tmpl
@@ -14,7 +14,7 @@
14 </authorgroup> 14 </authorgroup>
15 15
16 <copyright> 16 <copyright>
17 <year>2003</year> 17 <year>2003-2005</year>
18 <holder>Jeff Garzik</holder> 18 <holder>Jeff Garzik</holder>
19 </copyright> 19 </copyright>
20 20
@@ -44,30 +44,38 @@
44 44
45<toc></toc> 45<toc></toc>
46 46
47 <chapter id="libataThanks"> 47 <chapter id="libataIntroduction">
48 <title>Thanks</title> 48 <title>Introduction</title>
49 <para> 49 <para>
50 The bulk of the ATA knowledge comes thanks to long conversations with 50 libATA is a library used inside the Linux kernel to support ATA host
51 Andre Hedrick (www.linux-ide.org). 51 controllers and devices. libATA provides an ATA driver API, class
52 transports for ATA and ATAPI devices, and SCSI&lt;-&gt;ATA translation
53 for ATA devices according to the T10 SAT specification.
52 </para> 54 </para>
53 <para> 55 <para>
54 Thanks to Alan Cox for pointing out similarities 56 This Guide documents the libATA driver API, library functions, library
55 between SATA and SCSI, and in general for motivation to hack on 57 internals, and a couple sample ATA low-level drivers.
56 libata.
57 </para>
58 <para>
59 libata's device detection
60 method, ata_pio_devchk, and in general all the early probing was
61 based on extensive study of Hale Landis's probe/reset code in his
62 ATADRVR driver (www.ata-atapi.com).
63 </para> 58 </para>
64 </chapter> 59 </chapter>
65 60
66 <chapter id="libataDriverApi"> 61 <chapter id="libataDriverApi">
67 <title>libata Driver API</title> 62 <title>libata Driver API</title>
63 <para>
64 struct ata_port_operations is defined for every low-level libata
65 hardware driver, and it controls how the low-level driver
66 interfaces with the ATA and SCSI layers.
67 </para>
68 <para>
69 FIS-based drivers will hook into the system with ->qc_prep() and
70 ->qc_issue() high-level hooks. Hardware which behaves in a manner
71 similar to PCI IDE hardware may utilize several generic helpers,
72 defining at a bare minimum the bus I/O addresses of the ATA shadow
73 register blocks.
74 </para>
68 <sect1> 75 <sect1>
69 <title>struct ata_port_operations</title> 76 <title>struct ata_port_operations</title>
70 77
78 <sect2><title>Disable ATA port</title>
71 <programlisting> 79 <programlisting>
72void (*port_disable) (struct ata_port *); 80void (*port_disable) (struct ata_port *);
73 </programlisting> 81 </programlisting>
@@ -78,6 +86,9 @@ void (*port_disable) (struct ata_port *);
78 unplug). 86 unplug).
79 </para> 87 </para>
80 88
89 </sect2>
90
91 <sect2><title>Post-IDENTIFY device configuration</title>
81 <programlisting> 92 <programlisting>
82void (*dev_config) (struct ata_port *, struct ata_device *); 93void (*dev_config) (struct ata_port *, struct ata_device *);
83 </programlisting> 94 </programlisting>
@@ -88,6 +99,9 @@ void (*dev_config) (struct ata_port *, struct ata_device *);
88 issue of SET FEATURES - XFER MODE, and prior to operation. 99 issue of SET FEATURES - XFER MODE, and prior to operation.
89 </para> 100 </para>
90 101
102 </sect2>
103
104 <sect2><title>Set PIO/DMA mode</title>
91 <programlisting> 105 <programlisting>
92void (*set_piomode) (struct ata_port *, struct ata_device *); 106void (*set_piomode) (struct ata_port *, struct ata_device *);
93void (*set_dmamode) (struct ata_port *, struct ata_device *); 107void (*set_dmamode) (struct ata_port *, struct ata_device *);
@@ -108,6 +122,9 @@ void (*post_set_mode) (struct ata_port *ap);
108 ->set_dma_mode() is only called if DMA is possible. 122 ->set_dma_mode() is only called if DMA is possible.
109 </para> 123 </para>
110 124
125 </sect2>
126
127 <sect2><title>Taskfile read/write</title>
111 <programlisting> 128 <programlisting>
112void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); 129void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf);
113void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); 130void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
@@ -120,6 +137,9 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
120 taskfile register values. 137 taskfile register values.
121 </para> 138 </para>
122 139
140 </sect2>
141
142 <sect2><title>ATA command execute</title>
123 <programlisting> 143 <programlisting>
124void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); 144void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
125 </programlisting> 145 </programlisting>
@@ -129,17 +149,37 @@ void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
129 ->tf_load(), to be initiated in hardware. 149 ->tf_load(), to be initiated in hardware.
130 </para> 150 </para>
131 151
152 </sect2>
153
154 <sect2><title>Per-cmd ATAPI DMA capabilities filter</title>
155 <programlisting>
156int (*check_atapi_dma) (struct ata_queued_cmd *qc);
157 </programlisting>
158
159 <para>
160Allow low-level driver to filter ATA PACKET commands, returning a status
161indicating whether or not it is OK to use DMA for the supplied PACKET
162command.
163 </para>
164
165 </sect2>
166
167 <sect2><title>Read specific ATA shadow registers</title>
132 <programlisting> 168 <programlisting>
133u8 (*check_status)(struct ata_port *ap); 169u8 (*check_status)(struct ata_port *ap);
134void (*dev_select)(struct ata_port *ap, unsigned int device); 170u8 (*check_altstatus)(struct ata_port *ap);
171u8 (*check_err)(struct ata_port *ap);
135 </programlisting> 172 </programlisting>
136 173
137 <para> 174 <para>
138 Reads the Status ATA shadow register from hardware. On some 175 Reads the Status/AltStatus/Error ATA shadow register from
139 hardware, this has the side effect of clearing the interrupt 176 hardware. On some hardware, reading the Status register has
140 condition. 177 the side effect of clearing the interrupt condition.
141 </para> 178 </para>
142 179
180 </sect2>
181
182 <sect2><title>Select ATA device on bus</title>
143 <programlisting> 183 <programlisting>
144void (*dev_select)(struct ata_port *ap, unsigned int device); 184void (*dev_select)(struct ata_port *ap, unsigned int device);
145 </programlisting> 185 </programlisting>
@@ -147,9 +187,13 @@ void (*dev_select)(struct ata_port *ap, unsigned int device);
147 <para> 187 <para>
148 Issues the low-level hardware command(s) that causes one of N 188 Issues the low-level hardware command(s) that causes one of N
149 hardware devices to be considered 'selected' (active and 189 hardware devices to be considered 'selected' (active and
150 available for use) on the ATA bus. 190 available for use) on the ATA bus. This generally has no
191meaning on FIS-based devices.
151 </para> 192 </para>
152 193
194 </sect2>
195
196 <sect2><title>Reset ATA bus</title>
153 <programlisting> 197 <programlisting>
154void (*phy_reset) (struct ata_port *ap); 198void (*phy_reset) (struct ata_port *ap);
155 </programlisting> 199 </programlisting>
@@ -162,17 +206,31 @@ void (*phy_reset) (struct ata_port *ap);
162 functions ata_bus_reset() or sata_phy_reset() for this hook. 206 functions ata_bus_reset() or sata_phy_reset() for this hook.
163 </para> 207 </para>
164 208
209 </sect2>
210
211 <sect2><title>Control PCI IDE BMDMA engine</title>
165 <programlisting> 212 <programlisting>
166void (*bmdma_setup) (struct ata_queued_cmd *qc); 213void (*bmdma_setup) (struct ata_queued_cmd *qc);
167void (*bmdma_start) (struct ata_queued_cmd *qc); 214void (*bmdma_start) (struct ata_queued_cmd *qc);
215void (*bmdma_stop) (struct ata_port *ap);
216u8 (*bmdma_status) (struct ata_port *ap);
168 </programlisting> 217 </programlisting>
169 218
170 <para> 219 <para>
171 When setting up an IDE BMDMA transaction, these hooks arm 220When setting up an IDE BMDMA transaction, these hooks arm
172 (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA 221(->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop)
173 engine. 222the hardware's DMA engine. ->bmdma_status is used to read the standard
223PCI IDE DMA Status register.
174 </para> 224 </para>
175 225
226 <para>
227These hooks are typically either no-ops, or simply not implemented, in
228FIS-based drivers.
229 </para>
230
231 </sect2>
232
233 <sect2><title>High-level taskfile hooks</title>
176 <programlisting> 234 <programlisting>
177void (*qc_prep) (struct ata_queued_cmd *qc); 235void (*qc_prep) (struct ata_queued_cmd *qc);
178int (*qc_issue) (struct ata_queued_cmd *qc); 236int (*qc_issue) (struct ata_queued_cmd *qc);
@@ -190,20 +248,26 @@ int (*qc_issue) (struct ata_queued_cmd *qc);
190 ->qc_issue is used to make a command active, once the hardware 248 ->qc_issue is used to make a command active, once the hardware
191 and S/G tables have been prepared. IDE BMDMA drivers use the 249 and S/G tables have been prepared. IDE BMDMA drivers use the
192 helper function ata_qc_issue_prot() for taskfile protocol-based 250 helper function ata_qc_issue_prot() for taskfile protocol-based
193 dispatch. More advanced drivers roll their own ->qc_issue 251 dispatch. More advanced drivers implement their own ->qc_issue.
194 implementation, using this as the "issue new ATA command to
195 hardware" hook.
196 </para> 252 </para>
197 253
254 </sect2>
255
256 <sect2><title>Timeout (error) handling</title>
198 <programlisting> 257 <programlisting>
199void (*eng_timeout) (struct ata_port *ap); 258void (*eng_timeout) (struct ata_port *ap);
200 </programlisting> 259 </programlisting>
201 260
202 <para> 261 <para>
203 This is a high level error handling function, called from the 262This is a high level error handling function, called from the
204 error handling thread, when a command times out. 263error handling thread, when a command times out. Most newer
264hardware will implement its own error handling code here. IDE BMDMA
265drivers may use the helper function ata_eng_timeout().
205 </para> 266 </para>
206 267
268 </sect2>
269
270 <sect2><title>Hardware interrupt handling</title>
207 <programlisting> 271 <programlisting>
208irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); 272irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
209void (*irq_clear) (struct ata_port *); 273void (*irq_clear) (struct ata_port *);
@@ -216,6 +280,9 @@ void (*irq_clear) (struct ata_port *);
216 is quiet. 280 is quiet.
217 </para> 281 </para>
218 282
283 </sect2>
284
285 <sect2><title>SATA phy read/write</title>
219 <programlisting> 286 <programlisting>
220u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 287u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
221void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 288void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
@@ -227,6 +294,9 @@ void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
227 if ->phy_reset hook called the sata_phy_reset() helper function. 294 if ->phy_reset hook called the sata_phy_reset() helper function.
228 </para> 295 </para>
229 296
297 </sect2>
298
299 <sect2><title>Init and shutdown</title>
230 <programlisting> 300 <programlisting>
231int (*port_start) (struct ata_port *ap); 301int (*port_start) (struct ata_port *ap);
232void (*port_stop) (struct ata_port *ap); 302void (*port_stop) (struct ata_port *ap);
@@ -240,15 +310,17 @@ void (*host_stop) (struct ata_host_set *host_set);
240 tasks. 310 tasks.
241 </para> 311 </para>
242 <para> 312 <para>
243 ->host_stop() is called when the rmmod or hot unplug process
244 begins. The hook must stop all hardware interrupts, DMA
245 engines, etc.
246 </para>
247 <para>
248 ->port_stop() is called after ->host_stop(). It's sole function 313 ->port_stop() is called after ->host_stop(). It's sole function
249 is to release DMA/memory resources, now that they are no longer 314 is to release DMA/memory resources, now that they are no longer
250 actively being used. 315 actively being used.
251 </para> 316 </para>
317 <para>
318 ->host_stop() is called after all ->port_stop() calls
319have completed. The hook must finalize hardware shutdown, release DMA
320and other resources, etc.
321 </para>
322
323 </sect2>
252 324
253 </sect1> 325 </sect1>
254 </chapter> 326 </chapter>
@@ -279,4 +351,24 @@ void (*host_stop) (struct ata_host_set *host_set);
279!Idrivers/scsi/sata_sil.c 351!Idrivers/scsi/sata_sil.c
280 </chapter> 352 </chapter>
281 353
354 <chapter id="libataThanks">
355 <title>Thanks</title>
356 <para>
357 The bulk of the ATA knowledge comes thanks to long conversations with
358 Andre Hedrick (www.linux-ide.org), and long hours pondering the ATA
359 and SCSI specifications.
360 </para>
361 <para>
362 Thanks to Alan Cox for pointing out similarities
363 between SATA and SCSI, and in general for motivation to hack on
364 libata.
365 </para>
366 <para>
367 libata's device detection
368 method, ata_pio_devchk, and in general all the early probing was
369 based on extensive study of Hale Landis's probe/reset code in his
370 ATADRVR driver (www.ata-atapi.com).
371 </para>
372 </chapter>
373
282</book> 374</book>
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 9838d32b2fe7..4d35562b1cf9 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -271,7 +271,7 @@ patch, which certifies that you wrote it or otherwise have the right to
271pass it on as a open-source patch. The rules are pretty simple: if you 271pass it on as a open-source patch. The rules are pretty simple: if you
272can certify the below: 272can certify the below:
273 273
274 Developer's Certificate of Origin 1.0 274 Developer's Certificate of Origin 1.1
275 275
276 By making a contribution to this project, I certify that: 276 By making a contribution to this project, I certify that:
277 277
@@ -291,6 +291,12 @@ can certify the below:
291 person who certified (a), (b) or (c) and I have not modified 291 person who certified (a), (b) or (c) and I have not modified
292 it. 292 it.
293 293
294 (d) I understand and agree that this project and the contribution
295 are public and that a record of the contribution (including all
296 personal information I submit with it, including my sign-off) is
297 maintained indefinitely and may be redistributed consistent with
298 this project or the open source license(s) involved.
299
294then you just add a line saying 300then you just add a line saying
295 301
296 Signed-off-by: Random J Developer <random@developer.org> 302 Signed-off-by: Random J Developer <random@developer.org>
diff --git a/Documentation/networking/vortex.txt b/Documentation/networking/vortex.txt
index fa12a9e4abdd..80e1cb19609f 100644
--- a/Documentation/networking/vortex.txt
+++ b/Documentation/networking/vortex.txt
@@ -12,7 +12,7 @@ Don is no longer the prime maintainer of this version of the driver.
12Please report problems to one or more of: 12Please report problems to one or more of:
13 13
14 Andrew Morton <andrewm@uow.edu.au> 14 Andrew Morton <andrewm@uow.edu.au>
15 Netdev mailing list <netdev@oss.sgi.com> 15 Netdev mailing list <netdev@vger.kernel.org>
16 Linux kernel mailing list <linux-kernel@vger.kernel.org> 16 Linux kernel mailing list <linux-kernel@vger.kernel.org>
17 17
18Please note the 'Reporting and Diagnosing Problems' section at the end 18Please note the 'Reporting and Diagnosing Problems' section at the end
diff --git a/MAINTAINERS b/MAINTAINERS
index 65ad8251e4bc..86ba94f16e83 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -73,7 +73,7 @@ S: Status, one of the following:
733C359 NETWORK DRIVER 733C359 NETWORK DRIVER
74P: Mike Phillips 74P: Mike Phillips
75M: mikep@linuxtr.net 75M: mikep@linuxtr.net
76L: netdev@oss.sgi.com 76L: netdev@vger.kernel.org
77L: linux-tr@linuxtr.net 77L: linux-tr@linuxtr.net
78W: http://www.linuxtr.net 78W: http://www.linuxtr.net
79S: Maintained 79S: Maintained
@@ -81,13 +81,13 @@ S: Maintained
813C505 NETWORK DRIVER 813C505 NETWORK DRIVER
82P: Philip Blundell 82P: Philip Blundell
83M: philb@gnu.org 83M: philb@gnu.org
84L: netdev@oss.sgi.com 84L: netdev@vger.kernel.org
85S: Maintained 85S: Maintained
86 86
873CR990 NETWORK DRIVER 873CR990 NETWORK DRIVER
88P: David Dillow 88P: David Dillow
89M: dave@thedillows.org 89M: dave@thedillows.org
90L: netdev@oss.sgi.com 90L: netdev@vger.kernel.org
91S: Maintained 91S: Maintained
92 92
933W-XXXX ATA-RAID CONTROLLER DRIVER 933W-XXXX ATA-RAID CONTROLLER DRIVER
@@ -130,7 +130,7 @@ S: Maintained
1308169 10/100/1000 GIGABIT ETHERNET DRIVER 1308169 10/100/1000 GIGABIT ETHERNET DRIVER
131P: Francois Romieu 131P: Francois Romieu
132M: romieu@fr.zoreil.com 132M: romieu@fr.zoreil.com
133L: netdev@oss.sgi.com 133L: netdev@vger.kernel.org
134S: Maintained 134S: Maintained
135 135
1368250/16?50 (AND CLONE UARTS) SERIAL DRIVER 1368250/16?50 (AND CLONE UARTS) SERIAL DRIVER
@@ -143,7 +143,7 @@ S: Maintained
1438390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.] 1438390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
144P: Paul Gortmaker 144P: Paul Gortmaker
145M: p_gortmaker@yahoo.com 145M: p_gortmaker@yahoo.com
146L: netdev@oss.sgi.com 146L: netdev@vger.kernel.org
147S: Maintained 147S: Maintained
148 148
149A2232 SERIAL BOARD DRIVER 149A2232 SERIAL BOARD DRIVER
@@ -332,7 +332,7 @@ S: Maintained
332 332
333ARPD SUPPORT 333ARPD SUPPORT
334P: Jonathan Layes 334P: Jonathan Layes
335L: netdev@oss.sgi.com 335L: netdev@vger.kernel.org
336S: Maintained 336S: Maintained
337 337
338ASUS ACPI EXTRAS DRIVER 338ASUS ACPI EXTRAS DRIVER
@@ -706,7 +706,7 @@ S: Orphaned
706 706
707DIGI RIGHTSWITCH NETWORK DRIVER 707DIGI RIGHTSWITCH NETWORK DRIVER
708P: Rick Richardson 708P: Rick Richardson
709L: netdev@oss.sgi.com 709L: netdev@vger.kernel.org
710W: http://www.digi.com 710W: http://www.digi.com
711S: Orphaned 711S: Orphaned
712 712
@@ -812,7 +812,7 @@ S: Maintained
812ETHEREXPRESS-16 NETWORK DRIVER 812ETHEREXPRESS-16 NETWORK DRIVER
813P: Philip Blundell 813P: Philip Blundell
814M: philb@gnu.org 814M: philb@gnu.org
815L: netdev@oss.sgi.com 815L: netdev@vger.kernel.org
816S: Maintained 816S: Maintained
817 817
818ETHERNET BRIDGE 818ETHERNET BRIDGE
@@ -875,7 +875,7 @@ S: Maintained
875FRAME RELAY DLCI/FRAD (Sangoma drivers too) 875FRAME RELAY DLCI/FRAD (Sangoma drivers too)
876P: Mike McLagan 876P: Mike McLagan
877M: mike.mclagan@linux.org 877M: mike.mclagan@linux.org
878L: netdev@oss.sgi.com 878L: netdev@vger.kernel.org
879S: Maintained 879S: Maintained
880 880
881FREEVXFS FILESYSTEM 881FREEVXFS FILESYSTEM
@@ -1215,7 +1215,7 @@ S: Maintained
1215IPX NETWORK LAYER 1215IPX NETWORK LAYER
1216P: Arnaldo Carvalho de Melo 1216P: Arnaldo Carvalho de Melo
1217M: acme@conectiva.com.br 1217M: acme@conectiva.com.br
1218L: netdev@oss.sgi.com 1218L: netdev@vger.kernel.org
1219S: Maintained 1219S: Maintained
1220 1220
1221IRDA SUBSYSTEM 1221IRDA SUBSYSTEM
@@ -1482,7 +1482,7 @@ MARVELL MV64340 ETHERNET DRIVER
1482P: Manish Lachwani 1482P: Manish Lachwani
1483M: Manish_Lachwani@pmc-sierra.com 1483M: Manish_Lachwani@pmc-sierra.com
1484L: linux-mips@linux-mips.org 1484L: linux-mips@linux-mips.org
1485L: netdev@oss.sgi.com 1485L: netdev@vger.kernel.org
1486S: Supported 1486S: Supported
1487 1487
1488MATROX FRAMEBUFFER DRIVER 1488MATROX FRAMEBUFFER DRIVER
@@ -1592,13 +1592,13 @@ P: Andrew Morton
1592M: akpm@osdl.org 1592M: akpm@osdl.org
1593P: Jeff Garzik 1593P: Jeff Garzik
1594M: jgarzik@pobox.com 1594M: jgarzik@pobox.com
1595L: netdev@oss.sgi.com 1595L: netdev@vger.kernel.org
1596S: Maintained 1596S: Maintained
1597 1597
1598NETWORKING [GENERAL] 1598NETWORKING [GENERAL]
1599P: Networking Team 1599P: Networking Team
1600M: netdev@oss.sgi.com 1600M: netdev@vger.kernel.org
1601L: netdev@oss.sgi.com 1601L: netdev@vger.kernel.org
1602S: Maintained 1602S: Maintained
1603 1603
1604NETWORKING [IPv4/IPv6] 1604NETWORKING [IPv4/IPv6]
@@ -1614,7 +1614,7 @@ P: Hideaki YOSHIFUJI
1614M: yoshfuji@linux-ipv6.org 1614M: yoshfuji@linux-ipv6.org
1615P: Patrick McHardy 1615P: Patrick McHardy
1616M: kaber@coreworks.de 1616M: kaber@coreworks.de
1617L: netdev@oss.sgi.com 1617L: netdev@vger.kernel.org
1618S: Maintained 1618S: Maintained
1619 1619
1620IPVS 1620IPVS
@@ -1634,7 +1634,7 @@ NI5010 NETWORK DRIVER
1634P: Jan-Pascal van Best and Andreas Mohr 1634P: Jan-Pascal van Best and Andreas Mohr
1635M: Jan-Pascal van Best <jvbest@qv3pluto.leidenuniv.nl> 1635M: Jan-Pascal van Best <jvbest@qv3pluto.leidenuniv.nl>
1636M: Andreas Mohr <100.30936@germany.net> 1636M: Andreas Mohr <100.30936@germany.net>
1637L: netdev@oss.sgi.com 1637L: netdev@vger.kernel.org
1638S: Maintained 1638S: Maintained
1639 1639
1640NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER 1640NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER
@@ -1676,7 +1676,7 @@ P: Peter De Shrijver
1676M: p2@ace.ulyssis.student.kuleuven.ac.be 1676M: p2@ace.ulyssis.student.kuleuven.ac.be
1677P: Mike Phillips 1677P: Mike Phillips
1678M: mikep@linuxtr.net 1678M: mikep@linuxtr.net
1679L: netdev@oss.sgi.com 1679L: netdev@vger.kernel.org
1680L: linux-tr@linuxtr.net 1680L: linux-tr@linuxtr.net
1681W: http://www.linuxtr.net 1681W: http://www.linuxtr.net
1682S: Maintained 1682S: Maintained
@@ -1783,7 +1783,7 @@ S: Unmaintained
1783PCNET32 NETWORK DRIVER 1783PCNET32 NETWORK DRIVER
1784P: Thomas Bogendörfer 1784P: Thomas Bogendörfer
1785M: tsbogend@alpha.franken.de 1785M: tsbogend@alpha.franken.de
1786L: netdev@oss.sgi.com 1786L: netdev@vger.kernel.org
1787S: Maintained 1787S: Maintained
1788 1788
1789PHRAM MTD DRIVER 1789PHRAM MTD DRIVER
@@ -1795,7 +1795,7 @@ S: Maintained
1795POSIX CLOCKS and TIMERS 1795POSIX CLOCKS and TIMERS
1796P: George Anzinger 1796P: George Anzinger
1797M: george@mvista.com 1797M: george@mvista.com
1798L: netdev@oss.sgi.com 1798L: netdev@vger.kernel.org
1799S: Supported 1799S: Supported
1800 1800
1801PNP SUPPORT 1801PNP SUPPORT
@@ -1830,7 +1830,7 @@ S: Supported
1830PRISM54 WIRELESS DRIVER 1830PRISM54 WIRELESS DRIVER
1831P: Prism54 Development Team 1831P: Prism54 Development Team
1832M: prism54-private@prism54.org 1832M: prism54-private@prism54.org
1833L: netdev@oss.sgi.com 1833L: netdev@vger.kernel.org
1834W: http://prism54.org 1834W: http://prism54.org
1835S: Maintained 1835S: Maintained
1836 1836
@@ -2047,7 +2047,7 @@ SIS 900/7016 FAST ETHERNET DRIVER
2047P: Daniele Venzano 2047P: Daniele Venzano
2048M: venza@brownhat.org 2048M: venza@brownhat.org
2049W: http://www.brownhat.org/sis900.html 2049W: http://www.brownhat.org/sis900.html
2050L: netdev@oss.sgi.com 2050L: netdev@vger.kernel.org
2051S: Maintained 2051S: Maintained
2052 2052
2053SIS FRAMEBUFFER DRIVER 2053SIS FRAMEBUFFER DRIVER
@@ -2106,7 +2106,7 @@ S: Maintained
2106SONIC NETWORK DRIVER 2106SONIC NETWORK DRIVER
2107P: Thomas Bogendoerfer 2107P: Thomas Bogendoerfer
2108M: tsbogend@alpha.franken.de 2108M: tsbogend@alpha.franken.de
2109L: netdev@oss.sgi.com 2109L: netdev@vger.kernel.org
2110S: Maintained 2110S: Maintained
2111 2111
2112SONY VAIO CONTROL DEVICE DRIVER 2112SONY VAIO CONTROL DEVICE DRIVER
@@ -2163,7 +2163,7 @@ S: Supported
2163SPX NETWORK LAYER 2163SPX NETWORK LAYER
2164P: Jay Schulist 2164P: Jay Schulist
2165M: jschlst@samba.org 2165M: jschlst@samba.org
2166L: netdev@oss.sgi.com 2166L: netdev@vger.kernel.org
2167S: Supported 2167S: Supported
2168 2168
2169SRM (Alpha) environment access 2169SRM (Alpha) environment access
@@ -2242,7 +2242,7 @@ S: Maintained
2242TOKEN-RING NETWORK DRIVER 2242TOKEN-RING NETWORK DRIVER
2243P: Mike Phillips 2243P: Mike Phillips
2244M: mikep@linuxtr.net 2244M: mikep@linuxtr.net
2245L: netdev@oss.sgi.com 2245L: netdev@vger.kernel.org
2246L: linux-tr@linuxtr.net 2246L: linux-tr@linuxtr.net
2247W: http://www.linuxtr.net 2247W: http://www.linuxtr.net
2248S: Maintained 2248S: Maintained
diff --git a/Makefile b/Makefile
index c11a317ea910..0d1e74d50067 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 12 3SUBLEVEL = 12
4EXTRAVERSION =-rc5 4EXTRAVERSION =
5NAME=Woozy Numbat 5NAME=Woozy Numbat
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index bf397a9f8ac2..475950c8a831 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -497,7 +497,7 @@ source "drivers/cpufreq/Kconfig"
497 497
498config CPU_FREQ_SA1100 498config CPU_FREQ_SA1100
499 bool 499 bool
500 depends on CPU_FREQ && (SA1100_LART || SA1100_PLEB) 500 depends on CPU_FREQ && (SA1100_H3100 || SA1100_H3600 || SA1100_H3800 || SA1100_LART || SA1100_PLEB || SA1100_BADGE4 || SA1100_HACKKIT)
501 default y 501 default y
502 502
503config CPU_FREQ_SA1110 503config CPU_FREQ_SA1110
@@ -689,7 +689,9 @@ source "drivers/block/Kconfig"
689 689
690source "drivers/acorn/block/Kconfig" 690source "drivers/acorn/block/Kconfig"
691 691
692if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE 692if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \
693 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \
694 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
693source "drivers/ide/Kconfig" 695source "drivers/ide/Kconfig"
694endif 696endif
695 697
diff --git a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S
index 665bd2c20743..d3fe2533907e 100644
--- a/arch/arm/boot/compressed/head-xscale.S
+++ b/arch/arm/boot/compressed/head-xscale.S
@@ -47,3 +47,10 @@ __XScale_start:
47 orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00) 47 orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
48#endif 48#endif
49 49
50#ifdef CONFIG_ARCH_IXP2000
51 mov r1, #-1
52 mov r0, #0xd6000000
53 str r1, [r0, #0x14]
54 str r1, [r0, #0x18]
55#endif
56
diff --git a/arch/arm/configs/badge4_defconfig b/arch/arm/configs/badge4_defconfig
index 2b4059d2f8e4..5d92af975d87 100644
--- a/arch/arm/configs/badge4_defconfig
+++ b/arch/arm/configs/badge4_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-rc6-git3
4# Sat Mar 26 21:32:26 2005 4# Thu Jun 9 19:00:50 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -16,6 +16,7 @@ CONFIG_GENERIC_IOMAP=y
16CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -34,6 +35,8 @@ CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
37CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 41CONFIG_FUTEX=y
39CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -109,7 +112,6 @@ CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y 112CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y 113CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y 114CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113 115
114# 116#
115# Processor Features 117# Processor Features
@@ -122,6 +124,7 @@ CONFIG_FORCE_MAX_ZONEORDER=9
122# Bus support 124# Bus support
123# 125#
124CONFIG_ISA=y 126CONFIG_ISA=y
127CONFIG_ISA_DMA_API=y
125 128
126# 129#
127# PCCARD (PCMCIA/CardBus) support 130# PCCARD (PCMCIA/CardBus) support
@@ -131,6 +134,7 @@ CONFIG_ISA=y
131# 134#
132# Kernel Features 135# Kernel Features
133# 136#
137# CONFIG_SMP is not set
134# CONFIG_PREEMPT is not set 138# CONFIG_PREEMPT is not set
135CONFIG_DISCONTIGMEM=y 139CONFIG_DISCONTIGMEM=y
136# CONFIG_LEDS is not set 140# CONFIG_LEDS is not set
@@ -152,12 +156,14 @@ CONFIG_CPU_FREQ_TABLE=y
152# CONFIG_CPU_FREQ_DEBUG is not set 156# CONFIG_CPU_FREQ_DEBUG is not set
153CONFIG_CPU_FREQ_STAT=y 157CONFIG_CPU_FREQ_STAT=y
154# CONFIG_CPU_FREQ_STAT_DETAILS is not set 158# CONFIG_CPU_FREQ_STAT_DETAILS is not set
155CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 159# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
156# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 160CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
157CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 161CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
158# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 162# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
159# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 163CONFIG_CPU_FREQ_GOV_USERSPACE=y
160# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 164# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
165# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
166CONFIG_CPU_FREQ_SA1100=y
161 167
162# 168#
163# Floating point emulation 169# Floating point emulation
@@ -294,7 +300,6 @@ CONFIG_PARPORT_NOT_PC=y
294# 300#
295# Block devices 301# Block devices
296# 302#
297# CONFIG_BLK_DEV_FD is not set
298# CONFIG_BLK_DEV_XD is not set 303# CONFIG_BLK_DEV_XD is not set
299# CONFIG_PARIDE is not set 304# CONFIG_PARIDE is not set
300# CONFIG_BLK_DEV_COW_COMMON is not set 305# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -428,7 +433,6 @@ CONFIG_NET=y
428# 433#
429CONFIG_PACKET=y 434CONFIG_PACKET=y
430# CONFIG_PACKET_MMAP is not set 435# CONFIG_PACKET_MMAP is not set
431# CONFIG_NETLINK_DEV is not set
432CONFIG_UNIX=y 436CONFIG_UNIX=y
433# CONFIG_NET_KEY is not set 437# CONFIG_NET_KEY is not set
434CONFIG_INET=y 438CONFIG_INET=y
@@ -526,6 +530,7 @@ CONFIG_IRDA_ULTRA=y
526# CONFIG_SMC_IRCC_FIR is not set 530# CONFIG_SMC_IRCC_FIR is not set
527# CONFIG_ALI_FIR is not set 531# CONFIG_ALI_FIR is not set
528CONFIG_SA1100_FIR=y 532CONFIG_SA1100_FIR=y
533# CONFIG_VIA_FIR is not set
529CONFIG_BT=m 534CONFIG_BT=m
530CONFIG_BT_L2CAP=m 535CONFIG_BT_L2CAP=m
531# CONFIG_BT_SCO is not set 536# CONFIG_BT_SCO is not set
@@ -618,7 +623,6 @@ CONFIG_NET_WIRELESS=y
618# 623#
619# CONFIG_SERIO is not set 624# CONFIG_SERIO is not set
620# CONFIG_GAMEPORT is not set 625# CONFIG_GAMEPORT is not set
621CONFIG_SOUND_GAMEPORT=y
622 626
623# 627#
624# Character devices 628# Character devices
@@ -687,7 +691,6 @@ CONFIG_RTC=m
687# 691#
688# TPM devices 692# TPM devices
689# 693#
690# CONFIG_TCG_TPM is not set
691 694
692# 695#
693# I2C support 696# I2C support
@@ -736,6 +739,7 @@ CONFIG_I2C_ELEKTOR=m
736# CONFIG_SENSORS_LM85 is not set 739# CONFIG_SENSORS_LM85 is not set
737# CONFIG_SENSORS_LM87 is not set 740# CONFIG_SENSORS_LM87 is not set
738# CONFIG_SENSORS_LM90 is not set 741# CONFIG_SENSORS_LM90 is not set
742# CONFIG_SENSORS_LM92 is not set
739# CONFIG_SENSORS_MAX1619 is not set 743# CONFIG_SENSORS_MAX1619 is not set
740# CONFIG_SENSORS_PC87360 is not set 744# CONFIG_SENSORS_PC87360 is not set
741# CONFIG_SENSORS_SMSC47B397 is not set 745# CONFIG_SENSORS_SMSC47B397 is not set
@@ -747,6 +751,7 @@ CONFIG_I2C_ELEKTOR=m
747# 751#
748# Other I2C Chip support 752# Other I2C Chip support
749# 753#
754# CONFIG_SENSORS_DS1337 is not set
750# CONFIG_SENSORS_EEPROM is not set 755# CONFIG_SENSORS_EEPROM is not set
751# CONFIG_SENSORS_PCF8574 is not set 756# CONFIG_SENSORS_PCF8574 is not set
752# CONFIG_SENSORS_PCF8591 is not set 757# CONFIG_SENSORS_PCF8591 is not set
@@ -871,7 +876,6 @@ CONFIG_USB_PRINTER=m
871# 876#
872CONFIG_USB_STORAGE=y 877CONFIG_USB_STORAGE=y
873CONFIG_USB_STORAGE_DEBUG=y 878CONFIG_USB_STORAGE_DEBUG=y
874# CONFIG_USB_STORAGE_RW_DETECT is not set
875# CONFIG_USB_STORAGE_DATAFAB is not set 879# CONFIG_USB_STORAGE_DATAFAB is not set
876# CONFIG_USB_STORAGE_FREECOM is not set 880# CONFIG_USB_STORAGE_FREECOM is not set
877# CONFIG_USB_STORAGE_ISD200 is not set 881# CONFIG_USB_STORAGE_ISD200 is not set
@@ -954,9 +958,11 @@ CONFIG_USB_USS720=m
954# 958#
955CONFIG_USB_SERIAL=m 959CONFIG_USB_SERIAL=m
956CONFIG_USB_SERIAL_GENERIC=y 960CONFIG_USB_SERIAL_GENERIC=y
961# CONFIG_USB_SERIAL_AIRPRIME is not set
957CONFIG_USB_SERIAL_BELKIN=m 962CONFIG_USB_SERIAL_BELKIN=m
958CONFIG_USB_SERIAL_WHITEHEAT=m 963CONFIG_USB_SERIAL_WHITEHEAT=m
959CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m 964CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
965# CONFIG_USB_SERIAL_CP2101 is not set
960# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 966# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
961CONFIG_USB_SERIAL_EMPEG=m 967CONFIG_USB_SERIAL_EMPEG=m
962CONFIG_USB_SERIAL_FTDI_SIO=m 968CONFIG_USB_SERIAL_FTDI_SIO=m
@@ -985,6 +991,7 @@ CONFIG_USB_SERIAL_KEYSPAN=m
985# CONFIG_USB_SERIAL_KOBIL_SCT is not set 991# CONFIG_USB_SERIAL_KOBIL_SCT is not set
986CONFIG_USB_SERIAL_MCT_U232=m 992CONFIG_USB_SERIAL_MCT_U232=m
987CONFIG_USB_SERIAL_PL2303=m 993CONFIG_USB_SERIAL_PL2303=m
994# CONFIG_USB_SERIAL_HP4X is not set
988# CONFIG_USB_SERIAL_SAFE is not set 995# CONFIG_USB_SERIAL_SAFE is not set
989# CONFIG_USB_SERIAL_TI is not set 996# CONFIG_USB_SERIAL_TI is not set
990CONFIG_USB_SERIAL_CYBERJACK=m 997CONFIG_USB_SERIAL_CYBERJACK=m
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
index b4e297dd54b2..b9de07de80fe 100644
--- a/arch/arm/configs/h3600_defconfig
+++ b/arch/arm/configs/h3600_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-rc4
4# Mon Mar 28 00:02:26 2005 4# Thu Jun 9 01:59:03 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -16,6 +16,7 @@ CONFIG_GENERIC_IOMAP=y
16CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -33,6 +34,8 @@ CONFIG_KOBJECT_UEVENT=y
33# CONFIG_EMBEDDED is not set 34# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_PRINTK=y
38CONFIG_BUG=y
36CONFIG_BASE_FULL=y 39CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y 40CONFIG_FUTEX=y
38CONFIG_EPOLL=y 41CONFIG_EPOLL=y
@@ -120,6 +123,7 @@ CONFIG_CPU_MINICACHE=y
120# Bus support 123# Bus support
121# 124#
122CONFIG_ISA=y 125CONFIG_ISA=y
126CONFIG_ISA_DMA_API=y
123 127
124# 128#
125# PCCARD (PCMCIA/CardBus) support 129# PCCARD (PCMCIA/CardBus) support
@@ -138,6 +142,7 @@ CONFIG_PCMCIA_SA1100=y
138# 142#
139# Kernel Features 143# Kernel Features
140# 144#
145# CONFIG_SMP is not set
141# CONFIG_PREEMPT is not set 146# CONFIG_PREEMPT is not set
142CONFIG_DISCONTIGMEM=y 147CONFIG_DISCONTIGMEM=y
143# CONFIG_LEDS is not set 148# CONFIG_LEDS is not set
@@ -159,12 +164,13 @@ CONFIG_CPU_FREQ_TABLE=y
159# CONFIG_CPU_FREQ_DEBUG is not set 164# CONFIG_CPU_FREQ_DEBUG is not set
160CONFIG_CPU_FREQ_STAT=y 165CONFIG_CPU_FREQ_STAT=y
161# CONFIG_CPU_FREQ_STAT_DETAILS is not set 166# CONFIG_CPU_FREQ_STAT_DETAILS is not set
162CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 167# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
163# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 168CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
164CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 169# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
165# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 170# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
166# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 171CONFIG_CPU_FREQ_GOV_USERSPACE=y
167# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 172# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
173CONFIG_CPU_FREQ_SA1100=y
168 174
169# 175#
170# Floating point emulation 176# Floating point emulation
@@ -298,7 +304,6 @@ CONFIG_MTD_SA1100=y
298# 304#
299# Block devices 305# Block devices
300# 306#
301# CONFIG_BLK_DEV_FD is not set
302# CONFIG_BLK_DEV_XD is not set 307# CONFIG_BLK_DEV_XD is not set
303# CONFIG_BLK_DEV_COW_COMMON is not set 308# CONFIG_BLK_DEV_COW_COMMON is not set
304CONFIG_BLK_DEV_LOOP=m 309CONFIG_BLK_DEV_LOOP=m
@@ -379,7 +384,6 @@ CONFIG_NET=y
379# Networking options 384# Networking options
380# 385#
381# CONFIG_PACKET is not set 386# CONFIG_PACKET is not set
382# CONFIG_NETLINK_DEV is not set
383CONFIG_UNIX=y 387CONFIG_UNIX=y
384# CONFIG_NET_KEY is not set 388# CONFIG_NET_KEY is not set
385CONFIG_INET=y 389CONFIG_INET=y
@@ -476,6 +480,7 @@ CONFIG_IRCOMM=m
476# CONFIG_SMC_IRCC_FIR is not set 480# CONFIG_SMC_IRCC_FIR is not set
477# CONFIG_ALI_FIR is not set 481# CONFIG_ALI_FIR is not set
478CONFIG_SA1100_FIR=m 482CONFIG_SA1100_FIR=m
483# CONFIG_VIA_FIR is not set
479# CONFIG_BT is not set 484# CONFIG_BT is not set
480CONFIG_NETDEVICES=y 485CONFIG_NETDEVICES=y
481# CONFIG_DUMMY is not set 486# CONFIG_DUMMY is not set
@@ -647,7 +652,6 @@ CONFIG_LEGACY_PTY_COUNT=256
647# 652#
648# TPM devices 653# TPM devices
649# 654#
650# CONFIG_TCG_TPM is not set
651 655
652# 656#
653# I2C support 657# I2C support
@@ -676,9 +680,11 @@ CONFIG_FB_CFB_FILLRECT=y
676CONFIG_FB_CFB_COPYAREA=y 680CONFIG_FB_CFB_COPYAREA=y
677CONFIG_FB_CFB_IMAGEBLIT=y 681CONFIG_FB_CFB_IMAGEBLIT=y
678CONFIG_FB_SOFT_CURSOR=y 682CONFIG_FB_SOFT_CURSOR=y
683# CONFIG_FB_MACMODES is not set
679# CONFIG_FB_MODE_HELPERS is not set 684# CONFIG_FB_MODE_HELPERS is not set
680# CONFIG_FB_TILEBLITTING is not set 685# CONFIG_FB_TILEBLITTING is not set
681CONFIG_FB_SA1100=y 686CONFIG_FB_SA1100=y
687# CONFIG_FB_S1D13XXX is not set
682# CONFIG_FB_VIRTUAL is not set 688# CONFIG_FB_VIRTUAL is not set
683 689
684# 690#
diff --git a/arch/arm/configs/hackkit_defconfig b/arch/arm/configs/hackkit_defconfig
index 6987c8c5ddb4..fb41a36a5a68 100644
--- a/arch/arm/configs/hackkit_defconfig
+++ b/arch/arm/configs/hackkit_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-rc6-git3
4# Mon Mar 28 00:22:34 2005 4# Thu Jun 9 20:58:58 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -16,6 +16,7 @@ CONFIG_GENERIC_IOMAP=y
16CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -34,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
34CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
37CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 41CONFIG_FUTEX=y
39CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -109,7 +112,6 @@ CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y 112CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y 113CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y 114CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113 115
114# 116#
115# Processor Features 117# Processor Features
@@ -119,6 +121,7 @@ CONFIG_CPU_MINICACHE=y
119# Bus support 121# Bus support
120# 122#
121CONFIG_ISA=y 123CONFIG_ISA=y
124CONFIG_ISA_DMA_API=y
122 125
123# 126#
124# PCCARD (PCMCIA/CardBus) support 127# PCCARD (PCMCIA/CardBus) support
@@ -128,6 +131,7 @@ CONFIG_ISA=y
128# 131#
129# Kernel Features 132# Kernel Features
130# 133#
134# CONFIG_SMP is not set
131# CONFIG_PREEMPT is not set 135# CONFIG_PREEMPT is not set
132CONFIG_DISCONTIGMEM=y 136CONFIG_DISCONTIGMEM=y
133CONFIG_LEDS=y 137CONFIG_LEDS=y
@@ -151,12 +155,14 @@ CONFIG_CPU_FREQ_TABLE=y
151# CONFIG_CPU_FREQ_DEBUG is not set 155# CONFIG_CPU_FREQ_DEBUG is not set
152CONFIG_CPU_FREQ_STAT=y 156CONFIG_CPU_FREQ_STAT=y
153# CONFIG_CPU_FREQ_STAT_DETAILS is not set 157# CONFIG_CPU_FREQ_STAT_DETAILS is not set
154CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 158# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
155# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 159CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
156CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 160CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
157# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 161# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
158# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 162CONFIG_CPU_FREQ_GOV_USERSPACE=y
159# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 163# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
164# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
165CONFIG_CPU_FREQ_SA1100=y
160 166
161# 167#
162# Floating point emulation 168# Floating point emulation
@@ -280,7 +286,6 @@ CONFIG_MTD_CFI_UTIL=y
280# 286#
281# Block devices 287# Block devices
282# 288#
283# CONFIG_BLK_DEV_FD is not set
284# CONFIG_BLK_DEV_XD is not set 289# CONFIG_BLK_DEV_XD is not set
285# CONFIG_BLK_DEV_COW_COMMON is not set 290# CONFIG_BLK_DEV_COW_COMMON is not set
286# CONFIG_BLK_DEV_LOOP is not set 291# CONFIG_BLK_DEV_LOOP is not set
@@ -338,7 +343,6 @@ CONFIG_NET=y
338# 343#
339CONFIG_PACKET=y 344CONFIG_PACKET=y
340# CONFIG_PACKET_MMAP is not set 345# CONFIG_PACKET_MMAP is not set
341# CONFIG_NETLINK_DEV is not set
342CONFIG_UNIX=y 346CONFIG_UNIX=y
343# CONFIG_NET_KEY is not set 347# CONFIG_NET_KEY is not set
344CONFIG_INET=y 348CONFIG_INET=y
@@ -484,7 +488,6 @@ CONFIG_SERIO=y
484CONFIG_SERIO_SERPORT=y 488CONFIG_SERIO_SERPORT=y
485# CONFIG_SERIO_RAW is not set 489# CONFIG_SERIO_RAW is not set
486# CONFIG_GAMEPORT is not set 490# CONFIG_GAMEPORT is not set
487CONFIG_SOUND_GAMEPORT=y
488 491
489# 492#
490# Character devices 493# Character devices
@@ -533,7 +536,6 @@ CONFIG_LEGACY_PTY_COUNT=256
533# 536#
534# TPM devices 537# TPM devices
535# 538#
536# CONFIG_TCG_TPM is not set
537 539
538# 540#
539# I2C support 541# I2C support
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 4eb36155dc93..e14278d59882 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -269,7 +269,7 @@ __pabt_svc:
269 add r5, sp, #S_PC 269 add r5, sp, #S_PC
270 ldmia r7, {r2 - r4} @ Get USR pc, cpsr 270 ldmia r7, {r2 - r4} @ Get USR pc, cpsr
271 271
272#if __LINUX_ARM_ARCH__ < 6 272#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
273 @ make sure our user space atomic helper is aborted 273 @ make sure our user space atomic helper is aborted
274 cmp r2, #VIRT_OFFSET 274 cmp r2, #VIRT_OFFSET
275 bichs r3, r3, #PSR_Z_BIT 275 bichs r3, r3, #PSR_Z_BIT
@@ -616,11 +616,17 @@ __kuser_helper_start:
616 616
617__kuser_cmpxchg: @ 0xffff0fc0 617__kuser_cmpxchg: @ 0xffff0fc0
618 618
619#if __LINUX_ARM_ARCH__ < 6 619#if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
620 620
621#ifdef CONFIG_SMP /* sanity check */ 621 /*
622#error "CONFIG_SMP on a machine supporting pre-ARMv6 processors?" 622 * Poor you. No fast solution possible...
623#endif 623 * The kernel itself must perform the operation.
624 * A special ghost syscall is used for that (see traps.c).
625 */
626 swi #0x9ffff0
627 mov pc, lr
628
629#elif __LINUX_ARM_ARCH__ < 6
624 630
625 /* 631 /*
626 * Theory of operation: 632 * Theory of operation:
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 14df16b983f4..45d2a032d890 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -464,6 +464,55 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
464#endif 464#endif
465 return 0; 465 return 0;
466 466
467#ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
468 /*
469 * Atomically store r1 in *r2 if *r2 is equal to r0 for user space.
470 * Return zero in r0 if *MEM was changed or non-zero if no exchange
471 * happened. Also set the user C flag accordingly.
472 * If access permissions have to be fixed up then non-zero is
473 * returned and the operation has to be re-attempted.
474 *
475 * *NOTE*: This is a ghost syscall private to the kernel. Only the
476 * __kuser_cmpxchg code in entry-armv.S should be aware of its
477 * existence. Don't ever use this from user code.
478 */
479 case 0xfff0:
480 {
481 extern void do_DataAbort(unsigned long addr, unsigned int fsr,
482 struct pt_regs *regs);
483 unsigned long val;
484 unsigned long addr = regs->ARM_r2;
485 struct mm_struct *mm = current->mm;
486 pgd_t *pgd; pmd_t *pmd; pte_t *pte;
487
488 regs->ARM_cpsr &= ~PSR_C_BIT;
489 spin_lock(&mm->page_table_lock);
490 pgd = pgd_offset(mm, addr);
491 if (!pgd_present(*pgd))
492 goto bad_access;
493 pmd = pmd_offset(pgd, addr);
494 if (!pmd_present(*pmd))
495 goto bad_access;
496 pte = pte_offset_map(pmd, addr);
497 if (!pte_present(*pte) || !pte_write(*pte))
498 goto bad_access;
499 val = *(unsigned long *)addr;
500 val -= regs->ARM_r0;
501 if (val == 0) {
502 *(unsigned long *)addr = regs->ARM_r1;
503 regs->ARM_cpsr |= PSR_C_BIT;
504 }
505 spin_unlock(&mm->page_table_lock);
506 return val;
507
508 bad_access:
509 spin_unlock(&mm->page_table_lock);
510 /* simulate a read access fault */
511 do_DataAbort(addr, 15 + (1 << 11), regs);
512 return -1;
513 }
514#endif
515
467 default: 516 default:
468 /* Calls 9f00xx..9f07ff are defined to return -ENOSYS 517 /* Calls 9f00xx..9f07ff are defined to return -ENOSYS
469 if not implemented, rather than raising SIGILL. This 518 if not implemented, rather than raising SIGILL. This
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S
index 6d1d7c27806e..5e240e452af6 100644
--- a/arch/arm/lib/io-writesw-armv4.S
+++ b/arch/arm/lib/io-writesw-armv4.S
@@ -87,9 +87,9 @@ ENTRY(__raw_writesw)
87 subs r2, r2, #2 87 subs r2, r2, #2
88 orr ip, ip, r3, push_hbyte1 88 orr ip, ip, r3, push_hbyte1
89 strh ip, [r0] 89 strh ip, [r0]
90 bpl 2b 90 bpl 1b
91 91
923: tst r2, #1 92 tst r2, #1
932: movne ip, r3, lsr #8 933: movne ip, r3, lsr #8
94 strneh ip, [r0] 94 strneh ip, [r0]
95 mov pc, lr 95 mov pc, lr
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 3b948e8c2751..e0a01eef0993 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -83,7 +83,6 @@ static struct map_desc intcp_io_desc[] __initdata = {
83 { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE }, 83 { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE },
84 { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE }, 84 { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE },
85 { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE }, 85 { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE },
86 { 0xfc900000, 0xc9000000, SZ_4K, MT_DEVICE },
87 { 0xfca00000, 0xca000000, SZ_4K, MT_DEVICE }, 86 { 0xfca00000, 0xca000000, SZ_4K, MT_DEVICE },
88 { 0xfcb00000, 0xcb000000, SZ_4K, MT_DEVICE }, 87 { 0xfcb00000, 0xcb000000, SZ_4K, MT_DEVICE },
89}; 88};
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index dd012d6e2f5c..f2c9e0d2b24b 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/sysdev.h>
18#include <linux/major.h> 19#include <linux/major.h>
19#include <linux/fb.h> 20#include <linux/fb.h>
20#include <linux/interrupt.h> 21#include <linux/interrupt.h>
@@ -106,6 +107,35 @@ static void __init lubbock_init_irq(void)
106 set_irq_type(IRQ_GPIO(0), IRQT_FALLING); 107 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
107} 108}
108 109
110#ifdef CONFIG_PM
111
112static int lubbock_irq_resume(struct sys_device *dev)
113{
114 LUB_IRQ_MASK_EN = lubbock_irq_enabled;
115 return 0;
116}
117
118static struct sysdev_class lubbock_irq_sysclass = {
119 set_kset_name("cpld_irq"),
120 .resume = lubbock_irq_resume,
121};
122
123static struct sys_device lubbock_irq_device = {
124 .cls = &lubbock_irq_sysclass,
125};
126
127static int __init lubbock_irq_device_init(void)
128{
129 int ret = sysdev_class_register(&lubbock_irq_sysclass);
130 if (ret == 0)
131 ret = sysdev_register(&lubbock_irq_device);
132 return ret;
133}
134
135device_initcall(lubbock_irq_device_init);
136
137#endif
138
109static int lubbock_udc_is_connected(void) 139static int lubbock_udc_is_connected(void)
110{ 140{
111 return (LUB_MISC_RD & (1 << 9)) == 0; 141 return (LUB_MISC_RD & (1 << 9)) == 0;
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 3f952237ae3d..9896afca751f 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -15,6 +15,7 @@
15 15
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/sysdev.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <linux/sched.h> 20#include <linux/sched.h>
20#include <linux/bitops.h> 21#include <linux/bitops.h>
@@ -62,7 +63,6 @@ static struct irqchip mainstone_irq_chip = {
62 .unmask = mainstone_unmask_irq, 63 .unmask = mainstone_unmask_irq,
63}; 64};
64 65
65
66static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc, 66static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc,
67 struct pt_regs *regs) 67 struct pt_regs *regs)
68{ 68{
@@ -100,6 +100,35 @@ static void __init mainstone_init_irq(void)
100 set_irq_type(IRQ_GPIO(0), IRQT_FALLING); 100 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
101} 101}
102 102
103#ifdef CONFIG_PM
104
105static int mainstone_irq_resume(struct sys_device *dev)
106{
107 MST_INTMSKENA = mainstone_irq_enabled;
108 return 0;
109}
110
111static struct sysdev_class mainstone_irq_sysclass = {
112 set_kset_name("cpld_irq"),
113 .resume = mainstone_irq_resume,
114};
115
116static struct sys_device mainstone_irq_device = {
117 .cls = &mainstone_irq_sysclass,
118};
119
120static int __init mainstone_irq_device_init(void)
121{
122 int ret = sysdev_class_register(&mainstone_irq_sysclass);
123 if (ret == 0)
124 ret = sysdev_register(&mainstone_irq_device);
125 return ret;
126}
127
128device_initcall(mainstone_irq_device_init);
129
130#endif
131
103 132
104static struct resource smc91x_resources[] = { 133static struct resource smc91x_resources[] = {
105 [0] = { 134 [0] = {
@@ -304,6 +333,15 @@ static void __init mainstone_map_io(void)
304 PWER = 0xC0000002; 333 PWER = 0xC0000002;
305 PRER = 0x00000002; 334 PRER = 0x00000002;
306 PFER = 0x00000002; 335 PFER = 0x00000002;
336 /* for use I SRAM as framebuffer. */
337 PSLR |= 0xF04;
338 PCFR = 0x66;
339 /* For Keypad wakeup. */
340 KPC &=~KPC_ASACT;
341 KPC |=KPC_AS;
342 PKWR = 0x000FD000;
343 /* Need read PKWR back after set it. */
344 PKWR;
307} 345}
308 346
309MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 347MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 82a4bf34c251..9799fe80df23 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -29,9 +29,6 @@
29 */ 29 */
30#undef DEBUG 30#undef DEBUG
31 31
32extern void pxa_cpu_suspend(void);
33extern void pxa_cpu_resume(void);
34
35#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x 32#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
36#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] 33#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
37 34
@@ -63,6 +60,12 @@ enum { SLEEP_SAVE_START = 0,
63 SLEEP_SAVE_ICMR, 60 SLEEP_SAVE_ICMR,
64 SLEEP_SAVE_CKEN, 61 SLEEP_SAVE_CKEN,
65 62
63#ifdef CONFIG_PXA27x
64 SLEEP_SAVE_MDREFR,
65 SLEEP_SAVE_PWER, SLEEP_SAVE_PCFR, SLEEP_SAVE_PRER,
66 SLEEP_SAVE_PFER, SLEEP_SAVE_PKWR,
67#endif
68
66 SLEEP_SAVE_CKSUM, 69 SLEEP_SAVE_CKSUM,
67 70
68 SLEEP_SAVE_SIZE 71 SLEEP_SAVE_SIZE
@@ -75,9 +78,7 @@ static int pxa_pm_enter(suspend_state_t state)
75 unsigned long checksum = 0; 78 unsigned long checksum = 0;
76 struct timespec delta, rtc; 79 struct timespec delta, rtc;
77 int i; 80 int i;
78 81 extern void pxa_cpu_pm_enter(suspend_state_t state);
79 if (state != PM_SUSPEND_MEM)
80 return -EINVAL;
81 82
82#ifdef CONFIG_IWMMXT 83#ifdef CONFIG_IWMMXT
83 /* force any iWMMXt context to ram **/ 84 /* force any iWMMXt context to ram **/
@@ -100,16 +101,17 @@ static int pxa_pm_enter(suspend_state_t state)
100 SAVE(GAFR2_L); SAVE(GAFR2_U); 101 SAVE(GAFR2_L); SAVE(GAFR2_U);
101 102
102#ifdef CONFIG_PXA27x 103#ifdef CONFIG_PXA27x
104 SAVE(MDREFR);
103 SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3); 105 SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3);
104 SAVE(GAFR3_L); SAVE(GAFR3_U); 106 SAVE(GAFR3_L); SAVE(GAFR3_U);
107 SAVE(PWER); SAVE(PCFR); SAVE(PRER);
108 SAVE(PFER); SAVE(PKWR);
105#endif 109#endif
106 110
107 SAVE(ICMR); 111 SAVE(ICMR);
108 ICMR = 0; 112 ICMR = 0;
109 113
110 SAVE(CKEN); 114 SAVE(CKEN);
111 CKEN = 0;
112
113 SAVE(PSTR); 115 SAVE(PSTR);
114 116
115 /* Note: wake up source are set up in each machine specific files */ 117 /* Note: wake up source are set up in each machine specific files */
@@ -123,16 +125,13 @@ static int pxa_pm_enter(suspend_state_t state)
123 /* Clear sleep reset status */ 125 /* Clear sleep reset status */
124 RCSR = RCSR_SMR; 126 RCSR = RCSR_SMR;
125 127
126 /* set resume return address */
127 PSPR = virt_to_phys(pxa_cpu_resume);
128
129 /* before sleeping, calculate and save a checksum */ 128 /* before sleeping, calculate and save a checksum */
130 for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++) 129 for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++)
131 checksum += sleep_save[i]; 130 checksum += sleep_save[i];
132 sleep_save[SLEEP_SAVE_CKSUM] = checksum; 131 sleep_save[SLEEP_SAVE_CKSUM] = checksum;
133 132
134 /* *** go zzz *** */ 133 /* *** go zzz *** */
135 pxa_cpu_suspend(); 134 pxa_cpu_pm_enter(state);
136 135
137 /* after sleeping, validate the checksum */ 136 /* after sleeping, validate the checksum */
138 checksum = 0; 137 checksum = 0;
@@ -145,7 +144,7 @@ static int pxa_pm_enter(suspend_state_t state)
145 LUB_HEXLED = 0xbadbadc5; 144 LUB_HEXLED = 0xbadbadc5;
146#endif 145#endif
147 while (1) 146 while (1)
148 pxa_cpu_suspend(); 147 pxa_cpu_pm_enter(state);
149 } 148 }
150 149
151 /* ensure not to come back here if it wasn't intended */ 150 /* ensure not to come back here if it wasn't intended */
@@ -162,8 +161,11 @@ static int pxa_pm_enter(suspend_state_t state)
162 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); 161 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2);
163 162
164#ifdef CONFIG_PXA27x 163#ifdef CONFIG_PXA27x
164 RESTORE(MDREFR);
165 RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3); 165 RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3);
166 RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); 166 RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3);
167 RESTORE(PWER); RESTORE(PCFR); RESTORE(PRER);
168 RESTORE(PFER); RESTORE(PKWR);
167#endif 169#endif
168 170
169 PSSR = PSSR_RDH | PSSR_PH; 171 PSSR = PSSR_RDH | PSSR_PH;
@@ -197,7 +199,9 @@ unsigned long sleep_phys_sp(void *sp)
197 */ 199 */
198static int pxa_pm_prepare(suspend_state_t state) 200static int pxa_pm_prepare(suspend_state_t state)
199{ 201{
200 return 0; 202 extern int pxa_cpu_pm_prepare(suspend_state_t state);
203
204 return pxa_cpu_pm_prepare(state);
201} 205}
202 206
203/* 207/*
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index e887b7175ef3..7869c3b4e62f 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -16,6 +16,7 @@
16 * initialization stuff for PXA machines which can be overridden later if 16 * initialization stuff for PXA machines which can be overridden later if
17 * need be. 17 * need be.
18 */ 18 */
19#include <linux/config.h>
19#include <linux/module.h> 20#include <linux/module.h>
20#include <linux/kernel.h> 21#include <linux/kernel.h>
21#include <linux/init.h> 22#include <linux/init.h>
@@ -102,3 +103,35 @@ unsigned int get_lcdclk_frequency_10khz(void)
102} 103}
103 104
104EXPORT_SYMBOL(get_lcdclk_frequency_10khz); 105EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
106
107#ifdef CONFIG_PM
108
109int pxa_cpu_pm_prepare(suspend_state_t state)
110{
111 switch (state) {
112 case PM_SUSPEND_MEM:
113 break;
114 default:
115 return -EINVAL;
116 }
117
118 return 0;
119}
120
121void pxa_cpu_pm_enter(suspend_state_t state)
122{
123 extern void pxa_cpu_suspend(unsigned int);
124 extern void pxa_cpu_resume(void);
125
126 CKEN = 0;
127
128 switch (state) {
129 case PM_SUSPEND_MEM:
130 /* set resume return address */
131 PSPR = virt_to_phys(pxa_cpu_resume);
132 pxa_cpu_suspend(3);
133 break;
134 }
135}
136
137#endif
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 7e863afefb53..893964fb9659 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -120,6 +120,42 @@ EXPORT_SYMBOL(get_clk_frequency_khz);
120EXPORT_SYMBOL(get_memclk_frequency_10khz); 120EXPORT_SYMBOL(get_memclk_frequency_10khz);
121EXPORT_SYMBOL(get_lcdclk_frequency_10khz); 121EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
122 122
123#ifdef CONFIG_PM
124
125int pxa_cpu_pm_prepare(suspend_state_t state)
126{
127 switch (state) {
128 case PM_SUSPEND_MEM:
129 return 0;
130 default:
131 return -EINVAL;
132 }
133}
134
135void pxa_cpu_pm_enter(suspend_state_t state)
136{
137 extern void pxa_cpu_standby(void);
138 extern void pxa_cpu_suspend(unsigned int);
139 extern void pxa_cpu_resume(void);
140
141 CKEN = CKEN22_MEMC | CKEN9_OSTIMER;
142
143 /* ensure voltage-change sequencer not initiated, which hangs */
144 PCFR &= ~PCFR_FVC;
145
146 /* Clear edge-detect status register. */
147 PEDR = 0xDF12FE1B;
148
149 switch (state) {
150 case PM_SUSPEND_MEM:
151 /* set resume return address */
152 PSPR = virt_to_phys(pxa_cpu_resume);
153 pxa_cpu_suspend(3);
154 break;
155 }
156}
157
158#endif
123 159
124/* 160/*
125 * device registration specific to PXA27x. 161 * device registration specific to PXA27x.
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index bc229fab86d4..c7c28890d406 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -785,6 +785,10 @@ int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client)
785 chan->client = NULL; 785 chan->client = NULL;
786 chan->in_use = 0; 786 chan->in_use = 0;
787 787
788 if (chan->irq_claimed)
789 free_irq(chan->irq, (void *)chan);
790 chan->irq_claimed = 0;
791
788 local_irq_restore(flags); 792 local_irq_restore(flags);
789 793
790 return 0; 794 return 0;
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 50cde576dadf..6923316b3d0d 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -150,7 +150,7 @@ config SA1100_SSP
150 150
151config H3600_SLEEVE 151config H3600_SLEEVE
152 tristate "Compaq iPAQ Handheld sleeve support" 152 tristate "Compaq iPAQ Handheld sleeve support"
153 depends on SA1100_H3600 153 depends on SA1100_H3100 || SA1100_H3600
154 help 154 help
155 Choose this option to enable support for extension packs (sleeves) 155 Choose this option to enable support for extension packs (sleeves)
156 for the Compaq iPAQ H3XXX series of handheld computers. This option 156 for the Compaq iPAQ H3XXX series of handheld computers. This option
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 554e1bd30d6e..302c2a7b9b63 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -543,7 +543,7 @@ static void versatile_clcd_enable(struct clcd_fb *fb)
543 val |= SYS_CLCD_MODE_5551; 543 val |= SYS_CLCD_MODE_5551;
544 break; 544 break;
545 case 6: 545 case 6:
546 val |= SYS_CLCD_MODE_565_BLSB; 546 val |= SYS_CLCD_MODE_565_RLSB;
547 break; 547 break;
548 case 8: 548 case 8:
549 val |= SYS_CLCD_MODE_888; 549 val |= SYS_CLCD_MODE_888;
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 48bac7da8c70..3fefb43c67f7 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -228,7 +228,6 @@ config CPU_SA1100
228 select CPU_CACHE_V4WB 228 select CPU_CACHE_V4WB
229 select CPU_CACHE_VIVT 229 select CPU_CACHE_VIVT
230 select CPU_TLB_V4WB 230 select CPU_TLB_V4WB
231 select CPU_MINICACHE
232 231
233# XScale 232# XScale
234config CPU_XSCALE 233config CPU_XSCALE
@@ -239,7 +238,6 @@ config CPU_XSCALE
239 select CPU_ABRT_EV5T 238 select CPU_ABRT_EV5T
240 select CPU_CACHE_VIVT 239 select CPU_CACHE_VIVT
241 select CPU_TLB_V4WBI 240 select CPU_TLB_V4WBI
242 select CPU_MINICACHE
243 241
244# ARMv6 242# ARMv6
245config CPU_V6 243config CPU_V6
@@ -345,11 +343,6 @@ config CPU_TLB_V4WBI
345config CPU_TLB_V6 343config CPU_TLB_V6
346 bool 344 bool
347 345
348config CPU_MINICACHE
349 bool
350 help
351 Processor has a minicache.
352
353comment "Processor Features" 346comment "Processor Features"
354 347
355config ARM_THUMB 348config ARM_THUMB
@@ -429,3 +422,11 @@ config HAS_TLS_REG
429 assume directly accessing that register and always obtain the 422 assume directly accessing that register and always obtain the
430 expected value only on ARMv7 and above. 423 expected value only on ARMv7 and above.
431 424
425config NEEDS_SYSCALL_FOR_CMPXCHG
426 bool
427 default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
428 help
429 SMP on a pre-ARMv6 processor? Well OK then.
430 Forget about fast user space cmpxchg support.
431 It is just not possible.
432
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index ccf316c11e02..59f47d4c2dfe 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -31,8 +31,6 @@ obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o mmu.o
31obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o 31obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o
32obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o 32obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o
33 33
34obj-$(CONFIG_CPU_MINICACHE) += minicache.o
35
36obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o 34obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o
37obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o 35obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
38obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o 36obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o
diff --git a/arch/arm/mm/copypage-xscale.S b/arch/arm/mm/copypage-xscale.S
deleted file mode 100644
index bb277316ef52..000000000000
--- a/arch/arm/mm/copypage-xscale.S
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * linux/arch/arm/lib/copypage-xscale.S
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <linux/init.h>
12#include <asm/constants.h>
13
14/*
15 * General note:
16 * We don't really want write-allocate cache behaviour for these functions
17 * since that will just eat through 8K of the cache.
18 */
19
20 .text
21 .align 5
22/*
23 * XScale optimised copy_user_page
24 * r0 = destination
25 * r1 = source
26 * r2 = virtual user address of ultimate destination page
27 *
28 * The source page may have some clean entries in the cache already, but we
29 * can safely ignore them - break_cow() will flush them out of the cache
30 * if we eventually end up using our copied page.
31 *
32 * What we could do is use the mini-cache to buffer reads from the source
33 * page. We rely on the mini-cache being smaller than one page, so we'll
34 * cycle through the complete cache anyway.
35 */
36ENTRY(xscale_mc_copy_user_page)
37 stmfd sp!, {r4, r5, lr}
38 mov r5, r0
39 mov r0, r1
40 bl map_page_minicache
41 mov r1, r5
42 mov lr, #PAGE_SZ/64-1
43
44 /*
45 * Strangely enough, best performance is achieved
46 * when prefetching destination as well. (NP)
47 */
48 pld [r0, #0]
49 pld [r0, #32]
50 pld [r1, #0]
51 pld [r1, #32]
52
531: pld [r0, #64]
54 pld [r0, #96]
55 pld [r1, #64]
56 pld [r1, #96]
57
582: ldrd r2, [r0], #8
59 ldrd r4, [r0], #8
60 mov ip, r1
61 strd r2, [r1], #8
62 ldrd r2, [r0], #8
63 strd r4, [r1], #8
64 ldrd r4, [r0], #8
65 strd r2, [r1], #8
66 strd r4, [r1], #8
67 mcr p15, 0, ip, c7, c10, 1 @ clean D line
68 ldrd r2, [r0], #8
69 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
70 ldrd r4, [r0], #8
71 mov ip, r1
72 strd r2, [r1], #8
73 ldrd r2, [r0], #8
74 strd r4, [r1], #8
75 ldrd r4, [r0], #8
76 strd r2, [r1], #8
77 strd r4, [r1], #8
78 mcr p15, 0, ip, c7, c10, 1 @ clean D line
79 subs lr, lr, #1
80 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
81 bgt 1b
82 beq 2b
83
84 ldmfd sp!, {r4, r5, pc}
85
86 .align 5
87/*
88 * XScale optimised clear_user_page
89 * r0 = destination
90 * r1 = virtual user address of ultimate destination page
91 */
92ENTRY(xscale_mc_clear_user_page)
93 mov r1, #PAGE_SZ/32
94 mov r2, #0
95 mov r3, #0
961: mov ip, r0
97 strd r2, [r0], #8
98 strd r2, [r0], #8
99 strd r2, [r0], #8
100 strd r2, [r0], #8
101 mcr p15, 0, ip, c7, c10, 1 @ clean D line
102 subs r1, r1, #1
103 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
104 bne 1b
105 mov pc, lr
106
107 __INITDATA
108
109 .type xscale_mc_user_fns, #object
110ENTRY(xscale_mc_user_fns)
111 .long xscale_mc_clear_user_page
112 .long xscale_mc_copy_user_page
113 .size xscale_mc_user_fns, . - xscale_mc_user_fns
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c
new file mode 100644
index 000000000000..42a6ee255ce0
--- /dev/null
+++ b/arch/arm/mm/copypage-xscale.c
@@ -0,0 +1,131 @@
1/*
2 * linux/arch/arm/lib/copypage-xscale.S
3 *
4 * Copyright (C) 1995-2005 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This handles the mini data cache, as found on SA11x0 and XScale
11 * processors. When we copy a user page page, we map it in such a way
12 * that accesses to this page will not touch the main data cache, but
13 * will be cached in the mini data cache. This prevents us thrashing
14 * the main data cache on page faults.
15 */
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#include <asm/page.h>
20#include <asm/pgtable.h>
21#include <asm/tlbflush.h>
22
23/*
24 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
25 * specific hacks for copying pages efficiently.
26 */
27#define COPYPAGE_MINICACHE 0xffff8000
28
29#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
30 L_PTE_CACHEABLE)
31
32#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
33
34static DEFINE_SPINLOCK(minicache_lock);
35
36/*
37 * XScale mini-dcache optimised copy_user_page
38 *
39 * We flush the destination cache lines just before we write the data into the
40 * corresponding address. Since the Dcache is read-allocate, this removes the
41 * Dcache aliasing issue. The writes will be forwarded to the write buffer,
42 * and merged as appropriate.
43 */
44static void __attribute__((naked))
45mc_copy_user_page(void *from, void *to)
46{
47 /*
48 * Strangely enough, best performance is achieved
49 * when prefetching destination as well. (NP)
50 */
51 asm volatile(
52 "stmfd sp!, {r4, r5, lr} \n\
53 mov lr, %2 \n\
54 pld [r0, #0] \n\
55 pld [r0, #32] \n\
56 pld [r1, #0] \n\
57 pld [r1, #32] \n\
581: pld [r0, #64] \n\
59 pld [r0, #96] \n\
60 pld [r1, #64] \n\
61 pld [r1, #96] \n\
622: ldrd r2, [r0], #8 \n\
63 ldrd r4, [r0], #8 \n\
64 mov ip, r1 \n\
65 strd r2, [r1], #8 \n\
66 ldrd r2, [r0], #8 \n\
67 strd r4, [r1], #8 \n\
68 ldrd r4, [r0], #8 \n\
69 strd r2, [r1], #8 \n\
70 strd r4, [r1], #8 \n\
71 mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
72 ldrd r2, [r0], #8 \n\
73 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
74 ldrd r4, [r0], #8 \n\
75 mov ip, r1 \n\
76 strd r2, [r1], #8 \n\
77 ldrd r2, [r0], #8 \n\
78 strd r4, [r1], #8 \n\
79 ldrd r4, [r0], #8 \n\
80 strd r2, [r1], #8 \n\
81 strd r4, [r1], #8 \n\
82 mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
83 subs lr, lr, #1 \n\
84 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
85 bgt 1b \n\
86 beq 2b \n\
87 ldmfd sp!, {r4, r5, pc} "
88 :
89 : "r" (from), "r" (to), "I" (PAGE_SIZE / 64 - 1));
90}
91
92void xscale_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
93{
94 spin_lock(&minicache_lock);
95
96 set_pte(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot));
97 flush_tlb_kernel_page(COPYPAGE_MINICACHE);
98
99 mc_copy_user_page((void *)COPYPAGE_MINICACHE, kto);
100
101 spin_unlock(&minicache_lock);
102}
103
104/*
105 * XScale optimised clear_user_page
106 */
107void __attribute__((naked))
108xscale_mc_clear_user_page(void *kaddr, unsigned long vaddr)
109{
110 asm volatile(
111 "mov r1, %0 \n\
112 mov r2, #0 \n\
113 mov r3, #0 \n\
1141: mov ip, r0 \n\
115 strd r2, [r0], #8 \n\
116 strd r2, [r0], #8 \n\
117 strd r2, [r0], #8 \n\
118 strd r2, [r0], #8 \n\
119 mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
120 subs r1, r1, #1 \n\
121 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
122 bne 1b \n\
123 mov pc, lr"
124 :
125 : "I" (PAGE_SIZE / 32));
126}
127
128struct cpu_user_fns xscale_mc_user_fns __initdata = {
129 .cpu_clear_user_page = xscale_mc_clear_user_page,
130 .cpu_copy_user_page = xscale_mc_copy_user_page,
131};
diff --git a/arch/arm/mm/minicache.c b/arch/arm/mm/minicache.c
deleted file mode 100644
index dedf2ab01b2a..000000000000
--- a/arch/arm/mm/minicache.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * linux/arch/arm/mm/minicache.c
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This handles the mini data cache, as found on SA11x0 and XScale
11 * processors. When we copy a user page page, we map it in such a way
12 * that accesses to this page will not touch the main data cache, but
13 * will be cached in the mini data cache. This prevents us thrashing
14 * the main data cache on page faults.
15 */
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#include <asm/page.h>
20#include <asm/pgtable.h>
21#include <asm/tlbflush.h>
22
23/*
24 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
25 * specific hacks for copying pages efficiently.
26 */
27#define minicache_address (0xffff8000)
28#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
29 L_PTE_CACHEABLE)
30
31static pte_t *minicache_pte;
32
33/*
34 * Note that this is intended to be called only from the copy_user_page
35 * asm code; anything else will require special locking to prevent the
36 * mini-cache space being re-used. (Note: probably preempt unsafe).
37 *
38 * We rely on the fact that the minicache is 2K, and we'll be pushing
39 * 4K of data through it, so we don't actually have to specifically
40 * flush the minicache when we change the mapping.
41 *
42 * Note also: assert(PAGE_OFFSET <= virt < high_memory).
43 * Unsafe: preempt, kmap.
44 */
45unsigned long map_page_minicache(unsigned long virt)
46{
47 set_pte(minicache_pte, pfn_pte(__pa(virt) >> PAGE_SHIFT, minicache_pgprot));
48 flush_tlb_kernel_page(minicache_address);
49
50 return minicache_address;
51}
52
53static int __init minicache_init(void)
54{
55 pgd_t *pgd;
56 pmd_t *pmd;
57
58 spin_lock(&init_mm.page_table_lock);
59
60 pgd = pgd_offset_k(minicache_address);
61 pmd = pmd_alloc(&init_mm, pgd, minicache_address);
62 if (!pmd)
63 BUG();
64 minicache_pte = pte_alloc_kernel(&init_mm, pmd, minicache_address);
65 if (!minicache_pte)
66 BUG();
67
68 spin_unlock(&init_mm.page_table_lock);
69
70 return 0;
71}
72
73core_initcall(minicache_init);
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 0fbcfe00dd8d..51ecd512603d 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -43,7 +43,7 @@ obj-$(CONFIG_SCx200) += scx200.o
43# Note: kbuild does not track this dependency due to usage of .incbin 43# Note: kbuild does not track this dependency due to usage of .incbin
44$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so 44$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
45targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) 45targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
46targets += vsyscall.lds 46targets += vsyscall-note.o vsyscall.lds
47 47
48# The DSO images are built using a special linker script. 48# The DSO images are built using a special linker script.
49quiet_cmd_syscall = SYSCALL $@ 49quiet_cmd_syscall = SYSCALL $@
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 45641a872550..0ff65abcd56c 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -1222,6 +1222,7 @@ static int suspend(int vetoable)
1222 1222
1223 save_processor_state(); 1223 save_processor_state();
1224 err = set_system_power_state(APM_STATE_SUSPEND); 1224 err = set_system_power_state(APM_STATE_SUSPEND);
1225 ignore_normal_resume = 1;
1225 restore_processor_state(); 1226 restore_processor_state();
1226 1227
1227 local_irq_disable(); 1228 local_irq_disable();
@@ -1229,7 +1230,6 @@ static int suspend(int vetoable)
1229 spin_lock(&i8253_lock); 1230 spin_lock(&i8253_lock);
1230 reinit_timer(); 1231 reinit_timer();
1231 set_time(); 1232 set_time();
1232 ignore_normal_resume = 1;
1233 1233
1234 spin_unlock(&i8253_lock); 1234 spin_unlock(&i8253_lock);
1235 write_sequnlock(&xtime_lock); 1235 write_sequnlock(&xtime_lock);
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 4f3cdef75797..962b6c4e32b5 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -460,9 +460,9 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set
460 ;; 460 ;;
461 461
462 st8 [r2]=r14 // update current->blocked with new mask 462 st8 [r2]=r14 // update current->blocked with new mask
463 cmpxchg4.acq r14=[r9],r18,ar.ccv // current->thread_info->flags <- r18 463 cmpxchg4.acq r8=[r9],r18,ar.ccv // current->thread_info->flags <- r18
464 ;; 464 ;;
465 cmp.ne p6,p0=r17,r14 // update failed? 465 cmp.ne p6,p0=r17,r8 // update failed?
466(p6) br.cond.spnt.few 1b // yes -> retry 466(p6) br.cond.spnt.few 1b // yes -> retry
467 467
468#ifdef CONFIG_SMP 468#ifdef CONFIG_SMP
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index febc091c2f02..f1aca7cffd12 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -825,14 +825,16 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
825 * XXX Should have an arch-hook for running this after final section 825 * XXX Should have an arch-hook for running this after final section
826 * addresses have been selected... 826 * addresses have been selected...
827 */ 827 */
828 /* See if gp can cover the entire core module: */ 828 uint64_t gp;
829 uint64_t gp = (uint64_t) mod->module_core + MAX_LTOFF / 2; 829 if (mod->core_size > MAX_LTOFF)
830 if (mod->core_size >= MAX_LTOFF)
831 /* 830 /*
832 * This takes advantage of fact that SHF_ARCH_SMALL gets allocated 831 * This takes advantage of fact that SHF_ARCH_SMALL gets allocated
833 * at the end of the module. 832 * at the end of the module.
834 */ 833 */
835 gp = (uint64_t) mod->module_core + mod->core_size - MAX_LTOFF / 2; 834 gp = mod->core_size - MAX_LTOFF / 2;
835 else
836 gp = mod->core_size / 2;
837 gp = (uint64_t) mod->module_core + ((gp + 7) & -8);
836 mod->arch.gp = gp; 838 mod->arch.gp = gp;
837 DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp); 839 DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp);
838 } 840 }
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 08c8a5eb25ab..575a8f657b31 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -635,11 +635,17 @@ ia64_flush_fph (struct task_struct *task)
635{ 635{
636 struct ia64_psr *psr = ia64_psr(ia64_task_regs(task)); 636 struct ia64_psr *psr = ia64_psr(ia64_task_regs(task));
637 637
638 /*
639 * Prevent migrating this task while
640 * we're fiddling with the FPU state
641 */
642 preempt_disable();
638 if (ia64_is_local_fpu_owner(task) && psr->mfh) { 643 if (ia64_is_local_fpu_owner(task) && psr->mfh) {
639 psr->mfh = 0; 644 psr->mfh = 0;
640 task->thread.flags |= IA64_THREAD_FPH_VALID; 645 task->thread.flags |= IA64_THREAD_FPH_VALID;
641 ia64_save_fpu(&task->thread.fph[0]); 646 ia64_save_fpu(&task->thread.fph[0]);
642 } 647 }
648 preempt_enable();
643} 649}
644 650
645/* 651/*
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index b7e6b4cb374b..d14692e0920a 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -720,7 +720,8 @@ cpu_init (void)
720 ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page))); 720 ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page)));
721 721
722 /* 722 /*
723 * Initialize default control register to defer all speculative faults. The 723 * Initialize default control register to defer speculative faults except
724 * for those arising from TLB misses, which are not deferred. The
724 * kernel MUST NOT depend on a particular setting of these bits (in other words, 725 * kernel MUST NOT depend on a particular setting of these bits (in other words,
725 * the kernel must have recovery code for all speculative accesses). Turn on 726 * the kernel must have recovery code for all speculative accesses). Turn on
726 * dcr.lc as per recommendation by the architecture team. Most IA-32 apps 727 * dcr.lc as per recommendation by the architecture team. Most IA-32 apps
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index e82ad78081b3..1861173bd4f6 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -111,6 +111,24 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
111 siginfo_t siginfo; 111 siginfo_t siginfo;
112 int sig, code; 112 int sig, code;
113 113
114 /* break.b always sets cr.iim to 0, which causes problems for
115 * debuggers. Get the real break number from the original instruction,
116 * but only for kernel code. User space break.b is left alone, to
117 * preserve the existing behaviour. All break codings have the same
118 * format, so there is no need to check the slot type.
119 */
120 if (break_num == 0 && !user_mode(regs)) {
121 struct ia64_psr *ipsr = ia64_psr(regs);
122 unsigned long *bundle = (unsigned long *)regs->cr_iip;
123 unsigned long slot;
124 switch (ipsr->ri) {
125 case 0: slot = (bundle[0] >> 5); break;
126 case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break;
127 default: slot = (bundle[1] >> 23); break;
128 }
129 break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff);
130 }
131
114 /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ 132 /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
115 siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); 133 siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
116 siginfo.si_imm = break_num; 134 siginfo.si_imm = break_num;
@@ -202,13 +220,21 @@ disabled_fph_fault (struct pt_regs *regs)
202 220
203 /* first, grant user-level access to fph partition: */ 221 /* first, grant user-level access to fph partition: */
204 psr->dfh = 0; 222 psr->dfh = 0;
223
224 /*
225 * Make sure that no other task gets in on this processor
226 * while we're claiming the FPU
227 */
228 preempt_disable();
205#ifndef CONFIG_SMP 229#ifndef CONFIG_SMP
206 { 230 {
207 struct task_struct *fpu_owner 231 struct task_struct *fpu_owner
208 = (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER); 232 = (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER);
209 233
210 if (ia64_is_local_fpu_owner(current)) 234 if (ia64_is_local_fpu_owner(current)) {
235 preempt_enable_no_resched();
211 return; 236 return;
237 }
212 238
213 if (fpu_owner) 239 if (fpu_owner)
214 ia64_flush_fph(fpu_owner); 240 ia64_flush_fph(fpu_owner);
@@ -226,6 +252,7 @@ disabled_fph_fault (struct pt_regs *regs)
226 */ 252 */
227 psr->mfh = 1; 253 psr->mfh = 1;
228 } 254 }
255 preempt_enable_no_resched();
229} 256}
230 257
231static inline int 258static inline int
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 547785e3cba2..4eb2f52b87a1 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -305,8 +305,9 @@ setup_gate (void)
305 struct page *page; 305 struct page *page;
306 306
307 /* 307 /*
308 * Map the gate page twice: once read-only to export the ELF headers etc. and once 308 * Map the gate page twice: once read-only to export the ELF
309 * execute-only page to enable privilege-promotion via "epc": 309 * headers etc. and once execute-only page to enable
310 * privilege-promotion via "epc":
310 */ 311 */
311 page = virt_to_page(ia64_imva(__start_gate_section)); 312 page = virt_to_page(ia64_imva(__start_gate_section));
312 put_kernel_page(page, GATE_ADDR, PAGE_READONLY); 313 put_kernel_page(page, GATE_ADDR, PAGE_READONLY);
@@ -315,6 +316,20 @@ setup_gate (void)
315 put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE); 316 put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE);
316#else 317#else
317 put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE); 318 put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE);
319 /* Fill in the holes (if any) with read-only zero pages: */
320 {
321 unsigned long addr;
322
323 for (addr = GATE_ADDR + PAGE_SIZE;
324 addr < GATE_ADDR + PERCPU_PAGE_SIZE;
325 addr += PAGE_SIZE)
326 {
327 put_kernel_page(ZERO_PAGE(0), addr,
328 PAGE_READONLY);
329 put_kernel_page(ZERO_PAGE(0), addr + PERCPU_PAGE_SIZE,
330 PAGE_READONLY);
331 }
332 }
318#endif 333#endif
319 ia64_patch_gate(); 334 ia64_patch_gate();
320} 335}
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index e64cb8175f7a..44bfc7f318cb 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -222,7 +222,7 @@ void __init early_sn_setup(void)
222 222
223extern int platform_intr_list[]; 223extern int platform_intr_list[];
224extern nasid_t master_nasid; 224extern nasid_t master_nasid;
225static int shub_1_1_found __initdata; 225static int __initdata shub_1_1_found = 0;
226 226
227/* 227/*
228 * sn_check_for_wars 228 * sn_check_for_wars
@@ -251,7 +251,7 @@ static void __init sn_check_for_wars(void)
251 } else { 251 } else {
252 for_each_online_node(cnode) { 252 for_each_online_node(cnode) {
253 if (is_shub_1_1(cnodeid_to_nasid(cnode))) 253 if (is_shub_1_1(cnodeid_to_nasid(cnode)))
254 sn_hub_info->shub_1_1_found = 1; 254 shub_1_1_found = 1;
255 } 255 }
256 } 256 }
257} 257}
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig
index 7dbf997ff205..5649fbae430e 100644
--- a/arch/m68k/configs/amiga_defconfig
+++ b/arch/m68k/configs/amiga_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:05:59 2005 4# Tue Jun 7 20:34:23 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -135,7 +137,6 @@ CONFIG_PARPORT_1284=y
135# 137#
136CONFIG_AMIGA_FLOPPY=y 138CONFIG_AMIGA_FLOPPY=y
137CONFIG_AMIGA_Z2RAM=y 139CONFIG_AMIGA_Z2RAM=y
138# CONFIG_BLK_DEV_XD is not set
139# CONFIG_PARIDE is not set 140# CONFIG_PARIDE is not set
140# CONFIG_BLK_DEV_COW_COMMON is not set 141# CONFIG_BLK_DEV_COW_COMMON is not set
141CONFIG_BLK_DEV_LOOP=y 142CONFIG_BLK_DEV_LOOP=y
@@ -223,17 +224,12 @@ CONFIG_SCSI_CONSTANTS=y
223# 224#
224# SCSI low-level drivers 225# SCSI low-level drivers
225# 226#
226# CONFIG_SCSI_7000FASST is not set
227# CONFIG_SCSI_AHA152X is not set 227# CONFIG_SCSI_AHA152X is not set
228# CONFIG_SCSI_AHA1542 is not set
229# CONFIG_SCSI_AIC7XXX_OLD is not set 228# CONFIG_SCSI_AIC7XXX_OLD is not set
230# CONFIG_SCSI_IN2000 is not set 229# CONFIG_SCSI_IN2000 is not set
231# CONFIG_SCSI_SATA is not set 230# CONFIG_SCSI_SATA is not set
232# CONFIG_SCSI_BUSLOGIC is not set
233# CONFIG_SCSI_DTC3280 is not set 231# CONFIG_SCSI_DTC3280 is not set
234# CONFIG_SCSI_EATA is not set
235# CONFIG_SCSI_FUTURE_DOMAIN is not set 232# CONFIG_SCSI_FUTURE_DOMAIN is not set
236# CONFIG_SCSI_GDTH is not set
237# CONFIG_SCSI_GENERIC_NCR5380 is not set 233# CONFIG_SCSI_GENERIC_NCR5380 is not set
238# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set 234# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
239# CONFIG_SCSI_PPA is not set 235# CONFIG_SCSI_PPA is not set
@@ -244,7 +240,6 @@ CONFIG_SCSI_CONSTANTS=y
244# CONFIG_SCSI_QLOGIC_FAS is not set 240# CONFIG_SCSI_QLOGIC_FAS is not set
245# CONFIG_SCSI_SYM53C416 is not set 241# CONFIG_SCSI_SYM53C416 is not set
246# CONFIG_SCSI_T128 is not set 242# CONFIG_SCSI_T128 is not set
247# CONFIG_SCSI_U14_34F is not set
248# CONFIG_SCSI_DEBUG is not set 243# CONFIG_SCSI_DEBUG is not set
249CONFIG_A3000_SCSI=y 244CONFIG_A3000_SCSI=y
250CONFIG_A2091_SCSI=y 245CONFIG_A2091_SCSI=y
@@ -492,7 +487,6 @@ CONFIG_HYDRA=m
492CONFIG_ZORRO8390=m 487CONFIG_ZORRO8390=m
493CONFIG_APNE=m 488CONFIG_APNE=m
494# CONFIG_NET_VENDOR_3COM is not set 489# CONFIG_NET_VENDOR_3COM is not set
495# CONFIG_LANCE is not set
496# CONFIG_NET_VENDOR_SMC is not set 490# CONFIG_NET_VENDOR_SMC is not set
497# CONFIG_NET_VENDOR_RACAL is not set 491# CONFIG_NET_VENDOR_RACAL is not set
498# CONFIG_AT1700 is not set 492# CONFIG_AT1700 is not set
@@ -620,7 +614,6 @@ CONFIG_SERIO_SERPORT=m
620# CONFIG_SERIO_PARKBD is not set 614# CONFIG_SERIO_PARKBD is not set
621# CONFIG_SERIO_RAW is not set 615# CONFIG_SERIO_RAW is not set
622# CONFIG_GAMEPORT is not set 616# CONFIG_GAMEPORT is not set
623CONFIG_SOUND_GAMEPORT=y
624 617
625# 618#
626# Character devices 619# Character devices
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig
index 505a2968e604..63024b0b7ac3 100644
--- a/arch/m68k/configs/apollo_defconfig
+++ b/arch/m68k/configs/apollo_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:00 2005 4# Tue Jun 7 20:34:27 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -497,7 +499,6 @@ CONFIG_SERIO_SERPORT=m
497CONFIG_SERIO_LIBPS2=m 499CONFIG_SERIO_LIBPS2=m
498# CONFIG_SERIO_RAW is not set 500# CONFIG_SERIO_RAW is not set
499# CONFIG_GAMEPORT is not set 501# CONFIG_GAMEPORT is not set
500CONFIG_SOUND_GAMEPORT=y
501 502
502# 503#
503# Character devices 504# Character devices
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig
index 617aa73c3250..6433da2d2ce2 100644
--- a/arch/m68k/configs/atari_defconfig
+++ b/arch/m68k/configs/atari_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:18 2005 4# Tue Jun 7 20:34:32 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -531,7 +533,6 @@ CONFIG_SERIO_SERPORT=y
531CONFIG_SERIO_LIBPS2=y 533CONFIG_SERIO_LIBPS2=y
532# CONFIG_SERIO_RAW is not set 534# CONFIG_SERIO_RAW is not set
533# CONFIG_GAMEPORT is not set 535# CONFIG_GAMEPORT is not set
534CONFIG_SOUND_GAMEPORT=y
535 536
536# 537#
537# Character devices 538# Character devices
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig
index b501db51d9ec..da2a23a21463 100644
--- a/arch/m68k/configs/bvme6000_defconfig
+++ b/arch/m68k/configs/bvme6000_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:19 2005 4# Tue Jun 7 20:34:37 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -496,7 +498,6 @@ CONFIG_SERIO_SERPORT=m
496CONFIG_SERIO_LIBPS2=m 498CONFIG_SERIO_LIBPS2=m
497# CONFIG_SERIO_RAW is not set 499# CONFIG_SERIO_RAW is not set
498# CONFIG_GAMEPORT is not set 500# CONFIG_GAMEPORT is not set
499CONFIG_SOUND_GAMEPORT=y
500 501
501# 502#
502# Character devices 503# Character devices
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig
index 2bf6cef4f2b2..51251883adf8 100644
--- a/arch/m68k/configs/hp300_defconfig
+++ b/arch/m68k/configs/hp300_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:21 2005 4# Tue Jun 7 20:34:41 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -498,7 +500,6 @@ CONFIG_SERIO_SERPORT=m
498CONFIG_SERIO_LIBPS2=m 500CONFIG_SERIO_LIBPS2=m
499# CONFIG_SERIO_RAW is not set 501# CONFIG_SERIO_RAW is not set
500# CONFIG_GAMEPORT is not set 502# CONFIG_GAMEPORT is not set
501CONFIG_SOUND_GAMEPORT=y
502 503
503# 504#
504# Character devices 505# Character devices
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig
index 7074f856820c..15b80abfe94a 100644
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:24 2005 4# Tue Jun 7 20:34:45 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -540,7 +542,6 @@ CONFIG_SERIO_SERPORT=m
540CONFIG_SERIO_LIBPS2=m 542CONFIG_SERIO_LIBPS2=m
541# CONFIG_SERIO_RAW is not set 543# CONFIG_SERIO_RAW is not set
542# CONFIG_GAMEPORT is not set 544# CONFIG_GAMEPORT is not set
543CONFIG_SOUND_GAMEPORT=y
544 545
545# 546#
546# Character devices 547# Character devices
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig
index 61f09bc4846a..f0d5534f6830 100644
--- a/arch/m68k/configs/mvme147_defconfig
+++ b/arch/m68k/configs/mvme147_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:28 2005 4# Tue Jun 7 20:34:50 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -498,7 +500,6 @@ CONFIG_SERIO_SERPORT=m
498CONFIG_SERIO_LIBPS2=m 500CONFIG_SERIO_LIBPS2=m
499# CONFIG_SERIO_RAW is not set 501# CONFIG_SERIO_RAW is not set
500# CONFIG_GAMEPORT is not set 502# CONFIG_GAMEPORT is not set
501CONFIG_SOUND_GAMEPORT=y
502 503
503# 504#
504# Character devices 505# Character devices
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig
index 69c01004ec41..1d5c46ff3c81 100644
--- a/arch/m68k/configs/mvme16x_defconfig
+++ b/arch/m68k/configs/mvme16x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:31 2005 4# Tue Jun 7 20:34:53 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -497,7 +499,6 @@ CONFIG_SERIO_SERPORT=m
497CONFIG_SERIO_LIBPS2=m 499CONFIG_SERIO_LIBPS2=m
498# CONFIG_SERIO_RAW is not set 500# CONFIG_SERIO_RAW is not set
499# CONFIG_GAMEPORT is not set 501# CONFIG_GAMEPORT is not set
500CONFIG_SOUND_GAMEPORT=y
501 502
502# 503#
503# Character devices 504# Character devices
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig
index 550ec26006c1..856238634d42 100644
--- a/arch/m68k/configs/q40_defconfig
+++ b/arch/m68k/configs/q40_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:34 2005 4# Tue Jun 7 20:34:58 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -125,7 +127,6 @@ CONFIG_FW_LOADER=m
125# Block devices 127# Block devices
126# 128#
127# CONFIG_BLK_DEV_FD is not set 129# CONFIG_BLK_DEV_FD is not set
128# CONFIG_BLK_DEV_XD is not set
129# CONFIG_BLK_DEV_COW_COMMON is not set 130# CONFIG_BLK_DEV_COW_COMMON is not set
130CONFIG_BLK_DEV_LOOP=y 131CONFIG_BLK_DEV_LOOP=y
131CONFIG_BLK_DEV_CRYPTOLOOP=m 132CONFIG_BLK_DEV_CRYPTOLOOP=m
@@ -210,17 +211,12 @@ CONFIG_SCSI_CONSTANTS=y
210# 211#
211# SCSI low-level drivers 212# SCSI low-level drivers
212# 213#
213# CONFIG_SCSI_7000FASST is not set
214# CONFIG_SCSI_AHA152X is not set 214# CONFIG_SCSI_AHA152X is not set
215# CONFIG_SCSI_AHA1542 is not set
216# CONFIG_SCSI_AIC7XXX_OLD is not set 215# CONFIG_SCSI_AIC7XXX_OLD is not set
217# CONFIG_SCSI_IN2000 is not set 216# CONFIG_SCSI_IN2000 is not set
218# CONFIG_SCSI_SATA is not set 217# CONFIG_SCSI_SATA is not set
219# CONFIG_SCSI_BUSLOGIC is not set
220# CONFIG_SCSI_DTC3280 is not set 218# CONFIG_SCSI_DTC3280 is not set
221# CONFIG_SCSI_EATA is not set
222# CONFIG_SCSI_FUTURE_DOMAIN is not set 219# CONFIG_SCSI_FUTURE_DOMAIN is not set
223# CONFIG_SCSI_GDTH is not set
224# CONFIG_SCSI_GENERIC_NCR5380 is not set 220# CONFIG_SCSI_GENERIC_NCR5380 is not set
225# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set 221# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
226# CONFIG_SCSI_NCR53C406A is not set 222# CONFIG_SCSI_NCR53C406A is not set
@@ -229,7 +225,6 @@ CONFIG_SCSI_CONSTANTS=y
229# CONFIG_SCSI_QLOGIC_FAS is not set 225# CONFIG_SCSI_QLOGIC_FAS is not set
230# CONFIG_SCSI_SYM53C416 is not set 226# CONFIG_SCSI_SYM53C416 is not set
231# CONFIG_SCSI_T128 is not set 227# CONFIG_SCSI_T128 is not set
232# CONFIG_SCSI_U14_34F is not set
233# CONFIG_SCSI_DEBUG is not set 228# CONFIG_SCSI_DEBUG is not set
234 229
235# 230#
@@ -466,7 +461,6 @@ CONFIG_EQUALIZER=m
466CONFIG_NET_ETHERNET=y 461CONFIG_NET_ETHERNET=y
467CONFIG_MII=m 462CONFIG_MII=m
468# CONFIG_NET_VENDOR_3COM is not set 463# CONFIG_NET_VENDOR_3COM is not set
469# CONFIG_LANCE is not set
470# CONFIG_NET_VENDOR_SMC is not set 464# CONFIG_NET_VENDOR_SMC is not set
471# CONFIG_NET_VENDOR_RACAL is not set 465# CONFIG_NET_VENDOR_RACAL is not set
472# CONFIG_AT1700 is not set 466# CONFIG_AT1700 is not set
@@ -570,7 +564,6 @@ CONFIG_SERIO_Q40KBD=m
570CONFIG_SERIO_LIBPS2=m 564CONFIG_SERIO_LIBPS2=m
571# CONFIG_SERIO_RAW is not set 565# CONFIG_SERIO_RAW is not set
572# CONFIG_GAMEPORT is not set 566# CONFIG_GAMEPORT is not set
573CONFIG_SOUND_GAMEPORT=y
574 567
575# 568#
576# Character devices 569# Character devices
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig
index 5b5a619645aa..af903b5c5708 100644
--- a/arch/m68k/configs/sun3_defconfig
+++ b/arch/m68k/configs/sun3_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:37 2005 4# Tue Jun 7 20:35:02 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -171,7 +173,6 @@ CONFIG_SCSI_CONSTANTS=y
171# 173#
172# CONFIG_SCSI_SATA is not set 174# CONFIG_SCSI_SATA is not set
173# CONFIG_SCSI_DEBUG is not set 175# CONFIG_SCSI_DEBUG is not set
174CONFIG_SUN3_SCSI=y
175 176
176# 177#
177# Multi-device support (RAID and LVM) 178# Multi-device support (RAID and LVM)
@@ -487,7 +488,6 @@ CONFIG_SERIO_SERPORT=m
487CONFIG_SERIO_LIBPS2=m 488CONFIG_SERIO_LIBPS2=m
488# CONFIG_SERIO_RAW is not set 489# CONFIG_SERIO_RAW is not set
489# CONFIG_GAMEPORT is not set 490# CONFIG_GAMEPORT is not set
490CONFIG_SOUND_GAMEPORT=y
491 491
492# 492#
493# Character devices 493# Character devices
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig
index 704e42344cba..997143b7928a 100644
--- a/arch/m68k/configs/sun3x_defconfig
+++ b/arch/m68k/configs/sun3x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:40 2005 4# Tue Jun 7 20:35:06 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -497,7 +499,6 @@ CONFIG_SERIO_SERPORT=m
497CONFIG_SERIO_LIBPS2=m 499CONFIG_SERIO_LIBPS2=m
498# CONFIG_SERIO_RAW is not set 500# CONFIG_SERIO_RAW is not set
499# CONFIG_GAMEPORT is not set 501# CONFIG_GAMEPORT is not set
500CONFIG_SOUND_GAMEPORT=y
501 502
502# 503#
503# Character devices 504# Character devices
diff --git a/arch/m68k/defconfig b/arch/m68k/defconfig
index 5b2296ecba82..7d935e48a9a8 100644
--- a/arch/m68k/defconfig
+++ b/arch/m68k/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:05:31 2005 4# Tue Jun 7 20:34:17 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -33,6 +33,8 @@ CONFIG_KOBJECT_UEVENT=y
33# CONFIG_EMBEDDED is not set 33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y 34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
36CONFIG_BASE_FULL=y 38CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y 39CONFIG_FUTEX=y
38CONFIG_EPOLL=y 40CONFIG_EPOLL=y
@@ -355,7 +357,6 @@ CONFIG_SERIO_SERPORT=y
355CONFIG_SERIO_LIBPS2=y 357CONFIG_SERIO_LIBPS2=y
356# CONFIG_SERIO_RAW is not set 358# CONFIG_SERIO_RAW is not set
357# CONFIG_GAMEPORT is not set 359# CONFIG_GAMEPORT is not set
358CONFIG_SOUND_GAMEPORT=y
359 360
360# 361#
361# Character devices 362# Character devices
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 2b6c9d32b7a6..c4a33f265dc0 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -45,11 +45,13 @@ asmlinkage void ret_from_fork(void);
45 */ 45 */
46void default_idle(void) 46void default_idle(void)
47{ 47{
48 while(1) { 48 local_irq_disable();
49 if (need_resched()) 49 while (!need_resched()) {
50 __asm__("stop #0x2000" : : : "cc"); 50 /* This stop will re-enable interrupts */
51 schedule(); 51 __asm__("stop #0x2000" : : : "cc");
52 local_irq_disable();
52 } 53 }
54 local_irq_enable();
53} 55}
54 56
55void (*idle)(void) = default_idle; 57void (*idle)(void) = default_idle;
@@ -63,7 +65,12 @@ void (*idle)(void) = default_idle;
63void cpu_idle(void) 65void cpu_idle(void)
64{ 66{
65 /* endless idle loop with no priority at all */ 67 /* endless idle loop with no priority at all */
66 idle(); 68 while (1) {
69 idle();
70 preempt_enable_no_resched();
71 schedule();
72 preempt_disable();
73 }
67} 74}
68 75
69void machine_restart(char * __unused) 76void machine_restart(char * __unused)
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 8aa5e8c69009..d44b7dc5390a 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -838,6 +838,17 @@ struct cpu_spec cpu_specs[] = {
838 .icache_bsize = 32, 838 .icache_bsize = 32,
839 .dcache_bsize = 32, 839 .dcache_bsize = 32,
840 }, 840 },
841 { /* 405EP */
842 .pvr_mask = 0xffff0000,
843 .pvr_value = 0x51210000,
844 .cpu_name = "405EP",
845 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
846 CPU_FTR_USE_TB,
847 .cpu_user_features = PPC_FEATURE_32 |
848 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
849 .icache_bsize = 32,
850 .dcache_bsize = 32,
851 },
841 852
842#endif /* CONFIG_40x */ 853#endif /* CONFIG_40x */
843#ifdef CONFIG_44x 854#ifdef CONFIG_44x
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index e4f1615ec13f..7329ef177a18 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -619,7 +619,7 @@ _GLOBAL(flush_instruction_cache)
619_GLOBAL(flush_icache_range) 619_GLOBAL(flush_icache_range)
620BEGIN_FTR_SECTION 620BEGIN_FTR_SECTION
621 blr /* for 601, do nothing */ 621 blr /* for 601, do nothing */
622END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 622END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
623 li r5,L1_CACHE_LINE_SIZE-1 623 li r5,L1_CACHE_LINE_SIZE-1
624 andc r3,r3,r5 624 andc r3,r3,r5
625 subf r4,r3,r4 625 subf r4,r3,r4
@@ -736,7 +736,7 @@ _GLOBAL(flush_dcache_all)
736_GLOBAL(__flush_dcache_icache) 736_GLOBAL(__flush_dcache_icache)
737BEGIN_FTR_SECTION 737BEGIN_FTR_SECTION
738 blr /* for 601, do nothing */ 738 blr /* for 601, do nothing */
739END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 739END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
740 rlwinm r3,r3,0,0,19 /* Get page base address */ 740 rlwinm r3,r3,0,0,19 /* Get page base address */
741 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ 741 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */
742 mtctr r4 742 mtctr r4
@@ -764,7 +764,7 @@ END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE)
764_GLOBAL(__flush_dcache_icache_phys) 764_GLOBAL(__flush_dcache_icache_phys)
765BEGIN_FTR_SECTION 765BEGIN_FTR_SECTION
766 blr /* for 601, do nothing */ 766 blr /* for 601, do nothing */
767END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 767END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
768 mfmsr r10 768 mfmsr r10
769 rlwinm r0,r10,0,28,26 /* clear DR */ 769 rlwinm r0,r10,0,28,26 /* clear DR */
770 mtmsr r0 770 mtmsr r0
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
index 937f46df711e..5fdd4f607a40 100644
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -83,7 +83,7 @@ static u32 frequency_gpio;
83static u32 slew_done_gpio; 83static u32 slew_done_gpio;
84static int no_schedule; 84static int no_schedule;
85static int has_cpu_l2lve; 85static int has_cpu_l2lve;
86 86static int is_pmu_based;
87 87
88/* There are only two frequency states for each processor. Values 88/* There are only two frequency states for each processor. Values
89 * are in kHz for the time being. 89 * are in kHz for the time being.
@@ -463,7 +463,7 @@ static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, u32 state)
463 */ 463 */
464 no_schedule = 1; 464 no_schedule = 1;
465 sleep_freq = cur_freq; 465 sleep_freq = cur_freq;
466 if (cur_freq == low_freq) 466 if (cur_freq == low_freq && !is_pmu_based)
467 do_set_cpu_speed(CPUFREQ_HIGH, 0); 467 do_set_cpu_speed(CPUFREQ_HIGH, 0);
468 return 0; 468 return 0;
469} 469}
@@ -588,6 +588,7 @@ static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
588 return 1; 588 return 1;
589 hi_freq = (*value) / 1000; 589 hi_freq = (*value) / 1000;
590 set_speed_proc = pmu_set_cpu_speed; 590 set_speed_proc = pmu_set_cpu_speed;
591 is_pmu_based = 1;
591 592
592 return 0; 593 return 0;
593} 594}
@@ -692,6 +693,7 @@ static int __init pmac_cpufreq_setup(void)
692 hi_freq = cur_freq; 693 hi_freq = cur_freq;
693 low_freq = 400000; 694 low_freq = 400000;
694 set_speed_proc = pmu_set_cpu_speed; 695 set_speed_proc = pmu_set_cpu_speed;
696 is_pmu_based = 1;
695 } 697 }
696 /* Else check for TiPb 400 & 500 */ 698 /* Else check for TiPb 400 & 500 */
697 else if (machine_is_compatible("PowerBook3,2")) { 699 else if (machine_is_compatible("PowerBook3,2")) {
@@ -703,6 +705,7 @@ static int __init pmac_cpufreq_setup(void)
703 hi_freq = cur_freq; 705 hi_freq = cur_freq;
704 low_freq = 300000; 706 low_freq = 300000;
705 set_speed_proc = pmu_set_cpu_speed; 707 set_speed_proc = pmu_set_cpu_speed;
708 is_pmu_based = 1;
706 } 709 }
707 /* Else check for 750FX */ 710 /* Else check for 750FX */
708 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000) 711 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000)
diff --git a/arch/ppc64/boot/prom.c b/arch/ppc64/boot/prom.c
index 7b607d1862cb..d5218b15824e 100644
--- a/arch/ppc64/boot/prom.c
+++ b/arch/ppc64/boot/prom.c
@@ -11,6 +11,23 @@
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/ctype.h> 12#include <linux/ctype.h>
13 13
14extern __u32 __div64_32(unsigned long long *dividend, __u32 divisor);
15
16/* The unnecessary pointer compare is there
17 * to check for type safety (n must be 64bit)
18 */
19# define do_div(n,base) ({ \
20 __u32 __base = (base); \
21 __u32 __rem; \
22 (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \
23 if (((n) >> 32) == 0) { \
24 __rem = (__u32)(n) % __base; \
25 (n) = (__u32)(n) / __base; \
26 } else \
27 __rem = __div64_32(&(n), __base); \
28 __rem; \
29 })
30
14int (*prom)(void *); 31int (*prom)(void *);
15 32
16void *chosen_handle; 33void *chosen_handle;
@@ -352,7 +369,7 @@ static int skip_atoi(const char **s)
352#define SPECIAL 32 /* 0x */ 369#define SPECIAL 32 /* 0x */
353#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ 370#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
354 371
355static char * number(char * str, long num, int base, int size, int precision, int type) 372static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
356{ 373{
357 char c,sign,tmp[66]; 374 char c,sign,tmp[66];
358 const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; 375 const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
@@ -367,9 +384,9 @@ static char * number(char * str, long num, int base, int size, int precision, in
367 c = (type & ZEROPAD) ? '0' : ' '; 384 c = (type & ZEROPAD) ? '0' : ' ';
368 sign = 0; 385 sign = 0;
369 if (type & SIGN) { 386 if (type & SIGN) {
370 if (num < 0) { 387 if ((signed long long)num < 0) {
371 sign = '-'; 388 sign = '-';
372 num = -num; 389 num = - (signed long long)num;
373 size--; 390 size--;
374 } else if (type & PLUS) { 391 } else if (type & PLUS) {
375 sign = '+'; 392 sign = '+';
@@ -389,8 +406,7 @@ static char * number(char * str, long num, int base, int size, int precision, in
389 if (num == 0) 406 if (num == 0)
390 tmp[i++]='0'; 407 tmp[i++]='0';
391 else while (num != 0) { 408 else while (num != 0) {
392 tmp[i++] = digits[num % base]; 409 tmp[i++] = digits[do_div(num, base)];
393 num /= base;
394 } 410 }
395 if (i > precision) 411 if (i > precision)
396 precision = i; 412 precision = i;
@@ -426,7 +442,7 @@ int sprintf(char * buf, const char *fmt, ...);
426int vsprintf(char *buf, const char *fmt, va_list args) 442int vsprintf(char *buf, const char *fmt, va_list args)
427{ 443{
428 int len; 444 int len;
429 unsigned long num; 445 unsigned long long num;
430 int i, base; 446 int i, base;
431 char * str; 447 char * str;
432 const char *s; 448 const char *s;
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig
index 0f90df0b3f9c..1eb33398648e 100644
--- a/arch/ppc64/configs/g5_defconfig
+++ b/arch/ppc64/configs/g5_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11 3# Linux kernel version: 2.6.12-rc6
4# Thu Mar 10 16:47:04 2005 4# Tue Jun 14 16:59:20 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -31,19 +32,20 @@ CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
34CONFIG_LOG_BUF_SHIFT=17
35CONFIG_HOTPLUG=y 35CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
37CONFIG_IKCONFIG=y 37CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 38CONFIG_IKCONFIG_PROC=y
39# CONFIG_CPUSETS is not set
39# CONFIG_EMBEDDED is not set 40# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
41# CONFIG_KALLSYMS_ALL is not set 42# CONFIG_KALLSYMS_ALL is not set
42# CONFIG_KALLSYMS_EXTRA_PASS is not set 43# CONFIG_KALLSYMS_EXTRA_PASS is not set
44CONFIG_PRINTK=y
45CONFIG_BUG=y
43CONFIG_BASE_FULL=y 46CONFIG_BASE_FULL=y
44CONFIG_FUTEX=y 47CONFIG_FUTEX=y
45CONFIG_EPOLL=y 48CONFIG_EPOLL=y
46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
47CONFIG_SHMEM=y 49CONFIG_SHMEM=y
48CONFIG_CC_ALIGN_FUNCTIONS=0 50CONFIG_CC_ALIGN_FUNCTIONS=0
49CONFIG_CC_ALIGN_LABELS=0 51CONFIG_CC_ALIGN_LABELS=0
@@ -87,6 +89,8 @@ CONFIG_NR_CPUS=2
87# CONFIG_SCHED_SMT is not set 89# CONFIG_SCHED_SMT is not set
88# CONFIG_PREEMPT is not set 90# CONFIG_PREEMPT is not set
89CONFIG_GENERIC_HARDIRQS=y 91CONFIG_GENERIC_HARDIRQS=y
92CONFIG_SECCOMP=y
93CONFIG_ISA_DMA_API=y
90 94
91# 95#
92# General setup 96# General setup
@@ -97,6 +101,7 @@ CONFIG_BINFMT_ELF=y
97# CONFIG_BINFMT_MISC is not set 101# CONFIG_BINFMT_MISC is not set
98CONFIG_PCI_LEGACY_PROC=y 102CONFIG_PCI_LEGACY_PROC=y
99CONFIG_PCI_NAMES=y 103CONFIG_PCI_NAMES=y
104# CONFIG_PCI_DEBUG is not set
100# CONFIG_HOTPLUG_CPU is not set 105# CONFIG_HOTPLUG_CPU is not set
101 106
102# 107#
@@ -105,10 +110,6 @@ CONFIG_PCI_NAMES=y
105# CONFIG_PCCARD is not set 110# CONFIG_PCCARD is not set
106 111
107# 112#
108# PC-card bridges
109#
110
111#
112# PCI Hotplug Support 113# PCI Hotplug Support
113# 114#
114# CONFIG_HOTPLUG_PCI is not set 115# CONFIG_HOTPLUG_PCI is not set
@@ -293,7 +294,6 @@ CONFIG_SCSI_SATA_SVW=y
293# CONFIG_SCSI_BUSLOGIC is not set 294# CONFIG_SCSI_BUSLOGIC is not set
294# CONFIG_SCSI_DMX3191D is not set 295# CONFIG_SCSI_DMX3191D is not set
295# CONFIG_SCSI_EATA is not set 296# CONFIG_SCSI_EATA is not set
296# CONFIG_SCSI_EATA_PIO is not set
297# CONFIG_SCSI_FUTURE_DOMAIN is not set 297# CONFIG_SCSI_FUTURE_DOMAIN is not set
298# CONFIG_SCSI_GDTH is not set 298# CONFIG_SCSI_GDTH is not set
299# CONFIG_SCSI_IPS is not set 299# CONFIG_SCSI_IPS is not set
@@ -301,7 +301,6 @@ CONFIG_SCSI_SATA_SVW=y
301# CONFIG_SCSI_INIA100 is not set 301# CONFIG_SCSI_INIA100 is not set
302# CONFIG_SCSI_SYM53C8XX_2 is not set 302# CONFIG_SCSI_SYM53C8XX_2 is not set
303# CONFIG_SCSI_IPR is not set 303# CONFIG_SCSI_IPR is not set
304# CONFIG_SCSI_QLOGIC_ISP is not set
305# CONFIG_SCSI_QLOGIC_FC is not set 304# CONFIG_SCSI_QLOGIC_FC is not set
306# CONFIG_SCSI_QLOGIC_1280 is not set 305# CONFIG_SCSI_QLOGIC_1280 is not set
307CONFIG_SCSI_QLA2XXX=y 306CONFIG_SCSI_QLA2XXX=y
@@ -310,6 +309,7 @@ CONFIG_SCSI_QLA2XXX=y
310# CONFIG_SCSI_QLA2300 is not set 309# CONFIG_SCSI_QLA2300 is not set
311# CONFIG_SCSI_QLA2322 is not set 310# CONFIG_SCSI_QLA2322 is not set
312# CONFIG_SCSI_QLA6312 is not set 311# CONFIG_SCSI_QLA6312 is not set
312# CONFIG_SCSI_LPFC is not set
313# CONFIG_SCSI_DC395x is not set 313# CONFIG_SCSI_DC395x is not set
314# CONFIG_SCSI_DC390T is not set 314# CONFIG_SCSI_DC390T is not set
315# CONFIG_SCSI_DEBUG is not set 315# CONFIG_SCSI_DEBUG is not set
@@ -332,6 +332,7 @@ CONFIG_DM_CRYPT=m
332CONFIG_DM_SNAPSHOT=m 332CONFIG_DM_SNAPSHOT=m
333CONFIG_DM_MIRROR=m 333CONFIG_DM_MIRROR=m
334CONFIG_DM_ZERO=m 334CONFIG_DM_ZERO=m
335# CONFIG_DM_MULTIPATH is not set
335 336
336# 337#
337# Fusion MPT device support 338# Fusion MPT device support
@@ -394,7 +395,6 @@ CONFIG_NET=y
394# 395#
395CONFIG_PACKET=y 396CONFIG_PACKET=y
396# CONFIG_PACKET_MMAP is not set 397# CONFIG_PACKET_MMAP is not set
397# CONFIG_NETLINK_DEV is not set
398CONFIG_UNIX=y 398CONFIG_UNIX=y
399CONFIG_NET_KEY=m 399CONFIG_NET_KEY=m
400CONFIG_INET=y 400CONFIG_INET=y
@@ -564,6 +564,8 @@ CONFIG_E1000=y
564# CONFIG_R8169 is not set 564# CONFIG_R8169 is not set
565# CONFIG_SK98LIN is not set 565# CONFIG_SK98LIN is not set
566CONFIG_TIGON3=m 566CONFIG_TIGON3=m
567# CONFIG_BNX2 is not set
568# CONFIG_MV643XX_ETH is not set
567 569
568# 570#
569# Ethernet (10000 Mbit) 571# Ethernet (10000 Mbit)
@@ -631,18 +633,6 @@ CONFIG_INPUT_EVDEV=y
631# CONFIG_INPUT_EVBUG is not set 633# CONFIG_INPUT_EVBUG is not set
632 634
633# 635#
634# Input I/O drivers
635#
636# CONFIG_GAMEPORT is not set
637CONFIG_SOUND_GAMEPORT=y
638CONFIG_SERIO=y
639# CONFIG_SERIO_I8042 is not set
640# CONFIG_SERIO_SERPORT is not set
641# CONFIG_SERIO_CT82C710 is not set
642# CONFIG_SERIO_PCIPS2 is not set
643# CONFIG_SERIO_RAW is not set
644
645#
646# Input Device Drivers 636# Input Device Drivers
647# 637#
648CONFIG_INPUT_KEYBOARD=y 638CONFIG_INPUT_KEYBOARD=y
@@ -660,6 +650,16 @@ CONFIG_INPUT_MOUSE=y
660# CONFIG_INPUT_MISC is not set 650# CONFIG_INPUT_MISC is not set
661 651
662# 652#
653# Hardware I/O ports
654#
655CONFIG_SERIO=y
656# CONFIG_SERIO_I8042 is not set
657# CONFIG_SERIO_SERPORT is not set
658# CONFIG_SERIO_PCIPS2 is not set
659# CONFIG_SERIO_RAW is not set
660# CONFIG_GAMEPORT is not set
661
662#
663# Character devices 663# Character devices
664# 664#
665CONFIG_VT=y 665CONFIG_VT=y
@@ -676,6 +676,7 @@ CONFIG_HW_CONSOLE=y
676# Non-8250 serial port support 676# Non-8250 serial port support
677# 677#
678# CONFIG_SERIAL_PMACZILOG is not set 678# CONFIG_SERIAL_PMACZILOG is not set
679# CONFIG_SERIAL_JSM is not set
679CONFIG_UNIX98_PTYS=y 680CONFIG_UNIX98_PTYS=y
680CONFIG_LEGACY_PTYS=y 681CONFIG_LEGACY_PTYS=y
681CONFIG_LEGACY_PTY_COUNT=256 682CONFIG_LEGACY_PTY_COUNT=256
@@ -698,9 +699,12 @@ CONFIG_LEGACY_PTY_COUNT=256
698# 699#
699# Ftape, the floppy tape device driver 700# Ftape, the floppy tape device driver
700# 701#
702CONFIG_AGP=m
703CONFIG_AGP_UNINORTH=m
701# CONFIG_DRM is not set 704# CONFIG_DRM is not set
702CONFIG_RAW_DRIVER=y 705CONFIG_RAW_DRIVER=y
703CONFIG_MAX_RAW_DEVS=256 706CONFIG_MAX_RAW_DEVS=256
707# CONFIG_HANGCHECK_TIMER is not set
704 708
705# 709#
706# TPM devices 710# TPM devices
@@ -730,12 +734,11 @@ CONFIG_I2C_ALGOBIT=y
730# CONFIG_I2C_AMD8111 is not set 734# CONFIG_I2C_AMD8111 is not set
731# CONFIG_I2C_I801 is not set 735# CONFIG_I2C_I801 is not set
732# CONFIG_I2C_I810 is not set 736# CONFIG_I2C_I810 is not set
737# CONFIG_I2C_PIIX4 is not set
733# CONFIG_I2C_ISA is not set 738# CONFIG_I2C_ISA is not set
734CONFIG_I2C_KEYWEST=y 739CONFIG_I2C_KEYWEST=y
735# CONFIG_I2C_MPC is not set
736# CONFIG_I2C_NFORCE2 is not set 740# CONFIG_I2C_NFORCE2 is not set
737# CONFIG_I2C_PARPORT_LIGHT is not set 741# CONFIG_I2C_PARPORT_LIGHT is not set
738# CONFIG_I2C_PIIX4 is not set
739# CONFIG_I2C_PROSAVAGE is not set 742# CONFIG_I2C_PROSAVAGE is not set
740# CONFIG_I2C_SAVAGE4 is not set 743# CONFIG_I2C_SAVAGE4 is not set
741# CONFIG_SCx200_ACB is not set 744# CONFIG_SCx200_ACB is not set
@@ -772,6 +775,7 @@ CONFIG_I2C_KEYWEST=y
772# CONFIG_SENSORS_LM85 is not set 775# CONFIG_SENSORS_LM85 is not set
773# CONFIG_SENSORS_LM87 is not set 776# CONFIG_SENSORS_LM87 is not set
774# CONFIG_SENSORS_LM90 is not set 777# CONFIG_SENSORS_LM90 is not set
778# CONFIG_SENSORS_LM92 is not set
775# CONFIG_SENSORS_MAX1619 is not set 779# CONFIG_SENSORS_MAX1619 is not set
776# CONFIG_SENSORS_PC87360 is not set 780# CONFIG_SENSORS_PC87360 is not set
777# CONFIG_SENSORS_SMSC47B397 is not set 781# CONFIG_SENSORS_SMSC47B397 is not set
@@ -785,6 +789,7 @@ CONFIG_I2C_KEYWEST=y
785# 789#
786# Other I2C Chip support 790# Other I2C Chip support
787# 791#
792# CONFIG_SENSORS_DS1337 is not set
788# CONFIG_SENSORS_EEPROM is not set 793# CONFIG_SENSORS_EEPROM is not set
789# CONFIG_SENSORS_PCF8574 is not set 794# CONFIG_SENSORS_PCF8574 is not set
790# CONFIG_SENSORS_PCF8591 is not set 795# CONFIG_SENSORS_PCF8591 is not set
@@ -817,6 +822,11 @@ CONFIG_I2C_KEYWEST=y
817# Graphics support 822# Graphics support
818# 823#
819CONFIG_FB=y 824CONFIG_FB=y
825CONFIG_FB_CFB_FILLRECT=y
826CONFIG_FB_CFB_COPYAREA=y
827CONFIG_FB_CFB_IMAGEBLIT=y
828CONFIG_FB_SOFT_CURSOR=y
829CONFIG_FB_MACMODES=y
820CONFIG_FB_MODE_HELPERS=y 830CONFIG_FB_MODE_HELPERS=y
821CONFIG_FB_TILEBLITTING=y 831CONFIG_FB_TILEBLITTING=y
822# CONFIG_FB_CIRRUS is not set 832# CONFIG_FB_CIRRUS is not set
@@ -830,6 +840,7 @@ CONFIG_FB_OF=y
830# CONFIG_FB_ASILIANT is not set 840# CONFIG_FB_ASILIANT is not set
831# CONFIG_FB_IMSTT is not set 841# CONFIG_FB_IMSTT is not set
832# CONFIG_FB_VGA16 is not set 842# CONFIG_FB_VGA16 is not set
843# CONFIG_FB_NVIDIA is not set
833CONFIG_FB_RIVA=y 844CONFIG_FB_RIVA=y
834# CONFIG_FB_RIVA_I2C is not set 845# CONFIG_FB_RIVA_I2C is not set
835# CONFIG_FB_RIVA_DEBUG is not set 846# CONFIG_FB_RIVA_DEBUG is not set
@@ -847,6 +858,7 @@ CONFIG_FB_RADEON_I2C=y
847# CONFIG_FB_3DFX is not set 858# CONFIG_FB_3DFX is not set
848# CONFIG_FB_VOODOO1 is not set 859# CONFIG_FB_VOODOO1 is not set
849# CONFIG_FB_TRIDENT is not set 860# CONFIG_FB_TRIDENT is not set
861# CONFIG_FB_S1D13XXX is not set
850# CONFIG_FB_VIRTUAL is not set 862# CONFIG_FB_VIRTUAL is not set
851 863
852# 864#
@@ -880,6 +892,8 @@ CONFIG_LCD_DEVICE=y
880# 892#
881# USB support 893# USB support
882# 894#
895CONFIG_USB_ARCH_HAS_HCD=y
896CONFIG_USB_ARCH_HAS_OHCI=y
883CONFIG_USB=y 897CONFIG_USB=y
884# CONFIG_USB_DEBUG is not set 898# CONFIG_USB_DEBUG is not set
885 899
@@ -890,8 +904,6 @@ CONFIG_USB_DEVICEFS=y
890# CONFIG_USB_BANDWIDTH is not set 904# CONFIG_USB_BANDWIDTH is not set
891# CONFIG_USB_DYNAMIC_MINORS is not set 905# CONFIG_USB_DYNAMIC_MINORS is not set
892# CONFIG_USB_OTG is not set 906# CONFIG_USB_OTG is not set
893CONFIG_USB_ARCH_HAS_HCD=y
894CONFIG_USB_ARCH_HAS_OHCI=y
895 907
896# 908#
897# USB Host Controller Drivers 909# USB Host Controller Drivers
@@ -917,7 +929,6 @@ CONFIG_USB_PRINTER=y
917# 929#
918CONFIG_USB_STORAGE=y 930CONFIG_USB_STORAGE=y
919# CONFIG_USB_STORAGE_DEBUG is not set 931# CONFIG_USB_STORAGE_DEBUG is not set
920CONFIG_USB_STORAGE_RW_DETECT=y
921CONFIG_USB_STORAGE_DATAFAB=y 932CONFIG_USB_STORAGE_DATAFAB=y
922CONFIG_USB_STORAGE_FREECOM=y 933CONFIG_USB_STORAGE_FREECOM=y
923CONFIG_USB_STORAGE_ISD200=y 934CONFIG_USB_STORAGE_ISD200=y
@@ -1004,8 +1015,10 @@ CONFIG_USB_MON=y
1004# 1015#
1005CONFIG_USB_SERIAL=m 1016CONFIG_USB_SERIAL=m
1006CONFIG_USB_SERIAL_GENERIC=y 1017CONFIG_USB_SERIAL_GENERIC=y
1018# CONFIG_USB_SERIAL_AIRPRIME is not set
1007CONFIG_USB_SERIAL_BELKIN=m 1019CONFIG_USB_SERIAL_BELKIN=m
1008CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m 1020CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
1021# CONFIG_USB_SERIAL_CP2101 is not set
1009CONFIG_USB_SERIAL_CYPRESS_M8=m 1022CONFIG_USB_SERIAL_CYPRESS_M8=m
1010CONFIG_USB_SERIAL_EMPEG=m 1023CONFIG_USB_SERIAL_EMPEG=m
1011CONFIG_USB_SERIAL_FTDI_SIO=m 1024CONFIG_USB_SERIAL_FTDI_SIO=m
@@ -1034,6 +1047,7 @@ CONFIG_USB_SERIAL_KLSI=m
1034CONFIG_USB_SERIAL_KOBIL_SCT=m 1047CONFIG_USB_SERIAL_KOBIL_SCT=m
1035CONFIG_USB_SERIAL_MCT_U232=m 1048CONFIG_USB_SERIAL_MCT_U232=m
1036CONFIG_USB_SERIAL_PL2303=m 1049CONFIG_USB_SERIAL_PL2303=m
1050# CONFIG_USB_SERIAL_HP4X is not set
1037CONFIG_USB_SERIAL_SAFE=m 1051CONFIG_USB_SERIAL_SAFE=m
1038CONFIG_USB_SERIAL_SAFE_PADDED=y 1052CONFIG_USB_SERIAL_SAFE_PADDED=y
1039CONFIG_USB_SERIAL_TI=m 1053CONFIG_USB_SERIAL_TI=m
@@ -1270,11 +1284,13 @@ CONFIG_OPROFILE=y
1270# 1284#
1271# Kernel hacking 1285# Kernel hacking
1272# 1286#
1287# CONFIG_PRINTK_TIME is not set
1273CONFIG_DEBUG_KERNEL=y 1288CONFIG_DEBUG_KERNEL=y
1274CONFIG_MAGIC_SYSRQ=y 1289CONFIG_MAGIC_SYSRQ=y
1275# CONFIG_PRINTK_TIME is not set 1290CONFIG_LOG_BUF_SHIFT=17
1276# CONFIG_SCHEDSTATS is not set 1291# CONFIG_SCHEDSTATS is not set
1277# CONFIG_DEBUG_SLAB is not set 1292# CONFIG_DEBUG_SLAB is not set
1293# CONFIG_DEBUG_SPINLOCK is not set
1278# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1294# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1279# CONFIG_DEBUG_KOBJECT is not set 1295# CONFIG_DEBUG_KOBJECT is not set
1280# CONFIG_DEBUG_INFO is not set 1296# CONFIG_DEBUG_INFO is not set
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig
index a39e9d2e25da..f6a2b99afd63 100644
--- a/arch/ppc64/configs/iSeries_defconfig
+++ b/arch/ppc64/configs/iSeries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc6
4# Wed Feb 9 23:34:52 2005 4# Tue Jun 14 17:01:28 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,29 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34CONFIG_AUDIT=y
35CONFIG_AUDITSYSCALL=y
34CONFIG_HOTPLUG=y 36CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y 37CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 38CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 39CONFIG_IKCONFIG_PROC=y
40# CONFIG_CPUSETS is not set
38# CONFIG_EMBEDDED is not set 41# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 42CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set 43# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 44# CONFIG_KALLSYMS_EXTRA_PASS is not set
45CONFIG_PRINTK=y
46CONFIG_BUG=y
47CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 48CONFIG_FUTEX=y
43CONFIG_EPOLL=y 49CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 50CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 51CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 52CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 53CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 54CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 55# CONFIG_TINY_SHMEM is not set
56CONFIG_BASE_SMALL=0
51 57
52# 58#
53# Loadable module support 59# Loadable module support
@@ -79,6 +85,8 @@ CONFIG_NR_CPUS=32
79CONFIG_GENERIC_HARDIRQS=y 85CONFIG_GENERIC_HARDIRQS=y
80CONFIG_MSCHUNKS=y 86CONFIG_MSCHUNKS=y
81CONFIG_LPARCFG=y 87CONFIG_LPARCFG=y
88CONFIG_SECCOMP=y
89CONFIG_ISA_DMA_API=y
82 90
83# 91#
84# General setup 92# General setup
@@ -89,6 +97,7 @@ CONFIG_BINFMT_ELF=y
89# CONFIG_BINFMT_MISC is not set 97# CONFIG_BINFMT_MISC is not set
90CONFIG_PCI_LEGACY_PROC=y 98CONFIG_PCI_LEGACY_PROC=y
91CONFIG_PCI_NAMES=y 99CONFIG_PCI_NAMES=y
100# CONFIG_PCI_DEBUG is not set
92 101
93# 102#
94# PCCARD (PCMCIA/CardBus) support 103# PCCARD (PCMCIA/CardBus) support
@@ -96,10 +105,6 @@ CONFIG_PCI_NAMES=y
96# CONFIG_PCCARD is not set 105# CONFIG_PCCARD is not set
97 106
98# 107#
99# PC-card bridges
100#
101
102#
103# PCI Hotplug Support 108# PCI Hotplug Support
104# 109#
105# CONFIG_HOTPLUG_PCI is not set 110# CONFIG_HOTPLUG_PCI is not set
@@ -210,7 +215,6 @@ CONFIG_SCSI_FC_ATTRS=y
210# CONFIG_SCSI_BUSLOGIC is not set 215# CONFIG_SCSI_BUSLOGIC is not set
211# CONFIG_SCSI_DMX3191D is not set 216# CONFIG_SCSI_DMX3191D is not set
212# CONFIG_SCSI_EATA is not set 217# CONFIG_SCSI_EATA is not set
213# CONFIG_SCSI_EATA_PIO is not set
214# CONFIG_SCSI_FUTURE_DOMAIN is not set 218# CONFIG_SCSI_FUTURE_DOMAIN is not set
215# CONFIG_SCSI_GDTH is not set 219# CONFIG_SCSI_GDTH is not set
216# CONFIG_SCSI_IPS is not set 220# CONFIG_SCSI_IPS is not set
@@ -219,7 +223,6 @@ CONFIG_SCSI_IBMVSCSI=m
219# CONFIG_SCSI_INIA100 is not set 223# CONFIG_SCSI_INIA100 is not set
220# CONFIG_SCSI_SYM53C8XX_2 is not set 224# CONFIG_SCSI_SYM53C8XX_2 is not set
221# CONFIG_SCSI_IPR is not set 225# CONFIG_SCSI_IPR is not set
222# CONFIG_SCSI_QLOGIC_ISP is not set
223# CONFIG_SCSI_QLOGIC_FC is not set 226# CONFIG_SCSI_QLOGIC_FC is not set
224# CONFIG_SCSI_QLOGIC_1280 is not set 227# CONFIG_SCSI_QLOGIC_1280 is not set
225CONFIG_SCSI_QLA2XXX=y 228CONFIG_SCSI_QLA2XXX=y
@@ -228,6 +231,7 @@ CONFIG_SCSI_QLA2XXX=y
228# CONFIG_SCSI_QLA2300 is not set 231# CONFIG_SCSI_QLA2300 is not set
229# CONFIG_SCSI_QLA2322 is not set 232# CONFIG_SCSI_QLA2322 is not set
230# CONFIG_SCSI_QLA6312 is not set 233# CONFIG_SCSI_QLA6312 is not set
234# CONFIG_SCSI_LPFC is not set
231# CONFIG_SCSI_DC395x is not set 235# CONFIG_SCSI_DC395x is not set
232# CONFIG_SCSI_DC390T is not set 236# CONFIG_SCSI_DC390T is not set
233# CONFIG_SCSI_DEBUG is not set 237# CONFIG_SCSI_DEBUG is not set
@@ -250,6 +254,7 @@ CONFIG_DM_CRYPT=m
250CONFIG_DM_SNAPSHOT=m 254CONFIG_DM_SNAPSHOT=m
251CONFIG_DM_MIRROR=m 255CONFIG_DM_MIRROR=m
252CONFIG_DM_ZERO=m 256CONFIG_DM_ZERO=m
257# CONFIG_DM_MULTIPATH is not set
253 258
254# 259#
255# Fusion MPT device support 260# Fusion MPT device support
@@ -280,7 +285,6 @@ CONFIG_NET=y
280# 285#
281CONFIG_PACKET=y 286CONFIG_PACKET=y
282# CONFIG_PACKET_MMAP is not set 287# CONFIG_PACKET_MMAP is not set
283# CONFIG_NETLINK_DEV is not set
284CONFIG_UNIX=y 288CONFIG_UNIX=y
285CONFIG_NET_KEY=m 289CONFIG_NET_KEY=m
286CONFIG_INET=y 290CONFIG_INET=y
@@ -445,7 +449,6 @@ CONFIG_PCNET32=y
445# CONFIG_DGRS is not set 449# CONFIG_DGRS is not set
446# CONFIG_EEPRO100 is not set 450# CONFIG_EEPRO100 is not set
447CONFIG_E100=y 451CONFIG_E100=y
448# CONFIG_E100_NAPI is not set
449# CONFIG_FEALNX is not set 452# CONFIG_FEALNX is not set
450# CONFIG_NATSEMI is not set 453# CONFIG_NATSEMI is not set
451# CONFIG_NE2K_PCI is not set 454# CONFIG_NE2K_PCI is not set
@@ -471,6 +474,7 @@ CONFIG_E1000=m
471# CONFIG_SK98LIN is not set 474# CONFIG_SK98LIN is not set
472# CONFIG_VIA_VELOCITY is not set 475# CONFIG_VIA_VELOCITY is not set
473# CONFIG_TIGON3 is not set 476# CONFIG_TIGON3 is not set
477# CONFIG_BNX2 is not set
474 478
475# 479#
476# Ethernet (10000 Mbit) 480# Ethernet (10000 Mbit)
@@ -539,14 +543,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
539# CONFIG_INPUT_EVBUG is not set 543# CONFIG_INPUT_EVBUG is not set
540 544
541# 545#
542# Input I/O drivers
543#
544# CONFIG_GAMEPORT is not set
545CONFIG_SOUND_GAMEPORT=y
546# CONFIG_SERIO is not set
547# CONFIG_SERIO_I8042 is not set
548
549#
550# Input Device Drivers 546# Input Device Drivers
551# 547#
552# CONFIG_INPUT_KEYBOARD is not set 548# CONFIG_INPUT_KEYBOARD is not set
@@ -556,6 +552,12 @@ CONFIG_SOUND_GAMEPORT=y
556# CONFIG_INPUT_MISC is not set 552# CONFIG_INPUT_MISC is not set
557 553
558# 554#
555# Hardware I/O ports
556#
557# CONFIG_SERIO is not set
558# CONFIG_GAMEPORT is not set
559
560#
559# Character devices 561# Character devices
560# 562#
561# CONFIG_SERIAL_NONSTANDARD is not set 563# CONFIG_SERIAL_NONSTANDARD is not set
@@ -570,6 +572,7 @@ CONFIG_SOUND_GAMEPORT=y
570# 572#
571CONFIG_SERIAL_CORE=m 573CONFIG_SERIAL_CORE=m
572CONFIG_SERIAL_ICOM=m 574CONFIG_SERIAL_ICOM=m
575# CONFIG_SERIAL_JSM is not set
573CONFIG_UNIX98_PTYS=y 576CONFIG_UNIX98_PTYS=y
574CONFIG_LEGACY_PTYS=y 577CONFIG_LEGACY_PTYS=y
575CONFIG_LEGACY_PTY_COUNT=256 578CONFIG_LEGACY_PTY_COUNT=256
@@ -592,9 +595,16 @@ CONFIG_LEGACY_PTY_COUNT=256
592# 595#
593# Ftape, the floppy tape device driver 596# Ftape, the floppy tape device driver
594# 597#
598# CONFIG_AGP is not set
595# CONFIG_DRM is not set 599# CONFIG_DRM is not set
596CONFIG_RAW_DRIVER=y 600CONFIG_RAW_DRIVER=y
597CONFIG_MAX_RAW_DEVS=256 601CONFIG_MAX_RAW_DEVS=256
602# CONFIG_HANGCHECK_TIMER is not set
603
604#
605# TPM devices
606#
607# CONFIG_TCG_TPM is not set
598 608
599# 609#
600# I2C support 610# I2C support
@@ -633,13 +643,9 @@ CONFIG_MAX_RAW_DEVS=256
633# 643#
634# USB support 644# USB support
635# 645#
636# CONFIG_USB is not set
637CONFIG_USB_ARCH_HAS_HCD=y 646CONFIG_USB_ARCH_HAS_HCD=y
638CONFIG_USB_ARCH_HAS_OHCI=y 647CONFIG_USB_ARCH_HAS_OHCI=y
639 648# CONFIG_USB is not set
640#
641# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
642#
643 649
644# 650#
645# USB Gadget Support 651# USB Gadget Support
@@ -848,10 +854,13 @@ CONFIG_OPROFILE=y
848# 854#
849# Kernel hacking 855# Kernel hacking
850# 856#
857# CONFIG_PRINTK_TIME is not set
851CONFIG_DEBUG_KERNEL=y 858CONFIG_DEBUG_KERNEL=y
852CONFIG_MAGIC_SYSRQ=y 859CONFIG_MAGIC_SYSRQ=y
860CONFIG_LOG_BUF_SHIFT=17
853# CONFIG_SCHEDSTATS is not set 861# CONFIG_SCHEDSTATS is not set
854# CONFIG_DEBUG_SLAB is not set 862# CONFIG_DEBUG_SLAB is not set
863# CONFIG_DEBUG_SPINLOCK is not set
855# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 864# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
856# CONFIG_DEBUG_KOBJECT is not set 865# CONFIG_DEBUG_KOBJECT is not set
857# CONFIG_DEBUG_INFO is not set 866# CONFIG_DEBUG_INFO is not set
@@ -881,6 +890,7 @@ CONFIG_CRYPTO_SHA1=m
881CONFIG_CRYPTO_SHA256=m 890CONFIG_CRYPTO_SHA256=m
882CONFIG_CRYPTO_SHA512=m 891CONFIG_CRYPTO_SHA512=m
883CONFIG_CRYPTO_WP512=m 892CONFIG_CRYPTO_WP512=m
893CONFIG_CRYPTO_TGR192=m
884CONFIG_CRYPTO_DES=y 894CONFIG_CRYPTO_DES=y
885CONFIG_CRYPTO_BLOWFISH=m 895CONFIG_CRYPTO_BLOWFISH=m
886CONFIG_CRYPTO_TWOFISH=m 896CONFIG_CRYPTO_TWOFISH=m
diff --git a/arch/ppc64/configs/maple_defconfig b/arch/ppc64/configs/maple_defconfig
index cf527501915c..8051b0f47b6f 100644
--- a/arch/ppc64/configs/maple_defconfig
+++ b/arch/ppc64/configs/maple_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc6
4# Wed Feb 9 23:34:53 2005 4# Tue Jun 14 17:12:48 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,28 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34# CONFIG_AUDIT is not set
34# CONFIG_HOTPLUG is not set 35# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 37CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 38CONFIG_IKCONFIG_PROC=y
39# CONFIG_CPUSETS is not set
38# CONFIG_EMBEDDED is not set 40# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
40CONFIG_KALLSYMS_ALL=y 42CONFIG_KALLSYMS_ALL=y
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 43# CONFIG_KALLSYMS_EXTRA_PASS is not set
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 47CONFIG_FUTEX=y
43CONFIG_EPOLL=y 48CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 49CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 50CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 51CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 52CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 53CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 54# CONFIG_TINY_SHMEM is not set
55CONFIG_BASE_SMALL=0
51 56
52# 57#
53# Loadable module support 58# Loadable module support
@@ -84,6 +89,8 @@ CONFIG_NR_CPUS=2
84# CONFIG_SCHED_SMT is not set 89# CONFIG_SCHED_SMT is not set
85# CONFIG_PREEMPT is not set 90# CONFIG_PREEMPT is not set
86CONFIG_GENERIC_HARDIRQS=y 91CONFIG_GENERIC_HARDIRQS=y
92CONFIG_SECCOMP=y
93CONFIG_ISA_DMA_API=y
87 94
88# 95#
89# General setup 96# General setup
@@ -94,6 +101,7 @@ CONFIG_BINFMT_ELF=y
94# CONFIG_BINFMT_MISC is not set 101# CONFIG_BINFMT_MISC is not set
95CONFIG_PCI_LEGACY_PROC=y 102CONFIG_PCI_LEGACY_PROC=y
96CONFIG_PCI_NAMES=y 103CONFIG_PCI_NAMES=y
104# CONFIG_PCI_DEBUG is not set
97 105
98# 106#
99# PCCARD (PCMCIA/CardBus) support 107# PCCARD (PCMCIA/CardBus) support
@@ -101,10 +109,6 @@ CONFIG_PCI_NAMES=y
101# CONFIG_PCCARD is not set 109# CONFIG_PCCARD is not set
102 110
103# 111#
104# PC-card bridges
105#
106
107#
108# PCI Hotplug Support 112# PCI Hotplug Support
109# 113#
110# CONFIG_HOTPLUG_PCI is not set 114# CONFIG_HOTPLUG_PCI is not set
@@ -261,7 +265,6 @@ CONFIG_NET=y
261# 265#
262CONFIG_PACKET=y 266CONFIG_PACKET=y
263CONFIG_PACKET_MMAP=y 267CONFIG_PACKET_MMAP=y
264# CONFIG_NETLINK_DEV is not set
265CONFIG_UNIX=y 268CONFIG_UNIX=y
266# CONFIG_NET_KEY is not set 269# CONFIG_NET_KEY is not set
267CONFIG_INET=y 270CONFIG_INET=y
@@ -376,6 +379,8 @@ CONFIG_E1000=y
376# CONFIG_SK98LIN is not set 379# CONFIG_SK98LIN is not set
377# CONFIG_VIA_VELOCITY is not set 380# CONFIG_VIA_VELOCITY is not set
378# CONFIG_TIGON3 is not set 381# CONFIG_TIGON3 is not set
382# CONFIG_BNX2 is not set
383# CONFIG_MV643XX_ETH is not set
379 384
380# 385#
381# Ethernet (10000 Mbit) 386# Ethernet (10000 Mbit)
@@ -432,14 +437,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1200
432# CONFIG_INPUT_EVBUG is not set 437# CONFIG_INPUT_EVBUG is not set
433 438
434# 439#
435# Input I/O drivers
436#
437# CONFIG_GAMEPORT is not set
438CONFIG_SOUND_GAMEPORT=y
439# CONFIG_SERIO is not set
440# CONFIG_SERIO_I8042 is not set
441
442#
443# Input Device Drivers 440# Input Device Drivers
444# 441#
445# CONFIG_INPUT_KEYBOARD is not set 442# CONFIG_INPUT_KEYBOARD is not set
@@ -449,6 +446,12 @@ CONFIG_SOUND_GAMEPORT=y
449# CONFIG_INPUT_MISC is not set 446# CONFIG_INPUT_MISC is not set
450 447
451# 448#
449# Hardware I/O ports
450#
451# CONFIG_SERIO is not set
452# CONFIG_GAMEPORT is not set
453
454#
452# Character devices 455# Character devices
453# 456#
454CONFIG_VT=y 457CONFIG_VT=y
@@ -469,7 +472,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
469# 472#
470CONFIG_SERIAL_CORE=y 473CONFIG_SERIAL_CORE=y
471CONFIG_SERIAL_CORE_CONSOLE=y 474CONFIG_SERIAL_CORE_CONSOLE=y
472# CONFIG_SERIAL_PMACZILOG is not set 475# CONFIG_SERIAL_JSM is not set
473CONFIG_UNIX98_PTYS=y 476CONFIG_UNIX98_PTYS=y
474CONFIG_LEGACY_PTYS=y 477CONFIG_LEGACY_PTYS=y
475CONFIG_LEGACY_PTY_COUNT=256 478CONFIG_LEGACY_PTY_COUNT=256
@@ -492,8 +495,15 @@ CONFIG_LEGACY_PTY_COUNT=256
492# 495#
493# Ftape, the floppy tape device driver 496# Ftape, the floppy tape device driver
494# 497#
498# CONFIG_AGP is not set
495# CONFIG_DRM is not set 499# CONFIG_DRM is not set
496# CONFIG_RAW_DRIVER is not set 500# CONFIG_RAW_DRIVER is not set
501# CONFIG_HANGCHECK_TIMER is not set
502
503#
504# TPM devices
505#
506# CONFIG_TCG_TPM is not set
497 507
498# 508#
499# I2C support 509# I2C support
@@ -518,8 +528,8 @@ CONFIG_I2C_ALGOBIT=y
518CONFIG_I2C_AMD8111=y 528CONFIG_I2C_AMD8111=y
519# CONFIG_I2C_I801 is not set 529# CONFIG_I2C_I801 is not set
520# CONFIG_I2C_I810 is not set 530# CONFIG_I2C_I810 is not set
531# CONFIG_I2C_PIIX4 is not set
521# CONFIG_I2C_ISA is not set 532# CONFIG_I2C_ISA is not set
522# CONFIG_I2C_MPC is not set
523# CONFIG_I2C_NFORCE2 is not set 533# CONFIG_I2C_NFORCE2 is not set
524# CONFIG_I2C_PARPORT_LIGHT is not set 534# CONFIG_I2C_PARPORT_LIGHT is not set
525# CONFIG_I2C_PROSAVAGE is not set 535# CONFIG_I2C_PROSAVAGE is not set
@@ -545,7 +555,9 @@ CONFIG_I2C_AMD8111=y
545# CONFIG_SENSORS_ASB100 is not set 555# CONFIG_SENSORS_ASB100 is not set
546# CONFIG_SENSORS_DS1621 is not set 556# CONFIG_SENSORS_DS1621 is not set
547# CONFIG_SENSORS_FSCHER is not set 557# CONFIG_SENSORS_FSCHER is not set
558# CONFIG_SENSORS_FSCPOS is not set
548# CONFIG_SENSORS_GL518SM is not set 559# CONFIG_SENSORS_GL518SM is not set
560# CONFIG_SENSORS_GL520SM is not set
549# CONFIG_SENSORS_IT87 is not set 561# CONFIG_SENSORS_IT87 is not set
550# CONFIG_SENSORS_LM63 is not set 562# CONFIG_SENSORS_LM63 is not set
551# CONFIG_SENSORS_LM75 is not set 563# CONFIG_SENSORS_LM75 is not set
@@ -556,9 +568,11 @@ CONFIG_I2C_AMD8111=y
556# CONFIG_SENSORS_LM85 is not set 568# CONFIG_SENSORS_LM85 is not set
557# CONFIG_SENSORS_LM87 is not set 569# CONFIG_SENSORS_LM87 is not set
558# CONFIG_SENSORS_LM90 is not set 570# CONFIG_SENSORS_LM90 is not set
571# CONFIG_SENSORS_LM92 is not set
559# CONFIG_SENSORS_MAX1619 is not set 572# CONFIG_SENSORS_MAX1619 is not set
560# CONFIG_SENSORS_PC87360 is not set 573# CONFIG_SENSORS_PC87360 is not set
561# CONFIG_SENSORS_SMSC47B397 is not set 574# CONFIG_SENSORS_SMSC47B397 is not set
575# CONFIG_SENSORS_SIS5595 is not set
562# CONFIG_SENSORS_SMSC47M1 is not set 576# CONFIG_SENSORS_SMSC47M1 is not set
563# CONFIG_SENSORS_VIA686A is not set 577# CONFIG_SENSORS_VIA686A is not set
564# CONFIG_SENSORS_W83781D is not set 578# CONFIG_SENSORS_W83781D is not set
@@ -568,6 +582,7 @@ CONFIG_I2C_AMD8111=y
568# 582#
569# Other I2C Chip support 583# Other I2C Chip support
570# 584#
585# CONFIG_SENSORS_DS1337 is not set
571# CONFIG_SENSORS_EEPROM is not set 586# CONFIG_SENSORS_EEPROM is not set
572# CONFIG_SENSORS_PCF8574 is not set 587# CONFIG_SENSORS_PCF8574 is not set
573# CONFIG_SENSORS_PCF8591 is not set 588# CONFIG_SENSORS_PCF8591 is not set
@@ -615,6 +630,8 @@ CONFIG_DUMMY_CONSOLE=y
615# 630#
616# USB support 631# USB support
617# 632#
633CONFIG_USB_ARCH_HAS_HCD=y
634CONFIG_USB_ARCH_HAS_OHCI=y
618CONFIG_USB=y 635CONFIG_USB=y
619# CONFIG_USB_DEBUG is not set 636# CONFIG_USB_DEBUG is not set
620 637
@@ -625,8 +642,6 @@ CONFIG_USB_DEVICEFS=y
625# CONFIG_USB_BANDWIDTH is not set 642# CONFIG_USB_BANDWIDTH is not set
626# CONFIG_USB_DYNAMIC_MINORS is not set 643# CONFIG_USB_DYNAMIC_MINORS is not set
627# CONFIG_USB_OTG is not set 644# CONFIG_USB_OTG is not set
628CONFIG_USB_ARCH_HAS_HCD=y
629CONFIG_USB_ARCH_HAS_OHCI=y
630 645
631# 646#
632# USB Host Controller Drivers 647# USB Host Controller Drivers
@@ -635,6 +650,8 @@ CONFIG_USB_EHCI_HCD=y
635CONFIG_USB_EHCI_SPLIT_ISO=y 650CONFIG_USB_EHCI_SPLIT_ISO=y
636CONFIG_USB_EHCI_ROOT_HUB_TT=y 651CONFIG_USB_EHCI_ROOT_HUB_TT=y
637CONFIG_USB_OHCI_HCD=y 652CONFIG_USB_OHCI_HCD=y
653# CONFIG_USB_OHCI_BIG_ENDIAN is not set
654CONFIG_USB_OHCI_LITTLE_ENDIAN=y
638CONFIG_USB_UHCI_HCD=y 655CONFIG_USB_UHCI_HCD=y
639# CONFIG_USB_SL811_HCD is not set 656# CONFIG_USB_SL811_HCD is not set
640 657
@@ -688,6 +705,7 @@ CONFIG_USB_HIDINPUT=y
688CONFIG_USB_PEGASUS=y 705CONFIG_USB_PEGASUS=y
689# CONFIG_USB_RTL8150 is not set 706# CONFIG_USB_RTL8150 is not set
690# CONFIG_USB_USBNET is not set 707# CONFIG_USB_USBNET is not set
708CONFIG_USB_MON=y
691 709
692# 710#
693# USB port drivers 711# USB port drivers
@@ -699,8 +717,10 @@ CONFIG_USB_PEGASUS=y
699CONFIG_USB_SERIAL=y 717CONFIG_USB_SERIAL=y
700# CONFIG_USB_SERIAL_CONSOLE is not set 718# CONFIG_USB_SERIAL_CONSOLE is not set
701CONFIG_USB_SERIAL_GENERIC=y 719CONFIG_USB_SERIAL_GENERIC=y
720# CONFIG_USB_SERIAL_AIRPRIME is not set
702# CONFIG_USB_SERIAL_BELKIN is not set 721# CONFIG_USB_SERIAL_BELKIN is not set
703# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 722# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
723# CONFIG_USB_SERIAL_CP2101 is not set
704CONFIG_USB_SERIAL_CYPRESS_M8=m 724CONFIG_USB_SERIAL_CYPRESS_M8=m
705# CONFIG_USB_SERIAL_EMPEG is not set 725# CONFIG_USB_SERIAL_EMPEG is not set
706# CONFIG_USB_SERIAL_FTDI_SIO is not set 726# CONFIG_USB_SERIAL_FTDI_SIO is not set
@@ -729,6 +749,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
729# CONFIG_USB_SERIAL_KOBIL_SCT is not set 749# CONFIG_USB_SERIAL_KOBIL_SCT is not set
730# CONFIG_USB_SERIAL_MCT_U232 is not set 750# CONFIG_USB_SERIAL_MCT_U232 is not set
731# CONFIG_USB_SERIAL_PL2303 is not set 751# CONFIG_USB_SERIAL_PL2303 is not set
752# CONFIG_USB_SERIAL_HP4X is not set
732# CONFIG_USB_SERIAL_SAFE is not set 753# CONFIG_USB_SERIAL_SAFE is not set
733CONFIG_USB_SERIAL_TI=m 754CONFIG_USB_SERIAL_TI=m
734# CONFIG_USB_SERIAL_CYBERJACK is not set 755# CONFIG_USB_SERIAL_CYBERJACK is not set
@@ -750,6 +771,7 @@ CONFIG_USB_EZUSB=y
750# CONFIG_USB_PHIDGETKIT is not set 771# CONFIG_USB_PHIDGETKIT is not set
751# CONFIG_USB_PHIDGETSERVO is not set 772# CONFIG_USB_PHIDGETSERVO is not set
752# CONFIG_USB_IDMOUSE is not set 773# CONFIG_USB_IDMOUSE is not set
774# CONFIG_USB_SISUSBVGA is not set
753# CONFIG_USB_TEST is not set 775# CONFIG_USB_TEST is not set
754 776
755# 777#
@@ -936,10 +958,13 @@ CONFIG_NLS_UTF8=y
936# 958#
937# Kernel hacking 959# Kernel hacking
938# 960#
961# CONFIG_PRINTK_TIME is not set
939CONFIG_DEBUG_KERNEL=y 962CONFIG_DEBUG_KERNEL=y
940CONFIG_MAGIC_SYSRQ=y 963CONFIG_MAGIC_SYSRQ=y
964CONFIG_LOG_BUF_SHIFT=17
941# CONFIG_SCHEDSTATS is not set 965# CONFIG_SCHEDSTATS is not set
942CONFIG_DEBUG_SLAB=y 966CONFIG_DEBUG_SLAB=y
967# CONFIG_DEBUG_SPINLOCK is not set
943CONFIG_DEBUG_SPINLOCK_SLEEP=y 968CONFIG_DEBUG_SPINLOCK_SLEEP=y
944# CONFIG_DEBUG_KOBJECT is not set 969# CONFIG_DEBUG_KOBJECT is not set
945# CONFIG_DEBUG_INFO is not set 970# CONFIG_DEBUG_INFO is not set
@@ -971,6 +996,7 @@ CONFIG_CRYPTO_MD5=y
971# CONFIG_CRYPTO_SHA256 is not set 996# CONFIG_CRYPTO_SHA256 is not set
972# CONFIG_CRYPTO_SHA512 is not set 997# CONFIG_CRYPTO_SHA512 is not set
973# CONFIG_CRYPTO_WP512 is not set 998# CONFIG_CRYPTO_WP512 is not set
999# CONFIG_CRYPTO_TGR192 is not set
974CONFIG_CRYPTO_DES=y 1000CONFIG_CRYPTO_DES=y
975# CONFIG_CRYPTO_BLOWFISH is not set 1001# CONFIG_CRYPTO_BLOWFISH is not set
976# CONFIG_CRYPTO_TWOFISH is not set 1002# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig
index 4fecf237d5c9..3eb5ef25d3a3 100644
--- a/arch/ppc64/configs/pSeries_defconfig
+++ b/arch/ppc64/configs/pSeries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc6
4# Wed Feb 9 23:34:54 2005 4# Tue Jun 14 17:13:47 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,29 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34CONFIG_AUDIT=y
35CONFIG_AUDITSYSCALL=y
34CONFIG_HOTPLUG=y 36CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y 37CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 38CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 39CONFIG_IKCONFIG_PROC=y
40CONFIG_CPUSETS=y
38# CONFIG_EMBEDDED is not set 41# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 42CONFIG_KALLSYMS=y
40CONFIG_KALLSYMS_ALL=y 43CONFIG_KALLSYMS_ALL=y
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 44# CONFIG_KALLSYMS_EXTRA_PASS is not set
45CONFIG_PRINTK=y
46CONFIG_BUG=y
47CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 48CONFIG_FUTEX=y
43CONFIG_EPOLL=y 49CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 50CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 51CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 52CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 53CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 54CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 55# CONFIG_TINY_SHMEM is not set
56CONFIG_BASE_SMALL=0
51 57
52# 58#
53# Loadable module support 59# Loadable module support
@@ -89,9 +95,12 @@ CONFIG_SCHED_SMT=y
89CONFIG_EEH=y 95CONFIG_EEH=y
90CONFIG_GENERIC_HARDIRQS=y 96CONFIG_GENERIC_HARDIRQS=y
91CONFIG_PPC_RTAS=y 97CONFIG_PPC_RTAS=y
98CONFIG_RTAS_PROC=y
92CONFIG_RTAS_FLASH=m 99CONFIG_RTAS_FLASH=m
93CONFIG_SCANLOG=m 100CONFIG_SCANLOG=m
94CONFIG_LPARCFG=y 101CONFIG_LPARCFG=y
102CONFIG_SECCOMP=y
103CONFIG_ISA_DMA_API=y
95 104
96# 105#
97# General setup 106# General setup
@@ -102,6 +111,7 @@ CONFIG_BINFMT_ELF=y
102# CONFIG_BINFMT_MISC is not set 111# CONFIG_BINFMT_MISC is not set
103CONFIG_PCI_LEGACY_PROC=y 112CONFIG_PCI_LEGACY_PROC=y
104CONFIG_PCI_NAMES=y 113CONFIG_PCI_NAMES=y
114# CONFIG_PCI_DEBUG is not set
105CONFIG_HOTPLUG_CPU=y 115CONFIG_HOTPLUG_CPU=y
106 116
107# 117#
@@ -110,10 +120,6 @@ CONFIG_HOTPLUG_CPU=y
110# CONFIG_PCCARD is not set 120# CONFIG_PCCARD is not set
111 121
112# 122#
113# PC-card bridges
114#
115
116#
117# PCI Hotplug Support 123# PCI Hotplug Support
118# 124#
119CONFIG_HOTPLUG_PCI=m 125CONFIG_HOTPLUG_PCI=m
@@ -147,11 +153,10 @@ CONFIG_FW_LOADER=y
147# 153#
148CONFIG_PARPORT=m 154CONFIG_PARPORT=m
149CONFIG_PARPORT_PC=m 155CONFIG_PARPORT_PC=m
150CONFIG_PARPORT_PC_CML1=m
151# CONFIG_PARPORT_SERIAL is not set 156# CONFIG_PARPORT_SERIAL is not set
152# CONFIG_PARPORT_PC_FIFO is not set 157# CONFIG_PARPORT_PC_FIFO is not set
153# CONFIG_PARPORT_PC_SUPERIO is not set 158# CONFIG_PARPORT_PC_SUPERIO is not set
154# CONFIG_PARPORT_OTHER is not set 159# CONFIG_PARPORT_GSC is not set
155# CONFIG_PARPORT_1284 is not set 160# CONFIG_PARPORT_1284 is not set
156 161
157# 162#
@@ -293,7 +298,6 @@ CONFIG_SCSI_ISCSI_ATTRS=m
293# CONFIG_SCSI_BUSLOGIC is not set 298# CONFIG_SCSI_BUSLOGIC is not set
294# CONFIG_SCSI_DMX3191D is not set 299# CONFIG_SCSI_DMX3191D is not set
295# CONFIG_SCSI_EATA is not set 300# CONFIG_SCSI_EATA is not set
296# CONFIG_SCSI_EATA_PIO is not set
297# CONFIG_SCSI_FUTURE_DOMAIN is not set 301# CONFIG_SCSI_FUTURE_DOMAIN is not set
298# CONFIG_SCSI_GDTH is not set 302# CONFIG_SCSI_GDTH is not set
299# CONFIG_SCSI_IPS is not set 303# CONFIG_SCSI_IPS is not set
@@ -310,7 +314,6 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
310CONFIG_SCSI_IPR=y 314CONFIG_SCSI_IPR=y
311CONFIG_SCSI_IPR_TRACE=y 315CONFIG_SCSI_IPR_TRACE=y
312CONFIG_SCSI_IPR_DUMP=y 316CONFIG_SCSI_IPR_DUMP=y
313# CONFIG_SCSI_QLOGIC_ISP is not set
314# CONFIG_SCSI_QLOGIC_FC is not set 317# CONFIG_SCSI_QLOGIC_FC is not set
315# CONFIG_SCSI_QLOGIC_1280 is not set 318# CONFIG_SCSI_QLOGIC_1280 is not set
316CONFIG_SCSI_QLA2XXX=y 319CONFIG_SCSI_QLA2XXX=y
@@ -319,6 +322,7 @@ CONFIG_SCSI_QLA22XX=m
319CONFIG_SCSI_QLA2300=m 322CONFIG_SCSI_QLA2300=m
320CONFIG_SCSI_QLA2322=m 323CONFIG_SCSI_QLA2322=m
321CONFIG_SCSI_QLA6312=m 324CONFIG_SCSI_QLA6312=m
325CONFIG_SCSI_LPFC=m
322# CONFIG_SCSI_DC395x is not set 326# CONFIG_SCSI_DC395x is not set
323# CONFIG_SCSI_DC390T is not set 327# CONFIG_SCSI_DC390T is not set
324# CONFIG_SCSI_DEBUG is not set 328# CONFIG_SCSI_DEBUG is not set
@@ -341,6 +345,8 @@ CONFIG_DM_CRYPT=m
341CONFIG_DM_SNAPSHOT=m 345CONFIG_DM_SNAPSHOT=m
342CONFIG_DM_MIRROR=m 346CONFIG_DM_MIRROR=m
343CONFIG_DM_ZERO=m 347CONFIG_DM_ZERO=m
348CONFIG_DM_MULTIPATH=m
349CONFIG_DM_MULTIPATH_EMC=m
344 350
345# 351#
346# Fusion MPT device support 352# Fusion MPT device support
@@ -371,7 +377,6 @@ CONFIG_NET=y
371# 377#
372CONFIG_PACKET=y 378CONFIG_PACKET=y
373# CONFIG_PACKET_MMAP is not set 379# CONFIG_PACKET_MMAP is not set
374# CONFIG_NETLINK_DEV is not set
375CONFIG_UNIX=y 380CONFIG_UNIX=y
376CONFIG_NET_KEY=m 381CONFIG_NET_KEY=m
377CONFIG_INET=y 382CONFIG_INET=y
@@ -539,7 +544,6 @@ CONFIG_PCNET32=y
539# CONFIG_DGRS is not set 544# CONFIG_DGRS is not set
540# CONFIG_EEPRO100 is not set 545# CONFIG_EEPRO100 is not set
541CONFIG_E100=y 546CONFIG_E100=y
542# CONFIG_E100_NAPI is not set
543# CONFIG_FEALNX is not set 547# CONFIG_FEALNX is not set
544# CONFIG_NATSEMI is not set 548# CONFIG_NATSEMI is not set
545# CONFIG_NE2K_PCI is not set 549# CONFIG_NE2K_PCI is not set
@@ -565,6 +569,8 @@ CONFIG_E1000=y
565# CONFIG_SK98LIN is not set 569# CONFIG_SK98LIN is not set
566# CONFIG_VIA_VELOCITY is not set 570# CONFIG_VIA_VELOCITY is not set
567CONFIG_TIGON3=y 571CONFIG_TIGON3=y
572# CONFIG_BNX2 is not set
573# CONFIG_MV643XX_ETH is not set
568 574
569# 575#
570# Ethernet (10000 Mbit) 576# Ethernet (10000 Mbit)
@@ -636,20 +642,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
636# CONFIG_INPUT_EVBUG is not set 642# CONFIG_INPUT_EVBUG is not set
637 643
638# 644#
639# Input I/O drivers
640#
641# CONFIG_GAMEPORT is not set
642CONFIG_SOUND_GAMEPORT=y
643CONFIG_SERIO=y
644CONFIG_SERIO_I8042=y
645# CONFIG_SERIO_SERPORT is not set
646# CONFIG_SERIO_CT82C710 is not set
647# CONFIG_SERIO_PARKBD is not set
648# CONFIG_SERIO_PCIPS2 is not set
649CONFIG_SERIO_LIBPS2=y
650# CONFIG_SERIO_RAW is not set
651
652#
653# Input Device Drivers 645# Input Device Drivers
654# 646#
655CONFIG_INPUT_KEYBOARD=y 647CONFIG_INPUT_KEYBOARD=y
@@ -669,6 +661,18 @@ CONFIG_INPUT_PCSPKR=m
669# CONFIG_INPUT_UINPUT is not set 661# CONFIG_INPUT_UINPUT is not set
670 662
671# 663#
664# Hardware I/O ports
665#
666CONFIG_SERIO=y
667CONFIG_SERIO_I8042=y
668# CONFIG_SERIO_SERPORT is not set
669# CONFIG_SERIO_PARKBD is not set
670# CONFIG_SERIO_PCIPS2 is not set
671CONFIG_SERIO_LIBPS2=y
672# CONFIG_SERIO_RAW is not set
673# CONFIG_GAMEPORT is not set
674
675#
672# Character devices 676# Character devices
673# 677#
674CONFIG_VT=y 678CONFIG_VT=y
@@ -689,8 +693,8 @@ CONFIG_SERIAL_8250_NR_UARTS=4
689# 693#
690CONFIG_SERIAL_CORE=y 694CONFIG_SERIAL_CORE=y
691CONFIG_SERIAL_CORE_CONSOLE=y 695CONFIG_SERIAL_CORE_CONSOLE=y
692# CONFIG_SERIAL_PMACZILOG is not set
693CONFIG_SERIAL_ICOM=m 696CONFIG_SERIAL_ICOM=m
697# CONFIG_SERIAL_JSM is not set
694CONFIG_UNIX98_PTYS=y 698CONFIG_UNIX98_PTYS=y
695CONFIG_LEGACY_PTYS=y 699CONFIG_LEGACY_PTYS=y
696CONFIG_LEGACY_PTY_COUNT=256 700CONFIG_LEGACY_PTY_COUNT=256
@@ -718,9 +722,16 @@ CONFIG_HVCS=m
718# 722#
719# Ftape, the floppy tape device driver 723# Ftape, the floppy tape device driver
720# 724#
725# CONFIG_AGP is not set
721# CONFIG_DRM is not set 726# CONFIG_DRM is not set
722CONFIG_RAW_DRIVER=y 727CONFIG_RAW_DRIVER=y
723CONFIG_MAX_RAW_DEVS=1024 728CONFIG_MAX_RAW_DEVS=1024
729# CONFIG_HANGCHECK_TIMER is not set
730
731#
732# TPM devices
733#
734# CONFIG_TCG_TPM is not set
724 735
725# 736#
726# I2C support 737# I2C support
@@ -745,8 +756,8 @@ CONFIG_I2C_ALGOBIT=y
745# CONFIG_I2C_AMD8111 is not set 756# CONFIG_I2C_AMD8111 is not set
746# CONFIG_I2C_I801 is not set 757# CONFIG_I2C_I801 is not set
747# CONFIG_I2C_I810 is not set 758# CONFIG_I2C_I810 is not set
759# CONFIG_I2C_PIIX4 is not set
748# CONFIG_I2C_ISA is not set 760# CONFIG_I2C_ISA is not set
749# CONFIG_I2C_MPC is not set
750# CONFIG_I2C_NFORCE2 is not set 761# CONFIG_I2C_NFORCE2 is not set
751# CONFIG_I2C_PARPORT is not set 762# CONFIG_I2C_PARPORT is not set
752# CONFIG_I2C_PARPORT_LIGHT is not set 763# CONFIG_I2C_PARPORT_LIGHT is not set
@@ -773,7 +784,9 @@ CONFIG_I2C_ALGOBIT=y
773# CONFIG_SENSORS_ASB100 is not set 784# CONFIG_SENSORS_ASB100 is not set
774# CONFIG_SENSORS_DS1621 is not set 785# CONFIG_SENSORS_DS1621 is not set
775# CONFIG_SENSORS_FSCHER is not set 786# CONFIG_SENSORS_FSCHER is not set
787# CONFIG_SENSORS_FSCPOS is not set
776# CONFIG_SENSORS_GL518SM is not set 788# CONFIG_SENSORS_GL518SM is not set
789# CONFIG_SENSORS_GL520SM is not set
777# CONFIG_SENSORS_IT87 is not set 790# CONFIG_SENSORS_IT87 is not set
778# CONFIG_SENSORS_LM63 is not set 791# CONFIG_SENSORS_LM63 is not set
779# CONFIG_SENSORS_LM75 is not set 792# CONFIG_SENSORS_LM75 is not set
@@ -784,9 +797,11 @@ CONFIG_I2C_ALGOBIT=y
784# CONFIG_SENSORS_LM85 is not set 797# CONFIG_SENSORS_LM85 is not set
785# CONFIG_SENSORS_LM87 is not set 798# CONFIG_SENSORS_LM87 is not set
786# CONFIG_SENSORS_LM90 is not set 799# CONFIG_SENSORS_LM90 is not set
800# CONFIG_SENSORS_LM92 is not set
787# CONFIG_SENSORS_MAX1619 is not set 801# CONFIG_SENSORS_MAX1619 is not set
788# CONFIG_SENSORS_PC87360 is not set 802# CONFIG_SENSORS_PC87360 is not set
789# CONFIG_SENSORS_SMSC47B397 is not set 803# CONFIG_SENSORS_SMSC47B397 is not set
804# CONFIG_SENSORS_SIS5595 is not set
790# CONFIG_SENSORS_SMSC47M1 is not set 805# CONFIG_SENSORS_SMSC47M1 is not set
791# CONFIG_SENSORS_VIA686A is not set 806# CONFIG_SENSORS_VIA686A is not set
792# CONFIG_SENSORS_W83781D is not set 807# CONFIG_SENSORS_W83781D is not set
@@ -796,6 +811,7 @@ CONFIG_I2C_ALGOBIT=y
796# 811#
797# Other I2C Chip support 812# Other I2C Chip support
798# 813#
814# CONFIG_SENSORS_DS1337 is not set
799# CONFIG_SENSORS_EEPROM is not set 815# CONFIG_SENSORS_EEPROM is not set
800# CONFIG_SENSORS_PCF8574 is not set 816# CONFIG_SENSORS_PCF8574 is not set
801# CONFIG_SENSORS_PCF8591 is not set 817# CONFIG_SENSORS_PCF8591 is not set
@@ -828,8 +844,13 @@ CONFIG_I2C_ALGOBIT=y
828# Graphics support 844# Graphics support
829# 845#
830CONFIG_FB=y 846CONFIG_FB=y
847CONFIG_FB_CFB_FILLRECT=y
848CONFIG_FB_CFB_COPYAREA=y
849CONFIG_FB_CFB_IMAGEBLIT=y
850CONFIG_FB_SOFT_CURSOR=y
851CONFIG_FB_MACMODES=y
831CONFIG_FB_MODE_HELPERS=y 852CONFIG_FB_MODE_HELPERS=y
832# CONFIG_FB_TILEBLITTING is not set 853CONFIG_FB_TILEBLITTING=y
833# CONFIG_FB_CIRRUS is not set 854# CONFIG_FB_CIRRUS is not set
834# CONFIG_FB_PM2 is not set 855# CONFIG_FB_PM2 is not set
835# CONFIG_FB_CYBER2000 is not set 856# CONFIG_FB_CYBER2000 is not set
@@ -838,6 +859,7 @@ CONFIG_FB_OF=y
838# CONFIG_FB_ASILIANT is not set 859# CONFIG_FB_ASILIANT is not set
839# CONFIG_FB_IMSTT is not set 860# CONFIG_FB_IMSTT is not set
840# CONFIG_FB_VGA16 is not set 861# CONFIG_FB_VGA16 is not set
862# CONFIG_FB_NVIDIA is not set
841# CONFIG_FB_RIVA is not set 863# CONFIG_FB_RIVA is not set
842CONFIG_FB_MATROX=y 864CONFIG_FB_MATROX=y
843CONFIG_FB_MATROX_MILLENIUM=y 865CONFIG_FB_MATROX_MILLENIUM=y
@@ -858,6 +880,7 @@ CONFIG_FB_RADEON_I2C=y
858# CONFIG_FB_3DFX is not set 880# CONFIG_FB_3DFX is not set
859# CONFIG_FB_VOODOO1 is not set 881# CONFIG_FB_VOODOO1 is not set
860# CONFIG_FB_TRIDENT is not set 882# CONFIG_FB_TRIDENT is not set
883# CONFIG_FB_S1D13XXX is not set
861# CONFIG_FB_VIRTUAL is not set 884# CONFIG_FB_VIRTUAL is not set
862 885
863# 886#
@@ -891,6 +914,8 @@ CONFIG_LCD_DEVICE=y
891# 914#
892# USB support 915# USB support
893# 916#
917CONFIG_USB_ARCH_HAS_HCD=y
918CONFIG_USB_ARCH_HAS_OHCI=y
894CONFIG_USB=y 919CONFIG_USB=y
895# CONFIG_USB_DEBUG is not set 920# CONFIG_USB_DEBUG is not set
896 921
@@ -901,8 +926,6 @@ CONFIG_USB_DEVICEFS=y
901# CONFIG_USB_BANDWIDTH is not set 926# CONFIG_USB_BANDWIDTH is not set
902# CONFIG_USB_DYNAMIC_MINORS is not set 927# CONFIG_USB_DYNAMIC_MINORS is not set
903# CONFIG_USB_OTG is not set 928# CONFIG_USB_OTG is not set
904CONFIG_USB_ARCH_HAS_HCD=y
905CONFIG_USB_ARCH_HAS_OHCI=y
906 929
907# 930#
908# USB Host Controller Drivers 931# USB Host Controller Drivers
@@ -911,6 +934,8 @@ CONFIG_USB_EHCI_HCD=y
911# CONFIG_USB_EHCI_SPLIT_ISO is not set 934# CONFIG_USB_EHCI_SPLIT_ISO is not set
912# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 935# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
913CONFIG_USB_OHCI_HCD=y 936CONFIG_USB_OHCI_HCD=y
937# CONFIG_USB_OHCI_BIG_ENDIAN is not set
938CONFIG_USB_OHCI_LITTLE_ENDIAN=y
914# CONFIG_USB_UHCI_HCD is not set 939# CONFIG_USB_UHCI_HCD is not set
915# CONFIG_USB_SL811_HCD is not set 940# CONFIG_USB_SL811_HCD is not set
916 941
@@ -926,12 +951,11 @@ CONFIG_USB_OHCI_HCD=y
926# 951#
927CONFIG_USB_STORAGE=y 952CONFIG_USB_STORAGE=y
928# CONFIG_USB_STORAGE_DEBUG is not set 953# CONFIG_USB_STORAGE_DEBUG is not set
929# CONFIG_USB_STORAGE_RW_DETECT is not set
930# CONFIG_USB_STORAGE_DATAFAB is not set 954# CONFIG_USB_STORAGE_DATAFAB is not set
931# CONFIG_USB_STORAGE_FREECOM is not set 955# CONFIG_USB_STORAGE_FREECOM is not set
932# CONFIG_USB_STORAGE_ISD200 is not set 956# CONFIG_USB_STORAGE_ISD200 is not set
933# CONFIG_USB_STORAGE_DPCM is not set 957# CONFIG_USB_STORAGE_DPCM is not set
934# CONFIG_USB_STORAGE_HP8200e is not set 958# CONFIG_USB_STORAGE_USBAT is not set
935# CONFIG_USB_STORAGE_SDDR09 is not set 959# CONFIG_USB_STORAGE_SDDR09 is not set
936# CONFIG_USB_STORAGE_SDDR55 is not set 960# CONFIG_USB_STORAGE_SDDR55 is not set
937# CONFIG_USB_STORAGE_JUMPSHOT is not set 961# CONFIG_USB_STORAGE_JUMPSHOT is not set
@@ -975,6 +999,7 @@ CONFIG_USB_HIDDEV=y
975# CONFIG_USB_PEGASUS is not set 999# CONFIG_USB_PEGASUS is not set
976# CONFIG_USB_RTL8150 is not set 1000# CONFIG_USB_RTL8150 is not set
977# CONFIG_USB_USBNET is not set 1001# CONFIG_USB_USBNET is not set
1002CONFIG_USB_MON=y
978 1003
979# 1004#
980# USB port drivers 1005# USB port drivers
@@ -1000,6 +1025,7 @@ CONFIG_USB_HIDDEV=y
1000# CONFIG_USB_PHIDGETKIT is not set 1025# CONFIG_USB_PHIDGETKIT is not set
1001# CONFIG_USB_PHIDGETSERVO is not set 1026# CONFIG_USB_PHIDGETSERVO is not set
1002# CONFIG_USB_IDMOUSE is not set 1027# CONFIG_USB_IDMOUSE is not set
1028# CONFIG_USB_SISUSBVGA is not set
1003# CONFIG_USB_TEST is not set 1029# CONFIG_USB_TEST is not set
1004 1030
1005# 1031#
@@ -1208,10 +1234,13 @@ CONFIG_OPROFILE=y
1208# 1234#
1209# Kernel hacking 1235# Kernel hacking
1210# 1236#
1237# CONFIG_PRINTK_TIME is not set
1211CONFIG_DEBUG_KERNEL=y 1238CONFIG_DEBUG_KERNEL=y
1212CONFIG_MAGIC_SYSRQ=y 1239CONFIG_MAGIC_SYSRQ=y
1240CONFIG_LOG_BUF_SHIFT=17
1213# CONFIG_SCHEDSTATS is not set 1241# CONFIG_SCHEDSTATS is not set
1214# CONFIG_DEBUG_SLAB is not set 1242# CONFIG_DEBUG_SLAB is not set
1243# CONFIG_DEBUG_SPINLOCK is not set
1215# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1244# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1216# CONFIG_DEBUG_KOBJECT is not set 1245# CONFIG_DEBUG_KOBJECT is not set
1217# CONFIG_DEBUG_INFO is not set 1246# CONFIG_DEBUG_INFO is not set
@@ -1243,6 +1272,7 @@ CONFIG_CRYPTO_SHA1=m
1243CONFIG_CRYPTO_SHA256=m 1272CONFIG_CRYPTO_SHA256=m
1244CONFIG_CRYPTO_SHA512=m 1273CONFIG_CRYPTO_SHA512=m
1245CONFIG_CRYPTO_WP512=m 1274CONFIG_CRYPTO_WP512=m
1275CONFIG_CRYPTO_TGR192=m
1246CONFIG_CRYPTO_DES=y 1276CONFIG_CRYPTO_DES=y
1247CONFIG_CRYPTO_BLOWFISH=m 1277CONFIG_CRYPTO_BLOWFISH=m
1248CONFIG_CRYPTO_TWOFISH=m 1278CONFIG_CRYPTO_TWOFISH=m
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig
index 537b1cc82eab..2f31bf3046f9 100644
--- a/arch/ppc64/defconfig
+++ b/arch/ppc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc5-git9
4# Wed Feb 9 23:34:51 2005 4# Sun Jun 5 09:26:47 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,28 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34# CONFIG_AUDIT is not set
34CONFIG_HOTPLUG=y 35CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 37CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 38CONFIG_IKCONFIG_PROC=y
39CONFIG_CPUSETS=y
38# CONFIG_EMBEDDED is not set 40# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set 42# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 43# CONFIG_KALLSYMS_EXTRA_PASS is not set
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 47CONFIG_FUTEX=y
43CONFIG_EPOLL=y 48CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 49CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 50CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 51CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 52CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 53CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 54# CONFIG_TINY_SHMEM is not set
55CONFIG_BASE_SMALL=0
51 56
52# 57#
53# Loadable module support 58# Loadable module support
@@ -91,9 +96,12 @@ CONFIG_DISCONTIGMEM=y
91CONFIG_EEH=y 96CONFIG_EEH=y
92CONFIG_GENERIC_HARDIRQS=y 97CONFIG_GENERIC_HARDIRQS=y
93CONFIG_PPC_RTAS=y 98CONFIG_PPC_RTAS=y
99CONFIG_RTAS_PROC=y
94CONFIG_RTAS_FLASH=m 100CONFIG_RTAS_FLASH=m
95CONFIG_SCANLOG=m 101CONFIG_SCANLOG=m
96CONFIG_LPARCFG=y 102CONFIG_LPARCFG=y
103CONFIG_SECCOMP=y
104CONFIG_ISA_DMA_API=y
97 105
98# 106#
99# General setup 107# General setup
@@ -104,6 +112,7 @@ CONFIG_BINFMT_ELF=y
104CONFIG_BINFMT_MISC=m 112CONFIG_BINFMT_MISC=m
105# CONFIG_PCI_LEGACY_PROC is not set 113# CONFIG_PCI_LEGACY_PROC is not set
106# CONFIG_PCI_NAMES is not set 114# CONFIG_PCI_NAMES is not set
115# CONFIG_PCI_DEBUG is not set
107CONFIG_HOTPLUG_CPU=y 116CONFIG_HOTPLUG_CPU=y
108 117
109# 118#
@@ -112,10 +121,6 @@ CONFIG_HOTPLUG_CPU=y
112# CONFIG_PCCARD is not set 121# CONFIG_PCCARD is not set
113 122
114# 123#
115# PC-card bridges
116#
117
118#
119# PCI Hotplug Support 124# PCI Hotplug Support
120# 125#
121CONFIG_HOTPLUG_PCI=m 126CONFIG_HOTPLUG_PCI=m
@@ -149,11 +154,10 @@ CONFIG_FW_LOADER=y
149# 154#
150CONFIG_PARPORT=m 155CONFIG_PARPORT=m
151CONFIG_PARPORT_PC=m 156CONFIG_PARPORT_PC=m
152CONFIG_PARPORT_PC_CML1=m
153# CONFIG_PARPORT_SERIAL is not set 157# CONFIG_PARPORT_SERIAL is not set
154# CONFIG_PARPORT_PC_FIFO is not set 158# CONFIG_PARPORT_PC_FIFO is not set
155# CONFIG_PARPORT_PC_SUPERIO is not set 159# CONFIG_PARPORT_PC_SUPERIO is not set
156# CONFIG_PARPORT_OTHER is not set 160# CONFIG_PARPORT_GSC is not set
157# CONFIG_PARPORT_1284 is not set 161# CONFIG_PARPORT_1284 is not set
158 162
159# 163#
@@ -301,6 +305,7 @@ CONFIG_SCSI_SATA_SVW=y
301# CONFIG_SCSI_ATA_PIIX is not set 305# CONFIG_SCSI_ATA_PIIX is not set
302# CONFIG_SCSI_SATA_NV is not set 306# CONFIG_SCSI_SATA_NV is not set
303# CONFIG_SCSI_SATA_PROMISE is not set 307# CONFIG_SCSI_SATA_PROMISE is not set
308# CONFIG_SCSI_SATA_QSTOR is not set
304# CONFIG_SCSI_SATA_SX4 is not set 309# CONFIG_SCSI_SATA_SX4 is not set
305# CONFIG_SCSI_SATA_SIL is not set 310# CONFIG_SCSI_SATA_SIL is not set
306# CONFIG_SCSI_SATA_SIS is not set 311# CONFIG_SCSI_SATA_SIS is not set
@@ -310,7 +315,6 @@ CONFIG_SCSI_SATA_SVW=y
310# CONFIG_SCSI_BUSLOGIC is not set 315# CONFIG_SCSI_BUSLOGIC is not set
311# CONFIG_SCSI_DMX3191D is not set 316# CONFIG_SCSI_DMX3191D is not set
312# CONFIG_SCSI_EATA is not set 317# CONFIG_SCSI_EATA is not set
313# CONFIG_SCSI_EATA_PIO is not set
314# CONFIG_SCSI_FUTURE_DOMAIN is not set 318# CONFIG_SCSI_FUTURE_DOMAIN is not set
315# CONFIG_SCSI_GDTH is not set 319# CONFIG_SCSI_GDTH is not set
316# CONFIG_SCSI_IPS is not set 320# CONFIG_SCSI_IPS is not set
@@ -327,7 +331,6 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
327CONFIG_SCSI_IPR=y 331CONFIG_SCSI_IPR=y
328CONFIG_SCSI_IPR_TRACE=y 332CONFIG_SCSI_IPR_TRACE=y
329CONFIG_SCSI_IPR_DUMP=y 333CONFIG_SCSI_IPR_DUMP=y
330# CONFIG_SCSI_QLOGIC_ISP is not set
331# CONFIG_SCSI_QLOGIC_FC is not set 334# CONFIG_SCSI_QLOGIC_FC is not set
332# CONFIG_SCSI_QLOGIC_1280 is not set 335# CONFIG_SCSI_QLOGIC_1280 is not set
333CONFIG_SCSI_QLA2XXX=y 336CONFIG_SCSI_QLA2XXX=y
@@ -336,6 +339,7 @@ CONFIG_SCSI_QLA22XX=m
336CONFIG_SCSI_QLA2300=m 339CONFIG_SCSI_QLA2300=m
337CONFIG_SCSI_QLA2322=m 340CONFIG_SCSI_QLA2322=m
338CONFIG_SCSI_QLA6312=m 341CONFIG_SCSI_QLA6312=m
342CONFIG_SCSI_LPFC=m
339# CONFIG_SCSI_DC395x is not set 343# CONFIG_SCSI_DC395x is not set
340# CONFIG_SCSI_DC390T is not set 344# CONFIG_SCSI_DC390T is not set
341CONFIG_SCSI_DEBUG=m 345CONFIG_SCSI_DEBUG=m
@@ -358,6 +362,8 @@ CONFIG_DM_CRYPT=m
358CONFIG_DM_SNAPSHOT=m 362CONFIG_DM_SNAPSHOT=m
359CONFIG_DM_MIRROR=m 363CONFIG_DM_MIRROR=m
360CONFIG_DM_ZERO=m 364CONFIG_DM_ZERO=m
365CONFIG_DM_MULTIPATH=m
366CONFIG_DM_MULTIPATH_EMC=m
361 367
362# 368#
363# Fusion MPT device support 369# Fusion MPT device support
@@ -405,6 +411,7 @@ CONFIG_IEEE1394_AMDTP=m
405# 411#
406CONFIG_ADB=y 412CONFIG_ADB=y
407CONFIG_ADB_PMU=y 413CONFIG_ADB_PMU=y
414CONFIG_PMAC_SMU=y
408# CONFIG_PMAC_PBOOK is not set 415# CONFIG_PMAC_PBOOK is not set
409# CONFIG_PMAC_BACKLIGHT is not set 416# CONFIG_PMAC_BACKLIGHT is not set
410# CONFIG_INPUT_ADBHID is not set 417# CONFIG_INPUT_ADBHID is not set
@@ -420,7 +427,6 @@ CONFIG_NET=y
420# 427#
421CONFIG_PACKET=y 428CONFIG_PACKET=y
422# CONFIG_PACKET_MMAP is not set 429# CONFIG_PACKET_MMAP is not set
423# CONFIG_NETLINK_DEV is not set
424CONFIG_UNIX=y 430CONFIG_UNIX=y
425CONFIG_NET_KEY=m 431CONFIG_NET_KEY=m
426CONFIG_INET=y 432CONFIG_INET=y
@@ -588,7 +594,6 @@ CONFIG_PCNET32=y
588# CONFIG_DGRS is not set 594# CONFIG_DGRS is not set
589# CONFIG_EEPRO100 is not set 595# CONFIG_EEPRO100 is not set
590CONFIG_E100=y 596CONFIG_E100=y
591# CONFIG_E100_NAPI is not set
592# CONFIG_FEALNX is not set 597# CONFIG_FEALNX is not set
593# CONFIG_NATSEMI is not set 598# CONFIG_NATSEMI is not set
594# CONFIG_NE2K_PCI is not set 599# CONFIG_NE2K_PCI is not set
@@ -614,6 +619,8 @@ CONFIG_E1000=y
614# CONFIG_SK98LIN is not set 619# CONFIG_SK98LIN is not set
615# CONFIG_VIA_VELOCITY is not set 620# CONFIG_VIA_VELOCITY is not set
616CONFIG_TIGON3=y 621CONFIG_TIGON3=y
622# CONFIG_BNX2 is not set
623# CONFIG_MV643XX_ETH is not set
617 624
618# 625#
619# Ethernet (10000 Mbit) 626# Ethernet (10000 Mbit)
@@ -683,20 +690,6 @@ CONFIG_INPUT_EVDEV=m
683# CONFIG_INPUT_EVBUG is not set 690# CONFIG_INPUT_EVBUG is not set
684 691
685# 692#
686# Input I/O drivers
687#
688# CONFIG_GAMEPORT is not set
689CONFIG_SOUND_GAMEPORT=y
690CONFIG_SERIO=y
691CONFIG_SERIO_I8042=y
692# CONFIG_SERIO_SERPORT is not set
693# CONFIG_SERIO_CT82C710 is not set
694# CONFIG_SERIO_PARKBD is not set
695# CONFIG_SERIO_PCIPS2 is not set
696CONFIG_SERIO_LIBPS2=y
697# CONFIG_SERIO_RAW is not set
698
699#
700# Input Device Drivers 693# Input Device Drivers
701# 694#
702CONFIG_INPUT_KEYBOARD=y 695CONFIG_INPUT_KEYBOARD=y
@@ -716,6 +709,18 @@ CONFIG_INPUT_PCSPKR=m
716# CONFIG_INPUT_UINPUT is not set 709# CONFIG_INPUT_UINPUT is not set
717 710
718# 711#
712# Hardware I/O ports
713#
714CONFIG_SERIO=y
715CONFIG_SERIO_I8042=y
716# CONFIG_SERIO_SERPORT is not set
717# CONFIG_SERIO_PARKBD is not set
718# CONFIG_SERIO_PCIPS2 is not set
719CONFIG_SERIO_LIBPS2=y
720# CONFIG_SERIO_RAW is not set
721# CONFIG_GAMEPORT is not set
722
723#
719# Character devices 724# Character devices
720# 725#
721CONFIG_VT=y 726CONFIG_VT=y
@@ -738,6 +743,7 @@ CONFIG_SERIAL_CORE=y
738CONFIG_SERIAL_CORE_CONSOLE=y 743CONFIG_SERIAL_CORE_CONSOLE=y
739# CONFIG_SERIAL_PMACZILOG is not set 744# CONFIG_SERIAL_PMACZILOG is not set
740CONFIG_SERIAL_ICOM=m 745CONFIG_SERIAL_ICOM=m
746CONFIG_SERIAL_JSM=m
741CONFIG_UNIX98_PTYS=y 747CONFIG_UNIX98_PTYS=y
742CONFIG_LEGACY_PTYS=y 748CONFIG_LEGACY_PTYS=y
743CONFIG_LEGACY_PTY_COUNT=256 749CONFIG_LEGACY_PTY_COUNT=256
@@ -766,9 +772,16 @@ CONFIG_HVCS=m
766# 772#
767# Ftape, the floppy tape device driver 773# Ftape, the floppy tape device driver
768# 774#
775# CONFIG_AGP is not set
769# CONFIG_DRM is not set 776# CONFIG_DRM is not set
770CONFIG_RAW_DRIVER=y 777CONFIG_RAW_DRIVER=y
771CONFIG_MAX_RAW_DEVS=256 778CONFIG_MAX_RAW_DEVS=256
779# CONFIG_HANGCHECK_TIMER is not set
780
781#
782# TPM devices
783#
784# CONFIG_TCG_TPM is not set
772 785
773# 786#
774# I2C support 787# I2C support
@@ -793,9 +806,9 @@ CONFIG_I2C_ALGOBIT=y
793CONFIG_I2C_AMD8111=y 806CONFIG_I2C_AMD8111=y
794# CONFIG_I2C_I801 is not set 807# CONFIG_I2C_I801 is not set
795# CONFIG_I2C_I810 is not set 808# CONFIG_I2C_I810 is not set
809# CONFIG_I2C_PIIX4 is not set
796# CONFIG_I2C_ISA is not set 810# CONFIG_I2C_ISA is not set
797CONFIG_I2C_KEYWEST=y 811CONFIG_I2C_KEYWEST=y
798# CONFIG_I2C_MPC is not set
799# CONFIG_I2C_NFORCE2 is not set 812# CONFIG_I2C_NFORCE2 is not set
800# CONFIG_I2C_PARPORT is not set 813# CONFIG_I2C_PARPORT is not set
801# CONFIG_I2C_PARPORT_LIGHT is not set 814# CONFIG_I2C_PARPORT_LIGHT is not set
@@ -822,7 +835,9 @@ CONFIG_I2C_KEYWEST=y
822# CONFIG_SENSORS_ASB100 is not set 835# CONFIG_SENSORS_ASB100 is not set
823# CONFIG_SENSORS_DS1621 is not set 836# CONFIG_SENSORS_DS1621 is not set
824# CONFIG_SENSORS_FSCHER is not set 837# CONFIG_SENSORS_FSCHER is not set
838# CONFIG_SENSORS_FSCPOS is not set
825# CONFIG_SENSORS_GL518SM is not set 839# CONFIG_SENSORS_GL518SM is not set
840# CONFIG_SENSORS_GL520SM is not set
826# CONFIG_SENSORS_IT87 is not set 841# CONFIG_SENSORS_IT87 is not set
827# CONFIG_SENSORS_LM63 is not set 842# CONFIG_SENSORS_LM63 is not set
828# CONFIG_SENSORS_LM75 is not set 843# CONFIG_SENSORS_LM75 is not set
@@ -833,9 +848,11 @@ CONFIG_I2C_KEYWEST=y
833# CONFIG_SENSORS_LM85 is not set 848# CONFIG_SENSORS_LM85 is not set
834# CONFIG_SENSORS_LM87 is not set 849# CONFIG_SENSORS_LM87 is not set
835# CONFIG_SENSORS_LM90 is not set 850# CONFIG_SENSORS_LM90 is not set
851# CONFIG_SENSORS_LM92 is not set
836# CONFIG_SENSORS_MAX1619 is not set 852# CONFIG_SENSORS_MAX1619 is not set
837# CONFIG_SENSORS_PC87360 is not set 853# CONFIG_SENSORS_PC87360 is not set
838# CONFIG_SENSORS_SMSC47B397 is not set 854# CONFIG_SENSORS_SMSC47B397 is not set
855# CONFIG_SENSORS_SIS5595 is not set
839# CONFIG_SENSORS_SMSC47M1 is not set 856# CONFIG_SENSORS_SMSC47M1 is not set
840# CONFIG_SENSORS_VIA686A is not set 857# CONFIG_SENSORS_VIA686A is not set
841# CONFIG_SENSORS_W83781D is not set 858# CONFIG_SENSORS_W83781D is not set
@@ -845,6 +862,7 @@ CONFIG_I2C_KEYWEST=y
845# 862#
846# Other I2C Chip support 863# Other I2C Chip support
847# 864#
865# CONFIG_SENSORS_DS1337 is not set
848# CONFIG_SENSORS_EEPROM is not set 866# CONFIG_SENSORS_EEPROM is not set
849# CONFIG_SENSORS_PCF8574 is not set 867# CONFIG_SENSORS_PCF8574 is not set
850# CONFIG_SENSORS_PCF8591 is not set 868# CONFIG_SENSORS_PCF8591 is not set
@@ -877,6 +895,11 @@ CONFIG_I2C_KEYWEST=y
877# Graphics support 895# Graphics support
878# 896#
879CONFIG_FB=y 897CONFIG_FB=y
898CONFIG_FB_CFB_FILLRECT=y
899CONFIG_FB_CFB_COPYAREA=y
900CONFIG_FB_CFB_IMAGEBLIT=y
901CONFIG_FB_SOFT_CURSOR=y
902CONFIG_FB_MACMODES=y
880CONFIG_FB_MODE_HELPERS=y 903CONFIG_FB_MODE_HELPERS=y
881CONFIG_FB_TILEBLITTING=y 904CONFIG_FB_TILEBLITTING=y
882# CONFIG_FB_CIRRUS is not set 905# CONFIG_FB_CIRRUS is not set
@@ -890,9 +913,8 @@ CONFIG_FB_OF=y
890# CONFIG_FB_ASILIANT is not set 913# CONFIG_FB_ASILIANT is not set
891# CONFIG_FB_IMSTT is not set 914# CONFIG_FB_IMSTT is not set
892# CONFIG_FB_VGA16 is not set 915# CONFIG_FB_VGA16 is not set
893CONFIG_FB_RIVA=y 916# CONFIG_FB_NVIDIA is not set
894CONFIG_FB_RIVA_I2C=y 917# CONFIG_FB_RIVA is not set
895# CONFIG_FB_RIVA_DEBUG is not set
896CONFIG_FB_MATROX=y 918CONFIG_FB_MATROX=y
897CONFIG_FB_MATROX_MILLENIUM=y 919CONFIG_FB_MATROX_MILLENIUM=y
898CONFIG_FB_MATROX_MYSTIQUE=y 920CONFIG_FB_MATROX_MYSTIQUE=y
@@ -913,6 +935,7 @@ CONFIG_FB_RADEON_I2C=y
913# CONFIG_FB_3DFX is not set 935# CONFIG_FB_3DFX is not set
914# CONFIG_FB_VOODOO1 is not set 936# CONFIG_FB_VOODOO1 is not set
915# CONFIG_FB_TRIDENT is not set 937# CONFIG_FB_TRIDENT is not set
938# CONFIG_FB_S1D13XXX is not set
916# CONFIG_FB_VIRTUAL is not set 939# CONFIG_FB_VIRTUAL is not set
917 940
918# 941#
@@ -946,6 +969,8 @@ CONFIG_LCD_DEVICE=y
946# 969#
947# USB support 970# USB support
948# 971#
972CONFIG_USB_ARCH_HAS_HCD=y
973CONFIG_USB_ARCH_HAS_OHCI=y
949CONFIG_USB=y 974CONFIG_USB=y
950# CONFIG_USB_DEBUG is not set 975# CONFIG_USB_DEBUG is not set
951 976
@@ -956,8 +981,6 @@ CONFIG_USB_DEVICEFS=y
956# CONFIG_USB_BANDWIDTH is not set 981# CONFIG_USB_BANDWIDTH is not set
957# CONFIG_USB_DYNAMIC_MINORS is not set 982# CONFIG_USB_DYNAMIC_MINORS is not set
958# CONFIG_USB_OTG is not set 983# CONFIG_USB_OTG is not set
959CONFIG_USB_ARCH_HAS_HCD=y
960CONFIG_USB_ARCH_HAS_OHCI=y
961 984
962# 985#
963# USB Host Controller Drivers 986# USB Host Controller Drivers
@@ -966,6 +989,8 @@ CONFIG_USB_EHCI_HCD=y
966# CONFIG_USB_EHCI_SPLIT_ISO is not set 989# CONFIG_USB_EHCI_SPLIT_ISO is not set
967# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 990# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
968CONFIG_USB_OHCI_HCD=y 991CONFIG_USB_OHCI_HCD=y
992# CONFIG_USB_OHCI_BIG_ENDIAN is not set
993CONFIG_USB_OHCI_LITTLE_ENDIAN=y
969# CONFIG_USB_UHCI_HCD is not set 994# CONFIG_USB_UHCI_HCD is not set
970# CONFIG_USB_SL811_HCD is not set 995# CONFIG_USB_SL811_HCD is not set
971 996
@@ -981,12 +1006,11 @@ CONFIG_USB_OHCI_HCD=y
981# 1006#
982CONFIG_USB_STORAGE=m 1007CONFIG_USB_STORAGE=m
983# CONFIG_USB_STORAGE_DEBUG is not set 1008# CONFIG_USB_STORAGE_DEBUG is not set
984CONFIG_USB_STORAGE_RW_DETECT=y
985# CONFIG_USB_STORAGE_DATAFAB is not set 1009# CONFIG_USB_STORAGE_DATAFAB is not set
986# CONFIG_USB_STORAGE_FREECOM is not set 1010# CONFIG_USB_STORAGE_FREECOM is not set
987# CONFIG_USB_STORAGE_ISD200 is not set 1011# CONFIG_USB_STORAGE_ISD200 is not set
988# CONFIG_USB_STORAGE_DPCM is not set 1012# CONFIG_USB_STORAGE_DPCM is not set
989# CONFIG_USB_STORAGE_HP8200e is not set 1013# CONFIG_USB_STORAGE_USBAT is not set
990# CONFIG_USB_STORAGE_SDDR09 is not set 1014# CONFIG_USB_STORAGE_SDDR09 is not set
991# CONFIG_USB_STORAGE_SDDR55 is not set 1015# CONFIG_USB_STORAGE_SDDR55 is not set
992# CONFIG_USB_STORAGE_JUMPSHOT is not set 1016# CONFIG_USB_STORAGE_JUMPSHOT is not set
@@ -1030,6 +1054,7 @@ CONFIG_USB_HIDDEV=y
1030CONFIG_USB_PEGASUS=y 1054CONFIG_USB_PEGASUS=y
1031# CONFIG_USB_RTL8150 is not set 1055# CONFIG_USB_RTL8150 is not set
1032# CONFIG_USB_USBNET is not set 1056# CONFIG_USB_USBNET is not set
1057# CONFIG_USB_MON is not set
1033 1058
1034# 1059#
1035# USB port drivers 1060# USB port drivers
@@ -1055,6 +1080,7 @@ CONFIG_USB_PEGASUS=y
1055# CONFIG_USB_PHIDGETKIT is not set 1080# CONFIG_USB_PHIDGETKIT is not set
1056# CONFIG_USB_PHIDGETSERVO is not set 1081# CONFIG_USB_PHIDGETSERVO is not set
1057# CONFIG_USB_IDMOUSE is not set 1082# CONFIG_USB_IDMOUSE is not set
1083# CONFIG_USB_SISUSBVGA is not set
1058# CONFIG_USB_TEST is not set 1084# CONFIG_USB_TEST is not set
1059 1085
1060# 1086#
@@ -1276,10 +1302,13 @@ CONFIG_OPROFILE=y
1276# 1302#
1277# Kernel hacking 1303# Kernel hacking
1278# 1304#
1305# CONFIG_PRINTK_TIME is not set
1279CONFIG_DEBUG_KERNEL=y 1306CONFIG_DEBUG_KERNEL=y
1280CONFIG_MAGIC_SYSRQ=y 1307CONFIG_MAGIC_SYSRQ=y
1308CONFIG_LOG_BUF_SHIFT=17
1281# CONFIG_SCHEDSTATS is not set 1309# CONFIG_SCHEDSTATS is not set
1282# CONFIG_DEBUG_SLAB is not set 1310# CONFIG_DEBUG_SLAB is not set
1311# CONFIG_DEBUG_SPINLOCK is not set
1283# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1312# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1284# CONFIG_DEBUG_KOBJECT is not set 1313# CONFIG_DEBUG_KOBJECT is not set
1285# CONFIG_DEBUG_INFO is not set 1314# CONFIG_DEBUG_INFO is not set
@@ -1311,6 +1340,7 @@ CONFIG_CRYPTO_SHA1=m
1311CONFIG_CRYPTO_SHA256=m 1340CONFIG_CRYPTO_SHA256=m
1312CONFIG_CRYPTO_SHA512=m 1341CONFIG_CRYPTO_SHA512=m
1313CONFIG_CRYPTO_WP512=m 1342CONFIG_CRYPTO_WP512=m
1343CONFIG_CRYPTO_TGR192=m
1314CONFIG_CRYPTO_DES=y 1344CONFIG_CRYPTO_DES=y
1315CONFIG_CRYPTO_BLOWFISH=m 1345CONFIG_CRYPTO_BLOWFISH=m
1316CONFIG_CRYPTO_TWOFISH=m 1346CONFIG_CRYPTO_TWOFISH=m
diff --git a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S
index d3604056e1a9..b61572eb2a71 100644
--- a/arch/ppc64/kernel/entry.S
+++ b/arch/ppc64/kernel/entry.S
@@ -436,15 +436,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
436 REST_8GPRS(14, r1) 436 REST_8GPRS(14, r1)
437 REST_10GPRS(22, r1) 437 REST_10GPRS(22, r1)
438 438
439#ifdef CONFIG_PPC_ISERIES
440 clrrdi r7,r1,THREAD_SHIFT /* get current_thread_info() */
441 ld r7,TI_FLAGS(r7) /* Get run light flag */
442 mfspr r9,CTRLF
443 srdi r7,r7,TIF_RUN_LIGHT
444 insrdi r9,r7,1,63 /* Insert run light into CTRL */
445 mtspr CTRLT,r9
446#endif
447
448 /* convert old thread to its task_struct for return value */ 439 /* convert old thread to its task_struct for return value */
449 addi r3,r3,-THREAD 440 addi r3,r3,-THREAD
450 ld r7,_NIP(r1) /* Return to _switch caller in new task */ 441 ld r7,_NIP(r1) /* Return to _switch caller in new task */
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 92a744c31ab1..346dbf606b5d 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -626,10 +626,10 @@ system_reset_iSeries:
626 lhz r24,PACAPACAINDEX(r13) /* Get processor # */ 626 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
627 cmpwi 0,r24,0 /* Are we processor 0? */ 627 cmpwi 0,r24,0 /* Are we processor 0? */
628 beq .__start_initialization_iSeries /* Start up the first processor */ 628 beq .__start_initialization_iSeries /* Start up the first processor */
629 mfspr r4,CTRLF 629 mfspr r4,SPRN_CTRLF
630 li r5,RUNLATCH /* Turn off the run light */ 630 li r5,CTRL_RUNLATCH /* Turn off the run light */
631 andc r4,r4,r5 631 andc r4,r4,r5
632 mtspr CTRLT,r4 632 mtspr SPRN_CTRLT,r4
633 633
6341: 6341:
635 HMT_LOW 635 HMT_LOW
@@ -2082,9 +2082,9 @@ _GLOBAL(hmt_start_secondary)
2082 mfspr r4, HID0 2082 mfspr r4, HID0
2083 ori r4, r4, 0x1 2083 ori r4, r4, 0x1
2084 mtspr HID0, r4 2084 mtspr HID0, r4
2085 mfspr r4, CTRLF 2085 mfspr r4, SPRN_CTRLF
2086 oris r4, r4, 0x40 2086 oris r4, r4, 0x40
2087 mtspr CTRLT, r4 2087 mtspr SPRN_CTRLT, r4
2088 blr 2088 blr
2089#endif 2089#endif
2090 2090
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index da20120f2261..6d06eb550a3f 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -852,6 +852,28 @@ static int __init iSeries_src_init(void)
852 852
853late_initcall(iSeries_src_init); 853late_initcall(iSeries_src_init);
854 854
855static int set_spread_lpevents(char *str)
856{
857 unsigned long i;
858 unsigned long val = simple_strtoul(str, NULL, 0);
859
860 /*
861 * The parameter is the number of processors to share in processing
862 * lp events.
863 */
864 if (( val > 0) && (val <= NR_CPUS)) {
865 for (i = 1; i < val; ++i)
866 paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
867
868 printk("lpevent processing spread over %ld processors\n", val);
869 } else {
870 printk("invalid spread_lpevents %ld\n", val);
871 }
872
873 return 1;
874}
875__setup("spread_lpevents=", set_spread_lpevents);
876
855void __init iSeries_early_setup(void) 877void __init iSeries_early_setup(void)
856{ 878{
857 iSeries_fixup_klimit(); 879 iSeries_fixup_klimit();
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 6abc621d3ba0..f24ce2b87200 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -75,13 +75,9 @@ static int iSeries_idle(void)
75{ 75{
76 struct paca_struct *lpaca; 76 struct paca_struct *lpaca;
77 long oldval; 77 long oldval;
78 unsigned long CTRL;
79 78
80 /* ensure iSeries run light will be out when idle */ 79 /* ensure iSeries run light will be out when idle */
81 clear_thread_flag(TIF_RUN_LIGHT); 80 ppc64_runlatch_off();
82 CTRL = mfspr(CTRLF);
83 CTRL &= ~RUNLATCH;
84 mtspr(CTRLT, CTRL);
85 81
86 lpaca = get_paca(); 82 lpaca = get_paca();
87 83
@@ -111,7 +107,9 @@ static int iSeries_idle(void)
111 } 107 }
112 } 108 }
113 109
110 ppc64_runlatch_on();
114 schedule(); 111 schedule();
112 ppc64_runlatch_off();
115 } 113 }
116 114
117 return 0; 115 return 0;
diff --git a/arch/ppc64/kernel/kprobes.c b/arch/ppc64/kernel/kprobes.c
index 103daaf73573..e950a2058a19 100644
--- a/arch/ppc64/kernel/kprobes.c
+++ b/arch/ppc64/kernel/kprobes.c
@@ -45,12 +45,17 @@ static struct pt_regs jprobe_saved_regs;
45 45
46int arch_prepare_kprobe(struct kprobe *p) 46int arch_prepare_kprobe(struct kprobe *p)
47{ 47{
48 int ret = 0;
48 kprobe_opcode_t insn = *p->addr; 49 kprobe_opcode_t insn = *p->addr;
49 50
50 if (IS_MTMSRD(insn) || IS_RFID(insn)) 51 if ((unsigned long)p->addr & 0x03) {
51 /* cannot put bp on RFID/MTMSRD */ 52 printk("Attempt to register kprobe at an unaligned address\n");
52 return 1; 53 ret = -EINVAL;
53 return 0; 54 } else if (IS_MTMSRD(insn) || IS_RFID(insn)) {
55 printk("Cannot register a kprobe on rfid or mtmsrd\n");
56 ret = -EINVAL;
57 }
58 return ret;
54} 59}
55 60
56void arch_copy_kprobe(struct kprobe *p) 61void arch_copy_kprobe(struct kprobe *p)
@@ -172,8 +177,6 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs)
172 ret = emulate_step(regs, p->ainsn.insn[0]); 177 ret = emulate_step(regs, p->ainsn.insn[0]);
173 if (ret == 0) 178 if (ret == 0)
174 regs->nip = (unsigned long)p->addr + 4; 179 regs->nip = (unsigned long)p->addr + 4;
175
176 regs->msr &= ~MSR_SE;
177} 180}
178 181
179static inline int post_kprobe_handler(struct pt_regs *regs) 182static inline int post_kprobe_handler(struct pt_regs *regs)
@@ -210,6 +213,7 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
210 213
211 if (kprobe_status & KPROBE_HIT_SS) { 214 if (kprobe_status & KPROBE_HIT_SS) {
212 resume_execution(current_kprobe, regs); 215 resume_execution(current_kprobe, regs);
216 regs->msr &= ~MSR_SE;
213 regs->msr |= kprobe_saved_msr; 217 regs->msr |= kprobe_saved_msr;
214 218
215 unlock_kprobes(); 219 unlock_kprobes();
@@ -233,8 +237,6 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
233 */ 237 */
234 preempt_disable(); 238 preempt_disable();
235 switch (val) { 239 switch (val) {
236 case DIE_IABR_MATCH:
237 case DIE_DABR_MATCH:
238 case DIE_BPT: 240 case DIE_BPT:
239 if (kprobe_handler(args->regs)) 241 if (kprobe_handler(args->regs))
240 ret = NOTIFY_STOP; 242 ret = NOTIFY_STOP;
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index b944717c1dbd..e3c73b3425dc 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -792,7 +792,7 @@ _GLOBAL(sys_call_table32)
792 .llong .compat_sys_newstat 792 .llong .compat_sys_newstat
793 .llong .compat_sys_newlstat 793 .llong .compat_sys_newlstat
794 .llong .compat_sys_newfstat 794 .llong .compat_sys_newfstat
795 .llong .sys_uname 795 .llong .sys32_uname
796 .llong .sys_ni_syscall /* 110 old iopl syscall */ 796 .llong .sys_ni_syscall /* 110 old iopl syscall */
797 .llong .sys_vhangup 797 .llong .sys_vhangup
798 .llong .sys_ni_syscall /* old idle syscall */ 798 .llong .sys_ni_syscall /* old idle syscall */
diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c
index 8b0686122738..cdfecbeb331f 100644
--- a/arch/ppc64/kernel/process.c
+++ b/arch/ppc64/kernel/process.c
@@ -378,9 +378,6 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
378 childregs->gpr[1] = sp + sizeof(struct pt_regs); 378 childregs->gpr[1] = sp + sizeof(struct pt_regs);
379 p->thread.regs = NULL; /* no user register state */ 379 p->thread.regs = NULL; /* no user register state */
380 clear_ti_thread_flag(p->thread_info, TIF_32BIT); 380 clear_ti_thread_flag(p->thread_info, TIF_32BIT);
381#ifdef CONFIG_PPC_ISERIES
382 set_ti_thread_flag(p->thread_info, TIF_RUN_LIGHT);
383#endif
384 } else { 381 } else {
385 childregs->gpr[1] = usp; 382 childregs->gpr[1] = usp;
386 p->thread.regs = childregs; 383 p->thread.regs = childregs;
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index 3de950de3671..b7683abfbe6a 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -211,13 +211,23 @@ struct {
211 */ 211 */
212#define ADDR(x) (u32) ((unsigned long)(x) - offset) 212#define ADDR(x) (u32) ((unsigned long)(x) - offset)
213 213
214/*
215 * Error results ... some OF calls will return "-1" on error, some
216 * will return 0, some will return either. To simplify, here are
217 * macros to use with any ihandle or phandle return value to check if
218 * it is valid
219 */
220
221#define PROM_ERROR (-1u)
222#define PHANDLE_VALID(p) ((p) != 0 && (p) != PROM_ERROR)
223#define IHANDLE_VALID(i) ((i) != 0 && (i) != PROM_ERROR)
224
225
214/* This is the one and *ONLY* place where we actually call open 226/* This is the one and *ONLY* place where we actually call open
215 * firmware from, since we need to make sure we're running in 32b 227 * firmware from, since we need to make sure we're running in 32b
216 * mode when we do. We switch back to 64b mode upon return. 228 * mode when we do. We switch back to 64b mode upon return.
217 */ 229 */
218 230
219#define PROM_ERROR (-1)
220
221static int __init call_prom(const char *service, int nargs, int nret, ...) 231static int __init call_prom(const char *service, int nargs, int nret, ...)
222{ 232{
223 int i; 233 int i;
@@ -587,14 +597,13 @@ static void __init prom_send_capabilities(void)
587{ 597{
588 unsigned long offset = reloc_offset(); 598 unsigned long offset = reloc_offset();
589 ihandle elfloader; 599 ihandle elfloader;
590 int ret;
591 600
592 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader")); 601 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));
593 if (elfloader == 0) { 602 if (elfloader == 0) {
594 prom_printf("couldn't open /packages/elf-loader\n"); 603 prom_printf("couldn't open /packages/elf-loader\n");
595 return; 604 return;
596 } 605 }
597 ret = call_prom("call-method", 3, 1, ADDR("process-elf-header"), 606 call_prom("call-method", 3, 1, ADDR("process-elf-header"),
598 elfloader, ADDR(&fake_elf)); 607 elfloader, ADDR(&fake_elf));
599 call_prom("close", 1, 0, elfloader); 608 call_prom("close", 1, 0, elfloader);
600} 609}
@@ -646,7 +655,7 @@ static unsigned long __init alloc_up(unsigned long size, unsigned long align)
646 base = _ALIGN_UP(base + 0x100000, align)) { 655 base = _ALIGN_UP(base + 0x100000, align)) {
647 prom_debug(" trying: 0x%x\n\r", base); 656 prom_debug(" trying: 0x%x\n\r", base);
648 addr = (unsigned long)prom_claim(base, size, 0); 657 addr = (unsigned long)prom_claim(base, size, 0);
649 if ((int)addr != PROM_ERROR) 658 if (addr != PROM_ERROR)
650 break; 659 break;
651 addr = 0; 660 addr = 0;
652 if (align == 0) 661 if (align == 0)
@@ -708,7 +717,7 @@ static unsigned long __init alloc_down(unsigned long size, unsigned long align,
708 for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) { 717 for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) {
709 prom_debug(" trying: 0x%x\n\r", base); 718 prom_debug(" trying: 0x%x\n\r", base);
710 addr = (unsigned long)prom_claim(base, size, 0); 719 addr = (unsigned long)prom_claim(base, size, 0);
711 if ((int)addr != PROM_ERROR) 720 if (addr != PROM_ERROR)
712 break; 721 break;
713 addr = 0; 722 addr = 0;
714 } 723 }
@@ -902,18 +911,19 @@ static void __init prom_instantiate_rtas(void)
902{ 911{
903 unsigned long offset = reloc_offset(); 912 unsigned long offset = reloc_offset();
904 struct prom_t *_prom = PTRRELOC(&prom); 913 struct prom_t *_prom = PTRRELOC(&prom);
905 phandle prom_rtas, rtas_node; 914 phandle rtas_node;
915 ihandle rtas_inst;
906 u32 base, entry = 0; 916 u32 base, entry = 0;
907 u32 size = 0; 917 u32 size = 0;
908 918
909 prom_debug("prom_instantiate_rtas: start...\n"); 919 prom_debug("prom_instantiate_rtas: start...\n");
910 920
911 prom_rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); 921 rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas"));
912 prom_debug("prom_rtas: %x\n", prom_rtas); 922 prom_debug("rtas_node: %x\n", rtas_node);
913 if (prom_rtas == (phandle) -1) 923 if (!PHANDLE_VALID(rtas_node))
914 return; 924 return;
915 925
916 prom_getprop(prom_rtas, "rtas-size", &size, sizeof(size)); 926 prom_getprop(rtas_node, "rtas-size", &size, sizeof(size));
917 if (size == 0) 927 if (size == 0)
918 return; 928 return;
919 929
@@ -922,14 +932,18 @@ static void __init prom_instantiate_rtas(void)
922 prom_printf("RTAS allocation failed !\n"); 932 prom_printf("RTAS allocation failed !\n");
923 return; 933 return;
924 } 934 }
925 prom_printf("instantiating rtas at 0x%x", base);
926 935
927 rtas_node = call_prom("open", 1, 1, ADDR("/rtas")); 936 rtas_inst = call_prom("open", 1, 1, ADDR("/rtas"));
928 prom_printf("..."); 937 if (!IHANDLE_VALID(rtas_inst)) {
938 prom_printf("opening rtas package failed");
939 return;
940 }
941
942 prom_printf("instantiating rtas at 0x%x ...", base);
929 943
930 if (call_prom("call-method", 3, 2, 944 if (call_prom("call-method", 3, 2,
931 ADDR("instantiate-rtas"), 945 ADDR("instantiate-rtas"),
932 rtas_node, base) != PROM_ERROR) { 946 rtas_inst, base) != PROM_ERROR) {
933 entry = (long)_prom->args.rets[1]; 947 entry = (long)_prom->args.rets[1];
934 } 948 }
935 if (entry == 0) { 949 if (entry == 0) {
@@ -940,8 +954,8 @@ static void __init prom_instantiate_rtas(void)
940 954
941 reserve_mem(base, size); 955 reserve_mem(base, size);
942 956
943 prom_setprop(prom_rtas, "linux,rtas-base", &base, sizeof(base)); 957 prom_setprop(rtas_node, "linux,rtas-base", &base, sizeof(base));
944 prom_setprop(prom_rtas, "linux,rtas-entry", &entry, sizeof(entry)); 958 prom_setprop(rtas_node, "linux,rtas-entry", &entry, sizeof(entry));
945 959
946 prom_debug("rtas base = 0x%x\n", base); 960 prom_debug("rtas base = 0x%x\n", base);
947 prom_debug("rtas entry = 0x%x\n", entry); 961 prom_debug("rtas entry = 0x%x\n", entry);
@@ -1062,7 +1076,7 @@ static void __init prom_initialize_tce_table(void)
1062 1076
1063 prom_printf("opening PHB %s", path); 1077 prom_printf("opening PHB %s", path);
1064 phb_node = call_prom("open", 1, 1, path); 1078 phb_node = call_prom("open", 1, 1, path);
1065 if ( (long)phb_node <= 0) 1079 if (phb_node == 0)
1066 prom_printf("... failed\n"); 1080 prom_printf("... failed\n");
1067 else 1081 else
1068 prom_printf("... done\n"); 1082 prom_printf("... done\n");
@@ -1279,12 +1293,12 @@ static void __init prom_init_client_services(unsigned long pp)
1279 1293
1280 /* get a handle for the stdout device */ 1294 /* get a handle for the stdout device */
1281 _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen")); 1295 _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));
1282 if ((long)_prom->chosen <= 0) 1296 if (!PHANDLE_VALID(_prom->chosen))
1283 prom_panic("cannot find chosen"); /* msg won't be printed :( */ 1297 prom_panic("cannot find chosen"); /* msg won't be printed :( */
1284 1298
1285 /* get device tree root */ 1299 /* get device tree root */
1286 _prom->root = call_prom("finddevice", 1, 1, ADDR("/")); 1300 _prom->root = call_prom("finddevice", 1, 1, ADDR("/"));
1287 if ((long)_prom->root <= 0) 1301 if (!PHANDLE_VALID(_prom->root))
1288 prom_panic("cannot find device tree root"); /* msg won't be printed :( */ 1302 prom_panic("cannot find device tree root"); /* msg won't be printed :( */
1289} 1303}
1290 1304
@@ -1356,9 +1370,8 @@ static int __init prom_find_machine_type(void)
1356 } 1370 }
1357 /* Default to pSeries. We need to know if we are running LPAR */ 1371 /* Default to pSeries. We need to know if we are running LPAR */
1358 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); 1372 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));
1359 if (rtas != (phandle) -1) { 1373 if (PHANDLE_VALID(rtas)) {
1360 unsigned long x; 1374 int x = prom_getproplen(rtas, "ibm,hypertas-functions");
1361 x = prom_getproplen(rtas, "ibm,hypertas-functions");
1362 if (x != PROM_ERROR) { 1375 if (x != PROM_ERROR) {
1363 prom_printf("Hypertas detected, assuming LPAR !\n"); 1376 prom_printf("Hypertas detected, assuming LPAR !\n");
1364 return PLATFORM_PSERIES_LPAR; 1377 return PLATFORM_PSERIES_LPAR;
@@ -1426,12 +1439,13 @@ static void __init prom_check_displays(void)
1426 * leave some room at the end of the path for appending extra 1439 * leave some room at the end of the path for appending extra
1427 * arguments 1440 * arguments
1428 */ 1441 */
1429 if (call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-10) < 0) 1442 if (call_prom("package-to-path", 3, 1, node, path,
1443 PROM_SCRATCH_SIZE-10) == PROM_ERROR)
1430 continue; 1444 continue;
1431 prom_printf("found display : %s, opening ... ", path); 1445 prom_printf("found display : %s, opening ... ", path);
1432 1446
1433 ih = call_prom("open", 1, 1, path); 1447 ih = call_prom("open", 1, 1, path);
1434 if (ih == (ihandle)0 || ih == (ihandle)-1) { 1448 if (ih == 0) {
1435 prom_printf("failed\n"); 1449 prom_printf("failed\n");
1436 continue; 1450 continue;
1437 } 1451 }
@@ -1514,6 +1528,12 @@ static unsigned long __init dt_find_string(char *str)
1514 return 0; 1528 return 0;
1515} 1529}
1516 1530
1531/*
1532 * The Open Firmware 1275 specification states properties must be 31 bytes or
1533 * less, however not all firmwares obey this. Make it 64 bytes to be safe.
1534 */
1535#define MAX_PROPERTY_NAME 64
1536
1517static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start, 1537static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1518 unsigned long *mem_end) 1538 unsigned long *mem_end)
1519{ 1539{
@@ -1527,10 +1547,12 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1527 /* get and store all property names */ 1547 /* get and store all property names */
1528 prev_name = RELOC(""); 1548 prev_name = RELOC("");
1529 for (;;) { 1549 for (;;) {
1530 1550 int rc;
1531 /* 32 is max len of name including nul. */ 1551
1532 namep = make_room(mem_start, mem_end, 32, 1); 1552 /* 64 is max len of name including nul. */
1533 if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0) { 1553 namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1);
1554 rc = call_prom("nextprop", 3, 1, node, prev_name, namep);
1555 if (rc != 1) {
1534 /* No more nodes: unwind alloc */ 1556 /* No more nodes: unwind alloc */
1535 *mem_start = (unsigned long)namep; 1557 *mem_start = (unsigned long)namep;
1536 break; 1558 break;
@@ -1555,12 +1577,6 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1555 } 1577 }
1556} 1578}
1557 1579
1558/*
1559 * The Open Firmware 1275 specification states properties must be 31 bytes or
1560 * less, however not all firmwares obey this. Make it 64 bytes to be safe.
1561 */
1562#define MAX_PROPERTY_NAME 64
1563
1564static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, 1580static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1565 unsigned long *mem_end) 1581 unsigned long *mem_end)
1566{ 1582{
@@ -1607,7 +1623,10 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1607 prev_name = RELOC(""); 1623 prev_name = RELOC("");
1608 sstart = (char *)RELOC(dt_string_start); 1624 sstart = (char *)RELOC(dt_string_start);
1609 for (;;) { 1625 for (;;) {
1610 if (call_prom("nextprop", 3, 1, node, prev_name, pname) <= 0) 1626 int rc;
1627
1628 rc = call_prom("nextprop", 3, 1, node, prev_name, pname);
1629 if (rc != 1)
1611 break; 1630 break;
1612 1631
1613 /* find string offset */ 1632 /* find string offset */
@@ -1623,7 +1642,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1623 l = call_prom("getproplen", 2, 1, node, pname); 1642 l = call_prom("getproplen", 2, 1, node, pname);
1624 1643
1625 /* sanity checks */ 1644 /* sanity checks */
1626 if (l < 0) 1645 if (l == PROM_ERROR)
1627 continue; 1646 continue;
1628 if (l > MAX_PROPERTY_LENGTH) { 1647 if (l > MAX_PROPERTY_LENGTH) {
1629 prom_printf("WARNING: ignoring large property "); 1648 prom_printf("WARNING: ignoring large property ");
@@ -1771,17 +1790,18 @@ static void __init fixup_device_tree(void)
1771 1790
1772 /* Some G5s have a missing interrupt definition, fix it up here */ 1791 /* Some G5s have a missing interrupt definition, fix it up here */
1773 u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000")); 1792 u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000"));
1774 if ((long)u3 <= 0) 1793 if (!PHANDLE_VALID(u3))
1775 return; 1794 return;
1776 i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000")); 1795 i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000"));
1777 if ((long)i2c <= 0) 1796 if (!PHANDLE_VALID(i2c))
1778 return; 1797 return;
1779 mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000")); 1798 mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000"));
1780 if ((long)mpic <= 0) 1799 if (!PHANDLE_VALID(mpic))
1781 return; 1800 return;
1782 1801
1783 /* check if proper rev of u3 */ 1802 /* check if proper rev of u3 */
1784 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) <= 0) 1803 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1804 == PROM_ERROR)
1785 return; 1805 return;
1786 if (u3_rev != 0x35) 1806 if (u3_rev != 0x35)
1787 return; 1807 return;
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index 21c57f539c29..dce198d39328 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -103,11 +103,6 @@ extern void unflatten_device_tree(void);
103 103
104extern void smp_release_cpus(void); 104extern void smp_release_cpus(void);
105 105
106unsigned long decr_overclock = 1;
107unsigned long decr_overclock_proc0 = 1;
108unsigned long decr_overclock_set = 0;
109unsigned long decr_overclock_proc0_set = 0;
110
111int have_of = 1; 106int have_of = 1;
112int boot_cpuid = 0; 107int boot_cpuid = 0;
113int boot_cpuid_phys = 0; 108int boot_cpuid_phys = 0;
@@ -1120,64 +1115,15 @@ void ppc64_dump_msg(unsigned int src, const char *msg)
1120 printk("[dump]%04x %s\n", src, msg); 1115 printk("[dump]%04x %s\n", src, msg);
1121} 1116}
1122 1117
1123int set_spread_lpevents( char * str )
1124{
1125 /* The parameter is the number of processors to share in processing lp events */
1126 unsigned long i;
1127 unsigned long val = simple_strtoul( str, NULL, 0 );
1128 if ( ( val > 0 ) && ( val <= NR_CPUS ) ) {
1129 for ( i=1; i<val; ++i )
1130 paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
1131 printk("lpevent processing spread over %ld processors\n", val);
1132 }
1133 else
1134 printk("invalid spreaqd_lpevents %ld\n", val);
1135 return 1;
1136}
1137
1138/* This should only be called on processor 0 during calibrate decr */ 1118/* This should only be called on processor 0 during calibrate decr */
1139void setup_default_decr(void) 1119void setup_default_decr(void)
1140{ 1120{
1141 struct paca_struct *lpaca = get_paca(); 1121 struct paca_struct *lpaca = get_paca();
1142 1122
1143 if ( decr_overclock_set && !decr_overclock_proc0_set ) 1123 lpaca->default_decr = tb_ticks_per_jiffy;
1144 decr_overclock_proc0 = decr_overclock;
1145
1146 lpaca->default_decr = tb_ticks_per_jiffy / decr_overclock_proc0;
1147 lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy; 1124 lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
1148} 1125}
1149 1126
1150int set_decr_overclock_proc0( char * str )
1151{
1152 unsigned long val = simple_strtoul( str, NULL, 0 );
1153 if ( ( val >= 1 ) && ( val <= 48 ) ) {
1154 decr_overclock_proc0_set = 1;
1155 decr_overclock_proc0 = val;
1156 printk("proc 0 decrementer overclock factor of %ld\n", val);
1157 }
1158 else
1159 printk("invalid proc 0 decrementer overclock factor of %ld\n", val);
1160 return 1;
1161}
1162
1163int set_decr_overclock( char * str )
1164{
1165 unsigned long val = simple_strtoul( str, NULL, 0 );
1166 if ( ( val >= 1 ) && ( val <= 48 ) ) {
1167 decr_overclock_set = 1;
1168 decr_overclock = val;
1169 printk("decrementer overclock factor of %ld\n", val);
1170 }
1171 else
1172 printk("invalid decrementer overclock factor of %ld\n", val);
1173 return 1;
1174
1175}
1176
1177__setup("spread_lpevents=", set_spread_lpevents );
1178__setup("decr_overclock_proc0=", set_decr_overclock_proc0 );
1179__setup("decr_overclock=", set_decr_overclock );
1180
1181#ifndef CONFIG_PPC_ISERIES 1127#ifndef CONFIG_PPC_ISERIES
1182/* 1128/*
1183 * This function can be used by platforms to "find" legacy serial ports. 1129 * This function can be used by platforms to "find" legacy serial ports.
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
index 3b906cd94037..9ef5d36d6b25 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/ppc64/kernel/smp.c
@@ -334,7 +334,6 @@ void smp_call_function_interrupt(void)
334 } 334 }
335} 335}
336 336
337extern unsigned long decr_overclock;
338extern struct gettimeofday_struct do_gtod; 337extern struct gettimeofday_struct do_gtod;
339 338
340struct thread_info *current_set[NR_CPUS]; 339struct thread_info *current_set[NR_CPUS];
@@ -491,7 +490,7 @@ int __devinit __cpu_up(unsigned int cpu)
491 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)) 490 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu))
492 return -EINVAL; 491 return -EINVAL;
493 492
494 paca[cpu].default_decr = tb_ticks_per_jiffy / decr_overclock; 493 paca[cpu].default_decr = tb_ticks_per_jiffy;
495 494
496 if (!cpu_has_feature(CPU_FTR_SLB)) { 495 if (!cpu_has_feature(CPU_FTR_SLB)) {
497 void *tmp; 496 void *tmp;
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index 7cf7a9600025..9c8e317c598d 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -791,31 +791,6 @@ asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
791} 791}
792 792
793 793
794asmlinkage int ppc64_newuname(struct new_utsname __user * name)
795{
796 int errno = sys_newuname(name);
797
798 if (current->personality == PER_LINUX32 && !errno) {
799 if(copy_to_user(name->machine, "ppc\0\0", 8)) {
800 errno = -EFAULT;
801 }
802 }
803 return errno;
804}
805
806asmlinkage int ppc64_personality(unsigned long personality)
807{
808 int ret;
809 if (current->personality == PER_LINUX32 && personality == PER_LINUX)
810 personality = PER_LINUX32;
811 ret = sys_personality(personality);
812 if (ret == PER_LINUX32)
813 ret = PER_LINUX;
814 return ret;
815}
816
817
818
819/* Note: it is necessary to treat mode as an unsigned int, 794/* Note: it is necessary to treat mode as an unsigned int,
820 * with the corresponding cast to a signed int to insure that the 795 * with the corresponding cast to a signed int to insure that the
821 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 796 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -1158,26 +1133,47 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
1158} 1133}
1159#endif 1134#endif
1160 1135
1136asmlinkage int sys32_uname(struct old_utsname __user * name)
1137{
1138 int err = 0;
1139
1140 down_read(&uts_sem);
1141 if (copy_to_user(name, &system_utsname, sizeof(*name)))
1142 err = -EFAULT;
1143 up_read(&uts_sem);
1144 if (!err && personality(current->personality) == PER_LINUX32) {
1145 /* change "ppc64" to "ppc" */
1146 if (__put_user(0, name->machine + 3)
1147 || __put_user(0, name->machine + 4))
1148 err = -EFAULT;
1149 }
1150 return err;
1151}
1152
1161asmlinkage int sys32_olduname(struct oldold_utsname __user * name) 1153asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
1162{ 1154{
1163 int error; 1155 int error;
1164 1156
1165 if (!name)
1166 return -EFAULT;
1167 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) 1157 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
1168 return -EFAULT; 1158 return -EFAULT;
1169 1159
1170 down_read(&uts_sem); 1160 down_read(&uts_sem);
1171 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); 1161 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
1172 error -= __put_user(0,name->sysname+__OLD_UTS_LEN); 1162 error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
1173 error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); 1163 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
1174 error -= __put_user(0,name->nodename+__OLD_UTS_LEN); 1164 error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
1175 error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); 1165 error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
1176 error -= __put_user(0,name->release+__OLD_UTS_LEN); 1166 error |= __put_user(0,name->release+__OLD_UTS_LEN);
1177 error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); 1167 error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
1178 error -= __put_user(0,name->version+__OLD_UTS_LEN); 1168 error |= __put_user(0,name->version+__OLD_UTS_LEN);
1179 error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 1169 error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
1180 error = __put_user(0,name->machine+__OLD_UTS_LEN); 1170 error |= __put_user(0,name->machine+__OLD_UTS_LEN);
1171 if (personality(current->personality) == PER_LINUX32) {
1172 /* change "ppc64" to "ppc" */
1173 error |= __put_user(0, name->machine + 3);
1174 error |= __put_user(0, name->machine + 4);
1175 }
1176
1181 up_read(&uts_sem); 1177 up_read(&uts_sem);
1182 1178
1183 error = error ? -EFAULT : 0; 1179 error = error ? -EFAULT : 0;
diff --git a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c
index f2865ff8d2f9..a8cbb202b8cd 100644
--- a/arch/ppc64/kernel/syscalls.c
+++ b/arch/ppc64/kernel/syscalls.c
@@ -199,24 +199,33 @@ out:
199 return ret; 199 return ret;
200} 200}
201 201
202static int __init set_fakeppc(char *str) 202long ppc64_personality(unsigned long personality)
203{ 203{
204 if (*str) 204 long ret;
205 return 0; 205
206 init_task.personality = PER_LINUX32; 206 if (personality(current->personality) == PER_LINUX32
207 return 1; 207 && personality == PER_LINUX)
208 personality = PER_LINUX32;
209 ret = sys_personality(personality);
210 if (ret == PER_LINUX32)
211 ret = PER_LINUX;
212 return ret;
208} 213}
209__setup("fakeppc", set_fakeppc);
210 214
211asmlinkage int sys_uname(struct old_utsname __user * name) 215long ppc64_newuname(struct new_utsname __user * name)
212{ 216{
213 int err = -EFAULT; 217 int err = 0;
214 218
215 down_read(&uts_sem); 219 down_read(&uts_sem);
216 if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) 220 if (copy_to_user(name, &system_utsname, sizeof(*name)))
217 err = 0; 221 err = -EFAULT;
218 up_read(&uts_sem); 222 up_read(&uts_sem);
219 223 if (!err && personality(current->personality) == PER_LINUX32) {
224 /* change ppc64 to ppc */
225 if (__put_user(0, name->machine + 3)
226 || __put_user(0, name->machine + 4))
227 err = -EFAULT;
228 }
220 return err; 229 return err;
221} 230}
222 231
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index 0925694c3ce5..c8fa6569b2fd 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -113,7 +113,6 @@ void ppc64_enable_pmcs(void)
113#ifdef CONFIG_PPC_PSERIES 113#ifdef CONFIG_PPC_PSERIES
114 unsigned long set, reset; 114 unsigned long set, reset;
115 int ret; 115 int ret;
116 unsigned int ctrl;
117#endif /* CONFIG_PPC_PSERIES */ 116#endif /* CONFIG_PPC_PSERIES */
118 117
119 /* Only need to enable them once */ 118 /* Only need to enable them once */
@@ -167,11 +166,8 @@ void ppc64_enable_pmcs(void)
167 * On SMT machines we have to set the run latch in the ctrl register 166 * On SMT machines we have to set the run latch in the ctrl register
168 * in order to make PMC6 spin. 167 * in order to make PMC6 spin.
169 */ 168 */
170 if (cpu_has_feature(CPU_FTR_SMT)) { 169 if (cpu_has_feature(CPU_FTR_SMT))
171 ctrl = mfspr(CTRLF); 170 ppc64_runlatch_on();
172 ctrl |= RUNLATCH;
173 mtspr(CTRLT, ctrl);
174 }
175#endif /* CONFIG_PPC_PSERIES */ 171#endif /* CONFIG_PPC_PSERIES */
176} 172}
177 173
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 01ae1964c938..c067435bae45 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -28,6 +28,7 @@
28//#include <linux/kernel_stat.h> 28//#include <linux/kernel_stat.h>
29#include <linux/notifier.h> 29#include <linux/notifier.h>
30#include <linux/cpu.h> 30#include <linux/cpu.h>
31#include <linux/workqueue.h>
31 32
32#include "appldata.h" 33#include "appldata.h"
33 34
@@ -133,9 +134,12 @@ static int appldata_interval = APPLDATA_CPU_INTERVAL;
133static int appldata_timer_active; 134static int appldata_timer_active;
134 135
135/* 136/*
136 * Tasklet 137 * Work queue
137 */ 138 */
138static struct tasklet_struct appldata_tasklet_struct; 139static struct workqueue_struct *appldata_wq;
140static void appldata_work_fn(void *data);
141static DECLARE_WORK(appldata_work, appldata_work_fn, NULL);
142
139 143
140/* 144/*
141 * Ops list 145 * Ops list
@@ -144,11 +148,11 @@ static DEFINE_SPINLOCK(appldata_ops_lock);
144static LIST_HEAD(appldata_ops_list); 148static LIST_HEAD(appldata_ops_list);
145 149
146 150
147/************************* timer, tasklet, DIAG ******************************/ 151/*************************** timer, work, DIAG *******************************/
148/* 152/*
149 * appldata_timer_function() 153 * appldata_timer_function()
150 * 154 *
151 * schedule tasklet and reschedule timer 155 * schedule work and reschedule timer
152 */ 156 */
153static void appldata_timer_function(unsigned long data, struct pt_regs *regs) 157static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
154{ 158{
@@ -157,22 +161,22 @@ static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
157 atomic_read(&appldata_expire_count)); 161 atomic_read(&appldata_expire_count));
158 if (atomic_dec_and_test(&appldata_expire_count)) { 162 if (atomic_dec_and_test(&appldata_expire_count)) {
159 atomic_set(&appldata_expire_count, num_online_cpus()); 163 atomic_set(&appldata_expire_count, num_online_cpus());
160 tasklet_schedule((struct tasklet_struct *) data); 164 queue_work(appldata_wq, (struct work_struct *) data);
161 } 165 }
162} 166}
163 167
164/* 168/*
165 * appldata_tasklet_function() 169 * appldata_work_fn()
166 * 170 *
167 * call data gathering function for each (active) module 171 * call data gathering function for each (active) module
168 */ 172 */
169static void appldata_tasklet_function(unsigned long data) 173static void appldata_work_fn(void *data)
170{ 174{
171 struct list_head *lh; 175 struct list_head *lh;
172 struct appldata_ops *ops; 176 struct appldata_ops *ops;
173 int i; 177 int i;
174 178
175 P_DEBUG(" -= Tasklet =-\n"); 179 P_DEBUG(" -= Work Queue =-\n");
176 i = 0; 180 i = 0;
177 spin_lock(&appldata_ops_lock); 181 spin_lock(&appldata_ops_lock);
178 list_for_each(lh, &appldata_ops_list) { 182 list_for_each(lh, &appldata_ops_list) {
@@ -231,7 +235,7 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
231 : "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc"); 235 : "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc");
232 return (int) ry; 236 return (int) ry;
233} 237}
234/********************** timer, tasklet, DIAG <END> ***************************/ 238/************************ timer, work, DIAG <END> ****************************/
235 239
236 240
237/****************************** /proc stuff **********************************/ 241/****************************** /proc stuff **********************************/
@@ -411,7 +415,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
411 struct list_head *lh; 415 struct list_head *lh;
412 416
413 found = 0; 417 found = 0;
414 spin_lock_bh(&appldata_ops_lock); 418 spin_lock(&appldata_ops_lock);
415 list_for_each(lh, &appldata_ops_list) { 419 list_for_each(lh, &appldata_ops_list) {
416 tmp_ops = list_entry(lh, struct appldata_ops, list); 420 tmp_ops = list_entry(lh, struct appldata_ops, list);
417 if (&tmp_ops->ctl_table[2] == ctl) { 421 if (&tmp_ops->ctl_table[2] == ctl) {
@@ -419,15 +423,15 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
419 } 423 }
420 } 424 }
421 if (!found) { 425 if (!found) {
422 spin_unlock_bh(&appldata_ops_lock); 426 spin_unlock(&appldata_ops_lock);
423 return -ENODEV; 427 return -ENODEV;
424 } 428 }
425 ops = ctl->data; 429 ops = ctl->data;
426 if (!try_module_get(ops->owner)) { // protect this function 430 if (!try_module_get(ops->owner)) { // protect this function
427 spin_unlock_bh(&appldata_ops_lock); 431 spin_unlock(&appldata_ops_lock);
428 return -ENODEV; 432 return -ENODEV;
429 } 433 }
430 spin_unlock_bh(&appldata_ops_lock); 434 spin_unlock(&appldata_ops_lock);
431 435
432 if (!*lenp || *ppos) { 436 if (!*lenp || *ppos) {
433 *lenp = 0; 437 *lenp = 0;
@@ -451,10 +455,11 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
451 return -EFAULT; 455 return -EFAULT;
452 } 456 }
453 457
454 spin_lock_bh(&appldata_ops_lock); 458 spin_lock(&appldata_ops_lock);
455 if ((buf[0] == '1') && (ops->active == 0)) { 459 if ((buf[0] == '1') && (ops->active == 0)) {
456 if (!try_module_get(ops->owner)) { // protect tasklet 460 // protect work queue callback
457 spin_unlock_bh(&appldata_ops_lock); 461 if (!try_module_get(ops->owner)) {
462 spin_unlock(&appldata_ops_lock);
458 module_put(ops->owner); 463 module_put(ops->owner);
459 return -ENODEV; 464 return -ENODEV;
460 } 465 }
@@ -485,7 +490,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
485 } 490 }
486 module_put(ops->owner); 491 module_put(ops->owner);
487 } 492 }
488 spin_unlock_bh(&appldata_ops_lock); 493 spin_unlock(&appldata_ops_lock);
489out: 494out:
490 *lenp = len; 495 *lenp = len;
491 *ppos += len; 496 *ppos += len;
@@ -529,7 +534,7 @@ int appldata_register_ops(struct appldata_ops *ops)
529 } 534 }
530 memset(ops->ctl_table, 0, 4*sizeof(struct ctl_table)); 535 memset(ops->ctl_table, 0, 4*sizeof(struct ctl_table));
531 536
532 spin_lock_bh(&appldata_ops_lock); 537 spin_lock(&appldata_ops_lock);
533 list_for_each(lh, &appldata_ops_list) { 538 list_for_each(lh, &appldata_ops_list) {
534 tmp_ops = list_entry(lh, struct appldata_ops, list); 539 tmp_ops = list_entry(lh, struct appldata_ops, list);
535 P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n", 540 P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n",
@@ -541,18 +546,18 @@ int appldata_register_ops(struct appldata_ops *ops)
541 APPLDATA_PROC_NAME_LENGTH) == 0) { 546 APPLDATA_PROC_NAME_LENGTH) == 0) {
542 P_ERROR("Name \"%s\" already registered!\n", ops->name); 547 P_ERROR("Name \"%s\" already registered!\n", ops->name);
543 kfree(ops->ctl_table); 548 kfree(ops->ctl_table);
544 spin_unlock_bh(&appldata_ops_lock); 549 spin_unlock(&appldata_ops_lock);
545 return -EBUSY; 550 return -EBUSY;
546 } 551 }
547 if (tmp_ops->ctl_nr == ops->ctl_nr) { 552 if (tmp_ops->ctl_nr == ops->ctl_nr) {
548 P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr); 553 P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr);
549 kfree(ops->ctl_table); 554 kfree(ops->ctl_table);
550 spin_unlock_bh(&appldata_ops_lock); 555 spin_unlock(&appldata_ops_lock);
551 return -EBUSY; 556 return -EBUSY;
552 } 557 }
553 } 558 }
554 list_add(&ops->list, &appldata_ops_list); 559 list_add(&ops->list, &appldata_ops_list);
555 spin_unlock_bh(&appldata_ops_lock); 560 spin_unlock(&appldata_ops_lock);
556 561
557 ops->ctl_table[0].ctl_name = CTL_APPLDATA; 562 ops->ctl_table[0].ctl_name = CTL_APPLDATA;
558 ops->ctl_table[0].procname = appldata_proc_name; 563 ops->ctl_table[0].procname = appldata_proc_name;
@@ -583,12 +588,12 @@ int appldata_register_ops(struct appldata_ops *ops)
583 */ 588 */
584void appldata_unregister_ops(struct appldata_ops *ops) 589void appldata_unregister_ops(struct appldata_ops *ops)
585{ 590{
586 spin_lock_bh(&appldata_ops_lock); 591 spin_lock(&appldata_ops_lock);
587 unregister_sysctl_table(ops->sysctl_header); 592 unregister_sysctl_table(ops->sysctl_header);
588 list_del(&ops->list); 593 list_del(&ops->list);
589 kfree(ops->ctl_table); 594 kfree(ops->ctl_table);
590 ops->ctl_table = NULL; 595 ops->ctl_table = NULL;
591 spin_unlock_bh(&appldata_ops_lock); 596 spin_unlock(&appldata_ops_lock);
592 P_INFO("%s-ops unregistered!\n", ops->name); 597 P_INFO("%s-ops unregistered!\n", ops->name);
593} 598}
594/********************** module-ops management <END> **************************/ 599/********************** module-ops management <END> **************************/
@@ -602,7 +607,7 @@ appldata_online_cpu(int cpu)
602 init_virt_timer(&per_cpu(appldata_timer, cpu)); 607 init_virt_timer(&per_cpu(appldata_timer, cpu));
603 per_cpu(appldata_timer, cpu).function = appldata_timer_function; 608 per_cpu(appldata_timer, cpu).function = appldata_timer_function;
604 per_cpu(appldata_timer, cpu).data = (unsigned long) 609 per_cpu(appldata_timer, cpu).data = (unsigned long)
605 &appldata_tasklet_struct; 610 &appldata_work;
606 atomic_inc(&appldata_expire_count); 611 atomic_inc(&appldata_expire_count);
607 spin_lock(&appldata_timer_lock); 612 spin_lock(&appldata_timer_lock);
608 __appldata_vtimer_setup(APPLDATA_MOD_TIMER); 613 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
@@ -615,7 +620,7 @@ appldata_offline_cpu(int cpu)
615 del_virt_timer(&per_cpu(appldata_timer, cpu)); 620 del_virt_timer(&per_cpu(appldata_timer, cpu));
616 if (atomic_dec_and_test(&appldata_expire_count)) { 621 if (atomic_dec_and_test(&appldata_expire_count)) {
617 atomic_set(&appldata_expire_count, num_online_cpus()); 622 atomic_set(&appldata_expire_count, num_online_cpus());
618 tasklet_schedule(&appldata_tasklet_struct); 623 queue_work(appldata_wq, &appldata_work);
619 } 624 }
620 spin_lock(&appldata_timer_lock); 625 spin_lock(&appldata_timer_lock);
621 __appldata_vtimer_setup(APPLDATA_MOD_TIMER); 626 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
@@ -648,7 +653,7 @@ static struct notifier_block __devinitdata appldata_nb = {
648/* 653/*
649 * appldata_init() 654 * appldata_init()
650 * 655 *
651 * init timer and tasklet, register /proc entries 656 * init timer, register /proc entries
652 */ 657 */
653static int __init appldata_init(void) 658static int __init appldata_init(void)
654{ 659{
@@ -657,6 +662,12 @@ static int __init appldata_init(void)
657 P_DEBUG("sizeof(parameter_list) = %lu\n", 662 P_DEBUG("sizeof(parameter_list) = %lu\n",
658 sizeof(struct appldata_parameter_list)); 663 sizeof(struct appldata_parameter_list));
659 664
665 appldata_wq = create_singlethread_workqueue("appldata");
666 if (!appldata_wq) {
667 P_ERROR("Could not create work queue\n");
668 return -ENOMEM;
669 }
670
660 for_each_online_cpu(i) 671 for_each_online_cpu(i)
661 appldata_online_cpu(i); 672 appldata_online_cpu(i);
662 673
@@ -670,7 +681,6 @@ static int __init appldata_init(void)
670 appldata_table[1].de->owner = THIS_MODULE; 681 appldata_table[1].de->owner = THIS_MODULE;
671#endif 682#endif
672 683
673 tasklet_init(&appldata_tasklet_struct, appldata_tasklet_function, 0);
674 P_DEBUG("Base interface initialized.\n"); 684 P_DEBUG("Base interface initialized.\n");
675 return 0; 685 return 0;
676} 686}
@@ -678,7 +688,7 @@ static int __init appldata_init(void)
678/* 688/*
679 * appldata_exit() 689 * appldata_exit()
680 * 690 *
681 * stop timer and tasklet, unregister /proc entries 691 * stop timer, unregister /proc entries
682 */ 692 */
683static void __exit appldata_exit(void) 693static void __exit appldata_exit(void)
684{ 694{
@@ -690,7 +700,7 @@ static void __exit appldata_exit(void)
690 /* 700 /*
691 * ops list should be empty, but just in case something went wrong... 701 * ops list should be empty, but just in case something went wrong...
692 */ 702 */
693 spin_lock_bh(&appldata_ops_lock); 703 spin_lock(&appldata_ops_lock);
694 list_for_each(lh, &appldata_ops_list) { 704 list_for_each(lh, &appldata_ops_list) {
695 ops = list_entry(lh, struct appldata_ops, list); 705 ops = list_entry(lh, struct appldata_ops, list);
696 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, 706 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
@@ -700,7 +710,7 @@ static void __exit appldata_exit(void)
700 "return code: %d\n", ops->name, rc); 710 "return code: %d\n", ops->name, rc);
701 } 711 }
702 } 712 }
703 spin_unlock_bh(&appldata_ops_lock); 713 spin_unlock(&appldata_ops_lock);
704 714
705 for_each_online_cpu(i) 715 for_each_online_cpu(i)
706 appldata_offline_cpu(i); 716 appldata_offline_cpu(i);
@@ -709,7 +719,7 @@ static void __exit appldata_exit(void)
709 719
710 unregister_sysctl_table(appldata_sysctl_header); 720 unregister_sysctl_table(appldata_sysctl_header);
711 721
712 tasklet_kill(&appldata_tasklet_struct); 722 destroy_workqueue(appldata_wq);
713 P_DEBUG("... module unloaded!\n"); 723 P_DEBUG("... module unloaded!\n");
714} 724}
715/**************************** init / exit <END> ******************************/ 725/**************************** init / exit <END> ******************************/
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
index 462ee9a84e76..f0e2fbed3d4c 100644
--- a/arch/s390/appldata/appldata_mem.c
+++ b/arch/s390/appldata/appldata_mem.c
@@ -68,7 +68,7 @@ struct appldata_mem_data {
68 u64 pgmajfault; /* page faults (major only) */ 68 u64 pgmajfault; /* page faults (major only) */
69// <-- New in 2.6 69// <-- New in 2.6
70 70
71} appldata_mem_data; 71} __attribute__((packed)) appldata_mem_data;
72 72
73 73
74static inline void appldata_debug_print(struct appldata_mem_data *mem_data) 74static inline void appldata_debug_print(struct appldata_mem_data *mem_data)
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index dd61638d3027..2a4c7432db4a 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -57,7 +57,7 @@ struct appldata_net_sum_data {
57 u64 rx_dropped; /* no space in linux buffers */ 57 u64 rx_dropped; /* no space in linux buffers */
58 u64 tx_dropped; /* no space available in linux */ 58 u64 tx_dropped; /* no space available in linux */
59 u64 collisions; /* collisions while transmitting */ 59 u64 collisions; /* collisions while transmitting */
60} appldata_net_sum_data; 60} __attribute__((packed)) appldata_net_sum_data;
61 61
62 62
63static inline void appldata_print_debug(struct appldata_net_sum_data *net_data) 63static inline void appldata_print_debug(struct appldata_net_sum_data *net_data)
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c
index b83f07484551..e0a476bf4fd6 100644
--- a/arch/s390/appldata/appldata_os.c
+++ b/arch/s390/appldata/appldata_os.c
@@ -49,7 +49,7 @@ struct appldata_os_per_cpu {
49 u32 per_cpu_softirq; /* ... spent in softirqs */ 49 u32 per_cpu_softirq; /* ... spent in softirqs */
50 u32 per_cpu_iowait; /* ... spent while waiting for I/O */ 50 u32 per_cpu_iowait; /* ... spent while waiting for I/O */
51// <-- New in 2.6 51// <-- New in 2.6
52}; 52} __attribute__((packed));
53 53
54struct appldata_os_data { 54struct appldata_os_data {
55 u64 timestamp; 55 u64 timestamp;
@@ -75,7 +75,7 @@ struct appldata_os_data {
75 75
76 /* per cpu data */ 76 /* per cpu data */
77 struct appldata_os_per_cpu os_cpu[0]; 77 struct appldata_os_per_cpu os_cpu[0];
78}; 78} __attribute__((packed));
79 79
80static struct appldata_os_data *appldata_os_data; 80static struct appldata_os_data *appldata_os_data;
81 81
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 26889366929a..06afa3103ace 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -40,6 +40,7 @@
40#include <asm/pgalloc.h> 40#include <asm/pgalloc.h>
41#include <asm/system.h> 41#include <asm/system.h>
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <asm/unistd.h>
43 44
44#ifdef CONFIG_S390_SUPPORT 45#ifdef CONFIG_S390_SUPPORT
45#include "compat_ptrace.h" 46#include "compat_ptrace.h"
@@ -130,13 +131,19 @@ static int
130peek_user(struct task_struct *child, addr_t addr, addr_t data) 131peek_user(struct task_struct *child, addr_t addr, addr_t data)
131{ 132{
132 struct user *dummy = NULL; 133 struct user *dummy = NULL;
133 addr_t offset, tmp; 134 addr_t offset, tmp, mask;
134 135
135 /* 136 /*
136 * Stupid gdb peeks/pokes the access registers in 64 bit with 137 * Stupid gdb peeks/pokes the access registers in 64 bit with
137 * an alignment of 4. Programmers from hell... 138 * an alignment of 4. Programmers from hell...
138 */ 139 */
139 if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK) 140 mask = __ADDR_MASK;
141#ifdef CONFIG_ARCH_S390X
142 if (addr >= (addr_t) &dummy->regs.acrs &&
143 addr < (addr_t) &dummy->regs.orig_gpr2)
144 mask = 3;
145#endif
146 if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK)
140 return -EIO; 147 return -EIO;
141 148
142 if (addr < (addr_t) &dummy->regs.acrs) { 149 if (addr < (addr_t) &dummy->regs.acrs) {
@@ -153,6 +160,16 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
153 * access registers are stored in the thread structure 160 * access registers are stored in the thread structure
154 */ 161 */
155 offset = addr - (addr_t) &dummy->regs.acrs; 162 offset = addr - (addr_t) &dummy->regs.acrs;
163#ifdef CONFIG_ARCH_S390X
164 /*
165 * Very special case: old & broken 64 bit gdb reading
166 * from acrs[15]. Result is a 64 bit value. Read the
167 * 32 bit acrs[15] value and shift it by 32. Sick...
168 */
169 if (addr == (addr_t) &dummy->regs.acrs[15])
170 tmp = ((unsigned long) child->thread.acrs[15]) << 32;
171 else
172#endif
156 tmp = *(addr_t *)((addr_t) &child->thread.acrs + offset); 173 tmp = *(addr_t *)((addr_t) &child->thread.acrs + offset);
157 174
158 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) { 175 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) {
@@ -167,6 +184,9 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
167 */ 184 */
168 offset = addr - (addr_t) &dummy->regs.fp_regs; 185 offset = addr - (addr_t) &dummy->regs.fp_regs;
169 tmp = *(addr_t *)((addr_t) &child->thread.fp_regs + offset); 186 tmp = *(addr_t *)((addr_t) &child->thread.fp_regs + offset);
187 if (addr == (addr_t) &dummy->regs.fp_regs.fpc)
188 tmp &= (unsigned long) FPC_VALID_MASK
189 << (BITS_PER_LONG - 32);
170 190
171 } else if (addr < (addr_t) (&dummy->regs.per_info + 1)) { 191 } else if (addr < (addr_t) (&dummy->regs.per_info + 1)) {
172 /* 192 /*
@@ -191,13 +211,19 @@ static int
191poke_user(struct task_struct *child, addr_t addr, addr_t data) 211poke_user(struct task_struct *child, addr_t addr, addr_t data)
192{ 212{
193 struct user *dummy = NULL; 213 struct user *dummy = NULL;
194 addr_t offset; 214 addr_t offset, mask;
195 215
196 /* 216 /*
197 * Stupid gdb peeks/pokes the access registers in 64 bit with 217 * Stupid gdb peeks/pokes the access registers in 64 bit with
198 * an alignment of 4. Programmers from hell indeed... 218 * an alignment of 4. Programmers from hell indeed...
199 */ 219 */
200 if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK) 220 mask = __ADDR_MASK;
221#ifdef CONFIG_ARCH_S390X
222 if (addr >= (addr_t) &dummy->regs.acrs &&
223 addr < (addr_t) &dummy->regs.orig_gpr2)
224 mask = 3;
225#endif
226 if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK)
201 return -EIO; 227 return -EIO;
202 228
203 if (addr < (addr_t) &dummy->regs.acrs) { 229 if (addr < (addr_t) &dummy->regs.acrs) {
@@ -224,6 +250,17 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
224 * access registers are stored in the thread structure 250 * access registers are stored in the thread structure
225 */ 251 */
226 offset = addr - (addr_t) &dummy->regs.acrs; 252 offset = addr - (addr_t) &dummy->regs.acrs;
253#ifdef CONFIG_ARCH_S390X
254 /*
255 * Very special case: old & broken 64 bit gdb writing
256 * to acrs[15] with a 64 bit value. Ignore the lower
257 * half of the value and write the upper 32 bit to
258 * acrs[15]. Sick...
259 */
260 if (addr == (addr_t) &dummy->regs.acrs[15])
261 child->thread.acrs[15] = (unsigned int) (data >> 32);
262 else
263#endif
227 *(addr_t *)((addr_t) &child->thread.acrs + offset) = data; 264 *(addr_t *)((addr_t) &child->thread.acrs + offset) = data;
228 265
229 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) { 266 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) {
@@ -237,7 +274,8 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
237 * floating point regs. are stored in the thread structure 274 * floating point regs. are stored in the thread structure
238 */ 275 */
239 if (addr == (addr_t) &dummy->regs.fp_regs.fpc && 276 if (addr == (addr_t) &dummy->regs.fp_regs.fpc &&
240 (data & ~FPC_VALID_MASK) != 0) 277 (data & ~((unsigned long) FPC_VALID_MASK
278 << (BITS_PER_LONG - 32))) != 0)
241 return -EINVAL; 279 return -EINVAL;
242 offset = addr - (addr_t) &dummy->regs.fp_regs; 280 offset = addr - (addr_t) &dummy->regs.fp_regs;
243 *(addr_t *)((addr_t) &child->thread.fp_regs + offset) = data; 281 *(addr_t *)((addr_t) &child->thread.fp_regs + offset) = data;
@@ -723,6 +761,13 @@ syscall_trace(struct pt_regs *regs, int entryexit)
723 ? 0x80 : 0)); 761 ? 0x80 : 0));
724 762
725 /* 763 /*
764 * If the debuffer has set an invalid system call number,
765 * we prepare to skip the system call restart handling.
766 */
767 if (!entryexit && regs->gprs[2] >= NR_syscalls)
768 regs->trap = -1;
769
770 /*
726 * this isn't the same as continuing with a signal, but it will do 771 * this isn't the same as continuing with a signal, but it will do
727 * for normal use. strace only continues with a signal if the 772 * for normal use. strace only continues with a signal if the
728 * stopping signal is not SIGTRAP. -brl 773 * stopping signal is not SIGTRAP. -brl
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 80306bc8c799..75fde949d125 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -207,7 +207,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
207 * we are not in an interrupt and that there is a 207 * we are not in an interrupt and that there is a
208 * user context. 208 * user context.
209 */ 209 */
210 if (user_address == 0 || in_interrupt() || !mm) 210 if (user_address == 0 || in_atomic() || !mm)
211 goto no_context; 211 goto no_context;
212 212
213 /* 213 /*
diff --git a/arch/um/Kconfig_char b/arch/um/Kconfig_char
index 3e50fdb67626..62d87b71179b 100644
--- a/arch/um/Kconfig_char
+++ b/arch/um/Kconfig_char
@@ -204,5 +204,11 @@ config UML_RANDOM
204 http://sourceforge.net/projects/gkernel/). rngd periodically reads 204 http://sourceforge.net/projects/gkernel/). rngd periodically reads
205 /dev/hwrng and injects the entropy into /dev/random. 205 /dev/hwrng and injects the entropy into /dev/random.
206 206
207config MMAPPER
208 tristate "iomem emulation driver"
209 help
210 This driver allows a host file to be used as emulated IO memory inside
211 UML.
212
207endmenu 213endmenu
208 214
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 323f72c64cd2..b2de9916c32c 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -22,8 +22,8 @@ obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
22obj-$(CONFIG_SSL) += ssl.o 22obj-$(CONFIG_SSL) += ssl.o
23obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o 23obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o
24 24
25obj-$(CONFIG_UML_NET_SLIP) += slip.o 25obj-$(CONFIG_UML_NET_SLIP) += slip.o slip_common.o
26obj-$(CONFIG_UML_NET_SLIRP) += slirp.o 26obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o
27obj-$(CONFIG_UML_NET_DAEMON) += daemon.o 27obj-$(CONFIG_UML_NET_DAEMON) += daemon.o
28obj-$(CONFIG_UML_NET_MCAST) += mcast.o 28obj-$(CONFIG_UML_NET_MCAST) += mcast.o
29#obj-$(CONFIG_UML_NET_PCAP) += pcap.o $(PCAP) 29#obj-$(CONFIG_UML_NET_PCAP) += pcap.o $(PCAP)
@@ -41,6 +41,6 @@ obj-$(CONFIG_UML_WATCHDOG) += harddog.o
41obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o 41obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
42obj-$(CONFIG_UML_RANDOM) += random.o 42obj-$(CONFIG_UML_RANDOM) += random.o
43 43
44USER_OBJS := fd.o null.o pty.o tty.o xterm.o 44USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o
45 45
46include arch/um/scripts/Makefile.rules 46include arch/um/scripts/Makefile.rules
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 583b8e137c33..5d3768156c92 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -143,22 +143,22 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
143{ 143{
144 struct winch_data data; 144 struct winch_data data;
145 unsigned long stack; 145 unsigned long stack;
146 int fds[2], pid, n, err; 146 int fds[2], n, err;
147 char c; 147 char c;
148 148
149 err = os_pipe(fds, 1, 1); 149 err = os_pipe(fds, 1, 1);
150 if(err < 0){ 150 if(err < 0){
151 printk("winch_tramp : os_pipe failed, err = %d\n", -err); 151 printk("winch_tramp : os_pipe failed, err = %d\n", -err);
152 return(err); 152 goto out;
153 } 153 }
154 154
155 data = ((struct winch_data) { .pty_fd = fd, 155 data = ((struct winch_data) { .pty_fd = fd,
156 .pipe_fd = fds[1], 156 .pipe_fd = fds[1],
157 .close_me = fds[0] } ); 157 .close_me = fds[0] } );
158 pid = run_helper_thread(winch_thread, &data, 0, &stack, 0); 158 err = run_helper_thread(winch_thread, &data, 0, &stack, 0);
159 if(pid < 0){ 159 if(err < 0){
160 printk("fork of winch_thread failed - errno = %d\n", errno); 160 printk("fork of winch_thread failed - errno = %d\n", errno);
161 return(pid); 161 goto out_close;
162 } 162 }
163 163
164 os_close_file(fds[1]); 164 os_close_file(fds[1]);
@@ -168,14 +168,22 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
168 printk("winch_tramp : failed to read synchronization byte\n"); 168 printk("winch_tramp : failed to read synchronization byte\n");
169 printk("read failed, err = %d\n", -n); 169 printk("read failed, err = %d\n", -n);
170 printk("fd %d will not support SIGWINCH\n", fd); 170 printk("fd %d will not support SIGWINCH\n", fd);
171 *fd_out = -1; 171 err = -EINVAL;
172 goto out_close1;
172 } 173 }
173 return(pid); 174 return err ;
175
176 out_close:
177 os_close_file(fds[1]);
178 out_close1:
179 os_close_file(fds[0]);
180 out:
181 return err;
174} 182}
175 183
176void register_winch(int fd, struct tty_struct *tty) 184void register_winch(int fd, struct tty_struct *tty)
177{ 185{
178 int pid, thread, thread_fd; 186 int pid, thread, thread_fd = -1;
179 int count; 187 int count;
180 char c = 1; 188 char c = 1;
181 189
@@ -186,7 +194,7 @@ void register_winch(int fd, struct tty_struct *tty)
186 if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, 194 if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd,
187 tty) && (pid == -1)){ 195 tty) && (pid == -1)){
188 thread = winch_tramp(fd, tty, &thread_fd); 196 thread = winch_tramp(fd, tty, &thread_fd);
189 if(fd != -1){ 197 if(thread > 0){
190 register_winch_irq(thread_fd, fd, thread, tty); 198 register_winch_irq(thread_fd, fd, thread, tty);
191 199
192 count = os_write_file(thread_fd, &c, sizeof(c)); 200 count = os_write_file(thread_fd, &c, sizeof(c));
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index a63231dffe05..a37a5ac13c22 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -18,6 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/smp_lock.h> 20#include <linux/smp_lock.h>
21#include <linux/miscdevice.h>
21#include <asm/uaccess.h> 22#include <asm/uaccess.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <asm/pgtable.h> 24#include <asm/pgtable.h>
@@ -117,24 +118,39 @@ static struct file_operations mmapper_fops = {
117 .release = mmapper_release, 118 .release = mmapper_release,
118}; 119};
119 120
121static struct miscdevice mmapper_dev = {
122 .minor = MISC_DYNAMIC_MINOR,
123 .name = "mmapper",
124 .fops = &mmapper_fops
125};
126
120static int __init mmapper_init(void) 127static int __init mmapper_init(void)
121{ 128{
129 int err;
130
122 printk(KERN_INFO "Mapper v0.1\n"); 131 printk(KERN_INFO "Mapper v0.1\n");
123 132
124 v_buf = (char *) find_iomem("mmapper", &mmapper_size); 133 v_buf = (char *) find_iomem("mmapper", &mmapper_size);
125 if(mmapper_size == 0){ 134 if(mmapper_size == 0){
126 printk(KERN_ERR "mmapper_init - find_iomem failed\n"); 135 printk(KERN_ERR "mmapper_init - find_iomem failed\n");
127 return(0); 136 goto out;
128 } 137 }
129 138
130 p_buf = __pa(v_buf); 139 err = misc_register(&mmapper_dev);
140 if(err){
141 printk(KERN_ERR "mmapper - misc_register failed, err = %d\n",
142 err);
143 goto out;
144 }
131 145
132 devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUGO|S_IWUGO, "mmapper"); 146 p_buf = __pa(v_buf);
133 return(0); 147out:
148 return 0;
134} 149}
135 150
136static void mmapper_exit(void) 151static void mmapper_exit(void)
137{ 152{
153 misc_deregister(&mmapper_dev);
138} 154}
139 155
140module_init(mmapper_init); 156module_init(mmapper_init);
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 47229fe4a813..3730d4f12713 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -32,7 +32,7 @@ int tap_open_common(void *dev, char *gate_addr)
32 return(0); 32 return(0);
33} 33}
34 34
35void tap_check_ips(char *gate_addr, char *eth_addr) 35void tap_check_ips(char *gate_addr, unsigned char *eth_addr)
36{ 36{
37 int tap_addr[4]; 37 int tap_addr[4];
38 38
diff --git a/arch/um/drivers/slip.h b/arch/um/drivers/slip.h
index 495f2f1b1420..bb0dab41c2e4 100644
--- a/arch/um/drivers/slip.h
+++ b/arch/um/drivers/slip.h
@@ -1,10 +1,7 @@
1#ifndef __UM_SLIP_H 1#ifndef __UM_SLIP_H
2#define __UM_SLIP_H 2#define __UM_SLIP_H
3 3
4#define BUF_SIZE 1500 4#include "slip_common.h"
5 /* two bytes each for a (pathological) max packet of escaped chars + *
6 * terminating END char + initial END char */
7#define ENC_BUF_SIZE (2 * BUF_SIZE + 2)
8 5
9struct slip_data { 6struct slip_data {
10 void *dev; 7 void *dev;
@@ -12,28 +9,12 @@ struct slip_data {
12 char *addr; 9 char *addr;
13 char *gate_addr; 10 char *gate_addr;
14 int slave; 11 int slave;
15 char ibuf[ENC_BUF_SIZE]; 12 struct slip_proto slip;
16 char obuf[ENC_BUF_SIZE];
17 int more; /* more data: do not read fd until ibuf has been drained */
18 int pos;
19 int esc;
20}; 13};
21 14
22extern struct net_user_info slip_user_info; 15extern struct net_user_info slip_user_info;
23 16
24extern int set_umn_addr(int fd, char *addr, char *ptp_addr);
25extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri); 17extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri);
26extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri); 18extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri);
27 19
28#endif 20#endif
29
30/*
31 * Overrides for Emacs so that we follow Linus's tabbing style.
32 * Emacs will notice this stuff at the end of the file and automatically
33 * adjust the settings for this buffer only. This must remain at the end
34 * of the file.
35 * ---------------------------------------------------------------------------
36 * Local variables:
37 * c-file-style: "linux"
38 * End:
39 */
diff --git a/arch/um/drivers/slip_common.c b/arch/um/drivers/slip_common.c
new file mode 100644
index 000000000000..e89cfc68fc3e
--- /dev/null
+++ b/arch/um/drivers/slip_common.c
@@ -0,0 +1,54 @@
1#include <string.h>
2#include "slip_common.h"
3#include "net_user.h"
4
5int slip_proto_read(int fd, void *buf, int len, struct slip_proto *slip)
6{
7 int i, n, size, start;
8
9 if(slip->more > 0){
10 i = 0;
11 while(i < slip->more){
12 size = slip_unesc(slip->ibuf[i++], slip->ibuf,
13 &slip->pos, &slip->esc);
14 if(size){
15 memcpy(buf, slip->ibuf, size);
16 memmove(slip->ibuf, &slip->ibuf[i],
17 slip->more - i);
18 slip->more = slip->more - i;
19 return size;
20 }
21 }
22 slip->more = 0;
23 }
24
25 n = net_read(fd, &slip->ibuf[slip->pos],
26 sizeof(slip->ibuf) - slip->pos);
27 if(n <= 0)
28 return n;
29
30 start = slip->pos;
31 for(i = 0; i < n; i++){
32 size = slip_unesc(slip->ibuf[start + i], slip->ibuf,&slip->pos,
33 &slip->esc);
34 if(size){
35 memcpy(buf, slip->ibuf, size);
36 memmove(slip->ibuf, &slip->ibuf[start+i+1],
37 n - (i + 1));
38 slip->more = n - (i + 1);
39 return size;
40 }
41 }
42 return 0;
43}
44
45int slip_proto_write(int fd, void *buf, int len, struct slip_proto *slip)
46{
47 int actual, n;
48
49 actual = slip_esc(buf, slip->obuf, len);
50 n = net_write(fd, slip->obuf, actual);
51 if(n < 0)
52 return n;
53 else return len;
54}
diff --git a/arch/um/drivers/slip_proto.h b/arch/um/drivers/slip_common.h
index 7206361ace45..2ae76d8f1be1 100644
--- a/arch/um/drivers/slip_proto.h
+++ b/arch/um/drivers/slip_common.h
@@ -1,10 +1,10 @@
1/* 1#ifndef __UM_SLIP_COMMON_H
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2#define __UM_SLIP_COMMON_H
3 * Licensed under the GPL
4 */
5 3
6#ifndef __UM_SLIP_PROTO_H__ 4#define BUF_SIZE 1500
7#define __UM_SLIP_PROTO_H__ 5 /* two bytes each for a (pathological) max packet of escaped chars + *
6 * terminating END char + initial END char */
7#define ENC_BUF_SIZE (2 * BUF_SIZE + 2)
8 8
9/* SLIP protocol characters. */ 9/* SLIP protocol characters. */
10#define SLIP_END 0300 /* indicates end of frame */ 10#define SLIP_END 0300 /* indicates end of frame */
@@ -12,7 +12,8 @@
12#define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */ 12#define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */
13#define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */ 13#define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */
14 14
15static inline int slip_unesc(unsigned char c,char *buf,int *pos, int *esc) 15static inline int slip_unesc(unsigned char c, unsigned char *buf, int *pos,
16 int *esc)
16{ 17{
17 int ret; 18 int ret;
18 19
@@ -79,15 +80,25 @@ static inline int slip_esc(unsigned char *s, unsigned char *d, int len)
79 return (ptr - d); 80 return (ptr - d);
80} 81}
81 82
82#endif 83struct slip_proto {
84 unsigned char ibuf[ENC_BUF_SIZE];
85 unsigned char obuf[ENC_BUF_SIZE];
86 int more; /* more data: do not read fd until ibuf has been drained */
87 int pos;
88 int esc;
89};
90
91#define SLIP_PROTO_INIT { \
92 .ibuf = { '\0' }, \
93 .obuf = { '\0' }, \
94 .more = 0, \
95 .pos = 0, \
96 .esc = 0 \
97}
83 98
84/* 99extern int slip_proto_read(int fd, void *buf, int len,
85 * Overrides for Emacs so that we follow Linus's tabbing style. 100 struct slip_proto *slip);
86 * Emacs will notice this stuff at the end of the file and automatically 101extern int slip_proto_write(int fd, void *buf, int len,
87 * adjust the settings for this buffer only. This must remain at the end 102 struct slip_proto *slip);
88 * of the file. 103
89 * --------------------------------------------------------------------------- 104#endif
90 * Local variables:
91 * c-file-style: "linux"
92 * End:
93 */
diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c
index 0886eedba213..9a6f5c85f902 100644
--- a/arch/um/drivers/slip_kern.c
+++ b/arch/um/drivers/slip_kern.c
@@ -26,16 +26,16 @@ void slip_init(struct net_device *dev, void *data)
26 .addr = NULL, 26 .addr = NULL,
27 .gate_addr = init->gate_addr, 27 .gate_addr = init->gate_addr,
28 .slave = -1, 28 .slave = -1,
29 .ibuf = { '\0' }, 29 .slip = SLIP_PROTO_INIT,
30 .obuf = { '\0' },
31 .pos = 0,
32 .esc = 0,
33 .dev = dev }); 30 .dev = dev });
34 31
35 dev->init = NULL; 32 dev->init = NULL;
33 dev->header_cache_update = NULL;
34 dev->hard_header_cache = NULL;
35 dev->hard_header = NULL;
36 dev->hard_header_len = 0; 36 dev->hard_header_len = 0;
37 dev->addr_len = 4; 37 dev->addr_len = 0;
38 dev->type = ARPHRD_ETHER; 38 dev->type = ARPHRD_SLIP;
39 dev->tx_queue_len = 256; 39 dev->tx_queue_len = 256;
40 dev->flags = IFF_NOARP; 40 dev->flags = IFF_NOARP;
41 printk("SLIP backend - SLIP IP = %s\n", spri->gate_addr); 41 printk("SLIP backend - SLIP IP = %s\n", spri->gate_addr);
diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c
index d94846b1b4cf..71af444e591f 100644
--- a/arch/um/drivers/slip_user.c
+++ b/arch/um/drivers/slip_user.c
@@ -13,7 +13,7 @@
13#include "user.h" 13#include "user.h"
14#include "net_user.h" 14#include "net_user.h"
15#include "slip.h" 15#include "slip.h"
16#include "slip_proto.h" 16#include "slip_common.h"
17#include "helper.h" 17#include "helper.h"
18#include "os.h" 18#include "os.h"
19 19
@@ -77,41 +77,51 @@ static int slip_tramp(char **argv, int fd)
77 err = os_pipe(fds, 1, 0); 77 err = os_pipe(fds, 1, 0);
78 if(err < 0){ 78 if(err < 0){
79 printk("slip_tramp : pipe failed, err = %d\n", -err); 79 printk("slip_tramp : pipe failed, err = %d\n", -err);
80 return(err); 80 goto out;
81 } 81 }
82 82
83 err = 0; 83 err = 0;
84 pe_data.stdin = fd; 84 pe_data.stdin = fd;
85 pe_data.stdout = fds[1]; 85 pe_data.stdout = fds[1];
86 pe_data.close_me = fds[0]; 86 pe_data.close_me = fds[0];
87 pid = run_helper(slip_pre_exec, &pe_data, argv, NULL); 87 err = run_helper(slip_pre_exec, &pe_data, argv, NULL);
88 if(err < 0)
89 goto out_close;
90 pid = err;
91
92 output_len = page_size();
93 output = um_kmalloc(output_len);
94 if(output == NULL){
95 printk("slip_tramp : failed to allocate output buffer\n");
96 os_kill_process(pid, 1);
97 err = -ENOMEM;
98 goto out_free;
99 }
88 100
89 if(pid < 0) err = pid; 101 os_close_file(fds[1]);
90 else { 102 read_output(fds[0], output, output_len);
91 output_len = page_size(); 103 printk("%s", output);
92 output = um_kmalloc(output_len); 104
93 if(output == NULL) 105 CATCH_EINTR(err = waitpid(pid, &status, 0));
94 printk("slip_tramp : failed to allocate output " 106 if(err < 0)
95 "buffer\n"); 107 err = errno;
96 108 else if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0)){
97 os_close_file(fds[1]); 109 printk("'%s' didn't exit with status 0\n", argv[0]);
98 read_output(fds[0], output, output_len); 110 err = -EINVAL;
99 if(output != NULL){
100 printk("%s", output);
101 kfree(output);
102 }
103 CATCH_EINTR(err = waitpid(pid, &status, 0));
104 if(err < 0)
105 err = errno;
106 else if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0)){
107 printk("'%s' didn't exit with status 0\n", argv[0]);
108 err = -EINVAL;
109 }
110 } 111 }
112 else err = 0;
111 113
112 os_close_file(fds[0]); 114 os_close_file(fds[0]);
113 115
114 return(err); 116out_free:
117 kfree(output);
118 return err;
119
120out_close:
121 os_close_file(fds[0]);
122 os_close_file(fds[1]);
123out:
124 return err;
115} 125}
116 126
117static int slip_open(void *data) 127static int slip_open(void *data)
@@ -123,21 +133,26 @@ static int slip_open(void *data)
123 NULL }; 133 NULL };
124 int sfd, mfd, err; 134 int sfd, mfd, err;
125 135
126 mfd = get_pty(); 136 err = get_pty();
127 if(mfd < 0){ 137 if(err < 0){
128 printk("umn : Failed to open pty, err = %d\n", -mfd); 138 printk("slip-open : Failed to open pty, err = %d\n", -err);
129 return(mfd); 139 goto out;
130 } 140 }
131 sfd = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0); 141 mfd = err;
132 if(sfd < 0){ 142
133 printk("Couldn't open tty for slip line, err = %d\n", -sfd); 143 err = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0);
134 os_close_file(mfd); 144 if(err < 0){
135 return(sfd); 145 printk("Couldn't open tty for slip line, err = %d\n", -err);
146 goto out_close;
136 } 147 }
137 if(set_up_tty(sfd)) return(-1); 148 sfd = err;
149
150 if(set_up_tty(sfd))
151 goto out_close2;
152
138 pri->slave = sfd; 153 pri->slave = sfd;
139 pri->pos = 0; 154 pri->slip.pos = 0;
140 pri->esc = 0; 155 pri->slip.esc = 0;
141 if(pri->gate_addr != NULL){ 156 if(pri->gate_addr != NULL){
142 sprintf(version_buf, "%d", UML_NET_VERSION); 157 sprintf(version_buf, "%d", UML_NET_VERSION);
143 strcpy(gate_buf, pri->gate_addr); 158 strcpy(gate_buf, pri->gate_addr);
@@ -146,12 +161,12 @@ static int slip_open(void *data)
146 161
147 if(err < 0){ 162 if(err < 0){
148 printk("slip_tramp failed - err = %d\n", -err); 163 printk("slip_tramp failed - err = %d\n", -err);
149 return(err); 164 goto out_close2;
150 } 165 }
151 err = os_get_ifname(pri->slave, pri->name); 166 err = os_get_ifname(pri->slave, pri->name);
152 if(err < 0){ 167 if(err < 0){
153 printk("get_ifname failed, err = %d\n", -err); 168 printk("get_ifname failed, err = %d\n", -err);
154 return(err); 169 goto out_close2;
155 } 170 }
156 iter_addresses(pri->dev, open_addr, pri->name); 171 iter_addresses(pri->dev, open_addr, pri->name);
157 } 172 }
@@ -160,10 +175,16 @@ static int slip_open(void *data)
160 if(err < 0){ 175 if(err < 0){
161 printk("Failed to set slip discipline encapsulation - " 176 printk("Failed to set slip discipline encapsulation - "
162 "err = %d\n", -err); 177 "err = %d\n", -err);
163 return(err); 178 goto out_close2;
164 } 179 }
165 } 180 }
166 return(mfd); 181 return(mfd);
182out_close2:
183 os_close_file(sfd);
184out_close:
185 os_close_file(mfd);
186out:
187 return err;
167} 188}
168 189
169static void slip_close(int fd, void *data) 190static void slip_close(int fd, void *data)
@@ -190,48 +211,12 @@ static void slip_close(int fd, void *data)
190 211
191int slip_user_read(int fd, void *buf, int len, struct slip_data *pri) 212int slip_user_read(int fd, void *buf, int len, struct slip_data *pri)
192{ 213{
193 int i, n, size, start; 214 return slip_proto_read(fd, buf, len, &pri->slip);
194
195 if(pri->more>0) {
196 i = 0;
197 while(i < pri->more) {
198 size = slip_unesc(pri->ibuf[i++],
199 pri->ibuf, &pri->pos, &pri->esc);
200 if(size){
201 memcpy(buf, pri->ibuf, size);
202 memmove(pri->ibuf, &pri->ibuf[i], pri->more-i);
203 pri->more=pri->more-i;
204 return(size);
205 }
206 }
207 pri->more=0;
208 }
209
210 n = net_read(fd, &pri->ibuf[pri->pos], sizeof(pri->ibuf) - pri->pos);
211 if(n <= 0) return(n);
212
213 start = pri->pos;
214 for(i = 0; i < n; i++){
215 size = slip_unesc(pri->ibuf[start + i],
216 pri->ibuf, &pri->pos, &pri->esc);
217 if(size){
218 memcpy(buf, pri->ibuf, size);
219 memmove(pri->ibuf, &pri->ibuf[start+i+1], n-(i+1));
220 pri->more=n-(i+1);
221 return(size);
222 }
223 }
224 return(0);
225} 215}
226 216
227int slip_user_write(int fd, void *buf, int len, struct slip_data *pri) 217int slip_user_write(int fd, void *buf, int len, struct slip_data *pri)
228{ 218{
229 int actual, n; 219 return slip_proto_write(fd, buf, len, &pri->slip);
230
231 actual = slip_esc(buf, pri->obuf, len);
232 n = net_write(fd, pri->obuf, actual);
233 if(n < 0) return(n);
234 else return(len);
235} 220}
236 221
237static int slip_set_mtu(int mtu, void *data) 222static int slip_set_mtu(int mtu, void *data)
@@ -267,14 +252,3 @@ struct net_user_info slip_user_info = {
267 .delete_address = slip_del_addr, 252 .delete_address = slip_del_addr,
268 .max_packet = BUF_SIZE 253 .max_packet = BUF_SIZE
269}; 254};
270
271/*
272 * Overrides for Emacs so that we follow Linus's tabbing style.
273 * Emacs will notice this stuff at the end of the file and automatically
274 * adjust the settings for this buffer only. This must remain at the end
275 * of the file.
276 * ---------------------------------------------------------------------------
277 * Local variables:
278 * c-file-style: "linux"
279 * End:
280 */
diff --git a/arch/um/drivers/slirp.h b/arch/um/drivers/slirp.h
index 04e407d1e44a..6cf88ab580c9 100644
--- a/arch/um/drivers/slirp.h
+++ b/arch/um/drivers/slirp.h
@@ -1,10 +1,7 @@
1#ifndef __UM_SLIRP_H 1#ifndef __UM_SLIRP_H
2#define __UM_SLIRP_H 2#define __UM_SLIRP_H
3 3
4#define BUF_SIZE 1500 4#include "slip_common.h"
5 /* two bytes each for a (pathological) max packet of escaped chars + *
6 * terminating END char + initial END char */
7#define ENC_BUF_SIZE (2 * BUF_SIZE + 2)
8 5
9#define SLIRP_MAX_ARGS 100 6#define SLIRP_MAX_ARGS 100
10/* 7/*
@@ -24,28 +21,13 @@ struct slirp_data {
24 struct arg_list_dummy_wrapper argw; 21 struct arg_list_dummy_wrapper argw;
25 int pid; 22 int pid;
26 int slave; 23 int slave;
27 char ibuf[ENC_BUF_SIZE]; 24 struct slip_proto slip;
28 char obuf[ENC_BUF_SIZE];
29 int more; /* more data: do not read fd until ibuf has been drained */
30 int pos;
31 int esc;
32}; 25};
33 26
34extern struct net_user_info slirp_user_info; 27extern struct net_user_info slirp_user_info;
35 28
36extern int set_umn_addr(int fd, char *addr, char *ptp_addr);
37extern int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri); 29extern int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri);
38extern int slirp_user_write(int fd, void *buf, int len, struct slirp_data *pri); 30extern int slirp_user_write(int fd, void *buf, int len,
31 struct slirp_data *pri);
39 32
40#endif 33#endif
41
42/*
43 * Overrides for Emacs so that we follow Linus's tabbing style.
44 * Emacs will notice this stuff at the end of the file and automatically
45 * adjust the settings for this buffer only. This must remain at the end
46 * of the file.
47 * ---------------------------------------------------------------------------
48 * Local variables:
49 * c-file-style: "linux"
50 * End:
51 */
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c
index c9d6b52a831d..9864d27afdbe 100644
--- a/arch/um/drivers/slirp_kern.c
+++ b/arch/um/drivers/slirp_kern.c
@@ -25,10 +25,7 @@ void slirp_init(struct net_device *dev, void *data)
25 { .argw = init->argw, 25 { .argw = init->argw,
26 .pid = -1, 26 .pid = -1,
27 .slave = -1, 27 .slave = -1,
28 .ibuf = { '\0' }, 28 .slip = SLIP_PROTO_INIT,
29 .obuf = { '\0' },
30 .pos = 0,
31 .esc = 0,
32 .dev = dev }); 29 .dev = dev });
33 30
34 dev->init = NULL; 31 dev->init = NULL;
diff --git a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c
index c322515c71cc..8d91f663d82c 100644
--- a/arch/um/drivers/slirp_user.c
+++ b/arch/um/drivers/slirp_user.c
@@ -12,7 +12,7 @@
12#include "user.h" 12#include "user.h"
13#include "net_user.h" 13#include "net_user.h"
14#include "slirp.h" 14#include "slirp.h"
15#include "slip_proto.h" 15#include "slip_common.h"
16#include "helper.h" 16#include "helper.h"
17#include "os.h" 17#include "os.h"
18 18
@@ -48,47 +48,32 @@ static int slirp_tramp(char **argv, int fd)
48 return(pid); 48 return(pid);
49} 49}
50 50
51/* XXX This is just a trivial wrapper around os_pipe */
52static int slirp_datachan(int *mfd, int *sfd)
53{
54 int fds[2], err;
55
56 err = os_pipe(fds, 1, 1);
57 if(err < 0){
58 printk("slirp_datachan: Failed to open pipe, err = %d\n", -err);
59 return(err);
60 }
61
62 *mfd = fds[0];
63 *sfd = fds[1];
64 return(0);
65}
66
67static int slirp_open(void *data) 51static int slirp_open(void *data)
68{ 52{
69 struct slirp_data *pri = data; 53 struct slirp_data *pri = data;
70 int sfd, mfd, pid, err; 54 int fds[2], pid, err;
71 55
72 err = slirp_datachan(&mfd, &sfd); 56 err = os_pipe(fds, 1, 1);
73 if(err) 57 if(err)
74 return(err); 58 return(err);
75 59
76 pid = slirp_tramp(pri->argw.argv, sfd); 60 err = slirp_tramp(pri->argw.argv, fds[1]);
77 61 if(err < 0){
78 if(pid < 0){ 62 printk("slirp_tramp failed - errno = %d\n", -err);
79 printk("slirp_tramp failed - errno = %d\n", -pid); 63 goto out;
80 os_close_file(sfd);
81 os_close_file(mfd);
82 return(pid);
83 } 64 }
84 65 pid = err;
85 pri->slave = sfd; 66
86 pri->pos = 0; 67 pri->slave = fds[1];
87 pri->esc = 0; 68 pri->slip.pos = 0;
88 69 pri->slip.esc = 0;
89 pri->pid = pid; 70 pri->pid = err;
90 71
91 return(mfd); 72 return(fds[0]);
73out:
74 os_close_file(fds[0]);
75 os_close_file(fds[1]);
76 return err;
92} 77}
93 78
94static void slirp_close(int fd, void *data) 79static void slirp_close(int fd, void *data)
@@ -129,48 +114,12 @@ static void slirp_close(int fd, void *data)
129 114
130int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri) 115int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri)
131{ 116{
132 int i, n, size, start; 117 return slip_proto_read(fd, buf, len, &pri->slip);
133
134 if(pri->more>0) {
135 i = 0;
136 while(i < pri->more) {
137 size = slip_unesc(pri->ibuf[i++],
138 pri->ibuf,&pri->pos,&pri->esc);
139 if(size){
140 memcpy(buf, pri->ibuf, size);
141 memmove(pri->ibuf, &pri->ibuf[i], pri->more-i);
142 pri->more=pri->more-i;
143 return(size);
144 }
145 }
146 pri->more=0;
147 }
148
149 n = net_read(fd, &pri->ibuf[pri->pos], sizeof(pri->ibuf) - pri->pos);
150 if(n <= 0) return(n);
151
152 start = pri->pos;
153 for(i = 0; i < n; i++){
154 size = slip_unesc(pri->ibuf[start + i],
155 pri->ibuf,&pri->pos,&pri->esc);
156 if(size){
157 memcpy(buf, pri->ibuf, size);
158 memmove(pri->ibuf, &pri->ibuf[start+i+1], n-(i+1));
159 pri->more=n-(i+1);
160 return(size);
161 }
162 }
163 return(0);
164} 118}
165 119
166int slirp_user_write(int fd, void *buf, int len, struct slirp_data *pri) 120int slirp_user_write(int fd, void *buf, int len, struct slirp_data *pri)
167{ 121{
168 int actual, n; 122 return slip_proto_write(fd, buf, len, &pri->slip);
169
170 actual = slip_esc(buf, pri->obuf, len);
171 n = net_write(fd, pri->obuf, actual);
172 if(n < 0) return(n);
173 else return(len);
174} 123}
175 124
176static int slirp_set_mtu(int mtu, void *data) 125static int slirp_set_mtu(int mtu, void *data)
@@ -188,14 +137,3 @@ struct net_user_info slirp_user_info = {
188 .delete_address = NULL, 137 .delete_address = NULL,
189 .max_packet = BUF_SIZE 138 .max_packet = BUF_SIZE
190}; 139};
191
192/*
193 * Overrides for Emacs so that we follow Linus's tabbing style.
194 * Emacs will notice this stuff at the end of the file and automatically
195 * adjust the settings for this buffer only. This must remain at the end
196 * of the file.
197 * ---------------------------------------------------------------------------
198 * Local variables:
199 * c-file-style: "linux"
200 * End:
201 */
diff --git a/arch/um/drivers/stderr_console.c b/arch/um/drivers/stderr_console.c
index 98565b53d170..429ae8e6c7e5 100644
--- a/arch/um/drivers/stderr_console.c
+++ b/arch/um/drivers/stderr_console.c
@@ -22,9 +22,9 @@ static void stderr_console_write(struct console *console, const char *string,
22} 22}
23 23
24static struct console stderr_console = { 24static struct console stderr_console = {
25 .name "stderr", 25 .name = "stderr",
26 .write stderr_console_write, 26 .write = stderr_console_write,
27 .flags CON_PRINTBUFFER, 27 .flags = CON_PRINTBUFFER,
28}; 28};
29 29
30static int __init stderr_console_init(void) 30static int __init stderr_console_init(void)
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h
index 9fbe3083fdd8..cfa368e045a5 100644
--- a/arch/um/include/mconsole.h
+++ b/arch/um/include/mconsole.h
@@ -56,7 +56,7 @@ struct mc_request
56 int as_interrupt; 56 int as_interrupt;
57 57
58 int originating_fd; 58 int originating_fd;
59 int originlen; 59 unsigned int originlen;
60 unsigned char origin[128]; /* sockaddr_un */ 60 unsigned char origin[128]; /* sockaddr_un */
61 61
62 struct mconsole_request request; 62 struct mconsole_request request;
diff --git a/arch/um/include/net_user.h b/arch/um/include/net_user.h
index 36807b796e9f..89885a77a771 100644
--- a/arch/um/include/net_user.h
+++ b/arch/um/include/net_user.h
@@ -35,7 +35,7 @@ extern void *get_output_buffer(int *len_out);
35extern void free_output_buffer(void *buffer); 35extern void free_output_buffer(void *buffer);
36 36
37extern int tap_open_common(void *dev, char *gate_addr); 37extern int tap_open_common(void *dev, char *gate_addr);
38extern void tap_check_ips(char *gate_addr, char *eth_addr); 38extern void tap_check_ips(char *gate_addr, unsigned char *eth_addr);
39 39
40extern void read_output(int fd, char *output_out, int len); 40extern void read_output(int fd, char *output_out, int len);
41 41
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index d246d5a24609..881d2988d2d8 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -136,7 +136,7 @@ extern int os_seek_file(int fd, __u64 offset);
136extern int os_open_file(char *file, struct openflags flags, int mode); 136extern int os_open_file(char *file, struct openflags flags, int mode);
137extern int os_read_file(int fd, void *buf, int len); 137extern int os_read_file(int fd, void *buf, int len);
138extern int os_write_file(int fd, const void *buf, int count); 138extern int os_write_file(int fd, const void *buf, int count);
139extern int os_file_size(char *file, long long *size_out); 139extern int os_file_size(char *file, unsigned long long *size_out);
140extern int os_file_modtime(char *file, unsigned long *modtime); 140extern int os_file_modtime(char *file, unsigned long *modtime);
141extern int os_pipe(int *fd, int stream, int close_on_exec); 141extern int os_pipe(int *fd, int stream, int close_on_exec);
142extern int os_set_fd_async(int fd, int owner); 142extern int os_set_fd_async(int fd, int owner);
diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h
index 6eaeb9919983..c8ee9559f3ab 100644
--- a/arch/um/include/sysdep-i386/ptrace.h
+++ b/arch/um/include/sysdep-i386/ptrace.h
@@ -8,6 +8,8 @@
8 8
9#include "uml-config.h" 9#include "uml-config.h"
10#include "user_constants.h" 10#include "user_constants.h"
11#include "sysdep/faultinfo.h"
12#include "choose-mode.h"
11 13
12#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long)) 14#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long))
13#define MAX_REG_OFFSET (UM_FRAME_SIZE) 15#define MAX_REG_OFFSET (UM_FRAME_SIZE)
@@ -58,9 +60,6 @@ extern int sysemu_supported;
58#define PTRACE_SYSEMU_SINGLESTEP 32 60#define PTRACE_SYSEMU_SINGLESTEP 32
59#endif 61#endif
60 62
61#include "sysdep/faultinfo.h"
62#include "choose-mode.h"
63
64union uml_pt_regs { 63union uml_pt_regs {
65#ifdef UML_CONFIG_MODE_TT 64#ifdef UML_CONFIG_MODE_TT
66 struct tt_regs { 65 struct tt_regs {
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
index b8c5b8a95250..7b6a24dfd302 100644
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@ -41,9 +41,6 @@ extern unsigned long highmem;
41extern char host_info[]; 41extern char host_info[];
42 42
43extern char saved_command_line[]; 43extern char saved_command_line[];
44extern char command_line[];
45
46extern char *tempdir;
47 44
48extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; 45extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
49extern unsigned long _unprotected_end; 46extern unsigned long _unprotected_end;
diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c
index e42e6364ca13..e59f58152678 100644
--- a/arch/um/kernel/main.c
+++ b/arch/um/kernel/main.c
@@ -24,8 +24,6 @@
24#include "mode.h" 24#include "mode.h"
25#include "choose-mode.h" 25#include "choose-mode.h"
26#include "uml-config.h" 26#include "uml-config.h"
27#include "irq_user.h"
28#include "time_user.h"
29#include "os.h" 27#include "os.h"
30 28
31/* Set in set_stklim, which is called from main and __wrap_malloc. 29/* Set in set_stklim, which is called from main and __wrap_malloc.
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 51f8e5a8ac6a..1b5ef3e96c71 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -30,7 +30,6 @@
30#include "init.h" 30#include "init.h"
31#include "os.h" 31#include "os.h"
32#include "uml-config.h" 32#include "uml-config.h"
33#include "ptrace_user.h"
34#include "choose-mode.h" 33#include "choose-mode.h"
35#include "mode.h" 34#include "mode.h"
36#ifdef UML_CONFIG_MODE_SKAS 35#ifdef UML_CONFIG_MODE_SKAS
@@ -131,7 +130,7 @@ int start_fork_tramp(void *thread_arg, unsigned long temp_stack,
131 return(arg.pid); 130 return(arg.pid);
132} 131}
133 132
134static int ptrace_child(void *arg) 133static int ptrace_child(void)
135{ 134{
136 int ret; 135 int ret;
137 int pid = os_getpid(), ppid = getppid(); 136 int pid = os_getpid(), ppid = getppid();
@@ -160,20 +159,16 @@ static int ptrace_child(void *arg)
160 _exit(ret); 159 _exit(ret);
161} 160}
162 161
163static int start_ptraced_child(void **stack_out) 162static int start_ptraced_child(void)
164{ 163{
165 void *stack;
166 unsigned long sp;
167 int pid, n, status; 164 int pid, n, status;
168 165
169 stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, 166 pid = fork();
170 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 167 if(pid == 0)
171 if(stack == MAP_FAILED) 168 ptrace_child();
172 panic("check_ptrace : mmap failed, errno = %d", errno); 169
173 sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
174 pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
175 if(pid < 0) 170 if(pid < 0)
176 panic("check_ptrace : clone failed, errno = %d", errno); 171 panic("check_ptrace : fork failed, errno = %d", errno);
177 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 172 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
178 if(n < 0) 173 if(n < 0)
179 panic("check_ptrace : wait failed, errno = %d", errno); 174 panic("check_ptrace : wait failed, errno = %d", errno);
@@ -181,7 +176,6 @@ static int start_ptraced_child(void **stack_out)
181 panic("check_ptrace : expected SIGSTOP, got status = %d", 176 panic("check_ptrace : expected SIGSTOP, got status = %d",
182 status); 177 status);
183 178
184 *stack_out = stack;
185 return(pid); 179 return(pid);
186} 180}
187 181
@@ -189,12 +183,12 @@ static int start_ptraced_child(void **stack_out)
189 * just avoid using sysemu, not panic, but only if SYSEMU features are broken. 183 * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
190 * So only for SYSEMU features we test mustpanic, while normal host features 184 * So only for SYSEMU features we test mustpanic, while normal host features
191 * must work anyway!*/ 185 * must work anyway!*/
192static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic) 186static int stop_ptraced_child(int pid, int exitcode, int mustexit)
193{ 187{
194 int status, n, ret = 0; 188 int status, n, ret = 0;
195 189
196 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0) 190 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
197 panic("check_ptrace : ptrace failed, errno = %d", errno); 191 panic("stop_ptraced_child : ptrace failed, errno = %d", errno);
198 CATCH_EINTR(n = waitpid(pid, &status, 0)); 192 CATCH_EINTR(n = waitpid(pid, &status, 0));
199 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { 193 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
200 int exit_with = WEXITSTATUS(status); 194 int exit_with = WEXITSTATUS(status);
@@ -205,15 +199,13 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic)
205 printk("check_ptrace : child exited with exitcode %d, while " 199 printk("check_ptrace : child exited with exitcode %d, while "
206 "expecting %d; status 0x%x", exit_with, 200 "expecting %d; status 0x%x", exit_with,
207 exitcode, status); 201 exitcode, status);
208 if (mustpanic) 202 if (mustexit)
209 panic("\n"); 203 panic("\n");
210 else 204 else
211 printk("\n"); 205 printk("\n");
212 ret = -1; 206 ret = -1;
213 } 207 }
214 208
215 if(munmap(stack, PAGE_SIZE) < 0)
216 panic("check_ptrace : munmap failed, errno = %d", errno);
217 return ret; 209 return ret;
218} 210}
219 211
@@ -235,12 +227,11 @@ __uml_setup("nosysemu", nosysemu_cmd_param,
235 227
236static void __init check_sysemu(void) 228static void __init check_sysemu(void)
237{ 229{
238 void *stack;
239 int pid, syscall, n, status, count=0; 230 int pid, syscall, n, status, count=0;
240 231
241 printk("Checking syscall emulation patch for ptrace..."); 232 printk("Checking syscall emulation patch for ptrace...");
242 sysemu_supported = 0; 233 sysemu_supported = 0;
243 pid = start_ptraced_child(&stack); 234 pid = start_ptraced_child();
244 235
245 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) 236 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)
246 goto fail; 237 goto fail;
@@ -258,7 +249,7 @@ static void __init check_sysemu(void)
258 panic("check_sysemu : failed to modify system " 249 panic("check_sysemu : failed to modify system "
259 "call return, errno = %d", errno); 250 "call return, errno = %d", errno);
260 251
261 if (stop_ptraced_child(pid, stack, 0, 0) < 0) 252 if (stop_ptraced_child(pid, 0, 0) < 0)
262 goto fail_stopped; 253 goto fail_stopped;
263 254
264 sysemu_supported = 1; 255 sysemu_supported = 1;
@@ -266,7 +257,7 @@ static void __init check_sysemu(void)
266 set_using_sysemu(!force_sysemu_disabled); 257 set_using_sysemu(!force_sysemu_disabled);
267 258
268 printk("Checking advanced syscall emulation patch for ptrace..."); 259 printk("Checking advanced syscall emulation patch for ptrace...");
269 pid = start_ptraced_child(&stack); 260 pid = start_ptraced_child();
270 while(1){ 261 while(1){
271 count++; 262 count++;
272 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) 263 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
@@ -291,7 +282,7 @@ static void __init check_sysemu(void)
291 break; 282 break;
292 } 283 }
293 } 284 }
294 if (stop_ptraced_child(pid, stack, 0, 0) < 0) 285 if (stop_ptraced_child(pid, 0, 0) < 0)
295 goto fail_stopped; 286 goto fail_stopped;
296 287
297 sysemu_supported = 2; 288 sysemu_supported = 2;
@@ -302,18 +293,17 @@ static void __init check_sysemu(void)
302 return; 293 return;
303 294
304fail: 295fail:
305 stop_ptraced_child(pid, stack, 1, 0); 296 stop_ptraced_child(pid, 1, 0);
306fail_stopped: 297fail_stopped:
307 printk("missing\n"); 298 printk("missing\n");
308} 299}
309 300
310void __init check_ptrace(void) 301void __init check_ptrace(void)
311{ 302{
312 void *stack;
313 int pid, syscall, n, status; 303 int pid, syscall, n, status;
314 304
315 printk("Checking that ptrace can change system call numbers..."); 305 printk("Checking that ptrace can change system call numbers...");
316 pid = start_ptraced_child(&stack); 306 pid = start_ptraced_child();
317 307
318 if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) 308 if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
319 panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno); 309 panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno);
@@ -340,7 +330,7 @@ void __init check_ptrace(void)
340 break; 330 break;
341 } 331 }
342 } 332 }
343 stop_ptraced_child(pid, stack, 0, 1); 333 stop_ptraced_child(pid, 0, 1);
344 printk("OK\n"); 334 printk("OK\n");
345 check_sysemu(); 335 check_sysemu();
346} 336}
@@ -372,11 +362,10 @@ void forward_pending_sigio(int target)
372static inline int check_skas3_ptrace_support(void) 362static inline int check_skas3_ptrace_support(void)
373{ 363{
374 struct ptrace_faultinfo fi; 364 struct ptrace_faultinfo fi;
375 void *stack;
376 int pid, n, ret = 1; 365 int pid, n, ret = 1;
377 366
378 printf("Checking for the skas3 patch in the host..."); 367 printf("Checking for the skas3 patch in the host...");
379 pid = start_ptraced_child(&stack); 368 pid = start_ptraced_child();
380 369
381 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); 370 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
382 if (n < 0) { 371 if (n < 0) {
@@ -391,7 +380,7 @@ static inline int check_skas3_ptrace_support(void)
391 } 380 }
392 381
393 init_registers(pid); 382 init_registers(pid);
394 stop_ptraced_child(pid, stack, 1, 1); 383 stop_ptraced_child(pid, 1, 1);
395 384
396 return(ret); 385 return(ret);
397} 386}
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index ab5d3271da0b..fc71ef295782 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -68,8 +68,11 @@ void new_thread_handler(int sig)
68 * 0 if it just exits 68 * 0 if it just exits
69 */ 69 */
70 n = run_kernel_thread(fn, arg, &current->thread.exec_buf); 70 n = run_kernel_thread(fn, arg, &current->thread.exec_buf);
71 if(n == 1) 71 if(n == 1){
72 /* Handle any immediate reschedules or signals */
73 interrupt_end();
72 userspace(&current->thread.regs.regs); 74 userspace(&current->thread.regs.regs);
75 }
73 else do_exit(0); 76 else do_exit(0);
74} 77}
75 78
@@ -96,6 +99,8 @@ void fork_handler(int sig)
96 schedule_tail(current->thread.prev_sched); 99 schedule_tail(current->thread.prev_sched);
97 current->thread.prev_sched = NULL; 100 current->thread.prev_sched = NULL;
98 101
102 /* Handle any immediate reschedules or signals */
103 interrupt_end();
99 userspace(&current->thread.regs.regs); 104 userspace(&current->thread.regs.regs);
100} 105}
101 106
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 418427107b29..8736d098f0ee 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -26,7 +26,6 @@
26#include "asm/setup.h" 26#include "asm/setup.h"
27#include "ubd_user.h" 27#include "ubd_user.h"
28#include "asm/current.h" 28#include "asm/current.h"
29#include "asm/setup.h"
30#include "user_util.h" 29#include "user_util.h"
31#include "kern_util.h" 30#include "kern_util.h"
32#include "kern.h" 31#include "kern.h"
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c
index 9aee0b62ebca..f0d6060e3e57 100644
--- a/arch/um/os-Linux/elf_aux.c
+++ b/arch/um/os-Linux/elf_aux.c
@@ -45,7 +45,11 @@ __init void scan_elf_aux( char **envp)
45 elf_aux_hwcap = auxv->a_un.a_val; 45 elf_aux_hwcap = auxv->a_un.a_val;
46 break; 46 break;
47 case AT_PLATFORM: 47 case AT_PLATFORM:
48 elf_aux_platform = auxv->a_un.a_ptr; 48 /* elf.h removed the pointer elements from
49 * a_un, so we have to use a_val, which is
50 * all that's left.
51 */
52 elf_aux_platform = (char *) auxv->a_un.a_val;
49 break; 53 break;
50 case AT_PAGESZ: 54 case AT_PAGESZ:
51 page_size = auxv->a_un.a_val; 55 page_size = auxv->a_un.a_val;
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 77d4066d1af8..fd45bb260907 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -363,7 +363,7 @@ int os_write_file(int fd, const void *buf, int len)
363 (int (*)(int, void *, int)) write, copy_to_user_proc)); 363 (int (*)(int, void *, int)) write, copy_to_user_proc));
364} 364}
365 365
366int os_file_size(char *file, long long *size_out) 366int os_file_size(char *file, unsigned long long *size_out)
367{ 367{
368 struct uml_stat buf; 368 struct uml_stat buf;
369 int err; 369 int err;
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 0b2491883d9c..98346c711493 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -14,7 +14,7 @@ quiet_cmd_make_link = SYMLINK $@
14cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ 14cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@
15 15
16# this needs to be before the foreach, because targets does not accept 16# this needs to be before the foreach, because targets does not accept
17# complete paths like $(obj)/$(f). To make sure this works, use a := assignment, 17# complete paths like $(obj)/$(f). To make sure this works, use a := assignment
18# or we will get $(obj)/$(f) in the "targets" value. 18# or we will get $(obj)/$(f) in the "targets" value.
19# Also, this forces you to use the := syntax when assigning to targets. 19# Also, this forces you to use the := syntax when assigning to targets.
20# Otherwise the line below will cause an infinite loop (if you don't know why, 20# Otherwise the line below will cause an infinite loop (if you don't know why,
diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c
index a491f72cc966..504e63474993 100644
--- a/arch/x86_64/kernel/aperture.c
+++ b/arch/x86_64/kernel/aperture.c
@@ -33,12 +33,10 @@ int fallback_aper_force __initdata = 0;
33 33
34int fix_aperture __initdata = 1; 34int fix_aperture __initdata = 1;
35 35
36#define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16)) 36/* This code runs before the PCI subsystem is initialized, so just
37 access the northbridge directly. */
37 38
38static struct resource aper_res = { 39#define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16))
39 .name = "Aperture",
40 .flags = IORESOURCE_MEM,
41};
42 40
43static u32 __init allocate_aperture(void) 41static u32 __init allocate_aperture(void)
44{ 42{
@@ -55,24 +53,11 @@ static u32 __init allocate_aperture(void)
55 aper_size = (32 * 1024 * 1024) << fallback_aper_order; 53 aper_size = (32 * 1024 * 1024) << fallback_aper_order;
56 54
57 /* 55 /*
58 * Aperture has to be naturally aligned. This means an 2GB 56 * Aperture has to be naturally aligned. This means an 2GB aperture won't
59 * aperture won't have much chances to find a place in the 57 * have much chances to find a place in the lower 4GB of memory.
60 * lower 4GB of memory. Unfortunately we cannot move it up 58 * Unfortunately we cannot move it up because that would make the
61 * because that would make the IOMMU useless. 59 * IOMMU useless.
62 */ 60 */
63
64 /* First try to find some free unused space */
65 if (!allocate_resource(&iomem_resource, &aper_res,
66 aper_size,
67 0, 0xffffffff,
68 aper_size,
69 NULL, NULL)) {
70 printk(KERN_INFO "Putting aperture at %lx-%lx\n",
71 aper_res.start, aper_res.end);
72 return aper_res.start;
73 }
74
75 /* No free space found. Go on to waste some memory... */
76 p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0); 61 p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0);
77 if (!p || __pa(p)+aper_size > 0xffffffff) { 62 if (!p || __pa(p)+aper_size > 0xffffffff) {
78 printk("Cannot allocate aperture memory hole (%p,%uK)\n", 63 printk("Cannot allocate aperture memory hole (%p,%uK)\n",
@@ -81,7 +66,7 @@ static u32 __init allocate_aperture(void)
81 free_bootmem_node(nd0, (unsigned long)p, aper_size); 66 free_bootmem_node(nd0, (unsigned long)p, aper_size);
82 return 0; 67 return 0;
83 } 68 }
84 printk("Mapping aperture over %d KB of precious RAM @ %lx\n", 69 printk("Mapping aperture over %d KB of RAM @ %lx\n",
85 aper_size >> 10, __pa(p)); 70 aper_size >> 10, __pa(p));
86 return (u32)__pa(p); 71 return (u32)__pa(p);
87} 72}
@@ -102,16 +87,10 @@ static int __init aperture_valid(char *name, u64 aper_base, u32 aper_size)
102 printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name); 87 printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name);
103 return 0; 88 return 0;
104 } 89 }
105 /* Don't check the resource here because the aperture is usually
106 in an e820 reserved area, and we allocated these earlier. */
107 return 1; 90 return 1;
108} 91}
109 92
110/* 93/* Find a PCI capability */
111 * Find a PCI capability.
112 * This code runs before the PCI subsystem is initialized, so just
113 * access the northbridge directly.
114 */
115static __u32 __init find_cap(int num, int slot, int func, int cap) 94static __u32 __init find_cap(int num, int slot, int func, int cap)
116{ 95{
117 u8 pos; 96 u8 pos;
@@ -276,6 +255,8 @@ void __init iommu_hole_init(void)
276 fallback_aper_force) { 255 fallback_aper_force) {
277 printk("Your BIOS doesn't leave a aperture memory hole\n"); 256 printk("Your BIOS doesn't leave a aperture memory hole\n");
278 printk("Please enable the IOMMU option in the BIOS setup\n"); 257 printk("Please enable the IOMMU option in the BIOS setup\n");
258 printk("This costs you %d MB of RAM\n",
259 32 << fallback_aper_order);
279 260
280 aper_order = fallback_aper_order; 261 aper_order = fallback_aper_order;
281 aper_alloc = allocate_aperture(); 262 aper_alloc = allocate_aperture();
diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile
index d1dcd8eae3c9..5b77188527a9 100644
--- a/drivers/atm/Makefile
+++ b/drivers/atm/Makefile
@@ -39,7 +39,8 @@ ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
39 fore_200e-objs += fore200e_pca_fw.o 39 fore_200e-objs += fore200e_pca_fw.o
40 # guess the target endianess to choose the right PCA-200E firmware image 40 # guess the target endianess to choose the right PCA-200E firmware image
41 ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y) 41 ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y)
42 CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(src)/../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo $(obj)/pca200e.bin; else echo $(obj)/pca200e_ecd.bin2; fi) 42 byteorder.h := include$(if $(patsubst $(srctree),,$(objtree)),2)/asm/byteorder.h
43 CONFIG_ATM_FORE200E_PCA_FW := $(obj)/pca200e$(if $(shell $(CC) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2)
43 endif 44 endif
44endif 45endif
45 46
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 9e65bfb85ba3..5f702199543a 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -383,8 +383,7 @@ fore200e_shutdown(struct fore200e* fore200e)
383 switch(fore200e->state) { 383 switch(fore200e->state) {
384 384
385 case FORE200E_STATE_COMPLETE: 385 case FORE200E_STATE_COMPLETE:
386 if (fore200e->stats) 386 kfree(fore200e->stats);
387 kfree(fore200e->stats);
388 387
389 case FORE200E_STATE_IRQ: 388 case FORE200E_STATE_IRQ:
390 free_irq(fore200e->irq, fore200e->atm_dev); 389 free_irq(fore200e->irq, fore200e->atm_dev);
@@ -963,8 +962,7 @@ fore200e_tx_irq(struct fore200e* fore200e)
963 entry, txq->tail, entry->vc_map, entry->skb); 962 entry, txq->tail, entry->vc_map, entry->skb);
964 963
965 /* free copy of misaligned data */ 964 /* free copy of misaligned data */
966 if (entry->data) 965 kfree(entry->data);
967 kfree(entry->data);
968 966
969 /* remove DMA mapping */ 967 /* remove DMA mapping */
970 fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length, 968 fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length,
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 3022c548a132..df2c83fd5496 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -412,8 +412,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
412init_one_failure: 412init_one_failure:
413 if (atm_dev) 413 if (atm_dev)
414 atm_dev_deregister(atm_dev); 414 atm_dev_deregister(atm_dev);
415 if (he_dev) 415 kfree(he_dev);
416 kfree(he_dev);
417 pci_disable_device(pci_dev); 416 pci_disable_device(pci_dev);
418 return err; 417 return err;
419} 418}
@@ -2534,8 +2533,7 @@ he_open(struct atm_vcc *vcc)
2534open_failed: 2533open_failed:
2535 2534
2536 if (err) { 2535 if (err) {
2537 if (he_vcc) 2536 kfree(he_vcc);
2538 kfree(he_vcc);
2539 clear_bit(ATM_VF_ADDR, &vcc->flags); 2537 clear_bit(ATM_VF_ADDR, &vcc->flags);
2540 } 2538 }
2541 else 2539 else
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 85bf5c8442b0..b2a7b754fd14 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -676,10 +676,10 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
676 PRINTK("nicstar%d: RSQ base at 0x%x.\n", i, (u32) card->rsq.base); 676 PRINTK("nicstar%d: RSQ base at 0x%x.\n", i, (u32) card->rsq.base);
677 677
678 /* Initialize SCQ0, the only VBR SCQ used */ 678 /* Initialize SCQ0, the only VBR SCQ used */
679 card->scq1 = (scq_info *) NULL; 679 card->scq1 = NULL;
680 card->scq2 = (scq_info *) NULL; 680 card->scq2 = NULL;
681 card->scq0 = get_scq(VBR_SCQSIZE, NS_VRSCD0); 681 card->scq0 = get_scq(VBR_SCQSIZE, NS_VRSCD0);
682 if (card->scq0 == (scq_info *) NULL) 682 if (card->scq0 == NULL)
683 { 683 {
684 printk("nicstar%d: can't get SCQ0.\n", i); 684 printk("nicstar%d: can't get SCQ0.\n", i);
685 error = 12; 685 error = 12;
@@ -993,24 +993,24 @@ static scq_info *get_scq(int size, u32 scd)
993 int i; 993 int i;
994 994
995 if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) 995 if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
996 return (scq_info *) NULL; 996 return NULL;
997 997
998 scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL); 998 scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL);
999 if (scq == (scq_info *) NULL) 999 if (scq == NULL)
1000 return (scq_info *) NULL; 1000 return NULL;
1001 scq->org = kmalloc(2 * size, GFP_KERNEL); 1001 scq->org = kmalloc(2 * size, GFP_KERNEL);
1002 if (scq->org == NULL) 1002 if (scq->org == NULL)
1003 { 1003 {
1004 kfree(scq); 1004 kfree(scq);
1005 return (scq_info *) NULL; 1005 return NULL;
1006 } 1006 }
1007 scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) * 1007 scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) *
1008 (size / NS_SCQE_SIZE), GFP_KERNEL); 1008 (size / NS_SCQE_SIZE), GFP_KERNEL);
1009 if (scq->skb == (struct sk_buff **) NULL) 1009 if (scq->skb == NULL)
1010 { 1010 {
1011 kfree(scq->org); 1011 kfree(scq->org);
1012 kfree(scq); 1012 kfree(scq);
1013 return (scq_info *) NULL; 1013 return NULL;
1014 } 1014 }
1015 scq->num_entries = size / NS_SCQE_SIZE; 1015 scq->num_entries = size / NS_SCQE_SIZE;
1016 scq->base = (ns_scqe *) ALIGN_ADDRESS(scq->org, size); 1016 scq->base = (ns_scqe *) ALIGN_ADDRESS(scq->org, size);
@@ -1498,7 +1498,7 @@ static int ns_open(struct atm_vcc *vcc)
1498 vc->cbr_scd = NS_FRSCD + frscdi * NS_FRSCD_SIZE; 1498 vc->cbr_scd = NS_FRSCD + frscdi * NS_FRSCD_SIZE;
1499 1499
1500 scq = get_scq(CBR_SCQSIZE, vc->cbr_scd); 1500 scq = get_scq(CBR_SCQSIZE, vc->cbr_scd);
1501 if (scq == (scq_info *) NULL) 1501 if (scq == NULL)
1502 { 1502 {
1503 PRINTK("nicstar%d: can't get fixed rate SCQ.\n", card->index); 1503 PRINTK("nicstar%d: can't get fixed rate SCQ.\n", card->index);
1504 card->scd2vc[frscdi] = NULL; 1504 card->scd2vc[frscdi] = NULL;
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 47a800519ad0..8d5e65cb9755 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -902,7 +902,7 @@ static void close_tx(struct atm_vcc *vcc)
902 zatm_dev->tx_bw += vcc->qos.txtp.min_pcr; 902 zatm_dev->tx_bw += vcc->qos.txtp.min_pcr;
903 dealloc_shaper(vcc->dev,zatm_vcc->shaper); 903 dealloc_shaper(vcc->dev,zatm_vcc->shaper);
904 } 904 }
905 if (zatm_vcc->ring) kfree(zatm_vcc->ring); 905 kfree(zatm_vcc->ring);
906} 906}
907 907
908 908
@@ -1339,12 +1339,9 @@ static int __init zatm_start(struct atm_dev *dev)
1339 return 0; 1339 return 0;
1340 out: 1340 out:
1341 for (i = 0; i < NR_MBX; i++) 1341 for (i = 0; i < NR_MBX; i++)
1342 if (zatm_dev->mbx_start[i] != 0) 1342 kfree(zatm_dev->mbx_start[i]);
1343 kfree((void *) zatm_dev->mbx_start[i]); 1343 kfree(zatm_dev->rx_map);
1344 if (zatm_dev->rx_map != NULL) 1344 kfree(zatm_dev->tx_map);
1345 kfree(zatm_dev->rx_map);
1346 if (zatm_dev->tx_map != NULL)
1347 kfree(zatm_dev->tx_map);
1348 free_irq(zatm_dev->irq, dev); 1345 free_irq(zatm_dev->irq, dev);
1349 return error; 1346 return error;
1350} 1347}
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c
index 0ef7a0065ece..2210bacad56a 100644
--- a/drivers/block/cfq-iosched.c
+++ b/drivers/block/cfq-iosched.c
@@ -1202,13 +1202,16 @@ retry:
1202 if (new_cfqq) { 1202 if (new_cfqq) {
1203 cfqq = new_cfqq; 1203 cfqq = new_cfqq;
1204 new_cfqq = NULL; 1204 new_cfqq = NULL;
1205 } else if (gfp_mask & __GFP_WAIT) { 1205 } else {
1206 spin_unlock_irq(cfqd->queue->queue_lock); 1206 spin_unlock_irq(cfqd->queue->queue_lock);
1207 new_cfqq = kmem_cache_alloc(cfq_pool, gfp_mask); 1207 new_cfqq = kmem_cache_alloc(cfq_pool, gfp_mask);
1208 spin_lock_irq(cfqd->queue->queue_lock); 1208 spin_lock_irq(cfqd->queue->queue_lock);
1209
1210 if (!new_cfqq && !(gfp_mask & __GFP_WAIT))
1211 goto out;
1212
1209 goto retry; 1213 goto retry;
1210 } else 1214 }
1211 goto out;
1212 1215
1213 memset(cfqq, 0, sizeof(*cfqq)); 1216 memset(cfqq, 0, sizeof(*cfqq));
1214 1217
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c
index 6b79b4314622..89982925f9e2 100644
--- a/drivers/block/elevator.c
+++ b/drivers/block/elevator.c
@@ -220,11 +220,6 @@ void elevator_exit(elevator_t *e)
220 kfree(e); 220 kfree(e);
221} 221}
222 222
223static int elevator_global_init(void)
224{
225 return 0;
226}
227
228int elv_merge(request_queue_t *q, struct request **req, struct bio *bio) 223int elv_merge(request_queue_t *q, struct request **req, struct bio *bio)
229{ 224{
230 elevator_t *e = q->elevator; 225 elevator_t *e = q->elevator;
@@ -322,7 +317,7 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where,
322 int nrq = q->rq.count[READ] + q->rq.count[WRITE] 317 int nrq = q->rq.count[READ] + q->rq.count[WRITE]
323 - q->in_flight; 318 - q->in_flight;
324 319
325 if (nrq == q->unplug_thresh) 320 if (nrq >= q->unplug_thresh)
326 __generic_unplug_device(q); 321 __generic_unplug_device(q);
327 } 322 }
328 } else 323 } else
@@ -692,8 +687,6 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
692 return len; 687 return len;
693} 688}
694 689
695module_init(elevator_global_init);
696
697EXPORT_SYMBOL(elv_add_request); 690EXPORT_SYMBOL(elv_add_request);
698EXPORT_SYMBOL(__elv_add_request); 691EXPORT_SYMBOL(__elv_add_request);
699EXPORT_SYMBOL(elv_requeue_request); 692EXPORT_SYMBOL(elv_requeue_request);
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index ce42889f98fb..19c5e59bcfa8 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -8,13 +8,12 @@
8 * and is not licensed separately. See file COPYING for details. 8 * and is not licensed separately. See file COPYING for details.
9 * 9 *
10 * TODO (sorted by decreasing priority) 10 * TODO (sorted by decreasing priority)
11 * -- Kill first_open (Al Viro fixed the block layer now)
11 * -- Do resets with usb_device_reset (needs a thread context, use khubd) 12 * -- Do resets with usb_device_reset (needs a thread context, use khubd)
12 * -- set readonly flag for CDs, set removable flag for CF readers 13 * -- set readonly flag for CDs, set removable flag for CF readers
13 * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch) 14 * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch)
14 * -- support pphaneuf's SDDR-75 with two LUNs (also broken capacity...)
15 * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries 15 * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries
16 * -- verify the 13 conditions and do bulk resets 16 * -- verify the 13 conditions and do bulk resets
17 * -- normal pool of commands instead of cmdv[]?
18 * -- kill last_pipe and simply do two-state clearing on both pipes 17 * -- kill last_pipe and simply do two-state clearing on both pipes
19 * -- verify protocol (bulk) from USB descriptors (maybe...) 18 * -- verify protocol (bulk) from USB descriptors (maybe...)
20 * -- highmem and sg 19 * -- highmem and sg
@@ -49,7 +48,14 @@
49#define US_SC_SCSI 0x06 /* Transparent */ 48#define US_SC_SCSI 0x06 /* Transparent */
50 49
51/* 50/*
51 * This many LUNs per USB device.
52 * Every one of them takes a host, see UB_MAX_HOSTS.
52 */ 53 */
54#define UB_MAX_LUNS 9
55
56/*
57 */
58
53#define UB_MINORS_PER_MAJOR 8 59#define UB_MINORS_PER_MAJOR 8
54 60
55#define UB_MAX_CDB_SIZE 16 /* Corresponds to Bulk */ 61#define UB_MAX_CDB_SIZE 16 /* Corresponds to Bulk */
@@ -65,7 +71,7 @@ struct bulk_cb_wrap {
65 u32 Tag; /* unique per command id */ 71 u32 Tag; /* unique per command id */
66 __le32 DataTransferLength; /* size of data */ 72 __le32 DataTransferLength; /* size of data */
67 u8 Flags; /* direction in bit 0 */ 73 u8 Flags; /* direction in bit 0 */
68 u8 Lun; /* LUN normally 0 */ 74 u8 Lun; /* LUN */
69 u8 Length; /* of of the CDB */ 75 u8 Length; /* of of the CDB */
70 u8 CDB[UB_MAX_CDB_SIZE]; /* max command */ 76 u8 CDB[UB_MAX_CDB_SIZE]; /* max command */
71}; 77};
@@ -168,6 +174,7 @@ struct ub_scsi_cmd {
168 unsigned int len; /* Requested length */ 174 unsigned int len; /* Requested length */
169 // struct scatterlist sgv[UB_MAX_REQ_SG]; 175 // struct scatterlist sgv[UB_MAX_REQ_SG];
170 176
177 struct ub_lun *lun;
171 void (*done)(struct ub_dev *, struct ub_scsi_cmd *); 178 void (*done)(struct ub_dev *, struct ub_scsi_cmd *);
172 void *back; 179 void *back;
173}; 180};
@@ -252,25 +259,47 @@ struct ub_scsi_cmd_queue {
252}; 259};
253 260
254/* 261/*
255 * The UB device instance. 262 * The block device instance (one per LUN).
263 */
264struct ub_lun {
265 struct ub_dev *udev;
266 struct list_head link;
267 struct gendisk *disk;
268 int id; /* Host index */
269 int num; /* LUN number */
270 char name[16];
271
272 int changed; /* Media was changed */
273 int removable;
274 int readonly;
275 int first_open; /* Kludge. See ub_bd_open. */
276
277 /* Use Ingo's mempool if or when we have more than one command. */
278 /*
279 * Currently we never need more than one command for the whole device.
280 * However, giving every LUN a command is a cheap and automatic way
281 * to enforce fairness between them.
282 */
283 int cmda[1];
284 struct ub_scsi_cmd cmdv[1];
285
286 struct ub_capacity capacity;
287};
288
289/*
290 * The USB device instance.
256 */ 291 */
257struct ub_dev { 292struct ub_dev {
258 spinlock_t lock; 293 spinlock_t lock;
259 int id; /* Number among ub's */
260 atomic_t poison; /* The USB device is disconnected */ 294 atomic_t poison; /* The USB device is disconnected */
261 int openc; /* protected by ub_lock! */ 295 int openc; /* protected by ub_lock! */
262 /* kref is too implicit for our taste */ 296 /* kref is too implicit for our taste */
263 unsigned int tagcnt; 297 unsigned int tagcnt;
264 int changed; /* Media was changed */ 298 char name[12];
265 int removable;
266 int readonly;
267 int first_open; /* Kludge. See ub_bd_open. */
268 char name[8];
269 struct usb_device *dev; 299 struct usb_device *dev;
270 struct usb_interface *intf; 300 struct usb_interface *intf;
271 301
272 struct ub_capacity capacity; 302 struct list_head luns;
273 struct gendisk *disk;
274 303
275 unsigned int send_bulk_pipe; /* cached pipe values */ 304 unsigned int send_bulk_pipe; /* cached pipe values */
276 unsigned int recv_bulk_pipe; 305 unsigned int recv_bulk_pipe;
@@ -279,10 +308,6 @@ struct ub_dev {
279 308
280 struct tasklet_struct tasklet; 309 struct tasklet_struct tasklet;
281 310
282 /* XXX Use Ingo's mempool (once we have more than one) */
283 int cmda[1];
284 struct ub_scsi_cmd cmdv[1];
285
286 struct ub_scsi_cmd_queue cmd_queue; 311 struct ub_scsi_cmd_queue cmd_queue;
287 struct ub_scsi_cmd top_rqs_cmd; /* REQUEST SENSE */ 312 struct ub_scsi_cmd top_rqs_cmd; /* REQUEST SENSE */
288 unsigned char top_sense[UB_SENSE_SIZE]; 313 unsigned char top_sense[UB_SENSE_SIZE];
@@ -301,9 +326,9 @@ struct ub_dev {
301/* 326/*
302 */ 327 */
303static void ub_cleanup(struct ub_dev *sc); 328static void ub_cleanup(struct ub_dev *sc);
304static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq); 329static int ub_bd_rq_fn_1(struct ub_lun *lun, struct request *rq);
305static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 330static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
306 struct request *rq); 331 struct ub_scsi_cmd *cmd, struct request *rq);
307static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 332static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
308 struct request *rq); 333 struct request *rq);
309static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd); 334static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
@@ -320,8 +345,10 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
320static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 345static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
321 int stalled_pipe); 346 int stalled_pipe);
322static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd); 347static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd);
323static int ub_sync_tur(struct ub_dev *sc); 348static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun);
324static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret); 349static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
350 struct ub_capacity *ret);
351static int ub_probe_lun(struct ub_dev *sc, int lnum);
325 352
326/* 353/*
327 */ 354 */
@@ -342,6 +369,7 @@ MODULE_DEVICE_TABLE(usb, ub_usb_ids);
342 */ 369 */
343#define UB_MAX_HOSTS 26 370#define UB_MAX_HOSTS 26
344static char ub_hostv[UB_MAX_HOSTS]; 371static char ub_hostv[UB_MAX_HOSTS];
372
345static DEFINE_SPINLOCK(ub_lock); /* Locks globals and ->openc */ 373static DEFINE_SPINLOCK(ub_lock); /* Locks globals and ->openc */
346 374
347/* 375/*
@@ -406,6 +434,8 @@ static ssize_t ub_diag_show(struct device *dev, char *page)
406{ 434{
407 struct usb_interface *intf; 435 struct usb_interface *intf;
408 struct ub_dev *sc; 436 struct ub_dev *sc;
437 struct list_head *p;
438 struct ub_lun *lun;
409 int cnt; 439 int cnt;
410 unsigned long flags; 440 unsigned long flags;
411 int nc, nh; 441 int nc, nh;
@@ -421,9 +451,15 @@ static ssize_t ub_diag_show(struct device *dev, char *page)
421 spin_lock_irqsave(&sc->lock, flags); 451 spin_lock_irqsave(&sc->lock, flags);
422 452
423 cnt += sprintf(page + cnt, 453 cnt += sprintf(page + cnt,
424 "qlen %d qmax %d changed %d removable %d readonly %d\n", 454 "qlen %d qmax %d\n",
425 sc->cmd_queue.qlen, sc->cmd_queue.qmax, 455 sc->cmd_queue.qlen, sc->cmd_queue.qmax);
426 sc->changed, sc->removable, sc->readonly); 456
457 list_for_each (p, &sc->luns) {
458 lun = list_entry(p, struct ub_lun, link);
459 cnt += sprintf(page + cnt,
460 "lun %u changed %d removable %d readonly %d\n",
461 lun->num, lun->changed, lun->removable, lun->readonly);
462 }
427 463
428 if ((nc = sc->tr.cur + 1) == SCMD_TRACE_SZ) nc = 0; 464 if ((nc = sc->tr.cur + 1) == SCMD_TRACE_SZ) nc = 0;
429 for (j = 0; j < SCMD_TRACE_SZ; j++) { 465 for (j = 0; j < SCMD_TRACE_SZ; j++) {
@@ -523,53 +559,63 @@ static void ub_put(struct ub_dev *sc)
523 */ 559 */
524static void ub_cleanup(struct ub_dev *sc) 560static void ub_cleanup(struct ub_dev *sc)
525{ 561{
562 struct list_head *p;
563 struct ub_lun *lun;
526 request_queue_t *q; 564 request_queue_t *q;
527 565
528 /* I don't think queue can be NULL. But... Stolen from sx8.c */ 566 while (!list_empty(&sc->luns)) {
529 if ((q = sc->disk->queue) != NULL) 567 p = sc->luns.next;
530 blk_cleanup_queue(q); 568 lun = list_entry(p, struct ub_lun, link);
569 list_del(p);
531 570
532 /* 571 /* I don't think queue can be NULL. But... Stolen from sx8.c */
533 * If we zero disk->private_data BEFORE put_disk, we have to check 572 if ((q = lun->disk->queue) != NULL)
534 * for NULL all over the place in open, release, check_media and 573 blk_cleanup_queue(q);
535 * revalidate, because the block level semaphore is well inside the 574 /*
536 * put_disk. But we cannot zero after the call, because *disk is gone. 575 * If we zero disk->private_data BEFORE put_disk, we have
537 * The sd.c is blatantly racy in this area. 576 * to check for NULL all over the place in open, release,
538 */ 577 * check_media and revalidate, because the block level
539 /* disk->private_data = NULL; */ 578 * semaphore is well inside the put_disk.
540 put_disk(sc->disk); 579 * But we cannot zero after the call, because *disk is gone.
541 sc->disk = NULL; 580 * The sd.c is blatantly racy in this area.
581 */
582 /* disk->private_data = NULL; */
583 put_disk(lun->disk);
584 lun->disk = NULL;
585
586 ub_id_put(lun->id);
587 kfree(lun);
588 }
542 589
543 ub_id_put(sc->id);
544 kfree(sc); 590 kfree(sc);
545} 591}
546 592
547/* 593/*
548 * The "command allocator". 594 * The "command allocator".
549 */ 595 */
550static struct ub_scsi_cmd *ub_get_cmd(struct ub_dev *sc) 596static struct ub_scsi_cmd *ub_get_cmd(struct ub_lun *lun)
551{ 597{
552 struct ub_scsi_cmd *ret; 598 struct ub_scsi_cmd *ret;
553 599
554 if (sc->cmda[0]) 600 if (lun->cmda[0])
555 return NULL; 601 return NULL;
556 ret = &sc->cmdv[0]; 602 ret = &lun->cmdv[0];
557 sc->cmda[0] = 1; 603 lun->cmda[0] = 1;
558 return ret; 604 return ret;
559} 605}
560 606
561static void ub_put_cmd(struct ub_dev *sc, struct ub_scsi_cmd *cmd) 607static void ub_put_cmd(struct ub_lun *lun, struct ub_scsi_cmd *cmd)
562{ 608{
563 if (cmd != &sc->cmdv[0]) { 609 if (cmd != &lun->cmdv[0]) {
564 printk(KERN_WARNING "%s: releasing a foreign cmd %p\n", 610 printk(KERN_WARNING "%s: releasing a foreign cmd %p\n",
565 sc->name, cmd); 611 lun->name, cmd);
566 return; 612 return;
567 } 613 }
568 if (!sc->cmda[0]) { 614 if (!lun->cmda[0]) {
569 printk(KERN_WARNING "%s: releasing a free cmd\n", sc->name); 615 printk(KERN_WARNING "%s: releasing a free cmd\n", lun->name);
570 return; 616 return;
571 } 617 }
572 sc->cmda[0] = 0; 618 lun->cmda[0] = 0;
573} 619}
574 620
575/* 621/*
@@ -630,29 +676,30 @@ static struct ub_scsi_cmd *ub_cmdq_pop(struct ub_dev *sc)
630 676
631static void ub_bd_rq_fn(request_queue_t *q) 677static void ub_bd_rq_fn(request_queue_t *q)
632{ 678{
633 struct ub_dev *sc = q->queuedata; 679 struct ub_lun *lun = q->queuedata;
634 struct request *rq; 680 struct request *rq;
635 681
636 while ((rq = elv_next_request(q)) != NULL) { 682 while ((rq = elv_next_request(q)) != NULL) {
637 if (ub_bd_rq_fn_1(sc, rq) != 0) { 683 if (ub_bd_rq_fn_1(lun, rq) != 0) {
638 blk_stop_queue(q); 684 blk_stop_queue(q);
639 break; 685 break;
640 } 686 }
641 } 687 }
642} 688}
643 689
644static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq) 690static int ub_bd_rq_fn_1(struct ub_lun *lun, struct request *rq)
645{ 691{
692 struct ub_dev *sc = lun->udev;
646 struct ub_scsi_cmd *cmd; 693 struct ub_scsi_cmd *cmd;
647 int rc; 694 int rc;
648 695
649 if (atomic_read(&sc->poison) || sc->changed) { 696 if (atomic_read(&sc->poison) || lun->changed) {
650 blkdev_dequeue_request(rq); 697 blkdev_dequeue_request(rq);
651 ub_end_rq(rq, 0); 698 ub_end_rq(rq, 0);
652 return 0; 699 return 0;
653 } 700 }
654 701
655 if ((cmd = ub_get_cmd(sc)) == NULL) 702 if ((cmd = ub_get_cmd(lun)) == NULL)
656 return -1; 703 return -1;
657 memset(cmd, 0, sizeof(struct ub_scsi_cmd)); 704 memset(cmd, 0, sizeof(struct ub_scsi_cmd));
658 705
@@ -661,32 +708,30 @@ static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq)
661 if (blk_pc_request(rq)) { 708 if (blk_pc_request(rq)) {
662 rc = ub_cmd_build_packet(sc, cmd, rq); 709 rc = ub_cmd_build_packet(sc, cmd, rq);
663 } else { 710 } else {
664 rc = ub_cmd_build_block(sc, cmd, rq); 711 rc = ub_cmd_build_block(sc, lun, cmd, rq);
665 } 712 }
666 if (rc != 0) { 713 if (rc != 0) {
667 ub_put_cmd(sc, cmd); 714 ub_put_cmd(lun, cmd);
668 ub_end_rq(rq, 0); 715 ub_end_rq(rq, 0);
669 blk_start_queue(sc->disk->queue);
670 return 0; 716 return 0;
671 } 717 }
672
673 cmd->state = UB_CMDST_INIT; 718 cmd->state = UB_CMDST_INIT;
719 cmd->lun = lun;
674 cmd->done = ub_rw_cmd_done; 720 cmd->done = ub_rw_cmd_done;
675 cmd->back = rq; 721 cmd->back = rq;
676 722
677 cmd->tag = sc->tagcnt++; 723 cmd->tag = sc->tagcnt++;
678 if ((rc = ub_submit_scsi(sc, cmd)) != 0) { 724 if ((rc = ub_submit_scsi(sc, cmd)) != 0) {
679 ub_put_cmd(sc, cmd); 725 ub_put_cmd(lun, cmd);
680 ub_end_rq(rq, 0); 726 ub_end_rq(rq, 0);
681 blk_start_queue(sc->disk->queue);
682 return 0; 727 return 0;
683 } 728 }
684 729
685 return 0; 730 return 0;
686} 731}
687 732
688static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 733static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
689 struct request *rq) 734 struct ub_scsi_cmd *cmd, struct request *rq)
690{ 735{
691 int ub_dir; 736 int ub_dir;
692#if 0 /* We use rq->buffer for now */ 737#if 0 /* We use rq->buffer for now */
@@ -707,7 +752,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
707 sg = &cmd->sgv[0]; 752 sg = &cmd->sgv[0];
708 n_elem = blk_rq_map_sg(q, rq, sg); 753 n_elem = blk_rq_map_sg(q, rq, sg);
709 if (n_elem <= 0) { 754 if (n_elem <= 0) {
710 ub_put_cmd(sc, cmd); 755 ub_put_cmd(lun, cmd);
711 ub_end_rq(rq, 0); 756 ub_end_rq(rq, 0);
712 blk_start_queue(q); 757 blk_start_queue(q);
713 return 0; /* request with no s/g entries? */ 758 return 0; /* request with no s/g entries? */
@@ -716,7 +761,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
716 if (n_elem != 1) { /* Paranoia */ 761 if (n_elem != 1) { /* Paranoia */
717 printk(KERN_WARNING "%s: request with %d segments\n", 762 printk(KERN_WARNING "%s: request with %d segments\n",
718 sc->name, n_elem); 763 sc->name, n_elem);
719 ub_put_cmd(sc, cmd); 764 ub_put_cmd(lun, cmd);
720 ub_end_rq(rq, 0); 765 ub_end_rq(rq, 0);
721 blk_start_queue(q); 766 blk_start_queue(q);
722 return 0; 767 return 0;
@@ -748,8 +793,8 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
748 * The call to blk_queue_hardsect_size() guarantees that request 793 * The call to blk_queue_hardsect_size() guarantees that request
749 * is aligned, but it is given in terms of 512 byte units, always. 794 * is aligned, but it is given in terms of 512 byte units, always.
750 */ 795 */
751 block = rq->sector >> sc->capacity.bshift; 796 block = rq->sector >> lun->capacity.bshift;
752 nblks = rq->nr_sectors >> sc->capacity.bshift; 797 nblks = rq->nr_sectors >> lun->capacity.bshift;
753 798
754 cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10; 799 cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10;
755 /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */ 800 /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */
@@ -803,7 +848,8 @@ static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
803static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) 848static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
804{ 849{
805 struct request *rq = cmd->back; 850 struct request *rq = cmd->back;
806 struct gendisk *disk = sc->disk; 851 struct ub_lun *lun = cmd->lun;
852 struct gendisk *disk = lun->disk;
807 request_queue_t *q = disk->queue; 853 request_queue_t *q = disk->queue;
808 int uptodate; 854 int uptodate;
809 855
@@ -818,7 +864,7 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
818 else 864 else
819 uptodate = 0; 865 uptodate = 0;
820 866
821 ub_put_cmd(sc, cmd); 867 ub_put_cmd(lun, cmd);
822 ub_end_rq(rq, uptodate); 868 ub_end_rq(rq, uptodate);
823 blk_start_queue(q); 869 blk_start_queue(q);
824} 870}
@@ -887,7 +933,7 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
887 bcb->Tag = cmd->tag; /* Endianness is not important */ 933 bcb->Tag = cmd->tag; /* Endianness is not important */
888 bcb->DataTransferLength = cpu_to_le32(cmd->len); 934 bcb->DataTransferLength = cpu_to_le32(cmd->len);
889 bcb->Flags = (cmd->dir == UB_DIR_READ) ? 0x80 : 0; 935 bcb->Flags = (cmd->dir == UB_DIR_READ) ? 0x80 : 0;
890 bcb->Lun = 0; /* No multi-LUN yet */ 936 bcb->Lun = (cmd->lun != NULL) ? cmd->lun->num : 0;
891 bcb->Length = cmd->cdb_len; 937 bcb->Length = cmd->cdb_len;
892 938
893 /* copy the command payload */ 939 /* copy the command payload */
@@ -1002,9 +1048,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1002 * The control pipe clears itself - nothing to do. 1048 * The control pipe clears itself - nothing to do.
1003 * XXX Might try to reset the device here and retry. 1049 * XXX Might try to reset the device here and retry.
1004 */ 1050 */
1005 printk(KERN_NOTICE "%s: " 1051 printk(KERN_NOTICE "%s: stall on control pipe\n",
1006 "stall on control pipe for device %u\n", 1052 sc->name);
1007 sc->name, sc->dev->devnum);
1008 goto Bad_End; 1053 goto Bad_End;
1009 } 1054 }
1010 1055
@@ -1025,9 +1070,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1025 * The control pipe clears itself - nothing to do. 1070 * The control pipe clears itself - nothing to do.
1026 * XXX Might try to reset the device here and retry. 1071 * XXX Might try to reset the device here and retry.
1027 */ 1072 */
1028 printk(KERN_NOTICE "%s: " 1073 printk(KERN_NOTICE "%s: stall on control pipe\n",
1029 "stall on control pipe for device %u\n", 1074 sc->name);
1030 sc->name, sc->dev->devnum);
1031 goto Bad_End; 1075 goto Bad_End;
1032 } 1076 }
1033 1077
@@ -1046,9 +1090,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1046 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); 1090 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
1047 if (rc != 0) { 1091 if (rc != 0) {
1048 printk(KERN_NOTICE "%s: " 1092 printk(KERN_NOTICE "%s: "
1049 "unable to submit clear for device %u" 1093 "unable to submit clear (%d)\n",
1050 " (code %d)\n", 1094 sc->name, rc);
1051 sc->name, sc->dev->devnum, rc);
1052 /* 1095 /*
1053 * This is typically ENOMEM or some other such shit. 1096 * This is typically ENOMEM or some other such shit.
1054 * Retrying is pointless. Just do Bad End on it... 1097 * Retrying is pointless. Just do Bad End on it...
@@ -1107,9 +1150,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1107 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); 1150 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
1108 if (rc != 0) { 1151 if (rc != 0) {
1109 printk(KERN_NOTICE "%s: " 1152 printk(KERN_NOTICE "%s: "
1110 "unable to submit clear for device %u" 1153 "unable to submit clear (%d)\n",
1111 " (code %d)\n", 1154 sc->name, rc);
1112 sc->name, sc->dev->devnum, rc);
1113 /* 1155 /*
1114 * This is typically ENOMEM or some other such shit. 1156 * This is typically ENOMEM or some other such shit.
1115 * Retrying is pointless. Just do Bad End on it... 1157 * Retrying is pointless. Just do Bad End on it...
@@ -1140,9 +1182,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1140 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); 1182 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
1141 if (rc != 0) { 1183 if (rc != 0) {
1142 printk(KERN_NOTICE "%s: " 1184 printk(KERN_NOTICE "%s: "
1143 "unable to submit clear for device %u" 1185 "unable to submit clear (%d)\n",
1144 " (code %d)\n", 1186 sc->name, rc);
1145 sc->name, sc->dev->devnum, rc);
1146 /* 1187 /*
1147 * This is typically ENOMEM or some other such shit. 1188 * This is typically ENOMEM or some other such shit.
1148 * Retrying is pointless. Just do Bad End on it... 1189 * Retrying is pointless. Just do Bad End on it...
@@ -1164,9 +1205,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1164 * encounter such a thing, try to read the CSW again. 1205 * encounter such a thing, try to read the CSW again.
1165 */ 1206 */
1166 if (++cmd->stat_count >= 4) { 1207 if (++cmd->stat_count >= 4) {
1167 printk(KERN_NOTICE "%s: " 1208 printk(KERN_NOTICE "%s: unable to get CSW\n",
1168 "unable to get CSW on device %u\n", 1209 sc->name);
1169 sc->name, sc->dev->devnum);
1170 goto Bad_End; 1210 goto Bad_End;
1171 } 1211 }
1172 __ub_state_stat(sc, cmd); 1212 __ub_state_stat(sc, cmd);
@@ -1207,10 +1247,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1207 */ 1247 */
1208 if (++cmd->stat_count >= 4) { 1248 if (++cmd->stat_count >= 4) {
1209 printk(KERN_NOTICE "%s: " 1249 printk(KERN_NOTICE "%s: "
1210 "tag mismatch orig 0x%x reply 0x%x " 1250 "tag mismatch orig 0x%x reply 0x%x\n",
1211 "on device %u\n", 1251 sc->name, cmd->tag, bcs->Tag);
1212 sc->name, cmd->tag, bcs->Tag,
1213 sc->dev->devnum);
1214 goto Bad_End; 1252 goto Bad_End;
1215 } 1253 }
1216 __ub_state_stat(sc, cmd); 1254 __ub_state_stat(sc, cmd);
@@ -1244,8 +1282,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1244 1282
1245 } else { 1283 } else {
1246 printk(KERN_WARNING "%s: " 1284 printk(KERN_WARNING "%s: "
1247 "wrong command state %d on device %u\n", 1285 "wrong command state %d\n",
1248 sc->name, cmd->state, sc->dev->devnum); 1286 sc->name, cmd->state);
1249 goto Bad_End; 1287 goto Bad_End;
1250 } 1288 }
1251 return; 1289 return;
@@ -1288,7 +1326,6 @@ static void __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1288 1326
1289 if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) { 1327 if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) {
1290 /* XXX Clear stalls */ 1328 /* XXX Clear stalls */
1291 printk("%s: CSW #%d submit failed (%d)\n", sc->name, cmd->tag, rc); /* P3 */
1292 ub_complete(&sc->work_done); 1329 ub_complete(&sc->work_done);
1293 ub_state_done(sc, cmd, rc); 1330 ub_state_done(sc, cmd, rc);
1294 return; 1331 return;
@@ -1333,6 +1370,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1333 scmd->state = UB_CMDST_INIT; 1370 scmd->state = UB_CMDST_INIT;
1334 scmd->data = sc->top_sense; 1371 scmd->data = sc->top_sense;
1335 scmd->len = UB_SENSE_SIZE; 1372 scmd->len = UB_SENSE_SIZE;
1373 scmd->lun = cmd->lun;
1336 scmd->done = ub_top_sense_done; 1374 scmd->done = ub_top_sense_done;
1337 scmd->back = cmd; 1375 scmd->back = cmd;
1338 1376
@@ -1411,14 +1449,14 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd)
1411 } 1449 }
1412 if (cmd != scmd->back) { 1450 if (cmd != scmd->back) {
1413 printk(KERN_WARNING "%s: " 1451 printk(KERN_WARNING "%s: "
1414 "sense done for wrong command 0x%x on device %u\n", 1452 "sense done for wrong command 0x%x\n",
1415 sc->name, cmd->tag, sc->dev->devnum); 1453 sc->name, cmd->tag);
1416 return; 1454 return;
1417 } 1455 }
1418 if (cmd->state != UB_CMDST_SENSE) { 1456 if (cmd->state != UB_CMDST_SENSE) {
1419 printk(KERN_WARNING "%s: " 1457 printk(KERN_WARNING "%s: "
1420 "sense done with bad cmd state %d on device %u\n", 1458 "sense done with bad cmd state %d\n",
1421 sc->name, cmd->state, sc->dev->devnum); 1459 sc->name, cmd->state);
1422 return; 1460 return;
1423 } 1461 }
1424 1462
@@ -1429,68 +1467,32 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd)
1429 ub_scsi_urb_compl(sc, cmd); 1467 ub_scsi_urb_compl(sc, cmd);
1430} 1468}
1431 1469
1432#if 0
1433/* Determine what the maximum LUN supported is */
1434int usb_stor_Bulk_max_lun(struct us_data *us)
1435{
1436 int result;
1437
1438 /* issue the command */
1439 result = usb_stor_control_msg(us, us->recv_ctrl_pipe,
1440 US_BULK_GET_MAX_LUN,
1441 USB_DIR_IN | USB_TYPE_CLASS |
1442 USB_RECIP_INTERFACE,
1443 0, us->ifnum, us->iobuf, 1, HZ);
1444
1445 /*
1446 * Some devices (i.e. Iomega Zip100) need this -- apparently
1447 * the bulk pipes get STALLed when the GetMaxLUN request is
1448 * processed. This is, in theory, harmless to all other devices
1449 * (regardless of if they stall or not).
1450 */
1451 if (result < 0) {
1452 usb_stor_clear_halt(us, us->recv_bulk_pipe);
1453 usb_stor_clear_halt(us, us->send_bulk_pipe);
1454 }
1455
1456 US_DEBUGP("GetMaxLUN command result is %d, data is %d\n",
1457 result, us->iobuf[0]);
1458
1459 /* if we have a successful request, return the result */
1460 if (result == 1)
1461 return us->iobuf[0];
1462
1463 /* return the default -- no LUNs */
1464 return 0;
1465}
1466#endif
1467
1468/* 1470/*
1469 * This is called from a process context. 1471 * This is called from a process context.
1470 */ 1472 */
1471static void ub_revalidate(struct ub_dev *sc) 1473static void ub_revalidate(struct ub_dev *sc, struct ub_lun *lun)
1472{ 1474{
1473 1475
1474 sc->readonly = 0; /* XXX Query this from the device */ 1476 lun->readonly = 0; /* XXX Query this from the device */
1475 1477
1476 sc->capacity.nsec = 0; 1478 lun->capacity.nsec = 0;
1477 sc->capacity.bsize = 512; 1479 lun->capacity.bsize = 512;
1478 sc->capacity.bshift = 0; 1480 lun->capacity.bshift = 0;
1479 1481
1480 if (ub_sync_tur(sc) != 0) 1482 if (ub_sync_tur(sc, lun) != 0)
1481 return; /* Not ready */ 1483 return; /* Not ready */
1482 sc->changed = 0; 1484 lun->changed = 0;
1483 1485
1484 if (ub_sync_read_cap(sc, &sc->capacity) != 0) { 1486 if (ub_sync_read_cap(sc, lun, &lun->capacity) != 0) {
1485 /* 1487 /*
1486 * The retry here means something is wrong, either with the 1488 * The retry here means something is wrong, either with the
1487 * device, with the transport, or with our code. 1489 * device, with the transport, or with our code.
1488 * We keep this because sd.c has retries for capacity. 1490 * We keep this because sd.c has retries for capacity.
1489 */ 1491 */
1490 if (ub_sync_read_cap(sc, &sc->capacity) != 0) { 1492 if (ub_sync_read_cap(sc, lun, &lun->capacity) != 0) {
1491 sc->capacity.nsec = 0; 1493 lun->capacity.nsec = 0;
1492 sc->capacity.bsize = 512; 1494 lun->capacity.bsize = 512;
1493 sc->capacity.bshift = 0; 1495 lun->capacity.bshift = 0;
1494 } 1496 }
1495 } 1497 }
1496} 1498}
@@ -1503,12 +1505,15 @@ static void ub_revalidate(struct ub_dev *sc)
1503static int ub_bd_open(struct inode *inode, struct file *filp) 1505static int ub_bd_open(struct inode *inode, struct file *filp)
1504{ 1506{
1505 struct gendisk *disk = inode->i_bdev->bd_disk; 1507 struct gendisk *disk = inode->i_bdev->bd_disk;
1508 struct ub_lun *lun;
1506 struct ub_dev *sc; 1509 struct ub_dev *sc;
1507 unsigned long flags; 1510 unsigned long flags;
1508 int rc; 1511 int rc;
1509 1512
1510 if ((sc = disk->private_data) == NULL) 1513 if ((lun = disk->private_data) == NULL)
1511 return -ENXIO; 1514 return -ENXIO;
1515 sc = lun->udev;
1516
1512 spin_lock_irqsave(&ub_lock, flags); 1517 spin_lock_irqsave(&ub_lock, flags);
1513 if (atomic_read(&sc->poison)) { 1518 if (atomic_read(&sc->poison)) {
1514 spin_unlock_irqrestore(&ub_lock, flags); 1519 spin_unlock_irqrestore(&ub_lock, flags);
@@ -1529,15 +1534,15 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
1529 * The bottom line is, Al Viro says that we should not allow 1534 * The bottom line is, Al Viro says that we should not allow
1530 * bdev->bd_invalidated to be set when doing add_disk no matter what. 1535 * bdev->bd_invalidated to be set when doing add_disk no matter what.
1531 */ 1536 */
1532 if (sc->first_open) { 1537 if (lun->first_open) {
1533 if (sc->changed) { 1538 lun->first_open = 0;
1534 sc->first_open = 0; 1539 if (lun->changed) {
1535 rc = -ENOMEDIUM; 1540 rc = -ENOMEDIUM;
1536 goto err_open; 1541 goto err_open;
1537 } 1542 }
1538 } 1543 }
1539 1544
1540 if (sc->removable || sc->readonly) 1545 if (lun->removable || lun->readonly)
1541 check_disk_change(inode->i_bdev); 1546 check_disk_change(inode->i_bdev);
1542 1547
1543 /* 1548 /*
@@ -1545,12 +1550,12 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
1545 * under some pretty murky conditions (a failure of READ CAPACITY). 1550 * under some pretty murky conditions (a failure of READ CAPACITY).
1546 * We may need it one day. 1551 * We may need it one day.
1547 */ 1552 */
1548 if (sc->removable && sc->changed && !(filp->f_flags & O_NDELAY)) { 1553 if (lun->removable && lun->changed && !(filp->f_flags & O_NDELAY)) {
1549 rc = -ENOMEDIUM; 1554 rc = -ENOMEDIUM;
1550 goto err_open; 1555 goto err_open;
1551 } 1556 }
1552 1557
1553 if (sc->readonly && (filp->f_mode & FMODE_WRITE)) { 1558 if (lun->readonly && (filp->f_mode & FMODE_WRITE)) {
1554 rc = -EROFS; 1559 rc = -EROFS;
1555 goto err_open; 1560 goto err_open;
1556 } 1561 }
@@ -1567,7 +1572,8 @@ err_open:
1567static int ub_bd_release(struct inode *inode, struct file *filp) 1572static int ub_bd_release(struct inode *inode, struct file *filp)
1568{ 1573{
1569 struct gendisk *disk = inode->i_bdev->bd_disk; 1574 struct gendisk *disk = inode->i_bdev->bd_disk;
1570 struct ub_dev *sc = disk->private_data; 1575 struct ub_lun *lun = disk->private_data;
1576 struct ub_dev *sc = lun->udev;
1571 1577
1572 ub_put(sc); 1578 ub_put(sc);
1573 return 0; 1579 return 0;
@@ -1597,20 +1603,14 @@ static int ub_bd_ioctl(struct inode *inode, struct file *filp,
1597 */ 1603 */
1598static int ub_bd_revalidate(struct gendisk *disk) 1604static int ub_bd_revalidate(struct gendisk *disk)
1599{ 1605{
1600 struct ub_dev *sc = disk->private_data; 1606 struct ub_lun *lun = disk->private_data;
1601 1607
1602 ub_revalidate(sc); 1608 ub_revalidate(lun->udev, lun);
1603 /* This is pretty much a long term P3 */
1604 if (!atomic_read(&sc->poison)) { /* Cover sc->dev */
1605 printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n",
1606 sc->name, sc->dev->devnum,
1607 sc->capacity.nsec, sc->capacity.bsize);
1608 }
1609 1609
1610 /* XXX Support sector size switching like in sr.c */ 1610 /* XXX Support sector size switching like in sr.c */
1611 blk_queue_hardsect_size(disk->queue, sc->capacity.bsize); 1611 blk_queue_hardsect_size(disk->queue, lun->capacity.bsize);
1612 set_capacity(disk, sc->capacity.nsec); 1612 set_capacity(disk, lun->capacity.nsec);
1613 // set_disk_ro(sdkp->disk, sc->readonly); 1613 // set_disk_ro(sdkp->disk, lun->readonly);
1614 1614
1615 return 0; 1615 return 0;
1616} 1616}
@@ -1626,9 +1626,9 @@ static int ub_bd_revalidate(struct gendisk *disk)
1626 */ 1626 */
1627static int ub_bd_media_changed(struct gendisk *disk) 1627static int ub_bd_media_changed(struct gendisk *disk)
1628{ 1628{
1629 struct ub_dev *sc = disk->private_data; 1629 struct ub_lun *lun = disk->private_data;
1630 1630
1631 if (!sc->removable) 1631 if (!lun->removable)
1632 return 0; 1632 return 0;
1633 1633
1634 /* 1634 /*
@@ -1640,12 +1640,12 @@ static int ub_bd_media_changed(struct gendisk *disk)
1640 * will fail, then block layer discards the data. Since we never 1640 * will fail, then block layer discards the data. Since we never
1641 * spin drives up, such devices simply cannot be used with ub anyway. 1641 * spin drives up, such devices simply cannot be used with ub anyway.
1642 */ 1642 */
1643 if (ub_sync_tur(sc) != 0) { 1643 if (ub_sync_tur(lun->udev, lun) != 0) {
1644 sc->changed = 1; 1644 lun->changed = 1;
1645 return 1; 1645 return 1;
1646 } 1646 }
1647 1647
1648 return sc->changed; 1648 return lun->changed;
1649} 1649}
1650 1650
1651static struct block_device_operations ub_bd_fops = { 1651static struct block_device_operations ub_bd_fops = {
@@ -1669,7 +1669,7 @@ static void ub_probe_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1669/* 1669/*
1670 * Test if the device has a check condition on it, synchronously. 1670 * Test if the device has a check condition on it, synchronously.
1671 */ 1671 */
1672static int ub_sync_tur(struct ub_dev *sc) 1672static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun)
1673{ 1673{
1674 struct ub_scsi_cmd *cmd; 1674 struct ub_scsi_cmd *cmd;
1675 enum { ALLOC_SIZE = sizeof(struct ub_scsi_cmd) }; 1675 enum { ALLOC_SIZE = sizeof(struct ub_scsi_cmd) };
@@ -1688,6 +1688,7 @@ static int ub_sync_tur(struct ub_dev *sc)
1688 cmd->cdb_len = 6; 1688 cmd->cdb_len = 6;
1689 cmd->dir = UB_DIR_NONE; 1689 cmd->dir = UB_DIR_NONE;
1690 cmd->state = UB_CMDST_INIT; 1690 cmd->state = UB_CMDST_INIT;
1691 cmd->lun = lun; /* This may be NULL, but that's ok */
1691 cmd->done = ub_probe_done; 1692 cmd->done = ub_probe_done;
1692 cmd->back = &compl; 1693 cmd->back = &compl;
1693 1694
@@ -1718,7 +1719,8 @@ err_alloc:
1718/* 1719/*
1719 * Read the SCSI capacity synchronously (for probing). 1720 * Read the SCSI capacity synchronously (for probing).
1720 */ 1721 */
1721static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret) 1722static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
1723 struct ub_capacity *ret)
1722{ 1724{
1723 struct ub_scsi_cmd *cmd; 1725 struct ub_scsi_cmd *cmd;
1724 char *p; 1726 char *p;
@@ -1743,6 +1745,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret)
1743 cmd->state = UB_CMDST_INIT; 1745 cmd->state = UB_CMDST_INIT;
1744 cmd->data = p; 1746 cmd->data = p;
1745 cmd->len = 8; 1747 cmd->len = 8;
1748 cmd->lun = lun;
1746 cmd->done = ub_probe_done; 1749 cmd->done = ub_probe_done;
1747 cmd->back = &compl; 1750 cmd->back = &compl;
1748 1751
@@ -1812,6 +1815,90 @@ static void ub_probe_timeout(unsigned long arg)
1812} 1815}
1813 1816
1814/* 1817/*
1818 * Get number of LUNs by the way of Bulk GetMaxLUN command.
1819 */
1820static int ub_sync_getmaxlun(struct ub_dev *sc)
1821{
1822 int ifnum = sc->intf->cur_altsetting->desc.bInterfaceNumber;
1823 unsigned char *p;
1824 enum { ALLOC_SIZE = 1 };
1825 struct usb_ctrlrequest *cr;
1826 struct completion compl;
1827 struct timer_list timer;
1828 int nluns;
1829 int rc;
1830
1831 init_completion(&compl);
1832
1833 rc = -ENOMEM;
1834 if ((p = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
1835 goto err_alloc;
1836 *p = 55;
1837
1838 cr = &sc->work_cr;
1839 cr->bRequestType = USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE;
1840 cr->bRequest = US_BULK_GET_MAX_LUN;
1841 cr->wValue = cpu_to_le16(0);
1842 cr->wIndex = cpu_to_le16(ifnum);
1843 cr->wLength = cpu_to_le16(1);
1844
1845 usb_fill_control_urb(&sc->work_urb, sc->dev, sc->recv_ctrl_pipe,
1846 (unsigned char*) cr, p, 1, ub_probe_urb_complete, &compl);
1847 sc->work_urb.transfer_flags = 0;
1848 sc->work_urb.actual_length = 0;
1849 sc->work_urb.error_count = 0;
1850 sc->work_urb.status = 0;
1851
1852 if ((rc = usb_submit_urb(&sc->work_urb, GFP_KERNEL)) != 0) {
1853 if (rc == -EPIPE) {
1854 printk("%s: Stall at GetMaxLUN, using 1 LUN\n",
1855 sc->name); /* P3 */
1856 } else {
1857 printk(KERN_WARNING
1858 "%s: Unable to submit GetMaxLUN (%d)\n",
1859 sc->name, rc);
1860 }
1861 goto err_submit;
1862 }
1863
1864 init_timer(&timer);
1865 timer.function = ub_probe_timeout;
1866 timer.data = (unsigned long) &compl;
1867 timer.expires = jiffies + UB_CTRL_TIMEOUT;
1868 add_timer(&timer);
1869
1870 wait_for_completion(&compl);
1871
1872 del_timer_sync(&timer);
1873 usb_kill_urb(&sc->work_urb);
1874
1875 if (sc->work_urb.actual_length != 1) {
1876 printk("%s: GetMaxLUN returned %d bytes\n", sc->name,
1877 sc->work_urb.actual_length); /* P3 */
1878 nluns = 0;
1879 } else {
1880 if ((nluns = *p) == 55) {
1881 nluns = 0;
1882 } else {
1883 /* GetMaxLUN returns the maximum LUN number */
1884 nluns += 1;
1885 if (nluns > UB_MAX_LUNS)
1886 nluns = UB_MAX_LUNS;
1887 }
1888 printk("%s: GetMaxLUN returned %d, using %d LUNs\n", sc->name,
1889 *p, nluns); /* P3 */
1890 }
1891
1892 kfree(p);
1893 return nluns;
1894
1895err_submit:
1896 kfree(p);
1897err_alloc:
1898 return rc;
1899}
1900
1901/*
1815 * Clear initial stalls. 1902 * Clear initial stalls.
1816 */ 1903 */
1817static int ub_probe_clear_stall(struct ub_dev *sc, int stalled_pipe) 1904static int ub_probe_clear_stall(struct ub_dev *sc, int stalled_pipe)
@@ -1897,8 +1984,8 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev,
1897 } 1984 }
1898 1985
1899 if (ep_in == NULL || ep_out == NULL) { 1986 if (ep_in == NULL || ep_out == NULL) {
1900 printk(KERN_NOTICE "%s: device %u failed endpoint check\n", 1987 printk(KERN_NOTICE "%s: failed endpoint check\n",
1901 sc->name, sc->dev->devnum); 1988 sc->name);
1902 return -EIO; 1989 return -EIO;
1903 } 1990 }
1904 1991
@@ -1921,8 +2008,7 @@ static int ub_probe(struct usb_interface *intf,
1921 const struct usb_device_id *dev_id) 2008 const struct usb_device_id *dev_id)
1922{ 2009{
1923 struct ub_dev *sc; 2010 struct ub_dev *sc;
1924 request_queue_t *q; 2011 int nluns;
1925 struct gendisk *disk;
1926 int rc; 2012 int rc;
1927 int i; 2013 int i;
1928 2014
@@ -1931,6 +2017,7 @@ static int ub_probe(struct usb_interface *intf,
1931 goto err_core; 2017 goto err_core;
1932 memset(sc, 0, sizeof(struct ub_dev)); 2018 memset(sc, 0, sizeof(struct ub_dev));
1933 spin_lock_init(&sc->lock); 2019 spin_lock_init(&sc->lock);
2020 INIT_LIST_HEAD(&sc->luns);
1934 usb_init_urb(&sc->work_urb); 2021 usb_init_urb(&sc->work_urb);
1935 tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc); 2022 tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc);
1936 atomic_set(&sc->poison, 0); 2023 atomic_set(&sc->poison, 0);
@@ -1942,19 +2029,16 @@ static int ub_probe(struct usb_interface *intf,
1942 ub_init_completion(&sc->work_done); 2029 ub_init_completion(&sc->work_done);
1943 sc->work_done.done = 1; /* A little yuk, but oh well... */ 2030 sc->work_done.done = 1; /* A little yuk, but oh well... */
1944 2031
1945 rc = -ENOSR;
1946 if ((sc->id = ub_id_get()) == -1)
1947 goto err_id;
1948 snprintf(sc->name, 8, DRV_NAME "%c", sc->id + 'a');
1949
1950 sc->dev = interface_to_usbdev(intf); 2032 sc->dev = interface_to_usbdev(intf);
1951 sc->intf = intf; 2033 sc->intf = intf;
1952 // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; 2034 // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
1953
1954 usb_set_intfdata(intf, sc); 2035 usb_set_intfdata(intf, sc);
1955 usb_get_dev(sc->dev); 2036 usb_get_dev(sc->dev);
1956 // usb_get_intf(sc->intf); /* Do we need this? */ 2037 // usb_get_intf(sc->intf); /* Do we need this? */
1957 2038
2039 snprintf(sc->name, 12, DRV_NAME "(%d.%d)",
2040 sc->dev->bus->busnum, sc->dev->devnum);
2041
1958 /* XXX Verify that we can handle the device (from descriptors) */ 2042 /* XXX Verify that we can handle the device (from descriptors) */
1959 2043
1960 ub_get_pipes(sc, sc->dev, intf); 2044 ub_get_pipes(sc, sc->dev, intf);
@@ -1992,35 +2076,88 @@ static int ub_probe(struct usb_interface *intf,
1992 * In any case it's not our business how revaliadation is implemented. 2076 * In any case it's not our business how revaliadation is implemented.
1993 */ 2077 */
1994 for (i = 0; i < 3; i++) { /* Retries for benh's key */ 2078 for (i = 0; i < 3; i++) { /* Retries for benh's key */
1995 if ((rc = ub_sync_tur(sc)) <= 0) break; 2079 if ((rc = ub_sync_tur(sc, NULL)) <= 0) break;
1996 if (rc != 0x6) break; 2080 if (rc != 0x6) break;
1997 msleep(10); 2081 msleep(10);
1998 } 2082 }
1999 2083
2000 sc->removable = 1; /* XXX Query this from the device */ 2084 nluns = 1;
2001 sc->changed = 1; /* ub_revalidate clears only */ 2085 for (i = 0; i < 3; i++) {
2002 sc->first_open = 1; 2086 if ((rc = ub_sync_getmaxlun(sc)) < 0) {
2087 /*
2088 * Some devices (i.e. Iomega Zip100) need this --
2089 * apparently the bulk pipes get STALLed when the
2090 * GetMaxLUN request is processed.
2091 * XXX I have a ZIP-100, verify it does this.
2092 */
2093 if (rc == -EPIPE) {
2094 ub_probe_clear_stall(sc, sc->recv_bulk_pipe);
2095 ub_probe_clear_stall(sc, sc->send_bulk_pipe);
2096 }
2097 break;
2098 }
2099 if (rc != 0) {
2100 nluns = rc;
2101 break;
2102 }
2103 msleep(100);
2104 }
2003 2105
2004 ub_revalidate(sc); 2106 for (i = 0; i < nluns; i++) {
2005 /* This is pretty much a long term P3 */ 2107 ub_probe_lun(sc, i);
2006 printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n", 2108 }
2007 sc->name, sc->dev->devnum, sc->capacity.nsec, sc->capacity.bsize); 2109 return 0;
2110
2111 /* device_remove_file(&sc->intf->dev, &dev_attr_diag); */
2112err_diag:
2113 usb_set_intfdata(intf, NULL);
2114 // usb_put_intf(sc->intf);
2115 usb_put_dev(sc->dev);
2116 kfree(sc);
2117err_core:
2118 return rc;
2119}
2120
2121static int ub_probe_lun(struct ub_dev *sc, int lnum)
2122{
2123 struct ub_lun *lun;
2124 request_queue_t *q;
2125 struct gendisk *disk;
2126 int rc;
2127
2128 rc = -ENOMEM;
2129 if ((lun = kmalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
2130 goto err_alloc;
2131 memset(lun, 0, sizeof(struct ub_lun));
2132 lun->num = lnum;
2133
2134 rc = -ENOSR;
2135 if ((lun->id = ub_id_get()) == -1)
2136 goto err_id;
2137
2138 lun->udev = sc;
2139 list_add(&lun->link, &sc->luns);
2140
2141 snprintf(lun->name, 16, DRV_NAME "%c(%d.%d.%d)",
2142 lun->id + 'a', sc->dev->bus->busnum, sc->dev->devnum, lun->num);
2143
2144 lun->removable = 1; /* XXX Query this from the device */
2145 lun->changed = 1; /* ub_revalidate clears only */
2146 lun->first_open = 1;
2147 ub_revalidate(sc, lun);
2008 2148
2009 /*
2010 * Just one disk per sc currently, but maybe more.
2011 */
2012 rc = -ENOMEM; 2149 rc = -ENOMEM;
2013 if ((disk = alloc_disk(UB_MINORS_PER_MAJOR)) == NULL) 2150 if ((disk = alloc_disk(UB_MINORS_PER_MAJOR)) == NULL)
2014 goto err_diskalloc; 2151 goto err_diskalloc;
2015 2152
2016 sc->disk = disk; 2153 lun->disk = disk;
2017 sprintf(disk->disk_name, DRV_NAME "%c", sc->id + 'a'); 2154 sprintf(disk->disk_name, DRV_NAME "%c", lun->id + 'a');
2018 sprintf(disk->devfs_name, DEVFS_NAME "/%c", sc->id + 'a'); 2155 sprintf(disk->devfs_name, DEVFS_NAME "/%c", lun->id + 'a');
2019 disk->major = UB_MAJOR; 2156 disk->major = UB_MAJOR;
2020 disk->first_minor = sc->id * UB_MINORS_PER_MAJOR; 2157 disk->first_minor = lun->id * UB_MINORS_PER_MAJOR;
2021 disk->fops = &ub_bd_fops; 2158 disk->fops = &ub_bd_fops;
2022 disk->private_data = sc; 2159 disk->private_data = lun;
2023 disk->driverfs_dev = &intf->dev; 2160 disk->driverfs_dev = &sc->intf->dev; /* XXX Many to one ok? */
2024 2161
2025 rc = -ENOMEM; 2162 rc = -ENOMEM;
2026 if ((q = blk_init_queue(ub_bd_rq_fn, &sc->lock)) == NULL) 2163 if ((q = blk_init_queue(ub_bd_rq_fn, &sc->lock)) == NULL)
@@ -2028,28 +2165,17 @@ static int ub_probe(struct usb_interface *intf,
2028 2165
2029 disk->queue = q; 2166 disk->queue = q;
2030 2167
2031 // blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask); 2168 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
2032 blk_queue_max_hw_segments(q, UB_MAX_REQ_SG); 2169 blk_queue_max_hw_segments(q, UB_MAX_REQ_SG);
2033 blk_queue_max_phys_segments(q, UB_MAX_REQ_SG); 2170 blk_queue_max_phys_segments(q, UB_MAX_REQ_SG);
2034 // blk_queue_segment_boundary(q, CARM_SG_BOUNDARY); 2171 blk_queue_segment_boundary(q, 0xffffffff); /* Dubious. */
2035 blk_queue_max_sectors(q, UB_MAX_SECTORS); 2172 blk_queue_max_sectors(q, UB_MAX_SECTORS);
2036 blk_queue_hardsect_size(q, sc->capacity.bsize); 2173 blk_queue_hardsect_size(q, lun->capacity.bsize);
2037
2038 /*
2039 * This is a serious infraction, caused by a deficiency in the
2040 * USB sg interface (usb_sg_wait()). We plan to remove this once
2041 * we get mileage on the driver and can justify a change to USB API.
2042 * See blk_queue_bounce_limit() to understand this part.
2043 *
2044 * XXX And I still need to be aware of the DMA mask in the HC.
2045 */
2046 q->bounce_pfn = blk_max_low_pfn;
2047 q->bounce_gfp = GFP_NOIO;
2048 2174
2049 q->queuedata = sc; 2175 q->queuedata = lun;
2050 2176
2051 set_capacity(disk, sc->capacity.nsec); 2177 set_capacity(disk, lun->capacity.nsec);
2052 if (sc->removable) 2178 if (lun->removable)
2053 disk->flags |= GENHD_FL_REMOVABLE; 2179 disk->flags |= GENHD_FL_REMOVABLE;
2054 2180
2055 add_disk(disk); 2181 add_disk(disk);
@@ -2059,22 +2185,20 @@ static int ub_probe(struct usb_interface *intf,
2059err_blkqinit: 2185err_blkqinit:
2060 put_disk(disk); 2186 put_disk(disk);
2061err_diskalloc: 2187err_diskalloc:
2062 device_remove_file(&sc->intf->dev, &dev_attr_diag); 2188 list_del(&lun->link);
2063err_diag: 2189 ub_id_put(lun->id);
2064 usb_set_intfdata(intf, NULL);
2065 // usb_put_intf(sc->intf);
2066 usb_put_dev(sc->dev);
2067 ub_id_put(sc->id);
2068err_id: 2190err_id:
2069 kfree(sc); 2191 kfree(lun);
2070err_core: 2192err_alloc:
2071 return rc; 2193 return rc;
2072} 2194}
2073 2195
2074static void ub_disconnect(struct usb_interface *intf) 2196static void ub_disconnect(struct usb_interface *intf)
2075{ 2197{
2076 struct ub_dev *sc = usb_get_intfdata(intf); 2198 struct ub_dev *sc = usb_get_intfdata(intf);
2077 struct gendisk *disk = sc->disk; 2199 struct list_head *p;
2200 struct ub_lun *lun;
2201 struct gendisk *disk;
2078 unsigned long flags; 2202 unsigned long flags;
2079 2203
2080 /* 2204 /*
@@ -2124,14 +2248,18 @@ static void ub_disconnect(struct usb_interface *intf)
2124 /* 2248 /*
2125 * Unregister the upper layer. 2249 * Unregister the upper layer.
2126 */ 2250 */
2127 if (disk->flags & GENHD_FL_UP) 2251 list_for_each (p, &sc->luns) {
2128 del_gendisk(disk); 2252 lun = list_entry(p, struct ub_lun, link);
2129 /* 2253 disk = lun->disk;
2130 * I wish I could do: 2254 if (disk->flags & GENHD_FL_UP)
2131 * set_bit(QUEUE_FLAG_DEAD, &q->queue_flags); 2255 del_gendisk(disk);
2132 * As it is, we rely on our internal poisoning and let 2256 /*
2133 * the upper levels to spin furiously failing all the I/O. 2257 * I wish I could do:
2134 */ 2258 * set_bit(QUEUE_FLAG_DEAD, &q->queue_flags);
2259 * As it is, we rely on our internal poisoning and let
2260 * the upper levels to spin furiously failing all the I/O.
2261 */
2262 }
2135 2263
2136 /* 2264 /*
2137 * Taking a lock on a structure which is about to be freed 2265 * Taking a lock on a structure which is about to be freed
@@ -2182,8 +2310,8 @@ static int __init ub_init(void)
2182{ 2310{
2183 int rc; 2311 int rc;
2184 2312
2185 /* P3 */ printk("ub: sizeof ub_scsi_cmd %zu ub_dev %zu\n", 2313 /* P3 */ printk("ub: sizeof ub_scsi_cmd %zu ub_dev %zu ub_lun %zu\n",
2186 sizeof(struct ub_scsi_cmd), sizeof(struct ub_dev)); 2314 sizeof(struct ub_scsi_cmd), sizeof(struct ub_dev), sizeof(struct ub_lun));
2187 2315
2188 if ((rc = register_blkdev(UB_MAJOR, DRV_NAME)) != 0) 2316 if ((rc = register_blkdev(UB_MAJOR, DRV_NAME)) != 0)
2189 goto err_regblkdev; 2317 goto err_regblkdev;
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
index ad9c11391d81..c1fe013c64f3 100644
--- a/drivers/char/agp/agp.h
+++ b/drivers/char/agp/agp.h
@@ -278,6 +278,8 @@ void agp3_generic_cleanup(void);
278#define AGP_GENERIC_SIZES_ENTRIES 11 278#define AGP_GENERIC_SIZES_ENTRIES 11
279extern struct aper_size_info_16 agp3_generic_sizes[]; 279extern struct aper_size_info_16 agp3_generic_sizes[];
280 280
281#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x)))
282#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x)))
281 283
282extern int agp_off; 284extern int agp_off;
283extern int agp_try_unsupported_boot; 285extern int agp_try_unsupported_boot;
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c
index 0212febda654..9c9c9c2247ce 100644
--- a/drivers/char/agp/ali-agp.c
+++ b/drivers/char/agp/ali-agp.c
@@ -150,7 +150,7 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge)
150 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); 150 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
151 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, 151 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
152 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | 152 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
153 virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN )); 153 virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN ));
154 return addr; 154 return addr;
155} 155}
156 156
@@ -174,7 +174,7 @@ static void m1541_destroy_page(void * addr)
174 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); 174 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
175 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, 175 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
176 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | 176 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
177 virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN)); 177 virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN));
178 agp_generic_destroy_page(addr); 178 agp_generic_destroy_page(addr);
179} 179}
180 180
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
index e62a3c2c44a9..3a41672e4d66 100644
--- a/drivers/char/agp/amd-k7-agp.c
+++ b/drivers/char/agp/amd-k7-agp.c
@@ -43,7 +43,7 @@ static int amd_create_page_map(struct amd_page_map *page_map)
43 43
44 SetPageReserved(virt_to_page(page_map->real)); 44 SetPageReserved(virt_to_page(page_map->real));
45 global_cache_flush(); 45 global_cache_flush();
46 page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 46 page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
47 PAGE_SIZE); 47 PAGE_SIZE);
48 if (page_map->remapped == NULL) { 48 if (page_map->remapped == NULL) {
49 ClearPageReserved(virt_to_page(page_map->real)); 49 ClearPageReserved(virt_to_page(page_map->real));
@@ -154,7 +154,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
154 154
155 agp_bridge->gatt_table_real = (u32 *)page_dir.real; 155 agp_bridge->gatt_table_real = (u32 *)page_dir.real;
156 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; 156 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
157 agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); 157 agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
158 158
159 /* Get the address for the gart region. 159 /* Get the address for the gart region.
160 * This is a bus address even on the alpha, b/c its 160 * This is a bus address even on the alpha, b/c its
@@ -167,7 +167,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
167 167
168 /* Calculate the agp offset */ 168 /* Calculate the agp offset */
169 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { 169 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
170 writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1, 170 writel(virt_to_gart(amd_irongate_private.gatt_pages[i]->real) | 1,
171 page_dir.remapped+GET_PAGE_DIR_OFF(addr)); 171 page_dir.remapped+GET_PAGE_DIR_OFF(addr));
172 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ 172 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
173 } 173 }
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 399c042f68f0..1407945a5892 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -219,7 +219,7 @@ static struct aper_size_info_32 amd_8151_sizes[7] =
219 219
220static int amd_8151_configure(void) 220static int amd_8151_configure(void)
221{ 221{
222 unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real); 222 unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real);
223 223
224 /* Configure AGP regs in each x86-64 host bridge. */ 224 /* Configure AGP regs in each x86-64 host bridge. */
225 for_each_nb() { 225 for_each_nb() {
@@ -591,7 +591,7 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev)
591{ 591{
592 struct agp_bridge_data *bridge = pci_get_drvdata(pdev); 592 struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
593 593
594 release_mem_region(virt_to_phys(bridge->gatt_table_real), 594 release_mem_region(virt_to_gart(bridge->gatt_table_real),
595 amd64_aperture_sizes[bridge->aperture_size_idx].size); 595 amd64_aperture_sizes[bridge->aperture_size_idx].size);
596 agp_remove_bridge(bridge); 596 agp_remove_bridge(bridge);
597 agp_put_bridge(bridge); 597 agp_put_bridge(bridge);
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
index a65f8827c283..e572ced9100a 100644
--- a/drivers/char/agp/ati-agp.c
+++ b/drivers/char/agp/ati-agp.c
@@ -61,7 +61,7 @@ static int ati_create_page_map(ati_page_map *page_map)
61 61
62 SetPageReserved(virt_to_page(page_map->real)); 62 SetPageReserved(virt_to_page(page_map->real));
63 err = map_page_into_agp(virt_to_page(page_map->real)); 63 err = map_page_into_agp(virt_to_page(page_map->real));
64 page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 64 page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
65 PAGE_SIZE); 65 PAGE_SIZE);
66 if (page_map->remapped == NULL || err) { 66 if (page_map->remapped == NULL || err) {
67 ClearPageReserved(virt_to_page(page_map->real)); 67 ClearPageReserved(virt_to_page(page_map->real));
@@ -343,7 +343,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
343 343
344 agp_bridge->gatt_table_real = (u32 *)page_dir.real; 344 agp_bridge->gatt_table_real = (u32 *)page_dir.real;
345 agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped; 345 agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped;
346 agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real); 346 agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
347 347
348 /* Write out the size register */ 348 /* Write out the size register */
349 current_size = A_SIZE_LVL2(agp_bridge->current_size); 349 current_size = A_SIZE_LVL2(agp_bridge->current_size);
@@ -373,7 +373,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
373 373
374 /* Calculate the agp offset */ 374 /* Calculate the agp offset */
375 for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { 375 for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
376 writel(virt_to_bus(ati_generic_private.gatt_pages[i]->real) | 1, 376 writel(virt_to_gart(ati_generic_private.gatt_pages[i]->real) | 1,
377 page_dir.remapped+GET_PAGE_DIR_OFF(addr)); 377 page_dir.remapped+GET_PAGE_DIR_OFF(addr));
378 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ 378 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
379 } 379 }
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 2f3dfb63bdc6..4d4e602fdc7e 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -148,7 +148,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
148 return -ENOMEM; 148 return -ENOMEM;
149 } 149 }
150 150
151 bridge->scratch_page_real = virt_to_phys(addr); 151 bridge->scratch_page_real = virt_to_gart(addr);
152 bridge->scratch_page = 152 bridge->scratch_page =
153 bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0); 153 bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0);
154 } 154 }
@@ -189,7 +189,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
189err_out: 189err_out:
190 if (bridge->driver->needs_scratch_page) 190 if (bridge->driver->needs_scratch_page)
191 bridge->driver->agp_destroy_page( 191 bridge->driver->agp_destroy_page(
192 phys_to_virt(bridge->scratch_page_real)); 192 gart_to_virt(bridge->scratch_page_real));
193 if (got_gatt) 193 if (got_gatt)
194 bridge->driver->free_gatt_table(bridge); 194 bridge->driver->free_gatt_table(bridge);
195 if (got_keylist) { 195 if (got_keylist) {
@@ -214,7 +214,7 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
214 if (bridge->driver->agp_destroy_page && 214 if (bridge->driver->agp_destroy_page &&
215 bridge->driver->needs_scratch_page) 215 bridge->driver->needs_scratch_page)
216 bridge->driver->agp_destroy_page( 216 bridge->driver->agp_destroy_page(
217 phys_to_virt(bridge->scratch_page_real)); 217 gart_to_virt(bridge->scratch_page_real));
218} 218}
219 219
220/* When we remove the global variable agp_bridge from all drivers 220/* When we remove the global variable agp_bridge from all drivers
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c
index 1383c3165ea1..ac19fdcd21c1 100644
--- a/drivers/char/agp/efficeon-agp.c
+++ b/drivers/char/agp/efficeon-agp.c
@@ -219,7 +219,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
219 219
220 efficeon_private.l1_table[index] = page; 220 efficeon_private.l1_table[index] = page;
221 221
222 value = __pa(page) | pati | present | index; 222 value = virt_to_gart(page) | pati | present | index;
223 223
224 pci_write_config_dword(agp_bridge->dev, 224 pci_write_config_dword(agp_bridge->dev,
225 EFFICEON_ATTPAGE, value); 225 EFFICEON_ATTPAGE, value);
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index c321a924e38a..f0079e991bdc 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -153,7 +153,7 @@ void agp_free_memory(struct agp_memory *curr)
153 } 153 }
154 if (curr->page_count != 0) { 154 if (curr->page_count != 0) {
155 for (i = 0; i < curr->page_count; i++) { 155 for (i = 0; i < curr->page_count; i++) {
156 curr->bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[i])); 156 curr->bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[i]));
157 } 157 }
158 } 158 }
159 agp_free_key(curr->key); 159 agp_free_key(curr->key);
@@ -209,7 +209,7 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge,
209 agp_free_memory(new); 209 agp_free_memory(new);
210 return NULL; 210 return NULL;
211 } 211 }
212 new->memory[i] = virt_to_phys(addr); 212 new->memory[i] = virt_to_gart(addr);
213 new->page_count++; 213 new->page_count++;
214 } 214 }
215 new->bridge = bridge; 215 new->bridge = bridge;
@@ -295,19 +295,6 @@ int agp_num_entries(void)
295EXPORT_SYMBOL_GPL(agp_num_entries); 295EXPORT_SYMBOL_GPL(agp_num_entries);
296 296
297 297
298static int check_bridge_mode(struct pci_dev *dev)
299{
300 u32 agp3;
301 u8 cap_ptr;
302
303 cap_ptr = pci_find_capability(dev, PCI_CAP_ID_AGP);
304 pci_read_config_dword(dev, cap_ptr+AGPSTAT, &agp3);
305 if (agp3 & AGPSTAT_MODE_3_0)
306 return 1;
307 return 0;
308}
309
310
311/** 298/**
312 * agp_copy_info - copy bridge state information 299 * agp_copy_info - copy bridge state information
313 * 300 *
@@ -328,7 +315,7 @@ int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info)
328 info->version.minor = bridge->version->minor; 315 info->version.minor = bridge->version->minor;
329 info->chipset = SUPPORTED; 316 info->chipset = SUPPORTED;
330 info->device = bridge->dev; 317 info->device = bridge->dev;
331 if (check_bridge_mode(bridge->dev)) 318 if (bridge->mode & AGPSTAT_MODE_3_0)
332 info->mode = bridge->mode & ~AGP3_RESERVED_MASK; 319 info->mode = bridge->mode & ~AGP3_RESERVED_MASK;
333 else 320 else
334 info->mode = bridge->mode & ~AGP2_RESERVED_MASK; 321 info->mode = bridge->mode & ~AGP2_RESERVED_MASK;
@@ -661,7 +648,7 @@ u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode
661 bridge_agpstat &= ~AGPSTAT_FW; 648 bridge_agpstat &= ~AGPSTAT_FW;
662 649
663 /* Check to see if we are operating in 3.0 mode */ 650 /* Check to see if we are operating in 3.0 mode */
664 if (check_bridge_mode(agp_bridge->dev)) 651 if (agp_bridge->mode & AGPSTAT_MODE_3_0)
665 agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); 652 agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat);
666 else 653 else
667 agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); 654 agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat);
@@ -732,7 +719,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
732 719
733 /* Do AGP version specific frobbing. */ 720 /* Do AGP version specific frobbing. */
734 if (bridge->major_version >= 3) { 721 if (bridge->major_version >= 3) {
735 if (check_bridge_mode(bridge->dev)) { 722 if (bridge->mode & AGPSTAT_MODE_3_0) {
736 /* If we have 3.5, we can do the isoch stuff. */ 723 /* If we have 3.5, we can do the isoch stuff. */
737 if (bridge->minor_version >= 5) 724 if (bridge->minor_version >= 5)
738 agp_3_5_enable(bridge); 725 agp_3_5_enable(bridge);
@@ -806,8 +793,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
806 break; 793 break;
807 } 794 }
808 795
809 table = (char *) __get_free_pages(GFP_KERNEL, 796 table = alloc_gatt_pages(page_order);
810 page_order);
811 797
812 if (table == NULL) { 798 if (table == NULL) {
813 i++; 799 i++;
@@ -838,7 +824,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
838 size = ((struct aper_size_info_fixed *) temp)->size; 824 size = ((struct aper_size_info_fixed *) temp)->size;
839 page_order = ((struct aper_size_info_fixed *) temp)->page_order; 825 page_order = ((struct aper_size_info_fixed *) temp)->page_order;
840 num_entries = ((struct aper_size_info_fixed *) temp)->num_entries; 826 num_entries = ((struct aper_size_info_fixed *) temp)->num_entries;
841 table = (char *) __get_free_pages(GFP_KERNEL, page_order); 827 table = alloc_gatt_pages(page_order);
842 } 828 }
843 829
844 if (table == NULL) 830 if (table == NULL)
@@ -853,7 +839,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
853 agp_gatt_table = (void *)table; 839 agp_gatt_table = (void *)table;
854 840
855 bridge->driver->cache_flush(); 841 bridge->driver->cache_flush();
856 bridge->gatt_table = ioremap_nocache(virt_to_phys(table), 842 bridge->gatt_table = ioremap_nocache(virt_to_gart(table),
857 (PAGE_SIZE * (1 << page_order))); 843 (PAGE_SIZE * (1 << page_order)));
858 bridge->driver->cache_flush(); 844 bridge->driver->cache_flush();
859 845
@@ -861,11 +847,11 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
861 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) 847 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
862 ClearPageReserved(page); 848 ClearPageReserved(page);
863 849
864 free_pages((unsigned long) table, page_order); 850 free_gatt_pages(table, page_order);
865 851
866 return -ENOMEM; 852 return -ENOMEM;
867 } 853 }
868 bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real); 854 bridge->gatt_bus_addr = virt_to_gart(bridge->gatt_table_real);
869 855
870 /* AK: bogus, should encode addresses > 4GB */ 856 /* AK: bogus, should encode addresses > 4GB */
871 for (i = 0; i < num_entries; i++) { 857 for (i = 0; i < num_entries; i++) {
@@ -919,7 +905,7 @@ int agp_generic_free_gatt_table(struct agp_bridge_data *bridge)
919 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) 905 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
920 ClearPageReserved(page); 906 ClearPageReserved(page);
921 907
922 free_pages((unsigned long) bridge->gatt_table_real, page_order); 908 free_gatt_pages(bridge->gatt_table_real, page_order);
923 909
924 agp_gatt_table = NULL; 910 agp_gatt_table = NULL;
925 bridge->gatt_table = NULL; 911 bridge->gatt_table = NULL;
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index 6052bfa04c72..99762b6c19ae 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -110,7 +110,7 @@ static int __init hp_zx1_ioc_shared(void)
110 hp->gart_size = HP_ZX1_GART_SIZE; 110 hp->gart_size = HP_ZX1_GART_SIZE;
111 hp->gatt_entries = hp->gart_size / hp->io_page_size; 111 hp->gatt_entries = hp->gart_size / hp->io_page_size;
112 112
113 hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); 113 hp->io_pdir = gart_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
114 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; 114 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
115 115
116 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { 116 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
@@ -248,7 +248,7 @@ hp_zx1_configure (void)
248 agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); 248 agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS);
249 249
250 if (hp->io_pdir_owner) { 250 if (hp->io_pdir_owner) {
251 writel(virt_to_phys(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE); 251 writel(virt_to_gart(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE);
252 readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); 252 readl(hp->ioc_regs+HP_ZX1_PDIR_BASE);
253 writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); 253 writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG);
254 readl(hp->ioc_regs+HP_ZX1_TCNFG); 254 readl(hp->ioc_regs+HP_ZX1_TCNFG);
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c
index adbea896c0d2..94943298c03e 100644
--- a/drivers/char/agp/i460-agp.c
+++ b/drivers/char/agp/i460-agp.c
@@ -372,7 +372,7 @@ static int i460_alloc_large_page (struct lp_desc *lp)
372 } 372 }
373 memset(lp->alloced_map, 0, map_size); 373 memset(lp->alloced_map, 0, map_size);
374 374
375 lp->paddr = virt_to_phys(lpage); 375 lp->paddr = virt_to_gart(lpage);
376 lp->refcount = 0; 376 lp->refcount = 0;
377 atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); 377 atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
378 return 0; 378 return 0;
@@ -383,7 +383,7 @@ static void i460_free_large_page (struct lp_desc *lp)
383 kfree(lp->alloced_map); 383 kfree(lp->alloced_map);
384 lp->alloced_map = NULL; 384 lp->alloced_map = NULL;
385 385
386 free_pages((unsigned long) phys_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT); 386 free_pages((unsigned long) gart_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
387 atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); 387 atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
388} 388}
389 389
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 8c7d727432bb..51266d6b4d78 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -286,7 +286,7 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type)
286 if (new == NULL) 286 if (new == NULL)
287 return NULL; 287 return NULL;
288 288
289 new->memory[0] = virt_to_phys(addr); 289 new->memory[0] = virt_to_gart(addr);
290 if (pg_count == 4) { 290 if (pg_count == 4) {
291 /* kludge to get 4 physical pages for ARGB cursor */ 291 /* kludge to get 4 physical pages for ARGB cursor */
292 new->memory[1] = new->memory[0] + PAGE_SIZE; 292 new->memory[1] = new->memory[0] + PAGE_SIZE;
@@ -329,10 +329,10 @@ static void intel_i810_free_by_type(struct agp_memory *curr)
329 agp_free_key(curr->key); 329 agp_free_key(curr->key);
330 if(curr->type == AGP_PHYS_MEMORY) { 330 if(curr->type == AGP_PHYS_MEMORY) {
331 if (curr->page_count == 4) 331 if (curr->page_count == 4)
332 i8xx_destroy_pages(phys_to_virt(curr->memory[0])); 332 i8xx_destroy_pages(gart_to_virt(curr->memory[0]));
333 else 333 else
334 agp_bridge->driver->agp_destroy_page( 334 agp_bridge->driver->agp_destroy_page(
335 phys_to_virt(curr->memory[0])); 335 gart_to_virt(curr->memory[0]));
336 vfree(curr->memory); 336 vfree(curr->memory);
337 } 337 }
338 kfree(curr); 338 kfree(curr);
@@ -418,7 +418,8 @@ static void intel_i830_init_gtt_entries(void)
418 case I915_GMCH_GMS_STOLEN_48M: 418 case I915_GMCH_GMS_STOLEN_48M:
419 /* Check it's really I915G */ 419 /* Check it's really I915G */
420 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 420 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
421 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) 421 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
422 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB)
422 gtt_entries = MB(48) - KB(size); 423 gtt_entries = MB(48) - KB(size);
423 else 424 else
424 gtt_entries = 0; 425 gtt_entries = 0;
@@ -426,7 +427,8 @@ static void intel_i830_init_gtt_entries(void)
426 case I915_GMCH_GMS_STOLEN_64M: 427 case I915_GMCH_GMS_STOLEN_64M:
427 /* Check it's really I915G */ 428 /* Check it's really I915G */
428 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 429 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
429 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) 430 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
431 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB)
430 gtt_entries = MB(64) - KB(size); 432 gtt_entries = MB(64) - KB(size);
431 else 433 else
432 gtt_entries = 0; 434 gtt_entries = 0;
@@ -1662,6 +1664,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1662 } 1664 }
1663 name = "915GM"; 1665 name = "915GM";
1664 break; 1666 break;
1667 case PCI_DEVICE_ID_INTEL_82945G_HB:
1668 if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) {
1669 bridge->driver = &intel_915_driver;
1670 } else {
1671 bridge->driver = &intel_845_driver;
1672 }
1673 name = "945G";
1674 break;
1665 case PCI_DEVICE_ID_INTEL_7505_0: 1675 case PCI_DEVICE_ID_INTEL_7505_0:
1666 bridge->driver = &intel_7505_driver; 1676 bridge->driver = &intel_7505_driver;
1667 name = "E7505"; 1677 name = "E7505";
@@ -1801,6 +1811,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
1801 ID(PCI_DEVICE_ID_INTEL_7205_0), 1811 ID(PCI_DEVICE_ID_INTEL_7205_0),
1802 ID(PCI_DEVICE_ID_INTEL_82915G_HB), 1812 ID(PCI_DEVICE_ID_INTEL_82915G_HB),
1803 ID(PCI_DEVICE_ID_INTEL_82915GM_HB), 1813 ID(PCI_DEVICE_ID_INTEL_82915GM_HB),
1814 ID(PCI_DEVICE_ID_INTEL_82945G_HB),
1804 { } 1815 { }
1805}; 1816};
1806 1817
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index 4b3eda267976..d3aa159c9dec 100644
--- a/drivers/char/agp/sgi-agp.c
+++ b/drivers/char/agp/sgi-agp.c
@@ -133,11 +133,14 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
133 off_t j; 133 off_t j;
134 void *temp; 134 void *temp;
135 struct agp_bridge_data *bridge; 135 struct agp_bridge_data *bridge;
136 u64 *table;
136 137
137 bridge = mem->bridge; 138 bridge = mem->bridge;
138 if (!bridge) 139 if (!bridge)
139 return -EINVAL; 140 return -EINVAL;
140 141
142 table = (u64 *)bridge->gatt_table;
143
141 temp = bridge->current_size; 144 temp = bridge->current_size;
142 145
143 switch (bridge->driver->size_type) { 146 switch (bridge->driver->size_type) {
@@ -175,7 +178,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
175 j = pg_start; 178 j = pg_start;
176 179
177 while (j < (pg_start + mem->page_count)) { 180 while (j < (pg_start + mem->page_count)) {
178 if (*(bridge->gatt_table + j)) 181 if (table[j])
179 return -EBUSY; 182 return -EBUSY;
180 j++; 183 j++;
181 } 184 }
@@ -186,7 +189,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
186 } 189 }
187 190
188 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { 191 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
189 *(bridge->gatt_table + j) = 192 table[j] =
190 bridge->driver->mask_memory(bridge, mem->memory[i], 193 bridge->driver->mask_memory(bridge, mem->memory[i],
191 mem->type); 194 mem->type);
192 } 195 }
@@ -200,6 +203,7 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
200{ 203{
201 size_t i; 204 size_t i;
202 struct agp_bridge_data *bridge; 205 struct agp_bridge_data *bridge;
206 u64 *table;
203 207
204 bridge = mem->bridge; 208 bridge = mem->bridge;
205 if (!bridge) 209 if (!bridge)
@@ -209,8 +213,10 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
209 return -EINVAL; 213 return -EINVAL;
210 } 214 }
211 215
216 table = (u64 *)bridge->gatt_table;
217
212 for (i = pg_start; i < (mem->page_count + pg_start); i++) { 218 for (i = pg_start; i < (mem->page_count + pg_start); i++) {
213 *(bridge->gatt_table + i) = 0; 219 table[i] = 0;
214 } 220 }
215 221
216 bridge->driver->tlb_flush(mem); 222 bridge->driver->tlb_flush(mem);
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 10c23302dd84..a9fb12c20eb7 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -51,7 +51,7 @@ static int serverworks_create_page_map(struct serverworks_page_map *page_map)
51 } 51 }
52 SetPageReserved(virt_to_page(page_map->real)); 52 SetPageReserved(virt_to_page(page_map->real));
53 global_cache_flush(); 53 global_cache_flush();
54 page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 54 page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
55 PAGE_SIZE); 55 PAGE_SIZE);
56 if (page_map->remapped == NULL) { 56 if (page_map->remapped == NULL) {
57 ClearPageReserved(virt_to_page(page_map->real)); 57 ClearPageReserved(virt_to_page(page_map->real));
@@ -162,7 +162,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
162 /* Create a fake scratch directory */ 162 /* Create a fake scratch directory */
163 for(i = 0; i < 1024; i++) { 163 for(i = 0; i < 1024; i++) {
164 writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); 164 writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);
165 writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); 165 writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
166 } 166 }
167 167
168 retval = serverworks_create_gatt_pages(value->num_entries / 1024); 168 retval = serverworks_create_gatt_pages(value->num_entries / 1024);
@@ -174,7 +174,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
174 174
175 agp_bridge->gatt_table_real = (u32 *)page_dir.real; 175 agp_bridge->gatt_table_real = (u32 *)page_dir.real;
176 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; 176 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
177 agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); 177 agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
178 178
179 /* Get the address for the gart region. 179 /* Get the address for the gart region.
180 * This is a bus address even on the alpha, b/c its 180 * This is a bus address even on the alpha, b/c its
@@ -187,7 +187,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
187 /* Calculate the agp offset */ 187 /* Calculate the agp offset */
188 188
189 for(i = 0; i < value->num_entries / 1024; i++) 189 for(i = 0; i < value->num_entries / 1024; i++)
190 writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); 190 writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
191 191
192 return 0; 192 return 0;
193} 193}
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index a673971f2a90..c8255312b8c1 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -407,7 +407,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
407 407
408 bridge->gatt_table_real = (u32 *) table; 408 bridge->gatt_table_real = (u32 *) table;
409 bridge->gatt_table = (u32 *)table; 409 bridge->gatt_table = (u32 *)table;
410 bridge->gatt_bus_addr = virt_to_phys(table); 410 bridge->gatt_bus_addr = virt_to_gart(table);
411 411
412 for (i = 0; i < num_entries; i++) 412 for (i = 0; i < num_entries; i++)
413 bridge->gatt_table[i] = 0; 413 bridge->gatt_table[i] = 0;
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index 54a2914e3a32..11c6950158b3 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -220,5 +220,6 @@
220 {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 220 {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
221 {0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 221 {0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
222 {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 222 {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
223 {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
223 {0, 0, 0} 224 {0, 0, 0}
224 225
diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c
index 5b18bee6492e..cd25f28e26a3 100644
--- a/drivers/char/drm/radeon_irq.c
+++ b/drivers/char/drm/radeon_irq.c
@@ -123,11 +123,6 @@ static int radeon_wait_irq(drm_device_t *dev, int swi_nr)
123 123
124 dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; 124 dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
125 125
126 /* This is a hack to work around mysterious freezes on certain
127 * systems:
128 */
129 radeon_acknowledge_irqs( dev_priv );
130
131 DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ, 126 DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ,
132 RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr ); 127 RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr );
133 128
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 7a245068e3e5..f022f0944434 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -1995,9 +1995,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
1995 unsigned char ch, gdl; 1995 unsigned char ch, gdl;
1996 int ignored = 0; 1996 int ignored = 0;
1997 int cnt = 0; 1997 int cnt = 0;
1998 unsigned char *cp;
1999 char *fp;
2000 int count;
2001 int recv_room; 1998 int recv_room;
2002 int max = 256; 1999 int max = 256;
2003 unsigned long flags; 2000 unsigned long flags;
@@ -2011,10 +2008,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
2011 //return; 2008 //return;
2012 } 2009 }
2013 2010
2014 cp = tty->flip.char_buf;
2015 fp = tty->flip.flag_buf;
2016 count = 0;
2017
2018 // following add by Victor Yu. 09-02-2002 2011 // following add by Victor Yu. 09-02-2002
2019 if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) { 2012 if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) {
2020 2013
@@ -2041,12 +2034,10 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
2041 } 2034 }
2042 while (gdl--) { 2035 while (gdl--) {
2043 ch = inb(info->base + UART_RX); 2036 ch = inb(info->base + UART_RX);
2044 count++; 2037 tty_insert_flip_char(tty, ch, 0);
2045 *cp++ = ch;
2046 *fp++ = 0;
2047 cnt++; 2038 cnt++;
2048 /* 2039 /*
2049 if((count>=HI_WATER) && (info->stop_rx==0)){ 2040 if((cnt>=HI_WATER) && (info->stop_rx==0)){
2050 mxser_stoprx(tty); 2041 mxser_stoprx(tty);
2051 info->stop_rx=1; 2042 info->stop_rx=1;
2052 break; 2043 break;
@@ -2061,7 +2052,7 @@ intr_old:
2061 if (max-- < 0) 2052 if (max-- < 0)
2062 break; 2053 break;
2063 /* 2054 /*
2064 if((count>=HI_WATER) && (info->stop_rx==0)){ 2055 if((cnt>=HI_WATER) && (info->stop_rx==0)){
2065 mxser_stoprx(tty); 2056 mxser_stoprx(tty);
2066 info->stop_rx=1; 2057 info->stop_rx=1;
2067 break; 2058 break;
@@ -2078,36 +2069,33 @@ intr_old:
2078 if (++ignored > 100) 2069 if (++ignored > 100)
2079 break; 2070 break;
2080 } else { 2071 } else {
2081 count++; 2072 char flag = 0;
2082 if (*status & UART_LSR_SPECIAL) { 2073 if (*status & UART_LSR_SPECIAL) {
2083 if (*status & UART_LSR_BI) { 2074 if (*status & UART_LSR_BI) {
2084 *fp++ = TTY_BREAK; 2075 flag = TTY_BREAK;
2085/* added by casper 1/11/2000 */ 2076/* added by casper 1/11/2000 */
2086 info->icount.brk++; 2077 info->icount.brk++;
2087
2088/* */ 2078/* */
2089 if (info->flags & ASYNC_SAK) 2079 if (info->flags & ASYNC_SAK)
2090 do_SAK(tty); 2080 do_SAK(tty);
2091 } else if (*status & UART_LSR_PE) { 2081 } else if (*status & UART_LSR_PE) {
2092 *fp++ = TTY_PARITY; 2082 flag = TTY_PARITY;
2093/* added by casper 1/11/2000 */ 2083/* added by casper 1/11/2000 */
2094 info->icount.parity++; 2084 info->icount.parity++;
2095/* */ 2085/* */
2096 } else if (*status & UART_LSR_FE) { 2086 } else if (*status & UART_LSR_FE) {
2097 *fp++ = TTY_FRAME; 2087 flag = TTY_FRAME;
2098/* added by casper 1/11/2000 */ 2088/* added by casper 1/11/2000 */
2099 info->icount.frame++; 2089 info->icount.frame++;
2100/* */ 2090/* */
2101 } else if (*status & UART_LSR_OE) { 2091 } else if (*status & UART_LSR_OE) {
2102 *fp++ = TTY_OVERRUN; 2092 flag = TTY_OVERRUN;
2103/* added by casper 1/11/2000 */ 2093/* added by casper 1/11/2000 */
2104 info->icount.overrun++; 2094 info->icount.overrun++;
2105/* */ 2095/* */
2106 } else 2096 }
2107 *fp++ = 0; 2097 }
2108 } else 2098 tty_insert_flip_char(tty, ch, flag);
2109 *fp++ = 0;
2110 *cp++ = ch;
2111 cnt++; 2099 cnt++;
2112 if (cnt >= recv_room) { 2100 if (cnt >= recv_room) {
2113 if (!info->ldisc_stop_rx) { 2101 if (!info->ldisc_stop_rx) {
@@ -2132,13 +2120,13 @@ intr_old:
2132 // above add by Victor Yu. 09-02-2002 2120 // above add by Victor Yu. 09-02-2002
2133 } while (*status & UART_LSR_DR); 2121 } while (*status & UART_LSR_DR);
2134 2122
2135 end_intr: // add by Victor Yu. 09-02-2002 2123end_intr: // add by Victor Yu. 09-02-2002
2136 2124
2137 mxvar_log.rxcnt[info->port] += cnt; 2125 mxvar_log.rxcnt[info->port] += cnt;
2138 info->mon_data.rxcnt += cnt; 2126 info->mon_data.rxcnt += cnt;
2139 info->mon_data.up_rxcnt += cnt; 2127 info->mon_data.up_rxcnt += cnt;
2140 spin_unlock_irqrestore(&info->slock, flags); 2128 spin_unlock_irqrestore(&info->slock, flags);
2141 2129
2142 tty_flip_buffer_push(tty); 2130 tty_flip_buffer_push(tty);
2143} 2131}
2144 2132
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 00c7b958361a..ab82d6addd7f 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -745,7 +745,8 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
745 list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids); 745 list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids);
746 746
747 /* Register our host with the SCSI stack. */ 747 /* Register our host with the SCSI stack. */
748 scsi_host = scsi_host_alloc(&scsi_driver_template, 0); 748 scsi_host = scsi_host_alloc(&scsi_driver_template,
749 sizeof (unsigned long));
749 if (!scsi_host) { 750 if (!scsi_host) {
750 SBP2_ERR("failed to register scsi host"); 751 SBP2_ERR("failed to register scsi host");
751 goto failed_alloc; 752 goto failed_alloc;
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index af0446c6de82..48fdf1e517cf 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -54,7 +54,7 @@ static int atkbd_softraw = 1;
54module_param_named(softraw, atkbd_softraw, bool, 0); 54module_param_named(softraw, atkbd_softraw, bool, 0);
55MODULE_PARM_DESC(softraw, "Use software generated rawmode"); 55MODULE_PARM_DESC(softraw, "Use software generated rawmode");
56 56
57static int atkbd_scroll = 1; 57static int atkbd_scroll = 0;
58module_param_named(scroll, atkbd_scroll, bool, 0); 58module_param_named(scroll, atkbd_scroll, bool, 0);
59MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards"); 59MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards");
60 60
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 42a9f7f6f8cb..7bf4be733e9a 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -352,7 +352,7 @@ static int alps_reconnect(struct psmouse *psmouse)
352 if (alps_get_status(psmouse, param)) 352 if (alps_get_status(psmouse, param))
353 return -1; 353 return -1;
354 354
355 if (param[0] & 0x04) 355 if (!(param[0] & 0x04))
356 alps_tap_mode(psmouse, 1); 356 alps_tap_mode(psmouse, 1);
357 357
358 if (alps_absolute_mode(psmouse)) { 358 if (alps_absolute_mode(psmouse)) {
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index bb9f4044c74d..b941ee220997 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2593,6 +2593,9 @@ powerbook_sleep_Core99(void)
2593 /* Restore VIA */ 2593 /* Restore VIA */
2594 restore_via_state(); 2594 restore_via_state();
2595 2595
2596 /* tweak LPJ before cpufreq is there */
2597 loops_per_jiffy *= 2;
2598
2596 /* Restore video */ 2599 /* Restore video */
2597 pmac_call_early_video_resume(); 2600 pmac_call_early_video_resume();
2598 2601
@@ -2613,6 +2616,9 @@ powerbook_sleep_Core99(void)
2613 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); 2616 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
2614 pmu_wait_complete(&req); 2617 pmu_wait_complete(&req);
2615 2618
2619 /* Restore LPJ, cpufreq will adjust the cpu frequency */
2620 loops_per_jiffy /= 2;
2621
2616 pmac_wakeup_devices(); 2622 pmac_wakeup_devices();
2617 2623
2618 return 0; 2624 return 0;
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 1e97b3c12bd5..0c1b8520ef86 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -985,6 +985,9 @@ static int do_end_io(struct multipath *m, struct bio *bio,
985 if (!error) 985 if (!error)
986 return 0; /* I/O complete */ 986 return 0; /* I/O complete */
987 987
988 if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
989 return error;
990
988 spin_lock(&m->lock); 991 spin_lock(&m->lock);
989 if (!m->nr_valid_paths) { 992 if (!m->nr_valid_paths) {
990 if (!m->queue_if_no_path || m->suspended) { 993 if (!m->queue_if_no_path || m->suspended) {
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 7b74c87b569e..4830b7759061 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -573,6 +573,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
573static void i2o_block_event(struct i2o_event *evt) 573static void i2o_block_event(struct i2o_event *evt)
574{ 574{
575 osm_info("block-osm: event received\n"); 575 osm_info("block-osm: event received\n");
576 kfree(evt);
576}; 577};
577 578
578/* 579/*
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 1c563f905a59..a7f15d9f13e5 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -374,29 +374,6 @@ static inline void do_kiss_params(struct baycom_state *bc,
374} 374}
375 375
376/* --------------------------------------------------------------------- */ 376/* --------------------------------------------------------------------- */
377/*
378 * high performance HDLC encoder
379 * yes, it's ugly, but generates pretty good code
380 */
381
382#define ENCODEITERA(j) \
383({ \
384 if (!(notbitstream & (0x1f0 << j))) \
385 goto stuff##j; \
386 encodeend##j: ; \
387})
388
389#define ENCODEITERB(j) \
390({ \
391 stuff##j: \
392 bitstream &= ~(0x100 << j); \
393 bitbuf = (bitbuf & (((2 << j) << numbit) - 1)) | \
394 ((bitbuf & ~(((2 << j) << numbit) - 1)) << 1); \
395 numbit++; \
396 notbitstream = ~bitstream; \
397 goto encodeend##j; \
398})
399
400 377
401static void encode_hdlc(struct baycom_state *bc) 378static void encode_hdlc(struct baycom_state *bc)
402{ 379{
@@ -405,6 +382,7 @@ static void encode_hdlc(struct baycom_state *bc)
405 int pkt_len; 382 int pkt_len;
406 unsigned bitstream, notbitstream, bitbuf, numbit, crc; 383 unsigned bitstream, notbitstream, bitbuf, numbit, crc;
407 unsigned char crcarr[2]; 384 unsigned char crcarr[2];
385 int j;
408 386
409 if (bc->hdlctx.bufcnt > 0) 387 if (bc->hdlctx.bufcnt > 0)
410 return; 388 return;
@@ -429,24 +407,14 @@ static void encode_hdlc(struct baycom_state *bc)
429 pkt_len--; 407 pkt_len--;
430 if (!pkt_len) 408 if (!pkt_len)
431 bp = crcarr; 409 bp = crcarr;
432 ENCODEITERA(0); 410 for (j = 0; j < 8; j++)
433 ENCODEITERA(1); 411 if (unlikely(!(notbitstream & (0x1f0 << j)))) {
434 ENCODEITERA(2); 412 bitstream &= ~(0x100 << j);
435 ENCODEITERA(3); 413 bitbuf = (bitbuf & (((2 << j) << numbit) - 1)) |
436 ENCODEITERA(4); 414 ((bitbuf & ~(((2 << j) << numbit) - 1)) << 1);
437 ENCODEITERA(5); 415 numbit++;
438 ENCODEITERA(6); 416 notbitstream = ~bitstream;
439 ENCODEITERA(7); 417 }
440 goto enditer;
441 ENCODEITERB(0);
442 ENCODEITERB(1);
443 ENCODEITERB(2);
444 ENCODEITERB(3);
445 ENCODEITERB(4);
446 ENCODEITERB(5);
447 ENCODEITERB(6);
448 ENCODEITERB(7);
449 enditer:
450 numbit += 8; 418 numbit += 8;
451 while (numbit >= 8) { 419 while (numbit >= 8) {
452 *wp++ = bitbuf; 420 *wp++ = bitbuf;
@@ -610,37 +578,6 @@ static void do_rxpacket(struct net_device *dev)
610 bc->stats.rx_packets++; 578 bc->stats.rx_packets++;
611} 579}
612 580
613#define DECODEITERA(j) \
614({ \
615 if (!(notbitstream & (0x0fc << j))) /* flag or abort */ \
616 goto flgabrt##j; \
617 if ((bitstream & (0x1f8 << j)) == (0xf8 << j)) /* stuffed bit */ \
618 goto stuff##j; \
619 enditer##j: ; \
620})
621
622#define DECODEITERB(j) \
623({ \
624 flgabrt##j: \
625 if (!(notbitstream & (0x1fc << j))) { /* abort received */ \
626 state = 0; \
627 goto enditer##j; \
628 } \
629 if ((bitstream & (0x1fe << j)) != (0x0fc << j)) /* flag received */ \
630 goto enditer##j; \
631 if (state) \
632 do_rxpacket(dev); \
633 bc->hdlcrx.bufcnt = 0; \
634 bc->hdlcrx.bufptr = bc->hdlcrx.buf; \
635 state = 1; \
636 numbits = 7-j; \
637 goto enditer##j; \
638 stuff##j: \
639 numbits--; \
640 bitbuf = (bitbuf & ((~0xff) << j)) | ((bitbuf & ~((~0xff) << j)) << 1); \
641 goto enditer##j; \
642})
643
644static int receive(struct net_device *dev, int cnt) 581static int receive(struct net_device *dev, int cnt)
645{ 582{
646 struct baycom_state *bc = netdev_priv(dev); 583 struct baycom_state *bc = netdev_priv(dev);
@@ -649,6 +586,7 @@ static int receive(struct net_device *dev, int cnt)
649 unsigned char tmp[128]; 586 unsigned char tmp[128];
650 unsigned char *cp; 587 unsigned char *cp;
651 int cnt2, ret = 0; 588 int cnt2, ret = 0;
589 int j;
652 590
653 numbits = bc->hdlcrx.numbits; 591 numbits = bc->hdlcrx.numbits;
654 state = bc->hdlcrx.state; 592 state = bc->hdlcrx.state;
@@ -669,24 +607,32 @@ static int receive(struct net_device *dev, int cnt)
669 bitbuf |= (*cp) << 8; 607 bitbuf |= (*cp) << 8;
670 numbits += 8; 608 numbits += 8;
671 notbitstream = ~bitstream; 609 notbitstream = ~bitstream;
672 DECODEITERA(0); 610 for (j = 0; j < 8; j++) {
673 DECODEITERA(1); 611
674 DECODEITERA(2); 612 /* flag or abort */
675 DECODEITERA(3); 613 if (unlikely(!(notbitstream & (0x0fc << j)))) {
676 DECODEITERA(4); 614
677 DECODEITERA(5); 615 /* abort received */
678 DECODEITERA(6); 616 if (!(notbitstream & (0x1fc << j)))
679 DECODEITERA(7); 617 state = 0;
680 goto enddec; 618
681 DECODEITERB(0); 619 /* not flag received */
682 DECODEITERB(1); 620 else if (!(bitstream & (0x1fe << j)) != (0x0fc << j)) {
683 DECODEITERB(2); 621 if (state)
684 DECODEITERB(3); 622 do_rxpacket(dev);
685 DECODEITERB(4); 623 bc->hdlcrx.bufcnt = 0;
686 DECODEITERB(5); 624 bc->hdlcrx.bufptr = bc->hdlcrx.buf;
687 DECODEITERB(6); 625 state = 1;
688 DECODEITERB(7); 626 numbits = 7-j;
689 enddec: 627 }
628 }
629
630 /* stuffed bit */
631 else if (unlikely((bitstream & (0x1f8 << j)) == (0xf8 << j))) {
632 numbits--;
633 bitbuf = (bitbuf & ((~0xff) << j)) | ((bitbuf & ~((~0xff) << j)) << 1);
634 }
635 }
690 while (state && numbits >= 8) { 636 while (state && numbits >= 8) {
691 if (bc->hdlcrx.bufcnt >= TXBUFFER_SIZE) { 637 if (bc->hdlcrx.bufcnt >= TXBUFFER_SIZE) {
692 state = 0; 638 state = 0;
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index 1c553d7efdd9..ca5914091d3a 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -389,7 +389,7 @@ config VIA_FIR
389 help 389 help
390 Say Y here if you want to build support for the VIA VT8231 390 Say Y here if you want to build support for the VIA VT8231
391 and VIA VT1211 IrDA controllers, found on the motherboards using 391 and VIA VT1211 IrDA controllers, found on the motherboards using
392 those those VIA chipsets. To use this controller, you will need 392 those VIA chipsets. To use this controller, you will need
393 to plug a specific 5 pins FIR IrDA dongle in the specific 393 to plug a specific 5 pins FIR IrDA dongle in the specific
394 motherboard connector. The driver provides support for SIR, MIR 394 motherboard connector. The driver provides support for SIR, MIR
395 and FIR (4Mbps) speeds. 395 and FIR (4Mbps) speeds.
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 13ed8dc1e91d..55af32e9bf08 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -802,13 +802,14 @@ static void veth_tx_timeout(struct net_device *dev)
802 802
803 spin_lock_irqsave(&port->pending_gate, flags); 803 spin_lock_irqsave(&port->pending_gate, flags);
804 804
805 if (!port->pending_lpmask) {
806 spin_unlock_irqrestore(&port->pending_gate, flags);
807 return;
808 }
809
805 printk(KERN_WARNING "%s: Tx timeout! Resetting lp connections: %08x\n", 810 printk(KERN_WARNING "%s: Tx timeout! Resetting lp connections: %08x\n",
806 dev->name, port->pending_lpmask); 811 dev->name, port->pending_lpmask);
807 812
808 /* If we've timed out the queue must be stopped, which should
809 * only ever happen when there is a pending packet. */
810 WARN_ON(! port->pending_lpmask);
811
812 for (i = 0; i < HVMAXARCHITECTEDLPS; i++) { 813 for (i = 0; i < HVMAXARCHITECTEDLPS; i++) {
813 struct veth_lpar_connection *cnx = veth_cnx[i]; 814 struct veth_lpar_connection *cnx = veth_cnx[i];
814 815
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 41e517114807..c6e8b25f9685 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -1274,6 +1274,9 @@ static int el3_close(struct net_device *dev)
1274 spin_lock_irqsave(&lp->window_lock, flags); 1274 spin_lock_irqsave(&lp->window_lock, flags);
1275 update_stats(dev); 1275 update_stats(dev);
1276 spin_unlock_irqrestore(&lp->window_lock, flags); 1276 spin_unlock_irqrestore(&lp->window_lock, flags);
1277
1278 /* force interrupts off */
1279 outw(SetIntrEnb | 0x0000, ioaddr + EL3_CMD);
1277 } 1280 }
1278 1281
1279 link->open--; 1282 link->open--;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c59507f8a76b..d6d0e43dab65 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -415,7 +415,7 @@ struct rtl8169_private {
415 struct work_struct task; 415 struct work_struct task;
416}; 416};
417 417
418MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@oss.sgi.com>"); 418MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
419MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); 419MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
420module_param_array(media, int, &num_media, 0); 420module_param_array(media, int, &num_media, 0);
421module_param(rx_copybreak, int, 0); 421module_param(rx_copybreak, int, 0);
@@ -1585,8 +1585,8 @@ rtl8169_hw_start(struct net_device *dev)
1585 RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); 1585 RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
1586 RTL_W8(EarlyTxThres, EarlyTxThld); 1586 RTL_W8(EarlyTxThres, EarlyTxThld);
1587 1587
1588 /* For gigabit rtl8169, MTU + header + CRC + VLAN */ 1588 /* Low hurts. Let's disable the filtering. */
1589 RTL_W16(RxMaxSize, tp->rx_buf_sz); 1589 RTL_W16(RxMaxSize, 16383);
1590 1590
1591 /* Set Rx Config register */ 1591 /* Set Rx Config register */
1592 i = rtl8169_rx_config | 1592 i = rtl8169_rx_config |
@@ -2127,6 +2127,11 @@ rtl8169_tx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
2127 } 2127 }
2128} 2128}
2129 2129
2130static inline int rtl8169_fragmented_frame(u32 status)
2131{
2132 return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag);
2133}
2134
2130static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc) 2135static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc)
2131{ 2136{
2132 u32 opts1 = le32_to_cpu(desc->opts1); 2137 u32 opts1 = le32_to_cpu(desc->opts1);
@@ -2177,27 +2182,41 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
2177 2182
2178 while (rx_left > 0) { 2183 while (rx_left > 0) {
2179 unsigned int entry = cur_rx % NUM_RX_DESC; 2184 unsigned int entry = cur_rx % NUM_RX_DESC;
2185 struct RxDesc *desc = tp->RxDescArray + entry;
2180 u32 status; 2186 u32 status;
2181 2187
2182 rmb(); 2188 rmb();
2183 status = le32_to_cpu(tp->RxDescArray[entry].opts1); 2189 status = le32_to_cpu(desc->opts1);
2184 2190
2185 if (status & DescOwn) 2191 if (status & DescOwn)
2186 break; 2192 break;
2187 if (status & RxRES) { 2193 if (status & RxRES) {
2188 printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); 2194 printk(KERN_INFO "%s: Rx ERROR. status = %08x\n",
2195 dev->name, status);
2189 tp->stats.rx_errors++; 2196 tp->stats.rx_errors++;
2190 if (status & (RxRWT | RxRUNT)) 2197 if (status & (RxRWT | RxRUNT))
2191 tp->stats.rx_length_errors++; 2198 tp->stats.rx_length_errors++;
2192 if (status & RxCRC) 2199 if (status & RxCRC)
2193 tp->stats.rx_crc_errors++; 2200 tp->stats.rx_crc_errors++;
2201 rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
2194 } else { 2202 } else {
2195 struct RxDesc *desc = tp->RxDescArray + entry;
2196 struct sk_buff *skb = tp->Rx_skbuff[entry]; 2203 struct sk_buff *skb = tp->Rx_skbuff[entry];
2197 int pkt_size = (status & 0x00001FFF) - 4; 2204 int pkt_size = (status & 0x00001FFF) - 4;
2198 void (*pci_action)(struct pci_dev *, dma_addr_t, 2205 void (*pci_action)(struct pci_dev *, dma_addr_t,
2199 size_t, int) = pci_dma_sync_single_for_device; 2206 size_t, int) = pci_dma_sync_single_for_device;
2200 2207
2208 /*
2209 * The driver does not support incoming fragmented
2210 * frames. They are seen as a symptom of over-mtu
2211 * sized frames.
2212 */
2213 if (unlikely(rtl8169_fragmented_frame(status))) {
2214 tp->stats.rx_dropped++;
2215 tp->stats.rx_length_errors++;
2216 rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
2217 goto move_on;
2218 }
2219
2201 rtl8169_rx_csum(skb, desc); 2220 rtl8169_rx_csum(skb, desc);
2202 2221
2203 pci_dma_sync_single_for_cpu(tp->pci_dev, 2222 pci_dma_sync_single_for_cpu(tp->pci_dev,
@@ -2224,7 +2243,7 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
2224 tp->stats.rx_bytes += pkt_size; 2243 tp->stats.rx_bytes += pkt_size;
2225 tp->stats.rx_packets++; 2244 tp->stats.rx_packets++;
2226 } 2245 }
2227 2246move_on:
2228 cur_rx++; 2247 cur_rx++;
2229 rx_left--; 2248 rx_left--;
2230 } 2249 }
diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
index e68cf5fb4920..20edeb345792 100644
--- a/drivers/net/shaper.c
+++ b/drivers/net/shaper.c
@@ -100,35 +100,8 @@ static int sh_debug; /* Debug flag */
100 100
101#define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n" 101#define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n"
102 102
103/*
104 * Locking
105 */
106
107static int shaper_lock(struct shaper *sh)
108{
109 /*
110 * Lock in an interrupt must fail
111 */
112 while (test_and_set_bit(0, &sh->locked))
113 {
114 if (!in_interrupt())
115 sleep_on(&sh->wait_queue);
116 else
117 return 0;
118
119 }
120 return 1;
121}
122
123static void shaper_kick(struct shaper *sh); 103static void shaper_kick(struct shaper *sh);
124 104
125static void shaper_unlock(struct shaper *sh)
126{
127 clear_bit(0, &sh->locked);
128 wake_up(&sh->wait_queue);
129 shaper_kick(sh);
130}
131
132/* 105/*
133 * Compute clocks on a buffer 106 * Compute clocks on a buffer
134 */ 107 */
@@ -157,17 +130,15 @@ static void shaper_setspeed(struct shaper *shaper, int bitspersec)
157 * Throw a frame at a shaper. 130 * Throw a frame at a shaper.
158 */ 131 */
159 132
160static int shaper_qframe(struct shaper *shaper, struct sk_buff *skb) 133
134static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
161{ 135{
136 struct shaper *shaper = dev->priv;
162 struct sk_buff *ptr; 137 struct sk_buff *ptr;
163 138
164 /* 139 if (down_trylock(&shaper->sem))
165 * Get ready to work on this shaper. Lock may fail if its 140 return -1;
166 * an interrupt and locked. 141
167 */
168
169 if(!shaper_lock(shaper))
170 return -1;
171 ptr=shaper->sendq.prev; 142 ptr=shaper->sendq.prev;
172 143
173 /* 144 /*
@@ -260,7 +231,8 @@ static int shaper_qframe(struct shaper *shaper, struct sk_buff *skb)
260 dev_kfree_skb(ptr); 231 dev_kfree_skb(ptr);
261 shaper->stats.collisions++; 232 shaper->stats.collisions++;
262 } 233 }
263 shaper_unlock(shaper); 234 shaper_kick(shaper);
235 up(&shaper->sem);
264 return 0; 236 return 0;
265} 237}
266 238
@@ -297,8 +269,13 @@ static void shaper_queue_xmit(struct shaper *shaper, struct sk_buff *skb)
297 269
298static void shaper_timer(unsigned long data) 270static void shaper_timer(unsigned long data)
299{ 271{
300 struct shaper *sh=(struct shaper *)data; 272 struct shaper *shaper = (struct shaper *)data;
301 shaper_kick(sh); 273
274 if (!down_trylock(&shaper->sem)) {
275 shaper_kick(shaper);
276 up(&shaper->sem);
277 } else
278 mod_timer(&shaper->timer, jiffies);
302} 279}
303 280
304/* 281/*
@@ -311,19 +288,6 @@ static void shaper_kick(struct shaper *shaper)
311 struct sk_buff *skb; 288 struct sk_buff *skb;
312 289
313 /* 290 /*
314 * Shaper unlock will kick
315 */
316
317 if (test_and_set_bit(0, &shaper->locked))
318 {
319 if(sh_debug)
320 printk("Shaper locked.\n");
321 mod_timer(&shaper->timer, jiffies);
322 return;
323 }
324
325
326 /*
327 * Walk the list (may be empty) 291 * Walk the list (may be empty)
328 */ 292 */
329 293
@@ -364,8 +328,6 @@ static void shaper_kick(struct shaper *shaper)
364 328
365 if(skb!=NULL) 329 if(skb!=NULL)
366 mod_timer(&shaper->timer, SHAPERCB(skb)->shapeclock); 330 mod_timer(&shaper->timer, SHAPERCB(skb)->shapeclock);
367
368 clear_bit(0, &shaper->locked);
369} 331}
370 332
371 333
@@ -376,14 +338,12 @@ static void shaper_kick(struct shaper *shaper)
376static void shaper_flush(struct shaper *shaper) 338static void shaper_flush(struct shaper *shaper)
377{ 339{
378 struct sk_buff *skb; 340 struct sk_buff *skb;
379 if(!shaper_lock(shaper)) 341
380 { 342 down(&shaper->sem);
381 printk(KERN_ERR "shaper: shaper_flush() called by an irq!\n");
382 return;
383 }
384 while((skb=skb_dequeue(&shaper->sendq))!=NULL) 343 while((skb=skb_dequeue(&shaper->sendq))!=NULL)
385 dev_kfree_skb(skb); 344 dev_kfree_skb(skb);
386 shaper_unlock(shaper); 345 shaper_kick(shaper);
346 up(&shaper->sem);
387} 347}
388 348
389/* 349/*
@@ -426,13 +386,6 @@ static int shaper_close(struct net_device *dev)
426 * ARP and other resolutions and not before. 386 * ARP and other resolutions and not before.
427 */ 387 */
428 388
429
430static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
431{
432 struct shaper *sh=dev->priv;
433 return shaper_qframe(sh, skb);
434}
435
436static struct net_device_stats *shaper_get_stats(struct net_device *dev) 389static struct net_device_stats *shaper_get_stats(struct net_device *dev)
437{ 390{
438 struct shaper *sh=dev->priv; 391 struct shaper *sh=dev->priv;
@@ -623,7 +576,6 @@ static void shaper_init_priv(struct net_device *dev)
623 init_timer(&sh->timer); 576 init_timer(&sh->timer);
624 sh->timer.function=shaper_timer; 577 sh->timer.function=shaper_timer;
625 sh->timer.data=(unsigned long)sh; 578 sh->timer.data=(unsigned long)sh;
626 init_waitqueue_head(&sh->wait_queue);
627} 579}
628 580
629/* 581/*
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index fc9b5cd957aa..a0b8848049c9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7,7 +7,12 @@
7 * Copyright (C) 2005 Broadcom Corporation. 7 * Copyright (C) 2005 Broadcom Corporation.
8 * 8 *
9 * Firmware is: 9 * Firmware is:
10 * Copyright (C) 2000-2003 Broadcom Corporation. 10 * Derived from proprietary unpublished source code,
11 * Copyright (C) 2000-2003 Broadcom Corporation.
12 *
13 * Permission is hereby granted for the distribution of this firmware
14 * data in hexadecimal or equivalent format, provided this copyright
15 * notice is accompanying it.
11 */ 16 */
12 17
13#include <linux/config.h> 18#include <linux/config.h>
@@ -61,8 +66,8 @@
61 66
62#define DRV_MODULE_NAME "tg3" 67#define DRV_MODULE_NAME "tg3"
63#define PFX DRV_MODULE_NAME ": " 68#define PFX DRV_MODULE_NAME ": "
64#define DRV_MODULE_VERSION "3.29" 69#define DRV_MODULE_VERSION "3.31"
65#define DRV_MODULE_RELDATE "May 23, 2005" 70#define DRV_MODULE_RELDATE "June 8, 2005"
66 71
67#define TG3_DEF_MAC_MODE 0 72#define TG3_DEF_MAC_MODE 0
68#define TG3_DEF_RX_MODE 0 73#define TG3_DEF_RX_MODE 0
@@ -8555,6 +8560,16 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
8555 8560
8556 case NIC_SRAM_DATA_CFG_LED_MODE_MAC: 8561 case NIC_SRAM_DATA_CFG_LED_MODE_MAC:
8557 tp->led_ctrl = LED_CTRL_MODE_MAC; 8562 tp->led_ctrl = LED_CTRL_MODE_MAC;
8563
8564 /* Default to PHY_1_MODE if 0 (MAC_MODE) is
8565 * read on some older 5700/5701 bootcode.
8566 */
8567 if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
8568 ASIC_REV_5700 ||
8569 GET_ASIC_REV(tp->pci_chip_rev_id) ==
8570 ASIC_REV_5701)
8571 tp->led_ctrl = LED_CTRL_MODE_PHY_1;
8572
8558 break; 8573 break;
8559 8574
8560 case SHASTA_EXT_LED_SHARED: 8575 case SHASTA_EXT_LED_SHARED:
@@ -9680,10 +9695,24 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
9680 } 9695 }
9681 if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) != 9696 if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) !=
9682 DMA_RWCTRL_WRITE_BNDRY_16) { 9697 DMA_RWCTRL_WRITE_BNDRY_16) {
9698 static struct pci_device_id dma_wait_state_chipsets[] = {
9699 { PCI_DEVICE(PCI_VENDOR_ID_APPLE,
9700 PCI_DEVICE_ID_APPLE_UNI_N_PCI15) },
9701 { },
9702 };
9703
9683 /* DMA test passed without adjusting DMA boundary, 9704 /* DMA test passed without adjusting DMA boundary,
9684 * just restore the calculated DMA boundary 9705 * now look for chipsets that are known to expose the
9706 * DMA bug without failing the test.
9685 */ 9707 */
9686 tp->dma_rwctrl = saved_dma_rwctrl; 9708 if (pci_dev_present(dma_wait_state_chipsets)) {
9709 tp->dma_rwctrl &= ~DMA_RWCTRL_WRITE_BNDRY_MASK;
9710 tp->dma_rwctrl |= DMA_RWCTRL_WRITE_BNDRY_16;
9711 }
9712 else
9713 /* Safe to use the calculated DMA boundary. */
9714 tp->dma_rwctrl = saved_dma_rwctrl;
9715
9687 tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); 9716 tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
9688 } 9717 }
9689 9718
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 8132d946c384..30af105271a2 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -217,6 +217,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
217 kfree(slot->hotplug_slot->info); 217 kfree(slot->hotplug_slot->info);
218 kfree(slot->hotplug_slot->name); 218 kfree(slot->hotplug_slot->name);
219 kfree(slot->hotplug_slot); 219 kfree(slot->hotplug_slot);
220 if (slot->dev)
221 pci_dev_put(slot->dev);
220 kfree(slot); 222 kfree(slot);
221} 223}
222 224
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index c878028ad215..225b5e551dd6 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -315,9 +315,12 @@ int cpci_unconfigure_slot(struct slot* slot)
315 PCI_DEVFN(PCI_SLOT(slot->devfn), i)); 315 PCI_DEVFN(PCI_SLOT(slot->devfn), i));
316 if (dev) { 316 if (dev) {
317 pci_remove_bus_device(dev); 317 pci_remove_bus_device(dev);
318 slot->dev = NULL; 318 pci_dev_put(dev);
319 } 319 }
320 } 320 }
321 pci_dev_put(slot->dev);
322 slot->dev = NULL;
323
321 dbg("%s - exit", __FUNCTION__); 324 dbg("%s - exit", __FUNCTION__);
322 return 0; 325 return 0;
323} 326}
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index fe98553c978f..f315df2005bc 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -393,7 +393,10 @@ int pci_register_driver(struct pci_driver *drv)
393 drv->driver.bus = &pci_bus_type; 393 drv->driver.bus = &pci_bus_type;
394 drv->driver.probe = pci_device_probe; 394 drv->driver.probe = pci_device_probe;
395 drv->driver.remove = pci_device_remove; 395 drv->driver.remove = pci_device_remove;
396 drv->driver.shutdown = pci_device_shutdown, 396 /* FIXME, once all of the existing PCI drivers have been fixed to set
397 * the pci shutdown function, this test can go away. */
398 if (!drv->driver.shutdown)
399 drv->driver.shutdown = pci_device_shutdown,
397 drv->driver.owner = drv->owner; 400 drv->driver.owner = drv->owner;
398 drv->driver.kobj.ktype = &pci_driver_kobj_type; 401 drv->driver.kobj.ktype = &pci_driver_kobj_type;
399 pci_init_dynids(&drv->dynids); 402 pci_init_dynids(&drv->dynids);
diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids
index 93481b41b613..1d2ef1e2ffc6 100644
--- a/drivers/pci/pci.ids
+++ b/drivers/pci/pci.ids
@@ -7173,6 +7173,7 @@
7173 080f Sentry5 DDR/SDR RAM Controller 7173 080f Sentry5 DDR/SDR RAM Controller
7174 0811 Sentry5 External Interface Core 7174 0811 Sentry5 External Interface Core
7175 0816 BCM3302 Sentry5 MIPS32 CPU 7175 0816 BCM3302 Sentry5 MIPS32 CPU
7176 1600 NetXtreme BCM5752 Gigabit Ethernet PCI Express
7176 1644 NetXtreme BCM5700 Gigabit Ethernet 7177 1644 NetXtreme BCM5700 Gigabit Ethernet
7177 1014 0277 Broadcom Vigil B5700 1000Base-T 7178 1014 0277 Broadcom Vigil B5700 1000Base-T
7178 1028 00d1 Broadcom BCM5700 7179 1028 00d1 Broadcom BCM5700
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index b7ae87823c69..fd48b201eb53 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -125,7 +125,7 @@ static inline unsigned int pci_calc_resource_flags(unsigned int flags)
125/* 125/*
126 * Find the extent of a PCI decode.. 126 * Find the extent of a PCI decode..
127 */ 127 */
128static u32 pci_size(u32 base, u32 maxbase, unsigned long mask) 128static u32 pci_size(u32 base, u32 maxbase, u32 mask)
129{ 129{
130 u32 size = mask & maxbase; /* Find the significant bits */ 130 u32 size = mask & maxbase; /* Find the significant bits */
131 if (!size) 131 if (!size)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 637e9493034b..968033fd29f0 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -456,21 +456,16 @@ static void __init quirk_amd_8131_ioapic(struct pci_dev *dev)
456} 456}
457DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC, quirk_amd_8131_ioapic ); 457DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC, quirk_amd_8131_ioapic );
458 458
459static void __init quirk_svw_msi(struct pci_dev *dev)
460{
461 pci_msi_quirk = 1;
462 printk(KERN_WARNING "PCI: MSI quirk detected. pci_msi_quirk set.\n");
463}
464DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_svw_msi );
459#endif /* CONFIG_X86_IO_APIC */ 465#endif /* CONFIG_X86_IO_APIC */
460 466
461 467
462/* 468/*
463 * Via 686A/B: The PCI_INTERRUPT_LINE register for the on-chip
464 * devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
465 * when written, it makes an internal connection to the PIC.
466 * For these devices, this register is defined to be 4 bits wide.
467 * Normally this is fine. However for IO-APIC motherboards, or
468 * non-x86 architectures (yes Via exists on PPC among other places),
469 * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
470 * interrupts delivered properly.
471 */
472
473/*
474 * FIXME: it is questionable that quirk_via_acpi 469 * FIXME: it is questionable that quirk_via_acpi
475 * is needed. It shows up as an ISA bridge, and does not 470 * is needed. It shows up as an ISA bridge, and does not
476 * support the PCI_INTERRUPT_LINE register at all. Therefore 471 * support the PCI_INTERRUPT_LINE register at all. Therefore
@@ -492,28 +487,30 @@ static void __devinit quirk_via_acpi(struct pci_dev *d)
492DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi ); 487DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi );
493DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi ); 488DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi );
494 489
495static void quirk_via_irqpic(struct pci_dev *dev) 490/*
491 * Via 686A/B: The PCI_INTERRUPT_LINE register for the on-chip
492 * devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
493 * when written, it makes an internal connection to the PIC.
494 * For these devices, this register is defined to be 4 bits wide.
495 * Normally this is fine. However for IO-APIC motherboards, or
496 * non-x86 architectures (yes Via exists on PPC among other places),
497 * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
498 * interrupts delivered properly.
499 */
500static void quirk_via_irq(struct pci_dev *dev)
496{ 501{
497 u8 irq, new_irq; 502 u8 irq, new_irq;
498 503
499#ifdef CONFIG_X86_IO_APIC
500 if (nr_ioapics && !skip_ioapic_setup)
501 return;
502#endif
503#ifdef CONFIG_ACPI
504 if (acpi_irq_model != ACPI_IRQ_MODEL_PIC)
505 return;
506#endif
507 new_irq = dev->irq & 0xf; 504 new_irq = dev->irq & 0xf;
508 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); 505 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
509 if (new_irq != irq) { 506 if (new_irq != irq) {
510 printk(KERN_INFO "PCI: Via PIC IRQ fixup for %s, from %d to %d\n", 507 printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n",
511 pci_name(dev), irq, new_irq); 508 pci_name(dev), irq, new_irq);
512 udelay(15); /* unknown if delay really needed */ 509 udelay(15); /* unknown if delay really needed */
513 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq); 510 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
514 } 511 }
515} 512}
516DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irqpic); 513DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);
517 514
518/* 515/*
519 * PIIX3 USB: We have to disable USB interrupts that are 516 * PIIX3 USB: We have to disable USB interrupts that are
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 1811cb240315..27fec8a5eb5b 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1752,7 +1752,7 @@ config SCSI_NCR53C7xx_FAST
1752 1752
1753config SUN3_SCSI 1753config SUN3_SCSI
1754 tristate "Sun3 NCR5380 SCSI" 1754 tristate "Sun3 NCR5380 SCSI"
1755 depends on SUN3 && SCSI 1755 depends on SUN3 && SCSI && BROKEN
1756 help 1756 help
1757 This option will enable support for the OBIO (onboard io) NCR5380 1757 This option will enable support for the OBIO (onboard io) NCR5380
1758 SCSI controller found in the Sun 3/50 and 3/60, as well as for 1758 SCSI controller found in the Sun 3/50 and 3/60, as well as for
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 54c52349adc5..3be546439252 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -665,15 +665,6 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
665 return ata_pci_init_one(pdev, port_info, n_ports); 665 return ata_pci_init_one(pdev, port_info, n_ports);
666} 666}
667 667
668/**
669 * piix_init -
670 *
671 * LOCKING:
672 *
673 * RETURNS:
674 *
675 */
676
677static int __init piix_init(void) 668static int __init piix_init(void)
678{ 669{
679 int rc; 670 int rc;
@@ -689,13 +680,6 @@ static int __init piix_init(void)
689 return 0; 680 return 0;
690} 681}
691 682
692/**
693 * piix_exit -
694 *
695 * LOCKING:
696 *
697 */
698
699static void __exit piix_exit(void) 683static void __exit piix_exit(void)
700{ 684{
701 pci_unregister_driver(&piix_pci_driver); 685 pci_unregister_driver(&piix_pci_driver);
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 30a88f0e7bd6..9e58f134f68b 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -186,6 +186,28 @@ static void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
186 ata_wait_idle(ap); 186 ata_wait_idle(ap);
187} 187}
188 188
189
190/**
191 * ata_tf_load - send taskfile registers to host controller
192 * @ap: Port to which output is sent
193 * @tf: ATA taskfile register set
194 *
195 * Outputs ATA taskfile to standard ATA host controller using MMIO
196 * or PIO as indicated by the ATA_FLAG_MMIO flag.
197 * Writes the control, feature, nsect, lbal, lbam, and lbah registers.
198 * Optionally (ATA_TFLAG_LBA48) writes hob_feature, hob_nsect,
199 * hob_lbal, hob_lbam, and hob_lbah.
200 *
201 * This function waits for idle (!BUSY and !DRQ) after writing
202 * registers. If the control register has a new value, this
203 * function also waits for idle after writing control and before
204 * writing the remaining registers.
205 *
206 * May be used as the tf_load() entry in ata_port_operations.
207 *
208 * LOCKING:
209 * Inherited from caller.
210 */
189void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) 211void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf)
190{ 212{
191 if (ap->flags & ATA_FLAG_MMIO) 213 if (ap->flags & ATA_FLAG_MMIO)
@@ -195,11 +217,11 @@ void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf)
195} 217}
196 218
197/** 219/**
198 * ata_exec_command - issue ATA command to host controller 220 * ata_exec_command_pio - issue ATA command to host controller
199 * @ap: port to which command is being issued 221 * @ap: port to which command is being issued
200 * @tf: ATA taskfile register set 222 * @tf: ATA taskfile register set
201 * 223 *
202 * Issues PIO/MMIO write to ATA command register, with proper 224 * Issues PIO write to ATA command register, with proper
203 * synchronization with interrupt handler / other threads. 225 * synchronization with interrupt handler / other threads.
204 * 226 *
205 * LOCKING: 227 * LOCKING:
@@ -235,6 +257,18 @@ static void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf)
235 ata_pause(ap); 257 ata_pause(ap);
236} 258}
237 259
260
261/**
262 * ata_exec_command - issue ATA command to host controller
263 * @ap: port to which command is being issued
264 * @tf: ATA taskfile register set
265 *
266 * Issues PIO/MMIO write to ATA command register, with proper
267 * synchronization with interrupt handler / other threads.
268 *
269 * LOCKING:
270 * spin_lock_irqsave(host_set lock)
271 */
238void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf) 272void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf)
239{ 273{
240 if (ap->flags & ATA_FLAG_MMIO) 274 if (ap->flags & ATA_FLAG_MMIO)
@@ -305,7 +339,7 @@ void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf)
305} 339}
306 340
307/** 341/**
308 * ata_tf_read - input device's ATA taskfile shadow registers 342 * ata_tf_read_pio - input device's ATA taskfile shadow registers
309 * @ap: Port from which input is read 343 * @ap: Port from which input is read
310 * @tf: ATA taskfile register set for storing input 344 * @tf: ATA taskfile register set for storing input
311 * 345 *
@@ -368,6 +402,23 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf)
368 } 402 }
369} 403}
370 404
405
406/**
407 * ata_tf_read - input device's ATA taskfile shadow registers
408 * @ap: Port from which input is read
409 * @tf: ATA taskfile register set for storing input
410 *
411 * Reads ATA taskfile registers for currently-selected device
412 * into @tf.
413 *
414 * Reads nsect, lbal, lbam, lbah, and device. If ATA_TFLAG_LBA48
415 * is set, also reads the hob registers.
416 *
417 * May be used as the tf_read() entry in ata_port_operations.
418 *
419 * LOCKING:
420 * Inherited from caller.
421 */
371void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) 422void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
372{ 423{
373 if (ap->flags & ATA_FLAG_MMIO) 424 if (ap->flags & ATA_FLAG_MMIO)
@@ -381,7 +432,7 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
381 * @ap: port where the device is 432 * @ap: port where the device is
382 * 433 *
383 * Reads ATA taskfile status register for currently-selected device 434 * Reads ATA taskfile status register for currently-selected device
384 * and return it's value. This also clears pending interrupts 435 * and return its value. This also clears pending interrupts
385 * from this device 436 * from this device
386 * 437 *
387 * LOCKING: 438 * LOCKING:
@@ -397,7 +448,7 @@ static u8 ata_check_status_pio(struct ata_port *ap)
397 * @ap: port where the device is 448 * @ap: port where the device is
398 * 449 *
399 * Reads ATA taskfile status register for currently-selected device 450 * Reads ATA taskfile status register for currently-selected device
400 * via MMIO and return it's value. This also clears pending interrupts 451 * via MMIO and return its value. This also clears pending interrupts
401 * from this device 452 * from this device
402 * 453 *
403 * LOCKING: 454 * LOCKING:
@@ -408,6 +459,20 @@ static u8 ata_check_status_mmio(struct ata_port *ap)
408 return readb((void __iomem *) ap->ioaddr.status_addr); 459 return readb((void __iomem *) ap->ioaddr.status_addr);
409} 460}
410 461
462
463/**
464 * ata_check_status - Read device status reg & clear interrupt
465 * @ap: port where the device is
466 *
467 * Reads ATA taskfile status register for currently-selected device
468 * and return its value. This also clears pending interrupts
469 * from this device
470 *
471 * May be used as the check_status() entry in ata_port_operations.
472 *
473 * LOCKING:
474 * Inherited from caller.
475 */
411u8 ata_check_status(struct ata_port *ap) 476u8 ata_check_status(struct ata_port *ap)
412{ 477{
413 if (ap->flags & ATA_FLAG_MMIO) 478 if (ap->flags & ATA_FLAG_MMIO)
@@ -415,6 +480,20 @@ u8 ata_check_status(struct ata_port *ap)
415 return ata_check_status_pio(ap); 480 return ata_check_status_pio(ap);
416} 481}
417 482
483
484/**
485 * ata_altstatus - Read device alternate status reg
486 * @ap: port where the device is
487 *
488 * Reads ATA taskfile alternate status register for
489 * currently-selected device and return its value.
490 *
491 * Note: may NOT be used as the check_altstatus() entry in
492 * ata_port_operations.
493 *
494 * LOCKING:
495 * Inherited from caller.
496 */
418u8 ata_altstatus(struct ata_port *ap) 497u8 ata_altstatus(struct ata_port *ap)
419{ 498{
420 if (ap->ops->check_altstatus) 499 if (ap->ops->check_altstatus)
@@ -425,6 +504,20 @@ u8 ata_altstatus(struct ata_port *ap)
425 return inb(ap->ioaddr.altstatus_addr); 504 return inb(ap->ioaddr.altstatus_addr);
426} 505}
427 506
507
508/**
509 * ata_chk_err - Read device error reg
510 * @ap: port where the device is
511 *
512 * Reads ATA taskfile error register for
513 * currently-selected device and return its value.
514 *
515 * Note: may NOT be used as the check_err() entry in
516 * ata_port_operations.
517 *
518 * LOCKING:
519 * Inherited from caller.
520 */
428u8 ata_chk_err(struct ata_port *ap) 521u8 ata_chk_err(struct ata_port *ap)
429{ 522{
430 if (ap->ops->check_err) 523 if (ap->ops->check_err)
@@ -873,10 +966,24 @@ void ata_dev_id_string(u16 *id, unsigned char *s,
873 } 966 }
874} 967}
875 968
969
970/**
971 * ata_noop_dev_select - Select device 0/1 on ATA bus
972 * @ap: ATA channel to manipulate
973 * @device: ATA device (numbered from zero) to select
974 *
975 * This function performs no actual function.
976 *
977 * May be used as the dev_select() entry in ata_port_operations.
978 *
979 * LOCKING:
980 * caller.
981 */
876void ata_noop_dev_select (struct ata_port *ap, unsigned int device) 982void ata_noop_dev_select (struct ata_port *ap, unsigned int device)
877{ 983{
878} 984}
879 985
986
880/** 987/**
881 * ata_std_dev_select - Select device 0/1 on ATA bus 988 * ata_std_dev_select - Select device 0/1 on ATA bus
882 * @ap: ATA channel to manipulate 989 * @ap: ATA channel to manipulate
@@ -884,7 +991,9 @@ void ata_noop_dev_select (struct ata_port *ap, unsigned int device)
884 * 991 *
885 * Use the method defined in the ATA specification to 992 * Use the method defined in the ATA specification to
886 * make either device 0, or device 1, active on the 993 * make either device 0, or device 1, active on the
887 * ATA channel. 994 * ATA channel. Works with both PIO and MMIO.
995 *
996 * May be used as the dev_select() entry in ata_port_operations.
888 * 997 *
889 * LOCKING: 998 * LOCKING:
890 * caller. 999 * caller.
@@ -1190,7 +1299,12 @@ err_out:
1190 * ata_bus_probe - Reset and probe ATA bus 1299 * ata_bus_probe - Reset and probe ATA bus
1191 * @ap: Bus to probe 1300 * @ap: Bus to probe
1192 * 1301 *
1302 * Master ATA bus probing function. Initiates a hardware-dependent
1303 * bus reset, then attempts to identify any devices found on
1304 * the bus.
1305 *
1193 * LOCKING: 1306 * LOCKING:
1307 * PCI/etc. bus probe sem.
1194 * 1308 *
1195 * RETURNS: 1309 * RETURNS:
1196 * Zero on success, non-zero on error. 1310 * Zero on success, non-zero on error.
@@ -1229,10 +1343,14 @@ err_out:
1229} 1343}
1230 1344
1231/** 1345/**
1232 * ata_port_probe - 1346 * ata_port_probe - Mark port as enabled
1233 * @ap: 1347 * @ap: Port for which we indicate enablement
1234 * 1348 *
1235 * LOCKING: 1349 * Modify @ap data structure such that the system
1350 * thinks that the entire port is enabled.
1351 *
1352 * LOCKING: host_set lock, or some other form of
1353 * serialization.
1236 */ 1354 */
1237 1355
1238void ata_port_probe(struct ata_port *ap) 1356void ata_port_probe(struct ata_port *ap)
@@ -1241,10 +1359,15 @@ void ata_port_probe(struct ata_port *ap)
1241} 1359}
1242 1360
1243/** 1361/**
1244 * __sata_phy_reset - 1362 * __sata_phy_reset - Wake/reset a low-level SATA PHY
1245 * @ap: 1363 * @ap: SATA port associated with target SATA PHY.
1364 *
1365 * This function issues commands to standard SATA Sxxx
1366 * PHY registers, to wake up the phy (and device), and
1367 * clear any reset condition.
1246 * 1368 *
1247 * LOCKING: 1369 * LOCKING:
1370 * PCI/etc. bus probe sem.
1248 * 1371 *
1249 */ 1372 */
1250void __sata_phy_reset(struct ata_port *ap) 1373void __sata_phy_reset(struct ata_port *ap)
@@ -1289,10 +1412,14 @@ void __sata_phy_reset(struct ata_port *ap)
1289} 1412}
1290 1413
1291/** 1414/**
1292 * __sata_phy_reset - 1415 * sata_phy_reset - Reset SATA bus.
1293 * @ap: 1416 * @ap: SATA port associated with target SATA PHY.
1417 *
1418 * This function resets the SATA bus, and then probes
1419 * the bus for devices.
1294 * 1420 *
1295 * LOCKING: 1421 * LOCKING:
1422 * PCI/etc. bus probe sem.
1296 * 1423 *
1297 */ 1424 */
1298void sata_phy_reset(struct ata_port *ap) 1425void sata_phy_reset(struct ata_port *ap)
@@ -1304,10 +1431,16 @@ void sata_phy_reset(struct ata_port *ap)
1304} 1431}
1305 1432
1306/** 1433/**
1307 * ata_port_disable - 1434 * ata_port_disable - Disable port.
1308 * @ap: 1435 * @ap: Port to be disabled.
1309 * 1436 *
1310 * LOCKING: 1437 * Modify @ap data structure such that the system
1438 * thinks that the entire port is disabled, and should
1439 * never attempt to probe or communicate with devices
1440 * on this port.
1441 *
1442 * LOCKING: host_set lock, or some other form of
1443 * serialization.
1311 */ 1444 */
1312 1445
1313void ata_port_disable(struct ata_port *ap) 1446void ata_port_disable(struct ata_port *ap)
@@ -1416,7 +1549,10 @@ static void ata_host_set_dma(struct ata_port *ap, u8 xfer_mode,
1416 * ata_set_mode - Program timings and issue SET FEATURES - XFER 1549 * ata_set_mode - Program timings and issue SET FEATURES - XFER
1417 * @ap: port on which timings will be programmed 1550 * @ap: port on which timings will be programmed
1418 * 1551 *
1552 * Set ATA device disk transfer mode (PIO3, UDMA6, etc.).
1553 *
1419 * LOCKING: 1554 * LOCKING:
1555 * PCI/etc. bus probe sem.
1420 * 1556 *
1421 */ 1557 */
1422static void ata_set_mode(struct ata_port *ap) 1558static void ata_set_mode(struct ata_port *ap)
@@ -1467,7 +1603,10 @@ err_out:
1467 * @tmout_pat: impatience timeout 1603 * @tmout_pat: impatience timeout
1468 * @tmout: overall timeout 1604 * @tmout: overall timeout
1469 * 1605 *
1470 * LOCKING: 1606 * Sleep until ATA Status register bit BSY clears,
1607 * or a timeout occurs.
1608 *
1609 * LOCKING: None.
1471 * 1610 *
1472 */ 1611 */
1473 1612
@@ -1553,10 +1692,14 @@ static void ata_bus_post_reset(struct ata_port *ap, unsigned int devmask)
1553} 1692}
1554 1693
1555/** 1694/**
1556 * ata_bus_edd - 1695 * ata_bus_edd - Issue EXECUTE DEVICE DIAGNOSTIC command.
1557 * @ap: 1696 * @ap: Port to reset and probe
1697 *
1698 * Use the EXECUTE DEVICE DIAGNOSTIC command to reset and
1699 * probe the bus. Not often used these days.
1558 * 1700 *
1559 * LOCKING: 1701 * LOCKING:
1702 * PCI/etc. bus probe sem.
1560 * 1703 *
1561 */ 1704 */
1562 1705
@@ -1633,8 +1776,8 @@ static unsigned int ata_bus_softreset(struct ata_port *ap,
1633 * the device is ATA or ATAPI. 1776 * the device is ATA or ATAPI.
1634 * 1777 *
1635 * LOCKING: 1778 * LOCKING:
1636 * Inherited from caller. Some functions called by this function 1779 * PCI/etc. bus probe sem.
1637 * obtain the host_set lock. 1780 * Obtains host_set lock.
1638 * 1781 *
1639 * SIDE EFFECTS: 1782 * SIDE EFFECTS:
1640 * Sets ATA_FLAG_PORT_DISABLED if bus reset fails. 1783 * Sets ATA_FLAG_PORT_DISABLED if bus reset fails.
@@ -1876,7 +2019,11 @@ static int fgb(u32 bitmap)
1876 * @xfer_mode_out: (output) SET FEATURES - XFER MODE code 2019 * @xfer_mode_out: (output) SET FEATURES - XFER MODE code
1877 * @xfer_shift_out: (output) bit shift that selects this mode 2020 * @xfer_shift_out: (output) bit shift that selects this mode
1878 * 2021 *
2022 * Based on host and device capabilities, determine the
2023 * maximum transfer mode that is amenable to all.
2024 *
1879 * LOCKING: 2025 * LOCKING:
2026 * PCI/etc. bus probe sem.
1880 * 2027 *
1881 * RETURNS: 2028 * RETURNS:
1882 * Zero on success, negative on error. 2029 * Zero on success, negative on error.
@@ -1909,7 +2056,11 @@ static int ata_choose_xfer_mode(struct ata_port *ap,
1909 * @ap: Port associated with device @dev 2056 * @ap: Port associated with device @dev
1910 * @dev: Device to which command will be sent 2057 * @dev: Device to which command will be sent
1911 * 2058 *
2059 * Issue SET FEATURES - XFER MODE command to device @dev
2060 * on port @ap.
2061 *
1912 * LOCKING: 2062 * LOCKING:
2063 * PCI/etc. bus probe sem.
1913 */ 2064 */
1914 2065
1915static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) 2066static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
@@ -1947,10 +2098,13 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
1947} 2098}
1948 2099
1949/** 2100/**
1950 * ata_sg_clean - 2101 * ata_sg_clean - Unmap DMA memory associated with command
1951 * @qc: 2102 * @qc: Command containing DMA memory to be released
2103 *
2104 * Unmap all mapped DMA memory associated with this command.
1952 * 2105 *
1953 * LOCKING: 2106 * LOCKING:
2107 * spin_lock_irqsave(host_set lock)
1954 */ 2108 */
1955 2109
1956static void ata_sg_clean(struct ata_queued_cmd *qc) 2110static void ata_sg_clean(struct ata_queued_cmd *qc)
@@ -1981,7 +2135,11 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
1981 * ata_fill_sg - Fill PCI IDE PRD table 2135 * ata_fill_sg - Fill PCI IDE PRD table
1982 * @qc: Metadata associated with taskfile to be transferred 2136 * @qc: Metadata associated with taskfile to be transferred
1983 * 2137 *
2138 * Fill PCI IDE PRD (scatter-gather) table with segments
2139 * associated with the current disk command.
2140 *
1984 * LOCKING: 2141 * LOCKING:
2142 * spin_lock_irqsave(host_set lock)
1985 * 2143 *
1986 */ 2144 */
1987static void ata_fill_sg(struct ata_queued_cmd *qc) 2145static void ata_fill_sg(struct ata_queued_cmd *qc)
@@ -2028,7 +2186,13 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
2028 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 2186 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported
2029 * @qc: Metadata associated with taskfile to check 2187 * @qc: Metadata associated with taskfile to check
2030 * 2188 *
2189 * Allow low-level driver to filter ATA PACKET commands, returning
2190 * a status indicating whether or not it is OK to use DMA for the
2191 * supplied PACKET command.
2192 *
2031 * LOCKING: 2193 * LOCKING:
2194 * spin_lock_irqsave(host_set lock)
2195 *
2032 * RETURNS: 0 when ATAPI DMA can be used 2196 * RETURNS: 0 when ATAPI DMA can be used
2033 * nonzero otherwise 2197 * nonzero otherwise
2034 */ 2198 */
@@ -2046,6 +2210,8 @@ int ata_check_atapi_dma(struct ata_queued_cmd *qc)
2046 * ata_qc_prep - Prepare taskfile for submission 2210 * ata_qc_prep - Prepare taskfile for submission
2047 * @qc: Metadata associated with taskfile to be prepared 2211 * @qc: Metadata associated with taskfile to be prepared
2048 * 2212 *
2213 * Prepare ATA taskfile for submission.
2214 *
2049 * LOCKING: 2215 * LOCKING:
2050 * spin_lock_irqsave(host_set lock) 2216 * spin_lock_irqsave(host_set lock)
2051 */ 2217 */
@@ -2057,6 +2223,32 @@ void ata_qc_prep(struct ata_queued_cmd *qc)
2057 ata_fill_sg(qc); 2223 ata_fill_sg(qc);
2058} 2224}
2059 2225
2226/**
2227 * ata_sg_init_one - Associate command with memory buffer
2228 * @qc: Command to be associated
2229 * @buf: Memory buffer
2230 * @buflen: Length of memory buffer, in bytes.
2231 *
2232 * Initialize the data-related elements of queued_cmd @qc
2233 * to point to a single memory buffer, @buf of byte length @buflen.
2234 *
2235 * LOCKING:
2236 * spin_lock_irqsave(host_set lock)
2237 */
2238
2239
2240
2241/**
2242 * ata_sg_init_one - Prepare a one-entry scatter-gather list.
2243 * @qc: Queued command
2244 * @buf: transfer buffer
2245 * @buflen: length of buf
2246 *
2247 * Builds a single-entry scatter-gather list to initiate a
2248 * transfer utilizing the specified buffer.
2249 *
2250 * LOCKING:
2251 */
2060void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) 2252void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
2061{ 2253{
2062 struct scatterlist *sg; 2254 struct scatterlist *sg;
@@ -2074,6 +2266,32 @@ void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
2074 sg->length = buflen; 2266 sg->length = buflen;
2075} 2267}
2076 2268
2269/**
2270 * ata_sg_init - Associate command with scatter-gather table.
2271 * @qc: Command to be associated
2272 * @sg: Scatter-gather table.
2273 * @n_elem: Number of elements in s/g table.
2274 *
2275 * Initialize the data-related elements of queued_cmd @qc
2276 * to point to a scatter-gather table @sg, containing @n_elem
2277 * elements.
2278 *
2279 * LOCKING:
2280 * spin_lock_irqsave(host_set lock)
2281 */
2282
2283
2284/**
2285 * ata_sg_init - Assign a scatter gather list to a queued command
2286 * @qc: Queued command
2287 * @sg: Scatter-gather list
2288 * @n_elem: length of sg list
2289 *
2290 * Attaches a scatter-gather list to a queued command.
2291 *
2292 * LOCKING:
2293 */
2294
2077void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 2295void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
2078 unsigned int n_elem) 2296 unsigned int n_elem)
2079{ 2297{
@@ -2083,14 +2301,16 @@ void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
2083} 2301}
2084 2302
2085/** 2303/**
2086 * ata_sg_setup_one - 2304 * ata_sg_setup_one - DMA-map the memory buffer associated with a command.
2087 * @qc: 2305 * @qc: Command with memory buffer to be mapped.
2306 *
2307 * DMA-map the memory buffer associated with queued_cmd @qc.
2088 * 2308 *
2089 * LOCKING: 2309 * LOCKING:
2090 * spin_lock_irqsave(host_set lock) 2310 * spin_lock_irqsave(host_set lock)
2091 * 2311 *
2092 * RETURNS: 2312 * RETURNS:
2093 * 2313 * Zero on success, negative on error.
2094 */ 2314 */
2095 2315
2096static int ata_sg_setup_one(struct ata_queued_cmd *qc) 2316static int ata_sg_setup_one(struct ata_queued_cmd *qc)
@@ -2115,13 +2335,16 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
2115} 2335}
2116 2336
2117/** 2337/**
2118 * ata_sg_setup - 2338 * ata_sg_setup - DMA-map the scatter-gather table associated with a command.
2119 * @qc: 2339 * @qc: Command with scatter-gather table to be mapped.
2340 *
2341 * DMA-map the scatter-gather table associated with queued_cmd @qc.
2120 * 2342 *
2121 * LOCKING: 2343 * LOCKING:
2122 * spin_lock_irqsave(host_set lock) 2344 * spin_lock_irqsave(host_set lock)
2123 * 2345 *
2124 * RETURNS: 2346 * RETURNS:
2347 * Zero on success, negative on error.
2125 * 2348 *
2126 */ 2349 */
2127 2350
@@ -2151,6 +2374,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
2151 * @ap: 2374 * @ap:
2152 * 2375 *
2153 * LOCKING: 2376 * LOCKING:
2377 * None. (executing in kernel thread context)
2154 * 2378 *
2155 * RETURNS: 2379 * RETURNS:
2156 * 2380 *
@@ -2198,6 +2422,7 @@ static unsigned long ata_pio_poll(struct ata_port *ap)
2198 * @ap: 2422 * @ap:
2199 * 2423 *
2200 * LOCKING: 2424 * LOCKING:
2425 * None. (executing in kernel thread context)
2201 */ 2426 */
2202 2427
2203static void ata_pio_complete (struct ata_port *ap) 2428static void ata_pio_complete (struct ata_port *ap)
@@ -2240,6 +2465,18 @@ static void ata_pio_complete (struct ata_port *ap)
2240 ata_qc_complete(qc, drv_stat); 2465 ata_qc_complete(qc, drv_stat);
2241} 2466}
2242 2467
2468
2469/**
2470 * swap_buf_le16 -
2471 * @buf: Buffer to swap
2472 * @buf_words: Number of 16-bit words in buffer.
2473 *
2474 * Swap halves of 16-bit words if needed to convert from
2475 * little-endian byte order to native cpu byte order, or
2476 * vice-versa.
2477 *
2478 * LOCKING:
2479 */
2243void swap_buf_le16(u16 *buf, unsigned int buf_words) 2480void swap_buf_le16(u16 *buf, unsigned int buf_words)
2244{ 2481{
2245#ifdef __BIG_ENDIAN 2482#ifdef __BIG_ENDIAN
@@ -2340,7 +2577,6 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
2340next_sg: 2577next_sg:
2341 sg = &qc->sg[qc->cursg]; 2578 sg = &qc->sg[qc->cursg];
2342 2579
2343next_page:
2344 page = sg->page; 2580 page = sg->page;
2345 offset = sg->offset + qc->cursg_ofs; 2581 offset = sg->offset + qc->cursg_ofs;
2346 2582
@@ -2348,6 +2584,7 @@ next_page:
2348 page = nth_page(page, (offset >> PAGE_SHIFT)); 2584 page = nth_page(page, (offset >> PAGE_SHIFT));
2349 offset %= PAGE_SIZE; 2585 offset %= PAGE_SIZE;
2350 2586
2587 /* don't overrun current sg */
2351 count = min(sg->length - qc->cursg_ofs, bytes); 2588 count = min(sg->length - qc->cursg_ofs, bytes);
2352 2589
2353 /* don't cross page boundaries */ 2590 /* don't cross page boundaries */
@@ -2372,8 +2609,6 @@ next_page:
2372 kunmap(page); 2609 kunmap(page);
2373 2610
2374 if (bytes) { 2611 if (bytes) {
2375 if (qc->cursg_ofs < sg->length)
2376 goto next_page;
2377 goto next_sg; 2612 goto next_sg;
2378 } 2613 }
2379} 2614}
@@ -2415,6 +2650,7 @@ err_out:
2415 * @ap: 2650 * @ap:
2416 * 2651 *
2417 * LOCKING: 2652 * LOCKING:
2653 * None. (executing in kernel thread context)
2418 */ 2654 */
2419 2655
2420static void ata_pio_block(struct ata_port *ap) 2656static void ata_pio_block(struct ata_port *ap)
@@ -2583,6 +2819,7 @@ static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
2583 * transaction completed successfully. 2819 * transaction completed successfully.
2584 * 2820 *
2585 * LOCKING: 2821 * LOCKING:
2822 * Inherited from SCSI layer (none, can sleep)
2586 */ 2823 */
2587 2824
2588static void ata_qc_timeout(struct ata_queued_cmd *qc) 2825static void ata_qc_timeout(struct ata_queued_cmd *qc)
@@ -2692,6 +2929,7 @@ out:
2692 * @dev: Device from whom we request an available command structure 2929 * @dev: Device from whom we request an available command structure
2693 * 2930 *
2694 * LOCKING: 2931 * LOCKING:
2932 * None.
2695 */ 2933 */
2696 2934
2697static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) 2935static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
@@ -2717,6 +2955,7 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
2717 * @dev: Device from whom we request an available command structure 2955 * @dev: Device from whom we request an available command structure
2718 * 2956 *
2719 * LOCKING: 2957 * LOCKING:
2958 * None.
2720 */ 2959 */
2721 2960
2722struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, 2961struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
@@ -2781,6 +3020,7 @@ static void __ata_qc_complete(struct ata_queued_cmd *qc)
2781 * in case something prevents using it. 3020 * in case something prevents using it.
2782 * 3021 *
2783 * LOCKING: 3022 * LOCKING:
3023 * spin_lock_irqsave(host_set lock)
2784 * 3024 *
2785 */ 3025 */
2786void ata_qc_free(struct ata_queued_cmd *qc) 3026void ata_qc_free(struct ata_queued_cmd *qc)
@@ -2794,9 +3034,13 @@ void ata_qc_free(struct ata_queued_cmd *qc)
2794/** 3034/**
2795 * ata_qc_complete - Complete an active ATA command 3035 * ata_qc_complete - Complete an active ATA command
2796 * @qc: Command to complete 3036 * @qc: Command to complete
2797 * @drv_stat: ATA status register contents 3037 * @drv_stat: ATA Status register contents
3038 *
3039 * Indicate to the mid and upper layers that an ATA
3040 * command has completed, with either an ok or not-ok status.
2798 * 3041 *
2799 * LOCKING: 3042 * LOCKING:
3043 * spin_lock_irqsave(host_set lock)
2800 * 3044 *
2801 */ 3045 */
2802 3046
@@ -2892,6 +3136,7 @@ err_out:
2892 return -1; 3136 return -1;
2893} 3137}
2894 3138
3139
2895/** 3140/**
2896 * ata_qc_issue_prot - issue taskfile to device in proto-dependent manner 3141 * ata_qc_issue_prot - issue taskfile to device in proto-dependent manner
2897 * @qc: command to issue to device 3142 * @qc: command to issue to device
@@ -2901,6 +3146,8 @@ err_out:
2901 * classes called "protocols", and issuing each type of protocol 3146 * classes called "protocols", and issuing each type of protocol
2902 * is slightly different. 3147 * is slightly different.
2903 * 3148 *
3149 * May be used as the qc_issue() entry in ata_port_operations.
3150 *
2904 * LOCKING: 3151 * LOCKING:
2905 * spin_lock_irqsave(host_set lock) 3152 * spin_lock_irqsave(host_set lock)
2906 * 3153 *
@@ -2958,7 +3205,7 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc)
2958} 3205}
2959 3206
2960/** 3207/**
2961 * ata_bmdma_setup - Set up PCI IDE BMDMA transaction 3208 * ata_bmdma_setup_mmio - Set up PCI IDE BMDMA transaction
2962 * @qc: Info associated with this ATA transaction. 3209 * @qc: Info associated with this ATA transaction.
2963 * 3210 *
2964 * LOCKING: 3211 * LOCKING:
@@ -3065,6 +3312,18 @@ static void ata_bmdma_start_pio (struct ata_queued_cmd *qc)
3065 ap->ioaddr.bmdma_addr + ATA_DMA_CMD); 3312 ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
3066} 3313}
3067 3314
3315
3316/**
3317 * ata_bmdma_start - Start a PCI IDE BMDMA transaction
3318 * @qc: Info associated with this ATA transaction.
3319 *
3320 * Writes the ATA_DMA_START flag to the DMA command register.
3321 *
3322 * May be used as the bmdma_start() entry in ata_port_operations.
3323 *
3324 * LOCKING:
3325 * spin_lock_irqsave(host_set lock)
3326 */
3068void ata_bmdma_start(struct ata_queued_cmd *qc) 3327void ata_bmdma_start(struct ata_queued_cmd *qc)
3069{ 3328{
3070 if (qc->ap->flags & ATA_FLAG_MMIO) 3329 if (qc->ap->flags & ATA_FLAG_MMIO)
@@ -3073,6 +3332,20 @@ void ata_bmdma_start(struct ata_queued_cmd *qc)
3073 ata_bmdma_start_pio(qc); 3332 ata_bmdma_start_pio(qc);
3074} 3333}
3075 3334
3335
3336/**
3337 * ata_bmdma_setup - Set up PCI IDE BMDMA transaction
3338 * @qc: Info associated with this ATA transaction.
3339 *
3340 * Writes address of PRD table to device's PRD Table Address
3341 * register, sets the DMA control register, and calls
3342 * ops->exec_command() to start the transfer.
3343 *
3344 * May be used as the bmdma_setup() entry in ata_port_operations.
3345 *
3346 * LOCKING:
3347 * spin_lock_irqsave(host_set lock)
3348 */
3076void ata_bmdma_setup(struct ata_queued_cmd *qc) 3349void ata_bmdma_setup(struct ata_queued_cmd *qc)
3077{ 3350{
3078 if (qc->ap->flags & ATA_FLAG_MMIO) 3351 if (qc->ap->flags & ATA_FLAG_MMIO)
@@ -3081,6 +3354,19 @@ void ata_bmdma_setup(struct ata_queued_cmd *qc)
3081 ata_bmdma_setup_pio(qc); 3354 ata_bmdma_setup_pio(qc);
3082} 3355}
3083 3356
3357
3358/**
3359 * ata_bmdma_irq_clear - Clear PCI IDE BMDMA interrupt.
3360 * @ap: Port associated with this ATA transaction.
3361 *
3362 * Clear interrupt and error flags in DMA status register.
3363 *
3364 * May be used as the irq_clear() entry in ata_port_operations.
3365 *
3366 * LOCKING:
3367 * spin_lock_irqsave(host_set lock)
3368 */
3369
3084void ata_bmdma_irq_clear(struct ata_port *ap) 3370void ata_bmdma_irq_clear(struct ata_port *ap)
3085{ 3371{
3086 if (ap->flags & ATA_FLAG_MMIO) { 3372 if (ap->flags & ATA_FLAG_MMIO) {
@@ -3093,6 +3379,19 @@ void ata_bmdma_irq_clear(struct ata_port *ap)
3093 3379
3094} 3380}
3095 3381
3382
3383/**
3384 * ata_bmdma_status - Read PCI IDE BMDMA status
3385 * @ap: Port associated with this ATA transaction.
3386 *
3387 * Read and return BMDMA status register.
3388 *
3389 * May be used as the bmdma_status() entry in ata_port_operations.
3390 *
3391 * LOCKING:
3392 * spin_lock_irqsave(host_set lock)
3393 */
3394
3096u8 ata_bmdma_status(struct ata_port *ap) 3395u8 ata_bmdma_status(struct ata_port *ap)
3097{ 3396{
3098 u8 host_stat; 3397 u8 host_stat;
@@ -3104,6 +3403,19 @@ u8 ata_bmdma_status(struct ata_port *ap)
3104 return host_stat; 3403 return host_stat;
3105} 3404}
3106 3405
3406
3407/**
3408 * ata_bmdma_stop - Stop PCI IDE BMDMA transfer
3409 * @ap: Port associated with this ATA transaction.
3410 *
3411 * Clears the ATA_DMA_START flag in the dma control register
3412 *
3413 * May be used as the bmdma_stop() entry in ata_port_operations.
3414 *
3415 * LOCKING:
3416 * spin_lock_irqsave(host_set lock)
3417 */
3418
3107void ata_bmdma_stop(struct ata_port *ap) 3419void ata_bmdma_stop(struct ata_port *ap)
3108{ 3420{
3109 if (ap->flags & ATA_FLAG_MMIO) { 3421 if (ap->flags & ATA_FLAG_MMIO) {
@@ -3203,13 +3515,18 @@ idle_irq:
3203 3515
3204/** 3516/**
3205 * ata_interrupt - Default ATA host interrupt handler 3517 * ata_interrupt - Default ATA host interrupt handler
3206 * @irq: irq line 3518 * @irq: irq line (unused)
3207 * @dev_instance: pointer to our host information structure 3519 * @dev_instance: pointer to our ata_host_set information structure
3208 * @regs: unused 3520 * @regs: unused
3209 * 3521 *
3522 * Default interrupt handler for PCI IDE devices. Calls
3523 * ata_host_intr() for each port that is not disabled.
3524 *
3210 * LOCKING: 3525 * LOCKING:
3526 * Obtains host_set lock during operation.
3211 * 3527 *
3212 * RETURNS: 3528 * RETURNS:
3529 * IRQ_NONE or IRQ_HANDLED.
3213 * 3530 *
3214 */ 3531 */
3215 3532
@@ -3302,6 +3619,19 @@ err_out:
3302 ata_qc_complete(qc, ATA_ERR); 3619 ata_qc_complete(qc, ATA_ERR);
3303} 3620}
3304 3621
3622
3623/**
3624 * ata_port_start - Set port up for dma.
3625 * @ap: Port to initialize
3626 *
3627 * Called just after data structures for each port are
3628 * initialized. Allocates space for PRD table.
3629 *
3630 * May be used as the port_start() entry in ata_port_operations.
3631 *
3632 * LOCKING:
3633 */
3634
3305int ata_port_start (struct ata_port *ap) 3635int ata_port_start (struct ata_port *ap)
3306{ 3636{
3307 struct device *dev = ap->host_set->dev; 3637 struct device *dev = ap->host_set->dev;
@@ -3315,6 +3645,18 @@ int ata_port_start (struct ata_port *ap)
3315 return 0; 3645 return 0;
3316} 3646}
3317 3647
3648
3649/**
3650 * ata_port_stop - Undo ata_port_start()
3651 * @ap: Port to shut down
3652 *
3653 * Frees the PRD table.
3654 *
3655 * May be used as the port_stop() entry in ata_port_operations.
3656 *
3657 * LOCKING:
3658 */
3659
3318void ata_port_stop (struct ata_port *ap) 3660void ata_port_stop (struct ata_port *ap)
3319{ 3661{
3320 struct device *dev = ap->host_set->dev; 3662 struct device *dev = ap->host_set->dev;
@@ -3357,7 +3699,11 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
3357 * @ent: Probe information provided by low-level driver 3699 * @ent: Probe information provided by low-level driver
3358 * @port_no: Port number associated with this ata_port 3700 * @port_no: Port number associated with this ata_port
3359 * 3701 *
3702 * Initialize a new ata_port structure, and its associated
3703 * scsi_host.
3704 *
3360 * LOCKING: 3705 * LOCKING:
3706 * Inherited from caller.
3361 * 3707 *
3362 */ 3708 */
3363 3709
@@ -3412,9 +3758,13 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
3412 * @host_set: Collections of ports to which we add 3758 * @host_set: Collections of ports to which we add
3413 * @port_no: Port number associated with this host 3759 * @port_no: Port number associated with this host
3414 * 3760 *
3761 * Attach low-level ATA driver to system.
3762 *
3415 * LOCKING: 3763 * LOCKING:
3764 * PCI/etc. bus probe sem.
3416 * 3765 *
3417 * RETURNS: 3766 * RETURNS:
3767 * New ata_port on success, for NULL on error.
3418 * 3768 *
3419 */ 3769 */
3420 3770
@@ -3447,12 +3797,22 @@ err_out:
3447} 3797}
3448 3798
3449/** 3799/**
3450 * ata_device_add - 3800 * ata_device_add - Register hardware device with ATA and SCSI layers
3451 * @ent: 3801 * @ent: Probe information describing hardware device to be registered
3802 *
3803 * This function processes the information provided in the probe
3804 * information struct @ent, allocates the necessary ATA and SCSI
3805 * host information structures, initializes them, and registers
3806 * everything with requisite kernel subsystems.
3807 *
3808 * This function requests irqs, probes the ATA bus, and probes
3809 * the SCSI bus.
3452 * 3810 *
3453 * LOCKING: 3811 * LOCKING:
3812 * PCI/etc. bus probe sem.
3454 * 3813 *
3455 * RETURNS: 3814 * RETURNS:
3815 * Number of ports registered. Zero on error (no ports registered).
3456 * 3816 *
3457 */ 3817 */
3458 3818
@@ -3604,7 +3964,15 @@ int ata_scsi_release(struct Scsi_Host *host)
3604/** 3964/**
3605 * ata_std_ports - initialize ioaddr with standard port offsets. 3965 * ata_std_ports - initialize ioaddr with standard port offsets.
3606 * @ioaddr: IO address structure to be initialized 3966 * @ioaddr: IO address structure to be initialized
3967 *
3968 * Utility function which initializes data_addr, error_addr,
3969 * feature_addr, nsect_addr, lbal_addr, lbam_addr, lbah_addr,
3970 * device_addr, status_addr, and command_addr to standard offsets
3971 * relative to cmd_addr.
3972 *
3973 * Does not set ctl_addr, altstatus_addr, bmdma_addr, or scr_addr.
3607 */ 3974 */
3975
3608void ata_std_ports(struct ata_ioports *ioaddr) 3976void ata_std_ports(struct ata_ioports *ioaddr)
3609{ 3977{
3610 ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA; 3978 ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA;
@@ -3646,6 +4014,20 @@ ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)
3646 return probe_ent; 4014 return probe_ent;
3647} 4015}
3648 4016
4017
4018
4019/**
4020 * ata_pci_init_native_mode - Initialize native-mode driver
4021 * @pdev: pci device to be initialized
4022 * @port: array[2] of pointers to port info structures.
4023 *
4024 * Utility function which allocates and initializes an
4025 * ata_probe_ent structure for a standard dual-port
4026 * PIO-based IDE controller. The returned ata_probe_ent
4027 * structure can be passed to ata_device_add(). The returned
4028 * ata_probe_ent structure should then be freed with kfree().
4029 */
4030
3649#ifdef CONFIG_PCI 4031#ifdef CONFIG_PCI
3650struct ata_probe_ent * 4032struct ata_probe_ent *
3651ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port) 4033ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
@@ -3727,10 +4109,19 @@ ata_pci_init_legacy_mode(struct pci_dev *pdev, struct ata_port_info **port,
3727 * @port_info: Information from low-level host driver 4109 * @port_info: Information from low-level host driver
3728 * @n_ports: Number of ports attached to host controller 4110 * @n_ports: Number of ports attached to host controller
3729 * 4111 *
4112 * This is a helper function which can be called from a driver's
4113 * xxx_init_one() probe function if the hardware uses traditional
4114 * IDE taskfile registers.
4115 *
4116 * This function calls pci_enable_device(), reserves its register
4117 * regions, sets the dma mask, enables bus master mode, and calls
4118 * ata_device_add()
4119 *
3730 * LOCKING: 4120 * LOCKING:
3731 * Inherited from PCI layer (may sleep). 4121 * Inherited from PCI layer (may sleep).
3732 * 4122 *
3733 * RETURNS: 4123 * RETURNS:
4124 * Zero on success, negative on errno-based value on error.
3734 * 4125 *
3735 */ 4126 */
3736 4127
@@ -3949,15 +4340,6 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
3949#endif /* CONFIG_PCI */ 4340#endif /* CONFIG_PCI */
3950 4341
3951 4342
3952/**
3953 * ata_init -
3954 *
3955 * LOCKING:
3956 *
3957 * RETURNS:
3958 *
3959 */
3960
3961static int __init ata_init(void) 4343static int __init ata_init(void)
3962{ 4344{
3963 ata_wq = create_workqueue("ata"); 4345 ata_wq = create_workqueue("ata");
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 416ba67ba9ee..7a4adc4c8f09 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -947,7 +947,7 @@ unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf,
947} 947}
948 948
949/** 949/**
950 * ata_scsiop_noop - 950 * ata_scsiop_noop - Command handler that simply returns success.
951 * @args: device IDENTIFY data / SCSI command of interest. 951 * @args: device IDENTIFY data / SCSI command of interest.
952 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent. 952 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
953 * @buflen: Response buffer length. 953 * @buflen: Response buffer length.
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 579448222d69..3c97aa45772d 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -507,6 +507,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
507 int ret, i; 507 int ret, i;
508 unsigned int id, lun; 508 unsigned int id, lun;
509 unsigned long serial; 509 unsigned long serial;
510 unsigned long flags;
510 511
511 if (!CMD_SP(cmd)) 512 if (!CMD_SP(cmd))
512 return FAILED; 513 return FAILED;
@@ -519,7 +520,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
519 520
520 /* Check active list for command command. */ 521 /* Check active list for command command. */
521 spin_unlock_irq(ha->host->host_lock); 522 spin_unlock_irq(ha->host->host_lock);
522 spin_lock(&ha->hardware_lock); 523 spin_lock_irqsave(&ha->hardware_lock, flags);
523 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) { 524 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
524 sp = ha->outstanding_cmds[i]; 525 sp = ha->outstanding_cmds[i];
525 526
@@ -534,7 +535,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
534 sp->state)); 535 sp->state));
535 DEBUG3(qla2x00_print_scsi_cmd(cmd);) 536 DEBUG3(qla2x00_print_scsi_cmd(cmd);)
536 537
537 spin_unlock(&ha->hardware_lock); 538 spin_unlock_irqrestore(&ha->hardware_lock, flags);
538 if (qla2x00_abort_command(ha, sp)) { 539 if (qla2x00_abort_command(ha, sp)) {
539 DEBUG2(printk("%s(%ld): abort_command " 540 DEBUG2(printk("%s(%ld): abort_command "
540 "mbx failed.\n", __func__, ha->host_no)); 541 "mbx failed.\n", __func__, ha->host_no));
@@ -543,20 +544,19 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
543 "mbx success.\n", __func__, ha->host_no)); 544 "mbx success.\n", __func__, ha->host_no));
544 ret = SUCCESS; 545 ret = SUCCESS;
545 } 546 }
546 spin_lock(&ha->hardware_lock); 547 spin_lock_irqsave(&ha->hardware_lock, flags);
547 548
548 break; 549 break;
549 } 550 }
551 spin_unlock_irqrestore(&ha->hardware_lock, flags);
550 552
551 /* Wait for the command to be returned. */ 553 /* Wait for the command to be returned. */
552 if (ret == SUCCESS) { 554 if (ret == SUCCESS) {
553 spin_unlock(&ha->hardware_lock);
554 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 555 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
555 qla_printk(KERN_ERR, ha, 556 qla_printk(KERN_ERR, ha,
556 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 557 "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
557 "%x.\n", ha->host_no, id, lun, serial, ret); 558 "%x.\n", ha->host_no, id, lun, serial, ret);
558 } 559 }
559 spin_lock(&ha->hardware_lock);
560 } 560 }
561 spin_lock_irq(ha->host->host_lock); 561 spin_lock_irq(ha->host->host_lock);
562 562
@@ -588,6 +588,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
588 int status; 588 int status;
589 srb_t *sp; 589 srb_t *sp;
590 struct scsi_cmnd *cmd; 590 struct scsi_cmnd *cmd;
591 unsigned long flags;
591 592
592 status = 0; 593 status = 0;
593 594
@@ -596,11 +597,11 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
596 * array 597 * array
597 */ 598 */
598 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { 599 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
599 spin_lock(&ha->hardware_lock); 600 spin_lock_irqsave(&ha->hardware_lock, flags);
600 sp = ha->outstanding_cmds[cnt]; 601 sp = ha->outstanding_cmds[cnt];
601 if (sp) { 602 if (sp) {
602 cmd = sp->cmd; 603 cmd = sp->cmd;
603 spin_unlock(&ha->hardware_lock); 604 spin_unlock_irqrestore(&ha->hardware_lock, flags);
604 if (cmd->device->id == t) { 605 if (cmd->device->id == t) {
605 if (!qla2x00_eh_wait_on_command(ha, cmd)) { 606 if (!qla2x00_eh_wait_on_command(ha, cmd)) {
606 status = 1; 607 status = 1;
@@ -608,7 +609,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
608 } 609 }
609 } 610 }
610 } else { 611 } else {
611 spin_unlock(&ha->hardware_lock); 612 spin_unlock_irqrestore(&ha->hardware_lock, flags);
612 } 613 }
613 } 614 }
614 return (status); 615 return (status);
@@ -740,6 +741,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
740 int status; 741 int status;
741 srb_t *sp; 742 srb_t *sp;
742 struct scsi_cmnd *cmd; 743 struct scsi_cmnd *cmd;
744 unsigned long flags;
743 745
744 status = 1; 746 status = 1;
745 747
@@ -748,17 +750,17 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
748 * array 750 * array
749 */ 751 */
750 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { 752 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
751 spin_lock(&ha->hardware_lock); 753 spin_lock_irqsave(&ha->hardware_lock, flags);
752 sp = ha->outstanding_cmds[cnt]; 754 sp = ha->outstanding_cmds[cnt];
753 if (sp) { 755 if (sp) {
754 cmd = sp->cmd; 756 cmd = sp->cmd;
755 spin_unlock(&ha->hardware_lock); 757 spin_unlock_irqrestore(&ha->hardware_lock, flags);
756 status = qla2x00_eh_wait_on_command(ha, cmd); 758 status = qla2x00_eh_wait_on_command(ha, cmd);
757 if (status == 0) 759 if (status == 0)
758 break; 760 break;
759 } 761 }
760 else { 762 else {
761 spin_unlock(&ha->hardware_lock); 763 spin_unlock_irqrestore(&ha->hardware_lock, flags);
762 } 764 }
763 } 765 }
764 return (status); 766 return (status);
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 238580d244e6..49ed557a4b66 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -432,7 +432,13 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
432 writeb(cls, mmio_base + SIL_FIFO_R0); 432 writeb(cls, mmio_base + SIL_FIFO_R0);
433 writeb(cls, mmio_base + SIL_FIFO_W0); 433 writeb(cls, mmio_base + SIL_FIFO_W0);
434 writeb(cls, mmio_base + SIL_FIFO_R1); 434 writeb(cls, mmio_base + SIL_FIFO_R1);
435 writeb(cls, mmio_base + SIL_FIFO_W2); 435 writeb(cls, mmio_base + SIL_FIFO_W1);
436 if (ent->driver_data == sil_3114) {
437 writeb(cls, mmio_base + SIL_FIFO_R2);
438 writeb(cls, mmio_base + SIL_FIFO_W2);
439 writeb(cls, mmio_base + SIL_FIFO_R3);
440 writeb(cls, mmio_base + SIL_FIFO_W3);
441 }
436 } else 442 } else
437 printk(KERN_WARNING DRV_NAME "(%s): cache line size not set. Driver may not function\n", 443 printk(KERN_WARNING DRV_NAME "(%s): cache line size not set. Driver may not function\n",
438 pci_name(pdev)); 444 pci_name(pdev));
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index cca772624ae7..8d0d302844a1 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1197,6 +1197,7 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
1197 if (!starget) 1197 if (!starget)
1198 return ERR_PTR(-ENOMEM); 1198 return ERR_PTR(-ENOMEM);
1199 1199
1200 get_device(&starget->dev);
1200 down(&shost->scan_mutex); 1201 down(&shost->scan_mutex);
1201 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata); 1202 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata);
1202 if (res != SCSI_SCAN_LUN_PRESENT) 1203 if (res != SCSI_SCAN_LUN_PRESENT)
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index 22565a67a57c..98641c3f5ab9 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -197,7 +197,7 @@ static void
197sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs) 197sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
198{ 198{
199 struct tty_struct *tty = sport->port.info->tty; 199 struct tty_struct *tty = sport->port.info->tty;
200 unsigned int status, ch, flg, ignored = 0; 200 unsigned int status, ch, flg;
201 201
202 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | 202 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
203 UTSR0_TO_SM(UART_GET_UTSR0(sport)); 203 UTSR0_TO_SM(UART_GET_UTSR0(sport));
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index 5d2ceb623e6f..1f985327b0d4 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -234,7 +234,7 @@ static inline const char *siu_type_name(struct uart_port *port)
234 return "DSIU"; 234 return "DSIU";
235 } 235 }
236 236
237 return "unknown"; 237 return NULL;
238} 238}
239 239
240static unsigned int siu_tx_empty(struct uart_port *port) 240static unsigned int siu_tx_empty(struct uart_port *port)
@@ -482,9 +482,6 @@ static irqreturn_t siu_interrupt(int irq, void *dev_id, struct pt_regs *regs)
482 struct uart_port *port; 482 struct uart_port *port;
483 uint8_t iir, lsr; 483 uint8_t iir, lsr;
484 484
485 if (dev_id == NULL)
486 return IRQ_NONE;
487
488 port = (struct uart_port *)dev_id; 485 port = (struct uart_port *)dev_id;
489 486
490 iir = siu_read(port, UART_IIR); 487 iir = siu_read(port, UART_IIR);
@@ -507,6 +504,9 @@ static int siu_startup(struct uart_port *port)
507{ 504{
508 int retval; 505 int retval;
509 506
507 if (port->membase == NULL)
508 return -ENODEV;
509
510 siu_clear_fifo(port); 510 siu_clear_fifo(port);
511 511
512 (void)siu_read(port, UART_LSR); 512 (void)siu_read(port, UART_LSR);
@@ -545,9 +545,6 @@ static void siu_shutdown(struct uart_port *port)
545 unsigned long flags; 545 unsigned long flags;
546 uint8_t lcr; 546 uint8_t lcr;
547 547
548 if (port->membase == NULL)
549 return;
550
551 siu_write(port, UART_IER, 0); 548 siu_write(port, UART_IER, 0);
552 549
553 spin_lock_irqsave(&port->lock, flags); 550 spin_lock_irqsave(&port->lock, flags);
@@ -802,53 +799,6 @@ static int siu_init_ports(void)
802 799
803#ifdef CONFIG_SERIAL_VR41XX_CONSOLE 800#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
804 801
805static void early_set_termios(struct uart_port *port, struct termios *new,
806 struct termios *old)
807{
808 tcflag_t c_cflag;
809 uint8_t lcr;
810 unsigned int baud, quot;
811
812 c_cflag = new->c_cflag;
813 switch (c_cflag & CSIZE) {
814 case CS5:
815 lcr = UART_LCR_WLEN5;
816 break;
817 case CS6:
818 lcr = UART_LCR_WLEN6;
819 break;
820 case CS7:
821 lcr = UART_LCR_WLEN7;
822 break;
823 default:
824 lcr = UART_LCR_WLEN8;
825 break;
826 }
827
828 if (c_cflag & CSTOPB)
829 lcr |= UART_LCR_STOP;
830 if (c_cflag & PARENB)
831 lcr |= UART_LCR_PARITY;
832 if ((c_cflag & PARODD) != PARODD)
833 lcr |= UART_LCR_EPAR;
834 if (c_cflag & CMSPAR)
835 lcr |= UART_LCR_SPAR;
836
837 baud = uart_get_baud_rate(port, new, old, 0, port->uartclk/16);
838 quot = uart_get_divisor(port, baud);
839
840 siu_write(port, UART_LCR, lcr | UART_LCR_DLAB);
841
842 siu_write(port, UART_DLL, (uint8_t)quot);
843 siu_write(port, UART_DLM, (uint8_t)(quot >> 8));
844
845 siu_write(port, UART_LCR, lcr);
846}
847
848static struct uart_ops early_uart_ops = {
849 .set_termios = early_set_termios,
850};
851
852#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 802#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
853 803
854static void wait_for_xmitr(struct uart_port *port) 804static void wait_for_xmitr(struct uart_port *port)
@@ -915,7 +865,7 @@ static int siu_console_setup(struct console *con, char *options)
915 if (port->membase == NULL) { 865 if (port->membase == NULL) {
916 if (port->mapbase == 0) 866 if (port->mapbase == 0)
917 return -ENODEV; 867 return -ENODEV;
918 port->membase = (unsigned char __iomem *)KSEG1ADDR(port->mapbase); 868 port->membase = ioremap(port->mapbase, siu_port_size(port));
919 } 869 }
920 870
921 vr41xx_select_siu_interface(SIU_INTERFACE_RS232C); 871 vr41xx_select_siu_interface(SIU_INTERFACE_RS232C);
@@ -949,7 +899,7 @@ static int __devinit siu_console_init(void)
949 899
950 for (i = 0; i < num; i++) { 900 for (i = 0; i < num; i++) {
951 port = &siu_uart_ports[i]; 901 port = &siu_uart_ports[i];
952 port->ops = &early_uart_ops; 902 port->ops = &siu_uart_ops;
953 } 903 }
954 904
955 register_console(&siu_console); 905 register_console(&siu_console);
@@ -994,8 +944,10 @@ static int siu_probe(struct device *dev)
994 port->dev = dev; 944 port->dev = dev;
995 945
996 retval = uart_add_one_port(&siu_uart_driver, port); 946 retval = uart_add_one_port(&siu_uart_driver, port);
997 if (retval) 947 if (retval < 0) {
948 port->dev = NULL;
998 break; 949 break;
950 }
999 } 951 }
1000 952
1001 if (i == 0 && retval < 0) { 953 if (i == 0 && retval < 0) {
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 4ab50009291d..4d0c9e65cd03 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -290,32 +290,30 @@ static ssize_t show_modalias(struct device *dev, char *buf)
290{ 290{
291 struct usb_interface *intf; 291 struct usb_interface *intf;
292 struct usb_device *udev; 292 struct usb_device *udev;
293 int len;
293 294
294 intf = to_usb_interface(dev); 295 intf = to_usb_interface(dev);
295 udev = interface_to_usbdev(intf); 296 udev = interface_to_usbdev(intf);
296 if (udev->descriptor.bDeviceClass == 0) {
297 struct usb_host_interface *alt = intf->cur_altsetting;
298 297
299 return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X\n", 298 len = sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic",
300 le16_to_cpu(udev->descriptor.idVendor), 299 le16_to_cpu(udev->descriptor.idVendor),
301 le16_to_cpu(udev->descriptor.idProduct), 300 le16_to_cpu(udev->descriptor.idProduct),
302 le16_to_cpu(udev->descriptor.bcdDevice), 301 le16_to_cpu(udev->descriptor.bcdDevice),
303 udev->descriptor.bDeviceClass, 302 udev->descriptor.bDeviceClass,
304 udev->descriptor.bDeviceSubClass, 303 udev->descriptor.bDeviceSubClass,
305 udev->descriptor.bDeviceProtocol, 304 udev->descriptor.bDeviceProtocol);
305 buf += len;
306
307 if (udev->descriptor.bDeviceClass == 0) {
308 struct usb_host_interface *alt = intf->cur_altsetting;
309
310 return len + sprintf(buf, "%02Xisc%02Xip%02X\n",
306 alt->desc.bInterfaceClass, 311 alt->desc.bInterfaceClass,
307 alt->desc.bInterfaceSubClass, 312 alt->desc.bInterfaceSubClass,
308 alt->desc.bInterfaceProtocol); 313 alt->desc.bInterfaceProtocol);
309 } else { 314 } else {
310 return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic*isc*ip*\n", 315 return len + sprintf(buf, "*isc*ip*\n");
311 le16_to_cpu(udev->descriptor.idVendor),
312 le16_to_cpu(udev->descriptor.idProduct),
313 le16_to_cpu(udev->descriptor.bcdDevice),
314 udev->descriptor.bDeviceClass,
315 udev->descriptor.bDeviceSubClass,
316 udev->descriptor.bDeviceProtocol);
317 } 316 }
318
319} 317}
320static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL); 318static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL);
321 319
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 429330bc38de..d7b4f7939ded 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -439,9 +439,12 @@ static int ehci_hub_control (
439 /* force reset to complete */ 439 /* force reset to complete */
440 writel (temp & ~PORT_RESET, 440 writel (temp & ~PORT_RESET,
441 &ehci->regs->port_status [wIndex]); 441 &ehci->regs->port_status [wIndex]);
442 /* REVISIT: some hardware needs 550+ usec to clear
443 * this bit; seems too long to spin routinely...
444 */
442 retval = handshake ( 445 retval = handshake (
443 &ehci->regs->port_status [wIndex], 446 &ehci->regs->port_status [wIndex],
444 PORT_RESET, 0, 500); 447 PORT_RESET, 0, 750);
445 if (retval != 0) { 448 if (retval != 0) {
446 ehci_err (ehci, "port %d reset error %d\n", 449 ehci_err (ehci, "port %d reset error %d\n",
447 wIndex + 1, retval); 450 wIndex + 1, retval);
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 869ff73690ac..2d8bd9dcc6ed 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1315,6 +1315,8 @@ void hid_init_reports(struct hid_device *hid)
1315#define USB_DEVICE_ID_WACOM_INTUOS2 0x0040 1315#define USB_DEVICE_ID_WACOM_INTUOS2 0x0040
1316#define USB_DEVICE_ID_WACOM_VOLITO 0x0060 1316#define USB_DEVICE_ID_WACOM_VOLITO 0x0060
1317#define USB_DEVICE_ID_WACOM_PTU 0x0003 1317#define USB_DEVICE_ID_WACOM_PTU 0x0003
1318#define USB_DEVICE_ID_WACOM_INTUOS3 0x00B0
1319#define USB_DEVICE_ID_WACOM_CINTIQ 0x003F
1318 1320
1319#define USB_VENDOR_ID_KBGEAR 0x084e 1321#define USB_VENDOR_ID_KBGEAR 0x084e
1320#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001 1322#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001
@@ -1401,6 +1403,7 @@ void hid_init_reports(struct hid_device *hid)
1401 1403
1402#define USB_VENDOR_ID_DELORME 0x1163 1404#define USB_VENDOR_ID_DELORME 0x1163
1403#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 1405#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
1406#define USB_DEVICE_ID_DELORME_EM_LT20 0x0200
1404 1407
1405#define USB_VENDOR_ID_MCC 0x09db 1408#define USB_VENDOR_ID_MCC 0x09db
1406#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 1409#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
@@ -1412,6 +1415,12 @@ void hid_init_reports(struct hid_device *hid)
1412#define USB_VENDOR_ID_BTC 0x046e 1415#define USB_VENDOR_ID_BTC 0x046e
1413#define USB_DEVICE_ID_BTC_KEYBOARD 0x5303 1416#define USB_DEVICE_ID_BTC_KEYBOARD 0x5303
1414 1417
1418#define USB_VENDOR_ID_VERNIER 0x08f7
1419#define USB_DEVICE_ID_VERNIER_LABPRO 0x0001
1420#define USB_DEVICE_ID_VERNIER_GOTEMP 0x0002
1421#define USB_DEVICE_ID_VERNIER_SKIP 0x0003
1422#define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004
1423
1415 1424
1416/* 1425/*
1417 * Alphabetically sorted blacklist by quirk type. 1426 * Alphabetically sorted blacklist by quirk type.
@@ -1437,6 +1446,7 @@ static struct hid_blacklist {
1437 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW28, HID_QUIRK_IGNORE }, 1446 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW28, HID_QUIRK_IGNORE },
1438 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE }, 1447 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE },
1439 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE }, 1448 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE },
1449 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20, HID_QUIRK_IGNORE },
1440 { USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE }, 1450 { USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
1441 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE }, 1451 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
1442 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE }, 1452 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
@@ -1456,6 +1466,10 @@ static struct hid_blacklist {
1456 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE }, 1466 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE },
1457 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE }, 1467 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE },
1458 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE }, 1468 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE },
1469 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO, HID_QUIRK_IGNORE },
1470 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP, HID_QUIRK_IGNORE },
1471 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP, HID_QUIRK_IGNORE },
1472 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS, HID_QUIRK_IGNORE },
1459 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE }, 1473 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE },
1460 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE }, 1474 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
1461 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE }, 1475 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE },
@@ -1481,6 +1495,10 @@ static struct hid_blacklist {
1481 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE }, 1495 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE },
1482 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE }, 1496 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE },
1483 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE }, 1497 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE },
1498 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE },
1499 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE },
1500 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE },
1501 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE },
1484 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1502 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1485 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1503 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1486 1504
diff --git a/drivers/usb/media/pwc/ChangeLog b/drivers/usb/media/pwc/ChangeLog
deleted file mode 100644
index b2eb71a9afb5..000000000000
--- a/drivers/usb/media/pwc/ChangeLog
+++ /dev/null
@@ -1,143 +0,0 @@
19.0.2
2
3* Adding #ifdef to compile PWC before and after 2.6.5
4
59.0.1
6
79.0
8
9
108.12
11
12* Implement motorized pan/tilt feature for Logitech QuickCam Orbit/Spere.
13
148.11.1
15
16* Fix for PCVC720/40, would not be able to set videomode
17* Fix for Samsung MPC models, appearantly they are based on a newer chipset
18
198.11
20
21* 20 dev_hints (per request)
22* Hot unplugging should be better, no more dangling pointers or memory leaks
23* Added reserved Logitech webcam IDs
24* Device now remembers size & fps between close()/open()
25* Removed palette stuff altogether
26
278.10.1
28
29* Added IDs for PCVC720K/40 and Creative Labs Webcam Pro
30
318.10
32
33* Fixed ID for QuickCam Notebook pro
34* Added GREALSIZE ioctl() call
35* Fixed bug in case PWCX was not loaded and invalid size was set
36
378.9
38
39* Merging with kernel 2.5.49
40* Adding IDs for QuickCam Zoom & QuickCam Notebook
41
428.8
43
44* Fixing 'leds' parameter
45* Adding IDs for Logitech QuickCam Pro 4000
46* Making URB init/cleanup a little nicer
47
488.7
49
50* Incorporating changes in ioctl() parameter passing
51* Also changes to URB mechanism
52
538.6
54
55* Added ID's for Visionite VCS UM100 and UC300
56* Removed YUV420-interlaced palette altogether (was confusing)
57* Removed MIRROR stuff as it didn't work anyway
58* Fixed a problem with the 'leds' parameter (wouldn't blink)
59* Added ioctl()s for advanced features: 'extended' whitebalance ioctl()s,
60 CONTOUR, BACKLIGHT, FLICKER, DYNNOISE.
61* VIDIOCGCAP.name now contains real camera model name instead of
62 'Philips xxx webcam'
63* Added PROBE ioctl (see previous point & API doc)
64
658.5
66
67* Adding IDs for Creative Labs Webcam 5
68* Adding IDs for SOTEC CMS-001 webcam
69* Solving possible hang in VIDIOCSYNC when unplugging the cam
70* Forgot to return structure in VIDIOCPWCGAWB, oops
71* Time interval for the LEDs are now in milliseconds
72
738.4
74
75* Fixing power_save option for Vesta range
76* Handling new error codes in ISOC callback
77* Adding dev_hint module parameter, to specify /dev/videoX device nodes
78
798.3
80
81* Adding Samsung C10 and C30 cameras
82* Removing palette module parameter
83* Fixed typo in ID of QuickCam 3000 Pro
84* Adding LED settings (blinking while in use) for ToUCam cameras.
85* Turns LED off when camera is not in use.
86
878.2
88
89* Making module more silent when trace = 0
90* Adding QuickCam 3000 Pro IDs
91* Chrominance control for the Vesta cameras
92* Hopefully fixed problems on machines with BIGMEM and > 1GB of RAM
93* Included Oliver Neukem's lock_kernel() patch
94* Allocates less memory for image buffers
95* Adds ioctl()s for the whitebalancing
96
978.1
98
99* Adding support for 750
100* Adding V4L GAUDIO/SAUDIO/UNIT ioctl() calls
101
1028.0
103* 'damage control' after inclusion in 2.4.5.
104* Changed wait-queue mechanism in read/mmap/poll according to the book.
105* Included YUV420P palette.
106* Changed interface to decompressor module.
107* Cleaned up pwc structure a bit.
108
1097.0
110
111* Fixed bug in vcvt_420i_yuyv; extra variables on stack were misaligned.
112* There is now a clear error message when an image size is selected that
113 is only supported using the decompressor, and the decompressor isn't
114 loaded.
115* When the decompressor wasn't loaded, selecting large image size
116 would create skewed or double images.
117
1186.3
119
120* Introduced spinlocks for the buffer pointer manipulation; a number of
121 reports seem to suggest the down()/up() semaphores were the cause of
122 lockups, since they are not suitable for interrupt/user locking.
123* Separated decompressor and core code into 2 modules.
124
1256.2
126
127* Non-integral image sizes are now padded with gray or black.
128* Added SHUTTERSPEED ioctl().
129* Fixed buglet in VIDIOCPWCSAGC; the function would always return an error,
130 even though the call succeeded.
131* Added hotplug support for 2.4.*.
132* Memory: the 645/646 uses less memory now.
133
1346.1
135
136* VIDIOCSPICT returns -EINVAL with invalid palettes.
137* Added saturation control.
138* Split decompressors from rest.
139* Fixed bug that would reset the framerate to the default framerate if
140 the rate field was set to 0 (which is not what I intended, nl. do not
141 change the framerate!).
142* VIDIOCPWCSCQUAL (setting compression quality) now takes effect immediately.
143* Workaround for a bug in the 730 sensor.
diff --git a/drivers/usb/media/pwc/pwc-if.c b/drivers/usb/media/pwc/pwc-if.c
index 5429ff3b9753..b77e65c03659 100644
--- a/drivers/usb/media/pwc/pwc-if.c
+++ b/drivers/usb/media/pwc/pwc-if.c
@@ -332,10 +332,6 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
332#endif 332#endif
333 ; 333 ;
334 } 334 }
335 if (kbuf == NULL) {
336 Err("Failed to allocate decompress table.\n");
337 return -ENOMEM;
338 }
339 pdev->decompress_data = kbuf; 335 pdev->decompress_data = kbuf;
340 336
341 /* Allocate image buffer; double buffer for mmap() */ 337 /* Allocate image buffer; double buffer for mmap() */
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
index a9a7cf4a38eb..fd6ff4cb2c62 100644
--- a/drivers/usb/net/kaweth.c
+++ b/drivers/usb/net/kaweth.c
@@ -520,7 +520,7 @@ static void int_callback(struct urb *u, struct pt_regs *regs)
520 520
521 /* we check the link state to report changes */ 521 /* we check the link state to report changes */
522 if (kaweth->linkstate != (act_state = ( kaweth->intbuffer[STATE_OFFSET] | STATE_MASK) >> STATE_SHIFT)) { 522 if (kaweth->linkstate != (act_state = ( kaweth->intbuffer[STATE_OFFSET] | STATE_MASK) >> STATE_SHIFT)) {
523 if (!act_state) 523 if (act_state)
524 netif_carrier_on(kaweth->net); 524 netif_carrier_on(kaweth->net);
525 else 525 else
526 netif_carrier_off(kaweth->net); 526 netif_carrier_off(kaweth->net);
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
index 85476e76b244..4cbb408af727 100644
--- a/drivers/usb/net/usbnet.c
+++ b/drivers/usb/net/usbnet.c
@@ -2765,7 +2765,7 @@ static int blan_mdlm_bind (struct usbnet *dev, struct usb_interface *intf)
2765 } 2765 }
2766 /* expect bcdVersion 1.0, ignore */ 2766 /* expect bcdVersion 1.0, ignore */
2767 if (memcmp(&desc->bGUID, blan_guid, 16) 2767 if (memcmp(&desc->bGUID, blan_guid, 16)
2768 && memcmp(&desc->bGUID, blan_guid, 16) ) { 2768 && memcmp(&desc->bGUID, safe_guid, 16) ) {
2769 /* hey, this one might _really_ be MDLM! */ 2769 /* hey, this one might _really_ be MDLM! */
2770 dev_dbg (&intf->dev, "MDLM guid\n"); 2770 dev_dbg (&intf->dev, "MDLM guid\n");
2771 goto bad_desc; 2771 goto bad_desc;
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index bc798edf0358..9438909e87a5 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -455,6 +455,17 @@ config USB_SERIAL_XIRCOM
455 To compile this driver as a module, choose M here: the 455 To compile this driver as a module, choose M here: the
456 module will be called keyspan_pda. 456 module will be called keyspan_pda.
457 457
458config USB_SERIAL_OPTION
459 tristate "USB Option PCMCIA serial driver"
460 depends on USB_SERIAL && USB_OHCI_HCD && PCCARD
461 help
462 Say Y here if you want to use an Option card. This is a
463 GSM card, controlled by three serial ports which are connected
464 via an OHCI adapter located on a PC card.
465
466 To compile this driver as a module, choose M here: the
467 module will be called option.
468
458config USB_SERIAL_OMNINET 469config USB_SERIAL_OMNINET
459 tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)" 470 tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)"
460 depends on USB_SERIAL && EXPERIMENTAL 471 depends on USB_SERIAL && EXPERIMENTAL
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index d56ff6d86cce..6c7cdcc99a9e 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_USB_SERIAL_KLSI) += kl5kusb105.o
32obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o 32obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o
33obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o 33obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o
34obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o 34obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o
35obj-$(CONFIG_USB_SERIAL_OPTION) += option.o
35obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o 36obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o
36obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o 37obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o
37obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o 38obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index 7e9bb63eb466..4ace9964fc6b 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -7,6 +7,14 @@
7 * modify it under the terms of the GNU General Public License version 7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation. 8 * 2 as published by the Free Software Foundation.
9 * 9 *
10 * Support to set flow control line levels using TIOCMGET and TIOCMSET
11 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow
12 * control thanks to Munir Nassar nassarmu@real-time.com
13 *
14 * Outstanding Issues:
15 * Buffers are not flushed when the port is opened.
16 * Multiple calls to write() may fail with "Resource temporarily unavailable"
17 *
10 */ 18 */
11 19
12#include <linux/config.h> 20#include <linux/config.h>
@@ -24,7 +32,7 @@
24/* 32/*
25 * Version Information 33 * Version Information
26 */ 34 */
27#define DRIVER_VERSION "v0.03" 35#define DRIVER_VERSION "v0.04"
28#define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver" 36#define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver"
29 37
30/* 38/*
@@ -35,6 +43,9 @@ static void cp2101_cleanup(struct usb_serial_port*);
35static void cp2101_close(struct usb_serial_port*, struct file*); 43static void cp2101_close(struct usb_serial_port*, struct file*);
36static void cp2101_get_termios(struct usb_serial_port*); 44static void cp2101_get_termios(struct usb_serial_port*);
37static void cp2101_set_termios(struct usb_serial_port*, struct termios*); 45static void cp2101_set_termios(struct usb_serial_port*, struct termios*);
46static int cp2101_tiocmget (struct usb_serial_port *, struct file *);
47static int cp2101_tiocmset (struct usb_serial_port *, struct file *,
48 unsigned int, unsigned int);
38static void cp2101_break_ctl(struct usb_serial_port*, int); 49static void cp2101_break_ctl(struct usb_serial_port*, int);
39static int cp2101_startup (struct usb_serial *); 50static int cp2101_startup (struct usb_serial *);
40static void cp2101_shutdown(struct usb_serial*); 51static void cp2101_shutdown(struct usb_serial*);
@@ -43,9 +54,10 @@ static void cp2101_shutdown(struct usb_serial*);
43static int debug; 54static int debug;
44 55
45static struct usb_device_id id_table [] = { 56static struct usb_device_id id_table [] = {
46 {USB_DEVICE(0x10c4, 0xea60) }, /*Silicon labs factory default*/ 57 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
47 {USB_DEVICE(0x10ab, 0x10c5) }, /*Siemens MC60 Cable*/ 58 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
48 { } /* Terminating Entry*/ 59 { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */
60 { } /* Terminating Entry */
49}; 61};
50 62
51MODULE_DEVICE_TABLE (usb, id_table); 63MODULE_DEVICE_TABLE (usb, id_table);
@@ -70,32 +82,35 @@ static struct usb_serial_device_type cp2101_device = {
70 .close = cp2101_close, 82 .close = cp2101_close,
71 .break_ctl = cp2101_break_ctl, 83 .break_ctl = cp2101_break_ctl,
72 .set_termios = cp2101_set_termios, 84 .set_termios = cp2101_set_termios,
85 .tiocmget = cp2101_tiocmget,
86 .tiocmset = cp2101_tiocmset,
73 .attach = cp2101_startup, 87 .attach = cp2101_startup,
74 .shutdown = cp2101_shutdown, 88 .shutdown = cp2101_shutdown,
75}; 89};
76 90
77/*Config request types*/ 91/* Config request types */
78#define REQTYPE_HOST_TO_DEVICE 0x41 92#define REQTYPE_HOST_TO_DEVICE 0x41
79#define REQTYPE_DEVICE_TO_HOST 0xc1 93#define REQTYPE_DEVICE_TO_HOST 0xc1
80 94
81/*Config SET requests. To GET, add 1 to the request number*/ 95/* Config SET requests. To GET, add 1 to the request number */
82#define CP2101_UART 0x00 /*Enable / Disable*/ 96#define CP2101_UART 0x00 /* Enable / Disable */
83#define CP2101_BAUDRATE 0x01 /*(BAUD_RATE_GEN_FREQ / baudrate)*/ 97#define CP2101_BAUDRATE 0x01 /* (BAUD_RATE_GEN_FREQ / baudrate) */
84#define CP2101_BITS 0x03 /*0x(0)(data bits)(parity)(stop bits)*/ 98#define CP2101_BITS 0x03 /* 0x(0)(databits)(parity)(stopbits) */
85#define CP2101_BREAK 0x05 /*On / Off*/ 99#define CP2101_BREAK 0x05 /* On / Off */
86#define CP2101_DTRRTS 0x07 /*101 / 202 ???*/ 100#define CP2101_CONTROL 0x07 /* Flow control line states */
87#define CP2101_CONFIG_16 0x13 /*16 bytes of config data ???*/ 101#define CP2101_MODEMCTL 0x13 /* Modem controls */
88#define CP2101_CONFIG_6 0x19 /*6 bytes of config data ???*/ 102#define CP2101_CONFIG_6 0x19 /* 6 bytes of config data ??? */
89 103
90/*CP2101_UART*/ 104/* CP2101_UART */
91#define UART_ENABLE 0x0001 105#define UART_ENABLE 0x0001
92#define UART_DISABLE 0x0000 106#define UART_DISABLE 0x0000
93 107
94/*CP2101_BAUDRATE*/ 108/* CP2101_BAUDRATE */
95#define BAUD_RATE_GEN_FREQ 0x384000 109#define BAUD_RATE_GEN_FREQ 0x384000
96 110
97/*CP2101_BITS*/ 111/* CP2101_BITS */
98#define BITS_DATA_MASK 0X0f00 112#define BITS_DATA_MASK 0X0f00
113#define BITS_DATA_5 0X0500
99#define BITS_DATA_6 0X0600 114#define BITS_DATA_6 0X0600
100#define BITS_DATA_7 0X0700 115#define BITS_DATA_7 0X0700
101#define BITS_DATA_8 0X0800 116#define BITS_DATA_8 0X0800
@@ -112,64 +127,137 @@ static struct usb_serial_device_type cp2101_device = {
112#define BITS_STOP_1 0x0000 127#define BITS_STOP_1 0x0000
113#define BITS_STOP_1_5 0x0001 128#define BITS_STOP_1_5 0x0001
114#define BITS_STOP_2 0x0002 129#define BITS_STOP_2 0x0002
130
131/* CP2101_BREAK */
115#define BREAK_ON 0x0000 132#define BREAK_ON 0x0000
116#define BREAK_OFF 0x0001 133#define BREAK_OFF 0x0001
117 134
135/* CP2101_CONTROL */
136#define CONTROL_DTR 0x0001
137#define CONTROL_RTS 0x0002
138#define CONTROL_CTS 0x0010
139#define CONTROL_DSR 0x0020
140#define CONTROL_RING 0x0040
141#define CONTROL_DCD 0x0080
142#define CONTROL_WRITE_DTR 0x0100
143#define CONTROL_WRITE_RTS 0x0200
118 144
119static int cp2101_get_config(struct usb_serial_port* port, u8 request) 145/*
146 * cp2101_get_config
147 * Reads from the CP2101 configuration registers
148 * 'size' is specified in bytes.
149 * 'data' is a pointer to a pre-allocated array of integers large
150 * enough to hold 'size' bytes (with 4 bytes to each integer)
151 */
152static int cp2101_get_config(struct usb_serial_port* port, u8 request,
153 unsigned int *data, int size)
120{ 154{
121 struct usb_serial *serial = port->serial; 155 struct usb_serial *serial = port->serial;
122 unsigned char buf[4]; 156 u32 *buf;
123 unsigned int value; 157 int result, i, length;
124 int result, i; 158
159 /* Number of integers required to contain the array */
160 length = (((size - 1) | 3) + 1)/4;
161
162 buf = kmalloc (length * sizeof(u32), GFP_KERNEL);
163 memset(buf, 0, length * sizeof(u32));
164
165 if (!buf) {
166 dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__);
167 return -ENOMEM;
168 }
125 169
126 /*For get requests, the request number must be incremented*/ 170 /* For get requests, the request number must be incremented */
127 request++; 171 request++;
128 172
129 /*Issue the request, attempting to read 4 bytes*/ 173 /* Issue the request, attempting to read 'size' bytes */
130 result = usb_control_msg (serial->dev,usb_rcvctrlpipe (serial->dev, 0), 174 result = usb_control_msg (serial->dev,usb_rcvctrlpipe (serial->dev, 0),
131 request, REQTYPE_DEVICE_TO_HOST, 0x0000, 175 request, REQTYPE_DEVICE_TO_HOST, 0x0000,
132 0, buf, 4, 300); 176 0, buf, size, 300);
133 177
134 if (result < 0) { 178 /* Convert data into an array of integers */
135 dev_err(&port->dev, "%s - Unable to send config request, " 179 for (i=0; i<length; i++)
136 "request=0x%x result=%d\n", 180 data[i] = le32_to_cpu(buf[i]);
137 __FUNCTION__, request, result);
138 return result;
139 }
140 181
141 /*Assemble each byte read into an integer value*/ 182 kfree(buf);
142 value = 0;
143 for (i=0; i<4 && i<result; i++)
144 value |= (buf[i] << (i * 8));
145 183
146 dbg( " %s - request=0x%x result=%d value=0x%x", 184 if (result != size) {
147 __FUNCTION__, request, result, value); 185 dev_err(&port->dev, "%s - Unable to send config request, "
186 "request=0x%x size=%d result=%d\n",
187 __FUNCTION__, request, size, result);
188 return -EPROTO;
189 }
148 190
149 return value; 191 return 0;
150} 192}
151 193
152static int cp2101_set_config(struct usb_serial_port* port, u8 request, u16 value) 194/*
195 * cp2101_set_config
196 * Writes to the CP2101 configuration registers
197 * Values less than 16 bits wide are sent directly
198 * 'size' is specified in bytes.
199 */
200static int cp2101_set_config(struct usb_serial_port* port, u8 request,
201 unsigned int *data, int size)
153{ 202{
154 struct usb_serial *serial = port->serial; 203 struct usb_serial *serial = port->serial;
155 int result; 204 u32 *buf;
156 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), 205 int result, i, length;
157 request, REQTYPE_HOST_TO_DEVICE, value,
158 0, NULL, 0, 300);
159 206
160 if (result <0) { 207 /* Number of integers required to contain the array */
161 dev_err(&port->dev, "%s - Unable to send config request, " 208 length = (((size - 1) | 3) + 1)/4;
162 "request=0x%x value=0x%x result=%d\n", 209
163 __FUNCTION__, request, value, result); 210 buf = kmalloc(length * sizeof(u32), GFP_KERNEL);
164 return result; 211 if (!buf) {
212 dev_err(&port->dev, "%s - out of memory.\n",
213 __FUNCTION__);
214 return -ENOMEM;
215 }
216
217 /* Array of integers into bytes */
218 for (i = 0; i < length; i++)
219 buf[i] = cpu_to_le32(data[i]);
220
221 if (size > 2) {
222 result = usb_control_msg (serial->dev,
223 usb_sndctrlpipe(serial->dev, 0),
224 request, REQTYPE_HOST_TO_DEVICE, 0x0000,
225 0, buf, size, 300);
226 } else {
227 result = usb_control_msg (serial->dev,
228 usb_sndctrlpipe(serial->dev, 0),
229 request, REQTYPE_HOST_TO_DEVICE, data[0],
230 0, NULL, 0, 300);
165 } 231 }
166 232
167 dbg(" %s - request=0x%x value=0x%x result=%d", 233 kfree(buf);
168 __FUNCTION__, request, value, result); 234
235 if ((size > 2 && result != size) || result < 0) {
236 dev_err(&port->dev, "%s - Unable to send request, "
237 "request=0x%x size=%d result=%d\n",
238 __FUNCTION__, request, size, result);
239 return -EPROTO;
240 }
169 241
242 /* Single data value */
243 result = usb_control_msg (serial->dev,
244 usb_sndctrlpipe(serial->dev, 0),
245 request, REQTYPE_HOST_TO_DEVICE, data[0],
246 0, NULL, 0, 300);
170 return 0; 247 return 0;
171} 248}
172 249
250/*
251 * cp2101_set_config_single
252 * Convenience function for calling cp2101_set_config on single data values
253 * without requiring an integer pointer
254 */
255static inline int cp2101_set_config_single(struct usb_serial_port* port,
256 u8 request, unsigned int data)
257{
258 return cp2101_set_config(port, request, &data, 2);
259}
260
173static int cp2101_open (struct usb_serial_port *port, struct file *filp) 261static int cp2101_open (struct usb_serial_port *port, struct file *filp)
174{ 262{
175 struct usb_serial *serial = port->serial; 263 struct usb_serial *serial = port->serial;
@@ -177,7 +265,7 @@ static int cp2101_open (struct usb_serial_port *port, struct file *filp)
177 265
178 dbg("%s - port %d", __FUNCTION__, port->number); 266 dbg("%s - port %d", __FUNCTION__, port->number);
179 267
180 if (cp2101_set_config(port, CP2101_UART, UART_ENABLE)) { 268 if (cp2101_set_config_single(port, CP2101_UART, UART_ENABLE)) {
181 dev_err(&port->dev, "%s - Unable to enable UART\n", 269 dev_err(&port->dev, "%s - Unable to enable UART\n",
182 __FUNCTION__); 270 __FUNCTION__);
183 return -EPROTO; 271 return -EPROTO;
@@ -198,9 +286,12 @@ static int cp2101_open (struct usb_serial_port *port, struct file *filp)
198 return result; 286 return result;
199 } 287 }
200 288
201 /*Configure the termios structure*/ 289 /* Configure the termios structure */
202 cp2101_get_termios(port); 290 cp2101_get_termios(port);
203 291
292 /* Set the DTR and RTS pins low */
293 cp2101_tiocmset(port, NULL, TIOCM_DTR | TIOCM_RTS, 0);
294
204 return 0; 295 return 0;
205} 296}
206 297
@@ -228,16 +319,18 @@ static void cp2101_close (struct usb_serial_port *port, struct file * filp)
228 usb_kill_urb(port->write_urb); 319 usb_kill_urb(port->write_urb);
229 usb_kill_urb(port->read_urb); 320 usb_kill_urb(port->read_urb);
230 321
231 cp2101_set_config(port, CP2101_UART, UART_DISABLE); 322 cp2101_set_config_single(port, CP2101_UART, UART_DISABLE);
232} 323}
233 324
234/* cp2101_get_termios*/ 325/*
235/* Reads the baud rate, data bits, parity and stop bits from the device*/ 326 * cp2101_get_termios
236/* Corrects any unsupported values*/ 327 * Reads the baud rate, data bits, parity, stop bits and flow control mode
237/* Configures the termios structure to reflect the state of the device*/ 328 * from the device, corrects any unsupported values, and configures the
329 * termios structure to reflect the state of the device
330 */
238static void cp2101_get_termios (struct usb_serial_port *port) 331static void cp2101_get_termios (struct usb_serial_port *port)
239{ 332{
240 unsigned int cflag; 333 unsigned int cflag, modem_ctl[4];
241 int baud; 334 int baud;
242 int bits; 335 int bits;
243 336
@@ -249,15 +342,16 @@ static void cp2101_get_termios (struct usb_serial_port *port)
249 } 342 }
250 cflag = port->tty->termios->c_cflag; 343 cflag = port->tty->termios->c_cflag;
251 344
252 baud = cp2101_get_config(port, CP2101_BAUDRATE); 345 cp2101_get_config(port, CP2101_BAUDRATE, &baud, 2);
253 /*Convert to baudrate*/ 346 /* Convert to baudrate */
254 if (baud) 347 if (baud)
255 baud = BAUD_RATE_GEN_FREQ / baud; 348 baud = BAUD_RATE_GEN_FREQ / baud;
256 349
257 dbg("%s - baud rate = %d", __FUNCTION__, baud); 350 dbg("%s - baud rate = %d", __FUNCTION__, baud);
258 cflag &= ~CBAUD; 351 cflag &= ~CBAUD;
259 switch (baud) { 352 switch (baud) {
260 /* The baud rates which are commented out below 353 /*
354 * The baud rates which are commented out below
261 * appear to be supported by the device 355 * appear to be supported by the device
262 * but are non-standard 356 * but are non-standard
263 */ 357 */
@@ -284,14 +378,18 @@ static void cp2101_get_termios (struct usb_serial_port *port)
284 dbg("%s - Baud rate is not supported, " 378 dbg("%s - Baud rate is not supported, "
285 "using 9600 baud", __FUNCTION__); 379 "using 9600 baud", __FUNCTION__);
286 cflag |= B9600; 380 cflag |= B9600;
287 cp2101_set_config(port, CP2101_BAUDRATE, 381 cp2101_set_config_single(port, CP2101_BAUDRATE,
288 (BAUD_RATE_GEN_FREQ/9600)); 382 (BAUD_RATE_GEN_FREQ/9600));
289 break; 383 break;
290 } 384 }
291 385
292 bits = cp2101_get_config(port, CP2101_BITS); 386 cp2101_get_config(port, CP2101_BITS, &bits, 2);
293 cflag &= ~CSIZE; 387 cflag &= ~CSIZE;
294 switch(bits & BITS_DATA_MASK) { 388 switch(bits & BITS_DATA_MASK) {
389 case BITS_DATA_5:
390 dbg("%s - data bits = 5", __FUNCTION__);
391 cflag |= CS5;
392 break;
295 case BITS_DATA_6: 393 case BITS_DATA_6:
296 dbg("%s - data bits = 6", __FUNCTION__); 394 dbg("%s - data bits = 6", __FUNCTION__);
297 cflag |= CS6; 395 cflag |= CS6;
@@ -310,7 +408,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
310 cflag |= CS8; 408 cflag |= CS8;
311 bits &= ~BITS_DATA_MASK; 409 bits &= ~BITS_DATA_MASK;
312 bits |= BITS_DATA_8; 410 bits |= BITS_DATA_8;
313 cp2101_set_config(port, CP2101_BITS, bits); 411 cp2101_set_config(port, CP2101_BITS, &bits, 2);
314 break; 412 break;
315 default: 413 default:
316 dbg("%s - Unknown number of data bits, " 414 dbg("%s - Unknown number of data bits, "
@@ -318,7 +416,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
318 cflag |= CS8; 416 cflag |= CS8;
319 bits &= ~BITS_DATA_MASK; 417 bits &= ~BITS_DATA_MASK;
320 bits |= BITS_DATA_8; 418 bits |= BITS_DATA_8;
321 cp2101_set_config(port, CP2101_BITS, bits); 419 cp2101_set_config(port, CP2101_BITS, &bits, 2);
322 break; 420 break;
323 } 421 }
324 422
@@ -341,21 +439,21 @@ static void cp2101_get_termios (struct usb_serial_port *port)
341 "disabling parity)", __FUNCTION__); 439 "disabling parity)", __FUNCTION__);
342 cflag &= ~PARENB; 440 cflag &= ~PARENB;
343 bits &= ~BITS_PARITY_MASK; 441 bits &= ~BITS_PARITY_MASK;
344 cp2101_set_config(port, CP2101_BITS, bits); 442 cp2101_set_config(port, CP2101_BITS, &bits, 2);
345 break; 443 break;
346 case BITS_PARITY_SPACE: 444 case BITS_PARITY_SPACE:
347 dbg("%s - parity = SPACE (not supported, " 445 dbg("%s - parity = SPACE (not supported, "
348 "disabling parity)", __FUNCTION__); 446 "disabling parity)", __FUNCTION__);
349 cflag &= ~PARENB; 447 cflag &= ~PARENB;
350 bits &= ~BITS_PARITY_MASK; 448 bits &= ~BITS_PARITY_MASK;
351 cp2101_set_config(port, CP2101_BITS, bits); 449 cp2101_set_config(port, CP2101_BITS, &bits, 2);
352 break; 450 break;
353 default: 451 default:
354 dbg("%s - Unknown parity mode, " 452 dbg("%s - Unknown parity mode, "
355 "disabling parity", __FUNCTION__); 453 "disabling parity", __FUNCTION__);
356 cflag &= ~PARENB; 454 cflag &= ~PARENB;
357 bits &= ~BITS_PARITY_MASK; 455 bits &= ~BITS_PARITY_MASK;
358 cp2101_set_config(port, CP2101_BITS, bits); 456 cp2101_set_config(port, CP2101_BITS, &bits, 2);
359 break; 457 break;
360 } 458 }
361 459
@@ -366,9 +464,9 @@ static void cp2101_get_termios (struct usb_serial_port *port)
366 break; 464 break;
367 case BITS_STOP_1_5: 465 case BITS_STOP_1_5:
368 dbg("%s - stop bits = 1.5 (not supported, " 466 dbg("%s - stop bits = 1.5 (not supported, "
369 "using 1 stop bit", __FUNCTION__); 467 "using 1 stop bit)", __FUNCTION__);
370 bits &= ~BITS_STOP_MASK; 468 bits &= ~BITS_STOP_MASK;
371 cp2101_set_config(port, CP2101_BITS, bits); 469 cp2101_set_config(port, CP2101_BITS, &bits, 2);
372 break; 470 break;
373 case BITS_STOP_2: 471 case BITS_STOP_2:
374 dbg("%s - stop bits = 2", __FUNCTION__); 472 dbg("%s - stop bits = 2", __FUNCTION__);
@@ -378,10 +476,19 @@ static void cp2101_get_termios (struct usb_serial_port *port)
378 dbg("%s - Unknown number of stop bits, " 476 dbg("%s - Unknown number of stop bits, "
379 "using 1 stop bit", __FUNCTION__); 477 "using 1 stop bit", __FUNCTION__);
380 bits &= ~BITS_STOP_MASK; 478 bits &= ~BITS_STOP_MASK;
381 cp2101_set_config(port, CP2101_BITS, bits); 479 cp2101_set_config(port, CP2101_BITS, &bits, 2);
382 break; 480 break;
383 } 481 }
384 482
483 cp2101_get_config(port, CP2101_MODEMCTL, modem_ctl, 16);
484 if (modem_ctl[0] & 0x0008) {
485 dbg("%s - flow control = CRTSCTS", __FUNCTION__);
486 cflag |= CRTSCTS;
487 } else {
488 dbg("%s - flow control = NONE", __FUNCTION__);
489 cflag &= ~CRTSCTS;
490 }
491
385 port->tty->termios->c_cflag = cflag; 492 port->tty->termios->c_cflag = cflag;
386} 493}
387 494
@@ -389,8 +496,8 @@ static void cp2101_set_termios (struct usb_serial_port *port,
389 struct termios *old_termios) 496 struct termios *old_termios)
390{ 497{
391 unsigned int cflag, old_cflag=0; 498 unsigned int cflag, old_cflag=0;
392 int baud=0; 499 int baud=0, bits;
393 int bits; 500 unsigned int modem_ctl[4];
394 501
395 dbg("%s - port %d", __FUNCTION__, port->number); 502 dbg("%s - port %d", __FUNCTION__, port->number);
396 503
@@ -400,7 +507,7 @@ static void cp2101_set_termios (struct usb_serial_port *port,
400 } 507 }
401 cflag = port->tty->termios->c_cflag; 508 cflag = port->tty->termios->c_cflag;
402 509
403 /* check that they really want us to change something */ 510 /* Check that they really want us to change something */
404 if (old_termios) { 511 if (old_termios) {
405 if ((cflag == old_termios->c_cflag) && 512 if ((cflag == old_termios->c_cflag) &&
406 (RELEVANT_IFLAG(port->tty->termios->c_iflag) 513 (RELEVANT_IFLAG(port->tty->termios->c_iflag)
@@ -415,7 +522,8 @@ static void cp2101_set_termios (struct usb_serial_port *port,
415 /* If the baud rate is to be updated*/ 522 /* If the baud rate is to be updated*/
416 if ((cflag & CBAUD) != (old_cflag & CBAUD)) { 523 if ((cflag & CBAUD) != (old_cflag & CBAUD)) {
417 switch (cflag & CBAUD) { 524 switch (cflag & CBAUD) {
418 /* The baud rates which are commented out below 525 /*
526 * The baud rates which are commented out below
419 * appear to be supported by the device 527 * appear to be supported by the device
420 * but are non-standard 528 * but are non-standard
421 */ 529 */
@@ -448,18 +556,22 @@ static void cp2101_set_termios (struct usb_serial_port *port,
448 if (baud) { 556 if (baud) {
449 dbg("%s - Setting baud rate to %d baud", __FUNCTION__, 557 dbg("%s - Setting baud rate to %d baud", __FUNCTION__,
450 baud); 558 baud);
451 if (cp2101_set_config(port, CP2101_BAUDRATE, 559 if (cp2101_set_config_single(port, CP2101_BAUDRATE,
452 (BAUD_RATE_GEN_FREQ / baud))) 560 (BAUD_RATE_GEN_FREQ / baud)))
453 dev_err(&port->dev, "Baud rate requested not " 561 dev_err(&port->dev, "Baud rate requested not "
454 "supported by device\n"); 562 "supported by device\n");
455 } 563 }
456 } 564 }
457 565
458 /*If the number of data bits is to be updated*/ 566 /* If the number of data bits is to be updated */
459 if ((cflag & CSIZE) != (old_cflag & CSIZE)) { 567 if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
460 bits = cp2101_get_config(port, CP2101_BITS); 568 cp2101_get_config(port, CP2101_BITS, &bits, 2);
461 bits &= ~BITS_DATA_MASK; 569 bits &= ~BITS_DATA_MASK;
462 switch (cflag & CSIZE) { 570 switch (cflag & CSIZE) {
571 case CS5:
572 bits |= BITS_DATA_5;
573 dbg("%s - data bits = 5", __FUNCTION__);
574 break;
463 case CS6: 575 case CS6:
464 bits |= BITS_DATA_6; 576 bits |= BITS_DATA_6;
465 dbg("%s - data bits = 6", __FUNCTION__); 577 dbg("%s - data bits = 6", __FUNCTION__);
@@ -483,13 +595,13 @@ static void cp2101_set_termios (struct usb_serial_port *port,
483 bits |= BITS_DATA_8; 595 bits |= BITS_DATA_8;
484 break; 596 break;
485 } 597 }
486 if (cp2101_set_config(port, CP2101_BITS, bits)) 598 if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
487 dev_err(&port->dev, "Number of data bits requested " 599 dev_err(&port->dev, "Number of data bits requested "
488 "not supported by device\n"); 600 "not supported by device\n");
489 } 601 }
490 602
491 if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD))) { 603 if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD))) {
492 bits = cp2101_get_config(port, CP2101_BITS); 604 cp2101_get_config(port, CP2101_BITS, &bits, 2);
493 bits &= ~BITS_PARITY_MASK; 605 bits &= ~BITS_PARITY_MASK;
494 if (cflag & PARENB) { 606 if (cflag & PARENB) {
495 if (cflag & PARODD) { 607 if (cflag & PARODD) {
@@ -500,13 +612,13 @@ static void cp2101_set_termios (struct usb_serial_port *port,
500 dbg("%s - parity = EVEN", __FUNCTION__); 612 dbg("%s - parity = EVEN", __FUNCTION__);
501 } 613 }
502 } 614 }
503 if (cp2101_set_config(port, CP2101_BITS, bits)) 615 if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
504 dev_err(&port->dev, "Parity mode not supported " 616 dev_err(&port->dev, "Parity mode not supported "
505 "by device\n"); 617 "by device\n");
506 } 618 }
507 619
508 if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) { 620 if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
509 bits = cp2101_get_config(port, CP2101_BITS); 621 cp2101_get_config(port, CP2101_BITS, &bits, 2);
510 bits &= ~BITS_STOP_MASK; 622 bits &= ~BITS_STOP_MASK;
511 if (cflag & CSTOPB) { 623 if (cflag & CSTOPB) {
512 bits |= BITS_STOP_2; 624 bits |= BITS_STOP_2;
@@ -515,15 +627,90 @@ static void cp2101_set_termios (struct usb_serial_port *port,
515 bits |= BITS_STOP_1; 627 bits |= BITS_STOP_1;
516 dbg("%s - stop bits = 1", __FUNCTION__); 628 dbg("%s - stop bits = 1", __FUNCTION__);
517 } 629 }
518 if (cp2101_set_config(port, CP2101_BITS, bits)) 630 if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
519 dev_err(&port->dev, "Number of stop bits requested " 631 dev_err(&port->dev, "Number of stop bits requested "
520 "not supported by device\n"); 632 "not supported by device\n");
521 } 633 }
634
635 if ((cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
636 cp2101_get_config(port, CP2101_MODEMCTL, modem_ctl, 16);
637 dbg("%s - read modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x",
638 __FUNCTION__, modem_ctl[0], modem_ctl[1],
639 modem_ctl[2], modem_ctl[3]);
640
641 if (cflag & CRTSCTS) {
642 modem_ctl[0] &= ~0x7B;
643 modem_ctl[0] |= 0x09;
644 modem_ctl[1] = 0x80;
645 dbg("%s - flow control = CRTSCTS", __FUNCTION__);
646 } else {
647 modem_ctl[0] &= ~0x7B;
648 modem_ctl[0] |= 0x01;
649 modem_ctl[1] |= 0x40;
650 dbg("%s - flow control = NONE", __FUNCTION__);
651 }
652
653 dbg("%s - write modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x",
654 __FUNCTION__, modem_ctl[0], modem_ctl[1],
655 modem_ctl[2], modem_ctl[3]);
656 cp2101_set_config(port, CP2101_MODEMCTL, modem_ctl, 16);
657 }
658
659}
660
661static int cp2101_tiocmset (struct usb_serial_port *port, struct file *file,
662 unsigned int set, unsigned int clear)
663{
664 int control = 0;
665
666 dbg("%s - port %d", __FUNCTION__, port->number);
667
668 if (set & TIOCM_RTS) {
669 control |= CONTROL_RTS;
670 control |= CONTROL_WRITE_RTS;
671 }
672 if (set & TIOCM_DTR) {
673 control |= CONTROL_DTR;
674 control |= CONTROL_WRITE_DTR;
675 }
676 if (clear & TIOCM_RTS) {
677 control &= ~CONTROL_RTS;
678 control |= CONTROL_WRITE_RTS;
679 }
680 if (clear & TIOCM_DTR) {
681 control &= ~CONTROL_DTR;
682 control |= CONTROL_WRITE_DTR;
683 }
684
685 dbg("%s - control = 0x%.4x", __FUNCTION__, control);
686
687 return cp2101_set_config(port, CP2101_CONTROL, &control, 2);
688
689}
690
691static int cp2101_tiocmget (struct usb_serial_port *port, struct file *file)
692{
693 int control, result;
694
695 dbg("%s - port %d", __FUNCTION__, port->number);
696
697 cp2101_get_config(port, CP2101_CONTROL, &control, 1);
698
699 result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
700 |((control & CONTROL_RTS) ? TIOCM_RTS : 0)
701 |((control & CONTROL_CTS) ? TIOCM_CTS : 0)
702 |((control & CONTROL_DSR) ? TIOCM_DSR : 0)
703 |((control & CONTROL_RING)? TIOCM_RI : 0)
704 |((control & CONTROL_DCD) ? TIOCM_CD : 0);
705
706 dbg("%s - control = 0x%.2x", __FUNCTION__, control);
707
708 return result;
522} 709}
523 710
524static void cp2101_break_ctl (struct usb_serial_port *port, int break_state) 711static void cp2101_break_ctl (struct usb_serial_port *port, int break_state)
525{ 712{
526 u16 state; 713 int state;
527 714
528 dbg("%s - port %d", __FUNCTION__, port->number); 715 dbg("%s - port %d", __FUNCTION__, port->number);
529 if (break_state == 0) 716 if (break_state == 0)
@@ -532,12 +719,12 @@ static void cp2101_break_ctl (struct usb_serial_port *port, int break_state)
532 state = BREAK_ON; 719 state = BREAK_ON;
533 dbg("%s - turning break %s", __FUNCTION__, 720 dbg("%s - turning break %s", __FUNCTION__,
534 state==BREAK_OFF ? "off" : "on"); 721 state==BREAK_OFF ? "off" : "on");
535 cp2101_set_config(port, CP2101_BREAK, state); 722 cp2101_set_config(port, CP2101_BREAK, &state, 2);
536} 723}
537 724
538static int cp2101_startup (struct usb_serial *serial) 725static int cp2101_startup (struct usb_serial *serial)
539{ 726{
540 /*CP2101 buffers behave strangely unless device is reset*/ 727 /* CP2101 buffers behave strangely unless device is reset */
541 usb_reset_device(serial->dev); 728 usb_reset_device(serial->dev);
542 return 0; 729 return 0;
543} 730}
@@ -548,7 +735,7 @@ static void cp2101_shutdown (struct usb_serial *serial)
548 735
549 dbg("%s", __FUNCTION__); 736 dbg("%s", __FUNCTION__);
550 737
551 /* stop reads and writes on all ports */ 738 /* Stop reads and writes on all ports */
552 for (i=0; i < serial->num_ports; ++i) { 739 for (i=0; i < serial->num_ports; ++i) {
553 cp2101_cleanup(serial->port[i]); 740 cp2101_cleanup(serial->port[i]);
554 } 741 }
@@ -560,16 +747,16 @@ static int __init cp2101_init (void)
560 747
561 retval = usb_serial_register(&cp2101_device); 748 retval = usb_serial_register(&cp2101_device);
562 if (retval) 749 if (retval)
563 return retval; /*Failed to register*/ 750 return retval; /* Failed to register */
564 751
565 retval = usb_register(&cp2101_driver); 752 retval = usb_register(&cp2101_driver);
566 if (retval) { 753 if (retval) {
567 /*Failed to register*/ 754 /* Failed to register */
568 usb_serial_deregister(&cp2101_device); 755 usb_serial_deregister(&cp2101_device);
569 return retval; 756 return retval;
570 } 757 }
571 758
572 /*Success*/ 759 /* Success */
573 info(DRIVER_DESC " " DRIVER_VERSION); 760 info(DRIVER_DESC " " DRIVER_VERSION);
574 return 0; 761 return 0;
575} 762}
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 051c3a77b41b..3bfcc7b9f861 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -264,7 +264,7 @@
264/* 264/*
265 * Version Information 265 * Version Information
266 */ 266 */
267#define DRIVER_VERSION "v1.4.1" 267#define DRIVER_VERSION "v1.4.2"
268#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>" 268#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>"
269#define DRIVER_DESC "USB FTDI Serial Converters Driver" 269#define DRIVER_DESC "USB FTDI Serial Converters Driver"
270 270
@@ -687,6 +687,8 @@ struct ftdi_private {
687 char prev_status, diff_status; /* Used for TIOCMIWAIT */ 687 char prev_status, diff_status; /* Used for TIOCMIWAIT */
688 __u8 rx_flags; /* receive state flags (throttling) */ 688 __u8 rx_flags; /* receive state flags (throttling) */
689 spinlock_t rx_lock; /* spinlock for receive state */ 689 spinlock_t rx_lock; /* spinlock for receive state */
690 struct work_struct rx_work;
691 int rx_processed;
690 692
691 __u16 interface; /* FT2232C port interface (0 for FT232/245) */ 693 __u16 interface; /* FT2232C port interface (0 for FT232/245) */
692 694
@@ -717,7 +719,7 @@ static int ftdi_write_room (struct usb_serial_port *port);
717static int ftdi_chars_in_buffer (struct usb_serial_port *port); 719static int ftdi_chars_in_buffer (struct usb_serial_port *port);
718static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs); 720static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
719static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs); 721static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
720static void ftdi_process_read (struct usb_serial_port *port); 722static void ftdi_process_read (void *param);
721static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old); 723static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old);
722static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file); 724static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file);
723static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear); 725static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear);
@@ -1387,6 +1389,8 @@ static int ftdi_common_startup (struct usb_serial *serial)
1387 port->read_urb->transfer_buffer_length = BUFSZ; 1389 port->read_urb->transfer_buffer_length = BUFSZ;
1388 } 1390 }
1389 1391
1392 INIT_WORK(&priv->rx_work, ftdi_process_read, port);
1393
1390 /* Free port's existing write urb and transfer buffer. */ 1394 /* Free port's existing write urb and transfer buffer. */
1391 if (port->write_urb) { 1395 if (port->write_urb) {
1392 usb_free_urb (port->write_urb); 1396 usb_free_urb (port->write_urb);
@@ -1617,6 +1621,7 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp)
1617 spin_unlock_irqrestore(&priv->rx_lock, flags); 1621 spin_unlock_irqrestore(&priv->rx_lock, flags);
1618 1622
1619 /* Start reading from the device */ 1623 /* Start reading from the device */
1624 priv->rx_processed = 0;
1620 usb_fill_bulk_urb(port->read_urb, dev, 1625 usb_fill_bulk_urb(port->read_urb, dev,
1621 usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress), 1626 usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress),
1622 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, 1627 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
@@ -1667,6 +1672,10 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
1667 err("Error from RTS LOW urb"); 1672 err("Error from RTS LOW urb");
1668 } 1673 }
1669 } /* Note change no line if hupcl is off */ 1674 } /* Note change no line if hupcl is off */
1675
1676 /* cancel any scheduled reading */
1677 cancel_delayed_work(&priv->rx_work);
1678 flush_scheduled_work();
1670 1679
1671 /* shutdown our bulk read */ 1680 /* shutdown our bulk read */
1672 if (port->read_urb) 1681 if (port->read_urb)
@@ -1862,23 +1871,14 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
1862 return; 1871 return;
1863 } 1872 }
1864 1873
1865 /* If throttled, delay receive processing until unthrottled. */
1866 spin_lock(&priv->rx_lock);
1867 if (priv->rx_flags & THROTTLED) {
1868 dbg("Deferring read urb processing until unthrottled");
1869 priv->rx_flags |= ACTUALLY_THROTTLED;
1870 spin_unlock(&priv->rx_lock);
1871 return;
1872 }
1873 spin_unlock(&priv->rx_lock);
1874
1875 ftdi_process_read(port); 1874 ftdi_process_read(port);
1876 1875
1877} /* ftdi_read_bulk_callback */ 1876} /* ftdi_read_bulk_callback */
1878 1877
1879 1878
1880static void ftdi_process_read (struct usb_serial_port *port) 1879static void ftdi_process_read (void *param)
1881{ /* ftdi_process_read */ 1880{ /* ftdi_process_read */
1881 struct usb_serial_port *port = (struct usb_serial_port*)param;
1882 struct urb *urb; 1882 struct urb *urb;
1883 struct tty_struct *tty; 1883 struct tty_struct *tty;
1884 struct ftdi_private *priv; 1884 struct ftdi_private *priv;
@@ -1889,6 +1889,7 @@ static void ftdi_process_read (struct usb_serial_port *port)
1889 int result; 1889 int result;
1890 int need_flip; 1890 int need_flip;
1891 int packet_offset; 1891 int packet_offset;
1892 unsigned long flags;
1892 1893
1893 dbg("%s - port %d", __FUNCTION__, port->number); 1894 dbg("%s - port %d", __FUNCTION__, port->number);
1894 1895
@@ -1915,12 +1916,18 @@ static void ftdi_process_read (struct usb_serial_port *port)
1915 1916
1916 data = urb->transfer_buffer; 1917 data = urb->transfer_buffer;
1917 1918
1918 /* The first two bytes of every read packet are status */ 1919 if (priv->rx_processed) {
1919 if (urb->actual_length > 2) { 1920 dbg("%s - already processed: %d bytes, %d remain", __FUNCTION__,
1920 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data); 1921 priv->rx_processed,
1922 urb->actual_length - priv->rx_processed);
1921 } else { 1923 } else {
1922 dbg("Status only: %03oo %03oo",data[0],data[1]); 1924 /* The first two bytes of every read packet are status */
1923 } 1925 if (urb->actual_length > 2) {
1926 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
1927 } else {
1928 dbg("Status only: %03oo %03oo",data[0],data[1]);
1929 }
1930 }
1924 1931
1925 1932
1926 /* TO DO -- check for hung up line and handle appropriately: */ 1933 /* TO DO -- check for hung up line and handle appropriately: */
@@ -1929,8 +1936,12 @@ static void ftdi_process_read (struct usb_serial_port *port)
1929 /* if CD is dropped and the line is not CLOCAL then we should hangup */ 1936 /* if CD is dropped and the line is not CLOCAL then we should hangup */
1930 1937
1931 need_flip = 0; 1938 need_flip = 0;
1932 for (packet_offset=0; packet_offset < urb->actual_length; packet_offset += PKTSZ) { 1939 for (packet_offset = priv->rx_processed; packet_offset < urb->actual_length; packet_offset += PKTSZ) {
1940 int length;
1941
1933 /* Compare new line status to the old one, signal if different */ 1942 /* Compare new line status to the old one, signal if different */
1943 /* N.B. packet may be processed more than once, but differences
1944 * are only processed once. */
1934 if (priv != NULL) { 1945 if (priv != NULL) {
1935 char new_status = data[packet_offset+0] & FTDI_STATUS_B0_MASK; 1946 char new_status = data[packet_offset+0] & FTDI_STATUS_B0_MASK;
1936 if (new_status != priv->prev_status) { 1947 if (new_status != priv->prev_status) {
@@ -1940,6 +1951,35 @@ static void ftdi_process_read (struct usb_serial_port *port)
1940 } 1951 }
1941 } 1952 }
1942 1953
1954 length = min(PKTSZ, urb->actual_length-packet_offset)-2;
1955 if (length < 0) {
1956 err("%s - bad packet length: %d", __FUNCTION__, length+2);
1957 length = 0;
1958 }
1959
1960 /* have to make sure we don't overflow the buffer
1961 with tty_insert_flip_char's */
1962 if (tty->flip.count+length > TTY_FLIPBUF_SIZE) {
1963 tty_flip_buffer_push(tty);
1964 need_flip = 0;
1965
1966 if (tty->flip.count != 0) {
1967 /* flip didn't work, this happens when ftdi_process_read() is
1968 * called from ftdi_unthrottle, because TTY_DONT_FLIP is set */
1969 dbg("%s - flip buffer push failed", __FUNCTION__);
1970 break;
1971 }
1972 }
1973 if (priv->rx_flags & THROTTLED) {
1974 dbg("%s - throttled", __FUNCTION__);
1975 break;
1976 }
1977 if (tty->ldisc.receive_room(tty)-tty->flip.count < length) {
1978 /* break out & wait for throttling/unthrottling to happen */
1979 dbg("%s - receive room low", __FUNCTION__);
1980 break;
1981 }
1982
1943 /* Handle errors and break */ 1983 /* Handle errors and break */
1944 error_flag = TTY_NORMAL; 1984 error_flag = TTY_NORMAL;
1945 /* Although the device uses a bitmask and hence can have multiple */ 1985 /* Although the device uses a bitmask and hence can have multiple */
@@ -1962,13 +2002,8 @@ static void ftdi_process_read (struct usb_serial_port *port)
1962 error_flag = TTY_FRAME; 2002 error_flag = TTY_FRAME;
1963 dbg("FRAMING error"); 2003 dbg("FRAMING error");
1964 } 2004 }
1965 if (urb->actual_length > packet_offset + 2) { 2005 if (length > 0) {
1966 for (i = 2; (i < PKTSZ) && ((i+packet_offset) < urb->actual_length); ++i) { 2006 for (i = 2; i < length+2; i++) {
1967 /* have to make sure we don't overflow the buffer
1968 with tty_insert_flip_char's */
1969 if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
1970 tty_flip_buffer_push(tty);
1971 }
1972 /* Note that the error flag is duplicated for 2007 /* Note that the error flag is duplicated for
1973 every character received since we don't know 2008 every character received since we don't know
1974 which character it applied to */ 2009 which character it applied to */
@@ -2005,6 +2040,35 @@ static void ftdi_process_read (struct usb_serial_port *port)
2005 tty_flip_buffer_push(tty); 2040 tty_flip_buffer_push(tty);
2006 } 2041 }
2007 2042
2043 if (packet_offset < urb->actual_length) {
2044 /* not completely processed - record progress */
2045 priv->rx_processed = packet_offset;
2046 dbg("%s - incomplete, %d bytes processed, %d remain",
2047 __FUNCTION__, packet_offset,
2048 urb->actual_length - packet_offset);
2049 /* check if we were throttled while processing */
2050 spin_lock_irqsave(&priv->rx_lock, flags);
2051 if (priv->rx_flags & THROTTLED) {
2052 priv->rx_flags |= ACTUALLY_THROTTLED;
2053 spin_unlock_irqrestore(&priv->rx_lock, flags);
2054 dbg("%s - deferring remainder until unthrottled",
2055 __FUNCTION__);
2056 return;
2057 }
2058 spin_unlock_irqrestore(&priv->rx_lock, flags);
2059 /* if the port is closed stop trying to read */
2060 if (port->open_count > 0){
2061 /* delay processing of remainder */
2062 schedule_delayed_work(&priv->rx_work, 1);
2063 } else {
2064 dbg("%s - port is closed", __FUNCTION__);
2065 }
2066 return;
2067 }
2068
2069 /* urb is completely processed */
2070 priv->rx_processed = 0;
2071
2008 /* if the port is closed stop trying to read */ 2072 /* if the port is closed stop trying to read */
2009 if (port->open_count > 0){ 2073 if (port->open_count > 0){
2010 /* Continue trying to always read */ 2074 /* Continue trying to always read */
@@ -2444,7 +2508,7 @@ static void ftdi_unthrottle (struct usb_serial_port *port)
2444 spin_unlock_irqrestore(&priv->rx_lock, flags); 2508 spin_unlock_irqrestore(&priv->rx_lock, flags);
2445 2509
2446 if (actually_throttled) 2510 if (actually_throttled)
2447 ftdi_process_read(port); 2511 schedule_work(&priv->rx_work);
2448} 2512}
2449 2513
2450static int __init ftdi_init (void) 2514static int __init ftdi_init (void)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
new file mode 100644
index 000000000000..b722175f108f
--- /dev/null
+++ b/drivers/usb/serial/option.c
@@ -0,0 +1,729 @@
1/*
2 Option Card (PCMCIA to) USB to Serial Driver
3
4 Copyright (C) 2005 Matthias Urlichs <smurf@smurf.noris.de>
5
6 This driver is free software; you can redistribute it and/or modify
7 it under the terms of Version 2 of the GNU General Public License as
8 published by the Free Software Foundation.
9
10 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org>
11
12 History:
13
14 2005-05-19 v0.1 Initial version, based on incomplete docs
15 and analysis of misbehavior of the standard driver
16 2005-05-20 v0.2 Extended the input buffer to avoid losing
17 random 64-byte chunks of data
18 2005-05-21 v0.3 implemented chars_in_buffer()
19 turned on low_latency
20 simplified the code somewhat
21*/
22#define DRIVER_VERSION "v0.3"
23#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
24#define DRIVER_DESC "Option Card (PC-Card to) USB to Serial Driver"
25
26#include <linux/config.h>
27#include <linux/kernel.h>
28#include <linux/jiffies.h>
29#include <linux/errno.h>
30#include <linux/tty.h>
31#include <linux/tty_flip.h>
32#include <linux/module.h>
33#include <linux/usb.h>
34#include "usb-serial.h"
35
36/* Function prototypes */
37static int option_open (struct usb_serial_port *port, struct file *filp);
38static void option_close (struct usb_serial_port *port, struct file *filp);
39static int option_startup (struct usb_serial *serial);
40static void option_shutdown (struct usb_serial *serial);
41static void option_rx_throttle (struct usb_serial_port *port);
42static void option_rx_unthrottle (struct usb_serial_port *port);
43static int option_write_room (struct usb_serial_port *port);
44
45static void option_instat_callback(struct urb *urb, struct pt_regs *regs);
46
47
48static int option_write (struct usb_serial_port *port,
49 const unsigned char *buf, int count);
50
51static int option_chars_in_buffer (struct usb_serial_port *port);
52static int option_ioctl (struct usb_serial_port *port, struct file *file,
53 unsigned int cmd, unsigned long arg);
54static void option_set_termios (struct usb_serial_port *port,
55 struct termios *old);
56static void option_break_ctl (struct usb_serial_port *port, int break_state);
57static int option_tiocmget (struct usb_serial_port *port, struct file *file);
58static int option_tiocmset (struct usb_serial_port *port, struct file *file,
59 unsigned int set, unsigned int clear);
60static int option_send_setup (struct usb_serial_port *port);
61
62/* Vendor and product IDs */
63#define OPTION_VENDOR_ID 0x0AF0
64
65#define OPTION_PRODUCT_OLD 0x5000
66#define OPTION_PRODUCT_WLAN 0x6000
67
68static struct usb_device_id option_ids[] = {
69 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },
70 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_WLAN) },
71 { } /* Terminating entry */
72};
73
74MODULE_DEVICE_TABLE(usb, option_ids);
75
76static struct usb_driver option_driver = {
77 .owner = THIS_MODULE,
78 .name = "option",
79 .probe = usb_serial_probe,
80 .disconnect = usb_serial_disconnect,
81 .id_table = option_ids,
82};
83
84/* The card has three separate interfaces, wich the serial driver
85 * recognizes separately, thus num_port=1.
86 */
87static struct usb_serial_device_type option_3port_device = {
88 .owner = THIS_MODULE,
89 .name = "Option 3-port card",
90 .short_name = "option",
91 .id_table = option_ids,
92 .num_interrupt_in = NUM_DONT_CARE,
93 .num_bulk_in = NUM_DONT_CARE,
94 .num_bulk_out = NUM_DONT_CARE,
95 .num_ports = 1, /* 3 */
96 .open = option_open,
97 .close = option_close,
98 .write = option_write,
99 .write_room = option_write_room,
100 .chars_in_buffer = option_chars_in_buffer,
101 .throttle = option_rx_throttle,
102 .unthrottle = option_rx_unthrottle,
103 .ioctl = option_ioctl,
104 .set_termios = option_set_termios,
105 .break_ctl = option_break_ctl,
106 .tiocmget = option_tiocmget,
107 .tiocmset = option_tiocmset,
108 .attach = option_startup,
109 .shutdown = option_shutdown,
110 .read_int_callback = option_instat_callback,
111};
112
113static int debug;
114
115/* per port private data */
116
117#define N_IN_URB 4
118#define N_OUT_URB 1
119#define IN_BUFLEN 1024
120#define OUT_BUFLEN 1024
121
122struct option_port_private {
123 /* Input endpoints and buffer for this port */
124 struct urb *in_urbs[N_IN_URB];
125 char in_buffer[N_IN_URB][IN_BUFLEN];
126 /* Output endpoints and buffer for this port */
127 struct urb *out_urbs[N_OUT_URB];
128 char out_buffer[N_OUT_URB][OUT_BUFLEN];
129
130 /* Settings for the port */
131 int rts_state; /* Handshaking pins (outputs) */
132 int dtr_state;
133 int cts_state; /* Handshaking pins (inputs) */
134 int dsr_state;
135 int dcd_state;
136 int ri_state;
137 // int break_on;
138
139 unsigned long tx_start_time[N_OUT_URB];
140};
141
142
143/* Functions used by new usb-serial code. */
144static int __init
145option_init (void)
146{
147 int retval;
148 retval = usb_serial_register(&option_3port_device);
149 if (retval)
150 goto failed_3port_device_register;
151 retval = usb_register(&option_driver);
152 if (retval)
153 goto failed_driver_register;
154
155 info(DRIVER_DESC ": " DRIVER_VERSION);
156
157 return 0;
158
159failed_driver_register:
160 usb_serial_deregister (&option_3port_device);
161failed_3port_device_register:
162 return retval;
163}
164
165static void __exit
166option_exit (void)
167{
168 usb_deregister (&option_driver);
169 usb_serial_deregister (&option_3port_device);
170}
171
172module_init(option_init);
173module_exit(option_exit);
174
175static void
176option_rx_throttle (struct usb_serial_port *port)
177{
178 dbg("%s", __FUNCTION__);
179}
180
181
182static void
183option_rx_unthrottle (struct usb_serial_port *port)
184{
185 dbg("%s", __FUNCTION__);
186}
187
188
189static void
190option_break_ctl (struct usb_serial_port *port, int break_state)
191{
192 /* Unfortunately, I don't know how to send a break */
193 dbg("%s", __FUNCTION__);
194}
195
196
197static void
198option_set_termios (struct usb_serial_port *port,
199 struct termios *old_termios)
200{
201 dbg("%s", __FUNCTION__);
202
203 option_send_setup(port);
204}
205
206static int
207option_tiocmget(struct usb_serial_port *port, struct file *file)
208{
209 unsigned int value;
210 struct option_port_private *portdata;
211
212 portdata = usb_get_serial_port_data(port);
213
214 value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
215 ((portdata->dtr_state) ? TIOCM_DTR : 0) |
216 ((portdata->cts_state) ? TIOCM_CTS : 0) |
217 ((portdata->dsr_state) ? TIOCM_DSR : 0) |
218 ((portdata->dcd_state) ? TIOCM_CAR : 0) |
219 ((portdata->ri_state) ? TIOCM_RNG : 0);
220
221 return value;
222}
223
224static int
225option_tiocmset (struct usb_serial_port *port, struct file *file,
226 unsigned int set, unsigned int clear)
227{
228 struct option_port_private *portdata;
229
230 portdata = usb_get_serial_port_data(port);
231
232 if (set & TIOCM_RTS)
233 portdata->rts_state = 1;
234 if (set & TIOCM_DTR)
235 portdata->dtr_state = 1;
236
237 if (clear & TIOCM_RTS)
238 portdata->rts_state = 0;
239 if (clear & TIOCM_DTR)
240 portdata->dtr_state = 0;
241 return option_send_setup(port);
242}
243
244static int
245option_ioctl (struct usb_serial_port *port, struct file *file,
246 unsigned int cmd, unsigned long arg)
247{
248 return -ENOIOCTLCMD;
249}
250
251/* Write */
252static int
253option_write(struct usb_serial_port *port,
254 const unsigned char *buf, int count)
255{
256 struct option_port_private *portdata;
257 int i;
258 int left, todo;
259 struct urb *this_urb = NULL; /* spurious */
260 int err;
261
262 portdata = usb_get_serial_port_data(port);
263
264 dbg("%s: write (%d chars)", __FUNCTION__, count);
265
266#if 0
267 spin_lock(&port->lock);
268 if (port->write_urb_busy) {
269 spin_unlock(&port->lock);
270 dbg("%s: already writing", __FUNCTION__);
271 return 0;
272 }
273 port->write_urb_busy = 1;
274 spin_unlock(&port->lock);
275#endif
276
277 i = 0;
278 left = count;
279 while (left>0) {
280 todo = left;
281 if (todo > OUT_BUFLEN)
282 todo = OUT_BUFLEN;
283
284 for (;i < N_OUT_URB; i++) {
285 /* Check we have a valid urb/endpoint before we use it... */
286 this_urb = portdata->out_urbs[i];
287 if (this_urb->status != -EINPROGRESS)
288 break;
289 if (this_urb->transfer_flags & URB_ASYNC_UNLINK)
290 continue;
291 if (time_before(jiffies, portdata->tx_start_time[i] + 10 * HZ))
292 continue;
293 this_urb->transfer_flags |= URB_ASYNC_UNLINK;
294 usb_unlink_urb(this_urb);
295 }
296
297 if (i == N_OUT_URB) {
298 /* no bulk out free! */
299 dbg("%s: no output urb -- left %d", __FUNCTION__,count-left);
300#if 0
301 port->write_urb_busy = 0;
302#endif
303 return count-left;
304 }
305
306 dbg("%s: endpoint %d buf %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), i);
307
308 memcpy (this_urb->transfer_buffer, buf, todo);
309
310 /* send the data out the bulk port */
311 this_urb->transfer_buffer_length = todo;
312
313 this_urb->transfer_flags &= ~URB_ASYNC_UNLINK;
314 this_urb->dev = port->serial->dev;
315 err = usb_submit_urb(this_urb, GFP_ATOMIC);
316 if (err) {
317 dbg("usb_submit_urb %p (write bulk) failed (%d,, has %d)", this_urb, err, this_urb->status);
318 continue;
319 }
320 portdata->tx_start_time[i] = jiffies;
321 buf += todo;
322 left -= todo;
323 }
324
325 count -= left;
326#if 0
327 port->write_urb_busy = 0;
328#endif
329 dbg("%s: wrote (did %d)", __FUNCTION__, count);
330 return count;
331}
332
333static void
334option_indat_callback (struct urb *urb, struct pt_regs *regs)
335{
336 int i, err;
337 int endpoint;
338 struct usb_serial_port *port;
339 struct tty_struct *tty;
340 unsigned char *data = urb->transfer_buffer;
341
342 dbg("%s: %p", __FUNCTION__, urb);
343
344 endpoint = usb_pipeendpoint(urb->pipe);
345 port = (struct usb_serial_port *) urb->context;
346
347 if (urb->status) {
348 dbg("%s: nonzero status: %d on endpoint %02x.",
349 __FUNCTION__, urb->status, endpoint);
350 } else {
351 tty = port->tty;
352 if (urb->actual_length) {
353 for (i = 0; i < urb->actual_length ; ++i) {
354 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
355 tty_flip_buffer_push(tty);
356 tty_insert_flip_char(tty, data[i], 0);
357 }
358 tty_flip_buffer_push(tty);
359 } else {
360 dbg("%s: empty read urb received", __FUNCTION__);
361 }
362
363 /* Resubmit urb so we continue receiving */
364 if (port->open_count && urb->status != -ESHUTDOWN) {
365 err = usb_submit_urb(urb, GFP_ATOMIC);
366 if (err)
367 printk(KERN_ERR "%s: resubmit read urb failed. (%d)", __FUNCTION__, err);
368 }
369 }
370 return;
371}
372
373static void
374option_outdat_callback (struct urb *urb, struct pt_regs *regs)
375{
376 struct usb_serial_port *port;
377
378 dbg("%s", __FUNCTION__);
379
380 port = (struct usb_serial_port *) urb->context;
381
382 if (port->open_count)
383 schedule_work(&port->work);
384}
385
386static void
387option_instat_callback (struct urb *urb, struct pt_regs *regs)
388{
389 int err;
390 struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
391 struct option_port_private *portdata = usb_get_serial_port_data(port);
392 struct usb_serial *serial = port->serial;
393
394 dbg("%s", __FUNCTION__);
395 dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
396
397 if (urb->status == 0) {
398 struct usb_ctrlrequest *req_pkt =
399 (struct usb_ctrlrequest *)urb->transfer_buffer;
400
401 if (!req_pkt) {
402 dbg("%s: NULL req_pkt\n", __FUNCTION__);
403 return;
404 }
405 if ((req_pkt->bRequestType == 0xA1) && (req_pkt->bRequest == 0x20)) {
406 int old_dcd_state;
407 unsigned char signals = *((unsigned char *)
408 urb->transfer_buffer + sizeof(struct usb_ctrlrequest));
409
410 dbg("%s: signal x%x", __FUNCTION__, signals);
411
412 old_dcd_state = portdata->dcd_state;
413 portdata->cts_state = 1;
414 portdata->dcd_state = ((signals & 0x01) ? 1 : 0);
415 portdata->dsr_state = ((signals & 0x02) ? 1 : 0);
416 portdata->ri_state = ((signals & 0x08) ? 1 : 0);
417
418 if (port->tty && !C_CLOCAL(port->tty)
419 && old_dcd_state && !portdata->dcd_state) {
420 tty_hangup(port->tty);
421 }
422 } else
423 dbg("%s: type %x req %x", __FUNCTION__, req_pkt->bRequestType,req_pkt->bRequest);
424 } else
425 dbg("%s: error %d", __FUNCTION__, urb->status);
426
427 /* Resubmit urb so we continue receiving IRQ data */
428 if (urb->status != -ESHUTDOWN) {
429 urb->dev = serial->dev;
430 err = usb_submit_urb(urb, GFP_ATOMIC);
431 if (err)
432 dbg("%s: resubmit intr urb failed. (%d)", __FUNCTION__, err);
433 }
434}
435
436
437static int
438option_write_room (struct usb_serial_port *port)
439{
440 struct option_port_private *portdata;
441 int i;
442 int data_len = 0;
443 struct urb *this_urb;
444
445 portdata = usb_get_serial_port_data(port);
446
447 for (i=0; i < N_OUT_URB; i++)
448 this_urb = portdata->out_urbs[i];
449 if (this_urb && this_urb->status != -EINPROGRESS)
450 data_len += OUT_BUFLEN;
451
452 dbg("%s: %d", __FUNCTION__, data_len);
453 return data_len;
454}
455
456
457static int
458option_chars_in_buffer (struct usb_serial_port *port)
459{
460 struct option_port_private *portdata;
461 int i;
462 int data_len = 0;
463 struct urb *this_urb;
464
465 portdata = usb_get_serial_port_data(port);
466
467 for (i=0; i < N_OUT_URB; i++)
468 this_urb = portdata->out_urbs[i];
469 if (this_urb && this_urb->status == -EINPROGRESS)
470 data_len += this_urb->transfer_buffer_length;
471
472 dbg("%s: %d", __FUNCTION__, data_len);
473 return data_len;
474}
475
476
477static int
478option_open (struct usb_serial_port *port, struct file *filp)
479{
480 struct option_port_private *portdata;
481 struct usb_serial *serial = port->serial;
482 int i, err;
483 struct urb *urb;
484
485 portdata = usb_get_serial_port_data(port);
486
487 dbg("%s", __FUNCTION__);
488
489 /* Set some sane defaults */
490 portdata->rts_state = 1;
491 portdata->dtr_state = 1;
492
493 /* Reset low level data toggle and start reading from endpoints */
494 for (i = 0; i < N_IN_URB; i++) {
495 urb = portdata->in_urbs[i];
496 if (! urb)
497 continue;
498 if (urb->dev != serial->dev) {
499 dbg("%s: dev %p != %p", __FUNCTION__, urb->dev, serial->dev);
500 continue;
501 }
502
503 /* make sure endpoint data toggle is synchronized with the device */
504
505 usb_clear_halt(urb->dev, urb->pipe);
506
507 err = usb_submit_urb(urb, GFP_KERNEL);
508 if (err) {
509 dbg("%s: submit urb %d failed (%d) %d", __FUNCTION__, i, err,
510 urb->transfer_buffer_length);
511 }
512 }
513
514 /* Reset low level data toggle on out endpoints */
515 for (i = 0; i < N_OUT_URB; i++) {
516 urb = portdata->out_urbs[i];
517 if (! urb)
518 continue;
519 urb->dev = serial->dev;
520 /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */
521 }
522
523 port->tty->low_latency = 1;
524
525 option_send_setup(port);
526
527 return (0);
528}
529
530static inline void
531stop_urb(struct urb *urb)
532{
533 if (urb && urb->status == -EINPROGRESS) {
534 urb->transfer_flags &= ~URB_ASYNC_UNLINK;
535 usb_kill_urb(urb);
536 }
537}
538
539static void
540option_close(struct usb_serial_port *port, struct file *filp)
541{
542 int i;
543 struct usb_serial *serial = port->serial;
544 struct option_port_private *portdata;
545
546 dbg("%s", __FUNCTION__);
547 portdata = usb_get_serial_port_data(port);
548
549 portdata->rts_state = 0;
550 portdata->dtr_state = 0;
551
552 if (serial->dev) {
553 option_send_setup(port);
554
555 /* Stop reading/writing urbs */
556 for (i = 0; i < N_IN_URB; i++)
557 stop_urb(portdata->in_urbs[i]);
558 for (i = 0; i < N_OUT_URB; i++)
559 stop_urb(portdata->out_urbs[i]);
560 }
561 port->tty = NULL;
562}
563
564
565/* Helper functions used by option_setup_urbs */
566static struct urb *
567option_setup_urb (struct usb_serial *serial, int endpoint,
568 int dir, void *ctx, char *buf, int len,
569 void (*callback)(struct urb *, struct pt_regs *regs))
570{
571 struct urb *urb;
572
573 if (endpoint == -1)
574 return NULL; /* endpoint not needed */
575
576 urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
577 if (urb == NULL) {
578 dbg("%s: alloc for endpoint %d failed.", __FUNCTION__, endpoint);
579 return NULL;
580 }
581
582 /* Fill URB using supplied data. */
583 usb_fill_bulk_urb(urb, serial->dev,
584 usb_sndbulkpipe(serial->dev, endpoint) | dir,
585 buf, len, callback, ctx);
586
587 return urb;
588}
589
590/* Setup urbs */
591static void
592option_setup_urbs(struct usb_serial *serial)
593{
594 int j;
595 struct usb_serial_port *port;
596 struct option_port_private *portdata;
597
598 dbg("%s", __FUNCTION__);
599
600 port = serial->port[0];
601 portdata = usb_get_serial_port_data(port);
602
603 /* Do indat endpoints first */
604 for (j = 0; j <= N_IN_URB; ++j) {
605 portdata->in_urbs[j] = option_setup_urb (serial,
606 port->bulk_in_endpointAddress, USB_DIR_IN, port,
607 portdata->in_buffer[j], IN_BUFLEN, option_indat_callback);
608 }
609
610 /* outdat endpoints */
611 for (j = 0; j <= N_OUT_URB; ++j) {
612 portdata->out_urbs[j] = option_setup_urb (serial,
613 port->bulk_out_endpointAddress, USB_DIR_OUT, port,
614 portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback);
615 }
616}
617
618
619static int
620option_send_setup(struct usb_serial_port *port)
621{
622 struct usb_serial *serial = port->serial;
623 struct option_port_private *portdata;
624
625 dbg("%s", __FUNCTION__);
626
627 portdata = usb_get_serial_port_data(port);
628
629 if (port->tty) {
630 int val = 0;
631 if (portdata->dtr_state)
632 val |= 0x01;
633 if (portdata->rts_state)
634 val |= 0x02;
635
636 return usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
637 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT);
638 }
639
640 return 0;
641}
642
643
644static int
645option_startup (struct usb_serial *serial)
646{
647 int i, err;
648 struct usb_serial_port *port;
649 struct option_port_private *portdata;
650
651 dbg("%s", __FUNCTION__);
652
653 /* Now setup per port private data */
654 for (i = 0; i < serial->num_ports; i++) {
655 port = serial->port[i];
656 portdata = kmalloc(sizeof(struct option_port_private), GFP_KERNEL);
657 if (!portdata) {
658 dbg("%s: kmalloc for option_port_private (%d) failed!.", __FUNCTION__, i);
659 return (1);
660 }
661 memset(portdata, 0, sizeof(struct option_port_private));
662
663 usb_set_serial_port_data(port, portdata);
664
665 if (! port->interrupt_in_urb)
666 continue;
667 err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
668 if (err)
669 dbg("%s: submit irq_in urb failed %d", __FUNCTION__, err);
670 }
671
672 option_setup_urbs(serial);
673
674 return (0);
675}
676
677static void
678option_shutdown (struct usb_serial *serial)
679{
680 int i, j;
681 struct usb_serial_port *port;
682 struct option_port_private *portdata;
683
684 dbg("%s", __FUNCTION__);
685
686 /* Stop reading/writing urbs */
687 for (i = 0; i < serial->num_ports; ++i) {
688 port = serial->port[i];
689 portdata = usb_get_serial_port_data(port);
690 for (j = 0; j < N_IN_URB; j++)
691 stop_urb(portdata->in_urbs[j]);
692 for (j = 0; j < N_OUT_URB; j++)
693 stop_urb(portdata->out_urbs[j]);
694 }
695
696 /* Now free them */
697 for (i = 0; i < serial->num_ports; ++i) {
698 port = serial->port[i];
699 portdata = usb_get_serial_port_data(port);
700
701 for (j = 0; j < N_IN_URB; j++) {
702 if (portdata->in_urbs[j]) {
703 usb_free_urb(portdata->in_urbs[j]);
704 portdata->in_urbs[j] = NULL;
705 }
706 }
707 for (j = 0; j < N_OUT_URB; j++) {
708 if (portdata->out_urbs[j]) {
709 usb_free_urb(portdata->out_urbs[j]);
710 portdata->out_urbs[j] = NULL;
711 }
712 }
713 }
714
715 /* Now free per port private data */
716 for (i = 0; i < serial->num_ports; i++) {
717 port = serial->port[i];
718 kfree(usb_get_serial_port_data(port));
719 }
720}
721
722MODULE_AUTHOR(DRIVER_AUTHOR);
723MODULE_DESCRIPTION(DRIVER_DESC);
724MODULE_VERSION(DRIVER_VERSION);
725MODULE_LICENSE("GPL");
726
727module_param(debug, bool, S_IRUGO | S_IWUSR);
728MODULE_PARM_DESC(debug, "Debug messages");
729
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index d2891f475793..9fcc7bd1fbe4 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -862,6 +862,15 @@ UNUSUAL_DEV( 0x090a, 0x1001, 0x0100, 0x0100,
862 US_SC_DEVICE, US_PR_BULK, NULL, 862 US_SC_DEVICE, US_PR_BULK, NULL,
863 US_FL_NEED_OVERRIDE ), 863 US_FL_NEED_OVERRIDE ),
864 864
865/* Reported by Filippo Bardelli <filibard@libero.it>
866 * The device reports a subclass of RBC, which is wrong.
867 */
868UNUSUAL_DEV( 0x090a, 0x1050, 0x0100, 0x0100,
869 "Trumpion Microelectronics, Inc.",
870 "33520 USB Digital Voice Recorder",
871 US_SC_UFI, US_PR_DEVICE, NULL,
872 0),
873
865/* Trumpion Microelectronics MP3 player (felipe_alfaro@linuxmail.org) */ 874/* Trumpion Microelectronics MP3 player (felipe_alfaro@linuxmail.org) */
866UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999, 875UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999,
867 "Trumpion", 876 "Trumpion",
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index ee25b9e8db60..47a6b12bc968 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -2374,10 +2374,9 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
2374 } while ( rinfo->fb_base == 0 && 2374 } while ( rinfo->fb_base == 0 &&
2375 ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) ); 2375 ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) );
2376 2376
2377 if (rinfo->fb_base) 2377 if (rinfo->fb_base == NULL) {
2378 memset_io(rinfo->fb_base, 0, rinfo->mapped_vram); 2378 printk (KERN_ERR "radeonfb (%s): cannot map FB\n",
2379 else { 2379 pci_name(rinfo->pdev));
2380 printk (KERN_ERR "radeonfb (%s): cannot map FB\n", pci_name(rinfo->pdev));
2381 ret = -EIO; 2380 ret = -EIO;
2382 goto err_unmap_rom; 2381 goto err_unmap_rom;
2383 } 2382 }
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index c78a2c5961d3..277d733c6d00 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -241,7 +241,7 @@ static ssize_t show_virtual(struct class_device *class_device, char *buf)
241 struct fb_info *fb_info = 241 struct fb_info *fb_info =
242 (struct fb_info *)class_get_devdata(class_device); 242 (struct fb_info *)class_get_devdata(class_device);
243 return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual, 243 return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual,
244 fb_info->var.xres_virtual); 244 fb_info->var.yres_virtual);
245} 245}
246 246
247static ssize_t store_cmap(struct class_device *class_device, const char * buf, 247static ssize_t store_cmap(struct class_device *class_device, const char * buf,
diff --git a/drivers/video/macmodes.c b/drivers/video/macmodes.c
index de5a0f383600..2fc71081f7e7 100644
--- a/drivers/video/macmodes.c
+++ b/drivers/video/macmodes.c
@@ -387,3 +387,4 @@ int __init mac_find_mode(struct fb_var_screeninfo *var, struct fb_info *info,
387} 387}
388EXPORT_SYMBOL(mac_find_mode); 388EXPORT_SYMBOL(mac_find_mode);
389 389
390MODULE_LICENSE("GPL");
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index c374be51b041..f8f6b6b76179 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1125,7 +1125,7 @@ static int dump_write(struct file *file, const void *addr, int nr)
1125 return file->f_op->write(file, addr, nr, &file->f_pos) == nr; 1125 return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
1126} 1126}
1127 1127
1128static int dump_seek(struct file *file, off_t off) 1128static int dump_seek(struct file *file, loff_t off)
1129{ 1129{
1130 if (file->f_op->llseek) { 1130 if (file->f_op->llseek) {
1131 if (file->f_op->llseek(file, off, 0) != off) 1131 if (file->f_op->llseek(file, off, 0) != off)
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index f0cd67d9d31b..c8998dc66882 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -520,7 +520,7 @@ static int load_flat_file(struct linux_binprm * bprm,
520 DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n"); 520 DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n");
521 521
522 down_write(&current->mm->mmap_sem); 522 down_write(&current->mm->mmap_sem);
523 textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, 0, 0); 523 textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, MAP_SHARED, 0);
524 up_write(&current->mm->mmap_sem); 524 up_write(&current->mm->mmap_sem);
525 if (!textpos || textpos >= (unsigned long) -4096) { 525 if (!textpos || textpos >= (unsigned long) -4096) {
526 if (!textpos) 526 if (!textpos)
@@ -532,7 +532,7 @@ static int load_flat_file(struct linux_binprm * bprm,
532 down_write(&current->mm->mmap_sem); 532 down_write(&current->mm->mmap_sem);
533 realdatastart = do_mmap(0, 0, data_len + extra + 533 realdatastart = do_mmap(0, 0, data_len + extra +
534 MAX_SHARED_LIBS * sizeof(unsigned long), 534 MAX_SHARED_LIBS * sizeof(unsigned long),
535 PROT_READ|PROT_WRITE|PROT_EXEC, 0, 0); 535 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
536 up_write(&current->mm->mmap_sem); 536 up_write(&current->mm->mmap_sem);
537 537
538 if (realdatastart == 0 || realdatastart >= (unsigned long)-4096) { 538 if (realdatastart == 0 || realdatastart >= (unsigned long)-4096) {
@@ -574,7 +574,7 @@ static int load_flat_file(struct linux_binprm * bprm,
574 down_write(&current->mm->mmap_sem); 574 down_write(&current->mm->mmap_sem);
575 textpos = do_mmap(0, 0, text_len + data_len + extra + 575 textpos = do_mmap(0, 0, text_len + data_len + extra +
576 MAX_SHARED_LIBS * sizeof(unsigned long), 576 MAX_SHARED_LIBS * sizeof(unsigned long),
577 PROT_READ | PROT_EXEC | PROT_WRITE, 0, 0); 577 PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
578 up_write(&current->mm->mmap_sem); 578 up_write(&current->mm->mmap_sem);
579 if (!textpos || textpos >= (unsigned long) -4096) { 579 if (!textpos || textpos >= (unsigned long) -4096) {
580 if (!textpos) 580 if (!textpos)
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 95483baab706..dab4774ee7bb 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -6,7 +6,8 @@ kills the cifsd thread (NB: killing the cifs kernel threads is not
6recommended, unmount and rmmod cifs will kill them when they are 6recommended, unmount and rmmod cifs will kill them when they are
7no longer needed). Fix readdir to ASCII servers (ie older servers 7no longer needed). Fix readdir to ASCII servers (ie older servers
8which do not support Unicode) and also require asterik. 8which do not support Unicode) and also require asterik.
9 9Fix out of memory case in which data could be written one page
10off in the page cache.
10 11
11Version 1.33 12Version 1.33
12------------ 13------------
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index d00b3bfe1a52..78af5850c558 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -96,5 +96,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
96extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); 96extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
97extern int cifs_ioctl (struct inode * inode, struct file * filep, 97extern int cifs_ioctl (struct inode * inode, struct file * filep,
98 unsigned int command, unsigned long arg); 98 unsigned int command, unsigned long arg);
99#define CIFS_VERSION "1.34" 99#define CIFS_VERSION "1.35"
100#endif /* _CIFSFS_H */ 100#endif /* _CIFSFS_H */
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index dde2d251fc3d..30ab70ce5547 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1352,6 +1352,8 @@ static void cifs_copy_cache_pages(struct address_space *mapping,
1352 GFP_KERNEL)) { 1352 GFP_KERNEL)) {
1353 page_cache_release(page); 1353 page_cache_release(page);
1354 cFYI(1, ("Add page cache failed")); 1354 cFYI(1, ("Add page cache failed"));
1355 data += PAGE_CACHE_SIZE;
1356 bytes_read -= PAGE_CACHE_SIZE;
1355 continue; 1357 continue;
1356 } 1358 }
1357 1359
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index b8b78cbb34c9..8d336a900255 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -82,12 +82,12 @@ int cifs_get_inode_info_unix(struct inode **pinode,
82 /* get new inode */ 82 /* get new inode */
83 if (*pinode == NULL) { 83 if (*pinode == NULL) {
84 *pinode = new_inode(sb); 84 *pinode = new_inode(sb);
85 if(*pinode == NULL) 85 if (*pinode == NULL)
86 return -ENOMEM; 86 return -ENOMEM;
87 /* Is an i_ino of zero legal? */ 87 /* Is an i_ino of zero legal? */
88 /* Are there sanity checks we can use to ensure that 88 /* Are there sanity checks we can use to ensure that
89 the server is really filling in that field? */ 89 the server is really filling in that field? */
90 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 90 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
91 (*pinode)->i_ino = 91 (*pinode)->i_ino =
92 (unsigned long)findData.UniqueId; 92 (unsigned long)findData.UniqueId;
93 } /* note ino incremented to unique num in new_inode */ 93 } /* note ino incremented to unique num in new_inode */
@@ -134,7 +134,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
134 inode->i_gid = le64_to_cpu(findData.Gid); 134 inode->i_gid = le64_to_cpu(findData.Gid);
135 inode->i_nlink = le64_to_cpu(findData.Nlinks); 135 inode->i_nlink = le64_to_cpu(findData.Nlinks);
136 136
137 if(is_size_safe_to_change(cifsInfo)) { 137 if (is_size_safe_to_change(cifsInfo)) {
138 /* can not safely change the file size here if the 138 /* can not safely change the file size here if the
139 client is writing to it due to potential races */ 139 client is writing to it due to potential races */
140 140
@@ -162,7 +162,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
162 if (S_ISREG(inode->i_mode)) { 162 if (S_ISREG(inode->i_mode)) {
163 cFYI(1, (" File inode ")); 163 cFYI(1, (" File inode "));
164 inode->i_op = &cifs_file_inode_ops; 164 inode->i_op = &cifs_file_inode_ops;
165 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) 165 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
166 inode->i_fop = &cifs_file_direct_ops; 166 inode->i_fop = &cifs_file_direct_ops;
167 else 167 else
168 inode->i_fop = &cifs_file_ops; 168 inode->i_fop = &cifs_file_ops;
@@ -198,17 +198,17 @@ int cifs_get_inode_info(struct inode **pinode,
198 pTcon = cifs_sb->tcon; 198 pTcon = cifs_sb->tcon;
199 cFYI(1,("Getting info on %s ", search_path)); 199 cFYI(1,("Getting info on %s ", search_path));
200 200
201 if((pfindData == NULL) && (*pinode != NULL)) { 201 if ((pfindData == NULL) && (*pinode != NULL)) {
202 if(CIFS_I(*pinode)->clientCanCacheRead) { 202 if (CIFS_I(*pinode)->clientCanCacheRead) {
203 cFYI(1,("No need to revalidate cached inode sizes")); 203 cFYI(1,("No need to revalidate cached inode sizes"));
204 return rc; 204 return rc;
205 } 205 }
206 } 206 }
207 207
208 /* if file info not passed in then get it from server */ 208 /* if file info not passed in then get it from server */
209 if(pfindData == NULL) { 209 if (pfindData == NULL) {
210 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); 210 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
211 if(buf == NULL) 211 if (buf == NULL)
212 return -ENOMEM; 212 return -ENOMEM;
213 pfindData = (FILE_ALL_INFO *)buf; 213 pfindData = (FILE_ALL_INFO *)buf;
214 /* could do find first instead but this returns more info */ 214 /* could do find first instead but this returns more info */
@@ -268,7 +268,7 @@ int cifs_get_inode_info(struct inode **pinode,
268 IndexNumber field is not guaranteed unique? */ 268 IndexNumber field is not guaranteed unique? */
269 269
270#ifdef CONFIG_CIFS_EXPERIMENTAL 270#ifdef CONFIG_CIFS_EXPERIMENTAL
271 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM){ 271 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM){
272 int rc1 = 0; 272 int rc1 = 0;
273 __u64 inode_num; 273 __u64 inode_num;
274 274
@@ -277,7 +277,7 @@ int cifs_get_inode_info(struct inode **pinode,
277 cifs_sb->local_nls, 277 cifs_sb->local_nls,
278 cifs_sb->mnt_cifs_flags & 278 cifs_sb->mnt_cifs_flags &
279 CIFS_MOUNT_MAP_SPECIAL_CHR); 279 CIFS_MOUNT_MAP_SPECIAL_CHR);
280 if(rc1) { 280 if (rc1) {
281 cFYI(1,("GetSrvInodeNum rc %d", rc1)); 281 cFYI(1,("GetSrvInodeNum rc %d", rc1));
282 /* BB EOPNOSUPP disable SERVER_INUM? */ 282 /* BB EOPNOSUPP disable SERVER_INUM? */
283 } else /* do we need cast or hash to ino? */ 283 } else /* do we need cast or hash to ino? */
@@ -355,7 +355,7 @@ int cifs_get_inode_info(struct inode **pinode,
355 if (S_ISREG(inode->i_mode)) { 355 if (S_ISREG(inode->i_mode)) {
356 cFYI(1, (" File inode ")); 356 cFYI(1, (" File inode "));
357 inode->i_op = &cifs_file_inode_ops; 357 inode->i_op = &cifs_file_inode_ops;
358 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) 358 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
359 inode->i_fop = &cifs_file_direct_ops; 359 inode->i_fop = &cifs_file_direct_ops;
360 else 360 else
361 inode->i_fop = &cifs_file_ops; 361 inode->i_fop = &cifs_file_ops;
@@ -422,7 +422,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
422 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 422 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
423 423
424 if (!rc) { 424 if (!rc) {
425 if(direntry->d_inode) 425 if (direntry->d_inode)
426 direntry->d_inode->i_nlink--; 426 direntry->d_inode->i_nlink--;
427 } else if (rc == -ENOENT) { 427 } else if (rc == -ENOENT) {
428 d_drop(direntry); 428 d_drop(direntry);
@@ -441,7 +441,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
441 cifs_sb->mnt_cifs_flags & 441 cifs_sb->mnt_cifs_flags &
442 CIFS_MOUNT_MAP_SPECIAL_CHR); 442 CIFS_MOUNT_MAP_SPECIAL_CHR);
443 CIFSSMBClose(xid, pTcon, netfid); 443 CIFSSMBClose(xid, pTcon, netfid);
444 if(direntry->d_inode) 444 if (direntry->d_inode)
445 direntry->d_inode->i_nlink--; 445 direntry->d_inode->i_nlink--;
446 } 446 }
447 } else if (rc == -EACCES) { 447 } else if (rc == -EACCES) {
@@ -496,7 +496,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
496 cifs_sb->mnt_cifs_flags & 496 cifs_sb->mnt_cifs_flags &
497 CIFS_MOUNT_MAP_SPECIAL_CHR); 497 CIFS_MOUNT_MAP_SPECIAL_CHR);
498 if (!rc) { 498 if (!rc) {
499 if(direntry->d_inode) 499 if (direntry->d_inode)
500 direntry->d_inode->i_nlink--; 500 direntry->d_inode->i_nlink--;
501 } else if (rc == -ETXTBSY) { 501 } else if (rc == -ETXTBSY) {
502 int oplock = FALSE; 502 int oplock = FALSE;
@@ -517,14 +517,14 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
517 cifs_sb->mnt_cifs_flags & 517 cifs_sb->mnt_cifs_flags &
518 CIFS_MOUNT_MAP_SPECIAL_CHR); 518 CIFS_MOUNT_MAP_SPECIAL_CHR);
519 CIFSSMBClose(xid, pTcon, netfid); 519 CIFSSMBClose(xid, pTcon, netfid);
520 if(direntry->d_inode) 520 if (direntry->d_inode)
521 direntry->d_inode->i_nlink--; 521 direntry->d_inode->i_nlink--;
522 } 522 }
523 /* BB if rc = -ETXTBUSY goto the rename logic BB */ 523 /* BB if rc = -ETXTBUSY goto the rename logic BB */
524 } 524 }
525 } 525 }
526 } 526 }
527 if(direntry->d_inode) { 527 if (direntry->d_inode) {
528 cifsInode = CIFS_I(direntry->d_inode); 528 cifsInode = CIFS_I(direntry->d_inode);
529 cifsInode->time = 0; /* will force revalidate to get info 529 cifsInode->time = 0; /* will force revalidate to get info
530 when needed */ 530 when needed */
@@ -582,7 +582,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
582 if (direntry->d_inode) 582 if (direntry->d_inode)
583 direntry->d_inode->i_nlink = 2; 583 direntry->d_inode->i_nlink = 2;
584 if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) 584 if (cifs_sb->tcon->ses->capabilities & CAP_UNIX)
585 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { 585 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
586 CIFSSMBUnixSetPerms(xid, pTcon, full_path, 586 CIFSSMBUnixSetPerms(xid, pTcon, full_path,
587 mode, 587 mode,
588 (__u64)current->euid, 588 (__u64)current->euid,
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index 98d830401c56..5a97e346bd95 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -188,7 +188,6 @@ static int __cleanup_transaction(journal_t *journal, transaction_t *transaction)
188 } else { 188 } else {
189 jbd_unlock_bh_state(bh); 189 jbd_unlock_bh_state(bh);
190 } 190 }
191 jh = next_jh;
192 } while (jh != last_jh); 191 } while (jh != last_jh);
193 192
194 return ret; 193 return ret;
@@ -339,8 +338,10 @@ int log_do_checkpoint(journal_t *journal)
339 } 338 }
340 } while (jh != last_jh && !retry); 339 } while (jh != last_jh && !retry);
341 340
342 if (batch_count) 341 if (batch_count) {
343 __flush_batch(journal, bhs, &batch_count); 342 __flush_batch(journal, bhs, &batch_count);
343 retry = 1;
344 }
344 345
345 /* 346 /*
346 * If someone cleaned up this transaction while we slept, we're 347 * If someone cleaned up this transaction while we slept, we're
diff --git a/fs/mpage.c b/fs/mpage.c
index b92c0e64aefa..bb9aebe93862 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -79,8 +79,11 @@ static int mpage_end_io_write(struct bio *bio, unsigned int bytes_done, int err)
79 if (--bvec >= bio->bi_io_vec) 79 if (--bvec >= bio->bi_io_vec)
80 prefetchw(&bvec->bv_page->flags); 80 prefetchw(&bvec->bv_page->flags);
81 81
82 if (!uptodate) 82 if (!uptodate){
83 SetPageError(page); 83 SetPageError(page);
84 if (page->mapping)
85 set_bit(AS_EIO, &page->mapping->flags);
86 }
84 end_page_writeback(page); 87 end_page_writeback(page);
85 } while (bvec >= bio->bi_io_vec); 88 } while (bvec >= bio->bi_io_vec);
86 bio_put(bio); 89 bio_put(bio);
diff --git a/fs/namei.c b/fs/namei.c
index dd78f01b6de8..a7f7f44119b3 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -493,12 +493,21 @@ fail:
493 return PTR_ERR(link); 493 return PTR_ERR(link);
494} 494}
495 495
496static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd) 496struct path {
497 struct vfsmount *mnt;
498 struct dentry *dentry;
499};
500
501static inline int __do_follow_link(struct path *path, struct nameidata *nd)
497{ 502{
498 int error; 503 int error;
504 struct dentry *dentry = path->dentry;
499 505
500 touch_atime(nd->mnt, dentry); 506 touch_atime(path->mnt, dentry);
501 nd_set_link(nd, NULL); 507 nd_set_link(nd, NULL);
508
509 if (path->mnt == nd->mnt)
510 mntget(path->mnt);
502 error = dentry->d_inode->i_op->follow_link(dentry, nd); 511 error = dentry->d_inode->i_op->follow_link(dentry, nd);
503 if (!error) { 512 if (!error) {
504 char *s = nd_get_link(nd); 513 char *s = nd_get_link(nd);
@@ -507,6 +516,8 @@ static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd)
507 if (dentry->d_inode->i_op->put_link) 516 if (dentry->d_inode->i_op->put_link)
508 dentry->d_inode->i_op->put_link(dentry, nd); 517 dentry->d_inode->i_op->put_link(dentry, nd);
509 } 518 }
519 dput(dentry);
520 mntput(path->mnt);
510 521
511 return error; 522 return error;
512} 523}
@@ -518,7 +529,7 @@ static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd)
518 * Without that kind of total limit, nasty chains of consecutive 529 * Without that kind of total limit, nasty chains of consecutive
519 * symlinks can cause almost arbitrarily long lookups. 530 * symlinks can cause almost arbitrarily long lookups.
520 */ 531 */
521static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd) 532static inline int do_follow_link(struct path *path, struct nameidata *nd)
522{ 533{
523 int err = -ELOOP; 534 int err = -ELOOP;
524 if (current->link_count >= MAX_NESTED_LINKS) 535 if (current->link_count >= MAX_NESTED_LINKS)
@@ -527,17 +538,20 @@ static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
527 goto loop; 538 goto loop;
528 BUG_ON(nd->depth >= MAX_NESTED_LINKS); 539 BUG_ON(nd->depth >= MAX_NESTED_LINKS);
529 cond_resched(); 540 cond_resched();
530 err = security_inode_follow_link(dentry, nd); 541 err = security_inode_follow_link(path->dentry, nd);
531 if (err) 542 if (err)
532 goto loop; 543 goto loop;
533 current->link_count++; 544 current->link_count++;
534 current->total_link_count++; 545 current->total_link_count++;
535 nd->depth++; 546 nd->depth++;
536 err = __do_follow_link(dentry, nd); 547 err = __do_follow_link(path, nd);
537 current->link_count--; 548 current->link_count--;
538 nd->depth--; 549 nd->depth--;
539 return err; 550 return err;
540loop: 551loop:
552 dput(path->dentry);
553 if (path->mnt != nd->mnt)
554 mntput(path->mnt);
541 path_release(nd); 555 path_release(nd);
542 return err; 556 return err;
543} 557}
@@ -565,87 +579,91 @@ int follow_up(struct vfsmount **mnt, struct dentry **dentry)
565/* no need for dcache_lock, as serialization is taken care in 579/* no need for dcache_lock, as serialization is taken care in
566 * namespace.c 580 * namespace.c
567 */ 581 */
568static int follow_mount(struct vfsmount **mnt, struct dentry **dentry) 582static int __follow_mount(struct path *path)
569{ 583{
570 int res = 0; 584 int res = 0;
585 while (d_mountpoint(path->dentry)) {
586 struct vfsmount *mounted = lookup_mnt(path->mnt, path->dentry);
587 if (!mounted)
588 break;
589 dput(path->dentry);
590 if (res)
591 mntput(path->mnt);
592 path->mnt = mounted;
593 path->dentry = dget(mounted->mnt_root);
594 res = 1;
595 }
596 return res;
597}
598
599static void follow_mount(struct vfsmount **mnt, struct dentry **dentry)
600{
571 while (d_mountpoint(*dentry)) { 601 while (d_mountpoint(*dentry)) {
572 struct vfsmount *mounted = lookup_mnt(*mnt, *dentry); 602 struct vfsmount *mounted = lookup_mnt(*mnt, *dentry);
573 if (!mounted) 603 if (!mounted)
574 break; 604 break;
605 dput(*dentry);
575 mntput(*mnt); 606 mntput(*mnt);
576 *mnt = mounted; 607 *mnt = mounted;
577 dput(*dentry);
578 *dentry = dget(mounted->mnt_root); 608 *dentry = dget(mounted->mnt_root);
579 res = 1;
580 } 609 }
581 return res;
582} 610}
583 611
584/* no need for dcache_lock, as serialization is taken care in 612/* no need for dcache_lock, as serialization is taken care in
585 * namespace.c 613 * namespace.c
586 */ 614 */
587static inline int __follow_down(struct vfsmount **mnt, struct dentry **dentry) 615int follow_down(struct vfsmount **mnt, struct dentry **dentry)
588{ 616{
589 struct vfsmount *mounted; 617 struct vfsmount *mounted;
590 618
591 mounted = lookup_mnt(*mnt, *dentry); 619 mounted = lookup_mnt(*mnt, *dentry);
592 if (mounted) { 620 if (mounted) {
621 dput(*dentry);
593 mntput(*mnt); 622 mntput(*mnt);
594 *mnt = mounted; 623 *mnt = mounted;
595 dput(*dentry);
596 *dentry = dget(mounted->mnt_root); 624 *dentry = dget(mounted->mnt_root);
597 return 1; 625 return 1;
598 } 626 }
599 return 0; 627 return 0;
600} 628}
601 629
602int follow_down(struct vfsmount **mnt, struct dentry **dentry) 630static inline void follow_dotdot(struct nameidata *nd)
603{
604 return __follow_down(mnt,dentry);
605}
606
607static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry)
608{ 631{
609 while(1) { 632 while(1) {
610 struct vfsmount *parent; 633 struct vfsmount *parent;
611 struct dentry *old = *dentry; 634 struct dentry *old = nd->dentry;
612 635
613 read_lock(&current->fs->lock); 636 read_lock(&current->fs->lock);
614 if (*dentry == current->fs->root && 637 if (nd->dentry == current->fs->root &&
615 *mnt == current->fs->rootmnt) { 638 nd->mnt == current->fs->rootmnt) {
616 read_unlock(&current->fs->lock); 639 read_unlock(&current->fs->lock);
617 break; 640 break;
618 } 641 }
619 read_unlock(&current->fs->lock); 642 read_unlock(&current->fs->lock);
620 spin_lock(&dcache_lock); 643 spin_lock(&dcache_lock);
621 if (*dentry != (*mnt)->mnt_root) { 644 if (nd->dentry != nd->mnt->mnt_root) {
622 *dentry = dget((*dentry)->d_parent); 645 nd->dentry = dget(nd->dentry->d_parent);
623 spin_unlock(&dcache_lock); 646 spin_unlock(&dcache_lock);
624 dput(old); 647 dput(old);
625 break; 648 break;
626 } 649 }
627 spin_unlock(&dcache_lock); 650 spin_unlock(&dcache_lock);
628 spin_lock(&vfsmount_lock); 651 spin_lock(&vfsmount_lock);
629 parent = (*mnt)->mnt_parent; 652 parent = nd->mnt->mnt_parent;
630 if (parent == *mnt) { 653 if (parent == nd->mnt) {
631 spin_unlock(&vfsmount_lock); 654 spin_unlock(&vfsmount_lock);
632 break; 655 break;
633 } 656 }
634 mntget(parent); 657 mntget(parent);
635 *dentry = dget((*mnt)->mnt_mountpoint); 658 nd->dentry = dget(nd->mnt->mnt_mountpoint);
636 spin_unlock(&vfsmount_lock); 659 spin_unlock(&vfsmount_lock);
637 dput(old); 660 dput(old);
638 mntput(*mnt); 661 mntput(nd->mnt);
639 *mnt = parent; 662 nd->mnt = parent;
640 } 663 }
641 follow_mount(mnt, dentry); 664 follow_mount(&nd->mnt, &nd->dentry);
642} 665}
643 666
644struct path {
645 struct vfsmount *mnt;
646 struct dentry *dentry;
647};
648
649/* 667/*
650 * It's more convoluted than I'd like it to be, but... it's still fairly 668 * It's more convoluted than I'd like it to be, but... it's still fairly
651 * small and for now I'd prefer to have fast path as straight as possible. 669 * small and for now I'd prefer to have fast path as straight as possible.
@@ -664,6 +682,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
664done: 682done:
665 path->mnt = mnt; 683 path->mnt = mnt;
666 path->dentry = dentry; 684 path->dentry = dentry;
685 __follow_mount(path);
667 return 0; 686 return 0;
668 687
669need_lookup: 688need_lookup:
@@ -751,7 +770,7 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
751 case 2: 770 case 2:
752 if (this.name[1] != '.') 771 if (this.name[1] != '.')
753 break; 772 break;
754 follow_dotdot(&nd->mnt, &nd->dentry); 773 follow_dotdot(nd);
755 inode = nd->dentry->d_inode; 774 inode = nd->dentry->d_inode;
756 /* fallthrough */ 775 /* fallthrough */
757 case 1: 776 case 1:
@@ -771,8 +790,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
771 err = do_lookup(nd, &this, &next); 790 err = do_lookup(nd, &this, &next);
772 if (err) 791 if (err)
773 break; 792 break;
774 /* Check mountpoints.. */
775 follow_mount(&next.mnt, &next.dentry);
776 793
777 err = -ENOENT; 794 err = -ENOENT;
778 inode = next.dentry->d_inode; 795 inode = next.dentry->d_inode;
@@ -783,10 +800,7 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
783 goto out_dput; 800 goto out_dput;
784 801
785 if (inode->i_op->follow_link) { 802 if (inode->i_op->follow_link) {
786 mntget(next.mnt); 803 err = do_follow_link(&next, nd);
787 err = do_follow_link(next.dentry, nd);
788 dput(next.dentry);
789 mntput(next.mnt);
790 if (err) 804 if (err)
791 goto return_err; 805 goto return_err;
792 err = -ENOENT; 806 err = -ENOENT;
@@ -798,6 +812,8 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
798 break; 812 break;
799 } else { 813 } else {
800 dput(nd->dentry); 814 dput(nd->dentry);
815 if (nd->mnt != next.mnt)
816 mntput(nd->mnt);
801 nd->mnt = next.mnt; 817 nd->mnt = next.mnt;
802 nd->dentry = next.dentry; 818 nd->dentry = next.dentry;
803 } 819 }
@@ -819,7 +835,7 @@ last_component:
819 case 2: 835 case 2:
820 if (this.name[1] != '.') 836 if (this.name[1] != '.')
821 break; 837 break;
822 follow_dotdot(&nd->mnt, &nd->dentry); 838 follow_dotdot(nd);
823 inode = nd->dentry->d_inode; 839 inode = nd->dentry->d_inode;
824 /* fallthrough */ 840 /* fallthrough */
825 case 1: 841 case 1:
@@ -833,19 +849,17 @@ last_component:
833 err = do_lookup(nd, &this, &next); 849 err = do_lookup(nd, &this, &next);
834 if (err) 850 if (err)
835 break; 851 break;
836 follow_mount(&next.mnt, &next.dentry);
837 inode = next.dentry->d_inode; 852 inode = next.dentry->d_inode;
838 if ((lookup_flags & LOOKUP_FOLLOW) 853 if ((lookup_flags & LOOKUP_FOLLOW)
839 && inode && inode->i_op && inode->i_op->follow_link) { 854 && inode && inode->i_op && inode->i_op->follow_link) {
840 mntget(next.mnt); 855 err = do_follow_link(&next, nd);
841 err = do_follow_link(next.dentry, nd);
842 dput(next.dentry);
843 mntput(next.mnt);
844 if (err) 856 if (err)
845 goto return_err; 857 goto return_err;
846 inode = nd->dentry->d_inode; 858 inode = nd->dentry->d_inode;
847 } else { 859 } else {
848 dput(nd->dentry); 860 dput(nd->dentry);
861 if (nd->mnt != next.mnt)
862 mntput(nd->mnt);
849 nd->mnt = next.mnt; 863 nd->mnt = next.mnt;
850 nd->dentry = next.dentry; 864 nd->dentry = next.dentry;
851 } 865 }
@@ -885,6 +899,8 @@ return_base:
885 return 0; 899 return 0;
886out_dput: 900out_dput:
887 dput(next.dentry); 901 dput(next.dentry);
902 if (nd->mnt != next.mnt)
903 mntput(next.mnt);
888 break; 904 break;
889 } 905 }
890 path_release(nd); 906 path_release(nd);
@@ -1398,7 +1414,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
1398int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) 1414int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
1399{ 1415{
1400 int acc_mode, error = 0; 1416 int acc_mode, error = 0;
1401 struct dentry *dentry; 1417 struct path path;
1402 struct dentry *dir; 1418 struct dentry *dir;
1403 int count = 0; 1419 int count = 0;
1404 1420
@@ -1442,23 +1458,24 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
1442 dir = nd->dentry; 1458 dir = nd->dentry;
1443 nd->flags &= ~LOOKUP_PARENT; 1459 nd->flags &= ~LOOKUP_PARENT;
1444 down(&dir->d_inode->i_sem); 1460 down(&dir->d_inode->i_sem);
1445 dentry = __lookup_hash(&nd->last, nd->dentry, nd); 1461 path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
1462 path.mnt = nd->mnt;
1446 1463
1447do_last: 1464do_last:
1448 error = PTR_ERR(dentry); 1465 error = PTR_ERR(path.dentry);
1449 if (IS_ERR(dentry)) { 1466 if (IS_ERR(path.dentry)) {
1450 up(&dir->d_inode->i_sem); 1467 up(&dir->d_inode->i_sem);
1451 goto exit; 1468 goto exit;
1452 } 1469 }
1453 1470
1454 /* Negative dentry, just create the file */ 1471 /* Negative dentry, just create the file */
1455 if (!dentry->d_inode) { 1472 if (!path.dentry->d_inode) {
1456 if (!IS_POSIXACL(dir->d_inode)) 1473 if (!IS_POSIXACL(dir->d_inode))
1457 mode &= ~current->fs->umask; 1474 mode &= ~current->fs->umask;
1458 error = vfs_create(dir->d_inode, dentry, mode, nd); 1475 error = vfs_create(dir->d_inode, path.dentry, mode, nd);
1459 up(&dir->d_inode->i_sem); 1476 up(&dir->d_inode->i_sem);
1460 dput(nd->dentry); 1477 dput(nd->dentry);
1461 nd->dentry = dentry; 1478 nd->dentry = path.dentry;
1462 if (error) 1479 if (error)
1463 goto exit; 1480 goto exit;
1464 /* Don't check for write permission, don't truncate */ 1481 /* Don't check for write permission, don't truncate */
@@ -1476,22 +1493,24 @@ do_last:
1476 if (flag & O_EXCL) 1493 if (flag & O_EXCL)
1477 goto exit_dput; 1494 goto exit_dput;
1478 1495
1479 if (d_mountpoint(dentry)) { 1496 if (__follow_mount(&path)) {
1480 error = -ELOOP; 1497 error = -ELOOP;
1481 if (flag & O_NOFOLLOW) 1498 if (flag & O_NOFOLLOW)
1482 goto exit_dput; 1499 goto exit_dput;
1483 while (__follow_down(&nd->mnt,&dentry) && d_mountpoint(dentry));
1484 } 1500 }
1485 error = -ENOENT; 1501 error = -ENOENT;
1486 if (!dentry->d_inode) 1502 if (!path.dentry->d_inode)
1487 goto exit_dput; 1503 goto exit_dput;
1488 if (dentry->d_inode->i_op && dentry->d_inode->i_op->follow_link) 1504 if (path.dentry->d_inode->i_op && path.dentry->d_inode->i_op->follow_link)
1489 goto do_link; 1505 goto do_link;
1490 1506
1491 dput(nd->dentry); 1507 dput(nd->dentry);
1492 nd->dentry = dentry; 1508 nd->dentry = path.dentry;
1509 if (nd->mnt != path.mnt)
1510 mntput(nd->mnt);
1511 nd->mnt = path.mnt;
1493 error = -EISDIR; 1512 error = -EISDIR;
1494 if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)) 1513 if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode))
1495 goto exit; 1514 goto exit;
1496ok: 1515ok:
1497 error = may_open(nd, acc_mode, flag); 1516 error = may_open(nd, acc_mode, flag);
@@ -1500,7 +1519,9 @@ ok:
1500 return 0; 1519 return 0;
1501 1520
1502exit_dput: 1521exit_dput:
1503 dput(dentry); 1522 dput(path.dentry);
1523 if (nd->mnt != path.mnt)
1524 mntput(path.mnt);
1504exit: 1525exit:
1505 path_release(nd); 1526 path_release(nd);
1506 return error; 1527 return error;
@@ -1520,18 +1541,15 @@ do_link:
1520 * are done. Procfs-like symlinks just set LAST_BIND. 1541 * are done. Procfs-like symlinks just set LAST_BIND.
1521 */ 1542 */
1522 nd->flags |= LOOKUP_PARENT; 1543 nd->flags |= LOOKUP_PARENT;
1523 error = security_inode_follow_link(dentry, nd); 1544 error = security_inode_follow_link(path.dentry, nd);
1524 if (error) 1545 if (error)
1525 goto exit_dput; 1546 goto exit_dput;
1526 error = __do_follow_link(dentry, nd); 1547 error = __do_follow_link(&path, nd);
1527 dput(dentry);
1528 if (error) 1548 if (error)
1529 return error; 1549 return error;
1530 nd->flags &= ~LOOKUP_PARENT; 1550 nd->flags &= ~LOOKUP_PARENT;
1531 if (nd->last_type == LAST_BIND) { 1551 if (nd->last_type == LAST_BIND)
1532 dentry = nd->dentry;
1533 goto ok; 1552 goto ok;
1534 }
1535 error = -EISDIR; 1553 error = -EISDIR;
1536 if (nd->last_type != LAST_NORM) 1554 if (nd->last_type != LAST_NORM)
1537 goto exit; 1555 goto exit;
@@ -1546,7 +1564,8 @@ do_link:
1546 } 1564 }
1547 dir = nd->dentry; 1565 dir = nd->dentry;
1548 down(&dir->d_inode->i_sem); 1566 down(&dir->d_inode->i_sem);
1549 dentry = __lookup_hash(&nd->last, nd->dentry, nd); 1567 path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
1568 path.mnt = nd->mnt;
1550 putname(nd->last.name); 1569 putname(nd->last.name);
1551 goto do_last; 1570 goto do_last;
1552} 1571}
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 73f96acd5d37..ff6155f5e8d9 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -528,19 +528,39 @@ static inline void nfs_renew_times(struct dentry * dentry)
528 dentry->d_time = jiffies; 528 dentry->d_time = jiffies;
529} 529}
530 530
531/*
532 * Return the intent data that applies to this particular path component
533 *
534 * Note that the current set of intents only apply to the very last
535 * component of the path.
536 * We check for this using LOOKUP_CONTINUE and LOOKUP_PARENT.
537 */
538static inline unsigned int nfs_lookup_check_intent(struct nameidata *nd, unsigned int mask)
539{
540 if (nd->flags & (LOOKUP_CONTINUE|LOOKUP_PARENT))
541 return 0;
542 return nd->flags & mask;
543}
544
545/*
546 * Inode and filehandle revalidation for lookups.
547 *
548 * We force revalidation in the cases where the VFS sets LOOKUP_REVAL,
549 * or if the intent information indicates that we're about to open this
550 * particular file and the "nocto" mount flag is not set.
551 *
552 */
531static inline 553static inline
532int nfs_lookup_verify_inode(struct inode *inode, struct nameidata *nd) 554int nfs_lookup_verify_inode(struct inode *inode, struct nameidata *nd)
533{ 555{
534 struct nfs_server *server = NFS_SERVER(inode); 556 struct nfs_server *server = NFS_SERVER(inode);
535 557
536 if (nd != NULL) { 558 if (nd != NULL) {
537 int ndflags = nd->flags;
538 /* VFS wants an on-the-wire revalidation */ 559 /* VFS wants an on-the-wire revalidation */
539 if (ndflags & LOOKUP_REVAL) 560 if (nd->flags & LOOKUP_REVAL)
540 goto out_force; 561 goto out_force;
541 /* This is an open(2) */ 562 /* This is an open(2) */
542 if ((ndflags & LOOKUP_OPEN) && 563 if (nfs_lookup_check_intent(nd, LOOKUP_OPEN) != 0 &&
543 !(ndflags & LOOKUP_CONTINUE) &&
544 !(server->flags & NFS_MOUNT_NOCTO)) 564 !(server->flags & NFS_MOUNT_NOCTO))
545 goto out_force; 565 goto out_force;
546 } 566 }
@@ -560,12 +580,8 @@ static inline
560int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry, 580int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
561 struct nameidata *nd) 581 struct nameidata *nd)
562{ 582{
563 int ndflags = 0;
564
565 if (nd)
566 ndflags = nd->flags;
567 /* Don't revalidate a negative dentry if we're creating a new file */ 583 /* Don't revalidate a negative dentry if we're creating a new file */
568 if ((ndflags & LOOKUP_CREATE) && !(ndflags & LOOKUP_CONTINUE)) 584 if (nd != NULL && nfs_lookup_check_intent(nd, LOOKUP_CREATE) != 0)
569 return 0; 585 return 0;
570 return !nfs_check_verifier(dir, dentry); 586 return !nfs_check_verifier(dir, dentry);
571} 587}
@@ -700,12 +716,16 @@ struct dentry_operations nfs_dentry_operations = {
700 .d_iput = nfs_dentry_iput, 716 .d_iput = nfs_dentry_iput,
701}; 717};
702 718
719/*
720 * Use intent information to check whether or not we're going to do
721 * an O_EXCL create using this path component.
722 */
703static inline 723static inline
704int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd) 724int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd)
705{ 725{
706 if (NFS_PROTO(dir)->version == 2) 726 if (NFS_PROTO(dir)->version == 2)
707 return 0; 727 return 0;
708 if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE)) 728 if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_CREATE) == 0)
709 return 0; 729 return 0;
710 return (nd->intent.open.flags & O_EXCL) != 0; 730 return (nd->intent.open.flags & O_EXCL) != 0;
711} 731}
@@ -772,12 +792,13 @@ struct dentry_operations nfs4_dentry_operations = {
772 .d_iput = nfs_dentry_iput, 792 .d_iput = nfs_dentry_iput,
773}; 793};
774 794
795/*
796 * Use intent information to determine whether we need to substitute
797 * the NFSv4-style stateful OPEN for the LOOKUP call
798 */
775static int is_atomic_open(struct inode *dir, struct nameidata *nd) 799static int is_atomic_open(struct inode *dir, struct nameidata *nd)
776{ 800{
777 if (!nd) 801 if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_OPEN) == 0)
778 return 0;
779 /* Check that we are indeed trying to open this file */
780 if ((nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_OPEN))
781 return 0; 802 return 0;
782 /* NFS does not (yet) have a stateful open for directories */ 803 /* NFS does not (yet) have a stateful open for directories */
783 if (nd->flags & LOOKUP_DIRECTORY) 804 if (nd->flags & LOOKUP_DIRECTORY)
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index f06eee6dcff5..55c907592490 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -37,6 +37,7 @@
37 37
38static int nfs_file_open(struct inode *, struct file *); 38static int nfs_file_open(struct inode *, struct file *);
39static int nfs_file_release(struct inode *, struct file *); 39static int nfs_file_release(struct inode *, struct file *);
40static loff_t nfs_file_llseek(struct file *file, loff_t offset, int origin);
40static int nfs_file_mmap(struct file *, struct vm_area_struct *); 41static int nfs_file_mmap(struct file *, struct vm_area_struct *);
41static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); 42static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
42static ssize_t nfs_file_read(struct kiocb *, char __user *, size_t, loff_t); 43static ssize_t nfs_file_read(struct kiocb *, char __user *, size_t, loff_t);
@@ -48,7 +49,7 @@ static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
48static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); 49static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
49 50
50struct file_operations nfs_file_operations = { 51struct file_operations nfs_file_operations = {
51 .llseek = remote_llseek, 52 .llseek = nfs_file_llseek,
52 .read = do_sync_read, 53 .read = do_sync_read,
53 .write = do_sync_write, 54 .write = do_sync_write,
54 .aio_read = nfs_file_read, 55 .aio_read = nfs_file_read,
@@ -114,6 +115,45 @@ nfs_file_release(struct inode *inode, struct file *filp)
114 return NFS_PROTO(inode)->file_release(inode, filp); 115 return NFS_PROTO(inode)->file_release(inode, filp);
115} 116}
116 117
118/**
119 * nfs_revalidate_size - Revalidate the file size
120 * @inode - pointer to inode struct
121 * @file - pointer to struct file
122 *
123 * Revalidates the file length. This is basically a wrapper around
124 * nfs_revalidate_inode() that takes into account the fact that we may
125 * have cached writes (in which case we don't care about the server's
126 * idea of what the file length is), or O_DIRECT (in which case we
127 * shouldn't trust the cache).
128 */
129static int nfs_revalidate_file_size(struct inode *inode, struct file *filp)
130{
131 struct nfs_server *server = NFS_SERVER(inode);
132 struct nfs_inode *nfsi = NFS_I(inode);
133
134 if (server->flags & NFS_MOUNT_NOAC)
135 goto force_reval;
136 if (filp->f_flags & O_DIRECT)
137 goto force_reval;
138 if (nfsi->npages != 0)
139 return 0;
140 return nfs_revalidate_inode(server, inode);
141force_reval:
142 return __nfs_revalidate_inode(server, inode);
143}
144
145static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
146{
147 /* origin == SEEK_END => we must revalidate the cached file length */
148 if (origin == 2) {
149 struct inode *inode = filp->f_mapping->host;
150 int retval = nfs_revalidate_file_size(inode, filp);
151 if (retval < 0)
152 return (loff_t)retval;
153 }
154 return remote_llseek(filp, offset, origin);
155}
156
117/* 157/*
118 * Flush all dirty pages, and check for write errors. 158 * Flush all dirty pages, and check for write errors.
119 * 159 *
diff --git a/include/asm-alpha/agp.h b/include/asm-alpha/agp.h
index c99dbbb5bcb5..ef855a3bc0f5 100644
--- a/include/asm-alpha/agp.h
+++ b/include/asm-alpha/agp.h
@@ -10,4 +10,14 @@
10#define flush_agp_mappings() 10#define flush_agp_mappings()
11#define flush_agp_cache() mb() 11#define flush_agp_cache() mb()
12 12
13/* Convert a physical address to an address suitable for the GART. */
14#define phys_to_gart(x) (x)
15#define gart_to_phys(x) (x)
16
17/* GATT allocation. Returns/accepts GATT kernel virtual address. */
18#define alloc_gatt_pages(order) \
19 ((char *)__get_free_pages(GFP_KERNEL, (order)))
20#define free_gatt_pages(table, order) \
21 free_pages((unsigned long)(table), (order))
22
13#endif 23#endif
diff --git a/include/asm-arm/arch-integrator/platform.h b/include/asm-arm/arch-integrator/platform.h
index bd364f5a99bc..96ad3d2a66d1 100644
--- a/include/asm-arm/arch-integrator/platform.h
+++ b/include/asm-arm/arch-integrator/platform.h
@@ -293,7 +293,11 @@
293#define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) 293#define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET)
294 294
295 295
296#if defined(CONFIG_ARCH_INTEGRATOR_AP)
296#define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ 297#define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */
298#elif defined(CONFIG_ARCH_INTEGRATOR_CP)
299#define INTEGRATOR_GPIO_BASE 0xC9000000 /* GPIO */
300#endif
297 301
298/* ------------------------------------------------------------------------ 302/* ------------------------------------------------------------------------
299 * KMI keyboard/mouse definitions 303 * KMI keyboard/mouse definitions
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h
index a8e3c2daefd6..083462668e18 100644
--- a/include/asm-arm/arch-ixp2000/io.h
+++ b/include/asm-arm/arch-ixp2000/io.h
@@ -75,8 +75,8 @@ static inline void insw(u32 ptr, void *buf, int length)
75 * Is this cycle meant for the CS8900? 75 * Is this cycle meant for the CS8900?
76 */ 76 */
77 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && 77 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
78 ((port >= IXDP2X01_CS8900_VIRT_BASE) && 78 (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
79 (port <= IXDP2X01_CS8900_VIRT_END))) { 79 ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
80 u8 *buf8 = (u8*)buf; 80 u8 *buf8 = (u8*)buf;
81 register u32 tmp32; 81 register u32 tmp32;
82 82
@@ -100,8 +100,8 @@ static inline void outsw(u32 ptr, void *buf, int length)
100 * Is this cycle meant for the CS8900? 100 * Is this cycle meant for the CS8900?
101 */ 101 */
102 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && 102 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
103 ((port >= IXDP2X01_CS8900_VIRT_BASE) && 103 (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
104 (port <= IXDP2X01_CS8900_VIRT_END))) { 104 ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
105 register u32 tmp32; 105 register u32 tmp32;
106 u8 *buf8 = (u8*)buf; 106 u8 *buf8 = (u8*)buf;
107 do { 107 do {
@@ -124,8 +124,8 @@ static inline u16 inw(u32 ptr)
124 * Is this cycle meant for the CS8900? 124 * Is this cycle meant for the CS8900?
125 */ 125 */
126 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && 126 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
127 ((port >= IXDP2X01_CS8900_VIRT_BASE) && 127 (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
128 (port <= IXDP2X01_CS8900_VIRT_END))) { 128 ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
129 return (u16)(*port); 129 return (u16)(*port);
130 } 130 }
131 131
@@ -137,8 +137,8 @@ static inline void outw(u16 value, u32 ptr)
137 register volatile u32 *port = (volatile u32 *)ptr; 137 register volatile u32 *port = (volatile u32 *)ptr;
138 138
139 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) && 139 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
140 ((port >= IXDP2X01_CS8900_VIRT_BASE) && 140 (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
141 (port <= IXDP2X01_CS8900_VIRT_END))) { 141 ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
142 *port = value; 142 *port = value;
143 return; 143 return;
144 } 144 }
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 39741d3c9a34..b5e54a9e9fa7 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1296,6 +1296,7 @@
1296#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */ 1296#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */
1297#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */ 1297#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */
1298#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */ 1298#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */
1299#define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */
1299#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */ 1300#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */
1300 1301
1301/* GPIO alternate function mode & direction */ 1302/* GPIO alternate function mode & direction */
@@ -1428,6 +1429,7 @@
1428#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT) 1429#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT)
1429#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT) 1430#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT)
1430#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT) 1431#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT)
1432#define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
1431#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT) 1433#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT)
1432#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT) 1434#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT)
1433#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN) 1435#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN)
diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h
index 2598d1f08548..a71093e44c58 100644
--- a/include/asm-arm/arch-versatile/platform.h
+++ b/include/asm-arm/arch-versatile/platform.h
@@ -498,11 +498,17 @@
498/* 498/*
499 * IB2 Versatile/AB expansion board definitions 499 * IB2 Versatile/AB expansion board definitions
500 */ 500 */
501#define VERSATILE_IB2_CAMERA_BANK 0x24000000 501#define VERSATILE_IB2_CAMERA_BANK VERSATILE_IB2_BASE
502#define VERSATILE_IB2_KBD_DATAREG 0x25000000 502#define VERSATILE_IB2_KBD_DATAREG (VERSATILE_IB2_BASE + 0x01000000)
503#define VERSATILE_IB2_IER 0x26000000 /* for VICINTSOURCE27 */ 503
504#define VERSATILE_IB2_CTRL 0x27000000 504/* VICINTSOURCE27 */
505#define VERSATILE_IB2_STAT 0x27000004 505#define VERSATILE_IB2_INT_BASE (VERSATILE_IB2_BASE + 0x02000000)
506#define VERSATILE_IB2_IER (VERSATILE_IB2_INT_BASE + 0)
507#define VERSATILE_IB2_ISR (VERSATILE_IB2_INT_BASE + 4)
508
509#define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000)
510#define VERSATILE_IB2_CTRL (VERSATILE_IB2_CTL_BASE + 0)
511#define VERSATILE_IB2_STAT (VERSATILE_IB2_CTL_BASE + 4)
506#endif 512#endif
507 513
508#endif 514#endif
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index cbceacbe5afa..a1696ba238d3 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -38,9 +38,9 @@ typedef struct user_fp elf_fpregset_t;
38 */ 38 */
39#define ELF_CLASS ELFCLASS32 39#define ELF_CLASS ELFCLASS32
40#ifdef __ARMEB__ 40#ifdef __ARMEB__
41#define ELF_DATA ELFDATA2MSB; 41#define ELF_DATA ELFDATA2MSB
42#else 42#else
43#define ELF_DATA ELFDATA2LSB; 43#define ELF_DATA ELFDATA2LSB
44#endif 44#endif
45#define ELF_ARCH EM_ARM 45#define ELF_ARCH EM_ARM
46 46
diff --git a/include/asm-arm26/elf.h b/include/asm-arm26/elf.h
index 8b149474db24..5a47fdb3015d 100644
--- a/include/asm-arm26/elf.h
+++ b/include/asm-arm26/elf.h
@@ -36,7 +36,7 @@ typedef struct { void *null; } elf_fpregset_t;
36 * These are used to set parameters in the core dumps. 36 * These are used to set parameters in the core dumps.
37 */ 37 */
38#define ELF_CLASS ELFCLASS32 38#define ELF_CLASS ELFCLASS32
39#define ELF_DATA ELFDATA2LSB; 39#define ELF_DATA ELFDATA2LSB
40#define ELF_ARCH EM_ARM 40#define ELF_ARCH EM_ARM
41 41
42#define USE_ELF_CORE_DUMP 42#define USE_ELF_CORE_DUMP
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h
index dedb29280303..37ad25355591 100644
--- a/include/asm-arm26/signal.h
+++ b/include/asm-arm26/signal.h
@@ -166,9 +166,6 @@ typedef struct sigaltstack {
166#include <asm/sigcontext.h> 166#include <asm/sigcontext.h>
167 167
168#define sigmask(sig) (1UL << ((sig) - 1)) 168#define sigmask(sig) (1UL << ((sig) - 1))
169//FIXME!!!
170//#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER
171
172#endif 169#endif
173 170
174 171
diff --git a/include/asm-h8300/kmap_types.h b/include/asm-h8300/kmap_types.h
index 82431edeb2a1..1ec8a3427120 100644
--- a/include/asm-h8300/kmap_types.h
+++ b/include/asm-h8300/kmap_types.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_H8300_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_H8300_KMAP_TYPES_H
3 3
4enum km_type { 4enum km_type {
5 KM_BOUNCE_READ, 5 KM_BOUNCE_READ,
@@ -13,6 +13,8 @@ enum km_type {
13 KM_PTE1, 13 KM_PTE1,
14 KM_IRQ0, 14 KM_IRQ0,
15 KM_IRQ1, 15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
16 KM_TYPE_NR 18 KM_TYPE_NR
17}; 19};
18 20
diff --git a/include/asm-h8300/mman.h b/include/asm-h8300/mman.h
index abe08856c84f..63f727a59850 100644
--- a/include/asm-h8300/mman.h
+++ b/include/asm-h8300/mman.h
@@ -4,6 +4,7 @@
4#define PROT_READ 0x1 /* page can be read */ 4#define PROT_READ 0x1 /* page can be read */
5#define PROT_WRITE 0x2 /* page can be written */ 5#define PROT_WRITE 0x2 /* page can be written */
6#define PROT_EXEC 0x4 /* page can be executed */ 6#define PROT_EXEC 0x4 /* page can be executed */
7#define PROT_SEM 0x8 /* page may be used for atomic ops */
7#define PROT_NONE 0x0 /* page can not be accessed */ 8#define PROT_NONE 0x0 /* page can not be accessed */
8#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ 9#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
9#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ 10#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
@@ -19,6 +20,8 @@
19#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ 20#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
20#define MAP_LOCKED 0x2000 /* pages are locked */ 21#define MAP_LOCKED 0x2000 /* pages are locked */
21#define MAP_NORESERVE 0x4000 /* don't check for reservations */ 22#define MAP_NORESERVE 0x4000 /* don't check for reservations */
23#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
24#define MAP_NONBLOCK 0x10000 /* do not block on IO */
22 25
23#define MS_ASYNC 1 /* sync memory asynchronously */ 26#define MS_ASYNC 1 /* sync memory asynchronously */
24#define MS_INVALIDATE 2 /* invalidate the caches */ 27#define MS_INVALIDATE 2 /* invalidate the caches */
diff --git a/include/asm-i386/agp.h b/include/asm-i386/agp.h
index a917ff50354f..b82f5f3ab887 100644
--- a/include/asm-i386/agp.h
+++ b/include/asm-i386/agp.h
@@ -21,4 +21,14 @@ int unmap_page_from_agp(struct page *page);
21 worth it. Would need a page for it. */ 21 worth it. Would need a page for it. */
22#define flush_agp_cache() asm volatile("wbinvd":::"memory") 22#define flush_agp_cache() asm volatile("wbinvd":::"memory")
23 23
24/* Convert a physical address to an address suitable for the GART. */
25#define phys_to_gart(x) (x)
26#define gart_to_phys(x) (x)
27
28/* GATT allocation. Returns/accepts GATT kernel virtual address. */
29#define alloc_gatt_pages(order) \
30 ((char *)__get_free_pages(GFP_KERNEL, (order)))
31#define free_gatt_pages(table, order) \
32 free_pages((unsigned long)(table), (order))
33
24#endif 34#endif
diff --git a/include/asm-i386/mach-numaq/mach_ipi.h b/include/asm-i386/mach-numaq/mach_ipi.h
index 1b46fd3f2ae3..c6044488e9e6 100644
--- a/include/asm-i386/mach-numaq/mach_ipi.h
+++ b/include/asm-i386/mach-numaq/mach_ipi.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_MACH_IPI_H
3 3
4inline void send_IPI_mask_sequence(cpumask_t, int vector); 4void send_IPI_mask_sequence(cpumask_t, int vector);
5 5
6static inline void send_IPI_mask(cpumask_t mask, int vector) 6static inline void send_IPI_mask(cpumask_t mask, int vector)
7{ 7{
diff --git a/include/asm-ia64/agp.h b/include/asm-ia64/agp.h
index d1316f1e6ee1..4e517f0e6afa 100644
--- a/include/asm-ia64/agp.h
+++ b/include/asm-ia64/agp.h
@@ -18,4 +18,14 @@
18#define flush_agp_mappings() /* nothing */ 18#define flush_agp_mappings() /* nothing */
19#define flush_agp_cache() mb() 19#define flush_agp_cache() mb()
20 20
21/* Convert a physical address to an address suitable for the GART. */
22#define phys_to_gart(x) (x)
23#define gart_to_phys(x) (x)
24
25/* GATT allocation. Returns/accepts GATT kernel virtual address. */
26#define alloc_gatt_pages(order) \
27 ((char *)__get_free_pages(GFP_KERNEL, (order)))
28#define free_gatt_pages(table, order) \
29 free_pages((unsigned long)(table), (order))
30
21#endif /* _ASM_IA64_AGP_H */ 31#endif /* _ASM_IA64_AGP_H */
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index ea121a002309..fcc9c3344ab4 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -8,7 +8,7 @@
8 * This hopefully works with any (fixed) IA-64 page-size, as defined 8 * This hopefully works with any (fixed) IA-64 page-size, as defined
9 * in <asm/page.h>. 9 * in <asm/page.h>.
10 * 10 *
11 * Copyright (C) 1998-2004 Hewlett-Packard Co 11 * Copyright (C) 1998-2005 Hewlett-Packard Co
12 * David Mosberger-Tang <davidm@hpl.hp.com> 12 * David Mosberger-Tang <davidm@hpl.hp.com>
13 */ 13 */
14 14
@@ -551,7 +551,11 @@ do { \
551 551
552/* These tell get_user_pages() that the first gate page is accessible from user-level. */ 552/* These tell get_user_pages() that the first gate page is accessible from user-level. */
553#define FIXADDR_USER_START GATE_ADDR 553#define FIXADDR_USER_START GATE_ADDR
554#define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) 554#ifdef HAVE_BUGGY_SEGREL
555# define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE)
556#else
557# define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE)
558#endif
555 559
556#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 560#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
557#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 561#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 9e1ba8b7fb68..91bbd1f22461 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -403,7 +403,10 @@ extern void ia64_setreg_unknown_kr (void);
403 * task_struct at this point. 403 * task_struct at this point.
404 */ 404 */
405 405
406/* Return TRUE if task T owns the fph partition of the CPU we're running on. */ 406/*
407 * Return TRUE if task T owns the fph partition of the CPU we're running on.
408 * Must be called from code that has preemption disabled.
409 */
407#define ia64_is_local_fpu_owner(t) \ 410#define ia64_is_local_fpu_owner(t) \
408({ \ 411({ \
409 struct task_struct *__ia64_islfo_task = (t); \ 412 struct task_struct *__ia64_islfo_task = (t); \
@@ -411,7 +414,10 @@ extern void ia64_setreg_unknown_kr (void);
411 && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \ 414 && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \
412}) 415})
413 416
414/* Mark task T as owning the fph partition of the CPU we're running on. */ 417/*
418 * Mark task T as owning the fph partition of the CPU we're running on.
419 * Must be called from code that has preemption disabled.
420 */
415#define ia64_set_local_fpu_owner(t) do { \ 421#define ia64_set_local_fpu_owner(t) do { \
416 struct task_struct *__ia64_slfo_task = (t); \ 422 struct task_struct *__ia64_slfo_task = (t); \
417 __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \ 423 __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \
diff --git a/include/asm-ppc/agp.h b/include/asm-ppc/agp.h
index be27cfa8c5b0..ca9e423307f4 100644
--- a/include/asm-ppc/agp.h
+++ b/include/asm-ppc/agp.h
@@ -10,4 +10,14 @@
10#define flush_agp_mappings() 10#define flush_agp_mappings()
11#define flush_agp_cache() mb() 11#define flush_agp_cache() mb()
12 12
13/* Convert a physical address to an address suitable for the GART. */
14#define phys_to_gart(x) (x)
15#define gart_to_phys(x) (x)
16
17/* GATT allocation. Returns/accepts GATT kernel virtual address. */
18#define alloc_gatt_pages(order) \
19 ((char *)__get_free_pages(GFP_KERNEL, (order)))
20#define free_gatt_pages(table, order) \
21 free_pages((unsigned long)(table), (order))
22
13#endif 23#endif
diff --git a/include/asm-ppc/sigcontext.h b/include/asm-ppc/sigcontext.h
index f82dcccdee1e..b7a417e0a921 100644
--- a/include/asm-ppc/sigcontext.h
+++ b/include/asm-ppc/sigcontext.h
@@ -2,7 +2,7 @@
2#define _ASM_PPC_SIGCONTEXT_H 2#define _ASM_PPC_SIGCONTEXT_H
3 3
4#include <asm/ptrace.h> 4#include <asm/ptrace.h>
5 5#include <linux/compiler.h>
6 6
7struct sigcontext { 7struct sigcontext {
8 unsigned long _unused[4]; 8 unsigned long _unused[4];
diff --git a/include/asm-ppc64/agp.h b/include/asm-ppc64/agp.h
index be27cfa8c5b0..ca9e423307f4 100644
--- a/include/asm-ppc64/agp.h
+++ b/include/asm-ppc64/agp.h
@@ -10,4 +10,14 @@
10#define flush_agp_mappings() 10#define flush_agp_mappings()
11#define flush_agp_cache() mb() 11#define flush_agp_cache() mb()
12 12
13/* Convert a physical address to an address suitable for the GART. */
14#define phys_to_gart(x) (x)
15#define gart_to_phys(x) (x)
16
17/* GATT allocation. Returns/accepts GATT kernel virtual address. */
18#define alloc_gatt_pages(order) \
19 ((char *)__get_free_pages(GFP_KERNEL, (order)))
20#define free_gatt_pages(table, order) \
21 free_pages((unsigned long)(table), (order))
22
13#endif 23#endif
diff --git a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h
index 6c42d61bedd1..085eedb956fe 100644
--- a/include/asm-ppc64/elf.h
+++ b/include/asm-ppc64/elf.h
@@ -221,9 +221,7 @@ do { \
221 set_thread_flag(TIF_ABI_PENDING); \ 221 set_thread_flag(TIF_ABI_PENDING); \
222 else \ 222 else \
223 clear_thread_flag(TIF_ABI_PENDING); \ 223 clear_thread_flag(TIF_ABI_PENDING); \
224 if (ibcs2) \ 224 if (personality(current->personality) != PER_LINUX32) \
225 set_personality(PER_SVR4); \
226 else if (current->personality != PER_LINUX32) \
227 set_personality(PER_LINUX); \ 225 set_personality(PER_LINUX); \
228} while (0) 226} while (0)
229 227
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index 0035efe2db2b..809c634ba1df 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -120,103 +120,18 @@
120 120
121/* Special Purpose Registers (SPRNs)*/ 121/* Special Purpose Registers (SPRNs)*/
122 122
123#define SPRN_CDBCR 0x3D7 /* Cache Debug Control Register */
124#define SPRN_CTR 0x009 /* Count Register */ 123#define SPRN_CTR 0x009 /* Count Register */
125#define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ 124#define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */
126#define SPRN_DAC1 0x3F6 /* Data Address Compare 1 */ 125#define DABR_TRANSLATION (1UL << 2)
127#define SPRN_DAC2 0x3F7 /* Data Address Compare 2 */
128#define SPRN_DAR 0x013 /* Data Address Register */ 126#define SPRN_DAR 0x013 /* Data Address Register */
129#define SPRN_DBCR 0x3F2 /* Debug Control Regsiter */
130#define DBCR_EDM 0x80000000
131#define DBCR_IDM 0x40000000
132#define DBCR_RST(x) (((x) & 0x3) << 28)
133#define DBCR_RST_NONE 0
134#define DBCR_RST_CORE 1
135#define DBCR_RST_CHIP 2
136#define DBCR_RST_SYSTEM 3
137#define DBCR_IC 0x08000000 /* Instruction Completion Debug Evnt */
138#define DBCR_BT 0x04000000 /* Branch Taken Debug Event */
139#define DBCR_EDE 0x02000000 /* Exception Debug Event */
140#define DBCR_TDE 0x01000000 /* TRAP Debug Event */
141#define DBCR_FER 0x00F80000 /* First Events Remaining Mask */
142#define DBCR_FT 0x00040000 /* Freeze Timers on Debug Event */
143#define DBCR_IA1 0x00020000 /* Instr. Addr. Compare 1 Enable */
144#define DBCR_IA2 0x00010000 /* Instr. Addr. Compare 2 Enable */
145#define DBCR_D1R 0x00008000 /* Data Addr. Compare 1 Read Enable */
146#define DBCR_D1W 0x00004000 /* Data Addr. Compare 1 Write Enable */
147#define DBCR_D1S(x) (((x) & 0x3) << 12) /* Data Adrr. Compare 1 Size */
148#define DAC_BYTE 0
149#define DAC_HALF 1
150#define DAC_WORD 2
151#define DAC_QUAD 3
152#define DBCR_D2R 0x00000800 /* Data Addr. Compare 2 Read Enable */
153#define DBCR_D2W 0x00000400 /* Data Addr. Compare 2 Write Enable */
154#define DBCR_D2S(x) (((x) & 0x3) << 8) /* Data Addr. Compare 2 Size */
155#define DBCR_SBT 0x00000040 /* Second Branch Taken Debug Event */
156#define DBCR_SED 0x00000020 /* Second Exception Debug Event */
157#define DBCR_STD 0x00000010 /* Second Trap Debug Event */
158#define DBCR_SIA 0x00000008 /* Second IAC Enable */
159#define DBCR_SDA 0x00000004 /* Second DAC Enable */
160#define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */
161#define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */
162#define SPRN_DBCR0 0x3F2 /* Debug Control Register 0 */
163#define SPRN_DBCR1 0x3BD /* Debug Control Register 1 */
164#define SPRN_DBSR 0x3F0 /* Debug Status Register */
165#define SPRN_DCCR 0x3FA /* Data Cache Cacheability Register */
166#define DCCR_NOCACHE 0 /* Noncacheable */
167#define DCCR_CACHE 1 /* Cacheable */
168#define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */
169#define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */
170#define DCWR_COPY 0 /* Copy-back */
171#define DCWR_WRITE 1 /* Write-through */
172#define SPRN_DEAR 0x3D5 /* Data Error Address Register */
173#define SPRN_DEC 0x016 /* Decrement Register */ 127#define SPRN_DEC 0x016 /* Decrement Register */
174#define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */
175#define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ 128#define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */
176#define DSISR_NOHPTE 0x40000000 /* no translation found */ 129#define DSISR_NOHPTE 0x40000000 /* no translation found */
177#define DSISR_PROTFAULT 0x08000000 /* protection fault */ 130#define DSISR_PROTFAULT 0x08000000 /* protection fault */
178#define DSISR_ISSTORE 0x02000000 /* access was a store */ 131#define DSISR_ISSTORE 0x02000000 /* access was a store */
179#define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ 132#define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */
180#define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ 133#define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */
181#define SPRN_EAR 0x11A /* External Address Register */
182#define SPRN_ESR 0x3D4 /* Exception Syndrome Register */
183#define ESR_IMCP 0x80000000 /* Instr. Machine Check - Protection */
184#define ESR_IMCN 0x40000000 /* Instr. Machine Check - Non-config */
185#define ESR_IMCB 0x20000000 /* Instr. Machine Check - Bus error */
186#define ESR_IMCT 0x10000000 /* Instr. Machine Check - Timeout */
187#define ESR_PIL 0x08000000 /* Program Exception - Illegal */
188#define ESR_PPR 0x04000000 /* Program Exception - Priveleged */
189#define ESR_PTR 0x02000000 /* Program Exception - Trap */
190#define ESR_DST 0x00800000 /* Storage Exception - Data miss */
191#define ESR_DIZ 0x00400000 /* Storage Exception - Zone fault */
192#define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */
193#define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */
194#define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */
195#define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ 134#define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */
196#define HID0_EMCP (1<<31) /* Enable Machine Check pin */
197#define HID0_EBA (1<<29) /* Enable Bus Address Parity */
198#define HID0_EBD (1<<28) /* Enable Bus Data Parity */
199#define HID0_SBCLK (1<<27)
200#define HID0_EICE (1<<26)
201#define HID0_ECLK (1<<25)
202#define HID0_PAR (1<<24)
203#define HID0_DOZE (1<<23)
204#define HID0_NAP (1<<22)
205#define HID0_SLEEP (1<<21)
206#define HID0_DPM (1<<20)
207#define HID0_ICE (1<<15) /* Instruction Cache Enable */
208#define HID0_DCE (1<<14) /* Data Cache Enable */
209#define HID0_ILOCK (1<<13) /* Instruction Cache Lock */
210#define HID0_DLOCK (1<<12) /* Data Cache Lock */
211#define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */
212#define HID0_DCI (1<<10) /* Data Cache Invalidate */
213#define HID0_SPD (1<<9) /* Speculative disable */
214#define HID0_SGE (1<<7) /* Store Gathering Enable */
215#define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */
216#define HID0_BTIC (1<<5) /* Branch Target Instruction Cache Enable */
217#define HID0_ABE (1<<3) /* Address Broadcast Enable */
218#define HID0_BHTE (1<<2) /* Branch History Table Enable */
219#define HID0_BTCD (1<<1) /* Branch target cache disable */
220#define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */ 135#define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */
221#define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ 136#define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */
222#define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ 137#define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */
@@ -225,23 +140,8 @@
225#define SPRN_HID5 0x3F6 /* 970 HID5 */ 140#define SPRN_HID5 0x3F6 /* 970 HID5 */
226#define SPRN_TSC 0x3FD /* Thread switch control */ 141#define SPRN_TSC 0x3FD /* Thread switch control */
227#define SPRN_TST 0x3FC /* Thread switch timeout */ 142#define SPRN_TST 0x3FC /* Thread switch timeout */
228#define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */
229#define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */
230#define SPRN_ICCR 0x3FB /* Instruction Cache Cacheability Register */
231#define ICCR_NOCACHE 0 /* Noncacheable */
232#define ICCR_CACHE 1 /* Cacheable */
233#define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */
234#define SPRN_ICMP 0x3D5 /* Instruction TLB Compare Register */
235#define SPRN_ICTC 0x3FB /* Instruction Cache Throttling Control Reg */
236#define SPRN_IMISS 0x3D4 /* Instruction TLB Miss Register */
237#define SPRN_IMMR 0x27E /* Internal Memory Map Register */
238#define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */ 143#define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */
239#define SPRN_LR 0x008 /* Link Register */ 144#define SPRN_LR 0x008 /* Link Register */
240#define SPRN_PBL1 0x3FC /* Protection Bound Lower 1 */
241#define SPRN_PBL2 0x3FE /* Protection Bound Lower 2 */
242#define SPRN_PBU1 0x3FD /* Protection Bound Upper 1 */
243#define SPRN_PBU2 0x3FF /* Protection Bound Upper 2 */
244#define SPRN_PID 0x3B1 /* Process ID */
245#define SPRN_PIR 0x3FF /* Processor Identification Register */ 145#define SPRN_PIR 0x3FF /* Processor Identification Register */
246#define SPRN_PIT 0x3DB /* Programmable Interval Timer */ 146#define SPRN_PIT 0x3DB /* Programmable Interval Timer */
247#define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */ 147#define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */
@@ -249,9 +149,6 @@
249#define SPRN_RPA 0x3D6 /* Required Physical Address Register */ 149#define SPRN_RPA 0x3D6 /* Required Physical Address Register */
250#define SPRN_SDA 0x3BF /* Sampled Data Address Register */ 150#define SPRN_SDA 0x3BF /* Sampled Data Address Register */
251#define SPRN_SDR1 0x019 /* MMU Hash Base Register */ 151#define SPRN_SDR1 0x019 /* MMU Hash Base Register */
252#define SPRN_SGR 0x3B9 /* Storage Guarded Register */
253#define SGR_NORMAL 0
254#define SGR_GUARDED 1
255#define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ 152#define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */
256#define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ 153#define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */
257#define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ 154#define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */
@@ -264,50 +161,12 @@
264#define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */ 161#define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */
265#define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */ 162#define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */
266#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ 163#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */
267#define SPRN_TCR 0x3DA /* Timer Control Register */
268#define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */
269#define WP_2_17 0 /* 2^17 clocks */
270#define WP_2_21 1 /* 2^21 clocks */
271#define WP_2_25 2 /* 2^25 clocks */
272#define WP_2_29 3 /* 2^29 clocks */
273#define TCR_WRC(x) (((x)&0x3)<<28) /* WDT Reset Control */
274#define WRC_NONE 0 /* No reset will occur */
275#define WRC_CORE 1 /* Core reset will occur */
276#define WRC_CHIP 2 /* Chip reset will occur */
277#define WRC_SYSTEM 3 /* System reset will occur */
278#define TCR_WIE 0x08000000 /* WDT Interrupt Enable */
279#define TCR_PIE 0x04000000 /* PIT Interrupt Enable */
280#define TCR_FP(x) (((x)&0x3)<<24) /* FIT Period */
281#define FP_2_9 0 /* 2^9 clocks */
282#define FP_2_13 1 /* 2^13 clocks */
283#define FP_2_17 2 /* 2^17 clocks */
284#define FP_2_21 3 /* 2^21 clocks */
285#define TCR_FIE 0x00800000 /* FIT Interrupt Enable */
286#define TCR_ARE 0x00400000 /* Auto Reload Enable */
287#define SPRN_THRM1 0x3FC /* Thermal Management Register 1 */
288#define THRM1_TIN (1<<0)
289#define THRM1_TIV (1<<1)
290#define THRM1_THRES (0x7f<<2)
291#define THRM1_TID (1<<29)
292#define THRM1_TIE (1<<30)
293#define THRM1_V (1<<31)
294#define SPRN_THRM2 0x3FD /* Thermal Management Register 2 */
295#define SPRN_THRM3 0x3FE /* Thermal Management Register 3 */
296#define THRM3_E (1<<31)
297#define SPRN_TSR 0x3D8 /* Timer Status Register */
298#define TSR_ENW 0x80000000 /* Enable Next Watchdog */
299#define TSR_WIS 0x40000000 /* WDT Interrupt Status */
300#define TSR_WRS(x) (((x)&0x3)<<28) /* WDT Reset Status */
301#define WRS_NONE 0 /* No WDT reset occurred */
302#define WRS_CORE 1 /* WDT forced core reset */
303#define WRS_CHIP 2 /* WDT forced chip reset */
304#define WRS_SYSTEM 3 /* WDT forced system reset */
305#define TSR_PIS 0x08000000 /* PIT Interrupt Status */
306#define TSR_FIS 0x04000000 /* FIT Interrupt Status */
307#define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */ 164#define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */
308#define SPRN_XER 0x001 /* Fixed Point Exception Register */ 165#define SPRN_XER 0x001 /* Fixed Point Exception Register */
309#define SPRN_ZPR 0x3B0 /* Zone Protection Register */
310#define SPRN_VRSAVE 0x100 /* Vector save */ 166#define SPRN_VRSAVE 0x100 /* Vector save */
167#define SPRN_CTRLF 0x088
168#define SPRN_CTRLT 0x098
169#define CTRL_RUNLATCH 0x1
311 170
312/* Performance monitor SPRs */ 171/* Performance monitor SPRs */
313#define SPRN_SIAR 780 172#define SPRN_SIAR 780
@@ -352,28 +211,19 @@
352#define CTR SPRN_CTR /* Counter Register */ 211#define CTR SPRN_CTR /* Counter Register */
353#define DAR SPRN_DAR /* Data Address Register */ 212#define DAR SPRN_DAR /* Data Address Register */
354#define DABR SPRN_DABR /* Data Address Breakpoint Register */ 213#define DABR SPRN_DABR /* Data Address Breakpoint Register */
355#define DCMP SPRN_DCMP /* Data TLB Compare Register */
356#define DEC SPRN_DEC /* Decrement Register */ 214#define DEC SPRN_DEC /* Decrement Register */
357#define DMISS SPRN_DMISS /* Data TLB Miss Register */
358#define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */ 215#define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */
359#define EAR SPRN_EAR /* External Address Register */
360#define HASH1 SPRN_HASH1 /* Primary Hash Address Register */
361#define HASH2 SPRN_HASH2 /* Secondary Hash Address Register */
362#define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */ 216#define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */
363#define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */ 217#define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */
364#define NIADORM SPRN_NIADORM /* NIA Dormant Register */ 218#define NIADORM SPRN_NIADORM /* NIA Dormant Register */
365#define TSC SPRN_TSC /* Thread switch control */ 219#define TSC SPRN_TSC /* Thread switch control */
366#define TST SPRN_TST /* Thread switch timeout */ 220#define TST SPRN_TST /* Thread switch timeout */
367#define IABR SPRN_IABR /* Instruction Address Breakpoint Register */ 221#define IABR SPRN_IABR /* Instruction Address Breakpoint Register */
368#define ICMP SPRN_ICMP /* Instruction TLB Compare Register */
369#define IMISS SPRN_IMISS /* Instruction TLB Miss Register */
370#define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */
371#define L2CR SPRN_L2CR /* PPC 750 L2 control register */ 222#define L2CR SPRN_L2CR /* PPC 750 L2 control register */
372#define __LR SPRN_LR 223#define __LR SPRN_LR
373#define PVR SPRN_PVR /* Processor Version */ 224#define PVR SPRN_PVR /* Processor Version */
374#define PIR SPRN_PIR /* Processor ID */ 225#define PIR SPRN_PIR /* Processor ID */
375#define PURR SPRN_PURR /* Processor Utilization of Resource Register */ 226#define PURR SPRN_PURR /* Processor Utilization of Resource Register */
376//#define RPA SPRN_RPA /* Required Physical Address Register */
377#define SDR1 SPRN_SDR1 /* MMU hash base register */ 227#define SDR1 SPRN_SDR1 /* MMU hash base register */
378#define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */ 228#define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */
379#define SPR1 SPRN_SPRG1 229#define SPR1 SPRN_SPRG1
@@ -389,10 +239,6 @@
389#define TBRU SPRN_TBRU /* Time Base Read Upper Register */ 239#define TBRU SPRN_TBRU /* Time Base Read Upper Register */
390#define TBWL SPRN_TBWL /* Time Base Write Lower Register */ 240#define TBWL SPRN_TBWL /* Time Base Write Lower Register */
391#define TBWU SPRN_TBWU /* Time Base Write Upper Register */ 241#define TBWU SPRN_TBWU /* Time Base Write Upper Register */
392#define ICTC 1019
393#define THRM1 SPRN_THRM1 /* Thermal Management Register 1 */
394#define THRM2 SPRN_THRM2 /* Thermal Management Register 2 */
395#define THRM3 SPRN_THRM3 /* Thermal Management Register 3 */
396#define XER SPRN_XER 242#define XER SPRN_XER
397 243
398/* Processor Version Register (PVR) field extraction */ 244/* Processor Version Register (PVR) field extraction */
@@ -436,12 +282,6 @@
436#define XGLUE(a,b) a##b 282#define XGLUE(a,b) a##b
437#define GLUE(a,b) XGLUE(a,b) 283#define GLUE(a,b) XGLUE(a,b)
438 284
439/* iSeries CTRL register (for runlatch) */
440
441#define CTRLT 0x098
442#define CTRLF 0x088
443#define RUNLATCH 0x0001
444
445#ifdef __ASSEMBLY__ 285#ifdef __ASSEMBLY__
446 286
447#define _GLOBAL(name) \ 287#define _GLOBAL(name) \
@@ -656,6 +496,24 @@ static inline void prefetchw(const void *x)
656 496
657#define HAVE_ARCH_PICK_MMAP_LAYOUT 497#define HAVE_ARCH_PICK_MMAP_LAYOUT
658 498
499static inline void ppc64_runlatch_on(void)
500{
501 unsigned long ctrl;
502
503 ctrl = mfspr(SPRN_CTRLF);
504 ctrl |= CTRL_RUNLATCH;
505 mtspr(SPRN_CTRLT, ctrl);
506}
507
508static inline void ppc64_runlatch_off(void)
509{
510 unsigned long ctrl;
511
512 ctrl = mfspr(SPRN_CTRLF);
513 ctrl &= ~CTRL_RUNLATCH;
514 mtspr(SPRN_CTRLT, ctrl);
515}
516
659#endif /* __KERNEL__ */ 517#endif /* __KERNEL__ */
660 518
661#endif /* __ASSEMBLY__ */ 519#endif /* __ASSEMBLY__ */
diff --git a/include/asm-ppc64/thread_info.h b/include/asm-ppc64/thread_info.h
index 037b5e06083c..48b7900e90ec 100644
--- a/include/asm-ppc64/thread_info.h
+++ b/include/asm-ppc64/thread_info.h
@@ -96,7 +96,7 @@ static inline struct thread_info *current_thread_info(void)
96#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling 96#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
97 TIF_NEED_RESCHED */ 97 TIF_NEED_RESCHED */
98#define TIF_32BIT 5 /* 32 bit binary */ 98#define TIF_32BIT 5 /* 32 bit binary */
99#define TIF_RUN_LIGHT 6 /* iSeries run light */ 99/* #define SPARE 6 */
100#define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ 100#define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */
101#define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ 101#define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */
102#define TIF_SINGLESTEP 9 /* singlestepping active */ 102#define TIF_SINGLESTEP 9 /* singlestepping active */
@@ -110,7 +110,7 @@ static inline struct thread_info *current_thread_info(void)
110#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 110#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
111#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 111#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
112#define _TIF_32BIT (1<<TIF_32BIT) 112#define _TIF_32BIT (1<<TIF_32BIT)
113#define _TIF_RUN_LIGHT (1<<TIF_RUN_LIGHT) 113/* #define _SPARE (1<<SPARE) */
114#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) 114#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
115#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 115#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
116#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 116#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
diff --git a/include/asm-s390/user.h b/include/asm-s390/user.h
index c64f8c181df3..1dc74baf03c4 100644
--- a/include/asm-s390/user.h
+++ b/include/asm-s390/user.h
@@ -10,7 +10,7 @@
10#define _S390_USER_H 10#define _S390_USER_H
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13#include <linux/ptrace.h> 13#include <asm/ptrace.h>
14/* Core file format: The core file is written in such a way that gdb 14/* Core file format: The core file is written in such a way that gdb
15 can understand it and provide useful information to the user (under 15 can understand it and provide useful information to the user (under
16 linux we use the 'trad-core' bfd). There are quite a number of 16 linux we use the 'trad-core' bfd). There are quite a number of
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h
index f461144067ee..0a780e84a12b 100644
--- a/include/asm-sparc/uaccess.h
+++ b/include/asm-sparc/uaccess.h
@@ -41,10 +41,11 @@
41 * No one can read/write anything from userland in the kernel space by setting 41 * No one can read/write anything from userland in the kernel space by setting
42 * large size and address near to PAGE_OFFSET - a fault will break his intentions. 42 * large size and address near to PAGE_OFFSET - a fault will break his intentions.
43 */ 43 */
44#define __user_ok(addr,size) ((addr) < STACK_TOP) 44#define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; })
45#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) 45#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
46#define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size))) 46#define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size)))
47#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) 47#define access_ok(type, addr, size) \
48 ({ (void)(type); __access_ok((unsigned long)(addr), size); })
48 49
49/* this function will go away soon - use access_ok() instead */ 50/* this function will go away soon - use access_ok() instead */
50static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) 51static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
diff --git a/include/asm-sparc64/agp.h b/include/asm-sparc64/agp.h
index ba05bdf9a211..58f8cb6ae767 100644
--- a/include/asm-sparc64/agp.h
+++ b/include/asm-sparc64/agp.h
@@ -8,4 +8,14 @@
8#define flush_agp_mappings() 8#define flush_agp_mappings()
9#define flush_agp_cache() mb() 9#define flush_agp_cache() mb()
10 10
11/* Convert a physical address to an address suitable for the GART. */
12#define phys_to_gart(x) (x)
13#define gart_to_phys(x) (x)
14
15/* GATT allocation. Returns/accepts GATT kernel virtual address. */
16#define alloc_gatt_pages(order) \
17 ((char *)__get_free_pages(GFP_KERNEL, (order)))
18#define free_gatt_pages(table, order) \
19 free_pages((unsigned long)(table), (order))
20
11#endif 21#endif
diff --git a/include/asm-x86_64/agp.h b/include/asm-x86_64/agp.h
index 0bb9019d58aa..06c52ee9c06b 100644
--- a/include/asm-x86_64/agp.h
+++ b/include/asm-x86_64/agp.h
@@ -19,4 +19,14 @@ int unmap_page_from_agp(struct page *page);
19 worth it. Would need a page for it. */ 19 worth it. Would need a page for it. */
20#define flush_agp_cache() asm volatile("wbinvd":::"memory") 20#define flush_agp_cache() asm volatile("wbinvd":::"memory")
21 21
22/* Convert a physical address to an address suitable for the GART. */
23#define phys_to_gart(x) (x)
24#define gart_to_phys(x) (x)
25
26/* GATT allocation. Returns/accepts GATT kernel virtual address. */
27#define alloc_gatt_pages(order) \
28 ((char *)__get_free_pages(GFP_KERNEL, (order)))
29#define free_gatt_pages(table, order) \
30 free_pages((unsigned long)(table), (order))
31
22#endif 32#endif
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d5a55bdb9c3c..b123cc08773d 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,6 +25,8 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#include <linux/config.h>
29
28#ifdef CONFIG_ACPI 30#ifdef CONFIG_ACPI
29 31
30#ifndef _LINUX 32#ifndef _LINUX
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
index 0485b256d043..004e6f09a6e2 100644
--- a/include/linux/if_shaper.h
+++ b/include/linux/if_shaper.h
@@ -23,7 +23,7 @@ struct shaper
23 __u32 shapeclock; 23 __u32 shapeclock;
24 unsigned long recovery; /* Time we can next clock a packet out on 24 unsigned long recovery; /* Time we can next clock a packet out on
25 an empty queue */ 25 an empty queue */
26 unsigned long locked; 26 struct semaphore sem;
27 struct net_device_stats stats; 27 struct net_device_stats stats;
28 struct net_device *dev; 28 struct net_device *dev;
29 int (*hard_start_xmit) (struct sk_buff *skb, 29 int (*hard_start_xmit) (struct sk_buff *skb,
@@ -38,7 +38,6 @@ struct shaper
38 int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); 38 int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh);
39 void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); 39 void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr);
40 struct net_device_stats* (*get_stats)(struct net_device *dev); 40 struct net_device_stats* (*get_stats)(struct net_device *dev);
41 wait_queue_head_t wait_queue;
42 struct timer_list timer; 41 struct timer_list timer;
43}; 42};
44 43
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h
index 6688b414c529..3fba9e2f5427 100644
--- a/include/linux/if_tr.h
+++ b/include/linux/if_tr.h
@@ -19,6 +19,8 @@
19#ifndef _LINUX_IF_TR_H 19#ifndef _LINUX_IF_TR_H
20#define _LINUX_IF_TR_H 20#define _LINUX_IF_TR_H
21 21
22#include <asm/byteorder.h> /* For __be16 */
23
22/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble 24/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
23 and FCS/CRC (frame check sequence). */ 25 and FCS/CRC (frame check sequence). */
24#define TR_ALEN 6 /* Octets in one token-ring addr */ 26#define TR_ALEN 6 /* Octets in one token-ring addr */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index e74f301e9bae..b009f801e7c5 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -467,12 +467,34 @@ static inline u8 ata_chk_status(struct ata_port *ap)
467 return ap->ops->check_status(ap); 467 return ap->ops->check_status(ap);
468} 468}
469 469
470
471/**
472 * ata_pause - Flush writes and pause 400 nanoseconds.
473 * @ap: Port to wait for.
474 *
475 * LOCKING:
476 * Inherited from caller.
477 */
478
470static inline void ata_pause(struct ata_port *ap) 479static inline void ata_pause(struct ata_port *ap)
471{ 480{
472 ata_altstatus(ap); 481 ata_altstatus(ap);
473 ndelay(400); 482 ndelay(400);
474} 483}
475 484
485
486/**
487 * ata_busy_wait - Wait for a port status register
488 * @ap: Port to wait for.
489 *
490 * Waits up to max*10 microseconds for the selected bits in the port's
491 * status register to be cleared.
492 * Returns final value of status register.
493 *
494 * LOCKING:
495 * Inherited from caller.
496 */
497
476static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, 498static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
477 unsigned int max) 499 unsigned int max)
478{ 500{
@@ -487,6 +509,18 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
487 return status; 509 return status;
488} 510}
489 511
512
513/**
514 * ata_wait_idle - Wait for a port to be idle.
515 * @ap: Port to wait for.
516 *
517 * Waits up to 10ms for port's BUSY and DRQ signals to clear.
518 * Returns final value of status register.
519 *
520 * LOCKING:
521 * Inherited from caller.
522 */
523
490static inline u8 ata_wait_idle(struct ata_port *ap) 524static inline u8 ata_wait_idle(struct ata_port *ap)
491{ 525{
492 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 526 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
@@ -525,6 +559,18 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns
525 tf->device = ATA_DEVICE_OBS | ATA_DEV1; 559 tf->device = ATA_DEVICE_OBS | ATA_DEV1;
526} 560}
527 561
562
563/**
564 * ata_irq_on - Enable interrupts on a port.
565 * @ap: Port on which interrupts are enabled.
566 *
567 * Enable interrupts on a legacy IDE device using MMIO or PIO,
568 * wait for idle, clear any pending interrupts.
569 *
570 * LOCKING:
571 * Inherited from caller.
572 */
573
528static inline u8 ata_irq_on(struct ata_port *ap) 574static inline u8 ata_irq_on(struct ata_port *ap)
529{ 575{
530 struct ata_ioports *ioaddr = &ap->ioaddr; 576 struct ata_ioports *ioaddr = &ap->ioaddr;
@@ -544,6 +590,18 @@ static inline u8 ata_irq_on(struct ata_port *ap)
544 return tmp; 590 return tmp;
545} 591}
546 592
593
594/**
595 * ata_irq_ack - Acknowledge a device interrupt.
596 * @ap: Port on which interrupts are enabled.
597 *
598 * Wait up to 10 ms for legacy IDE device to become idle (BUSY
599 * or BUSY+DRQ clear). Obtain dma status and port status from
600 * device. Clear the interrupt. Return port status.
601 *
602 * LOCKING:
603 */
604
547static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) 605static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
548{ 606{
549 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; 607 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 470af8c1a4a0..ba5d1236aa17 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -204,7 +204,7 @@ struct hh_cache
204 /* cached hardware header; allow for machine alignment needs. */ 204 /* cached hardware header; allow for machine alignment needs. */
205#define HH_DATA_MOD 16 205#define HH_DATA_MOD 16
206#define HH_DATA_OFF(__len) \ 206#define HH_DATA_OFF(__len) \
207 (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1))) 207 (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1))
208#define HH_DATA_ALIGN(__len) \ 208#define HH_DATA_ALIGN(__len) \
209 (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) 209 (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
210 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; 210 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b0d6134e1ee6..b8b4ebf9abf1 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -874,6 +874,7 @@
874#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 874#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026
875#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 875#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027
876#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d 876#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d
877#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
877#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 878#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
878#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 879#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
879#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 880#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033
@@ -2382,6 +2383,8 @@
2382#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 2383#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582
2383#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 2384#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
2384#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 2385#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
2386#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
2387#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
2385#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2388#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
2386#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 2389#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
2387#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 2390#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0a98f5ec5cae..7be18b5e2fb4 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -231,10 +231,8 @@ extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
231extern long do_sigpending(void __user *, unsigned long); 231extern long do_sigpending(void __user *, unsigned long);
232extern int sigprocmask(int, sigset_t *, sigset_t *); 232extern int sigprocmask(int, sigset_t *, sigset_t *);
233 233
234#ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER
235struct pt_regs; 234struct pt_regs;
236extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); 235extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
237#endif
238 236
239#endif /* __KERNEL__ */ 237#endif /* __KERNEL__ */
240 238
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 23032d9d6071..a17745c80a91 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -346,6 +346,7 @@ enum
346 NET_TCP_MODERATE_RCVBUF=106, 346 NET_TCP_MODERATE_RCVBUF=106,
347 NET_TCP_TSO_WIN_DIVISOR=107, 347 NET_TCP_TSO_WIN_DIVISOR=107,
348 NET_TCP_BIC_BETA=108, 348 NET_TCP_BIC_BETA=108,
349 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
349}; 350};
350 351
351enum { 352enum {
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index aa6b48bb4dcd..a6b2cc530af5 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -56,6 +56,36 @@ enum
56 TCF_META_ID_TCCLASSID, 56 TCF_META_ID_TCCLASSID,
57 TCF_META_ID_RTCLASSID, 57 TCF_META_ID_RTCLASSID,
58 TCF_META_ID_RTIIF, 58 TCF_META_ID_RTIIF,
59 TCF_META_ID_SK_FAMILY,
60 TCF_META_ID_SK_STATE,
61 TCF_META_ID_SK_REUSE,
62 TCF_META_ID_SK_BOUND_IF,
63 TCF_META_ID_SK_REFCNT,
64 TCF_META_ID_SK_SHUTDOWN,
65 TCF_META_ID_SK_PROTO,
66 TCF_META_ID_SK_TYPE,
67 TCF_META_ID_SK_RCVBUF,
68 TCF_META_ID_SK_RMEM_ALLOC,
69 TCF_META_ID_SK_WMEM_ALLOC,
70 TCF_META_ID_SK_OMEM_ALLOC,
71 TCF_META_ID_SK_WMEM_QUEUED,
72 TCF_META_ID_SK_RCV_QLEN,
73 TCF_META_ID_SK_SND_QLEN,
74 TCF_META_ID_SK_ERR_QLEN,
75 TCF_META_ID_SK_FORWARD_ALLOCS,
76 TCF_META_ID_SK_SNDBUF,
77 TCF_META_ID_SK_ALLOCS,
78 TCF_META_ID_SK_ROUTE_CAPS,
79 TCF_META_ID_SK_HASHENT,
80 TCF_META_ID_SK_LINGERTIME,
81 TCF_META_ID_SK_ACK_BACKLOG,
82 TCF_META_ID_SK_MAX_ACK_BACKLOG,
83 TCF_META_ID_SK_PRIO,
84 TCF_META_ID_SK_RCVLOWAT,
85 TCF_META_ID_SK_RCVTIMEO,
86 TCF_META_ID_SK_SNDTIMEO,
87 TCF_META_ID_SK_SENDMSG_OFF,
88 TCF_META_ID_SK_WRITE_PENDING,
59 __TCF_META_ID_MAX 89 __TCF_META_ID_MAX
60}; 90};
61#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 91#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 41d1a644c9d4..2d1ac5058534 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -796,6 +796,10 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
796 * of the iso_frame_desc array, and the number of errors is reported in 796 * of the iso_frame_desc array, and the number of errors is reported in
797 * error_count. Completion callbacks for ISO transfers will normally 797 * error_count. Completion callbacks for ISO transfers will normally
798 * (re)submit URBs to ensure a constant transfer rate. 798 * (re)submit URBs to ensure a constant transfer rate.
799 *
800 * Note that even fields marked "public" should not be touched by the driver
801 * when the urb is owned by the hcd, that is, since the call to
802 * usb_submit_urb() till the entry into the completion routine.
799 */ 803 */
800struct urb 804struct urb
801{ 805{
@@ -803,12 +807,12 @@ struct urb
803 struct kref kref; /* reference count of the URB */ 807 struct kref kref; /* reference count of the URB */
804 spinlock_t lock; /* lock for the URB */ 808 spinlock_t lock; /* lock for the URB */
805 void *hcpriv; /* private data for host controller */ 809 void *hcpriv; /* private data for host controller */
806 struct list_head urb_list; /* list pointer to all active urbs */
807 int bandwidth; /* bandwidth for INT/ISO request */ 810 int bandwidth; /* bandwidth for INT/ISO request */
808 atomic_t use_count; /* concurrent submissions counter */ 811 atomic_t use_count; /* concurrent submissions counter */
809 u8 reject; /* submissions will fail */ 812 u8 reject; /* submissions will fail */
810 813
811 /* public, documented fields in the urb that can be used by drivers */ 814 /* public, documented fields in the urb that can be used by drivers */
815 struct list_head urb_list; /* list head for use by the urb owner */
812 struct usb_device *dev; /* (in) pointer to associated device */ 816 struct usb_device *dev; /* (in) pointer to associated device */
813 unsigned int pipe; /* (in) pipe information */ 817 unsigned int pipe; /* (in) pipe information */
814 int status; /* (return) non-ISO status */ 818 int status; /* (return) non-ISO status */
diff --git a/include/net/ip.h b/include/net/ip.h
index 3f63992eb712..32360bbe143f 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -163,6 +163,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
163 163
164extern int sysctl_local_port_range[2]; 164extern int sysctl_local_port_range[2];
165extern int sysctl_ip_default_ttl; 165extern int sysctl_ip_default_ttl;
166extern int sysctl_ip_nonlocal_bind;
166 167
167#ifdef CONFIG_INET 168#ifdef CONFIG_INET
168/* The function in 2.2 was invalid, producing wrong result for 169/* The function in 2.2 was invalid, producing wrong result for
diff --git a/kernel/exit.c b/kernel/exit.c
index edaa50b5bbfa..2ef2ad540201 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -811,10 +811,8 @@ fastcall NORET_TYPE void do_exit(long code)
811 acct_update_integrals(tsk); 811 acct_update_integrals(tsk);
812 update_mem_hiwater(tsk); 812 update_mem_hiwater(tsk);
813 group_dead = atomic_dec_and_test(&tsk->signal->live); 813 group_dead = atomic_dec_and_test(&tsk->signal->live);
814 if (group_dead) { 814 if (group_dead)
815 del_timer_sync(&tsk->signal->real_timer);
816 acct_process(code); 815 acct_process(code);
817 }
818 exit_mm(tsk); 816 exit_mm(tsk);
819 817
820 exit_sem(tsk); 818 exit_sem(tsk);
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index fd316c272260..cabb63fc9e16 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -1197,6 +1197,7 @@ void exit_itimers(struct signal_struct *sig)
1197 tmr = list_entry(sig->posix_timers.next, struct k_itimer, list); 1197 tmr = list_entry(sig->posix_timers.next, struct k_itimer, list);
1198 itimer_delete(tmr); 1198 itimer_delete(tmr);
1199 } 1199 }
1200 del_timer_sync(&sig->real_timer);
1200} 1201}
1201 1202
1202/* 1203/*
diff --git a/kernel/sched.c b/kernel/sched.c
index 66b2ed784822..f12a0c8a7d98 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3755,19 +3755,22 @@ EXPORT_SYMBOL(cond_resched);
3755 */ 3755 */
3756int cond_resched_lock(spinlock_t * lock) 3756int cond_resched_lock(spinlock_t * lock)
3757{ 3757{
3758 int ret = 0;
3759
3758 if (need_lockbreak(lock)) { 3760 if (need_lockbreak(lock)) {
3759 spin_unlock(lock); 3761 spin_unlock(lock);
3760 cpu_relax(); 3762 cpu_relax();
3763 ret = 1;
3761 spin_lock(lock); 3764 spin_lock(lock);
3762 } 3765 }
3763 if (need_resched()) { 3766 if (need_resched()) {
3764 _raw_spin_unlock(lock); 3767 _raw_spin_unlock(lock);
3765 preempt_enable_no_resched(); 3768 preempt_enable_no_resched();
3766 __cond_resched(); 3769 __cond_resched();
3770 ret = 1;
3767 spin_lock(lock); 3771 spin_lock(lock);
3768 return 1;
3769 } 3772 }
3770 return 0; 3773 return ret;
3771} 3774}
3772 3775
3773EXPORT_SYMBOL(cond_resched_lock); 3776EXPORT_SYMBOL(cond_resched_lock);
diff --git a/mm/filemap.c b/mm/filemap.c
index 1d33fec7bac6..4a2fee2cb62b 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1968,6 +1968,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
1968 do { 1968 do {
1969 unsigned long index; 1969 unsigned long index;
1970 unsigned long offset; 1970 unsigned long offset;
1971 unsigned long maxlen;
1971 size_t copied; 1972 size_t copied;
1972 1973
1973 offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */ 1974 offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */
@@ -1982,7 +1983,10 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
1982 * same page as we're writing to, without it being marked 1983 * same page as we're writing to, without it being marked
1983 * up-to-date. 1984 * up-to-date.
1984 */ 1985 */
1985 fault_in_pages_readable(buf, bytes); 1986 maxlen = cur_iov->iov_len - iov_base;
1987 if (maxlen > bytes)
1988 maxlen = bytes;
1989 fault_in_pages_readable(buf, maxlen);
1986 1990
1987 page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); 1991 page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
1988 if (!page) { 1992 if (!page) {
@@ -2024,6 +2028,8 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
2024 filemap_set_next_iovec(&cur_iov, 2028 filemap_set_next_iovec(&cur_iov,
2025 &iov_base, status); 2029 &iov_base, status);
2026 buf = cur_iov->iov_base + iov_base; 2030 buf = cur_iov->iov_base + iov_base;
2031 } else {
2032 iov_base += status;
2027 } 2033 }
2028 } 2034 }
2029 } 2035 }
diff --git a/net/core/dev.c b/net/core/dev.c
index f15a3ffff635..ab935778ce81 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1744,6 +1744,7 @@ static int process_backlog(struct net_device *backlog_dev, int *budget)
1744 struct softnet_data *queue = &__get_cpu_var(softnet_data); 1744 struct softnet_data *queue = &__get_cpu_var(softnet_data);
1745 unsigned long start_time = jiffies; 1745 unsigned long start_time = jiffies;
1746 1746
1747 backlog_dev->weight = weight_p;
1747 for (;;) { 1748 for (;;) {
1748 struct sk_buff *skb; 1749 struct sk_buff *skb;
1749 struct net_device *dev; 1750 struct net_device *dev;
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 8ec484894d68..a3eeb88e1c81 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -356,7 +356,7 @@ static int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr)
356{ 356{
357 struct ethtool_coalesce coalesce; 357 struct ethtool_coalesce coalesce;
358 358
359 if (!dev->ethtool_ops->get_coalesce) 359 if (!dev->ethtool_ops->set_coalesce)
360 return -EOPNOTSUPP; 360 return -EOPNOTSUPP;
361 361
362 if (copy_from_user(&coalesce, useraddr, sizeof(coalesce))) 362 if (copy_from_user(&coalesce, useraddr, sizeof(coalesce)))
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 910eb4c05a47..e2137f3e489d 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -185,6 +185,22 @@ static ssize_t store_tx_queue_len(struct class_device *dev, const char *buf, siz
185static CLASS_DEVICE_ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len, 185static CLASS_DEVICE_ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len,
186 store_tx_queue_len); 186 store_tx_queue_len);
187 187
188NETDEVICE_SHOW(weight, fmt_dec);
189
190static int change_weight(struct net_device *net, unsigned long new_weight)
191{
192 net->weight = new_weight;
193 return 0;
194}
195
196static ssize_t store_weight(struct class_device *dev, const char *buf, size_t len)
197{
198 return netdev_store(dev, buf, len, change_weight);
199}
200
201static CLASS_DEVICE_ATTR(weight, S_IRUGO | S_IWUSR, show_weight,
202 store_weight);
203
188 204
189static struct class_device_attribute *net_class_attributes[] = { 205static struct class_device_attribute *net_class_attributes[] = {
190 &class_device_attr_ifindex, 206 &class_device_attr_ifindex,
@@ -194,6 +210,7 @@ static struct class_device_attribute *net_class_attributes[] = {
194 &class_device_attr_features, 210 &class_device_attr_features,
195 &class_device_attr_mtu, 211 &class_device_attr_mtu,
196 &class_device_attr_flags, 212 &class_device_attr_flags,
213 &class_device_attr_weight,
197 &class_device_attr_type, 214 &class_device_attr_type,
198 &class_device_attr_address, 215 &class_device_attr_address,
199 &class_device_attr_broadcast, 216 &class_device_attr_broadcast,
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index b3cb49ce5fad..03942f133944 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1181,6 +1181,7 @@ EXPORT_SYMBOL(inet_stream_connect);
1181EXPORT_SYMBOL(inet_stream_ops); 1181EXPORT_SYMBOL(inet_stream_ops);
1182EXPORT_SYMBOL(inet_unregister_protosw); 1182EXPORT_SYMBOL(inet_unregister_protosw);
1183EXPORT_SYMBOL(net_statistics); 1183EXPORT_SYMBOL(net_statistics);
1184EXPORT_SYMBOL(sysctl_ip_nonlocal_bind);
1184 1185
1185#ifdef INET_REFCNT_DEBUG 1186#ifdef INET_REFCNT_DEBUG
1186EXPORT_SYMBOL(inet_sock_nr); 1187EXPORT_SYMBOL(inet_sock_nr);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 85bf0d3e294b..cb759484979d 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -207,6 +207,7 @@ int sysctl_icmp_ignore_bogus_error_responses;
207 207
208int sysctl_icmp_ratelimit = 1 * HZ; 208int sysctl_icmp_ratelimit = 1 * HZ;
209int sysctl_icmp_ratemask = 0x1818; 209int sysctl_icmp_ratemask = 0x1818;
210int sysctl_icmp_errors_use_inbound_ifaddr;
210 211
211/* 212/*
212 * ICMP control array. This specifies what to do with each ICMP. 213 * ICMP control array. This specifies what to do with each ICMP.
@@ -511,8 +512,12 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info)
511 */ 512 */
512 513
513 saddr = iph->daddr; 514 saddr = iph->daddr;
514 if (!(rt->rt_flags & RTCF_LOCAL)) 515 if (!(rt->rt_flags & RTCF_LOCAL)) {
515 saddr = 0; 516 if (sysctl_icmp_errors_use_inbound_ifaddr)
517 saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK);
518 else
519 saddr = 0;
520 }
516 521
517 tos = icmp_pointers[type].error ? ((iph->tos & IPTOS_TOS_MASK) | 522 tos = icmp_pointers[type].error ? ((iph->tos & IPTOS_TOS_MASK) |
518 IPTOS_PREC_INTERNETCONTROL) : 523 IPTOS_PREC_INTERNETCONTROL) :
diff --git a/net/ipv4/ipvs/Makefile b/net/ipv4/ipvs/Makefile
index a788461a40c9..30e85de9ffff 100644
--- a/net/ipv4/ipvs/Makefile
+++ b/net/ipv4/ipvs/Makefile
@@ -11,7 +11,7 @@ ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH) += ip_vs_proto_ah.o
11 11
12ip_vs-objs := ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \ 12ip_vs-objs := ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \
13 ip_vs_xmit.o ip_vs_app.o ip_vs_sync.o \ 13 ip_vs_xmit.o ip_vs_app.o ip_vs_sync.o \
14 ip_vs_est.o ip_vs_proto.o ip_vs_proto_icmp.o \ 14 ip_vs_est.o ip_vs_proto.o \
15 $(ip_vs_proto-objs-y) 15 $(ip_vs_proto-objs-y)
16 16
17 17
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
index 253c46252bd5..867d4e9c6594 100644
--- a/net/ipv4/ipvs/ip_vs_proto.c
+++ b/net/ipv4/ipvs/ip_vs_proto.c
@@ -216,9 +216,6 @@ int ip_vs_protocol_init(void)
216#ifdef CONFIG_IP_VS_PROTO_UDP 216#ifdef CONFIG_IP_VS_PROTO_UDP
217 REGISTER_PROTOCOL(&ip_vs_protocol_udp); 217 REGISTER_PROTOCOL(&ip_vs_protocol_udp);
218#endif 218#endif
219#ifdef CONFIG_IP_VS_PROTO_ICMP
220 REGISTER_PROTOCOL(&ip_vs_protocol_icmp);
221#endif
222#ifdef CONFIG_IP_VS_PROTO_AH 219#ifdef CONFIG_IP_VS_PROTO_AH
223 REGISTER_PROTOCOL(&ip_vs_protocol_ah); 220 REGISTER_PROTOCOL(&ip_vs_protocol_ah);
224#endif 221#endif
diff --git a/net/ipv4/ipvs/ip_vs_proto_icmp.c b/net/ipv4/ipvs/ip_vs_proto_icmp.c
deleted file mode 100644
index 191e94aa1c1f..000000000000
--- a/net/ipv4/ipvs/ip_vs_proto_icmp.c
+++ /dev/null
@@ -1,182 +0,0 @@
1/*
2 * ip_vs_proto_icmp.c: ICMP load balancing support for IP Virtual Server
3 *
4 * Authors: Julian Anastasov <ja@ssi.bg>, March 2002
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation;
9 *
10 */
11
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/icmp.h>
15#include <linux/netfilter.h>
16#include <linux/netfilter_ipv4.h>
17
18#include <net/ip_vs.h>
19
20
21static int icmp_timeouts[1] = { 1*60*HZ };
22
23static char * icmp_state_name_table[1] = { "ICMP" };
24
25static struct ip_vs_conn *
26icmp_conn_in_get(const struct sk_buff *skb,
27 struct ip_vs_protocol *pp,
28 const struct iphdr *iph,
29 unsigned int proto_off,
30 int inverse)
31{
32#if 0
33 struct ip_vs_conn *cp;
34
35 if (likely(!inverse)) {
36 cp = ip_vs_conn_in_get(iph->protocol,
37 iph->saddr, 0,
38 iph->daddr, 0);
39 } else {
40 cp = ip_vs_conn_in_get(iph->protocol,
41 iph->daddr, 0,
42 iph->saddr, 0);
43 }
44
45 return cp;
46
47#else
48 return NULL;
49#endif
50}
51
52static struct ip_vs_conn *
53icmp_conn_out_get(const struct sk_buff *skb,
54 struct ip_vs_protocol *pp,
55 const struct iphdr *iph,
56 unsigned int proto_off,
57 int inverse)
58{
59#if 0
60 struct ip_vs_conn *cp;
61
62 if (likely(!inverse)) {
63 cp = ip_vs_conn_out_get(iph->protocol,
64 iph->saddr, 0,
65 iph->daddr, 0);
66 } else {
67 cp = ip_vs_conn_out_get(IPPROTO_UDP,
68 iph->daddr, 0,
69 iph->saddr, 0);
70 }
71
72 return cp;
73#else
74 return NULL;
75#endif
76}
77
78static int
79icmp_conn_schedule(struct sk_buff *skb, struct ip_vs_protocol *pp,
80 int *verdict, struct ip_vs_conn **cpp)
81{
82 *verdict = NF_ACCEPT;
83 return 0;
84}
85
86static int
87icmp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
88{
89 if (!(skb->nh.iph->frag_off & __constant_htons(IP_OFFSET))) {
90 if (skb->ip_summed != CHECKSUM_UNNECESSARY) {
91 if (ip_vs_checksum_complete(skb, skb->nh.iph->ihl * 4)) {
92 IP_VS_DBG_RL_PKT(0, pp, skb, 0, "Failed checksum for");
93 return 0;
94 }
95 }
96 }
97 return 1;
98}
99
100static void
101icmp_debug_packet(struct ip_vs_protocol *pp,
102 const struct sk_buff *skb,
103 int offset,
104 const char *msg)
105{
106 char buf[256];
107 struct iphdr _iph, *ih;
108
109 ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph);
110 if (ih == NULL)
111 sprintf(buf, "%s TRUNCATED", pp->name);
112 else if (ih->frag_off & __constant_htons(IP_OFFSET))
113 sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u frag",
114 pp->name, NIPQUAD(ih->saddr),
115 NIPQUAD(ih->daddr));
116 else {
117 struct icmphdr _icmph, *ic;
118
119 ic = skb_header_pointer(skb, offset + ih->ihl*4,
120 sizeof(_icmph), &_icmph);
121 if (ic == NULL)
122 sprintf(buf, "%s TRUNCATED to %u bytes\n",
123 pp->name, skb->len - offset);
124 else
125 sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u T:%d C:%d",
126 pp->name, NIPQUAD(ih->saddr),
127 NIPQUAD(ih->daddr),
128 ic->type, ic->code);
129 }
130 printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
131}
132
133static int
134icmp_state_transition(struct ip_vs_conn *cp, int direction,
135 const struct sk_buff *skb,
136 struct ip_vs_protocol *pp)
137{
138 cp->timeout = pp->timeout_table[IP_VS_ICMP_S_NORMAL];
139 return 1;
140}
141
142static int
143icmp_set_state_timeout(struct ip_vs_protocol *pp, char *sname, int to)
144{
145 int num;
146 char **names;
147
148 num = IP_VS_ICMP_S_LAST;
149 names = icmp_state_name_table;
150 return ip_vs_set_state_timeout(pp->timeout_table, num, names, sname, to);
151}
152
153
154static void icmp_init(struct ip_vs_protocol *pp)
155{
156 pp->timeout_table = icmp_timeouts;
157}
158
159static void icmp_exit(struct ip_vs_protocol *pp)
160{
161}
162
163struct ip_vs_protocol ip_vs_protocol_icmp = {
164 .name = "ICMP",
165 .protocol = IPPROTO_ICMP,
166 .dont_defrag = 0,
167 .init = icmp_init,
168 .exit = icmp_exit,
169 .conn_schedule = icmp_conn_schedule,
170 .conn_in_get = icmp_conn_in_get,
171 .conn_out_get = icmp_conn_out_get,
172 .snat_handler = NULL,
173 .dnat_handler = NULL,
174 .csum_check = icmp_csum_check,
175 .state_transition = icmp_state_transition,
176 .register_app = NULL,
177 .unregister_app = NULL,
178 .app_conn_bind = NULL,
179 .debug_packet = icmp_debug_packet,
180 .timeout_change = NULL,
181 .set_state_timeout = icmp_set_state_timeout,
182};
diff --git a/net/ipv4/multipath_drr.c b/net/ipv4/multipath_drr.c
index cf2e6bcf7973..c9cf8726051d 100644
--- a/net/ipv4/multipath_drr.c
+++ b/net/ipv4/multipath_drr.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -247,3 +248,4 @@ static void __exit drr_exit(void)
247 248
248module_init(drr_init); 249module_init(drr_init);
249module_exit(drr_exit); 250module_exit(drr_exit);
251MODULE_LICENSE("GPL");
diff --git a/net/ipv4/multipath_random.c b/net/ipv4/multipath_random.c
index 805a16e47de5..5249dbe7c559 100644
--- a/net/ipv4/multipath_random.c
+++ b/net/ipv4/multipath_random.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -126,3 +127,4 @@ static void __exit random_exit(void)
126 127
127module_init(random_init); 128module_init(random_init);
128module_exit(random_exit); 129module_exit(random_exit);
130MODULE_LICENSE("GPL");
diff --git a/net/ipv4/multipath_rr.c b/net/ipv4/multipath_rr.c
index 061b6b253982..b6cd2870478f 100644
--- a/net/ipv4/multipath_rr.c
+++ b/net/ipv4/multipath_rr.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -93,3 +94,4 @@ static void __exit rr_exit(void)
93 94
94module_init(rr_init); 95module_init(rr_init);
95module_exit(rr_exit); 96module_exit(rr_exit);
97MODULE_LICENSE("GPL");
diff --git a/net/ipv4/multipath_wrandom.c b/net/ipv4/multipath_wrandom.c
index c3d2ca1a6781..bd7d75b6abe0 100644
--- a/net/ipv4/multipath_wrandom.c
+++ b/net/ipv4/multipath_wrandom.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -342,3 +343,4 @@ static void __exit wrandom_exit(void)
342 343
343module_init(wrandom_init); 344module_init(wrandom_init);
344module_exit(wrandom_exit); 345module_exit(wrandom_exit);
346MODULE_LICENSE("GPL");
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
index 46ca45f74d85..bc59f7b39805 100644
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -256,6 +256,7 @@ static void *exp_seq_next(struct seq_file *s, void *v, loff_t *pos)
256{ 256{
257 struct list_head *e = v; 257 struct list_head *e = v;
258 258
259 ++*pos;
259 e = e->next; 260 e = e->next;
260 261
261 if (e == &ip_conntrack_expect_list) 262 if (e == &ip_conntrack_expect_list)
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index 25ab9fabdcba..2d44b07688af 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -223,7 +223,7 @@ static int ip_recent_ctrl(struct file *file, const char __user *input, unsigned
223 curr_table->table[count].last_seen = 0; 223 curr_table->table[count].last_seen = 0;
224 curr_table->table[count].addr = 0; 224 curr_table->table[count].addr = 0;
225 curr_table->table[count].ttl = 0; 225 curr_table->table[count].ttl = 0;
226 memset(curr_table->table[count].last_pkts,0,ip_pkt_list_tot*sizeof(u_int32_t)); 226 memset(curr_table->table[count].last_pkts,0,ip_pkt_list_tot*sizeof(unsigned long));
227 curr_table->table[count].oldest_pkt = 0; 227 curr_table->table[count].oldest_pkt = 0;
228 curr_table->table[count].time_pos = 0; 228 curr_table->table[count].time_pos = 0;
229 curr_table->time_info[count].position = count; 229 curr_table->time_info[count].position = count;
@@ -502,7 +502,7 @@ match(const struct sk_buff *skb,
502 location = time_info[curr_table->time_pos].position; 502 location = time_info[curr_table->time_pos].position;
503 hash_table[r_list[location].hash_entry] = -1; 503 hash_table[r_list[location].hash_entry] = -1;
504 hash_table[hash_result] = location; 504 hash_table[hash_result] = location;
505 memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(u_int32_t)); 505 memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(unsigned long));
506 r_list[location].time_pos = curr_table->time_pos; 506 r_list[location].time_pos = curr_table->time_pos;
507 r_list[location].addr = addr; 507 r_list[location].addr = addr;
508 r_list[location].ttl = ttl; 508 r_list[location].ttl = ttl;
@@ -631,7 +631,7 @@ match(const struct sk_buff *skb,
631 r_list[location].last_seen = 0; 631 r_list[location].last_seen = 0;
632 r_list[location].addr = 0; 632 r_list[location].addr = 0;
633 r_list[location].ttl = 0; 633 r_list[location].ttl = 0;
634 memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(u_int32_t)); 634 memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(unsigned long));
635 r_list[location].oldest_pkt = 0; 635 r_list[location].oldest_pkt = 0;
636 ans = !info->invert; 636 ans = !info->invert;
637 } 637 }
@@ -734,10 +734,10 @@ checkentry(const char *tablename,
734 memset(curr_table->table,0,sizeof(struct recent_ip_list)*ip_list_tot); 734 memset(curr_table->table,0,sizeof(struct recent_ip_list)*ip_list_tot);
735#ifdef DEBUG 735#ifdef DEBUG
736 if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: Allocating %d for pkt_list.\n", 736 if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: Allocating %d for pkt_list.\n",
737 sizeof(u_int32_t)*ip_pkt_list_tot*ip_list_tot); 737 sizeof(unsigned long)*ip_pkt_list_tot*ip_list_tot);
738#endif 738#endif
739 739
740 hold = vmalloc(sizeof(u_int32_t)*ip_pkt_list_tot*ip_list_tot); 740 hold = vmalloc(sizeof(unsigned long)*ip_pkt_list_tot*ip_list_tot);
741#ifdef DEBUG 741#ifdef DEBUG
742 if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: After pkt_list allocation.\n"); 742 if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: After pkt_list allocation.\n");
743#endif 743#endif
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 3aafb298c1c1..23068bddbf0b 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -23,6 +23,7 @@ extern int sysctl_ip_nonlocal_bind;
23extern int sysctl_icmp_echo_ignore_all; 23extern int sysctl_icmp_echo_ignore_all;
24extern int sysctl_icmp_echo_ignore_broadcasts; 24extern int sysctl_icmp_echo_ignore_broadcasts;
25extern int sysctl_icmp_ignore_bogus_error_responses; 25extern int sysctl_icmp_ignore_bogus_error_responses;
26extern int sysctl_icmp_errors_use_inbound_ifaddr;
26 27
27/* From ip_fragment.c */ 28/* From ip_fragment.c */
28extern int sysctl_ipfrag_low_thresh; 29extern int sysctl_ipfrag_low_thresh;
@@ -396,6 +397,14 @@ ctl_table ipv4_table[] = {
396 .proc_handler = &proc_dointvec 397 .proc_handler = &proc_dointvec
397 }, 398 },
398 { 399 {
400 .ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
401 .procname = "icmp_errors_use_inbound_ifaddr",
402 .data = &sysctl_icmp_errors_use_inbound_ifaddr,
403 .maxlen = sizeof(int),
404 .mode = 0644,
405 .proc_handler = &proc_dointvec
406 },
407 {
399 .ctl_name = NET_IPV4_ROUTE, 408 .ctl_name = NET_IPV4_ROUTE,
400 .procname = "route", 409 .procname = "route",
401 .maxlen = 0, 410 .maxlen = 0,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index a037bafcba3c..0d9a4fd5f1a4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2338,7 +2338,7 @@ void __init tcp_init(void)
2338 (tcp_bhash_size * sizeof(struct tcp_bind_hashbucket)); 2338 (tcp_bhash_size * sizeof(struct tcp_bind_hashbucket));
2339 order++) 2339 order++)
2340 ; 2340 ;
2341 if (order > 4) { 2341 if (order >= 4) {
2342 sysctl_local_port_range[0] = 32768; 2342 sysctl_local_port_range[0] = 32768;
2343 sysctl_local_port_range[1] = 61000; 2343 sysctl_local_port_range[1] = 61000;
2344 sysctl_tcp_max_tw_buckets = 180000; 2344 sysctl_tcp_max_tw_buckets = 180000;
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7744a2592693..2720899d516c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -372,6 +372,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
372 ndev->regen_timer.data = (unsigned long) ndev; 372 ndev->regen_timer.data = (unsigned long) ndev;
373 if ((dev->flags&IFF_LOOPBACK) || 373 if ((dev->flags&IFF_LOOPBACK) ||
374 dev->type == ARPHRD_TUNNEL || 374 dev->type == ARPHRD_TUNNEL ||
375 dev->type == ARPHRD_NONE ||
375 dev->type == ARPHRD_SIT) { 376 dev->type == ARPHRD_SIT) {
376 printk(KERN_INFO 377 printk(KERN_INFO
377 "Disabled Privacy Extensions on device %p(%s)\n", 378 "Disabled Privacy Extensions on device %p(%s)\n",
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 8e0f569b883e..ff3ec9822e36 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -277,8 +277,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
277{ 277{
278 struct inet6_dev *idev = NULL; 278 struct inet6_dev *idev = NULL;
279 struct ipv6hdr *hdr = skb->nh.ipv6h; 279 struct ipv6hdr *hdr = skb->nh.ipv6h;
280 struct sock *sk = icmpv6_socket->sk; 280 struct sock *sk;
281 struct ipv6_pinfo *np = inet6_sk(sk); 281 struct ipv6_pinfo *np;
282 struct in6_addr *saddr = NULL; 282 struct in6_addr *saddr = NULL;
283 struct dst_entry *dst; 283 struct dst_entry *dst;
284 struct icmp6hdr tmp_hdr; 284 struct icmp6hdr tmp_hdr;
@@ -358,6 +358,9 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
358 if (icmpv6_xmit_lock()) 358 if (icmpv6_xmit_lock())
359 return; 359 return;
360 360
361 sk = icmpv6_socket->sk;
362 np = inet6_sk(sk);
363
361 if (!icmpv6_xrlim_allow(sk, type, &fl)) 364 if (!icmpv6_xrlim_allow(sk, type, &fl))
362 goto out; 365 goto out;
363 366
@@ -423,9 +426,9 @@ out:
423 426
424static void icmpv6_echo_reply(struct sk_buff *skb) 427static void icmpv6_echo_reply(struct sk_buff *skb)
425{ 428{
426 struct sock *sk = icmpv6_socket->sk; 429 struct sock *sk;
427 struct inet6_dev *idev; 430 struct inet6_dev *idev;
428 struct ipv6_pinfo *np = inet6_sk(sk); 431 struct ipv6_pinfo *np;
429 struct in6_addr *saddr = NULL; 432 struct in6_addr *saddr = NULL;
430 struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw; 433 struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw;
431 struct icmp6hdr tmp_hdr; 434 struct icmp6hdr tmp_hdr;
@@ -454,6 +457,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
454 if (icmpv6_xmit_lock()) 457 if (icmpv6_xmit_lock())
455 return; 458 return;
456 459
460 sk = icmpv6_socket->sk;
461 np = inet6_sk(sk);
462
457 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) 463 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst))
458 fl.oif = np->mcast_oif; 464 fl.oif = np->mcast_oif;
459 465
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 3b1c9fa184ae..ba3b0c267f75 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -882,6 +882,7 @@ ip6ip6_tnl_change(struct ip6_tnl *t, struct ip6_tnl_parm *p)
882 t->parms.hop_limit = p->hop_limit; 882 t->parms.hop_limit = p->hop_limit;
883 t->parms.encap_limit = p->encap_limit; 883 t->parms.encap_limit = p->encap_limit;
884 t->parms.flowinfo = p->flowinfo; 884 t->parms.flowinfo = p->flowinfo;
885 t->parms.link = p->link;
885 ip6ip6_tnl_link_config(t); 886 ip6ip6_tnl_link_config(t);
886 return 0; 887 return 0;
887} 888}
diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c
index 2f4c91ddc9a3..5ade5a5d1990 100644
--- a/net/ipv6/ipv6_syms.c
+++ b/net/ipv6/ipv6_syms.c
@@ -37,5 +37,4 @@ EXPORT_SYMBOL(in6_dev_finish_destroy);
37EXPORT_SYMBOL(xfrm6_rcv); 37EXPORT_SYMBOL(xfrm6_rcv);
38#endif 38#endif
39EXPORT_SYMBOL(rt6_lookup); 39EXPORT_SYMBOL(rt6_lookup);
40EXPORT_SYMBOL(fl6_sock_lookup);
41EXPORT_SYMBOL(ipv6_push_nfrag_opts); 40EXPORT_SYMBOL(ipv6_push_nfrag_opts);
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index b0941186f867..b22c9beb604d 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -405,7 +405,7 @@ config NET_EMATCH_STACK
405 ---help--- 405 ---help---
406 Size of the local stack variable used while evaluating the tree of 406 Size of the local stack variable used while evaluating the tree of
407 ematches. Limits the depth of the tree, i.e. the number of 407 ematches. Limits the depth of the tree, i.e. the number of
408 encapsulated precedences. Every level requires 4 bytes of addtional 408 encapsulated precedences. Every level requires 4 bytes of additional
409 stack space. 409 stack space.
410 410
411config NET_EMATCH_CMP 411config NET_EMATCH_CMP
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index cafcb084098d..914c85ff8fe6 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -881,7 +881,7 @@ static int __init tc_action_init(void)
881 link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action; 881 link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action;
882 } 882 }
883 883
884 printk("TC classifier action (bugs to netdev@oss.sgi.com cc " 884 printk("TC classifier action (bugs to netdev@vger.kernel.org cc "
885 "hadi@cyberus.ca)\n"); 885 "hadi@cyberus.ca)\n");
886 return 0; 886 return 0;
887} 887}
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index 0d2d4415f334..dfb300bb6baa 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -261,6 +261,9 @@ static int basic_dump(struct tcf_proto *tp, unsigned long fh,
261 rta = (struct rtattr *) b; 261 rta = (struct rtattr *) b;
262 RTA_PUT(skb, TCA_OPTIONS, 0, NULL); 262 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
263 263
264 if (f->res.classid)
265 RTA_PUT(skb, TCA_BASIC_CLASSID, sizeof(u32), &f->res.classid);
266
264 if (tcf_exts_dump(skb, &f->exts, &basic_ext_map) < 0 || 267 if (tcf_exts_dump(skb, &f->exts, &basic_ext_map) < 0 ||
265 tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0) 268 tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0)
266 goto rtattr_failure; 269 goto rtattr_failure;
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c
index f1eeaf65cee5..48bb23c2a35a 100644
--- a/net/sched/em_meta.c
+++ b/net/sched/em_meta.c
@@ -32,7 +32,7 @@
32 * +-----------+ +-----------+ 32 * +-----------+ +-----------+
33 * | | 33 * | |
34 * ---> meta_ops[INT][INDEV](...) | 34 * ---> meta_ops[INT][INDEV](...) |
35 * | | 35 * | |
36 * ----------- | 36 * ----------- |
37 * V V 37 * V V
38 * +-----------+ +-----------+ 38 * +-----------+ +-----------+
@@ -70,6 +70,7 @@
70#include <net/dst.h> 70#include <net/dst.h>
71#include <net/route.h> 71#include <net/route.h>
72#include <net/pkt_cls.h> 72#include <net/pkt_cls.h>
73#include <net/sock.h>
73 74
74struct meta_obj 75struct meta_obj
75{ 76{
@@ -284,6 +285,214 @@ META_COLLECTOR(int_rtiif)
284} 285}
285 286
286/************************************************************************** 287/**************************************************************************
288 * Socket Attributes
289 **************************************************************************/
290
291#define SKIP_NONLOCAL(skb) \
292 if (unlikely(skb->sk == NULL)) { \
293 *err = -1; \
294 return; \
295 }
296
297META_COLLECTOR(int_sk_family)
298{
299 SKIP_NONLOCAL(skb);
300 dst->value = skb->sk->sk_family;
301}
302
303META_COLLECTOR(int_sk_state)
304{
305 SKIP_NONLOCAL(skb);
306 dst->value = skb->sk->sk_state;
307}
308
309META_COLLECTOR(int_sk_reuse)
310{
311 SKIP_NONLOCAL(skb);
312 dst->value = skb->sk->sk_reuse;
313}
314
315META_COLLECTOR(int_sk_bound_if)
316{
317 SKIP_NONLOCAL(skb);
318 /* No error if bound_dev_if is 0, legal userspace check */
319 dst->value = skb->sk->sk_bound_dev_if;
320}
321
322META_COLLECTOR(var_sk_bound_if)
323{
324 SKIP_NONLOCAL(skb);
325
326 if (skb->sk->sk_bound_dev_if == 0) {
327 dst->value = (unsigned long) "any";
328 dst->len = 3;
329 } else {
330 struct net_device *dev;
331
332 dev = dev_get_by_index(skb->sk->sk_bound_dev_if);
333 *err = var_dev(dev, dst);
334 if (dev)
335 dev_put(dev);
336 }
337}
338
339META_COLLECTOR(int_sk_refcnt)
340{
341 SKIP_NONLOCAL(skb);
342 dst->value = atomic_read(&skb->sk->sk_refcnt);
343}
344
345META_COLLECTOR(int_sk_rcvbuf)
346{
347 SKIP_NONLOCAL(skb);
348 dst->value = skb->sk->sk_rcvbuf;
349}
350
351META_COLLECTOR(int_sk_shutdown)
352{
353 SKIP_NONLOCAL(skb);
354 dst->value = skb->sk->sk_shutdown;
355}
356
357META_COLLECTOR(int_sk_proto)
358{
359 SKIP_NONLOCAL(skb);
360 dst->value = skb->sk->sk_protocol;
361}
362
363META_COLLECTOR(int_sk_type)
364{
365 SKIP_NONLOCAL(skb);
366 dst->value = skb->sk->sk_type;
367}
368
369META_COLLECTOR(int_sk_rmem_alloc)
370{
371 SKIP_NONLOCAL(skb);
372 dst->value = atomic_read(&skb->sk->sk_rmem_alloc);
373}
374
375META_COLLECTOR(int_sk_wmem_alloc)
376{
377 SKIP_NONLOCAL(skb);
378 dst->value = atomic_read(&skb->sk->sk_wmem_alloc);
379}
380
381META_COLLECTOR(int_sk_omem_alloc)
382{
383 SKIP_NONLOCAL(skb);
384 dst->value = atomic_read(&skb->sk->sk_omem_alloc);
385}
386
387META_COLLECTOR(int_sk_rcv_qlen)
388{
389 SKIP_NONLOCAL(skb);
390 dst->value = skb->sk->sk_receive_queue.qlen;
391}
392
393META_COLLECTOR(int_sk_snd_qlen)
394{
395 SKIP_NONLOCAL(skb);
396 dst->value = skb->sk->sk_write_queue.qlen;
397}
398
399META_COLLECTOR(int_sk_wmem_queued)
400{
401 SKIP_NONLOCAL(skb);
402 dst->value = skb->sk->sk_wmem_queued;
403}
404
405META_COLLECTOR(int_sk_fwd_alloc)
406{
407 SKIP_NONLOCAL(skb);
408 dst->value = skb->sk->sk_forward_alloc;
409}
410
411META_COLLECTOR(int_sk_sndbuf)
412{
413 SKIP_NONLOCAL(skb);
414 dst->value = skb->sk->sk_sndbuf;
415}
416
417META_COLLECTOR(int_sk_alloc)
418{
419 SKIP_NONLOCAL(skb);
420 dst->value = skb->sk->sk_allocation;
421}
422
423META_COLLECTOR(int_sk_route_caps)
424{
425 SKIP_NONLOCAL(skb);
426 dst->value = skb->sk->sk_route_caps;
427}
428
429META_COLLECTOR(int_sk_hashent)
430{
431 SKIP_NONLOCAL(skb);
432 dst->value = skb->sk->sk_hashent;
433}
434
435META_COLLECTOR(int_sk_lingertime)
436{
437 SKIP_NONLOCAL(skb);
438 dst->value = skb->sk->sk_lingertime / HZ;
439}
440
441META_COLLECTOR(int_sk_err_qlen)
442{
443 SKIP_NONLOCAL(skb);
444 dst->value = skb->sk->sk_error_queue.qlen;
445}
446
447META_COLLECTOR(int_sk_ack_bl)
448{
449 SKIP_NONLOCAL(skb);
450 dst->value = skb->sk->sk_ack_backlog;
451}
452
453META_COLLECTOR(int_sk_max_ack_bl)
454{
455 SKIP_NONLOCAL(skb);
456 dst->value = skb->sk->sk_max_ack_backlog;
457}
458
459META_COLLECTOR(int_sk_prio)
460{
461 SKIP_NONLOCAL(skb);
462 dst->value = skb->sk->sk_priority;
463}
464
465META_COLLECTOR(int_sk_rcvlowat)
466{
467 SKIP_NONLOCAL(skb);
468 dst->value = skb->sk->sk_rcvlowat;
469}
470
471META_COLLECTOR(int_sk_rcvtimeo)
472{
473 SKIP_NONLOCAL(skb);
474 dst->value = skb->sk->sk_rcvtimeo / HZ;
475}
476
477META_COLLECTOR(int_sk_sndtimeo)
478{
479 SKIP_NONLOCAL(skb);
480 dst->value = skb->sk->sk_sndtimeo / HZ;
481}
482
483META_COLLECTOR(int_sk_sendmsg_off)
484{
485 SKIP_NONLOCAL(skb);
486 dst->value = skb->sk->sk_sndmsg_off;
487}
488
489META_COLLECTOR(int_sk_write_pend)
490{
491 SKIP_NONLOCAL(skb);
492 dst->value = skb->sk->sk_write_pending;
493}
494
495/**************************************************************************
287 * Meta value collectors assignment table 496 * Meta value collectors assignment table
288 **************************************************************************/ 497 **************************************************************************/
289 498
@@ -293,41 +502,75 @@ struct meta_ops
293 struct meta_value *, struct meta_obj *, int *); 502 struct meta_value *, struct meta_obj *, int *);
294}; 503};
295 504
505#define META_ID(name) TCF_META_ID_##name
506#define META_FUNC(name) { .get = meta_##name }
507
296/* Meta value operations table listing all meta value collectors and 508/* Meta value operations table listing all meta value collectors and
297 * assigns them to a type and meta id. */ 509 * assigns them to a type and meta id. */
298static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = { 510static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = {
299 [TCF_META_TYPE_VAR] = { 511 [TCF_META_TYPE_VAR] = {
300 [TCF_META_ID_DEV] = { .get = meta_var_dev }, 512 [META_ID(DEV)] = META_FUNC(var_dev),
301 [TCF_META_ID_INDEV] = { .get = meta_var_indev }, 513 [META_ID(INDEV)] = META_FUNC(var_indev),
302 [TCF_META_ID_REALDEV] = { .get = meta_var_realdev } 514 [META_ID(REALDEV)] = META_FUNC(var_realdev),
515 [META_ID(SK_BOUND_IF)] = META_FUNC(var_sk_bound_if),
303 }, 516 },
304 [TCF_META_TYPE_INT] = { 517 [TCF_META_TYPE_INT] = {
305 [TCF_META_ID_RANDOM] = { .get = meta_int_random }, 518 [META_ID(RANDOM)] = META_FUNC(int_random),
306 [TCF_META_ID_LOADAVG_0] = { .get = meta_int_loadavg_0 }, 519 [META_ID(LOADAVG_0)] = META_FUNC(int_loadavg_0),
307 [TCF_META_ID_LOADAVG_1] = { .get = meta_int_loadavg_1 }, 520 [META_ID(LOADAVG_1)] = META_FUNC(int_loadavg_1),
308 [TCF_META_ID_LOADAVG_2] = { .get = meta_int_loadavg_2 }, 521 [META_ID(LOADAVG_2)] = META_FUNC(int_loadavg_2),
309 [TCF_META_ID_DEV] = { .get = meta_int_dev }, 522 [META_ID(DEV)] = META_FUNC(int_dev),
310 [TCF_META_ID_INDEV] = { .get = meta_int_indev }, 523 [META_ID(INDEV)] = META_FUNC(int_indev),
311 [TCF_META_ID_REALDEV] = { .get = meta_int_realdev }, 524 [META_ID(REALDEV)] = META_FUNC(int_realdev),
312 [TCF_META_ID_PRIORITY] = { .get = meta_int_priority }, 525 [META_ID(PRIORITY)] = META_FUNC(int_priority),
313 [TCF_META_ID_PROTOCOL] = { .get = meta_int_protocol }, 526 [META_ID(PROTOCOL)] = META_FUNC(int_protocol),
314 [TCF_META_ID_SECURITY] = { .get = meta_int_security }, 527 [META_ID(SECURITY)] = META_FUNC(int_security),
315 [TCF_META_ID_PKTTYPE] = { .get = meta_int_pkttype }, 528 [META_ID(PKTTYPE)] = META_FUNC(int_pkttype),
316 [TCF_META_ID_PKTLEN] = { .get = meta_int_pktlen }, 529 [META_ID(PKTLEN)] = META_FUNC(int_pktlen),
317 [TCF_META_ID_DATALEN] = { .get = meta_int_datalen }, 530 [META_ID(DATALEN)] = META_FUNC(int_datalen),
318 [TCF_META_ID_MACLEN] = { .get = meta_int_maclen }, 531 [META_ID(MACLEN)] = META_FUNC(int_maclen),
319#ifdef CONFIG_NETFILTER 532#ifdef CONFIG_NETFILTER
320 [TCF_META_ID_NFMARK] = { .get = meta_int_nfmark }, 533 [META_ID(NFMARK)] = META_FUNC(int_nfmark),
321#endif 534#endif
322 [TCF_META_ID_TCINDEX] = { .get = meta_int_tcindex }, 535 [META_ID(TCINDEX)] = META_FUNC(int_tcindex),
323#ifdef CONFIG_NET_CLS_ACT 536#ifdef CONFIG_NET_CLS_ACT
324 [TCF_META_ID_TCVERDICT] = { .get = meta_int_tcverd }, 537 [META_ID(TCVERDICT)] = META_FUNC(int_tcverd),
325 [TCF_META_ID_TCCLASSID] = { .get = meta_int_tcclassid }, 538 [META_ID(TCCLASSID)] = META_FUNC(int_tcclassid),
326#endif 539#endif
327#ifdef CONFIG_NET_CLS_ROUTE 540#ifdef CONFIG_NET_CLS_ROUTE
328 [TCF_META_ID_RTCLASSID] = { .get = meta_int_rtclassid }, 541 [META_ID(RTCLASSID)] = META_FUNC(int_rtclassid),
329#endif 542#endif
330 [TCF_META_ID_RTIIF] = { .get = meta_int_rtiif } 543 [META_ID(RTIIF)] = META_FUNC(int_rtiif),
544 [META_ID(SK_FAMILY)] = META_FUNC(int_sk_family),
545 [META_ID(SK_STATE)] = META_FUNC(int_sk_state),
546 [META_ID(SK_REUSE)] = META_FUNC(int_sk_reuse),
547 [META_ID(SK_BOUND_IF)] = META_FUNC(int_sk_bound_if),
548 [META_ID(SK_REFCNT)] = META_FUNC(int_sk_refcnt),
549 [META_ID(SK_RCVBUF)] = META_FUNC(int_sk_rcvbuf),
550 [META_ID(SK_SNDBUF)] = META_FUNC(int_sk_sndbuf),
551 [META_ID(SK_SHUTDOWN)] = META_FUNC(int_sk_shutdown),
552 [META_ID(SK_PROTO)] = META_FUNC(int_sk_proto),
553 [META_ID(SK_TYPE)] = META_FUNC(int_sk_type),
554 [META_ID(SK_RMEM_ALLOC)] = META_FUNC(int_sk_rmem_alloc),
555 [META_ID(SK_WMEM_ALLOC)] = META_FUNC(int_sk_wmem_alloc),
556 [META_ID(SK_OMEM_ALLOC)] = META_FUNC(int_sk_omem_alloc),
557 [META_ID(SK_WMEM_QUEUED)] = META_FUNC(int_sk_wmem_queued),
558 [META_ID(SK_RCV_QLEN)] = META_FUNC(int_sk_rcv_qlen),
559 [META_ID(SK_SND_QLEN)] = META_FUNC(int_sk_snd_qlen),
560 [META_ID(SK_ERR_QLEN)] = META_FUNC(int_sk_err_qlen),
561 [META_ID(SK_FORWARD_ALLOCS)] = META_FUNC(int_sk_fwd_alloc),
562 [META_ID(SK_ALLOCS)] = META_FUNC(int_sk_alloc),
563 [META_ID(SK_ROUTE_CAPS)] = META_FUNC(int_sk_route_caps),
564 [META_ID(SK_HASHENT)] = META_FUNC(int_sk_hashent),
565 [META_ID(SK_LINGERTIME)] = META_FUNC(int_sk_lingertime),
566 [META_ID(SK_ACK_BACKLOG)] = META_FUNC(int_sk_ack_bl),
567 [META_ID(SK_MAX_ACK_BACKLOG)] = META_FUNC(int_sk_max_ack_bl),
568 [META_ID(SK_PRIO)] = META_FUNC(int_sk_prio),
569 [META_ID(SK_RCVLOWAT)] = META_FUNC(int_sk_rcvlowat),
570 [META_ID(SK_RCVTIMEO)] = META_FUNC(int_sk_rcvtimeo),
571 [META_ID(SK_SNDTIMEO)] = META_FUNC(int_sk_sndtimeo),
572 [META_ID(SK_SENDMSG_OFF)] = META_FUNC(int_sk_sendmsg_off),
573 [META_ID(SK_WRITE_PENDING)] = META_FUNC(int_sk_write_pend),
331 } 574 }
332}; 575};
333 576
@@ -396,9 +639,9 @@ static int meta_int_compare(struct meta_obj *a, struct meta_obj *b)
396 /* Let gcc optimize it, the unlikely is not really based on 639 /* Let gcc optimize it, the unlikely is not really based on
397 * some numbers but jump free code for mismatches seems 640 * some numbers but jump free code for mismatches seems
398 * more logical. */ 641 * more logical. */
399 if (unlikely(a == b)) 642 if (unlikely(a->value == b->value))
400 return 0; 643 return 0;
401 else if (a < b) 644 else if (a->value < b->value)
402 return -1; 645 return -1;
403 else 646 else
404 return 1; 647 return 1;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index b719a77d66b4..fffc880a646d 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -178,6 +178,37 @@ int sctp_rcv(struct sk_buff *skb)
178 178
179 asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport); 179 asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport);
180 180
181 if (!asoc)
182 ep = __sctp_rcv_lookup_endpoint(&dest);
183
184 /* Retrieve the common input handling substructure. */
185 rcvr = asoc ? &asoc->base : &ep->base;
186 sk = rcvr->sk;
187
188 /*
189 * If a frame arrives on an interface and the receiving socket is
190 * bound to another interface, via SO_BINDTODEVICE, treat it as OOTB
191 */
192 if (sk->sk_bound_dev_if && (sk->sk_bound_dev_if != af->skb_iif(skb)))
193 {
194 sock_put(sk);
195 if (asoc) {
196 sctp_association_put(asoc);
197 asoc = NULL;
198 } else {
199 sctp_endpoint_put(ep);
200 ep = NULL;
201 }
202 sk = sctp_get_ctl_sock();
203 ep = sctp_sk(sk)->ep;
204 sctp_endpoint_hold(ep);
205 sock_hold(sk);
206 rcvr = &ep->base;
207 }
208
209 if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
210 goto discard_release;
211
181 /* 212 /*
182 * RFC 2960, 8.4 - Handle "Out of the blue" Packets. 213 * RFC 2960, 8.4 - Handle "Out of the blue" Packets.
183 * An SCTP packet is called an "out of the blue" (OOTB) 214 * An SCTP packet is called an "out of the blue" (OOTB)
@@ -187,22 +218,12 @@ int sctp_rcv(struct sk_buff *skb)
187 * packet belongs. 218 * packet belongs.
188 */ 219 */
189 if (!asoc) { 220 if (!asoc) {
190 ep = __sctp_rcv_lookup_endpoint(&dest);
191 if (sctp_rcv_ootb(skb)) { 221 if (sctp_rcv_ootb(skb)) {
192 SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES); 222 SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES);
193 goto discard_release; 223 goto discard_release;
194 } 224 }
195 } 225 }
196 226
197 /* Retrieve the common input handling substructure. */
198 rcvr = asoc ? &asoc->base : &ep->base;
199 sk = rcvr->sk;
200
201 if ((sk) && (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)) {
202 goto discard_release;
203 }
204
205
206 /* SCTP seems to always need a timestamp right now (FIXME) */ 227 /* SCTP seems to always need a timestamp right now (FIXME) */
207 if (skb->stamp.tv_sec == 0) { 228 if (skb->stamp.tv_sec == 0) {
208 do_gettimeofday(&skb->stamp); 229 do_gettimeofday(&skb->stamp);
@@ -265,13 +286,11 @@ discard_it:
265 286
266discard_release: 287discard_release:
267 /* Release any structures we may be holding. */ 288 /* Release any structures we may be holding. */
268 if (asoc) { 289 sock_put(sk);
269 sock_put(asoc->base.sk); 290 if (asoc)
270 sctp_association_put(asoc); 291 sctp_association_put(asoc);
271 } else { 292 else
272 sock_put(ep->base.sk);
273 sctp_endpoint_put(ep); 293 sctp_endpoint_put(ep);
274 }
275 294
276 goto discard_it; 295 goto discard_it;
277} 296}
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index c9d9ea064734..c7e42d125b9c 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -812,26 +812,23 @@ static int sctp_inet6_bind_verify(struct sctp_sock *opt, union sctp_addr *addr)
812 if (addr->sa.sa_family != AF_INET6) 812 if (addr->sa.sa_family != AF_INET6)
813 af = sctp_get_af_specific(addr->sa.sa_family); 813 af = sctp_get_af_specific(addr->sa.sa_family);
814 else { 814 else {
815 struct sock *sk;
816 int type = ipv6_addr_type(&addr->v6.sin6_addr); 815 int type = ipv6_addr_type(&addr->v6.sin6_addr);
817 sk = sctp_opt2sk(opt); 816 struct net_device *dev;
817
818 if (type & IPV6_ADDR_LINKLOCAL) { 818 if (type & IPV6_ADDR_LINKLOCAL) {
819 /* Note: Behavior similar to af_inet6.c: 819 if (!addr->v6.sin6_scope_id)
820 * 1) Overrides previous bound_dev_if 820 return 0;
821 * 2) Destructive even if bind isn't successful. 821 dev = dev_get_by_index(addr->v6.sin6_scope_id);
822 */ 822 if (!dev)
823
824 if (addr->v6.sin6_scope_id)
825 sk->sk_bound_dev_if = addr->v6.sin6_scope_id;
826 if (!sk->sk_bound_dev_if)
827 return 0; 823 return 0;
824 dev_put(dev);
828 } 825 }
829 af = opt->pf->af; 826 af = opt->pf->af;
830 } 827 }
831 return af->available(addr, opt); 828 return af->available(addr, opt);
832} 829}
833 830
834/* Verify that the provided sockaddr looks bindable. Common verification, 831/* Verify that the provided sockaddr looks sendable. Common verification,
835 * has already been taken care of. 832 * has already been taken care of.
836 */ 833 */
837static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr) 834static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr)
@@ -842,19 +839,16 @@ static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr)
842 if (addr->sa.sa_family != AF_INET6) 839 if (addr->sa.sa_family != AF_INET6)
843 af = sctp_get_af_specific(addr->sa.sa_family); 840 af = sctp_get_af_specific(addr->sa.sa_family);
844 else { 841 else {
845 struct sock *sk;
846 int type = ipv6_addr_type(&addr->v6.sin6_addr); 842 int type = ipv6_addr_type(&addr->v6.sin6_addr);
847 sk = sctp_opt2sk(opt); 843 struct net_device *dev;
844
848 if (type & IPV6_ADDR_LINKLOCAL) { 845 if (type & IPV6_ADDR_LINKLOCAL) {
849 /* Note: Behavior similar to af_inet6.c: 846 if (!addr->v6.sin6_scope_id)
850 * 1) Overrides previous bound_dev_if 847 return 0;
851 * 2) Destructive even if bind isn't successful. 848 dev = dev_get_by_index(addr->v6.sin6_scope_id);
852 */ 849 if (!dev)
853
854 if (addr->v6.sin6_scope_id)
855 sk->sk_bound_dev_if = addr->v6.sin6_scope_id;
856 if (!sk->sk_bound_dev_if)
857 return 0; 850 return 0;
851 dev_put(dev);
858 } 852 }
859 af = opt->pf->af; 853 af = opt->pf->af;
860 } 854 }
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index e42fd8c2916b..98d49ec9b74b 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -132,14 +132,25 @@ void sctp_snmp_proc_exit(void)
132static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) 132static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb)
133{ 133{
134 struct list_head *pos; 134 struct list_head *pos;
135 struct sctp_association *asoc;
135 struct sctp_sockaddr_entry *laddr; 136 struct sctp_sockaddr_entry *laddr;
136 union sctp_addr *addr; 137 struct sctp_transport *peer;
138 union sctp_addr *addr, *primary = NULL;
137 struct sctp_af *af; 139 struct sctp_af *af;
138 140
141 if (epb->type == SCTP_EP_TYPE_ASSOCIATION) {
142 asoc = sctp_assoc(epb);
143 peer = asoc->peer.primary_path;
144 primary = &peer->saddr;
145 }
146
139 list_for_each(pos, &epb->bind_addr.address_list) { 147 list_for_each(pos, &epb->bind_addr.address_list) {
140 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 148 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
141 addr = (union sctp_addr *)&laddr->a; 149 addr = (union sctp_addr *)&laddr->a;
142 af = sctp_get_af_specific(addr->sa.sa_family); 150 af = sctp_get_af_specific(addr->sa.sa_family);
151 if (primary && af->cmp_addr(addr, primary)) {
152 seq_printf(seq, "*");
153 }
143 af->seq_dump_addr(seq, addr); 154 af->seq_dump_addr(seq, addr);
144 } 155 }
145} 156}
@@ -149,17 +160,54 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
149{ 160{
150 struct list_head *pos; 161 struct list_head *pos;
151 struct sctp_transport *transport; 162 struct sctp_transport *transport;
152 union sctp_addr *addr; 163 union sctp_addr *addr, *primary;
153 struct sctp_af *af; 164 struct sctp_af *af;
154 165
166 primary = &(assoc->peer.primary_addr);
155 list_for_each(pos, &assoc->peer.transport_addr_list) { 167 list_for_each(pos, &assoc->peer.transport_addr_list) {
156 transport = list_entry(pos, struct sctp_transport, transports); 168 transport = list_entry(pos, struct sctp_transport, transports);
157 addr = (union sctp_addr *)&transport->ipaddr; 169 addr = (union sctp_addr *)&transport->ipaddr;
158 af = sctp_get_af_specific(addr->sa.sa_family); 170 af = sctp_get_af_specific(addr->sa.sa_family);
171 if (af->cmp_addr(addr, primary)) {
172 seq_printf(seq, "*");
173 }
159 af->seq_dump_addr(seq, addr); 174 af->seq_dump_addr(seq, addr);
160 } 175 }
161} 176}
162 177
178static void * sctp_eps_seq_start(struct seq_file *seq, loff_t *pos)
179{
180 if (*pos > sctp_ep_hashsize)
181 return NULL;
182
183 if (*pos < 0)
184 *pos = 0;
185
186 if (*pos == 0)
187 seq_printf(seq, " ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS\n");
188
189 ++*pos;
190
191 return (void *)pos;
192}
193
194static void sctp_eps_seq_stop(struct seq_file *seq, void *v)
195{
196 return;
197}
198
199
200static void * sctp_eps_seq_next(struct seq_file *seq, void *v, loff_t *pos)
201{
202 if (*pos > sctp_ep_hashsize)
203 return NULL;
204
205 ++*pos;
206
207 return pos;
208}
209
210
163/* Display sctp endpoints (/proc/net/sctp/eps). */ 211/* Display sctp endpoints (/proc/net/sctp/eps). */
164static int sctp_eps_seq_show(struct seq_file *seq, void *v) 212static int sctp_eps_seq_show(struct seq_file *seq, void *v)
165{ 213{
@@ -167,38 +215,50 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
167 struct sctp_ep_common *epb; 215 struct sctp_ep_common *epb;
168 struct sctp_endpoint *ep; 216 struct sctp_endpoint *ep;
169 struct sock *sk; 217 struct sock *sk;
170 int hash; 218 int hash = *(int *)v;
171 219
172 seq_printf(seq, " ENDPT SOCK STY SST HBKT LPORT LADDRS\n"); 220 if (hash > sctp_ep_hashsize)
173 for (hash = 0; hash < sctp_ep_hashsize; hash++) { 221 return -ENOMEM;
174 head = &sctp_ep_hashtable[hash]; 222
175 read_lock(&head->lock); 223 head = &sctp_ep_hashtable[hash-1];
176 for (epb = head->chain; epb; epb = epb->next) { 224 sctp_local_bh_disable();
177 ep = sctp_ep(epb); 225 read_lock(&head->lock);
178 sk = epb->sk; 226 for (epb = head->chain; epb; epb = epb->next) {
179 seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d ", ep, sk, 227 ep = sctp_ep(epb);
180 sctp_sk(sk)->type, sk->sk_state, hash, 228 sk = epb->sk;
181 epb->bind_addr.port); 229 seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
182 sctp_seq_dump_local_addrs(seq, epb); 230 sctp_sk(sk)->type, sk->sk_state, hash-1,
183 seq_printf(seq, "\n"); 231 epb->bind_addr.port,
184 } 232 sock_i_uid(sk), sock_i_ino(sk));
185 read_unlock(&head->lock); 233
234 sctp_seq_dump_local_addrs(seq, epb);
235 seq_printf(seq, "\n");
186 } 236 }
237 read_unlock(&head->lock);
238 sctp_local_bh_enable();
187 239
188 return 0; 240 return 0;
189} 241}
190 242
243static struct seq_operations sctp_eps_ops = {
244 .start = sctp_eps_seq_start,
245 .next = sctp_eps_seq_next,
246 .stop = sctp_eps_seq_stop,
247 .show = sctp_eps_seq_show,
248};
249
250
191/* Initialize the seq file operations for 'eps' object. */ 251/* Initialize the seq file operations for 'eps' object. */
192static int sctp_eps_seq_open(struct inode *inode, struct file *file) 252static int sctp_eps_seq_open(struct inode *inode, struct file *file)
193{ 253{
194 return single_open(file, sctp_eps_seq_show, NULL); 254 return seq_open(file, &sctp_eps_ops);
195} 255}
196 256
197static struct file_operations sctp_eps_seq_fops = { 257static struct file_operations sctp_eps_seq_fops = {
198 .open = sctp_eps_seq_open, 258 .open = sctp_eps_seq_open,
199 .read = seq_read, 259 .read = seq_read,
200 .llseek = seq_lseek, 260 .llseek = seq_lseek,
201 .release = single_release, 261 .release = seq_release,
202}; 262};
203 263
204/* Set up the proc fs entry for 'eps' object. */ 264/* Set up the proc fs entry for 'eps' object. */
@@ -221,6 +281,40 @@ void sctp_eps_proc_exit(void)
221 remove_proc_entry("eps", proc_net_sctp); 281 remove_proc_entry("eps", proc_net_sctp);
222} 282}
223 283
284
285static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos)
286{
287 if (*pos > sctp_assoc_hashsize)
288 return NULL;
289
290 if (*pos < 0)
291 *pos = 0;
292
293 if (*pos == 0)
294 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT "
295 "RPORT LADDRS <-> RADDRS\n");
296
297 ++*pos;
298
299 return (void *)pos;
300}
301
302static void sctp_assocs_seq_stop(struct seq_file *seq, void *v)
303{
304 return;
305}
306
307
308static void * sctp_assocs_seq_next(struct seq_file *seq, void *v, loff_t *pos)
309{
310 if (*pos > sctp_assoc_hashsize)
311 return NULL;
312
313 ++*pos;
314
315 return pos;
316}
317
224/* Display sctp associations (/proc/net/sctp/assocs). */ 318/* Display sctp associations (/proc/net/sctp/assocs). */
225static int sctp_assocs_seq_show(struct seq_file *seq, void *v) 319static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
226{ 320{
@@ -228,43 +322,57 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
228 struct sctp_ep_common *epb; 322 struct sctp_ep_common *epb;
229 struct sctp_association *assoc; 323 struct sctp_association *assoc;
230 struct sock *sk; 324 struct sock *sk;
231 int hash; 325 int hash = *(int *)v;
232 326
233 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT LPORT RPORT " 327 if (hash > sctp_assoc_hashsize)
234 "LADDRS <-> RADDRS\n"); 328 return -ENOMEM;
235 for (hash = 0; hash < sctp_assoc_hashsize; hash++) { 329
236 head = &sctp_assoc_hashtable[hash]; 330 head = &sctp_assoc_hashtable[hash-1];
237 read_lock(&head->lock); 331 sctp_local_bh_disable();
238 for (epb = head->chain; epb; epb = epb->next) { 332 read_lock(&head->lock);
239 assoc = sctp_assoc(epb); 333 for (epb = head->chain; epb; epb = epb->next) {
240 sk = epb->sk; 334 assoc = sctp_assoc(epb);
241 seq_printf(seq, 335 sk = epb->sk;
242 "%8p %8p %-3d %-3d %-2d %-4d %-5d %-5d ", 336 seq_printf(seq,
243 assoc, sk, sctp_sk(sk)->type, sk->sk_state, 337 "%8p %8p %-3d %-3d %-2d %-4d %4d %8d %8d %7d %5lu %-5d %5d ",
244 assoc->state, hash, epb->bind_addr.port, 338 assoc, sk, sctp_sk(sk)->type, sk->sk_state,
245 assoc->peer.port); 339 assoc->state, hash-1, assoc->assoc_id,
246 sctp_seq_dump_local_addrs(seq, epb); 340 (sk->sk_rcvbuf - assoc->rwnd),
247 seq_printf(seq, "<-> "); 341 assoc->sndbuf_used,
248 sctp_seq_dump_remote_addrs(seq, assoc); 342 sock_i_uid(sk), sock_i_ino(sk),
249 seq_printf(seq, "\n"); 343 epb->bind_addr.port,
250 } 344 assoc->peer.port);
251 read_unlock(&head->lock); 345
346 seq_printf(seq, " ");
347 sctp_seq_dump_local_addrs(seq, epb);
348 seq_printf(seq, "<-> ");
349 sctp_seq_dump_remote_addrs(seq, assoc);
350 seq_printf(seq, "\n");
252 } 351 }
352 read_unlock(&head->lock);
353 sctp_local_bh_enable();
253 354
254 return 0; 355 return 0;
255} 356}
256 357
358static struct seq_operations sctp_assoc_ops = {
359 .start = sctp_assocs_seq_start,
360 .next = sctp_assocs_seq_next,
361 .stop = sctp_assocs_seq_stop,
362 .show = sctp_assocs_seq_show,
363};
364
257/* Initialize the seq file operations for 'assocs' object. */ 365/* Initialize the seq file operations for 'assocs' object. */
258static int sctp_assocs_seq_open(struct inode *inode, struct file *file) 366static int sctp_assocs_seq_open(struct inode *inode, struct file *file)
259{ 367{
260 return single_open(file, sctp_assocs_seq_show, NULL); 368 return seq_open(file, &sctp_assoc_ops);
261} 369}
262 370
263static struct file_operations sctp_assocs_seq_fops = { 371static struct file_operations sctp_assocs_seq_fops = {
264 .open = sctp_assocs_seq_open, 372 .open = sctp_assocs_seq_open,
265 .read = seq_read, 373 .read = seq_read,
266 .llseek = seq_lseek, 374 .llseek = seq_lseek,
267 .release = single_release, 375 .release = seq_release,
268}; 376};
269 377
270/* Set up the proc fs entry for 'assocs' object. */ 378/* Set up the proc fs entry for 'assocs' object. */
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 2e1f9c3556f5..5135e1a25d25 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -378,10 +378,13 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp)
378{ 378{
379 int ret = inet_addr_type(addr->v4.sin_addr.s_addr); 379 int ret = inet_addr_type(addr->v4.sin_addr.s_addr);
380 380
381 /* FIXME: ip_nonlocal_bind sysctl support. */
382 381
383 if (addr->v4.sin_addr.s_addr != INADDR_ANY && ret != RTN_LOCAL) 382 if (addr->v4.sin_addr.s_addr != INADDR_ANY &&
383 ret != RTN_LOCAL &&
384 !sp->inet.freebind &&
385 !sysctl_ip_nonlocal_bind)
384 return 0; 386 return 0;
387
385 return 1; 388 return 1;
386} 389}
387 390
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 0b338eca6dc0..2a3c0e08a090 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4686,6 +4686,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
4686 struct sctp_endpoint *newep = newsp->ep; 4686 struct sctp_endpoint *newep = newsp->ep;
4687 struct sk_buff *skb, *tmp; 4687 struct sk_buff *skb, *tmp;
4688 struct sctp_ulpevent *event; 4688 struct sctp_ulpevent *event;
4689 int flags = 0;
4689 4690
4690 /* Migrate socket buffer sizes and all the socket level options to the 4691 /* Migrate socket buffer sizes and all the socket level options to the
4691 * new socket. 4692 * new socket.
@@ -4707,6 +4708,17 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
4707 sctp_sk(newsk)->bind_hash = pp; 4708 sctp_sk(newsk)->bind_hash = pp;
4708 inet_sk(newsk)->num = inet_sk(oldsk)->num; 4709 inet_sk(newsk)->num = inet_sk(oldsk)->num;
4709 4710
4711 /* Copy the bind_addr list from the original endpoint to the new
4712 * endpoint so that we can handle restarts properly
4713 */
4714 if (assoc->peer.ipv4_address)
4715 flags |= SCTP_ADDR4_PEERSUPP;
4716 if (assoc->peer.ipv6_address)
4717 flags |= SCTP_ADDR6_PEERSUPP;
4718 sctp_bind_addr_copy(&newsp->ep->base.bind_addr,
4719 &oldsp->ep->base.bind_addr,
4720 SCTP_SCOPE_GLOBAL, GFP_KERNEL, flags);
4721
4710 /* Move any messages in the old socket's receive queue that are for the 4722 /* Move any messages in the old socket's receive queue that are for the
4711 * peeled off association to the new socket's receive queue. 4723 * peeled off association to the new socket's receive queue.
4712 */ 4724 */
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 84b0bbddbd22..aae66144d411 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3289,7 +3289,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3289 } 3289 }
3290 usb_chip[chip->index] = NULL; 3290 usb_chip[chip->index] = NULL;
3291 up(&register_mutex); 3291 up(&register_mutex);
3292 snd_card_free_in_thread(card); 3292 snd_card_free(card);
3293 } else { 3293 } else {
3294 up(&register_mutex); 3294 up(&register_mutex);
3295 } 3295 }
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index b06a267e5dac..89ee8b732013 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -1,6 +1,11 @@
1/* 1/*
2 * usbusy2y.c - ALSA USB US-428 Driver 2 * usbusy2y.c - ALSA USB US-428 Driver
3 * 3 *
42005-04-14 Karsten Wiese
5 Version 0.8.7.2:
6 Call snd_card_free() instead of snd_card_free_in_thread() to prevent oops with dead keyboard symptom.
7 Tested ok with kernel 2.6.12-rc2.
8
42004-12-14 Karsten Wiese 92004-12-14 Karsten Wiese
5 Version 0.8.7.1: 10 Version 0.8.7.1:
6 snd_pcm_open for rawusb pcm-devices now returns -EBUSY if called without rawusb's hwdep device being open. 11 snd_pcm_open for rawusb pcm-devices now returns -EBUSY if called without rawusb's hwdep device being open.
@@ -143,7 +148,7 @@
143 148
144 149
145MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>"); 150MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>");
146MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.1"); 151MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2");
147MODULE_LICENSE("GPL"); 152MODULE_LICENSE("GPL");
148MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001)(0x8005)(0x8007) }}"); 153MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001)(0x8005)(0x8007) }}");
149 154
@@ -430,8 +435,6 @@ static void usX2Y_usb_disconnect(struct usb_device* device, void* ptr)
430 if (ptr) { 435 if (ptr) {
431 usX2Ydev_t* usX2Y = usX2Y((snd_card_t*)ptr); 436 usX2Ydev_t* usX2Y = usX2Y((snd_card_t*)ptr);
432 struct list_head* p; 437 struct list_head* p;
433 if (usX2Y->chip_status == USX2Y_STAT_CHIP_HUP) // on 2.6.1 kernel snd_usbmidi_disconnect()
434 return; // calls us back. better leave :-) .
435 usX2Y->chip.shutdown = 1; 438 usX2Y->chip.shutdown = 1;
436 usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; 439 usX2Y->chip_status = USX2Y_STAT_CHIP_HUP;
437 usX2Y_unlinkSeq(&usX2Y->AS04); 440 usX2Y_unlinkSeq(&usX2Y->AS04);
@@ -443,7 +446,7 @@ static void usX2Y_usb_disconnect(struct usb_device* device, void* ptr)
443 } 446 }
444 if (usX2Y->us428ctls_sharedmem) 447 if (usX2Y->us428ctls_sharedmem)
445 wake_up(&usX2Y->us428ctls_wait_queue_head); 448 wake_up(&usX2Y->us428ctls_wait_queue_head);
446 snd_card_free_in_thread((snd_card_t*)ptr); 449 snd_card_free((snd_card_t*)ptr);
447 } 450 }
448} 451}
449 452