aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/feature-removal-schedule.txt8
-rw-r--r--Documentation/kernel-parameters.txt24
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt12
-rw-r--r--Documentation/sparse.txt10
-rw-r--r--MAINTAINERS3
-rw-r--r--Makefile2
-rw-r--r--arch/arm/common/Kconfig1
-rw-r--r--arch/arm/mach-imx/cpufreq.c15
-rw-r--r--arch/arm/mach-imx/generic.c9
-rw-r--r--arch/arm/mach-ns9xxx/mach-cc9p9360dev.c2
-rw-r--r--arch/arm/mach-omap1/board-h2.c1
-rw-r--r--arch/arm/mach-omap2/clock.c1
-rw-r--r--arch/arm/mach-omap2/clock.h3
-rw-r--r--arch/arm/mach-pxa/tosa.c3
-rw-r--r--arch/avr32/kernel/ptrace.c4
-rw-r--r--arch/avr32/kernel/traps.c52
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c2
-rw-r--r--arch/avr32/mm/cache.c3
-rw-r--r--arch/i386/Kconfig2
-rw-r--r--arch/i386/kernel/acpi/boot.c23
-rw-r--r--arch/i386/kernel/acpi/earlyquirk.c7
-rw-r--r--arch/i386/kernel/smpboot.c16
-rw-r--r--arch/i386/kernel/tsc.c1
-rw-r--r--arch/i386/kernel/vmitime.c10
-rw-r--r--arch/ia64/configs/tiger_defconfig263
-rw-r--r--arch/ia64/configs/zx1_defconfig344
-rw-r--r--arch/ia64/defconfig321
-rw-r--r--arch/ia64/ia32/sys_ia32.c10
-rw-r--r--arch/ia64/kernel/asm-offsets.c1
-rw-r--r--arch/ia64/kernel/crash.c10
-rw-r--r--arch/ia64/kernel/efi.c38
-rw-r--r--arch/ia64/kernel/fsys.S105
-rw-r--r--arch/ia64/kernel/iosapic.c8
-rw-r--r--arch/ia64/kernel/mca.c8
-rw-r--r--arch/ia64/kernel/mca_drv.c65
-rw-r--r--arch/ia64/kernel/perfmon.c11
-rw-r--r--arch/ia64/kernel/ptrace.c1
-rw-r--r--arch/ia64/kernel/setup.c32
-rw-r--r--arch/ia64/lib/Makefile3
-rw-r--r--arch/ia64/mm/contig.c5
-rw-r--r--arch/ia64/mm/discontig.c6
-rw-r--r--arch/ia64/sn/kernel/io_acpi_init.c44
-rw-r--r--arch/ia64/sn/kernel/irq.c14
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/m68knommu/kernel/setup.c4
-rw-r--r--arch/m68knommu/platform/5307/ints.c1
-rw-r--r--arch/m68knommu/platform/68328/ints.c5
-rw-r--r--arch/m68knommu/platform/68328/timers.c3
-rw-r--r--arch/m68knommu/platform/68360/config.c3
-rw-r--r--arch/m68knommu/platform/68EZ328/config.c3
-rw-r--r--arch/m68knommu/platform/68VZ328/config.c3
-rw-r--r--arch/mips/Kconfig7
-rw-r--r--arch/mips/arc/init.c6
-rw-r--r--arch/mips/cobalt/Kconfig7
-rw-r--r--arch/mips/cobalt/console.c5
-rw-r--r--arch/mips/configs/atlas_defconfig1
-rw-r--r--arch/mips/configs/bigsur_defconfig1
-rw-r--r--arch/mips/configs/capcella_defconfig1
-rw-r--r--arch/mips/configs/cobalt_defconfig1
-rw-r--r--arch/mips/configs/db1000_defconfig1
-rw-r--r--arch/mips/configs/db1100_defconfig1
-rw-r--r--arch/mips/configs/db1200_defconfig1
-rw-r--r--arch/mips/configs/db1500_defconfig1
-rw-r--r--arch/mips/configs/db1550_defconfig1
-rw-r--r--arch/mips/configs/ddb5477_defconfig1
-rw-r--r--arch/mips/configs/decstation_defconfig1
-rw-r--r--arch/mips/configs/e55_defconfig1
-rw-r--r--arch/mips/configs/emma2rh_defconfig1
-rw-r--r--arch/mips/configs/ev64120_defconfig1
-rw-r--r--arch/mips/configs/excite_defconfig1
-rw-r--r--arch/mips/configs/ip22_defconfig1
-rw-r--r--arch/mips/configs/ip27_defconfig1
-rw-r--r--arch/mips/configs/ip32_defconfig1
-rw-r--r--arch/mips/configs/jaguar-atx_defconfig1
-rw-r--r--arch/mips/configs/jazz_defconfig1
-rw-r--r--arch/mips/configs/jmr3927_defconfig1
-rw-r--r--arch/mips/configs/lasat200_defconfig1
-rw-r--r--arch/mips/configs/malta_defconfig1
-rw-r--r--arch/mips/configs/mipssim_defconfig1
-rw-r--r--arch/mips/configs/mpc30x_defconfig1
-rw-r--r--arch/mips/configs/ocelot_3_defconfig1
-rw-r--r--arch/mips/configs/ocelot_c_defconfig1
-rw-r--r--arch/mips/configs/ocelot_defconfig1
-rw-r--r--arch/mips/configs/ocelot_g_defconfig1
-rw-r--r--arch/mips/configs/pb1100_defconfig1
-rw-r--r--arch/mips/configs/pb1500_defconfig1
-rw-r--r--arch/mips/configs/pb1550_defconfig1
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig1
-rw-r--r--arch/mips/configs/pnx8550-stb810_defconfig1
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig1
-rw-r--r--arch/mips/configs/qemu_defconfig1
-rw-r--r--arch/mips/configs/rbhma4500_defconfig1
-rw-r--r--arch/mips/configs/rm200_defconfig1
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig1
-rw-r--r--arch/mips/configs/sead_defconfig1
-rw-r--r--arch/mips/configs/tb0226_defconfig1
-rw-r--r--arch/mips/configs/tb0229_defconfig1
-rw-r--r--arch/mips/configs/tb0287_defconfig1
-rw-r--r--arch/mips/configs/workpad_defconfig1
-rw-r--r--arch/mips/configs/wrppmc_defconfig1
-rw-r--r--arch/mips/configs/yosemite_defconfig1
-rw-r--r--arch/mips/dec/prom/init.c3
-rw-r--r--arch/mips/defconfig1
-rw-r--r--arch/mips/kernel/kspd.c4
-rw-r--r--arch/mips/kernel/linux32.c46
-rw-r--r--arch/mips/kernel/mips_ksyms.c1
-rw-r--r--arch/mips/kernel/scall32-o32.S2
-rw-r--r--arch/mips/kernel/scall64-64.S3
-rw-r--r--arch/mips/kernel/scall64-n32.S5
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/mips-boards/generic/init.c4
-rw-r--r--arch/mips/mips-boards/malta/Makefile2
-rw-r--r--arch/mips/mips-boards/malta/malta_smtc.c (renamed from arch/mips/mips-boards/malta/malta_smp.c)31
-rw-r--r--arch/mips/mm/c-tx39.c18
-rw-r--r--arch/mips/momentum/jaguar_atx/platform.c8
-rw-r--r--arch/mips/momentum/ocelot_3/platform.c8
-rw-r--r--arch/mips/momentum/ocelot_c/platform.c4
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c22
-rw-r--r--arch/mips/philips/pnx8550/common/int.c14
-rw-r--r--arch/mips/sgi-ip27/ip27-init.c2
-rw-r--r--arch/mips/sibyte/Kconfig22
-rw-r--r--arch/mips/sibyte/sb1250/bcm1250_tbprof.c377
-rw-r--r--arch/mips/sibyte/sb1250/setup.c2
-rw-r--r--arch/powerpc/configs/cell_defconfig151
-rw-r--r--arch/powerpc/kernel/cputable.c16
-rw-r--r--arch/powerpc/kernel/prom_parse.c2
-rw-r--r--arch/powerpc/kernel/udbg_16550.c2
-rw-r--r--arch/powerpc/mm/hash_utils_64.c6
-rw-r--r--arch/powerpc/mm/hugetlbpage.c4
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c8
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c81
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c24
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c20
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h6
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c62
-rw-r--r--arch/powerpc/platforms/celleb/scc_epci.c82
-rw-r--r--arch/powerpc/platforms/chrp/pegasos_eth.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/pasemi/iommu.c2
-rw-r--r--arch/powerpc/platforms/powermac/feature.c5
-rw-r--r--arch/powerpc/platforms/powermac/pci.c7
-rw-r--r--arch/powerpc/platforms/ps3/mm.c2
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c2
-rw-r--r--arch/powerpc/xmon/xmon.c2
-rw-r--r--arch/ppc/syslib/mv64x60.c12
-rw-r--r--arch/s390/Kconfig2
-rw-r--r--arch/s390/appldata/appldata_mem.c5
-rw-r--r--arch/s390/kernel/head31.S11
-rw-r--r--arch/s390/kernel/head64.S11
-rw-r--r--arch/s390/kernel/ipl.c4
-rw-r--r--arch/s390/kernel/kprobes.c21
-rw-r--r--arch/s390/kernel/machine_kexec.c5
-rw-r--r--arch/s390/kernel/reipl.S13
-rw-r--r--arch/s390/kernel/reipl64.S13
-rw-r--r--arch/s390/kernel/smp.c15
-rw-r--r--arch/s390/mm/fault.c105
-rw-r--r--arch/sh/boards/renesas/r7780rp/Makefile2
-rw-r--r--arch/sh/boards/renesas/r7780rp/io.c233
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c24
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/setup.c26
-rw-r--r--arch/sh/configs/rts7751r2d_defconfig110
-rw-r--r--arch/sh/kernel/entry-common.S2
-rw-r--r--arch/sh/kernel/io_generic.c3
-rw-r--r--arch/sh/kernel/process.c5
-rw-r--r--arch/sh/kernel/ptrace.c45
-rw-r--r--arch/sh/kernel/signal.c4
-rw-r--r--arch/sh/kernel/vmlinux.lds.S3
-rw-r--r--arch/sh/mm/cache-sh4.c12
-rw-r--r--arch/sh/mm/cache-sh7705.c9
-rw-r--r--arch/sh/mm/pg-sh4.c22
-rw-r--r--arch/sh/mm/pg-sh7705.c31
-rw-r--r--arch/sh/mm/tlb-flush.c55
-rw-r--r--arch/sh/mm/tlb-sh3.c63
-rw-r--r--arch/sh/mm/tlb-sh4.c68
-rw-r--r--arch/sparc/kernel/process.c16
-rw-r--r--arch/sparc/kernel/systbls.S6
-rw-r--r--arch/sparc/kernel/traps.c6
-rw-r--r--arch/sparc/mm/init.c2
-rw-r--r--arch/sparc64/kernel/process.c9
-rw-r--r--arch/sparc64/kernel/systbls.S9
-rw-r--r--arch/sparc64/mm/hugetlbpage.c3
-rw-r--r--arch/um/Kconfig2
-rw-r--r--arch/um/drivers/daemon_user.c17
-rw-r--r--arch/um/drivers/line.c6
-rw-r--r--arch/um/drivers/mcast_user.c10
-rw-r--r--arch/um/drivers/ssl.c2
-rw-r--r--arch/um/drivers/stdio_console.c2
-rw-r--r--arch/um/include/os.h3
-rw-r--r--arch/um/kernel/irq.c1
-rw-r--r--arch/um/kernel/signal.c6
-rw-r--r--arch/um/os-Linux/process.c3
-rw-r--r--arch/um/os-Linux/signal.c5
-rw-r--r--arch/um/os-Linux/skas/process.c5
-rw-r--r--arch/um/os-Linux/trap.c1
-rw-r--r--arch/um/scripts/Makefile.rules4
-rw-r--r--arch/um/sys-x86_64/syscalls.c6
-rw-r--r--arch/x86_64/ia32/ptrace32.c1
-rw-r--r--arch/x86_64/kernel/early-quirks.c9
-rw-r--r--arch/x86_64/kernel/smpboot.c5
-rw-r--r--arch/x86_64/kernel/vsyscall.c2
-rw-r--r--drivers/acpi/Kconfig12
-rw-r--r--drivers/acpi/blacklist.c10
-rw-r--r--drivers/acpi/ec.c40
-rw-r--r--drivers/acpi/events/evmisc.c25
-rw-r--r--drivers/acpi/ibm_acpi.c28
-rw-r--r--drivers/acpi/power.c20
-rw-r--r--drivers/acpi/resources/rscreate.c25
-rw-r--r--drivers/acpi/video.c38
-rw-r--r--drivers/ata/ahci.c1
-rw-r--r--drivers/ata/ata_piix.c11
-rw-r--r--drivers/ata/libata-acpi.c24
-rw-r--r--drivers/ata/libata-core.c19
-rw-r--r--drivers/ata/pata_cs5520.c2
-rw-r--r--drivers/ata/pata_legacy.c2
-rw-r--r--drivers/ata/pata_mpc52xx.c2
-rw-r--r--drivers/ata/pata_pdc202xx_old.c22
-rw-r--r--drivers/ata/sata_nv.c8
-rw-r--r--drivers/ata/sata_sis.c2
-rw-r--r--drivers/atm/zatm.c4
-rw-r--r--drivers/base/core.c30
-rw-r--r--drivers/block/Kconfig16
-rw-r--r--drivers/block/cciss.c55
-rw-r--r--drivers/block/paride/pd.c8
-rw-r--r--drivers/char/Kconfig15
-rw-r--r--drivers/char/ds1286.c9
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c3
-rw-r--r--drivers/char/watchdog/Kconfig1
-rw-r--r--drivers/char/watchdog/machzwd.c2
-rw-r--r--drivers/connector/connector.c22
-rw-r--r--drivers/crypto/geode-aes.c3
-rw-r--r--drivers/hid/hid-core.c9
-rw-r--r--drivers/ide/Kconfig2
-rw-r--r--drivers/infiniband/core/cma.c2
-rw-r--r--drivers/infiniband/core/ucma.c2
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.c1
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_cm.c19
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_ev.c12
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.c40
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.h33
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_qp.c2
-rw-r--r--drivers/infiniband/hw/ehca/ehca_classes.h6
-rw-r--r--drivers/infiniband/hw/ehca/ehca_cq.c16
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c59
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c4
-rw-r--r--drivers/infiniband/hw/ipath/ipath_dma.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c10
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c5
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_verbs.c13
-rw-r--r--drivers/input/serio/i8042.c10
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c6
-rw-r--r--drivers/misc/asus-laptop.c2
-rw-r--r--drivers/misc/sony-laptop.c2
-rw-r--r--drivers/mmc/imxmmc.c13
-rw-r--r--drivers/mmc/mmc.c83
-rw-r--r--drivers/mmc/sdhci.c39
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c2
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0020.c2
-rw-r--r--drivers/mtd/maps/dilnetpc.c4
-rw-r--r--drivers/mtd/maps/esb2rom.c11
-rw-r--r--drivers/mtd/mtdconcat.c1
-rw-r--r--drivers/mtd/mtdpart.c7
-rw-r--r--drivers/mtd/nand/diskonchip.c2
-rw-r--r--drivers/mtd/nand/nand_base.c1
-rw-r--r--drivers/mtd/onenand/onenand_base.c77
-rw-r--r--drivers/net/3c59x.c36
-rw-r--r--drivers/net/atl1/atl1_main.c4
-rw-r--r--drivers/net/bonding/bond_main.c86
-rw-r--r--drivers/net/gianfar.c2
-rw-r--r--drivers/net/mv643xx_eth.c63
-rw-r--r--drivers/net/myri10ge/myri10ge.c42
-rw-r--r--drivers/net/natsemi.c24
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c5
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c4
-rw-r--r--drivers/net/pcnet32.c4
-rw-r--r--drivers/net/pppoe.c11
-rw-r--r--drivers/net/r8169.c14
-rw-r--r--drivers/net/sis900.c10
-rw-r--r--drivers/net/sky2.c24
-rw-r--r--drivers/net/tokenring/ibmtr.c25
-rw-r--r--drivers/net/tulip/de2104x.c6
-rw-r--r--drivers/net/tulip/dmfe.c208
-rw-r--r--drivers/net/ucc_geth.c17
-rw-r--r--drivers/net/via-rhine.c32
-rw-r--r--drivers/net/wan/z85230.c2
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c6
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_phy.c10
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_wx.c10
-rw-r--r--drivers/pci/msi.c150
-rw-r--r--drivers/pci/pci.c29
-rw-r--r--drivers/pci/pci.h2
-rw-r--r--drivers/pci/pcie/aer/aerdrv.c6
-rw-r--r--drivers/pci/pcie/portdrv_pci.c6
-rw-r--r--drivers/pci/search.c2
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c120
-rw-r--r--drivers/ps3/ps3av.c9
-rw-r--r--drivers/ps3/ps3av_cmd.c24
-rw-r--r--drivers/ps3/sys-manager.c6
-rw-r--r--drivers/ps3/vuart.c6
-rw-r--r--drivers/s390/block/dasd_eer.c1
-rw-r--r--drivers/s390/char/tape_std.c5
-rw-r--r--drivers/s390/cio/device_fsm.c117
-rw-r--r--drivers/s390/net/qeth.h2
-rw-r--r--drivers/serial/mcfserial.c44
-rw-r--r--drivers/serial/sn_console.c52
-rw-r--r--drivers/usb/class/cdc-acm.c8
-rw-r--r--drivers/usb/core/devio.c13
-rw-r--r--drivers/usb/core/hub.c9
-rw-r--r--drivers/usb/core/message.c9
-rw-r--r--drivers/usb/gadget/at91_udc.c6
-rw-r--r--drivers/usb/gadget/goku_udc.c29
-rw-r--r--drivers/usb/host/ehci-hub.c3
-rw-r--r--drivers/usb/host/uhci-hub.c11
-rw-r--r--drivers/usb/input/hid-core.c21
-rw-r--r--drivers/usb/misc/ftdi-elan.c18
-rw-r--r--drivers/usb/net/dm9601.c4
-rw-r--r--drivers/usb/serial/airprime.c47
-rw-r--r--drivers/usb/serial/cp2101.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c90
-rw-r--r--drivers/usb/serial/ftdi_sio.h21
-rw-r--r--drivers/usb/serial/ipaq.c2
-rw-r--r--drivers/usb/serial/usb-serial.c22
-rw-r--r--drivers/usb/storage/unusual_devs.h17
-rw-r--r--drivers/video/Kconfig16
-rw-r--r--drivers/video/aty/atyfb.h3
-rw-r--r--drivers/video/backlight/locomolcd.c4
-rw-r--r--drivers/video/backlight/progear_bl.c4
-rw-r--r--drivers/video/bw2.c18
-rw-r--r--drivers/video/cg14.c5
-rw-r--r--drivers/video/nvidia/nv_backlight.c5
-rw-r--r--fs/buffer.c9
-rw-r--r--fs/cifs/CHANGES7
-rw-r--r--fs/cifs/Makefile2
-rw-r--r--fs/cifs/TODO16
-rw-r--r--fs/cifs/cifsfs.c16
-rw-r--r--fs/cifs/cifsfs.h4
-rw-r--r--fs/cifs/cifsglob.h8
-rw-r--r--fs/cifs/cifspdu.h3
-rw-r--r--fs/cifs/cifsproto.h2
-rw-r--r--fs/cifs/cifssmb.c10
-rw-r--r--fs/cifs/dir.c2
-rw-r--r--fs/cifs/export.c52
-rw-r--r--fs/cifs/file.c105
-rw-r--r--fs/cifs/inode.c58
-rw-r--r--fs/cifs/readdir.c6
-rw-r--r--fs/cifs/transport.c6
-rw-r--r--fs/compat.c100
-rw-r--r--fs/dlm/user.c1
-rw-r--r--fs/ecryptfs/inode.c2
-rw-r--r--fs/gfs2/glock.c4
-rw-r--r--fs/gfs2/glops.c3
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/inode.c7
-rw-r--r--fs/gfs2/ops_address.c7
-rw-r--r--fs/gfs2/ops_export.c5
-rw-r--r--fs/gfs2/ops_fstype.c2
-rw-r--r--fs/gfs2/quota.c2
-rw-r--r--fs/gfs2/super.c1
-rw-r--r--fs/hostfs/hostfs_kern.c17
-rw-r--r--fs/jffs2/background.c8
-rw-r--r--fs/jffs2/readinode.c16
-rw-r--r--fs/jffs2/scan.c9
-rw-r--r--fs/jffs2/wbuf.c7
-rw-r--r--fs/ncpfs/inode.c16
-rw-r--r--fs/ncpfs/sock.c151
-rw-r--r--fs/nfsd/nfsfh.c1
-rw-r--r--fs/partitions/check.c2
-rw-r--r--fs/proc/base.c21
-rw-r--r--fs/sysfs/dir.c2
-rw-r--r--fs/sysfs/inode.c5
-rw-r--r--include/asm-arm/arch-ixp4xx/ixp4xx-regs.h6
-rw-r--r--include/asm-arm/arch-lh7a40x/entry-macro.S12
-rw-r--r--include/asm-avr32/Kbuild2
-rw-r--r--include/asm-avr32/dma-mapping.h18
-rw-r--r--include/asm-generic/page.h38
-rw-r--r--include/asm-i386/paravirt.h2
-rw-r--r--include/asm-i386/tsc.h68
-rw-r--r--include/asm-i386/vmi_time.h10
-rw-r--r--include/asm-ia64/kexec.h1
-rw-r--r--include/asm-ia64/mca.h2
-rw-r--r--include/asm-ia64/meminit.h6
-rw-r--r--include/asm-ia64/pal.h1
-rw-r--r--include/asm-ia64/pci.h3
-rw-r--r--include/asm-ia64/resource.h1
-rw-r--r--include/asm-ia64/sal.h5
-rw-r--r--include/asm-ia64/swiotlb.h9
-rw-r--r--include/asm-ia64/unwind.h2
-rw-r--r--include/asm-m32r/dma-mapping.h19
-rw-r--r--include/asm-m68k/dma-mapping.h2
-rw-r--r--include/asm-m68k/mc146818rtc.h1
-rw-r--r--include/asm-m68knommu/m528xsim.h3
-rw-r--r--include/asm-mips/bitops.h56
-rw-r--r--include/asm-mips/dma.h2
-rw-r--r--include/asm-mips/mips_mt.h2
-rw-r--r--include/asm-mips/sibyte/trace_prof.h110
-rw-r--r--include/asm-mips/smtc.h3
-rw-r--r--include/asm-mips/smtc_ipi.h2
-rw-r--r--include/asm-mips/spinlock.h4
-rw-r--r--include/asm-mips/uaccess.h2
-rw-r--r--include/asm-mips/unistd.h18
-rw-r--r--include/asm-powerpc/floppy.h2
-rw-r--r--include/asm-powerpc/spu.h7
-rw-r--r--include/asm-powerpc/spu_csa.h4
-rw-r--r--include/asm-powerpc/systbl.h3
-rw-r--r--include/asm-powerpc/unistd.h4
-rw-r--r--include/asm-s390/bugs.h2
-rw-r--r--include/asm-s390/ipl.h1
-rw-r--r--include/asm-sh/cache.h3
-rw-r--r--include/asm-sh/cacheflush.h3
-rw-r--r--include/asm-sh/cpu-sh3/cacheflush.h2
-rw-r--r--include/asm-sh/cpu-sh4/cacheflush.h2
-rw-r--r--include/asm-sh/pgtable.h5
-rw-r--r--include/asm-sh/thread_info.h2
-rw-r--r--include/asm-sparc/dma-mapping.h15
-rw-r--r--include/asm-sparc/unistd.h16
-rw-r--r--include/asm-sparc64/dma.h11
-rw-r--r--include/asm-sparc64/floppy.h11
-rw-r--r--include/asm-sparc64/parport.h11
-rw-r--r--include/asm-sparc64/unistd.h17
-rw-r--r--include/asm-x86_64/swiotlb.h1
-rw-r--r--include/asm-x86_64/tsc.h68
-rw-r--r--include/asm-x86_64/uaccess.h4
-rw-r--r--include/linux/audit.h1
-rw-r--r--include/linux/compat.h19
-rw-r--r--include/linux/hrtimer.h4
-rw-r--r--include/linux/if_pppox.h2
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/mmc/host.h8
-rw-r--r--include/linux/msi.h8
-rw-r--r--include/linux/mtd/mtd.h1
-rw-r--r--include/linux/mtd/onenand.h5
-rw-r--r--include/linux/mv643xx.h1
-rw-r--r--include/linux/ncp_fs_sb.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_core.h2
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/security.h8
-rw-r--r--include/linux/sunrpc/svc.h2
-rw-r--r--include/linux/sunrpc/svcsock.h2
-rw-r--r--include/net/inet_timewait_sock.h2
-rw-r--r--include/net/netfilter/nf_conntrack_core.h2
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/xfrm.h5
-rw-r--r--include/sound/version.h4
-rw-r--r--init/Kconfig16
-rw-r--r--ipc/mqueue.c3
-rw-r--r--kernel/auditsc.c24
-rw-r--r--kernel/hrtimer.c15
-rw-r--r--kernel/module.c6
-rw-r--r--kernel/power/Kconfig37
-rw-r--r--kernel/rcutorture.c14
-rw-r--r--kernel/sysctl.c3
-rw-r--r--kernel/time/tick-broadcast.c36
-rw-r--r--kernel/time/tick-common.c32
-rw-r--r--kernel/time/tick-internal.h4
-rw-r--r--kernel/timer.c8
-rw-r--r--lib/kobject.c2
-rw-r--r--lib/swiotlb.c184
-rw-r--r--net/bluetooth/hci_sock.c4
-rw-r--r--net/bridge/br_if.c4
-rw-r--r--net/core/sock.c2
-rw-r--r--net/dccp/ccids/ccid3.c7
-rw-r--r--net/dccp/dccp.h1
-rw-r--r--net/dccp/input.c21
-rw-r--r--net/dccp/minisocks.c2
-rw-r--r--net/dccp/output.c16
-rw-r--r--net/dccp/timer.c25
-rw-r--r--net/ipv4/cipso_ipv4.c5
-rw-r--r--net/ipv4/devinet.c4
-rw-r--r--net/ipv4/igmp.c23
-rw-r--r--net/ipv4/netfilter/ip_conntrack_core.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_tcp.c4
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c6
-rw-r--r--net/ipv4/netfilter/nf_conntrack_proto_icmp.c6
-rw-r--r--net/ipv4/netfilter/nf_nat_core.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_proto_gre.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_proto_icmp.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_proto_tcp.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_proto_udp.c3
-rw-r--r--net/ipv4/udp.c1
-rw-r--r--net/ipv6/addrconf.c4
-rw-r--r--net/ipv6/ipv6_sockglue.c14
-rw-r--r--net/ipv6/netfilter.c1
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c7
-rw-r--r--net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c6
-rw-r--r--net/key/af_key.c26
-rw-r--r--net/netfilter/nf_conntrack_core.c5
-rw-r--r--net/netfilter/nf_conntrack_proto_gre.c3
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c13
-rw-r--r--net/netfilter/nf_conntrack_proto_udp.c6
-rw-r--r--net/netfilter/nfnetlink_log.c30
-rw-r--r--net/rose/af_rose.c80
-rw-r--r--net/sctp/ipv6.c4
-rw-r--r--net/sunrpc/svc.c154
-rw-r--r--net/sunrpc/svcsock.c101
-rw-r--r--net/unix/af_unix.c6
-rw-r--r--net/wanrouter/af_wanpipe.c2600
-rw-r--r--net/xfrm/xfrm_policy.c18
-rw-r--r--net/xfrm/xfrm_state.c6
-rw-r--r--net/xfrm/xfrm_user.c24
-rw-r--r--security/dummy.c2
-rw-r--r--security/selinux/hooks.c8
-rw-r--r--sound/oss/dmasound/dmasound_core.c20
-rw-r--r--sound/pci/ac97/ac97_patch.c2
-rw-r--r--sound/pci/ali5451/ali5451.c2
-rw-r--r--sound/pci/cmipci.c18
-rw-r--r--sound/pci/echoaudio/echoaudio.c2
-rw-r--r--sound/pci/hda/patch_analog.c3
-rw-r--r--sound/pci/hda/patch_conexant.c8
-rw-r--r--sound/pci/hda/patch_realtek.c21
-rw-r--r--sound/pci/hda/patch_sigmatel.c35
-rw-r--r--sound/pci/riptide/riptide.c2
-rw-r--r--sound/pci/rme9652/hdspm.c2
-rw-r--r--sound/soc/codecs/wm9712.c3
516 files changed, 5413 insertions, 6067 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index c3b1430cf603..0bc8b0b2e103 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -316,3 +316,11 @@ Why: The option/code is
316Who: Johannes Berg <johannes@sipsolutions.net> 316Who: Johannes Berg <johannes@sipsolutions.net>
317 317
318--------------------------- 318---------------------------
319
320What: i8xx_tco watchdog driver
321When: in 2.6.22
322Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt
323 watchdog driver.
324Who: Wim Van Sebroeck <wim@iguana.be>
325
326---------------------------
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 03eb5ed503f7..856c8b114e71 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -79,6 +79,7 @@ parameter is applicable:
79 Documentation/scsi/. 79 Documentation/scsi/.
80 SELINUX SELinux support is enabled. 80 SELINUX SELinux support is enabled.
81 SERIAL Serial support is enabled. 81 SERIAL Serial support is enabled.
82 SH SuperH architecture is enabled.
82 SMP The kernel is an SMP kernel. 83 SMP The kernel is an SMP kernel.
83 SPARC Sparc architecture is enabled. 84 SPARC Sparc architecture is enabled.
84 SWSUSP Software suspend is enabled. 85 SWSUSP Software suspend is enabled.
@@ -125,7 +126,8 @@ and is between 256 and 4096 characters. It is defined in the file
125 See header of drivers/scsi/53c7xx.c. 126 See header of drivers/scsi/53c7xx.c.
126 See also Documentation/scsi/ncr53c7xx.txt. 127 See also Documentation/scsi/ncr53c7xx.txt.
127 128
128 acpi= [HW,ACPI] Advanced Configuration and Power Interface 129 acpi= [HW,ACPI,X86-64,i386]
130 Advanced Configuration and Power Interface
129 Format: { force | off | ht | strict | noirq } 131 Format: { force | off | ht | strict | noirq }
130 force -- enable ACPI if default was off 132 force -- enable ACPI if default was off
131 off -- disable ACPI if default was on 133 off -- disable ACPI if default was on
@@ -485,7 +487,7 @@ and is between 256 and 4096 characters. It is defined in the file
485 487
486 dtc3181e= [HW,SCSI] 488 dtc3181e= [HW,SCSI]
487 489
488 earlyprintk= [IA-32,X86-64] 490 earlyprintk= [IA-32,X86-64,SH]
489 earlyprintk=vga 491 earlyprintk=vga
490 earlyprintk=serial[,ttySn[,baudrate]] 492 earlyprintk=serial[,ttySn[,baudrate]]
491 493
@@ -1685,6 +1687,22 @@ and is between 256 and 4096 characters. It is defined in the file
1685 stifb= [HW] 1687 stifb= [HW]
1686 Format: bpp:<bpp1>[:<bpp2>[:<bpp3>...]] 1688 Format: bpp:<bpp1>[:<bpp2>[:<bpp3>...]]
1687 1689
1690 sunrpc.pool_mode=
1691 [NFS]
1692 Control how the NFS server code allocates CPUs to
1693 service thread pools. Depending on how many NICs
1694 you have and where their interrupts are bound, this
1695 option will affect which CPUs will do NFS serving.
1696 Note: this parameter cannot be changed while the
1697 NFS server is running.
1698
1699 auto the server chooses an appropriate mode
1700 automatically using heuristics
1701 global a single global pool contains all CPUs
1702 percpu one pool for each CPU
1703 pernode one pool for each NUMA node (equivalent
1704 to global on non-NUMA machines)
1705
1688 swiotlb= [IA-64] Number of I/O TLB slabs 1706 swiotlb= [IA-64] Number of I/O TLB slabs
1689 1707
1690 switches= [HW,M68k] 1708 switches= [HW,M68k]
@@ -1768,7 +1786,7 @@ and is between 256 and 4096 characters. It is defined in the file
1768 usbhid.mousepoll= 1786 usbhid.mousepoll=
1769 [USBHID] The interval which mice are to be polled at. 1787 [USBHID] The interval which mice are to be polled at.
1770 1788
1771 vdso= [IA-32] 1789 vdso= [IA-32,SH]
1772 vdso=1: enable VDSO (default) 1790 vdso=1: enable VDSO (default)
1773 vdso=0: disable VDSO mapping 1791 vdso=0: disable VDSO mapping
1774 1792
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index c30ff1bb2d10..db398a6441c1 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -370,7 +370,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
370 mpu_port - 0x300,0x310,0x320,0x330 = legacy port, 370 mpu_port - 0x300,0x310,0x320,0x330 = legacy port,
371 1 = integrated PCI port, 371 1 = integrated PCI port,
372 0 = disable (default) 372 0 = disable (default)
373 fm_port - 0x388 (default), 0 = disable (default) 373 fm_port - 0x388 = legacy port,
374 1 = integrated PCI port (default),
375 0 = disable
374 soft_ac3 - Software-conversion of raw SPDIF packets (model 033 only) 376 soft_ac3 - Software-conversion of raw SPDIF packets (model 033 only)
375 (default = 1) 377 (default = 1)
376 joystick_port - Joystick port address (0 = disable, 1 = auto-detect) 378 joystick_port - Joystick port address (0 = disable, 1 = auto-detect)
@@ -895,10 +897,16 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
895 can be adjusted. Appearing only when compiled with 897 can be adjusted. Appearing only when compiled with
896 $CONFIG_SND_DEBUG=y 898 $CONFIG_SND_DEBUG=y
897 899
898 STAC9200/9205/9220/9221/9254 900 STAC9200/9205/9254
901 ref Reference board
902
903 STAC9220/9221
899 ref Reference board 904 ref Reference board
900 3stack D945 3stack 905 3stack D945 3stack
901 5stack D945 5stack + SPDIF 906 5stack D945 5stack + SPDIF
907 macmini Intel Mac Mini
908 macbook Intel Mac Book
909 macbook-pro Intel Mac Book Pro
902 910
903 STAC9202/9250/9251 911 STAC9202/9250/9251
904 ref Reference board, base config 912 ref Reference board, base config
diff --git a/Documentation/sparse.txt b/Documentation/sparse.txt
index f9c99c9a54f9..1a3bdc27d95e 100644
--- a/Documentation/sparse.txt
+++ b/Documentation/sparse.txt
@@ -45,11 +45,15 @@ special.
45Getting sparse 45Getting sparse
46~~~~~~~~~~~~~~ 46~~~~~~~~~~~~~~
47 47
48With git, you can just get it from 48You can get latest released versions from the Sparse homepage at
49http://www.kernel.org/pub/linux/kernel/people/josh/sparse/
49 50
50 rsync://rsync.kernel.org/pub/scm/devel/sparse/sparse.git 51Alternatively, you can get snapshots of the latest development version
52of sparse using git to clone..
51 53
52and DaveJ has tar-balls at 54 git://git.kernel.org/pub/scm/linux/kernel/git/josh/sparse.git
55
56DaveJ has hourly generated tarballs of the git tree available at..
53 57
54 http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ 58 http://www.codemonkey.org.uk/projects/git-snapshots/sparse/
55 59
diff --git a/MAINTAINERS b/MAINTAINERS
index 9993b9009415..17555bba20af 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1103,9 +1103,6 @@ W: http://lanana.org/docs/device-list/index.html
1103L: linux-kernel@vger.kernel.org 1103L: linux-kernel@vger.kernel.org
1104S: Maintained 1104S: Maintained
1105 1105
1106DEVICE FILESYSTEM
1107S: Obsolete
1108
1109DIGI INTL. EPCA DRIVER 1106DIGI INTL. EPCA DRIVER
1110P: Digi International, Inc 1107P: Digi International, Inc
1111M: Eng.Linux@digi.com 1108M: Eng.Linux@digi.com
diff --git a/Makefile b/Makefile
index 66ee8b803986..6393738fe968 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 21 3SUBLEVEL = 21
4EXTRAVERSION = -rc2 4EXTRAVERSION = -rc3
5NAME = Homicidal Dwarf Hamster 5NAME = Homicidal Dwarf Hamster
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 5e34ca6d38b6..3e073467caca 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -28,6 +28,7 @@ config SHARP_PARAM
28 28
29config SHARPSL_PM 29config SHARPSL_PM
30 bool 30 bool
31 select APM_EMULATION
31 32
32config SHARP_SCOOP 33config SHARP_SCOOP
33 bool 34 bool
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
index 4f66e90db74f..7e70e0b0b989 100644
--- a/arch/arm/mach-imx/cpufreq.c
+++ b/arch/arm/mach-imx/cpufreq.c
@@ -50,6 +50,7 @@
50#define CR_920T_ASYNC_MODE 0xC0000000 50#define CR_920T_ASYNC_MODE 0xC0000000
51 51
52static u32 mpctl0_at_boot; 52static u32 mpctl0_at_boot;
53static u32 bclk_div_at_boot;
53 54
54static void imx_set_async_mode(void) 55static void imx_set_async_mode(void)
55{ 56{
@@ -82,13 +83,13 @@ static void imx_set_mpctl0(u32 mpctl0)
82 * imx_compute_mpctl - compute new PLL parameters 83 * imx_compute_mpctl - compute new PLL parameters
83 * @new_mpctl: pointer to location assigned by new PLL control register value 84 * @new_mpctl: pointer to location assigned by new PLL control register value
84 * @cur_mpctl: current PLL control register parameters 85 * @cur_mpctl: current PLL control register parameters
86 * @f_ref: reference source frequency Hz
85 * @freq: required frequency in Hz 87 * @freq: required frequency in Hz
86 * @relation: is one of %CPUFREQ_RELATION_L (supremum) 88 * @relation: is one of %CPUFREQ_RELATION_L (supremum)
87 * and %CPUFREQ_RELATION_H (infimum) 89 * and %CPUFREQ_RELATION_H (infimum)
88 */ 90 */
89long imx_compute_mpctl(u32 *new_mpctl, u32 cur_mpctl, unsigned long freq, int relation) 91long imx_compute_mpctl(u32 *new_mpctl, u32 cur_mpctl, u32 f_ref, unsigned long freq, int relation)
90{ 92{
91 u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512);
92 u32 mfi; 93 u32 mfi;
93 u32 mfn; 94 u32 mfn;
94 u32 mfd; 95 u32 mfd;
@@ -182,7 +183,7 @@ static int imx_set_target(struct cpufreq_policy *policy,
182 unsigned long flags; 183 unsigned long flags;
183 long freq; 184 long freq;
184 long sysclk; 185 long sysclk;
185 unsigned int bclk_div = 1; 186 unsigned int bclk_div = bclk_div_at_boot;
186 187
187 /* 188 /*
188 * Some governors do not respects CPU and policy lower limits 189 * Some governors do not respects CPU and policy lower limits
@@ -202,8 +203,8 @@ static int imx_set_target(struct cpufreq_policy *policy,
202 203
203 sysclk = imx_get_system_clk(); 204 sysclk = imx_get_system_clk();
204 205
205 if (freq > sysclk + 1000000) { 206 if (freq > sysclk / bclk_div_at_boot + 1000000) {
206 freq = imx_compute_mpctl(&mpctl0, mpctl0_at_boot, freq, relation); 207 freq = imx_compute_mpctl(&mpctl0, mpctl0_at_boot, CLK32 * 512, freq, relation);
207 if (freq < 0) { 208 if (freq < 0) {
208 printk(KERN_WARNING "imx: target frequency %ld Hz cannot be set\n", freq); 209 printk(KERN_WARNING "imx: target frequency %ld Hz cannot be set\n", freq);
209 return -EINVAL; 210 return -EINVAL;
@@ -217,6 +218,8 @@ static int imx_set_target(struct cpufreq_policy *policy,
217 218
218 if(bclk_div > 16) 219 if(bclk_div > 16)
219 bclk_div = 16; 220 bclk_div = 16;
221 if(bclk_div < bclk_div_at_boot)
222 bclk_div = bclk_div_at_boot;
220 } 223 }
221 freq = (sysclk + bclk_div / 2) / bclk_div; 224 freq = (sysclk + bclk_div / 2) / bclk_div;
222 } 225 }
@@ -285,7 +288,7 @@ static struct cpufreq_driver imx_driver = {
285 288
286static int __init imx_cpufreq_init(void) 289static int __init imx_cpufreq_init(void)
287{ 290{
288 291 bclk_div_at_boot = __mfld2val(CSCR_BCLK_DIV, CSCR) + 1;
289 mpctl0_at_boot = 0; 292 mpctl0_at_boot = 0;
290 293
291 if((CSCR & CSCR_MPEN) && 294 if((CSCR & CSCR_MPEN) &&
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
index b5aa49d00ca3..7a7fa51ec62c 100644
--- a/arch/arm/mach-imx/generic.c
+++ b/arch/arm/mach-imx/generic.c
@@ -102,7 +102,7 @@ EXPORT_SYMBOL(imx_gpio_mode);
102 * f = 2 * f_ref * -------------------- 102 * f = 2 * f_ref * --------------------
103 * pd + 1 103 * pd + 1
104 */ 104 */
105static unsigned int imx_decode_pll(unsigned int pll) 105static unsigned int imx_decode_pll(unsigned int pll, u32 f_ref)
106{ 106{
107 unsigned long long ll; 107 unsigned long long ll;
108 unsigned long quot; 108 unsigned long quot;
@@ -111,7 +111,6 @@ static unsigned int imx_decode_pll(unsigned int pll)
111 u32 mfn = pll & 0x3ff; 111 u32 mfn = pll & 0x3ff;
112 u32 mfd = (pll >> 16) & 0x3ff; 112 u32 mfd = (pll >> 16) & 0x3ff;
113 u32 pd = (pll >> 26) & 0xf; 113 u32 pd = (pll >> 26) & 0xf;
114 u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512);
115 114
116 mfi = mfi <= 5 ? 5 : mfi; 115 mfi = mfi <= 5 ? 5 : mfi;
117 116
@@ -124,13 +123,15 @@ static unsigned int imx_decode_pll(unsigned int pll)
124 123
125unsigned int imx_get_system_clk(void) 124unsigned int imx_get_system_clk(void)
126{ 125{
127 return imx_decode_pll(SPCTL0); 126 u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512);
127
128 return imx_decode_pll(SPCTL0, f_ref);
128} 129}
129EXPORT_SYMBOL(imx_get_system_clk); 130EXPORT_SYMBOL(imx_get_system_clk);
130 131
131unsigned int imx_get_mcu_clk(void) 132unsigned int imx_get_mcu_clk(void)
132{ 133{
133 return imx_decode_pll(MPCTL0); 134 return imx_decode_pll(MPCTL0, CLK32 * 512);
134} 135}
135EXPORT_SYMBOL(imx_get_mcu_clk); 136EXPORT_SYMBOL(imx_get_mcu_clk);
136 137
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
index a193dd931512..760c9d0db7c3 100644
--- a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
+++ b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
@@ -32,7 +32,7 @@ static void __init mach_cc9p9360dev_init_machine(void)
32 board_a9m9750dev_init_machine(); 32 board_a9m9750dev_init_machine();
33} 33}
34 34
35MACHINE_START(CC9P9360DEV, "Connect Core 9P 9360 on an A9M9750 Devboard") 35MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an A9M9750 Devboard")
36 .map_io = mach_cc9p9360dev_map_io, 36 .map_io = mach_cc9p9360dev_map_io,
37 .init_irq = mach_cc9p9360dev_init_irq, 37 .init_irq = mach_cc9p9360dev_init_irq,
38 .init_machine = mach_cc9p9360dev_init_machine, 38 .init_machine = mach_cc9p9360dev_init_machine,
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 6e113078f7ab..ad519390dd58 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -27,6 +27,7 @@
27#include <linux/mtd/nand.h> 27#include <linux/mtd/nand.h>
28#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
29#include <linux/input.h> 29#include <linux/input.h>
30#include <linux/workqueue.h>
30 31
31#include <asm/hardware.h> 32#include <asm/hardware.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 0de201c3d50b..5170481afeab 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -27,6 +27,7 @@
27 27
28#include <asm/arch/clock.h> 28#include <asm/arch/clock.h>
29#include <asm/arch/sram.h> 29#include <asm/arch/sram.h>
30#include <asm/div64.h>
30 31
31#include "prcm-regs.h" 32#include "prcm-regs.h"
32#include "memory.h" 33#include "memory.h"
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 8816f5a33a28..162978fd5359 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -1013,7 +1013,8 @@ static struct clk dss2_fck = { /* Alt clk used in power management */
1013 .name = "dss2_fck", 1013 .name = "dss2_fck",
1014 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ 1014 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
1015 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 1015 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1016 RATE_CKCTL | CM_CORE_SEL1 | RATE_FIXED, 1016 RATE_CKCTL | CM_CORE_SEL1 | RATE_FIXED |
1017 DELAYED_APP,
1017 .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE, 1018 .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
1018 .enable_bit = 1, 1019 .enable_bit = 1,
1019 .src_offset = 13, 1020 .src_offset = 13,
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 7915a5a22865..72738771fb57 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -28,6 +28,7 @@
28#include <asm/hardware.h> 28#include <asm/hardware.h>
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/system.h> 30#include <asm/system.h>
31#include <asm/arch/pxa-regs.h>
31#include <asm/arch/irda.h> 32#include <asm/arch/irda.h>
32#include <asm/arch/mmc.h> 33#include <asm/arch/mmc.h>
33#include <asm/arch/udc.h> 34#include <asm/arch/udc.h>
@@ -35,8 +36,6 @@
35#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 37#include <asm/mach/map.h>
37#include <asm/mach/irq.h> 38#include <asm/mach/irq.h>
38
39#include <asm/arch/pxa-regs.h>
40#include <asm/arch/tosa.h> 39#include <asm/arch/tosa.h>
41 40
42#include <asm/hardware/scoop.h> 41#include <asm/hardware/scoop.h>
diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c
index f2e81cd79002..6f4388f7c20b 100644
--- a/arch/avr32/kernel/ptrace.c
+++ b/arch/avr32/kernel/ptrace.c
@@ -313,7 +313,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
313 __mtdr(DBGREG_DC, dc); 313 __mtdr(DBGREG_DC, dc);
314 314
315 ti = current_thread_info(); 315 ti = current_thread_info();
316 ti->flags |= _TIF_BREAKPOINT; 316 set_ti_thread_flag(ti, TIF_BREAKPOINT);
317 317
318 /* The TLB miss handlers don't check thread flags */ 318 /* The TLB miss handlers don't check thread flags */
319 if ((regs->pc >= (unsigned long)&itlb_miss) 319 if ((regs->pc >= (unsigned long)&itlb_miss)
@@ -328,7 +328,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
328 * single step. 328 * single step.
329 */ 329 */
330 if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR) 330 if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR)
331 ti->flags |= TIF_SINGLE_STEP; 331 set_ti_thread_flag(ti, TIF_SINGLE_STEP);
332 } else { 332 } else {
333 panic("Unable to handle debug trap at pc = %08lx\n", 333 panic("Unable to handle debug trap at pc = %08lx\n",
334 regs->pc); 334 regs->pc);
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index 7e803f4d7a12..adc01a12d154 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -49,39 +49,45 @@ out:
49 return; 49 return;
50} 50}
51 51
52static inline int valid_stack_ptr(struct thread_info *tinfo, unsigned long p)
53{
54 return (p > (unsigned long)tinfo)
55 && (p < (unsigned long)tinfo + THREAD_SIZE - 3);
56}
57
52#ifdef CONFIG_FRAME_POINTER 58#ifdef CONFIG_FRAME_POINTER
53static inline void __show_trace(struct task_struct *tsk, unsigned long *sp, 59static inline void __show_trace(struct task_struct *tsk, unsigned long *sp,
54 struct pt_regs *regs) 60 struct pt_regs *regs)
55{ 61{
56 unsigned long __user *fp; 62 unsigned long lr, fp;
57 unsigned long __user *last_fp = NULL; 63 struct thread_info *tinfo;
58 64
59 if (regs) { 65 tinfo = (struct thread_info *)
60 fp = (unsigned long __user *)regs->r7; 66 ((unsigned long)sp & ~(THREAD_SIZE - 1));
61 } else if (tsk == current) { 67
62 register unsigned long __user *real_fp __asm__("r7"); 68 if (regs)
63 fp = real_fp; 69 fp = regs->r7;
64 } else { 70 else if (tsk == current)
65 fp = (unsigned long __user *)tsk->thread.cpu_context.r7; 71 asm("mov %0, r7" : "=r"(fp));
66 } 72 else
73 fp = tsk->thread.cpu_context.r7;
67 74
68 /* 75 /*
69 * Walk the stack until (a) we get an exception, (b) the frame 76 * Walk the stack as long as the frame pointer (a) is within
70 * pointer becomes zero, or (c) the frame pointer gets stuck 77 * the kernel stack of the task, and (b) it doesn't move
71 * at the same value. 78 * downwards.
72 */ 79 */
73 while (fp && fp != last_fp) { 80 while (valid_stack_ptr(tinfo, fp)) {
74 unsigned long lr, new_fp = 0; 81 unsigned long new_fp;
75
76 last_fp = fp;
77 if (__get_user(lr, fp))
78 break;
79 if (fp && __get_user(new_fp, fp + 1))
80 break;
81 fp = (unsigned long __user *)new_fp;
82 82
83 lr = *(unsigned long *)fp;
83 printk(" [<%08lx>] ", lr); 84 printk(" [<%08lx>] ", lr);
84 print_symbol("%s\n", lr); 85 print_symbol("%s\n", lr);
86
87 new_fp = *(unsigned long *)(fp + 4);
88 if (new_fp <= fp)
89 break;
90 fp = new_fp;
85 } 91 }
86 printk("\n"); 92 printk("\n");
87} 93}
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index bc235507c5c7..472703f90c22 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -752,7 +752,7 @@ static struct resource atmel_spi1_resource[] = {
752DEFINE_DEV(atmel_spi, 1); 752DEFINE_DEV(atmel_spi, 1);
753DEV_CLK(spi_clk, atmel_spi1, pba, 1); 753DEV_CLK(spi_clk, atmel_spi1, pba, 1);
754 754
755static void 755static void __init
756at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, 756at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b,
757 unsigned int n, const u8 *pins) 757 unsigned int n, const u8 *pins)
758{ 758{
diff --git a/arch/avr32/mm/cache.c b/arch/avr32/mm/cache.c
index fb13f72e9a02..8f7b1c3cd0f9 100644
--- a/arch/avr32/mm/cache.c
+++ b/arch/avr32/mm/cache.c
@@ -121,9 +121,8 @@ void flush_icache_range(unsigned long start, unsigned long end)
121void flush_icache_page(struct vm_area_struct *vma, struct page *page) 121void flush_icache_page(struct vm_area_struct *vma, struct page *page)
122{ 122{
123 if (vma->vm_flags & VM_EXEC) { 123 if (vma->vm_flags & VM_EXEC) {
124 void *v = kmap(page); 124 void *v = page_address(page);
125 __flush_icache_range((unsigned long)v, (unsigned long)v + PAGE_SIZE); 125 __flush_icache_range((unsigned long)v, (unsigned long)v + PAGE_SIZE);
126 kunmap(v);
127 } 126 }
128} 127}
129 128
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 27e8453274e6..53d62373a524 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -220,7 +220,7 @@ config PARAVIRT
220 220
221config VMI 221config VMI
222 bool "VMI Paravirt-ops support" 222 bool "VMI Paravirt-ops support"
223 depends on PARAVIRT 223 depends on PARAVIRT && !COMPAT_VDSO
224 help 224 help
225 VMI provides a paravirtualized interface to the VMware ESX server 225 VMI provides a paravirtualized interface to the VMware ESX server
226 (it could be used by other hypervisors in theory too, but is not 226 (it could be used by other hypervisors in theory too, but is not
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index e5eb97a910ed..9ea5b8ecc7e1 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -1072,7 +1072,28 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
1072 "ASUS A7V ACPI BIOS Revision 1007"), 1072 "ASUS A7V ACPI BIOS Revision 1007"),
1073 }, 1073 },
1074 }, 1074 },
1075 1075 {
1076 /*
1077 * Latest BIOS for IBM 600E (1.16) has bad pcinum
1078 * for LPC bridge, which is needed for the PCI
1079 * interrupt links to work. DSDT fix is in bug 5966.
1080 * 2645, 2646 model numbers are shared with 600/600E/600X
1081 */
1082 .callback = disable_acpi_irq,
1083 .ident = "IBM Thinkpad 600 Series 2645",
1084 .matches = {
1085 DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
1086 DMI_MATCH(DMI_BOARD_NAME, "2645"),
1087 },
1088 },
1089 {
1090 .callback = disable_acpi_irq,
1091 .ident = "IBM Thinkpad 600 Series 2646",
1092 .matches = {
1093 DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
1094 DMI_MATCH(DMI_BOARD_NAME, "2646"),
1095 },
1096 },
1076 /* 1097 /*
1077 * Boxes that need ACPI PCI IRQ routing and PCI scan disabled 1098 * Boxes that need ACPI PCI IRQ routing and PCI scan disabled
1078 */ 1099 */
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c
index bf86f7662d8b..a7d22d9f3d7e 100644
--- a/arch/i386/kernel/acpi/earlyquirk.c
+++ b/arch/i386/kernel/acpi/earlyquirk.c
@@ -14,11 +14,8 @@
14 14
15#ifdef CONFIG_ACPI 15#ifdef CONFIG_ACPI
16 16
17static int nvidia_hpet_detected __initdata;
18
19static int __init nvidia_hpet_check(struct acpi_table_header *header) 17static int __init nvidia_hpet_check(struct acpi_table_header *header)
20{ 18{
21 nvidia_hpet_detected = 1;
22 return 0; 19 return 0;
23} 20}
24#endif 21#endif
@@ -29,9 +26,7 @@ static int __init check_bridge(int vendor, int device)
29 /* According to Nvidia all timer overrides are bogus unless HPET 26 /* According to Nvidia all timer overrides are bogus unless HPET
30 is enabled. */ 27 is enabled. */
31 if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) { 28 if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) {
32 nvidia_hpet_detected = 0; 29 if (acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check)) {
33 acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check);
34 if (nvidia_hpet_detected == 0) {
35 acpi_skip_timer_override = 1; 30 acpi_skip_timer_override = 1;
36 printk(KERN_INFO "Nvidia board " 31 printk(KERN_INFO "Nvidia board "
37 "detected. Ignoring ACPI " 32 "detected. Ignoring ACPI "
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 9b0dd2744c82..4ff55e675576 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -45,6 +45,7 @@
45#include <linux/notifier.h> 45#include <linux/notifier.h>
46#include <linux/cpu.h> 46#include <linux/cpu.h>
47#include <linux/percpu.h> 47#include <linux/percpu.h>
48#include <linux/nmi.h>
48 49
49#include <linux/delay.h> 50#include <linux/delay.h>
50#include <linux/mc146818rtc.h> 51#include <linux/mc146818rtc.h>
@@ -1278,8 +1279,9 @@ void __cpu_die(unsigned int cpu)
1278 1279
1279int __cpuinit __cpu_up(unsigned int cpu) 1280int __cpuinit __cpu_up(unsigned int cpu)
1280{ 1281{
1282 unsigned long flags;
1281#ifdef CONFIG_HOTPLUG_CPU 1283#ifdef CONFIG_HOTPLUG_CPU
1282 int ret=0; 1284 int ret = 0;
1283 1285
1284 /* 1286 /*
1285 * We do warm boot only on cpus that had booted earlier 1287 * We do warm boot only on cpus that had booted earlier
@@ -1297,23 +1299,25 @@ int __cpuinit __cpu_up(unsigned int cpu)
1297 /* In case one didn't come up */ 1299 /* In case one didn't come up */
1298 if (!cpu_isset(cpu, cpu_callin_map)) { 1300 if (!cpu_isset(cpu, cpu_callin_map)) {
1299 printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu); 1301 printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu);
1300 local_irq_enable();
1301 return -EIO; 1302 return -EIO;
1302 } 1303 }
1303 1304
1304 local_irq_enable();
1305
1306 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; 1305 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
1307 /* Unleash the CPU! */ 1306 /* Unleash the CPU! */
1308 cpu_set(cpu, smp_commenced_mask); 1307 cpu_set(cpu, smp_commenced_mask);
1309 1308
1310 /* 1309 /*
1311 * Check TSC synchronization with the AP: 1310 * Check TSC synchronization with the AP (keep irqs disabled
1311 * while doing so):
1312 */ 1312 */
1313 local_irq_save(flags);
1313 check_tsc_sync_source(cpu); 1314 check_tsc_sync_source(cpu);
1315 local_irq_restore(flags);
1314 1316
1315 while (!cpu_isset(cpu, cpu_online_map)) 1317 while (!cpu_isset(cpu, cpu_online_map)) {
1316 cpu_relax(); 1318 cpu_relax();
1319 touch_nmi_watchdog();
1320 }
1317 1321
1318#ifdef CONFIG_X86_GENERICARCH 1322#ifdef CONFIG_X86_GENERICARCH
1319 if (num_online_cpus() > 8 && genapic == &apic_default) 1323 if (num_online_cpus() > 8 && genapic == &apic_default)
diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c
index 875d8a6ecc02..602660df455c 100644
--- a/arch/i386/kernel/tsc.c
+++ b/arch/i386/kernel/tsc.c
@@ -24,7 +24,6 @@
24 * an extra value to store the TSC freq 24 * an extra value to store the TSC freq
25 */ 25 */
26unsigned int tsc_khz; 26unsigned int tsc_khz;
27unsigned long long (*custom_sched_clock)(void);
28 27
29int tsc_disable; 28int tsc_disable;
30 29
diff --git a/arch/i386/kernel/vmitime.c b/arch/i386/kernel/vmitime.c
index 8dc72d575666..9dfb17739b67 100644
--- a/arch/i386/kernel/vmitime.c
+++ b/arch/i386/kernel/vmitime.c
@@ -123,12 +123,10 @@ static struct clocksource clocksource_vmi = {
123static irqreturn_t vmi_timer_interrupt(int irq, void *dev_id); 123static irqreturn_t vmi_timer_interrupt(int irq, void *dev_id);
124 124
125static struct irqaction vmi_timer_irq = { 125static struct irqaction vmi_timer_irq = {
126 vmi_timer_interrupt, 126 .handler = vmi_timer_interrupt,
127 SA_INTERRUPT, 127 .flags = IRQF_DISABLED,
128 CPU_MASK_NONE, 128 .mask = CPU_MASK_NONE,
129 "VMI-alarm", 129 .name = "VMI-alarm",
130 NULL,
131 NULL
132}; 130};
133 131
134/* Alarm rate */ 132/* Alarm rate */
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index 9d1cffb57cde..a1446931b401 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_defconfig
@@ -1,8 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc5 3# Linux kernel version: 2.6.21-rc3
4# Mon Feb 27 15:49:18 2006 4# Thu Mar 8 11:07:09 2007
5# 5#
6CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
6 7
7# 8#
8# Code maturity level options 9# Code maturity level options
@@ -18,16 +19,24 @@ CONFIG_LOCALVERSION=""
18CONFIG_LOCALVERSION_AUTO=y 19CONFIG_LOCALVERSION_AUTO=y
19CONFIG_SWAP=y 20CONFIG_SWAP=y
20CONFIG_SYSVIPC=y 21CONFIG_SYSVIPC=y
22# CONFIG_IPC_NS is not set
23CONFIG_SYSVIPC_SYSCTL=y
21CONFIG_POSIX_MQUEUE=y 24CONFIG_POSIX_MQUEUE=y
22# CONFIG_BSD_PROCESS_ACCT is not set 25# CONFIG_BSD_PROCESS_ACCT is not set
23CONFIG_SYSCTL=y 26# CONFIG_TASKSTATS is not set
27# CONFIG_UTS_NS is not set
24# CONFIG_AUDIT is not set 28# CONFIG_AUDIT is not set
25CONFIG_IKCONFIG=y 29CONFIG_IKCONFIG=y
26CONFIG_IKCONFIG_PROC=y 30CONFIG_IKCONFIG_PROC=y
27# CONFIG_CPUSETS is not set 31# CONFIG_CPUSETS is not set
32CONFIG_SYSFS_DEPRECATED=y
33# CONFIG_RELAY is not set
34CONFIG_BLK_DEV_INITRD=y
28CONFIG_INITRAMFS_SOURCE="" 35CONFIG_INITRAMFS_SOURCE=""
29CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
37CONFIG_SYSCTL=y
30# CONFIG_EMBEDDED is not set 38# CONFIG_EMBEDDED is not set
39CONFIG_SYSCTL_SYSCALL=y
31CONFIG_KALLSYMS=y 40CONFIG_KALLSYMS=y
32CONFIG_KALLSYMS_ALL=y 41CONFIG_KALLSYMS_ALL=y
33# CONFIG_KALLSYMS_EXTRA_PASS is not set 42# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -39,11 +48,9 @@ CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 48CONFIG_FUTEX=y
40CONFIG_EPOLL=y 49CONFIG_EPOLL=y
41CONFIG_SHMEM=y 50CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46CONFIG_SLAB=y 51CONFIG_SLAB=y
52CONFIG_VM_EVENT_COUNTERS=y
53CONFIG_RT_MUTEXES=y
47# CONFIG_TINY_SHMEM is not set 54# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0 55CONFIG_BASE_SMALL=0
49# CONFIG_SLOB is not set 56# CONFIG_SLOB is not set
@@ -54,7 +61,6 @@ CONFIG_BASE_SMALL=0
54CONFIG_MODULES=y 61CONFIG_MODULES=y
55CONFIG_MODULE_UNLOAD=y 62CONFIG_MODULE_UNLOAD=y
56# CONFIG_MODULE_FORCE_UNLOAD is not set 63# CONFIG_MODULE_FORCE_UNLOAD is not set
57CONFIG_OBSOLETE_MODPARM=y
58CONFIG_MODVERSIONS=y 64CONFIG_MODVERSIONS=y
59CONFIG_MODULE_SRCVERSION_ALL=y 65CONFIG_MODULE_SRCVERSION_ALL=y
60CONFIG_KMOD=y 66CONFIG_KMOD=y
@@ -63,6 +69,8 @@ CONFIG_STOP_MACHINE=y
63# 69#
64# Block layer 70# Block layer
65# 71#
72CONFIG_BLOCK=y
73# CONFIG_BLK_DEV_IO_TRACE is not set
66 74
67# 75#
68# IO Schedulers 76# IO Schedulers
@@ -82,15 +90,20 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
82# 90#
83CONFIG_IA64=y 91CONFIG_IA64=y
84CONFIG_64BIT=y 92CONFIG_64BIT=y
93CONFIG_ZONE_DMA=y
85CONFIG_MMU=y 94CONFIG_MMU=y
86CONFIG_SWIOTLB=y 95CONFIG_SWIOTLB=y
87CONFIG_RWSEM_XCHGADD_ALGORITHM=y 96CONFIG_RWSEM_XCHGADD_ALGORITHM=y
97# CONFIG_ARCH_HAS_ILOG2_U32 is not set
98# CONFIG_ARCH_HAS_ILOG2_U64 is not set
99CONFIG_GENERIC_FIND_NEXT_BIT=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 100CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_TIME_INTERPOLATION=y 101CONFIG_TIME_INTERPOLATION=y
102CONFIG_DMI=y
90CONFIG_EFI=y 103CONFIG_EFI=y
91CONFIG_GENERIC_IOMAP=y 104CONFIG_GENERIC_IOMAP=y
92CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 105CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
93CONFIG_DMA_IS_DMA32=y 106CONFIG_AUDIT_ARCH=y
94# CONFIG_IA64_GENERIC is not set 107# CONFIG_IA64_GENERIC is not set
95CONFIG_IA64_DIG=y 108CONFIG_IA64_DIG=y
96# CONFIG_IA64_HP_ZX1 is not set 109# CONFIG_IA64_HP_ZX1 is not set
@@ -107,6 +120,7 @@ CONFIG_PGTABLE_3=y
107# CONFIG_PGTABLE_4 is not set 120# CONFIG_PGTABLE_4 is not set
108# CONFIG_HZ_100 is not set 121# CONFIG_HZ_100 is not set
109CONFIG_HZ_250=y 122CONFIG_HZ_250=y
123# CONFIG_HZ_300 is not set
110# CONFIG_HZ_1000 is not set 124# CONFIG_HZ_1000 is not set
111CONFIG_HZ=250 125CONFIG_HZ=250
112CONFIG_IA64_L1_CACHE_SHIFT=7 126CONFIG_IA64_L1_CACHE_SHIFT=7
@@ -116,9 +130,10 @@ CONFIG_FORCE_MAX_ZONEORDER=17
116CONFIG_SMP=y 130CONFIG_SMP=y
117CONFIG_NR_CPUS=16 131CONFIG_NR_CPUS=16
118CONFIG_HOTPLUG_CPU=y 132CONFIG_HOTPLUG_CPU=y
133CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
134# CONFIG_SCHED_SMT is not set
119CONFIG_PERMIT_BSP_REMOVE=y 135CONFIG_PERMIT_BSP_REMOVE=y
120CONFIG_FORCE_CPEI_RETARGET=y 136CONFIG_FORCE_CPEI_RETARGET=y
121# CONFIG_SCHED_SMT is not set
122# CONFIG_PREEMPT is not set 137# CONFIG_PREEMPT is not set
123CONFIG_SELECT_MEMORY_MODEL=y 138CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 139CONFIG_FLATMEM_MANUAL=y
@@ -128,10 +143,13 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 143CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 144# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 145CONFIG_SPLIT_PTLOCK_CPUS=4
146CONFIG_RESOURCES_64BIT=y
147CONFIG_ZONE_DMA_FLAG=1
131CONFIG_ARCH_SELECT_MEMORY_MODEL=y 148CONFIG_ARCH_SELECT_MEMORY_MODEL=y
132CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 149CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
133CONFIG_ARCH_FLATMEM_ENABLE=y 150CONFIG_ARCH_FLATMEM_ENABLE=y
134CONFIG_ARCH_SPARSEMEM_ENABLE=y 151CONFIG_ARCH_SPARSEMEM_ENABLE=y
152CONFIG_ARCH_POPULATES_NODE_MAP=y
135CONFIG_VIRTUAL_MEM_MAP=y 153CONFIG_VIRTUAL_MEM_MAP=y
136CONFIG_HOLES_IN_ZONE=y 154CONFIG_HOLES_IN_ZONE=y
137CONFIG_IA32_SUPPORT=y 155CONFIG_IA32_SUPPORT=y
@@ -139,6 +157,9 @@ CONFIG_COMPAT=y
139CONFIG_IA64_MCA_RECOVERY=y 157CONFIG_IA64_MCA_RECOVERY=y
140CONFIG_PERFMON=y 158CONFIG_PERFMON=y
141CONFIG_IA64_PALINFO=y 159CONFIG_IA64_PALINFO=y
160# CONFIG_IA64_ESI is not set
161CONFIG_KEXEC=y
162# CONFIG_CRASH_DUMP is not set
142 163
143# 164#
144# Firmware Drivers 165# Firmware Drivers
@@ -154,13 +175,16 @@ CONFIG_BINFMT_MISC=m
154CONFIG_PM=y 175CONFIG_PM=y
155CONFIG_PM_LEGACY=y 176CONFIG_PM_LEGACY=y
156# CONFIG_PM_DEBUG is not set 177# CONFIG_PM_DEBUG is not set
178# CONFIG_PM_SYSFS_DEPRECATED is not set
157 179
158# 180#
159# ACPI (Advanced Configuration and Power Interface) Support 181# ACPI (Advanced Configuration and Power Interface) Support
160# 182#
161CONFIG_ACPI=y 183CONFIG_ACPI=y
184CONFIG_ACPI_PROCFS=y
162CONFIG_ACPI_BUTTON=m 185CONFIG_ACPI_BUTTON=m
163CONFIG_ACPI_FAN=m 186CONFIG_ACPI_FAN=m
187# CONFIG_ACPI_DOCK is not set
164CONFIG_ACPI_PROCESSOR=m 188CONFIG_ACPI_PROCESSOR=m
165CONFIG_ACPI_HOTPLUG_CPU=y 189CONFIG_ACPI_HOTPLUG_CPU=y
166CONFIG_ACPI_THERMAL=m 190CONFIG_ACPI_THERMAL=m
@@ -181,8 +205,8 @@ CONFIG_ACPI_CONTAINER=m
181# 205#
182CONFIG_PCI=y 206CONFIG_PCI=y
183CONFIG_PCI_DOMAINS=y 207CONFIG_PCI_DOMAINS=y
208# CONFIG_PCIEPORTBUS is not set
184# CONFIG_PCI_MSI is not set 209# CONFIG_PCI_MSI is not set
185CONFIG_PCI_LEGACY_PROC=y
186# CONFIG_PCI_DEBUG is not set 210# CONFIG_PCI_DEBUG is not set
187 211
188# 212#
@@ -212,6 +236,10 @@ CONFIG_NET=y
212CONFIG_PACKET=y 236CONFIG_PACKET=y
213# CONFIG_PACKET_MMAP is not set 237# CONFIG_PACKET_MMAP is not set
214CONFIG_UNIX=y 238CONFIG_UNIX=y
239CONFIG_XFRM=y
240# CONFIG_XFRM_USER is not set
241# CONFIG_XFRM_SUB_POLICY is not set
242# CONFIG_XFRM_MIGRATE is not set
215# CONFIG_NET_KEY is not set 243# CONFIG_NET_KEY is not set
216CONFIG_INET=y 244CONFIG_INET=y
217CONFIG_IP_MULTICAST=y 245CONFIG_IP_MULTICAST=y
@@ -226,12 +254,21 @@ CONFIG_SYN_COOKIES=y
226# CONFIG_INET_AH is not set 254# CONFIG_INET_AH is not set
227# CONFIG_INET_ESP is not set 255# CONFIG_INET_ESP is not set
228# CONFIG_INET_IPCOMP is not set 256# CONFIG_INET_IPCOMP is not set
257# CONFIG_INET_XFRM_TUNNEL is not set
229# CONFIG_INET_TUNNEL is not set 258# CONFIG_INET_TUNNEL is not set
259CONFIG_INET_XFRM_MODE_TRANSPORT=y
260CONFIG_INET_XFRM_MODE_TUNNEL=y
261CONFIG_INET_XFRM_MODE_BEET=y
230CONFIG_INET_DIAG=y 262CONFIG_INET_DIAG=y
231CONFIG_INET_TCP_DIAG=y 263CONFIG_INET_TCP_DIAG=y
232# CONFIG_TCP_CONG_ADVANCED is not set 264# CONFIG_TCP_CONG_ADVANCED is not set
233CONFIG_TCP_CONG_BIC=y 265CONFIG_TCP_CONG_CUBIC=y
266CONFIG_DEFAULT_TCP_CONG="cubic"
267# CONFIG_TCP_MD5SIG is not set
234# CONFIG_IPV6 is not set 268# CONFIG_IPV6 is not set
269# CONFIG_INET6_XFRM_TUNNEL is not set
270# CONFIG_INET6_TUNNEL is not set
271# CONFIG_NETWORK_SECMARK is not set
235# CONFIG_NETFILTER is not set 272# CONFIG_NETFILTER is not set
236 273
237# 274#
@@ -257,7 +294,6 @@ CONFIG_TCP_CONG_BIC=y
257# CONFIG_ATALK is not set 294# CONFIG_ATALK is not set
258# CONFIG_X25 is not set 295# CONFIG_X25 is not set
259# CONFIG_LAPB is not set 296# CONFIG_LAPB is not set
260# CONFIG_NET_DIVERT is not set
261# CONFIG_ECONET is not set 297# CONFIG_ECONET is not set
262# CONFIG_WAN_ROUTER is not set 298# CONFIG_WAN_ROUTER is not set
263 299
@@ -286,6 +322,8 @@ CONFIG_STANDALONE=y
286CONFIG_PREVENT_FIRMWARE_BUILD=y 322CONFIG_PREVENT_FIRMWARE_BUILD=y
287CONFIG_FW_LOADER=m 323CONFIG_FW_LOADER=m
288# CONFIG_DEBUG_DRIVER is not set 324# CONFIG_DEBUG_DRIVER is not set
325# CONFIG_DEBUG_DEVRES is not set
326# CONFIG_SYS_HYPERVISOR is not set
289 327
290# 328#
291# Connector - unified userspace <-> kernelspace linker 329# Connector - unified userspace <-> kernelspace linker
@@ -329,11 +367,17 @@ CONFIG_BLK_DEV_NBD=m
329CONFIG_BLK_DEV_RAM=y 367CONFIG_BLK_DEV_RAM=y
330CONFIG_BLK_DEV_RAM_COUNT=16 368CONFIG_BLK_DEV_RAM_COUNT=16
331CONFIG_BLK_DEV_RAM_SIZE=4096 369CONFIG_BLK_DEV_RAM_SIZE=4096
332CONFIG_BLK_DEV_INITRD=y 370CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
333# CONFIG_CDROM_PKTCDVD is not set 371# CONFIG_CDROM_PKTCDVD is not set
334# CONFIG_ATA_OVER_ETH is not set 372# CONFIG_ATA_OVER_ETH is not set
335 373
336# 374#
375# Misc devices
376#
377# CONFIG_SGI_IOC4 is not set
378# CONFIG_TIFM_CORE is not set
379
380#
337# ATA/ATAPI/MFM/RLL support 381# ATA/ATAPI/MFM/RLL support
338# 382#
339CONFIG_IDE=y 383CONFIG_IDE=y
@@ -350,6 +394,7 @@ CONFIG_BLK_DEV_IDECD=y
350# CONFIG_BLK_DEV_IDETAPE is not set 394# CONFIG_BLK_DEV_IDETAPE is not set
351CONFIG_BLK_DEV_IDEFLOPPY=y 395CONFIG_BLK_DEV_IDEFLOPPY=y
352CONFIG_BLK_DEV_IDESCSI=m 396CONFIG_BLK_DEV_IDESCSI=m
397# CONFIG_BLK_DEV_IDEACPI is not set
353# CONFIG_IDE_TASK_IOCTL is not set 398# CONFIG_IDE_TASK_IOCTL is not set
354 399
355# 400#
@@ -376,8 +421,10 @@ CONFIG_BLK_DEV_CMD64X=y
376# CONFIG_BLK_DEV_CS5530 is not set 421# CONFIG_BLK_DEV_CS5530 is not set
377# CONFIG_BLK_DEV_HPT34X is not set 422# CONFIG_BLK_DEV_HPT34X is not set
378# CONFIG_BLK_DEV_HPT366 is not set 423# CONFIG_BLK_DEV_HPT366 is not set
424# CONFIG_BLK_DEV_JMICRON is not set
379# CONFIG_BLK_DEV_SC1200 is not set 425# CONFIG_BLK_DEV_SC1200 is not set
380CONFIG_BLK_DEV_PIIX=y 426CONFIG_BLK_DEV_PIIX=y
427# CONFIG_BLK_DEV_IT8213 is not set
381# CONFIG_BLK_DEV_IT821X is not set 428# CONFIG_BLK_DEV_IT821X is not set
382# CONFIG_BLK_DEV_NS87415 is not set 429# CONFIG_BLK_DEV_NS87415 is not set
383# CONFIG_BLK_DEV_PDC202XX_OLD is not set 430# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -387,6 +434,7 @@ CONFIG_BLK_DEV_PIIX=y
387# CONFIG_BLK_DEV_SLC90E66 is not set 434# CONFIG_BLK_DEV_SLC90E66 is not set
388# CONFIG_BLK_DEV_TRM290 is not set 435# CONFIG_BLK_DEV_TRM290 is not set
389# CONFIG_BLK_DEV_VIA82CXXX is not set 436# CONFIG_BLK_DEV_VIA82CXXX is not set
437# CONFIG_BLK_DEV_TC86C001 is not set
390# CONFIG_IDE_ARM is not set 438# CONFIG_IDE_ARM is not set
391CONFIG_BLK_DEV_IDEDMA=y 439CONFIG_BLK_DEV_IDEDMA=y
392# CONFIG_IDEDMA_IVB is not set 440# CONFIG_IDEDMA_IVB is not set
@@ -398,6 +446,8 @@ CONFIG_IDEDMA_AUTO=y
398# 446#
399# CONFIG_RAID_ATTRS is not set 447# CONFIG_RAID_ATTRS is not set
400CONFIG_SCSI=y 448CONFIG_SCSI=y
449# CONFIG_SCSI_TGT is not set
450CONFIG_SCSI_NETLINK=y
401CONFIG_SCSI_PROC_FS=y 451CONFIG_SCSI_PROC_FS=y
402 452
403# 453#
@@ -417,14 +467,16 @@ CONFIG_CHR_DEV_SG=m
417# CONFIG_SCSI_MULTI_LUN is not set 467# CONFIG_SCSI_MULTI_LUN is not set
418# CONFIG_SCSI_CONSTANTS is not set 468# CONFIG_SCSI_CONSTANTS is not set
419# CONFIG_SCSI_LOGGING is not set 469# CONFIG_SCSI_LOGGING is not set
470# CONFIG_SCSI_SCAN_ASYNC is not set
420 471
421# 472#
422# SCSI Transport Attributes 473# SCSI Transports
423# 474#
424CONFIG_SCSI_SPI_ATTRS=y 475CONFIG_SCSI_SPI_ATTRS=y
425CONFIG_SCSI_FC_ATTRS=y 476CONFIG_SCSI_FC_ATTRS=y
426# CONFIG_SCSI_ISCSI_ATTRS is not set 477# CONFIG_SCSI_ISCSI_ATTRS is not set
427# CONFIG_SCSI_SAS_ATTRS is not set 478# CONFIG_SCSI_SAS_ATTRS is not set
479# CONFIG_SCSI_SAS_LIBSAS is not set
428 480
429# 481#
430# SCSI low-level drivers 482# SCSI low-level drivers
@@ -437,29 +489,36 @@ CONFIG_SCSI_FC_ATTRS=y
437# CONFIG_SCSI_AIC7XXX is not set 489# CONFIG_SCSI_AIC7XXX is not set
438# CONFIG_SCSI_AIC7XXX_OLD is not set 490# CONFIG_SCSI_AIC7XXX_OLD is not set
439# CONFIG_SCSI_AIC79XX is not set 491# CONFIG_SCSI_AIC79XX is not set
492# CONFIG_SCSI_AIC94XX is not set
493# CONFIG_SCSI_ARCMSR is not set
440# CONFIG_MEGARAID_NEWGEN is not set 494# CONFIG_MEGARAID_NEWGEN is not set
441# CONFIG_MEGARAID_LEGACY is not set 495# CONFIG_MEGARAID_LEGACY is not set
442# CONFIG_MEGARAID_SAS is not set 496# CONFIG_MEGARAID_SAS is not set
443# CONFIG_SCSI_SATA is not set 497# CONFIG_SCSI_HPTIOP is not set
444# CONFIG_SCSI_DMX3191D is not set 498# CONFIG_SCSI_DMX3191D is not set
445# CONFIG_SCSI_FUTURE_DOMAIN is not set 499# CONFIG_SCSI_FUTURE_DOMAIN is not set
446# CONFIG_SCSI_IPS is not set 500# CONFIG_SCSI_IPS is not set
447# CONFIG_SCSI_INITIO is not set 501# CONFIG_SCSI_INITIO is not set
448# CONFIG_SCSI_INIA100 is not set 502# CONFIG_SCSI_INIA100 is not set
503# CONFIG_SCSI_STEX is not set
449CONFIG_SCSI_SYM53C8XX_2=y 504CONFIG_SCSI_SYM53C8XX_2=y
450CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 505CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
451CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 506CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
452CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 507CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
453# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 508CONFIG_SCSI_SYM53C8XX_MMIO=y
454# CONFIG_SCSI_IPR is not set
455CONFIG_SCSI_QLOGIC_FC=y
456# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
457CONFIG_SCSI_QLOGIC_1280=y 509CONFIG_SCSI_QLOGIC_1280=y
458# CONFIG_SCSI_QLA_FC is not set 510# CONFIG_SCSI_QLA_FC is not set
511# CONFIG_SCSI_QLA_ISCSI is not set
459# CONFIG_SCSI_LPFC is not set 512# CONFIG_SCSI_LPFC is not set
460# CONFIG_SCSI_DC395x is not set 513# CONFIG_SCSI_DC395x is not set
461# CONFIG_SCSI_DC390T is not set 514# CONFIG_SCSI_DC390T is not set
462# CONFIG_SCSI_DEBUG is not set 515# CONFIG_SCSI_DEBUG is not set
516# CONFIG_SCSI_SRP is not set
517
518#
519# Serial ATA (prod) and Parallel ATA (experimental) drivers
520#
521# CONFIG_ATA is not set
463 522
464# 523#
465# Multi-device support (RAID and LVM) 524# Multi-device support (RAID and LVM)
@@ -470,11 +529,11 @@ CONFIG_MD_LINEAR=m
470CONFIG_MD_RAID0=m 529CONFIG_MD_RAID0=m
471CONFIG_MD_RAID1=m 530CONFIG_MD_RAID1=m
472# CONFIG_MD_RAID10 is not set 531# CONFIG_MD_RAID10 is not set
473CONFIG_MD_RAID5=m 532# CONFIG_MD_RAID456 is not set
474CONFIG_MD_RAID6=m
475CONFIG_MD_MULTIPATH=m 533CONFIG_MD_MULTIPATH=m
476# CONFIG_MD_FAULTY is not set 534# CONFIG_MD_FAULTY is not set
477CONFIG_BLK_DEV_DM=m 535CONFIG_BLK_DEV_DM=m
536# CONFIG_DM_DEBUG is not set
478CONFIG_DM_CRYPT=m 537CONFIG_DM_CRYPT=m
479CONFIG_DM_SNAPSHOT=m 538CONFIG_DM_SNAPSHOT=m
480CONFIG_DM_MIRROR=m 539CONFIG_DM_MIRROR=m
@@ -563,6 +622,7 @@ CONFIG_E100=m
563# CONFIG_EPIC100 is not set 622# CONFIG_EPIC100 is not set
564# CONFIG_SUNDANCE is not set 623# CONFIG_SUNDANCE is not set
565# CONFIG_VIA_RHINE is not set 624# CONFIG_VIA_RHINE is not set
625# CONFIG_SC92031 is not set
566 626
567# 627#
568# Ethernet (1000 Mbit) 628# Ethernet (1000 Mbit)
@@ -583,13 +643,18 @@ CONFIG_E1000=y
583# CONFIG_VIA_VELOCITY is not set 643# CONFIG_VIA_VELOCITY is not set
584CONFIG_TIGON3=y 644CONFIG_TIGON3=y
585# CONFIG_BNX2 is not set 645# CONFIG_BNX2 is not set
646# CONFIG_QLA3XXX is not set
647# CONFIG_ATL1 is not set
586 648
587# 649#
588# Ethernet (10000 Mbit) 650# Ethernet (10000 Mbit)
589# 651#
590# CONFIG_CHELSIO_T1 is not set 652# CONFIG_CHELSIO_T1 is not set
653# CONFIG_CHELSIO_T3 is not set
591# CONFIG_IXGB is not set 654# CONFIG_IXGB is not set
592# CONFIG_S2IO is not set 655# CONFIG_S2IO is not set
656# CONFIG_MYRI10GE is not set
657# CONFIG_NETXEN_NIC is not set
593 658
594# 659#
595# Token Ring devices 660# Token Ring devices
@@ -631,6 +696,7 @@ CONFIG_NET_POLL_CONTROLLER=y
631# Input device support 696# Input device support
632# 697#
633CONFIG_INPUT=y 698CONFIG_INPUT=y
699# CONFIG_INPUT_FF_MEMLESS is not set
634 700
635# 701#
636# Userland interfaces 702# Userland interfaces
@@ -653,6 +719,7 @@ CONFIG_KEYBOARD_ATKBD=y
653# CONFIG_KEYBOARD_LKKBD is not set 719# CONFIG_KEYBOARD_LKKBD is not set
654# CONFIG_KEYBOARD_XTKBD is not set 720# CONFIG_KEYBOARD_XTKBD is not set
655# CONFIG_KEYBOARD_NEWTON is not set 721# CONFIG_KEYBOARD_NEWTON is not set
722# CONFIG_KEYBOARD_STOWAWAY is not set
656CONFIG_INPUT_MOUSE=y 723CONFIG_INPUT_MOUSE=y
657CONFIG_MOUSE_PS2=y 724CONFIG_MOUSE_PS2=y
658# CONFIG_MOUSE_SERIAL is not set 725# CONFIG_MOUSE_SERIAL is not set
@@ -682,6 +749,7 @@ CONFIG_GAMEPORT=m
682CONFIG_VT=y 749CONFIG_VT=y
683CONFIG_VT_CONSOLE=y 750CONFIG_VT_CONSOLE=y
684CONFIG_HW_CONSOLE=y 751CONFIG_HW_CONSOLE=y
752# CONFIG_VT_HW_CONSOLE_BINDING is not set
685CONFIG_SERIAL_NONSTANDARD=y 753CONFIG_SERIAL_NONSTANDARD=y
686# CONFIG_COMPUTONE is not set 754# CONFIG_COMPUTONE is not set
687# CONFIG_ROCKETPORT is not set 755# CONFIG_ROCKETPORT is not set
@@ -689,12 +757,14 @@ CONFIG_SERIAL_NONSTANDARD=y
689# CONFIG_DIGIEPCA is not set 757# CONFIG_DIGIEPCA is not set
690# CONFIG_MOXA_INTELLIO is not set 758# CONFIG_MOXA_INTELLIO is not set
691# CONFIG_MOXA_SMARTIO is not set 759# CONFIG_MOXA_SMARTIO is not set
760# CONFIG_MOXA_SMARTIO_NEW is not set
692# CONFIG_ISI is not set 761# CONFIG_ISI is not set
693# CONFIG_SYNCLINKMP is not set 762# CONFIG_SYNCLINKMP is not set
694# CONFIG_SYNCLINK_GT is not set 763# CONFIG_SYNCLINK_GT is not set
695# CONFIG_N_HDLC is not set 764# CONFIG_N_HDLC is not set
696# CONFIG_SPECIALIX is not set 765# CONFIG_SPECIALIX is not set
697# CONFIG_SX is not set 766# CONFIG_SX is not set
767# CONFIG_RIO is not set
698# CONFIG_STALDRV is not set 768# CONFIG_STALDRV is not set
699 769
700# 770#
@@ -702,7 +772,8 @@ CONFIG_SERIAL_NONSTANDARD=y
702# 772#
703CONFIG_SERIAL_8250=y 773CONFIG_SERIAL_8250=y
704CONFIG_SERIAL_8250_CONSOLE=y 774CONFIG_SERIAL_8250_CONSOLE=y
705CONFIG_SERIAL_8250_ACPI=y 775CONFIG_SERIAL_8250_PCI=y
776CONFIG_SERIAL_8250_PNP=y
706CONFIG_SERIAL_8250_NR_UARTS=6 777CONFIG_SERIAL_8250_NR_UARTS=6
707CONFIG_SERIAL_8250_RUNTIME_UARTS=4 778CONFIG_SERIAL_8250_RUNTIME_UARTS=4
708CONFIG_SERIAL_8250_EXTENDED=y 779CONFIG_SERIAL_8250_EXTENDED=y
@@ -734,10 +805,6 @@ CONFIG_EFI_RTC=y
734# CONFIG_DTLK is not set 805# CONFIG_DTLK is not set
735# CONFIG_R3964 is not set 806# CONFIG_R3964 is not set
736# CONFIG_APPLICOM is not set 807# CONFIG_APPLICOM is not set
737
738#
739# Ftape, the floppy tape device driver
740#
741CONFIG_AGP=m 808CONFIG_AGP=m
742CONFIG_AGP_I460=m 809CONFIG_AGP_I460=m
743CONFIG_DRM=m 810CONFIG_DRM=m
@@ -759,7 +826,6 @@ CONFIG_HPET_MMAP=y
759# TPM devices 826# TPM devices
760# 827#
761# CONFIG_TCG_TPM is not set 828# CONFIG_TCG_TPM is not set
762# CONFIG_TELCLOCK is not set
763 829
764# 830#
765# I2C support 831# I2C support
@@ -782,16 +848,16 @@ CONFIG_HPET_MMAP=y
782# 848#
783CONFIG_HWMON=y 849CONFIG_HWMON=y
784# CONFIG_HWMON_VID is not set 850# CONFIG_HWMON_VID is not set
851# CONFIG_SENSORS_ABITUGURU is not set
785# CONFIG_SENSORS_F71805F is not set 852# CONFIG_SENSORS_F71805F is not set
853# CONFIG_SENSORS_PC87427 is not set
854# CONFIG_SENSORS_VT1211 is not set
786# CONFIG_HWMON_DEBUG_CHIP is not set 855# CONFIG_HWMON_DEBUG_CHIP is not set
787 856
788# 857#
789# Misc devices 858# Multifunction device drivers
790#
791
792#
793# Multimedia Capabilities Port drivers
794# 859#
860# CONFIG_MFD_SM501 is not set
795 861
796# 862#
797# Multimedia devices 863# Multimedia devices
@@ -802,16 +868,19 @@ CONFIG_HWMON=y
802# Digital Video Broadcasting Devices 868# Digital Video Broadcasting Devices
803# 869#
804# CONFIG_DVB is not set 870# CONFIG_DVB is not set
871# CONFIG_USB_DABUSB is not set
805 872
806# 873#
807# Graphics support 874# Graphics support
808# 875#
876# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
809# CONFIG_FB is not set 877# CONFIG_FB is not set
810 878
811# 879#
812# Console display driver support 880# Console display driver support
813# 881#
814CONFIG_VGA_CONSOLE=y 882CONFIG_VGA_CONSOLE=y
883# CONFIG_VGACON_SOFT_SCROLLBACK is not set
815CONFIG_DUMMY_CONSOLE=y 884CONFIG_DUMMY_CONSOLE=y
816 885
817# 886#
@@ -820,10 +889,17 @@ CONFIG_DUMMY_CONSOLE=y
820# CONFIG_SOUND is not set 889# CONFIG_SOUND is not set
821 890
822# 891#
892# HID Devices
893#
894CONFIG_HID=y
895# CONFIG_HID_DEBUG is not set
896
897#
823# USB support 898# USB support
824# 899#
825CONFIG_USB_ARCH_HAS_HCD=y 900CONFIG_USB_ARCH_HAS_HCD=y
826CONFIG_USB_ARCH_HAS_OHCI=y 901CONFIG_USB_ARCH_HAS_OHCI=y
902CONFIG_USB_ARCH_HAS_EHCI=y
827CONFIG_USB=y 903CONFIG_USB=y
828# CONFIG_USB_DEBUG is not set 904# CONFIG_USB_DEBUG is not set
829 905
@@ -831,7 +907,6 @@ CONFIG_USB=y
831# Miscellaneous USB options 907# Miscellaneous USB options
832# 908#
833CONFIG_USB_DEVICEFS=y 909CONFIG_USB_DEVICEFS=y
834# CONFIG_USB_BANDWIDTH is not set
835# CONFIG_USB_DYNAMIC_MINORS is not set 910# CONFIG_USB_DYNAMIC_MINORS is not set
836# CONFIG_USB_SUSPEND is not set 911# CONFIG_USB_SUSPEND is not set
837# CONFIG_USB_OTG is not set 912# CONFIG_USB_OTG is not set
@@ -842,9 +917,12 @@ CONFIG_USB_DEVICEFS=y
842CONFIG_USB_EHCI_HCD=m 917CONFIG_USB_EHCI_HCD=m
843# CONFIG_USB_EHCI_SPLIT_ISO is not set 918# CONFIG_USB_EHCI_SPLIT_ISO is not set
844# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 919# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
920# CONFIG_USB_EHCI_TT_NEWSCHED is not set
921# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
845# CONFIG_USB_ISP116X_HCD is not set 922# CONFIG_USB_ISP116X_HCD is not set
846CONFIG_USB_OHCI_HCD=m 923CONFIG_USB_OHCI_HCD=m
847# CONFIG_USB_OHCI_BIG_ENDIAN is not set 924# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
925# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
848CONFIG_USB_OHCI_LITTLE_ENDIAN=y 926CONFIG_USB_OHCI_LITTLE_ENDIAN=y
849CONFIG_USB_UHCI_HCD=y 927CONFIG_USB_UHCI_HCD=y
850# CONFIG_USB_SL811_HCD is not set 928# CONFIG_USB_SL811_HCD is not set
@@ -873,13 +951,13 @@ CONFIG_USB_STORAGE=m
873# CONFIG_USB_STORAGE_SDDR55 is not set 951# CONFIG_USB_STORAGE_SDDR55 is not set
874# CONFIG_USB_STORAGE_JUMPSHOT is not set 952# CONFIG_USB_STORAGE_JUMPSHOT is not set
875# CONFIG_USB_STORAGE_ALAUDA is not set 953# CONFIG_USB_STORAGE_ALAUDA is not set
954# CONFIG_USB_STORAGE_KARMA is not set
876# CONFIG_USB_LIBUSUAL is not set 955# CONFIG_USB_LIBUSUAL is not set
877 956
878# 957#
879# USB Input Devices 958# USB Input Devices
880# 959#
881CONFIG_USB_HID=y 960CONFIG_USB_HID=y
882CONFIG_USB_HIDINPUT=y
883# CONFIG_USB_HIDINPUT_POWERBOOK is not set 961# CONFIG_USB_HIDINPUT_POWERBOOK is not set
884# CONFIG_HID_FF is not set 962# CONFIG_HID_FF is not set
885# CONFIG_USB_HIDDEV is not set 963# CONFIG_USB_HIDDEV is not set
@@ -888,15 +966,14 @@ CONFIG_USB_HIDINPUT=y
888# CONFIG_USB_ACECAD is not set 966# CONFIG_USB_ACECAD is not set
889# CONFIG_USB_KBTAB is not set 967# CONFIG_USB_KBTAB is not set
890# CONFIG_USB_POWERMATE is not set 968# CONFIG_USB_POWERMATE is not set
891# CONFIG_USB_MTOUCH is not set 969# CONFIG_USB_TOUCHSCREEN is not set
892# CONFIG_USB_ITMTOUCH is not set
893# CONFIG_USB_EGALAX is not set
894# CONFIG_USB_YEALINK is not set 970# CONFIG_USB_YEALINK is not set
895# CONFIG_USB_XPAD is not set 971# CONFIG_USB_XPAD is not set
896# CONFIG_USB_ATI_REMOTE is not set 972# CONFIG_USB_ATI_REMOTE is not set
897# CONFIG_USB_ATI_REMOTE2 is not set 973# CONFIG_USB_ATI_REMOTE2 is not set
898# CONFIG_USB_KEYSPAN_REMOTE is not set 974# CONFIG_USB_KEYSPAN_REMOTE is not set
899# CONFIG_USB_APPLETOUCH is not set 975# CONFIG_USB_APPLETOUCH is not set
976# CONFIG_USB_GTCO is not set
900 977
901# 978#
902# USB Imaging devices 979# USB Imaging devices
@@ -905,21 +982,13 @@ CONFIG_USB_HIDINPUT=y
905# CONFIG_USB_MICROTEK is not set 982# CONFIG_USB_MICROTEK is not set
906 983
907# 984#
908# USB Multimedia devices
909#
910# CONFIG_USB_DABUSB is not set
911
912#
913# Video4Linux support is needed for USB Multimedia device support
914#
915
916#
917# USB Network Adapters 985# USB Network Adapters
918# 986#
919# CONFIG_USB_CATC is not set 987# CONFIG_USB_CATC is not set
920# CONFIG_USB_KAWETH is not set 988# CONFIG_USB_KAWETH is not set
921# CONFIG_USB_PEGASUS is not set 989# CONFIG_USB_PEGASUS is not set
922# CONFIG_USB_RTL8150 is not set 990# CONFIG_USB_RTL8150 is not set
991# CONFIG_USB_USBNET_MII is not set
923# CONFIG_USB_USBNET is not set 992# CONFIG_USB_USBNET is not set
924# CONFIG_USB_MON is not set 993# CONFIG_USB_MON is not set
925 994
@@ -937,17 +1006,23 @@ CONFIG_USB_HIDINPUT=y
937# 1006#
938# CONFIG_USB_EMI62 is not set 1007# CONFIG_USB_EMI62 is not set
939# CONFIG_USB_EMI26 is not set 1008# CONFIG_USB_EMI26 is not set
1009# CONFIG_USB_ADUTUX is not set
940# CONFIG_USB_AUERSWALD is not set 1010# CONFIG_USB_AUERSWALD is not set
941# CONFIG_USB_RIO500 is not set 1011# CONFIG_USB_RIO500 is not set
942# CONFIG_USB_LEGOTOWER is not set 1012# CONFIG_USB_LEGOTOWER is not set
943# CONFIG_USB_LCD is not set 1013# CONFIG_USB_LCD is not set
1014# CONFIG_USB_BERRY_CHARGE is not set
944# CONFIG_USB_LED is not set 1015# CONFIG_USB_LED is not set
1016# CONFIG_USB_CYPRESS_CY7C63 is not set
945# CONFIG_USB_CYTHERM is not set 1017# CONFIG_USB_CYTHERM is not set
946# CONFIG_USB_PHIDGETKIT is not set 1018# CONFIG_USB_PHIDGET is not set
947# CONFIG_USB_PHIDGETSERVO is not set
948# CONFIG_USB_IDMOUSE is not set 1019# CONFIG_USB_IDMOUSE is not set
1020# CONFIG_USB_FTDI_ELAN is not set
1021# CONFIG_USB_APPLEDISPLAY is not set
949# CONFIG_USB_SISUSBVGA is not set 1022# CONFIG_USB_SISUSBVGA is not set
950# CONFIG_USB_LD is not set 1023# CONFIG_USB_LD is not set
1024# CONFIG_USB_TRANCEVIBRATOR is not set
1025# CONFIG_USB_IOWARRIOR is not set
951# CONFIG_USB_TEST is not set 1026# CONFIG_USB_TEST is not set
952 1027
953# 1028#
@@ -965,15 +1040,55 @@ CONFIG_USB_HIDINPUT=y
965# CONFIG_MMC is not set 1040# CONFIG_MMC is not set
966 1041
967# 1042#
1043# LED devices
1044#
1045# CONFIG_NEW_LEDS is not set
1046
1047#
1048# LED drivers
1049#
1050
1051#
1052# LED Triggers
1053#
1054
1055#
968# InfiniBand support 1056# InfiniBand support
969# 1057#
970# CONFIG_INFINIBAND is not set 1058# CONFIG_INFINIBAND is not set
971 1059
972# 1060#
973# EDAC - error detection and reporting (RAS) 1061# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1062#
1063
1064#
1065# Real Time Clock
1066#
1067# CONFIG_RTC_CLASS is not set
1068
1069#
1070# DMA Engine support
1071#
1072# CONFIG_DMA_ENGINE is not set
1073
1074#
1075# DMA Clients
974# 1076#
975 1077
976# 1078#
1079# DMA Devices
1080#
1081
1082#
1083# Auxiliary Display support
1084#
1085
1086#
1087# Virtualization
1088#
1089# CONFIG_MSPEC is not set
1090
1091#
977# File systems 1092# File systems
978# 1093#
979CONFIG_EXT2_FS=y 1094CONFIG_EXT2_FS=y
@@ -985,6 +1100,7 @@ CONFIG_EXT3_FS=y
985CONFIG_EXT3_FS_XATTR=y 1100CONFIG_EXT3_FS_XATTR=y
986CONFIG_EXT3_FS_POSIX_ACL=y 1101CONFIG_EXT3_FS_POSIX_ACL=y
987CONFIG_EXT3_FS_SECURITY=y 1102CONFIG_EXT3_FS_SECURITY=y
1103# CONFIG_EXT4DEV_FS is not set
988CONFIG_JBD=y 1104CONFIG_JBD=y
989# CONFIG_JBD_DEBUG is not set 1105# CONFIG_JBD_DEBUG is not set
990CONFIG_FS_MBCACHE=y 1106CONFIG_FS_MBCACHE=y
@@ -997,15 +1113,16 @@ CONFIG_REISERFS_FS_SECURITY=y
997# CONFIG_JFS_FS is not set 1113# CONFIG_JFS_FS is not set
998CONFIG_FS_POSIX_ACL=y 1114CONFIG_FS_POSIX_ACL=y
999CONFIG_XFS_FS=y 1115CONFIG_XFS_FS=y
1000CONFIG_XFS_EXPORT=y
1001# CONFIG_XFS_QUOTA is not set 1116# CONFIG_XFS_QUOTA is not set
1002# CONFIG_XFS_SECURITY is not set 1117# CONFIG_XFS_SECURITY is not set
1003# CONFIG_XFS_POSIX_ACL is not set 1118# CONFIG_XFS_POSIX_ACL is not set
1004# CONFIG_XFS_RT is not set 1119# CONFIG_XFS_RT is not set
1120# CONFIG_GFS2_FS is not set
1005# CONFIG_OCFS2_FS is not set 1121# CONFIG_OCFS2_FS is not set
1006# CONFIG_MINIX_FS is not set 1122# CONFIG_MINIX_FS is not set
1007# CONFIG_ROMFS_FS is not set 1123# CONFIG_ROMFS_FS is not set
1008CONFIG_INOTIFY=y 1124CONFIG_INOTIFY=y
1125CONFIG_INOTIFY_USER=y
1009# CONFIG_QUOTA is not set 1126# CONFIG_QUOTA is not set
1010CONFIG_DNOTIFY=y 1127CONFIG_DNOTIFY=y
1011CONFIG_AUTOFS_FS=y 1128CONFIG_AUTOFS_FS=y
@@ -1038,12 +1155,13 @@ CONFIG_NTFS_FS=m
1038# 1155#
1039CONFIG_PROC_FS=y 1156CONFIG_PROC_FS=y
1040CONFIG_PROC_KCORE=y 1157CONFIG_PROC_KCORE=y
1158CONFIG_PROC_SYSCTL=y
1041CONFIG_SYSFS=y 1159CONFIG_SYSFS=y
1042CONFIG_TMPFS=y 1160CONFIG_TMPFS=y
1161# CONFIG_TMPFS_POSIX_ACL is not set
1043CONFIG_HUGETLBFS=y 1162CONFIG_HUGETLBFS=y
1044CONFIG_HUGETLB_PAGE=y 1163CONFIG_HUGETLB_PAGE=y
1045CONFIG_RAMFS=y 1164CONFIG_RAMFS=y
1046# CONFIG_RELAYFS_FS is not set
1047# CONFIG_CONFIGFS_FS is not set 1165# CONFIG_CONFIGFS_FS is not set
1048 1166
1049# 1167#
@@ -1078,7 +1196,7 @@ CONFIG_NFSD_V4=y
1078CONFIG_NFSD_TCP=y 1196CONFIG_NFSD_TCP=y
1079CONFIG_LOCKD=m 1197CONFIG_LOCKD=m
1080CONFIG_LOCKD_V4=y 1198CONFIG_LOCKD_V4=y
1081CONFIG_EXPORTFS=y 1199CONFIG_EXPORTFS=m
1082CONFIG_NFS_COMMON=y 1200CONFIG_NFS_COMMON=y
1083CONFIG_SUNRPC=m 1201CONFIG_SUNRPC=m
1084CONFIG_SUNRPC_GSS=m 1202CONFIG_SUNRPC_GSS=m
@@ -1089,7 +1207,9 @@ CONFIG_SMB_NLS_DEFAULT=y
1089CONFIG_SMB_NLS_REMOTE="cp437" 1207CONFIG_SMB_NLS_REMOTE="cp437"
1090CONFIG_CIFS=m 1208CONFIG_CIFS=m
1091# CONFIG_CIFS_STATS is not set 1209# CONFIG_CIFS_STATS is not set
1210# CONFIG_CIFS_WEAK_PW_HASH is not set
1092# CONFIG_CIFS_XATTR is not set 1211# CONFIG_CIFS_XATTR is not set
1212# CONFIG_CIFS_DEBUG2 is not set
1093# CONFIG_CIFS_EXPERIMENTAL is not set 1213# CONFIG_CIFS_EXPERIMENTAL is not set
1094# CONFIG_NCP_FS is not set 1214# CONFIG_NCP_FS is not set
1095# CONFIG_CODA_FS is not set 1215# CONFIG_CODA_FS is not set
@@ -1162,15 +1282,25 @@ CONFIG_NLS_KOI8_U=m
1162CONFIG_NLS_UTF8=m 1282CONFIG_NLS_UTF8=m
1163 1283
1164# 1284#
1285# Distributed Lock Manager
1286#
1287# CONFIG_DLM is not set
1288
1289#
1165# Library routines 1290# Library routines
1166# 1291#
1292CONFIG_BITREVERSE=y
1167# CONFIG_CRC_CCITT is not set 1293# CONFIG_CRC_CCITT is not set
1168# CONFIG_CRC16 is not set 1294# CONFIG_CRC16 is not set
1169CONFIG_CRC32=y 1295CONFIG_CRC32=y
1170# CONFIG_LIBCRC32C is not set 1296# CONFIG_LIBCRC32C is not set
1297CONFIG_PLIST=y
1298CONFIG_HAS_IOMEM=y
1299CONFIG_HAS_IOPORT=y
1171CONFIG_GENERIC_HARDIRQS=y 1300CONFIG_GENERIC_HARDIRQS=y
1172CONFIG_GENERIC_IRQ_PROBE=y 1301CONFIG_GENERIC_IRQ_PROBE=y
1173CONFIG_GENERIC_PENDING_IRQ=y 1302CONFIG_GENERIC_PENDING_IRQ=y
1303CONFIG_IRQ_PER_CPU=y
1174 1304
1175# 1305#
1176# Instrumentation Support 1306# Instrumentation Support
@@ -1182,21 +1312,31 @@ CONFIG_GENERIC_PENDING_IRQ=y
1182# Kernel hacking 1312# Kernel hacking
1183# 1313#
1184# CONFIG_PRINTK_TIME is not set 1314# CONFIG_PRINTK_TIME is not set
1315CONFIG_ENABLE_MUST_CHECK=y
1185CONFIG_MAGIC_SYSRQ=y 1316CONFIG_MAGIC_SYSRQ=y
1317# CONFIG_UNUSED_SYMBOLS is not set
1318# CONFIG_DEBUG_FS is not set
1319# CONFIG_HEADERS_CHECK is not set
1186CONFIG_DEBUG_KERNEL=y 1320CONFIG_DEBUG_KERNEL=y
1321# CONFIG_DEBUG_SHIRQ is not set
1187CONFIG_LOG_BUF_SHIFT=20 1322CONFIG_LOG_BUF_SHIFT=20
1188CONFIG_DETECT_SOFTLOCKUP=y 1323CONFIG_DETECT_SOFTLOCKUP=y
1189# CONFIG_SCHEDSTATS is not set 1324# CONFIG_SCHEDSTATS is not set
1325# CONFIG_TIMER_STATS is not set
1190# CONFIG_DEBUG_SLAB is not set 1326# CONFIG_DEBUG_SLAB is not set
1191CONFIG_DEBUG_MUTEXES=y 1327# CONFIG_DEBUG_RT_MUTEXES is not set
1328# CONFIG_RT_MUTEX_TESTER is not set
1192# CONFIG_DEBUG_SPINLOCK is not set 1329# CONFIG_DEBUG_SPINLOCK is not set
1330CONFIG_DEBUG_MUTEXES=y
1193# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1331# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1332# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1194# CONFIG_DEBUG_KOBJECT is not set 1333# CONFIG_DEBUG_KOBJECT is not set
1195# CONFIG_DEBUG_INFO is not set 1334# CONFIG_DEBUG_INFO is not set
1196# CONFIG_DEBUG_FS is not set
1197# CONFIG_DEBUG_VM is not set 1335# CONFIG_DEBUG_VM is not set
1336# CONFIG_DEBUG_LIST is not set
1198CONFIG_FORCED_INLINING=y 1337CONFIG_FORCED_INLINING=y
1199# CONFIG_RCU_TORTURE_TEST is not set 1338# CONFIG_RCU_TORTURE_TEST is not set
1339# CONFIG_FAULT_INJECTION is not set
1200CONFIG_IA64_GRANULE_16MB=y 1340CONFIG_IA64_GRANULE_16MB=y
1201# CONFIG_IA64_GRANULE_64MB is not set 1341# CONFIG_IA64_GRANULE_64MB is not set
1202# CONFIG_IA64_PRINT_HAZARDS is not set 1342# CONFIG_IA64_PRINT_HAZARDS is not set
@@ -1215,7 +1355,11 @@ CONFIG_SYSVIPC_COMPAT=y
1215# Cryptographic options 1355# Cryptographic options
1216# 1356#
1217CONFIG_CRYPTO=y 1357CONFIG_CRYPTO=y
1358CONFIG_CRYPTO_ALGAPI=y
1359CONFIG_CRYPTO_BLKCIPHER=m
1360CONFIG_CRYPTO_MANAGER=m
1218# CONFIG_CRYPTO_HMAC is not set 1361# CONFIG_CRYPTO_HMAC is not set
1362# CONFIG_CRYPTO_XCBC is not set
1219# CONFIG_CRYPTO_NULL is not set 1363# CONFIG_CRYPTO_NULL is not set
1220# CONFIG_CRYPTO_MD4 is not set 1364# CONFIG_CRYPTO_MD4 is not set
1221CONFIG_CRYPTO_MD5=y 1365CONFIG_CRYPTO_MD5=y
@@ -1224,7 +1368,13 @@ CONFIG_CRYPTO_MD5=y
1224# CONFIG_CRYPTO_SHA512 is not set 1368# CONFIG_CRYPTO_SHA512 is not set
1225# CONFIG_CRYPTO_WP512 is not set 1369# CONFIG_CRYPTO_WP512 is not set
1226# CONFIG_CRYPTO_TGR192 is not set 1370# CONFIG_CRYPTO_TGR192 is not set
1371# CONFIG_CRYPTO_GF128MUL is not set
1372CONFIG_CRYPTO_ECB=m
1373CONFIG_CRYPTO_CBC=m
1374CONFIG_CRYPTO_PCBC=m
1375# CONFIG_CRYPTO_LRW is not set
1227CONFIG_CRYPTO_DES=m 1376CONFIG_CRYPTO_DES=m
1377# CONFIG_CRYPTO_FCRYPT is not set
1228# CONFIG_CRYPTO_BLOWFISH is not set 1378# CONFIG_CRYPTO_BLOWFISH is not set
1229# CONFIG_CRYPTO_TWOFISH is not set 1379# CONFIG_CRYPTO_TWOFISH is not set
1230# CONFIG_CRYPTO_SERPENT is not set 1380# CONFIG_CRYPTO_SERPENT is not set
@@ -1238,6 +1388,7 @@ CONFIG_CRYPTO_DES=m
1238# CONFIG_CRYPTO_DEFLATE is not set 1388# CONFIG_CRYPTO_DEFLATE is not set
1239# CONFIG_CRYPTO_MICHAEL_MIC is not set 1389# CONFIG_CRYPTO_MICHAEL_MIC is not set
1240# CONFIG_CRYPTO_CRC32C is not set 1390# CONFIG_CRYPTO_CRC32C is not set
1391# CONFIG_CRYPTO_CAMELLIA is not set
1241# CONFIG_CRYPTO_TEST is not set 1392# CONFIG_CRYPTO_TEST is not set
1242 1393
1243# 1394#
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig
index 949dc4670a0c..1c7955c16358 100644
--- a/arch/ia64/configs/zx1_defconfig
+++ b/arch/ia64/configs/zx1_defconfig
@@ -1,8 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc5 3# Linux kernel version: 2.6.21-rc3
4# Mon Feb 27 15:55:36 2006 4# Thu Mar 8 11:04:20 2007
5# 5#
6CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
6 7
7# 8#
8# Code maturity level options 9# Code maturity level options
@@ -18,16 +19,24 @@ CONFIG_LOCALVERSION=""
18CONFIG_LOCALVERSION_AUTO=y 19CONFIG_LOCALVERSION_AUTO=y
19CONFIG_SWAP=y 20CONFIG_SWAP=y
20CONFIG_SYSVIPC=y 21CONFIG_SYSVIPC=y
22# CONFIG_IPC_NS is not set
23CONFIG_SYSVIPC_SYSCTL=y
21# CONFIG_POSIX_MQUEUE is not set 24# CONFIG_POSIX_MQUEUE is not set
22CONFIG_BSD_PROCESS_ACCT=y 25CONFIG_BSD_PROCESS_ACCT=y
23# CONFIG_BSD_PROCESS_ACCT_V3 is not set 26# CONFIG_BSD_PROCESS_ACCT_V3 is not set
24CONFIG_SYSCTL=y 27# CONFIG_TASKSTATS is not set
28# CONFIG_UTS_NS is not set
25# CONFIG_AUDIT is not set 29# CONFIG_AUDIT is not set
26# CONFIG_IKCONFIG is not set 30# CONFIG_IKCONFIG is not set
27# CONFIG_CPUSETS is not set 31# CONFIG_CPUSETS is not set
32CONFIG_SYSFS_DEPRECATED=y
33# CONFIG_RELAY is not set
34CONFIG_BLK_DEV_INITRD=y
28CONFIG_INITRAMFS_SOURCE="" 35CONFIG_INITRAMFS_SOURCE=""
29CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
37CONFIG_SYSCTL=y
30# CONFIG_EMBEDDED is not set 38# CONFIG_EMBEDDED is not set
39CONFIG_SYSCTL_SYSCALL=y
31CONFIG_KALLSYMS=y 40CONFIG_KALLSYMS=y
32# CONFIG_KALLSYMS_ALL is not set 41# CONFIG_KALLSYMS_ALL is not set
33# CONFIG_KALLSYMS_EXTRA_PASS is not set 42# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -39,11 +48,9 @@ CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 48CONFIG_FUTEX=y
40CONFIG_EPOLL=y 49CONFIG_EPOLL=y
41CONFIG_SHMEM=y 50CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46CONFIG_SLAB=y 51CONFIG_SLAB=y
52CONFIG_VM_EVENT_COUNTERS=y
53CONFIG_RT_MUTEXES=y
47# CONFIG_TINY_SHMEM is not set 54# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0 55CONFIG_BASE_SMALL=0
49# CONFIG_SLOB is not set 56# CONFIG_SLOB is not set
@@ -53,14 +60,16 @@ CONFIG_BASE_SMALL=0
53# 60#
54CONFIG_MODULES=y 61CONFIG_MODULES=y
55# CONFIG_MODULE_UNLOAD is not set 62# CONFIG_MODULE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set 63# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set 64# CONFIG_MODULE_SRCVERSION_ALL is not set
59# CONFIG_KMOD is not set 65# CONFIG_KMOD is not set
66CONFIG_STOP_MACHINE=y
60 67
61# 68#
62# Block layer 69# Block layer
63# 70#
71CONFIG_BLOCK=y
72# CONFIG_BLK_DEV_IO_TRACE is not set
64 73
65# 74#
66# IO Schedulers 75# IO Schedulers
@@ -80,15 +89,19 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
80# 89#
81CONFIG_IA64=y 90CONFIG_IA64=y
82CONFIG_64BIT=y 91CONFIG_64BIT=y
92CONFIG_ZONE_DMA=y
83CONFIG_MMU=y 93CONFIG_MMU=y
84CONFIG_SWIOTLB=y
85CONFIG_RWSEM_XCHGADD_ALGORITHM=y 94CONFIG_RWSEM_XCHGADD_ALGORITHM=y
95# CONFIG_ARCH_HAS_ILOG2_U32 is not set
96# CONFIG_ARCH_HAS_ILOG2_U64 is not set
97CONFIG_GENERIC_FIND_NEXT_BIT=y
86CONFIG_GENERIC_CALIBRATE_DELAY=y 98CONFIG_GENERIC_CALIBRATE_DELAY=y
87CONFIG_TIME_INTERPOLATION=y 99CONFIG_TIME_INTERPOLATION=y
100CONFIG_DMI=y
88CONFIG_EFI=y 101CONFIG_EFI=y
89CONFIG_GENERIC_IOMAP=y 102CONFIG_GENERIC_IOMAP=y
90CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 103CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
91CONFIG_DMA_IS_DMA32=y 104CONFIG_AUDIT_ARCH=y
92# CONFIG_IA64_GENERIC is not set 105# CONFIG_IA64_GENERIC is not set
93# CONFIG_IA64_DIG is not set 106# CONFIG_IA64_DIG is not set
94CONFIG_IA64_HP_ZX1=y 107CONFIG_IA64_HP_ZX1=y
@@ -105,6 +118,7 @@ CONFIG_PGTABLE_3=y
105# CONFIG_PGTABLE_4 is not set 118# CONFIG_PGTABLE_4 is not set
106# CONFIG_HZ_100 is not set 119# CONFIG_HZ_100 is not set
107CONFIG_HZ_250=y 120CONFIG_HZ_250=y
121# CONFIG_HZ_300 is not set
108# CONFIG_HZ_1000 is not set 122# CONFIG_HZ_1000 is not set
109CONFIG_HZ=250 123CONFIG_HZ=250
110CONFIG_IA64_L1_CACHE_SHIFT=7 124CONFIG_IA64_L1_CACHE_SHIFT=7
@@ -113,8 +127,10 @@ CONFIG_IOSAPIC=y
113CONFIG_FORCE_MAX_ZONEORDER=17 127CONFIG_FORCE_MAX_ZONEORDER=17
114CONFIG_SMP=y 128CONFIG_SMP=y
115CONFIG_NR_CPUS=16 129CONFIG_NR_CPUS=16
116# CONFIG_HOTPLUG_CPU is not set 130CONFIG_HOTPLUG_CPU=y
131CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
117# CONFIG_SCHED_SMT is not set 132# CONFIG_SCHED_SMT is not set
133# CONFIG_PERMIT_BSP_REMOVE is not set
118# CONFIG_PREEMPT is not set 134# CONFIG_PREEMPT is not set
119CONFIG_SELECT_MEMORY_MODEL=y 135CONFIG_SELECT_MEMORY_MODEL=y
120CONFIG_FLATMEM_MANUAL=y 136CONFIG_FLATMEM_MANUAL=y
@@ -124,11 +140,14 @@ CONFIG_FLATMEM=y
124CONFIG_FLAT_NODE_MEM_MAP=y 140CONFIG_FLAT_NODE_MEM_MAP=y
125# CONFIG_SPARSEMEM_STATIC is not set 141# CONFIG_SPARSEMEM_STATIC is not set
126CONFIG_SPLIT_PTLOCK_CPUS=4 142CONFIG_SPLIT_PTLOCK_CPUS=4
143CONFIG_RESOURCES_64BIT=y
144CONFIG_ZONE_DMA_FLAG=1
127CONFIG_ARCH_SELECT_MEMORY_MODEL=y 145CONFIG_ARCH_SELECT_MEMORY_MODEL=y
128CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 146CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
129CONFIG_ARCH_FLATMEM_ENABLE=y 147CONFIG_ARCH_FLATMEM_ENABLE=y
130CONFIG_ARCH_SPARSEMEM_ENABLE=y 148CONFIG_ARCH_SPARSEMEM_ENABLE=y
131CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y 149CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
150CONFIG_ARCH_POPULATES_NODE_MAP=y
132CONFIG_VIRTUAL_MEM_MAP=y 151CONFIG_VIRTUAL_MEM_MAP=y
133CONFIG_HOLES_IN_ZONE=y 152CONFIG_HOLES_IN_ZONE=y
134CONFIG_IA32_SUPPORT=y 153CONFIG_IA32_SUPPORT=y
@@ -136,6 +155,9 @@ CONFIG_COMPAT=y
136CONFIG_IA64_MCA_RECOVERY=y 155CONFIG_IA64_MCA_RECOVERY=y
137CONFIG_PERFMON=y 156CONFIG_PERFMON=y
138CONFIG_IA64_PALINFO=y 157CONFIG_IA64_PALINFO=y
158# CONFIG_IA64_ESI is not set
159# CONFIG_KEXEC is not set
160CONFIG_CRASH_DUMP=y
139 161
140# 162#
141# Firmware Drivers 163# Firmware Drivers
@@ -151,21 +173,25 @@ CONFIG_BINFMT_MISC=y
151CONFIG_PM=y 173CONFIG_PM=y
152CONFIG_PM_LEGACY=y 174CONFIG_PM_LEGACY=y
153# CONFIG_PM_DEBUG is not set 175# CONFIG_PM_DEBUG is not set
176# CONFIG_PM_SYSFS_DEPRECATED is not set
154 177
155# 178#
156# ACPI (Advanced Configuration and Power Interface) Support 179# ACPI (Advanced Configuration and Power Interface) Support
157# 180#
158CONFIG_ACPI=y 181CONFIG_ACPI=y
182CONFIG_ACPI_PROCFS=y
159CONFIG_ACPI_BUTTON=y 183CONFIG_ACPI_BUTTON=y
160CONFIG_ACPI_FAN=y 184CONFIG_ACPI_FAN=y
185# CONFIG_ACPI_DOCK is not set
161CONFIG_ACPI_PROCESSOR=y 186CONFIG_ACPI_PROCESSOR=y
187CONFIG_ACPI_HOTPLUG_CPU=y
162CONFIG_ACPI_THERMAL=y 188CONFIG_ACPI_THERMAL=y
163CONFIG_ACPI_BLACKLIST_YEAR=0 189CONFIG_ACPI_BLACKLIST_YEAR=0
164# CONFIG_ACPI_DEBUG is not set 190# CONFIG_ACPI_DEBUG is not set
165CONFIG_ACPI_EC=y 191CONFIG_ACPI_EC=y
166CONFIG_ACPI_POWER=y 192CONFIG_ACPI_POWER=y
167CONFIG_ACPI_SYSTEM=y 193CONFIG_ACPI_SYSTEM=y
168# CONFIG_ACPI_CONTAINER is not set 194CONFIG_ACPI_CONTAINER=y
169 195
170# 196#
171# CPU Frequency scaling 197# CPU Frequency scaling
@@ -177,8 +203,8 @@ CONFIG_ACPI_SYSTEM=y
177# 203#
178CONFIG_PCI=y 204CONFIG_PCI=y
179CONFIG_PCI_DOMAINS=y 205CONFIG_PCI_DOMAINS=y
206# CONFIG_PCIEPORTBUS is not set
180# CONFIG_PCI_MSI is not set 207# CONFIG_PCI_MSI is not set
181CONFIG_PCI_LEGACY_PROC=y
182# CONFIG_PCI_DEBUG is not set 208# CONFIG_PCI_DEBUG is not set
183 209
184# 210#
@@ -208,6 +234,10 @@ CONFIG_NET=y
208CONFIG_PACKET=y 234CONFIG_PACKET=y
209# CONFIG_PACKET_MMAP is not set 235# CONFIG_PACKET_MMAP is not set
210CONFIG_UNIX=y 236CONFIG_UNIX=y
237CONFIG_XFRM=y
238# CONFIG_XFRM_USER is not set
239# CONFIG_XFRM_SUB_POLICY is not set
240# CONFIG_XFRM_MIGRATE is not set
211# CONFIG_NET_KEY is not set 241# CONFIG_NET_KEY is not set
212CONFIG_INET=y 242CONFIG_INET=y
213CONFIG_IP_MULTICAST=y 243CONFIG_IP_MULTICAST=y
@@ -222,17 +252,26 @@ CONFIG_IP_FIB_HASH=y
222# CONFIG_INET_AH is not set 252# CONFIG_INET_AH is not set
223# CONFIG_INET_ESP is not set 253# CONFIG_INET_ESP is not set
224# CONFIG_INET_IPCOMP is not set 254# CONFIG_INET_IPCOMP is not set
255# CONFIG_INET_XFRM_TUNNEL is not set
225# CONFIG_INET_TUNNEL is not set 256# CONFIG_INET_TUNNEL is not set
257CONFIG_INET_XFRM_MODE_TRANSPORT=y
258CONFIG_INET_XFRM_MODE_TUNNEL=y
259CONFIG_INET_XFRM_MODE_BEET=y
226CONFIG_INET_DIAG=y 260CONFIG_INET_DIAG=y
227CONFIG_INET_TCP_DIAG=y 261CONFIG_INET_TCP_DIAG=y
228# CONFIG_TCP_CONG_ADVANCED is not set 262# CONFIG_TCP_CONG_ADVANCED is not set
229CONFIG_TCP_CONG_BIC=y 263CONFIG_TCP_CONG_CUBIC=y
264CONFIG_DEFAULT_TCP_CONG="cubic"
265# CONFIG_TCP_MD5SIG is not set
230 266
231# 267#
232# IP: Virtual Server Configuration 268# IP: Virtual Server Configuration
233# 269#
234# CONFIG_IP_VS is not set 270# CONFIG_IP_VS is not set
235# CONFIG_IPV6 is not set 271# CONFIG_IPV6 is not set
272# CONFIG_INET6_XFRM_TUNNEL is not set
273# CONFIG_INET6_TUNNEL is not set
274# CONFIG_NETWORK_SECMARK is not set
236CONFIG_NETFILTER=y 275CONFIG_NETFILTER=y
237# CONFIG_NETFILTER_DEBUG is not set 276# CONFIG_NETFILTER_DEBUG is not set
238 277
@@ -240,14 +279,15 @@ CONFIG_NETFILTER=y
240# Core Netfilter Configuration 279# Core Netfilter Configuration
241# 280#
242# CONFIG_NETFILTER_NETLINK is not set 281# CONFIG_NETFILTER_NETLINK is not set
243# CONFIG_NF_CONNTRACK is not set 282# CONFIG_NF_CONNTRACK_ENABLED is not set
244# CONFIG_NETFILTER_XTABLES is not set 283# CONFIG_NETFILTER_XTABLES is not set
245 284
246# 285#
247# IP: Netfilter Configuration 286# IP: Netfilter Configuration
248# 287#
249# CONFIG_IP_NF_CONNTRACK is not set
250# CONFIG_IP_NF_QUEUE is not set 288# CONFIG_IP_NF_QUEUE is not set
289# CONFIG_IP_NF_IPTABLES is not set
290# CONFIG_IP_NF_ARPTABLES is not set
251 291
252# 292#
253# DCCP Configuration (EXPERIMENTAL) 293# DCCP Configuration (EXPERIMENTAL)
@@ -272,7 +312,6 @@ CONFIG_NETFILTER=y
272# CONFIG_ATALK is not set 312# CONFIG_ATALK is not set
273# CONFIG_X25 is not set 313# CONFIG_X25 is not set
274# CONFIG_LAPB is not set 314# CONFIG_LAPB is not set
275# CONFIG_NET_DIVERT is not set
276# CONFIG_ECONET is not set 315# CONFIG_ECONET is not set
277# CONFIG_WAN_ROUTER is not set 316# CONFIG_WAN_ROUTER is not set
278 317
@@ -285,6 +324,7 @@ CONFIG_NETFILTER=y
285# Network testing 324# Network testing
286# 325#
287# CONFIG_NET_PKTGEN is not set 326# CONFIG_NET_PKTGEN is not set
327# CONFIG_NET_TCPPROBE is not set
288# CONFIG_HAMRADIO is not set 328# CONFIG_HAMRADIO is not set
289# CONFIG_IRDA is not set 329# CONFIG_IRDA is not set
290# CONFIG_BT is not set 330# CONFIG_BT is not set
@@ -301,6 +341,8 @@ CONFIG_STANDALONE=y
301CONFIG_PREVENT_FIRMWARE_BUILD=y 341CONFIG_PREVENT_FIRMWARE_BUILD=y
302# CONFIG_FW_LOADER is not set 342# CONFIG_FW_LOADER is not set
303# CONFIG_DEBUG_DRIVER is not set 343# CONFIG_DEBUG_DRIVER is not set
344# CONFIG_DEBUG_DEVRES is not set
345# CONFIG_SYS_HYPERVISOR is not set
304 346
305# 347#
306# Connector - unified userspace <-> kernelspace linker 348# Connector - unified userspace <-> kernelspace linker
@@ -344,11 +386,17 @@ CONFIG_BLK_DEV_LOOP=y
344CONFIG_BLK_DEV_RAM=y 386CONFIG_BLK_DEV_RAM=y
345CONFIG_BLK_DEV_RAM_COUNT=16 387CONFIG_BLK_DEV_RAM_COUNT=16
346CONFIG_BLK_DEV_RAM_SIZE=4096 388CONFIG_BLK_DEV_RAM_SIZE=4096
347CONFIG_BLK_DEV_INITRD=y 389CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
348# CONFIG_CDROM_PKTCDVD is not set 390# CONFIG_CDROM_PKTCDVD is not set
349# CONFIG_ATA_OVER_ETH is not set 391# CONFIG_ATA_OVER_ETH is not set
350 392
351# 393#
394# Misc devices
395#
396# CONFIG_SGI_IOC4 is not set
397# CONFIG_TIFM_CORE is not set
398
399#
352# ATA/ATAPI/MFM/RLL support 400# ATA/ATAPI/MFM/RLL support
353# 401#
354CONFIG_IDE=y 402CONFIG_IDE=y
@@ -365,6 +413,7 @@ CONFIG_BLK_DEV_IDECD=y
365# CONFIG_BLK_DEV_IDETAPE is not set 413# CONFIG_BLK_DEV_IDETAPE is not set
366# CONFIG_BLK_DEV_IDEFLOPPY is not set 414# CONFIG_BLK_DEV_IDEFLOPPY is not set
367# CONFIG_BLK_DEV_IDESCSI is not set 415# CONFIG_BLK_DEV_IDESCSI is not set
416# CONFIG_BLK_DEV_IDEACPI is not set
368# CONFIG_IDE_TASK_IOCTL is not set 417# CONFIG_IDE_TASK_IOCTL is not set
369 418
370# 419#
@@ -390,8 +439,10 @@ CONFIG_BLK_DEV_CMD64X=y
390# CONFIG_BLK_DEV_CS5530 is not set 439# CONFIG_BLK_DEV_CS5530 is not set
391# CONFIG_BLK_DEV_HPT34X is not set 440# CONFIG_BLK_DEV_HPT34X is not set
392# CONFIG_BLK_DEV_HPT366 is not set 441# CONFIG_BLK_DEV_HPT366 is not set
442# CONFIG_BLK_DEV_JMICRON is not set
393# CONFIG_BLK_DEV_SC1200 is not set 443# CONFIG_BLK_DEV_SC1200 is not set
394# CONFIG_BLK_DEV_PIIX is not set 444# CONFIG_BLK_DEV_PIIX is not set
445# CONFIG_BLK_DEV_IT8213 is not set
395# CONFIG_BLK_DEV_IT821X is not set 446# CONFIG_BLK_DEV_IT821X is not set
396# CONFIG_BLK_DEV_NS87415 is not set 447# CONFIG_BLK_DEV_NS87415 is not set
397# CONFIG_BLK_DEV_PDC202XX_OLD is not set 448# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -401,6 +452,7 @@ CONFIG_BLK_DEV_CMD64X=y
401# CONFIG_BLK_DEV_SLC90E66 is not set 452# CONFIG_BLK_DEV_SLC90E66 is not set
402# CONFIG_BLK_DEV_TRM290 is not set 453# CONFIG_BLK_DEV_TRM290 is not set
403# CONFIG_BLK_DEV_VIA82CXXX is not set 454# CONFIG_BLK_DEV_VIA82CXXX is not set
455# CONFIG_BLK_DEV_TC86C001 is not set
404# CONFIG_IDE_ARM is not set 456# CONFIG_IDE_ARM is not set
405CONFIG_BLK_DEV_IDEDMA=y 457CONFIG_BLK_DEV_IDEDMA=y
406# CONFIG_IDEDMA_IVB is not set 458# CONFIG_IDEDMA_IVB is not set
@@ -412,6 +464,8 @@ CONFIG_BLK_DEV_IDEDMA=y
412# 464#
413# CONFIG_RAID_ATTRS is not set 465# CONFIG_RAID_ATTRS is not set
414CONFIG_SCSI=y 466CONFIG_SCSI=y
467# CONFIG_SCSI_TGT is not set
468CONFIG_SCSI_NETLINK=y
415CONFIG_SCSI_PROC_FS=y 469CONFIG_SCSI_PROC_FS=y
416 470
417# 471#
@@ -431,14 +485,16 @@ CONFIG_CHR_DEV_SG=y
431CONFIG_SCSI_MULTI_LUN=y 485CONFIG_SCSI_MULTI_LUN=y
432CONFIG_SCSI_CONSTANTS=y 486CONFIG_SCSI_CONSTANTS=y
433CONFIG_SCSI_LOGGING=y 487CONFIG_SCSI_LOGGING=y
488# CONFIG_SCSI_SCAN_ASYNC is not set
434 489
435# 490#
436# SCSI Transport Attributes 491# SCSI Transports
437# 492#
438CONFIG_SCSI_SPI_ATTRS=y 493CONFIG_SCSI_SPI_ATTRS=y
439CONFIG_SCSI_FC_ATTRS=y 494CONFIG_SCSI_FC_ATTRS=y
440# CONFIG_SCSI_ISCSI_ATTRS is not set 495# CONFIG_SCSI_ISCSI_ATTRS is not set
441# CONFIG_SCSI_SAS_ATTRS is not set 496# CONFIG_SCSI_SAS_ATTRS is not set
497# CONFIG_SCSI_SAS_LIBSAS is not set
442 498
443# 499#
444# SCSI low-level drivers 500# SCSI low-level drivers
@@ -451,28 +507,36 @@ CONFIG_SCSI_FC_ATTRS=y
451# CONFIG_SCSI_AIC7XXX is not set 507# CONFIG_SCSI_AIC7XXX is not set
452# CONFIG_SCSI_AIC7XXX_OLD is not set 508# CONFIG_SCSI_AIC7XXX_OLD is not set
453# CONFIG_SCSI_AIC79XX is not set 509# CONFIG_SCSI_AIC79XX is not set
510# CONFIG_SCSI_AIC94XX is not set
511# CONFIG_SCSI_ARCMSR is not set
454# CONFIG_MEGARAID_NEWGEN is not set 512# CONFIG_MEGARAID_NEWGEN is not set
455# CONFIG_MEGARAID_LEGACY is not set 513# CONFIG_MEGARAID_LEGACY is not set
456# CONFIG_MEGARAID_SAS is not set 514# CONFIG_MEGARAID_SAS is not set
457# CONFIG_SCSI_SATA is not set 515# CONFIG_SCSI_HPTIOP is not set
458# CONFIG_SCSI_DMX3191D is not set 516# CONFIG_SCSI_DMX3191D is not set
459# CONFIG_SCSI_FUTURE_DOMAIN is not set 517# CONFIG_SCSI_FUTURE_DOMAIN is not set
460# CONFIG_SCSI_IPS is not set 518# CONFIG_SCSI_IPS is not set
461# CONFIG_SCSI_INITIO is not set 519# CONFIG_SCSI_INITIO is not set
462# CONFIG_SCSI_INIA100 is not set 520# CONFIG_SCSI_INIA100 is not set
521# CONFIG_SCSI_STEX is not set
463CONFIG_SCSI_SYM53C8XX_2=y 522CONFIG_SCSI_SYM53C8XX_2=y
464CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 523CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
465CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 524CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
466CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 525CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
467# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 526CONFIG_SCSI_SYM53C8XX_MMIO=y
468# CONFIG_SCSI_IPR is not set
469# CONFIG_SCSI_QLOGIC_FC is not set
470CONFIG_SCSI_QLOGIC_1280=y 527CONFIG_SCSI_QLOGIC_1280=y
471# CONFIG_SCSI_QLA_FC is not set 528# CONFIG_SCSI_QLA_FC is not set
529# CONFIG_SCSI_QLA_ISCSI is not set
472# CONFIG_SCSI_LPFC is not set 530# CONFIG_SCSI_LPFC is not set
473# CONFIG_SCSI_DC395x is not set 531# CONFIG_SCSI_DC395x is not set
474# CONFIG_SCSI_DC390T is not set 532# CONFIG_SCSI_DC390T is not set
475# CONFIG_SCSI_DEBUG is not set 533# CONFIG_SCSI_DEBUG is not set
534# CONFIG_SCSI_SRP is not set
535
536#
537# Serial ATA (prod) and Parallel ATA (experimental) drivers
538#
539# CONFIG_ATA is not set
476 540
477# 541#
478# Multi-device support (RAID and LVM) 542# Multi-device support (RAID and LVM)
@@ -562,6 +626,7 @@ CONFIG_E100=y
562# CONFIG_EPIC100 is not set 626# CONFIG_EPIC100 is not set
563# CONFIG_SUNDANCE is not set 627# CONFIG_SUNDANCE is not set
564# CONFIG_VIA_RHINE is not set 628# CONFIG_VIA_RHINE is not set
629# CONFIG_SC92031 is not set
565 630
566# 631#
567# Ethernet (1000 Mbit) 632# Ethernet (1000 Mbit)
@@ -582,13 +647,18 @@ CONFIG_E1000=y
582# CONFIG_VIA_VELOCITY is not set 647# CONFIG_VIA_VELOCITY is not set
583CONFIG_TIGON3=y 648CONFIG_TIGON3=y
584# CONFIG_BNX2 is not set 649# CONFIG_BNX2 is not set
650# CONFIG_QLA3XXX is not set
651# CONFIG_ATL1 is not set
585 652
586# 653#
587# Ethernet (10000 Mbit) 654# Ethernet (10000 Mbit)
588# 655#
589# CONFIG_CHELSIO_T1 is not set 656# CONFIG_CHELSIO_T1 is not set
657# CONFIG_CHELSIO_T3 is not set
590# CONFIG_IXGB is not set 658# CONFIG_IXGB is not set
591# CONFIG_S2IO is not set 659# CONFIG_S2IO is not set
660# CONFIG_MYRI10GE is not set
661# CONFIG_NETXEN_NIC is not set
592 662
593# 663#
594# Token Ring devices 664# Token Ring devices
@@ -628,6 +698,7 @@ CONFIG_TIGON3=y
628# Input device support 698# Input device support
629# 699#
630CONFIG_INPUT=y 700CONFIG_INPUT=y
701# CONFIG_INPUT_FF_MEMLESS is not set
631 702
632# 703#
633# Userland interfaces 704# Userland interfaces
@@ -666,6 +737,7 @@ CONFIG_SERIO=y
666CONFIG_VT=y 737CONFIG_VT=y
667CONFIG_VT_CONSOLE=y 738CONFIG_VT_CONSOLE=y
668CONFIG_HW_CONSOLE=y 739CONFIG_HW_CONSOLE=y
740# CONFIG_VT_HW_CONSOLE_BINDING is not set
669# CONFIG_SERIAL_NONSTANDARD is not set 741# CONFIG_SERIAL_NONSTANDARD is not set
670 742
671# 743#
@@ -673,7 +745,8 @@ CONFIG_HW_CONSOLE=y
673# 745#
674CONFIG_SERIAL_8250=y 746CONFIG_SERIAL_8250=y
675CONFIG_SERIAL_8250_CONSOLE=y 747CONFIG_SERIAL_8250_CONSOLE=y
676CONFIG_SERIAL_8250_ACPI=y 748CONFIG_SERIAL_8250_PCI=y
749CONFIG_SERIAL_8250_PNP=y
677CONFIG_SERIAL_8250_NR_UARTS=8 750CONFIG_SERIAL_8250_NR_UARTS=8
678CONFIG_SERIAL_8250_RUNTIME_UARTS=4 751CONFIG_SERIAL_8250_RUNTIME_UARTS=4
679CONFIG_SERIAL_8250_EXTENDED=y 752CONFIG_SERIAL_8250_EXTENDED=y
@@ -705,10 +778,6 @@ CONFIG_EFI_RTC=y
705# CONFIG_DTLK is not set 778# CONFIG_DTLK is not set
706# CONFIG_R3964 is not set 779# CONFIG_R3964 is not set
707# CONFIG_APPLICOM is not set 780# CONFIG_APPLICOM is not set
708
709#
710# Ftape, the floppy tape device driver
711#
712CONFIG_AGP=y 781CONFIG_AGP=y
713CONFIG_AGP_HP_ZX1=y 782CONFIG_AGP_HP_ZX1=y
714CONFIG_DRM=y 783CONFIG_DRM=y
@@ -727,7 +796,6 @@ CONFIG_DRM_RADEON=y
727# TPM devices 796# TPM devices
728# 797#
729# CONFIG_TCG_TPM is not set 798# CONFIG_TCG_TPM is not set
730# CONFIG_TELCLOCK is not set
731 799
732# 800#
733# I2C support 801# I2C support
@@ -754,10 +822,11 @@ CONFIG_I2C_ALGOPCF=y
754# CONFIG_I2C_I810 is not set 822# CONFIG_I2C_I810 is not set
755# CONFIG_I2C_PIIX4 is not set 823# CONFIG_I2C_PIIX4 is not set
756# CONFIG_I2C_NFORCE2 is not set 824# CONFIG_I2C_NFORCE2 is not set
825# CONFIG_I2C_OCORES is not set
757# CONFIG_I2C_PARPORT_LIGHT is not set 826# CONFIG_I2C_PARPORT_LIGHT is not set
827# CONFIG_I2C_PASEMI is not set
758# CONFIG_I2C_PROSAVAGE is not set 828# CONFIG_I2C_PROSAVAGE is not set
759# CONFIG_I2C_SAVAGE4 is not set 829# CONFIG_I2C_SAVAGE4 is not set
760# CONFIG_SCx200_ACB is not set
761# CONFIG_I2C_SIS5595 is not set 830# CONFIG_I2C_SIS5595 is not set
762# CONFIG_I2C_SIS630 is not set 831# CONFIG_I2C_SIS630 is not set
763# CONFIG_I2C_SIS96X is not set 832# CONFIG_I2C_SIS96X is not set
@@ -776,9 +845,7 @@ CONFIG_I2C_ALGOPCF=y
776# CONFIG_SENSORS_PCF8574 is not set 845# CONFIG_SENSORS_PCF8574 is not set
777# CONFIG_SENSORS_PCA9539 is not set 846# CONFIG_SENSORS_PCA9539 is not set
778# CONFIG_SENSORS_PCF8591 is not set 847# CONFIG_SENSORS_PCF8591 is not set
779# CONFIG_SENSORS_RTC8564 is not set
780# CONFIG_SENSORS_MAX6875 is not set 848# CONFIG_SENSORS_MAX6875 is not set
781# CONFIG_RTC_X1205_I2C is not set
782# CONFIG_I2C_DEBUG_CORE is not set 849# CONFIG_I2C_DEBUG_CORE is not set
783# CONFIG_I2C_DEBUG_ALGO is not set 850# CONFIG_I2C_DEBUG_ALGO is not set
784# CONFIG_I2C_DEBUG_BUS is not set 851# CONFIG_I2C_DEBUG_BUS is not set
@@ -802,28 +869,31 @@ CONFIG_I2C_ALGOPCF=y
802# CONFIG_HWMON_VID is not set 869# CONFIG_HWMON_VID is not set
803 870
804# 871#
805# Misc devices 872# Multifunction device drivers
806#
807
808#
809# Multimedia Capabilities Port drivers
810# 873#
874# CONFIG_MFD_SM501 is not set
811 875
812# 876#
813# Multimedia devices 877# Multimedia devices
814# 878#
815CONFIG_VIDEO_DEV=y 879CONFIG_VIDEO_DEV=y
880CONFIG_VIDEO_V4L1=y
881CONFIG_VIDEO_V4L1_COMPAT=y
882CONFIG_VIDEO_V4L2=y
816 883
817# 884#
818# Video For Linux 885# Video Capture Adapters
819# 886#
820 887
821# 888#
822# Video Adapters 889# Video Capture Adapters
823# 890#
824# CONFIG_VIDEO_ADV_DEBUG is not set 891# CONFIG_VIDEO_ADV_DEBUG is not set
892CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
893# CONFIG_VIDEO_VIVI is not set
825# CONFIG_VIDEO_BT848 is not set 894# CONFIG_VIDEO_BT848 is not set
826# CONFIG_VIDEO_CPIA is not set 895# CONFIG_VIDEO_CPIA is not set
896# CONFIG_VIDEO_CPIA2 is not set
827# CONFIG_VIDEO_SAA5246A is not set 897# CONFIG_VIDEO_SAA5246A is not set
828# CONFIG_VIDEO_SAA5249 is not set 898# CONFIG_VIDEO_SAA5249 is not set
829# CONFIG_TUNER_3036 is not set 899# CONFIG_TUNER_3036 is not set
@@ -835,10 +905,27 @@ CONFIG_VIDEO_DEV=y
835# CONFIG_VIDEO_HEXIUM_ORION is not set 905# CONFIG_VIDEO_HEXIUM_ORION is not set
836# CONFIG_VIDEO_HEXIUM_GEMINI is not set 906# CONFIG_VIDEO_HEXIUM_GEMINI is not set
837# CONFIG_VIDEO_CX88 is not set 907# CONFIG_VIDEO_CX88 is not set
908# CONFIG_VIDEO_CAFE_CCIC is not set
909
910#
911# V4L USB devices
912#
913# CONFIG_VIDEO_PVRUSB2 is not set
838# CONFIG_VIDEO_EM28XX is not set 914# CONFIG_VIDEO_EM28XX is not set
915# CONFIG_VIDEO_USBVISION is not set
916# CONFIG_USB_VICAM is not set
917# CONFIG_USB_IBMCAM is not set
918# CONFIG_USB_KONICAWC is not set
919# CONFIG_USB_QUICKCAM_MESSENGER is not set
920# CONFIG_USB_ET61X251 is not set
839# CONFIG_VIDEO_OVCAMCHIP is not set 921# CONFIG_VIDEO_OVCAMCHIP is not set
840# CONFIG_VIDEO_AUDIO_DECODER is not set 922# CONFIG_USB_W9968CF is not set
841# CONFIG_VIDEO_DECODER is not set 923# CONFIG_USB_OV511 is not set
924# CONFIG_USB_SE401 is not set
925# CONFIG_USB_SN9C102 is not set
926# CONFIG_USB_STV680 is not set
927# CONFIG_USB_ZC0301 is not set
928# CONFIG_USB_PWC is not set
842 929
843# 930#
844# Radio Adapters 931# Radio Adapters
@@ -846,22 +933,35 @@ CONFIG_VIDEO_DEV=y
846# CONFIG_RADIO_GEMTEK_PCI is not set 933# CONFIG_RADIO_GEMTEK_PCI is not set
847# CONFIG_RADIO_MAXIRADIO is not set 934# CONFIG_RADIO_MAXIRADIO is not set
848# CONFIG_RADIO_MAESTRO is not set 935# CONFIG_RADIO_MAESTRO is not set
936# CONFIG_USB_DSBR is not set
849 937
850# 938#
851# Digital Video Broadcasting Devices 939# Digital Video Broadcasting Devices
852# 940#
853# CONFIG_DVB is not set 941# CONFIG_DVB is not set
942# CONFIG_USB_DABUSB is not set
854 943
855# 944#
856# Graphics support 945# Graphics support
857# 946#
947CONFIG_BACKLIGHT_LCD_SUPPORT=y
948CONFIG_BACKLIGHT_CLASS_DEVICE=y
949CONFIG_LCD_CLASS_DEVICE=m
858CONFIG_FB=y 950CONFIG_FB=y
951# CONFIG_FIRMWARE_EDID is not set
952CONFIG_FB_DDC=y
859CONFIG_FB_CFB_FILLRECT=y 953CONFIG_FB_CFB_FILLRECT=y
860CONFIG_FB_CFB_COPYAREA=y 954CONFIG_FB_CFB_COPYAREA=y
861CONFIG_FB_CFB_IMAGEBLIT=y 955CONFIG_FB_CFB_IMAGEBLIT=y
956# CONFIG_FB_SVGALIB is not set
862# CONFIG_FB_MACMODES is not set 957# CONFIG_FB_MACMODES is not set
958CONFIG_FB_BACKLIGHT=y
863CONFIG_FB_MODE_HELPERS=y 959CONFIG_FB_MODE_HELPERS=y
864# CONFIG_FB_TILEBLITTING is not set 960# CONFIG_FB_TILEBLITTING is not set
961
962#
963# Frambuffer hardware drivers
964#
865# CONFIG_FB_CIRRUS is not set 965# CONFIG_FB_CIRRUS is not set
866# CONFIG_FB_PM2 is not set 966# CONFIG_FB_PM2 is not set
867# CONFIG_FB_CYBER2000 is not set 967# CONFIG_FB_CYBER2000 is not set
@@ -871,12 +971,13 @@ CONFIG_FB_MODE_HELPERS=y
871# CONFIG_FB_NVIDIA is not set 971# CONFIG_FB_NVIDIA is not set
872# CONFIG_FB_RIVA is not set 972# CONFIG_FB_RIVA is not set
873# CONFIG_FB_MATROX is not set 973# CONFIG_FB_MATROX is not set
874# CONFIG_FB_RADEON_OLD is not set
875CONFIG_FB_RADEON=y 974CONFIG_FB_RADEON=y
876CONFIG_FB_RADEON_I2C=y 975CONFIG_FB_RADEON_I2C=y
976CONFIG_FB_RADEON_BACKLIGHT=y
877CONFIG_FB_RADEON_DEBUG=y 977CONFIG_FB_RADEON_DEBUG=y
878# CONFIG_FB_ATY128 is not set 978# CONFIG_FB_ATY128 is not set
879# CONFIG_FB_ATY is not set 979# CONFIG_FB_ATY is not set
980# CONFIG_FB_S3 is not set
880# CONFIG_FB_SAVAGE is not set 981# CONFIG_FB_SAVAGE is not set
881# CONFIG_FB_SIS is not set 982# CONFIG_FB_SIS is not set
882# CONFIG_FB_NEOMAGIC is not set 983# CONFIG_FB_NEOMAGIC is not set
@@ -890,6 +991,7 @@ CONFIG_FB_RADEON_DEBUG=y
890# Console display driver support 991# Console display driver support
891# 992#
892CONFIG_VGA_CONSOLE=y 993CONFIG_VGA_CONSOLE=y
994# CONFIG_VGACON_SOFT_SCROLLBACK is not set
893CONFIG_DUMMY_CONSOLE=y 995CONFIG_DUMMY_CONSOLE=y
894CONFIG_FRAMEBUFFER_CONSOLE=y 996CONFIG_FRAMEBUFFER_CONSOLE=y
895# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 997# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
@@ -904,7 +1006,6 @@ CONFIG_LOGO=y
904# CONFIG_LOGO_LINUX_MONO is not set 1006# CONFIG_LOGO_LINUX_MONO is not set
905# CONFIG_LOGO_LINUX_VGA16 is not set 1007# CONFIG_LOGO_LINUX_VGA16 is not set
906CONFIG_LOGO_LINUX_CLUT224=y 1008CONFIG_LOGO_LINUX_CLUT224=y
907# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
908 1009
909# 1010#
910# Sound 1011# Sound
@@ -924,9 +1025,11 @@ CONFIG_SND_SEQUENCER=y
924CONFIG_SND_OSSEMUL=y 1025CONFIG_SND_OSSEMUL=y
925CONFIG_SND_MIXER_OSS=y 1026CONFIG_SND_MIXER_OSS=y
926CONFIG_SND_PCM_OSS=y 1027CONFIG_SND_PCM_OSS=y
1028CONFIG_SND_PCM_OSS_PLUGINS=y
927CONFIG_SND_SEQUENCER_OSS=y 1029CONFIG_SND_SEQUENCER_OSS=y
928# CONFIG_SND_DYNAMIC_MINORS is not set 1030# CONFIG_SND_DYNAMIC_MINORS is not set
929CONFIG_SND_SUPPORT_OLD_API=y 1031CONFIG_SND_SUPPORT_OLD_API=y
1032CONFIG_SND_VERBOSE_PROCFS=y
930# CONFIG_SND_VERBOSE_PRINTK is not set 1033# CONFIG_SND_VERBOSE_PRINTK is not set
931# CONFIG_SND_DEBUG is not set 1034# CONFIG_SND_DEBUG is not set
932 1035
@@ -936,7 +1039,6 @@ CONFIG_SND_SUPPORT_OLD_API=y
936CONFIG_SND_MPU401_UART=y 1039CONFIG_SND_MPU401_UART=y
937CONFIG_SND_OPL3_LIB=y 1040CONFIG_SND_OPL3_LIB=y
938CONFIG_SND_AC97_CODEC=y 1041CONFIG_SND_AC97_CODEC=y
939CONFIG_SND_AC97_BUS=y
940# CONFIG_SND_DUMMY is not set 1042# CONFIG_SND_DUMMY is not set
941# CONFIG_SND_VIRMIDI is not set 1043# CONFIG_SND_VIRMIDI is not set
942# CONFIG_SND_MTPAV is not set 1044# CONFIG_SND_MTPAV is not set
@@ -947,6 +1049,7 @@ CONFIG_SND_AC97_BUS=y
947# PCI devices 1049# PCI devices
948# 1050#
949# CONFIG_SND_AD1889 is not set 1051# CONFIG_SND_AD1889 is not set
1052# CONFIG_SND_ALS300 is not set
950# CONFIG_SND_ALI5451 is not set 1053# CONFIG_SND_ALI5451 is not set
951# CONFIG_SND_ATIIXP is not set 1054# CONFIG_SND_ATIIXP is not set
952# CONFIG_SND_ATIIXP_MODEM is not set 1055# CONFIG_SND_ATIIXP_MODEM is not set
@@ -959,6 +1062,18 @@ CONFIG_SND_AC97_BUS=y
959# CONFIG_SND_CMIPCI is not set 1062# CONFIG_SND_CMIPCI is not set
960# CONFIG_SND_CS4281 is not set 1063# CONFIG_SND_CS4281 is not set
961# CONFIG_SND_CS46XX is not set 1064# CONFIG_SND_CS46XX is not set
1065# CONFIG_SND_DARLA20 is not set
1066# CONFIG_SND_GINA20 is not set
1067# CONFIG_SND_LAYLA20 is not set
1068# CONFIG_SND_DARLA24 is not set
1069# CONFIG_SND_GINA24 is not set
1070# CONFIG_SND_LAYLA24 is not set
1071# CONFIG_SND_MONA is not set
1072# CONFIG_SND_MIA is not set
1073# CONFIG_SND_ECHO3G is not set
1074# CONFIG_SND_INDIGO is not set
1075# CONFIG_SND_INDIGOIO is not set
1076# CONFIG_SND_INDIGODJ is not set
962# CONFIG_SND_EMU10K1 is not set 1077# CONFIG_SND_EMU10K1 is not set
963# CONFIG_SND_EMU10K1X is not set 1078# CONFIG_SND_EMU10K1X is not set
964# CONFIG_SND_ENS1370 is not set 1079# CONFIG_SND_ENS1370 is not set
@@ -966,7 +1081,7 @@ CONFIG_SND_AC97_BUS=y
966# CONFIG_SND_ES1938 is not set 1081# CONFIG_SND_ES1938 is not set
967# CONFIG_SND_ES1968 is not set 1082# CONFIG_SND_ES1968 is not set
968CONFIG_SND_FM801=y 1083CONFIG_SND_FM801=y
969CONFIG_SND_FM801_TEA575X=y 1084# CONFIG_SND_FM801_TEA575X_BOOL is not set
970# CONFIG_SND_HDA_INTEL is not set 1085# CONFIG_SND_HDA_INTEL is not set
971# CONFIG_SND_HDSP is not set 1086# CONFIG_SND_HDSP is not set
972# CONFIG_SND_HDSPM is not set 1087# CONFIG_SND_HDSPM is not set
@@ -979,6 +1094,7 @@ CONFIG_SND_FM801_TEA575X=y
979# CONFIG_SND_MIXART is not set 1094# CONFIG_SND_MIXART is not set
980# CONFIG_SND_NM256 is not set 1095# CONFIG_SND_NM256 is not set
981# CONFIG_SND_PCXHR is not set 1096# CONFIG_SND_PCXHR is not set
1097# CONFIG_SND_RIPTIDE is not set
982# CONFIG_SND_RME32 is not set 1098# CONFIG_SND_RME32 is not set
983# CONFIG_SND_RME96 is not set 1099# CONFIG_SND_RME96 is not set
984# CONFIG_SND_RME9652 is not set 1100# CONFIG_SND_RME9652 is not set
@@ -988,6 +1104,7 @@ CONFIG_SND_FM801_TEA575X=y
988# CONFIG_SND_VIA82XX_MODEM is not set 1104# CONFIG_SND_VIA82XX_MODEM is not set
989# CONFIG_SND_VX222 is not set 1105# CONFIG_SND_VX222 is not set
990# CONFIG_SND_YMFPCI is not set 1106# CONFIG_SND_YMFPCI is not set
1107# CONFIG_SND_AC97_POWER_SAVE is not set
991 1108
992# 1109#
993# USB devices 1110# USB devices
@@ -995,15 +1112,28 @@ CONFIG_SND_FM801_TEA575X=y
995# CONFIG_SND_USB_AUDIO is not set 1112# CONFIG_SND_USB_AUDIO is not set
996 1113
997# 1114#
1115# SoC audio support
1116#
1117# CONFIG_SND_SOC is not set
1118
1119#
998# Open Sound System 1120# Open Sound System
999# 1121#
1000# CONFIG_SOUND_PRIME is not set 1122# CONFIG_SOUND_PRIME is not set
1123CONFIG_AC97_BUS=y
1124
1125#
1126# HID Devices
1127#
1128CONFIG_HID=y
1129# CONFIG_HID_DEBUG is not set
1001 1130
1002# 1131#
1003# USB support 1132# USB support
1004# 1133#
1005CONFIG_USB_ARCH_HAS_HCD=y 1134CONFIG_USB_ARCH_HAS_HCD=y
1006CONFIG_USB_ARCH_HAS_OHCI=y 1135CONFIG_USB_ARCH_HAS_OHCI=y
1136CONFIG_USB_ARCH_HAS_EHCI=y
1007CONFIG_USB=y 1137CONFIG_USB=y
1008# CONFIG_USB_DEBUG is not set 1138# CONFIG_USB_DEBUG is not set
1009 1139
@@ -1011,7 +1141,6 @@ CONFIG_USB=y
1011# Miscellaneous USB options 1141# Miscellaneous USB options
1012# 1142#
1013# CONFIG_USB_DEVICEFS is not set 1143# CONFIG_USB_DEVICEFS is not set
1014CONFIG_USB_BANDWIDTH=y
1015# CONFIG_USB_DYNAMIC_MINORS is not set 1144# CONFIG_USB_DYNAMIC_MINORS is not set
1016# CONFIG_USB_SUSPEND is not set 1145# CONFIG_USB_SUSPEND is not set
1017# CONFIG_USB_OTG is not set 1146# CONFIG_USB_OTG is not set
@@ -1022,9 +1151,12 @@ CONFIG_USB_BANDWIDTH=y
1022CONFIG_USB_EHCI_HCD=y 1151CONFIG_USB_EHCI_HCD=y
1023# CONFIG_USB_EHCI_SPLIT_ISO is not set 1152# CONFIG_USB_EHCI_SPLIT_ISO is not set
1024# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1153# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1154# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1155# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
1025# CONFIG_USB_ISP116X_HCD is not set 1156# CONFIG_USB_ISP116X_HCD is not set
1026CONFIG_USB_OHCI_HCD=y 1157CONFIG_USB_OHCI_HCD=y
1027# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1158# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1159# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1028CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1160CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1029CONFIG_USB_UHCI_HCD=y 1161CONFIG_USB_UHCI_HCD=y
1030# CONFIG_USB_SL811_HCD is not set 1162# CONFIG_USB_SL811_HCD is not set
@@ -1032,7 +1164,6 @@ CONFIG_USB_UHCI_HCD=y
1032# 1164#
1033# USB Device Class drivers 1165# USB Device Class drivers
1034# 1166#
1035# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
1036# CONFIG_USB_ACM is not set 1167# CONFIG_USB_ACM is not set
1037# CONFIG_USB_PRINTER is not set 1168# CONFIG_USB_PRINTER is not set
1038 1169
@@ -1054,13 +1185,13 @@ CONFIG_USB_STORAGE=y
1054# CONFIG_USB_STORAGE_SDDR55 is not set 1185# CONFIG_USB_STORAGE_SDDR55 is not set
1055# CONFIG_USB_STORAGE_JUMPSHOT is not set 1186# CONFIG_USB_STORAGE_JUMPSHOT is not set
1056# CONFIG_USB_STORAGE_ALAUDA is not set 1187# CONFIG_USB_STORAGE_ALAUDA is not set
1188# CONFIG_USB_STORAGE_KARMA is not set
1057# CONFIG_USB_LIBUSUAL is not set 1189# CONFIG_USB_LIBUSUAL is not set
1058 1190
1059# 1191#
1060# USB Input Devices 1192# USB Input Devices
1061# 1193#
1062CONFIG_USB_HID=y 1194CONFIG_USB_HID=y
1063CONFIG_USB_HIDINPUT=y
1064# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1195# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1065# CONFIG_HID_FF is not set 1196# CONFIG_HID_FF is not set
1066CONFIG_USB_HIDDEV=y 1197CONFIG_USB_HIDDEV=y
@@ -1069,15 +1200,14 @@ CONFIG_USB_HIDDEV=y
1069# CONFIG_USB_ACECAD is not set 1200# CONFIG_USB_ACECAD is not set
1070# CONFIG_USB_KBTAB is not set 1201# CONFIG_USB_KBTAB is not set
1071# CONFIG_USB_POWERMATE is not set 1202# CONFIG_USB_POWERMATE is not set
1072# CONFIG_USB_MTOUCH is not set 1203# CONFIG_USB_TOUCHSCREEN is not set
1073# CONFIG_USB_ITMTOUCH is not set
1074# CONFIG_USB_EGALAX is not set
1075# CONFIG_USB_YEALINK is not set 1204# CONFIG_USB_YEALINK is not set
1076# CONFIG_USB_XPAD is not set 1205# CONFIG_USB_XPAD is not set
1077# CONFIG_USB_ATI_REMOTE is not set 1206# CONFIG_USB_ATI_REMOTE is not set
1078# CONFIG_USB_ATI_REMOTE2 is not set 1207# CONFIG_USB_ATI_REMOTE2 is not set
1079# CONFIG_USB_KEYSPAN_REMOTE is not set 1208# CONFIG_USB_KEYSPAN_REMOTE is not set
1080# CONFIG_USB_APPLETOUCH is not set 1209# CONFIG_USB_APPLETOUCH is not set
1210# CONFIG_USB_GTCO is not set
1081 1211
1082# 1212#
1083# USB Imaging devices 1213# USB Imaging devices
@@ -1086,27 +1216,13 @@ CONFIG_USB_HIDDEV=y
1086# CONFIG_USB_MICROTEK is not set 1216# CONFIG_USB_MICROTEK is not set
1087 1217
1088# 1218#
1089# USB Multimedia devices
1090#
1091# CONFIG_USB_DABUSB is not set
1092# CONFIG_USB_VICAM is not set
1093# CONFIG_USB_DSBR is not set
1094# CONFIG_USB_ET61X251 is not set
1095# CONFIG_USB_IBMCAM is not set
1096# CONFIG_USB_KONICAWC is not set
1097# CONFIG_USB_OV511 is not set
1098# CONFIG_USB_SE401 is not set
1099# CONFIG_USB_SN9C102 is not set
1100# CONFIG_USB_STV680 is not set
1101# CONFIG_USB_PWC is not set
1102
1103#
1104# USB Network Adapters 1219# USB Network Adapters
1105# 1220#
1106# CONFIG_USB_CATC is not set 1221# CONFIG_USB_CATC is not set
1107# CONFIG_USB_KAWETH is not set 1222# CONFIG_USB_KAWETH is not set
1108# CONFIG_USB_PEGASUS is not set 1223# CONFIG_USB_PEGASUS is not set
1109# CONFIG_USB_RTL8150 is not set 1224# CONFIG_USB_RTL8150 is not set
1225# CONFIG_USB_USBNET_MII is not set
1110# CONFIG_USB_USBNET is not set 1226# CONFIG_USB_USBNET is not set
1111CONFIG_USB_MON=y 1227CONFIG_USB_MON=y
1112 1228
@@ -1124,17 +1240,23 @@ CONFIG_USB_MON=y
1124# 1240#
1125# CONFIG_USB_EMI62 is not set 1241# CONFIG_USB_EMI62 is not set
1126# CONFIG_USB_EMI26 is not set 1242# CONFIG_USB_EMI26 is not set
1243# CONFIG_USB_ADUTUX is not set
1127# CONFIG_USB_AUERSWALD is not set 1244# CONFIG_USB_AUERSWALD is not set
1128# CONFIG_USB_RIO500 is not set 1245# CONFIG_USB_RIO500 is not set
1129# CONFIG_USB_LEGOTOWER is not set 1246# CONFIG_USB_LEGOTOWER is not set
1130# CONFIG_USB_LCD is not set 1247# CONFIG_USB_LCD is not set
1248# CONFIG_USB_BERRY_CHARGE is not set
1131# CONFIG_USB_LED is not set 1249# CONFIG_USB_LED is not set
1250# CONFIG_USB_CYPRESS_CY7C63 is not set
1132# CONFIG_USB_CYTHERM is not set 1251# CONFIG_USB_CYTHERM is not set
1133# CONFIG_USB_PHIDGETKIT is not set 1252# CONFIG_USB_PHIDGET is not set
1134# CONFIG_USB_PHIDGETSERVO is not set
1135# CONFIG_USB_IDMOUSE is not set 1253# CONFIG_USB_IDMOUSE is not set
1254# CONFIG_USB_FTDI_ELAN is not set
1255# CONFIG_USB_APPLEDISPLAY is not set
1136# CONFIG_USB_SISUSBVGA is not set 1256# CONFIG_USB_SISUSBVGA is not set
1137# CONFIG_USB_LD is not set 1257# CONFIG_USB_LD is not set
1258# CONFIG_USB_TRANCEVIBRATOR is not set
1259# CONFIG_USB_IOWARRIOR is not set
1138 1260
1139# 1261#
1140# USB DSL modem support 1262# USB DSL modem support
@@ -1151,13 +1273,53 @@ CONFIG_USB_MON=y
1151# CONFIG_MMC is not set 1273# CONFIG_MMC is not set
1152 1274
1153# 1275#
1276# LED devices
1277#
1278# CONFIG_NEW_LEDS is not set
1279
1280#
1281# LED drivers
1282#
1283
1284#
1285# LED Triggers
1286#
1287
1288#
1154# InfiniBand support 1289# InfiniBand support
1155# 1290#
1156# CONFIG_INFINIBAND is not set 1291# CONFIG_INFINIBAND is not set
1157 1292
1158# 1293#
1159# EDAC - error detection and reporting (RAS) 1294# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1295#
1296
1297#
1298# Real Time Clock
1160# 1299#
1300# CONFIG_RTC_CLASS is not set
1301
1302#
1303# DMA Engine support
1304#
1305# CONFIG_DMA_ENGINE is not set
1306
1307#
1308# DMA Clients
1309#
1310
1311#
1312# DMA Devices
1313#
1314
1315#
1316# Auxiliary Display support
1317#
1318
1319#
1320# Virtualization
1321#
1322# CONFIG_MSPEC is not set
1161 1323
1162# 1324#
1163# File systems 1325# File systems
@@ -1171,6 +1333,7 @@ CONFIG_EXT3_FS=y
1171CONFIG_EXT3_FS_XATTR=y 1333CONFIG_EXT3_FS_XATTR=y
1172# CONFIG_EXT3_FS_POSIX_ACL is not set 1334# CONFIG_EXT3_FS_POSIX_ACL is not set
1173# CONFIG_EXT3_FS_SECURITY is not set 1335# CONFIG_EXT3_FS_SECURITY is not set
1336# CONFIG_EXT4DEV_FS is not set
1174CONFIG_JBD=y 1337CONFIG_JBD=y
1175# CONFIG_JBD_DEBUG is not set 1338# CONFIG_JBD_DEBUG is not set
1176CONFIG_FS_MBCACHE=y 1339CONFIG_FS_MBCACHE=y
@@ -1178,6 +1341,7 @@ CONFIG_FS_MBCACHE=y
1178# CONFIG_JFS_FS is not set 1341# CONFIG_JFS_FS is not set
1179# CONFIG_FS_POSIX_ACL is not set 1342# CONFIG_FS_POSIX_ACL is not set
1180# CONFIG_XFS_FS is not set 1343# CONFIG_XFS_FS is not set
1344# CONFIG_GFS2_FS is not set
1181# CONFIG_OCFS2_FS is not set 1345# CONFIG_OCFS2_FS is not set
1182# CONFIG_MINIX_FS is not set 1346# CONFIG_MINIX_FS is not set
1183# CONFIG_ROMFS_FS is not set 1347# CONFIG_ROMFS_FS is not set
@@ -1212,12 +1376,14 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1212# 1376#
1213CONFIG_PROC_FS=y 1377CONFIG_PROC_FS=y
1214CONFIG_PROC_KCORE=y 1378CONFIG_PROC_KCORE=y
1379CONFIG_PROC_VMCORE=y
1380CONFIG_PROC_SYSCTL=y
1215CONFIG_SYSFS=y 1381CONFIG_SYSFS=y
1216CONFIG_TMPFS=y 1382CONFIG_TMPFS=y
1383# CONFIG_TMPFS_POSIX_ACL is not set
1217CONFIG_HUGETLBFS=y 1384CONFIG_HUGETLBFS=y
1218CONFIG_HUGETLB_PAGE=y 1385CONFIG_HUGETLB_PAGE=y
1219CONFIG_RAMFS=y 1386CONFIG_RAMFS=y
1220# CONFIG_RELAYFS_FS is not set
1221# CONFIG_CONFIGFS_FS is not set 1387# CONFIG_CONFIGFS_FS is not set
1222 1388
1223# 1389#
@@ -1331,15 +1497,25 @@ CONFIG_NLS_KOI8_U=y
1331CONFIG_NLS_UTF8=y 1497CONFIG_NLS_UTF8=y
1332 1498
1333# 1499#
1500# Distributed Lock Manager
1501#
1502# CONFIG_DLM is not set
1503
1504#
1334# Library routines 1505# Library routines
1335# 1506#
1507CONFIG_BITREVERSE=y
1336# CONFIG_CRC_CCITT is not set 1508# CONFIG_CRC_CCITT is not set
1337# CONFIG_CRC16 is not set 1509# CONFIG_CRC16 is not set
1338CONFIG_CRC32=y 1510CONFIG_CRC32=y
1339# CONFIG_LIBCRC32C is not set 1511# CONFIG_LIBCRC32C is not set
1512CONFIG_PLIST=y
1513CONFIG_HAS_IOMEM=y
1514CONFIG_HAS_IOPORT=y
1340CONFIG_GENERIC_HARDIRQS=y 1515CONFIG_GENERIC_HARDIRQS=y
1341CONFIG_GENERIC_IRQ_PROBE=y 1516CONFIG_GENERIC_IRQ_PROBE=y
1342CONFIG_GENERIC_PENDING_IRQ=y 1517CONFIG_GENERIC_PENDING_IRQ=y
1518CONFIG_IRQ_PER_CPU=y
1343 1519
1344# 1520#
1345# Instrumentation Support 1521# Instrumentation Support
@@ -1351,21 +1527,32 @@ CONFIG_KPROBES=y
1351# Kernel hacking 1527# Kernel hacking
1352# 1528#
1353# CONFIG_PRINTK_TIME is not set 1529# CONFIG_PRINTK_TIME is not set
1530CONFIG_ENABLE_MUST_CHECK=y
1354CONFIG_MAGIC_SYSRQ=y 1531CONFIG_MAGIC_SYSRQ=y
1532# CONFIG_UNUSED_SYMBOLS is not set
1533# CONFIG_DEBUG_FS is not set
1534# CONFIG_HEADERS_CHECK is not set
1355CONFIG_DEBUG_KERNEL=y 1535CONFIG_DEBUG_KERNEL=y
1536# CONFIG_DEBUG_SHIRQ is not set
1356CONFIG_LOG_BUF_SHIFT=17 1537CONFIG_LOG_BUF_SHIFT=17
1357CONFIG_DETECT_SOFTLOCKUP=y 1538CONFIG_DETECT_SOFTLOCKUP=y
1358# CONFIG_SCHEDSTATS is not set 1539# CONFIG_SCHEDSTATS is not set
1540# CONFIG_TIMER_STATS is not set
1359# CONFIG_DEBUG_SLAB is not set 1541# CONFIG_DEBUG_SLAB is not set
1360CONFIG_DEBUG_MUTEXES=y 1542# CONFIG_DEBUG_RT_MUTEXES is not set
1543# CONFIG_RT_MUTEX_TESTER is not set
1361# CONFIG_DEBUG_SPINLOCK is not set 1544# CONFIG_DEBUG_SPINLOCK is not set
1545CONFIG_DEBUG_MUTEXES=y
1362# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1546# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1547# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1363# CONFIG_DEBUG_KOBJECT is not set 1548# CONFIG_DEBUG_KOBJECT is not set
1364# CONFIG_DEBUG_INFO is not set 1549# CONFIG_DEBUG_INFO is not set
1365# CONFIG_DEBUG_FS is not set
1366# CONFIG_DEBUG_VM is not set 1550# CONFIG_DEBUG_VM is not set
1551# CONFIG_DEBUG_LIST is not set
1367CONFIG_FORCED_INLINING=y 1552CONFIG_FORCED_INLINING=y
1368# CONFIG_RCU_TORTURE_TEST is not set 1553# CONFIG_RCU_TORTURE_TEST is not set
1554# CONFIG_LKDTM is not set
1555# CONFIG_FAULT_INJECTION is not set
1369CONFIG_IA64_GRANULE_16MB=y 1556CONFIG_IA64_GRANULE_16MB=y
1370# CONFIG_IA64_GRANULE_64MB is not set 1557# CONFIG_IA64_GRANULE_64MB is not set
1371CONFIG_IA64_PRINT_HAZARDS=y 1558CONFIG_IA64_PRINT_HAZARDS=y
@@ -1384,7 +1571,11 @@ CONFIG_SYSVIPC_COMPAT=y
1384# Cryptographic options 1571# Cryptographic options
1385# 1572#
1386CONFIG_CRYPTO=y 1573CONFIG_CRYPTO=y
1574CONFIG_CRYPTO_ALGAPI=y
1575CONFIG_CRYPTO_BLKCIPHER=y
1576CONFIG_CRYPTO_MANAGER=y
1387# CONFIG_CRYPTO_HMAC is not set 1577# CONFIG_CRYPTO_HMAC is not set
1578# CONFIG_CRYPTO_XCBC is not set
1388# CONFIG_CRYPTO_NULL is not set 1579# CONFIG_CRYPTO_NULL is not set
1389# CONFIG_CRYPTO_MD4 is not set 1580# CONFIG_CRYPTO_MD4 is not set
1390CONFIG_CRYPTO_MD5=y 1581CONFIG_CRYPTO_MD5=y
@@ -1393,7 +1584,13 @@ CONFIG_CRYPTO_MD5=y
1393# CONFIG_CRYPTO_SHA512 is not set 1584# CONFIG_CRYPTO_SHA512 is not set
1394# CONFIG_CRYPTO_WP512 is not set 1585# CONFIG_CRYPTO_WP512 is not set
1395# CONFIG_CRYPTO_TGR192 is not set 1586# CONFIG_CRYPTO_TGR192 is not set
1587# CONFIG_CRYPTO_GF128MUL is not set
1588CONFIG_CRYPTO_ECB=m
1589CONFIG_CRYPTO_CBC=y
1590CONFIG_CRYPTO_PCBC=m
1591# CONFIG_CRYPTO_LRW is not set
1396CONFIG_CRYPTO_DES=y 1592CONFIG_CRYPTO_DES=y
1593# CONFIG_CRYPTO_FCRYPT is not set
1397# CONFIG_CRYPTO_BLOWFISH is not set 1594# CONFIG_CRYPTO_BLOWFISH is not set
1398# CONFIG_CRYPTO_TWOFISH is not set 1595# CONFIG_CRYPTO_TWOFISH is not set
1399# CONFIG_CRYPTO_SERPENT is not set 1596# CONFIG_CRYPTO_SERPENT is not set
@@ -1407,6 +1604,7 @@ CONFIG_CRYPTO_DES=y
1407# CONFIG_CRYPTO_DEFLATE is not set 1604# CONFIG_CRYPTO_DEFLATE is not set
1408# CONFIG_CRYPTO_MICHAEL_MIC is not set 1605# CONFIG_CRYPTO_MICHAEL_MIC is not set
1409# CONFIG_CRYPTO_CRC32C is not set 1606# CONFIG_CRYPTO_CRC32C is not set
1607# CONFIG_CRYPTO_CAMELLIA is not set
1410# CONFIG_CRYPTO_TEST is not set 1608# CONFIG_CRYPTO_TEST is not set
1411 1609
1412# 1610#
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 9001b3fbaa32..153bfdc0182d 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -1,8 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc5 3# Linux kernel version: 2.6.21-rc3
4# Mon Feb 27 16:02:28 2006 4# Thu Mar 8 11:01:03 2007
5# 5#
6CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
6 7
7# 8#
8# Code maturity level options 9# Code maturity level options
@@ -18,16 +19,24 @@ CONFIG_LOCALVERSION=""
18CONFIG_LOCALVERSION_AUTO=y 19CONFIG_LOCALVERSION_AUTO=y
19CONFIG_SWAP=y 20CONFIG_SWAP=y
20CONFIG_SYSVIPC=y 21CONFIG_SYSVIPC=y
22# CONFIG_IPC_NS is not set
23CONFIG_SYSVIPC_SYSCTL=y
21CONFIG_POSIX_MQUEUE=y 24CONFIG_POSIX_MQUEUE=y
22# CONFIG_BSD_PROCESS_ACCT is not set 25# CONFIG_BSD_PROCESS_ACCT is not set
23CONFIG_SYSCTL=y 26# CONFIG_TASKSTATS is not set
27# CONFIG_UTS_NS is not set
24# CONFIG_AUDIT is not set 28# CONFIG_AUDIT is not set
25CONFIG_IKCONFIG=y 29CONFIG_IKCONFIG=y
26CONFIG_IKCONFIG_PROC=y 30CONFIG_IKCONFIG_PROC=y
27# CONFIG_CPUSETS is not set 31# CONFIG_CPUSETS is not set
32CONFIG_SYSFS_DEPRECATED=y
33# CONFIG_RELAY is not set
34CONFIG_BLK_DEV_INITRD=y
28CONFIG_INITRAMFS_SOURCE="" 35CONFIG_INITRAMFS_SOURCE=""
29CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
37CONFIG_SYSCTL=y
30# CONFIG_EMBEDDED is not set 38# CONFIG_EMBEDDED is not set
39CONFIG_SYSCTL_SYSCALL=y
31CONFIG_KALLSYMS=y 40CONFIG_KALLSYMS=y
32CONFIG_KALLSYMS_ALL=y 41CONFIG_KALLSYMS_ALL=y
33# CONFIG_KALLSYMS_EXTRA_PASS is not set 42# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -39,11 +48,9 @@ CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 48CONFIG_FUTEX=y
40CONFIG_EPOLL=y 49CONFIG_EPOLL=y
41CONFIG_SHMEM=y 50CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46CONFIG_SLAB=y 51CONFIG_SLAB=y
52CONFIG_VM_EVENT_COUNTERS=y
53CONFIG_RT_MUTEXES=y
47# CONFIG_TINY_SHMEM is not set 54# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0 55CONFIG_BASE_SMALL=0
49# CONFIG_SLOB is not set 56# CONFIG_SLOB is not set
@@ -54,7 +61,6 @@ CONFIG_BASE_SMALL=0
54CONFIG_MODULES=y 61CONFIG_MODULES=y
55CONFIG_MODULE_UNLOAD=y 62CONFIG_MODULE_UNLOAD=y
56# CONFIG_MODULE_FORCE_UNLOAD is not set 63# CONFIG_MODULE_FORCE_UNLOAD is not set
57CONFIG_OBSOLETE_MODPARM=y
58CONFIG_MODVERSIONS=y 64CONFIG_MODVERSIONS=y
59# CONFIG_MODULE_SRCVERSION_ALL is not set 65# CONFIG_MODULE_SRCVERSION_ALL is not set
60CONFIG_KMOD=y 66CONFIG_KMOD=y
@@ -63,6 +69,8 @@ CONFIG_STOP_MACHINE=y
63# 69#
64# Block layer 70# Block layer
65# 71#
72CONFIG_BLOCK=y
73# CONFIG_BLK_DEV_IO_TRACE is not set
66 74
67# 75#
68# IO Schedulers 76# IO Schedulers
@@ -82,15 +90,20 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
82# 90#
83CONFIG_IA64=y 91CONFIG_IA64=y
84CONFIG_64BIT=y 92CONFIG_64BIT=y
93CONFIG_ZONE_DMA=y
85CONFIG_MMU=y 94CONFIG_MMU=y
86CONFIG_SWIOTLB=y 95CONFIG_SWIOTLB=y
87CONFIG_RWSEM_XCHGADD_ALGORITHM=y 96CONFIG_RWSEM_XCHGADD_ALGORITHM=y
97# CONFIG_ARCH_HAS_ILOG2_U32 is not set
98# CONFIG_ARCH_HAS_ILOG2_U64 is not set
99CONFIG_GENERIC_FIND_NEXT_BIT=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 100CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_TIME_INTERPOLATION=y 101CONFIG_TIME_INTERPOLATION=y
102CONFIG_DMI=y
90CONFIG_EFI=y 103CONFIG_EFI=y
91CONFIG_GENERIC_IOMAP=y 104CONFIG_GENERIC_IOMAP=y
92CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 105CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
93CONFIG_DMA_IS_DMA32=y 106CONFIG_AUDIT_ARCH=y
94CONFIG_IA64_GENERIC=y 107CONFIG_IA64_GENERIC=y
95# CONFIG_IA64_DIG is not set 108# CONFIG_IA64_DIG is not set
96# CONFIG_IA64_HP_ZX1 is not set 109# CONFIG_IA64_HP_ZX1 is not set
@@ -107,6 +120,7 @@ CONFIG_PGTABLE_3=y
107# CONFIG_PGTABLE_4 is not set 120# CONFIG_PGTABLE_4 is not set
108# CONFIG_HZ_100 is not set 121# CONFIG_HZ_100 is not set
109CONFIG_HZ_250=y 122CONFIG_HZ_250=y
123# CONFIG_HZ_300 is not set
110# CONFIG_HZ_1000 is not set 124# CONFIG_HZ_1000 is not set
111CONFIG_HZ=250 125CONFIG_HZ=250
112CONFIG_IA64_L1_CACHE_SHIFT=7 126CONFIG_IA64_L1_CACHE_SHIFT=7
@@ -116,9 +130,10 @@ CONFIG_IOSAPIC=y
116CONFIG_FORCE_MAX_ZONEORDER=17 130CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 131CONFIG_SMP=y
118CONFIG_NR_CPUS=512 132CONFIG_NR_CPUS=512
119CONFIG_IA64_NR_NODES=256
120CONFIG_HOTPLUG_CPU=y 133CONFIG_HOTPLUG_CPU=y
134CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
121# CONFIG_SCHED_SMT is not set 135# CONFIG_SCHED_SMT is not set
136# CONFIG_PERMIT_BSP_REMOVE is not set
122# CONFIG_PREEMPT is not set 137# CONFIG_PREEMPT is not set
123CONFIG_SELECT_MEMORY_MODEL=y 138CONFIG_SELECT_MEMORY_MODEL=y
124# CONFIG_FLATMEM_MANUAL is not set 139# CONFIG_FLATMEM_MANUAL is not set
@@ -130,21 +145,34 @@ CONFIG_NEED_MULTIPLE_NODES=y
130# CONFIG_SPARSEMEM_STATIC is not set 145# CONFIG_SPARSEMEM_STATIC is not set
131CONFIG_SPLIT_PTLOCK_CPUS=4 146CONFIG_SPLIT_PTLOCK_CPUS=4
132CONFIG_MIGRATION=y 147CONFIG_MIGRATION=y
148CONFIG_RESOURCES_64BIT=y
149CONFIG_ZONE_DMA_FLAG=1
133CONFIG_ARCH_SELECT_MEMORY_MODEL=y 150CONFIG_ARCH_SELECT_MEMORY_MODEL=y
134CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 151CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
135CONFIG_ARCH_FLATMEM_ENABLE=y 152CONFIG_ARCH_FLATMEM_ENABLE=y
136CONFIG_ARCH_SPARSEMEM_ENABLE=y 153CONFIG_ARCH_SPARSEMEM_ENABLE=y
137CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y 154CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
138CONFIG_NUMA=y 155CONFIG_NUMA=y
156CONFIG_NODES_SHIFT=10
157CONFIG_ARCH_POPULATES_NODE_MAP=y
139CONFIG_VIRTUAL_MEM_MAP=y 158CONFIG_VIRTUAL_MEM_MAP=y
140CONFIG_HOLES_IN_ZONE=y 159CONFIG_HOLES_IN_ZONE=y
141CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y 160CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
161CONFIG_HAVE_ARCH_NODEDATA_EXTENSION=y
142CONFIG_IA32_SUPPORT=y 162CONFIG_IA32_SUPPORT=y
143CONFIG_COMPAT=y 163CONFIG_COMPAT=y
144CONFIG_IA64_MCA_RECOVERY=y 164CONFIG_IA64_MCA_RECOVERY=y
145CONFIG_PERFMON=y 165CONFIG_PERFMON=y
146CONFIG_IA64_PALINFO=y 166CONFIG_IA64_PALINFO=y
147CONFIG_SGI_SN=y 167CONFIG_SGI_SN=y
168# CONFIG_IA64_ESI is not set
169
170#
171# SN Devices
172#
173CONFIG_SGI_IOC3=m
174CONFIG_KEXEC=y
175CONFIG_CRASH_DUMP=y
148 176
149# 177#
150# Firmware Drivers 178# Firmware Drivers
@@ -160,13 +188,16 @@ CONFIG_BINFMT_MISC=m
160CONFIG_PM=y 188CONFIG_PM=y
161CONFIG_PM_LEGACY=y 189CONFIG_PM_LEGACY=y
162# CONFIG_PM_DEBUG is not set 190# CONFIG_PM_DEBUG is not set
191# CONFIG_PM_SYSFS_DEPRECATED is not set
163 192
164# 193#
165# ACPI (Advanced Configuration and Power Interface) Support 194# ACPI (Advanced Configuration and Power Interface) Support
166# 195#
167CONFIG_ACPI=y 196CONFIG_ACPI=y
197CONFIG_ACPI_PROCFS=y
168CONFIG_ACPI_BUTTON=m 198CONFIG_ACPI_BUTTON=m
169CONFIG_ACPI_FAN=m 199CONFIG_ACPI_FAN=m
200# CONFIG_ACPI_DOCK is not set
170CONFIG_ACPI_PROCESSOR=m 201CONFIG_ACPI_PROCESSOR=m
171CONFIG_ACPI_HOTPLUG_CPU=y 202CONFIG_ACPI_HOTPLUG_CPU=y
172CONFIG_ACPI_THERMAL=m 203CONFIG_ACPI_THERMAL=m
@@ -188,8 +219,8 @@ CONFIG_ACPI_CONTAINER=m
188# 219#
189CONFIG_PCI=y 220CONFIG_PCI=y
190CONFIG_PCI_DOMAINS=y 221CONFIG_PCI_DOMAINS=y
222# CONFIG_PCIEPORTBUS is not set
191# CONFIG_PCI_MSI is not set 223# CONFIG_PCI_MSI is not set
192CONFIG_PCI_LEGACY_PROC=y
193# CONFIG_PCI_DEBUG is not set 224# CONFIG_PCI_DEBUG is not set
194 225
195# 226#
@@ -220,6 +251,10 @@ CONFIG_NET=y
220CONFIG_PACKET=y 251CONFIG_PACKET=y
221# CONFIG_PACKET_MMAP is not set 252# CONFIG_PACKET_MMAP is not set
222CONFIG_UNIX=y 253CONFIG_UNIX=y
254CONFIG_XFRM=y
255# CONFIG_XFRM_USER is not set
256# CONFIG_XFRM_SUB_POLICY is not set
257# CONFIG_XFRM_MIGRATE is not set
223# CONFIG_NET_KEY is not set 258# CONFIG_NET_KEY is not set
224CONFIG_INET=y 259CONFIG_INET=y
225CONFIG_IP_MULTICAST=y 260CONFIG_IP_MULTICAST=y
@@ -234,12 +269,21 @@ CONFIG_SYN_COOKIES=y
234# CONFIG_INET_AH is not set 269# CONFIG_INET_AH is not set
235# CONFIG_INET_ESP is not set 270# CONFIG_INET_ESP is not set
236# CONFIG_INET_IPCOMP is not set 271# CONFIG_INET_IPCOMP is not set
272# CONFIG_INET_XFRM_TUNNEL is not set
237# CONFIG_INET_TUNNEL is not set 273# CONFIG_INET_TUNNEL is not set
274CONFIG_INET_XFRM_MODE_TRANSPORT=y
275CONFIG_INET_XFRM_MODE_TUNNEL=y
276CONFIG_INET_XFRM_MODE_BEET=y
238CONFIG_INET_DIAG=y 277CONFIG_INET_DIAG=y
239CONFIG_INET_TCP_DIAG=y 278CONFIG_INET_TCP_DIAG=y
240# CONFIG_TCP_CONG_ADVANCED is not set 279# CONFIG_TCP_CONG_ADVANCED is not set
241CONFIG_TCP_CONG_BIC=y 280CONFIG_TCP_CONG_CUBIC=y
281CONFIG_DEFAULT_TCP_CONG="cubic"
282# CONFIG_TCP_MD5SIG is not set
242# CONFIG_IPV6 is not set 283# CONFIG_IPV6 is not set
284# CONFIG_INET6_XFRM_TUNNEL is not set
285# CONFIG_INET6_TUNNEL is not set
286# CONFIG_NETWORK_SECMARK is not set
243# CONFIG_NETFILTER is not set 287# CONFIG_NETFILTER is not set
244 288
245# 289#
@@ -265,7 +309,6 @@ CONFIG_TCP_CONG_BIC=y
265# CONFIG_ATALK is not set 309# CONFIG_ATALK is not set
266# CONFIG_X25 is not set 310# CONFIG_X25 is not set
267# CONFIG_LAPB is not set 311# CONFIG_LAPB is not set
268# CONFIG_NET_DIVERT is not set
269# CONFIG_ECONET is not set 312# CONFIG_ECONET is not set
270# CONFIG_WAN_ROUTER is not set 313# CONFIG_WAN_ROUTER is not set
271 314
@@ -294,6 +337,8 @@ CONFIG_STANDALONE=y
294CONFIG_PREVENT_FIRMWARE_BUILD=y 337CONFIG_PREVENT_FIRMWARE_BUILD=y
295CONFIG_FW_LOADER=m 338CONFIG_FW_LOADER=m
296# CONFIG_DEBUG_DRIVER is not set 339# CONFIG_DEBUG_DRIVER is not set
340# CONFIG_DEBUG_DEVRES is not set
341# CONFIG_SYS_HYPERVISOR is not set
297 342
298# 343#
299# Connector - unified userspace <-> kernelspace linker 344# Connector - unified userspace <-> kernelspace linker
@@ -337,11 +382,17 @@ CONFIG_BLK_DEV_NBD=m
337CONFIG_BLK_DEV_RAM=y 382CONFIG_BLK_DEV_RAM=y
338CONFIG_BLK_DEV_RAM_COUNT=16 383CONFIG_BLK_DEV_RAM_COUNT=16
339CONFIG_BLK_DEV_RAM_SIZE=4096 384CONFIG_BLK_DEV_RAM_SIZE=4096
340CONFIG_BLK_DEV_INITRD=y 385CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
341# CONFIG_CDROM_PKTCDVD is not set 386# CONFIG_CDROM_PKTCDVD is not set
342# CONFIG_ATA_OVER_ETH is not set 387# CONFIG_ATA_OVER_ETH is not set
343 388
344# 389#
390# Misc devices
391#
392CONFIG_SGI_IOC4=y
393# CONFIG_TIFM_CORE is not set
394
395#
345# ATA/ATAPI/MFM/RLL support 396# ATA/ATAPI/MFM/RLL support
346# 397#
347CONFIG_IDE=y 398CONFIG_IDE=y
@@ -358,6 +409,7 @@ CONFIG_BLK_DEV_IDECD=y
358# CONFIG_BLK_DEV_IDETAPE is not set 409# CONFIG_BLK_DEV_IDETAPE is not set
359CONFIG_BLK_DEV_IDEFLOPPY=y 410CONFIG_BLK_DEV_IDEFLOPPY=y
360CONFIG_BLK_DEV_IDESCSI=m 411CONFIG_BLK_DEV_IDESCSI=m
412# CONFIG_BLK_DEV_IDEACPI is not set
361# CONFIG_IDE_TASK_IOCTL is not set 413# CONFIG_IDE_TASK_IOCTL is not set
362 414
363# 415#
@@ -384,8 +436,10 @@ CONFIG_BLK_DEV_CMD64X=y
384# CONFIG_BLK_DEV_CS5530 is not set 436# CONFIG_BLK_DEV_CS5530 is not set
385# CONFIG_BLK_DEV_HPT34X is not set 437# CONFIG_BLK_DEV_HPT34X is not set
386# CONFIG_BLK_DEV_HPT366 is not set 438# CONFIG_BLK_DEV_HPT366 is not set
439# CONFIG_BLK_DEV_JMICRON is not set
387# CONFIG_BLK_DEV_SC1200 is not set 440# CONFIG_BLK_DEV_SC1200 is not set
388CONFIG_BLK_DEV_PIIX=y 441CONFIG_BLK_DEV_PIIX=y
442# CONFIG_BLK_DEV_IT8213 is not set
389# CONFIG_BLK_DEV_IT821X is not set 443# CONFIG_BLK_DEV_IT821X is not set
390# CONFIG_BLK_DEV_NS87415 is not set 444# CONFIG_BLK_DEV_NS87415 is not set
391# CONFIG_BLK_DEV_PDC202XX_OLD is not set 445# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -396,6 +450,7 @@ CONFIG_BLK_DEV_SGIIOC4=y
396# CONFIG_BLK_DEV_SLC90E66 is not set 450# CONFIG_BLK_DEV_SLC90E66 is not set
397# CONFIG_BLK_DEV_TRM290 is not set 451# CONFIG_BLK_DEV_TRM290 is not set
398# CONFIG_BLK_DEV_VIA82CXXX is not set 452# CONFIG_BLK_DEV_VIA82CXXX is not set
453# CONFIG_BLK_DEV_TC86C001 is not set
399# CONFIG_IDE_ARM is not set 454# CONFIG_IDE_ARM is not set
400CONFIG_BLK_DEV_IDEDMA=y 455CONFIG_BLK_DEV_IDEDMA=y
401# CONFIG_IDEDMA_IVB is not set 456# CONFIG_IDEDMA_IVB is not set
@@ -407,6 +462,8 @@ CONFIG_IDEDMA_AUTO=y
407# 462#
408# CONFIG_RAID_ATTRS is not set 463# CONFIG_RAID_ATTRS is not set
409CONFIG_SCSI=y 464CONFIG_SCSI=y
465# CONFIG_SCSI_TGT is not set
466CONFIG_SCSI_NETLINK=y
410CONFIG_SCSI_PROC_FS=y 467CONFIG_SCSI_PROC_FS=y
411 468
412# 469#
@@ -426,14 +483,16 @@ CONFIG_CHR_DEV_SG=m
426# CONFIG_SCSI_MULTI_LUN is not set 483# CONFIG_SCSI_MULTI_LUN is not set
427# CONFIG_SCSI_CONSTANTS is not set 484# CONFIG_SCSI_CONSTANTS is not set
428# CONFIG_SCSI_LOGGING is not set 485# CONFIG_SCSI_LOGGING is not set
486# CONFIG_SCSI_SCAN_ASYNC is not set
429 487
430# 488#
431# SCSI Transport Attributes 489# SCSI Transports
432# 490#
433CONFIG_SCSI_SPI_ATTRS=y 491CONFIG_SCSI_SPI_ATTRS=y
434CONFIG_SCSI_FC_ATTRS=y 492CONFIG_SCSI_FC_ATTRS=y
435# CONFIG_SCSI_ISCSI_ATTRS is not set 493# CONFIG_SCSI_ISCSI_ATTRS is not set
436# CONFIG_SCSI_SAS_ATTRS is not set 494# CONFIG_SCSI_SAS_ATTRS is not set
495# CONFIG_SCSI_SAS_LIBSAS is not set
437 496
438# 497#
439# SCSI low-level drivers 498# SCSI low-level drivers
@@ -446,43 +505,36 @@ CONFIG_SCSI_FC_ATTRS=y
446# CONFIG_SCSI_AIC7XXX is not set 505# CONFIG_SCSI_AIC7XXX is not set
447# CONFIG_SCSI_AIC7XXX_OLD is not set 506# CONFIG_SCSI_AIC7XXX_OLD is not set
448# CONFIG_SCSI_AIC79XX is not set 507# CONFIG_SCSI_AIC79XX is not set
508# CONFIG_SCSI_AIC94XX is not set
509# CONFIG_SCSI_ARCMSR is not set
449# CONFIG_MEGARAID_NEWGEN is not set 510# CONFIG_MEGARAID_NEWGEN is not set
450# CONFIG_MEGARAID_LEGACY is not set 511# CONFIG_MEGARAID_LEGACY is not set
451# CONFIG_MEGARAID_SAS is not set 512# CONFIG_MEGARAID_SAS is not set
452CONFIG_SCSI_SATA=y 513# CONFIG_SCSI_HPTIOP is not set
453# CONFIG_SCSI_SATA_AHCI is not set
454# CONFIG_SCSI_SATA_SVW is not set
455# CONFIG_SCSI_ATA_PIIX is not set
456# CONFIG_SCSI_SATA_MV is not set
457# CONFIG_SCSI_SATA_NV is not set
458# CONFIG_SCSI_PDC_ADMA is not set
459# CONFIG_SCSI_SATA_QSTOR is not set
460# CONFIG_SCSI_SATA_PROMISE is not set
461# CONFIG_SCSI_SATA_SX4 is not set
462# CONFIG_SCSI_SATA_SIL is not set
463# CONFIG_SCSI_SATA_SIL24 is not set
464# CONFIG_SCSI_SATA_SIS is not set
465# CONFIG_SCSI_SATA_ULI is not set
466# CONFIG_SCSI_SATA_VIA is not set
467CONFIG_SCSI_SATA_VITESSE=y
468# CONFIG_SCSI_DMX3191D is not set 514# CONFIG_SCSI_DMX3191D is not set
469# CONFIG_SCSI_FUTURE_DOMAIN is not set 515# CONFIG_SCSI_FUTURE_DOMAIN is not set
470# CONFIG_SCSI_IPS is not set 516# CONFIG_SCSI_IPS is not set
471# CONFIG_SCSI_INITIO is not set 517# CONFIG_SCSI_INITIO is not set
472# CONFIG_SCSI_INIA100 is not set 518# CONFIG_SCSI_INIA100 is not set
519# CONFIG_SCSI_STEX is not set
473CONFIG_SCSI_SYM53C8XX_2=y 520CONFIG_SCSI_SYM53C8XX_2=y
474CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 521CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
475CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 522CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
476CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 523CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
477# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 524CONFIG_SCSI_SYM53C8XX_MMIO=y
478# CONFIG_SCSI_IPR is not set
479# CONFIG_SCSI_QLOGIC_FC is not set
480CONFIG_SCSI_QLOGIC_1280=y 525CONFIG_SCSI_QLOGIC_1280=y
481# CONFIG_SCSI_QLA_FC is not set 526# CONFIG_SCSI_QLA_FC is not set
527# CONFIG_SCSI_QLA_ISCSI is not set
482# CONFIG_SCSI_LPFC is not set 528# CONFIG_SCSI_LPFC is not set
483# CONFIG_SCSI_DC395x is not set 529# CONFIG_SCSI_DC395x is not set
484# CONFIG_SCSI_DC390T is not set 530# CONFIG_SCSI_DC390T is not set
485# CONFIG_SCSI_DEBUG is not set 531# CONFIG_SCSI_DEBUG is not set
532# CONFIG_SCSI_SRP is not set
533
534#
535# Serial ATA (prod) and Parallel ATA (experimental) drivers
536#
537# CONFIG_ATA is not set
486 538
487# 539#
488# Multi-device support (RAID and LVM) 540# Multi-device support (RAID and LVM)
@@ -493,11 +545,11 @@ CONFIG_MD_LINEAR=m
493CONFIG_MD_RAID0=m 545CONFIG_MD_RAID0=m
494CONFIG_MD_RAID1=m 546CONFIG_MD_RAID1=m
495# CONFIG_MD_RAID10 is not set 547# CONFIG_MD_RAID10 is not set
496CONFIG_MD_RAID5=m 548# CONFIG_MD_RAID456 is not set
497CONFIG_MD_RAID6=m
498CONFIG_MD_MULTIPATH=m 549CONFIG_MD_MULTIPATH=m
499# CONFIG_MD_FAULTY is not set 550# CONFIG_MD_FAULTY is not set
500CONFIG_BLK_DEV_DM=m 551CONFIG_BLK_DEV_DM=m
552# CONFIG_DM_DEBUG is not set
501CONFIG_DM_CRYPT=m 553CONFIG_DM_CRYPT=m
502CONFIG_DM_SNAPSHOT=m 554CONFIG_DM_SNAPSHOT=m
503CONFIG_DM_MIRROR=m 555CONFIG_DM_MIRROR=m
@@ -587,6 +639,7 @@ CONFIG_E100=m
587# CONFIG_EPIC100 is not set 639# CONFIG_EPIC100 is not set
588# CONFIG_SUNDANCE is not set 640# CONFIG_SUNDANCE is not set
589# CONFIG_VIA_RHINE is not set 641# CONFIG_VIA_RHINE is not set
642# CONFIG_SC92031 is not set
590 643
591# 644#
592# Ethernet (1000 Mbit) 645# Ethernet (1000 Mbit)
@@ -607,13 +660,18 @@ CONFIG_E1000=y
607# CONFIG_VIA_VELOCITY is not set 660# CONFIG_VIA_VELOCITY is not set
608CONFIG_TIGON3=y 661CONFIG_TIGON3=y
609# CONFIG_BNX2 is not set 662# CONFIG_BNX2 is not set
663# CONFIG_QLA3XXX is not set
664# CONFIG_ATL1 is not set
610 665
611# 666#
612# Ethernet (10000 Mbit) 667# Ethernet (10000 Mbit)
613# 668#
614# CONFIG_CHELSIO_T1 is not set 669# CONFIG_CHELSIO_T1 is not set
670# CONFIG_CHELSIO_T3 is not set
615# CONFIG_IXGB is not set 671# CONFIG_IXGB is not set
616# CONFIG_S2IO is not set 672# CONFIG_S2IO is not set
673# CONFIG_MYRI10GE is not set
674# CONFIG_NETXEN_NIC is not set
617 675
618# 676#
619# Token Ring devices 677# Token Ring devices
@@ -655,6 +713,7 @@ CONFIG_NET_POLL_CONTROLLER=y
655# Input device support 713# Input device support
656# 714#
657CONFIG_INPUT=y 715CONFIG_INPUT=y
716# CONFIG_INPUT_FF_MEMLESS is not set
658 717
659# 718#
660# Userland interfaces 719# Userland interfaces
@@ -677,6 +736,7 @@ CONFIG_KEYBOARD_ATKBD=y
677# CONFIG_KEYBOARD_LKKBD is not set 736# CONFIG_KEYBOARD_LKKBD is not set
678# CONFIG_KEYBOARD_XTKBD is not set 737# CONFIG_KEYBOARD_XTKBD is not set
679# CONFIG_KEYBOARD_NEWTON is not set 738# CONFIG_KEYBOARD_NEWTON is not set
739# CONFIG_KEYBOARD_STOWAWAY is not set
680CONFIG_INPUT_MOUSE=y 740CONFIG_INPUT_MOUSE=y
681CONFIG_MOUSE_PS2=y 741CONFIG_MOUSE_PS2=y
682# CONFIG_MOUSE_SERIAL is not set 742# CONFIG_MOUSE_SERIAL is not set
@@ -706,6 +766,7 @@ CONFIG_GAMEPORT=m
706CONFIG_VT=y 766CONFIG_VT=y
707CONFIG_VT_CONSOLE=y 767CONFIG_VT_CONSOLE=y
708CONFIG_HW_CONSOLE=y 768CONFIG_HW_CONSOLE=y
769# CONFIG_VT_HW_CONSOLE_BINDING is not set
709CONFIG_SERIAL_NONSTANDARD=y 770CONFIG_SERIAL_NONSTANDARD=y
710# CONFIG_COMPUTONE is not set 771# CONFIG_COMPUTONE is not set
711# CONFIG_ROCKETPORT is not set 772# CONFIG_ROCKETPORT is not set
@@ -713,12 +774,14 @@ CONFIG_SERIAL_NONSTANDARD=y
713# CONFIG_DIGIEPCA is not set 774# CONFIG_DIGIEPCA is not set
714# CONFIG_MOXA_INTELLIO is not set 775# CONFIG_MOXA_INTELLIO is not set
715# CONFIG_MOXA_SMARTIO is not set 776# CONFIG_MOXA_SMARTIO is not set
777# CONFIG_MOXA_SMARTIO_NEW is not set
716# CONFIG_ISI is not set 778# CONFIG_ISI is not set
717# CONFIG_SYNCLINKMP is not set 779# CONFIG_SYNCLINKMP is not set
718# CONFIG_SYNCLINK_GT is not set 780# CONFIG_SYNCLINK_GT is not set
719# CONFIG_N_HDLC is not set 781# CONFIG_N_HDLC is not set
720# CONFIG_SPECIALIX is not set 782# CONFIG_SPECIALIX is not set
721# CONFIG_SX is not set 783# CONFIG_SX is not set
784# CONFIG_RIO is not set
722# CONFIG_STALDRV is not set 785# CONFIG_STALDRV is not set
723CONFIG_SGI_SNSC=y 786CONFIG_SGI_SNSC=y
724CONFIG_SGI_TIOCX=y 787CONFIG_SGI_TIOCX=y
@@ -729,7 +792,8 @@ CONFIG_SGI_MBCS=m
729# 792#
730CONFIG_SERIAL_8250=y 793CONFIG_SERIAL_8250=y
731CONFIG_SERIAL_8250_CONSOLE=y 794CONFIG_SERIAL_8250_CONSOLE=y
732CONFIG_SERIAL_8250_ACPI=y 795CONFIG_SERIAL_8250_PCI=y
796CONFIG_SERIAL_8250_PNP=y
733CONFIG_SERIAL_8250_NR_UARTS=6 797CONFIG_SERIAL_8250_NR_UARTS=6
734CONFIG_SERIAL_8250_RUNTIME_UARTS=4 798CONFIG_SERIAL_8250_RUNTIME_UARTS=4
735CONFIG_SERIAL_8250_EXTENDED=y 799CONFIG_SERIAL_8250_EXTENDED=y
@@ -764,10 +828,6 @@ CONFIG_EFI_RTC=y
764# CONFIG_DTLK is not set 828# CONFIG_DTLK is not set
765# CONFIG_R3964 is not set 829# CONFIG_R3964 is not set
766# CONFIG_APPLICOM is not set 830# CONFIG_APPLICOM is not set
767
768#
769# Ftape, the floppy tape device driver
770#
771CONFIG_AGP=m 831CONFIG_AGP=m
772CONFIG_AGP_I460=m 832CONFIG_AGP_I460=m
773CONFIG_AGP_HP_ZX1=m 833CONFIG_AGP_HP_ZX1=m
@@ -792,7 +852,6 @@ CONFIG_MMTIMER=y
792# TPM devices 852# TPM devices
793# 853#
794# CONFIG_TCG_TPM is not set 854# CONFIG_TCG_TPM is not set
795# CONFIG_TELCLOCK is not set
796 855
797# 856#
798# I2C support 857# I2C support
@@ -815,16 +874,16 @@ CONFIG_MMTIMER=y
815# 874#
816CONFIG_HWMON=y 875CONFIG_HWMON=y
817# CONFIG_HWMON_VID is not set 876# CONFIG_HWMON_VID is not set
877# CONFIG_SENSORS_ABITUGURU is not set
818# CONFIG_SENSORS_F71805F is not set 878# CONFIG_SENSORS_F71805F is not set
879# CONFIG_SENSORS_PC87427 is not set
880# CONFIG_SENSORS_VT1211 is not set
819# CONFIG_HWMON_DEBUG_CHIP is not set 881# CONFIG_HWMON_DEBUG_CHIP is not set
820 882
821# 883#
822# Misc devices 884# Multifunction device drivers
823#
824
825#
826# Multimedia Capabilities Port drivers
827# 885#
886# CONFIG_MFD_SM501 is not set
828 887
829# 888#
830# Multimedia devices 889# Multimedia devices
@@ -835,16 +894,19 @@ CONFIG_HWMON=y
835# Digital Video Broadcasting Devices 894# Digital Video Broadcasting Devices
836# 895#
837# CONFIG_DVB is not set 896# CONFIG_DVB is not set
897# CONFIG_USB_DABUSB is not set
838 898
839# 899#
840# Graphics support 900# Graphics support
841# 901#
902# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
842# CONFIG_FB is not set 903# CONFIG_FB is not set
843 904
844# 905#
845# Console display driver support 906# Console display driver support
846# 907#
847CONFIG_VGA_CONSOLE=y 908CONFIG_VGA_CONSOLE=y
909# CONFIG_VGACON_SOFT_SCROLLBACK is not set
848CONFIG_DUMMY_CONSOLE=y 910CONFIG_DUMMY_CONSOLE=y
849 911
850# 912#
@@ -865,9 +927,11 @@ CONFIG_SND_SEQ_DUMMY=m
865CONFIG_SND_OSSEMUL=y 927CONFIG_SND_OSSEMUL=y
866CONFIG_SND_MIXER_OSS=m 928CONFIG_SND_MIXER_OSS=m
867CONFIG_SND_PCM_OSS=m 929CONFIG_SND_PCM_OSS=m
930CONFIG_SND_PCM_OSS_PLUGINS=y
868CONFIG_SND_SEQUENCER_OSS=y 931CONFIG_SND_SEQUENCER_OSS=y
869# CONFIG_SND_DYNAMIC_MINORS is not set 932# CONFIG_SND_DYNAMIC_MINORS is not set
870CONFIG_SND_SUPPORT_OLD_API=y 933CONFIG_SND_SUPPORT_OLD_API=y
934CONFIG_SND_VERBOSE_PROCFS=y
871CONFIG_SND_VERBOSE_PRINTK=y 935CONFIG_SND_VERBOSE_PRINTK=y
872# CONFIG_SND_DEBUG is not set 936# CONFIG_SND_DEBUG is not set
873 937
@@ -877,7 +941,6 @@ CONFIG_SND_VERBOSE_PRINTK=y
877CONFIG_SND_MPU401_UART=m 941CONFIG_SND_MPU401_UART=m
878CONFIG_SND_OPL3_LIB=m 942CONFIG_SND_OPL3_LIB=m
879CONFIG_SND_AC97_CODEC=m 943CONFIG_SND_AC97_CODEC=m
880CONFIG_SND_AC97_BUS=m
881CONFIG_SND_DUMMY=m 944CONFIG_SND_DUMMY=m
882CONFIG_SND_VIRMIDI=m 945CONFIG_SND_VIRMIDI=m
883CONFIG_SND_MTPAV=m 946CONFIG_SND_MTPAV=m
@@ -888,6 +951,7 @@ CONFIG_SND_MPU401=m
888# PCI devices 951# PCI devices
889# 952#
890# CONFIG_SND_AD1889 is not set 953# CONFIG_SND_AD1889 is not set
954# CONFIG_SND_ALS300 is not set
891# CONFIG_SND_ALI5451 is not set 955# CONFIG_SND_ALI5451 is not set
892# CONFIG_SND_ATIIXP is not set 956# CONFIG_SND_ATIIXP is not set
893# CONFIG_SND_ATIIXP_MODEM is not set 957# CONFIG_SND_ATIIXP_MODEM is not set
@@ -901,6 +965,18 @@ CONFIG_SND_MPU401=m
901CONFIG_SND_CS4281=m 965CONFIG_SND_CS4281=m
902CONFIG_SND_CS46XX=m 966CONFIG_SND_CS46XX=m
903CONFIG_SND_CS46XX_NEW_DSP=y 967CONFIG_SND_CS46XX_NEW_DSP=y
968# CONFIG_SND_DARLA20 is not set
969# CONFIG_SND_GINA20 is not set
970# CONFIG_SND_LAYLA20 is not set
971# CONFIG_SND_DARLA24 is not set
972# CONFIG_SND_GINA24 is not set
973# CONFIG_SND_LAYLA24 is not set
974# CONFIG_SND_MONA is not set
975# CONFIG_SND_MIA is not set
976# CONFIG_SND_ECHO3G is not set
977# CONFIG_SND_INDIGO is not set
978# CONFIG_SND_INDIGOIO is not set
979# CONFIG_SND_INDIGODJ is not set
904CONFIG_SND_EMU10K1=m 980CONFIG_SND_EMU10K1=m
905# CONFIG_SND_EMU10K1X is not set 981# CONFIG_SND_EMU10K1X is not set
906# CONFIG_SND_ENS1370 is not set 982# CONFIG_SND_ENS1370 is not set
@@ -908,7 +984,7 @@ CONFIG_SND_EMU10K1=m
908# CONFIG_SND_ES1938 is not set 984# CONFIG_SND_ES1938 is not set
909# CONFIG_SND_ES1968 is not set 985# CONFIG_SND_ES1968 is not set
910CONFIG_SND_FM801=m 986CONFIG_SND_FM801=m
911# CONFIG_SND_FM801_TEA575X is not set 987# CONFIG_SND_FM801_TEA575X_BOOL is not set
912# CONFIG_SND_HDA_INTEL is not set 988# CONFIG_SND_HDA_INTEL is not set
913# CONFIG_SND_HDSP is not set 989# CONFIG_SND_HDSP is not set
914# CONFIG_SND_HDSPM is not set 990# CONFIG_SND_HDSPM is not set
@@ -921,6 +997,7 @@ CONFIG_SND_FM801=m
921# CONFIG_SND_MIXART is not set 997# CONFIG_SND_MIXART is not set
922# CONFIG_SND_NM256 is not set 998# CONFIG_SND_NM256 is not set
923# CONFIG_SND_PCXHR is not set 999# CONFIG_SND_PCXHR is not set
1000# CONFIG_SND_RIPTIDE is not set
924# CONFIG_SND_RME32 is not set 1001# CONFIG_SND_RME32 is not set
925# CONFIG_SND_RME96 is not set 1002# CONFIG_SND_RME96 is not set
926# CONFIG_SND_RME9652 is not set 1003# CONFIG_SND_RME9652 is not set
@@ -930,6 +1007,7 @@ CONFIG_SND_FM801=m
930# CONFIG_SND_VIA82XX_MODEM is not set 1007# CONFIG_SND_VIA82XX_MODEM is not set
931# CONFIG_SND_VX222 is not set 1008# CONFIG_SND_VX222 is not set
932# CONFIG_SND_YMFPCI is not set 1009# CONFIG_SND_YMFPCI is not set
1010# CONFIG_SND_AC97_POWER_SAVE is not set
933 1011
934# 1012#
935# USB devices 1013# USB devices
@@ -937,15 +1015,28 @@ CONFIG_SND_FM801=m
937# CONFIG_SND_USB_AUDIO is not set 1015# CONFIG_SND_USB_AUDIO is not set
938 1016
939# 1017#
1018# SoC audio support
1019#
1020# CONFIG_SND_SOC is not set
1021
1022#
940# Open Sound System 1023# Open Sound System
941# 1024#
942# CONFIG_SOUND_PRIME is not set 1025# CONFIG_SOUND_PRIME is not set
1026CONFIG_AC97_BUS=m
1027
1028#
1029# HID Devices
1030#
1031CONFIG_HID=y
1032# CONFIG_HID_DEBUG is not set
943 1033
944# 1034#
945# USB support 1035# USB support
946# 1036#
947CONFIG_USB_ARCH_HAS_HCD=y 1037CONFIG_USB_ARCH_HAS_HCD=y
948CONFIG_USB_ARCH_HAS_OHCI=y 1038CONFIG_USB_ARCH_HAS_OHCI=y
1039CONFIG_USB_ARCH_HAS_EHCI=y
949CONFIG_USB=m 1040CONFIG_USB=m
950# CONFIG_USB_DEBUG is not set 1041# CONFIG_USB_DEBUG is not set
951 1042
@@ -953,7 +1044,6 @@ CONFIG_USB=m
953# Miscellaneous USB options 1044# Miscellaneous USB options
954# 1045#
955CONFIG_USB_DEVICEFS=y 1046CONFIG_USB_DEVICEFS=y
956# CONFIG_USB_BANDWIDTH is not set
957# CONFIG_USB_DYNAMIC_MINORS is not set 1047# CONFIG_USB_DYNAMIC_MINORS is not set
958# CONFIG_USB_SUSPEND is not set 1048# CONFIG_USB_SUSPEND is not set
959# CONFIG_USB_OTG is not set 1049# CONFIG_USB_OTG is not set
@@ -964,9 +1054,12 @@ CONFIG_USB_DEVICEFS=y
964CONFIG_USB_EHCI_HCD=m 1054CONFIG_USB_EHCI_HCD=m
965# CONFIG_USB_EHCI_SPLIT_ISO is not set 1055# CONFIG_USB_EHCI_SPLIT_ISO is not set
966# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1056# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1057# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1058# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
967# CONFIG_USB_ISP116X_HCD is not set 1059# CONFIG_USB_ISP116X_HCD is not set
968CONFIG_USB_OHCI_HCD=m 1060CONFIG_USB_OHCI_HCD=m
969# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1061# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1062# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
970CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1063CONFIG_USB_OHCI_LITTLE_ENDIAN=y
971CONFIG_USB_UHCI_HCD=m 1064CONFIG_USB_UHCI_HCD=m
972# CONFIG_USB_SL811_HCD is not set 1065# CONFIG_USB_SL811_HCD is not set
@@ -974,7 +1067,6 @@ CONFIG_USB_UHCI_HCD=m
974# 1067#
975# USB Device Class drivers 1068# USB Device Class drivers
976# 1069#
977# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
978# CONFIG_USB_ACM is not set 1070# CONFIG_USB_ACM is not set
979# CONFIG_USB_PRINTER is not set 1071# CONFIG_USB_PRINTER is not set
980 1072
@@ -996,13 +1088,13 @@ CONFIG_USB_STORAGE=m
996# CONFIG_USB_STORAGE_SDDR55 is not set 1088# CONFIG_USB_STORAGE_SDDR55 is not set
997# CONFIG_USB_STORAGE_JUMPSHOT is not set 1089# CONFIG_USB_STORAGE_JUMPSHOT is not set
998# CONFIG_USB_STORAGE_ALAUDA is not set 1090# CONFIG_USB_STORAGE_ALAUDA is not set
1091# CONFIG_USB_STORAGE_KARMA is not set
999# CONFIG_USB_LIBUSUAL is not set 1092# CONFIG_USB_LIBUSUAL is not set
1000 1093
1001# 1094#
1002# USB Input Devices 1095# USB Input Devices
1003# 1096#
1004CONFIG_USB_HID=m 1097CONFIG_USB_HID=m
1005CONFIG_USB_HIDINPUT=y
1006# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1098# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1007# CONFIG_HID_FF is not set 1099# CONFIG_HID_FF is not set
1008# CONFIG_USB_HIDDEV is not set 1100# CONFIG_USB_HIDDEV is not set
@@ -1017,15 +1109,14 @@ CONFIG_USB_HIDINPUT=y
1017# CONFIG_USB_ACECAD is not set 1109# CONFIG_USB_ACECAD is not set
1018# CONFIG_USB_KBTAB is not set 1110# CONFIG_USB_KBTAB is not set
1019# CONFIG_USB_POWERMATE is not set 1111# CONFIG_USB_POWERMATE is not set
1020# CONFIG_USB_MTOUCH is not set 1112# CONFIG_USB_TOUCHSCREEN is not set
1021# CONFIG_USB_ITMTOUCH is not set
1022# CONFIG_USB_EGALAX is not set
1023# CONFIG_USB_YEALINK is not set 1113# CONFIG_USB_YEALINK is not set
1024# CONFIG_USB_XPAD is not set 1114# CONFIG_USB_XPAD is not set
1025# CONFIG_USB_ATI_REMOTE is not set 1115# CONFIG_USB_ATI_REMOTE is not set
1026# CONFIG_USB_ATI_REMOTE2 is not set 1116# CONFIG_USB_ATI_REMOTE2 is not set
1027# CONFIG_USB_KEYSPAN_REMOTE is not set 1117# CONFIG_USB_KEYSPAN_REMOTE is not set
1028# CONFIG_USB_APPLETOUCH is not set 1118# CONFIG_USB_APPLETOUCH is not set
1119# CONFIG_USB_GTCO is not set
1029 1120
1030# 1121#
1031# USB Imaging devices 1122# USB Imaging devices
@@ -1034,21 +1125,13 @@ CONFIG_USB_HIDINPUT=y
1034# CONFIG_USB_MICROTEK is not set 1125# CONFIG_USB_MICROTEK is not set
1035 1126
1036# 1127#
1037# USB Multimedia devices
1038#
1039# CONFIG_USB_DABUSB is not set
1040
1041#
1042# Video4Linux support is needed for USB Multimedia device support
1043#
1044
1045#
1046# USB Network Adapters 1128# USB Network Adapters
1047# 1129#
1048# CONFIG_USB_CATC is not set 1130# CONFIG_USB_CATC is not set
1049# CONFIG_USB_KAWETH is not set 1131# CONFIG_USB_KAWETH is not set
1050# CONFIG_USB_PEGASUS is not set 1132# CONFIG_USB_PEGASUS is not set
1051# CONFIG_USB_RTL8150 is not set 1133# CONFIG_USB_RTL8150 is not set
1134# CONFIG_USB_USBNET_MII is not set
1052# CONFIG_USB_USBNET is not set 1135# CONFIG_USB_USBNET is not set
1053CONFIG_USB_MON=y 1136CONFIG_USB_MON=y
1054 1137
@@ -1066,17 +1149,23 @@ CONFIG_USB_MON=y
1066# 1149#
1067# CONFIG_USB_EMI62 is not set 1150# CONFIG_USB_EMI62 is not set
1068# CONFIG_USB_EMI26 is not set 1151# CONFIG_USB_EMI26 is not set
1152# CONFIG_USB_ADUTUX is not set
1069# CONFIG_USB_AUERSWALD is not set 1153# CONFIG_USB_AUERSWALD is not set
1070# CONFIG_USB_RIO500 is not set 1154# CONFIG_USB_RIO500 is not set
1071# CONFIG_USB_LEGOTOWER is not set 1155# CONFIG_USB_LEGOTOWER is not set
1072# CONFIG_USB_LCD is not set 1156# CONFIG_USB_LCD is not set
1157# CONFIG_USB_BERRY_CHARGE is not set
1073# CONFIG_USB_LED is not set 1158# CONFIG_USB_LED is not set
1159# CONFIG_USB_CYPRESS_CY7C63 is not set
1074# CONFIG_USB_CYTHERM is not set 1160# CONFIG_USB_CYTHERM is not set
1075# CONFIG_USB_PHIDGETKIT is not set 1161# CONFIG_USB_PHIDGET is not set
1076# CONFIG_USB_PHIDGETSERVO is not set
1077# CONFIG_USB_IDMOUSE is not set 1162# CONFIG_USB_IDMOUSE is not set
1163# CONFIG_USB_FTDI_ELAN is not set
1164# CONFIG_USB_APPLEDISPLAY is not set
1078# CONFIG_USB_SISUSBVGA is not set 1165# CONFIG_USB_SISUSBVGA is not set
1079# CONFIG_USB_LD is not set 1166# CONFIG_USB_LD is not set
1167# CONFIG_USB_TRANCEVIBRATOR is not set
1168# CONFIG_USB_IOWARRIOR is not set
1080# CONFIG_USB_TEST is not set 1169# CONFIG_USB_TEST is not set
1081 1170
1082# 1171#
@@ -1094,26 +1183,65 @@ CONFIG_USB_MON=y
1094# CONFIG_MMC is not set 1183# CONFIG_MMC is not set
1095 1184
1096# 1185#
1186# LED devices
1187#
1188# CONFIG_NEW_LEDS is not set
1189
1190#
1191# LED drivers
1192#
1193
1194#
1195# LED Triggers
1196#
1197
1198#
1097# InfiniBand support 1199# InfiniBand support
1098# 1200#
1099CONFIG_INFINIBAND=m 1201CONFIG_INFINIBAND=m
1100# CONFIG_INFINIBAND_USER_MAD is not set 1202# CONFIG_INFINIBAND_USER_MAD is not set
1101# CONFIG_INFINIBAND_USER_ACCESS is not set 1203# CONFIG_INFINIBAND_USER_ACCESS is not set
1204CONFIG_INFINIBAND_ADDR_TRANS=y
1102CONFIG_INFINIBAND_MTHCA=m 1205CONFIG_INFINIBAND_MTHCA=m
1103# CONFIG_INFINIBAND_MTHCA_DEBUG is not set 1206CONFIG_INFINIBAND_MTHCA_DEBUG=y
1207# CONFIG_INFINIBAND_AMSO1100 is not set
1104CONFIG_INFINIBAND_IPOIB=m 1208CONFIG_INFINIBAND_IPOIB=m
1105# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 1209# CONFIG_INFINIBAND_IPOIB_CM is not set
1210CONFIG_INFINIBAND_IPOIB_DEBUG=y
1211# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
1106# CONFIG_INFINIBAND_SRP is not set 1212# CONFIG_INFINIBAND_SRP is not set
1213# CONFIG_INFINIBAND_ISER is not set
1107 1214
1108# 1215#
1109# SN Devices 1216# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1217#
1218
1219#
1220# Real Time Clock
1221#
1222# CONFIG_RTC_CLASS is not set
1223
1224#
1225# DMA Engine support
1226#
1227# CONFIG_DMA_ENGINE is not set
1228
1229#
1230# DMA Clients
1231#
1232
1233#
1234# DMA Devices
1235#
1236
1237#
1238# Auxiliary Display support
1110# 1239#
1111CONFIG_SGI_IOC4=y
1112CONFIG_SGI_IOC3=m
1113 1240
1114# 1241#
1115# EDAC - error detection and reporting (RAS) 1242# Virtualization
1116# 1243#
1244# CONFIG_MSPEC is not set
1117 1245
1118# 1246#
1119# File systems 1247# File systems
@@ -1127,6 +1255,7 @@ CONFIG_EXT3_FS=y
1127CONFIG_EXT3_FS_XATTR=y 1255CONFIG_EXT3_FS_XATTR=y
1128CONFIG_EXT3_FS_POSIX_ACL=y 1256CONFIG_EXT3_FS_POSIX_ACL=y
1129CONFIG_EXT3_FS_SECURITY=y 1257CONFIG_EXT3_FS_SECURITY=y
1258# CONFIG_EXT4DEV_FS is not set
1130CONFIG_JBD=y 1259CONFIG_JBD=y
1131# CONFIG_JBD_DEBUG is not set 1260# CONFIG_JBD_DEBUG is not set
1132CONFIG_FS_MBCACHE=y 1261CONFIG_FS_MBCACHE=y
@@ -1139,15 +1268,16 @@ CONFIG_REISERFS_FS_SECURITY=y
1139# CONFIG_JFS_FS is not set 1268# CONFIG_JFS_FS is not set
1140CONFIG_FS_POSIX_ACL=y 1269CONFIG_FS_POSIX_ACL=y
1141CONFIG_XFS_FS=y 1270CONFIG_XFS_FS=y
1142CONFIG_XFS_EXPORT=y
1143# CONFIG_XFS_QUOTA is not set 1271# CONFIG_XFS_QUOTA is not set
1144# CONFIG_XFS_SECURITY is not set 1272# CONFIG_XFS_SECURITY is not set
1145# CONFIG_XFS_POSIX_ACL is not set 1273# CONFIG_XFS_POSIX_ACL is not set
1146# CONFIG_XFS_RT is not set 1274# CONFIG_XFS_RT is not set
1275# CONFIG_GFS2_FS is not set
1147# CONFIG_OCFS2_FS is not set 1276# CONFIG_OCFS2_FS is not set
1148# CONFIG_MINIX_FS is not set 1277# CONFIG_MINIX_FS is not set
1149# CONFIG_ROMFS_FS is not set 1278# CONFIG_ROMFS_FS is not set
1150CONFIG_INOTIFY=y 1279CONFIG_INOTIFY=y
1280CONFIG_INOTIFY_USER=y
1151# CONFIG_QUOTA is not set 1281# CONFIG_QUOTA is not set
1152CONFIG_DNOTIFY=y 1282CONFIG_DNOTIFY=y
1153CONFIG_AUTOFS_FS=y 1283CONFIG_AUTOFS_FS=y
@@ -1180,12 +1310,14 @@ CONFIG_NTFS_FS=m
1180# 1310#
1181CONFIG_PROC_FS=y 1311CONFIG_PROC_FS=y
1182CONFIG_PROC_KCORE=y 1312CONFIG_PROC_KCORE=y
1313CONFIG_PROC_VMCORE=y
1314CONFIG_PROC_SYSCTL=y
1183CONFIG_SYSFS=y 1315CONFIG_SYSFS=y
1184CONFIG_TMPFS=y 1316CONFIG_TMPFS=y
1317# CONFIG_TMPFS_POSIX_ACL is not set
1185CONFIG_HUGETLBFS=y 1318CONFIG_HUGETLBFS=y
1186CONFIG_HUGETLB_PAGE=y 1319CONFIG_HUGETLB_PAGE=y
1187CONFIG_RAMFS=y 1320CONFIG_RAMFS=y
1188# CONFIG_RELAYFS_FS is not set
1189# CONFIG_CONFIGFS_FS is not set 1321# CONFIG_CONFIGFS_FS is not set
1190 1322
1191# 1323#
@@ -1220,7 +1352,7 @@ CONFIG_NFSD_V4=y
1220CONFIG_NFSD_TCP=y 1352CONFIG_NFSD_TCP=y
1221CONFIG_LOCKD=m 1353CONFIG_LOCKD=m
1222CONFIG_LOCKD_V4=y 1354CONFIG_LOCKD_V4=y
1223CONFIG_EXPORTFS=y 1355CONFIG_EXPORTFS=m
1224CONFIG_NFS_COMMON=y 1356CONFIG_NFS_COMMON=y
1225CONFIG_SUNRPC=m 1357CONFIG_SUNRPC=m
1226CONFIG_SUNRPC_GSS=m 1358CONFIG_SUNRPC_GSS=m
@@ -1231,7 +1363,9 @@ CONFIG_SMB_NLS_DEFAULT=y
1231CONFIG_SMB_NLS_REMOTE="cp437" 1363CONFIG_SMB_NLS_REMOTE="cp437"
1232CONFIG_CIFS=m 1364CONFIG_CIFS=m
1233# CONFIG_CIFS_STATS is not set 1365# CONFIG_CIFS_STATS is not set
1366# CONFIG_CIFS_WEAK_PW_HASH is not set
1234# CONFIG_CIFS_XATTR is not set 1367# CONFIG_CIFS_XATTR is not set
1368# CONFIG_CIFS_DEBUG2 is not set
1235# CONFIG_CIFS_EXPERIMENTAL is not set 1369# CONFIG_CIFS_EXPERIMENTAL is not set
1236# CONFIG_NCP_FS is not set 1370# CONFIG_NCP_FS is not set
1237# CONFIG_CODA_FS is not set 1371# CONFIG_CODA_FS is not set
@@ -1304,15 +1438,25 @@ CONFIG_NLS_KOI8_U=m
1304CONFIG_NLS_UTF8=m 1438CONFIG_NLS_UTF8=m
1305 1439
1306# 1440#
1441# Distributed Lock Manager
1442#
1443# CONFIG_DLM is not set
1444
1445#
1307# Library routines 1446# Library routines
1308# 1447#
1448CONFIG_BITREVERSE=y
1309# CONFIG_CRC_CCITT is not set 1449# CONFIG_CRC_CCITT is not set
1310# CONFIG_CRC16 is not set 1450# CONFIG_CRC16 is not set
1311CONFIG_CRC32=y 1451CONFIG_CRC32=y
1312# CONFIG_LIBCRC32C is not set 1452# CONFIG_LIBCRC32C is not set
1453CONFIG_PLIST=y
1454CONFIG_HAS_IOMEM=y
1455CONFIG_HAS_IOPORT=y
1313CONFIG_GENERIC_HARDIRQS=y 1456CONFIG_GENERIC_HARDIRQS=y
1314CONFIG_GENERIC_IRQ_PROBE=y 1457CONFIG_GENERIC_IRQ_PROBE=y
1315CONFIG_GENERIC_PENDING_IRQ=y 1458CONFIG_GENERIC_PENDING_IRQ=y
1459CONFIG_IRQ_PER_CPU=y
1316 1460
1317# 1461#
1318# HP Simulator drivers 1462# HP Simulator drivers
@@ -1331,21 +1475,31 @@ CONFIG_GENERIC_PENDING_IRQ=y
1331# Kernel hacking 1475# Kernel hacking
1332# 1476#
1333# CONFIG_PRINTK_TIME is not set 1477# CONFIG_PRINTK_TIME is not set
1478CONFIG_ENABLE_MUST_CHECK=y
1334CONFIG_MAGIC_SYSRQ=y 1479CONFIG_MAGIC_SYSRQ=y
1480# CONFIG_UNUSED_SYMBOLS is not set
1481# CONFIG_DEBUG_FS is not set
1482# CONFIG_HEADERS_CHECK is not set
1335CONFIG_DEBUG_KERNEL=y 1483CONFIG_DEBUG_KERNEL=y
1484# CONFIG_DEBUG_SHIRQ is not set
1336CONFIG_LOG_BUF_SHIFT=20 1485CONFIG_LOG_BUF_SHIFT=20
1337CONFIG_DETECT_SOFTLOCKUP=y 1486CONFIG_DETECT_SOFTLOCKUP=y
1338# CONFIG_SCHEDSTATS is not set 1487# CONFIG_SCHEDSTATS is not set
1488# CONFIG_TIMER_STATS is not set
1339# CONFIG_DEBUG_SLAB is not set 1489# CONFIG_DEBUG_SLAB is not set
1340CONFIG_DEBUG_MUTEXES=y 1490# CONFIG_DEBUG_RT_MUTEXES is not set
1491# CONFIG_RT_MUTEX_TESTER is not set
1341# CONFIG_DEBUG_SPINLOCK is not set 1492# CONFIG_DEBUG_SPINLOCK is not set
1493CONFIG_DEBUG_MUTEXES=y
1342# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1494# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1495# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1343# CONFIG_DEBUG_KOBJECT is not set 1496# CONFIG_DEBUG_KOBJECT is not set
1344# CONFIG_DEBUG_INFO is not set 1497# CONFIG_DEBUG_INFO is not set
1345# CONFIG_DEBUG_FS is not set
1346# CONFIG_DEBUG_VM is not set 1498# CONFIG_DEBUG_VM is not set
1499# CONFIG_DEBUG_LIST is not set
1347CONFIG_FORCED_INLINING=y 1500CONFIG_FORCED_INLINING=y
1348# CONFIG_RCU_TORTURE_TEST is not set 1501# CONFIG_RCU_TORTURE_TEST is not set
1502# CONFIG_FAULT_INJECTION is not set
1349CONFIG_IA64_GRANULE_16MB=y 1503CONFIG_IA64_GRANULE_16MB=y
1350# CONFIG_IA64_GRANULE_64MB is not set 1504# CONFIG_IA64_GRANULE_64MB is not set
1351# CONFIG_IA64_PRINT_HAZARDS is not set 1505# CONFIG_IA64_PRINT_HAZARDS is not set
@@ -1364,7 +1518,11 @@ CONFIG_SYSVIPC_COMPAT=y
1364# Cryptographic options 1518# Cryptographic options
1365# 1519#
1366CONFIG_CRYPTO=y 1520CONFIG_CRYPTO=y
1521CONFIG_CRYPTO_ALGAPI=y
1522CONFIG_CRYPTO_BLKCIPHER=m
1523CONFIG_CRYPTO_MANAGER=m
1367# CONFIG_CRYPTO_HMAC is not set 1524# CONFIG_CRYPTO_HMAC is not set
1525# CONFIG_CRYPTO_XCBC is not set
1368# CONFIG_CRYPTO_NULL is not set 1526# CONFIG_CRYPTO_NULL is not set
1369# CONFIG_CRYPTO_MD4 is not set 1527# CONFIG_CRYPTO_MD4 is not set
1370CONFIG_CRYPTO_MD5=y 1528CONFIG_CRYPTO_MD5=y
@@ -1373,7 +1531,13 @@ CONFIG_CRYPTO_MD5=y
1373# CONFIG_CRYPTO_SHA512 is not set 1531# CONFIG_CRYPTO_SHA512 is not set
1374# CONFIG_CRYPTO_WP512 is not set 1532# CONFIG_CRYPTO_WP512 is not set
1375# CONFIG_CRYPTO_TGR192 is not set 1533# CONFIG_CRYPTO_TGR192 is not set
1534# CONFIG_CRYPTO_GF128MUL is not set
1535CONFIG_CRYPTO_ECB=m
1536CONFIG_CRYPTO_CBC=m
1537CONFIG_CRYPTO_PCBC=m
1538# CONFIG_CRYPTO_LRW is not set
1376CONFIG_CRYPTO_DES=m 1539CONFIG_CRYPTO_DES=m
1540# CONFIG_CRYPTO_FCRYPT is not set
1377# CONFIG_CRYPTO_BLOWFISH is not set 1541# CONFIG_CRYPTO_BLOWFISH is not set
1378# CONFIG_CRYPTO_TWOFISH is not set 1542# CONFIG_CRYPTO_TWOFISH is not set
1379# CONFIG_CRYPTO_SERPENT is not set 1543# CONFIG_CRYPTO_SERPENT is not set
@@ -1387,6 +1551,7 @@ CONFIG_CRYPTO_DES=m
1387# CONFIG_CRYPTO_DEFLATE is not set 1551# CONFIG_CRYPTO_DEFLATE is not set
1388# CONFIG_CRYPTO_MICHAEL_MIC is not set 1552# CONFIG_CRYPTO_MICHAEL_MIC is not set
1389# CONFIG_CRYPTO_CRC32C is not set 1553# CONFIG_CRYPTO_CRC32C is not set
1554# CONFIG_CRYPTO_CAMELLIA is not set
1390# CONFIG_CRYPTO_TEST is not set 1555# CONFIG_CRYPTO_TEST is not set
1391 1556
1392# 1557#
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index d430d36ae49d..0afb4fe7c35b 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -1267,6 +1267,10 @@ sys32_getdents (unsigned int fd, struct compat_dirent __user *dirent, unsigned i
1267 struct getdents32_callback buf; 1267 struct getdents32_callback buf;
1268 int error; 1268 int error;
1269 1269
1270 error = -EFAULT;
1271 if (!access_ok(VERIFY_WRITE, dirent, count))
1272 goto out;
1273
1270 error = -EBADF; 1274 error = -EBADF;
1271 file = fget(fd); 1275 file = fget(fd);
1272 if (!file) 1276 if (!file)
@@ -1283,10 +1287,10 @@ sys32_getdents (unsigned int fd, struct compat_dirent __user *dirent, unsigned i
1283 error = buf.error; 1287 error = buf.error;
1284 lastdirent = buf.previous; 1288 lastdirent = buf.previous;
1285 if (lastdirent) { 1289 if (lastdirent) {
1286 error = -EINVAL;
1287 if (put_user(file->f_pos, &lastdirent->d_off)) 1290 if (put_user(file->f_pos, &lastdirent->d_off))
1288 goto out_putf; 1291 error = -EFAULT;
1289 error = count - buf.count; 1292 else
1293 error = count - buf.count;
1290 } 1294 }
1291 1295
1292out_putf: 1296out_putf:
diff --git a/arch/ia64/kernel/asm-offsets.c b/arch/ia64/kernel/asm-offsets.c
index 75a2a2c12258..2236fabbb3c6 100644
--- a/arch/ia64/kernel/asm-offsets.c
+++ b/arch/ia64/kernel/asm-offsets.c
@@ -35,6 +35,7 @@ void foo(void)
35 BLANK(); 35 BLANK();
36 36
37 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 37 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
38 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
38 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); 39 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
39 40
40 BLANK(); 41 BLANK();
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 5cdd2f5fa064..7d1bbb4403ba 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -21,9 +21,9 @@
21#include <asm/mca.h> 21#include <asm/mca.h>
22 22
23int kdump_status[NR_CPUS]; 23int kdump_status[NR_CPUS];
24atomic_t kdump_cpu_freezed; 24static atomic_t kdump_cpu_frozen;
25atomic_t kdump_in_progress; 25atomic_t kdump_in_progress;
26int kdump_on_init = 1; 26static int kdump_on_init = 1;
27 27
28static inline Elf64_Word 28static inline Elf64_Word
29*append_elf_note(Elf64_Word *buf, char *name, unsigned type, void *data, 29*append_elf_note(Elf64_Word *buf, char *name, unsigned type, void *data,
@@ -86,7 +86,7 @@ kdump_wait_cpu_freeze(void)
86 int cpu_num = num_online_cpus() - 1; 86 int cpu_num = num_online_cpus() - 1;
87 int timeout = 1000; 87 int timeout = 1000;
88 while(timeout-- > 0) { 88 while(timeout-- > 0) {
89 if (atomic_read(&kdump_cpu_freezed) == cpu_num) 89 if (atomic_read(&kdump_cpu_frozen) == cpu_num)
90 return 0; 90 return 0;
91 udelay(1000); 91 udelay(1000);
92 } 92 }
@@ -108,8 +108,8 @@ machine_crash_shutdown(struct pt_regs *pt)
108 kexec_disable_iosapic(); 108 kexec_disable_iosapic();
109#ifdef CONFIG_SMP 109#ifdef CONFIG_SMP
110 kdump_smp_send_stop(); 110 kdump_smp_send_stop();
111 /* not all cpu response to IPI, send INIT to freeze them */
111 if (kdump_wait_cpu_freeze() && kdump_on_init) { 112 if (kdump_wait_cpu_freeze() && kdump_on_init) {
112 //not all cpu response to IPI, send INIT to freeze them
113 kdump_smp_send_init(); 113 kdump_smp_send_init();
114 } 114 }
115#endif 115#endif
@@ -136,7 +136,7 @@ kdump_cpu_freeze(struct unw_frame_info *info, void *arg)
136 cpuid = smp_processor_id(); 136 cpuid = smp_processor_id();
137 crash_save_this_cpu(); 137 crash_save_this_cpu();
138 current->thread.ksp = (__u64)info->sw - 16; 138 current->thread.ksp = (__u64)info->sw - 16;
139 atomic_inc(&kdump_cpu_freezed); 139 atomic_inc(&kdump_cpu_frozen);
140 kdump_status[cpuid] = 1; 140 kdump_status[cpuid] = 1;
141 mb(); 141 mb();
142#ifdef CONFIG_HOTPLUG_CPU 142#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 772ba6fe110f..f45f91d38cab 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -21,6 +21,7 @@
21 * Skip non-WB memory and ignore empty memory ranges. 21 * Skip non-WB memory and ignore empty memory ranges.
22 */ 22 */
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/bootmem.h>
24#include <linux/kernel.h> 25#include <linux/kernel.h>
25#include <linux/init.h> 26#include <linux/init.h>
26#include <linux/types.h> 27#include <linux/types.h>
@@ -970,6 +971,11 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
970 if (!is_memory_available(md)) 971 if (!is_memory_available(md))
971 continue; 972 continue;
972 973
974#ifdef CONFIG_CRASH_DUMP
975 /* saved_max_pfn should ignore max_addr= command line arg */
976 if (saved_max_pfn < (efi_md_end(md) >> PAGE_SHIFT))
977 saved_max_pfn = (efi_md_end(md) >> PAGE_SHIFT);
978#endif
973 /* 979 /*
974 * Round ends inward to granule boundaries 980 * Round ends inward to granule boundaries
975 * Give trimmings to uncached allocator 981 * Give trimmings to uncached allocator
@@ -1136,7 +1142,7 @@ efi_initialize_iomem_resources(struct resource *code_resource,
1136/* find a block of memory aligned to 64M exclude reserved regions 1142/* find a block of memory aligned to 64M exclude reserved regions
1137 rsvd_regions are sorted 1143 rsvd_regions are sorted
1138 */ 1144 */
1139unsigned long 1145unsigned long __init
1140kdump_find_rsvd_region (unsigned long size, 1146kdump_find_rsvd_region (unsigned long size,
1141 struct rsvd_region *r, int n) 1147 struct rsvd_region *r, int n)
1142{ 1148{
@@ -1177,3 +1183,33 @@ kdump_find_rsvd_region (unsigned long size,
1177 return ~0UL; 1183 return ~0UL;
1178} 1184}
1179#endif 1185#endif
1186
1187#ifdef CONFIG_PROC_VMCORE
1188/* locate the size find a the descriptor at a certain address */
1189unsigned long
1190vmcore_find_descriptor_size (unsigned long address)
1191{
1192 void *efi_map_start, *efi_map_end, *p;
1193 efi_memory_desc_t *md;
1194 u64 efi_desc_size;
1195 unsigned long ret = 0;
1196
1197 efi_map_start = __va(ia64_boot_param->efi_memmap);
1198 efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
1199 efi_desc_size = ia64_boot_param->efi_memdesc_size;
1200
1201 for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
1202 md = p;
1203 if (efi_wb(md) && md->type == EFI_LOADER_DATA
1204 && md->phys_addr == address) {
1205 ret = efi_md_size(md);
1206 break;
1207 }
1208 }
1209
1210 if (ret == 0)
1211 printk(KERN_WARNING "Cannot locate EFI vmcore descriptor\n");
1212
1213 return ret;
1214}
1215#endif
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 7a05b1cb2ad5..8589e84a27c6 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -10,6 +10,8 @@
10 * probably broke it along the way... ;-) 10 * probably broke it along the way... ;-)
11 * 13-Jul-04 clameter Implement fsys_clock_gettime and revise fsys_gettimeofday to make 11 * 13-Jul-04 clameter Implement fsys_clock_gettime and revise fsys_gettimeofday to make
12 * it capable of using memory based clocks without falling back to C code. 12 * it capable of using memory based clocks without falling back to C code.
13 * 08-Feb-07 Fenghua Yu Implement fsys_getcpu.
14 *
13 */ 15 */
14 16
15#include <asm/asmmacro.h> 17#include <asm/asmmacro.h>
@@ -505,6 +507,59 @@ EX(.fail_efault, (p15) st8 [r34]=r3)
505#endif 507#endif
506END(fsys_rt_sigprocmask) 508END(fsys_rt_sigprocmask)
507 509
510/*
511 * fsys_getcpu doesn't use the third parameter in this implementation. It reads
512 * current_thread_info()->cpu and corresponding node in cpu_to_node_map.
513 */
514ENTRY(fsys_getcpu)
515 .prologue
516 .altrp b6
517 .body
518 ;;
519 add r2=TI_FLAGS+IA64_TASK_SIZE,r16
520 tnat.nz p6,p0 = r32 // guard against NaT argument
521 add r3=TI_CPU+IA64_TASK_SIZE,r16
522 ;;
523 ld4 r3=[r3] // M r3 = thread_info->cpu
524 ld4 r2=[r2] // M r2 = thread_info->flags
525(p6) br.cond.spnt.few .fail_einval // B
526 ;;
527 tnat.nz p7,p0 = r33 // I guard against NaT argument
528(p7) br.cond.spnt.few .fail_einval // B
529#ifdef CONFIG_NUMA
530 movl r17=cpu_to_node_map
531 ;;
532EX(.fail_efault, probe.w.fault r32, 3) // M This takes 5 cycles
533EX(.fail_efault, probe.w.fault r33, 3) // M This takes 5 cycles
534 shladd r18=r3,1,r17
535 ;;
536 ld2 r20=[r18] // r20 = cpu_to_node_map[cpu]
537 and r2 = TIF_ALLWORK_MASK,r2
538 ;;
539 cmp.ne p8,p0=0,r2
540(p8) br.spnt.many fsys_fallback_syscall
541 ;;
542 ;;
543EX(.fail_efault, st4 [r32] = r3)
544EX(.fail_efault, st2 [r33] = r20)
545 mov r8=0
546 ;;
547#else
548EX(.fail_efault, probe.w.fault r32, 3) // M This takes 5 cycles
549EX(.fail_efault, probe.w.fault r33, 3) // M This takes 5 cycles
550 and r2 = TIF_ALLWORK_MASK,r2
551 ;;
552 cmp.ne p8,p0=0,r2
553(p8) br.spnt.many fsys_fallback_syscall
554 ;;
555EX(.fail_efault, st4 [r32] = r3)
556EX(.fail_efault, st2 [r33] = r0)
557 mov r8=0
558 ;;
559#endif
560 FSYS_RETURN
561END(fsys_getcpu)
562
508ENTRY(fsys_fallback_syscall) 563ENTRY(fsys_fallback_syscall)
509 .prologue 564 .prologue
510 .altrp b6 565 .altrp b6
@@ -878,6 +933,56 @@ fsyscall_table:
878 data8 0 // timer_delete 933 data8 0 // timer_delete
879 data8 0 // clock_settime 934 data8 0 // clock_settime
880 data8 fsys_clock_gettime // clock_gettime 935 data8 fsys_clock_gettime // clock_gettime
936 data8 0 // clock_getres // 1255
937 data8 0 // clock_nanosleep
938 data8 0 // fstatfs64
939 data8 0 // statfs64
940 data8 0 // mbind
941 data8 0 // get_mempolicy // 1260
942 data8 0 // set_mempolicy
943 data8 0 // mq_open
944 data8 0 // mq_unlink
945 data8 0 // mq_timedsend
946 data8 0 // mq_timedreceive // 1265
947 data8 0 // mq_notify
948 data8 0 // mq_getsetattr
949 data8 0 // kexec_load
950 data8 0 // vserver
951 data8 0 // waitid // 1270
952 data8 0 // add_key
953 data8 0 // request_key
954 data8 0 // keyctl
955 data8 0 // ioprio_set
956 data8 0 // ioprio_get // 1275
957 data8 0 // move_pages
958 data8 0 // inotify_init
959 data8 0 // inotify_add_watch
960 data8 0 // inotify_rm_watch
961 data8 0 // migrate_pages // 1280
962 data8 0 // openat
963 data8 0 // mkdirat
964 data8 0 // mknodat
965 data8 0 // fchownat
966 data8 0 // futimesat // 1285
967 data8 0 // newfstatat
968 data8 0 // unlinkat
969 data8 0 // renameat
970 data8 0 // linkat
971 data8 0 // symlinkat // 1290
972 data8 0 // readlinkat
973 data8 0 // fchmodat
974 data8 0 // faccessat
975 data8 0
976 data8 0 // 1295
977 data8 0 // unshare
978 data8 0 // splice
979 data8 0 // set_robust_list
980 data8 0 // get_robust_list
981 data8 0 // sync_file_range // 1300
982 data8 0 // tee
983 data8 0 // vmsplice
984 data8 0
985 data8 fsys_getcpu // getcpu // 1304
881 986
882 // fill in zeros for the remaining entries 987 // fill in zeros for the remaining entries
883 .zero: 988 .zero:
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index d6aab40c6416..dcfbf3e7a9ef 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -446,7 +446,7 @@ iosapic_end_level_irq (unsigned int irq)
446#define iosapic_disable_level_irq mask_irq 446#define iosapic_disable_level_irq mask_irq
447#define iosapic_ack_level_irq nop 447#define iosapic_ack_level_irq nop
448 448
449struct hw_interrupt_type irq_type_iosapic_level = { 449struct irq_chip irq_type_iosapic_level = {
450 .name = "IO-SAPIC-level", 450 .name = "IO-SAPIC-level",
451 .startup = iosapic_startup_level_irq, 451 .startup = iosapic_startup_level_irq,
452 .shutdown = iosapic_shutdown_level_irq, 452 .shutdown = iosapic_shutdown_level_irq,
@@ -454,6 +454,8 @@ struct hw_interrupt_type irq_type_iosapic_level = {
454 .disable = iosapic_disable_level_irq, 454 .disable = iosapic_disable_level_irq,
455 .ack = iosapic_ack_level_irq, 455 .ack = iosapic_ack_level_irq,
456 .end = iosapic_end_level_irq, 456 .end = iosapic_end_level_irq,
457 .mask = mask_irq,
458 .unmask = unmask_irq,
457 .set_affinity = iosapic_set_affinity 459 .set_affinity = iosapic_set_affinity
458}; 460};
459 461
@@ -493,7 +495,7 @@ iosapic_ack_edge_irq (unsigned int irq)
493#define iosapic_disable_edge_irq nop 495#define iosapic_disable_edge_irq nop
494#define iosapic_end_edge_irq nop 496#define iosapic_end_edge_irq nop
495 497
496struct hw_interrupt_type irq_type_iosapic_edge = { 498struct irq_chip irq_type_iosapic_edge = {
497 .name = "IO-SAPIC-edge", 499 .name = "IO-SAPIC-edge",
498 .startup = iosapic_startup_edge_irq, 500 .startup = iosapic_startup_edge_irq,
499 .shutdown = iosapic_disable_edge_irq, 501 .shutdown = iosapic_disable_edge_irq,
@@ -501,6 +503,8 @@ struct hw_interrupt_type irq_type_iosapic_edge = {
501 .disable = iosapic_disable_edge_irq, 503 .disable = iosapic_disable_edge_irq,
502 .ack = iosapic_ack_edge_irq, 504 .ack = iosapic_ack_edge_irq,
503 .end = iosapic_end_edge_irq, 505 .end = iosapic_end_edge_irq,
506 .mask = mask_irq,
507 .unmask = unmask_irq,
504 .set_affinity = iosapic_set_affinity 508 .set_affinity = iosapic_set_affinity
505}; 509};
506 510
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index a76add3e76a2..491687f84fb5 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1192,8 +1192,6 @@ void
1192ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, 1192ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1193 struct ia64_sal_os_state *sos) 1193 struct ia64_sal_os_state *sos)
1194{ 1194{
1195 pal_processor_state_info_t *psp = (pal_processor_state_info_t *)
1196 &sos->proc_state_param;
1197 int recover, cpu = smp_processor_id(); 1195 int recover, cpu = smp_processor_id();
1198 struct task_struct *previous_current; 1196 struct task_struct *previous_current;
1199 struct ia64_mca_notify_die nd = 1197 struct ia64_mca_notify_die nd =
@@ -1223,10 +1221,8 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1223 /* Get the MCA error record and log it */ 1221 /* Get the MCA error record and log it */
1224 ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA); 1222 ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA);
1225 1223
1226 /* TLB error is only exist in this SAL error record */ 1224 /* MCA error recovery */
1227 recover = (psp->tc && !(psp->cc || psp->bc || psp->rc || psp->uc)) 1225 recover = (ia64_mca_ucmc_extension
1228 /* other error recovery */
1229 || (ia64_mca_ucmc_extension
1230 && ia64_mca_ucmc_extension( 1226 && ia64_mca_ucmc_extension(
1231 IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_MCA), 1227 IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_MCA),
1232 sos)); 1228 sos));
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index afc1403799c9..832cf1e647e8 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -602,11 +602,40 @@ recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx,
602 default: 602 default:
603 break; 603 break;
604 } 604 }
605 } else if (psp->cc && !psp->bc) { /* Cache error */
606 status = recover_from_read_error(slidx, peidx, pbci, sos);
605 } 607 }
606 608
607 return status; 609 return status;
608} 610}
609 611
612/*
613 * recover_from_tlb_check
614 * @peidx: pointer of index of processor error section
615 *
616 * Return value:
617 * 1 on Success / 0 on Failure
618 */
619static int
620recover_from_tlb_check(peidx_table_t *peidx)
621{
622 sal_log_mod_error_info_t *smei;
623 pal_tlb_check_info_t *ptci;
624
625 smei = (sal_log_mod_error_info_t *)peidx_tlb_check(peidx, 0);
626 ptci = (pal_tlb_check_info_t *)&(smei->check_info);
627
628 /*
629 * Look for signature of a duplicate TLB DTC entry, which is
630 * a SW bug and always fatal.
631 */
632 if (ptci->op == PAL_TLB_CHECK_OP_PURGE
633 && !(ptci->itr || ptci->dtc || ptci->itc))
634 return fatal_mca("Duplicate TLB entry");
635
636 return mca_recovered("TLB check recovered");
637}
638
610/** 639/**
611 * recover_from_processor_error 640 * recover_from_processor_error
612 * @platform: whether there are some platform error section or not 641 * @platform: whether there are some platform error section or not
@@ -618,13 +647,6 @@ recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx,
618 * Return value: 647 * Return value:
619 * 1 on Success / 0 on Failure 648 * 1 on Success / 0 on Failure
620 */ 649 */
621/*
622 * Later we try to recover when below all conditions are satisfied.
623 * 1. Only one processor error section is exist.
624 * 2. BUS_CHECK is exist and the others are not exist.(Except TLB_CHECK)
625 * 3. The entry of BUS_CHECK_INFO is 1.
626 * 4. "External bus error" flag is set and the others are not set.
627 */
628 650
629static int 651static int
630recover_from_processor_error(int platform, slidx_table_t *slidx, 652recover_from_processor_error(int platform, slidx_table_t *slidx,
@@ -652,38 +674,39 @@ recover_from_processor_error(int platform, slidx_table_t *slidx,
652 return fatal_mca("error not contained"); 674 return fatal_mca("error not contained");
653 675
654 /* 676 /*
677 * Look for recoverable TLB check
678 */
679 if (psp->tc && !(psp->cc || psp->bc || psp->rc || psp->uc))
680 return recover_from_tlb_check(peidx);
681
682 /*
655 * The cache check and bus check bits have four possible states 683 * The cache check and bus check bits have four possible states
656 * cc bc 684 * cc bc
657 * 0 0 Weird record, not recovered
658 * 1 0 Cache error, not recovered
659 * 0 1 I/O error, attempt recovery
660 * 1 1 Memory error, attempt recovery 685 * 1 1 Memory error, attempt recovery
686 * 1 0 Cache error, attempt recovery
687 * 0 1 I/O error, attempt recovery
688 * 0 0 Other error type, not recovered
661 */ 689 */
662 if (psp->bc == 0 || pbci == NULL) 690 if (psp->cc == 0 && (psp->bc == 0 || pbci == NULL))
663 return fatal_mca("No bus check"); 691 return fatal_mca("No cache or bus check");
664 692
665 /* 693 /*
666 * Sorry, we cannot handle so many. 694 * Cannot handle more than one bus check.
667 */ 695 */
668 if (peidx_bus_check_num(peidx) > 1) 696 if (peidx_bus_check_num(peidx) > 1)
669 return fatal_mca("Too many bus checks"); 697 return fatal_mca("Too many bus checks");
670 /* 698
671 * Well, here is only one bus error.
672 */
673 if (pbci->ib) 699 if (pbci->ib)
674 return fatal_mca("Internal Bus error"); 700 return fatal_mca("Internal Bus error");
675 if (pbci->cc)
676 return fatal_mca("Cache-cache error");
677 if (pbci->eb && pbci->bsi > 0) 701 if (pbci->eb && pbci->bsi > 0)
678 return fatal_mca("External bus check fatal status"); 702 return fatal_mca("External bus check fatal status");
679 703
680 /* 704 /*
681 * This is a local MCA and estimated as recoverble external bus error. 705 * This is a local MCA and estimated as a recoverble error.
682 * (e.g. a load from poisoned memory)
683 * This means "there are some platform errors".
684 */ 706 */
685 if (platform) 707 if (platform)
686 return recover_from_platform_error(slidx, peidx, pbci, sos); 708 return recover_from_platform_error(slidx, peidx, pbci, sos);
709
687 /* 710 /*
688 * On account of strange SAL error record, we cannot recover. 711 * On account of strange SAL error record, we cannot recover.
689 */ 712 */
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 9ddf896a137a..abc7ad035886 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2299,7 +2299,7 @@ pfm_remap_buffer(struct vm_area_struct *vma, unsigned long buf, unsigned long ad
2299 * allocate a sampling buffer and remaps it into the user address space of the task 2299 * allocate a sampling buffer and remaps it into the user address space of the task
2300 */ 2300 */
2301static int 2301static int
2302pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned long rsize, void **user_vaddr) 2302pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t *ctx, unsigned long rsize, void **user_vaddr)
2303{ 2303{
2304 struct mm_struct *mm = task->mm; 2304 struct mm_struct *mm = task->mm;
2305 struct vm_area_struct *vma = NULL; 2305 struct vm_area_struct *vma = NULL;
@@ -2349,6 +2349,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
2349 * partially initialize the vma for the sampling buffer 2349 * partially initialize the vma for the sampling buffer
2350 */ 2350 */
2351 vma->vm_mm = mm; 2351 vma->vm_mm = mm;
2352 vma->vm_file = filp;
2352 vma->vm_flags = VM_READ| VM_MAYREAD |VM_RESERVED; 2353 vma->vm_flags = VM_READ| VM_MAYREAD |VM_RESERVED;
2353 vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */ 2354 vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */
2354 2355
@@ -2387,6 +2388,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
2387 goto error; 2388 goto error;
2388 } 2389 }
2389 2390
2391 get_file(filp);
2392
2390 /* 2393 /*
2391 * now insert the vma in the vm list for the process, must be 2394 * now insert the vma in the vm list for the process, must be
2392 * done with mmap lock held 2395 * done with mmap lock held
@@ -2464,7 +2467,7 @@ pfarg_is_sane(struct task_struct *task, pfarg_context_t *pfx)
2464} 2467}
2465 2468
2466static int 2469static int
2467pfm_setup_buffer_fmt(struct task_struct *task, pfm_context_t *ctx, unsigned int ctx_flags, 2470pfm_setup_buffer_fmt(struct task_struct *task, struct file *filp, pfm_context_t *ctx, unsigned int ctx_flags,
2468 unsigned int cpu, pfarg_context_t *arg) 2471 unsigned int cpu, pfarg_context_t *arg)
2469{ 2472{
2470 pfm_buffer_fmt_t *fmt = NULL; 2473 pfm_buffer_fmt_t *fmt = NULL;
@@ -2505,7 +2508,7 @@ pfm_setup_buffer_fmt(struct task_struct *task, pfm_context_t *ctx, unsigned int
2505 /* 2508 /*
2506 * buffer is always remapped into the caller's address space 2509 * buffer is always remapped into the caller's address space
2507 */ 2510 */
2508 ret = pfm_smpl_buffer_alloc(current, ctx, size, &uaddr); 2511 ret = pfm_smpl_buffer_alloc(current, filp, ctx, size, &uaddr);
2509 if (ret) goto error; 2512 if (ret) goto error;
2510 2513
2511 /* keep track of user address of buffer */ 2514 /* keep track of user address of buffer */
@@ -2716,7 +2719,7 @@ pfm_context_create(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg
2716 * does the user want to sample? 2719 * does the user want to sample?
2717 */ 2720 */
2718 if (pfm_uuid_cmp(req->ctx_smpl_buf_id, pfm_null_uuid)) { 2721 if (pfm_uuid_cmp(req->ctx_smpl_buf_id, pfm_null_uuid)) {
2719 ret = pfm_setup_buffer_fmt(current, ctx, ctx_flags, 0, req); 2722 ret = pfm_setup_buffer_fmt(current, filp, ctx, ctx_flags, 0, req);
2720 if (ret) goto buffer_error; 2723 if (ret) goto buffer_error;
2721 } 2724 }
2722 2725
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 3f8918782e0c..00f803246948 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -1573,6 +1573,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data)
1573 1573
1574 case PTRACE_DETACH: 1574 case PTRACE_DETACH:
1575 /* detach a process that was attached. */ 1575 /* detach a process that was attached. */
1576 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
1576 ret = ptrace_detach(child, data); 1577 ret = ptrace_detach(child, data);
1577 goto out_tsk; 1578 goto out_tsk;
1578 1579
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5fa09d141ab7..339e8a54c2f1 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -91,8 +91,6 @@ static struct resource code_resource = {
91 .name = "Kernel code", 91 .name = "Kernel code",
92 .flags = IORESOURCE_BUSY | IORESOURCE_MEM 92 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
93}; 93};
94extern void efi_initialize_iomem_resources(struct resource *,
95 struct resource *);
96extern char _text[], _end[], _etext[]; 94extern char _text[], _end[], _etext[];
97 95
98unsigned long ia64_max_cacheline_size; 96unsigned long ia64_max_cacheline_size;
@@ -251,6 +249,12 @@ reserve_memory (void)
251 } 249 }
252#endif 250#endif
253 251
252#ifdef CONFIG_PROC_VMCORE
253 if (reserve_elfcorehdr(&rsvd_region[n].start,
254 &rsvd_region[n].end) == 0)
255 n++;
256#endif
257
254 efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end); 258 efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end);
255 n++; 259 n++;
256 260
@@ -453,6 +457,30 @@ static int __init parse_elfcorehdr(char *arg)
453 return 0; 457 return 0;
454} 458}
455early_param("elfcorehdr", parse_elfcorehdr); 459early_param("elfcorehdr", parse_elfcorehdr);
460
461int __init reserve_elfcorehdr(unsigned long *start, unsigned long *end)
462{
463 unsigned long length;
464
465 /* We get the address using the kernel command line,
466 * but the size is extracted from the EFI tables.
467 * Both address and size are required for reservation
468 * to work properly.
469 */
470
471 if (elfcorehdr_addr >= ELFCORE_ADDR_MAX)
472 return -EINVAL;
473
474 if ((length = vmcore_find_descriptor_size(elfcorehdr_addr)) == 0) {
475 elfcorehdr_addr = ELFCORE_ADDR_MAX;
476 return -EINVAL;
477 }
478
479 *start = (unsigned long)__va(elfcorehdr_addr);
480 *end = *start + length;
481 return 0;
482}
483
456#endif /* CONFIG_PROC_VMCORE */ 484#endif /* CONFIG_PROC_VMCORE */
457 485
458void __init 486void __init
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index 38fa6e49e791..46edf8444c7e 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -9,12 +9,11 @@ lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
9 checksum.o clear_page.o csum_partial_copy.o \ 9 checksum.o clear_page.o csum_partial_copy.o \
10 clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ 10 clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \
11 flush.o ip_fast_csum.o do_csum.o \ 11 flush.o ip_fast_csum.o do_csum.o \
12 memset.o strlen.o 12 memset.o strlen.o xor.o
13 13
14lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o 14lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o 15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
16lib-$(CONFIG_PERFMON) += carta_random.o 16lib-$(CONFIG_PERFMON) += carta_random.o
17lib-$(CONFIG_MD_RAID456) += xor.o
18 17
19AFLAGS___divdi3.o = 18AFLAGS___divdi3.o =
20AFLAGS___udivdi3.o = -DUNSIGNED 19AFLAGS___udivdi3.o = -DUNSIGNED
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index ca4d41e5f177..fb0f4698f5d0 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -197,11 +197,6 @@ find_memory (void)
197 197
198 find_initrd(); 198 find_initrd();
199 199
200#ifdef CONFIG_CRASH_DUMP
201 /* If we are doing a crash dump, we still need to know the real mem
202 * size before original memory map is reset. */
203 saved_max_pfn = max_pfn;
204#endif
205} 200}
206 201
207#ifdef CONFIG_SMP 202#ifdef CONFIG_SMP
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 16835108bb5b..11a2d8825d89 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -480,12 +480,6 @@ void __init find_memory(void)
480 max_pfn = max_low_pfn; 480 max_pfn = max_low_pfn;
481 481
482 find_initrd(); 482 find_initrd();
483
484#ifdef CONFIG_CRASH_DUMP
485 /* If we are doing a crash dump, we still need to know the real mem
486 * size before original memory map is reset. */
487 saved_max_pfn = max_pfn;
488#endif
489} 483}
490 484
491#ifdef CONFIG_SMP 485#ifdef CONFIG_SMP
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
index 8c331ca6e5c9..c6216f454ffb 100644
--- a/arch/ia64/sn/kernel/io_acpi_init.c
+++ b/arch/ia64/sn/kernel/io_acpi_init.c
@@ -53,12 +53,15 @@ sal_ioif_init(u64 *result)
53} 53}
54 54
55/* 55/*
56 * sn_hubdev_add - The 'add' function of the acpi_sn_hubdev_driver. 56 * sn_acpi_hubdev_init() - This function is called by acpi_ns_get_device_callback()
57 * Called for every "SGIHUB" or "SGITIO" device defined 57 * for all SGIHUB and SGITIO acpi devices defined in the
58 * in the ACPI namespace. 58 * DSDT. It obtains the hubdev_info pointer from the
59 * ACPI vendor resource, which the PROM setup, and sets up the
60 * hubdev_info in the pda.
59 */ 61 */
60static int __init 62
61sn_hubdev_add(struct acpi_device *device) 63static acpi_status __init
64sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
62{ 65{
63 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 66 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
64 u64 addr; 67 u64 addr;
@@ -67,18 +70,19 @@ sn_hubdev_add(struct acpi_device *device)
67 int i; 70 int i;
68 u64 nasid; 71 u64 nasid;
69 struct acpi_resource *resource; 72 struct acpi_resource *resource;
70 int ret = 0;
71 acpi_status status; 73 acpi_status status;
72 struct acpi_resource_vendor_typed *vendor; 74 struct acpi_resource_vendor_typed *vendor;
73 extern void sn_common_hubdev_init(struct hubdev_info *); 75 extern void sn_common_hubdev_init(struct hubdev_info *);
74 76
75 status = acpi_get_vendor_resource(device->handle, METHOD_NAME__CRS, 77 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
76 &sn_uuid, &buffer); 78 &sn_uuid, &buffer);
77 if (ACPI_FAILURE(status)) { 79 if (ACPI_FAILURE(status)) {
78 printk(KERN_ERR 80 printk(KERN_ERR
79 "sn_hubdev_add: acpi_get_vendor_resource() failed: %d\n", 81 "sn_acpi_hubdev_init: acpi_get_vendor_resource() "
80 status); 82 "(0x%x) failed for: ", status);
81 return 1; 83 acpi_ns_print_node_pathname(handle, NULL);
84 printk("\n");
85 return AE_OK; /* Continue walking namespace */
82 } 86 }
83 87
84 resource = buffer.pointer; 88 resource = buffer.pointer;
@@ -86,9 +90,10 @@ sn_hubdev_add(struct acpi_device *device)
86 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != 90 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
87 sizeof(struct hubdev_info *)) { 91 sizeof(struct hubdev_info *)) {
88 printk(KERN_ERR 92 printk(KERN_ERR
89 "sn_hubdev_add: Invalid vendor data length: %d\n", 93 "sn_acpi_hubdev_init: Invalid vendor data length: %d for: ",
90 vendor->byte_length); 94 vendor->byte_length);
91 ret = 1; 95 acpi_ns_print_node_pathname(handle, NULL);
96 printk("\n");
92 goto exit; 97 goto exit;
93 } 98 }
94 99
@@ -103,7 +108,7 @@ sn_hubdev_add(struct acpi_device *device)
103 108
104exit: 109exit:
105 kfree(buffer.pointer); 110 kfree(buffer.pointer);
106 return ret; 111 return AE_OK; /* Continue walking namespace */
107} 112}
108 113
109/* 114/*
@@ -441,14 +446,6 @@ sn_acpi_slot_fixup(struct pci_dev *dev)
441 446
442EXPORT_SYMBOL(sn_acpi_slot_fixup); 447EXPORT_SYMBOL(sn_acpi_slot_fixup);
443 448
444static struct acpi_driver acpi_sn_hubdev_driver = {
445 .name = "SGI HUBDEV Driver",
446 .ids = "SGIHUB,SGITIO",
447 .ops = {
448 .add = sn_hubdev_add,
449 },
450};
451
452 449
453/* 450/*
454 * sn_acpi_bus_fixup - Perform SN specific setup of software structs 451 * sn_acpi_bus_fixup - Perform SN specific setup of software structs
@@ -492,7 +489,10 @@ sn_io_acpi_init(void)
492 /* SN Altix does not follow the IOSAPIC IRQ routing model */ 489 /* SN Altix does not follow the IOSAPIC IRQ routing model */
493 acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM; 490 acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM;
494 491
495 acpi_bus_register_driver(&acpi_sn_hubdev_driver); 492 /* Setup hubdev_info for all SGIHUB/SGITIO devices */
493 acpi_get_devices("SGIHUB", sn_acpi_hubdev_init, NULL, NULL);
494 acpi_get_devices("SGITIO", sn_acpi_hubdev_init, NULL, NULL);
495
496 status = sal_ioif_init(&result); 496 status = sal_ioif_init(&result);
497 if (status || result) 497 if (status || result)
498 panic("sal_ioif_init failed: [%lx] %s\n", 498 panic("sal_ioif_init failed: [%lx] %s\n",
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 8c5bee01eaa2..8d2a1bfbfe7c 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -205,7 +205,17 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
205 (void)sn_retarget_vector(sn_irq_info, nasid, slice); 205 (void)sn_retarget_vector(sn_irq_info, nasid, slice);
206} 206}
207 207
208struct hw_interrupt_type irq_type_sn = { 208static void
209sn_mask_irq(unsigned int irq)
210{
211}
212
213static void
214sn_unmask_irq(unsigned int irq)
215{
216}
217
218struct irq_chip irq_type_sn = {
209 .name = "SN hub", 219 .name = "SN hub",
210 .startup = sn_startup_irq, 220 .startup = sn_startup_irq,
211 .shutdown = sn_shutdown_irq, 221 .shutdown = sn_shutdown_irq,
@@ -213,6 +223,8 @@ struct hw_interrupt_type irq_type_sn = {
213 .disable = sn_disable_irq, 223 .disable = sn_disable_irq,
214 .ack = sn_ack_irq, 224 .ack = sn_ack_irq,
215 .end = sn_end_irq, 225 .end = sn_end_irq,
226 .mask = sn_mask_irq,
227 .unmask = sn_unmask_irq,
216 .set_affinity = sn_set_affinity_irq 228 .set_affinity = sn_set_affinity_irq
217}; 229};
218 230
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 8571e52c2efd..bd5373d593e1 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -397,6 +397,8 @@ void __init sn_setup(char **cmdline_p)
397 ia64_sn_set_os_feature(OSF_PCISEGMENT_ENABLE); 397 ia64_sn_set_os_feature(OSF_PCISEGMENT_ENABLE);
398 ia64_sn_set_os_feature(OSF_ACPI_ENABLE); 398 ia64_sn_set_os_feature(OSF_ACPI_ENABLE);
399 399
400 /* Load the new DSDT and SSDT tables into the global table list. */
401 acpi_table_init();
400 402
401#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 403#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
402 /* 404 /*
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c
index d5c25d27b64d..8133b1047353 100644
--- a/arch/m68knommu/kernel/setup.c
+++ b/arch/m68knommu/kernel/setup.c
@@ -51,7 +51,7 @@ static void dummy_waitbut(void)
51{ 51{
52} 52}
53 53
54void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)); 54void (*mach_sched_init) (irq_handler_t handler);
55void (*mach_tick)( void ); 55void (*mach_tick)( void );
56/* machine dependent keyboard functions */ 56/* machine dependent keyboard functions */
57int (*mach_keyb_init) (void); 57int (*mach_keyb_init) (void);
@@ -66,7 +66,7 @@ void (*mach_trap_init) (void);
66/* machine dependent timer functions */ 66/* machine dependent timer functions */
67unsigned long (*mach_gettimeoffset) (void); 67unsigned long (*mach_gettimeoffset) (void);
68void (*mach_gettod) (int*, int*, int*, int*, int*, int*); 68void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
69int (*mach_hwclk) (int, struct hwclk_time*); 69int (*mach_hwclk) (int, struct rtc_time*);
70int (*mach_set_clock_mmss) (unsigned long); 70int (*mach_set_clock_mmss) (unsigned long);
71void (*mach_mksound)( unsigned int count, unsigned int ticks ); 71void (*mach_mksound)( unsigned int count, unsigned int ticks );
72void (*mach_reset)( void ); 72void (*mach_reset)( void );
diff --git a/arch/m68knommu/platform/5307/ints.c b/arch/m68knommu/platform/5307/ints.c
index 20f12a19a522..751633038c4b 100644
--- a/arch/m68knommu/platform/5307/ints.c
+++ b/arch/m68knommu/platform/5307/ints.c
@@ -42,7 +42,6 @@ static irq_node_t nodes[NUM_IRQ_NODES];
42/* The number of spurious interrupts */ 42/* The number of spurious interrupts */
43volatile unsigned int num_spurious; 43volatile unsigned int num_spurious;
44 44
45unsigned int local_bh_count[NR_CPUS];
46unsigned int local_irq_count[NR_CPUS]; 45unsigned int local_irq_count[NR_CPUS];
47 46
48static irqreturn_t default_irq_handler(int irq, void *ptr) 47static irqreturn_t default_irq_handler(int irq, void *ptr)
diff --git a/arch/m68knommu/platform/68328/ints.c b/arch/m68knommu/platform/68328/ints.c
index 2dda7339aae5..3de6e337554e 100644
--- a/arch/m68knommu/platform/68328/ints.c
+++ b/arch/m68knommu/platform/68328/ints.c
@@ -15,6 +15,7 @@
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/kernel_stat.h> 16#include <linux/kernel_stat.h>
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/interrupt.h>
18 19
19#include <asm/system.h> 20#include <asm/system.h>
20#include <asm/irq.h> 21#include <asm/irq.h>
@@ -64,7 +65,7 @@ asmlinkage void trap44(void);
64asmlinkage void trap45(void); 65asmlinkage void trap45(void);
65asmlinkage void trap46(void); 66asmlinkage void trap46(void);
66asmlinkage void trap47(void); 67asmlinkage void trap47(void);
67asmlinkage irqreturn_t bad_interrupt(int, void *, struct pt_regs *); 68asmlinkage irqreturn_t bad_interrupt(int, void *);
68asmlinkage irqreturn_t inthandler(void); 69asmlinkage irqreturn_t inthandler(void);
69asmlinkage irqreturn_t inthandler1(void); 70asmlinkage irqreturn_t inthandler1(void);
70asmlinkage irqreturn_t inthandler2(void); 71asmlinkage irqreturn_t inthandler2(void);
@@ -121,7 +122,7 @@ void init_IRQ(void)
121 122
122int request_irq( 123int request_irq(
123 unsigned int irq, 124 unsigned int irq,
124 irqreturn_t (*handler)(int, void *, struct pt_regs *), 125 irq_handler_t handler,
125 unsigned long flags, 126 unsigned long flags,
126 const char *devname, 127 const char *devname,
127 void *dev_id) 128 void *dev_id)
diff --git a/arch/m68knommu/platform/68328/timers.c b/arch/m68knommu/platform/68328/timers.c
index 438ef6ee9720..ef067f4c3cd4 100644
--- a/arch/m68knommu/platform/68328/timers.c
+++ b/arch/m68knommu/platform/68328/timers.c
@@ -17,6 +17,7 @@
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/interrupt.h>
20#include <asm/setup.h> 21#include <asm/setup.h>
21#include <asm/system.h> 22#include <asm/system.h>
22#include <asm/pgtable.h> 23#include <asm/pgtable.h>
@@ -52,7 +53,7 @@
52 53
53/***************************************************************************/ 54/***************************************************************************/
54 55
55void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)) 56void m68328_timer_init(irq_handler_t timer_routine)
56{ 57{
57 /* disable timer 1 */ 58 /* disable timer 1 */
58 TCTL = 0; 59 TCTL = 0;
diff --git a/arch/m68knommu/platform/68360/config.c b/arch/m68knommu/platform/68360/config.c
index 1b36f6261764..4ff13bd51ffd 100644
--- a/arch/m68knommu/platform/68360/config.c
+++ b/arch/m68knommu/platform/68360/config.c
@@ -16,6 +16,7 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/tty.h> 17#include <linux/tty.h>
18#include <linux/console.h> 18#include <linux/console.h>
19#include <linux/interrupt.h>
19 20
20#include <asm/setup.h> 21#include <asm/setup.h>
21#include <asm/system.h> 22#include <asm/system.h>
@@ -50,7 +51,7 @@ extern unsigned long int system_clock; //In kernel setup.c
50 51
51extern void config_M68360_irq(void); 52extern void config_M68360_irq(void);
52 53
53void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *)) 54void BSP_sched_init(irq_handler_t timer_routine)
54{ 55{
55 unsigned char prescaler; 56 unsigned char prescaler;
56 unsigned short tgcr_save; 57 unsigned short tgcr_save;
diff --git a/arch/m68knommu/platform/68EZ328/config.c b/arch/m68knommu/platform/68EZ328/config.c
index 659b80aca118..ab36551fc969 100644
--- a/arch/m68knommu/platform/68EZ328/config.c
+++ b/arch/m68knommu/platform/68EZ328/config.c
@@ -19,6 +19,7 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/tty.h> 20#include <linux/tty.h>
21#include <linux/console.h> 21#include <linux/console.h>
22#include <linux/interrupt.h>
22 23
23#include <asm/setup.h> 24#include <asm/setup.h>
24#include <asm/system.h> 25#include <asm/system.h>
@@ -31,7 +32,7 @@
31 32
32/***************************************************************************/ 33/***************************************************************************/
33 34
34void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)); 35void m68328_timer_init(irq_handler_t timer_routine);
35void m68328_timer_tick(void); 36void m68328_timer_tick(void);
36unsigned long m68328_timer_gettimeoffset(void); 37unsigned long m68328_timer_gettimeoffset(void);
37void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); 38void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
diff --git a/arch/m68knommu/platform/68VZ328/config.c b/arch/m68knommu/platform/68VZ328/config.c
index fcd100b7594d..8abe0f6e7235 100644
--- a/arch/m68knommu/platform/68VZ328/config.c
+++ b/arch/m68knommu/platform/68VZ328/config.c
@@ -21,6 +21,7 @@
21#include <linux/console.h> 21#include <linux/console.h>
22#include <linux/kd.h> 22#include <linux/kd.h>
23#include <linux/netdevice.h> 23#include <linux/netdevice.h>
24#include <linux/interrupt.h>
24 25
25#include <asm/setup.h> 26#include <asm/setup.h>
26#include <asm/system.h> 27#include <asm/system.h>
@@ -36,7 +37,7 @@
36 37
37/***************************************************************************/ 38/***************************************************************************/
38 39
39void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)); 40void m68328_timer_init(irq_handler_t timer_routine);
40void m68328_timer_tick(void); 41void m68328_timer_tick(void);
41unsigned long m68328_timer_gettimeoffset(void); 42unsigned long m68328_timer_gettimeoffset(void);
42void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); 43void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 4ec2dd5455f3..2b9c65c3b5d1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -167,6 +167,7 @@ config MIPS_COBALT
167 select IRQ_CPU 167 select IRQ_CPU
168 select MIPS_GT64111 168 select MIPS_GT64111
169 select SYS_HAS_CPU_NEVADA 169 select SYS_HAS_CPU_NEVADA
170 select SYS_HAS_EARLY_PRINTK
170 select SYS_SUPPORTS_32BIT_KERNEL 171 select SYS_SUPPORTS_32BIT_KERNEL
171 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 172 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
172 select SYS_SUPPORTS_LITTLE_ENDIAN 173 select SYS_SUPPORTS_LITTLE_ENDIAN
@@ -469,11 +470,6 @@ config MIPS_XXS1500
469 select SOC_AU1500 470 select SOC_AU1500
470 select SYS_SUPPORTS_LITTLE_ENDIAN 471 select SYS_SUPPORTS_LITTLE_ENDIAN
471 472
472config PNX8550_V2PCI
473 bool "Philips PNX8550 based Viper2-PCI board"
474 select PNX8550
475 select SYS_SUPPORTS_LITTLE_ENDIAN
476
477config PNX8550_JBS 473config PNX8550_JBS
478 bool "Philips PNX8550 based JBS board" 474 bool "Philips PNX8550 based JBS board"
479 select PNX8550 475 select PNX8550
@@ -837,7 +833,6 @@ source "arch/mips/tx4927/Kconfig"
837source "arch/mips/tx4938/Kconfig" 833source "arch/mips/tx4938/Kconfig"
838source "arch/mips/vr41xx/Kconfig" 834source "arch/mips/vr41xx/Kconfig"
839source "arch/mips/philips/pnx8550/common/Kconfig" 835source "arch/mips/philips/pnx8550/common/Kconfig"
840source "arch/mips/cobalt/Kconfig"
841 836
842endmenu 837endmenu
843 838
diff --git a/arch/mips/arc/init.c b/arch/mips/arc/init.c
index 0ac8f42d3752..e2f75b13312f 100644
--- a/arch/mips/arc/init.c
+++ b/arch/mips/arc/init.c
@@ -23,16 +23,16 @@ LONG *_prom_argv, *_prom_envp;
23void __init prom_init(void) 23void __init prom_init(void)
24{ 24{
25 PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; 25 PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
26
26 romvec = ROMVECTOR; 27 romvec = ROMVECTOR;
27 ULONG cnt;
28 CHAR c;
29 28
30 prom_argc = fw_arg0; 29 prom_argc = fw_arg0;
31 _prom_argv = (LONG *) fw_arg1; 30 _prom_argv = (LONG *) fw_arg1;
32 _prom_envp = (LONG *) fw_arg2; 31 _prom_envp = (LONG *) fw_arg2;
33 32
34 if (pb->magic != 0x53435241) { 33 if (pb->magic != 0x53435241) {
35 printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", pb->magic); 34 printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n",
35 (unsigned long) pb->magic);
36 while(1) 36 while(1)
37 ; 37 ;
38 } 38 }
diff --git a/arch/mips/cobalt/Kconfig b/arch/mips/cobalt/Kconfig
deleted file mode 100644
index 7c42b088d16c..000000000000
--- a/arch/mips/cobalt/Kconfig
+++ /dev/null
@@ -1,7 +0,0 @@
1config EARLY_PRINTK
2 bool "Early console support"
3 depends on MIPS_COBALT
4 help
5 Provide early console support by direct access to the
6 on board UART. The UART must have been previously
7 initialised by the boot loader.
diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
index fff20d28114f..ca56b415b8ac 100644
--- a/arch/mips/cobalt/console.c
+++ b/arch/mips/cobalt/console.c
@@ -9,11 +9,8 @@
9#include <asm/addrspace.h> 9#include <asm/addrspace.h>
10#include <asm/mach-cobalt/cobalt.h> 10#include <asm/mach-cobalt/cobalt.h>
11 11
12static void putchar(int c) 12void prom_putchar(char c)
13{ 13{
14 if(c == '\n')
15 putchar('\r');
16
17 while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE)) 14 while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE))
18 ; 15 ;
19 16
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index 458894933a4c..39e251300c64 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_ATLAS=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index aa05e294ea62..4713a13211ce 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index b2594fa556f3..5e7ae56b1f3c 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index 9090a7aba6c1..ba593b510b76 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_COBALT=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 4cb8cf4255a2..0db6a8b37301 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1000=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index d86dedf27fc4..162add97c5ef 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1100=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index c24b6008345e..82801ec43e6a 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1200=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index baad2c5223ba..545f23094e13 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1500=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index c29fdab0423a..5bd3b4328e57 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1550=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index f4b316d2cd70..5b502a2013fb 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45CONFIG_DDB5477=y 44CONFIG_DDB5477=y
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index 9c38e5c77761..4bbdab078ff1 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -39,7 +39,6 @@ CONFIG_MACH_DECSTATION=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index 922af379aa41..b5714a6a5398 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/emma2rh_defconfig b/arch/mips/configs/emma2rh_defconfig
index c0db8f14713d..3044579f171a 100644
--- a/arch/mips/configs/emma2rh_defconfig
+++ b/arch/mips/configs/emma2rh_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index ce088b36291d..c10e4e063226 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_EV64120=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/excite_defconfig b/arch/mips/configs/excite_defconfig
index 82f204d080b7..460d7a26a8ba 100644
--- a/arch/mips/configs/excite_defconfig
+++ b/arch/mips/configs/excite_defconfig
@@ -40,7 +40,6 @@ CONFIG_BASLER_EXCITE=y
40# CONFIG_MOMENCO_OCELOT_C is not set 40# CONFIG_MOMENCO_OCELOT_C is not set
41# CONFIG_MOMENCO_OCELOT_G is not set 41# CONFIG_MOMENCO_OCELOT_G is not set
42# CONFIG_MIPS_XXS1500 is not set 42# CONFIG_MIPS_XXS1500 is not set
43# CONFIG_PNX8550_V2PCI is not set
44# CONFIG_PNX8550_JBS is not set 43# CONFIG_PNX8550_JBS is not set
45# CONFIG_PNX8550_STB810 is not set 44# CONFIG_PNX8550_STB810 is not set
46# CONFIG_DDB5477 is not set 45# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index cb81f13bd45a..7ec618f3c8b9 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 46f6ac4083b9..9ddc3eff4793 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index d9e5000d5329..8fc18809d5ff 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index 57ef0c45a62b..083104daa2ca 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -39,7 +39,6 @@ CONFIG_MOMENCO_JAGUAR_ATX=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig
index 21d979f8326c..9331cb0a19b1 100644
--- a/arch/mips/configs/jazz_defconfig
+++ b/arch/mips/configs/jazz_defconfig
@@ -39,7 +39,6 @@ CONFIG_MACH_JAZZ=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 98b9fbc042f4..21a094752dab 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index b3f767ff1c5a..fd4272c1458a 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -39,7 +39,6 @@ CONFIG_LASAT=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index a5f379d626d6..1f64d7632a03 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_MALTA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/mipssim_defconfig b/arch/mips/configs/mipssim_defconfig
index 5ff53e184912..a2db5c201216 100644
--- a/arch/mips/configs/mipssim_defconfig
+++ b/arch/mips/configs/mipssim_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_SIM=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index 750e6445c613..ad5c0bf87b2b 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index 2febd0a7fba2..28547313ce13 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -39,7 +39,6 @@ CONFIG_MOMENCO_OCELOT_3=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index b8f457300bbf..82ff6fc0cd41 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39CONFIG_MOMENCO_OCELOT_C=y 39CONFIG_MOMENCO_OCELOT_C=y
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index 8ade072271cd..15a027e00eec 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -39,7 +39,6 @@ CONFIG_MOMENCO_OCELOT=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig
index d20a2216c11d..7078e6b3ea11 100644
--- a/arch/mips/configs/ocelot_g_defconfig
+++ b/arch/mips/configs/ocelot_g_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40CONFIG_MOMENCO_OCELOT_G=y 40CONFIG_MOMENCO_OCELOT_G=y
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 33fcc8133bc0..69678d99ae61 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_PB1100=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index e07c55dc8dc1..070672799dac 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_PB1500=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index df210dd22476..354e49b7a5f1 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_PB1550=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
index 106a1641c0b5..fae16c5ec521 100644
--- a/arch/mips/configs/pnx8550-jbs_defconfig
+++ b/arch/mips/configs/pnx8550-jbs_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43CONFIG_PNX8550_JBS=y 42CONFIG_PNX8550_JBS=y
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/pnx8550-stb810_defconfig b/arch/mips/configs/pnx8550-stb810_defconfig
index 8caa2cd1aa7c..cd821e52181d 100644
--- a/arch/mips/configs/pnx8550-stb810_defconfig
+++ b/arch/mips/configs/pnx8550-stb810_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44CONFIG_PNX8550_STB810=y 43CONFIG_PNX8550_STB810=y
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
index 43f1becec2a4..3d6c2d743502 100644
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ b/arch/mips/configs/pnx8550-v2pci_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42CONFIG_PNX8550_V2PCI=y
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/qemu_defconfig b/arch/mips/configs/qemu_defconfig
index f68396d19f9a..8e8d03157954 100644
--- a/arch/mips/configs/qemu_defconfig
+++ b/arch/mips/configs/qemu_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig
index a6a824fcc874..29e0df9f4be0 100644
--- a/arch/mips/configs/rbhma4500_defconfig
+++ b/arch/mips/configs/rbhma4500_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index bee3702d501d..5593cde9f74c 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index 3c891ed10141..6c4f09a381e2 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index e31d964a053b..988b9cdef01f 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -39,7 +39,6 @@ CONFIG_MIPS_SEAD=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index 5771c1aee76a..b5be8b74d896 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index a8eb4b182d34..1756d2bdf6b8 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
index c58afa2eac6b..8bb6be4342b6 100644
--- a/arch/mips/configs/tb0287_defconfig
+++ b/arch/mips/configs/tb0287_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index 2abbd6827720..8f019ffcc71b 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/wrppmc_defconfig b/arch/mips/configs/wrppmc_defconfig
index 44b6b7c1fdb6..52b48c0715d3 100644
--- a/arch/mips/configs/wrppmc_defconfig
+++ b/arch/mips/configs/wrppmc_defconfig
@@ -39,7 +39,6 @@ CONFIG_WR_PPMC=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index f24e1c6fc484..6824606309e5 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c
index bf2858071f1f..a217aafe59f6 100644
--- a/arch/mips/dec/prom/init.c
+++ b/arch/mips/dec/prom/init.c
@@ -103,9 +103,6 @@ void __init prom_init(void)
103 if (prom_is_rex(magic)) 103 if (prom_is_rex(magic))
104 rex_clear_cache(); 104 rex_clear_cache();
105 105
106 /* Register the early console. */
107 register_prom_console();
108
109 /* Were we compiled with the right CPU option? */ 106 /* Were we compiled with the right CPU option? */
110#if defined(CONFIG_CPU_R3000) 107#if defined(CONFIG_CPU_R3000)
111 if ((current_cpu_data.cputype == CPU_R4000SC) || 108 if ((current_cpu_data.cputype == CPU_R4000SC) ||
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index 8cb8f5919194..41211f8b7738 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y
39# CONFIG_MOMENCO_OCELOT_C is not set 39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 42# CONFIG_PNX8550_JBS is not set
44# CONFIG_PNX8550_STB810 is not set 43# CONFIG_PNX8550_STB810 is not set
45# CONFIG_DDB5477 is not set 44# CONFIG_DDB5477 is not set
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index 5929f883e46b..241ee7a2906e 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -70,6 +70,7 @@ static int sp_stopping = 0;
70#define MTSP_SYSCALL_GETTIME (MTSP_SYSCALL_BASE + 7) 70#define MTSP_SYSCALL_GETTIME (MTSP_SYSCALL_BASE + 7)
71#define MTSP_SYSCALL_PIPEFREQ (MTSP_SYSCALL_BASE + 8) 71#define MTSP_SYSCALL_PIPEFREQ (MTSP_SYSCALL_BASE + 8)
72#define MTSP_SYSCALL_GETTOD (MTSP_SYSCALL_BASE + 9) 72#define MTSP_SYSCALL_GETTOD (MTSP_SYSCALL_BASE + 9)
73#define MTSP_SYSCALL_IOCTL (MTSP_SYSCALL_BASE + 10)
73 74
74#define MTSP_O_RDONLY 0x0000 75#define MTSP_O_RDONLY 0x0000
75#define MTSP_O_WRONLY 0x0001 76#define MTSP_O_WRONLY 0x0001
@@ -110,7 +111,8 @@ struct apsp_table syscall_command_table[] = {
110 { MTSP_SYSCALL_CLOSE, __NR_close }, 111 { MTSP_SYSCALL_CLOSE, __NR_close },
111 { MTSP_SYSCALL_READ, __NR_read }, 112 { MTSP_SYSCALL_READ, __NR_read },
112 { MTSP_SYSCALL_WRITE, __NR_write }, 113 { MTSP_SYSCALL_WRITE, __NR_write },
113 { MTSP_SYSCALL_LSEEK32, __NR_lseek } 114 { MTSP_SYSCALL_LSEEK32, __NR_lseek },
115 { MTSP_SYSCALL_IOCTL, __NR_ioctl }
114}; 116};
115 117
116static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3) 118static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3)
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 30d433f14f93..1df544c1f966 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -564,49 +564,3 @@ _sys32_clone(nabi_no_regargs struct pt_regs regs)
564 return do_fork(clone_flags, newsp, &regs, 0, 564 return do_fork(clone_flags, newsp, &regs, 0,
565 parent_tidptr, child_tidptr); 565 parent_tidptr, child_tidptr);
566} 566}
567
568/*
569 * Implement the event wait interface for the eventpoll file. It is the kernel
570 * part of the user space epoll_pwait(2).
571 */
572asmlinkage long compat_sys_epoll_pwait(int epfd,
573 struct epoll_event __user *events, int maxevents, int timeout,
574 const compat_sigset_t __user *sigmask, size_t sigsetsize)
575{
576 int error;
577 sigset_t ksigmask, sigsaved;
578
579 /*
580 * If the caller wants a certain signal mask to be set during the wait,
581 * we apply it here.
582 */
583 if (sigmask) {
584 if (sigsetsize != sizeof(sigset_t))
585 return -EINVAL;
586 if (!access_ok(VERIFY_READ, sigmask, sizeof(ksigmask)))
587 return -EFAULT;
588 if (__copy_conv_sigset_from_user(&ksigmask, sigmask))
589 return -EFAULT;
590 sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP));
591 sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
592 }
593
594 error = sys_epoll_wait(epfd, events, maxevents, timeout);
595
596 /*
597 * If we changed the signal mask, we need to restore the original one.
598 * In case we've got a signal while waiting, we do not restore the
599 * signal mask yet, and we allow do_signal() to deliver the signal on
600 * the way back to userspace, before the signal mask is restored.
601 */
602 if (sigmask) {
603 if (error == -EINTR) {
604 memcpy(&current->saved_sigmask, &sigsaved,
605 sizeof(sigsaved));
606 set_thread_flag(TIF_RESTORE_SIGMASK);
607 } else
608 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
609 }
610
611 return error;
612}
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 2ef857c3ee53..225755d0c1f6 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -37,6 +37,7 @@ EXPORT_SYMBOL(kernel_thread);
37 * Userspace access stuff. 37 * Userspace access stuff.
38 */ 38 */
39EXPORT_SYMBOL(__copy_user); 39EXPORT_SYMBOL(__copy_user);
40EXPORT_SYMBOL(__copy_user_inatomic);
40EXPORT_SYMBOL(__bzero); 41EXPORT_SYMBOL(__bzero);
41EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm); 42EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm);
42EXPORT_SYMBOL(__strncpy_from_user_asm); 43EXPORT_SYMBOL(__strncpy_from_user_asm);
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 7c0b3936ba44..0c9a9ff8cd25 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -656,6 +656,8 @@ einval: li v0, -EINVAL
656 sys sys_kexec_load 4 656 sys sys_kexec_load 4
657 sys sys_getcpu 3 657 sys sys_getcpu 3
658 sys sys_epoll_pwait 6 658 sys sys_epoll_pwait 6
659 sys sys_ioprio_set 3
660 sys sys_ioprio_get 2
659 .endm 661 .endm
660 662
661 /* We pre-compute the number of _instruction_ bytes needed to 663 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index e569b846e9a3..23f3b118f718 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -471,3 +471,6 @@ sys_call_table:
471 PTR sys_kexec_load /* 5270 */ 471 PTR sys_kexec_load /* 5270 */
472 PTR sys_getcpu 472 PTR sys_getcpu
473 PTR sys_epoll_pwait 473 PTR sys_epoll_pwait
474 PTR sys_ioprio_set
475 PTR sys_ioprio_get
476 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index f17e31e3bff2..6eac28337423 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -395,5 +395,8 @@ EXPORT(sysn32_call_table)
395 PTR compat_sys_set_robust_list 395 PTR compat_sys_set_robust_list
396 PTR compat_sys_get_robust_list 396 PTR compat_sys_get_robust_list
397 PTR compat_sys_kexec_load 397 PTR compat_sys_kexec_load
398 PTR sys_getcpu 398 PTR sys_getcpu /* 6275 */
399 PTR compat_sys_epoll_pwait 399 PTR compat_sys_epoll_pwait
400 PTR sys_ioprio_set
401 PTR sys_ioprio_get
402 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 142c9b70c026..7e74b412a782 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -519,4 +519,6 @@ sys_call_table:
519 PTR compat_sys_kexec_load 519 PTR compat_sys_kexec_load
520 PTR sys_getcpu 520 PTR sys_getcpu
521 PTR compat_sys_epoll_pwait 521 PTR compat_sys_epoll_pwait
522 PTR sys_ioprio_set
523 PTR sys_ioprio_get /* 4315 */
522 .size sys_call_table,.-sys_call_table 524 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index b11337600129..1acdf091c258 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -251,8 +251,6 @@ void __init mips_ejtag_setup (void)
251 251
252void __init prom_init(void) 252void __init prom_init(void)
253{ 253{
254 u32 start, map, mask, data;
255
256 prom_argc = fw_arg0; 254 prom_argc = fw_arg0;
257 _prom_argv = (int *) fw_arg1; 255 _prom_argv = (int *) fw_arg1;
258 _prom_envp = (int *) fw_arg2; 256 _prom_envp = (int *) fw_arg2;
@@ -278,6 +276,8 @@ void __init prom_init(void)
278 mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_MSC; 276 mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_MSC;
279 } 277 }
280 switch(mips_revision_corid) { 278 switch(mips_revision_corid) {
279 u32 start, map, mask, data;
280
281 case MIPS_REVISION_CORID_QED_RM5261: 281 case MIPS_REVISION_CORID_QED_RM5261:
282 case MIPS_REVISION_CORID_CORE_LV: 282 case MIPS_REVISION_CORID_CORE_LV:
283 case MIPS_REVISION_CORID_CORE_FPGA: 283 case MIPS_REVISION_CORID_CORE_FPGA:
diff --git a/arch/mips/mips-boards/malta/Makefile b/arch/mips/mips-boards/malta/Makefile
index cb7f349b0514..377d9e8f250a 100644
--- a/arch/mips/mips-boards/malta/Makefile
+++ b/arch/mips/mips-boards/malta/Makefile
@@ -21,4 +21,4 @@
21 21
22obj-y := malta_int.o malta_setup.o 22obj-y := malta_int.o malta_setup.o
23obj-$(CONFIG_MTD) += malta_mtd.o 23obj-$(CONFIG_MTD) += malta_mtd.o
24obj-$(CONFIG_SMP) += malta_smp.o 24obj-$(CONFIG_MIPS_MT_SMTC) += malta_smtc.o
diff --git a/arch/mips/mips-boards/malta/malta_smp.c b/arch/mips/mips-boards/malta/malta_smtc.c
index cf967170fe29..d1c80f631100 100644
--- a/arch/mips/mips-boards/malta/malta_smp.c
+++ b/arch/mips/mips-boards/malta/malta_smtc.c
@@ -1,25 +1,14 @@
1/* 1/*
2 * Malta Platform-specific hooks for SMP operation 2 * Malta Platform-specific hooks for SMP operation
3 */ 3 */
4#include <linux/init.h>
4 5
5#include <linux/kernel.h> 6#include <asm/mipsregs.h>
6#include <linux/sched.h> 7#include <asm/mipsmtregs.h>
7#include <linux/cpumask.h> 8#include <asm/smtc.h>
8#include <linux/interrupt.h>
9
10#include <asm/atomic.h>
11#include <asm/cpu.h>
12#include <asm/processor.h>
13#include <asm/system.h>
14#include <asm/hardirq.h>
15#include <asm/mmu_context.h>
16#include <asm/smp.h>
17#ifdef CONFIG_MIPS_MT_SMTC
18#include <asm/smtc_ipi.h> 9#include <asm/smtc_ipi.h>
19#endif /* CONFIG_MIPS_MT_SMTC */
20 10
21/* VPE/SMP Prototype implements platform interfaces directly */ 11/* VPE/SMP Prototype implements platform interfaces directly */
22#if !defined(CONFIG_MIPS_MT_SMP)
23 12
24/* 13/*
25 * Cause the specified action to be performed on a targeted "CPU" 14 * Cause the specified action to be performed on a targeted "CPU"
@@ -27,10 +16,8 @@
27 16
28void core_send_ipi(int cpu, unsigned int action) 17void core_send_ipi(int cpu, unsigned int action)
29{ 18{
30/* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */ 19 /* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */
31#ifdef CONFIG_MIPS_MT_SMTC
32 smtc_send_ipi(cpu, LINUX_SMP_IPI, action); 20 smtc_send_ipi(cpu, LINUX_SMP_IPI, action);
33#endif /* CONFIG_MIPS_MT_SMTC */
34} 21}
35 22
36/* 23/*
@@ -39,9 +26,7 @@ void core_send_ipi(int cpu, unsigned int action)
39 26
40void prom_boot_secondary(int cpu, struct task_struct *idle) 27void prom_boot_secondary(int cpu, struct task_struct *idle)
41{ 28{
42#ifdef CONFIG_MIPS_MT_SMTC
43 smtc_boot_secondary(cpu, idle); 29 smtc_boot_secondary(cpu, idle);
44#endif /* CONFIG_MIPS_MT_SMTC */
45} 30}
46 31
47/* 32/*
@@ -50,7 +35,6 @@ void prom_boot_secondary(int cpu, struct task_struct *idle)
50 35
51void prom_init_secondary(void) 36void prom_init_secondary(void)
52{ 37{
53#ifdef CONFIG_MIPS_MT_SMTC
54 void smtc_init_secondary(void); 38 void smtc_init_secondary(void);
55 int myvpe; 39 int myvpe;
56 40
@@ -65,7 +49,6 @@ void prom_init_secondary(void)
65 } 49 }
66 50
67 smtc_init_secondary(); 51 smtc_init_secondary();
68#endif /* CONFIG_MIPS_MT_SMTC */
69} 52}
70 53
71/* 54/*
@@ -93,9 +76,7 @@ void __init plat_prepare_cpus(unsigned int max_cpus)
93 76
94void prom_smp_finish(void) 77void prom_smp_finish(void)
95{ 78{
96#ifdef CONFIG_MIPS_MT_SMTC
97 smtc_smp_finish(); 79 smtc_smp_finish();
98#endif /* CONFIG_MIPS_MT_SMTC */
99} 80}
100 81
101/* 82/*
@@ -105,5 +86,3 @@ void prom_smp_finish(void)
105void prom_cpus_done(void) 86void prom_cpus_done(void)
106{ 87{
107} 88}
108
109#endif /* CONFIG_MIPS32R2_MT_SMP */
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index f32ebde30ccf..560a6de96556 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -128,7 +128,6 @@ static inline void tx39_flush_cache_all(void)
128 return; 128 return;
129 129
130 tx39_blast_dcache(); 130 tx39_blast_dcache();
131 tx39_blast_icache();
132} 131}
133 132
134static inline void tx39___flush_cache_all(void) 133static inline void tx39___flush_cache_all(void)
@@ -142,24 +141,19 @@ static void tx39_flush_cache_mm(struct mm_struct *mm)
142 if (!cpu_has_dc_aliases) 141 if (!cpu_has_dc_aliases)
143 return; 142 return;
144 143
145 if (cpu_context(smp_processor_id(), mm) != 0) { 144 if (cpu_context(smp_processor_id(), mm) != 0)
146 tx39_flush_cache_all(); 145 tx39_blast_dcache();
147 }
148} 146}
149 147
150static void tx39_flush_cache_range(struct vm_area_struct *vma, 148static void tx39_flush_cache_range(struct vm_area_struct *vma,
151 unsigned long start, unsigned long end) 149 unsigned long start, unsigned long end)
152{ 150{
153 int exec; 151 if (!cpu_has_dc_aliases)
154 152 return;
155 if (!(cpu_context(smp_processor_id(), vma->vm_mm))) 153 if (!(cpu_context(smp_processor_id(), vma->vm_mm)))
156 return; 154 return;
157 155
158 exec = vma->vm_flags & VM_EXEC; 156 tx39_blast_dcache();
159 if (cpu_has_dc_aliases || exec)
160 tx39_blast_dcache();
161 if (exec)
162 tx39_blast_icache();
163} 157}
164 158
165static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn) 159static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn)
@@ -218,7 +212,7 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page
218 212
219static void local_tx39_flush_data_cache_page(void * addr) 213static void local_tx39_flush_data_cache_page(void * addr)
220{ 214{
221 tx39_blast_dcache_page(addr); 215 tx39_blast_dcache_page((unsigned long)addr);
222} 216}
223 217
224static void tx39_flush_data_cache_page(unsigned long addr) 218static void tx39_flush_data_cache_page(unsigned long addr)
diff --git a/arch/mips/momentum/jaguar_atx/platform.c b/arch/mips/momentum/jaguar_atx/platform.c
index 771e55f39875..561844878a90 100644
--- a/arch/mips/momentum/jaguar_atx/platform.c
+++ b/arch/mips/momentum/jaguar_atx/platform.c
@@ -48,6 +48,8 @@ static struct resource mv64x60_eth0_resources[] = {
48}; 48};
49 49
50static struct mv643xx_eth_platform_data eth0_pd = { 50static struct mv643xx_eth_platform_data eth0_pd = {
51 .port_number = 0,
52
51 .tx_sram_addr = MV_SRAM_BASE_ETH0, 53 .tx_sram_addr = MV_SRAM_BASE_ETH0,
52 .tx_sram_size = MV_SRAM_TXRING_SIZE, 54 .tx_sram_size = MV_SRAM_TXRING_SIZE,
53 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, 55 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
@@ -77,6 +79,8 @@ static struct resource mv64x60_eth1_resources[] = {
77}; 79};
78 80
79static struct mv643xx_eth_platform_data eth1_pd = { 81static struct mv643xx_eth_platform_data eth1_pd = {
82 .port_number = 1,
83
80 .tx_sram_addr = MV_SRAM_BASE_ETH1, 84 .tx_sram_addr = MV_SRAM_BASE_ETH1,
81 .tx_sram_size = MV_SRAM_TXRING_SIZE, 85 .tx_sram_size = MV_SRAM_TXRING_SIZE,
82 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, 86 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
@@ -105,7 +109,9 @@ static struct resource mv64x60_eth2_resources[] = {
105 }, 109 },
106}; 110};
107 111
108static struct mv643xx_eth_platform_data eth2_pd; 112static struct mv643xx_eth_platform_data eth2_pd = {
113 .port_number = 2,
114};
109 115
110static struct platform_device eth2_device = { 116static struct platform_device eth2_device = {
111 .name = MV643XX_ETH_NAME, 117 .name = MV643XX_ETH_NAME,
diff --git a/arch/mips/momentum/ocelot_3/platform.c b/arch/mips/momentum/ocelot_3/platform.c
index b80733f0c66d..44e4c3fc7403 100644
--- a/arch/mips/momentum/ocelot_3/platform.c
+++ b/arch/mips/momentum/ocelot_3/platform.c
@@ -48,6 +48,8 @@ static struct resource mv64x60_eth0_resources[] = {
48}; 48};
49 49
50static struct mv643xx_eth_platform_data eth0_pd = { 50static struct mv643xx_eth_platform_data eth0_pd = {
51 .port_number = 0,
52
51 .tx_sram_addr = MV_SRAM_BASE_ETH0, 53 .tx_sram_addr = MV_SRAM_BASE_ETH0,
52 .tx_sram_size = MV_SRAM_TXRING_SIZE, 54 .tx_sram_size = MV_SRAM_TXRING_SIZE,
53 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, 55 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
@@ -77,6 +79,8 @@ static struct resource mv64x60_eth1_resources[] = {
77}; 79};
78 80
79static struct mv643xx_eth_platform_data eth1_pd = { 81static struct mv643xx_eth_platform_data eth1_pd = {
82 .port_number = 1,
83
80 .tx_sram_addr = MV_SRAM_BASE_ETH1, 84 .tx_sram_addr = MV_SRAM_BASE_ETH1,
81 .tx_sram_size = MV_SRAM_TXRING_SIZE, 85 .tx_sram_size = MV_SRAM_TXRING_SIZE,
82 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, 86 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
@@ -105,7 +109,9 @@ static struct resource mv64x60_eth2_resources[] = {
105 }, 109 },
106}; 110};
107 111
108static struct mv643xx_eth_platform_data eth2_pd; 112static struct mv643xx_eth_platform_data eth2_pd = {
113 .port_number = 2,
114};
109 115
110static struct platform_device eth2_device = { 116static struct platform_device eth2_device = {
111 .name = MV643XX_ETH_NAME, 117 .name = MV643XX_ETH_NAME,
diff --git a/arch/mips/momentum/ocelot_c/platform.c b/arch/mips/momentum/ocelot_c/platform.c
index f7cd303f3eba..7780aa0c6555 100644
--- a/arch/mips/momentum/ocelot_c/platform.c
+++ b/arch/mips/momentum/ocelot_c/platform.c
@@ -47,6 +47,8 @@ static struct resource mv64x60_eth0_resources[] = {
47}; 47};
48 48
49static struct mv643xx_eth_platform_data eth0_pd = { 49static struct mv643xx_eth_platform_data eth0_pd = {
50 .port_number = 0,
51
50 .tx_sram_addr = MV_SRAM_BASE_ETH0, 52 .tx_sram_addr = MV_SRAM_BASE_ETH0,
51 .tx_sram_size = MV_SRAM_TXRING_SIZE, 53 .tx_sram_size = MV_SRAM_TXRING_SIZE,
52 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, 54 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
@@ -76,6 +78,8 @@ static struct resource mv64x60_eth1_resources[] = {
76}; 78};
77 79
78static struct mv643xx_eth_platform_data eth1_pd = { 80static struct mv643xx_eth_platform_data eth1_pd = {
81 .port_number = 1,
82
79 .tx_sram_addr = MV_SRAM_BASE_ETH1, 83 .tx_sram_addr = MV_SRAM_BASE_ETH1,
80 .tx_sram_size = MV_SRAM_TXRING_SIZE, 84 .tx_sram_size = MV_SRAM_TXRING_SIZE,
81 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, 85 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 9d08608aaa51..69a8bcfe72b2 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -74,13 +74,13 @@ static inline void w_c0_ ## r ## n(unsigned int value) \
74 74
75__define_perf_accessors(perfcntr, 0, 2) 75__define_perf_accessors(perfcntr, 0, 2)
76__define_perf_accessors(perfcntr, 1, 3) 76__define_perf_accessors(perfcntr, 1, 3)
77__define_perf_accessors(perfcntr, 2, 2) 77__define_perf_accessors(perfcntr, 2, 0)
78__define_perf_accessors(perfcntr, 3, 2) 78__define_perf_accessors(perfcntr, 3, 1)
79 79
80__define_perf_accessors(perfctrl, 0, 2) 80__define_perf_accessors(perfctrl, 0, 2)
81__define_perf_accessors(perfctrl, 1, 3) 81__define_perf_accessors(perfctrl, 1, 3)
82__define_perf_accessors(perfctrl, 2, 2) 82__define_perf_accessors(perfctrl, 2, 0)
83__define_perf_accessors(perfctrl, 3, 2) 83__define_perf_accessors(perfctrl, 3, 1)
84 84
85struct op_mips_model op_model_mipsxx_ops; 85struct op_mips_model op_model_mipsxx_ops;
86 86
@@ -97,7 +97,6 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr)
97 int i; 97 int i;
98 98
99 /* Compute the performance counter control word. */ 99 /* Compute the performance counter control word. */
100 /* For now count kernel and user mode */
101 for (i = 0; i < counters; i++) { 100 for (i = 0; i < counters; i++) {
102 reg.control[i] = 0; 101 reg.control[i] = 0;
103 reg.counter[i] = 0; 102 reg.counter[i] = 0;
@@ -234,9 +233,6 @@ static inline int n_counters(void)
234 counters = __n_counters(); 233 counters = __n_counters();
235 } 234 }
236 235
237#ifdef CONFIG_MIPS_MT_SMP
238 counters >> 1;
239#endif
240 return counters; 236 return counters;
241} 237}
242 238
@@ -270,6 +266,10 @@ static int __init mipsxx_init(void)
270 266
271 reset_counters(counters); 267 reset_counters(counters);
272 268
269#ifdef CONFIG_MIPS_MT_SMP
270 counters >>= 1;
271#endif
272
273 op_model_mipsxx_ops.num_counters = counters; 273 op_model_mipsxx_ops.num_counters = counters;
274 switch (current_cpu_data.cputype) { 274 switch (current_cpu_data.cputype) {
275 case CPU_20KC: 275 case CPU_20KC:
@@ -326,7 +326,11 @@ static int __init mipsxx_init(void)
326 326
327static void mipsxx_exit(void) 327static void mipsxx_exit(void)
328{ 328{
329 reset_counters(op_model_mipsxx_ops.num_counters); 329 int counters = op_model_mipsxx_ops.num_counters;
330#ifdef CONFIG_MIPS_MT_SMP
331 counters <<= 1;
332#endif
333 reset_counters(counters);
330 334
331 perf_irq = null_perf_irq; 335 perf_irq = null_perf_irq;
332} 336}
diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c
index d48665ebd33c..b1c4805a0b92 100644
--- a/arch/mips/philips/pnx8550/common/int.c
+++ b/arch/mips/philips/pnx8550/common/int.c
@@ -204,19 +204,7 @@ void __init arch_init_irq(void)
204 * Note, PCI INTA is active low on the bus, but inverted 204 * Note, PCI INTA is active low on the bus, but inverted
205 * in the GIC, so to us it's active high. 205 * in the GIC, so to us it's active high.
206 */ 206 */
207#ifdef CONFIG_PNX8550_V2PCI 207 PNX8550_GIC_REQ(i - PNX8550_INT_GIC_MIN) = 0x1E000000;
208 if (gic_int_line == (PNX8550_INT_GPIO0 - PNX8550_INT_GIC_MIN)) {
209 /* PCI INT through gpio 8, which is setup in
210 * pnx8550_setup.c and routed to GPIO
211 * Interrupt Level 0 (GPIO Connection 58).
212 * Set it active low. */
213
214 PNX8550_GIC_REQ(gic_int_line) = 0x1E020000;
215 } else
216#endif
217 {
218 PNX8550_GIC_REQ(i - PNX8550_INT_GIC_MIN) = 0x1E000000;
219 }
220 208
221 /* mask/priority is still 0 so we will not get any 209 /* mask/priority is still 0 so we will not get any
222 * interrupts until it is unmasked */ 210 * interrupts until it is unmasked */
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c
index 9094baf31d0e..74158d349630 100644
--- a/arch/mips/sgi-ip27/ip27-init.c
+++ b/arch/mips/sgi-ip27/ip27-init.c
@@ -191,7 +191,6 @@ static inline void ioc3_eth_init(void)
191 ioc3->eier = 0; 191 ioc3->eier = 0;
192} 192}
193 193
194extern void ip27_setup_console(void);
195extern void ip27_time_init(void); 194extern void ip27_time_init(void);
196extern void ip27_reboot_setup(void); 195extern void ip27_reboot_setup(void);
197 196
@@ -200,7 +199,6 @@ void __init plat_mem_setup(void)
200 hubreg_t p, e, n_mode; 199 hubreg_t p, e, n_mode;
201 nasid_t nid; 200 nasid_t nid;
202 201
203 ip27_setup_console();
204 ip27_reboot_setup(); 202 ip27_reboot_setup();
205 203
206 /* 204 /*
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig
index 67dac6204b6d..bdf24a7b5494 100644
--- a/arch/mips/sibyte/Kconfig
+++ b/arch/mips/sibyte/Kconfig
@@ -1,31 +1,35 @@
1config SIBYTE_SB1250 1config SIBYTE_SB1250
2 bool 2 bool
3 select HW_HAS_PCI 3 select HW_HAS_PCI
4 select SIBYTE_HAS_LDT 4 select SIBYTE_ENABLE_LDT_IF_PCI
5 select SIBYTE_SB1xxx_SOC 5 select SIBYTE_SB1xxx_SOC
6 select SYS_SUPPORTS_SMP 6 select SYS_SUPPORTS_SMP
7 7
8config SIBYTE_BCM1120 8config SIBYTE_BCM1120
9 bool 9 bool
10 select SIBYTE_BCM112X 10 select SIBYTE_BCM112X
11 select SIBYTE_HAS_ZBUS_PROFILING
11 select SIBYTE_SB1xxx_SOC 12 select SIBYTE_SB1xxx_SOC
12 13
13config SIBYTE_BCM1125 14config SIBYTE_BCM1125
14 bool 15 bool
15 select HW_HAS_PCI 16 select HW_HAS_PCI
16 select SIBYTE_BCM112X 17 select SIBYTE_BCM112X
18 select SIBYTE_HAS_ZBUS_PROFILING
17 select SIBYTE_SB1xxx_SOC 19 select SIBYTE_SB1xxx_SOC
18 20
19config SIBYTE_BCM1125H 21config SIBYTE_BCM1125H
20 bool 22 bool
21 select HW_HAS_PCI 23 select HW_HAS_PCI
22 select SIBYTE_BCM112X 24 select SIBYTE_BCM112X
23 select SIBYTE_HAS_LDT 25 select SIBYTE_ENABLE_LDT_IF_PCI
26 select SIBYTE_HAS_ZBUS_PROFILING
24 select SIBYTE_SB1xxx_SOC 27 select SIBYTE_SB1xxx_SOC
25 28
26config SIBYTE_BCM112X 29config SIBYTE_BCM112X
27 bool 30 bool
28 select SIBYTE_SB1xxx_SOC 31 select SIBYTE_SB1xxx_SOC
32 select SIBYTE_HAS_ZBUS_PROFILING
29 33
30config SIBYTE_BCM1x80 34config SIBYTE_BCM1x80
31 bool 35 bool
@@ -37,6 +41,7 @@ config SIBYTE_BCM1x55
37 bool 41 bool
38 select HW_HAS_PCI 42 select HW_HAS_PCI
39 select SIBYTE_SB1xxx_SOC 43 select SIBYTE_SB1xxx_SOC
44 select SIBYTE_HAS_ZBUS_PROFILING
40 select SYS_SUPPORTS_SMP 45 select SYS_SUPPORTS_SMP
41 46
42config SIBYTE_SB1xxx_SOC 47config SIBYTE_SB1xxx_SOC
@@ -95,8 +100,10 @@ config CPU_SB1_PASS_2
95 100
96config SIBYTE_HAS_LDT 101config SIBYTE_HAS_LDT
97 bool 102 bool
98 depends on PCI && (SIBYTE_SB1250 || SIBYTE_BCM1125H) 103
99 default y 104config SIBYTE_ENABLE_LDT_IF_PCI
105 bool
106 select SIBYTE_HAS_LDT if PCI
100 107
101config SIMULATION 108config SIMULATION
102 bool "Running under simulation" 109 bool "Running under simulation"
@@ -162,5 +169,8 @@ config SIBYTE_SB1250_PROF
162 depends on SIBYTE_SB1xxx_SOC 169 depends on SIBYTE_SB1xxx_SOC
163 170
164config SIBYTE_TBPROF 171config SIBYTE_TBPROF
165 bool "Support for ZBbus profiling" 172 tristate "Support for ZBbus profiling"
166 depends on SIBYTE_SB1xxx_SOC 173 depends on SIBYTE_HAS_ZBUS_PROFILING
174
175config SIBYTE_HAS_ZBUS_PROFILING
176 bool
diff --git a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
index 212547c57310..ea0ca131a3cf 100644
--- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
+++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * Copyright (C) 2001, 2002, 2003 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or 2 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License 3 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2 4 * as published by the Free Software Foundation; either version 2
@@ -14,10 +12,16 @@
14 * You should have received a copy of the GNU General Public License 12 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software 13 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) 2001, 2002, 2003 Broadcom Corporation
17 * Copyright (C) 2007 Ralf Baechle <ralf@linux-mips.org>
18 * Copyright (C) 2007 MIPS Technologies, Inc.
19 * written by Ralf Baechle <ralf@linux-mips.org>
17 */ 20 */
18 21
19#define SBPROF_TB_DEBUG 0 22#undef DEBUG
20 23
24#include <linux/device.h>
21#include <linux/module.h> 25#include <linux/module.h>
22#include <linux/kernel.h> 26#include <linux/kernel.h>
23#include <linux/types.h> 27#include <linux/types.h>
@@ -27,24 +31,98 @@
27#include <linux/vmalloc.h> 31#include <linux/vmalloc.h>
28#include <linux/fs.h> 32#include <linux/fs.h>
29#include <linux/errno.h> 33#include <linux/errno.h>
30#include <linux/reboot.h> 34#include <linux/types.h>
31#include <linux/smp_lock.h>
32#include <linux/wait.h> 35#include <linux/wait.h>
33#include <asm/uaccess.h> 36
34#include <asm/io.h> 37#include <asm/io.h>
35#include <asm/sibyte/sb1250.h> 38#include <asm/sibyte/sb1250.h>
36#include <asm/sibyte/sb1250_regs.h> 39#include <asm/sibyte/sb1250_regs.h>
37#include <asm/sibyte/sb1250_scd.h> 40#include <asm/sibyte/sb1250_scd.h>
38#include <asm/sibyte/sb1250_int.h> 41#include <asm/sibyte/sb1250_int.h>
39#include <asm/sibyte/trace_prof.h> 42#include <asm/system.h>
43#include <asm/uaccess.h>
40 44
41#define DEVNAME "bcm1250_tbprof" 45#define SBPROF_TB_MAJOR 240
46
47typedef u64 tb_sample_t[6*256];
48
49enum open_status {
50 SB_CLOSED,
51 SB_OPENING,
52 SB_OPEN
53};
54
55struct sbprof_tb {
56 wait_queue_head_t tb_sync;
57 wait_queue_head_t tb_read;
58 struct mutex lock;
59 enum open_status open;
60 tb_sample_t *sbprof_tbbuf;
61 int next_tb_sample;
62
63 volatile int tb_enable;
64 volatile int tb_armed;
65
66};
42 67
43static struct sbprof_tb sbp; 68static struct sbprof_tb sbp;
44 69
70#define MAX_SAMPLE_BYTES (24*1024*1024)
71#define MAX_TBSAMPLE_BYTES (12*1024*1024)
72
73#define MAX_SAMPLES (MAX_SAMPLE_BYTES/sizeof(u_int32_t))
74#define TB_SAMPLE_SIZE (sizeof(tb_sample_t))
75#define MAX_TB_SAMPLES (MAX_TBSAMPLE_BYTES/TB_SAMPLE_SIZE)
76
77/* ioctls */
78#define SBPROF_ZBSTART _IOW('s', 0, int)
79#define SBPROF_ZBSTOP _IOW('s', 1, int)
80#define SBPROF_ZBWAITFULL _IOW('s', 2, int)
81
82/*
83 * Routines for using 40-bit SCD cycle counter
84 *
85 * Client responsible for either handling interrupts or making sure
86 * the cycles counter never saturates, e.g., by doing
87 * zclk_timer_init(0) at least every 2^40 - 1 ZCLKs.
88 */
89
90/*
91 * Configures SCD counter 0 to count ZCLKs starting from val;
92 * Configures SCD counters1,2,3 to count nothing.
93 * Must not be called while gathering ZBbus profiles.
94 */
95
96#define zclk_timer_init(val) \
97 __asm__ __volatile__ (".set push;" \
98 ".set mips64;" \
99 "la $8, 0xb00204c0;" /* SCD perf_cnt_cfg */ \
100 "sd %0, 0x10($8);" /* write val to counter0 */ \
101 "sd %1, 0($8);" /* config counter0 for zclks*/ \
102 ".set pop" \
103 : /* no outputs */ \
104 /* enable, counter0 */ \
105 : /* inputs */ "r"(val), "r" ((1ULL << 33) | 1ULL) \
106 : /* modifies */ "$8" )
107
108
109/* Reads SCD counter 0 and puts result in value
110 unsigned long long val; */
111#define zclk_get(val) \
112 __asm__ __volatile__ (".set push;" \
113 ".set mips64;" \
114 "la $8, 0xb00204c0;" /* SCD perf_cnt_cfg */ \
115 "ld %0, 0x10($8);" /* write val to counter0 */ \
116 ".set pop" \
117 : /* outputs */ "=r"(val) \
118 : /* inputs */ \
119 : /* modifies */ "$8" )
120
121#define DEVNAME "bcm1250_tbprof"
122
45#define TB_FULL (sbp.next_tb_sample == MAX_TB_SAMPLES) 123#define TB_FULL (sbp.next_tb_sample == MAX_TB_SAMPLES)
46 124
47/************************************************************************ 125/*
48 * Support for ZBbus sampling using the trace buffer 126 * Support for ZBbus sampling using the trace buffer
49 * 127 *
50 * We use the SCD performance counter interrupt, caused by a Zclk counter 128 * We use the SCD performance counter interrupt, caused by a Zclk counter
@@ -54,30 +132,36 @@ static struct sbprof_tb sbp;
54 * overflow. 132 * overflow.
55 * 133 *
56 * We map the interrupt for trace_buffer_freeze to handle it on CPU 0. 134 * We map the interrupt for trace_buffer_freeze to handle it on CPU 0.
57 * 135 */
58 ************************************************************************/
59 136
60static u_int64_t tb_period; 137static u64 tb_period;
61 138
62static void arm_tb(void) 139static void arm_tb(void)
63{ 140{
64 u_int64_t scdperfcnt; 141 u64 scdperfcnt;
65 u_int64_t next = (1ULL << 40) - tb_period; 142 u64 next = (1ULL << 40) - tb_period;
66 u_int64_t tb_options = M_SCD_TRACE_CFG_FREEZE_FULL; 143 u64 tb_options = M_SCD_TRACE_CFG_FREEZE_FULL;
67 /* Generate an SCD_PERFCNT interrupt in TB_PERIOD Zclks to 144
68 trigger start of trace. XXX vary sampling period */ 145 /*
146 * Generate an SCD_PERFCNT interrupt in TB_PERIOD Zclks to trigger
147 *start of trace. XXX vary sampling period
148 */
69 __raw_writeq(0, IOADDR(A_SCD_PERF_CNT_1)); 149 __raw_writeq(0, IOADDR(A_SCD_PERF_CNT_1));
70 scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG)); 150 scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG));
71 /* Unfortunately, in Pass 2 we must clear all counters to knock down 151
72 a previous interrupt request. This means that bus profiling 152 /*
73 requires ALL of the SCD perf counters. */ 153 * Unfortunately, in Pass 2 we must clear all counters to knock down a
154 * previous interrupt request. This means that bus profiling requires
155 * ALL of the SCD perf counters.
156 */
74 __raw_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) | 157 __raw_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) |
75 // keep counters 0,2,3 as is 158 /* keep counters 0,2,3 as is */
76 M_SPC_CFG_ENABLE | // enable counting 159 M_SPC_CFG_ENABLE | /* enable counting */
77 M_SPC_CFG_CLEAR | // clear all counters 160 M_SPC_CFG_CLEAR | /* clear all counters */
78 V_SPC_CFG_SRC1(1), // counter 1 counts cycles 161 V_SPC_CFG_SRC1(1), /* counter 1 counts cycles */
79 IOADDR(A_SCD_PERF_CNT_CFG)); 162 IOADDR(A_SCD_PERF_CNT_CFG));
80 __raw_writeq(next, IOADDR(A_SCD_PERF_CNT_1)); 163 __raw_writeq(next, IOADDR(A_SCD_PERF_CNT_1));
164
81 /* Reset the trace buffer */ 165 /* Reset the trace buffer */
82 __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); 166 __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG));
83#if 0 && defined(M_SCD_TRACE_CFG_FORCECNT) 167#if 0 && defined(M_SCD_TRACE_CFG_FORCECNT)
@@ -91,43 +175,45 @@ static void arm_tb(void)
91static irqreturn_t sbprof_tb_intr(int irq, void *dev_id) 175static irqreturn_t sbprof_tb_intr(int irq, void *dev_id)
92{ 176{
93 int i; 177 int i;
94 DBG(printk(DEVNAME ": tb_intr\n")); 178
179 pr_debug(DEVNAME ": tb_intr\n");
180
95 if (sbp.next_tb_sample < MAX_TB_SAMPLES) { 181 if (sbp.next_tb_sample < MAX_TB_SAMPLES) {
96 /* XXX should use XKPHYS to make writes bypass L2 */ 182 /* XXX should use XKPHYS to make writes bypass L2 */
97 u_int64_t *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++]; 183 u64 *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++];
98 /* Read out trace */ 184 /* Read out trace */
99 __raw_writeq(M_SCD_TRACE_CFG_START_READ, 185 __raw_writeq(M_SCD_TRACE_CFG_START_READ,
100 IOADDR(A_SCD_TRACE_CFG)); 186 IOADDR(A_SCD_TRACE_CFG));
101 __asm__ __volatile__ ("sync" : : : "memory"); 187 __asm__ __volatile__ ("sync" : : : "memory");
102 /* Loop runs backwards because bundles are read out in reverse order */ 188 /* Loop runs backwards because bundles are read out in reverse order */
103 for (i = 256 * 6; i > 0; i -= 6) { 189 for (i = 256 * 6; i > 0; i -= 6) {
104 // Subscripts decrease to put bundle in the order 190 /* Subscripts decrease to put bundle in the order */
105 // t0 lo, t0 hi, t1 lo, t1 hi, t2 lo, t2 hi 191 /* t0 lo, t0 hi, t1 lo, t1 hi, t2 lo, t2 hi */
106 p[i - 1] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); 192 p[i - 1] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
107 // read t2 hi 193 /* read t2 hi */
108 p[i - 2] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); 194 p[i - 2] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
109 // read t2 lo 195 /* read t2 lo */
110 p[i - 3] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); 196 p[i - 3] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
111 // read t1 hi 197 /* read t1 hi */
112 p[i - 4] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); 198 p[i - 4] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
113 // read t1 lo 199 /* read t1 lo */
114 p[i - 5] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); 200 p[i - 5] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
115 // read t0 hi 201 /* read t0 hi */
116 p[i - 6] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); 202 p[i - 6] = __raw_readq(IOADDR(A_SCD_TRACE_READ));
117 // read t0 lo 203 /* read t0 lo */
118 } 204 }
119 if (!sbp.tb_enable) { 205 if (!sbp.tb_enable) {
120 DBG(printk(DEVNAME ": tb_intr shutdown\n")); 206 pr_debug(DEVNAME ": tb_intr shutdown\n");
121 __raw_writeq(M_SCD_TRACE_CFG_RESET, 207 __raw_writeq(M_SCD_TRACE_CFG_RESET,
122 IOADDR(A_SCD_TRACE_CFG)); 208 IOADDR(A_SCD_TRACE_CFG));
123 sbp.tb_armed = 0; 209 sbp.tb_armed = 0;
124 wake_up(&sbp.tb_sync); 210 wake_up(&sbp.tb_sync);
125 } else { 211 } else {
126 arm_tb(); // knock down current interrupt and get another one later 212 arm_tb(); /* knock down current interrupt and get another one later */
127 } 213 }
128 } else { 214 } else {
129 /* No more trace buffer samples */ 215 /* No more trace buffer samples */
130 DBG(printk(DEVNAME ": tb_intr full\n")); 216 pr_debug(DEVNAME ": tb_intr full\n");
131 __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); 217 __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG));
132 sbp.tb_armed = 0; 218 sbp.tb_armed = 0;
133 if (!sbp.tb_enable) { 219 if (!sbp.tb_enable) {
@@ -135,6 +221,7 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id)
135 } 221 }
136 wake_up(&sbp.tb_read); 222 wake_up(&sbp.tb_read);
137 } 223 }
224
138 return IRQ_HANDLED; 225 return IRQ_HANDLED;
139} 226}
140 227
@@ -144,23 +231,30 @@ static irqreturn_t sbprof_pc_intr(int irq, void *dev_id)
144 return IRQ_NONE; 231 return IRQ_NONE;
145} 232}
146 233
147int sbprof_zbprof_start(struct file *filp) 234/*
235 * Requires: Already called zclk_timer_init with a value that won't
236 * saturate 40 bits. No subsequent use of SCD performance counters
237 * or trace buffer.
238 */
239
240static int sbprof_zbprof_start(struct file *filp)
148{ 241{
149 u_int64_t scdperfcnt; 242 u64 scdperfcnt;
243 int err;
150 244
151 if (sbp.tb_enable) 245 if (xchg(&sbp.tb_enable, 1))
152 return -EBUSY; 246 return -EBUSY;
153 247
154 DBG(printk(DEVNAME ": starting\n")); 248 pr_debug(DEVNAME ": starting\n");
155 249
156 sbp.tb_enable = 1;
157 sbp.next_tb_sample = 0; 250 sbp.next_tb_sample = 0;
158 filp->f_pos = 0; 251 filp->f_pos = 0;
159 252
160 if (request_irq 253 err = request_irq(K_INT_TRACE_FREEZE, sbprof_tb_intr, 0,
161 (K_INT_TRACE_FREEZE, sbprof_tb_intr, 0, DEVNAME " trace freeze", &sbp)) { 254 DEVNAME " trace freeze", &sbp);
255 if (err)
162 return -EBUSY; 256 return -EBUSY;
163 } 257
164 /* Make sure there isn't a perf-cnt interrupt waiting */ 258 /* Make sure there isn't a perf-cnt interrupt waiting */
165 scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG)); 259 scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG));
166 /* Disable and clear counters, override SRC_1 */ 260 /* Disable and clear counters, override SRC_1 */
@@ -168,18 +262,21 @@ int sbprof_zbprof_start(struct file *filp)
168 M_SPC_CFG_ENABLE | M_SPC_CFG_CLEAR | V_SPC_CFG_SRC1(1), 262 M_SPC_CFG_ENABLE | M_SPC_CFG_CLEAR | V_SPC_CFG_SRC1(1),
169 IOADDR(A_SCD_PERF_CNT_CFG)); 263 IOADDR(A_SCD_PERF_CNT_CFG));
170 264
171 /* We grab this interrupt to prevent others from trying to use 265 /*
172 it, even though we don't want to service the interrupts 266 * We grab this interrupt to prevent others from trying to use it, even
173 (they only feed into the trace-on-interrupt mechanism) */ 267 * though we don't want to service the interrupts (they only feed into
174 if (request_irq 268 * the trace-on-interrupt mechanism)
175 (K_INT_PERF_CNT, sbprof_pc_intr, 0, DEVNAME " scd perfcnt", &sbp)) { 269 */
176 free_irq(K_INT_TRACE_FREEZE, &sbp); 270 err = request_irq(K_INT_PERF_CNT, sbprof_pc_intr, 0,
177 return -EBUSY; 271 DEVNAME " scd perfcnt", &sbp);
178 } 272 if (err)
179 273 goto out_free_irq;
180 /* I need the core to mask these, but the interrupt mapper to 274
181 pass them through. I am exploiting my knowledge that 275 /*
182 cp0_status masks out IP[5]. krw */ 276 * I need the core to mask these, but the interrupt mapper to pass them
277 * through. I am exploiting my knowledge that cp0_status masks out
278 * IP[5]. krw
279 */
183 __raw_writeq(K_INT_MAP_I3, 280 __raw_writeq(K_INT_MAP_I3,
184 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + 281 IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) +
185 (K_INT_PERF_CNT << 3))); 282 (K_INT_PERF_CNT << 3)));
@@ -201,7 +298,7 @@ int sbprof_zbprof_start(struct file *filp)
201 __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3)); 298 __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3));
202 299
203 /* Initialize Trace Event 0-7 */ 300 /* Initialize Trace Event 0-7 */
204 // when interrupt 301 /* when interrupt */
205 __raw_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0)); 302 __raw_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0));
206 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1)); 303 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1));
207 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2)); 304 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2));
@@ -212,10 +309,10 @@ int sbprof_zbprof_start(struct file *filp)
212 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7)); 309 __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7));
213 310
214 /* Initialize Trace Sequence 0-7 */ 311 /* Initialize Trace Sequence 0-7 */
215 // Start on event 0 (interrupt) 312 /* Start on event 0 (interrupt) */
216 __raw_writeq(V_SCD_TRSEQ_FUNC_START | 0x0fff, 313 __raw_writeq(V_SCD_TRSEQ_FUNC_START | 0x0fff,
217 IOADDR(A_SCD_TRACE_SEQUENCE_0)); 314 IOADDR(A_SCD_TRACE_SEQUENCE_0));
218 // dsamp when d used | asamp when a used 315 /* dsamp when d used | asamp when a used */
219 __raw_writeq(M_SCD_TRSEQ_ASAMPLE | M_SCD_TRSEQ_DSAMPLE | 316 __raw_writeq(M_SCD_TRSEQ_ASAMPLE | M_SCD_TRSEQ_DSAMPLE |
220 K_SCD_TRSEQ_TRIGGER_ALL, 317 K_SCD_TRSEQ_TRIGGER_ALL,
221 IOADDR(A_SCD_TRACE_SEQUENCE_1)); 318 IOADDR(A_SCD_TRACE_SEQUENCE_1));
@@ -232,33 +329,41 @@ int sbprof_zbprof_start(struct file *filp)
232 329
233 arm_tb(); 330 arm_tb();
234 331
235 DBG(printk(DEVNAME ": done starting\n")); 332 pr_debug(DEVNAME ": done starting\n");
236 333
237 return 0; 334 return 0;
335
336out_free_irq:
337 free_irq(K_INT_TRACE_FREEZE, &sbp);
338
339 return err;
238} 340}
239 341
240int sbprof_zbprof_stop(void) 342static int sbprof_zbprof_stop(void)
241{ 343{
242 DEFINE_WAIT(wait); 344 int err;
243 DBG(printk(DEVNAME ": stopping\n")); 345
346 pr_debug(DEVNAME ": stopping\n");
244 347
245 if (sbp.tb_enable) { 348 if (sbp.tb_enable) {
349 /*
350 * XXXKW there is a window here where the intr handler may run,
351 * see the disable, and do the wake_up before this sleep
352 * happens.
353 */
354 pr_debug(DEVNAME ": wait for disarm\n");
355 err = wait_event_interruptible(sbp.tb_sync, !sbp.tb_armed);
356 pr_debug(DEVNAME ": disarm complete, stat %d\n", err);
357
358 if (err)
359 return err;
360
246 sbp.tb_enable = 0; 361 sbp.tb_enable = 0;
247 /* XXXKW there is a window here where the intr handler
248 may run, see the disable, and do the wake_up before
249 this sleep happens. */
250 if (sbp.tb_armed) {
251 DBG(printk(DEVNAME ": wait for disarm\n"));
252 prepare_to_wait(&sbp.tb_sync, &wait, TASK_INTERRUPTIBLE);
253 schedule();
254 finish_wait(&sbp.tb_sync, &wait);
255 DBG(printk(DEVNAME ": disarm complete\n"));
256 }
257 free_irq(K_INT_TRACE_FREEZE, &sbp); 362 free_irq(K_INT_TRACE_FREEZE, &sbp);
258 free_irq(K_INT_PERF_CNT, &sbp); 363 free_irq(K_INT_PERF_CNT, &sbp);
259 } 364 }
260 365
261 DBG(printk(DEVNAME ": done stopping\n")); 366 pr_debug(DEVNAME ": done stopping\n");
262 367
263 return 0; 368 return 0;
264} 369}
@@ -268,42 +373,45 @@ static int sbprof_tb_open(struct inode *inode, struct file *filp)
268 int minor; 373 int minor;
269 374
270 minor = iminor(inode); 375 minor = iminor(inode);
271 if (minor != 0) { 376 if (minor != 0)
272 return -ENODEV; 377 return -ENODEV;
273 } 378
274 if (sbp.open) { 379 if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED)
275 return -EBUSY; 380 return -EBUSY;
276 }
277 381
278 memset(&sbp, 0, sizeof(struct sbprof_tb)); 382 memset(&sbp, 0, sizeof(struct sbprof_tb));
383
279 sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES); 384 sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES);
280 if (!sbp.sbprof_tbbuf) { 385 if (!sbp.sbprof_tbbuf)
281 return -ENOMEM; 386 return -ENOMEM;
282 } 387
283 memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES); 388 memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES);
284 init_waitqueue_head(&sbp.tb_sync); 389 init_waitqueue_head(&sbp.tb_sync);
285 init_waitqueue_head(&sbp.tb_read); 390 init_waitqueue_head(&sbp.tb_read);
286 sbp.open = 1; 391 mutex_init(&sbp.lock);
392
393 sbp.open = SB_OPEN;
287 394
288 return 0; 395 return 0;
289} 396}
290 397
291static int sbprof_tb_release(struct inode *inode, struct file *filp) 398static int sbprof_tb_release(struct inode *inode, struct file *filp)
292{ 399{
293 int minor; 400 int minor = iminor(inode);
294 401
295 minor = iminor(inode); 402 if (minor != 0 || !sbp.open)
296 if (minor != 0 || !sbp.open) {
297 return -ENODEV; 403 return -ENODEV;
298 }
299 404
300 if (sbp.tb_armed || sbp.tb_enable) { 405 mutex_lock(&sbp.lock);
406
407 if (sbp.tb_armed || sbp.tb_enable)
301 sbprof_zbprof_stop(); 408 sbprof_zbprof_stop();
302 }
303 409
304 vfree(sbp.sbprof_tbbuf); 410 vfree(sbp.sbprof_tbbuf);
305 sbp.open = 0; 411 sbp.open = 0;
306 412
413 mutex_unlock(&sbp.lock);
414
307 return 0; 415 return 0;
308} 416}
309 417
@@ -311,21 +419,35 @@ static ssize_t sbprof_tb_read(struct file *filp, char *buf,
311 size_t size, loff_t *offp) 419 size_t size, loff_t *offp)
312{ 420{
313 int cur_sample, sample_off, cur_count, sample_left; 421 int cur_sample, sample_off, cur_count, sample_left;
314 char *src;
315 int count = 0;
316 char *dest = buf;
317 long cur_off = *offp; 422 long cur_off = *offp;
423 char *dest = buf;
424 int count = 0;
425 char *src;
426
427 if (!access_ok(VERIFY_WRITE, buf, size))
428 return -EFAULT;
429
430 mutex_lock(&sbp.lock);
318 431
319 count = 0; 432 count = 0;
320 cur_sample = cur_off / TB_SAMPLE_SIZE; 433 cur_sample = cur_off / TB_SAMPLE_SIZE;
321 sample_off = cur_off % TB_SAMPLE_SIZE; 434 sample_off = cur_off % TB_SAMPLE_SIZE;
322 sample_left = TB_SAMPLE_SIZE - sample_off; 435 sample_left = TB_SAMPLE_SIZE - sample_off;
436
323 while (size && (cur_sample < sbp.next_tb_sample)) { 437 while (size && (cur_sample < sbp.next_tb_sample)) {
438 int err;
439
324 cur_count = size < sample_left ? size : sample_left; 440 cur_count = size < sample_left ? size : sample_left;
325 src = (char *)(((long)sbp.sbprof_tbbuf[cur_sample])+sample_off); 441 src = (char *)(((long)sbp.sbprof_tbbuf[cur_sample])+sample_off);
326 copy_to_user(dest, src, cur_count); 442 err = __copy_to_user(dest, src, cur_count);
327 DBG(printk(DEVNAME ": read from sample %d, %d bytes\n", 443 if (err) {
328 cur_sample, cur_count)); 444 *offp = cur_off + cur_count - err;
445 mutex_unlock(&sbp.lock);
446 return err;
447 }
448
449 pr_debug(DEVNAME ": read from sample %d, %d bytes\n",
450 cur_sample, cur_count);
329 size -= cur_count; 451 size -= cur_count;
330 sample_left -= cur_count; 452 sample_left -= cur_count;
331 if (!sample_left) { 453 if (!sample_left) {
@@ -339,37 +461,43 @@ static ssize_t sbprof_tb_read(struct file *filp, char *buf,
339 dest += cur_count; 461 dest += cur_count;
340 count += cur_count; 462 count += cur_count;
341 } 463 }
464
342 *offp = cur_off; 465 *offp = cur_off;
466 mutex_unlock(&sbp.lock);
343 467
344 return count; 468 return count;
345} 469}
346 470
347static long sbprof_tb_ioctl(struct file *filp, 471static long sbprof_tb_ioctl(struct file *filp, unsigned int command,
348 unsigned int command, 472 unsigned long arg)
349 unsigned long arg)
350{ 473{
351 int error = 0; 474 int error = 0;
352 475
353 lock_kernel();
354 switch (command) { 476 switch (command) {
355 case SBPROF_ZBSTART: 477 case SBPROF_ZBSTART:
478 mutex_lock(&sbp.lock);
356 error = sbprof_zbprof_start(filp); 479 error = sbprof_zbprof_start(filp);
480 mutex_unlock(&sbp.lock);
357 break; 481 break;
482
358 case SBPROF_ZBSTOP: 483 case SBPROF_ZBSTOP:
484 mutex_lock(&sbp.lock);
359 error = sbprof_zbprof_stop(); 485 error = sbprof_zbprof_stop();
486 mutex_unlock(&sbp.lock);
360 break; 487 break;
488
361 case SBPROF_ZBWAITFULL: 489 case SBPROF_ZBWAITFULL:
362 DEFINE_WAIT(wait); 490 error = wait_event_interruptible(sbp.tb_read, TB_FULL);
363 prepare_to_wait(&sbp.tb_read, &wait, TASK_INTERRUPTIBLE); 491 if (error)
364 schedule(); 492 break;
365 finish_wait(&sbp.tb_read, &wait); 493
366 /* XXXKW check if interrupted? */ 494 error = put_user(TB_FULL, (int *) arg);
367 return put_user(TB_FULL, (int *) arg); 495 break;
496
368 default: 497 default:
369 error = -EINVAL; 498 error = -EINVAL;
370 break; 499 break;
371 } 500 }
372 unlock_kernel();
373 501
374 return error; 502 return error;
375} 503}
@@ -384,23 +512,60 @@ static const struct file_operations sbprof_tb_fops = {
384 .mmap = NULL, 512 .mmap = NULL,
385}; 513};
386 514
515static struct class *tb_class;
516static struct device *tb_dev;
517
387static int __init sbprof_tb_init(void) 518static int __init sbprof_tb_init(void)
388{ 519{
520 struct device *dev;
521 struct class *tbc;
522 int err;
523
389 if (register_chrdev(SBPROF_TB_MAJOR, DEVNAME, &sbprof_tb_fops)) { 524 if (register_chrdev(SBPROF_TB_MAJOR, DEVNAME, &sbprof_tb_fops)) {
390 printk(KERN_WARNING DEVNAME ": initialization failed (dev %d)\n", 525 printk(KERN_WARNING DEVNAME ": initialization failed (dev %d)\n",
391 SBPROF_TB_MAJOR); 526 SBPROF_TB_MAJOR);
392 return -EIO; 527 return -EIO;
393 } 528 }
529
530 tbc = class_create(THIS_MODULE, "sb_tracebuffer");
531 if (IS_ERR(tbc)) {
532 err = PTR_ERR(tbc);
533 goto out_chrdev;
534 }
535
536 tb_class = tbc;
537
538 dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), "tb");
539 if (IS_ERR(dev)) {
540 err = PTR_ERR(dev);
541 goto out_class;
542 }
543 tb_dev = dev;
544
394 sbp.open = 0; 545 sbp.open = 0;
395 tb_period = zbbus_mhz * 10000LL; 546 tb_period = zbbus_mhz * 10000LL;
396 printk(KERN_INFO DEVNAME ": initialized - tb_period = %lld\n", tb_period); 547 pr_info(DEVNAME ": initialized - tb_period = %lld\n", tb_period);
548
397 return 0; 549 return 0;
550
551out_class:
552 class_destroy(tb_class);
553out_chrdev:
554 unregister_chrdev(SBPROF_TB_MAJOR, DEVNAME);
555
556 return err;
398} 557}
399 558
400static void __exit sbprof_tb_cleanup(void) 559static void __exit sbprof_tb_cleanup(void)
401{ 560{
561 device_destroy(tb_class, MKDEV(SBPROF_TB_MAJOR, 0));
402 unregister_chrdev(SBPROF_TB_MAJOR, DEVNAME); 562 unregister_chrdev(SBPROF_TB_MAJOR, DEVNAME);
563 class_destroy(tb_class);
403} 564}
404 565
405module_init(sbprof_tb_init); 566module_init(sbprof_tb_init);
406module_exit(sbprof_tb_cleanup); 567module_exit(sbprof_tb_cleanup);
568
569MODULE_ALIAS_CHARDEV_MAJOR(SBPROF_TB_MAJOR);
570MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
571MODULE_LICENSE("GPL");
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c
index 1cb042eab720..87188f0f6fbe 100644
--- a/arch/mips/sibyte/sb1250/setup.c
+++ b/arch/mips/sibyte/sb1250/setup.c
@@ -16,6 +16,7 @@
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */ 17 */
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/module.h>
19#include <linux/kernel.h> 20#include <linux/kernel.h>
20#include <linux/reboot.h> 21#include <linux/reboot.h>
21#include <linux/string.h> 22#include <linux/string.h>
@@ -32,6 +33,7 @@ unsigned int soc_pass;
32unsigned int soc_type; 33unsigned int soc_type;
33unsigned int periph_rev; 34unsigned int periph_rev;
34unsigned int zbbus_mhz; 35unsigned int zbbus_mhz;
36EXPORT_SYMBOL(zbbus_mhz);
35 37
36static char *soc_str; 38static char *soc_str;
37static char *pass_str; 39static char *pass_str;
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig
index 24367319ce24..cf7e316ad4f6 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_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.20-rc5 3# Linux kernel version: 2.6.21-rc3
4# Mon Jan 22 22:12:56 2007 4# Fri Mar 9 23:34:53 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -61,6 +61,7 @@ CONFIG_LOCALVERSION_AUTO=y
61CONFIG_SWAP=y 61CONFIG_SWAP=y
62CONFIG_SYSVIPC=y 62CONFIG_SYSVIPC=y
63# CONFIG_IPC_NS is not set 63# CONFIG_IPC_NS is not set
64CONFIG_SYSVIPC_SYSCTL=y
64# CONFIG_POSIX_MQUEUE is not set 65# CONFIG_POSIX_MQUEUE is not set
65# CONFIG_BSD_PROCESS_ACCT is not set 66# CONFIG_BSD_PROCESS_ACCT is not set
66# CONFIG_TASKSTATS is not set 67# CONFIG_TASKSTATS is not set
@@ -71,6 +72,7 @@ CONFIG_IKCONFIG_PROC=y
71CONFIG_CPUSETS=y 72CONFIG_CPUSETS=y
72CONFIG_SYSFS_DEPRECATED=y 73CONFIG_SYSFS_DEPRECATED=y
73# CONFIG_RELAY is not set 74# CONFIG_RELAY is not set
75CONFIG_BLK_DEV_INITRD=y
74CONFIG_INITRAMFS_SOURCE="" 76CONFIG_INITRAMFS_SOURCE=""
75CONFIG_CC_OPTIMIZE_FOR_SIZE=y 77CONFIG_CC_OPTIMIZE_FOR_SIZE=y
76CONFIG_SYSCTL=y 78CONFIG_SYSCTL=y
@@ -133,6 +135,7 @@ CONFIG_PPC_MULTIPLATFORM=y
133# CONFIG_PPC_PSERIES is not set 135# CONFIG_PPC_PSERIES is not set
134# CONFIG_PPC_ISERIES is not set 136# CONFIG_PPC_ISERIES is not set
135# CONFIG_PPC_MPC52xx is not set 137# CONFIG_PPC_MPC52xx is not set
138# CONFIG_PPC_MPC5200 is not set
136# CONFIG_PPC_PMAC is not set 139# CONFIG_PPC_PMAC is not set
137# CONFIG_PPC_MAPLE is not set 140# CONFIG_PPC_MAPLE is not set
138# CONFIG_PPC_PASEMI is not set 141# CONFIG_PPC_PASEMI is not set
@@ -140,8 +143,10 @@ CONFIG_PPC_CELL=y
140CONFIG_PPC_CELL_NATIVE=y 143CONFIG_PPC_CELL_NATIVE=y
141CONFIG_PPC_IBM_CELL_BLADE=y 144CONFIG_PPC_IBM_CELL_BLADE=y
142CONFIG_PPC_PS3=y 145CONFIG_PPC_PS3=y
146CONFIG_PPC_CELLEB=y
143CONFIG_PPC_NATIVE=y 147CONFIG_PPC_NATIVE=y
144CONFIG_UDBG_RTAS_CONSOLE=y 148CONFIG_UDBG_RTAS_CONSOLE=y
149CONFIG_PPC_UDBG_BEAT=y
145# CONFIG_U3_DART is not set 150# CONFIG_U3_DART is not set
146CONFIG_PPC_RTAS=y 151CONFIG_PPC_RTAS=y
147# CONFIG_RTAS_ERROR_LOGGING is not set 152# CONFIG_RTAS_ERROR_LOGGING is not set
@@ -181,10 +186,13 @@ CONFIG_CBE_CPUFREQ=m
181# 186#
182# PS3 Platform Options 187# PS3 Platform Options
183# 188#
189# CONFIG_PS3_ADVANCED is not set
184CONFIG_PS3_HTAB_SIZE=20 190CONFIG_PS3_HTAB_SIZE=20
185# CONFIG_PS3_DYNAMIC_DMA is not set 191# CONFIG_PS3_DYNAMIC_DMA is not set
186CONFIG_PS3_USE_LPAR_ADDR=y 192CONFIG_PS3_USE_LPAR_ADDR=y
187CONFIG_PS3_VUART=y 193CONFIG_PS3_VUART=y
194CONFIG_PS3_PS3AV=y
195CONFIG_PS3_SYS_MANAGER=y
188 196
189# 197#
190# Kernel options 198# Kernel options
@@ -226,6 +234,7 @@ CONFIG_MEMORY_HOTPLUG_SPARSE=y
226CONFIG_SPLIT_PTLOCK_CPUS=4 234CONFIG_SPLIT_PTLOCK_CPUS=4
227CONFIG_MIGRATION=y 235CONFIG_MIGRATION=y
228CONFIG_RESOURCES_64BIT=y 236CONFIG_RESOURCES_64BIT=y
237CONFIG_ZONE_DMA_FLAG=1
229CONFIG_ARCH_MEMORY_PROBE=y 238CONFIG_ARCH_MEMORY_PROBE=y
230CONFIG_NODES_SPAN_OTHER_NODES=y 239CONFIG_NODES_SPAN_OTHER_NODES=y
231CONFIG_PPC_64K_PAGES=y 240CONFIG_PPC_64K_PAGES=y
@@ -239,6 +248,7 @@ CONFIG_ISA_DMA_API=y
239# 248#
240# Bus options 249# Bus options
241# 250#
251CONFIG_ZONE_DMA=y
242CONFIG_GENERIC_ISA_DMA=y 252CONFIG_GENERIC_ISA_DMA=y
243# CONFIG_MPIC_WEIRD is not set 253# CONFIG_MPIC_WEIRD is not set
244# CONFIG_PPC_I8259 is not set 254# CONFIG_PPC_I8259 is not set
@@ -274,6 +284,7 @@ CONFIG_UNIX=y
274CONFIG_XFRM=y 284CONFIG_XFRM=y
275# CONFIG_XFRM_USER is not set 285# CONFIG_XFRM_USER is not set
276# CONFIG_XFRM_SUB_POLICY is not set 286# CONFIG_XFRM_SUB_POLICY is not set
287# CONFIG_XFRM_MIGRATE is not set
277# CONFIG_NET_KEY is not set 288# CONFIG_NET_KEY is not set
278CONFIG_INET=y 289CONFIG_INET=y
279CONFIG_IP_MULTICAST=y 290CONFIG_IP_MULTICAST=y
@@ -340,6 +351,7 @@ CONFIG_NETFILTER_XT_TARGET_DSCP=m
340CONFIG_NETFILTER_XT_TARGET_MARK=m 351CONFIG_NETFILTER_XT_TARGET_MARK=m
341CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 352CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
342CONFIG_NETFILTER_XT_TARGET_NFLOG=m 353CONFIG_NETFILTER_XT_TARGET_NFLOG=m
354CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
343CONFIG_NETFILTER_XT_MATCH_COMMENT=m 355CONFIG_NETFILTER_XT_MATCH_COMMENT=m
344CONFIG_NETFILTER_XT_MATCH_DCCP=m 356CONFIG_NETFILTER_XT_MATCH_DCCP=m
345CONFIG_NETFILTER_XT_MATCH_DSCP=m 357CONFIG_NETFILTER_XT_MATCH_DSCP=m
@@ -376,7 +388,6 @@ CONFIG_IP_NF_FILTER=m
376CONFIG_IP_NF_TARGET_REJECT=m 388CONFIG_IP_NF_TARGET_REJECT=m
377CONFIG_IP_NF_TARGET_LOG=m 389CONFIG_IP_NF_TARGET_LOG=m
378CONFIG_IP_NF_TARGET_ULOG=m 390CONFIG_IP_NF_TARGET_ULOG=m
379CONFIG_IP_NF_TARGET_TCPMSS=m
380CONFIG_IP_NF_MANGLE=m 391CONFIG_IP_NF_MANGLE=m
381CONFIG_IP_NF_TARGET_TOS=m 392CONFIG_IP_NF_TARGET_TOS=m
382CONFIG_IP_NF_TARGET_ECN=m 393CONFIG_IP_NF_TARGET_ECN=m
@@ -444,6 +455,7 @@ CONFIG_STANDALONE=y
444CONFIG_PREVENT_FIRMWARE_BUILD=y 455CONFIG_PREVENT_FIRMWARE_BUILD=y
445CONFIG_FW_LOADER=y 456CONFIG_FW_LOADER=y
446# CONFIG_DEBUG_DRIVER is not set 457# CONFIG_DEBUG_DRIVER is not set
458# CONFIG_DEBUG_DEVRES is not set
447# CONFIG_SYS_HYPERVISOR is not set 459# CONFIG_SYS_HYPERVISOR is not set
448 460
449# 461#
@@ -464,6 +476,7 @@ CONFIG_FW_LOADER=y
464# 476#
465# Plug and Play support 477# Plug and Play support
466# 478#
479# CONFIG_PNPACPI is not set
467 480
468# 481#
469# Block devices 482# Block devices
@@ -483,7 +496,6 @@ CONFIG_BLK_DEV_RAM=y
483CONFIG_BLK_DEV_RAM_COUNT=16 496CONFIG_BLK_DEV_RAM_COUNT=16
484CONFIG_BLK_DEV_RAM_SIZE=131072 497CONFIG_BLK_DEV_RAM_SIZE=131072
485CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 498CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
486CONFIG_BLK_DEV_INITRD=y
487# CONFIG_CDROM_PKTCDVD is not set 499# CONFIG_CDROM_PKTCDVD is not set
488# CONFIG_ATA_OVER_ETH is not set 500# CONFIG_ATA_OVER_ETH is not set
489 501
@@ -537,6 +549,7 @@ CONFIG_BLK_DEV_AEC62XX=y
537# CONFIG_BLK_DEV_JMICRON is not set 549# CONFIG_BLK_DEV_JMICRON is not set
538# CONFIG_BLK_DEV_SC1200 is not set 550# CONFIG_BLK_DEV_SC1200 is not set
539# CONFIG_BLK_DEV_PIIX is not set 551# CONFIG_BLK_DEV_PIIX is not set
552# CONFIG_BLK_DEV_IT8213 is not set
540# CONFIG_BLK_DEV_IT821X is not set 553# CONFIG_BLK_DEV_IT821X is not set
541# CONFIG_BLK_DEV_NS87415 is not set 554# CONFIG_BLK_DEV_NS87415 is not set
542# CONFIG_BLK_DEV_PDC202XX_OLD is not set 555# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -547,6 +560,8 @@ CONFIG_BLK_DEV_SIIMAGE=y
547# CONFIG_BLK_DEV_SLC90E66 is not set 560# CONFIG_BLK_DEV_SLC90E66 is not set
548# CONFIG_BLK_DEV_TRM290 is not set 561# CONFIG_BLK_DEV_TRM290 is not set
549# CONFIG_BLK_DEV_VIA82CXXX is not set 562# CONFIG_BLK_DEV_VIA82CXXX is not set
563# CONFIG_BLK_DEV_TC86C001 is not set
564CONFIG_BLK_DEV_IDE_CELLEB=y
550# CONFIG_IDE_ARM is not set 565# CONFIG_IDE_ARM is not set
551CONFIG_BLK_DEV_IDEDMA=y 566CONFIG_BLK_DEV_IDEDMA=y
552# CONFIG_IDEDMA_IVB is not set 567# CONFIG_IDEDMA_IVB is not set
@@ -557,7 +572,7 @@ CONFIG_IDEDMA_AUTO=y
557# SCSI device support 572# SCSI device support
558# 573#
559# CONFIG_RAID_ATTRS is not set 574# CONFIG_RAID_ATTRS is not set
560CONFIG_SCSI=m 575CONFIG_SCSI=y
561# CONFIG_SCSI_TGT is not set 576# CONFIG_SCSI_TGT is not set
562# CONFIG_SCSI_NETLINK is not set 577# CONFIG_SCSI_NETLINK is not set
563CONFIG_SCSI_PROC_FS=y 578CONFIG_SCSI_PROC_FS=y
@@ -565,12 +580,12 @@ CONFIG_SCSI_PROC_FS=y
565# 580#
566# SCSI support type (disk, tape, CD-ROM) 581# SCSI support type (disk, tape, CD-ROM)
567# 582#
568CONFIG_BLK_DEV_SD=m 583CONFIG_BLK_DEV_SD=y
569# CONFIG_CHR_DEV_ST is not set 584# CONFIG_CHR_DEV_ST is not set
570# CONFIG_CHR_DEV_OSST is not set 585# CONFIG_CHR_DEV_OSST is not set
571CONFIG_BLK_DEV_SR=m 586CONFIG_BLK_DEV_SR=m
572# CONFIG_BLK_DEV_SR_VENDOR is not set 587# CONFIG_BLK_DEV_SR_VENDOR is not set
573CONFIG_CHR_DEV_SG=m 588CONFIG_CHR_DEV_SG=y
574# CONFIG_CHR_DEV_SCH is not set 589# CONFIG_CHR_DEV_SCH is not set
575 590
576# 591#
@@ -587,7 +602,7 @@ CONFIG_CHR_DEV_SG=m
587# CONFIG_SCSI_SPI_ATTRS is not set 602# CONFIG_SCSI_SPI_ATTRS is not set
588# CONFIG_SCSI_FC_ATTRS is not set 603# CONFIG_SCSI_FC_ATTRS is not set
589# CONFIG_SCSI_ISCSI_ATTRS is not set 604# CONFIG_SCSI_ISCSI_ATTRS is not set
590# CONFIG_SCSI_SAS_ATTRS is not set 605CONFIG_SCSI_SAS_ATTRS=y
591# CONFIG_SCSI_SAS_LIBSAS is not set 606# CONFIG_SCSI_SAS_LIBSAS is not set
592 607
593# 608#
@@ -617,6 +632,7 @@ CONFIG_CHR_DEV_SG=m
617# CONFIG_SCSI_INIA100 is not set 632# CONFIG_SCSI_INIA100 is not set
618# CONFIG_SCSI_STEX is not set 633# CONFIG_SCSI_STEX is not set
619# CONFIG_SCSI_SYM53C8XX_2 is not set 634# CONFIG_SCSI_SYM53C8XX_2 is not set
635# CONFIG_SCSI_IPR is not set
620# CONFIG_SCSI_QLOGIC_1280 is not set 636# CONFIG_SCSI_QLOGIC_1280 is not set
621# CONFIG_SCSI_QLA_FC is not set 637# CONFIG_SCSI_QLA_FC is not set
622# CONFIG_SCSI_QLA_ISCSI is not set 638# CONFIG_SCSI_QLA_ISCSI is not set
@@ -629,7 +645,60 @@ CONFIG_CHR_DEV_SG=m
629# 645#
630# Serial ATA (prod) and Parallel ATA (experimental) drivers 646# Serial ATA (prod) and Parallel ATA (experimental) drivers
631# 647#
632# CONFIG_ATA is not set 648CONFIG_ATA=y
649# CONFIG_ATA_NONSTANDARD is not set
650# CONFIG_SATA_AHCI is not set
651# CONFIG_SATA_SVW is not set
652# CONFIG_ATA_PIIX is not set
653# CONFIG_SATA_MV is not set
654# CONFIG_SATA_NV is not set
655# CONFIG_PDC_ADMA is not set
656# CONFIG_SATA_QSTOR is not set
657CONFIG_SATA_PROMISE=y
658# CONFIG_SATA_SX4 is not set
659# CONFIG_SATA_SIL is not set
660# CONFIG_SATA_SIL24 is not set
661# CONFIG_SATA_SIS is not set
662# CONFIG_SATA_ULI is not set
663# CONFIG_SATA_VIA is not set
664# CONFIG_SATA_VITESSE is not set
665# CONFIG_SATA_INIC162X is not set
666# CONFIG_PATA_ALI is not set
667# CONFIG_PATA_AMD is not set
668# CONFIG_PATA_ARTOP is not set
669# CONFIG_PATA_ATIIXP is not set
670# CONFIG_PATA_CMD64X is not set
671# CONFIG_PATA_CS5520 is not set
672# CONFIG_PATA_CS5530 is not set
673# CONFIG_PATA_CYPRESS is not set
674# CONFIG_PATA_EFAR is not set
675# CONFIG_ATA_GENERIC is not set
676# CONFIG_PATA_HPT366 is not set
677# CONFIG_PATA_HPT37X is not set
678# CONFIG_PATA_HPT3X2N is not set
679# CONFIG_PATA_HPT3X3 is not set
680# CONFIG_PATA_IT821X is not set
681# CONFIG_PATA_IT8213 is not set
682# CONFIG_PATA_JMICRON is not set
683# CONFIG_PATA_TRIFLEX is not set
684# CONFIG_PATA_MARVELL is not set
685# CONFIG_PATA_MPIIX is not set
686# CONFIG_PATA_OLDPIIX is not set
687# CONFIG_PATA_NETCELL is not set
688# CONFIG_PATA_NS87410 is not set
689# CONFIG_PATA_OPTI is not set
690# CONFIG_PATA_OPTIDMA is not set
691# CONFIG_PATA_PDC_OLD is not set
692# CONFIG_PATA_RADISYS is not set
693# CONFIG_PATA_RZ1000 is not set
694# CONFIG_PATA_SC1200 is not set
695# CONFIG_PATA_SERVERWORKS is not set
696CONFIG_PATA_PDC2027X=m
697# CONFIG_PATA_SIL680 is not set
698# CONFIG_PATA_SIS is not set
699# CONFIG_PATA_VIA is not set
700# CONFIG_PATA_WINBOND is not set
701# CONFIG_PATA_SCC is not set
633 702
634# 703#
635# Multi-device support (RAID and LVM) 704# Multi-device support (RAID and LVM)
@@ -655,10 +724,12 @@ CONFIG_DM_MULTIPATH=m
655# 724#
656# Fusion MPT device support 725# Fusion MPT device support
657# 726#
658# CONFIG_FUSION is not set 727CONFIG_FUSION=y
659# CONFIG_FUSION_SPI is not set 728# CONFIG_FUSION_SPI is not set
660# CONFIG_FUSION_FC is not set 729# CONFIG_FUSION_FC is not set
661# CONFIG_FUSION_SAS is not set 730CONFIG_FUSION_SAS=y
731CONFIG_FUSION_MAX_SGE=128
732# CONFIG_FUSION_CTL is not set
662 733
663# 734#
664# IEEE 1394 (FireWire) support 735# IEEE 1394 (FireWire) support
@@ -732,15 +803,18 @@ CONFIG_TIGON3=y
732# CONFIG_BNX2 is not set 803# CONFIG_BNX2 is not set
733CONFIG_SPIDER_NET=y 804CONFIG_SPIDER_NET=y
734# CONFIG_QLA3XXX is not set 805# CONFIG_QLA3XXX is not set
806# CONFIG_ATL1 is not set
735 807
736# 808#
737# Ethernet (10000 Mbit) 809# Ethernet (10000 Mbit)
738# 810#
739# CONFIG_CHELSIO_T1 is not set 811# CONFIG_CHELSIO_T1 is not set
812# CONFIG_CHELSIO_T3 is not set
740# CONFIG_IXGB is not set 813# CONFIG_IXGB is not set
741# CONFIG_S2IO is not set 814# CONFIG_S2IO is not set
742# CONFIG_MYRI10GE is not set 815# CONFIG_MYRI10GE is not set
743# CONFIG_NETXEN_NIC is not set 816# CONFIG_NETXEN_NIC is not set
817# CONFIG_PASEMI_MAC is not set
744 818
745# 819#
746# Token Ring devices 820# Token Ring devices
@@ -853,16 +927,27 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
853# 927#
854CONFIG_SERIAL_CORE=y 928CONFIG_SERIAL_CORE=y
855CONFIG_SERIAL_CORE_CONSOLE=y 929CONFIG_SERIAL_CORE_CONSOLE=y
930CONFIG_SERIAL_TXX9=y
931CONFIG_HAS_TXX9_SERIAL=y
932CONFIG_SERIAL_TXX9_NR_UARTS=2
933CONFIG_SERIAL_TXX9_CONSOLE=y
856# CONFIG_SERIAL_JSM is not set 934# CONFIG_SERIAL_JSM is not set
935CONFIG_SERIAL_OF_PLATFORM=y
857CONFIG_UNIX98_PTYS=y 936CONFIG_UNIX98_PTYS=y
858# CONFIG_LEGACY_PTYS is not set 937# CONFIG_LEGACY_PTYS is not set
859CONFIG_HVC_DRIVER=y 938CONFIG_HVC_DRIVER=y
860CONFIG_HVC_RTAS=y 939CONFIG_HVC_RTAS=y
940# CONFIG_HVC_BEAT is not set
861 941
862# 942#
863# IPMI 943# IPMI
864# 944#
865# CONFIG_IPMI_HANDLER is not set 945CONFIG_IPMI_HANDLER=m
946# CONFIG_IPMI_PANIC_EVENT is not set
947CONFIG_IPMI_DEVICE_INTERFACE=m
948CONFIG_IPMI_SI=m
949CONFIG_IPMI_WATCHDOG=m
950CONFIG_IPMI_POWEROFF=m
866 951
867# 952#
868# Watchdog Cards 953# Watchdog Cards
@@ -874,7 +959,7 @@ CONFIG_WATCHDOG=y
874# Watchdog Device Drivers 959# Watchdog Device Drivers
875# 960#
876# CONFIG_SOFT_WATCHDOG is not set 961# CONFIG_SOFT_WATCHDOG is not set
877CONFIG_WATCHDOG_RTAS=y 962# CONFIG_WATCHDOG_RTAS is not set
878 963
879# 964#
880# PCI-based Watchdog Cards 965# PCI-based Watchdog Cards
@@ -929,6 +1014,7 @@ CONFIG_I2C_ALGOBIT=y
929# CONFIG_I2C_NFORCE2 is not set 1014# CONFIG_I2C_NFORCE2 is not set
930# CONFIG_I2C_OCORES is not set 1015# CONFIG_I2C_OCORES is not set
931# CONFIG_I2C_PARPORT_LIGHT is not set 1016# CONFIG_I2C_PARPORT_LIGHT is not set
1017# CONFIG_I2C_PASEMI is not set
932# CONFIG_I2C_PROSAVAGE is not set 1018# CONFIG_I2C_PROSAVAGE is not set
933# CONFIG_I2C_SAVAGE4 is not set 1019# CONFIG_I2C_SAVAGE4 is not set
934# CONFIG_I2C_SIS5595 is not set 1020# CONFIG_I2C_SIS5595 is not set
@@ -973,6 +1059,11 @@ CONFIG_I2C_ALGOBIT=y
973# CONFIG_HWMON_VID is not set 1059# CONFIG_HWMON_VID is not set
974 1060
975# 1061#
1062# Multifunction device drivers
1063#
1064# CONFIG_MFD_SM501 is not set
1065
1066#
976# Multimedia devices 1067# Multimedia devices
977# 1068#
978# CONFIG_VIDEO_DEV is not set 1069# CONFIG_VIDEO_DEV is not set
@@ -986,7 +1077,7 @@ CONFIG_I2C_ALGOBIT=y
986# 1077#
987# Graphics support 1078# Graphics support
988# 1079#
989CONFIG_FIRMWARE_EDID=y 1080# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
990# CONFIG_FB is not set 1081# CONFIG_FB is not set
991# CONFIG_FB_IBM_GXT4500 is not set 1082# CONFIG_FB_IBM_GXT4500 is not set
992 1083
@@ -995,7 +1086,6 @@ CONFIG_FIRMWARE_EDID=y
995# 1086#
996# CONFIG_VGA_CONSOLE is not set 1087# CONFIG_VGA_CONSOLE is not set
997CONFIG_DUMMY_CONSOLE=y 1088CONFIG_DUMMY_CONSOLE=y
998# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
999 1089
1000# 1090#
1001# Sound 1091# Sound
@@ -1006,6 +1096,7 @@ CONFIG_DUMMY_CONSOLE=y
1006# HID Devices 1096# HID Devices
1007# 1097#
1008CONFIG_HID=m 1098CONFIG_HID=m
1099# CONFIG_HID_DEBUG is not set
1009 1100
1010# 1101#
1011# USB support 1102# USB support
@@ -1020,9 +1111,7 @@ CONFIG_USB=m
1020# Miscellaneous USB options 1111# Miscellaneous USB options
1021# 1112#
1022CONFIG_USB_DEVICEFS=y 1113CONFIG_USB_DEVICEFS=y
1023# CONFIG_USB_BANDWIDTH is not set
1024# CONFIG_USB_DYNAMIC_MINORS is not set 1114# CONFIG_USB_DYNAMIC_MINORS is not set
1025# CONFIG_USB_MULTITHREAD_PROBE is not set
1026# CONFIG_USB_OTG is not set 1115# CONFIG_USB_OTG is not set
1027 1116
1028# 1117#
@@ -1032,9 +1121,15 @@ CONFIG_USB_EHCI_HCD=m
1032# CONFIG_USB_EHCI_SPLIT_ISO is not set 1121# CONFIG_USB_EHCI_SPLIT_ISO is not set
1033# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1122# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1034# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1123# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1124CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
1035# CONFIG_USB_ISP116X_HCD is not set 1125# CONFIG_USB_ISP116X_HCD is not set
1036CONFIG_USB_OHCI_HCD=m 1126CONFIG_USB_OHCI_HCD=m
1037# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1127CONFIG_USB_OHCI_HCD_PPC_OF=y
1128CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1129# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1130CONFIG_USB_OHCI_HCD_PCI=y
1131CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1132CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
1038CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1133CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1039# CONFIG_USB_UHCI_HCD is not set 1134# CONFIG_USB_UHCI_HCD is not set
1040# CONFIG_USB_SL811_HCD is not set 1135# CONFIG_USB_SL811_HCD is not set
@@ -1088,6 +1183,7 @@ CONFIG_USB_STORAGE=m
1088# CONFIG_USB_ATI_REMOTE2 is not set 1183# CONFIG_USB_ATI_REMOTE2 is not set
1089# CONFIG_USB_KEYSPAN_REMOTE is not set 1184# CONFIG_USB_KEYSPAN_REMOTE is not set
1090# CONFIG_USB_APPLETOUCH is not set 1185# CONFIG_USB_APPLETOUCH is not set
1186# CONFIG_USB_GTCO is not set
1091 1187
1092# 1188#
1093# USB Imaging devices 1189# USB Imaging devices
@@ -1125,6 +1221,7 @@ CONFIG_USB_MON=y
1125# CONFIG_USB_RIO500 is not set 1221# CONFIG_USB_RIO500 is not set
1126# CONFIG_USB_LEGOTOWER is not set 1222# CONFIG_USB_LEGOTOWER is not set
1127# CONFIG_USB_LCD is not set 1223# CONFIG_USB_LCD is not set
1224# CONFIG_USB_BERRY_CHARGE is not set
1128# CONFIG_USB_LED is not set 1225# CONFIG_USB_LED is not set
1129# CONFIG_USB_CYPRESS_CY7C63 is not set 1226# CONFIG_USB_CYPRESS_CY7C63 is not set
1130# CONFIG_USB_CYTHERM is not set 1227# CONFIG_USB_CYTHERM is not set
@@ -1135,6 +1232,7 @@ CONFIG_USB_MON=y
1135# CONFIG_USB_SISUSBVGA is not set 1232# CONFIG_USB_SISUSBVGA is not set
1136# CONFIG_USB_LD is not set 1233# CONFIG_USB_LD is not set
1137# CONFIG_USB_TRANCEVIBRATOR is not set 1234# CONFIG_USB_TRANCEVIBRATOR is not set
1235# CONFIG_USB_IOWARRIOR is not set
1138# CONFIG_USB_TEST is not set 1236# CONFIG_USB_TEST is not set
1139 1237
1140# 1238#
@@ -1175,6 +1273,7 @@ CONFIG_INFINIBAND_MTHCA=m
1175CONFIG_INFINIBAND_MTHCA_DEBUG=y 1273CONFIG_INFINIBAND_MTHCA_DEBUG=y
1176# CONFIG_INFINIBAND_AMSO1100 is not set 1274# CONFIG_INFINIBAND_AMSO1100 is not set
1177CONFIG_INFINIBAND_IPOIB=m 1275CONFIG_INFINIBAND_IPOIB=m
1276# CONFIG_INFINIBAND_IPOIB_CM is not set
1178CONFIG_INFINIBAND_IPOIB_DEBUG=y 1277CONFIG_INFINIBAND_IPOIB_DEBUG=y
1179CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y 1278CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
1180# CONFIG_INFINIBAND_SRP is not set 1279# CONFIG_INFINIBAND_SRP is not set
@@ -1203,6 +1302,10 @@ CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
1203# 1302#
1204 1303
1205# 1304#
1305# Auxiliary Display support
1306#
1307
1308#
1206# Virtualization 1309# Virtualization
1207# 1310#
1208 1311
@@ -1395,7 +1498,8 @@ CONFIG_TEXTSEARCH_KMP=m
1395CONFIG_TEXTSEARCH_BM=m 1498CONFIG_TEXTSEARCH_BM=m
1396CONFIG_TEXTSEARCH_FSM=m 1499CONFIG_TEXTSEARCH_FSM=m
1397CONFIG_PLIST=y 1500CONFIG_PLIST=y
1398CONFIG_IOMAP_COPY=y 1501CONFIG_HAS_IOMEM=y
1502CONFIG_HAS_IOPORT=y
1399 1503
1400# 1504#
1401# Instrumentation Support 1505# Instrumentation Support
@@ -1414,15 +1518,16 @@ CONFIG_MAGIC_SYSRQ=y
1414CONFIG_DEBUG_FS=y 1518CONFIG_DEBUG_FS=y
1415# CONFIG_HEADERS_CHECK is not set 1519# CONFIG_HEADERS_CHECK is not set
1416CONFIG_DEBUG_KERNEL=y 1520CONFIG_DEBUG_KERNEL=y
1521# CONFIG_DEBUG_SHIRQ is not set
1417CONFIG_LOG_BUF_SHIFT=15 1522CONFIG_LOG_BUF_SHIFT=15
1418CONFIG_DETECT_SOFTLOCKUP=y 1523# CONFIG_DETECT_SOFTLOCKUP is not set
1419# CONFIG_SCHEDSTATS is not set 1524# CONFIG_SCHEDSTATS is not set
1525# CONFIG_TIMER_STATS is not set
1420# CONFIG_DEBUG_SLAB is not set 1526# CONFIG_DEBUG_SLAB is not set
1421# CONFIG_DEBUG_RT_MUTEXES is not set 1527# CONFIG_DEBUG_RT_MUTEXES is not set
1422# CONFIG_RT_MUTEX_TESTER is not set 1528# CONFIG_RT_MUTEX_TESTER is not set
1423# CONFIG_DEBUG_SPINLOCK is not set 1529# CONFIG_DEBUG_SPINLOCK is not set
1424CONFIG_DEBUG_MUTEXES=y 1530CONFIG_DEBUG_MUTEXES=y
1425# CONFIG_DEBUG_RWSEMS is not set
1426CONFIG_DEBUG_SPINLOCK_SLEEP=y 1531CONFIG_DEBUG_SPINLOCK_SLEEP=y
1427# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1532# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1428# CONFIG_DEBUG_KOBJECT is not set 1533# CONFIG_DEBUG_KOBJECT is not set
@@ -1432,6 +1537,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1432# CONFIG_DEBUG_LIST is not set 1537# CONFIG_DEBUG_LIST is not set
1433# CONFIG_FORCED_INLINING is not set 1538# CONFIG_FORCED_INLINING is not set
1434# CONFIG_RCU_TORTURE_TEST is not set 1539# CONFIG_RCU_TORTURE_TEST is not set
1540# CONFIG_FAULT_INJECTION is not set
1435# CONFIG_DEBUG_STACKOVERFLOW is not set 1541# CONFIG_DEBUG_STACKOVERFLOW is not set
1436# CONFIG_DEBUG_STACK_USAGE is not set 1542# CONFIG_DEBUG_STACK_USAGE is not set
1437CONFIG_DEBUGGER=y 1543CONFIG_DEBUGGER=y
@@ -1469,8 +1575,10 @@ CONFIG_CRYPTO_SHA1=m
1469# CONFIG_CRYPTO_GF128MUL is not set 1575# CONFIG_CRYPTO_GF128MUL is not set
1470CONFIG_CRYPTO_ECB=m 1576CONFIG_CRYPTO_ECB=m
1471CONFIG_CRYPTO_CBC=m 1577CONFIG_CRYPTO_CBC=m
1578CONFIG_CRYPTO_PCBC=m
1472# CONFIG_CRYPTO_LRW is not set 1579# CONFIG_CRYPTO_LRW is not set
1473CONFIG_CRYPTO_DES=m 1580CONFIG_CRYPTO_DES=m
1581# CONFIG_CRYPTO_FCRYPT is not set
1474# CONFIG_CRYPTO_BLOWFISH is not set 1582# CONFIG_CRYPTO_BLOWFISH is not set
1475# CONFIG_CRYPTO_TWOFISH is not set 1583# CONFIG_CRYPTO_TWOFISH is not set
1476# CONFIG_CRYPTO_SERPENT is not set 1584# CONFIG_CRYPTO_SERPENT is not set
@@ -1484,6 +1592,7 @@ CONFIG_CRYPTO_DES=m
1484CONFIG_CRYPTO_DEFLATE=m 1592CONFIG_CRYPTO_DEFLATE=m
1485# CONFIG_CRYPTO_MICHAEL_MIC is not set 1593# CONFIG_CRYPTO_MICHAEL_MIC is not set
1486# CONFIG_CRYPTO_CRC32C is not set 1594# CONFIG_CRYPTO_CRC32C is not set
1595# CONFIG_CRYPTO_CAMELLIA is not set
1487# CONFIG_CRYPTO_TEST is not set 1596# CONFIG_CRYPTO_TEST is not set
1488 1597
1489# 1598#
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 7ec4ac77c0fa..e4006dc087ca 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -225,6 +225,22 @@ static struct cpu_spec cpu_specs[] = {
225 .oprofile_type = PPC_OPROFILE_POWER4, 225 .oprofile_type = PPC_OPROFILE_POWER4,
226 .platform = "ppc970", 226 .platform = "ppc970",
227 }, 227 },
228 { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
229 .pvr_mask = 0xffffffff,
230 .pvr_value = 0x00440100,
231 .cpu_name = "PPC970MP",
232 .cpu_features = CPU_FTRS_PPC970,
233 .cpu_user_features = COMMON_USER_POWER4 |
234 PPC_FEATURE_HAS_ALTIVEC_COMP,
235 .icache_bsize = 128,
236 .dcache_bsize = 128,
237 .num_pmcs = 8,
238 .cpu_setup = __setup_cpu_ppc970,
239 .cpu_restore = __restore_cpu_ppc970,
240 .oprofile_cpu_type = "ppc64/970MP",
241 .oprofile_type = PPC_OPROFILE_POWER4,
242 .platform = "ppc970",
243 },
228 { /* PPC970MP */ 244 { /* PPC970MP */
229 .pvr_mask = 0xffff0000, 245 .pvr_mask = 0xffff0000,
230 .pvr_value = 0x00440000, 246 .pvr_value = 0x00440000,
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index ea6fd552c7ea..91b443c9a488 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -916,7 +916,7 @@ EXPORT_SYMBOL_GPL(of_irq_map_raw);
916static int of_irq_map_oldworld(struct device_node *device, int index, 916static int of_irq_map_oldworld(struct device_node *device, int index,
917 struct of_irq *out_irq) 917 struct of_irq *out_irq)
918{ 918{
919 const u32 *ints; 919 const u32 *ints = NULL;
920 int intlen; 920 int intlen;
921 921
922 /* 922 /*
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index e738f93b42fe..a963f657222b 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -184,7 +184,7 @@ void udbg_pas_real_putc(char c)
184 184
185void udbg_init_pas_realmode(void) 185void udbg_init_pas_realmode(void)
186{ 186{
187 udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8; 187 udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8UL;
188 188
189 udbg_putc = udbg_pas_real_putc; 189 udbg_putc = udbg_pas_real_putc;
190 udbg_getc = NULL; 190 udbg_getc = NULL;
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index c0d2a694fa30..3c7fe2c65b5a 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -685,6 +685,9 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
685 "non-cacheable mapping\n"); 685 "non-cacheable mapping\n");
686 psize = mmu_vmalloc_psize = MMU_PAGE_4K; 686 psize = mmu_vmalloc_psize = MMU_PAGE_4K;
687 } 687 }
688#ifdef CONFIG_SPE_BASE
689 spu_flush_all_slbs(mm);
690#endif
688 } 691 }
689 if (user_region) { 692 if (user_region) {
690 if (psize != get_paca()->context.user_psize) { 693 if (psize != get_paca()->context.user_psize) {
@@ -759,6 +762,9 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
759 mmu_psize_defs[MMU_PAGE_4K].sllp; 762 mmu_psize_defs[MMU_PAGE_4K].sllp;
760 get_paca()->context = mm->context; 763 get_paca()->context = mm->context;
761 slb_flush_and_rebolt(); 764 slb_flush_and_rebolt();
765#ifdef CONFIG_SPE_BASE
766 spu_flush_all_slbs(mm);
767#endif
762 } 768 }
763 } 769 }
764 if (mm->context.user_psize == MMU_PAGE_64K) 770 if (mm->context.user_psize == MMU_PAGE_64K)
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 8c77c791f87e..f6ffaaa7a5bf 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -24,6 +24,7 @@
24#include <asm/machdep.h> 24#include <asm/machdep.h>
25#include <asm/cputable.h> 25#include <asm/cputable.h>
26#include <asm/tlb.h> 26#include <asm/tlb.h>
27#include <asm/spu.h>
27 28
28#include <linux/sysctl.h> 29#include <linux/sysctl.h>
29 30
@@ -513,6 +514,9 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff)
513 if ((addr + len) > 0x100000000UL) 514 if ((addr + len) > 0x100000000UL)
514 err = open_high_hpage_areas(current->mm, 515 err = open_high_hpage_areas(current->mm,
515 HTLB_AREA_MASK(addr, len)); 516 HTLB_AREA_MASK(addr, len));
517#ifdef CONFIG_SPE_BASE
518 spu_flush_all_slbs(current->mm);
519#endif
516 if (err) { 520 if (err) {
517 printk(KERN_DEBUG "prepare_hugepage_range(%lx, %lx)" 521 printk(KERN_DEBUG "prepare_hugepage_range(%lx, %lx)"
518 " failed (lowmask: 0x%04hx, highmask: 0x%04hx)\n", 522 " failed (lowmask: 0x%04hx, highmask: 0x%04hx)\n",
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index e5d819166874..8aa9a93e2aa2 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -55,9 +55,9 @@ static int mpc834x_usb_cfg(void)
55 struct device_node *np = NULL; 55 struct device_node *np = NULL;
56 int port0_is_dr = 0; 56 int port0_is_dr = 0;
57 57
58 if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL) 58 if ((np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr")) != NULL)
59 port0_is_dr = 1; 59 port0_is_dr = 1;
60 if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL){ 60 if ((np = of_find_compatible_node(NULL, "usb", "fsl-usb2-mph")) != NULL){
61 if (port0_is_dr) { 61 if (port0_is_dr) {
62 printk(KERN_WARNING 62 printk(KERN_WARNING
63 "There is only one USB port on PB board! \n"); 63 "There is only one USB port on PB board! \n");
@@ -103,8 +103,8 @@ static int mpc834x_usb_cfg(void)
103 return -1; 103 return -1;
104 104
105 /* 105 /*
106 * if MDS board is plug into PIB board, 106 * if Processor Board is plugged into PIB board,
107 * force to use the PHY on MDS board 107 * force to use the PHY on Processor Board
108 */ 108 */
109 bcsr5 = in_8(bcsr_regs + 5); 109 bcsr5 = in_8(bcsr_regs + 5);
110 if (!(bcsr5 & BCSR5_INT_USB)) 110 if (!(bcsr5 & BCSR5_INT_USB))
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index eb661ccf2dab..e764c0aced88 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -47,6 +47,7 @@ config MPC85xx
47 bool 47 bool
48 select PPC_UDBG_16550 48 select PPC_UDBG_16550
49 select PPC_INDIRECT_PCI 49 select PPC_INDIRECT_PCI
50 select SERIAL_8250_SHARE_IRQ if SERIAL_8250
50 default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS || MPC85xx_MDS 51 default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS || MPC85xx_MDS
51 52
52config PPC_INDIRECT_PCI_BE 53config PPC_INDIRECT_PCI_BE
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index c43999a10deb..eba7a2641dce 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -38,8 +38,61 @@
38const struct spu_management_ops *spu_management_ops; 38const struct spu_management_ops *spu_management_ops;
39const struct spu_priv1_ops *spu_priv1_ops; 39const struct spu_priv1_ops *spu_priv1_ops;
40 40
41static struct list_head spu_list[MAX_NUMNODES];
42static LIST_HEAD(spu_full_list);
43static DEFINE_MUTEX(spu_mutex);
44static spinlock_t spu_list_lock = SPIN_LOCK_UNLOCKED;
45
41EXPORT_SYMBOL_GPL(spu_priv1_ops); 46EXPORT_SYMBOL_GPL(spu_priv1_ops);
42 47
48void spu_invalidate_slbs(struct spu *spu)
49{
50 struct spu_priv2 __iomem *priv2 = spu->priv2;
51
52 if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK)
53 out_be64(&priv2->slb_invalidate_all_W, 0UL);
54}
55EXPORT_SYMBOL_GPL(spu_invalidate_slbs);
56
57/* This is called by the MM core when a segment size is changed, to
58 * request a flush of all the SPEs using a given mm
59 */
60void spu_flush_all_slbs(struct mm_struct *mm)
61{
62 struct spu *spu;
63 unsigned long flags;
64
65 spin_lock_irqsave(&spu_list_lock, flags);
66 list_for_each_entry(spu, &spu_full_list, full_list) {
67 if (spu->mm == mm)
68 spu_invalidate_slbs(spu);
69 }
70 spin_unlock_irqrestore(&spu_list_lock, flags);
71}
72
73/* The hack below stinks... try to do something better one of
74 * these days... Does it even work properly with NR_CPUS == 1 ?
75 */
76static inline void mm_needs_global_tlbie(struct mm_struct *mm)
77{
78 int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1;
79
80 /* Global TLBIE broadcast required with SPEs. */
81 __cpus_setall(&mm->cpu_vm_mask, nr);
82}
83
84void spu_associate_mm(struct spu *spu, struct mm_struct *mm)
85{
86 unsigned long flags;
87
88 spin_lock_irqsave(&spu_list_lock, flags);
89 spu->mm = mm;
90 spin_unlock_irqrestore(&spu_list_lock, flags);
91 if (mm)
92 mm_needs_global_tlbie(mm);
93}
94EXPORT_SYMBOL_GPL(spu_associate_mm);
95
43static int __spu_trap_invalid_dma(struct spu *spu) 96static int __spu_trap_invalid_dma(struct spu *spu)
44{ 97{
45 pr_debug("%s\n", __FUNCTION__); 98 pr_debug("%s\n", __FUNCTION__);
@@ -74,6 +127,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
74 struct spu_priv2 __iomem *priv2 = spu->priv2; 127 struct spu_priv2 __iomem *priv2 = spu->priv2;
75 struct mm_struct *mm = spu->mm; 128 struct mm_struct *mm = spu->mm;
76 u64 esid, vsid, llp; 129 u64 esid, vsid, llp;
130 int psize;
77 131
78 pr_debug("%s\n", __FUNCTION__); 132 pr_debug("%s\n", __FUNCTION__);
79 133
@@ -90,22 +144,25 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
90 case USER_REGION_ID: 144 case USER_REGION_ID:
91#ifdef CONFIG_HUGETLB_PAGE 145#ifdef CONFIG_HUGETLB_PAGE
92 if (in_hugepage_area(mm->context, ea)) 146 if (in_hugepage_area(mm->context, ea))
93 llp = mmu_psize_defs[mmu_huge_psize].sllp; 147 psize = mmu_huge_psize;
94 else 148 else
95#endif 149#endif
96 llp = mmu_psize_defs[mmu_virtual_psize].sllp; 150 psize = mm->context.user_psize;
97 vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) | 151 vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) |
98 SLB_VSID_USER | llp; 152 SLB_VSID_USER;
99 break; 153 break;
100 case VMALLOC_REGION_ID: 154 case VMALLOC_REGION_ID:
101 llp = mmu_psize_defs[mmu_virtual_psize].sllp; 155 if (ea < VMALLOC_END)
156 psize = mmu_vmalloc_psize;
157 else
158 psize = mmu_io_psize;
102 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 159 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) |
103 SLB_VSID_KERNEL | llp; 160 SLB_VSID_KERNEL;
104 break; 161 break;
105 case KERNEL_REGION_ID: 162 case KERNEL_REGION_ID:
106 llp = mmu_psize_defs[mmu_linear_psize].sllp; 163 psize = mmu_linear_psize;
107 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 164 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) |
108 SLB_VSID_KERNEL | llp; 165 SLB_VSID_KERNEL;
109 break; 166 break;
110 default: 167 default:
111 /* Future: support kernel segments so that drivers 168 /* Future: support kernel segments so that drivers
@@ -114,9 +171,10 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
114 pr_debug("invalid region access at %016lx\n", ea); 171 pr_debug("invalid region access at %016lx\n", ea);
115 return 1; 172 return 1;
116 } 173 }
174 llp = mmu_psize_defs[psize].sllp;
117 175
118 out_be64(&priv2->slb_index_W, spu->slb_replace); 176 out_be64(&priv2->slb_index_W, spu->slb_replace);
119 out_be64(&priv2->slb_vsid_RW, vsid); 177 out_be64(&priv2->slb_vsid_RW, vsid | llp);
120 out_be64(&priv2->slb_esid_RW, esid); 178 out_be64(&priv2->slb_esid_RW, esid);
121 179
122 spu->slb_replace++; 180 spu->slb_replace++;
@@ -330,10 +388,6 @@ static void spu_free_irqs(struct spu *spu)
330 free_irq(spu->irqs[2], spu); 388 free_irq(spu->irqs[2], spu);
331} 389}
332 390
333static struct list_head spu_list[MAX_NUMNODES];
334static LIST_HEAD(spu_full_list);
335static DEFINE_MUTEX(spu_mutex);
336
337static void spu_init_channels(struct spu *spu) 391static void spu_init_channels(struct spu *spu)
338{ 392{
339 static const struct { 393 static const struct {
@@ -593,6 +647,7 @@ static int __init create_spu(void *data)
593 struct spu *spu; 647 struct spu *spu;
594 int ret; 648 int ret;
595 static int number; 649 static int number;
650 unsigned long flags;
596 651
597 ret = -ENOMEM; 652 ret = -ENOMEM;
598 spu = kzalloc(sizeof (*spu), GFP_KERNEL); 653 spu = kzalloc(sizeof (*spu), GFP_KERNEL);
@@ -620,8 +675,10 @@ static int __init create_spu(void *data)
620 goto out_free_irqs; 675 goto out_free_irqs;
621 676
622 mutex_lock(&spu_mutex); 677 mutex_lock(&spu_mutex);
678 spin_lock_irqsave(&spu_list_lock, flags);
623 list_add(&spu->list, &spu_list[spu->node]); 679 list_add(&spu->list, &spu_list[spu->node]);
624 list_add(&spu->full_list, &spu_full_list); 680 list_add(&spu->full_list, &spu_full_list);
681 spin_unlock_irqrestore(&spu_list_lock, flags);
625 mutex_unlock(&spu_mutex); 682 mutex_unlock(&spu_mutex);
626 683
627 goto out; 684 goto out;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index b00653d69c01..505266a568d4 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -63,8 +63,8 @@ static ssize_t
63spufs_mem_read(struct file *file, char __user *buffer, 63spufs_mem_read(struct file *file, char __user *buffer,
64 size_t size, loff_t *pos) 64 size_t size, loff_t *pos)
65{ 65{
66 int ret;
67 struct spu_context *ctx = file->private_data; 66 struct spu_context *ctx = file->private_data;
67 ssize_t ret;
68 68
69 spu_acquire(ctx); 69 spu_acquire(ctx);
70 ret = __spufs_mem_read(ctx, buffer, size, pos); 70 ret = __spufs_mem_read(ctx, buffer, size, pos);
@@ -74,25 +74,29 @@ spufs_mem_read(struct file *file, char __user *buffer,
74 74
75static ssize_t 75static ssize_t
76spufs_mem_write(struct file *file, const char __user *buffer, 76spufs_mem_write(struct file *file, const char __user *buffer,
77 size_t size, loff_t *pos) 77 size_t size, loff_t *ppos)
78{ 78{
79 struct spu_context *ctx = file->private_data; 79 struct spu_context *ctx = file->private_data;
80 char *local_store; 80 char *local_store;
81 loff_t pos = *ppos;
81 int ret; 82 int ret;
82 83
83 size = min_t(ssize_t, LS_SIZE - *pos, size); 84 if (pos < 0)
84 if (size <= 0) 85 return -EINVAL;
86 if (pos > LS_SIZE)
85 return -EFBIG; 87 return -EFBIG;
86 *pos += size; 88 if (size > LS_SIZE - pos)
89 size = LS_SIZE - pos;
87 90
88 spu_acquire(ctx); 91 spu_acquire(ctx);
89
90 local_store = ctx->ops->get_ls(ctx); 92 local_store = ctx->ops->get_ls(ctx);
91 ret = copy_from_user(local_store + *pos - size, 93 ret = copy_from_user(local_store + pos, buffer, size);
92 buffer, size) ? -EFAULT : size;
93
94 spu_release(ctx); 94 spu_release(ctx);
95 return ret; 95
96 if (ret)
97 return -EFAULT;
98 *ppos = pos + size;
99 return size;
96} 100}
97 101
98static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma, 102static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma,
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index 353a8fa07ab8..f95a611ca362 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -143,7 +143,7 @@ static inline int spu_run_init(struct spu_context *ctx, u32 * npc)
143 int ret; 143 int ret;
144 unsigned long runcntl = SPU_RUNCNTL_RUNNABLE; 144 unsigned long runcntl = SPU_RUNCNTL_RUNNABLE;
145 145
146 ret = spu_acquire_runnable(ctx, SPU_ACTIVATE_NOWAKE); 146 ret = spu_acquire_runnable(ctx, 0);
147 if (ret) 147 if (ret)
148 return ret; 148 return ret;
149 149
@@ -155,7 +155,7 @@ static inline int spu_run_init(struct spu_context *ctx, u32 * npc)
155 spu_release(ctx); 155 spu_release(ctx);
156 ret = spu_setup_isolated(ctx); 156 ret = spu_setup_isolated(ctx);
157 if (!ret) 157 if (!ret)
158 ret = spu_acquire_runnable(ctx, SPU_ACTIVATE_NOWAKE); 158 ret = spu_acquire_runnable(ctx, 0);
159 } 159 }
160 160
161 /* if userspace has set the runcntrl register (eg, to issue an 161 /* if userspace has set the runcntrl register (eg, to issue an
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 2f25e68b4bac..39823cec0844 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -127,14 +127,6 @@ static void spu_remove_from_active_list(struct spu *spu)
127 mutex_unlock(&spu_prio->active_mutex[node]); 127 mutex_unlock(&spu_prio->active_mutex[node]);
128} 128}
129 129
130static inline void mm_needs_global_tlbie(struct mm_struct *mm)
131{
132 int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1;
133
134 /* Global TLBIE broadcast required with SPEs. */
135 __cpus_setall(&mm->cpu_vm_mask, nr);
136}
137
138static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); 130static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier);
139 131
140static void spu_switch_notify(struct spu *spu, struct spu_context *ctx) 132static void spu_switch_notify(struct spu *spu, struct spu_context *ctx)
@@ -167,8 +159,7 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
167 ctx->spu = spu; 159 ctx->spu = spu;
168 ctx->ops = &spu_hw_ops; 160 ctx->ops = &spu_hw_ops;
169 spu->pid = current->pid; 161 spu->pid = current->pid;
170 spu->mm = ctx->owner; 162 spu_associate_mm(spu, ctx->owner);
171 mm_needs_global_tlbie(spu->mm);
172 spu->ibox_callback = spufs_ibox_callback; 163 spu->ibox_callback = spufs_ibox_callback;
173 spu->wbox_callback = spufs_wbox_callback; 164 spu->wbox_callback = spufs_wbox_callback;
174 spu->stop_callback = spufs_stop_callback; 165 spu->stop_callback = spufs_stop_callback;
@@ -205,7 +196,7 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx)
205 spu->stop_callback = NULL; 196 spu->stop_callback = NULL;
206 spu->mfc_callback = NULL; 197 spu->mfc_callback = NULL;
207 spu->dma_callback = NULL; 198 spu->dma_callback = NULL;
208 spu->mm = NULL; 199 spu_associate_mm(spu, NULL);
209 spu->pid = 0; 200 spu->pid = 0;
210 ctx->ops = &spu_backing_ops; 201 ctx->ops = &spu_backing_ops;
211 ctx->spu = NULL; 202 ctx->spu = NULL;
@@ -263,7 +254,6 @@ static void spu_prio_wait(struct spu_context *ctx)
263{ 254{
264 DEFINE_WAIT(wait); 255 DEFINE_WAIT(wait);
265 256
266 set_bit(SPU_SCHED_WAKE, &ctx->sched_flags);
267 prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE); 257 prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE);
268 if (!signal_pending(current)) { 258 if (!signal_pending(current)) {
269 mutex_unlock(&ctx->state_mutex); 259 mutex_unlock(&ctx->state_mutex);
@@ -272,7 +262,6 @@ static void spu_prio_wait(struct spu_context *ctx)
272 } 262 }
273 __set_current_state(TASK_RUNNING); 263 __set_current_state(TASK_RUNNING);
274 remove_wait_queue(&ctx->stop_wq, &wait); 264 remove_wait_queue(&ctx->stop_wq, &wait);
275 clear_bit(SPU_SCHED_WAKE, &ctx->sched_flags);
276} 265}
277 266
278/** 267/**
@@ -292,7 +281,7 @@ static void spu_reschedule(struct spu *spu)
292 best = sched_find_first_bit(spu_prio->bitmap); 281 best = sched_find_first_bit(spu_prio->bitmap);
293 if (best < MAX_PRIO) { 282 if (best < MAX_PRIO) {
294 struct spu_context *ctx = spu_grab_context(best); 283 struct spu_context *ctx = spu_grab_context(best);
295 if (ctx && test_bit(SPU_SCHED_WAKE, &ctx->sched_flags)) 284 if (ctx)
296 wake_up(&ctx->stop_wq); 285 wake_up(&ctx->stop_wq);
297 } 286 }
298 spin_unlock(&spu_prio->runq_lock); 287 spin_unlock(&spu_prio->runq_lock);
@@ -414,8 +403,7 @@ int spu_activate(struct spu_context *ctx, unsigned long flags)
414 } 403 }
415 404
416 spu_add_to_rq(ctx); 405 spu_add_to_rq(ctx);
417 if (!(flags & SPU_ACTIVATE_NOWAKE)) 406 spu_prio_wait(ctx);
418 spu_prio_wait(ctx);
419 spu_del_from_rq(ctx); 407 spu_del_from_rq(ctx);
420 } while (!signal_pending(current)); 408 } while (!signal_pending(current));
421 409
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 0c437891dfd5..5c4e47d69d79 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -41,7 +41,7 @@ struct spu_gang;
41 41
42/* ctx->sched_flags */ 42/* ctx->sched_flags */
43enum { 43enum {
44 SPU_SCHED_WAKE = 0, 44 SPU_SCHED_WAKE = 0, /* currently unused */
45}; 45};
46 46
47struct spu_context { 47struct spu_context {
@@ -191,9 +191,7 @@ void spu_forget(struct spu_context *ctx);
191int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags); 191int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags);
192void spu_acquire_saved(struct spu_context *ctx); 192void spu_acquire_saved(struct spu_context *ctx);
193int spu_acquire_exclusive(struct spu_context *ctx); 193int spu_acquire_exclusive(struct spu_context *ctx);
194enum { 194
195 SPU_ACTIVATE_NOWAKE = 1,
196};
197int spu_activate(struct spu_context *ctx, unsigned long flags); 195int spu_activate(struct spu_context *ctx, unsigned long flags);
198void spu_deactivate(struct spu_context *ctx); 196void spu_deactivate(struct spu_context *ctx);
199void spu_yield(struct spu_context *ctx); 197void spu_yield(struct spu_context *ctx);
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index c08981ff7fc6..fd91c73de34e 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -468,26 +468,6 @@ static inline void wait_purge_complete(struct spu_state *csa, struct spu *spu)
468 MFC_CNTL_PURGE_DMA_COMPLETE); 468 MFC_CNTL_PURGE_DMA_COMPLETE);
469} 469}
470 470
471static inline void save_mfc_slbs(struct spu_state *csa, struct spu *spu)
472{
473 struct spu_priv2 __iomem *priv2 = spu->priv2;
474 int i;
475
476 /* Save, Step 29:
477 * If MFC_SR1[R]='1', save SLBs in CSA.
478 */
479 if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) {
480 csa->priv2.slb_index_W = in_be64(&priv2->slb_index_W);
481 for (i = 0; i < 8; i++) {
482 out_be64(&priv2->slb_index_W, i);
483 eieio();
484 csa->slb_esid_RW[i] = in_be64(&priv2->slb_esid_RW);
485 csa->slb_vsid_RW[i] = in_be64(&priv2->slb_vsid_RW);
486 eieio();
487 }
488 }
489}
490
491static inline void setup_mfc_sr1(struct spu_state *csa, struct spu *spu) 471static inline void setup_mfc_sr1(struct spu_state *csa, struct spu *spu)
492{ 472{
493 /* Save, Step 30: 473 /* Save, Step 30:
@@ -708,20 +688,6 @@ static inline void resume_mfc_queue(struct spu_state *csa, struct spu *spu)
708 out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE); 688 out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE);
709} 689}
710 690
711static inline void invalidate_slbs(struct spu_state *csa, struct spu *spu)
712{
713 struct spu_priv2 __iomem *priv2 = spu->priv2;
714
715 /* Save, Step 45:
716 * Restore, Step 19:
717 * If MFC_SR1[R]=1, write 0 to SLB_Invalidate_All.
718 */
719 if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) {
720 out_be64(&priv2->slb_invalidate_all_W, 0UL);
721 eieio();
722 }
723}
724
725static inline void get_kernel_slb(u64 ea, u64 slb[2]) 691static inline void get_kernel_slb(u64 ea, u64 slb[2])
726{ 692{
727 u64 llp; 693 u64 llp;
@@ -765,7 +731,7 @@ static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu)
765 * MFC_SR1[R]=1 (in other words, assume that 731 * MFC_SR1[R]=1 (in other words, assume that
766 * translation is desired by OS environment). 732 * translation is desired by OS environment).
767 */ 733 */
768 invalidate_slbs(csa, spu); 734 spu_invalidate_slbs(spu);
769 get_kernel_slb((unsigned long)&spu_save_code[0], code_slb); 735 get_kernel_slb((unsigned long)&spu_save_code[0], code_slb);
770 get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb); 736 get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb);
771 load_mfc_slb(spu, code_slb, 0); 737 load_mfc_slb(spu, code_slb, 0);
@@ -1718,27 +1684,6 @@ static inline void check_ppuint_mb_stat(struct spu_state *csa, struct spu *spu)
1718 } 1684 }
1719} 1685}
1720 1686
1721static inline void restore_mfc_slbs(struct spu_state *csa, struct spu *spu)
1722{
1723 struct spu_priv2 __iomem *priv2 = spu->priv2;
1724 int i;
1725
1726 /* Restore, Step 68:
1727 * If MFC_SR1[R]='1', restore SLBs from CSA.
1728 */
1729 if (csa->priv1.mfc_sr1_RW & MFC_STATE1_RELOCATE_MASK) {
1730 for (i = 0; i < 8; i++) {
1731 out_be64(&priv2->slb_index_W, i);
1732 eieio();
1733 out_be64(&priv2->slb_esid_RW, csa->slb_esid_RW[i]);
1734 out_be64(&priv2->slb_vsid_RW, csa->slb_vsid_RW[i]);
1735 eieio();
1736 }
1737 out_be64(&priv2->slb_index_W, csa->priv2.slb_index_W);
1738 eieio();
1739 }
1740}
1741
1742static inline void restore_mfc_sr1(struct spu_state *csa, struct spu *spu) 1687static inline void restore_mfc_sr1(struct spu_state *csa, struct spu *spu)
1743{ 1688{
1744 /* Restore, Step 69: 1689 /* Restore, Step 69:
@@ -1875,7 +1820,6 @@ static void save_csa(struct spu_state *prev, struct spu *spu)
1875 set_mfc_tclass_id(prev, spu); /* Step 26. */ 1820 set_mfc_tclass_id(prev, spu); /* Step 26. */
1876 purge_mfc_queue(prev, spu); /* Step 27. */ 1821 purge_mfc_queue(prev, spu); /* Step 27. */
1877 wait_purge_complete(prev, spu); /* Step 28. */ 1822 wait_purge_complete(prev, spu); /* Step 28. */
1878 save_mfc_slbs(prev, spu); /* Step 29. */
1879 setup_mfc_sr1(prev, spu); /* Step 30. */ 1823 setup_mfc_sr1(prev, spu); /* Step 30. */
1880 save_spu_npc(prev, spu); /* Step 31. */ 1824 save_spu_npc(prev, spu); /* Step 31. */
1881 save_spu_privcntl(prev, spu); /* Step 32. */ 1825 save_spu_privcntl(prev, spu); /* Step 32. */
@@ -1987,7 +1931,7 @@ static void harvest(struct spu_state *prev, struct spu *spu)
1987 reset_spu_privcntl(prev, spu); /* Step 16. */ 1931 reset_spu_privcntl(prev, spu); /* Step 16. */
1988 reset_spu_lslr(prev, spu); /* Step 17. */ 1932 reset_spu_lslr(prev, spu); /* Step 17. */
1989 setup_mfc_sr1(prev, spu); /* Step 18. */ 1933 setup_mfc_sr1(prev, spu); /* Step 18. */
1990 invalidate_slbs(prev, spu); /* Step 19. */ 1934 spu_invalidate_slbs(spu); /* Step 19. */
1991 reset_ch_part1(prev, spu); /* Step 20. */ 1935 reset_ch_part1(prev, spu); /* Step 20. */
1992 reset_ch_part2(prev, spu); /* Step 21. */ 1936 reset_ch_part2(prev, spu); /* Step 21. */
1993 enable_interrupts(prev, spu); /* Step 22. */ 1937 enable_interrupts(prev, spu); /* Step 22. */
@@ -2055,7 +1999,7 @@ static void restore_csa(struct spu_state *next, struct spu *spu)
2055 restore_spu_mb(next, spu); /* Step 65. */ 1999 restore_spu_mb(next, spu); /* Step 65. */
2056 check_ppu_mb_stat(next, spu); /* Step 66. */ 2000 check_ppu_mb_stat(next, spu); /* Step 66. */
2057 check_ppuint_mb_stat(next, spu); /* Step 67. */ 2001 check_ppuint_mb_stat(next, spu); /* Step 67. */
2058 restore_mfc_slbs(next, spu); /* Step 68. */ 2002 spu_invalidate_slbs(spu); /* Modified Step 68. */
2059 restore_mfc_sr1(next, spu); /* Step 69. */ 2003 restore_mfc_sr1(next, spu); /* Step 69. */
2060 restore_other_spu_access(next, spu); /* Step 70. */ 2004 restore_other_spu_access(next, spu); /* Step 70. */
2061 restore_spu_runcntl(next, spu); /* Step 71. */ 2005 restore_spu_runcntl(next, spu); /* Step 71. */
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c
index c11b39c3776a..fb23d53eb09c 100644
--- a/arch/powerpc/platforms/celleb/scc_epci.c
+++ b/arch/powerpc/platforms/celleb/scc_epci.c
@@ -43,11 +43,34 @@
43 43
44#define iob() __asm__ __volatile__("eieio; sync":::"memory") 44#define iob() __asm__ __volatile__("eieio; sync":::"memory")
45 45
46static inline volatile void __iomem *celleb_epci_get_epci_base(
47 struct pci_controller *hose)
48{
49 /*
50 * Note:
51 * Celleb epci uses cfg_addr as a base address for
52 * epci control registers.
53 */
54
55 return hose->cfg_addr;
56}
57
58static inline volatile void __iomem *celleb_epci_get_epci_cfg(
59 struct pci_controller *hose)
60{
61 /*
62 * Note:
63 * Celleb epci uses cfg_data as a base address for
64 * configuration area for epci devices.
65 */
66
67 return hose->cfg_data;
68}
46 69
47#if 0 /* test code for epci dummy read */ 70#if 0 /* test code for epci dummy read */
48static void celleb_epci_dummy_read(struct pci_dev *dev) 71static void celleb_epci_dummy_read(struct pci_dev *dev)
49{ 72{
50 void __iomem *epci_base; 73 volatile void __iomem *epci_base;
51 struct device_node *node; 74 struct device_node *node;
52 struct pci_controller *hose; 75 struct pci_controller *hose;
53 u32 val; 76 u32 val;
@@ -58,7 +81,7 @@ static void celleb_epci_dummy_read(struct pci_dev *dev)
58 if (!hose) 81 if (!hose)
59 return; 82 return;
60 83
61 epci_base = hose->cfg_addr; 84 epci_base = celleb_epci_get_epci_base(hose);
62 85
63 val = in_be32(epci_base + SCC_EPCI_WATRP); 86 val = in_be32(epci_base + SCC_EPCI_WATRP);
64 iosync(); 87 iosync();
@@ -70,19 +93,20 @@ static void celleb_epci_dummy_read(struct pci_dev *dev)
70static inline void clear_and_disable_master_abort_interrupt( 93static inline void clear_and_disable_master_abort_interrupt(
71 struct pci_controller *hose) 94 struct pci_controller *hose)
72{ 95{
73 void __iomem *addr; 96 volatile void __iomem *epci_base, *reg;
74 addr = hose->cfg_addr + PCI_COMMAND; 97 epci_base = celleb_epci_get_epci_base(hose);
75 out_be32(addr, in_be32(addr) | (PCI_STATUS_REC_MASTER_ABORT << 16)); 98 reg = epci_base + PCI_COMMAND;
99 out_be32(reg, in_be32(reg) | (PCI_STATUS_REC_MASTER_ABORT << 16));
76} 100}
77 101
78static int celleb_epci_check_abort(struct pci_controller *hose, 102static int celleb_epci_check_abort(struct pci_controller *hose,
79 void __iomem *addr) 103 volatile void __iomem *addr)
80{ 104{
81 void __iomem *reg, *epci_base; 105 volatile void __iomem *reg, *epci_base;
82 u32 val; 106 u32 val;
83 107
84 iob(); 108 iob();
85 epci_base = hose->cfg_addr; 109 epci_base = celleb_epci_get_epci_base(hose);
86 110
87 reg = epci_base + PCI_COMMAND; 111 reg = epci_base + PCI_COMMAND;
88 val = in_be32(reg); 112 val = in_be32(reg);
@@ -108,20 +132,21 @@ static int celleb_epci_check_abort(struct pci_controller *hose,
108 return PCIBIOS_SUCCESSFUL; 132 return PCIBIOS_SUCCESSFUL;
109} 133}
110 134
111static void __iomem *celleb_epci_make_config_addr(struct pci_controller *hose, 135static volatile void __iomem *celleb_epci_make_config_addr(
136 struct pci_controller *hose,
112 unsigned int devfn, int where) 137 unsigned int devfn, int where)
113{ 138{
114 void __iomem *addr; 139 volatile void __iomem *addr;
115 struct pci_bus *bus = hose->bus; 140 struct pci_bus *bus = hose->bus;
116 141
117 if (bus->self) 142 if (bus->self)
118 addr = hose->cfg_data + 143 addr = celleb_epci_get_epci_cfg(hose) +
119 (((bus->number & 0xff) << 16) 144 (((bus->number & 0xff) << 16)
120 | ((devfn & 0xff) << 8) 145 | ((devfn & 0xff) << 8)
121 | (where & 0xff) 146 | (where & 0xff)
122 | 0x01000000); 147 | 0x01000000);
123 else 148 else
124 addr = hose->cfg_data + 149 addr = celleb_epci_get_epci_cfg(hose) +
125 (((devfn & 0xff) << 8) | (where & 0xff)); 150 (((devfn & 0xff) << 8) | (where & 0xff));
126 151
127 pr_debug("EPCI: config_addr = 0x%p\n", addr); 152 pr_debug("EPCI: config_addr = 0x%p\n", addr);
@@ -132,7 +157,7 @@ static void __iomem *celleb_epci_make_config_addr(struct pci_controller *hose,
132static int celleb_epci_read_config(struct pci_bus *bus, 157static int celleb_epci_read_config(struct pci_bus *bus,
133 unsigned int devfn, int where, int size, u32 * val) 158 unsigned int devfn, int where, int size, u32 * val)
134{ 159{
135 void __iomem *addr; 160 volatile void __iomem *epci_base, *addr;
136 struct device_node *node; 161 struct device_node *node;
137 struct pci_controller *hose; 162 struct pci_controller *hose;
138 163
@@ -142,13 +167,14 @@ static int celleb_epci_read_config(struct pci_bus *bus,
142 node = (struct device_node *)bus->sysdata; 167 node = (struct device_node *)bus->sysdata;
143 hose = pci_find_hose_for_OF_device(node); 168 hose = pci_find_hose_for_OF_device(node);
144 169
145 if (!hose->cfg_data) 170 if (!celleb_epci_get_epci_cfg(hose))
146 return PCIBIOS_DEVICE_NOT_FOUND; 171 return PCIBIOS_DEVICE_NOT_FOUND;
147 172
148 if (bus->number == hose->first_busno && devfn == 0) { 173 if (bus->number == hose->first_busno && devfn == 0) {
149 /* EPCI controller self */ 174 /* EPCI controller self */
150 175
151 addr = hose->cfg_addr + where; 176 epci_base = celleb_epci_get_epci_base(hose);
177 addr = epci_base + where;
152 178
153 switch (size) { 179 switch (size) {
154 case 1: 180 case 1:
@@ -185,7 +211,7 @@ static int celleb_epci_read_config(struct pci_bus *bus,
185 } 211 }
186 212
187 pr_debug("EPCI: " 213 pr_debug("EPCI: "
188 "addr=0x%lx, devfn=0x%x, where=0x%x, size=0x%x, val=0x%x\n", 214 "addr=0x%p, devfn=0x%x, where=0x%x, size=0x%x, val=0x%x\n",
189 addr, devfn, where, size, *val); 215 addr, devfn, where, size, *val);
190 216
191 return celleb_epci_check_abort(hose, NULL); 217 return celleb_epci_check_abort(hose, NULL);
@@ -194,7 +220,7 @@ static int celleb_epci_read_config(struct pci_bus *bus,
194static int celleb_epci_write_config(struct pci_bus *bus, 220static int celleb_epci_write_config(struct pci_bus *bus,
195 unsigned int devfn, int where, int size, u32 val) 221 unsigned int devfn, int where, int size, u32 val)
196{ 222{
197 void __iomem *addr; 223 volatile void __iomem *epci_base, *addr;
198 struct device_node *node; 224 struct device_node *node;
199 struct pci_controller *hose; 225 struct pci_controller *hose;
200 226
@@ -204,13 +230,15 @@ static int celleb_epci_write_config(struct pci_bus *bus,
204 node = (struct device_node *)bus->sysdata; 230 node = (struct device_node *)bus->sysdata;
205 hose = pci_find_hose_for_OF_device(node); 231 hose = pci_find_hose_for_OF_device(node);
206 232
207 if (!hose->cfg_data) 233
234 if (!celleb_epci_get_epci_cfg(hose))
208 return PCIBIOS_DEVICE_NOT_FOUND; 235 return PCIBIOS_DEVICE_NOT_FOUND;
209 236
210 if (bus->number == hose->first_busno && devfn == 0) { 237 if (bus->number == hose->first_busno && devfn == 0) {
211 /* EPCI controller self */ 238 /* EPCI controller self */
212 239
213 addr = hose->cfg_addr + where; 240 epci_base = celleb_epci_get_epci_base(hose);
241 addr = epci_base + where;
214 242
215 switch (size) { 243 switch (size) {
216 case 1: 244 case 1:
@@ -258,10 +286,10 @@ struct pci_ops celleb_epci_ops = {
258static int __devinit celleb_epci_init(struct pci_controller *hose) 286static int __devinit celleb_epci_init(struct pci_controller *hose)
259{ 287{
260 u32 val; 288 u32 val;
261 void __iomem *reg, *epci_base; 289 volatile void __iomem *reg, *epci_base;
262 int hwres = 0; 290 int hwres = 0;
263 291
264 epci_base = hose->cfg_addr; 292 epci_base = celleb_epci_get_epci_base(hose);
265 293
266 /* PCI core reset(Internal bus and PCI clock) */ 294 /* PCI core reset(Internal bus and PCI clock) */
267 reg = epci_base + SCC_EPCI_CKCTRL; 295 reg = epci_base + SCC_EPCI_CKCTRL;
@@ -382,6 +410,18 @@ int __devinit celleb_setup_epci(struct device_node *node,
382 410
383 pr_debug("PCI: celleb_setup_epci()\n"); 411 pr_debug("PCI: celleb_setup_epci()\n");
384 412
413 /*
414 * Note:
415 * Celleb epci uses cfg_addr and cfg_data member of
416 * pci_controller structure in irregular way.
417 *
418 * cfg_addr is used to map for control registers of
419 * celleb epci.
420 *
421 * cfg_data is used for configuration area of devices
422 * on Celleb epci buses.
423 */
424
385 if (of_address_to_resource(node, 0, &r)) 425 if (of_address_to_resource(node, 0, &r))
386 goto error; 426 goto error;
387 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); 427 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1));
diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 6ad4b1a72c96..71045677559a 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -58,6 +58,7 @@ static struct resource mv643xx_eth0_resources[] = {
58 58
59 59
60static struct mv643xx_eth_platform_data eth0_pd = { 60static struct mv643xx_eth_platform_data eth0_pd = {
61 .port_number = 0,
61 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0, 62 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
62 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE, 63 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
63 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16, 64 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
@@ -87,6 +88,7 @@ static struct resource mv643xx_eth1_resources[] = {
87}; 88};
88 89
89static struct mv643xx_eth_platform_data eth1_pd = { 90static struct mv643xx_eth_platform_data eth1_pd = {
91 .port_number = 1,
90 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1, 92 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
91 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE, 93 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
92 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16, 94 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 886c522d78e9..3410bcbc9dbe 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -79,6 +79,7 @@ config LINKSTATION
79 select MPIC 79 select MPIC
80 select FSL_SOC 80 select FSL_SOC
81 select PPC_UDBG_16550 if SERIAL_8250 81 select PPC_UDBG_16550 if SERIAL_8250
82 select DEFAULT_UIMAGE
82 help 83 help
83 Select LINKSTATION if configuring for one of PPC- (MPC8241) 84 Select LINKSTATION if configuring for one of PPC- (MPC8241)
84 based NAS systems from Buffalo Technology. So far only 85 based NAS systems from Buffalo Technology. So far only
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c
index 459a53b7d24d..71dbf1a56e13 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -77,7 +77,7 @@
77#define IOBMAP_L2E_V 0x80000000 77#define IOBMAP_L2E_V 0x80000000
78#define IOBMAP_L2E_V_CACHED 0xc0000000 78#define IOBMAP_L2E_V_CACHED 0xc0000000
79 79
80static u32 *iob; 80static u32 __iomem *iob;
81static u32 iob_l1_emptyval; 81static u32 iob_l1_emptyval;
82static u32 iob_l2_emptyval; 82static u32 iob_l2_emptyval;
83static u32 *iob_l2_base; 83static u32 *iob_l2_base;
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index c29a6a064d22..24cc50c1774a 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -810,6 +810,7 @@ core99_ata100_enable(struct device_node *node, long value)
810 unsigned long flags; 810 unsigned long flags;
811 struct pci_dev *pdev = NULL; 811 struct pci_dev *pdev = NULL;
812 u8 pbus, pid; 812 u8 pbus, pid;
813 int rc;
813 814
814 if (uninorth_rev < 0x24) 815 if (uninorth_rev < 0x24)
815 return -ENODEV; 816 return -ENODEV;
@@ -828,7 +829,9 @@ core99_ata100_enable(struct device_node *node, long value)
828 pdev = pci_find_slot(pbus, pid); 829 pdev = pci_find_slot(pbus, pid);
829 if (pdev == NULL) 830 if (pdev == NULL)
830 return 0; 831 return 0;
831 pci_enable_device(pdev); 832 rc = pci_enable_device(pdev);
833 if (rc)
834 return rc;
832 pci_set_master(pdev); 835 pci_set_master(pdev);
833 } 836 }
834 return 0; 837 return 0;
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index f42475b27c15..6fbac308ded6 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1191,8 +1191,11 @@ void __init pmac_pcibios_after_init(void)
1191 * -- BenH 1191 * -- BenH
1192 */ 1192 */
1193 for_each_pci_dev(dev) { 1193 for_each_pci_dev(dev) {
1194 if ((dev->class >> 16) == PCI_BASE_CLASS_STORAGE) 1194 if ((dev->class >> 16) != PCI_BASE_CLASS_STORAGE)
1195 pci_enable_device(dev); 1195 continue;
1196 if (pci_enable_device(dev))
1197 printk(KERN_WARNING
1198 "pci: Failed to enable %s\n", pci_name(dev));
1196 } 1199 }
1197#endif /* CONFIG_BLK_DEV_IDE */ 1200#endif /* CONFIG_BLK_DEV_IDE */
1198 1201
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 42354de3f557..2014d2b44449 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -294,7 +294,7 @@ static int __init ps3_mm_add_memory(void)
294 unsigned long nr_pages; 294 unsigned long nr_pages;
295 295
296 if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 296 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
297 return 0; 297 return -ENODEV;
298 298
299 BUG_ON(!mem_init_done); 299 BUG_ON(!mem_init_done);
300 300
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index a9f7e4a39a2a..3c48cce98a5c 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -172,7 +172,7 @@ int __init ps3_system_bus_init(void)
172 int result; 172 int result;
173 173
174 if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 174 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
175 return 0; 175 return -ENODEV;
176 176
177 result = bus_register(&ps3_system_bus_type); 177 result = bus_register(&ps3_system_bus_type);
178 BUG_ON(result); 178 BUG_ON(result);
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 0183e5fbaf46..bf299b66f3fc 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -218,7 +218,7 @@ Commands:\n\
218" ss stop execution on all spus\n\ 218" ss stop execution on all spus\n\
219 sr restore execution on stopped spus\n\ 219 sr restore execution on stopped spus\n\
220 sf # dump spu fields for spu # (in hex)\n\ 220 sf # dump spu fields for spu # (in hex)\n\
221 sd # dump spu local store for spu # (in hex)\ 221 sd # dump spu local store for spu # (in hex)\n\
222 sdi # disassemble spu local store for spu # (in hex)\n" 222 sdi # disassemble spu local store for spu # (in hex)\n"
223#endif 223#endif
224" S print special registers\n\ 224" S print special registers\n\
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index 3b039c30a439..a6f8b686ea83 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -339,7 +339,9 @@ static struct resource mv64x60_eth0_resources[] = {
339 }, 339 },
340}; 340};
341 341
342static struct mv643xx_eth_platform_data eth0_pd; 342static struct mv643xx_eth_platform_data eth0_pd = {
343 .port_number = 0,
344};
343 345
344static struct platform_device eth0_device = { 346static struct platform_device eth0_device = {
345 .name = MV643XX_ETH_NAME, 347 .name = MV643XX_ETH_NAME,
@@ -362,7 +364,9 @@ static struct resource mv64x60_eth1_resources[] = {
362 }, 364 },
363}; 365};
364 366
365static struct mv643xx_eth_platform_data eth1_pd; 367static struct mv643xx_eth_platform_data eth1_pd = {
368 .port_number = 1,
369};
366 370
367static struct platform_device eth1_device = { 371static struct platform_device eth1_device = {
368 .name = MV643XX_ETH_NAME, 372 .name = MV643XX_ETH_NAME,
@@ -385,7 +389,9 @@ static struct resource mv64x60_eth2_resources[] = {
385 }, 389 },
386}; 390};
387 391
388static struct mv643xx_eth_platform_data eth2_pd; 392static struct mv643xx_eth_platform_data eth2_pd = {
393 .port_number = 2,
394};
389 395
390static struct platform_device eth2_device = { 396static struct platform_device eth2_device = {
391 .name = MV643XX_ETH_NAME, 397 .name = MV643XX_ETH_NAME,
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index d9425f59be91..0f293aa7b0fa 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -376,6 +376,8 @@ config SHARED_KERNEL
376 Select this option, if you want to share the text segment of the 376 Select this option, if you want to share the text segment of the
377 Linux kernel between different VM guests. This reduces memory 377 Linux kernel between different VM guests. This reduces memory
378 usage with lots of guests but greatly increases kernel size. 378 usage with lots of guests but greatly increases kernel size.
379 Also if a kernel was IPL'ed from a shared segment the kexec system
380 call will not work.
379 You should only select this option if you know what you are 381 You should only select this option if you know what you are
380 doing and want to exploit this feature. 382 doing and want to exploit this feature.
381 383
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
index 4ca615788702..697eb30a68a3 100644
--- a/arch/s390/appldata/appldata_mem.c
+++ b/arch/s390/appldata/appldata_mem.c
@@ -117,7 +117,10 @@ static void appldata_get_mem_data(void *data)
117 mem_data->pgpgout = ev[PGPGOUT] >> 1; 117 mem_data->pgpgout = ev[PGPGOUT] >> 1;
118 mem_data->pswpin = ev[PSWPIN]; 118 mem_data->pswpin = ev[PSWPIN];
119 mem_data->pswpout = ev[PSWPOUT]; 119 mem_data->pswpout = ev[PSWPOUT];
120 mem_data->pgalloc = ev[PGALLOC_NORMAL] + ev[PGALLOC_DMA]; 120 mem_data->pgalloc = ev[PGALLOC_NORMAL];
121#ifdef CONFIG_ZONE_DMA
122 mem_data->pgalloc += ev[PGALLOC_DMA];
123#endif
121 mem_data->pgfault = ev[PGFAULT]; 124 mem_data->pgfault = ev[PGFAULT];
122 mem_data->pgmajfault = ev[PGMAJFAULT]; 125 mem_data->pgmajfault = ev[PGMAJFAULT];
123 126
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index da7c8bb80982..dc364c1419af 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -121,7 +121,7 @@ startup_continue:
121 .long .Lduct # cr2: dispatchable unit control table 121 .long .Lduct # cr2: dispatchable unit control table
122 .long 0 # cr3: instruction authorization 122 .long 0 # cr3: instruction authorization
123 .long 0 # cr4: instruction authorization 123 .long 0 # cr4: instruction authorization
124 .long 0xffffffff # cr5: primary-aste origin 124 .long .Lduct # cr5: primary-aste origin
125 .long 0 # cr6: I/O interrupts 125 .long 0 # cr6: I/O interrupts
126 .long 0 # cr7: secondary space segment table 126 .long 0 # cr7: secondary space segment table
127 .long 0 # cr8: access registers translation 127 .long 0 # cr8: access registers translation
@@ -132,8 +132,6 @@ startup_continue:
132 .long 0 # cr13: home space segment table 132 .long 0 # cr13: home space segment table
133 .long 0xc0000000 # cr14: machine check handling off 133 .long 0xc0000000 # cr14: machine check handling off
134 .long 0 # cr15: linkage stack operations 134 .long 0 # cr15: linkage stack operations
135.Lduct: .long 0,0,0,0,0,0,0,0
136 .long 0,0,0,0,0,0,0,0
137.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu 135.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu
138.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp 136.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp
139.Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg 137.Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg
@@ -147,6 +145,13 @@ startup_continue:
147.Linittu: .long init_thread_union 145.Linittu: .long init_thread_union
148.Lstartup_init: 146.Lstartup_init:
149 .long startup_init 147 .long startup_init
148 .align 64
149.Lduct: .long 0,0,0,0,.Lduald,0,0,0
150 .long 0,0,0,0,0,0,0,0
151 .align 128
152.Lduald:.rept 8
153 .long 0x80000000,0,0,0 # invalid access-list entries
154 .endr
150 155
151 .org 0x12000 156 .org 0x12000
152 .globl _ehead 157 .globl _ehead
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index af09e18cc5d0..37010709fe68 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -134,7 +134,7 @@ startup_continue:
134 .quad .Lduct # cr2: dispatchable unit control table 134 .quad .Lduct # cr2: dispatchable unit control table
135 .quad 0 # cr3: instruction authorization 135 .quad 0 # cr3: instruction authorization
136 .quad 0 # cr4: instruction authorization 136 .quad 0 # cr4: instruction authorization
137 .quad 0xffffffffffffffff # cr5: primary-aste origin 137 .quad .Lduct # cr5: primary-aste origin
138 .quad 0 # cr6: I/O interrupts 138 .quad 0 # cr6: I/O interrupts
139 .quad 0 # cr7: secondary space segment table 139 .quad 0 # cr7: secondary space segment table
140 .quad 0 # cr8: access registers translation 140 .quad 0 # cr8: access registers translation
@@ -145,14 +145,19 @@ startup_continue:
145 .quad 0 # cr13: home space segment table 145 .quad 0 # cr13: home space segment table
146 .quad 0xc0000000 # cr14: machine check handling off 146 .quad 0xc0000000 # cr14: machine check handling off
147 .quad 0 # cr15: linkage stack operations 147 .quad 0 # cr15: linkage stack operations
148.Lduct: .long 0,0,0,0,0,0,0,0
149 .long 0,0,0,0,0,0,0,0
150.Lpcmsk:.quad 0x0000000180000000 148.Lpcmsk:.quad 0x0000000180000000
151.L4malign:.quad 0xffffffffffc00000 149.L4malign:.quad 0xffffffffffc00000
152.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 150.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
153.Lnop: .long 0x07000700 151.Lnop: .long 0x07000700
154.Lparmaddr: 152.Lparmaddr:
155 .quad PARMAREA 153 .quad PARMAREA
154 .align 64
155.Lduct: .long 0,0,0,0,.Lduald,0,0,0
156 .long 0,0,0,0,0,0,0,0
157 .align 128
158.Lduald:.rept 8
159 .long 0x80000000,0,0,0 # invalid access-list entries
160 .endr
156 161
157 .org 0x12000 162 .org 0x12000
158 .globl _ehead 163 .globl _ehead
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 5a863a3bf10c..d125a4ead08d 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -1066,7 +1066,7 @@ static void do_reset_calls(void)
1066 reset->fn(); 1066 reset->fn();
1067} 1067}
1068 1068
1069extern __u32 dump_prefix_page; 1069u32 dump_prefix_page;
1070 1070
1071void s390_reset_system(void) 1071void s390_reset_system(void)
1072{ 1072{
@@ -1078,7 +1078,7 @@ void s390_reset_system(void)
1078 lc->panic_stack = S390_lowcore.panic_stack; 1078 lc->panic_stack = S390_lowcore.panic_stack;
1079 1079
1080 /* Save prefix page address for dump case */ 1080 /* Save prefix page address for dump case */
1081 dump_prefix_page = (unsigned long) lc; 1081 dump_prefix_page = (u32)(unsigned long) lc;
1082 1082
1083 /* Disable prefixing */ 1083 /* Disable prefixing */
1084 set_prefix(0); 1084 set_prefix(0);
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index a466bab6677e..8af549e95730 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -337,21 +337,14 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
337 } 337 }
338 338
339 p = get_kprobe(addr); 339 p = get_kprobe(addr);
340 if (!p) { 340 if (!p)
341 if (*addr != BREAKPOINT_INSTRUCTION) { 341 /*
342 /* 342 * No kprobe at this address. The fault has not been
343 * The breakpoint instruction was removed right 343 * caused by a kprobe breakpoint. The race of breakpoint
344 * after we hit it. Another cpu has removed 344 * vs. kprobe remove does not exist because on s390 we
345 * either a probepoint or a debugger breakpoint 345 * use stop_machine_run to arm/disarm the breakpoints.
346 * at this address. In either case, no further 346 */
347 * handling of this interrupt is appropriate.
348 *
349 */
350 ret = 1;
351 }
352 /* Not one of ours: let kernel handle it */
353 goto no_kprobe; 347 goto no_kprobe;
354 }
355 348
356 kcb->kprobe_status = KPROBE_HIT_ACTIVE; 349 kcb->kprobe_status = KPROBE_HIT_ACTIVE;
357 set_current_kprobe(p, regs, kcb); 350 set_current_kprobe(p, regs, kcb);
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 52f57af252b4..3c77dd36994c 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -19,6 +19,7 @@
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/smp.h> 20#include <asm/smp.h>
21#include <asm/reset.h> 21#include <asm/reset.h>
22#include <asm/ipl.h>
22 23
23typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long); 24typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long);
24 25
@@ -29,6 +30,10 @@ int machine_kexec_prepare(struct kimage *image)
29{ 30{
30 void *reboot_code_buffer; 31 void *reboot_code_buffer;
31 32
33 /* Can't replace kernel image since it is read-only. */
34 if (ipl_flags & IPL_NSS_VALID)
35 return -ENOSYS;
36
32 /* We don't support anything but the default image type for now. */ 37 /* We don't support anything but the default image type for now. */
33 if (image->type != KEXEC_TYPE_DEFAULT) 38 if (image->type != KEXEC_TYPE_DEFAULT)
34 return -EINVAL; 39 return -EINVAL;
diff --git a/arch/s390/kernel/reipl.S b/arch/s390/kernel/reipl.S
index c3f4d9b95083..2f481cc3d1c9 100644
--- a/arch/s390/kernel/reipl.S
+++ b/arch/s390/kernel/reipl.S
@@ -8,6 +8,10 @@
8 8
9#include <asm/lowcore.h> 9#include <asm/lowcore.h>
10 10
11#
12# do_reipl_asm
13# Parameter: r2 = schid of reipl device
14#
11 .globl do_reipl_asm 15 .globl do_reipl_asm
12do_reipl_asm: basr %r13,0 16do_reipl_asm: basr %r13,0
13.Lpg0: lpsw .Lnewpsw-.Lpg0(%r13) 17.Lpg0: lpsw .Lnewpsw-.Lpg0(%r13)
@@ -16,12 +20,12 @@ do_reipl_asm: basr %r13,0
16 stm %r0,%r15,__LC_GPREGS_SAVE_AREA 20 stm %r0,%r15,__LC_GPREGS_SAVE_AREA
17 stctl %c0,%c15,__LC_CREGS_SAVE_AREA 21 stctl %c0,%c15,__LC_CREGS_SAVE_AREA
18 stam %a0,%a15,__LC_AREGS_SAVE_AREA 22 stam %a0,%a15,__LC_AREGS_SAVE_AREA
19 mvc __LC_PREFIX_SAVE_AREA(4),dump_prefix_page-.Lpg0(%r13) 23 l %r10,.Ldump_pfx-.Lpg0(%r13)
24 mvc __LC_PREFIX_SAVE_AREA(4),0(%r10)
20 stckc .Lclkcmp-.Lpg0(%r13) 25 stckc .Lclkcmp-.Lpg0(%r13)
21 mvc __LC_CLOCK_COMP_SAVE_AREA(8),.Lclkcmp-.Lpg0(%r13) 26 mvc __LC_CLOCK_COMP_SAVE_AREA(8),.Lclkcmp-.Lpg0(%r13)
22 stpt __LC_CPU_TIMER_SAVE_AREA 27 stpt __LC_CPU_TIMER_SAVE_AREA
23 st %r13, __LC_PSW_SAVE_AREA+4 28 st %r13, __LC_PSW_SAVE_AREA+4
24
25 lctl %c6,%c6,.Lall-.Lpg0(%r13) 29 lctl %c6,%c6,.Lall-.Lpg0(%r13)
26 lr %r1,%r2 30 lr %r1,%r2
27 mvc __LC_PGM_NEW_PSW(8),.Lpcnew-.Lpg0(%r13) 31 mvc __LC_PGM_NEW_PSW(8),.Lpcnew-.Lpg0(%r13)
@@ -55,6 +59,7 @@ do_reipl_asm: basr %r13,0
55 .align 8 59 .align 8
56.Lclkcmp: .quad 0x0000000000000000 60.Lclkcmp: .quad 0x0000000000000000
57.Lall: .long 0xff000000 61.Lall: .long 0xff000000
62.Ldump_pfx: .long dump_prefix_page
58 .align 8 63 .align 8
59.Lnewpsw: .long 0x00080000,0x80000000+.Lpg1 64.Lnewpsw: .long 0x00080000,0x80000000+.Lpg1
60.Lpcnew: .long 0x00080000,0x80000000+.Lecs 65.Lpcnew: .long 0x00080000,0x80000000+.Lecs
@@ -79,7 +84,3 @@ do_reipl_asm: basr %r13,0
79 .long 0x00000000,0x00000000 84 .long 0x00000000,0x00000000
80 .long 0x00000000,0x00000000 85 .long 0x00000000,0x00000000
81 .long 0x00000000,0x00000000 86 .long 0x00000000,0x00000000
82 .globl dump_prefix_page
83dump_prefix_page:
84 .long 0x00000000
85
diff --git a/arch/s390/kernel/reipl64.S b/arch/s390/kernel/reipl64.S
index dbb3eed38865..c41930499a5f 100644
--- a/arch/s390/kernel/reipl64.S
+++ b/arch/s390/kernel/reipl64.S
@@ -8,6 +8,12 @@
8 */ 8 */
9 9
10#include <asm/lowcore.h> 10#include <asm/lowcore.h>
11
12#
13# do_reipl_asm
14# Parameter: r2 = schid of reipl device
15#
16
11 .globl do_reipl_asm 17 .globl do_reipl_asm
12do_reipl_asm: basr %r13,0 18do_reipl_asm: basr %r13,0
13.Lpg0: lpswe .Lnewpsw-.Lpg0(%r13) 19.Lpg0: lpswe .Lnewpsw-.Lpg0(%r13)
@@ -20,7 +26,8 @@ do_reipl_asm: basr %r13,0
20 stg %r0,__LC_GPREGS_SAVE_AREA-0x1000+8(%r1) 26 stg %r0,__LC_GPREGS_SAVE_AREA-0x1000+8(%r1)
21 stctg %c0,%c15,__LC_CREGS_SAVE_AREA-0x1000(%r1) 27 stctg %c0,%c15,__LC_CREGS_SAVE_AREA-0x1000(%r1)
22 stam %a0,%a15,__LC_AREGS_SAVE_AREA-0x1000(%r1) 28 stam %a0,%a15,__LC_AREGS_SAVE_AREA-0x1000(%r1)
23 mvc __LC_PREFIX_SAVE_AREA-0x1000(4,%r1),dump_prefix_page-.Lpg0(%r13) 29 lg %r10,.Ldump_pfx-.Lpg0(%r13)
30 mvc __LC_PREFIX_SAVE_AREA-0x1000(4,%r1),0(%r10)
24 stfpc __LC_FP_CREG_SAVE_AREA-0x1000(%r1) 31 stfpc __LC_FP_CREG_SAVE_AREA-0x1000(%r1)
25 stckc .Lclkcmp-.Lpg0(%r13) 32 stckc .Lclkcmp-.Lpg0(%r13)
26 mvc __LC_CLOCK_COMP_SAVE_AREA-0x1000(8,%r1),.Lclkcmp-.Lpg0(%r13) 33 mvc __LC_CLOCK_COMP_SAVE_AREA-0x1000(8,%r1),.Lclkcmp-.Lpg0(%r13)
@@ -64,6 +71,7 @@ do_reipl_asm: basr %r13,0
64 .align 8 71 .align 8
65.Lclkcmp: .quad 0x0000000000000000 72.Lclkcmp: .quad 0x0000000000000000
66.Lall: .quad 0x00000000ff000000 73.Lall: .quad 0x00000000ff000000
74.Ldump_pfx: .quad dump_prefix_page
67.Lregsave: .quad 0x0000000000000000 75.Lregsave: .quad 0x0000000000000000
68 .align 16 76 .align 16
69/* 77/*
@@ -103,6 +111,3 @@ do_reipl_asm: basr %r13,0
103 .long 0x00000000,0x00000000 111 .long 0x00000000,0x00000000
104 .long 0x00000000,0x00000000 112 .long 0x00000000,0x00000000
105 .long 0x00000000,0x00000000 113 .long 0x00000000,0x00000000
106 .globl dump_prefix_page
107dump_prefix_page:
108 .long 0x00000000
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index ecaa432a99f8..97764f710bb7 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -94,10 +94,9 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
94 int cpu, local = 0; 94 int cpu, local = 0;
95 95
96 /* 96 /*
97 * Can deadlock when interrupts are disabled or if in wrong context, 97 * Can deadlock when interrupts are disabled or if in wrong context.
98 * caller must disable preemption
99 */ 98 */
100 WARN_ON(irqs_disabled() || in_irq() || preemptible()); 99 WARN_ON(irqs_disabled() || in_irq());
101 100
102 /* 101 /*
103 * Check for local function call. We have to have the same call order 102 * Check for local function call. We have to have the same call order
@@ -152,17 +151,18 @@ out:
152 * Run a function on all other CPUs. 151 * Run a function on all other CPUs.
153 * 152 *
154 * You must not call this function with disabled interrupts or from a 153 * You must not call this function with disabled interrupts or from a
155 * hardware interrupt handler. Must be called with preemption disabled. 154 * hardware interrupt handler. You may call it from a bottom half.
156 * You may call it from a bottom half.
157 */ 155 */
158int smp_call_function(void (*func) (void *info), void *info, int nonatomic, 156int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
159 int wait) 157 int wait)
160{ 158{
161 cpumask_t map; 159 cpumask_t map;
162 160
161 preempt_disable();
163 map = cpu_online_map; 162 map = cpu_online_map;
164 cpu_clear(smp_processor_id(), map); 163 cpu_clear(smp_processor_id(), map);
165 __smp_call_function_map(func, info, nonatomic, wait, map); 164 __smp_call_function_map(func, info, nonatomic, wait, map);
165 preempt_enable();
166 return 0; 166 return 0;
167} 167}
168EXPORT_SYMBOL(smp_call_function); 168EXPORT_SYMBOL(smp_call_function);
@@ -178,16 +178,17 @@ EXPORT_SYMBOL(smp_call_function);
178 * Run a function on one processor. 178 * Run a function on one processor.
179 * 179 *
180 * You must not call this function with disabled interrupts or from a 180 * You must not call this function with disabled interrupts or from a
181 * hardware interrupt handler. Must be called with preemption disabled. 181 * hardware interrupt handler. You may call it from a bottom half.
182 * You may call it from a bottom half.
183 */ 182 */
184int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic, 183int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic,
185 int wait, int cpu) 184 int wait, int cpu)
186{ 185{
187 cpumask_t map = CPU_MASK_NONE; 186 cpumask_t map = CPU_MASK_NONE;
188 187
188 preempt_disable();
189 cpu_set(cpu, map); 189 cpu_set(cpu, map);
190 __smp_call_function_map(func, info, nonatomic, wait, map); 190 __smp_call_function_map(func, info, nonatomic, wait, map);
191 preempt_enable();
191 return 0; 192 return 0;
192} 193}
193EXPORT_SYMBOL(smp_call_function_on); 194EXPORT_SYMBOL(smp_call_function_on);
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 641aef36ccc4..7462aebd3eb6 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -108,53 +108,40 @@ void bust_spinlocks(int yes)
108} 108}
109 109
110/* 110/*
111 * Check which address space is addressed by the access 111 * Returns the address space associated with the fault.
112 * register in S390_lowcore.exc_access_id. 112 * Returns 0 for kernel space, 1 for user space and
113 * Returns 1 for user space and 0 for kernel space. 113 * 2 for code execution in user space with noexec=on.
114 */ 114 */
115static int __check_access_register(struct pt_regs *regs, int error_code) 115static inline int check_space(struct task_struct *tsk)
116{
117 int areg = S390_lowcore.exc_access_id;
118
119 if (areg == 0)
120 /* Access via access register 0 -> kernel address */
121 return 0;
122 save_access_regs(current->thread.acrs);
123 if (regs && areg < NUM_ACRS && current->thread.acrs[areg] <= 1)
124 /*
125 * access register contains 0 -> kernel address,
126 * access register contains 1 -> user space address
127 */
128 return current->thread.acrs[areg];
129
130 /* Something unhealthy was done with the access registers... */
131 die("page fault via unknown access register", regs, error_code);
132 do_exit(SIGKILL);
133 return 0;
134}
135
136/*
137 * Check which address space the address belongs to.
138 * May return 1 or 2 for user space and 0 for kernel space.
139 * Returns 2 for user space in primary addressing mode with
140 * CONFIG_S390_EXEC_PROTECT on and kernel parameter noexec=on.
141 */
142static inline int check_user_space(struct pt_regs *regs, int error_code)
143{ 116{
144 /* 117 /*
145 * The lowest two bits of S390_lowcore.trans_exc_code indicate 118 * The lowest two bits of S390_lowcore.trans_exc_code
146 * which paging table was used: 119 * indicate which paging table was used.
147 * 0: Primary Segment Table Descriptor
148 * 1: STD determined via access register
149 * 2: Secondary Segment Table Descriptor
150 * 3: Home Segment Table Descriptor
151 */ 120 */
152 int descriptor = S390_lowcore.trans_exc_code & 3; 121 int desc = S390_lowcore.trans_exc_code & 3;
153 if (unlikely(descriptor == 1)) 122
154 return __check_access_register(regs, error_code); 123 if (desc == 3) /* Home Segment Table Descriptor */
155 if (descriptor == 2) 124 return switch_amode == 0;
156 return current->thread.mm_segment.ar4; 125 if (desc == 2) /* Secondary Segment Table Descriptor */
157 return ((descriptor != 0) ^ (switch_amode)) << s390_noexec; 126 return tsk->thread.mm_segment.ar4;
127#ifdef CONFIG_S390_SWITCH_AMODE
128 if (unlikely(desc == 1)) { /* STD determined via access register */
129 /* %a0 always indicates primary space. */
130 if (S390_lowcore.exc_access_id != 0) {
131 save_access_regs(tsk->thread.acrs);
132 /*
133 * An alet of 0 indicates primary space.
134 * An alet of 1 indicates secondary space.
135 * Any other alet values generate an
136 * alen-translation exception.
137 */
138 if (tsk->thread.acrs[S390_lowcore.exc_access_id])
139 return tsk->thread.mm_segment.ar4;
140 }
141 }
142#endif
143 /* Primary Segment Table Descriptor */
144 return switch_amode << s390_noexec;
158} 145}
159 146
160/* 147/*
@@ -265,16 +252,16 @@ out_fault:
265 * 11 Page translation -> Not present (nullification) 252 * 11 Page translation -> Not present (nullification)
266 * 3b Region third trans. -> Not present (nullification) 253 * 3b Region third trans. -> Not present (nullification)
267 */ 254 */
268static inline void __kprobes 255static inline void
269do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection) 256do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
270{ 257{
271 struct task_struct *tsk; 258 struct task_struct *tsk;
272 struct mm_struct *mm; 259 struct mm_struct *mm;
273 struct vm_area_struct * vma; 260 struct vm_area_struct * vma;
274 unsigned long address; 261 unsigned long address;
275 int user_address;
276 const struct exception_table_entry *fixup; 262 const struct exception_table_entry *fixup;
277 int si_code = SEGV_MAPERR; 263 int si_code;
264 int space;
278 265
279 tsk = current; 266 tsk = current;
280 mm = tsk->mm; 267 mm = tsk->mm;
@@ -294,7 +281,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
294 NULL pointer write access in kernel mode. */ 281 NULL pointer write access in kernel mode. */
295 if (!(regs->psw.mask & PSW_MASK_PSTATE)) { 282 if (!(regs->psw.mask & PSW_MASK_PSTATE)) {
296 address = 0; 283 address = 0;
297 user_address = 0; 284 space = 0;
298 goto no_context; 285 goto no_context;
299 } 286 }
300 287
@@ -309,15 +296,15 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
309 * the address 296 * the address
310 */ 297 */
311 address = S390_lowcore.trans_exc_code & __FAIL_ADDR_MASK; 298 address = S390_lowcore.trans_exc_code & __FAIL_ADDR_MASK;
312 user_address = check_user_space(regs, error_code); 299 space = check_space(tsk);
313 300
314 /* 301 /*
315 * Verify that the fault happened in user space, that 302 * Verify that the fault happened in user space, that
316 * we are not in an interrupt and that there is a 303 * we are not in an interrupt and that there is a
317 * user context. 304 * user context.
318 */ 305 */
319 if (user_address == 0 || in_atomic() || !mm) 306 if (unlikely(space == 0 || in_atomic() || !mm))
320 goto no_context; 307 goto no_context;
321 308
322 /* 309 /*
323 * When we get here, the fault happened in the current 310 * When we get here, the fault happened in the current
@@ -328,12 +315,13 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
328 315
329 down_read(&mm->mmap_sem); 316 down_read(&mm->mmap_sem);
330 317
331 vma = find_vma(mm, address); 318 si_code = SEGV_MAPERR;
332 if (!vma) 319 vma = find_vma(mm, address);
333 goto bad_area; 320 if (!vma)
321 goto bad_area;
334 322
335#ifdef CONFIG_S390_EXEC_PROTECT 323#ifdef CONFIG_S390_EXEC_PROTECT
336 if (unlikely((user_address == 2) && !(vma->vm_flags & VM_EXEC))) 324 if (unlikely((space == 2) && !(vma->vm_flags & VM_EXEC)))
337 if (!signal_return(mm, regs, address, error_code)) 325 if (!signal_return(mm, regs, address, error_code))
338 /* 326 /*
339 * signal_return() has done an up_read(&mm->mmap_sem) 327 * signal_return() has done an up_read(&mm->mmap_sem)
@@ -389,7 +377,7 @@ survive:
389 * The instruction that caused the program check will 377 * The instruction that caused the program check will
390 * be repeated. Don't signal single step via SIGTRAP. 378 * be repeated. Don't signal single step via SIGTRAP.
391 */ 379 */
392 clear_tsk_thread_flag(current, TIF_SINGLE_STEP); 380 clear_tsk_thread_flag(tsk, TIF_SINGLE_STEP);
393 return; 381 return;
394 382
395/* 383/*
@@ -419,7 +407,7 @@ no_context:
419 * Oops. The kernel tried to access some bad page. We'll have to 407 * Oops. The kernel tried to access some bad page. We'll have to
420 * terminate things with extreme prejudice. 408 * terminate things with extreme prejudice.
421 */ 409 */
422 if (user_address == 0) 410 if (space == 0)
423 printk(KERN_ALERT "Unable to handle kernel pointer dereference" 411 printk(KERN_ALERT "Unable to handle kernel pointer dereference"
424 " at virtual kernel address %p\n", (void *)address); 412 " at virtual kernel address %p\n", (void *)address);
425 else 413 else
@@ -462,13 +450,14 @@ do_sigbus:
462 goto no_context; 450 goto no_context;
463} 451}
464 452
465void do_protection_exception(struct pt_regs *regs, unsigned long error_code) 453void __kprobes do_protection_exception(struct pt_regs *regs,
454 unsigned long error_code)
466{ 455{
467 regs->psw.addr -= (error_code >> 16); 456 regs->psw.addr -= (error_code >> 16);
468 do_exception(regs, 4, 1); 457 do_exception(regs, 4, 1);
469} 458}
470 459
471void do_dat_exception(struct pt_regs *regs, unsigned long error_code) 460void __kprobes do_dat_exception(struct pt_regs *regs, unsigned long error_code)
472{ 461{
473 do_exception(regs, error_code & 0xff, 0); 462 do_exception(regs, error_code & 0xff, 0);
474} 463}
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile
index 3c93012e91a3..ed5f5a9a3b3e 100644
--- a/arch/sh/boards/renesas/r7780rp/Makefile
+++ b/arch/sh/boards/renesas/r7780rp/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the R7780RP-1 specific parts of the kernel 2# Makefile for the R7780RP-1 specific parts of the kernel
3# 3#
4 4
5obj-y := setup.o io.o irq.o 5obj-y := setup.o irq.o
6 6
7obj-$(CONFIG_PUSH_SWITCH) += psw.o 7obj-$(CONFIG_PUSH_SWITCH) += psw.o
diff --git a/arch/sh/boards/renesas/r7780rp/io.c b/arch/sh/boards/renesas/r7780rp/io.c
deleted file mode 100644
index f74d2ffb3851..000000000000
--- a/arch/sh/boards/renesas/r7780rp/io.c
+++ /dev/null
@@ -1,233 +0,0 @@
1/*
2 * Copyright (C) 2001 Ian da Silva, Jeremy Siegel
3 * Based largely on io_se.c.
4 *
5 * I/O routine for Renesas Solutions Highlander R7780RP-1
6 *
7 * Initial version only to support LAN access; some
8 * placeholder code from io_r7780rp.c left in with the
9 * expectation of later SuperIO and PCMCIA access.
10 */
11#include <linux/pci.h>
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/io.h>
15#include <asm/r7780rp.h>
16#include <asm/addrspace.h>
17
18static inline unsigned long port88796l(unsigned int port, int flag)
19{
20 unsigned long addr;
21
22 if (flag)
23 addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1);
24 else
25 addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1) + 0x1000;
26
27 return addr;
28}
29
30#if defined(CONFIG_NE2000) || defined(CONFIG_NE2000_MODULE)
31#define CHECK_AX88796L_PORT(port) \
32 ((port >= AX88796L_IO_BASE) && (port < (AX88796L_IO_BASE+0x20)))
33#else
34#define CHECK_AX88796L_PORT(port) (0)
35#endif
36
37/*
38 * General outline: remap really low stuff [eventually] to SuperIO,
39 * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
40 * is mapped through the PCI IO window. Stuff with high bits (PXSEG)
41 * should be way beyond the window, and is used w/o translation for
42 * compatibility.
43 */
44u8 r7780rp_inb(unsigned long port)
45{
46 if (CHECK_AX88796L_PORT(port))
47 return ctrl_inw(port88796l(port, 0)) & 0xff;
48 else if (is_pci_ioaddr(port))
49 return ctrl_inb(pci_ioaddr(port));
50
51 return ctrl_inw(port) & 0xff;
52}
53
54u8 r7780rp_inb_p(unsigned long port)
55{
56 u8 v;
57
58 if (CHECK_AX88796L_PORT(port))
59 v = ctrl_inw(port88796l(port, 0)) & 0xff;
60 else if (is_pci_ioaddr(port))
61 v = ctrl_inb(pci_ioaddr(port));
62 else
63 v = ctrl_inw(port) & 0xff;
64
65 ctrl_delay();
66
67 return v;
68}
69
70u16 r7780rp_inw(unsigned long port)
71{
72 if (is_pci_ioaddr(port))
73 return ctrl_inw(pci_ioaddr(port));
74
75 return ctrl_inw(port);
76}
77
78u32 r7780rp_inl(unsigned long port)
79{
80 if (is_pci_ioaddr(port))
81 return ctrl_inl(pci_ioaddr(port));
82
83 return ctrl_inl(port);
84}
85
86void r7780rp_outb(u8 value, unsigned long port)
87{
88 if (CHECK_AX88796L_PORT(port))
89 ctrl_outw(value, port88796l(port, 0));
90 else if (is_pci_ioaddr(port))
91 ctrl_outb(value, pci_ioaddr(port));
92 else
93 ctrl_outb(value, port);
94}
95
96void r7780rp_outb_p(u8 value, unsigned long port)
97{
98 if (CHECK_AX88796L_PORT(port))
99 ctrl_outw(value, port88796l(port, 0));
100 else if (is_pci_ioaddr(port))
101 ctrl_outb(value, pci_ioaddr(port));
102 else
103 ctrl_outb(value, port);
104
105 ctrl_delay();
106}
107
108void r7780rp_outw(u16 value, unsigned long port)
109{
110 if (is_pci_ioaddr(port))
111 ctrl_outw(value, pci_ioaddr(port));
112 else
113 ctrl_outw(value, port);
114}
115
116void r7780rp_outl(u32 value, unsigned long port)
117{
118 if (is_pci_ioaddr(port))
119 ctrl_outl(value, pci_ioaddr(port));
120 else
121 ctrl_outl(value, port);
122}
123
124void r7780rp_insb(unsigned long port, void *dst, unsigned long count)
125{
126 volatile u16 *p;
127 u8 *buf = dst;
128
129 if (CHECK_AX88796L_PORT(port)) {
130 p = (volatile u16 *)port88796l(port, 0);
131 while (count--)
132 *buf++ = *p & 0xff;
133 } else if (is_pci_ioaddr(port)) {
134 volatile u8 *bp = (volatile u8 *)pci_ioaddr(port);
135
136 while (count--)
137 *buf++ = *bp;
138 } else {
139 p = (volatile u16 *)port;
140 while (count--)
141 *buf++ = *p & 0xff;
142 }
143}
144
145void r7780rp_insw(unsigned long port, void *dst, unsigned long count)
146{
147 volatile u16 *p;
148 u16 *buf = dst;
149
150 if (CHECK_AX88796L_PORT(port))
151 p = (volatile u16 *)port88796l(port, 1);
152 else if (is_pci_ioaddr(port))
153 p = (volatile u16 *)pci_ioaddr(port);
154 else
155 p = (volatile u16 *)port;
156
157 while (count--)
158 *buf++ = *p;
159
160 flush_dcache_all();
161}
162
163void r7780rp_insl(unsigned long port, void *dst, unsigned long count)
164{
165 if (is_pci_ioaddr(port)) {
166 volatile u32 *p = (volatile u32 *)pci_ioaddr(port);
167 u32 *buf = dst;
168
169 while (count--)
170 *buf++ = *p;
171 }
172}
173
174void r7780rp_outsb(unsigned long port, const void *src, unsigned long count)
175{
176 volatile u16 *p;
177 const u8 *buf = src;
178
179 if (CHECK_AX88796L_PORT(port)) {
180 p = (volatile u16 *)port88796l(port, 0);
181 while (count--)
182 *p = *buf++;
183 } else if (is_pci_ioaddr(port)) {
184 volatile u8 *bp = (volatile u8 *)pci_ioaddr(port);
185
186 while (count--)
187 *bp = *buf++;
188 } else
189 while (count--)
190 ctrl_outb(*buf++, port);
191}
192
193void r7780rp_outsw(unsigned long port, const void *src, unsigned long count)
194{
195 volatile u16 *p;
196 const u16 *buf = src;
197
198 if (CHECK_AX88796L_PORT(port))
199 p = (volatile u16 *)port88796l(port, 1);
200 else if (is_pci_ioaddr(port))
201 p = (volatile u16 *)pci_ioaddr(port);
202 else
203 p = (volatile u16 *)port;
204
205 while (count--)
206 *p = *buf++;
207
208 flush_dcache_all();
209}
210
211void r7780rp_outsl(unsigned long port, const void *src, unsigned long count)
212{
213 const u32 *buf = src;
214 u32 *p;
215
216 if (is_pci_ioaddr(port))
217 p = (u32 *)pci_ioaddr(port);
218 else
219 p = (u32 *)port;
220
221 while (count--)
222 ctrl_outl(*buf++, (unsigned long)p);
223}
224
225void __iomem *r7780rp_ioport_map(unsigned long port, unsigned int size)
226{
227 if (CHECK_AX88796L_PORT(port))
228 return (void __iomem *)port88796l(port, size > 1);
229 else if (is_pci_ioaddr(port))
230 return (void __iomem *)pci_ioaddr(port);
231
232 return (void __iomem *)port;
233}
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
index 0d74db9f1792..2faba6679e64 100644
--- a/arch/sh/boards/renesas/r7780rp/setup.c
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -187,31 +187,7 @@ static void __init r7780rp_setup(char **cmdline_p)
187struct sh_machine_vector mv_r7780rp __initmv = { 187struct sh_machine_vector mv_r7780rp __initmv = {
188 .mv_name = "Highlander R7780RP-1", 188 .mv_name = "Highlander R7780RP-1",
189 .mv_setup = r7780rp_setup, 189 .mv_setup = r7780rp_setup,
190
191 .mv_nr_irqs = 109, 190 .mv_nr_irqs = 109,
192
193 .mv_inb = r7780rp_inb,
194 .mv_inw = r7780rp_inw,
195 .mv_inl = r7780rp_inl,
196 .mv_outb = r7780rp_outb,
197 .mv_outw = r7780rp_outw,
198 .mv_outl = r7780rp_outl,
199
200 .mv_inb_p = r7780rp_inb_p,
201 .mv_inw_p = r7780rp_inw,
202 .mv_inl_p = r7780rp_inl,
203 .mv_outb_p = r7780rp_outb_p,
204 .mv_outw_p = r7780rp_outw,
205 .mv_outl_p = r7780rp_outl,
206
207 .mv_insb = r7780rp_insb,
208 .mv_insw = r7780rp_insw,
209 .mv_insl = r7780rp_insl,
210 .mv_outsb = r7780rp_outsb,
211 .mv_outsw = r7780rp_outsw,
212 .mv_outsl = r7780rp_outsl,
213
214 .mv_ioport_map = r7780rp_ioport_map,
215 .mv_init_irq = init_r7780rp_IRQ, 191 .mv_init_irq = init_r7780rp_IRQ,
216}; 192};
217ALIAS_MV(r7780rp) 193ALIAS_MV(r7780rp)
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c
index 44b42082a0af..593f26a85e9c 100644
--- a/arch/sh/boards/renesas/rts7751r2d/setup.c
+++ b/arch/sh/boards/renesas/rts7751r2d/setup.c
@@ -12,6 +12,7 @@
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/pata_platform.h> 13#include <linux/pata_platform.h>
14#include <linux/serial_8250.h> 14#include <linux/serial_8250.h>
15#include <linux/sm501.h>
15#include <linux/pm.h> 16#include <linux/pm.h>
16#include <asm/machvec.h> 17#include <asm/machvec.h>
17#include <asm/rts7751r2d.h> 18#include <asm/rts7751r2d.h>
@@ -111,10 +112,35 @@ static struct platform_device heartbeat_device = {
111 .resource = heartbeat_resources, 112 .resource = heartbeat_resources,
112}; 113};
113 114
115static struct resource sm501_resources[] = {
116 [0] = {
117 .start = 0x10000000,
118 .end = 0x13e00000 - 1,
119 .flags = IORESOURCE_MEM,
120 },
121 [1] = {
122 .start = 0x13e00000,
123 .end = 0x13ffffff,
124 .flags = IORESOURCE_MEM,
125 },
126 [2] = {
127 .start = 32,
128 .flags = IORESOURCE_IRQ,
129 },
130};
131
132static struct platform_device sm501_device = {
133 .name = "sm501",
134 .id = -1,
135 .num_resources = ARRAY_SIZE(sm501_resources),
136 .resource = sm501_resources,
137};
138
114static struct platform_device *rts7751r2d_devices[] __initdata = { 139static struct platform_device *rts7751r2d_devices[] __initdata = {
115 &uart_device, 140 &uart_device,
116 &heartbeat_device, 141 &heartbeat_device,
117 &cf_ide_device, 142 &cf_ide_device,
143 &sm501_device,
118}; 144};
119 145
120static int __init rts7751r2d_devices_setup(void) 146static int __init rts7751r2d_devices_setup(void)
diff --git a/arch/sh/configs/rts7751r2d_defconfig b/arch/sh/configs/rts7751r2d_defconfig
index db6a02df5af6..a59bb78bd071 100644
--- a/arch/sh/configs/rts7751r2d_defconfig
+++ b/arch/sh/configs/rts7751r2d_defconfig
@@ -1,14 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.21-rc1
4# Thu Feb 15 17:17:29 2007 4# Thu Mar 1 16:42:40 2007
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_RWSEM_GENERIC_SPINLOCK=y 7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8CONFIG_GENERIC_FIND_NEXT_BIT=y 8CONFIG_GENERIC_FIND_NEXT_BIT=y
9CONFIG_GENERIC_HWEIGHT=y 9CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
12CONFIG_GENERIC_IRQ_PROBE=y 11CONFIG_GENERIC_IRQ_PROBE=y
13CONFIG_GENERIC_CALIBRATE_DELAY=y 12CONFIG_GENERIC_CALIBRATE_DELAY=y
14# CONFIG_GENERIC_TIME is not set 13# CONFIG_GENERIC_TIME is not set
@@ -33,6 +32,7 @@ CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y 32CONFIG_SWAP=y
34CONFIG_SYSVIPC=y 33CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set 34# CONFIG_IPC_NS is not set
35CONFIG_SYSVIPC_SYSCTL=y
36# CONFIG_POSIX_MQUEUE is not set 36# CONFIG_POSIX_MQUEUE is not set
37# CONFIG_BSD_PROCESS_ACCT is not set 37# CONFIG_BSD_PROCESS_ACCT is not set
38# CONFIG_TASKSTATS is not set 38# CONFIG_TASKSTATS is not set
@@ -119,7 +119,6 @@ CONFIG_SH_RTS7751R2D=y
119# CONFIG_SH_SHMIN is not set 119# CONFIG_SH_SHMIN is not set
120# CONFIG_SH_7206_SOLUTION_ENGINE is not set 120# CONFIG_SH_7206_SOLUTION_ENGINE is not set
121# CONFIG_SH_7619_SOLUTION_ENGINE is not set 121# CONFIG_SH_7619_SOLUTION_ENGINE is not set
122# CONFIG_SH_ASDAP310 is not set
123# CONFIG_SH_UNKNOWN is not set 122# CONFIG_SH_UNKNOWN is not set
124 123
125# 124#
@@ -281,7 +280,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00010000
281CONFIG_BOOT_LINK_OFFSET=0x00800000 280CONFIG_BOOT_LINK_OFFSET=0x00800000
282# CONFIG_UBC_WAKEUP is not set 281# CONFIG_UBC_WAKEUP is not set
283CONFIG_CMDLINE_BOOL=y 282CONFIG_CMDLINE_BOOL=y
284CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1" 283CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1"
285 284
286# 285#
287# Bus options 286# Bus options
@@ -433,6 +432,7 @@ CONFIG_FW_LOADER=m
433# 432#
434# Plug and Play support 433# Plug and Play support
435# 434#
435# CONFIG_PNPACPI is not set
436 436
437# 437#
438# Block devices 438# Block devices
@@ -770,7 +770,26 @@ CONFIG_NET_WIRELESS=y
770# 770#
771# Input device support 771# Input device support
772# 772#
773# CONFIG_INPUT is not set 773CONFIG_INPUT=y
774# CONFIG_INPUT_FF_MEMLESS is not set
775
776#
777# Userland interfaces
778#
779# CONFIG_INPUT_MOUSEDEV is not set
780# CONFIG_INPUT_JOYDEV is not set
781# CONFIG_INPUT_TSDEV is not set
782# CONFIG_INPUT_EVDEV is not set
783# CONFIG_INPUT_EVBUG is not set
784
785#
786# Input Device Drivers
787#
788# CONFIG_INPUT_KEYBOARD is not set
789# CONFIG_INPUT_MOUSE is not set
790# CONFIG_INPUT_JOYSTICK is not set
791# CONFIG_INPUT_TOUCHSCREEN is not set
792# CONFIG_INPUT_MISC is not set
774 793
775# 794#
776# Hardware I/O ports 795# Hardware I/O ports
@@ -781,7 +800,10 @@ CONFIG_NET_WIRELESS=y
781# 800#
782# Character devices 801# Character devices
783# 802#
784# CONFIG_VT is not set 803CONFIG_VT=y
804CONFIG_VT_CONSOLE=y
805CONFIG_HW_CONSOLE=y
806CONFIG_VT_HW_CONSOLE_BINDING=y
785# CONFIG_SERIAL_NONSTANDARD is not set 807# CONFIG_SERIAL_NONSTANDARD is not set
786 808
787# 809#
@@ -857,6 +879,11 @@ CONFIG_HWMON=y
857# CONFIG_HWMON_DEBUG_CHIP is not set 879# CONFIG_HWMON_DEBUG_CHIP is not set
858 880
859# 881#
882# Multifunction device drivers
883#
884CONFIG_MFD_SM501=y
885
886#
860# Multimedia devices 887# Multimedia devices
861# 888#
862# CONFIG_VIDEO_DEV is not set 889# CONFIG_VIDEO_DEV is not set
@@ -869,9 +896,66 @@ CONFIG_HWMON=y
869# 896#
870# Graphics support 897# Graphics support
871# 898#
872CONFIG_FIRMWARE_EDID=y
873# CONFIG_FB is not set
874# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 899# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
900CONFIG_FB=y
901# CONFIG_FIRMWARE_EDID is not set
902# CONFIG_FB_DDC is not set
903CONFIG_FB_CFB_FILLRECT=y
904CONFIG_FB_CFB_COPYAREA=y
905CONFIG_FB_CFB_IMAGEBLIT=y
906# CONFIG_FB_SVGALIB is not set
907# CONFIG_FB_MACMODES is not set
908# CONFIG_FB_BACKLIGHT is not set
909# CONFIG_FB_MODE_HELPERS is not set
910# CONFIG_FB_TILEBLITTING is not set
911
912#
913# Frambuffer hardware drivers
914#
915# CONFIG_FB_CIRRUS is not set
916# CONFIG_FB_PM2 is not set
917# CONFIG_FB_CYBER2000 is not set
918# CONFIG_FB_ASILIANT is not set
919# CONFIG_FB_IMSTT is not set
920# CONFIG_FB_EPSON1355 is not set
921# CONFIG_FB_S1D13XXX is not set
922# CONFIG_FB_NVIDIA is not set
923# CONFIG_FB_RIVA is not set
924# CONFIG_FB_MATROX is not set
925# CONFIG_FB_RADEON is not set
926# CONFIG_FB_ATY128 is not set
927# CONFIG_FB_ATY is not set
928# CONFIG_FB_S3 is not set
929# CONFIG_FB_SAVAGE is not set
930# CONFIG_FB_SIS is not set
931# CONFIG_FB_NEOMAGIC is not set
932# CONFIG_FB_KYRO is not set
933# CONFIG_FB_3DFX is not set
934# CONFIG_FB_VOODOO1 is not set
935# CONFIG_FB_TRIDENT is not set
936CONFIG_FB_SM501=y
937# CONFIG_FB_VIRTUAL is not set
938
939#
940# Console display driver support
941#
942CONFIG_DUMMY_CONSOLE=y
943CONFIG_FRAMEBUFFER_CONSOLE=y
944# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
945# CONFIG_FONTS is not set
946CONFIG_FONT_8x8=y
947CONFIG_FONT_8x16=y
948
949#
950# Logo configuration
951#
952CONFIG_LOGO=y
953# CONFIG_LOGO_LINUX_MONO is not set
954# CONFIG_LOGO_LINUX_VGA16 is not set
955# CONFIG_LOGO_LINUX_CLUT224 is not set
956# CONFIG_LOGO_SUPERH_MONO is not set
957# CONFIG_LOGO_SUPERH_VGA16 is not set
958CONFIG_LOGO_SUPERH_CLUT224=y
875 959
876# 960#
877# Sound 961# Sound
@@ -985,6 +1069,12 @@ CONFIG_SOUND_PRIME=m
985CONFIG_AC97_BUS=m 1069CONFIG_AC97_BUS=m
986 1070
987# 1071#
1072# HID Devices
1073#
1074CONFIG_HID=y
1075# CONFIG_HID_DEBUG is not set
1076
1077#
988# USB support 1078# USB support
989# 1079#
990CONFIG_USB_ARCH_HAS_HCD=y 1080CONFIG_USB_ARCH_HAS_HCD=y
@@ -1237,7 +1327,7 @@ CONFIG_LOG_BUF_SHIFT=14
1237CONFIG_EARLY_SCIF_CONSOLE=y 1327CONFIG_EARLY_SCIF_CONSOLE=y
1238CONFIG_EARLY_SCIF_CONSOLE_PORT=0xffe80000 1328CONFIG_EARLY_SCIF_CONSOLE_PORT=0xffe80000
1239CONFIG_EARLY_PRINTK=y 1329CONFIG_EARLY_PRINTK=y
1240# CONFIG_KGDB is not set 1330# CONFIG_SH_KGDB is not set
1241 1331
1242# 1332#
1243# Security options 1333# Security options
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index ab4ebb856c2a..b46728027195 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -224,7 +224,7 @@ work_resched:
224syscall_exit_work: 224syscall_exit_work:
225 ! r0: current_thread_info->flags 225 ! r0: current_thread_info->flags
226 ! r8: current_thread_info 226 ! r8: current_thread_info
227 tst #_TIF_SYSCALL_TRACE, r0 227 tst #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP, r0
228 bt/s work_pending 228 bt/s work_pending
229 tst #_TIF_NEED_RESCHED, r0 229 tst #_TIF_NEED_RESCHED, r0
230#ifdef CONFIG_TRACE_IRQFLAGS 230#ifdef CONFIG_TRACE_IRQFLAGS
diff --git a/arch/sh/kernel/io_generic.c b/arch/sh/kernel/io_generic.c
index 66626c03e1ee..771ea4230441 100644
--- a/arch/sh/kernel/io_generic.c
+++ b/arch/sh/kernel/io_generic.c
@@ -14,7 +14,6 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <asm/machvec.h> 16#include <asm/machvec.h>
17#include <asm/cacheflush.h>
18 17
19#ifdef CONFIG_CPU_SH3 18#ifdef CONFIG_CPU_SH3
20/* SH3 has a PCMCIA bug that needs a dummy read from area 6 for a 19/* SH3 has a PCMCIA bug that needs a dummy read from area 6 for a
@@ -96,7 +95,6 @@ void generic_insw(unsigned long port, void *dst, unsigned long count)
96 while (count--) 95 while (count--)
97 *buf++ = *port_addr; 96 *buf++ = *port_addr;
98 97
99 flush_dcache_all();
100 dummy_read(); 98 dummy_read();
101} 99}
102 100
@@ -171,7 +169,6 @@ void generic_outsw(unsigned long port, const void *src, unsigned long count)
171 while (count--) 169 while (count--)
172 *port_addr = *buf++; 170 *port_addr = *buf++;
173 171
174 flush_dcache_all();
175 dummy_read(); 172 dummy_read();
176} 173}
177 174
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 9d6a438b3eaf..e7607366ac4e 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -250,12 +250,11 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
250 childregs->regs[15] = usp; 250 childregs->regs[15] = usp;
251 ti->addr_limit = USER_DS; 251 ti->addr_limit = USER_DS;
252 } else { 252 } else {
253 childregs->regs[15] = (unsigned long)task_stack_page(p) + 253 childregs->regs[15] = (unsigned long)childregs;
254 THREAD_SIZE;
255 ti->addr_limit = KERNEL_DS; 254 ti->addr_limit = KERNEL_DS;
256 } 255 }
257 256
258 if (clone_flags & CLONE_SETTLS) 257 if (clone_flags & CLONE_SETTLS)
259 childregs->gbr = childregs->regs[0]; 258 childregs->gbr = childregs->regs[0];
260 259
261 childregs->regs[0] = 0; /* Set return value for child */ 260 childregs->regs[0] = 0; /* Set return value for child */
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c
index 04ca13a041c1..855f7246cfff 100644
--- a/arch/sh/kernel/ptrace.c
+++ b/arch/sh/kernel/ptrace.c
@@ -8,7 +8,6 @@
8 * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka 8 * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka
9 * 9 *
10 */ 10 */
11
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/sched.h> 12#include <linux/sched.h>
14#include <linux/mm.h> 13#include <linux/mm.h>
@@ -20,8 +19,7 @@
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include <linux/security.h> 20#include <linux/security.h>
22#include <linux/signal.h> 21#include <linux/signal.h>
23 22#include <linux/io.h>
24#include <asm/io.h>
25#include <asm/uaccess.h> 23#include <asm/uaccess.h>
26#include <asm/pgtable.h> 24#include <asm/pgtable.h>
27#include <asm/system.h> 25#include <asm/system.h>
@@ -59,6 +57,23 @@ static inline int put_stack_long(struct task_struct *task, int offset,
59 return 0; 57 return 0;
60} 58}
61 59
60static void ptrace_disable_singlestep(struct task_struct *child)
61{
62 clear_tsk_thread_flag(child, TIF_SINGLESTEP);
63
64 /*
65 * Ensure the UBC is not programmed at the next context switch.
66 *
67 * Normally this is not needed but there are sequences such as
68 * singlestep, signal delivery, and continue that leave the
69 * ubc_pc non-zero leading to spurious SIGTRAPs.
70 */
71 if (child->thread.ubc_pc != 0) {
72 ubc_usercnt -= 1;
73 child->thread.ubc_pc = 0;
74 }
75}
76
62/* 77/*
63 * Called by kernel/ptrace.c when detaching.. 78 * Called by kernel/ptrace.c when detaching..
64 * 79 *
@@ -66,7 +81,7 @@ static inline int put_stack_long(struct task_struct *task, int offset,
66 */ 81 */
67void ptrace_disable(struct task_struct *child) 82void ptrace_disable(struct task_struct *child)
68{ 83{
69 /* nothing to do.. */ 84 ptrace_disable_singlestep(child);
70} 85}
71 86
72long arch_ptrace(struct task_struct *child, long request, long addr, long data) 87long arch_ptrace(struct task_struct *child, long request, long addr, long data)
@@ -76,7 +91,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
76 91
77 switch (request) { 92 switch (request) {
78 /* when I and D space are separate, these will need to be fixed. */ 93 /* when I and D space are separate, these will need to be fixed. */
79 case PTRACE_PEEKTEXT: /* read word at location addr. */ 94 case PTRACE_PEEKTEXT: /* read word at location addr. */
80 case PTRACE_PEEKDATA: { 95 case PTRACE_PEEKDATA: {
81 unsigned long tmp; 96 unsigned long tmp;
82 int copied; 97 int copied;
@@ -94,7 +109,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
94 unsigned long tmp; 109 unsigned long tmp;
95 110
96 ret = -EIO; 111 ret = -EIO;
97 if ((addr & 3) || addr < 0 || 112 if ((addr & 3) || addr < 0 ||
98 addr > sizeof(struct user) - 3) 113 addr > sizeof(struct user) - 3)
99 break; 114 break;
100 115
@@ -129,7 +144,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
129 144
130 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 145 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
131 ret = -EIO; 146 ret = -EIO;
132 if ((addr & 3) || addr < 0 || 147 if ((addr & 3) || addr < 0 ||
133 addr > sizeof(struct user) - 3) 148 addr > sizeof(struct user) - 3)
134 break; 149 break;
135 150
@@ -156,6 +171,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
156 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 171 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
157 else 172 else
158 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 173 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
174
175 ptrace_disable_singlestep(child);
176
159 child->exit_code = data; 177 child->exit_code = data;
160 wake_up_process(child); 178 wake_up_process(child);
161 ret = 0; 179 ret = 0;
@@ -163,14 +181,15 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
163 } 181 }
164 182
165/* 183/*
166 * make the child exit. Best I can do is send it a sigkill. 184 * make the child exit. Best I can do is send it a sigkill.
167 * perhaps it should be put in the status that it wants to 185 * perhaps it should be put in the status that it wants to
168 * exit. 186 * exit.
169 */ 187 */
170 case PTRACE_KILL: { 188 case PTRACE_KILL: {
171 ret = 0; 189 ret = 0;
172 if (child->exit_state == EXIT_ZOMBIE) /* already dead */ 190 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
173 break; 191 break;
192 ptrace_disable_singlestep(child);
174 child->exit_code = SIGKILL; 193 child->exit_code = SIGKILL;
175 wake_up_process(child); 194 wake_up_process(child);
176 break; 195 break;
@@ -196,6 +215,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
196 ubc_usercnt += 1; 215 ubc_usercnt += 1;
197 child->thread.ubc_pc = pc; 216 child->thread.ubc_pc = pc;
198 217
218 set_tsk_thread_flag(child, TIF_SINGLESTEP);
199 child->exit_code = data; 219 child->exit_code = data;
200 /* give it a chance to run. */ 220 /* give it a chance to run. */
201 wake_up_process(child); 221 wake_up_process(child);
@@ -248,14 +268,15 @@ asmlinkage void do_syscall_trace(void)
248{ 268{
249 struct task_struct *tsk = current; 269 struct task_struct *tsk = current;
250 270
251 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 271 if (!test_thread_flag(TIF_SYSCALL_TRACE) &&
272 !test_thread_flag(TIF_SINGLESTEP))
252 return; 273 return;
253 if (!(tsk->ptrace & PT_PTRACED)) 274 if (!(tsk->ptrace & PT_PTRACED))
254 return; 275 return;
255 /* the 0x80 provides a way for the tracing parent to distinguish 276 /* the 0x80 provides a way for the tracing parent to distinguish
256 between a syscall stop and SIGTRAP delivery */ 277 between a syscall stop and SIGTRAP delivery */
257 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 278 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) &&
258 ? 0x80 : 0)); 279 !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0));
259 280
260 /* 281 /*
261 * this isn't the same as continuing with a signal, but it will do 282 * this isn't the same as continuing with a signal, but it will do
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c
index 32f10a03fbb5..9f39ef1f73da 100644
--- a/arch/sh/kernel/signal.c
+++ b/arch/sh/kernel/signal.c
@@ -589,6 +589,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
589 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 589 if (test_thread_flag(TIF_RESTORE_SIGMASK))
590 clear_thread_flag(TIF_RESTORE_SIGMASK); 590 clear_thread_flag(TIF_RESTORE_SIGMASK);
591 } 591 }
592
593 return;
592 } 594 }
593 595
594 no_signal: 596 no_signal:
@@ -598,7 +600,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
598 if (regs->regs[0] == -ERESTARTNOHAND || 600 if (regs->regs[0] == -ERESTARTNOHAND ||
599 regs->regs[0] == -ERESTARTSYS || 601 regs->regs[0] == -ERESTARTSYS ||
600 regs->regs[0] == -ERESTARTNOINTR) { 602 regs->regs[0] == -ERESTARTNOINTR) {
601 regs->regs[0] = save_r0; 603 regs->regs[0] = save_r0;
602 regs->pc -= 2; 604 regs->pc -= 2;
603 } else if (regs->regs[0] == -ERESTART_RESTARTBLOCK) { 605 } else if (regs->regs[0] == -ERESTART_RESTARTBLOCK) {
604 regs->pc -= 2; 606 regs->pc -= 2;
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index 75de165867a0..78a6c09875b2 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -3,6 +3,7 @@
3 * Written by Niibe Yutaka 3 * Written by Niibe Yutaka
4 */ 4 */
5#include <asm/thread_info.h> 5#include <asm/thread_info.h>
6#include <asm/cache.h>
6#include <asm-generic/vmlinux.lds.h> 7#include <asm-generic/vmlinux.lds.h>
7 8
8#ifdef CONFIG_CPU_LITTLE_ENDIAN 9#ifdef CONFIG_CPU_LITTLE_ENDIAN
@@ -53,7 +54,7 @@ SECTIONS
53 . = ALIGN(PAGE_SIZE); 54 . = ALIGN(PAGE_SIZE);
54 .data.page_aligned : { *(.data.page_aligned) } 55 .data.page_aligned : { *(.data.page_aligned) }
55 56
56 . = ALIGN(32); 57 . = ALIGN(L1_CACHE_BYTES);
57 __per_cpu_start = .; 58 __per_cpu_start = .;
58 .data.percpu : { *(.data.percpu) } 59 .data.percpu : { *(.data.percpu) }
59 __per_cpu_end = .; 60 __per_cpu_end = .;
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index e0cd4b7f4aeb..981b04089055 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -237,20 +237,10 @@ static inline void flush_cache_4096(unsigned long start,
237/* 237/*
238 * Write back & invalidate the D-cache of the page. 238 * Write back & invalidate the D-cache of the page.
239 * (To avoid "alias" issues) 239 * (To avoid "alias" issues)
240 *
241 * This uses a lazy write-back on UP, which is explicitly
242 * disabled on SMP.
243 */ 240 */
244void flush_dcache_page(struct page *page) 241void flush_dcache_page(struct page *page)
245{ 242{
246#ifndef CONFIG_SMP 243 if (test_bit(PG_mapped, &page->flags)) {
247 struct address_space *mapping = page_mapping(page);
248
249 if (mapping && !mapping_mapped(mapping))
250 set_bit(PG_dcache_dirty, &page->flags);
251 else
252#endif
253 {
254 unsigned long phys = PHYSADDR(page_address(page)); 244 unsigned long phys = PHYSADDR(page_address(page));
255 unsigned long addr = CACHE_OC_ADDRESS_ARRAY; 245 unsigned long addr = CACHE_OC_ADDRESS_ARRAY;
256 int i, n; 246 int i, n;
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c
index 31f8deb7a158..4896d7376926 100644
--- a/arch/sh/mm/cache-sh7705.c
+++ b/arch/sh/mm/cache-sh7705.c
@@ -3,11 +3,11 @@
3 * 3 *
4 * Copyright (C) 1999, 2000 Niibe Yutaka 4 * Copyright (C) 1999, 2000 Niibe Yutaka
5 * Copyright (C) 2004 Alex Song 5 * Copyright (C) 2004 Alex Song
6 * Copyright (C) 2006 Paul Mundt
7 * 6 *
8 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
10 * for more details. 9 * for more details.
10 *
11 */ 11 */
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/mman.h> 13#include <linux/mman.h>
@@ -51,6 +51,7 @@ static inline void cache_wback_all(void)
51 51
52 if ((data & v) == v) 52 if ((data & v) == v)
53 ctrl_outl(data & ~v, addr); 53 ctrl_outl(data & ~v, addr);
54
54 } 55 }
55 56
56 addrstart += current_cpu_data.dcache.way_incr; 57 addrstart += current_cpu_data.dcache.way_incr;
@@ -127,11 +128,7 @@ static void __flush_dcache_page(unsigned long phys)
127 */ 128 */
128void flush_dcache_page(struct page *page) 129void flush_dcache_page(struct page *page)
129{ 130{
130 struct address_space *mapping = page_mapping(page); 131 if (test_bit(PG_mapped, &page->flags))
131
132 if (mapping && !mapping_mapped(mapping))
133 set_bit(PG_dcache_dirty, &page->flags);
134 else
135 __flush_dcache_page(PHYSADDR(page_address(page))); 132 __flush_dcache_page(PHYSADDR(page_address(page)));
136} 133}
137 134
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c
index 969efeceb928..df69da9ca69c 100644
--- a/arch/sh/mm/pg-sh4.c
+++ b/arch/sh/mm/pg-sh4.c
@@ -23,6 +23,7 @@ extern struct mutex p3map_mutex[];
23 */ 23 */
24void clear_user_page(void *to, unsigned long address, struct page *page) 24void clear_user_page(void *to, unsigned long address, struct page *page)
25{ 25{
26 __set_bit(PG_mapped, &page->flags);
26 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) 27 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
27 clear_page(to); 28 clear_page(to);
28 else { 29 else {
@@ -58,6 +59,7 @@ void clear_user_page(void *to, unsigned long address, struct page *page)
58void copy_user_page(void *to, void *from, unsigned long address, 59void copy_user_page(void *to, void *from, unsigned long address,
59 struct page *page) 60 struct page *page)
60{ 61{
62 __set_bit(PG_mapped, &page->flags);
61 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) 63 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
62 copy_page(to, from); 64 copy_page(to, from);
63 else { 65 else {
@@ -82,3 +84,23 @@ void copy_user_page(void *to, void *from, unsigned long address,
82 mutex_unlock(&p3map_mutex[(address & CACHE_ALIAS)>>12]); 84 mutex_unlock(&p3map_mutex[(address & CACHE_ALIAS)>>12]);
83 } 85 }
84} 86}
87
88/*
89 * For SH-4, we have our own implementation for ptep_get_and_clear
90 */
91inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
92{
93 pte_t pte = *ptep;
94
95 pte_clear(mm, addr, ptep);
96 if (!pte_not_present(pte)) {
97 unsigned long pfn = pte_pfn(pte);
98 if (pfn_valid(pfn)) {
99 struct page *page = pfn_to_page(pfn);
100 struct address_space *mapping = page_mapping(page);
101 if (!mapping || !mapping_writably_mapped(mapping))
102 __clear_bit(PG_mapped, &page->flags);
103 }
104 }
105 return pte;
106}
diff --git a/arch/sh/mm/pg-sh7705.c b/arch/sh/mm/pg-sh7705.c
index 887ab9d18ccd..a4b015f95a3a 100644
--- a/arch/sh/mm/pg-sh7705.c
+++ b/arch/sh/mm/pg-sh7705.c
@@ -7,7 +7,9 @@
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 *
10 */ 11 */
12
11#include <linux/init.h> 13#include <linux/init.h>
12#include <linux/mman.h> 14#include <linux/mman.h>
13#include <linux/mm.h> 15#include <linux/mm.h>
@@ -74,6 +76,7 @@ void clear_user_page(void *to, unsigned long address, struct page *pg)
74{ 76{
75 struct page *page = virt_to_page(to); 77 struct page *page = virt_to_page(to);
76 78
79 __set_bit(PG_mapped, &page->flags);
77 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { 80 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) {
78 clear_page(to); 81 clear_page(to);
79 __flush_wback_region(to, PAGE_SIZE); 82 __flush_wback_region(to, PAGE_SIZE);
@@ -92,11 +95,12 @@ void clear_user_page(void *to, unsigned long address, struct page *pg)
92 * @from: P1 address 95 * @from: P1 address
93 * @address: U0 address to be mapped 96 * @address: U0 address to be mapped
94 */ 97 */
95void copy_user_page(void *to, void *from, unsigned long address, 98void copy_user_page(void *to, void *from, unsigned long address, struct page *pg)
96 struct page *pg)
97{ 99{
98 struct page *page = virt_to_page(to); 100 struct page *page = virt_to_page(to);
99 101
102
103 __set_bit(PG_mapped, &page->flags);
100 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { 104 if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) {
101 copy_page(to, from); 105 copy_page(to, from);
102 __flush_wback_region(to, PAGE_SIZE); 106 __flush_wback_region(to, PAGE_SIZE);
@@ -108,3 +112,26 @@ void copy_user_page(void *to, void *from, unsigned long address,
108 __flush_wback_region(to, PAGE_SIZE); 112 __flush_wback_region(to, PAGE_SIZE);
109 } 113 }
110} 114}
115
116/*
117 * For SH7705, we have our own implementation for ptep_get_and_clear
118 * Copied from pg-sh4.c
119 */
120inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
121{
122 pte_t pte = *ptep;
123
124 pte_clear(mm, addr, ptep);
125 if (!pte_not_present(pte)) {
126 unsigned long pfn = pte_pfn(pte);
127 if (pfn_valid(pfn)) {
128 struct page *page = pfn_to_page(pfn);
129 struct address_space *mapping = page_mapping(page);
130 if (!mapping || !mapping_writably_mapped(mapping))
131 __clear_bit(PG_mapped, &page->flags);
132 }
133 }
134
135 return pte;
136}
137
diff --git a/arch/sh/mm/tlb-flush.c b/arch/sh/mm/tlb-flush.c
index d2f7b4a2eb05..6f45c1f8a7fe 100644
--- a/arch/sh/mm/tlb-flush.c
+++ b/arch/sh/mm/tlb-flush.c
@@ -2,17 +2,15 @@
2 * TLB flushing operations for SH with an MMU. 2 * TLB flushing operations for SH with an MMU.
3 * 3 *
4 * Copyright (C) 1999 Niibe Yutaka 4 * Copyright (C) 1999 Niibe Yutaka
5 * Copyright (C) 2003 - 2006 Paul Mundt 5 * Copyright (C) 2003 Paul Mundt
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 */ 10 */
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/io.h>
13#include <asm/mmu_context.h> 12#include <asm/mmu_context.h>
14#include <asm/tlbflush.h> 13#include <asm/tlbflush.h>
15#include <asm/cacheflush.h>
16 14
17void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) 15void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
18{ 16{
@@ -140,54 +138,3 @@ void local_flush_tlb_all(void)
140 ctrl_barrier(); 138 ctrl_barrier();
141 local_irq_restore(flags); 139 local_irq_restore(flags);
142} 140}
143
144void update_mmu_cache(struct vm_area_struct *vma,
145 unsigned long address, pte_t pte)
146{
147 unsigned long flags;
148 unsigned long pteval;
149 unsigned long vpn;
150 struct page *page;
151 unsigned long pfn = pte_pfn(pte);
152 struct address_space *mapping;
153
154 if (!pfn_valid(pfn))
155 return;
156
157 page = pfn_to_page(pfn);
158 mapping = page_mapping(page);
159 if (mapping) {
160 unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
161 int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
162
163 if (dirty)
164 __flush_wback_region((void *)P1SEGADDR(phys),
165 PAGE_SIZE);
166 }
167
168 local_irq_save(flags);
169
170 /* Set PTEH register */
171 vpn = (address & MMU_VPN_MASK) | get_asid();
172 ctrl_outl(vpn, MMU_PTEH);
173
174 pteval = pte_val(pte);
175
176#ifdef CONFIG_CPU_HAS_PTEA
177 /* Set PTEA register */
178 /* TODO: make this look less hacky */
179 ctrl_outl(((pteval >> 28) & 0xe) | (pteval & 0x1), MMU_PTEA);
180#endif
181
182 /* Set PTEL register */
183 pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */
184#if defined(CONFIG_SH_WRITETHROUGH) && defined(CONFIG_CPU_SH4)
185 pteval |= _PAGE_WT;
186#endif
187 /* conveniently, we want all the software flags to be 0 anyway */
188 ctrl_outl(pteval, MMU_PTEL);
189
190 /* Load the TLB */
191 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory");
192 local_irq_restore(flags);
193}
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index e5e76eb7ee09..7fbfd5a11ffa 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -8,9 +8,69 @@
8 * 8 *
9 * Released under the terms of the GNU GPL v2.0. 9 * Released under the terms of the GNU GPL v2.0.
10 */ 10 */
11#include <linux/io.h> 11#include <linux/signal.h>
12#include <linux/sched.h>
13#include <linux/kernel.h>
14#include <linux/errno.h>
15#include <linux/string.h>
16#include <linux/types.h>
17#include <linux/ptrace.h>
18#include <linux/mman.h>
19#include <linux/mm.h>
20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/interrupt.h>
23
12#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/io.h>
26#include <asm/uaccess.h>
27#include <asm/pgalloc.h>
13#include <asm/mmu_context.h> 28#include <asm/mmu_context.h>
29#include <asm/cacheflush.h>
30
31void update_mmu_cache(struct vm_area_struct * vma,
32 unsigned long address, pte_t pte)
33{
34 unsigned long flags;
35 unsigned long pteval;
36 unsigned long vpn;
37
38 /* Ptrace may call this routine. */
39 if (vma && current->active_mm != vma->vm_mm)
40 return;
41
42#if defined(CONFIG_SH7705_CACHE_32KB)
43 {
44 struct page *page = pte_page(pte);
45 unsigned long pfn = pte_pfn(pte);
46
47 if (pfn_valid(pfn) && !test_bit(PG_mapped, &page->flags)) {
48 unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
49
50 __flush_wback_region((void *)P1SEGADDR(phys),
51 PAGE_SIZE);
52 __set_bit(PG_mapped, &page->flags);
53 }
54 }
55#endif
56
57 local_irq_save(flags);
58
59 /* Set PTEH register */
60 vpn = (address & MMU_VPN_MASK) | get_asid();
61 ctrl_outl(vpn, MMU_PTEH);
62
63 pteval = pte_val(pte);
64
65 /* Set PTEL register */
66 pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */
67 /* conveniently, we want all the software flags to be 0 anyway */
68 ctrl_outl(pteval, MMU_PTEL);
69
70 /* Load the TLB */
71 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory");
72 local_irq_restore(flags);
73}
14 74
15void local_flush_tlb_one(unsigned long asid, unsigned long page) 75void local_flush_tlb_one(unsigned long asid, unsigned long page)
16{ 76{
@@ -34,3 +94,4 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
34 for (i = 0; i < ways; i++) 94 for (i = 0; i < ways; i++)
35 ctrl_outl(data, addr + (i << 8)); 95 ctrl_outl(data, addr + (i << 8));
36} 96}
97
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c
index 221e7095473d..f74cf667c8fa 100644
--- a/arch/sh/mm/tlb-sh4.c
+++ b/arch/sh/mm/tlb-sh4.c
@@ -8,9 +8,74 @@
8 * 8 *
9 * Released under the terms of the GNU GPL v2.0. 9 * Released under the terms of the GNU GPL v2.0.
10 */ 10 */
11#include <linux/io.h> 11#include <linux/signal.h>
12#include <linux/sched.h>
13#include <linux/kernel.h>
14#include <linux/errno.h>
15#include <linux/string.h>
16#include <linux/types.h>
17#include <linux/ptrace.h>
18#include <linux/mman.h>
19#include <linux/mm.h>
20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/interrupt.h>
23
12#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/io.h>
26#include <asm/uaccess.h>
27#include <asm/pgalloc.h>
13#include <asm/mmu_context.h> 28#include <asm/mmu_context.h>
29#include <asm/cacheflush.h>
30
31void update_mmu_cache(struct vm_area_struct * vma,
32 unsigned long address, pte_t pte)
33{
34 unsigned long flags;
35 unsigned long pteval;
36 unsigned long vpn;
37 struct page *page;
38 unsigned long pfn;
39
40 /* Ptrace may call this routine. */
41 if (vma && current->active_mm != vma->vm_mm)
42 return;
43
44 pfn = pte_pfn(pte);
45 if (pfn_valid(pfn)) {
46 page = pfn_to_page(pfn);
47 if (!test_bit(PG_mapped, &page->flags)) {
48 unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
49 __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE);
50 __set_bit(PG_mapped, &page->flags);
51 }
52 }
53
54 local_irq_save(flags);
55
56 /* Set PTEH register */
57 vpn = (address & MMU_VPN_MASK) | get_asid();
58 ctrl_outl(vpn, MMU_PTEH);
59
60 pteval = pte_val(pte);
61
62 /* Set PTEA register */
63 if (cpu_data->flags & CPU_HAS_PTEA)
64 /* TODO: make this look less hacky */
65 ctrl_outl(((pteval >> 28) & 0xe) | (pteval & 0x1), MMU_PTEA);
66
67 /* Set PTEL register */
68 pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */
69#ifdef CONFIG_SH_WRITETHROUGH
70 pteval |= _PAGE_WT;
71#endif
72 /* conveniently, we want all the software flags to be 0 anyway */
73 ctrl_outl(pteval, MMU_PTEL);
74
75 /* Load the TLB */
76 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory");
77 local_irq_restore(flags);
78}
14 79
15void local_flush_tlb_one(unsigned long asid, unsigned long page) 80void local_flush_tlb_one(unsigned long asid, unsigned long page)
16{ 81{
@@ -28,3 +93,4 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
28 ctrl_outl(data, addr); 93 ctrl_outl(data, addr);
29 back_to_P1(); 94 back_to_P1();
30} 95}
96
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 113bd48a89bd..fc874e63a499 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -348,7 +348,7 @@ void exit_thread(void)
348#ifndef CONFIG_SMP 348#ifndef CONFIG_SMP
349 if(last_task_used_math == current) { 349 if(last_task_used_math == current) {
350#else 350#else
351 if(current_thread_info()->flags & _TIF_USEDFPU) { 351 if (test_thread_flag(TIF_USEDFPU)) {
352#endif 352#endif
353 /* Keep process from leaving FPU in a bogon state. */ 353 /* Keep process from leaving FPU in a bogon state. */
354 put_psr(get_psr() | PSR_EF); 354 put_psr(get_psr() | PSR_EF);
@@ -357,7 +357,7 @@ void exit_thread(void)
357#ifndef CONFIG_SMP 357#ifndef CONFIG_SMP
358 last_task_used_math = NULL; 358 last_task_used_math = NULL;
359#else 359#else
360 current_thread_info()->flags &= ~_TIF_USEDFPU; 360 clear_thread_flag(TIF_USEDFPU);
361#endif 361#endif
362 } 362 }
363} 363}
@@ -371,7 +371,7 @@ void flush_thread(void)
371#ifndef CONFIG_SMP 371#ifndef CONFIG_SMP
372 if(last_task_used_math == current) { 372 if(last_task_used_math == current) {
373#else 373#else
374 if(current_thread_info()->flags & _TIF_USEDFPU) { 374 if (test_thread_flag(TIF_USEDFPU)) {
375#endif 375#endif
376 /* Clean the fpu. */ 376 /* Clean the fpu. */
377 put_psr(get_psr() | PSR_EF); 377 put_psr(get_psr() | PSR_EF);
@@ -380,7 +380,7 @@ void flush_thread(void)
380#ifndef CONFIG_SMP 380#ifndef CONFIG_SMP
381 last_task_used_math = NULL; 381 last_task_used_math = NULL;
382#else 382#else
383 current_thread_info()->flags &= ~_TIF_USEDFPU; 383 clear_thread_flag(TIF_USEDFPU);
384#endif 384#endif
385 } 385 }
386 386
@@ -466,13 +466,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
466#ifndef CONFIG_SMP 466#ifndef CONFIG_SMP
467 if(last_task_used_math == current) { 467 if(last_task_used_math == current) {
468#else 468#else
469 if(current_thread_info()->flags & _TIF_USEDFPU) { 469 if (test_thread_flag(TIF_USEDFPU)) {
470#endif 470#endif
471 put_psr(get_psr() | PSR_EF); 471 put_psr(get_psr() | PSR_EF);
472 fpsave(&p->thread.float_regs[0], &p->thread.fsr, 472 fpsave(&p->thread.float_regs[0], &p->thread.fsr,
473 &p->thread.fpqueue[0], &p->thread.fpqdepth); 473 &p->thread.fpqueue[0], &p->thread.fpqdepth);
474#ifdef CONFIG_SMP 474#ifdef CONFIG_SMP
475 current_thread_info()->flags &= ~_TIF_USEDFPU; 475 clear_thread_flag(TIF_USEDFPU);
476#endif 476#endif
477 } 477 }
478 478
@@ -609,13 +609,13 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
609 return 1; 609 return 1;
610 } 610 }
611#ifdef CONFIG_SMP 611#ifdef CONFIG_SMP
612 if (current_thread_info()->flags & _TIF_USEDFPU) { 612 if (test_thread_flag(TIF_USEDFPU)) {
613 put_psr(get_psr() | PSR_EF); 613 put_psr(get_psr() | PSR_EF);
614 fpsave(&current->thread.float_regs[0], &current->thread.fsr, 614 fpsave(&current->thread.float_regs[0], &current->thread.fsr,
615 &current->thread.fpqueue[0], &current->thread.fpqdepth); 615 &current->thread.fpqueue[0], &current->thread.fpqdepth);
616 if (regs != NULL) { 616 if (regs != NULL) {
617 regs->psr &= ~(PSR_EF); 617 regs->psr &= ~(PSR_EF);
618 current_thread_info()->flags &= ~(_TIF_USEDFPU); 618 clear_thread_flag(TIF_USEDFPU);
619 } 619 }
620 } 620 }
621#else 621#else
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index ea75ca569052..3a69778c8366 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -78,7 +78,8 @@ sys_call_table:
78/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 78/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
79/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 79/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
80/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 80/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
81/*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages 81/*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
82/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
82 83
83#ifdef CONFIG_SUNOS_EMUL 84#ifdef CONFIG_SUNOS_EMUL
84 /* Now the SunOS syscall table. */ 85 /* Now the SunOS syscall table. */
@@ -192,5 +193,8 @@ sunos_sys_table:
192 .long sunos_nosys, sunos_nosys, sunos_nosys 193 .long sunos_nosys, sunos_nosys, sunos_nosys
193 .long sunos_nosys 194 .long sunos_nosys
194/*300*/ .long sunos_nosys, sunos_nosys, sunos_nosys 195/*300*/ .long sunos_nosys, sunos_nosys, sunos_nosys
196 .long sunos_nosys, sunos_nosys, sunos_nosys
197 .long sunos_nosys, sunos_nosys, sunos_nosys
198 .long sunos_nosys
195 199
196#endif 200#endif
diff --git a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c
index 6a70d215fd04..527687afc1c4 100644
--- a/arch/sparc/kernel/traps.c
+++ b/arch/sparc/kernel/traps.c
@@ -259,7 +259,7 @@ void do_fpd_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
259 } else { 259 } else {
260 fpload(&current->thread.float_regs[0], &current->thread.fsr); 260 fpload(&current->thread.float_regs[0], &current->thread.fsr);
261 } 261 }
262 current_thread_info()->flags |= _TIF_USEDFPU; 262 set_thread_flag(TIF_USEDFPU);
263#endif 263#endif
264} 264}
265 265
@@ -290,7 +290,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
290#ifndef CONFIG_SMP 290#ifndef CONFIG_SMP
291 if(!fpt) { 291 if(!fpt) {
292#else 292#else
293 if(!(task_thread_info(fpt)->flags & _TIF_USEDFPU)) { 293 if (!test_tsk_thread_flag(fpt, TIF_USEDFPU)) {
294#endif 294#endif
295 fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth); 295 fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth);
296 regs->psr &= ~PSR_EF; 296 regs->psr &= ~PSR_EF;
@@ -333,7 +333,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
333 /* nope, better SIGFPE the offending process... */ 333 /* nope, better SIGFPE the offending process... */
334 334
335#ifdef CONFIG_SMP 335#ifdef CONFIG_SMP
336 task_thread_info(fpt)->flags &= ~_TIF_USEDFPU; 336 clear_tsk_thread_flag(fpt, TIF_USEDFPU);
337#endif 337#endif
338 if(psr & PSR_PS) { 338 if(psr & PSR_PS) {
339 /* The first fsr store/load we tried trapped, 339 /* The first fsr store/load we tried trapped,
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index c85ddf312747..a532922e2e35 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -75,7 +75,7 @@ void show_mem(void)
75 printk("Free swap: %6ldkB\n", 75 printk("Free swap: %6ldkB\n",
76 nr_swap_pages << (PAGE_SHIFT-10)); 76 nr_swap_pages << (PAGE_SHIFT-10));
77 printk("%ld pages of RAM\n", totalram_pages); 77 printk("%ld pages of RAM\n", totalram_pages);
78 printk("%d free pages\n", nr_free_pages()); 78 printk("%ld free pages\n", nr_free_pages());
79#if 0 /* undefined pgtable_cache_size, pgd_cache_size */ 79#if 0 /* undefined pgtable_cache_size, pgd_cache_size */
80 printk("%ld pages in page table cache\n",pgtable_cache_size); 80 printk("%ld pages in page table cache\n",pgtable_cache_size);
81#ifndef CONFIG_SMP 81#ifndef CONFIG_SMP
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 7d75cd4eb297..b291060c25a6 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -413,8 +413,13 @@ void flush_thread(void)
413 struct thread_info *t = current_thread_info(); 413 struct thread_info *t = current_thread_info();
414 struct mm_struct *mm; 414 struct mm_struct *mm;
415 415
416 if (t->flags & _TIF_ABI_PENDING) 416 if (test_ti_thread_flag(t, TIF_ABI_PENDING)) {
417 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 417 clear_ti_thread_flag(t, TIF_ABI_PENDING);
418 if (test_ti_thread_flag(t, TIF_32BIT))
419 clear_ti_thread_flag(t, TIF_32BIT);
420 else
421 set_ti_thread_flag(t, TIF_32BIT);
422 }
418 423
419 mm = t->task->mm; 424 mm = t->task->mm;
420 if (mm) 425 if (mm)
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 948b7d2d5874..aaeb5e06735c 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -79,7 +79,8 @@ sys_call_table32:
79 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 79 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
80/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 80/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
81 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 81 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
82/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages 82/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages, compat_sys_mbind, compat_sys_get_mempolicy
83 .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait
83 84
84#endif /* CONFIG_COMPAT */ 85#endif /* CONFIG_COMPAT */
85 86
@@ -149,7 +150,8 @@ sys_call_table:
149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 150 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
150/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 151/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 152 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
152/*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages 153/*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
154 .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
153 155
154#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ 156#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
155 defined(CONFIG_SOLARIS_EMUL_MODULE) 157 defined(CONFIG_SOLARIS_EMUL_MODULE)
@@ -264,5 +266,8 @@ sunos_sys_table:
264 .word sunos_nosys, sunos_nosys, sunos_nosys 266 .word sunos_nosys, sunos_nosys, sunos_nosys
265 .word sunos_nosys 267 .word sunos_nosys
266/*300*/ .word sunos_nosys, sunos_nosys, sunos_nosys 268/*300*/ .word sunos_nosys, sunos_nosys, sunos_nosys
269 .word sunos_nosys, sunos_nosys, sunos_nosys
270 .word sunos_nosys, sunos_nosys, sunos_nosys
271 .word sunos_nosys
267 272
268#endif 273#endif
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
index 33fd0b265e70..00677b5e1d7d 100644
--- a/arch/sparc64/mm/hugetlbpage.c
+++ b/arch/sparc64/mm/hugetlbpage.c
@@ -248,6 +248,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
248 if (!pte_present(*ptep) && pte_present(entry)) 248 if (!pte_present(*ptep) && pte_present(entry))
249 mm->context.huge_pte_count++; 249 mm->context.huge_pte_count++;
250 250
251 addr &= HPAGE_MASK;
251 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 252 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
252 set_pte_at(mm, addr, ptep, entry); 253 set_pte_at(mm, addr, ptep, entry);
253 ptep++; 254 ptep++;
@@ -266,6 +267,8 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
266 if (pte_present(entry)) 267 if (pte_present(entry))
267 mm->context.huge_pte_count--; 268 mm->context.huge_pte_count--;
268 269
270 addr &= HPAGE_MASK;
271
269 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 272 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
270 pte_clear(mm, addr, ptep); 273 pte_clear(mm, addr, ptep);
271 addr += PAGE_SIZE; 274 addr += PAGE_SIZE;
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index b3a21ba77cd2..354cc6b70530 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -44,7 +44,7 @@ config LOCKDEP_SUPPORT
44 44
45config STACKTRACE_SUPPORT 45config STACKTRACE_SUPPORT
46 bool 46 bool
47 default y 47 default n
48 48
49config GENERIC_CALIBRATE_DELAY 49config GENERIC_CALIBRATE_DELAY
50 bool 50 bool
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c
index 310af0f1e49e..021b82c7a759 100644
--- a/arch/um/drivers/daemon_user.c
+++ b/arch/um/drivers/daemon_user.c
@@ -56,30 +56,31 @@ static int connect_to_switch(struct daemon_data *pri)
56 56
57 pri->control = socket(AF_UNIX, SOCK_STREAM, 0); 57 pri->control = socket(AF_UNIX, SOCK_STREAM, 0);
58 if(pri->control < 0){ 58 if(pri->control < 0){
59 err = -errno;
59 printk("daemon_open : control socket failed, errno = %d\n", 60 printk("daemon_open : control socket failed, errno = %d\n",
60 errno); 61 -err);
61 return(-errno); 62 return err;
62 } 63 }
63 64
64 if(connect(pri->control, (struct sockaddr *) ctl_addr, 65 if(connect(pri->control, (struct sockaddr *) ctl_addr,
65 sizeof(*ctl_addr)) < 0){ 66 sizeof(*ctl_addr)) < 0){
66 printk("daemon_open : control connect failed, errno = %d\n",
67 errno);
68 err = -errno; 67 err = -errno;
68 printk("daemon_open : control connect failed, errno = %d\n",
69 -err);
69 goto out; 70 goto out;
70 } 71 }
71 72
72 fd = socket(AF_UNIX, SOCK_DGRAM, 0); 73 fd = socket(AF_UNIX, SOCK_DGRAM, 0);
73 if(fd < 0){ 74 if(fd < 0){
74 printk("daemon_open : data socket failed, errno = %d\n",
75 errno);
76 err = -errno; 75 err = -errno;
76 printk("daemon_open : data socket failed, errno = %d\n",
77 -err);
77 goto out; 78 goto out;
78 } 79 }
79 if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr)) < 0){ 80 if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr)) < 0){
80 printk("daemon_open : data bind failed, errno = %d\n",
81 errno);
82 err = -errno; 81 err = -errno;
82 printk("daemon_open : data bind failed, errno = %d\n",
83 -err);
83 goto out_close; 84 goto out_close;
84 } 85 }
85 86
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 01d4ab6b0ef1..f75d7b05c481 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -370,10 +370,10 @@ static irqreturn_t line_write_interrupt(int irq, void *data)
370 struct tty_struct *tty = line->tty; 370 struct tty_struct *tty = line->tty;
371 int err; 371 int err;
372 372
373 /* Interrupts are enabled here because we registered the interrupt with 373 /* Interrupts are disabled here because we registered the interrupt with
374 * IRQF_DISABLED (see line_setup_irq).*/ 374 * IRQF_DISABLED (see line_setup_irq).*/
375 375
376 spin_lock_irq(&line->lock); 376 spin_lock(&line->lock);
377 err = flush_buffer(line); 377 err = flush_buffer(line);
378 if (err == 0) { 378 if (err == 0) {
379 return IRQ_NONE; 379 return IRQ_NONE;
@@ -381,7 +381,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data)
381 line->head = line->buffer; 381 line->head = line->buffer;
382 line->tail = line->buffer; 382 line->tail = line->buffer;
383 } 383 }
384 spin_unlock_irq(&line->lock); 384 spin_unlock(&line->lock);
385 385
386 if(tty == NULL) 386 if(tty == NULL)
387 return IRQ_NONE; 387 return IRQ_NONE;
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index 8138f5ea1bf7..b827e82884c9 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -50,6 +50,14 @@ static void mcast_user_init(void *data, void *dev)
50 pri->dev = dev; 50 pri->dev = dev;
51} 51}
52 52
53static void mcast_remove(void *data)
54{
55 struct mcast_data *pri = data;
56
57 kfree(pri->mcast_addr);
58 pri->mcast_addr = NULL;
59}
60
53static int mcast_open(void *data) 61static int mcast_open(void *data)
54{ 62{
55 struct mcast_data *pri = data; 63 struct mcast_data *pri = data;
@@ -157,7 +165,7 @@ const struct net_user_info mcast_user_info = {
157 .init = mcast_user_init, 165 .init = mcast_user_init,
158 .open = mcast_open, 166 .open = mcast_open,
159 .close = mcast_close, 167 .close = mcast_close,
160 .remove = NULL, 168 .remove = mcast_remove,
161 .set_mtu = mcast_set_mtu, 169 .set_mtu = mcast_set_mtu,
162 .add_address = NULL, 170 .add_address = NULL,
163 .delete_address = NULL, 171 .delete_address = NULL,
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index fc22b9bd9153..4b382a6e710f 100644
--- a/arch/um/drivers/ssl.c
+++ b/arch/um/drivers/ssl.c
@@ -179,7 +179,7 @@ static struct console ssl_cons = {
179 .write = ssl_console_write, 179 .write = ssl_console_write,
180 .device = ssl_console_device, 180 .device = ssl_console_device,
181 .setup = ssl_console_setup, 181 .setup = ssl_console_setup,
182 .flags = CON_PRINTBUFFER, 182 .flags = CON_PRINTBUFFER|CON_ANYTIME,
183 .index = -1, 183 .index = -1,
184}; 184};
185 185
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index 7ff0b0fc37e7..76d1f1c980ef 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -153,7 +153,7 @@ static struct console stdiocons = {
153 .write = uml_console_write, 153 .write = uml_console_write,
154 .device = uml_console_device, 154 .device = uml_console_device,
155 .setup = uml_console_setup, 155 .setup = uml_console_setup,
156 .flags = CON_PRINTBUFFER, 156 .flags = CON_PRINTBUFFER|CON_ANYTIME,
157 .index = -1, 157 .index = -1,
158}; 158};
159 159
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 8629bd191492..5c74da410451 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -192,7 +192,9 @@ extern int os_process_parent(int pid);
192extern void os_stop_process(int pid); 192extern void os_stop_process(int pid);
193extern void os_kill_process(int pid, int reap_child); 193extern void os_kill_process(int pid, int reap_child);
194extern void os_kill_ptraced_process(int pid, int reap_child); 194extern void os_kill_ptraced_process(int pid, int reap_child);
195#ifdef UML_CONFIG_MODE_TT
195extern void os_usr1_process(int pid); 196extern void os_usr1_process(int pid);
197#endif
196extern long os_ptrace_ldt(long pid, long addr, long data); 198extern long os_ptrace_ldt(long pid, long addr, long data);
197 199
198extern int os_getpid(void); 200extern int os_getpid(void);
@@ -261,7 +263,6 @@ extern void block_signals(void);
261extern void unblock_signals(void); 263extern void unblock_signals(void);
262extern int get_signals(void); 264extern int get_signals(void);
263extern int set_signals(int enable); 265extern int set_signals(int enable);
264extern void os_usr1_signal(int on);
265 266
266/* trap.c */ 267/* trap.c */
267extern void os_fill_handlinfo(struct kern_handlers h); 268extern void os_fill_handlinfo(struct kern_handlers h);
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 50a288bb875a..dbf2f5bc842f 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -142,6 +142,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
142 .events = events, 142 .events = events,
143 .current_events = 0 } ); 143 .current_events = 0 } );
144 144
145 err = -EBUSY;
145 spin_lock_irqsave(&irq_lock, flags); 146 spin_lock_irqsave(&irq_lock, flags);
146 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { 147 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
147 if ((irq_fd->fd == fd) && (irq_fd->type == type)) { 148 if ((irq_fd->fd == fd) && (irq_fd->type == type)) {
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c
index 2a32e5e8e9c9..3c798cdde550 100644
--- a/arch/um/kernel/signal.c
+++ b/arch/um/kernel/signal.c
@@ -158,12 +158,12 @@ static int kern_do_signal(struct pt_regs *regs)
158 clear_thread_flag(TIF_RESTORE_SIGMASK); 158 clear_thread_flag(TIF_RESTORE_SIGMASK);
159 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 159 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
160 } 160 }
161 return(handled_sig); 161 return handled_sig;
162} 162}
163 163
164int do_signal(void) 164int do_signal(void)
165{ 165{
166 return(kern_do_signal(&current->thread.regs)); 166 return kern_do_signal(&current->thread.regs);
167} 167}
168 168
169/* 169/*
@@ -186,5 +186,5 @@ long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
186 186
187long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) 187long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
188{ 188{
189 return(do_sigaltstack(uss, uoss, PT_REGS_SP(&current->thread.regs))); 189 return do_sigaltstack(uss, uoss, PT_REGS_SP(&current->thread.regs));
190} 190}
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index c692a192957a..76bdd6712417 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -21,6 +21,7 @@
21#include "longjmp.h" 21#include "longjmp.h"
22#include "skas_ptrace.h" 22#include "skas_ptrace.h"
23#include "kern_constants.h" 23#include "kern_constants.h"
24#include "uml-config.h"
24 25
25#define ARBITRARY_ADDR -1 26#define ARBITRARY_ADDR -1
26#define FAILURE_PID -1 27#define FAILURE_PID -1
@@ -131,10 +132,12 @@ void os_kill_ptraced_process(int pid, int reap_child)
131 CATCH_EINTR(waitpid(pid, NULL, 0)); 132 CATCH_EINTR(waitpid(pid, NULL, 0));
132} 133}
133 134
135#ifdef UML_CONFIG_MODE_TT
134void os_usr1_process(int pid) 136void os_usr1_process(int pid)
135{ 137{
136 kill(pid, SIGUSR1); 138 kill(pid, SIGUSR1);
137} 139}
140#endif
138 141
139/* Don't use the glibc version, which caches the result in TLS. It misses some 142/* Don't use the glibc version, which caches the result in TLS. It misses some
140 * syscalls, and also breaks with clone(), which does not unshare the TLS. 143 * syscalls, and also breaks with clone(), which does not unshare the TLS.
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index b897e8592d77..266768629fee 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -243,8 +243,3 @@ int set_signals(int enable)
243 243
244 return ret; 244 return ret;
245} 245}
246
247void os_usr1_signal(int on)
248{
249 change_sig(SIGUSR1, on);
250}
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 9b34fe65949a..dda06789bcb0 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -419,9 +419,12 @@ void map_stub_pages(int fd, unsigned long code,
419 .offset = code_offset 419 .offset = code_offset
420 } } }); 420 } } });
421 n = os_write_file(fd, &mmop, sizeof(mmop)); 421 n = os_write_file(fd, &mmop, sizeof(mmop));
422 if(n != sizeof(mmop)) 422 if(n != sizeof(mmop)){
423 printk("mmap args - addr = 0x%lx, fd = %d, offset = %llx\n",
424 code, code_fd, (unsigned long long) code_offset);
423 panic("map_stub_pages : /proc/mm map for code failed, " 425 panic("map_stub_pages : /proc/mm map for code failed, "
424 "err = %d\n", -n); 426 "err = %d\n", -n);
427 }
425 428
426 if ( stack ) { 429 if ( stack ) {
427 __u64 map_offset; 430 __u64 map_offset;
diff --git a/arch/um/os-Linux/trap.c b/arch/um/os-Linux/trap.c
index 1df231a26244..d221214d2ed5 100644
--- a/arch/um/os-Linux/trap.c
+++ b/arch/um/os-Linux/trap.c
@@ -16,6 +16,7 @@ void usr2_handler(int sig, union uml_pt_regs *regs)
16 CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0); 16 CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0);
17} 17}
18 18
19/* Initialized from linux_main() */
19void (*sig_info[NSIG])(int, union uml_pt_regs *); 20void (*sig_info[NSIG])(int, union uml_pt_regs *);
20 21
21void os_fill_handlinfo(struct kern_handlers h) 22void os_fill_handlinfo(struct kern_handlers h)
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 813077fb1e5b..a9a4b85ca516 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -10,7 +10,7 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
10$(USER_OBJS:.o=.%): \ 10$(USER_OBJS:.o=.%): \
11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o) 11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o)
12$(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ 12$(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
13 -Dunix -D__unix__ -D__$(SUBARCH)__ 13 -Dunix -D__unix__ -D__$(SUBARCH)__ $(CF)
14 14
15# These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of 15# These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of
16# using it directly. 16# using it directly.
@@ -19,7 +19,7 @@ UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file))
19$(UNPROFILE_OBJS:.o=.%): \ 19$(UNPROFILE_OBJS:.o=.%): \
20 c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o) 20 c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o)
21$(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ 21$(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
22 -Dunix -D__unix__ -D__$(SUBARCH)__ 22 -Dunix -D__unix__ -D__$(SUBARCH)__ $(CF)
23 23
24# The stubs and unmap.o can't try to call mcount or update basic block data 24# The stubs and unmap.o can't try to call mcount or update basic block data
25define unprofile 25define unprofile
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index 01b91f9fa789..b3f6350cac44 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -103,6 +103,9 @@ long arch_prctl_skas(struct task_struct *task, int code,
103 103
104 switch(code){ 104 switch(code){
105 case ARCH_SET_FS: 105 case ARCH_SET_FS:
106 current->thread.arch.fs = (unsigned long) ptr;
107 save_registers(pid, &current->thread.regs.regs);
108 break;
106 case ARCH_SET_GS: 109 case ARCH_SET_GS:
107 save_registers(pid, &current->thread.regs.regs); 110 save_registers(pid, &current->thread.regs.regs);
108 break; 111 break;
@@ -140,9 +143,8 @@ long sys_clone(unsigned long clone_flags, unsigned long newsp,
140 143
141void arch_switch_to_skas(struct task_struct *from, struct task_struct *to) 144void arch_switch_to_skas(struct task_struct *from, struct task_struct *to)
142{ 145{
143 if(to->thread.arch.fs == 0) 146 if((to->thread.arch.fs == 0) || (to->mm == NULL))
144 return; 147 return;
145 148
146 arch_prctl_skas(to, ARCH_SET_FS, (void __user *) to->thread.arch.fs); 149 arch_prctl_skas(to, ARCH_SET_FS, (void __user *) to->thread.arch.fs);
147} 150}
148
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c
index 04566fe5de49..4de3a54318f4 100644
--- a/arch/x86_64/ia32/ptrace32.c
+++ b/arch/x86_64/ia32/ptrace32.c
@@ -243,6 +243,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
243 case PTRACE_SINGLESTEP: 243 case PTRACE_SINGLESTEP:
244 case PTRACE_DETACH: 244 case PTRACE_DETACH:
245 case PTRACE_SYSCALL: 245 case PTRACE_SYSCALL:
246 case PTRACE_OLDSETOPTIONS:
246 case PTRACE_SETOPTIONS: 247 case PTRACE_SETOPTIONS:
247 case PTRACE_SET_THREAD_AREA: 248 case PTRACE_SET_THREAD_AREA:
248 case PTRACE_GET_THREAD_AREA: 249 case PTRACE_GET_THREAD_AREA:
diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86_64/kernel/early-quirks.c
index 8047ea8c2ab2..dec587b293bf 100644
--- a/arch/x86_64/kernel/early-quirks.c
+++ b/arch/x86_64/kernel/early-quirks.c
@@ -30,11 +30,8 @@ static void via_bugs(void)
30 30
31#ifdef CONFIG_ACPI 31#ifdef CONFIG_ACPI
32 32
33static int nvidia_hpet_detected __initdata;
34
35static int __init nvidia_hpet_check(struct acpi_table_header *header) 33static int __init nvidia_hpet_check(struct acpi_table_header *header)
36{ 34{
37 nvidia_hpet_detected = 1;
38 return 0; 35 return 0;
39} 36}
40#endif 37#endif
@@ -52,11 +49,7 @@ static void nvidia_bugs(void)
52 if (acpi_use_timer_override) 49 if (acpi_use_timer_override)
53 return; 50 return;
54 51
55 nvidia_hpet_detected = 0; 52 if (acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check)) {
56 if (acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check))
57 return;
58
59 if (nvidia_hpet_detected == 0) {
60 acpi_skip_timer_override = 1; 53 acpi_skip_timer_override = 1;
61 printk(KERN_INFO "Nvidia board " 54 printk(KERN_INFO "Nvidia board "
62 "detected. Ignoring ACPI " 55 "detected. Ignoring ACPI "
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 35443729aad8..cd4643a37022 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -923,8 +923,9 @@ void __init smp_prepare_boot_cpu(void)
923 */ 923 */
924int __cpuinit __cpu_up(unsigned int cpu) 924int __cpuinit __cpu_up(unsigned int cpu)
925{ 925{
926 int err;
927 int apicid = cpu_present_to_apicid(cpu); 926 int apicid = cpu_present_to_apicid(cpu);
927 unsigned long flags;
928 int err;
928 929
929 WARN_ON(irqs_disabled()); 930 WARN_ON(irqs_disabled());
930 931
@@ -958,7 +959,9 @@ int __cpuinit __cpu_up(unsigned int cpu)
958 /* 959 /*
959 * Make sure and check TSC sync: 960 * Make sure and check TSC sync:
960 */ 961 */
962 local_irq_save(flags);
961 check_tsc_sync_source(cpu); 963 check_tsc_sync_source(cpu);
964 local_irq_restore(flags);
962 965
963 while (!cpu_isset(cpu, cpu_online_map)) 966 while (!cpu_isset(cpu, cpu_online_map))
964 cpu_relax(); 967 cpu_relax();
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index 180ff919eaf9..b43c698cf7d3 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -112,7 +112,7 @@ static __always_inline void do_vgettimeofday(struct timeval * tv)
112 112
113 vread = __vsyscall_gtod_data.clock.vread; 113 vread = __vsyscall_gtod_data.clock.vread;
114 if (unlikely(!__vsyscall_gtod_data.sysctl_enabled || !vread)) { 114 if (unlikely(!__vsyscall_gtod_data.sysctl_enabled || !vread)) {
115 gettimeofday(tv,0); 115 gettimeofday(tv,NULL);
116 return; 116 return;
117 } 117 }
118 now = vread(); 118 now = vread();
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 7c49e103cf8f..e2ce4a9c1c92 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -7,6 +7,7 @@ menu "ACPI (Advanced Configuration and Power Interface) Support"
7 depends on !X86_VISWS 7 depends on !X86_VISWS
8 depends on !IA64_HP_SIM 8 depends on !IA64_HP_SIM
9 depends on IA64 || X86 9 depends on IA64 || X86
10 depends on PM
10 11
11config ACPI 12config ACPI
12 bool "ACPI Support" 13 bool "ACPI Support"
@@ -243,6 +244,17 @@ config ACPI_IBM_DOCK
243 244
244 If you are not sure, say N here. 245 If you are not sure, say N here.
245 246
247config ACPI_IBM_BAY
248 bool "Legacy Removable Bay Support"
249 depends on ACPI_IBM
250 default y
251 ---help---
252 Allows the ibm_acpi driver to handle removable bays. It will allow
253 disabling the device in the bay, and also generate notifications when
254 the bay lever is ejected or inserted.
255
256 If you are not sure, say Y here.
257
246config ACPI_TOSHIBA 258config ACPI_TOSHIBA
247 tristate "Toshiba Laptop Extras" 259 tristate "Toshiba Laptop Extras"
248 depends on X86 260 depends on X86
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index f289fd41e77d..3ec110ce00c8 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -79,11 +79,17 @@ static int __init blacklist_by_year(void)
79{ 79{
80 int year = dmi_get_year(DMI_BIOS_DATE); 80 int year = dmi_get_year(DMI_BIOS_DATE);
81 /* Doesn't exist? Likely an old system */ 81 /* Doesn't exist? Likely an old system */
82 if (year == -1) 82 if (year == -1) {
83 printk(KERN_ERR PREFIX "no DMI BIOS year, "
84 "acpi=force is required to enable ACPI\n" );
83 return 1; 85 return 1;
86 }
84 /* 0? Likely a buggy new BIOS */ 87 /* 0? Likely a buggy new BIOS */
85 if (year == 0) 88 if (year == 0) {
89 printk(KERN_ERR PREFIX "DMI BIOS year==0, "
90 "assuming ACPI-capable machine\n" );
86 return 0; 91 return 0;
92 }
87 if (year < CONFIG_ACPI_BLACKLIST_YEAR) { 93 if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
88 printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), " 94 printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
89 "acpi=force is required to enable ACPI\n", 95 "acpi=force is required to enable ACPI\n",
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index ab6888373795..a802962ff2b4 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -100,6 +100,7 @@ static struct acpi_ec {
100 unsigned long global_lock; 100 unsigned long global_lock;
101 struct mutex lock; 101 struct mutex lock;
102 atomic_t query_pending; 102 atomic_t query_pending;
103 atomic_t event_count;
103 atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort */ 104 atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort */
104 wait_queue_head_t wait; 105 wait_queue_head_t wait;
105} *ec_ecdt; 106} *ec_ecdt;
@@ -131,10 +132,12 @@ static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
131 outb(data, ec->data_addr); 132 outb(data, ec->data_addr);
132} 133}
133 134
134static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event) 135static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event,
136 unsigned old_count)
135{ 137{
136 u8 status = acpi_ec_read_status(ec); 138 u8 status = acpi_ec_read_status(ec);
137 139 if (old_count == atomic_read(&ec->event_count))
140 return 0;
138 if (event == ACPI_EC_EVENT_OBF_1) { 141 if (event == ACPI_EC_EVENT_OBF_1) {
139 if (status & ACPI_EC_FLAG_OBF) 142 if (status & ACPI_EC_FLAG_OBF)
140 return 1; 143 return 1;
@@ -146,19 +149,19 @@ static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event)
146 return 0; 149 return 0;
147} 150}
148 151
149static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event) 152static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, unsigned count)
150{ 153{
151 if (acpi_ec_mode == EC_POLL) { 154 if (acpi_ec_mode == EC_POLL) {
152 unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY); 155 unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
153 while (time_before(jiffies, delay)) { 156 while (time_before(jiffies, delay)) {
154 if (acpi_ec_check_status(ec, event)) 157 if (acpi_ec_check_status(ec, event, 0))
155 return 0; 158 return 0;
156 } 159 }
157 } else { 160 } else {
158 if (wait_event_timeout(ec->wait, 161 if (wait_event_timeout(ec->wait,
159 acpi_ec_check_status(ec, event), 162 acpi_ec_check_status(ec, event, count),
160 msecs_to_jiffies(ACPI_EC_DELAY)) || 163 msecs_to_jiffies(ACPI_EC_DELAY)) ||
161 acpi_ec_check_status(ec, event)) { 164 acpi_ec_check_status(ec, event, 0)) {
162 return 0; 165 return 0;
163 } else { 166 } else {
164 printk(KERN_ERR PREFIX "acpi_ec_wait timeout," 167 printk(KERN_ERR PREFIX "acpi_ec_wait timeout,"
@@ -225,21 +228,22 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
225 u8 * rdata, unsigned rdata_len) 228 u8 * rdata, unsigned rdata_len)
226{ 229{
227 int result = 0; 230 int result = 0;
228 231 unsigned count = atomic_read(&ec->event_count);
229 acpi_ec_write_cmd(ec, command); 232 acpi_ec_write_cmd(ec, command);
230 233
231 for (; wdata_len > 0; --wdata_len) { 234 for (; wdata_len > 0; --wdata_len) {
232 result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0); 235 result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count);
233 if (result) { 236 if (result) {
234 printk(KERN_ERR PREFIX 237 printk(KERN_ERR PREFIX
235 "write_cmd timeout, command = %d\n", command); 238 "write_cmd timeout, command = %d\n", command);
236 goto end; 239 goto end;
237 } 240 }
241 count = atomic_read(&ec->event_count);
238 acpi_ec_write_data(ec, *(wdata++)); 242 acpi_ec_write_data(ec, *(wdata++));
239 } 243 }
240 244
241 if (!rdata_len) { 245 if (!rdata_len) {
242 result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0); 246 result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count);
243 if (result) { 247 if (result) {
244 printk(KERN_ERR PREFIX 248 printk(KERN_ERR PREFIX
245 "finish-write timeout, command = %d\n", command); 249 "finish-write timeout, command = %d\n", command);
@@ -250,13 +254,13 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
250 } 254 }
251 255
252 for (; rdata_len > 0; --rdata_len) { 256 for (; rdata_len > 0; --rdata_len) {
253 result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1); 257 result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, count);
254 if (result) { 258 if (result) {
255 printk(KERN_ERR PREFIX "read timeout, command = %d\n", 259 printk(KERN_ERR PREFIX "read timeout, command = %d\n",
256 command); 260 command);
257 goto end; 261 goto end;
258 } 262 }
259 263 count = atomic_read(&ec->event_count);
260 *(rdata++) = acpi_ec_read_data(ec); 264 *(rdata++) = acpi_ec_read_data(ec);
261 } 265 }
262 end: 266 end:
@@ -288,7 +292,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
288 /* Make sure GPE is enabled before doing transaction */ 292 /* Make sure GPE is enabled before doing transaction */
289 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 293 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
290 294
291 status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0); 295 status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0);
292 if (status) { 296 if (status) {
293 printk(KERN_DEBUG PREFIX 297 printk(KERN_DEBUG PREFIX
294 "input buffer is not empty, aborting transaction\n"); 298 "input buffer is not empty, aborting transaction\n");
@@ -369,8 +373,8 @@ int ec_write(u8 addr, u8 val)
369EXPORT_SYMBOL(ec_write); 373EXPORT_SYMBOL(ec_write);
370 374
371int ec_transaction(u8 command, 375int ec_transaction(u8 command,
372 const u8 * wdata, unsigned wdata_len, 376 const u8 * wdata, unsigned wdata_len,
373 u8 * rdata, unsigned rdata_len) 377 u8 * rdata, unsigned rdata_len)
374{ 378{
375 struct acpi_ec *ec; 379 struct acpi_ec *ec;
376 380
@@ -435,7 +439,7 @@ static u32 acpi_ec_gpe_handler(void *data)
435 acpi_status status = AE_OK; 439 acpi_status status = AE_OK;
436 u8 value; 440 u8 value;
437 struct acpi_ec *ec = (struct acpi_ec *)data; 441 struct acpi_ec *ec = (struct acpi_ec *)data;
438 442 atomic_inc(&ec->event_count);
439 if (acpi_ec_mode == EC_INTR) { 443 if (acpi_ec_mode == EC_INTR) {
440 wake_up(&ec->wait); 444 wake_up(&ec->wait);
441 } 445 }
@@ -633,6 +637,7 @@ static int acpi_ec_add(struct acpi_device *device)
633 ec->uid = -1; 637 ec->uid = -1;
634 mutex_init(&ec->lock); 638 mutex_init(&ec->lock);
635 atomic_set(&ec->query_pending, 0); 639 atomic_set(&ec->query_pending, 0);
640 atomic_set(&ec->event_count, 1);
636 if (acpi_ec_mode == EC_INTR) { 641 if (acpi_ec_mode == EC_INTR) {
637 atomic_set(&ec->leaving_burst, 1); 642 atomic_set(&ec->leaving_burst, 1);
638 init_waitqueue_head(&ec->wait); 643 init_waitqueue_head(&ec->wait);
@@ -807,6 +812,7 @@ acpi_fake_ecdt_callback(acpi_handle handle,
807 acpi_status status; 812 acpi_status status;
808 813
809 mutex_init(&ec_ecdt->lock); 814 mutex_init(&ec_ecdt->lock);
815 atomic_set(&ec_ecdt->event_count, 1);
810 if (acpi_ec_mode == EC_INTR) { 816 if (acpi_ec_mode == EC_INTR) {
811 init_waitqueue_head(&ec_ecdt->wait); 817 init_waitqueue_head(&ec_ecdt->wait);
812 } 818 }
@@ -888,6 +894,7 @@ static int __init acpi_ec_get_real_ecdt(void)
888 return -ENOMEM; 894 return -ENOMEM;
889 895
890 mutex_init(&ec_ecdt->lock); 896 mutex_init(&ec_ecdt->lock);
897 atomic_set(&ec_ecdt->event_count, 1);
891 if (acpi_ec_mode == EC_INTR) { 898 if (acpi_ec_mode == EC_INTR) {
892 init_waitqueue_head(&ec_ecdt->wait); 899 init_waitqueue_head(&ec_ecdt->wait);
893 } 900 }
@@ -1016,8 +1023,7 @@ static int __init acpi_ec_set_intr_mode(char *str)
1016 acpi_ec_mode = EC_POLL; 1023 acpi_ec_mode = EC_POLL;
1017 } 1024 }
1018 acpi_ec_driver.ops.add = acpi_ec_add; 1025 acpi_ec_driver.ops.add = acpi_ec_add;
1019 printk(KERN_NOTICE PREFIX "%s mode.\n", 1026 printk(KERN_NOTICE PREFIX "%s mode.\n", intr ? "interrupt" : "polling");
1020 intr ? "interrupt" : "polling");
1021 1027
1022 return 1; 1028 return 1;
1023} 1029}
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index d572700197f3..3a799b9b5df5 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -423,6 +423,8 @@ static acpi_status acpi_ev_remove_global_lock_handler(void)
423 * the global lock appear as a standard mutex on the OS side. 423 * the global lock appear as a standard mutex on the OS side.
424 * 424 *
425 *****************************************************************************/ 425 *****************************************************************************/
426static acpi_thread_id acpi_ev_global_lock_thread_id;
427static int acpi_ev_global_lock_acquired;
426 428
427acpi_status acpi_ev_acquire_global_lock(u16 timeout) 429acpi_status acpi_ev_acquire_global_lock(u16 timeout)
428{ 430{
@@ -435,11 +437,24 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
435 * Only one thread can acquire the GL at a time, the global_lock_mutex 437 * Only one thread can acquire the GL at a time, the global_lock_mutex
436 * enforces this. This interface releases the interpreter if we must wait. 438 * enforces this. This interface releases the interpreter if we must wait.
437 */ 439 */
438 status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, timeout); 440 status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, 0);
441 if (status == AE_TIME) {
442 if (acpi_ev_global_lock_thread_id == acpi_os_get_thread_id()) {
443 acpi_ev_global_lock_acquired++;
444 return AE_OK;
445 }
446 }
447
448 if (ACPI_FAILURE(status)) {
449 status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, timeout);
450 }
439 if (ACPI_FAILURE(status)) { 451 if (ACPI_FAILURE(status)) {
440 return_ACPI_STATUS(status); 452 return_ACPI_STATUS(status);
441 } 453 }
442 454
455 acpi_ev_global_lock_thread_id = acpi_os_get_thread_id();
456 acpi_ev_global_lock_acquired++;
457
443 /* 458 /*
444 * Make sure that a global lock actually exists. If not, just treat 459 * Make sure that a global lock actually exists. If not, just treat
445 * the lock as a standard mutex. 460 * the lock as a standard mutex.
@@ -506,6 +521,11 @@ acpi_status acpi_ev_release_global_lock(void)
506 return_ACPI_STATUS(AE_NOT_ACQUIRED); 521 return_ACPI_STATUS(AE_NOT_ACQUIRED);
507 } 522 }
508 523
524 acpi_ev_global_lock_acquired--;
525 if (acpi_ev_global_lock_acquired > 0) {
526 return AE_OK;
527 }
528
509 if (acpi_gbl_global_lock_present) { 529 if (acpi_gbl_global_lock_present) {
510 530
511 /* Allow any thread to release the lock */ 531 /* Allow any thread to release the lock */
@@ -529,7 +549,8 @@ acpi_status acpi_ev_release_global_lock(void)
529 acpi_gbl_global_lock_acquired = FALSE; 549 acpi_gbl_global_lock_acquired = FALSE;
530 550
531 /* Release the local GL mutex */ 551 /* Release the local GL mutex */
532 552 acpi_ev_global_lock_thread_id = NULL;
553 acpi_ev_global_lock_acquired = 0;
533 acpi_os_release_mutex(acpi_gbl_global_lock_mutex); 554 acpi_os_release_mutex(acpi_gbl_global_lock_mutex);
534 return_ACPI_STATUS(status); 555 return_ACPI_STATUS(status);
535} 556}
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 4cc534e36e81..36901362fd24 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -86,6 +86,7 @@
86 86
87#include <linux/proc_fs.h> 87#include <linux/proc_fs.h>
88#include <linux/backlight.h> 88#include <linux/backlight.h>
89#include <linux/fb.h>
89#include <asm/uaccess.h> 90#include <asm/uaccess.h>
90 91
91#include <linux/dmi.h> 92#include <linux/dmi.h>
@@ -157,6 +158,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
157 "\\_SB.PCI.ISA.SLCE", /* 570 */ 158 "\\_SB.PCI.ISA.SLCE", /* 570 */
158 ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ 159 ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */
159#endif 160#endif
161#ifdef CONFIG_ACPI_IBM_BAY
160IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ 162IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
161 "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ 163 "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
162 "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ 164 "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */
@@ -174,6 +176,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */
174IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ 176IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */
175 "_EJ0", /* 770x */ 177 "_EJ0", /* 770x */
176 ); /* all others */ 178 ); /* all others */
179#endif /* CONFIG_ACPI_IBM_BAY */
177 180
178/* don't list other alternatives as we install a notify handler on the 570 */ 181/* don't list other alternatives as we install a notify handler on the 570 */
179IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ 182IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */
@@ -1044,6 +1047,7 @@ static int light_write(char *buf)
1044 return 0; 1047 return 0;
1045} 1048}
1046 1049
1050#if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY)
1047static int _sta(acpi_handle handle) 1051static int _sta(acpi_handle handle)
1048{ 1052{
1049 int status; 1053 int status;
@@ -1053,6 +1057,7 @@ static int _sta(acpi_handle handle)
1053 1057
1054 return status; 1058 return status;
1055} 1059}
1060#endif
1056 1061
1057#ifdef CONFIG_ACPI_IBM_DOCK 1062#ifdef CONFIG_ACPI_IBM_DOCK
1058#define dock_docked() (_sta(dock_handle) & 1) 1063#define dock_docked() (_sta(dock_handle) & 1)
@@ -1119,6 +1124,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
1119} 1124}
1120#endif 1125#endif
1121 1126
1127#ifdef CONFIG_ACPI_IBM_BAY
1122static int bay_status_supported; 1128static int bay_status_supported;
1123static int bay_status2_supported; 1129static int bay_status2_supported;
1124static int bay_eject_supported; 1130static int bay_eject_supported;
@@ -1194,6 +1200,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event)
1194{ 1200{
1195 acpi_bus_generate_event(ibm->device, event, 0); 1201 acpi_bus_generate_event(ibm->device, event, 0);
1196} 1202}
1203#endif /* CONFIG_ACPI_IBM_BAY */
1197 1204
1198static int cmos_read(char *p) 1205static int cmos_read(char *p)
1199{ 1206{
@@ -1701,7 +1708,10 @@ static int brightness_write(char *buf)
1701 1708
1702static int brightness_update_status(struct backlight_device *bd) 1709static int brightness_update_status(struct backlight_device *bd)
1703{ 1710{
1704 return brightness_set(bd->props.brightness); 1711 return brightness_set(
1712 (bd->props.fb_blank == FB_BLANK_UNBLANK &&
1713 bd->props.power == FB_BLANK_UNBLANK) ?
1714 bd->props.brightness : 0);
1705} 1715}
1706 1716
1707static struct backlight_ops ibm_backlight_data = { 1717static struct backlight_ops ibm_backlight_data = {
@@ -1711,6 +1721,12 @@ static struct backlight_ops ibm_backlight_data = {
1711 1721
1712static int brightness_init(void) 1722static int brightness_init(void)
1713{ 1723{
1724 int b;
1725
1726 b = brightness_get(NULL);
1727 if (b < 0)
1728 return b;
1729
1714 ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, 1730 ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
1715 &ibm_backlight_data); 1731 &ibm_backlight_data);
1716 if (IS_ERR(ibm_backlight_device)) { 1732 if (IS_ERR(ibm_backlight_device)) {
@@ -1718,7 +1734,9 @@ static int brightness_init(void)
1718 return PTR_ERR(ibm_backlight_device); 1734 return PTR_ERR(ibm_backlight_device);
1719 } 1735 }
1720 1736
1721 ibm_backlight_device->props.max_brightness = 7; 1737 ibm_backlight_device->props.max_brightness = 7;
1738 ibm_backlight_device->props.brightness = b;
1739 backlight_update_status(ibm_backlight_device);
1722 1740
1723 return 0; 1741 return 0;
1724} 1742}
@@ -2353,6 +2371,7 @@ static struct ibm_struct ibms[] = {
2353 .type = ACPI_SYSTEM_NOTIFY, 2371 .type = ACPI_SYSTEM_NOTIFY,
2354 }, 2372 },
2355#endif 2373#endif
2374#ifdef CONFIG_ACPI_IBM_BAY
2356 { 2375 {
2357 .name = "bay", 2376 .name = "bay",
2358 .init = bay_init, 2377 .init = bay_init,
@@ -2362,6 +2381,7 @@ static struct ibm_struct ibms[] = {
2362 .handle = &bay_handle, 2381 .handle = &bay_handle,
2363 .type = ACPI_SYSTEM_NOTIFY, 2382 .type = ACPI_SYSTEM_NOTIFY,
2364 }, 2383 },
2384#endif /* CONFIG_ACPI_IBM_BAY */
2365 { 2385 {
2366 .name = "cmos", 2386 .name = "cmos",
2367 .read = cmos_read, 2387 .read = cmos_read,
@@ -2647,7 +2667,9 @@ IBM_PARAM(light);
2647#ifdef CONFIG_ACPI_IBM_DOCK 2667#ifdef CONFIG_ACPI_IBM_DOCK
2648IBM_PARAM(dock); 2668IBM_PARAM(dock);
2649#endif 2669#endif
2670#ifdef CONFIG_ACPI_IBM_BAY
2650IBM_PARAM(bay); 2671IBM_PARAM(bay);
2672#endif /* CONFIG_ACPI_IBM_BAY */
2651IBM_PARAM(cmos); 2673IBM_PARAM(cmos);
2652IBM_PARAM(led); 2674IBM_PARAM(led);
2653IBM_PARAM(beep); 2675IBM_PARAM(beep);
@@ -2723,12 +2745,14 @@ static int __init acpi_ibm_init(void)
2723 IBM_HANDLE_INIT(dock); 2745 IBM_HANDLE_INIT(dock);
2724#endif 2746#endif
2725 IBM_HANDLE_INIT(pci); 2747 IBM_HANDLE_INIT(pci);
2748#ifdef CONFIG_ACPI_IBM_BAY
2726 IBM_HANDLE_INIT(bay); 2749 IBM_HANDLE_INIT(bay);
2727 if (bay_handle) 2750 if (bay_handle)
2728 IBM_HANDLE_INIT(bay_ej); 2751 IBM_HANDLE_INIT(bay_ej);
2729 IBM_HANDLE_INIT(bay2); 2752 IBM_HANDLE_INIT(bay2);
2730 if (bay2_handle) 2753 if (bay2_handle)
2731 IBM_HANDLE_INIT(bay2_ej); 2754 IBM_HANDLE_INIT(bay2_ej);
2755#endif /* CONFIG_ACPI_IBM_BAY */
2732 IBM_HANDLE_INIT(beep); 2756 IBM_HANDLE_INIT(beep);
2733 IBM_HANDLE_INIT(ecrd); 2757 IBM_HANDLE_INIT(ecrd);
2734 IBM_HANDLE_INIT(ecwr); 2758 IBM_HANDLE_INIT(ecwr);
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 1ef338545dfe..4ffecd179702 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -436,8 +436,6 @@ int acpi_power_transition(struct acpi_device *device, int state)
436 cl = &device->power.states[device->power.state].resources; 436 cl = &device->power.states[device->power.state].resources;
437 tl = &device->power.states[state].resources; 437 tl = &device->power.states[state].resources;
438 438
439 device->power.state = ACPI_STATE_UNKNOWN;
440
441 if (!cl->count && !tl->count) { 439 if (!cl->count && !tl->count) {
442 result = -ENODEV; 440 result = -ENODEV;
443 goto end; 441 goto end;
@@ -468,12 +466,15 @@ int acpi_power_transition(struct acpi_device *device, int state)
468 goto end; 466 goto end;
469 } 467 }
470 468
471 /* We shouldn't change the state till all above operations succeed */ 469 end:
472 device->power.state = state; 470 if (result) {
473 end: 471 device->power.state = ACPI_STATE_UNKNOWN;
474 if (result)
475 printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", 472 printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n",
476 device->pnp.bus_id, state); 473 device->pnp.bus_id, state);
474 } else {
475 /* We shouldn't change the state till all above operations succeed */
476 device->power.state = state;
477 }
477 478
478 return result; 479 return result;
479} 480}
@@ -687,13 +688,6 @@ static int acpi_power_resume(struct acpi_device *device)
687 return result; 688 return result;
688 689
689 mutex_lock(&resource->resource_lock); 690 mutex_lock(&resource->resource_lock);
690 if ((resource->state == ACPI_POWER_RESOURCE_STATE_ON) &&
691 list_empty(&resource->reference)) {
692 mutex_unlock(&resource->resource_lock);
693 result = acpi_power_off_device(device->handle, NULL);
694 return result;
695 }
696
697 if ((resource->state == ACPI_POWER_RESOURCE_STATE_OFF) && 691 if ((resource->state == ACPI_POWER_RESOURCE_STATE_OFF) &&
698 !list_empty(&resource->reference)) { 692 !list_empty(&resource->reference)) {
699 ref = container_of(resource->reference.next, struct acpi_power_reference, node); 693 ref = container_of(resource->reference.next, struct acpi_power_reference, node);
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
index 1358c06a969c..cc48ab05676c 100644
--- a/drivers/acpi/resources/rscreate.c
+++ b/drivers/acpi/resources/rscreate.c
@@ -191,6 +191,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
191 user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); 191 user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
192 192
193 for (index = 0; index < number_of_elements; index++) { 193 for (index = 0; index < number_of_elements; index++) {
194 int source_name_index = 2;
195 int source_index_index = 3;
196
194 /* 197 /*
195 * Point user_prt past this current structure 198 * Point user_prt past this current structure
196 * 199 *
@@ -261,10 +264,28 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
261 } 264 }
262 265
263 /* 266 /*
267 * If BIOS erroneously reversed the _PRT source_name and source_index,
268 * then reverse them back.
269 */
270 if (ACPI_GET_OBJECT_TYPE (sub_object_list[3]) != ACPI_TYPE_INTEGER) {
271 if (acpi_gbl_enable_interpreter_slack) {
272 source_name_index = 3;
273 source_index_index = 2;
274 printk(KERN_WARNING "ACPI: Handling Garbled _PRT entry\n");
275 } else {
276 ACPI_ERROR((AE_INFO,
277 "(PRT[%X].source_index) Need Integer, found %s",
278 index,
279 acpi_ut_get_object_type_name(sub_object_list[3])));
280 return_ACPI_STATUS(AE_BAD_DATA);
281 }
282 }
283
284 /*
264 * 3) Third subobject: Dereference the PRT.source_name 285 * 3) Third subobject: Dereference the PRT.source_name
265 * The name may be unresolved (slack mode), so allow a null object 286 * The name may be unresolved (slack mode), so allow a null object
266 */ 287 */
267 obj_desc = sub_object_list[2]; 288 obj_desc = sub_object_list[source_name_index];
268 if (obj_desc) { 289 if (obj_desc) {
269 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { 290 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
270 case ACPI_TYPE_LOCAL_REFERENCE: 291 case ACPI_TYPE_LOCAL_REFERENCE:
@@ -339,7 +360,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
339 360
340 /* 4) Fourth subobject: Dereference the PRT.source_index */ 361 /* 4) Fourth subobject: Dereference the PRT.source_index */
341 362
342 obj_desc = sub_object_list[3]; 363 obj_desc = sub_object_list[source_index_index];
343 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 364 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
344 user_prt->source_index = (u32) obj_desc->integer.value; 365 user_prt->source_index = (u32) obj_desc->integer.value;
345 } else { 366 } else {
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 0771b434feb2..00d25b347255 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -102,9 +102,9 @@ struct acpi_video_bus_cap {
102 102
103struct acpi_video_device_attrib { 103struct acpi_video_device_attrib {
104 u32 display_index:4; /* A zero-based instance of the Display */ 104 u32 display_index:4; /* A zero-based instance of the Display */
105 u32 display_port_attachment:4; /*This field differenates displays type */ 105 u32 display_port_attachment:4; /*This field differentiates the display type */
106 u32 display_type:4; /*Describe the specific type in use */ 106 u32 display_type:4; /*Describe the specific type in use */
107 u32 vendor_specific:4; /*Chipset Vendor Specifi */ 107 u32 vendor_specific:4; /*Chipset Vendor Specific */
108 u32 bios_can_detect:1; /*BIOS can detect the device */ 108 u32 bios_can_detect:1; /*BIOS can detect the device */
109 u32 depend_on_vga:1; /*Non-VGA output device whose power is related to 109 u32 depend_on_vga:1; /*Non-VGA output device whose power is related to
110 the VGA device. */ 110 the VGA device. */
@@ -484,16 +484,16 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video,
484 * 0. The system BIOS should NOT automatically switch(toggle) 484 * 0. The system BIOS should NOT automatically switch(toggle)
485 * the active display output. 485 * the active display output.
486 * 1. The system BIOS should automatically switch (toggle) the 486 * 1. The system BIOS should automatically switch (toggle) the
487 * active display output. No swich event. 487 * active display output. No switch event.
488 * 2. The _DGS value should be locked. 488 * 2. The _DGS value should be locked.
489 * 3. The system BIOS should not automatically switch (toggle) the 489 * 3. The system BIOS should not automatically switch (toggle) the
490 * active display output, but instead generate the display switch 490 * active display output, but instead generate the display switch
491 * event notify code. 491 * event notify code.
492 * lcd_flag : 492 * lcd_flag :
493 * 0. The system BIOS should automatically control the brightness level 493 * 0. The system BIOS should automatically control the brightness level
494 * of the LCD, when the power changes from AC to DC 494 * of the LCD when the power changes from AC to DC
495 * 1. The system BIOS should NOT automatically control the brightness 495 * 1. The system BIOS should NOT automatically control the brightness
496 * level of the LCD, when the power changes from AC to DC. 496 * level of the LCD when the power changes from AC to DC.
497 * Return Value: 497 * Return Value:
498 * -1 wrong arg. 498 * -1 wrong arg.
499 */ 499 */
@@ -525,7 +525,7 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
525 * Return Value: 525 * Return Value:
526 * None 526 * None
527 * 527 *
528 * Find out all required AML method defined under the output 528 * Find out all required AML methods defined under the output
529 * device. 529 * device.
530 */ 530 */
531 531
@@ -636,7 +636,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
636 * Return Value: 636 * Return Value:
637 * None 637 * None
638 * 638 *
639 * Find out all required AML method defined under the video bus device. 639 * Find out all required AML methods defined under the video bus device.
640 */ 640 */
641 641
642static void acpi_video_bus_find_cap(struct acpi_video_bus *video) 642static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
@@ -681,19 +681,19 @@ static int acpi_video_bus_check(struct acpi_video_bus *video)
681 * to check well known required nodes. 681 * to check well known required nodes.
682 */ 682 */
683 683
684 /* Does this device able to support video switching ? */ 684 /* Does this device support video switching? */
685 if (video->cap._DOS) { 685 if (video->cap._DOS) {
686 video->flags.multihead = 1; 686 video->flags.multihead = 1;
687 status = 0; 687 status = 0;
688 } 688 }
689 689
690 /* Does this device able to retrieve a retrieve a video ROM ? */ 690 /* Does this device support retrieving a video ROM? */
691 if (video->cap._ROM) { 691 if (video->cap._ROM) {
692 video->flags.rom = 1; 692 video->flags.rom = 1;
693 status = 0; 693 status = 0;
694 } 694 }
695 695
696 /* Does this device able to configure which video device to POST ? */ 696 /* Does this device support configuring which video device to POST? */
697 if (video->cap._GPD && video->cap._SPD && video->cap._VPO) { 697 if (video->cap._GPD && video->cap._SPD && video->cap._VPO) {
698 video->flags.post = 1; 698 video->flags.post = 1;
699 status = 0; 699 status = 0;
@@ -860,7 +860,7 @@ acpi_video_device_write_brightness(struct file *file,
860 if (level > 100) 860 if (level > 100)
861 return -EFAULT; 861 return -EFAULT;
862 862
863 /* validate though the list of available levels */ 863 /* validate through the list of available levels */
864 for (i = 0; i < dev->brightness->count; i++) 864 for (i = 0; i < dev->brightness->count; i++)
865 if (level == dev->brightness->levels[i]) { 865 if (level == dev->brightness->levels[i]) {
866 if (ACPI_SUCCESS 866 if (ACPI_SUCCESS
@@ -1065,10 +1065,10 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
1065 printk(KERN_WARNING PREFIX 1065 printk(KERN_WARNING PREFIX
1066 "The motherboard VGA device is not listed as a possible POST device.\n"); 1066 "The motherboard VGA device is not listed as a possible POST device.\n");
1067 printk(KERN_WARNING PREFIX 1067 printk(KERN_WARNING PREFIX
1068 "This indicate a BIOS bug. Please contact the manufacturer.\n"); 1068 "This indicates a BIOS bug. Please contact the manufacturer.\n");
1069 } 1069 }
1070 printk("%lx\n", options); 1070 printk("%lx\n", options);
1071 seq_printf(seq, "can POST: <intgrated video>"); 1071 seq_printf(seq, "can POST: <integrated video>");
1072 if (options & 2) 1072 if (options & 2)
1073 seq_printf(seq, " <PCI video>"); 1073 seq_printf(seq, " <PCI video>");
1074 if (options & 4) 1074 if (options & 4)
@@ -1102,7 +1102,7 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset)
1102 seq_printf(seq, "<not supported>\n"); 1102 seq_printf(seq, "<not supported>\n");
1103 goto end; 1103 goto end;
1104 } 1104 }
1105 seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]); 1105 seq_printf(seq, "device POSTed is <%s>\n", device_decode[id & 3]);
1106 1106
1107 end: 1107 end:
1108 return 0; 1108 return 0;
@@ -1156,7 +1156,7 @@ acpi_video_bus_write_POST(struct file *file,
1156 if (opt > 3) 1156 if (opt > 3)
1157 return -EFAULT; 1157 return -EFAULT;
1158 1158
1159 /* just in case an OEM 'forget' the motherboard... */ 1159 /* just in case an OEM 'forgot' the motherboard... */
1160 options |= 1; 1160 options |= 1;
1161 1161
1162 if (options & (1ul << opt)) { 1162 if (options & (1ul << opt)) {
@@ -1527,13 +1527,13 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
1527/* 1527/*
1528 * Arg: 1528 * Arg:
1529 * video : video bus device 1529 * video : video bus device
1530 * event : Nontify Event 1530 * event : notify event
1531 * 1531 *
1532 * Return: 1532 * Return:
1533 * < 0 : error 1533 * < 0 : error
1534 * 1534 *
1535 * 1. Find out the current active output device. 1535 * 1. Find out the current active output device.
1536 * 2. Identify the next output device to switch 1536 * 2. Identify the next output device to switch to.
1537 * 3. call _DSS to do actual switch. 1537 * 3. call _DSS to do actual switch.
1538 */ 1538 */
1539 1539
@@ -1723,12 +1723,12 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
1723 device = video->device; 1723 device = video->device;
1724 1724
1725 switch (event) { 1725 switch (event) {
1726 case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, 1726 case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch,
1727 * most likely via hotkey. */ 1727 * most likely via hotkey. */
1728 acpi_bus_generate_event(device, event, 0); 1728 acpi_bus_generate_event(device, event, 0);
1729 break; 1729 break;
1730 1730
1731 case ACPI_VIDEO_NOTIFY_PROBE: /* User plug or remove a video 1731 case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video
1732 * connector. */ 1732 * connector. */
1733 acpi_video_device_enumerate(video); 1733 acpi_video_device_enumerate(video);
1734 acpi_video_device_rebind(video); 1734 acpi_video_device_rebind(video);
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 43cc43d7b591..dc7b56225923 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -389,6 +389,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
389 { PCI_VDEVICE(INTEL, 0x2929), board_ahci_pi }, /* ICH9M */ 389 { PCI_VDEVICE(INTEL, 0x2929), board_ahci_pi }, /* ICH9M */
390 { PCI_VDEVICE(INTEL, 0x292a), board_ahci_pi }, /* ICH9M */ 390 { PCI_VDEVICE(INTEL, 0x292a), board_ahci_pi }, /* ICH9M */
391 { PCI_VDEVICE(INTEL, 0x292b), board_ahci_pi }, /* ICH9M */ 391 { PCI_VDEVICE(INTEL, 0x292b), board_ahci_pi }, /* ICH9M */
392 { PCI_VDEVICE(INTEL, 0x292c), board_ahci_pi }, /* ICH9M */
392 { PCI_VDEVICE(INTEL, 0x292f), board_ahci_pi }, /* ICH9M */ 393 { PCI_VDEVICE(INTEL, 0x292f), board_ahci_pi }, /* ICH9M */
393 { PCI_VDEVICE(INTEL, 0x294d), board_ahci_pi }, /* ICH9 */ 394 { PCI_VDEVICE(INTEL, 0x294d), board_ahci_pi }, /* ICH9 */
394 { PCI_VDEVICE(INTEL, 0x294e), board_ahci_pi }, /* ICH9M */ 395 { PCI_VDEVICE(INTEL, 0x294e), board_ahci_pi }, /* ICH9M */
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index dc42ba1b46f7..b952c584338f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -93,7 +93,7 @@
93#include <linux/libata.h> 93#include <linux/libata.h>
94 94
95#define DRV_NAME "ata_piix" 95#define DRV_NAME "ata_piix"
96#define DRV_VERSION "2.10" 96#define DRV_VERSION "2.10ac1"
97 97
98enum { 98enum {
99 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ 99 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */
@@ -667,14 +667,9 @@ static int ich_pata_prereset(struct ata_port *ap)
667{ 667{
668 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 668 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
669 669
670 if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no])) { 670 if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
671 ata_port_printk(ap, KERN_INFO, "port disabled. ignoring.\n"); 671 return -ENOENT;
672 ap->eh_context.i.action &= ~ATA_EH_RESET_MASK;
673 return 0;
674 }
675
676 ich_pata_cbl_detect(ap); 672 ich_pata_cbl_detect(ap);
677
678 return ata_std_prereset(ap); 673 return ata_std_prereset(ap);
679} 674}
680 675
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index d14a48e75f1b..c428a56e6f31 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -34,6 +34,13 @@ struct taskfile_array {
34 u8 tfa[REGS_PER_GTF]; /* regs. 0x1f1 - 0x1f7 */ 34 u8 tfa[REGS_PER_GTF]; /* regs. 0x1f1 - 0x1f7 */
35}; 35};
36 36
37/*
38 * Helper - belongs in the PCI layer somewhere eventually
39 */
40static int is_pci_dev(struct device *dev)
41{
42 return (dev->bus == &pci_bus_type);
43}
37 44
38/** 45/**
39 * sata_get_dev_handle - finds acpi_handle and PCI device.function 46 * sata_get_dev_handle - finds acpi_handle and PCI device.function
@@ -53,6 +60,9 @@ static int sata_get_dev_handle(struct device *dev, acpi_handle *handle,
53 struct pci_dev *pci_dev; 60 struct pci_dev *pci_dev;
54 acpi_integer addr; 61 acpi_integer addr;
55 62
63 if (!is_pci_dev(dev))
64 return -ENODEV;
65
56 pci_dev = to_pci_dev(dev); /* NOTE: PCI-specific */ 66 pci_dev = to_pci_dev(dev); /* NOTE: PCI-specific */
57 /* Please refer to the ACPI spec for the syntax of _ADR. */ 67 /* Please refer to the ACPI spec for the syntax of _ADR. */
58 addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn); 68 addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
@@ -84,7 +94,12 @@ static int pata_get_dev_handle(struct device *dev, acpi_handle *handle,
84 acpi_status status; 94 acpi_status status;
85 struct acpi_device_info *dinfo = NULL; 95 struct acpi_device_info *dinfo = NULL;
86 int ret = -ENODEV; 96 int ret = -ENODEV;
87 struct pci_dev *pdev = to_pci_dev(dev); 97 struct pci_dev *pdev;
98
99 if (!is_pci_dev(dev))
100 return -ENODEV;
101
102 pdev = to_pci_dev(dev);
88 103
89 bus = pdev->bus->number; 104 bus = pdev->bus->number;
90 devnum = PCI_SLOT(pdev->devfn); 105 devnum = PCI_SLOT(pdev->devfn);
@@ -561,6 +576,13 @@ int ata_acpi_exec_tfs(struct ata_port *ap)
561 576
562 if (noacpi) 577 if (noacpi)
563 return 0; 578 return 0;
579 /*
580 * TBD - implement PATA support. For now,
581 * we should not run GTF on PATA devices since some
582 * PATA require execution of GTM/STM before GTF.
583 */
584 if (!(ap->cbl == ATA_CBL_SATA))
585 return 0;
564 586
565 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { 587 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {
566 if (!ata_dev_enabled(&ap->device[ix])) 588 if (!ata_dev_enabled(&ap->device[ix]))
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index dc362fa01ca4..3c1f8830ac8b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3455,7 +3455,8 @@ static void ata_dev_xfermask(struct ata_device *dev)
3455 "device is on DMA blacklist, disabling DMA\n"); 3455 "device is on DMA blacklist, disabling DMA\n");
3456 } 3456 }
3457 3457
3458 if ((host->flags & ATA_HOST_SIMPLEX) && host->simplex_claimed != ap) { 3458 if ((host->flags & ATA_HOST_SIMPLEX) &&
3459 host->simplex_claimed && host->simplex_claimed != ap) {
3459 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 3460 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
3460 ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " 3461 ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by "
3461 "other device, disabling DMA\n"); 3462 "other device, disabling DMA\n");
@@ -5684,18 +5685,22 @@ static void ata_host_release(struct device *gendev, void *res)
5684 for (i = 0; i < host->n_ports; i++) { 5685 for (i = 0; i < host->n_ports; i++) {
5685 struct ata_port *ap = host->ports[i]; 5686 struct ata_port *ap = host->ports[i];
5686 5687
5687 if (!ap) 5688 if (ap && ap->ops->port_stop)
5688 continue;
5689
5690 if (ap->ops->port_stop)
5691 ap->ops->port_stop(ap); 5689 ap->ops->port_stop(ap);
5692
5693 scsi_host_put(ap->scsi_host);
5694 } 5690 }
5695 5691
5696 if (host->ops->host_stop) 5692 if (host->ops->host_stop)
5697 host->ops->host_stop(host); 5693 host->ops->host_stop(host);
5698 5694
5695 for (i = 0; i < host->n_ports; i++) {
5696 struct ata_port *ap = host->ports[i];
5697
5698 if (ap)
5699 scsi_host_put(ap->scsi_host);
5700
5701 host->ports[i] = NULL;
5702 }
5703
5699 dev_set_drvdata(gendev, NULL); 5704 dev_set_drvdata(gendev, NULL);
5700} 5705}
5701 5706
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 7ef834250a43..55cc293e7487 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -208,7 +208,7 @@ static struct ata_port_operations cs5520_port_ops = {
208static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) 208static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
209{ 209{
210 u8 pcicfg; 210 u8 pcicfg;
211 void *iomap[5]; 211 void __iomem *iomap[5];
212 static struct ata_probe_ent probe[2]; 212 static struct ata_probe_ent probe[2];
213 int ports = 0; 213 int ports = 0;
214 214
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index fc5b73d78e00..86fbcd6a742b 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -69,7 +69,7 @@
69#define NR_HOST 6 69#define NR_HOST 6
70 70
71static int legacy_port[NR_HOST] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 }; 71static int legacy_port[NR_HOST] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
72static int legacy_irq[NR_HOST] = { 15, 14, 11, 10, 8, 12 }; 72static int legacy_irq[NR_HOST] = { 14, 15, 11, 10, 8, 12 };
73 73
74struct legacy_data { 74struct legacy_data {
75 unsigned long timing; 75 unsigned long timing;
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index f5d88729ca79..882c36eaf293 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -329,7 +329,7 @@ mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv)
329 ae->dev = dev; 329 ae->dev = dev;
330 ae->irq = priv->ata_irq; 330 ae->irq = priv->ata_irq;
331 331
332 aio->cmd_addr = 0; /* Don't have a classic reg block */ 332 aio->cmd_addr = NULL; /* Don't have a classic reg block */
333 aio->altstatus_addr = &priv->ata_regs->tf_control; 333 aio->altstatus_addr = &priv->ata_regs->tf_control;
334 aio->ctl_addr = &priv->ata_regs->tf_control; 334 aio->ctl_addr = &priv->ata_regs->tf_control;
335 aio->data_addr = &priv->ata_regs->tf_data; 335 aio->data_addr = &priv->ata_regs->tf_data;
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 3fb417780166..acdc52cbe38a 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -2,13 +2,14 @@
2 * pata_pdc202xx_old.c - Promise PDC202xx PATA for new ATA layer 2 * pata_pdc202xx_old.c - Promise PDC202xx PATA for new ATA layer
3 * (C) 2005 Red Hat Inc 3 * (C) 2005 Red Hat Inc
4 * Alan Cox <alan@redhat.com> 4 * Alan Cox <alan@redhat.com>
5 * (C) 2007 Bartlomiej Zolnierkiewicz
5 * 6 *
6 * Based in part on linux/drivers/ide/pci/pdc202xx_old.c 7 * Based in part on linux/drivers/ide/pci/pdc202xx_old.c
7 * 8 *
8 * First cut with LBA48/ATAPI 9 * First cut with LBA48/ATAPI
9 * 10 *
10 * TODO: 11 * TODO:
11 * Channel interlock/reset on both required ? 12 * Channel interlock/reset on both required
12 */ 13 */
13 14
14#include <linux/kernel.h> 15#include <linux/kernel.h>
@@ -21,7 +22,7 @@
21#include <linux/libata.h> 22#include <linux/libata.h>
22 23
23#define DRV_NAME "pata_pdc202xx_old" 24#define DRV_NAME "pata_pdc202xx_old"
24#define DRV_VERSION "0.3.0" 25#define DRV_VERSION "0.4.0"
25 26
26/** 27/**
27 * pdc2024x_pre_reset - probe begin 28 * pdc2024x_pre_reset - probe begin
@@ -76,7 +77,7 @@ static void pdc2026x_error_handler(struct ata_port *ap)
76static void pdc202xx_configure_piomode(struct ata_port *ap, struct ata_device *adev, int pio) 77static void pdc202xx_configure_piomode(struct ata_port *ap, struct ata_device *adev, int pio)
77{ 78{
78 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 79 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
79 int port = 0x60 + 4 * ap->port_no + 2 * adev->devno; 80 int port = 0x60 + 8 * ap->port_no + 4 * adev->devno;
80 static u16 pio_timing[5] = { 81 static u16 pio_timing[5] = {
81 0x0913, 0x050C , 0x0308, 0x0206, 0x0104 82 0x0913, 0x050C , 0x0308, 0x0206, 0x0104
82 }; 83 };
@@ -85,7 +86,7 @@ static void pdc202xx_configure_piomode(struct ata_port *ap, struct ata_device *a
85 pci_read_config_byte(pdev, port, &r_ap); 86 pci_read_config_byte(pdev, port, &r_ap);
86 pci_read_config_byte(pdev, port + 1, &r_bp); 87 pci_read_config_byte(pdev, port + 1, &r_bp);
87 r_ap &= ~0x3F; /* Preserve ERRDY_EN, SYNC_IN */ 88 r_ap &= ~0x3F; /* Preserve ERRDY_EN, SYNC_IN */
88 r_bp &= ~0x07; 89 r_bp &= ~0x1F;
89 r_ap |= (pio_timing[pio] >> 8); 90 r_ap |= (pio_timing[pio] >> 8);
90 r_bp |= (pio_timing[pio] & 0xFF); 91 r_bp |= (pio_timing[pio] & 0xFF);
91 92
@@ -123,7 +124,7 @@ static void pdc202xx_set_piomode(struct ata_port *ap, struct ata_device *adev)
123static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev) 124static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
124{ 125{
125 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 126 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
126 int port = 0x60 + 4 * ap->port_no + 2 * adev->devno; 127 int port = 0x60 + 8 * ap->port_no + 4 * adev->devno;
127 static u8 udma_timing[6][2] = { 128 static u8 udma_timing[6][2] = {
128 { 0x60, 0x03 }, /* 33 Mhz Clock */ 129 { 0x60, 0x03 }, /* 33 Mhz Clock */
129 { 0x40, 0x02 }, 130 { 0x40, 0x02 },
@@ -132,12 +133,17 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
132 { 0x20, 0x01 }, 133 { 0x20, 0x01 },
133 { 0x20, 0x01 } 134 { 0x20, 0x01 }
134 }; 135 };
136 static u8 mdma_timing[3][2] = {
137 { 0x60, 0x03 },
138 { 0x60, 0x04 },
139 { 0xe0, 0x0f },
140 };
135 u8 r_bp, r_cp; 141 u8 r_bp, r_cp;
136 142
137 pci_read_config_byte(pdev, port + 1, &r_bp); 143 pci_read_config_byte(pdev, port + 1, &r_bp);
138 pci_read_config_byte(pdev, port + 2, &r_cp); 144 pci_read_config_byte(pdev, port + 2, &r_cp);
139 145
140 r_bp &= ~0xF0; 146 r_bp &= ~0xE0;
141 r_cp &= ~0x0F; 147 r_cp &= ~0x0F;
142 148
143 if (adev->dma_mode >= XFER_UDMA_0) { 149 if (adev->dma_mode >= XFER_UDMA_0) {
@@ -147,8 +153,8 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
147 153
148 } else { 154 } else {
149 int speed = adev->dma_mode - XFER_MW_DMA_0; 155 int speed = adev->dma_mode - XFER_MW_DMA_0;
150 r_bp |= 0x60; 156 r_bp |= mdma_timing[speed][0];
151 r_cp |= (5 - speed); 157 r_cp |= mdma_timing[speed][1];
152 } 158 }
153 pci_write_config_byte(pdev, port + 1, r_bp); 159 pci_write_config_byte(pdev, port + 1, r_bp);
154 pci_write_config_byte(pdev, port + 2, r_cp); 160 pci_write_config_byte(pdev, port + 2, r_cp);
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 388d07fab5f7..9d9670a9b117 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -874,8 +874,14 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
874 874
875 if (status & (NV_ADMA_STAT_DONE | 875 if (status & (NV_ADMA_STAT_DONE |
876 NV_ADMA_STAT_CPBERR)) { 876 NV_ADMA_STAT_CPBERR)) {
877 u32 check_commands = notifier | notifier_error; 877 u32 check_commands;
878 int pos, error = 0; 878 int pos, error = 0;
879
880 if(ata_tag_valid(ap->active_tag))
881 check_commands = 1 << ap->active_tag;
882 else
883 check_commands = ap->sactive;
884
879 /** Check CPBs for completed commands */ 885 /** Check CPBs for completed commands */
880 while ((pos = ffs(check_commands)) && !error) { 886 while ((pos = ffs(check_commands)) && !error) {
881 pos--; 887 pos--;
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 1879e0cd56aa..a787f0d4a5ba 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -354,7 +354,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
354 return -ENOMEM; 354 return -ENOMEM;
355 355
356 if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) { 356 if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) {
357 void *mmio; 357 void __iomem *mmio;
358 358
359 mmio = pcim_iomap(pdev, SIS_SCR_PCI_BAR, 0); 359 mmio = pcim_iomap(pdev, SIS_SCR_PCI_BAR, 0);
360 if (!mmio) 360 if (!mmio)
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 0d7091e2077f..2ad2527cf5b3 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -1177,7 +1177,7 @@ static void __devinit eprom_get_esi(struct atm_dev *dev)
1177/*--------------------------------- entries ---------------------------------*/ 1177/*--------------------------------- entries ---------------------------------*/
1178 1178
1179 1179
1180static int __init zatm_init(struct atm_dev *dev) 1180static int __devinit zatm_init(struct atm_dev *dev)
1181{ 1181{
1182 struct zatm_dev *zatm_dev; 1182 struct zatm_dev *zatm_dev;
1183 struct pci_dev *pci_dev; 1183 struct pci_dev *pci_dev;
@@ -1256,7 +1256,7 @@ static int __init zatm_init(struct atm_dev *dev)
1256} 1256}
1257 1257
1258 1258
1259static int __init zatm_start(struct atm_dev *dev) 1259static int __devinit zatm_start(struct atm_dev *dev)
1260{ 1260{
1261 struct zatm_dev *zatm_dev = ZATM_DEV(dev); 1261 struct zatm_dev *zatm_dev = ZATM_DEV(dev);
1262 struct pci_dev *pdev = zatm_dev->pci_dev; 1262 struct pci_dev *pdev = zatm_dev->pci_dev;
diff --git a/drivers/base/core.c b/drivers/base/core.c
index cf2a398aaaa1..f191afe62b4d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -584,17 +584,17 @@ int device_add(struct device *dev)
584 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 584 if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
585 sysfs_create_link(&dev->class->subsys.kset.kobj, 585 sysfs_create_link(&dev->class->subsys.kset.kobj,
586 &dev->kobj, dev->bus_id); 586 &dev->kobj, dev->bus_id);
587#ifdef CONFIG_SYSFS_DEPRECATED
588 if (parent) { 587 if (parent) {
589 sysfs_create_link(&dev->kobj, &dev->parent->kobj, 588 sysfs_create_link(&dev->kobj, &dev->parent->kobj,
590 "device"); 589 "device");
590#ifdef CONFIG_SYSFS_DEPRECATED
591 class_name = make_class_name(dev->class->name, 591 class_name = make_class_name(dev->class->name,
592 &dev->kobj); 592 &dev->kobj);
593 if (class_name) 593 if (class_name)
594 sysfs_create_link(&dev->parent->kobj, 594 sysfs_create_link(&dev->parent->kobj,
595 &dev->kobj, class_name); 595 &dev->kobj, class_name);
596 }
597#endif 596#endif
597 }
598 } 598 }
599 599
600 if ((error = device_add_attrs(dev))) 600 if ((error = device_add_attrs(dev)))
@@ -651,17 +651,17 @@ int device_add(struct device *dev)
651 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 651 if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
652 sysfs_remove_link(&dev->class->subsys.kset.kobj, 652 sysfs_remove_link(&dev->class->subsys.kset.kobj,
653 dev->bus_id); 653 dev->bus_id);
654#ifdef CONFIG_SYSFS_DEPRECATED
655 if (parent) { 654 if (parent) {
655#ifdef CONFIG_SYSFS_DEPRECATED
656 char *class_name = make_class_name(dev->class->name, 656 char *class_name = make_class_name(dev->class->name,
657 &dev->kobj); 657 &dev->kobj);
658 if (class_name) 658 if (class_name)
659 sysfs_remove_link(&dev->parent->kobj, 659 sysfs_remove_link(&dev->parent->kobj,
660 class_name); 660 class_name);
661 kfree(class_name); 661 kfree(class_name);
662#endif
662 sysfs_remove_link(&dev->kobj, "device"); 663 sysfs_remove_link(&dev->kobj, "device");
663 } 664 }
664#endif
665 665
666 down(&dev->class->sem); 666 down(&dev->class->sem);
667 /* notify any interfaces that the device is now gone */ 667 /* notify any interfaces that the device is now gone */
@@ -761,17 +761,17 @@ void device_del(struct device * dev)
761 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 761 if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
762 sysfs_remove_link(&dev->class->subsys.kset.kobj, 762 sysfs_remove_link(&dev->class->subsys.kset.kobj,
763 dev->bus_id); 763 dev->bus_id);
764#ifdef CONFIG_SYSFS_DEPRECATED
765 if (parent) { 764 if (parent) {
765#ifdef CONFIG_SYSFS_DEPRECATED
766 char *class_name = make_class_name(dev->class->name, 766 char *class_name = make_class_name(dev->class->name,
767 &dev->kobj); 767 &dev->kobj);
768 if (class_name) 768 if (class_name)
769 sysfs_remove_link(&dev->parent->kobj, 769 sysfs_remove_link(&dev->parent->kobj,
770 class_name); 770 class_name);
771 kfree(class_name); 771 kfree(class_name);
772#endif
772 sysfs_remove_link(&dev->kobj, "device"); 773 sysfs_remove_link(&dev->kobj, "device");
773 } 774 }
774#endif
775 775
776 down(&dev->class->sem); 776 down(&dev->class->sem);
777 /* notify any interfaces that the device is now gone */ 777 /* notify any interfaces that the device is now gone */
@@ -787,6 +787,13 @@ void device_del(struct device * dev)
787 device_remove_attrs(dev); 787 device_remove_attrs(dev);
788 bus_remove_device(dev); 788 bus_remove_device(dev);
789 789
790 /*
791 * Some platform devices are driven without driver attached
792 * and managed resources may have been acquired. Make sure
793 * all resources are released.
794 */
795 devres_release_all(dev);
796
790 /* Notify the platform of the removal, in case they 797 /* Notify the platform of the removal, in case they
791 * need to do anything... 798 * need to do anything...
792 */ 799 */
@@ -1058,14 +1065,14 @@ int device_rename(struct device *dev, char *new_name)
1058 1065
1059 return error; 1066 return error;
1060} 1067}
1061 1068EXPORT_SYMBOL_GPL(device_rename);
1062 1069
1063static int device_move_class_links(struct device *dev, 1070static int device_move_class_links(struct device *dev,
1064 struct device *old_parent, 1071 struct device *old_parent,
1065 struct device *new_parent) 1072 struct device *new_parent)
1066{ 1073{
1074 int error = 0;
1067#ifdef CONFIG_SYSFS_DEPRECATED 1075#ifdef CONFIG_SYSFS_DEPRECATED
1068 int error;
1069 char *class_name; 1076 char *class_name;
1070 1077
1071 class_name = make_class_name(dev->class->name, &dev->kobj); 1078 class_name = make_class_name(dev->class->name, &dev->kobj);
@@ -1093,7 +1100,12 @@ out:
1093 kfree(class_name); 1100 kfree(class_name);
1094 return error; 1101 return error;
1095#else 1102#else
1096 return 0; 1103 if (old_parent)
1104 sysfs_remove_link(&dev->kobj, "device");
1105 if (new_parent)
1106 error = sysfs_create_link(&dev->kobj, &new_parent->kobj,
1107 "device");
1108 return error;
1097#endif 1109#endif
1098} 1110}
1099 1111
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index cacb1c816e35..17ee97f3a99b 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -406,22 +406,6 @@ config BLK_DEV_RAM_BLOCKSIZE
406 setups function - apparently needed by the rd_load_image routine 406 setups function - apparently needed by the rd_load_image routine
407 that supposes the filesystem in the image uses a 1024 blocksize. 407 that supposes the filesystem in the image uses a 1024 blocksize.
408 408
409config BLK_DEV_INITRD
410 bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
411 depends on BROKEN || !FRV
412 help
413 The initial RAM filesystem is a ramfs which is loaded by the
414 boot loader (loadlin or lilo) and that is mounted as root
415 before the normal boot procedure. It is typically used to
416 load modules needed to mount the "real" root file system,
417 etc. See <file:Documentation/initrd.txt> for details.
418
419 If RAM disk support (BLK_DEV_RAM) is also included, this
420 also enables initial RAM disk (initrd) support and adds
421 15 Kbytes (more on some other architectures) to the kernel size.
422
423 If unsure say Y.
424
425config CDROM_PKTCDVD 409config CDROM_PKTCDVD
426 tristate "Packet writing on CD/DVD media" 410 tristate "Packet writing on CD/DVD media"
427 depends on !UML 411 depends on !UML
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 05dfe357527c..072e18e6d76d 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1291,13 +1291,19 @@ static void cciss_update_drive_info(int ctlr, int drv_index)
1291 if (inq_buff == NULL) 1291 if (inq_buff == NULL)
1292 goto mem_msg; 1292 goto mem_msg;
1293 1293
1294 /* testing to see if 16-byte CDBs are already being used */
1295 if (h->cciss_read == CCISS_READ_16) {
1296 cciss_read_capacity_16(h->ctlr, drv_index, 1,
1297 &total_size, &block_size);
1298 goto geo_inq;
1299 }
1300
1294 cciss_read_capacity(ctlr, drv_index, 1, 1301 cciss_read_capacity(ctlr, drv_index, 1,
1295 &total_size, &block_size); 1302 &total_size, &block_size);
1296 1303
1297 /* total size = last LBA + 1 */ 1304 /* if read_capacity returns all F's this volume is >2TB in size */
1298 /* FFFFFFFF + 1 = 0, cannot have a logical volume of size 0 */ 1305 /* so we switch to 16-byte CDB's for all read/write ops */
1299 /* so we assume this volume this must be >2TB in size */ 1306 if (total_size == 0xFFFFFFFFULL) {
1300 if (total_size == (__u32) 0) {
1301 cciss_read_capacity_16(ctlr, drv_index, 1, 1307 cciss_read_capacity_16(ctlr, drv_index, 1,
1302 &total_size, &block_size); 1308 &total_size, &block_size);
1303 h->cciss_read = CCISS_READ_16; 1309 h->cciss_read = CCISS_READ_16;
@@ -1306,6 +1312,7 @@ static void cciss_update_drive_info(int ctlr, int drv_index)
1306 h->cciss_read = CCISS_READ_10; 1312 h->cciss_read = CCISS_READ_10;
1307 h->cciss_write = CCISS_WRITE_10; 1313 h->cciss_write = CCISS_WRITE_10;
1308 } 1314 }
1315geo_inq:
1309 cciss_geometry_inquiry(ctlr, drv_index, 1, total_size, block_size, 1316 cciss_geometry_inquiry(ctlr, drv_index, 1, total_size, block_size,
1310 inq_buff, &h->drv[drv_index]); 1317 inq_buff, &h->drv[drv_index]);
1311 1318
@@ -1432,7 +1439,7 @@ static int rebuild_lun_table(ctlr_info_t *h, struct gendisk *del_disk)
1432 1439
1433 if (return_code == IO_OK) { 1440 if (return_code == IO_OK) {
1434 listlength = 1441 listlength =
1435 be32_to_cpu(*(__u32 *) ld_buff->LUNListLength); 1442 be32_to_cpu(*(__be32 *) ld_buff->LUNListLength);
1436 } else { /* reading number of logical volumes failed */ 1443 } else { /* reading number of logical volumes failed */
1437 printk(KERN_WARNING "cciss: report logical volume" 1444 printk(KERN_WARNING "cciss: report logical volume"
1438 " command failed\n"); 1445 " command failed\n");
@@ -1917,13 +1924,14 @@ static void cciss_geometry_inquiry(int ctlr, int logvol,
1917 drv->raid_level = inq_buff->data_byte[8]; 1924 drv->raid_level = inq_buff->data_byte[8];
1918 } 1925 }
1919 drv->block_size = block_size; 1926 drv->block_size = block_size;
1920 drv->nr_blocks = total_size; 1927 drv->nr_blocks = total_size + 1;
1921 t = drv->heads * drv->sectors; 1928 t = drv->heads * drv->sectors;
1922 if (t > 1) { 1929 if (t > 1) {
1923 unsigned rem = sector_div(total_size, t); 1930 sector_t real_size = total_size + 1;
1931 unsigned long rem = sector_div(real_size, t);
1924 if (rem) 1932 if (rem)
1925 total_size++; 1933 real_size++;
1926 drv->cylinders = total_size; 1934 drv->cylinders = real_size;
1927 } 1935 }
1928 } else { /* Get geometry failed */ 1936 } else { /* Get geometry failed */
1929 printk(KERN_WARNING "cciss: reading geometry failed\n"); 1937 printk(KERN_WARNING "cciss: reading geometry failed\n");
@@ -1953,16 +1961,16 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size,
1953 ctlr, buf, sizeof(ReadCapdata_struct), 1961 ctlr, buf, sizeof(ReadCapdata_struct),
1954 1, logvol, 0, NULL, TYPE_CMD); 1962 1, logvol, 0, NULL, TYPE_CMD);
1955 if (return_code == IO_OK) { 1963 if (return_code == IO_OK) {
1956 *total_size = be32_to_cpu(*(__u32 *) buf->total_size)+1; 1964 *total_size = be32_to_cpu(*(__be32 *) buf->total_size);
1957 *block_size = be32_to_cpu(*(__u32 *) buf->block_size); 1965 *block_size = be32_to_cpu(*(__be32 *) buf->block_size);
1958 } else { /* read capacity command failed */ 1966 } else { /* read capacity command failed */
1959 printk(KERN_WARNING "cciss: read capacity failed\n"); 1967 printk(KERN_WARNING "cciss: read capacity failed\n");
1960 *total_size = 0; 1968 *total_size = 0;
1961 *block_size = BLOCK_SIZE; 1969 *block_size = BLOCK_SIZE;
1962 } 1970 }
1963 if (*total_size != (__u32) 0) 1971 if (*total_size != 0)
1964 printk(KERN_INFO " blocks= %llu block_size= %d\n", 1972 printk(KERN_INFO " blocks= %llu block_size= %d\n",
1965 (unsigned long long)*total_size, *block_size); 1973 (unsigned long long)*total_size+1, *block_size);
1966 kfree(buf); 1974 kfree(buf);
1967 return; 1975 return;
1968} 1976}
@@ -1989,15 +1997,15 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size,
1989 1, logvol, 0, NULL, TYPE_CMD); 1997 1, logvol, 0, NULL, TYPE_CMD);
1990 } 1998 }
1991 if (return_code == IO_OK) { 1999 if (return_code == IO_OK) {
1992 *total_size = be64_to_cpu(*(__u64 *) buf->total_size)+1; 2000 *total_size = be64_to_cpu(*(__be64 *) buf->total_size);
1993 *block_size = be32_to_cpu(*(__u32 *) buf->block_size); 2001 *block_size = be32_to_cpu(*(__be32 *) buf->block_size);
1994 } else { /* read capacity command failed */ 2002 } else { /* read capacity command failed */
1995 printk(KERN_WARNING "cciss: read capacity failed\n"); 2003 printk(KERN_WARNING "cciss: read capacity failed\n");
1996 *total_size = 0; 2004 *total_size = 0;
1997 *block_size = BLOCK_SIZE; 2005 *block_size = BLOCK_SIZE;
1998 } 2006 }
1999 printk(KERN_INFO " blocks= %llu block_size= %d\n", 2007 printk(KERN_INFO " blocks= %llu block_size= %d\n",
2000 (unsigned long long)*total_size, *block_size); 2008 (unsigned long long)*total_size+1, *block_size);
2001 kfree(buf); 2009 kfree(buf);
2002 return; 2010 return;
2003} 2011}
@@ -3119,8 +3127,9 @@ static void cciss_getgeometry(int cntl_num)
3119 } 3127 }
3120 cciss_read_capacity(cntl_num, i, 0, &total_size, &block_size); 3128 cciss_read_capacity(cntl_num, i, 0, &total_size, &block_size);
3121 3129
3122 /* total_size = last LBA + 1 */ 3130 /* If read_capacity returns all F's the logical is >2TB */
3123 if(total_size == (__u32) 0) { 3131 /* so we switch to 16-byte CDBs for all read/write ops */
3132 if(total_size == 0xFFFFFFFFULL) {
3124 cciss_read_capacity_16(cntl_num, i, 0, 3133 cciss_read_capacity_16(cntl_num, i, 0,
3125 &total_size, &block_size); 3134 &total_size, &block_size);
3126 hba[cntl_num]->cciss_read = CCISS_READ_16; 3135 hba[cntl_num]->cciss_read = CCISS_READ_16;
@@ -3395,7 +3404,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
3395 return -1; 3404 return -1;
3396} 3405}
3397 3406
3398static void __devexit cciss_remove_one(struct pci_dev *pdev) 3407static void cciss_remove_one(struct pci_dev *pdev)
3399{ 3408{
3400 ctlr_info_t *tmp_ptr; 3409 ctlr_info_t *tmp_ptr;
3401 int i, j; 3410 int i, j;
@@ -3419,9 +3428,10 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev)
3419 memset(flush_buf, 0, 4); 3428 memset(flush_buf, 0, 4);
3420 return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL, 3429 return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL,
3421 TYPE_CMD); 3430 TYPE_CMD);
3422 if (return_code != IO_OK) { 3431 if (return_code == IO_OK) {
3423 printk(KERN_WARNING "Error Flushing cache on controller %d\n", 3432 printk(KERN_INFO "Completed flushing cache on controller %d\n", i);
3424 i); 3433 } else {
3434 printk(KERN_WARNING "Error flushing cache on controller %d\n", i);
3425 } 3435 }
3426 free_irq(hba[i]->intr[2], hba[i]); 3436 free_irq(hba[i]->intr[2], hba[i]);
3427 3437
@@ -3472,6 +3482,7 @@ static struct pci_driver cciss_pci_driver = {
3472 .probe = cciss_init_one, 3482 .probe = cciss_init_one,
3473 .remove = __devexit_p(cciss_remove_one), 3483 .remove = __devexit_p(cciss_remove_one),
3474 .id_table = cciss_pci_device_id, /* id_table */ 3484 .id_table = cciss_pci_device_id, /* id_table */
3485 .shutdown = cciss_remove_one,
3475}; 3486};
3476 3487
3477/* 3488/*
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 99e2c8ce1cc4..31e01488eb51 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -663,11 +663,11 @@ static enum action pd_identify(struct pd_unit *disk)
663 return Fail; 663 return Fail;
664 pi_read_block(disk->pi, pd_scratch, 512); 664 pi_read_block(disk->pi, pd_scratch, 512);
665 disk->can_lba = pd_scratch[99] & 2; 665 disk->can_lba = pd_scratch[99] & 2;
666 disk->sectors = le16_to_cpu(*(u16 *) (pd_scratch + 12)); 666 disk->sectors = le16_to_cpu(*(__le16 *) (pd_scratch + 12));
667 disk->heads = le16_to_cpu(*(u16 *) (pd_scratch + 6)); 667 disk->heads = le16_to_cpu(*(__le16 *) (pd_scratch + 6));
668 disk->cylinders = le16_to_cpu(*(u16 *) (pd_scratch + 2)); 668 disk->cylinders = le16_to_cpu(*(__le16 *) (pd_scratch + 2));
669 if (disk->can_lba) 669 if (disk->can_lba)
670 disk->capacity = le32_to_cpu(*(u32 *) (pd_scratch + 120)); 670 disk->capacity = le32_to_cpu(*(__le32 *) (pd_scratch + 120));
671 else 671 else
672 disk->capacity = disk->sectors * disk->heads * disk->cylinders; 672 disk->capacity = disk->sectors * disk->heads * disk->cylinders;
673 673
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index d0a6dc53213c..3429ece4ef92 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -1026,16 +1026,17 @@ config MMTIMER
1026source "drivers/char/tpm/Kconfig" 1026source "drivers/char/tpm/Kconfig"
1027 1027
1028config TELCLOCK 1028config TELCLOCK
1029 tristate "Telecom clock driver for MPBL0010 ATCA SBC" 1029 tristate "Telecom clock driver for ATCA SBC"
1030 depends on EXPERIMENTAL && X86 1030 depends on EXPERIMENTAL && X86
1031 default n 1031 default n
1032 help 1032 help
1033 The telecom clock device is specific to the MPBL0010 ATCA computer and 1033 The telecom clock device is specific to the MPCBL0010 and MPCBL0050
1034 allows direct userspace access to the configuration of the telecom clock 1034 ATCA computers and allows direct userspace access to the
1035 configuration settings. This device is used for hardware synchronization 1035 configuration of the telecom clock configuration settings. This
1036 across the ATCA backplane fabric. Upon loading, the driver exports a 1036 device is used for hardware synchronization across the ATCA backplane
1037 sysfs directory, /sys/devices/platform/telco_clock, with a number of 1037 fabric. Upon loading, the driver exports a sysfs directory,
1038 files for controlling the behavior of this hardware. 1038 /sys/devices/platform/telco_clock, with a number of files for
1039 controlling the behavior of this hardware.
1039 1040
1040endmenu 1041endmenu
1041 1042
diff --git a/drivers/char/ds1286.c b/drivers/char/ds1286.c
index 6d58b0370802..59146e3365ba 100644
--- a/drivers/char/ds1286.c
+++ b/drivers/char/ds1286.c
@@ -197,6 +197,7 @@ static int ds1286_ioctl(struct inode *inode, struct file *file,
197 197
198 hrs = alm_tm.tm_hour; 198 hrs = alm_tm.tm_hour;
199 min = alm_tm.tm_min; 199 min = alm_tm.tm_min;
200 sec = alm_tm.tm_sec;
200 201
201 if (hrs >= 24) 202 if (hrs >= 24)
202 hrs = 0xff; 203 hrs = 0xff;
@@ -204,9 +205,11 @@ static int ds1286_ioctl(struct inode *inode, struct file *file,
204 if (min >= 60) 205 if (min >= 60)
205 min = 0xff; 206 min = 0xff;
206 207
207 BIN_TO_BCD(sec); 208 if (sec != 0)
208 BIN_TO_BCD(min); 209 return -EINVAL;
209 BIN_TO_BCD(hrs); 210
211 min = BIN2BCD(min);
212 min = BIN2BCD(hrs);
210 213
211 spin_lock(&ds1286_lock); 214 spin_lock(&ds1286_lock);
212 rtc_write(hrs, RTC_HOURS_ALARM); 215 rtc_write(hrs, RTC_HOURS_ALARM);
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 0e82968c2f38..f2e4ec4fd407 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -273,6 +273,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf,
273 DEBUGP(6, dev, "BytesToRead=%lu\n", bytes_to_read); 273 DEBUGP(6, dev, "BytesToRead=%lu\n", bytes_to_read);
274 274
275 min_bytes_to_read = min(count, bytes_to_read + 5); 275 min_bytes_to_read = min(count, bytes_to_read + 5);
276 min_bytes_to_read = min_t(size_t, min_bytes_to_read, READ_WRITE_BUFFER_SIZE);
276 277
277 DEBUGP(6, dev, "Min=%lu\n", min_bytes_to_read); 278 DEBUGP(6, dev, "Min=%lu\n", min_bytes_to_read);
278 279
@@ -340,7 +341,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf,
340 return 0; 341 return 0;
341 } 342 }
342 343
343 if (count < 5) { 344 if ((count < 5) || (count > READ_WRITE_BUFFER_SIZE)) {
344 DEBUGP(2, dev, "<- cm4040_write buffersize=%Zd < 5\n", count); 345 DEBUGP(2, dev, "<- cm4040_write buffersize=%Zd < 5\n", count);
345 return -EIO; 346 return -EIO;
346 } 347 }
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index ea09d0c974ea..e812aa129e28 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -301,6 +301,7 @@ config I6300ESB_WDT
301config I8XX_TCO 301config I8XX_TCO
302 tristate "Intel i8xx TCO Timer/Watchdog" 302 tristate "Intel i8xx TCO Timer/Watchdog"
303 depends on WATCHDOG && (X86 || IA64) && PCI 303 depends on WATCHDOG && (X86 || IA64) && PCI
304 default n
304 ---help--- 305 ---help---
305 Hardware driver for the TCO timer built into the Intel 82801 306 Hardware driver for the TCO timer built into the Intel 82801
306 I/O Controller Hub family. The TCO (Total Cost of Ownership) 307 I/O Controller Hub family. The TCO (Total Cost of Ownership)
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
index 4a328ba0d262..81fb3dec180f 100644
--- a/drivers/char/watchdog/machzwd.c
+++ b/drivers/char/watchdog/machzwd.c
@@ -324,7 +324,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
324 return put_user(0, p); 324 return put_user(0, p);
325 325
326 case WDIOC_KEEPALIVE: 326 case WDIOC_KEEPALIVE:
327 zf_ping(0); 327 zf_ping(NULL);
328 break; 328 break;
329 329
330 default: 330 default:
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index a44db75bc25b..a905f7820331 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -128,7 +128,7 @@ EXPORT_SYMBOL_GPL(cn_netlink_send);
128 */ 128 */
129static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), void *data) 129static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), void *data)
130{ 130{
131 struct cn_callback_entry *__cbq; 131 struct cn_callback_entry *__cbq, *__new_cbq;
132 struct cn_dev *dev = &cdev; 132 struct cn_dev *dev = &cdev;
133 int err = -ENODEV; 133 int err = -ENODEV;
134 134
@@ -148,27 +148,27 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v
148 } else { 148 } else {
149 struct cn_callback_data *d; 149 struct cn_callback_data *d;
150 150
151 __cbq = kzalloc(sizeof(*__cbq), GFP_ATOMIC); 151 err = -ENOMEM;
152 if (__cbq) { 152 __new_cbq = kzalloc(sizeof(struct cn_callback_entry), GFP_ATOMIC);
153 d = &__cbq->data; 153 if (__new_cbq) {
154 d = &__new_cbq->data;
154 d->callback_priv = msg; 155 d->callback_priv = msg;
155 d->callback = __cbq->data.callback; 156 d->callback = __cbq->data.callback;
156 d->ddata = data; 157 d->ddata = data;
157 d->destruct_data = destruct_data; 158 d->destruct_data = destruct_data;
158 d->free = __cbq; 159 d->free = __new_cbq;
159 160
160 INIT_WORK(&__cbq->work, 161 INIT_WORK(&__new_cbq->work,
161 &cn_queue_wrapper); 162 &cn_queue_wrapper);
162 163
163 if (queue_work(dev->cbdev->cn_queue, 164 if (queue_work(dev->cbdev->cn_queue,
164 &__cbq->work)) 165 &__new_cbq->work))
165 err = 0; 166 err = 0;
166 else { 167 else {
167 kfree(__cbq); 168 kfree(__new_cbq);
168 err = -EINVAL; 169 err = -EINVAL;
169 } 170 }
170 } else 171 }
171 err = -ENOMEM;
172 } 172 }
173 break; 173 break;
174 } 174 }
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 0eb62841e9b0..6d3840e629de 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -99,9 +99,8 @@ do_crypt(void *src, void *dst, int len, u32 flags)
99static unsigned int 99static unsigned int
100geode_aes_crypt(struct geode_aes_op *op) 100geode_aes_crypt(struct geode_aes_op *op)
101{ 101{
102
103 u32 flags = 0; 102 u32 flags = 0;
104 int iflags; 103 unsigned long iflags;
105 104
106 if (op->len == 0 || op->src == op->dst) 105 if (op->len == 0 || op->src == op->dst)
107 return 0; 106 return 0;
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index f4ee1afe488f..9c8157fb6d75 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -753,8 +753,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
753 753
754 report += offset >> 3; /* adjust byte index */ 754 report += offset >> 3; /* adjust byte index */
755 offset &= 7; /* now only need bit offset into one byte */ 755 offset &= 7; /* now only need bit offset into one byte */
756 x = get_unaligned((u64 *) report); 756 x = le64_to_cpu(get_unaligned((__le64 *) report));
757 x = le64_to_cpu(x);
758 x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */ 757 x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */
759 return (u32) x; 758 return (u32) x;
760} 759}
@@ -769,7 +768,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
769 */ 768 */
770static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) 769static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)
771{ 770{
772 u64 x; 771 __le64 x;
773 u64 m = (1ULL << n) - 1; 772 u64 m = (1ULL << n) - 1;
774 773
775 WARN_ON(n > 32); 774 WARN_ON(n > 32);
@@ -780,10 +779,10 @@ static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u3
780 report += offset >> 3; 779 report += offset >> 3;
781 offset &= 7; 780 offset &= 7;
782 781
783 x = get_unaligned((u64 *)report); 782 x = get_unaligned((__le64 *)report);
784 x &= cpu_to_le64(~(m << offset)); 783 x &= cpu_to_le64(~(m << offset));
785 x |= cpu_to_le64(((u64) value) << offset); 784 x |= cpu_to_le64(((u64) value) << offset);
786 put_unaligned(x, (u64 *) report); 785 put_unaligned(x, (__le64 *) report);
787} 786}
788 787
789/* 788/*
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 5d134bb75ba1..3f76987d818a 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -802,7 +802,7 @@ config BLK_DEV_IDEDMA_PMAC
802 802
803config BLK_DEV_IDE_CELLEB 803config BLK_DEV_IDE_CELLEB
804 bool "Toshiba's Cell Reference Set IDE support" 804 bool "Toshiba's Cell Reference Set IDE support"
805 depends on PPC_CELLEB 805 depends on PPC_CELLEB && IDE=y
806 help 806 help
807 This driver provides support for the built-in IDE controller on 807 This driver provides support for the built-in IDE controller on
808 Toshiba Cell Reference Board. 808 Toshiba Cell Reference Board.
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index d441815a3e0c..fde92ce45153 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1821,7 +1821,7 @@ static int cma_alloc_port(struct idr *ps, struct rdma_id_private *id_priv,
1821 struct rdma_bind_list *bind_list; 1821 struct rdma_bind_list *bind_list;
1822 int port, ret; 1822 int port, ret;
1823 1823
1824 bind_list = kmalloc(sizeof *bind_list, GFP_KERNEL); 1824 bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
1825 if (!bind_list) 1825 if (!bind_list)
1826 return -ENOMEM; 1826 return -ENOMEM;
1827 1827
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index b516b93b8550..c859134c1daa 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -266,7 +266,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id,
266 mutex_lock(&ctx->file->mut); 266 mutex_lock(&ctx->file->mut);
267 if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { 267 if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) {
268 if (!ctx->backlog) { 268 if (!ctx->backlog) {
269 ret = -EDQUOT; 269 ret = -ENOMEM;
270 kfree(uevent); 270 kfree(uevent);
271 goto out; 271 goto out;
272 } 272 }
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index d737c738d876..818cf1aee8c7 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -36,6 +36,7 @@
36#include <linux/sched.h> 36#include <linux/sched.h>
37#include <linux/spinlock.h> 37#include <linux/spinlock.h>
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/dma-mapping.h>
39 40
40#include "cxio_resource.h" 41#include "cxio_resource.h"
41#include "cxio_hal.h" 42#include "cxio_hal.h"
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index b21fde8b659d..d0ed1d35ca3e 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -305,8 +305,7 @@ static int status2errno(int status)
305 */ 305 */
306static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp) 306static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp)
307{ 307{
308 if (skb) { 308 if (skb && !skb_is_nonlinear(skb) && !skb_cloned(skb)) {
309 BUG_ON(skb_cloned(skb));
310 skb_trim(skb, 0); 309 skb_trim(skb, 0);
311 skb_get(skb); 310 skb_get(skb);
312 } else { 311 } else {
@@ -1415,6 +1414,7 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1415 wake_up(&ep->com.waitq); 1414 wake_up(&ep->com.waitq);
1416 break; 1415 break;
1417 case FPDU_MODE: 1416 case FPDU_MODE:
1417 start_ep_timer(ep);
1418 __state_set(&ep->com, CLOSING); 1418 __state_set(&ep->com, CLOSING);
1419 attrs.next_state = IWCH_QP_STATE_CLOSING; 1419 attrs.next_state = IWCH_QP_STATE_CLOSING;
1420 iwch_modify_qp(ep->com.qp->rhp, ep->com.qp, 1420 iwch_modify_qp(ep->com.qp->rhp, ep->com.qp,
@@ -1425,7 +1425,6 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1425 disconnect = 0; 1425 disconnect = 0;
1426 break; 1426 break;
1427 case CLOSING: 1427 case CLOSING:
1428 start_ep_timer(ep);
1429 __state_set(&ep->com, MORIBUND); 1428 __state_set(&ep->com, MORIBUND);
1430 disconnect = 0; 1429 disconnect = 0;
1431 break; 1430 break;
@@ -1487,8 +1486,10 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1487 case CONNECTING: 1486 case CONNECTING:
1488 break; 1487 break;
1489 case MPA_REQ_WAIT: 1488 case MPA_REQ_WAIT:
1489 stop_ep_timer(ep);
1490 break; 1490 break;
1491 case MPA_REQ_SENT: 1491 case MPA_REQ_SENT:
1492 stop_ep_timer(ep);
1492 connect_reply_upcall(ep, -ECONNRESET); 1493 connect_reply_upcall(ep, -ECONNRESET);
1493 break; 1494 break;
1494 case MPA_REP_SENT: 1495 case MPA_REP_SENT:
@@ -1507,9 +1508,10 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1507 get_ep(&ep->com); 1508 get_ep(&ep->com);
1508 break; 1509 break;
1509 case MORIBUND: 1510 case MORIBUND:
1511 case CLOSING:
1510 stop_ep_timer(ep); 1512 stop_ep_timer(ep);
1513 /*FALLTHROUGH*/
1511 case FPDU_MODE: 1514 case FPDU_MODE:
1512 case CLOSING:
1513 if (ep->com.cm_id && ep->com.qp) { 1515 if (ep->com.cm_id && ep->com.qp) {
1514 attrs.next_state = IWCH_QP_STATE_ERROR; 1516 attrs.next_state = IWCH_QP_STATE_ERROR;
1515 ret = iwch_modify_qp(ep->com.qp->rhp, 1517 ret = iwch_modify_qp(ep->com.qp->rhp,
@@ -1570,7 +1572,6 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1570 spin_lock_irqsave(&ep->com.lock, flags); 1572 spin_lock_irqsave(&ep->com.lock, flags);
1571 switch (ep->com.state) { 1573 switch (ep->com.state) {
1572 case CLOSING: 1574 case CLOSING:
1573 start_ep_timer(ep);
1574 __state_set(&ep->com, MORIBUND); 1575 __state_set(&ep->com, MORIBUND);
1575 break; 1576 break;
1576 case MORIBUND: 1577 case MORIBUND:
@@ -1586,6 +1587,8 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1586 __state_set(&ep->com, DEAD); 1587 __state_set(&ep->com, DEAD);
1587 release = 1; 1588 release = 1;
1588 break; 1589 break;
1590 case ABORTING:
1591 break;
1589 case DEAD: 1592 case DEAD:
1590 default: 1593 default:
1591 BUG_ON(1); 1594 BUG_ON(1);
@@ -1659,6 +1662,7 @@ static void ep_timeout(unsigned long arg)
1659 break; 1662 break;
1660 case MPA_REQ_WAIT: 1663 case MPA_REQ_WAIT:
1661 break; 1664 break;
1665 case CLOSING:
1662 case MORIBUND: 1666 case MORIBUND:
1663 if (ep->com.cm_id && ep->com.qp) { 1667 if (ep->com.cm_id && ep->com.qp) {
1664 attrs.next_state = IWCH_QP_STATE_ERROR; 1668 attrs.next_state = IWCH_QP_STATE_ERROR;
@@ -1687,12 +1691,11 @@ int iwch_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
1687 return -ECONNRESET; 1691 return -ECONNRESET;
1688 } 1692 }
1689 BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); 1693 BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD);
1690 state_set(&ep->com, CLOSING);
1691 if (mpa_rev == 0) 1694 if (mpa_rev == 0)
1692 abort_connection(ep, NULL, GFP_KERNEL); 1695 abort_connection(ep, NULL, GFP_KERNEL);
1693 else { 1696 else {
1694 err = send_mpa_reject(ep, pdata, pdata_len); 1697 err = send_mpa_reject(ep, pdata, pdata_len);
1695 err = send_halfclose(ep, GFP_KERNEL); 1698 err = iwch_ep_disconnect(ep, 0, GFP_KERNEL);
1696 } 1699 }
1697 return 0; 1700 return 0;
1698} 1701}
@@ -1957,11 +1960,11 @@ int iwch_ep_disconnect(struct iwch_ep *ep, int abrupt, gfp_t gfp)
1957 case MPA_REQ_RCVD: 1960 case MPA_REQ_RCVD:
1958 case MPA_REP_SENT: 1961 case MPA_REP_SENT:
1959 case FPDU_MODE: 1962 case FPDU_MODE:
1963 start_ep_timer(ep);
1960 ep->com.state = CLOSING; 1964 ep->com.state = CLOSING;
1961 close = 1; 1965 close = 1;
1962 break; 1966 break;
1963 case CLOSING: 1967 case CLOSING:
1964 start_ep_timer(ep);
1965 ep->com.state = MORIBUND; 1968 ep->com.state = MORIBUND;
1966 close = 1; 1969 close = 1;
1967 break; 1970 break;
diff --git a/drivers/infiniband/hw/cxgb3/iwch_ev.c b/drivers/infiniband/hw/cxgb3/iwch_ev.c
index 54362afbf72f..b40676662a8a 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_ev.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_ev.c
@@ -47,12 +47,6 @@ static void post_qp_event(struct iwch_dev *rnicp, struct iwch_cq *chp,
47 struct iwch_qp_attributes attrs; 47 struct iwch_qp_attributes attrs;
48 struct iwch_qp *qhp; 48 struct iwch_qp *qhp;
49 49
50 printk(KERN_ERR "%s - AE qpid 0x%x opcode %d status 0x%x "
51 "type %d wrid.hi 0x%x wrid.lo 0x%x \n", __FUNCTION__,
52 CQE_QPID(rsp_msg->cqe), CQE_OPCODE(rsp_msg->cqe),
53 CQE_STATUS(rsp_msg->cqe), CQE_TYPE(rsp_msg->cqe),
54 CQE_WRID_HI(rsp_msg->cqe), CQE_WRID_LOW(rsp_msg->cqe));
55
56 spin_lock(&rnicp->lock); 50 spin_lock(&rnicp->lock);
57 qhp = get_qhp(rnicp, CQE_QPID(rsp_msg->cqe)); 51 qhp = get_qhp(rnicp, CQE_QPID(rsp_msg->cqe));
58 52
@@ -73,6 +67,12 @@ static void post_qp_event(struct iwch_dev *rnicp, struct iwch_cq *chp,
73 return; 67 return;
74 } 68 }
75 69
70 printk(KERN_ERR "%s - AE qpid 0x%x opcode %d status 0x%x "
71 "type %d wrid.hi 0x%x wrid.lo 0x%x \n", __FUNCTION__,
72 CQE_QPID(rsp_msg->cqe), CQE_OPCODE(rsp_msg->cqe),
73 CQE_STATUS(rsp_msg->cqe), CQE_TYPE(rsp_msg->cqe),
74 CQE_WRID_HI(rsp_msg->cqe), CQE_WRID_LOW(rsp_msg->cqe));
75
76 atomic_inc(&qhp->refcnt); 76 atomic_inc(&qhp->refcnt);
77 spin_unlock(&rnicp->lock); 77 spin_unlock(&rnicp->lock);
78 78
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index 9947a144a929..f2774ae906bf 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -331,6 +331,7 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
331 int ret = 0; 331 int ret = 0;
332 struct iwch_mm_entry *mm; 332 struct iwch_mm_entry *mm;
333 struct iwch_ucontext *ucontext; 333 struct iwch_ucontext *ucontext;
334 u64 addr;
334 335
335 PDBG("%s pgoff 0x%lx key 0x%x len %d\n", __FUNCTION__, vma->vm_pgoff, 336 PDBG("%s pgoff 0x%lx key 0x%x len %d\n", __FUNCTION__, vma->vm_pgoff,
336 key, len); 337 key, len);
@@ -345,10 +346,11 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
345 mm = remove_mmap(ucontext, key, len); 346 mm = remove_mmap(ucontext, key, len);
346 if (!mm) 347 if (!mm)
347 return -EINVAL; 348 return -EINVAL;
349 addr = mm->addr;
348 kfree(mm); 350 kfree(mm);
349 351
350 if ((mm->addr >= rdev_p->rnic_info.udbell_physbase) && 352 if ((addr >= rdev_p->rnic_info.udbell_physbase) &&
351 (mm->addr < (rdev_p->rnic_info.udbell_physbase + 353 (addr < (rdev_p->rnic_info.udbell_physbase +
352 rdev_p->rnic_info.udbell_len))) { 354 rdev_p->rnic_info.udbell_len))) {
353 355
354 /* 356 /*
@@ -362,7 +364,7 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
362 vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; 364 vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND;
363 vma->vm_flags &= ~VM_MAYREAD; 365 vma->vm_flags &= ~VM_MAYREAD;
364 ret = io_remap_pfn_range(vma, vma->vm_start, 366 ret = io_remap_pfn_range(vma, vma->vm_start,
365 mm->addr >> PAGE_SHIFT, 367 addr >> PAGE_SHIFT,
366 len, vma->vm_page_prot); 368 len, vma->vm_page_prot);
367 } else { 369 } else {
368 370
@@ -370,7 +372,7 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
370 * Map WQ or CQ contig dma memory... 372 * Map WQ or CQ contig dma memory...
371 */ 373 */
372 ret = remap_pfn_range(vma, vma->vm_start, 374 ret = remap_pfn_range(vma, vma->vm_start,
373 mm->addr >> PAGE_SHIFT, 375 addr >> PAGE_SHIFT,
374 len, vma->vm_page_prot); 376 len, vma->vm_page_prot);
375 } 377 }
376 378
@@ -463,9 +465,6 @@ static struct ib_mr *iwch_register_phys_mem(struct ib_pd *pd,
463 php = to_iwch_pd(pd); 465 php = to_iwch_pd(pd);
464 rhp = php->rhp; 466 rhp = php->rhp;
465 467
466 acc = iwch_convert_access(acc);
467
468
469 mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); 468 mhp = kzalloc(sizeof(*mhp), GFP_KERNEL);
470 if (!mhp) 469 if (!mhp)
471 return ERR_PTR(-ENOMEM); 470 return ERR_PTR(-ENOMEM);
@@ -491,12 +490,7 @@ static struct ib_mr *iwch_register_phys_mem(struct ib_pd *pd,
491 mhp->attr.pdid = php->pdid; 490 mhp->attr.pdid = php->pdid;
492 mhp->attr.zbva = 0; 491 mhp->attr.zbva = 0;
493 492
494 /* NOTE: TPT perms are backwards from BIND WR perms! */ 493 mhp->attr.perms = iwch_ib_to_tpt_access(acc);
495 mhp->attr.perms = (acc & 0x1) << 3;
496 mhp->attr.perms |= (acc & 0x2) << 1;
497 mhp->attr.perms |= (acc & 0x4) >> 1;
498 mhp->attr.perms |= (acc & 0x8) >> 3;
499
500 mhp->attr.va_fbo = *iova_start; 494 mhp->attr.va_fbo = *iova_start;
501 mhp->attr.page_size = shift - 12; 495 mhp->attr.page_size = shift - 12;
502 496
@@ -525,7 +519,6 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr,
525 struct iwch_mr mh, *mhp; 519 struct iwch_mr mh, *mhp;
526 struct iwch_pd *php; 520 struct iwch_pd *php;
527 struct iwch_dev *rhp; 521 struct iwch_dev *rhp;
528 int new_acc;
529 __be64 *page_list = NULL; 522 __be64 *page_list = NULL;
530 int shift = 0; 523 int shift = 0;
531 u64 total_size; 524 u64 total_size;
@@ -546,14 +539,12 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr,
546 if (rhp != php->rhp) 539 if (rhp != php->rhp)
547 return -EINVAL; 540 return -EINVAL;
548 541
549 new_acc = mhp->attr.perms;
550
551 memcpy(&mh, mhp, sizeof *mhp); 542 memcpy(&mh, mhp, sizeof *mhp);
552 543
553 if (mr_rereg_mask & IB_MR_REREG_PD) 544 if (mr_rereg_mask & IB_MR_REREG_PD)
554 php = to_iwch_pd(pd); 545 php = to_iwch_pd(pd);
555 if (mr_rereg_mask & IB_MR_REREG_ACCESS) 546 if (mr_rereg_mask & IB_MR_REREG_ACCESS)
556 mh.attr.perms = iwch_convert_access(acc); 547 mh.attr.perms = iwch_ib_to_tpt_access(acc);
557 if (mr_rereg_mask & IB_MR_REREG_TRANS) 548 if (mr_rereg_mask & IB_MR_REREG_TRANS)
558 ret = build_phys_page_list(buffer_list, num_phys_buf, 549 ret = build_phys_page_list(buffer_list, num_phys_buf,
559 iova_start, 550 iova_start,
@@ -568,7 +559,7 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr,
568 if (mr_rereg_mask & IB_MR_REREG_PD) 559 if (mr_rereg_mask & IB_MR_REREG_PD)
569 mhp->attr.pdid = php->pdid; 560 mhp->attr.pdid = php->pdid;
570 if (mr_rereg_mask & IB_MR_REREG_ACCESS) 561 if (mr_rereg_mask & IB_MR_REREG_ACCESS)
571 mhp->attr.perms = acc; 562 mhp->attr.perms = iwch_ib_to_tpt_access(acc);
572 if (mr_rereg_mask & IB_MR_REREG_TRANS) { 563 if (mr_rereg_mask & IB_MR_REREG_TRANS) {
573 mhp->attr.zbva = 0; 564 mhp->attr.zbva = 0;
574 mhp->attr.va_fbo = *iova_start; 565 mhp->attr.va_fbo = *iova_start;
@@ -613,8 +604,6 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, struct ib_umem *region,
613 goto err; 604 goto err;
614 } 605 }
615 606
616 acc = iwch_convert_access(acc);
617
618 i = n = 0; 607 i = n = 0;
619 608
620 list_for_each_entry(chunk, &region->chunk_list, list) 609 list_for_each_entry(chunk, &region->chunk_list, list)
@@ -630,10 +619,7 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, struct ib_umem *region,
630 mhp->rhp = rhp; 619 mhp->rhp = rhp;
631 mhp->attr.pdid = php->pdid; 620 mhp->attr.pdid = php->pdid;
632 mhp->attr.zbva = 0; 621 mhp->attr.zbva = 0;
633 mhp->attr.perms = (acc & 0x1) << 3; 622 mhp->attr.perms = iwch_ib_to_tpt_access(acc);
634 mhp->attr.perms |= (acc & 0x2) << 1;
635 mhp->attr.perms |= (acc & 0x4) >> 1;
636 mhp->attr.perms |= (acc & 0x8) >> 3;
637 mhp->attr.va_fbo = region->virt_base; 623 mhp->attr.va_fbo = region->virt_base;
638 mhp->attr.page_size = shift - 12; 624 mhp->attr.page_size = shift - 12;
639 mhp->attr.len = (u32) region->length; 625 mhp->attr.len = (u32) region->length;
@@ -736,10 +722,8 @@ static int iwch_destroy_qp(struct ib_qp *ib_qp)
736 qhp = to_iwch_qp(ib_qp); 722 qhp = to_iwch_qp(ib_qp);
737 rhp = qhp->rhp; 723 rhp = qhp->rhp;
738 724
739 if (qhp->attr.state == IWCH_QP_STATE_RTS) { 725 attrs.next_state = IWCH_QP_STATE_ERROR;
740 attrs.next_state = IWCH_QP_STATE_ERROR; 726 iwch_modify_qp(rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, &attrs, 0);
741 iwch_modify_qp(rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, &attrs, 0);
742 }
743 wait_event(qhp->wait, !qhp->ep); 727 wait_event(qhp->wait, !qhp->ep);
744 728
745 remove_handle(rhp, &rhp->qpidr, qhp->wq.qpid); 729 remove_handle(rhp, &rhp->qpidr, qhp->wq.qpid);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.h b/drivers/infiniband/hw/cxgb3/iwch_provider.h
index de0fe1b93a0c..93bcc56756bd 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.h
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.h
@@ -286,27 +286,20 @@ static inline int iwch_convert_state(enum ib_qp_state ib_state)
286 } 286 }
287} 287}
288 288
289enum iwch_mem_perms { 289static inline u32 iwch_ib_to_tpt_access(int acc)
290 IWCH_MEM_ACCESS_LOCAL_READ = 1 << 0,
291 IWCH_MEM_ACCESS_LOCAL_WRITE = 1 << 1,
292 IWCH_MEM_ACCESS_REMOTE_READ = 1 << 2,
293 IWCH_MEM_ACCESS_REMOTE_WRITE = 1 << 3,
294 IWCH_MEM_ACCESS_ATOMICS = 1 << 4,
295 IWCH_MEM_ACCESS_BINDING = 1 << 5,
296 IWCH_MEM_ACCESS_LOCAL =
297 (IWCH_MEM_ACCESS_LOCAL_READ | IWCH_MEM_ACCESS_LOCAL_WRITE),
298 IWCH_MEM_ACCESS_REMOTE =
299 (IWCH_MEM_ACCESS_REMOTE_WRITE | IWCH_MEM_ACCESS_REMOTE_READ)
300 /* cannot go beyond 1 << 31 */
301} __attribute__ ((packed));
302
303static inline u32 iwch_convert_access(int acc)
304{ 290{
305 return (acc & IB_ACCESS_REMOTE_WRITE ? IWCH_MEM_ACCESS_REMOTE_WRITE : 0) 291 return (acc & IB_ACCESS_REMOTE_WRITE ? TPT_REMOTE_WRITE : 0) |
306 | (acc & IB_ACCESS_REMOTE_READ ? IWCH_MEM_ACCESS_REMOTE_READ : 0) | 292 (acc & IB_ACCESS_REMOTE_READ ? TPT_REMOTE_READ : 0) |
307 (acc & IB_ACCESS_LOCAL_WRITE ? IWCH_MEM_ACCESS_LOCAL_WRITE : 0) | 293 (acc & IB_ACCESS_LOCAL_WRITE ? TPT_LOCAL_WRITE : 0) |
308 (acc & IB_ACCESS_MW_BIND ? IWCH_MEM_ACCESS_BINDING : 0) | 294 TPT_LOCAL_READ;
309 IWCH_MEM_ACCESS_LOCAL_READ; 295}
296
297static inline u32 iwch_ib_to_mwbind_access(int acc)
298{
299 return (acc & IB_ACCESS_REMOTE_WRITE ? T3_MEM_ACCESS_REM_WRITE : 0) |
300 (acc & IB_ACCESS_REMOTE_READ ? T3_MEM_ACCESS_REM_READ : 0) |
301 (acc & IB_ACCESS_LOCAL_WRITE ? T3_MEM_ACCESS_LOCAL_WRITE : 0) |
302 T3_MEM_ACCESS_LOCAL_READ;
310} 303}
311 304
312enum iwch_mmid_state { 305enum iwch_mmid_state {
diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c
index 9ea00cc4a5f8..0a472c9b44db 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_qp.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c
@@ -439,7 +439,7 @@ int iwch_bind_mw(struct ib_qp *qp,
439 wqe->bind.type = T3_VA_BASED_TO; 439 wqe->bind.type = T3_VA_BASED_TO;
440 440
441 /* TBD: check perms */ 441 /* TBD: check perms */
442 wqe->bind.perms = iwch_convert_access(mw_bind->mw_access_flags); 442 wqe->bind.perms = iwch_ib_to_mwbind_access(mw_bind->mw_access_flags);
443 wqe->bind.mr_stag = cpu_to_be32(mw_bind->mr->lkey); 443 wqe->bind.mr_stag = cpu_to_be32(mw_bind->mr->lkey);
444 wqe->bind.mw_stag = cpu_to_be32(mw->rkey); 444 wqe->bind.mw_stag = cpu_to_be32(mw->rkey);
445 wqe->bind.mw_len = cpu_to_be32(mw_bind->length); 445 wqe->bind.mw_len = cpu_to_be32(mw_bind->length);
diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h
index 40404c9e2817..82ded44c6cee 100644
--- a/drivers/infiniband/hw/ehca/ehca_classes.h
+++ b/drivers/infiniband/hw/ehca/ehca_classes.h
@@ -52,6 +52,8 @@ struct ehca_mw;
52struct ehca_pd; 52struct ehca_pd;
53struct ehca_av; 53struct ehca_av;
54 54
55#include <linux/wait.h>
56
55#include <rdma/ib_verbs.h> 57#include <rdma/ib_verbs.h>
56#include <rdma/ib_user_verbs.h> 58#include <rdma/ib_user_verbs.h>
57 59
@@ -153,7 +155,9 @@ struct ehca_cq {
153 spinlock_t cb_lock; 155 spinlock_t cb_lock;
154 struct hlist_head qp_hashtab[QP_HASHTAB_LEN]; 156 struct hlist_head qp_hashtab[QP_HASHTAB_LEN];
155 struct list_head entry; 157 struct list_head entry;
156 u32 nr_callbacks; 158 u32 nr_callbacks; /* #events assigned to cpu by scaling code */
159 u32 nr_events; /* #events seen */
160 wait_queue_head_t wait_completion;
157 spinlock_t task_lock; 161 spinlock_t task_lock;
158 u32 ownpid; 162 u32 ownpid;
159 /* mmap counter for resources mapped into user space */ 163 /* mmap counter for resources mapped into user space */
diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/infiniband/hw/ehca/ehca_cq.c
index 6ebfa27e4e16..e2cdc1a16fe9 100644
--- a/drivers/infiniband/hw/ehca/ehca_cq.c
+++ b/drivers/infiniband/hw/ehca/ehca_cq.c
@@ -146,6 +146,7 @@ struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe,
146 spin_lock_init(&my_cq->spinlock); 146 spin_lock_init(&my_cq->spinlock);
147 spin_lock_init(&my_cq->cb_lock); 147 spin_lock_init(&my_cq->cb_lock);
148 spin_lock_init(&my_cq->task_lock); 148 spin_lock_init(&my_cq->task_lock);
149 init_waitqueue_head(&my_cq->wait_completion);
149 my_cq->ownpid = current->tgid; 150 my_cq->ownpid = current->tgid;
150 151
151 cq = &my_cq->ib_cq; 152 cq = &my_cq->ib_cq;
@@ -302,6 +303,16 @@ create_cq_exit1:
302 return cq; 303 return cq;
303} 304}
304 305
306static int get_cq_nr_events(struct ehca_cq *my_cq)
307{
308 int ret;
309 unsigned long flags;
310 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
311 ret = my_cq->nr_events;
312 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
313 return ret;
314}
315
305int ehca_destroy_cq(struct ib_cq *cq) 316int ehca_destroy_cq(struct ib_cq *cq)
306{ 317{
307 u64 h_ret; 318 u64 h_ret;
@@ -329,10 +340,11 @@ int ehca_destroy_cq(struct ib_cq *cq)
329 } 340 }
330 341
331 spin_lock_irqsave(&ehca_cq_idr_lock, flags); 342 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
332 while (my_cq->nr_callbacks) { 343 while (my_cq->nr_events) {
333 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); 344 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
334 yield(); 345 wait_event(my_cq->wait_completion, !get_cq_nr_events(my_cq));
335 spin_lock_irqsave(&ehca_cq_idr_lock, flags); 346 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
347 /* recheck nr_events to assure no cqe has just arrived */
336 } 348 }
337 349
338 idr_remove(&ehca_cq_idr, my_cq->token); 350 idr_remove(&ehca_cq_idr, my_cq->token);
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 3ec53c687d08..20f36bf8b2b6 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -404,10 +404,11 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe)
404 u32 token; 404 u32 token;
405 unsigned long flags; 405 unsigned long flags;
406 struct ehca_cq *cq; 406 struct ehca_cq *cq;
407
407 eqe_value = eqe->entry; 408 eqe_value = eqe->entry;
408 ehca_dbg(&shca->ib_device, "eqe_value=%lx", eqe_value); 409 ehca_dbg(&shca->ib_device, "eqe_value=%lx", eqe_value);
409 if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) { 410 if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) {
410 ehca_dbg(&shca->ib_device, "... completion event"); 411 ehca_dbg(&shca->ib_device, "Got completion event");
411 token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value); 412 token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value);
412 spin_lock_irqsave(&ehca_cq_idr_lock, flags); 413 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
413 cq = idr_find(&ehca_cq_idr, token); 414 cq = idr_find(&ehca_cq_idr, token);
@@ -419,16 +420,20 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe)
419 return; 420 return;
420 } 421 }
421 reset_eq_pending(cq); 422 reset_eq_pending(cq);
422 if (ehca_scaling_code) { 423 cq->nr_events++;
424 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
425 if (ehca_scaling_code)
423 queue_comp_task(cq); 426 queue_comp_task(cq);
424 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); 427 else {
425 } else {
426 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
427 comp_event_callback(cq); 428 comp_event_callback(cq);
429 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
430 cq->nr_events--;
431 if (!cq->nr_events)
432 wake_up(&cq->wait_completion);
433 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
428 } 434 }
429 } else { 435 } else {
430 ehca_dbg(&shca->ib_device, 436 ehca_dbg(&shca->ib_device, "Got non completion event");
431 "Got non completion event");
432 parse_identifier(shca, eqe_value); 437 parse_identifier(shca, eqe_value);
433 } 438 }
434} 439}
@@ -478,6 +483,7 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
478 "token=%x", token); 483 "token=%x", token);
479 continue; 484 continue;
480 } 485 }
486 eqe_cache[eqe_cnt].cq->nr_events++;
481 spin_unlock(&ehca_cq_idr_lock); 487 spin_unlock(&ehca_cq_idr_lock);
482 } else 488 } else
483 eqe_cache[eqe_cnt].cq = NULL; 489 eqe_cache[eqe_cnt].cq = NULL;
@@ -504,12 +510,18 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
504 /* call completion handler for cached eqes */ 510 /* call completion handler for cached eqes */
505 for (i = 0; i < eqe_cnt; i++) 511 for (i = 0; i < eqe_cnt; i++)
506 if (eq->eqe_cache[i].cq) { 512 if (eq->eqe_cache[i].cq) {
507 if (ehca_scaling_code) { 513 if (ehca_scaling_code)
508 spin_lock(&ehca_cq_idr_lock);
509 queue_comp_task(eq->eqe_cache[i].cq); 514 queue_comp_task(eq->eqe_cache[i].cq);
510 spin_unlock(&ehca_cq_idr_lock); 515 else {
511 } else 516 struct ehca_cq *cq = eq->eqe_cache[i].cq;
512 comp_event_callback(eq->eqe_cache[i].cq); 517 comp_event_callback(cq);
518 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
519 cq->nr_events--;
520 if (!cq->nr_events)
521 wake_up(&cq->wait_completion);
522 spin_unlock_irqrestore(&ehca_cq_idr_lock,
523 flags);
524 }
513 } else { 525 } else {
514 ehca_dbg(&shca->ib_device, "Got non completion event"); 526 ehca_dbg(&shca->ib_device, "Got non completion event");
515 parse_identifier(shca, eq->eqe_cache[i].eqe->entry); 527 parse_identifier(shca, eq->eqe_cache[i].eqe->entry);
@@ -523,7 +535,6 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
523 if (!eqe) 535 if (!eqe)
524 break; 536 break;
525 process_eqe(shca, eqe); 537 process_eqe(shca, eqe);
526 eqe_cnt++;
527 } while (1); 538 } while (1);
528 539
529unlock_irq_spinlock: 540unlock_irq_spinlock:
@@ -567,8 +578,7 @@ static void __queue_comp_task(struct ehca_cq *__cq,
567 list_add_tail(&__cq->entry, &cct->cq_list); 578 list_add_tail(&__cq->entry, &cct->cq_list);
568 cct->cq_jobs++; 579 cct->cq_jobs++;
569 wake_up(&cct->wait_queue); 580 wake_up(&cct->wait_queue);
570 } 581 } else
571 else
572 __cq->nr_callbacks++; 582 __cq->nr_callbacks++;
573 583
574 spin_unlock(&__cq->task_lock); 584 spin_unlock(&__cq->task_lock);
@@ -577,18 +587,21 @@ static void __queue_comp_task(struct ehca_cq *__cq,
577 587
578static void queue_comp_task(struct ehca_cq *__cq) 588static void queue_comp_task(struct ehca_cq *__cq)
579{ 589{
580 int cpu;
581 int cpu_id; 590 int cpu_id;
582 struct ehca_cpu_comp_task *cct; 591 struct ehca_cpu_comp_task *cct;
592 int cq_jobs;
593 unsigned long flags;
583 594
584 cpu = get_cpu();
585 cpu_id = find_next_online_cpu(pool); 595 cpu_id = find_next_online_cpu(pool);
586 BUG_ON(!cpu_online(cpu_id)); 596 BUG_ON(!cpu_online(cpu_id));
587 597
588 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id); 598 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
589 BUG_ON(!cct); 599 BUG_ON(!cct);
590 600
591 if (cct->cq_jobs > 0) { 601 spin_lock_irqsave(&cct->task_lock, flags);
602 cq_jobs = cct->cq_jobs;
603 spin_unlock_irqrestore(&cct->task_lock, flags);
604 if (cq_jobs > 0) {
592 cpu_id = find_next_online_cpu(pool); 605 cpu_id = find_next_online_cpu(pool);
593 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id); 606 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
594 BUG_ON(!cct); 607 BUG_ON(!cct);
@@ -608,11 +621,17 @@ static void run_comp_task(struct ehca_cpu_comp_task* cct)
608 cq = list_entry(cct->cq_list.next, struct ehca_cq, entry); 621 cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
609 spin_unlock_irqrestore(&cct->task_lock, flags); 622 spin_unlock_irqrestore(&cct->task_lock, flags);
610 comp_event_callback(cq); 623 comp_event_callback(cq);
611 spin_lock_irqsave(&cct->task_lock, flags);
612 624
625 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
626 cq->nr_events--;
627 if (!cq->nr_events)
628 wake_up(&cq->wait_completion);
629 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
630
631 spin_lock_irqsave(&cct->task_lock, flags);
613 spin_lock(&cq->task_lock); 632 spin_lock(&cq->task_lock);
614 cq->nr_callbacks--; 633 cq->nr_callbacks--;
615 if (cq->nr_callbacks == 0) { 634 if (!cq->nr_callbacks) {
616 list_del_init(cct->cq_list.next); 635 list_del_init(cct->cq_list.next);
617 cct->cq_jobs--; 636 cct->cq_jobs--;
618 } 637 }
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index c1835121a822..059da9628bb5 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -52,7 +52,7 @@
52MODULE_LICENSE("Dual BSD/GPL"); 52MODULE_LICENSE("Dual BSD/GPL");
53MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>"); 53MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>");
54MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver"); 54MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver");
55MODULE_VERSION("SVNEHCA_0021"); 55MODULE_VERSION("SVNEHCA_0022");
56 56
57int ehca_open_aqp1 = 0; 57int ehca_open_aqp1 = 0;
58int ehca_debug_level = 0; 58int ehca_debug_level = 0;
@@ -810,7 +810,7 @@ int __init ehca_module_init(void)
810 int ret; 810 int ret;
811 811
812 printk(KERN_INFO "eHCA Infiniband Device Driver " 812 printk(KERN_INFO "eHCA Infiniband Device Driver "
813 "(Rel.: SVNEHCA_0021)\n"); 813 "(Rel.: SVNEHCA_0022)\n");
814 idr_init(&ehca_qp_idr); 814 idr_init(&ehca_qp_idr);
815 idr_init(&ehca_cq_idr); 815 idr_init(&ehca_cq_idr);
816 spin_lock_init(&ehca_qp_idr_lock); 816 spin_lock_init(&ehca_qp_idr_lock);
diff --git a/drivers/infiniband/hw/ipath/ipath_dma.c b/drivers/infiniband/hw/ipath/ipath_dma.c
index f6f949040825..f87f003e3ef8 100644
--- a/drivers/infiniband/hw/ipath/ipath_dma.c
+++ b/drivers/infiniband/hw/ipath/ipath_dma.c
@@ -167,7 +167,7 @@ static void *ipath_dma_alloc_coherent(struct ib_device *dev, size_t size,
167} 167}
168 168
169static void ipath_dma_free_coherent(struct ib_device *dev, size_t size, 169static void ipath_dma_free_coherent(struct ib_device *dev, size_t size,
170 void *cpu_addr, dma_addr_t dma_handle) 170 void *cpu_addr, u64 dma_handle)
171{ 171{
172 free_pages((unsigned long) cpu_addr, get_order(size)); 172 free_pages((unsigned long) cpu_addr, get_order(size));
173} 173}
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 71dc84bd4254..1c6b63aca268 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -1088,21 +1088,21 @@ static void mthca_unmap_memfree(struct mthca_dev *dev,
1088static int mthca_alloc_memfree(struct mthca_dev *dev, 1088static int mthca_alloc_memfree(struct mthca_dev *dev,
1089 struct mthca_qp *qp) 1089 struct mthca_qp *qp)
1090{ 1090{
1091 int ret = 0;
1092
1093 if (mthca_is_memfree(dev)) { 1091 if (mthca_is_memfree(dev)) {
1094 qp->rq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_RQ, 1092 qp->rq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_RQ,
1095 qp->qpn, &qp->rq.db); 1093 qp->qpn, &qp->rq.db);
1096 if (qp->rq.db_index < 0) 1094 if (qp->rq.db_index < 0)
1097 return ret; 1095 return -ENOMEM;
1098 1096
1099 qp->sq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_SQ, 1097 qp->sq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_SQ,
1100 qp->qpn, &qp->sq.db); 1098 qp->qpn, &qp->sq.db);
1101 if (qp->sq.db_index < 0) 1099 if (qp->sq.db_index < 0) {
1102 mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index); 1100 mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index);
1101 return -ENOMEM;
1102 }
1103 } 1103 }
1104 1104
1105 return ret; 1105 return 0;
1106} 1106}
1107 1107
1108static void mthca_free_memfree(struct mthca_dev *dev, 1108static void mthca_free_memfree(struct mthca_dev *dev,
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index bb2e3d5eee20..56c87a81bb67 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -407,6 +407,10 @@ static int ipoib_mcast_join_complete(int status,
407 queue_delayed_work(ipoib_workqueue, 407 queue_delayed_work(ipoib_workqueue,
408 &priv->mcast_task, 0); 408 &priv->mcast_task, 0);
409 mutex_unlock(&mcast_mutex); 409 mutex_unlock(&mcast_mutex);
410
411 if (mcast == priv->broadcast)
412 netif_carrier_on(dev);
413
410 return 0; 414 return 0;
411 } 415 }
412 416
@@ -594,7 +598,6 @@ void ipoib_mcast_join_task(struct work_struct *work)
594 ipoib_dbg_mcast(priv, "successfully joined all multicast groups\n"); 598 ipoib_dbg_mcast(priv, "successfully joined all multicast groups\n");
595 599
596 clear_bit(IPOIB_MCAST_RUN, &priv->flags); 600 clear_bit(IPOIB_MCAST_RUN, &priv->flags);
597 netif_carrier_on(dev);
598} 601}
599 602
600int ipoib_mcast_start_thread(struct net_device *dev) 603int ipoib_mcast_start_thread(struct net_device *dev)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
index 3cb551b88756..7f3ec205e35f 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
@@ -259,12 +259,13 @@ void ipoib_event(struct ib_event_handler *handler,
259 struct ipoib_dev_priv *priv = 259 struct ipoib_dev_priv *priv =
260 container_of(handler, struct ipoib_dev_priv, event_handler); 260 container_of(handler, struct ipoib_dev_priv, event_handler);
261 261
262 if (record->event == IB_EVENT_PORT_ERR || 262 if ((record->event == IB_EVENT_PORT_ERR ||
263 record->event == IB_EVENT_PKEY_CHANGE || 263 record->event == IB_EVENT_PKEY_CHANGE ||
264 record->event == IB_EVENT_PORT_ACTIVE || 264 record->event == IB_EVENT_PORT_ACTIVE ||
265 record->event == IB_EVENT_LID_CHANGE || 265 record->event == IB_EVENT_LID_CHANGE ||
266 record->event == IB_EVENT_SM_CHANGE || 266 record->event == IB_EVENT_SM_CHANGE ||
267 record->event == IB_EVENT_CLIENT_REREGISTER) { 267 record->event == IB_EVENT_CLIENT_REREGISTER) &&
268 record->element.port_num == priv->port) {
268 ipoib_dbg(priv, "Port state change event\n"); 269 ipoib_dbg(priv, "Port state change event\n");
269 queue_work(ipoib_workqueue, &priv->flush_task); 270 queue_work(ipoib_workqueue, &priv->flush_task);
270 } 271 }
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index ec195a36e8f6..db9cca3b65e0 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -553,7 +553,8 @@ static int __devinit i8042_check_aux(void)
553 */ 553 */
554 554
555 param = 0x5a; 555 param = 0x5a;
556 if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0x5a) { 556 retval = i8042_command(&param, I8042_CMD_AUX_LOOP);
557 if (retval || param != 0x5a) {
557 558
558/* 559/*
559 * External connection test - filters out AT-soldered PS/2 i8042's 560 * External connection test - filters out AT-soldered PS/2 i8042's
@@ -567,7 +568,12 @@ static int __devinit i8042_check_aux(void)
567 (param && param != 0xfa && param != 0xff)) 568 (param && param != 0xfa && param != 0xff))
568 return -1; 569 return -1;
569 570
570 aux_loop_broken = 1; 571/*
572 * If AUX_LOOP completed without error but returned unexpected data
573 * mark it as broken
574 */
575 if (!retval)
576 aux_loop_broken = 1;
571 } 577 }
572 578
573/* 579/*
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 1ff5138e4bb6..9916cf32494d 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1248,10 +1248,10 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1248 ret |= pvr2_write_register(hdw, 0xaa18, 0x00840000); /*unknown*/ 1248 ret |= pvr2_write_register(hdw, 0xaa18, 0x00840000); /*unknown*/
1249 LOCK_TAKE(hdw->ctl_lock); do { 1249 LOCK_TAKE(hdw->ctl_lock); do {
1250 hdw->cmd_buffer[0] = FX2CMD_FWPOST1; 1250 hdw->cmd_buffer[0] = FX2CMD_FWPOST1;
1251 ret |= pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); 1251 ret |= pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
1252 hdw->cmd_buffer[0] = FX2CMD_MEMSEL; 1252 hdw->cmd_buffer[0] = FX2CMD_MEMSEL;
1253 hdw->cmd_buffer[1] = 0; 1253 hdw->cmd_buffer[1] = 0;
1254 ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,0,0); 1254 ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,NULL,0);
1255 } while (0); LOCK_GIVE(hdw->ctl_lock); 1255 } while (0); LOCK_GIVE(hdw->ctl_lock);
1256 1256
1257 if (ret) { 1257 if (ret) {
@@ -1320,7 +1320,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1320 LOCK_TAKE(hdw->ctl_lock); do { 1320 LOCK_TAKE(hdw->ctl_lock); do {
1321 hdw->cmd_buffer[0] = FX2CMD_MEMSEL; 1321 hdw->cmd_buffer[0] = FX2CMD_MEMSEL;
1322 hdw->cmd_buffer[1] = 0; 1322 hdw->cmd_buffer[1] = 0;
1323 ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,0,0); 1323 ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,NULL,0);
1324 } while (0); LOCK_GIVE(hdw->ctl_lock); 1324 } while (0); LOCK_GIVE(hdw->ctl_lock);
1325 1325
1326 if (ret) { 1326 if (ret) {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 5313d342666e..25d3830b482a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -808,11 +808,11 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp)
808{ 808{
809 if (vp->dev_video) { 809 if (vp->dev_video) {
810 pvr2_v4l2_dev_destroy(vp->dev_video); 810 pvr2_v4l2_dev_destroy(vp->dev_video);
811 vp->dev_video = 0; 811 vp->dev_video = NULL;
812 } 812 }
813 if (vp->dev_radio) { 813 if (vp->dev_radio) {
814 pvr2_v4l2_dev_destroy(vp->dev_radio); 814 pvr2_v4l2_dev_destroy(vp->dev_radio);
815 vp->dev_radio = 0; 815 vp->dev_radio = NULL;
816 } 816 }
817 817
818 pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_v4l2 id=%p",vp); 818 pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_v4l2 id=%p",vp);
@@ -1138,7 +1138,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1138{ 1138{
1139 int mindevnum; 1139 int mindevnum;
1140 int unit_number; 1140 int unit_number;
1141 int *nr_ptr = 0; 1141 int *nr_ptr = NULL;
1142 dip->v4lp = vp; 1142 dip->v4lp = vp;
1143 1143
1144 1144
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index 295e931c0dfb..4b232124a1ab 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -211,7 +211,7 @@ static struct workqueue_struct *led_workqueue;
211 enum led_brightness value); \ 211 enum led_brightness value); \
212 static void object##_led_update(struct work_struct *ignored); \ 212 static void object##_led_update(struct work_struct *ignored); \
213 static int object##_led_wk; \ 213 static int object##_led_wk; \
214 DECLARE_WORK(object##_led_work, object##_led_update); \ 214 static DECLARE_WORK(object##_led_work, object##_led_update); \
215 static struct led_classdev object##_led = { \ 215 static struct led_classdev object##_led = { \
216 .name = "asus:" ledname, \ 216 .name = "asus:" ledname, \
217 .brightness_set = object##_led_set, \ 217 .brightness_set = object##_led_set, \
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 2ebe240dd537..ac708bc2f9f3 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -453,7 +453,7 @@ static int sony_acpi_resume(struct acpi_device *device)
453static int sony_acpi_add(struct acpi_device *device) 453static int sony_acpi_add(struct acpi_device *device)
454{ 454{
455 acpi_status status; 455 acpi_status status;
456 int result; 456 int result = 0;
457 acpi_handle handle; 457 acpi_handle handle;
458 458
459 sony_acpi_acpi_device = device; 459 sony_acpi_acpi_device = device;
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c
index b060d4bfba29..0de5c9e94e74 100644
--- a/drivers/mmc/imxmmc.c
+++ b/drivers/mmc/imxmmc.c
@@ -569,10 +569,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat)
569 569
570 if(host->dma_dir == DMA_FROM_DEVICE) { 570 if(host->dma_dir == DMA_FROM_DEVICE) {
571 imxmci_busy_wait_for_status(host, &stat, 571 imxmci_busy_wait_for_status(host, &stat,
572 STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE, 572 STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE |
573 STATUS_TIME_OUT_READ,
573 50, "imxmci_cpu_driven_data read"); 574 50, "imxmci_cpu_driven_data read");
574 575
575 while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) && 576 while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) &&
577 !(stat & STATUS_TIME_OUT_READ) &&
576 (host->data_cnt < 512)) { 578 (host->data_cnt < 512)) {
577 579
578 udelay(20); /* required for clocks < 8MHz*/ 580 udelay(20); /* required for clocks < 8MHz*/
@@ -602,6 +604,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat)
602 if(host->dma_size & 0x1ff) 604 if(host->dma_size & 0x1ff)
603 stat &= ~STATUS_CRC_READ_ERR; 605 stat &= ~STATUS_CRC_READ_ERR;
604 606
607 if(stat & STATUS_TIME_OUT_READ) {
608 dev_dbg(mmc_dev(host->mmc), "imxmci_cpu_driven_data read timeout STATUS = 0x%x\n",
609 stat);
610 trans_done = -1;
611 }
612
605 } else { 613 } else {
606 imxmci_busy_wait_for_status(host, &stat, 614 imxmci_busy_wait_for_status(host, &stat,
607 STATUS_APPL_BUFF_FE, 615 STATUS_APPL_BUFF_FE,
@@ -709,6 +717,9 @@ static void imxmci_tasklet_fnc(unsigned long data)
709 */ 717 */
710 stat |= host->status_reg; 718 stat |= host->status_reg;
711 719
720 if(test_bit(IMXMCI_PEND_CPU_DATA_b, &host->pending_events))
721 stat &= ~STATUS_CRC_READ_ERR;
722
712 if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) { 723 if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) {
713 imxmci_busy_wait_for_status(host, &stat, 724 imxmci_busy_wait_for_status(host, &stat,
714 STATUS_END_CMD_RESP | STATUS_ERR_MASK, 725 STATUS_END_CMD_RESP | STATUS_ERR_MASK,
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 5046a1661342..4a73e8b2428d 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -376,10 +376,11 @@ static inline void mmc_set_ios(struct mmc_host *host)
376{ 376{
377 struct mmc_ios *ios = &host->ios; 377 struct mmc_ios *ios = &host->ios;
378 378
379 pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n", 379 pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u "
380 "width %u timing %u\n",
380 mmc_hostname(host), ios->clock, ios->bus_mode, 381 mmc_hostname(host), ios->clock, ios->bus_mode,
381 ios->power_mode, ios->chip_select, ios->vdd, 382 ios->power_mode, ios->chip_select, ios->vdd,
382 ios->bus_width); 383 ios->bus_width, ios->timing);
383 384
384 host->ops->set_ios(host, ios); 385 host->ops->set_ios(host, ios);
385} 386}
@@ -809,6 +810,7 @@ static void mmc_power_up(struct mmc_host *host)
809 host->ios.chip_select = MMC_CS_DONTCARE; 810 host->ios.chip_select = MMC_CS_DONTCARE;
810 host->ios.power_mode = MMC_POWER_UP; 811 host->ios.power_mode = MMC_POWER_UP;
811 host->ios.bus_width = MMC_BUS_WIDTH_1; 812 host->ios.bus_width = MMC_BUS_WIDTH_1;
813 host->ios.timing = MMC_TIMING_LEGACY;
812 mmc_set_ios(host); 814 mmc_set_ios(host);
813 815
814 mmc_delay(1); 816 mmc_delay(1);
@@ -828,6 +830,7 @@ static void mmc_power_off(struct mmc_host *host)
828 host->ios.chip_select = MMC_CS_DONTCARE; 830 host->ios.chip_select = MMC_CS_DONTCARE;
829 host->ios.power_mode = MMC_POWER_OFF; 831 host->ios.power_mode = MMC_POWER_OFF;
830 host->ios.bus_width = MMC_BUS_WIDTH_1; 832 host->ios.bus_width = MMC_BUS_WIDTH_1;
833 host->ios.timing = MMC_TIMING_LEGACY;
831 mmc_set_ios(host); 834 mmc_set_ios(host);
832} 835}
833 836
@@ -1112,46 +1115,50 @@ static void mmc_process_ext_csds(struct mmc_host *host)
1112 continue; 1115 continue;
1113 } 1116 }
1114 1117
1115 /* Activate highspeed support. */ 1118 if (host->caps & MMC_CAP_MMC_HIGHSPEED) {
1116 cmd.opcode = MMC_SWITCH; 1119 /* Activate highspeed support. */
1117 cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) | 1120 cmd.opcode = MMC_SWITCH;
1118 (EXT_CSD_HS_TIMING << 16) | 1121 cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
1119 (1 << 8) | 1122 (EXT_CSD_HS_TIMING << 16) |
1120 EXT_CSD_CMD_SET_NORMAL; 1123 (1 << 8) |
1121 cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; 1124 EXT_CSD_CMD_SET_NORMAL;
1125 cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
1122 1126
1123 err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); 1127 err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES);
1124 if (err != MMC_ERR_NONE) { 1128 if (err != MMC_ERR_NONE) {
1125 printk("%s: failed to switch card to mmc v4 " 1129 printk("%s: failed to switch card to mmc v4 "
1126 "high-speed mode.\n", 1130 "high-speed mode.\n",
1127 mmc_hostname(card->host)); 1131 mmc_hostname(card->host));
1128 continue; 1132 continue;
1129 } 1133 }
1130 1134
1131 mmc_card_set_highspeed(card); 1135 mmc_card_set_highspeed(card);
1132 1136
1133 /* Check for host support for wide-bus modes. */ 1137 host->ios.timing = MMC_TIMING_SD_HS;
1134 if (!(host->caps & MMC_CAP_4_BIT_DATA)) { 1138 mmc_set_ios(host);
1135 continue;
1136 } 1139 }
1137 1140
1138 /* Activate 4-bit support. */ 1141 /* Check for host support for wide-bus modes. */
1139 cmd.opcode = MMC_SWITCH; 1142 if (host->caps & MMC_CAP_4_BIT_DATA) {
1140 cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) | 1143 /* Activate 4-bit support. */
1141 (EXT_CSD_BUS_WIDTH << 16) | 1144 cmd.opcode = MMC_SWITCH;
1142 (EXT_CSD_BUS_WIDTH_4 << 8) | 1145 cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
1143 EXT_CSD_CMD_SET_NORMAL; 1146 (EXT_CSD_BUS_WIDTH << 16) |
1144 cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; 1147 (EXT_CSD_BUS_WIDTH_4 << 8) |
1148 EXT_CSD_CMD_SET_NORMAL;
1149 cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
1145 1150
1146 err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); 1151 err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES);
1147 if (err != MMC_ERR_NONE) { 1152 if (err != MMC_ERR_NONE) {
1148 printk("%s: failed to switch card to " 1153 printk("%s: failed to switch card to "
1149 "mmc v4 4-bit bus mode.\n", 1154 "mmc v4 4-bit bus mode.\n",
1150 mmc_hostname(card->host)); 1155 mmc_hostname(card->host));
1151 continue; 1156 continue;
1152 } 1157 }
1153 1158
1154 host->ios.bus_width = MMC_BUS_WIDTH_4; 1159 host->ios.bus_width = MMC_BUS_WIDTH_4;
1160 mmc_set_ios(host);
1161 }
1155 } 1162 }
1156 1163
1157 kfree(ext_csd); 1164 kfree(ext_csd);
@@ -1241,6 +1248,9 @@ static void mmc_read_switch_caps(struct mmc_host *host)
1241 unsigned char *status; 1248 unsigned char *status;
1242 struct scatterlist sg; 1249 struct scatterlist sg;
1243 1250
1251 if (!(host->caps & MMC_CAP_SD_HIGHSPEED))
1252 return;
1253
1244 status = kmalloc(64, GFP_KERNEL); 1254 status = kmalloc(64, GFP_KERNEL);
1245 if (!status) { 1255 if (!status) {
1246 printk(KERN_WARNING "%s: Unable to allocate buffer for " 1256 printk(KERN_WARNING "%s: Unable to allocate buffer for "
@@ -1332,6 +1342,9 @@ static void mmc_read_switch_caps(struct mmc_host *host)
1332 } 1342 }
1333 1343
1334 mmc_card_set_highspeed(card); 1344 mmc_card_set_highspeed(card);
1345
1346 host->ios.timing = MMC_TIMING_SD_HS;
1347 mmc_set_ios(host);
1335 } 1348 }
1336 1349
1337 kfree(status); 1350 kfree(status);
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 7522f76b15ec..d749f08601b8 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -606,7 +606,6 @@ static void sdhci_finish_command(struct sdhci_host *host)
606static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) 606static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
607{ 607{
608 int div; 608 int div;
609 u8 ctrl;
610 u16 clk; 609 u16 clk;
611 unsigned long timeout; 610 unsigned long timeout;
612 611
@@ -615,13 +614,6 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
615 614
616 writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); 615 writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL);
617 616
618 ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL);
619 if (clock > 25000000)
620 ctrl |= SDHCI_CTRL_HISPD;
621 else
622 ctrl &= ~SDHCI_CTRL_HISPD;
623 writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL);
624
625 if (clock == 0) 617 if (clock == 0)
626 goto out; 618 goto out;
627 619
@@ -761,10 +753,17 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
761 sdhci_set_power(host, ios->vdd); 753 sdhci_set_power(host, ios->vdd);
762 754
763 ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); 755 ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL);
756
764 if (ios->bus_width == MMC_BUS_WIDTH_4) 757 if (ios->bus_width == MMC_BUS_WIDTH_4)
765 ctrl |= SDHCI_CTRL_4BITBUS; 758 ctrl |= SDHCI_CTRL_4BITBUS;
766 else 759 else
767 ctrl &= ~SDHCI_CTRL_4BITBUS; 760 ctrl &= ~SDHCI_CTRL_4BITBUS;
761
762 if (ios->timing == MMC_TIMING_SD_HS)
763 ctrl |= SDHCI_CTRL_HISPD;
764 else
765 ctrl &= ~SDHCI_CTRL_HISPD;
766
768 writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); 767 writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL);
769 768
770 mmiowb(); 769 mmiowb();
@@ -994,7 +993,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
994 993
995 intmask = readl(host->ioaddr + SDHCI_INT_STATUS); 994 intmask = readl(host->ioaddr + SDHCI_INT_STATUS);
996 995
997 if (!intmask) { 996 if (!intmask || intmask == 0xffffffff) {
998 result = IRQ_NONE; 997 result = IRQ_NONE;
999 goto out; 998 goto out;
1000 } 999 }
@@ -1080,6 +1079,13 @@ static int sdhci_suspend (struct pci_dev *pdev, pm_message_t state)
1080 1079
1081 pci_save_state(pdev); 1080 pci_save_state(pdev);
1082 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); 1081 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
1082
1083 for (i = 0;i < chip->num_slots;i++) {
1084 if (!chip->hosts[i])
1085 continue;
1086 free_irq(chip->hosts[i]->irq, chip->hosts[i]);
1087 }
1088
1083 pci_disable_device(pdev); 1089 pci_disable_device(pdev);
1084 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 1090 pci_set_power_state(pdev, pci_choose_state(pdev, state));
1085 1091
@@ -1108,6 +1114,11 @@ static int sdhci_resume (struct pci_dev *pdev)
1108 continue; 1114 continue;
1109 if (chip->hosts[i]->flags & SDHCI_USE_DMA) 1115 if (chip->hosts[i]->flags & SDHCI_USE_DMA)
1110 pci_set_master(pdev); 1116 pci_set_master(pdev);
1117 ret = request_irq(chip->hosts[i]->irq, sdhci_irq,
1118 IRQF_SHARED, chip->hosts[i]->slot_descr,
1119 chip->hosts[i]);
1120 if (ret)
1121 return ret;
1111 sdhci_init(chip->hosts[i]); 1122 sdhci_init(chip->hosts[i]);
1112 mmiowb(); 1123 mmiowb();
1113 ret = mmc_resume_host(chip->hosts[i]->mmc); 1124 ret = mmc_resume_host(chip->hosts[i]->mmc);
@@ -1274,6 +1285,9 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
1274 mmc->f_max = host->max_clk; 1285 mmc->f_max = host->max_clk;
1275 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK; 1286 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK;
1276 1287
1288 if (caps & SDHCI_CAN_DO_HISPD)
1289 mmc->caps |= MMC_CAP_SD_HIGHSPEED;
1290
1277 mmc->ocr_avail = 0; 1291 mmc->ocr_avail = 0;
1278 if (caps & SDHCI_CAN_VDD_330) 1292 if (caps & SDHCI_CAN_VDD_330)
1279 mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34; 1293 mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34;
@@ -1282,13 +1296,6 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
1282 if (caps & SDHCI_CAN_VDD_180) 1296 if (caps & SDHCI_CAN_VDD_180)
1283 mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19; 1297 mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19;
1284 1298
1285 if ((host->max_clk > 25000000) && !(caps & SDHCI_CAN_DO_HISPD)) {
1286 printk(KERN_ERR "%s: Controller reports > 25 MHz base clock,"
1287 " but no high speed support.\n",
1288 host->slot_descr);
1289 mmc->f_max = 25000000;
1290 }
1291
1292 if (mmc->ocr_avail == 0) { 1299 if (mmc->ocr_avail == 0) {
1293 printk(KERN_ERR "%s: Hardware doesn't report any " 1300 printk(KERN_ERR "%s: Hardware doesn't report any "
1294 "support voltages.\n", host->slot_descr); 1301 "support voltages.\n", host->slot_descr);
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index e3acd398fb37..1f6445840461 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -359,6 +359,8 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
359 cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp; 359 cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp;
360 cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp; 360 cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp;
361 cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp; 361 cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp;
362 cfi->chips[i].ref_point_counter = 0;
363 init_waitqueue_head(&(cfi->chips[i].wq));
362 } 364 }
363 365
364 map->fldrv = &cfi_amdstd_chipdrv; 366 map->fldrv = &cfi_amdstd_chipdrv;
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index 69d49e0250a9..b344ff858b2d 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -158,6 +158,8 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
158 cfi->chips[i].word_write_time = 128; 158 cfi->chips[i].word_write_time = 128;
159 cfi->chips[i].buffer_write_time = 128; 159 cfi->chips[i].buffer_write_time = 128;
160 cfi->chips[i].erase_time = 1024; 160 cfi->chips[i].erase_time = 1024;
161 cfi->chips[i].ref_point_counter = 0;
162 init_waitqueue_head(&(cfi->chips[i].wq));
161 } 163 }
162 164
163 return cfi_staa_setup(map); 165 return cfi_staa_setup(map);
diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c
index b1104fe1f207..1c3b34ad7325 100644
--- a/drivers/mtd/maps/dilnetpc.c
+++ b/drivers/mtd/maps/dilnetpc.c
@@ -402,8 +402,8 @@ static int __init init_dnpc(void)
402 ++higlvl_partition_info[i].name; 402 ++higlvl_partition_info[i].name;
403 } 403 }
404 404
405 printk(KERN_NOTICE "DIL/Net %s flash: 0x%lx at 0x%lx\n", 405 printk(KERN_NOTICE "DIL/Net %s flash: 0x%lx at 0x%llx\n",
406 is_dnp ? "DNPC" : "ADNP", dnpc_map.size, dnpc_map.phys); 406 is_dnp ? "DNPC" : "ADNP", dnpc_map.size, (unsigned long long)dnpc_map.phys);
407 407
408 dnpc_map.virt = ioremap_nocache(dnpc_map.phys, dnpc_map.size); 408 dnpc_map.virt = ioremap_nocache(dnpc_map.phys, dnpc_map.size);
409 409
diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c
index 0bc013fd66a3..aa64a4752781 100644
--- a/drivers/mtd/maps/esb2rom.c
+++ b/drivers/mtd/maps/esb2rom.c
@@ -30,7 +30,7 @@
30 30
31#define ROM_PROBE_STEP_SIZE (64*1024) /* 64KiB */ 31#define ROM_PROBE_STEP_SIZE (64*1024) /* 64KiB */
32 32
33#define BIOS_CNTL 0xDC 33#define BIOS_CNTL 0xDC
34#define BIOS_LOCK_ENABLE 0x02 34#define BIOS_LOCK_ENABLE 0x02
35#define BIOS_WRITE_ENABLE 0x01 35#define BIOS_WRITE_ENABLE 0x01
36 36
@@ -145,7 +145,7 @@ static void esb2rom_cleanup(struct esb2rom_window *window)
145} 145}
146 146
147static int __devinit esb2rom_init_one(struct pci_dev *pdev, 147static int __devinit esb2rom_init_one(struct pci_dev *pdev,
148 const struct pci_device_id *ent) 148 const struct pci_device_id *ent)
149{ 149{
150 static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL }; 150 static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
151 struct esb2rom_window *window = &esb2rom_window; 151 struct esb2rom_window *window = &esb2rom_window;
@@ -185,7 +185,7 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev,
185 /* Find a region continuous to the end of the ROM window */ 185 /* Find a region continuous to the end of the ROM window */
186 window->phys = 0; 186 window->phys = 0;
187 pci_read_config_word(pdev, FWH_DEC_EN1, &word); 187 pci_read_config_word(pdev, FWH_DEC_EN1, &word);
188 printk(KERN_DEBUG "pci_read_config_byte : %x\n", word); 188 printk(KERN_DEBUG "pci_read_config_word : %x\n", word);
189 189
190 if ((word & FWH_8MiB) == FWH_8MiB) 190 if ((word & FWH_8MiB) == FWH_8MiB)
191 window->phys = 0xff400000; 191 window->phys = 0xff400000;
@@ -212,6 +212,11 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev,
212 else if ((word & FWH_0_5MiB) == FWH_0_5MiB) 212 else if ((word & FWH_0_5MiB) == FWH_0_5MiB)
213 window->phys = 0xfff80000; 213 window->phys = 0xfff80000;
214 214
215 if (window->phys == 0) {
216 printk(KERN_ERR MOD_NAME ": Rom window is closed\n");
217 goto out;
218 }
219
215 /* reserved 0x0020 and 0x0010 */ 220 /* reserved 0x0020 and 0x0010 */
216 window->phys -= 0x400000UL; 221 window->phys -= 0x400000UL;
217 window->size = (0xffffffffUL - window->phys) + 1UL; 222 window->size = (0xffffffffUL - window->phys) + 1UL;
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 880580c44e01..41844ea02462 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -727,6 +727,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
727 concat->mtd.erasesize = subdev[0]->erasesize; 727 concat->mtd.erasesize = subdev[0]->erasesize;
728 concat->mtd.writesize = subdev[0]->writesize; 728 concat->mtd.writesize = subdev[0]->writesize;
729 concat->mtd.oobsize = subdev[0]->oobsize; 729 concat->mtd.oobsize = subdev[0]->oobsize;
730 concat->mtd.oobavail = subdev[0]->oobavail;
730 if (subdev[0]->writev) 731 if (subdev[0]->writev)
731 concat->mtd.writev = concat_writev; 732 concat->mtd.writev = concat_writev;
732 if (subdev[0]->read_oob) 733 if (subdev[0]->read_oob)
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 633def3fb087..1af989023c66 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -200,6 +200,11 @@ static int part_erase (struct mtd_info *mtd, struct erase_info *instr)
200 return -EINVAL; 200 return -EINVAL;
201 instr->addr += part->offset; 201 instr->addr += part->offset;
202 ret = part->master->erase(part->master, instr); 202 ret = part->master->erase(part->master, instr);
203 if (ret) {
204 if (instr->fail_addr != 0xffffffff)
205 instr->fail_addr -= part->offset;
206 instr->addr -= part->offset;
207 }
203 return ret; 208 return ret;
204} 209}
205 210
@@ -338,6 +343,7 @@ int add_mtd_partitions(struct mtd_info *master,
338 slave->mtd.size = parts[i].size; 343 slave->mtd.size = parts[i].size;
339 slave->mtd.writesize = master->writesize; 344 slave->mtd.writesize = master->writesize;
340 slave->mtd.oobsize = master->oobsize; 345 slave->mtd.oobsize = master->oobsize;
346 slave->mtd.oobavail = master->oobavail;
341 slave->mtd.subpage_sft = master->subpage_sft; 347 slave->mtd.subpage_sft = master->subpage_sft;
342 348
343 slave->mtd.name = parts[i].name; 349 slave->mtd.name = parts[i].name;
@@ -559,4 +565,3 @@ EXPORT_SYMBOL_GPL(deregister_mtd_parser);
559MODULE_LICENSE("GPL"); 565MODULE_LICENSE("GPL");
560MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>"); 566MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>");
561MODULE_DESCRIPTION("Generic support for partitioning of MTD devices"); 567MODULE_DESCRIPTION("Generic support for partitioning of MTD devices");
562
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index 12608c13cce5..595208f965a5 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -114,7 +114,7 @@ module_param(no_autopart, int, 0);
114static int show_firmware_partition = 0; 114static int show_firmware_partition = 0;
115module_param(show_firmware_partition, int, 0); 115module_param(show_firmware_partition, int, 0);
116 116
117#ifdef MTD_NAND_DISKONCHIP_BBTWRITE 117#ifdef CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE
118static int inftl_bbt_write = 1; 118static int inftl_bbt_write = 1;
119#else 119#else
120static int inftl_bbt_write = 0; 120static int inftl_bbt_write = 0;
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index acaf97bc80d1..6af37b8cff65 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2524,6 +2524,7 @@ int nand_scan_tail(struct mtd_info *mtd)
2524 for (i = 0; chip->ecc.layout->oobfree[i].length; i++) 2524 for (i = 0; chip->ecc.layout->oobfree[i].length; i++)
2525 chip->ecc.layout->oobavail += 2525 chip->ecc.layout->oobavail +=
2526 chip->ecc.layout->oobfree[i].length; 2526 chip->ecc.layout->oobfree[i].length;
2527 mtd->oobavail = chip->ecc.layout->oobavail;
2527 2528
2528 /* 2529 /*
2529 * Set the number of read / write steps for one page depending on ECC 2530 * Set the number of read / write steps for one page depending on ECC
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 7f1cb6e5dccb..9e14a26ca4e8 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -4,6 +4,11 @@
4 * Copyright (C) 2005-2007 Samsung Electronics 4 * Copyright (C) 2005-2007 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
6 * 6 *
7 * Credits:
8 * Adrian Hunter <ext-adrian.hunter@nokia.com>:
9 * auto-placement support, read-while load support, various fixes
10 * Copyright (C) Nokia Corporation, 2007
11 *
7 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
@@ -831,7 +836,7 @@ static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int col
831 int readcol = column; 836 int readcol = column;
832 int readend = column + thislen; 837 int readend = column + thislen;
833 int lastgap = 0; 838 int lastgap = 0;
834 uint8_t *oob_buf = this->page_buf + mtd->writesize; 839 uint8_t *oob_buf = this->oob_buf;
835 840
836 for (free = this->ecclayout->oobfree; free->length; ++free) { 841 for (free = this->ecclayout->oobfree; free->length; ++free) {
837 if (readcol >= lastgap) 842 if (readcol >= lastgap)
@@ -849,7 +854,8 @@ static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int col
849 int n = ed - st; 854 int n = ed - st;
850 memcpy(buf, oob_buf + st, n); 855 memcpy(buf, oob_buf + st, n);
851 buf += n; 856 buf += n;
852 } 857 } else
858 break;
853 } 859 }
854 return 0; 860 return 0;
855} 861}
@@ -947,9 +953,9 @@ static int onenand_do_read_oob(struct mtd_info *mtd, loff_t from, size_t len,
947 953
948/** 954/**
949 * onenand_read_oob - [MTD Interface] NAND write data and/or out-of-band 955 * onenand_read_oob - [MTD Interface] NAND write data and/or out-of-band
950 * @mtd: MTD device structure 956 * @param mtd: MTD device structure
951 * @from: offset to read from 957 * @param from: offset to read from
952 * @ops: oob operation description structure 958 * @param ops: oob operation description structure
953 */ 959 */
954static int onenand_read_oob(struct mtd_info *mtd, loff_t from, 960static int onenand_read_oob(struct mtd_info *mtd, loff_t from,
955 struct mtd_oob_ops *ops) 961 struct mtd_oob_ops *ops)
@@ -1017,7 +1023,7 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state)
1017 * onenand_bbt_read_oob - [MTD Interface] OneNAND read out-of-band for bbt scan 1023 * onenand_bbt_read_oob - [MTD Interface] OneNAND read out-of-band for bbt scan
1018 * @param mtd MTD device structure 1024 * @param mtd MTD device structure
1019 * @param from offset to read from 1025 * @param from offset to read from
1020 * @param @ops oob operation description structure 1026 * @param ops oob operation description structure
1021 * 1027 *
1022 * OneNAND read out-of-band data from the spare area for bbt scan 1028 * OneNAND read out-of-band data from the spare area for bbt scan
1023 */ 1029 */
@@ -1093,7 +1099,7 @@ int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
1093static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to) 1099static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to)
1094{ 1100{
1095 struct onenand_chip *this = mtd->priv; 1101 struct onenand_chip *this = mtd->priv;
1096 char *readp = this->page_buf + mtd->writesize; 1102 char oobbuf[64];
1097 int status, i; 1103 int status, i;
1098 1104
1099 this->command(mtd, ONENAND_CMD_READOOB, to, mtd->oobsize); 1105 this->command(mtd, ONENAND_CMD_READOOB, to, mtd->oobsize);
@@ -1102,9 +1108,9 @@ static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to
1102 if (status) 1108 if (status)
1103 return status; 1109 return status;
1104 1110
1105 this->read_bufferram(mtd, ONENAND_SPARERAM, readp, 0, mtd->oobsize); 1111 this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize);
1106 for(i = 0; i < mtd->oobsize; i++) 1112 for (i = 0; i < mtd->oobsize; i++)
1107 if (buf[i] != 0xFF && buf[i] != readp[i]) 1113 if (buf[i] != 0xFF && buf[i] != oobbuf[i])
1108 return -EBADMSG; 1114 return -EBADMSG;
1109 1115
1110 return 0; 1116 return 0;
@@ -1290,7 +1296,8 @@ static int onenand_fill_auto_oob(struct mtd_info *mtd, u_char *oob_buf,
1290 int n = ed - st; 1296 int n = ed - st;
1291 memcpy(oob_buf + st, buf, n); 1297 memcpy(oob_buf + st, buf, n);
1292 buf += n; 1298 buf += n;
1293 } 1299 } else
1300 break;
1294 } 1301 }
1295 return 0; 1302 return 0;
1296} 1303}
@@ -1312,6 +1319,7 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
1312 struct onenand_chip *this = mtd->priv; 1319 struct onenand_chip *this = mtd->priv;
1313 int column, ret = 0, oobsize; 1320 int column, ret = 0, oobsize;
1314 int written = 0; 1321 int written = 0;
1322 u_char *oobbuf;
1315 1323
1316 DEBUG(MTD_DEBUG_LEVEL3, "onenand_write_oob: to = 0x%08x, len = %i\n", (unsigned int) to, (int) len); 1324 DEBUG(MTD_DEBUG_LEVEL3, "onenand_write_oob: to = 0x%08x, len = %i\n", (unsigned int) to, (int) len);
1317 1325
@@ -1331,7 +1339,7 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
1331 } 1339 }
1332 1340
1333 /* For compatibility with NAND: Do not allow write past end of page */ 1341 /* For compatibility with NAND: Do not allow write past end of page */
1334 if (column + len > oobsize) { 1342 if (unlikely(column + len > oobsize)) {
1335 printk(KERN_ERR "onenand_write_oob: " 1343 printk(KERN_ERR "onenand_write_oob: "
1336 "Attempt to write past end of page\n"); 1344 "Attempt to write past end of page\n");
1337 return -EINVAL; 1345 return -EINVAL;
@@ -1348,6 +1356,8 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
1348 /* Grab the lock and see if the device is available */ 1356 /* Grab the lock and see if the device is available */
1349 onenand_get_device(mtd, FL_WRITING); 1357 onenand_get_device(mtd, FL_WRITING);
1350 1358
1359 oobbuf = this->oob_buf;
1360
1351 /* Loop until all data write */ 1361 /* Loop until all data write */
1352 while (written < len) { 1362 while (written < len) {
1353 int thislen = min_t(int, oobsize, len - written); 1363 int thislen = min_t(int, oobsize, len - written);
@@ -1358,12 +1368,12 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
1358 1368
1359 /* We send data to spare ram with oobsize 1369 /* We send data to spare ram with oobsize
1360 * to prevent byte access */ 1370 * to prevent byte access */
1361 memset(this->page_buf, 0xff, mtd->oobsize); 1371 memset(oobbuf, 0xff, mtd->oobsize);
1362 if (mode == MTD_OOB_AUTO) 1372 if (mode == MTD_OOB_AUTO)
1363 onenand_fill_auto_oob(mtd, this->page_buf, buf, column, thislen); 1373 onenand_fill_auto_oob(mtd, oobbuf, buf, column, thislen);
1364 else 1374 else
1365 memcpy(this->page_buf + column, buf, thislen); 1375 memcpy(oobbuf + column, buf, thislen);
1366 this->write_bufferram(mtd, ONENAND_SPARERAM, this->page_buf, 0, mtd->oobsize); 1376 this->write_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize);
1367 1377
1368 this->command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize); 1378 this->command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize);
1369 1379
@@ -1375,7 +1385,7 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
1375 break; 1385 break;
1376 } 1386 }
1377 1387
1378 ret = onenand_verify_oob(mtd, this->page_buf, to); 1388 ret = onenand_verify_oob(mtd, oobbuf, to);
1379 if (ret) { 1389 if (ret) {
1380 printk(KERN_ERR "onenand_write_oob: verify failed %d\n", ret); 1390 printk(KERN_ERR "onenand_write_oob: verify failed %d\n", ret);
1381 break; 1391 break;
@@ -1400,9 +1410,9 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
1400 1410
1401/** 1411/**
1402 * onenand_write_oob - [MTD Interface] NAND write data and/or out-of-band 1412 * onenand_write_oob - [MTD Interface] NAND write data and/or out-of-band
1403 * @mtd: MTD device structure 1413 * @param mtd: MTD device structure
1404 * @from: offset to read from 1414 * @param to: offset to write
1405 * @ops: oob operation description structure 1415 * @param ops: oob operation description structure
1406 */ 1416 */
1407static int onenand_write_oob(struct mtd_info *mtd, loff_t to, 1417static int onenand_write_oob(struct mtd_info *mtd, loff_t to,
1408 struct mtd_oob_ops *ops) 1418 struct mtd_oob_ops *ops)
@@ -1616,6 +1626,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
1616 * @param mtd MTD device structure 1626 * @param mtd MTD device structure
1617 * @param ofs offset relative to mtd start 1627 * @param ofs offset relative to mtd start
1618 * @param len number of bytes to lock or unlock 1628 * @param len number of bytes to lock or unlock
1629 * @param cmd lock or unlock command
1619 * 1630 *
1620 * Lock or unlock one or more blocks 1631 * Lock or unlock one or more blocks
1621 */ 1632 */
@@ -2117,10 +2128,11 @@ static void onenand_check_features(struct mtd_info *mtd)
2117} 2128}
2118 2129
2119/** 2130/**
2120 * onenand_print_device_info - Print device ID 2131 * onenand_print_device_info - Print device & version ID
2121 * @param device device ID 2132 * @param device device ID
2133 * @param version version ID
2122 * 2134 *
2123 * Print device ID 2135 * Print device & version ID
2124 */ 2136 */
2125static void onenand_print_device_info(int device, int version) 2137static void onenand_print_device_info(int device, int version)
2126{ 2138{
@@ -2320,15 +2332,25 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
2320 2332
2321 /* Allocate buffers, if necessary */ 2333 /* Allocate buffers, if necessary */
2322 if (!this->page_buf) { 2334 if (!this->page_buf) {
2323 size_t len; 2335 this->page_buf = kzalloc(mtd->writesize, GFP_KERNEL);
2324 len = mtd->writesize + mtd->oobsize;
2325 this->page_buf = kmalloc(len, GFP_KERNEL);
2326 if (!this->page_buf) { 2336 if (!this->page_buf) {
2327 printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n"); 2337 printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n");
2328 return -ENOMEM; 2338 return -ENOMEM;
2329 } 2339 }
2330 this->options |= ONENAND_PAGEBUF_ALLOC; 2340 this->options |= ONENAND_PAGEBUF_ALLOC;
2331 } 2341 }
2342 if (!this->oob_buf) {
2343 this->oob_buf = kzalloc(mtd->oobsize, GFP_KERNEL);
2344 if (!this->oob_buf) {
2345 printk(KERN_ERR "onenand_scan(): Can't allocate oob_buf\n");
2346 if (this->options & ONENAND_PAGEBUF_ALLOC) {
2347 this->options &= ~ONENAND_PAGEBUF_ALLOC;
2348 kfree(this->page_buf);
2349 }
2350 return -ENOMEM;
2351 }
2352 this->options |= ONENAND_OOBBUF_ALLOC;
2353 }
2332 2354
2333 this->state = FL_READY; 2355 this->state = FL_READY;
2334 init_waitqueue_head(&this->wq); 2356 init_waitqueue_head(&this->wq);
@@ -2367,6 +2389,7 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
2367 for (i = 0; this->ecclayout->oobfree[i].length; i++) 2389 for (i = 0; this->ecclayout->oobfree[i].length; i++)
2368 this->ecclayout->oobavail += 2390 this->ecclayout->oobavail +=
2369 this->ecclayout->oobfree[i].length; 2391 this->ecclayout->oobfree[i].length;
2392 mtd->oobavail = this->ecclayout->oobavail;
2370 2393
2371 mtd->ecclayout = this->ecclayout; 2394 mtd->ecclayout = this->ecclayout;
2372 2395
@@ -2424,9 +2447,11 @@ void onenand_release(struct mtd_info *mtd)
2424 kfree(bbm->bbt); 2447 kfree(bbm->bbt);
2425 kfree(this->bbm); 2448 kfree(this->bbm);
2426 } 2449 }
2427 /* Buffer allocated by onenand_scan */ 2450 /* Buffers allocated by onenand_scan */
2428 if (this->options & ONENAND_PAGEBUF_ALLOC) 2451 if (this->options & ONENAND_PAGEBUF_ALLOC)
2429 kfree(this->page_buf); 2452 kfree(this->page_buf);
2453 if (this->options & ONENAND_OOBBUF_ALLOC)
2454 kfree(this->oob_buf);
2430} 2455}
2431 2456
2432EXPORT_SYMBOL_GPL(onenand_scan); 2457EXPORT_SYMBOL_GPL(onenand_scan);
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 716a47210aa3..b406ecfa7268 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -822,11 +822,17 @@ static int vortex_resume(struct pci_dev *pdev)
822{ 822{
823 struct net_device *dev = pci_get_drvdata(pdev); 823 struct net_device *dev = pci_get_drvdata(pdev);
824 struct vortex_private *vp = netdev_priv(dev); 824 struct vortex_private *vp = netdev_priv(dev);
825 int err;
825 826
826 if (dev && vp) { 827 if (dev && vp) {
827 pci_set_power_state(pdev, PCI_D0); 828 pci_set_power_state(pdev, PCI_D0);
828 pci_restore_state(pdev); 829 pci_restore_state(pdev);
829 pci_enable_device(pdev); 830 err = pci_enable_device(pdev);
831 if (err) {
832 printk(KERN_WARNING "%s: Could not enable device \n",
833 dev->name);
834 return err;
835 }
830 pci_set_master(pdev); 836 pci_set_master(pdev);
831 if (request_irq(dev->irq, vp->full_bus_master_rx ? 837 if (request_irq(dev->irq, vp->full_bus_master_rx ?
832 &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) { 838 &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) {
@@ -852,19 +858,7 @@ static struct eisa_device_id vortex_eisa_ids[] = {
852}; 858};
853MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); 859MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids);
854 860
855static int vortex_eisa_probe(struct device *device); 861static int __init vortex_eisa_probe(struct device *device)
856static int vortex_eisa_remove(struct device *device);
857
858static struct eisa_driver vortex_eisa_driver = {
859 .id_table = vortex_eisa_ids,
860 .driver = {
861 .name = "3c59x",
862 .probe = vortex_eisa_probe,
863 .remove = vortex_eisa_remove
864 }
865};
866
867static int vortex_eisa_probe(struct device *device)
868{ 862{
869 void __iomem *ioaddr; 863 void __iomem *ioaddr;
870 struct eisa_device *edev; 864 struct eisa_device *edev;
@@ -887,7 +881,7 @@ static int vortex_eisa_probe(struct device *device)
887 return 0; 881 return 0;
888} 882}
889 883
890static int vortex_eisa_remove(struct device *device) 884static int __devexit vortex_eisa_remove(struct device *device)
891{ 885{
892 struct eisa_device *edev; 886 struct eisa_device *edev;
893 struct net_device *dev; 887 struct net_device *dev;
@@ -912,7 +906,17 @@ static int vortex_eisa_remove(struct device *device)
912 free_netdev(dev); 906 free_netdev(dev);
913 return 0; 907 return 0;
914} 908}
915#endif 909
910static struct eisa_driver vortex_eisa_driver = {
911 .id_table = vortex_eisa_ids,
912 .driver = {
913 .name = "3c59x",
914 .probe = vortex_eisa_probe,
915 .remove = __devexit_p(vortex_eisa_remove)
916 }
917};
918
919#endif /* CONFIG_EISA */
916 920
917/* returns count found (>= 0), or negative on error */ 921/* returns count found (>= 0), or negative on error */
918static int __init vortex_eisa_init(void) 922static int __init vortex_eisa_init(void)
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 88d4f70035bb..dee3638ad744 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1328,7 +1328,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
1328 1328
1329 if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { 1329 if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
1330 cso = skb->h.raw - skb->data; 1330 cso = skb->h.raw - skb->data;
1331 css = (skb->h.raw + skb->csum) - skb->data; 1331 css = (skb->h.raw + skb->csum_offset) - skb->data;
1332 if (unlikely(cso & 0x1)) { 1332 if (unlikely(cso & 0x1)) {
1333 printk(KERN_DEBUG "%s: payload offset != even number\n", 1333 printk(KERN_DEBUG "%s: payload offset != even number\n",
1334 atl1_driver_name); 1334 atl1_driver_name);
@@ -1562,7 +1562,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1562 /* mss will be nonzero if we're doing segment offload (TSO/GSO) */ 1562 /* mss will be nonzero if we're doing segment offload (TSO/GSO) */
1563 mss = skb_shinfo(skb)->gso_size; 1563 mss = skb_shinfo(skb)->gso_size;
1564 if (mss) { 1564 if (mss) {
1565 if (skb->protocol == ntohs(ETH_P_IP)) { 1565 if (skb->protocol == htons(ETH_P_IP)) {
1566 proto_hdr_len = ((skb->h.raw - skb->data) + 1566 proto_hdr_len = ((skb->h.raw - skb->data) +
1567 (skb->h.th->doff << 2)); 1567 (skb->h.th->doff << 2));
1568 if (unlikely(proto_hdr_len > len)) { 1568 if (unlikely(proto_hdr_len > len)) {
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ea73ebff4387..e4724d874e7c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -60,6 +60,7 @@
60#include <linux/errno.h> 60#include <linux/errno.h>
61#include <linux/netdevice.h> 61#include <linux/netdevice.h>
62#include <linux/inetdevice.h> 62#include <linux/inetdevice.h>
63#include <linux/igmp.h>
63#include <linux/etherdevice.h> 64#include <linux/etherdevice.h>
64#include <linux/skbuff.h> 65#include <linux/skbuff.h>
65#include <net/sock.h> 66#include <net/sock.h>
@@ -861,6 +862,28 @@ static void bond_mc_delete(struct bonding *bond, void *addr, int alen)
861 } 862 }
862} 863}
863 864
865
866/*
867 * Retrieve the list of registered multicast addresses for the bonding
868 * device and retransmit an IGMP JOIN request to the current active
869 * slave.
870 */
871static void bond_resend_igmp_join_requests(struct bonding *bond)
872{
873 struct in_device *in_dev;
874 struct ip_mc_list *im;
875
876 rcu_read_lock();
877 in_dev = __in_dev_get_rcu(bond->dev);
878 if (in_dev) {
879 for (im = in_dev->mc_list; im; im = im->next) {
880 ip_mc_rejoin_group(im);
881 }
882 }
883
884 rcu_read_unlock();
885}
886
864/* 887/*
865 * Totally destroys the mc_list in bond 888 * Totally destroys the mc_list in bond
866 */ 889 */
@@ -874,6 +897,7 @@ static void bond_mc_list_destroy(struct bonding *bond)
874 kfree(dmi); 897 kfree(dmi);
875 dmi = bond->mc_list; 898 dmi = bond->mc_list;
876 } 899 }
900 bond->mc_list = NULL;
877} 901}
878 902
879/* 903/*
@@ -967,6 +991,7 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct
967 for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) { 991 for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) {
968 dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); 992 dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
969 } 993 }
994 bond_resend_igmp_join_requests(bond);
970 } 995 }
971} 996}
972 997
@@ -3423,15 +3448,21 @@ void bond_register_arp(struct bonding *bond)
3423{ 3448{
3424 struct packet_type *pt = &bond->arp_mon_pt; 3449 struct packet_type *pt = &bond->arp_mon_pt;
3425 3450
3451 if (pt->type)
3452 return;
3453
3426 pt->type = htons(ETH_P_ARP); 3454 pt->type = htons(ETH_P_ARP);
3427 pt->dev = NULL; /*bond->dev;XXX*/ 3455 pt->dev = bond->dev;
3428 pt->func = bond_arp_rcv; 3456 pt->func = bond_arp_rcv;
3429 dev_add_pack(pt); 3457 dev_add_pack(pt);
3430} 3458}
3431 3459
3432void bond_unregister_arp(struct bonding *bond) 3460void bond_unregister_arp(struct bonding *bond)
3433{ 3461{
3434 dev_remove_pack(&bond->arp_mon_pt); 3462 struct packet_type *pt = &bond->arp_mon_pt;
3463
3464 dev_remove_pack(pt);
3465 pt->type = 0;
3435} 3466}
3436 3467
3437/*---------------------------- Hashing Policies -----------------------------*/ 3468/*---------------------------- Hashing Policies -----------------------------*/
@@ -4011,42 +4042,6 @@ out:
4011 return 0; 4042 return 0;
4012} 4043}
4013 4044
4014static void bond_activebackup_xmit_copy(struct sk_buff *skb,
4015 struct bonding *bond,
4016 struct slave *slave)
4017{
4018 struct sk_buff *skb2 = skb_copy(skb, GFP_ATOMIC);
4019 struct ethhdr *eth_data;
4020 u8 *hwaddr;
4021 int res;
4022
4023 if (!skb2) {
4024 printk(KERN_ERR DRV_NAME ": Error: "
4025 "bond_activebackup_xmit_copy(): skb_copy() failed\n");
4026 return;
4027 }
4028
4029 skb2->mac.raw = (unsigned char *)skb2->data;
4030 eth_data = eth_hdr(skb2);
4031
4032 /* Pick an appropriate source MAC address
4033 * -- use slave's perm MAC addr, unless used by bond
4034 * -- otherwise, borrow active slave's perm MAC addr
4035 * since that will not be used
4036 */
4037 hwaddr = slave->perm_hwaddr;
4038 if (!memcmp(eth_data->h_source, hwaddr, ETH_ALEN))
4039 hwaddr = bond->curr_active_slave->perm_hwaddr;
4040
4041 /* Set source MAC address appropriately */
4042 memcpy(eth_data->h_source, hwaddr, ETH_ALEN);
4043
4044 res = bond_dev_queue_xmit(bond, skb2, slave->dev);
4045 if (res)
4046 dev_kfree_skb(skb2);
4047
4048 return;
4049}
4050 4045
4051/* 4046/*
4052 * in active-backup mode, we know that bond->curr_active_slave is always valid if 4047 * in active-backup mode, we know that bond->curr_active_slave is always valid if
@@ -4067,21 +4062,6 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d
4067 if (!bond->curr_active_slave) 4062 if (!bond->curr_active_slave)
4068 goto out; 4063 goto out;
4069 4064
4070 /* Xmit IGMP frames on all slaves to ensure rapid fail-over
4071 for multicast traffic on snooping switches */
4072 if (skb->protocol == __constant_htons(ETH_P_IP) &&
4073 skb->nh.iph->protocol == IPPROTO_IGMP) {
4074 struct slave *slave, *active_slave;
4075 int i;
4076
4077 active_slave = bond->curr_active_slave;
4078 bond_for_each_slave_from_to(bond, slave, i, active_slave->next,
4079 active_slave->prev)
4080 if (IS_UP(slave->dev) &&
4081 (slave->link == BOND_LINK_UP))
4082 bond_activebackup_xmit_copy(skb, bond, slave);
4083 }
4084
4085 res = bond_dev_queue_xmit(bond, skb, bond->curr_active_slave->dev); 4065 res = bond_dev_queue_xmit(bond, skb, bond->curr_active_slave->dev);
4086 4066
4087out: 4067out:
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 02b61b85b62c..d981d4c41dd3 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1132,7 +1132,7 @@ static void gfar_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
1132 1132
1133 spin_lock_irqsave(&priv->rxlock, flags); 1133 spin_lock_irqsave(&priv->rxlock, flags);
1134 1134
1135 vlan_group_set_device(priv->vgrp, vid, NULL); 1135 vlan_group_set_device(priv->vlgrp, vid, NULL);
1136 1136
1137 spin_unlock_irqrestore(&priv->rxlock, flags); 1137 spin_unlock_irqrestore(&priv->rxlock, flags);
1138} 1138}
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index be2ddbb6ef56..1ee27c360a4b 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -787,6 +787,12 @@ static int mv643xx_eth_open(struct net_device *dev)
787 unsigned int size; 787 unsigned int size;
788 int err; 788 int err;
789 789
790 /* Clear any pending ethernet port interrupts */
791 mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
792 mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
793 /* wait for previous write to complete */
794 mv_read (MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num));
795
790 err = request_irq(dev->irq, mv643xx_eth_int_handler, 796 err = request_irq(dev->irq, mv643xx_eth_int_handler,
791 IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); 797 IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev);
792 if (err) { 798 if (err) {
@@ -875,10 +881,6 @@ static int mv643xx_eth_open(struct net_device *dev)
875 881
876 mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */ 882 mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */
877 883
878 /* Clear any pending ethernet port interrupts */
879 mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
880 mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
881
882 eth_port_start(dev); 884 eth_port_start(dev);
883 885
884 /* Interrupt Coalescing */ 886 /* Interrupt Coalescing */
@@ -1309,7 +1311,7 @@ static void mv643xx_init_ethtool_cmd(struct net_device *dev, int phy_address,
1309static int mv643xx_eth_probe(struct platform_device *pdev) 1311static int mv643xx_eth_probe(struct platform_device *pdev)
1310{ 1312{
1311 struct mv643xx_eth_platform_data *pd; 1313 struct mv643xx_eth_platform_data *pd;
1312 int port_num = pdev->id; 1314 int port_num;
1313 struct mv643xx_private *mp; 1315 struct mv643xx_private *mp;
1314 struct net_device *dev; 1316 struct net_device *dev;
1315 u8 *p; 1317 u8 *p;
@@ -1319,6 +1321,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
1319 int duplex = DUPLEX_HALF; 1321 int duplex = DUPLEX_HALF;
1320 int speed = 0; /* default to auto-negotiation */ 1322 int speed = 0; /* default to auto-negotiation */
1321 1323
1324 pd = pdev->dev.platform_data;
1325 if (pd == NULL) {
1326 printk(KERN_ERR "No mv643xx_eth_platform_data\n");
1327 return -ENODEV;
1328 }
1329
1322 dev = alloc_etherdev(sizeof(struct mv643xx_private)); 1330 dev = alloc_etherdev(sizeof(struct mv643xx_private));
1323 if (!dev) 1331 if (!dev)
1324 return -ENOMEM; 1332 return -ENOMEM;
@@ -1331,8 +1339,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
1331 BUG_ON(!res); 1339 BUG_ON(!res);
1332 dev->irq = res->start; 1340 dev->irq = res->start;
1333 1341
1334 mp->port_num = port_num;
1335
1336 dev->open = mv643xx_eth_open; 1342 dev->open = mv643xx_eth_open;
1337 dev->stop = mv643xx_eth_stop; 1343 dev->stop = mv643xx_eth_stop;
1338 dev->hard_start_xmit = mv643xx_eth_start_xmit; 1344 dev->hard_start_xmit = mv643xx_eth_start_xmit;
@@ -1373,39 +1379,40 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
1373 1379
1374 spin_lock_init(&mp->lock); 1380 spin_lock_init(&mp->lock);
1375 1381
1382 port_num = pd->port_number;
1383
1376 /* set default config values */ 1384 /* set default config values */
1377 eth_port_uc_addr_get(dev, dev->dev_addr); 1385 eth_port_uc_addr_get(dev, dev->dev_addr);
1378 mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE; 1386 mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE;
1379 mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE; 1387 mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE;
1380 1388
1381 pd = pdev->dev.platform_data; 1389 if (is_valid_ether_addr(pd->mac_addr))
1382 if (pd) { 1390 memcpy(dev->dev_addr, pd->mac_addr, 6);
1383 if (is_valid_ether_addr(pd->mac_addr))
1384 memcpy(dev->dev_addr, pd->mac_addr, 6);
1385
1386 if (pd->phy_addr || pd->force_phy_addr)
1387 ethernet_phy_set(port_num, pd->phy_addr);
1388 1391
1389 if (pd->rx_queue_size) 1392 if (pd->phy_addr || pd->force_phy_addr)
1390 mp->rx_ring_size = pd->rx_queue_size; 1393 ethernet_phy_set(port_num, pd->phy_addr);
1391 1394
1392 if (pd->tx_queue_size) 1395 if (pd->rx_queue_size)
1393 mp->tx_ring_size = pd->tx_queue_size; 1396 mp->rx_ring_size = pd->rx_queue_size;
1394 1397
1395 if (pd->tx_sram_size) { 1398 if (pd->tx_queue_size)
1396 mp->tx_sram_size = pd->tx_sram_size; 1399 mp->tx_ring_size = pd->tx_queue_size;
1397 mp->tx_sram_addr = pd->tx_sram_addr;
1398 }
1399 1400
1400 if (pd->rx_sram_size) { 1401 if (pd->tx_sram_size) {
1401 mp->rx_sram_size = pd->rx_sram_size; 1402 mp->tx_sram_size = pd->tx_sram_size;
1402 mp->rx_sram_addr = pd->rx_sram_addr; 1403 mp->tx_sram_addr = pd->tx_sram_addr;
1403 } 1404 }
1404 1405
1405 duplex = pd->duplex; 1406 if (pd->rx_sram_size) {
1406 speed = pd->speed; 1407 mp->rx_sram_size = pd->rx_sram_size;
1408 mp->rx_sram_addr = pd->rx_sram_addr;
1407 } 1409 }
1408 1410
1411 duplex = pd->duplex;
1412 speed = pd->speed;
1413
1414 mp->port_num = port_num;
1415
1409 /* Hook up MII support for ethtool */ 1416 /* Hook up MII support for ethtool */
1410 mp->mii.dev = dev; 1417 mp->mii.dev = dev;
1411 mp->mii.mdio_read = mv643xx_mdio_read; 1418 mp->mii.mdio_read = mv643xx_mdio_read;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index b05dc6ed7fb7..ac02b3b60f92 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -181,6 +181,7 @@ struct myri10ge_priv {
181 int intr_coal_delay; 181 int intr_coal_delay;
182 __be32 __iomem *intr_coal_delay_ptr; 182 __be32 __iomem *intr_coal_delay_ptr;
183 int mtrr; 183 int mtrr;
184 int wc_enabled;
184 int wake_queue; 185 int wake_queue;
185 int stop_queue; 186 int stop_queue;
186 int down_cnt; 187 int down_cnt;
@@ -717,6 +718,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
717 int status; 718 int status;
718 size_t bytes; 719 size_t bytes;
719 u32 len; 720 u32 len;
721 struct page *dmatest_page;
722 dma_addr_t dmatest_bus;
720 723
721 /* try to send a reset command to the card to see if it 724 /* try to send a reset command to the card to see if it
722 * is alive */ 725 * is alive */
@@ -726,6 +729,11 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
726 dev_err(&mgp->pdev->dev, "failed reset\n"); 729 dev_err(&mgp->pdev->dev, "failed reset\n");
727 return -ENXIO; 730 return -ENXIO;
728 } 731 }
732 dmatest_page = alloc_page(GFP_KERNEL);
733 if (!dmatest_page)
734 return -ENOMEM;
735 dmatest_bus = pci_map_page(mgp->pdev, dmatest_page, 0, PAGE_SIZE,
736 DMA_BIDIRECTIONAL);
729 737
730 /* Now exchange information about interrupts */ 738 /* Now exchange information about interrupts */
731 739
@@ -764,8 +772,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
764 772
765 len = mgp->tx.boundary; 773 len = mgp->tx.boundary;
766 774
767 cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); 775 cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus);
768 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); 776 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus);
769 cmd.data2 = len * 0x10000; 777 cmd.data2 = len * 0x10000;
770 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); 778 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0);
771 if (status == 0) 779 if (status == 0)
@@ -774,8 +782,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
774 else 782 else
775 dev_warn(&mgp->pdev->dev, "DMA read benchmark failed: %d\n", 783 dev_warn(&mgp->pdev->dev, "DMA read benchmark failed: %d\n",
776 status); 784 status);
777 cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); 785 cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus);
778 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); 786 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus);
779 cmd.data2 = len * 0x1; 787 cmd.data2 = len * 0x1;
780 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); 788 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0);
781 if (status == 0) 789 if (status == 0)
@@ -785,8 +793,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
785 dev_warn(&mgp->pdev->dev, "DMA write benchmark failed: %d\n", 793 dev_warn(&mgp->pdev->dev, "DMA write benchmark failed: %d\n",
786 status); 794 status);
787 795
788 cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); 796 cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus);
789 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); 797 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus);
790 cmd.data2 = len * 0x10001; 798 cmd.data2 = len * 0x10001;
791 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); 799 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0);
792 if (status == 0) 800 if (status == 0)
@@ -796,6 +804,9 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
796 dev_warn(&mgp->pdev->dev, 804 dev_warn(&mgp->pdev->dev,
797 "DMA read/write benchmark failed: %d\n", status); 805 "DMA read/write benchmark failed: %d\n", status);
798 806
807 pci_unmap_page(mgp->pdev, dmatest_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
808 put_page(dmatest_page);
809
799 memset(mgp->rx_done.entry, 0, bytes); 810 memset(mgp->rx_done.entry, 0, bytes);
800 811
801 /* reset mcp/driver shared state back to 0 */ 812 /* reset mcp/driver shared state back to 0 */
@@ -1375,7 +1386,7 @@ myri10ge_get_ethtool_stats(struct net_device *netdev,
1375 data[i] = ((unsigned long *)&mgp->stats)[i]; 1386 data[i] = ((unsigned long *)&mgp->stats)[i];
1376 1387
1377 data[i++] = (unsigned int)mgp->tx.boundary; 1388 data[i++] = (unsigned int)mgp->tx.boundary;
1378 data[i++] = (unsigned int)(mgp->mtrr >= 0); 1389 data[i++] = (unsigned int)mgp->wc_enabled;
1379 data[i++] = (unsigned int)mgp->pdev->irq; 1390 data[i++] = (unsigned int)mgp->pdev->irq;
1380 data[i++] = (unsigned int)mgp->msi_enabled; 1391 data[i++] = (unsigned int)mgp->msi_enabled;
1381 data[i++] = (unsigned int)mgp->read_dma; 1392 data[i++] = (unsigned int)mgp->read_dma;
@@ -1456,6 +1467,8 @@ static int myri10ge_allocate_rings(struct net_device *dev)
1456 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_RING_SIZE, &cmd, 0); 1467 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_RING_SIZE, &cmd, 0);
1457 tx_ring_size = cmd.data0; 1468 tx_ring_size = cmd.data0;
1458 status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0); 1469 status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0);
1470 if (status != 0)
1471 return status;
1459 rx_ring_size = cmd.data0; 1472 rx_ring_size = cmd.data0;
1460 1473
1461 tx_ring_entries = tx_ring_size / sizeof(struct mcp_kreq_ether_send); 1474 tx_ring_entries = tx_ring_size / sizeof(struct mcp_kreq_ether_send);
@@ -1463,6 +1476,8 @@ static int myri10ge_allocate_rings(struct net_device *dev)
1463 mgp->tx.mask = tx_ring_entries - 1; 1476 mgp->tx.mask = tx_ring_entries - 1;
1464 mgp->rx_small.mask = mgp->rx_big.mask = rx_ring_entries - 1; 1477 mgp->rx_small.mask = mgp->rx_big.mask = rx_ring_entries - 1;
1465 1478
1479 status = -ENOMEM;
1480
1466 /* allocate the host shadow rings */ 1481 /* allocate the host shadow rings */
1467 1482
1468 bytes = 8 + (MYRI10GE_MAX_SEND_DESC_TSO + 4) 1483 bytes = 8 + (MYRI10GE_MAX_SEND_DESC_TSO + 4)
@@ -1735,7 +1750,7 @@ static int myri10ge_open(struct net_device *dev)
1735 goto abort_with_irq; 1750 goto abort_with_irq;
1736 } 1751 }
1737 1752
1738 if (myri10ge_wcfifo && mgp->mtrr >= 0) { 1753 if (myri10ge_wcfifo && mgp->wc_enabled) {
1739 mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; 1754 mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4;
1740 mgp->rx_small.wc_fifo = 1755 mgp->rx_small.wc_fifo =
1741 (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; 1756 (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL;
@@ -2510,6 +2525,12 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
2510 bridge->vendor, bridge->device); 2525 bridge->vendor, bridge->device);
2511 mgp->tx.boundary = 4096; 2526 mgp->tx.boundary = 4096;
2512 mgp->fw_name = myri10ge_fw_aligned; 2527 mgp->fw_name = myri10ge_fw_aligned;
2528 } else if (bridge &&
2529 bridge->vendor == PCI_VENDOR_ID_SGI &&
2530 bridge->device == 0x4002 /* TIOCE pcie-port */ ) {
2531 /* this pcie bridge does not support 4K rdma request */
2532 mgp->tx.boundary = 2048;
2533 mgp->fw_name = myri10ge_fw_aligned;
2513 } 2534 }
2514 } else { 2535 } else {
2515 if (myri10ge_force_firmware == 1) { 2536 if (myri10ge_force_firmware == 1) {
@@ -2830,9 +2851,12 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2830 mgp->board_span = pci_resource_len(pdev, 0); 2851 mgp->board_span = pci_resource_len(pdev, 0);
2831 mgp->iomem_base = pci_resource_start(pdev, 0); 2852 mgp->iomem_base = pci_resource_start(pdev, 0);
2832 mgp->mtrr = -1; 2853 mgp->mtrr = -1;
2854 mgp->wc_enabled = 0;
2833#ifdef CONFIG_MTRR 2855#ifdef CONFIG_MTRR
2834 mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span, 2856 mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span,
2835 MTRR_TYPE_WRCOMB, 1); 2857 MTRR_TYPE_WRCOMB, 1);
2858 if (mgp->mtrr >= 0)
2859 mgp->wc_enabled = 1;
2836#endif 2860#endif
2837 /* Hack. need to get rid of these magic numbers */ 2861 /* Hack. need to get rid of these magic numbers */
2838 mgp->sram_size = 2862 mgp->sram_size =
@@ -2927,7 +2951,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2927 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", 2951 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n",
2928 (mgp->msi_enabled ? "MSI" : "xPIC"), 2952 (mgp->msi_enabled ? "MSI" : "xPIC"),
2929 netdev->irq, mgp->tx.boundary, mgp->fw_name, 2953 netdev->irq, mgp->tx.boundary, mgp->fw_name,
2930 (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); 2954 (mgp->wc_enabled ? "Enabled" : "Disabled"));
2931 2955
2932 return 0; 2956 return 0;
2933 2957
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 5c57433cb306..c6172a77a6d7 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -2024,6 +2024,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
2024 struct netdev_private *np = netdev_priv(dev); 2024 struct netdev_private *np = netdev_priv(dev);
2025 void __iomem * ioaddr = ns_ioaddr(dev); 2025 void __iomem * ioaddr = ns_ioaddr(dev);
2026 unsigned entry; 2026 unsigned entry;
2027 unsigned long flags;
2027 2028
2028 /* Note: Ordering is important here, set the field with the 2029 /* Note: Ordering is important here, set the field with the
2029 "ownership" bit last, and only then increment cur_tx. */ 2030 "ownership" bit last, and only then increment cur_tx. */
@@ -2037,7 +2038,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
2037 2038
2038 np->tx_ring[entry].addr = cpu_to_le32(np->tx_dma[entry]); 2039 np->tx_ring[entry].addr = cpu_to_le32(np->tx_dma[entry]);
2039 2040
2040 spin_lock_irq(&np->lock); 2041 spin_lock_irqsave(&np->lock, flags);
2041 2042
2042 if (!np->hands_off) { 2043 if (!np->hands_off) {
2043 np->tx_ring[entry].cmd_status = cpu_to_le32(DescOwn | skb->len); 2044 np->tx_ring[entry].cmd_status = cpu_to_le32(DescOwn | skb->len);
@@ -2056,7 +2057,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
2056 dev_kfree_skb_irq(skb); 2057 dev_kfree_skb_irq(skb);
2057 np->stats.tx_dropped++; 2058 np->stats.tx_dropped++;
2058 } 2059 }
2059 spin_unlock_irq(&np->lock); 2060 spin_unlock_irqrestore(&np->lock, flags);
2060 2061
2061 dev->trans_start = jiffies; 2062 dev->trans_start = jiffies;
2062 2063
@@ -2222,6 +2223,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
2222 pkt_len = (desc_status & DescSizeMask) - 4; 2223 pkt_len = (desc_status & DescSizeMask) - 4;
2223 if ((desc_status&(DescMore|DescPktOK|DescRxLong)) != DescPktOK){ 2224 if ((desc_status&(DescMore|DescPktOK|DescRxLong)) != DescPktOK){
2224 if (desc_status & DescMore) { 2225 if (desc_status & DescMore) {
2226 unsigned long flags;
2227
2225 if (netif_msg_rx_err(np)) 2228 if (netif_msg_rx_err(np))
2226 printk(KERN_WARNING 2229 printk(KERN_WARNING
2227 "%s: Oversized(?) Ethernet " 2230 "%s: Oversized(?) Ethernet "
@@ -2236,12 +2239,12 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
2236 * reset procedure documented in 2239 * reset procedure documented in
2237 * AN-1287. */ 2240 * AN-1287. */
2238 2241
2239 spin_lock_irq(&np->lock); 2242 spin_lock_irqsave(&np->lock, flags);
2240 reset_rx(dev); 2243 reset_rx(dev);
2241 reinit_rx(dev); 2244 reinit_rx(dev);
2242 writel(np->ring_dma, ioaddr + RxRingPtr); 2245 writel(np->ring_dma, ioaddr + RxRingPtr);
2243 check_link(dev); 2246 check_link(dev);
2244 spin_unlock_irq(&np->lock); 2247 spin_unlock_irqrestore(&np->lock, flags);
2245 2248
2246 /* We'll enable RX on exit from this 2249 /* We'll enable RX on exit from this
2247 * function. */ 2250 * function. */
@@ -2396,8 +2399,19 @@ static struct net_device_stats *get_stats(struct net_device *dev)
2396#ifdef CONFIG_NET_POLL_CONTROLLER 2399#ifdef CONFIG_NET_POLL_CONTROLLER
2397static void natsemi_poll_controller(struct net_device *dev) 2400static void natsemi_poll_controller(struct net_device *dev)
2398{ 2401{
2402 struct netdev_private *np = netdev_priv(dev);
2403
2399 disable_irq(dev->irq); 2404 disable_irq(dev->irq);
2400 intr_handler(dev->irq, dev); 2405
2406 /*
2407 * A real interrupt might have already reached us at this point
2408 * but NAPI might still haven't called us back. As the interrupt
2409 * status register is cleared by reading, we should prevent an
2410 * interrupt loss in this case...
2411 */
2412 if (!np->intr_status)
2413 intr_handler(dev->irq, dev);
2414
2401 enable_irq(dev->irq); 2415 enable_irq(dev->irq);
2402} 2416}
2403#endif 2417#endif
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index a2877f33fa85..1be55702557d 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -228,7 +228,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
228 &adapter->ctx_desc_pdev); 228 &adapter->ctx_desc_pdev);
229 229
230 printk("ctx_desc_phys_addr: 0x%llx\n", 230 printk("ctx_desc_phys_addr: 0x%llx\n",
231 (u64) adapter->ctx_desc_phys_addr); 231 (unsigned long long) adapter->ctx_desc_phys_addr);
232 if (addr == NULL) { 232 if (addr == NULL) {
233 DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); 233 DPRINTK(ERR, "bad return from pci_alloc_consistent\n");
234 err = -ENOMEM; 234 err = -ENOMEM;
@@ -247,7 +247,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
247 adapter->max_tx_desc_count, 247 adapter->max_tx_desc_count,
248 (dma_addr_t *) & hw->cmd_desc_phys_addr, 248 (dma_addr_t *) & hw->cmd_desc_phys_addr,
249 &adapter->ahw.cmd_desc_pdev); 249 &adapter->ahw.cmd_desc_pdev);
250 printk("cmd_desc_phys_addr: 0x%llx\n", (u64) hw->cmd_desc_phys_addr); 250 printk("cmd_desc_phys_addr: 0x%llx\n",
251 (unsigned long long) hw->cmd_desc_phys_addr);
251 252
252 if (addr == NULL) { 253 if (addr == NULL) {
253 DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); 254 DPRINTK(ERR, "bad return from pci_alloc_consistent\n");
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index a956a51d284f..1060154ae750 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -138,7 +138,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
138 138
139======================================================================*/ 139======================================================================*/
140 140
141static int ibmtr_attach(struct pcmcia_device *link) 141static int __devinit ibmtr_attach(struct pcmcia_device *link)
142{ 142{
143 ibmtr_dev_t *info; 143 ibmtr_dev_t *info;
144 struct net_device *dev; 144 struct net_device *dev;
@@ -217,7 +217,7 @@ static void ibmtr_detach(struct pcmcia_device *link)
217#define CS_CHECK(fn, ret) \ 217#define CS_CHECK(fn, ret) \
218do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 218do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
219 219
220static int ibmtr_config(struct pcmcia_device *link) 220static int __devinit ibmtr_config(struct pcmcia_device *link)
221{ 221{
222 ibmtr_dev_t *info = link->priv; 222 ibmtr_dev_t *info = link->priv;
223 struct net_device *dev = info->dev; 223 struct net_device *dev = info->dev;
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 36f9d988278f..4d94ba7899bf 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1234,14 +1234,14 @@ static void pcnet32_rx_entry(struct net_device *dev,
1234 skb_put(skb, pkt_len); /* Make room */ 1234 skb_put(skb, pkt_len); /* Make room */
1235 pci_dma_sync_single_for_cpu(lp->pci_dev, 1235 pci_dma_sync_single_for_cpu(lp->pci_dev,
1236 lp->rx_dma_addr[entry], 1236 lp->rx_dma_addr[entry],
1237 PKT_BUF_SZ - 2, 1237 pkt_len,
1238 PCI_DMA_FROMDEVICE); 1238 PCI_DMA_FROMDEVICE);
1239 eth_copy_and_sum(skb, 1239 eth_copy_and_sum(skb,
1240 (unsigned char *)(lp->rx_skbuff[entry]->data), 1240 (unsigned char *)(lp->rx_skbuff[entry]->data),
1241 pkt_len, 0); 1241 pkt_len, 0);
1242 pci_dma_sync_single_for_device(lp->pci_dev, 1242 pci_dma_sync_single_for_device(lp->pci_dev,
1243 lp->rx_dma_addr[entry], 1243 lp->rx_dma_addr[entry],
1244 PKT_BUF_SZ - 2, 1244 pkt_len,
1245 PCI_DMA_FROMDEVICE); 1245 PCI_DMA_FROMDEVICE);
1246 } 1246 }
1247 lp->stats.rx_bytes += skb->len; 1247 lp->stats.rx_bytes += skb->len;
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 86e56f1f2f0b..ebfa2967cd68 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -140,7 +140,7 @@ static struct pppox_sock *__get_item(unsigned long sid, unsigned char *addr, int
140 140
141 ret = item_hash_table[hash]; 141 ret = item_hash_table[hash];
142 142
143 while (ret && !(cmp_addr(&ret->pppoe_pa, sid, addr) && ret->pppoe_dev->ifindex == ifindex)) 143 while (ret && !(cmp_addr(&ret->pppoe_pa, sid, addr) && ret->pppoe_ifindex == ifindex))
144 ret = ret->next; 144 ret = ret->next;
145 145
146 return ret; 146 return ret;
@@ -153,7 +153,7 @@ static int __set_item(struct pppox_sock *po)
153 153
154 ret = item_hash_table[hash]; 154 ret = item_hash_table[hash];
155 while (ret) { 155 while (ret) {
156 if (cmp_2_addr(&ret->pppoe_pa, &po->pppoe_pa) && ret->pppoe_dev->ifindex == po->pppoe_dev->ifindex) 156 if (cmp_2_addr(&ret->pppoe_pa, &po->pppoe_pa) && ret->pppoe_ifindex == po->pppoe_ifindex)
157 return -EALREADY; 157 return -EALREADY;
158 158
159 ret = ret->next; 159 ret = ret->next;
@@ -174,7 +174,7 @@ static struct pppox_sock *__delete_item(unsigned long sid, char *addr, int ifind
174 src = &item_hash_table[hash]; 174 src = &item_hash_table[hash];
175 175
176 while (ret) { 176 while (ret) {
177 if (cmp_addr(&ret->pppoe_pa, sid, addr) && ret->pppoe_dev->ifindex == ifindex) { 177 if (cmp_addr(&ret->pppoe_pa, sid, addr) && ret->pppoe_ifindex == ifindex) {
178 *src = ret->next; 178 *src = ret->next;
179 break; 179 break;
180 } 180 }
@@ -529,7 +529,7 @@ static int pppoe_release(struct socket *sock)
529 529
530 po = pppox_sk(sk); 530 po = pppox_sk(sk);
531 if (po->pppoe_pa.sid) { 531 if (po->pppoe_pa.sid) {
532 delete_item(po->pppoe_pa.sid, po->pppoe_pa.remote, po->pppoe_dev->ifindex); 532 delete_item(po->pppoe_pa.sid, po->pppoe_pa.remote, po->pppoe_ifindex);
533 } 533 }
534 534
535 if (po->pppoe_dev) 535 if (po->pppoe_dev)
@@ -577,7 +577,7 @@ static int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr,
577 pppox_unbind_sock(sk); 577 pppox_unbind_sock(sk);
578 578
579 /* Delete the old binding */ 579 /* Delete the old binding */
580 delete_item(po->pppoe_pa.sid,po->pppoe_pa.remote,po->pppoe_dev->ifindex); 580 delete_item(po->pppoe_pa.sid,po->pppoe_pa.remote,po->pppoe_ifindex);
581 581
582 if(po->pppoe_dev) 582 if(po->pppoe_dev)
583 dev_put(po->pppoe_dev); 583 dev_put(po->pppoe_dev);
@@ -597,6 +597,7 @@ static int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr,
597 goto end; 597 goto end;
598 598
599 po->pppoe_dev = dev; 599 po->pppoe_dev = dev;
600 po->pppoe_ifindex = dev->ifindex;
600 601
601 if (!(dev->flags & IFF_UP)) 602 if (!(dev->flags & IFF_UP))
602 goto err_put; 603 goto err_put;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 15d954e50cae..521b5f0618a4 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -572,8 +572,8 @@ static void rtl8169_xmii_reset_enable(void __iomem *ioaddr)
572{ 572{
573 unsigned int val; 573 unsigned int val;
574 574
575 mdio_write(ioaddr, MII_BMCR, BMCR_RESET); 575 val = mdio_read(ioaddr, MII_BMCR) | BMCR_RESET;
576 val = mdio_read(ioaddr, MII_BMCR); 576 mdio_write(ioaddr, MII_BMCR, val & 0xffff);
577} 577}
578 578
579static void rtl8169_check_link_status(struct net_device *dev, 579static void rtl8169_check_link_status(struct net_device *dev,
@@ -1368,11 +1368,7 @@ static inline void rtl8169_request_timer(struct net_device *dev)
1368 (tp->phy_version >= RTL_GIGA_PHY_VER_H)) 1368 (tp->phy_version >= RTL_GIGA_PHY_VER_H))
1369 return; 1369 return;
1370 1370
1371 init_timer(timer); 1371 mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT);
1372 timer->expires = jiffies + RTL8169_PHY_TIMEOUT;
1373 timer->data = (unsigned long)(dev);
1374 timer->function = rtl8169_phy_timer;
1375 add_timer(timer);
1376} 1372}
1377 1373
1378#ifdef CONFIG_NET_POLL_CONTROLLER 1374#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -1685,6 +1681,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1685 tp->mmio_addr = ioaddr; 1681 tp->mmio_addr = ioaddr;
1686 tp->align = rtl_cfg_info[ent->driver_data].align; 1682 tp->align = rtl_cfg_info[ent->driver_data].align;
1687 1683
1684 init_timer(&tp->timer);
1685 tp->timer.data = (unsigned long) dev;
1686 tp->timer.function = rtl8169_phy_timer;
1687
1688 spin_lock_init(&tp->lock); 1688 spin_lock_init(&tp->lock);
1689 1689
1690 rc = register_netdev(dev); 1690 rc = register_netdev(dev);
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index fb2b53051635..b3750f284279 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -968,10 +968,10 @@ static void mdio_write(struct net_device *net_dev, int phy_id, int location,
968 968
969static u16 sis900_reset_phy(struct net_device *net_dev, int phy_addr) 969static u16 sis900_reset_phy(struct net_device *net_dev, int phy_addr)
970{ 970{
971 int i = 0; 971 int i;
972 u16 status; 972 u16 status;
973 973
974 while (i++ < 2) 974 for (i = 0; i < 2; i++)
975 status = mdio_read(net_dev, phy_addr, MII_STATUS); 975 status = mdio_read(net_dev, phy_addr, MII_STATUS);
976 976
977 mdio_write( net_dev, phy_addr, MII_CONTROL, MII_CNTL_RESET ); 977 mdio_write( net_dev, phy_addr, MII_CONTROL, MII_CNTL_RESET );
@@ -1430,7 +1430,7 @@ static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)
1430 int i = 0; 1430 int i = 0;
1431 u32 status; 1431 u32 status;
1432 1432
1433 while (i++ < 2) 1433 for (i = 0; i < 2; i++)
1434 status = mdio_read(net_dev, phy_addr, MII_STATUS); 1434 status = mdio_read(net_dev, phy_addr, MII_STATUS);
1435 1435
1436 if (!(status & MII_STAT_LINK)){ 1436 if (!(status & MII_STAT_LINK)){
@@ -1466,9 +1466,9 @@ static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex
1466 int phy_addr = sis_priv->cur_phy; 1466 int phy_addr = sis_priv->cur_phy;
1467 u32 status; 1467 u32 status;
1468 u16 autoadv, autorec; 1468 u16 autoadv, autorec;
1469 int i = 0; 1469 int i;
1470 1470
1471 while (i++ < 2) 1471 for (i = 0; i < 2; i++)
1472 status = mdio_read(net_dev, phy_addr, MII_STATUS); 1472 status = mdio_read(net_dev, phy_addr, MII_STATUS);
1473 1473
1474 if (!(status & MII_STAT_LINK)) 1474 if (!(status & MII_STAT_LINK))
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 53839979cfb8..ab0ab92583fe 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2165,9 +2165,27 @@ force_update:
2165 /* fall through */ 2165 /* fall through */
2166#endif 2166#endif
2167 case OP_RXCHKS: 2167 case OP_RXCHKS:
2168 skb = sky2->rx_ring[sky2->rx_next].skb; 2168 if (!sky2->rx_csum)
2169 skb->ip_summed = CHECKSUM_COMPLETE; 2169 break;
2170 skb->csum = status & 0xffff; 2170
2171 /* Both checksum counters are programmed to start at
2172 * the same offset, so unless there is a problem they
2173 * should match. This failure is an early indication that
2174 * hardware receive checksumming won't work.
2175 */
2176 if (likely(status >> 16 == (status & 0xffff))) {
2177 skb = sky2->rx_ring[sky2->rx_next].skb;
2178 skb->ip_summed = CHECKSUM_COMPLETE;
2179 skb->csum = status & 0xffff;
2180 } else {
2181 printk(KERN_NOTICE PFX "%s: hardware receive "
2182 "checksum problem (status = %#x)\n",
2183 dev->name, status);
2184 sky2->rx_csum = 0;
2185 sky2_write32(sky2->hw,
2186 Q_ADDR(rxqaddr[le->link], Q_CSR),
2187 BMU_DIS_RX_CHKSUM);
2188 }
2171 break; 2189 break;
2172 2190
2173 case OP_TXINDEXLE: 2191 case OP_TXINDEXLE:
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 0d97e10ccac5..01d55315ee8c 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -186,7 +186,6 @@ static char __devinit *adapter_def(char type)
186#define TRC_INITV 0x02 /* verbose init trace points */ 186#define TRC_INITV 0x02 /* verbose init trace points */
187static unsigned char ibmtr_debug_trace = 0; 187static unsigned char ibmtr_debug_trace = 0;
188 188
189static int ibmtr_probe(struct net_device *dev);
190static int ibmtr_probe1(struct net_device *dev, int ioaddr); 189static int ibmtr_probe1(struct net_device *dev, int ioaddr);
191static unsigned char get_sram_size(struct tok_info *adapt_info); 190static unsigned char get_sram_size(struct tok_info *adapt_info);
192static int trdev_init(struct net_device *dev); 191static int trdev_init(struct net_device *dev);
@@ -335,17 +334,6 @@ static void ibmtr_cleanup_card(struct net_device *dev)
335#endif 334#endif
336} 335}
337 336
338int ibmtr_probe_card(struct net_device *dev)
339{
340 int err = ibmtr_probe(dev);
341 if (!err) {
342 err = register_netdev(dev);
343 if (err)
344 ibmtr_cleanup_card(dev);
345 }
346 return err;
347}
348
349/**************************************************************************** 337/****************************************************************************
350 * ibmtr_probe(): Routine specified in the network device structure 338 * ibmtr_probe(): Routine specified in the network device structure
351 * to probe for an IBM Token Ring Adapter. Routine outline: 339 * to probe for an IBM Token Ring Adapter. Routine outline:
@@ -358,7 +346,7 @@ int ibmtr_probe_card(struct net_device *dev)
358 * which references it. 346 * which references it.
359 ****************************************************************************/ 347 ****************************************************************************/
360 348
361static int ibmtr_probe(struct net_device *dev) 349static int __devinit ibmtr_probe(struct net_device *dev)
362{ 350{
363 int i; 351 int i;
364 int base_addr = dev->base_addr; 352 int base_addr = dev->base_addr;
@@ -378,6 +366,17 @@ static int ibmtr_probe(struct net_device *dev)
378 return -ENODEV; 366 return -ENODEV;
379} 367}
380 368
369int __devinit ibmtr_probe_card(struct net_device *dev)
370{
371 int err = ibmtr_probe(dev);
372 if (!err) {
373 err = register_netdev(dev);
374 if (err)
375 ibmtr_cleanup_card(dev);
376 }
377 return err;
378}
379
381/*****************************************************************************/ 380/*****************************************************************************/
382 381
383static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) 382static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index dacea4fd3337..c82befa209a2 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -1685,7 +1685,7 @@ static const struct ethtool_ops de_ethtool_ops = {
1685 .get_regs = de_get_regs, 1685 .get_regs = de_get_regs,
1686}; 1686};
1687 1687
1688static void __init de21040_get_mac_address (struct de_private *de) 1688static void __devinit de21040_get_mac_address (struct de_private *de)
1689{ 1689{
1690 unsigned i; 1690 unsigned i;
1691 1691
@@ -1703,7 +1703,7 @@ static void __init de21040_get_mac_address (struct de_private *de)
1703 } 1703 }
1704} 1704}
1705 1705
1706static void __init de21040_get_media_info(struct de_private *de) 1706static void __devinit de21040_get_media_info(struct de_private *de)
1707{ 1707{
1708 unsigned int i; 1708 unsigned int i;
1709 1709
@@ -1765,7 +1765,7 @@ static unsigned __devinit tulip_read_eeprom(void __iomem *regs, int location, in
1765 return retval; 1765 return retval;
1766} 1766}
1767 1767
1768static void __init de21041_get_srom_info (struct de_private *de) 1768static void __devinit de21041_get_srom_info (struct de_private *de)
1769{ 1769{
1770 unsigned i, sa_offset = 0, ofs; 1770 unsigned i, sa_offset = 0, ofs;
1771 u8 ee_data[DE_EEPROM_SIZE + 6] = {}; 1771 u8 ee_data[DE_EEPROM_SIZE + 6] = {};
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 7f59a3d4fda2..9aeac76184f3 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -143,9 +143,16 @@
143#define DMFE_TX_TIMEOUT ((3*HZ)/2) /* tx packet time-out time 1.5 s" */ 143#define DMFE_TX_TIMEOUT ((3*HZ)/2) /* tx packet time-out time 1.5 s" */
144#define DMFE_TX_KICK (HZ/2) /* tx packet Kick-out time 0.5 s" */ 144#define DMFE_TX_KICK (HZ/2) /* tx packet Kick-out time 0.5 s" */
145 145
146#define DMFE_DBUG(dbug_now, msg, value) if (dmfe_debug || (dbug_now)) printk(KERN_ERR DRV_NAME ": %s %lx\n", (msg), (long) (value)) 146#define DMFE_DBUG(dbug_now, msg, value) \
147 do { \
148 if (dmfe_debug || (dbug_now)) \
149 printk(KERN_ERR DRV_NAME ": %s %lx\n",\
150 (msg), (long) (value)); \
151 } while (0)
147 152
148#define SHOW_MEDIA_TYPE(mode) printk(KERN_ERR DRV_NAME ": Change Speed to %sMhz %s duplex\n",mode & 1 ?"100":"10", mode & 4 ? "full":"half"); 153#define SHOW_MEDIA_TYPE(mode) \
154 printk (KERN_INFO DRV_NAME ": Change Speed to %sMhz %s duplex\n" , \
155 (mode & 1) ? "100":"10", (mode & 4) ? "full":"half");
149 156
150 157
151/* CR9 definition: SROM/MII */ 158/* CR9 definition: SROM/MII */
@@ -163,23 +170,33 @@
163 170
164#define SROM_V41_CODE 0x14 171#define SROM_V41_CODE 0x14
165 172
166#define SROM_CLK_WRITE(data, ioaddr) outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5);outl(data|CR9_SROM_READ|CR9_SRCS|CR9_SRCLK,ioaddr);udelay(5);outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5); 173#define SROM_CLK_WRITE(data, ioaddr) \
174 outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr); \
175 udelay(5); \
176 outl(data|CR9_SROM_READ|CR9_SRCS|CR9_SRCLK,ioaddr); \
177 udelay(5); \
178 outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr); \
179 udelay(5);
180
181#define __CHK_IO_SIZE(pci_id, dev_rev) \
182 (( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x02000030) ) ? \
183 DM9102A_IO_SIZE: DM9102_IO_SIZE)
167 184
168#define __CHK_IO_SIZE(pci_id, dev_rev) ( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x02000030) ) ? DM9102A_IO_SIZE: DM9102_IO_SIZE 185#define CHK_IO_SIZE(pci_dev, dev_rev) \
169#define CHK_IO_SIZE(pci_dev, dev_rev) __CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, dev_rev) 186 (__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, dev_rev))
170 187
171/* Sten Check */ 188/* Sten Check */
172#define DEVICE net_device 189#define DEVICE net_device
173 190
174/* Structure/enum declaration ------------------------------- */ 191/* Structure/enum declaration ------------------------------- */
175struct tx_desc { 192struct tx_desc {
176 u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */ 193 __le32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
177 char *tx_buf_ptr; /* Data for us */ 194 char *tx_buf_ptr; /* Data for us */
178 struct tx_desc *next_tx_desc; 195 struct tx_desc *next_tx_desc;
179} __attribute__(( aligned(32) )); 196} __attribute__(( aligned(32) ));
180 197
181struct rx_desc { 198struct rx_desc {
182 u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */ 199 __le32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */
183 struct sk_buff *rx_skb_ptr; /* Data for us */ 200 struct sk_buff *rx_skb_ptr; /* Data for us */
184 struct rx_desc *next_rx_desc; 201 struct rx_desc *next_rx_desc;
185} __attribute__(( aligned(32) )); 202} __attribute__(( aligned(32) ));
@@ -187,7 +204,7 @@ struct rx_desc {
187struct dmfe_board_info { 204struct dmfe_board_info {
188 u32 chip_id; /* Chip vendor/Device ID */ 205 u32 chip_id; /* Chip vendor/Device ID */
189 u32 chip_revision; /* Chip revision */ 206 u32 chip_revision; /* Chip revision */
190 struct DEVICE *dev; /* net device */ 207 struct DEVICE *next_dev; /* next device */
191 struct pci_dev *pdev; /* PCI device */ 208 struct pci_dev *pdev; /* PCI device */
192 spinlock_t lock; 209 spinlock_t lock;
193 210
@@ -231,7 +248,6 @@ struct dmfe_board_info {
231 u8 media_mode; /* user specify media mode */ 248 u8 media_mode; /* user specify media mode */
232 u8 op_mode; /* real work media mode */ 249 u8 op_mode; /* real work media mode */
233 u8 phy_addr; 250 u8 phy_addr;
234 u8 link_failed; /* Ever link failed */
235 u8 wait_reset; /* Hardware failed, need to reset */ 251 u8 wait_reset; /* Hardware failed, need to reset */
236 u8 dm910x_chk_mode; /* Operating mode check */ 252 u8 dm910x_chk_mode; /* Operating mode check */
237 u8 first_in_callback; /* Flag to record state */ 253 u8 first_in_callback; /* Flag to record state */
@@ -329,7 +345,7 @@ static void dmfe_program_DM9802(struct dmfe_board_info *);
329static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * ); 345static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * );
330static void dmfe_set_phyxcer(struct dmfe_board_info *); 346static void dmfe_set_phyxcer(struct dmfe_board_info *);
331 347
332/* DM910X network baord routine ---------------------------- */ 348/* DM910X network board routine ---------------------------- */
333 349
334/* 350/*
335 * Search DM910X board ,allocate space and register it 351 * Search DM910X board ,allocate space and register it
@@ -356,7 +372,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
356 SET_NETDEV_DEV(dev, &pdev->dev); 372 SET_NETDEV_DEV(dev, &pdev->dev);
357 373
358 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { 374 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
359 printk(KERN_WARNING DRV_NAME ": 32-bit PCI DMA not available.\n"); 375 printk(KERN_WARNING DRV_NAME
376 ": 32-bit PCI DMA not available.\n");
360 err = -ENODEV; 377 err = -ENODEV;
361 goto err_out_free; 378 goto err_out_free;
362 } 379 }
@@ -399,11 +416,12 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
399 /* Init system & device */ 416 /* Init system & device */
400 db = netdev_priv(dev); 417 db = netdev_priv(dev);
401 418
402 db->dev = dev;
403
404 /* Allocate Tx/Rx descriptor memory */ 419 /* Allocate Tx/Rx descriptor memory */
405 db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); 420 db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) *
406 db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); 421 DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr);
422
423 db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC *
424 TX_DESC_CNT + 4, &db->buf_pool_dma_ptr);
407 425
408 db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; 426 db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr;
409 db->first_tx_desc_dma = db->desc_pool_dma_ptr; 427 db->first_tx_desc_dma = db->desc_pool_dma_ptr;
@@ -428,7 +446,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
428 dev->poll_controller = &poll_dmfe; 446 dev->poll_controller = &poll_dmfe;
429#endif 447#endif
430 dev->ethtool_ops = &netdev_ethtool_ops; 448 dev->ethtool_ops = &netdev_ethtool_ops;
431 netif_carrier_off(db->dev); 449 netif_carrier_off(dev);
432 spin_lock_init(&db->lock); 450 spin_lock_init(&db->lock);
433 451
434 pci_read_config_dword(pdev, 0x50, &pci_pmr); 452 pci_read_config_dword(pdev, 0x50, &pci_pmr);
@@ -440,7 +458,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
440 458
441 /* read 64 word srom data */ 459 /* read 64 word srom data */
442 for (i = 0; i < 64; i++) 460 for (i = 0; i < 64; i++)
443 ((u16 *) db->srom)[i] = cpu_to_le16(read_srom_word(db->ioaddr, i)); 461 ((__le16 *) db->srom)[i] =
462 cpu_to_le16(read_srom_word(db->ioaddr, i));
444 463
445 /* Set Node address */ 464 /* Set Node address */
446 for (i = 0; i < 6; i++) 465 for (i = 0; i < 6; i++)
@@ -482,14 +501,17 @@ static void __devexit dmfe_remove_one (struct pci_dev *pdev)
482 DMFE_DBUG(0, "dmfe_remove_one()", 0); 501 DMFE_DBUG(0, "dmfe_remove_one()", 0);
483 502
484 if (dev) { 503 if (dev) {
504
505 unregister_netdev(dev);
506
485 pci_free_consistent(db->pdev, sizeof(struct tx_desc) * 507 pci_free_consistent(db->pdev, sizeof(struct tx_desc) *
486 DESC_ALL_CNT + 0x20, db->desc_pool_ptr, 508 DESC_ALL_CNT + 0x20, db->desc_pool_ptr,
487 db->desc_pool_dma_ptr); 509 db->desc_pool_dma_ptr);
488 pci_free_consistent(db->pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, 510 pci_free_consistent(db->pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4,
489 db->buf_pool_ptr, db->buf_pool_dma_ptr); 511 db->buf_pool_ptr, db->buf_pool_dma_ptr);
490 unregister_netdev(dev);
491 pci_release_regions(pdev); 512 pci_release_regions(pdev);
492 free_netdev(dev); /* free board information */ 513 free_netdev(dev); /* free board information */
514
493 pci_set_drvdata(pdev, NULL); 515 pci_set_drvdata(pdev, NULL);
494 } 516 }
495 517
@@ -509,7 +531,8 @@ static int dmfe_open(struct DEVICE *dev)
509 531
510 DMFE_DBUG(0, "dmfe_open", 0); 532 DMFE_DBUG(0, "dmfe_open", 0);
511 533
512 ret = request_irq(dev->irq, &dmfe_interrupt, IRQF_SHARED, dev->name, dev); 534 ret = request_irq(dev->irq, &dmfe_interrupt,
535 IRQF_SHARED, dev->name, dev);
513 if (ret) 536 if (ret)
514 return ret; 537 return ret;
515 538
@@ -518,7 +541,6 @@ static int dmfe_open(struct DEVICE *dev)
518 db->tx_packet_cnt = 0; 541 db->tx_packet_cnt = 0;
519 db->tx_queue_cnt = 0; 542 db->tx_queue_cnt = 0;
520 db->rx_avail_cnt = 0; 543 db->rx_avail_cnt = 0;
521 db->link_failed = 1;
522 db->wait_reset = 0; 544 db->wait_reset = 0;
523 545
524 db->first_in_callback = 0; 546 db->first_in_callback = 0;
@@ -650,7 +672,8 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
650 /* No Tx resource check, it never happen nromally */ 672 /* No Tx resource check, it never happen nromally */
651 if (db->tx_queue_cnt >= TX_FREE_DESC_CNT) { 673 if (db->tx_queue_cnt >= TX_FREE_DESC_CNT) {
652 spin_unlock_irqrestore(&db->lock, flags); 674 spin_unlock_irqrestore(&db->lock, flags);
653 printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", db->tx_queue_cnt); 675 printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n",
676 db->tx_queue_cnt);
654 return 1; 677 return 1;
655 } 678 }
656 679
@@ -722,7 +745,8 @@ static int dmfe_stop(struct DEVICE *dev)
722 745
723#if 0 746#if 0
724 /* show statistic counter */ 747 /* show statistic counter */
725 printk(DRV_NAME ": FU:%lx EC:%lx LC:%lx NC:%lx LOC:%lx TXJT:%lx RESET:%lx RCR8:%lx FAL:%lx TT:%lx\n", 748 printk(DRV_NAME ": FU:%lx EC:%lx LC:%lx NC:%lx"
749 " LOC:%lx TXJT:%lx RESET:%lx RCR8:%lx FAL:%lx TT:%lx\n",
726 db->tx_fifo_underrun, db->tx_excessive_collision, 750 db->tx_fifo_underrun, db->tx_excessive_collision,
727 db->tx_late_collision, db->tx_no_carrier, db->tx_loss_carrier, 751 db->tx_late_collision, db->tx_no_carrier, db->tx_loss_carrier,
728 db->tx_jabber_timeout, db->reset_count, db->reset_cr8, 752 db->tx_jabber_timeout, db->reset_count, db->reset_cr8,
@@ -905,7 +929,7 @@ static inline u32 cal_CRC(unsigned char * Data, unsigned int Len, u8 flag)
905static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db) 929static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
906{ 930{
907 struct rx_desc *rxptr; 931 struct rx_desc *rxptr;
908 struct sk_buff *skb; 932 struct sk_buff *skb, *newskb;
909 int rxlen; 933 int rxlen;
910 u32 rdes0; 934 u32 rdes0;
911 935
@@ -919,7 +943,9 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
919 db->rx_avail_cnt--; 943 db->rx_avail_cnt--;
920 db->interval_rx_cnt++; 944 db->interval_rx_cnt++;
921 945
922 pci_unmap_single(db->pdev, le32_to_cpu(rxptr->rdes2), RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE); 946 pci_unmap_single(db->pdev, le32_to_cpu(rxptr->rdes2),
947 RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE);
948
923 if ( (rdes0 & 0x300) != 0x300) { 949 if ( (rdes0 & 0x300) != 0x300) {
924 /* A packet without First/Last flag */ 950 /* A packet without First/Last flag */
925 /* reuse this SKB */ 951 /* reuse this SKB */
@@ -956,9 +982,11 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
956 } else { 982 } else {
957 /* Good packet, send to upper layer */ 983 /* Good packet, send to upper layer */
958 /* Shorst packet used new SKB */ 984 /* Shorst packet used new SKB */
959 if ( (rxlen < RX_COPY_SIZE) && 985 if ((rxlen < RX_COPY_SIZE) &&
960 ( (skb = dev_alloc_skb(rxlen + 2) ) 986 ((newskb = dev_alloc_skb(rxlen + 2))
961 != NULL) ) { 987 != NULL)) {
988
989 skb = newskb;
962 /* size less than COPY_SIZE, allocate a rxlen SKB */ 990 /* size less than COPY_SIZE, allocate a rxlen SKB */
963 skb->dev = dev; 991 skb->dev = dev;
964 skb_reserve(skb, 2); /* 16byte align */ 992 skb_reserve(skb, 2); /* 16byte align */
@@ -1069,6 +1097,8 @@ static void dmfe_timer(unsigned long data)
1069 struct dmfe_board_info *db = netdev_priv(dev); 1097 struct dmfe_board_info *db = netdev_priv(dev);
1070 unsigned long flags; 1098 unsigned long flags;
1071 1099
1100 int link_ok, link_ok_phy;
1101
1072 DMFE_DBUG(0, "dmfe_timer()", 0); 1102 DMFE_DBUG(0, "dmfe_timer()", 0);
1073 spin_lock_irqsave(&db->lock, flags); 1103 spin_lock_irqsave(&db->lock, flags);
1074 1104
@@ -1078,7 +1108,8 @@ static void dmfe_timer(unsigned long data)
1078 if (db->chip_type && (db->chip_id==PCI_DM9102_ID)) { 1108 if (db->chip_type && (db->chip_id==PCI_DM9102_ID)) {
1079 db->cr6_data &= ~0x40000; 1109 db->cr6_data &= ~0x40000;
1080 update_cr6(db->cr6_data, db->ioaddr); 1110 update_cr6(db->cr6_data, db->ioaddr);
1081 phy_write(db->ioaddr, db->phy_addr, 0, 0x1000, db->chip_id); 1111 phy_write(db->ioaddr,
1112 db->phy_addr, 0, 0x1000, db->chip_id);
1082 db->cr6_data |= 0x40000; 1113 db->cr6_data |= 0x40000;
1083 update_cr6(db->cr6_data, db->ioaddr); 1114 update_cr6(db->cr6_data, db->ioaddr);
1084 db->timer.expires = DMFE_TIMER_WUT + HZ * 2; 1115 db->timer.expires = DMFE_TIMER_WUT + HZ * 2;
@@ -1139,21 +1170,41 @@ static void dmfe_timer(unsigned long data)
1139 (db->chip_revision == 0x02000010)) ) { 1170 (db->chip_revision == 0x02000010)) ) {
1140 /* DM9102A Chip */ 1171 /* DM9102A Chip */
1141 if (tmp_cr12 & 2) 1172 if (tmp_cr12 & 2)
1142 tmp_cr12 = 0x0; /* Link failed */ 1173 link_ok = 0;
1143 else 1174 else
1144 tmp_cr12 = 0x3; /* Link OK */ 1175 link_ok = 1;
1145 } 1176 }
1177 else
1178 /*0x43 is used instead of 0x3 because bit 6 should represent
1179 link status of external PHY */
1180 link_ok = (tmp_cr12 & 0x43) ? 1 : 0;
1181
1182
1183 /* If chip reports that link is failed it could be because external
1184 PHY link status pin is not conected correctly to chip
1185 To be sure ask PHY too.
1186 */
1187
1188 /* need a dummy read because of PHY's register latch*/
1189 phy_read (db->ioaddr, db->phy_addr, 1, db->chip_id);
1190 link_ok_phy = (phy_read (db->ioaddr,
1191 db->phy_addr, 1, db->chip_id) & 0x4) ? 1 : 0;
1146 1192
1147 if ( !(tmp_cr12 & 0x3) && !db->link_failed ) { 1193 if (link_ok_phy != link_ok) {
1194 DMFE_DBUG (0, "PHY and chip report different link status", 0);
1195 link_ok = link_ok | link_ok_phy;
1196 }
1197
1198 if ( !link_ok && netif_carrier_ok(dev)) {
1148 /* Link Failed */ 1199 /* Link Failed */
1149 DMFE_DBUG(0, "Link Failed", tmp_cr12); 1200 DMFE_DBUG(0, "Link Failed", tmp_cr12);
1150 db->link_failed = 1; 1201 netif_carrier_off(dev);
1151 netif_carrier_off(db->dev);
1152 1202
1153 /* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */ 1203 /* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */
1154 /* AUTO or force 1M Homerun/Longrun don't need */ 1204 /* AUTO or force 1M Homerun/Longrun don't need */
1155 if ( !(db->media_mode & 0x38) ) 1205 if ( !(db->media_mode & 0x38) )
1156 phy_write(db->ioaddr, db->phy_addr, 0, 0x1000, db->chip_id); 1206 phy_write(db->ioaddr, db->phy_addr,
1207 0, 0x1000, db->chip_id);
1157 1208
1158 /* AUTO mode, if INT phyxcer link failed, select EXT device */ 1209 /* AUTO mode, if INT phyxcer link failed, select EXT device */
1159 if (db->media_mode & DMFE_AUTO) { 1210 if (db->media_mode & DMFE_AUTO) {
@@ -1162,21 +1213,19 @@ static void dmfe_timer(unsigned long data)
1162 db->cr6_data&=~0x00000200; /* bit9=0, HD mode */ 1213 db->cr6_data&=~0x00000200; /* bit9=0, HD mode */
1163 update_cr6(db->cr6_data, db->ioaddr); 1214 update_cr6(db->cr6_data, db->ioaddr);
1164 } 1215 }
1165 } else 1216 } else if (!netif_carrier_ok(dev)) {
1166 if ((tmp_cr12 & 0x3) && db->link_failed) { 1217
1167 DMFE_DBUG(0, "Link link OK", tmp_cr12); 1218 DMFE_DBUG(0, "Link link OK", tmp_cr12);
1168 db->link_failed = 0; 1219
1169 1220 /* Auto Sense Speed */
1170 /* Auto Sense Speed */ 1221 if ( !(db->media_mode & DMFE_AUTO) || !dmfe_sense_speed(db)) {
1171 if ( (db->media_mode & DMFE_AUTO) && 1222 netif_carrier_on(dev);
1172 dmfe_sense_speed(db) ) 1223 SHOW_MEDIA_TYPE(db->op_mode);
1173 db->link_failed = 1;
1174 else
1175 netif_carrier_on(db->dev);
1176 dmfe_process_mode(db);
1177 /* SHOW_MEDIA_TYPE(db->op_mode); */
1178 } 1224 }
1179 1225
1226 dmfe_process_mode(db);
1227 }
1228
1180 /* HPNA remote command check */ 1229 /* HPNA remote command check */
1181 if (db->HPNA_command & 0xf00) { 1230 if (db->HPNA_command & 0xf00) {
1182 db->HPNA_timer--; 1231 db->HPNA_timer--;
@@ -1221,7 +1270,7 @@ static void dmfe_dynamic_reset(struct DEVICE *dev)
1221 db->tx_packet_cnt = 0; 1270 db->tx_packet_cnt = 0;
1222 db->tx_queue_cnt = 0; 1271 db->tx_queue_cnt = 0;
1223 db->rx_avail_cnt = 0; 1272 db->rx_avail_cnt = 0;
1224 db->link_failed = 1; 1273 netif_carrier_off(dev);
1225 db->wait_reset = 0; 1274 db->wait_reset = 0;
1226 1275
1227 /* Re-initilize DM910X board */ 1276 /* Re-initilize DM910X board */
@@ -1259,7 +1308,8 @@ static void dmfe_reuse_skb(struct dmfe_board_info *db, struct sk_buff * skb)
1259 1308
1260 if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) { 1309 if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) {
1261 rxptr->rx_skb_ptr = skb; 1310 rxptr->rx_skb_ptr = skb;
1262 rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->data, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); 1311 rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev,
1312 skb->data, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) );
1263 wmb(); 1313 wmb();
1264 rxptr->rdes0 = cpu_to_le32(0x80000000); 1314 rxptr->rdes0 = cpu_to_le32(0x80000000);
1265 db->rx_avail_cnt++; 1315 db->rx_avail_cnt++;
@@ -1291,8 +1341,11 @@ static void dmfe_descriptor_init(struct dmfe_board_info *db, unsigned long ioadd
1291 outl(db->first_tx_desc_dma, ioaddr + DCR4); /* TX DESC address */ 1341 outl(db->first_tx_desc_dma, ioaddr + DCR4); /* TX DESC address */
1292 1342
1293 /* rx descriptor start pointer */ 1343 /* rx descriptor start pointer */
1294 db->first_rx_desc = (void *)db->first_tx_desc + sizeof(struct tx_desc) * TX_DESC_CNT; 1344 db->first_rx_desc = (void *)db->first_tx_desc +
1295 db->first_rx_desc_dma = db->first_tx_desc_dma + sizeof(struct tx_desc) * TX_DESC_CNT; 1345 sizeof(struct tx_desc) * TX_DESC_CNT;
1346
1347 db->first_rx_desc_dma = db->first_tx_desc_dma +
1348 sizeof(struct tx_desc) * TX_DESC_CNT;
1296 db->rx_insert_ptr = db->first_rx_desc; 1349 db->rx_insert_ptr = db->first_rx_desc;
1297 db->rx_ready_ptr = db->first_rx_desc; 1350 db->rx_ready_ptr = db->first_rx_desc;
1298 outl(db->first_rx_desc_dma, ioaddr + DCR3); /* RX DESC address */ 1351 outl(db->first_rx_desc_dma, ioaddr + DCR3); /* RX DESC address */
@@ -1470,7 +1523,8 @@ static void allocate_rx_buffer(struct dmfe_board_info *db)
1470 if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL ) 1523 if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL )
1471 break; 1524 break;
1472 rxptr->rx_skb_ptr = skb; /* FIXME (?) */ 1525 rxptr->rx_skb_ptr = skb; /* FIXME (?) */
1473 rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->data, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); 1526 rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->data,
1527 RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) );
1474 wmb(); 1528 wmb();
1475 rxptr->rdes0 = cpu_to_le32(0x80000000); 1529 rxptr->rdes0 = cpu_to_le32(0x80000000);
1476 rxptr = rxptr->next_rx_desc; 1530 rxptr = rxptr->next_rx_desc;
@@ -1510,7 +1564,8 @@ static u16 read_srom_word(long ioaddr, int offset)
1510 for (i = 16; i > 0; i--) { 1564 for (i = 16; i > 0; i--) {
1511 outl(CR9_SROM_READ | CR9_SRCS | CR9_SRCLK, cr9_ioaddr); 1565 outl(CR9_SROM_READ | CR9_SRCS | CR9_SRCLK, cr9_ioaddr);
1512 udelay(5); 1566 udelay(5);
1513 srom_data = (srom_data << 1) | ((inl(cr9_ioaddr) & CR9_CRDOUT) ? 1 : 0); 1567 srom_data = (srom_data << 1) |
1568 ((inl(cr9_ioaddr) & CR9_CRDOUT) ? 1 : 0);
1514 outl(CR9_SROM_READ | CR9_SRCS, cr9_ioaddr); 1569 outl(CR9_SROM_READ | CR9_SRCS, cr9_ioaddr);
1515 udelay(5); 1570 udelay(5);
1516 } 1571 }
@@ -1537,9 +1592,11 @@ static u8 dmfe_sense_speed(struct dmfe_board_info * db)
1537 1592
1538 if ( (phy_mode & 0x24) == 0x24 ) { 1593 if ( (phy_mode & 0x24) == 0x24 ) {
1539 if (db->chip_id == PCI_DM9132_ID) /* DM9132 */ 1594 if (db->chip_id == PCI_DM9132_ID) /* DM9132 */
1540 phy_mode = phy_read(db->ioaddr, db->phy_addr, 7, db->chip_id) & 0xf000; 1595 phy_mode = phy_read(db->ioaddr,
1596 db->phy_addr, 7, db->chip_id) & 0xf000;
1541 else /* DM9102/DM9102A */ 1597 else /* DM9102/DM9102A */
1542 phy_mode = phy_read(db->ioaddr, db->phy_addr, 17, db->chip_id) & 0xf000; 1598 phy_mode = phy_read(db->ioaddr,
1599 db->phy_addr, 17, db->chip_id) & 0xf000;
1543 /* printk(DRV_NAME ": Phy_mode %x ",phy_mode); */ 1600 /* printk(DRV_NAME ": Phy_mode %x ",phy_mode); */
1544 switch (phy_mode) { 1601 switch (phy_mode) {
1545 case 0x1000: db->op_mode = DMFE_10MHF; break; 1602 case 0x1000: db->op_mode = DMFE_10MHF; break;
@@ -1576,8 +1633,11 @@ static void dmfe_set_phyxcer(struct dmfe_board_info *db)
1576 1633
1577 /* DM9009 Chip: Phyxcer reg18 bit12=0 */ 1634 /* DM9009 Chip: Phyxcer reg18 bit12=0 */
1578 if (db->chip_id == PCI_DM9009_ID) { 1635 if (db->chip_id == PCI_DM9009_ID) {
1579 phy_reg = phy_read(db->ioaddr, db->phy_addr, 18, db->chip_id) & ~0x1000; 1636 phy_reg = phy_read(db->ioaddr,
1580 phy_write(db->ioaddr, db->phy_addr, 18, phy_reg, db->chip_id); 1637 db->phy_addr, 18, db->chip_id) & ~0x1000;
1638
1639 phy_write(db->ioaddr,
1640 db->phy_addr, 18, phy_reg, db->chip_id);
1581 } 1641 }
1582 1642
1583 /* Phyxcer capability setting */ 1643 /* Phyxcer capability setting */
@@ -1650,10 +1710,12 @@ static void dmfe_process_mode(struct dmfe_board_info *db)
1650 case DMFE_100MHF: phy_reg = 0x2000; break; 1710 case DMFE_100MHF: phy_reg = 0x2000; break;
1651 case DMFE_100MFD: phy_reg = 0x2100; break; 1711 case DMFE_100MFD: phy_reg = 0x2100; break;
1652 } 1712 }
1653 phy_write(db->ioaddr, db->phy_addr, 0, phy_reg, db->chip_id); 1713 phy_write(db->ioaddr,
1714 db->phy_addr, 0, phy_reg, db->chip_id);
1654 if ( db->chip_type && (db->chip_id == PCI_DM9102_ID) ) 1715 if ( db->chip_type && (db->chip_id == PCI_DM9102_ID) )
1655 mdelay(20); 1716 mdelay(20);
1656 phy_write(db->ioaddr, db->phy_addr, 0, phy_reg, db->chip_id); 1717 phy_write(db->ioaddr,
1718 db->phy_addr, 0, phy_reg, db->chip_id);
1657 } 1719 }
1658 } 1720 }
1659} 1721}
@@ -1663,7 +1725,8 @@ static void dmfe_process_mode(struct dmfe_board_info *db)
1663 * Write a word to Phy register 1725 * Write a word to Phy register
1664 */ 1726 */
1665 1727
1666static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data, u32 chip_id) 1728static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset,
1729 u16 phy_data, u32 chip_id)
1667{ 1730{
1668 u16 i; 1731 u16 i;
1669 unsigned long ioaddr; 1732 unsigned long ioaddr;
@@ -1689,11 +1752,13 @@ static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data
1689 1752
1690 /* Send Phy address */ 1753 /* Send Phy address */
1691 for (i = 0x10; i > 0; i = i >> 1) 1754 for (i = 0x10; i > 0; i = i >> 1)
1692 phy_write_1bit(ioaddr, phy_addr & i ? PHY_DATA_1 : PHY_DATA_0); 1755 phy_write_1bit(ioaddr,
1756 phy_addr & i ? PHY_DATA_1 : PHY_DATA_0);
1693 1757
1694 /* Send register address */ 1758 /* Send register address */
1695 for (i = 0x10; i > 0; i = i >> 1) 1759 for (i = 0x10; i > 0; i = i >> 1)
1696 phy_write_1bit(ioaddr, offset & i ? PHY_DATA_1 : PHY_DATA_0); 1760 phy_write_1bit(ioaddr,
1761 offset & i ? PHY_DATA_1 : PHY_DATA_0);
1697 1762
1698 /* written trasnition */ 1763 /* written trasnition */
1699 phy_write_1bit(ioaddr, PHY_DATA_1); 1764 phy_write_1bit(ioaddr, PHY_DATA_1);
@@ -1701,7 +1766,8 @@ static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data
1701 1766
1702 /* Write a word data to PHY controller */ 1767 /* Write a word data to PHY controller */
1703 for ( i = 0x8000; i > 0; i >>= 1) 1768 for ( i = 0x8000; i > 0; i >>= 1)
1704 phy_write_1bit(ioaddr, phy_data & i ? PHY_DATA_1 : PHY_DATA_0); 1769 phy_write_1bit(ioaddr,
1770 phy_data & i ? PHY_DATA_1 : PHY_DATA_0);
1705 } 1771 }
1706} 1772}
1707 1773
@@ -1738,11 +1804,13 @@ static u16 phy_read(unsigned long iobase, u8 phy_addr, u8 offset, u32 chip_id)
1738 1804
1739 /* Send Phy address */ 1805 /* Send Phy address */
1740 for (i = 0x10; i > 0; i = i >> 1) 1806 for (i = 0x10; i > 0; i = i >> 1)
1741 phy_write_1bit(ioaddr, phy_addr & i ? PHY_DATA_1 : PHY_DATA_0); 1807 phy_write_1bit(ioaddr,
1808 phy_addr & i ? PHY_DATA_1 : PHY_DATA_0);
1742 1809
1743 /* Send register address */ 1810 /* Send register address */
1744 for (i = 0x10; i > 0; i = i >> 1) 1811 for (i = 0x10; i > 0; i = i >> 1)
1745 phy_write_1bit(ioaddr, offset & i ? PHY_DATA_1 : PHY_DATA_0); 1812 phy_write_1bit(ioaddr,
1813 offset & i ? PHY_DATA_1 : PHY_DATA_0);
1746 1814
1747 /* Skip transition state */ 1815 /* Skip transition state */
1748 phy_read_1bit(ioaddr); 1816 phy_read_1bit(ioaddr);
@@ -1963,7 +2031,8 @@ static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * db)
1963 2031
1964 /* Check remote device status match our setting ot not */ 2032 /* Check remote device status match our setting ot not */
1965 if ( phy_reg != (db->HPNA_command & 0x0f00) ) { 2033 if ( phy_reg != (db->HPNA_command & 0x0f00) ) {
1966 phy_write(db->ioaddr, db->phy_addr, 16, db->HPNA_command, db->chip_id); 2034 phy_write(db->ioaddr, db->phy_addr, 16, db->HPNA_command,
2035 db->chip_id);
1967 db->HPNA_timer=8; 2036 db->HPNA_timer=8;
1968 } else 2037 } else
1969 db->HPNA_timer=600; /* Match, every 10 minutes, check */ 2038 db->HPNA_timer=600; /* Match, every 10 minutes, check */
@@ -2003,8 +2072,11 @@ module_param(HPNA_tx_cmd, byte, 0);
2003module_param(HPNA_NoiseFloor, byte, 0); 2072module_param(HPNA_NoiseFloor, byte, 0);
2004module_param(SF_mode, byte, 0); 2073module_param(SF_mode, byte, 0);
2005MODULE_PARM_DESC(debug, "Davicom DM9xxx enable debugging (0-1)"); 2074MODULE_PARM_DESC(debug, "Davicom DM9xxx enable debugging (0-1)");
2006MODULE_PARM_DESC(mode, "Davicom DM9xxx: Bit 0: 10/100Mbps, bit 2: duplex, bit 8: HomePNA"); 2075MODULE_PARM_DESC(mode, "Davicom DM9xxx: "
2007MODULE_PARM_DESC(SF_mode, "Davicom DM9xxx special function (bit 0: VLAN, bit 1 Flow Control, bit 2: TX pause packet)"); 2076 "Bit 0: 10/100Mbps, bit 2: duplex, bit 8: HomePNA");
2077
2078MODULE_PARM_DESC(SF_mode, "Davicom DM9xxx special function "
2079 "(bit 0: VLAN, bit 1 Flow Control, bit 2: TX pause packet)");
2008 2080
2009/* Description: 2081/* Description:
2010 * when user used insmod to add module, system invoked init_module() 2082 * when user used insmod to add module, system invoked init_module()
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 885e73d731c2..dab88b958d6e 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3598,17 +3598,20 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
3598 3598
3599 /* Move to next BD in the ring */ 3599 /* Move to next BD in the ring */
3600 if (!(bd_status & T_W)) 3600 if (!(bd_status & T_W))
3601 ugeth->txBd[txQ] = bd + sizeof(struct qe_bd); 3601 bd += sizeof(struct qe_bd);
3602 else 3602 else
3603 ugeth->txBd[txQ] = ugeth->p_tx_bd_ring[txQ]; 3603 bd = ugeth->p_tx_bd_ring[txQ];
3604 3604
3605 /* If the next BD still needs to be cleaned up, then the bds 3605 /* If the next BD still needs to be cleaned up, then the bds
3606 are full. We need to tell the kernel to stop sending us stuff. */ 3606 are full. We need to tell the kernel to stop sending us stuff. */
3607 if (bd == ugeth->confBd[txQ]) { 3607 if (bd == ugeth->confBd[txQ]) {
3608 if (!netif_queue_stopped(dev)) 3608 if (!netif_queue_stopped(dev))
3609 netif_stop_queue(dev); 3609 netif_stop_queue(dev);
3610 return NETDEV_TX_BUSY;
3610 } 3611 }
3611 3612
3613 ugeth->txBd[txQ] = bd;
3614
3612 if (ugeth->p_scheduler) { 3615 if (ugeth->p_scheduler) {
3613 ugeth->cpucount[txQ]++; 3616 ugeth->cpucount[txQ]++;
3614 /* Indicate to QE that there are more Tx bds ready for 3617 /* Indicate to QE that there are more Tx bds ready for
@@ -3620,7 +3623,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
3620 3623
3621 spin_unlock_irq(&ugeth->lock); 3624 spin_unlock_irq(&ugeth->lock);
3622 3625
3623 return 0; 3626 return NETDEV_TX_OK;
3624} 3627}
3625 3628
3626static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit) 3629static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit)
@@ -3722,7 +3725,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
3722 /* Handle the transmitted buffer and release */ 3725 /* Handle the transmitted buffer and release */
3723 /* the BD to be used with the current frame */ 3726 /* the BD to be used with the current frame */
3724 3727
3725 if ((bd = ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0)) 3728 if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
3726 break; 3729 break;
3727 3730
3728 ugeth->stats.tx_packets++; 3731 ugeth->stats.tx_packets++;
@@ -3741,10 +3744,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
3741 3744
3742 /* Advance the confirmation BD pointer */ 3745 /* Advance the confirmation BD pointer */
3743 if (!(bd_status & T_W)) 3746 if (!(bd_status & T_W))
3744 ugeth->confBd[txQ] += sizeof(struct qe_bd); 3747 bd += sizeof(struct qe_bd);
3745 else 3748 else
3746 ugeth->confBd[txQ] = ugeth->p_tx_bd_ring[txQ]; 3749 bd = ugeth->p_tx_bd_ring[txQ];
3750 bd_status = in_be32((u32 *)bd);
3747 } 3751 }
3752 ugeth->confBd[txQ] = bd;
3748 return 0; 3753 return 0;
3749} 3754}
3750 3755
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index ebbda1d8f542..f3a972e74e9a 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -30,8 +30,8 @@
30*/ 30*/
31 31
32#define DRV_NAME "via-rhine" 32#define DRV_NAME "via-rhine"
33#define DRV_VERSION "1.4.2" 33#define DRV_VERSION "1.4.3"
34#define DRV_RELDATE "Sept-11-2006" 34#define DRV_RELDATE "2007-03-06"
35 35
36 36
37/* A few user-configurable values. 37/* A few user-configurable values.
@@ -105,6 +105,7 @@ static const int multicast_filter_limit = 32;
105#include <asm/io.h> 105#include <asm/io.h>
106#include <asm/irq.h> 106#include <asm/irq.h>
107#include <asm/uaccess.h> 107#include <asm/uaccess.h>
108#include <linux/dmi.h>
108 109
109/* These identify the driver base version and may not be removed. */ 110/* These identify the driver base version and may not be removed. */
110static char version[] __devinitdata = 111static char version[] __devinitdata =
@@ -1995,6 +1996,23 @@ static struct pci_driver rhine_driver = {
1995 .shutdown = rhine_shutdown, 1996 .shutdown = rhine_shutdown,
1996}; 1997};
1997 1998
1999static struct dmi_system_id __initdata rhine_dmi_table[] = {
2000 {
2001 .ident = "EPIA-M",
2002 .matches = {
2003 DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
2004 DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
2005 },
2006 },
2007 {
2008 .ident = "KV7",
2009 .matches = {
2010 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
2011 DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
2012 },
2013 },
2014 { NULL }
2015};
1998 2016
1999static int __init rhine_init(void) 2017static int __init rhine_init(void)
2000{ 2018{
@@ -2002,6 +2020,16 @@ static int __init rhine_init(void)
2002#ifdef MODULE 2020#ifdef MODULE
2003 printk(version); 2021 printk(version);
2004#endif 2022#endif
2023 if (dmi_check_system(rhine_dmi_table)) {
2024 /* these BIOSes fail at PXE boot if chip is in D3 */
2025 avoid_D3 = 1;
2026 printk(KERN_WARNING "%s: Broken BIOS detected, avoid_D3 "
2027 "enabled.\n",
2028 DRV_NAME);
2029 }
2030 else if (avoid_D3)
2031 printk(KERN_INFO "%s: avoid_D3 set.\n", DRV_NAME);
2032
2005 return pci_register_driver(&rhine_driver); 2033 return pci_register_driver(&rhine_driver);
2006} 2034}
2007 2035
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c
index 8dbcf83bb5f3..8b4540bfc1b0 100644
--- a/drivers/net/wan/z85230.c
+++ b/drivers/net/wan/z85230.c
@@ -407,7 +407,7 @@ static void z8530_tx(struct z8530_channel *c)
407 while(c->txcount) { 407 while(c->txcount) {
408 /* FIFO full ? */ 408 /* FIFO full ? */
409 if(!(read_zsreg(c, R0)&4)) 409 if(!(read_zsreg(c, R0)&4))
410 break; 410 return;
411 c->txcount--; 411 c->txcount--;
412 /* 412 /*
413 * Shovel out the byte 413 * Shovel out the byte
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index e594af46ff05..80cb88eb98c6 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -1858,9 +1858,6 @@ static irqreturn_t bcm43xx_interrupt_handler(int irq, void *dev_id)
1858 1858
1859 spin_lock(&bcm->irq_lock); 1859 spin_lock(&bcm->irq_lock);
1860 1860
1861 assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED);
1862 assert(bcm->current_core->id == BCM43xx_COREID_80211);
1863
1864 reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); 1861 reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON);
1865 if (reason == 0xffffffff) { 1862 if (reason == 0xffffffff) {
1866 /* irq not for us (shared irq) */ 1863 /* irq not for us (shared irq) */
@@ -1871,6 +1868,9 @@ static irqreturn_t bcm43xx_interrupt_handler(int irq, void *dev_id)
1871 if (!reason) 1868 if (!reason)
1872 goto out; 1869 goto out;
1873 1870
1871 assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED);
1872 assert(bcm->current_core->id == BCM43xx_COREID_80211);
1873
1874 bcm->dma_reason[0] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA0_REASON) 1874 bcm->dma_reason[0] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA0_REASON)
1875 & 0x0001DC00; 1875 & 0x0001DC00;
1876 bcm->dma_reason[1] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA1_REASON) 1876 bcm->dma_reason[1] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA1_REASON)
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index 3a5c9c2b2150..cae89258a640 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -859,6 +859,11 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
859 bcm43xx_radio_write16(bcm, 0x005D, 0x0088); 859 bcm43xx_radio_write16(bcm, 0x005D, 0x0088);
860 bcm43xx_radio_write16(bcm, 0x005E, 0x0088); 860 bcm43xx_radio_write16(bcm, 0x005E, 0x0088);
861 bcm43xx_radio_write16(bcm, 0x007D, 0x0088); 861 bcm43xx_radio_write16(bcm, 0x007D, 0x0088);
862 bcm43xx_shm_write32(bcm, BCM43xx_SHM_SHARED,
863 BCM43xx_UCODEFLAGS_OFFSET,
864 (bcm43xx_shm_read32(bcm, BCM43xx_SHM_SHARED,
865 BCM43xx_UCODEFLAGS_OFFSET)
866 | 0x00000200));
862 } 867 }
863 if (radio->revision == 8) { 868 if (radio->revision == 8) {
864 bcm43xx_radio_write16(bcm, 0x0051, 0x0000); 869 bcm43xx_radio_write16(bcm, 0x0051, 0x0000);
@@ -941,7 +946,8 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
941 bcm43xx_phy_write(bcm, 0x0038, 0x0668); 946 bcm43xx_phy_write(bcm, 0x0038, 0x0668);
942 bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); 947 bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF);
943 if (radio->revision <= 5) 948 if (radio->revision <= 5)
944 bcm43xx_phy_write(bcm, 0x005D, bcm43xx_phy_read(bcm, 0x005D) | 0x0003); 949 bcm43xx_phy_write(bcm, 0x005D, (bcm43xx_phy_read(bcm, 0x005D)
950 & 0xFF80) | 0x0003);
945 if (radio->revision <= 2) 951 if (radio->revision <= 2)
946 bcm43xx_radio_write16(bcm, 0x005D, 0x000D); 952 bcm43xx_radio_write16(bcm, 0x005D, 0x000D);
947 953
@@ -958,7 +964,7 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
958 bcm43xx_phy_write(bcm, 0x0016, 0x0410); 964 bcm43xx_phy_write(bcm, 0x0016, 0x0410);
959 bcm43xx_phy_write(bcm, 0x0017, 0x0820); 965 bcm43xx_phy_write(bcm, 0x0017, 0x0820);
960 bcm43xx_phy_write(bcm, 0x0062, 0x0007); 966 bcm43xx_phy_write(bcm, 0x0062, 0x0007);
961 (void) bcm43xx_radio_calibrationvalue(bcm); 967 bcm43xx_radio_init2050(bcm);
962 bcm43xx_phy_lo_g_measure(bcm); 968 bcm43xx_phy_lo_g_measure(bcm);
963 if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) { 969 if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) {
964 bcm43xx_calc_nrssi_slope(bcm); 970 bcm43xx_calc_nrssi_slope(bcm);
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
index 7b665e2386a8..d6d9413d7f23 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -105,18 +105,24 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev,
105 struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); 105 struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
106 unsigned long flags; 106 unsigned long flags;
107 u8 channel; 107 u8 channel;
108 s8 expon;
108 int freq; 109 int freq;
109 int err = -EINVAL; 110 int err = -EINVAL;
110 111
111 mutex_lock(&bcm->mutex); 112 mutex_lock(&bcm->mutex);
112 spin_lock_irqsave(&bcm->irq_lock, flags); 113 spin_lock_irqsave(&bcm->irq_lock, flags);
113 114
114 if ((data->freq.m >= 0) && (data->freq.m <= 1000)) { 115 if ((data->freq.e == 0) &&
116 (data->freq.m >= 0) && (data->freq.m <= 1000)) {
115 channel = data->freq.m; 117 channel = data->freq.m;
116 freq = bcm43xx_channel_to_freq(bcm, channel); 118 freq = bcm43xx_channel_to_freq(bcm, channel);
117 } else { 119 } else {
118 channel = bcm43xx_freq_to_channel(bcm, data->freq.m);
119 freq = data->freq.m; 120 freq = data->freq.m;
121 expon = 6 - data->freq.e;
122 while (--expon >= 0) /* scale down the frequency to MHz */
123 freq /= 10;
124 assert(freq > 1000);
125 channel = bcm43xx_freq_to_channel(bcm, freq);
120 } 126 }
121 if (!ieee80211_is_valid_channel(bcm->ieee, channel)) 127 if (!ieee80211_is_valid_channel(bcm->ieee, channel))
122 goto out_unlock; 128 goto out_unlock;
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 01869b1782e4..ad33e0159514 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -100,6 +100,7 @@ static void msi_set_mask_bit(unsigned int irq, int flag)
100 BUG(); 100 BUG();
101 break; 101 break;
102 } 102 }
103 entry->msi_attrib.masked = !!flag;
103} 104}
104 105
105void read_msi_msg(unsigned int irq, struct msi_msg *msg) 106void read_msi_msg(unsigned int irq, struct msi_msg *msg)
@@ -179,6 +180,7 @@ void write_msi_msg(unsigned int irq, struct msi_msg *msg)
179 default: 180 default:
180 BUG(); 181 BUG();
181 } 182 }
183 entry->msg = *msg;
182} 184}
183 185
184void mask_msi_irq(unsigned int irq) 186void mask_msi_irq(unsigned int irq)
@@ -225,164 +227,60 @@ static struct msi_desc* alloc_msi_entry(void)
225} 227}
226 228
227#ifdef CONFIG_PM 229#ifdef CONFIG_PM
228static int __pci_save_msi_state(struct pci_dev *dev)
229{
230 int pos, i = 0;
231 u16 control;
232 struct pci_cap_saved_state *save_state;
233 u32 *cap;
234
235 if (!dev->msi_enabled)
236 return 0;
237
238 pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
239 if (pos <= 0)
240 return 0;
241
242 save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u32) * 5,
243 GFP_KERNEL);
244 if (!save_state) {
245 printk(KERN_ERR "Out of memory in pci_save_msi_state\n");
246 return -ENOMEM;
247 }
248 cap = &save_state->data[0];
249
250 pci_read_config_dword(dev, pos, &cap[i++]);
251 control = cap[0] >> 16;
252 pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, &cap[i++]);
253 if (control & PCI_MSI_FLAGS_64BIT) {
254 pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, &cap[i++]);
255 pci_read_config_dword(dev, pos + PCI_MSI_DATA_64, &cap[i++]);
256 } else
257 pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, &cap[i++]);
258 if (control & PCI_MSI_FLAGS_MASKBIT)
259 pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, &cap[i++]);
260 save_state->cap_nr = PCI_CAP_ID_MSI;
261 pci_add_saved_cap(dev, save_state);
262 return 0;
263}
264
265static void __pci_restore_msi_state(struct pci_dev *dev) 230static void __pci_restore_msi_state(struct pci_dev *dev)
266{ 231{
267 int i = 0, pos; 232 int pos;
268 u16 control; 233 u16 control;
269 struct pci_cap_saved_state *save_state; 234 struct msi_desc *entry;
270 u32 *cap;
271 235
272 if (!dev->msi_enabled) 236 if (!dev->msi_enabled)
273 return; 237 return;
274 238
275 save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSI); 239 entry = get_irq_msi(dev->irq);
276 pos = pci_find_capability(dev, PCI_CAP_ID_MSI); 240 pos = entry->msi_attrib.pos;
277 if (!save_state || pos <= 0)
278 return;
279 cap = &save_state->data[0];
280 241
281 pci_intx(dev, 0); /* disable intx */ 242 pci_intx(dev, 0); /* disable intx */
282 control = cap[i++] >> 16;
283 msi_set_enable(dev, 0); 243 msi_set_enable(dev, 0);
284 pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, cap[i++]); 244 write_msi_msg(dev->irq, &entry->msg);
285 if (control & PCI_MSI_FLAGS_64BIT) { 245 if (entry->msi_attrib.maskbit)
286 pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, cap[i++]); 246 msi_set_mask_bit(dev->irq, entry->msi_attrib.masked);
287 pci_write_config_dword(dev, pos + PCI_MSI_DATA_64, cap[i++]); 247
288 } else 248 pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);
289 pci_write_config_dword(dev, pos + PCI_MSI_DATA_32, cap[i++]); 249 control &= ~(PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE);
290 if (control & PCI_MSI_FLAGS_MASKBIT) 250 if (entry->msi_attrib.maskbit || !entry->msi_attrib.masked)
291 pci_write_config_dword(dev, pos + PCI_MSI_MASK_BIT, cap[i++]); 251 control |= PCI_MSI_FLAGS_ENABLE;
292 pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); 252 pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control);
293 pci_remove_saved_cap(save_state);
294 kfree(save_state);
295}
296
297static int __pci_save_msix_state(struct pci_dev *dev)
298{
299 int pos;
300 int irq, head, tail = 0;
301 u16 control;
302 struct pci_cap_saved_state *save_state;
303
304 if (!dev->msix_enabled)
305 return 0;
306
307 pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
308 if (pos <= 0)
309 return 0;
310
311 /* save the capability */
312 pci_read_config_word(dev, msi_control_reg(pos), &control);
313 save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u16),
314 GFP_KERNEL);
315 if (!save_state) {
316 printk(KERN_ERR "Out of memory in pci_save_msix_state\n");
317 return -ENOMEM;
318 }
319 *((u16 *)&save_state->data[0]) = control;
320
321 /* save the table */
322 irq = head = dev->first_msi_irq;
323 while (head != tail) {
324 struct msi_desc *entry;
325
326 entry = get_irq_msi(irq);
327 read_msi_msg(irq, &entry->msg_save);
328
329 tail = entry->link.tail;
330 irq = tail;
331 }
332
333 save_state->cap_nr = PCI_CAP_ID_MSIX;
334 pci_add_saved_cap(dev, save_state);
335 return 0;
336}
337
338int pci_save_msi_state(struct pci_dev *dev)
339{
340 int rc;
341
342 rc = __pci_save_msi_state(dev);
343 if (rc)
344 return rc;
345
346 rc = __pci_save_msix_state(dev);
347
348 return rc;
349} 253}
350 254
351static void __pci_restore_msix_state(struct pci_dev *dev) 255static void __pci_restore_msix_state(struct pci_dev *dev)
352{ 256{
353 u16 save;
354 int pos; 257 int pos;
355 int irq, head, tail = 0; 258 int irq, head, tail = 0;
356 struct msi_desc *entry; 259 struct msi_desc *entry;
357 struct pci_cap_saved_state *save_state; 260 u16 control;
358 261
359 if (!dev->msix_enabled) 262 if (!dev->msix_enabled)
360 return; 263 return;
361 264
362 save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSIX);
363 if (!save_state)
364 return;
365 save = *((u16 *)&save_state->data[0]);
366 pci_remove_saved_cap(save_state);
367 kfree(save_state);
368
369 pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
370 if (pos <= 0)
371 return;
372
373 /* route the table */ 265 /* route the table */
374 pci_intx(dev, 0); /* disable intx */ 266 pci_intx(dev, 0); /* disable intx */
375 msix_set_enable(dev, 0); 267 msix_set_enable(dev, 0);
376 irq = head = dev->first_msi_irq; 268 irq = head = dev->first_msi_irq;
269 entry = get_irq_msi(irq);
270 pos = entry->msi_attrib.pos;
377 while (head != tail) { 271 while (head != tail) {
378 entry = get_irq_msi(irq); 272 entry = get_irq_msi(irq);
379 write_msi_msg(irq, &entry->msg_save); 273 write_msi_msg(irq, &entry->msg);
274 msi_set_mask_bit(irq, entry->msi_attrib.masked);
380 275
381 tail = entry->link.tail; 276 tail = entry->link.tail;
382 irq = tail; 277 irq = tail;
383 } 278 }
384 279
385 pci_write_config_word(dev, msi_control_reg(pos), save); 280 pci_read_config_word(dev, pos + PCI_MSIX_FLAGS, &control);
281 control &= ~PCI_MSIX_FLAGS_MASKALL;
282 control |= PCI_MSIX_FLAGS_ENABLE;
283 pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control);
386} 284}
387 285
388void pci_restore_msi_state(struct pci_dev *dev) 286void pci_restore_msi_state(struct pci_dev *dev)
@@ -420,6 +318,7 @@ static int msi_capability_init(struct pci_dev *dev)
420 entry->msi_attrib.is_64 = is_64bit_address(control); 318 entry->msi_attrib.is_64 = is_64bit_address(control);
421 entry->msi_attrib.entry_nr = 0; 319 entry->msi_attrib.entry_nr = 0;
422 entry->msi_attrib.maskbit = is_mask_bit_support(control); 320 entry->msi_attrib.maskbit = is_mask_bit_support(control);
321 entry->msi_attrib.masked = 1;
423 entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ 322 entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */
424 entry->msi_attrib.pos = pos; 323 entry->msi_attrib.pos = pos;
425 if (is_mask_bit_support(control)) { 324 if (is_mask_bit_support(control)) {
@@ -507,6 +406,7 @@ static int msix_capability_init(struct pci_dev *dev,
507 entry->msi_attrib.is_64 = 1; 406 entry->msi_attrib.is_64 = 1;
508 entry->msi_attrib.entry_nr = j; 407 entry->msi_attrib.entry_nr = j;
509 entry->msi_attrib.maskbit = 1; 408 entry->msi_attrib.maskbit = 1;
409 entry->msi_attrib.masked = 1;
510 entry->msi_attrib.default_irq = dev->irq; 410 entry->msi_attrib.default_irq = dev->irq;
511 entry->msi_attrib.pos = pos; 411 entry->msi_attrib.pos = pos;
512 entry->dev = dev; 412 entry->dev = dev;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index df495300ce3d..d3eab057b2d3 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -551,7 +551,9 @@ static int pci_save_pcie_state(struct pci_dev *dev)
551 if (pos <= 0) 551 if (pos <= 0)
552 return 0; 552 return 0;
553 553
554 save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL); 554 save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP);
555 if (!save_state)
556 save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL);
555 if (!save_state) { 557 if (!save_state) {
556 dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); 558 dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n");
557 return -ENOMEM; 559 return -ENOMEM;
@@ -582,8 +584,6 @@ static void pci_restore_pcie_state(struct pci_dev *dev)
582 pci_write_config_word(dev, pos + PCI_EXP_LNKCTL, cap[i++]); 584 pci_write_config_word(dev, pos + PCI_EXP_LNKCTL, cap[i++]);
583 pci_write_config_word(dev, pos + PCI_EXP_SLTCTL, cap[i++]); 585 pci_write_config_word(dev, pos + PCI_EXP_SLTCTL, cap[i++]);
584 pci_write_config_word(dev, pos + PCI_EXP_RTCTL, cap[i++]); 586 pci_write_config_word(dev, pos + PCI_EXP_RTCTL, cap[i++]);
585 pci_remove_saved_cap(save_state);
586 kfree(save_state);
587} 587}
588 588
589 589
@@ -597,7 +597,9 @@ static int pci_save_pcix_state(struct pci_dev *dev)
597 if (pos <= 0) 597 if (pos <= 0)
598 return 0; 598 return 0;
599 599
600 save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL); 600 save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP);
601 if (!save_state)
602 save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL);
601 if (!save_state) { 603 if (!save_state) {
602 dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); 604 dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n");
603 return -ENOMEM; 605 return -ENOMEM;
@@ -622,8 +624,6 @@ static void pci_restore_pcix_state(struct pci_dev *dev)
622 cap = (u16 *)&save_state->data[0]; 624 cap = (u16 *)&save_state->data[0];
623 625
624 pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); 626 pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]);
625 pci_remove_saved_cap(save_state);
626 kfree(save_state);
627} 627}
628 628
629 629
@@ -638,8 +638,6 @@ pci_save_state(struct pci_dev *dev)
638 /* XXX: 100% dword access ok here? */ 638 /* XXX: 100% dword access ok here? */
639 for (i = 0; i < 16; i++) 639 for (i = 0; i < 16; i++)
640 pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]); 640 pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]);
641 if ((i = pci_save_msi_state(dev)) != 0)
642 return i;
643 if ((i = pci_save_pcie_state(dev)) != 0) 641 if ((i = pci_save_pcie_state(dev)) != 0)
644 return i; 642 return i;
645 if ((i = pci_save_pcix_state(dev)) != 0) 643 if ((i = pci_save_pcix_state(dev)) != 0)
@@ -757,7 +755,8 @@ int pci_enable_device(struct pci_dev *dev)
757 * when a device is enabled using managed PCI device enable interface. 755 * when a device is enabled using managed PCI device enable interface.
758 */ 756 */
759struct pci_devres { 757struct pci_devres {
760 unsigned int disable:1; 758 unsigned int enabled:1;
759 unsigned int pinned:1;
761 unsigned int orig_intx:1; 760 unsigned int orig_intx:1;
762 unsigned int restore_intx:1; 761 unsigned int restore_intx:1;
763 u32 region_mask; 762 u32 region_mask;
@@ -781,7 +780,7 @@ static void pcim_release(struct device *gendev, void *res)
781 if (this->restore_intx) 780 if (this->restore_intx)
782 pci_intx(dev, this->orig_intx); 781 pci_intx(dev, this->orig_intx);
783 782
784 if (this->disable) 783 if (this->enabled && !this->pinned)
785 pci_disable_device(dev); 784 pci_disable_device(dev);
786} 785}
787 786
@@ -820,12 +819,12 @@ int pcim_enable_device(struct pci_dev *pdev)
820 dr = get_pci_dr(pdev); 819 dr = get_pci_dr(pdev);
821 if (unlikely(!dr)) 820 if (unlikely(!dr))
822 return -ENOMEM; 821 return -ENOMEM;
823 WARN_ON(!!dr->disable); 822 WARN_ON(!!dr->enabled);
824 823
825 rc = pci_enable_device(pdev); 824 rc = pci_enable_device(pdev);
826 if (!rc) { 825 if (!rc) {
827 pdev->is_managed = 1; 826 pdev->is_managed = 1;
828 dr->disable = 1; 827 dr->enabled = 1;
829 } 828 }
830 return rc; 829 return rc;
831} 830}
@@ -843,9 +842,9 @@ void pcim_pin_device(struct pci_dev *pdev)
843 struct pci_devres *dr; 842 struct pci_devres *dr;
844 843
845 dr = find_pci_dr(pdev); 844 dr = find_pci_dr(pdev);
846 WARN_ON(!dr || !dr->disable); 845 WARN_ON(!dr || !dr->enabled);
847 if (dr) 846 if (dr)
848 dr->disable = 0; 847 dr->pinned = 1;
849} 848}
850 849
851/** 850/**
@@ -876,7 +875,7 @@ pci_disable_device(struct pci_dev *dev)
876 875
877 dr = find_pci_dr(dev); 876 dr = find_pci_dr(dev);
878 if (dr) 877 if (dr)
879 dr->disable = 0; 878 dr->enabled = 0;
880 879
881 if (atomic_sub_return(1, &dev->enable_cnt) != 0) 880 if (atomic_sub_return(1, &dev->enable_cnt) != 0)
882 return; 881 return;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index ae7a975995a5..62ea04c8af64 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -52,10 +52,8 @@ static inline void pci_no_msi(void) { }
52#endif 52#endif
53 53
54#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM) 54#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM)
55int pci_save_msi_state(struct pci_dev *dev);
56void pci_restore_msi_state(struct pci_dev *dev); 55void pci_restore_msi_state(struct pci_dev *dev);
57#else 56#else
58static inline int pci_save_msi_state(struct pci_dev *dev) { return 0; }
59static inline void pci_restore_msi_state(struct pci_dev *dev) {} 57static inline void pci_restore_msi_state(struct pci_dev *dev) {}
60#endif 58#endif
61 59
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c
index b164de050d4f..db6ad8e763ac 100644
--- a/drivers/pci/pcie/aer/aerdrv.c
+++ b/drivers/pci/pcie/aer/aerdrv.c
@@ -66,7 +66,7 @@ static struct pci_error_handlers aer_error_handlers = {
66 .resume = aer_error_resume, 66 .resume = aer_error_resume,
67}; 67};
68 68
69static struct pcie_port_service_driver aerdrv = { 69static struct pcie_port_service_driver aerdriver = {
70 .name = "aer", 70 .name = "aer",
71 .id_table = &aer_id[0], 71 .id_table = &aer_id[0],
72 72
@@ -328,7 +328,7 @@ static void aer_error_resume(struct pci_dev *dev)
328 **/ 328 **/
329static int __init aer_service_init(void) 329static int __init aer_service_init(void)
330{ 330{
331 return pcie_port_service_register(&aerdrv); 331 return pcie_port_service_register(&aerdriver);
332} 332}
333 333
334/** 334/**
@@ -338,7 +338,7 @@ static int __init aer_service_init(void)
338 **/ 338 **/
339static void __exit aer_service_exit(void) 339static void __exit aer_service_exit(void)
340{ 340{
341 pcie_port_service_unregister(&aerdrv); 341 pcie_port_service_unregister(&aerdriver);
342} 342}
343 343
344module_init(aer_service_init); 344module_init(aer_service_init);
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index f17e7ed2b2a5..0be5a0b30725 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -276,7 +276,7 @@ static struct pci_error_handlers pcie_portdrv_err_handler = {
276 .resume = pcie_portdrv_err_resume, 276 .resume = pcie_portdrv_err_resume,
277}; 277};
278 278
279static struct pci_driver pcie_portdrv = { 279static struct pci_driver pcie_portdriver = {
280 .name = (char *)device_name, 280 .name = (char *)device_name,
281 .id_table = &port_pci_ids[0], 281 .id_table = &port_pci_ids[0],
282 282
@@ -298,7 +298,7 @@ static int __init pcie_portdrv_init(void)
298 printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval); 298 printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval);
299 goto out; 299 goto out;
300 } 300 }
301 retval = pci_register_driver(&pcie_portdrv); 301 retval = pci_register_driver(&pcie_portdriver);
302 if (retval) 302 if (retval)
303 pcie_port_bus_unregister(); 303 pcie_port_bus_unregister();
304 out: 304 out:
@@ -307,7 +307,7 @@ static int __init pcie_portdrv_init(void)
307 307
308static void __exit pcie_portdrv_exit(void) 308static void __exit pcie_portdrv_exit(void)
309{ 309{
310 pci_unregister_driver(&pcie_portdrv); 310 pci_unregister_driver(&pcie_portdriver);
311 pcie_port_bus_unregister(); 311 pcie_port_bus_unregister();
312} 312}
313 313
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index ff98eaddaa73..2dd8681d6b31 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -15,7 +15,7 @@
15 15
16DECLARE_RWSEM(pci_bus_sem); 16DECLARE_RWSEM(pci_bus_sem);
17 17
18static struct pci_bus * __devinit 18static struct pci_bus *
19pci_do_find_bus(struct pci_bus* bus, unsigned char busnr) 19pci_do_find_bus(struct pci_bus* bus, unsigned char busnr)
20{ 20{
21 struct pci_bus* child; 21 struct pci_bus* child;
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 7a535542fe92..118ac9779b3c 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -89,6 +89,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi,
89 return; 89 return;
90 90
91 res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag 91 res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag
92 res->irq_resource[i].flags |= irq_flags(triggering, polarity);
92 irq = acpi_register_gsi(gsi, triggering, polarity); 93 irq = acpi_register_gsi(gsi, triggering, polarity);
93 if (irq < 0) { 94 if (irq < 0) {
94 res->irq_resource[i].flags |= IORESOURCE_DISABLED; 95 res->irq_resource[i].flags |= IORESOURCE_DISABLED;
@@ -103,8 +104,52 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi,
103 pcibios_penalize_isa_irq(irq, 1); 104 pcibios_penalize_isa_irq(irq, 1);
104} 105}
105 106
107static int dma_flags(int type, int bus_master, int transfer)
108{
109 int flags = 0;
110
111 if (bus_master)
112 flags |= IORESOURCE_DMA_MASTER;
113 switch (type) {
114 case ACPI_COMPATIBILITY:
115 flags |= IORESOURCE_DMA_COMPATIBLE;
116 break;
117 case ACPI_TYPE_A:
118 flags |= IORESOURCE_DMA_TYPEA;
119 break;
120 case ACPI_TYPE_B:
121 flags |= IORESOURCE_DMA_TYPEB;
122 break;
123 case ACPI_TYPE_F:
124 flags |= IORESOURCE_DMA_TYPEF;
125 break;
126 default:
127 /* Set a default value ? */
128 flags |= IORESOURCE_DMA_COMPATIBLE;
129 pnp_err("Invalid DMA type");
130 }
131 switch (transfer) {
132 case ACPI_TRANSFER_8:
133 flags |= IORESOURCE_DMA_8BIT;
134 break;
135 case ACPI_TRANSFER_8_16:
136 flags |= IORESOURCE_DMA_8AND16BIT;
137 break;
138 case ACPI_TRANSFER_16:
139 flags |= IORESOURCE_DMA_16BIT;
140 break;
141 default:
142 /* Set a default value ? */
143 flags |= IORESOURCE_DMA_8AND16BIT;
144 pnp_err("Invalid DMA transfer type");
145 }
146
147 return flags;
148}
149
106static void 150static void
107pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma) 151pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma,
152 int type, int bus_master, int transfer)
108{ 153{
109 int i = 0; 154 int i = 0;
110 while (i < PNP_MAX_DMA && 155 while (i < PNP_MAX_DMA &&
@@ -112,6 +157,7 @@ pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma)
112 i++; 157 i++;
113 if (i < PNP_MAX_DMA) { 158 if (i < PNP_MAX_DMA) {
114 res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag 159 res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
160 res->dma_resource[i].flags |= dma_flags(type, bus_master, transfer);
115 if (dma == -1) { 161 if (dma == -1) {
116 res->dma_resource[i].flags |= IORESOURCE_DISABLED; 162 res->dma_resource[i].flags |= IORESOURCE_DISABLED;
117 return; 163 return;
@@ -123,7 +169,7 @@ pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma)
123 169
124static void 170static void
125pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, 171pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
126 u64 io, u64 len) 172 u64 io, u64 len, int io_decode)
127{ 173{
128 int i = 0; 174 int i = 0;
129 while (!(res->port_resource[i].flags & IORESOURCE_UNSET) && 175 while (!(res->port_resource[i].flags & IORESOURCE_UNSET) &&
@@ -131,6 +177,8 @@ pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
131 i++; 177 i++;
132 if (i < PNP_MAX_PORT) { 178 if (i < PNP_MAX_PORT) {
133 res->port_resource[i].flags = IORESOURCE_IO; // Also clears _UNSET flag 179 res->port_resource[i].flags = IORESOURCE_IO; // Also clears _UNSET flag
180 if (io_decode == ACPI_DECODE_16)
181 res->port_resource[i].flags |= PNP_PORT_FLAG_16BITADDR;
134 if (len <= 0 || (io + len -1) >= 0x10003) { 182 if (len <= 0 || (io + len -1) >= 0x10003) {
135 res->port_resource[i].flags |= IORESOURCE_DISABLED; 183 res->port_resource[i].flags |= IORESOURCE_DISABLED;
136 return; 184 return;
@@ -142,7 +190,7 @@ pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
142 190
143static void 191static void
144pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, 192pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
145 u64 mem, u64 len) 193 u64 mem, u64 len, int write_protect)
146{ 194{
147 int i = 0; 195 int i = 0;
148 while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) && 196 while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) &&
@@ -154,6 +202,9 @@ pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
154 res->mem_resource[i].flags |= IORESOURCE_DISABLED; 202 res->mem_resource[i].flags |= IORESOURCE_DISABLED;
155 return; 203 return;
156 } 204 }
205 if(write_protect == ACPI_READ_WRITE_MEMORY)
206 res->mem_resource[i].flags |= IORESOURCE_MEM_WRITEABLE;
207
157 res->mem_resource[i].start = mem; 208 res->mem_resource[i].start = mem;
158 res->mem_resource[i].end = mem + len - 1; 209 res->mem_resource[i].end = mem + len - 1;
159 } 210 }
@@ -178,10 +229,11 @@ pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table,
178 229
179 if (p->resource_type == ACPI_MEMORY_RANGE) 230 if (p->resource_type == ACPI_MEMORY_RANGE)
180 pnpacpi_parse_allocated_memresource(res_table, 231 pnpacpi_parse_allocated_memresource(res_table,
181 p->minimum, p->address_length); 232 p->minimum, p->address_length, p->info.mem.write_protect);
182 else if (p->resource_type == ACPI_IO_RANGE) 233 else if (p->resource_type == ACPI_IO_RANGE)
183 pnpacpi_parse_allocated_ioresource(res_table, 234 pnpacpi_parse_allocated_ioresource(res_table,
184 p->minimum, p->address_length); 235 p->minimum, p->address_length,
236 p->granularity == 0xfff ? ACPI_DECODE_10 : ACPI_DECODE_16);
185} 237}
186 238
187static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, 239static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
@@ -208,13 +260,17 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
208 case ACPI_RESOURCE_TYPE_DMA: 260 case ACPI_RESOURCE_TYPE_DMA:
209 if (res->data.dma.channel_count > 0) 261 if (res->data.dma.channel_count > 0)
210 pnpacpi_parse_allocated_dmaresource(res_table, 262 pnpacpi_parse_allocated_dmaresource(res_table,
211 res->data.dma.channels[0]); 263 res->data.dma.channels[0],
264 res->data.dma.type,
265 res->data.dma.bus_master,
266 res->data.dma.transfer);
212 break; 267 break;
213 268
214 case ACPI_RESOURCE_TYPE_IO: 269 case ACPI_RESOURCE_TYPE_IO:
215 pnpacpi_parse_allocated_ioresource(res_table, 270 pnpacpi_parse_allocated_ioresource(res_table,
216 res->data.io.minimum, 271 res->data.io.minimum,
217 res->data.io.address_length); 272 res->data.io.address_length,
273 res->data.io.io_decode);
218 break; 274 break;
219 275
220 case ACPI_RESOURCE_TYPE_START_DEPENDENT: 276 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
@@ -224,7 +280,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
224 case ACPI_RESOURCE_TYPE_FIXED_IO: 280 case ACPI_RESOURCE_TYPE_FIXED_IO:
225 pnpacpi_parse_allocated_ioresource(res_table, 281 pnpacpi_parse_allocated_ioresource(res_table,
226 res->data.fixed_io.address, 282 res->data.fixed_io.address,
227 res->data.fixed_io.address_length); 283 res->data.fixed_io.address_length,
284 ACPI_DECODE_10);
228 break; 285 break;
229 286
230 case ACPI_RESOURCE_TYPE_VENDOR: 287 case ACPI_RESOURCE_TYPE_VENDOR:
@@ -236,17 +293,20 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
236 case ACPI_RESOURCE_TYPE_MEMORY24: 293 case ACPI_RESOURCE_TYPE_MEMORY24:
237 pnpacpi_parse_allocated_memresource(res_table, 294 pnpacpi_parse_allocated_memresource(res_table,
238 res->data.memory24.minimum, 295 res->data.memory24.minimum,
239 res->data.memory24.address_length); 296 res->data.memory24.address_length,
297 res->data.memory24.write_protect);
240 break; 298 break;
241 case ACPI_RESOURCE_TYPE_MEMORY32: 299 case ACPI_RESOURCE_TYPE_MEMORY32:
242 pnpacpi_parse_allocated_memresource(res_table, 300 pnpacpi_parse_allocated_memresource(res_table,
243 res->data.memory32.minimum, 301 res->data.memory32.minimum,
244 res->data.memory32.address_length); 302 res->data.memory32.address_length,
303 res->data.memory32.write_protect);
245 break; 304 break;
246 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: 305 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
247 pnpacpi_parse_allocated_memresource(res_table, 306 pnpacpi_parse_allocated_memresource(res_table,
248 res->data.fixed_memory32.address, 307 res->data.fixed_memory32.address,
249 res->data.fixed_memory32.address_length); 308 res->data.fixed_memory32.address_length,
309 res->data.fixed_memory32.write_protect);
250 break; 310 break;
251 case ACPI_RESOURCE_TYPE_ADDRESS16: 311 case ACPI_RESOURCE_TYPE_ADDRESS16:
252 case ACPI_RESOURCE_TYPE_ADDRESS32: 312 case ACPI_RESOURCE_TYPE_ADDRESS32:
@@ -304,42 +364,8 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, struct acpi_reso
304 364
305 for(i = 0; i < p->channel_count; i++) 365 for(i = 0; i < p->channel_count; i++)
306 dma->map |= 1 << p->channels[i]; 366 dma->map |= 1 << p->channels[i];
307 dma->flags = 0; 367
308 if (p->bus_master) 368 dma->flags = dma_flags(p->type, p->bus_master, p->transfer);
309 dma->flags |= IORESOURCE_DMA_MASTER;
310 switch (p->type) {
311 case ACPI_COMPATIBILITY:
312 dma->flags |= IORESOURCE_DMA_COMPATIBLE;
313 break;
314 case ACPI_TYPE_A:
315 dma->flags |= IORESOURCE_DMA_TYPEA;
316 break;
317 case ACPI_TYPE_B:
318 dma->flags |= IORESOURCE_DMA_TYPEB;
319 break;
320 case ACPI_TYPE_F:
321 dma->flags |= IORESOURCE_DMA_TYPEF;
322 break;
323 default:
324 /* Set a default value ? */
325 dma->flags |= IORESOURCE_DMA_COMPATIBLE;
326 pnp_err("Invalid DMA type");
327 }
328 switch (p->transfer) {
329 case ACPI_TRANSFER_8:
330 dma->flags |= IORESOURCE_DMA_8BIT;
331 break;
332 case ACPI_TRANSFER_8_16:
333 dma->flags |= IORESOURCE_DMA_8AND16BIT;
334 break;
335 case ACPI_TRANSFER_16:
336 dma->flags |= IORESOURCE_DMA_16BIT;
337 break;
338 default:
339 /* Set a default value ? */
340 dma->flags |= IORESOURCE_DMA_8AND16BIT;
341 pnp_err("Invalid DMA transfer type");
342 }
343 369
344 pnp_register_dma_resource(option, dma); 370 pnp_register_dma_resource(option, dma);
345 return; 371 return;
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index 1926b4d3e1f4..d21e04ccb021 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -24,6 +24,8 @@
24#include <linux/reboot.h> 24#include <linux/reboot.h>
25#include <linux/kernel.h> 25#include <linux/kernel.h>
26#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27
28#include <asm/firmware.h>
27#include <asm/lv1call.h> 29#include <asm/lv1call.h>
28#include <asm/ps3av.h> 30#include <asm/ps3av.h>
29#include <asm/ps3.h> 31#include <asm/ps3.h>
@@ -947,7 +949,12 @@ static struct ps3_vuart_port_driver ps3av_driver = {
947 949
948static int ps3av_module_init(void) 950static int ps3av_module_init(void)
949{ 951{
950 int error = ps3_vuart_port_driver_register(&ps3av_driver); 952 int error;
953
954 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
955 return -ENODEV;
956
957 error = ps3_vuart_port_driver_register(&ps3av_driver);
951 if (error) { 958 if (error) {
952 printk(KERN_ERR 959 printk(KERN_ERR
953 "%s: ps3_vuart_port_driver_register failed %d\n", 960 "%s: ps3_vuart_port_driver_register failed %d\n",
diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c
index 21c97c80aa2e..bc70e81f8cb0 100644
--- a/drivers/ps3/ps3av_cmd.c
+++ b/drivers/ps3/ps3av_cmd.c
@@ -485,12 +485,12 @@ static u8 ps3av_cnv_mclk(u32 fs)
485 485
486static const u32 ps3av_ns_table[][5] = { 486static const u32 ps3av_ns_table[][5] = {
487 /* D1, D2, D3, D4, D5 */ 487 /* D1, D2, D3, D4, D5 */
488 [PS3AV_CMD_AUDIO_FS_44K-BASE] { 6272, 6272, 17836, 17836, 8918 }, 488 [PS3AV_CMD_AUDIO_FS_44K-BASE] = { 6272, 6272, 17836, 17836, 8918 },
489 [PS3AV_CMD_AUDIO_FS_48K-BASE] { 6144, 6144, 11648, 11648, 5824 }, 489 [PS3AV_CMD_AUDIO_FS_48K-BASE] = { 6144, 6144, 11648, 11648, 5824 },
490 [PS3AV_CMD_AUDIO_FS_88K-BASE] { 12544, 12544, 35672, 35672, 17836 }, 490 [PS3AV_CMD_AUDIO_FS_88K-BASE] = { 12544, 12544, 35672, 35672, 17836 },
491 [PS3AV_CMD_AUDIO_FS_96K-BASE] { 12288, 12288, 23296, 23296, 11648 }, 491 [PS3AV_CMD_AUDIO_FS_96K-BASE] = { 12288, 12288, 23296, 23296, 11648 },
492 [PS3AV_CMD_AUDIO_FS_176K-BASE] { 25088, 25088, 71344, 71344, 35672 }, 492 [PS3AV_CMD_AUDIO_FS_176K-BASE] = { 25088, 25088, 71344, 71344, 35672 },
493 [PS3AV_CMD_AUDIO_FS_192K-BASE] { 24576, 24576, 46592, 46592, 23296 } 493 [PS3AV_CMD_AUDIO_FS_192K-BASE] = { 24576, 24576, 46592, 46592, 23296 }
494}; 494};
495 495
496static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) 496static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid)
@@ -543,9 +543,10 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid)
543 543
544#undef BASE 544#undef BASE
545 545
546static u8 ps3av_cnv_enable(u32 source, u8 *enable) 546static u8 ps3av_cnv_enable(u32 source, const u8 *enable)
547{ 547{
548 u8 *p, ret = 0; 548 const u8 *p;
549 u8 ret = 0;
549 550
550 if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { 551 if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) {
551 ret = 0x03; 552 ret = 0x03;
@@ -559,9 +560,10 @@ static u8 ps3av_cnv_enable(u32 source, u8 *enable)
559 return ret; 560 return ret;
560} 561}
561 562
562static u8 ps3av_cnv_fifomap(u8 *map) 563static u8 ps3av_cnv_fifomap(const u8 *map)
563{ 564{
564 u8 *p, ret = 0; 565 const u8 *p;
566 u8 ret = 0;
565 567
566 p = map; 568 p = map;
567 ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); 569 ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6);
@@ -615,7 +617,7 @@ static void ps3av_cnv_info(struct ps3av_audio_info_frame *info,
615 info->pb5.lsv = mode->audio_downmix_level; 617 info->pb5.lsv = mode->audio_downmix_level;
616} 618}
617 619
618static void ps3av_cnv_chstat(u8 *chstat, u8 *cs_info) 620static void ps3av_cnv_chstat(u8 *chstat, const u8 *cs_info)
619{ 621{
620 memcpy(chstat, cs_info, 5); 622 memcpy(chstat, cs_info, 5);
621} 623}
diff --git a/drivers/ps3/sys-manager.c b/drivers/ps3/sys-manager.c
index 0fc30be8b81e..3aa2b0dcc369 100644
--- a/drivers/ps3/sys-manager.c
+++ b/drivers/ps3/sys-manager.c
@@ -22,7 +22,10 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/workqueue.h> 23#include <linux/workqueue.h>
24#include <linux/reboot.h> 24#include <linux/reboot.h>
25
26#include <asm/firmware.h>
25#include <asm/ps3.h> 27#include <asm/ps3.h>
28
26#include "vuart.h" 29#include "vuart.h"
27 30
28MODULE_AUTHOR("Sony Corporation"); 31MODULE_AUTHOR("Sony Corporation");
@@ -598,6 +601,9 @@ static struct ps3_vuart_port_driver ps3_sys_manager = {
598 601
599static int __init ps3_sys_manager_init(void) 602static int __init ps3_sys_manager_init(void)
600{ 603{
604 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
605 return -ENODEV;
606
601 return ps3_vuart_port_driver_register(&ps3_sys_manager); 607 return ps3_vuart_port_driver_register(&ps3_sys_manager);
602} 608}
603 609
diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c
index 746298107d6f..6c12744eeb9d 100644
--- a/drivers/ps3/vuart.c
+++ b/drivers/ps3/vuart.c
@@ -952,7 +952,7 @@ fail_alloc_irq:
952 kfree(dev->priv); 952 kfree(dev->priv);
953 dev->priv = NULL; 953 dev->priv = NULL;
954fail_alloc: 954fail_alloc:
955 vuart_bus_priv.devices[port_number] = 0; 955 vuart_bus_priv.devices[port_number] = NULL;
956fail_match: 956fail_match:
957 up(&vuart_bus_priv.probe_mutex); 957 up(&vuart_bus_priv.probe_mutex);
958 dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__); 958 dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__);
@@ -978,7 +978,7 @@ static int ps3_vuart_remove(struct device *_dev)
978 dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__, 978 dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__,
979 __LINE__, dev->core.bus_id); 979 __LINE__, dev->core.bus_id);
980 980
981 vuart_bus_priv.devices[dev->priv->port_number] = 0; 981 vuart_bus_priv.devices[dev->priv->port_number] = NULL;
982 982
983 if (--vuart_bus_priv.use_count == 0) { 983 if (--vuart_bus_priv.use_count == 0) {
984 BUG(); 984 BUG();
@@ -1031,7 +1031,7 @@ int __init ps3_vuart_bus_init(void)
1031 pr_debug("%s:%d:\n", __func__, __LINE__); 1031 pr_debug("%s:%d:\n", __func__, __LINE__);
1032 1032
1033 if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 1033 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
1034 return 0; 1034 return -ENODEV;
1035 1035
1036 init_MUTEX(&vuart_bus_priv.probe_mutex); 1036 init_MUTEX(&vuart_bus_priv.probe_mutex);
1037 result = bus_register(&ps3_vuart_bus); 1037 result = bus_register(&ps3_vuart_bus);
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index 4b8a95fba1e5..a1dc8c466ec9 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -461,6 +461,7 @@ int dasd_eer_enable(struct dasd_device *device)
461 cqr->device = device; 461 cqr->device = device;
462 cqr->retries = 255; 462 cqr->retries = 255;
463 cqr->expires = 10 * HZ; 463 cqr->expires = 10 * HZ;
464 clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
464 465
465 cqr->cpaddr->cmd_code = DASD_ECKD_CCW_SNSS; 466 cqr->cpaddr->cmd_code = DASD_ECKD_CCW_SNSS;
466 cqr->cpaddr->count = SNSS_DATA_SIZE; 467 cqr->cpaddr->count = SNSS_DATA_SIZE;
diff --git a/drivers/s390/char/tape_std.c b/drivers/s390/char/tape_std.c
index 7a76ec413a3a..2a1af4e60be0 100644
--- a/drivers/s390/char/tape_std.c
+++ b/drivers/s390/char/tape_std.c
@@ -647,7 +647,10 @@ tape_std_mtcompression(struct tape_device *device, int mt_count)
647 return PTR_ERR(request); 647 return PTR_ERR(request);
648 request->op = TO_NOP; 648 request->op = TO_NOP;
649 /* setup ccws */ 649 /* setup ccws */
650 *device->modeset_byte = (mt_count == 0) ? 0x00 : 0x08; 650 if (mt_count == 0)
651 *device->modeset_byte &= ~0x08;
652 else
653 *device->modeset_byte |= 0x08;
651 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); 654 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
652 tape_ccw_end(request->cpaddr + 1, NOP, 0, NULL); 655 tape_ccw_end(request->cpaddr + 1, NOP, 0, NULL);
653 /* execute it */ 656 /* execute it */
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 51238e7555bb..089a3ddd6265 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -144,8 +144,8 @@ ccw_device_cancel_halt_clear(struct ccw_device *cdev)
144 ret = stsch(sch->schid, &sch->schib); 144 ret = stsch(sch->schid, &sch->schib);
145 if (ret || !sch->schib.pmcw.dnv) 145 if (ret || !sch->schib.pmcw.dnv)
146 return -ENODEV; 146 return -ENODEV;
147 if (!sch->schib.pmcw.ena || sch->schib.scsw.actl == 0) 147 if (!sch->schib.pmcw.ena)
148 /* Not operational or no activity -> done. */ 148 /* Not operational -> done. */
149 return 0; 149 return 0;
150 /* Stage 1: cancel io. */ 150 /* Stage 1: cancel io. */
151 if (!(sch->schib.scsw.actl & SCSW_ACTL_HALT_PEND) && 151 if (!(sch->schib.scsw.actl & SCSW_ACTL_HALT_PEND) &&
@@ -334,20 +334,29 @@ ccw_device_oper_notify(struct work_struct *work)
334 struct ccw_device *cdev; 334 struct ccw_device *cdev;
335 struct subchannel *sch; 335 struct subchannel *sch;
336 int ret; 336 int ret;
337 unsigned long flags;
337 338
338 priv = container_of(work, struct ccw_device_private, kick_work); 339 priv = container_of(work, struct ccw_device_private, kick_work);
339 cdev = priv->cdev; 340 cdev = priv->cdev;
341 spin_lock_irqsave(cdev->ccwlock, flags);
340 sch = to_subchannel(cdev->dev.parent); 342 sch = to_subchannel(cdev->dev.parent);
341 ret = (sch->driver && sch->driver->notify) ? 343 if (sch->driver && sch->driver->notify) {
342 sch->driver->notify(&sch->dev, CIO_OPER) : 0; 344 spin_unlock_irqrestore(cdev->ccwlock, flags);
343 if (!ret) 345 ret = sch->driver->notify(&sch->dev, CIO_OPER);
344 /* Driver doesn't want device back. */ 346 spin_lock_irqsave(cdev->ccwlock, flags);
345 ccw_device_do_unreg_rereg(work); 347 } else
346 else { 348 ret = 0;
349 if (ret) {
347 /* Reenable channel measurements, if needed. */ 350 /* Reenable channel measurements, if needed. */
351 spin_unlock_irqrestore(cdev->ccwlock, flags);
348 cmf_reenable(cdev); 352 cmf_reenable(cdev);
353 spin_lock_irqsave(cdev->ccwlock, flags);
349 wake_up(&cdev->private->wait_q); 354 wake_up(&cdev->private->wait_q);
350 } 355 }
356 spin_unlock_irqrestore(cdev->ccwlock, flags);
357 if (!ret)
358 /* Driver doesn't want device back. */
359 ccw_device_do_unreg_rereg(work);
351} 360}
352 361
353/* 362/*
@@ -534,15 +543,21 @@ ccw_device_nopath_notify(struct work_struct *work)
534 struct ccw_device *cdev; 543 struct ccw_device *cdev;
535 struct subchannel *sch; 544 struct subchannel *sch;
536 int ret; 545 int ret;
546 unsigned long flags;
537 547
538 priv = container_of(work, struct ccw_device_private, kick_work); 548 priv = container_of(work, struct ccw_device_private, kick_work);
539 cdev = priv->cdev; 549 cdev = priv->cdev;
550 spin_lock_irqsave(cdev->ccwlock, flags);
540 sch = to_subchannel(cdev->dev.parent); 551 sch = to_subchannel(cdev->dev.parent);
541 /* Extra sanity. */ 552 /* Extra sanity. */
542 if (sch->lpm) 553 if (sch->lpm)
543 return; 554 goto out_unlock;
544 ret = (sch->driver && sch->driver->notify) ? 555 if (sch->driver && sch->driver->notify) {
545 sch->driver->notify(&sch->dev, CIO_NO_PATH) : 0; 556 spin_unlock_irqrestore(cdev->ccwlock, flags);
557 ret = sch->driver->notify(&sch->dev, CIO_NO_PATH);
558 spin_lock_irqsave(cdev->ccwlock, flags);
559 } else
560 ret = 0;
546 if (!ret) { 561 if (!ret) {
547 if (get_device(&sch->dev)) { 562 if (get_device(&sch->dev)) {
548 /* Driver doesn't want to keep device. */ 563 /* Driver doesn't want to keep device. */
@@ -562,6 +577,8 @@ ccw_device_nopath_notify(struct work_struct *work)
562 cdev->private->state = DEV_STATE_DISCONNECTED; 577 cdev->private->state = DEV_STATE_DISCONNECTED;
563 wake_up(&cdev->private->wait_q); 578 wake_up(&cdev->private->wait_q);
564 } 579 }
580out_unlock:
581 spin_unlock_irqrestore(cdev->ccwlock, flags);
565} 582}
566 583
567void 584void
@@ -607,10 +624,13 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
607 default: 624 default:
608 /* Reset oper notify indication after verify error. */ 625 /* Reset oper notify indication after verify error. */
609 cdev->private->flags.donotify = 0; 626 cdev->private->flags.donotify = 0;
610 PREPARE_WORK(&cdev->private->kick_work, 627 if (cdev->online) {
611 ccw_device_nopath_notify); 628 PREPARE_WORK(&cdev->private->kick_work,
612 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 629 ccw_device_nopath_notify);
613 ccw_device_done(cdev, DEV_STATE_NOT_OPER); 630 queue_work(ccw_device_notify_work,
631 &cdev->private->kick_work);
632 } else
633 ccw_device_done(cdev, DEV_STATE_NOT_OPER);
614 break; 634 break;
615 } 635 }
616} 636}
@@ -756,15 +776,22 @@ static void
756ccw_device_online_notoper(struct ccw_device *cdev, enum dev_event dev_event) 776ccw_device_online_notoper(struct ccw_device *cdev, enum dev_event dev_event)
757{ 777{
758 struct subchannel *sch; 778 struct subchannel *sch;
779 int ret;
759 780
760 sch = to_subchannel(cdev->dev.parent); 781 sch = to_subchannel(cdev->dev.parent);
761 if (sch->driver->notify && 782 if (sch->driver->notify) {
762 sch->driver->notify(&sch->dev, sch->lpm ? CIO_GONE : CIO_NO_PATH)) { 783 spin_unlock_irq(cdev->ccwlock);
763 ccw_device_set_timeout(cdev, 0); 784 ret = sch->driver->notify(&sch->dev,
764 cdev->private->flags.fake_irb = 0; 785 sch->lpm ? CIO_GONE : CIO_NO_PATH);
765 cdev->private->state = DEV_STATE_DISCONNECTED; 786 spin_lock_irq(cdev->ccwlock);
766 wake_up(&cdev->private->wait_q); 787 } else
767 return; 788 ret = 0;
789 if (ret) {
790 ccw_device_set_timeout(cdev, 0);
791 cdev->private->flags.fake_irb = 0;
792 cdev->private->state = DEV_STATE_DISCONNECTED;
793 wake_up(&cdev->private->wait_q);
794 return;
768 } 795 }
769 cdev->private->state = DEV_STATE_NOT_OPER; 796 cdev->private->state = DEV_STATE_NOT_OPER;
770 cio_disable_subchannel(sch); 797 cio_disable_subchannel(sch);
@@ -969,18 +996,12 @@ ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event)
969 996
970 sch = to_subchannel(cdev->dev.parent); 997 sch = to_subchannel(cdev->dev.parent);
971 ccw_device_set_timeout(cdev, 0); 998 ccw_device_set_timeout(cdev, 0);
999 /* Start delayed path verification. */
1000 ccw_device_online_verify(cdev, 0);
972 /* OK, i/o is dead now. Call interrupt handler. */ 1001 /* OK, i/o is dead now. Call interrupt handler. */
973 cdev->private->state = DEV_STATE_ONLINE;
974 if (cdev->handler) 1002 if (cdev->handler)
975 cdev->handler(cdev, cdev->private->intparm, 1003 cdev->handler(cdev, cdev->private->intparm,
976 ERR_PTR(-EIO)); 1004 ERR_PTR(-EIO));
977 if (!sch->lpm) {
978 PREPARE_WORK(&cdev->private->kick_work,
979 ccw_device_nopath_notify);
980 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
981 } else if (cdev->private->flags.doverify)
982 /* Start delayed path verification. */
983 ccw_device_online_verify(cdev, 0);
984} 1005}
985 1006
986static void 1007static void
@@ -993,21 +1014,8 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event)
993 ccw_device_set_timeout(cdev, 3*HZ); 1014 ccw_device_set_timeout(cdev, 3*HZ);
994 return; 1015 return;
995 } 1016 }
996 if (ret == -ENODEV) { 1017 /* Start delayed path verification. */
997 struct subchannel *sch; 1018 ccw_device_online_verify(cdev, 0);
998
999 sch = to_subchannel(cdev->dev.parent);
1000 if (!sch->lpm) {
1001 PREPARE_WORK(&cdev->private->kick_work,
1002 ccw_device_nopath_notify);
1003 queue_work(ccw_device_notify_work,
1004 &cdev->private->kick_work);
1005 } else
1006 dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
1007 return;
1008 }
1009 //FIXME: Can we get here?
1010 cdev->private->state = DEV_STATE_ONLINE;
1011 if (cdev->handler) 1019 if (cdev->handler)
1012 cdev->handler(cdev, cdev->private->intparm, 1020 cdev->handler(cdev, cdev->private->intparm,
1013 ERR_PTR(-EIO)); 1021 ERR_PTR(-EIO));
@@ -1025,26 +1033,11 @@ void device_kill_io(struct subchannel *sch)
1025 cdev->private->state = DEV_STATE_TIMEOUT_KILL; 1033 cdev->private->state = DEV_STATE_TIMEOUT_KILL;
1026 return; 1034 return;
1027 } 1035 }
1028 if (ret == -ENODEV) { 1036 /* Start delayed path verification. */
1029 if (!sch->lpm) { 1037 ccw_device_online_verify(cdev, 0);
1030 PREPARE_WORK(&cdev->private->kick_work,
1031 ccw_device_nopath_notify);
1032 queue_work(ccw_device_notify_work,
1033 &cdev->private->kick_work);
1034 } else
1035 dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
1036 return;
1037 }
1038 if (cdev->handler) 1038 if (cdev->handler)
1039 cdev->handler(cdev, cdev->private->intparm, 1039 cdev->handler(cdev, cdev->private->intparm,
1040 ERR_PTR(-EIO)); 1040 ERR_PTR(-EIO));
1041 if (!sch->lpm) {
1042 PREPARE_WORK(&cdev->private->kick_work,
1043 ccw_device_nopath_notify);
1044 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
1045 } else
1046 /* Start delayed path verification. */
1047 ccw_device_online_verify(cdev, 0);
1048} 1041}
1049 1042
1050static void 1043static void
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index e95c281f1e36..84b108d7c7fd 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -873,7 +873,7 @@ qeth_realloc_headroom(struct qeth_card *card, struct sk_buff *skb, int size)
873} 873}
874 874
875static inline struct sk_buff * 875static inline struct sk_buff *
876qeth_pskb_unshare(struct sk_buff *skb, int pri) 876qeth_pskb_unshare(struct sk_buff *skb, gfp_t pri)
877{ 877{
878 struct sk_buff *nskb; 878 struct sk_buff *nskb;
879 if (!skb_cloned(skb)) 879 if (!skb_cloned(skb))
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index 08430961a895..99af084c7cec 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -425,15 +425,13 @@ irqreturn_t mcfrs_interrupt(int irq, void *dev_id)
425 * ------------------------------------------------------------------- 425 * -------------------------------------------------------------------
426 */ 426 */
427 427
428static void mcfrs_offintr(void *private) 428static void mcfrs_offintr(struct work_struct *work)
429{ 429{
430 struct mcf_serial *info = (struct mcf_serial *) private; 430 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue);
431 struct tty_struct *tty; 431 struct tty_struct *tty = info->tty;
432 432
433 tty = info->tty; 433 if (tty)
434 if (!tty) 434 tty_wakeup(tty);
435 return;
436 tty_wakeup(tty);
437} 435}
438 436
439 437
@@ -497,16 +495,13 @@ static void mcfrs_timer(void)
497 * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup() 495 * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup()
498 * 496 *
499 */ 497 */
500static void do_serial_hangup(void *private) 498static void do_serial_hangup(struct work_struct *work)
501{ 499{
502 struct mcf_serial *info = (struct mcf_serial *) private; 500 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup);
503 struct tty_struct *tty; 501 struct tty_struct *tty = info->tty;
504 502
505 tty = info->tty; 503 if (tty)
506 if (!tty) 504 tty_hangup(tty);
507 return;
508
509 tty_hangup(tty);
510} 505}
511 506
512static int startup(struct mcf_serial * info) 507static int startup(struct mcf_serial * info)
@@ -857,7 +852,7 @@ static void mcfrs_throttle(struct tty_struct * tty)
857#ifdef SERIAL_DEBUG_THROTTLE 852#ifdef SERIAL_DEBUG_THROTTLE
858 char buf[64]; 853 char buf[64];
859 854
860 printk("throttle %s: %d....\n", _tty_name(tty, buf), 855 printk("throttle %s: %d....\n", tty_name(tty, buf),
861 tty->ldisc.chars_in_buffer(tty)); 856 tty->ldisc.chars_in_buffer(tty));
862#endif 857#endif
863 858
@@ -876,7 +871,7 @@ static void mcfrs_unthrottle(struct tty_struct * tty)
876#ifdef SERIAL_DEBUG_THROTTLE 871#ifdef SERIAL_DEBUG_THROTTLE
877 char buf[64]; 872 char buf[64];
878 873
879 printk("unthrottle %s: %d....\n", _tty_name(tty, buf), 874 printk("unthrottle %s: %d....\n", tty_name(tty, buf),
880 tty->ldisc.chars_in_buffer(tty)); 875 tty->ldisc.chars_in_buffer(tty));
881#endif 876#endif
882 877
@@ -1541,8 +1536,8 @@ static void mcfrs_irqinit(struct mcf_serial *info)
1541 * External Pin Mask Setting & Enable External Pin for Interface 1536 * External Pin Mask Setting & Enable External Pin for Interface
1542 * mrcbis@aliceposta.it 1537 * mrcbis@aliceposta.it
1543 */ 1538 */
1544 unsigned short *serpin_enable_mask; 1539 u16 *serpin_enable_mask;
1545 serpin_enable_mask = (MCF_IPSBAR + MCF_GPIO_PAR_UART); 1540 serpin_enable_mask = (u16 *) (MCF_IPSBAR + MCF_GPIO_PAR_UART);
1546 if (info->line == 0) 1541 if (info->line == 0)
1547 *serpin_enable_mask |= UART0_ENABLE_MASK; 1542 *serpin_enable_mask |= UART0_ENABLE_MASK;
1548 else if (info->line == 1) 1543 else if (info->line == 1)
@@ -1551,6 +1546,13 @@ static void mcfrs_irqinit(struct mcf_serial *info)
1551 *serpin_enable_mask |= UART2_ENABLE_MASK; 1546 *serpin_enable_mask |= UART2_ENABLE_MASK;
1552 } 1547 }
1553#endif 1548#endif
1549#if defined(CONFIG_M528x)
1550 /* make sure PUAPAR is set for UART0 and UART1 */
1551 if (info->line < 2) {
1552 volatile unsigned char *portp = (volatile unsigned char *) (MCF_MBAR + MCF5282_GPIO_PUAPAR);
1553 *portp |= (0x03 << (info->line * 2));
1554 }
1555#endif
1554#elif defined(CONFIG_M520x) 1556#elif defined(CONFIG_M520x)
1555 volatile unsigned char *icrp, *uartp; 1557 volatile unsigned char *icrp, *uartp;
1556 volatile unsigned long *imrp; 1558 volatile unsigned long *imrp;
@@ -1783,8 +1785,8 @@ mcfrs_init(void)
1783 info->event = 0; 1785 info->event = 0;
1784 info->count = 0; 1786 info->count = 0;
1785 info->blocked_open = 0; 1787 info->blocked_open = 0;
1786 INIT_WORK(&info->tqueue, mcfrs_offintr, info); 1788 INIT_WORK(&info->tqueue, mcfrs_offintr);
1787 INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); 1789 INIT_WORK(&info->tqueue_hangup, do_serial_hangup);
1788 init_waitqueue_head(&info->open_wait); 1790 init_waitqueue_head(&info->open_wait);
1789 init_waitqueue_head(&info->close_wait); 1791 init_waitqueue_head(&info->close_wait);
1790 1792
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c
index 253ceb895ca7..a27e9e92cb5e 100644
--- a/drivers/serial/sn_console.c
+++ b/drivers/serial/sn_console.c
@@ -636,25 +636,6 @@ static irqreturn_t sn_sal_interrupt(int irq, void *dev_id)
636} 636}
637 637
638/** 638/**
639 * sn_sal_connect_interrupt - Request interrupt, handled by sn_sal_interrupt
640 * @port: Our sn_cons_port (which contains the uart port)
641 *
642 * returns the console irq if interrupt is successfully registered, else 0
643 *
644 */
645static int sn_sal_connect_interrupt(struct sn_cons_port *port)
646{
647 if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt,
648 IRQF_DISABLED | IRQF_SHARED,
649 "SAL console driver", port) >= 0) {
650 return SGI_UART_VECTOR;
651 }
652
653 printk(KERN_INFO "sn_console: console proceeding in polled mode\n");
654 return 0;
655}
656
657/**
658 * sn_sal_timer_poll - this function handles polled console mode 639 * sn_sal_timer_poll - this function handles polled console mode
659 * @data: A pointer to our sn_cons_port (which contains the uart port) 640 * @data: A pointer to our sn_cons_port (which contains the uart port)
660 * 641 *
@@ -746,30 +727,31 @@ static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port)
746 * mode. We were previously in asynch/polling mode (using init_timer). 727 * mode. We were previously in asynch/polling mode (using init_timer).
747 * 728 *
748 * We attempt to switch to interrupt mode here by calling 729 * We attempt to switch to interrupt mode here by calling
749 * sn_sal_connect_interrupt. If that works out, we enable receive interrupts. 730 * request_irq. If that works out, we enable receive interrupts.
750 */ 731 */
751static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) 732static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port)
752{ 733{
753 int irq;
754 unsigned long flags; 734 unsigned long flags;
755 735
756 if (!port) 736 if (port) {
757 return; 737 DPRINTF("sn_console: switching to interrupt driven console\n");
758
759 DPRINTF("sn_console: switching to interrupt driven console\n");
760
761 spin_lock_irqsave(&port->sc_port.lock, flags);
762 738
763 irq = sn_sal_connect_interrupt(port); 739 if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt,
740 IRQF_DISABLED | IRQF_SHARED,
741 "SAL console driver", port) >= 0) {
742 spin_lock_irqsave(&port->sc_port.lock, flags);
743 port->sc_port.irq = SGI_UART_VECTOR;
744 port->sc_ops = &intr_ops;
764 745
765 if (irq) { 746 /* turn on receive interrupts */
766 port->sc_port.irq = irq; 747 ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV);
767 port->sc_ops = &intr_ops; 748 spin_unlock_irqrestore(&port->sc_port.lock, flags);
768 749 }
769 /* turn on receive interrupts */ 750 else {
770 ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); 751 printk(KERN_INFO
752 "sn_console: console proceeding in polled mode\n");
753 }
771 } 754 }
772 spin_unlock_irqrestore(&port->sc_port.lock, flags);
773} 755}
774 756
775/* 757/*
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index d38a25f36ea5..31ae661e586a 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -332,9 +332,9 @@ static void acm_rx_tasklet(unsigned long _acm)
332 if (!ACM_READY(acm)) 332 if (!ACM_READY(acm))
333 return; 333 return;
334 334
335 spin_lock(&acm->throttle_lock); 335 spin_lock_irqsave(&acm->throttle_lock, flags);
336 throttled = acm->throttle; 336 throttled = acm->throttle;
337 spin_unlock(&acm->throttle_lock); 337 spin_unlock_irqrestore(&acm->throttle_lock, flags);
338 if (throttled) 338 if (throttled)
339 return; 339 return;
340 340
@@ -352,9 +352,9 @@ next_buffer:
352 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size); 352 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
353 353
354 tty_buffer_request_room(tty, buf->size); 354 tty_buffer_request_room(tty, buf->size);
355 spin_lock(&acm->throttle_lock); 355 spin_lock_irqsave(&acm->throttle_lock, flags);
356 throttled = acm->throttle; 356 throttled = acm->throttle;
357 spin_unlock(&acm->throttle_lock); 357 spin_unlock_irqrestore(&acm->throttle_lock, flags);
358 if (!throttled) 358 if (!throttled)
359 tty_insert_flip_string(tty, buf->base, buf->size); 359 tty_insert_flip_string(tty, buf->base, buf->size);
360 tty_flip_buffer_push(tty); 360 tty_flip_buffer_push(tty);
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 274f14f1633e..36e7a843bf91 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -912,7 +912,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
912 struct async *as; 912 struct async *as;
913 struct usb_ctrlrequest *dr = NULL; 913 struct usb_ctrlrequest *dr = NULL;
914 unsigned int u, totlen, isofrmlen; 914 unsigned int u, totlen, isofrmlen;
915 int ret, interval = 0, ifnum = -1; 915 int ret, ifnum = -1;
916 916
917 if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP|USBDEVFS_URB_SHORT_NOT_OK| 917 if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP|USBDEVFS_URB_SHORT_NOT_OK|
918 URB_NO_FSBR|URB_ZERO_PACKET)) 918 URB_NO_FSBR|URB_ZERO_PACKET))
@@ -992,7 +992,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
992 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) 992 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
993 != USB_ENDPOINT_XFER_ISOC) 993 != USB_ENDPOINT_XFER_ISOC)
994 return -EINVAL; 994 return -EINVAL;
995 interval = 1 << min (15, ep->desc.bInterval - 1);
996 isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) * uurb->number_of_packets; 995 isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) * uurb->number_of_packets;
997 if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL))) 996 if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL)))
998 return -ENOMEM; 997 return -ENOMEM;
@@ -1021,10 +1020,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1021 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) 1020 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
1022 != USB_ENDPOINT_XFER_INT) 1021 != USB_ENDPOINT_XFER_INT)
1023 return -EINVAL; 1022 return -EINVAL;
1024 if (ps->dev->speed == USB_SPEED_HIGH)
1025 interval = 1 << min (15, ep->desc.bInterval - 1);
1026 else
1027 interval = ep->desc.bInterval;
1028 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) 1023 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1029 return -EINVAL; 1024 return -EINVAL;
1030 if (!access_ok((uurb->endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb->buffer, uurb->buffer_length)) 1025 if (!access_ok((uurb->endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb->buffer, uurb->buffer_length))
@@ -1053,7 +1048,11 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1053 as->urb->setup_packet = (unsigned char*)dr; 1048 as->urb->setup_packet = (unsigned char*)dr;
1054 as->urb->start_frame = uurb->start_frame; 1049 as->urb->start_frame = uurb->start_frame;
1055 as->urb->number_of_packets = uurb->number_of_packets; 1050 as->urb->number_of_packets = uurb->number_of_packets;
1056 as->urb->interval = interval; 1051 if (uurb->type == USBDEVFS_URB_TYPE_ISO ||
1052 ps->dev->speed == USB_SPEED_HIGH)
1053 as->urb->interval = 1 << min(15, ep->desc.bInterval - 1);
1054 else
1055 as->urb->interval = ep->desc.bInterval;
1057 as->urb->context = as; 1056 as->urb->context = as;
1058 as->urb->complete = async_completed; 1057 as->urb->complete = async_completed;
1059 for (totlen = u = 0; u < uurb->number_of_packets; u++) { 1058 for (totlen = u = 0; u < uurb->number_of_packets; u++) {
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 41400743ce2c..b89a98e61323 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1281,12 +1281,6 @@ int usb_new_device(struct usb_device *udev)
1281{ 1281{
1282 int err; 1282 int err;
1283 1283
1284 /* Lock ourself into memory in order to keep a probe sequence
1285 * sleeping in a new thread from allowing us to be unloaded.
1286 */
1287 if (!try_module_get(THIS_MODULE))
1288 return -EINVAL;
1289
1290 /* Determine quirks */ 1284 /* Determine quirks */
1291 usb_detect_quirks(udev); 1285 usb_detect_quirks(udev);
1292 1286
@@ -1390,7 +1384,6 @@ int usb_new_device(struct usb_device *udev)
1390 usb_autoresume_device(udev->parent); 1384 usb_autoresume_device(udev->parent);
1391 1385
1392exit: 1386exit:
1393 module_put(THIS_MODULE);
1394 return err; 1387 return err;
1395 1388
1396fail: 1389fail:
@@ -2443,7 +2436,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
2443 2436
2444 if (portchange & USB_PORT_STAT_C_CONNECTION) { 2437 if (portchange & USB_PORT_STAT_C_CONNECTION) {
2445 status = hub_port_debounce(hub, port1); 2438 status = hub_port_debounce(hub, port1);
2446 if (status < 0) { 2439 if (status < 0 && printk_ratelimit()) {
2447 dev_err (hub_dev, 2440 dev_err (hub_dev,
2448 "connect-debounce failed, port %d disabled\n", 2441 "connect-debounce failed, port %d disabled\n",
2449 port1); 2442 port1);
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 2f17468b5c1e..217a3d6d0a06 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -221,10 +221,15 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
221 221
222 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == 222 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
223 USB_ENDPOINT_XFER_INT) { 223 USB_ENDPOINT_XFER_INT) {
224 int interval;
225
226 if (usb_dev->speed == USB_SPEED_HIGH)
227 interval = 1 << min(15, ep->desc.bInterval - 1);
228 else
229 interval = ep->desc.bInterval;
224 pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); 230 pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30);
225 usb_fill_int_urb(urb, usb_dev, pipe, data, len, 231 usb_fill_int_urb(urb, usb_dev, pipe, data, len,
226 usb_api_blocking_completion, NULL, 232 usb_api_blocking_completion, NULL, interval);
227 ep->desc.bInterval);
228 } else 233 } else
229 usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, 234 usb_fill_bulk_urb(urb, usb_dev, pipe, data, len,
230 usb_api_blocking_completion, NULL); 235 usb_api_blocking_completion, NULL);
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index a4677802fb20..2a6e3163d944 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1835,7 +1835,7 @@ static int at91udc_resume(struct platform_device *pdev)
1835#define at91udc_resume NULL 1835#define at91udc_resume NULL
1836#endif 1836#endif
1837 1837
1838static struct platform_driver at91_udc = { 1838static struct platform_driver at91_udc_driver = {
1839 .remove = __exit_p(at91udc_remove), 1839 .remove = __exit_p(at91udc_remove),
1840 .shutdown = at91udc_shutdown, 1840 .shutdown = at91udc_shutdown,
1841 .suspend = at91udc_suspend, 1841 .suspend = at91udc_suspend,
@@ -1848,13 +1848,13 @@ static struct platform_driver at91_udc = {
1848 1848
1849static int __init udc_init_module(void) 1849static int __init udc_init_module(void)
1850{ 1850{
1851 return platform_driver_probe(&at91_udc, at91udc_probe); 1851 return platform_driver_probe(&at91_udc_driver, at91udc_probe);
1852} 1852}
1853module_init(udc_init_module); 1853module_init(udc_init_module);
1854 1854
1855static void __exit udc_exit_module(void) 1855static void __exit udc_exit_module(void)
1856{ 1856{
1857 platform_driver_unregister(&at91_udc); 1857 platform_driver_unregister(&at91_udc_driver);
1858} 1858}
1859module_exit(udc_exit_module); 1859module_exit(udc_exit_module);
1860 1860
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index 7b3a326b57ab..65c91d3735de 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -297,27 +297,6 @@ goku_free_request(struct usb_ep *_ep, struct usb_request *_req)
297 297
298/*-------------------------------------------------------------------------*/ 298/*-------------------------------------------------------------------------*/
299 299
300#undef USE_KMALLOC
301
302/* many common platforms have dma-coherent caches, which means that it's
303 * safe to use kmalloc() memory for all i/o buffers without using any
304 * cache flushing calls. (unless you're trying to share cache lines
305 * between dma and non-dma activities, which is a slow idea in any case.)
306 *
307 * other platforms need more care, with 2.6 having a moderately general
308 * solution except for the common "buffer is smaller than a page" case.
309 */
310#if defined(CONFIG_X86)
311#define USE_KMALLOC
312
313#elif defined(CONFIG_MIPS) && !defined(CONFIG_DMA_NONCOHERENT)
314#define USE_KMALLOC
315
316#elif defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE)
317#define USE_KMALLOC
318
319#endif
320
321/* allocating buffers this way eliminates dma mapping overhead, which 300/* allocating buffers this way eliminates dma mapping overhead, which
322 * on some platforms will mean eliminating a per-io buffer copy. with 301 * on some platforms will mean eliminating a per-io buffer copy. with
323 * some kinds of system caches, further tweaks may still be needed. 302 * some kinds of system caches, further tweaks may still be needed.
@@ -334,11 +313,6 @@ goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
334 return NULL; 313 return NULL;
335 *dma = DMA_ADDR_INVALID; 314 *dma = DMA_ADDR_INVALID;
336 315
337#if defined(USE_KMALLOC)
338 retval = kmalloc(bytes, gfp_flags);
339 if (retval)
340 *dma = virt_to_phys(retval);
341#else
342 if (ep->dma) { 316 if (ep->dma) {
343 /* the main problem with this call is that it wastes memory 317 /* the main problem with this call is that it wastes memory
344 * on typical 1/N page allocations: it allocates 1-N pages. 318 * on typical 1/N page allocations: it allocates 1-N pages.
@@ -348,7 +322,6 @@ goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
348 bytes, dma, gfp_flags); 322 bytes, dma, gfp_flags);
349 } else 323 } else
350 retval = kmalloc(bytes, gfp_flags); 324 retval = kmalloc(bytes, gfp_flags);
351#endif
352 return retval; 325 return retval;
353} 326}
354 327
@@ -356,7 +329,6 @@ static void
356goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes) 329goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes)
357{ 330{
358 /* free memory into the right allocator */ 331 /* free memory into the right allocator */
359#ifndef USE_KMALLOC
360 if (dma != DMA_ADDR_INVALID) { 332 if (dma != DMA_ADDR_INVALID) {
361 struct goku_ep *ep; 333 struct goku_ep *ep;
362 334
@@ -365,7 +337,6 @@ goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes)
365 return; 337 return;
366 dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma); 338 dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma);
367 } else 339 } else
368#endif
369 kfree (buf); 340 kfree (buf);
370} 341}
371 342
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 9af529d22b3e..1813b7cac294 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -653,8 +653,7 @@ static int ehci_hub_control (
653 if (status & ~0xffff) /* only if wPortChange is interesting */ 653 if (status & ~0xffff) /* only if wPortChange is interesting */
654#endif 654#endif
655 dbg_port (ehci, "GetStatus", wIndex + 1, temp); 655 dbg_port (ehci, "GetStatus", wIndex + 1, temp);
656 // we "know" this alignment is good, caller used kmalloc()... 656 put_unaligned(cpu_to_le32 (status), (__le32 *) buf);
657 *((__le32 *) buf) = cpu_to_le32 (status);
658 break; 657 break;
659 case SetHubFeature: 658 case SetHubFeature:
660 switch (wValue) { 659 switch (wValue) {
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
index bacc25c53ba3..8e4427aebb14 100644
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -33,6 +33,9 @@ static __u8 root_hub_hub_des[] =
33/* status change bits: nonzero writes will clear */ 33/* status change bits: nonzero writes will clear */
34#define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC) 34#define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC)
35 35
36/* suspend/resume bits: port suspended or port resuming */
37#define SUSPEND_BITS (USBPORTSC_SUSP | USBPORTSC_RD)
38
36/* A port that either is connected or has a changed-bit set will prevent 39/* A port that either is connected or has a changed-bit set will prevent
37 * us from AUTO_STOPPING. 40 * us from AUTO_STOPPING.
38 */ 41 */
@@ -96,8 +99,8 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
96 int status; 99 int status;
97 int i; 100 int i;
98 101
99 if (inw(port_addr) & (USBPORTSC_SUSP | USBPORTSC_RD)) { 102 if (inw(port_addr) & SUSPEND_BITS) {
100 CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD); 103 CLR_RH_PORTSTAT(SUSPEND_BITS);
101 if (test_bit(port, &uhci->resuming_ports)) 104 if (test_bit(port, &uhci->resuming_ports))
102 set_bit(port, &uhci->port_c_suspend); 105 set_bit(port, &uhci->port_c_suspend);
103 106
@@ -107,7 +110,7 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
107 * Experiments show that some controllers take longer, so 110 * Experiments show that some controllers take longer, so
108 * we'll poll for completion. */ 111 * we'll poll for completion. */
109 for (i = 0; i < 10; ++i) { 112 for (i = 0; i < 10; ++i) {
110 if (!(inw(port_addr) & USBPORTSC_RD)) 113 if (!(inw(port_addr) & SUSPEND_BITS))
111 break; 114 break;
112 udelay(1); 115 udelay(1);
113 } 116 }
@@ -289,7 +292,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
289 wPortStatus |= USB_PORT_STAT_CONNECTION; 292 wPortStatus |= USB_PORT_STAT_CONNECTION;
290 if (status & USBPORTSC_PE) { 293 if (status & USBPORTSC_PE) {
291 wPortStatus |= USB_PORT_STAT_ENABLE; 294 wPortStatus |= USB_PORT_STAT_ENABLE;
292 if (status & (USBPORTSC_SUSP | USBPORTSC_RD)) 295 if (status & SUSPEND_BITS)
293 wPortStatus |= USB_PORT_STAT_SUSPEND; 296 wPortStatus |= USB_PORT_STAT_SUSPEND;
294 } 297 }
295 if (status & USBPORTSC_OC) 298 if (status & USBPORTSC_OC)
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 12ec8b432953..827a75a186ba 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -686,10 +686,8 @@ void usbhid_init_reports(struct hid_device *hid)
686#define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802 686#define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802
687 687
688#define USB_VENDOR_ID_CODEMERCS 0x07c0 688#define USB_VENDOR_ID_CODEMERCS 0x07c0
689#define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500 689#define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500
690#define USB_DEVICE_ID_CODEMERCS_IOW24 0x1501 690#define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff
691#define USB_DEVICE_ID_CODEMERCS_IOW48 0x1502
692#define USB_DEVICE_ID_CODEMERCS_IOW28 0x1503
693 691
694#define USB_VENDOR_ID_DELORME 0x1163 692#define USB_VENDOR_ID_DELORME 0x1163
695#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 693#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
@@ -789,10 +787,6 @@ static const struct hid_blacklist {
789 { USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE }, 787 { USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE },
790 { USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE }, 788 { USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE },
791 { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE }, 789 { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
792 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW40, HID_QUIRK_IGNORE },
793 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW24, HID_QUIRK_IGNORE },
794 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW48, HID_QUIRK_IGNORE },
795 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW28, HID_QUIRK_IGNORE },
796 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE }, 790 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE },
797 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_ULTRAMOUSE, HID_QUIRK_IGNORE }, 791 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_ULTRAMOUSE, HID_QUIRK_IGNORE },
798 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE }, 792 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE },
@@ -1070,9 +1064,14 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1070 int n, len, insize = 0; 1064 int n, len, insize = 0;
1071 struct usbhid_device *usbhid; 1065 struct usbhid_device *usbhid;
1072 1066
1073 /* Ignore all Wacom devices */ 1067 /* Ignore all Wacom devices */
1074 if (le16_to_cpu(dev->descriptor.idVendor) == USB_VENDOR_ID_WACOM) 1068 if (le16_to_cpu(dev->descriptor.idVendor) == USB_VENDOR_ID_WACOM)
1075 return NULL; 1069 return NULL;
1070 /* ignore all Code Mercenaries IOWarrior devices */
1071 if (le16_to_cpu(dev->descriptor.idVendor) == USB_VENDOR_ID_CODEMERCS)
1072 if (le16_to_cpu(dev->descriptor.idProduct) >= USB_DEVICE_ID_CODEMERCS_IOW_FIRST &&
1073 le16_to_cpu(dev->descriptor.idProduct) <= USB_DEVICE_ID_CODEMERCS_IOW_LAST)
1074 return NULL;
1076 1075
1077 for (n = 0; hid_blacklist[n].idVendor; n++) 1076 for (n = 0; hid_blacklist[n].idVendor; n++)
1078 if ((hid_blacklist[n].idVendor == le16_to_cpu(dev->descriptor.idVendor)) && 1077 if ((hid_blacklist[n].idVendor == le16_to_cpu(dev->descriptor.idVendor)) &&
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 0c1d66ddb812..bc3327e3dd78 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -2905,17 +2905,31 @@ static int __init ftdi_elan_init(void)
2905{ 2905{
2906 int result; 2906 int result;
2907 printk(KERN_INFO "driver %s built at %s on %s\n", ftdi_elan_driver.name, 2907 printk(KERN_INFO "driver %s built at %s on %s\n", ftdi_elan_driver.name,
2908 __TIME__, __DATE__); 2908 __TIME__, __DATE__);
2909 init_MUTEX(&ftdi_module_lock); 2909 init_MUTEX(&ftdi_module_lock);
2910 INIT_LIST_HEAD(&ftdi_static_list); 2910 INIT_LIST_HEAD(&ftdi_static_list);
2911 status_queue = create_singlethread_workqueue("ftdi-status-control"); 2911 status_queue = create_singlethread_workqueue("ftdi-status-control");
2912 if (!status_queue)
2913 goto err1;
2912 command_queue = create_singlethread_workqueue("ftdi-command-engine"); 2914 command_queue = create_singlethread_workqueue("ftdi-command-engine");
2915 if (!command_queue)
2916 goto err2;
2913 respond_queue = create_singlethread_workqueue("ftdi-respond-engine"); 2917 respond_queue = create_singlethread_workqueue("ftdi-respond-engine");
2918 if (!respond_queue)
2919 goto err3;
2914 result = usb_register(&ftdi_elan_driver); 2920 result = usb_register(&ftdi_elan_driver);
2915 if (result) 2921 if (result)
2916 printk(KERN_ERR "usb_register failed. Error number %d\n", 2922 printk(KERN_ERR "usb_register failed. Error number %d\n",
2917 result); 2923 result);
2918 return result; 2924 return result;
2925
2926 err3:
2927 destroy_workqueue(command_queue);
2928 err2:
2929 destroy_workqueue(status_queue);
2930 err1:
2931 printk(KERN_ERR "%s couldn't create workqueue\n", ftdi_elan_driver.name);
2932 return -ENOMEM;
2919} 2933}
2920 2934
2921static void __exit ftdi_elan_exit(void) 2935static void __exit ftdi_elan_exit(void)
diff --git a/drivers/usb/net/dm9601.c b/drivers/usb/net/dm9601.c
index 4a932e1cd93b..c0bc52be5e10 100644
--- a/drivers/usb/net/dm9601.c
+++ b/drivers/usb/net/dm9601.c
@@ -571,6 +571,10 @@ static const struct driver_info dm9601_info = {
571 571
572static const struct usb_device_id products[] = { 572static const struct usb_device_id products[] = {
573 { 573 {
574 USB_DEVICE(0x07aa, 0x9601), /* Corega FEther USB-TXC */
575 .driver_info = (unsigned long)&dm9601_info,
576 },
577 {
574 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */ 578 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */
575 .driver_info = (unsigned long)&dm9601_info, 579 .driver_info = (unsigned long)&dm9601_info,
576 }, 580 },
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index 18816bf96a4d..310a8b5f5906 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -44,8 +44,43 @@ struct airprime_private {
44 int outstanding_urbs; 44 int outstanding_urbs;
45 int throttled; 45 int throttled;
46 struct urb *read_urbp[NUM_READ_URBS]; 46 struct urb *read_urbp[NUM_READ_URBS];
47
48 /* Settings for the port */
49 int rts_state; /* Handshaking pins (outputs) */
50 int dtr_state;
51 int cts_state; /* Handshaking pins (inputs) */
52 int dsr_state;
53 int dcd_state;
54 int ri_state;
47}; 55};
48 56
57static int airprime_send_setup(struct usb_serial_port *port)
58{
59 struct usb_serial *serial = port->serial;
60 struct airprime_private *priv;
61
62 dbg("%s", __FUNCTION__);
63
64 if (port->number != 0)
65 return 0;
66
67 priv = usb_get_serial_port_data(port);
68
69 if (port->tty) {
70 int val = 0;
71 if (priv->dtr_state)
72 val |= 0x01;
73 if (priv->rts_state)
74 val |= 0x02;
75
76 return usb_control_msg(serial->dev,
77 usb_rcvctrlpipe(serial->dev, 0),
78 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT);
79 }
80
81 return 0;
82}
83
49static void airprime_read_bulk_callback(struct urb *urb) 84static void airprime_read_bulk_callback(struct urb *urb)
50{ 85{
51 struct usb_serial_port *port = urb->context; 86 struct usb_serial_port *port = urb->context;
@@ -118,6 +153,10 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp)
118 usb_set_serial_port_data(port, priv); 153 usb_set_serial_port_data(port, priv);
119 } 154 }
120 155
156 /* Set some sane defaults */
157 priv->rts_state = 1;
158 priv->dtr_state = 1;
159
121 for (i = 0; i < NUM_READ_URBS; ++i) { 160 for (i = 0; i < NUM_READ_URBS; ++i) {
122 buffer = kmalloc(buffer_size, GFP_KERNEL); 161 buffer = kmalloc(buffer_size, GFP_KERNEL);
123 if (!buffer) { 162 if (!buffer) {
@@ -151,6 +190,9 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp)
151 /* remember this urb so we can kill it when the port is closed */ 190 /* remember this urb so we can kill it when the port is closed */
152 priv->read_urbp[i] = urb; 191 priv->read_urbp[i] = urb;
153 } 192 }
193
194 airprime_send_setup(port);
195
154 goto out; 196 goto out;
155 197
156 errout: 198 errout:
@@ -176,6 +218,11 @@ static void airprime_close(struct usb_serial_port *port, struct file * filp)
176 218
177 dbg("%s - port %d", __FUNCTION__, port->number); 219 dbg("%s - port %d", __FUNCTION__, port->number);
178 220
221 priv->rts_state = 0;
222 priv->dtr_state = 0;
223
224 airprime_send_setup(port);
225
179 for (i = 0; i < NUM_READ_URBS; ++i) { 226 for (i = 0; i < NUM_READ_URBS; ++i) {
180 usb_kill_urb (priv->read_urbp[i]); 227 usb_kill_urb (priv->read_urbp[i]);
181 kfree (priv->read_urbp[i]->transfer_buffer); 228 kfree (priv->read_urbp[i]->transfer_buffer);
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index db623e754899..d7d0ba986a80 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -63,6 +63,8 @@ static struct usb_device_id id_table [] = {
63 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ 63 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
64 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ 64 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
65 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ 65 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
66 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
67 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
66 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 68 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
67 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ 69 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
68 { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ 70 { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c525b42dadde..1633a0fd48e8 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -315,6 +315,7 @@ static struct usb_device_id id_table_combined [] = {
315 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 315 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
316 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 316 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
317 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 317 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
318 { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) },
318 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, 319 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
319 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 320 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) },
320 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 321 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
@@ -420,6 +421,14 @@ static struct usb_device_id id_table_combined [] = {
420 { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, 421 { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) },
421 { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, 422 { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) },
422 { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, 423 { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) },
424 { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) },
425 { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) },
426 { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) },
427 { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) },
428 { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) },
429 { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) },
430 { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) },
431 { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) },
423 /* 432 /*
424 * These will probably use user-space drivers. Uncomment them if 433 * These will probably use user-space drivers. Uncomment them if
425 * you need them or use the user-specified vendor/product module 434 * you need them or use the user-specified vendor/product module
@@ -459,6 +468,7 @@ static struct usb_device_id id_table_combined [] = {
459 { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, 468 { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) },
460 { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, 469 { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) },
461 { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, 470 { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) },
471 { USB_DEVICE(TTI_VID, TTI_QL355P_PID) },
462 { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, 472 { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) },
463 { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, 473 { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) },
464 { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, 474 { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
@@ -533,6 +543,7 @@ static const char *ftdi_chip_name[] = {
533 [FT8U232AM] = "FT8U232AM", 543 [FT8U232AM] = "FT8U232AM",
534 [FT232BM] = "FT232BM", 544 [FT232BM] = "FT232BM",
535 [FT2232C] = "FT2232C", 545 [FT2232C] = "FT2232C",
546 [FT232RL] = "FT232RL",
536}; 547};
537 548
538 549
@@ -588,6 +599,8 @@ struct ftdi_private {
588static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id); 599static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id);
589static int ftdi_sio_attach (struct usb_serial *serial); 600static int ftdi_sio_attach (struct usb_serial *serial);
590static void ftdi_shutdown (struct usb_serial *serial); 601static void ftdi_shutdown (struct usb_serial *serial);
602static int ftdi_sio_port_probe (struct usb_serial_port *port);
603static int ftdi_sio_port_remove (struct usb_serial_port *port);
591static int ftdi_open (struct usb_serial_port *port, struct file *filp); 604static int ftdi_open (struct usb_serial_port *port, struct file *filp);
592static void ftdi_close (struct usb_serial_port *port, struct file *filp); 605static void ftdi_close (struct usb_serial_port *port, struct file *filp);
593static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count); 606static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count);
@@ -622,6 +635,8 @@ static struct usb_serial_driver ftdi_sio_device = {
622 .num_bulk_out = 1, 635 .num_bulk_out = 1,
623 .num_ports = 1, 636 .num_ports = 1,
624 .probe = ftdi_sio_probe, 637 .probe = ftdi_sio_probe,
638 .port_probe = ftdi_sio_port_probe,
639 .port_remove = ftdi_sio_port_remove,
625 .open = ftdi_open, 640 .open = ftdi_open,
626 .close = ftdi_close, 641 .close = ftdi_close,
627 .throttle = ftdi_throttle, 642 .throttle = ftdi_throttle,
@@ -1024,11 +1039,10 @@ static ssize_t show_latency_timer(struct device *dev, struct device_attribute *a
1024{ 1039{
1025 struct usb_serial_port *port = to_usb_serial_port(dev); 1040 struct usb_serial_port *port = to_usb_serial_port(dev);
1026 struct ftdi_private *priv = usb_get_serial_port_data(port); 1041 struct ftdi_private *priv = usb_get_serial_port_data(port);
1027 struct usb_device *udev; 1042 struct usb_device *udev = port->serial->dev;
1028 unsigned short latency = 0; 1043 unsigned short latency = 0;
1029 int rv = 0; 1044 int rv = 0;
1030 1045
1031 udev = to_usb_device(dev);
1032 1046
1033 dbg("%s",__FUNCTION__); 1047 dbg("%s",__FUNCTION__);
1034 1048
@@ -1052,13 +1066,11 @@ static ssize_t store_latency_timer(struct device *dev, struct device_attribute *
1052{ 1066{
1053 struct usb_serial_port *port = to_usb_serial_port(dev); 1067 struct usb_serial_port *port = to_usb_serial_port(dev);
1054 struct ftdi_private *priv = usb_get_serial_port_data(port); 1068 struct ftdi_private *priv = usb_get_serial_port_data(port);
1055 struct usb_device *udev; 1069 struct usb_device *udev = port->serial->dev;
1056 char buf[1]; 1070 char buf[1];
1057 int v = simple_strtoul(valbuf, NULL, 10); 1071 int v = simple_strtoul(valbuf, NULL, 10);
1058 int rv = 0; 1072 int rv = 0;
1059 1073
1060 udev = to_usb_device(dev);
1061
1062 dbg("%s: setting latency timer = %i", __FUNCTION__, v); 1074 dbg("%s: setting latency timer = %i", __FUNCTION__, v);
1063 1075
1064 rv = usb_control_msg(udev, 1076 rv = usb_control_msg(udev,
@@ -1083,13 +1095,11 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att
1083{ 1095{
1084 struct usb_serial_port *port = to_usb_serial_port(dev); 1096 struct usb_serial_port *port = to_usb_serial_port(dev);
1085 struct ftdi_private *priv = usb_get_serial_port_data(port); 1097 struct ftdi_private *priv = usb_get_serial_port_data(port);
1086 struct usb_device *udev; 1098 struct usb_device *udev = port->serial->dev;
1087 char buf[1]; 1099 char buf[1];
1088 int v = simple_strtoul(valbuf, NULL, 10); 1100 int v = simple_strtoul(valbuf, NULL, 10);
1089 int rv = 0; 1101 int rv = 0;
1090 1102
1091 udev = to_usb_device(dev);
1092
1093 dbg("%s: setting event char = %i", __FUNCTION__, v); 1103 dbg("%s: setting event char = %i", __FUNCTION__, v);
1094 1104
1095 rv = usb_control_msg(udev, 1105 rv = usb_control_msg(udev,
@@ -1110,46 +1120,38 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att
1110static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer); 1120static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer);
1111static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); 1121static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char);
1112 1122
1113static int create_sysfs_attrs(struct usb_serial *serial) 1123static int create_sysfs_attrs(struct usb_serial_port *port)
1114{ 1124{
1115 struct ftdi_private *priv; 1125 struct ftdi_private *priv = usb_get_serial_port_data(port);
1116 struct usb_device *udev;
1117 int retval = 0; 1126 int retval = 0;
1118 1127
1119 dbg("%s",__FUNCTION__); 1128 dbg("%s",__FUNCTION__);
1120 1129
1121 priv = usb_get_serial_port_data(serial->port[0]);
1122 udev = serial->dev;
1123
1124 /* XXX I've no idea if the original SIO supports the event_char 1130 /* XXX I've no idea if the original SIO supports the event_char
1125 * sysfs parameter, so I'm playing it safe. */ 1131 * sysfs parameter, so I'm playing it safe. */
1126 if (priv->chip_type != SIO) { 1132 if (priv->chip_type != SIO) {
1127 dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); 1133 dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]);
1128 retval = device_create_file(&udev->dev, &dev_attr_event_char); 1134 retval = device_create_file(&port->dev, &dev_attr_event_char);
1129 if ((!retval) && 1135 if ((!retval) &&
1130 (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) { 1136 (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) {
1131 retval = device_create_file(&udev->dev, 1137 retval = device_create_file(&port->dev,
1132 &dev_attr_latency_timer); 1138 &dev_attr_latency_timer);
1133 } 1139 }
1134 } 1140 }
1135 return retval; 1141 return retval;
1136} 1142}
1137 1143
1138static void remove_sysfs_attrs(struct usb_serial *serial) 1144static void remove_sysfs_attrs(struct usb_serial_port *port)
1139{ 1145{
1140 struct ftdi_private *priv; 1146 struct ftdi_private *priv = usb_get_serial_port_data(port);
1141 struct usb_device *udev;
1142 1147
1143 dbg("%s",__FUNCTION__); 1148 dbg("%s",__FUNCTION__);
1144 1149
1145 priv = usb_get_serial_port_data(serial->port[0]);
1146 udev = serial->dev;
1147
1148 /* XXX see create_sysfs_attrs */ 1150 /* XXX see create_sysfs_attrs */
1149 if (priv->chip_type != SIO) { 1151 if (priv->chip_type != SIO) {
1150 device_remove_file(&udev->dev, &dev_attr_event_char); 1152 device_remove_file(&port->dev, &dev_attr_event_char);
1151 if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { 1153 if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) {
1152 device_remove_file(&udev->dev, &dev_attr_latency_timer); 1154 device_remove_file(&port->dev, &dev_attr_latency_timer);
1153 } 1155 }
1154 } 1156 }
1155 1157
@@ -1169,13 +1171,9 @@ static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id
1169 return (0); 1171 return (0);
1170} 1172}
1171 1173
1172/* attach subroutine */ 1174static int ftdi_sio_port_probe(struct usb_serial_port *port)
1173static int ftdi_sio_attach (struct usb_serial *serial)
1174{ 1175{
1175 struct usb_serial_port *port = serial->port[0];
1176 struct ftdi_private *priv; 1176 struct ftdi_private *priv;
1177 struct ftdi_sio_quirk *quirk;
1178 int retval;
1179 1177
1180 dbg("%s",__FUNCTION__); 1178 dbg("%s",__FUNCTION__);
1181 1179
@@ -1215,19 +1213,21 @@ static int ftdi_sio_attach (struct usb_serial *serial)
1215 kfree(port->bulk_out_buffer); 1213 kfree(port->bulk_out_buffer);
1216 port->bulk_out_buffer = NULL; 1214 port->bulk_out_buffer = NULL;
1217 1215
1218 usb_set_serial_port_data(serial->port[0], priv); 1216 usb_set_serial_port_data(port, priv);
1219 1217
1220 ftdi_determine_type (serial->port[0]); 1218 ftdi_determine_type (port);
1221 retval = create_sysfs_attrs(serial); 1219 create_sysfs_attrs(port);
1222 if (retval) 1220 return 0;
1223 dev_err(&serial->dev->dev, "Error creating sysfs files, " 1221}
1224 "continuing\n");
1225 1222
1223/* attach subroutine */
1224static int ftdi_sio_attach (struct usb_serial *serial)
1225{
1226 /* Check for device requiring special set up. */ 1226 /* Check for device requiring special set up. */
1227 quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial); 1227 struct ftdi_sio_quirk *quirk = usb_get_serial_data(serial);
1228 if (quirk && quirk->setup) { 1228
1229 if (quirk && quirk->setup)
1229 quirk->setup(serial); 1230 quirk->setup(serial);
1230 }
1231 1231
1232 return 0; 1232 return 0;
1233} /* ftdi_sio_attach */ 1233} /* ftdi_sio_attach */
@@ -1271,17 +1271,18 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
1271 * calls __serial_close for each open of the port 1271 * calls __serial_close for each open of the port
1272 * shutdown is called then (ie ftdi_shutdown) 1272 * shutdown is called then (ie ftdi_shutdown)
1273 */ 1273 */
1274
1275
1276static void ftdi_shutdown (struct usb_serial *serial) 1274static void ftdi_shutdown (struct usb_serial *serial)
1277{ /* ftdi_shutdown */ 1275{
1276 dbg("%s", __FUNCTION__);
1277}
1278 1278
1279 struct usb_serial_port *port = serial->port[0]; 1279static int ftdi_sio_port_remove(struct usb_serial_port *port)
1280{
1280 struct ftdi_private *priv = usb_get_serial_port_data(port); 1281 struct ftdi_private *priv = usb_get_serial_port_data(port);
1281 1282
1282 dbg("%s", __FUNCTION__); 1283 dbg("%s", __FUNCTION__);
1283 1284
1284 remove_sysfs_attrs(serial); 1285 remove_sysfs_attrs(port);
1285 1286
1286 /* all open ports are closed at this point 1287 /* all open ports are closed at this point
1287 * (by usbserial.c:__serial_close, which calls ftdi_close) 1288 * (by usbserial.c:__serial_close, which calls ftdi_close)
@@ -1291,8 +1292,9 @@ static void ftdi_shutdown (struct usb_serial *serial)
1291 usb_set_serial_port_data(port, NULL); 1292 usb_set_serial_port_data(port, NULL);
1292 kfree(priv); 1293 kfree(priv);
1293 } 1294 }
1294} /* ftdi_shutdown */
1295 1295
1296 return 0;
1297}
1296 1298
1297static int ftdi_open (struct usb_serial_port *port, struct file *filp) 1299static int ftdi_open (struct usb_serial_port *port, struct file *filp)
1298{ /* ftdi_open */ 1300{ /* ftdi_open */
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 1bdda935f7d9..513cfe1b768b 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -27,6 +27,7 @@
27#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ 27#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */
28#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ 28#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
29#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ 29#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
30#define FTDI_232RL_PID 0xFBFA /* Product ID for FT232RL */
30#define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */ 31#define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */
31#define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */ 32#define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */
32#define FTDI_NF_RIC_PID 0x0001 /* Product Id */ 33#define FTDI_NF_RIC_PID 0x0001 /* Product Id */
@@ -339,6 +340,12 @@
339#define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */ 340#define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */
340 341
341/* 342/*
343 * TTi (Thurlby Thandar Instruments)
344 */
345#define TTI_VID 0x103E /* Vendor Id */
346#define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */
347
348/*
342 * Definitions for B&B Electronics products. 349 * Definitions for B&B Electronics products.
343 */ 350 */
344#define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ 351#define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */
@@ -497,6 +504,19 @@
497#define TELLDUS_VID 0x1781 /* Vendor ID */ 504#define TELLDUS_VID 0x1781 /* Vendor ID */
498#define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ 505#define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */
499 506
507/*
508 * IBS elektronik product ids
509 * Submitted by Thomas Schleusener
510 */
511#define FTDI_IBS_US485_PID 0xff38 /* IBS US485 (USB<-->RS422/485 interface) */
512#define FTDI_IBS_PICPRO_PID 0xff39 /* IBS PIC-Programmer */
513#define FTDI_IBS_PCMCIA_PID 0xff3a /* IBS Card reader for PCMCIA SRAM-cards */
514#define FTDI_IBS_PK1_PID 0xff3b /* IBS PK1 - Particel counter */
515#define FTDI_IBS_RS232MON_PID 0xff3c /* IBS RS232 - Monitor */
516#define FTDI_IBS_APP70_PID 0xff3d /* APP 70 (dust monitoring system) */
517#define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */
518#define FTDI_IBS_PROD_PID 0xff3f /* future device */
519
500/* Commands */ 520/* Commands */
501#define FTDI_SIO_RESET 0 /* Reset the port */ 521#define FTDI_SIO_RESET 0 /* Reset the port */
502#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 522#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
@@ -620,6 +640,7 @@ typedef enum {
620 FT8U232AM = 2, 640 FT8U232AM = 2,
621 FT232BM = 3, 641 FT232BM = 3,
622 FT2232C = 4, 642 FT2232C = 4,
643 FT232RL = 5,
623} ftdi_chip_type_t; 644} ftdi_chip_type_t;
624 645
625typedef enum { 646typedef enum {
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index a408184334ea..d16e2e1764ad 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -247,6 +247,8 @@ static struct usb_device_id ipaq_id_table [] = {
247 { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */ 247 { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */
248 { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */ 248 { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */
249 { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */ 249 { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */
250 { USB_DEVICE(0x04AD, 0x0306) }, /* GPS Pocket PC USB Sync */
251 { USB_DEVICE(0x04B7, 0x0531) }, /* MyGuide 7000 XL USB Sync */
250 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ 252 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */
251 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ 253 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */
252 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ 254 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 6bf22a28adb8..8511352251f3 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -99,9 +99,12 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po
99 continue; 99 continue;
100 100
101 *minor = i; 101 *minor = i;
102 j = 0;
102 dbg("%s - minor base = %d", __FUNCTION__, *minor); 103 dbg("%s - minor base = %d", __FUNCTION__, *minor);
103 for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) 104 for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) {
104 serial_table[i] = serial; 105 serial_table[i] = serial;
106 serial->port[j++]->number = i;
107 }
105 spin_unlock(&table_lock); 108 spin_unlock(&table_lock);
106 return serial; 109 return serial;
107 } 110 }
@@ -135,11 +138,6 @@ static void destroy_serial(struct kref *kref)
135 138
136 dbg("%s - %s", __FUNCTION__, serial->type->description); 139 dbg("%s - %s", __FUNCTION__, serial->type->description);
137 140
138 serial->type->shutdown(serial);
139
140 /* return the minor range that this device had */
141 return_serial(serial);
142
143 for (i = 0; i < serial->num_ports; ++i) 141 for (i = 0; i < serial->num_ports; ++i)
144 serial->port[i]->open_count = 0; 142 serial->port[i]->open_count = 0;
145 143
@@ -150,6 +148,12 @@ static void destroy_serial(struct kref *kref)
150 serial->port[i] = NULL; 148 serial->port[i] = NULL;
151 } 149 }
152 150
151 if (serial->type->shutdown)
152 serial->type->shutdown(serial);
153
154 /* return the minor range that this device had */
155 return_serial(serial);
156
153 /* If this is a "fake" port, we have to clean it up here, as it will 157 /* If this is a "fake" port, we have to clean it up here, as it will
154 * not get cleaned up in port_release() as it was never registered with 158 * not get cleaned up in port_release() as it was never registered with
155 * the driver core */ 159 * the driver core */
@@ -826,7 +830,6 @@ int usb_serial_probe(struct usb_interface *interface,
826 num_ports = type->num_ports; 830 num_ports = type->num_ports;
827 } 831 }
828 832
829 serial->minor = minor;
830 serial->num_ports = num_ports; 833 serial->num_ports = num_ports;
831 serial->num_bulk_in = num_bulk_in; 834 serial->num_bulk_in = num_bulk_in;
832 serial->num_bulk_out = num_bulk_out; 835 serial->num_bulk_out = num_bulk_out;
@@ -847,7 +850,6 @@ int usb_serial_probe(struct usb_interface *interface,
847 port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); 850 port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL);
848 if (!port) 851 if (!port)
849 goto probe_error; 852 goto probe_error;
850 port->number = i + serial->minor;
851 port->serial = serial; 853 port->serial = serial;
852 spin_lock_init(&port->lock); 854 spin_lock_init(&port->lock);
853 mutex_init(&port->mutex); 855 mutex_init(&port->mutex);
@@ -980,6 +982,7 @@ int usb_serial_probe(struct usb_interface *interface,
980 dev_err(&interface->dev, "No more free serial devices\n"); 982 dev_err(&interface->dev, "No more free serial devices\n");
981 goto probe_error; 983 goto probe_error;
982 } 984 }
985 serial->minor = minor;
983 986
984 /* register all of the individual ports with the driver core */ 987 /* register all of the individual ports with the driver core */
985 for (i = 0; i < num_ports; ++i) { 988 for (i = 0; i < num_ports; ++i) {
@@ -1034,9 +1037,6 @@ probe_error:
1034 kfree(port->interrupt_out_buffer); 1037 kfree(port->interrupt_out_buffer);
1035 } 1038 }
1036 1039
1037 /* return the minor range that this device had */
1038 return_serial (serial);
1039
1040 /* free up any memory that we allocated */ 1040 /* free up any memory that we allocated */
1041 for (i = 0; i < serial->num_port_pointers; ++i) 1041 for (i = 0; i < serial->num_port_pointers; ++i)
1042 kfree(serial->port[i]); 1042 kfree(serial->port[i]);
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 9644a8ea4aa7..2dd31e3f5107 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -146,6 +146,13 @@ UNUSUAL_DEV( 0x0420, 0x0001, 0x0100, 0x0100,
146 US_SC_DEVICE, US_PR_DEVICE, NULL, 146 US_SC_DEVICE, US_PR_DEVICE, NULL,
147 US_FL_IGNORE_RESIDUE ), 147 US_FL_IGNORE_RESIDUE ),
148 148
149/* Reported by Andrew Nayenko <relan@bk.ru> */
150UNUSUAL_DEV( 0x0421, 0x0019, 0x0592, 0x0592,
151 "Nokia",
152 "Nokia 6288",
153 US_SC_DEVICE, US_PR_DEVICE, NULL,
154 US_FL_MAX_SECTORS_64 ),
155
149/* Reported by Mario Rettig <mariorettig@web.de> */ 156/* Reported by Mario Rettig <mariorettig@web.de> */
150UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, 157UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100,
151 "Nokia", 158 "Nokia",
@@ -1395,16 +1402,6 @@ UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
1395 US_SC_DEVICE, US_PR_DEVICE, NULL, 1402 US_SC_DEVICE, US_PR_DEVICE, NULL,
1396 US_FL_IGNORE_RESIDUE ), 1403 US_FL_IGNORE_RESIDUE ),
1397 1404
1398/* Reported by Thomas Baechler <thomas@archlinux.org>
1399 * Fixes I/O errors with Teac HD-35PU devices
1400 */
1401
1402UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
1403 "Super Top",
1404 "USB 2.0 IDE DEVICE",
1405 US_SC_DEVICE, US_PR_DEVICE, NULL,
1406 US_FL_IGNORE_RESIDUE),
1407
1408/* patch submitted by Davide Perini <perini.davide@dpsoftware.org> 1405/* patch submitted by Davide Perini <perini.davide@dpsoftware.org>
1409 * and Renato Perini <rperini@email.it> 1406 * and Renato Perini <rperini@email.it>
1410 */ 1407 */
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index b8f0a11e8f31..7f5a59836818 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -677,8 +677,6 @@ config FB_S1D13XXX
677config FB_NVIDIA 677config FB_NVIDIA
678 tristate "nVidia Framebuffer Support" 678 tristate "nVidia Framebuffer Support"
679 depends on FB && PCI 679 depends on FB && PCI
680 select I2C_ALGOBIT if FB_NVIDIA_I2C
681 select I2C if FB_NVIDIA_I2C
682 select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT 680 select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT
683 select FB_MODE_HELPERS 681 select FB_MODE_HELPERS
684 select FB_CFB_FILLRECT 682 select FB_CFB_FILLRECT
@@ -697,6 +695,7 @@ config FB_NVIDIA
697config FB_NVIDIA_I2C 695config FB_NVIDIA_I2C
698 bool "Enable DDC Support" 696 bool "Enable DDC Support"
699 depends on FB_NVIDIA 697 depends on FB_NVIDIA
698 select FB_DDC
700 help 699 help
701 This enables I2C support for nVidia Chipsets. This is used 700 This enables I2C support for nVidia Chipsets. This is used
702 only for getting EDID information from the attached display 701 only for getting EDID information from the attached display
@@ -716,7 +715,6 @@ config FB_NVIDIA_BACKLIGHT
716config FB_RIVA 715config FB_RIVA
717 tristate "nVidia Riva support" 716 tristate "nVidia Riva support"
718 depends on FB && PCI 717 depends on FB && PCI
719 select FB_DDC if FB_RIVA_I2C
720 select FB_BACKLIGHT if FB_RIVA_BACKLIGHT 718 select FB_BACKLIGHT if FB_RIVA_BACKLIGHT
721 select FB_MODE_HELPERS 719 select FB_MODE_HELPERS
722 select FB_CFB_FILLRECT 720 select FB_CFB_FILLRECT
@@ -734,6 +732,7 @@ config FB_RIVA
734config FB_RIVA_I2C 732config FB_RIVA_I2C
735 bool "Enable DDC Support" 733 bool "Enable DDC Support"
736 depends on FB_RIVA 734 depends on FB_RIVA
735 select FB_DDC
737 help 736 help
738 This enables I2C support for nVidia Chipsets. This is used 737 This enables I2C support for nVidia Chipsets. This is used
739 only for getting EDID information from the attached display 738 only for getting EDID information from the attached display
@@ -812,8 +811,6 @@ config FB_INTEL
812 depends on FB && EXPERIMENTAL && PCI && X86 811 depends on FB && EXPERIMENTAL && PCI && X86
813 select AGP 812 select AGP
814 select AGP_INTEL 813 select AGP_INTEL
815 select I2C_ALGOBIT if FB_INTEL_I2C
816 select I2C if FB_INTEL_I2C
817 select FB_MODE_HELPERS 814 select FB_MODE_HELPERS
818 select FB_CFB_FILLRECT 815 select FB_CFB_FILLRECT
819 select FB_CFB_COPYAREA 816 select FB_CFB_COPYAREA
@@ -846,6 +843,7 @@ config FB_INTEL_DEBUG
846config FB_INTEL_I2C 843config FB_INTEL_I2C
847 bool "DDC/I2C for Intel framebuffer support" 844 bool "DDC/I2C for Intel framebuffer support"
848 depends on FB_INTEL 845 depends on FB_INTEL
846 select FB_DDC
849 default y 847 default y
850 help 848 help
851 Say Y here if you want DDC/I2C support for your on-board Intel graphics. 849 Say Y here if you want DDC/I2C support for your on-board Intel graphics.
@@ -924,8 +922,8 @@ config FB_MATROX_G
924 922
925config FB_MATROX_I2C 923config FB_MATROX_I2C
926 tristate "Matrox I2C support" 924 tristate "Matrox I2C support"
927 depends on FB_MATROX && I2C 925 depends on FB_MATROX
928 select I2C_ALGOBIT 926 select FB_DDC
929 ---help--- 927 ---help---
930 This drivers creates I2C buses which are needed for accessing the 928 This drivers creates I2C buses which are needed for accessing the
931 DDC (I2C) bus present on all Matroxes, an I2C bus which 929 DDC (I2C) bus present on all Matroxes, an I2C bus which
@@ -993,7 +991,6 @@ config FB_MATROX_MULTIHEAD
993config FB_RADEON 991config FB_RADEON
994 tristate "ATI Radeon display support" 992 tristate "ATI Radeon display support"
995 depends on FB && PCI 993 depends on FB && PCI
996 select FB_DDC if FB_RADEON_I2C
997 select FB_BACKLIGHT if FB_RADEON_BACKLIGHT 994 select FB_BACKLIGHT if FB_RADEON_BACKLIGHT
998 select FB_MODE_HELPERS 995 select FB_MODE_HELPERS
999 select FB_CFB_FILLRECT 996 select FB_CFB_FILLRECT
@@ -1018,6 +1015,7 @@ config FB_RADEON
1018config FB_RADEON_I2C 1015config FB_RADEON_I2C
1019 bool "DDC/I2C for ATI Radeon support" 1016 bool "DDC/I2C for ATI Radeon support"
1020 depends on FB_RADEON 1017 depends on FB_RADEON
1018 select FB_DDC
1021 default y 1019 default y
1022 help 1020 help
1023 Say Y here if you want DDC/I2C support for your Radeon board. 1021 Say Y here if you want DDC/I2C support for your Radeon board.
@@ -1125,7 +1123,6 @@ config FB_S3
1125config FB_SAVAGE 1123config FB_SAVAGE
1126 tristate "S3 Savage support" 1124 tristate "S3 Savage support"
1127 depends on FB && PCI && EXPERIMENTAL 1125 depends on FB && PCI && EXPERIMENTAL
1128 select FB_DDC if FB_SAVAGE_I2C
1129 select FB_MODE_HELPERS 1126 select FB_MODE_HELPERS
1130 select FB_CFB_FILLRECT 1127 select FB_CFB_FILLRECT
1131 select FB_CFB_COPYAREA 1128 select FB_CFB_COPYAREA
@@ -1142,6 +1139,7 @@ config FB_SAVAGE
1142config FB_SAVAGE_I2C 1139config FB_SAVAGE_I2C
1143 bool "Enable DDC2 Support" 1140 bool "Enable DDC2 Support"
1144 depends on FB_SAVAGE 1141 depends on FB_SAVAGE
1142 select FB_DDC
1145 help 1143 help
1146 This enables I2C support for S3 Savage Chipsets. This is used 1144 This enables I2C support for S3 Savage Chipsets. This is used
1147 only for getting EDID information from the attached display 1145 only for getting EDID information from the attached display
diff --git a/drivers/video/aty/atyfb.h b/drivers/video/aty/atyfb.h
index f72faff33c0c..dc62f8e282b4 100644
--- a/drivers/video/aty/atyfb.h
+++ b/drivers/video/aty/atyfb.h
@@ -284,7 +284,8 @@ static inline void aty_st_8(int regindex, u8 val, const struct atyfb_par *par)
284#endif 284#endif
285} 285}
286 286
287#if defined(CONFIG_PM) || defined(CONFIG_PMAC_BACKLIGHT) || defined (CONFIG_FB_ATY_GENERIC_LCD) 287#if defined(CONFIG_PM) || defined(CONFIG_PMAC_BACKLIGHT) || \
288defined (CONFIG_FB_ATY_GENERIC_LCD) || defined (CONFIG_FB_ATY_BACKLIGHT)
288extern void aty_st_lcd(int index, u32 val, const struct atyfb_par *par); 289extern void aty_st_lcd(int index, u32 val, const struct atyfb_par *par);
289extern u32 aty_ld_lcd(int index, const struct atyfb_par *par); 290extern u32 aty_ld_lcd(int index, const struct atyfb_par *par);
290#endif 291#endif
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
index d1312477813e..6b488b8a7eee 100644
--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -199,8 +199,8 @@ static int locomolcd_remove(struct locomo_dev *dev)
199{ 199{
200 unsigned long flags; 200 unsigned long flags;
201 201
202 locomobl_data.brightness = 0; 202 locomolcd_bl_device->props.brightness = 0;
203 locomobl_data.power = 0; 203 locomolcd_bl_device->props.power = 0;
204 locomolcd_set_intensity(locomolcd_bl_device); 204 locomolcd_set_intensity(locomolcd_bl_device);
205 205
206 backlight_device_unregister(locomolcd_bl_device); 206 backlight_device_unregister(locomolcd_bl_device);
diff --git a/drivers/video/backlight/progear_bl.c b/drivers/video/backlight/progear_bl.c
index 702269357861..836ab4df0ef2 100644
--- a/drivers/video/backlight/progear_bl.c
+++ b/drivers/video/backlight/progear_bl.c
@@ -65,13 +65,13 @@ static int progearbl_probe(struct platform_device *pdev)
65 u8 temp; 65 u8 temp;
66 struct backlight_device *progear_backlight_device; 66 struct backlight_device *progear_backlight_device;
67 67
68 pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 0); 68 pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL);
69 if (!pmu_dev) { 69 if (!pmu_dev) {
70 printk("ALI M7101 PMU not found.\n"); 70 printk("ALI M7101 PMU not found.\n");
71 return -ENODEV; 71 return -ENODEV;
72 } 72 }
73 73
74 sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 0); 74 sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
75 if (!sb_dev) { 75 if (!sb_dev) {
76 printk("ALI 1533 SB not found.\n"); 76 printk("ALI 1533 SB not found.\n");
77 pci_dev_put(pmu_dev); 77 pci_dev_put(pmu_dev);
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 9bb6257d6918..b0b2e40bbd9f 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -186,8 +186,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
186 * Initialisation 186 * Initialisation
187 */ 187 */
188 188
189static void 189static void __devinit bw2_init_fix(struct fb_info *info, int linebytes)
190bw2_init_fix(struct fb_info *info, int linebytes)
191{ 190{
192 strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); 191 strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id));
193 192
@@ -199,43 +198,44 @@ bw2_init_fix(struct fb_info *info, int linebytes)
199 info->fix.accel = FB_ACCEL_SUN_BWTWO; 198 info->fix.accel = FB_ACCEL_SUN_BWTWO;
200} 199}
201 200
202static u8 bw2regs_1600[] __initdata = { 201static u8 bw2regs_1600[] __devinitdata = {
203 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, 202 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13,
204 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, 203 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e,
205 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, 204 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01,
206 0x10, 0x21, 0 205 0x10, 0x21, 0
207}; 206};
208 207
209static u8 bw2regs_ecl[] __initdata = { 208static u8 bw2regs_ecl[] __devinitdata = {
210 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, 209 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c,
211 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, 210 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23,
212 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, 211 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01,
213 0x10, 0x20, 0 212 0x10, 0x20, 0
214}; 213};
215 214
216static u8 bw2regs_analog[] __initdata = { 215static u8 bw2regs_analog[] __devinitdata = {
217 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, 216 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13,
218 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, 217 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22,
219 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 218 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
220 0x10, 0x20, 0 219 0x10, 0x20, 0
221}; 220};
222 221
223static u8 bw2regs_76hz[] __initdata = { 222static u8 bw2regs_76hz[] __devinitdata = {
224 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, 223 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f,
225 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, 224 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a,
226 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, 225 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01,
227 0x10, 0x24, 0 226 0x10, 0x24, 0
228}; 227};
229 228
230static u8 bw2regs_66hz[] __initdata = { 229static u8 bw2regs_66hz[] __devinitdata = {
231 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, 230 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14,
232 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, 231 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24,
233 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 232 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
234 0x10, 0x20, 0 233 0x10, 0x20, 0
235}; 234};
236 235
237static void bw2_do_default_mode(struct bw2_par *par, struct fb_info *info, 236static void __devinit bw2_do_default_mode(struct bw2_par *par,
238 int *linebytes) 237 struct fb_info *info,
238 int *linebytes)
239{ 239{
240 u8 status, mon; 240 u8 status, mon;
241 u8 *p; 241 u8 *p;
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index ec6a51a5822d..b071bb632b97 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -354,7 +354,8 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
354 * Initialisation 354 * Initialisation
355 */ 355 */
356 356
357static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) 357static void __devinit cg14_init_fix(struct fb_info *info, int linebytes,
358 struct device_node *dp)
358{ 359{
359 const char *name = dp->name; 360 const char *name = dp->name;
360 361
@@ -368,7 +369,7 @@ static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_nod
368 info->fix.accel = FB_ACCEL_SUN_CG14; 369 info->fix.accel = FB_ACCEL_SUN_CG14;
369} 370}
370 371
371static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __initdata = { 372static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __devinitdata = {
372 { 373 {
373 .voff = CG14_REGS, 374 .voff = CG14_REGS,
374 .poff = 0x80000000, 375 .poff = 0x80000000,
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index a50b303093a7..43f62d8ee41d 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -12,6 +12,11 @@
12#include <linux/backlight.h> 12#include <linux/backlight.h>
13#include <linux/fb.h> 13#include <linux/fb.h>
14#include <linux/pci.h> 14#include <linux/pci.h>
15
16#ifdef CONFIG_PMAC_BACKLIGHT
17#include <asm/backlight.h>
18#endif
19
15#include "nv_local.h" 20#include "nv_local.h"
16#include "nv_type.h" 21#include "nv_type.h"
17#include "nv_proto.h" 22#include "nv_proto.h"
diff --git a/fs/buffer.c b/fs/buffer.c
index e8504b65176c..1d0852fa728b 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2365,6 +2365,10 @@ failed:
2365} 2365}
2366EXPORT_SYMBOL(nobh_prepare_write); 2366EXPORT_SYMBOL(nobh_prepare_write);
2367 2367
2368/*
2369 * Make sure any changes to nobh_commit_write() are reflected in
2370 * nobh_truncate_page(), since it doesn't call commit_write().
2371 */
2368int nobh_commit_write(struct file *file, struct page *page, 2372int nobh_commit_write(struct file *file, struct page *page,
2369 unsigned from, unsigned to) 2373 unsigned from, unsigned to)
2370{ 2374{
@@ -2466,6 +2470,11 @@ int nobh_truncate_page(struct address_space *mapping, loff_t from)
2466 memset(kaddr + offset, 0, PAGE_CACHE_SIZE - offset); 2470 memset(kaddr + offset, 0, PAGE_CACHE_SIZE - offset);
2467 flush_dcache_page(page); 2471 flush_dcache_page(page);
2468 kunmap_atomic(kaddr, KM_USER0); 2472 kunmap_atomic(kaddr, KM_USER0);
2473 /*
2474 * It would be more correct to call aops->commit_write()
2475 * here, but this is more efficient.
2476 */
2477 SetPageUptodate(page);
2469 set_page_dirty(page); 2478 set_page_dirty(page);
2470 } 2479 }
2471 unlock_page(page); 2480 unlock_page(page);
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 5fe13593b57f..6247628bdaed 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,3 +1,10 @@
1Verison 1.48
2------------
3Fix mtime bouncing around from local idea of last write times to remote time.
4Fix hang (in i_size_read) when simultaneous size update of same remote file
5on smp system corrupts sequence number. Do not reread unnecessarily partial page
6(which we are about to overwrite anyway) when writing out file opened rw.
7
1Version 1.47 8Version 1.47
2------------ 9------------
3Fix oops in list_del during mount caused by unaligned string. 10Fix oops in list_del during mount caused by unaligned string.
diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
index a26f26ed5a17..6ecd9d6ba3f3 100644
--- a/fs/cifs/Makefile
+++ b/fs/cifs/Makefile
@@ -3,4 +3,4 @@
3# 3#
4obj-$(CONFIG_CIFS) += cifs.o 4obj-$(CONFIG_CIFS) += cifs.o
5 5
6cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o 6cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o export.o
diff --git a/fs/cifs/TODO b/fs/cifs/TODO
index 68372946dc92..d7b9c27c942d 100644
--- a/fs/cifs/TODO
+++ b/fs/cifs/TODO
@@ -18,7 +18,9 @@ better)
18 18
19d) Kerberos/SPNEGO session setup support - (started) 19d) Kerberos/SPNEGO session setup support - (started)
20 20
21e) NTLMv2 authentication (mostly implemented) 21e) NTLMv2 authentication (mostly implemented - double check
22that NTLMv2 signing works, also need to cleanup now unneeded SessSetup code in
23fs/cifs/connect.c)
22 24
23f) MD5-HMAC signing SMB PDUs when SPNEGO style SessionSetup 25f) MD5-HMAC signing SMB PDUs when SPNEGO style SessionSetup
24used (Kerberos or NTLMSSP). Signing alreadyimplemented for NTLM 26used (Kerberos or NTLMSSP). Signing alreadyimplemented for NTLM
@@ -88,11 +90,12 @@ w) Finish up the dos time conversion routines needed to return old server
88time to the client (default time, of now or time 0 is used now for these 90time to the client (default time, of now or time 0 is used now for these
89very old servers) 91very old servers)
90 92
91x) Add support for OS/2 (LANMAN 1.2 and LANMAN2.1 based SMB servers) 93x) In support for OS/2 (LANMAN 1.2 and LANMAN2.1 based SMB servers)
94need to add ability to set time to server (utimes command)
92 95
93y) Finish testing of Windows 9x/Windows ME server support (started). 96y) Finish testing of Windows 9x/Windows ME server support (started).
94 97
95KNOWN BUGS (updated April 29, 2005) 98KNOWN BUGS (updated February 26, 2007)
96==================================== 99====================================
97See http://bugzilla.samba.org - search on product "CifsVFS" for 100See http://bugzilla.samba.org - search on product "CifsVFS" for
98current bug list. 101current bug list.
@@ -107,11 +110,6 @@ but recognizes them
107succeed but still return access denied (appears to be Windows 110succeed but still return access denied (appears to be Windows
108server not cifs client problem) and has not been reproduced recently. 111server not cifs client problem) and has not been reproduced recently.
109NTFS partitions do not have this problem. 112NTFS partitions do not have this problem.
1104) debug connectathon lock test case 10 which fails against
111Samba (may be unmappable due to POSIX to Windows lock model
112differences but worth investigating). Also debug Samba to
113see why lock test case 7 takes longer to complete to Samba
114than to Windows.
115 113
116Misc testing to do 114Misc testing to do
117================== 115==================
@@ -119,7 +117,7 @@ Misc testing to do
119types. Try nested symlinks (8 deep). Return max path name in stat -f information 117types. Try nested symlinks (8 deep). Return max path name in stat -f information
120 118
1212) Modify file portion of ltp so it can run against a mounted network 1192) Modify file portion of ltp so it can run against a mounted network
122share and run it against cifs vfs. 120share and run it against cifs vfs in automated fashion.
123 121
1243) Additional performance testing and optimization using iozone and similar - 1223) Additional performance testing and optimization using iozone and similar -
125there are some easy changes that can be done to parallelize sequential writes, 123there are some easy changes that can be done to parallelize sequential writes,
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index bc2c0ac27169..faba4d69fe91 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fs/cifs/cifsfs.c 2 * fs/cifs/cifsfs.c
3 * 3 *
4 * Copyright (C) International Business Machines Corp., 2002,2004 4 * Copyright (C) International Business Machines Corp., 2002,2007
5 * Author(s): Steve French (sfrench@us.ibm.com) 5 * Author(s): Steve French (sfrench@us.ibm.com)
6 * 6 *
7 * Common Internet FileSystem (CIFS) client 7 * Common Internet FileSystem (CIFS) client
@@ -47,7 +47,11 @@
47 47
48#ifdef CONFIG_CIFS_QUOTA 48#ifdef CONFIG_CIFS_QUOTA
49static struct quotactl_ops cifs_quotactl_ops; 49static struct quotactl_ops cifs_quotactl_ops;
50#endif 50#endif /* QUOTA */
51
52#ifdef CONFIG_CIFS_EXPERIMENTAL
53extern struct export_operations cifs_export_ops;
54#endif /* EXPERIMENTAL */
51 55
52int cifsFYI = 0; 56int cifsFYI = 0;
53int cifsERROR = 1; 57int cifsERROR = 1;
@@ -62,8 +66,8 @@ unsigned int extended_security = CIFSSEC_DEF;
62unsigned int sign_CIFS_PDUs = 1; 66unsigned int sign_CIFS_PDUs = 1;
63extern struct task_struct * oplockThread; /* remove sparse warning */ 67extern struct task_struct * oplockThread; /* remove sparse warning */
64struct task_struct * oplockThread = NULL; 68struct task_struct * oplockThread = NULL;
65extern struct task_struct * dnotifyThread; /* remove sparse warning */ 69/* extern struct task_struct * dnotifyThread; remove sparse warning */
66struct task_struct * dnotifyThread = NULL; 70static struct task_struct * dnotifyThread = NULL;
67static const struct super_operations cifs_super_ops; 71static const struct super_operations cifs_super_ops;
68unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; 72unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
69module_param(CIFSMaxBufSize, int, 0); 73module_param(CIFSMaxBufSize, int, 0);
@@ -110,6 +114,10 @@ cifs_read_super(struct super_block *sb, void *data,
110 114
111 sb->s_magic = CIFS_MAGIC_NUMBER; 115 sb->s_magic = CIFS_MAGIC_NUMBER;
112 sb->s_op = &cifs_super_ops; 116 sb->s_op = &cifs_super_ops;
117#ifdef CONFIG_CIFS_EXPERIMENTAL
118 if(experimEnabled != 0)
119 sb->s_export_op = &cifs_export_ops;
120#endif /* EXPERIMENTAL */
113/* if(cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512) 121/* if(cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512)
114 sb->s_blocksize = cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */ 122 sb->s_blocksize = cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */
115#ifdef CONFIG_CIFS_QUOTA 123#ifdef CONFIG_CIFS_QUOTA
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index c97c08eb481a..2c2c384894d8 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -38,8 +38,8 @@ extern const struct address_space_operations cifs_addr_ops_smallbuf;
38/* Functions related to super block operations */ 38/* Functions related to super block operations */
39/* extern const struct super_operations cifs_super_ops;*/ 39/* extern const struct super_operations cifs_super_ops;*/
40extern void cifs_read_inode(struct inode *); 40extern void cifs_read_inode(struct inode *);
41extern void cifs_delete_inode(struct inode *); 41/*extern void cifs_delete_inode(struct inode *);*/ /* BB not needed yet */
42/* extern void cifs_write_inode(struct inode *); *//* BB not needed yet */ 42/* extern void cifs_write_inode(struct inode *); */ /* BB not needed yet */
43 43
44/* Functions related to inodes */ 44/* Functions related to inodes */
45extern const struct inode_operations cifs_dir_inode_ops; 45extern const struct inode_operations cifs_dir_inode_ops;
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 74d3ccbb103b..e4de8eba4780 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -525,15 +525,17 @@ require use of the stronger protocol */
525 */ 525 */
526GLOBAL_EXTERN struct smbUidInfo *GlobalUidList[UID_HASH]; 526GLOBAL_EXTERN struct smbUidInfo *GlobalUidList[UID_HASH];
527 527
528GLOBAL_EXTERN struct list_head GlobalServerList; /* BB not implemented yet */ 528/* GLOBAL_EXTERN struct list_head GlobalServerList; BB not implemented yet */
529GLOBAL_EXTERN struct list_head GlobalSMBSessionList; 529GLOBAL_EXTERN struct list_head GlobalSMBSessionList;
530GLOBAL_EXTERN struct list_head GlobalTreeConnectionList; 530GLOBAL_EXTERN struct list_head GlobalTreeConnectionList;
531GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */ 531GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */
532 532
533GLOBAL_EXTERN struct list_head GlobalOplock_Q; 533GLOBAL_EXTERN struct list_head GlobalOplock_Q;
534 534
535GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; /* Outstanding dir notify requests */ 535/* Outstanding dir notify requests */
536GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q;/* DirNotify response queue */ 536GLOBAL_EXTERN struct list_head GlobalDnotifyReqList;
537/* DirNotify response queue */
538GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q;
537 539
538/* 540/*
539 * Global transaction id (XID) information 541 * Global transaction id (XID) information
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 2498d644827c..3af76249dc8b 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -220,6 +220,9 @@
220 */ 220 */
221#define CIFS_NO_HANDLE 0xFFFF 221#define CIFS_NO_HANDLE 0xFFFF
222 222
223#define NO_CHANGE_64 cpu_to_le64(0xFFFFFFFFFFFFFFFFULL)
224#define NO_CHANGE_32 0xFFFFFFFFUL
225
223/* IPC$ in ASCII */ 226/* IPC$ in ASCII */
224#define CIFS_IPC_RESOURCE "\x49\x50\x43\x24" 227#define CIFS_IPC_RESOURCE "\x49\x50\x43\x24"
225 228
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 6148b82170c4..32eb1acab630 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -43,7 +43,7 @@ extern void _FreeXid(unsigned int);
43#define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__FUNCTION__,curr_xid,(int)rc));} 43#define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__FUNCTION__,curr_xid,(int)rc));}
44extern char *build_path_from_dentry(struct dentry *); 44extern char *build_path_from_dentry(struct dentry *);
45extern char *build_wildcard_path_from_dentry(struct dentry *direntry); 45extern char *build_wildcard_path_from_dentry(struct dentry *direntry);
46extern void renew_parental_timestamps(struct dentry *direntry); 46/* extern void renew_parental_timestamps(struct dentry *direntry);*/
47extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, 47extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
48 struct smb_hdr * /* input */ , 48 struct smb_hdr * /* input */ ,
49 struct smb_hdr * /* out */ , 49 struct smb_hdr * /* out */ ,
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 24364106b8f9..48fc0c2ab0e5 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -4803,6 +4803,16 @@ setPermsRetry:
4803 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC); 4803 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC);
4804 pSMB->Reserved4 = 0; 4804 pSMB->Reserved4 = 0;
4805 pSMB->hdr.smb_buf_length += byte_count; 4805 pSMB->hdr.smb_buf_length += byte_count;
4806 /* Samba server ignores set of file size to zero due to bugs in some
4807 older clients, but we should be precise - we use SetFileSize to
4808 set file size and do not want to truncate file size to zero
4809 accidently as happened on one Samba server beta by putting
4810 zero instead of -1 here */
4811 data_offset->EndOfFile = NO_CHANGE_64;
4812 data_offset->NumOfBytes = NO_CHANGE_64;
4813 data_offset->LastStatusChange = NO_CHANGE_64;
4814 data_offset->LastAccessTime = NO_CHANGE_64;
4815 data_offset->LastModificationTime = NO_CHANGE_64;
4806 data_offset->Uid = cpu_to_le64(uid); 4816 data_offset->Uid = cpu_to_le64(uid);
4807 data_offset->Gid = cpu_to_le64(gid); 4817 data_offset->Gid = cpu_to_le64(gid);
4808 /* better to leave device as zero when it is */ 4818 /* better to leave device as zero when it is */
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 66b825ade3e1..3fad638d26d3 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -31,7 +31,7 @@
31#include "cifs_debug.h" 31#include "cifs_debug.h"
32#include "cifs_fs_sb.h" 32#include "cifs_fs_sb.h"
33 33
34void 34static void
35renew_parental_timestamps(struct dentry *direntry) 35renew_parental_timestamps(struct dentry *direntry)
36{ 36{
37 /* BB check if there is a way to get the kernel to do this or if we really need this */ 37 /* BB check if there is a way to get the kernel to do this or if we really need this */
diff --git a/fs/cifs/export.c b/fs/cifs/export.c
new file mode 100644
index 000000000000..1d716392c3aa
--- /dev/null
+++ b/fs/cifs/export.c
@@ -0,0 +1,52 @@
1/*
2 * fs/cifs/export.c
3 *
4 * Copyright (C) International Business Machines Corp., 2007
5 * Author(s): Steve French (sfrench@us.ibm.com)
6 *
7 * Common Internet FileSystem (CIFS) client
8 *
9 * Operations related to support for exporting files via NFSD
10 *
11 * This library is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published
13 * by the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
19 * the GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25
26 /*
27 * See Documentation/filesystems/Exporting
28 * and examples in fs/exportfs
29 */
30
31#include <linux/fs.h>
32
33#ifdef CONFIG_CIFS_EXPERIMENTAL
34
35static struct dentry *cifs_get_parent(struct dentry *dentry)
36{
37 /* BB need to add code here eventually to enable export via NFSD */
38 return ERR_PTR(-EACCES);
39}
40
41struct export_operations cifs_export_ops = {
42 .get_parent = cifs_get_parent,
43/* Following five export operations are unneeded so far and can default */
44/* .get_dentry =
45 .get_name =
46 .find_exported_dentry =
47 .decode_fh =
48 .encode_fs = */
49 };
50
51#endif /* EXPERIMENTAL */
52
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index a1265c9bfec0..2d3275bedb55 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -879,18 +879,19 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
879 cifs_stats_bytes_written(pTcon, total_written); 879 cifs_stats_bytes_written(pTcon, total_written);
880 880
881 /* since the write may have blocked check these pointers again */ 881 /* since the write may have blocked check these pointers again */
882 if (file->f_path.dentry) { 882 if ((file->f_path.dentry) && (file->f_path.dentry->d_inode)) {
883 if (file->f_path.dentry->d_inode) { 883 struct inode *inode = file->f_path.dentry->d_inode;
884 struct inode *inode = file->f_path.dentry->d_inode; 884/* Do not update local mtime - server will set its actual value on write
885 inode->i_ctime = inode->i_mtime = 885 * inode->i_ctime = inode->i_mtime =
886 current_fs_time(inode->i_sb); 886 * current_fs_time(inode->i_sb);*/
887 if (total_written > 0) { 887 if (total_written > 0) {
888 if (*poffset > file->f_path.dentry->d_inode->i_size) 888 spin_lock(&inode->i_lock);
889 i_size_write(file->f_path.dentry->d_inode, 889 if (*poffset > file->f_path.dentry->d_inode->i_size)
890 i_size_write(file->f_path.dentry->d_inode,
890 *poffset); 891 *poffset);
891 } 892 spin_unlock(&inode->i_lock);
892 mark_inode_dirty_sync(file->f_path.dentry->d_inode);
893 } 893 }
894 mark_inode_dirty_sync(file->f_path.dentry->d_inode);
894 } 895 }
895 FreeXid(xid); 896 FreeXid(xid);
896 return total_written; 897 return total_written;
@@ -1012,18 +1013,18 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
1012 cifs_stats_bytes_written(pTcon, total_written); 1013 cifs_stats_bytes_written(pTcon, total_written);
1013 1014
1014 /* since the write may have blocked check these pointers again */ 1015 /* since the write may have blocked check these pointers again */
1015 if (file->f_path.dentry) { 1016 if ((file->f_path.dentry) && (file->f_path.dentry->d_inode)) {
1016 if (file->f_path.dentry->d_inode) {
1017/*BB We could make this contingent on superblock ATIME flag too */ 1017/*BB We could make this contingent on superblock ATIME flag too */
1018/* file->f_path.dentry->d_inode->i_ctime = 1018/* file->f_path.dentry->d_inode->i_ctime =
1019 file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME;*/ 1019 file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME;*/
1020 if (total_written > 0) { 1020 if (total_written > 0) {
1021 if (*poffset > file->f_path.dentry->d_inode->i_size) 1021 spin_lock(&file->f_path.dentry->d_inode->i_lock);
1022 i_size_write(file->f_path.dentry->d_inode, 1022 if (*poffset > file->f_path.dentry->d_inode->i_size)
1023 *poffset); 1023 i_size_write(file->f_path.dentry->d_inode,
1024 } 1024 *poffset);
1025 mark_inode_dirty_sync(file->f_path.dentry->d_inode); 1025 spin_unlock(&file->f_path.dentry->d_inode->i_lock);
1026 } 1026 }
1027 mark_inode_dirty_sync(file->f_path.dentry->d_inode);
1027 } 1028 }
1028 FreeXid(xid); 1029 FreeXid(xid);
1029 return total_written; 1030 return total_written;
@@ -1400,6 +1401,7 @@ static int cifs_commit_write(struct file *file, struct page *page,
1400 xid = GetXid(); 1401 xid = GetXid();
1401 cFYI(1, ("commit write for page %p up to position %lld for %d", 1402 cFYI(1, ("commit write for page %p up to position %lld for %d",
1402 page, position, to)); 1403 page, position, to));
1404 spin_lock(&inode->i_lock);
1403 if (position > inode->i_size) { 1405 if (position > inode->i_size) {
1404 i_size_write(inode, position); 1406 i_size_write(inode, position);
1405 /* if (file->private_data == NULL) { 1407 /* if (file->private_data == NULL) {
@@ -1429,6 +1431,7 @@ static int cifs_commit_write(struct file *file, struct page *page,
1429 cFYI(1, (" SetEOF (commit write) rc = %d", rc)); 1431 cFYI(1, (" SetEOF (commit write) rc = %d", rc));
1430 } */ 1432 } */
1431 } 1433 }
1434 spin_unlock(&inode->i_lock);
1432 if (!PageUptodate(page)) { 1435 if (!PageUptodate(page)) {
1433 position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset; 1436 position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset;
1434 /* can not rely on (or let) writepage write this data */ 1437 /* can not rely on (or let) writepage write this data */
@@ -1989,34 +1992,52 @@ static int cifs_prepare_write(struct file *file, struct page *page,
1989 unsigned from, unsigned to) 1992 unsigned from, unsigned to)
1990{ 1993{
1991 int rc = 0; 1994 int rc = 0;
1992 loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; 1995 loff_t i_size;
1996 loff_t offset;
1997
1993 cFYI(1, ("prepare write for page %p from %d to %d",page,from,to)); 1998 cFYI(1, ("prepare write for page %p from %d to %d",page,from,to));
1994 if (!PageUptodate(page)) { 1999 if (PageUptodate(page))
1995 /* if (to - from != PAGE_CACHE_SIZE) { 2000 return 0;
1996 void *kaddr = kmap_atomic(page, KM_USER0); 2001
2002 /* If we are writing a full page it will be up to date,
2003 no need to read from the server */
2004 if ((to == PAGE_CACHE_SIZE) && (from == 0)) {
2005 SetPageUptodate(page);
2006 return 0;
2007 }
2008
2009 offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
2010 i_size = i_size_read(page->mapping->host);
2011
2012 if ((offset >= i_size) ||
2013 ((from == 0) && (offset + to) >= i_size)) {
2014 /*
2015 * We don't need to read data beyond the end of the file.
2016 * zero it, and set the page uptodate
2017 */
2018 void *kaddr = kmap_atomic(page, KM_USER0);
2019
2020 if (from)
1997 memset(kaddr, 0, from); 2021 memset(kaddr, 0, from);
2022 if (to < PAGE_CACHE_SIZE)
1998 memset(kaddr + to, 0, PAGE_CACHE_SIZE - to); 2023 memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
1999 flush_dcache_page(page); 2024 flush_dcache_page(page);
2000 kunmap_atomic(kaddr, KM_USER0); 2025 kunmap_atomic(kaddr, KM_USER0);
2001 } */ 2026 SetPageUptodate(page);
2002 /* If we are writing a full page it will be up to date, 2027 } else if ((file->f_flags & O_ACCMODE) != O_WRONLY) {
2003 no need to read from the server */
2004 if ((to == PAGE_CACHE_SIZE) && (from == 0))
2005 SetPageUptodate(page);
2006
2007 /* might as well read a page, it is fast enough */ 2028 /* might as well read a page, it is fast enough */
2008 if ((file->f_flags & O_ACCMODE) != O_WRONLY) { 2029 rc = cifs_readpage_worker(file, page, &offset);
2009 rc = cifs_readpage_worker(file, page, &offset); 2030 } else {
2010 } else { 2031 /* we could try using another file handle if there is one -
2011 /* should we try using another file handle if there is one - 2032 but how would we lock it to prevent close of that handle
2012 how would we lock it to prevent close of that handle 2033 racing with this read? In any case
2013 racing with this read? 2034 this will be written out by commit_write so is fine */
2014 In any case this will be written out by commit_write */
2015 }
2016 } 2035 }
2017 2036
2018 /* BB should we pass any errors back? 2037 /* we do not need to pass errors back
2019 e.g. if we do not have read access to the file */ 2038 e.g. if we do not have read access to the file
2039 because cifs_commit_write will do the right thing. -- shaggy */
2040
2020 return 0; 2041 return 0;
2021} 2042}
2022 2043
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 37c6ce87416b..86b9dbbd8441 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -143,10 +143,10 @@ int cifs_get_inode_info_unix(struct inode **pinode,
143 inode->i_gid = le64_to_cpu(findData.Gid); 143 inode->i_gid = le64_to_cpu(findData.Gid);
144 inode->i_nlink = le64_to_cpu(findData.Nlinks); 144 inode->i_nlink = le64_to_cpu(findData.Nlinks);
145 145
146 spin_lock(&inode->i_lock);
146 if (is_size_safe_to_change(cifsInfo, end_of_file)) { 147 if (is_size_safe_to_change(cifsInfo, end_of_file)) {
147 /* can not safely change the file size here if the 148 /* can not safely change the file size here if the
148 client is writing to it due to potential races */ 149 client is writing to it due to potential races */
149
150 i_size_write(inode, end_of_file); 150 i_size_write(inode, end_of_file);
151 151
152 /* blksize needs to be multiple of two. So safer to default to 152 /* blksize needs to be multiple of two. So safer to default to
@@ -162,6 +162,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
162 /* for this calculation */ 162 /* for this calculation */
163 inode->i_blocks = (512 - 1 + num_of_bytes) >> 9; 163 inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
164 } 164 }
165 spin_unlock(&inode->i_lock);
165 166
166 if (num_of_bytes < end_of_file) 167 if (num_of_bytes < end_of_file)
167 cFYI(1, ("allocation size less than end of file")); 168 cFYI(1, ("allocation size less than end of file"));
@@ -496,6 +497,8 @@ int cifs_get_inode_info(struct inode **pinode,
496 /* BB add code here - 497 /* BB add code here -
497 validate if device or weird share or device type? */ 498 validate if device or weird share or device type? */
498 } 499 }
500
501 spin_lock(&inode->i_lock);
499 if (is_size_safe_to_change(cifsInfo, le64_to_cpu(pfindData->EndOfFile))) { 502 if (is_size_safe_to_change(cifsInfo, le64_to_cpu(pfindData->EndOfFile))) {
500 /* can not safely shrink the file size here if the 503 /* can not safely shrink the file size here if the
501 client is writing to it due to potential races */ 504 client is writing to it due to potential races */
@@ -506,6 +509,7 @@ int cifs_get_inode_info(struct inode **pinode,
506 inode->i_blocks = (512 - 1 + le64_to_cpu( 509 inode->i_blocks = (512 - 1 + le64_to_cpu(
507 pfindData->AllocationSize)) >> 9; 510 pfindData->AllocationSize)) >> 9;
508 } 511 }
512 spin_unlock(&inode->i_lock);
509 513
510 inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks); 514 inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks);
511 515
@@ -834,8 +838,10 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
834 838
835 if (!rc) { 839 if (!rc) {
836 drop_nlink(inode); 840 drop_nlink(inode);
841 spin_lock(&direntry->d_inode->i_lock);
837 i_size_write(direntry->d_inode,0); 842 i_size_write(direntry->d_inode,0);
838 clear_nlink(direntry->d_inode); 843 clear_nlink(direntry->d_inode);
844 spin_unlock(&direntry->d_inode->i_lock);
839 } 845 }
840 846
841 cifsInode = CIFS_I(direntry->d_inode); 847 cifsInode = CIFS_I(direntry->d_inode);
@@ -1128,6 +1134,52 @@ static int cifs_truncate_page(struct address_space *mapping, loff_t from)
1128 return rc; 1134 return rc;
1129} 1135}
1130 1136
1137static int cifs_vmtruncate(struct inode * inode, loff_t offset)
1138{
1139 struct address_space *mapping = inode->i_mapping;
1140 unsigned long limit;
1141
1142 spin_lock(&inode->i_lock);
1143 if (inode->i_size < offset)
1144 goto do_expand;
1145 /*
1146 * truncation of in-use swapfiles is disallowed - it would cause
1147 * subsequent swapout to scribble on the now-freed blocks.
1148 */
1149 if (IS_SWAPFILE(inode)) {
1150 spin_unlock(&inode->i_lock);
1151 goto out_busy;
1152 }
1153 i_size_write(inode, offset);
1154 spin_unlock(&inode->i_lock);
1155 unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
1156 truncate_inode_pages(mapping, offset);
1157 goto out_truncate;
1158
1159do_expand:
1160 limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
1161 if (limit != RLIM_INFINITY && offset > limit) {
1162 spin_unlock(&inode->i_lock);
1163 goto out_sig;
1164 }
1165 if (offset > inode->i_sb->s_maxbytes) {
1166 spin_unlock(&inode->i_lock);
1167 goto out_big;
1168 }
1169 i_size_write(inode, offset);
1170 spin_unlock(&inode->i_lock);
1171out_truncate:
1172 if (inode->i_op && inode->i_op->truncate)
1173 inode->i_op->truncate(inode);
1174 return 0;
1175out_sig:
1176 send_sig(SIGXFSZ, current, 0);
1177out_big:
1178 return -EFBIG;
1179out_busy:
1180 return -ETXTBSY;
1181}
1182
1131int cifs_setattr(struct dentry *direntry, struct iattr *attrs) 1183int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1132{ 1184{
1133 int xid; 1185 int xid;
@@ -1244,7 +1296,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1244 */ 1296 */
1245 1297
1246 if (rc == 0) { 1298 if (rc == 0) {
1247 rc = vmtruncate(direntry->d_inode, attrs->ia_size); 1299 rc = cifs_vmtruncate(direntry->d_inode, attrs->ia_size);
1248 cifs_truncate_page(direntry->d_inode->i_mapping, 1300 cifs_truncate_page(direntry->d_inode->i_mapping,
1249 direntry->d_inode->i_size); 1301 direntry->d_inode->i_size);
1250 } else 1302 } else
@@ -1379,9 +1431,11 @@ cifs_setattr_exit:
1379 return rc; 1431 return rc;
1380} 1432}
1381 1433
1434#if 0
1382void cifs_delete_inode(struct inode *inode) 1435void cifs_delete_inode(struct inode *inode)
1383{ 1436{
1384 cFYI(1, ("In cifs_delete_inode, inode = 0x%p", inode)); 1437 cFYI(1, ("In cifs_delete_inode, inode = 0x%p", inode));
1385 /* may have to add back in if and when safe distributed caching of 1438 /* may have to add back in if and when safe distributed caching of
1386 directories added e.g. via FindNotify */ 1439 directories added e.g. via FindNotify */
1387} 1440}
1441#endif
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index c444798f0740..44cfb528797d 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Directory search handling 4 * Directory search handling
5 * 5 *
6 * Copyright (C) International Business Machines Corp., 2004, 2005 6 * Copyright (C) International Business Machines Corp., 2004, 2007
7 * Author(s): Steve French (sfrench@us.ibm.com) 7 * Author(s): Steve French (sfrench@us.ibm.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or modify 9 * This library is free software; you can redistribute it and/or modify
@@ -226,6 +226,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
226 atomic_set(&cifsInfo->inUse, 1); 226 atomic_set(&cifsInfo->inUse, 1);
227 } 227 }
228 228
229 spin_lock(&tmp_inode->i_lock);
229 if (is_size_safe_to_change(cifsInfo, end_of_file)) { 230 if (is_size_safe_to_change(cifsInfo, end_of_file)) {
230 /* can not safely change the file size here if the 231 /* can not safely change the file size here if the
231 client is writing to it due to potential races */ 232 client is writing to it due to potential races */
@@ -235,6 +236,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
235 /* for this calculation, even though the reported blocksize is larger */ 236 /* for this calculation, even though the reported blocksize is larger */
236 tmp_inode->i_blocks = (512 - 1 + allocation_size) >> 9; 237 tmp_inode->i_blocks = (512 - 1 + allocation_size) >> 9;
237 } 238 }
239 spin_unlock(&tmp_inode->i_lock);
238 240
239 if (allocation_size < end_of_file) 241 if (allocation_size < end_of_file)
240 cFYI(1, ("May be sparse file, allocation less than file size")); 242 cFYI(1, ("May be sparse file, allocation less than file size"));
@@ -355,6 +357,7 @@ static void unix_fill_in_inode(struct inode *tmp_inode,
355 tmp_inode->i_gid = le64_to_cpu(pfindData->Gid); 357 tmp_inode->i_gid = le64_to_cpu(pfindData->Gid);
356 tmp_inode->i_nlink = le64_to_cpu(pfindData->Nlinks); 358 tmp_inode->i_nlink = le64_to_cpu(pfindData->Nlinks);
357 359
360 spin_lock(&tmp_inode->i_lock);
358 if (is_size_safe_to_change(cifsInfo, end_of_file)) { 361 if (is_size_safe_to_change(cifsInfo, end_of_file)) {
359 /* can not safely change the file size here if the 362 /* can not safely change the file size here if the
360 client is writing to it due to potential races */ 363 client is writing to it due to potential races */
@@ -364,6 +367,7 @@ static void unix_fill_in_inode(struct inode *tmp_inode,
364 /* for this calculation, not the real blocksize */ 367 /* for this calculation, not the real blocksize */
365 tmp_inode->i_blocks = (512 - 1 + num_of_bytes) >> 9; 368 tmp_inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
366 } 369 }
370 spin_unlock(&tmp_inode->i_lock);
367 371
368 if (S_ISREG(tmp_inode->i_mode)) { 372 if (S_ISREG(tmp_inode->i_mode)) {
369 cFYI(1, ("File inode")); 373 cFYI(1, ("File inode"));
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index f80007eaebf4..5f468459a1e2 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -499,7 +499,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
499 due to last connection to this server being unmounted */ 499 due to last connection to this server being unmounted */
500 if (signal_pending(current)) { 500 if (signal_pending(current)) {
501 /* if signal pending do not hold up user for full smb timeout 501 /* if signal pending do not hold up user for full smb timeout
502 but we still give response a change to complete */ 502 but we still give response a chance to complete */
503 timeout = 2 * HZ; 503 timeout = 2 * HZ;
504 } 504 }
505 505
@@ -587,7 +587,6 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
587 } 587 }
588 588
589out: 589out:
590
591 DeleteMidQEntry(midQ); 590 DeleteMidQEntry(midQ);
592 atomic_dec(&ses->server->inFlight); 591 atomic_dec(&ses->server->inFlight);
593 wake_up(&ses->server->request_q); 592 wake_up(&ses->server->request_q);
@@ -681,7 +680,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
681 due to last connection to this server being unmounted */ 680 due to last connection to this server being unmounted */
682 if (signal_pending(current)) { 681 if (signal_pending(current)) {
683 /* if signal pending do not hold up user for full smb timeout 682 /* if signal pending do not hold up user for full smb timeout
684 but we still give response a change to complete */ 683 but we still give response a chance to complete */
685 timeout = 2 * HZ; 684 timeout = 2 * HZ;
686 } 685 }
687 686
@@ -765,7 +764,6 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
765 } 764 }
766 765
767out: 766out:
768
769 DeleteMidQEntry(midQ); 767 DeleteMidQEntry(midQ);
770 atomic_dec(&ses->server->inFlight); 768 atomic_dec(&ses->server->inFlight);
771 wake_up(&ses->server->request_q); 769 wake_up(&ses->server->request_q);
diff --git a/fs/compat.c b/fs/compat.c
index 0ec70e3cee0a..040a8be38a48 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -48,6 +48,7 @@
48#include <linux/highmem.h> 48#include <linux/highmem.h>
49#include <linux/poll.h> 49#include <linux/poll.h>
50#include <linux/mm.h> 50#include <linux/mm.h>
51#include <linux/eventpoll.h>
51 52
52#include <net/sock.h> /* siocdevprivate_ioctl */ 53#include <net/sock.h> /* siocdevprivate_ioctl */
53 54
@@ -2235,3 +2236,102 @@ long asmlinkage compat_sys_nfsservctl(int cmd, void *notused, void *notused2)
2235 return sys_ni_syscall(); 2236 return sys_ni_syscall();
2236} 2237}
2237#endif 2238#endif
2239
2240#ifdef CONFIG_EPOLL
2241
2242#ifdef CONFIG_HAS_COMPAT_EPOLL_EVENT
2243asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
2244 struct compat_epoll_event __user *event)
2245{
2246 long err = 0;
2247 struct compat_epoll_event user;
2248 struct epoll_event __user *kernel = NULL;
2249
2250 if (event) {
2251 if (copy_from_user(&user, event, sizeof(user)))
2252 return -EFAULT;
2253 kernel = compat_alloc_user_space(sizeof(struct epoll_event));
2254 err |= __put_user(user.events, &kernel->events);
2255 err |= __put_user(user.data, &kernel->data);
2256 }
2257
2258 return err ? err : sys_epoll_ctl(epfd, op, fd, kernel);
2259}
2260
2261
2262asmlinkage long compat_sys_epoll_wait(int epfd,
2263 struct compat_epoll_event __user *events,
2264 int maxevents, int timeout)
2265{
2266 long i, ret, err = 0;
2267 struct epoll_event __user *kbuf;
2268 struct epoll_event ev;
2269
2270 if ((maxevents <= 0) ||
2271 (maxevents > (INT_MAX / sizeof(struct epoll_event))))
2272 return -EINVAL;
2273 kbuf = compat_alloc_user_space(sizeof(struct epoll_event) * maxevents);
2274 ret = sys_epoll_wait(epfd, kbuf, maxevents, timeout);
2275 for (i = 0; i < ret; i++) {
2276 err |= __get_user(ev.events, &kbuf[i].events);
2277 err |= __get_user(ev.data, &kbuf[i].data);
2278 err |= __put_user(ev.events, &events->events);
2279 err |= __put_user_unaligned(ev.data, &events->data);
2280 events++;
2281 }
2282
2283 return err ? -EFAULT: ret;
2284}
2285#endif /* CONFIG_HAS_COMPAT_EPOLL_EVENT */
2286
2287#ifdef TIF_RESTORE_SIGMASK
2288asmlinkage long compat_sys_epoll_pwait(int epfd,
2289 struct compat_epoll_event __user *events,
2290 int maxevents, int timeout,
2291 const compat_sigset_t __user *sigmask,
2292 compat_size_t sigsetsize)
2293{
2294 long err;
2295 compat_sigset_t csigmask;
2296 sigset_t ksigmask, sigsaved;
2297
2298 /*
2299 * If the caller wants a certain signal mask to be set during the wait,
2300 * we apply it here.
2301 */
2302 if (sigmask) {
2303 if (sigsetsize != sizeof(compat_sigset_t))
2304 return -EINVAL;
2305 if (copy_from_user(&csigmask, sigmask, sizeof(csigmask)))
2306 return -EFAULT;
2307 sigset_from_compat(&ksigmask, &csigmask);
2308 sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP));
2309 sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
2310 }
2311
2312#ifdef CONFIG_HAS_COMPAT_EPOLL_EVENT
2313 err = compat_sys_epoll_wait(epfd, events, maxevents, timeout);
2314#else
2315 err = sys_epoll_wait(epfd, events, maxevents, timeout);
2316#endif
2317
2318 /*
2319 * If we changed the signal mask, we need to restore the original one.
2320 * In case we've got a signal while waiting, we do not restore the
2321 * signal mask yet, and we allow do_signal() to deliver the signal on
2322 * the way back to userspace, before the signal mask is restored.
2323 */
2324 if (sigmask) {
2325 if (err == -EINTR) {
2326 memcpy(&current->saved_sigmask, &sigsaved,
2327 sizeof(sigsaved));
2328 set_thread_flag(TIF_RESTORE_SIGMASK);
2329 } else
2330 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
2331 }
2332
2333 return err;
2334}
2335#endif /* TIF_RESTORE_SIGMASK */
2336
2337#endif /* CONFIG_EPOLL */
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 40db61dc95f2..3870150b83a4 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -22,6 +22,7 @@
22#include "lockspace.h" 22#include "lockspace.h"
23#include "lock.h" 23#include "lock.h"
24#include "lvb_table.h" 24#include "lvb_table.h"
25#include "user.h"
25 26
26static const char *name_prefix="dlm"; 27static const char *name_prefix="dlm";
27static struct miscdevice ctl_device; 28static struct miscdevice ctl_device;
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index e62f3fc7241e..1548be26b5e6 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -38,7 +38,7 @@ static struct dentry *lock_parent(struct dentry *dentry)
38 struct dentry *dir; 38 struct dentry *dir;
39 39
40 dir = dget(dentry->d_parent); 40 dir = dget(dentry->d_parent);
41 mutex_lock(&(dir->d_inode->i_mutex)); 41 mutex_lock_nested(&(dir->d_inode->i_mutex), I_MUTEX_PARENT);
42 return dir; 42 return dir;
43} 43}
44 44
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 6618c1190252..12accb08fe02 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -20,6 +20,7 @@
20#include <linux/list.h> 20#include <linux/list.h>
21#include <linux/lm_interface.h> 21#include <linux/lm_interface.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/module.h>
23#include <linux/rwsem.h> 24#include <linux/rwsem.h>
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25 26
@@ -953,9 +954,6 @@ static void drop_bh(struct gfs2_glock *gl, unsigned int ret)
953 spin_unlock(&gl->gl_spin); 954 spin_unlock(&gl->gl_spin);
954 } 955 }
955 956
956 if (glops->go_drop_bh)
957 glops->go_drop_bh(gl);
958
959 spin_lock(&gl->gl_spin); 957 spin_lock(&gl->gl_spin);
960 gl->gl_req_gh = NULL; 958 gl->gl_req_gh = NULL;
961 gl->gl_req_bh = NULL; 959 gl->gl_req_bh = NULL;
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 46af55355513..39c8ae23bd9c 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -245,7 +245,6 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
245 245
246 if (ip && S_ISREG(ip->i_inode.i_mode)) { 246 if (ip && S_ISREG(ip->i_inode.i_mode)) {
247 truncate_inode_pages(ip->i_inode.i_mapping, 0); 247 truncate_inode_pages(ip->i_inode.i_mapping, 0);
248 gfs2_assert_withdraw(GFS2_SB(&ip->i_inode), !ip->i_inode.i_mapping->nrpages);
249 clear_bit(GIF_PAGED, &ip->i_flags); 248 clear_bit(GIF_PAGED, &ip->i_flags);
250 } 249 }
251} 250}
@@ -459,6 +458,8 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
459}; 458};
460 459
461const struct gfs2_glock_operations gfs2_rgrp_glops = { 460const struct gfs2_glock_operations gfs2_rgrp_glops = {
461 .go_xmote_th = meta_go_sync,
462 .go_drop_th = meta_go_sync,
462 .go_inval = meta_go_inval, 463 .go_inval = meta_go_inval,
463 .go_demote_ok = rgrp_go_demote_ok, 464 .go_demote_ok = rgrp_go_demote_ok,
464 .go_lock = rgrp_go_lock, 465 .go_lock = rgrp_go_lock,
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 12c80fd28db5..49f0dbf40d86 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -104,7 +104,6 @@ struct gfs2_glock_operations {
104 void (*go_xmote_th) (struct gfs2_glock *gl); 104 void (*go_xmote_th) (struct gfs2_glock *gl);
105 void (*go_xmote_bh) (struct gfs2_glock *gl); 105 void (*go_xmote_bh) (struct gfs2_glock *gl);
106 void (*go_drop_th) (struct gfs2_glock *gl); 106 void (*go_drop_th) (struct gfs2_glock *gl);
107 void (*go_drop_bh) (struct gfs2_glock *gl);
108 void (*go_inval) (struct gfs2_glock *gl, int flags); 107 void (*go_inval) (struct gfs2_glock *gl, int flags);
109 int (*go_demote_ok) (struct gfs2_glock *gl); 108 int (*go_demote_ok) (struct gfs2_glock *gl);
110 int (*go_lock) (struct gfs2_holder *gh); 109 int (*go_lock) (struct gfs2_holder *gh);
@@ -416,7 +415,6 @@ struct gfs2_tune {
416 unsigned int gt_stall_secs; /* Detects trouble! */ 415 unsigned int gt_stall_secs; /* Detects trouble! */
417 unsigned int gt_complain_secs; 416 unsigned int gt_complain_secs;
418 unsigned int gt_reclaim_limit; /* Max num of glocks in reclaim list */ 417 unsigned int gt_reclaim_limit; /* Max num of glocks in reclaim list */
419 unsigned int gt_entries_per_readdir;
420 unsigned int gt_statfs_quantum; 418 unsigned int gt_statfs_quantum;
421 unsigned int gt_statfs_slow; 419 unsigned int gt_statfs_slow;
422}; 420};
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 0d6831a40565..df0b8b3018b9 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -43,7 +43,8 @@ static int iget_test(struct inode *inode, void *opaque)
43 struct gfs2_inode *ip = GFS2_I(inode); 43 struct gfs2_inode *ip = GFS2_I(inode);
44 struct gfs2_inum_host *inum = opaque; 44 struct gfs2_inum_host *inum = opaque;
45 45
46 if (ip->i_num.no_addr == inum->no_addr) 46 if (ip->i_num.no_addr == inum->no_addr &&
47 inode->i_private != NULL)
47 return 1; 48 return 1;
48 49
49 return 0; 50 return 0;
@@ -61,13 +62,13 @@ static int iget_set(struct inode *inode, void *opaque)
61 62
62struct inode *gfs2_ilookup(struct super_block *sb, struct gfs2_inum_host *inum) 63struct inode *gfs2_ilookup(struct super_block *sb, struct gfs2_inum_host *inum)
63{ 64{
64 return ilookup5(sb, (unsigned long)inum->no_formal_ino, 65 return ilookup5(sb, (unsigned long)inum->no_addr,
65 iget_test, inum); 66 iget_test, inum);
66} 67}
67 68
68static struct inode *gfs2_iget(struct super_block *sb, struct gfs2_inum_host *inum) 69static struct inode *gfs2_iget(struct super_block *sb, struct gfs2_inum_host *inum)
69{ 70{
70 return iget5_locked(sb, (unsigned long)inum->no_formal_ino, 71 return iget5_locked(sb, (unsigned long)inum->no_addr,
71 iget_test, iget_set, inum); 72 iget_test, iget_set, inum);
72} 73}
73 74
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 56e33590b656..b3b7e8475359 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -266,9 +266,11 @@ skip_lock:
266out: 266out:
267 return error; 267 return error;
268out_unlock: 268out_unlock:
269 if (error == GLR_TRYFAILED)
270 error = AOP_TRUNCATED_PAGE;
271 unlock_page(page); 269 unlock_page(page);
270 if (error == GLR_TRYFAILED) {
271 error = AOP_TRUNCATED_PAGE;
272 yield();
273 }
272 if (do_unlock) 274 if (do_unlock)
273 gfs2_holder_uninit(&gh); 275 gfs2_holder_uninit(&gh);
274 goto out; 276 goto out;
@@ -364,6 +366,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
364 if (error == GLR_TRYFAILED) { 366 if (error == GLR_TRYFAILED) {
365 unlock_page(page); 367 unlock_page(page);
366 error = AOP_TRUNCATED_PAGE; 368 error = AOP_TRUNCATED_PAGE;
369 yield();
367 } 370 }
368 goto out_uninit; 371 goto out_uninit;
369 } 372 }
diff --git a/fs/gfs2/ops_export.c b/fs/gfs2/ops_export.c
index 1de05b63d43a..aad918337a46 100644
--- a/fs/gfs2/ops_export.c
+++ b/fs/gfs2/ops_export.c
@@ -38,14 +38,11 @@ static struct dentry *gfs2_decode_fh(struct super_block *sb,
38 struct gfs2_fh_obj fh_obj; 38 struct gfs2_fh_obj fh_obj;
39 struct gfs2_inum_host *this, parent; 39 struct gfs2_inum_host *this, parent;
40 40
41 if (fh_type != fh_len)
42 return NULL;
43
44 this = &fh_obj.this; 41 this = &fh_obj.this;
45 fh_obj.imode = DT_UNKNOWN; 42 fh_obj.imode = DT_UNKNOWN;
46 memset(&parent, 0, sizeof(struct gfs2_inum)); 43 memset(&parent, 0, sizeof(struct gfs2_inum));
47 44
48 switch (fh_type) { 45 switch (fh_len) {
49 case GFS2_LARGE_FH_SIZE: 46 case GFS2_LARGE_FH_SIZE:
50 parent.no_formal_ino = ((u64)be32_to_cpu(fh[4])) << 32; 47 parent.no_formal_ino = ((u64)be32_to_cpu(fh[4])) << 32;
51 parent.no_formal_ino |= be32_to_cpu(fh[5]); 48 parent.no_formal_ino |= be32_to_cpu(fh[5]);
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index ee80b8a5e7bc..ee54cb667083 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -840,7 +840,7 @@ static struct super_block* get_gfs2_sb(const char *dev_name)
840 } 840 }
841 841
842 printk(KERN_WARNING "GFS2: Unrecognized block device or " 842 printk(KERN_WARNING "GFS2: Unrecognized block device or "
843 "mount point %s", dev_name); 843 "mount point %s\n", dev_name);
844 844
845free_nd: 845free_nd:
846 path_release(&nd); 846 path_release(&nd);
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index d0db881b55d2..c186857e48a8 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -279,7 +279,7 @@ static int bh_get(struct gfs2_quota_data *qd)
279 (bh->b_data + sizeof(struct gfs2_meta_header) + 279 (bh->b_data + sizeof(struct gfs2_meta_header) +
280 offset * sizeof(struct gfs2_quota_change)); 280 offset * sizeof(struct gfs2_quota_change));
281 281
282 mutex_lock(&sdp->sd_quota_mutex); 282 mutex_unlock(&sdp->sd_quota_mutex);
283 283
284 return 0; 284 return 0;
285 285
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 70f424fcf1cd..4fdda974dc83 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -76,7 +76,6 @@ void gfs2_tune_init(struct gfs2_tune *gt)
76 gt->gt_stall_secs = 600; 76 gt->gt_stall_secs = 600;
77 gt->gt_complain_secs = 10; 77 gt->gt_complain_secs = 10;
78 gt->gt_reclaim_limit = 5000; 78 gt->gt_reclaim_limit = 5000;
79 gt->gt_entries_per_readdir = 32;
80 gt->gt_statfs_quantum = 30; 79 gt->gt_statfs_quantum = 30;
81 gt->gt_statfs_slow = 0; 80 gt->gt_statfs_slow = 0;
82} 81}
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index e965eb11d76f..9baf69773ed1 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -47,7 +47,7 @@ struct dentry_operations hostfs_dentry_ops = {
47}; 47};
48 48
49/* Changed in hostfs_args before the kernel starts running */ 49/* Changed in hostfs_args before the kernel starts running */
50static char *root_ino = "/"; 50static char *root_ino = "";
51static int append = 0; 51static int append = 0;
52 52
53#define HOSTFS_SUPER_MAGIC 0x00c0ffee 53#define HOSTFS_SUPER_MAGIC 0x00c0ffee
@@ -947,15 +947,17 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
947 sb->s_magic = HOSTFS_SUPER_MAGIC; 947 sb->s_magic = HOSTFS_SUPER_MAGIC;
948 sb->s_op = &hostfs_sbops; 948 sb->s_op = &hostfs_sbops;
949 949
950 if((data == NULL) || (*data == '\0')) 950 /* NULL is printed as <NULL> by sprintf: avoid that. */
951 data = root_ino; 951 if (data == NULL)
952 data = "";
952 953
953 err = -ENOMEM; 954 err = -ENOMEM;
954 name = kmalloc(strlen(data) + 1, GFP_KERNEL); 955 name = kmalloc(strlen(root_ino) + 1
956 + strlen(data) + 1, GFP_KERNEL);
955 if(name == NULL) 957 if(name == NULL)
956 goto out; 958 goto out;
957 959
958 strcpy(name, data); 960 sprintf(name, "%s/%s", root_ino, data);
959 961
960 root_inode = iget(sb, 0); 962 root_inode = iget(sb, 0);
961 if(root_inode == NULL) 963 if(root_inode == NULL)
@@ -966,6 +968,9 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
966 goto out_put; 968 goto out_put;
967 969
968 HOSTFS_I(root_inode)->host_filename = name; 970 HOSTFS_I(root_inode)->host_filename = name;
971 /* Avoid that in the error path, iput(root_inode) frees again name through
972 * hostfs_destroy_inode! */
973 name = NULL;
969 974
970 err = -ENOMEM; 975 err = -ENOMEM;
971 sb->s_root = d_alloc_root(root_inode); 976 sb->s_root = d_alloc_root(root_inode);
@@ -977,7 +982,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
977 /* No iput in this case because the dput does that for us */ 982 /* No iput in this case because the dput does that for us */
978 dput(sb->s_root); 983 dput(sb->s_root);
979 sb->s_root = NULL; 984 sb->s_root = NULL;
980 goto out_free; 985 goto out;
981 } 986 }
982 987
983 return(0); 988 return(0);
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c
index 6eb3daebd563..888f236e5494 100644
--- a/fs/jffs2/background.c
+++ b/fs/jffs2/background.c
@@ -99,7 +99,13 @@ static int jffs2_garbage_collect_thread(void *_c)
99 if (try_to_freeze()) 99 if (try_to_freeze())
100 continue; 100 continue;
101 101
102 cond_resched(); 102 /* This thread is purely an optimisation. But if it runs when
103 other things could be running, it actually makes things a
104 lot worse. Use yield() and put it at the back of the runqueue
105 every time. Especially during boot, pulling an inode in
106 with read_inode() is much preferable to having the GC thread
107 get there first. */
108 yield();
103 109
104 /* Put_super will send a SIGKILL and then wait on the sem. 110 /* Put_super will send a SIGKILL and then wait on the sem.
105 */ 111 */
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index 58a0b912e9d0..717a48cf7df2 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -373,7 +373,14 @@ free_out:
373static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs2_unknown_node *un) 373static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs2_unknown_node *un)
374{ 374{
375 /* We don't mark unknown nodes as REF_UNCHECKED */ 375 /* We don't mark unknown nodes as REF_UNCHECKED */
376 BUG_ON(ref_flags(ref) == REF_UNCHECKED); 376 if (ref_flags(ref) == REF_UNCHECKED) {
377 JFFS2_ERROR("REF_UNCHECKED but unknown node at %#08x\n",
378 ref_offset(ref));
379 JFFS2_ERROR("Node is {%04x,%04x,%08x,%08x}. Please report this error.\n",
380 je16_to_cpu(un->magic), je16_to_cpu(un->nodetype),
381 je32_to_cpu(un->totlen), je32_to_cpu(un->hdr_crc));
382 return 1;
383 }
377 384
378 un->nodetype = cpu_to_je16(JFFS2_NODE_ACCURATE | je16_to_cpu(un->nodetype)); 385 un->nodetype = cpu_to_je16(JFFS2_NODE_ACCURATE | je16_to_cpu(un->nodetype));
379 386
@@ -576,6 +583,13 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf
576 jffs2_mark_node_obsolete(c, ref); 583 jffs2_mark_node_obsolete(c, ref);
577 goto cont; 584 goto cont;
578 } 585 }
586 /* Due to poor choice of crc32 seed, an all-zero node will have a correct CRC */
587 if (!je32_to_cpu(node->u.hdr_crc) && !je16_to_cpu(node->u.nodetype) &&
588 !je16_to_cpu(node->u.magic) && !je32_to_cpu(node->u.totlen)) {
589 JFFS2_NOTICE("All zero node header at %#08x.\n", ref_offset(ref));
590 jffs2_mark_node_obsolete(c, ref);
591 goto cont;
592 }
579 593
580 switch (je16_to_cpu(node->u.nodetype)) { 594 switch (je16_to_cpu(node->u.nodetype)) {
581 595
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 31c1475d922a..7fb45bd4915c 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -734,6 +734,15 @@ scan_more:
734 ofs += 4; 734 ofs += 4;
735 continue; 735 continue;
736 } 736 }
737 /* Due to poor choice of crc32 seed, an all-zero node will have a correct CRC */
738 if (!je32_to_cpu(node->hdr_crc) && !je16_to_cpu(node->nodetype) &&
739 !je16_to_cpu(node->magic) && !je32_to_cpu(node->totlen)) {
740 noisy_printk(&noise, "jffs2_scan_eraseblock(): All zero node header at 0x%08x.\n", ofs);
741 if ((err = jffs2_scan_dirty_space(c, jeb, 4)))
742 return err;
743 ofs += 4;
744 continue;
745 }
737 746
738 if (ofs + je32_to_cpu(node->totlen) > 747 if (ofs + je32_to_cpu(node->totlen) >
739 jeb->offset + c->sector_size) { 748 jeb->offset + c->sector_size) {
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index de718e3a1692..4fac6dd53954 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -238,7 +238,10 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
238 jeb = &c->blocks[c->wbuf_ofs / c->sector_size]; 238 jeb = &c->blocks[c->wbuf_ofs / c->sector_size];
239 239
240 spin_lock(&c->erase_completion_lock); 240 spin_lock(&c->erase_completion_lock);
241 jffs2_block_refile(c, jeb, REFILE_NOTEMPTY); 241 if (c->wbuf_ofs % c->mtd->erasesize)
242 jffs2_block_refile(c, jeb, REFILE_NOTEMPTY);
243 else
244 jffs2_block_refile(c, jeb, REFILE_ANYWAY);
242 spin_unlock(&c->erase_completion_lock); 245 spin_unlock(&c->erase_completion_lock);
243 246
244 BUG_ON(!ref_obsolete(jeb->last_node)); 247 BUG_ON(!ref_obsolete(jeb->last_node));
@@ -1087,7 +1090,7 @@ int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *
1087 if (!c->mtd->block_markbad) 1090 if (!c->mtd->block_markbad)
1088 return 1; // What else can we do? 1091 return 1; // What else can we do?
1089 1092
1090 D1(printk(KERN_WARNING "jffs2_write_nand_badblock(): Marking bad block at %08x\n", bad_offset)); 1093 printk(KERN_WARNING "JFFS2: marking eraseblock at %08x\n as bad", bad_offset);
1091 ret = c->mtd->block_markbad(c->mtd, bad_offset); 1094 ret = c->mtd->block_markbad(c->mtd, bad_offset);
1092 1095
1093 if (ret) { 1096 if (ret) {
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 14939ddf74f1..7285c94956c4 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -576,6 +576,12 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
576 server->packet = vmalloc(NCP_PACKET_SIZE); 576 server->packet = vmalloc(NCP_PACKET_SIZE);
577 if (server->packet == NULL) 577 if (server->packet == NULL)
578 goto out_nls; 578 goto out_nls;
579 server->txbuf = vmalloc(NCP_PACKET_SIZE);
580 if (server->txbuf == NULL)
581 goto out_packet;
582 server->rxbuf = vmalloc(NCP_PACKET_SIZE);
583 if (server->rxbuf == NULL)
584 goto out_txbuf;
579 585
580 sock->sk->sk_data_ready = ncp_tcp_data_ready; 586 sock->sk->sk_data_ready = ncp_tcp_data_ready;
581 sock->sk->sk_error_report = ncp_tcp_error_report; 587 sock->sk->sk_error_report = ncp_tcp_error_report;
@@ -597,7 +603,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
597 error = ncp_connect(server); 603 error = ncp_connect(server);
598 ncp_unlock_server(server); 604 ncp_unlock_server(server);
599 if (error < 0) 605 if (error < 0)
600 goto out_packet; 606 goto out_rxbuf;
601 DPRINTK("ncp_fill_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb)); 607 DPRINTK("ncp_fill_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb));
602 608
603 error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */ 609 error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */
@@ -666,8 +672,12 @@ out_disconnect:
666 ncp_lock_server(server); 672 ncp_lock_server(server);
667 ncp_disconnect(server); 673 ncp_disconnect(server);
668 ncp_unlock_server(server); 674 ncp_unlock_server(server);
669out_packet: 675out_rxbuf:
670 ncp_stop_tasks(server); 676 ncp_stop_tasks(server);
677 vfree(server->rxbuf);
678out_txbuf:
679 vfree(server->txbuf);
680out_packet:
671 vfree(server->packet); 681 vfree(server->packet);
672out_nls: 682out_nls:
673#ifdef CONFIG_NCPFS_NLS 683#ifdef CONFIG_NCPFS_NLS
@@ -723,6 +733,8 @@ static void ncp_put_super(struct super_block *sb)
723 733
724 kfree(server->priv.data); 734 kfree(server->priv.data);
725 kfree(server->auth.object_name); 735 kfree(server->auth.object_name);
736 vfree(server->rxbuf);
737 vfree(server->txbuf);
726 vfree(server->packet); 738 vfree(server->packet);
727 sb->s_fs_info = NULL; 739 sb->s_fs_info = NULL;
728 kfree(server); 740 kfree(server);
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c
index e496d8b65e92..e37df8d5fe70 100644
--- a/fs/ncpfs/sock.c
+++ b/fs/ncpfs/sock.c
@@ -14,6 +14,7 @@
14#include <linux/socket.h> 14#include <linux/socket.h>
15#include <linux/fcntl.h> 15#include <linux/fcntl.h>
16#include <linux/stat.h> 16#include <linux/stat.h>
17#include <linux/string.h>
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
18#include <linux/in.h> 19#include <linux/in.h>
19#include <linux/net.h> 20#include <linux/net.h>
@@ -55,10 +56,11 @@ static int _send(struct socket *sock, const void *buff, int len)
55struct ncp_request_reply { 56struct ncp_request_reply {
56 struct list_head req; 57 struct list_head req;
57 wait_queue_head_t wq; 58 wait_queue_head_t wq;
58 struct ncp_reply_header* reply_buf; 59 atomic_t refs;
60 unsigned char* reply_buf;
59 size_t datalen; 61 size_t datalen;
60 int result; 62 int result;
61 enum { RQ_DONE, RQ_INPROGRESS, RQ_QUEUED, RQ_IDLE } status; 63 enum { RQ_DONE, RQ_INPROGRESS, RQ_QUEUED, RQ_IDLE, RQ_ABANDONED } status;
62 struct kvec* tx_ciov; 64 struct kvec* tx_ciov;
63 size_t tx_totallen; 65 size_t tx_totallen;
64 size_t tx_iovlen; 66 size_t tx_iovlen;
@@ -67,6 +69,32 @@ struct ncp_request_reply {
67 u_int32_t sign[6]; 69 u_int32_t sign[6];
68}; 70};
69 71
72static inline struct ncp_request_reply* ncp_alloc_req(void)
73{
74 struct ncp_request_reply *req;
75
76 req = kmalloc(sizeof(struct ncp_request_reply), GFP_KERNEL);
77 if (!req)
78 return NULL;
79
80 init_waitqueue_head(&req->wq);
81 atomic_set(&req->refs, (1));
82 req->status = RQ_IDLE;
83
84 return req;
85}
86
87static void ncp_req_get(struct ncp_request_reply *req)
88{
89 atomic_inc(&req->refs);
90}
91
92static void ncp_req_put(struct ncp_request_reply *req)
93{
94 if (atomic_dec_and_test(&req->refs))
95 kfree(req);
96}
97
70void ncp_tcp_data_ready(struct sock *sk, int len) 98void ncp_tcp_data_ready(struct sock *sk, int len)
71{ 99{
72 struct ncp_server *server = sk->sk_user_data; 100 struct ncp_server *server = sk->sk_user_data;
@@ -101,14 +129,17 @@ void ncpdgram_timeout_call(unsigned long v)
101 schedule_work(&server->timeout_tq); 129 schedule_work(&server->timeout_tq);
102} 130}
103 131
104static inline void ncp_finish_request(struct ncp_request_reply *req, int result) 132static inline void ncp_finish_request(struct ncp_server *server, struct ncp_request_reply *req, int result)
105{ 133{
106 req->result = result; 134 req->result = result;
135 if (req->status != RQ_ABANDONED)
136 memcpy(req->reply_buf, server->rxbuf, req->datalen);
107 req->status = RQ_DONE; 137 req->status = RQ_DONE;
108 wake_up_all(&req->wq); 138 wake_up_all(&req->wq);
139 ncp_req_put(req);
109} 140}
110 141
111static void __abort_ncp_connection(struct ncp_server *server, struct ncp_request_reply *aborted, int err) 142static void __abort_ncp_connection(struct ncp_server *server)
112{ 143{
113 struct ncp_request_reply *req; 144 struct ncp_request_reply *req;
114 145
@@ -118,31 +149,19 @@ static void __abort_ncp_connection(struct ncp_server *server, struct ncp_request
118 req = list_entry(server->tx.requests.next, struct ncp_request_reply, req); 149 req = list_entry(server->tx.requests.next, struct ncp_request_reply, req);
119 150
120 list_del_init(&req->req); 151 list_del_init(&req->req);
121 if (req == aborted) { 152 ncp_finish_request(server, req, -EIO);
122 ncp_finish_request(req, err);
123 } else {
124 ncp_finish_request(req, -EIO);
125 }
126 } 153 }
127 req = server->rcv.creq; 154 req = server->rcv.creq;
128 if (req) { 155 if (req) {
129 server->rcv.creq = NULL; 156 server->rcv.creq = NULL;
130 if (req == aborted) { 157 ncp_finish_request(server, req, -EIO);
131 ncp_finish_request(req, err);
132 } else {
133 ncp_finish_request(req, -EIO);
134 }
135 server->rcv.ptr = NULL; 158 server->rcv.ptr = NULL;
136 server->rcv.state = 0; 159 server->rcv.state = 0;
137 } 160 }
138 req = server->tx.creq; 161 req = server->tx.creq;
139 if (req) { 162 if (req) {
140 server->tx.creq = NULL; 163 server->tx.creq = NULL;
141 if (req == aborted) { 164 ncp_finish_request(server, req, -EIO);
142 ncp_finish_request(req, err);
143 } else {
144 ncp_finish_request(req, -EIO);
145 }
146 } 165 }
147} 166}
148 167
@@ -160,10 +179,12 @@ static inline void __ncp_abort_request(struct ncp_server *server, struct ncp_req
160 break; 179 break;
161 case RQ_QUEUED: 180 case RQ_QUEUED:
162 list_del_init(&req->req); 181 list_del_init(&req->req);
163 ncp_finish_request(req, err); 182 ncp_finish_request(server, req, err);
164 break; 183 break;
165 case RQ_INPROGRESS: 184 case RQ_INPROGRESS:
166 __abort_ncp_connection(server, req, err); 185 req->status = RQ_ABANDONED;
186 break;
187 case RQ_ABANDONED:
167 break; 188 break;
168 } 189 }
169} 190}
@@ -177,7 +198,7 @@ static inline void ncp_abort_request(struct ncp_server *server, struct ncp_reque
177 198
178static inline void __ncptcp_abort(struct ncp_server *server) 199static inline void __ncptcp_abort(struct ncp_server *server)
179{ 200{
180 __abort_ncp_connection(server, NULL, 0); 201 __abort_ncp_connection(server);
181} 202}
182 203
183static int ncpdgram_send(struct socket *sock, struct ncp_request_reply *req) 204static int ncpdgram_send(struct socket *sock, struct ncp_request_reply *req)
@@ -294,6 +315,11 @@ static void ncptcp_start_request(struct ncp_server *server, struct ncp_request_r
294 315
295static inline void __ncp_start_request(struct ncp_server *server, struct ncp_request_reply *req) 316static inline void __ncp_start_request(struct ncp_server *server, struct ncp_request_reply *req)
296{ 317{
318 /* we copy the data so that we do not depend on the caller
319 staying alive */
320 memcpy(server->txbuf, req->tx_iov[1].iov_base, req->tx_iov[1].iov_len);
321 req->tx_iov[1].iov_base = server->txbuf;
322
297 if (server->ncp_sock->type == SOCK_STREAM) 323 if (server->ncp_sock->type == SOCK_STREAM)
298 ncptcp_start_request(server, req); 324 ncptcp_start_request(server, req);
299 else 325 else
@@ -308,6 +334,7 @@ static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *
308 printk(KERN_ERR "ncpfs: tcp: Server died\n"); 334 printk(KERN_ERR "ncpfs: tcp: Server died\n");
309 return -EIO; 335 return -EIO;
310 } 336 }
337 ncp_req_get(req);
311 if (server->tx.creq || server->rcv.creq) { 338 if (server->tx.creq || server->rcv.creq) {
312 req->status = RQ_QUEUED; 339 req->status = RQ_QUEUED;
313 list_add_tail(&req->req, &server->tx.requests); 340 list_add_tail(&req->req, &server->tx.requests);
@@ -409,7 +436,7 @@ void ncpdgram_rcv_proc(struct work_struct *work)
409 server->timeout_last = NCP_MAX_RPC_TIMEOUT; 436 server->timeout_last = NCP_MAX_RPC_TIMEOUT;
410 mod_timer(&server->timeout_tm, jiffies + NCP_MAX_RPC_TIMEOUT); 437 mod_timer(&server->timeout_tm, jiffies + NCP_MAX_RPC_TIMEOUT);
411 } else if (reply.type == NCP_REPLY) { 438 } else if (reply.type == NCP_REPLY) {
412 result = _recv(sock, (void*)req->reply_buf, req->datalen, MSG_DONTWAIT); 439 result = _recv(sock, server->rxbuf, req->datalen, MSG_DONTWAIT);
413#ifdef CONFIG_NCPFS_PACKET_SIGNING 440#ifdef CONFIG_NCPFS_PACKET_SIGNING
414 if (result >= 0 && server->sign_active && req->tx_type != NCP_DEALLOC_SLOT_REQUEST) { 441 if (result >= 0 && server->sign_active && req->tx_type != NCP_DEALLOC_SLOT_REQUEST) {
415 if (result < 8 + 8) { 442 if (result < 8 + 8) {
@@ -419,7 +446,7 @@ void ncpdgram_rcv_proc(struct work_struct *work)
419 446
420 result -= 8; 447 result -= 8;
421 hdrl = sock->sk->sk_family == AF_INET ? 8 : 6; 448 hdrl = sock->sk->sk_family == AF_INET ? 8 : 6;
422 if (sign_verify_reply(server, ((char*)req->reply_buf) + hdrl, result - hdrl, cpu_to_le32(result), ((char*)req->reply_buf) + result)) { 449 if (sign_verify_reply(server, server->rxbuf + hdrl, result - hdrl, cpu_to_le32(result), server->rxbuf + result)) {
423 printk(KERN_INFO "ncpfs: Signature violation\n"); 450 printk(KERN_INFO "ncpfs: Signature violation\n");
424 result = -EIO; 451 result = -EIO;
425 } 452 }
@@ -428,7 +455,7 @@ void ncpdgram_rcv_proc(struct work_struct *work)
428#endif 455#endif
429 del_timer(&server->timeout_tm); 456 del_timer(&server->timeout_tm);
430 server->rcv.creq = NULL; 457 server->rcv.creq = NULL;
431 ncp_finish_request(req, result); 458 ncp_finish_request(server, req, result);
432 __ncp_next_request(server); 459 __ncp_next_request(server);
433 mutex_unlock(&server->rcv.creq_mutex); 460 mutex_unlock(&server->rcv.creq_mutex);
434 continue; 461 continue;
@@ -478,12 +505,6 @@ void ncpdgram_timeout_proc(struct work_struct *work)
478 mutex_unlock(&server->rcv.creq_mutex); 505 mutex_unlock(&server->rcv.creq_mutex);
479} 506}
480 507
481static inline void ncp_init_req(struct ncp_request_reply* req)
482{
483 init_waitqueue_head(&req->wq);
484 req->status = RQ_IDLE;
485}
486
487static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len) 508static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len)
488{ 509{
489 int result; 510 int result;
@@ -601,8 +622,8 @@ skipdata:;
601 goto skipdata; 622 goto skipdata;
602 } 623 }
603 req->datalen = datalen - 8; 624 req->datalen = datalen - 8;
604 req->reply_buf->type = NCP_REPLY; 625 ((struct ncp_reply_header*)server->rxbuf)->type = NCP_REPLY;
605 server->rcv.ptr = (unsigned char*)(req->reply_buf) + 2; 626 server->rcv.ptr = server->rxbuf + 2;
606 server->rcv.len = datalen - 10; 627 server->rcv.len = datalen - 10;
607 server->rcv.state = 1; 628 server->rcv.state = 1;
608 break; 629 break;
@@ -615,12 +636,12 @@ skipdata:;
615 case 1: 636 case 1:
616 req = server->rcv.creq; 637 req = server->rcv.creq;
617 if (req->tx_type != NCP_ALLOC_SLOT_REQUEST) { 638 if (req->tx_type != NCP_ALLOC_SLOT_REQUEST) {
618 if (req->reply_buf->sequence != server->sequence) { 639 if (((struct ncp_reply_header*)server->rxbuf)->sequence != server->sequence) {
619 printk(KERN_ERR "ncpfs: tcp: Bad sequence number\n"); 640 printk(KERN_ERR "ncpfs: tcp: Bad sequence number\n");
620 __ncp_abort_request(server, req, -EIO); 641 __ncp_abort_request(server, req, -EIO);
621 return -EIO; 642 return -EIO;
622 } 643 }
623 if ((req->reply_buf->conn_low | (req->reply_buf->conn_high << 8)) != server->connection) { 644 if ((((struct ncp_reply_header*)server->rxbuf)->conn_low | (((struct ncp_reply_header*)server->rxbuf)->conn_high << 8)) != server->connection) {
624 printk(KERN_ERR "ncpfs: tcp: Connection number mismatch\n"); 645 printk(KERN_ERR "ncpfs: tcp: Connection number mismatch\n");
625 __ncp_abort_request(server, req, -EIO); 646 __ncp_abort_request(server, req, -EIO);
626 return -EIO; 647 return -EIO;
@@ -628,14 +649,14 @@ skipdata:;
628 } 649 }
629#ifdef CONFIG_NCPFS_PACKET_SIGNING 650#ifdef CONFIG_NCPFS_PACKET_SIGNING
630 if (server->sign_active && req->tx_type != NCP_DEALLOC_SLOT_REQUEST) { 651 if (server->sign_active && req->tx_type != NCP_DEALLOC_SLOT_REQUEST) {
631 if (sign_verify_reply(server, (unsigned char*)(req->reply_buf) + 6, req->datalen - 6, cpu_to_be32(req->datalen + 16), &server->rcv.buf.type)) { 652 if (sign_verify_reply(server, server->rxbuf + 6, req->datalen - 6, cpu_to_be32(req->datalen + 16), &server->rcv.buf.type)) {
632 printk(KERN_ERR "ncpfs: tcp: Signature violation\n"); 653 printk(KERN_ERR "ncpfs: tcp: Signature violation\n");
633 __ncp_abort_request(server, req, -EIO); 654 __ncp_abort_request(server, req, -EIO);
634 return -EIO; 655 return -EIO;
635 } 656 }
636 } 657 }
637#endif 658#endif
638 ncp_finish_request(req, req->datalen); 659 ncp_finish_request(server, req, req->datalen);
639 nextreq:; 660 nextreq:;
640 __ncp_next_request(server); 661 __ncp_next_request(server);
641 case 2: 662 case 2:
@@ -645,7 +666,7 @@ skipdata:;
645 server->rcv.state = 0; 666 server->rcv.state = 0;
646 break; 667 break;
647 case 3: 668 case 3:
648 ncp_finish_request(server->rcv.creq, -EIO); 669 ncp_finish_request(server, server->rcv.creq, -EIO);
649 goto nextreq; 670 goto nextreq;
650 case 5: 671 case 5:
651 info_server(server, 0, server->unexpected_packet.data, server->unexpected_packet.len); 672 info_server(server, 0, server->unexpected_packet.data, server->unexpected_packet.len);
@@ -675,28 +696,39 @@ void ncp_tcp_tx_proc(struct work_struct *work)
675} 696}
676 697
677static int do_ncp_rpc_call(struct ncp_server *server, int size, 698static int do_ncp_rpc_call(struct ncp_server *server, int size,
678 struct ncp_reply_header* reply_buf, int max_reply_size) 699 unsigned char* reply_buf, int max_reply_size)
679{ 700{
680 int result; 701 int result;
681 struct ncp_request_reply req; 702 struct ncp_request_reply *req;
682 703
683 ncp_init_req(&req); 704 req = ncp_alloc_req();
684 req.reply_buf = reply_buf; 705 if (!req)
685 req.datalen = max_reply_size; 706 return -ENOMEM;
686 req.tx_iov[1].iov_base = server->packet; 707
687 req.tx_iov[1].iov_len = size; 708 req->reply_buf = reply_buf;
688 req.tx_iovlen = 1; 709 req->datalen = max_reply_size;
689 req.tx_totallen = size; 710 req->tx_iov[1].iov_base = server->packet;
690 req.tx_type = *(u_int16_t*)server->packet; 711 req->tx_iov[1].iov_len = size;
691 712 req->tx_iovlen = 1;
692 result = ncp_add_request(server, &req); 713 req->tx_totallen = size;
693 if (result < 0) { 714 req->tx_type = *(u_int16_t*)server->packet;
694 return result; 715
695 } 716 result = ncp_add_request(server, req);
696 if (wait_event_interruptible(req.wq, req.status == RQ_DONE)) { 717 if (result < 0)
697 ncp_abort_request(server, &req, -EIO); 718 goto out;
719
720 if (wait_event_interruptible(req->wq, req->status == RQ_DONE)) {
721 ncp_abort_request(server, req, -EINTR);
722 result = -EINTR;
723 goto out;
698 } 724 }
699 return req.result; 725
726 result = req->result;
727
728out:
729 ncp_req_put(req);
730
731 return result;
700} 732}
701 733
702/* 734/*
@@ -751,11 +783,6 @@ static int ncp_do_request(struct ncp_server *server, int size,
751 783
752 DDPRINTK("do_ncp_rpc_call returned %d\n", result); 784 DDPRINTK("do_ncp_rpc_call returned %d\n", result);
753 785
754 if (result < 0) {
755 /* There was a problem with I/O, so the connections is
756 * no longer usable. */
757 ncp_invalidate_conn(server);
758 }
759 return result; 786 return result;
760} 787}
761 788
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index c2660cbfcd96..8d995bcef806 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -17,7 +17,6 @@
17#include <linux/stat.h> 17#include <linux/stat.h>
18#include <linux/dcache.h> 18#include <linux/dcache.h>
19#include <linux/mount.h> 19#include <linux/mount.h>
20#include <asm/pgtable.h>
21 20
22#include <linux/sunrpc/clnt.h> 21#include <linux/sunrpc/clnt.h>
23#include <linux/sunrpc/svc.h> 22#include <linux/sunrpc/svc.h>
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 22d38ffc9ef0..e46d237b10f9 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -180,7 +180,7 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
180 } 180 }
181 if (res > 0) 181 if (res > 0)
182 return state; 182 return state;
183 if (!err) 183 if (err)
184 /* The partition is unrecognized. So report I/O errors if there were any */ 184 /* The partition is unrecognized. So report I/O errors if there were any */
185 res = err; 185 res = err;
186 if (!res) 186 if (!res)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 01f7769da8e6..989af5e55d1b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1558,29 +1558,20 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
1558 size_t count, loff_t *ppos) 1558 size_t count, loff_t *ppos)
1559{ 1559{
1560 struct inode * inode = file->f_path.dentry->d_inode; 1560 struct inode * inode = file->f_path.dentry->d_inode;
1561 unsigned long page; 1561 char *p = NULL;
1562 ssize_t length; 1562 ssize_t length;
1563 struct task_struct *task = get_proc_task(inode); 1563 struct task_struct *task = get_proc_task(inode);
1564 1564
1565 length = -ESRCH;
1566 if (!task) 1565 if (!task)
1567 goto out_no_task; 1566 return -ESRCH;
1568
1569 if (count > PAGE_SIZE)
1570 count = PAGE_SIZE;
1571 length = -ENOMEM;
1572 if (!(page = __get_free_page(GFP_KERNEL)))
1573 goto out;
1574 1567
1575 length = security_getprocattr(task, 1568 length = security_getprocattr(task,
1576 (char*)file->f_path.dentry->d_name.name, 1569 (char*)file->f_path.dentry->d_name.name,
1577 (void*)page, count); 1570 &p);
1578 if (length >= 0)
1579 length = simple_read_from_buffer(buf, count, ppos, (char *)page, length);
1580 free_page(page);
1581out:
1582 put_task_struct(task); 1571 put_task_struct(task);
1583out_no_task: 1572 if (length > 0)
1573 length = simple_read_from_buffer(buf, count, ppos, p, length);
1574 kfree(p);
1584 return length; 1575 return length;
1585} 1576}
1586 1577
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 8813990304fe..85a668680f82 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -431,6 +431,8 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent)
431 new_parent_dentry = new_parent ? 431 new_parent_dentry = new_parent ?
432 new_parent->dentry : sysfs_mount->mnt_sb->s_root; 432 new_parent->dentry : sysfs_mount->mnt_sb->s_root;
433 433
434 if (old_parent_dentry->d_inode == new_parent_dentry->d_inode)
435 return 0; /* nothing to move */
434again: 436again:
435 mutex_lock(&old_parent_dentry->d_inode->i_mutex); 437 mutex_lock(&old_parent_dentry->d_inode->i_mutex);
436 if (!mutex_trylock(&new_parent_dentry->d_inode->i_mutex)) { 438 if (!mutex_trylock(&new_parent_dentry->d_inode->i_mutex)) {
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index dd1344b007f5..ccb7d722c558 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -227,11 +227,8 @@ static inline void orphan_all_buffers(struct inode *node)
227 227
228 mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); 228 mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD);
229 if (node->i_private) { 229 if (node->i_private) {
230 list_for_each_entry(buf, &set->associates, associates) { 230 list_for_each_entry(buf, &set->associates, associates)
231 down(&buf->sem);
232 buf->orphaned = 1; 231 buf->orphaned = 1;
233 up(&buf->sem);
234 }
235 } 232 }
236 mutex_unlock(&node->i_mutex); 233 mutex_unlock(&node->i_mutex);
237} 234}
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
index 9444958bec1e..ed35e5c94f40 100644
--- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
+++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
@@ -144,9 +144,9 @@
144#define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) 144#define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000)
145#define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) 145#define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000)
146#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) 146#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000)
147#define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000) 147#define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x6000)
148#define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000) 148#define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x7000)
149#define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000) 149#define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x8000)
150#define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) 150#define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000)
151#define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) 151#define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000)
152#define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) 152#define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000)
diff --git a/include/asm-arm/arch-lh7a40x/entry-macro.S b/include/asm-arm/arch-lh7a40x/entry-macro.S
index 502700604e00..ffe397250f0c 100644
--- a/include/asm-arm/arch-lh7a40x/entry-macro.S
+++ b/include/asm-arm/arch-lh7a40x/entry-macro.S
@@ -86,6 +86,12 @@ branch_irq_lh7a400: b 1000f
86 .macro disable_fiq 86 .macro disable_fiq
87 .endm 87 .endm
88 88
89 .macro get_irqnr_preamble, base, tmp
90 .endm
91
92 .macro arch_ret_to_user, tmp1, tmp2
93 .endm
94
89 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 95 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
90 mov \irqnr, #0 96 mov \irqnr, #0
91 mov \base, #io_p2v(0x80000000) @ APB registers 97 mov \base, #io_p2v(0x80000000) @ APB registers
@@ -105,6 +111,12 @@ branch_irq_lh7a400: b 1000f
105 .macro disable_fiq 111 .macro disable_fiq
106 .endm 112 .endm
107 113
114 .macro get_irqnr_preamble, base, tmp
115 .endm
116
117 .macro arch_ret_to_user, tmp1, tmp2
118 .endm
119
108 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 120 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
109 mov \irqnr, #0 @ VIC1 irq base 121 mov \irqnr, #0 @ VIC1 irq base
110 mov \base, #io_p2v(0x80000000) @ APB registers 122 mov \base, #io_p2v(0x80000000) @ APB registers
diff --git a/include/asm-avr32/Kbuild b/include/asm-avr32/Kbuild
index 8770e73ce938..3136628ba8d2 100644
--- a/include/asm-avr32/Kbuild
+++ b/include/asm-avr32/Kbuild
@@ -1,3 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3headers-y += cachectl.h 3header-y += cachectl.h
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h
index 115813e48fe0..21bb60bbb9a1 100644
--- a/include/asm-avr32/dma-mapping.h
+++ b/include/asm-avr32/dma-mapping.h
@@ -274,6 +274,24 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
274 dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction); 274 dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction);
275} 275}
276 276
277static inline void
278dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
279 unsigned long offset, size_t size,
280 enum dma_data_direction direction)
281{
282 /* just sync everything, that's all the pci API can do */
283 dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction);
284}
285
286static inline void
287dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
288 unsigned long offset, size_t size,
289 enum dma_data_direction direction)
290{
291 /* just sync everything, that's all the pci API can do */
292 dma_sync_single_for_device(dev, dma_handle, offset+size, direction);
293}
294
277/** 295/**
278 * dma_sync_sg_for_cpu 296 * dma_sync_sg_for_cpu
279 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices 297 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
index b55052ce2330..a96b5d986b6e 100644
--- a/include/asm-generic/page.h
+++ b/include/asm-generic/page.h
@@ -4,51 +4,21 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
6 6
7#include <linux/log2.h> 7#include <linux/compiler.h>
8 8
9/* 9/* Pure 2^n version of get_order */
10 * non-const pure 2^n version of get_order 10static __inline__ __attribute_const__ int get_order(unsigned long size)
11 * - the arch may override these in asm/bitops.h if they can be implemented
12 * more efficiently than using the arch log2 routines
13 * - we use the non-const log2() instead if the arch has defined one suitable
14 */
15#ifndef ARCH_HAS_GET_ORDER
16static inline __attribute__((const))
17int __get_order(unsigned long size, int page_shift)
18{ 11{
19#if BITS_PER_LONG == 32 && defined(ARCH_HAS_ILOG2_U32)
20 int order = __ilog2_u32(size) - page_shift;
21 return order >= 0 ? order : 0;
22#elif BITS_PER_LONG == 64 && defined(ARCH_HAS_ILOG2_U64)
23 int order = __ilog2_u64(size) - page_shift;
24 return order >= 0 ? order : 0;
25#else
26 int order; 12 int order;
27 13
28 size = (size - 1) >> (page_shift - 1); 14 size = (size - 1) >> (PAGE_SHIFT - 1);
29 order = -1; 15 order = -1;
30 do { 16 do {
31 size >>= 1; 17 size >>= 1;
32 order++; 18 order++;
33 } while (size); 19 } while (size);
34 return order; 20 return order;
35#endif
36} 21}
37#endif
38
39/**
40 * get_order - calculate log2(pages) to hold a block of the specified size
41 * @n - size
42 *
43 * calculate allocation order based on the current page size
44 * - this can be used to initialise global variables from constant data
45 */
46#define get_order(n) \
47( \
48 __builtin_constant_p(n) ? \
49 ((n < (1UL << PAGE_SHIFT)) ? 0 : ilog2(n) - PAGE_SHIFT) : \
50 __get_order(n, PAGE_SHIFT) \
51 )
52 22
53#endif /* __ASSEMBLY__ */ 23#endif /* __ASSEMBLY__ */
54#endif /* __KERNEL__ */ 24#endif /* __KERNEL__ */
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h
index f8319cae2ac5..46dc34ca887a 100644
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -130,7 +130,7 @@ struct paravirt_ops
130 void (*flush_tlb_kernel)(void); 130 void (*flush_tlb_kernel)(void);
131 void (*flush_tlb_single)(u32 addr); 131 void (*flush_tlb_single)(u32 addr);
132 132
133 void (fastcall *map_pt_hook)(int type, pte_t *va, u32 pfn); 133 void (*map_pt_hook)(int type, pte_t *va, u32 pfn);
134 134
135 void (*alloc_pt)(u32 pfn); 135 void (*alloc_pt)(u32 pfn);
136 void (*alloc_pd)(u32 pfn); 136 void (*alloc_pd)(u32 pfn);
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h
index e997891cc7cc..84016ff481b9 100644
--- a/include/asm-i386/tsc.h
+++ b/include/asm-i386/tsc.h
@@ -1 +1,67 @@
1#include <asm-x86_64/tsc.h> 1/*
2 * linux/include/asm-i386/tsc.h
3 *
4 * i386 TSC related functions
5 */
6#ifndef _ASM_i386_TSC_H
7#define _ASM_i386_TSC_H
8
9#include <asm/processor.h>
10
11/*
12 * Standard way to access the cycle counter.
13 */
14typedef unsigned long long cycles_t;
15
16extern unsigned int cpu_khz;
17extern unsigned int tsc_khz;
18
19static inline cycles_t get_cycles(void)
20{
21 unsigned long long ret = 0;
22
23#ifndef CONFIG_X86_TSC
24 if (!cpu_has_tsc)
25 return 0;
26#endif
27
28#if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC)
29 rdtscll(ret);
30#endif
31 return ret;
32}
33
34/* Like get_cycles, but make sure the CPU is synchronized. */
35static __always_inline cycles_t get_cycles_sync(void)
36{
37 unsigned long long ret;
38#ifdef X86_FEATURE_SYNC_RDTSC
39 unsigned eax;
40
41 /*
42 * Don't do an additional sync on CPUs where we know
43 * RDTSC is already synchronous:
44 */
45 alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC,
46 "=a" (eax), "0" (1) : "ebx","ecx","edx","memory");
47#else
48 sync_core();
49#endif
50 rdtscll(ret);
51
52 return ret;
53}
54
55extern void tsc_init(void);
56extern void mark_tsc_unstable(void);
57extern int unsynchronized_tsc(void);
58extern void init_tsc_clocksource(void);
59
60/*
61 * Boot-time check whether the TSCs are synchronized across
62 * all CPUs/cores:
63 */
64extern void check_tsc_sync_source(int cpu);
65extern void check_tsc_sync_target(void);
66
67#endif
diff --git a/include/asm-i386/vmi_time.h b/include/asm-i386/vmi_time.h
index 1f971eb7f71e..c3a1fcf66c96 100644
--- a/include/asm-i386/vmi_time.h
+++ b/include/asm-i386/vmi_time.h
@@ -54,13 +54,21 @@ extern unsigned long vmi_cpu_khz(void);
54 54
55#ifdef CONFIG_X86_LOCAL_APIC 55#ifdef CONFIG_X86_LOCAL_APIC
56extern void __init vmi_timer_setup_boot_alarm(void); 56extern void __init vmi_timer_setup_boot_alarm(void);
57extern void __init vmi_timer_setup_secondary_alarm(void); 57extern void __devinit vmi_timer_setup_secondary_alarm(void);
58extern void apic_vmi_timer_interrupt(void); 58extern void apic_vmi_timer_interrupt(void);
59#endif 59#endif
60 60
61#ifdef CONFIG_NO_IDLE_HZ 61#ifdef CONFIG_NO_IDLE_HZ
62extern int vmi_stop_hz_timer(void); 62extern int vmi_stop_hz_timer(void);
63extern void vmi_account_time_restart_hz_timer(void); 63extern void vmi_account_time_restart_hz_timer(void);
64#else
65static inline int vmi_stop_hz_timer(void)
66{
67 return 0;
68}
69static inline void vmi_account_time_restart_hz_timer(void)
70{
71}
64#endif 72#endif
65 73
66/* 74/*
diff --git a/include/asm-ia64/kexec.h b/include/asm-ia64/kexec.h
index f2ad469a6ddf..41299ddfee30 100644
--- a/include/asm-ia64/kexec.h
+++ b/include/asm-ia64/kexec.h
@@ -22,7 +22,6 @@
22 } while(0) 22 } while(0)
23 23
24extern struct kimage *ia64_kimage; 24extern struct kimage *ia64_kimage;
25DECLARE_PER_CPU(u64, ia64_mca_pal_base);
26extern const unsigned int relocate_new_kernel_size; 25extern const unsigned int relocate_new_kernel_size;
27extern void relocate_new_kernel(unsigned long, unsigned long, 26extern void relocate_new_kernel(unsigned long, unsigned long,
28 struct ia64_boot_param *, unsigned long); 27 struct ia64_boot_param *, unsigned long);
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
index ee97f7c2d462..41098f459684 100644
--- a/include/asm-ia64/mca.h
+++ b/include/asm-ia64/mca.h
@@ -156,6 +156,8 @@ struct ia64_mca_notify_die {
156 int *monarch_cpu; 156 int *monarch_cpu;
157}; 157};
158 158
159DECLARE_PER_CPU(u64, ia64_mca_pal_base);
160
159#else /* __ASSEMBLY__ */ 161#else /* __ASSEMBLY__ */
160 162
161#define IA64_MCA_CORRECTED 0x0 /* Error has been corrected by OS_MCA */ 163#define IA64_MCA_CORRECTED 0x0 /* Error has been corrected by OS_MCA */
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
index 6dd476b652c6..21ec5f3d23de 100644
--- a/include/asm-ia64/meminit.h
+++ b/include/asm-ia64/meminit.h
@@ -17,10 +17,11 @@
17 * - kernel code & data 17 * - kernel code & data
18 * - crash dumping code reserved region 18 * - crash dumping code reserved region
19 * - Kernel memory map built from EFI memory map 19 * - Kernel memory map built from EFI memory map
20 * - ELF core header
20 * 21 *
21 * More could be added if necessary 22 * More could be added if necessary
22 */ 23 */
23#define IA64_MAX_RSVD_REGIONS 7 24#define IA64_MAX_RSVD_REGIONS 8
24 25
25struct rsvd_region { 26struct rsvd_region {
26 unsigned long start; /* virtual address of beginning of element */ 27 unsigned long start; /* virtual address of beginning of element */
@@ -36,6 +37,9 @@ extern void find_initrd (void);
36extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg); 37extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
37extern void efi_memmap_init(unsigned long *, unsigned long *); 38extern void efi_memmap_init(unsigned long *, unsigned long *);
38 39
40extern unsigned long vmcore_find_descriptor_size(unsigned long address);
41extern int reserve_elfcorehdr(unsigned long *start, unsigned long *end);
42
39/* 43/*
40 * For rounding an address to the next IA64_GRANULE_SIZE or order 44 * For rounding an address to the next IA64_GRANULE_SIZE or order
41 */ 45 */
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index e43021a99a20..67656ce767c2 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -371,6 +371,7 @@ typedef u64 pal_mc_info_index_t;
371 * dependent 371 * dependent
372 */ 372 */
373 373
374#define PAL_TLB_CHECK_OP_PURGE 8
374 375
375typedef struct pal_process_state_info_s { 376typedef struct pal_process_state_info_s {
376 u64 reserved1 : 2, 377 u64 reserved1 : 2,
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
index 5160233bbfac..5a5d1c2ce39d 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -9,6 +9,7 @@
9 9
10#include <asm/io.h> 10#include <asm/io.h>
11#include <asm/scatterlist.h> 11#include <asm/scatterlist.h>
12#include <asm/hw_irq.h>
12 13
13/* 14/*
14 * Can be used to override the logic in pci_scan_bus for skipping already-configured bus 15 * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
@@ -170,7 +171,7 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res)
170#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 171#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
171static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 172static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
172{ 173{
173 return channel ? 15 : 14; 174 return channel ? isa_irq_to_vector(15) : isa_irq_to_vector(14);
174} 175}
175 176
176#endif /* _ASM_IA64_PCI_H */ 177#endif /* _ASM_IA64_PCI_H */
diff --git a/include/asm-ia64/resource.h b/include/asm-ia64/resource.h
index 77b1eee01f30..ba2272a87fc7 100644
--- a/include/asm-ia64/resource.h
+++ b/include/asm-ia64/resource.h
@@ -2,7 +2,6 @@
2#define _ASM_IA64_RESOURCE_H 2#define _ASM_IA64_RESOURCE_H
3 3
4#include <asm/ustack.h> 4#include <asm/ustack.h>
5#define _STK_LIM_MAX DEFAULT_USER_STACK_SIZE
6#include <asm-generic/resource.h> 5#include <asm-generic/resource.h>
7 6
8#endif /* _ASM_IA64_RESOURCE_H */ 7#endif /* _ASM_IA64_RESOURCE_H */
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index d000689d9142..46cadf5aaac5 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -847,12 +847,13 @@ extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64,
847 */ 847 */
848struct sal_to_os_boot { 848struct sal_to_os_boot {
849 u64 rr[8]; /* Region Registers */ 849 u64 rr[8]; /* Region Registers */
850 u64 br[6]; /* br0: return addr into SAL boot rendez routine */ 850 u64 br[6]; /* br0:
851 * return addr into SAL boot rendez routine */
851 u64 gr1; /* SAL:GP */ 852 u64 gr1; /* SAL:GP */
852 u64 gr12; /* SAL:SP */ 853 u64 gr12; /* SAL:SP */
853 u64 gr13; /* SAL: Task Pointer */ 854 u64 gr13; /* SAL: Task Pointer */
854 u64 fpsr; 855 u64 fpsr;
855 u64 pfs; 856 u64 pfs;
856 u64 rnat; 857 u64 rnat;
857 u64 unat; 858 u64 unat;
858 u64 bspstore; 859 u64 bspstore;
diff --git a/include/asm-ia64/swiotlb.h b/include/asm-ia64/swiotlb.h
deleted file mode 100644
index 452c162dee4e..000000000000
--- a/include/asm-ia64/swiotlb.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ASM_SWIOTLB_H
2#define _ASM_SWIOTLB_H 1
3
4#include <asm/machvec.h>
5
6#define SWIOTLB_ARCH_NEED_LATE_INIT
7#define SWIOTLB_ARCH_NEED_ALLOC
8
9#endif /* _ASM_SWIOTLB_H */
diff --git a/include/asm-ia64/unwind.h b/include/asm-ia64/unwind.h
index 5df0276b0493..1af3875f1a57 100644
--- a/include/asm-ia64/unwind.h
+++ b/include/asm-ia64/unwind.h
@@ -81,7 +81,7 @@ struct unw_frame_info {
81 struct unw_ireg { 81 struct unw_ireg {
82 unsigned long *loc; 82 unsigned long *loc;
83 struct unw_ireg_nat { 83 struct unw_ireg_nat {
84 long type : 3; /* enum unw_nat_type */ 84 unsigned long type : 3; /* enum unw_nat_type */
85 signed long off : 61; /* NaT word is at loc+nat.off */ 85 signed long off : 61; /* NaT word is at loc+nat.off */
86 } nat; 86 } nat;
87 } r4, r5, r6, r7; 87 } r4, r5, r6, r7;
diff --git a/include/asm-m32r/dma-mapping.h b/include/asm-m32r/dma-mapping.h
index a7fa0302bda7..f9b58ebba361 100644
--- a/include/asm-m32r/dma-mapping.h
+++ b/include/asm-m32r/dma-mapping.h
@@ -1,23 +1,6 @@
1#ifndef _ASM_M32R_DMA_MAPPING_H 1#ifndef _ASM_M32R_DMA_MAPPING_H
2#define _ASM_M32R_DMA_MAPPING_H 2#define _ASM_M32R_DMA_MAPPING_H
3 3
4/* 4#include <asm-generic/dma-mapping-broken.h>
5 * NOTE: Do not include <asm-generic/dma-mapping.h>
6 * Because it requires PCI stuffs, but current M32R don't provide these.
7 */
8
9static inline void *
10dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
11 gfp_t flag)
12{
13 return (void *)NULL;
14}
15
16static inline void
17dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
18 dma_addr_t dma_handle)
19{
20 return;
21}
22 5
23#endif /* _ASM_M32R_DMA_MAPPING_H */ 6#endif /* _ASM_M32R_DMA_MAPPING_H */
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h
index 00259ed6fc95..a26cdeb46a57 100644
--- a/include/asm-m68k/dma-mapping.h
+++ b/include/asm-m68k/dma-mapping.h
@@ -32,7 +32,7 @@ extern void dma_free_coherent(struct device *, size_t,
32 void *, dma_addr_t); 32 void *, dma_addr_t);
33 33
34static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, 34static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
35 dma_addr_t *handle, int flag) 35 dma_addr_t *handle, gfp_t flag)
36{ 36{
37 return dma_alloc_coherent(dev, size, handle, flag); 37 return dma_alloc_coherent(dev, size, handle, flag);
38} 38}
diff --git a/include/asm-m68k/mc146818rtc.h b/include/asm-m68k/mc146818rtc.h
index 11fe12ddb913..9f70a01f73dc 100644
--- a/include/asm-m68k/mc146818rtc.h
+++ b/include/asm-m68k/mc146818rtc.h
@@ -11,6 +11,7 @@
11#include <asm/atarihw.h> 11#include <asm/atarihw.h>
12 12
13#define RTC_PORT(x) (TT_RTC_BAS + 2*(x)) 13#define RTC_PORT(x) (TT_RTC_BAS + 2*(x))
14#define RTC_ALWAYS_BCD 0
14 15
15#define CMOS_READ(addr) ({ \ 16#define CMOS_READ(addr) ({ \
16atari_outb_p((addr),RTC_PORT(0)); \ 17atari_outb_p((addr),RTC_PORT(0)); \
diff --git a/include/asm-m68knommu/m528xsim.h b/include/asm-m68knommu/m528xsim.h
index 1a3b1ae06b1e..28bf783a5d6d 100644
--- a/include/asm-m68knommu/m528xsim.h
+++ b/include/asm-m68knommu/m528xsim.h
@@ -47,6 +47,9 @@
47/* set Port AS pin for I2C or UART */ 47/* set Port AS pin for I2C or UART */
48#define MCF5282_GPIO_PASPAR (volatile u16 *) (MCF_IPSBAR + 0x00100056) 48#define MCF5282_GPIO_PASPAR (volatile u16 *) (MCF_IPSBAR + 0x00100056)
49 49
50/* Port UA Pin Assignment Register (8 Bit) */
51#define MCF5282_GPIO_PUAPAR 0x10005C
52
50/* Interrupt Mask Register Register Low */ 53/* Interrupt Mask Register Register Low */
51#define MCF5282_INTC0_IMRL (volatile u32 *) (MCF_IPSBAR + 0x0C0C) 54#define MCF5282_INTC0_IMRL (volatile u32 *) (MCF_IPSBAR + 0x0C0C)
52/* Interrupt Control Register 7 */ 55/* Interrupt Control Register 7 */
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 89436b96ad66..8959da245cfb 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -54,6 +54,7 @@
54static inline void set_bit(unsigned long nr, volatile unsigned long *addr) 54static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
55{ 55{
56 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 56 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
57 unsigned short bit = nr & SZLONG_MASK;
57 unsigned long temp; 58 unsigned long temp;
58 59
59 if (cpu_has_llsc && R10000_LLSC_WAR) { 60 if (cpu_has_llsc && R10000_LLSC_WAR) {
@@ -65,9 +66,9 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
65 " beqzl %0, 1b \n" 66 " beqzl %0, 1b \n"
66 " .set mips0 \n" 67 " .set mips0 \n"
67 : "=&r" (temp), "=m" (*m) 68 : "=&r" (temp), "=m" (*m)
68 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 69 : "ir" (1UL << bit), "m" (*m));
69#ifdef CONFIG_CPU_MIPSR2 70#ifdef CONFIG_CPU_MIPSR2
70 } else if (__builtin_constant_p(nr)) { 71 } else if (__builtin_constant_p(bit)) {
71 __asm__ __volatile__( 72 __asm__ __volatile__(
72 "1: " __LL "%0, %1 # set_bit \n" 73 "1: " __LL "%0, %1 # set_bit \n"
73 " " __INS "%0, %4, %2, 1 \n" 74 " " __INS "%0, %4, %2, 1 \n"
@@ -77,7 +78,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
77 "2: b 1b \n" 78 "2: b 1b \n"
78 " .previous \n" 79 " .previous \n"
79 : "=&r" (temp), "=m" (*m) 80 : "=&r" (temp), "=m" (*m)
80 : "ir" (nr & SZLONG_MASK), "m" (*m), "r" (~0)); 81 : "ir" (bit), "m" (*m), "r" (~0));
81#endif /* CONFIG_CPU_MIPSR2 */ 82#endif /* CONFIG_CPU_MIPSR2 */
82 } else if (cpu_has_llsc) { 83 } else if (cpu_has_llsc) {
83 __asm__ __volatile__( 84 __asm__ __volatile__(
@@ -91,14 +92,14 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
91 " .previous \n" 92 " .previous \n"
92 " .set mips0 \n" 93 " .set mips0 \n"
93 : "=&r" (temp), "=m" (*m) 94 : "=&r" (temp), "=m" (*m)
94 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 95 : "ir" (1UL << bit), "m" (*m));
95 } else { 96 } else {
96 volatile unsigned long *a = addr; 97 volatile unsigned long *a = addr;
97 unsigned long mask; 98 unsigned long mask;
98 unsigned long flags; 99 unsigned long flags;
99 100
100 a += nr >> SZLONG_LOG; 101 a += nr >> SZLONG_LOG;
101 mask = 1UL << (nr & SZLONG_MASK); 102 mask = 1UL << bit;
102 local_irq_save(flags); 103 local_irq_save(flags);
103 *a |= mask; 104 *a |= mask;
104 local_irq_restore(flags); 105 local_irq_restore(flags);
@@ -118,6 +119,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
118static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) 119static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
119{ 120{
120 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 121 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
122 unsigned short bit = nr & SZLONG_MASK;
121 unsigned long temp; 123 unsigned long temp;
122 124
123 if (cpu_has_llsc && R10000_LLSC_WAR) { 125 if (cpu_has_llsc && R10000_LLSC_WAR) {
@@ -129,9 +131,9 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
129 " beqzl %0, 1b \n" 131 " beqzl %0, 1b \n"
130 " .set mips0 \n" 132 " .set mips0 \n"
131 : "=&r" (temp), "=m" (*m) 133 : "=&r" (temp), "=m" (*m)
132 : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); 134 : "ir" (~(1UL << bit)), "m" (*m));
133#ifdef CONFIG_CPU_MIPSR2 135#ifdef CONFIG_CPU_MIPSR2
134 } else if (__builtin_constant_p(nr)) { 136 } else if (__builtin_constant_p(bit)) {
135 __asm__ __volatile__( 137 __asm__ __volatile__(
136 "1: " __LL "%0, %1 # clear_bit \n" 138 "1: " __LL "%0, %1 # clear_bit \n"
137 " " __INS "%0, $0, %2, 1 \n" 139 " " __INS "%0, $0, %2, 1 \n"
@@ -141,7 +143,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
141 "2: b 1b \n" 143 "2: b 1b \n"
142 " .previous \n" 144 " .previous \n"
143 : "=&r" (temp), "=m" (*m) 145 : "=&r" (temp), "=m" (*m)
144 : "ir" (nr & SZLONG_MASK), "m" (*m)); 146 : "ir" (bit), "m" (*m));
145#endif /* CONFIG_CPU_MIPSR2 */ 147#endif /* CONFIG_CPU_MIPSR2 */
146 } else if (cpu_has_llsc) { 148 } else if (cpu_has_llsc) {
147 __asm__ __volatile__( 149 __asm__ __volatile__(
@@ -155,14 +157,14 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
155 " .previous \n" 157 " .previous \n"
156 " .set mips0 \n" 158 " .set mips0 \n"
157 : "=&r" (temp), "=m" (*m) 159 : "=&r" (temp), "=m" (*m)
158 : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); 160 : "ir" (~(1UL << bit)), "m" (*m));
159 } else { 161 } else {
160 volatile unsigned long *a = addr; 162 volatile unsigned long *a = addr;
161 unsigned long mask; 163 unsigned long mask;
162 unsigned long flags; 164 unsigned long flags;
163 165
164 a += nr >> SZLONG_LOG; 166 a += nr >> SZLONG_LOG;
165 mask = 1UL << (nr & SZLONG_MASK); 167 mask = 1UL << bit;
166 local_irq_save(flags); 168 local_irq_save(flags);
167 *a &= ~mask; 169 *a &= ~mask;
168 local_irq_restore(flags); 170 local_irq_restore(flags);
@@ -180,6 +182,8 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
180 */ 182 */
181static inline void change_bit(unsigned long nr, volatile unsigned long *addr) 183static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
182{ 184{
185 unsigned short bit = nr & SZLONG_MASK;
186
183 if (cpu_has_llsc && R10000_LLSC_WAR) { 187 if (cpu_has_llsc && R10000_LLSC_WAR) {
184 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 188 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
185 unsigned long temp; 189 unsigned long temp;
@@ -192,7 +196,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
192 " beqzl %0, 1b \n" 196 " beqzl %0, 1b \n"
193 " .set mips0 \n" 197 " .set mips0 \n"
194 : "=&r" (temp), "=m" (*m) 198 : "=&r" (temp), "=m" (*m)
195 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 199 : "ir" (1UL << bit), "m" (*m));
196 } else if (cpu_has_llsc) { 200 } else if (cpu_has_llsc) {
197 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 201 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
198 unsigned long temp; 202 unsigned long temp;
@@ -208,14 +212,14 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
208 " .previous \n" 212 " .previous \n"
209 " .set mips0 \n" 213 " .set mips0 \n"
210 : "=&r" (temp), "=m" (*m) 214 : "=&r" (temp), "=m" (*m)
211 : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); 215 : "ir" (1UL << bit), "m" (*m));
212 } else { 216 } else {
213 volatile unsigned long *a = addr; 217 volatile unsigned long *a = addr;
214 unsigned long mask; 218 unsigned long mask;
215 unsigned long flags; 219 unsigned long flags;
216 220
217 a += nr >> SZLONG_LOG; 221 a += nr >> SZLONG_LOG;
218 mask = 1UL << (nr & SZLONG_MASK); 222 mask = 1UL << bit;
219 local_irq_save(flags); 223 local_irq_save(flags);
220 *a ^= mask; 224 *a ^= mask;
221 local_irq_restore(flags); 225 local_irq_restore(flags);
@@ -233,6 +237,8 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
233static inline int test_and_set_bit(unsigned long nr, 237static inline int test_and_set_bit(unsigned long nr,
234 volatile unsigned long *addr) 238 volatile unsigned long *addr)
235{ 239{
240 unsigned short bit = nr & SZLONG_MASK;
241
236 if (cpu_has_llsc && R10000_LLSC_WAR) { 242 if (cpu_has_llsc && R10000_LLSC_WAR) {
237 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 243 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
238 unsigned long temp, res; 244 unsigned long temp, res;
@@ -246,7 +252,7 @@ static inline int test_and_set_bit(unsigned long nr,
246 " and %2, %0, %3 \n" 252 " and %2, %0, %3 \n"
247 " .set mips0 \n" 253 " .set mips0 \n"
248 : "=&r" (temp), "=m" (*m), "=&r" (res) 254 : "=&r" (temp), "=m" (*m), "=&r" (res)
249 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 255 : "r" (1UL << bit), "m" (*m)
250 : "memory"); 256 : "memory");
251 257
252 return res != 0; 258 return res != 0;
@@ -269,7 +275,7 @@ static inline int test_and_set_bit(unsigned long nr,
269 " .previous \n" 275 " .previous \n"
270 " .set pop \n" 276 " .set pop \n"
271 : "=&r" (temp), "=m" (*m), "=&r" (res) 277 : "=&r" (temp), "=m" (*m), "=&r" (res)
272 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 278 : "r" (1UL << bit), "m" (*m)
273 : "memory"); 279 : "memory");
274 280
275 return res != 0; 281 return res != 0;
@@ -280,7 +286,7 @@ static inline int test_and_set_bit(unsigned long nr,
280 unsigned long flags; 286 unsigned long flags;
281 287
282 a += nr >> SZLONG_LOG; 288 a += nr >> SZLONG_LOG;
283 mask = 1UL << (nr & SZLONG_MASK); 289 mask = 1UL << bit;
284 local_irq_save(flags); 290 local_irq_save(flags);
285 retval = (mask & *a) != 0; 291 retval = (mask & *a) != 0;
286 *a |= mask; 292 *a |= mask;
@@ -303,6 +309,8 @@ static inline int test_and_set_bit(unsigned long nr,
303static inline int test_and_clear_bit(unsigned long nr, 309static inline int test_and_clear_bit(unsigned long nr,
304 volatile unsigned long *addr) 310 volatile unsigned long *addr)
305{ 311{
312 unsigned short bit = nr & SZLONG_MASK;
313
306 if (cpu_has_llsc && R10000_LLSC_WAR) { 314 if (cpu_has_llsc && R10000_LLSC_WAR) {
307 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 315 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
308 unsigned long temp, res; 316 unsigned long temp, res;
@@ -317,7 +325,7 @@ static inline int test_and_clear_bit(unsigned long nr,
317 " and %2, %0, %3 \n" 325 " and %2, %0, %3 \n"
318 " .set mips0 \n" 326 " .set mips0 \n"
319 : "=&r" (temp), "=m" (*m), "=&r" (res) 327 : "=&r" (temp), "=m" (*m), "=&r" (res)
320 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 328 : "r" (1UL << bit), "m" (*m)
321 : "memory"); 329 : "memory");
322 330
323 return res != 0; 331 return res != 0;
@@ -336,7 +344,7 @@ static inline int test_and_clear_bit(unsigned long nr,
336 "2: b 1b \n" 344 "2: b 1b \n"
337 " .previous \n" 345 " .previous \n"
338 : "=&r" (temp), "=m" (*m), "=&r" (res) 346 : "=&r" (temp), "=m" (*m), "=&r" (res)
339 : "ri" (nr & SZLONG_MASK), "m" (*m) 347 : "ri" (bit), "m" (*m)
340 : "memory"); 348 : "memory");
341 349
342 return res; 350 return res;
@@ -361,7 +369,7 @@ static inline int test_and_clear_bit(unsigned long nr,
361 " .previous \n" 369 " .previous \n"
362 " .set pop \n" 370 " .set pop \n"
363 : "=&r" (temp), "=m" (*m), "=&r" (res) 371 : "=&r" (temp), "=m" (*m), "=&r" (res)
364 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 372 : "r" (1UL << bit), "m" (*m)
365 : "memory"); 373 : "memory");
366 374
367 return res != 0; 375 return res != 0;
@@ -372,7 +380,7 @@ static inline int test_and_clear_bit(unsigned long nr,
372 unsigned long flags; 380 unsigned long flags;
373 381
374 a += nr >> SZLONG_LOG; 382 a += nr >> SZLONG_LOG;
375 mask = 1UL << (nr & SZLONG_MASK); 383 mask = 1UL << bit;
376 local_irq_save(flags); 384 local_irq_save(flags);
377 retval = (mask & *a) != 0; 385 retval = (mask & *a) != 0;
378 *a &= ~mask; 386 *a &= ~mask;
@@ -395,6 +403,8 @@ static inline int test_and_clear_bit(unsigned long nr,
395static inline int test_and_change_bit(unsigned long nr, 403static inline int test_and_change_bit(unsigned long nr,
396 volatile unsigned long *addr) 404 volatile unsigned long *addr)
397{ 405{
406 unsigned short bit = nr & SZLONG_MASK;
407
398 if (cpu_has_llsc && R10000_LLSC_WAR) { 408 if (cpu_has_llsc && R10000_LLSC_WAR) {
399 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 409 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
400 unsigned long temp, res; 410 unsigned long temp, res;
@@ -408,7 +418,7 @@ static inline int test_and_change_bit(unsigned long nr,
408 " and %2, %0, %3 \n" 418 " and %2, %0, %3 \n"
409 " .set mips0 \n" 419 " .set mips0 \n"
410 : "=&r" (temp), "=m" (*m), "=&r" (res) 420 : "=&r" (temp), "=m" (*m), "=&r" (res)
411 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 421 : "r" (1UL << bit), "m" (*m)
412 : "memory"); 422 : "memory");
413 423
414 return res != 0; 424 return res != 0;
@@ -431,7 +441,7 @@ static inline int test_and_change_bit(unsigned long nr,
431 " .previous \n" 441 " .previous \n"
432 " .set pop \n" 442 " .set pop \n"
433 : "=&r" (temp), "=m" (*m), "=&r" (res) 443 : "=&r" (temp), "=m" (*m), "=&r" (res)
434 : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) 444 : "r" (1UL << bit), "m" (*m)
435 : "memory"); 445 : "memory");
436 446
437 return res != 0; 447 return res != 0;
@@ -441,7 +451,7 @@ static inline int test_and_change_bit(unsigned long nr,
441 unsigned long flags; 451 unsigned long flags;
442 452
443 a += nr >> SZLONG_LOG; 453 a += nr >> SZLONG_LOG;
444 mask = 1UL << (nr & SZLONG_MASK); 454 mask = 1UL << bit;
445 local_irq_save(flags); 455 local_irq_save(flags);
446 retval = (mask & *a) != 0; 456 retval = (mask & *a) != 0;
447 *a ^= mask; 457 *a ^= mask;
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h
index e06ef0776d48..833437d31ef1 100644
--- a/include/asm-mips/dma.h
+++ b/include/asm-mips/dma.h
@@ -74,7 +74,7 @@
74 * 74 *
75 */ 75 */
76 76
77#ifndef GENERIC_ISA_DMA_SUPPORT_BROKEN 77#ifndef CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN
78#define MAX_DMA_CHANNELS 8 78#define MAX_DMA_CHANNELS 8
79#endif 79#endif
80 80
diff --git a/include/asm-mips/mips_mt.h b/include/asm-mips/mips_mt.h
index fdfff0b8ce42..8045abc78d0f 100644
--- a/include/asm-mips/mips_mt.h
+++ b/include/asm-mips/mips_mt.h
@@ -6,6 +6,8 @@
6#ifndef __ASM_MIPS_MT_H 6#ifndef __ASM_MIPS_MT_H
7#define __ASM_MIPS_MT_H 7#define __ASM_MIPS_MT_H
8 8
9#include <linux/cpumask.h>
10
9extern cpumask_t mt_fpu_cpumask; 11extern cpumask_t mt_fpu_cpumask;
10extern unsigned long mt_fpemul_threshold; 12extern unsigned long mt_fpemul_threshold;
11 13
diff --git a/include/asm-mips/sibyte/trace_prof.h b/include/asm-mips/sibyte/trace_prof.h
deleted file mode 100644
index 557792075e9a..000000000000
--- a/include/asm-mips/sibyte/trace_prof.h
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * Copyright (C) 2001 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#ifndef __ASM_SIBYTE_TRACE_PROF_H
20#define __ASM_SIBYTE_TRACE_PROF_H
21
22#undef DBG
23#if SBPROF_TB_DEBUG
24#define DBG(a) a
25#else
26#define DBG(a)
27#endif
28
29#define SBPROF_TB_MAJOR 240
30#define DEVNAME "bcm1250_tbprof"
31
32typedef u_int64_t tb_sample_t[6*256];
33
34struct sbprof_tb {
35 int open;
36 tb_sample_t *sbprof_tbbuf;
37 int next_tb_sample;
38
39 volatile int tb_enable;
40 volatile int tb_armed;
41
42 wait_queue_head_t tb_sync;
43 wait_queue_head_t tb_read;
44};
45
46#define MAX_SAMPLE_BYTES (24*1024*1024)
47#define MAX_TBSAMPLE_BYTES (12*1024*1024)
48
49#define MAX_SAMPLES (MAX_SAMPLE_BYTES/sizeof(u_int32_t))
50#define TB_SAMPLE_SIZE (sizeof(tb_sample_t))
51#define MAX_TB_SAMPLES (MAX_TBSAMPLE_BYTES/TB_SAMPLE_SIZE)
52
53/* IOCTLs */
54#define SBPROF_ZBSTART _IOW('s', 0, int)
55#define SBPROF_ZBSTOP _IOW('s', 1, int)
56#define SBPROF_ZBWAITFULL _IOW('s', 2, int)
57
58/***************************************************************************
59 * Routines for gathering ZBbus profiles using trace buffer
60 ***************************************************************************/
61
62/* Requires: Already called zclk_timer_init with a value that won't
63 saturate 40 bits. No subsequent use of SCD performance counters
64 or trace buffer.
65 Effect: Starts gathering random ZBbus profiles using trace buffer. */
66extern int sbprof_zbprof_start(struct file *filp);
67
68/* Effect: Stops collection of ZBbus profiles */
69extern int sbprof_zbprof_stop(void);
70
71
72/***************************************************************************
73 * Routines for using 40-bit SCD cycle counter
74 *
75 * Client responsible for either handling interrupts or making sure
76 * the cycles counter never saturates, e.g., by doing
77 * zclk_timer_init(0) at least every 2^40 - 1 ZCLKs.
78 ***************************************************************************/
79
80/* Configures SCD counter 0 to count ZCLKs starting from val;
81 Configures SCD counters1,2,3 to count nothing.
82 Must not be called while gathering ZBbus profiles.
83
84unsigned long long val; */
85#define zclk_timer_init(val) \
86 __asm__ __volatile__ (".set push;" \
87 ".set mips64;" \
88 "la $8, 0xb00204c0;" /* SCD perf_cnt_cfg */ \
89 "sd %0, 0x10($8);" /* write val to counter0 */ \
90 "sd %1, 0($8);" /* config counter0 for zclks*/ \
91 ".set pop" \
92 : /* no outputs */ \
93 /* enable, counter0 */ \
94 : /* inputs */ "r"(val), "r" ((1ULL << 33) | 1ULL) \
95 : /* modifies */ "$8" )
96
97
98/* Reads SCD counter 0 and puts result in value
99 unsigned long long val; */
100#define zclk_get(val) \
101 __asm__ __volatile__ (".set push;" \
102 ".set mips64;" \
103 "la $8, 0xb00204c0;" /* SCD perf_cnt_cfg */ \
104 "ld %0, 0x10($8);" /* write val to counter0 */ \
105 ".set pop" \
106 : /* outputs */ "=r"(val) \
107 : /* inputs */ \
108 : /* modifies */ "$8" )
109
110#endif /* __ASM_SIBYTE_TRACE_PROF_H */
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h
index e1941d1b8726..44dfa4adecf3 100644
--- a/include/asm-mips/smtc.h
+++ b/include/asm-mips/smtc.h
@@ -34,6 +34,9 @@ typedef long asiduse;
34 34
35extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS]; 35extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
36 36
37struct mm_struct;
38struct task_struct;
39
37void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu); 40void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
38 41
39void smtc_flush_tlb_asid(unsigned long asid); 42void smtc_flush_tlb_asid(unsigned long asid);
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h
index 55f3419f6546..360ea6d250c7 100644
--- a/include/asm-mips/smtc_ipi.h
+++ b/include/asm-mips/smtc_ipi.h
@@ -4,6 +4,8 @@
4#ifndef __ASM_SMTC_IPI_H 4#ifndef __ASM_SMTC_IPI_H
5#define __ASM_SMTC_IPI_H 5#define __ASM_SMTC_IPI_H
6 6
7#include <linux/spinlock.h>
8
7//#define SMTC_IPI_DEBUG 9//#define SMTC_IPI_DEBUG
8 10
9#ifdef SMTC_IPI_DEBUG 11#ifdef SMTC_IPI_DEBUG
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index f1755d28a36a..35e431cd796b 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -287,7 +287,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
287 " .set noreorder # __raw_read_trylock \n" 287 " .set noreorder # __raw_read_trylock \n"
288 " li %2, 0 \n" 288 " li %2, 0 \n"
289 "1: ll %1, %3 \n" 289 "1: ll %1, %3 \n"
290 " bnez %1, 2f \n" 290 " bltz %1, 2f \n"
291 " addu %1, 1 \n" 291 " addu %1, 1 \n"
292 " sc %1, %0 \n" 292 " sc %1, %0 \n"
293 " .set reorder \n" 293 " .set reorder \n"
@@ -304,7 +304,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
304 " .set noreorder # __raw_read_trylock \n" 304 " .set noreorder # __raw_read_trylock \n"
305 " li %2, 0 \n" 305 " li %2, 0 \n"
306 "1: ll %1, %3 \n" 306 "1: ll %1, %3 \n"
307 " bnez %1, 2f \n" 307 " bltz %1, 2f \n"
308 " addu %1, 1 \n" 308 " addu %1, 1 \n"
309 " sc %1, %0 \n" 309 " sc %1, %0 \n"
310 " beqz %1, 1b \n" 310 " beqz %1, 1b \n"
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index c62c20e7b5c6..b25511787ee0 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -435,6 +435,8 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
435 __cu_len; \ 435 __cu_len; \
436}) 436})
437 437
438extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
439
438#define __copy_to_user_inatomic(to,from,n) \ 440#define __copy_to_user_inatomic(to,from,n) \
439({ \ 441({ \
440 void __user *__cu_to; \ 442 void __user *__cu_to; \
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 696cff39a1d3..2f1087b3a202 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -334,16 +334,18 @@
334#define __NR_kexec_load (__NR_Linux + 311) 334#define __NR_kexec_load (__NR_Linux + 311)
335#define __NR_getcpu (__NR_Linux + 312) 335#define __NR_getcpu (__NR_Linux + 312)
336#define __NR_epoll_pwait (__NR_Linux + 313) 336#define __NR_epoll_pwait (__NR_Linux + 313)
337#define __NR_ioprio_set (__NR_Linux + 314)
338#define __NR_ioprio_get (__NR_Linux + 315)
337 339
338/* 340/*
339 * Offset of the last Linux o32 flavoured syscall 341 * Offset of the last Linux o32 flavoured syscall
340 */ 342 */
341#define __NR_Linux_syscalls 313 343#define __NR_Linux_syscalls 315
342 344
343#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 345#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
344 346
345#define __NR_O32_Linux 4000 347#define __NR_O32_Linux 4000
346#define __NR_O32_Linux_syscalls 313 348#define __NR_O32_Linux_syscalls 315
347 349
348#if _MIPS_SIM == _MIPS_SIM_ABI64 350#if _MIPS_SIM == _MIPS_SIM_ABI64
349 351
@@ -624,16 +626,18 @@
624#define __NR_kexec_load (__NR_Linux + 270) 626#define __NR_kexec_load (__NR_Linux + 270)
625#define __NR_getcpu (__NR_Linux + 271) 627#define __NR_getcpu (__NR_Linux + 271)
626#define __NR_epoll_pwait (__NR_Linux + 272) 628#define __NR_epoll_pwait (__NR_Linux + 272)
629#define __NR_ioprio_set (__NR_Linux + 273)
630#define __NR_ioprio_get (__NR_Linux + 274)
627 631
628/* 632/*
629 * Offset of the last Linux 64-bit flavoured syscall 633 * Offset of the last Linux 64-bit flavoured syscall
630 */ 634 */
631#define __NR_Linux_syscalls 272 635#define __NR_Linux_syscalls 274
632 636
633#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 637#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
634 638
635#define __NR_64_Linux 5000 639#define __NR_64_Linux 5000
636#define __NR_64_Linux_syscalls 272 640#define __NR_64_Linux_syscalls 274
637 641
638#if _MIPS_SIM == _MIPS_SIM_NABI32 642#if _MIPS_SIM == _MIPS_SIM_NABI32
639 643
@@ -918,16 +922,18 @@
918#define __NR_kexec_load (__NR_Linux + 274) 922#define __NR_kexec_load (__NR_Linux + 274)
919#define __NR_getcpu (__NR_Linux + 275) 923#define __NR_getcpu (__NR_Linux + 275)
920#define __NR_epoll_pwait (__NR_Linux + 276) 924#define __NR_epoll_pwait (__NR_Linux + 276)
925#define __NR_ioprio_set (__NR_Linux + 277)
926#define __NR_ioprio_get (__NR_Linux + 278)
921 927
922/* 928/*
923 * Offset of the last N32 flavoured syscall 929 * Offset of the last N32 flavoured syscall
924 */ 930 */
925#define __NR_Linux_syscalls 276 931#define __NR_Linux_syscalls 278
926 932
927#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 933#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
928 934
929#define __NR_N32_Linux 6000 935#define __NR_N32_Linux 6000
930#define __NR_N32_Linux_syscalls 276 936#define __NR_N32_Linux_syscalls 278
931 937
932#ifdef __KERNEL__ 938#ifdef __KERNEL__
933 939
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h
index a0f14eea1da5..afa700ded877 100644
--- a/include/asm-powerpc/floppy.h
+++ b/include/asm-powerpc/floppy.h
@@ -178,7 +178,7 @@ static struct fd_dma_ops virt_dma_ops =
178 ._dma_setup = vdma_dma_setup 178 ._dma_setup = vdma_dma_setup
179}; 179};
180 180
181static int fd_request_dma() 181static int fd_request_dma(void)
182{ 182{
183 if (can_use_virtual_dma & 1) { 183 if (can_use_virtual_dma & 1) {
184 fd_ops = &virt_dma_ops; 184 fd_ops = &virt_dma_ops;
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 0f9f2dd24a79..31d5054be20f 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -165,6 +165,13 @@ int spu_irq_class_0_bottom(struct spu *spu);
165int spu_irq_class_1_bottom(struct spu *spu); 165int spu_irq_class_1_bottom(struct spu *spu);
166void spu_irq_setaffinity(struct spu *spu, int cpu); 166void spu_irq_setaffinity(struct spu *spu, int cpu);
167 167
168extern void spu_invalidate_slbs(struct spu *spu);
169extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
170
171/* Calls from the memory management to the SPU */
172struct mm_struct;
173extern void spu_flush_all_slbs(struct mm_struct *mm);
174
168/* system callbacks from the SPU */ 175/* system callbacks from the SPU */
169struct spu_syscall_block { 176struct spu_syscall_block {
170 u64 nr_ret; 177 u64 nr_ret;
diff --git a/include/asm-powerpc/spu_csa.h b/include/asm-powerpc/spu_csa.h
index bdbf906a767f..8aad0619eb8e 100644
--- a/include/asm-powerpc/spu_csa.h
+++ b/include/asm-powerpc/spu_csa.h
@@ -221,8 +221,6 @@ struct spu_priv2_collapsed {
221 * @spu_chnlcnt_RW: Array of saved channel counts. 221 * @spu_chnlcnt_RW: Array of saved channel counts.
222 * @spu_chnldata_RW: Array of saved channel data. 222 * @spu_chnldata_RW: Array of saved channel data.
223 * @suspend_time: Time stamp when decrementer disabled. 223 * @suspend_time: Time stamp when decrementer disabled.
224 * @slb_esid_RW: Array of saved SLB esid entries.
225 * @slb_vsid_RW: Array of saved SLB vsid entries.
226 * 224 *
227 * Structure representing the whole of the SPU 225 * Structure representing the whole of the SPU
228 * context save area (CSA). This struct contains 226 * context save area (CSA). This struct contains
@@ -245,8 +243,6 @@ struct spu_state {
245 u32 spu_mailbox_data[4]; 243 u32 spu_mailbox_data[4];
246 u32 pu_mailbox_data[1]; 244 u32 pu_mailbox_data[1];
247 unsigned long suspend_time; 245 unsigned long suspend_time;
248 u64 slb_esid_RW[8];
249 u64 slb_vsid_RW[8];
250 spinlock_t register_lock; 246 spinlock_t register_lock;
251}; 247};
252 248
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 418e5c7e972c..8d853c554631 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -304,5 +304,6 @@ SYSCALL_SPU(fchmodat)
304SYSCALL_SPU(faccessat) 304SYSCALL_SPU(faccessat)
305COMPAT_SYS_SPU(get_robust_list) 305COMPAT_SYS_SPU(get_robust_list)
306COMPAT_SYS_SPU(set_robust_list) 306COMPAT_SYS_SPU(set_robust_list)
307COMPAT_SYS(move_pages) 307COMPAT_SYS_SPU(move_pages)
308SYSCALL_SPU(getcpu) 308SYSCALL_SPU(getcpu)
309COMPAT_SYS(epoll_pwait)
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index 0ae954e3d258..2baedbe54e13 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -324,10 +324,12 @@
324#define __NR_get_robust_list 299 324#define __NR_get_robust_list 299
325#define __NR_set_robust_list 300 325#define __NR_set_robust_list 300
326#define __NR_move_pages 301 326#define __NR_move_pages 301
327#define __NR_getcpu 302
328#define __NR_epoll_pwait 303
327 329
328#ifdef __KERNEL__ 330#ifdef __KERNEL__
329 331
330#define __NR_syscalls 302 332#define __NR_syscalls 304
331 333
332#define __NR__exit __NR_exit 334#define __NR__exit __NR_exit
333#define NR_syscalls __NR_syscalls 335#define NR_syscalls __NR_syscalls
diff --git a/include/asm-s390/bugs.h b/include/asm-s390/bugs.h
index 2c3659621314..011f1e6a2a6c 100644
--- a/include/asm-s390/bugs.h
+++ b/include/asm-s390/bugs.h
@@ -16,7 +16,7 @@
16 * void check_bugs(void); 16 * void check_bugs(void);
17 */ 17 */
18 18
19static void __init check_bugs(void) 19static inline void check_bugs(void)
20{ 20{
21 /* s390 has no bugs ... */ 21 /* s390 has no bugs ... */
22} 22}
diff --git a/include/asm-s390/ipl.h b/include/asm-s390/ipl.h
index 5650d3d4ae46..660f78271a93 100644
--- a/include/asm-s390/ipl.h
+++ b/include/asm-s390/ipl.h
@@ -74,6 +74,7 @@ struct ipl_parameter_block {
74extern u32 ipl_flags; 74extern u32 ipl_flags;
75extern u16 ipl_devno; 75extern u16 ipl_devno;
76 76
77extern u32 dump_prefix_page;
77extern void do_reipl(void); 78extern void do_reipl(void);
78extern void ipl_save_parameters(void); 79extern void ipl_save_parameters(void);
79 80
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h
index e3a180cf5062..9a3cb6ba9d15 100644
--- a/include/asm-sh/cache.h
+++ b/include/asm-sh/cache.h
@@ -21,6 +21,7 @@
21 21
22#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) 22#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
23 23
24#ifndef __ASSEMBLY__
24struct cache_info { 25struct cache_info {
25 unsigned int ways; /* Number of cache ways */ 26 unsigned int ways; /* Number of cache ways */
26 unsigned int sets; /* Number of cache sets */ 27 unsigned int sets; /* Number of cache sets */
@@ -47,6 +48,6 @@ struct cache_info {
47 48
48 unsigned long flags; 49 unsigned long flags;
49}; 50};
50 51#endif /* __ASSEMBLY__ */
51#endif /* __KERNEL__ */ 52#endif /* __KERNEL__ */
52#endif /* __ASM_SH_CACHE_H */ 53#endif /* __ASM_SH_CACHE_H */
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h
index 22f12634975b..07f62ec9ff0c 100644
--- a/include/asm-sh/cacheflush.h
+++ b/include/asm-sh/cacheflush.h
@@ -30,8 +30,5 @@ extern void __flush_invalidate_region(void *start, int size);
30 30
31#define HAVE_ARCH_UNMAPPED_AREA 31#define HAVE_ARCH_UNMAPPED_AREA
32 32
33/* Page flag for lazy dcache write-back for the aliasing UP caches */
34#define PG_dcache_dirty PG_arch_1
35
36#endif /* __KERNEL__ */ 33#endif /* __KERNEL__ */
37#endif /* __ASM_SH_CACHEFLUSH_H */ 34#endif /* __ASM_SH_CACHEFLUSH_H */
diff --git a/include/asm-sh/cpu-sh3/cacheflush.h b/include/asm-sh/cpu-sh3/cacheflush.h
index 6fabbba228de..f70d8ef76a15 100644
--- a/include/asm-sh/cpu-sh3/cacheflush.h
+++ b/include/asm-sh/cpu-sh3/cacheflush.h
@@ -36,6 +36,8 @@
36 /* 32KB cache, 4kb PAGE sizes need to check bit 12 */ 36 /* 32KB cache, 4kb PAGE sizes need to check bit 12 */
37#define CACHE_ALIAS 0x00001000 37#define CACHE_ALIAS 0x00001000
38 38
39#define PG_mapped PG_arch_1
40
39void flush_cache_all(void); 41void flush_cache_all(void);
40void flush_cache_mm(struct mm_struct *mm); 42void flush_cache_mm(struct mm_struct *mm);
41#define flush_cache_dup_mm(mm) flush_cache_mm(mm) 43#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h
index b3746a936a09..5fd5c89ef86a 100644
--- a/include/asm-sh/cpu-sh4/cacheflush.h
+++ b/include/asm-sh/cpu-sh4/cacheflush.h
@@ -39,4 +39,6 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
39/* Initialization of P3 area for copy_user_page */ 39/* Initialization of P3 area for copy_user_page */
40void p3_cache_init(void); 40void p3_cache_init(void);
41 41
42#define PG_mapped PG_arch_1
43
42#endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ 44#endif /* __ASM_CPU_SH4_CACHEFLUSH_H */
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index 9214c015fe14..184d7fcaaf10 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -583,6 +583,11 @@ struct mm_struct;
583extern unsigned int kobjsize(const void *objp); 583extern unsigned int kobjsize(const void *objp);
584#endif /* !CONFIG_MMU */ 584#endif /* !CONFIG_MMU */
585 585
586#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)
587#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
588extern pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
589#endif
590
586extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 591extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
587extern void paging_init(void); 592extern void paging_init(void);
588 593
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index 279e70a77c75..31d55e3782d5 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -111,6 +111,7 @@ static inline struct thread_info *current_thread_info(void)
111#define TIF_SIGPENDING 2 /* signal pending */ 111#define TIF_SIGPENDING 2 /* signal pending */
112#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 112#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
113#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ 113#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
114#define TIF_SINGLESTEP 5 /* singlestepping active */
114#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 115#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
115#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 116#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
116#define TIF_MEMDIE 18 117#define TIF_MEMDIE 18
@@ -121,6 +122,7 @@ static inline struct thread_info *current_thread_info(void)
121#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 122#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
122#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 123#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
123#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 124#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
125#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
124#define _TIF_USEDFPU (1<<TIF_USEDFPU) 126#define _TIF_USEDFPU (1<<TIF_USEDFPU)
125#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 127#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
126#define _TIF_FREEZE (1<<TIF_FREEZE) 128#define _TIF_FREEZE (1<<TIF_FREEZE)
diff --git a/include/asm-sparc/dma-mapping.h b/include/asm-sparc/dma-mapping.h
index 6db83dc93cb7..f3a641e6b2c8 100644
--- a/include/asm-sparc/dma-mapping.h
+++ b/include/asm-sparc/dma-mapping.h
@@ -5,20 +5,7 @@
5#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
6#include <asm-generic/dma-mapping.h> 6#include <asm-generic/dma-mapping.h>
7#else 7#else
8 8#include <asm-generic/dma-mapping-broken.h>
9static inline void *dma_alloc_coherent(struct device *dev, size_t size,
10 dma_addr_t *dma_handle, gfp_t flag)
11{
12 BUG();
13 return NULL;
14}
15
16static inline void dma_free_coherent(struct device *dev, size_t size,
17 void *vaddr, dma_addr_t dma_handle)
18{
19 BUG();
20}
21
22#endif /* PCI */ 9#endif /* PCI */
23 10
24#endif /* _ASM_SPARC_DMA_MAPPING_H */ 11#endif /* _ASM_SPARC_DMA_MAPPING_H */
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index d5b2f8053b3b..e43ed1d63a9d 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -319,16 +319,17 @@
319#define __NR_set_robust_list 300 319#define __NR_set_robust_list 300
320#define __NR_get_robust_list 301 320#define __NR_get_robust_list 301
321#define __NR_migrate_pages 302 321#define __NR_migrate_pages 302
322#define __NR_mbind 303
323#define __NR_get_mempolicy 304
324#define __NR_set_mempolicy 305
325#define __NR_kexec_load 306
326#define __NR_move_pages 307
327#define __NR_getcpu 308
328#define __NR_epoll_pwait 309
322 329
323#define NR_SYSCALLS 303 330#define NR_SYSCALLS 310
324 331
325#ifdef __KERNEL__ 332#ifdef __KERNEL__
326/* WARNING: You MAY NOT add syscall numbers larger than 302, since
327 * all of the syscall tables in the Sparc kernel are
328 * sized to have 302 entries (starting at zero). Therefore
329 * find a free slot in the 0-302 range.
330 */
331
332#define __ARCH_WANT_IPC_PARSE_VERSION 333#define __ARCH_WANT_IPC_PARSE_VERSION
333#define __ARCH_WANT_OLD_READDIR 334#define __ARCH_WANT_OLD_READDIR
334#define __ARCH_WANT_STAT64 335#define __ARCH_WANT_STAT64
@@ -345,7 +346,6 @@
345#define __ARCH_WANT_SYS_GETPGRP 346#define __ARCH_WANT_SYS_GETPGRP
346#define __ARCH_WANT_SYS_LLSEEK 347#define __ARCH_WANT_SYS_LLSEEK
347#define __ARCH_WANT_SYS_NICE 348#define __ARCH_WANT_SYS_NICE
348#define __ARCH_WANT_SYS_OLD_GETRLIMIT
349#define __ARCH_WANT_SYS_OLDUMOUNT 349#define __ARCH_WANT_SYS_OLDUMOUNT
350#define __ARCH_WANT_SYS_SIGPENDING 350#define __ARCH_WANT_SYS_SIGPENDING
351#define __ARCH_WANT_SYS_SIGPROCMASK 351#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/include/asm-sparc64/dma.h b/include/asm-sparc64/dma.h
index 1bf4f7a8fbe1..a9fd06183972 100644
--- a/include/asm-sparc64/dma.h
+++ b/include/asm-sparc64/dma.h
@@ -15,17 +15,6 @@
15#include <asm/delay.h> 15#include <asm/delay.h>
16#include <asm/oplib.h> 16#include <asm/oplib.h>
17 17
18extern spinlock_t dma_spin_lock;
19
20#define claim_dma_lock() \
21({ unsigned long flags; \
22 spin_lock_irqsave(&dma_spin_lock, flags); \
23 flags; \
24})
25
26#define release_dma_lock(__flags) \
27 spin_unlock_irqrestore(&dma_spin_lock, __flags);
28
29/* These are irrelevant for Sparc DMA, but we leave it in so that 18/* These are irrelevant for Sparc DMA, but we leave it in so that
30 * things can compile. 19 * things can compile.
31 */ 20 */
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index dbe033e494db..331013a0053e 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -854,4 +854,15 @@ static unsigned long __init sun_floppy_init(void)
854 854
855#define EXTRA_FLOPPY_PARAMS 855#define EXTRA_FLOPPY_PARAMS
856 856
857static DEFINE_SPINLOCK(dma_spin_lock);
858
859#define claim_dma_lock() \
860({ unsigned long flags; \
861 spin_lock_irqsave(&dma_spin_lock, flags); \
862 flags; \
863})
864
865#define release_dma_lock(__flags) \
866 spin_unlock_irqrestore(&dma_spin_lock, __flags);
867
857#endif /* !(__ASM_SPARC64_FLOPPY_H) */ 868#endif /* !(__ASM_SPARC64_FLOPPY_H) */
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index be9509c8f8c1..284dfd01a33d 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -19,6 +19,17 @@
19 */ 19 */
20#define HAS_DMA 20#define HAS_DMA
21 21
22static DEFINE_SPINLOCK(dma_spin_lock);
23
24#define claim_dma_lock() \
25({ unsigned long flags; \
26 spin_lock_irqsave(&dma_spin_lock, flags); \
27 flags; \
28})
29
30#define release_dma_lock(__flags) \
31 spin_unlock_irqrestore(&dma_spin_lock, __flags);
32
22static struct sparc_ebus_info { 33static struct sparc_ebus_info {
23 struct ebus_dma_info info; 34 struct ebus_dma_info info;
24 unsigned int addr; 35 unsigned int addr;
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 47047536f261..e2dcb87e0c62 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -321,17 +321,17 @@
321#define __NR_set_robust_list 300 321#define __NR_set_robust_list 300
322#define __NR_get_robust_list 301 322#define __NR_get_robust_list 301
323#define __NR_migrate_pages 302 323#define __NR_migrate_pages 302
324#define __NR_mbind 303
325#define __NR_get_mempolicy 304
326#define __NR_set_mempolicy 305
327#define __NR_kexec_load 306
328#define __NR_move_pages 307
329#define __NR_getcpu 308
330#define __NR_epoll_pwait 309
324 331
325#define NR_SYSCALLS 303 332#define NR_SYSCALLS 310
326 333
327#ifdef __KERNEL__ 334#ifdef __KERNEL__
328
329/* WARNING: You MAY NOT add syscall numbers larger than 302, since
330 * all of the syscall tables in the Sparc kernel are
331 * sized to have 302 entries (starting at zero). Therefore
332 * find a free slot in the 0-302 range.
333 */
334
335/* sysconf options, for SunOS compatibility */ 335/* sysconf options, for SunOS compatibility */
336#define _SC_ARG_MAX 1 336#define _SC_ARG_MAX 1
337#define _SC_CHILD_MAX 2 337#define _SC_CHILD_MAX 2
@@ -359,7 +359,6 @@
359#define __ARCH_WANT_SYS_GETPGRP 359#define __ARCH_WANT_SYS_GETPGRP
360#define __ARCH_WANT_SYS_LLSEEK 360#define __ARCH_WANT_SYS_LLSEEK
361#define __ARCH_WANT_SYS_NICE 361#define __ARCH_WANT_SYS_NICE
362#define __ARCH_WANT_SYS_OLD_GETRLIMIT
363#define __ARCH_WANT_SYS_OLDUMOUNT 362#define __ARCH_WANT_SYS_OLDUMOUNT
364#define __ARCH_WANT_SYS_SIGPENDING 363#define __ARCH_WANT_SYS_SIGPENDING
365#define __ARCH_WANT_SYS_SIGPROCMASK 364#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h
index ab913ffcad56..f9c589539a82 100644
--- a/include/asm-x86_64/swiotlb.h
+++ b/include/asm-x86_64/swiotlb.h
@@ -44,7 +44,6 @@ extern void swiotlb_init(void);
44extern int swiotlb_force; 44extern int swiotlb_force;
45 45
46#ifdef CONFIG_SWIOTLB 46#ifdef CONFIG_SWIOTLB
47#define SWIOTLB_ARCH_NEED_ALLOC
48extern int swiotlb; 47extern int swiotlb;
49#else 48#else
50#define swiotlb 0 49#define swiotlb 0
diff --git a/include/asm-x86_64/tsc.h b/include/asm-x86_64/tsc.h
index 26c3e9828288..d66ba6ef25f6 100644
--- a/include/asm-x86_64/tsc.h
+++ b/include/asm-x86_64/tsc.h
@@ -1,67 +1 @@
1/* #include <asm-i386/tsc.h>
2 * linux/include/asm-x86_64/tsc.h
3 *
4 * x86_64 TSC related functions
5 */
6#ifndef _ASM_x86_64_TSC_H
7#define _ASM_x86_64_TSC_H
8
9#include <asm/processor.h>
10
11/*
12 * Standard way to access the cycle counter.
13 */
14typedef unsigned long long cycles_t;
15
16extern unsigned int cpu_khz;
17extern unsigned int tsc_khz;
18
19static inline cycles_t get_cycles(void)
20{
21 unsigned long long ret = 0;
22
23#ifndef CONFIG_X86_TSC
24 if (!cpu_has_tsc)
25 return 0;
26#endif
27
28#if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC)
29 rdtscll(ret);
30#endif
31 return ret;
32}
33
34/* Like get_cycles, but make sure the CPU is synchronized. */
35static __always_inline cycles_t get_cycles_sync(void)
36{
37 unsigned long long ret;
38#ifdef X86_FEATURE_SYNC_RDTSC
39 unsigned eax;
40
41 /*
42 * Don't do an additional sync on CPUs where we know
43 * RDTSC is already synchronous:
44 */
45 alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC,
46 "=a" (eax), "0" (1) : "ebx","ecx","edx","memory");
47#else
48 sync_core();
49#endif
50 rdtscll(ret);
51
52 return ret;
53}
54
55extern void tsc_init(void);
56extern void mark_tsc_unstable(void);
57extern int unsynchronized_tsc(void);
58extern void init_tsc_clocksource(void);
59
60/*
61 * Boot-time check whether the TSCs are synchronized across
62 * all CPUs/cores:
63 */
64extern void check_tsc_sync_source(int cpu);
65extern void check_tsc_sync_target(void);
66
67#endif
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 1981f70fcad1..9df30b939c4e 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -373,12 +373,12 @@ extern long __copy_user_nocache(void *dst, const void __user *src, unsigned size
373static inline int __copy_from_user_nocache(void *dst, const void __user *src, unsigned size) 373static inline int __copy_from_user_nocache(void *dst, const void __user *src, unsigned size)
374{ 374{
375 might_sleep(); 375 might_sleep();
376 return __copy_user_nocache(dst, (__force void *)src, size, 1); 376 return __copy_user_nocache(dst, src, size, 1);
377} 377}
378 378
379static inline int __copy_from_user_inatomic_nocache(void *dst, const void __user *src, unsigned size) 379static inline int __copy_from_user_inatomic_nocache(void *dst, const void __user *src, unsigned size)
380{ 380{
381 return __copy_user_nocache(dst, (__force void *)src, size, 0); 381 return __copy_user_nocache(dst, src, size, 0);
382} 382}
383 383
384#endif /* __X86_64_UACCESS_H */ 384#endif /* __X86_64_UACCESS_H */
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 229fa012c893..773e30df11ee 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -24,6 +24,7 @@
24#ifndef _LINUX_AUDIT_H_ 24#ifndef _LINUX_AUDIT_H_
25#define _LINUX_AUDIT_H_ 25#define _LINUX_AUDIT_H_
26 26
27#include <linux/types.h>
27#include <linux/elf-em.h> 28#include <linux/elf-em.h>
28 29
29/* The netlink messages for the audit system is divided into blocks: 30/* The netlink messages for the audit system is divided into blocks:
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 80b17f440ec1..ccd863dd77fa 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -234,5 +234,24 @@ asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
234 compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, 234 compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
235 const compat_ulong_t __user *new_nodes); 235 const compat_ulong_t __user *new_nodes);
236 236
237/*
238 * epoll (fs/eventpoll.c) compat bits follow ...
239 */
240#ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT
241struct epoll_event;
242#define compat_epoll_event epoll_event
243#else
244asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
245 struct compat_epoll_event __user *event);
246asmlinkage long compat_sys_epoll_wait(int epfd,
247 struct compat_epoll_event __user *events,
248 int maxevents, int timeout);
249#endif
250asmlinkage long compat_sys_epoll_pwait(int epfd,
251 struct compat_epoll_event __user *events,
252 int maxevents, int timeout,
253 const compat_sigset_t __user *sigmask,
254 compat_size_t sigsetsize);
255
237#endif /* CONFIG_COMPAT */ 256#endif /* CONFIG_COMPAT */
238#endif /* _LINUX_COMPAT_H */ 257#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 3bef961b58b1..5bdbc744e773 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -47,7 +47,7 @@ enum hrtimer_restart {
47 * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context 47 * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context
48 * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and 48 * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and
49 * does not restart the timer 49 * does not restart the timer
50 * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in softirq context 50 * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context
51 * Special mode for tick emultation 51 * Special mode for tick emultation
52 */ 52 */
53enum hrtimer_cb_mode { 53enum hrtimer_cb_mode {
@@ -139,7 +139,7 @@ struct hrtimer_sleeper {
139}; 139};
140 140
141/** 141/**
142 * struct hrtimer_base - the timer base for a specific clock 142 * struct hrtimer_clock_base - the timer base for a specific clock
143 * @cpu_base: per cpu clock base 143 * @cpu_base: per cpu clock base
144 * @index: clock type index for per_cpu support when moving a 144 * @index: clock type index for per_cpu support when moving a
145 * timer to a base on another cpu. 145 * timer to a base on another cpu.
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 4fab3d0a4bce..e33ee763c052 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -114,6 +114,7 @@ struct pppoe_hdr {
114#ifdef __KERNEL__ 114#ifdef __KERNEL__
115struct pppoe_opt { 115struct pppoe_opt {
116 struct net_device *dev; /* device associated with socket*/ 116 struct net_device *dev; /* device associated with socket*/
117 int ifindex; /* ifindex of device associated with socket */
117 struct pppoe_addr pa; /* what this socket is bound to*/ 118 struct pppoe_addr pa; /* what this socket is bound to*/
118 struct sockaddr_pppox relay; /* what socket data will be 119 struct sockaddr_pppox relay; /* what socket data will be
119 relayed to (PPPoE relaying) */ 120 relayed to (PPPoE relaying) */
@@ -132,6 +133,7 @@ struct pppox_sock {
132 unsigned short num; 133 unsigned short num;
133}; 134};
134#define pppoe_dev proto.pppoe.dev 135#define pppoe_dev proto.pppoe.dev
136#define pppoe_ifindex proto.pppoe.ifindex
135#define pppoe_pa proto.pppoe.pa 137#define pppoe_pa proto.pppoe.pa
136#define pppoe_relay proto.pppoe.relay 138#define pppoe_relay proto.pppoe.relay
137 139
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 9dbb525c5178..a113fe68d8a1 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -218,5 +218,7 @@ extern void ip_mc_up(struct in_device *);
218extern void ip_mc_down(struct in_device *); 218extern void ip_mc_down(struct in_device *);
219extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); 219extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
220extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); 220extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
221extern void ip_mc_rejoin_group(struct ip_mc_list *im);
222
221#endif 223#endif
222#endif 224#endif
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 913e5752569f..bfcef8a1ad8b 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -62,6 +62,12 @@ struct mmc_ios {
62 62
63#define MMC_BUS_WIDTH_1 0 63#define MMC_BUS_WIDTH_1 0
64#define MMC_BUS_WIDTH_4 2 64#define MMC_BUS_WIDTH_4 2
65
66 unsigned char timing; /* timing specification used */
67
68#define MMC_TIMING_LEGACY 0
69#define MMC_TIMING_MMC_HS 1
70#define MMC_TIMING_SD_HS 2
65}; 71};
66 72
67struct mmc_host_ops { 73struct mmc_host_ops {
@@ -87,6 +93,8 @@ struct mmc_host {
87#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ 93#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
88#define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ 94#define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */
89#define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */ 95#define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */
96#define MMC_CAP_MMC_HIGHSPEED (1 << 3) /* Can do MMC high-speed timing */
97#define MMC_CAP_SD_HIGHSPEED (1 << 4) /* Can do SD high-speed timing */
90 98
91 /* host specific block data */ 99 /* host specific block data */
92 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 100 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 74c8a2ecc9dd..e38fe6822cb4 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -17,7 +17,7 @@ struct msi_desc {
17 struct { 17 struct {
18 __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ 18 __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */
19 __u8 maskbit : 1; /* mask-pending bit supported ? */ 19 __u8 maskbit : 1; /* mask-pending bit supported ? */
20 __u8 unused : 1; 20 __u8 masked : 1;
21 __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ 21 __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */
22 __u8 pos; /* Location of the msi capability */ 22 __u8 pos; /* Location of the msi capability */
23 __u16 entry_nr; /* specific enabled entry */ 23 __u16 entry_nr; /* specific enabled entry */
@@ -32,10 +32,8 @@ struct msi_desc {
32 void __iomem *mask_base; 32 void __iomem *mask_base;
33 struct pci_dev *dev; 33 struct pci_dev *dev;
34 34
35#ifdef CONFIG_PM 35 /* Last set MSI message */
36 /* PM save area for MSIX address/data */ 36 struct msi_msg msg;
37 struct msi_msg msg_save;
38#endif
39}; 37};
40 38
41/* 39/*
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 6a8570be331b..3d956c3abb31 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -121,6 +121,7 @@ struct mtd_info {
121 u_int32_t writesize; 121 u_int32_t writesize;
122 122
123 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 123 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
124 u_int32_t oobavail; // Available OOB bytes per block
124 125
125 // Kernel-only stuff starts here. 126 // Kernel-only stuff starts here.
126 char *name; 127 char *name;
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index d8af8a95e58d..a56d24ada505 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -82,7 +82,8 @@ struct onenand_bufferram {
82 * @wq: [INTERN] wait queue to sleep on if a OneNAND 82 * @wq: [INTERN] wait queue to sleep on if a OneNAND
83 * operation is in progress 83 * operation is in progress
84 * @state: [INTERN] the current state of the OneNAND device 84 * @state: [INTERN] the current state of the OneNAND device
85 * @page_buf: data buffer 85 * @page_buf: [INTERN] page main data buffer
86 * @oob_buf: [INTERN] page oob data buffer
86 * @subpagesize: [INTERN] holds the subpagesize 87 * @subpagesize: [INTERN] holds the subpagesize
87 * @ecclayout: [REPLACEABLE] the default ecc placement scheme 88 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
88 * @bbm: [REPLACEABLE] pointer to Bad Block Management 89 * @bbm: [REPLACEABLE] pointer to Bad Block Management
@@ -122,6 +123,7 @@ struct onenand_chip {
122 wait_queue_head_t wq; 123 wait_queue_head_t wq;
123 onenand_state_t state; 124 onenand_state_t state;
124 unsigned char *page_buf; 125 unsigned char *page_buf;
126 unsigned char *oob_buf;
125 127
126 int subpagesize; 128 int subpagesize;
127 struct nand_ecclayout *ecclayout; 129 struct nand_ecclayout *ecclayout;
@@ -156,6 +158,7 @@ struct onenand_chip {
156#define ONENAND_HAS_CONT_LOCK (0x0001) 158#define ONENAND_HAS_CONT_LOCK (0x0001)
157#define ONENAND_HAS_UNLOCK_ALL (0x0002) 159#define ONENAND_HAS_UNLOCK_ALL (0x0002)
158#define ONENAND_PAGEBUF_ALLOC (0x1000) 160#define ONENAND_PAGEBUF_ALLOC (0x1000)
161#define ONENAND_OOBBUF_ALLOC (0x2000)
159 162
160/* 163/*
161 * OneNAND Flash Manufacturer ID Codes 164 * OneNAND Flash Manufacturer ID Codes
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index e7d4da1cc9fa..c6d4ab86b83c 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -1288,6 +1288,7 @@ struct mv64xxx_i2c_pdata {
1288#define MV643XX_ETH_NAME "mv643xx_eth" 1288#define MV643XX_ETH_NAME "mv643xx_eth"
1289 1289
1290struct mv643xx_eth_platform_data { 1290struct mv643xx_eth_platform_data {
1291 int port_number;
1291 u16 force_phy_addr; /* force override if phy_addr == 0 */ 1292 u16 force_phy_addr; /* force override if phy_addr == 0 */
1292 u16 phy_addr; 1293 u16 phy_addr;
1293 1294
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index a503052138bd..6330fc76b00f 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -50,6 +50,8 @@ struct ncp_server {
50 int packet_size; 50 int packet_size;
51 unsigned char *packet; /* Here we prepare requests and 51 unsigned char *packet; /* Here we prepare requests and
52 receive replies */ 52 receive replies */
53 unsigned char *txbuf; /* Storage for current request */
54 unsigned char *rxbuf; /* Storage for reply to current request */
53 55
54 int lock; /* To prevent mismatch in protocols. */ 56 int lock; /* To prevent mismatch in protocols. */
55 struct mutex mutex; 57 struct mutex mutex;
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h
index 907d4f5ca5dc..e3a6df07aa4b 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_core.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h
@@ -45,7 +45,7 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb)
45 int ret = NF_ACCEPT; 45 int ret = NF_ACCEPT;
46 46
47 if (ct) { 47 if (ct) {
48 if (!is_confirmed(ct)) 48 if (!is_confirmed(ct) && !is_dying(ct))
49 ret = __ip_conntrack_confirm(pskb); 49 ret = __ip_conntrack_confirm(pskb);
50 ip_ct_deliver_cached_events(ct); 50 ip_ct_deliver_cached_events(ct);
51 } 51 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 78417e421b4c..481ea0663f19 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -209,11 +209,6 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev,
209 hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); 209 hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space);
210} 210}
211 211
212static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap)
213{
214 hlist_del(&cap->next);
215}
216
217/* 212/*
218 * For PCI devices, the region numbers are assigned this way: 213 * For PCI devices, the region numbers are assigned this way:
219 * 214 *
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index f09cce2357ff..495d368390e0 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -296,6 +296,7 @@
296#define PCI_MSIX_FLAGS 2 296#define PCI_MSIX_FLAGS 2
297#define PCI_MSIX_FLAGS_QSIZE 0x7FF 297#define PCI_MSIX_FLAGS_QSIZE 0x7FF
298#define PCI_MSIX_FLAGS_ENABLE (1 << 15) 298#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
299#define PCI_MSIX_FLAGS_MASKALL (1 << 14)
299#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 300#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
300#define PCI_MSIX_FLAGS_BITMASK (1 << 0) 301#define PCI_MSIX_FLAGS_BITMASK (1 << 0)
301 302
diff --git a/include/linux/security.h b/include/linux/security.h
index 7f88d97575fd..47e82c120f9a 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1324,7 +1324,7 @@ struct security_operations {
1324 1324
1325 void (*d_instantiate) (struct dentry *dentry, struct inode *inode); 1325 void (*d_instantiate) (struct dentry *dentry, struct inode *inode);
1326 1326
1327 int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size); 1327 int (*getprocattr)(struct task_struct *p, char *name, char **value);
1328 int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size); 1328 int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size);
1329 int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen); 1329 int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen);
1330 void (*release_secctx)(char *secdata, u32 seclen); 1330 void (*release_secctx)(char *secdata, u32 seclen);
@@ -2092,9 +2092,9 @@ static inline void security_d_instantiate (struct dentry *dentry, struct inode *
2092 security_ops->d_instantiate (dentry, inode); 2092 security_ops->d_instantiate (dentry, inode);
2093} 2093}
2094 2094
2095static inline int security_getprocattr(struct task_struct *p, char *name, void *value, size_t size) 2095static inline int security_getprocattr(struct task_struct *p, char *name, char **value)
2096{ 2096{
2097 return security_ops->getprocattr(p, name, value, size); 2097 return security_ops->getprocattr(p, name, value);
2098} 2098}
2099 2099
2100static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) 2100static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size)
@@ -2749,7 +2749,7 @@ static inline int security_sem_semop (struct sem_array * sma,
2749static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode) 2749static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode)
2750{ } 2750{ }
2751 2751
2752static inline int security_getprocattr(struct task_struct *p, char *name, void *value, size_t size) 2752static inline int security_getprocattr(struct task_struct *p, char *name, char **value)
2753{ 2753{
2754 return -EINVAL; 2754 return -EINVAL;
2755} 2755}
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 83b3c7b433aa..35fa4d5aadd0 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -194,9 +194,7 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
194 194
195union svc_addr_u { 195union svc_addr_u {
196 struct in_addr addr; 196 struct in_addr addr;
197#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
198 struct in6_addr addr6; 197 struct in6_addr addr6;
199#endif
200}; 198};
201 199
202/* 200/*
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index cccea0a0feb4..7909687557bf 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -66,7 +66,7 @@ struct svc_sock {
66 * Function prototypes. 66 * Function prototypes.
67 */ 67 */
68int svc_makesock(struct svc_serv *, int, unsigned short, int flags); 68int svc_makesock(struct svc_serv *, int, unsigned short, int flags);
69void svc_close_socket(struct svc_sock *); 69void svc_force_close_socket(struct svc_sock *);
70int svc_recv(struct svc_rqst *, long); 70int svc_recv(struct svc_rqst *, long);
71int svc_send(struct svc_rqst *); 71int svc_send(struct svc_rqst *);
72void svc_drop(struct svc_rqst *); 72void svc_drop(struct svc_rqst *);
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index f7be1ac73601..09a2532699b2 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -66,7 +66,7 @@ struct inet_hashinfo;
66struct inet_timewait_death_row { 66struct inet_timewait_death_row {
67 /* Short-time timewait calendar */ 67 /* Short-time timewait calendar */
68 int twcal_hand; 68 int twcal_hand;
69 int twcal_jiffie; 69 unsigned long twcal_jiffie;
70 struct timer_list twcal_timer; 70 struct timer_list twcal_timer;
71 struct hlist_head twcal_row[INET_TWDR_RECYCLE_SLOTS]; 71 struct hlist_head twcal_row[INET_TWDR_RECYCLE_SLOTS];
72 72
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 7fdc72c01356..85634e1865c3 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -64,7 +64,7 @@ static inline int nf_conntrack_confirm(struct sk_buff **pskb)
64 int ret = NF_ACCEPT; 64 int ret = NF_ACCEPT;
65 65
66 if (ct) { 66 if (ct) {
67 if (!nf_ct_is_confirmed(ct)) 67 if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct))
68 ret = __nf_conntrack_confirm(pskb); 68 ret = __nf_conntrack_confirm(pskb);
69 nf_ct_deliver_cached_events(ct); 69 nf_ct_deliver_cached_events(ct);
70 } 70 }
diff --git a/include/net/sock.h b/include/net/sock.h
index 849c7df23181..2c7d60ca3548 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -426,7 +426,7 @@ static inline void sk_acceptq_added(struct sock *sk)
426 426
427static inline int sk_acceptq_is_full(struct sock *sk) 427static inline int sk_acceptq_is_full(struct sock *sk)
428{ 428{
429 return sk->sk_ack_backlog >= sk->sk_max_ack_backlog; 429 return sk->sk_ack_backlog > sk->sk_max_ack_backlog;
430} 430}
431 431
432/* 432/*
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 92a1fc46ea59..5a00aa85b756 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -988,8 +988,9 @@ extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int,
988int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 988int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
989struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, 989struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
990 struct xfrm_selector *sel, 990 struct xfrm_selector *sel,
991 struct xfrm_sec_ctx *ctx, int delete); 991 struct xfrm_sec_ctx *ctx, int delete,
992struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete); 992 int *err);
993struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err);
993void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); 994void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info);
994u32 xfrm_get_acqseq(void); 995u32 xfrm_get_acqseq(void);
995void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); 996void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi);
diff --git a/include/sound/version.h b/include/sound/version.h
index a9ba7ee69939..5f7275000102 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.14rc2" 2#define CONFIG_SND_VERSION "1.0.14rc3"
3#define CONFIG_SND_DATE " (Wed Feb 14 07:42:13 2007 UTC)" 3#define CONFIG_SND_DATE " (Tue Mar 06 13:10:00 2007 UTC)"
diff --git a/init/Kconfig b/init/Kconfig
index f977086e118a..b170aa1d43bd 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -304,6 +304,22 @@ config RELAY
304 304
305 If unsure, say N. 305 If unsure, say N.
306 306
307config BLK_DEV_INITRD
308 bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
309 depends on BROKEN || !FRV
310 help
311 The initial RAM filesystem is a ramfs which is loaded by the
312 boot loader (loadlin or lilo) and that is mounted as root
313 before the normal boot procedure. It is typically used to
314 load modules needed to mount the "real" root file system,
315 etc. See <file:Documentation/initrd.txt> for details.
316
317 If RAM disk support (BLK_DEV_RAM) is also included, this
318 also enables initial RAM disk (initrd) support and adds
319 15 Kbytes (more on some other architectures) to the kernel size.
320
321 If unsure say Y.
322
307if BLK_DEV_INITRD 323if BLK_DEV_INITRD
308 324
309source "usr/Kconfig" 325source "usr/Kconfig"
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 0b5ecbe5f045..554ac368be79 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -731,7 +731,8 @@ asmlinkage long sys_mq_unlink(const char __user *u_name)
731 if (IS_ERR(name)) 731 if (IS_ERR(name))
732 return PTR_ERR(name); 732 return PTR_ERR(name);
733 733
734 mutex_lock(&mqueue_mnt->mnt_root->d_inode->i_mutex); 734 mutex_lock_nested(&mqueue_mnt->mnt_root->d_inode->i_mutex,
735 I_MUTEX_PARENT);
735 dentry = lookup_one_len(name, mqueue_mnt->mnt_root, strlen(name)); 736 dentry = lookup_one_len(name, mqueue_mnt->mnt_root, strlen(name));
736 if (IS_ERR(dentry)) { 737 if (IS_ERR(dentry)) {
737 err = PTR_ERR(dentry); 738 err = PTR_ERR(dentry);
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 359955800dd2..628c7ac590a0 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -739,28 +739,26 @@ static inline void audit_free_context(struct audit_context *context)
739void audit_log_task_context(struct audit_buffer *ab) 739void audit_log_task_context(struct audit_buffer *ab)
740{ 740{
741 char *ctx = NULL; 741 char *ctx = NULL;
742 ssize_t len = 0; 742 unsigned len;
743 int error;
744 u32 sid;
745
746 selinux_get_task_sid(current, &sid);
747 if (!sid)
748 return;
743 749
744 len = security_getprocattr(current, "current", NULL, 0); 750 error = selinux_sid_to_string(sid, &ctx, &len);
745 if (len < 0) { 751 if (error) {
746 if (len != -EINVAL) 752 if (error != -EINVAL)
747 goto error_path; 753 goto error_path;
748 return; 754 return;
749 } 755 }
750 756
751 ctx = kmalloc(len, GFP_KERNEL);
752 if (!ctx)
753 goto error_path;
754
755 len = security_getprocattr(current, "current", ctx, len);
756 if (len < 0 )
757 goto error_path;
758
759 audit_log_format(ab, " subj=%s", ctx); 757 audit_log_format(ab, " subj=%s", ctx);
758 kfree(ctx);
760 return; 759 return;
761 760
762error_path: 761error_path:
763 kfree(ctx);
764 audit_panic("error in audit_log_task_context"); 762 audit_panic("error in audit_log_task_context");
765 return; 763 return;
766} 764}
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index de93a8176ca6..ec4cb9f3e3b7 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -540,19 +540,19 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
540/* 540/*
541 * Switch to high resolution mode 541 * Switch to high resolution mode
542 */ 542 */
543static void hrtimer_switch_to_hres(void) 543static int hrtimer_switch_to_hres(void)
544{ 544{
545 struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases); 545 struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases);
546 unsigned long flags; 546 unsigned long flags;
547 547
548 if (base->hres_active) 548 if (base->hres_active)
549 return; 549 return 1;
550 550
551 local_irq_save(flags); 551 local_irq_save(flags);
552 552
553 if (tick_init_highres()) { 553 if (tick_init_highres()) {
554 local_irq_restore(flags); 554 local_irq_restore(flags);
555 return; 555 return 0;
556 } 556 }
557 base->hres_active = 1; 557 base->hres_active = 1;
558 base->clock_base[CLOCK_REALTIME].resolution = KTIME_HIGH_RES; 558 base->clock_base[CLOCK_REALTIME].resolution = KTIME_HIGH_RES;
@@ -565,13 +565,14 @@ static void hrtimer_switch_to_hres(void)
565 local_irq_restore(flags); 565 local_irq_restore(flags);
566 printk(KERN_INFO "Switched to high resolution mode on CPU %d\n", 566 printk(KERN_INFO "Switched to high resolution mode on CPU %d\n",
567 smp_processor_id()); 567 smp_processor_id());
568 return 1;
568} 569}
569 570
570#else 571#else
571 572
572static inline int hrtimer_hres_active(void) { return 0; } 573static inline int hrtimer_hres_active(void) { return 0; }
573static inline int hrtimer_is_hres_enabled(void) { return 0; } 574static inline int hrtimer_is_hres_enabled(void) { return 0; }
574static inline void hrtimer_switch_to_hres(void) { } 575static inline int hrtimer_switch_to_hres(void) { return 0; }
575static inline void hrtimer_force_reprogram(struct hrtimer_cpu_base *base) { } 576static inline void hrtimer_force_reprogram(struct hrtimer_cpu_base *base) { }
576static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, 577static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
577 struct hrtimer_clock_base *base) 578 struct hrtimer_clock_base *base)
@@ -1130,6 +1131,9 @@ static inline void run_hrtimer_queue(struct hrtimer_cpu_base *cpu_base,
1130 if (base->softirq_time.tv64 <= timer->expires.tv64) 1131 if (base->softirq_time.tv64 <= timer->expires.tv64)
1131 break; 1132 break;
1132 1133
1134#ifdef CONFIG_HIGH_RES_TIMERS
1135 WARN_ON_ONCE(timer->cb_mode == HRTIMER_CB_IRQSAFE_NO_SOFTIRQ);
1136#endif
1133 timer_stats_account_hrtimer(timer); 1137 timer_stats_account_hrtimer(timer);
1134 1138
1135 fn = timer->function; 1139 fn = timer->function;
@@ -1173,7 +1177,8 @@ void hrtimer_run_queues(void)
1173 * deadlock vs. xtime_lock. 1177 * deadlock vs. xtime_lock.
1174 */ 1178 */
1175 if (tick_check_oneshot_change(!hrtimer_is_hres_enabled())) 1179 if (tick_check_oneshot_change(!hrtimer_is_hres_enabled()))
1176 hrtimer_switch_to_hres(); 1180 if (hrtimer_switch_to_hres())
1181 return;
1177 1182
1178 hrtimer_get_softirq_time(cpu_base); 1183 hrtimer_get_softirq_time(cpu_base);
1179 1184
diff --git a/kernel/module.c b/kernel/module.c
index f77e893e4620..fbc51de6444e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2419,12 +2419,6 @@ void module_remove_driver(struct device_driver *drv)
2419 kfree(driver_name); 2419 kfree(driver_name);
2420 } 2420 }
2421 } 2421 }
2422 /*
2423 * Undo the additional reference we added in module_add_driver()
2424 * via kset_find_obj()
2425 */
2426 if (drv->mod_name)
2427 kobject_put(&drv->kobj);
2428} 2422}
2429EXPORT_SYMBOL(module_remove_driver); 2423EXPORT_SYMBOL(module_remove_driver);
2430#endif 2424#endif
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 95f6657fff73..51a4dd0f1b74 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -81,29 +81,34 @@ config SOFTWARE_SUSPEND
81 bool "Software Suspend" 81 bool "Software Suspend"
82 depends on PM && SWAP && ((X86 && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)) 82 depends on PM && SWAP && ((X86 && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP))
83 ---help--- 83 ---help---
84 Enable the possibility of suspending the machine. 84 Enable the suspend to disk (STD) functionality.
85 It doesn't need ACPI or APM.
86 You may suspend your machine by 'swsusp' or 'shutdown -z <time>'
87 (patch for sysvinit needed).
88 85
89 It creates an image which is saved in your active swap. Upon next 86 You can suspend your machine with 'echo disk > /sys/power/state'.
87 Alternatively, you can use the additional userland tools available
88 from <http://suspend.sf.net>.
89
90 In principle it does not require ACPI or APM, although for example
91 ACPI will be used if available.
92
93 It creates an image which is saved in your active swap. Upon the next
90 boot, pass the 'resume=/dev/swappartition' argument to the kernel to 94 boot, pass the 'resume=/dev/swappartition' argument to the kernel to
91 have it detect the saved image, restore memory state from it, and 95 have it detect the saved image, restore memory state from it, and
92 continue to run as before. If you do not want the previous state to 96 continue to run as before. If you do not want the previous state to
93 be reloaded, then use the 'noresume' kernel argument. However, note 97 be reloaded, then use the 'noresume' kernel command line argument.
94 that your partitions will be fsck'd and you must re-mkswap your swap 98 Note, however, that fsck will be run on your filesystems and you will
95 partitions. It does not work with swap files. 99 need to run mkswap against the swap partition used for the suspend.
96 100
97 Right now you may boot without resuming and then later resume but 101 It also works with swap files to a limited extent (for details see
98 in meantime you cannot use those swap partitions/files which were 102 <file:Documentation/power/swsusp-and-swap-files.txt>).
99 involved in suspending. Also in this case there is a risk that buffers
100 on disk won't match with saved ones.
101 103
102 For more information take a look at <file:Documentation/power/swsusp.txt>. 104 Right now you may boot without resuming and resume later but in the
105 meantime you cannot use the swap partition(s)/file(s) involved in
106 suspending. Also in this case you must not use the filesystems
107 that were mounted before the suspend. In particular, you MUST NOT
108 MOUNT any journaled filesystems mounted before the suspend or they
109 will get corrupted in a nasty way.
103 110
104 (For now, swsusp is incompatible with PAE aka HIGHMEM_64G on i386. 111 For more information take a look at <file:Documentation/power/swsusp.txt>.
105 we need identity mapping for resume to work, and that is trivial
106 to get with 4MB pages, but less than trivial on PAE).
107 112
108config PM_STD_PARTITION 113config PM_STD_PARTITION
109 string "Default resume partition" 114 string "Default resume partition"
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 482b11ff65cb..bcd14e83ef39 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -60,19 +60,19 @@ static int test_no_idle_hz; /* Test RCU's support for tickless idle CPUs. */
60static int shuffle_interval = 5; /* Interval between shuffles (in sec)*/ 60static int shuffle_interval = 5; /* Interval between shuffles (in sec)*/
61static char *torture_type = "rcu"; /* What RCU implementation to torture. */ 61static char *torture_type = "rcu"; /* What RCU implementation to torture. */
62 62
63module_param(nreaders, int, 0); 63module_param(nreaders, int, 0444);
64MODULE_PARM_DESC(nreaders, "Number of RCU reader threads"); 64MODULE_PARM_DESC(nreaders, "Number of RCU reader threads");
65module_param(nfakewriters, int, 0); 65module_param(nfakewriters, int, 0444);
66MODULE_PARM_DESC(nfakewriters, "Number of RCU fake writer threads"); 66MODULE_PARM_DESC(nfakewriters, "Number of RCU fake writer threads");
67module_param(stat_interval, int, 0); 67module_param(stat_interval, int, 0444);
68MODULE_PARM_DESC(stat_interval, "Number of seconds between stats printk()s"); 68MODULE_PARM_DESC(stat_interval, "Number of seconds between stats printk()s");
69module_param(verbose, bool, 0); 69module_param(verbose, bool, 0444);
70MODULE_PARM_DESC(verbose, "Enable verbose debugging printk()s"); 70MODULE_PARM_DESC(verbose, "Enable verbose debugging printk()s");
71module_param(test_no_idle_hz, bool, 0); 71module_param(test_no_idle_hz, bool, 0444);
72MODULE_PARM_DESC(test_no_idle_hz, "Test support for tickless idle CPUs"); 72MODULE_PARM_DESC(test_no_idle_hz, "Test support for tickless idle CPUs");
73module_param(shuffle_interval, int, 0); 73module_param(shuffle_interval, int, 0444);
74MODULE_PARM_DESC(shuffle_interval, "Number of seconds between shuffles"); 74MODULE_PARM_DESC(shuffle_interval, "Number of seconds between shuffles");
75module_param(torture_type, charp, 0); 75module_param(torture_type, charp, 0444);
76MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu, rcu_bh, srcu)"); 76MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu, rcu_bh, srcu)");
77 77
78#define TORTURE_FLAG "-torture:" 78#define TORTURE_FLAG "-torture:"
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 34b2301276ce..1b255df4fcd0 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -846,7 +846,8 @@ static ctl_table vm_table[] = {
846 .extra2 = &one_hundred, 846 .extra2 = &one_hundred,
847 }, 847 },
848#endif 848#endif
849#ifdef CONFIG_X86_32 849#if defined(CONFIG_X86_32) || \
850 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
850 { 851 {
851 .ctl_name = VM_VDSO_ENABLED, 852 .ctl_name = VM_VDSO_ENABLED,
852 .procname = "vdso_enabled", 853 .procname = "vdso_enabled",
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 12b3efeb9f6f..5567745470f7 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -284,6 +284,42 @@ void tick_shutdown_broadcast(unsigned int *cpup)
284 spin_unlock_irqrestore(&tick_broadcast_lock, flags); 284 spin_unlock_irqrestore(&tick_broadcast_lock, flags);
285} 285}
286 286
287void tick_suspend_broadcast(void)
288{
289 struct clock_event_device *bc;
290 unsigned long flags;
291
292 spin_lock_irqsave(&tick_broadcast_lock, flags);
293
294 bc = tick_broadcast_device.evtdev;
295 if (bc && tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)
296 clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
297
298 spin_unlock_irqrestore(&tick_broadcast_lock, flags);
299}
300
301int tick_resume_broadcast(void)
302{
303 struct clock_event_device *bc;
304 unsigned long flags;
305 int broadcast = 0;
306
307 spin_lock_irqsave(&tick_broadcast_lock, flags);
308
309 bc = tick_broadcast_device.evtdev;
310 if (bc) {
311 if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC &&
312 !cpus_empty(tick_broadcast_mask))
313 tick_broadcast_start_periodic(bc);
314
315 broadcast = cpu_isset(smp_processor_id(), tick_broadcast_mask);
316 }
317 spin_unlock_irqrestore(&tick_broadcast_lock, flags);
318
319 return broadcast;
320}
321
322
287#ifdef CONFIG_TICK_ONESHOT 323#ifdef CONFIG_TICK_ONESHOT
288 324
289static cpumask_t tick_broadcast_oneshot_mask; 325static cpumask_t tick_broadcast_oneshot_mask;
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 0986a2bfab49..43ba1bdec14c 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -298,6 +298,28 @@ static void tick_shutdown(unsigned int *cpup)
298 spin_unlock_irqrestore(&tick_device_lock, flags); 298 spin_unlock_irqrestore(&tick_device_lock, flags);
299} 299}
300 300
301static void tick_suspend_periodic(void)
302{
303 struct tick_device *td = &__get_cpu_var(tick_cpu_device);
304 unsigned long flags;
305
306 spin_lock_irqsave(&tick_device_lock, flags);
307 if (td->mode == TICKDEV_MODE_PERIODIC)
308 clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_SHUTDOWN);
309 spin_unlock_irqrestore(&tick_device_lock, flags);
310}
311
312static void tick_resume_periodic(void)
313{
314 struct tick_device *td = &__get_cpu_var(tick_cpu_device);
315 unsigned long flags;
316
317 spin_lock_irqsave(&tick_device_lock, flags);
318 if (td->mode == TICKDEV_MODE_PERIODIC)
319 tick_setup_periodic(td->evtdev, 0);
320 spin_unlock_irqrestore(&tick_device_lock, flags);
321}
322
301/* 323/*
302 * Notification about clock event devices 324 * Notification about clock event devices
303 */ 325 */
@@ -325,6 +347,16 @@ static int tick_notify(struct notifier_block *nb, unsigned long reason,
325 tick_shutdown(dev); 347 tick_shutdown(dev);
326 break; 348 break;
327 349
350 case CLOCK_EVT_NOTIFY_SUSPEND:
351 tick_suspend_periodic();
352 tick_suspend_broadcast();
353 break;
354
355 case CLOCK_EVT_NOTIFY_RESUME:
356 if (!tick_resume_broadcast())
357 tick_resume_periodic();
358 break;
359
328 default: 360 default:
329 break; 361 break;
330 } 362 }
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
index 54861a0f29ff..75890efd24ff 100644
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -67,6 +67,8 @@ extern int tick_check_broadcast_device(struct clock_event_device *dev);
67extern int tick_is_broadcast_device(struct clock_event_device *dev); 67extern int tick_is_broadcast_device(struct clock_event_device *dev);
68extern void tick_broadcast_on_off(unsigned long reason, int *oncpu); 68extern void tick_broadcast_on_off(unsigned long reason, int *oncpu);
69extern void tick_shutdown_broadcast(unsigned int *cpup); 69extern void tick_shutdown_broadcast(unsigned int *cpup);
70extern void tick_suspend_broadcast(void);
71extern int tick_resume_broadcast(void);
70 72
71extern void 73extern void
72tick_set_periodic_handler(struct clock_event_device *dev, int broadcast); 74tick_set_periodic_handler(struct clock_event_device *dev, int broadcast);
@@ -90,6 +92,8 @@ static inline int tick_device_uses_broadcast(struct clock_event_device *dev,
90static inline void tick_do_periodic_broadcast(struct clock_event_device *d) { } 92static inline void tick_do_periodic_broadcast(struct clock_event_device *d) { }
91static inline void tick_broadcast_on_off(unsigned long reason, int *oncpu) { } 93static inline void tick_broadcast_on_off(unsigned long reason, int *oncpu) { }
92static inline void tick_shutdown_broadcast(unsigned int *cpup) { } 94static inline void tick_shutdown_broadcast(unsigned int *cpup) { }
95static inline void tick_suspend_broadcast(void) { }
96static inline int tick_resume_broadcast(void) { return 0; }
93 97
94/* 98/*
95 * Set the periodic handler in non broadcast mode 99 * Set the periodic handler in non broadcast mode
diff --git a/kernel/timer.c b/kernel/timer.c
index 8ad384253ef2..797cccb86431 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -862,6 +862,8 @@ int do_settimeofday(struct timespec *tv)
862 clock->error = 0; 862 clock->error = 0;
863 ntp_clear(); 863 ntp_clear();
864 864
865 update_vsyscall(&xtime, clock);
866
865 write_sequnlock_irqrestore(&xtime_lock, flags); 867 write_sequnlock_irqrestore(&xtime_lock, flags);
866 868
867 /* signal hrtimers about time change */ 869 /* signal hrtimers about time change */
@@ -997,6 +999,9 @@ static int timekeeping_resume(struct sys_device *dev)
997 write_sequnlock_irqrestore(&xtime_lock, flags); 999 write_sequnlock_irqrestore(&xtime_lock, flags);
998 1000
999 touch_softlockup_watchdog(); 1001 touch_softlockup_watchdog();
1002
1003 clockevents_notify(CLOCK_EVT_NOTIFY_RESUME, NULL);
1004
1000 /* Resume hrtimers */ 1005 /* Resume hrtimers */
1001 clock_was_set(); 1006 clock_was_set();
1002 1007
@@ -1011,6 +1016,9 @@ static int timekeeping_suspend(struct sys_device *dev, pm_message_t state)
1011 timekeeping_suspended = 1; 1016 timekeeping_suspended = 1;
1012 timekeeping_suspend_time = read_persistent_clock(); 1017 timekeeping_suspend_time = read_persistent_clock();
1013 write_sequnlock_irqrestore(&xtime_lock, flags); 1018 write_sequnlock_irqrestore(&xtime_lock, flags);
1019
1020 clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
1021
1014 return 0; 1022 return 0;
1015} 1023}
1016 1024
diff --git a/lib/kobject.c b/lib/kobject.c
index f4f6176dcd12..057921c5945a 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -385,9 +385,11 @@ int kobject_move(struct kobject *kobj, struct kobject *new_parent)
385 goto out; 385 goto out;
386 old_parent = kobj->parent; 386 old_parent = kobj->parent;
387 kobj->parent = new_parent; 387 kobj->parent = new_parent;
388 new_parent = NULL;
388 kobject_put(old_parent); 389 kobject_put(old_parent);
389 kobject_uevent_env(kobj, KOBJ_MOVE, envp); 390 kobject_uevent_env(kobj, KOBJ_MOVE, envp);
390out: 391out:
392 kobject_put(new_parent);
391 kobject_put(kobj); 393 kobject_put(kobj);
392 kfree(devpath_string); 394 kfree(devpath_string);
393 kfree(devpath); 395 kfree(devpath);
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 623a68af8b18..9970e55c90bd 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -28,7 +28,6 @@
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/dma.h> 29#include <asm/dma.h>
30#include <asm/scatterlist.h> 30#include <asm/scatterlist.h>
31#include <asm/swiotlb.h>
32 31
33#include <linux/init.h> 32#include <linux/init.h>
34#include <linux/bootmem.h> 33#include <linux/bootmem.h>
@@ -36,10 +35,8 @@
36#define OFFSET(val,align) ((unsigned long) \ 35#define OFFSET(val,align) ((unsigned long) \
37 ( (val) & ( (align) - 1))) 36 ( (val) & ( (align) - 1)))
38 37
39#ifndef SG_ENT_VIRT_ADDRESS
40#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset) 38#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)
41#define SG_ENT_PHYS_ADDRESS(sg) virt_to_bus(SG_ENT_VIRT_ADDRESS(sg)) 39#define SG_ENT_PHYS_ADDRESS(sg) virt_to_bus(SG_ENT_VIRT_ADDRESS(sg))
42#endif
43 40
44/* 41/*
45 * Maximum allowable number of contiguous slabs to map, 42 * Maximum allowable number of contiguous slabs to map,
@@ -104,25 +101,13 @@ static unsigned int io_tlb_index;
104 * We need to save away the original address corresponding to a mapped entry 101 * We need to save away the original address corresponding to a mapped entry
105 * for the sync operations. 102 * for the sync operations.
106 */ 103 */
107#ifndef SWIOTLB_ARCH_HAS_IO_TLB_ADDR_T 104static unsigned char **io_tlb_orig_addr;
108typedef char *io_tlb_addr_t;
109#define swiotlb_orig_addr_null(buffer) (!(buffer))
110#define ptr_to_io_tlb_addr(ptr) (ptr)
111#define page_to_io_tlb_addr(pg, off) (page_address(pg) + (off))
112#define sg_to_io_tlb_addr(sg) SG_ENT_VIRT_ADDRESS(sg)
113#endif
114static io_tlb_addr_t *io_tlb_orig_addr;
115 105
116/* 106/*
117 * Protect the above data structures in the map and unmap calls 107 * Protect the above data structures in the map and unmap calls
118 */ 108 */
119static DEFINE_SPINLOCK(io_tlb_lock); 109static DEFINE_SPINLOCK(io_tlb_lock);
120 110
121#ifdef SWIOTLB_EXTRA_VARIABLES
122SWIOTLB_EXTRA_VARIABLES;
123#endif
124
125#ifndef SWIOTLB_ARCH_HAS_SETUP_IO_TLB_NPAGES
126static int __init 111static int __init
127setup_io_tlb_npages(char *str) 112setup_io_tlb_npages(char *str)
128{ 113{
@@ -137,25 +122,9 @@ setup_io_tlb_npages(char *str)
137 swiotlb_force = 1; 122 swiotlb_force = 1;
138 return 1; 123 return 1;
139} 124}
140#endif
141__setup("swiotlb=", setup_io_tlb_npages); 125__setup("swiotlb=", setup_io_tlb_npages);
142/* make io_tlb_overflow tunable too? */ 126/* make io_tlb_overflow tunable too? */
143 127
144#ifndef swiotlb_adjust_size
145#define swiotlb_adjust_size(size) ((void)0)
146#endif
147
148#ifndef swiotlb_adjust_seg
149#define swiotlb_adjust_seg(start, size) ((void)0)
150#endif
151
152#ifndef swiotlb_print_info
153#define swiotlb_print_info(bytes) \
154 printk(KERN_INFO "Placing %luMB software IO TLB between 0x%lx - " \
155 "0x%lx\n", bytes >> 20, \
156 virt_to_bus(io_tlb_start), virt_to_bus(io_tlb_end))
157#endif
158
159/* 128/*
160 * Statically reserve bounce buffer space and initialize bounce buffer data 129 * Statically reserve bounce buffer space and initialize bounce buffer data
161 * structures for the software IO TLB used to implement the DMA API. 130 * structures for the software IO TLB used to implement the DMA API.
@@ -169,8 +138,6 @@ swiotlb_init_with_default_size(size_t default_size)
169 io_tlb_nslabs = (default_size >> IO_TLB_SHIFT); 138 io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
170 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); 139 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
171 } 140 }
172 swiotlb_adjust_size(io_tlb_nslabs);
173 swiotlb_adjust_size(io_tlb_overflow);
174 141
175 bytes = io_tlb_nslabs << IO_TLB_SHIFT; 142 bytes = io_tlb_nslabs << IO_TLB_SHIFT;
176 143
@@ -188,14 +155,10 @@ swiotlb_init_with_default_size(size_t default_size)
188 * between io_tlb_start and io_tlb_end. 155 * between io_tlb_start and io_tlb_end.
189 */ 156 */
190 io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int)); 157 io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int));
191 for (i = 0; i < io_tlb_nslabs; i++) { 158 for (i = 0; i < io_tlb_nslabs; i++)
192 if ( !(i % IO_TLB_SEGSIZE) )
193 swiotlb_adjust_seg(io_tlb_start + (i << IO_TLB_SHIFT),
194 IO_TLB_SEGSIZE << IO_TLB_SHIFT);
195 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE); 159 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
196 }
197 io_tlb_index = 0; 160 io_tlb_index = 0;
198 io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(io_tlb_addr_t)); 161 io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *));
199 162
200 /* 163 /*
201 * Get the overflow emergency buffer 164 * Get the overflow emergency buffer
@@ -203,21 +166,17 @@ swiotlb_init_with_default_size(size_t default_size)
203 io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); 166 io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
204 if (!io_tlb_overflow_buffer) 167 if (!io_tlb_overflow_buffer)
205 panic("Cannot allocate SWIOTLB overflow buffer!\n"); 168 panic("Cannot allocate SWIOTLB overflow buffer!\n");
206 swiotlb_adjust_seg(io_tlb_overflow_buffer, io_tlb_overflow);
207 169
208 swiotlb_print_info(bytes); 170 printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n",
171 virt_to_bus(io_tlb_start), virt_to_bus(io_tlb_end));
209} 172}
210#ifndef __swiotlb_init_with_default_size
211#define __swiotlb_init_with_default_size swiotlb_init_with_default_size
212#endif
213 173
214void __init 174void __init
215swiotlb_init(void) 175swiotlb_init(void)
216{ 176{
217 __swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */ 177 swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */
218} 178}
219 179
220#ifdef SWIOTLB_ARCH_NEED_LATE_INIT
221/* 180/*
222 * Systems with larger DMA zones (those that don't support ISA) can 181 * Systems with larger DMA zones (those that don't support ISA) can
223 * initialize the swiotlb later using the slab allocator if needed. 182 * initialize the swiotlb later using the slab allocator if needed.
@@ -275,12 +234,12 @@ swiotlb_late_init_with_default_size(size_t default_size)
275 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE); 234 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
276 io_tlb_index = 0; 235 io_tlb_index = 0;
277 236
278 io_tlb_orig_addr = (io_tlb_addr_t *)__get_free_pages(GFP_KERNEL, 237 io_tlb_orig_addr = (unsigned char **)__get_free_pages(GFP_KERNEL,
279 get_order(io_tlb_nslabs * sizeof(io_tlb_addr_t))); 238 get_order(io_tlb_nslabs * sizeof(char *)));
280 if (!io_tlb_orig_addr) 239 if (!io_tlb_orig_addr)
281 goto cleanup3; 240 goto cleanup3;
282 241
283 memset(io_tlb_orig_addr, 0, io_tlb_nslabs * sizeof(io_tlb_addr_t)); 242 memset(io_tlb_orig_addr, 0, io_tlb_nslabs * sizeof(char *));
284 243
285 /* 244 /*
286 * Get the overflow emergency buffer 245 * Get the overflow emergency buffer
@@ -290,17 +249,19 @@ swiotlb_late_init_with_default_size(size_t default_size)
290 if (!io_tlb_overflow_buffer) 249 if (!io_tlb_overflow_buffer)
291 goto cleanup4; 250 goto cleanup4;
292 251
293 swiotlb_print_info(bytes); 252 printk(KERN_INFO "Placing %luMB software IO TLB between 0x%lx - "
253 "0x%lx\n", bytes >> 20,
254 virt_to_bus(io_tlb_start), virt_to_bus(io_tlb_end));
294 255
295 return 0; 256 return 0;
296 257
297cleanup4: 258cleanup4:
298 free_pages((unsigned long)io_tlb_orig_addr, 259 free_pages((unsigned long)io_tlb_orig_addr, get_order(io_tlb_nslabs *
299 get_order(io_tlb_nslabs * sizeof(io_tlb_addr_t))); 260 sizeof(char *)));
300 io_tlb_orig_addr = NULL; 261 io_tlb_orig_addr = NULL;
301cleanup3: 262cleanup3:
302 free_pages((unsigned long)io_tlb_list, 263 free_pages((unsigned long)io_tlb_list, get_order(io_tlb_nslabs *
303 get_order(io_tlb_nslabs * sizeof(int))); 264 sizeof(int)));
304 io_tlb_list = NULL; 265 io_tlb_list = NULL;
305cleanup2: 266cleanup2:
306 io_tlb_end = NULL; 267 io_tlb_end = NULL;
@@ -310,9 +271,7 @@ cleanup1:
310 io_tlb_nslabs = req_nslabs; 271 io_tlb_nslabs = req_nslabs;
311 return -ENOMEM; 272 return -ENOMEM;
312} 273}
313#endif
314 274
315#ifndef SWIOTLB_ARCH_HAS_NEEDS_MAPPING
316static int 275static int
317address_needs_mapping(struct device *hwdev, dma_addr_t addr) 276address_needs_mapping(struct device *hwdev, dma_addr_t addr)
318{ 277{
@@ -323,35 +282,11 @@ address_needs_mapping(struct device *hwdev, dma_addr_t addr)
323 return (addr & ~mask) != 0; 282 return (addr & ~mask) != 0;
324} 283}
325 284
326static inline int range_needs_mapping(const void *ptr, size_t size)
327{
328 return swiotlb_force;
329}
330
331static inline int order_needs_mapping(unsigned int order)
332{
333 return 0;
334}
335#endif
336
337static void
338__sync_single(io_tlb_addr_t buffer, char *dma_addr, size_t size, int dir)
339{
340#ifndef SWIOTLB_ARCH_HAS_SYNC_SINGLE
341 if (dir == DMA_TO_DEVICE)
342 memcpy(dma_addr, buffer, size);
343 else
344 memcpy(buffer, dma_addr, size);
345#else
346 __swiotlb_arch_sync_single(buffer, dma_addr, size, dir);
347#endif
348}
349
350/* 285/*
351 * Allocates bounce buffer and returns its kernel virtual address. 286 * Allocates bounce buffer and returns its kernel virtual address.
352 */ 287 */
353static void * 288static void *
354map_single(struct device *hwdev, io_tlb_addr_t buffer, size_t size, int dir) 289map_single(struct device *hwdev, char *buffer, size_t size, int dir)
355{ 290{
356 unsigned long flags; 291 unsigned long flags;
357 char *dma_addr; 292 char *dma_addr;
@@ -424,7 +359,7 @@ map_single(struct device *hwdev, io_tlb_addr_t buffer, size_t size, int dir)
424 */ 359 */
425 io_tlb_orig_addr[index] = buffer; 360 io_tlb_orig_addr[index] = buffer;
426 if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) 361 if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)
427 __sync_single(buffer, dma_addr, size, DMA_TO_DEVICE); 362 memcpy(dma_addr, buffer, size);
428 363
429 return dma_addr; 364 return dma_addr;
430} 365}
@@ -438,18 +373,17 @@ unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
438 unsigned long flags; 373 unsigned long flags;
439 int i, count, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT; 374 int i, count, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
440 int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT; 375 int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
441 io_tlb_addr_t buffer = io_tlb_orig_addr[index]; 376 char *buffer = io_tlb_orig_addr[index];
442 377
443 /* 378 /*
444 * First, sync the memory before unmapping the entry 379 * First, sync the memory before unmapping the entry
445 */ 380 */
446 if (!swiotlb_orig_addr_null(buffer) 381 if (buffer && ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL)))
447 && ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL)))
448 /* 382 /*
449 * bounce... copy the data back into the original buffer * and 383 * bounce... copy the data back into the original buffer * and
450 * delete the bounce buffer. 384 * delete the bounce buffer.
451 */ 385 */
452 __sync_single(buffer, dma_addr, size, DMA_FROM_DEVICE); 386 memcpy(buffer, dma_addr, size);
453 387
454 /* 388 /*
455 * Return the buffer to the free list by setting the corresponding 389 * Return the buffer to the free list by setting the corresponding
@@ -482,18 +416,18 @@ sync_single(struct device *hwdev, char *dma_addr, size_t size,
482 int dir, int target) 416 int dir, int target)
483{ 417{
484 int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT; 418 int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
485 io_tlb_addr_t buffer = io_tlb_orig_addr[index]; 419 char *buffer = io_tlb_orig_addr[index];
486 420
487 switch (target) { 421 switch (target) {
488 case SYNC_FOR_CPU: 422 case SYNC_FOR_CPU:
489 if (likely(dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL)) 423 if (likely(dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL))
490 __sync_single(buffer, dma_addr, size, DMA_FROM_DEVICE); 424 memcpy(buffer, dma_addr, size);
491 else 425 else
492 BUG_ON(dir != DMA_TO_DEVICE); 426 BUG_ON(dir != DMA_TO_DEVICE);
493 break; 427 break;
494 case SYNC_FOR_DEVICE: 428 case SYNC_FOR_DEVICE:
495 if (likely(dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)) 429 if (likely(dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL))
496 __sync_single(buffer, dma_addr, size, DMA_TO_DEVICE); 430 memcpy(dma_addr, buffer, size);
497 else 431 else
498 BUG_ON(dir != DMA_FROM_DEVICE); 432 BUG_ON(dir != DMA_FROM_DEVICE);
499 break; 433 break;
@@ -502,8 +436,6 @@ sync_single(struct device *hwdev, char *dma_addr, size_t size,
502 } 436 }
503} 437}
504 438
505#ifdef SWIOTLB_ARCH_NEED_ALLOC
506
507void * 439void *
508swiotlb_alloc_coherent(struct device *hwdev, size_t size, 440swiotlb_alloc_coherent(struct device *hwdev, size_t size,
509 dma_addr_t *dma_handle, gfp_t flags) 441 dma_addr_t *dma_handle, gfp_t flags)
@@ -519,10 +451,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
519 */ 451 */
520 flags |= GFP_DMA; 452 flags |= GFP_DMA;
521 453
522 if (!order_needs_mapping(order)) 454 ret = (void *)__get_free_pages(flags, order);
523 ret = (void *)__get_free_pages(flags, order);
524 else
525 ret = NULL;
526 if (ret && address_needs_mapping(hwdev, virt_to_bus(ret))) { 455 if (ret && address_needs_mapping(hwdev, virt_to_bus(ret))) {
527 /* 456 /*
528 * The allocated memory isn't reachable by the device. 457 * The allocated memory isn't reachable by the device.
@@ -560,7 +489,6 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
560 *dma_handle = dev_addr; 489 *dma_handle = dev_addr;
561 return ret; 490 return ret;
562} 491}
563EXPORT_SYMBOL(swiotlb_alloc_coherent);
564 492
565void 493void
566swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, 494swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
@@ -573,9 +501,6 @@ swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
573 /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ 501 /* DMA_TO_DEVICE to avoid memcpy in unmap_single */
574 swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE); 502 swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE);
575} 503}
576EXPORT_SYMBOL(swiotlb_free_coherent);
577
578#endif
579 504
580static void 505static void
581swiotlb_full(struct device *dev, size_t size, int dir, int do_panic) 506swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
@@ -617,14 +542,13 @@ swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir)
617 * we can safely return the device addr and not worry about bounce 542 * we can safely return the device addr and not worry about bounce
618 * buffering it. 543 * buffering it.
619 */ 544 */
620 if (!range_needs_mapping(ptr, size) 545 if (!address_needs_mapping(hwdev, dev_addr) && !swiotlb_force)
621 && !address_needs_mapping(hwdev, dev_addr))
622 return dev_addr; 546 return dev_addr;
623 547
624 /* 548 /*
625 * Oh well, have to allocate and map a bounce buffer. 549 * Oh well, have to allocate and map a bounce buffer.
626 */ 550 */
627 map = map_single(hwdev, ptr_to_io_tlb_addr(ptr), size, dir); 551 map = map_single(hwdev, ptr, size, dir);
628 if (!map) { 552 if (!map) {
629 swiotlb_full(hwdev, size, dir, 1); 553 swiotlb_full(hwdev, size, dir, 1);
630 map = io_tlb_overflow_buffer; 554 map = io_tlb_overflow_buffer;
@@ -752,16 +676,17 @@ int
752swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems, 676swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
753 int dir) 677 int dir)
754{ 678{
679 void *addr;
755 dma_addr_t dev_addr; 680 dma_addr_t dev_addr;
756 int i; 681 int i;
757 682
758 BUG_ON(dir == DMA_NONE); 683 BUG_ON(dir == DMA_NONE);
759 684
760 for (i = 0; i < nelems; i++, sg++) { 685 for (i = 0; i < nelems; i++, sg++) {
761 dev_addr = SG_ENT_PHYS_ADDRESS(sg); 686 addr = SG_ENT_VIRT_ADDRESS(sg);
762 if (range_needs_mapping(SG_ENT_VIRT_ADDRESS(sg), sg->length) 687 dev_addr = virt_to_bus(addr);
763 || address_needs_mapping(hwdev, dev_addr)) { 688 if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) {
764 void *map = map_single(hwdev, sg_to_io_tlb_addr(sg), sg->length, dir); 689 void *map = map_single(hwdev, addr, sg->length, dir);
765 if (!map) { 690 if (!map) {
766 /* Don't panic here, we expect map_sg users 691 /* Don't panic here, we expect map_sg users
767 to do proper error handling. */ 692 to do proper error handling. */
@@ -835,44 +760,6 @@ swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
835 swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_DEVICE); 760 swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_DEVICE);
836} 761}
837 762
838#ifdef SWIOTLB_ARCH_NEED_MAP_PAGE
839
840dma_addr_t
841swiotlb_map_page(struct device *hwdev, struct page *page,
842 unsigned long offset, size_t size,
843 enum dma_data_direction direction)
844{
845 dma_addr_t dev_addr;
846 char *map;
847
848 dev_addr = page_to_bus(page) + offset;
849 if (address_needs_mapping(hwdev, dev_addr)) {
850 map = map_single(hwdev, page_to_io_tlb_addr(page, offset), size, direction);
851 if (!map) {
852 swiotlb_full(hwdev, size, direction, 1);
853 map = io_tlb_overflow_buffer;
854 }
855 dev_addr = virt_to_bus(map);
856 }
857
858 return dev_addr;
859}
860
861void
862swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr,
863 size_t size, enum dma_data_direction direction)
864{
865 char *dma_addr = bus_to_virt(dev_addr);
866
867 BUG_ON(direction == DMA_NONE);
868 if (dma_addr >= io_tlb_start && dma_addr < io_tlb_end)
869 unmap_single(hwdev, dma_addr, size, direction);
870 else if (direction == DMA_FROM_DEVICE)
871 dma_mark_clean(dma_addr, size);
872}
873
874#endif
875
876int 763int
877swiotlb_dma_mapping_error(dma_addr_t dma_addr) 764swiotlb_dma_mapping_error(dma_addr_t dma_addr)
878{ 765{
@@ -885,13 +772,10 @@ swiotlb_dma_mapping_error(dma_addr_t dma_addr)
885 * during bus mastering, then you would pass 0x00ffffff as the mask to 772 * during bus mastering, then you would pass 0x00ffffff as the mask to
886 * this function. 773 * this function.
887 */ 774 */
888#ifndef __swiotlb_dma_supported
889#define __swiotlb_dma_supported(hwdev, mask) (virt_to_bus(io_tlb_end - 1) <= (mask))
890#endif
891int 775int
892swiotlb_dma_supported(struct device *hwdev, u64 mask) 776swiotlb_dma_supported(struct device *hwdev, u64 mask)
893{ 777{
894 return __swiotlb_dma_supported(hwdev, mask); 778 return virt_to_bus(io_tlb_end - 1) <= mask;
895} 779}
896 780
897EXPORT_SYMBOL(swiotlb_init); 781EXPORT_SYMBOL(swiotlb_init);
@@ -906,4 +790,6 @@ EXPORT_SYMBOL_GPL(swiotlb_sync_single_range_for_device);
906EXPORT_SYMBOL(swiotlb_sync_sg_for_cpu); 790EXPORT_SYMBOL(swiotlb_sync_sg_for_cpu);
907EXPORT_SYMBOL(swiotlb_sync_sg_for_device); 791EXPORT_SYMBOL(swiotlb_sync_sg_for_device);
908EXPORT_SYMBOL(swiotlb_dma_mapping_error); 792EXPORT_SYMBOL(swiotlb_dma_mapping_error);
793EXPORT_SYMBOL(swiotlb_alloc_coherent);
794EXPORT_SYMBOL(swiotlb_free_coherent);
909EXPORT_SYMBOL(swiotlb_dma_supported); 795EXPORT_SYMBOL(swiotlb_dma_supported);
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index f928d2b2a17d..71f5cfbbebb8 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -656,7 +656,7 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
656 /* Detach sockets from device */ 656 /* Detach sockets from device */
657 read_lock(&hci_sk_list.lock); 657 read_lock(&hci_sk_list.lock);
658 sk_for_each(sk, node, &hci_sk_list.head) { 658 sk_for_each(sk, node, &hci_sk_list.head) {
659 bh_lock_sock(sk); 659 lock_sock(sk);
660 if (hci_pi(sk)->hdev == hdev) { 660 if (hci_pi(sk)->hdev == hdev) {
661 hci_pi(sk)->hdev = NULL; 661 hci_pi(sk)->hdev = NULL;
662 sk->sk_err = EPIPE; 662 sk->sk_err = EPIPE;
@@ -665,7 +665,7 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
665 665
666 hci_dev_put(hdev); 666 hci_dev_put(hdev);
667 } 667 }
668 bh_unlock_sock(sk); 668 release_sock(sk);
669 } 669 }
670 read_unlock(&hci_sk_list.lock); 670 read_unlock(&hci_sk_list.lock);
671 } 671 }
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 6845a258408f..f3a2e29be40c 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -428,6 +428,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
428 spin_lock_bh(&br->lock); 428 spin_lock_bh(&br->lock);
429 br_stp_recalculate_bridge_id(br); 429 br_stp_recalculate_bridge_id(br);
430 br_features_recompute(br); 430 br_features_recompute(br);
431
432 if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) &&
433 (br->dev->flags & IFF_UP))
434 br_stp_enable_port(p);
431 spin_unlock_bh(&br->lock); 435 spin_unlock_bh(&br->lock);
432 436
433 dev_set_mtu(br->dev, br_min_mtu(br)); 437 dev_set_mtu(br->dev, br_min_mtu(br));
diff --git a/net/core/sock.c b/net/core/sock.c
index e9986acdd0ab..8d65d6478dcd 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1597,7 +1597,7 @@ int compat_sock_common_getsockopt(struct socket *sock, int level, int optname,
1597{ 1597{
1598 struct sock *sk = sock->sk; 1598 struct sock *sk = sock->sk;
1599 1599
1600 if (sk->sk_prot->compat_setsockopt != NULL) 1600 if (sk->sk_prot->compat_getsockopt != NULL)
1601 return sk->sk_prot->compat_getsockopt(sk, level, optname, 1601 return sk->sk_prot->compat_getsockopt(sk, level, optname,
1602 optval, optlen); 1602 optval, optlen);
1603 return sk->sk_prot->getsockopt(sk, level, optname, optval, optlen); 1603 return sk->sk_prot->getsockopt(sk, level, optname, optval, optlen);
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 5361a4d8e13b..746f79d104b3 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -545,12 +545,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
545 /* set idle flag */ 545 /* set idle flag */
546 hctx->ccid3hctx_idle = 1; 546 hctx->ccid3hctx_idle = 1;
547 break; 547 break;
548 case TFRC_SSTATE_NO_SENT: 548 case TFRC_SSTATE_NO_SENT: /* fall through */
549 /*
550 * XXX when implementing bidirectional rx/tx check this again
551 */
552 DCCP_WARN("Illegal ACK received - no packet sent\n");
553 /* fall through */
554 case TFRC_SSTATE_TERM: /* ignore feedback when closing */ 549 case TFRC_SSTATE_TERM: /* ignore feedback when closing */
555 break; 550 break;
556 } 551 }
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index e33a9edb4036..a0e7cd183a5d 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -191,6 +191,7 @@ extern void dccp_send_sync(struct sock *sk, const u64 seq,
191 const enum dccp_pkt_type pkt_type); 191 const enum dccp_pkt_type pkt_type);
192 192
193extern void dccp_write_xmit(struct sock *sk, int block); 193extern void dccp_write_xmit(struct sock *sk, int block);
194extern void dccp_write_xmit_timer(unsigned long data);
194extern void dccp_write_space(struct sock *sk); 195extern void dccp_write_space(struct sock *sk);
195 196
196extern void dccp_init_xmit_timers(struct sock *sk); 197extern void dccp_init_xmit_timers(struct sock *sk);
diff --git a/net/dccp/input.c b/net/dccp/input.c
index 4dee462f00db..78b043c458bf 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -248,18 +248,8 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
248 DCCP_ACKVEC_STATE_RECEIVED)) 248 DCCP_ACKVEC_STATE_RECEIVED))
249 goto discard; 249 goto discard;
250 250
251 /* 251 ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb);
252 * Deliver to the CCID module in charge. 252 ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb);
253 * FIXME: Currently DCCP operates one-directional only, i.e. a listening
254 * server is not at the same time a connecting client. There is
255 * not much sense in delivering to both rx/tx sides at the moment
256 * (only one is active at a time); when moving to bidirectional
257 * service, this needs to be revised.
258 */
259 if (dccp_sk(sk)->dccps_role == DCCP_ROLE_SERVER)
260 ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb);
261 else
262 ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb);
263 253
264 return __dccp_rcv_established(sk, skb, dh, len); 254 return __dccp_rcv_established(sk, skb, dh, len);
265discard: 255discard:
@@ -494,11 +484,8 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
494 DCCP_ACKVEC_STATE_RECEIVED)) 484 DCCP_ACKVEC_STATE_RECEIVED))
495 goto discard; 485 goto discard;
496 486
497 /* XXX see the comments in dccp_rcv_established about this */ 487 ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb);
498 if (dccp_sk(sk)->dccps_role == DCCP_ROLE_SERVER) 488 ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb);
499 ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb);
500 else
501 ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb);
502 } 489 }
503 490
504 /* 491 /*
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index 6656bb497c7b..6d235b3013dd 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -103,7 +103,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk,
103 103
104 if (newsk != NULL) { 104 if (newsk != NULL) {
105 const struct dccp_request_sock *dreq = dccp_rsk(req); 105 const struct dccp_request_sock *dreq = dccp_rsk(req);
106 struct inet_connection_sock *newicsk = inet_csk(sk); 106 struct inet_connection_sock *newicsk = inet_csk(newsk);
107 struct dccp_sock *newdp = dccp_sk(newsk); 107 struct dccp_sock *newdp = dccp_sk(newsk);
108 struct dccp_minisock *newdmsk = dccp_msk(newsk); 108 struct dccp_minisock *newdmsk = dccp_msk(newsk);
109 109
diff --git a/net/dccp/output.c b/net/dccp/output.c
index 3282f2f2291b..aa21cc4de37f 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -213,19 +213,6 @@ do_interrupted:
213 goto out; 213 goto out;
214} 214}
215 215
216static void dccp_write_xmit_timer(unsigned long data) {
217 struct sock *sk = (struct sock *)data;
218 struct dccp_sock *dp = dccp_sk(sk);
219
220 bh_lock_sock(sk);
221 if (sock_owned_by_user(sk))
222 sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies+1);
223 else
224 dccp_write_xmit(sk, 0);
225 bh_unlock_sock(sk);
226 sock_put(sk);
227}
228
229void dccp_write_xmit(struct sock *sk, int block) 216void dccp_write_xmit(struct sock *sk, int block)
230{ 217{
231 struct dccp_sock *dp = dccp_sk(sk); 218 struct dccp_sock *dp = dccp_sk(sk);
@@ -434,9 +421,6 @@ static inline void dccp_connect_init(struct sock *sk)
434 dp->dccps_gar = dp->dccps_iss; 421 dp->dccps_gar = dp->dccps_iss;
435 422
436 icsk->icsk_retransmits = 0; 423 icsk->icsk_retransmits = 0;
437 init_timer(&dp->dccps_xmit_timer);
438 dp->dccps_xmit_timer.data = (unsigned long)sk;
439 dp->dccps_xmit_timer.function = dccp_write_xmit_timer;
440} 424}
441 425
442int dccp_connect(struct sock *sk) 426int dccp_connect(struct sock *sk)
diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index 41ea0f6594c4..b038a0a3ad40 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -261,8 +261,33 @@ out:
261 sock_put(sk); 261 sock_put(sk);
262} 262}
263 263
264/* Transmit-delay timer: used by the CCIDs to delay actual send time */
265void dccp_write_xmit_timer(unsigned long data)
266{
267 struct sock *sk = (struct sock *)data;
268 struct dccp_sock *dp = dccp_sk(sk);
269
270 bh_lock_sock(sk);
271 if (sock_owned_by_user(sk))
272 sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies+1);
273 else
274 dccp_write_xmit(sk, 0);
275 bh_unlock_sock(sk);
276 sock_put(sk);
277}
278
279static void dccp_init_write_xmit_timer(struct sock *sk)
280{
281 struct dccp_sock *dp = dccp_sk(sk);
282
283 init_timer(&dp->dccps_xmit_timer);
284 dp->dccps_xmit_timer.data = (unsigned long)sk;
285 dp->dccps_xmit_timer.function = dccp_write_xmit_timer;
286}
287
264void dccp_init_xmit_timers(struct sock *sk) 288void dccp_init_xmit_timers(struct sock *sk)
265{ 289{
290 dccp_init_write_xmit_timer(sk);
266 inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer, 291 inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer,
267 &dccp_keepalive_timer); 292 &dccp_keepalive_timer);
268} 293}
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index c976dd7e9758..2ce5b693a8bd 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -1933,6 +1933,11 @@ int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
1933 &cipso_ptr[6], 1933 &cipso_ptr[6],
1934 secattr); 1934 secattr);
1935 break; 1935 break;
1936 case CIPSO_V4_TAG_RANGE:
1937 ret_val = cipso_v4_parsetag_rng(doi_def,
1938 &cipso_ptr[6],
1939 secattr);
1940 break;
1936 } 1941 }
1937 1942
1938skbuff_getattr_return: 1943skbuff_getattr_return:
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index e10794dc5f64..98a00d0edc76 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -502,8 +502,10 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
502 goto errout; 502 goto errout;
503 503
504 ifm = nlmsg_data(nlh); 504 ifm = nlmsg_data(nlh);
505 if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL) 505 if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL) {
506 err = -EINVAL;
506 goto errout; 507 goto errout;
508 }
507 509
508 dev = __dev_get_by_index(ifm->ifa_index); 510 dev = __dev_get_by_index(ifm->ifa_index);
509 if (dev == NULL) { 511 if (dev == NULL) {
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 063721302ebf..8cedb2a2c9df 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1251,6 +1251,28 @@ out:
1251} 1251}
1252 1252
1253/* 1253/*
1254 * Resend IGMP JOIN report; used for bonding.
1255 */
1256void ip_mc_rejoin_group(struct ip_mc_list *im)
1257{
1258#ifdef CONFIG_IP_MULTICAST
1259 struct in_device *in_dev = im->interface;
1260
1261 if (im->multiaddr == IGMP_ALL_HOSTS)
1262 return;
1263
1264 if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) {
1265 igmp_mod_timer(im, IGMP_Initial_Report_Delay);
1266 return;
1267 }
1268 /* else, v3 */
1269 im->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
1270 IGMP_Unsolicited_Report_Count;
1271 igmp_ifc_event(in_dev);
1272#endif
1273}
1274
1275/*
1254 * A socket has left a multicast group on device dev 1276 * A socket has left a multicast group on device dev
1255 */ 1277 */
1256 1278
@@ -2596,3 +2618,4 @@ int __init igmp_mc_proc_init(void)
2596EXPORT_SYMBOL(ip_mc_dec_group); 2618EXPORT_SYMBOL(ip_mc_dec_group);
2597EXPORT_SYMBOL(ip_mc_inc_group); 2619EXPORT_SYMBOL(ip_mc_inc_group);
2598EXPORT_SYMBOL(ip_mc_join_group); 2620EXPORT_SYMBOL(ip_mc_join_group);
2621EXPORT_SYMBOL(ip_mc_rejoin_group);
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
index 07ba1dd136b5..23b99ae2cc37 100644
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -1254,7 +1254,7 @@ get_next_corpse(int (*iter)(struct ip_conntrack *i, void *data),
1254 list_for_each_entry(h, &unconfirmed, list) { 1254 list_for_each_entry(h, &unconfirmed, list) {
1255 ct = tuplehash_to_ctrack(h); 1255 ct = tuplehash_to_ctrack(h);
1256 if (iter(ct, data)) 1256 if (iter(ct, data))
1257 goto found; 1257 set_bit(IPS_DYING_BIT, &ct->status);
1258 } 1258 }
1259 write_unlock_bh(&ip_conntrack_lock); 1259 write_unlock_bh(&ip_conntrack_lock);
1260 return NULL; 1260 return NULL;
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
index 170d625fad67..0a72eab14620 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -812,8 +812,10 @@ void ip_conntrack_tcp_update(struct sk_buff *skb,
812static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] = 812static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] =
813{ 813{
814 [TH_SYN] = 1, 814 [TH_SYN] = 1,
815 [TH_SYN|TH_ACK] = 1,
816 [TH_SYN|TH_PUSH] = 1, 815 [TH_SYN|TH_PUSH] = 1,
816 [TH_SYN|TH_URG] = 1,
817 [TH_SYN|TH_PUSH|TH_URG] = 1,
818 [TH_SYN|TH_ACK] = 1,
817 [TH_SYN|TH_ACK|TH_PUSH] = 1, 819 [TH_SYN|TH_ACK|TH_PUSH] = 1,
818 [TH_RST] = 1, 820 [TH_RST] = 1,
819 [TH_RST|TH_ACK] = 1, 821 [TH_RST|TH_ACK] = 1,
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index b984db771258..8f3e92d20df8 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -379,8 +379,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
379 return -ENOENT; 379 return -ENOENT;
380} 380}
381 381
382#if defined(CONFIG_NF_CT_NETLINK) || \ 382#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
383 defined(CONFIG_NF_CT_NETLINK_MODULE)
384 383
385#include <linux/netfilter/nfnetlink.h> 384#include <linux/netfilter/nfnetlink.h>
386#include <linux/netfilter/nfnetlink_conntrack.h> 385#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -435,8 +434,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 = {
435 .print_conntrack = ipv4_print_conntrack, 434 .print_conntrack = ipv4_print_conntrack,
436 .prepare = ipv4_prepare, 435 .prepare = ipv4_prepare,
437 .get_features = ipv4_get_features, 436 .get_features = ipv4_get_features,
438#if defined(CONFIG_NF_CT_NETLINK) || \ 437#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
439 defined(CONFIG_NF_CT_NETLINK_MODULE)
440 .tuple_to_nfattr = ipv4_tuple_to_nfattr, 438 .tuple_to_nfattr = ipv4_tuple_to_nfattr,
441 .nfattr_to_tuple = ipv4_nfattr_to_tuple, 439 .nfattr_to_tuple = ipv4_nfattr_to_tuple,
442#endif 440#endif
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
index 88cfa6aacfc1..5fd1e5363c1a 100644
--- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
@@ -268,8 +268,7 @@ icmp_error(struct sk_buff *skb, unsigned int dataoff,
268 return icmp_error_message(skb, ctinfo, hooknum); 268 return icmp_error_message(skb, ctinfo, hooknum);
269} 269}
270 270
271#if defined(CONFIG_NF_CT_NETLINK) || \ 271#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
272 defined(CONFIG_NF_CT_NETLINK_MODULE)
273 272
274#include <linux/netfilter/nfnetlink.h> 273#include <linux/netfilter/nfnetlink.h>
275#include <linux/netfilter/nfnetlink_conntrack.h> 274#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -368,8 +367,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp =
368 .error = icmp_error, 367 .error = icmp_error,
369 .destroy = NULL, 368 .destroy = NULL,
370 .me = NULL, 369 .me = NULL,
371#if defined(CONFIG_NF_CT_NETLINK) || \ 370#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
372 defined(CONFIG_NF_CT_NETLINK_MODULE)
373 .tuple_to_nfattr = icmp_tuple_to_nfattr, 371 .tuple_to_nfattr = icmp_tuple_to_nfattr,
374 .nfattr_to_tuple = icmp_nfattr_to_tuple, 372 .nfattr_to_tuple = icmp_nfattr_to_tuple,
375#endif 373#endif
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index 2c01378d3592..452e9d326684 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -546,8 +546,7 @@ void nf_nat_protocol_unregister(struct nf_nat_protocol *proto)
546} 546}
547EXPORT_SYMBOL(nf_nat_protocol_unregister); 547EXPORT_SYMBOL(nf_nat_protocol_unregister);
548 548
549#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 549#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
550 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
551int 550int
552nf_nat_port_range_to_nfattr(struct sk_buff *skb, 551nf_nat_port_range_to_nfattr(struct sk_buff *skb,
553 const struct nf_nat_range *range) 552 const struct nf_nat_range *range)
diff --git a/net/ipv4/netfilter/nf_nat_proto_gre.c b/net/ipv4/netfilter/nf_nat_proto_gre.c
index d3de579e09d2..e5a34c17d927 100644
--- a/net/ipv4/netfilter/nf_nat_proto_gre.c
+++ b/net/ipv4/netfilter/nf_nat_proto_gre.c
@@ -152,8 +152,7 @@ static struct nf_nat_protocol gre __read_mostly = {
152 .manip_pkt = gre_manip_pkt, 152 .manip_pkt = gre_manip_pkt,
153 .in_range = gre_in_range, 153 .in_range = gre_in_range,
154 .unique_tuple = gre_unique_tuple, 154 .unique_tuple = gre_unique_tuple,
155#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 155#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
156 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
157 .range_to_nfattr = nf_nat_port_range_to_nfattr, 156 .range_to_nfattr = nf_nat_port_range_to_nfattr,
158 .nfattr_to_range = nf_nat_port_nfattr_to_range, 157 .nfattr_to_range = nf_nat_port_nfattr_to_range,
159#endif 158#endif
diff --git a/net/ipv4/netfilter/nf_nat_proto_icmp.c b/net/ipv4/netfilter/nf_nat_proto_icmp.c
index 6bc2f06de055..f71ef9b5f428 100644
--- a/net/ipv4/netfilter/nf_nat_proto_icmp.c
+++ b/net/ipv4/netfilter/nf_nat_proto_icmp.c
@@ -78,8 +78,7 @@ struct nf_nat_protocol nf_nat_protocol_icmp = {
78 .manip_pkt = icmp_manip_pkt, 78 .manip_pkt = icmp_manip_pkt,
79 .in_range = icmp_in_range, 79 .in_range = icmp_in_range,
80 .unique_tuple = icmp_unique_tuple, 80 .unique_tuple = icmp_unique_tuple,
81#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 81#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
82 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
83 .range_to_nfattr = nf_nat_port_range_to_nfattr, 82 .range_to_nfattr = nf_nat_port_range_to_nfattr,
84 .nfattr_to_range = nf_nat_port_nfattr_to_range, 83 .nfattr_to_range = nf_nat_port_nfattr_to_range,
85#endif 84#endif
diff --git a/net/ipv4/netfilter/nf_nat_proto_tcp.c b/net/ipv4/netfilter/nf_nat_proto_tcp.c
index 439164c7a626..123c95913f28 100644
--- a/net/ipv4/netfilter/nf_nat_proto_tcp.c
+++ b/net/ipv4/netfilter/nf_nat_proto_tcp.c
@@ -144,8 +144,7 @@ struct nf_nat_protocol nf_nat_protocol_tcp = {
144 .manip_pkt = tcp_manip_pkt, 144 .manip_pkt = tcp_manip_pkt,
145 .in_range = tcp_in_range, 145 .in_range = tcp_in_range,
146 .unique_tuple = tcp_unique_tuple, 146 .unique_tuple = tcp_unique_tuple,
147#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 147#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
148 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
149 .range_to_nfattr = nf_nat_port_range_to_nfattr, 148 .range_to_nfattr = nf_nat_port_range_to_nfattr,
150 .nfattr_to_range = nf_nat_port_nfattr_to_range, 149 .nfattr_to_range = nf_nat_port_nfattr_to_range,
151#endif 150#endif
diff --git a/net/ipv4/netfilter/nf_nat_proto_udp.c b/net/ipv4/netfilter/nf_nat_proto_udp.c
index 8cae6e063bb6..1c4c70e25cd4 100644
--- a/net/ipv4/netfilter/nf_nat_proto_udp.c
+++ b/net/ipv4/netfilter/nf_nat_proto_udp.c
@@ -134,8 +134,7 @@ struct nf_nat_protocol nf_nat_protocol_udp = {
134 .manip_pkt = udp_manip_pkt, 134 .manip_pkt = udp_manip_pkt,
135 .in_range = udp_in_range, 135 .in_range = udp_in_range,
136 .unique_tuple = udp_unique_tuple, 136 .unique_tuple = udp_unique_tuple,
137#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 137#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
138 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
139 .range_to_nfattr = nf_nat_port_range_to_nfattr, 138 .range_to_nfattr = nf_nat_port_range_to_nfattr,
140 .nfattr_to_range = nf_nat_port_nfattr_to_range, 139 .nfattr_to_range = nf_nat_port_nfattr_to_range,
141#endif 140#endif
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index ce6c46034314..fc620a7c1db4 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1215,6 +1215,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
1215 1215
1216 if (ulen < sizeof(*uh) || pskb_trim_rcsum(skb, ulen)) 1216 if (ulen < sizeof(*uh) || pskb_trim_rcsum(skb, ulen))
1217 goto short_packet; 1217 goto short_packet;
1218 uh = skb->h.uh;
1218 1219
1219 udp4_csum_init(skb, uh); 1220 udp4_csum_init(skb, uh);
1220 1221
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index e16f1bba5dff..a7fee6b27320 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -342,10 +342,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
342 } 342 }
343#endif 343#endif
344 344
345 if (netif_carrier_ok(dev))
346 ndev->if_flags |= IF_READY;
347
348
349 ipv6_mc_init_dev(ndev); 345 ipv6_mc_init_dev(ndev);
350 ndev->tstamp = jiffies; 346 ndev->tstamp = jiffies;
351#ifdef CONFIG_SYSCTL 347#ifdef CONFIG_SYSCTL
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 286c86735aed..f5f9582a8d39 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -413,7 +413,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
413 } 413 }
414 414
415 /* routing header option needs extra check */ 415 /* routing header option needs extra check */
416 if (optname == IPV6_RTHDR && opt->srcrt) { 416 if (optname == IPV6_RTHDR && opt && opt->srcrt) {
417 struct ipv6_rt_hdr *rthdr = opt->srcrt; 417 struct ipv6_rt_hdr *rthdr = opt->srcrt;
418 switch (rthdr->type) { 418 switch (rthdr->type) {
419 case IPV6_SRCRT_TYPE_0: 419 case IPV6_SRCRT_TYPE_0:
@@ -795,12 +795,16 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, int optname,
795EXPORT_SYMBOL(compat_ipv6_setsockopt); 795EXPORT_SYMBOL(compat_ipv6_setsockopt);
796#endif 796#endif
797 797
798static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, 798static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
799 char __user *optval, int len) 799 char __user *optval, int len)
800{ 800{
801 if (!hdr) 801 struct ipv6_opt_hdr *hdr;
802
803 if (!opt || !opt->hopopt)
802 return 0; 804 return 0;
803 len = min_t(int, len, ipv6_optlen(hdr)); 805 hdr = opt->hopopt;
806
807 len = min_t(unsigned int, len, ipv6_optlen(hdr));
804 if (copy_to_user(optval, hdr, ipv6_optlen(hdr))) 808 if (copy_to_user(optval, hdr, ipv6_optlen(hdr)))
805 return -EFAULT; 809 return -EFAULT;
806 return len; 810 return len;
@@ -940,7 +944,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
940 { 944 {
941 945
942 lock_sock(sk); 946 lock_sock(sk);
943 len = ipv6_getsockopt_sticky(sk, np->opt->hopopt, 947 len = ipv6_getsockopt_sticky(sk, np->opt,
944 optval, len); 948 optval, len);
945 release_sock(sk); 949 release_sock(sk);
946 return put_user(len, optlen); 950 return put_user(len, optlen);
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c
index 0b2d265e7da7..1c405dd30c67 100644
--- a/net/ipv6/netfilter.c
+++ b/net/ipv6/netfilter.c
@@ -15,6 +15,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
15 struct dst_entry *dst; 15 struct dst_entry *dst;
16 struct flowi fl = { 16 struct flowi fl = {
17 .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0, 17 .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
18 .mark = skb->mark,
18 .nl_u = 19 .nl_u =
19 { .ip6_u = 20 { .ip6_u =
20 { .daddr = iph->daddr, 21 { .daddr = iph->daddr,
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 4b7be4bb4d03..d1102455668d 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -257,6 +257,7 @@ static unsigned int ipv6_conntrack_in(unsigned int hooknum,
257 } 257 }
258 nf_conntrack_get(reasm->nfct); 258 nf_conntrack_get(reasm->nfct);
259 (*pskb)->nfct = reasm->nfct; 259 (*pskb)->nfct = reasm->nfct;
260 (*pskb)->nfctinfo = reasm->nfctinfo;
260 return NF_ACCEPT; 261 return NF_ACCEPT;
261 } 262 }
262 263
@@ -353,8 +354,7 @@ static ctl_table nf_ct_ipv6_sysctl_table[] = {
353}; 354};
354#endif 355#endif
355 356
356#if defined(CONFIG_NF_CT_NETLINK) || \ 357#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
357 defined(CONFIG_NF_CT_NETLINK_MODULE)
358 358
359#include <linux/netfilter/nfnetlink.h> 359#include <linux/netfilter/nfnetlink.h>
360#include <linux/netfilter/nfnetlink_conntrack.h> 360#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -403,8 +403,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 = {
403 .print_tuple = ipv6_print_tuple, 403 .print_tuple = ipv6_print_tuple,
404 .print_conntrack = ipv6_print_conntrack, 404 .print_conntrack = ipv6_print_conntrack,
405 .prepare = ipv6_prepare, 405 .prepare = ipv6_prepare,
406#if defined(CONFIG_NF_CT_NETLINK) || \ 406#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
407 defined(CONFIG_NF_CT_NETLINK_MODULE)
408 .tuple_to_nfattr = ipv6_tuple_to_nfattr, 407 .tuple_to_nfattr = ipv6_tuple_to_nfattr,
409 .nfattr_to_tuple = ipv6_nfattr_to_tuple, 408 .nfattr_to_tuple = ipv6_nfattr_to_tuple,
410#endif 409#endif
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
index 21f19cc719f3..075da4f287b8 100644
--- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
@@ -244,8 +244,7 @@ icmpv6_error(struct sk_buff *skb, unsigned int dataoff,
244 return icmpv6_error_message(skb, dataoff, ctinfo, hooknum); 244 return icmpv6_error_message(skb, dataoff, ctinfo, hooknum);
245} 245}
246 246
247#if defined(CONFIG_NF_CT_NETLINK) || \ 247#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
248 defined(CONFIG_NF_CT_NETLINK_MODULE)
249 248
250#include <linux/netfilter/nfnetlink.h> 249#include <linux/netfilter/nfnetlink.h>
251#include <linux/netfilter/nfnetlink_conntrack.h> 250#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -327,8 +326,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 =
327 .packet = icmpv6_packet, 326 .packet = icmpv6_packet,
328 .new = icmpv6_new, 327 .new = icmpv6_new,
329 .error = icmpv6_error, 328 .error = icmpv6_error,
330#if defined(CONFIG_NF_CT_NETLINK) || \ 329#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
331 defined(CONFIG_NF_CT_NETLINK_MODULE)
332 .tuple_to_nfattr = icmpv6_tuple_to_nfattr, 330 .tuple_to_nfattr = icmpv6_tuple_to_nfattr,
333 .nfattr_to_tuple = icmpv6_nfattr_to_tuple, 331 .nfattr_to_tuple = icmpv6_nfattr_to_tuple,
334#endif 332#endif
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 1c58204d767e..a4e7e2db0ff3 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1467,9 +1467,6 @@ static int pfkey_delete(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
1467 1467
1468 err = xfrm_state_delete(x); 1468 err = xfrm_state_delete(x);
1469 1469
1470 xfrm_audit_log(audit_get_loginuid(current->audit_context), 0,
1471 AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x);
1472
1473 if (err < 0) 1470 if (err < 0)
1474 goto out; 1471 goto out;
1475 1472
@@ -1478,6 +1475,8 @@ static int pfkey_delete(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
1478 c.event = XFRM_MSG_DELSA; 1475 c.event = XFRM_MSG_DELSA;
1479 km_state_notify(x, &c); 1476 km_state_notify(x, &c);
1480out: 1477out:
1478 xfrm_audit_log(audit_get_loginuid(current->audit_context), 0,
1479 AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x);
1481 xfrm_state_put(x); 1480 xfrm_state_put(x);
1482 1481
1483 return err; 1482 return err;
@@ -2294,14 +2293,12 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
2294 } 2293 }
2295 2294
2296 xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN, pol->sadb_x_policy_dir-1, 2295 xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN, pol->sadb_x_policy_dir-1,
2297 &sel, tmp.security, 1); 2296 &sel, tmp.security, 1, &err);
2298 security_xfrm_policy_free(&tmp); 2297 security_xfrm_policy_free(&tmp);
2299 2298
2300 if (xp == NULL) 2299 if (xp == NULL)
2301 return -ENOENT; 2300 return -ENOENT;
2302 2301
2303 err = security_xfrm_policy_delete(xp);
2304
2305 xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, 2302 xfrm_audit_log(audit_get_loginuid(current->audit_context), 0,
2306 AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); 2303 AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL);
2307 2304
@@ -2539,7 +2536,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
2539static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) 2536static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs)
2540{ 2537{
2541 unsigned int dir; 2538 unsigned int dir;
2542 int err; 2539 int err = 0, delete;
2543 struct sadb_x_policy *pol; 2540 struct sadb_x_policy *pol;
2544 struct xfrm_policy *xp; 2541 struct xfrm_policy *xp;
2545 struct km_event c; 2542 struct km_event c;
@@ -2551,16 +2548,20 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
2551 if (dir >= XFRM_POLICY_MAX) 2548 if (dir >= XFRM_POLICY_MAX)
2552 return -EINVAL; 2549 return -EINVAL;
2553 2550
2551 delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2);
2554 xp = xfrm_policy_byid(XFRM_POLICY_TYPE_MAIN, dir, pol->sadb_x_policy_id, 2552 xp = xfrm_policy_byid(XFRM_POLICY_TYPE_MAIN, dir, pol->sadb_x_policy_id,
2555 hdr->sadb_msg_type == SADB_X_SPDDELETE2); 2553 delete, &err);
2556 if (xp == NULL) 2554 if (xp == NULL)
2557 return -ENOENT; 2555 return -ENOENT;
2558 2556
2559 err = 0; 2557 if (delete) {
2558 xfrm_audit_log(audit_get_loginuid(current->audit_context), 0,
2559 AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL);
2560 2560
2561 c.seq = hdr->sadb_msg_seq; 2561 if (err)
2562 c.pid = hdr->sadb_msg_pid; 2562 goto out;
2563 if (hdr->sadb_msg_type == SADB_X_SPDDELETE2) { 2563 c.seq = hdr->sadb_msg_seq;
2564 c.pid = hdr->sadb_msg_pid;
2564 c.data.byid = 1; 2565 c.data.byid = 1;
2565 c.event = XFRM_MSG_DELPOLICY; 2566 c.event = XFRM_MSG_DELPOLICY;
2566 km_policy_notify(xp, dir, &c); 2567 km_policy_notify(xp, dir, &c);
@@ -2568,6 +2569,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
2568 err = key_pol_get_resp(sk, xp, hdr, dir); 2569 err = key_pol_get_resp(sk, xp, hdr, dir);
2569 } 2570 }
2570 2571
2572out:
2571 xfrm_pol_put(xp); 2573 xfrm_pol_put(xp);
2572 return err; 2574 return err;
2573} 2575}
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 32891ebc9e68..b3a70eb6d42a 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -976,8 +976,7 @@ void __nf_ct_refresh_acct(struct nf_conn *ct,
976} 976}
977EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct); 977EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct);
978 978
979#if defined(CONFIG_NF_CT_NETLINK) || \ 979#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
980 defined(CONFIG_NF_CT_NETLINK_MODULE)
981 980
982#include <linux/netfilter/nfnetlink.h> 981#include <linux/netfilter/nfnetlink.h>
983#include <linux/netfilter/nfnetlink_conntrack.h> 982#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -1070,7 +1069,7 @@ get_next_corpse(int (*iter)(struct nf_conn *i, void *data),
1070 list_for_each_entry(h, &unconfirmed, list) { 1069 list_for_each_entry(h, &unconfirmed, list) {
1071 ct = nf_ct_tuplehash_to_ctrack(h); 1070 ct = nf_ct_tuplehash_to_ctrack(h);
1072 if (iter(ct, data)) 1071 if (iter(ct, data))
1073 goto found; 1072 set_bit(IPS_DYING_BIT, &ct->status);
1074 } 1073 }
1075 write_unlock_bh(&nf_conntrack_lock); 1074 write_unlock_bh(&nf_conntrack_lock);
1076 return NULL; 1075 return NULL;
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c
index ac193ce70249..5434472420fe 100644
--- a/net/netfilter/nf_conntrack_proto_gre.c
+++ b/net/netfilter/nf_conntrack_proto_gre.c
@@ -281,8 +281,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 = {
281 .new = gre_new, 281 .new = gre_new,
282 .destroy = gre_destroy, 282 .destroy = gre_destroy,
283 .me = THIS_MODULE, 283 .me = THIS_MODULE,
284#if defined(CONFIG_NF_CONNTRACK_NETLINK) || \ 284#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
285 defined(CONFIG_NF_CONNTRACK_NETLINK_MODULE)
286 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, 285 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr,
287 .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, 286 .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple,
288#endif 287#endif
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 069b85ca51cd..153d6619993a 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -769,8 +769,10 @@ EXPORT_SYMBOL_GPL(nf_conntrack_tcp_update);
769static u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] = 769static u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] =
770{ 770{
771 [TH_SYN] = 1, 771 [TH_SYN] = 1,
772 [TH_SYN|TH_ACK] = 1,
773 [TH_SYN|TH_PUSH] = 1, 772 [TH_SYN|TH_PUSH] = 1,
773 [TH_SYN|TH_URG] = 1,
774 [TH_SYN|TH_PUSH|TH_URG] = 1,
775 [TH_SYN|TH_ACK] = 1,
774 [TH_SYN|TH_ACK|TH_PUSH] = 1, 776 [TH_SYN|TH_ACK|TH_PUSH] = 1,
775 [TH_RST] = 1, 777 [TH_RST] = 1,
776 [TH_RST|TH_ACK] = 1, 778 [TH_RST|TH_ACK] = 1,
@@ -1099,8 +1101,7 @@ static int tcp_new(struct nf_conn *conntrack,
1099 return 1; 1101 return 1;
1100} 1102}
1101 1103
1102#if defined(CONFIG_NF_CT_NETLINK) || \ 1104#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
1103 defined(CONFIG_NF_CT_NETLINK_MODULE)
1104 1105
1105#include <linux/netfilter/nfnetlink.h> 1106#include <linux/netfilter/nfnetlink.h>
1106#include <linux/netfilter/nfnetlink_conntrack.h> 1107#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -1378,8 +1379,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 =
1378 .packet = tcp_packet, 1379 .packet = tcp_packet,
1379 .new = tcp_new, 1380 .new = tcp_new,
1380 .error = tcp_error, 1381 .error = tcp_error,
1381#if defined(CONFIG_NF_CT_NETLINK) || \ 1382#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
1382 defined(CONFIG_NF_CT_NETLINK_MODULE)
1383 .to_nfattr = tcp_to_nfattr, 1383 .to_nfattr = tcp_to_nfattr,
1384 .from_nfattr = nfattr_to_tcp, 1384 .from_nfattr = nfattr_to_tcp,
1385 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, 1385 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr,
@@ -1408,8 +1408,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6 =
1408 .packet = tcp_packet, 1408 .packet = tcp_packet,
1409 .new = tcp_new, 1409 .new = tcp_new,
1410 .error = tcp_error, 1410 .error = tcp_error,
1411#if defined(CONFIG_NF_CT_NETLINK) || \ 1411#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
1412 defined(CONFIG_NF_CT_NETLINK_MODULE)
1413 .to_nfattr = tcp_to_nfattr, 1412 .to_nfattr = tcp_to_nfattr,
1414 .from_nfattr = nfattr_to_tcp, 1413 .from_nfattr = nfattr_to_tcp,
1415 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, 1414 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr,
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index d0a1cee7ee52..a5e5726ec0c7 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -208,8 +208,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 =
208 .packet = udp_packet, 208 .packet = udp_packet,
209 .new = udp_new, 209 .new = udp_new,
210 .error = udp_error, 210 .error = udp_error,
211#if defined(CONFIG_NF_CT_NETLINK) || \ 211#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
212 defined(CONFIG_NF_CT_NETLINK_MODULE)
213 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, 212 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr,
214 .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, 213 .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple,
215#endif 214#endif
@@ -236,8 +235,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 =
236 .packet = udp_packet, 235 .packet = udp_packet,
237 .new = udp_new, 236 .new = udp_new,
238 .error = udp_error, 237 .error = udp_error,
239#if defined(CONFIG_NF_CT_NETLINK) || \ 238#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
240 defined(CONFIG_NF_CT_NETLINK_MODULE)
241 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, 239 .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr,
242 .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, 240 .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple,
243#endif 241#endif
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index b8eab0dbc3dd..5cb30ebba0f4 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -133,6 +133,7 @@ instance_put(struct nfulnl_instance *inst)
133 if (inst && atomic_dec_and_test(&inst->use)) { 133 if (inst && atomic_dec_and_test(&inst->use)) {
134 UDEBUG("kfree(inst=%p)\n", inst); 134 UDEBUG("kfree(inst=%p)\n", inst);
135 kfree(inst); 135 kfree(inst);
136 module_put(THIS_MODULE);
136 } 137 }
137} 138}
138 139
@@ -217,6 +218,9 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
217 218
218 spin_lock_bh(&inst->lock); 219 spin_lock_bh(&inst->lock);
219 if (inst->skb) { 220 if (inst->skb) {
221 /* timer "holds" one reference (we have one more) */
222 if (del_timer(&inst->timer))
223 instance_put(inst);
220 if (inst->qlen) 224 if (inst->qlen)
221 __nfulnl_send(inst); 225 __nfulnl_send(inst);
222 if (inst->skb) { 226 if (inst->skb) {
@@ -228,8 +232,6 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
228 232
229 /* and finally put the refcount */ 233 /* and finally put the refcount */
230 instance_put(inst); 234 instance_put(inst);
231
232 module_put(THIS_MODULE);
233} 235}
234 236
235static inline void 237static inline void
@@ -363,9 +365,6 @@ __nfulnl_send(struct nfulnl_instance *inst)
363{ 365{
364 int status; 366 int status;
365 367
366 if (timer_pending(&inst->timer))
367 del_timer(&inst->timer);
368
369 if (!inst->skb) 368 if (!inst->skb)
370 return 0; 369 return 0;
371 370
@@ -393,8 +392,8 @@ static void nfulnl_timer(unsigned long data)
393 392
394 spin_lock_bh(&inst->lock); 393 spin_lock_bh(&inst->lock);
395 __nfulnl_send(inst); 394 __nfulnl_send(inst);
396 instance_put(inst);
397 spin_unlock_bh(&inst->lock); 395 spin_unlock_bh(&inst->lock);
396 instance_put(inst);
398} 397}
399 398
400/* This is an inline function, we don't really care about a long 399/* This is an inline function, we don't really care about a long
@@ -487,7 +486,7 @@ __build_packet_message(struct nfulnl_instance *inst,
487 * for physical device (when called from ipv4) */ 486 * for physical device (when called from ipv4) */
488 NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV, 487 NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV,
489 sizeof(tmp_uint), &tmp_uint); 488 sizeof(tmp_uint), &tmp_uint);
490 if (skb->nf_bridge) { 489 if (skb->nf_bridge && skb->nf_bridge->physoutdev) {
491 tmp_uint = 490 tmp_uint =
492 htonl(skb->nf_bridge->physoutdev->ifindex); 491 htonl(skb->nf_bridge->physoutdev->ifindex);
493 NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSOUTDEV, 492 NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSOUTDEV,
@@ -560,6 +559,7 @@ __build_packet_message(struct nfulnl_instance *inst,
560 } 559 }
561 560
562 nlh->nlmsg_len = inst->skb->tail - old_tail; 561 nlh->nlmsg_len = inst->skb->tail - old_tail;
562 inst->lastnlh = nlh;
563 return 0; 563 return 0;
564 564
565nlmsg_failure: 565nlmsg_failure:
@@ -615,7 +615,7 @@ nfulnl_log_packet(unsigned int pf,
615 615
616 plen = 0; 616 plen = 0;
617 if (prefix) 617 if (prefix)
618 plen = strlen(prefix); 618 plen = strlen(prefix) + 1;
619 619
620 /* all macros expand to constant values at compile time */ 620 /* all macros expand to constant values at compile time */
621 /* FIXME: do we want to make the size calculation conditional based on 621 /* FIXME: do we want to make the size calculation conditional based on
@@ -689,6 +689,9 @@ nfulnl_log_packet(unsigned int pf,
689 * enough room in the skb left. flush to userspace. */ 689 * enough room in the skb left. flush to userspace. */
690 UDEBUG("flushing old skb\n"); 690 UDEBUG("flushing old skb\n");
691 691
692 /* timer "holds" one reference (we have another one) */
693 if (del_timer(&inst->timer))
694 instance_put(inst);
692 __nfulnl_send(inst); 695 __nfulnl_send(inst);
693 696
694 if (!(inst->skb = nfulnl_alloc_skb(nlbufsiz, size))) { 697 if (!(inst->skb = nfulnl_alloc_skb(nlbufsiz, size))) {
@@ -711,15 +714,16 @@ nfulnl_log_packet(unsigned int pf,
711 inst->timer.expires = jiffies + (inst->flushtimeout*HZ/100); 714 inst->timer.expires = jiffies + (inst->flushtimeout*HZ/100);
712 add_timer(&inst->timer); 715 add_timer(&inst->timer);
713 } 716 }
714 spin_unlock_bh(&inst->lock);
715 717
718unlock_and_release:
719 spin_unlock_bh(&inst->lock);
720 instance_put(inst);
716 return; 721 return;
717 722
718alloc_failure: 723alloc_failure:
719 spin_unlock_bh(&inst->lock);
720 instance_put(inst);
721 UDEBUG("error allocating skb\n"); 724 UDEBUG("error allocating skb\n");
722 /* FIXME: statistics */ 725 /* FIXME: statistics */
726 goto unlock_and_release;
723} 727}
724 728
725static int 729static int
@@ -856,6 +860,9 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
856 ret = -EINVAL; 860 ret = -EINVAL;
857 break; 861 break;
858 } 862 }
863
864 if (!inst)
865 goto out;
859 } else { 866 } else {
860 if (!inst) { 867 if (!inst) {
861 UDEBUG("no config command, and no instance for " 868 UDEBUG("no config command, and no instance for "
@@ -909,6 +916,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
909 916
910out_put: 917out_put:
911 instance_put(inst); 918 instance_put(inst);
919out:
912 return ret; 920 return ret;
913} 921}
914 922
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 8c34f1ca6c8c..f92d5310847b 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -700,23 +700,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
700 unsigned char cause, diagnostic; 700 unsigned char cause, diagnostic;
701 struct net_device *dev; 701 struct net_device *dev;
702 ax25_uid_assoc *user; 702 ax25_uid_assoc *user;
703 int n; 703 int n, err = 0;
704
705 if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) {
706 sock->state = SS_CONNECTED;
707 return 0; /* Connect completed during a ERESTARTSYS event */
708 }
709
710 if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) {
711 sock->state = SS_UNCONNECTED;
712 return -ECONNREFUSED;
713 }
714
715 if (sk->sk_state == TCP_ESTABLISHED)
716 return -EISCONN; /* No reconnect on a seqpacket socket */
717
718 sk->sk_state = TCP_CLOSE;
719 sock->state = SS_UNCONNECTED;
720 704
721 if (addr_len != sizeof(struct sockaddr_rose) && addr_len != sizeof(struct full_sockaddr_rose)) 705 if (addr_len != sizeof(struct sockaddr_rose) && addr_len != sizeof(struct full_sockaddr_rose))
722 return -EINVAL; 706 return -EINVAL;
@@ -734,24 +718,53 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
734 if ((rose->source_ndigis + addr->srose_ndigis) > ROSE_MAX_DIGIS) 718 if ((rose->source_ndigis + addr->srose_ndigis) > ROSE_MAX_DIGIS)
735 return -EINVAL; 719 return -EINVAL;
736 720
721 lock_sock(sk);
722
723 if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) {
724 /* Connect completed during a ERESTARTSYS event */
725 sock->state = SS_CONNECTED;
726 goto out_release;
727 }
728
729 if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) {
730 sock->state = SS_UNCONNECTED;
731 err = -ECONNREFUSED;
732 goto out_release;
733 }
734
735 if (sk->sk_state == TCP_ESTABLISHED) {
736 /* No reconnect on a seqpacket socket */
737 err = -EISCONN;
738 goto out_release;
739 }
740
741 sk->sk_state = TCP_CLOSE;
742 sock->state = SS_UNCONNECTED;
743
737 rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, 744 rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause,
738 &diagnostic); 745 &diagnostic);
739 if (!rose->neighbour) 746 if (!rose->neighbour)
740 return -ENETUNREACH; 747 return -ENETUNREACH;
741 748
742 rose->lci = rose_new_lci(rose->neighbour); 749 rose->lci = rose_new_lci(rose->neighbour);
743 if (!rose->lci) 750 if (!rose->lci) {
744 return -ENETUNREACH; 751 err = -ENETUNREACH;
752 goto out_release;
753 }
745 754
746 if (sock_flag(sk, SOCK_ZAPPED)) { /* Must bind first - autobinding in this may or may not work */ 755 if (sock_flag(sk, SOCK_ZAPPED)) { /* Must bind first - autobinding in this may or may not work */
747 sock_reset_flag(sk, SOCK_ZAPPED); 756 sock_reset_flag(sk, SOCK_ZAPPED);
748 757
749 if ((dev = rose_dev_first()) == NULL) 758 if ((dev = rose_dev_first()) == NULL) {
750 return -ENETUNREACH; 759 err = -ENETUNREACH;
760 goto out_release;
761 }
751 762
752 user = ax25_findbyuid(current->euid); 763 user = ax25_findbyuid(current->euid);
753 if (!user) 764 if (!user) {
754 return -EINVAL; 765 err = -EINVAL;
766 goto out_release;
767 }
755 768
756 memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN); 769 memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN);
757 rose->source_call = user->call; 770 rose->source_call = user->call;
@@ -789,8 +802,10 @@ rose_try_next_neigh:
789 rose_start_t1timer(sk); 802 rose_start_t1timer(sk);
790 803
791 /* Now the loop */ 804 /* Now the loop */
792 if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) 805 if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) {
793 return -EINPROGRESS; 806 err = -EINPROGRESS;
807 goto out_release;
808 }
794 809
795 /* 810 /*
796 * A Connect Ack with Choke or timeout or failed routing will go to 811 * A Connect Ack with Choke or timeout or failed routing will go to
@@ -805,8 +820,10 @@ rose_try_next_neigh:
805 set_current_state(TASK_INTERRUPTIBLE); 820 set_current_state(TASK_INTERRUPTIBLE);
806 if (sk->sk_state != TCP_SYN_SENT) 821 if (sk->sk_state != TCP_SYN_SENT)
807 break; 822 break;
823 release_sock(sk);
808 if (!signal_pending(tsk)) { 824 if (!signal_pending(tsk)) {
809 schedule(); 825 schedule();
826 lock_sock(sk);
810 continue; 827 continue;
811 } 828 }
812 current->state = TASK_RUNNING; 829 current->state = TASK_RUNNING;
@@ -822,14 +839,19 @@ rose_try_next_neigh:
822 rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic); 839 rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic);
823 if (rose->neighbour) 840 if (rose->neighbour)
824 goto rose_try_next_neigh; 841 goto rose_try_next_neigh;
825 /* No more neighbour */ 842
843 /* No more neighbours */
826 sock->state = SS_UNCONNECTED; 844 sock->state = SS_UNCONNECTED;
827 return sock_error(sk); /* Always set at this point */ 845 err = sock_error(sk); /* Always set at this point */
846 goto out_release;
828 } 847 }
829 848
830 sock->state = SS_CONNECTED; 849 sock->state = SS_CONNECTED;
831 850
832 return 0; 851out_release:
852 release_sock(sk);
853
854 return err;
833} 855}
834 856
835static int rose_accept(struct socket *sock, struct socket *newsock, int flags) 857static int rose_accept(struct socket *sock, struct socket *newsock, int flags)
@@ -877,6 +899,8 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags)
877 lock_sock(sk); 899 lock_sock(sk);
878 continue; 900 continue;
879 } 901 }
902 current->state = TASK_RUNNING;
903 remove_wait_queue(sk->sk_sleep, &wait);
880 return -ERESTARTSYS; 904 return -ERESTARTSYS;
881 } 905 }
882 current->state = TASK_RUNNING; 906 current->state = TASK_RUNNING;
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 63fe1093b616..0b9c49b3a100 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -360,7 +360,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
360 return; 360 return;
361 } 361 }
362 362
363 read_lock(&in6_dev->lock); 363 read_lock_bh(&in6_dev->lock);
364 for (ifp = in6_dev->addr_list; ifp; ifp = ifp->if_next) { 364 for (ifp = in6_dev->addr_list; ifp; ifp = ifp->if_next) {
365 /* Add the address to the local list. */ 365 /* Add the address to the local list. */
366 addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC); 366 addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
@@ -374,7 +374,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
374 } 374 }
375 } 375 }
376 376
377 read_unlock(&in6_dev->lock); 377 read_unlock_bh(&in6_dev->lock);
378 rcu_read_unlock(); 378 rcu_read_unlock();
379} 379}
380 380
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 8353829bc5c6..b4db53ff1435 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -27,22 +27,26 @@
27 27
28#define RPCDBG_FACILITY RPCDBG_SVCDSP 28#define RPCDBG_FACILITY RPCDBG_SVCDSP
29 29
30#define svc_serv_is_pooled(serv) ((serv)->sv_function)
31
30/* 32/*
31 * Mode for mapping cpus to pools. 33 * Mode for mapping cpus to pools.
32 */ 34 */
33enum { 35enum {
34 SVC_POOL_NONE = -1, /* uninitialised, choose one of the others */ 36 SVC_POOL_AUTO = -1, /* choose one of the others */
35 SVC_POOL_GLOBAL, /* no mapping, just a single global pool 37 SVC_POOL_GLOBAL, /* no mapping, just a single global pool
36 * (legacy & UP mode) */ 38 * (legacy & UP mode) */
37 SVC_POOL_PERCPU, /* one pool per cpu */ 39 SVC_POOL_PERCPU, /* one pool per cpu */
38 SVC_POOL_PERNODE /* one pool per numa node */ 40 SVC_POOL_PERNODE /* one pool per numa node */
39}; 41};
42#define SVC_POOL_DEFAULT SVC_POOL_GLOBAL
40 43
41/* 44/*
42 * Structure for mapping cpus to pools and vice versa. 45 * Structure for mapping cpus to pools and vice versa.
43 * Setup once during sunrpc initialisation. 46 * Setup once during sunrpc initialisation.
44 */ 47 */
45static struct svc_pool_map { 48static struct svc_pool_map {
49 int count; /* How many svc_servs use us */
46 int mode; /* Note: int not enum to avoid 50 int mode; /* Note: int not enum to avoid
47 * warnings about "enumeration value 51 * warnings about "enumeration value
48 * not handled in switch" */ 52 * not handled in switch" */
@@ -50,9 +54,63 @@ static struct svc_pool_map {
50 unsigned int *pool_to; /* maps pool id to cpu or node */ 54 unsigned int *pool_to; /* maps pool id to cpu or node */
51 unsigned int *to_pool; /* maps cpu or node to pool id */ 55 unsigned int *to_pool; /* maps cpu or node to pool id */
52} svc_pool_map = { 56} svc_pool_map = {
53 .mode = SVC_POOL_NONE 57 .count = 0,
58 .mode = SVC_POOL_DEFAULT
54}; 59};
60static DEFINE_MUTEX(svc_pool_map_mutex);/* protects svc_pool_map.count only */
61
62static int
63param_set_pool_mode(const char *val, struct kernel_param *kp)
64{
65 int *ip = (int *)kp->arg;
66 struct svc_pool_map *m = &svc_pool_map;
67 int err;
68
69 mutex_lock(&svc_pool_map_mutex);
70
71 err = -EBUSY;
72 if (m->count)
73 goto out;
74
75 err = 0;
76 if (!strncmp(val, "auto", 4))
77 *ip = SVC_POOL_AUTO;
78 else if (!strncmp(val, "global", 6))
79 *ip = SVC_POOL_GLOBAL;
80 else if (!strncmp(val, "percpu", 6))
81 *ip = SVC_POOL_PERCPU;
82 else if (!strncmp(val, "pernode", 7))
83 *ip = SVC_POOL_PERNODE;
84 else
85 err = -EINVAL;
86
87out:
88 mutex_unlock(&svc_pool_map_mutex);
89 return err;
90}
55 91
92static int
93param_get_pool_mode(char *buf, struct kernel_param *kp)
94{
95 int *ip = (int *)kp->arg;
96
97 switch (*ip)
98 {
99 case SVC_POOL_AUTO:
100 return strlcpy(buf, "auto", 20);
101 case SVC_POOL_GLOBAL:
102 return strlcpy(buf, "global", 20);
103 case SVC_POOL_PERCPU:
104 return strlcpy(buf, "percpu", 20);
105 case SVC_POOL_PERNODE:
106 return strlcpy(buf, "pernode", 20);
107 default:
108 return sprintf(buf, "%d", *ip);
109 }
110}
111
112module_param_call(pool_mode, param_set_pool_mode, param_get_pool_mode,
113 &svc_pool_map.mode, 0644);
56 114
57/* 115/*
58 * Detect best pool mapping mode heuristically, 116 * Detect best pool mapping mode heuristically,
@@ -166,18 +224,25 @@ svc_pool_map_init_pernode(struct svc_pool_map *m)
166 224
167 225
168/* 226/*
169 * Build the global map of cpus to pools and vice versa. 227 * Add a reference to the global map of cpus to pools (and
228 * vice versa). Initialise the map if we're the first user.
229 * Returns the number of pools.
170 */ 230 */
171static unsigned int 231static unsigned int
172svc_pool_map_init(void) 232svc_pool_map_get(void)
173{ 233{
174 struct svc_pool_map *m = &svc_pool_map; 234 struct svc_pool_map *m = &svc_pool_map;
175 int npools = -1; 235 int npools = -1;
176 236
177 if (m->mode != SVC_POOL_NONE) 237 mutex_lock(&svc_pool_map_mutex);
238
239 if (m->count++) {
240 mutex_unlock(&svc_pool_map_mutex);
178 return m->npools; 241 return m->npools;
242 }
179 243
180 m->mode = svc_pool_map_choose_mode(); 244 if (m->mode == SVC_POOL_AUTO)
245 m->mode = svc_pool_map_choose_mode();
181 246
182 switch (m->mode) { 247 switch (m->mode) {
183 case SVC_POOL_PERCPU: 248 case SVC_POOL_PERCPU:
@@ -195,9 +260,36 @@ svc_pool_map_init(void)
195 } 260 }
196 m->npools = npools; 261 m->npools = npools;
197 262
263 mutex_unlock(&svc_pool_map_mutex);
198 return m->npools; 264 return m->npools;
199} 265}
200 266
267
268/*
269 * Drop a reference to the global map of cpus to pools.
270 * When the last reference is dropped, the map data is
271 * freed; this allows the sysadmin to change the pool
272 * mode using the pool_mode module option without
273 * rebooting or re-loading sunrpc.ko.
274 */
275static void
276svc_pool_map_put(void)
277{
278 struct svc_pool_map *m = &svc_pool_map;
279
280 mutex_lock(&svc_pool_map_mutex);
281
282 if (!--m->count) {
283 m->mode = SVC_POOL_DEFAULT;
284 kfree(m->to_pool);
285 kfree(m->pool_to);
286 m->npools = 0;
287 }
288
289 mutex_unlock(&svc_pool_map_mutex);
290}
291
292
201/* 293/*
202 * Set the current thread's cpus_allowed mask so that it 294 * Set the current thread's cpus_allowed mask so that it
203 * will only run on cpus in the given pool. 295 * will only run on cpus in the given pool.
@@ -212,10 +304,9 @@ svc_pool_map_set_cpumask(unsigned int pidx, cpumask_t *oldmask)
212 304
213 /* 305 /*
214 * The caller checks for sv_nrpools > 1, which 306 * The caller checks for sv_nrpools > 1, which
215 * implies that we've been initialized and the 307 * implies that we've been initialized.
216 * map mode is not NONE.
217 */ 308 */
218 BUG_ON(m->mode == SVC_POOL_NONE); 309 BUG_ON(m->count == 0);
219 310
220 switch (m->mode) 311 switch (m->mode)
221 { 312 {
@@ -246,18 +337,19 @@ svc_pool_for_cpu(struct svc_serv *serv, int cpu)
246 unsigned int pidx = 0; 337 unsigned int pidx = 0;
247 338
248 /* 339 /*
249 * SVC_POOL_NONE happens in a pure client when 340 * An uninitialised map happens in a pure client when
250 * lockd is brought up, so silently treat it the 341 * lockd is brought up, so silently treat it the
251 * same as SVC_POOL_GLOBAL. 342 * same as SVC_POOL_GLOBAL.
252 */ 343 */
253 344 if (svc_serv_is_pooled(serv)) {
254 switch (m->mode) { 345 switch (m->mode) {
255 case SVC_POOL_PERCPU: 346 case SVC_POOL_PERCPU:
256 pidx = m->to_pool[cpu]; 347 pidx = m->to_pool[cpu];
257 break; 348 break;
258 case SVC_POOL_PERNODE: 349 case SVC_POOL_PERNODE:
259 pidx = m->to_pool[cpu_to_node(cpu)]; 350 pidx = m->to_pool[cpu_to_node(cpu)];
260 break; 351 break;
352 }
261 } 353 }
262 return &serv->sv_pools[pidx % serv->sv_nrpools]; 354 return &serv->sv_pools[pidx % serv->sv_nrpools];
263} 355}
@@ -347,7 +439,7 @@ svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
347 svc_thread_fn func, int sig, struct module *mod) 439 svc_thread_fn func, int sig, struct module *mod)
348{ 440{
349 struct svc_serv *serv; 441 struct svc_serv *serv;
350 unsigned int npools = svc_pool_map_init(); 442 unsigned int npools = svc_pool_map_get();
351 443
352 serv = __svc_create(prog, bufsize, npools, shutdown); 444 serv = __svc_create(prog, bufsize, npools, shutdown);
353 445
@@ -367,6 +459,7 @@ void
367svc_destroy(struct svc_serv *serv) 459svc_destroy(struct svc_serv *serv)
368{ 460{
369 struct svc_sock *svsk; 461 struct svc_sock *svsk;
462 struct svc_sock *tmp;
370 463
371 dprintk("svc: svc_destroy(%s, %d)\n", 464 dprintk("svc: svc_destroy(%s, %d)\n",
372 serv->sv_program->pg_name, 465 serv->sv_program->pg_name,
@@ -382,24 +475,23 @@ svc_destroy(struct svc_serv *serv)
382 475
383 del_timer_sync(&serv->sv_temptimer); 476 del_timer_sync(&serv->sv_temptimer);
384 477
385 while (!list_empty(&serv->sv_tempsocks)) { 478 list_for_each_entry_safe(svsk, tmp, &serv->sv_tempsocks, sk_list)
386 svsk = list_entry(serv->sv_tempsocks.next, 479 svc_force_close_socket(svsk);
387 struct svc_sock, 480
388 sk_list);
389 svc_close_socket(svsk);
390 }
391 if (serv->sv_shutdown) 481 if (serv->sv_shutdown)
392 serv->sv_shutdown(serv); 482 serv->sv_shutdown(serv);
393 483
394 while (!list_empty(&serv->sv_permsocks)) { 484 list_for_each_entry_safe(svsk, tmp, &serv->sv_permsocks, sk_list)
395 svsk = list_entry(serv->sv_permsocks.next, 485 svc_force_close_socket(svsk);
396 struct svc_sock, 486
397 sk_list); 487 BUG_ON(!list_empty(&serv->sv_permsocks));
398 svc_close_socket(svsk); 488 BUG_ON(!list_empty(&serv->sv_tempsocks));
399 }
400 489
401 cache_clean_deferred(serv); 490 cache_clean_deferred(serv);
402 491
492 if (svc_serv_is_pooled(serv))
493 svc_pool_map_put();
494
403 /* Unregister service with the portmapper */ 495 /* Unregister service with the portmapper */
404 svc_register(serv, 0, 0); 496 svc_register(serv, 0, 0);
405 kfree(serv->sv_pools); 497 kfree(serv->sv_pools);
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 63ae94771b8e..f6e1eb1ea720 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -82,6 +82,7 @@ static void svc_delete_socket(struct svc_sock *svsk);
82static void svc_udp_data_ready(struct sock *, int); 82static void svc_udp_data_ready(struct sock *, int);
83static int svc_udp_recvfrom(struct svc_rqst *); 83static int svc_udp_recvfrom(struct svc_rqst *);
84static int svc_udp_sendto(struct svc_rqst *); 84static int svc_udp_sendto(struct svc_rqst *);
85static void svc_close_socket(struct svc_sock *svsk);
85 86
86static struct svc_deferred_req *svc_deferred_dequeue(struct svc_sock *svsk); 87static struct svc_deferred_req *svc_deferred_dequeue(struct svc_sock *svsk);
87static int svc_deferred_recv(struct svc_rqst *rqstp); 88static int svc_deferred_recv(struct svc_rqst *rqstp);
@@ -131,13 +132,13 @@ static char *__svc_print_addr(struct sockaddr *addr, char *buf, size_t len)
131 NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), 132 NIPQUAD(((struct sockaddr_in *) addr)->sin_addr),
132 htons(((struct sockaddr_in *) addr)->sin_port)); 133 htons(((struct sockaddr_in *) addr)->sin_port));
133 break; 134 break;
134#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 135
135 case AF_INET6: 136 case AF_INET6:
136 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", 137 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u",
137 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), 138 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr),
138 htons(((struct sockaddr_in6 *) addr)->sin6_port)); 139 htons(((struct sockaddr_in6 *) addr)->sin6_port));
139 break; 140 break;
140#endif 141
141 default: 142 default:
142 snprintf(buf, len, "unknown address type: %d", addr->sa_family); 143 snprintf(buf, len, "unknown address type: %d", addr->sa_family);
143 break; 144 break;
@@ -449,9 +450,7 @@ svc_wake_up(struct svc_serv *serv)
449 450
450union svc_pktinfo_u { 451union svc_pktinfo_u {
451 struct in_pktinfo pkti; 452 struct in_pktinfo pkti;
452#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
453 struct in6_pktinfo pkti6; 453 struct in6_pktinfo pkti6;
454#endif
455}; 454};
456 455
457static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) 456static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
@@ -467,7 +466,7 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
467 cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); 466 cmh->cmsg_len = CMSG_LEN(sizeof(*pki));
468 } 467 }
469 break; 468 break;
470#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 469
471 case AF_INET6: { 470 case AF_INET6: {
472 struct in6_pktinfo *pki = CMSG_DATA(cmh); 471 struct in6_pktinfo *pki = CMSG_DATA(cmh);
473 472
@@ -479,7 +478,6 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
479 cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); 478 cmh->cmsg_len = CMSG_LEN(sizeof(*pki));
480 } 479 }
481 break; 480 break;
482#endif
483 } 481 }
484 return; 482 return;
485} 483}
@@ -721,45 +719,21 @@ svc_write_space(struct sock *sk)
721 } 719 }
722} 720}
723 721
724static void svc_udp_get_sender_address(struct svc_rqst *rqstp, 722static inline void svc_udp_get_dest_address(struct svc_rqst *rqstp,
725 struct sk_buff *skb) 723 struct cmsghdr *cmh)
726{ 724{
727 switch (rqstp->rq_sock->sk_sk->sk_family) { 725 switch (rqstp->rq_sock->sk_sk->sk_family) {
728 case AF_INET: { 726 case AF_INET: {
729 /* this seems to come from net/ipv4/udp.c:udp_recvmsg */ 727 struct in_pktinfo *pki = CMSG_DATA(cmh);
730 struct sockaddr_in *sin = svc_addr_in(rqstp); 728 rqstp->rq_daddr.addr.s_addr = pki->ipi_spec_dst.s_addr;
731
732 sin->sin_family = AF_INET;
733 sin->sin_port = skb->h.uh->source;
734 sin->sin_addr.s_addr = skb->nh.iph->saddr;
735 rqstp->rq_addrlen = sizeof(struct sockaddr_in);
736 /* Remember which interface received this request */
737 rqstp->rq_daddr.addr.s_addr = skb->nh.iph->daddr;
738 }
739 break; 729 break;
740#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
741 case AF_INET6: {
742 /* this is derived from net/ipv6/udp.c:udpv6_recvmesg */
743 struct sockaddr_in6 *sin6 = svc_addr_in6(rqstp);
744
745 sin6->sin6_family = AF_INET6;
746 sin6->sin6_port = skb->h.uh->source;
747 sin6->sin6_flowinfo = 0;
748 sin6->sin6_scope_id = 0;
749 if (ipv6_addr_type(&sin6->sin6_addr) &
750 IPV6_ADDR_LINKLOCAL)
751 sin6->sin6_scope_id = IP6CB(skb)->iif;
752 ipv6_addr_copy(&sin6->sin6_addr,
753 &skb->nh.ipv6h->saddr);
754 rqstp->rq_addrlen = sizeof(struct sockaddr_in);
755 /* Remember which interface received this request */
756 ipv6_addr_copy(&rqstp->rq_daddr.addr6,
757 &skb->nh.ipv6h->saddr);
758 } 730 }
731 case AF_INET6: {
732 struct in6_pktinfo *pki = CMSG_DATA(cmh);
733 ipv6_addr_copy(&rqstp->rq_daddr.addr6, &pki->ipi6_addr);
759 break; 734 break;
760#endif 735 }
761 } 736 }
762 return;
763} 737}
764 738
765/* 739/*
@@ -771,7 +745,15 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
771 struct svc_sock *svsk = rqstp->rq_sock; 745 struct svc_sock *svsk = rqstp->rq_sock;
772 struct svc_serv *serv = svsk->sk_server; 746 struct svc_serv *serv = svsk->sk_server;
773 struct sk_buff *skb; 747 struct sk_buff *skb;
748 char buffer[CMSG_SPACE(sizeof(union svc_pktinfo_u))];
749 struct cmsghdr *cmh = (struct cmsghdr *)buffer;
774 int err, len; 750 int err, len;
751 struct msghdr msg = {
752 .msg_name = svc_addr(rqstp),
753 .msg_control = cmh,
754 .msg_controllen = sizeof(buffer),
755 .msg_flags = MSG_DONTWAIT,
756 };
775 757
776 if (test_and_clear_bit(SK_CHNGBUF, &svsk->sk_flags)) 758 if (test_and_clear_bit(SK_CHNGBUF, &svsk->sk_flags))
777 /* udp sockets need large rcvbuf as all pending 759 /* udp sockets need large rcvbuf as all pending
@@ -797,7 +779,9 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
797 } 779 }
798 780
799 clear_bit(SK_DATA, &svsk->sk_flags); 781 clear_bit(SK_DATA, &svsk->sk_flags);
800 while ((skb = skb_recv_datagram(svsk->sk_sk, 0, 1, &err)) == NULL) { 782 while ((err == kernel_recvmsg(svsk->sk_sock, &msg, NULL,
783 0, 0, MSG_PEEK | MSG_DONTWAIT)) < 0 ||
784 (skb = skb_recv_datagram(svsk->sk_sk, 0, 1, &err)) == NULL) {
801 if (err == -EAGAIN) { 785 if (err == -EAGAIN) {
802 svc_sock_received(svsk); 786 svc_sock_received(svsk);
803 return err; 787 return err;
@@ -805,6 +789,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
805 /* possibly an icmp error */ 789 /* possibly an icmp error */
806 dprintk("svc: recvfrom returned error %d\n", -err); 790 dprintk("svc: recvfrom returned error %d\n", -err);
807 } 791 }
792 rqstp->rq_addrlen = sizeof(rqstp->rq_addr);
808 if (skb->tstamp.off_sec == 0) { 793 if (skb->tstamp.off_sec == 0) {
809 struct timeval tv; 794 struct timeval tv;
810 795
@@ -827,7 +812,16 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
827 812
828 rqstp->rq_prot = IPPROTO_UDP; 813 rqstp->rq_prot = IPPROTO_UDP;
829 814
830 svc_udp_get_sender_address(rqstp, skb); 815 if (cmh->cmsg_level != IPPROTO_IP ||
816 cmh->cmsg_type != IP_PKTINFO) {
817 if (net_ratelimit())
818 printk("rpcsvc: received unknown control message:"
819 "%d/%d\n",
820 cmh->cmsg_level, cmh->cmsg_type);
821 skb_free_datagram(svsk->sk_sk, skb);
822 return 0;
823 }
824 svc_udp_get_dest_address(rqstp, cmh);
831 825
832 if (skb_is_nonlinear(skb)) { 826 if (skb_is_nonlinear(skb)) {
833 /* we have to copy */ 827 /* we have to copy */
@@ -884,6 +878,9 @@ svc_udp_sendto(struct svc_rqst *rqstp)
884static void 878static void
885svc_udp_init(struct svc_sock *svsk) 879svc_udp_init(struct svc_sock *svsk)
886{ 880{
881 int one = 1;
882 mm_segment_t oldfs;
883
887 svsk->sk_sk->sk_data_ready = svc_udp_data_ready; 884 svsk->sk_sk->sk_data_ready = svc_udp_data_ready;
888 svsk->sk_sk->sk_write_space = svc_write_space; 885 svsk->sk_sk->sk_write_space = svc_write_space;
889 svsk->sk_recvfrom = svc_udp_recvfrom; 886 svsk->sk_recvfrom = svc_udp_recvfrom;
@@ -899,6 +896,13 @@ svc_udp_init(struct svc_sock *svsk)
899 896
900 set_bit(SK_DATA, &svsk->sk_flags); /* might have come in before data_ready set up */ 897 set_bit(SK_DATA, &svsk->sk_flags); /* might have come in before data_ready set up */
901 set_bit(SK_CHNGBUF, &svsk->sk_flags); 898 set_bit(SK_CHNGBUF, &svsk->sk_flags);
899
900 oldfs = get_fs();
901 set_fs(KERNEL_DS);
902 /* make sure we get destination address info */
903 svsk->sk_sock->ops->setsockopt(svsk->sk_sock, IPPROTO_IP, IP_PKTINFO,
904 (char __user *)&one, sizeof(one));
905 set_fs(oldfs);
902} 906}
903 907
904/* 908/*
@@ -977,11 +981,9 @@ static inline int svc_port_is_privileged(struct sockaddr *sin)
977 case AF_INET: 981 case AF_INET:
978 return ntohs(((struct sockaddr_in *)sin)->sin_port) 982 return ntohs(((struct sockaddr_in *)sin)->sin_port)
979 < PROT_SOCK; 983 < PROT_SOCK;
980#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
981 case AF_INET6: 984 case AF_INET6:
982 return ntohs(((struct sockaddr_in6 *)sin)->sin6_port) 985 return ntohs(((struct sockaddr_in6 *)sin)->sin6_port)
983 < PROT_SOCK; 986 < PROT_SOCK;
984#endif
985 default: 987 default:
986 return 0; 988 return 0;
987 } 989 }
@@ -1786,7 +1788,7 @@ svc_delete_socket(struct svc_sock *svsk)
1786 spin_unlock_bh(&serv->sv_lock); 1788 spin_unlock_bh(&serv->sv_lock);
1787} 1789}
1788 1790
1789void svc_close_socket(struct svc_sock *svsk) 1791static void svc_close_socket(struct svc_sock *svsk)
1790{ 1792{
1791 set_bit(SK_CLOSE, &svsk->sk_flags); 1793 set_bit(SK_CLOSE, &svsk->sk_flags);
1792 if (test_and_set_bit(SK_BUSY, &svsk->sk_flags)) 1794 if (test_and_set_bit(SK_BUSY, &svsk->sk_flags))
@@ -1799,6 +1801,19 @@ void svc_close_socket(struct svc_sock *svsk)
1799 svc_sock_put(svsk); 1801 svc_sock_put(svsk);
1800} 1802}
1801 1803
1804void svc_force_close_socket(struct svc_sock *svsk)
1805{
1806 set_bit(SK_CLOSE, &svsk->sk_flags);
1807 if (test_bit(SK_BUSY, &svsk->sk_flags)) {
1808 /* Waiting to be processed, but no threads left,
1809 * So just remove it from the waiting list
1810 */
1811 list_del_init(&svsk->sk_ready);
1812 clear_bit(SK_BUSY, &svsk->sk_flags);
1813 }
1814 svc_close_socket(svsk);
1815}
1816
1802/** 1817/**
1803 * svc_makesock - Make a socket for nfsd and lockd 1818 * svc_makesock - Make a socket for nfsd and lockd
1804 * @serv: RPC server structure 1819 * @serv: RPC server structure
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 51ca4383c388..606971645b33 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -934,7 +934,7 @@ static long unix_wait_for_peer(struct sock *other, long timeo)
934 934
935 sched = !sock_flag(other, SOCK_DEAD) && 935 sched = !sock_flag(other, SOCK_DEAD) &&
936 !(other->sk_shutdown & RCV_SHUTDOWN) && 936 !(other->sk_shutdown & RCV_SHUTDOWN) &&
937 (skb_queue_len(&other->sk_receive_queue) >= 937 (skb_queue_len(&other->sk_receive_queue) >
938 other->sk_max_ack_backlog); 938 other->sk_max_ack_backlog);
939 939
940 unix_state_runlock(other); 940 unix_state_runlock(other);
@@ -1008,7 +1008,7 @@ restart:
1008 if (other->sk_state != TCP_LISTEN) 1008 if (other->sk_state != TCP_LISTEN)
1009 goto out_unlock; 1009 goto out_unlock;
1010 1010
1011 if (skb_queue_len(&other->sk_receive_queue) >= 1011 if (skb_queue_len(&other->sk_receive_queue) >
1012 other->sk_max_ack_backlog) { 1012 other->sk_max_ack_backlog) {
1013 err = -EAGAIN; 1013 err = -EAGAIN;
1014 if (!timeo) 1014 if (!timeo)
@@ -1381,7 +1381,7 @@ restart:
1381 } 1381 }
1382 1382
1383 if (unix_peer(other) != sk && 1383 if (unix_peer(other) != sk &&
1384 (skb_queue_len(&other->sk_receive_queue) >= 1384 (skb_queue_len(&other->sk_receive_queue) >
1385 other->sk_max_ack_backlog)) { 1385 other->sk_max_ack_backlog)) {
1386 if (!timeo) { 1386 if (!timeo) {
1387 err = -EAGAIN; 1387 err = -EAGAIN;
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c
deleted file mode 100644
index 41d7e32be70d..000000000000
--- a/net/wanrouter/af_wanpipe.c
+++ /dev/null
@@ -1,2600 +0,0 @@
1/*****************************************************************************
2* af_wanpipe.c WANPIPE(tm) Secure Socket Layer.
3*
4* Author: Nenad Corbic <ncorbic@sangoma.com>
5*
6* Copyright: (c) 2000 Sangoma Technologies Inc.
7*
8* This program is free software; you can redistribute it and/or
9* modify it under the terms of the GNU General Public License
10* as published by the Free Software Foundation; either version
11* 2 of the License, or (at your option) any later version.
12* ============================================================================
13* Due Credit:
14* Wanpipe socket layer is based on Packet and
15* the X25 socket layers. The above sockets were
16* used for the specific use of Sangoma Technologies
17* API programs.
18* Packet socket Authors: Ross Biro, Fred N. van Kempen and
19* Alan Cox.
20* X25 socket Author: Jonathan Naylor.
21* ============================================================================
22* Mar 15, 2002 Arnaldo C. Melo o Use wp_sk()->num, as it isnt anymore in sock
23* Apr 25, 2000 Nenad Corbic o Added the ability to send zero length packets.
24* Mar 13, 2000 Nenad Corbic o Added a tx buffer check via ioctl call.
25* Mar 06, 2000 Nenad Corbic o Fixed the corrupt sock lcn problem.
26* Server and client application can run
27* simultaneously without conflicts.
28* Feb 29, 2000 Nenad Corbic o Added support for PVC protocols, such as
29* CHDLC, Frame Relay and HDLC API.
30* Jan 17, 2000 Nenad Corbic o Initial version, based on AF_PACKET socket.
31* X25API support only.
32*
33******************************************************************************/
34
35#include <linux/types.h>
36#include <linux/sched.h>
37#include <linux/mm.h>
38#include <linux/capability.h>
39#include <linux/fcntl.h>
40#include <linux/socket.h>
41#include <linux/in.h>
42#include <linux/inet.h>
43#include <linux/netdevice.h>
44#include <linux/poll.h>
45#include <linux/wireless.h>
46#include <linux/kmod.h>
47#include <net/ip.h>
48#include <net/protocol.h>
49#include <linux/skbuff.h>
50#include <net/sock.h>
51#include <linux/errno.h>
52#include <linux/timer.h>
53#include <asm/system.h>
54#include <asm/uaccess.h>
55#include <linux/module.h>
56#include <linux/init.h>
57#include <linux/if_wanpipe.h>
58#include <linux/pkt_sched.h>
59#include <linux/tcp_states.h>
60#include <linux/if_wanpipe_common.h>
61
62#ifdef CONFIG_INET
63#include <net/inet_common.h>
64#endif
65
66#define SLOW_BACKOFF 0.1*HZ
67#define FAST_BACKOFF 0.01*HZ
68
69//#define PRINT_DEBUG
70#ifdef PRINT_DEBUG
71 #define DBG_PRINTK(format, a...) printk(format, ## a)
72#else
73 #define DBG_PRINTK(format, a...)
74#endif
75
76
77/* SECURE SOCKET IMPLEMENTATION
78 *
79 * TRANSMIT:
80 *
81 * When the user sends a packet via send() system call
82 * the wanpipe_sendmsg() function is executed.
83 *
84 * Each packet is enqueud into sk->sk_write_queue transmit
85 * queue. When the packet is enqueued, a delayed transmit
86 * timer is triggerd which acts as a Bottom Half hander.
87 *
88 * wanpipe_delay_transmit() function (BH), dequeues packets
89 * from the sk->sk_write_queue transmit queue and sends it
90 * to the deriver via dev->hard_start_xmit(skb, dev) function.
91 * Note, this function is actual a function pointer of if_send()
92 * routine in the wanpipe driver.
93 *
94 * X25API GUARANTEED DELIVERY:
95 *
96 * In order to provide 100% guaranteed packet delivery,
97 * an atomic 'packet_sent' counter is implemented. Counter
98 * is incremented for each packet enqueued
99 * into sk->sk_write_queue. Counter is decremented each
100 * time wanpipe_delayed_transmit() function successfuly
101 * passes the packet to the driver. Before each send(), a poll
102 * routine checks the sock resources The maximum value of
103 * packet sent counter is 1, thus if one packet is queued, the
104 * application will block until that packet is passed to the
105 * driver.
106 *
107 * RECEIVE:
108 *
109 * Wanpipe device drivers call the socket bottom half
110 * function, wanpipe_rcv() to queue the incoming packets
111 * into an AF_WANPIPE socket queue. Based on wanpipe_rcv()
112 * return code, the driver knows whether the packet was
113 * successfully queued. If the socket queue is full,
114 * protocol flow control is used by the driver, if any,
115 * to slow down the traffic until the sock queue is free.
116 *
117 * Every time a packet arrives into a socket queue the
118 * socket wakes up processes which are waiting to receive
119 * data.
120 *
121 * If the socket queue is full, the driver sets a block
122 * bit which signals the socket to kick the wanpipe driver
123 * bottom half hander when the socket queue is partialy
124 * empty. wanpipe_recvmsg() function performs this action.
125 *
126 * In case of x25api, packets will never be dropped, since
127 * flow control is available.
128 *
129 * In case of streaming protocols like CHDLC, packets will
130 * be dropped but the statistics will be generated.
131 */
132
133
134/* The code below is used to test memory leaks. It prints out
135 * a message every time kmalloc and kfree system calls get executed.
136 * If the calls match there is no leak :)
137 */
138
139/***********FOR DEBUGGING PURPOSES*********************************************
140#define KMEM_SAFETYZONE 8
141
142static void * dbg_kmalloc(unsigned int size, int prio, int line) {
143 void * v = kmalloc(size,prio);
144 printk(KERN_INFO "line %d kmalloc(%d,%d) = %p\n",line,size,prio,v);
145 return v;
146}
147static void dbg_kfree(void * v, int line) {
148 printk(KERN_INFO "line %d kfree(%p)\n",line,v);
149 kfree(v);
150}
151
152#define kmalloc(x,y) dbg_kmalloc(x,y,__LINE__)
153#define kfree(x) dbg_kfree(x,__LINE__)
154******************************************************************************/
155
156
157/* List of all wanpipe sockets. */
158HLIST_HEAD(wanpipe_sklist);
159static DEFINE_RWLOCK(wanpipe_sklist_lock);
160
161atomic_t wanpipe_socks_nr;
162static unsigned long wanpipe_tx_critical;
163
164#if 0
165/* Private wanpipe socket structures. */
166struct wanpipe_opt
167{
168 void *mbox; /* Mail box */
169 void *card; /* Card bouded to */
170 struct net_device *dev; /* Bounded device */
171 unsigned short lcn; /* Binded LCN */
172 unsigned char svc; /* 0=pvc, 1=svc */
173 unsigned char timer; /* flag for delayed transmit*/
174 struct timer_list tx_timer;
175 unsigned poll_cnt;
176 unsigned char force; /* Used to force sock release */
177 atomic_t packet_sent;
178};
179#endif
180
181static int sk_count;
182extern const struct proto_ops wanpipe_ops;
183static unsigned long find_free_critical;
184
185static void wanpipe_unlink_driver(struct sock *sk);
186static void wanpipe_link_driver(struct net_device *dev, struct sock *sk);
187static void wanpipe_wakeup_driver(struct sock *sk);
188static int execute_command(struct sock *, unsigned char, unsigned int);
189static int check_dev(struct net_device *dev, sdla_t *card);
190struct net_device *wanpipe_find_free_dev(sdla_t *card);
191static void wanpipe_unlink_card (struct sock *);
192static int wanpipe_link_card (struct sock *);
193static struct sock *wanpipe_make_new(struct sock *);
194static struct sock *wanpipe_alloc_socket(void);
195static inline int get_atomic_device(struct net_device *dev);
196static int wanpipe_exec_cmd(struct sock *, int, unsigned int);
197static int get_ioctl_cmd (struct sock *, void *);
198static int set_ioctl_cmd (struct sock *, void *);
199static void release_device(struct net_device *dev);
200static void wanpipe_kill_sock_timer (unsigned long data);
201static void wanpipe_kill_sock_irq (struct sock *);
202static void wanpipe_kill_sock_accept (struct sock *);
203static int wanpipe_do_bind(struct sock *sk, struct net_device *dev,
204 int protocol);
205struct sock * get_newsk_from_skb (struct sk_buff *);
206static int wanpipe_debug (struct sock *, void *);
207static void wanpipe_delayed_transmit (unsigned long data);
208static void release_driver(struct sock *);
209static void start_cleanup_timer (struct sock *);
210static void check_write_queue(struct sock *);
211static int check_driver_busy (struct sock *);
212
213/*============================================================
214 * wanpipe_rcv
215 *
216 * Wanpipe socket bottom half handler. This function
217 * is called by the WANPIPE device drivers to queue a
218 * incoming packet into the socket receive queue.
219 * Once the packet is queued, all processes waiting to
220 * read are woken up.
221 *
222 * During socket bind, this function is bounded into
223 * WANPIPE driver private.
224 *===========================================================*/
225
226static int wanpipe_rcv(struct sk_buff *skb, struct net_device *dev,
227 struct sock *sk)
228{
229 struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)skb->cb;
230 wanpipe_common_t *chan = dev->priv;
231 /*
232 * When we registered the protocol we saved the socket in the data
233 * field for just this event.
234 */
235
236 skb->dev = dev;
237
238 sll->sll_family = AF_WANPIPE;
239 sll->sll_hatype = dev->type;
240 sll->sll_protocol = skb->protocol;
241 sll->sll_pkttype = skb->pkt_type;
242 sll->sll_ifindex = dev->ifindex;
243 sll->sll_halen = 0;
244
245 if (dev->hard_header_parse)
246 sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr);
247
248 /*
249 * WAN_PACKET_DATA : Data which should be passed up the receive queue.
250 * WAN_PACKET_ASYC : Asynchronous data like place call, which should
251 * be passed up the listening sock.
252 * WAN_PACKET_ERR : Asynchronous data like clear call or restart
253 * which should go into an error queue.
254 */
255 switch (skb->pkt_type){
256
257 case WAN_PACKET_DATA:
258 if (sock_queue_rcv_skb(sk,skb)<0){
259 return -ENOMEM;
260 }
261 break;
262 case WAN_PACKET_CMD:
263 sk->sk_state = chan->state;
264 /* Bug fix: update Mar6.
265 * Do not set the sock lcn number here, since
266 * cmd is not guaranteed to be executed on the
267 * board, thus Lcn could be wrong */
268 sk->sk_data_ready(sk, skb->len);
269 kfree_skb(skb);
270 break;
271 case WAN_PACKET_ERR:
272 sk->sk_state = chan->state;
273 if (sock_queue_err_skb(sk,skb)<0){
274 return -ENOMEM;
275 }
276 break;
277 default:
278 printk(KERN_INFO "wansock: BH Illegal Packet Type Dropping\n");
279 kfree_skb(skb);
280 break;
281 }
282
283//??????????????????????
284// if (sk->sk_state == WANSOCK_DISCONNECTED){
285// if (sk->sk_zapped) {
286// //printk(KERN_INFO "wansock: Disconnected, killing early\n");
287// wanpipe_unlink_driver(sk);
288// sk->sk_bound_dev_if = 0;
289// }
290// }
291
292 return 0;
293}
294
295/*============================================================
296 * wanpipe_listen_rcv
297 *
298 * Wanpipe LISTEN socket bottom half handler. This function
299 * is called by the WANPIPE device drivers to queue an
300 * incoming call into the socket listening queue.
301 * Once the packet is queued, the waiting accept() process
302 * is woken up.
303 *
304 * During socket bind, this function is bounded into
305 * WANPIPE driver private.
306 *
307 * IMPORTANT NOTE:
308 * The accept call() is waiting for an skb packet
309 * which contains a pointer to a device structure.
310 *
311 * When we do a bind to a device structre, we
312 * bind a newly created socket into "chan->sk". Thus,
313 * when accept receives the skb packet, it will know
314 * from which dev it came form, and in turn it will know
315 * the address of the new sock.
316 *
317 * NOTE: This function gets called from driver ISR.
318 *===========================================================*/
319
320static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
321{
322 wanpipe_opt *wp = wp_sk(sk), *newwp;
323 struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)skb->cb;
324 struct sock *newsk;
325 struct net_device *dev;
326 sdla_t *card;
327 mbox_cmd_t *mbox_ptr;
328 wanpipe_common_t *chan;
329
330 /* Find a free device, if none found, all svc's are busy
331 */
332
333 card = (sdla_t*)wp->card;
334 if (!card){
335 printk(KERN_INFO "wansock: LISTEN ERROR, No Card\n");
336 return -ENODEV;
337 }
338
339 dev = wanpipe_find_free_dev(card);
340 if (!dev){
341 printk(KERN_INFO "wansock: LISTEN ERROR, No Free Device\n");
342 return -ENODEV;
343 }
344
345 chan=dev->priv;
346 chan->state = WANSOCK_CONNECTING;
347
348 /* Allocate a new sock, which accept will bind
349 * and pass up to the user
350 */
351 if ((newsk = wanpipe_make_new(sk)) == NULL){
352 release_device(dev);
353 return -ENOMEM;
354 }
355
356
357 /* Initialize the new sock structure
358 */
359 newsk->sk_bound_dev_if = dev->ifindex;
360 newwp = wp_sk(newsk);
361 newwp->card = wp->card;
362
363 /* Insert the sock into the main wanpipe
364 * sock list.
365 */
366 atomic_inc(&wanpipe_socks_nr);
367
368 /* Allocate and fill in the new Mail Box. Then
369 * bind the mail box to the sock. It will be
370 * used by the ioctl call to read call information
371 * and to execute commands.
372 */
373 if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) {
374 wanpipe_kill_sock_irq (newsk);
375 release_device(dev);
376 return -ENOMEM;
377 }
378 memcpy(mbox_ptr,skb->data,skb->len);
379
380 /* Register the lcn on which incoming call came
381 * from. Thus, if we have to clear it, we know
382 * which lcn to clear
383 */
384
385 newwp->lcn = mbox_ptr->cmd.lcn;
386 newwp->mbox = (void *)mbox_ptr;
387
388 DBG_PRINTK(KERN_INFO "NEWSOCK : Device %s, bind to lcn %i\n",
389 dev->name,mbox_ptr->cmd.lcn);
390
391 chan->lcn = mbox_ptr->cmd.lcn;
392 card->u.x.svc_to_dev_map[(chan->lcn%MAX_X25_LCN)] = dev;
393
394 sock_reset_flag(newsk, SOCK_ZAPPED);
395 newwp->num = htons(X25_PROT);
396
397 if (wanpipe_do_bind(newsk, dev, newwp->num)) {
398 wanpipe_kill_sock_irq (newsk);
399 release_device(dev);
400 return -EINVAL;
401 }
402 newsk->sk_state = WANSOCK_CONNECTING;
403
404
405 /* Fill in the standard sock address info */
406
407 sll->sll_family = AF_WANPIPE;
408 sll->sll_hatype = dev->type;
409 sll->sll_protocol = skb->protocol;
410 sll->sll_pkttype = skb->pkt_type;
411 sll->sll_ifindex = dev->ifindex;
412 sll->sll_halen = 0;
413
414 skb->dev = dev;
415 sk->sk_ack_backlog++;
416
417 /* We must do this manually, since the sock_queue_rcv_skb()
418 * function sets the skb->dev to NULL. However, we use
419 * the dev field in the accept function.*/
420 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
421 (unsigned)sk->sk_rcvbuf) {
422
423 wanpipe_unlink_driver(newsk);
424 wanpipe_kill_sock_irq (newsk);
425 --sk->sk_ack_backlog;
426 return -ENOMEM;
427 }
428
429 skb_set_owner_r(skb, sk);
430 skb_queue_tail(&sk->sk_receive_queue, skb);
431 sk->sk_data_ready(sk, skb->len);
432
433 return 0;
434}
435
436
437
438/*============================================================
439 * wanpipe_make_new
440 *
441 * Create a new sock, and allocate a wanpipe private
442 * structure to it. Also, copy the important data
443 * from the original sock to the new sock.
444 *
445 * This function is used by wanpipe_listen_rcv() listen
446 * bottom half handler. A copy of the listening sock
447 * is created using this function.
448 *
449 *===========================================================*/
450
451static struct sock *wanpipe_make_new(struct sock *osk)
452{
453 struct sock *sk;
454
455 if (osk->sk_type != SOCK_RAW)
456 return NULL;
457
458 if ((sk = wanpipe_alloc_socket()) == NULL)
459 return NULL;
460
461 sk->sk_type = osk->sk_type;
462 sk->sk_socket = osk->sk_socket;
463 sk->sk_priority = osk->sk_priority;
464 sk->sk_protocol = osk->sk_protocol;
465 wp_sk(sk)->num = wp_sk(osk)->num;
466 sk->sk_rcvbuf = osk->sk_rcvbuf;
467 sk->sk_sndbuf = osk->sk_sndbuf;
468 sk->sk_state = WANSOCK_CONNECTING;
469 sk->sk_sleep = osk->sk_sleep;
470
471 if (sock_flag(osk, SOCK_DBG))
472 sock_set_flag(sk, SOCK_DBG);
473
474 return sk;
475}
476
477/*
478 * FIXME: wanpipe_opt has to include a sock in its definition and stop using
479 * sk_protinfo, but this code is not even compilable now, so lets leave it for
480 * later.
481 */
482static struct proto wanpipe_proto = {
483 .name = "WANPIPE",
484 .owner = THIS_MODULE,
485 .obj_size = sizeof(struct sock),
486};
487
488/*============================================================
489 * wanpipe_make_new
490 *
491 * Allocate memory for the a new sock, and sock
492 * private data.
493 *
494 * Increment the module use count.
495 *
496 * This function is used by wanpipe_create() and
497 * wanpipe_make_new() functions.
498 *
499 *===========================================================*/
500
501static struct sock *wanpipe_alloc_socket(void)
502{
503 struct sock *sk;
504 struct wanpipe_opt *wan_opt;
505
506 if ((sk = sk_alloc(PF_WANPIPE, GFP_ATOMIC, &wanpipe_proto, 1)) == NULL)
507 return NULL;
508
509 if ((wan_opt = kzalloc(sizeof(struct wanpipe_opt), GFP_ATOMIC)) == NULL) {
510 sk_free(sk);
511 return NULL;
512 }
513
514 wp_sk(sk) = wan_opt;
515
516 /* Use timer to send data to the driver. This will act
517 * as a BH handler for sendmsg functions */
518 init_timer(&wan_opt->tx_timer);
519 wan_opt->tx_timer.data = (unsigned long)sk;
520 wan_opt->tx_timer.function = wanpipe_delayed_transmit;
521
522 sock_init_data(NULL, sk);
523 return sk;
524}
525
526
527/*============================================================
528 * wanpipe_sendmsg
529 *
530 * This function implements a sendto() system call,
531 * for AF_WANPIPE socket family.
532 * During socket bind() sk->sk_bound_dev_if is initialized
533 * to a correct network device. This number is used
534 * to find a network device to which the packet should
535 * be passed to.
536 *
537 * Each packet is queued into sk->sk_write_queue and
538 * delayed transmit bottom half handler is marked for
539 * execution.
540 *
541 * A socket must be in WANSOCK_CONNECTED state before
542 * a packet is queued into sk->sk_write_queue.
543 *===========================================================*/
544
545static int wanpipe_sendmsg(struct kiocb *iocb, struct socket *sock,
546 struct msghdr *msg, int len)
547{
548 wanpipe_opt *wp;
549 struct sock *sk = sock->sk;
550 struct wan_sockaddr_ll *saddr=(struct wan_sockaddr_ll *)msg->msg_name;
551 struct sk_buff *skb;
552 struct net_device *dev;
553 unsigned short proto;
554 unsigned char *addr;
555 int ifindex, err, reserve = 0;
556
557
558 if (!sock_flag(sk, SOCK_ZAPPED))
559 return -ENETDOWN;
560
561 if (sk->sk_state != WANSOCK_CONNECTED)
562 return -ENOTCONN;
563
564 if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
565 return(-EINVAL);
566
567 /* it was <=, now one can send
568 * zero length packets */
569 if (len < sizeof(x25api_hdr_t))
570 return -EINVAL;
571
572 wp = wp_sk(sk);
573
574 if (saddr == NULL) {
575 ifindex = sk->sk_bound_dev_if;
576 proto = wp->num;
577 addr = NULL;
578
579 }else{
580 if (msg->msg_namelen < sizeof(struct wan_sockaddr_ll)){
581 return -EINVAL;
582 }
583
584 ifindex = sk->sk_bound_dev_if;
585 proto = saddr->sll_protocol;
586 addr = saddr->sll_addr;
587 }
588
589 dev = dev_get_by_index(ifindex);
590 if (dev == NULL){
591 printk(KERN_INFO "wansock: Send failed, dev index: %i\n",ifindex);
592 return -ENXIO;
593 }
594 dev_put(dev);
595
596 if (sock->type == SOCK_RAW)
597 reserve = dev->hard_header_len;
598
599 if (len > dev->mtu+reserve){
600 return -EMSGSIZE;
601 }
602
603 skb = sock_alloc_send_skb(sk, len + LL_RESERVED_SPACE(dev),
604 msg->msg_flags & MSG_DONTWAIT, &err);
605
606 if (skb==NULL){
607 goto out_unlock;
608 }
609
610 skb_reserve(skb, LL_RESERVED_SPACE(dev));
611 skb->nh.raw = skb->data;
612
613 /* Returns -EFAULT on error */
614 err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
615 if (err){
616 goto out_free;
617 }
618
619 if (dev->hard_header) {
620 int res;
621 err = -EINVAL;
622 res = dev->hard_header(skb, dev, ntohs(proto), addr, NULL, len);
623 if (res<0){
624 goto out_free;
625 }
626 }
627
628 skb->protocol = proto;
629 skb->dev = dev;
630 skb->priority = sk->sk_priority;
631 skb->pkt_type = WAN_PACKET_DATA;
632
633 err = -ENETDOWN;
634 if (!(dev->flags & IFF_UP))
635 goto out_free;
636
637 if (atomic_read(&sk->sk_wmem_alloc) + skb->truesize >
638 (unsigned int)sk->sk_sndbuf){
639 kfree_skb(skb);
640 return -ENOBUFS;
641 }
642
643 skb_queue_tail(&sk->sk_write_queue,skb);
644 atomic_inc(&wp->packet_sent);
645
646 if (!(test_and_set_bit(0, &wp->timer)))
647 mod_timer(&wp->tx_timer, jiffies + 1);
648
649 return(len);
650
651out_free:
652 kfree_skb(skb);
653out_unlock:
654 return err;
655}
656
657/*============================================================
658 * wanpipe_delayed_tarnsmit
659 *
660 * Transmit bottom half handler. It dequeues packets
661 * from sk->sk_write_queue and passes them to the
662 * driver. If the driver is busy, the packet is
663 * re-enqueued.
664 *
665 * Packet Sent counter is decremented on successful
666 * transmission.
667 *===========================================================*/
668
669
670static void wanpipe_delayed_transmit (unsigned long data)
671{
672 struct sock *sk=(struct sock *)data;
673 struct sk_buff *skb;
674 wanpipe_opt *wp = wp_sk(sk);
675 struct net_device *dev = wp->dev;
676 sdla_t *card = (sdla_t*)wp->card;
677
678 if (!card || !dev){
679 clear_bit(0, &wp->timer);
680 DBG_PRINTK(KERN_INFO "wansock: Transmit delay, no dev or card\n");
681 return;
682 }
683
684 if (sk->sk_state != WANSOCK_CONNECTED || !sock_flag(sk, SOCK_ZAPPED)) {
685 clear_bit(0, &wp->timer);
686 DBG_PRINTK(KERN_INFO "wansock: Tx Timer, State not CONNECTED\n");
687 return;
688 }
689
690 /* If driver is executing command, we must offload
691 * the board by not sending data. Otherwise a
692 * pending command will never get a free buffer
693 * to execute */
694 if (atomic_read(&card->u.x.command_busy)){
695 wp->tx_timer.expires = jiffies + SLOW_BACKOFF;
696 add_timer(&wp->tx_timer);
697 DBG_PRINTK(KERN_INFO "wansock: Tx Timer, command bys BACKOFF\n");
698 return;
699 }
700
701
702 if (test_and_set_bit(0,&wanpipe_tx_critical)){
703 printk(KERN_INFO "WanSock: Tx timer critical %s\n",dev->name);
704 wp->tx_timer.expires = jiffies + SLOW_BACKOFF;
705 add_timer(&wp->tx_timer);
706 return;
707 }
708
709 /* Check for a packet in the fifo and send */
710 if ((skb = skb_dequeue(&sk->sk_write_queue)) != NULL){
711
712 if (dev->hard_start_xmit(skb, dev) != 0){
713
714 /* Driver failed to transmit, re-enqueue
715 * the packet and retry again later */
716 skb_queue_head(&sk->sk_write_queue,skb);
717 clear_bit(0,&wanpipe_tx_critical);
718 return;
719 }else{
720
721 /* Packet Sent successful. Check for more packets
722 * if more packets, re-trigger the transmit routine
723 * other wise exit
724 */
725 atomic_dec(&wp->packet_sent);
726
727 if (skb_peek(&sk->sk_write_queue) == NULL) {
728 /* If there is nothing to send, kick
729 * the poll routine, which will trigger
730 * the application to send more data */
731 sk->sk_data_ready(sk, 0);
732 clear_bit(0, &wp->timer);
733 }else{
734 /* Reschedule as fast as possible */
735 wp->tx_timer.expires = jiffies + 1;
736 add_timer(&wp->tx_timer);
737 }
738 }
739 }
740 clear_bit(0,&wanpipe_tx_critical);
741}
742
743/*============================================================
744 * execute_command
745 *
746 * Execute x25api commands. The atomic variable
747 * chan->command is used to indicate to the driver that
748 * command is pending for execution. The acutal command
749 * structure is placed into a sock mbox structure
750 * (wp_sk(sk)->mbox).
751 *
752 * The sock private structure, mbox is
753 * used as shared memory between sock and the driver.
754 * Driver uses the sock mbox to execute the command
755 * and return the result.
756 *
757 * For all command except PLACE CALL, the function
758 * waits for the result. PLACE CALL can be ether
759 * blocking or nonblocking. The user sets this option
760 * via ioctl call.
761 *===========================================================*/
762
763
764static int execute_command(struct sock *sk, unsigned char cmd, unsigned int flags)
765{
766 wanpipe_opt *wp = wp_sk(sk);
767 struct net_device *dev;
768 wanpipe_common_t *chan=NULL;
769 int err=0;
770 DECLARE_WAITQUEUE(wait, current);
771
772 dev = dev_get_by_index(sk->sk_bound_dev_if);
773 if (dev == NULL){
774 printk(KERN_INFO "wansock: Exec failed no dev %i\n",
775 sk->sk_bound_dev_if);
776 return -ENODEV;
777 }
778 dev_put(dev);
779
780 if ((chan=dev->priv) == NULL){
781 printk(KERN_INFO "wansock: Exec cmd failed no priv area\n");
782 return -ENODEV;
783 }
784
785 if (atomic_read(&chan->command)){
786 printk(KERN_INFO "wansock: ERROR: Command already running %x, %s\n",
787 atomic_read(&chan->command),dev->name);
788 return -EINVAL;
789 }
790
791 if (!wp->mbox) {
792 printk(KERN_INFO "wansock: In execute without MBOX\n");
793 return -EINVAL;
794 }
795
796 ((mbox_cmd_t*)wp->mbox)->cmd.command = cmd;
797 ((mbox_cmd_t*)wp->mbox)->cmd.lcn = wp->lcn;
798 ((mbox_cmd_t*)wp->mbox)->cmd.result = 0x7F;
799
800
801 if (flags & O_NONBLOCK){
802 cmd |= 0x80;
803 atomic_set(&chan->command, cmd);
804 }else{
805 atomic_set(&chan->command, cmd);
806 }
807
808 add_wait_queue(sk->sk_sleep,&wait);
809 current->state = TASK_INTERRUPTIBLE;
810 for (;;){
811 if (((mbox_cmd_t*)wp->mbox)->cmd.result != 0x7F) {
812 err = 0;
813 break;
814 }
815 if (signal_pending(current)) {
816 err = -ERESTARTSYS;
817 break;
818 }
819 schedule();
820 }
821 current->state = TASK_RUNNING;
822 remove_wait_queue(sk->sk_sleep,&wait);
823
824 return err;
825}
826
827/*============================================================
828 * wanpipe_destroy_timer
829 *
830 * Used by wanpipe_release, to delay release of
831 * the socket.
832 *===========================================================*/
833
834static void wanpipe_destroy_timer(unsigned long data)
835{
836 struct sock *sk=(struct sock *)data;
837 wanpipe_opt *wp = wp_sk(sk);
838
839 if ((!atomic_read(&sk->sk_wmem_alloc) &&
840 !atomic_read(&sk->sk_rmem_alloc)) ||
841 (++wp->force == 5)) {
842
843 if (atomic_read(&sk->sk_wmem_alloc) ||
844 atomic_read(&sk->sk_rmem_alloc))
845 printk(KERN_INFO "wansock: Warning, Packet Discarded due to sock shutdown!\n");
846
847 kfree(wp);
848 wp_sk(sk) = NULL;
849
850 if (atomic_read(&sk->sk_refcnt) != 1) {
851 atomic_set(&sk->sk_refcnt, 1);
852 DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i ! :delay.\n",
853 atomic_read(&sk->sk_refcnt));
854 }
855 sock_put(sk);
856 atomic_dec(&wanpipe_socks_nr);
857 return;
858 }
859
860 sk->sk_timer.expires = jiffies + 5 * HZ;
861 add_timer(&sk->sk_timer);
862 printk(KERN_INFO "wansock: packet sk destroy delayed\n");
863}
864
865/*============================================================
866 * wanpipe_unlink_driver
867 *
868 * When the socket is released, this function is
869 * used to remove links that bind the sock and the
870 * driver together.
871 *===========================================================*/
872static void wanpipe_unlink_driver (struct sock *sk)
873{
874 struct net_device *dev;
875 wanpipe_common_t *chan=NULL;
876
877 sock_reset_flag(sk, SOCK_ZAPPED);
878 sk->sk_state = WANSOCK_DISCONNECTED;
879 wp_sk(sk)->dev = NULL;
880
881 dev = dev_get_by_index(sk->sk_bound_dev_if);
882 if (!dev){
883 printk(KERN_INFO "wansock: No dev on release\n");
884 return;
885 }
886 dev_put(dev);
887
888 if ((chan = dev->priv) == NULL){
889 printk(KERN_INFO "wansock: No Priv Area on release\n");
890 return;
891 }
892
893 set_bit(0,&chan->common_critical);
894 chan->sk=NULL;
895 chan->func=NULL;
896 chan->mbox=NULL;
897 chan->tx_timer=NULL;
898 clear_bit(0,&chan->common_critical);
899 release_device(dev);
900
901 return;
902}
903
904/*============================================================
905 * wanpipe_link_driver
906 *
907 * Upon successful bind(), sock is linked to a driver
908 * by binding in the wanpipe_rcv() bottom half handler
909 * to the driver function pointer, as well as sock and
910 * sock mailbox addresses. This way driver can pass
911 * data up the socket.
912 *===========================================================*/
913
914static void wanpipe_link_driver(struct net_device *dev, struct sock *sk)
915{
916 wanpipe_opt *wp = wp_sk(sk);
917 wanpipe_common_t *chan = dev->priv;
918 if (!chan)
919 return;
920 set_bit(0,&chan->common_critical);
921 chan->sk=sk;
922 chan->func=wanpipe_rcv;
923 chan->mbox = wp->mbox;
924 chan->tx_timer = &wp->tx_timer;
925 wp->dev = dev;
926 sock_set_flag(sk, SOCK_ZAPPED);
927 clear_bit(0,&chan->common_critical);
928}
929
930
931/*============================================================
932 * release_device
933 *
934 * During sock release, clear a critical bit, which
935 * marks the device a being taken.
936 *===========================================================*/
937
938
939static void release_device(struct net_device *dev)
940{
941 wanpipe_common_t *chan=dev->priv;
942 clear_bit(0,(void*)&chan->rw_bind);
943}
944
945/*============================================================
946 * wanpipe_release
947 *
948 * Close a PACKET socket. This is fairly simple. We
949 * immediately go to 'closed' state and remove our
950 * protocol entry in the device list.
951 *===========================================================*/
952
953static int wanpipe_release(struct socket *sock)
954{
955 wanpipe_opt *wp;
956 struct sock *sk = sock->sk;
957
958 if (!sk)
959 return 0;
960
961 wp = wp_sk(sk);
962 check_write_queue(sk);
963
964 /* Kill the tx timer, if we don't kill it now, the timer
965 * will run after we kill the sock. Timer code will
966 * try to access the sock which has been killed and cause
967 * kernel panic */
968
969 del_timer(&wp->tx_timer);
970
971 /*
972 * Unhook packet receive handler.
973 */
974
975 if (wp->num == htons(X25_PROT) &&
976 sk->sk_state != WANSOCK_DISCONNECTED && sock_flag(sk, SOCK_ZAPPED)) {
977 struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if);
978 wanpipe_common_t *chan;
979 if (dev){
980 chan=dev->priv;
981 atomic_set(&chan->disconnect,1);
982 DBG_PRINTK(KERN_INFO "wansock: Sending Clear Indication %i\n",
983 sk->sk_state);
984 dev_put(dev);
985 }
986 }
987
988 set_bit(1,&wanpipe_tx_critical);
989 write_lock(&wanpipe_sklist_lock);
990 sk_del_node_init(sk);
991 write_unlock(&wanpipe_sklist_lock);
992 clear_bit(1,&wanpipe_tx_critical);
993
994
995
996 release_driver(sk);
997
998
999 /*
1000 * Now the socket is dead. No more input will appear.
1001 */
1002
1003 sk->sk_state_change(sk); /* It is useless. Just for sanity. */
1004
1005 sock->sk = NULL;
1006 sk->sk_socket = NULL;
1007 sock_set_flag(sk, SOCK_DEAD);
1008
1009 /* Purge queues */
1010 skb_queue_purge(&sk->sk_receive_queue);
1011 skb_queue_purge(&sk->sk_write_queue);
1012 skb_queue_purge(&sk->sk_error_queue);
1013
1014 if (atomic_read(&sk->sk_rmem_alloc) ||
1015 atomic_read(&sk->sk_wmem_alloc)) {
1016 del_timer(&sk->sk_timer);
1017 printk(KERN_INFO "wansock: Killing in Timer R %i , W %i\n",
1018 atomic_read(&sk->sk_rmem_alloc),
1019 atomic_read(&sk->sk_wmem_alloc));
1020 sk->sk_timer.data = (unsigned long)sk;
1021 sk->sk_timer.expires = jiffies + HZ;
1022 sk->sk_timer.function = wanpipe_destroy_timer;
1023 add_timer(&sk->sk_timer);
1024 return 0;
1025 }
1026
1027 kfree(wp);
1028 wp_sk(sk) = NULL;
1029
1030 if (atomic_read(&sk->sk_refcnt) != 1) {
1031 DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i !:release.\n",
1032 atomic_read(&sk->sk_refcnt));
1033 atomic_set(&sk->sk_refcnt, 1);
1034 }
1035 sock_put(sk);
1036 atomic_dec(&wanpipe_socks_nr);
1037 return 0;
1038}
1039
1040/*============================================================
1041 * check_write_queue
1042 *
1043 * During sock shutdown, if the sock state is
1044 * WANSOCK_CONNECTED and there is transmit data
1045 * pending. Wait until data is released
1046 * before proceeding.
1047 *===========================================================*/
1048
1049static void check_write_queue(struct sock *sk)
1050{
1051
1052 if (sk->sk_state != WANSOCK_CONNECTED)
1053 return;
1054
1055 if (!atomic_read(&sk->sk_wmem_alloc))
1056 return;
1057
1058 printk(KERN_INFO "wansock: MAJOR ERROR, Data lost on sock release !!!\n");
1059
1060}
1061
1062/*============================================================
1063 * release_driver
1064 *
1065 * This function is called during sock shutdown, to
1066 * release any resources and links that bind the sock
1067 * to the driver. It also changes the state of the
1068 * sock to WANSOCK_DISCONNECTED
1069 *===========================================================*/
1070
1071static void release_driver(struct sock *sk)
1072{
1073 wanpipe_opt *wp;
1074 struct sk_buff *skb=NULL;
1075 struct sock *deadsk=NULL;
1076
1077 if (sk->sk_state == WANSOCK_LISTEN ||
1078 sk->sk_state == WANSOCK_BIND_LISTEN) {
1079 while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
1080 if ((deadsk = get_newsk_from_skb(skb))){
1081 DBG_PRINTK (KERN_INFO "wansock: RELEASE: FOUND DEAD SOCK\n");
1082 sock_set_flag(deadsk, SOCK_DEAD);
1083 start_cleanup_timer(deadsk);
1084 }
1085 kfree_skb(skb);
1086 }
1087 if (sock_flag(sk, SOCK_ZAPPED))
1088 wanpipe_unlink_card(sk);
1089 }else{
1090 if (sock_flag(sk, SOCK_ZAPPED))
1091 wanpipe_unlink_driver(sk);
1092 }
1093 sk->sk_state = WANSOCK_DISCONNECTED;
1094 sk->sk_bound_dev_if = 0;
1095 sock_reset_flag(sk, SOCK_ZAPPED);
1096 wp = wp_sk(sk);
1097
1098 if (wp) {
1099 kfree(wp->mbox);
1100 wp->mbox = NULL;
1101 }
1102}
1103
1104/*============================================================
1105 * start_cleanup_timer
1106 *
1107 * If new incoming call's are pending but the socket
1108 * is being released, start the timer which will
1109 * envoke the kill routines for pending socks.
1110 *===========================================================*/
1111
1112
1113static void start_cleanup_timer (struct sock *sk)
1114{
1115 del_timer(&sk->sk_timer);
1116 sk->sk_timer.data = (unsigned long)sk;
1117 sk->sk_timer.expires = jiffies + HZ;
1118 sk->sk_timer.function = wanpipe_kill_sock_timer;
1119 add_timer(&sk->sk_timer);
1120}
1121
1122
1123/*============================================================
1124 * wanpipe_kill_sock
1125 *
1126 * This is a function which performs actual killing
1127 * of the sock. It releases socket resources,
1128 * and unlinks the sock from the driver.
1129 *===========================================================*/
1130
1131static void wanpipe_kill_sock_timer (unsigned long data)
1132{
1133
1134 struct sock *sk = (struct sock *)data;
1135 struct sock **skp;
1136
1137 if (!sk)
1138 return;
1139
1140 /* This function can be called from interrupt. We must use
1141 * appropriate locks */
1142
1143 if (test_bit(1,&wanpipe_tx_critical)){
1144 sk->sk_timer.expires = jiffies + 10;
1145 add_timer(&sk->sk_timer);
1146 return;
1147 }
1148
1149 write_lock(&wanpipe_sklist_lock);
1150 sk_del_node_init(sk);
1151 write_unlock(&wanpipe_sklist_lock);
1152
1153
1154 if (wp_sk(sk)->num == htons(X25_PROT) &&
1155 sk->sk_state != WANSOCK_DISCONNECTED) {
1156 struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if);
1157 wanpipe_common_t *chan;
1158 if (dev){
1159 chan=dev->priv;
1160 atomic_set(&chan->disconnect,1);
1161 dev_put(dev);
1162 }
1163 }
1164
1165 release_driver(sk);
1166
1167 sk->sk_socket = NULL;
1168
1169 /* Purge queues */
1170 skb_queue_purge(&sk->sk_receive_queue);
1171 skb_queue_purge(&sk->sk_write_queue);
1172 skb_queue_purge(&sk->sk_error_queue);
1173
1174 if (atomic_read(&sk->sk_rmem_alloc) ||
1175 atomic_read(&sk->sk_wmem_alloc)) {
1176 del_timer(&sk->sk_timer);
1177 printk(KERN_INFO "wansock: Killing SOCK in Timer\n");
1178 sk->sk_timer.data = (unsigned long)sk;
1179 sk->sk_timer.expires = jiffies + HZ;
1180 sk->sk_timer.function = wanpipe_destroy_timer;
1181 add_timer(&sk->sk_timer);
1182 return;
1183 }
1184
1185 kfree(wp_sk(sk));
1186 wp_sk(sk) = NULL;
1187
1188 if (atomic_read(&sk->sk_refcnt) != 1) {
1189 atomic_set(&sk->sk_refcnt, 1);
1190 DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i ! :timer.\n",
1191 atomic_read(&sk->sk_refcnt));
1192 }
1193 sock_put(sk);
1194 atomic_dec(&wanpipe_socks_nr);
1195 return;
1196}
1197
1198static void wanpipe_kill_sock_accept (struct sock *sk)
1199{
1200
1201 struct sock **skp;
1202
1203 if (!sk)
1204 return;
1205
1206 /* This function can be called from interrupt. We must use
1207 * appropriate locks */
1208
1209 write_lock(&wanpipe_sklist_lock);
1210 sk_del_node_init(sk);
1211 write_unlock(&wanpipe_sklist_lock);
1212
1213 sk->sk_socket = NULL;
1214
1215
1216 kfree(wp_sk(sk));
1217 wp_sk(sk) = NULL;
1218
1219 if (atomic_read(&sk->sk_refcnt) != 1) {
1220 atomic_set(&sk->sk_refcnt, 1);
1221 DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i ! :timer.\n",
1222 atomic_read(&sk->sk_refcnt));
1223 }
1224 sock_put(sk);
1225 atomic_dec(&wanpipe_socks_nr);
1226 return;
1227}
1228
1229
1230static void wanpipe_kill_sock_irq (struct sock *sk)
1231{
1232
1233 if (!sk)
1234 return;
1235
1236 sk->sk_socket = NULL;
1237
1238 kfree(wp_sk(sk));
1239 wp_sk(sk) = NULL;
1240
1241 if (atomic_read(&sk->sk_refcnt) != 1) {
1242 atomic_set(&sk->sk_refcnt, 1);
1243 DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i !:listen.\n",
1244 atomic_read(&sk->sk_refcnt));
1245 }
1246 sock_put(sk);
1247 atomic_dec(&wanpipe_socks_nr);
1248}
1249
1250
1251/*============================================================
1252 * wanpipe_do_bind
1253 *
1254 * Bottom half of the binding system call.
1255 * Once the wanpipe_bind() function checks the
1256 * legality of the call, this function binds the
1257 * sock to the driver.
1258 *===========================================================*/
1259
1260static int wanpipe_do_bind(struct sock *sk, struct net_device *dev,
1261 int protocol)
1262{
1263 wanpipe_opt *wp = wp_sk(sk);
1264 wanpipe_common_t *chan=NULL;
1265 int err=0;
1266
1267 if (sock_flag(sk, SOCK_ZAPPED)) {
1268 err = -EALREADY;
1269 goto bind_unlock_exit;
1270 }
1271
1272 wp->num = protocol;
1273
1274 if (protocol == 0){
1275 release_device(dev);
1276 err = -EINVAL;
1277 goto bind_unlock_exit;
1278 }
1279
1280 if (dev) {
1281 if (dev->flags&IFF_UP) {
1282 chan=dev->priv;
1283 sk->sk_state = chan->state;
1284
1285 if (wp->num == htons(X25_PROT) &&
1286 sk->sk_state != WANSOCK_DISCONNECTED &&
1287 sk->sk_state != WANSOCK_CONNECTING) {
1288 DBG_PRINTK(KERN_INFO
1289 "wansock: Binding to Device not DISCONNECTED %i\n",
1290 sk->sk_state);
1291 release_device(dev);
1292 err = -EAGAIN;
1293 goto bind_unlock_exit;
1294 }
1295
1296 wanpipe_link_driver(dev,sk);
1297 sk->sk_bound_dev_if = dev->ifindex;
1298
1299 /* X25 Specific option */
1300 if (wp->num == htons(X25_PROT))
1301 wp_sk(sk)->svc = chan->svc;
1302
1303 } else {
1304 sk->sk_err = ENETDOWN;
1305 sk->sk_error_report(sk);
1306 release_device(dev);
1307 err = -EINVAL;
1308 }
1309 } else {
1310 err = -ENODEV;
1311 }
1312bind_unlock_exit:
1313 /* FIXME where is this lock */
1314
1315 return err;
1316}
1317
1318/*============================================================
1319 * wanpipe_bind
1320 *
1321 * BIND() System call, which is bound to the AF_WANPIPE
1322 * operations structure. It checks for correct wanpipe
1323 * card name, and cross references interface names with
1324 * the card names. Thus, interface name must belong to
1325 * the actual card.
1326 *===========================================================*/
1327
1328
1329static int wanpipe_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
1330{
1331 struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)uaddr;
1332 struct sock *sk=sock->sk;
1333 wanpipe_opt *wp = wp_sk(sk);
1334 struct net_device *dev = NULL;
1335 sdla_t *card=NULL;
1336 char name[15];
1337
1338 /*
1339 * Check legality
1340 */
1341
1342 if (addr_len < sizeof(struct wan_sockaddr_ll)){
1343 printk(KERN_INFO "wansock: Address length error\n");
1344 return -EINVAL;
1345 }
1346 if (sll->sll_family != AF_WANPIPE){
1347 printk(KERN_INFO "wansock: Illegal family name specified.\n");
1348 return -EINVAL;
1349 }
1350
1351 card = wanpipe_find_card (sll->sll_card);
1352 if (!card){
1353 printk(KERN_INFO "wansock: Wanpipe card not found: %s\n",sll->sll_card);
1354 return -ENODEV;
1355 }else{
1356 wp_sk(sk)->card = (void *)card;
1357 }
1358
1359 if (!strcmp(sll->sll_device,"svc_listen")){
1360
1361 /* Bind a sock to a card structure for listening
1362 */
1363 int err=0;
1364
1365 /* This is x25 specific area if protocol doesn't
1366 * match, return error */
1367 if (sll->sll_protocol != htons(X25_PROT))
1368 return -EINVAL;
1369
1370 err= wanpipe_link_card (sk);
1371 if (err < 0)
1372 return err;
1373
1374 if (sll->sll_protocol)
1375 wp->num = sll->sll_protocol;
1376 sk->sk_state = WANSOCK_BIND_LISTEN;
1377 return 0;
1378
1379 }else if (!strcmp(sll->sll_device,"svc_connect")){
1380
1381 /* This is x25 specific area if protocol doesn't
1382 * match, return error */
1383 if (sll->sll_protocol != htons(X25_PROT))
1384 return -EINVAL;
1385
1386 /* Find a free device
1387 */
1388 dev = wanpipe_find_free_dev(card);
1389 if (dev == NULL){
1390 DBG_PRINTK(KERN_INFO "wansock: No free network devices for card %s\n",
1391 card->devname);
1392 return -EINVAL;
1393 }
1394 }else{
1395 /* Bind a socket to a interface name
1396 * This is used by PVC mostly
1397 */
1398 strlcpy(name,sll->sll_device,sizeof(name));
1399 dev = dev_get_by_name(name);
1400 if (dev == NULL){
1401 printk(KERN_INFO "wansock: Failed to get Dev from name: %s,\n",
1402 name);
1403 return -ENODEV;
1404 }
1405
1406 dev_put(dev);
1407
1408 if (check_dev(dev, card)){
1409 printk(KERN_INFO "wansock: Device %s, doesn't belong to card %s\n",
1410 dev->name, card->devname);
1411 return -EINVAL;
1412 }
1413 if (get_atomic_device (dev))
1414 return -EINVAL;
1415 }
1416
1417 return wanpipe_do_bind(sk, dev, sll->sll_protocol ? : wp->num);
1418}
1419
1420/*============================================================
1421 * get_atomic_device
1422 *
1423 * Sets a bit atomically which indicates that
1424 * the interface is taken. This avoids race conditions.
1425 *===========================================================*/
1426
1427
1428static inline int get_atomic_device(struct net_device *dev)
1429{
1430 wanpipe_common_t *chan = dev->priv;
1431 if (!test_and_set_bit(0,(void *)&chan->rw_bind)){
1432 return 0;
1433 }
1434 return 1;
1435}
1436
1437/*============================================================
1438 * check_dev
1439 *
1440 * Check that device name belongs to a particular card.
1441 *===========================================================*/
1442
1443static int check_dev(struct net_device *dev, sdla_t *card)
1444{
1445 struct net_device* tmp_dev;
1446
1447 for (tmp_dev = card->wandev.dev; tmp_dev;
1448 tmp_dev = *((struct net_device **)tmp_dev->priv)) {
1449 if (tmp_dev->ifindex == dev->ifindex){
1450 return 0;
1451 }
1452 }
1453 return 1;
1454}
1455
1456/*============================================================
1457 * wanpipe_find_free_dev
1458 *
1459 * Find a free network interface. If found set atomic
1460 * bit indicating that the interface is taken.
1461 * X25API Specific.
1462 *===========================================================*/
1463
1464struct net_device *wanpipe_find_free_dev(sdla_t *card)
1465{
1466 struct net_device* dev;
1467 volatile wanpipe_common_t *chan;
1468
1469 if (test_and_set_bit(0,&find_free_critical)){
1470 printk(KERN_INFO "CRITICAL in Find Free\n");
1471 }
1472
1473 for (dev = card->wandev.dev; dev;
1474 dev = *((struct net_device **)dev->priv)) {
1475 chan = dev->priv;
1476 if (!chan)
1477 continue;
1478 if (chan->usedby == API && chan->svc){
1479 if (!get_atomic_device (dev)){
1480 if (chan->state != WANSOCK_DISCONNECTED){
1481 release_device(dev);
1482 }else{
1483 clear_bit(0,&find_free_critical);
1484 return dev;
1485 }
1486 }
1487 }
1488 }
1489 clear_bit(0,&find_free_critical);
1490 return NULL;
1491}
1492
1493/*============================================================
1494 * wanpipe_create
1495 *
1496 * SOCKET() System call. It allocates a sock structure
1497 * and adds the socket to the wanpipe_sk_list.
1498 * Crates AF_WANPIPE socket.
1499 *===========================================================*/
1500
1501static int wanpipe_create(struct socket *sock, int protocol)
1502{
1503 struct sock *sk;
1504
1505 //FIXME: This checks for root user, SECURITY ?
1506 //if (!capable(CAP_NET_RAW))
1507 // return -EPERM;
1508
1509 if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW)
1510 return -ESOCKTNOSUPPORT;
1511
1512 sock->state = SS_UNCONNECTED;
1513
1514 if ((sk = wanpipe_alloc_socket()) == NULL)
1515 return -ENOBUFS;
1516
1517 sk->sk_reuse = 1;
1518 sock->ops = &wanpipe_ops;
1519 sock_init_data(sock,sk);
1520
1521 sock_reset_flag(sk, SOCK_ZAPPED);
1522 sk->sk_family = PF_WANPIPE;
1523 wp_sk(sk)->num = protocol;
1524 sk->sk_state = WANSOCK_DISCONNECTED;
1525 sk->sk_ack_backlog = 0;
1526 sk->sk_bound_dev_if = 0;
1527
1528 atomic_inc(&wanpipe_socks_nr);
1529
1530 /* We must disable interrupts because the ISR
1531 * can also change the list */
1532 set_bit(1,&wanpipe_tx_critical);
1533 write_lock(&wanpipe_sklist_lock);
1534 sk_add_node(sk, &wanpipe_sklist);
1535 write_unlock(&wanpipe_sklist_lock);
1536 clear_bit(1,&wanpipe_tx_critical);
1537
1538 return(0);
1539}
1540
1541
1542/*============================================================
1543 * wanpipe_recvmsg
1544 *
1545 * Pull a packet from our receive queue and hand it
1546 * to the user. If necessary we block.
1547 *===========================================================*/
1548
1549static int wanpipe_recvmsg(struct kiocb *iocb, struct socket *sock,
1550 struct msghdr *msg, int len, int flags)
1551{
1552 struct sock *sk = sock->sk;
1553 struct sk_buff *skb;
1554 int copied, err=-ENOBUFS;
1555
1556
1557 /*
1558 * If the address length field is there to be filled in, we fill
1559 * it in now.
1560 */
1561
1562 msg->msg_namelen = sizeof(struct wan_sockaddr_ll);
1563
1564 /*
1565 * Call the generic datagram receiver. This handles all sorts
1566 * of horrible races and re-entrancy so we can forget about it
1567 * in the protocol layers.
1568 *
1569 * Now it will return ENETDOWN, if device have just gone down,
1570 * but then it will block.
1571 */
1572
1573 if (flags & MSG_OOB){
1574 skb = skb_dequeue(&sk->sk_error_queue);
1575 }else{
1576 skb=skb_recv_datagram(sk,flags,1,&err);
1577 }
1578 /*
1579 * An error occurred so return it. Because skb_recv_datagram()
1580 * handles the blocking we don't see and worry about blocking
1581 * retries.
1582 */
1583
1584 if(skb==NULL)
1585 goto out;
1586
1587 /*
1588 * You lose any data beyond the buffer you gave. If it worries a
1589 * user program they can ask the device for its MTU anyway.
1590 */
1591
1592 copied = skb->len;
1593 if (copied > len)
1594 {
1595 copied=len;
1596 msg->msg_flags|=MSG_TRUNC;
1597 }
1598
1599 wanpipe_wakeup_driver(sk);
1600
1601 /* We can't use skb_copy_datagram here */
1602 err = memcpy_toiovec(msg->msg_iov, skb->data, copied);
1603 if (err)
1604 goto out_free;
1605
1606 sock_recv_timestamp(msg, sk, skb);
1607
1608 if (msg->msg_name)
1609 memcpy(msg->msg_name, skb->cb, msg->msg_namelen);
1610
1611 /*
1612 * Free or return the buffer as appropriate. Again this
1613 * hides all the races and re-entrancy issues from us.
1614 */
1615 err = (flags&MSG_TRUNC) ? skb->len : copied;
1616
1617out_free:
1618 skb_free_datagram(sk, skb);
1619out:
1620 return err;
1621}
1622
1623
1624/*============================================================
1625 * wanpipe_wakeup_driver
1626 *
1627 * If socket receive buffer is full and driver cannot
1628 * pass data up the sock, it sets a packet_block flag.
1629 * This function check that flag and if sock receive
1630 * queue has room it kicks the driver BH handler.
1631 *
1632 * This way, driver doesn't have to poll the sock
1633 * receive queue.
1634 *===========================================================*/
1635
1636static void wanpipe_wakeup_driver(struct sock *sk)
1637{
1638 struct net_device *dev = NULL;
1639 wanpipe_common_t *chan=NULL;
1640
1641 dev = dev_get_by_index(sk->sk_bound_dev_if);
1642 if (!dev)
1643 return;
1644
1645 dev_put(dev);
1646
1647 if ((chan = dev->priv) == NULL)
1648 return;
1649
1650 if (atomic_read(&chan->receive_block)){
1651 if (atomic_read(&sk->sk_rmem_alloc) <
1652 ((unsigned)sk->sk_rcvbuf * 0.9)) {
1653 printk(KERN_INFO "wansock: Queuing task for wanpipe\n");
1654 atomic_set(&chan->receive_block,0);
1655 wanpipe_queue_tq(&chan->wanpipe_task);
1656 wanpipe_mark_bh();
1657 }
1658 }
1659}
1660
1661/*============================================================
1662 * wanpipe_getname
1663 *
1664 * I don't know what to do with this yet.
1665 * User can use this function to get sock address
1666 * information. Not very useful for Sangoma's purposes.
1667 *===========================================================*/
1668
1669
1670static int wanpipe_getname(struct socket *sock, struct sockaddr *uaddr,
1671 int *uaddr_len, int peer)
1672{
1673 struct net_device *dev;
1674 struct sock *sk = sock->sk;
1675 struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)uaddr;
1676
1677 sll->sll_family = AF_WANPIPE;
1678 sll->sll_ifindex = sk->sk_bound_dev_if;
1679 sll->sll_protocol = wp_sk(sk)->num;
1680 dev = dev_get_by_index(sk->sk_bound_dev_if);
1681 if (dev) {
1682 sll->sll_hatype = dev->type;
1683 sll->sll_halen = dev->addr_len;
1684 memcpy(sll->sll_addr, dev->dev_addr, dev->addr_len);
1685 } else {
1686 sll->sll_hatype = 0; /* Bad: we have no ARPHRD_UNSPEC */
1687 sll->sll_halen = 0;
1688 }
1689 *uaddr_len = sizeof(*sll);
1690
1691 dev_put(dev);
1692
1693 return 0;
1694}
1695
1696/*============================================================
1697 * wanpipe_notifier
1698 *
1699 * If driver turns off network interface, this function
1700 * will be envoked. Currently I treate it as a
1701 * call disconnect. More thought should go into this
1702 * function.
1703 *
1704 * FIXME: More thought should go into this function.
1705 *
1706 *===========================================================*/
1707
1708static int wanpipe_notifier(struct notifier_block *this, unsigned long msg, void *data)
1709{
1710 struct sock *sk;
1711 hlist_node *node;
1712 struct net_device *dev = (struct net_device *)data;
1713
1714 sk_for_each(sk, node, &wanpipe_sklist) {
1715 struct wanpipe_opt *po = wp_sk(sk);
1716
1717 if (!po)
1718 continue;
1719 if (dev == NULL)
1720 continue;
1721
1722 switch (msg) {
1723 case NETDEV_DOWN:
1724 case NETDEV_UNREGISTER:
1725 if (dev->ifindex == sk->sk_bound_dev_if) {
1726 printk(KERN_INFO "wansock: Device down %s\n",dev->name);
1727 if (sock_flag(sk, SOCK_ZAPPED)) {
1728 wanpipe_unlink_driver(sk);
1729 sk->sk_err = ENETDOWN;
1730 sk->sk_error_report(sk);
1731 }
1732
1733 if (msg == NETDEV_UNREGISTER) {
1734 printk(KERN_INFO "wansock: Unregistering Device: %s\n",
1735 dev->name);
1736 wanpipe_unlink_driver(sk);
1737 sk->sk_bound_dev_if = 0;
1738 }
1739 }
1740 break;
1741 case NETDEV_UP:
1742 if (dev->ifindex == sk->sk_bound_dev_if &&
1743 po->num && !sock_flag(sk, SOCK_ZAPPED)) {
1744 printk(KERN_INFO "wansock: Registering Device: %s\n",
1745 dev->name);
1746 wanpipe_link_driver(dev,sk);
1747 }
1748 break;
1749 }
1750 }
1751 return NOTIFY_DONE;
1752}
1753
1754/*============================================================
1755 * wanpipe_ioctl
1756 *
1757 * Execute a user commands, and set socket options.
1758 *
1759 * FIXME: More thought should go into this function.
1760 *
1761 *===========================================================*/
1762
1763static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1764{
1765 struct sock *sk = sock->sk;
1766 int err;
1767
1768 switch(cmd)
1769 {
1770 case SIOCGSTAMP:
1771 return sock_get_timestamp(sk, (struct timeval __user *)arg);
1772
1773 case SIOC_WANPIPE_CHECK_TX:
1774
1775 return atomic_read(&sk->sk_wmem_alloc);
1776
1777 case SIOC_WANPIPE_SOCK_STATE:
1778
1779 if (sk->sk_state == WANSOCK_CONNECTED)
1780 return 0;
1781
1782 return 1;
1783
1784
1785 case SIOC_WANPIPE_GET_CALL_DATA:
1786
1787 return get_ioctl_cmd (sk,(void*)arg);
1788
1789 case SIOC_WANPIPE_SET_CALL_DATA:
1790
1791 return set_ioctl_cmd (sk,(void*)arg);
1792
1793 case SIOC_WANPIPE_ACCEPT_CALL:
1794 case SIOC_WANPIPE_CLEAR_CALL:
1795 case SIOC_WANPIPE_RESET_CALL:
1796
1797 if ((err=set_ioctl_cmd(sk,(void*)arg)) < 0)
1798 return err;
1799
1800 err=wanpipe_exec_cmd(sk,cmd,0);
1801 get_ioctl_cmd(sk,(void*)arg);
1802 return err;
1803
1804 case SIOC_WANPIPE_DEBUG:
1805
1806 return wanpipe_debug(sk,(void*)arg);
1807
1808 case SIOC_WANPIPE_SET_NONBLOCK:
1809
1810 if (sk->sk_state != WANSOCK_DISCONNECTED)
1811 return -EINVAL;
1812
1813 sock->file->f_flags |= O_NONBLOCK;
1814 return 0;
1815
1816#ifdef CONFIG_INET
1817 case SIOCADDRT:
1818 case SIOCDELRT:
1819 case SIOCDARP:
1820 case SIOCGARP:
1821 case SIOCSARP:
1822 case SIOCDRARP:
1823 case SIOCGRARP:
1824 case SIOCSRARP:
1825 case SIOCGIFADDR:
1826 case SIOCSIFADDR:
1827 case SIOCGIFBRDADDR:
1828 case SIOCSIFBRDADDR:
1829 case SIOCGIFNETMASK:
1830 case SIOCSIFNETMASK:
1831 case SIOCGIFDSTADDR:
1832 case SIOCSIFDSTADDR:
1833 case SIOCSIFFLAGS:
1834 return inet_dgram_ops.ioctl(sock, cmd, arg);
1835#endif
1836
1837 default:
1838 return -ENOIOCTLCMD;
1839 }
1840 /*NOTREACHED*/
1841}
1842
1843/*============================================================
1844 * wanpipe_debug
1845 *
1846 * This function will pass up information about all
1847 * active sockets.
1848 *
1849 * FIXME: More thought should go into this function.
1850 *
1851 *===========================================================*/
1852
1853static int wanpipe_debug (struct sock *origsk, void *arg)
1854{
1855 struct sock *sk;
1856 struct hlist_node *node;
1857 struct net_device *dev = NULL;
1858 wanpipe_common_t *chan=NULL;
1859 int cnt=0, err=0;
1860 wan_debug_t *dbg_data = (wan_debug_t *)arg;
1861
1862 sk_for_each(sk, node, &wanpipe_sklist) {
1863 wanpipe_opt *wp = wp_sk(sk);
1864
1865 if (sk == origsk){
1866 continue;
1867 }
1868
1869 if ((err=put_user(1, &dbg_data->debug[cnt].free)))
1870 return err;
1871 if ((err = put_user(sk->sk_state,
1872 &dbg_data->debug[cnt].state_sk)))
1873 return err;
1874 if ((err = put_user(sk->sk_rcvbuf,
1875 &dbg_data->debug[cnt].rcvbuf)))
1876 return err;
1877 if ((err = put_user(atomic_read(&sk->sk_rmem_alloc),
1878 &dbg_data->debug[cnt].rmem)))
1879 return err;
1880 if ((err = put_user(atomic_read(&sk->sk_wmem_alloc),
1881 &dbg_data->debug[cnt].wmem)))
1882 return err;
1883 if ((err = put_user(sk->sk_sndbuf,
1884 &dbg_data->debug[cnt].sndbuf)))
1885 return err;
1886 if ((err=put_user(sk_count, &dbg_data->debug[cnt].sk_count)))
1887 return err;
1888 if ((err=put_user(wp->poll_cnt, &dbg_data->debug[cnt].poll_cnt)))
1889 return err;
1890 if ((err = put_user(sk->sk_bound_dev_if,
1891 &dbg_data->debug[cnt].bound)))
1892 return err;
1893
1894 if (sk->sk_bound_dev_if) {
1895 dev = dev_get_by_index(sk->sk_bound_dev_if);
1896 if (!dev)
1897 continue;
1898
1899 chan=dev->priv;
1900 dev_put(dev);
1901
1902 if ((err=put_user(chan->state, &dbg_data->debug[cnt].d_state)))
1903 return err;
1904 if ((err=put_user(chan->svc, &dbg_data->debug[cnt].svc)))
1905 return err;
1906
1907 if ((err=put_user(atomic_read(&chan->command),
1908 &dbg_data->debug[cnt].command)))
1909 return err;
1910
1911
1912 if (wp){
1913 sdla_t *card = (sdla_t*)wp->card;
1914
1915 if (card){
1916 if ((err=put_user(atomic_read(&card->u.x.command_busy),
1917 &dbg_data->debug[cnt].cmd_busy)))
1918 return err;
1919 }
1920
1921 if ((err=put_user(wp->lcn,
1922 &dbg_data->debug[cnt].lcn)))
1923 return err;
1924
1925 if (wp->mbox) {
1926 if ((err=put_user(1, &dbg_data->debug[cnt].mbox)))
1927 return err;
1928 }
1929 }
1930
1931 if ((err=put_user(atomic_read(&chan->receive_block),
1932 &dbg_data->debug[cnt].rblock)))
1933 return err;
1934
1935 if (copy_to_user(dbg_data->debug[cnt].name, dev->name, strlen(dev->name)))
1936 return -EFAULT;
1937 }
1938
1939 if (++cnt == MAX_NUM_DEBUG)
1940 break;
1941 }
1942 return 0;
1943}
1944
1945/*============================================================
1946 * get_ioctl_cmd
1947 *
1948 * Pass up the contents of socket MBOX to the user.
1949 *===========================================================*/
1950
1951static int get_ioctl_cmd (struct sock *sk, void *arg)
1952{
1953 x25api_t *usr_data = (x25api_t *)arg;
1954 mbox_cmd_t *mbox_ptr;
1955 int err;
1956
1957 if (usr_data == NULL)
1958 return -EINVAL;
1959
1960 if (!wp_sk(sk)->mbox) {
1961 return -EINVAL;
1962 }
1963
1964 mbox_ptr = (mbox_cmd_t *)wp_sk(sk)->mbox;
1965
1966 if ((err=put_user(mbox_ptr->cmd.qdm, &usr_data->hdr.qdm)))
1967 return err;
1968 if ((err=put_user(mbox_ptr->cmd.cause, &usr_data->hdr.cause)))
1969 return err;
1970 if ((err=put_user(mbox_ptr->cmd.diagn, &usr_data->hdr.diagn)))
1971 return err;
1972 if ((err=put_user(mbox_ptr->cmd.length, &usr_data->hdr.length)))
1973 return err;
1974 if ((err=put_user(mbox_ptr->cmd.result, &usr_data->hdr.result)))
1975 return err;
1976 if ((err=put_user(mbox_ptr->cmd.lcn, &usr_data->hdr.lcn)))
1977 return err;
1978
1979 if (mbox_ptr->cmd.length > 0){
1980 if (mbox_ptr->cmd.length > X25_MAX_DATA)
1981 return -EINVAL;
1982
1983 if (copy_to_user(usr_data->data, mbox_ptr->data, mbox_ptr->cmd.length)){
1984 printk(KERN_INFO "wansock: Copy failed !!!\n");
1985 return -EFAULT;
1986 }
1987 }
1988 return 0;
1989}
1990
1991/*============================================================
1992 * set_ioctl_cmd
1993 *
1994 * Before command can be execute, socket MBOX must
1995 * be created, and initialized with user data.
1996 *===========================================================*/
1997
1998static int set_ioctl_cmd (struct sock *sk, void *arg)
1999{
2000 x25api_t *usr_data = (x25api_t *)arg;
2001 mbox_cmd_t *mbox_ptr;
2002 int err;
2003
2004 if (!wp_sk(sk)->mbox) {
2005 void *mbox_ptr;
2006 struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if);
2007 if (!dev)
2008 return -ENODEV;
2009
2010 dev_put(dev);
2011
2012 if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL)
2013 return -ENOMEM;
2014
2015 wp_sk(sk)->mbox = mbox_ptr;
2016
2017 wanpipe_link_driver(dev,sk);
2018 }
2019
2020 mbox_ptr = (mbox_cmd_t*)wp_sk(sk)->mbox;
2021 memset(mbox_ptr, 0, sizeof(mbox_cmd_t));
2022
2023 if (usr_data == NULL){
2024 return 0;
2025 }
2026 if ((err=get_user(mbox_ptr->cmd.qdm, &usr_data->hdr.qdm)))
2027 return err;
2028 if ((err=get_user(mbox_ptr->cmd.cause, &usr_data->hdr.cause)))
2029 return err;
2030 if ((err=get_user(mbox_ptr->cmd.diagn, &usr_data->hdr.diagn)))
2031 return err;
2032 if ((err=get_user(mbox_ptr->cmd.length, &usr_data->hdr.length)))
2033 return err;
2034 if ((err=get_user(mbox_ptr->cmd.result, &usr_data->hdr.result)))
2035 return err;
2036
2037 if (mbox_ptr->cmd.length > 0){
2038 if (mbox_ptr->cmd.length > X25_MAX_DATA)
2039 return -EINVAL;
2040
2041 if (copy_from_user(mbox_ptr->data, usr_data->data, mbox_ptr->cmd.length)){
2042 printk(KERN_INFO "Copy failed\n");
2043 return -EFAULT;
2044 }
2045 }
2046 return 0;
2047}
2048
2049
2050/*======================================================================
2051 * wanpipe_poll
2052 *
2053 * Datagram poll: Again totally generic. This also handles
2054 * sequenced packet sockets providing the socket receive queue
2055 * is only ever holding data ready to receive.
2056 *
2057 * Note: when you _don't_ use this routine for this protocol,
2058 * and you use a different write policy from sock_writeable()
2059 * then please supply your own write_space callback.
2060 *=====================================================================*/
2061
2062unsigned int wanpipe_poll(struct file * file, struct socket *sock, poll_table *wait)
2063{
2064 struct sock *sk = sock->sk;
2065 unsigned int mask;
2066
2067 ++wp_sk(sk)->poll_cnt;
2068
2069 poll_wait(file, sk->sk_sleep, wait);
2070 mask = 0;
2071
2072 /* exceptional events? */
2073 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) {
2074 mask |= POLLPRI;
2075 return mask;
2076 }
2077 if (sk->sk_shutdown & RCV_SHUTDOWN)
2078 mask |= POLLHUP;
2079
2080 /* readable? */
2081 if (!skb_queue_empty(&sk->sk_receive_queue)) {
2082 mask |= POLLIN | POLLRDNORM;
2083 }
2084
2085 /* connection hasn't started yet */
2086 if (sk->sk_state == WANSOCK_CONNECTING) {
2087 return mask;
2088 }
2089
2090 if (sk->sk_state == WANSOCK_DISCONNECTED) {
2091 mask = POLLPRI;
2092 return mask;
2093 }
2094
2095 /* This check blocks the user process if there is
2096 * a packet already queued in the socket write queue.
2097 * This option is only for X25API protocol, for other
2098 * protocol like chdlc enable streaming mode,
2099 * where multiple packets can be pending in the socket
2100 * transmit queue */
2101
2102 if (wp_sk(sk)->num == htons(X25_PROT)) {
2103 if (atomic_read(&wp_sk(sk)->packet_sent))
2104 return mask;
2105 }
2106
2107 /* writable? */
2108 if (sock_writeable(sk)){
2109 mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
2110 }else{
2111 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
2112 }
2113
2114 return mask;
2115}
2116
2117/*======================================================================
2118 * wanpipe_listen
2119 *
2120 * X25API Specific function. Set a socket into LISTENING MODE.
2121 *=====================================================================*/
2122
2123
2124static int wanpipe_listen(struct socket *sock, int backlog)
2125{
2126 struct sock *sk = sock->sk;
2127
2128 /* This is x25 specific area if protocol doesn't
2129 * match, return error */
2130 if (wp_sk(sk)->num != htons(X25_PROT))
2131 return -EINVAL;
2132
2133 if (sk->sk_state == WANSOCK_BIND_LISTEN) {
2134
2135 sk->sk_max_ack_backlog = backlog;
2136 sk->sk_state = WANSOCK_LISTEN;
2137 return 0;
2138 }else{
2139 printk(KERN_INFO "wansock: Listening sock was not binded\n");
2140 }
2141
2142 return -EINVAL;
2143}
2144
2145/*======================================================================
2146 * wanpipe_link_card
2147 *
2148 * Connects the listening socket to the driver
2149 *=====================================================================*/
2150
2151static int wanpipe_link_card (struct sock *sk)
2152{
2153 sdla_t *card = (sdla_t*)wp_sk(sk)->card;
2154
2155 if (!card)
2156 return -ENOMEM;
2157
2158 if ((card->sk != NULL) || (card->func != NULL)){
2159 printk(KERN_INFO "wansock: Listening queue is already established\n");
2160 return -EINVAL;
2161 }
2162
2163 card->sk=sk;
2164 card->func=wanpipe_listen_rcv;
2165 sock_set_flag(sk, SOCK_ZAPPED);
2166
2167 return 0;
2168}
2169
2170/*======================================================================
2171 * wanpipe_listen
2172 *
2173 * X25API Specific function. Disconnect listening socket from
2174 * the driver.
2175 *=====================================================================*/
2176
2177static void wanpipe_unlink_card (struct sock *sk)
2178{
2179 sdla_t *card = (sdla_t*)wp_sk(sk)->card;
2180
2181 if (card){
2182 card->sk=NULL;
2183 card->func=NULL;
2184 }
2185}
2186
2187/*======================================================================
2188 * wanpipe_exec_cmd
2189 *
2190 * Ioctl function calls this function to execute user command.
2191 * Connect() sytem call also calls this function to execute
2192 * place call. This function blocks until command is executed.
2193 *=====================================================================*/
2194
2195static int wanpipe_exec_cmd(struct sock *sk, int cmd, unsigned int flags)
2196{
2197 int err = -EINVAL;
2198 wanpipe_opt *wp = wp_sk(sk);
2199 mbox_cmd_t *mbox_ptr = (mbox_cmd_t*)wp->mbox;
2200
2201 if (!mbox_ptr){
2202 printk(KERN_INFO "NO MBOX PTR !!!!!\n");
2203 return -EINVAL;
2204 }
2205
2206 /* This is x25 specific area if protocol doesn't
2207 * match, return error */
2208 if (wp->num != htons(X25_PROT))
2209 return -EINVAL;
2210
2211
2212 switch (cmd){
2213
2214 case SIOC_WANPIPE_ACCEPT_CALL:
2215
2216 if (sk->sk_state != WANSOCK_CONNECTING) {
2217 err = -EHOSTDOWN;
2218 break;
2219 }
2220
2221 err = execute_command(sk,X25_ACCEPT_CALL,0);
2222 if (err < 0)
2223 break;
2224
2225 /* Update. Mar6 2000.
2226 * Do not set the sock lcn number here, since
2227 * it is done in wanpipe_listen_rcv().
2228 */
2229 if (sk->sk_state == WANSOCK_CONNECTED) {
2230 wp->lcn = ((mbox_cmd_t*)wp->mbox)->cmd.lcn;
2231 DBG_PRINTK(KERN_INFO "\nwansock: Accept OK %i\n",
2232 wp->lcn);
2233 err = 0;
2234
2235 }else{
2236 DBG_PRINTK (KERN_INFO "\nwansock: Accept Failed %i\n",
2237 wp->lcn);
2238 wp->lcn = 0;
2239 err = -ECONNREFUSED;
2240 }
2241 break;
2242
2243 case SIOC_WANPIPE_CLEAR_CALL:
2244
2245 if (sk->sk_state == WANSOCK_DISCONNECTED) {
2246 err = -EINVAL;
2247 break;
2248 }
2249
2250
2251 /* Check if data buffers are pending for transmission,
2252 * if so, check whether user wants to wait until data
2253 * is transmitted, or clear a call and drop packets */
2254
2255 if (atomic_read(&sk->sk_wmem_alloc) ||
2256 check_driver_busy(sk)) {
2257 mbox_cmd_t *mbox = wp->mbox;
2258 if (mbox->cmd.qdm & 0x80){
2259 mbox->cmd.result = 0x35;
2260 err = -EAGAIN;
2261 break;
2262 }
2263 }
2264
2265 sk->sk_state = WANSOCK_DISCONNECTING;
2266
2267 err = execute_command(sk,X25_CLEAR_CALL,0);
2268 if (err < 0)
2269 break;
2270
2271 err = -ECONNREFUSED;
2272 if (sk->sk_state == WANSOCK_DISCONNECTED) {
2273 DBG_PRINTK(KERN_INFO "\nwansock: CLEAR OK %i\n",
2274 wp->lcn);
2275 wp->lcn = 0;
2276 err = 0;
2277 }
2278 break;
2279
2280 case SIOC_WANPIPE_RESET_CALL:
2281
2282 if (sk->sk_state != WANSOCK_CONNECTED) {
2283 err = -EINVAL;
2284 break;
2285 }
2286
2287
2288 /* Check if data buffers are pending for transmission,
2289 * if so, check whether user wants to wait until data
2290 * is transmitted, or reset a call and drop packets */
2291
2292 if (atomic_read(&sk->sk_wmem_alloc) ||
2293 check_driver_busy(sk)) {
2294 mbox_cmd_t *mbox = wp->mbox;
2295 if (mbox->cmd.qdm & 0x80){
2296 mbox->cmd.result = 0x35;
2297 err = -EAGAIN;
2298 break;
2299 }
2300 }
2301
2302
2303 err = execute_command(sk, X25_RESET,0);
2304 if (err < 0)
2305 break;
2306
2307 err = mbox_ptr->cmd.result;
2308 break;
2309
2310
2311 case X25_PLACE_CALL:
2312
2313 err=execute_command(sk,X25_PLACE_CALL,flags);
2314 if (err < 0)
2315 break;
2316
2317 if (sk->sk_state == WANSOCK_CONNECTED) {
2318
2319 wp->lcn = ((mbox_cmd_t*)wp->mbox)->cmd.lcn;
2320
2321 DBG_PRINTK(KERN_INFO "\nwansock: PLACE CALL OK %i\n",
2322 wp->lcn);
2323 err = 0;
2324
2325 } else if (sk->sk_state == WANSOCK_CONNECTING &&
2326 (flags & O_NONBLOCK)) {
2327 wp->lcn = ((mbox_cmd_t*)wp->mbox)->cmd.lcn;
2328 DBG_PRINTK(KERN_INFO "\nwansock: Place Call OK: Waiting %i\n",
2329 wp->lcn);
2330
2331 err = 0;
2332
2333 }else{
2334 DBG_PRINTK(KERN_INFO "\nwansock: Place call Failed\n");
2335 err = -ECONNREFUSED;
2336 }
2337
2338 break;
2339
2340 default:
2341 return -EINVAL;
2342 }
2343
2344 return err;
2345}
2346
2347static int check_driver_busy (struct sock *sk)
2348{
2349 struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if);
2350 wanpipe_common_t *chan;
2351
2352 if (!dev)
2353 return 0;
2354
2355 dev_put(dev);
2356
2357 if ((chan=dev->priv) == NULL)
2358 return 0;
2359
2360 return atomic_read(&chan->driver_busy);
2361}
2362
2363
2364/*======================================================================
2365 * wanpipe_accept
2366 *
2367 * ACCEPT() System call. X25API Specific function.
2368 * For each incoming call, create a new socket and
2369 * return it to the user.
2370 *=====================================================================*/
2371
2372static int wanpipe_accept(struct socket *sock, struct socket *newsock, int flags)
2373{
2374 struct sock *sk;
2375 struct sock *newsk;
2376 struct sk_buff *skb;
2377 DECLARE_WAITQUEUE(wait, current);
2378 int err=0;
2379
2380 if (newsock->sk != NULL){
2381 wanpipe_kill_sock_accept(newsock->sk);
2382 newsock->sk=NULL;
2383 }
2384
2385 if ((sk = sock->sk) == NULL)
2386 return -EINVAL;
2387
2388 if (sk->sk_type != SOCK_RAW)
2389 return -EOPNOTSUPP;
2390
2391 if (sk->sk_state != WANSOCK_LISTEN)
2392 return -EINVAL;
2393
2394 if (wp_sk(sk)->num != htons(X25_PROT))
2395 return -EINVAL;
2396
2397 add_wait_queue(sk->sk_sleep,&wait);
2398 current->state = TASK_INTERRUPTIBLE;
2399 for (;;){
2400 skb = skb_dequeue(&sk->sk_receive_queue);
2401 if (skb){
2402 err=0;
2403 break;
2404 }
2405 if (signal_pending(current)) {
2406 err = -ERESTARTSYS;
2407 break;
2408 }
2409 schedule();
2410 }
2411 current->state = TASK_RUNNING;
2412 remove_wait_queue(sk->sk_sleep,&wait);
2413
2414 if (err != 0)
2415 return err;
2416
2417 newsk = get_newsk_from_skb(skb);
2418 if (!newsk){
2419 return -EINVAL;
2420 }
2421
2422 set_bit(1,&wanpipe_tx_critical);
2423 write_lock(&wanpipe_sklist_lock);
2424 sk_add_node(newsk, &wanpipe_sklist);
2425 write_unlock(&wanpipe_sklist_lock);
2426 clear_bit(1,&wanpipe_tx_critical);
2427
2428 newsk->sk_socket = newsock;
2429 newsk->sk_sleep = &newsock->wait;
2430
2431 /* Now attach up the new socket */
2432 sk->sk_ack_backlog--;
2433 newsock->sk = newsk;
2434
2435 kfree_skb(skb);
2436
2437 DBG_PRINTK(KERN_INFO "\nwansock: ACCEPT Got LCN %i\n",
2438 wp_sk(newsk)->lcn);
2439 return 0;
2440}
2441
2442/*======================================================================
2443 * get_newsk_from_skb
2444 *
2445 * Accept() uses this function to get the address of the new
2446 * socket structure.
2447 *=====================================================================*/
2448
2449struct sock * get_newsk_from_skb (struct sk_buff *skb)
2450{
2451 struct net_device *dev = skb->dev;
2452 wanpipe_common_t *chan;
2453
2454 if (!dev){
2455 return NULL;
2456 }
2457
2458 if ((chan = dev->priv) == NULL){
2459 return NULL;
2460 }
2461
2462 if (!chan->sk){
2463 return NULL;
2464 }
2465 return (struct sock *)chan->sk;
2466}
2467
2468/*======================================================================
2469 * wanpipe_connect
2470 *
2471 * CONNECT() System Call. X25API specific function
2472 * Check the state of the sock, and execute PLACE_CALL command.
2473 * Connect can ether block or return without waiting for connection,
2474 * if specified by user.
2475 *=====================================================================*/
2476
2477static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags)
2478{
2479 struct sock *sk = sock->sk;
2480 struct wan_sockaddr_ll *addr = (struct wan_sockaddr_ll*)uaddr;
2481 struct net_device *dev;
2482 int err;
2483
2484 if (wp_sk(sk)->num != htons(X25_PROT))
2485 return -EINVAL;
2486
2487 if (sk->sk_state == WANSOCK_CONNECTED)
2488 return -EISCONN; /* No reconnect on a seqpacket socket */
2489
2490 if (sk->sk_state != WAN_DISCONNECTED) {
2491 printk(KERN_INFO "wansock: Trying to connect on channel NON DISCONNECT\n");
2492 return -ECONNREFUSED;
2493 }
2494
2495 sk->sk_state = WANSOCK_DISCONNECTED;
2496 sock->state = SS_UNCONNECTED;
2497
2498 if (addr_len != sizeof(struct wan_sockaddr_ll))
2499 return -EINVAL;
2500
2501 if (addr->sll_family != AF_WANPIPE)
2502 return -EINVAL;
2503
2504 if ((dev = dev_get_by_index(sk->sk_bound_dev_if)) == NULL)
2505 return -ENETUNREACH;
2506
2507 dev_put(dev);
2508
2509 if (!sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */
2510 return -EINVAL;
2511
2512 sock->state = SS_CONNECTING;
2513 sk->sk_state = WANSOCK_CONNECTING;
2514
2515 if (!wp_sk(sk)->mbox) {
2516 if (wp_sk (sk)->svc)
2517 return -EINVAL;
2518 else {
2519 int err;
2520 if ((err=set_ioctl_cmd(sk,NULL)) < 0)
2521 return err;
2522 }
2523 }
2524
2525 if ((err=wanpipe_exec_cmd(sk, X25_PLACE_CALL,flags)) != 0){
2526 sock->state = SS_UNCONNECTED;
2527 sk->sk_state = WANSOCK_CONNECTED;
2528 return err;
2529 }
2530
2531 if (sk->sk_state != WANSOCK_CONNECTED && (flags & O_NONBLOCK)) {
2532 return 0;
2533 }
2534
2535 if (sk->sk_state != WANSOCK_CONNECTED) {
2536 sock->state = SS_UNCONNECTED;
2537 return -ECONNREFUSED;
2538 }
2539
2540 sock->state = SS_CONNECTED;
2541 return 0;
2542}
2543
2544const struct proto_ops wanpipe_ops = {
2545 .family = PF_WANPIPE,
2546 .owner = THIS_MODULE,
2547 .release = wanpipe_release,
2548 .bind = wanpipe_bind,
2549 .connect = wanpipe_connect,
2550 .socketpair = sock_no_socketpair,
2551 .accept = wanpipe_accept,
2552 .getname = wanpipe_getname,
2553 .poll = wanpipe_poll,
2554 .ioctl = wanpipe_ioctl,
2555 .listen = wanpipe_listen,
2556 .shutdown = sock_no_shutdown,
2557 .setsockopt = sock_no_setsockopt,
2558 .getsockopt = sock_no_getsockopt,
2559 .sendmsg = wanpipe_sendmsg,
2560 .recvmsg = wanpipe_recvmsg
2561};
2562
2563static struct net_proto_family wanpipe_family_ops = {
2564 .family = PF_WANPIPE,
2565 .create = wanpipe_create,
2566 .owner = THIS_MODULE,
2567};
2568
2569struct notifier_block wanpipe_netdev_notifier = {
2570 .notifier_call = wanpipe_notifier,
2571};
2572
2573
2574#ifdef MODULE
2575void cleanup_module(void)
2576{
2577 printk(KERN_INFO "wansock: Cleaning up \n");
2578 unregister_netdevice_notifier(&wanpipe_netdev_notifier);
2579 sock_unregister(PF_WANPIPE);
2580 proto_unregister(&wanpipe_proto);
2581}
2582
2583int init_module(void)
2584{
2585 int rc;
2586
2587 printk(KERN_INFO "wansock: Registering Socket \n");
2588
2589 rc = proto_register(&wanpipe_proto, 0);
2590 if (rc != 0)
2591 goto out;
2592
2593 sock_register(&wanpipe_family_ops);
2594 register_netdevice_notifier(&wanpipe_netdev_notifier);
2595out:
2596 return rc;
2597}
2598#endif
2599MODULE_LICENSE("GPL");
2600MODULE_ALIAS_NETPROTO(PF_WANPIPE);
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 946b715db5ec..0c3a70ac5075 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -735,12 +735,14 @@ EXPORT_SYMBOL(xfrm_policy_insert);
735 735
736struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, 736struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
737 struct xfrm_selector *sel, 737 struct xfrm_selector *sel,
738 struct xfrm_sec_ctx *ctx, int delete) 738 struct xfrm_sec_ctx *ctx, int delete,
739 int *err)
739{ 740{
740 struct xfrm_policy *pol, *ret; 741 struct xfrm_policy *pol, *ret;
741 struct hlist_head *chain; 742 struct hlist_head *chain;
742 struct hlist_node *entry; 743 struct hlist_node *entry;
743 744
745 *err = 0;
744 write_lock_bh(&xfrm_policy_lock); 746 write_lock_bh(&xfrm_policy_lock);
745 chain = policy_hash_bysel(sel, sel->family, dir); 747 chain = policy_hash_bysel(sel, sel->family, dir);
746 ret = NULL; 748 ret = NULL;
@@ -750,6 +752,11 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
750 xfrm_sec_ctx_match(ctx, pol->security)) { 752 xfrm_sec_ctx_match(ctx, pol->security)) {
751 xfrm_pol_hold(pol); 753 xfrm_pol_hold(pol);
752 if (delete) { 754 if (delete) {
755 *err = security_xfrm_policy_delete(pol);
756 if (*err) {
757 write_unlock_bh(&xfrm_policy_lock);
758 return pol;
759 }
753 hlist_del(&pol->bydst); 760 hlist_del(&pol->bydst);
754 hlist_del(&pol->byidx); 761 hlist_del(&pol->byidx);
755 xfrm_policy_count[dir]--; 762 xfrm_policy_count[dir]--;
@@ -768,12 +775,14 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
768} 775}
769EXPORT_SYMBOL(xfrm_policy_bysel_ctx); 776EXPORT_SYMBOL(xfrm_policy_bysel_ctx);
770 777
771struct xfrm_policy *xfrm_policy_byid(u8 type, int dir, u32 id, int delete) 778struct xfrm_policy *xfrm_policy_byid(u8 type, int dir, u32 id, int delete,
779 int *err)
772{ 780{
773 struct xfrm_policy *pol, *ret; 781 struct xfrm_policy *pol, *ret;
774 struct hlist_head *chain; 782 struct hlist_head *chain;
775 struct hlist_node *entry; 783 struct hlist_node *entry;
776 784
785 *err = 0;
777 write_lock_bh(&xfrm_policy_lock); 786 write_lock_bh(&xfrm_policy_lock);
778 chain = xfrm_policy_byidx + idx_hash(id); 787 chain = xfrm_policy_byidx + idx_hash(id);
779 ret = NULL; 788 ret = NULL;
@@ -781,6 +790,11 @@ struct xfrm_policy *xfrm_policy_byid(u8 type, int dir, u32 id, int delete)
781 if (pol->type == type && pol->index == id) { 790 if (pol->type == type && pol->index == id) {
782 xfrm_pol_hold(pol); 791 xfrm_pol_hold(pol);
783 if (delete) { 792 if (delete) {
793 *err = security_xfrm_policy_delete(pol);
794 if (*err) {
795 write_unlock_bh(&xfrm_policy_lock);
796 return pol;
797 }
784 hlist_del(&pol->bydst); 798 hlist_del(&pol->bydst);
785 hlist_del(&pol->byidx); 799 hlist_del(&pol->byidx);
786 xfrm_policy_count[dir]--; 800 xfrm_policy_count[dir]--;
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index a35f9e4ede26..5c5f6dcab974 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -704,7 +704,8 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re
704 x->props.mode != mode || 704 x->props.mode != mode ||
705 x->props.family != family || 705 x->props.family != family ||
706 x->km.state != XFRM_STATE_ACQ || 706 x->km.state != XFRM_STATE_ACQ ||
707 x->id.spi != 0) 707 x->id.spi != 0 ||
708 x->id.proto != proto)
708 continue; 709 continue;
709 710
710 switch (family) { 711 switch (family) {
@@ -801,7 +802,8 @@ int xfrm_state_add(struct xfrm_state *x)
801 802
802 if (use_spi && x->km.seq) { 803 if (use_spi && x->km.seq) {
803 x1 = __xfrm_find_acq_byseq(x->km.seq); 804 x1 = __xfrm_find_acq_byseq(x->km.seq);
804 if (x1 && xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family)) { 805 if (x1 && ((x1->id.proto != x->id.proto) ||
806 xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) {
805 xfrm_state_put(x1); 807 xfrm_state_put(x1);
806 x1 = NULL; 808 x1 = NULL;
807 } 809 }
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 956cfe0ff7f8..96789952f6a3 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -530,9 +530,6 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
530 530
531 err = xfrm_state_delete(x); 531 err = xfrm_state_delete(x);
532 532
533 xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid,
534 AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x);
535
536 if (err < 0) 533 if (err < 0)
537 goto out; 534 goto out;
538 535
@@ -542,6 +539,8 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
542 km_state_notify(x, &c); 539 km_state_notify(x, &c);
543 540
544out: 541out:
542 xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid,
543 AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x);
545 xfrm_state_put(x); 544 xfrm_state_put(x);
546 return err; 545 return err;
547} 546}
@@ -1254,7 +1253,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1254 return err; 1253 return err;
1255 1254
1256 if (p->index) 1255 if (p->index)
1257 xp = xfrm_policy_byid(type, p->dir, p->index, delete); 1256 xp = xfrm_policy_byid(type, p->dir, p->index, delete, &err);
1258 else { 1257 else {
1259 struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; 1258 struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1];
1260 struct xfrm_policy tmp; 1259 struct xfrm_policy tmp;
@@ -1270,7 +1269,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1270 if ((err = security_xfrm_policy_alloc(&tmp, uctx))) 1269 if ((err = security_xfrm_policy_alloc(&tmp, uctx)))
1271 return err; 1270 return err;
1272 } 1271 }
1273 xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security, delete); 1272 xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security,
1273 delete, &err);
1274 security_xfrm_policy_free(&tmp); 1274 security_xfrm_policy_free(&tmp);
1275 } 1275 }
1276 if (xp == NULL) 1276 if (xp == NULL)
@@ -1288,8 +1288,6 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1288 MSG_DONTWAIT); 1288 MSG_DONTWAIT);
1289 } 1289 }
1290 } else { 1290 } else {
1291 err = security_xfrm_policy_delete(xp);
1292
1293 xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, 1291 xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid,
1294 AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); 1292 AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL);
1295 1293
@@ -1303,9 +1301,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1303 km_policy_notify(xp, p->dir, &c); 1301 km_policy_notify(xp, p->dir, &c);
1304 } 1302 }
1305 1303
1306 xfrm_pol_put(xp);
1307
1308out: 1304out:
1305 xfrm_pol_put(xp);
1309 return err; 1306 return err;
1310} 1307}
1311 1308
@@ -1502,7 +1499,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
1502 return err; 1499 return err;
1503 1500
1504 if (p->index) 1501 if (p->index)
1505 xp = xfrm_policy_byid(type, p->dir, p->index, 0); 1502 xp = xfrm_policy_byid(type, p->dir, p->index, 0, &err);
1506 else { 1503 else {
1507 struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; 1504 struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1];
1508 struct xfrm_policy tmp; 1505 struct xfrm_policy tmp;
@@ -1518,13 +1515,14 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
1518 if ((err = security_xfrm_policy_alloc(&tmp, uctx))) 1515 if ((err = security_xfrm_policy_alloc(&tmp, uctx)))
1519 return err; 1516 return err;
1520 } 1517 }
1521 xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security, 0); 1518 xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security,
1519 0, &err);
1522 security_xfrm_policy_free(&tmp); 1520 security_xfrm_policy_free(&tmp);
1523 } 1521 }
1524 1522
1525 if (xp == NULL) 1523 if (xp == NULL)
1526 return err; 1524 return -ENOENT;
1527 read_lock(&xp->lock); 1525 read_lock(&xp->lock);
1528 if (xp->dead) { 1526 if (xp->dead) {
1529 read_unlock(&xp->lock); 1527 read_unlock(&xp->lock);
1530 goto out; 1528 goto out;
diff --git a/security/dummy.c b/security/dummy.c
index 558795b237d6..8ffd76405b5b 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -907,7 +907,7 @@ static void dummy_d_instantiate (struct dentry *dentry, struct inode *inode)
907 return; 907 return;
908} 908}
909 909
910static int dummy_getprocattr(struct task_struct *p, char *name, void *value, size_t size) 910static int dummy_getprocattr(struct task_struct *p, char *name, char **value)
911{ 911{
912 return -EINVAL; 912 return -EINVAL;
913} 913}
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 19a385e9968e..d41e24d6ae41 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4468,11 +4468,12 @@ static void selinux_d_instantiate (struct dentry *dentry, struct inode *inode)
4468} 4468}
4469 4469
4470static int selinux_getprocattr(struct task_struct *p, 4470static int selinux_getprocattr(struct task_struct *p,
4471 char *name, void *value, size_t size) 4471 char *name, char **value)
4472{ 4472{
4473 struct task_security_struct *tsec; 4473 struct task_security_struct *tsec;
4474 u32 sid; 4474 u32 sid;
4475 int error; 4475 int error;
4476 unsigned len;
4476 4477
4477 if (current != p) { 4478 if (current != p) {
4478 error = task_has_perm(current, p, PROCESS__GETATTR); 4479 error = task_has_perm(current, p, PROCESS__GETATTR);
@@ -4500,7 +4501,10 @@ static int selinux_getprocattr(struct task_struct *p,
4500 if (!sid) 4501 if (!sid)
4501 return 0; 4502 return 0;
4502 4503
4503 return selinux_getsecurity(sid, value, size); 4504 error = security_sid_to_context(sid, value, &len);
4505 if (error)
4506 return error;
4507 return len;
4504} 4508}
4505 4509
4506static int selinux_setprocattr(struct task_struct *p, 4510static int selinux_setprocattr(struct task_struct *p,
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index a0ec886f2aa3..f4056a9c371b 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -1346,22 +1346,34 @@ static const struct file_operations sq_fops =
1346 .ioctl = sq_ioctl, 1346 .ioctl = sq_ioctl,
1347 .open = sq_open, 1347 .open = sq_open,
1348 .release = sq_release, 1348 .release = sq_release,
1349};
1350
1349#ifdef HAS_RECORD 1351#ifdef HAS_RECORD
1350 .read = NULL /* default to no read for compat mode */ 1352static const struct file_operations sq_fops_record =
1351#endif 1353{
1354 .owner = THIS_MODULE,
1355 .llseek = no_llseek,
1356 .write = sq_write,
1357 .poll = sq_poll,
1358 .ioctl = sq_ioctl,
1359 .open = sq_open,
1360 .release = sq_release,
1361 .read = sq_read,
1352}; 1362};
1363#endif
1353 1364
1354static int sq_init(void) 1365static int sq_init(void)
1355{ 1366{
1367 const struct file_operations *fops = &sq_fops;
1356#ifndef MODULE 1368#ifndef MODULE
1357 int sq_unit; 1369 int sq_unit;
1358#endif 1370#endif
1359 1371
1360#ifdef HAS_RECORD 1372#ifdef HAS_RECORD
1361 if (dmasound.mach.record) 1373 if (dmasound.mach.record)
1362 sq_fops.read = sq_read ; 1374 fops = &sq_fops_record;
1363#endif 1375#endif
1364 sq_unit = register_sound_dsp(&sq_fops, -1); 1376 sq_unit = register_sound_dsp(fops, -1);
1365 if (sq_unit < 0) { 1377 if (sq_unit < 0) {
1366 printk(KERN_ERR "dmasound_core: couldn't register fops\n") ; 1378 printk(KERN_ERR "dmasound_core: couldn't register fops\n") ;
1367 return sq_unit ; 1379 return sq_unit ;
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index bfc2fed16da3..37fabf75daa7 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -1790,6 +1790,8 @@ static const struct snd_kcontrol_new snd_ac97_ad1981x_jack_sense[] = {
1790 * (SS vendor << 16 | device) 1790 * (SS vendor << 16 | device)
1791 */ 1791 */
1792static unsigned int ad1981_jacks_blacklist[] = { 1792static unsigned int ad1981_jacks_blacklist[] = {
1793 0x10140523, /* Thinkpad R40 */
1794 0x10140534, /* Thinkpad X31 */
1793 0x10140537, /* Thinkpad T41p */ 1795 0x10140537, /* Thinkpad T41p */
1794 0x10140554, /* Thinkpad T42p/R50p */ 1796 0x10140554, /* Thinkpad T42p/R50p */
1795 0 /* end */ 1797 0 /* end */
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 9327ab2eccb0..ba7fa22b285d 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -2312,6 +2312,8 @@ static int __devinit snd_ali_create(struct snd_card *card,
2312 return err; 2312 return err;
2313 } 2313 }
2314 2314
2315 snd_card_set_dev(card, &pci->dev);
2316
2315 /* initialise synth voices*/ 2317 /* initialise synth voices*/
2316 for (i = 0; i < ALI_CHANNELS; i++ ) { 2318 for (i = 0; i < ALI_CHANNELS; i++ ) {
2317 codec->synth.voices[i].number = i; 2319 codec->synth.voices[i].number = i;
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 70face7e1048..7d3c5ee0005c 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -57,7 +57,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
58static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ 58static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */
59static long mpu_port[SNDRV_CARDS]; 59static long mpu_port[SNDRV_CARDS];
60static long fm_port[SNDRV_CARDS]; 60static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
61static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; 61static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
62#ifdef SUPPORT_JOYSTICK 62#ifdef SUPPORT_JOYSTICK
63static int joystick_port[SNDRV_CARDS]; 63static int joystick_port[SNDRV_CARDS];
@@ -2779,6 +2779,9 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2779 struct snd_opl3 *opl3; 2779 struct snd_opl3 *opl3;
2780 int err; 2780 int err;
2781 2781
2782 if (!fm_port)
2783 goto disable_fm;
2784
2782 /* first try FM regs in PCI port range */ 2785 /* first try FM regs in PCI port range */
2783 iosynth = cm->iobase + CM_REG_FM_PCI; 2786 iosynth = cm->iobase + CM_REG_FM_PCI;
2784 err = snd_opl3_create(cm->card, iosynth, iosynth + 2, 2787 err = snd_opl3_create(cm->card, iosynth, iosynth + 2,
@@ -2793,7 +2796,7 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2793 case 0x3C8: val |= CM_FMSEL_3C8; break; 2796 case 0x3C8: val |= CM_FMSEL_3C8; break;
2794 case 0x388: val |= CM_FMSEL_388; break; 2797 case 0x388: val |= CM_FMSEL_388; break;
2795 default: 2798 default:
2796 return 0; 2799 goto disable_fm;
2797 } 2800 }
2798 snd_cmipci_write(cm, CM_REG_LEGACY_CTRL, val); 2801 snd_cmipci_write(cm, CM_REG_LEGACY_CTRL, val);
2799 /* enable FM */ 2802 /* enable FM */
@@ -2803,11 +2806,7 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2803 OPL3_HW_OPL3, 0, &opl3) < 0) { 2806 OPL3_HW_OPL3, 0, &opl3) < 0) {
2804 printk(KERN_ERR "cmipci: no OPL device at %#lx, " 2807 printk(KERN_ERR "cmipci: no OPL device at %#lx, "
2805 "skipping...\n", iosynth); 2808 "skipping...\n", iosynth);
2806 /* disable FM */ 2809 goto disable_fm;
2807 snd_cmipci_write(cm, CM_REG_LEGACY_CTRL,
2808 val & ~CM_FMSEL_MASK);
2809 snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_FM_EN);
2810 return 0;
2811 } 2810 }
2812 } 2811 }
2813 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 2812 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
@@ -2815,6 +2814,11 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2815 return err; 2814 return err;
2816 } 2815 }
2817 return 0; 2816 return 0;
2817
2818 disable_fm:
2819 snd_cmipci_clear_bit(cm, CM_REG_LEGACY_CTRL, CM_FMSEL_MASK);
2820 snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_FM_EN);
2821 return 0;
2818} 2822}
2819 2823
2820static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pci, 2824static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 6a428b81dba6..e413da00759b 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -2033,6 +2033,8 @@ static int __devinit snd_echo_probe(struct pci_dev *pci,
2033 if (card == NULL) 2033 if (card == NULL)
2034 return -ENOMEM; 2034 return -ENOMEM;
2035 2035
2036 snd_card_set_dev(card, &pci->dev);
2037
2036 if ((err = snd_echo_create(card, pci, &chip)) < 0) { 2038 if ((err = snd_echo_create(card, pci, &chip)) < 0) {
2037 snd_card_free(card); 2039 snd_card_free(card);
2038 return err; 2040 return err;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 38977bce70e2..00ace59b05c9 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -523,6 +523,7 @@ static struct snd_kcontrol_new ad1986a_mixers[] = {
523 HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT), 523 HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT),
524 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), 524 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
525 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), 525 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
526 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
526 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x18, 0x0, HDA_OUTPUT), 527 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x18, 0x0, HDA_OUTPUT),
527 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x18, 0x0, HDA_OUTPUT), 528 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x18, 0x0, HDA_OUTPUT),
528 HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT), 529 HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT),
@@ -570,6 +571,7 @@ static struct snd_kcontrol_new ad1986a_laptop_mixers[] = {
570 HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT), 571 HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT),
571 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), 572 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
572 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), 573 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
574 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
573 /* HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x18, 0x0, HDA_OUTPUT), 575 /* HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x18, 0x0, HDA_OUTPUT),
574 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x18, 0x0, HDA_OUTPUT), 576 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x18, 0x0, HDA_OUTPUT),
575 HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT), 577 HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT),
@@ -658,6 +660,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
658 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT), 660 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
659 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), 661 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
660 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), 662 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
663 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
661 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT), 664 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
662 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT), 665 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
663 { 666 {
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 23a1c75085b5..46e93c6b9a42 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -629,10 +629,12 @@ static int cxt5045_hp_master_vol_put(struct snd_kcontrol *kcontrol,
629static void cxt5045_hp_automute(struct hda_codec *codec) 629static void cxt5045_hp_automute(struct hda_codec *codec)
630{ 630{
631 struct conexant_spec *spec = codec->spec; 631 struct conexant_spec *spec = codec->spec;
632 unsigned int bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; 632 unsigned int bits;
633 633
634 spec->hp_present = snd_hda_codec_read(codec, 0x11, 0, 634 spec->hp_present = snd_hda_codec_read(codec, 0x11, 0,
635 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 635 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
636
637 bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
636 snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits); 638 snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits);
637 snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits); 639 snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits);
638} 640}
@@ -979,10 +981,12 @@ static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol,
979static void cxt5047_hp_automute(struct hda_codec *codec) 981static void cxt5047_hp_automute(struct hda_codec *codec)
980{ 982{
981 struct conexant_spec *spec = codec->spec; 983 struct conexant_spec *spec = codec->spec;
982 unsigned int bits = spec->hp_present || !spec->cur_eapd ? 0x80 : 0; 984 unsigned int bits;
983 985
984 spec->hp_present = snd_hda_codec_read(codec, 0x13, 0, 986 spec->hp_present = snd_hda_codec_read(codec, 0x13, 0,
985 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 987 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
988
989 bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
986 snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits); 990 snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits);
987 snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits); 991 snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits);
988 /* Mute/Unmute PCM 2 for good measure - some systems need this */ 992 /* Mute/Unmute PCM 2 for good measure - some systems need this */
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 145682b78071..84d005ef30ee 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4942,9 +4942,16 @@ static int patch_alc882(struct hda_codec *codec)
4942 alc882_cfg_tbl); 4942 alc882_cfg_tbl);
4943 4943
4944 if (board_config < 0 || board_config >= ALC882_MODEL_LAST) { 4944 if (board_config < 0 || board_config >= ALC882_MODEL_LAST) {
4945 printk(KERN_INFO "hda_codec: Unknown model for ALC882, " 4945 /* Pick up systems that don't supply PCI SSID */
4946 "trying auto-probe from BIOS...\n"); 4946 switch (codec->subsystem_id) {
4947 board_config = ALC882_AUTO; 4947 case 0x106b0c00: /* Mac Pro */
4948 board_config = ALC885_MACPRO;
4949 break;
4950 default:
4951 printk(KERN_INFO "hda_codec: Unknown model for ALC882, "
4952 "trying auto-probe from BIOS...\n");
4953 board_config = ALC882_AUTO;
4954 }
4948 } 4955 }
4949 4956
4950 if (board_config == ALC882_AUTO) { 4957 if (board_config == ALC882_AUTO) {
@@ -5917,8 +5924,10 @@ static struct snd_kcontrol_new alc262_base_mixer[] = {
5917 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 5924 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
5918 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 5925 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
5919 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 5926 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
5927 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
5920 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), 5928 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
5921 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 5929 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
5930 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
5922 /* HDA_CODEC_VOLUME("PC Beep Playback Volume", 0x0b, 0x05, HDA_INPUT), 5931 /* HDA_CODEC_VOLUME("PC Beep Playback Volume", 0x0b, 0x05, HDA_INPUT),
5923 HDA_CODEC_MUTE("PC Beelp Playback Switch", 0x0b, 0x05, HDA_INPUT), */ 5932 HDA_CODEC_MUTE("PC Beelp Playback Switch", 0x0b, 0x05, HDA_INPUT), */
5924 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT), 5933 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT),
@@ -5937,8 +5946,10 @@ static struct snd_kcontrol_new alc262_hippo1_mixer[] = {
5937 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 5946 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
5938 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 5947 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
5939 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 5948 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
5949 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
5940 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), 5950 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
5941 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 5951 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
5952 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
5942 /* HDA_CODEC_VOLUME("PC Beep Playback Volume", 0x0b, 0x05, HDA_INPUT), 5953 /* HDA_CODEC_VOLUME("PC Beep Playback Volume", 0x0b, 0x05, HDA_INPUT),
5943 HDA_CODEC_MUTE("PC Beelp Playback Switch", 0x0b, 0x05, HDA_INPUT), */ 5954 HDA_CODEC_MUTE("PC Beelp Playback Switch", 0x0b, 0x05, HDA_INPUT), */
5944 /*HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT),*/ 5955 /*HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT),*/
@@ -5955,8 +5966,10 @@ static struct snd_kcontrol_new alc262_HP_BPC_mixer[] = {
5955 5966
5956 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 5967 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
5957 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 5968 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
5969 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
5958 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), 5970 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
5959 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 5971 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
5972 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
5960 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 5973 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
5961 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 5974 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
5962 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 5975 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
@@ -5977,6 +5990,7 @@ static struct snd_kcontrol_new alc262_HP_BPC_WildWest_mixer[] = {
5977 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT), 5990 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT),
5978 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x02, HDA_INPUT), 5991 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x02, HDA_INPUT),
5979 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x02, HDA_INPUT), 5992 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x02, HDA_INPUT),
5993 HDA_CODEC_VOLUME("Front Mic Boost", 0x1a, 0, HDA_INPUT),
5980 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT), 5994 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT),
5981 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT), 5995 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT),
5982 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 5996 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
@@ -5989,6 +6003,7 @@ static struct snd_kcontrol_new alc262_HP_BPC_WildWest_mixer[] = {
5989static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer[] = { 6003static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer[] = {
5990 HDA_CODEC_VOLUME("Rear Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 6004 HDA_CODEC_VOLUME("Rear Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
5991 HDA_CODEC_MUTE("Rear Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 6005 HDA_CODEC_MUTE("Rear Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
6006 HDA_CODEC_VOLUME("Rear Mic Boost", 0x18, 0, HDA_INPUT),
5992 { } /* end */ 6007 { } /* end */
5993}; 6008};
5994 6009
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index f7ef9c5afe87..4c7b03996be9 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -59,6 +59,8 @@ enum {
59 STAC_D945GTP3, 59 STAC_D945GTP3,
60 STAC_D945GTP5, 60 STAC_D945GTP5,
61 STAC_MACMINI, 61 STAC_MACMINI,
62 STAC_MACBOOK,
63 STAC_MACBOOK_PRO,
62 STAC_922X_MODELS 64 STAC_922X_MODELS
63}; 65};
64 66
@@ -461,6 +463,8 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
461 "Dell Inspiron E1705/9400", STAC_REF), 463 "Dell Inspiron E1705/9400", STAC_REF),
462 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ce, 464 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ce,
463 "Dell XPS M1710", STAC_REF), 465 "Dell XPS M1710", STAC_REF),
466 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf,
467 "Dell Precision M90", STAC_REF),
464 {} /* terminator */ 468 {} /* terminator */
465}; 469};
466 470
@@ -519,11 +523,25 @@ static unsigned int d945gtp5_pin_configs[10] = {
519 0x02a19320, 0x40000100, 523 0x02a19320, 0x40000100,
520}; 524};
521 525
526static unsigned int macbook_pin_configs[10] = {
527 0x0321e230, 0x03a1e020, 0x400000fd, 0x9017e110,
528 0x400000fe, 0x0381e021, 0x1345e240, 0x13c5e22e,
529 0x400000fc, 0x400000fb,
530};
531
532static unsigned int macbook_pro_pin_configs[10] = {
533 0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
534 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
535 0x400000fc, 0x400000fb,
536};
537
522static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { 538static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
523 [STAC_D945_REF] = ref922x_pin_configs, 539 [STAC_D945_REF] = ref922x_pin_configs,
524 [STAC_D945GTP3] = d945gtp3_pin_configs, 540 [STAC_D945GTP3] = d945gtp3_pin_configs,
525 [STAC_D945GTP5] = d945gtp5_pin_configs, 541 [STAC_D945GTP5] = d945gtp5_pin_configs,
526 [STAC_MACMINI] = d945gtp5_pin_configs, 542 [STAC_MACMINI] = d945gtp5_pin_configs,
543 [STAC_MACBOOK] = macbook_pin_configs,
544 [STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
527}; 545};
528 546
529static const char *stac922x_models[STAC_922X_MODELS] = { 547static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -531,6 +549,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
531 [STAC_D945GTP5] = "5stack", 549 [STAC_D945GTP5] = "5stack",
532 [STAC_D945GTP3] = "3stack", 550 [STAC_D945GTP3] = "3stack",
533 [STAC_MACMINI] = "macmini", 551 [STAC_MACMINI] = "macmini",
552 [STAC_MACBOOK] = "macbook",
553 [STAC_MACBOOK_PRO] = "macbook-pro",
534}; 554};
535 555
536static struct snd_pci_quirk stac922x_cfg_tbl[] = { 556static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1864,6 +1884,18 @@ static int patch_stac922x(struct hda_codec *codec)
1864 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, 1884 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
1865 stac922x_models, 1885 stac922x_models,
1866 stac922x_cfg_tbl); 1886 stac922x_cfg_tbl);
1887 if (spec->board_config == STAC_MACMINI) {
1888 spec->gpio_mute = 1;
1889 /* Intel Macs have all same PCI SSID, so we need to check
1890 * codec SSID to distinguish the exact models
1891 */
1892 switch (codec->subsystem_id) {
1893 case 0x106b1e00:
1894 spec->board_config = STAC_MACBOOK_PRO;
1895 break;
1896 }
1897 }
1898
1867 again: 1899 again:
1868 if (spec->board_config < 0) { 1900 if (spec->board_config < 0) {
1869 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " 1901 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, "
@@ -1904,9 +1936,6 @@ static int patch_stac922x(struct hda_codec *codec)
1904 return err; 1936 return err;
1905 } 1937 }
1906 1938
1907 if (spec->board_config == STAC_MACMINI)
1908 spec->gpio_mute = 1;
1909
1910 codec->patch_ops = stac92xx_patch_ops; 1939 codec->patch_ops = stac92xx_patch_ops;
1911 1940
1912 return 0; 1941 return 0;
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 5e1d5d2b2850..952625dead58 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1919,6 +1919,8 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci,
1919 return err; 1919 return err;
1920 } 1920 }
1921 1921
1922 snd_card_set_dev(card, &pci->dev);
1923
1922 *rchip = chip; 1924 *rchip = chip;
1923 return 0; 1925 return 0;
1924} 1926}
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index e0215aca1193..6e95857e4e67 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -4468,6 +4468,8 @@ static int __devinit snd_hdspm_probe(struct pci_dev *pci,
4468 hdspm->dev = dev; 4468 hdspm->dev = dev;
4469 hdspm->pci = pci; 4469 hdspm->pci = pci;
4470 4470
4471 snd_card_set_dev(card, &pci->dev);
4472
4471 if ((err = 4473 if ((err =
4472 snd_hdspm_create(card, hdspm, precise_ptr[dev], 4474 snd_hdspm_create(card, hdspm, precise_ptr[dev],
4473 enable_monitor[dev])) < 0) { 4475 enable_monitor[dev])) < 0) {
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 92a64871bcd0..ee7a691a9ba1 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -39,7 +39,7 @@ static int ac97_write(struct snd_soc_codec *codec,
39 */ 39 */
40static const u16 wm9712_reg[] = { 40static const u16 wm9712_reg[] = {
41 0x6174, 0x8000, 0x8000, 0x8000, // 6 41 0x6174, 0x8000, 0x8000, 0x8000, // 6
42 0xf0f0, 0xaaa0, 0xc008, 0x6808, // e 42 0x0f0f, 0xaaa0, 0xc008, 0x6808, // e
43 0xe808, 0xaaa0, 0xad00, 0x8000, // 16 43 0xe808, 0xaaa0, 0xad00, 0x8000, // 16
44 0xe808, 0x3000, 0x8000, 0x0000, // 1e 44 0xe808, 0x3000, 0x8000, 0x0000, // 1e
45 0x0000, 0x0000, 0x0000, 0x000f, // 26 45 0x0000, 0x0000, 0x0000, 0x000f, // 26
@@ -96,6 +96,7 @@ SOC_DOUBLE("Speaker Playback Volume", AC97_MASTER, 8, 0, 31, 1),
96SOC_SINGLE("Speaker Playback Switch", AC97_MASTER, 15, 1, 1), 96SOC_SINGLE("Speaker Playback Switch", AC97_MASTER, 15, 1, 1),
97SOC_DOUBLE("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1), 97SOC_DOUBLE("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1),
98SOC_SINGLE("Headphone Playback Switch", AC97_HEADPHONE,15, 1, 1), 98SOC_SINGLE("Headphone Playback Switch", AC97_HEADPHONE,15, 1, 1),
99SOC_DOUBLE("PCM Playback Volume", AC97_PCM, 8, 0, 31, 1),
99 100
100SOC_SINGLE("Speaker Playback ZC Switch", AC97_MASTER, 7, 1, 0), 101SOC_SINGLE("Speaker Playback ZC Switch", AC97_MASTER, 7, 1, 0),
101SOC_SINGLE("Speaker Playback Invert Switch", AC97_MASTER, 6, 1, 0), 102SOC_SINGLE("Speaker Playback Invert Switch", AC97_MASTER, 6, 1, 0),