]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
Merge trivial low-risk suspend hotkey bugzilla-5918 into release
authorLen Brown <len.brown@intel.com>
Mon, 21 Aug 2006 01:49:29 +0000 (21:49 -0400)
committerLen Brown <len.brown@intel.com>
Mon, 21 Aug 2006 01:49:29 +0000 (21:49 -0400)
644 files changed:
.gitignore
Documentation/DocBook/kernel-api.tmpl
Documentation/SubmittingPatches
Documentation/accounting/delay-accounting.txt
Documentation/cpu-freq/user-guide.txt
Documentation/cpu-hotplug.txt
Documentation/devices.txt
Documentation/fb/imacfb.txt [new file with mode: 0644]
Documentation/feature-removal-schedule.txt
Documentation/infiniband/ipoib.txt
Documentation/initrd.txt
Documentation/kbuild/makefiles.txt
Documentation/kernel-parameters.txt
Documentation/kobject.txt
Documentation/networking/ip-sysctl.txt
Documentation/powerpc/booting-without-of.txt
Documentation/sysctl/kernel.txt
Documentation/usb/proc_usb_info.txt
Documentation/usb/usb-help.txt
Documentation/x86_64/boot-options.txt
MAINTAINERS
Makefile
arch/alpha/kernel/err_ev7.c
arch/alpha/kernel/osf_sys.c
arch/alpha/kernel/setup.c
arch/alpha/kernel/sys_ruffian.c
arch/alpha/kernel/time.c
arch/arm/common/gic.c
arch/arm/common/locomo.c
arch/arm/common/rtctime.c
arch/arm/common/sa1111.c
arch/arm/common/vic.c
arch/arm/configs/ep93xx_defconfig
arch/arm/kernel/ecard.c
arch/arm/kernel/head.S
arch/arm/kernel/irq.c
arch/arm/kernel/traps.c
arch/arm/mach-at91rm9200/gpio.c
arch/arm/mach-at91rm9200/irq.c
arch/arm/mach-footbridge/cats-hw.c
arch/arm/mach-imx/irq.c
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-iop3xx/iop321-irq.c
arch/arm/mach-iop3xx/iop331-irq.c
arch/arm/mach-ixp4xx/common-pci.c
arch/arm/mach-ixp4xx/gtwx5715-setup.c
arch/arm/mach-lh7a40x/arch-kev7a400.c
arch/arm/mach-lh7a40x/arch-lpd7a40x.c
arch/arm/mach-lh7a40x/irq-kev7a400.c
arch/arm/mach-lh7a40x/irq-lh7a400.c
arch/arm/mach-lh7a40x/irq-lh7a404.c
arch/arm/mach-lh7a40x/irq-lpd7a40x.c
arch/arm/mach-omap1/fpga.c
arch/arm/mach-omap1/irq.c
arch/arm/mach-omap2/irq.c
arch/arm/mach-pxa/irq.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-s3c2410/mach-anubis.c
arch/arm/mach-s3c2410/mach-osiris.c
arch/arm/mach-sa1100/irq.c
arch/arm/mach-shark/irq.c
arch/arm/mach-versatile/core.c
arch/arm/mm/ioremap.c
arch/arm/mm/proc-syms.c
arch/arm/mm/proc-xscale.S
arch/arm/plat-omap/gpio.c
arch/i386/Kconfig
arch/i386/kernel/Makefile
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/wakeup.S
arch/i386/kernel/cpu/cpufreq/Kconfig
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/cpu/cpufreq/longhaul.c
arch/i386/kernel/cpu/intel_cacheinfo.c
arch/i386/kernel/cpu/mcheck/mce.h
arch/i386/kernel/entry.S
arch/i386/kernel/kprobes.c
arch/i386/kernel/machine_kexec.c
arch/i386/kernel/nmi.c
arch/i386/kernel/process.c
arch/i386/kernel/smpboot.c
arch/i386/kernel/time.c
arch/i386/kernel/traps.c
arch/i386/kernel/vsyscall.lds.S
arch/ia64/configs/sn2_defconfig
arch/ia64/defconfig
arch/ia64/hp/sim/simscsi.c
arch/ia64/kernel/Makefile
arch/ia64/kernel/acpi.c
arch/ia64/kernel/efi.c
arch/ia64/kernel/gate.lds.S
arch/ia64/kernel/head.S
arch/ia64/kernel/ia64_ksyms.c
arch/ia64/kernel/kprobes.c
arch/ia64/kernel/pal.S
arch/ia64/kernel/palinfo.c
arch/ia64/kernel/topology.c
arch/ia64/kernel/traps.c
arch/ia64/kernel/uncached.c
arch/ia64/lib/Makefile
arch/ia64/mm/contig.c
arch/ia64/mm/discontig.c
arch/ia64/mm/init.c
arch/ia64/mm/ioremap.c
arch/ia64/sn/kernel/xpc_main.c
arch/ia64/sn/pci/tioce_provider.c
arch/parisc/kernel/vmlinux.lds.S
arch/powerpc/Kconfig
arch/powerpc/boot/dts/mpc8641_hpcn.dts [new file with mode: 0644]
arch/powerpc/configs/g5_defconfig
arch/powerpc/configs/iseries_defconfig
arch/powerpc/configs/pmac32_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/cpu_setup_power4.S
arch/powerpc/kernel/crash.c
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/kprobes.c
arch/powerpc/kernel/legacy_serial.c
arch/powerpc/kernel/machine_kexec.c
arch/powerpc/kernel/machine_kexec_64.c
arch/powerpc/kernel/misc_64.S
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/smp.c
arch/powerpc/kernel/sysfs.c
arch/powerpc/kernel/traps.c
arch/powerpc/kernel/udbg_16550.c
arch/powerpc/kernel/vdso32/Makefile
arch/powerpc/kernel/vdso32/vdso32.lds.S
arch/powerpc/kernel/vdso64/Makefile
arch/powerpc/kernel/vdso64/vdso64.lds.S
arch/powerpc/mm/lmb.c
arch/powerpc/platforms/chrp/setup.c
arch/powerpc/platforms/maple/setup.c
arch/powerpc/platforms/powermac/backlight.c
arch/powerpc/platforms/powermac/bootx_init.c
arch/powerpc/platforms/powermac/cpufreq_64.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/platforms/pseries/xics.c
arch/powerpc/sysdev/fsl_soc.c
arch/ppc/kernel/vmlinux.lds.S
arch/s390/appldata/appldata_base.c
arch/s390/defconfig
arch/s390/mm/init.c
arch/sh/kernel/cpu/sh4/sq.c
arch/sparc/kernel/time.c
arch/sparc64/mm/fault.c
arch/um/kernel/dyn.lds.S
arch/v850/kernel/setup.c
arch/v850/kernel/v850_ksyms.c
arch/x86_64/defconfig
arch/x86_64/ia32/Makefile
arch/x86_64/ia32/ia32entry.S
arch/x86_64/ia32/vsyscall.lds
arch/x86_64/kernel/entry.S
arch/x86_64/kernel/machine_kexec.c
arch/x86_64/kernel/mce.c
arch/x86_64/kernel/mce_amd.c
arch/x86_64/kernel/pci-calgary.c
arch/x86_64/kernel/pci-nommu.c
arch/x86_64/kernel/pci-swiotlb.c
arch/x86_64/kernel/smp.c
arch/x86_64/kernel/tce.c
arch/x86_64/kernel/time.c
arch/x86_64/kernel/traps.c
arch/x86_64/pci/k8-bus.c
arch/xtensa/kernel/traps.c
block/blktrace.c
block/cfq-iosched.c
drivers/acpi/ac.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/battery.c
drivers/acpi/bus.c
drivers/acpi/dock.c
drivers/acpi/hotkey.c
drivers/acpi/i2c_ec.c
drivers/acpi/osl.c
drivers/acpi/sbs.c
drivers/acpi/scan.c
drivers/acpi/utils.c
drivers/base/topology.c
drivers/block/cciss.c
drivers/block/nbd.c
drivers/block/pktcdvd.c
drivers/char/hvsi.c
drivers/char/hw_random/geode-rng.c
drivers/char/hw_random/intel-rng.c
drivers/char/hw_random/omap-rng.c
drivers/char/keyboard.c
drivers/char/pc8736x_gpio.c
drivers/char/snsc.c
drivers/char/watchdog/Kconfig
drivers/connector/cn_proc.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/cpufreq/cpufreq_userspace.c
drivers/edac/edac_mc.h
drivers/i2c/busses/scx200_acb.c
drivers/ide/Kconfig
drivers/ide/ide-disk.c
drivers/ide/ide-dma.c
drivers/ide/ide-iops.c
drivers/ide/ide.c
drivers/ide/pci/generic.c
drivers/ide/pci/it821x.c
drivers/ieee1394/sbp2.c
drivers/infiniband/core/addr.c
drivers/infiniband/core/cm.c
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/hw/mthca/mthca_allocator.c
drivers/infiniband/ulp/ipoib/Kconfig
drivers/infiniband/ulp/srp/ib_srp.c
drivers/input/evdev.c
drivers/input/gameport/fm801-gp.c
drivers/input/gameport/gameport.c
drivers/input/input.c
drivers/input/joystick/iforce/iforce-main.c
drivers/input/joystick/spaceball.c
drivers/input/keyboard/atkbd.c
drivers/input/misc/wistron_btns.c
drivers/input/mouse/logips2pp.c
drivers/input/mouse/trackpoint.c
drivers/input/serio/libps2.c
drivers/input/serio/serio.c
drivers/isdn/hardware/eicon/divasync.h
drivers/macintosh/Kconfig
drivers/macintosh/adbhid.c
drivers/macintosh/therm_pm72.c
drivers/macintosh/therm_pm72.h
drivers/macintosh/via-pmu-backlight.c
drivers/macintosh/via-pmu-led.c
drivers/macintosh/via-pmu.c
drivers/md/dm-mpath.c
drivers/md/linear.c
drivers/media/dvb/bt8xx/dst.c
drivers/media/dvb/dvb-core/Makefile
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/dvb/frontends/dvb-pll.c
drivers/media/dvb/ttpci/av7110.c
drivers/media/dvb/ttpci/av7110_v4l.c
drivers/media/dvb/ttpci/budget-av.c
drivers/media/dvb/ttpci/budget-ci.c
drivers/media/dvb/ttpci/budget-core.c
drivers/media/dvb/ttpci/budget-patch.c
drivers/media/dvb/ttpci/budget.c
drivers/media/dvb/ttpci/budget.h
drivers/media/radio/Kconfig
drivers/media/radio/Makefile
drivers/media/radio/dsbr100.c [new file with mode: 0644]
drivers/media/video/Kconfig
drivers/media/video/Makefile
drivers/media/video/bt8xx/Kconfig
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bt8xx/bttv-vbi.c
drivers/media/video/compat_ioctl32.c
drivers/media/video/cpia2/Kconfig
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx88/cx88-input.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/dsbr100.c [deleted file]
drivers/media/video/msp3400-driver.c
drivers/media/video/msp3400-kthreads.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-io.c
drivers/media/video/pvrusb2/pvrusb2-io.h
drivers/media/video/pvrusb2/pvrusb2-ioread.c
drivers/media/video/pvrusb2/pvrusb2-sysfs.c
drivers/media/video/pwc/Kconfig
drivers/media/video/pwc/pwc-if.c
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-oss.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/saa7134/saa7134.h
drivers/media/video/stradis.c
drivers/media/video/tuner-core.c
drivers/media/video/tuner-simple.c
drivers/media/video/tuner-types.c
drivers/media/video/usbvideo/Kconfig
drivers/media/video/v4l1-compat.c
drivers/media/video/v4l2-common.c
drivers/media/video/videodev.c
drivers/media/video/vivi.c
drivers/mmc/mmc_queue.c
drivers/mmc/wbsd.c
drivers/net/appletalk/Kconfig
drivers/net/bnx2.c
drivers/net/bnx2.h
drivers/net/e1000/e1000_main.c
drivers/net/myri10ge/myri10ge.c
drivers/net/phy/phy.c
drivers/net/ppp_generic.c
drivers/net/s2io.c
drivers/net/s2io.h
drivers/net/skge.c
drivers/net/sunlance.c
drivers/net/tg3.c
drivers/net/tg3.h
drivers/net/via-velocity.c
drivers/net/wireless/Kconfig
drivers/net/wireless/bcm43xx/bcm43xx_main.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/zd1201.c
drivers/net/wireless/zd1211rw/zd_chip.c
drivers/net/wireless/zd1211rw/zd_chip.h
drivers/net/wireless/zd1211rw/zd_mac.c
drivers/net/wireless/zd1211rw/zd_usb.c
drivers/pci/hotplug/Kconfig
drivers/pci/hotplug/acpiphp_core.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/pcie/portdrv_pci.c
drivers/pci/quirks.c
drivers/pci/search.c
drivers/pcmcia/pcmcia_ioctl.c
drivers/pcmcia/pcmcia_resource.c
drivers/pnp/interface.c
drivers/pnp/pnpacpi/rsparser.c
drivers/pnp/pnpbios/core.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_devmap.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/xpram.c
drivers/s390/char/tape_class.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/device_fsm.c
drivers/s390/cio/device_ops.c
drivers/scsi/NCR53C9x.c
drivers/scsi/ahci.c
drivers/scsi/aic7xxx/aicasm/Makefile
drivers/scsi/arm/Kconfig
drivers/scsi/arm/fas216.c
drivers/scsi/arm/scsi.h
drivers/scsi/ata_piix.c
drivers/scsi/esp.c
drivers/scsi/libata-core.c
drivers/scsi/libata-eh.c
drivers/scsi/libata-scsi.c
drivers/scsi/sata_promise.c
drivers/scsi/sata_sil24.c
drivers/scsi/scsi_ioctl.c
drivers/usb/Kconfig
drivers/usb/core/devio.c
drivers/usb/core/file.c
drivers/usb/gadget/Kconfig
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/at91_udc.h
drivers/usb/gadget/dummy_hcd.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-au1xxx.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/uhci-q.c
drivers/usb/input/appletouch.c
drivers/usb/input/ati_remote.c
drivers/usb/input/hid-input.c
drivers/usb/input/hiddev.c
drivers/usb/misc/cypress_cy7c63.c
drivers/usb/misc/usbtest.c
drivers/usb/net/rtl8150.c
drivers/usb/serial/Kconfig
drivers/usb/serial/Makefile
drivers/usb/serial/anydata.c [deleted file]
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h
drivers/usb/serial/ipaq.c
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.h
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/usb.c
drivers/video/Kconfig
drivers/video/Makefile
drivers/video/aty/aty128fb.c
drivers/video/aty/atyfb_base.c
drivers/video/aty/radeon_base.c
drivers/video/aty/radeon_pm.c
drivers/video/aty/radeonfb.h
drivers/video/au1100fb.c
drivers/video/backlight/Kconfig
drivers/video/console/mdacon.c
drivers/video/fb_notify.c [new file with mode: 0644]
drivers/video/fbmem.c
drivers/video/imacfb.c
drivers/video/nvidia/nvidia.c
drivers/video/offb.c
drivers/video/riva/fbdev.c
fs/9p/conv.c
fs/9p/vfs_inode.c
fs/adfs/super.c
fs/befs/linuxvfs.c
fs/buffer.c
fs/coda/file.c
fs/efs/symlink.c
fs/ext3/inode.c
fs/ext3/namei.c
fs/freevxfs/vxfs_lookup.c
fs/fuse/control.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/inotify_user.c
fs/jfs/inode.c
fs/jfs/jfs_inode.h
fs/jfs/super.c
fs/lockd/svclock.c
fs/locks.c
fs/namei.c
fs/nfs/namespace.c
fs/nfs/read.c
fs/nfs/write.c
fs/nfsd/nfsfh.c
fs/ocfs2/dlm/dlmmaster.c
fs/ocfs2/dlm/dlmunlock.c
fs/ocfs2/localalloc.c
fs/ocfs2/ocfs2.h
fs/ocfs2/suballoc.c
fs/ocfs2/suballoc.h
fs/ocfs2/super.c
fs/partitions/Kconfig
fs/reiserfs/file.c
fs/reiserfs/inode.c
fs/reiserfs/ioctl.c
fs/udf/ialloc.c
fs/udf/super.c
fs/ufs/balloc.c
fs/ufs/namei.c
fs/ufs/util.c
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/quota/xfs_qm_bhv.c
fs/xfs/xfs_alloc.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_log.c
fs/xfs/xfs_vfsops.c
include/asm-arm/arch-iop3xx/iop331-irqs.h
include/asm-arm/arch-omap/clock.h
include/asm-i386/kprobes.h
include/asm-ia64/kprobes.h
include/asm-ia64/meminit.h
include/asm-ia64/pal.h
include/asm-ia64/sn/xpc.h
include/asm-ia64/system.h
include/asm-powerpc/backlight.h
include/asm-powerpc/kexec.h
include/asm-powerpc/kprobes.h
include/asm-powerpc/rtas.h
include/asm-sparc/signal.h
include/asm-sparc64/kprobes.h
include/asm-sparc64/pgtable.h
include/asm-sparc64/sfp-machine.h
include/asm-x86_64/calgary.h
include/asm-x86_64/kprobes.h
include/asm-x86_64/page.h
include/asm-x86_64/swiotlb.h
include/linux/audit.h
include/linux/cn_proc.h
include/linux/cpufreq.h
include/linux/debug_locks.h
include/linux/delayacct.h
include/linux/ext3_fs.h
include/linux/fb.h
include/linux/fsnotify.h
include/linux/futex.h
include/linux/ide.h
include/linux/if_vlan.h
include/linux/input.h
include/linux/irq.h
include/linux/jiffies.h
include/linux/kernel.h
include/linux/kobject.h
include/linux/libata.h
include/linux/lockd/lockd.h
include/linux/mm.h
include/linux/netdevice.h
include/linux/netfilter_bridge.h
include/linux/nfs_fs.h
include/linux/pci_ids.h
include/linux/pmu.h
include/linux/sched.h
include/linux/security.h
include/linux/skbuff.h
include/linux/sunrpc/xprt.h
include/linux/usb.h
include/linux/usb_usual.h
include/linux/videodev.h
include/linux/videodev2.h
include/linux/vmstat.h
include/media/v4l2-dev.h
include/net/af_unix.h
include/net/ip6_route.h
include/net/ipv6.h
include/net/netdma.h
include/net/netevent.h [new file with mode: 0644]
include/net/red.h
include/net/scm.h
include/net/tcp.h
ipc/msg.c
kernel/audit.c
kernel/auditfilter.c
kernel/auditsc.c
kernel/delayacct.c
kernel/fork.c
kernel/futex.c
kernel/futex_compat.c
kernel/hrtimer.c
kernel/irq/manage.c
kernel/kprobes.c
kernel/panic.c
kernel/power/process.c
kernel/printk.c
kernel/rcupdate.c
kernel/resource.c
kernel/rtmutex.c
kernel/sched.c
kernel/signal.c
kernel/softirq.c
kernel/softlockup.c
kernel/taskstats.c
kernel/timer.c
kernel/workqueue.c
lib/kobject_uevent.c
lib/spinlock_debug.c
lib/zlib_inflate/inflate.c
mm/fadvise.c
mm/filemap.c
mm/memory_hotplug.c
mm/slab.c
mm/swap.c
net/atm/proc.c
net/bridge/br_if.c
net/bridge/br_netfilter.c
net/bridge/br_netlink.c
net/bridge/netfilter/ebt_ulog.c
net/core/Makefile
net/core/dev.c
net/core/dst.c
net/core/neighbour.c
net/core/netevent.c [new file with mode: 0644]
net/core/pktgen.c
net/core/rtnetlink.c
net/core/skbuff.c
net/core/utils.c
net/core/wireless.c
net/dccp/ipv6.c
net/decnet/dn_route.c
net/ieee80211/Kconfig
net/ieee80211/softmac/ieee80211softmac_auth.c
net/ipv4/fib_semantics.c
net/ipv4/igmp.c
net/ipv4/ip_input.c
net/ipv4/ip_output.c
net/ipv4/ip_sockglue.c
net/ipv4/ipmr.c
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_conntrack_helper_h323.c
net/ipv4/netfilter/ip_conntrack_netlink.c
net/ipv4/netfilter/ip_conntrack_sip.c
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/ip_nat_snmp_basic.c
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ipt_ULOG.c
net/ipv4/netfilter/ipt_hashlimit.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_output.c
net/ipv4/tcp_probe.c
net/ipv6/addrconf.c
net/ipv6/af_inet6.c
net/ipv6/icmp.c
net/ipv6/inet6_connection_sock.c
net/ipv6/ip6_input.c
net/ipv6/ip6_output.c
net/ipv6/mcast.c
net/ipv6/netfilter/ip6_tables.c
net/ipv6/raw.c
net/ipv6/route.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/xfrm6_output.c
net/ipx/af_ipx.c
net/lapb/lapb_iface.c
net/llc/af_llc.c
net/llc/llc_sap.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_queue.c
net/netfilter/nfnetlink_log.c
net/netfilter/xt_SECMARK.c
net/netfilter/xt_physdev.c
net/netfilter/xt_pkttype.c
net/netfilter/xt_string.c
net/sched/cls_u32.c
net/sched/sch_api.c
net/sunrpc/cache.c
net/sunrpc/clnt.c
net/sunrpc/rpc_pipe.c
net/sunrpc/xprt.c
net/sunrpc/xprtsock.c
net/unix/af_unix.c
net/xfrm/xfrm_policy.c
scripts/Kbuild.include
scripts/Makefile.modpost
scripts/kconfig/confdata.c
scripts/kernel-doc
scripts/mod/file2alias.c
security/dummy.c
security/selinux/hooks.c
security/selinux/ss/policydb.c
security/selinux/ss/services.c
sound/aoa/codecs/snd-aoa-codec-toonie.c
sound/aoa/core/snd-aoa-gpio-feature.c
sound/aoa/core/snd-aoa-gpio-pmf.c
sound/core/oss/mixer_oss.c
sound/core/oss/pcm_oss.c
sound/core/seq/seq_device.c
sound/core/sgbuf.c
sound/drivers/vx/vx_pcm.c
sound/oss/Kconfig
sound/pci/Kconfig
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/emu10k1/irq.c
sound/ppc/awacs.c
sound/ppc/daca.c
sound/ppc/keywest.c
sound/ppc/powermac.c
sound/ppc/tumbler.c
sound/usb/usbaudio.c
usr/Makefile

index 27fd37621255799602d74e94d670ff7a1658d40a..b1f5b9df2ae1f4eede001d7751b099d4ae34be95 100644 (file)
@@ -30,6 +30,11 @@ include/config
 include/linux/autoconf.h
 include/linux/compile.h
 include/linux/version.h
+include/linux/utsrelease.h
 
 # stgit generated dirs
 patches-*
+
+# quilt's files
+patches
+series
index 1ae4dc0fd8564db5801951997946603f0ce4a79d..f8fe882e33dccfc50f6e5add6ca89a53389d649f 100644 (file)
@@ -58,6 +58,9 @@
 !Iinclude/linux/ktime.h
 !Iinclude/linux/hrtimer.h
 !Ekernel/hrtimer.c
+     </sect1>
+     <sect1><title>Workqueues and Kevents</title>
+!Ekernel/workqueue.c
      </sect1>
      <sect1><title>Internal Functions</title>
 !Ikernel/exit.c
@@ -300,7 +303,7 @@ X!Ekernel/module.c
      </sect1>
 
      <sect1><title>Resources Management</title>
-!Ekernel/resource.c
+!Ikernel/resource.c
      </sect1>
 
      <sect1><title>MTRR Handling</title>
@@ -312,9 +315,7 @@ X!Ekernel/module.c
 !Edrivers/pci/pci-driver.c
 !Edrivers/pci/remove.c
 !Edrivers/pci/pci-acpi.c
-<!-- kerneldoc does not understand __devinit
-X!Edrivers/pci/search.c
- -->
+!Edrivers/pci/search.c
 !Edrivers/pci/msi.c
 !Edrivers/pci/bus.c
 <!-- FIXME: Removed for now since no structured comments in source
index c2c85bcb3d438b983ccc1535acbbd185867e26c3..2cd7f02ffd0b3bc874f20a99e15a82edb694c646 100644 (file)
@@ -10,7 +10,9 @@ kernel, the process can sometimes be daunting if you're not familiar
 with "the system."  This text is a collection of suggestions which
 can greatly increase the chances of your change being accepted.
 
-If you are submitting a driver, also read Documentation/SubmittingDrivers.
+Read Documentation/SubmitChecklist for a list of items to check
+before submitting code.  If you are submitting a driver, also read
+Documentation/SubmittingDrivers.
 
 
 
@@ -74,9 +76,6 @@ There are a number of scripts which can aid in this:
 Quilt:
 http://savannah.nongnu.org/projects/quilt
 
-Randy Dunlap's patch scripts:
-http://www.xenotime.net/linux/scripts/patching-scripts-002.tar.gz
-
 Andrew Morton's patch scripts:
 http://www.zip.com.au/~akpm/linux/patches/
 Instead of these scripts, quilt is the recommended patch management
@@ -484,7 +483,7 @@ Greg Kroah-Hartman "How to piss off a kernel subsystem maintainer".
   <http://www.kroah.com/log/2005/10/19/>
   <http://www.kroah.com/log/2006/01/11/>
 
-NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!.
+NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!
   <http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2>
 
 Kernel Documentation/CodingStyle
@@ -493,4 +492,3 @@ Kernel Documentation/CodingStyle
 Linus Torvald's mail on the canonical patch format:
   <http://lkml.org/lkml/2005/4/7/183>
 --
-Last updated on 17 Nov 2005.
index be215e58423b8068ac79b7f44561222195b8a3a0..1443cd71d2631241f13286e544296ef286d91c90 100644 (file)
@@ -64,11 +64,13 @@ Compile the kernel with
        CONFIG_TASK_DELAY_ACCT=y
        CONFIG_TASKSTATS=y
 
-Enable the accounting at boot time by adding
-the following to the kernel boot options
-       delayacct
+Delay accounting is enabled by default at boot up.
+To disable, add
+   nodelayacct
+to the kernel boot options. The rest of the instructions
+below assume this has not been done.
 
-and after the system has booted up, use a utility
+After the system has booted up, use a utility
 similar to  getdelays.c to access the delays
 seen by a given task or a task group (tgid).
 The utility also allows a given command to be
index 7fedc00c3d30b78688cf0693f1512234c7e00f9f..555c8cf3650a5e6bb6523b9bdc69c75b2bc94159 100644 (file)
@@ -153,10 +153,13 @@ scaling_governor,         and by "echoing" the name of another
                                that some governors won't load - they only
                                work on some specific architectures or
                                processors.
-scaling_min_freq and 
+scaling_min_freq and
 scaling_max_freq               show the current "policy limits" (in
                                kHz). By echoing new values into these
                                files, you can change these limits.
+                               NOTE: when setting a policy you need to
+                               first set scaling_max_freq, then
+                               scaling_min_freq.
 
 
 If you have selected the "userspace" governor which allows you to
index 1bcf69996c9df74fba87c25949c05285ff604d3b..bc107cb157a8bba060ce65bb9ded734bfbdd15a8 100644 (file)
@@ -251,16 +251,24 @@ A: This is what you would need in your kernel code to receive notifications.
                return NOTIFY_OK;
        }
 
-       static struct notifier_block foobar_cpu_notifer =
+       static struct notifier_block __cpuinitdata foobar_cpu_notifer =
        {
           .notifier_call = foobar_cpu_callback,
        };
 
+You need to call register_cpu_notifier() from your init function.
+Init functions could be of two types:
+1. early init (init function called when only the boot processor is online).
+2. late init (init function called _after_ all the CPUs are online).
 
-In your init function,
+For the first case, you should add the following to your init function
 
        register_cpu_notifier(&foobar_cpu_notifier);
 
+For the second case, you should add the following to your init function
+
+       register_hotcpu_notifier(&foobar_cpu_notifier);
+
 You can fail PREPARE notifiers if something doesn't work to prepare resources.
 This will stop the activity and send a following CANCELED event back.
 
index 4aaf68fafebe78fe67933fffab7fe96bfb5a8bfe..66c725f530f38b2c836f52ced2fa898c640f8db1 100644 (file)
@@ -2565,10 +2565,10 @@ Your cooperation is appreciated.
                243 = /dev/usb/dabusb3  Fourth dabusb device
 
 180 block      USB block devices
-               0 = /dev/uba            First USB block device
-               8 = /dev/ubb            Second USB block device
-               16 = /dev/ubc           Thrid USB block device
-               ...
+                 0 = /dev/uba          First USB block device
+                 8 = /dev/ubb          Second USB block device
+                16 = /dev/ubc          Third USB block device
+                   ...
 
 181 char       Conrad Electronic parallel port radio clocks
                  0 = /dev/pcfclock0    First Conrad radio clock
diff --git a/Documentation/fb/imacfb.txt b/Documentation/fb/imacfb.txt
new file mode 100644 (file)
index 0000000..7590285
--- /dev/null
@@ -0,0 +1,31 @@
+
+What is imacfb?
+===============
+
+This is a generic EFI platform driver for Intel based Apple computers.
+Imacfb is only for EFI booted Intel Macs.
+
+Supported Hardware
+==================
+
+iMac 17"/20"
+Macbook
+Macbook Pro 15"/17"
+MacMini
+
+How to use it?
+==============
+
+Imacfb does not have any kind of autodetection of your machine.
+You have to add the fillowing kernel parameters in your elilo.conf:
+       Macbook :
+               video=imacfb:macbook
+       MacMini :
+               video=imacfb:mini
+       Macbook Pro 15", iMac 17" :
+               video=imacfb:i17
+       Macbook Pro 17", iMac 20" :
+               video=imacfb:i20
+
+--
+Edgar Hucek <gimli@dark-green.com>
index 9d3a0775a11df394f3504dbd13ee60af75db4c3b..87851efb02285658f55031c390258c10c490d170 100644 (file)
@@ -258,3 +258,19 @@ Why:       These drivers never compiled since they were added to the kernel
 Who:   Jean Delvare <khali@linux-fr.org>
 
 ---------------------------
+
+What:  Bridge netfilter deferred IPv4/IPv6 output hook calling
+When:  January 2007
+Why:   The deferred output hooks are a layering violation causing unusual
+       and broken behaviour on bridge devices. Examples of things they
+       break include QoS classifation using the MARK or CLASSIFY targets,
+       the IPsec policy match and connection tracking with VLANs on a
+       bridge. Their only use is to enable bridge output port filtering
+       within iptables with the physdev match, which can also be done by
+       combining iptables and ebtables using netfilter marks. Until it
+       will get removed the hook deferral is disabled by default and is
+       only enabled when needed.
+
+Who:   Patrick McHardy <kaber@trash.net>
+
+---------------------------
index 187035560d7ff6a9817c90e824318e0dde69c5e6..864ff32837803da00c5c0d8cfde27e754216ef95 100644 (file)
@@ -51,8 +51,6 @@ Debugging Information
 
 References
 
-  IETF IP over InfiniBand (ipoib) Working Group
-    http://ietf.org/html.charters/ipoib-charter.html
   Transmission of IP over InfiniBand (IPoIB) (RFC 4391)
     http://ietf.org/rfc/rfc4391.txt 
   IP over InfiniBand (IPoIB) Architecture (RFC 4392)
index b1b6440237a6ef82fa367fdc4560e7b6d3590eb2..15f1b35deb3410932fcf5d9ef7fad28f69080408 100644 (file)
@@ -72,6 +72,22 @@ initrd adds the following new options:
     initrd is mounted as root, and the normal boot procedure is followed,
     with the RAM disk still mounted as root.
 
+Compressed cpio images
+----------------------
+
+Recent kernels have support for populating a ramdisk from a compressed cpio
+archive, on such systems, the creation of a ramdisk image doesn't need to
+involve special block devices or loopbacks, you merely create a directory on
+disk with the desired initrd content, cd to that directory, and run (as an
+example):
+
+find . | cpio --quiet -c -o | gzip -9 -n > /boot/imagefile.img
+
+Examining the contents of an existing image file is just as simple:
+
+mkdir /tmp/imagefile
+cd /tmp/imagefile
+gzip -cd /boot/imagefile.img | cpio -imd --quiet
 
 Installation
 ------------
index 14ef3868a328d5080b8748507a8e8be576c936cd..0706699c9da91c7814449f41714ee883017e0a66 100644 (file)
@@ -407,6 +407,20 @@ more details, with real examples.
        The second argument is optional, and if supplied will be used
        if first argument is not supported.
 
+    ld-option
+       ld-option is used to check if $(CC) when used to link object files
+       supports the given option.  An optional second option may be
+       specified if first option are not supported.
+
+       Example:
+               #arch/i386/kernel/Makefile
+               vsyscall-flags += $(call ld-option, -Wl$(comma)--hash-style=sysv)
+
+       In the above example vsyscall-flags will be assigned the option
+       -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
+       The second argument is optional, and if supplied will be used
+       if first argument is not supported.
+
     cc-option
        cc-option is used to check if $(CC) support a given option, and not
        supported to use an optional second option.
index e11f7728ec6f0691b940daa3d2ec5c7b182417fc..b50595a0550f7d45d46358c2156e10154e9ed67c 100644 (file)
@@ -448,8 +448,6 @@ running once the system is up.
                        Format: <area>[,<node>]
                        See also Documentation/networking/decnet.txt.
 
-       delayacct       [KNL] Enable per-task delay accounting
-
        dhash_entries=  [KNL]
                        Set number of hash buckets for dentry cache.
 
@@ -1031,6 +1029,8 @@ running once the system is up.
 
        nocache         [ARM]
 
+       nodelayacct     [KNL] Disable per-task delay accounting
+
        nodisconnect    [HW,SCSI,M68K] Disables SCSI disconnects.
 
        noexec          [IA-64]
index 8d9bffbd192cad1f2f28f396be8a4ee9a4a0f9b7..949f7b5a20538aa3537078d0eafd636df4a5991b 100644 (file)
@@ -247,7 +247,7 @@ the object-specific fields, which include:
 - default_attrs: Default attributes to be exported via sysfs when the
   object is registered.Note that the last attribute has to be
   initialized to NULL ! You can find a complete implementation
-  in drivers/block/genhd.c
+  in block/genhd.c
 
 
 Instances of struct kobj_type are not registered; only referenced by
index d46338af6002997b0593d4875a6aee825c77126f..3e0c017e78772aba2857aca4d78ac24364a1e15d 100644 (file)
@@ -294,15 +294,15 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
        Default: 87380*2 bytes.
 
 tcp_mem - vector of 3 INTEGERs: min, pressure, max
-       low: below this number of pages TCP is not bothered about its
+       min: below this number of pages TCP is not bothered about its
        memory appetite.
 
        pressure: when amount of memory allocated by TCP exceeds this number
        of pages, TCP moderates its memory consumption and enters memory
        pressure mode, which is exited when memory consumption falls
-       under "low".
+       under "min".
 
-       high: number of pages allowed for queueing by all TCP sockets.
+       max: number of pages allowed for queueing by all TCP sockets.
 
        Defaults are calculated at boot time from amount of available
        memory.
index 3c62e66e1fcc01999d939c8be8837285d6b18add..8c48b8a27b9c95a3ec4038f604d3e1ee424bdae0 100644 (file)
@@ -1196,7 +1196,7 @@ platforms are moved over to use the flattened-device-tree model.
     - model : Model of the device.  Can be "TSEC", "eTSEC", or "FEC"
     - compatible : Should be "gianfar"
     - reg : Offset and length of the register set for the device
-    - address : List of bytes representing the ethernet address of
+    - mac-address : List of bytes representing the ethernet address of
       this controller
     - interrupts : <a b> where a is the interrupt number and b is a
       field that represents an encoding of the sense and level
@@ -1216,7 +1216,7 @@ platforms are moved over to use the flattened-device-tree model.
                model = "TSEC";
                compatible = "gianfar";
                reg = <24000 1000>;
-               address = [ 00 E0 0C 00 73 00 ];
+               mac-address = [ 00 E0 0C 00 73 00 ];
                interrupts = <d 3 e 3 12 3>;
                interrupt-parent = <40000>;
                phy-handle = <2452000>
@@ -1498,7 +1498,7 @@ not necessary as they are usually the same as the root node.
                        model = "TSEC";
                        compatible = "gianfar";
                        reg = <24000 1000>;
-                       address = [ 00 E0 0C 00 73 00 ];
+                       mac-address = [ 00 E0 0C 00 73 00 ];
                        interrupts = <d 3 e 3 12 3>;
                        interrupt-parent = <40000>;
                        phy-handle = <2452000>;
@@ -1511,7 +1511,7 @@ not necessary as they are usually the same as the root node.
                        model = "TSEC";
                        compatible = "gianfar";
                        reg = <25000 1000>;
-                       address = [ 00 E0 0C 00 73 01 ];
+                       mac-address = [ 00 E0 0C 00 73 01 ];
                        interrupts = <13 3 14 3 18 3>;
                        interrupt-parent = <40000>;
                        phy-handle = <2452001>;
@@ -1524,7 +1524,7 @@ not necessary as they are usually the same as the root node.
                        model = "FEC";
                        compatible = "gianfar";
                        reg = <26000 1000>;
-                       address = [ 00 E0 0C 00 73 02 ];
+                       mac-address = [ 00 E0 0C 00 73 02 ];
                        interrupts = <19 3>;
                        interrupt-parent = <40000>;
                        phy-handle = <2452002>;
index b0c7ab93dcb92db3423690382d5d4f8fc4507849..7345c338080a6548dcaf765b7e7423431ea47cdd 100644 (file)
@@ -211,9 +211,8 @@ Controls the kernel's behaviour when an oops or BUG is encountered.
 
 0: try to continue operation
 
-1: delay a few seconds (to give klogd time to record the oops output) and
-   then panic.  If the `panic' sysctl is also non-zero then the machine will
-   be rebooted.
+1: panic immediatly.  If the `panic' sysctl is also non-zero then the
+   machine will be rebooted.
 
 ==============================================================
 
index f86550fe38ee21afc0381a991ac4e58b07426f57..22c5331260ca05bb17be0c647a7d98d595ce0cd7 100644 (file)
@@ -59,7 +59,7 @@ bind to an interface (or perhaps several) using an ioctl call.  You
 would issue more ioctls to the device to communicate to it using
 control, bulk, or other kinds of USB transfers.  The IOCTLs are
 listed in the <linux/usbdevice_fs.h> file, and at this writing the
-source code (linux/drivers/usb/devio.c) is the primary reference
+source code (linux/drivers/usb/core/devio.c) is the primary reference
 for how to access devices through those files.
 
 Note that since by default these BBB/DDD files are writable only by
index b7c324973695b5bb21a6a72cac55527f38418b1c..a7408593829feb51c205f35b5647b961a8334a24 100644 (file)
@@ -5,8 +5,7 @@ For USB help other than the readme files that are located in
 Documentation/usb/*, see the following:
 
 Linux-USB project:  http://www.linux-usb.org
-  mirrors at        http://www.suse.cz/development/linux-usb/
-         and        http://usb.in.tum.de/linux-usb/
+  mirrors at        http://usb.in.tum.de/linux-usb/
          and        http://it.linux-usb.org
 Linux USB Guide:    http://linux-usb.sourceforge.net
 Linux-USB device overview (working devices and drivers):
index 6887d44d266188c9d5d17fc267b2441cc82d8e39..6da24e7a56cba01c9b7af0a0e1c894667a614d75 100644 (file)
@@ -238,6 +238,13 @@ Debugging
   pagefaulttrace Dump all page faults. Only useful for extreme debugging
                and will create a lot of output.
 
+  call_trace=[old|both|newfallback|new]
+               old: use old inexact backtracer
+               new: use new exact dwarf2 unwinder
+               both: print entries from both
+               newfallback: use new unwinder but fall back to old if it gets
+                       stuck (default)
+
 Misc
 
   noreplacement  Don't replace instructions with more appropriate ones
index b2afc7ae965bde912209daaceaff89ed6f1c7bb2..3bab239e82fe5f50427ee59eba95bd6dfe9346c2 100644 (file)
@@ -214,6 +214,12 @@ W: http://acpi.sourceforge.net/
 T:     git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
 S:     Maintained
 
+ACPI PCI HOTPLUG DRIVER
+P:     Kristen Carlson Accardi
+M:     kristen.c.accardi@intel.com
+L:     pcihpd-discuss@lists.sourceforge.net
+S:     Maintained
+
 AD1816 SOUND DRIVER
 P:     Thorsten Knabe
 M:     Thorsten Knabe <linux@thorsten-knabe.de>
@@ -292,6 +298,13 @@ L: info-linux@geode.amd.com
 W:     http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
 S:     Supported
 
+AOA (Apple Onboard Audio) ALSA DRIVER
+P:     Johannes Berg
+M:     johannes@sipsolutions.net
+L:     linuxppc-dev@ozlabs.org
+L:     alsa-devel@alsa-project.org
+S:     Maintained
+
 APM DRIVER
 P:     Stephen Rothwell
 M:     sfr@canb.auug.org.au
@@ -876,6 +889,12 @@ M: rdunlap@xenotime.net
 T:     git http://tali.admingilde.org/git/linux-docbook.git
 S:     Maintained
 
+DOCKING STATION DRIVER
+P:     Kristen Carlson Accardi
+M:     kristen.c.accardi@intel.com
+L:     linux-acpi@vger.kernel.org
+S:     Maintained
+
 DOUBLETALK DRIVER
 P:     James R. Van Zandt
 M:     jrv@vanzandt.mv.com
@@ -968,6 +987,10 @@ P: Andrey V. Savochkin
 M:     saw@saw.sw.com.sg
 S:     Maintained
 
+EFS FILESYSTEM
+W:     http://aeschi.ch.eu.org/efs/
+S:     Orphan
+
 EMU10K1 SOUND DRIVER
 P:     James Courtier-Dutton
 M:     James@superbug.demon.co.uk
@@ -1598,7 +1621,7 @@ W:        http://jfs.sourceforge.net/
 T:     git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
 S:     Supported
 
-JOURNALLING LAYER FOR BLOCK DEVICS (JBD)
+JOURNALLING LAYER FOR BLOCK DEVICES (JBD)
 P:     Stephen Tweedie, Andrew Morton
 M:     sct@redhat.com, akpm@osdl.org
 L:     ext2-devel@lists.sourceforge.net
@@ -1642,9 +1665,8 @@ S:        Maintained
 
 KERNEL JANITORS
 P:     Several
-L:     kernel-janitors@osdl.org
+L:     kernel-janitors@lists.osdl.org
 W:     http://www.kerneljanitors.org/
-W:     http://sf.net/projects/kernel-janitor/
 S:     Maintained
 
 KERNEL NFSD
@@ -1882,6 +1904,12 @@ S:     linux-scsi@vger.kernel.org
 W:     http://megaraid.lsilogic.com
 S:     Maintained
 
+MEMORY MANAGEMENT
+L:     linux-mm@kvack.org
+L:     linux-kernel@vger.kernel.org
+W:     http://www.linux-mm.org
+S:     Maintained
+
 MEMORY TECHNOLOGY DEVICES (MTD)
 P:     David Woodhouse
 M:     dwmw2@infradead.org
@@ -2626,6 +2654,22 @@ M:       dbrownell@users.sourceforge.net
 L:     spi-devel-general@lists.sourceforge.net
 S:     Maintained
 
+STABLE BRANCH:
+P:     Greg Kroah-Hartman
+M:     greg@kroah.com
+P:     Chris Wright
+M:     chrisw@sous-sol.org
+L:     stable@kernel.org
+S:     Maintained
+
+STABLE BRANCH:
+P:     Greg Kroah-Hartman
+M:     greg@kroah.com
+P:     Chris Wright
+M:     chrisw@sous-sol.org
+L:     stable@kernel.org
+S:     Maintained
+
 TPM DEVICE DRIVER
 P:     Kylene Hall
 M:     kjhall@us.ibm.com
index 1dd58d35d72c53dc8e33623f1793bb7f58ed5401..8406d02c638501d5902595daff5b1b631186f299 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 18
-EXTRAVERSION = -rc2
+EXTRAVERSION = -rc4
 NAME=Crazed Snow-Weasel
 
 # *DOCUMENTATION*
@@ -309,9 +309,6 @@ CPPFLAGS        := -D__KERNEL__ $(LINUXINCLUDE)
 
 CFLAGS          := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                    -fno-strict-aliasing -fno-common
-# Force gcc to behave correct even for buggy distributions
-CFLAGS          += $(call cc-option, -fno-stack-protector-all \
-                                     -fno-stack-protector)
 AFLAGS          := -D__ASSEMBLY__
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@ -368,6 +365,7 @@ endif
 
 no-dot-config-targets := clean mrproper distclean \
                         cscope TAGS tags help %docs check% \
+                        include/linux/version.h headers_% \
                         kernelrelease kernelversion
 
 config-targets := 0
@@ -435,12 +433,13 @@ core-y            := usr/
 endif # KBUILD_EXTMOD
 
 ifeq ($(dot-config),1)
-# In this section, we need .config
+# Read in config
+-include include/config/auto.conf
 
+ifeq ($(KBUILD_EXTMOD),)
 # Read in dependencies to all Kconfig* files, make sure to run
 # oldconfig if changes are detected.
 -include include/config/auto.conf.cmd
--include include/config/auto.conf
 
 # To avoid any implicit rule to kick in, define an empty command
 $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
@@ -450,16 +449,27 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
 # we execute the config step to be sure to catch updated Kconfig files
 include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
-ifeq ($(KBUILD_EXTMOD),)
        $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
 else
-       $(error kernel configuration not valid - run 'make prepare' in $(srctree) to update it)
-endif
+# external modules needs include/linux/autoconf.h and include/config/auto.conf
+# but do not care if they are up-to-date. Use auto.conf to trigger the test
+PHONY += include/config/auto.conf
+
+include/config/auto.conf:
+       $(Q)test -e include/linux/autoconf.h -a -e $@ || (              \
+       echo;                                                           \
+       echo "  ERROR: Kernel configuration is invalid.";               \
+       echo "         include/linux/autoconf.h or $@ are missing.";    \
+       echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
+       echo;                                                           \
+       /bin/false)
+
+endif # KBUILD_EXTMOD
 
 else
 # Dummy target needed, because used as prerequisite
 include/config/auto.conf: ;
-endif
+endif # $(dot-config)
 
 # The all: target is the default when no target is given on the
 # command line.
@@ -473,6 +483,8 @@ else
 CFLAGS         += -O2
 endif
 
+include $(srctree)/arch/$(ARCH)/Makefile
+
 ifdef CONFIG_FRAME_POINTER
 CFLAGS         += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
 else
@@ -487,7 +499,8 @@ ifdef CONFIG_DEBUG_INFO
 CFLAGS         += -g
 endif
 
-include $(srctree)/arch/$(ARCH)/Makefile
+# Force gcc to behave correct even for buggy distributions
+CFLAGS          += $(call cc-option, -fno-stack-protector)
 
 # arch Makefile may override CC so keep this after arch Makefile is included
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
index bf52ba691957625305fec2b274d37110e98c265b..fed6b3d1b80364675b65c3b8220a834801868828 100644 (file)
@@ -274,16 +274,14 @@ ev7_process_pal_subpacket(struct el_subpacket *header)
 struct el_subpacket_handler ev7_pal_subpacket_handler =
        SUBPACKET_HANDLER_INIT(EL_CLASS__PAL, ev7_process_pal_subpacket);
 
-void 
+void
 ev7_register_error_handlers(void)
 {
        int i;
 
-       for(i = 0;
-           i<sizeof(el_ev7_pal_annotations)/sizeof(el_ev7_pal_annotations[1]);
-           i++) {
+       for (i = 0; i < ARRAY_SIZE(el_ev7_pal_annotations); i++)
                cdl_register_subpacket_annotation(&el_ev7_pal_annotations[i]);
-       }       
+
        cdl_register_subpacket_handler(&ev7_pal_subpacket_handler);
 }
 
index e15dcf4f3dcd91937bac42d364b39f742d54fce0..73c7622b529755d2d42def44da80ee335c631df7 100644 (file)
@@ -623,12 +623,12 @@ osf_sysinfo(int command, char __user *buf, long count)
        long len, err = -EINVAL;
 
        offset = command-1;
-       if (offset >= sizeof(sysinfo_table)/sizeof(char *)) {
+       if (offset >= ARRAY_SIZE(sysinfo_table)) {
                /* Digital UNIX has a few unpublished interfaces here */
                printk("sysinfo(%d)", command);
                goto out;
        }
-       
+
        down_read(&uts_sem);
        res = sysinfo_table[offset];
        len = strlen(res)+1;
index 2cb9c4380113e92e1eaa181558b105fe38a1f4eb..fd4a8fa0c93d70ac5092778fecbf32f9b16d8e6e 100644 (file)
@@ -114,8 +114,6 @@ struct alpha_machine_vector alpha_mv;
 int alpha_using_srm;
 #endif
 
-#define N(a) (sizeof(a)/sizeof(a[0]))
-
 static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long,
                                               unsigned long);
 static struct alpha_machine_vector *get_sysvec_byname(const char *);
@@ -240,7 +238,7 @@ reserve_std_resources(void)
        standard_io_resources[0].start = RTC_PORT(0);
        standard_io_resources[0].end = RTC_PORT(0) + 0x10;
 
-       for (i = 0; i < N(standard_io_resources); ++i)
+       for (i = 0; i < ARRAY_SIZE(standard_io_resources); ++i)
                request_resource(io, standard_io_resources+i);
 }
 
@@ -918,13 +916,13 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
 
        /* Search the system tables first... */
        vec = NULL;
-       if (type < N(systype_vecs)) {
+       if (type < ARRAY_SIZE(systype_vecs)) {
                vec = systype_vecs[type];
        } else if ((type > ST_API_BIAS) &&
-                  (type - ST_API_BIAS) < N(api_vecs)) {
+                  (type - ST_API_BIAS) < ARRAY_SIZE(api_vecs)) {
                vec = api_vecs[type - ST_API_BIAS];
        } else if ((type > ST_UNOFFICIAL_BIAS) &&
-                  (type - ST_UNOFFICIAL_BIAS) < N(unofficial_vecs)) {
+                  (type - ST_UNOFFICIAL_BIAS) < ARRAY_SIZE(unofficial_vecs)) {
                vec = unofficial_vecs[type - ST_UNOFFICIAL_BIAS];
        }
 
@@ -938,11 +936,11 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
 
                switch (type) {
                case ST_DEC_ALCOR:
-                       if (member < N(alcor_indices))
+                       if (member < ARRAY_SIZE(alcor_indices))
                                vec = alcor_vecs[alcor_indices[member]];
                        break;
                case ST_DEC_EB164:
-                       if (member < N(eb164_indices))
+                       if (member < ARRAY_SIZE(eb164_indices))
                                vec = eb164_vecs[eb164_indices[member]];
                        /* PC164 may show as EB164 variation with EV56 CPU,
                           but, since no true EB164 had anything but EV5... */
@@ -950,24 +948,24 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
                                vec = &pc164_mv;
                        break;
                case ST_DEC_EB64P:
-                       if (member < N(eb64p_indices))
+                       if (member < ARRAY_SIZE(eb64p_indices))
                                vec = eb64p_vecs[eb64p_indices[member]];
                        break;
                case ST_DEC_EB66:
-                       if (member < N(eb66_indices))
+                       if (member < ARRAY_SIZE(eb66_indices))
                                vec = eb66_vecs[eb66_indices[member]];
                        break;
                case ST_DEC_MARVEL:
-                       if (member < N(marvel_indices))
+                       if (member < ARRAY_SIZE(marvel_indices))
                                vec = marvel_vecs[marvel_indices[member]];
                        break;
                case ST_DEC_TITAN:
                        vec = titan_vecs[0];    /* default */
-                       if (member < N(titan_indices))
+                       if (member < ARRAY_SIZE(titan_indices))
                                vec = titan_vecs[titan_indices[member]];
                        break;
                case ST_DEC_TSUNAMI:
-                       if (member < N(tsunami_indices))
+                       if (member < ARRAY_SIZE(tsunami_indices))
                                vec = tsunami_vecs[tsunami_indices[member]];
                        break;
                case ST_DEC_1000:
@@ -1039,7 +1037,7 @@ get_sysvec_byname(const char *name)
 
        size_t i;
 
-       for (i = 0; i < N(all_vecs); ++i) {
+       for (i = 0; i < ARRAY_SIZE(all_vecs); ++i) {
                struct alpha_machine_vector *mv = all_vecs[i];
                if (strcasecmp(mv->vector_name, name) == 0)
                        return mv;
@@ -1055,13 +1053,13 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
 
        /* If not in the tables, make it UNKNOWN,
           else set type name to family */
-       if (type < N(systype_names)) {
+       if (type < ARRAY_SIZE(systype_names)) {
                *type_name = systype_names[type];
        } else if ((type > ST_API_BIAS) &&
-                  (type - ST_API_BIAS) < N(api_names)) {
+                  (type - ST_API_BIAS) < ARRAY_SIZE(api_names)) {
                *type_name = api_names[type - ST_API_BIAS];
        } else if ((type > ST_UNOFFICIAL_BIAS) &&
-                  (type - ST_UNOFFICIAL_BIAS) < N(unofficial_names)) {
+                  (type - ST_UNOFFICIAL_BIAS) < ARRAY_SIZE(unofficial_names)) {
                *type_name = unofficial_names[type - ST_UNOFFICIAL_BIAS];
        } else {
                *type_name = sys_unknown;
@@ -1083,7 +1081,7 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
        default: /* default to variation "0" for now */
                break;
        case ST_DEC_EB164:
-               if (member < N(eb164_indices))
+               if (member < ARRAY_SIZE(eb164_indices))
                        *variation_name = eb164_names[eb164_indices[member]];
                /* PC164 may show as EB164 variation, but with EV56 CPU,
                   so, since no true EB164 had anything but EV5... */
@@ -1091,32 +1089,32 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
                        *variation_name = eb164_names[1]; /* make it PC164 */
                break;
        case ST_DEC_ALCOR:
-               if (member < N(alcor_indices))
+               if (member < ARRAY_SIZE(alcor_indices))
                        *variation_name = alcor_names[alcor_indices[member]];
                break;
        case ST_DEC_EB64P:
-               if (member < N(eb64p_indices))
+               if (member < ARRAY_SIZE(eb64p_indices))
                        *variation_name = eb64p_names[eb64p_indices[member]];
                break;
        case ST_DEC_EB66:
-               if (member < N(eb66_indices))
+               if (member < ARRAY_SIZE(eb66_indices))
                        *variation_name = eb66_names[eb66_indices[member]];
                break;
        case ST_DEC_MARVEL:
-               if (member < N(marvel_indices))
+               if (member < ARRAY_SIZE(marvel_indices))
                        *variation_name = marvel_names[marvel_indices[member]];
                break;
        case ST_DEC_RAWHIDE:
-               if (member < N(rawhide_indices))
+               if (member < ARRAY_SIZE(rawhide_indices))
                        *variation_name = rawhide_names[rawhide_indices[member]];
                break;
        case ST_DEC_TITAN:
                *variation_name = titan_names[0];       /* default */
-               if (member < N(titan_indices))
+               if (member < ARRAY_SIZE(titan_indices))
                        *variation_name = titan_names[titan_indices[member]];
                break;
        case ST_DEC_TSUNAMI:
-               if (member < N(tsunami_indices))
+               if (member < ARRAY_SIZE(tsunami_indices))
                        *variation_name = tsunami_names[tsunami_indices[member]];
                break;
        }
@@ -1211,7 +1209,7 @@ show_cpuinfo(struct seq_file *f, void *slot)
 
        cpu_index = (unsigned) (cpu->type - 1);
        cpu_name = "Unknown";
-       if (cpu_index < N(cpu_names))
+       if (cpu_index < ARRAY_SIZE(cpu_names))
                cpu_name = cpu_names[cpu_index];
 
        get_sysnames(hwrpb->sys_type, hwrpb->sys_variation,
index 78c30decf3ff421844939caf51270dff81dda592..5b99cf3cd69cb3be72cf733d10f14885feb74f66 100644 (file)
@@ -182,16 +182,16 @@ static unsigned long __init
 ruffian_get_bank_size(unsigned long offset)
 {
        unsigned long bank_addr, bank, ret = 0;
-  
+
        /* Valid offsets are: 0x800, 0x840 and 0x880
           since Ruffian only uses three banks.  */
        bank_addr = (unsigned long)PYXIS_MCR + offset;
        bank = *(vulp)bank_addr;
-    
+
        /* Check BANK_ENABLE */
        if (bank & 0x01) {
                static unsigned long size[] __initdata = {
-                       0x40000000UL, /* 0x00,   1G */ 
+                       0x40000000UL, /* 0x00,   1G */
                        0x20000000UL, /* 0x02, 512M */
                        0x10000000UL, /* 0x04, 256M */
                        0x08000000UL, /* 0x06, 128M */
@@ -203,7 +203,7 @@ ruffian_get_bank_size(unsigned long offset)
                };
 
                bank = (bank & 0x1e) >> 1;
-               if (bank < sizeof(size)/sizeof(*size))
+               if (bank < ARRAY_SIZE(size))
                        ret = size[bank];
        }
 
index 50eccde2dcd8dc0ac9a00f495a454171be7faa4b..b191cc75973751d5bdfe6137596a051a1c821b13 100644 (file)
@@ -233,7 +233,7 @@ validate_cc_value(unsigned long cc)
        index = cpu->type & 0xffffffff;
 
        /* If index out of bounds, no way to validate.  */
-       if (index >= sizeof(cpu_hz)/sizeof(cpu_hz[0]))
+       if (index >= ARRAY_SIZE(cpu_hz))
                return cc;
 
        /* If index contains no data, no way to validate.  */
index f3c1ebfdd0aabaa8ec8cc87d089f9fe74ce1899f..f3e020f2227f316a754d0584a5ad0f386146d8df 100644 (file)
@@ -95,7 +95,8 @@ static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
 }
 #endif
 
-static struct irqchip gic_chip = {
+static struct irq_chip gic_chip = {
+       .name           = "GIC",
        .ack            = gic_ack_irq,
        .mask           = gic_mask_irq,
        .unmask         = gic_unmask_irq,
index 04de83f4f0088765358cfd98cfed07ade9602fd6..4e0dcaef6eb204a4a5c344d2011baadcfd64502a 100644 (file)
@@ -204,7 +204,8 @@ static void locomo_unmask_irq(unsigned int irq)
        locomo_writel(r, mapbase + LOCOMO_ICR);
 }
 
-static struct irqchip locomo_chip = {
+static struct irq_chip locomo_chip = {
+       .name   = "LOCOMO",
        .ack    = locomo_ack_irq,
        .mask   = locomo_mask_irq,
        .unmask = locomo_unmask_irq,
@@ -249,7 +250,8 @@ static void locomo_key_unmask_irq(unsigned int irq)
        locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
 }
 
-static struct irqchip locomo_key_chip = {
+static struct irq_chip locomo_key_chip = {
+       .name   = "LOCOMO-key",
        .ack    = locomo_key_ack_irq,
        .mask   = locomo_key_mask_irq,
        .unmask = locomo_key_unmask_irq,
@@ -312,7 +314,8 @@ static void locomo_gpio_unmask_irq(unsigned int irq)
        locomo_writel(r, mapbase + LOCOMO_GIE);
 }
 
-static struct irqchip locomo_gpio_chip = {
+static struct irq_chip locomo_gpio_chip = {
+       .name   = "LOCOMO-gpio",
        .ack    = locomo_gpio_ack_irq,
        .mask   = locomo_gpio_mask_irq,
        .unmask = locomo_gpio_unmask_irq,
@@ -357,7 +360,8 @@ static void locomo_lt_unmask_irq(unsigned int irq)
        locomo_writel(r, mapbase + LOCOMO_LTINT);
 }
 
-static struct irqchip locomo_lt_chip = {
+static struct irq_chip locomo_lt_chip = {
+       .name   = "LOCOMO-lt",
        .ack    = locomo_lt_ack_irq,
        .mask   = locomo_lt_mask_irq,
        .unmask = locomo_lt_unmask_irq,
@@ -418,7 +422,8 @@ static void locomo_spi_unmask_irq(unsigned int irq)
        locomo_writel(r, mapbase + LOCOMO_SPIIE);
 }
 
-static struct irqchip locomo_spi_chip = {
+static struct irq_chip locomo_spi_chip = {
+       .name   = "LOCOMO-spi",
        .ack    = locomo_spi_ack_irq,
        .mask   = locomo_spi_mask_irq,
        .unmask = locomo_spi_unmask_irq,
index 35c9a64ac14cb81ef93f6309bae4c2f88c4d6f15..4e5445cfb0ea696eff688baf7ecd364f9697fc80 100644 (file)
@@ -68,6 +68,7 @@ void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc
                rtc_time_to_tm(next_time, next);
        }
 }
+EXPORT_SYMBOL(rtc_next_alarm_time);
 
 static inline int rtc_arm_read_time(struct rtc_ops *ops, struct rtc_time *tm)
 {
index 1cdb26a47e1f3170596b373fb401714d7d574772..a331c12cead991322b10626349eeb04f7c021bd8 100644 (file)
@@ -272,7 +272,8 @@ static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
        return 0;
 }
 
-static struct irqchip sa1111_low_chip = {
+static struct irq_chip sa1111_low_chip = {
+       .name           = "SA1111-l",
        .ack            = sa1111_ack_irq,
        .mask           = sa1111_mask_lowirq,
        .unmask         = sa1111_unmask_lowirq,
@@ -368,7 +369,8 @@ static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
        return 0;
 }
 
-static struct irqchip sa1111_high_chip = {
+static struct irq_chip sa1111_high_chip = {
+       .name           = "SA1111-h",
        .ack            = sa1111_ack_irq,
        .mask           = sa1111_mask_highirq,
        .unmask         = sa1111_unmask_highirq,
index a19bc4a6196d42c9d633af005c94e206fda60b74..43d278134521a23f7d5ab9e9075d3de0e9ab6efb 100644 (file)
@@ -39,7 +39,8 @@ static void vic_unmask_irq(unsigned int irq)
        writel(1 << irq, base + VIC_INT_ENABLE);
 }
 
-static struct irqchip vic_chip = {
+static struct irq_chip vic_chip = {
+       .name   = "VIC",
        .ack    = vic_mask_irq,
        .mask   = vic_mask_irq,
        .unmask = vic_unmask_irq,
index c0de6fcd488a85d22566a7241669f67ef59f0ca0..2948b4589a8b4bc8bfea4ebb09d9c191c6a01e73 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Sun Jul  9 15:21:30 2006
+# Linux kernel version: 2.6.18-rc1-git9
+# Sat Jul 15 15:08:10 2006
 #
 CONFIG_ARM=y
 CONFIG_MMU=y
@@ -30,6 +30,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
@@ -749,7 +750,7 @@ CONFIG_VIDEO_V4L2=y
 # USB support
 #
 CONFIG_USB_ARCH_HAS_HCD=y
-# CONFIG_USB_ARCH_HAS_OHCI is not set
+CONFIG_USB_ARCH_HAS_OHCI=y
 # CONFIG_USB_ARCH_HAS_EHCI is not set
 CONFIG_USB=y
 CONFIG_USB_DEBUG=y
@@ -766,6 +767,9 @@ CONFIG_USB_DYNAMIC_MINORS=y
 # USB Host Controller Drivers
 #
 # CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
 
 #
@@ -855,6 +859,7 @@ CONFIG_USB_SERIAL_CONSOLE=y
 CONFIG_USB_SERIAL_PL2303=y
 # CONFIG_USB_SERIAL_HP4X is not set
 # CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
 # CONFIG_USB_SERIAL_TI is not set
 # CONFIG_USB_SERIAL_CYBERJACK is not set
 # CONFIG_USB_SERIAL_XIRCOM is not set
@@ -871,7 +876,7 @@ CONFIG_USB_SERIAL_PL2303=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
-# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
@@ -916,6 +921,7 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_DRV_X1205 is not set
 # CONFIG_RTC_DRV_DS1307 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
 # CONFIG_RTC_DRV_DS1672 is not set
 # CONFIG_RTC_DRV_DS1742 is not set
 # CONFIG_RTC_DRV_PCF8563 is not set
@@ -1023,7 +1029,6 @@ CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
index b9a74a741d005db9e02243e396b8a4403d4939b1..eca248d9eba44823986f1e6c30a1ffa7b8d1f77f 100644 (file)
@@ -470,7 +470,8 @@ static void ecard_irq_mask(unsigned int irqnr)
        }
 }
 
-static struct irqchip ecard_chip = {
+static struct irq_chip ecard_chip = {
+       .name   = "ECARD",
        .ack    = ecard_irq_mask,
        .mask   = ecard_irq_mask,
        .unmask = ecard_irq_unmask,
index 2242f5f7cb7ddf5f8dc02c3c78e02617e5ad3b5e..4fe386eea4b4963bf61c8c55e25a3d7ba9ab3102 100644 (file)
@@ -114,9 +114,9 @@ ENTRY(secondary_startup)
         * Use the page tables supplied from  __cpu_up.
         */
        adr     r4, __secondary_data
-       ldmia   r4, {r5, r6, r13}               @ address to jump to after
+       ldmia   r4, {r5, r7, r13}               @ address to jump to after
        sub     r4, r4, r5                      @ mmu has been enabled
-       ldr     r4, [r6, r4]                    @ get secondary_data.pgdir
+       ldr     r4, [r7, r4]                    @ get secondary_data.pgdir
        adr     lr, __enable_mmu                @ return address
        add     pc, r10, #12                    @ initialise processor
                                                @ (return control reg)
@@ -125,7 +125,7 @@ ENTRY(secondary_startup)
         * r6  = &secondary_data
         */
 ENTRY(__secondary_switched)
-       ldr     sp, [r6, #4]                    @ get secondary_data.stack
+       ldr     sp, [r7, #4]                    @ get secondary_data.stack
        mov     fp, #0
        b       secondary_start_kernel
 
index 626feeec0ade7325def132610ad99b3eb2d1dbc0..2e1bf830fe11bf0523b2e37cbefaa32d50db4d55 100644 (file)
@@ -77,6 +77,7 @@ int show_interrupts(struct seq_file *p, void *v)
                seq_printf(p, "%3d: ", i);
                for_each_present_cpu(cpu)
                        seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
+               seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-");
                seq_printf(p, "  %s", action->name);
                for (action = action->next; action; action = action->next)
                        seq_printf(p, ", %s", action->name);
index 35a052fc177aeaefbebd2ceb294805d472ac7d45..aeeed806f9915574576e5ea628562a86d8f3a7b1 100644 (file)
@@ -232,11 +232,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
        bust_spinlocks(0);
        spin_unlock_irq(&die_lock);
 
-       if (panic_on_oops) {
-               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
-               ssleep(5);
+       if (panic_on_oops)
                panic("Fatal exception");
-       }
 
        do_exit(SIGSEGV);
 }
index 5783c282ae7b3e3288160a1cab22bf4db71d8172..cec199fd67217bd171303762431843a6722354c8 100644 (file)
@@ -327,7 +327,8 @@ static int gpio_irq_type(unsigned pin, unsigned type)
        return (type == IRQT_BOTHEDGE) ? 0 : -EINVAL;
 }
 
-static struct irqchip gpio_irqchip = {
+static struct irq_chip gpio_irqchip = {
+       .name           = "GPIO",
        .mask           = gpio_irq_mask,
        .unmask         = gpio_irq_unmask,
        .set_type       = gpio_irq_type,
index 9b0911320417ae374acd055fd29dc085502c125f..c3a5e777f9f8c3753656b59a3e3c42dfc9ebc86a 100644 (file)
@@ -114,7 +114,8 @@ void at91_irq_resume(void)
 #define at91_aic_set_wake      NULL
 #endif
 
-static struct irqchip at91_aic_chip = {
+static struct irq_chip at91_aic_chip = {
+       .name           = "AIC",
        .ack            = at91_aic_mask_irq,
        .mask           = at91_aic_mask_irq,
        .unmask         = at91_aic_unmask_irq,
index 5b64d5c5b967764f8ac52dc1f46e836291b610a8..ef6ccc8993e96c2082489075cd712372006c417e 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/tty.h>
+#include <linux/screen_info.h>
 
 #include <asm/hardware/dec21285.h>
 #include <asm/io.h>
index a5de5f1da9f2e65dd0c83e99556eeed7f40807aa..2688bd82c2a242addcc62822b90b461d509ec0f3 100644 (file)
@@ -204,13 +204,15 @@ imx_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
        imx_gpio_handler(mask, irq, desc, regs);
 }
 
-static struct irqchip imx_internal_chip = {
+static struct irq_chip imx_internal_chip = {
+       .name = "MPU",
        .ack = imx_mask_irq,
        .mask = imx_mask_irq,
        .unmask = imx_unmask_irq,
 };
 
-static struct irqchip imx_gpio_chip = {
+static struct irq_chip imx_gpio_chip = {
+       .name = "GPIO",
        .ack = imx_gpio_ack_irq,
        .mask = imx_gpio_mask_irq,
        .unmask = imx_gpio_unmask_irq,
index 6d65c96ebfd2a05f988f8fde100b691e779ee4cc..191c57a3b997a8efc52b3df0934058296b033b81 100644 (file)
@@ -161,7 +161,8 @@ static void sc_unmask_irq(unsigned int irq)
        writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET);
 }
 
-static struct irqchip sc_chip = {
+static struct irq_chip sc_chip = {
+       .name   = "SC",
        .ack    = sc_mask_irq,
        .mask   = sc_mask_irq,
        .unmask = sc_unmask_irq,
index 9f55f5ae1044ffcd4e4a3080e581525646e8d639..678b6ba2b463ac020c9f9fc0edbd20dde4fcf7f3 100644 (file)
@@ -156,7 +156,8 @@ static void cic_unmask_irq(unsigned int irq)
        cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET);
 }
 
-static struct irqchip cic_chip = {
+static struct irq_chip cic_chip = {
+       .name   = "CIC",
        .ack    = cic_mask_irq,
        .mask   = cic_mask_irq,
        .unmask = cic_unmask_irq,
@@ -174,7 +175,8 @@ static void pic_unmask_irq(unsigned int irq)
        pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET);
 }
 
-static struct irqchip pic_chip = {
+static struct irq_chip pic_chip = {
+       .name   = "PIC",
        .ack    = pic_mask_irq,
        .mask   = pic_mask_irq,
        .unmask = pic_unmask_irq,
@@ -192,7 +194,8 @@ static void sic_unmask_irq(unsigned int irq)
        sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET);
 }
 
-static struct irqchip sic_chip = {
+static struct irq_chip sic_chip = {
+       .name   = "SIC",
        .ack    = sic_mask_irq,
        .mask   = sic_mask_irq,
        .unmask = sic_unmask_irq,
index d42aae6aef03c6b1aa13e26b548ab0d278c17b0d..88ac333472c872180bfae4ba3391f801dd4799e7 100644 (file)
@@ -52,7 +52,8 @@ iop321_irq_unmask (unsigned int irq)
        intctl_write(iop321_mask);
 }
 
-struct irqchip ext_chip = {
+struct irq_chip ext_chip = {
+       .name   = "IOP",
        .ack    = iop321_irq_mask,
        .mask   = iop321_irq_mask,
        .unmask = iop321_irq_unmask,
index f4d4321737a4b5a0a3614fc39912088fdcb2420c..cab11722ced21f10112ce57db2f8a83e82f5b6ed 100644 (file)
@@ -77,13 +77,15 @@ iop331_irq_unmask2(unsigned int irq)
         intctl_write1(iop331_mask1);
 }
 
-struct irqchip iop331_irqchip1 = {
+struct irq_chip iop331_irqchip1 = {
+       .name   = "IOP-1",
        .ack    = iop331_irq_mask1,
        .mask   = iop331_irq_mask1,
        .unmask = iop331_irq_unmask1,
 };
 
-struct irqchip iop331_irqchip2 = {
+struct irq_chip iop331_irqchip2 = {
+       .name   = "IOP-2",
        .ack    = iop331_irq_mask2,
        .mask   = iop331_irq_mask2,
        .unmask = iop331_irq_unmask2,
index 2d40fe1145f0d2f1f68272d3a46d99772323b463..9562177b5fe1454c680a2ed0dc151cd25dbbc503 100644 (file)
@@ -532,8 +532,6 @@ pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
        return -EIO;
 }
 
-EXPORT_SYMBOL(pci_set_dma_mask);
-EXPORT_SYMBOL(pci_set_consistent_dma_mask);
 EXPORT_SYMBOL(ixp4xx_pci_read);
 EXPORT_SYMBOL(ixp4xx_pci_write);
 
index 654e2eed81fb26d9b839dbcdbaa4c5e7eb6ed624..30f1300e0e211ef13ee660ef1ba4efdb2f7454f2 100644 (file)
@@ -107,9 +107,9 @@ static struct flash_platform_data gtwx5715_flash_data = {
        .width          = 2,
 };
 
-static struct gtw5715_flash_resource = {
+static struct resource gtwx5715_flash_resource = {
        .flags          = IORESOURCE_MEM,
-}
+};
 
 static struct platform_device gtwx5715_flash = {
        .name           = "IXP4XX-Flash",
@@ -130,9 +130,6 @@ static void __init gtwx5715_init(void)
 {
        ixp4xx_sys_init();
 
-       if (!flash_resource)
-               printk(KERN_ERR "Could not allocate flash resource\n");
-
        gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
        gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1;
 
index 2cccc27c62e4029c3c35de1b027c1a2f69d8f934..4f2ab48800a50eb6ba15f8c1a2e6b4c72af5bcd2 100644 (file)
@@ -63,7 +63,8 @@ static void kev7a400_unmask_cpld_irq (u32 irq)
        CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
 }
 
-static struct irqchip kev7a400_cpld_chip = {
+static struct irq_chip kev7a400_cpld_chip = {
+       .name   = "CPLD",
        .ack    = kev7a400_ack_cpld_irq,
        .mask   = kev7a400_mask_cpld_irq,
        .unmask = kev7a400_unmask_cpld_irq,
index 35c3606a20795f89be0567402ecf613187e5f878..a6910114b24c5d9cd4e46a299c97a0f8bfb1547a 100644 (file)
@@ -200,7 +200,8 @@ static void lh7a40x_unmask_cpld_irq (u32 irq)
        }
 }
 
-static struct irqchip lpd7a40x_cpld_chip = {
+static struct irq_chip lpd7a40x_cpld_chip = {
+       .name   = "CPLD",
        .ack    = lh7a40x_ack_cpld_irq,
        .mask   = lh7a40x_mask_cpld_irq,
        .unmask = lh7a40x_unmask_cpld_irq,
index 8535764d89ca58b63c03625749627e1731a7fafb..f9b3fe9174a5e1dadcd82f91e626f8d22270053f 100644 (file)
@@ -43,7 +43,8 @@ lh7a400_unmask_cpld_irq (u32 irq)
 }
 
 static struct
-irqchip lh7a400_cpld_chip = {
+irq_chip lh7a400_cpld_chip = {
+       .name   = "CPLD",
        .ack    = lh7a400_ack_cpld_irq,
        .mask   = lh7a400_mask_cpld_irq,
        .unmask = lh7a400_unmask_cpld_irq,
index f9fdefef6d6fbc120324ab4651980fe72ce5d723..091b2dc58d25176e673809bfdadad8e6bf6a86a2 100644 (file)
@@ -38,13 +38,15 @@ static void lh7a400_ack_gpio_irq (u32 irq)
        INTC_INTENC = (1 << irq);
 }
 
-static struct irqchip lh7a400_internal_chip = {
+static struct irq_chip lh7a400_internal_chip = {
+       .name   = "MPU",
        .ack    = lh7a400_mask_irq, /* Level triggering -> mask is ack */
        .mask   = lh7a400_mask_irq,
        .unmask = lh7a400_unmask_irq,
 };
 
-static struct irqchip lh7a400_gpio_chip = {
+static struct irq_chip lh7a400_gpio_chip = {
+       .name   = "GPIO",
        .ack    = lh7a400_ack_gpio_irq,
        .mask   = lh7a400_mask_irq,
        .unmask = lh7a400_unmask_irq,
index 2685a81454d260e79ebbcd60b4a6cd8c34721c1c..7059b983724f384dbdc2b80936ca5d6aaaa0e8da 100644 (file)
@@ -76,25 +76,29 @@ static void lh7a404_vic2_ack_gpio_irq (u32 irq)
        VIC2_INTENCLR = (1 << irq);
 }
 
-static struct irqchip lh7a404_vic1_chip = {
+static struct irq_chip lh7a404_vic1_chip = {
+       .name   = "VIC1",
        .ack    = lh7a404_vic1_mask_irq, /* Because level-triggered */
        .mask   = lh7a404_vic1_mask_irq,
        .unmask = lh7a404_vic1_unmask_irq,
 };
 
-static struct irqchip lh7a404_vic2_chip = {
+static struct irq_chip lh7a404_vic2_chip = {
+       .name   = "VIC2",
        .ack    = lh7a404_vic2_mask_irq, /* Because level-triggered */
        .mask   = lh7a404_vic2_mask_irq,
        .unmask = lh7a404_vic2_unmask_irq,
 };
 
-static struct irqchip lh7a404_gpio_vic1_chip = {
+static struct irq_chip lh7a404_gpio_vic1_chip = {
+       .name   = "GPIO-VIC1",
        .ack    = lh7a404_vic1_ack_gpio_irq,
        .mask   = lh7a404_vic1_mask_irq,
        .unmask = lh7a404_vic1_unmask_irq,
 };
 
-static struct irqchip lh7a404_gpio_vic2_chip = {
+static struct irq_chip lh7a404_gpio_vic2_chip = {
+       .name   = "GPIO-VIC2",
        .ack    = lh7a404_vic2_ack_gpio_irq,
        .mask   = lh7a404_vic2_mask_irq,
        .unmask = lh7a404_vic2_unmask_irq,
index dcb4e17b941990eabe8992680c9aa9b67afb6fd4..d6055dde646877a1d304827863ec2b06482d421a 100644 (file)
@@ -50,7 +50,8 @@ static void lh7a40x_unmask_cpld_irq (u32 irq)
        }
 }
 
-static struct irqchip lh7a40x_cpld_chip = {
+static struct irq_chip lh7a40x_cpld_chip = {
+       .name   = "CPLD",
        .ack    = lh7a40x_ack_cpld_irq,
        .mask   = lh7a40x_mask_cpld_irq,
        .unmask = lh7a40x_unmask_cpld_irq,
index 34eb79ee6e6182f480e5da181f41972b134ad3c6..efe9bfc6e55f694c7c40921e0037e09be0e663be 100644 (file)
@@ -106,14 +106,16 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc,
        }
 }
 
-static struct irqchip omap_fpga_irq_ack = {
+static struct irq_chip omap_fpga_irq_ack = {
+       .name           = "FPGA-ack",
        .ack            = fpga_mask_ack_irq,
        .mask           = fpga_mask_irq,
        .unmask         = fpga_unmask_irq,
 };
 
 
-static struct irqchip omap_fpga_irq = {
+static struct irq_chip omap_fpga_irq = {
+       .name           = "FPGA",
        .ack            = fpga_ack_irq,
        .mask           = fpga_mask_irq,
        .unmask         = fpga_unmask_irq,
index 9e039845b50e53abc25712f113b5351ee7070197..3ea140bb9ebaae5ba454ed0007ced1e9d4d6a306 100644 (file)
@@ -168,7 +168,8 @@ static struct omap_irq_bank omap1610_irq_banks[] = {
 };
 #endif
 
-static struct irqchip omap_irq_chip = {
+static struct irq_chip omap_irq_chip = {
+       .name           = "MPU",
        .ack            = omap_mask_ack_irq,
        .mask           = omap_mask_irq,
        .unmask         = omap_unmask_irq,
index 3eed6a737bf8144e69edb096c1710bae2ad8ca23..dfc3b35cc1ffaeb00f57ba31d55ab1f66797e251 100644 (file)
@@ -94,7 +94,8 @@ static void omap_mask_ack_irq(unsigned int irq)
        omap_ack_irq(irq);
 }
 
-static struct irqchip omap_irq_chip = {
+static struct irq_chip omap_irq_chip = {
+       .name   = "INTC",
        .ack    = omap_mask_ack_irq,
        .mask   = omap_mask_irq,
        .unmask = omap_unmask_irq,
index d9635ff4b10cb97bd979e7f8022dd346e929ae5e..12141e2a50cc35e1368f05b8fc10b93cb854f5bc 100644 (file)
@@ -39,7 +39,8 @@ static void pxa_unmask_low_irq(unsigned int irq)
        ICMR |= (1 << (irq + PXA_IRQ_SKIP));
 }
 
-static struct irqchip pxa_internal_chip_low = {
+static struct irq_chip pxa_internal_chip_low = {
+       .name           = "SC",
        .ack            = pxa_mask_low_irq,
        .mask           = pxa_mask_low_irq,
        .unmask         = pxa_unmask_low_irq,
@@ -61,7 +62,8 @@ static void pxa_unmask_high_irq(unsigned int irq)
        ICMR2 |= (1 << (irq - 32 + PXA_IRQ_SKIP));
 }
 
-static struct irqchip pxa_internal_chip_high = {
+static struct irq_chip pxa_internal_chip_high = {
+       .name           = "SC-hi",
        .ack            = pxa_mask_high_irq,
        .mask           = pxa_mask_high_irq,
        .unmask         = pxa_unmask_high_irq,
@@ -129,7 +131,8 @@ static void pxa_ack_low_gpio(unsigned int irq)
        GEDR0 = (1 << (irq - IRQ_GPIO0));
 }
 
-static struct irqchip pxa_low_gpio_chip = {
+static struct irq_chip pxa_low_gpio_chip = {
+       .name           = "GPIO-l",
        .ack            = pxa_ack_low_gpio,
        .mask           = pxa_mask_low_irq,
        .unmask         = pxa_unmask_low_irq,
@@ -237,7 +240,8 @@ static void pxa_unmask_muxed_gpio(unsigned int irq)
        GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
 }
 
-static struct irqchip pxa_muxed_gpio_chip = {
+static struct irq_chip pxa_muxed_gpio_chip = {
+       .name           = "GPIO",
        .ack            = pxa_ack_muxed_gpio,
        .mask           = pxa_mask_muxed_gpio,
        .unmask         = pxa_unmask_muxed_gpio,
index 1a5f5c21481e671015702edd072c595d1be3a016..12479ae26db2addc8c4bcd5f1a11a40d563f24e4 100644 (file)
@@ -68,7 +68,8 @@ static void lpd270_unmask_irq(unsigned int irq)
        __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
 }
 
-static struct irqchip lpd270_irq_chip = {
+static struct irq_chip lpd270_irq_chip = {
+       .name           = "CPLD",
        .ack            = lpd270_mask_irq,
        .mask           = lpd270_mask_irq,
        .unmask         = lpd270_unmask_irq,
index 6a9a669d60de5e90b233eadb50cccd3808f82d08..83ff5cee64d935d27396564f78721ff90b2d582b 100644 (file)
@@ -78,7 +78,8 @@ static void lubbock_unmask_irq(unsigned int irq)
        LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq));
 }
 
-static struct irqchip lubbock_irq_chip = {
+static struct irq_chip lubbock_irq_chip = {
+       .name           = "FPGA",
        .ack            = lubbock_mask_irq,
        .mask           = lubbock_mask_irq,
        .unmask         = lubbock_unmask_irq,
index 21ddf3de2f6e18e2b830bbb240b2b5ab43912097..a7e9b96f258a4b34e9a209dca6b2f7ddb69e8228 100644 (file)
@@ -64,7 +64,8 @@ static void mainstone_unmask_irq(unsigned int irq)
        MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq));
 }
 
-static struct irqchip mainstone_irq_chip = {
+static struct irq_chip mainstone_irq_chip = {
+       .name           = "FPGA",
        .ack            = mainstone_mask_irq,
        .mask           = mainstone_mask_irq,
        .unmask         = mainstone_unmask_irq,
index 4a92d6f92d6b8be1e57d7a3e50eb4752c82375c6..60641d452db33275c57d4b33adcc1caebf23cad3 100644 (file)
@@ -60,11 +60,12 @@ static struct map_desc anubis_iodesc[] __initdata = {
        .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
        .pfn            = __phys_to_pfn(0x0),
        .length         = SZ_4M,
-       .type           = MT_DEVICE
+       .type           = MT_DEVICE,
   }, {
        .virtual        = (u32)S3C24XX_VA_ISA_WORD,
        .pfn            = __phys_to_pfn(0x0),
-       .length         = SZ_4M, MT_DEVICE
+       .length         = SZ_4M,
+       .type           = MT_DEVICE,
   },
 
   /* we could possibly compress the next set down into a set of smaller tables
@@ -78,36 +79,12 @@ static struct map_desc anubis_iodesc[] __initdata = {
        .virtual        = (u32)ANUBIS_VA_CTRL1,
        .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL1),
        .length         = SZ_4K,
-       .type           = MT_DEVICE
+       .type           = MT_DEVICE,
   }, {
        .virtual        = (u32)ANUBIS_VA_CTRL2,
        .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL2),
        .length         = SZ_4K,
-       .type           =MT_DEVICE
-  },
-
-  /* IDE drives */
-
-  {
-       .virtual        = (u32)ANUBIS_IDEPRI,
-       .pfn            = __phys_to_pfn(S3C2410_CS3),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
-  }, {
-       .virtual        = (u32)ANUBIS_IDEPRIAUX,
-       .pfn            = __phys_to_pfn(S3C2410_CS3+(1<<26)),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
-  }, {
-       .virtual        = (u32)ANUBIS_IDESEC,
-       .pfn            = __phys_to_pfn(S3C2410_CS4),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
-  }, {
-       .virtual        = (u32)ANUBIS_IDESECAUX,
-       .pfn            = __phys_to_pfn(S3C2410_CS4+(1<<26)),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
+       .type           = MT_DEVICE,
   },
 };
 
@@ -126,7 +103,7 @@ static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = {
                .name           = "pclk",
                .divisor        = 1,
                .min_baud       = 0,
-               .max_baud       = 0.
+               .max_baud       = 0,
        }
 };
 
@@ -139,7 +116,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
                .ulcon       = ULCON,
                .ufcon       = UFCON,
                .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks)
+               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
        },
        [1] = {
                .hwport      = 2,
@@ -148,7 +125,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
                .ulcon       = ULCON,
                .ufcon       = UFCON,
                .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks)
+               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
        },
 };
 
@@ -162,7 +139,7 @@ static struct mtd_partition anubis_default_nand_part[] = {
        [0] = {
                .name   = "Boot Agent",
                .size   = SZ_16K,
-               .offset = 0
+               .offset = 0,
        },
        [1] = {
                .name   = "/boot",
@@ -194,21 +171,21 @@ static struct s3c2410_nand_set anubis_nand_sets[] = {
                .nr_chips       = 1,
                .nr_map         = external_map,
                .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part
+               .partitions     = anubis_default_nand_part,
        },
        [0] = {
                .name           = "chip0",
                .nr_chips       = 1,
                .nr_map         = chip0_map,
                .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part
+               .partitions     = anubis_default_nand_part,
        },
        [2] = {
                .name           = "chip1",
                .nr_chips       = 1,
                .nr_map         = chip1_map,
                .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part
+               .partitions     = anubis_default_nand_part,
        },
 };
 
@@ -313,7 +290,7 @@ static struct s3c24xx_board anubis_board __initdata = {
        .devices       = anubis_devices,
        .devices_count = ARRAY_SIZE(anubis_devices),
        .clocks        = anubis_clocks,
-       .clocks_count  = ARRAY_SIZE(anubis_clocks)
+       .clocks_count  = ARRAY_SIZE(anubis_clocks),
 };
 
 static void __init anubis_map_io(void)
index 858fd03c6bc524d978546e2e1779fa771ff492cd..e193ba69e652e2e39c0dffed700363cbecb42c54 100644 (file)
@@ -67,12 +67,12 @@ static struct map_desc osiris_iodesc[] __initdata = {
          .virtual      = (u32)OSIRIS_VA_CTRL1,
          .pfn          = __phys_to_pfn(OSIRIS_PA_CTRL1),
          .length       = SZ_16K,
-         .type         = MT_DEVICE
+         .type         = MT_DEVICE,
   }, {
          .virtual      = (u32)OSIRIS_VA_CTRL2,
          .pfn          = __phys_to_pfn(OSIRIS_PA_CTRL2),
          .length       = SZ_16K,
-         .type         = MT_DEVICE
+         .type         = MT_DEVICE,
   },
 };
 
@@ -91,7 +91,7 @@ static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = {
                .name           = "pclk",
                .divisor        = 1,
                .min_baud       = 0,
-               .max_baud       = 0.
+               .max_baud       = 0,
        }
 };
 
@@ -103,7 +103,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
                .ulcon       = ULCON,
                .ufcon       = UFCON,
                .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks)
+               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
        },
        [1] = {
                .hwport      = 1,
@@ -112,7 +112,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
                .ulcon       = ULCON,
                .ufcon       = UFCON,
                .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks)
+               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
        },
 };
 
@@ -126,7 +126,7 @@ static struct mtd_partition osiris_default_nand_part[] = {
        [0] = {
                .name   = "Boot Agent",
                .size   = SZ_16K,
-               .offset = 0
+               .offset = 0,
        },
        [1] = {
                .name   = "/boot",
@@ -158,21 +158,21 @@ static struct s3c2410_nand_set osiris_nand_sets[] = {
                .nr_chips       = 1,
                .nr_map         = external_map,
                .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
-               .partitions     = osiris_default_nand_part
+               .partitions     = osiris_default_nand_part,
        },
        [0] = {
                .name           = "chip0",
                .nr_chips       = 1,
                .nr_map         = chip0_map,
                .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
-               .partitions     = osiris_default_nand_part
+               .partitions     = osiris_default_nand_part,
        },
        [2] = {
                .name           = "chip1",
                .nr_chips       = 1,
                .nr_map         = chip1_map,
                .nr_partitions  = ARRAY_SIZE(osiris_default_nand_part),
-               .partitions     = osiris_default_nand_part
+               .partitions     = osiris_default_nand_part,
        },
 };
 
@@ -245,7 +245,7 @@ static struct s3c24xx_board osiris_board __initdata = {
        .devices       = osiris_devices,
        .devices_count = ARRAY_SIZE(osiris_devices),
        .clocks        = osiris_clocks,
-       .clocks_count  = ARRAY_SIZE(osiris_clocks)
+       .clocks_count  = ARRAY_SIZE(osiris_clocks),
 };
 
 static void __init osiris_map_io(void)
index 2891b8ca86dd40d58b570c3c6a91272859ece838..b55b90a2e8fe975faba29388a517b36cfcb400cd 100644 (file)
@@ -95,7 +95,8 @@ static int sa1100_low_gpio_wake(unsigned int irq, unsigned int on)
        return 0;
 }
 
-static struct irqchip sa1100_low_gpio_chip = {
+static struct irq_chip sa1100_low_gpio_chip = {
+       .name           = "GPIO-l",
        .ack            = sa1100_low_gpio_ack,
        .mask           = sa1100_low_gpio_mask,
        .unmask         = sa1100_low_gpio_unmask,
@@ -178,7 +179,8 @@ static int sa1100_high_gpio_wake(unsigned int irq, unsigned int on)
        return 0;
 }
 
-static struct irqchip sa1100_high_gpio_chip = {
+static struct irq_chip sa1100_high_gpio_chip = {
+       .name           = "GPIO-h",
        .ack            = sa1100_high_gpio_ack,
        .mask           = sa1100_high_gpio_mask,
        .unmask         = sa1100_high_gpio_unmask,
@@ -215,7 +217,8 @@ static int sa1100_set_wake(unsigned int irq, unsigned int on)
        return -EINVAL;
 }
 
-static struct irqchip sa1100_normal_chip = {
+static struct irq_chip sa1100_normal_chip = {
+       .name           = "SC",
        .ack            = sa1100_mask_irq,
        .mask           = sa1100_mask_irq,
        .unmask         = sa1100_unmask_irq,
index 6cb67bd3dfd3ebb159fe7f8525de67c6195303d0..b227052296cff2be019ed69e8b5b4d2c0d2931e9 100644 (file)
@@ -69,7 +69,8 @@ static irqreturn_t bogus_int(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction cascade;
 
-static struct irqchip fb_chip = {
+static struct irq_chip fb_chip = {
+       .name   = "XT-PIC",
        .ack    = shark_ack_8259A_irq,
        .mask   = shark_disable_8259A_irq,
        .unmask = shark_enable_8259A_irq,
index 86437717601512832c8f8308e0ab1df3dd686cec..c4e3f8c684795800403ba2eac98dc32dd928a7f8 100644 (file)
@@ -69,7 +69,8 @@ static void sic_unmask_irq(unsigned int irq)
        writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET);
 }
 
-static struct irqchip sic_chip = {
+static struct irq_chip sic_chip = {
+       .name   = "SIC",
        .ack    = sic_mask_irq,
        .mask   = sic_mask_irq,
        .unmask = sic_unmask_irq,
index dba7dddfe57d365a53959c74b84a7e136781c775..88a999df0ab3f59ddaf8fe6da4f942fca750895d 100644 (file)
@@ -363,7 +363,9 @@ EXPORT_SYMBOL(__ioremap);
 
 void __iounmap(void __iomem *addr)
 {
+#ifndef CONFIG_SMP
        struct vm_struct **p, *tmp;
+#endif
        unsigned int section_mapping = 0;
 
        addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr);
index 6c5f0fe578a5e220e8245809c40df9601faecc41..ab143557e6889ae7c5ff23e2e335716d6e134ef5 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/cacheflush.h>
 #include <asm/proc-fns.h>
 #include <asm/tlbflush.h>
+#include <asm/page.h>
 
 #ifndef MULTI_CPU
 EXPORT_SYMBOL(cpu_dcache_clean_area);
@@ -30,6 +31,13 @@ EXPORT_SYMBOL(__cpuc_coherent_kern_range);
 EXPORT_SYMBOL(cpu_cache);
 #endif
 
+#ifndef MULTI_USER
+EXPORT_SYMBOL(__cpu_clear_user_page);
+EXPORT_SYMBOL(__cpu_copy_user_page);
+#else
+EXPORT_SYMBOL(cpu_user);
+#endif
+
 /*
  * No module should need to touch the TLB (and currently
  * no modules do.  We export this for "loadkernel" support
index 521538671f4ce6efcaac8b645d9431c21f127467..561bff73a036ae15964e02d5356c634ce1b93324 100644 (file)
@@ -536,6 +536,11 @@ cpu_80200_name:
        .asciz  "XScale-80200"
        .size   cpu_80200_name, . - cpu_80200_name
 
+       .type   cpu_80219_name, #object
+cpu_80219_name:
+       .asciz  "XScale-80219"
+       .size   cpu_80219_name, . - cpu_80219_name
+
        .type   cpu_8032x_name, #object
 cpu_8032x_name:
        .asciz  "XScale-IOP8032x Family"
@@ -613,10 +618,33 @@ __80200_proc_info:
        .long   xscale_cache_fns
        .size   __80200_proc_info, . - __80200_proc_info
 
+       .type   __80219_proc_info,#object
+__80219_proc_info:
+       .long   0x69052e20
+       .long   0xffffffe0
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_BUFFERABLE | \
+               PMD_SECT_CACHEABLE | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
+       b       __xscale_setup
+       .long   cpu_arch_name
+       .long   cpu_elf_name
+       .long   HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
+       .long   cpu_80219_name
+       .long   xscale_processor_functions
+       .long   v4wbi_tlb_fns
+       .long   xscale_mc_user_fns
+       .long   xscale_cache_fns
+       .size   __80219_proc_info, . - __80219_proc_info
+
        .type   __8032x_proc_info,#object
 __8032x_proc_info:
        .long   0x69052420
-       .long   0xfffff5e0      @ mask should accomodate IOP80219 also
+       .long   0xffffffe0
        .long   PMD_TYPE_SECT | \
                PMD_SECT_BUFFERABLE | \
                PMD_SECT_CACHEABLE | \
index fec7970e564d443be786d21635ce464213f1d51e..cd7f973fb286618e23c1370dd56b532e9b5cbc15 100644 (file)
@@ -944,7 +944,8 @@ static void mpuio_unmask_irq(unsigned int irq)
        _set_gpio_irqenable(bank, gpio, 1);
 }
 
-static struct irqchip gpio_irq_chip = {
+static struct irq_chip gpio_irq_chip = {
+       .name           = "GPIO",
        .ack            = gpio_ack_irq,
        .mask           = gpio_mask_irq,
        .unmask         = gpio_unmask_irq,
@@ -952,10 +953,11 @@ static struct irqchip gpio_irq_chip = {
        .set_wake       = gpio_wake_enable,
 };
 
-static struct irqchip mpuio_irq_chip = {
+static struct irq_chip mpuio_irq_chip = {
+       .name   = "MPUIO",
        .ack    = mpuio_ack_irq,
        .mask   = mpuio_mask_irq,
-       .unmask = mpuio_unmask_irq
+       .unmask = mpuio_unmask_irq
 };
 
 static int initialized;
index daa75ce4b7773d374b2015edb6cc533cb1c8afa8..f71fb4a029cbf031111e7dbddc9753b5af231978 100644 (file)
@@ -672,7 +672,7 @@ config MTRR
          See <file:Documentation/mtrr.txt> for more information.
 
 config EFI
-       bool "Boot from EFI support (EXPERIMENTAL)"
+       bool "Boot from EFI support"
        depends on ACPI
        default n
        ---help---
index 1b452a1665c4ffe92a05f3a5fa80704b4e1738ec..ab98fc21a54105b7d41fed6a5c6861ed44735dad 100644 (file)
@@ -59,7 +59,8 @@ quiet_cmd_syscall = SYSCALL $@
 
 export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)
 
-vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1
+vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
+                $(call ld-option, -Wl$(comma)--hash-style=sysv)
 SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags)
 SYSCFLAGS_vsyscall-int80.so    = $(vsyscall-flags)
 
index 0db6387025ca77cb9ce81258f0ed5fdf89861512..ee003bc0e8b114ba754b4fc5f6ce70da0b206338 100644 (file)
@@ -59,7 +59,7 @@ static inline int gsi_irq_sharing(int gsi) { return gsi; }
 
 #define BAD_MADT_ENTRY(entry, end) (                                       \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
-               ((acpi_table_entry_header *)entry)->length != sizeof(*entry))
+               ((acpi_table_entry_header *)entry)->length < sizeof(*entry))
 
 #define PREFIX                 "ACPI: "
 
index 9f408eee4e6f200857fd14f7118367bb5283f028..b781b38131c06cb9237745bc1144bc4bfee609ac 100644 (file)
@@ -292,7 +292,10 @@ ENTRY(do_suspend_lowlevel)
        pushl   $3
        call    acpi_enter_sleep_state
        addl    $4, %esp
-       ret
+
+#      In case of S3 failure, we'll emerge here.  Jump
+#      to ret_point to recover
+       jmp     ret_point
        .p2align 4,,7
 ret_point:
        call    restore_registers
index e44a4c6a4fe516ab46730348024f210a28257f73..ccc1edff5c9710f73cf08f6a40300464e4287f02 100644 (file)
@@ -96,6 +96,7 @@ config X86_POWERNOW_K8_ACPI
 
 config X86_GX_SUSPMOD
        tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"
+       depends on PCI
        help
         This add the CPUFreq driver for NatSemi Geode processors which
         support suspend modulation.
@@ -202,7 +203,7 @@ config X86_LONGRUN
 config X86_LONGHAUL
        tristate "VIA Cyrix III Longhaul"
        select CPU_FREQ_TABLE
-       depends on BROKEN
+       depends on ACPI_PROCESSOR
        help
          This adds the CPUFreq driver for VIA Samuel/CyrixIII,
          VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T
index 567b39bea07e4fbbe091b265b010905e3d30ff5a..efb41e81351ce5c9e47ffceba31a03c0daa85166 100644 (file)
@@ -384,8 +384,7 @@ static int acpi_cpufreq_early_init_acpi(void)
        }
 
        /* Do initialization in ACPI core */
-       acpi_processor_preregister_performance(acpi_perf_data);
-       return 0;
+       return acpi_processor_preregister_performance(acpi_perf_data);
 }
 
 static int
index 146f607e9c44addc0e5cbb3856b2763cadd46173..4f2c3aeef724cf18e7647338650c0f2a3a7508f7 100644 (file)
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
 #include <linux/string.h>
-#include <linux/pci.h>
 
 #include <asm/msr.h>
 #include <asm/timex.h>
 #include <asm/io.h>
+#include <asm/acpi.h>
+#include <linux/acpi.h>
+#include <acpi/processor.h>
 
 #include "longhaul.h"
 
@@ -56,6 +58,8 @@ static int minvid, maxvid;
 static unsigned int minmult, maxmult;
 static int can_scale_voltage;
 static int vrmrev;
+static struct acpi_processor *pr = NULL;
+static struct acpi_processor_cx *cx = NULL;
 
 /* Module parameters */
 static int dont_scale_voltage;
@@ -118,84 +122,65 @@ static int longhaul_get_cpu_mult(void)
        return eblcr_table[invalue];
 }
 
+/* For processor with BCR2 MSR */
 
-static void do_powersaver(union msr_longhaul *longhaul,
-                       unsigned int clock_ratio_index)
+static void do_longhaul1(int cx_address, unsigned int clock_ratio_index)
 {
-       struct pci_dev *dev;
-       unsigned long flags;
-       unsigned int tmp_mask;
-       int version;
-       int i;
-       u16 pci_cmd;
-       u16 cmd_state[64];
+       union msr_bcr2 bcr2;
+       u32 t;
 
-       switch (cpu_model) {
-       case CPU_EZRA_T:
-               version = 3;
-               break;
-       case CPU_NEHEMIAH:
-               version = 0xf;
-               break;
-       default:
-               return;
-       }
+       rdmsrl(MSR_VIA_BCR2, bcr2.val);
+       /* Enable software clock multiplier */
+       bcr2.bits.ESOFTBF = 1;
+       bcr2.bits.CLOCKMUL = clock_ratio_index;
 
-       rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
-       longhaul->bits.SoftBusRatio = clock_ratio_index & 0xf;
-       longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
-       longhaul->bits.EnableSoftBusRatio = 1;
-       longhaul->bits.RevisionKey = 0;
+       /* Sync to timer tick */
+       safe_halt();
+       ACPI_FLUSH_CPU_CACHE();
+       /* Change frequency on next halt or sleep */
+       wrmsrl(MSR_VIA_BCR2, bcr2.val);
+       /* Invoke C3 */
+       inb(cx_address);
+       /* Dummy op - must do something useless after P_LVL3 read */
+       t = inl(acpi_fadt.xpm_tmr_blk.address);
+
+       /* Disable software clock multiplier */
+       local_irq_disable();
+       rdmsrl(MSR_VIA_BCR2, bcr2.val);
+       bcr2.bits.ESOFTBF = 0;
+       wrmsrl(MSR_VIA_BCR2, bcr2.val);
+}
 
-       preempt_disable();
-       local_irq_save(flags);
+/* For processor with Longhaul MSR */
 
-       /*
-        * get current pci bus master state for all devices
-        * and clear bus master bit
-        */
-       dev = NULL;
-       i = 0;
-       do {
-               dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
-               if (dev != NULL) {
-                       pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);
-                       cmd_state[i++] = pci_cmd;
-                       pci_cmd &= ~PCI_COMMAND_MASTER;
-                       pci_write_config_word(dev, PCI_COMMAND, pci_cmd);
-               }
-       } while (dev != NULL);
+static void do_powersaver(int cx_address, unsigned int clock_ratio_index)
+{
+       union msr_longhaul longhaul;
+       u32 t;
 
-       tmp_mask=inb(0x21);     /* works on C3. save mask. */
-       outb(0xFE,0x21);        /* TMR0 only */
-       outb(0xFF,0x80);        /* delay */
+       rdmsrl(MSR_VIA_LONGHAUL, longhaul.val);
+       longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
+       longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
+       longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
+       longhaul.bits.EnableSoftBusRatio = 1;
 
+       /* Sync to timer tick */
        safe_halt();
-       wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
-       halt();
-
+       ACPI_FLUSH_CPU_CACHE();
+       /* Change frequency on next halt or sleep */
+       wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
+       /* Invoke C3 */
+       inb(cx_address);
+       /* Dummy op - must do something useless after P_LVL3 read */
+       t = inl(acpi_fadt.xpm_tmr_blk.address);
+
+       /* Disable bus ratio bit */
        local_irq_disable();
-
-       outb(tmp_mask,0x21);    /* restore mask */
-
-       /* restore pci bus master state for all devices */
-       dev = NULL;
-       i = 0;
-       do {
-               dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
-               if (dev != NULL) {
-                       pci_cmd = cmd_state[i++];
-                       pci_write_config_byte(dev, PCI_COMMAND, pci_cmd);
-               }
-       } while (dev != NULL);
-       local_irq_restore(flags);
-       preempt_enable();
-
-       /* disable bus ratio bit */
-       rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
-       longhaul->bits.EnableSoftBusRatio = 0;
-       longhaul->bits.RevisionKey = version;
-       wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
+       longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
+       longhaul.bits.EnableSoftBusRatio = 0;
+       longhaul.bits.EnableSoftBSEL = 0;
+       longhaul.bits.EnableSoftVID = 0;
+       wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
 }
 
 /**
@@ -209,9 +194,9 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
 {
        int speed, mult;
        struct cpufreq_freqs freqs;
-       union msr_longhaul longhaul;
-       union msr_bcr2 bcr2;
        static unsigned int old_ratio=-1;
+       unsigned long flags;
+       unsigned int pic1_mask, pic2_mask;
 
        if (old_ratio == clock_ratio_index)
                return;
@@ -234,6 +219,20 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
        dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
                        fsb, mult/10, mult%10, print_speed(speed/1000));
 
+       preempt_disable();
+       local_irq_save(flags);
+
+       pic2_mask = inb(0xA1);
+       pic1_mask = inb(0x21);  /* works on C3. save mask. */
+       outb(0xFF,0xA1);        /* Overkill */
+       outb(0xFE,0x21);        /* TMR0 only */
+
+       /* Disable bus master arbitration */
+       if (pr->flags.bm_check) {
+               acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,
+                                 ACPI_MTX_DO_NOT_LOCK);
+       }
+
        switch (longhaul_version) {
 
        /*
@@ -245,20 +244,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
         */
        case TYPE_LONGHAUL_V1:
        case TYPE_LONGHAUL_V2:
-               rdmsrl (MSR_VIA_BCR2, bcr2.val);
-               /* Enable software clock multiplier */
-               bcr2.bits.ESOFTBF = 1;
-               bcr2.bits.CLOCKMUL = clock_ratio_index;
-               local_irq_disable();
-               wrmsrl (MSR_VIA_BCR2, bcr2.val);
-               safe_halt();
-
-               /* Disable software clock multiplier */
-               rdmsrl (MSR_VIA_BCR2, bcr2.val);
-               bcr2.bits.ESOFTBF = 0;
-               local_irq_disable();
-               wrmsrl (MSR_VIA_BCR2, bcr2.val);
-               local_irq_enable();
+               do_longhaul1(cx->address, clock_ratio_index);
                break;
 
        /*
@@ -273,10 +259,22 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
         * to work in practice.
         */
        case TYPE_POWERSAVER:
-               do_powersaver(&longhaul, clock_ratio_index);
+               do_powersaver(cx->address, clock_ratio_index);
                break;
        }
 
+       /* Enable bus master arbitration */
+       if (pr->flags.bm_check) {
+               acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,
+                                 ACPI_MTX_DO_NOT_LOCK);
+       }
+
+       outb(pic2_mask,0xA1);   /* restore mask */
+       outb(pic1_mask,0x21);
+
+       local_irq_restore(flags);
+       preempt_enable();
+
        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 }
 
@@ -324,9 +322,11 @@ static int guess_fsb(void)
 static int __init longhaul_get_ranges(void)
 {
        unsigned long invalue;
-       unsigned int multipliers[32]= {
-               50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65,
-               -1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 };
+       unsigned int ezra_t_multipliers[32]= {
+                       90,  30,  40, 100,  55,  35,  45,  95,
+                       50,  70,  80,  60, 120,  75,  85,  65,
+                       -1, 110, 120,  -1, 135, 115, 125, 105,
+                       130, 150, 160, 140,  -1, 155,  -1, 145 };
        unsigned int j, k = 0;
        union msr_longhaul longhaul;
        unsigned long lo, hi;
@@ -355,13 +355,13 @@ static int __init longhaul_get_ranges(void)
                        invalue = longhaul.bits.MaxMHzBR;
                        if (longhaul.bits.MaxMHzBR4)
                                invalue += 16;
-                       maxmult=multipliers[invalue];
+                       maxmult=ezra_t_multipliers[invalue];
 
                        invalue = longhaul.bits.MinMHzBR;
                        if (longhaul.bits.MinMHzBR4 == 1)
                                minmult = 30;
                        else
-                               minmult = multipliers[invalue];
+                               minmult = ezra_t_multipliers[invalue];
                        fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];
                        break;
                }
@@ -527,6 +527,18 @@ static unsigned int longhaul_get(unsigned int cpu)
        return calc_speed(longhaul_get_cpu_mult());
 }
 
+static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
+                                         u32 nesting_level,
+                                         void *context, void **return_value)
+{
+       struct acpi_device *d;
+
+       if ( acpi_bus_get_device(obj_handle, &d) ) {
+               return 0;
+       }
+       *return_value = (void *)acpi_driver_data(d);
+       return 1;
+}
 
 static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
 {
@@ -534,6 +546,15 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
        char *cpuname=NULL;
        int ret;
 
+       /* Check ACPI support for C3 state */
+       acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
+                        &longhaul_walk_callback, NULL, (void *)&pr);
+       if (pr == NULL) goto err_acpi;
+
+       cx = &pr->power.states[ACPI_STATE_C3];
+       if (cx->address == 0 || cx->latency > 1000) goto err_acpi;
+
+       /* Now check what we have on this motherboard */
        switch (c->x86_model) {
        case 6:
                cpu_model = CPU_SAMUEL;
@@ -634,6 +655,10 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
        cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu);
 
        return 0;
+
+err_acpi:
+       printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n");
+       return -ENODEV;
 }
 
 static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy)
@@ -666,6 +691,18 @@ static int __init longhaul_init(void)
        if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6)
                return -ENODEV;
 
+#ifdef CONFIG_SMP
+       if (num_online_cpus() > 1) {
+               return -ENODEV;
+               printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n");
+       }
+#endif
+#ifdef CONFIG_X86_IO_APIC
+       if (cpu_has_apic) {
+               printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n");
+               return -ENODEV;
+       }
+#endif
        switch (c->x86_model) {
        case 6 ... 9:
                return cpufreq_register_driver(&longhaul_driver);
@@ -699,6 +736,6 @@ MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
 MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");
 MODULE_LICENSE ("GPL");
 
-module_init(longhaul_init);
+late_initcall(longhaul_init);
 module_exit(longhaul_exit);
 
index e9f0b928b0a9925e534ddeadb3c868493240df58..5c43be47587f5d4b9875e4c45070027cdb829d95 100644 (file)
@@ -759,7 +759,7 @@ static int __cpuinit cache_sysfs_init(void)
        if (num_cache_leaves == 0)
                return 0;
 
-       register_cpu_notifier(&cacheinfo_cpu_notifier);
+       register_hotcpu_notifier(&cacheinfo_cpu_notifier);
 
        for_each_online_cpu(i) {
                cacheinfo_cpu_callback(&cacheinfo_cpu_notifier, CPU_ONLINE,
index dc2416dfef151271ba8d15d206564a0d8cf56fec..84fd4cf7d0fb11e4396c981f0319af9d85b4dc5f 100644 (file)
@@ -9,6 +9,6 @@ void winchip_mcheck_init(struct cpuinfo_x86 *c);
 /* Call the installed machine check handler for this CPU setup. */
 extern fastcall void (*machine_check_vector)(struct pt_regs *, long error_code);
 
-extern int mce_disabled __initdata;
+extern int mce_disabled;
 extern int nr_mce_banks;
 
index d9a260f2efb4d24086bf7ee4c1e8e1ab7eaf8c5e..37a7d2eaf4a006608a8321647b96e7323c05e998 100644 (file)
@@ -204,7 +204,7 @@ VM_MASK             = 0x00020000
 ENTRY(ret_from_fork)
        CFI_STARTPROC
        pushl %eax
-       CFI_ADJUST_CFA_OFFSET -4
+       CFI_ADJUST_CFA_OFFSET 4
        call schedule_tail
        GET_THREAD_INFO(%ebp)
        popl %eax
index de2e16e561c06796d62efe9191b0c388e4d93a83..afe6505ca0b3a78af53db084d60574540ea7361d 100644 (file)
@@ -256,11 +256,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
        int ret = 0;
        kprobe_opcode_t *addr;
        struct kprobe_ctlblk *kcb;
-#ifdef CONFIG_PREEMPT
-       unsigned pre_preempt_count = preempt_count();
-#else
-       unsigned pre_preempt_count = 1;
-#endif
 
        addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
 
@@ -338,13 +333,15 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
                return 1;
 
 ss_probe:
-       if (pre_preempt_count && p->ainsn.boostable == 1 && !p->post_handler){
+#ifndef CONFIG_PREEMPT
+       if (p->ainsn.boostable == 1 && !p->post_handler){
                /* Boost up -- we can execute copied instructions directly */
                reset_current_kprobe();
                regs->eip = (unsigned long)p->ainsn.insn;
                preempt_enable_no_resched();
                return 1;
        }
+#endif
        prepare_singlestep(p, regs);
        kcb->kprobe_status = KPROBE_HIT_SS;
        return 1;
index 511abe52a94e861a2ad2051dd72e072a131db30c..6b1ae6ba76f0d15421f9aee87747a9192da1f4db 100644 (file)
@@ -189,14 +189,11 @@ NORET_TYPE void machine_kexec(struct kimage *image)
        memcpy((void *)reboot_code_buffer, relocate_new_kernel,
                                                relocate_new_kernel_size);
 
-       /* The segment registers are funny things, they are
-        * automatically loaded from a table, in memory wherever you
-        * set them to a specific selector, but this table is never
-        * accessed again you set the segment to a different selector.
-        *
-        * The more common model is are caches where the behide
-        * the scenes work is done, but is also dropped at arbitrary
-        * times.
+       /* The segment registers are funny things, they have both a
+        * visible and an invisible part.  Whenever the visible part is
+        * set to a specific selector, the invisible part is loaded
+        * with from a table in memory.  At no other time is the
+        * descriptor table in memory accessed.
         *
         * I take advantage of this here by force loading the
         * segments, before I zap the gdt with an invalid value.
index 2dd928a84645c53f34c69391c1966cb5ff8e9614..acb351478e42b9f5e4693de4ca6d5786d2ed8f37 100644 (file)
@@ -575,6 +575,7 @@ void touch_nmi_watchdog (void)
         */
        touch_softlockup_watchdog();
 }
+EXPORT_SYMBOL(touch_nmi_watchdog);
 
 extern void die_nmi(struct pt_regs *, const char *msg);
 
index 923bb292f47fbc91ac978777ab69eafc28a2535c..8657c739656a37bbcef81cb36accb486902cf5d1 100644 (file)
@@ -690,8 +690,8 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
        /*
         * Now maybe handle debug registers and/or IO bitmaps
         */
-       if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW))
-           || test_tsk_thread_flag(prev_p, TIF_IO_BITMAP))
+       if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)
+           || test_tsk_thread_flag(prev_p, TIF_IO_BITMAP)))
                __switch_to_xtra(next_p, tss);
 
        disable_tsc(prev_p, next_p);
index 6f5fea05f1d7fc92a80e66819962cf4ee269086f..f948419c888a85905aa768f1aaeaf0c5378ca910 100644 (file)
@@ -212,14 +212,20 @@ valid_k7:
  * then we print a warning if not, and always resync.
  */
 
-static atomic_t tsc_start_flag = ATOMIC_INIT(0);
-static atomic_t tsc_count_start = ATOMIC_INIT(0);
-static atomic_t tsc_count_stop = ATOMIC_INIT(0);
-static unsigned long long tsc_values[NR_CPUS];
+static struct {
+       atomic_t start_flag;
+       atomic_t count_start;
+       atomic_t count_stop;
+       unsigned long long values[NR_CPUS];
+} tsc __initdata = {
+       .start_flag = ATOMIC_INIT(0),
+       .count_start = ATOMIC_INIT(0),
+       .count_stop = ATOMIC_INIT(0),
+};
 
 #define NR_LOOPS 5
 
-static void __init synchronize_tsc_bp (void)
+static void __init synchronize_tsc_bp(void)
 {
        int i;
        unsigned long long t0;
@@ -233,7 +239,7 @@ static void __init synchronize_tsc_bp (void)
        /* convert from kcyc/sec to cyc/usec */
        one_usec = cpu_khz / 1000;
 
-       atomic_set(&tsc_start_flag, 1);
+       atomic_set(&tsc.start_flag, 1);
        wmb();
 
        /*
@@ -250,16 +256,16 @@ static void __init synchronize_tsc_bp (void)
                /*
                 * all APs synchronize but they loop on '== num_cpus'
                 */
-               while (atomic_read(&tsc_count_start) != num_booting_cpus()-1)
+               while (atomic_read(&tsc.count_start) != num_booting_cpus()-1)
                        cpu_relax();
-               atomic_set(&tsc_count_stop, 0);
+               atomic_set(&tsc.count_stop, 0);
                wmb();
                /*
                 * this lets the APs save their current TSC:
                 */
-               atomic_inc(&tsc_count_start);
+               atomic_inc(&tsc.count_start);
 
-               rdtscll(tsc_values[smp_processor_id()]);
+               rdtscll(tsc.values[smp_processor_id()]);
                /*
                 * We clear the TSC in the last loop:
                 */
@@ -269,56 +275,54 @@ static void __init synchronize_tsc_bp (void)
                /*
                 * Wait for all APs to leave the synchronization point:
                 */
-               while (atomic_read(&tsc_count_stop) != num_booting_cpus()-1)
+               while (atomic_read(&tsc.count_stop) != num_booting_cpus()-1)
                        cpu_relax();
-               atomic_set(&tsc_count_start, 0);
+               atomic_set(&tsc.count_start, 0);
                wmb();
-               atomic_inc(&tsc_count_stop);
+               atomic_inc(&tsc.count_stop);
        }
 
        sum = 0;
        for (i = 0; i < NR_CPUS; i++) {
                if (cpu_isset(i, cpu_callout_map)) {
-                       t0 = tsc_values[i];
+                       t0 = tsc.values[i];
                        sum += t0;
                }
        }
        avg = sum;
        do_div(avg, num_booting_cpus());
 
-       sum = 0;
        for (i = 0; i < NR_CPUS; i++) {
                if (!cpu_isset(i, cpu_callout_map))
                        continue;
-               delta = tsc_values[i] - avg;
+               delta = tsc.values[i] - avg;
                if (delta < 0)
                        delta = -delta;
                /*
                 * We report bigger than 2 microseconds clock differences.
                 */
                if (delta > 2*one_usec) {
-                       long realdelta;
+                       long long realdelta;
+
                        if (!buggy) {
                                buggy = 1;
                                printk("\n");
                        }
                        realdelta = delta;
                        do_div(realdelta, one_usec);
-                       if (tsc_values[i] < avg)
+                       if (tsc.values[i] < avg)
                                realdelta = -realdelta;
 
-                       if (realdelta > 0)
-                               printk(KERN_INFO "CPU#%d had %ld usecs TSC "
+                       if (realdelta)
+                               printk(KERN_INFO "CPU#%d had %Ld usecs TSC "
                                        "skew, fixed it up.\n", i, realdelta);
                }
-
-               sum += delta;
        }
        if (!buggy)
                printk("passed.\n");
 }
 
-static void __init synchronize_tsc_ap (void)
+static void __init synchronize_tsc_ap(void)
 {
        int i;
 
@@ -327,20 +331,20 @@ static void __init synchronize_tsc_ap (void)
         * this gets called, so we first wait for the BP to
         * finish SMP initialization:
         */
-       while (!atomic_read(&tsc_start_flag))
+       while (!atomic_read(&tsc.start_flag))
                cpu_relax();
 
        for (i = 0; i < NR_LOOPS; i++) {
-               atomic_inc(&tsc_count_start);
-               while (atomic_read(&tsc_count_start) != num_booting_cpus())
+               atomic_inc(&tsc.count_start);
+               while (atomic_read(&tsc.count_start) != num_booting_cpus())
                        cpu_relax();
 
-               rdtscll(tsc_values[smp_processor_id()]);
+               rdtscll(tsc.values[smp_processor_id()]);
                if (i == NR_LOOPS-1)
                        write_tsc(0, 0);
 
-               atomic_inc(&tsc_count_stop);
-               while (atomic_read(&tsc_count_stop) != num_booting_cpus())
+               atomic_inc(&tsc.count_stop);
+               while (atomic_read(&tsc.count_stop) != num_booting_cpus())
                        cpu_relax();
        }
 }
index 8705c0f0578881afafb5af2e80337f347bfad5ec..edd00f6cee377715fdc6e73e411d0e2c8fed2026 100644 (file)
@@ -135,7 +135,7 @@ unsigned long profile_pc(struct pt_regs *regs)
 {
        unsigned long pc = instruction_pointer(regs);
 
-       if (in_lock_functions(pc))
+       if (!user_mode_vm(regs) && in_lock_functions(pc))
                return *(unsigned long *)(regs->ebp + 4);
 
        return pc;
index 313ac1f7dc5aaf88795748554118a8d9e393f83f..82e0fd02af1c5b7dcaf92a98c76899684e77b85b 100644 (file)
@@ -187,10 +187,21 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
                        if (unwind_init_blocked(&info, task) == 0)
                                unw_ret = show_trace_unwind(&info, log_lvl);
                }
-               if (unw_ret > 0) {
-                       if (call_trace > 0)
+               if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
+#ifdef CONFIG_STACK_UNWIND
+                       print_symbol("DWARF2 unwinder stuck at %s\n",
+                                    UNW_PC(&info));
+                       if (call_trace == 1) {
+                               printk("Leftover inexact backtrace:\n");
+                               if (UNW_SP(&info))
+                                       stack = (void *)UNW_SP(&info);
+                       } else if (call_trace > 1)
                                return;
-                       printk("%sLegacy call trace:\n", log_lvl);
+                       else
+                               printk("Full inexact backtrace again:\n");
+#else
+                       printk("Inexact backtrace:\n");
+#endif
                }
        }
 
@@ -442,11 +453,9 @@ void die(const char * str, struct pt_regs * regs, long err)
        if (in_interrupt())
                panic("Fatal exception in interrupt");
 
-       if (panic_on_oops) {
-               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
-               ssleep(5);
+       if (panic_on_oops)
                panic("Fatal exception");
-       }
+
        oops_exit();
        do_exit(SIGSEGV);
 }
@@ -1238,8 +1247,10 @@ static int __init call_trace_setup(char *s)
                call_trace = -1;
        else if (strcmp(s, "both") == 0)
                call_trace = 0;
-       else if (strcmp(s, "new") == 0)
+       else if (strcmp(s, "newfallback") == 0)
                call_trace = 1;
+       else if (strcmp(s, "new") == 2)
+               call_trace = 2;
        return 1;
 }
 __setup("call_trace=", call_trace_setup);
index e26975fc68b650105cbff7b0568ba7b856770085..f66cd11adb7211e211f6d78f2ad063e0701ce832 100644 (file)
@@ -10,6 +10,7 @@ SECTIONS
   . = VDSO_PRELINK + SIZEOF_HEADERS;
 
   .hash           : { *(.hash) }               :text
+  .gnu.hash       : { *(.gnu.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
index 9ea35398e10d0b9a28d43152d274a3b40dd05258..0f14a82b856e500b72aa4277ddea084ae242a8f7 100644 (file)
@@ -363,7 +363,7 @@ CONFIG_BLK_DEV_IDECD=y
 #
 CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_IDEPCI=y
-# CONFIG_IDEPCI_SHARE_IRQ is not set
+CONFIG_IDEPCI_SHARE_IRQ=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 # CONFIG_BLK_DEV_GENERIC is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
index 6cba55da572a0bb28c6399142765df87aeeb4b96..9001b3fbaa3244c53a535fc62e23adef893a7166 100644 (file)
@@ -366,7 +366,7 @@ CONFIG_BLK_DEV_IDESCSI=m
 # CONFIG_IDE_GENERIC is not set
 # CONFIG_BLK_DEV_IDEPNP is not set
 CONFIG_BLK_DEV_IDEPCI=y
-# CONFIG_IDEPCI_SHARE_IRQ is not set
+CONFIG_IDEPCI_SHARE_IRQ=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
index a3fe97531134127d060ef257fa794291dad8d545..8a4f0d0d17a35fafcf6ebb72a40c622f280e33f7 100644 (file)
@@ -151,7 +151,7 @@ static void
 simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset)
 {
        int list_len = sc->use_sg;
-       struct scatterlist *sl = (struct scatterlist *)sc->buffer;
+       struct scatterlist *sl = (struct scatterlist *)sc->request_buffer;
        struct disk_stat stat;
        struct disk_req req;
 
@@ -244,7 +244,7 @@ static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
 
        if (scatterlen == 0)
                memcpy(sc->request_buffer, buf, len);
-       else for (slp = (struct scatterlist *)sc->buffer; scatterlen-- > 0 && len > 0; slp++) {
+       else for (slp = (struct scatterlist *)sc->request_buffer; scatterlen-- > 0 && len > 0; slp++) {
                unsigned thislen = min(len, slp->length);
 
                memcpy(page_address(slp->page) + slp->offset, buf, thislen);
index 0e4553f320bffd4a812401f0cae3836f63d88c7d..ad8215a3c586948f3cf92c2e6c80f31a5ff36aa5 100644 (file)
@@ -45,7 +45,8 @@ CPPFLAGS_gate.lds := -P -C -U$(ARCH)
 quiet_cmd_gate = GATE $@
       cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@
 
-GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1
+GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
+                    $(call ld-option, -Wl$(comma)--hash-style=sysv)
 $(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
        $(call if_changed,gate)
 
index 99761b81db4496a78c0ea1eb0cb1076c438c8c3c..0176556aeeccbf28fa6c14a9c99f07f51750d9ae 100644 (file)
@@ -55,7 +55,7 @@
 
 #define BAD_MADT_ENTRY(entry, end) (                                        \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
-               ((acpi_table_entry_header *)entry)->length != sizeof(*entry))
+               ((acpi_table_entry_header *)entry)->length < sizeof(*entry))
 
 #define PREFIX                 "ACPI: "
 
index e4bfa9dafbcebf88e2d815cd30197ee82eceeb28..bb8770a177b5f3c6eac55a11e83ac9cbc9d389e9 100644 (file)
@@ -632,7 +632,7 @@ kern_memory_descriptor (unsigned long phys_addr)
                if (phys_addr - md->start < (md->num_pages << EFI_PAGE_SHIFT))
                         return md;
        }
-       return 0;
+       return NULL;
 }
 
 static efi_memory_desc_t *
@@ -652,7 +652,7 @@ efi_memory_descriptor (unsigned long phys_addr)
                if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT))
                         return md;
        }
-       return 0;
+       return NULL;
 }
 
 u32
@@ -923,7 +923,7 @@ find_memmap_space (void)
 void
 efi_memmap_init(unsigned long *s, unsigned long *e)
 {
-       struct kern_memdesc *k, *prev = 0;
+       struct kern_memdesc *k, *prev = NULL;
        u64     contig_low=0, contig_high=0;
        u64     as, ae, lim;
        void *efi_map_start, *efi_map_end, *p, *q;
index cc35cddfd4cfdd8e047ed30b06ef6e87f7f5c7e2..6d198339bf85446d2f47d1bf7a2b5e9731dffbbb 100644 (file)
@@ -12,6 +12,7 @@ SECTIONS
   . = GATE_ADDR + SIZEOF_HEADERS;
 
   .hash                                : { *(.hash) }                          :readable
+  .gnu.hash                    : { *(.gnu.hash) }
   .dynsym                      : { *(.dynsym) }
   .dynstr                      : { *(.dynstr) }
   .gnu.version                 : { *(.gnu.version) }
index 561b8f1d3bc7dbb62c05f41494f856b199afe2ab..29236f0c62b5ea20f9597c1e159175c884ef32e2 100644 (file)
@@ -853,7 +853,6 @@ END(__ia64_init_fpu)
  */
 GLOBAL_ENTRY(ia64_switch_mode_phys)
  {
-       alloc r2=ar.pfs,0,0,0,0
        rsm psr.i | psr.ic              // disable interrupts and interrupt collection
        mov r15=ip
  }
@@ -902,7 +901,6 @@ END(ia64_switch_mode_phys)
  */
 GLOBAL_ENTRY(ia64_switch_mode_virt)
  {
-       alloc r2=ar.pfs,0,0,0,0
        rsm psr.i | psr.ic              // disable interrupts and interrupt collection
        mov r15=ip
  }
index b7cf651ceb14538eb5c1d7e424f8de41746fd533..3ead20fb6f4b2f45d7ec6f6bee19f82a3d4364af 100644 (file)
@@ -62,7 +62,7 @@ EXPORT_SYMBOL(__udivdi3);
 EXPORT_SYMBOL(__moddi3);
 EXPORT_SYMBOL(__umoddi3);
 
-#if defined(CONFIG_MD_RAID5) || defined(CONFIG_MD_RAID5_MODULE)
+#if defined(CONFIG_MD_RAID456) || defined(CONFIG_MD_RAID456_MODULE)
 extern void xor_ia64_2(void);
 extern void xor_ia64_3(void);
 extern void xor_ia64_4(void);
index 00d9c83b80205dd43669b6e5d87f4a882cf3bbce..781960f80b6f12c2d7c8be375157086c3b16a72d 100644 (file)
@@ -448,11 +448,20 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
        return 0;
 }
 
+void __kprobes flush_insn_slot(struct kprobe *p)
+{
+       unsigned long arm_addr;
+
+       arm_addr = ((unsigned long)&p->opcode.bundle) & ~0xFULL;
+       flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
+}
+
 void __kprobes arch_arm_kprobe(struct kprobe *p)
 {
        unsigned long addr = (unsigned long)p->addr;
        unsigned long arm_addr = addr & ~0xFULL;
 
+       flush_insn_slot(p);
        memcpy((char *)arm_addr, &p->ainsn.insn.bundle, sizeof(bundle_t));
        flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
 }
index 5018c7f2e7a898b01f4e6213e7681de11f9ff67a..ebaf1e685f5e350312bf72f3efbcb47288f58f1e 100644 (file)
@@ -217,12 +217,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
        .body
        ;;
        ld8 loc2 = [loc2]               // loc2 <- entry point
-       mov out0 = in0          // first argument
-       mov out1 = in1          // copy arg2
-       mov out2 = in2          // copy arg3
-       mov out3 = in3          // copy arg3
-       ;;
-       mov loc3 = psr          // save psr
+       mov loc3 = psr                  // save psr
        ;;
        mov loc4=ar.rsc                 // save RSE configuration
        dep.z loc2=loc2,0,61            // convert pal entry point to physical
@@ -236,18 +231,23 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
        ;;
        andcm r16=loc3,r16              // removes bits to clear from psr
        br.call.sptk.many rp=ia64_switch_mode_phys
-.ret6:
+
+       mov out0 = in0                  // first argument
+       mov out1 = in1                  // copy arg2
+       mov out2 = in2                  // copy arg3
+       mov out3 = in3                  // copy arg3
        mov loc5 = r19
        mov loc6 = r20
+
        br.call.sptk.many rp=b7         // now make the call
-.ret7:
+
        mov ar.rsc=0                    // put RSE in enforced lazy, LE mode
        mov r16=loc3                    // r16= original psr
        mov r19=loc5
        mov r20=loc6
        br.call.sptk.many rp=ia64_switch_mode_virt      // return to virtual mode
 
-.ret8: mov psr.l  = loc3               // restore init PSR
+       mov psr.l  = loc3               // restore init PSR
        mov ar.pfs = loc1
        mov rp = loc0
        ;;
index 3f5bac59209a501fa7b9278f5ed4681567f417ee..0b546e2b36ac61c113b73ada6e98775a30294e25 100644 (file)
@@ -566,29 +566,23 @@ version_info(char *page)
        pal_version_u_t min_ver, cur_ver;
        char *p = page;
 
-       /* The PAL_VERSION call is advertised as being able to support
-        * both physical and virtual mode calls. This seems to be a documentation
-        * bug rather than firmware bug. In fact, it does only support physical mode.
-        * So now the code reflects this fact and the pal_version() has been updated
-        * accordingly.
-        */
-       if (ia64_pal_version(&min_ver, &cur_ver) != 0) return 0;
+       if (ia64_pal_version(&min_ver, &cur_ver) != 0)
+               return 0;
 
        p += sprintf(p,
                     "PAL_vendor : 0x%02x (min=0x%02x)\n"
-                    "PAL_A      : %x.%x.%x (min=%x.%x.%x)\n"
-                    "PAL_B      : %x.%x.%x (min=%x.%x.%x)\n",
-                    cur_ver.pal_version_s.pv_pal_vendor, min_ver.pal_version_s.pv_pal_vendor,
-
-                    cur_ver.pal_version_s.pv_pal_a_model>>4,
-                    cur_ver.pal_version_s.pv_pal_a_model&0xf, cur_ver.pal_version_s.pv_pal_a_rev,
-                    min_ver.pal_version_s.pv_pal_a_model>>4,
-                    min_ver.pal_version_s.pv_pal_a_model&0xf, min_ver.pal_version_s.pv_pal_a_rev,
-
-                    cur_ver.pal_version_s.pv_pal_b_model>>4,
-                    cur_ver.pal_version_s.pv_pal_b_model&0xf, cur_ver.pal_version_s.pv_pal_b_rev,
-                    min_ver.pal_version_s.pv_pal_b_model>>4,
-                    min_ver.pal_version_s.pv_pal_b_model&0xf, min_ver.pal_version_s.pv_pal_b_rev);
+                    "PAL_A      : %02x.%02x (min=%02x.%02x)\n"
+                    "PAL_B      : %02x.%02x (min=%02x.%02x)\n",
+                    cur_ver.pal_version_s.pv_pal_vendor,
+                    min_ver.pal_version_s.pv_pal_vendor,
+                    cur_ver.pal_version_s.pv_pal_a_model,
+                    cur_ver.pal_version_s.pv_pal_a_rev,
+                    min_ver.pal_version_s.pv_pal_a_model,
+                    min_ver.pal_version_s.pv_pal_a_rev,
+                    cur_ver.pal_version_s.pv_pal_b_model,
+                    cur_ver.pal_version_s.pv_pal_b_rev,
+                    min_ver.pal_version_s.pv_pal_b_model,
+                    min_ver.pal_version_s.pv_pal_b_rev);
        return p - page;
 }
 
@@ -958,9 +952,9 @@ remove_palinfo_proc_entries(unsigned int hcpu)
        }
 }
 
-static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
-                                                               unsigned long action,
-                                                               void *hcpu)
+#ifdef CONFIG_HOTPLUG_CPU
+static int palinfo_cpu_callback(struct notifier_block *nfb,
+                                       unsigned long action, void *hcpu)
 {
        unsigned int hotcpu = (unsigned long)hcpu;
 
@@ -968,20 +962,19 @@ static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
        case CPU_ONLINE:
                create_palinfo_proc_entries(hotcpu);
                break;
-#ifdef CONFIG_HOTPLUG_CPU
        case CPU_DEAD:
                remove_palinfo_proc_entries(hotcpu);
                break;
-#endif
        }
        return NOTIFY_OK;
 }
 
-static struct notifier_block __cpuinitdata palinfo_cpu_notifier =
+static struct notifier_block palinfo_cpu_notifier =
 {
        .notifier_call = palinfo_cpu_callback,
        .priority = 0,
 };
+#endif
 
 static int __init
 palinfo_init(void)
@@ -1020,7 +1013,7 @@ palinfo_exit(void)
        /*
         * Unregister from cpu notifier callbacks
         */
-       unregister_cpu_notifier(&palinfo_cpu_notifier);
+       unregister_hotcpu_notifier(&palinfo_cpu_notifier);
 }
 
 module_init(palinfo_init);
index b146f1cfad3141e240fac9297de3bfc67f75286a..d24fa393b18210603fbaadbfa2934e060c2702ba 100644 (file)
@@ -435,7 +435,7 @@ static int __cpuinit cache_sysfs_init(void)
                                (void *)(long)i);
        }
 
-       register_cpu_notifier(&cache_cpu_notifier);
+       register_hotcpu_notifier(&cache_cpu_notifier);
 
        return 0;
 }
index e7bbb0f40aa20eacb9b07431f360fbd456cc91e1..fffa9e0826bc3b8eab092da56ead23c7349d27b6 100644 (file)
@@ -117,11 +117,8 @@ die (const char *str, struct pt_regs *regs, long err)
        die.lock_owner = -1;
        spin_unlock_irq(&die.lock);
 
-       if (panic_on_oops) {
-               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
-               ssleep(5);
+       if (panic_on_oops)
                panic("Fatal exception");
-       }
 
        do_exit(SIGSEGV);
 }
index 5f03b9e524dd2ab78bdb368afe0994efbc4af9d9..4c73a67636692cad28d089e3f491c61b0353c611 100644 (file)
 
 extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *);
 
-#define MAX_UNCACHED_GRANULES  5
-static int allocated_granules;
+struct uncached_pool {
+       struct gen_pool *pool;
+       struct mutex add_chunk_mutex;   /* serialize adding a converted chunk */
+       int nchunks_added;              /* #of converted chunks added to pool */
+       atomic_t status;                /* smp called function's return status*/
+};
+
+#define MAX_CONVERTED_CHUNKS_PER_NODE  2
 
-struct gen_pool *uncached_pool[MAX_NUMNODES];
+struct uncached_pool uncached_pools[MAX_NUMNODES];
 
 
 static void uncached_ipi_visibility(void *data)
 {
        int status;
+       struct uncached_pool *uc_pool = (struct uncached_pool *)data;
 
        status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
        if ((status != PAL_VISIBILITY_OK) &&
            (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
-               printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "
-                      "CPU %i\n", status, raw_smp_processor_id());
+               atomic_inc(&uc_pool->status);
 }
 
 
 static void uncached_ipi_mc_drain(void *data)
 {
        int status;
+       struct uncached_pool *uc_pool = (struct uncached_pool *)data;
 
        status = ia64_pal_mc_drain();
-       if (status)
-               printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "
-                      "CPU %i\n", status, raw_smp_processor_id());
+       if (status != PAL_STATUS_SUCCESS)
+               atomic_inc(&uc_pool->status);
 }
 
 
@@ -70,21 +76,34 @@ static void uncached_ipi_mc_drain(void *data)
  * This is accomplished by first allocating a granule of cached memory pages
  * and then converting them to uncached memory pages.
  */
-static int uncached_add_chunk(struct gen_pool *pool, int nid)
+static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid)
 {
        struct page *page;
-       int status, i;
+       int status, i, nchunks_added = uc_pool->nchunks_added;
        unsigned long c_addr, uc_addr;
 
-       if (allocated_granules >= MAX_UNCACHED_GRANULES)
+       if (mutex_lock_interruptible(&uc_pool->add_chunk_mutex) != 0)
+               return -1;      /* interrupted by a signal */
+
+       if (uc_pool->nchunks_added > nchunks_added) {
+               /* someone added a new chunk while we were waiting */
+               mutex_unlock(&uc_pool->add_chunk_mutex);
+               return 0;
+       }
+
+       if (uc_pool->nchunks_added >= MAX_CONVERTED_CHUNKS_PER_NODE) {
+               mutex_unlock(&uc_pool->add_chunk_mutex);
                return -1;
+       }
 
        /* attempt to allocate a granule's worth of cached memory pages */
 
        page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO,
                                IA64_GRANULE_SHIFT-PAGE_SHIFT);
-       if (!page)
+       if (!page) {
+               mutex_unlock(&uc_pool->add_chunk_mutex);
                return -1;
+       }
 
        /* convert the memory pages from cached to uncached */
 
@@ -102,11 +121,14 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
        flush_tlb_kernel_range(uc_addr, uc_adddr + IA64_GRANULE_SIZE);
 
        status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
-       if (!status) {
-               status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
-               if (status)
+       if (status == PAL_VISIBILITY_OK_REMOTE_NEEDED) {
+               atomic_set(&uc_pool->status, 0);
+               status = smp_call_function(uncached_ipi_visibility, uc_pool,
+                                          0, 1);
+               if (status || atomic_read(&uc_pool->status))
                        goto failed;
-       }
+       } else if (status != PAL_VISIBILITY_OK)
+               goto failed;
 
        preempt_disable();
 
@@ -120,20 +142,24 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
 
        preempt_enable();
 
-       ia64_pal_mc_drain();
-       status = smp_call_function(uncached_ipi_mc_drain, NULL, 0, 1);
-       if (status)
+       status = ia64_pal_mc_drain();
+       if (status != PAL_STATUS_SUCCESS)
+               goto failed;
+       atomic_set(&uc_pool->status, 0);
+       status = smp_call_function(uncached_ipi_mc_drain, uc_pool, 0, 1);
+       if (status || atomic_read(&uc_pool->status))
                goto failed;
 
        /*
         * The chunk of memory pages has been converted to uncached so now we
         * can add it to the pool.
         */
-       status = gen_pool_add(pool, uc_addr, IA64_GRANULE_SIZE, nid);
+       status = gen_pool_add(uc_pool->pool, uc_addr, IA64_GRANULE_SIZE, nid);
        if (status)
                goto failed;
 
-       allocated_granules++;
+       uc_pool->nchunks_added++;
+       mutex_unlock(&uc_pool->add_chunk_mutex);
        return 0;
 
        /* failed to convert or add the chunk so give it back to the kernel */
@@ -142,6 +168,7 @@ failed:
                ClearPageUncached(&page[i]);
 
        free_pages(c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT);
+       mutex_unlock(&uc_pool->add_chunk_mutex);
        return -1;
 }
 
@@ -158,7 +185,7 @@ failed:
 unsigned long uncached_alloc_page(int starting_nid)
 {
        unsigned long uc_addr;
-       struct gen_pool *pool;
+       struct uncached_pool *uc_pool;
        int nid;
 
        if (unlikely(starting_nid >= MAX_NUMNODES))
@@ -171,14 +198,14 @@ unsigned long uncached_alloc_page(int starting_nid)
        do {
                if (!node_online(nid))
                        continue;
-               pool = uncached_pool[nid];
-               if (pool == NULL)
+               uc_pool = &uncached_pools[nid];
+               if (uc_pool->pool == NULL)
                        continue;
                do {
-                       uc_addr = gen_pool_alloc(pool, PAGE_SIZE);
+                       uc_addr = gen_pool_alloc(uc_pool->pool, PAGE_SIZE);
                        if (uc_addr != 0)
                                return uc_addr;
-               } while (uncached_add_chunk(pool, nid) == 0);
+               } while (uncached_add_chunk(uc_pool, nid) == 0);
 
        } while ((nid = (nid + 1) % MAX_NUMNODES) != starting_nid);
 
@@ -197,7 +224,7 @@ EXPORT_SYMBOL(uncached_alloc_page);
 void uncached_free_page(unsigned long uc_addr)
 {
        int nid = paddr_to_nid(uc_addr - __IA64_UNCACHED_OFFSET);
-       struct gen_pool *pool = uncached_pool[nid];
+       struct gen_pool *pool = uncached_pools[nid].pool;
 
        if (unlikely(pool == NULL))
                return;
@@ -224,7 +251,7 @@ static int __init uncached_build_memmap(unsigned long uc_start,
                                        unsigned long uc_end, void *arg)
 {
        int nid = paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET);
-       struct gen_pool *pool = uncached_pool[nid];
+       struct gen_pool *pool = uncached_pools[nid].pool;
        size_t size = uc_end - uc_start;
 
        touch_softlockup_watchdog();
@@ -242,7 +269,8 @@ static int __init uncached_init(void)
        int nid;
 
        for_each_online_node(nid) {
-               uncached_pool[nid] = gen_pool_create(PAGE_SHIFT, nid);
+               uncached_pools[nid].pool = gen_pool_create(PAGE_SHIFT, nid);
+               mutex_init(&uncached_pools[nid].add_chunk_mutex);
        }
 
        efi_memmap_walk_uc(uncached_build_memmap, NULL);
index d8536a2c22a9cd0b7ce42a608c403d3108c7c918..38fa6e49e791a0789c2c57ecf584744c29862fce 100644 (file)
@@ -14,7 +14,7 @@ lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o                        \
 lib-$(CONFIG_ITANIUM)  += copy_page.o copy_user.o memcpy.o
 lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
 lib-$(CONFIG_PERFMON)  += carta_random.o
-lib-$(CONFIG_MD_RAID5) += xor.o
+lib-$(CONFIG_MD_RAID456)       += xor.o
 
 AFLAGS___divdi3.o      =
 AFLAGS___udivdi3.o     = -DUNSIGNED
index 2a88cdd6d92493e5e8af300e62daa4e162879491..e004143ba86b7f22ce19d8a002a3cbd944b94c7a 100644 (file)
@@ -27,6 +27,7 @@
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
 static unsigned long num_dma_physpages;
+static unsigned long max_gap;
 #endif
 
 /**
@@ -45,9 +46,15 @@ show_mem (void)
 
        printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
        i = max_mapnr;
-       while (i-- > 0) {
-               if (!pfn_valid(i))
+       for (i = 0; i < max_mapnr; i++) {
+               if (!pfn_valid(i)) {
+#ifdef CONFIG_VIRTUAL_MEM_MAP
+                       if (max_gap < LARGE_GAP)
+                               continue;
+                       i = vmemmap_find_next_valid_pfn(0, i) - 1;
+#endif
                        continue;
+               }
                total++;
                if (PageReserved(mem_map+i))
                        reserved++;
@@ -234,7 +241,6 @@ paging_init (void)
        unsigned long zones_size[MAX_NR_ZONES];
 #ifdef CONFIG_VIRTUAL_MEM_MAP
        unsigned long zholes_size[MAX_NR_ZONES];
-       unsigned long max_gap;
 #endif
 
        /* initialize mem_map[] */
@@ -266,7 +272,6 @@ paging_init (void)
                }
        }
 
-       max_gap = 0;
        efi_memmap_walk(find_largest_hole, (u64 *)&max_gap);
        if (max_gap < LARGE_GAP) {
                vmem_map = (struct page *) 0;
@@ -277,7 +282,8 @@ paging_init (void)
 
                /* allocate virtual_mem_map */
 
-               map_size = PAGE_ALIGN(max_low_pfn * sizeof(struct page));
+               map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
+                       sizeof(struct page));
                vmalloc_end -= map_size;
                vmem_map = (struct page *) vmalloc_end;
                efi_memmap_walk(create_mem_map_page_table, NULL);
index 99bd9e30db9694979522b86c0b768cbf7cc6839a..d260bffa01ab9ffd5949eec9f411554dc84ae9a7 100644 (file)
@@ -534,68 +534,6 @@ void __cpuinit *per_cpu_init(void)
 }
 #endif /* CONFIG_SMP */
 
-#ifdef CONFIG_VIRTUAL_MEM_MAP
-static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
-{
-       unsigned long end_address, hole_next_pfn;
-       unsigned long stop_address;
-
-       end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
-       end_address = PAGE_ALIGN(end_address);
-
-       stop_address = (unsigned long) &vmem_map[
-               pgdat->node_start_pfn + pgdat->node_spanned_pages];
-
-       do {
-               pgd_t *pgd;
-               pud_t *pud;
-               pmd_t *pmd;
-               pte_t *pte;
-
-               pgd = pgd_offset_k(end_address);
-               if (pgd_none(*pgd)) {
-                       end_address += PGDIR_SIZE;
-                       continue;
-               }
-
-               pud = pud_offset(pgd, end_address);
-               if (pud_none(*pud)) {
-                       end_address += PUD_SIZE;
-                       continue;
-               }
-
-               pmd = pmd_offset(pud, end_address);
-               if (pmd_none(*pmd)) {
-                       end_address += PMD_SIZE;
-                       continue;
-               }
-
-               pte = pte_offset_kernel(pmd, end_address);
-retry_pte:
-               if (pte_none(*pte)) {
-                       end_address += PAGE_SIZE;
-                       pte++;
-                       if ((end_address < stop_address) &&
-                           (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
-                               goto retry_pte;
-                       continue;
-               }
-               /* Found next valid vmem_map page */
-               break;
-       } while (end_address < stop_address);
-
-       end_address = min(end_address, stop_address);
-       end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
-       hole_next_pfn = end_address / sizeof(struct page);
-       return hole_next_pfn - pgdat->node_start_pfn;
-}
-#else
-static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
-{
-       return i + 1;
-}
-#endif
-
 /**
  * show_mem - give short summary of memory stats
  *
@@ -625,7 +563,8 @@ void show_mem(void)
                        if (pfn_valid(pgdat->node_start_pfn + i))
                                page = pfn_to_page(pgdat->node_start_pfn + i);
                        else {
-                               i = find_next_valid_pfn_for_pgdat(pgdat, i) - 1;
+                               i = vmemmap_find_next_valid_pfn(pgdat->node_id,
+                                        i) - 1;
                                continue;
                        }
                        if (PageReserved(page))
@@ -751,7 +690,8 @@ void __init paging_init(void)
        efi_memmap_walk(filter_rsvd_memory, count_node_pages);
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
-       vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page));
+       vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
+               sizeof(struct page));
        vmem_map = (struct page *) vmalloc_end;
        efi_memmap_walk(create_mem_map_page_table, NULL);
        printk("Virtual mem_map starts at 0x%p\n", vmem_map);
index 2f50c064513c248f1a739d8891dd21509f7a474a..30617ccb4f7e69bc5e412dbc63aae8405e1a8691 100644 (file)
@@ -415,6 +415,61 @@ ia64_mmu_init (void *my_cpu_data)
 }
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
+int vmemmap_find_next_valid_pfn(int node, int i)
+{
+       unsigned long end_address, hole_next_pfn;
+       unsigned long stop_address;
+       pg_data_t *pgdat = NODE_DATA(node);
+
+       end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
+       end_address = PAGE_ALIGN(end_address);
+
+       stop_address = (unsigned long) &vmem_map[
+               pgdat->node_start_pfn + pgdat->node_spanned_pages];
+
+       do {
+               pgd_t *pgd;
+               pud_t *pud;
+               pmd_t *pmd;
+               pte_t *pte;
+
+               pgd = pgd_offset_k(end_address);
+               if (pgd_none(*pgd)) {
+                       end_address += PGDIR_SIZE;
+                       continue;
+               }
+
+               pud = pud_offset(pgd, end_address);
+               if (pud_none(*pud)) {
+                       end_address += PUD_SIZE;
+                       continue;
+               }
+
+               pmd = pmd_offset(pud, end_address);
+               if (pmd_none(*pmd)) {
+                       end_address += PMD_SIZE;
+                       continue;
+               }
+
+               pte = pte_offset_kernel(pmd, end_address);
+retry_pte:
+               if (pte_none(*pte)) {
+                       end_address += PAGE_SIZE;
+                       pte++;
+                       if ((end_address < stop_address) &&
+                           (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
+                               goto retry_pte;
+                       continue;
+               }
+               /* Found next valid vmem_map page */
+               break;
+       } while (end_address < stop_address);
+
+       end_address = min(end_address, stop_address);
+       end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
+       hole_next_pfn = end_address / sizeof(struct page);
+       return hole_next_pfn - pgdat->node_start_pfn;
+}
 
 int __init
 create_mem_map_page_table (u64 start, u64 end, void *arg)
index 07bd02b6c3724fc8a2979413971fc3ec48fd61da..4280c074d64e69e28badb70de4c9050f0524b986 100644 (file)
@@ -32,7 +32,7 @@ ioremap (unsigned long offset, unsigned long size)
         */
        attr = kern_mem_attribute(offset, size);
        if (attr & EFI_MEMORY_WB)
-               return phys_to_virt(offset);
+               return (void __iomem *) phys_to_virt(offset);
        else if (attr & EFI_MEMORY_UC)
                return __ioremap(offset, size);
 
@@ -43,7 +43,7 @@ ioremap (unsigned long offset, unsigned long size)
        gran_base = GRANULEROUNDDOWN(offset);
        gran_size = GRANULEROUNDUP(offset + size) - gran_base;
        if (efi_mem_attribute(gran_base, gran_size) & EFI_MEMORY_WB)
-               return phys_to_virt(offset);
+               return (void __iomem *) phys_to_virt(offset);
 
        return __ioremap(offset, size);
 }
@@ -53,7 +53,7 @@ void __iomem *
 ioremap_nocache (unsigned long offset, unsigned long size)
 {
        if (kern_mem_attribute(offset, size) & EFI_MEMORY_WB)
-               return 0;
+               return NULL;
 
        return __ioremap(offset, size);
 }
index 99b123a6421ad9541288b81f2148dfd9403161a4..5e8e59efb34726a209829a0b3ebd63d867d0eb29 100644 (file)
@@ -480,7 +480,7 @@ xpc_activating(void *__partid)
        partid_t partid = (u64) __partid;
        struct xpc_partition *part = &xpc_partitions[partid];
        unsigned long irq_flags;
-       struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 };
+       struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
        int ret;
 
 
index 17cd342848868866583ceec4725b2aa5f13045c9..af7171adcd2c1e83a912871e9114cf9bdc5c216c 100644 (file)
@@ -74,7 +74,7 @@ tioce_mmr_war_pre(struct tioce_kernel *kern, void *mmr_addr)
                else
                        mmr_war_offset = 0x158;
 
-               readq_relaxed((void *)(mmr_base + mmr_war_offset));
+               readq_relaxed((void __iomem *)(mmr_base + mmr_war_offset));
        }
 }
 
@@ -92,8 +92,8 @@ tioce_mmr_war_post(struct tioce_kernel *kern, void *mmr_addr)
 
        if (mmr_offset < 0x45000) {
                if (mmr_offset == 0x100)
-                       readq_relaxed((void *)(mmr_base + 0x38));
-               readq_relaxed((void *)(mmr_base + 0xb050));
+                       readq_relaxed((void __iomem *)(mmr_base + 0x38));
+               readq_relaxed((void __iomem *)(mmr_base + 0xb050));
        }
 }
 
index 9989495a51dd64e8c026c88c20fec99fc9dc2ae0..b3677fc8eef597fb9f4ebeb6fda0249e4a48f5f2 100644 (file)
@@ -204,6 +204,7 @@ SECTIONS
        *(.dynstr)
        *(.dynamic)
        *(.hash)
+       *(.gnu.hash)
 #endif
        }
 
index 2643dbc3f289428ef46d836705e93e386904dafe..abb325eb8f757e60283110d03e99fc49c2c81e4e 100644 (file)
@@ -504,7 +504,7 @@ config CPU_FREQ_PMAC
 
 config CPU_FREQ_PMAC64
        bool "Support for some Apple G5s"
-       depends on CPU_FREQ && PMAC_SMU && PPC64
+       depends on CPU_FREQ && PPC64
        select CPU_FREQ_TABLE
        help
          This adds support for frequency switching on Apple iMac G5,
@@ -836,9 +836,10 @@ config MCA
        bool
 
 config PCI
-       bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) \
-                                 || MPC7448HPC2
-       default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !PPC_85xx && !PPC_86xx
+       bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
+               || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) || MPC7448HPC2
+       default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \
+               && !PPC_85xx && !PPC_86xx
        default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
        default PCI_QSPAN if !4xx && !CPM2 && 8xx
        help
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
new file mode 100644 (file)
index 0000000..f0c7731
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * MPC8641 HPCN Device Tree Source
+ *
+ * Copyright 2006 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+
+/ {
+       model = "MPC8641HPCN";
+       compatible = "mpc86xx";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #cpus = <2>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,8641@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       d-cache-line-size = <20>;       // 32 bytes
+                       i-cache-line-size = <20>;       // 32 bytes
+                       d-cache-size = <8000>;          // L1, 32K
+                       i-cache-size = <8000>;          // L1, 32K
+                       timebase-frequency = <0>;       // 33 MHz, from uboot
+                       bus-frequency = <0>;            // From uboot
+                       clock-frequency = <0>;          // From uboot
+                       32-bit;
+                       linux,boot-cpu;
+               };
+               PowerPC,8641@1 {
+                       device_type = "cpu";
+                       reg = <1>;
+                       d-cache-line-size = <20>;       // 32 bytes
+                       i-cache-line-size = <20>;       // 32 bytes
+                       d-cache-size = <8000>;          // L1, 32K
+                       i-cache-size = <8000>;          // L1, 32K
+                       timebase-frequency = <0>;       // 33 MHz, from uboot
+                       bus-frequency = <0>;            // From uboot
+                       clock-frequency = <0>;          // From uboot
+                       32-bit;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <00000000 40000000>;      // 1G at 0x0
+       };
+
+       soc8641@f8000000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               #interrupt-cells = <2>;
+               device_type = "soc";
+               ranges = <0 f8000000 00100000>;
+               reg = <f8000000 00100000>;      // CCSRBAR 1M
+               bus-frequency = <0>;
+
+               i2c@3000 {
+                       device_type = "i2c";
+                       compatible = "fsl-i2c";
+                       reg = <3000 100>;
+                       interrupts = <2b 2>;
+                       interrupt-parent = <40000>;
+                       dfsrr;
+               };
+
+               i2c@3100 {
+                       device_type = "i2c";
+                       compatible = "fsl-i2c";
+                       reg = <3100 100>;
+                       interrupts = <2b 2>;
+                       interrupt-parent = <40000>;
+                       dfsrr;
+               };
+
+               mdio@24520 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       device_type = "mdio";
+                       compatible = "gianfar";
+                       reg = <24520 20>;
+                       linux,phandle = <24520>;
+                       ethernet-phy@0 {
+                               linux,phandle = <2452000>;
+                               interrupt-parent = <40000>;
+                               interrupts = <4a 1>;
+                               reg = <0>;
+                               device_type = "ethernet-phy";
+                       };
+                       ethernet-phy@1 {
+                               linux,phandle = <2452001>;
+                               interrupt-parent = <40000>;
+                               interrupts = <4a 1>;
+                               reg = <1>;
+                               device_type = "ethernet-phy";
+                       };
+                       ethernet-phy@2 {
+                               linux,phandle = <2452002>;
+                               interrupt-parent = <40000>;
+                               interrupts = <4a 1>;
+                               reg = <2>;
+                               device_type = "ethernet-phy";
+                       };
+                       ethernet-phy@3 {
+                               linux,phandle = <2452003>;
+                               interrupt-parent = <40000>;
+                               interrupts = <4a 1>;
+                               reg = <3>;
+                               device_type = "ethernet-phy";
+                       };
+               };
+
+               ethernet@24000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <24000 1000>;
+                       mac-address = [ 00 E0 0C 00 73 00 ];
+                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupt-parent = <40000>;
+                       phy-handle = <2452000>;
+               };
+
+               ethernet@25000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <25000 1000>;
+                       mac-address = [ 00 E0 0C 00 73 01 ];
+                       interrupts = <23 2 24 2 28 2>;
+                       interrupt-parent = <40000>;
+                       phy-handle = <2452001>;
+               };
+               
+               ethernet@26000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <26000 1000>;
+                       mac-address = [ 00 E0 0C 00 02 FD ];
+                       interrupts = <1F 2 20 2 21 2>;
+                       interrupt-parent = <40000>;
+                       phy-handle = <2452002>;
+               };
+
+               ethernet@27000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <27000 1000>;
+                       mac-address = [ 00 E0 0C 00 03 FD ];
+                       interrupts = <25 2 26 2 27 2>;
+                       interrupt-parent = <40000>;
+                       phy-handle = <2452003>;
+               };
+               serial@4500 {
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <4500 100>;
+                       clock-frequency = <0>;
+                       interrupts = <2a 2>;
+                       interrupt-parent = <40000>;
+               };
+
+               serial@4600 {
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <4600 100>;
+                       clock-frequency = <0>;
+                       interrupts = <1c 2>;
+                       interrupt-parent = <40000>;
+               };
+
+               pci@8000 {
+                       compatible = "86xx";
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       reg = <8000 1000>;
+                       bus-range = <0 fe>;
+                       ranges = <02000000 0 80000000 80000000 0 20000000
+                                 01000000 0 00000000 e2000000 0 00100000>;
+                       clock-frequency = <1fca055>;
+                       interrupt-parent = <40000>;
+                       interrupts = <18 2>;
+                       interrupt-map-mask = <f800 0 0 7>;
+                       interrupt-map = <
+                               /* IDSEL 0x11 */
+                               8800 0 0 1 4d0 3 2
+                               8800 0 0 2 4d0 4 2
+                               8800 0 0 3 4d0 5 2
+                               8800 0 0 4 4d0 6 2
+
+                               /* IDSEL 0x12 */
+                               9000 0 0 1 4d0 4 2
+                               9000 0 0 2 4d0 5 2
+                               9000 0 0 3 4d0 6 2
+                               9000 0 0 4 4d0 3 2
+
+                               /* IDSEL 0x13 */
+                               9800 0 0 1 4d0 0 0
+                               9800 0 0 2 4d0 0 0
+                               9800 0 0 3 4d0 0 0
+                               9800 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x14 */
+                               a000 0 0 1 4d0 0 0
+                               a000 0 0 2 4d0 0 0
+                               a000 0 0 3 4d0 0 0
+                               a000 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x15 */
+                               a800 0 0 1 4d0 0 0
+                               a800 0 0 2 4d0 0 0
+                               a800 0 0 3 4d0 0 0
+                               a800 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x16 */
+                               b000 0 0 1 4d0 0 0
+                               b000 0 0 2 4d0 0 0
+                               b000 0 0 3 4d0 0 0
+                               b000 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x17 */
+                               b800 0 0 1 4d0 0 0
+                               b800 0 0 2 4d0 0 0
+                               b800 0 0 3 4d0 0 0
+                               b800 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x18 */
+                               c000 0 0 1 4d0 0 0
+                               c000 0 0 2 4d0 0 0
+                               c000 0 0 3 4d0 0 0
+                               c000 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x19 */
+                               c800 0 0 1 4d0 0 0
+                               c800 0 0 2 4d0 0 0
+                               c800 0 0 3 4d0 0 0
+                               c800 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x1a */
+                               d000 0 0 1 4d0 6 2
+                               d000 0 0 2 4d0 3 2
+                               d000 0 0 3 4d0 4 2
+                               d000 0 0 4 4d0 5 2
+
+
+                               /* IDSEL 0x1b */
+                               d800 0 0 1 4d0 5 2
+                               d800 0 0 2 4d0 0 0
+                               d800 0 0 3 4d0 0 0
+                               d800 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x1c */
+                               e000 0 0 1 4d0 9 2
+                               e000 0 0 2 4d0 a 2
+                               e000 0 0 3 4d0 c 2
+                               e000 0 0 4 4d0 7 2
+
+                               /* IDSEL 0x1d */
+                               e800 0 0 1 4d0 9 2
+                               e800 0 0 2 4d0 a 2
+                               e800 0 0 3 4d0 b 2
+                               e800 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x1e */
+                               f000 0 0 1 4d0 c 2
+                               f000 0 0 2 4d0 0 0
+                               f000 0 0 3 4d0 0 0
+                               f000 0 0 4 4d0 0 0
+
+                               /* IDSEL 0x1f */
+                               f800 0 0 1 4d0 6 2
+                               f800 0 0 2 4d0 0 0
+                               f800 0 0 3 4d0 0 0
+                               f800 0 0 4 4d0 0 0
+                               >;
+                       i8259@4d0 {
+                               linux,phandle = <4d0>;
+                               clock-frequency = <0>;
+                               interrupt-controller;
+                               device_type = "interrupt-controller";
+                               #address-cells = <0>;
+                               #interrupt-cells = <2>;
+                               built-in;
+                               compatible = "chrp,iic";
+                               big-endian;
+                               interrupts = <49 2>;
+                               interrupt-parent = <40000>;
+                       };
+
+               };
+               pic@40000 {
+                       linux,phandle = <40000>;
+                       clock-frequency = <0>;
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <2>;
+                       reg = <40000 40000>;
+                       built-in;
+                       compatible = "chrp,open-pic";
+                       device_type = "open-pic";
+                        big-endian;
+                       interrupts = <
+                               10 2 11 2 12 2 13 2
+                               14 2 15 2 16 2 17 2
+                               18 2 19 2 1a 2 1b 2
+                               1c 2 1d 2 1e 2 1f 2
+                               20 2 21 2 22 2 23 2
+                               24 2 25 2 26 2 27 2
+                               28 2 29 2 2a 2 2b 2
+                               2c 2 2d 2 2e 2 2f 2
+                               30 2 31 2 32 2 33 2
+                               34 2 35 2 36 2 37 2
+                               38 2 39 2 2a 2 3b 2
+                               3c 2 3d 2 3e 2 3f 2
+                               48 1 49 2 4a 1
+                               >;
+                       interrupt-parent = <40000>;
+               };
+       };
+};
index a45627547d03f235716138346a9f929c24ca0ead..8c6bd17c6929c5be6c40f32cb0b3a6a59155a009 100644 (file)
@@ -1,16 +1,18 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc1
-# Wed Apr 19 13:24:37 2006
+# Linux kernel version: 2.6.18-rc3
+# Tue Aug  8 09:12:29 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_COMPAT=y
@@ -33,6 +35,7 @@ CONFIG_PPC_STD_MMU=y
 CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=4
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -50,6 +53,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
@@ -67,10 +71,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -116,12 +122,16 @@ CONFIG_PPC_PMAC=y
 CONFIG_PPC_PMAC64=y
 # CONFIG_PPC_MAPLE is not set
 # CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PPC_IBM_CELL_BLADE is not set
+# CONFIG_UDBG_RTAS_CONSOLE is not set
 CONFIG_U3_DART=y
 CONFIG_MPIC=y
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
 CONFIG_MPIC_BROKEN_U3=y
 # CONFIG_PPC_MPC106 is not set
+CONFIG_PPC_970_NAP=y
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_TABLE=y
 # CONFIG_CPU_FREQ_DEBUG is not set
@@ -153,6 +163,7 @@ CONFIG_BINFMT_ELF=y
 CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_IOMMU_VMERGE=y
 # CONFIG_HOTPLUG_CPU is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
 CONFIG_IRQ_ALL_CPUS=y
@@ -168,6 +179,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
 # CONFIG_PPC_64K_PAGES is not set
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
@@ -184,6 +196,7 @@ CONFIG_GENERIC_ISA_DMA=y
 # CONFIG_PPC_INDIRECT_PCI is not set
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
 # CONFIG_PCI_DEBUG is not set
 
 #
@@ -227,6 +240,8 @@ CONFIG_INET_ESP=m
 CONFIG_INET_IPCOMP=m
 CONFIG_INET_XFRM_TUNNEL=m
 CONFIG_INET_TUNNEL=y
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -239,6 +254,7 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -263,6 +279,7 @@ CONFIG_IP_NF_TFTP=m
 CONFIG_IP_NF_AMANDA=m
 # CONFIG_IP_NF_PPTP is not set
 # CONFIG_IP_NF_H323 is not set
+# CONFIG_IP_NF_SIP is not set
 CONFIG_IP_NF_QUEUE=m
 
 #
@@ -318,6 +335,7 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
 
 #
 # Connector - unified userspace <-> kernelspace linker
@@ -355,6 +373,7 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -417,7 +436,6 @@ CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_BLK_DEV_IDE_PMAC=y
 CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
 CONFIG_BLK_DEV_IDEDMA_PMAC=y
-# CONFIG_BLK_DEV_IDE_PMAC_BLINK is not set
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
@@ -478,6 +496,7 @@ CONFIG_SCSI_SATA_SVW=y
 # CONFIG_SCSI_SATA_MV is not set
 # CONFIG_SCSI_SATA_NV is not set
 # CONFIG_SCSI_PDC_ADMA is not set
+# CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_SATA_QSTOR is not set
 # CONFIG_SCSI_SATA_PROMISE is not set
 # CONFIG_SCSI_SATA_SX4 is not set
@@ -497,7 +516,6 @@ CONFIG_SCSI_SATA_SVW=y
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
-# CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 # CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
@@ -514,9 +532,7 @@ CONFIG_MD_LINEAR=y
 CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 CONFIG_MD_RAID10=m
-CONFIG_MD_RAID5=y
-# CONFIG_MD_RAID5_RESHAPE is not set
-CONFIG_MD_RAID6=m
+# CONFIG_MD_RAID456 is not set
 CONFIG_MD_MULTIPATH=m
 CONFIG_MD_FAULTY=m
 CONFIG_BLK_DEV_DM=y
@@ -559,7 +575,6 @@ CONFIG_IEEE1394_OHCI1394=y
 #
 CONFIG_IEEE1394_VIDEO1394=m
 CONFIG_IEEE1394_SBP2=m
-# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
 CONFIG_IEEE1394_ETH1394=m
 CONFIG_IEEE1394_DV1394=m
 CONFIG_IEEE1394_RAWIO=y
@@ -573,6 +588,7 @@ CONFIG_IEEE1394_RAWIO=y
 # Macintosh device drivers
 #
 CONFIG_ADB_PMU=y
+# CONFIG_ADB_PMU_LED is not set
 CONFIG_PMAC_SMU=y
 CONFIG_THERM_PM72=y
 CONFIG_WINDFARM=y
@@ -643,6 +659,7 @@ CONFIG_TIGON3=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
 
 #
 # Token Ring devices
@@ -739,6 +756,7 @@ CONFIG_SERIO=y
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -754,6 +772,7 @@ CONFIG_HW_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_BRIQ_PANEL is not set
 
 #
 # IPMI
@@ -764,6 +783,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
 # CONFIG_DTLK is not set
@@ -774,6 +794,7 @@ CONFIG_GEN_RTC=y
 # Ftape, the floppy tape device driver
 #
 CONFIG_AGP=m
+# CONFIG_AGP_SIS is not set
 # CONFIG_AGP_VIA is not set
 CONFIG_AGP_UNINORTH=m
 # CONFIG_DRM is not set
@@ -813,6 +834,7 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_PIIX4 is not set
 CONFIG_I2C_POWERMAC=y
 # CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PROSAVAGE is not set
 # CONFIG_I2C_SAVAGE4 is not set
@@ -849,7 +871,6 @@ CONFIG_I2C_POWERMAC=y
 #
 # Dallas's 1-wire bus
 #
-# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -865,6 +886,7 @@ CONFIG_I2C_POWERMAC=y
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -875,22 +897,19 @@ CONFIG_I2C_POWERMAC=y
 #
 # Graphics support
 #
+CONFIG_FIRMWARE_EDID=y
 CONFIG_FB=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
 CONFIG_FB_MACMODES=y
-CONFIG_FB_FIRMWARE_EDID=y
+# CONFIG_FB_BACKLIGHT is not set
 CONFIG_FB_MODE_HELPERS=y
 CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
 CONFIG_FB_OF=y
-# CONFIG_FB_CONTROL is not set
-# CONFIG_FB_PLATINUM is not set
-# CONFIG_FB_VALKYRIE is not set
-# CONFIG_FB_CT65550 is not set
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 # CONFIG_FB_VGA16 is not set
@@ -990,6 +1009,18 @@ CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_CS46XX is not set
+# CONFIG_SND_DARLA20 is not set
+# CONFIG_SND_GINA20 is not set
+# CONFIG_SND_LAYLA20 is not set
+# CONFIG_SND_DARLA24 is not set
+# CONFIG_SND_GINA24 is not set
+# CONFIG_SND_LAYLA24 is not set
+# CONFIG_SND_MONA is not set
+# CONFIG_SND_MIA is not set
+# CONFIG_SND_ECHO3G is not set
+# CONFIG_SND_INDIGO is not set
+# CONFIG_SND_INDIGOIO is not set
+# CONFIG_SND_INDIGODJ is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_EMU10K1X is not set
 # CONFIG_SND_ENS1370 is not set
@@ -1026,6 +1057,17 @@ CONFIG_SND_VERBOSE_PROCFS=y
 CONFIG_SND_POWERMAC=m
 CONFIG_SND_POWERMAC_AUTO_DRC=y
 
+#
+# Apple Onboard Audio driver
+#
+CONFIG_SND_AOA=m
+CONFIG_SND_AOA_FABRIC_LAYOUT=m
+CONFIG_SND_AOA_ONYX=m
+CONFIG_SND_AOA_TAS=m
+CONFIG_SND_AOA_TOONIE=m
+CONFIG_SND_AOA_SOUNDBUS=m
+CONFIG_SND_AOA_SOUNDBUS_I2S=m
+
 #
 # USB devices
 #
@@ -1060,6 +1102,7 @@ CONFIG_USB_DEVICEFS=y
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_SPLIT_ISO is not set
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -1110,9 +1153,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_ACECAD is not set
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_MTOUCH is not set
-# CONFIG_USB_ITMTOUCH is not set
-# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_TOUCHSCREEN is not set
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
@@ -1155,6 +1196,7 @@ CONFIG_USB_SERIAL=m
 CONFIG_USB_SERIAL_GENERIC=y
 # CONFIG_USB_SERIAL_AIRPRIME is not set
 # CONFIG_USB_SERIAL_ANYDATA is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
 CONFIG_USB_SERIAL_BELKIN=m
 # CONFIG_USB_SERIAL_WHITEHEAT is not set
 CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
@@ -1162,6 +1204,7 @@ CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
 CONFIG_USB_SERIAL_CYPRESS_M8=m
 CONFIG_USB_SERIAL_EMPEG=m
 CONFIG_USB_SERIAL_FTDI_SIO=m
+# CONFIG_USB_SERIAL_FUNSOFT is not set
 CONFIG_USB_SERIAL_VISOR=m
 CONFIG_USB_SERIAL_IPAQ=m
 CONFIG_USB_SERIAL_IR=m
@@ -1191,9 +1234,11 @@ CONFIG_USB_SERIAL_PL2303=m
 # CONFIG_USB_SERIAL_HP4X is not set
 CONFIG_USB_SERIAL_SAFE=m
 CONFIG_USB_SERIAL_SAFE_PADDED=y
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
 CONFIG_USB_SERIAL_TI=m
 CONFIG_USB_SERIAL_CYBERJACK=m
 CONFIG_USB_SERIAL_XIRCOM=m
+# CONFIG_USB_SERIAL_OPTION is not set
 CONFIG_USB_SERIAL_OMNINET=m
 CONFIG_USB_EZUSB=y
 
@@ -1207,10 +1252,12 @@ CONFIG_USB_EZUSB=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_APPLEDISPLAY=m
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TEST is not set
@@ -1234,6 +1281,14 @@ CONFIG_USB_EZUSB=y
 #
 # CONFIG_NEW_LEDS is not set
 
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
 #
 # InfiniBand support
 #
@@ -1248,6 +1303,19 @@ CONFIG_USB_EZUSB=y
 #
 # CONFIG_RTC_CLASS is not set
 
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
 #
 # File systems
 #
@@ -1273,7 +1341,6 @@ CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
-CONFIG_XFS_EXPORT=y
 # CONFIG_XFS_QUOTA is not set
 CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
@@ -1282,6 +1349,7 @@ CONFIG_XFS_POSIX_ACL=y
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 CONFIG_AUTOFS_FS=m
@@ -1363,7 +1431,9 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_SMB_FS is not set
 CONFIG_CIFS=m
 # CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
 # CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_CIFS_EXPERIMENTAL is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
@@ -1444,6 +1514,9 @@ CONFIG_CRC32=y
 CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_PLIST=y
 
 #
 # Instrumentation Support
@@ -1457,14 +1530,19 @@ CONFIG_OPROFILE=y
 #
 # CONFIG_PRINTK_TIME is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
-CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RWSEMS is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
@@ -1476,11 +1554,7 @@ CONFIG_FORCED_INLINING=y
 # CONFIG_DEBUGGER is not set
 CONFIG_IRQSTACKS=y
 CONFIG_BOOTX_TEXT=y
-# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
-# CONFIG_PPC_EARLY_DEBUG_G5 is not set
-# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
-# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
-# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
 
 #
 # Security options
index a95e455a1944a9a2102af115416a43eeeb867daa..72ed95b3ead63bb25dab624fb8b61b8ca44a81d2 100644 (file)
@@ -1,16 +1,18 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc1
-# Wed Apr 19 11:46:44 2006
+# Linux kernel version: 2.6.18-rc3
+# Tue Aug  8 09:15:46 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_COMPAT=y
@@ -34,6 +36,7 @@ CONFIG_PPC_STD_MMU=y
 CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -51,6 +54,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 CONFIG_AUDIT=y
 CONFIG_AUDITSYSCALL=y
@@ -69,10 +73,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -113,10 +119,14 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_PPC_ISERIES=y
 # CONFIG_EMBEDDED6xx is not set
 # CONFIG_APUS is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_UDBG_RTAS_CONSOLE is not set
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
 CONFIG_IBMVIO=y
 # CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
 # CONFIG_CPU_FREQ is not set
 # CONFIG_WANT_EARLY_SERIAL is not set
 
@@ -135,6 +145,7 @@ CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_IOMMU_VMERGE=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_IRQ_ALL_CPUS=y
 CONFIG_LPARCFG=y
 # CONFIG_NUMA is not set
@@ -149,6 +160,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
 # CONFIG_PPC_64K_PAGES is not set
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
@@ -164,6 +176,7 @@ CONFIG_GENERIC_ISA_DMA=y
 # CONFIG_PPC_INDIRECT_PCI is not set
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
 # CONFIG_PCI_DEBUG is not set
 
 #
@@ -207,6 +220,8 @@ CONFIG_INET_ESP=m
 CONFIG_INET_IPCOMP=m
 CONFIG_INET_XFRM_TUNNEL=m
 CONFIG_INET_TUNNEL=y
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -219,6 +234,7 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -246,9 +262,11 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
 # CONFIG_NETFILTER_XT_MATCH_POLICY is not set
 # CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
 CONFIG_NETFILTER_XT_MATCH_REALM=m
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 
@@ -267,6 +285,7 @@ CONFIG_IP_NF_TFTP=m
 CONFIG_IP_NF_AMANDA=m
 # CONFIG_IP_NF_PPTP is not set
 # CONFIG_IP_NF_H323 is not set
+# CONFIG_IP_NF_SIP is not set
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
 CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -360,6 +379,7 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
 
 #
 # Connector - unified userspace <-> kernelspace linker
@@ -396,6 +416,7 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -453,6 +474,7 @@ CONFIG_SCSI_FC_ATTRS=y
 # CONFIG_MEGARAID_LEGACY is not set
 # CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
@@ -464,7 +486,6 @@ CONFIG_SCSI_IBMVSCSI=m
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
-# CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 # CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
@@ -481,9 +502,7 @@ CONFIG_MD_LINEAR=y
 CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 CONFIG_MD_RAID10=m
-CONFIG_MD_RAID5=y
-# CONFIG_MD_RAID5_RESHAPE is not set
-CONFIG_MD_RAID6=m
+# CONFIG_MD_RAID456 is not set
 CONFIG_MD_MULTIPATH=m
 CONFIG_MD_FAULTY=m
 CONFIG_BLK_DEV_DM=y
@@ -596,6 +615,7 @@ CONFIG_E1000=m
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
 
 #
 # Token Ring devices
@@ -696,6 +716,7 @@ CONFIG_SERIAL_ICOM=m
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_BRIQ_PANEL is not set
 
 #
 # IPMI
@@ -706,6 +727,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
 # CONFIG_DTLK is not set
@@ -741,7 +763,6 @@ CONFIG_MAX_RAW_DEVS=256
 #
 # Dallas's 1-wire bus
 #
-# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -757,6 +778,7 @@ CONFIG_MAX_RAW_DEVS=256
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -766,7 +788,9 @@ CONFIG_MAX_RAW_DEVS=256
 #
 # Graphics support
 #
+CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -800,6 +824,14 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 #
 # CONFIG_NEW_LEDS is not set
 
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
 #
 # InfiniBand support
 #
@@ -814,6 +846,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 #
 # CONFIG_RTC_CLASS is not set
 
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
 #
 # File systems
 #
@@ -843,7 +888,6 @@ CONFIG_JFS_SECURITY=y
 # CONFIG_JFS_STATISTICS is not set
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
-CONFIG_XFS_EXPORT=y
 # CONFIG_XFS_QUOTA is not set
 CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
@@ -852,6 +896,7 @@ CONFIG_XFS_POSIX_ACL=y
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 CONFIG_AUTOFS_FS=m
@@ -933,8 +978,10 @@ CONFIG_RPCSEC_GSS_SPKM3=m
 # CONFIG_SMB_FS is not set
 CONFIG_CIFS=m
 # CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
 CONFIG_CIFS_XATTR=y
 CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_CIFS_EXPERIMENTAL is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
@@ -1013,10 +1060,12 @@ CONFIG_TEXTSEARCH=y
 CONFIG_TEXTSEARCH_KMP=m
 CONFIG_TEXTSEARCH_BM=m
 CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y
 
 #
 # Instrumentation Support
 #
+# CONFIG_PROFILING is not set
 # CONFIG_KPROBES is not set
 
 #
@@ -1024,14 +1073,19 @@ CONFIG_TEXTSEARCH_FSM=m
 #
 # CONFIG_PRINTK_TIME is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
-# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RWSEMS is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
@@ -1042,11 +1096,7 @@ CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_STACK_USAGE=y
 # CONFIG_DEBUGGER is not set
 CONFIG_IRQSTACKS=y
-# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
-# CONFIG_PPC_EARLY_DEBUG_G5 is not set
-# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
-# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
-# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
 
 #
 # Security options
index addc79381c3b3b3bf0cf466905e287f1b2bc7b1a..3545af9896af03eac7a22069b7b5a89e65fa3730 100644 (file)
@@ -1,16 +1,18 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc5
-# Mon May 29 14:47:49 2006
+# Linux kernel version: 2.6.17
+# Mon Jul  3 14:20:49 2006
 #
 # CONFIG_PPC64 is not set
 CONFIG_PPC32=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
@@ -29,6 +31,7 @@ CONFIG_CLASSIC32=y
 # CONFIG_PPC_82xx is not set
 # CONFIG_PPC_83xx is not set
 # CONFIG_PPC_85xx is not set
+# CONFIG_PPC_86xx is not set
 # CONFIG_40x is not set
 # CONFIG_44x is not set
 # CONFIG_8xx is not set
@@ -39,6 +42,7 @@ CONFIG_ALTIVEC=y
 CONFIG_PPC_STD_MMU=y
 CONFIG_PPC_STD_MMU_32=y
 # CONFIG_SMP is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -72,10 +76,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -119,6 +125,9 @@ CONFIG_PPC_MULTIPLATFORM=y
 # CONFIG_APUS is not set
 # CONFIG_PPC_CHRP is not set
 CONFIG_PPC_PMAC=y
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_UDBG_RTAS_CONSOLE is not set
 CONFIG_MPIC=y
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
@@ -154,6 +163,7 @@ CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 # CONFIG_KEXEC is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -164,6 +174,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
 CONFIG_PM=y
@@ -182,6 +193,7 @@ CONFIG_GENERIC_ISA_DMA=y
 CONFIG_PPC_INDIRECT_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
 # CONFIG_PCI_DEBUG is not set
 
 #
@@ -256,6 +268,8 @@ CONFIG_INET_ESP=y
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -268,6 +282,7 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -292,9 +307,11 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
 CONFIG_NETFILTER_XT_MATCH_REALM=m
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 
@@ -313,6 +330,7 @@ CONFIG_IP_NF_TFTP=m
 CONFIG_IP_NF_AMANDA=m
 CONFIG_IP_NF_PPTP=m
 CONFIG_IP_NF_H323=m
+# CONFIG_IP_NF_SIP is not set
 # CONFIG_IP_NF_QUEUE is not set
 CONFIG_IP_NF_IPTABLES=m
 CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -457,6 +475,7 @@ CONFIG_IRTTY_SIR=m
 # CONFIG_ALI_FIR is not set
 # CONFIG_VLSI_FIR is not set
 # CONFIG_VIA_FIR is not set
+# CONFIG_MCS_FIR is not set
 CONFIG_BT=m
 CONFIG_BT_L2CAP=m
 CONFIG_BT_SCO=m
@@ -500,6 +519,7 @@ CONFIG_WIRELESS_EXT=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
 
 #
 # Connector - unified userspace <-> kernelspace linker
@@ -600,7 +620,6 @@ CONFIG_BLK_DEV_PDC202XX_NEW=y
 CONFIG_BLK_DEV_IDE_PMAC=y
 CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
 CONFIG_BLK_DEV_IDEDMA_PMAC=y
-CONFIG_BLK_DEV_IDE_PMAC_BLINK=y
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
@@ -661,6 +680,7 @@ CONFIG_SCSI_AIC7XXX_OLD=m
 # CONFIG_MEGARAID_LEGACY is not set
 # CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
@@ -705,9 +725,7 @@ CONFIG_MD_LINEAR=m
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 CONFIG_MD_RAID10=m
-CONFIG_MD_RAID5=m
-CONFIG_MD_RAID5_RESHAPE=y
-CONFIG_MD_RAID6=m
+# CONFIG_MD_RAID456 is not set
 CONFIG_MD_MULTIPATH=m
 CONFIG_MD_FAULTY=m
 CONFIG_BLK_DEV_DM=m
@@ -750,7 +768,6 @@ CONFIG_IEEE1394_OHCI1394=m
 #
 CONFIG_IEEE1394_VIDEO1394=m
 CONFIG_IEEE1394_SBP2=m
-# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
 # CONFIG_IEEE1394_ETH1394 is not set
 CONFIG_IEEE1394_DV1394=m
 CONFIG_IEEE1394_RAWIO=m
@@ -766,9 +783,12 @@ CONFIG_IEEE1394_RAWIO=m
 CONFIG_ADB=y
 CONFIG_ADB_CUDA=y
 CONFIG_ADB_PMU=y
+CONFIG_ADB_PMU_LED=y
+CONFIG_ADB_PMU_LED_IDE=y
 CONFIG_PMAC_APM_EMU=m
 CONFIG_PMAC_MEDIABAY=y
 CONFIG_PMAC_BACKLIGHT=y
+CONFIG_PMAC_BACKLIGHT_LEGACY=y
 CONFIG_INPUT_ADBHID=y
 CONFIG_MAC_EMUMOUSEBTN=y
 CONFIG_THERM_WINDTUNNEL=m
@@ -858,6 +878,7 @@ CONFIG_PCNET32=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
 
 #
 # Token Ring devices
@@ -908,6 +929,7 @@ CONFIG_APPLE_AIRPORT=m
 # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
 #
 CONFIG_PRISM54=m
+# CONFIG_USB_ZD1201 is not set
 # CONFIG_HOSTAP is not set
 CONFIG_NET_WIRELESS=y
 
@@ -998,6 +1020,7 @@ CONFIG_SERIO=y
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -1029,6 +1052,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
 CONFIG_NVRAM=y
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
@@ -1040,6 +1064,7 @@ CONFIG_GEN_RTC=y
 # Ftape, the floppy tape device driver
 #
 CONFIG_AGP=m
+# CONFIG_AGP_SIS is not set
 # CONFIG_AGP_VIA is not set
 CONFIG_AGP_UNINORTH=m
 CONFIG_DRM=m
@@ -1092,6 +1117,7 @@ CONFIG_I2C_ALGOBIT=y
 CONFIG_I2C_POWERMAC=y
 # CONFIG_I2C_MPC is not set
 # CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PROSAVAGE is not set
 # CONFIG_I2C_SAVAGE4 is not set
@@ -1156,12 +1182,13 @@ CONFIG_VIDEO_V4L2=y
 #
 # Graphics support
 #
+# CONFIG_FIRMWARE_EDID is not set
 CONFIG_FB=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
 CONFIG_FB_MACMODES=y
-CONFIG_FB_FIRMWARE_EDID=y
+CONFIG_FB_BACKLIGHT=y
 CONFIG_FB_MODE_HELPERS=y
 CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_CIRRUS is not set
@@ -1178,6 +1205,7 @@ CONFIG_FB_IMSTT=y
 # CONFIG_FB_S1D13XXX is not set
 CONFIG_FB_NVIDIA=y
 CONFIG_FB_NVIDIA_I2C=y
+CONFIG_FB_NVIDIA_BACKLIGHT=y
 # CONFIG_FB_RIVA is not set
 CONFIG_FB_MATROX=y
 CONFIG_FB_MATROX_MILLENIUM=y
@@ -1187,12 +1215,15 @@ CONFIG_FB_MATROX_MYSTIQUE=y
 # CONFIG_FB_MATROX_MULTIHEAD is not set
 CONFIG_FB_RADEON=y
 CONFIG_FB_RADEON_I2C=y
+CONFIG_FB_RADEON_BACKLIGHT=y
 # CONFIG_FB_RADEON_DEBUG is not set
 CONFIG_FB_ATY128=y
+CONFIG_FB_ATY128_BACKLIGHT=y
 CONFIG_FB_ATY=y
 CONFIG_FB_ATY_CT=y
 # CONFIG_FB_ATY_GENERIC_LCD is not set
 CONFIG_FB_ATY_GX=y
+CONFIG_FB_ATY_BACKLIGHT=y
 # CONFIG_FB_SAVAGE is not set
 # CONFIG_FB_SIS is not set
 # CONFIG_FB_NEOMAGIC is not set
@@ -1221,7 +1252,11 @@ CONFIG_LOGO=y
 CONFIG_LOGO_LINUX_MONO=y
 CONFIG_LOGO_LINUX_VGA16=y
 CONFIG_LOGO_LINUX_CLUT224=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_DEVICE=y
+CONFIG_LCD_CLASS_DEVICE=m
+CONFIG_LCD_DEVICE=y
 
 #
 # Sound
@@ -1278,6 +1313,18 @@ CONFIG_SND_DUMMY=m
 # CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_CS46XX is not set
+# CONFIG_SND_DARLA20 is not set
+# CONFIG_SND_GINA20 is not set
+# CONFIG_SND_LAYLA20 is not set
+# CONFIG_SND_DARLA24 is not set
+# CONFIG_SND_GINA24 is not set
+# CONFIG_SND_LAYLA24 is not set
+# CONFIG_SND_MONA is not set
+# CONFIG_SND_MIA is not set
+# CONFIG_SND_ECHO3G is not set
+# CONFIG_SND_INDIGO is not set
+# CONFIG_SND_INDIGOIO is not set
+# CONFIG_SND_INDIGODJ is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_EMU10K1X is not set
 # CONFIG_SND_ENS1370 is not set
@@ -1314,6 +1361,17 @@ CONFIG_SND_DUMMY=m
 CONFIG_SND_POWERMAC=m
 CONFIG_SND_POWERMAC_AUTO_DRC=y
 
+#
+# Apple Onboard Audio driver
+#
+CONFIG_SND_AOA=m
+CONFIG_SND_AOA_FABRIC_LAYOUT=m
+CONFIG_SND_AOA_ONYX=m
+CONFIG_SND_AOA_TAS=m
+CONFIG_SND_AOA_TOONIE=m
+CONFIG_SND_AOA_SOUNDBUS=m
+CONFIG_SND_AOA_SOUNDBUS_I2S=m
+
 #
 # USB devices
 #
@@ -1355,6 +1413,7 @@ CONFIG_USB_DYNAMIC_MINORS=y
 CONFIG_USB_EHCI_HCD=m
 CONFIG_USB_EHCI_SPLIT_ISO=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -1431,7 +1490,6 @@ CONFIG_USB_NET_NET1080=m
 # CONFIG_USB_NET_RNDIS_HOST is not set
 # CONFIG_USB_NET_CDC_SUBSET is not set
 CONFIG_USB_NET_ZAURUS=m
-# CONFIG_USB_ZD1201 is not set
 CONFIG_USB_MON=y
 
 #
@@ -1499,10 +1557,12 @@ CONFIG_USB_EZUSB=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_APPLEDISPLAY=m
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TEST is not set
@@ -1524,7 +1584,8 @@ CONFIG_USB_EZUSB=y
 #
 # LED devices
 #
-# CONFIG_NEW_LEDS is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
 
 #
 # LED drivers
@@ -1533,6 +1594,10 @@ CONFIG_USB_EZUSB=y
 #
 # LED Triggers
 #
+CONFIG_LEDS_TRIGGERS=y
+# CONFIG_LEDS_TRIGGER_TIMER is not set
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
+# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
 
 #
 # InfiniBand support
@@ -1548,6 +1613,19 @@ CONFIG_USB_EZUSB=y
 #
 # CONFIG_RTC_CLASS is not set
 
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
 #
 # File systems
 #
@@ -1569,6 +1647,7 @@ CONFIG_FS_POSIX_ACL=y
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
@@ -1649,6 +1728,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
 CONFIG_SMB_FS=m
 # CONFIG_SMB_NLS_DEFAULT is not set
 # CONFIG_CIFS is not set
+# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -1732,6 +1812,7 @@ CONFIG_TEXTSEARCH=y
 CONFIG_TEXTSEARCH_KMP=m
 CONFIG_TEXTSEARCH_BM=m
 CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y
 
 #
 # Instrumentation Support
@@ -1744,12 +1825,15 @@ CONFIG_OPROFILE=y
 #
 # CONFIG_PRINTK_TIME is not set
 # CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -1763,11 +1847,7 @@ CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
 # CONFIG_BDI_SWITCH is not set
 CONFIG_BOOTX_TEXT=y
-# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
-# CONFIG_PPC_EARLY_DEBUG_G5 is not set
-# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
-# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
-# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
 
 #
 # Security options
index 31708ad4574e20e3a3bcb9bf764e8d34ecaee79e..c18e8600d78f6d46ba2d3dde6d08cb2ee9bc2c01 100644 (file)
@@ -1,13 +1,14 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc4
-# Sun May 28 07:26:56 2006
+# Linux kernel version: 2.6.18-rc3
+# Tue Aug  8 09:14:48 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
@@ -35,6 +36,7 @@ CONFIG_PPC_STD_MMU=y
 CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=128
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -52,6 +54,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 CONFIG_AUDIT=y
 CONFIG_AUDITSYSCALL=y
@@ -70,10 +73,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -118,6 +123,9 @@ CONFIG_PPC_PSERIES=y
 # CONFIG_PPC_PMAC is not set
 # CONFIG_PPC_MAPLE is not set
 # CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PPC_IBM_CELL_BLADE is not set
+# CONFIG_UDBG_RTAS_CONSOLE is not set
 CONFIG_XICS=y
 # CONFIG_U3_DART is not set
 CONFIG_MPIC=y
@@ -149,6 +157,7 @@ CONFIG_BINFMT_MISC=m
 CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_IOMMU_VMERGE=y
 CONFIG_HOTPLUG_CPU=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
 CONFIG_IRQ_ALL_CPUS=y
@@ -173,6 +182,7 @@ CONFIG_SPARSEMEM_EXTREME=y
 # CONFIG_MEMORY_HOTPLUG is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
+CONFIG_RESOURCES_64BIT=y
 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
 # CONFIG_PPC_64K_PAGES is not set
 CONFIG_SCHED_SMT=y
@@ -190,6 +200,7 @@ CONFIG_PPC_I8259=y
 # CONFIG_PPC_INDIRECT_PCI is not set
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
 # CONFIG_PCI_DEBUG is not set
 
 #
@@ -238,6 +249,8 @@ CONFIG_INET_ESP=m
 CONFIG_INET_IPCOMP=m
 CONFIG_INET_XFRM_TUNNEL=m
 CONFIG_INET_TUNNEL=y
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -250,6 +263,7 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -277,6 +291,7 @@ CONFIG_IP_NF_TFTP=m
 CONFIG_IP_NF_AMANDA=m
 # CONFIG_IP_NF_PPTP is not set
 # CONFIG_IP_NF_H323 is not set
+# CONFIG_IP_NF_SIP is not set
 CONFIG_IP_NF_QUEUE=m
 
 #
@@ -316,6 +331,7 @@ CONFIG_LLC=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_TCPPROBE is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
@@ -332,6 +348,7 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
 
 #
 # Connector - unified userspace <-> kernelspace linker
@@ -352,6 +369,7 @@ CONFIG_PARPORT_PC=m
 # CONFIG_PARPORT_PC_FIFO is not set
 # CONFIG_PARPORT_PC_SUPERIO is not set
 # CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_AX88796 is not set
 # CONFIG_PARPORT_1284 is not set
 
 #
@@ -376,6 +394,7 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -487,6 +506,7 @@ CONFIG_SCSI_SAS_ATTRS=m
 # CONFIG_MEGARAID_LEGACY is not set
 # CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
@@ -508,12 +528,6 @@ CONFIG_SCSI_IPR_TRACE=y
 CONFIG_SCSI_IPR_DUMP=y
 # CONFIG_SCSI_QLOGIC_1280 is not set
 CONFIG_SCSI_QLA_FC=m
-CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE=y
-CONFIG_SCSI_QLA21XX=m
-CONFIG_SCSI_QLA22XX=m
-CONFIG_SCSI_QLA2300=m
-CONFIG_SCSI_QLA2322=m
-CONFIG_SCSI_QLA24XX=m
 CONFIG_SCSI_LPFC=m
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -528,9 +542,7 @@ CONFIG_MD_LINEAR=y
 CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 CONFIG_MD_RAID10=m
-CONFIG_MD_RAID5=y
-CONFIG_MD_RAID5_RESHAPE=y
-CONFIG_MD_RAID6=m
+# CONFIG_MD_RAID456 is not set
 CONFIG_MD_MULTIPATH=m
 CONFIG_MD_FAULTY=m
 CONFIG_BLK_DEV_DM=y
@@ -651,6 +663,7 @@ CONFIG_IXGB=m
 # CONFIG_IXGB_NAPI is not set
 CONFIG_S2IO=m
 # CONFIG_S2IO_NAPI is not set
+# CONFIG_MYRI10GE is not set
 
 #
 # Token Ring devices
@@ -754,6 +767,7 @@ CONFIG_SERIO_LIBPS2=y
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -776,6 +790,7 @@ CONFIG_SERIAL_JSM=m
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_BRIQ_PANEL is not set
 # CONFIG_PRINTER is not set
 # CONFIG_PPDEV is not set
 # CONFIG_TIPAR is not set
@@ -793,6 +808,7 @@ CONFIG_HVCS=m
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
 # CONFIG_DTLK is not set
@@ -839,6 +855,7 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_I810 is not set
 # CONFIG_I2C_PIIX4 is not set
 # CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PROSAVAGE is not set
@@ -876,7 +893,6 @@ CONFIG_I2C_ALGOBIT=y
 #
 # Dallas's 1-wire bus
 #
-# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -892,6 +908,7 @@ CONFIG_I2C_ALGOBIT=y
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -902,19 +919,19 @@ CONFIG_I2C_ALGOBIT=y
 #
 # Graphics support
 #
+CONFIG_FIRMWARE_EDID=y
 CONFIG_FB=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
 CONFIG_FB_MACMODES=y
-CONFIG_FB_FIRMWARE_EDID=y
+# CONFIG_FB_BACKLIGHT is not set
 CONFIG_FB_MODE_HELPERS=y
 CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
 CONFIG_FB_OF=y
-# CONFIG_FB_CT65550 is not set
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 # CONFIG_FB_VGA16 is not set
@@ -993,6 +1010,7 @@ CONFIG_USB_DEVICEFS=y
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_SPLIT_ISO is not set
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -1083,10 +1101,12 @@ CONFIG_USB_MON=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TEST is not set
@@ -1124,12 +1144,14 @@ CONFIG_USB_MON=y
 CONFIG_INFINIBAND=m
 CONFIG_INFINIBAND_USER_MAD=m
 CONFIG_INFINIBAND_USER_ACCESS=m
+CONFIG_INFINIBAND_ADDR_TRANS=y
 CONFIG_INFINIBAND_MTHCA=m
 CONFIG_INFINIBAND_MTHCA_DEBUG=y
 CONFIG_INFINIBAND_IPOIB=m
 CONFIG_INFINIBAND_IPOIB_DEBUG=y
 # CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
 CONFIG_INFINIBAND_SRP=m
+# CONFIG_INFINIBAND_ISER is not set
 
 #
 # EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -1140,6 +1162,19 @@ CONFIG_INFINIBAND_SRP=m
 #
 # CONFIG_RTC_CLASS is not set
 
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
 #
 # File systems
 #
@@ -1169,15 +1204,16 @@ CONFIG_JFS_SECURITY=y
 # CONFIG_JFS_STATISTICS is not set
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
-CONFIG_XFS_EXPORT=y
 # CONFIG_XFS_QUOTA is not set
 CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
 CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
@@ -1259,8 +1295,10 @@ CONFIG_RPCSEC_GSS_SPKM3=m
 # CONFIG_SMB_FS is not set
 CONFIG_CIFS=m
 # CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
 CONFIG_CIFS_XATTR=y
 CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_CIFS_EXPERIMENTAL is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
@@ -1326,6 +1364,9 @@ CONFIG_CRC32=y
 CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_PLIST=y
 
 #
 # Instrumentation Support
@@ -1339,14 +1380,19 @@ CONFIG_KPROBES=y
 #
 # CONFIG_PRINTK_TIME is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
-# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RWSEMS is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
index 814f242aeb8cc06348603c2df8478b0dd0d4e274..956c2e5564b7a647592c51910b086a7812f2c285 100644 (file)
@@ -67,9 +67,9 @@ pci64-$(CONFIG_PPC64)         += pci_64.o pci_dn.o pci_iommu.o \
                                   pci_direct_iommu.o iomap.o
 pci32-$(CONFIG_PPC32)          := pci_32.o
 obj-$(CONFIG_PCI)              += $(pci64-y) $(pci32-y)
-kexec-$(CONFIG_PPC64)          := machine_kexec_64.o crash.o
+kexec-$(CONFIG_PPC64)          := machine_kexec_64.o
 kexec-$(CONFIG_PPC32)          := machine_kexec_32.o
-obj-$(CONFIG_KEXEC)            += machine_kexec.o $(kexec-y)
+obj-$(CONFIG_KEXEC)            += machine_kexec.o crash.o $(kexec-y)
 
 ifeq ($(CONFIG_PPC_ISERIES),y)
 $(obj)/head_64.o: $(obj)/lparmap.s
index f69af2c5d7b30faaead1c3f9473e6c8b91182674..76e97aa71c45b307347e58f031cf97ecd20dd348 100644 (file)
@@ -76,6 +76,8 @@ _GLOBAL(__setup_cpu_ppc970)
        mfspr   r0,SPRN_HID0
        li      r11,5                   /* clear DOZE and SLEEP */
        rldimi  r0,r11,52,8             /* set NAP and DPM */
+       li      r11,0
+       rldimi  r0,r11,32,31            /* clear EN_ATTN */
        mtspr   SPRN_HID0,r0
        mfspr   r0,SPRN_HID0
        mfspr   r0,SPRN_HID0
index 358cecdc6aef2e1ab8e91778897db3accce3fd11..f04c18e08b8b6dcf9f52e422db1c4aa2b0a2854a 100644 (file)
@@ -44,6 +44,7 @@
 /* This keeps a track of which one is crashing cpu. */
 int crashing_cpu = -1;
 static cpumask_t cpus_in_crash = CPU_MASK_NONE;
+cpumask_t cpus_in_sr = CPU_MASK_NONE;
 
 static u32 *append_elf_note(u32 *buf, char *name, unsigned type, void *data,
                                                               size_t data_len)
@@ -139,7 +140,13 @@ void crash_ipi_callback(struct pt_regs *regs)
 
        if (ppc_md.kexec_cpu_down)
                ppc_md.kexec_cpu_down(1, 1);
+
+#ifdef CONFIG_PPC64
        kexec_smp_wait();
+#else
+       for (;;);       /* FIXME */
+#endif
+
        /* NOTREACHED */
 }
 
@@ -255,7 +262,11 @@ static void crash_kexec_prepare_cpus(int cpu)
         *
         * do this if kexec in setup.c ?
         */
+#ifdef CONFIG_PPC64
        smp_release_cpus();
+#else
+       /* FIXME */
+#endif
 }
 
 void crash_kexec_secondary(struct pt_regs *regs)
index e16eb2a33173142c828cfba102d248b8e982c7e8..6ff3cf506088bf2c97265bd31835115ba19b94ed 100644 (file)
@@ -191,6 +191,37 @@ exception_marker:
        ori     reg,reg,(label)@l;      /* virt addr of handler ... */
 #endif
 
+/*
+ * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode.
+ * The firmware calls the registered system_reset_fwnmi and
+ * machine_check_fwnmi handlers in 32bit mode if the cpu happens to run
+ * a 32bit application at the time of the event.
+ * This firmware bug is present on POWER4 and JS20.
+ */
+#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label)              \
+       mfspr   r13,SPRN_SPRG3;         /* get paca address into r13 */ \
+       std     r9,area+EX_R9(r13);     /* save r9 - r12 */             \
+       std     r10,area+EX_R10(r13);                                   \
+       std     r11,area+EX_R11(r13);                                   \
+       std     r12,area+EX_R12(r13);                                   \
+       mfspr   r9,SPRN_SPRG1;                                          \
+       std     r9,area+EX_R13(r13);                                    \
+       mfcr    r9;                                                     \
+       clrrdi  r12,r13,32;             /* get high part of &label */   \
+       mfmsr   r10;                                                    \
+       /* force 64bit mode */                                          \
+       li      r11,5;                  /* MSR_SF_LG|MSR_ISF_LG */      \
+       rldimi  r10,r11,61,0;           /* insert into top 3 bits */    \
+       /* done 64bit mode */                                           \
+       mfspr   r11,SPRN_SRR0;          /* save SRR0 */                 \
+       LOAD_HANDLER(r12,label)                                         \
+       ori     r10,r10,MSR_IR|MSR_DR|MSR_RI;                           \
+       mtspr   SPRN_SRR0,r12;                                          \
+       mfspr   r12,SPRN_SRR1;          /* and SRR1 */                  \
+       mtspr   SPRN_SRR1,r10;                                          \
+       rfid;                                                           \
+       b       .       /* prevent speculative execution */
+
 #define EXCEPTION_PROLOG_PSERIES(area, label)                          \
        mfspr   r13,SPRN_SPRG3;         /* get paca address into r13 */ \
        std     r9,area+EX_R9(r13);     /* save r9 - r12 */             \
@@ -604,14 +635,14 @@ slb_miss_user_pseries:
 system_reset_fwnmi:
        HMT_MEDIUM
        mtspr   SPRN_SPRG1,r13          /* save r13 */
-       EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
+       EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXGEN, system_reset_common)
 
        .globl machine_check_fwnmi
       .align 7
 machine_check_fwnmi:
        HMT_MEDIUM
        mtspr   SPRN_SPRG1,r13          /* save r13 */
-       EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
+       EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common)
 
 #ifdef CONFIG_PPC_ISERIES
 /***  ISeries-LPAR interrupt handlers ***/
index 01bdae35cb5590ed1aff66f6f6cfcb945be99495..7ee6854333191b420472b7234e0db5713b80335b 100644 (file)
@@ -693,7 +693,7 @@ unsigned int irq_radix_revmap(struct irq_host *host,
        /* If not there, try to insert it */
        virq = irq_find_mapping(host, hwirq);
        if (virq != NO_IRQ)
-               radix_tree_insert(tree, virq, &irq_map[virq]);
+               radix_tree_insert(tree, hwirq, &irq_map[virq]);
  bail:
        spin_unlock_irqrestore(&irq_big_lock, flags);
        return virq;
index 9f0898c897592d41760817b396adeff3b15b3784..cd65c367b8b6d5c9abcc23fe7cbf595931814a5d 100644 (file)
@@ -61,6 +61,8 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
        if (!ret) {
                memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
                p->opcode = *p->addr;
+               flush_icache_range((unsigned long)p->ainsn.insn,
+                       (unsigned long)p->ainsn.insn + sizeof(kprobe_opcode_t));
        }
 
        return ret;
index 7e98e778b52ff66bbfa313ea58add73807a1cb33..359ab89748e05b7d179003fa28942c4b8edf2a9b 100644 (file)
@@ -112,7 +112,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
 static int __init add_legacy_soc_port(struct device_node *np,
                                      struct device_node *soc_dev)
 {
-       phys_addr_t addr;
+       u64 addr;
        u32 *addrp;
        upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
 
@@ -143,7 +143,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
        u32 *reg;
        char *typep;
        int index = -1;
-       phys_addr_t taddr;
+       u64 taddr;
 
        DBG(" -> add_legacy_isa_port(%s)\n", np->full_name);
 
@@ -165,10 +165,13 @@ static int __init add_legacy_isa_port(struct device_node *np,
        if (typep && *typep == 'S')
                index = simple_strtol(typep+1, NULL, 0) - 1;
 
-       /* Translate ISA address */
+       /* Translate ISA address. If it fails, we still register the port
+        * with no translated address so that it can be picked up as an IO
+        * port later by the serial driver
+        */
        taddr = of_translate_address(np, reg);
        if (taddr == OF_BAD_ADDR)
-               return -1;
+               taddr = 0;
 
        /* Add port, irq will be dealt with later */
        return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr,
@@ -180,7 +183,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
 static int __init add_legacy_pci_port(struct device_node *np,
                                      struct device_node *pci_dev)
 {
-       phys_addr_t addr, base;
+       u64 addr, base;
        u32 *addrp;
        unsigned int flags;
        int iotype, index = -1, lindex = 0;
index a81ca1b841ec89a0c5eff398b676dac5a3ae85fc..e60a0c544d6347684dda853203a30a9c362d3d8b 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/reboot.h>
 #include <linux/threads.h>
 #include <asm/machdep.h>
+#include <asm/lmb.h>
 
 void machine_crash_shutdown(struct pt_regs *regs)
 {
@@ -59,3 +60,58 @@ NORET_TYPE void machine_kexec(struct kimage *image)
        }
        for(;;);
 }
+
+static int __init early_parse_crashk(char *p)
+{
+       unsigned long size;
+
+       if (!p)
+               return 1;
+
+       size = memparse(p, &p);
+
+       if (*p == '@')
+               crashk_res.start = memparse(p + 1, &p);
+       else
+               crashk_res.start = KDUMP_KERNELBASE;
+
+       crashk_res.end = crashk_res.start + size - 1;
+
+       return 0;
+}
+early_param("crashkernel", early_parse_crashk);
+
+void __init reserve_crashkernel(void)
+{
+       unsigned long size;
+
+       if (crashk_res.start == 0)
+               return;
+
+       /* We might have got these values via the command line or the
+        * device tree, either way sanitise them now. */
+
+       size = crashk_res.end - crashk_res.start + 1;
+
+       if (crashk_res.start != KDUMP_KERNELBASE)
+               printk("Crash kernel location must be 0x%x\n",
+                               KDUMP_KERNELBASE);
+
+       crashk_res.start = KDUMP_KERNELBASE;
+       size = PAGE_ALIGN(size);
+       crashk_res.end = crashk_res.start + size - 1;
+
+       /* Crash kernel trumps memory limit */
+       if (memory_limit && memory_limit <= crashk_res.end) {
+               memory_limit = crashk_res.end + 1;
+               printk("Adjusted memory limit for crashkernel, now 0x%lx\n",
+                               memory_limit);
+       }
+
+       lmb_reserve(crashk_res.start, size);
+}
+
+int overlaps_crashkernel(unsigned long start, unsigned long size)
+{
+       return (start + size) > crashk_res.start && start <= crashk_res.end;
+}
index b438d45a068c6b0dd621b0f51520f9478b729539..be58985c7681edd8ffede42b4d32468494b2145f 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/cpumask.h>
 #include <linux/kexec.h>
 #include <linux/smp.h>
 #include <linux/thread_info.h>
@@ -21,7 +20,6 @@
 #include <asm/machdep.h>
 #include <asm/cacheflush.h>
 #include <asm/paca.h>
-#include <asm/lmb.h>
 #include <asm/mmu.h>
 #include <asm/sections.h>      /* _end */
 #include <asm/prom.h>
@@ -385,58 +383,3 @@ static int __init kexec_setup(void)
        return 0;
 }
 __initcall(kexec_setup);
-
-static int __init early_parse_crashk(char *p)
-{
-       unsigned long size;
-
-       if (!p)
-               return 1;
-
-       size = memparse(p, &p);
-
-       if (*p == '@')
-               crashk_res.start = memparse(p + 1, &p);
-       else
-               crashk_res.start = KDUMP_KERNELBASE;
-
-       crashk_res.end = crashk_res.start + size - 1;
-
-       return 0;
-}
-early_param("crashkernel", early_parse_crashk);
-
-void __init reserve_crashkernel(void)
-{
-       unsigned long size;
-
-       if (crashk_res.start == 0)
-               return;
-
-       /* We might have got these values via the command line or the
-        * device tree, either way sanitise them now. */
-
-       size = crashk_res.end - crashk_res.start + 1;
-
-       if (crashk_res.start != KDUMP_KERNELBASE)
-               printk("Crash kernel location must be 0x%x\n",
-                               KDUMP_KERNELBASE);
-
-       crashk_res.start = KDUMP_KERNELBASE;
-       size = PAGE_ALIGN(size);
-       crashk_res.end = crashk_res.start + size - 1;
-
-       /* Crash kernel trumps memory limit */
-       if (memory_limit && memory_limit <= crashk_res.end) {
-               memory_limit = crashk_res.end + 1;
-               printk("Adjusted memory limit for crashkernel, now 0x%lx\n",
-                               memory_limit);
-       }
-
-       lmb_reserve(crashk_res.start, size);
-}
-
-int overlaps_crashkernel(unsigned long start, unsigned long size)
-{
-       return (start + size) > crashk_res.start && start <= crashk_res.end;
-}
index bfb407fc1aa1f5ed747e789289a5daa53260dd81..e3ed21cd3d945e6d3e5afbfb64108dc5602517f6 100644 (file)
@@ -687,7 +687,7 @@ _GLOBAL(kexec_sequence)
        /* clear out hardware hash page table and tlb */
        ld      r5,0(r27)               /* deref function descriptor */
        mtctr   r5
-       bctrl                           /* ppc_md.hash_clear_all(void); */
+       bctrl                           /* ppc_md.hpte_clear_all(void); */
 
 /*
  *   kexec image calling is:
index ebd501a59abdaf3e800d94985b81fa6f58feb080..462bced40c128de355e9bc15c16989c3cfea8c5e 100644 (file)
@@ -557,7 +557,9 @@ unsigned long prom_memparse(const char *ptr, const char **retptr)
 static void __init early_cmdline_parse(void)
 {
        struct prom_t *_prom = &RELOC(prom);
+#ifdef CONFIG_PPC64
        const char *opt;
+#endif
        char *p;
        int l = 0;
 
@@ -2030,6 +2032,39 @@ static void __init fixup_device_tree_maple(void)
 #define fixup_device_tree_maple()
 #endif
 
+#ifdef CONFIG_PPC_CHRP
+/* Pegasos lacks the "ranges" property in the isa node */
+static void __init fixup_device_tree_chrp(void)
+{
+       phandle isa;
+       u32 isa_ranges[6];
+       char *name;
+       int rc;
+
+       name = "/pci@80000000/isa@c";
+       isa = call_prom("finddevice", 1, 1, ADDR(name));
+       if (!PHANDLE_VALID(isa))
+               return;
+
+       rc = prom_getproplen(isa, "ranges");
+       if (rc != 0 && rc != PROM_ERROR)
+               return;
+
+       prom_printf("Fixing up missing ISA range on Pegasos...\n");
+
+       isa_ranges[0] = 0x1;
+       isa_ranges[1] = 0x0;
+       isa_ranges[2] = 0x01006000;
+       isa_ranges[3] = 0x0;
+       isa_ranges[4] = 0x0;
+       isa_ranges[5] = 0x00010000;
+       prom_setprop(isa, name, "ranges",
+                       isa_ranges, sizeof(isa_ranges));
+}
+#else
+#define fixup_device_tree_chrp()
+#endif
+
 #if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
 static void __init fixup_device_tree_pmac(void)
 {
@@ -2077,6 +2112,7 @@ static void __init fixup_device_tree_pmac(void)
 static void __init fixup_device_tree(void)
 {
        fixup_device_tree_maple();
+       fixup_device_tree_chrp();
        fixup_device_tree_pmac();
 }
 
index 4a4cb5598402731afaa5717b25607a5272bab6ec..77f1e06d208d2984bf0b12d79f2d6733c8c53b5f 100644 (file)
@@ -569,6 +569,27 @@ int rtas_set_indicator(int indicator, int index, int new_value)
 }
 EXPORT_SYMBOL(rtas_set_indicator);
 
+/*
+ * Ignoring RTAS extended delay
+ */
+int rtas_set_indicator_fast(int indicator, int index, int new_value)
+{
+       int rc;
+       int token = rtas_token("set-indicator");
+
+       if (token == RTAS_UNKNOWN_SERVICE)
+               return -ENOENT;
+
+       rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);
+
+       WARN_ON(rc == -2 || (rc >= 9900 && rc <= 9905));
+
+       if (rc < 0)
+               return rtas_error_rc(rc);
+
+       return rc;
+}
+
 void rtas_restart(char *cmd)
 {
        if (rtas_flash_term_hook)
index 46c56cfd1b2f9685aa69a2b4cbc879009b48c6e2..6a9bc9ce54e0a2304d5a590659822f95e4aad98a 100644 (file)
@@ -144,13 +144,15 @@ void smp_message_recv(int msg, struct pt_regs *regs)
 
 void smp_send_reschedule(int cpu)
 {
-       smp_ops->message_pass(cpu, PPC_MSG_RESCHEDULE);
+       if (likely(smp_ops))
+               smp_ops->message_pass(cpu, PPC_MSG_RESCHEDULE);
 }
 
 #ifdef CONFIG_DEBUGGER
 void smp_send_debugger_break(int cpu)
 {
-       smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
+       if (likely(smp_ops))
+               smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
 }
 #endif
 
@@ -158,7 +160,7 @@ void smp_send_debugger_break(int cpu)
 void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
 {
        crash_ipi_function_ptr = crash_ipi_callback;
-       if (crash_ipi_callback) {
+       if (crash_ipi_callback && smp_ops) {
                mb();
                smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK);
        }
@@ -220,6 +222,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
        /* Can deadlock when called with interrupts disabled */
        WARN_ON(irqs_disabled());
 
+       if (unlikely(smp_ops == NULL))
+               return -1;
+
        data.func = func;
        data.info = info;
        atomic_set(&data.started, 0);
@@ -357,7 +362,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
        smp_store_cpu_info(boot_cpuid);
        cpu_callin_map[boot_cpuid] = 1;
 
-       max_cpus = smp_ops->probe();
+       if (smp_ops)
+               max_cpus = smp_ops->probe();
+       else
+               max_cpus = 1;
  
        smp_space_timers(max_cpus);
 
@@ -453,7 +461,7 @@ void generic_mach_cpu_die(void)
 
 static int __devinit cpu_enable(unsigned int cpu)
 {
-       if (smp_ops->cpu_enable)
+       if (smp_ops && smp_ops->cpu_enable)
                return smp_ops->cpu_enable(cpu);
 
        return -ENOSYS;
@@ -467,7 +475,8 @@ int __devinit __cpu_up(unsigned int cpu)
        if (!cpu_enable(cpu))
                return 0;
 
-       if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu))
+       if (smp_ops == NULL ||
+           (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)))
                return -EINVAL;
 
        /* Make sure callin-map entry is 0 (can be leftover a CPU
@@ -568,7 +577,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
        old_mask = current->cpus_allowed;
        set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid));
        
-       smp_ops->setup_cpu(boot_cpuid);
+       if (smp_ops)
+               smp_ops->setup_cpu(boot_cpuid);
 
        set_cpus_allowed(current, old_mask);
 
index 0104350955501942833470f5a7c578d6125530cd..fec228cd0163d69d60c9b5a12e3938596d0b04f2 100644 (file)
@@ -278,7 +278,7 @@ static void unregister_cpu_online(unsigned int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-static int __devinit sysfs_cpu_notify(struct notifier_block *self,
+static int __cpuinit sysfs_cpu_notify(struct notifier_block *self,
                                      unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned int)(long)hcpu;
@@ -296,7 +296,7 @@ static int __devinit sysfs_cpu_notify(struct notifier_block *self,
        return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata sysfs_cpu_nb = {
+static struct notifier_block __cpuinitdata sysfs_cpu_nb = {
        .notifier_call  = sysfs_cpu_notify,
 };
 
index 3c668078e524fefb03c628dd1fd986d8745f092d..e4d1713e8aea30fe225d07c39b18cb9b2df5ca92 100644 (file)
@@ -55,9 +55,6 @@
 
 #ifdef CONFIG_PPC64    /* XXX */
 #define _IO_BASE       pci_io_base
-#ifdef CONFIG_KEXEC
-cpumask_t cpus_in_sr = CPU_MASK_NONE;
-#endif
 #endif
 
 #ifdef CONFIG_DEBUGGER
@@ -150,13 +147,9 @@ int die(const char *str, struct pt_regs *regs, long err)
        if (in_interrupt())
                panic("Fatal exception in interrupt");
 
-       if (panic_on_oops) {
-#ifdef CONFIG_PPC64
-               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
-               ssleep(5);
-#endif
+       if (panic_on_oops)
                panic("Fatal exception");
-       }
+
        do_exit(err);
 
        return 0;
@@ -215,6 +208,19 @@ void system_reset_exception(struct pt_regs *regs)
 
        die("System Reset", regs, SIGABRT);
 
+       /*
+        * Some CPUs when released from the debugger will execute this path.
+        * These CPUs entered the debugger via a soft-reset. If the CPU was
+        * hung before entering the debugger it will return to the hung
+        * state when exiting this function.  This causes a problem in
+        * kdump since the hung CPU(s) will not respond to the IPI sent
+        * from kdump. To prevent the problem we call crash_kexec_secondary()
+        * here. If a kdump had not been initiated or we exit the debugger
+        * with the "exit and recover" command (x) crash_kexec_secondary()
+        * will return after 5ms and the CPU returns to its previous state.
+        */
+       crash_kexec_secondary(regs);
+
        /* Must die if the interrupt is not recoverable */
        if (!(regs->msr & MSR_RI))
                panic("Unrecoverable System Reset");
index 0835b4841dea41d8157fde5a7faa37f68a7aab12..2d17f2b8eda73323444208ed4744c0f04104e6e8 100644 (file)
@@ -81,10 +81,14 @@ static int udbg_550_getc(void)
 void udbg_init_uart(void __iomem *comport, unsigned int speed,
                    unsigned int clock)
 {
-       unsigned int dll, base_bauds = clock / 16;
+       unsigned int dll, base_bauds;
 
+       if (clock == 0)
+               clock = 1843200;
        if (speed == 0)
                speed = 9600;
+
+       base_bauds = clock / 16;
        dll = base_bauds / speed;
 
        if (comport) {
index 8a3bed5f143a14f4a226a26fbcae4a2ba07e9791..3726358faae88444f8603c7a8cc8f0b394095846 100644 (file)
@@ -14,7 +14,8 @@ obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
 
 
 EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
-EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1
+EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
+               $(call ld-option, -Wl$(comma)--hash-style=sysv)
 EXTRA_AFLAGS := -D__VDSO32__ -s
 
 obj-y += vdso32_wrapper.o
index f4bad720cb0a1b7f450260671844261f0ebb634e..6187af2d54c393ea825e523172636ebbcd062427 100644 (file)
@@ -14,6 +14,7 @@ SECTIONS
 {
   . = VDSO32_LBASE + SIZEOF_HEADERS;
   .hash           : { *(.hash) }                       :text
+  .gnu.hash       : { *(.gnu.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
index ab39988452ccb8f5ec90fc19c03ecb5be117b0ab..43af9b2a6f3bd21dc8b3d4f86faa7928f041648b 100644 (file)
@@ -8,7 +8,8 @@ targets := $(obj-vdso64) vdso64.so
 obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
 
 EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
-EXTRA_CFLAGS +=  -nostdlib -Wl,-soname=linux-vdso64.so.1
+EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
+               $(call ld-option, -Wl$(comma)--hash-style=sysv)
 EXTRA_AFLAGS := -D__VDSO64__ -s
 
 obj-y += vdso64_wrapper.o
index 4bdf224464abaf2914a2d62bb285f5f3404fe85c..4a2b6dc0960c582b3b0f0f9c8ba73a171195ee0c 100644 (file)
@@ -12,6 +12,7 @@ SECTIONS
 {
   . = VDSO64_LBASE + SIZEOF_HEADERS;
   .hash           : { *(.hash) }               :text
+  .gnu.hash       : { *(.gnu.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
index 4b17a7359924ef5e339753194a25ab5a2b59254f..716a2906a24da373a9e892e1486e24f1316d271e 100644 (file)
@@ -320,7 +320,8 @@ void __init lmb_enforce_memory_limit(unsigned long memory_limit)
                break;
        }
 
-       lmb.rmo_size = lmb.memory.region[0].size;
+       if (lmb.memory.region[0].size < lmb.rmo_size)
+               lmb.rmo_size = lmb.memory.region[0].size;
 
        /* And truncate any reserves above the limit also. */
        for (i = 0; i < lmb.reserved.cnt; i++) {
index 538e337d63e244ec423212c09a3eaa53a7481c3f..9c08ff3222900d6e0475b01967e79abfc7cda018 100644 (file)
@@ -291,10 +291,6 @@ void __init chrp_setup_arch(void)
 
        pci_create_OF_bus_map();
 
-#ifdef CONFIG_SMP
-       smp_ops = &chrp_smp_ops;
-#endif /* CONFIG_SMP */
-
        /*
         * Print the banner, then scroll down so boot progress
         * can be printed.  -- Cort
@@ -479,6 +475,14 @@ void __init chrp_init_IRQ(void)
        chrp_find_openpic();
        chrp_find_8259();
 
+#ifdef CONFIG_SMP
+       /* Pegasos has no MPIC, those ops would make it crash. It might be an
+        * option to move setting them to after we probe the PIC though
+        */
+       if (chrp_mpic != NULL)
+               smp_ops = &chrp_smp_ops;
+#endif /* CONFIG_SMP */
+
        if (_chrp_type == _CHRP_Pegasos)
                ppc_md.get_irq        = i8259_irq;
 
index cb528c9de4c36fbec879871f5e1c52524eff274c..57567dfb98192cbf5fc781c144d28d67738487ea 100644 (file)
@@ -221,10 +221,17 @@ static void __init maple_init_IRQ(void)
         * in Maple device-tree where the type of the controller is
         * open-pic and not interrupt-controller
         */
-       for_each_node_by_type(np, "open-pic") {
-               mpic_node = np;
-               break;
-       }
+
+       for_each_node_by_type(np, "interrupt-controller")
+               if (device_is_compatible(np, "open-pic")) {
+                       mpic_node = np;
+                       break;
+               }
+       if (mpic_node == NULL)
+               for_each_node_by_type(np, "open-pic") {
+                       mpic_node = np;
+                       break;
+               }
        if (mpic_node == NULL) {
                printk(KERN_ERR
                       "Failed to locate the MPIC interrupt controller\n");
@@ -252,6 +259,8 @@ static void __init maple_init_IRQ(void)
 
        /* XXX Maple specific bits */
        flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET;
+       /* All U3/U4 are big-endian, older SLOF firmware doesn't encode this */
+       flags |= MPIC_BIG_ENDIAN;
 
        /* Setup the openpic driver. More device-tree junks, we hard code no
         * ISUs for now. I'll have to revisit some stuffs with the folks doing
index 74eed6b74cd6dbf3a762328f9b5218b09e5f4a92..d6641549105523be39a647c2c1409833b6e3d176 100644 (file)
 #include <linux/kernel.h>
 #include <linux/fb.h>
 #include <linux/backlight.h>
+#include <linux/adb.h>
+#include <linux/pmu.h>
+#include <asm/atomic.h>
 #include <asm/prom.h>
 #include <asm/backlight.h>
 
 #define OLD_BACKLIGHT_MAX 15
 
 static void pmac_backlight_key_worker(void *data);
+static void pmac_backlight_set_legacy_worker(void *data);
+
 static DECLARE_WORK(pmac_backlight_key_work, pmac_backlight_key_worker, NULL);
+static DECLARE_WORK(pmac_backlight_set_legacy_work, pmac_backlight_set_legacy_worker, NULL);
 
-/* Although this variable is used in interrupt context, it makes no sense to
- * protect it. No user is able to produce enough key events per second and
+/* Although these variables are used in interrupt context, it makes no sense to
+ * protect them. No user is able to produce enough key events per second and
  * notice the errors that might happen.
  */
 static int pmac_backlight_key_queued;
+static int pmac_backlight_set_legacy_queued;
+
+/* The via-pmu code allows the backlight to be grabbed, in which case the
+ * in-kernel control of the brightness needs to be disabled. This should
+ * only be used by really old PowerBooks.
+ */
+static atomic_t kernel_backlight_disabled = ATOMIC_INIT(0);
 
 /* Protect the pmac_backlight variable */
 DEFINE_MUTEX(pmac_backlight_mutex);
@@ -82,6 +95,9 @@ int pmac_backlight_curve_lookup(struct fb_info *info, int value)
 
 static void pmac_backlight_key_worker(void *data)
 {
+       if (atomic_read(&kernel_backlight_disabled))
+               return;
+
        mutex_lock(&pmac_backlight_mutex);
        if (pmac_backlight) {
                struct backlight_properties *props;
@@ -107,8 +123,12 @@ static void pmac_backlight_key_worker(void *data)
        mutex_unlock(&pmac_backlight_mutex);
 }
 
+/* This function is called in interrupt context */
 void pmac_backlight_key(int direction)
 {
+       if (atomic_read(&kernel_backlight_disabled))
+               return;
+
        /* we can receive multiple interrupts here, but the scheduled work
         * will run only once, with the last value
         */
@@ -116,7 +136,7 @@ void pmac_backlight_key(int direction)
        schedule_work(&pmac_backlight_key_work);
 }
 
-int pmac_backlight_set_legacy_brightness(int brightness)
+static int __pmac_backlight_set_legacy_brightness(int brightness)
 {
        int error = -ENXIO;
 
@@ -145,6 +165,28 @@ int pmac_backlight_set_legacy_brightness(int brightness)
        return error;
 }
 
+static void pmac_backlight_set_legacy_worker(void *data)
+{
+       if (atomic_read(&kernel_backlight_disabled))
+               return;
+
+       __pmac_backlight_set_legacy_brightness(pmac_backlight_set_legacy_queued);
+}
+
+/* This function is called in interrupt context */
+void pmac_backlight_set_legacy_brightness_pmu(int brightness) {
+       if (atomic_read(&kernel_backlight_disabled))
+               return;
+
+       pmac_backlight_set_legacy_queued = brightness;
+       schedule_work(&pmac_backlight_set_legacy_work);
+}
+
+int pmac_backlight_set_legacy_brightness(int brightness)
+{
+       return __pmac_backlight_set_legacy_brightness(brightness);
+}
+
 int pmac_backlight_get_legacy_brightness()
 {
        int result = -ENXIO;
@@ -167,6 +209,16 @@ int pmac_backlight_get_legacy_brightness()
        return result;
 }
 
+void pmac_backlight_disable()
+{
+       atomic_inc(&kernel_backlight_disabled);
+}
+
+void pmac_backlight_enable()
+{
+       atomic_dec(&kernel_backlight_disabled);
+}
+
 EXPORT_SYMBOL_GPL(pmac_backlight);
 EXPORT_SYMBOL_GPL(pmac_backlight_mutex);
 EXPORT_SYMBOL_GPL(pmac_has_backlight_type);
index 871b002c9f90dd111963c1f2d465988647f7379a..6a026c733f6a069bffae70e1391cb1642244a847 100644 (file)
@@ -181,13 +181,18 @@ static void __init bootx_add_chosen_props(unsigned long base,
 }
 
 static void __init bootx_add_display_props(unsigned long base,
-                                          unsigned long *mem_end)
+                                          unsigned long *mem_end,
+                                          int has_real_node)
 {
        boot_infos_t *bi = bootx_info;
        u32 tmp;
 
-       bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end);
-       bootx_dt_add_prop("linux,opened", NULL, 0, mem_end);
+       if (has_real_node) {
+               bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end);
+               bootx_dt_add_prop("linux,opened", NULL, 0, mem_end);
+       } else
+               bootx_dt_add_prop("linux,bootx-noscreen", NULL, 0, mem_end);
+
        tmp = bi->dispDeviceDepth;
        bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end);
        tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0];
@@ -241,11 +246,6 @@ static void __init bootx_scan_dt_build_strings(unsigned long base,
                DBG(" detected display ! adding properties names !\n");
                bootx_dt_add_string("linux,boot-display", mem_end);
                bootx_dt_add_string("linux,opened", mem_end);
-               bootx_dt_add_string("linux,bootx-depth", mem_end);
-               bootx_dt_add_string("linux,bootx-width", mem_end);
-               bootx_dt_add_string("linux,bootx-height", mem_end);
-               bootx_dt_add_string("linux,bootx-linebytes", mem_end);
-               bootx_dt_add_string("linux,bootx-addr", mem_end);
                strncpy(bootx_disp_path, namep, 255);
        }
 
@@ -329,10 +329,13 @@ static void __init bootx_scan_dt_build_struct(unsigned long base,
                ppp = &pp->next;
        }
 
-       if (node == bootx_node_chosen)
+       if (node == bootx_node_chosen) {
                bootx_add_chosen_props(base, mem_end);
-       if (node == bootx_info->dispDeviceRegEntryOffset)
-               bootx_add_display_props(base, mem_end);
+               if (bootx_info->dispDeviceRegEntryOffset == 0)
+                       bootx_add_display_props(base, mem_end, 0);
+       }
+       else if (node == bootx_info->dispDeviceRegEntryOffset)
+               bootx_add_display_props(base, mem_end, 1);
 
        /* do all our children */
        cpp = &np->child;
@@ -374,6 +377,14 @@ static unsigned long __init bootx_flatten_dt(unsigned long start)
        mem_end += 4;
        bootx_dt_strend = mem_end;
        bootx_scan_dt_build_strings(base, 4, &mem_end);
+       /* Add some strings */
+       bootx_dt_add_string("linux,bootx-noscreen", &mem_end);
+       bootx_dt_add_string("linux,bootx-depth", &mem_end);
+       bootx_dt_add_string("linux,bootx-width", &mem_end);
+       bootx_dt_add_string("linux,bootx-height", &mem_end);
+       bootx_dt_add_string("linux,bootx-linebytes", &mem_end);
+       bootx_dt_add_string("linux,bootx-addr", &mem_end);
+       /* Wrap up strings */
        hdr->off_dt_strings = bootx_dt_strbase - mem_start;
        hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase;
 
@@ -471,6 +482,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
        if (bi->dispDeviceDepth == 16)
                bi->dispDeviceDepth = 15;
 
+
 #ifdef CONFIG_BOOTX_TEXT
        ptr = (unsigned long)bi->logicalDisplayBase;
        ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes;
@@ -508,6 +520,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
 #ifdef CONFIG_BOOTX_TEXT
        btext_welcome(bi);
 #endif
+
        /* New BootX enters kernel with MMU off, i/os are not allowed
         * here. This hack will have been done by the boostrap anyway.
         */
index f08a14516139f5f5c042c4d4a6a1b1f8ff910a57..7b1156ea5341ced1f27b8e0a874d55b3937daca4 100644 (file)
@@ -10,6 +10,8 @@
  * that is iMac G5 and latest single CPU desktop.
  */
 
+#undef DEBUG
+
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <asm/smu.h>
 #include <asm/pmac_pfunc.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
+#define DBG(fmt...) pr_debug(fmt)
 
 /* see 970FX user manual */
 
@@ -82,8 +78,6 @@ static struct freq_attr* g5_cpu_freqs_attr[] = {
 /* Power mode data is an array of the 32 bits PCR values to use for
  * the various frequencies, retrieved from the device-tree
  */
-static u32 *g5_pmode_data;
-static int g5_pmode_max;
 static int g5_pmode_cur;
 
 static void (*g5_switch_volt)(int speed_mode);
@@ -93,6 +87,11 @@ static int (*g5_query_freq)(void);
 static DEFINE_MUTEX(g5_switch_mutex);
 
 
+#ifdef CONFIG_PMAC_SMU
+
+static u32 *g5_pmode_data;
+static int g5_pmode_max;
+
 static struct smu_sdbp_fvt *g5_fvt_table;      /* table of op. points */
 static int g5_fvt_count;                       /* number of op. points */
 static int g5_fvt_cur;                         /* current op. point */
@@ -209,6 +208,16 @@ static int g5_scom_query_freq(void)
        return i;
 }
 
+/*
+ * Fake voltage switching for platforms with missing support
+ */
+
+static void g5_dummy_switch_volt(int speed_mode)
+{
+}
+
+#endif /* CONFIG_PMAC_SMU */
+
 /*
  * Platform function based voltage switching for PowerMac7,2 & 7,3
  */
@@ -248,6 +257,9 @@ static int g5_pfunc_switch_freq(int speed_mode)
        struct pmf_args args;
        u32 done = 0;
        unsigned long timeout;
+       int rc;
+
+       DBG("g5_pfunc_switch_freq(%d)\n", speed_mode);
 
        /* If frequency is going up, first ramp up the voltage */
        if (speed_mode < g5_pmode_cur)
@@ -255,9 +267,12 @@ static int g5_pfunc_switch_freq(int speed_mode)
 
        /* Do it */
        if (speed_mode == CPUFREQ_HIGH)
-               pmf_call_one(pfunc_cpu_setfreq_high, NULL);
+               rc = pmf_call_one(pfunc_cpu_setfreq_high, NULL);
        else
-               pmf_call_one(pfunc_cpu_setfreq_low, NULL);
+               rc = pmf_call_one(pfunc_cpu_setfreq_low, NULL);
+
+       if (rc)
+               printk(KERN_WARNING "cpufreq: pfunc switch error %d\n", rc);
 
        /* It's an irq GPIO so we should be able to just block here,
         * I'll do that later after I've properly tested the IRQ code for
@@ -296,13 +311,6 @@ static int g5_pfunc_query_freq(void)
        return val ? CPUFREQ_HIGH : CPUFREQ_LOW;
 }
 
-/*
- * Fake voltage switching for platforms with missing support
- */
-
-static void g5_dummy_switch_volt(int speed_mode)
-{
-}
 
 /*
  * Common interface to the cpufreq core
@@ -375,6 +383,8 @@ static struct cpufreq_driver g5_cpufreq_driver = {
 };
 
 
+#ifdef CONFIG_PMAC_SMU
+
 static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
 {
        struct device_node *cpunode;
@@ -525,6 +535,9 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
        return rc;
 }
 
+#endif /* CONFIG_PMAC_SMU */
+
+
 static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
 {
        struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL;
@@ -533,6 +546,9 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
        u64 max_freq, min_freq, ih, il;
        int has_volt = 1, rc = 0;
 
+       DBG("cpufreq: Initializing for PowerMac7,2, PowerMac7,3 and"
+           " RackMac3,1...\n");
+
        /* Get first CPU node */
        for (cpunode = NULL;
             (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
@@ -636,6 +652,15 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
         */
        ih = *((u32 *)(eeprom + 0x10));
        il = *((u32 *)(eeprom + 0x20));
+
+       /* Check for machines with no useful settings */
+       if (il == ih) {
+               printk(KERN_WARNING "cpufreq: No low frequency mode available"
+                      " on this model !\n");
+               rc = -ENODEV;
+               goto bail;
+       }
+
        min_freq = 0;
        if (ih != 0 && il != 0)
                min_freq = (max_freq * il) / ih;
@@ -643,7 +668,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
        /* Sanity check */
        if (min_freq >= max_freq || min_freq < 1000) {
                printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n");
-               rc = -ENODEV;
+               rc = -ENXIO;
                goto bail;
        }
        g5_cpu_freqs[0].frequency = max_freq;
@@ -690,16 +715,10 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
        return rc;
 }
 
-static int __init g5_rm31_cpufreq_init(struct device_node *cpus)
-{
-       /* NYI */
-       return 0;
-}
-
 static int __init g5_cpufreq_init(void)
 {
        struct device_node *cpus;
-       int rc;
+       int rc = 0;
 
        cpus = of_find_node_by_path("/cpus");
        if (cpus == NULL) {
@@ -708,12 +727,13 @@ static int __init g5_cpufreq_init(void)
        }
 
        if (machine_is_compatible("PowerMac7,2") ||
-           machine_is_compatible("PowerMac7,3"))
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
                rc = g5_pm72_cpufreq_init(cpus);
-       else if (machine_is_compatible("RackMac3,1"))
-               rc = g5_rm31_cpufreq_init(cpus);
+#ifdef CONFIG_PMAC_SMU
        else
                rc = g5_neo2_cpufreq_init(cpus);
+#endif /* CONFIG_PMAC_SMU */
 
        of_node_put(cpus);
        return rc;
index 54a52437265c50ecb5d0038a3c070c67d1945a9c..31867a701fcbfe25b20b29ae02a3c4b04e714515 100644 (file)
@@ -213,8 +213,6 @@ static void pseries_lpar_enable_pmcs(void)
 {
        unsigned long set, reset;
 
-       power4_enable_pmcs();
-
        set = 1UL << 63;
        reset = 0;
        plpar_hcall_norets(H_PERFMON, set, reset);
@@ -501,7 +499,8 @@ static void pseries_dedicated_idle_sleep(void)
        }
 
        /*
-        * Cede if the other thread is not idle, so that it can
+        * If not SMT, cede processor.  If CPU is running SMT
+        * cede if the other thread is not idle, so that it can
         * go single-threaded.  If the other thread is idle,
         * we ask the hypervisor if it has pending work it
         * wants to do and cede if it does.  Otherwise we keep
@@ -514,7 +513,8 @@ static void pseries_dedicated_idle_sleep(void)
         * very low priority.  The cede enables interrupts, which
         * doesn't matter here.
         */
-       if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
+       if (!cpu_has_feature(CPU_FTR_SMT) || !lppaca[cpu ^ 1].idle
+           || poll_pending() == H_PENDING)
                cede_processor();
 
 out:
index 2d0da6f9e244b9fa44c4f710828fd8a5c86d19a7..e98863025721d47e907fc35e94c8cace7ce1a5a0 100644 (file)
@@ -467,7 +467,7 @@ void xics_setup_cpu(void)
         *
         * XXX: undo of teardown on kexec needs this too, as may hotplug
         */
-       rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
+       rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
                (1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
 }
 
@@ -796,7 +796,7 @@ void xics_teardown_cpu(int secondary)
         * so leave the master cpu in the group.
         */
        if (secondary)
-               rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
+               rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
                                   (1UL << interrupt_server_size) - 1 -
                                   default_distrib_server, 0);
 }
@@ -813,7 +813,7 @@ void xics_migrate_irqs_away(void)
        xics_set_cpu_priority(cpu, 0);
 
        /* remove ourselves from the global interrupt queue */
-       status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
+       status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
                (1UL << interrupt_server_size) - 1 - default_distrib_server, 0);
        WARN_ON(status < 0);
 
index e983972132d8cf2f37d3cbd1fecf5ac19bb8eed3..12b65609c072cd801acb8f469a6b2e667f2147a3 100644 (file)
@@ -169,8 +169,16 @@ static int __init gfar_of_init(void)
                        goto err;
                }
 
-               mac_addr = get_property(np, "address", NULL);
-               memcpy(gfar_data.mac_addr, mac_addr, 6);
+               mac_addr = get_property(np, "local-mac-address", NULL);
+               if (mac_addr == NULL)
+                       mac_addr = get_property(np, "mac-address", NULL);
+               if (mac_addr == NULL) {
+                       /* Obsolete */
+                       mac_addr = get_property(np, "address", NULL);
+               }
+
+               if (mac_addr)
+                       memcpy(gfar_data.mac_addr, mac_addr, 6);
 
                if (model && !strcasecmp(model, "TSEC"))
                        gfar_data.device_flags =
index 09c6525cfa6133081b962fdc0257e6189dbe0d67..095fd3323323b077a3acbcdcdf00e91c7bacce02 100644 (file)
@@ -8,6 +8,7 @@ SECTIONS
   . = + SIZEOF_HEADERS;
   .interp : { *(.interp) }
   .hash          : { *(.hash)          }
+  .gnu.hash      : { *(.gnu.hash)      }
   .dynsym        : { *(.dynsym)                }
   .dynstr        : { *(.dynstr)                }
   .rel.text      : { *(.rel.text)              }
index d0f82c995af680a3c678d68c60094ae91b056348..a0a94e0ef8d121b38542c965def18842cfc845f2 100644 (file)
@@ -617,6 +617,7 @@ appldata_offline_cpu(int cpu)
        spin_unlock(&appldata_timer_lock);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
 static int __cpuinit
 appldata_cpu_notify(struct notifier_block *self,
                    unsigned long action, void *hcpu)
@@ -625,20 +626,19 @@ appldata_cpu_notify(struct notifier_block *self,
        case CPU_ONLINE:
                appldata_online_cpu((long) hcpu);
                break;
-#ifdef CONFIG_HOTPLUG_CPU
        case CPU_DEAD:
                appldata_offline_cpu((long) hcpu);
                break;
-#endif
        default:
                break;
        }
        return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata appldata_nb = {
+static struct notifier_block appldata_nb = {
        .notifier_call = appldata_cpu_notify,
 };
+#endif
 
 /*
  * appldata_init()
@@ -662,7 +662,7 @@ static int __init appldata_init(void)
                appldata_online_cpu(i);
 
        /* Register cpu hotplug notifier */
-       register_cpu_notifier(&appldata_nb);
+       register_hotcpu_notifier(&appldata_nb);
 
        appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 1);
 #ifdef MODULE
index f4dfc10026d2411fb8ec0a301360fb50b1dbf5f9..f1d4591eddbbd3bcf26801a728e033992841f412 100644 (file)
@@ -1,13 +1,16 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc1
-# Mon Apr  3 14:34:15 2006
+# Linux kernel version: 2.6.18-rc2
+# Thu Jul 27 13:51:07 2006
 #
 CONFIG_MMU=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_S390=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -25,6 +28,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 CONFIG_AUDIT=y
 # CONFIG_AUDITSYSCALL is not set
@@ -43,10 +47,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -94,7 +100,6 @@ CONFIG_HOTPLUG_CPU=y
 CONFIG_DEFAULT_MIGRATION_COST=1000000
 CONFIG_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
-CONFIG_BINFMT_ELF32=y
 
 #
 # Code generation options
@@ -115,6 +120,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
 
 #
 # I/O subsystem configuration
@@ -142,6 +148,7 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
 # CONFIG_APPLDATA_BASE is not set
 CONFIG_NO_IDLE_HZ=y
 CONFIG_NO_IDLE_HZ_INIT=y
+CONFIG_S390_HYPFS_FS=y
 CONFIG_KEXEC=y
 
 #
@@ -174,6 +181,8 @@ CONFIG_IP_FIB_HASH=y
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -186,7 +195,10 @@ CONFIG_IPV6=y
 # CONFIG_INET6_IPCOMP is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=y
+CONFIG_INET6_XFRM_MODE_TUNNEL=y
 # CONFIG_IPV6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -263,6 +275,7 @@ CONFIG_NET_ESTIMATOR=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_TCPPROBE is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
@@ -276,6 +289,7 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
+CONFIG_SYS_HYPERVISOR=y
 
 #
 # Connector - unified userspace <-> kernelspace linker
@@ -334,6 +348,7 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 
@@ -359,9 +374,7 @@ CONFIG_MD_LINEAR=m
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 # CONFIG_MD_RAID10 is not set
-CONFIG_MD_RAID5=m
-# CONFIG_MD_RAID5_RESHAPE is not set
-# CONFIG_MD_RAID6 is not set
+# CONFIG_MD_RAID456 is not set
 CONFIG_MD_MULTIPATH=m
 # CONFIG_MD_FAULTY is not set
 CONFIG_BLK_DEV_DM=y
@@ -419,7 +432,8 @@ CONFIG_S390_TAPE_34XX=m
 #
 # Cryptographic devices
 #
-CONFIG_Z90CRYPT=m
+CONFIG_ZCRYPT=m
+# CONFIG_ZCRYPT_MONOLITHIC is not set
 
 #
 # Network device support
@@ -509,6 +523,7 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
@@ -614,26 +629,36 @@ CONFIG_MSDOS_PARTITION=y
 # Instrumentation Support
 #
 # CONFIG_PROFILING is not set
-# CONFIG_STATISTICS is not set
+CONFIG_STATISTICS=y
+CONFIG_KPROBES=y
 
 #
 # Kernel hacking
 #
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_DETECT_SOFTLOCKUP is not set
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
 CONFIG_DEBUG_PREEMPT=y
-CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_FRAME_POINTER is not set
 # CONFIG_UNWIND_INFO is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
@@ -688,3 +713,4 @@ CONFIG_CRYPTO=y
 # CONFIG_CRC16 is not set
 CONFIG_CRC32=m
 # CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
index eb6ebfef134ae8b710def114b33533507e62a673..6e6b6de77770672968d528f42f5d824bca031e1a 100644 (file)
@@ -129,7 +129,7 @@ void __init paging_init(void)
                 /*
                  * pg_table is physical at this point
                  */
-               pg_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
+               pg_table = (pte_t *) alloc_bootmem_pages(PAGE_SIZE);
 
                 pg_dir->pgd0 =  (_PAGE_TABLE | __pa(pg_table));
                 pg_dir->pgd1 =  (_PAGE_TABLE | (__pa(pg_table)+1024));
@@ -219,7 +219,7 @@ void __init paging_init(void)
                         continue;
                 }          
         
-               pm_dir = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE*4);
+               pm_dir = (pmd_t *) alloc_bootmem_pages(PAGE_SIZE * 4);
                 pgd_populate(&init_mm, pg_dir, pm_dir);
 
                 for (j = 0 ; j < PTRS_PER_PMD ; j++,pm_dir++) {
@@ -228,7 +228,7 @@ void __init paging_init(void)
                                 continue; 
                         }          
                         
-                        pt_dir = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
+                       pt_dir = (pte_t *) alloc_bootmem_pages(PAGE_SIZE);
                         pmd_populate_kernel(&init_mm, pm_dir, pt_dir);
        
                         for (k = 0 ; k < PTRS_PER_PTE ; k++,pt_dir++) {
index 781dbb11c03894b56e04668a0311a63c99fbb47b..b09805f3ee23799e8a78379856211d2b967a30f0 100644 (file)
@@ -421,18 +421,22 @@ static struct miscdevice sq_dev = {
 
 static int __init sq_api_init(void)
 {
+       int ret;
        printk(KERN_NOTICE "sq: Registering store queue API.\n");
 
-#ifdef CONFIG_PROC_FS
        create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
-#endif
 
-       return misc_register(&sq_dev);
+       ret = misc_register(&sq_dev);
+       if (ret)
+               remove_proc_entry("sq_mapping", NULL);
+
+       return ret;
 }
 
 static void __exit sq_api_exit(void)
 {
        misc_deregister(&sq_dev);
+       remove_proc_entry("sq_mapping", NULL);
 }
 
 module_init(sq_api_init);
index 04eb1eab6e3e17f2777045c86a31650900cb999e..845081b0126760ac14e8b7c2735ad089bee991f2 100644 (file)
@@ -225,6 +225,32 @@ static __inline__ int has_low_battery(void)
        return (data1 == data2);        /* Was the write blocked? */
 }
 
+static void __init mostek_set_system_time(void)
+{
+       unsigned int year, mon, day, hour, min, sec;
+       struct mostek48t02 *mregs;
+
+       mregs = (struct mostek48t02 *)mstk48t02_regs;
+       if(!mregs) {
+               prom_printf("Something wrong, clock regs not mapped yet.\n");
+               prom_halt();
+       }               
+       spin_lock_irq(&mostek_lock);
+       mregs->creg |= MSTK_CREG_READ;
+       sec = MSTK_REG_SEC(mregs);
+       min = MSTK_REG_MIN(mregs);
+       hour = MSTK_REG_HOUR(mregs);
+       day = MSTK_REG_DOM(mregs);
+       mon = MSTK_REG_MONTH(mregs);
+       year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
+       xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+       xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+        set_normalized_timespec(&wall_to_monotonic,
+                                -xtime.tv_sec, -xtime.tv_nsec);
+       mregs->creg &= ~MSTK_CREG_READ;
+       spin_unlock_irq(&mostek_lock);
+}
+
 /* Probe for the real time clock chip on Sun4 */
 static __inline__ void sun4_clock_probe(void)
 {
@@ -273,6 +299,7 @@ static __inline__ void sun4_clock_probe(void)
 #endif
 }
 
+#ifndef CONFIG_SUN4
 static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
 {
        struct device_node *dp = op->node;
@@ -307,6 +334,8 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id
        if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)
                kick_start_clock();
 
+       mostek_set_system_time();
+
        return 0;
 }
 
@@ -325,56 +354,37 @@ static struct of_platform_driver clock_driver = {
 
 
 /* Probe for the mostek real time clock chip. */
-static void clock_init(void)
+static int __init clock_init(void)
 {
-       of_register_driver(&clock_driver, &of_bus_type);
+       return of_register_driver(&clock_driver, &of_bus_type);
 }
 
+/* Must be after subsys_initcall() so that busses are probed.  Must
+ * be before device_initcall() because things like the RTC driver
+ * need to see the clock registers.
+ */
+fs_initcall(clock_init);
+#endif /* !CONFIG_SUN4 */
+
 void __init sbus_time_init(void)
 {
-       unsigned int year, mon, day, hour, min, sec;
-       struct mostek48t02 *mregs;
-
-#ifdef CONFIG_SUN4
-       int temp;
-       struct intersil *iregs;
-#endif
 
        BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM);
        btfixup();
 
        if (ARCH_SUN4)
                sun4_clock_probe();
-       else
-               clock_init();
 
        sparc_init_timers(timer_interrupt);
        
 #ifdef CONFIG_SUN4
        if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) {
-#endif
-       mregs = (struct mostek48t02 *)mstk48t02_regs;
-       if(!mregs) {
-               prom_printf("Something wrong, clock regs not mapped yet.\n");
-               prom_halt();
-       }               
-       spin_lock_irq(&mostek_lock);
-       mregs->creg |= MSTK_CREG_READ;
-       sec = MSTK_REG_SEC(mregs);
-       min = MSTK_REG_MIN(mregs);
-       hour = MSTK_REG_HOUR(mregs);
-       day = MSTK_REG_DOM(mregs);
-       mon = MSTK_REG_MONTH(mregs);
-       year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
-       xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
-       xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
-        set_normalized_timespec(&wall_to_monotonic,
-                                -xtime.tv_sec, -xtime.tv_nsec);
-       mregs->creg &= ~MSTK_CREG_READ;
-       spin_unlock_irq(&mostek_lock);
-#ifdef CONFIG_SUN4
+               mostek_set_system_time();
        } else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) {
                /* initialise the intersil on sun4 */
+               unsigned int year, mon, day, hour, min, sec;
+               int temp;
+               struct intersil *iregs;
 
                iregs=intersil_clock;
                if(!iregs) {
index 1605967cce91c1a076a482a56cb9cf399ebc204e..55ae802dc0ad6ffd6c06b9bd12e860f9a777267b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/kprobes.h>
+#include <linux/kallsyms.h>
 
 #include <asm/page.h>
 #include <asm/pgtable.h>
@@ -132,6 +133,8 @@ static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
 
        printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
               regs->tpc);
+       printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]);
+       print_symbol("RPC: <%s>\n", regs->u_regs[15]);
        printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
        __asm__("mov %%sp, %0" : "=r" (ksp));
        show_stack(current, ksp);
index 2517ecb8bf27d07d56fc5903c0cd26052aa7617a..68ed24df5c8fa7f24d5089e305fa91e743c37e5a 100644 (file)
@@ -26,6 +26,7 @@ SECTIONS
 
   /* Read-only sections, merged into text segment: */
   .hash           : { *(.hash) }
+  .gnu.hash       : { *(.gnu.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
index 62bdb8d29fc05191750c7f1033a802e24f445d4d..1bf672a25692a9b3575d527092a1b255430e391f 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * arch/v850/kernel/setup.c -- Arch-dependent initialization functions
  *
- *  Copyright (C) 2001,02,03,05  NEC Electronics Corporation
- *  Copyright (C) 2001,02,03,05  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 2001,02,03,05,06  NEC Electronics Corporation
+ *  Copyright (C) 2001,02,03,05,06  Miles Bader <miles@gnu.org>
  *
  * This file is subject to the terms and conditions of the GNU General
  * Public License.  See the file COPYING in the main directory of this
@@ -190,7 +190,7 @@ void free_initmem (void)
                for (addr = start; addr < end; addr += PAGE_SIZE) {
                        struct page *page = virt_to_page (addr);
                        ClearPageReserved (page);
-                       set_page_count (page, 1);
+                       init_page_count (page);
                        __free_page (page);
                        total_ram_pages++;
                }
index c03ad6ed61cca6f10139895a4f4ba4dcb89deef7..67bc48e57c60061c707f762c3b74de88dcb1338f 100644 (file)
@@ -21,9 +21,6 @@ EXPORT_SYMBOL (trap_table);
 
 /* platform dependent support */
 EXPORT_SYMBOL (kernel_thread);
-EXPORT_SYMBOL (enable_irq);
-EXPORT_SYMBOL (disable_irq);
-EXPORT_SYMBOL (disable_irq_nosync);
 EXPORT_SYMBOL (__bug);
 
 /* Networking helper routines. */
@@ -33,22 +30,9 @@ EXPORT_SYMBOL (ip_compute_csum);
 EXPORT_SYMBOL (ip_fast_csum);
 
 /* string / mem functions */
-EXPORT_SYMBOL (strcpy);
-EXPORT_SYMBOL (strncpy);
-EXPORT_SYMBOL (strcat);
-EXPORT_SYMBOL (strncat);
-EXPORT_SYMBOL (strcmp);
-EXPORT_SYMBOL (strncmp);
-EXPORT_SYMBOL (strchr);
-EXPORT_SYMBOL (strlen);
-EXPORT_SYMBOL (strnlen);
-EXPORT_SYMBOL (strrchr);
-EXPORT_SYMBOL (strstr);
 EXPORT_SYMBOL (memset);
 EXPORT_SYMBOL (memcpy);
 EXPORT_SYMBOL (memmove);
-EXPORT_SYMBOL (memcmp);
-EXPORT_SYMBOL (memscan);
 
 /* semaphores */
 EXPORT_SYMBOL (__down);
index 83d389b8ebd80f8f3eddb23a2b5cc802f6284136..840d5d93d5cc9f3447c844f1a4eef8e6f6ffef87 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-git22
-# Tue Jul  4 14:24:40 2006
+# Linux kernel version: 2.6.18-rc2
+# Tue Jul 18 17:13:20 2006
 #
 CONFIG_X86_64=y
 CONFIG_64BIT=y
@@ -37,6 +37,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
@@ -413,6 +414,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -1195,7 +1197,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
-# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
@@ -1373,7 +1375,6 @@ CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
index 62bc5f56da9e7cf8def1e9749297c6e2b1234cf1..cdae36435e21a308aece3f925cf71e5a5b8a7c8a 100644 (file)
@@ -23,6 +23,7 @@ targets := $(foreach F,sysenter syscall,vsyscall-$F.o vsyscall-$F.so)
 # The DSO images are built using a special linker script
 quiet_cmd_syscall = SYSCALL $@
       cmd_syscall = $(CC) -m32 -nostdlib -shared -s \
+                         $(call ld-option, -Wl$(comma)--hash-style=sysv) \
                           -Wl,-soname=linux-gate.so.1 -o $@ \
                           -Wl,-T,$(filter-out FORCE,$^)
 
index 9b5bb413a6e938ea1efe0c41327563e07547774d..5d4a7d125ed0bbd9cbc0729290b25475b3a1534d 100644 (file)
@@ -103,7 +103,7 @@ ENTRY(ia32_sysenter_target)
        pushq   %rax
        CFI_ADJUST_CFA_OFFSET 8
        cld
-       SAVE_ARGS 0,0,1
+       SAVE_ARGS 0,0,0
        /* no need to do an access_ok check here because rbp has been
           32bit zero extended */ 
 1:     movl    (%rbp),%r9d
index f2e75ed4c6c757caca14fa19cb488e75d97f685e..1dc86ff5bcb9013a3fa404700129ce528ae0061b 100644 (file)
@@ -11,6 +11,7 @@ SECTIONS
   . = VSYSCALL_BASE + SIZEOF_HEADERS;
 
   .hash           : { *(.hash) }               :text
+  .gnu.hash       : { *(.gnu.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
index d464dded68c0eb363e1ca848cb5563d34a74b724..6f810424df44ba4aeb5fcd6abb1aea960b07d50b 100644 (file)
@@ -513,6 +513,7 @@ END(stub_rt_sigreturn)
        swapgs  
 1:     incl    %gs:pda_irqcount        # RED-PEN should check preempt count
        cmoveq %gs:pda_irqstackptr,%rsp
+       push    %rbp                    # backlink for old unwinder
        /*
         * We entered an interrupt context - irqs are off:
         */
@@ -1139,18 +1140,21 @@ ENTRY(machine_check)
 END(machine_check)
 #endif
 
+/* Call softirq on interrupt stack. Interrupts are off. */
 ENTRY(call_softirq)
        CFI_STARTPROC
-       movq %gs:pda_irqstackptr,%rax
-       movq %rsp,%rdx
-       CFI_DEF_CFA_REGISTER    rdx
+       push %rbp
+       CFI_ADJUST_CFA_OFFSET   8
+       CFI_REL_OFFSET rbp,0
+       mov  %rsp,%rbp
+       CFI_DEF_CFA_REGISTER rbp
        incl %gs:pda_irqcount
-       cmove %rax,%rsp
-       pushq %rdx
-       /*todo CFI_DEF_CFA_EXPRESSION ...*/
+       cmove %gs:pda_irqstackptr,%rsp
+       push  %rbp                      # backlink for old unwinder
        call __do_softirq
-       popq %rsp
+       leaveq
        CFI_DEF_CFA_REGISTER    rsp
+       CFI_ADJUST_CFA_OFFSET   -8
        decl %gs:pda_irqcount
        ret
        CFI_ENDPROC
index 83fb24a02821e0f67d6c14b5cff6b417da5e0221..106076b370fc8fa8a4cfc2faf610bf237b2dbde0 100644 (file)
@@ -207,14 +207,11 @@ NORET_TYPE void machine_kexec(struct kimage *image)
        __flush_tlb();
 
 
-       /* The segment registers are funny things, they are
-        * automatically loaded from a table, in memory wherever you
-        * set them to a specific selector, but this table is never
-        * accessed again unless you set the segment to a different selector.
-        *
-        * The more common model are caches where the behide
-        * the scenes work is done, but is also dropped at arbitrary
-        * times.
+       /* The segment registers are funny things, they have both a
+        * visible and an invisible part.  Whenever the visible part is
+        * set to a specific selector, the invisible part is loaded
+        * with from a table in memory.  At no other time is the
+        * descriptor table in memory accessed.
         *
         * I take advantage of this here by force loading the
         * segments, before I zap the gdt with an invalid value.
index 88845674c661a39feefc5b35bb5c5dd9b2255be8..4e017fb30fb3f60c824fabc384bd895867dc90e8 100644 (file)
@@ -615,7 +615,7 @@ static __cpuinit int mce_create_device(unsigned int cpu)
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-static __cpuinit void mce_remove_device(unsigned int cpu)
+static void mce_remove_device(unsigned int cpu)
 {
        int i;
 
@@ -626,10 +626,9 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
        sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
        sysdev_unregister(&per_cpu(device_mce,cpu));
 }
-#endif
 
 /* Get notified when a cpu comes on/off. Be hotplug friendly. */
-static __cpuinit int
+static int
 mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
@@ -638,18 +637,17 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
        case CPU_ONLINE:
                mce_create_device(cpu);
                break;
-#ifdef CONFIG_HOTPLUG_CPU
        case CPU_DEAD:
                mce_remove_device(cpu);
                break;
-#endif
        }
        return NOTIFY_OK;
 }
 
-static struct notifier_block __cpuinitdata mce_cpu_notifier = {
+static struct notifier_block mce_cpu_notifier = {
        .notifier_call = mce_cpu_callback,
 };
+#endif
 
 static __init int mce_init_device(void)
 {
@@ -664,7 +662,7 @@ static __init int mce_init_device(void)
                mce_create_device(i);
        }
 
-       register_cpu_notifier(&mce_cpu_notifier);
+       register_hotcpu_notifier(&mce_cpu_notifier);
        misc_register(&mce_log_device);
        return err;
 }
index db2acbf7ad288b4621a7e4bcb7f79d86d13eef43..883fe747f64c3346e21f9d8c7ceed22244287b47 100644 (file)
@@ -558,7 +558,7 @@ out:
  *   of shared sysfs dir/files, and rest of the cores will be symlinked to it.
  */
 
-static __cpuinit void deallocate_threshold_block(unsigned int cpu,
+static void deallocate_threshold_block(unsigned int cpu,
                                                 unsigned int bank)
 {
        struct threshold_block *pos = NULL;
@@ -578,7 +578,7 @@ static __cpuinit void deallocate_threshold_block(unsigned int cpu,
        per_cpu(threshold_banks, cpu)[bank]->blocks = NULL;
 }
 
-static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank)
+static void threshold_remove_bank(unsigned int cpu, int bank)
 {
        int i = 0;
        struct threshold_bank *b;
@@ -618,7 +618,7 @@ free_out:
        per_cpu(threshold_banks, cpu)[bank] = NULL;
 }
 
-static __cpuinit void threshold_remove_device(unsigned int cpu)
+static void threshold_remove_device(unsigned int cpu)
 {
        unsigned int bank;
 
@@ -629,14 +629,8 @@ static __cpuinit void threshold_remove_device(unsigned int cpu)
        }
 }
 
-#else /* !CONFIG_HOTPLUG_CPU */
-static void threshold_remove_device(unsigned int cpu)
-{
-}
-#endif
-
 /* get notified when a cpu comes on/off */
-static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
+static int threshold_cpu_callback(struct notifier_block *nfb,
                                            unsigned long action, void *hcpu)
 {
        /* cpu was unsigned int to begin with */
@@ -659,9 +653,10 @@ static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
        return NOTIFY_OK;
 }
 
-static struct notifier_block threshold_cpu_notifier __cpuinitdata = {
+static struct notifier_block threshold_cpu_notifier = {
        .notifier_call = threshold_cpu_callback,
 };
+#endif /* CONFIG_HOTPLUG_CPU */
 
 static __init int threshold_init_device(void)
 {
@@ -673,7 +668,7 @@ static __init int threshold_init_device(void)
                if (err)
                        return err;
        }
-       register_cpu_notifier(&threshold_cpu_notifier);
+       register_hotcpu_notifier(&threshold_cpu_notifier);
        return 0;
 }
 
index e71ed53b08fb7bad84aa3f852504d1291237f249..146924ba5df5b5d86ec3aea9b2a1edddc17f83e8 100644 (file)
@@ -85,7 +85,8 @@
 #define CSR_AGENT_MASK         0xffe0ffff
 
 #define MAX_NUM_OF_PHBS                8 /* how many PHBs in total? */
-#define MAX_PHB_BUS_NUM                (MAX_NUM_OF_PHBS * 2) /* max dev->bus->number */
+#define MAX_NUM_CHASSIS                8 /* max number of chassis */
+#define MAX_PHB_BUS_NUM                (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2) /* max dev->bus->number */
 #define PHBS_PER_CALGARY       4
 
 /* register offsets in Calgary's internal register space */
@@ -110,7 +111,8 @@ static const unsigned long phb_offsets[] = {
        0xB000 /* PHB3 */
 };
 
-void* tce_table_kva[MAX_NUM_OF_PHBS * MAX_NUMNODES];
+static char bus_to_phb[MAX_PHB_BUS_NUM];
+void* tce_table_kva[MAX_PHB_BUS_NUM];
 unsigned int specified_table_size = TCE_TABLE_SIZE_UNSPECIFIED;
 static int translate_empty_slots __read_mostly = 0;
 static int calgary_detected __read_mostly = 0;
@@ -119,7 +121,7 @@ static int calgary_detected __read_mostly = 0;
  * the bitmap of PHBs the user requested that we disable
  * translation on.
  */
-static DECLARE_BITMAP(translation_disabled, MAX_NUMNODES * MAX_PHB_BUS_NUM);
+static DECLARE_BITMAP(translation_disabled, MAX_PHB_BUS_NUM);
 
 static void tce_cache_blast(struct iommu_table *tbl);
 
@@ -452,7 +454,7 @@ static struct dma_mapping_ops calgary_dma_ops = {
 
 static inline int busno_to_phbid(unsigned char num)
 {
-       return bus_to_phb(num) % PHBS_PER_CALGARY;
+       return bus_to_phb[num];
 }
 
 static inline unsigned long split_queue_offset(unsigned char num)
@@ -812,7 +814,7 @@ static int __init calgary_init(void)
        int i, ret = -ENODEV;
        struct pci_dev *dev = NULL;
 
-       for (i = 0; i <= num_online_nodes() * MAX_NUM_OF_PHBS; i++) {
+       for (i = 0; i < MAX_PHB_BUS_NUM; i++) {
                dev = pci_get_device(PCI_VENDOR_ID_IBM,
                                     PCI_DEVICE_ID_IBM_CALGARY,
                                     dev);
@@ -822,7 +824,7 @@ static int __init calgary_init(void)
                        calgary_init_one_nontraslated(dev);
                        continue;
                }
-               if (!tce_table_kva[i] && !translate_empty_slots) {
+               if (!tce_table_kva[dev->bus->number] && !translate_empty_slots) {
                        pci_dev_put(dev);
                        continue;
                }
@@ -842,7 +844,7 @@ error:
                        pci_dev_put(dev);
                        continue;
                }
-               if (!tce_table_kva[i] && !translate_empty_slots)
+               if (!tce_table_kva[dev->bus->number] && !translate_empty_slots)
                        continue;
                calgary_disable_translation(dev);
                calgary_free_tar(dev);
@@ -876,9 +878,10 @@ static inline int __init determine_tce_table_size(u64 ram)
 void __init detect_calgary(void)
 {
        u32 val;
-       int bus, table_idx;
+       int bus;
        void *tbl;
-       int detected = 0;
+       int calgary_found = 0;
+       int phb = -1;
 
        /*
         * if the user specified iommu=off or iommu=soft or we found
@@ -889,38 +892,46 @@ void __init detect_calgary(void)
 
        specified_table_size = determine_tce_table_size(end_pfn * PAGE_SIZE);
 
-       for (bus = 0, table_idx = 0;
-            bus <= num_online_nodes() * MAX_PHB_BUS_NUM;
-            bus++) {
-               BUG_ON(bus > MAX_NUMNODES * MAX_PHB_BUS_NUM);
+       for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
+               int dev;
+
+               tce_table_kva[bus] = NULL;
+               bus_to_phb[bus] = -1;
+
                if (read_pci_config(bus, 0, 0, 0) != PCI_VENDOR_DEVICE_ID_CALGARY)
                        continue;
+
+               /*
+                * There are 4 PHBs per Calgary chip.  Set phb to which phb (0-3)
+                * it is connected to releative to the clagary chip.
+                */
+               phb = (phb + 1) % PHBS_PER_CALGARY;
+
                if (test_bit(bus, translation_disabled)) {
                        printk(KERN_INFO "Calgary: translation is disabled for "
                               "PHB 0x%x\n", bus);
                        /* skip this phb, don't allocate a tbl for it */
-                       tce_table_kva[table_idx] = NULL;
-                       table_idx++;
                        continue;
                }
                /*
-                * scan the first slot of the PCI bus to see if there
-                * are any devices present
+                * Scan the slots of the PCI bus to see if there is a device present.
+                * The parent bus will be the zero-ith device, so start at 1.
                 */
-               val = read_pci_config(bus, 1, 0, 0);
-               if (val != 0xffffffff || translate_empty_slots) {
-                       tbl = alloc_tce_table();
-                       if (!tbl)
-                               goto cleanup;
-                       detected = 1;
-               } else
-                       tbl = NULL;
-
-               tce_table_kva[table_idx] = tbl;
-               table_idx++;
+               for (dev = 1; dev < 8; dev++) {
+                       val = read_pci_config(bus, dev, 0, 0);
+                       if (val != 0xffffffff || translate_empty_slots) {
+                               tbl = alloc_tce_table();
+                               if (!tbl)
+                                       goto cleanup;
+                               tce_table_kva[bus] = tbl;
+                               bus_to_phb[bus] = phb;
+                               calgary_found = 1;
+                               break;
+                       }
+               }
        }
 
-       if (detected) {
+       if (calgary_found) {
                iommu_detected = 1;
                calgary_detected = 1;
                printk(KERN_INFO "PCI-DMA: Calgary IOMMU detected. "
@@ -929,9 +940,9 @@ void __init detect_calgary(void)
        return;
 
 cleanup:
-       for (--table_idx; table_idx >= 0; --table_idx)
-               if (tce_table_kva[table_idx])
-                       free_tce_table(tce_table_kva[table_idx]);
+       for (--bus; bus >= 0; --bus)
+               if (tce_table_kva[bus])
+                       free_tce_table(tce_table_kva[bus]);
 }
 
 int __init calgary_iommu_init(void)
@@ -1002,7 +1013,7 @@ static int __init calgary_parse_options(char *p)
                        if (p == endp)
                                break;
 
-                       if (bridge <= (num_online_nodes() * MAX_PHB_BUS_NUM)) {
+                       if (bridge < MAX_PHB_BUS_NUM) {
                                printk(KERN_INFO "Calgary: disabling "
                                       "translation for PHB 0x%x\n", bridge);
                                set_bit(bridge, translation_disabled);
index c4c3cc36ac5b033997d5904fa5adff8fa4de54b8..aad7609d8e9249e6d9121128e723838a4e508da6 100644 (file)
@@ -92,5 +92,7 @@ void __init no_iommu_init(void)
 {
        if (dma_ops)
                return;
+
+       force_iommu = 0; /* no HW IOMMU */
        dma_ops = &nommu_dma_ops;
 }
index ebdb77fe20573702facc612fd1262ab3e3d93ade..6a55f87ba97f917ed2814bc3c11c3f21a3ad096b 100644 (file)
@@ -31,9 +31,10 @@ struct dma_mapping_ops swiotlb_dma_ops = {
 void pci_swiotlb_init(void)
 {
        /* don't initialize swiotlb if iommu=off (no_iommu=1) */
-       if (!iommu_detected && !no_iommu &&
-           (end_pfn > MAX_DMA32_PFN || force_iommu))
+       if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN)
               swiotlb = 1;
+       if (swiotlb_force)
+               swiotlb = 1;
        if (swiotlb) {
                printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
                swiotlb_init();
index 5a1c0a3bf87262c027c327773628e93e58194188..06af6ca601295e8253b95b999435710fdc8672e2 100644 (file)
@@ -203,7 +203,7 @@ int __cpuinit init_smp_flush(void)
 {
        int i;
        for_each_cpu_mask(i, cpu_possible_map) {
-               spin_lock_init(&per_cpu(flush_state.tlbstate_lock, i));
+               spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
        }
        return 0;
 }
index d3a9e79e954c43aaf8bd873be430a57448382c61..5530dda3f27ac3b84ec63a6e4f96662f4f50abc3 100644 (file)
@@ -96,7 +96,6 @@ static inline unsigned int table_size_to_number_of_entries(unsigned char size)
 static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
 {
        unsigned int bitmapsz;
-       unsigned int tce_table_index;
        unsigned long bmppages;
        int ret;
 
@@ -105,8 +104,7 @@ static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
        /* set the tce table size - measured in entries */
        tbl->it_size = table_size_to_number_of_entries(specified_table_size);
 
-       tce_table_index = bus_to_phb(tbl->it_busno);
-       tbl->it_base = (unsigned long)tce_table_kva[tce_table_index];
+       tbl->it_base = (unsigned long)tce_table_kva[dev->bus->number];
        if (!tbl->it_base) {
                printk(KERN_ERR "Calgary: iommu_table_setparms: "
                       "no table allocated?!\n");
index b9ff75992c16d85b8fd1c7b7a2118c7d6847087b..7a9b18224182ced7cd0932b2691249c69f70e4ad 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/acpi.h>
 #ifdef CONFIG_ACPI
 #include <acpi/achware.h>      /* for PM timer frequency */
+#include <acpi/acpi_bus.h>
 #endif
 #include <asm/8253pit.h>
 #include <asm/pgtable.h>
@@ -193,7 +194,7 @@ unsigned long profile_pc(struct pt_regs *regs)
           is just accounted to the spinlock function.
           Better would be to write these functions in assembler again
           and check exactly. */
-       if (in_lock_functions(pc)) {
+       if (!user_mode(regs) && in_lock_functions(pc)) {
                char *v = *(char **)regs->rsp;
                if ((v >= _stext && v <= _etext) ||
                        (v >= _sinittext && v <= _einittext) ||
@@ -953,11 +954,18 @@ __cpuinit int unsynchronized_tsc(void)
 #ifdef CONFIG_SMP
        if (apic_is_clustered_box())
                return 1;
-       /* Intel systems are normally all synchronized. Exceptions
-          are handled in the check above. */
-       if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
-               return 0;
 #endif
+       /* Most intel systems have synchronized TSCs except for
+          multi node systems */
+       if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+#ifdef CONFIG_ACPI
+               /* But TSC doesn't tick in C3 so don't use it there */
+               if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 100)
+                       return 1;
+#endif
+               return 0;
+       }
+
        /* Assume multi socket systems are not synchronized */
        return num_present_cpus() > 1;
 }
index eb39a2775236428a405aeda04227d15be93b8b27..14052f08981498a2ef13c0b2feaab12498ca07e3 100644 (file)
@@ -254,7 +254,6 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
 {
        const unsigned cpu = safe_smp_processor_id();
        unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
-       int i = 11;
        unsigned used = 0;
 
        printk("\nCall Trace:\n");
@@ -275,11 +274,20 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
                        if (unwind_init_blocked(&info, tsk) == 0)
                                unw_ret = show_trace_unwind(&info, NULL);
                }
-               if (unw_ret > 0) {
-                       if (call_trace > 0)
+               if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
+#ifdef CONFIG_STACK_UNWIND
+                       unsigned long rip = info.regs.rip;
+                       print_symbol("DWARF2 unwinder stuck at %s\n", rip);
+                       if (call_trace == 1) {
+                               printk("Leftover inexact backtrace:\n");
+                               stack = (unsigned long *)info.regs.rsp;
+                       } else if (call_trace > 1)
                                return;
-                       printk("Legacy call trace:");
-                       i = 18;
+                       else
+                               printk("Full inexact backtrace again:\n");
+#else
+                       printk("Inexact backtrace:\n");
+#endif
                }
        }
 
@@ -521,7 +529,7 @@ void __kprobes oops_end(unsigned long flags)
                /* Nest count reaches zero, release the lock. */
                spin_unlock_irqrestore(&die_lock, flags);
        if (panic_on_oops)
-               panic("Oops");
+               panic("Fatal exception");
 }
 
 void __kprobes __die(const char * str, struct pt_regs * regs, long err)
@@ -1118,8 +1126,10 @@ static int __init call_trace_setup(char *s)
                call_trace = -1;
        else if (strcmp(s, "both") == 0)
                call_trace = 0;
-       else if (strcmp(s, "new") == 0)
+       else if (strcmp(s, "newfallback") == 0)
                call_trace = 1;
+       else if (strcmp(s, "new") == 0)
+               call_trace = 2;
        return 1;
 }
 __setup("call_trace=", call_trace_setup);
index b50a7c7c47f8984b45329d07447a5b9cbb1447d3..3acf60ded2a0b54144a72b5b0faf5f8bc2c00933 100644 (file)
@@ -2,7 +2,6 @@
 #include <linux/pci.h>
 #include <asm/mpspec.h>
 #include <linux/cpumask.h>
-#include <asm/k8.h>
 
 /*
  * This discovers the pcibus <-> node mapping on AMD K8.
@@ -19,6 +18,7 @@
 #define NR_LDT_BUS_NUMBER_REGISTERS 3
 #define SECONDARY_LDT_BUS_NUMBER(dword) ((dword >> 8) & 0xFF)
 #define SUBORDINATE_LDT_BUS_NUMBER(dword) ((dword >> 16) & 0xFF)
+#define PCI_DEVICE_ID_K8HTCONFIG 0x1100
 
 /**
  * fill_mp_bus_to_cpumask()
@@ -28,7 +28,8 @@
 __init static int
 fill_mp_bus_to_cpumask(void)
 {
-       int i, j, k;
+       struct pci_dev *nb_dev = NULL;
+       int i, j;
        u32 ldtbus, nid;
        static int lbnr[3] = {
                LDT_BUS_NUMBER_REGISTER_0,
@@ -36,9 +37,8 @@ fill_mp_bus_to_cpumask(void)
                LDT_BUS_NUMBER_REGISTER_2
        };
 
-       cache_k8_northbridges();
-       for (k = 0; k < num_k8_northbridges; k++) {
-               struct pci_dev *nb_dev = k8_northbridges[k];
+       while ((nb_dev = pci_get_device(PCI_VENDOR_ID_AMD,
+                       PCI_DEVICE_ID_K8HTCONFIG, nb_dev))) {
                pci_read_config_dword(nb_dev, NODE_ID_REGISTER, &nid);
 
                for (i = 0; i < NR_LDT_BUS_NUMBER_REGISTERS; i++) {
index 27e409089a7b9837ce33927236f21ea89323fdf1..ce077d6bf3a02eff9c9d59165d60a7b43a521044 100644 (file)
@@ -487,11 +487,9 @@ void die(const char * str, struct pt_regs * regs, long err)
        if (in_interrupt())
                panic("Fatal exception in interrupt");
 
-       if (panic_on_oops) {
-               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
-               ssleep(5);
+       if (panic_on_oops)
                panic("Fatal exception");
-       }
+
        do_exit(err);
 }
 
index b8c0702777ff4e1bb2557567a7aa7f6d987bb6eb..265f7a830619ef1e5de60bfe1179fa9d3a002229 100644 (file)
@@ -80,7 +80,7 @@ static u32 bio_act[5] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC
 #define trace_sync_bit(rw)     \
        (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
 #define trace_ahead_bit(rw)    \
-       (((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))
+       (((rw) & (1 << BIO_RW_AHEAD)) << (2 - BIO_RW_AHEAD))
 
 /*
  * The worker for the various blk_add_trace*() types. Fills out a
index 102ebc2c5c34c73f8e7f76c589559ddfde0d9885..aae3123bf3eec6501faa46fdbf3000ea4bfa97af 100644 (file)
@@ -936,7 +936,7 @@ static int cfq_arm_slice_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq)
         * seeks. so allow a little bit of time for him to submit a new rq
         */
        if (sample_valid(cic->seek_samples) && CIC_SEEKY(cic))
-               sl = 2;
+               sl = min(sl, msecs_to_jiffies(2));
 
        mod_timer(&cfqd->idle_slice_timer, jiffies + sl);
        return 1;
index 96309b9660da886434d6ee44ae3581564a05a0ea..11abc7bf777ef90626eac53d0aec8e32f0228bde 100644 (file)
@@ -285,6 +285,8 @@ static int __init acpi_ac_init(void)
 {
        int result;
 
+       if (acpi_disabled)
+               return -ENODEV;
 
        acpi_ac_dir = acpi_lock_ac_dir();
        if (!acpi_ac_dir)
index 81e970adeab3b3cc6d5e47d32e69381693240943..1dda370f402b69d4d69dd433c6dcfab2e58cd5d5 100644 (file)
@@ -129,11 +129,15 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
        struct acpi_memory_info *info, *n;
 
 
+       if (!list_empty(&mem_device->res_list))
+               return 0;
+
        status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
                                     acpi_memory_get_resource, mem_device);
        if (ACPI_FAILURE(status)) {
                list_for_each_entry_safe(info, n, &mem_device->res_list, list)
                        kfree(info);
+               INIT_LIST_HEAD(&mem_device->res_list);
                return -EINVAL;
        }
 
@@ -230,17 +234,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
         * (i.e. memory-hot-remove function)
         */
        list_for_each_entry(info, &mem_device->res_list, list) {
-               u64 start_pfn, end_pfn;
-
-               start_pfn = info->start_addr >> PAGE_SHIFT;
-               end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
-
-               if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
-                       /* already enabled. try next area */
+               if (info->enabled) { /* just sanity check...*/
                        num_enabled++;
                        continue;
                }
-
                result = add_memory(node, info->start_addr, info->length);
                if (result)
                        continue;
@@ -487,10 +484,8 @@ acpi_memory_register_notify_handler(acpi_handle handle,
 
 
        status = is_memory_device(handle);
-       if (ACPI_FAILURE(status)){
-               ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
+       if (ACPI_FAILURE(status))
                return AE_OK;   /* continue */
-       }
 
        status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
                                             acpi_memory_device_notify, NULL);
@@ -506,10 +501,8 @@ acpi_memory_deregister_notify_handler(acpi_handle handle,
 
 
        status = is_memory_device(handle);
-       if (ACPI_FAILURE(status)){
-               ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
+       if (ACPI_FAILURE(status))
                return AE_OK;   /* continue */
-       }
 
        status = acpi_remove_notify_handler(handle,
                                            ACPI_SYSTEM_NOTIFY,
index 6e5221707d9757de15030edb0a08f1d8caa7c89f..9810e2a55d0adf3fb77758b20b9b670f3e2f5342 100644 (file)
@@ -757,6 +757,9 @@ static int __init acpi_battery_init(void)
 {
        int result;
 
+       if (acpi_disabled)
+               return -ENODEV;
+
        acpi_battery_dir = acpi_lock_battery_dir();
        if (!acpi_battery_dir)
                return -ENODEV;
index b2977695e12091ab6e945b20432178a953a81114..279c4bac92e553aaec80c4dc1181f682852e2c41 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
+#include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/sched.h>
 #include <linux/pm.h>
@@ -68,7 +69,8 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
 
        status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
        if (ACPI_FAILURE(status) || !*device) {
-               ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
+                                 handle));
                return -ENODEV;
        }
 
@@ -192,7 +194,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
        /* Make sure this is a valid target state */
 
        if (!device->flags.power_manageable) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable",
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable\n",
                                device->kobj.name));
                return -ENODEV;
        }
@@ -738,7 +740,10 @@ static int __init acpi_init(void)
                return -ENODEV;
        }
 
-       firmware_register(&acpi_subsys);
+       result = firmware_register(&acpi_subsys);
+       if (result < 0)
+               printk(KERN_WARNING "%s: firmware_register error: %d\n",
+                       __FUNCTION__, result);
 
        result = acpi_bus_init();
 
index 1c0a39d8b04e5de9474cf2b0ec967a8633fca3fe..578b99b71d9ce12556fe398bf5dfb196e8739f27 100644 (file)
@@ -58,8 +58,8 @@ struct dock_dependent_device {
 };
 
 #define DOCK_DOCKING   0x00000001
-#define DOCK_EVENT     KOBJ_DOCK
-#define UNDOCK_EVENT   KOBJ_UNDOCK
+#define DOCK_EVENT     3
+#define UNDOCK_EVENT   2
 
 static struct dock_station *dock_station;
 
@@ -322,11 +322,10 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
 
 static void dock_event(struct dock_station *ds, u32 event, int num)
 {
-       struct acpi_device *device;
-
-       device = dock_create_acpi_device(ds->handle);
-       if (device)
-               kobject_uevent(&device->kobj, num);
+       /*
+        * we don't do events until someone tells me that
+        * they would like to have them.
+        */
 }
 
 /**
index 32c9d88fd19655d6545644da6a23381012ccb079..1ba2db6718652aae3874c9bdf8ceae167fc990e4 100644 (file)
@@ -91,6 +91,14 @@ enum {
        HK_EVENT_ENTERRING_S5,
 };
 
+enum conf_entry_enum {
+       bus_handle = 0,
+       bus_method = 1,
+       action_handle = 2,
+       method = 3,
+       LAST_CONF_ENTRY
+};
+
 /*  procdir we use */
 static struct proc_dir_entry *hotkey_proc_dir;
 static struct proc_dir_entry *hotkey_config;
@@ -244,19 +252,15 @@ static int hotkey_info_open_fs(struct inode *inode, struct file *file)
 
 static char *format_result(union acpi_object *object)
 {
-       char *buf = NULL;
-
-       buf = (char *)kmalloc(RESULT_STR_LEN, GFP_KERNEL);
-       if (buf)
-               memset(buf, 0, RESULT_STR_LEN);
-       else
-               goto do_fail;
+       char *buf;
 
+       buf = kzalloc(RESULT_STR_LEN, GFP_KERNEL);
+       if (!buf)
+               return NULL;
        /* Now, just support integer type */
        if (object->type == ACPI_TYPE_INTEGER)
                sprintf(buf, "%d\n", (u32) object->integer.value);
-      do_fail:
-       return (buf);
+       return buf;
 }
 
 static int hotkey_polling_seq_show(struct seq_file *seq, void *offset)
@@ -486,98 +490,102 @@ static void free_hotkey_device(union acpi_hotkey *key)
 
 static void free_hotkey_buffer(union acpi_hotkey *key)
 {
+       /* key would never be null, action method could be */
        kfree(key->event_hotkey.action_method);
 }
 
 static void free_poll_hotkey_buffer(union acpi_hotkey *key)
 {
+       /* key would never be null, others could be*/
        kfree(key->poll_hotkey.action_method);
        kfree(key->poll_hotkey.poll_method);
        kfree(key->poll_hotkey.poll_result);
 }
 static int
-init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str,
-                  char *method, int std_num, int external_num)
+init_hotkey_device(union acpi_hotkey *key, char **config_entry,
+                  int std_num, int external_num)
 {
        acpi_handle tmp_handle;
        acpi_status status = AE_OK;
 
-
        if (std_num < 0 || IS_POLL(std_num) || !key)
                goto do_fail;
 
-       if (!bus_str || !action_str || !method)
+       if (!config_entry[bus_handle] || !config_entry[action_handle]
+                       || !config_entry[method])
                goto do_fail;
 
        key->link.hotkey_type = ACPI_HOTKEY_EVENT;
        key->link.hotkey_standard_num = std_num;
        key->event_hotkey.flag = 0;
-       key->event_hotkey.action_method = method;
+       key->event_hotkey.action_method = config_entry[method];
 
-       status =
-           acpi_get_handle(NULL, bus_str, &(key->event_hotkey.bus_handle));
+       status = acpi_get_handle(NULL, config_entry[bus_handle],
+                          &(key->event_hotkey.bus_handle));
        if (ACPI_FAILURE(status))
-               goto do_fail;
+               goto do_fail_zero;
        key->event_hotkey.external_hotkey_num = external_num;
-       status =
-           acpi_get_handle(NULL, action_str,
+       status = acpi_get_handle(NULL, config_entry[action_handle],
                            &(key->event_hotkey.action_handle));
        if (ACPI_FAILURE(status))
-               goto do_fail;
+               goto do_fail_zero;
        status = acpi_get_handle(key->event_hotkey.action_handle,
-                                method, &tmp_handle);
+                                config_entry[method], &tmp_handle);
        if (ACPI_FAILURE(status))
-               goto do_fail;
+               goto do_fail_zero;
        return AE_OK;
-      do_fail:
+do_fail_zero:
+       key->event_hotkey.action_method = NULL;
+do_fail:
        return -ENODEV;
 }
 
 static int
-init_poll_hotkey_device(union acpi_hotkey *key,
-                       char *poll_str,
-                       char *poll_method,
-                       char *action_str, char *action_method, int std_num)
+init_poll_hotkey_device(union acpi_hotkey *key, char **config_entry,
+                       int std_num)
 {
        acpi_status status = AE_OK;
        acpi_handle tmp_handle;
 
-
        if (std_num < 0 || IS_EVENT(std_num) || !key)
                goto do_fail;
-
-       if (!poll_str || !poll_method || !action_str || !action_method)
+       if (!config_entry[bus_handle] ||!config_entry[bus_method] ||
+               !config_entry[action_handle] || !config_entry[method])
                goto do_fail;
 
        key->link.hotkey_type = ACPI_HOTKEY_POLLING;
        key->link.hotkey_standard_num = std_num;
        key->poll_hotkey.flag = 0;
-       key->poll_hotkey.poll_method = poll_method;
-       key->poll_hotkey.action_method = action_method;
+       key->poll_hotkey.poll_method = config_entry[bus_method];
+       key->poll_hotkey.action_method = config_entry[method];
 
-       status =
-           acpi_get_handle(NULL, poll_str, &(key->poll_hotkey.poll_handle));
+       status = acpi_get_handle(NULL, config_entry[bus_handle],
+                     &(key->poll_hotkey.poll_handle));
        if (ACPI_FAILURE(status))
-               goto do_fail;
+               goto do_fail_zero;
        status = acpi_get_handle(key->poll_hotkey.poll_handle,
-                                poll_method, &tmp_handle);
+                                config_entry[bus_method], &tmp_handle);
        if (ACPI_FAILURE(status))
-               goto do_fail;
+               goto do_fail_zero;
        status =
-           acpi_get_handle(NULL, action_str,
+           acpi_get_handle(NULL, config_entry[action_handle],
                            &(key->poll_hotkey.action_handle));
        if (ACPI_FAILURE(status))
-               goto do_fail;
+               goto do_fail_zero;
        status = acpi_get_handle(key->poll_hotkey.action_handle,
-                                action_method, &tmp_handle);
+                                config_entry[method], &tmp_handle);
        if (ACPI_FAILURE(status))
-               goto do_fail;
+               goto do_fail_zero;
        key->poll_hotkey.poll_result =
            (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL);
        if (!key->poll_hotkey.poll_result)
-               goto do_fail;
+               goto do_fail_zero;
        return AE_OK;
-      do_fail:
+
+do_fail_zero:
+       key->poll_hotkey.poll_method = NULL;
+       key->poll_hotkey.action_method = NULL;
+do_fail:
        return -ENODEV;
 }
 
@@ -652,17 +660,18 @@ static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
 }
 
 static int
-get_parms(char *config_record,
-         int *cmd,
-         char **bus_handle,
-         char **bus_method,
-         char **action_handle,
-         char **method, int *internal_event_num, int *external_event_num)
+get_parms(char *config_record, int *cmd, char **config_entry,
+              int *internal_event_num, int *external_event_num)
 {
+/* the format of *config_record =
+ * "1:\d+:*" : "cmd:internal_event_num"
+ * "\d+:\w+:\w+:\w+:\w+:\d+:\d+" :
+ * "cmd:bus_handle:bus_method:action_handle:method:internal_event_num:external_event_num"
+ */
        char *tmp, *tmp1, count;
+       int i;
 
        sscanf(config_record, "%d", cmd);
-
        if (*cmd == 1) {
                if (sscanf(config_record, "%d:%d", cmd, internal_event_num) !=
                    2)
@@ -674,59 +683,27 @@ get_parms(char *config_record,
        if (!tmp)
                goto do_fail;
        tmp++;
-       tmp1 = strchr(tmp, ':');
-       if (!tmp1)
-               goto do_fail;
-
-       count = tmp1 - tmp;
-       *bus_handle = (char *)kmalloc(count + 1, GFP_KERNEL);
-       if (!*bus_handle)
-               goto do_fail;
-       strncpy(*bus_handle, tmp, count);
-       *(*bus_handle + count) = 0;
-
-       tmp = tmp1;
-       tmp++;
-       tmp1 = strchr(tmp, ':');
-       if (!tmp1)
-               goto do_fail;
-       count = tmp1 - tmp;
-       *bus_method = (char *)kmalloc(count + 1, GFP_KERNEL);
-       if (!*bus_method)
-               goto do_fail;
-       strncpy(*bus_method, tmp, count);
-       *(*bus_method + count) = 0;
-
-       tmp = tmp1;
-       tmp++;
-       tmp1 = strchr(tmp, ':');
-       if (!tmp1)
-               goto do_fail;
-       count = tmp1 - tmp;
-       *action_handle = (char *)kmalloc(count + 1, GFP_KERNEL);
-       if (!*action_handle)
-               goto do_fail;
-       strncpy(*action_handle, tmp, count);
-       *(*action_handle + count) = 0;
-
-       tmp = tmp1;
-       tmp++;
-       tmp1 = strchr(tmp, ':');
-       if (!tmp1)
-               goto do_fail;
-       count = tmp1 - tmp;
-       *method = (char *)kmalloc(count + 1, GFP_KERNEL);
-       if (!*method)
-               goto do_fail;
-       strncpy(*method, tmp, count);
-       *(*method + count) = 0;
-
-       if (sscanf(tmp1 + 1, "%d:%d", internal_event_num, external_event_num) <=
-           0)
-               goto do_fail;
-
-       return 6;
-      do_fail:
+       for (i = 0; i < LAST_CONF_ENTRY; i++) {
+               tmp1 = strchr(tmp, ':');
+               if (!tmp1) {
+                       goto do_fail;
+               }
+               count = tmp1 - tmp;
+               config_entry[i] = kzalloc(count + 1, GFP_KERNEL);
+               if (!config_entry[i])
+                       goto handle_failure;
+               strncpy(config_entry[i], tmp, count);
+               tmp = tmp1 + 1;
+       }
+       if (sscanf(tmp, "%d:%d", internal_event_num, external_event_num) <= 0)
+               goto handle_failure;
+       if (!IS_OTHERS(*internal_event_num)) {
+               return 6;
+       }
+handle_failure:
+       while (i-- > 0)
+               kfree(config_entry[i]);
+do_fail:
        return -1;
 }
 
@@ -736,50 +713,34 @@ static ssize_t hotkey_write_config(struct file *file,
                                   size_t count, loff_t * data)
 {
        char *config_record = NULL;
-       char *bus_handle = NULL;
-       char *bus_method = NULL;
-       char *action_handle = NULL;
-       char *method = NULL;
+       char *config_entry[LAST_CONF_ENTRY];
        int cmd, internal_event_num, external_event_num;
        int ret = 0;
-       union acpi_hotkey *key = NULL;
+       union acpi_hotkey *key = kzalloc(sizeof(union acpi_hotkey), GFP_KERNEL);
 
+       if (!key)
+               return -ENOMEM;
 
-       config_record = (char *)kmalloc(count + 1, GFP_KERNEL);
-       if (!config_record)
+       config_record = kzalloc(count + 1, GFP_KERNEL);
+       if (!config_record) {
+               kfree(key);
                return -ENOMEM;
+       }
 
        if (copy_from_user(config_record, buffer, count)) {
                kfree(config_record);
+               kfree(key);
                printk(KERN_ERR PREFIX "Invalid data\n");
                return -EINVAL;
        }
-       config_record[count] = 0;
-
-       ret = get_parms(config_record,
-                       &cmd,
-                       &bus_handle,
-                       &bus_method,
-                       &action_handle,
-                       &method, &internal_event_num, &external_event_num);
-
+       ret = get_parms(config_record, &cmd, config_entry,
+                      &internal_event_num, &external_event_num);
        kfree(config_record);
-       if (IS_OTHERS(internal_event_num))
-               goto do_fail;
        if (ret != 6) {
-             do_fail:
-               kfree(bus_handle);
-               kfree(bus_method);
-               kfree(action_handle);
-               kfree(method);
                printk(KERN_ERR PREFIX "Invalid data format ret=%d\n", ret);
                return -EINVAL;
        }
 
-       key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL);
-       if (!key)
-               goto do_fail;
-       memset(key, 0, sizeof(union acpi_hotkey));
        if (cmd == 1) {
                union acpi_hotkey *tmp = NULL;
                tmp = get_hotkey_by_event(&global_hotkey_list,
@@ -791,34 +752,19 @@ static ssize_t hotkey_write_config(struct file *file,
                goto cont_cmd;
        }
        if (IS_EVENT(internal_event_num)) {
-               kfree(bus_method);
-               ret = init_hotkey_device(key, bus_handle, action_handle, method,
-                                        internal_event_num,
-                                        external_event_num);
-       } else
-               ret = init_poll_hotkey_device(key, bus_handle, bus_method,
-                                             action_handle, method,
-                                             internal_event_num);
-       if (ret) {
-               kfree(bus_handle);
-               kfree(action_handle);
-               if (IS_EVENT(internal_event_num))
-                       free_hotkey_buffer(key);
-               else
-                       free_poll_hotkey_buffer(key);
-               kfree(key);
-               printk(KERN_ERR PREFIX "Invalid hotkey\n");
-               return -EINVAL;
+               if (init_hotkey_device(key, config_entry,
+                       internal_event_num, external_event_num))
+                       goto init_hotkey_fail;
+       } else {
+               if (init_poll_hotkey_device(key, config_entry,
+                              internal_event_num))
+                       goto init_poll_hotkey_fail;
        }
-
-      cont_cmd:
-       kfree(bus_handle);
-       kfree(action_handle);
-
+cont_cmd:
        switch (cmd) {
        case 0:
-               if (get_hotkey_by_event
-                   (&global_hotkey_list, key->link.hotkey_standard_num))
+               if (get_hotkey_by_event(&global_hotkey_list,
+                               key->link.hotkey_standard_num))
                        goto fail_out;
                else
                        hotkey_add(key);
@@ -827,6 +773,7 @@ static ssize_t hotkey_write_config(struct file *file,
                hotkey_remove(key);
                break;
        case 2:
+               /* key is kfree()ed if matched*/
                if (hotkey_update(key))
                        goto fail_out;
                break;
@@ -835,11 +782,22 @@ static ssize_t hotkey_write_config(struct file *file,
                break;
        }
        return count;
-      fail_out:
-       if (IS_EVENT(internal_event_num))
-               free_hotkey_buffer(key);
-       else
-               free_poll_hotkey_buffer(key);
+
+init_poll_hotkey_fail:         /* failed init_poll_hotkey_device */
+       kfree(config_entry[bus_method]);
+       config_entry[bus_method] = NULL;
+init_hotkey_fail:              /* failed init_hotkey_device */
+       kfree(config_entry[method]);
+fail_out:
+       kfree(config_entry[bus_handle]);
+       kfree(config_entry[action_handle]);
+       /* No double free since elements =NULL for error cases */
+       if (IS_EVENT(internal_event_num)) {
+               if (config_entry[bus_method])
+                       kfree(config_entry[bus_method]);
+               free_hotkey_buffer(key);        /* frees [method] */
+       } else
+               free_poll_hotkey_buffer(key);  /* frees [bus_method]+[method] */
        kfree(key);
        printk(KERN_ERR PREFIX "invalid key\n");
        return -EINVAL;
@@ -923,10 +881,9 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
        union acpi_hotkey *key;
 
 
-       arg = (char *)kmalloc(count + 1, GFP_KERNEL);
+       arg = kzalloc(count + 1, GFP_KERNEL);
        if (!arg)
                return -ENOMEM;
-       arg[count] = 0;
 
        if (copy_from_user(arg, buffer, count)) {
                kfree(arg);
index 84239d51dc0ca472bf4e01433dcc7498e037753b..6809c283ec5865ed7183570dbe5814fa7e9bf5a4 100644 (file)
@@ -330,7 +330,7 @@ static int acpi_ec_hc_add(struct acpi_device *device)
        status = acpi_evaluate_integer(ec_hc->handle, "_EC", NULL, &val);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error obtaining _EC\n"));
-               kfree(ec_hc->smbus);
+               kfree(ec_hc);
                kfree(smbus);
                return -EIO;
        }
index b7d1514cd199c834558a416f74dc29a0ab2d88eb..507f051d1cefd437634454809aa69c748f256a0d 100644 (file)
@@ -746,6 +746,16 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
        ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
                          handle, units, timeout));
 
+       /*
+        * This can be called during resume with interrupts off.
+        * Like boot-time, we should be single threaded and will
+        * always get the lock if we try -- timeout or not.
+        * If this doesn't succeed, then we will oops courtesy of
+        * might_sleep() in down().
+        */
+       if (!down_trylock(sem))
+               return AE_OK;
+
        switch (timeout) {
                /*
                 * No Wait:
index db7b350a50356417f49bf660a1a9e1e74ccbfaa7..62bef0b3b614aef8d10742cd3494e9ecca149675 100644 (file)
@@ -1714,6 +1714,9 @@ static int __init acpi_sbs_init(void)
 {
        int result = 0;
 
+       if (acpi_disabled)
+               return -ENODEV;
+
        init_MUTEX(&sbs_sem);
 
        if (capacity_mode != DEF_CAPACITY_UNIT
index 5fcb50c7b77802d135cbbe1368f96e8fabd6877e..698a1540e3033ce1960d4c72a45f3a8177397d94 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/kernel.h>
 #include <linux/acpi.h>
 
 #include <acpi/acpi_drivers.h>
@@ -113,6 +114,8 @@ static struct kset acpi_namespace_kset = {
 static void acpi_device_register(struct acpi_device *device,
                                 struct acpi_device *parent)
 {
+       int err;
+
        /*
         * Linkage
         * -------
@@ -138,7 +141,10 @@ static void acpi_device_register(struct acpi_device *device,
                device->kobj.parent = &parent->kobj;
        device->kobj.ktype = &ktype_acpi_ns;
        device->kobj.kset = &acpi_namespace_kset;
-       kobject_register(&device->kobj);
+       err = kobject_register(&device->kobj);
+       if (err < 0)
+               printk(KERN_WARNING "%s: kobject_register error: %d\n",
+                       __FUNCTION__, err);
        create_sysfs_device_files(device);
 }
 
@@ -1450,7 +1456,9 @@ static int __init acpi_scan_init(void)
        if (acpi_disabled)
                return 0;
 
-       kset_register(&acpi_namespace_kset);
+       result = kset_register(&acpi_namespace_kset);
+       if (result < 0)
+               printk(KERN_ERR PREFIX "kset_register error: %d\n", result);
 
        result = bus_register(&acpi_bus_type);
        if (result) {
index f48227f4c8c9183f03e224852af6fa2f1c14c129..d0d84c43a9d4c547591a6e43ffb8b8857dc90a63 100644 (file)
@@ -262,7 +262,7 @@ acpi_evaluate_integer(acpi_handle handle,
        if (!data)
                return AE_BAD_PARAMETER;
 
-       element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
+       element = kmalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
        if (!element)
                return AE_NO_MEMORY;
 
index c2d621632383306a493fd5f60d5d3b9b55721f70..3ef9d514b916985af339d2af7067903daf9a881e 100644 (file)
@@ -139,7 +139,7 @@ static int __cpuinit topology_sysfs_init(void)
                                (void *)(long)i);
        }
 
-       register_cpu_notifier(&topology_cpu_notifier);
+       register_hotcpu_notifier(&topology_cpu_notifier);
 
        return 0;
 }
index 1c4df22dfd2a960a2309570e093828e570096d94..7b0eca703a678c3c2401b58e9c78f07d0e40f415 100644 (file)
@@ -1233,6 +1233,50 @@ static inline void complete_buffers(struct bio *bio, int status)
        }
 }
 
+static void cciss_check_queues(ctlr_info_t *h)
+{
+       int start_queue = h->next_to_run;
+       int i;
+
+       /* check to see if we have maxed out the number of commands that can
+        * be placed on the queue.  If so then exit.  We do this check here
+        * in case the interrupt we serviced was from an ioctl and did not
+        * free any new commands.
+        */
+       if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS)
+               return;
+
+       /* We have room on the queue for more commands.  Now we need to queue
+        * them up.  We will also keep track of the next queue to run so
+        * that every queue gets a chance to be started first.
+        */
+       for (i = 0; i < h->highest_lun + 1; i++) {
+               int curr_queue = (start_queue + i) % (h->highest_lun + 1);
+               /* make sure the disk has been added and the drive is real
+                * because this can be called from the middle of init_one.
+                */
+               if (!(h->drv[curr_queue].queue) || !(h->drv[curr_queue].heads))
+                       continue;
+               blk_start_queue(h->gendisk[curr_queue]->queue);
+
+               /* check to see if we have maxed out the number of commands
+                * that can be placed on the queue.
+                */
+               if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) {
+                       if (curr_queue == start_queue) {
+                               h->next_to_run =
+                                   (start_queue + 1) % (h->highest_lun + 1);
+                               break;
+                       } else {
+                               h->next_to_run = curr_queue;
+                               break;
+                       }
+               } else {
+                       curr_queue = (curr_queue + 1) % (h->highest_lun + 1);
+               }
+       }
+}
+
 static void cciss_softirq_done(struct request *rq)
 {
        CommandList_struct *cmd = rq->completion_data;
@@ -1264,6 +1308,7 @@ static void cciss_softirq_done(struct request *rq)
        spin_lock_irqsave(&h->lock, flags);
        end_that_request_last(rq, rq->errors);
        cmd_free(h, cmd, 1);
+       cciss_check_queues(h);
        spin_unlock_irqrestore(&h->lock, flags);
 }
 
@@ -2528,8 +2573,6 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
        CommandList_struct *c;
        unsigned long flags;
        __u32 a, a1, a2;
-       int j;
-       int start_queue = h->next_to_run;
 
        if (interrupt_not_for_us(h))
                return IRQ_NONE;
@@ -2588,45 +2631,6 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
                }
        }
 
-       /* check to see if we have maxed out the number of commands that can
-        * be placed on the queue.  If so then exit.  We do this check here
-        * in case the interrupt we serviced was from an ioctl and did not
-        * free any new commands.
-        */
-       if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS)
-               goto cleanup;
-
-       /* We have room on the queue for more commands.  Now we need to queue
-        * them up.  We will also keep track of the next queue to run so
-        * that every queue gets a chance to be started first.
-        */
-       for (j = 0; j < h->highest_lun + 1; j++) {
-               int curr_queue = (start_queue + j) % (h->highest_lun + 1);
-               /* make sure the disk has been added and the drive is real
-                * because this can be called from the middle of init_one.
-                */
-               if (!(h->drv[curr_queue].queue) || !(h->drv[curr_queue].heads))
-                       continue;
-               blk_start_queue(h->gendisk[curr_queue]->queue);
-
-               /* check to see if we have maxed out the number of commands
-                * that can be placed on the queue.
-                */
-               if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) {
-                       if (curr_queue == start_queue) {
-                               h->next_to_run =
-                                   (start_queue + 1) % (h->highest_lun + 1);
-                               goto cleanup;
-                       } else {
-                               h->next_to_run = curr_queue;
-                               goto cleanup;
-                       }
-               } else {
-                       curr_queue = (curr_queue + 1) % (h->highest_lun + 1);
-               }
-       }
-
-      cleanup:
        spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
        return IRQ_HANDLED;
 }
index 0a1b1ea36ddcdc3064ba4daa35567a01e0f5b72d..bdbade9a5cf50a99e3b2e3fa3f860d71f36bfe82 100644 (file)
@@ -300,6 +300,15 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
                                lo->disk->disk_name, result);
                goto harderror;
        }
+
+       if (ntohl(reply.magic) != NBD_REPLY_MAGIC) {
+               printk(KERN_ERR "%s: Wrong magic (0x%lx)\n",
+                               lo->disk->disk_name,
+                               (unsigned long)ntohl(reply.magic));
+               result = -EPROTO;
+               goto harderror;
+       }
+
        req = nbd_find_request(lo, reply.handle);
        if (unlikely(IS_ERR(req))) {
                result = PTR_ERR(req);
@@ -312,13 +321,6 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
                goto harderror;
        }
 
-       if (ntohl(reply.magic) != NBD_REPLY_MAGIC) {
-               printk(KERN_ERR "%s: Wrong magic (0x%lx)\n",
-                               lo->disk->disk_name,
-                               (unsigned long)ntohl(reply.magic));
-               result = -EPROTO;
-               goto harderror;
-       }
        if (ntohl(reply.error)) {
                printk(KERN_ERR "%s: Other side returned error (%d)\n",
                                lo->disk->disk_name, ntohl(reply.error));
@@ -339,7 +341,8 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
                                        printk(KERN_ERR "%s: Receive data failed (result %d)\n",
                                                        lo->disk->disk_name,
                                                        result);
-                                       goto harderror;
+                                       req->errors++;
+                                       return req;
                                }
                                dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
                                        lo->disk->disk_name, req, bvec->bv_len);
index bde2c64b634660b0a49057b127ce5e05a97c8cc1..451b996bba91e53bc934cc54048951015acc9868 100644 (file)
@@ -2577,19 +2577,19 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm
        case PKT_CTRL_CMD_SETUP:
                if (!capable(CAP_SYS_ADMIN))
                        return -EPERM;
-               mutex_lock(&ctl_mutex);
+               mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
                ret = pkt_setup_dev(&ctrl_cmd);
                mutex_unlock(&ctl_mutex);
                break;
        case PKT_CTRL_CMD_TEARDOWN:
                if (!capable(CAP_SYS_ADMIN))
                        return -EPERM;
-               mutex_lock(&ctl_mutex);
+               mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
                ret = pkt_remove_dev(&ctrl_cmd);
                mutex_unlock(&ctl_mutex);
                break;
        case PKT_CTRL_CMD_STATUS:
-               mutex_lock(&ctl_mutex);
+               mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
                pkt_get_status(&ctrl_cmd);
                mutex_unlock(&ctl_mutex);
                break;
index 41db8060e8f791502c51bb559ffbfa4881327e5c..017f755632a3455d1a2223d2b1cd01006477d990 100644 (file)
@@ -311,7 +311,8 @@ static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,
                                /* CD went away; no more connection */
                                pr_debug("hvsi%i: CD dropped\n", hp->index);
                                hp->mctrl &= TIOCM_CD;
-                               if (!(hp->tty->flags & CLOCAL))
+                               /* If userland hasn't done an open(2) yet, hp->tty is NULL. */
+                               if (hp->tty && !(hp->tty->flags & CLOCAL))
                                        *to_hangup = hp->tty;
                        }
                        break;
@@ -986,10 +987,7 @@ static void hvsi_write_worker(void *arg)
                start_j = 0;
 #endif /* DEBUG */
                wake_up_all(&hp->emptyq);
-               if (test_bit(TTY_DO_WRITE_WAKEUP, &hp->tty->flags)
-                               && hp->tty->ldisc.write_wakeup)
-                       hp->tty->ldisc.write_wakeup(hp->tty);
-               wake_up_interruptible(&hp->tty->write_wait);
+               tty_wakeup(hp->tty);
        }
 
 out:
index be61f22ee7bb3e9a69d452236ef700b1104581e6..d37ced0d132ba3d09bc0e972820dad0c445998e6 100644 (file)
@@ -107,10 +107,14 @@ found:
        if (err) {
                printk(KERN_ERR PFX "RNG registering failed (%d)\n",
                       err);
-               goto out;
+               goto err_unmap;
        }
 out:
        return err;
+
+err_unmap:
+       iounmap(mem);
+       goto out;
 }
 
 static void __exit mod_exit(void)
index 6594bd5645f42928992a8e85d13332169fdf5e85..ccd7e7102234cf09cfda77bdb49db017389d197a 100644 (file)
@@ -164,7 +164,7 @@ static int __init mod_init(void)
        if (err) {
                printk(KERN_ERR PFX "RNG registering failed (%d)\n",
                       err);
-               goto out;
+               goto err_unmap;
        }
 out:
        return err;
index 819516b35a79394deb31eb419e5be7d8d0524575..a01d796d1eeb3624a4f55537d604cc9dba1cb1e3 100644 (file)
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/random.h>
+#include <linux/clk.h>
 #include <linux/err.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <linux/hw_random.h>
 
 #include <asm/io.h>
-#include <asm/hardware/clock.h>
 
 #define RNG_OUT_REG            0x00            /* Output register */
 #define RNG_STAT_REG           0x04            /* Status register
@@ -52,7 +52,7 @@
 
 static void __iomem *rng_base;
 static struct clk *rng_ick;
-static struct device *rng_dev;
+static struct platform_device *rng_dev;
 
 static u32 omap_rng_read_reg(int reg)
 {
@@ -83,9 +83,8 @@ static struct hwrng omap_rng_ops = {
        .data_read      = omap_rng_data_read,
 };
 
-static int __init omap_rng_probe(struct device *dev)
+static int __init omap_rng_probe(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
        struct resource *res, *mem;
        int ret;
 
@@ -95,16 +94,14 @@ static int __init omap_rng_probe(struct device *dev)
         */
        BUG_ON(rng_dev);
 
-       if (cpu_is_omap24xx()) {
+       if (cpu_is_omap24xx()) {
                rng_ick = clk_get(NULL, "rng_ick");
                if (IS_ERR(rng_ick)) {
-                       dev_err(dev, "Could not get rng_ick\n");
+                       dev_err(&pdev->dev, "Could not get rng_ick\n");
                        ret = PTR_ERR(rng_ick);
                        return ret;
-               }
-               else {
-                       clk_use(rng_ick);
-               }
+               } else
+                       clk_enable(rng_ick);
        }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -117,7 +114,7 @@ static int __init omap_rng_probe(struct device *dev)
        if (mem == NULL)
                return -EBUSY;
 
-       dev_set_drvdata(dev, mem);
+       dev_set_drvdata(&pdev->dev, mem);
        rng_base = (u32 __iomem *)io_p2v(res->start);
 
        ret = hwrng_register(&omap_rng_ops);
@@ -127,25 +124,25 @@ static int __init omap_rng_probe(struct device *dev)
                return ret;
        }
 
-       dev_info(dev, "OMAP Random Number Generator ver. %02x\n",
+       dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",
                omap_rng_read_reg(RNG_REV_REG));
        omap_rng_write_reg(RNG_MASK_REG, 0x1);
 
-       rng_dev = dev;
+       rng_dev = pdev;
 
        return 0;
 }
 
-static int __exit omap_rng_remove(struct device *dev)
+static int __exit omap_rng_remove(struct platform_device *pdev)
 {
-       struct resource *mem = dev_get_drvdata(dev);
+       struct resource *mem = dev_get_drvdata(&pdev->dev);
 
        hwrng_unregister(&omap_rng_ops);
 
        omap_rng_write_reg(RNG_MASK_REG, 0x0);
 
        if (cpu_is_omap24xx()) {
-               clk_unuse(rng_ick);
+               clk_disable(rng_ick);
                clk_put(rng_ick);
        }
 
@@ -157,18 +154,16 @@ static int __exit omap_rng_remove(struct device *dev)
 
 #ifdef CONFIG_PM
 
-static int omap_rng_suspend(struct device *dev, pm_message_t message, u32 level)
+static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message)
 {
        omap_rng_write_reg(RNG_MASK_REG, 0x0);
-
        return 0;
 }
 
-static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
+static int omap_rng_resume(struct platform_device *pdev)
 {
        omap_rng_write_reg(RNG_MASK_REG, 0x1);
-
-       return 1;
+       return 0;
 }
 
 #else
@@ -179,9 +174,11 @@ static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
 #endif
 
 
-static struct device_driver omap_rng_driver = {
-       .name           = "omap_rng",
-       .bus            = &platform_bus_type,
+static struct platform_driver omap_rng_driver = {
+       .driver = {
+               .name           = "omap_rng",
+               .owner          = THIS_MODULE,
+       },
        .probe          = omap_rng_probe,
        .remove         = __exit_p(omap_rng_remove),
        .suspend        = omap_rng_suspend,
@@ -193,12 +190,12 @@ static int __init omap_rng_init(void)
        if (!cpu_is_omap16xx() && !cpu_is_omap24xx())
                return -ENODEV;
 
-       return driver_register(&omap_rng_driver);
+       return platform_driver_register(&omap_rng_driver);
 }
 
 static void __exit omap_rng_exit(void)
 {
-       driver_unregister(&omap_rng_driver);
+       platform_driver_unregister(&omap_rng_driver);
 }
 
 module_init(omap_rng_init);
index 056ebe84b81d4b55dc394248c47b3dcc423c34a4..3e90aac3751032b74178a85fd31f5778f3bb7d29 100644 (file)
@@ -107,7 +107,6 @@ const int NR_TYPES = ARRAY_SIZE(max_vals);
 
 struct kbd_struct kbd_table[MAX_NR_CONSOLES];
 static struct kbd_struct *kbd = kbd_table;
-static struct kbd_struct kbd0;
 
 int spawnpid, spawnsig;
 
@@ -223,13 +222,13 @@ static void kd_nosound(unsigned long ignored)
 {
        struct list_head *node;
 
-       list_for_each(node,&kbd_handler.h_list) {
+       list_for_each(node, &kbd_handler.h_list) {
                struct input_handle *handle = to_handle_h(node);
                if (test_bit(EV_SND, handle->dev->evbit)) {
                        if (test_bit(SND_TONE, handle->dev->sndbit))
-                               input_event(handle->dev, EV_SND, SND_TONE, 0);
+                               input_inject_event(handle, EV_SND, SND_TONE, 0);
                        if (test_bit(SND_BELL, handle->dev->sndbit))
-                               input_event(handle->dev, EV_SND, SND_BELL, 0);
+                               input_inject_event(handle, EV_SND, SND_BELL, 0);
                }
        }
 }
@@ -247,11 +246,11 @@ void kd_mksound(unsigned int hz, unsigned int ticks)
                        struct input_handle *handle = to_handle_h(node);
                        if (test_bit(EV_SND, handle->dev->evbit)) {
                                if (test_bit(SND_TONE, handle->dev->sndbit)) {
-                                       input_event(handle->dev, EV_SND, SND_TONE, hz);
+                                       input_inject_event(handle, EV_SND, SND_TONE, hz);
                                        break;
                                }
                                if (test_bit(SND_BELL, handle->dev->sndbit)) {
-                                       input_event(handle->dev, EV_SND, SND_BELL, 1);
+                                       input_inject_event(handle, EV_SND, SND_BELL, 1);
                                        break;
                                }
                        }
@@ -272,15 +271,15 @@ int kbd_rate(struct kbd_repeat *rep)
        unsigned int d = 0;
        unsigned int p = 0;
 
-       list_for_each(node,&kbd_handler.h_list) {
+       list_for_each(node, &kbd_handler.h_list) {
                struct input_handle *handle = to_handle_h(node);
                struct input_dev *dev = handle->dev;
 
                if (test_bit(EV_REP, dev->evbit)) {
                        if (rep->delay > 0)
-                               input_event(dev, EV_REP, REP_DELAY, rep->delay);
+                               input_inject_event(handle, EV_REP, REP_DELAY, rep->delay);
                        if (rep->period > 0)
-                               input_event(dev, EV_REP, REP_PERIOD, rep->period);
+                               input_inject_event(handle, EV_REP, REP_PERIOD, rep->period);
                        d = dev->rep[REP_DELAY];
                        p = dev->rep[REP_PERIOD];
                }
@@ -988,7 +987,7 @@ static inline unsigned char getleds(void)
  * interrupt routines for this thing allows us to easily mask
  * this when we don't want any of the above to happen.
  * This allows for easy and efficient race-condition prevention
- * for kbd_refresh_leds => input_event(dev, EV_LED, ...) => ...
+ * for kbd_start => input_inject_event(dev, EV_LED, ...) => ...
  */
 
 static void kbd_bh(unsigned long dummy)
@@ -998,11 +997,11 @@ static void kbd_bh(unsigned long dummy)
 
        if (leds != ledstate) {
                list_for_each(node, &kbd_handler.h_list) {
-                       struct input_handle * handle = to_handle_h(node);
-                       input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
-                       input_event(handle->dev, EV_LED, LED_NUML,    !!(leds & 0x02));
-                       input_event(handle->dev, EV_LED, LED_CAPSL,   !!(leds & 0x04));
-                       input_sync(handle->dev);
+                       struct input_handle *handle = to_handle_h(node);
+                       input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));
+                       input_inject_event(handle, EV_LED, LED_NUML,    !!(leds & 0x02));
+                       input_inject_event(handle, EV_LED, LED_CAPSL,   !!(leds & 0x04));
+                       input_inject_event(handle, EV_SYN, SYN_REPORT, 0);
                }
        }
 
@@ -1011,23 +1010,6 @@ static void kbd_bh(unsigned long dummy)
 
 DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
 
-/*
- * This allows a newly plugged keyboard to pick the LED state.
- */
-static void kbd_refresh_leds(struct input_handle *handle)
-{
-       unsigned char leds = ledstate;
-
-       tasklet_disable(&keyboard_tasklet);
-       if (leds != 0xff) {
-               input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
-               input_event(handle->dev, EV_LED, LED_NUML,    !!(leds & 0x02));
-               input_event(handle->dev, EV_LED, LED_CAPSL,   !!(leds & 0x04));
-               input_sync(handle->dev);
-       }
-       tasklet_enable(&keyboard_tasklet);
-}
-
 #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\
     defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\
     defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\
@@ -1043,7 +1025,7 @@ static const unsigned short x86_keycodes[256] =
         48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
         64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
         80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92,
-       284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
+       284,285,309,  0,312, 91,327,328,329,331,333,335,336,337,338,339,
        367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349,
        360,261,262,263,268,376,100,101,321,316,373,286,289,102,351,355,
        103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,
@@ -1065,38 +1047,55 @@ extern void sun_do_break(void);
 static int emulate_raw(struct vc_data *vc, unsigned int keycode,
                       unsigned char up_flag)
 {
-       if (keycode > 255 || !x86_keycodes[keycode])
-               return -1;
+       int code;
 
        switch (keycode) {
                case KEY_PAUSE:
                        put_queue(vc, 0xe1);
                        put_queue(vc, 0x1d | up_flag);
                        put_queue(vc, 0x45 | up_flag);
-                       return 0;
+                       break;
+
                case KEY_HANGEUL:
                        if (!up_flag)
                                put_queue(vc, 0xf2);
-                       return 0;
+                       break;
+
                case KEY_HANJA:
                        if (!up_flag)
                                put_queue(vc, 0xf1);
-                       return 0;
-       }
+                       break;
 
-       if (keycode == KEY_SYSRQ && sysrq_alt) {
-               put_queue(vc, 0x54 | up_flag);
-               return 0;
-       }
+               case KEY_SYSRQ:
+                       /*
+                        * Real AT keyboards (that's what we're trying
+                        * to emulate here emit 0xe0 0x2a 0xe0 0x37 when
+                        * pressing PrtSc/SysRq alone, but simply 0x54
+                        * when pressing Alt+PrtSc/SysRq.
+                        */
+                       if (sysrq_alt) {
+                               put_queue(vc, 0x54 | up_flag);
+                       } else {
+                               put_queue(vc, 0xe0);
+                               put_queue(vc, 0x2a | up_flag);
+                               put_queue(vc, 0xe0);
+                               put_queue(vc, 0x37 | up_flag);
+                       }
+                       break;
+
+               default:
+                       if (keycode > 255)
+                               return -1;
 
-       if (x86_keycodes[keycode] & 0x100)
-               put_queue(vc, 0xe0);
+                       code = x86_keycodes[keycode];
+                       if (!code)
+                               return -1;
 
-       put_queue(vc, (x86_keycodes[keycode] & 0x7f) | up_flag);
+                       if (code & 0x100)
+                               put_queue(vc, 0xe0);
+                       put_queue(vc, (code & 0x7f) | up_flag);
 
-       if (keycode == KEY_SYSRQ) {
-               put_queue(vc, 0xe0);
-               put_queue(vc, 0x37 | up_flag);
+                       break;
        }
 
        return 0;
@@ -1298,16 +1297,15 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
        if (i == BTN_MISC && !test_bit(EV_SND, dev->evbit))
                return NULL;
 
-       if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
+       handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
+       if (!handle)
                return NULL;
-       memset(handle, 0, sizeof(struct input_handle));
 
        handle->dev = dev;
        handle->handler = handler;
        handle->name = "kbd";
 
        input_open_device(handle);
-       kbd_refresh_leds(handle);
 
        return handle;
 }
@@ -1318,6 +1316,24 @@ static void kbd_disconnect(struct input_handle *handle)
        kfree(handle);
 }
 
+/*
+ * Start keyboard handler on the new keyboard by refreshing LED state to
+ * match the rest of the system.
+ */
+static void kbd_start(struct input_handle *handle)
+{
+       unsigned char leds = ledstate;
+
+       tasklet_disable(&keyboard_tasklet);
+       if (leds != 0xff) {
+               input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));
+               input_inject_event(handle, EV_LED, LED_NUML,    !!(leds & 0x02));
+               input_inject_event(handle, EV_LED, LED_CAPSL,   !!(leds & 0x04));
+               input_inject_event(handle, EV_SYN, SYN_REPORT, 0);
+       }
+       tasklet_enable(&keyboard_tasklet);
+}
+
 static struct input_device_id kbd_ids[] = {
        {
                 .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
@@ -1338,6 +1354,7 @@ static struct input_handler kbd_handler = {
        .event          = kbd_event,
        .connect        = kbd_connect,
        .disconnect     = kbd_disconnect,
+       .start          = kbd_start,
        .name           = "kbd",
        .id_table       = kbd_ids,
 };
@@ -1346,15 +1363,15 @@ int __init kbd_init(void)
 {
        int i;
 
-        kbd0.ledflagstate = kbd0.default_ledflagstate = KBD_DEFLEDS;
-        kbd0.ledmode = LED_SHOW_FLAGS;
-        kbd0.lockstate = KBD_DEFLOCK;
-        kbd0.slockstate = 0;
-        kbd0.modeflags = KBD_DEFMODE;
-        kbd0.kbdmode = VC_XLATE;
-
-        for (i = 0 ; i < MAX_NR_CONSOLES ; i++)
-                kbd_table[i] = kbd0;
+        for (i = 0; i < MAX_NR_CONSOLES; i++) {
+               kbd_table[i].ledflagstate = KBD_DEFLEDS;
+               kbd_table[i].default_ledflagstate = KBD_DEFLEDS;
+               kbd_table[i].ledmode = LED_SHOW_FLAGS;
+               kbd_table[i].lockstate = KBD_DEFLOCK;
+               kbd_table[i].slockstate = 0;
+               kbd_table[i].modeflags = KBD_DEFMODE;
+               kbd_table[i].kbdmode = VC_XLATE;
+       }
 
        input_register_handler(&kbd_handler);
 
index 645eb81cb5a9d6be636fe4eef7dfb6a618ea672f..84e5a68635f12203c361cf837aab3f2bd4fdbca0 100644 (file)
@@ -221,7 +221,6 @@ static struct nsc_gpio_ops pc8736x_gpio_ops = {
        .gpio_change    = pc8736x_gpio_change,
        .gpio_current   = pc8736x_gpio_current
 };
-EXPORT_SYMBOL(pc8736x_gpio_ops);
 
 static int pc8736x_gpio_open(struct inode *inode, struct file *file)
 {
index afc6eda602f7f6fa45ed1b70af620bf8810ed4fc..07e0b75f2338b59a6ca2b9c76917115afd935526 100644 (file)
@@ -374,7 +374,12 @@ scdrv_init(void)
        struct sysctl_data_s *scd;
        void *salbuf;
        dev_t first_dev, dev;
-       nasid_t event_nasid = ia64_sn_get_console_nasid();
+       nasid_t event_nasid;
+
+       if (!ia64_platform_is("sn2"))
+               return -ENODEV;
+
+       event_nasid = ia64_sn_get_console_nasid();
 
        if (alloc_chrdev_region(&first_dev, 0, num_cnodes,
                                SYSCTL_BASENAME) < 0) {
index d53f664a4dd89215a3f9e7a66a2f8cf587ae3aea..fff89c2d88fda66ad93bb40e822137b2751477b5 100644 (file)
@@ -45,7 +45,7 @@ config WATCHDOG_NOWAYOUT
 comment "Watchdog Device Drivers"
        depends on WATCHDOG
 
-# Architecture Independant
+# Architecture Independent
 
 config SOFT_WATCHDOG
        tristate "Software watchdog"
@@ -127,7 +127,7 @@ config S3C2410_WATCHDOG
          enabled.
 
          The driver is limited by the speed of the system's PCLK
-         signal, so with reasonbaly fast systems (PCLK around 50-66MHz)
+         signal, so with reasonably fast systems (PCLK around 50-66MHz)
          then watchdog intervals of over approximately 20seconds are
          unavailable.
 
@@ -423,7 +423,7 @@ config SBC_EPX_C3_WATCHDOG
          is no way to know if writing to its IO address will corrupt
          your system or have any real effect.  The only way to be sure
          that this driver does what you want is to make sure you
-         are runnning it on an EPX-C3 from Winsystems with the watchdog
+         are running it on an EPX-C3 from Winsystems with the watchdog
          timer at IO address 0x1ee and 0x1ef.  It will write to both those
          IO ports.  Basically, the assumption is made that if you compile
          this driver into your kernel and/or load it as a module, that you
@@ -472,7 +472,7 @@ config INDYDOG
        tristate "Indy/I2 Hardware Watchdog"
        depends on WATCHDOG && SGI_IP22
        help
-         Hardwaredriver for the Indy's/I2's watchdog. This is a
+         Hardware driver for the Indy's/I2's watchdog. This is a
          watchdog timer that will reboot the machine after a 60 second
          timer expired and no process has written to /dev/watchdog during
          that time.
index 498aa37bca221f50a3e3d070e40cbaa7a648a0db..3ece6923134359a9e70c841e8e592b589ea864ab 100644 (file)
@@ -51,6 +51,7 @@ void proc_fork_connector(struct task_struct *task)
        struct cn_msg *msg;
        struct proc_event *ev;
        __u8 buffer[CN_PROC_MSG_SIZE];
+       struct timespec ts;
 
        if (atomic_read(&proc_event_num_listeners) < 1)
                return;
@@ -58,7 +59,8 @@ void proc_fork_connector(struct task_struct *task)
        msg = (struct cn_msg*)buffer;
        ev = (struct proc_event*)msg->data;
        get_seq(&msg->seq, &ev->cpu);
-       ktime_get_ts(&ev->timestamp); /* get high res monotonic timestamp */
+       ktime_get_ts(&ts); /* get high res monotonic timestamp */
+       ev->timestamp_ns = timespec_to_ns(&ts);
        ev->what = PROC_EVENT_FORK;
        ev->event_data.fork.parent_pid = task->real_parent->pid;
        ev->event_data.fork.parent_tgid = task->real_parent->tgid;
@@ -76,6 +78,7 @@ void proc_exec_connector(struct task_struct *task)
 {
        struct cn_msg *msg;
        struct proc_event *ev;
+       struct timespec ts;
        __u8 buffer[CN_PROC_MSG_SIZE];
 
        if (atomic_read(&proc_event_num_listeners) < 1)
@@ -84,7 +87,8 @@ void proc_exec_connector(struct task_struct *task)
        msg = (struct cn_msg*)buffer;
        ev = (struct proc_event*)msg->data;
        get_seq(&msg->seq, &ev->cpu);
-       ktime_get_ts(&ev->timestamp);
+       ktime_get_ts(&ts); /* get high res monotonic timestamp */
+       ev->timestamp_ns = timespec_to_ns(&ts);
        ev->what = PROC_EVENT_EXEC;
        ev->event_data.exec.process_pid = task->pid;
        ev->event_data.exec.process_tgid = task->tgid;
@@ -100,6 +104,7 @@ void proc_id_connector(struct task_struct *task, int which_id)
        struct cn_msg *msg;
        struct proc_event *ev;
        __u8 buffer[CN_PROC_MSG_SIZE];
+       struct timespec ts;
 
        if (atomic_read(&proc_event_num_listeners) < 1)
                return;
@@ -118,7 +123,8 @@ void proc_id_connector(struct task_struct *task, int which_id)
        } else
                return;
        get_seq(&msg->seq, &ev->cpu);
-       ktime_get_ts(&ev->timestamp);
+       ktime_get_ts(&ts); /* get high res monotonic timestamp */
+       ev->timestamp_ns = timespec_to_ns(&ts);
 
        memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
        msg->ack = 0; /* not used */
@@ -131,6 +137,7 @@ void proc_exit_connector(struct task_struct *task)
        struct cn_msg *msg;
        struct proc_event *ev;
        __u8 buffer[CN_PROC_MSG_SIZE];
+       struct timespec ts;
 
        if (atomic_read(&proc_event_num_listeners) < 1)
                return;
@@ -138,7 +145,8 @@ void proc_exit_connector(struct task_struct *task)
        msg = (struct cn_msg*)buffer;
        ev = (struct proc_event*)msg->data;
        get_seq(&msg->seq, &ev->cpu);
-       ktime_get_ts(&ev->timestamp);
+       ktime_get_ts(&ts); /* get high res monotonic timestamp */
+       ev->timestamp_ns = timespec_to_ns(&ts);
        ev->what = PROC_EVENT_EXIT;
        ev->event_data.exit.process_pid = task->pid;
        ev->event_data.exit.process_tgid = task->tgid;
@@ -164,6 +172,7 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
        struct cn_msg *msg;
        struct proc_event *ev;
        __u8 buffer[CN_PROC_MSG_SIZE];
+       struct timespec ts;
 
        if (atomic_read(&proc_event_num_listeners) < 1)
                return;
@@ -171,7 +180,8 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
        msg = (struct cn_msg*)buffer;
        ev = (struct proc_event*)msg->data;
        msg->seq = rcvd_seq;
-       ktime_get_ts(&ev->timestamp);
+       ktime_get_ts(&ts); /* get high res monotonic timestamp */
+       ev->timestamp_ns = timespec_to_ns(&ts);
        ev->cpu = -1;
        ev->what = PROC_EVENT_NONE;
        ev->event_data.ack.err = err;
index 8d328186f774b81cfdd1eabf5c01d244f50115be..b3df613ae4ec84dfbcf75ad40b4487d68355ba70 100644 (file)
@@ -284,39 +284,69 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_transition);
  *                          SYSFS INTERFACE                          *
  *********************************************************************/
 
+static struct cpufreq_governor *__find_governor(const char *str_governor)
+{
+       struct cpufreq_governor *t;
+
+       list_for_each_entry(t, &cpufreq_governor_list, governor_list)
+               if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN))
+                       return t;
+
+       return NULL;
+}
+
 /**
  * cpufreq_parse_governor - parse a governor string
  */
 static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
                                struct cpufreq_governor **governor)
 {
+       int err = -EINVAL;
+
        if (!cpufreq_driver)
-               return -EINVAL;
+               goto out;
+
        if (cpufreq_driver->setpolicy) {
                if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
                        *policy = CPUFREQ_POLICY_PERFORMANCE;
-                       return 0;
+                       err = 0;
                } else if (!strnicmp(str_governor, "powersave", CPUFREQ_NAME_LEN)) {
                        *policy = CPUFREQ_POLICY_POWERSAVE;
-                       return 0;
+                       err = 0;
                }
-               return -EINVAL;
-       } else {
+       } else if (cpufreq_driver->target) {
                struct cpufreq_governor *t;
+
                mutex_lock(&cpufreq_governor_mutex);
-               if (!cpufreq_driver || !cpufreq_driver->target)
-                       goto out;
-               list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
-                       if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN)) {
-                               *governor = t;
+
+               t = __find_governor(str_governor);
+
+               if (t == NULL) {
+                       char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", str_governor);
+
+                       if (name) {
+                               int ret;
+
                                mutex_unlock(&cpufreq_governor_mutex);
-                               return 0;
+                               ret = request_module(name);
+                               mutex_lock(&cpufreq_governor_mutex);
+
+                               if (ret == 0)
+                                       t = __find_governor(str_governor);
                        }
+
+                       kfree(name);
                }
-out:
+
+               if (t != NULL) {
+                       *governor = t;
+                       err = 0;
+               }
+
                mutex_unlock(&cpufreq_governor_mutex);
        }
-       return -EINVAL;
+  out:
+       return err;
 }
 
 
@@ -364,10 +394,12 @@ static ssize_t store_##file_name                                  \
        if (ret != 1)                                                   \
                return -EINVAL;                                         \
                                                                        \
+       lock_cpu_hotplug();                                             \
        mutex_lock(&policy->lock);                                      \
        ret = __cpufreq_set_policy(policy, &new_policy);                \
        policy->user_policy.object = policy->object;                    \
        mutex_unlock(&policy->lock);                                    \
+       unlock_cpu_hotplug();                                           \
                                                                        \
        return ret ? ret : count;                                       \
 }
@@ -1197,20 +1229,18 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier);
  *********************************************************************/
 
 
+/* Must be called with lock_cpu_hotplug held */
 int __cpufreq_driver_target(struct cpufreq_policy *policy,
                            unsigned int target_freq,
                            unsigned int relation)
 {
        int retval = -EINVAL;
 
-       lock_cpu_hotplug();
        dprintk("target for CPU %u: %u kHz, relation %u\n", policy->cpu,
                target_freq, relation);
        if (cpu_online(policy->cpu) && cpufreq_driver->target)
                retval = cpufreq_driver->target(policy, target_freq, relation);
 
-       unlock_cpu_hotplug();
-
        return retval;
 }
 EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
@@ -1225,17 +1255,23 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
        if (!policy)
                return -EINVAL;
 
+       lock_cpu_hotplug();
        mutex_lock(&policy->lock);
 
        ret = __cpufreq_driver_target(policy, target_freq, relation);
 
        mutex_unlock(&policy->lock);
+       unlock_cpu_hotplug();
 
        cpufreq_cpu_put(policy);
        return ret;
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_target);
 
+/*
+ * Locking: Must be called with the lock_cpu_hotplug() lock held
+ * when "event" is CPUFREQ_GOV_LIMITS
+ */
 
 static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
 {
@@ -1257,43 +1293,23 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
 }
 
 
-int cpufreq_governor(unsigned int cpu, unsigned int event)
-{
-       int ret = 0;
-       struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
-
-       if (!policy)
-               return -EINVAL;
-
-       mutex_lock(&policy->lock);
-       ret = __cpufreq_governor(policy, event);
-       mutex_unlock(&policy->lock);
-
-       cpufreq_cpu_put(policy);
-       return ret;
-}
-EXPORT_SYMBOL_GPL(cpufreq_governor);
-
-
 int cpufreq_register_governor(struct cpufreq_governor *governor)
 {
-       struct cpufreq_governor *t;
+       int err;
 
        if (!governor)
                return -EINVAL;
 
        mutex_lock(&cpufreq_governor_mutex);
 
-       list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
-               if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) {
-                       mutex_unlock(&cpufreq_governor_mutex);
-                       return -EBUSY;
-               }
+       err = -EBUSY;
+       if (__find_governor(governor->name) == NULL) {
+               err = 0;
+               list_add(&governor->governor_list, &cpufreq_governor_list);
        }
-       list_add(&governor->governor_list, &cpufreq_governor_list);
 
        mutex_unlock(&cpufreq_governor_mutex);
-       return 0;
+       return err;
 }
 EXPORT_SYMBOL_GPL(cpufreq_register_governor);
 
@@ -1342,6 +1358,9 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
 EXPORT_SYMBOL(cpufreq_get_policy);
 
 
+/*
+ * Locking: Must be called with the lock_cpu_hotplug() lock held
+ */
 static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy)
 {
        int ret = 0;
@@ -1352,6 +1371,11 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
 
        memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo));
 
+       if (policy->min > data->min && policy->min > policy->max) {
+               ret = -EINVAL;
+               goto error_out;
+       }
+
        /* verify the cpu speed can be set within this limit */
        ret = cpufreq_driver->verify(policy);
        if (ret)
@@ -1436,6 +1460,8 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
        if (!data)
                return -EINVAL;
 
+       lock_cpu_hotplug();
+
        /* lock this CPU */
        mutex_lock(&data->lock);
 
@@ -1446,6 +1472,8 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
        data->user_policy.governor = data->governor;
 
        mutex_unlock(&data->lock);
+
+       unlock_cpu_hotplug();
        cpufreq_cpu_put(data);
 
        return ret;
@@ -1469,6 +1497,7 @@ int cpufreq_update_policy(unsigned int cpu)
        if (!data)
                return -ENODEV;
 
+       lock_cpu_hotplug();
        mutex_lock(&data->lock);
 
        dprintk("updating policy for CPU %u\n", cpu);
@@ -1494,7 +1523,7 @@ int cpufreq_update_policy(unsigned int cpu)
        ret = __cpufreq_set_policy(data, &policy);
 
        mutex_unlock(&data->lock);
-
+       unlock_cpu_hotplug();
        cpufreq_cpu_put(data);
        return ret;
 }
index b3ebc8f019753db87d072914b1d699e9f36c85eb..c4c578defabfa0e5df0251d430fde58fee7d45ab 100644 (file)
@@ -525,7 +525,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                break;
 
        case CPUFREQ_GOV_LIMITS:
-               lock_cpu_hotplug();
                mutex_lock(&dbs_mutex);
                if (policy->max < this_dbs_info->cur_policy->cur)
                        __cpufreq_driver_target(
@@ -536,7 +535,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                                        this_dbs_info->cur_policy,
                                        policy->min, CPUFREQ_RELATION_L);
                mutex_unlock(&dbs_mutex);
-               unlock_cpu_hotplug();
                break;
        }
        return 0;
index 178f0c547eb7ac928fcdce0d0f0edd3da73c4c70..52cf1f02182591f64f527144e1e3a1394ee9a050 100644 (file)
@@ -309,7 +309,9 @@ static void do_dbs_timer(void *data)
        if (!dbs_info->enable)
                return;
 
+       lock_cpu_hotplug();
        dbs_check_cpu(dbs_info);
+       unlock_cpu_hotplug();
        queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work,
                        usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
 }
@@ -412,7 +414,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                break;
 
        case CPUFREQ_GOV_LIMITS:
-               lock_cpu_hotplug();
                mutex_lock(&dbs_mutex);
                if (policy->max < this_dbs_info->cur_policy->cur)
                        __cpufreq_driver_target(this_dbs_info->cur_policy,
@@ -423,7 +424,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                                                policy->min,
                                                CPUFREQ_RELATION_L);
                mutex_unlock(&dbs_mutex);
-               unlock_cpu_hotplug();
                break;
        }
        return 0;
index 44ae5e5b94cf4a30f4d1ab18287f72ec28caadb1..a06c204589cdf7c9f8e0e68e38c337f1535ace66 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
 #include <linux/cpufreq.h>
+#include <linux/cpu.h>
 #include <linux/types.h>
 #include <linux/fs.h>
 #include <linux/sysfs.h>
@@ -70,6 +71,7 @@ static int cpufreq_set(unsigned int freq, struct cpufreq_policy *policy)
 
        dprintk("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq);
 
+       lock_cpu_hotplug();
        mutex_lock(&userspace_mutex);
        if (!cpu_is_managed[policy->cpu])
                goto err;
@@ -92,6 +94,7 @@ static int cpufreq_set(unsigned int freq, struct cpufreq_policy *policy)
 
  err:
        mutex_unlock(&userspace_mutex);
+       unlock_cpu_hotplug();
        return ret;
 }
 
index bf6ab8a8d5ed8700dce391de101a03b60ee72987..a1cfd4e3c97df8e3454112bda619446b69623b9a 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/rcupdate.h>
 #include <linux/completion.h>
 #include <linux/kobject.h>
+#include <linux/platform_device.h>
 
 #define EDAC_MC_LABEL_LEN      31
 #define MC_PROC_NAME_MAX_LEN 7
index ced309ff056fa123d3a0022dfcc7d7530b60d491..eae9e81be375acecb2a697fd23b7afdcab944b6a 100644 (file)
@@ -232,7 +232,7 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
        unsigned long timeout;
 
        timeout = jiffies + POLL_TIMEOUT;
-       while (time_before(jiffies, timeout)) {
+       while (1) {
                status = inb(ACBST);
 
                /* Reset the status register to avoid the hang */
@@ -242,7 +242,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
                        scx200_acb_machine(iface, status);
                        return;
                }
-               yield();
+               if (time_after(jiffies, timeout))
+                       break;
+               cpu_relax();
+               cond_resched();
        }
 
        dev_err(&iface->adapter.dev, "timeout in state %s\n",
index d1266fe2d1abc9b53277c9719019cd97f632cfd2..b6fb167e20f681980a54c9baa7ef14a0de4fea83 100644 (file)
@@ -682,6 +682,7 @@ config BLK_DEV_SVWKS
 config BLK_DEV_SGIIOC4
        tristate "Silicon Graphics IOC4 chipset ATA/ATAPI support"
        depends on (IA64_SGI_SN2 || IA64_GENERIC) && SGI_IOC4
+       select IDEPCI_SHARE_IRQ
        help
          This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
          chipset, which has one channel and can support two devices.
@@ -773,20 +774,6 @@ config BLK_DEV_IDEDMA_PMAC
          to transfer data to and from memory.  Saying Y is safe and improves
          performance.
 
-config BLK_DEV_IDE_PMAC_BLINK
-       bool "Blink laptop LED on drive activity (DEPRECATED)"
-       depends on BLK_DEV_IDE_PMAC && ADB_PMU
-       select ADB_PMU_LED
-       select LEDS_TRIGGERS
-       select LEDS_TRIGGER_IDE_DISK
-       help
-         This option enables the use of the sleep LED as a hard drive
-         activity LED.
-         This option is deprecated, it only selects ADB_PMU_LED and
-         LEDS_TRIGGER_IDE_DISK and changes the code in the new led class
-         device to default to the ide-disk trigger (which should be set
-         from userspace via sysfs).
-
 config BLK_DEV_IDE_SWARM
        tristate "IDE for Sibyte evaluation boards"
        depends on SIBYTE_SB1xxx_SOC
index f712e4cfd9dcb7eb1dafba2dc59f7e1c584f80f2..7cf3eb02352140d8f8558533aee4107c8fd1a445 100644 (file)
@@ -776,7 +776,7 @@ static void update_ordered(ide_drive_t *drive)
                 * not available so we don't need to recheck that.
                 */
                capacity = idedisk_capacity(drive);
-               barrier = ide_id_has_flush_cache(id) &&
+               barrier = ide_id_has_flush_cache(id) && !drive->noflush &&
                        (drive->addressing == 0 || capacity <= (1ULL << 28) ||
                         ide_id_has_flush_cache_ext(id));
 
index 98918fb6b2ce32a8854fa4c05068e2fc9ad184c4..7c3a13e1cf647a4cbca6ee39c327c36f9de8d422 100644 (file)
@@ -750,7 +750,7 @@ void ide_dma_verbose(ide_drive_t *drive)
                        goto bug_dma_off;
                printk(", DMA");
        } else if (id->field_valid & 1) {
-               printk(", BUG");
+               goto bug_dma_off;
        }
        return;
 bug_dma_off:
index 657165297dc76c0a16bd2126b854920ffbf99cbe..77703acaec1731164c433d7ce35d2eda0ba15293 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/bitops.h>
+#include <linux/nmi.h>
 
 #include <asm/byteorder.h>
 #include <asm/irq.h>
@@ -1243,6 +1244,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
                if (stat == 0xff)
                        return -ENODEV;
                touch_softlockup_watchdog();
+               touch_nmi_watchdog();
        }
        return -EBUSY;
 }
index 05fbd9298db7c7cd5e265a8d9a65a994ec1c81f5..defd4b4bd37488ab38198e8ab86f963c438e2809 100644 (file)
@@ -1539,7 +1539,7 @@ static int __init ide_setup(char *s)
                const char *hd_words[] = {
                        "none", "noprobe", "nowerr", "cdrom", "serialize",
                        "autotune", "noautotune", "minus8", "swapdata", "bswap",
-                       "minus11", "remap", "remap63", "scsi", NULL };
+                       "noflush", "remap", "remap63", "scsi", NULL };
                unit = s[2] - 'a';
                hw   = unit / MAX_DRIVES;
                unit = unit % MAX_DRIVES;
@@ -1578,6 +1578,9 @@ static int __init ide_setup(char *s)
                        case -10: /* "bswap" */
                                drive->bswap = 1;
                                goto done;
+                       case -11: /* noflush */
+                               drive->noflush = 1;
+                               goto done;
                        case -12: /* "remap" */
                                drive->remap_0_to_1 = 1;
                                goto done;
index 2f962cfa3f7f0f2e4a38af238cce287bd6d19f9a..78810ba982e9efb17b6713c1a12d480ec4e77491 100644 (file)
@@ -180,6 +180,36 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
                .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
+       },{     /* 15 */
+               .name           = "JMB361",
+               .init_hwif      = init_hwif_generic,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .bootable       = OFF_BOARD,
+       },{     /* 16 */
+               .name           = "JMB363",
+               .init_hwif      = init_hwif_generic,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .bootable       = OFF_BOARD,
+       },{     /* 17 */
+               .name           = "JMB365",
+               .init_hwif      = init_hwif_generic,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .bootable       = OFF_BOARD,
+       },{     /* 18 */
+               .name           = "JMB366",
+               .init_hwif      = init_hwif_generic,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .bootable       = OFF_BOARD,
+       },{     /* 19 */
+               .name           = "JMB368",
+               .init_hwif      = init_hwif_generic,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .bootable       = OFF_BOARD,
        }
 };
 
index 3cb04424d351dcb9f88e0163a120ea103983b19c..e9bad185968a8e289cd28f2844ac2578b6727373 100644 (file)
@@ -498,9 +498,14 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 {
        u8 speed        = ide_dma_speed(drive, it821x_ratemask(drive));
 
-       config_it821x_chipset_for_pio(drive, !speed);
-       it821x_tune_chipset(drive, speed);
-       return ide_dma_enable(drive);
+       if (speed) {
+               config_it821x_chipset_for_pio(drive, 0);
+               it821x_tune_chipset(drive, speed);
+
+               return ide_dma_enable(drive);
+       }
+
+       return 0;
 }
 
 /**
index aaa74f293aaf4279353c77404ba9f38ac2c98663..b08755e2e68f31115ff11920f598835001ea0bd3 100644 (file)
@@ -2515,6 +2515,9 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
                sdev->skip_ms_page_8 = 1;
        if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
                sdev->fix_capacity = 1;
+       if (scsi_id->ne->guid_vendor_id == 0x0010b9 && /* Maxtor's OUI */
+           (sdev->type == TYPE_DISK || sdev->type == TYPE_RBC))
+               sdev->allow_restart = 1;
        return 0;
 }
 
index d294bbc42f091792468a265fff603c4f1916c2ee..1205e8027829aa55dee38e10af974abd8d46ba93 100644 (file)
@@ -35,6 +35,7 @@
 #include <net/arp.h>
 #include <net/neighbour.h>
 #include <net/route.h>
+#include <net/netevent.h>
 #include <rdma/ib_addr.h>
 
 MODULE_AUTHOR("Sean Hefty");
@@ -326,25 +327,22 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr)
 }
 EXPORT_SYMBOL(rdma_addr_cancel);
 
-static int addr_arp_recv(struct sk_buff *skb, struct net_device *dev,
-                        struct packet_type *pkt, struct net_device *orig_dev)
+static int netevent_callback(struct notifier_block *self, unsigned long event, 
+       void *ctx)
 {
-       struct arphdr *arp_hdr;
+       if (event == NETEVENT_NEIGH_UPDATE) {  
+               struct neighbour *neigh = ctx;
 
-       arp_hdr = (struct arphdr *) skb->nh.raw;
-
-       if (arp_hdr->ar_op == htons(ARPOP_REQUEST) ||
-           arp_hdr->ar_op == htons(ARPOP_REPLY))
-               set_timeout(jiffies);
-
-       kfree_skb(skb);
+               if (neigh->dev->type == ARPHRD_INFINIBAND &&
+                   (neigh->nud_state & NUD_VALID)) {
+                       set_timeout(jiffies);
+               }
+       }
        return 0;
 }
 
-static struct packet_type addr_arp = {
-       .type           = __constant_htons(ETH_P_ARP),
-       .func           = addr_arp_recv,
-       .af_packet_priv = (void*) 1,
+static struct notifier_block nb = {
+       .notifier_call = netevent_callback
 };
 
 static int addr_init(void)
@@ -353,13 +351,13 @@ static int addr_init(void)
        if (!addr_wq)
                return -ENOMEM;
 
-       dev_add_pack(&addr_arp);
+       register_netevent_notifier(&nb);
        return 0;
 }
 
 static void addr_cleanup(void)
 {
-       dev_remove_pack(&addr_arp);
+       unregister_netevent_notifier(&nb);
        destroy_workqueue(addr_wq);
 }
 
index f85c97f7500a844d41bd5e7b5243e6cd10bd44db..0de335b7bfc2f9e5236f603cf765e3fd96d89fc1 100644 (file)
@@ -975,8 +975,10 @@ int ib_send_cm_req(struct ib_cm_id *cm_id,
 
        cm_id_priv->timewait_info = cm_create_timewait_info(cm_id_priv->
                                                            id.local_id);
-       if (IS_ERR(cm_id_priv->timewait_info))
+       if (IS_ERR(cm_id_priv->timewait_info)) {
+               ret = PTR_ERR(cm_id_priv->timewait_info);
                goto out;
+       }
 
        ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av);
        if (ret)
index bb9bee56a824a9ea5b1da2417a882a12aab11f16..102a59c033ff9fe3b0f79b8aedc66ced43515eb4 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/kref.h>
 #include <linux/idr.h>
 #include <linux/mutex.h>
+#include <linux/completion.h>
 
 #include <rdma/ib_verbs.h>
 #include <rdma/ib_user_verbs.h>
@@ -69,6 +70,7 @@
 
 struct ib_uverbs_device {
        struct kref                             ref;
+       struct completion                       comp;
        int                                     devnum;
        struct cdev                            *dev;
        struct class_device                    *class_dev;
index e725cccc7cde245803a10791fec5c31c212a1b36..4e16314e8e6dd8bec8e9aabb4917a841f441695f 100644 (file)
@@ -122,7 +122,7 @@ static void ib_uverbs_release_dev(struct kref *ref)
        struct ib_uverbs_device *dev =
                container_of(ref, struct ib_uverbs_device, ref);
 
-       kfree(dev);
+       complete(&dev->comp);
 }
 
 void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
@@ -740,6 +740,7 @@ static void ib_uverbs_add_one(struct ib_device *device)
                return;
 
        kref_init(&uverbs_dev->ref);
+       init_completion(&uverbs_dev->comp);
 
        spin_lock(&map_lock);
        uverbs_dev->devnum = find_first_zero_bit(dev_map, IB_UVERBS_MAX_DEVICES);
@@ -793,6 +794,8 @@ err_cdev:
 
 err:
        kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
+       wait_for_completion(&uverbs_dev->comp);
+       kfree(uverbs_dev);
        return;
 }
 
@@ -812,7 +815,10 @@ static void ib_uverbs_remove_one(struct ib_device *device)
        spin_unlock(&map_lock);
 
        clear_bit(uverbs_dev->devnum, dev_map);
+
        kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
+       wait_for_completion(&uverbs_dev->comp);
+       kfree(uverbs_dev);
 }
 
 static int uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
index 9ba3211cef7cb2a7747348420d5dbad3ff0ee18d..25157f57a6d0809aed11705dd77b7d13d8fbe129 100644 (file)
@@ -108,14 +108,15 @@ void mthca_alloc_cleanup(struct mthca_alloc *alloc)
  * serialize access to the array.
  */
 
+#define MTHCA_ARRAY_MASK (PAGE_SIZE / sizeof (void *) - 1)
+
 void *mthca_array_get(struct mthca_array *array, int index)
 {
        int p = (index * sizeof (void *)) >> PAGE_SHIFT;
 
-       if (array->page_list[p].page) {
-               int i = index & (PAGE_SIZE / sizeof (void *) - 1);
-               return array->page_list[p].page[i];
-       } else
+       if (array->page_list[p].page)
+               return array->page_list[p].page[index & MTHCA_ARRAY_MASK];
+       else
                return NULL;
 }
 
@@ -130,8 +131,7 @@ int mthca_array_set(struct mthca_array *array, int index, void *value)
        if (!array->page_list[p].page)
                return -ENOMEM;
 
-       array->page_list[p].page[index & (PAGE_SIZE / sizeof (void *) - 1)] =
-               value;
+       array->page_list[p].page[index & MTHCA_ARRAY_MASK] = value;
        ++array->page_list[p].used;
 
        return 0;
@@ -144,7 +144,8 @@ void mthca_array_clear(struct mthca_array *array, int index)
        if (--array->page_list[p].used == 0) {
                free_page((unsigned long) array->page_list[p].page);
                array->page_list[p].page = NULL;
-       }
+       } else
+               array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL;
 
        if (array->page_list[p].used < 0)
                pr_debug("Array %p index %d page %d with ref count %d < 0\n",
index 13d6d01c72c028f92b68fa27c7115e8c9c13c950..d74653d7de1c3b6aecf59ec9f9c7a0604ebd3ebd 100644 (file)
@@ -6,8 +6,7 @@ config INFINIBAND_IPOIB
          transports IP packets over InfiniBand so you can use your IB
          device as a fancy NIC.
 
-         The IPoIB protocol is defined by the IETF ipoib working
-         group: <http://www.ietf.org/html.charters/ipoib-charter.html>.
+         See Documentation/infiniband/ipoib.txt for more information
 
 config INFINIBAND_IPOIB_DEBUG
        bool "IP-over-InfiniBand debugging" if EMBEDDED
index 8f472e7113b41afcd4b35f35a0ea7ae0f55d93fe..8257d5a2c8f8955124138cedca609f2719d37e1d 100644 (file)
@@ -77,6 +77,14 @@ MODULE_PARM_DESC(topspin_workarounds,
 
 static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad };
 
+static int mellanox_workarounds = 1;
+
+module_param(mellanox_workarounds, int, 0444);
+MODULE_PARM_DESC(mellanox_workarounds,
+                "Enable workarounds for Mellanox SRP target bugs if != 0");
+
+static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };
+
 static void srp_add_one(struct ib_device *device);
 static void srp_remove_one(struct ib_device *device);
 static void srp_completion(struct ib_cq *cq, void *target_ptr);
@@ -526,8 +534,10 @@ static int srp_reconnect_target(struct srp_target_port *target)
        while (ib_poll_cq(target->cq, 1, &wc) > 0)
                ; /* nothing */
 
+       spin_lock_irq(target->scsi_host->host_lock);
        list_for_each_entry_safe(req, tmp, &target->req_queue, list)
                srp_reset_req(target, req);
+       spin_unlock_irq(target->scsi_host->host_lock);
 
        target->rx_head  = 0;
        target->tx_head  = 0;
@@ -567,7 +577,7 @@ err:
        return ret;
 }
 
-static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
+static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
                       int sg_cnt, struct srp_request *req,
                       struct srp_direct_buf *buf)
 {
@@ -577,10 +587,15 @@ static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
        int page_cnt;
        int i, j;
        int ret;
+       struct srp_device *dev = target->srp_host->dev;
 
        if (!dev->fmr_pool)
                return -ENODEV;
 
+       if ((sg_dma_address(&scat[0]) & ~dev->fmr_page_mask) &&
+           mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3))
+               return -EINVAL;
+
        len = page_cnt = 0;
        for (i = 0; i < sg_cnt; ++i) {
                if (sg_dma_address(&scat[i]) & ~dev->fmr_page_mask) {
@@ -683,7 +698,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
                buf->va  = cpu_to_be64(sg_dma_address(scat));
                buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey);
                buf->len = cpu_to_be32(sg_dma_len(scat));
-       } else if (srp_map_fmr(target->srp_host->dev, scat, count, req,
+       } else if (srp_map_fmr(target, scat, count, req,
                               (void *) cmd->add_data)) {
                /*
                 * FMR mapping failed, and the scatterlist has more
index a29d5ceb00cf9e5903d4dfb7167b2abc9d8af22c..4bf48188cc9114cdce3a6a97de55351db1bf9ec3 100644 (file)
@@ -127,14 +127,10 @@ static int evdev_open(struct inode * inode, struct file * file)
 {
        struct evdev_list *list;
        int i = iminor(inode) - EVDEV_MINOR_BASE;
-       int accept_err;
 
        if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist)
                return -ENODEV;
 
-       if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))
-               return accept_err;
-
        if (!(list = kzalloc(sizeof(struct evdev_list), GFP_KERNEL)))
                return -ENOMEM;
 
@@ -260,7 +256,7 @@ static ssize_t evdev_write(struct file * file, const char __user * buffer, size_
 
                if (evdev_event_from_user(buffer + retval, &event))
                        return -EFAULT;
-               input_event(list->evdev->handle.dev, event.type, event.code, event.value);
+               input_inject_event(&list->evdev->handle, event.type, event.code, event.value);
                retval += evdev_event_size();
        }
 
@@ -428,8 +424,8 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
                        if (get_user(v, ip + 1))
                                return -EFAULT;
 
-                       input_event(dev, EV_REP, REP_DELAY, u);
-                       input_event(dev, EV_REP, REP_PERIOD, v);
+                       input_inject_event(&evdev->handle, EV_REP, REP_DELAY, u);
+                       input_inject_event(&evdev->handle, EV_REP, REP_PERIOD, v);
 
                        return 0;
 
index 47e93daa0fa7c498aec5ae237135126d0ef2e040..90de5afe03c21a40c95383d01f919e2b15699eb8 100644 (file)
@@ -106,10 +106,10 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
        gp->gameport = port;
        gp->res_port = request_region(port->io, 0x10, "FM801 GP");
        if (!gp->res_port) {
-               kfree(gp);
-               gameport_free_port(port);
                printk(KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n",
                        port->io, port->io + 0x0f);
+               gameport_free_port(port);
+               kfree(gp);
                return -EBUSY;
        }
 
index 36644bff379d5126a90d209fc71f8605ab4b74e9..3f47ae55c6f3892f7c6b6952e9cf38ccf7d8585f 100644 (file)
@@ -53,6 +53,7 @@ static LIST_HEAD(gameport_list);
 
 static struct bus_type gameport_bus;
 
+static void gameport_add_driver(struct gameport_driver *drv);
 static void gameport_add_port(struct gameport *gameport);
 static void gameport_destroy_port(struct gameport *gameport);
 static void gameport_reconnect_port(struct gameport *gameport);
@@ -211,8 +212,14 @@ static void gameport_release_driver(struct gameport *gameport)
 
 static void gameport_find_driver(struct gameport *gameport)
 {
+       int error;
+
        down_write(&gameport_bus.subsys.rwsem);
-       device_attach(&gameport->dev);
+       error = device_attach(&gameport->dev);
+       if (error < 0)
+               printk(KERN_WARNING
+                       "gameport: device_attach() failed for %s (%s), error: %d\n",
+                       gameport->phys, gameport->name, error);
        up_write(&gameport_bus.subsys.rwsem);
 }
 
@@ -316,7 +323,6 @@ static void gameport_remove_duplicate_events(struct gameport_event *event)
        spin_unlock_irqrestore(&gameport_event_lock, flags);
 }
 
-
 static struct gameport_event *gameport_get_event(void)
 {
        struct gameport_event *event;
@@ -342,7 +348,6 @@ static struct gameport_event *gameport_get_event(void)
 static void gameport_handle_event(void)
 {
        struct gameport_event *event;
-       struct gameport_driver *gameport_drv;
 
        mutex_lock(&gameport_mutex);
 
@@ -369,8 +374,7 @@ static void gameport_handle_event(void)
                                break;
 
                        case GAMEPORT_REGISTER_DRIVER:
-                               gameport_drv = event->object;
-                               driver_register(&gameport_drv->driver);
+                               gameport_add_driver(event->object);
                                break;
 
                        default:
@@ -532,6 +536,7 @@ static void gameport_init_port(struct gameport *gameport)
        if (gameport->parent)
                gameport->dev.parent = &gameport->parent->dev;
 
+       INIT_LIST_HEAD(&gameport->node);
        spin_lock_init(&gameport->timer_lock);
        init_timer(&gameport->poll_timer);
        gameport->poll_timer.function = gameport_run_poll_handler;
@@ -544,6 +549,8 @@ static void gameport_init_port(struct gameport *gameport)
  */
 static void gameport_add_port(struct gameport *gameport)
 {
+       int error;
+
        if (gameport->parent)
                gameport->parent->child = gameport;
 
@@ -558,8 +565,13 @@ static void gameport_add_port(struct gameport *gameport)
                printk(KERN_INFO "gameport: %s is %s, speed %dkHz\n",
                        gameport->name, gameport->phys, gameport->speed);
 
-       device_add(&gameport->dev);
-       gameport->registered = 1;
+       error = device_add(&gameport->dev);
+       if (error)
+               printk(KERN_ERR
+                       "gameport: device_add() failed for %s (%s), error: %d\n",
+                       gameport->phys, gameport->name, error);
+       else
+               gameport->registered = 1;
 }
 
 /*
@@ -583,10 +595,11 @@ static void gameport_destroy_port(struct gameport *gameport)
 
        if (gameport->registered) {
                device_del(&gameport->dev);
-               list_del_init(&gameport->node);
                gameport->registered = 0;
        }
 
+       list_del_init(&gameport->node);
+
        gameport_remove_pending_events(gameport);
        put_device(&gameport->dev);
 }
@@ -704,11 +717,22 @@ static int gameport_driver_remove(struct device *dev)
 }
 
 static struct bus_type gameport_bus = {
-       .name = "gameport",
-       .probe = gameport_driver_probe,
-       .remove = gameport_driver_remove,
+       .name   = "gameport",
+       .probe  = gameport_driver_probe,
+       .remove = gameport_driver_remove,
 };
 
+static void gameport_add_driver(struct gameport_driver *drv)
+{
+       int error;
+
+       error = driver_register(&drv->driver);
+       if (error)
+               printk(KERN_ERR
+                       "gameport: driver_register() failed for %s, error: %d\n",
+                       drv->driver.name, error);
+}
+
 void __gameport_register_driver(struct gameport_driver *drv, struct module *owner)
 {
        drv->driver.bus = &gameport_bus;
@@ -778,16 +802,24 @@ void gameport_close(struct gameport *gameport)
 
 static int __init gameport_init(void)
 {
-       gameport_task = kthread_run(gameport_thread, NULL, "kgameportd");
-       if (IS_ERR(gameport_task)) {
-               printk(KERN_ERR "gameport: Failed to start kgameportd\n");
-               return PTR_ERR(gameport_task);
-       }
+       int error;
 
        gameport_bus.dev_attrs = gameport_device_attrs;
        gameport_bus.drv_attrs = gameport_driver_attrs;
        gameport_bus.match = gameport_bus_match;
-       bus_register(&gameport_bus);
+       error = bus_register(&gameport_bus);
+       if (error) {
+               printk(KERN_ERR "gameport: failed to register gameport bus, error: %d\n", error);
+               return error;
+       }
+
+       gameport_task = kthread_run(gameport_thread, NULL, "kgameportd");
+       if (IS_ERR(gameport_task)) {
+               bus_unregister(&gameport_bus);
+               error = PTR_ERR(gameport_task);
+               printk(KERN_ERR "gameport: Failed to start kgameportd, error: %d\n", error);
+               return error;
+       }
 
        return 0;
 }
index a90486f5e49127bf3bbae494d8502d86835f412c..9cb4b9a54f01ffa38dd0f803785f190dae1f8adb 100644 (file)
@@ -35,6 +35,16 @@ static LIST_HEAD(input_handler_list);
 
 static struct input_handler *input_table[8];
 
+/**
+ * input_event() - report new input event
+ * @handle: device that generated the event
+ * @type: type of the event
+ * @code: event code
+ * @value: value of the event
+ *
+ * This function should be used by drivers implementing various input devices
+ * See also input_inject_event()
+ */
 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
        struct input_handle *handle;
@@ -183,6 +193,23 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
 }
 EXPORT_SYMBOL(input_event);
 
+/**
+ * input_inject_event() - send input event from input handler
+ * @handle: input handle to send event through
+ * @type: type of the event
+ * @code: event code
+ * @value: value of the event
+ *
+ * Similar to input_event() but will ignore event if device is "grabbed" and handle
+ * injecting event is not the one that owns the device.
+ */
+void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
+{
+       if (!handle->dev->grab || handle->dev->grab == handle)
+               input_event(handle->dev, type, code, value);
+}
+EXPORT_SYMBOL(input_inject_event);
+
 static void input_repeat_key(unsigned long data)
 {
        struct input_dev *dev = (void *) data;
@@ -197,15 +224,6 @@ static void input_repeat_key(unsigned long data)
                mod_timer(&dev->timer, jiffies + msecs_to_jiffies(dev->rep[REP_PERIOD]));
 }
 
-int input_accept_process(struct input_handle *handle, struct file *file)
-{
-       if (handle->dev->accept)
-               return handle->dev->accept(handle->dev, file);
-
-       return 0;
-}
-EXPORT_SYMBOL(input_accept_process);
-
 int input_grab_device(struct input_handle *handle)
 {
        if (handle->dev->grab)
@@ -218,8 +236,15 @@ EXPORT_SYMBOL(input_grab_device);
 
 void input_release_device(struct input_handle *handle)
 {
-       if (handle->dev->grab == handle)
-               handle->dev->grab = NULL;
+       struct input_dev *dev = handle->dev;
+
+       if (dev->grab == handle) {
+               dev->grab = NULL;
+
+               list_for_each_entry(handle, &dev->h_list, d_node)
+                       if (handle->handler->start)
+                               handle->handler->start(handle);
+       }
 }
 EXPORT_SYMBOL(input_release_device);
 
@@ -963,8 +988,11 @@ int input_register_device(struct input_dev *dev)
        list_for_each_entry(handler, &input_handler_list, node)
                if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
                        if ((id = input_match_device(handler->id_table, dev)))
-                               if ((handle = handler->connect(handler, dev, id)))
+                               if ((handle = handler->connect(handler, dev, id))) {
                                        input_link_handle(handle);
+                                       if (handler->start)
+                                               handler->start(handle);
+                               }
 
        input_wakeup_procfs_readers();
 
@@ -1028,8 +1056,11 @@ void input_register_handler(struct input_handler *handler)
        list_for_each_entry(dev, &input_dev_list, node)
                if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
                        if ((id = input_match_device(handler->id_table, dev)))
-                               if ((handle = handler->connect(handler, dev, id)))
+                               if ((handle = handler->connect(handler, dev, id))) {
                                        input_link_handle(handle);
+                                       if (handler->start)
+                                               handler->start(handle);
+                               }
 
        input_wakeup_procfs_readers();
 }
index 6d99e3c37884257d4b16fa35807a691059169a7b..b4914e7231f863a3073da1c7e8e320e3e93c9c87 100644 (file)
@@ -79,6 +79,7 @@ static struct iforce_device iforce_device[] = {
        { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback",       btn_wheel, abs_wheel, ff_iforce }, //?
        { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel",      btn_wheel, abs_wheel, ff_iforce }, //?
        { 0x06f8, 0x0004, "Gullemot Jet Leader 3D",                     btn_joystick, abs_joystick, ff_iforce }, //?
+       { 0x06d6, 0x29bc, "Trust Force Feedback Race Master",           btn_wheel, abs_wheel, ff_iforce },
        { 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]",         btn_joystick, abs_joystick, ff_iforce }
 };
 
@@ -222,22 +223,22 @@ static int iforce_erase_effect(struct input_dev *dev, int effect_id)
        int err = 0;
        struct iforce_core_effect* core_effect;
 
-       /* Check who is trying to erase this effect */
-       if (iforce->core_effects[effect_id].owner != current->pid) {
-               printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, iforce->core_effects[effect_id].owner);
-               return -EACCES;
-       }
-
        if (effect_id < 0 || effect_id >= FF_EFFECTS_MAX)
                return -EINVAL;
 
-       core_effect = iforce->core_effects + effect_id;
+       core_effect = &iforce->core_effects[effect_id];
+
+       /* Check who is trying to erase this effect */
+       if (core_effect->owner != current->pid) {
+               printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, core_effect->owner);
+               return -EACCES;
+       }
 
        if (test_bit(FF_MOD1_IS_USED, core_effect->flags))
-               err = release_resource(&(iforce->core_effects[effect_id].mod1_chunk));
+               err = release_resource(&core_effect->mod1_chunk);
 
        if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags))
-               err = release_resource(&(iforce->core_effects[effect_id].mod2_chunk));
+               err = release_resource(&core_effect->mod2_chunk);
 
        /*TODO: remember to change that if more FF_MOD* bits are added */
        core_effect->flags[0] = 0;
index 75eb5ca59992aa21afc6244fe39c264887cbdff0..7a19ee052972ab4c50bd5b4a0c106c25d8f4a6cd 100644 (file)
@@ -50,7 +50,7 @@ MODULE_LICENSE("GPL");
  */
 
 #define SPACEBALL_MAX_LENGTH   128
-#define SPACEBALL_MAX_ID       8
+#define SPACEBALL_MAX_ID       9
 
 #define SPACEBALL_1003      1
 #define SPACEBALL_2003B     3
index ce1f10e8984b064beede5a3ea934ecd4894e6ab2..6bfa0cf4b1d2db2cf7ace5f90ceb39f955c23398 100644 (file)
@@ -482,13 +482,7 @@ out:
        return IRQ_HANDLED;
 }
 
-/*
- * atkbd_event_work() is used to complete processing of events that
- * can not be processed by input_event() which is often called from
- * interrupt context.
- */
-
-static void atkbd_event_work(void *data)
+static int atkbd_set_repeat_rate(struct atkbd *atkbd)
 {
        const short period[32] =
                { 33,  37,  42,  46,  50,  54,  58,  63,  67,  75,  83,  92, 100, 109, 116, 125,
@@ -496,41 +490,64 @@ static void atkbd_event_work(void *data)
        const short delay[4] =
                { 250, 500, 750, 1000 };
 
-       struct atkbd *atkbd = data;
+       struct input_dev *dev = atkbd->dev;
+       unsigned char param;
+       int i = 0, j = 0;
+
+       while (i < ARRAY_SIZE(period) - 1 && period[i] < dev->rep[REP_PERIOD])
+               i++;
+       dev->rep[REP_PERIOD] = period[i];
+
+       while (j < ARRAY_SIZE(period) - 1 && delay[j] < dev->rep[REP_DELAY])
+               j++;
+       dev->rep[REP_DELAY] = delay[j];
+
+       param = i | (j << 5);
+       return ps2_command(&atkbd->ps2dev, &param, ATKBD_CMD_SETREP);
+}
+
+static int atkbd_set_leds(struct atkbd *atkbd)
+{
        struct input_dev *dev = atkbd->dev;
        unsigned char param[2];
-       int i, j;
 
-       mutex_lock(&atkbd->event_mutex);
+       param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
+                | (test_bit(LED_NUML,    dev->led) ? 2 : 0)
+                | (test_bit(LED_CAPSL,   dev->led) ? 4 : 0);
+       if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS))
+               return -1;
 
-       if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) {
-               param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
-                        | (test_bit(LED_NUML,    dev->led) ? 2 : 0)
-                        | (test_bit(LED_CAPSL,   dev->led) ? 4 : 0);
-               ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS);
-
-               if (atkbd->extra) {
-                       param[0] = 0;
-                       param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
-                                | (test_bit(LED_SLEEP,   dev->led) ? 0x02 : 0)
-                                | (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0)
-                                | (test_bit(LED_MISC,    dev->led) ? 0x10 : 0)
-                                | (test_bit(LED_MUTE,    dev->led) ? 0x20 : 0);
-                       ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS);
-               }
+       if (atkbd->extra) {
+               param[0] = 0;
+               param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
+                        | (test_bit(LED_SLEEP,   dev->led) ? 0x02 : 0)
+                        | (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0)
+                        | (test_bit(LED_MISC,    dev->led) ? 0x10 : 0)
+                        | (test_bit(LED_MUTE,    dev->led) ? 0x20 : 0);
+               if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS))
+                       return -1;
        }
 
-       if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) {
-               i = j = 0;
-               while (i < 31 && period[i] < dev->rep[REP_PERIOD])
-                       i++;
-               while (j < 3 && delay[j] < dev->rep[REP_DELAY])
-                       j++;
-               dev->rep[REP_PERIOD] = period[i];
-               dev->rep[REP_DELAY] = delay[j];
-               param[0] = i | (j << 5);
-               ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETREP);
-       }
+       return 0;
+}
+
+/*
+ * atkbd_event_work() is used to complete processing of events that
+ * can not be processed by input_event() which is often called from
+ * interrupt context.
+ */
+
+static void atkbd_event_work(void *data)
+{
+       struct atkbd *atkbd = data;
+
+       mutex_lock(&atkbd->event_mutex);
+
+       if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask))
+               atkbd_set_leds(atkbd);
+
+       if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask))
+               atkbd_set_repeat_rate(atkbd);
 
        mutex_unlock(&atkbd->event_mutex);
 }
@@ -975,7 +992,6 @@ static int atkbd_reconnect(struct serio *serio)
 {
        struct atkbd *atkbd = serio_get_drvdata(serio);
        struct serio_driver *drv = serio->drv;
-       unsigned char param[1];
 
        if (!atkbd || !drv) {
                printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
@@ -985,10 +1001,6 @@ static int atkbd_reconnect(struct serio *serio)
        atkbd_disable(atkbd);
 
        if (atkbd->write) {
-               param[0] = (test_bit(LED_SCROLLL, atkbd->dev->led) ? 1 : 0)
-                        | (test_bit(LED_NUML,    atkbd->dev->led) ? 2 : 0)
-                        | (test_bit(LED_CAPSL,   atkbd->dev->led) ? 4 : 0);
-
                if (atkbd_probe(atkbd))
                        return -1;
                if (atkbd->set != atkbd_select_set(atkbd, atkbd->set, atkbd->extra))
@@ -996,8 +1008,13 @@ static int atkbd_reconnect(struct serio *serio)
 
                atkbd_activate(atkbd);
 
-               if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS))
-                       return -1;
+/*
+ * Restore repeat rate and LEDs (that were reset by atkbd_activate)
+ * to pre-resume state
+ */
+               if (!atkbd->softrepeat)
+                       atkbd_set_repeat_rate(atkbd);
+               atkbd_set_leds(atkbd);
        }
 
        atkbd_enable(atkbd);
index ccf0faeee5c18390ea7ee3f84eb4c1617b00db62..a8efc1af36cb3ade08be3321148966277f98b826 100644 (file)
@@ -94,7 +94,7 @@ static void call_bios(struct regs *regs)
 
 static ssize_t __init locate_wistron_bios(void __iomem *base)
 {
-       static const unsigned char __initdata signature[] =
+       static unsigned char __initdata signature[] =
                { 0x42, 0x21, 0x55, 0x30 };
        ssize_t offset;
 
@@ -259,11 +259,11 @@ static int __init dmi_matched(struct dmi_system_id *dmi)
        return 1;
 }
 
-static struct key_entry keymap_empty[] = {
+static struct key_entry keymap_empty[] __initdata = {
        { KE_END, 0 }
 };
 
-static struct key_entry keymap_fs_amilo_pro_v2000[] = {
+static struct key_entry keymap_fs_amilo_pro_v2000[] __initdata = {
        { KE_KEY,  0x01, KEY_HELP },
        { KE_KEY,  0x11, KEY_PROG1 },
        { KE_KEY,  0x12, KEY_PROG2 },
@@ -273,7 +273,7 @@ static struct key_entry keymap_fs_amilo_pro_v2000[] = {
        { KE_END,  0 }
 };
 
-static struct key_entry keymap_fujitsu_n3510[] = {
+static struct key_entry keymap_fujitsu_n3510[] __initdata = {
        { KE_KEY, 0x11, KEY_PROG1 },
        { KE_KEY, 0x12, KEY_PROG2 },
        { KE_KEY, 0x36, KEY_WWW },
@@ -285,7 +285,7 @@ static struct key_entry keymap_fujitsu_n3510[] = {
        { KE_END, 0 }
 };
 
-static struct key_entry keymap_wistron_ms2111[] = {
+static struct key_entry keymap_wistron_ms2111[] __initdata = {
        { KE_KEY,  0x11, KEY_PROG1 },
        { KE_KEY,  0x12, KEY_PROG2 },
        { KE_KEY,  0x13, KEY_PROG3 },
@@ -294,7 +294,7 @@ static struct key_entry keymap_wistron_ms2111[] = {
        { KE_END,  0 }
 };
 
-static struct key_entry keymap_wistron_ms2141[] = {
+static struct key_entry keymap_wistron_ms2141[] __initdata = {
        { KE_KEY,  0x11, KEY_PROG1 },
        { KE_KEY,  0x12, KEY_PROG2 },
        { KE_WIFI, 0x30, 0 },
@@ -307,7 +307,7 @@ static struct key_entry keymap_wistron_ms2141[] = {
        { KE_END,  0 }
 };
 
-static struct key_entry keymap_acer_aspire_1500[] = {
+static struct key_entry keymap_acer_aspire_1500[] __initdata = {
        { KE_KEY, 0x11, KEY_PROG1 },
        { KE_KEY, 0x12, KEY_PROG2 },
        { KE_WIFI, 0x30, 0 },
@@ -317,7 +317,7 @@ static struct key_entry keymap_acer_aspire_1500[] = {
        { KE_END, 0 }
 };
 
-static struct key_entry keymap_acer_travelmate_240[] = {
+static struct key_entry keymap_acer_travelmate_240[] __initdata = {
        { KE_KEY, 0x31, KEY_MAIL },
        { KE_KEY, 0x36, KEY_WWW },
        { KE_KEY, 0x11, KEY_PROG1 },
@@ -327,7 +327,7 @@ static struct key_entry keymap_acer_travelmate_240[] = {
        { KE_END, 0 }
 };
 
-static struct key_entry keymap_aopen_1559as[] = {
+static struct key_entry keymap_aopen_1559as[] __initdata = {
        { KE_KEY,  0x01, KEY_HELP },
        { KE_KEY,  0x06, KEY_PROG3 },
        { KE_KEY,  0x11, KEY_PROG1 },
@@ -343,7 +343,7 @@ static struct key_entry keymap_aopen_1559as[] = {
  * a list of buttons and their key codes (reported when loading this module
  * with force=1) and the output of dmidecode to $MODULE_AUTHOR.
  */
-static struct dmi_system_id dmi_ids[] = {
+static struct dmi_system_id dmi_ids[] __initdata = {
        {
                .callback = dmi_matched,
                .ident = "Fujitsu-Siemens Amilo Pro V2000",
index 2f0d28840810aad3c4811d276aa1a0cb6ffb17b8..54b696cfe1e33be4bf94b599ab8f5cc71e4562c7 100644 (file)
@@ -238,8 +238,7 @@ static struct ps2pp_info *get_model_info(unsigned char model)
                { 100,  PS2PP_KIND_MX,                                  /* MX510 */
                                PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
                                PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
-               { 111,  PS2PP_KIND_MX,                                  /* MX300 */
-                               PS2PP_WHEEL | PS2PP_EXTRA_BTN | PS2PP_TASK_BTN },
+               { 111,  PS2PP_KIND_MX,  PS2PP_WHEEL | PS2PP_SIDE_BTN }, /* MX300 reports task button as side */
                { 112,  PS2PP_KIND_MX,                                  /* MX500 */
                                PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
                                PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
index 6d9ec9ab1b9069d2b050a2a5d350e7ea09c00cb8..ae5871a0e060fac36f5899436dc9bea9037b53d0 100644 (file)
@@ -183,21 +183,26 @@ static struct attribute_group trackpoint_attr_group = {
        .attrs = trackpoint_attrs,
 };
 
-static void trackpoint_disconnect(struct psmouse *psmouse)
+static int trackpoint_start_protocol(struct psmouse *psmouse, unsigned char *firmware_id)
 {
-       sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group);
+       unsigned char param[2] = { 0 };
 
-       kfree(psmouse->private);
-       psmouse->private = NULL;
+       if (ps2_command(&psmouse->ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
+               return -1;
+
+       if (param[0] != TP_MAGIC_IDENT)
+               return -1;
+
+       if (firmware_id)
+               *firmware_id = param[1];
+
+       return 0;
 }
 
 static int trackpoint_sync(struct psmouse *psmouse)
 {
-       unsigned char toggle;
        struct trackpoint_data *tp = psmouse->private;
-
-       if (!tp)
-               return -1;
+       unsigned char toggle;
 
        /* Disable features that may make device unusable with this driver */
        trackpoint_read(&psmouse->ps2dev, TP_TOGGLE_TWOHAND, &toggle);
@@ -263,27 +268,38 @@ static void trackpoint_defaults(struct trackpoint_data *tp)
        tp->ext_dev = TP_DEF_EXT_DEV;
 }
 
+static void trackpoint_disconnect(struct psmouse *psmouse)
+{
+       sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group);
+
+       kfree(psmouse->private);
+       psmouse->private = NULL;
+}
+
+static int trackpoint_reconnect(struct psmouse *psmouse)
+{
+       if (trackpoint_start_protocol(psmouse, NULL))
+               return -1;
+
+       if (trackpoint_sync(psmouse))
+               return -1;
+
+       return 0;
+}
+
 int trackpoint_detect(struct psmouse *psmouse, int set_properties)
 {
        struct trackpoint_data *priv;
        struct ps2dev *ps2dev = &psmouse->ps2dev;
        unsigned char firmware_id;
        unsigned char button_info;
-       unsigned char param[2];
-
-       param[0] = param[1] = 0;
 
-       if (ps2_command(ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
-               return -1;
-
-       if (param[0] != TP_MAGIC_IDENT)
+       if (trackpoint_start_protocol(psmouse, &firmware_id))
                return -1;
 
        if (!set_properties)
                return 0;
 
-       firmware_id = param[1];
-
        if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) {
                printk(KERN_WARNING "trackpoint.c: failed to get extended button data\n");
                button_info = 0;
@@ -296,7 +312,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
        psmouse->vendor = "IBM";
        psmouse->name = "TrackPoint";
 
-       psmouse->reconnect = trackpoint_sync;
+       psmouse->reconnect = trackpoint_reconnect;
        psmouse->disconnect = trackpoint_disconnect;
 
        trackpoint_defaults(priv);
index 61a6f977846f3fe999ebddd5d58a839e8dac5472..ed202f2f251aa76eeb3b680186a7baa7ddefaa7a 100644 (file)
@@ -177,6 +177,11 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
                return -1;
        }
 
+       if (send && !param) {
+               WARN_ON(1);
+               return -1;
+       }
+
        mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
 
        serio_pause_rx(ps2dev->serio);
index 6521034bc93328289819d92894fd2388401cecbb..3e76ad71c9a027386923be8cdf576b943f69bc77 100644 (file)
@@ -62,6 +62,7 @@ static LIST_HEAD(serio_list);
 
 static struct bus_type serio_bus;
 
+static void serio_add_driver(struct serio_driver *drv);
 static void serio_add_port(struct serio *serio);
 static void serio_destroy_port(struct serio *serio);
 static void serio_reconnect_port(struct serio *serio);
@@ -140,8 +141,14 @@ static void serio_release_driver(struct serio *serio)
 
 static void serio_find_driver(struct serio *serio)
 {
+       int error;
+
        down_write(&serio_bus.subsys.rwsem);
-       device_attach(&serio->dev);
+       error = device_attach(&serio->dev);
+       if (error < 0)
+               printk(KERN_WARNING
+                       "serio: device_attach() failed for %s (%s), error: %d\n",
+                       serio->phys, serio->name, error);
        up_write(&serio_bus.subsys.rwsem);
 }
 
@@ -272,7 +279,6 @@ static struct serio_event *serio_get_event(void)
 static void serio_handle_event(void)
 {
        struct serio_event *event;
-       struct serio_driver *serio_drv;
 
        mutex_lock(&serio_mutex);
 
@@ -304,8 +310,7 @@ static void serio_handle_event(void)
                                break;
 
                        case SERIO_REGISTER_DRIVER:
-                               serio_drv = event->object;
-                               driver_register(&serio_drv->driver);
+                               serio_add_driver(event->object);
                                break;
 
                        default:
@@ -525,6 +530,7 @@ static void serio_init_port(struct serio *serio)
 
        __module_get(THIS_MODULE);
 
+       INIT_LIST_HEAD(&serio->node);
        spin_lock_init(&serio->lock);
        mutex_init(&serio->drv_mutex);
        device_initialize(&serio->dev);
@@ -542,6 +548,8 @@ static void serio_init_port(struct serio *serio)
  */
 static void serio_add_port(struct serio *serio)
 {
+       int error;
+
        if (serio->parent) {
                serio_pause_rx(serio->parent);
                serio->parent->child = serio;
@@ -551,9 +559,19 @@ static void serio_add_port(struct serio *serio)
        list_add_tail(&serio->node, &serio_list);
        if (serio->start)
                serio->start(serio);
-       device_add(&serio->dev);
-       sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);
-       serio->registered = 1;
+       error = device_add(&serio->dev);
+       if (error)
+               printk(KERN_ERR
+                       "serio: device_add() failed for %s (%s), error: %d\n",
+                       serio->phys, serio->name, error);
+       else {
+               serio->registered = 1;
+               error = sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);
+               if (error)
+                       printk(KERN_ERR
+                               "serio: sysfs_create_group() failed for %s (%s), error: %d\n",
+                               serio->phys, serio->name, error);
+       }
 }
 
 /*
@@ -583,10 +601,10 @@ static void serio_destroy_port(struct serio *serio)
        if (serio->registered) {
                sysfs_remove_group(&serio->dev.kobj, &serio_id_attr_group);
                device_del(&serio->dev);
-               list_del_init(&serio->node);
                serio->registered = 0;
        }
 
+       list_del_init(&serio->node);
        serio_remove_pending_events(serio);
        put_device(&serio->dev);
 }
@@ -756,6 +774,17 @@ static struct bus_type serio_bus = {
        .remove = serio_driver_remove,
 };
 
+static void serio_add_driver(struct serio_driver *drv)
+{
+       int error;
+
+       error = driver_register(&drv->driver);
+       if (error)
+               printk(KERN_ERR
+                       "serio: driver_register() failed for %s, error: %d\n",
+                       drv->driver.name, error);
+}
+
 void __serio_register_driver(struct serio_driver *drv, struct module *owner)
 {
        drv->driver.bus = &serio_bus;
@@ -903,18 +932,26 @@ irqreturn_t serio_interrupt(struct serio *serio,
 
 static int __init serio_init(void)
 {
-       serio_task = kthread_run(serio_thread, NULL, "kseriod");
-       if (IS_ERR(serio_task)) {
-               printk(KERN_ERR "serio: Failed to start kseriod\n");
-               return PTR_ERR(serio_task);
-       }
+       int error;
 
        serio_bus.dev_attrs = serio_device_attrs;
        serio_bus.drv_attrs = serio_driver_attrs;
        serio_bus.match = serio_bus_match;
        serio_bus.uevent = serio_uevent;
        serio_bus.resume = serio_resume;
-       bus_register(&serio_bus);
+       error = bus_register(&serio_bus);
+       if (error) {
+               printk(KERN_ERR "serio: failed to register serio bus, error: %d\n", error);
+               return error;
+       }
+
+       serio_task = kthread_run(serio_thread, NULL, "kseriod");
+       if (IS_ERR(serio_task)) {
+               bus_unregister(&serio_bus);
+               error = PTR_ERR(serio_task);
+               printk(KERN_ERR "serio: Failed to start kseriod, error: %d\n", error);
+               return error;
+       }
 
        return 0;
 }
index 0a5be7f969f212e494912f8e1a6db7b0bdaec58e..af3eb9e795b500faba4eaa15eca11152b54c8872 100644 (file)
@@ -256,7 +256,6 @@ typedef struct
 #define NO_ORDER_CHECK_MASK 0x00000010
 #define LOW_CHANNEL_MASK 0x00000020
 #define NO_HSCX30_MASK  0x00000040
-#define MODE_MASK   0x00000080
 #define SET_BOARD   0x00001000
 #define SET_CRC4   0x00030000
 #define SET_L1_TRISTATE  0x00040000
index f5fe7fb4b3ad352c96e1c04582bd2e3e3268af4a..d5d649f5ccdb3a05f14309fd1e11af83c7486a9f 100644 (file)
@@ -90,6 +90,15 @@ config ADB_PMU_LED
          and the ide-disk LED trigger and configure appropriately through
          sysfs.
 
+config ADB_PMU_LED_IDE
+       bool "Use front LED as IDE LED by default"
+       depends on ADB_PMU_LED
+       select LEDS_TRIGGERS
+       select LEDS_TRIGGER_IDE_DISK
+       help
+         This option makes the front LED default to the IDE trigger
+         so that it blinks on IDE activity.
+
 config PMAC_SMU
        bool "Support for SMU  based PowerMacs"
        depends on PPC_PMAC64
@@ -100,7 +109,7 @@ config PMAC_SMU
 
 config PMAC_APM_EMU
        tristate "APM emulation"
-       depends on PPC_PMAC && PPC32 && PM
+       depends on PPC_PMAC && PPC32 && PM && ADB_PMU
 
 config PMAC_MEDIABAY
        bool "Support PowerBook hotswap media bay"
@@ -115,8 +124,6 @@ config PMAC_BACKLIGHT
        bool "Backlight control for LCD screens"
        depends on ADB_PMU && FB = y && (BROKEN || !PPC64)
        select FB_BACKLIGHT
-       select BACKLIGHT_CLASS_DEVICE
-       select BACKLIGHT_LCD_SUPPORT
        help
          Say Y here to enable Macintosh specific extensions of the generic
          backlight code. With this enabled, the brightness keys on older
index 545be1ed692783035d190b2d3a884808db11515f..c69d23bb255e54683357eed0026aaa0040e999d7 100644 (file)
 #include <linux/pmu.h>
 
 #include <asm/machdep.h>
+#include <asm/backlight.h>
 #ifdef CONFIG_PPC_PMAC
 #include <asm/pmac_feature.h>
 #endif
 
-#ifdef CONFIG_PMAC_BACKLIGHT
-#include <asm/backlight.h>
-#endif
-
 MODULE_AUTHOR("Franz Sirl <Franz.Sirl-kernel@lauterbach.com>");
 
 #define KEYB_KEYREG    0       /* register # for key up/down data */
@@ -237,11 +234,6 @@ static struct adb_ids keyboard_ids;
 static struct adb_ids mouse_ids;
 static struct adb_ids buttons_ids;
 
-#ifdef CONFIG_PMAC_BACKLIGHT
-/* Exported to via-pmu.c */
-int disable_kernel_backlight = 0;
-#endif /* CONFIG_PMAC_BACKLIGHT */
-
 /* Kind of keyboard, see Apple technote 1152  */
 #define ADB_KEYBOARD_UNKNOWN   0
 #define ADB_KEYBOARD_ANSI      0x0100
@@ -527,7 +519,7 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
 
                case 0xa:       /* brightness decrease */
 #ifdef CONFIG_PMAC_BACKLIGHT
-                       if (!disable_kernel_backlight && down)
+                       if (down)
                                pmac_backlight_key_down();
 #endif
                        input_report_key(adbhid[id]->input, KEY_BRIGHTNESSDOWN, down);
@@ -535,7 +527,7 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
 
                case 0x9:       /* brightness increase */
 #ifdef CONFIG_PMAC_BACKLIGHT
-                       if (!disable_kernel_backlight && down)
+                       if (down)
                                pmac_backlight_key_up();
 #endif
                        input_report_key(adbhid[id]->input, KEY_BRIGHTNESSUP, down);
index c1fe0b368f7624ff12653f0f3f87d85e571939b7..20bf67244e2c1e35630e813cb5b7d1695e7925d1 100644 (file)
  *     - Use min/max macros here or there
  *     - Latest darwin updated U3H min fan speed to 20% PWM
  *
+ *  July. 06, 2006 : 1.3
+ *     - Fix setting of RPM fans on Xserve G5 (they were going too fast)
+ *      - Add missing slots fan control loop for Xserve G5
+ *     - Lower fixed slots fan speed from 50% to 40% on desktop G5s. We
+ *        still can't properly implement the control loop for these, so let's
+ *        reduce the noise a little bit, it appears that 40% still gives us
+ *        a pretty good air flow
+ *     - Add code to "tickle" the FCU regulary so it doesn't think that
+ *        we are gone while in fact, the machine just didn't need any fan
+ *        speed change lately
+ *
  */
 
 #include <linux/types.h>
 
 #include "therm_pm72.h"
 
-#define VERSION "1.2b2"
+#define VERSION "1.3"
 
 #undef DEBUG
 
@@ -146,6 +157,7 @@ static struct basckside_pid_params  backside_params;
 static struct backside_pid_state       backside_state;
 static struct drives_pid_state         drives_state;
 static struct dimm_pid_state           dimms_state;
+static struct slots_pid_state          slots_state;
 static int                             state;
 static int                             cpu_count;
 static int                             cpu_pid_type;
@@ -154,7 +166,8 @@ static struct completion            ctrl_complete;
 static int                             critical_state;
 static int                             rackmac;
 static s32                             dimm_output_clamp;
-
+static int                             fcu_rpm_shift;
+static int                             fcu_tickle_ticks;
 static DECLARE_MUTEX(driver_lock);
 
 /*
@@ -495,13 +508,20 @@ static int start_fcu(void)
        rc = fan_write_reg(0x2e, &buf, 1);
        if (rc < 0)
                return -EIO;
+       rc = fan_read_reg(0, &buf, 1);
+       if (rc < 0)
+               return -EIO;
+       fcu_rpm_shift = (buf == 1) ? 2 : 3;
+       printk(KERN_DEBUG "FCU Initialized, RPM fan shift is %d\n",
+              fcu_rpm_shift);
+
        return 0;
 }
 
 static int set_rpm_fan(int fan_index, int rpm)
 {
        unsigned char buf[2];
-       int rc, id;
+       int rc, id, min, max;
 
        if (fcu_fans[fan_index].type != FCU_FAN_RPM)
                return -EINVAL;
@@ -509,12 +529,15 @@ static int set_rpm_fan(int fan_index, int rpm)
        if (id == FCU_FAN_ABSENT_ID)
                return -EINVAL;
 
-       if (rpm < 300)
-               rpm = 300;
-       else if (rpm > 8191)
-               rpm = 8191;
-       buf[0] = rpm >> 5;
-       buf[1] = rpm << 3;
+       min = 2400 >> fcu_rpm_shift;
+       max = 56000 >> fcu_rpm_shift;
+
+       if (rpm < min)
+               rpm = min;
+       else if (rpm > max)
+               rpm = max;
+       buf[0] = rpm >> (8 - fcu_rpm_shift);
+       buf[1] = rpm << fcu_rpm_shift;
        rc = fan_write_reg(0x10 + (id * 2), buf, 2);
        if (rc < 0)
                return -EIO;
@@ -551,7 +574,7 @@ static int get_rpm_fan(int fan_index, int programmed)
        if (rc != 2)
                return -EIO;
 
-       return (buf[0] << 5) | buf[1] >> 3;
+       return (buf[0] << (8 - fcu_rpm_shift)) | buf[1] >> fcu_rpm_shift;
 }
 
 static int set_pwm_fan(int fan_index, int pwm)
@@ -609,6 +632,26 @@ static int get_pwm_fan(int fan_index)
        return (buf[0] * 1000) / 2559;
 }
 
+static void tickle_fcu(void)
+{
+       int pwm;
+
+       pwm = get_pwm_fan(SLOTS_FAN_PWM_INDEX);
+
+       DBG("FCU Tickle, slots fan is: %d\n", pwm);
+       if (pwm < 0)
+               pwm = 100;
+
+       if (!rackmac) {
+               pwm = SLOTS_FAN_DEFAULT_PWM;
+       } else if (pwm < SLOTS_PID_OUTPUT_MIN)
+               pwm = SLOTS_PID_OUTPUT_MIN;
+
+       /* That is hopefully enough to make the FCU happy */
+       set_pwm_fan(SLOTS_FAN_PWM_INDEX, pwm);
+}
+
+
 /*
  * Utility routine to read the CPU calibration EEPROM data
  * from the device-tree
@@ -715,6 +758,9 @@ BUILD_SHOW_FUNC_INT(backside_fan_pwm, backside_state.pwm)
 BUILD_SHOW_FUNC_FIX(drives_temperature, drives_state.last_temp)
 BUILD_SHOW_FUNC_INT(drives_fan_rpm, drives_state.rpm)
 
+BUILD_SHOW_FUNC_FIX(slots_temperature, slots_state.last_temp)
+BUILD_SHOW_FUNC_INT(slots_fan_pwm, slots_state.pwm)
+
 BUILD_SHOW_FUNC_FIX(dimms_temperature, dimms_state.last_temp)
 
 static DEVICE_ATTR(cpu0_temperature,S_IRUGO,show_cpu0_temperature,NULL);
@@ -735,6 +781,9 @@ static DEVICE_ATTR(backside_fan_pwm,S_IRUGO,show_backside_fan_pwm,NULL);
 static DEVICE_ATTR(drives_temperature,S_IRUGO,show_drives_temperature,NULL);
 static DEVICE_ATTR(drives_fan_rpm,S_IRUGO,show_drives_fan_rpm,NULL);
 
+static DEVICE_ATTR(slots_temperature,S_IRUGO,show_slots_temperature,NULL);
+static DEVICE_ATTR(slots_fan_pwm,S_IRUGO,show_slots_fan_pwm,NULL);
+
 static DEVICE_ATTR(dimms_temperature,S_IRUGO,show_dimms_temperature,NULL);
 
 /*
@@ -1076,6 +1125,9 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state)
        fan_min = dimm_output_clamp;
        fan_min = max(fan_min, (int)state->mpu.rminn_intake_fan);
 
+       DBG(" CPU min mpu = %d, min dimm = %d\n",
+           state->mpu.rminn_intake_fan, dimm_output_clamp);
+
        state->rpm = max(state->rpm, (int)fan_min);
        state->rpm = min(state->rpm, (int)state->mpu.rmaxn_intake_fan);
        state->intake_rpm = state->rpm;
@@ -1374,7 +1426,8 @@ static void do_monitor_drives(struct drives_pid_state *state)
        DBG("  current rpm: %d\n", state->rpm);
 
        /* Get some sensor readings */
-       temp = le16_to_cpu(i2c_smbus_read_word_data(state->monitor, DS1775_TEMP)) << 8;
+       temp = le16_to_cpu(i2c_smbus_read_word_data(state->monitor,
+                                                   DS1775_TEMP)) << 8;
        state->last_temp = temp;
        DBG("  temp: %d.%03d, target: %d.%03d\n", FIX32TOPRINT(temp),
            FIX32TOPRINT(DRIVES_PID_INPUT_TARGET));
@@ -1575,7 +1628,7 @@ static int init_dimms_state(struct dimm_pid_state *state)
 }
 
 /*
- * Dispose of the state data for the drives control loop
+ * Dispose of the state data for the DIMM control loop
  */
 static void dispose_dimms_state(struct dimm_pid_state *state)
 {
@@ -1588,6 +1641,127 @@ static void dispose_dimms_state(struct dimm_pid_state *state)
        state->monitor = NULL;
 }
 
+/*
+ * Slots fan control loop
+ */
+static void do_monitor_slots(struct slots_pid_state *state)
+{
+       s32 temp, integral, derivative;
+       s64 integ_p, deriv_p, prop_p, sum;
+       int i, rc;
+
+       if (--state->ticks != 0)
+               return;
+       state->ticks = SLOTS_PID_INTERVAL;
+
+       DBG("slots:\n");
+
+       /* Check fan status */
+       rc = get_pwm_fan(SLOTS_FAN_PWM_INDEX);
+       if (rc < 0) {
+               printk(KERN_WARNING "Error %d reading slots fan !\n", rc);
+               /* XXX What do we do now ? */
+       } else
+               state->pwm = rc;
+       DBG("  current pwm: %d\n", state->pwm);
+
+       /* Get some sensor readings */
+       temp = le16_to_cpu(i2c_smbus_read_word_data(state->monitor,
+                                                   DS1775_TEMP)) << 8;
+       state->last_temp = temp;
+       DBG("  temp: %d.%03d, target: %d.%03d\n", FIX32TOPRINT(temp),
+           FIX32TOPRINT(SLOTS_PID_INPUT_TARGET));
+
+       /* Store temperature and error in history array */
+       state->cur_sample = (state->cur_sample + 1) % SLOTS_PID_HISTORY_SIZE;
+       state->sample_history[state->cur_sample] = temp;
+       state->error_history[state->cur_sample] = temp - SLOTS_PID_INPUT_TARGET;
+
+       /* If first loop, fill the history table */
+       if (state->first) {
+               for (i = 0; i < (SLOTS_PID_HISTORY_SIZE - 1); i++) {
+                       state->cur_sample = (state->cur_sample + 1) %
+                               SLOTS_PID_HISTORY_SIZE;
+                       state->sample_history[state->cur_sample] = temp;
+                       state->error_history[state->cur_sample] =
+                               temp - SLOTS_PID_INPUT_TARGET;
+               }
+               state->first = 0;
+       }
+
+       /* Calculate the integral term */
+       sum = 0;
+       integral = 0;
+       for (i = 0; i < SLOTS_PID_HISTORY_SIZE; i++)
+               integral += state->error_history[i];
+       integral *= SLOTS_PID_INTERVAL;
+       DBG("  integral: %08x\n", integral);
+       integ_p = ((s64)SLOTS_PID_G_r) * (s64)integral;
+       DBG("   integ_p: %d\n", (int)(integ_p >> 36));
+       sum += integ_p;
+
+       /* Calculate the derivative term */
+       derivative = state->error_history[state->cur_sample] -
+               state->error_history[(state->cur_sample + SLOTS_PID_HISTORY_SIZE - 1)
+                                   % SLOTS_PID_HISTORY_SIZE];
+       derivative /= SLOTS_PID_INTERVAL;
+       deriv_p = ((s64)SLOTS_PID_G_d) * (s64)derivative;
+       DBG("   deriv_p: %d\n", (int)(deriv_p >> 36));
+       sum += deriv_p;
+
+       /* Calculate the proportional term */
+       prop_p = ((s64)SLOTS_PID_G_p) * (s64)(state->error_history[state->cur_sample]);
+       DBG("   prop_p: %d\n", (int)(prop_p >> 36));
+       sum += prop_p;
+
+       /* Scale sum */
+       sum >>= 36;
+
+       DBG("   sum: %d\n", (int)sum);
+       state->pwm = (s32)sum;
+
+       state->pwm = max(state->pwm, SLOTS_PID_OUTPUT_MIN);
+       state->pwm = min(state->pwm, SLOTS_PID_OUTPUT_MAX);
+
+       DBG("** DRIVES PWM: %d\n", (int)state->pwm);
+       set_pwm_fan(SLOTS_FAN_PWM_INDEX, state->pwm);
+}
+
+/*
+ * Initialize the state structure for the slots bay fan control loop
+ */
+static int init_slots_state(struct slots_pid_state *state)
+{
+       state->ticks = 1;
+       state->first = 1;
+       state->pwm = 50;
+
+       state->monitor = attach_i2c_chip(XSERVE_SLOTS_LM75, "slots_temp");
+       if (state->monitor == NULL)
+               return -ENODEV;
+
+       device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
+       device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
+
+       return 0;
+}
+
+/*
+ * Dispose of the state data for the slots control loop
+ */
+static void dispose_slots_state(struct slots_pid_state *state)
+{
+       if (state->monitor == NULL)
+               return;
+
+       device_remove_file(&of_dev->dev, &dev_attr_slots_temperature);
+       device_remove_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
+
+       detach_i2c_chip(state->monitor);
+       state->monitor = NULL;
+}
+
+
 static int call_critical_overtemp(void)
 {
        char *argv[] = { critical_overtemp_path, NULL };
@@ -1617,14 +1791,17 @@ static int main_control_loop(void *x)
                goto out;
        }
 
-       /* Set the PCI fan once for now */
-       set_pwm_fan(SLOTS_FAN_PWM_INDEX, SLOTS_FAN_DEFAULT_PWM);
+       /* Set the PCI fan once for now on non-RackMac */
+       if (!rackmac)
+               set_pwm_fan(SLOTS_FAN_PWM_INDEX, SLOTS_FAN_DEFAULT_PWM);
 
        /* Initialize ADCs */
        initialize_adc(&cpu_state[0]);
        if (cpu_state[1].monitor != NULL)
                initialize_adc(&cpu_state[1]);
 
+       fcu_tickle_ticks = FCU_TICKLE_TICKS;
+
        up(&driver_lock);
 
        while (state == state_attached) {
@@ -1634,6 +1811,12 @@ static int main_control_loop(void *x)
 
                down(&driver_lock);
 
+               /* Tickle the FCU just in case */
+               if (--fcu_tickle_ticks < 0) {
+                       fcu_tickle_ticks = FCU_TICKLE_TICKS;
+                       tickle_fcu();
+               }
+
                /* First, we always calculate the new DIMMs state on an Xserve */
                if (rackmac)
                        do_monitor_dimms(&dimms_state);
@@ -1654,7 +1837,9 @@ static int main_control_loop(void *x)
                }
                /* Then, the rest */
                do_monitor_backside(&backside_state);
-               if (!rackmac)
+               if (rackmac)
+                       do_monitor_slots(&slots_state);
+               else
                        do_monitor_drives(&drives_state);
                up(&driver_lock);
 
@@ -1696,6 +1881,7 @@ static void dispose_control_loops(void)
        dispose_cpu_state(&cpu_state[1]);
        dispose_backside_state(&backside_state);
        dispose_drives_state(&drives_state);
+       dispose_slots_state(&slots_state);
        dispose_dimms_state(&dimms_state);
 }
 
@@ -1745,6 +1931,8 @@ static int create_control_loops(void)
                goto fail;
        if (rackmac && init_dimms_state(&dimms_state))
                goto fail;
+       if (rackmac && init_slots_state(&slots_state))
+               goto fail;
        if (!rackmac && init_drives_state(&drives_state))
                goto fail;
 
index fc7e9b7ecaf2da93f7323cf80e4939b935d93f10..393cc9df94e164ad8cef98fd2cecfd45d2461702 100644 (file)
@@ -105,6 +105,7 @@ static char * critical_overtemp_path = "/sbin/critical_overtemp";
 #define DRIVES_DALLAS_ID       0x94
 #define BACKSIDE_MAX_ID                0x98
 #define XSERVE_DIMMS_LM87      0x25a
+#define XSERVE_SLOTS_LM75      0x290
 
 /*
  * Some MAX6690, DS1775, LM87 register definitions
@@ -198,7 +199,7 @@ struct drives_pid_state
 
 #define SLOTS_FAN_PWM_DEFAULT_ID       2
 #define SLOTS_FAN_PWM_INDEX            2
-#define        SLOTS_FAN_DEFAULT_PWM           50 /* Do better here ! */
+#define        SLOTS_FAN_DEFAULT_PWM           40 /* Do better here ! */
 
 
 /*
@@ -206,7 +207,7 @@ struct drives_pid_state
  */
 #define DIMM_PID_G_d                   0
 #define DIMM_PID_G_p                   0
-#define DIMM_PID_G_r                   0x6553600
+#define DIMM_PID_G_r                   0x06553600
 #define DIMM_PID_INPUT_TARGET          3276800
 #define DIMM_PID_INTERVAL              1
 #define DIMM_PID_OUTPUT_MAX            14000
@@ -226,6 +227,31 @@ struct dimm_pid_state
 };
 
 
+/*
+ * PID factors for the Xserve Slots control loop
+ */
+#define SLOTS_PID_G_d                  0
+#define SLOTS_PID_G_p                  0
+#define SLOTS_PID_G_r                  0x00100000
+#define SLOTS_PID_INPUT_TARGET         3200000
+#define SLOTS_PID_INTERVAL             1
+#define SLOTS_PID_OUTPUT_MAX           100
+#define SLOTS_PID_OUTPUT_MIN           20
+#define SLOTS_PID_HISTORY_SIZE         20
+
+struct slots_pid_state
+{
+       int                     ticks;
+       struct i2c_client *     monitor;
+       s32                     sample_history[SLOTS_PID_HISTORY_SIZE];
+       s32                     error_history[SLOTS_PID_HISTORY_SIZE];
+       int                     cur_sample;
+       s32                     last_temp;
+       int                     first;
+       int                     pwm;
+};
+
+
 
 /* Desktops */
 
@@ -283,6 +309,9 @@ struct cpu_pid_state
        s32                     pump_max;
 };
 
+/* Tickle FCU every 10 seconds */
+#define FCU_TICKLE_TICKS       10
+
 /*
  * Driver state
  */
index b42d05f2aaff60c1d8f6ab50d44f0a4b1eb62a49..d3f8d75bcbb434cae0cf091901444e2d396df495 100644 (file)
@@ -15,8 +15,9 @@
 
 #define MAX_PMU_LEVEL 0xFF
 
-static struct device_node *vias;
 static struct backlight_properties pmu_backlight_data;
+static spinlock_t pmu_backlight_lock;
+static int sleeping;
 
 static int pmu_backlight_get_level_brightness(struct fb_info *info,
                int level)
@@ -40,23 +41,36 @@ static int pmu_backlight_update_status(struct backlight_device *bd)
 {
        struct fb_info *info = class_get_devdata(&bd->class_dev);
        struct adb_request req;
-       int pmulevel, level = bd->props->brightness;
+       unsigned long flags;
+       int level = bd->props->brightness;
 
-       if (vias == NULL)
-               return -ENODEV;
+       spin_lock_irqsave(&pmu_backlight_lock, flags);
+
+       /* Don't update brightness when sleeping */
+       if (sleeping)
+               goto out;
 
        if (bd->props->power != FB_BLANK_UNBLANK ||
            bd->props->fb_blank != FB_BLANK_UNBLANK)
                level = 0;
 
-       pmulevel = pmu_backlight_get_level_brightness(info, level);
+       if (level > 0) {
+               int pmulevel = pmu_backlight_get_level_brightness(info, level);
 
-       pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, pmulevel);
-       pmu_wait_complete(&req);
+               pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, pmulevel);
+               pmu_wait_complete(&req);
 
-       pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
-               PMU_POW_BACKLIGHT | (level > 0 ? PMU_POW_ON : PMU_POW_OFF));
-       pmu_wait_complete(&req);
+               pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
+                       PMU_POW_BACKLIGHT | PMU_POW_ON);
+               pmu_wait_complete(&req);
+       } else {
+               pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
+                       PMU_POW_BACKLIGHT | PMU_POW_OFF);
+               pmu_wait_complete(&req);
+       }
+
+out:
+       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
 
        return 0;
 }
@@ -73,15 +87,39 @@ static struct backlight_properties pmu_backlight_data = {
        .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
 };
 
-void __init pmu_backlight_init(struct device_node *in_vias)
+#ifdef CONFIG_PM
+static int pmu_backlight_sleep_call(struct pmu_sleep_notifier *self, int when)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&pmu_backlight_lock, flags);
+
+       switch (when) {
+       case PBOOK_SLEEP_REQUEST:
+               sleeping = 1;
+               break;
+       case PBOOK_WAKE:
+               sleeping = 0;
+               break;
+       }
+
+       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
+
+       return PBOOK_SLEEP_OK;
+}
+
+static struct pmu_sleep_notifier pmu_backlight_sleep_notif = {
+       .notifier_call = pmu_backlight_sleep_call,
+};
+#endif
+
+void __init pmu_backlight_init()
 {
        struct backlight_device *bd;
        struct fb_info *info;
        char name[10];
        int level, autosave;
 
-       vias = in_vias;
-
        /* Special case for the old PowerBook since I can't test on it */
        autosave =
                machine_is_compatible("AAPL,3400/2400") ||
@@ -141,6 +179,10 @@ void __init pmu_backlight_init(struct device_node *in_vias)
                pmac_backlight = bd;
        mutex_unlock(&pmac_backlight_mutex);
 
+#ifdef CONFIG_PM
+       pmu_register_sleep_notifier(&pmu_backlight_sleep_notif);
+#endif
+
        printk("pmubl: Backlight initialized (%s)\n", name);
 
        return;
index af8375ed0f5ebdf72e150fac3a45e70e573c6919..5189d5454b1f274c1f363eb5baaa9a255132bb98 100644 (file)
@@ -74,7 +74,7 @@ static void pmu_led_set(struct led_classdev *led_cdev,
 
 static struct led_classdev pmu_led = {
        .name = "pmu-front-led",
-#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK
+#ifdef CONFIG_ADB_PMU_LED_IDE
        .default_trigger = "ide-disk",
 #endif
        .brightness_set = pmu_led_set,
index 06ca80bfd6b98442dfce7c532d33a6d8a9e4ced0..ea386801e215976ae002604f070c01ba9a224d1f 100644 (file)
@@ -16,7 +16,6 @@
  *    a sleep or a freq. switch
  *  - Move sleep code out of here to pmac_pm, merge into new
  *    common PM infrastructure
- *  - Move backlight code out as well
  *  - Save/Restore PCI space properly
  *
  */
@@ -60,9 +59,7 @@
 #include <asm/mmu_context.h>
 #include <asm/cputable.h>
 #include <asm/time.h>
-#ifdef CONFIG_PMAC_BACKLIGHT
 #include <asm/backlight.h>
-#endif
 
 #include "via-pmu-event.h"
 
@@ -177,10 +174,6 @@ static int query_batt_timer = BATTERY_POLLING_COUNT;
 static struct adb_request batt_req;
 static struct proc_dir_entry *proc_pmu_batt[PMU_MAX_BATTERIES];
 
-#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
-extern int disable_kernel_backlight;
-#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */
-
 int __fake_sleep;
 int asleep;
 BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
@@ -466,7 +459,7 @@ static int __init via_pmu_dev_init(void)
 
 #ifdef CONFIG_PMAC_BACKLIGHT
        /* Initialize backlight */
-       pmu_backlight_init(vias);
+       pmu_backlight_init();
 #endif
 
 #ifdef CONFIG_PPC32
@@ -1403,11 +1396,8 @@ next:
        else if ((1 << pirq) & PMU_INT_SNDBRT) {
 #ifdef CONFIG_PMAC_BACKLIGHT
                if (len == 3)
-#ifdef CONFIG_INPUT_ADBHID
-                       if (!disable_kernel_backlight)
-#endif /* CONFIG_INPUT_ADBHID */
-                               pmac_backlight_set_legacy_brightness(data[1] >> 4);
-#endif /* CONFIG_PMAC_BACKLIGHT */
+                       pmac_backlight_set_legacy_brightness_pmu(data[1] >> 4);
+#endif
        }
        /* Tick interrupt */
        else if ((1 << pirq) & PMU_INT_TICK) {
@@ -2414,7 +2404,7 @@ struct pmu_private {
        spinlock_t lock;
 #if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
        int     backlight_locker;
-#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */    
+#endif
 };
 
 static LIST_HEAD(all_pmu_pvt);
@@ -2464,7 +2454,7 @@ pmu_open(struct inode *inode, struct file *file)
        spin_lock_irqsave(&all_pvt_lock, flags);
 #if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
        pp->backlight_locker = 0;
-#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */    
+#endif
        list_add(&pp->list, &all_pmu_pvt);
        spin_unlock_irqrestore(&all_pvt_lock, flags);
        file->private_data = pp;
@@ -2559,13 +2549,12 @@ pmu_release(struct inode *inode, struct file *file)
                spin_lock_irqsave(&all_pvt_lock, flags);
                list_del(&pp->list);
                spin_unlock_irqrestore(&all_pvt_lock, flags);
+
 #if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
-               if (pp->backlight_locker) {
-                       spin_lock_irqsave(&pmu_lock, flags);
-                       disable_kernel_backlight--;
-                       spin_unlock_irqrestore(&pmu_lock, flags);
-               }
-#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */
+               if (pp->backlight_locker)
+                       pmac_backlight_enable();
+#endif
+
                kfree(pp);
        }
        unlock_kernel();
@@ -2642,18 +2631,18 @@ pmu_ioctl(struct inode * inode, struct file *filp,
 #ifdef CONFIG_INPUT_ADBHID
        case PMU_IOC_GRAB_BACKLIGHT: {
                struct pmu_private *pp = filp->private_data;
-               unsigned long flags;
 
                if (pp->backlight_locker)
                        return 0;
+
                pp->backlight_locker = 1;
-               spin_lock_irqsave(&pmu_lock, flags);
-               disable_kernel_backlight++;
-               spin_unlock_irqrestore(&pmu_lock, flags);
+               pmac_backlight_disable();
+
                return 0;
        }
 #endif /* CONFIG_INPUT_ADBHID */
 #endif /* CONFIG_PMAC_BACKLIGHT_LEGACY */
+
        case PMU_IOC_GET_MODEL:
                return put_user(pmu_kind, argp);
        case PMU_IOC_HAS_ADB:
index 217615b3322351f4d653b355d1b7290f36248631..93f701ea87bc3438bf5ab2426b74e5f43085827a 100644 (file)
@@ -710,6 +710,8 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
                return -EINVAL;
        }
 
+       m->ti = ti;
+
        r = parse_features(&as, m, ti);
        if (r)
                goto bad;
@@ -751,7 +753,6 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
        }
 
        ti->private = m;
-       m->ti = ti;
 
        return 0;
 
index ff83c9b5979e5feb0c433b4e3a118344e479a5cc..b99c19c7eb2237e6f6583530c849bcfcaa2887c2 100644 (file)
@@ -162,7 +162,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
                goto out;
        }
 
-       min_spacing = mddev->array_size;
+       min_spacing = conf->array_size;
        sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *));
 
        /* min_spacing is the minimum spacing that will fit the hash
@@ -171,7 +171,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
         * that is larger than min_spacing as use the size of that as
         * the actual spacing
         */
-       conf->hash_spacing = mddev->array_size;
+       conf->hash_spacing = conf->array_size;
        for (i=0; i < cnt-1 ; i++) {
                sector_t sz = 0;
                int j;
@@ -228,7 +228,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
        curr_offset = 0;
        i = 0;
        for (curr_offset = 0;
-            curr_offset < mddev->array_size;
+            curr_offset < conf->array_size;
             curr_offset += conf->hash_spacing) {
 
                while (i < mddev->raid_disks-1 &&
index d687a14ec0a7aa6b3b72d9fd322d9508cab8c2da..06ac899a9a26931f3bc23b87cf9a1ae7a351a1a4 100644 (file)
@@ -393,7 +393,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
        state->bandwidth = bandwidth;
 
        if (state->dst_type != DST_TYPE_IS_TERR)
-               return 0;
+               return -EOPNOTSUPP;
 
        switch (bandwidth) {
        case BANDWIDTH_6_MHZ:
@@ -462,7 +462,7 @@ static int dst_set_symbolrate(struct dst_state *state, u32 srate)
 
        state->symbol_rate = srate;
        if (state->dst_type == DST_TYPE_IS_TERR) {
-               return 0;
+               return -EOPNOTSUPP;
        }
        dprintk(verbose, DST_INFO, 1, "set symrate %u", srate);
        srate /= 1000;
@@ -504,7 +504,7 @@ static int dst_set_symbolrate(struct dst_state *state, u32 srate)
 static int dst_set_modulation(struct dst_state *state, fe_modulation_t modulation)
 {
        if (state->dst_type != DST_TYPE_IS_CABLE)
-               return 0;
+               return -EOPNOTSUPP;
 
        state->modulation = modulation;
        switch (modulation) {
@@ -1234,7 +1234,7 @@ int dst_command(struct dst_state *state, u8 *data, u8 len)
                goto error;
        }
        if (write_dst(state, data, len)) {
-               dprintk(verbose, DST_INFO, 1, "Tring to recover.. ");
+               dprintk(verbose, DST_INFO, 1, "Trying to recover.. ");
                if ((dst_error_recovery(state)) < 0) {
                        dprintk(verbose, DST_ERROR, 1, "Recovery Failed.");
                        goto error;
@@ -1328,15 +1328,13 @@ static int dst_tone_power_cmd(struct dst_state *state)
 {
        u8 paket[8] = { 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 };
 
-       if (state->dst_type == DST_TYPE_IS_TERR)
-               return 0;
+       if (state->dst_type != DST_TYPE_IS_SAT)
+               return -EOPNOTSUPP;
        paket[4] = state->tx_tuna[4];
        paket[2] = state->tx_tuna[2];
        paket[3] = state->tx_tuna[3];
        paket[7] = dst_check_sum (paket, 7);
-       dst_command(state, paket, 8);
-
-       return 0;
+       return dst_command(state, paket, 8);
 }
 
 static int dst_get_tuna(struct dst_state *state)
@@ -1465,7 +1463,7 @@ static int dst_set_diseqc(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd
        u8 paket[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec };
 
        if (state->dst_type != DST_TYPE_IS_SAT)
-               return 0;
+               return -EOPNOTSUPP;
        if (cmd->msg_len > 0 && cmd->msg_len < 5)
                memcpy(&paket[3], cmd->msg, cmd->msg_len);
        else if (cmd->msg_len == 5 && state->dst_hw_cap & DST_TYPE_HAS_DISEQC5)
@@ -1473,18 +1471,17 @@ static int dst_set_diseqc(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd
        else
                return -EINVAL;
        paket[7] = dst_check_sum(&paket[0], 7);
-       dst_command(state, paket, 8);
-       return 0;
+       return dst_command(state, paket, 8);
 }
 
 static int dst_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
 {
-       int need_cmd;
+       int need_cmd, retval = 0;
        struct dst_state *state = fe->demodulator_priv;
 
        state->voltage = voltage;
        if (state->dst_type != DST_TYPE_IS_SAT)
-               return 0;
+               return -EOPNOTSUPP;
 
        need_cmd = 0;
 
@@ -1506,9 +1503,9 @@ static int dst_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
        }
 
        if (need_cmd)
-               dst_tone_power_cmd(state);
+               retval = dst_tone_power_cmd(state);
 
-       return 0;
+       return retval;
 }
 
 static int dst_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
@@ -1517,7 +1514,7 @@ static int dst_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
 
        state->tone = tone;
        if (state->dst_type != DST_TYPE_IS_SAT)
-               return 0;
+               return -EOPNOTSUPP;
 
        switch (tone) {
        case SEC_TONE_OFF:
@@ -1533,9 +1530,7 @@ static int dst_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
        default:
                return -EINVAL;
        }
-       dst_tone_power_cmd(state);
-
-       return 0;
+       return dst_tone_power_cmd(state);
 }
 
 static int dst_send_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t minicmd)
@@ -1543,7 +1538,7 @@ static int dst_send_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t minicmd)
        struct dst_state *state = fe->demodulator_priv;
 
        if (state->dst_type != DST_TYPE_IS_SAT)
-               return 0;
+               return -EOPNOTSUPP;
        state->minicmd = minicmd;
        switch (minicmd) {
        case SEC_MINI_A:
@@ -1553,9 +1548,7 @@ static int dst_send_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t minicmd)
                state->tx_tuna[3] = 0xff;
                break;
        }
-       dst_tone_power_cmd(state);
-
-       return 0;
+       return dst_tone_power_cmd(state);
 }
 
 
@@ -1608,28 +1601,31 @@ static int dst_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
 {
        struct dst_state *state = fe->demodulator_priv;
 
-       dst_get_signal(state);
+       int retval = dst_get_signal(state);
        *strength = state->decode_strength;
 
-       return 0;
+       return retval;
 }
 
 static int dst_read_snr(struct dvb_frontend *fe, u16 *snr)
 {
        struct dst_state *state = fe->demodulator_priv;
 
-       dst_get_signal(state);
+       int retval = dst_get_signal(state);
        *snr = state->decode_snr;
 
-       return 0;
+       return retval;
 }
 
 static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
 {
+       int retval = -EINVAL;
        struct dst_state *state = fe->demodulator_priv;
 
        if (p != NULL) {
-               dst_set_freq(state, p->frequency);
+               retval = dst_set_freq(state, p->frequency);
+               if(retval != 0)
+                       return retval;
                dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency);
 
                if (state->dst_type == DST_TYPE_IS_SAT) {
@@ -1647,10 +1643,10 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
                        dst_set_symbolrate(state, p->u.qam.symbol_rate);
                        dst_set_modulation(state, p->u.qam.modulation);
                }
-               dst_write_tuna(fe);
+               retval = dst_write_tuna(fe);
        }
 
-       return 0;
+       return retval;
 }
 
 static int dst_tune_frontend(struct dvb_frontend* fe,
index 11054657fdb507491dd4d944ace466bbc6ba7a35..0b5182835cc82d4205b06ac473073d3e1b6e0ac2 100644 (file)
@@ -2,8 +2,8 @@
 # Makefile for the kernel DVB device drivers.
 #
 
-dvb-core-objs = dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o     \
-               dvb_ca_en50221.o dvb_frontend.o                 \
-               dvb_net.o dvb_ringbuffer.o dvb_math.o
+dvb-core-objs := dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o    \
+                dvb_ca_en50221.o dvb_frontend.o                \
+                dvb_net.o dvb_ringbuffer.o dvb_math.o
 
 obj-$(CONFIG_DVB_CORE) += dvb-core.o
index 59ac35ddd51ef693f388eb3599a133d64cdd585e..57b34cda99f5a6f598b9786d42af22d58a19f70d 100644 (file)
@@ -526,7 +526,9 @@ static int dvb_frontend_thread(void *data)
        fepriv->delay = 3*HZ;
        fepriv->status = 0;
        fepriv->wakeup = 0;
-       fepriv->reinitialise = 1;
+       fepriv->reinitialise = 0;
+
+       dvb_frontend_init(fe);
 
        while (1) {
                up(&fepriv->sem);           /* is locked when we enter the thread... */
@@ -1013,17 +1015,18 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
                return ret;
 
        if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
+
+               /* normal tune mode when opened R/W */
+               fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
+               fepriv->tone = -1;
+               fepriv->voltage = -1;
+
                ret = dvb_frontend_start (fe);
                if (ret)
                        dvb_generic_release (inode, file);
 
                /*  empty event queue */
                fepriv->events.eventr = fepriv->events.eventw = 0;
-
-               /* normal tune mode when opened R/W */
-               fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
-               fepriv->tone = -1;
-               fepriv->voltage = -1;
        }
 
        return ret;
index a189683454b7da0ad84cb69cccaba873bf816da1..2be33f27c69fbfb7944140220eb34df815f15034 100644 (file)
@@ -194,11 +194,11 @@ struct dvb_pll_desc dvb_pll_tda665x = {
                {  253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0  10 */ },
                {  383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0  10 */ },
                {  443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0  10 */ },
-               {  444000000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0  11 */ },
-               {  583834000, 36249333, 166667, 0xca, 0x63 /* 011 0 0 0  11 */ },
-               {  793834000, 36249333, 166667, 0xca, 0xa3 /* 101 0 0 0  11 */ },
-               {  444834000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0  11 */ },
-               {  861000000, 36249333, 166667, 0xca, 0xe3 /* 111 0 0 0  11 */ },
+               {  444000000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1  00 */ },
+               {  583834000, 36249333, 166667, 0xca, 0x64 /* 011 0 0 1  00 */ },
+               {  793834000, 36249333, 166667, 0xca, 0xa4 /* 101 0 0 1  00 */ },
+               {  444834000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1  00 */ },
+               {  861000000, 36249333, 166667, 0xca, 0xe4 /* 111 0 0 1  00 */ },
        }
 };
 EXPORT_SYMBOL(dvb_pll_tda665x);
@@ -613,7 +613,21 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
 
 int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc)
 {
+       u8 b1 [] = { 0 };
+       struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 };
        struct dvb_pll_priv *priv = NULL;
+       int ret;
+
+       if (i2c != NULL) {
+               if (fe->ops.i2c_gate_ctrl)
+                       fe->ops.i2c_gate_ctrl(fe, 1);
+
+               ret = i2c_transfer (i2c, &msg, 1);
+               if (ret != 1)
+                       return -1;
+               if (fe->ops.i2c_gate_ctrl)
+                            fe->ops.i2c_gate_ctrl(fe, 0);
+       }
 
        priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL);
        if (priv == NULL)
index 500f15c10aaf93047902c39a9a24b0a8e1c29b5e..4506165c5de259ac9a9a2785866b3cf7048624c4 100644 (file)
@@ -2203,8 +2203,8 @@ static int frontend_init(struct av7110 *av7110)
                                av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params;
 
                                /* set TDA9819 into DVB mode */
-                               saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
-                               saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
+                               saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
+                               saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
 
                                /* tuner on this needs a slower i2c bus speed */
                                av7110->dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_240;
index 64055461559dc918bcc325d732a52719c4000e0c..6ffe53fdcf570bced668dd68cce10233eef437ab 100644 (file)
@@ -272,8 +272,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
                                if (ves1820_writereg(dev, 0x09, 0x0f, 0x60))
                                        dprintk(1, "setting band in demodulator failed.\n");
                        } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
-                               saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD)
-                               saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9198 pin30(VIF)
+                               saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9819 pin9(STD)
+                               saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9819 pin30(VIF)
                        }
                        if (i2c_writereg(av7110, 0x48, 0x02, 0xd0) != 1)
                                dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num);
@@ -308,8 +308,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
                        if (ves1820_writereg(dev, 0x09, 0x0f, 0x20))
                                dprintk(1, "setting band in demodulator failed.\n");
                } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
-                       saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
-                       saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
+                       saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
+                       saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
                }
        }
 
@@ -750,8 +750,8 @@ int av7110_init_analog_module(struct av7110 *av7110)
                        if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20))
                                dprintk(1, "setting band in demodulator failed.\n");
                } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
-                       saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
-                       saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
+                       saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
+                       saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
                }
 
                /* init the saa7113 */
index 5f111d407730611a661c50b00028f356638efe26..2d21fec23b4d9ea4f04694ab1678bbff747a797d 100644 (file)
@@ -1303,6 +1303,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
        budget_av->budget.dvb_adapter.priv = budget_av;
        frontend_init(budget_av);
        ciintf_init(budget_av);
+
+       ttpci_budget_init_hooks(&budget_av->budget);
+
        return 0;
 }
 
index 4b966eea3834b52dc07668c7f99721ce907e2a2c..ffbbb3e34be482cf3071e1dabbb7d76882404e0f 100644 (file)
@@ -1101,6 +1101,8 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
        budget_ci->budget.dvb_adapter.priv = budget_ci;
        frontend_init(budget_ci);
 
+       ttpci_budget_init_hooks(&budget_ci->budget);
+
        return 0;
 }
 
index e4cf7775e07f75f21447fa2f051af771180aad63..e15562f81664ea40c0fd36a34136ca08226b6ef1 100644 (file)
@@ -63,9 +63,6 @@ static int stop_ts_capture(struct budget *budget)
 {
        dprintk(2, "budget: %p\n", budget);
 
-       if (--budget->feeding)
-               return budget->feeding;
-
        saa7146_write(budget->dev, MC1, MASK_20);       // DMA3 off
        SAA7146_IER_DISABLE(budget->dev, MASK_10);
        return 0;
@@ -77,8 +74,8 @@ static int start_ts_capture(struct budget *budget)
 
        dprintk(2, "budget: %p\n", budget);
 
-       if (budget->feeding)
-               return ++budget->feeding;
+       if (!budget->feeding || !budget->fe_synced)
+               return 0;
 
        saa7146_write(dev, MC1, MASK_20);       // DMA3 off
 
@@ -139,7 +136,33 @@ static int start_ts_capture(struct budget *budget)
        SAA7146_IER_ENABLE(budget->dev, MASK_10);       /* VPE */
        saa7146_write(dev, MC1, (MASK_04 | MASK_20));   /* DMA3 on */
 
-       return ++budget->feeding;
+       return 0;
+}
+
+static int budget_read_fe_status(struct dvb_frontend *fe, fe_status_t *status)
+{
+       struct budget *budget = (struct budget *) fe->dvb->priv;
+       int synced;
+       int ret;
+
+       if (budget->read_fe_status)
+               ret = budget->read_fe_status(fe, status);
+       else
+               ret = -EINVAL;
+
+       if (!ret) {
+               synced = (*status & FE_HAS_LOCK);
+               if (synced != budget->fe_synced) {
+                       budget->fe_synced = synced;
+                       spin_lock(&budget->feedlock);
+                       if (synced)
+                               start_ts_capture(budget);
+                       else
+                               stop_ts_capture(budget);
+                       spin_unlock(&budget->feedlock);
+               }
+       }
+       return ret;
 }
 
 static void vpeirq(unsigned long data)
@@ -267,7 +290,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
 {
        struct dvb_demux *demux = feed->demux;
        struct budget *budget = (struct budget *) demux->priv;
-       int status;
+       int status = 0;
 
        dprintk(2, "budget: %p\n", budget);
 
@@ -276,7 +299,8 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
 
        spin_lock(&budget->feedlock);
        feed->pusi_seen = 0; /* have a clean section start */
-       status = start_ts_capture(budget);
+       if (budget->feeding++ == 0)
+               status = start_ts_capture(budget);
        spin_unlock(&budget->feedlock);
        return status;
 }
@@ -285,12 +309,13 @@ static int budget_stop_feed(struct dvb_demux_feed *feed)
 {
        struct dvb_demux *demux = feed->demux;
        struct budget *budget = (struct budget *) demux->priv;
-       int status;
+       int status = 0;
 
        dprintk(2, "budget: %p\n", budget);
 
        spin_lock(&budget->feedlock);
-       status = stop_ts_capture(budget);
+       if (--budget->feeding == 0)
+               status = stop_ts_capture(budget);
        spin_unlock(&budget->feedlock);
        return status;
 }
@@ -470,6 +495,14 @@ err:
        return ret;
 }
 
+void ttpci_budget_init_hooks(struct budget *budget)
+{
+       if (budget->dvb_frontend && !budget->read_fe_status) {
+               budget->read_fe_status = budget->dvb_frontend->ops.read_status;
+               budget->dvb_frontend->ops.read_status = budget_read_fe_status;
+       }
+}
+
 int ttpci_budget_deinit(struct budget *budget)
 {
        struct saa7146_dev *dev = budget->dev;
@@ -508,11 +541,8 @@ void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port)
        spin_lock(&budget->feedlock);
        budget->video_port = video_port;
        if (budget->feeding) {
-               int oldfeeding = budget->feeding;
-               budget->feeding = 1;
                stop_ts_capture(budget);
                start_ts_capture(budget);
-               budget->feeding = oldfeeding;
        }
        spin_unlock(&budget->feedlock);
 }
@@ -520,6 +550,7 @@ void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port)
 EXPORT_SYMBOL_GPL(ttpci_budget_debiread);
 EXPORT_SYMBOL_GPL(ttpci_budget_debiwrite);
 EXPORT_SYMBOL_GPL(ttpci_budget_init);
+EXPORT_SYMBOL_GPL(ttpci_budget_init_hooks);
 EXPORT_SYMBOL_GPL(ttpci_budget_deinit);
 EXPORT_SYMBOL_GPL(ttpci_budget_irq10_handler);
 EXPORT_SYMBOL_GPL(ttpci_budget_set_video_port);
index ee60ce90a4005f562d62ed85f6b8a1b155e68a2f..57227441891e54bea5d0236417042e6f12ede756 100644 (file)
@@ -617,6 +617,8 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte
        budget->dvb_adapter.priv = budget;
        frontend_init(budget);
 
+       ttpci_budget_init_hooks(budget);
+
        return 0;
 }
 
index 35761f13c12b051fac37d2d48ffda657e7d90e75..863dffb4ed8e5058b42fb31be828297945adc1f8 100644 (file)
@@ -375,9 +375,6 @@ static void frontend_init(struct budget *budget)
                if (budget->dvb_frontend) {
                        budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
                        budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
-                       budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
-                       budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst;
-                       budget->dvb_frontend->ops.set_tone = budget_set_tone;
                        break;
                }
                break;
@@ -474,6 +471,8 @@ static int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_
        budget->dvb_adapter.priv = budget;
        frontend_init(budget);
 
+       ttpci_budget_init_hooks(budget);
+
        return 0;
 }
 
index ecea3a13030e6c1016fc03cdf615086ad79f6cbc..e8a5c79178e1e229a331a07225ba521aca9c4434 100644 (file)
@@ -52,9 +52,6 @@ struct budget {
        struct dmx_frontend hw_frontend;
        struct dmx_frontend mem_frontend;
 
-       int fe_synced;
-       struct mutex pid_mutex;
-
        int ci_present;
        int video_port;
 
@@ -74,6 +71,9 @@ struct budget {
 
        struct dvb_adapter dvb_adapter;
        struct dvb_frontend *dvb_frontend;
+       int (*read_fe_status)(struct dvb_frontend *fe, fe_status_t *status);
+       int fe_synced;
+
        void *priv;
 };
 
@@ -106,6 +106,7 @@ static struct saa7146_pci_extension_data x_var = { \
 extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
                             struct saa7146_pci_extension_data *info,
                             struct module *owner);
+extern void ttpci_budget_init_hooks(struct budget *budget);
 extern int ttpci_budget_deinit(struct budget *budget);
 extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr);
 extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
index de3128a31de825f6d31b2c9c7a2431d83f7f98b0..220076b1b956df5d20434a5c5d8b2d9b9c1e7583 100644 (file)
@@ -350,5 +350,15 @@ config RADIO_ZOLTRIX_PORT
        help
          Enter the I/O port of your Zoltrix radio card.
 
-endmenu
+config USB_DSBR
+       tristate "D-Link USB FM radio support (EXPERIMENTAL)"
+       depends on USB && VIDEO_V4L1 && EXPERIMENTAL
+       ---help---
+         Say Y here if you want to connect this type of radio to your
+         computer's USB port. Note that the audio is not digital, and
+         you must connect the line out connector to a sound card or a
+         set of speakers.
 
+         To compile this driver as a module, choose M here: the
+         module will be called dsbr100.
+endmenu
index e95b6805e00257ecdc752a405bc81eba2e443f8a..cf55a18e3ddf94bcd0c20a2d834db3a980f62d67 100644 (file)
@@ -20,5 +20,6 @@ obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
+obj-$(CONFIG_USB_DSBR) += dsbr100.o
 
 EXTRA_CFLAGS += -Isound
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
new file mode 100644 (file)
index 0000000..f7e33f9
--- /dev/null
@@ -0,0 +1,430 @@
+/* A driver for the D-Link DSB-R100 USB radio.  The R100 plugs
+ into both the USB and an analog audio input, so this thing
+ only deals with initialisation and frequency setting, the
+ audio data has to be handled by a sound driver.
+
+ Major issue: I can't find out where the device reports the signal
+ strength, and indeed the windows software appearantly just looks
+ at the stereo indicator as well.  So, scanning will only find
+ stereo stations.  Sad, but I can't help it.
+
+ Also, the windows program sends oodles of messages over to the
+ device, and I couldn't figure out their meaning.  My suspicion
+ is that they don't have any:-)
+
+ You might find some interesting stuff about this module at
+ http://unimut.fsk.uni-heidelberg.de/unimut/demi/dsbr
+
+ Copyright (c) 2000 Markus Demleitner <msdemlei@cl.uni-heidelberg.de>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ History:
+
+ Version 0.40:
+  Markus: Updates for 2.6.x kernels, code layout changes, name sanitizing
+
+ Version 0.30:
+       Markus: Updates for 2.5.x kernel and more ISO compliant source
+
+ Version 0.25:
+       PSL and Markus: Cleanup, radio now doesn't stop on device close
+
+ Version 0.24:
+       Markus: Hope I got these silly VIDEO_TUNER_LOW issues finally
+       right.  Some minor cleanup, improved standalone compilation
+
+ Version 0.23:
+       Markus: Sign extension bug fixed by declaring transfer_buffer unsigned
+
+ Version 0.22:
+       Markus: Some (brown bag) cleanup in what VIDIOCSTUNER returns,
+       thanks to Mike Cox for pointing the problem out.
+
+ Version 0.21:
+       Markus: Minor cleanup, warnings if something goes wrong, lame attempt
+       to adhere to Documentation/CodingStyle
+
+ Version 0.2:
+       Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module
+       Markus: Copyright clarification
+
+ Version 0.01: Markus: initial release
+
+*/
+
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/input.h>
+#include <linux/videodev.h>
+#include <media/v4l2-common.h>
+#include <linux/usb.h>
+#include <linux/smp_lock.h>
+
+/*
+ * Version Information
+ */
+#define DRIVER_VERSION "v0.40"
+#define DRIVER_AUTHOR "Markus Demleitner <msdemlei@tucana.harvard.edu>"
+#define DRIVER_DESC "D-Link DSB-R100 USB FM radio driver"
+
+#define DSB100_VENDOR 0x04b4
+#define DSB100_PRODUCT 0x1002
+
+/* Commands the device appears to understand */
+#define DSB100_TUNE 1
+#define DSB100_ONOFF 2
+
+#define TB_LEN 16
+
+/* Frequency limits in MHz -- these are European values.  For Japanese
+devices, that would be 76 and 91.  */
+#define FREQ_MIN  87.5
+#define FREQ_MAX 108.0
+#define FREQ_MUL 16000
+
+
+static int usb_dsbr100_probe(struct usb_interface *intf,
+                            const struct usb_device_id *id);
+static void usb_dsbr100_disconnect(struct usb_interface *intf);
+static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
+                            unsigned int cmd, unsigned long arg);
+static int usb_dsbr100_open(struct inode *inode, struct file *file);
+static int usb_dsbr100_close(struct inode *inode, struct file *file);
+
+static int radio_nr = -1;
+module_param(radio_nr, int, 0);
+
+/* Data for one (physical) device */
+typedef struct {
+       struct usb_device *usbdev;
+       struct video_device *videodev;
+       unsigned char transfer_buffer[TB_LEN];
+       int curfreq;
+       int stereo;
+       int users;
+       int removed;
+} dsbr100_device;
+
+
+/* File system interface */
+static struct file_operations usb_dsbr100_fops = {
+       .owner =        THIS_MODULE,
+       .open =         usb_dsbr100_open,
+       .release =      usb_dsbr100_close,
+       .ioctl =        usb_dsbr100_ioctl,
+       .compat_ioctl = v4l_compat_ioctl32,
+       .llseek =       no_llseek,
+};
+
+/* V4L interface */
+static struct video_device dsbr100_videodev_template=
+{
+       .owner =        THIS_MODULE,
+       .name =         "D-Link DSB-R 100",
+       .type =         VID_TYPE_TUNER,
+       .hardware =     VID_HARDWARE_AZTECH,
+       .fops =         &usb_dsbr100_fops,
+       .release = video_device_release,
+};
+
+static struct usb_device_id usb_dsbr100_device_table [] = {
+       { USB_DEVICE(DSB100_VENDOR, DSB100_PRODUCT) },
+       { }                                             /* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE (usb, usb_dsbr100_device_table);
+
+/* USB subsystem interface */
+static struct usb_driver usb_dsbr100_driver = {
+       .name =         "dsbr100",
+       .probe =        usb_dsbr100_probe,
+       .disconnect =   usb_dsbr100_disconnect,
+       .id_table =     usb_dsbr100_device_table,
+};
+
+/* Low-level device interface begins here */
+
+/* switch on radio */
+static int dsbr100_start(dsbr100_device *radio)
+{
+       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+                       USB_REQ_GET_STATUS,
+                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+                       0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 ||
+       usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+                       DSB100_ONOFF,
+                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+                       0x01, 0x00, radio->transfer_buffer, 8, 300)<0)
+               return -1;
+       return (radio->transfer_buffer)[0];
+}
+
+
+/* switch off radio */
+static int dsbr100_stop(dsbr100_device *radio)
+{
+       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+                       USB_REQ_GET_STATUS,
+                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+                       0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 ||
+       usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+                       DSB100_ONOFF,
+                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+                       0x00, 0x00, radio->transfer_buffer, 8, 300)<0)
+               return -1;
+       return (radio->transfer_buffer)[0];
+}
+
+/* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
+static int dsbr100_setfreq(dsbr100_device *radio, int freq)
+{
+       freq = (freq/16*80)/1000+856;
+       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+                       DSB100_TUNE,
+                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+                       (freq>>8)&0x00ff, freq&0xff,
+                       radio->transfer_buffer, 8, 300)<0 ||
+          usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+                       USB_REQ_GET_STATUS,
+                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+                       0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 ||
+       usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+                       USB_REQ_GET_STATUS,
+                       USB_TYPE_VENDOR | USB_RECIP_DEVICE |  USB_DIR_IN,
+                       0x00, 0x24, radio->transfer_buffer, 8, 300)<0) {
+               radio->stereo = -1;
+               return -1;
+       }
+       radio->stereo = ! ((radio->transfer_buffer)[0]&0x01);
+       return (radio->transfer_buffer)[0];
+}
+
+/* return the device status.  This is, in effect, just whether it
+sees a stereo signal or not.  Pity. */
+static void dsbr100_getstat(dsbr100_device *radio)
+{
+       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+               USB_REQ_GET_STATUS,
+               USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+               0x00 , 0x24, radio->transfer_buffer, 8, 300)<0)
+               radio->stereo = -1;
+       else
+               radio->stereo = ! (radio->transfer_buffer[0]&0x01);
+}
+
+
+/* USB subsystem interface begins here */
+
+/* check if the device is present and register with v4l and
+usb if it is */
+static int usb_dsbr100_probe(struct usb_interface *intf,
+                        const struct usb_device_id *id)
+{
+       dsbr100_device *radio;
+
+       if (!(radio = kmalloc(sizeof(dsbr100_device), GFP_KERNEL)))
+               return -ENOMEM;
+       if (!(radio->videodev = video_device_alloc())) {
+               kfree(radio);
+               return -ENOMEM;
+       }
+       memcpy(radio->videodev, &dsbr100_videodev_template,
+               sizeof(dsbr100_videodev_template));
+       radio->removed = 0;
+       radio->users = 0;
+       radio->usbdev = interface_to_usbdev(intf);
+       radio->curfreq = FREQ_MIN*FREQ_MUL;
+       video_set_drvdata(radio->videodev, radio);
+       if (video_register_device(radio->videodev, VFL_TYPE_RADIO,
+               radio_nr)) {
+               warn("Could not register video device");
+               video_device_release(radio->videodev);
+               kfree(radio);
+               return -EIO;
+       }
+       usb_set_intfdata(intf, radio);
+       return 0;
+}
+
+/* handle unplugging of the device, release data structures
+if nothing keeps us from doing it.  If something is still
+keeping us busy, the release callback of v4l will take care
+of releasing it.  stv680.c does not relase its private
+data, so I don't do this here either.  Checking out the
+code I'd expect I better did that, but if there's a memory
+leak here it's tiny (~50 bytes per disconnect) */
+static void usb_dsbr100_disconnect(struct usb_interface *intf)
+{
+       dsbr100_device *radio = usb_get_intfdata(intf);
+
+       usb_set_intfdata (intf, NULL);
+       if (radio) {
+               video_unregister_device(radio->videodev);
+               radio->videodev = NULL;
+               if (radio->users) {
+                       kfree(radio);
+               } else {
+                       radio->removed = 1;
+               }
+       }
+}
+
+
+/* Video for Linux interface */
+
+static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
+                               unsigned int cmd, void *arg)
+{
+       dsbr100_device *radio=video_get_drvdata(video_devdata(file));
+
+       if (!radio)
+               return -EIO;
+
+       switch(cmd) {
+               case VIDIOCGCAP: {
+                       struct video_capability *v = arg;
+
+                       memset(v, 0, sizeof(*v));
+                       v->type = VID_TYPE_TUNER;
+                       v->channels = 1;
+                       v->audios = 1;
+                       strcpy(v->name, "D-Link R-100 USB FM Radio");
+                       return 0;
+               }
+               case VIDIOCGTUNER: {
+                       struct video_tuner *v = arg;
+
+                       dsbr100_getstat(radio);
+                       if(v->tuner)    /* Only 1 tuner */
+                               return -EINVAL;
+                       v->rangelow = FREQ_MIN*FREQ_MUL;
+                       v->rangehigh = FREQ_MAX*FREQ_MUL;
+                       v->flags = VIDEO_TUNER_LOW;
+                       v->mode = VIDEO_MODE_AUTO;
+                       v->signal = radio->stereo*0x7000;
+                               /* Don't know how to get signal strength */
+                       v->flags |= VIDEO_TUNER_STEREO_ON*radio->stereo;
+                       strcpy(v->name, "DSB R-100");
+                       return 0;
+               }
+               case VIDIOCSTUNER: {
+                       struct video_tuner *v = arg;
+
+                       if(v->tuner!=0)
+                               return -EINVAL;
+                       /* Only 1 tuner so no setting needed ! */
+                       return 0;
+               }
+               case VIDIOCGFREQ: {
+                       int *freq = arg;
+
+                       if (radio->curfreq==-1)
+                               return -EINVAL;
+                       *freq = radio->curfreq;
+                       return 0;
+               }
+               case VIDIOCSFREQ: {
+                       int *freq = arg;
+
+                       radio->curfreq = *freq;
+                       if (dsbr100_setfreq(radio, radio->curfreq)==-1)
+                               warn("Set frequency failed");
+                       return 0;
+               }
+               case VIDIOCGAUDIO: {
+                       struct video_audio *v = arg;
+
+                       memset(v, 0, sizeof(*v));
+                       v->flags |= VIDEO_AUDIO_MUTABLE;
+                       v->mode = VIDEO_SOUND_STEREO;
+                       v->volume = 1;
+                       v->step = 1;
+                       strcpy(v->name, "Radio");
+                       return 0;
+               }
+               case VIDIOCSAUDIO: {
+                       struct video_audio *v = arg;
+
+                       if (v->audio)
+                               return -EINVAL;
+                       if (v->flags&VIDEO_AUDIO_MUTE) {
+                               if (dsbr100_stop(radio)==-1)
+                                       warn("Radio did not respond properly");
+                       }
+                       else
+                               if (dsbr100_start(radio)==-1)
+                                       warn("Radio did not respond properly");
+                       return 0;
+               }
+               default:
+                       return -ENOIOCTLCMD;
+       }
+}
+
+static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
+                            unsigned int cmd, unsigned long arg)
+{
+       return video_usercopy(inode, file, cmd, arg, usb_dsbr100_do_ioctl);
+}
+
+static int usb_dsbr100_open(struct inode *inode, struct file *file)
+{
+       dsbr100_device *radio=video_get_drvdata(video_devdata(file));
+
+       radio->users = 1;
+       if (dsbr100_start(radio)<0) {
+               warn("Radio did not start up properly");
+               radio->users = 0;
+               return -EIO;
+       }
+       dsbr100_setfreq(radio, radio->curfreq);
+       return 0;
+}
+
+static int usb_dsbr100_close(struct inode *inode, struct file *file)
+{
+       dsbr100_device *radio=video_get_drvdata(video_devdata(file));
+
+       if (!radio)
+               return -ENODEV;
+       radio->users = 0;
+       if (radio->removed) {
+               kfree(radio);
+       }
+       return 0;
+}
+
+static int __init dsbr100_init(void)
+{
+       int retval = usb_register(&usb_dsbr100_driver);
+       info(DRIVER_VERSION ":" DRIVER_DESC);
+       return retval;
+}
+
+static void __exit dsbr100_exit(void)
+{
+       usb_deregister(&usb_dsbr100_driver);
+}
+
+module_init (dsbr100_init);
+module_exit (dsbr100_exit);
+
+MODULE_AUTHOR( DRIVER_AUTHOR );
+MODULE_DESCRIPTION( DRIVER_DESC );
+MODULE_LICENSE("GPL");
index 6d532f170ce5c8302b82975c4bb53c8a2dbeef1d..732bf1e7c326bc806c46073d01d8f0891ec53c55 100644 (file)
@@ -145,7 +145,7 @@ config VIDEO_SAA5246A
 
 config VIDEO_SAA5249
        tristate "SAA5249 Teletext processor"
-       depends on VIDEO_DEV && I2C
+       depends on VIDEO_DEV && I2C && VIDEO_V4L1
        help
          Support for I2C bus based teletext using the SAA5249 chip. At the
          moment this is only useful on some European WinTV cards.
@@ -155,7 +155,7 @@ config VIDEO_SAA5249
 
 config TUNER_3036
        tristate "SAB3036 tuner"
-       depends on VIDEO_DEV && I2C
+       depends on VIDEO_DEV && I2C && VIDEO_V4L1
        help
          Say Y here to include support for Philips SAB3036 compatible tuners.
          If in doubt, say N.
@@ -449,18 +449,6 @@ source "drivers/media/video/pvrusb2/Kconfig"
 
 source "drivers/media/video/em28xx/Kconfig"
 
-config USB_DSBR
-       tristate "D-Link USB FM radio support (EXPERIMENTAL)"
-       depends on USB && VIDEO_V4L1 && EXPERIMENTAL
-       ---help---
-         Say Y here if you want to connect this type of radio to your
-         computer's USB port. Note that the audio is not digital, and
-         you must connect the line out connector to a sound card or a
-         set of speakers.
-
-         To compile this driver as a module, choose M here: the
-         module will be called dsbr100.
-
 source "drivers/media/video/usbvideo/Kconfig"
 
 source "drivers/media/video/et61x251/Kconfig"
index 353d61cfac1b2150021762ed5529ae3ad81b089f..e82e511f2a72782e343c6d19258d84f7aeeca6af 100644 (file)
@@ -77,7 +77,6 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
 obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o
 
 obj-$(CONFIG_USB_DABUSB)        += dabusb.o
-obj-$(CONFIG_USB_DSBR)          += dsbr100.o
 obj-$(CONFIG_USB_OV511)         += ov511.o
 obj-$(CONFIG_USB_SE401)         += se401.o
 obj-$(CONFIG_USB_STV680)        += stv680.o
@@ -91,6 +90,7 @@ obj-$(CONFIG_USB_ZC0301)        += zc0301/
 obj-$(CONFIG_USB_IBMCAM)        += usbvideo/
 obj-$(CONFIG_USB_KONICAWC)      += usbvideo/
 obj-$(CONFIG_USB_VICAM)         += usbvideo/
+obj-$(CONFIG_USB_QUICKCAM_MESSENGER)   += usbvideo/
 
 obj-$(CONFIG_VIDEO_VIVI) += vivi.o
 
index 153f6a4a96c990c3a55de92e131774c5d51c8356..cdcf556507141559be9f3284a9a8425c1069a9ce 100644 (file)
@@ -1,6 +1,6 @@
 config VIDEO_BT848
        tristate "BT848 Video For Linux"
-       depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2
+       depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L1
        select I2C_ALGOBIT
        select FW_LOADER
        select VIDEO_BTCX
index 5764a89d35627db94dd489558bdaf0655d3e1b0f..20dff7c316eb595e2c8e9385f90ba0ad22723de9 100644 (file)
@@ -3923,7 +3923,12 @@ static int __devinit bttv_register_video(struct bttv *btv)
                goto err;
        printk(KERN_INFO "bttv%d: registered device video%d\n",
               btv->c.nr,btv->video_dev->minor & 0x1f);
-       video_device_create_file(btv->video_dev, &class_device_attr_card);
+       if (class_device_create_file(&btv->video_dev->class_dev,
+                                    &class_device_attr_card)<0) {
+               printk(KERN_ERR "bttv%d: class_device_create_file 'card' "
+                      "failed\n", btv->c.nr);
+               goto err;
+       }
 
        /* vbi */
        btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");
@@ -4287,6 +4292,8 @@ static struct pci_driver bttv_pci_driver = {
 
 static int bttv_init_module(void)
 {
+       int ret;
+
        bttv_num = 0;
 
        printk(KERN_INFO "bttv: driver version %d.%d.%d loaded\n",
@@ -4308,7 +4315,11 @@ static int bttv_init_module(void)
 
        bttv_check_chipset();
 
-       bus_register(&bttv_sub_bus_type);
+       ret = bus_register(&bttv_sub_bus_type);
+       if (ret < 0) {
+               printk(KERN_WARNING "bttv: bus_register error: %d\n", ret);
+               return ret;
+       }
        return pci_register_driver(&bttv_pci_driver);
 }
 
index 8c9f0f7cf467734b1ef69e252f8ce6a86f3f1199..63676e7bd635f6b403a69be86e0e24d602c56337 100644 (file)
 #include <asm/io.h>
 #include "bttvp.h"
 
-/* Offset from line sync pulse leading edge (0H) in 1 / sampling_rate:
-   bt8x8 /HRESET pulse starts at 0H and has length 64 / fCLKx1 (E|O_VTC
-   HSFMT = 0). VBI_HDELAY (always 0) is an offset from the trailing edge
-   of /HRESET in 1 / fCLKx1, and the sampling_rate tvnorm->Fsc is fCLKx2. */
-#define VBI_OFFSET ((64 + 0) * 2)
+/* Offset from line sync pulse leading edge (0H) to start of VBI capture,
+   in fCLKx2 pixels.  According to the datasheet, VBI capture starts
+   VBI_HDELAY fCLKx1 pixels from the tailing edgeof /HRESET, and /HRESET
+   is 64 fCLKx1 pixels wide.  VBI_HDELAY is set to 0, so this should be
+   (64 + 0) * 2 = 128 fCLKx2 pixels.  But it's not!  The datasheet is
+   Just Plain Wrong.  The real value appears to be different for
+   different revisions of the bt8x8 chips, and to be affected by the
+   horizontal scaling factor.  Experimentally, the value is measured
+   to be about 244.  */
+#define VBI_OFFSET 244
 
 #define VBI_DEFLINES 16
 #define VBI_MAXLINES 32
index 353d02b67c33014d73a3f5279f9b6ed5c0597a98..b69ee1194815cf84155b109d0d8f801de4e3ff58 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifdef CONFIG_COMPAT
 
-
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 struct video_tuner32 {
        compat_int_t tuner;
        char name[32];
@@ -107,6 +107,7 @@ struct video_window32 {
        compat_caddr_t clips;
        compat_int_t clipcount;
 };
+#endif
 
 static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
@@ -124,6 +125,7 @@ static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 }
 
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 /* You get back everything except the clips... */
 static int put_video_window32(struct video_window *kp, struct video_window32 __user *up)
 {
@@ -138,6 +140,7 @@ static int put_video_window32(struct video_window *kp, struct video_window32 __u
                        return -EFAULT;
        return 0;
 }
+#endif
 
 struct v4l2_clip32
 {
@@ -490,6 +493,24 @@ static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user
        return 0;
 }
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+struct video_code32
+{
+       char            loadwhat[16];   /* name or tag of file being passed */
+       compat_int_t    datasize;
+       unsigned char   *data;
+};
+
+static inline int microcode32(struct video_code *kp, struct video_code32 __user *up)
+{
+       if(!access_ok(VERIFY_READ, up, sizeof(struct video_code32)) ||
+               copy_from_user(kp->loadwhat, up->loadwhat, sizeof (up->loadwhat)) ||
+               get_user(kp->datasize, &up->datasize) ||
+               copy_from_user(kp->data, up->data, up->datasize))
+                       return -EFAULT;
+       return 0;
+}
+
 #define VIDIOCGTUNER32         _IOWR('v',4, struct video_tuner32)
 #define VIDIOCSTUNER32         _IOW('v',5, struct video_tuner32)
 #define VIDIOCGWIN32           _IOR('v',9, struct video_window32)
@@ -498,6 +519,9 @@ static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user
 #define VIDIOCSFBUF32          _IOW('v',12, struct video_buffer32)
 #define VIDIOCGFREQ32          _IOR('v',14, u32)
 #define VIDIOCSFREQ32          _IOW('v',15, u32)
+#define VIDIOCSMICROCODE32     _IOW('v',27, struct video_code32)
+
+#endif
 
 /* VIDIOC_ENUMINPUT32 is VIDIOC_ENUMINPUT minus 4 bytes of padding alignement */
 #define VIDIOC_ENUMINPUT32     VIDIOC_ENUMINPUT - _IOC(0, 0, 0, 4)
@@ -519,6 +543,7 @@ static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user
 #define VIDIOC_S_INPUT32       _IOWR ('V', 39, compat_int_t)
 #define VIDIOC_TRY_FMT32       _IOWR ('V', 64, struct v4l2_format32)
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 enum {
        MaxClips = (~0U-sizeof(struct video_window))/sizeof(struct video_clip)
 };
@@ -583,13 +608,17 @@ static int do_set_window(struct file *file, unsigned int cmd, unsigned long arg)
 
        return native_ioctl(file, VIDIOCSWIN, (unsigned long)vw);
 }
+#endif
 
 static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        union {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
                struct video_tuner vt;
                struct video_buffer vb;
                struct video_window vw;
+               struct video_code vc;
+#endif
                struct v4l2_format v2f;
                struct v4l2_buffer v2b;
                struct v4l2_framebuffer v2fb;
@@ -605,6 +634,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
 
        /* First, convert the command. */
        switch(cmd) {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case VIDIOCGTUNER32: cmd = VIDIOCGTUNER; break;
        case VIDIOCSTUNER32: cmd = VIDIOCSTUNER; break;
        case VIDIOCGWIN32: cmd = VIDIOCGWIN; break;
@@ -612,6 +642,8 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
        case VIDIOCSFBUF32: cmd = VIDIOCSFBUF; break;
        case VIDIOCGFREQ32: cmd = VIDIOCGFREQ; break;
        case VIDIOCSFREQ32: cmd = VIDIOCSFREQ; break;
+       case VIDIOCSMICROCODE32: cmd = VIDIOCSMICROCODE; break;
+#endif
        case VIDIOC_G_FMT32: cmd = VIDIOC_G_FMT; break;
        case VIDIOC_S_FMT32: cmd = VIDIOC_S_FMT; break;
        case VIDIOC_QUERYBUF32: cmd = VIDIOC_QUERYBUF; break;
@@ -631,6 +663,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
        };
 
        switch(cmd) {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case VIDIOCSTUNER:
        case VIDIOCGTUNER:
                err = get_video_tuner32(&karg.vt, up);
@@ -644,6 +677,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
                break;
 
        case VIDIOCSFREQ:
+#endif
        case VIDIOC_S_INPUT:
        case VIDIOC_OVERLAY:
        case VIDIOC_STREAMON:
@@ -697,14 +731,21 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
                compatible_arg = 0;
                break;
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case VIDIOCGWIN:
        case VIDIOCGFBUF:
        case VIDIOCGFREQ:
+#endif
        case VIDIOC_G_FBUF:
        case VIDIOC_G_INPUT:
                compatible_arg = 0;
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+       case VIDIOCSMICROCODE:
+               err = microcode32(&karg.vc, up);
+               compatible_arg = 0;
+               break;
+#endif
        };
-
        if(err)
                goto out;
 
@@ -719,6 +760,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
        }
        if(err == 0) {
                switch(cmd) {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
                case VIDIOCGTUNER:
                        err = put_video_tuner32(&karg.vt, up);
                        break;
@@ -730,7 +772,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
                case VIDIOCGFBUF:
                        err = put_video_buffer32(&karg.vb, up);
                        break;
-
+#endif
                case VIDIOC_G_FBUF:
                        err = put_v4l2_framebuffer32(&karg.v2fb, up);
                        break;
@@ -768,7 +810,9 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
                        err = put_v4l2_input32(&karg.v2i, up);
                        break;
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
                case VIDIOCGFREQ:
+#endif
                case VIDIOC_G_INPUT:
                        err = put_user(((u32)karg.vx), (u32 __user *)up);
                        break;
@@ -786,6 +830,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
                return ret;
 
        switch (cmd) {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case VIDIOCSWIN32:
                ret = do_set_window(file, cmd, arg);
                break;
@@ -796,6 +841,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
        case VIDIOCSFBUF32:
        case VIDIOCGFREQ32:
        case VIDIOCSFREQ32:
+#endif
        case VIDIOC_QUERYCAP:
        case VIDIOC_ENUM_FMT:
        case VIDIOC_G_FMT32:
@@ -827,6 +873,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
                ret = do_video_ioctl(file, cmd, arg);
                break;
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        /* Little v, the video4linux ioctls (conflict?) */
        case VIDIOCGCAP:
        case VIDIOCGCHAN:
@@ -855,6 +902,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
        case _IOR('v' , BASE_VIDIOCPRIVATE+7, int):
                ret = native_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
                break;
+#endif
        default:
                v4l_print_ioctl("compat_ioctl32", cmd);
        }
index 513cc0927389484a2336f3c8651f4d48b3983c72..e39a961520043982a5393f69d5b2d695e660785c 100644 (file)
@@ -1,6 +1,6 @@
 config VIDEO_CPIA2
        tristate "CPiA2 Video For Linux"
-       depends on VIDEO_DEV && USB
+       depends on VIDEO_DEV && USB && VIDEO_V4L1
        ---help---
          This is the video4linux driver for cameras based on Vision's CPiA2
          (Colour Processor Interface ASIC), such as the Digital Blue QX5
index 5c2036b40ea11e8373b101a3a9c2844ddbcf0dd5..7bb7589a07c30719f7796e78081d01cc0e878ee7 100644 (file)
@@ -104,8 +104,8 @@ u32 cx25840_read4(struct i2c_client * client, u16 addr)
        if (i2c_master_recv(client, buffer, 4) < 4)
                return 0;
 
-       return (buffer[0] << 24) | (buffer[1] << 16) |
-           (buffer[2] << 8) | buffer[3];
+       return (buffer[3] << 24) | (buffer[2] << 16) |
+           (buffer[1] << 8) | buffer[0];
 }
 
 int cx25840_and_or(struct i2c_client *client, u16 addr, unsigned and_mask,
index 72b630a91f41e1aa06ed1e6ef6bf96d1001a34e6..c255646489933f19170ec466badc8d1c896693cf 100644 (file)
@@ -89,7 +89,7 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
 
                auxgpio = cx_read(MO_GP1_IO);
                /* Take out the parity part */
-               gpio+=(gpio & 0x7fd) + (auxgpio & 0xef);
+               gpio=(gpio & 0x7fd) + (auxgpio & 0xef);
        } else
                auxgpio = gpio;
 
index 2225d4b94140cb8f9079e751966ef4a3386b31d2..94c92bacc342be219f78035e855c78d43ce1a763 100644 (file)
@@ -1180,7 +1180,6 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
                        V4L2_CAP_READWRITE     |
                        V4L2_CAP_STREAMING     |
                        V4L2_CAP_VBI_CAPTURE   |
-                       V4L2_CAP_VIDEO_OVERLAY |
                        0;
                if (UNSET != core->tuner_type)
                        cap->capabilities |= V4L2_CAP_TUNER;
@@ -1226,7 +1225,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
                struct v4l2_format *f = arg;
                return cx8800_try_fmt(dev,fh,f);
        }
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        /* --- streaming capture ------------------------------------- */
        case VIDIOCGMBUF:
        {
@@ -1585,7 +1584,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
                *id = 0;
                return 0;
        }
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case VIDIOCSTUNER:
        {
                struct video_tuner *v = arg;
diff --git a/drivers/media/video/dsbr100.c b/drivers/media/video/dsbr100.c
deleted file mode 100644 (file)
index f7e33f9..0000000
+++ /dev/null
@@ -1,430 +0,0 @@
-/* A driver for the D-Link DSB-R100 USB radio.  The R100 plugs
- into both the USB and an analog audio input, so this thing
- only deals with initialisation and frequency setting, the
- audio data has to be handled by a sound driver.
-
- Major issue: I can't find out where the device reports the signal
- strength, and indeed the windows software appearantly just looks
- at the stereo indicator as well.  So, scanning will only find
- stereo stations.  Sad, but I can't help it.
-
- Also, the windows program sends oodles of messages over to the
- device, and I couldn't figure out their meaning.  My suspicion
- is that they don't have any:-)
-
- You might find some interesting stuff about this module at
- http://unimut.fsk.uni-heidelberg.de/unimut/demi/dsbr
-
- Copyright (c) 2000 Markus Demleitner <msdemlei@cl.uni-heidelberg.de>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- History:
-
- Version 0.40:
-  Markus: Updates for 2.6.x kernels, code layout changes, name sanitizing
-
- Version 0.30:
-       Markus: Updates for 2.5.x kernel and more ISO compliant source
-
- Version 0.25:
-       PSL and Markus: Cleanup, radio now doesn't stop on device close
-
- Version 0.24:
-       Markus: Hope I got these silly VIDEO_TUNER_LOW issues finally
-       right.  Some minor cleanup, improved standalone compilation
-
- Version 0.23:
-       Markus: Sign extension bug fixed by declaring transfer_buffer unsigned
-
- Version 0.22:
-       Markus: Some (brown bag) cleanup in what VIDIOCSTUNER returns,
-       thanks to Mike Cox for pointing the problem out.
-
- Version 0.21:
-       Markus: Minor cleanup, warnings if something goes wrong, lame attempt
-       to adhere to Documentation/CodingStyle
-
- Version 0.2:
-       Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module
-       Markus: Copyright clarification
-
- Version 0.01: Markus: initial release
-
-*/
-
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/slab.h>
-#include <linux/input.h>
-#include <linux/videodev.h>
-#include <media/v4l2-common.h>
-#include <linux/usb.h>
-#include <linux/smp_lock.h>
-
-/*
- * Version Information
- */
-#define DRIVER_VERSION "v0.40"
-#define DRIVER_AUTHOR "Markus Demleitner <msdemlei@tucana.harvard.edu>"
-#define DRIVER_DESC "D-Link DSB-R100 USB FM radio driver"
-
-#define DSB100_VENDOR 0x04b4
-#define DSB100_PRODUCT 0x1002
-
-/* Commands the device appears to understand */
-#define DSB100_TUNE 1
-#define DSB100_ONOFF 2
-
-#define TB_LEN 16
-
-/* Frequency limits in MHz -- these are European values.  For Japanese
-devices, that would be 76 and 91.  */
-#define FREQ_MIN  87.5
-#define FREQ_MAX 108.0
-#define FREQ_MUL 16000
-
-
-static int usb_dsbr100_probe(struct usb_interface *intf,
-                            const struct usb_device_id *id);
-static void usb_dsbr100_disconnect(struct usb_interface *intf);
-static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
-                            unsigned int cmd, unsigned long arg);
-static int usb_dsbr100_open(struct inode *inode, struct file *file);
-static int usb_dsbr100_close(struct inode *inode, struct file *file);
-
-static int radio_nr = -1;
-module_param(radio_nr, int, 0);
-
-/* Data for one (physical) device */
-typedef struct {
-       struct usb_device *usbdev;
-       struct video_device *videodev;
-       unsigned char transfer_buffer[TB_LEN];
-       int curfreq;
-       int stereo;
-       int users;
-       int removed;
-} dsbr100_device;
-
-
-/* File system interface */
-static struct file_operations usb_dsbr100_fops = {
-       .owner =        THIS_MODULE,
-       .open =         usb_dsbr100_open,
-       .release =      usb_dsbr100_close,
-       .ioctl =        usb_dsbr100_ioctl,
-       .compat_ioctl = v4l_compat_ioctl32,
-       .llseek =       no_llseek,
-};
-
-/* V4L interface */
-static struct video_device dsbr100_videodev_template=
-{
-       .owner =        THIS_MODULE,
-       .name =         "D-Link DSB-R 100",
-       .type =         VID_TYPE_TUNER,
-       .hardware =     VID_HARDWARE_AZTECH,
-       .fops =         &usb_dsbr100_fops,
-       .release = video_device_release,
-};
-
-static struct usb_device_id usb_dsbr100_device_table [] = {
-       { USB_DEVICE(DSB100_VENDOR, DSB100_PRODUCT) },
-       { }                                             /* Terminating entry */
-};
-
-MODULE_DEVICE_TABLE (usb, usb_dsbr100_device_table);
-
-/* USB subsystem interface */
-static struct usb_driver usb_dsbr100_driver = {
-       .name =         "dsbr100",
-       .probe =        usb_dsbr100_probe,
-       .disconnect =   usb_dsbr100_disconnect,
-       .id_table =     usb_dsbr100_device_table,
-};
-
-/* Low-level device interface begins here */
-
-/* switch on radio */
-static int dsbr100_start(dsbr100_device *radio)
-{
-       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS,
-                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-                       0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 ||
-       usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       DSB100_ONOFF,
-                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-                       0x01, 0x00, radio->transfer_buffer, 8, 300)<0)
-               return -1;
-       return (radio->transfer_buffer)[0];
-}
-
-
-/* switch off radio */
-static int dsbr100_stop(dsbr100_device *radio)
-{
-       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS,
-                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-                       0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 ||
-       usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       DSB100_ONOFF,
-                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-                       0x00, 0x00, radio->transfer_buffer, 8, 300)<0)
-               return -1;
-       return (radio->transfer_buffer)[0];
-}
-
-/* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
-static int dsbr100_setfreq(dsbr100_device *radio, int freq)
-{
-       freq = (freq/16*80)/1000+856;
-       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       DSB100_TUNE,
-                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-                       (freq>>8)&0x00ff, freq&0xff,
-                       radio->transfer_buffer, 8, 300)<0 ||
-          usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS,
-                       USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-                       0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 ||
-       usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS,
-                       USB_TYPE_VENDOR | USB_RECIP_DEVICE |  USB_DIR_IN,
-                       0x00, 0x24, radio->transfer_buffer, 8, 300)<0) {
-               radio->stereo = -1;
-               return -1;
-       }
-       radio->stereo = ! ((radio->transfer_buffer)[0]&0x01);
-       return (radio->transfer_buffer)[0];
-}
-
-/* return the device status.  This is, in effect, just whether it
-sees a stereo signal or not.  Pity. */
-static void dsbr100_getstat(dsbr100_device *radio)
-{
-       if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-               USB_REQ_GET_STATUS,
-               USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-               0x00 , 0x24, radio->transfer_buffer, 8, 300)<0)
-               radio->stereo = -1;
-       else
-               radio->stereo = ! (radio->transfer_buffer[0]&0x01);
-}
-
-
-/* USB subsystem interface begins here */
-
-/* check if the device is present and register with v4l and
-usb if it is */
-static int usb_dsbr100_probe(struct usb_interface *intf,
-                        const struct usb_device_id *id)
-{
-       dsbr100_device *radio;
-
-       if (!(radio = kmalloc(sizeof(dsbr100_device), GFP_KERNEL)))
-               return -ENOMEM;
-       if (!(radio->videodev = video_device_alloc())) {
-               kfree(radio);
-               return -ENOMEM;
-       }
-       memcpy(radio->videodev, &dsbr100_videodev_template,
-               sizeof(dsbr100_videodev_template));
-       radio->removed = 0;
-       radio->users = 0;
-       radio->usbdev = interface_to_usbdev(intf);
-       radio->curfreq = FREQ_MIN*FREQ_MUL;
-       video_set_drvdata(radio->videodev, radio);
-       if (video_register_device(radio->videodev, VFL_TYPE_RADIO,
-               radio_nr)) {
-               warn("Could not register video device");
-               video_device_release(radio->videodev);
-               kfree(radio);
-               return -EIO;
-       }
-       usb_set_intfdata(intf, radio);
-       return 0;
-}
-
-/* handle unplugging of the device, release data structures
-if nothing keeps us from doing it.  If something is still
-keeping us busy, the release callback of v4l will take care
-of releasing it.  stv680.c does not relase its private
-data, so I don't do this here either.  Checking out the
-code I'd expect I better did that, but if there's a memory
-leak here it's tiny (~50 bytes per disconnect) */
-static void usb_dsbr100_disconnect(struct usb_interface *intf)
-{
-       dsbr100_device *radio = usb_get_intfdata(intf);
-
-       usb_set_intfdata (intf, NULL);
-       if (radio) {
-               video_unregister_device(radio->videodev);
-               radio->videodev = NULL;
-               if (radio->users) {
-                       kfree(radio);
-               } else {
-                       radio->removed = 1;
-               }
-       }
-}
-
-
-/* Video for Linux interface */
-
-static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
-                               unsigned int cmd, void *arg)
-{
-       dsbr100_device *radio=video_get_drvdata(video_devdata(file));
-
-       if (!radio)
-               return -EIO;
-
-       switch(cmd) {
-               case VIDIOCGCAP: {
-                       struct video_capability *v = arg;
-
-                       memset(v, 0, sizeof(*v));
-                       v->type = VID_TYPE_TUNER;
-                       v->channels = 1;
-                       v->audios = 1;
-                       strcpy(v->name, "D-Link R-100 USB FM Radio");
-                       return 0;
-               }
-               case VIDIOCGTUNER: {
-                       struct video_tuner *v = arg;
-
-                       dsbr100_getstat(radio);
-                       if(v->tuner)    /* Only 1 tuner */
-                               return -EINVAL;
-                       v->rangelow = FREQ_MIN*FREQ_MUL;
-                       v->rangehigh = FREQ_MAX*FREQ_MUL;
-                       v->flags = VIDEO_TUNER_LOW;
-                       v->mode = VIDEO_MODE_AUTO;
-                       v->signal = radio->stereo*0x7000;
-                               /* Don't know how to get signal strength */
-                       v->flags |= VIDEO_TUNER_STEREO_ON*radio->stereo;
-                       strcpy(v->name, "DSB R-100");
-                       return 0;
-               }
-               case VIDIOCSTUNER: {
-                       struct video_tuner *v = arg;
-
-                       if(v->tuner!=0)
-                               return -EINVAL;
-                       /* Only 1 tuner so no setting needed ! */
-                       return 0;
-               }
-               case VIDIOCGFREQ: {
-                       int *freq = arg;
-
-                       if (radio->curfreq==-1)
-                               return -EINVAL;
-                       *freq = radio->curfreq;
-                       return 0;
-               }
-               case VIDIOCSFREQ: {
-                       int *freq = arg;
-
-                       radio->curfreq = *freq;
-                       if (dsbr100_setfreq(radio, radio->curfreq)==-1)
-                               warn("Set frequency failed");
-                       return 0;
-               }
-               case VIDIOCGAUDIO: {
-                       struct video_audio *v = arg;
-
-                       memset(v, 0, sizeof(*v));
-                       v->flags |= VIDEO_AUDIO_MUTABLE;
-                       v->mode = VIDEO_SOUND_STEREO;
-                       v->volume = 1;
-                       v->step = 1;
-                       strcpy(v->name, "Radio");
-                       return 0;
-               }
-               case VIDIOCSAUDIO: {
-                       struct video_audio *v = arg;
-
-                       if (v->audio)
-                               return -EINVAL;
-                       if (v->flags&VIDEO_AUDIO_MUTE) {
-                               if (dsbr100_stop(radio)==-1)
-                                       warn("Radio did not respond properly");
-                       }
-                       else
-                               if (dsbr100_start(radio)==-1)
-                                       warn("Radio did not respond properly");
-                       return 0;
-               }
-               default:
-                       return -ENOIOCTLCMD;
-       }
-}
-
-static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
-                            unsigned int cmd, unsigned long arg)
-{
-       return video_usercopy(inode, file, cmd, arg, usb_dsbr100_do_ioctl);
-}
-
-static int usb_dsbr100_open(struct inode *inode, struct file *file)
-{
-       dsbr100_device *radio=video_get_drvdata(video_devdata(file));
-
-       radio->users = 1;
-       if (dsbr100_start(radio)<0) {
-               warn("Radio did not start up properly");
-               radio->users = 0;
-               return -EIO;
-       }
-       dsbr100_setfreq(radio, radio->curfreq);
-       return 0;
-}
-
-static int usb_dsbr100_close(struct inode *inode, struct file *file)
-{
-       dsbr100_device *radio=video_get_drvdata(video_devdata(file));
-
-       if (!radio)
-               return -ENODEV;
-       radio->users = 0;
-       if (radio->removed) {
-               kfree(radio);
-       }
-       return 0;
-}
-
-static int __init dsbr100_init(void)
-{
-       int retval = usb_register(&usb_dsbr100_driver);
-       info(DRIVER_VERSION ":" DRIVER_DESC);
-       return retval;
-}
-
-static void __exit dsbr100_exit(void)
-{
-       usb_deregister(&usb_dsbr100_driver);
-}
-
-module_init (dsbr100_init);
-module_exit (dsbr100_exit);
-
-MODULE_AUTHOR( DRIVER_AUTHOR );
-MODULE_DESCRIPTION( DRIVER_DESC );
-MODULE_LICENSE("GPL");
index dbb75a7db199ca6635ca2b194e204542f2c2fd66..56246b8578f32039d68c7098d70598b33fe7db1f 100644 (file)
@@ -362,7 +362,7 @@ int msp_sleep(struct msp_state *state, int timeout)
 }
 
 /* ------------------------------------------------------------------------ */
-
+#ifdef CONFIG_VIDEO_V4L1
 static int msp_mode_v4l2_to_v4l1(int rxsubchans, int audmode)
 {
        if (rxsubchans == V4L2_TUNER_SUB_MONO)
@@ -384,6 +384,7 @@ static int msp_mode_v4l1_to_v4l2(int mode)
                return V4L2_TUNER_MODE_LANG1;
        return V4L2_TUNER_MODE_MONO;
 }
+#endif
 
 static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl)
 {
@@ -509,6 +510,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
        /* --- v4l ioctls --- */
        /* take care: bttv does userspace copying, we'll get a
           kernel pointer here... */
+#ifdef CONFIG_VIDEO_V4L1
        case VIDIOCGAUDIO:
        {
                struct video_audio *va = arg;
@@ -577,6 +579,12 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
        }
 
        case VIDIOCSFREQ:
+       {
+               /* new channel -- kick audio carrier scan */
+               msp_wake_thread(client);
+               break;
+       }
+#endif
        case VIDIOC_S_FREQUENCY:
        {
                /* new channel -- kick audio carrier scan */
index f2fd9195b3ac6491468deec543c9c68fdf0af379..ed02ff81138865c27b7b28a80a455af34aae313d 100644 (file)
@@ -961,10 +961,10 @@ int msp34xxg_thread(void *data)
                /* setup the chip*/
                msp34xxg_reset(client);
                state->std = state->radio ? 0x40 : msp_standard;
-               if (state->std != 1)
-                       goto unmute;
                /* start autodetect */
                msp_write_dem(client, 0x20, state->std);
+               if (state->std != 1)
+                       goto unmute;
 
                /* watch autodetect */
                v4l_dbg(1, msp_debug, client, "started autodetect, waiting for result\n");
index 9b48abcf60897a84e6af0202bcfb3de9beb5359a..be1e5cc780812b1820ef21e94fea7e9058787888 100644 (file)
@@ -852,7 +852,6 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw)
        return hdw->serial_number;
 }
 
-
 int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw)
 {
        return hdw->unit_number;
@@ -2318,7 +2317,6 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw)
        }
 }
 
-
 /* Return name for this driver instance */
 const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)
 {
@@ -2542,6 +2540,10 @@ static void pvr2_ctl_timeout(unsigned long data)
 }
 
 
+/* Issue a command and get a response from the device.  This extended
+   version includes a probe flag (which if set means that device errors
+   should not be logged or treated as fatal) and a timeout in jiffies.
+   This can be used to non-lethally probe the health of endpoint 1. */
 static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
                                unsigned int timeout,int probe_fl,
                                void *write_data,unsigned int write_len,
@@ -2970,6 +2972,7 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
 }
 
 
+/* Stop / start video stream transport */
 static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
 {
        int status;
@@ -3068,6 +3071,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
 }
 
 
+/* Find I2C address of eeprom */
 static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
 {
        int result;
index 681f79c8064e68ce0a51d9553eb3b1804f7a5368..1e393762546c174b55c71f967d5c9bdc9f7e65db 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/slab.h>
 #include <linux/mutex.h>
 
+static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state);
+
 #define BUFFER_SIG 0x47653271
 
 // #define SANITY_CHECK_BUFFERS
@@ -515,6 +517,10 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp,
 }
 
 /* Query / set the nominal buffer count */
+int pvr2_stream_get_buffer_count(struct pvr2_stream *sp)
+{
+       return sp->buffer_target_count;
+}
 
 int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
 {
@@ -553,7 +559,6 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp)
        return sp->r_count;
 }
 
-
 void pvr2_stream_kill(struct pvr2_stream *sp)
 {
        struct pvr2_buffer *bp;
@@ -607,7 +612,6 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp)
        return ret;
 }
 
-
 int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt)
 {
        int ret = 0;
@@ -646,7 +650,6 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp)
        return bp->status;
 }
 
-
 int pvr2_buffer_get_id(struct pvr2_buffer *bp)
 {
        return bp->id;
index 96285ad234a6ba1e20a4ebe7285bbcce14dd8570..93279cc2a35e7e29785b8fd4346b32e5f1d0c2f7 100644 (file)
@@ -47,6 +47,7 @@ void pvr2_stream_set_callback(struct pvr2_stream *,
                              void *data);
 
 /* Query / set the nominal buffer count */
+int pvr2_stream_get_buffer_count(struct pvr2_stream *);
 int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int);
 
 /* Get a pointer to a buffer that is either idle, ready, or is specified
@@ -58,6 +59,7 @@ struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id);
 /* Find out how many buffers are idle or ready */
 int pvr2_stream_get_ready_count(struct pvr2_stream *);
 
+
 /* Kill all pending buffers and throw away any ready buffers as well */
 void pvr2_stream_kill(struct pvr2_stream *);
 
index f7a2e225a002543287f171d00a91589b0877bcb6..b71f9a961f8ac20461df5043b5487741607128c0 100644 (file)
@@ -213,7 +213,9 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
                                   " pvr2_ioread_setup (tear-down) id=%p",cp);
                        pvr2_ioread_stop(cp);
                        pvr2_stream_kill(cp->stream);
-                       pvr2_stream_set_buffer_count(cp->stream,0);
+                       if (pvr2_stream_get_buffer_count(cp->stream)) {
+                               pvr2_stream_set_buffer_count(cp->stream,0);
+                       }
                        cp->stream = NULL;
                }
                if (sp) {
@@ -251,7 +253,6 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl)
        return ret;
 }
 
-
 static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
 {
        int stat;
index 6af55a8b6f055cb3b2e1e961bf00b3a78e8c817a..d1dda5caf4063dd4b14063e25496c4c86ab8a4a2 100644 (file)
@@ -44,12 +44,16 @@ struct pvr2_sysfs {
        struct kobj_type ktype;
        struct class_device_attribute attr_v4l_minor_number;
        struct class_device_attribute attr_unit_number;
+       int v4l_minor_number_created_ok;
+       int unit_number_created_ok;
 };
 
 #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
 struct pvr2_sysfs_debugifc {
        struct class_device_attribute attr_debugcmd;
        struct class_device_attribute attr_debuginfo;
+       int debugcmd_created_ok;
+       int debuginfo_created_ok;
 };
 #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */
 
@@ -67,6 +71,7 @@ struct pvr2_sysfs_ctl_item {
        struct pvr2_sysfs_ctl_item *item_next;
        struct attribute *attr_gen[7];
        struct attribute_group grp;
+       int created_ok;
        char name[80];
 };
 
@@ -487,6 +492,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
        struct pvr2_sysfs_func_set *fp;
        struct pvr2_ctrl *cptr;
        unsigned int cnt,acnt;
+       int ret;
 
        if ((ctl_id < 0) || (ctl_id >= (sizeof(funcs)/sizeof(funcs[0])))) {
                return;
@@ -589,7 +595,13 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
        cip->grp.name = cip->name;
        cip->grp.attrs = cip->attr_gen;
 
-       sysfs_create_group(&sfp->class_dev->kobj,&cip->grp);
+       ret = sysfs_create_group(&sfp->class_dev->kobj,&cip->grp);
+       if (ret) {
+               printk(KERN_WARNING "%s: sysfs_create_group error: %d\n",
+                      __FUNCTION__, ret);
+               return;
+       }
+       cip->created_ok = !0;
 }
 
 #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
@@ -600,6 +612,8 @@ static ssize_t debugcmd_store(struct class_device *,const char *,size_t count);
 static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
 {
        struct pvr2_sysfs_debugifc *dip;
+       int ret;
+
        dip = kmalloc(sizeof(*dip),GFP_KERNEL);
        if (!dip) return;
        memset(dip,0,sizeof(*dip));
@@ -613,17 +627,34 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
        dip->attr_debuginfo.attr.mode = S_IRUGO;
        dip->attr_debuginfo.show = debuginfo_show;
        sfp->debugifc = dip;
-       class_device_create_file(sfp->class_dev,&dip->attr_debugcmd);
-       class_device_create_file(sfp->class_dev,&dip->attr_debuginfo);
+       ret = class_device_create_file(sfp->class_dev,&dip->attr_debugcmd);
+       if (ret < 0) {
+               printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
+                      __FUNCTION__, ret);
+       } else {
+               dip->debugcmd_created_ok = !0;
+       }
+       ret = class_device_create_file(sfp->class_dev,&dip->attr_debuginfo);
+       if (ret < 0) {
+               printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
+                      __FUNCTION__, ret);
+       } else {
+               dip->debuginfo_created_ok = !0;
+       }
 }
 
 
 static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp)
 {
        if (!sfp->debugifc) return;
-       class_device_remove_file(sfp->class_dev,
-                                &sfp->debugifc->attr_debuginfo);
-       class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd);
+       if (sfp->debugifc->debuginfo_created_ok) {
+               class_device_remove_file(sfp->class_dev,
+                                        &sfp->debugifc->attr_debuginfo);
+       }
+       if (sfp->debugifc->debugcmd_created_ok) {
+               class_device_remove_file(sfp->class_dev,
+                                        &sfp->debugifc->attr_debugcmd);
+       }
        kfree(sfp->debugifc);
        sfp->debugifc = NULL;
 }
@@ -645,7 +676,9 @@ static void pvr2_sysfs_tear_down_controls(struct pvr2_sysfs *sfp)
        struct pvr2_sysfs_ctl_item *cip1,*cip2;
        for (cip1 = sfp->item_first; cip1; cip1 = cip2) {
                cip2 = cip1->item_next;
-               sysfs_remove_group(&sfp->class_dev->kobj,&cip1->grp);
+               if (cip1->created_ok) {
+                       sysfs_remove_group(&sfp->class_dev->kobj,&cip1->grp);
+               }
                pvr2_sysfs_trace("Destroying pvr2_sysfs_ctl_item id=%p",cip1);
                kfree(cip1);
        }
@@ -675,8 +708,14 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp)
        pvr2_sysfs_tear_down_debugifc(sfp);
 #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */
        pvr2_sysfs_tear_down_controls(sfp);
-       class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
-       class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number);
+       if (sfp->v4l_minor_number_created_ok) {
+               class_device_remove_file(sfp->class_dev,
+                                        &sfp->attr_v4l_minor_number);
+       }
+       if (sfp->unit_number_created_ok) {
+               class_device_remove_file(sfp->class_dev,
+                                        &sfp->attr_unit_number);
+       }
        pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev);
        sfp->class_dev->class_data = NULL;
        class_device_unregister(sfp->class_dev);
@@ -709,6 +748,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
 {
        struct usb_device *usb_dev;
        struct class_device *class_dev;
+       int ret;
+
        usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw);
        if (!usb_dev) return;
        class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL);
@@ -733,20 +774,40 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
 
        sfp->class_dev = class_dev;
        class_dev->class_data = sfp;
-       class_device_register(class_dev);
+       ret = class_device_register(class_dev);
+       if (ret) {
+               printk(KERN_ERR "%s: class_device_register failed\n",
+                      __FUNCTION__);
+               kfree(class_dev);
+               return;
+       }
 
        sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE;
        sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
        sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
        sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
        sfp->attr_v4l_minor_number.store = NULL;
-       class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
+       ret = class_device_create_file(sfp->class_dev,
+                                      &sfp->attr_v4l_minor_number);
+       if (ret < 0) {
+               printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
+                      __FUNCTION__, ret);
+       } else {
+               sfp->v4l_minor_number_created_ok = !0;
+       }
+
        sfp->attr_unit_number.attr.owner = THIS_MODULE;
        sfp->attr_unit_number.attr.name = "unit_number";
        sfp->attr_unit_number.attr.mode = S_IRUGO;
        sfp->attr_unit_number.show = unit_number_show;
        sfp->attr_unit_number.store = NULL;
-       class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
+       ret = class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
+       if (ret < 0) {
+               printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
+                      __FUNCTION__, ret);
+       } else {
+               sfp->unit_number_created_ok = !0;
+       }
 
        pvr2_sysfs_add_controls(sfp);
 #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
index 697145e0bf15b551c7073ef727a6c602fc2e0180..8fdf7101d3bfcabb31863d6f0a5622ed5071bb5e 100644 (file)
@@ -30,7 +30,7 @@ config USB_PWC
 
 config USB_PWC_DEBUG
        bool "USB Philips Cameras verbose debug"
-       depends USB_PWC
+       depends on USB_PWC
        help
          Say Y here in order to have the pwc driver generate verbose debugging
          messages.
index 47d0d83a0264445fd4f68b61b5e4b9d1f5906b23..d4703944df9c12c39bb719b311da043da60cb1d9 100644 (file)
@@ -160,6 +160,7 @@ static struct file_operations pwc_fops = {
        .poll =         pwc_video_poll,
        .mmap =         pwc_video_mmap,
        .ioctl =        pwc_video_ioctl,
+       .compat_ioctl = v4l_compat_ioctl32,
        .llseek =       no_llseek,
 };
 static struct video_device pwc_template = {
index f1fd69e7f119ea5220cb44abf5f0e926b7f680bc..d73cff1970ae22391ae77a6e1f1289f23119403f 100644 (file)
@@ -997,9 +997,9 @@ static int saa7134_alsa_init(void)
        struct saa7134_dev *dev = NULL;
        struct list_head *list;
 
-       if (!dmasound_init && !dmasound_exit) {
-               dmasound_init = alsa_device_init;
-               dmasound_exit = alsa_device_exit;
+       if (!saa7134_dmasound_init && !saa7134_dmasound_exit) {
+               saa7134_dmasound_init = alsa_device_init;
+               saa7134_dmasound_exit = alsa_device_exit;
        } else {
                printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n");
                return -EBUSY;
@@ -1036,8 +1036,8 @@ static void saa7134_alsa_exit(void)
                snd_card_free(snd_saa7134_cards[idx]);
        }
 
-       dmasound_init = NULL;
-       dmasound_exit = NULL;
+       saa7134_dmasound_init = NULL;
+       saa7134_dmasound_exit = NULL;
        printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n");
 
        return;
index 6e97cc84ba8903c035ae3a6c605ddb35ab412391..be3a81fc90a2498769cb95ca2b4f306c4d71cfc8 100644 (file)
@@ -95,8 +95,8 @@ LIST_HEAD(saa7134_devlist);
 static LIST_HEAD(mops_list);
 static unsigned int saa7134_devcount;
 
-int (*dmasound_init)(struct saa7134_dev *dev);
-int (*dmasound_exit)(struct saa7134_dev *dev);
+int (*saa7134_dmasound_init)(struct saa7134_dev *dev);
+int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
 
 #define dprintk(fmt, arg...)   if (core_debug) \
        printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
@@ -1008,8 +1008,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
        /* check for signal */
        saa7134_irq_video_intl(dev);
 
-       if (dmasound_init && !dev->dmasound.priv_data) {
-               dmasound_init(dev);
+       if (saa7134_dmasound_init && !dev->dmasound.priv_data) {
+               saa7134_dmasound_init(dev);
        }
 
        return 0;
@@ -1036,8 +1036,8 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
        struct saa7134_mpeg_ops *mops;
 
        /* Release DMA sound modules if present */
-       if (dmasound_exit && dev->dmasound.priv_data) {
-               dmasound_exit(dev);
+       if (saa7134_dmasound_exit && dev->dmasound.priv_data) {
+               saa7134_dmasound_exit(dev);
        }
 
        /* debugging ... */
@@ -1169,8 +1169,8 @@ EXPORT_SYMBOL(saa7134_boards);
 
 /* ----------------- for the DMA sound modules --------------- */
 
-EXPORT_SYMBOL(dmasound_init);
-EXPORT_SYMBOL(dmasound_exit);
+EXPORT_SYMBOL(saa7134_dmasound_init);
+EXPORT_SYMBOL(saa7134_dmasound_exit);
 EXPORT_SYMBOL(saa7134_pgtable_free);
 EXPORT_SYMBOL(saa7134_pgtable_build);
 EXPORT_SYMBOL(saa7134_pgtable_alloc);
index 3895d05804ae93cc1944fcafe69ed8a30fcf8f9b..2e3ba5f31453656a872fbfa1c9eab65c6dcaa0e9 100644 (file)
@@ -993,9 +993,9 @@ static int saa7134_oss_init(void)
        struct saa7134_dev *dev = NULL;
        struct list_head *list;
 
-       if (!dmasound_init && !dmasound_exit) {
-               dmasound_init = oss_device_init;
-               dmasound_exit = oss_device_exit;
+       if (!saa7134_dmasound_init && !saa7134_dmasound_exit) {
+               saa7134_dmasound_init = oss_device_init;
+               saa7134_dmasound_exit = oss_device_exit;
        } else {
                printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n");
                return -EBUSY;
@@ -1037,8 +1037,8 @@ static void saa7134_oss_exit(void)
 
        }
 
-       dmasound_init = NULL;
-       dmasound_exit = NULL;
+       saa7134_dmasound_init = NULL;
+       saa7134_dmasound_exit = NULL;
 
        printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n");
 
index e4156ec9c6d7ed4412b65aefbfa94ebffc4a1a3a..2c171af9a9f2fb868f81ded74eb70fba0c6353f2 100644 (file)
@@ -40,7 +40,7 @@
 
 static unsigned int video_debug   = 0;
 static unsigned int gbuffers      = 8;
-static unsigned int noninterlaced = 0;
+static unsigned int noninterlaced = 1;
 static unsigned int gbufsize      = 720*576*4;
 static unsigned int gbufsize_max  = 720*576*4;
 module_param(video_debug, int, 0644);
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(video_debug,"enable debug messages [video]");
 module_param(gbuffers, int, 0444);
 MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32");
 module_param(noninterlaced, int, 0644);
-MODULE_PARM_DESC(noninterlaced,"video input is noninterlaced");
+MODULE_PARM_DESC(noninterlaced,"capture non interlaced video");
 
 #define dprintk(fmt, arg...)   if (video_debug) \
        printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
@@ -2087,7 +2087,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
                struct v4l2_format *f = arg;
                return saa7134_try_fmt(dev,fh,f);
        }
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case VIDIOCGMBUF:
        {
                struct video_mbuf *mbuf = arg;
index d5ee99c574ccbefa17c617d50594d7bfc8077ab2..c04ce6152fd5373a0e2ea1410621b17ba923f8b8 100644 (file)
@@ -586,8 +586,8 @@ void saa7134_dma_free(struct videobuf_queue *q,struct saa7134_buf *buf);
 
 int saa7134_set_dmabits(struct saa7134_dev *dev);
 
-extern int (*dmasound_init)(struct saa7134_dev *dev);
-extern int (*dmasound_exit)(struct saa7134_dev *dev);
+extern int (*saa7134_dmasound_init)(struct saa7134_dev *dev);
+extern int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
 
 
 /* ----------------------------------------------------------- */
index b36ba9fa3a283786146789ae4776c392f92db147..5686547ba76ab49114aa135cca59e50a646791c2 100644 (file)
@@ -2181,7 +2181,6 @@ static struct pci_device_id stradis_pci_tbl[] = {
        { 0 }
 };
 
-MODULE_DEVICE_TABLE(pci, stradis_pci_tbl);
 
 static struct pci_driver stradis_driver = {
        .name = "stradis",
index f7eb402d5f2b0254af18639e93b27f6a167967fd..40590bae5ff7f55652ae57039d9347ccbb6f8566 100644 (file)
@@ -196,14 +196,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
                i2c_master_send(c, buffer, 4);
                default_tuner_init(c);
                break;
-       case TUNER_LG_TDVS_H06XF:
-               /* Set the Auxiliary Byte. */
-               buffer[2] &= ~0x20;
-               buffer[2] |= 0x18;
-               buffer[3] = 0x20;
-               i2c_master_send(c, buffer, 4);
-               default_tuner_init(c);
-               break;
        case TUNER_PHILIPS_TD1316:
                buffer[0] = 0x0b;
                buffer[1] = 0xdc;
@@ -598,6 +590,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                if (t->standby)
                        t->standby (client);
                break;
+#ifdef CONFIG_VIDEO_V4L1
        case VIDIOCSAUDIO:
                if (check_mode(t, "VIDIOCSAUDIO") == EINVAL)
                        return 0;
@@ -607,17 +600,6 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                /* Should be implemented, since bttv calls it */
                tuner_dbg("VIDIOCSAUDIO not implemented.\n");
                break;
-       case TDA9887_SET_CONFIG:
-               if (t->type == TUNER_TDA9887) {
-                       int *i = arg;
-
-                       t->tda9887_config = *i;
-                       set_freq(client, t->tv_freq);
-               }
-               break;
-       /* --- v4l ioctls --- */
-       /* take care: bttv does userspace copying, we'll get a
-          kernel pointer here... */
        case VIDIOCSCHAN:
                {
                        static const v4l2_std_id map[] = {
@@ -701,7 +683,18 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                                    ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
                        return 0;
                }
+#endif
+       case TDA9887_SET_CONFIG:
+               if (t->type == TUNER_TDA9887) {
+                       int *i = arg;
 
+                       t->tda9887_config = *i;
+                       set_freq(client, t->tv_freq);
+               }
+               break;
+       /* --- v4l ioctls --- */
+       /* take care: bttv does userspace copying, we'll get a
+          kernel pointer here... */
        case VIDIOC_S_STD:
                {
                        v4l2_std_id *id = arg;
index d071c5cbf0131ba2517e9422773c9197b3ed8b28..abe37cf632c6845eabab734962e631e78dda5342 100644 (file)
@@ -339,7 +339,20 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
        if (4 != (rc = i2c_master_send(c,buffer,4)))
                tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
 
-       if (t->type == TUNER_MICROTUNE_4042FI5) {
+       switch (t->type) {
+       case TUNER_LG_TDVS_H06XF:
+               /* Set the Auxiliary Byte. */
+               buffer[0] = buffer[2];
+               buffer[0] &= ~0x20;
+               buffer[0] |= 0x18;
+               buffer[1] = 0x20;
+               tuner_dbg("tv 0x%02x 0x%02x\n",buffer[0],buffer[1]);
+
+               if (2 != (rc = i2c_master_send(c,buffer,2)))
+                       tuner_warn("i2c i/o error: rc == %d (should be 2)\n",rc);
+               break;
+       case TUNER_MICROTUNE_4042FI5:
+       {
                // FIXME - this may also work for other tuners
                unsigned long timeout = jiffies + msecs_to_jiffies(1);
                u8 status_byte = 0;
@@ -364,10 +377,12 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
                buffer[2] = config;
                buffer[3] = cb;
                tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
-                      buffer[0],buffer[1],buffer[2],buffer[3]);
+                         buffer[0],buffer[1],buffer[2],buffer[3]);
 
                if (4 != (rc = i2c_master_send(c,buffer,4)))
                        tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
+               break;
+       }
        }
 }
 
index a167e17c6dcd030d3d773c922146a364dd3aea4e..d7eadc2c298da68f3b0ccc8ad8cdfa89f0d276c9 100644 (file)
@@ -1027,10 +1027,11 @@ static struct tuner_params tuner_tnf_5335mf_params[] = {
 /* 70-79 */
 /* ------------ TUNER_SAMSUNG_TCPN_2121P30A - Samsung NTSC ------------ */
 
+/* '+ 4' turns on the Low Noise Amplifier */
 static struct tuner_range tuner_samsung_tcpn_2121p30a_ntsc_ranges[] = {
-       { 16 * 130.00 /*MHz*/, 0xce, 0x01, },
-       { 16 * 364.50 /*MHz*/, 0xce, 0x02, },
-       { 16 * 999.99        , 0xce, 0x08, },
+       { 16 * 130.00 /*MHz*/, 0xce, 0x01 + 4, },
+       { 16 * 364.50 /*MHz*/, 0xce, 0x02 + 4, },
+       { 16 * 999.99        , 0xce, 0x08 + 4, },
 };
 
 static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = {
@@ -1060,10 +1061,11 @@ static struct tuner_params tuner_thomson_fe6600_params[] = {
 
 /* ------------ TUNER_SAMSUNG_TCPG_6121P30A - Samsung PAL ------------ */
 
+/* '+ 4' turns on the Low Noise Amplifier */
 static struct tuner_range tuner_samsung_tcpg_6121p30a_pal_ranges[] = {
-       { 16 * 146.25 /*MHz*/, 0xce, 0x01, },
-       { 16 * 428.50 /*MHz*/, 0xce, 0x02, },
-       { 16 * 999.99        , 0xce, 0x08, },
+       { 16 * 146.25 /*MHz*/, 0xce, 0x01 + 4, },
+       { 16 * 428.50 /*MHz*/, 0xce, 0x02 + 4, },
+       { 16 * 999.99        , 0xce, 0x08 + 4, },
 };
 
 static struct tuner_params tuner_samsung_tcpg_6121p30a_params[] = {
index 59fb899f31f3548ce1b1c1a72f088a799977c6ed..a0fd82b924f20780fb18c88eb3805e6e1a713f2d 100644 (file)
@@ -3,7 +3,7 @@ config VIDEO_USBVIDEO
 
 config USB_VICAM
        tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)"
-       depends on USB && VIDEO_V4L1 && EXPERIMENTAL
+       depends on USB && VIDEO_DEV && VIDEO_V4L1 && EXPERIMENTAL
        select VIDEO_USBVIDEO
        ---help---
          Say Y here if you have 3com homeconnect camera (vicam).
@@ -13,7 +13,7 @@ config USB_VICAM
 
 config USB_IBMCAM
        tristate "USB IBM (Xirlink) C-it Camera support"
-       depends on USB && VIDEO_V4L1
+       depends on USB && VIDEO_DEV && VIDEO_V4L1
        select VIDEO_USBVIDEO
        ---help---
          Say Y here if you want to connect a IBM "C-It" camera, also known as
@@ -28,7 +28,7 @@ config USB_IBMCAM
 
 config USB_KONICAWC
        tristate "USB Konica Webcam support"
-       depends on USB && VIDEO_V4L1
+       depends on USB && VIDEO_DEV && VIDEO_V4L1
        select VIDEO_USBVIDEO
        ---help---
          Say Y here if you want support for webcams based on a Konica
@@ -39,7 +39,7 @@ config USB_KONICAWC
 
 config USB_QUICKCAM_MESSENGER
        tristate "USB Logitech Quickcam Messenger"
-       depends on USB && VIDEO_DEV
+       depends on USB && VIDEO_DEV && VIDEO_V4L1
        select VIDEO_USBVIDEO
        ---help---
          Say Y or M here to enable support for the USB Logitech Quickcam
index d83a2c84d2334a279c7febcd070f6f7ef7a27899..d7c3fcbc80f7b5585d2a9463ece0f31695b566ee 100644 (file)
@@ -599,6 +599,10 @@ v4l_compat_translate_ioctl(struct inode         *inode,
                        dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n",err);
                        break;
                }
+
+               pict->depth   = ((fmt2->fmt.pix.bytesperline<<3)
+                                + (fmt2->fmt.pix.width-1) )
+                                /fmt2->fmt.pix.width;
                pict->palette = pixelformat_to_palette(
                        fmt2->fmt.pix.pixelformat);
                break;
index f06dc19e504a89652ae55c81c6911c4cd2438cc3..8d972ffdaf98782b3070713900faa245d308eec5 100644 (file)
@@ -202,7 +202,7 @@ static char *v4l2_memory_names[] = {
 /* ------------------------------------------------------------------ */
 /* debug help functions                                               */
 
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 static const char *v4l1_ioctls[] = {
        [_IOC_NR(VIDIOCGCAP)]       = "VIDIOCGCAP",
        [_IOC_NR(VIDIOCGCHAN)]      = "VIDIOCGCHAN",
@@ -301,7 +301,7 @@ static const char *v4l2_ioctls[] = {
 #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
 
 static const char *v4l2_int_ioctls[] = {
-#ifdef HAVE_VIDEO_DECODER
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        [_IOC_NR(DECODER_GET_CAPABILITIES)]    = "DECODER_GET_CAPABILITIES",
        [_IOC_NR(DECODER_GET_STATUS)]          = "DECODER_GET_STATUS",
        [_IOC_NR(DECODER_SET_NORM)]            = "DECODER_SET_NORM",
@@ -367,7 +367,7 @@ void v4l_printk_ioctl(unsigned int cmd)
                       (_IOC_NR(cmd) < V4L2_INT_IOCTLS) ?
                       v4l2_int_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd);
                break;
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case 'v':
                printk("v4l1 ioctl %s, dir=%s (0x%08x)\n",
                       (_IOC_NR(cmd) < V4L1_IOCTLS) ?
@@ -414,6 +414,7 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
                printk ("%s: tuner type=%d\n", s, *p);
                break;
        }
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case DECODER_SET_VBI_BYPASS:
        case DECODER_ENABLE_OUTPUT:
        case DECODER_GET_STATUS:
@@ -424,6 +425,7 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
        case VIDIOCCAPTURE:
        case VIDIOCSYNC:
        case VIDIOCSWRITEMODE:
+#endif
        case TUNER_SET_TYPE_ADDR:
        case TUNER_SET_STANDBY:
        case TDA9887_SET_CONFIG:
@@ -755,6 +757,7 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
                                p->afc);
                break;
        }
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        case VIDIOCGVBIFMT:
        case VIDIOCSVBIFMT:
        {
@@ -924,6 +927,14 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
                                p->clipcount);
                break;
        }
+       case VIDIOCGFREQ:
+       case VIDIOCSFREQ:
+       {
+               unsigned long *p=arg;
+               printk ("%s: value=%lu\n", s, *p);
+               break;
+       }
+#endif
        case VIDIOC_INT_AUDIO_CLOCK_FREQ:
        case VIDIOC_INT_I2S_CLOCK_FREQ:
        case VIDIOC_INT_S_STANDBY:
@@ -933,13 +944,6 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
                printk ("%s: value=%d\n", s, *p);
                break;
        }
-       case VIDIOCGFREQ:
-       case VIDIOCSFREQ:
-       {
-               unsigned long *p=arg;
-               printk ("%s: value=%lu\n", s, *p);
-               break;
-       }
        case VIDIOC_G_STD:
        case VIDIOC_S_STD:
        case VIDIOC_QUERYSTD:
index b26ebaff226f49182537c0a350ff4189969eaddf..88bf2af2a0e715d575ca6614139d8becfc16fb05 100644 (file)
@@ -760,7 +760,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
                ret=vfd->vidioc_overlay(file, fh, *i);
                break;
        }
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        /* --- streaming capture ------------------------------------- */
        case VIDIOCGMBUF:
        {
@@ -1512,6 +1512,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
        int i=0;
        int base;
        int end;
+       int ret;
        char *name_base;
 
        switch(type)
@@ -1537,6 +1538,8 @@ int video_register_device(struct video_device *vfd, int type, int nr)
                        name_base = "radio";
                        break;
                default:
+                       printk(KERN_ERR "%s called with unknown type: %d\n",
+                              __FUNCTION__, type);
                        return -1;
        }
 
@@ -1571,9 +1574,18 @@ int video_register_device(struct video_device *vfd, int type, int nr)
        vfd->class_dev.class       = &video_class;
        vfd->class_dev.devt        = MKDEV(VIDEO_MAJOR, vfd->minor);
        sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base);
-       class_device_register(&vfd->class_dev);
-       class_device_create_file(&vfd->class_dev,
-                               &class_device_attr_name);
+       ret = class_device_register(&vfd->class_dev);
+       if (ret < 0) {
+               printk(KERN_ERR "%s: class_device_register failed\n",
+                      __FUNCTION__);
+               goto fail_minor;
+       }
+       ret = class_device_create_file(&vfd->class_dev, &class_device_attr_name);
+       if (ret < 0) {
+               printk(KERN_ERR "%s: class_device_create_file 'name' failed\n",
+                      __FUNCTION__);
+               goto fail_classdev;
+       }
 
 #if 1
        /* needed until all drivers are fixed */
@@ -1583,6 +1595,15 @@ int video_register_device(struct video_device *vfd, int type, int nr)
                       "http://lwn.net/Articles/36850/\n", vfd->name);
 #endif
        return 0;
+
+fail_classdev:
+       class_device_unregister(&vfd->class_dev);
+fail_minor:
+       mutex_lock(&videodev_lock);
+       video_device[vfd->minor] = NULL;
+       vfd->minor = -1;
+       mutex_unlock(&videodev_lock);
+       return ret;
 }
 
 /**
index 41d23c8acbd8b41fd283f4d39b7aaf4ebd88c849..841884af0cc03b56a992aa1084740dfa1937c3b6 100644 (file)
@@ -986,7 +986,7 @@ static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *p)
                                file->f_flags & O_NONBLOCK));
 }
 
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf)
 {
        struct vivi_fh  *fh=priv;
@@ -1328,7 +1328,7 @@ static struct video_device vivi = {
        .vidioc_s_ctrl        = vidioc_s_ctrl,
        .vidioc_streamon      = vidioc_streamon,
        .vidioc_streamoff     = vidioc_streamoff,
-#ifdef HAVE_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
        .vidiocgmbuf          = vidiocgmbuf,
 #endif
        .tvnorms              = tvnorms,
index 0b9682e9a357117edbe4cf439851134051b94d74..74f8cdeeff0f8501f379d01037144ecd404c6ff4 100644 (file)
@@ -79,7 +79,8 @@ static int mmc_queue_thread(void *d)
                spin_lock_irq(q->queue_lock);
                set_current_state(TASK_INTERRUPTIBLE);
                if (!blk_queue_plugged(q))
-                       mq->req = req = elv_next_request(q);
+                       req = elv_next_request(q);
+               mq->req = req;
                spin_unlock_irq(q->queue_lock);
 
                if (!req) {
index 8a30ef3ae4191d52320516ae72b93c75f47a6aac..c351c6d1a18a11ee8ed712c77248b4337c5729d5 100644 (file)
@@ -41,7 +41,7 @@
 #include "wbsd.h"
 
 #define DRIVER_NAME "wbsd"
-#define DRIVER_VERSION "1.5"
+#define DRIVER_VERSION "1.6"
 
 #define DBG(x...) \
        pr_debug(DRIVER_NAME ": " x)
@@ -1439,13 +1439,13 @@ static int __devinit wbsd_scan(struct wbsd_host *host)
 
 static int __devinit wbsd_request_region(struct wbsd_host *host, int base)
 {
-       if (io & 0x7)
+       if (base & 0x7)
                return -EINVAL;
 
        if (!request_region(base, 8, DRIVER_NAME))
                return -EIO;
 
-       host->base = io;
+       host->base = base;
 
        return 0;
 }
@@ -1773,7 +1773,7 @@ static int __devinit wbsd_init(struct device *dev, int base, int irq, int dma,
        /*
         * Request resources.
         */
-       ret = wbsd_request_resources(host, io, irq, dma);
+       ret = wbsd_request_resources(host, base, irq, dma);
        if (ret) {
                wbsd_release_resources(host);
                wbsd_free_mmc(dev);
@@ -1861,6 +1861,7 @@ static void __devexit wbsd_shutdown(struct device *dev, int pnp)
 
 static int __devinit wbsd_probe(struct platform_device *dev)
 {
+       /* Use the module parameters for resources */
        return wbsd_init(&dev->dev, io, irq, dma, 0);
 }
 
index b14e89004c3aa607031b5aba3c97dab96e9b0e68..0a0e0cd81a23a1fd5a16581fca361d7742bfaed4 100644 (file)
@@ -29,7 +29,7 @@ config ATALK
          even politically correct people are allowed to say Y here.
 
 config DEV_APPLETALK
-       bool "Appletalk interfaces support"
+       tristate "Appletalk interfaces support"
        depends on ATALK
        help
          AppleTalk is the protocol that Apple computers can use to communicate
index db73de0d25117339ede7074548003cec7986bddf..652eb05a6c2df6c7e406eef8ecbfa82cfcb03564 100644 (file)
@@ -56,8 +56,8 @@
 
 #define DRV_MODULE_NAME                "bnx2"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "1.4.43"
-#define DRV_MODULE_RELDATE     "June 28, 2006"
+#define DRV_MODULE_VERSION     "1.4.44"
+#define DRV_MODULE_RELDATE     "August 10, 2006"
 
 #define RUN_AT(x) (jiffies + (x))
 
@@ -209,8 +209,10 @@ MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl);
 
 static inline u32 bnx2_tx_avail(struct bnx2 *bp)
 {
-       u32 diff = TX_RING_IDX(bp->tx_prod) - TX_RING_IDX(bp->tx_cons);
+       u32 diff;
 
+       smp_mb();
+       diff = TX_RING_IDX(bp->tx_prod) - TX_RING_IDX(bp->tx_cons);
        if (diff > MAX_TX_DESC_CNT)
                diff = (diff & MAX_TX_DESC_CNT) - 1;
        return (bp->tx_ring_size - diff);
@@ -1569,7 +1571,7 @@ bnx2_alloc_rx_skb(struct bnx2 *bp, u16 index)
        struct rx_bd *rxbd = &bp->rx_desc_ring[RX_RING(index)][RX_IDX(index)];
        unsigned long align;
 
-       skb = dev_alloc_skb(bp->rx_buf_size);
+       skb = netdev_alloc_skb(bp->dev, bp->rx_buf_size);
        if (skb == NULL) {
                return -ENOMEM;
        }
@@ -1578,7 +1580,6 @@ bnx2_alloc_rx_skb(struct bnx2 *bp, u16 index)
                skb_reserve(skb, 8 - align);
        }
 
-       skb->dev = bp->dev;
        mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_use_size,
                PCI_DMA_FROMDEVICE);
 
@@ -1686,15 +1687,20 @@ bnx2_tx_int(struct bnx2 *bp)
        }
 
        bp->tx_cons = sw_cons;
+       /* Need to make the tx_cons update visible to bnx2_start_xmit()
+        * before checking for netif_queue_stopped().  Without the
+        * memory barrier, there is a small possibility that bnx2_start_xmit()
+        * will miss it and cause the queue to be stopped forever.
+        */
+       smp_mb();
 
-       if (unlikely(netif_queue_stopped(bp->dev))) {
-               spin_lock(&bp->tx_lock);
+       if (unlikely(netif_queue_stopped(bp->dev)) &&
+                    (bnx2_tx_avail(bp) > bp->tx_wake_thresh)) {
+               netif_tx_lock(bp->dev);
                if ((netif_queue_stopped(bp->dev)) &&
-                   (bnx2_tx_avail(bp) > MAX_SKB_FRAGS)) {
-
+                   (bnx2_tx_avail(bp) > bp->tx_wake_thresh))
                        netif_wake_queue(bp->dev);
-               }
-               spin_unlock(&bp->tx_lock);
+               netif_tx_unlock(bp->dev);
        }
 }
 
@@ -1786,7 +1792,7 @@ bnx2_rx_int(struct bnx2 *bp, int budget)
                if ((bp->dev->mtu > 1500) && (len <= RX_COPY_THRESH)) {
                        struct sk_buff *new_skb;
 
-                       new_skb = dev_alloc_skb(len + 2);
+                       new_skb = netdev_alloc_skb(bp->dev, len + 2);
                        if (new_skb == NULL)
                                goto reuse_rx;
 
@@ -1797,7 +1803,6 @@ bnx2_rx_int(struct bnx2 *bp, int budget)
 
                        skb_reserve(new_skb, 2);
                        skb_put(new_skb, len);
-                       new_skb->dev = bp->dev;
 
                        bnx2_reuse_rx_skb(bp, skb,
                                sw_ring_cons, sw_ring_prod);
@@ -3503,6 +3508,8 @@ bnx2_init_tx_ring(struct bnx2 *bp)
        struct tx_bd *txbd;
        u32 val;
 
+       bp->tx_wake_thresh = bp->tx_ring_size / 2;
+
        txbd = &bp->tx_desc_ring[MAX_TX_DESC_CNT];
                
        txbd->tx_bd_haddr_hi = (u64) bp->tx_desc_mapping >> 32;
@@ -3952,7 +3959,7 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
                return -EINVAL;
 
        pkt_size = 1514;
-       skb = dev_alloc_skb(pkt_size);
+       skb = netdev_alloc_skb(bp->dev, pkt_size);
        if (!skb)
                return -ENOMEM;
        packet = skb_put(skb, pkt_size);
@@ -4390,10 +4397,8 @@ bnx2_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
 #endif
 
 /* Called with netif_tx_lock.
- * hard_start_xmit is pseudo-lockless - a lock is only required when
- * the tx queue is full. This way, we get the benefit of lockless
- * operations most of the time without the complexities to handle
- * netif_stop_queue/wake_queue race conditions.
+ * bnx2_tx_int() runs without netif_tx_lock unless it needs to call
+ * netif_wake_queue().
  */
 static int
 bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -4512,12 +4517,9 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
        dev->trans_start = jiffies;
 
        if (unlikely(bnx2_tx_avail(bp) <= MAX_SKB_FRAGS)) {
-               spin_lock(&bp->tx_lock);
                netif_stop_queue(dev);
-               
-               if (bnx2_tx_avail(bp) > MAX_SKB_FRAGS)
+               if (bnx2_tx_avail(bp) > bp->tx_wake_thresh)
                        netif_wake_queue(dev);
-               spin_unlock(&bp->tx_lock);
        }
 
        return NETDEV_TX_OK;
@@ -5628,7 +5630,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        bp->pdev = pdev;
 
        spin_lock_init(&bp->phy_lock);
-       spin_lock_init(&bp->tx_lock);
        INIT_WORK(&bp->reset_task, bnx2_reset_task, bp);
 
        dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0);
@@ -5751,7 +5752,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        bp->mac_addr[5] = (u8) reg;
 
        bp->tx_ring_size = MAX_TX_DESC_CNT;
-       bnx2_set_rx_ring_size(bp, 100);
+       bnx2_set_rx_ring_size(bp, 255);
 
        bp->rx_csum = 1;
 
index 658c5ee95c73ecdea4bd4c34c74e68e2b82b54bb..fe804763c60738b0d8c442175fa05d7816e1882c 100644 (file)
@@ -3890,10 +3890,6 @@ struct bnx2 {
        u32             tx_prod_bseq __attribute__((aligned(L1_CACHE_BYTES)));
        u16             tx_prod;
 
-       struct tx_bd    *tx_desc_ring;
-       struct sw_bd    *tx_buf_ring;
-       int             tx_ring_size;
-
        u16             tx_cons __attribute__((aligned(L1_CACHE_BYTES)));
        u16             hw_tx_cons;
 
@@ -3916,9 +3912,11 @@ struct bnx2 {
        struct sw_bd            *rx_buf_ring;
        struct rx_bd            *rx_desc_ring[MAX_RX_RINGS];
 
-       /* Only used to synchronize netif_stop_queue/wake_queue when tx */
-       /* ring is full */
-       spinlock_t              tx_lock;
+       /* TX constants */
+       struct tx_bd    *tx_desc_ring;
+       struct sw_bd    *tx_buf_ring;
+       int             tx_ring_size;
+       u32             tx_wake_thresh;
 
        /* End of fields used in the performance code paths. */
 
index da62db8974265229fa4a1729efdabe30ec77e902..627f224d78bc0113a2cb8096f2d413346aa10867 100644 (file)
@@ -3127,7 +3127,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
                break;
        }
 
-       /* NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
+       /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
         * means we reserve 2 more, this pushes us to allocate from the next
         * larger slab size
         * i.e. RXBUFFER_2048 --> size-4096 slab */
@@ -3708,7 +3708,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
 #define E1000_CB_LENGTH 256
                if (length < E1000_CB_LENGTH) {
                        struct sk_buff *new_skb =
-                           dev_alloc_skb(length + NET_IP_ALIGN);
+                           netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
                        if (new_skb) {
                                skb_reserve(new_skb, NET_IP_ALIGN);
                                new_skb->dev = netdev;
@@ -3979,7 +3979,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
 
        while (cleaned_count--) {
                if (!(skb = buffer_info->skb))
-                       skb = dev_alloc_skb(bufsz);
+                       skb = netdev_alloc_skb(netdev, bufsz);
                else {
                        skb_trim(skb, 0);
                        goto map_skb;
@@ -3997,7 +3997,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
                        DPRINTK(RX_ERR, ERR, "skb align check failed: %u bytes "
                                             "at %p\n", bufsz, skb->data);
                        /* Try again, without freeing the previous */
-                       skb = dev_alloc_skb(bufsz);
+                       skb = netdev_alloc_skb(netdev, bufsz);
                        /* Failed allocation, critical failure */
                        if (!skb) {
                                dev_kfree_skb(oldskb);
@@ -4121,7 +4121,8 @@ e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
                                rx_desc->read.buffer_addr[j+1] = ~0;
                }
 
-               skb = dev_alloc_skb(adapter->rx_ps_bsize0 + NET_IP_ALIGN);
+               skb = netdev_alloc_skb(netdev,
+                                      adapter->rx_ps_bsize0 + NET_IP_ALIGN);
 
                if (unlikely(!skb)) {
                        adapter->alloc_rx_buff_failed++;
index 07ca9480a6fe7fc892b32b87e49d9065aac9a695..9bdd43ab3573afb5981b456d9a50b0a7a7c6ce73 100644 (file)
@@ -177,6 +177,7 @@ struct myri10ge_priv {
        struct work_struct watchdog_work;
        struct timer_list watchdog_timer;
        int watchdog_tx_done;
+       int watchdog_tx_req;
        int watchdog_resets;
        int tx_linearized;
        int pause;
@@ -448,6 +449,7 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
        struct mcp_gen_header *hdr;
        size_t hdr_offset;
        int status;
+       unsigned i;
 
        if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) {
                dev_err(dev, "Unable to load %s firmware image via hotplug\n",
@@ -479,18 +481,12 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
                goto abort_with_fw;
 
        crc = crc32(~0, fw->data, fw->size);
-       if (mgp->tx.boundary == 2048) {
-               /* Avoid PCI burst on chipset with unaligned completions. */
-               int i;
-               __iomem u32 *ptr = (__iomem u32 *) (mgp->sram +
-                                                   MYRI10GE_FW_OFFSET);
-               for (i = 0; i < fw->size / 4; i++) {
-                       __raw_writel(((u32 *) fw->data)[i], ptr + i);
-                       wmb();
-               }
-       } else {
-               myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET, fw->data,
-                                 fw->size);
+       for (i = 0; i < fw->size; i += 256) {
+               myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET + i,
+                                 fw->data + i,
+                                 min(256U, (unsigned)(fw->size - i)));
+               mb();
+               readb(mgp->sram);
        }
        /* corruption checking is good for parity recovery and buggy chipset */
        memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size);
@@ -620,7 +616,7 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp)
                return -ENXIO;
        }
        dev_info(&mgp->pdev->dev, "handoff confirmed\n");
-       myri10ge_dummy_rdma(mgp, mgp->tx.boundary != 4096);
+       myri10ge_dummy_rdma(mgp, 1);
 
        return 0;
 }
@@ -2429,7 +2425,7 @@ static int myri10ge_resume(struct pci_dev *pdev)
        }
 
        myri10ge_reset(mgp);
-       myri10ge_dummy_rdma(mgp, mgp->tx.boundary != 4096);
+       myri10ge_dummy_rdma(mgp, 1);
 
        /* Save configuration space to be restored if the
         * nic resets due to a parity error */
@@ -2547,7 +2543,8 @@ static void myri10ge_watchdog_timer(unsigned long arg)
 
        mgp = (struct myri10ge_priv *)arg;
        if (mgp->tx.req != mgp->tx.done &&
-           mgp->tx.done == mgp->watchdog_tx_done)
+           mgp->tx.done == mgp->watchdog_tx_done &&
+           mgp->watchdog_tx_req != mgp->watchdog_tx_done)
                /* nic seems like it might be stuck.. */
                schedule_work(&mgp->watchdog_work);
        else
@@ -2556,6 +2553,7 @@ static void myri10ge_watchdog_timer(unsigned long arg)
                          jiffies + myri10ge_watchdog_timeout * HZ);
 
        mgp->watchdog_tx_done = mgp->tx.done;
+       mgp->watchdog_tx_req = mgp->tx.req;
 }
 
 static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
index 7d5c2233c252fac78c386f6b6e3cc9bc4f21b88e..f5aad77288f916e776d8362fdbcec38c6ba5f5ff 100644 (file)
@@ -419,9 +419,8 @@ void phy_start_machine(struct phy_device *phydev,
 
 /* phy_stop_machine
  *
- * description: Stops the state machine timer, sets the state to
- *   UP (unless it wasn't up yet), and then frees the interrupt,
- *   if it is in use. This function must be called BEFORE
+ * description: Stops the state machine timer, sets the state to UP
+ *   (unless it wasn't up yet). This function must be called BEFORE
  *   phy_detach.
  */
 void phy_stop_machine(struct phy_device *phydev)
@@ -433,9 +432,6 @@ void phy_stop_machine(struct phy_device *phydev)
                phydev->state = PHY_UP;
        spin_unlock(&phydev->lock);
 
-       if (phydev->irq != PHY_POLL)
-               phy_stop_interrupts(phydev);
-
        phydev->adjust_state = NULL;
 }
 
index 0ec6e9d57b9499d438c9cf1838a212238e261a09..c872f7c6cce39392e7490cb2437ea62bd8fcc53f 100644 (file)
@@ -192,7 +192,7 @@ struct cardmap {
        void *ptr[CARDMAP_WIDTH];
 };
 static void *cardmap_get(struct cardmap *map, unsigned int nr);
-static void cardmap_set(struct cardmap **map, unsigned int nr, void *ptr);
+static int cardmap_set(struct cardmap **map, unsigned int nr, void *ptr);
 static unsigned int cardmap_find_first_free(struct cardmap *map);
 static void cardmap_destroy(struct cardmap **map);
 
@@ -1995,10 +1995,9 @@ ppp_register_channel(struct ppp_channel *chan)
 {
        struct channel *pch;
 
-       pch = kmalloc(sizeof(struct channel), GFP_KERNEL);
+       pch = kzalloc(sizeof(struct channel), GFP_KERNEL);
        if (pch == 0)
                return -ENOMEM;
-       memset(pch, 0, sizeof(struct channel));
        pch->ppp = NULL;
        pch->chan = chan;
        chan->ppp = pch;
@@ -2408,13 +2407,12 @@ ppp_create_interface(int unit, int *retp)
        int ret = -ENOMEM;
        int i;
 
-       ppp = kmalloc(sizeof(struct ppp), GFP_KERNEL);
+       ppp = kzalloc(sizeof(struct ppp), GFP_KERNEL);
        if (!ppp)
                goto out;
        dev = alloc_netdev(0, "", ppp_setup);
        if (!dev)
                goto out1;
-       memset(ppp, 0, sizeof(struct ppp));
 
        ppp->mru = PPP_MRU;
        init_ppp_file(&ppp->file, INTERFACE);
@@ -2454,11 +2452,16 @@ ppp_create_interface(int unit, int *retp)
        }
 
        atomic_inc(&ppp_unit_count);
-       cardmap_set(&all_ppp_units, unit, ppp);
+       ret = cardmap_set(&all_ppp_units, unit, ppp);
+       if (ret != 0)
+               goto out3;
+
        mutex_unlock(&all_ppp_mutex);
        *retp = 0;
        return ppp;
 
+out3:
+       atomic_dec(&ppp_unit_count);
 out2:
        mutex_unlock(&all_ppp_mutex);
        free_netdev(dev);
@@ -2695,7 +2698,7 @@ static void *cardmap_get(struct cardmap *map, unsigned int nr)
        return NULL;
 }
 
-static void cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
+static int cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
 {
        struct cardmap *p;
        int i;
@@ -2704,8 +2707,9 @@ static void cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
        if (p == NULL || (nr >> p->shift) >= CARDMAP_WIDTH) {
                do {
                        /* need a new top level */
-                       struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
-                       memset(np, 0, sizeof(*np));
+                       struct cardmap *np = kzalloc(sizeof(*np), GFP_KERNEL);
+                       if (!np)
+                               goto enomem;
                        np->ptr[0] = p;
                        if (p != NULL) {
                                np->shift = p->shift + CARDMAP_ORDER;
@@ -2719,8 +2723,9 @@ static void cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
        while (p->shift > 0) {
                i = (nr >> p->shift) & CARDMAP_MASK;
                if (p->ptr[i] == NULL) {
-                       struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
-                       memset(np, 0, sizeof(*np));
+                       struct cardmap *np = kzalloc(sizeof(*np), GFP_KERNEL);
+                       if (!np)
+                               goto enomem;
                        np->shift = p->shift - CARDMAP_ORDER;
                        np->parent = p;
                        p->ptr[i] = np;
@@ -2735,6 +2740,9 @@ static void cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
                set_bit(i, &p->inuse);
        else
                clear_bit(i, &p->inuse);
+       return 0;
+ enomem:
+       return -ENOMEM;
 }
 
 static unsigned int cardmap_find_first_free(struct cardmap *map)
index e1fe3a0a7b0be740237491f4a5eaf523793c5683..132ed32bce1ae819c8112a2d644c1de895d1370c 100644 (file)
@@ -76,7 +76,7 @@
 #include "s2io.h"
 #include "s2io-regs.h"
 
-#define DRV_VERSION "2.0.14.2"
+#define DRV_VERSION "2.0.15.2"
 
 /* S2io Driver name & version. */
 static char s2io_driver_name[] = "Neterion";
@@ -370,38 +370,50 @@ static const u64 fix_mac[] = {
        END_SIGN
 };
 
+MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@neterion.com>");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);
+
+
 /* Module Loadable parameters. */
-static unsigned int tx_fifo_num = 1;
-static unsigned int tx_fifo_len[MAX_TX_FIFOS] =
-    {DEFAULT_FIFO_0_LEN, [1 ...(MAX_TX_FIFOS - 1)] = DEFAULT_FIFO_1_7_LEN};
-static unsigned int rx_ring_num = 1;
-static unsigned int rx_ring_sz[MAX_RX_RINGS] =
-    {[0 ...(MAX_RX_RINGS - 1)] = SMALL_BLK_CNT};
-static unsigned int rts_frm_len[MAX_RX_RINGS] =
-    {[0 ...(MAX_RX_RINGS - 1)] = 0 };
-static unsigned int rx_ring_mode = 1;
-static unsigned int use_continuous_tx_intrs = 1;
-static unsigned int rmac_pause_time = 0x100;
-static unsigned int mc_pause_threshold_q0q3 = 187;
-static unsigned int mc_pause_threshold_q4q7 = 187;
-static unsigned int shared_splits;
-static unsigned int tmac_util_period = 5;
-static unsigned int rmac_util_period = 5;
-static unsigned int bimodal = 0;
-static unsigned int l3l4hdr_size = 128;
-#ifndef CONFIG_S2IO_NAPI
-static unsigned int indicate_max_pkts;
-#endif
+S2IO_PARM_INT(tx_fifo_num, 1);
+S2IO_PARM_INT(rx_ring_num, 1);
+
+
+S2IO_PARM_INT(rx_ring_mode, 1);
+S2IO_PARM_INT(use_continuous_tx_intrs, 1);
+S2IO_PARM_INT(rmac_pause_time, 0x100);
+S2IO_PARM_INT(mc_pause_threshold_q0q3, 187);
+S2IO_PARM_INT(mc_pause_threshold_q4q7, 187);
+S2IO_PARM_INT(shared_splits, 0);
+S2IO_PARM_INT(tmac_util_period, 5);
+S2IO_PARM_INT(rmac_util_period, 5);
+S2IO_PARM_INT(bimodal, 0);
+S2IO_PARM_INT(l3l4hdr_size, 128);
 /* Frequency of Rx desc syncs expressed as power of 2 */
-static unsigned int rxsync_frequency = 3;
+S2IO_PARM_INT(rxsync_frequency, 3);
 /* Interrupt type. Values can be 0(INTA), 1(MSI), 2(MSI_X) */
-static unsigned int intr_type = 0;
+S2IO_PARM_INT(intr_type, 0);
 /* Large receive offload feature */
-static unsigned int lro = 0;
+S2IO_PARM_INT(lro, 0);
 /* Max pkts to be aggregated by LRO at one time. If not specified,
  * aggregation happens until we hit max IP pkt size(64K)
  */
-static unsigned int lro_max_pkts = 0xFFFF;
+S2IO_PARM_INT(lro_max_pkts, 0xFFFF);
+#ifndef CONFIG_S2IO_NAPI
+S2IO_PARM_INT(indicate_max_pkts, 0);
+#endif
+
+static unsigned int tx_fifo_len[MAX_TX_FIFOS] =
+    {DEFAULT_FIFO_0_LEN, [1 ...(MAX_TX_FIFOS - 1)] = DEFAULT_FIFO_1_7_LEN};
+static unsigned int rx_ring_sz[MAX_RX_RINGS] =
+    {[0 ...(MAX_RX_RINGS - 1)] = SMALL_BLK_CNT};
+static unsigned int rts_frm_len[MAX_RX_RINGS] =
+    {[0 ...(MAX_RX_RINGS - 1)] = 0 };
+
+module_param_array(tx_fifo_len, uint, NULL, 0);
+module_param_array(rx_ring_sz, uint, NULL, 0);
+module_param_array(rts_frm_len, uint, NULL, 0);
 
 /*
  * S2IO device table.
@@ -464,10 +476,9 @@ static int init_shared_mem(struct s2io_nic *nic)
                size += config->tx_cfg[i].fifo_len;
        }
        if (size > MAX_AVAILABLE_TXDS) {
-               DBG_PRINT(ERR_DBG, "%s: Requested TxDs too high, ",
-                         __FUNCTION__);
+               DBG_PRINT(ERR_DBG, "s2io: Requested TxDs too high, ");
                DBG_PRINT(ERR_DBG, "Requested: %d, max supported: 8192\n", size);
-               return FAILURE;
+               return -EINVAL;
        }
 
        lst_size = (sizeof(TxD_t) * config->max_txds);
@@ -547,6 +558,7 @@ static int init_shared_mem(struct s2io_nic *nic)
        nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL);
        if (!nic->ufo_in_band_v)
                return -ENOMEM;
+       memset(nic->ufo_in_band_v, 0, size);
 
        /* Allocation and initialization of RXDs in Rings */
        size = 0;
@@ -1213,7 +1225,7 @@ static int init_nic(struct s2io_nic *nic)
                break;
        }
 
-       /* Enable Tx FIFO partition 0. */
+       /* Enable all configured Tx FIFO partitions */
        val64 = readq(&bar0->tx_fifo_partition_0);
        val64 |= (TX_FIFO_PARTITION_EN);
        writeq(val64, &bar0->tx_fifo_partition_0);
@@ -1650,7 +1662,7 @@ static void en_dis_able_nic_intrs(struct s2io_nic *nic, u16 mask, int flag)
                        writeq(temp64, &bar0->general_int_mask);
                        /*
                         * If Hercules adapter enable GPIO otherwise
-                        * disabled all PCIX, Flash, MDIO, IIC and GPIO
+                        * disable all PCIX, Flash, MDIO, IIC and GPIO
                         * interrupts for now.
                         * TODO
                         */
@@ -2119,7 +2131,7 @@ static struct sk_buff *s2io_txdl_getskb(fifo_info_t *fifo_data, TxD_t *txdlp, in
                                       frag->size, PCI_DMA_TODEVICE);
                }
        }
-       txdlp->Host_Control = 0;
+       memset(txdlp,0, (sizeof(TxD_t) * fifo_data->max_txds));
        return(skb);
 }
 
@@ -2371,9 +2383,14 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
                        skb->data = (void *) (unsigned long)tmp;
                        skb->tail = (void *) (unsigned long)tmp;
 
-                       ((RxD3_t*)rxdp)->Buffer0_ptr =
-                           pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN,
+                       if (!(((RxD3_t*)rxdp)->Buffer0_ptr))
+                               ((RxD3_t*)rxdp)->Buffer0_ptr =
+                                  pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN,
                                           PCI_DMA_FROMDEVICE);
+                       else
+                               pci_dma_sync_single_for_device(nic->pdev,
+                                   (dma_addr_t) ((RxD3_t*)rxdp)->Buffer0_ptr,
+                                   BUF0_LEN, PCI_DMA_FROMDEVICE);
                        rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN);
                        if (nic->rxd_mode == RXD_MODE_3B) {
                                /* Two buffer mode */
@@ -2386,10 +2403,13 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
                                (nic->pdev, skb->data, dev->mtu + 4,
                                                PCI_DMA_FROMDEVICE);
 
-                               /* Buffer-1 will be dummy buffer not used */
-                               ((RxD3_t*)rxdp)->Buffer1_ptr =
-                               pci_map_single(nic->pdev, ba->ba_1, BUF1_LEN,
-                                       PCI_DMA_FROMDEVICE);
+                               /* Buffer-1 will be dummy buffer. Not used */
+                               if (!(((RxD3_t*)rxdp)->Buffer1_ptr)) {
+                                       ((RxD3_t*)rxdp)->Buffer1_ptr =
+                                               pci_map_single(nic->pdev, 
+                                               ba->ba_1, BUF1_LEN,
+                                               PCI_DMA_FROMDEVICE);
+                               }
                                rxdp->Control_2 |= SET_BUFFER1_SIZE_3(1);
                                rxdp->Control_2 |= SET_BUFFER2_SIZE_3
                                                                (dev->mtu + 4);
@@ -2614,23 +2634,23 @@ no_rx:
 }
 #endif
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
 /**
- * s2io_netpoll - Rx interrupt service handler for netpoll support
+ * s2io_netpoll - netpoll event handler entry point
  * @dev : pointer to the device structure.
  * Description:
- * Polling 'interrupt' - used by things like netconsole to send skbs
- * without having to re-enable interrupts. It's not called while
- * the interrupt routine is executing.
+ *     This function will be called by upper layer to check for events on the
+ * interface in situations where interrupts are disabled. It is used for
+ * specific in-kernel networking tasks, such as remote consoles and kernel
+ * debugging over the network (example netdump in RedHat).
  */
-
-#ifdef CONFIG_NET_POLL_CONTROLLER
 static void s2io_netpoll(struct net_device *dev)
 {
        nic_t *nic = dev->priv;
        mac_info_t *mac_control;
        struct config_param *config;
        XENA_dev_config_t __iomem *bar0 = nic->bar0;
-       u64 val64;
+       u64 val64 = 0xFFFFFFFFFFFFFFFFULL;
        int i;
 
        disable_irq(dev->irq);
@@ -2639,9 +2659,17 @@ static void s2io_netpoll(struct net_device *dev)
        mac_control = &nic->mac_control;
        config = &nic->config;
 
-       val64 = readq(&bar0->rx_traffic_int);
        writeq(val64, &bar0->rx_traffic_int);
+       writeq(val64, &bar0->tx_traffic_int);
 
+       /* we need to free up the transmitted skbufs or else netpoll will 
+        * run out of skbs and will fail and eventually netpoll application such
+        * as netdump will fail.
+        */
+       for (i = 0; i < config->tx_fifo_num; i++)
+               tx_intr_handler(&mac_control->fifos[i]);
+
+       /* check for received packet and indicate up to network */
        for (i = 0; i < config->rx_ring_num; i++)
                rx_intr_handler(&mac_control->rings[i]);
 
@@ -2708,7 +2736,7 @@ static void rx_intr_handler(ring_info_t *ring_data)
                /* If your are next to put index then it's FIFO full condition */
                if ((get_block == put_block) &&
                    (get_info.offset + 1) == put_info.offset) {
-                       DBG_PRINT(ERR_DBG, "%s: Ring Full\n",dev->name);
+                       DBG_PRINT(INTR_DBG, "%s: Ring Full\n",dev->name);
                        break;
                }
                skb = (struct sk_buff *) ((unsigned long)rxdp->Host_Control);
@@ -2728,18 +2756,15 @@ static void rx_intr_handler(ring_info_t *ring_data)
                                 HEADER_SNAP_SIZE,
                                 PCI_DMA_FROMDEVICE);
                } else if (nic->rxd_mode == RXD_MODE_3B) {
-                       pci_unmap_single(nic->pdev, (dma_addr_t)
+                       pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)
                                 ((RxD3_t*)rxdp)->Buffer0_ptr,
                                 BUF0_LEN, PCI_DMA_FROMDEVICE);
-                       pci_unmap_single(nic->pdev, (dma_addr_t)
-                                ((RxD3_t*)rxdp)->Buffer1_ptr,
-                                BUF1_LEN, PCI_DMA_FROMDEVICE);
                        pci_unmap_single(nic->pdev, (dma_addr_t)
                                 ((RxD3_t*)rxdp)->Buffer2_ptr,
                                 dev->mtu + 4,
                                 PCI_DMA_FROMDEVICE);
                } else {
-                       pci_unmap_single(nic->pdev, (dma_addr_t)
+                       pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)
                                         ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN,
                                         PCI_DMA_FROMDEVICE);
                        pci_unmap_single(nic->pdev, (dma_addr_t)
@@ -3327,7 +3352,7 @@ static void s2io_reset(nic_t * sp)
 
        /* Clear certain PCI/PCI-X fields after reset */
        if (sp->device_type == XFRAME_II_DEVICE) {
-               /* Clear parity err detect bit */
+               /* Clear "detected parity error" bit */
                pci_write_config_word(sp->pdev, PCI_STATUS, 0x8000);
 
                /* Clearing PCIX Ecc status register */
@@ -3528,7 +3553,7 @@ static void restore_xmsi_data(nic_t *nic)
        u64 val64;
        int i;
 
-       for (i=0; i< nic->avail_msix_vectors; i++) {
+       for (i=0; i < MAX_REQUESTED_MSI_X; i++) {
                writeq(nic->msix_info[i].addr, &bar0->xmsi_address);
                writeq(nic->msix_info[i].data, &bar0->xmsi_data);
                val64 = (BIT(7) | BIT(15) | vBIT(i, 26, 6));
@@ -3547,7 +3572,7 @@ static void store_xmsi_data(nic_t *nic)
        int i;
 
        /* Store and display */
-       for (i=0; i< nic->avail_msix_vectors; i++) {
+       for (i=0; i < MAX_REQUESTED_MSI_X; i++) {
                val64 = (BIT(15) | vBIT(i, 26, 6));
                writeq(val64, &bar0->xmsi_access);
                if (wait_for_msix_trans(nic, i)) {
@@ -3808,13 +3833,11 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
        TxD_t *txdp;
        TxFIFO_element_t __iomem *tx_fifo;
        unsigned long flags;
-#ifdef NETIF_F_TSO
-       int mss;
-#endif
        u16 vlan_tag = 0;
        int vlan_priority = 0;
        mac_info_t *mac_control;
        struct config_param *config;
+       int offload_type;
 
        mac_control = &sp->mac_control;
        config = &sp->config;
@@ -3862,13 +3885,11 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
                return 0;
        }
 
-       txdp->Control_1 = 0;
-       txdp->Control_2 = 0;
+       offload_type = s2io_offload_type(skb);
 #ifdef NETIF_F_TSO
-       mss = skb_shinfo(skb)->gso_size;
-       if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
+       if (offload_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
                txdp->Control_1 |= TXD_TCP_LSO_EN;
-               txdp->Control_1 |= TXD_TCP_LSO_MSS(mss);
+               txdp->Control_1 |= TXD_TCP_LSO_MSS(s2io_tcp_mss(skb));
        }
 #endif
        if (skb->ip_summed == CHECKSUM_HW) {
@@ -3886,10 +3907,10 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        frg_len = skb->len - skb->data_len;
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) {
+       if (offload_type == SKB_GSO_UDP) {
                int ufo_size;
 
-               ufo_size = skb_shinfo(skb)->gso_size;
+               ufo_size = s2io_udp_mss(skb);
                ufo_size &= ~7;
                txdp->Control_1 |= TXD_UFO_EN;
                txdp->Control_1 |= TXD_UFO_MSS(ufo_size);
@@ -3906,16 +3927,13 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
                                        sp->ufo_in_band_v,
                                        sizeof(u64), PCI_DMA_TODEVICE);
                txdp++;
-               txdp->Control_1 = 0;
-               txdp->Control_2 = 0;
        }
 
        txdp->Buffer_Pointer = pci_map_single
            (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);
        txdp->Host_Control = (unsigned long) skb;
        txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len);
-
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
+       if (offload_type == SKB_GSO_UDP)
                txdp->Control_1 |= TXD_UFO_EN;
 
        frg_cnt = skb_shinfo(skb)->nr_frags;
@@ -3930,12 +3948,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
                    (sp->pdev, frag->page, frag->page_offset,
                     frag->size, PCI_DMA_TODEVICE);
                txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
-               if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
+               if (offload_type == SKB_GSO_UDP)
                        txdp->Control_1 |= TXD_UFO_EN;
        }
        txdp->Control_1 |= TXD_GATHER_CODE_LAST;
 
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
+       if (offload_type == SKB_GSO_UDP)
                frg_cnt++; /* as Txd0 was used for inband header */
 
        tx_fifo = mac_control->tx_FIFO_start[queue];
@@ -3944,13 +3962,9 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
 
        val64 = (TX_FIFO_LAST_TXD_NUM(frg_cnt) | TX_FIFO_FIRST_LIST |
                 TX_FIFO_LAST_LIST);
-
-#ifdef NETIF_F_TSO
-       if (mss)
-               val64 |= TX_FIFO_SPECIAL_FUNC;
-#endif
-       if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
+       if (offload_type)
                val64 |= TX_FIFO_SPECIAL_FUNC;
+
        writeq(val64, &tx_fifo->List_Control);
 
        mmiowb();
@@ -3984,13 +3998,41 @@ s2io_alarm_handle(unsigned long data)
        mod_timer(&sp->alarm_timer, jiffies + HZ / 2);
 }
 
+static int s2io_chk_rx_buffers(nic_t *sp, int rng_n)
+{
+       int rxb_size, level;
+
+       if (!sp->lro) {
+               rxb_size = atomic_read(&sp->rx_bufs_left[rng_n]);
+               level = rx_buffer_level(sp, rxb_size, rng_n);
+
+               if ((level == PANIC) && (!TASKLET_IN_USE)) {
+                       int ret;
+                       DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__);
+                       DBG_PRINT(INTR_DBG, "PANIC levels\n");
+                       if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) {
+                               DBG_PRINT(ERR_DBG, "Out of memory in %s",
+                                         __FUNCTION__);
+                               clear_bit(0, (&sp->tasklet_status));
+                               return -1;
+                       }
+                       clear_bit(0, (&sp->tasklet_status));
+               } else if (level == LOW)
+                       tasklet_schedule(&sp->task);
+
+       } else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) {
+                       DBG_PRINT(ERR_DBG, "%s:Out of memory", sp->dev->name);
+                       DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");
+       }
+       return 0;
+}
+
 static irqreturn_t
 s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs)
 {
        struct net_device *dev = (struct net_device *) dev_id;
        nic_t *sp = dev->priv;
        int i;
-       int ret;
        mac_info_t *mac_control;
        struct config_param *config;
 
@@ -4012,35 +4054,8 @@ s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs)
         * reallocate the buffers from the interrupt handler itself,
         * else schedule a tasklet to reallocate the buffers.
         */
-       for (i = 0; i < config->rx_ring_num; i++) {
-               if (!sp->lro) {
-                       int rxb_size = atomic_read(&sp->rx_bufs_left[i]);
-                       int level = rx_buffer_level(sp, rxb_size, i);
-
-                       if ((level == PANIC) && (!TASKLET_IN_USE)) {
-                               DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", 
-                                                       dev->name);
-                               DBG_PRINT(INTR_DBG, "PANIC levels\n");
-                               if ((ret = fill_rx_buffers(sp, i)) == -ENOMEM) {
-                                       DBG_PRINT(ERR_DBG, "%s:Out of memory",
-                                                 dev->name);
-                                       DBG_PRINT(ERR_DBG, " in ISR!!\n");
-                                       clear_bit(0, (&sp->tasklet_status));
-                                       atomic_dec(&sp->isr_cnt);
-                                       return IRQ_HANDLED;
-                               }
-                               clear_bit(0, (&sp->tasklet_status));
-                       } else if (level == LOW) {
-                               tasklet_schedule(&sp->task);
-                       }
-               }
-               else if (fill_rx_buffers(sp, i) == -ENOMEM) {
-                               DBG_PRINT(ERR_DBG, "%s:Out of memory",
-                                                       dev->name);
-                               DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");
-                               break;
-               }
-       }
+       for (i = 0; i < config->rx_ring_num; i++)
+               s2io_chk_rx_buffers(sp, i);
 
        atomic_dec(&sp->isr_cnt);
        return IRQ_HANDLED;
@@ -4051,39 +4066,13 @@ s2io_msix_ring_handle(int irq, void *dev_id, struct pt_regs *regs)
 {
        ring_info_t *ring = (ring_info_t *)dev_id;
        nic_t *sp = ring->nic;
-       struct net_device *dev = (struct net_device *) dev_id;
-       int rxb_size, level, rng_n;
 
        atomic_inc(&sp->isr_cnt);
-       rx_intr_handler(ring);
-
-       rng_n = ring->ring_no;
-       if (!sp->lro) {
-               rxb_size = atomic_read(&sp->rx_bufs_left[rng_n]);
-               level = rx_buffer_level(sp, rxb_size, rng_n);
 
-               if ((level == PANIC) && (!TASKLET_IN_USE)) {
-                       int ret;
-                       DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__);
-                       DBG_PRINT(INTR_DBG, "PANIC levels\n");
-                       if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) {
-                               DBG_PRINT(ERR_DBG, "Out of memory in %s",
-                                         __FUNCTION__);
-                               clear_bit(0, (&sp->tasklet_status));
-                               return IRQ_HANDLED;
-                       }
-                       clear_bit(0, (&sp->tasklet_status));
-               } else if (level == LOW) {
-                       tasklet_schedule(&sp->task);
-               }
-       }
-       else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) {
-                       DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name);
-                       DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");
-       }
+       rx_intr_handler(ring);
+       s2io_chk_rx_buffers(sp, ring->ring_no);
 
        atomic_dec(&sp->isr_cnt);
-
        return IRQ_HANDLED;
 }
 
@@ -4248,37 +4237,8 @@ static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs)
         * else schedule a tasklet to reallocate the buffers.
         */
 #ifndef CONFIG_S2IO_NAPI
-       for (i = 0; i < config->rx_ring_num; i++) {
-               if (!sp->lro) {
-                       int ret;
-                       int rxb_size = atomic_read(&sp->rx_bufs_left[i]);
-                       int level = rx_buffer_level(sp, rxb_size, i);
-
-                       if ((level == PANIC) && (!TASKLET_IN_USE)) {
-                               DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", 
-                                                       dev->name);
-                               DBG_PRINT(INTR_DBG, "PANIC levels\n");
-                               if ((ret = fill_rx_buffers(sp, i)) == -ENOMEM) {
-                                       DBG_PRINT(ERR_DBG, "%s:Out of memory",
-                                                 dev->name);
-                                       DBG_PRINT(ERR_DBG, " in ISR!!\n");
-                                       clear_bit(0, (&sp->tasklet_status));
-                                       atomic_dec(&sp->isr_cnt);
-                                       writeq(org_mask, &bar0->general_int_mask);
-                                       return IRQ_HANDLED;
-                               }
-                               clear_bit(0, (&sp->tasklet_status));
-                       } else if (level == LOW) {
-                               tasklet_schedule(&sp->task);
-                       }
-               }
-               else if (fill_rx_buffers(sp, i) == -ENOMEM) {
-                               DBG_PRINT(ERR_DBG, "%s:Out of memory",
-                                                       dev->name);
-                               DBG_PRINT(ERR_DBG, " in Rx intr!!\n");
-                               break;
-               }
-       }
+       for (i = 0; i < config->rx_ring_num; i++)
+               s2io_chk_rx_buffers(sp, i);
 #endif
        writeq(org_mask, &bar0->general_int_mask);
        atomic_dec(&sp->isr_cnt);
@@ -4308,6 +4268,8 @@ static void s2io_updt_stats(nic_t *sp)
                        if (cnt == 5)
                                break; /* Updt failed */
                } while(1);
+       } else {
+               memset(sp->mac_control.stats_info, 0, sizeof(StatInfo_t));
        }
 }
 
@@ -4942,7 +4904,8 @@ static int write_eeprom(nic_t * sp, int off, u64 data, int cnt)
 }
 static void s2io_vpd_read(nic_t *nic)
 {
-       u8 vpd_data[256],data;
+       u8 *vpd_data;
+       u8 data;
        int i=0, cnt, fail = 0;
        int vpd_addr = 0x80;
 
@@ -4955,6 +4918,10 @@ static void s2io_vpd_read(nic_t *nic)
                vpd_addr = 0x50;
        }
 
+       vpd_data = kmalloc(256, GFP_KERNEL);
+       if (!vpd_data)
+               return;
+
        for (i = 0; i < 256; i +=4 ) {
                pci_write_config_byte(nic->pdev, (vpd_addr + 2), i);
                pci_read_config_byte(nic->pdev,  (vpd_addr + 2), &data);
@@ -4977,6 +4944,7 @@ static void s2io_vpd_read(nic_t *nic)
                memset(nic->product_name, 0, vpd_data[1]);
                memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
        }
+       kfree(vpd_data);
 }
 
 /**
@@ -5295,7 +5263,7 @@ static int s2io_link_test(nic_t * sp, uint64_t * data)
        else
                *data = 0;
 
-       return 0;
+       return *data;
 }
 
 /**
@@ -5753,6 +5721,19 @@ static int s2io_ethtool_op_set_tx_csum(struct net_device *dev, u32 data)
        return 0;
 }
 
+static u32 s2io_ethtool_op_get_tso(struct net_device *dev)
+{
+       return (dev->features & NETIF_F_TSO) != 0;
+}
+static int s2io_ethtool_op_set_tso(struct net_device *dev, u32 data)
+{
+       if (data)
+               dev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
+       else
+               dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
+
+       return 0;
+}
 
 static struct ethtool_ops netdev_ethtool_ops = {
        .get_settings = s2io_ethtool_gset,
@@ -5773,8 +5754,8 @@ static struct ethtool_ops netdev_ethtool_ops = {
        .get_sg = ethtool_op_get_sg,
        .set_sg = ethtool_op_set_sg,
 #ifdef NETIF_F_TSO
-       .get_tso = ethtool_op_get_tso,
-       .set_tso = ethtool_op_set_tso,
+       .get_tso = s2io_ethtool_op_get_tso,
+       .set_tso = s2io_ethtool_op_set_tso,
 #endif
        .get_ufo = ethtool_op_get_ufo,
        .set_ufo = ethtool_op_set_ufo,
@@ -6337,7 +6318,7 @@ static int s2io_card_up(nic_t * sp)
        s2io_set_multicast(dev);
 
        if (sp->lro) {
-               /* Initialize max aggregatable pkts based on MTU */
+               /* Initialize max aggregatable pkts per session based on MTU */
                sp->lro_max_aggr_per_sess = ((1<<16) - 1) / dev->mtu;
                /* Check if we can use(if specified) user provided value */
                if (lro_max_pkts < sp->lro_max_aggr_per_sess)
@@ -6438,7 +6419,7 @@ static void s2io_tx_watchdog(struct net_device *dev)
  *   @cksum : FCS checksum of the frame.
  *   @ring_no : the ring from which this RxD was extracted.
  *   Description:
- *   This function is called by the Tx interrupt serivce routine to perform
+ *   This function is called by the Rx interrupt serivce routine to perform
  *   some OS related operations on the SKB before passing it to the upper
  *   layers. It mainly checks if the checksum is OK, if so adds it to the
  *   SKBs cksum variable, increments the Rx packet count and passes the SKB
@@ -6698,33 +6679,6 @@ static void s2io_init_pci(nic_t * sp)
        pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);
 }
 
-MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@neterion.com>");
-MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);
-
-module_param(tx_fifo_num, int, 0);
-module_param(rx_ring_num, int, 0);
-module_param(rx_ring_mode, int, 0);
-module_param_array(tx_fifo_len, uint, NULL, 0);
-module_param_array(rx_ring_sz, uint, NULL, 0);
-module_param_array(rts_frm_len, uint, NULL, 0);
-module_param(use_continuous_tx_intrs, int, 1);
-module_param(rmac_pause_time, int, 0);
-module_param(mc_pause_threshold_q0q3, int, 0);
-module_param(mc_pause_threshold_q4q7, int, 0);
-module_param(shared_splits, int, 0);
-module_param(tmac_util_period, int, 0);
-module_param(rmac_util_period, int, 0);
-module_param(bimodal, bool, 0);
-module_param(l3l4hdr_size, int , 0);
-#ifndef CONFIG_S2IO_NAPI
-module_param(indicate_max_pkts, int, 0);
-#endif
-module_param(rxsync_frequency, int, 0);
-module_param(intr_type, int, 0);
-module_param(lro, int, 0);
-module_param(lro_max_pkts, int, 0);
-
 static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type)
 {
        if ( tx_fifo_num > 8) {
@@ -6832,8 +6786,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
        }
        if (dev_intr_type != MSI_X) {
                if (pci_request_regions(pdev, s2io_driver_name)) {
-                       DBG_PRINT(ERR_DBG, "Request Regions failed\n"),
-                           pci_disable_device(pdev);
+                       DBG_PRINT(ERR_DBG, "Request Regions failed\n");
+                       pci_disable_device(pdev);
                        return -ENODEV;
                }
        }
@@ -6957,7 +6911,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
        /*  initialize the shared memory used by the NIC and the host */
        if (init_shared_mem(sp)) {
                DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n",
-                         __FUNCTION__);
+                         dev->name);
                ret = -ENOMEM;
                goto mem_alloc_failed;
        }
@@ -7094,6 +7048,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
        dev->addr_len = ETH_ALEN;
        memcpy(dev->dev_addr, sp->def_mac_addr, ETH_ALEN);
 
+       /* reset Nic and bring it to known state */
+       s2io_reset(sp);
+
        /*
         * Initialize the tasklet status and link state flags
         * and the card state parameter
@@ -7131,11 +7088,11 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
                goto register_failed;
        }
        s2io_vpd_read(sp);
-       DBG_PRINT(ERR_DBG, "%s: Neterion %s",dev->name, sp->product_name);
-       DBG_PRINT(ERR_DBG, "(rev %d), Driver version %s\n",
-                               get_xena_rev_id(sp->pdev),
-                               s2io_driver_version);
        DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2005 Neterion Inc.\n");
+       DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name,
+                 sp->product_name, get_xena_rev_id(sp->pdev));
+       DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name,
+                 s2io_driver_version);
        DBG_PRINT(ERR_DBG, "%s: MAC ADDR: "
                          "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name,
                          sp->def_mac_addr[0].mac_addr[0],
@@ -7436,8 +7393,13 @@ static int verify_l3_l4_lro_capable(lro_t *l_lro, struct iphdr *ip,
        if (ip->ihl != 5) /* IP has options */
                return -1;
 
+       /* If we see CE codepoint in IP header, packet is not mergeable */
+       if (INET_ECN_is_ce(ipv4_get_dsfield(ip)))
+               return -1;
+
+       /* If we see ECE or CWR flags in TCP header, packet is not mergeable */
        if (tcp->urg || tcp->psh || tcp->rst || tcp->syn || tcp->fin ||
-                                                               !tcp->ack) {
+                                   tcp->ece || tcp->cwr || !tcp->ack) {
                /*
                 * Currently recognize only the ack control word and
                 * any other control field being set would result in
@@ -7591,18 +7553,16 @@ static void queue_rx_frame(struct sk_buff *skb)
 static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb,
                           u32 tcp_len)
 {
-       struct sk_buff *tmp, *first = lro->parent;
+       struct sk_buff *first = lro->parent;
 
        first->len += tcp_len;
        first->data_len = lro->frags_len;
        skb_pull(skb, (skb->len - tcp_len));
-       if ((tmp = skb_shinfo(first)->frag_list)) {
-               while (tmp->next)
-                       tmp = tmp->next;
-               tmp->next = skb;
-       }
+       if (skb_shinfo(first)->frag_list)
+               lro->last_frag->next = skb;
        else
                skb_shinfo(first)->frag_list = skb;
+       lro->last_frag = skb;
        sp->mac_control.stats_info->sw_stat.clubbed_frms_cnt++;
        return;
 }
index 217097bc22f159970e3a24fc05b3b43f1fd35374..5ed49c3be1e9472630055edf2398e764ecf10c51 100644 (file)
@@ -719,6 +719,7 @@ struct msix_info_st {
 /* Data structure to represent a LRO session */
 typedef struct lro {
        struct sk_buff  *parent;
+       struct sk_buff  *last_frag;
        u8              *l2h;
        struct iphdr    *iph;
        struct tcphdr   *tcph;
@@ -1011,4 +1012,13 @@ static void clear_lro_session(lro_t *lro);
 static void queue_rx_frame(struct sk_buff *skb);
 static void update_L3L4_header(nic_t *sp, lro_t *lro);
 static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb, u32 tcp_len);
+
+#define s2io_tcp_mss(skb) skb_shinfo(skb)->gso_size
+#define s2io_udp_mss(skb) skb_shinfo(skb)->gso_size
+#define s2io_offload_type(skb) skb_shinfo(skb)->gso_type
+
+#define S2IO_PARM_INT(X, def_val) \
+       static unsigned int X = def_val;\
+               module_param(X , uint, 0);
+
 #endif                         /* _S2IO_H */
index 82200bfaa8ed2bb5bef5ea7f959d1a183887f234..7de9a07b2ac2defb1c45311c21b5348952bb82f5 100644 (file)
@@ -516,10 +516,7 @@ static int skge_set_pauseparam(struct net_device *dev,
 /* Chip internal frequency for clock calculations */
 static inline u32 hwkhz(const struct skge_hw *hw)
 {
-       if (hw->chip_id == CHIP_ID_GENESIS)
-               return 53215; /* or:  53.125 MHz */
-       else
-               return 78215; /* or:  78.125 MHz */
+       return (hw->chip_id == CHIP_ID_GENESIS) ? 53125 : 78125;
 }
 
 /* Chip HZ to microseconds */
index 1ef9fd39a79a9cfc3b1dacb6235088a0c0525e5d..0e3fdf7c6dd3a8cf321a063d61876a39d58b2c1d 100644 (file)
@@ -1537,7 +1537,7 @@ static int __init sparc_lance_init(void)
 {
        if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) ||
            (idprom->id_machtype == (SM_SUN4|SM_4_470))) {
-               memset(&sun4_sdev, 0, sizeof(sdev));
+               memset(&sun4_sdev, 0, sizeof(struct sbus_dev));
                sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr;
                sun4_sdev.irqs[0] = 6;
                return sparc_lance_probe_one(&sun4_sdev, NULL, NULL);
@@ -1547,16 +1547,16 @@ static int __init sparc_lance_init(void)
 
 static int __exit sunlance_sun4_remove(void)
 {
-       struct lance_private *lp = dev_get_drvdata(&sun4_sdev->dev);
+       struct lance_private *lp = dev_get_drvdata(&sun4_sdev.ofdev.dev);
        struct net_device *net_dev = lp->dev;
 
        unregister_netdevice(net_dev);
 
-       lance_free_hwresources(root_lance_dev);
+       lance_free_hwresources(lp);
 
        free_netdev(net_dev);
 
-       dev_set_drvdata(&sun4_sdev->dev, NULL);
+       dev_set_drvdata(&sun4_sdev.ofdev.dev, NULL);
 
        return 0;
 }
index ce6f3be86da00b77e363d426eb7562c962c35121..eafabb253f08d244585e8be5e74164586c111f91 100644 (file)
@@ -68,8 +68,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.62"
-#define DRV_MODULE_RELDATE     "June 30, 2006"
+#define DRV_MODULE_VERSION     "3.65"
+#define DRV_MODULE_RELDATE     "August 07, 2006"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
                                   TG3_RX_RCB_RING_SIZE(tp))
 #define TG3_TX_RING_BYTES      (sizeof(struct tg3_tx_buffer_desc) * \
                                 TG3_TX_RING_SIZE)
-#define TX_BUFFS_AVAIL(TP)                                             \
-       ((TP)->tx_pending -                                             \
-        (((TP)->tx_prod - (TP)->tx_cons) & (TG3_TX_RING_SIZE - 1)))
 #define NEXT_TX(N)             (((N) + 1) & (TG3_TX_RING_SIZE - 1))
 
 #define RX_PKT_BUF_SZ          (1536 + tp->rx_offset + 64)
@@ -2987,6 +2984,13 @@ static void tg3_tx_recover(struct tg3 *tp)
        spin_unlock(&tp->lock);
 }
 
+static inline u32 tg3_tx_avail(struct tg3 *tp)
+{
+       smp_mb();
+       return (tp->tx_pending -
+               ((tp->tx_prod - tp->tx_cons) & (TG3_TX_RING_SIZE - 1)));
+}
+
 /* Tigon3 never reports partial packet sends.  So we do not
  * need special logic to handle SKBs that have not had all
  * of their frags sent yet, like SunGEM does.
@@ -3038,12 +3042,20 @@ static void tg3_tx(struct tg3 *tp)
 
        tp->tx_cons = sw_idx;
 
-       if (unlikely(netif_queue_stopped(tp->dev))) {
-               spin_lock(&tp->tx_lock);
+       /* Need to make the tx_cons update visible to tg3_start_xmit()
+        * before checking for netif_queue_stopped().  Without the
+        * memory barrier, there is a small possibility that tg3_start_xmit()
+        * will miss it and cause the queue to be stopped forever.
+        */
+       smp_mb();
+
+       if (unlikely(netif_queue_stopped(tp->dev) &&
+                    (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH))) {
+               netif_tx_lock(tp->dev);
                if (netif_queue_stopped(tp->dev) &&
-                   (TX_BUFFS_AVAIL(tp) > TG3_TX_WAKEUP_THRESH))
+                   (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH))
                        netif_wake_queue(tp->dev);
-               spin_unlock(&tp->tx_lock);
+               netif_tx_unlock(tp->dev);
        }
 }
 
@@ -3097,11 +3109,10 @@ static int tg3_alloc_rx_skb(struct tg3 *tp, u32 opaque_key,
         * Callers depend upon this behavior and assume that
         * we leave everything unchanged if we fail.
         */
-       skb = dev_alloc_skb(skb_size);
+       skb = netdev_alloc_skb(tp->dev, skb_size);
        if (skb == NULL)
                return -ENOMEM;
 
-       skb->dev = tp->dev;
        skb_reserve(skb, tp->rx_offset);
 
        mapping = pci_map_single(tp->pdev, skb->data,
@@ -3270,11 +3281,10 @@ static int tg3_rx(struct tg3 *tp, int budget)
                        tg3_recycle_rx(tp, opaque_key,
                                       desc_idx, *post_ptr);
 
-                       copy_skb = dev_alloc_skb(len + 2);
+                       copy_skb = netdev_alloc_skb(tp->dev, len + 2);
                        if (copy_skb == NULL)
                                goto drop_it_no_recycle;
 
-                       copy_skb->dev = tp->dev;
                        skb_reserve(copy_skb, 2);
                        skb_put(copy_skb, len);
                        pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
@@ -3590,6 +3600,28 @@ static irqreturn_t tg3_test_isr(int irq, void *dev_id,
 static int tg3_init_hw(struct tg3 *, int);
 static int tg3_halt(struct tg3 *, int, int);
 
+/* Restart hardware after configuration changes, self-test, etc.
+ * Invoked with tp->lock held.
+ */
+static int tg3_restart_hw(struct tg3 *tp, int reset_phy)
+{
+       int err;
+
+       err = tg3_init_hw(tp, reset_phy);
+       if (err) {
+               printk(KERN_ERR PFX "%s: Failed to re-initialize device, "
+                      "aborting.\n", tp->dev->name);
+               tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+               tg3_full_unlock(tp);
+               del_timer_sync(&tp->timer);
+               tp->irq_sync = 0;
+               netif_poll_enable(tp->dev);
+               dev_close(tp->dev);
+               tg3_full_lock(tp, 0);
+       }
+       return err;
+}
+
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void tg3_poll_controller(struct net_device *dev)
 {
@@ -3630,13 +3662,15 @@ static void tg3_reset_task(void *_data)
        }
 
        tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
-       tg3_init_hw(tp, 1);
+       if (tg3_init_hw(tp, 1))
+               goto out;
 
        tg3_netif_start(tp);
 
        if (restart_timer)
                mod_timer(&tp->timer, jiffies + 1);
 
+out:
        tp->tg3_flags &= ~TG3_FLAG_IN_RESET_TASK;
 
        tg3_full_unlock(tp);
@@ -3773,7 +3807,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
         * interrupt.  Furthermore, IRQ processing runs lockless so we have
         * no IRQ context deadlocks to worry about either.  Rejoice!
         */
-       if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
+       if (unlikely(tg3_tx_avail(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
                if (!netif_queue_stopped(dev)) {
                        netif_stop_queue(dev);
 
@@ -3869,12 +3903,10 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
        tw32_tx_mbox((MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW), entry);
 
        tp->tx_prod = entry;
-       if (unlikely(TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1))) {
-               spin_lock(&tp->tx_lock);
+       if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) {
                netif_stop_queue(dev);
-               if (TX_BUFFS_AVAIL(tp) > TG3_TX_WAKEUP_THRESH)
+               if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH)
                        netif_wake_queue(tp->dev);
-               spin_unlock(&tp->tx_lock);
        }
 
 out_unlock:
@@ -3896,7 +3928,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
        struct sk_buff *segs, *nskb;
 
        /* Estimate the number of fragments in the worst case */
-       if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->gso_segs * 3))) {
+       if (unlikely(tg3_tx_avail(tp) <= (skb_shinfo(skb)->gso_segs * 3))) {
                netif_stop_queue(tp->dev);
                return NETDEV_TX_BUSY;
        }
@@ -3936,7 +3968,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
         * interrupt.  Furthermore, IRQ processing runs lockless so we have
         * no IRQ context deadlocks to worry about either.  Rejoice!
         */
-       if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
+       if (unlikely(tg3_tx_avail(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
                if (!netif_queue_stopped(dev)) {
                        netif_stop_queue(dev);
 
@@ -4086,12 +4118,10 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
        tw32_tx_mbox((MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW), entry);
 
        tp->tx_prod = entry;
-       if (unlikely(TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1))) {
-               spin_lock(&tp->tx_lock);
+       if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) {
                netif_stop_queue(dev);
-               if (TX_BUFFS_AVAIL(tp) > TG3_TX_WAKEUP_THRESH)
+               if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH)
                        netif_wake_queue(tp->dev);
-               spin_unlock(&tp->tx_lock);
        }
 
 out_unlock:
@@ -4124,6 +4154,7 @@ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
 static int tg3_change_mtu(struct net_device *dev, int new_mtu)
 {
        struct tg3 *tp = netdev_priv(dev);
+       int err;
 
        if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp))
                return -EINVAL;
@@ -4144,13 +4175,14 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
 
        tg3_set_mtu(dev, tp, new_mtu);
 
-       tg3_init_hw(tp, 0);
+       err = tg3_restart_hw(tp, 0);
 
-       tg3_netif_start(tp);
+       if (!err)
+               tg3_netif_start(tp);
 
        tg3_full_unlock(tp);
 
-       return 0;
+       return err;
 }
 
 /* Free up pending packets in all rx/tx rings.
@@ -4232,7 +4264,7 @@ static void tg3_free_rings(struct tg3 *tp)
  * end up in the driver.  tp->{tx,}lock are held and thus
  * we may not sleep.
  */
-static void tg3_init_rings(struct tg3 *tp)
+static int tg3_init_rings(struct tg3 *tp)
 {
        u32 i;
 
@@ -4281,18 +4313,38 @@ static void tg3_init_rings(struct tg3 *tp)
 
        /* Now allocate fresh SKBs for each rx ring. */
        for (i = 0; i < tp->rx_pending; i++) {
-               if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_STD,
-                                    -1, i) < 0)
+               if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_STD, -1, i) < 0) {
+                       printk(KERN_WARNING PFX
+                              "%s: Using a smaller RX standard ring, "
+                              "only %d out of %d buffers were allocated "
+                              "successfully.\n",
+                              tp->dev->name, i, tp->rx_pending);
+                       if (i == 0)
+                               return -ENOMEM;
+                       tp->rx_pending = i;
                        break;
+               }
        }
 
        if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) {
                for (i = 0; i < tp->rx_jumbo_pending; i++) {
                        if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_JUMBO,
-                                            -1, i) < 0)
+                                            -1, i) < 0) {
+                               printk(KERN_WARNING PFX
+                                      "%s: Using a smaller RX jumbo ring, "
+                                      "only %d out of %d buffers were "
+                                      "allocated successfully.\n",
+                                      tp->dev->name, i, tp->rx_jumbo_pending);
+                               if (i == 0) {
+                                       tg3_free_rings(tp);
+                                       return -ENOMEM;
+                               }
+                               tp->rx_jumbo_pending = i;
                                break;
+                       }
                }
        }
+       return 0;
 }
 
 /*
@@ -5815,6 +5867,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
 {
        struct tg3 *tp = netdev_priv(dev);
        struct sockaddr *addr = p;
+       int err = 0;
 
        if (!is_valid_ether_addr(addr->sa_data))
                return -EINVAL;
@@ -5832,9 +5885,9 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
                tg3_full_lock(tp, 1);
 
                tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-               tg3_init_hw(tp, 0);
-
-               tg3_netif_start(tp);
+               err = tg3_restart_hw(tp, 0);
+               if (!err)
+                       tg3_netif_start(tp);
                tg3_full_unlock(tp);
        } else {
                spin_lock_bh(&tp->lock);
@@ -5842,7 +5895,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
                spin_unlock_bh(&tp->lock);
        }
 
-       return 0;
+       return err;
 }
 
 /* tp->lock is held. */
@@ -5942,7 +5995,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
         * can only do this after the hardware has been
         * successfully reset.
         */
-       tg3_init_rings(tp);
+       err = tg3_init_rings(tp);
+       if (err)
+               return err;
 
        /* This value is determined during the probe time DMA
         * engine test, tg3_test_dma.
@@ -7956,7 +8011,7 @@ static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *
 static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
 {
        struct tg3 *tp = netdev_priv(dev);
-       int irq_sync = 0;
+       int irq_sync = 0, err = 0;
   
        if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) ||
            (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) ||
@@ -7980,13 +8035,14 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
 
        if (netif_running(dev)) {
                tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-               tg3_init_hw(tp, 1);
-               tg3_netif_start(tp);
+               err = tg3_restart_hw(tp, 1);
+               if (!err)
+                       tg3_netif_start(tp);
        }
 
        tg3_full_unlock(tp);
   
-       return 0;
+       return err;
 }
   
 static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
@@ -8001,7 +8057,7 @@ static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam
 static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
 {
        struct tg3 *tp = netdev_priv(dev);
-       int irq_sync = 0;
+       int irq_sync = 0, err = 0;
   
        if (netif_running(dev)) {
                tg3_netif_stop(tp);
@@ -8025,13 +8081,14 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
 
        if (netif_running(dev)) {
                tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-               tg3_init_hw(tp, 1);
-               tg3_netif_start(tp);
+               err = tg3_restart_hw(tp, 1);
+               if (!err)
+                       tg3_netif_start(tp);
        }
 
        tg3_full_unlock(tp);
   
-       return 0;
+       return err;
 }
   
 static u32 tg3_get_rx_csum(struct net_device *dev)
@@ -8567,7 +8624,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
        err = -EIO;
 
        tx_len = 1514;
-       skb = dev_alloc_skb(tx_len);
+       skb = netdev_alloc_skb(tp->dev, tx_len);
        if (!skb)
                return -ENOMEM;
 
@@ -8666,7 +8723,9 @@ static int tg3_test_loopback(struct tg3 *tp)
        if (!netif_running(tp->dev))
                return TG3_LOOPBACK_FAILED;
 
-       tg3_reset_hw(tp, 1);
+       err = tg3_reset_hw(tp, 1);
+       if (err)
+               return TG3_LOOPBACK_FAILED;
 
        if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
                err |= TG3_MAC_LOOPBACK_FAILED;
@@ -8740,8 +8799,8 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
                tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
                if (netif_running(dev)) {
                        tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
-                       tg3_init_hw(tp, 1);
-                       tg3_netif_start(tp);
+                       if (!tg3_restart_hw(tp, 1))
+                               tg3_netif_start(tp);
                }
 
                tg3_full_unlock(tp);
@@ -11421,7 +11480,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
        tp->grc_mode |= GRC_MODE_BSWAP_NONFRM_DATA;
 #endif
        spin_lock_init(&tp->lock);
-       spin_lock_init(&tp->tx_lock);
        spin_lock_init(&tp->indirect_lock);
        INIT_WORK(&tp->reset_task, tg3_reset_task, tp);
 
@@ -11699,7 +11757,8 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
                tg3_full_lock(tp, 0);
 
                tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
-               tg3_init_hw(tp, 1);
+               if (tg3_restart_hw(tp, 1))
+                       goto out;
 
                tp->timer.expires = jiffies + tp->timer_offset;
                add_timer(&tp->timer);
@@ -11707,6 +11766,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
                netif_device_attach(dev);
                tg3_netif_start(tp);
 
+out:
                tg3_full_unlock(tp);
        }
 
@@ -11733,16 +11793,19 @@ static int tg3_resume(struct pci_dev *pdev)
        tg3_full_lock(tp, 0);
 
        tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
-       tg3_init_hw(tp, 1);
+       err = tg3_restart_hw(tp, 1);
+       if (err)
+               goto out;
 
        tp->timer.expires = jiffies + tp->timer_offset;
        add_timer(&tp->timer);
 
        tg3_netif_start(tp);
 
+out:
        tg3_full_unlock(tp);
 
-       return 0;
+       return err;
 }
 
 static struct pci_driver tg3_driver = {
index ba2c98711c88dc9d524f35204652e823b9d4c177..3ecf356cfb082e17cc17875aec9eaf0c7e5b3cbb 100644 (file)
@@ -2079,9 +2079,9 @@ struct tg3 {
         * lock: Held during reset, PHY access, timer, and when
         *       updating tg3_flags and tg3_flags2.
         *
-        * tx_lock: Held during tg3_start_xmit and tg3_tx only
-        *          when calling netif_[start|stop]_queue.
-        *          tg3_start_xmit is protected by netif_tx_lock.
+        * netif_tx_lock: Held during tg3_start_xmit. tg3_tx holds
+        *                netif_tx_lock when it needs to call
+        *                netif_wake_queue.
         *
         * Both of these locks are to be held with BH safety.
         *
@@ -2118,8 +2118,6 @@ struct tg3 {
        u32                             tx_cons;
        u32                             tx_pending;
 
-       spinlock_t                      tx_lock;
-
        struct tg3_tx_buffer_desc       *tx_ring;
        struct tx_ring_info             *tx_buffers;
        dma_addr_t                      tx_desc_mapping;
index f5b0078eb4adf471ca0397d55fe165bf7d6503f3..aa9cd92f46b2dbbb51716416acd4f26d503aca1c 100644 (file)
@@ -2742,7 +2742,7 @@ static u32 check_connection_type(struct mac_regs __iomem * regs)
 
        if (PHYSR0 & PHYSR0_SPDG)
                status |= VELOCITY_SPEED_1000;
-       if (PHYSR0 & PHYSR0_SPD10)
+       else if (PHYSR0 & PHYSR0_SPD10)
                status |= VELOCITY_SPEED_10;
        else
                status |= VELOCITY_SPEED_100;
@@ -2851,8 +2851,17 @@ static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd
        u32 status;
        status = check_connection_type(vptr->mac_regs);
 
-       cmd->supported = SUPPORTED_TP | SUPPORTED_Autoneg | SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full;
-       if (status & VELOCITY_SPEED_100)
+       cmd->supported = SUPPORTED_TP |
+                       SUPPORTED_Autoneg |
+                       SUPPORTED_10baseT_Half |
+                       SUPPORTED_10baseT_Full |
+                       SUPPORTED_100baseT_Half |
+                       SUPPORTED_100baseT_Full |
+                       SUPPORTED_1000baseT_Half |
+                       SUPPORTED_1000baseT_Full;
+       if (status & VELOCITY_SPEED_1000)
+               cmd->speed = SPEED_1000;
+       else if (status & VELOCITY_SPEED_100)
                cmd->speed = SPEED_100;
        else
                cmd->speed = SPEED_10;
@@ -2896,7 +2905,7 @@ static u32 velocity_get_link(struct net_device *dev)
 {
        struct velocity_info *vptr = netdev_priv(dev);
        struct mac_regs __iomem * regs = vptr->mac_regs;
-       return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0)  ? 0 : 1;
+       return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 1 : 0;
 }
 
 static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
index fa9d2c4edc93eeda6fe7520036d228f6df0c7c9e..2e8ac995d56f0b404a98ed4f24e9b2cc549750c5 100644 (file)
@@ -447,6 +447,7 @@ config AIRO_CS
        tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards"
        depends on NET_RADIO && PCMCIA && (BROKEN || !M32R)
        select CRYPTO
+       select CRYPTO_AES
        ---help---
          This is the standard Linux driver to support Cisco/Aironet PCMCIA
          802.11 wireless cards.  This driver is the same as the Aironet
index 3889f79e7128b1e5ab0bc1566d3d936c9c394395..df317c1e12a89df16d84ce861ffac7d302cea8ad 100644 (file)
@@ -3701,7 +3701,7 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev,
        }
        if (sec->flags & SEC_AUTH_MODE) {
                secinfo->auth_mode = sec->auth_mode;
-               dprintk(", .auth_mode = %d\n", sec->auth_mode);
+               dprintk(", .auth_mode = %d", sec->auth_mode);
        }
        dprintk("\n");
        if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED &&
index d6ed5781b93a8cf6ffce52cabd4ba3e01847acc5..317ace7f9aae3af7191323c45953f9416875ed3b 100644 (file)
@@ -2875,7 +2875,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
        if (orinoco_lock(priv, &flags) != 0)
                return -EBUSY;
 
-       if (erq->pointer) {
+       if (erq->length > 0) {
                if ((index < 0) || (index >= ORINOCO_MAX_KEYS))
                        index = priv->tx_key;
 
@@ -2918,7 +2918,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
        if (erq->flags & IW_ENCODE_RESTRICTED)
                restricted = 1;
 
-       if (erq->pointer) {
+       if (erq->pointer && erq->length > 0) {
                priv->keys[index].len = cpu_to_le16(xlen);
                memset(priv->keys[index].data, 0,
                       sizeof(priv->keys[index].data));
index 662ecc8a33ff9f6559a32c8dff38d25ff5b793ad..c52e9bcf8d02f3fc688de9d7f1c17c49b51c9288 100644 (file)
@@ -1820,6 +1820,8 @@ static int zd1201_probe(struct usb_interface *interface,
            zd->dev->name);
 
        usb_set_intfdata(interface, zd);
+       zd1201_enable(zd);      /* zd1201 likes to startup enabled, */
+       zd1201_disable(zd);     /* interfering with all the wifis in range */
        return 0;
 
 err_net:
index efc9c4bd826f06e3dadb785827775c1db193663b..da9d06bdb818a22089f623650e094a8e74c63b53 100644 (file)
@@ -797,7 +797,7 @@ static int zd1211_hw_init_hmac(struct zd_chip *chip)
                { CR_ADDA_MBIAS_WARMTIME,       0x30000808 },
                { CR_ZD1211_RETRY_MAX,          0x2 },
                { CR_SNIFFER_ON,                0 },
-               { CR_RX_FILTER,                 AP_RX_FILTER },
+               { CR_RX_FILTER,                 STA_RX_FILTER },
                { CR_GROUP_HASH_P1,             0x00 },
                { CR_GROUP_HASH_P2,             0x80000000 },
                { CR_REG1,                      0xa4 },
@@ -844,7 +844,7 @@ static int zd1211b_hw_init_hmac(struct zd_chip *chip)
                { CR_ZD1211B_AIFS_CTL2,         0x008C003C },
                { CR_ZD1211B_TXOP,              0x01800824 },
                { CR_SNIFFER_ON,                0 },
-               { CR_RX_FILTER,                 AP_RX_FILTER },
+               { CR_RX_FILTER,                 STA_RX_FILTER },
                { CR_GROUP_HASH_P1,             0x00 },
                { CR_GROUP_HASH_P2,             0x80000000 },
                { CR_REG1,                      0xa4 },
index 805121093ab596962c281a677174a3b18406cdb7..069d2b467339828d1213748cd591b4c3f0aa49a0 100644 (file)
 
 #define CR_RX_FILTER                   CTL_REG(0x068c)
 #define RX_FILTER_ASSOC_RESPONSE       0x0002
+#define RX_FILTER_REASSOC_RESPONSE     0x0008
 #define RX_FILTER_PROBE_RESPONSE       0x0020
 #define RX_FILTER_BEACON               0x0100
+#define RX_FILTER_DISASSOC             0x0400
 #define RX_FILTER_AUTH                 0x0800
-/* Sniff modus sets filter to 0xfffff */
+#define AP_RX_FILTER                   0x0400feff
+#define STA_RX_FILTER                  0x0000ffff
+
+/* Monitor mode sets filter to 0xfffff */
 
 #define CR_ACK_TIMEOUT_EXT             CTL_REG(0x0690)
 #define CR_BCN_FIFO_SEMAPHORE          CTL_REG(0x0694)
 #define CR_ZD1211B_TXOP                        CTL_REG(0x0b20)
 #define CR_ZD1211B_RETRY_MAX           CTL_REG(0x0b28)
 
-#define AP_RX_FILTER                   0x0400feff
-#define STA_RX_FILTER                  0x0000ffff
-
 #define CWIN_SIZE                      0x007f043f
 
 
index 3bdc54d128d0613cb5ead20e81a1b642b4f0efd4..d6f3e02a0b54e5925e67b08a3039ffdcb9136ccc 100644 (file)
@@ -108,7 +108,9 @@ int zd_mac_init_hw(struct zd_mac *mac, u8 device_type)
        if (r)
                goto disable_int;
 
-       r = zd_set_encryption_type(chip, NO_WEP);
+       /* We must inform the device that we are doing encryption/decryption in
+        * software at the moment. */
+       r = zd_set_encryption_type(chip, ENC_SNIFFER);
        if (r)
                goto disable_int;
 
@@ -136,10 +138,8 @@ static int reset_mode(struct zd_mac *mac)
 {
        struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
        struct zd_ioreq32 ioreqs[3] = {
-               { CR_RX_FILTER, RX_FILTER_BEACON|RX_FILTER_PROBE_RESPONSE|
-                               RX_FILTER_AUTH|RX_FILTER_ASSOC_RESPONSE },
+               { CR_RX_FILTER, STA_RX_FILTER },
                { CR_SNIFFER_ON, 0U },
-               { CR_ENCRYPTION_TYPE, NO_WEP },
        };
 
        if (ieee->iw_mode == IW_MODE_MONITOR) {
@@ -713,10 +713,10 @@ static int zd_mac_tx(struct zd_mac *mac, struct ieee80211_txb *txb, int pri)
 struct zd_rt_hdr {
        struct ieee80211_radiotap_header rt_hdr;
        u8  rt_flags;
+       u8  rt_rate;
        u16 rt_channel;
        u16 rt_chbitmask;
-       u16 rt_rate;
-};
+} __attribute__((packed));
 
 static void fill_rt_header(void *buffer, struct zd_mac *mac,
                           const struct ieee80211_rx_stats *stats,
@@ -735,14 +735,14 @@ static void fill_rt_header(void *buffer, struct zd_mac *mac,
        if (status->decryption_type & (ZD_RX_WEP64|ZD_RX_WEP128|ZD_RX_WEP256))
                hdr->rt_flags |= IEEE80211_RADIOTAP_F_WEP;
 
+       hdr->rt_rate = stats->rate / 5;
+
        /* FIXME: 802.11a */
        hdr->rt_channel = cpu_to_le16(ieee80211chan2mhz(
                                             _zd_chip_get_channel(&mac->chip)));
        hdr->rt_chbitmask = cpu_to_le16(IEEE80211_CHAN_2GHZ |
                ((status->frame_status & ZD_RX_FRAME_MODULATION_MASK) ==
                ZD_RX_OFDM ? IEEE80211_CHAN_OFDM : IEEE80211_CHAN_CCK));
-
-       hdr->rt_rate = stats->rate / 5;
 }
 
 /* Returns 1 if the data packet is for us and 0 otherwise. */
index 72f90525bf681a00b724ed171ee0ba708dc2e9c9..6320984126c73adf63acf2cd55aee078b4f6f7da 100644 (file)
@@ -323,7 +323,6 @@ static void disable_read_regs_int(struct zd_usb *usb)
 {
        struct zd_usb_interrupt *intr = &usb->intr;
 
-       ZD_ASSERT(in_interrupt());
        spin_lock(&intr->lock);
        intr->read_regs_enabled = 0;
        spin_unlock(&intr->lock);
@@ -545,11 +544,11 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
         * be padded. Unaligned access might also happen if the length_info
         * structure is not present.
         */
-       if (get_unaligned(&length_info->tag) == RX_LENGTH_INFO_TAG) {
+       if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG))
+       {
                unsigned int l, k, n;
                for (i = 0, l = 0;; i++) {
-                       k = le16_to_cpu(get_unaligned(
-                               &length_info->length[i]));
+                       k = le16_to_cpu(get_unaligned(&length_info->length[i]));
                        n = l+k;
                        if (n > length)
                                return;
index 3fae77ffb2fac79d0029ed062114d0293c8dbaf5..8a60f391ffcf4176116d9297f9fbe14c8b42692b 100644 (file)
@@ -76,7 +76,7 @@ config HOTPLUG_PCI_IBM
 
 config HOTPLUG_PCI_ACPI
        tristate "ACPI PCI Hotplug driver"
-       depends on ACPI_DOCK && HOTPLUG_PCI
+       depends on (!ACPI_DOCK && ACPI && HOTPLUG_PCI) || (ACPI_DOCK && HOTPLUG_PCI)
        help
          Say Y here if you have a system that supports PCI Hotplug using
          ACPI.
@@ -153,13 +153,6 @@ config HOTPLUG_PCI_SHPC_POLL_EVENT_MODE
 
          When in doubt, say N.
 
-config HOTPLUG_PCI_SHPC_PHPRM_LEGACY
-       bool "For AMD SHPC only: Use $HRT for resource/configuration"
-       depends on HOTPLUG_PCI_SHPC && !ACPI 
-       help
-         Say Y here for AMD SHPC. You have to select this option if you are 
-         using this driver on platform with AMD SHPC.
-
 config HOTPLUG_PCI_RPA
        tristate "RPA PCI Hotplug driver"
        depends on HOTPLUG_PCI && PPC_PSERIES && PPC64 && !HOTPLUG_PCI_FAKE
index 34de5697983db4f867cc7fd57ecc28f544f2b890..e2fef60c2d06133818c413e2d37db98617e320d9 100644 (file)
@@ -27,8 +27,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <gregkh@us.ibm.com>,
- *                 <t-kochi@bq.jp.nec.com>
+ * Send feedback to <kristen.c.accardi@intel.com>
  *
  */
 
index ef95d12fb32c6beca0fc0b1e6f0c645f8ad9b6dd..ae67a8f55ba169851ad7c78bf1cdd83c7c67f047 100644 (file)
@@ -26,7 +26,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <t-kochi@bq.jp.nec.com>
+ * Send feedback to <kristen.c.accardi@intel.com>
  *
  */
 
index ce89f5815861ed4a9a4c8a9f0502f8514ff7194d..eaea9d36a1bb2096104372b751decf81163efad7 100644 (file)
@@ -279,6 +279,11 @@ struct hpc_ops {
 
 
 #ifdef CONFIG_ACPI
+#include <acpi/acpi.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/actypes.h>
+#include <linux/pci-acpi.h>
+
 #define pciehp_get_hp_hw_control_from_firmware(dev) \
        pciehp_acpi_get_hp_hw_control_from_firmware(dev)
 static inline int pciehp_get_hp_params_from_firmware(struct pci_dev *dev,
index 0d8fb6e607a1dd38a6f43c47ae650a3337fa6c78..6ab3b6cd2b54095fe3d1bdda65440b4e7c7129db 100644 (file)
 
 #include "../pci.h"
 #include "pciehp.h"
-#include <acpi/acpi.h>
-#include <acpi/acpi_bus.h>
-#include <acpi/actypes.h>
-#include <linux/pci-acpi.h>
 #ifdef DEBUG
 #define DBG_K_TRACE_ENTRY      ((unsigned int)0x00000001)      /* On function entry */
 #define DBG_K_TRACE_EXIT       ((unsigned int)0x00000002)      /* On function exit */
index 50bfc1b2f3bf56c0461532640b4437bc3c53c4ec..478d0d28f7ad1e6b573e5e3c3a26f37b9dc1e557 100644 (file)
@@ -30,23 +30,6 @@ MODULE_LICENSE("GPL");
 /* global data */
 static const char device_name[] = "pcieport-driver";
 
-static int pcie_portdrv_save_config(struct pci_dev *dev)
-{
-       return pci_save_state(dev);
-}
-
-static int pcie_portdrv_restore_config(struct pci_dev *dev)
-{
-       int retval;
-
-       pci_restore_state(dev);
-       retval = pci_enable_device(dev);
-       if (retval)
-               return retval;
-       pci_set_master(dev);
-       return 0;
-}
-
 /*
  * pcie_portdrv_probe - Probe PCI-Express port devices
  * @dev: PCI-Express port device being probed
@@ -73,8 +56,10 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
                "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", 
                __FUNCTION__, dev->device, dev->vendor);
        }
-       if (pcie_port_device_register(dev)) 
+       if (pcie_port_device_register(dev)) {
+               pci_disable_device(dev);
                return -ENOMEM;
+       }
 
        return 0;
 }
@@ -86,6 +71,23 @@ static void pcie_portdrv_remove (struct pci_dev *dev)
 }
 
 #ifdef CONFIG_PM
+static int pcie_portdrv_save_config(struct pci_dev *dev)
+{
+       return pci_save_state(dev);
+}
+
+static int pcie_portdrv_restore_config(struct pci_dev *dev)
+{
+       int retval;
+
+       pci_restore_state(dev);
+       retval = pci_enable_device(dev);
+       if (retval)
+               return retval;
+       pci_set_master(dev);
+       return 0;
+}
+
 static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state)
 {
        int ret = pcie_port_device_suspend(dev, state);
index 5ca1e94887be1bc0bda3e8e84c92870853938fd0..04618d4d7d74a2becb82d597ba936f3baa9bbb30 100644 (file)
@@ -990,6 +990,11 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
                        case 0x8070: /* P4G8X Deluxe */
                                asus_hides_smbus = 1;
                        }
+               if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH)
+                       switch (dev->subsystem_device) {
+                       case 0x80c9: /* PU-DLS */
+                               asus_hides_smbus = 1;
+                       }
                if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB)
                        switch (dev->subsystem_device) {
                        case 0x1751: /* M2N notebook */
@@ -1058,6 +1063,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,     PCI_DEVICE_ID_INTEL_82845G_HB,  asu
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82850_HB,   asus_hides_smbus_hostbridge );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82865_HB,   asus_hides_smbus_hostbridge );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_7205_0,     asus_hides_smbus_hostbridge );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_E7501_MCH,  asus_hides_smbus_hostbridge );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge );
@@ -1081,6 +1087,7 @@ static void __init asus_hides_smbus_lpc(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82801DB_0,  asus_hides_smbus_lpc );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82801BA_0,  asus_hides_smbus_lpc );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82801CA_0,  asus_hides_smbus_lpc );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82801EB_0,  asus_hides_smbus_lpc );
index 622b3f8ba820d25e9f6bbcf1b1d83eb9eb60a765..d529462d1b53e6b8083aab301eca87f02ebac35a 100644 (file)
@@ -41,7 +41,7 @@ pci_do_find_bus(struct pci_bus* bus, unsigned char busnr)
  * in the global list of PCI buses.  If the bus is found, a pointer to its
  * data structure is returned.  If no bus is found, %NULL is returned.
  */
-struct pci_bus * __devinit pci_find_bus(int domain, int busnr)
+struct pci_bus * pci_find_bus(int domain, int busnr)
 {
        struct pci_bus *bus = NULL;
        struct pci_bus *tmp_bus;
@@ -61,7 +61,7 @@ struct pci_bus * __devinit pci_find_bus(int domain, int busnr)
  * @from: Previous PCI bus found, or %NULL for new search.
  *
  * Iterates through the list of known PCI busses.  A new search is
- * initiated by passing %NULL to the @from argument.  Otherwise if
+ * initiated by passing %NULL as the @from argument.  Otherwise if
  * @from is not %NULL, searches continue from next device on the
  * global list.
  */
@@ -148,13 +148,14 @@ struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn)
  * @from: Previous PCI device found in search, or %NULL for new search.
  *
  * Iterates through the list of known PCI devices.  If a PCI device is
- * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its
- * device structure is returned.  Otherwise, %NULL is returned.
- * A new search is initiated by passing %NULL to the @from argument.
- * Otherwise if @from is not %NULL, searches continue from next device on the global list.
+ * found with a matching @vendor, @device, @ss_vendor and @ss_device, a
+ * pointer to its device structure is returned.  Otherwise, %NULL is returned.
+ * A new search is initiated by passing %NULL as the @from argument.
+ * Otherwise if @from is not %NULL, searches continue from next device
+ * on the global list.
  *
- * NOTE: Do not use this function anymore, use pci_get_subsys() instead, as
- * the pci device returned by this function can disappear at any moment in
+ * NOTE: Do not use this function any more; use pci_get_subsys() instead, as
+ * the PCI device returned by this function can disappear at any moment in
  * time.
  */
 static struct pci_dev * pci_find_subsys(unsigned int vendor,
@@ -191,14 +192,15 @@ exit:
  * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
  * @from: Previous PCI device found in search, or %NULL for new search.
  *
- * Iterates through the list of known PCI devices.  If a PCI device is
- * found with a matching @vendor and @device, a pointer to its device structure is
+ * Iterates through the list of known PCI devices.  If a PCI device is found
+ * with a matching @vendor and @device, a pointer to its device structure is
  * returned.  Otherwise, %NULL is returned.
- * A new search is initiated by passing %NULL to the @from argument.
- * Otherwise if @from is not %NULL, searches continue from next device on the global list.
+ * A new search is initiated by passing %NULL as the @from argument.
+ * Otherwise if @from is not %NULL, searches continue from next device
+ * on the global list.
  * 
- * NOTE: Do not use this function anymore, use pci_get_device() instead, as
- * the pci device returned by this function can disappear at any moment in
+ * NOTE: Do not use this function any more; use pci_get_device() instead, as
+ * the PCI device returned by this function can disappear at any moment in
  * time.
  */
 struct pci_dev *
@@ -215,11 +217,11 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
  * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all device ids
  * @from: Previous PCI device found in search, or %NULL for new search.
  *
- * Iterates through the list of known PCI devices.  If a PCI device is
- * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its
+ * Iterates through the list of known PCI devices.  If a PCI device is found
+ * with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its
  * device structure is returned, and the reference count to the device is
  * incremented.  Otherwise, %NULL is returned.  A new search is initiated by
- * passing %NULL to the @from argument.  Otherwise if @from is not %NULL,
+ * passing %NULL as the @from argument.  Otherwise if @from is not %NULL,
  * searches continue from next device on the global list.
  * The reference count for @from is always decremented if it is not %NULL.
  */
@@ -262,7 +264,7 @@ exit:
  * found with a matching @vendor and @device, the reference count to the
  * device is incremented and a pointer to its device structure is returned.
  * Otherwise, %NULL is returned.  A new search is initiated by passing %NULL
- * to the @from argument.  Otherwise if @from is not %NULL, searches continue
+ * as the @from argument.  Otherwise if @from is not %NULL, searches continue
  * from next device on the global list.  The reference count for @from is
  * always decremented if it is not %NULL.
  */
@@ -279,11 +281,13 @@ pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from)
  * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
  * @from: Previous PCI device found in search, or %NULL for new search.
  *
- * Iterates through the list of known PCI devices in the reverse order of pci_find_device().
+ * Iterates through the list of known PCI devices in the reverse order of
+ * pci_find_device().
  * If a PCI device is found with a matching @vendor and @device, a pointer to
  * its device structure is returned.  Otherwise, %NULL is returned.
- * A new search is initiated by passing %NULL to the @from argument.
- * Otherwise if @from is not %NULL, searches continue from previous device on the global list.
+ * A new search is initiated by passing %NULL as the @from argument.
+ * Otherwise if @from is not %NULL, searches continue from previous device
+ * on the global list.
  */
 struct pci_dev *
 pci_find_device_reverse(unsigned int vendor, unsigned int device, const struct pci_dev *from)
@@ -317,7 +321,7 @@ exit:
  * found with a matching @class, the reference count to the device is
  * incremented and a pointer to its device structure is returned.
  * Otherwise, %NULL is returned.
- * A new search is initiated by passing %NULL to the @from argument.
+ * A new search is initiated by passing %NULL as the @from argument.
  * Otherwise if @from is not %NULL, searches continue from next device
  * on the global list.  The reference count for @from is always decremented
  * if it is not %NULL.
index 738b1ef595a3506fd595f9f742da4c6f966b7e47..9ad18e62658d6da302f70290027410eaace11c7d 100644 (file)
@@ -601,12 +601,8 @@ static int ds_ioctl(struct inode * inode, struct file * file,
            ret = CS_BAD_ARGS;
        else {
            struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function);
-           if (p_dev == NULL)
-                   ret = CS_BAD_ARGS;
-           else {
-                   ret = pccard_get_configuration_info(s, p_dev, &buf->config);
-                   pcmcia_put_dev(p_dev);
-           }
+           ret = pccard_get_configuration_info(s, p_dev, &buf->config);
+           pcmcia_put_dev(p_dev);
        }
        break;
     case DS_GET_FIRST_TUPLE:
@@ -636,12 +632,8 @@ static int ds_ioctl(struct inode * inode, struct file * file,
                    ret = CS_BAD_ARGS;
            else {
                    struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function);
-                   if (p_dev == NULL)
-                           ret = CS_BAD_ARGS;
-                   else {
-                           ret = pccard_get_status(s, p_dev, &buf->status);
-                           pcmcia_put_dev(p_dev);
-                   }
+                   ret = pccard_get_status(s, p_dev, &buf->status);
+                   pcmcia_put_dev(p_dev);
            }
            break;
     case DS_VALIDATE_CIS:
index 7bf25b88ea314ffdc730d5fef834232aa1116980..c8323399e9e4d03ec0b9cced174a8834b9b60e4a 100644 (file)
@@ -245,10 +245,17 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
                return CS_SUCCESS;
        }
 
-       /* !!! This is a hack !!! */
-       memcpy(&config->Attributes, &c->Attributes, sizeof(config_t));
-       config->Attributes |= CONF_VALID_CLIENT;
-       config->CardValues = c->CardValues;
+       config->Attributes = c->Attributes | CONF_VALID_CLIENT;
+       config->Vcc = s->socket.Vcc;
+       config->Vpp1 = config->Vpp2 = s->socket.Vpp;
+       config->IntType = c->IntType;
+       config->ConfigBase = c->ConfigBase;
+       config->Status = c->Status;
+       config->Pin = c->Pin;
+       config->Copy = c->Copy;
+       config->Option = c->Option;
+       config->ExtStatus = c->ExtStatus;
+       config->Present = config->CardValues = c->CardValues;
        config->IRQAttributes = c->irq.Attributes;
        config->AssignedIRQ = s->irq.AssignedIRQ;
        config->BasePort1 = c->io.BasePort1;
index 3163e3d73da13c1d6f58beecd6271a36f1bcb2e1..9d8b415eca79ba729e0104d1a4af1e7f185123ef 100644 (file)
@@ -265,8 +265,8 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                                pnp_printf(buffer," disabled\n");
                        else
                                pnp_printf(buffer," 0x%llx-0x%llx\n",
-                                               pnp_port_start(dev, i),
-                                               pnp_port_end(dev, i));
+                                       (unsigned long long)pnp_port_start(dev, i),
+                                       (unsigned long long)pnp_port_end(dev, i));
                }
        }
        for (i = 0; i < PNP_MAX_MEM; i++) {
@@ -276,8 +276,8 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                                pnp_printf(buffer," disabled\n");
                        else
                                pnp_printf(buffer," 0x%llx-0x%llx\n",
-                                               pnp_mem_start(dev, i),
-                                               pnp_mem_end(dev, i));
+                                       (unsigned long long)pnp_mem_start(dev, i),
+                                       (unsigned long long)pnp_mem_end(dev, i));
                }
        }
        for (i = 0; i < PNP_MAX_IRQ; i++) {
@@ -287,7 +287,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                                pnp_printf(buffer," disabled\n");
                        else
                                pnp_printf(buffer," %lld\n",
-                                               pnp_irq(dev, i));
+                                       (unsigned long long)pnp_irq(dev, i));
                }
        }
        for (i = 0; i < PNP_MAX_DMA; i++) {
@@ -297,7 +297,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                                pnp_printf(buffer," disabled\n");
                        else
                                pnp_printf(buffer," %lld\n",
-                                               pnp_dma(dev, i));
+                                       (unsigned long long)pnp_dma(dev, i));
                }
        }
        ret = (buffer->curr - buf);
index 21226888185789f24d112b32ab78d1b76e63d458..dc79b0a0059f6206c22dd6a611c591d62b83aa7a 100644 (file)
@@ -173,6 +173,9 @@ pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table,
                return;
        }
 
+       if (p->producer_consumer == ACPI_PRODUCER)
+               return;
+
        if (p->resource_type == ACPI_MEMORY_RANGE)
                pnpacpi_parse_allocated_memresource(res_table,
                                p->minimum, p->address_length);
@@ -252,9 +255,14 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
                break;
 
        case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
+               if (res->data.ext_address64.producer_consumer == ACPI_PRODUCER)
+                       return AE_OK;
                break;
 
        case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+               if (res->data.extended_irq.producer_consumer == ACPI_PRODUCER)
+                       return AE_OK;
+
                for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {
                        pnpacpi_parse_allocated_irqresource(res_table,
                                res->data.extended_irq.interrupts[i],
index b154b3f52cbe3cadcdf73f7e2a1a2a23f137ea34..551f58e298106060b5708cb288d04c8c7da39043 100644 (file)
@@ -346,7 +346,7 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node)
        dev->flags = node->flags;
        if (!(dev->flags & PNPBIOS_NO_CONFIG))
                dev->capabilities |= PNP_CONFIGURABLE;
-       if (!(dev->flags & PNPBIOS_NO_DISABLE))
+       if (!(dev->flags & PNPBIOS_NO_DISABLE) && pnpbios_is_dynamic(dev))
                dev->capabilities |= PNP_DISABLE;
        dev->capabilities |= PNP_READ;
        if (pnpbios_is_dynamic(dev))
index 4bf03fb67f8d46320e72a068e84aa4230a53d017..d8e9b95f0a1a374875c9574cb99af5b0ef5e4968 100644 (file)
@@ -1730,8 +1730,8 @@ dasd_flush_request_queue(struct dasd_device * device)
                req = elv_next_request(device->request_queue);
                if (req == NULL)
                        break;
-               dasd_end_request(req, 0);
                blkdev_dequeue_request(req);
+               dasd_end_request(req, 0);
        }
        spin_unlock_irq(&device->request_queue_lock);
 }
index 7f6fdac747068c84a22014b34ffa619643041d4e..9d0c6e1a0e664a87beb7764eb32653ff8c1614fc 100644 (file)
@@ -48,18 +48,20 @@ struct dasd_devmap {
 };
 
 /*
- * dasd_servermap is used to store the server_id of all storage servers
- * accessed by DASD device driver.
+ * dasd_server_ssid_map contains a globally unique storage server subsystem ID.
+ * dasd_server_ssid_list contains the list of all subsystem IDs accessed by
+ * the DASD device driver.
  */
-struct dasd_servermap {
+struct dasd_server_ssid_map {
        struct list_head list;
        struct server_id {
                char vendor[4];
                char serial[15];
        } sid;
+       __u16 ssid;
 };
 
-static struct list_head dasd_serverlist;
+static struct list_head dasd_server_ssid_list;
 
 /*
  * Parameter parsing functions for dasd= parameter. The syntax is:
@@ -89,7 +91,7 @@ static char *dasd[256];
 module_param_array(dasd, charp, NULL, 0);
 
 /*
- * Single spinlock to protect devmap structures and lists.
+ * Single spinlock to protect devmap and servermap structures and lists.
  */
 static DEFINE_SPINLOCK(dasd_devmap_lock);
 
@@ -264,8 +266,9 @@ dasd_parse_keyword( char *parsestring ) {
                if (dasd_page_cache)
                        return residual_str;
                dasd_page_cache =
-                       kmem_cache_create("dasd_page_cache", PAGE_SIZE, 0,
-                                         SLAB_CACHE_DMA, NULL, NULL );
+                       kmem_cache_create("dasd_page_cache", PAGE_SIZE,
+                                         PAGE_SIZE, SLAB_CACHE_DMA,
+                                         NULL, NULL );
                if (!dasd_page_cache)
                        MESSAGE(KERN_WARNING, "%s", "Failed to create slab, "
                                "fixed buffer mode disabled.");
@@ -858,39 +861,6 @@ static struct attribute_group dasd_attr_group = {
        .attrs = dasd_attrs,
 };
 
-/*
- * Check if the related storage server is already contained in the
- * dasd_serverlist. If server is not contained, create new entry.
- * Return 0 if server was already in serverlist,
- *       1 if the server was added successfully
- *      <0 in case of error.
- */
-static int
-dasd_add_server(struct dasd_uid *uid)
-{
-       struct dasd_servermap *new, *tmp;
-
-       /* check if server is already contained */
-       list_for_each_entry(tmp, &dasd_serverlist, list)
-         // normale cmp?
-               if (strncmp(tmp->sid.vendor, uid->vendor,
-                           sizeof(tmp->sid.vendor)) == 0
-                   && strncmp(tmp->sid.serial, uid->serial,
-                              sizeof(tmp->sid.serial)) == 0)
-                       return 0;
-
-       new = (struct dasd_servermap *)
-               kzalloc(sizeof(struct dasd_servermap), GFP_KERNEL);
-       if (!new)
-               return -ENOMEM;
-
-       strncpy(new->sid.vendor, uid->vendor, sizeof(new->sid.vendor));
-       strncpy(new->sid.serial, uid->serial, sizeof(new->sid.serial));
-       list_add(&new->list, &dasd_serverlist);
-       return 1;
-}
-
-
 /*
  * Return copy of the device unique identifier.
  */
@@ -910,6 +880,9 @@ dasd_get_uid(struct ccw_device *cdev, struct dasd_uid *uid)
 
 /*
  * Register the given device unique identifier into devmap struct.
+ * In addition check if the related storage server subsystem ID is already
+ * contained in the dasd_server_ssid_list. If subsystem ID is not contained,
+ * create new entry.
  * Return 0 if server was already in serverlist,
  *       1 if the server was added successful
  *      <0 in case of error.
@@ -918,16 +891,39 @@ int
 dasd_set_uid(struct ccw_device *cdev, struct dasd_uid *uid)
 {
        struct dasd_devmap *devmap;
-       int rc;
+       struct dasd_server_ssid_map *srv, *tmp;
 
        devmap = dasd_find_busid(cdev->dev.bus_id);
        if (IS_ERR(devmap))
                return PTR_ERR(devmap);
+
+       /* generate entry for server_ssid_map */
+       srv = (struct dasd_server_ssid_map *)
+               kzalloc(sizeof(struct dasd_server_ssid_map), GFP_KERNEL);
+       if (!srv)
+               return -ENOMEM;
+       strncpy(srv->sid.vendor, uid->vendor, sizeof(srv->sid.vendor) - 1);
+       strncpy(srv->sid.serial, uid->serial, sizeof(srv->sid.serial) - 1);
+       srv->ssid = uid->ssid;
+
+       /* server is already contained ? */
        spin_lock(&dasd_devmap_lock);
        devmap->uid = *uid;
-       rc = dasd_add_server(uid);
+       list_for_each_entry(tmp, &dasd_server_ssid_list, list) {
+               if (!memcmp(&srv->sid, &tmp->sid,
+                           sizeof(struct dasd_server_ssid_map))) {
+                       kfree(srv);
+                       srv = NULL;
+                       break;
+               }
+       }
+
+       /* add servermap to serverlist */
+       if (srv)
+               list_add(&srv->list, &dasd_server_ssid_list);
        spin_unlock(&dasd_devmap_lock);
-       return rc;
+
+       return (srv ? 1 : 0);
 }
 EXPORT_SYMBOL_GPL(dasd_set_uid);
 
@@ -995,7 +991,7 @@ dasd_devmap_init(void)
                INIT_LIST_HEAD(&dasd_hashlists[i]);
 
        /* Initialize servermap structure. */
-       INIT_LIST_HEAD(&dasd_serverlist);
+       INIT_LIST_HEAD(&dasd_server_ssid_list);
        return 0;
 }
 
index 39c2281371b5e75a1d7f15272e1de9ecf89f9a18..957ed5db98e4de714fb84caf485a1b88d48e362a 100644 (file)
@@ -468,11 +468,11 @@ dasd_eckd_generate_uid(struct dasd_device *device, struct dasd_uid *uid)
                return -ENODEV;
 
        memset(uid, 0, sizeof(struct dasd_uid));
-       strncpy(uid->vendor, confdata->ned1.HDA_manufacturer,
-               sizeof(uid->vendor) - 1);
+       memcpy(uid->vendor, confdata->ned1.HDA_manufacturer,
+              sizeof(uid->vendor) - 1);
        EBCASC(uid->vendor, sizeof(uid->vendor) - 1);
-       strncpy(uid->serial, confdata->ned1.HDA_location,
-               sizeof(uid->serial) - 1);
+       memcpy(uid->serial, confdata->ned1.HDA_location,
+              sizeof(uid->serial) - 1);
        EBCASC(uid->serial, sizeof(uid->serial) - 1);
        uid->ssid = confdata->neq.subsystemID;
        if (confdata->ned2.sneq.flags == 0x40) {
index 1140302ff11d852de1c1d20ba29069db84593dd6..ca7d51f7eccc276da0608dd6b8347a9887ae61a5 100644 (file)
 #define PRINT_ERR(x...)                printk(KERN_ERR XPRAM_NAME " error:" x)
 
 
-static struct sysdev_class xpram_sysclass = {
-       set_kset_name("xpram"),
-};
-
-static struct sys_device xpram_sys_device = {
-       .id     = 0,
-       .cls    = &xpram_sysclass,
-}; 
-
 typedef struct {
        unsigned int    size;           /* size of xpram segment in pages */
        unsigned int    offset;         /* start page of xpram segment */
@@ -451,8 +442,6 @@ static void __exit xpram_exit(void)
        }
        unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
        blk_cleanup_queue(xpram_queue);
-       sysdev_unregister(&xpram_sys_device);
-       sysdev_class_unregister(&xpram_sysclass);
 }
 
 static int __init xpram_init(void)
@@ -470,19 +459,7 @@ static int __init xpram_init(void)
        rc = xpram_setup_sizes(xpram_pages);
        if (rc)
                return rc;
-       rc = sysdev_class_register(&xpram_sysclass);
-       if (rc)
-               return rc;
-
-       rc = sysdev_register(&xpram_sys_device);
-       if (rc) {
-               sysdev_class_unregister(&xpram_sysclass);
-               return rc;
-       }
-       rc = xpram_setup_blkdev();
-       if (rc)
-               sysdev_unregister(&xpram_sys_device);
-       return rc;
+       return xpram_setup_blkdev();
 }
 
 module_init(xpram_init);
index 643b6d0785636783538d7d504c129c588bee3a2f..56b87618b100c1d33b8829d3f9bd184f7c80f7b6 100644 (file)
@@ -76,7 +76,7 @@ struct tape_class_device *register_tape_dev(
                                device,
                                "%s", tcd->device_name
                        );
-       rc = PTR_ERR(tcd->class_device);
+       rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0;
        if (rc)
                goto fail_with_cdev;
        rc = sysfs_create_link(
index f26a2ee3aad8de4a3fe7d94daf23e3e42cdc8ca7..3cba6c9fab11ce9c049cb36e24391ad36c2fe31a 100644 (file)
@@ -152,7 +152,6 @@ ccwgroup_create(struct device *root,
        struct ccwgroup_device *gdev;
        int i;
        int rc;
-       int del_drvdata;
 
        if (argc > 256) /* disallow dumb users */
                return -EINVAL;
@@ -163,7 +162,6 @@ ccwgroup_create(struct device *root,
 
        atomic_set(&gdev->onoff, 0);
 
-       del_drvdata = 0;
        for (i = 0; i < argc; i++) {
                gdev->cdev[i] = get_ccwdev_by_busid(cdrv, argv[i]);
 
@@ -180,10 +178,8 @@ ccwgroup_create(struct device *root,
                        rc = -EINVAL;
                        goto free_dev;
                }
-       }
-       for (i = 0; i < argc; i++)
                gdev->cdev[i]->dev.driver_data = gdev;
-       del_drvdata = 1;
+       }
 
        gdev->creator_id = creator_id;
        gdev->count = argc;
@@ -226,9 +222,9 @@ error:
 free_dev:
        for (i = 0; i < argc; i++)
                if (gdev->cdev[i]) {
-                       put_device(&gdev->cdev[i]->dev);
-                       if (del_drvdata)
+                       if (gdev->cdev[i]->dev.driver_data == gdev)
                                gdev->cdev[i]->dev.driver_data = NULL;
+                       put_device(&gdev->cdev[i]->dev);
                }
        kfree(gdev);
        return rc;
index ac6e0c7e43d9587805e820e8d2e6eb633989d58d..6d91c2eb205b05b49afec7f9587f188ab55c5d0a 100644 (file)
@@ -152,7 +152,8 @@ ccw_device_cancel_halt_clear(struct ccw_device *cdev)
                if (cdev->private->iretry) {
                        cdev->private->iretry--;
                        ret = cio_halt(sch);
-                       return (ret == 0) ? -EBUSY : ret;
+                       if (ret != -EBUSY)
+                               return (ret == 0) ? -EBUSY : ret;
                }
                /* halt io unsuccessful. */
                cdev->private->iretry = 255;    /* 255 clear retries. */
@@ -771,6 +772,7 @@ ccw_device_online_verify(struct ccw_device *cdev, enum dev_event dev_event)
        stsch(sch->schid, &sch->schib);
 
        if (sch->schib.scsw.actl != 0 ||
+           (sch->schib.scsw.stctl & SCSW_STCTL_STATUS_PEND) ||
            (cdev->private->irb.scsw.stctl & SCSW_STCTL_STATUS_PEND)) {
                /*
                 * No final status yet or final status not yet delivered
index a60124264beec97583a150973f07550eb4845193..9e3de0bd59b5f3af9f6868356c5a8e23c019c07c 100644 (file)
@@ -263,6 +263,9 @@ ccw_device_wake_up(struct ccw_device *cdev, unsigned long ip, struct irb *irb)
        /* Abuse intparm for error reporting. */
        if (IS_ERR(irb))
                cdev->private->intparm = -EIO;
+       else if (irb->scsw.cc == 1)
+               /* Retry for deferred condition code. */
+               cdev->private->intparm = -EAGAIN;
        else if ((irb->scsw.dstat !=
                  (DEV_STAT_CHN_END|DEV_STAT_DEV_END)) ||
                 (irb->scsw.cstat != 0)) {
index 085db4826e0ed16f9fb3f371825fb59c604e214c..bdc6bb262bced9c235234364f84f7b2707abd841 100644 (file)
@@ -2152,29 +2152,23 @@ static int esp_do_data_finale(struct NCR_ESP *esp,
  */
 static int esp_should_clear_sync(Scsi_Cmnd *sp)
 {
-       unchar cmd1 = sp->cmnd[0];
-       unchar cmd2 = sp->data_cmnd[0];
+       unchar cmd = sp->cmnd[0];
 
        /* These cases are for spinning up a disk and
         * waiting for that spinup to complete.
         */
-       if(cmd1 == START_STOP ||
-          cmd2 == START_STOP)
+       if(cmd == START_STOP)
                return 0;
 
-       if(cmd1 == TEST_UNIT_READY ||
-          cmd2 == TEST_UNIT_READY)
+       if(cmd == TEST_UNIT_READY)
                return 0;
 
        /* One more special case for SCSI tape drives,
         * this is what is used to probe the device for
         * completion of a rewind or tape load operation.
         */
-       if(sp->device->type == TYPE_TAPE) {
-               if(cmd1 == MODE_SENSE ||
-                  cmd2 == MODE_SENSE)
-                       return 0;
-       }
+       if(sp->device->type == TYPE_TAPE && cmd == MODE_SENSE)
+               return 0;
 
        return 1;
 }
index 77e7202a0eba30544389e6bd020fdae2cb7be3fe..904c25fb4ba4a26678bf81e9b8bc4315714bed5f 100644 (file)
@@ -940,14 +940,8 @@ static void ahci_host_intr(struct ata_port *ap)
                return;
 
        /* ignore interim PIO setup fis interrupts */
-       if (ata_tag_valid(ap->active_tag)) {
-               struct ata_queued_cmd *qc =
-                       ata_qc_from_tag(ap, ap->active_tag);
-
-               if (qc && qc->tf.protocol == ATA_PROT_PIO &&
-                   (status & PORT_IRQ_PIOS_FIS))
-                       return;
-       }
+       if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS)) 
+               return;
 
        if (ata_ratelimit())
                ata_port_printk(ap, KERN_INFO, "spurious interrupt "
index 8c91fda6482c3ec53df78989a28d46198ae65f5d..b98c5c1056c380a10dddaa0c6b4a3e6c5d50796c 100644 (file)
@@ -14,6 +14,8 @@ LIBS= -ldb
 clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
 # Override default kernel CFLAGS.  This is a userland app.
 AICASM_CFLAGS:= -I/usr/include -I.
+LEX= flex
+YACC= bison
 YFLAGS= -d
 
 NOMAN= noman
index 06d7601cdf565626c74bf196494b41cbb36809ca..d006a8cb4a7451fd439b97f6cd725efd3f5db001 100644 (file)
@@ -69,6 +69,7 @@ comment "The following drivers are not fully supported"
 config SCSI_CUMANA_1
        tristate "CumanaSCSI I support (EXPERIMENTAL)"
        depends on ARCH_ACORN && EXPERIMENTAL && SCSI
+       select SCSI_SPI_ATTRS
        help
          This enables support for the Cumana SCSI I card. If you have an
          Acorn system with one of these, say Y. If unsure, say N.
@@ -76,6 +77,7 @@ config SCSI_CUMANA_1
 config SCSI_ECOSCSI
        tristate "EcoScsi support (EXPERIMENTAL)"
        depends on ARCH_ACORN && EXPERIMENTAL && (ARCH_ARC || ARCH_A5K) && SCSI
+       select SCSI_SPI_ATTRS
        help
          This enables support for the EcoSCSI card -- a small card that sits
          in the Econet socket. If you have an Acorn system with one of these,
@@ -84,6 +86,7 @@ config SCSI_ECOSCSI
 config SCSI_OAK1
        tristate "Oak SCSI support (EXPERIMENTAL)"
        depends on ARCH_ACORN && EXPERIMENTAL && SCSI
+       select SCSI_SPI_ATTRS
        help
          This enables support for the Oak SCSI card. If you have an Acorn
          system with one of these, say Y. If unsure, say N.
index 3e1053f111dcd61f849bb240c2a4caee4657f3d5..4cf7afc31cc7f00e24414f7a08d1cd3e8733ed7b 100644 (file)
@@ -2427,7 +2427,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt)
        info->stats.aborts += 1;
 
        printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no);
-       __scsi_print_command(SCpnt->data_cmnd);
+       __scsi_print_command(SCpnt->cmnd);
 
        print_debug_list();
        fas216_dumpstate(info);
index 6dd544a5eb56a207f9918f33c1d20ce00e0cd7bd..8c2600ffc6afec68e270f224ea4ba17a4d3fb7b4 100644 (file)
@@ -74,7 +74,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt)
                unsigned long len = 0;
                int buf;
 
-               SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->buffer;
+               SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
                SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
                SCpnt->SCp.ptr = (char *)
                         (page_address(SCpnt->SCp.buffer->page) +
index 19745a31072b17e2be64a3e432fe0940effb004a..5e8afc87698095710ed661bccc188fe07b94b1b9 100644 (file)
@@ -567,8 +567,8 @@ static int piix_sata_prereset(struct ata_port *ap)
                        present = 1;
        }
 
-       DPRINTK("ata%u: LEAVE, pcs=0x%x present_mask=0x%x\n",
-               ap->id, pcs, present_mask);
+       DPRINTK("ata%u: LEAVE, pcs=0x%x present=0x%x\n",
+               ap->id, pcs, present);
 
        if (!present) {
                ata_port_printk(ap, KERN_INFO, "SATA port has no device.\n");
@@ -828,6 +828,7 @@ static void __devinit piix_init_sata_map(struct pci_dev *pdev,
                case IDE:
                        WARN_ON((i & 1) || map[i + 1] != IDE);
                        pinfo[i / 2] = piix_port_info[ich5_pata];
+                       pinfo[i / 2].private_data = hpriv;
                        i++;
                        printk(" IDE IDE");
                        break;
index eaf64c7e54e7014821b5145536edeb28090dfe03..98bd22714d0dde82647578abc90c07505fb1186f 100644 (file)
@@ -2754,18 +2754,15 @@ static int esp_do_data_finale(struct esp *esp)
  */
 static int esp_should_clear_sync(struct scsi_cmnd *sp)
 {
-       u8 cmd1 = sp->cmnd[0];
-       u8 cmd2 = sp->data_cmnd[0];
+       u8 cmd = sp->cmnd[0];
 
        /* These cases are for spinning up a disk and
         * waiting for that spinup to complete.
         */
-       if (cmd1 == START_STOP ||
-           cmd2 == START_STOP)
+       if (cmd == START_STOP)
                return 0;
 
-       if (cmd1 == TEST_UNIT_READY ||
-           cmd2 == TEST_UNIT_READY)
+       if (cmd == TEST_UNIT_READY)
                return 0;
 
        /* One more special case for SCSI tape drives,
@@ -2773,8 +2770,7 @@ static int esp_should_clear_sync(struct scsi_cmnd *sp)
         * completion of a rewind or tape load operation.
         */
        if (sp->device->type == TYPE_TAPE) {
-               if (cmd1 == MODE_SENSE ||
-                   cmd2 == MODE_SENSE)
+               if (cmd == MODE_SENSE)
                        return 0;
        }
 
index 386e5f21e191894da37dbaa44d58d5ad6769fd81..16fc2dd8f2f7e3e7c17149c1764a153eea2c062a 100644 (file)
@@ -5185,28 +5185,6 @@ void ata_host_stop (struct ata_host_set *host_set)
                iounmap(host_set->mmio_base);
 }
 
-
-/**
- *     ata_host_remove - Unregister SCSI host structure with upper layers
- *     @ap: Port to unregister
- *     @do_unregister: 1 if we fully unregister, 0 to just stop the port
- *
- *     LOCKING:
- *     Inherited from caller.
- */
-
-static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
-{
-       struct Scsi_Host *sh = ap->host;
-
-       DPRINTK("ENTER\n");
-
-       if (do_unregister)
-               scsi_remove_host(sh);
-
-       ap->ops->port_stop(ap);
-}
-
 /**
  *     ata_dev_init - Initialize an ata_device structure
  *     @dev: Device structure to initialize
@@ -5532,8 +5510,11 @@ int ata_device_add(const struct ata_probe_ent *ent)
 
 err_out:
        for (i = 0; i < count; i++) {
-               ata_host_remove(host_set->ports[i], 1);
-               scsi_host_put(host_set->ports[i]->host);
+               struct ata_port *ap = host_set->ports[i];
+               if (ap) {
+                       ap->ops->port_stop(ap);
+                       scsi_host_put(ap->host);
+               }
        }
 err_free_ret:
        kfree(host_set);
@@ -5558,7 +5539,7 @@ void ata_port_detach(struct ata_port *ap)
        int i;
 
        if (!ap->ops->error_handler)
-               return;
+               goto skip_eh;
 
        /* tell EH we're leaving & flush EH */
        spin_lock_irqsave(ap->lock, flags);
@@ -5594,6 +5575,7 @@ void ata_port_detach(struct ata_port *ap)
        cancel_delayed_work(&ap->hotplug_task);
        flush_workqueue(ata_aux_wq);
 
+ skip_eh:
        /* remove the associated SCSI host */
        scsi_remove_host(ap->host);
 }
@@ -5662,7 +5644,7 @@ int ata_scsi_release(struct Scsi_Host *host)
        DPRINTK("ENTER\n");
 
        ap->ops->port_disable(ap);
-       ata_host_remove(ap, 0);
+       ap->ops->port_stop(ap);
 
        DPRINTK("EXIT\n");
        return 1;
index 4b6aa30f4d68529f1a51e0cdaf278c3e2918ec81..29f59345305d93e7181ad599594710b22963792f 100644 (file)
@@ -764,12 +764,27 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev,
                               unsigned int action)
 {
        unsigned long flags;
+       struct ata_eh_info *ehi = &ap->eh_info;
+       struct ata_eh_context *ehc = &ap->eh_context;
 
        spin_lock_irqsave(ap->lock, flags);
 
-       ata_eh_clear_action(dev, &ap->eh_info, action);
+       /* Reset is represented by combination of actions and EHI
+        * flags.  Suck in all related bits before clearing eh_info to
+        * avoid losing requested action.
+        */
+       if (action & ATA_EH_RESET_MASK) {
+               ehc->i.action |= ehi->action & ATA_EH_RESET_MASK;
+               ehc->i.flags |= ehi->flags & ATA_EHI_RESET_MODIFIER_MASK;
+
+               /* make sure all reset actions are cleared & clear EHI flags */
+               action |= ATA_EH_RESET_MASK;
+               ehi->flags &= ~ATA_EHI_RESET_MODIFIER_MASK;
+       }
+
+       ata_eh_clear_action(dev, ehi, action);
 
-       if (!(ap->eh_context.i.flags & ATA_EHI_QUIET))
+       if (!(ehc->i.flags & ATA_EHI_QUIET))
                ap->pflags |= ATA_PFLAG_RECOVERED;
 
        spin_unlock_irqrestore(ap->lock, flags);
@@ -790,6 +805,12 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev,
 static void ata_eh_done(struct ata_port *ap, struct ata_device *dev,
                        unsigned int action)
 {
+       /* if reset is complete, clear all reset actions & reset modifier */
+       if (action & ATA_EH_RESET_MASK) {
+               action |= ATA_EH_RESET_MASK;
+               ap->eh_context.i.flags &= ~ATA_EHI_RESET_MODIFIER_MASK;
+       }
+
        ata_eh_clear_action(dev, &ap->eh_context.i, action);
 }
 
@@ -1276,8 +1297,6 @@ static int ata_eh_speed_down(struct ata_device *dev, int is_io,
 static void ata_eh_autopsy(struct ata_port *ap)
 {
        struct ata_eh_context *ehc = &ap->eh_context;
-       unsigned int action = ehc->i.action;
-       struct ata_device *failed_dev = NULL;
        unsigned int all_err_mask = 0;
        int tag, is_io = 0;
        u32 serror;
@@ -1294,7 +1313,7 @@ static void ata_eh_autopsy(struct ata_port *ap)
                ehc->i.serror |= serror;
                ata_eh_analyze_serror(ap);
        } else if (rc != -EOPNOTSUPP)
-               action |= ATA_EH_HARDRESET;
+               ehc->i.action |= ATA_EH_HARDRESET;
 
        /* analyze NCQ failure */
        ata_eh_analyze_ncq_error(ap);
@@ -1315,7 +1334,7 @@ static void ata_eh_autopsy(struct ata_port *ap)
                qc->err_mask |= ehc->i.err_mask;
 
                /* analyze TF */
-               action |= ata_eh_analyze_tf(qc, &qc->result_tf);
+               ehc->i.action |= ata_eh_analyze_tf(qc, &qc->result_tf);
 
                /* DEV errors are probably spurious in case of ATA_BUS error */
                if (qc->err_mask & AC_ERR_ATA_BUS)
@@ -1329,11 +1348,11 @@ static void ata_eh_autopsy(struct ata_port *ap)
                /* SENSE_VALID trumps dev/unknown error and revalidation */
                if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
                        qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER);
-                       action &= ~ATA_EH_REVALIDATE;
+                       ehc->i.action &= ~ATA_EH_REVALIDATE;
                }
 
                /* accumulate error info */
-               failed_dev = qc->dev;
+               ehc->i.dev = qc->dev;
                all_err_mask |= qc->err_mask;
                if (qc->flags & ATA_QCFLAG_IO)
                        is_io = 1;
@@ -1342,25 +1361,22 @@ static void ata_eh_autopsy(struct ata_port *ap)
        /* enforce default EH actions */
        if (ap->pflags & ATA_PFLAG_FROZEN ||
            all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT))
-               action |= ATA_EH_SOFTRESET;
+               ehc->i.action |= ATA_EH_SOFTRESET;
        else if (all_err_mask)
-               action |= ATA_EH_REVALIDATE;
+               ehc->i.action |= ATA_EH_REVALIDATE;
 
        /* if we have offending qcs and the associated failed device */
-       if (failed_dev) {
+       if (ehc->i.dev) {
                /* speed down */
-               action |= ata_eh_speed_down(failed_dev, is_io, all_err_mask);
+               ehc->i.action |= ata_eh_speed_down(ehc->i.dev, is_io,
+                                                  all_err_mask);
 
                /* perform per-dev EH action only on the offending device */
-               ehc->i.dev_action[failed_dev->devno] |=
-                       action & ATA_EH_PERDEV_MASK;
-               action &= ~ATA_EH_PERDEV_MASK;
+               ehc->i.dev_action[ehc->i.dev->devno] |=
+                       ehc->i.action & ATA_EH_PERDEV_MASK;
+               ehc->i.action &= ~ATA_EH_PERDEV_MASK;
        }
 
-       /* record autopsy result */
-       ehc->i.dev = failed_dev;
-       ehc->i.action |= action;
-
        DPRINTK("EXIT\n");
 }
 
@@ -1483,6 +1499,9 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
        ata_reset_fn_t reset;
        int i, did_followup_srst, rc;
 
+       /* about to reset */
+       ata_eh_about_to_do(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK);
+
        /* Determine which reset to use and record in ehc->i.action.
         * prereset() may examine and modify it.
         */
@@ -1531,8 +1550,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
                ata_port_printk(ap, KERN_INFO, "%s resetting port\n",
                                reset == softreset ? "soft" : "hard");
 
-       /* reset */
-       ata_eh_about_to_do(ap, NULL, ATA_EH_RESET_MASK);
+       /* mark that this EH session started with reset */
        ehc->i.flags |= ATA_EHI_DID_RESET;
 
        rc = ata_do_reset(ap, reset, classes);
@@ -1595,7 +1613,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
                        postreset(ap, classes);
 
                /* reset successful, schedule revalidation */
-               ata_eh_done(ap, NULL, ATA_EH_RESET_MASK);
+               ata_eh_done(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK);
                ehc->i.action |= ATA_EH_REVALIDATE;
        }
 
@@ -1848,15 +1866,16 @@ static int ata_eh_skip_recovery(struct ata_port *ap)
        for (i = 0; i < ata_port_max_devices(ap); i++) {
                struct ata_device *dev = &ap->device[i];
 
-               if (ata_dev_absent(dev) || ata_dev_ready(dev))
+               if (!(dev->flags & ATA_DFLAG_SUSPENDED))
                        break;
        }
 
        if (i == ata_port_max_devices(ap))
                return 1;
 
-       /* always thaw frozen port and recover failed devices */
-       if (ap->pflags & ATA_PFLAG_FROZEN || ata_port_nr_enabled(ap))
+       /* thaw frozen port, resume link and recover failed devices */
+       if ((ap->pflags & ATA_PFLAG_FROZEN) ||
+           (ehc->i.flags & ATA_EHI_RESUME_LINK) || ata_port_nr_enabled(ap))
                return 0;
 
        /* skip if class codes for all vacant slots are ATA_DEV_NONE */
index 7ced41ecde860c0c4c58ce0c5cb7d9afc0d05051..e92c31d698ff6c983b7a817afe190d10a7f1de6c 100644 (file)
@@ -2353,6 +2353,19 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
                        ata_gen_ata_desc_sense(qc);
                }
 
+               /* SCSI EH automatically locks door if sdev->locked is
+                * set.  Sometimes door lock request continues to
+                * fail, for example, when no media is present.  This
+                * creates a loop - SCSI EH issues door lock which
+                * fails and gets invoked again to acquire sense data
+                * for the failed command.
+                *
+                * If door lock fails, always clear sdev->locked to
+                * avoid this infinite loop.
+                */
+               if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL)
+                       qc->dev->sdev->locked = 0;
+
                qc->scsicmd->result = SAM_STAT_CHECK_CONDITION;
                qc->scsidone(cmd);
                ata_qc_free(qc);
index 64631bd38952e28dd806506eceec01ac44ad0190..4776f4e55839022303c8dba80e7ca4ec76ddf368 100644 (file)
@@ -269,8 +269,15 @@ static const struct pci_device_id pdc_ata_pci_tbl[] = {
        { PCI_VENDOR_ID_PROMISE, 0x6629, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
          board_20619 },
 
+/* TODO: remove all associated board_20771 code, as it completely
+ * duplicates board_2037x code, unless reason for separation can be
+ * divined.
+ */
+#if 0
        { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
          board_20771 },
+#endif
+
        { }     /* terminate list */
 };
 
index 2e0f4a4076af6cd48a118c68b3640917116c158f..3f368c7d3ef90be120a98410ce842628ef201ef9 100644 (file)
@@ -1106,7 +1106,6 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        probe_ent->irq = pdev->irq;
        probe_ent->irq_flags = IRQF_SHARED;
-       probe_ent->mmio_base = port_base;
        probe_ent->private_data = hpriv;
 
        hpriv->host_base = host_base;
index a89c4115cfbaa4c674b765a503e8ee9c3ea138a1..32293f4516694ae0d7bf237364a35892f2e53156 100644 (file)
@@ -110,11 +110,8 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
                                       sshdr.asc, sshdr.ascq);
                        break;
                case NOT_READY: /* This happens if there is no disc in drive */
-                       if (sdev->removable && (cmd[0] != TEST_UNIT_READY)) {
-                               printk(KERN_INFO "Device not ready. Make sure"
-                                      " there is a disc in the drive.\n");
+                       if (sdev->removable)
                                break;
-                       }
                case UNIT_ATTENTION:
                        if (sdev->removable) {
                                sdev->changed = 1;
index 2ee742d40c43e3708ea7c8fbce9e4096f6181a77..005043197527142749965cce1d75fde169773c4c 100644 (file)
@@ -24,7 +24,7 @@ config USB_ARCH_HAS_OHCI
        default y if ARCH_S3C2410
        default y if PXA27x
        default y if ARCH_EP93XX
-       default y if ARCH_AT91RM9200
+       default y if (ARCH_AT91RM9200 || ARCH_AT91SAM9261)
        # PPC:
        default y if STB03xxx
        default y if PPC_MPC52xx
index f7bdd94b3aa89b26cb704bf9c202a1f84432bf1b..218621b9958e4af20972900bc19038d940fbe78a 100644 (file)
@@ -517,19 +517,19 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsig
 
 static struct usb_device *usbdev_lookup_minor(int minor)
 {
-       struct device *device;
-       struct usb_device *udev = NULL;
+       struct class_device *class_dev;
+       struct usb_device *dev = NULL;
 
        down(&usb_device_class->sem);
-       list_for_each_entry(device, &usb_device_class->devices, node) {
-               if (device->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
-                       udev = device->platform_data;
+       list_for_each_entry(class_dev, &usb_device_class->children, node) {
+               if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
+                       dev = class_dev->class_data;
                        break;
                }
        }
        up(&usb_device_class->sem);
 
-       return udev;
+       return dev;
 };
 
 /*
@@ -1580,16 +1580,16 @@ static void usbdev_add(struct usb_device *dev)
 {
        int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1);
 
-       dev->usbfs_dev = device_create(usb_device_class, &dev->dev,
-                               MKDEV(USB_DEVICE_MAJOR, minor),
+       dev->class_dev = class_device_create(usb_device_class, NULL,
+                               MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev,
                                "usbdev%d.%d", dev->bus->busnum, dev->devnum);
 
-       dev->usbfs_dev->platform_data = dev;
+       dev->class_dev->class_data = dev;
 }
 
 static void usbdev_remove(struct usb_device *dev)
 {
-       device_unregister(dev->usbfs_dev);
+       class_device_unregister(dev->class_dev);
 }
 
 static int usbdev_notify(struct notifier_block *self, unsigned long action,
index abee0f5b6a66492c1a9e417a8f908a0cb9d8606d..8de4f8c99d61f3a7cb01696bde29202ed814b160 100644 (file)
@@ -194,13 +194,14 @@ int usb_register_dev(struct usb_interface *intf,
                ++temp;
        else
                temp = name;
-       intf->usb_dev = device_create(usb_class->class, &intf->dev,
-                                     MKDEV(USB_MAJOR, minor), "%s", temp);
-       if (IS_ERR(intf->usb_dev)) {
+       intf->class_dev = class_device_create(usb_class->class, NULL,
+                                             MKDEV(USB_MAJOR, minor),
+                                             &intf->dev, "%s", temp);
+       if (IS_ERR(intf->class_dev)) {
                spin_lock (&minor_lock);
                usb_minors[intf->minor] = NULL;
                spin_unlock (&minor_lock);
-               retval = PTR_ERR(intf->usb_dev);
+               retval = PTR_ERR(intf->class_dev);
        }
 exit:
        return retval;
@@ -241,8 +242,8 @@ void usb_deregister_dev(struct usb_interface *intf,
        spin_unlock (&minor_lock);
 
        snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
-       device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
-       intf->usb_dev = NULL;
+       class_device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
+       intf->class_dev = NULL;
        intf->minor = -1;
        destroy_usb_class();
 }
index 363b2ad74ae60db025df978abe30aea313033cf3..1a32d96774b42d61ce0e33abe3b38b8c350fde10 100644 (file)
@@ -207,7 +207,7 @@ config USB_AT91
 
 config USB_GADGET_DUMMY_HCD
        boolean "Dummy HCD (DEVELOPMENT)"
-       depends on USB && EXPERIMENTAL
+       depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL
        select USB_GADGET_DUALSPEED
        help
          This host controller driver emulates USB, looping all data transfer
index 1c459ff037cef275d5e487da9de0f8362fee4b26..cfebca05ead57ca87188b40d93f08ec0c04160b1 100644 (file)
 
 /*
  * This controller is simple and PIO-only.  It's used in many AT91-series
- * ARMv4T controllers, including the at91rm9200 (arm920T, with MMU),
- * at91sam9261 (arm926ejs, with MMU), and several no-mmu versions.
+ * full speed USB controllers, including the at91rm9200 (arm920T, with MMU),
+ * at91sam926x (arm926ejs, with MMU), and several no-mmu versions.
  *
  * This driver expects the board has been wired with two GPIOs suppporting
  * a VBUS sensing IRQ, and a D+ pullup.  (They may be omitted, but the
- * testing hasn't covered such cases.)  The pullup is most important; it
+ * testing hasn't covered such cases.)
+ *
+ * The pullup is most important (so it's integrated on sam926x parts).  It
  * provides software control over whether the host enumerates the device.
+ *
  * The VBUS sensing helps during enumeration, and allows both USB clocks
  * (and the transceiver) to stay gated off until they're necessary, saving
- * power.  During USB suspend, the 48 MHz clock is gated off.
+ * power.  During USB suspend, the 48 MHz clock is gated off in hardware;
+ * it may also be gated off by software during some Linux sleep states.
  */
 
-#define        DRIVER_VERSION  "8 March 2005"
+#define        DRIVER_VERSION  "3 May 2006"
 
 static const char driver_name [] = "at91_udc";
 static const char ep0name[] = "ep0";
@@ -316,9 +320,15 @@ static void done(struct at91_ep *ep, struct at91_request *req, int status)
  *
  * There are also state bits like FORCESTALL, EPEDS, DIR, and EPTYPE
  * that shouldn't normally be changed.
+ *
+ * NOTE at91sam9260 docs mention synch between UDPCK and MCK clock domains,
+ * implying a need to wait for one write to complete (test relevant bits)
+ * before starting the next write.  This shouldn't be an issue given how
+ * infrequently we write, except maybe for write-then-read idioms.
  */
 #define        SET_FX  (AT91_UDP_TXPKTRDY)
-#define        CLR_FX  (RX_DATA_READY | AT91_UDP_RXSETUP | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP)
+#define        CLR_FX  (RX_DATA_READY | AT91_UDP_RXSETUP \
+               | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP)
 
 /* pull OUT packet data from the endpoint's fifo */
 static int read_fifo (struct at91_ep *ep, struct at91_request *req)
@@ -472,7 +482,8 @@ static void nuke(struct at91_ep *ep, int status)
 
 /*-------------------------------------------------------------------------*/
 
-static int at91_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+static int at91_ep_enable(struct usb_ep *_ep,
+                               const struct usb_endpoint_descriptor *desc)
 {
        struct at91_ep  *ep = container_of(_ep, struct at91_ep, ep);
        struct at91_udc *dev = ep->udc;
@@ -582,11 +593,12 @@ static int at91_ep_disable (struct usb_ep * _ep)
  * interesting for request or buffer allocation.
  */
 
-static struct usb_request *at91_ep_alloc_request (struct usb_ep *_ep, unsigned int gfp_flags)
+static struct usb_request *
+at91_ep_alloc_request(struct usb_ep *_ep, unsigned int gfp_flags)
 {
        struct at91_request *req;
 
-       req = kcalloc(1, sizeof (struct at91_request), SLAB_KERNEL);
+       req = kcalloc(1, sizeof (struct at91_request), gfp_flags);
        if (!req)
                return NULL;
 
@@ -862,6 +874,7 @@ static void stop_activity(struct at91_udc *udc)
        if (udc->gadget.speed == USB_SPEED_UNKNOWN)
                driver = NULL;
        udc->gadget.speed = USB_SPEED_UNKNOWN;
+       udc->suspended = 0;
 
        for (i = 0; i < NUM_ENDPOINTS; i++) {
                struct at91_ep *ep = &udc->ep[i];
@@ -889,8 +902,8 @@ static void clk_off(struct at91_udc *udc)
                return;
        udc->clocked = 0;
        udc->gadget.speed = USB_SPEED_UNKNOWN;
-       clk_disable(udc->iclk);
        clk_disable(udc->fclk);
+       clk_disable(udc->iclk);
 }
 
 /*
@@ -911,9 +924,6 @@ static void pullup(struct at91_udc *udc, int is_on)
                at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
                at91_set_gpio_value(udc->board.pullup_pin, 0);
                clk_off(udc);
-
-               // REVISIT:  with transceiver disabled, will D- float
-               // so that a host would falsely detect a device?
        }
 }
 
@@ -1290,7 +1300,8 @@ static void handle_ep0(struct at91_udc *udc)
                        if (udc->wait_for_addr_ack) {
                                u32     tmp;
 
-                               at91_udp_write(AT91_UDP_FADDR, AT91_UDP_FEN | udc->addr);
+                               at91_udp_write(AT91_UDP_FADDR,
+                                               AT91_UDP_FEN | udc->addr);
                                tmp = at91_udp_read(AT91_UDP_GLB_STAT);
                                tmp &= ~AT91_UDP_FADDEN;
                                if (udc->addr)
@@ -1361,9 +1372,10 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc, struct pt_regs *r)
        u32                     rescans = 5;
 
        while (rescans--) {
-               u32     status = at91_udp_read(AT91_UDP_ISR);
+               u32 status;
 
-               status &= at91_udp_read(AT91_UDP_IMR);
+               status = at91_udp_read(AT91_UDP_ISR)
+                       & at91_udp_read(AT91_UDP_IMR);
                if (!status)
                        break;
 
@@ -1379,18 +1391,17 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc, struct pt_regs *r)
                        stop_activity(udc);
 
                        /* enable ep0 */
-                       at91_udp_write(AT91_UDP_CSR(0), AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL);
+                       at91_udp_write(AT91_UDP_CSR(0),
+                                       AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL);
                        udc->gadget.speed = USB_SPEED_FULL;
                        udc->suspended = 0;
                        at91_udp_write(AT91_UDP_IER, AT91_UDP_EP(0));
 
                        /*
                         * NOTE:  this driver keeps clocks off unless the
-                        * USB host is present.  That saves power, and also
-                        * eliminates IRQs (reset, resume, suspend) that can
-                        * otherwise flood from the controller.  If your
-                        * board doesn't support VBUS detection, suspend and
-                        * resume irq logic may need more attention...
+                        * USB host is present.  That saves power, but for
+                        * boards that don't support VBUS detection, both
+                        * clocks need to be active most of the time.
                         */
 
                /* host initiated suspend (3+ms bus idle) */
@@ -1452,13 +1463,19 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc, struct pt_regs *r)
 
 /*-------------------------------------------------------------------------*/
 
+static void nop_release(struct device *dev)
+{
+       /* nothing to free */
+}
+
 static struct at91_udc controller = {
        .gadget = {
-               .ops = &at91_udc_ops,
-               .ep0 = &controller.ep[0].ep,
-               .name = driver_name,
-               .dev = {
-                       .bus_id = "gadget"
+               .ops    = &at91_udc_ops,
+               .ep0    = &controller.ep[0].ep,
+               .name   = driver_name,
+               .dev    = {
+                       .bus_id = "gadget",
+                       .release = nop_release,
                }
        },
        .ep[0] = {
@@ -1468,7 +1485,8 @@ static struct at91_udc controller = {
                },
                .udc            = &controller,
                .maxpacket      = 8,
-               .creg           = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(0)),
+               .creg           = (void __iomem *)(AT91_VA_BASE_UDP
+                                       + AT91_UDP_CSR(0)),
                .int_mask       = 1 << 0,
        },
        .ep[1] = {
@@ -1479,7 +1497,8 @@ static struct at91_udc controller = {
                .udc            = &controller,
                .is_pingpong    = 1,
                .maxpacket      = 64,
-               .creg           = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(1)),
+               .creg           = (void __iomem *)(AT91_VA_BASE_UDP
+                                       + AT91_UDP_CSR(1)),
                .int_mask       = 1 << 1,
        },
        .ep[2] = {
@@ -1490,7 +1509,8 @@ static struct at91_udc controller = {
                .udc            = &controller,
                .is_pingpong    = 1,
                .maxpacket      = 64,
-               .creg           = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(2)),
+               .creg           = (void __iomem *)(AT91_VA_BASE_UDP
+                                       + AT91_UDP_CSR(2)),
                .int_mask       = 1 << 2,
        },
        .ep[3] = {
@@ -1501,7 +1521,8 @@ static struct at91_udc controller = {
                },
                .udc            = &controller,
                .maxpacket      = 8,
-               .creg           = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(3)),
+               .creg           = (void __iomem *)(AT91_VA_BASE_UDP
+                                       + AT91_UDP_CSR(3)),
                .int_mask       = 1 << 3,
        },
        .ep[4] = {
@@ -1512,7 +1533,8 @@ static struct at91_udc controller = {
                .udc            = &controller,
                .is_pingpong    = 1,
                .maxpacket      = 256,
-               .creg           = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(4)),
+               .creg           = (void __iomem *)(AT91_VA_BASE_UDP
+                                       + AT91_UDP_CSR(4)),
                .int_mask       = 1 << 4,
        },
        .ep[5] = {
@@ -1523,10 +1545,11 @@ static struct at91_udc controller = {
                .udc            = &controller,
                .is_pingpong    = 1,
                .maxpacket      = 256,
-               .creg           = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(5)),
+               .creg           = (void __iomem *)(AT91_VA_BASE_UDP
+                                       + AT91_UDP_CSR(5)),
                .int_mask       = 1 << 5,
        },
-       /* ep6 and ep7 are also reserved */
+       /* ep6 and ep7 are also reserved (custom silicon might use them) */
 };
 
 static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r)
@@ -1593,6 +1616,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
 
        local_irq_disable();
        udc->enabled = 0;
+       at91_udp_write(AT91_UDP_IDR, ~0);
        pullup(udc, 0);
        local_irq_enable();
 
@@ -1624,6 +1648,16 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
+       if (pdev->num_resources != 2) {
+               DBG("invalid num_resources");
+               return -ENODEV;
+       }
+       if ((pdev->resource[0].flags != IORESOURCE_MEM)
+                       || (pdev->resource[1].flags != IORESOURCE_IRQ)) {
+               DBG("invalid resource type");
+               return -ENODEV;
+       }
+
        if (!request_mem_region(AT91_BASE_UDP, SZ_16K, driver_name)) {
                DBG("someone's using UDC memory\n");
                return -EBUSY;
@@ -1649,19 +1683,26 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
        if (retval < 0)
                goto fail0;
 
-       /* disable everything until there's a gadget driver and vbus */
-       pullup(udc, 0);
+       /* don't do anything until we have both gadget driver and VBUS */
+       clk_enable(udc->iclk);
+       at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
+       at91_udp_write(AT91_UDP_IDR, 0xffffffff);
+       clk_disable(udc->iclk);
 
        /* request UDC and maybe VBUS irqs */
-       if (request_irq(AT91_ID_UDP, at91_udc_irq, IRQF_DISABLED, driver_name, udc)) {
-               DBG("request irq %d failed\n", AT91_ID_UDP);
+       udc->udp_irq = platform_get_irq(pdev, 0);
+       if (request_irq(udc->udp_irq, at91_udc_irq,
+                       IRQF_DISABLED, driver_name, udc)) {
+               DBG("request irq %d failed\n", udc->udp_irq);
                retval = -EBUSY;
                goto fail1;
        }
        if (udc->board.vbus_pin > 0) {
-               if (request_irq(udc->board.vbus_pin, at91_vbus_irq, IRQF_DISABLED, driver_name, udc)) {
-                       DBG("request vbus irq %d failed\n", udc->board.vbus_pin);
-                       free_irq(AT91_ID_UDP, udc);
+               if (request_irq(udc->board.vbus_pin, at91_vbus_irq,
+                               IRQF_DISABLED, driver_name, udc)) {
+                       DBG("request vbus irq %d failed\n",
+                                       udc->board.vbus_pin);
+                       free_irq(udc->udp_irq, udc);
                        retval = -EBUSY;
                        goto fail1;
                }
@@ -1670,6 +1711,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
                udc->vbus = 1;
        }
        dev_set_drvdata(dev, udc);
+       device_init_wakeup(dev, 1);
        create_debug_file(udc);
 
        INFO("%s version %s\n", driver_name, DRIVER_VERSION);
@@ -1678,14 +1720,14 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
 fail1:
        device_unregister(&udc->gadget.dev);
 fail0:
-       release_mem_region(AT91_VA_BASE_UDP, SZ_16K);
+       release_mem_region(AT91_BASE_UDP, SZ_16K);
        DBG("%s probe failed, %d\n", driver_name, retval);
        return retval;
 }
 
-static int __devexit at91udc_remove(struct platform_device *dev)
+static int __devexit at91udc_remove(struct platform_device *pdev)
 {
-       struct at91_udc *udc = platform_get_drvdata(dev);
+       struct at91_udc *udc = platform_get_drvdata(pdev);
 
        DBG("remove\n");
 
@@ -1694,10 +1736,11 @@ static int __devexit at91udc_remove(struct platform_device *dev)
        if (udc->driver != 0)
                usb_gadget_unregister_driver(udc->driver);
 
+       device_init_wakeup(&pdev->dev, 0);
        remove_debug_file(udc);
        if (udc->board.vbus_pin > 0)
                free_irq(udc->board.vbus_pin, udc);
-       free_irq(AT91_ID_UDP, udc);
+       free_irq(udc->udp_irq, udc);
        device_unregister(&udc->gadget.dev);
        release_mem_region(AT91_BASE_UDP, SZ_16K);
 
@@ -1708,31 +1751,36 @@ static int __devexit at91udc_remove(struct platform_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg)
+static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
-       struct at91_udc *udc = platform_get_drvdata(dev);
+       struct at91_udc *udc = platform_get_drvdata(pdev);
+       int             wake = udc->driver && device_may_wakeup(&pdev->dev);
 
-       /*
-        * The "safe" suspend transitions are opportunistic ... e.g. when
-        * the USB link is suspended (48MHz clock autogated off), or when
-        * it's disconnected (programmatically gated off, elsewhere).
-        * Then we can suspend, and the chip can enter slow clock mode.
-        *
-        * The problem case is some component (user mode?) suspending this
-        * device while it's active, with the 48 MHz clock in use.  There
-        * are two basic approaches:  (a) veto suspend levels involving slow
-        * clock mode, (b) disconnect, so 48 MHz will no longer be in use
-        * and we can enter slow clock mode.  This uses (b) for now, since
-        * it's simplest until AT91 PM exists and supports the other option.
+       /* Unless we can act normally to the host (letting it wake us up
+        * whenever it has work for us) force disconnect.  Wakeup requires
+        * PLLB for USB events (signaling for reset, wakeup, or incoming
+        * tokens) and VBUS irqs (on systems which support them).
         */
-       if (udc->vbus && !udc->suspended)
+       if ((!udc->suspended && udc->addr)
+                       || !wake
+                       || at91_suspend_entering_slow_clock()) {
                pullup(udc, 0);
+               disable_irq_wake(udc->udp_irq);
+       } else
+               enable_irq_wake(udc->udp_irq);
+
+       if (udc->board.vbus_pin > 0) {
+               if (wake)
+                       enable_irq_wake(udc->board.vbus_pin);
+               else
+                       disable_irq_wake(udc->board.vbus_pin);
+       }
        return 0;
 }
 
-static int at91udc_resume(struct platform_device *dev)
+static int at91udc_resume(struct platform_device *pdev)
 {
-       struct at91_udc *udc = platform_get_drvdata(dev);
+       struct at91_udc *udc = platform_get_drvdata(pdev);
 
        /* maybe reconnect to host; if so, clocks on */
        pullup(udc, 1);
@@ -1748,7 +1796,7 @@ static struct platform_driver at91_udc = {
        .remove         = __devexit_p(at91udc_remove),
        .shutdown       = at91udc_shutdown,
        .suspend        = at91udc_suspend,
-       .resume         = at91udc_resume,
+       .resume         = at91udc_resume,
        .driver         = {
                .name   = (char *) driver_name,
                .owner  = THIS_MODULE,
@@ -1767,6 +1815,6 @@ static void __devexit udc_exit_module(void)
 }
 module_exit(udc_exit_module);
 
-MODULE_DESCRIPTION("AT91RM9200 udc driver");
+MODULE_DESCRIPTION("AT91 udc driver");
 MODULE_AUTHOR("Thomas Rathbone, David Brownell");
 MODULE_LICENSE("GPL");
index 5a4799cedd1974a1c8c5cb0abe08dd29f68a374e..882af42e86cc413f2d74d28e4a8b986ff4868f4c 100644 (file)
@@ -141,6 +141,7 @@ struct at91_udc {
        struct clk                      *iclk, *fclk;
        struct platform_device          *pdev;
        struct proc_dir_entry           *pde;
+       int                             udp_irq;
 };
 
 static inline struct at91_udc *to_udc(struct usb_gadget *g)
index 4be47195bd38d633b3b6dca431682cc69543bcfa..7d1c22c34957bfa94ebc5dfe067a6b98ffa86e28 100644 (file)
@@ -609,7 +609,8 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req)
        if (!dum->driver)
                return -ESHUTDOWN;
 
-       spin_lock_irqsave (&dum->lock, flags);
+       local_irq_save (flags);
+       spin_lock (&dum->lock);
        list_for_each_entry (req, &ep->queue, queue) {
                if (&req->req == _req) {
                        list_del_init (&req->queue);
@@ -618,7 +619,7 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req)
                        break;
                }
        }
-       spin_unlock_irqrestore (&dum->lock, flags);
+       spin_unlock (&dum->lock);
 
        if (retval == 0) {
                dev_dbg (udc_dev(dum),
@@ -626,6 +627,7 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req)
                                req, _ep->name, _req->length, _req->buf);
                _req->complete (_ep, _req);
        }
+       local_irq_restore (flags);
        return retval;
 }
 
index 85b0b4ad4c16ec58de1ebf8016ad25f6b3829e1a..d63177a8eaea330b41e6465f740efa4d7b3ba3c7 100644 (file)
@@ -892,7 +892,7 @@ MODULE_LICENSE ("GPL");
 #define        PCI_DRIVER              ehci_pci_driver
 #endif
 
-#ifdef CONFIG_PPC_83xx
+#ifdef CONFIG_MPC834x
 #include "ehci-fsl.c"
 #define        PLATFORM_DRIVER         ehci_fsl_driver
 #endif
index cdbafb710000a1f30d06083f5dfc721ce57653f4..85cc059705a645e947eae76f13be929048f8eef4 100644 (file)
@@ -4,7 +4,7 @@
  *  Copyright (C) 2004 SAN People (Pty) Ltd.
  *  Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
  *
- * AT91RM9200 Bus Glue
+ * AT91 Bus Glue
  *
  * Based on fragments of 2.4 driver by Rick Bronson.
  * Based on ohci-omap.c
 #include <asm/hardware.h>
 #include <asm/arch/board.h>
 
-#ifndef CONFIG_ARCH_AT91RM9200
-#error "CONFIG_ARCH_AT91RM9200 must be defined."
+#ifndef CONFIG_ARCH_AT91
+#error "CONFIG_ARCH_AT91 must be defined."
 #endif
 
 /* interface and function clocks */
 static struct clk *iclk, *fclk;
+static int clocked;
 
 extern int usb_disabled(void);
 
@@ -35,13 +36,14 @@ static void at91_start_hc(struct platform_device *pdev)
        struct usb_hcd *hcd = platform_get_drvdata(pdev);
        struct ohci_regs __iomem *regs = hcd->regs;
 
-       dev_dbg(&pdev->dev, "starting AT91RM9200 OHCI USB Controller\n");
+       dev_dbg(&pdev->dev, "start\n");
 
        /*
         * Start the USB clocks.
         */
        clk_enable(iclk);
        clk_enable(fclk);
+       clocked = 1;
 
        /*
         * The USB host controller must remain in reset.
@@ -54,7 +56,7 @@ static void at91_stop_hc(struct platform_device *pdev)
        struct usb_hcd *hcd = platform_get_drvdata(pdev);
        struct ohci_regs __iomem *regs = hcd->regs;
 
-       dev_dbg(&pdev->dev, "stopping AT91RM9200 OHCI USB Controller\n");
+       dev_dbg(&pdev->dev, "stop\n");
 
        /*
         * Put the USB host controller into reset.
@@ -66,6 +68,7 @@ static void at91_stop_hc(struct platform_device *pdev)
         */
        clk_disable(fclk);
        clk_disable(iclk);
+       clocked = 0;
 }
 
 
@@ -78,14 +81,15 @@ static int usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
 
 
 /**
- * usb_hcd_at91_probe - initialize AT91RM9200-based HCDs
+ * usb_hcd_at91_probe - initialize AT91-based HCDs
  * Context: !in_interrupt()
  *
  * Allocates basic resources for this USB host controller, and
  * then invokes the start() method for the HCD associated with it
  * through the hotplug entry's driver_data.
  */
-int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev)
+static int usb_hcd_at91_probe(const struct hc_driver *driver,
+                       struct platform_device *pdev)
 {
        int retval;
        struct usb_hcd *hcd = NULL;
@@ -95,12 +99,13 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *
                return -ENODEV;
        }
 
-       if ((pdev->resource[0].flags != IORESOURCE_MEM) || (pdev->resource[1].flags != IORESOURCE_IRQ)) {
+       if ((pdev->resource[0].flags != IORESOURCE_MEM)
+                       || (pdev->resource[1].flags != IORESOURCE_IRQ)) {
                pr_debug("hcd probe: invalid resource type\n");
                return -ENODEV;
        }
 
-       hcd = usb_create_hcd(driver, &pdev->dev, "at91rm9200");
+       hcd = usb_create_hcd(driver, &pdev->dev, "at91");
        if (!hcd)
                return -ENOMEM;
        hcd->rsrc_start = pdev->resource[0].start;
@@ -149,21 +154,23 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *
 /* may be called with controller, bus, and devices active */
 
 /**
- * usb_hcd_at91_remove - shutdown processing for AT91RM9200-based HCDs
+ * usb_hcd_at91_remove - shutdown processing for AT91-based HCDs
  * @dev: USB Host Controller being removed
  * Context: !in_interrupt()
  *
  * Reverses the effect of usb_hcd_at91_probe(), first invoking
  * the HCD's stop() method.  It is always called from a thread
- * context, normally "rmmod", "apmd", or something similar.
+ * context, "rmmod" or something similar.
  *
  */
-static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pdev)
+static int usb_hcd_at91_remove(struct usb_hcd *hcd,
+                               struct platform_device *pdev)
 {
        usb_remove_hcd(hcd);
        at91_stop_hc(pdev);
        iounmap(hcd->regs);
        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+       disable_irq_wake(hcd->irq);
 
        clk_put(fclk);
        clk_put(iclk);
@@ -178,19 +185,21 @@ static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pde
 static int __devinit
 ohci_at91_start (struct usb_hcd *hcd)
 {
-//     struct at91_ohci_data   *board = hcd->self.controller->platform_data;
+       struct at91_usbh_data   *board = hcd->self.controller->platform_data;
        struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
+       struct usb_device       *root = hcd->self.root_hub;
        int                     ret;
 
        if ((ret = ohci_init(ohci)) < 0)
                return ret;
 
+       root->maxchild = board->ports;
+
        if ((ret = ohci_run(ohci)) < 0) {
                err("can't start %s", hcd->self.bus_name);
                ohci_stop(hcd);
                return ret;
        }
-//     hcd->self.root_hub->maxchild = board->ports;
        return 0;
 }
 
@@ -198,7 +207,7 @@ ohci_at91_start (struct usb_hcd *hcd)
 
 static const struct hc_driver ohci_at91_hc_driver = {
        .description =          hcd_name,
-       .product_desc =         "AT91RM9200 OHCI",
+       .product_desc =         "AT91 OHCI",
        .hcd_priv_size =        sizeof(struct ohci_hcd),
 
        /*
@@ -240,33 +249,54 @@ static const struct hc_driver ohci_at91_hc_driver = {
 
 /*-------------------------------------------------------------------------*/
 
-static int ohci_hcd_at91_drv_probe(struct platform_device *dev)
+static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
 {
-       return usb_hcd_at91_probe(&ohci_at91_hc_driver, dev);
+       device_init_wakeup(&pdev->dev, 1);
+       return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
 }
 
-static int ohci_hcd_at91_drv_remove(struct platform_device *dev)
+static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
 {
-       return usb_hcd_at91_remove(platform_get_drvdata(dev), dev);
+       device_init_wakeup(&pdev->dev, 0);
+       return usb_hcd_at91_remove(platform_get_drvdata(pdev), pdev);
 }
 
 #ifdef CONFIG_PM
 
-/* REVISIT suspend/resume look "too" simple here */
-
 static int
-ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg)
+ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
-       clk_disable(fclk);
-       clk_disable(iclk);
+       struct usb_hcd  *hcd = platform_get_drvdata(pdev);
+       struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+
+       if (device_may_wakeup(&pdev->dev))
+               enable_irq_wake(hcd->irq);
+       else
+               disable_irq_wake(hcd->irq);
+
+       /*
+        * The integrated transceivers seem unable to notice disconnect,
+        * reconnect, or wakeup without the 48 MHz clock active.  so for
+        * correctness, always discard connection state (using reset).
+        *
+        * REVISIT: some boards will be able to turn VBUS off...
+        */
+       if (at91_suspend_entering_slow_clock()) {
+               ohci_usb_reset (ohci);
+               clk_disable(fclk);
+               clk_disable(iclk);
+               clocked = 0;
+       }
 
        return 0;
 }
 
-static int ohci_hcd_at91_drv_resume(struct platform_device *dev)
+static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
 {
-       clk_enable(iclk);
-       clk_enable(fclk);
+       if (!clocked) {
+               clk_enable(iclk);
+               clk_enable(fclk);
+       }
 
        return 0;
 }
@@ -275,7 +305,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *dev)
 #define ohci_hcd_at91_drv_resume  NULL
 #endif
 
-MODULE_ALIAS("at91rm9200-ohci");
+MODULE_ALIAS("at91_ohci");
 
 static struct platform_driver ohci_hcd_at91_driver = {
        .probe          = ohci_hcd_at91_drv_probe,
@@ -283,7 +313,7 @@ static struct platform_driver ohci_hcd_at91_driver = {
        .suspend        = ohci_hcd_at91_drv_suspend,
        .resume         = ohci_hcd_at91_drv_resume,
        .driver         = {
-               .name   = "at91rm9200-ohci",
+               .name   = "at91_ohci",
                .owner  = THIS_MODULE,
        },
 };
index 822914e2f43bbbe80a31616da47f40d3dfc06a4a..f7a975d5db097757965b758baf14612c86b72f62 100644 (file)
@@ -110,7 +110,6 @@ static void au1xxx_start_ohc(struct platform_device *dev)
 
        printk(KERN_DEBUG __FILE__
        ": Clock to USB host has been enabled \n");
-#endif
 }
 
 static void au1xxx_stop_ohc(struct platform_device *dev)
index afef5ac35b4af79d3137532898930a8bbea40c86..94d8cf4b36c19cf1472ae3c64d5874d143fd60fa 100644 (file)
@@ -913,7 +913,7 @@ MODULE_LICENSE ("GPL");
 #include "ohci-ppc-soc.c"
 #endif
 
-#ifdef CONFIG_ARCH_AT91RM9200
+#if defined(CONFIG_ARCH_AT91RM9200) || defined(CONFIG_ARCH_AT91SAM9261)
 #include "ohci-at91.c"
 #endif
 
@@ -927,6 +927,7 @@ MODULE_LICENSE ("GPL");
       || defined (CONFIG_SOC_AU1X00) \
       || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \
       || defined (CONFIG_ARCH_AT91RM9200) \
+      || defined (CONFIG_ARCH_AT91SAM9261) \
        )
 #error "missing bus glue for ohci-hcd"
 #endif
index c9d72ac0a1d775872ed78ed733980e40244749a0..66c3f61bc9d1332da61027fd5b2a005c7af941f1 100644 (file)
@@ -943,7 +943,9 @@ static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb)
                        /* We received a short packet */
                        if (urb->transfer_flags & URB_SHORT_NOT_OK)
                                ret = -EREMOTEIO;
-                       else if (ctrlstat & TD_CTRL_SPD)
+
+                       /* Fixup needed only if this isn't the URB's last TD */
+                       else if (&td->list != urbp->td_list.prev)
                                ret = 1;
                }
 
index 9e3f139033714b49c2c7ef101803d52a78e02112..044faa07e2976f49bf81bf8514f4c3b4575babbe 100644 (file)
@@ -597,9 +597,9 @@ static void atp_disconnect(struct usb_interface *iface)
        if (dev) {
                usb_kill_urb(dev->urb);
                input_unregister_device(dev->input);
-               usb_free_urb(dev->urb);
                usb_buffer_free(dev->udev, dev->datalen,
                                dev->data, dev->urb->transfer_dma);
+               usb_free_urb(dev->urb);
                kfree(dev);
        }
        printk(KERN_INFO "input: appletouch disconnected\n");
index 05d2d6012eb247d4700abdb086bc257eaea1c792..3719fcb04b8f4bb01973f6dea86d4918e3dd1433 100644 (file)
 #define NAME_BUFSIZE      80    /* size of product name, path buffers */
 #define DATA_BUFSIZE      63    /* size of URB data buffers */
 
+/*
+ * Duplicate event filtering time.
+ * Sequential, identical KIND_FILTERED inputs with less than
+ * FILTER_TIME milliseconds between them are considered as repeat
+ * events. The hardware generates 5 events for the first keypress
+ * and we have to take this into account for an accurate repeat
+ * behaviour.
+ */
+#define FILTER_TIME    60 /* msec */
+
 static unsigned long channel_mask;
-module_param(channel_mask, ulong, 0444);
+module_param(channel_mask, ulong, 0644);
 MODULE_PARM_DESC(channel_mask, "Bitmask of remote control channels to ignore");
 
 static int debug;
-module_param(debug, int, 0444);
+module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Enable extra debug messages and information");
 
+static int repeat_filter = FILTER_TIME;
+module_param(repeat_filter, int, 0644);
+MODULE_PARM_DESC(repeat_filter, "Repeat filter time, default = 60 msec");
+
 #define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0)
 #undef err
 #define err(format, arg...) printk(KERN_ERR format , ## arg)
@@ -143,19 +157,6 @@ MODULE_DEVICE_TABLE(usb, ati_remote_table);
 static char init1[] = { 0x01, 0x00, 0x20, 0x14 };
 static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };
 
-/* Acceleration curve for directional control pad */
-static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
-
-/* Duplicate event filtering time.
- * Sequential, identical KIND_FILTERED inputs with less than
- * FILTER_TIME jiffies between them are considered as repeat
- * events. The hardware generates 5 events for the first keypress
- * and we have to take this into account for an accurate repeat
- * behaviour.
- * (HZ / 20) == 50 ms and works well for me.
- */
-#define FILTER_TIME (HZ / 20)
-
 struct ati_remote {
        struct input_dev *idev;
        struct usb_device *udev;
@@ -412,6 +413,43 @@ static int ati_remote_event_lookup(int rem, unsigned char d1, unsigned char d2)
        return -1;
 }
 
+/*
+ *     ati_remote_compute_accel
+ *
+ * Implements acceleration curve for directional control pad
+ * If elapsed time since last event is > 1/4 second, user "stopped",
+ * so reset acceleration. Otherwise, user is probably holding the control
+ * pad down, so we increase acceleration, ramping up over two seconds to
+ * a maximum speed.
+ */
+static int ati_remote_compute_accel(struct ati_remote *ati_remote)
+{
+       static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
+       unsigned long now = jiffies;
+       int acc;
+
+       if (time_after(now, ati_remote->old_jiffies + msecs_to_jiffies(250))) {
+               acc = 1;
+               ati_remote->acc_jiffies = now;
+       }
+       else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(125)))
+               acc = accel[0];
+       else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(250)))
+               acc = accel[1];
+       else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(500)))
+               acc = accel[2];
+       else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(1000)))
+               acc = accel[3];
+       else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(1500)))
+               acc = accel[4];
+       else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(2000)))
+               acc = accel[5];
+       else
+               acc = accel[6];
+
+       return acc;
+}
+
 /*
  *     ati_remote_report_input
  */
@@ -465,9 +503,9 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
 
        if (ati_remote_tbl[index].kind == KIND_FILTERED) {
                /* Filter duplicate events which happen "too close" together. */
-               if ((ati_remote->old_data[0] == data[1]) &&
-                       (ati_remote->old_data[1] == data[2]) &&
-                       time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) {
+               if (ati_remote->old_data[0] == data[1] &&
+                   ati_remote->old_data[1] == data[2] &&
+                   time_before(jiffies, ati_remote->old_jiffies + msecs_to_jiffies(repeat_filter))) {
                        ati_remote->repeat_count++;
                } else {
                        ati_remote->repeat_count = 0;
@@ -477,75 +515,61 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
                ati_remote->old_data[1] = data[2];
                ati_remote->old_jiffies = jiffies;
 
-               if ((ati_remote->repeat_count > 0)
-                   && (ati_remote->repeat_count < 5))
+               if (ati_remote->repeat_count > 0 &&
+                   ati_remote->repeat_count < 5)
                        return;
 
 
                input_regs(dev, regs);
                input_event(dev, ati_remote_tbl[index].type,
                        ati_remote_tbl[index].code, 1);
+               input_sync(dev);
                input_event(dev, ati_remote_tbl[index].type,
                        ati_remote_tbl[index].code, 0);
                input_sync(dev);
 
-               return;
-       }
+       } else {
 
-       /*
-        * Other event kinds are from the directional control pad, and have an
-        * acceleration factor applied to them.  Without this acceleration, the
-        * control pad is mostly unusable.
-        *
-        * If elapsed time since last event is > 1/4 second, user "stopped",
-        * so reset acceleration. Otherwise, user is probably holding the control
-        * pad down, so we increase acceleration, ramping up over two seconds to
-        * a maximum speed.  The acceleration curve is #defined above.
-        */
-       if (time_after(jiffies, ati_remote->old_jiffies + (HZ >> 2))) {
-               acc = 1;
-               ati_remote->acc_jiffies = jiffies;
-       }
-       else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 3)))  acc = accel[0];
-       else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 2)))  acc = accel[1];
-       else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 1)))  acc = accel[2];
-       else if (time_before(jiffies, ati_remote->acc_jiffies + HZ))         acc = accel[3];
-       else if (time_before(jiffies, ati_remote->acc_jiffies + HZ+(HZ>>1))) acc = accel[4];
-       else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ << 1)))  acc = accel[5];
-       else acc = accel[6];
-
-       input_regs(dev, regs);
-       switch (ati_remote_tbl[index].kind) {
-       case KIND_ACCEL:
-               input_event(dev, ati_remote_tbl[index].type,
-                       ati_remote_tbl[index].code,
-                       ati_remote_tbl[index].value * acc);
-               break;
-       case KIND_LU:
-               input_report_rel(dev, REL_X, -acc);
-               input_report_rel(dev, REL_Y, -acc);
-               break;
-       case KIND_RU:
-               input_report_rel(dev, REL_X, acc);
-               input_report_rel(dev, REL_Y, -acc);
-               break;
-       case KIND_LD:
-               input_report_rel(dev, REL_X, -acc);
-               input_report_rel(dev, REL_Y, acc);
-               break;
-       case KIND_RD:
-               input_report_rel(dev, REL_X, acc);
-               input_report_rel(dev, REL_Y, acc);
-               break;
-       default:
-               dev_dbg(&ati_remote->interface->dev, "ati_remote kind=%d\n",
-                       ati_remote_tbl[index].kind);
-       }
-       input_sync(dev);
+               /*
+                * Other event kinds are from the directional control pad, and have an
+                * acceleration factor applied to them.  Without this acceleration, the
+                * control pad is mostly unusable.
+                */
+               acc = ati_remote_compute_accel(ati_remote);
+
+               input_regs(dev, regs);
+               switch (ati_remote_tbl[index].kind) {
+               case KIND_ACCEL:
+                       input_event(dev, ati_remote_tbl[index].type,
+                               ati_remote_tbl[index].code,
+                               ati_remote_tbl[index].value * acc);
+                       break;
+               case KIND_LU:
+                       input_report_rel(dev, REL_X, -acc);
+                       input_report_rel(dev, REL_Y, -acc);
+                       break;
+               case KIND_RU:
+                       input_report_rel(dev, REL_X, acc);
+                       input_report_rel(dev, REL_Y, -acc);
+                       break;
+               case KIND_LD:
+                       input_report_rel(dev, REL_X, -acc);
+                       input_report_rel(dev, REL_Y, acc);
+                       break;
+               case KIND_RD:
+                       input_report_rel(dev, REL_X, acc);
+                       input_report_rel(dev, REL_Y, acc);
+                       break;
+               default:
+                       dev_dbg(&ati_remote->interface->dev, "ati_remote kind=%d\n",
+                               ati_remote_tbl[index].kind);
+               }
+               input_sync(dev);
 
-       ati_remote->old_jiffies = jiffies;
-       ati_remote->old_data[0] = data[1];
-       ati_remote->old_data[1] = data[2];
+               ati_remote->old_jiffies = jiffies;
+               ati_remote->old_data[0] = data[1];
+               ati_remote->old_data[1] = data[2];
+       }
 }
 
 /*
index 028e1ad89f5d96471f08bbb36a96c6d3ee33e121..7208839f2dbf24d50c15516b7d99971980f8160d 100644 (file)
@@ -607,7 +607,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 
        }
 
-       if (usage->hat_min < usage->hat_max || usage->hat_dir) {
+       if (usage->type == EV_ABS &&
+           (usage->hat_min < usage->hat_max || usage->hat_dir)) {
                int i;
                for (i = usage->code; i < usage->code + 2 && i <= max; i++) {
                        input_set_abs_params(input, i, -1, 1, 0, 0);
index 70477f02cc29fc49d93bf9f808ce56bb72b19b3b..f6b839c257a7a0f33cddaafb0c7496d7b6cb28a6 100644 (file)
@@ -49,7 +49,7 @@ struct hiddev {
        int open;
        wait_queue_head_t wait;
        struct hid_device *hid;
-       struct hiddev_list *list;
+       struct list_head list;
 };
 
 struct hiddev_list {
@@ -59,7 +59,7 @@ struct hiddev_list {
        unsigned flags;
        struct fasync_struct *fasync;
        struct hiddev *hiddev;
-       struct hiddev_list *next;
+       struct list_head node;
 };
 
 static struct hiddev *hiddev_table[HIDDEV_MINORS];
@@ -73,12 +73,15 @@ static struct hiddev *hiddev_table[HIDDEV_MINORS];
 static struct hid_report *
 hiddev_lookup_report(struct hid_device *hid, struct hiddev_report_info *rinfo)
 {
-       unsigned flags = rinfo->report_id & ~HID_REPORT_ID_MASK;
+       unsigned int flags = rinfo->report_id & ~HID_REPORT_ID_MASK;
+       unsigned int rid = rinfo->report_id & HID_REPORT_ID_MASK;
        struct hid_report_enum *report_enum;
+       struct hid_report *report;
        struct list_head *list;
 
        if (rinfo->report_type < HID_REPORT_TYPE_MIN ||
-           rinfo->report_type > HID_REPORT_TYPE_MAX) return NULL;
+           rinfo->report_type > HID_REPORT_TYPE_MAX)
+               return NULL;
 
        report_enum = hid->report_enum +
                (rinfo->report_type - HID_REPORT_TYPE_MIN);
@@ -88,21 +91,25 @@ hiddev_lookup_report(struct hid_device *hid, struct hiddev_report_info *rinfo)
                break;
 
        case HID_REPORT_ID_FIRST:
-               list = report_enum->report_list.next;
-               if (list == &report_enum->report_list)
+               if (list_empty(&report_enum->report_list))
                        return NULL;
-               rinfo->report_id = ((struct hid_report *) list)->id;
+
+               list = report_enum->report_list.next;
+               report = list_entry(list, struct hid_report, list);
+               rinfo->report_id = report->id;
                break;
 
        case HID_REPORT_ID_NEXT:
-               list = (struct list_head *)
-                       report_enum->report_id_hash[rinfo->report_id & HID_REPORT_ID_MASK];
-               if (list == NULL)
+               report = report_enum->report_id_hash[rid];
+               if (!report)
                        return NULL;
-               list = list->next;
+
+               list = report->list.next;
                if (list == &report_enum->report_list)
                        return NULL;
-               rinfo->report_id = ((struct hid_report *) list)->id;
+
+               report = list_entry(list, struct hid_report, list);
+               rinfo->report_id = report->id;
                break;
 
        default:
@@ -125,12 +132,13 @@ hiddev_lookup_usage(struct hid_device *hid, struct hiddev_usage_ref *uref)
        struct hid_field *field;
 
        if (uref->report_type < HID_REPORT_TYPE_MIN ||
-           uref->report_type > HID_REPORT_TYPE_MAX) return NULL;
+           uref->report_type > HID_REPORT_TYPE_MAX)
+               return NULL;
 
        report_enum = hid->report_enum +
                (uref->report_type - HID_REPORT_TYPE_MIN);
 
-       list_for_each_entry(report, &report_enum->report_list, list)
+       list_for_each_entry(report, &report_enum->report_list, list) {
                for (i = 0; i < report->maxfield; i++) {
                        field = report->field[i];
                        for (j = 0; j < field->maxusage; j++) {
@@ -142,6 +150,7 @@ hiddev_lookup_usage(struct hid_device *hid, struct hiddev_usage_ref *uref)
                                }
                        }
                }
+       }
 
        return NULL;
 }
@@ -150,9 +159,9 @@ static void hiddev_send_event(struct hid_device *hid,
                              struct hiddev_usage_ref *uref)
 {
        struct hiddev *hiddev = hid->hiddev;
-       struct hiddev_list *list = hiddev->list;
+       struct hiddev_list *list;
 
-       while (list) {
+       list_for_each_entry(list, &hiddev->list, node) {
                if (uref->field_index != HID_FIELD_INDEX_NONE ||
                    (list->flags & HIDDEV_FLAG_REPORT) != 0) {
                        list->buffer[list->head] = *uref;
@@ -160,8 +169,6 @@ static void hiddev_send_event(struct hid_device *hid,
                                (HIDDEV_BUFFER_SIZE - 1);
                        kill_fasync(&list->fasync, SIGIO, POLL_IN);
                }
-
-               list = list->next;
        }
 
        wake_up_interruptible(&hiddev->wait);
@@ -180,7 +187,7 @@ void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
        uref.report_type =
          (type == HID_INPUT_REPORT) ? HID_REPORT_TYPE_INPUT :
          ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT :
-          ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0));
+          ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE : 0));
        uref.report_id = field->report->id;
        uref.field_index = field->index;
        uref.usage_index = (usage - field->usage);
@@ -200,7 +207,7 @@ void hiddev_report_event(struct hid_device *hid, struct hid_report *report)
        uref.report_type =
          (type == HID_INPUT_REPORT) ? HID_REPORT_TYPE_INPUT :
          ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT :
-          ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0));
+          ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE : 0));
        uref.report_id = report->id;
        uref.field_index = HID_FIELD_INDEX_NONE;
 
@@ -213,7 +220,9 @@ static int hiddev_fasync(int fd, struct file *file, int on)
 {
        int retval;
        struct hiddev_list *list = file->private_data;
+
        retval = fasync_helper(fd, file, on, &list->fasync);
+
        return retval < 0 ? retval : 0;
 }
 
@@ -224,14 +233,9 @@ static int hiddev_fasync(int fd, struct file *file, int on)
 static int hiddev_release(struct inode * inode, struct file * file)
 {
        struct hiddev_list *list = file->private_data;
-       struct hiddev_list **listptr;
 
-       listptr = &list->hiddev->list;
        hiddev_fasync(-1, file, 0);
-
-       while (*listptr && (*listptr != list))
-               listptr = &((*listptr)->next);
-       *listptr = (*listptr)->next;
+       list_del(&list->node);
 
        if (!--list->hiddev->open) {
                if (list->hiddev->exist)
@@ -248,7 +252,8 @@ static int hiddev_release(struct inode * inode, struct file * file)
 /*
  * open file op
  */
-static int hiddev_open(struct inode * inode, struct file * file) {
+static int hiddev_open(struct inode *inode, struct file *file)
+{
        struct hiddev_list *list;
 
        int i = iminor(inode) - HIDDEV_MINOR_BASE;
@@ -260,9 +265,7 @@ static int hiddev_open(struct inode * inode, struct file * file) {
                return -ENOMEM;
 
        list->hiddev = hiddev_table[i];
-       list->next = hiddev_table[i]->list;
-       hiddev_table[i]->list = list;
-
+       list_add_tail(&list->node, &hiddev_table[i]->list);
        file->private_data = list;
 
        if (!list->hiddev->open++)
@@ -362,6 +365,7 @@ static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t coun
 static unsigned int hiddev_poll(struct file *file, poll_table *wait)
 {
        struct hiddev_list *list = file->private_data;
+
        poll_wait(file, &list->hiddev->wait, wait);
        if (list->head != list->tail)
                return POLLIN | POLLRDNORM;
@@ -382,7 +386,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
        struct hiddev_collection_info cinfo;
        struct hiddev_report_info rinfo;
        struct hiddev_field_info finfo;
-       struct hiddev_usage_ref_multi *uref_multi=NULL;
+       struct hiddev_usage_ref_multi *uref_multi = NULL;
        struct hiddev_usage_ref *uref;
        struct hiddev_devinfo dinfo;
        struct hid_report *report;
@@ -764,15 +768,15 @@ int hiddev_connect(struct hid_device *hid)
        }
 
        init_waitqueue_head(&hiddev->wait);
-
-       hiddev_table[hid->intf->minor - HIDDEV_MINOR_BASE] = hiddev;
-
+       INIT_LIST_HEAD(&hiddev->list);
        hiddev->hid = hid;
        hiddev->exist = 1;
 
        hid->minor = hid->intf->minor;
        hid->hiddev = hiddev;
 
+       hiddev_table[hid->intf->minor - HIDDEV_MINOR_BASE] = hiddev;
+
        return 0;
 }
 
index e091d327bd9e7839eccee2a9b11d036959feb30e..a4062a6adbb830f20c9539b063e69ae493d8c966 100644 (file)
 *      the single I/O ports of the device.
 *
 *      Supported vendors:      AK Modul-Bus Computer GmbH
-*      Supported devices:      CY7C63001A-PC (to be continued...)
-*      Supported functions:    Read/Write Ports (to be continued...)
+*                              (Firmware "Port-Chip")
+*
+*      Supported devices:      CY7C63001A-PC
+*                              CY7C63001C-PXC
+*                              CY7C63001C-SXC
+*
+*      Supported functions:    Read/Write Ports
 *
 *
 *      This program is free software; you can redistribute it and/or
index 786e1dbe88ec4dbbd82484146ad77fa6d7444473..983e104dd4520653baa6f61c4ca2ccff10a16ba5 100644 (file)
@@ -1242,11 +1242,12 @@ done:
 static int ctrl_out (struct usbtest_dev *dev,
                unsigned count, unsigned length, unsigned vary)
 {
-       unsigned                i, j, len, retval;
+       unsigned                i, j, len;
+       int                     retval;
        u8                      *buf;
        char                    *what = "?";
        struct usb_device       *udev;
-       
+
        if (length < 1 || length > 0xffff || vary >= length)
                return -EINVAL;
 
index e5e6e4f3ef874e5128bfd52f8202e78d7d4edc54..bd09232ce13c5fc5052d708a18315bf6498a08a4 100644 (file)
@@ -175,6 +175,8 @@ static inline struct sk_buff *pull_skb(rtl8150_t *);
 static void rtl8150_disconnect(struct usb_interface *intf);
 static int rtl8150_probe(struct usb_interface *intf,
                           const struct usb_device_id *id);
+static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message);
+static int rtl8150_resume(struct usb_interface *intf);
 
 static const char driver_name [] = "rtl8150";
 
@@ -183,6 +185,8 @@ static struct usb_driver rtl8150_driver = {
        .probe =        rtl8150_probe,
        .disconnect =   rtl8150_disconnect,
        .id_table =     rtl8150_table,
+       .suspend =      rtl8150_suspend,
+       .resume =       rtl8150_resume
 };
 
 /*
@@ -238,9 +242,11 @@ static int async_set_registers(rtl8150_t * dev, u16 indx, u16 size)
        usb_fill_control_urb(dev->ctrl_urb, dev->udev,
                         usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr,
                         &dev->rx_creg, size, ctrl_callback, dev);
-       if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC)))
+       if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) {
+               if (ret == -ENODEV)
+                       netif_device_detach(dev->netdev);
                err("control request submission failed: %d", ret);
-       else
+       else
                set_bit(RX_REG_SET, &dev->flags);
 
        return ret;
@@ -416,6 +422,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
        struct sk_buff *skb;
        struct net_device *netdev;
        u16 rx_stat;
+       int status;
 
        dev = urb->context;
        if (!dev)
@@ -465,7 +472,10 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
 goon:
        usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
                      dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
-       if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) {
+       status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
+       if (status == -ENODEV)
+               netif_device_detach(dev->netdev);
+       else if (status) {
                set_bit(RX_URB_FAIL, &dev->flags);
                goto resched;
        } else {
@@ -481,6 +491,7 @@ static void rx_fixup(unsigned long data)
 {
        rtl8150_t *dev;
        struct sk_buff *skb;
+       int status;
 
        dev = (rtl8150_t *)data;
 
@@ -499,10 +510,13 @@ static void rx_fixup(unsigned long data)
        usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
                      dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
 try_again:
-       if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) {
+       status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
+       if (status == -ENODEV) {
+               netif_device_detach(dev->netdev);
+       } else if (status) {
                set_bit(RX_URB_FAIL, &dev->flags);
                goto tlsched;
-        } else {
+       } else {
                clear_bit(RX_URB_FAIL, &dev->flags);
        }
 
@@ -574,12 +588,43 @@ static void intr_callback(struct urb *urb, struct pt_regs *regs)
 
 resubmit:
        status = usb_submit_urb (urb, SLAB_ATOMIC);
-       if (status)
+       if (status == -ENODEV)
+               netif_device_detach(dev->netdev);
+       else if (status)
                err ("can't resubmit intr, %s-%s/input0, status %d",
                                dev->udev->bus->bus_name,
                                dev->udev->devpath, status);
 }
 
+static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message)
+{
+       rtl8150_t *dev = usb_get_intfdata(intf);
+
+       netif_device_detach(dev->netdev);
+
+       if (netif_running(dev->netdev)) {
+               usb_kill_urb(dev->rx_urb);
+               usb_kill_urb(dev->intr_urb);
+       }
+       return 0;
+}
+
+static int rtl8150_resume(struct usb_interface *intf)
+{
+       rtl8150_t *dev = usb_get_intfdata(intf);
+
+       netif_device_attach(dev->netdev);
+       if (netif_running(dev->netdev)) {
+               dev->rx_urb->status = 0;
+               dev->rx_urb->actual_length = 0;
+               read_bulk_callback(dev->rx_urb, NULL);
+
+               dev->intr_urb->status = 0;
+               dev->intr_urb->actual_length = 0;
+               intr_callback(dev->intr_urb, NULL);
+       }
+       return 0;
+}
 
 /*
 **
@@ -690,9 +735,14 @@ static int rtl8150_start_xmit(struct sk_buff *skb, struct net_device *netdev)
        usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2),
                      skb->data, count, write_bulk_callback, dev);
        if ((res = usb_submit_urb(dev->tx_urb, GFP_ATOMIC))) {
-               warn("failed tx_urb %d\n", res);
-               dev->stats.tx_errors++;
-               netif_start_queue(netdev);
+               /* Can we get/handle EPIPE here? */
+               if (res == -ENODEV)
+                       netif_device_detach(dev->netdev);
+               else {
+                       warn("failed tx_urb %d\n", res);
+                       dev->stats.tx_errors++;
+                       netif_start_queue(netdev);
+               }
        } else {
                dev->stats.tx_packets++;
                dev->stats.tx_bytes += skb->len;
@@ -729,16 +779,25 @@ static int rtl8150_open(struct net_device *netdev)
        
        usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
                      dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
-       if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL)))
+       if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) {
+               if (res == -ENODEV)
+                       netif_device_detach(dev->netdev);
                warn("%s: rx_urb submit failed: %d", __FUNCTION__, res);
+               return res;
+       }
        usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3),
                     dev->intr_buff, INTBUFSIZE, intr_callback,
                     dev, dev->intr_interval);
-       if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL)))
+       if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) {
+               if (res == -ENODEV)
+                       netif_device_detach(dev->netdev);
                warn("%s: intr_urb submit failed: %d", __FUNCTION__, res);
-       netif_start_queue(netdev);
+               usb_kill_urb(dev->rx_urb);
+               return res;
+       }
        enable_net_traffic(dev);
        set_carrier(netdev);
+       netif_start_queue(netdev);
 
        return res;
 }
index ac33bd47cfce8746ac009e8fa64927538ec68612..f5b9438c94f0f29bd35392906b59759420ebad44 100644 (file)
@@ -62,15 +62,6 @@ config USB_SERIAL_AIRPRIME
          To compile this driver as a module, choose M here: the
          module will be called airprime.
 
-config USB_SERIAL_ANYDATA
-       tristate "USB AnyData CDMA Wireless Driver"
-       depends on USB_SERIAL
-       help
-         Say Y here if you want to use a AnyData CDMA device.
-
-         To compile this driver as a module, choose M here: the
-         module will be called anydata.
-
 config USB_SERIAL_ARK3116
        tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)"
        depends on USB_SERIAL && EXPERIMENTAL
@@ -502,15 +493,18 @@ config USB_SERIAL_XIRCOM
          module will be called keyspan_pda.
 
 config USB_SERIAL_OPTION
-       tristate "USB driver for GSM modems"
+       tristate "USB driver for GSM and CDMA modems"
        depends on USB_SERIAL
        help
-         Say Y here if you have an "Option" GSM PCMCIA card
-         (or an OEM version: branded Huawei, Audiovox, or Novatel).
+         Say Y here if you have a GSM or CDMA modem that's connected to USB.
+
+         This driver also supports several PCMCIA cards which have a
+         built-in OHCI-USB adapter and an internally-connected GSM modem.
+         The USB bus on these cards is not accessible externally.
 
-         These cards feature a built-in OHCI-USB adapter and an
-         internally-connected GSM modem. The USB bus is not
-         accessible externally.
+         Supported devices include (some of?) those made by:
+         Option, Huawei, Audiovox, Sierra Wireless, Novatel Wireless, or
+         Anydata.
 
          To compile this driver as a module, choose M here: the
          module will be called option.
index 35d4acc7f1d3276d9eea7ef119ef372aaae60c0c..8efed2ce1ba38260f97968b4c9c9e84f86fbf491 100644 (file)
@@ -12,7 +12,6 @@ usbserial-obj-$(CONFIG_USB_EZUSB)             += ezusb.o
 usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y)
 
 obj-$(CONFIG_USB_SERIAL_AIRPRIME)              += airprime.o
-obj-$(CONFIG_USB_SERIAL_ANYDATA)               += anydata.o
 obj-$(CONFIG_USB_SERIAL_ARK3116)               += ark3116.o
 obj-$(CONFIG_USB_SERIAL_BELKIN)                        += belkin_sa.o
 obj-$(CONFIG_USB_SERIAL_CP2101)                        += cp2101.o
diff --git a/drivers/usb/serial/anydata.c b/drivers/usb/serial/anydata.c
deleted file mode 100644 (file)
index 01843ef..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * AnyData CDMA Serial USB driver
- *
- * Copyright (C) 2005 Greg Kroah-Hartman <gregkh@suse.de>
- *
- *     This program is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License version
- *     2 as published by the Free Software Foundation.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/tty.h>
-#include <linux/module.h>
-#include <linux/usb.h>
-#include <linux/usb/serial.h>
-
-static struct usb_device_id id_table [] = {
-       { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */
-       { },
-};
-MODULE_DEVICE_TABLE(usb, id_table);
-
-/* if overridden by the user, then use their value for the size of the
- * read and write urbs */
-static int buffer_size;
-static int debug;
-
-static struct usb_driver anydata_driver = {
-       .name =         "anydata",
-       .probe =        usb_serial_probe,
-       .disconnect =   usb_serial_disconnect,
-       .id_table =     id_table,
-       .no_dynamic_id =        1,
-};
-
-static int anydata_open(struct usb_serial_port *port, struct file *filp)
-{
-       char *buffer;
-       int result = 0;
-
-       dbg("%s - port %d", __FUNCTION__, port->number);
-
-       if (buffer_size) {
-               /* override the default buffer sizes */
-               buffer = kmalloc(buffer_size, GFP_KERNEL);
-               if (!buffer) {
-                       dev_err(&port->dev, "%s - out of memory.\n",
-                               __FUNCTION__);
-                       return -ENOMEM;
-               }
-               kfree (port->read_urb->transfer_buffer);
-               port->read_urb->transfer_buffer = buffer;
-               port->read_urb->transfer_buffer_length = buffer_size;
-
-               buffer = kmalloc(buffer_size, GFP_KERNEL);
-               if (!buffer) {
-                       dev_err(&port->dev, "%s - out of memory.\n",
-                               __FUNCTION__);
-                       return -ENOMEM;
-               }
-               kfree (port->write_urb->transfer_buffer);
-               port->write_urb->transfer_buffer = buffer;
-               port->write_urb->transfer_buffer_length = buffer_size;
-               port->bulk_out_size = buffer_size;
-       }
-
-       /* Start reading from the device */
-       usb_fill_bulk_urb(port->read_urb, port->serial->dev,
-                         usb_rcvbulkpipe(port->serial->dev,
-                                         port->bulk_in_endpointAddress),
-                         port->read_urb->transfer_buffer,
-                         port->read_urb->transfer_buffer_length,
-                         usb_serial_generic_read_bulk_callback, port);
-       result = usb_submit_urb(port->read_urb, GFP_KERNEL);
-       if (result)
-               dev_err(&port->dev,
-                       "%s - failed submitting read urb, error %d\n",
-                       __FUNCTION__, result);
-
-       return result;
-}
-
-static struct usb_serial_driver anydata_device = {
-       .driver = {
-               .owner =        THIS_MODULE,
-               .name =         "anydata",
-       },
-       .id_table =             id_table,
-       .num_interrupt_in =     NUM_DONT_CARE,
-       .num_bulk_in =          NUM_DONT_CARE,
-       .num_bulk_out =         NUM_DONT_CARE,
-       .num_ports =            1,
-       .open =                 anydata_open,
-};
-
-static int __init anydata_init(void)
-{
-       int retval;
-
-       retval = usb_serial_register(&anydata_device);
-       if (retval)
-               return retval;
-       retval = usb_register(&anydata_driver);
-       if (retval)
-               usb_serial_deregister(&anydata_device);
-       return retval;
-}
-
-static void __exit anydata_exit(void)
-{
-       usb_deregister(&anydata_driver);
-       usb_serial_deregister(&anydata_device);
-}
-
-module_init(anydata_init);
-module_exit(anydata_exit);
-MODULE_LICENSE("GPL");
-
-module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Debug enabled or not");
-module_param(buffer_size, int, 0);
-MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers");
index b458aedc5fb6ae541166fc8f66da7cc91f5cb22f..15945e806f032971abd692fc40bcc850f9133902 100644 (file)
@@ -306,6 +306,8 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
 
 
 static struct usb_device_id id_table_combined [] = {
+       { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) },
@@ -337,6 +339,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
        { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) },
        { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) },
        { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) },
index 04ef90fcb8766d3adffa2f345a178e55a5f7c12b..8888cd80a491a6da9b7adc40481d721101b488a5 100644 (file)
 #define FTDI_NF_RIC_PID        0x0001  /* Product Id */
 
 
+/* www.canusb.com Lawicel CANUSB device */
+#define FTDI_CANUSB_PID 0xFFA8 /* Product Id */
+
+/* AlphaMicro Components AMC-232USB01 device */
+#define FTDI_AMC232_PID 0xFF00 /* Product Id */
+
 /* ACT Solutions HomePro ZWave interface (http://www.act-solutions.com/HomePro.htm) */
 #define FTDI_ACTZWAVE_PID      0xF2D0
 
 /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
 #define FTDI_USB_UIRT_PID      0xF850  /* Product Id */
 
+/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */
+
+#define FTDI_TNC_X_PID         0xEBE0
+
 /*
  * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
  * All of these devices use FTDI's vendor ID (0x0403).
index 59c5d999009abfbbe31b2c58d3715355c9066d71..9840bade79f974acc9231665498500205ac0ff96 100644 (file)
@@ -250,6 +250,9 @@ static struct usb_device_id ipaq_id_table [] = {
        { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */
        { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */
        { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */
+       { USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */
+       { USB_DEVICE(0x04DD, 0x9121) }, /* SHARP WS004SH USB Modem */
+       { USB_DEVICE(0x04DD, 0x9123) }, /* SHARP WS007SH USB Modem */
        { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */
        { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */
        { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
index f0530c1d7b7a274ca7a2c69bc8a33df199a9f6c1..c856e6f40e22c5ff7716e5d01f18c50a9c2b1bc0 100644 (file)
@@ -9,40 +9,14 @@
 
   Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org>
 
-  History:
-
-  2005-05-19  v0.1   Initial version, based on incomplete docs
-                     and analysis of misbehavior with the standard driver
-  2005-05-20  v0.2   Extended the input buffer to avoid losing
-                     random 64-byte chunks of data
-  2005-05-21  v0.3   implemented chars_in_buffer()
-                     turned on low_latency
-                     simplified the code somewhat
-  2005-05-24  v0.4   option_write() sometimes deadlocked under heavy load
-                     removed some dead code
-                     added sponsor notice
-                     coding style clean-up
-  2005-06-20  v0.4.1 add missing braces :-/
-                     killed end-of-line whitespace
-  2005-07-15  v0.4.2 rename WLAN product to FUSION, add FUSION2
-  2005-09-10  v0.4.3 added HUAWEI E600 card and Audiovox AirCard
-  2005-09-20  v0.4.4 increased recv buffer size: the card sometimes
-                     wants to send >2000 bytes.
-  2006-04-10  v0.5   fixed two array overrun errors :-/
-  2006-04-21  v0.5.1 added support for Sierra Wireless MC8755
-  2006-05-15  v0.6   re-enable multi-port support
-  2006-06-01  v0.6.1 add COBRA
-  2006-06-01  v0.6.2 add backwards-compatibility stuff
-  2006-06-01  v0.6.3 add Novatel Wireless
-  2006-06-01  v0.7   Option => GSM
-  2006-06-01  v0.7.1 add COBRA2
+  History: see the git log.
 
   Work sponsored by: Sigos GmbH, Germany <info@sigos.de>
 
   This driver exists because the "normal" serial driver doesn't work too well
   with GSM modems. Issues:
   - data loss -- one single Receive URB is not nearly enough
-  - nonstandard flow (Option devices) and multiplex (Sierra) control
+  - nonstandard flow (Option devices) control
   - controlling the baud rate doesn't make sense
 
   This driver is named "option" because the most common device it's
@@ -96,8 +70,8 @@ static int  option_send_setup(struct usb_serial_port *port);
 #define OPTION_VENDOR_ID                0x0AF0
 #define HUAWEI_VENDOR_ID                0x12D1
 #define AUDIOVOX_VENDOR_ID              0x0F3D
-#define SIERRAWIRELESS_VENDOR_ID        0x1199
 #define NOVATELWIRELESS_VENDOR_ID       0x1410
+#define ANYDATA_VENDOR_ID               0x16d5
 
 #define OPTION_PRODUCT_OLD              0x5000
 #define OPTION_PRODUCT_FUSION           0x6000
@@ -106,8 +80,8 @@ static int  option_send_setup(struct usb_serial_port *port);
 #define OPTION_PRODUCT_COBRA2           0x6600
 #define HUAWEI_PRODUCT_E600             0x1001
 #define AUDIOVOX_PRODUCT_AIRCARD        0x0112
-#define SIERRAWIRELESS_PRODUCT_MC8755   0x6802
 #define NOVATELWIRELESS_PRODUCT_U740    0x1400
+#define ANYDATA_PRODUCT_ID              0x6501
 
 static struct usb_device_id option_ids[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },
@@ -117,8 +91,8 @@ static struct usb_device_id option_ids[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
        { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
-       { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
+       { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
        { } /* Terminating entry */
 };
 
@@ -131,10 +105,7 @@ static struct usb_device_id option_ids1[] = {
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
        { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
-       { } /* Terminating entry */
-};
-static struct usb_device_id option_ids3[] = {
-       { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) },
+       { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
        { } /* Terminating entry */
 };
 
@@ -151,37 +122,11 @@ static struct usb_driver option_driver = {
 /* The card has three separate interfaces, which the serial driver
  * recognizes separately, thus num_port=1.
  */
-static struct usb_serial_driver option_3port_device = {
-       .driver = {
-               .owner =        THIS_MODULE,
-               .name =         "option",
-       },
-       .description       = "GSM modem (3-port)",
-       .id_table          = option_ids3,
-       .num_interrupt_in  = NUM_DONT_CARE,
-       .num_bulk_in       = NUM_DONT_CARE,
-       .num_bulk_out      = NUM_DONT_CARE,
-       .num_ports         = 3,
-       .open              = option_open,
-       .close             = option_close,
-       .write             = option_write,
-       .write_room        = option_write_room,
-       .chars_in_buffer   = option_chars_in_buffer,
-       .throttle          = option_rx_throttle,
-       .unthrottle        = option_rx_unthrottle,
-       .set_termios       = option_set_termios,
-       .break_ctl         = option_break_ctl,
-       .tiocmget          = option_tiocmget,
-       .tiocmset          = option_tiocmset,
-       .attach            = option_startup,
-       .shutdown          = option_shutdown,
-       .read_int_callback = option_instat_callback,
-};
 
 static struct usb_serial_driver option_1port_device = {
        .driver = {
                .owner =        THIS_MODULE,
-               .name =         "option",
+               .name =         "option1",
        },
        .description       = "GSM modem (1-port)",
        .id_table          = option_ids1,
@@ -245,9 +190,6 @@ static int __init option_init(void)
        retval = usb_serial_register(&option_1port_device);
        if (retval)
                goto failed_1port_device_register;
-       retval = usb_serial_register(&option_3port_device);
-       if (retval)
-               goto failed_3port_device_register;
        retval = usb_register(&option_driver);
        if (retval)
                goto failed_driver_register;
@@ -257,8 +199,6 @@ static int __init option_init(void)
        return 0;
 
 failed_driver_register:
-       usb_serial_deregister (&option_3port_device);
-failed_3port_device_register:
        usb_serial_deregister (&option_1port_device);
 failed_1port_device_register:
        return retval;
@@ -267,7 +207,6 @@ failed_1port_device_register:
 static void __exit option_exit(void)
 {
        usb_deregister (&option_driver);
-       usb_serial_deregister (&option_3port_device);
        usb_serial_deregister (&option_1port_device);
 }
 
@@ -656,7 +595,6 @@ static void option_setup_urbs(struct usb_serial *serial)
 
        dbg("%s", __FUNCTION__);
 
-
        for (i = 0; i < serial->num_ports; i++) {
                port = serial->port[i];
                portdata = usb_get_serial_port_data(port);
index 259db31b65c194b6a2e4a19d76fdb47845b3e517..efbbc0adb89ac26908e387d1f5bd071c72c5e9e6 100644 (file)
@@ -81,6 +81,7 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) },
        { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) },
        { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) },
+       { USB_DEVICE(BELKIN_VENDOR_ID, BELKIN_PRODUCT_ID) },
        { }                                     /* Terminating entry */
 };
 
index d9c1e6e0b4b3427c926983e4ad8bf8c47257ac0d..a692ac66ca6c0a0e89652e0d3c22d320dd738b5f 100644 (file)
@@ -89,3 +89,7 @@
 /* DATAPILOT Universal-2 Phone Cable */
 #define DATAPILOT_U2_VENDOR_ID 0x0731
 #define DATAPILOT_U2_PRODUCT_ID        0x2003
+
+/* Belkin "F5U257" Serial Adapter */
+#define BELKIN_VENDOR_ID       0x050d
+#define BELKIN_PRODUCT_ID      0x0257
index a5ca449f6e645e811022371cdbca9125f4cf18d7..fd158e063c0634bd89ca4791ea006bdc2f47a3be 100644 (file)
@@ -145,6 +145,13 @@ UNUSUAL_DEV(  0x0420, 0x0001, 0x0100, 0x0100,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Mario Rettig <mariorettig@web.de> */
+UNUSUAL_DEV(  0x0421, 0x042e, 0x0100, 0x0100,
+               "Nokia",
+               "Nokia 3250",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
+
 /* Reported by Sumedha Swamy <sumedhaswamy@gmail.com> and
  * Einar Th. Einarsson <einarthered@gmail.com> */
 UNUSUAL_DEV(  0x0421, 0x0444, 0x0100, 0x0100,
@@ -627,18 +634,6 @@ UNUSUAL_DEV(  0x0595, 0x4343, 0x0000, 0x2210,
                "Digital Camera EX-20 DSC",
                US_SC_8070, US_PR_DEVICE, NULL, 0 ),
 
-/* The entry was here before I took over, and had US_SC_RBC. It turns
- * out that isn't needed. Additionally, Torsten Eriksson
- * <Torsten.Eriksson@bergianska.se> is able to use his device fine
- * without this entry at all - but I don't suspect that will be true
- * for all users (the protocol is likely needed), so is staying at
- * this time. - Phil Dibowitz <phil@ipom.com>
- */
-UNUSUAL_DEV(  0x059f, 0xa601, 0x0200, 0x0200, 
-               "LaCie",
-               "USB Hard Disk",
-               US_SC_DEVICE, US_PR_CB, NULL, 0 ),
-
 /* Submitted by Joel Bourquard <numlock@freesurf.ch>
  * Some versions of this device need the SubClass and Protocol overrides
  * while others don't.
@@ -1106,7 +1101,15 @@ UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
                 "Optio S/S4",
                 US_SC_DEVICE, US_PR_DEVICE, NULL,
                 US_FL_FIX_INQUIRY ),
-               
+
+/* This is a virtual windows driver CD, which the zd1211rw driver automatically
+ * converts into a WLAN device. */
+UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
+                "ZyXEL",
+                "G-220F USB-WLAN Install",
+                US_SC_DEVICE, US_PR_DEVICE, NULL,
+                US_FL_IGNORE_DEVICE ),
+
 #ifdef CONFIG_USB_STORAGE_ISD200
 UNUSUAL_DEV(  0x0bf6, 0xa001, 0x0100, 0x0110,
                "ATI",
@@ -1237,6 +1240,16 @@ UNUSUAL_DEV(  0x0ed1, 0x7636, 0x0103, 0x0103,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64),
 
+/* David Kuehling <dvdkhlng@gmx.de>:
+ * for MP3-Player AVOX WSX-300ER (bought in Japan).  Reports lots of SCSI
+ * errors when trying to write.
+ */
+UNUSUAL_DEV(  0x0f19, 0x0105, 0x0100, 0x0100,
+               "C-MEX",
+               "A-VOX",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE ),
+
 /* Reported by Michael Stattmann <michael@stattmann.com> */
 UNUSUAL_DEV(  0x0fce, 0xd008, 0x0000, 0x0000,
                "Sony Ericsson",
index 5ee19be52f6510bd2efea0ca6ac81d0f70082b38..8d7bdcb5924d402f891cbf1a07c2584400a28cb3 100644 (file)
@@ -483,7 +483,7 @@ static struct us_unusual_dev *find_unusual(const struct usb_device_id *id)
 }
 
 /* Get the unusual_devs entries and the string descriptors */
-static void get_device_info(struct us_data *us, const struct usb_device_id *id)
+static int get_device_info(struct us_data *us, const struct usb_device_id *id)
 {
        struct usb_device *dev = us->pusb_dev;
        struct usb_interface_descriptor *idesc =
@@ -500,6 +500,11 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
                        unusual_dev->useTransport;
        us->flags = USB_US_ORIG_FLAGS(id->driver_info);
 
+       if (us->flags & US_FL_IGNORE_DEVICE) {
+               printk(KERN_INFO USB_STORAGE "device ignored\n");
+               return -ENODEV;
+       }
+
        /*
         * This flag is only needed when we're in high-speed, so let's
         * disable it if we're in full-speed
@@ -541,6 +546,8 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
                                msgs[msg],
                                UTS_RELEASE);
        }
+
+       return 0;
 }
 
 /* Get the transport settings */
@@ -969,7 +976,9 @@ static int storage_probe(struct usb_interface *intf,
         * of the match from the usb_device_id table, so we can find the
         * corresponding entry in the private table.
         */
-       get_device_info(us, id);
+       result = get_device_info(us, id);
+       if (result)
+               goto BadDevice;
 
        /* Get the transport, protocol, and pipe settings */
        result = get_transport(us);
index 6533b0f3923133e355284df03934a3b1de60c202..702eb933cf88bc9414ccbcb85e74de2dcfc18b08 100644 (file)
@@ -86,9 +86,11 @@ config FB_MACMODES
        default n
 
 config FB_BACKLIGHT
-       bool
-       depends on FB
-       default n
+       bool
+       depends on FB
+       select BACKLIGHT_LCD_SUPPORT
+       select BACKLIGHT_CLASS_DEVICE
+       default n
 
 config FB_MODE_HELPERS
         bool "Enable Video Mode Handling Helpers"
@@ -420,7 +422,7 @@ config FB_OF
 
 config FB_CONTROL
        bool "Apple \"control\" display support"
-       depends on (FB = y) && PPC_PMAC
+       depends on (FB = y) && PPC_PMAC && PPC32
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -431,7 +433,7 @@ config FB_CONTROL
 
 config FB_PLATINUM
        bool "Apple \"platinum\" display support"
-       depends on (FB = y) && PPC_PMAC
+       depends on (FB = y) && PPC_PMAC && PPC32
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -442,7 +444,7 @@ config FB_PLATINUM
 
 config FB_VALKYRIE
        bool "Apple \"valkyrie\" display support"
-       depends on (FB = y) && (MAC || PPC_PMAC)
+       depends on (FB = y) && (MAC || (PPC_PMAC && PPC32))
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -453,7 +455,7 @@ config FB_VALKYRIE
 
 config FB_CT65550
        bool "Chips 65550 display support"
-       depends on (FB = y) && PPC
+       depends on (FB = y) && PPC32
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -552,7 +554,7 @@ config FB_VESA
 
 config FB_IMAC
        bool "Intel-based Macintosh Framebuffer Support"
-       depends on (FB = y) && X86
+       depends on (FB = y) && X86 && EFI
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -721,10 +723,8 @@ config FB_NVIDIA_I2C
 
 config FB_NVIDIA_BACKLIGHT
        bool "Support for backlight control"
-       depends on FB_NVIDIA && PPC_PMAC
+       depends on FB_NVIDIA && PMAC_BACKLIGHT
        select FB_BACKLIGHT
-       select BACKLIGHT_LCD_SUPPORT
-       select BACKLIGHT_CLASS_DEVICE
        default y
        help
          Say Y here if you want to control the backlight of your display.
@@ -769,10 +769,8 @@ config FB_RIVA_DEBUG
 
 config FB_RIVA_BACKLIGHT
        bool "Support for backlight control"
-       depends on FB_RIVA && PPC_PMAC
+       depends on FB_RIVA && PMAC_BACKLIGHT
        select FB_BACKLIGHT
-       select BACKLIGHT_LCD_SUPPORT
-       select BACKLIGHT_CLASS_DEVICE
        default y
        help
          Say Y here if you want to control the backlight of your display.
@@ -1025,10 +1023,8 @@ config FB_RADEON_I2C
 
 config FB_RADEON_BACKLIGHT
        bool "Support for backlight control"
-       depends on FB_RADEON && PPC_PMAC
+       depends on FB_RADEON && PMAC_BACKLIGHT
        select FB_BACKLIGHT
-       select BACKLIGHT_LCD_SUPPORT
-       select BACKLIGHT_CLASS_DEVICE
        default y
        help
          Say Y here if you want to control the backlight of your display.
@@ -1059,10 +1055,8 @@ config FB_ATY128
 
 config FB_ATY128_BACKLIGHT
        bool "Support for backlight control"
-       depends on FB_ATY128 && PPC_PMAC
+       depends on FB_ATY128 && PMAC_BACKLIGHT
        select FB_BACKLIGHT
-       select BACKLIGHT_LCD_SUPPORT
-       select BACKLIGHT_CLASS_DEVICE
        default y
        help
          Say Y here if you want to control the backlight of your display.
@@ -1111,10 +1105,8 @@ config FB_ATY_GX
 
 config FB_ATY_BACKLIGHT
        bool "Support for backlight control"
-       depends on FB_ATY && PPC_PMAC
+       depends on FB_ATY && PMAC_BACKLIGHT
        select FB_BACKLIGHT
-       select BACKLIGHT_LCD_SUPPORT
-       select BACKLIGHT_CLASS_DEVICE
        default y
        help
          Say Y here if you want to control the backlight of your display.
@@ -1620,7 +1612,7 @@ if FB || SGI_NEWPORT_CONSOLE
        source "drivers/video/logo/Kconfig"
 endif
 
-if FB && SYSFS
+if SYSFS
        source "drivers/video/backlight/Kconfig"
 endif
 
index 95563c9c6b9c7498fdc0d5f2d34e475df1d22882..481c6c9695f821da3bd133017bc4a9c3823046be 100644 (file)
@@ -4,6 +4,7 @@
 
 # Each configuration option enables a list of files.
 
+obj-y                             += fb_notify.o
 obj-$(CONFIG_FB)                  += fb.o
 fb-y                              := fbmem.o fbmon.o fbcmap.o fbsysfs.o \
                                      modedb.o fbcvt.o
index c64a717e2d4b1c4711dd8c32618bddd470f7fc2f..3e827e04a2aab4de2c3081486ff07ef89dbecea0 100644 (file)
@@ -455,7 +455,10 @@ static void do_wait_for_fifo(u16 entries, struct aty128fb_par *par);
 static void wait_for_fifo(u16 entries, struct aty128fb_par *par);
 static void wait_for_idle(struct aty128fb_par *par);
 static u32 depth_to_dst(u32 depth);
+
+#ifdef CONFIG_FB_ATY128_BACKLIGHT
 static void aty128_bl_set_power(struct fb_info *info, int power);
+#endif
 
 #define BIOS_IN8(v)    (readb(bios + (v)))
 #define BIOS_IN16(v)   (readb(bios + (v)) | \
@@ -1910,9 +1913,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
        u8 chip_rev;
        u32 dac;
 
-       if (!par->vram_size)    /* may have already been probed */
-               par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;
-
        /* Get the chip revision */
        chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
 
@@ -2025,9 +2025,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
 
        aty128_init_engine(par);
 
-       if (register_framebuffer(info) < 0)
-               return 0;
-
        par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
        par->pdev = pdev;
        par->asleep = 0;
@@ -2037,6 +2034,9 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
        aty128_bl_init(par);
 #endif
 
+       if (register_framebuffer(info) < 0)
+               return 0;
+
        printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",
               info->node, info->fix.id, video_card);
 
@@ -2086,7 +2086,6 @@ static int __devinit aty128_probe(struct pci_dev *pdev, const struct pci_device_
        par = info->par;
 
        info->pseudo_palette = par->pseudo_palette;
-       info->fix = aty128fb_fix;
 
        /* Virtualize mmio region */
        info->fix.mmio_start = reg_addr;
index 1507d19f481f8ebe84904a152a4f94333fc8f19e..053ff63365b76662ba092608cb3a145af6b2c42c 100644 (file)
@@ -2812,7 +2812,7 @@ static int atyfb_blank(int blank, struct fb_info *info)
        if (par->lock_blank || par->asleep)
                return 0;
 
-#ifdef CONFIG_PMAC_BACKLIGHT
+#ifdef CONFIG_FB_ATY_BACKLIGHT
        if (machine_is(powermac) && blank > FB_BLANK_NORMAL)
                aty_bl_set_power(info, FB_BLANK_POWERDOWN);
 #elif defined(CONFIG_FB_ATY_GENERIC_LCD)
@@ -2844,7 +2844,7 @@ static int atyfb_blank(int blank, struct fb_info *info)
        }
        aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par);
 
-#ifdef CONFIG_PMAC_BACKLIGHT
+#ifdef CONFIG_FB_ATY_BACKLIGHT
        if (machine_is(powermac) && blank <= FB_BLANK_NORMAL)
                aty_bl_set_power(info, FB_BLANK_UNBLANK);
 #elif defined(CONFIG_FB_ATY_GENERIC_LCD)
index 8d85fc58142e62861f5481ff711aabe206bd5f0f..8e3400d5dd21e3f3246b8472287132e2ff73c7ff 100644 (file)
@@ -266,6 +266,8 @@ static int force_measure_pll = 0;
 #ifdef CONFIG_MTRR
 static int nomtrr = 0;
 #endif
+static int force_sleep;
+static int ignore_devlist;
 
 /*
  * prototypes
@@ -2327,9 +2329,9 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
                /* -2 is special: means  ON on mobility chips and do not
                 * change on others
                 */
-               radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1);
+               radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1, ignore_devlist, force_sleep);
        } else
-               radeonfb_pm_init(rinfo, default_dynclk);
+               radeonfb_pm_init(rinfo, default_dynclk, ignore_devlist, force_sleep);
 
        pci_set_drvdata(pdev, info);
 
@@ -2477,6 +2479,12 @@ static int __init radeonfb_setup (char *options)
                        force_measure_pll = 1;
                } else if (!strncmp(this_opt, "ignore_edid", 11)) {
                        ignore_edid = 1;
+#if defined(CONFIG_PM) && defined(CONFIG_X86)
+               } else if (!strncmp(this_opt, "force_sleep", 11)) {
+                       force_sleep = 1;
+               } else if (!strncmp(this_opt, "ignore_devlist", 14)) {
+                       ignore_devlist = 1;
+#endif
                } else
                        mode_option = this_opt;
        }
@@ -2532,3 +2540,9 @@ module_param(panel_yres, int, 0);
 MODULE_PARM_DESC(panel_yres, "int: set panel yres");
 module_param(mode_option, charp, 0);
 MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
+#if defined(CONFIG_PM) && defined(CONFIG_X86)
+module_param(force_sleep, bool, 0);
+MODULE_PARM_DESC(force_sleep, "bool: force D2 sleep mode on all hardware");
+module_param(ignore_devlist, bool, 0);
+MODULE_PARM_DESC(ignore_devlist, "bool: ignore workarounds for bugs in specific laptops");
+#endif
index c7091761cef41614cd08c3dd091eecb65a764205..f31e606a2ded2d8506db105f5d897bb3e02c7373 100644 (file)
 
 #include "ati_ids.h"
 
+static void radeon_reinitialize_M10(struct radeonfb_info *rinfo);
+
+/*
+ * Workarounds for bugs in PC laptops:
+ * - enable D2 sleep in some IBM Thinkpads
+ * - special case for Samsung P35
+ *
+ * Whitelist by subsystem vendor/device because
+ * its the subsystem vendor's fault!
+ */
+
+#if defined(CONFIG_PM) && defined(CONFIG_X86)
+struct radeon_device_id {
+        const char *ident;                     /* (arbitrary) Name */
+        const unsigned short subsystem_vendor; /* Subsystem Vendor ID */
+        const unsigned short subsystem_device; /* Subsystem Device ID */
+       const enum radeon_pm_mode pm_mode_modifier; /* modify pm_mode */
+       const reinit_function_ptr new_reinit_func;   /* changed reinit_func */
+};
+
+#define BUGFIX(model, sv, sd, pm, fn) { \
+       .ident = model, \
+       .subsystem_vendor = sv, \
+       .subsystem_device = sd, \
+       .pm_mode_modifier = pm, \
+       .new_reinit_func  = fn  \
+}
+
+static struct radeon_device_id radeon_workaround_list[] = {
+       BUGFIX("IBM Thinkpad R32",
+              PCI_VENDOR_ID_IBM, 0x1905,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad R40",
+              PCI_VENDOR_ID_IBM, 0x0526,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad R40",
+              PCI_VENDOR_ID_IBM, 0x0527,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad R50/R51/T40/T41",
+              PCI_VENDOR_ID_IBM, 0x0531,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad R51/T40/T41/T42",
+              PCI_VENDOR_ID_IBM, 0x0530,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad T30",
+              PCI_VENDOR_ID_IBM, 0x0517,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad T40p",
+              PCI_VENDOR_ID_IBM, 0x054d,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad T42",
+              PCI_VENDOR_ID_IBM, 0x0550,
+              radeon_pm_d2, NULL),
+       BUGFIX("IBM Thinkpad X31/X32",
+              PCI_VENDOR_ID_IBM, 0x052f,
+              radeon_pm_d2, NULL),
+       BUGFIX("Samsung P35",
+              PCI_VENDOR_ID_SAMSUNG, 0xc00c,
+              radeon_pm_off, radeon_reinitialize_M10),
+       { .ident = NULL }
+};
+
+static int radeon_apply_workarounds(struct radeonfb_info *rinfo)
+{
+       struct radeon_device_id *id;
+
+       for (id = radeon_workaround_list; id->ident != NULL; id++ )
+               if ((id->subsystem_vendor == rinfo->pdev->subsystem_vendor ) &&
+                   (id->subsystem_device == rinfo->pdev->subsystem_device )) {
+
+                       /* we found a device that requires workaround */
+                       printk(KERN_DEBUG "radeonfb: %s detected"
+                              ", enabling workaround\n", id->ident);
+
+                       rinfo->pm_mode |= id->pm_mode_modifier;
+
+                       if (id->new_reinit_func != NULL)
+                               rinfo->reinit_func = id->new_reinit_func;
+
+                       return 1;
+               }
+       return 0;  /* not found */
+}
+
+#else  /* defined(CONFIG_PM) && defined(CONFIG_X86) */
+static inline int radeon_apply_workarounds(struct radeonfb_info *rinfo)
+{
+        return 0;
+}
+#endif /* defined(CONFIG_PM) && defined(CONFIG_X86) */
+
+
+
 static void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo)
 {
        u32 tmp;
@@ -852,18 +945,26 @@ static void radeon_pm_setup_for_suspend(struct radeonfb_info *rinfo)
        /* because both INPLL and OUTPLL take the same lock, that's why. */
        tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND;
        OUTPLL( pllMCLK_MISC, tmp);
-       
-       /* AGP PLL control */
-       if (rinfo->family <= CHIP_FAMILY_RV280) {
-               OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) |  BUS_CNTL1__AGPCLK_VALID);
 
-               OUTREG(BUS_CNTL1,
-                      (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK)
-                      | (2<<BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT));   // 440BX
-       } else {
-               OUTREG(BUS_CNTL1, INREG(BUS_CNTL1));
-               OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000);
+       /* BUS_CNTL1__MOBILE_PLATORM_SEL setting is northbridge chipset
+        * and radeon chip dependent. Thus we only enable it on Mac for
+        * now (until we get more info on how to compute the correct
+        * value for various X86 bridges).
+        */
+#ifdef CONFIG_PPC_PMAC
+       if (machine_is(powermac)) {
+               /* AGP PLL control */
+               if (rinfo->family <= CHIP_FAMILY_RV280) {
+                       OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) |  BUS_CNTL1__AGPCLK_VALID);
+                       OUTREG(BUS_CNTL1,
+                              (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK)
+                              | (2<<BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT));   // 440BX
+               } else {
+                       OUTREG(BUS_CNTL1, INREG(BUS_CNTL1));
+                       OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000);
+               }
        }
+#endif
 
        OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL)
                                  & ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN));
@@ -2713,7 +2814,7 @@ static void radeonfb_early_resume(void *data)
 
 #endif /* CONFIG_PM */
 
-void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk)
+void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
 {
        /* Find PM registers in config space if any*/
        rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
@@ -2729,22 +2830,13 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk)
        }
 
 #if defined(CONFIG_PM)
+#if defined(CONFIG_PPC_PMAC)
        /* Check if we can power manage on suspend/resume. We can do
         * D2 on M6, M7 and M9, and we can resume from D3 cold a few other
         * "Mac" cards, but that's all. We need more infos about what the
         * BIOS does tho. Right now, all this PM stuff is pmac-only for that
         * reason. --BenH
         */
-       /* Special case for Samsung P35 laptops
-        */
-       if ((rinfo->pdev->vendor == PCI_VENDOR_ID_ATI) &&
-           (rinfo->pdev->device == PCI_CHIP_RV350_NP) &&
-           (rinfo->pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG) &&
-           (rinfo->pdev->subsystem_device == 0xc00c)) {
-               rinfo->reinit_func = radeon_reinitialize_M10;
-               rinfo->pm_mode |= radeon_pm_off;
-       }
-#if defined(CONFIG_PPC_PMAC)
        if (machine_is(powermac) && rinfo->of_node) {
                if (rinfo->is_mobility && rinfo->pm_reg &&
                    rinfo->family <= CHIP_FAMILY_RV250)
@@ -2790,6 +2882,18 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk)
        }
 #endif /* defined(CONFIG_PPC_PMAC) */
 #endif /* defined(CONFIG_PM) */
+
+       if (ignore_devlist)
+               printk(KERN_DEBUG
+                      "radeonfb: skipping test for device workarounds\n");
+       else
+               radeon_apply_workarounds(rinfo);
+
+       if (force_sleep) {
+               printk(KERN_DEBUG
+                      "radeonfb: forcefully enabling D2 sleep mode\n");
+               rinfo->pm_mode |= radeon_pm_d2;
+       }
 }
 
 void radeonfb_pm_exit(struct radeonfb_info *rinfo)
index 38657b2d10eb9c2010d10a578584f8f3c0a4a46e..d5ff224a625843e74ed64c27225ee664ce9dfcb3 100644 (file)
@@ -273,6 +273,8 @@ enum radeon_pm_mode {
        radeon_pm_off   = 0x00000002,   /* Can resume from D3 cold */
 };
 
+typedef void (*reinit_function_ptr)(struct radeonfb_info *rinfo);
+
 struct radeonfb_info {
        struct fb_info          *info;
 
@@ -338,7 +340,7 @@ struct radeonfb_info {
        int                     dynclk;
        int                     no_schedule;
        enum radeon_pm_mode     pm_mode;
-       void                    (*reinit_func)(struct radeonfb_info *rinfo);
+       reinit_function_ptr     reinit_func;
 
        /* Lock on register access */
        spinlock_t              reg_lock;
@@ -600,7 +602,7 @@ extern int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8
 /* PM Functions */
 extern int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state);
 extern int radeonfb_pci_resume(struct pci_dev *pdev);
-extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk);
+extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep);
 extern void radeonfb_pm_exit(struct radeonfb_info *rinfo);
 
 /* Monitor probe functions */
index a92a91fef16fc303d0aa393c4af607a063e305a2..f25d5d648333cb6665529154aeaec90184da02b5 100644 (file)
@@ -156,7 +156,7 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
 
                        info->fix.visual = FB_VISUAL_TRUECOLOR;
                        info->fix.line_length = info->var.xres_virtual << 1; /* depth=16 */
-       }
+               }
        } else {
                /* mono */
                info->fix.visual = FB_VISUAL_MONO10;
@@ -164,20 +164,16 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
        }
 
        info->screen_size = info->fix.line_length * info->var.yres_virtual;
+       info->var.rotate = ((fbdev->panel->control_base&LCD_CONTROL_SM_MASK) \
+                               >> LCD_CONTROL_SM_BIT) * 90;
 
        /* Determine BPP mode and format */
-       fbdev->regs->lcd_control = fbdev->panel->control_base |
-                           ((info->var.rotate/90) << LCD_CONTROL_SM_BIT);
-
-       fbdev->regs->lcd_intenable = 0;
-       fbdev->regs->lcd_intstatus = 0;
-
+       fbdev->regs->lcd_control = fbdev->panel->control_base;
        fbdev->regs->lcd_horztiming = fbdev->panel->horztiming;
-
        fbdev->regs->lcd_verttiming = fbdev->panel->verttiming;
-
        fbdev->regs->lcd_clkcontrol = fbdev->panel->clkcontrol_base;
-
+       fbdev->regs->lcd_intenable = 0;
+       fbdev->regs->lcd_intstatus = 0;
        fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(fbdev->fb_phys);
 
        if (panel_is_dual(fbdev->panel)) {
@@ -206,6 +202,8 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
 
        /* Resume controller */
        fbdev->regs->lcd_control |= LCD_CONTROL_GO;
+       mdelay(10);
+       au1100fb_fb_blank(VESA_NO_BLANKING, info);
 
        return 0;
 }
index 022f9d3473f5030074bda89cb3fe84a175d93a44..02f15297a021b1c7902137ee09bed8355e62f412 100644 (file)
@@ -10,7 +10,7 @@ menuconfig BACKLIGHT_LCD_SUPPORT
 
 config BACKLIGHT_CLASS_DEVICE
         tristate "Lowlevel Backlight controls"
-       depends on BACKLIGHT_LCD_SUPPORT && FB
+       depends on BACKLIGHT_LCD_SUPPORT
        default m
        help
          This framework adds support for low-level control of the LCD
@@ -26,7 +26,7 @@ config BACKLIGHT_DEVICE
 
 config LCD_CLASS_DEVICE
         tristate "Lowlevel LCD controls"
-       depends on BACKLIGHT_LCD_SUPPORT && FB
+       depends on BACKLIGHT_LCD_SUPPORT
        default m
        help
          This framework adds support for low-level control of LCD.
index 52ed12b12acc15b0a4f90e1d4e4fe027112ac6af..eb4d03fa53915612f40158a82d06f549eec4f595 100644 (file)
@@ -197,7 +197,7 @@ static int __init mdacon_setup(char *str)
 __setup("mdacon=", mdacon_setup);
 #endif
 
-static int __init mda_detect(void)
+static int mda_detect(void)
 {
        int count=0;
        u16 *p, p_save;
@@ -282,7 +282,7 @@ static int __init mda_detect(void)
        return 1;
 }
 
-static void __init mda_initialize(void)
+static void mda_initialize(void)
 {
        write_mda_b(97, 0x00);          /* horizontal total */
        write_mda_b(80, 0x01);          /* horizontal displayed */
diff --git a/drivers/video/fb_notify.c b/drivers/video/fb_notify.c
new file mode 100644 (file)
index 0000000..8c02038
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ *  linux/drivers/video/fb_notify.c
+ *
+ *  Copyright (C) 2006 Antonino Daplas <adaplas@pol.net>
+ *
+ *     2001 - Documented with DocBook
+ *     - Brad Douglas <brad@neruo.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+#include <linux/fb.h>
+#include <linux/notifier.h>
+
+static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
+
+/**
+ *     fb_register_client - register a client notifier
+ *     @nb: notifier block to callback on events
+ */
+int fb_register_client(struct notifier_block *nb)
+{
+       return blocking_notifier_chain_register(&fb_notifier_list, nb);
+}
+EXPORT_SYMBOL(fb_register_client);
+
+/**
+ *     fb_unregister_client - unregister a client notifier
+ *     @nb: notifier block to callback on events
+ */
+int fb_unregister_client(struct notifier_block *nb)
+{
+       return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
+}
+EXPORT_SYMBOL(fb_unregister_client);
+
+/**
+ * fb_notifier_call_chain - notify clients of fb_events
+ *
+ */
+int fb_notifier_call_chain(unsigned long val, void *v)
+{
+       return blocking_notifier_call_chain(&fb_notifier_list, val, v);
+}
+EXPORT_SYMBOL_GPL(fb_notifier_call_chain);
index 4fc9df426c1af5fc7fb30c4ee0b96228d0eb03fe..17961e3ecaa07ed1b9572868e5af8055f1b91760 100644 (file)
@@ -52,7 +52,6 @@
 
 #define FBPIXMAPSIZE   (1024 * 8)
 
-static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
 struct fb_info *registered_fb[FB_MAX];
 int num_registered_fb;
 
@@ -791,8 +790,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
 
                    event.info = info;
                    event.data = &mode1;
-                   ret = blocking_notifier_call_chain(&fb_notifier_list,
-                                             FB_EVENT_MODE_DELETE, &event);
+                   ret = fb_notifier_call_chain(FB_EVENT_MODE_DELETE, &event);
                }
 
                if (!ret)
@@ -837,8 +835,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
 
                                info->flags &= ~FBINFO_MISC_USEREVENT;
                                event.info = info;
-                               blocking_notifier_call_chain(&fb_notifier_list,
-                                               evnt, &event);
+                               fb_notifier_call_chain(evnt, &event);
                        }
                }
        }
@@ -861,8 +858,7 @@ fb_blank(struct fb_info *info, int blank)
 
                event.info = info;
                event.data = &blank;
-               blocking_notifier_call_chain(&fb_notifier_list,
-                               FB_EVENT_BLANK, &event);
+               fb_notifier_call_chain(FB_EVENT_BLANK, &event);
        }
 
        return ret;
@@ -933,8 +929,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                con2fb.framebuffer = -1;
                event.info = info;
                event.data = &con2fb;
-               blocking_notifier_call_chain(&fb_notifier_list,
-                                   FB_EVENT_GET_CONSOLE_MAP, &event);
+               fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event);
                return copy_to_user(argp, &con2fb,
                                    sizeof(con2fb)) ? -EFAULT : 0;
        case FBIOPUT_CON2FBMAP:
@@ -952,9 +947,8 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                    return -EINVAL;
                event.info = info;
                event.data = &con2fb;
-               return blocking_notifier_call_chain(&fb_notifier_list,
-                                          FB_EVENT_SET_CONSOLE_MAP,
-                                          &event);
+               return fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP,
+                                             &event);
        case FBIOBLANK:
                acquire_console_sem();
                info->flags |= FBINFO_MISC_USEREVENT;
@@ -1330,8 +1324,7 @@ register_framebuffer(struct fb_info *fb_info)
        registered_fb[i] = fb_info;
 
        event.info = fb_info;
-       blocking_notifier_call_chain(&fb_notifier_list,
-                           FB_EVENT_FB_REGISTERED, &event);
+       fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
        return 0;
 }
 
@@ -1365,29 +1358,10 @@ unregister_framebuffer(struct fb_info *fb_info)
        fb_cleanup_class_device(fb_info);
        class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
        event.info = fb_info;
-       blocking_notifier_call_chain(&fb_notifier_list,
-                                    FB_EVENT_FB_UNREGISTERED, &event);
+       fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
        return 0;
 }
 
-/**
- *     fb_register_client - register a client notifier
- *     @nb: notifier block to callback on events
- */
-int fb_register_client(struct notifier_block *nb)
-{
-       return blocking_notifier_chain_register(&fb_notifier_list, nb);
-}
-
-/**
- *     fb_unregister_client - unregister a client notifier
- *     @nb: notifier block to callback on events
- */
-int fb_unregister_client(struct notifier_block *nb)
-{
-       return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
-}
-
 /**
  *     fb_set_suspend - low level driver signals suspend
  *     @info: framebuffer affected
@@ -1403,13 +1377,11 @@ void fb_set_suspend(struct fb_info *info, int state)
 
        event.info = info;
        if (state) {
-               blocking_notifier_call_chain(&fb_notifier_list,
-                               FB_EVENT_SUSPEND, &event);
+               fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
                info->state = FBINFO_STATE_SUSPENDED;
        } else {
                info->state = FBINFO_STATE_RUNNING;
-               blocking_notifier_call_chain(&fb_notifier_list,
-                               FB_EVENT_RESUME, &event);
+               fb_notifier_call_chain(FB_EVENT_RESUME, &event);
        }
 }
 
@@ -1480,9 +1452,7 @@ int fb_new_modelist(struct fb_info *info)
 
        if (!list_empty(&info->modelist)) {
                event.info = info;
-               err = blocking_notifier_call_chain(&fb_notifier_list,
-                                          FB_EVENT_NEW_MODELIST,
-                                          &event);
+               err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
        }
 
        return err;
@@ -1594,8 +1564,6 @@ EXPORT_SYMBOL(fb_blank);
 EXPORT_SYMBOL(fb_pan_display);
 EXPORT_SYMBOL(fb_get_buffer_offset);
 EXPORT_SYMBOL(fb_set_suspend);
-EXPORT_SYMBOL(fb_register_client);
-EXPORT_SYMBOL(fb_unregister_client);
 EXPORT_SYMBOL(fb_get_options);
 
 MODULE_LICENSE("GPL");
index ff233b84dec4fc1a3c900b1896459e87446a623f..b485bece5fc921bc574544ee5a7dc7c408fad957 100644 (file)
@@ -18,6 +18,8 @@
 #include <linux/screen_info.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/dmi.h>
+#include <linux/efi.h>
 
 #include <asm/io.h>
 
@@ -28,7 +30,7 @@ typedef enum _MAC_TYPE {
        M_I20,
        M_MINI,
        M_MACBOOK,
-       M_NEW
+       M_UNKNOWN
 } MAC_TYPE;
 
 /* --------------------------------------------------------------------- */
@@ -52,10 +54,36 @@ static struct fb_fix_screeninfo imacfb_fix __initdata = {
 };
 
 static int inverse;
-static int model               = M_NEW;
+static int model               = M_UNKNOWN;
 static int manual_height;
 static int manual_width;
 
+static int set_system(struct dmi_system_id *id)
+{
+       printk(KERN_INFO "imacfb: %s detected - set system to %ld\n",
+               id->ident, (long)id->driver_data);
+
+       model = (long)id->driver_data;
+
+       return 0;
+}
+
+static struct dmi_system_id __initdata dmi_system_table[] = {
+       { set_system, "iMac4,1", {
+         DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+         DMI_MATCH(DMI_BIOS_VERSION,"iMac4,1") }, (void*)M_I17},
+       { set_system, "MacBookPro1,1", {
+         DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+         DMI_MATCH(DMI_BIOS_VERSION,"MacBookPro1,1") }, (void*)M_I17},
+       { set_system, "MacBook1,1", {
+         DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+         DMI_MATCH(DMI_PRODUCT_NAME,"MacBook1,1")}, (void *)M_MACBOOK},
+       { set_system, "Macmini1,1", {
+         DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+         DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}, (void *)M_MINI},
+       {},
+};
+
 #define        DEFAULT_FB_MEM  1024*1024*16
 
 /* --------------------------------------------------------------------- */
@@ -149,7 +177,6 @@ static int __init imacfb_probe(struct platform_device *dev)
                screen_info.lfb_linelength = 1472 * 4;
                screen_info.lfb_base = 0x80010000;
                break;
-       case M_NEW:
        case M_I20:
                screen_info.lfb_width = 1680;
                screen_info.lfb_height = 1050;
@@ -207,6 +234,10 @@ static int __init imacfb_probe(struct platform_device *dev)
                size_remap = size_total;
        imacfb_fix.smem_len = size_remap;
 
+#ifndef __i386__
+       screen_info.imacpm_seg = 0;
+#endif
+
        if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) {
                printk(KERN_WARNING
                       "imacfb: cannot reserve video memory at 0x%lx\n",
@@ -324,8 +355,16 @@ static int __init imacfb_init(void)
        int ret;
        char *option = NULL;
 
-       /* ignore error return of fb_get_options */
-       fb_get_options("imacfb", &option);
+       if (!efi_enabled)
+               return -ENODEV;
+       if (!dmi_check_system(dmi_system_table))
+               return -ENODEV;
+       if (model == M_UNKNOWN)
+               return -ENODEV;
+
+       if (fb_get_options("imacfb", &option))
+               return -ENODEV;
+
        imacfb_setup(option);
        ret = platform_driver_register(&imacfb_driver);
 
index 9f2066f0745adbd62921e2cebb284dcc7a99869f..d4f850117874899f76afd661c5340fa2508d997f 100644 (file)
 #include "nv_proto.h"
 #include "nv_dma.h"
 
-#ifndef CONFIG_PCI             /* sanity check */
-#error This driver requires PCI support.
-#endif
-
 #undef CONFIG_FB_NVIDIA_DEBUG
 #ifdef CONFIG_FB_NVIDIA_DEBUG
 #define NVTRACE          printk
@@ -1303,20 +1299,19 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
 
        nvidia_save_vga(par, &par->SavedReg);
 
+       pci_set_drvdata(pd, info);
+       nvidia_bl_init(par);
        if (register_framebuffer(info) < 0) {
                printk(KERN_ERR PFX "error registering nVidia framebuffer\n");
                goto err_out_iounmap_fb;
        }
 
-       pci_set_drvdata(pd, info);
 
        printk(KERN_INFO PFX
               "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n",
               info->fix.id,
               par->FbMapSize / (1024 * 1024), info->fix.smem_start);
 
-       nvidia_bl_init(par);
-
        NVTRACE_LEAVE();
        return 0;
 
index ce5f3031b99b07b16f32dd899f58374d8bd03dfd..0013311e056469c65ffd5063db355ee1415936f5 100644 (file)
@@ -62,8 +62,6 @@ struct offb_par default_par;
      *  Interface used by the world
      */
 
-int offb_init(void);
-
 static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
                          u_int transp, struct fb_info *info);
 static int offb_blank(int blank, struct fb_info *info);
@@ -72,11 +70,6 @@ static int offb_blank(int blank, struct fb_info *info);
 extern boot_infos_t *boot_infos;
 #endif
 
-static void offb_init_nodriver(struct device_node *);
-static void offb_init_fb(const char *name, const char *full_name,
-                        int width, int height, int depth, int pitch,
-                        unsigned long address, struct device_node *dp);
-
 static struct fb_ops offb_ops = {
        .owner          = THIS_MODULE,
        .fb_setcolreg   = offb_setcolreg,
@@ -229,123 +222,17 @@ static int offb_blank(int blank, struct fb_info *info)
        return 0;
 }
 
-    /*
-     *  Initialisation
-     */
 
-int __init offb_init(void)
+static void __iomem *offb_map_reg(struct device_node *np, int index,
+                                 unsigned long offset, unsigned long size)
 {
-       struct device_node *dp = NULL, *boot_disp = NULL;
-
-       if (fb_get_options("offb", NULL))
-               return -ENODEV;
+       struct resource r;
 
-       for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
-               if (get_property(dp, "linux,opened", NULL) &&
-                   get_property(dp, "linux,boot-display", NULL)) {
-                       boot_disp = dp;
-                       offb_init_nodriver(dp);
-               }
-       }
-       for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
-               if (get_property(dp, "linux,opened", NULL) &&
-                   dp != boot_disp)
-                       offb_init_nodriver(dp);
-       }
-
-       return 0;
-}
-
-
-static void __init offb_init_nodriver(struct device_node *dp)
-{
-       unsigned int len;
-       int i, width = 640, height = 480, depth = 8, pitch = 640;
-       unsigned int flags, rsize, addr_prop = 0;
-       unsigned long max_size = 0;
-       u64 rstart, address = OF_BAD_ADDR;
-       u32 *pp, *addrp, *up;
-       u64 asize;
-
-       pp = (u32 *)get_property(dp, "linux,bootx-depth", &len);
-       if (pp == NULL)
-               pp = (u32 *)get_property(dp, "depth", &len);
-       if (pp && len == sizeof(u32))
-               depth = *pp;
-
-       pp = (u32 *)get_property(dp, "linux,bootx-width", &len);
-       if (pp == NULL)
-               pp = (u32 *)get_property(dp, "width", &len);
-       if (pp && len == sizeof(u32))
-               width = *pp;
-
-       pp = (u32 *)get_property(dp, "linux,bootx-height", &len);
-       if (pp == NULL)
-               pp = (u32 *)get_property(dp, "height", &len);
-       if (pp && len == sizeof(u32))
-               height = *pp;
-
-       pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len);
-       if (pp == NULL)
-               pp = (u32 *)get_property(dp, "linebytes", &len);
-       if (pp && len == sizeof(u32))
-               pitch = *pp;
-       else
-               pitch = width * ((depth + 7) / 8);
-
-       rsize = (unsigned long)pitch * (unsigned long)height;
-
-       /* Ok, now we try to figure out the address of the framebuffer.
-        *
-        * Unfortunately, Open Firmware doesn't provide a standard way to do
-        * so. All we can do is a dodgy heuristic that happens to work in
-        * practice. On most machines, the "address" property contains what
-        * we need, though not on Matrox cards found in IBM machines. What I've
-        * found that appears to give good results is to go through the PCI
-        * ranges and pick one that is both big enough and if possible encloses
-        * the "address" property. If none match, we pick the biggest
-        */
-       up = (u32 *)get_property(dp, "linux,bootx-addr", &len);
-       if (up == NULL)
-               up = (u32 *)get_property(dp, "address", &len);
-       if (up && len == sizeof(u32))
-               addr_prop = *up;
-
-       for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags))
-                    != NULL; i++) {
-               int match_addrp = 0;
-
-               if (!(flags & IORESOURCE_MEM))
-                       continue;
-               if (asize < rsize)
-                       continue;
-               rstart = of_translate_address(dp, addrp);
-               if (rstart == OF_BAD_ADDR)
-                       continue;
-               if (addr_prop && (rstart <= addr_prop) &&
-                   ((rstart + asize) >= (addr_prop + rsize)))
-                       match_addrp = 1;
-               if (match_addrp) {
-                       address = addr_prop;
-                       break;
-               }
-               if (rsize > max_size) {
-                       max_size = rsize;
-                       address = OF_BAD_ADDR;
-               }
-
-               if (address == OF_BAD_ADDR)
-                       address = rstart;
-       }
-       if (address == OF_BAD_ADDR && addr_prop)
-               address = (u64)addr_prop;
-       if (address != OF_BAD_ADDR) {
-               /* kludge for valkyrie */
-               if (strcmp(dp->name, "valkyrie") == 0)
-                       address += 0x1000;
-               offb_init_fb(dp->name, dp->full_name, width, height, depth,
-                            pitch, address, dp);
-       }
+       if (of_address_to_resource(np, index, &r))
+               return 0;
+       if ((r.start + offset + size) > r.end)
+               return 0;
+       return ioremap(r.start + offset, size);
 }
 
 static void __init offb_init_fb(const char *name, const char *full_name,
@@ -402,45 +289,39 @@ static void __init offb_init_fb(const char *name, const char *full_name,
 
        par->cmap_type = cmap_unknown;
        if (depth == 8) {
-
                /* Palette hacks disabled for now */
-#if 0
                if (dp && !strncmp(name, "ATY,Rage128", 11)) {
-                       unsigned long regbase = dp->addrs[2].address;
-                       par->cmap_adr = ioremap(regbase, 0x1FFF);
-                       par->cmap_type = cmap_r128;
+                       par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
+                       if (par->cmap_adr)
+                               par->cmap_type = cmap_r128;
                } else if (dp && (!strncmp(name, "ATY,RageM3pA", 12)
                                  || !strncmp(name, "ATY,RageM3p12A", 14))) {
-                       unsigned long regbase =
-                           dp->parent->addrs[2].address;
-                       par->cmap_adr = ioremap(regbase, 0x1FFF);
-                       par->cmap_type = cmap_M3A;
+                       par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
+                       if (par->cmap_adr)
+                               par->cmap_type = cmap_M3A;
                } else if (dp && !strncmp(name, "ATY,RageM3pB", 12)) {
-                       unsigned long regbase =
-                           dp->parent->addrs[2].address;
-                       par->cmap_adr = ioremap(regbase, 0x1FFF);
-                       par->cmap_type = cmap_M3B;
+                       par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
+                       if (par->cmap_adr)
+                               par->cmap_type = cmap_M3B;
                } else if (dp && !strncmp(name, "ATY,Rage6", 9)) {
-                       unsigned long regbase = dp->addrs[1].address;
-                       par->cmap_adr = ioremap(regbase, 0x1FFF);
-                       par->cmap_type = cmap_radeon;
+                       par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff);
+                       if (par->cmap_adr)
+                               par->cmap_type = cmap_radeon;
                } else if (!strncmp(name, "ATY,", 4)) {
                        unsigned long base = address & 0xff000000UL;
                        par->cmap_adr =
                            ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
                        par->cmap_data = par->cmap_adr + 1;
                        par->cmap_type = cmap_m64;
-               } else if (device_is_compatible(dp, "pci1014,b7")) {
-                       unsigned long regbase = dp->addrs[0].address;
-                       par->cmap_adr = ioremap(regbase + 0x6000, 0x1000);
-                       par->cmap_type = cmap_gxt2000;
+               } else if (dp && device_is_compatible(dp, "pci1014,b7")) {
+                       par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000);
+                       if (par->cmap_adr)
+                               par->cmap_type = cmap_gxt2000;
                }
-#endif
-               fix->visual = par->cmap_adr ? FB_VISUAL_PSEUDOCOLOR
-                   : FB_VISUAL_STATIC_PSEUDOCOLOR;
+               fix->visual = (par->cmap_type != cmap_unknown) ?
+                       FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR;
        } else
-               fix->visual =   /* par->cmap_adr ? FB_VISUAL_DIRECTCOLOR
-                                  : */ FB_VISUAL_TRUECOLOR;
+               fix->visual = FB_VISUAL_TRUECOLOR;
 
        var->xoffset = var->yoffset = 0;
        switch (depth) {
@@ -520,5 +401,139 @@ static void __init offb_init_fb(const char *name, const char *full_name,
               info->node, full_name);
 }
 
+
+static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
+{
+       unsigned int len;
+       int i, width = 640, height = 480, depth = 8, pitch = 640;
+       unsigned int flags, rsize, addr_prop = 0;
+       unsigned long max_size = 0;
+       u64 rstart, address = OF_BAD_ADDR;
+       u32 *pp, *addrp, *up;
+       u64 asize;
+
+       pp = (u32 *)get_property(dp, "linux,bootx-depth", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "depth", &len);
+       if (pp && len == sizeof(u32))
+               depth = *pp;
+
+       pp = (u32 *)get_property(dp, "linux,bootx-width", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "width", &len);
+       if (pp && len == sizeof(u32))
+               width = *pp;
+
+       pp = (u32 *)get_property(dp, "linux,bootx-height", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "height", &len);
+       if (pp && len == sizeof(u32))
+               height = *pp;
+
+       pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len);
+       if (pp == NULL)
+               pp = (u32 *)get_property(dp, "linebytes", &len);
+       if (pp && len == sizeof(u32))
+               pitch = *pp;
+       else
+               pitch = width * ((depth + 7) / 8);
+
+       rsize = (unsigned long)pitch * (unsigned long)height;
+
+       /* Ok, now we try to figure out the address of the framebuffer.
+        *
+        * Unfortunately, Open Firmware doesn't provide a standard way to do
+        * so. All we can do is a dodgy heuristic that happens to work in
+        * practice. On most machines, the "address" property contains what
+        * we need, though not on Matrox cards found in IBM machines. What I've
+        * found that appears to give good results is to go through the PCI
+        * ranges and pick one that is both big enough and if possible encloses
+        * the "address" property. If none match, we pick the biggest
+        */
+       up = (u32 *)get_property(dp, "linux,bootx-addr", &len);
+       if (up == NULL)
+               up = (u32 *)get_property(dp, "address", &len);
+       if (up && len == sizeof(u32))
+               addr_prop = *up;
+
+       /* Hack for when BootX is passing us */
+       if (no_real_node)
+               goto skip_addr;
+
+       for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags))
+                    != NULL; i++) {
+               int match_addrp = 0;
+
+               if (!(flags & IORESOURCE_MEM))
+                       continue;
+               if (asize < rsize)
+                       continue;
+               rstart = of_translate_address(dp, addrp);
+               if (rstart == OF_BAD_ADDR)
+                       continue;
+               if (addr_prop && (rstart <= addr_prop) &&
+                   ((rstart + asize) >= (addr_prop + rsize)))
+                       match_addrp = 1;
+               if (match_addrp) {
+                       address = addr_prop;
+                       break;
+               }
+               if (rsize > max_size) {
+                       max_size = rsize;
+                       address = OF_BAD_ADDR;
+               }
+
+               if (address == OF_BAD_ADDR)
+                       address = rstart;
+       }
+ skip_addr:
+       if (address == OF_BAD_ADDR && addr_prop)
+               address = (u64)addr_prop;
+       if (address != OF_BAD_ADDR) {
+               /* kludge for valkyrie */
+               if (strcmp(dp->name, "valkyrie") == 0)
+                       address += 0x1000;
+               offb_init_fb(no_real_node ? "bootx" : dp->name,
+                            no_real_node ? "display" : dp->full_name,
+                            width, height, depth, pitch, address,
+                            no_real_node ? dp : NULL);
+       }
+}
+
+static int __init offb_init(void)
+{
+       struct device_node *dp = NULL, *boot_disp = NULL;
+
+       if (fb_get_options("offb", NULL))
+               return -ENODEV;
+
+       /* Check if we have a MacOS display without a node spec */
+       if (get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) {
+               /* The old code tried to work out which node was the MacOS
+                * display based on the address. I'm dropping that since the
+                * lack of a node spec only happens with old BootX versions
+                * (users can update) and with this code, they'll still get
+                * a display (just not the palette hacks).
+                */
+               offb_init_nodriver(of_chosen, 1);
+       }
+
+       for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
+               if (get_property(dp, "linux,opened", NULL) &&
+                   get_property(dp, "linux,boot-display", NULL)) {
+                       boot_disp = dp;
+                       offb_init_nodriver(dp, 0);
+               }
+       }
+       for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
+               if (get_property(dp, "linux,opened", NULL) &&
+                   dp != boot_disp)
+                       offb_init_nodriver(dp, 0);
+       }
+
+       return 0;
+}
+
+
 module_init(offb_init);
 MODULE_LICENSE("GPL");
index 33dddbae54208a12df34d3128bd58e2261f6d73f..76fc9d355eb7171620e42b93ccfcd8e6b5cef22e 100644 (file)
@@ -2132,6 +2132,9 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 
        fb_destroy_modedb(info->monspecs.modedb);
        info->monspecs.modedb = NULL;
+
+       pci_set_drvdata(pd, info);
+       riva_bl_init(info->par);
        ret = register_framebuffer(info);
        if (ret < 0) {
                printk(KERN_ERR PFX
@@ -2139,8 +2142,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
                goto err_iounmap_screen_base;
        }
 
-       pci_set_drvdata(pd, info);
-
        printk(KERN_INFO PFX
                "PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n",
                info->fix.id,
@@ -2148,8 +2149,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
                info->fix.smem_len / (1024 * 1024),
                info->fix.smem_start);
 
-       riva_bl_init(info->par);
-
        NVTRACE_LEAVE();
        return 0;
 
index 1e898144eb7c167bb3a2ad30dc1760c8cb8f19ba..56d88c1a09c566baa5a0733f728cc7a8819b97b7 100644 (file)
@@ -673,8 +673,10 @@ struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode,
        struct cbuf *bufp = &buffer;
 
        size = 4 + 2 + strlen(name) + 4 + 1;    /* fid[4] name[s] perm[4] mode[1] */
-       if (extended && extension!=NULL)
-               size += 2 + strlen(extension);  /* extension[s] */
+       if (extended) {
+               size += 2 +                     /* extension[s] */
+                   (extension == NULL ? 0 : strlen(extension));
+       }
 
        fc = v9fs_create_common(bufp, size, TCREATE);
        if (IS_ERR(fc))
index 2f580a197b8dadf573ce7093742e4e647c950c82..eae50c9d6dc41f0ca06524357008775a59d74fe1 100644 (file)
@@ -434,11 +434,11 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir)
        result = v9fs_t_remove(v9ses, fid, &fcall);
        if (result < 0) {
                PRINT_FCALL_ERROR("remove fails", fcall);
-       } else {
-               v9fs_put_idpool(fid, &v9ses->fidpool);
-               v9fs_fid_destroy(v9fid);
        }
 
+       v9fs_put_idpool(fid, &v9ses->fidpool);
+       v9fs_fid_destroy(v9fid);
+
        kfree(fcall);
        return result;
 }
index ba1c88af49fee9e0c288479b06b3e774b19f6f8b..82011019494ccf6bbcefa838e28b5c130739470b 100644 (file)
@@ -308,7 +308,7 @@ static struct adfs_discmap *adfs_read_map(struct super_block *sb, struct adfs_di
        if (adfs_checkmap(sb, dm))
                return dm;
 
-       adfs_error(sb, NULL, "map corrupted");
+       adfs_error(sb, "map corrupted");
 
 error_free:
        while (--zone >= 0)
index fcaeead9696b135f6481ff93afd7829980d53e5e..50cfca5c7efd570588d549a5f23f9f5650fd360d 100644 (file)
@@ -512,7 +512,11 @@ befs_utf2nls(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = in_len; /* The utf8->nls conversion can't make more chars */
+       /* The utf8->nls conversion won't make the final nls string bigger
+        * than the utf one, but if the string is pure ascii they'll have the
+        * same width and an extra char is needed to save the additional \0
+        */
+       int maxlen = in_len + 1;
 
        befs_debug(sb, "---> utf2nls()");
 
@@ -588,7 +592,10 @@ befs_nls2utf(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = 3 * in_len;
+       /* There're nls characters that will translate to 3-chars-wide UTF-8
+        * characters, a additional byte is needed to save the final \0
+        * in special cases */
+       int maxlen = (3 * in_len) + 1;
 
        befs_debug(sb, "---> nls2utf()\n");
 
index 3660dcb975912d5a831a7940192df8f53354024d..71649ef9b6586696c695e2d80c000ceedaa51282 100644 (file)
@@ -470,13 +470,18 @@ out:
    pass does the actual I/O. */
 void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers)
 {
+       struct address_space *mapping = bdev->bd_inode->i_mapping;
+
+       if (mapping->nrpages == 0)
+               return;
+
        invalidate_bh_lrus();
        /*
         * FIXME: what about destroy_dirty_buffers?
         * We really want to use invalidate_inode_pages2() for
         * that, but not until that's cleaned up.
         */
-       invalidate_inode_pages(bdev->bd_inode->i_mapping);
+       invalidate_inode_pages(mapping);
 }
 
 /*
index cc66c681bd11069d993f086db77198f8ba978dfb..dbfbcfa5b3c064855f377949a9470bd6aab63a2e 100644 (file)
@@ -136,10 +136,8 @@ int coda_open(struct inode *coda_inode, struct file *coda_file)
        coda_vfs_stat.open++;
 
        cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL);
-       if (!cfi) {
-               unlock_kernel();
+       if (!cfi)
                return -ENOMEM;
-       }
 
        lock_kernel();
 
index e249cf733a6bdb9b728b664a9910dff59edb8101..1d30d2ff440fa3fecb7448b25416dd8a2c13abfa 100644 (file)
@@ -22,7 +22,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page)
   
        err = -ENAMETOOLONG;
        if (size > 2 * EFS_BLOCKSIZE)
-               goto fail;
+               goto fail_notlocked;
   
        lock_kernel();
        /* read first 512 bytes of link target */
@@ -47,6 +47,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page)
        return 0;
 fail:
        unlock_kernel();
+fail_notlocked:
        SetPageError(page);
        kunmap(page);
        unlock_page(page);
index f804d5e9d60c6cc81cf35c33b42b4a8d9d2fc896..c5ee9f0691e3bab720023686122e14df8c946c22 100644 (file)
@@ -1158,7 +1158,7 @@ retry:
                ret = PTR_ERR(handle);
                goto out;
        }
-       if (test_opt(inode->i_sb, NOBH))
+       if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
                ret = nobh_prepare_write(page, from, to, ext3_get_block);
        else
                ret = block_prepare_write(page, from, to, ext3_get_block);
@@ -1244,7 +1244,7 @@ static int ext3_writeback_commit_write(struct file *file, struct page *page,
        if (new_i_size > EXT3_I(inode)->i_disksize)
                EXT3_I(inode)->i_disksize = new_i_size;
 
-       if (test_opt(inode->i_sb, NOBH))
+       if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
                ret = nobh_commit_write(file, page, from, to);
        else
                ret = generic_commit_write(file, page, from, to);
@@ -1494,7 +1494,7 @@ static int ext3_writeback_writepage(struct page *page,
                goto out_fail;
        }
 
-       if (test_opt(inode->i_sb, NOBH))
+       if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
                ret = nobh_writepage(page, ext3_get_block, wbc);
        else
                ret = block_write_full_page(page, ext3_get_block, wbc);
@@ -2402,14 +2402,15 @@ static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb,
        struct buffer_head *bh;
        struct ext3_group_desc * gdp;
 
-
-       if ((ino != EXT3_ROOT_INO && ino != EXT3_JOURNAL_INO &&
-               ino != EXT3_RESIZE_INO && ino < EXT3_FIRST_INO(sb)) ||
-               ino > le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count)) {
-               ext3_error(sb, "ext3_get_inode_block",
-                           "bad inode number: %lu", ino);
+       if (!ext3_valid_inum(sb, ino)) {
+               /*
+                * This error is already checked for in namei.c unless we are
+                * looking at an NFS filehandle, in which case no error
+                * report is needed
+                */
                return 0;
        }
+
        block_group = (ino - 1) / EXT3_INODES_PER_GROUP(sb);
        if (block_group >= EXT3_SB(sb)->s_groups_count) {
                ext3_error(sb,"ext3_get_inode_block","group >= groups count");
index d9176dba36980b707512c11bbea09131d2bd45ae..2aa7101b27cd31bda494dbf5d688f1aa469f2985 100644 (file)
@@ -1000,7 +1000,12 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str
        if (bh) {
                unsigned long ino = le32_to_cpu(de->inode);
                brelse (bh);
-               inode = iget(dir->i_sb, ino);
+               if (!ext3_valid_inum(dir->i_sb, ino)) {
+                       ext3_error(dir->i_sb, "ext3_lookup",
+                                  "bad inode number: %lu", ino);
+                       inode = NULL;
+               } else
+                       inode = iget(dir->i_sb, ino);
 
                if (!inode)
                        return ERR_PTR(-EACCES);
@@ -1028,7 +1033,13 @@ struct dentry *ext3_get_parent(struct dentry *child)
                return ERR_PTR(-ENOENT);
        ino = le32_to_cpu(de->inode);
        brelse(bh);
-       inode = iget(child->d_inode->i_sb, ino);
+
+       if (!ext3_valid_inum(child->d_inode->i_sb, ino)) {
+               ext3_error(child->d_inode->i_sb, "ext3_get_parent",
+                          "bad inode number: %lu", ino);
+               inode = NULL;
+       } else
+               inode = iget(child->d_inode->i_sb, ino);
 
        if (!inode)
                return ERR_PTR(-EACCES);
index 29cce456c7ced1fdbfd6bfc7a9ed1b9a2ff07779..43886fa00a2a06a9a3423dc20c4d35f521a3a6a5 100644 (file)
@@ -246,6 +246,8 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler)
        u_long                  page, npages, block, pblocks, nblocks, offset;
        loff_t                  pos;
 
+       lock_kernel();
+
        switch ((long)fp->f_pos) {
        case 0:
                if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0)
index a3bce3a77253f42504b9770ecdba8e6e3977d946..46fe60b2da23b2eafad38d99b62c8edacba4dd1b 100644 (file)
@@ -105,7 +105,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent,
 
 /*
  * Add a connection to the control filesystem (if it exists).  Caller
- * must host fuse_mutex
+ * must hold fuse_mutex
  */
 int fuse_ctl_add_conn(struct fuse_conn *fc)
 {
@@ -139,7 +139,7 @@ int fuse_ctl_add_conn(struct fuse_conn *fc)
 
 /*
  * Remove a connection from the control filesystem (if it exists).
- * Caller must host fuse_mutex
+ * Caller must hold fuse_mutex
  */
 void fuse_ctl_remove_conn(struct fuse_conn *fc)
 {
index 72a74cde6de8c288793293d4e4ca4bb4ea58b793..409ce6a7cca4ccd2e53f46693a5e4301bef87245 100644 (file)
 #include <linux/sched.h>
 #include <linux/namei.h>
 
+#if BITS_PER_LONG >= 64
+static inline void fuse_dentry_settime(struct dentry *entry, u64 time)
+{
+       entry->d_time = time;
+}
+
+static inline u64 fuse_dentry_time(struct dentry *entry)
+{
+       return entry->d_time;
+}
+#else
+/*
+ * On 32 bit archs store the high 32 bits of time in d_fsdata
+ */
+static void fuse_dentry_settime(struct dentry *entry, u64 time)
+{
+       entry->d_time = time;
+       entry->d_fsdata = (void *) (unsigned long) (time >> 32);
+}
+
+static u64 fuse_dentry_time(struct dentry *entry)
+{
+       return (u64) entry->d_time +
+               ((u64) (unsigned long) entry->d_fsdata << 32);
+}
+#endif
+
 /*
  * FUSE caches dentries and attributes with separate timeout.  The
  * time in jiffies until the dentry/attributes are valid is stored in
 /*
  * Calculate the time in jiffies until a dentry/attributes are valid
  */
-static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec)
+static u64 time_to_jiffies(unsigned long sec, unsigned long nsec)
 {
-       struct timespec ts = {sec, nsec};
-       return jiffies + timespec_to_jiffies(&ts);
+       if (sec || nsec) {
+               struct timespec ts = {sec, nsec};
+               return get_jiffies_64() + timespec_to_jiffies(&ts);
+       } else
+               return 0;
 }
 
 /*
@@ -35,7 +65,8 @@ static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec)
  */
 static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o)
 {
-       entry->d_time = time_to_jiffies(o->entry_valid, o->entry_valid_nsec);
+       fuse_dentry_settime(entry,
+               time_to_jiffies(o->entry_valid, o->entry_valid_nsec));
        if (entry->d_inode)
                get_fuse_inode(entry->d_inode)->i_time =
                        time_to_jiffies(o->attr_valid, o->attr_valid_nsec);
@@ -47,7 +78,7 @@ static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o)
  */
 void fuse_invalidate_attr(struct inode *inode)
 {
-       get_fuse_inode(inode)->i_time = jiffies - 1;
+       get_fuse_inode(inode)->i_time = 0;
 }
 
 /*
@@ -60,7 +91,7 @@ void fuse_invalidate_attr(struct inode *inode)
  */
 static void fuse_invalidate_entry_cache(struct dentry *entry)
 {
-       entry->d_time = jiffies - 1;
+       fuse_dentry_settime(entry, 0);
 }
 
 /*
@@ -102,7 +133,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
 
        if (inode && is_bad_inode(inode))
                return 0;
-       else if (time_after(jiffies, entry->d_time)) {
+       else if (fuse_dentry_time(entry) < get_jiffies_64()) {
                int err;
                struct fuse_entry_out outarg;
                struct fuse_conn *fc;
@@ -666,7 +697,7 @@ static int fuse_revalidate(struct dentry *entry)
        if (!fuse_allow_task(fc, current))
                return -EACCES;
        if (get_node_id(inode) != FUSE_ROOT_ID &&
-           time_before_eq(jiffies, fi->i_time))
+           fi->i_time >= get_jiffies_64())
                return 0;
 
        return fuse_do_getattr(inode);
index 63614ed16336d7dec7bd4902a9c43d582e48842e..5c4fcd1dbf5908d29401aa3f83d1aac23a1d8244 100644 (file)
@@ -395,14 +395,16 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
        struct fuse_readpages_data data;
        int err;
 
+       err = -EIO;
        if (is_bad_inode(inode))
-               return -EIO;
+               goto clean_pages_up;
 
        data.file = file;
        data.inode = inode;
        data.req = fuse_get_req(fc);
+       err = PTR_ERR(data.req);
        if (IS_ERR(data.req))
-               return PTR_ERR(data.req);
+               goto clean_pages_up;
 
        err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data);
        if (!err) {
@@ -412,6 +414,10 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
                        fuse_put_request(fc, data.req);
        }
        return err;
+
+clean_pages_up:
+       put_pages_list(pages);
+       return err;
 }
 
 static size_t fuse_send_write(struct fuse_req *req, struct file *file,
index 0dbf96621841506f94ed62ae32260fd077ae19d5..69c7750d55b8e59cfd95a0322f45557a74c0fdfe 100644 (file)
@@ -59,7 +59,7 @@ struct fuse_inode {
        struct fuse_req *forget_req;
 
        /** Time in jiffies until the file attributes are valid */
-       unsigned long i_time;
+       u64 i_time;
 };
 
 /** FUSE specific file data */
index dcaaabd3b9c450ad546b86c54d475c5b8ff0f0ed..7d25092262ae71d3eb0af390b60b8e8a0c587a9e 100644 (file)
@@ -51,7 +51,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
                return NULL;
 
        fi = get_fuse_inode(inode);
-       fi->i_time = jiffies - 1;
+       fi->i_time = 0;
        fi->nodeid = 0;
        fi->nlookup = 0;
        fi->forget_req = fuse_request_alloc();
index f2386442adeeeafad47132049aea39284fc07d98..017cb0f134d6aa600f5c37296b6c786bacb6cf7c 100644 (file)
@@ -187,7 +187,7 @@ static struct inotify_kernel_event * kernel_event(s32 wd, u32 mask, u32 cookie,
 {
        struct inotify_kernel_event *kevent;
 
-       kevent = kmem_cache_alloc(event_cachep, GFP_KERNEL);
+       kevent = kmem_cache_alloc(event_cachep, GFP_NOFS);
        if (unlikely(!kevent))
                return NULL;
 
index 43e3f566aad65fb26a4dcf92845675d561746601..a223cf4faa9b59e61f14e2ffc57712b9469017be 100644 (file)
@@ -168,16 +168,15 @@ void jfs_dirty_inode(struct inode *inode)
        set_cflag(COMMIT_Dirty, inode);
 }
 
-static int
-jfs_get_blocks(struct inode *ip, sector_t lblock, unsigned long max_blocks,
-                       struct buffer_head *bh_result, int create)
+int jfs_get_block(struct inode *ip, sector_t lblock,
+                 struct buffer_head *bh_result, int create)
 {
        s64 lblock64 = lblock;
        int rc = 0;
        xad_t xad;
        s64 xaddr;
        int xflag;
-       s32 xlen = max_blocks;
+       s32 xlen = bh_result->b_size >> ip->i_blkbits;
 
        /*
         * Take appropriate lock on inode
@@ -188,7 +187,7 @@ jfs_get_blocks(struct inode *ip, sector_t lblock, unsigned long max_blocks,
                IREAD_LOCK(ip);
 
        if (((lblock64 << ip->i_sb->s_blocksize_bits) < ip->i_size) &&
-           (!xtLookup(ip, lblock64, max_blocks, &xflag, &xaddr, &xlen, 0)) &&
+           (!xtLookup(ip, lblock64, xlen, &xflag, &xaddr, &xlen, 0)) &&
            xaddr) {
                if (xflag & XAD_NOTRECORDED) {
                        if (!create)
@@ -255,13 +254,6 @@ jfs_get_blocks(struct inode *ip, sector_t lblock, unsigned long max_blocks,
        return rc;
 }
 
-static int jfs_get_block(struct inode *ip, sector_t lblock,
-                        struct buffer_head *bh_result, int create)
-{
-       return jfs_get_blocks(ip, lblock, bh_result->b_size >> ip->i_blkbits,
-                       bh_result, create);
-}
-
 static int jfs_writepage(struct page *page, struct writeback_control *wbc)
 {
        return nobh_writepage(page, jfs_get_block, wbc);
index b5c7da6190dc0ac2364536650923941b8fa43ac8..1fc48df670c834f334f9620c4bd44c0a586145c7 100644 (file)
@@ -32,6 +32,7 @@ extern void jfs_truncate_nolock(struct inode *, loff_t);
 extern void jfs_free_zero_link(struct inode *);
 extern struct dentry *jfs_get_parent(struct dentry *dentry);
 extern void jfs_set_inode_flags(struct inode *);
+extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
 
 extern const struct address_space_operations jfs_aops;
 extern struct inode_operations jfs_dir_inode_operations;
index 4f6cfebc82dbed167db0e5350613aec969f62f8e..143bcd1d5eaa42f0529596676c85c16304a3e995 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/moduleparam.h>
 #include <linux/kthread.h>
 #include <linux/posix_acl.h>
+#include <linux/buffer_head.h>
 #include <asm/uaccess.h>
 #include <linux/seq_file.h>
 
@@ -298,7 +299,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
                        break;
                }
 
-#if defined(CONFIG_QUOTA)
+#ifdef CONFIG_QUOTA
                case Opt_quota:
                case Opt_usrquota:
                        *flag |= JFS_USRQUOTA;
@@ -597,7 +598,7 @@ static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
        if (sbi->flag & JFS_NOINTEGRITY)
                seq_puts(seq, ",nointegrity");
 
-#if defined(CONFIG_QUOTA)
+#ifdef CONFIG_QUOTA
        if (sbi->flag & JFS_USRQUOTA)
                seq_puts(seq, ",usrquota");
 
@@ -608,6 +609,113 @@ static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
        return 0;
 }
 
+#ifdef CONFIG_QUOTA
+
+/* Read data from quotafile - avoid pagecache and such because we cannot afford
+ * acquiring the locks... As quota files are never truncated and quota code
+ * itself serializes the operations (and noone else should touch the files)
+ * we don't have to be afraid of races */
+static ssize_t jfs_quota_read(struct super_block *sb, int type, char *data,
+                             size_t len, loff_t off)
+{
+       struct inode *inode = sb_dqopt(sb)->files[type];
+       sector_t blk = off >> sb->s_blocksize_bits;
+       int err = 0;
+       int offset = off & (sb->s_blocksize - 1);
+       int tocopy;
+       size_t toread;
+       struct buffer_head tmp_bh;
+       struct buffer_head *bh;
+       loff_t i_size = i_size_read(inode);
+
+       if (off > i_size)
+               return 0;
+       if (off+len > i_size)
+               len = i_size-off;
+       toread = len;
+       while (toread > 0) {
+               tocopy = sb->s_blocksize - offset < toread ?
+                               sb->s_blocksize - offset : toread;
+
+               tmp_bh.b_state = 0;
+               tmp_bh.b_size = 1 << inode->i_blkbits;
+               err = jfs_get_block(inode, blk, &tmp_bh, 0);
+               if (err)
+                       return err;
+               if (!buffer_mapped(&tmp_bh))    /* A hole? */
+                       memset(data, 0, tocopy);
+               else {
+                       bh = sb_bread(sb, tmp_bh.b_blocknr);
+                       if (!bh)
+                               return -EIO;
+                       memcpy(data, bh->b_data+offset, tocopy);
+                       brelse(bh);
+               }
+               offset = 0;
+               toread -= tocopy;
+               data += tocopy;
+               blk++;
+       }
+       return len;
+}
+
+/* Write to quotafile */
+static ssize_t jfs_quota_write(struct super_block *sb, int type,
+                              const char *data, size_t len, loff_t off)
+{
+       struct inode *inode = sb_dqopt(sb)->files[type];
+       sector_t blk = off >> sb->s_blocksize_bits;
+       int err = 0;
+       int offset = off & (sb->s_blocksize - 1);
+       int tocopy;
+       size_t towrite = len;
+       struct buffer_head tmp_bh;
+       struct buffer_head *bh;
+
+       mutex_lock(&inode->i_mutex);
+       while (towrite > 0) {
+               tocopy = sb->s_blocksize - offset < towrite ?
+                               sb->s_blocksize - offset : towrite;
+
+               tmp_bh.b_state = 0;
+               tmp_bh.b_size = 1 << inode->i_blkbits;
+               err = jfs_get_block(inode, blk, &tmp_bh, 1);
+               if (err)
+                       goto out;
+               if (offset || tocopy != sb->s_blocksize)
+                       bh = sb_bread(sb, tmp_bh.b_blocknr);
+               else
+                       bh = sb_getblk(sb, tmp_bh.b_blocknr);
+               if (!bh) {
+                       err = -EIO;
+                       goto out;
+               }
+               lock_buffer(bh);
+               memcpy(bh->b_data+offset, data, tocopy);
+               flush_dcache_page(bh->b_page);
+               set_buffer_uptodate(bh);
+               mark_buffer_dirty(bh);
+               unlock_buffer(bh);
+               brelse(bh);
+               offset = 0;
+               towrite -= tocopy;
+               data += tocopy;
+               blk++;
+       }
+out:
+       if (len == towrite)
+               return err;
+       if (inode->i_size < off+len-towrite)
+               i_size_write(inode, off+len-towrite);
+       inode->i_version++;
+       inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+       mark_inode_dirty(inode);
+       mutex_unlock(&inode->i_mutex);
+       return len - towrite;
+}
+
+#endif
+
 static struct super_operations jfs_super_operations = {
        .alloc_inode    = jfs_alloc_inode,
        .destroy_inode  = jfs_destroy_inode,
@@ -621,7 +729,11 @@ static struct super_operations jfs_super_operations = {
        .unlockfs       = jfs_unlockfs,
        .statfs         = jfs_statfs,
        .remount_fs     = jfs_remount,
-       .show_options   = jfs_show_options
+       .show_options   = jfs_show_options,
+#ifdef CONFIG_QUOTA
+       .quota_read     = jfs_quota_read,
+       .quota_write    = jfs_quota_write,
+#endif
 };
 
 static struct export_operations jfs_export_operations = {
index baf5ae513481f97ade8d76d73a2079dcdfe5dc58..c9d419703cf30b35daa6fcf17609b948f465b4a0 100644 (file)
@@ -638,9 +638,6 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
        if (task->tk_status < 0) {
                /* RPC error: Re-insert for retransmission */
                timeout = 10 * HZ;
-       } else if (block->b_done) {
-               /* Block already removed, kill it for real */
-               timeout = 0;
        } else {
                /* Call was successful, now wait for client callback */
                timeout = 60 * HZ;
@@ -709,13 +706,10 @@ nlmsvc_retry_blocked(void)
                        break;
                if (time_after(block->b_when,jiffies))
                        break;
-               dprintk("nlmsvc_retry_blocked(%p, when=%ld, done=%d)\n",
-                       block, block->b_when, block->b_done);
+               dprintk("nlmsvc_retry_blocked(%p, when=%ld)\n",
+                       block, block->b_when);
                kref_get(&block->b_count);
-               if (block->b_done)
-                       nlmsvc_unlink_block(block);
-               else
-                       nlmsvc_grant_blocked(block);
+               nlmsvc_grant_blocked(block);
                nlmsvc_release_block(block);
        }
 
index b0b41a64e10bd86482b10a7ba44b36613a6d25e8..d7c53392cac12cf5b907d0122e1e504ca7a26f0e 100644 (file)
@@ -1421,8 +1421,9 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
        if (!leases_enable)
                goto out;
 
-       error = lease_alloc(filp, arg, &fl);
-       if (error)
+       error = -ENOMEM;
+       fl = locks_alloc_lock();
+       if (fl == NULL)
                goto out;
 
        locks_copy_lock(fl, lease);
@@ -1430,6 +1431,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
        locks_insert_lock(before, fl);
 
        *flp = fl;
+       error = 0;
 out:
        return error;
 }
index e01070d7bf58a39e27a50ade9fcfd598574f43aa..55a131230f94828eea51f54a56efe36a7ca0a9e4 100644 (file)
@@ -159,7 +159,7 @@ char * getname(const char __user * filename)
 #ifdef CONFIG_AUDITSYSCALL
 void putname(const char *name)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                audit_putname(name);
        else
                __putname(name);
@@ -1125,7 +1125,7 @@ static int fastcall do_path_lookup(int dfd, const char *name,
        retval = link_path_walk(name, nd);
 out:
        if (likely(retval == 0)) {
-               if (unlikely(current->audit_context && nd && nd->dentry &&
+               if (unlikely(!audit_dummy_context() && nd && nd->dentry &&
                                nd->dentry->d_inode))
                audit_inode(name, nd->dentry->d_inode);
        }
@@ -1357,7 +1357,7 @@ static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
                return -ENOENT;
 
        BUG_ON(victim->d_parent->d_inode != dir);
-       audit_inode_child(victim->d_name.name, victim->d_inode, dir->i_ino);
+       audit_inode_child(victim->d_name.name, victim->d_inode, dir);
 
        error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
        if (error)
@@ -1659,6 +1659,7 @@ do_last:
         * It already exists.
         */
        mutex_unlock(&dir->d_inode->i_mutex);
+       audit_inode_update(path.dentry->d_inode);
 
        error = -EEXIST;
        if (flag & O_EXCL)
@@ -1669,6 +1670,7 @@ do_last:
                if (flag & O_NOFOLLOW)
                        goto exit_dput;
        }
+
        error = -ENOENT;
        if (!path.dentry->d_inode)
                goto exit_dput;
index 19b98ca468eb630f90978347aa54eb85fc1fa4ce..86b3169c8cac0b01eded9d13c59edf01912b6f68 100644 (file)
@@ -51,7 +51,7 @@ char *nfs_path(const char *base, const struct dentry *dentry,
                namelen = dentry->d_name.len;
                buflen -= namelen + 1;
                if (buflen < 0)
-                       goto Elong;
+                       goto Elong_unlock;
                end -= namelen;
                memcpy(end, dentry->d_name.name, namelen);
                *--end = '/';
@@ -68,6 +68,8 @@ char *nfs_path(const char *base, const struct dentry *dentry,
        end -= namelen;
        memcpy(end, base, namelen);
        return end;
+Elong_unlock:
+       spin_unlock(&dcache_lock);
 Elong:
        return ERR_PTR(-ENAMETOOLONG);
 }
index 52bf634260a11c162cd7b5a8859782ff5924a1bd..65c0c5b32351cfaf7b3f9facd5d0e37a1bd9ce9b 100644 (file)
@@ -63,7 +63,7 @@ struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount)
        return p;
 }
 
-void nfs_readdata_free(struct nfs_read_data *p)
+static void nfs_readdata_free(struct nfs_read_data *p)
 {
        if (p && (p->pagevec != &p->page_array[0]))
                kfree(p->pagevec);
index 86bac6a5008e7b3a1d7b5184887f1413dfb97d88..50774991f8d56f845b1a79ced47f6e526557306d 100644 (file)
@@ -137,7 +137,7 @@ struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount)
        return p;
 }
 
-void nfs_writedata_free(struct nfs_write_data *p)
+static void nfs_writedata_free(struct nfs_write_data *p)
 {
        if (p && (p->pagevec != &p->page_array[0]))
                kfree(p->pagevec);
index ecc439d2565fda18ecbeb460ec18eb5cb3115742..501d83884530859e767bfaeb8341a51105b01206 100644 (file)
@@ -187,6 +187,11 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                        goto out;
                }
 
+               /* Set user creds for this exportpoint */
+               error = nfserrno(nfsd_setuser(rqstp, exp));
+               if (error)
+                       goto out;
+
                /*
                 * Look up the dentry using the NFS file handle.
                 */
@@ -241,16 +246,17 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                dprintk("nfsd: fh_verify - just checking\n");
                dentry = fhp->fh_dentry;
                exp = fhp->fh_export;
+               /* Set user creds for this exportpoint; necessary even
+                * in the "just checking" case because this may be a
+                * filehandle that was created by fh_compose, and that
+                * is about to be used in another nfsv4 compound
+                * operation */
+               error = nfserrno(nfsd_setuser(rqstp, exp));
+               if (error)
+                       goto out;
        }
        cache_get(&exp->h);
 
-       /* Set user creds for this exportpoint; necessary even in the "just
-        * checking" case because this may be a filehandle that was created by
-        * fh_compose, and that is about to be used in another nfsv4 compound
-        * operation */
-       error = nfserrno(nfsd_setuser(rqstp, exp));
-       if (error)
-               goto out;
 
        error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
        if (error)
index 1b8346dd0572ff349b3f01dc94140a9c8ed0557c..9503240ef0e50d46f413e46b62a665de3eec57bd 100644 (file)
@@ -2375,7 +2375,6 @@ leave:
        mlog(0, "returning %d\n", ret);
        return ret;
 }
-EXPORT_SYMBOL_GPL(dlm_migrate_lockres);
 
 int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock)
 {
index b0c3134f4f7089b016baaffcf54ed85e266d7f90..37be4b2e0d4a8801982e97a8636f61abd1360d4e 100644 (file)
@@ -155,7 +155,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
        else
                status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions);
 
-       if (status != DLM_NORMAL)
+       if (status != DLM_NORMAL && (status != DLM_CANCELGRANT || !master_node))
                goto leave;
 
        /* By now this has been masked out of cancel requests. */
@@ -183,8 +183,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
                spin_lock(&lock->spinlock);
                /* if the master told us the lock was already granted,
                 * let the ast handle all of these actions */
-               if (status == DLM_NORMAL &&
-                   lksb->status == DLM_CANCELGRANT) {
+               if (status == DLM_CANCELGRANT) {
                        actions &= ~(DLM_UNLOCK_REMOVE_LOCK|
                                     DLM_UNLOCK_REGRANT_LOCK|
                                     DLM_UNLOCK_CLEAR_CONVERT_TYPE);
@@ -349,14 +348,9 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
                                        vec, veclen, owner, &status);
        if (tmpret >= 0) {
                // successfully sent and received
-               if (status == DLM_CANCELGRANT)
-                       ret = DLM_NORMAL;
-               else if (status == DLM_FORWARD) {
+               if (status == DLM_FORWARD)
                        mlog(0, "master was in-progress.  retry\n");
-                       ret = DLM_FORWARD;
-               } else
-                       ret = status;
-               lksb->status = status;
+               ret = status;
        } else {
                mlog_errno(tmpret);
                if (dlm_is_host_down(tmpret)) {
@@ -372,7 +366,6 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
                        /* something bad.  this will BUG in ocfs2 */
                        ret = dlm_err_to_dlm_status(tmpret);
                }
-               lksb->status = ret;
        }
 
        return ret;
@@ -483,6 +476,10 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data)
 
        /* lock was found on queue */
        lksb = lock->lksb;
+       if (flags & (LKM_VALBLK|LKM_PUT_LVB) &&
+           lock->ml.type != LKM_EXMODE)
+               flags &= ~(LKM_VALBLK|LKM_PUT_LVB);
+
        /* unlockast only called on originating node */
        if (flags & LKM_PUT_LVB) {
                lksb->flags |= DLM_LKSB_PUT_LVB;
@@ -507,11 +504,8 @@ not_found:
                               "cookie=%u:%llu\n",
                               dlm_get_lock_cookie_node(unlock->cookie),
                               dlm_get_lock_cookie_seq(unlock->cookie));
-       else {
-               /* send the lksb->status back to the other node */
-               status = lksb->status;
+       else
                dlm_lock_put(lock);
-       }
 
 leave:
        if (res)
@@ -533,26 +527,22 @@ static enum dlm_status dlm_get_cancel_actions(struct dlm_ctxt *dlm,
 
        if (dlm_lock_on_list(&res->blocked, lock)) {
                /* cancel this outright */
-               lksb->status = DLM_NORMAL;
                status = DLM_NORMAL;
                *actions = (DLM_UNLOCK_CALL_AST |
                            DLM_UNLOCK_REMOVE_LOCK);
        } else if (dlm_lock_on_list(&res->converting, lock)) {
                /* cancel the request, put back on granted */
-               lksb->status = DLM_NORMAL;
                status = DLM_NORMAL;
                *actions = (DLM_UNLOCK_CALL_AST |
                            DLM_UNLOCK_REMOVE_LOCK |
                            DLM_UNLOCK_REGRANT_LOCK |
                            DLM_UNLOCK_CLEAR_CONVERT_TYPE);
        } else if (dlm_lock_on_list(&res->granted, lock)) {
-               /* too late, already granted.  DLM_CANCELGRANT */
-               lksb->status = DLM_CANCELGRANT;
-               status = DLM_NORMAL;
+               /* too late, already granted. */
+               status = DLM_CANCELGRANT;
                *actions = DLM_UNLOCK_CALL_AST;
        } else {
                mlog(ML_ERROR, "lock to cancel is not on any list!\n");
-               lksb->status = DLM_IVLOCKID;
                status = DLM_IVLOCKID;
                *actions = 0;
        }
@@ -569,13 +559,11 @@ static enum dlm_status dlm_get_unlock_actions(struct dlm_ctxt *dlm,
 
        /* unlock request */
        if (!dlm_lock_on_list(&res->granted, lock)) {
-               lksb->status = DLM_DENIED;
                status = DLM_DENIED;
                dlm_error(status);
                *actions = 0;
        } else {
                /* unlock granted lock */
-               lksb->status = DLM_NORMAL;
                status = DLM_NORMAL;
                *actions = (DLM_UNLOCK_FREE_LOCK |
                            DLM_UNLOCK_CALL_AST |
@@ -632,6 +620,8 @@ retry:
 
        spin_lock(&res->spinlock);
        is_master = (res->owner == dlm->node_num);
+       if (flags & LKM_VALBLK && lock->ml.type != LKM_EXMODE)
+               flags &= ~LKM_VALBLK;
        spin_unlock(&res->spinlock);
 
        if (is_master) {
@@ -665,7 +655,7 @@ retry:
        }
 
        if (call_ast) {
-               mlog(0, "calling unlockast(%p, %d)\n", data, lksb->status);
+               mlog(0, "calling unlockast(%p, %d)\n", data, status);
                if (is_master) {
                        /* it is possible that there is one last bast 
                         * pending.  make sure it is flushed, then
@@ -677,9 +667,12 @@ retry:
                        wait_event(dlm->ast_wq, 
                                   dlm_lock_basts_flushed(dlm, lock));
                }
-               (*unlockast)(data, lksb->status);
+               (*unlockast)(data, status);
        }
 
+       if (status == DLM_CANCELGRANT)
+               status = DLM_NORMAL;
+
        if (status == DLM_NORMAL) {
                mlog(0, "kicking the thread\n");
                dlm_kick_thread(dlm, res);
index 0d1973ea32b0a0b4d9d61e70a819022168cb1725..1f17a4d08287fbd6b1e02fc13c3aac997bdcd2c1 100644 (file)
@@ -840,6 +840,12 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
 
        mlog(0, "Allocating %u clusters for a new window.\n",
             ocfs2_local_alloc_window_bits(osb));
+
+       /* Instruct the allocation code to try the most recently used
+        * cluster group. We'll re-record the group used this pass
+        * below. */
+       ac->ac_last_group = osb->la_last_gd;
+
        /* we used the generic suballoc reserve function, but we set
         * everything up nicely, so there's no reason why we can't use
         * the more specific cluster api to claim bits. */
@@ -852,6 +858,8 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
                goto bail;
        }
 
+       osb->la_last_gd = ac->ac_last_group;
+
        la->la_bm_off = cpu_to_le32(cluster_off);
        alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count);
        /* just in case... In the future when we find space ourselves,
index cd4a6f253d13ac0a6bf7c70a50df905daccc6bec..0462a7f4e21b398300f3ed1bf8b80b6b7d30ce07 100644 (file)
@@ -197,7 +197,6 @@ struct ocfs2_super
        struct ocfs2_node_map recovery_map;
        struct ocfs2_node_map umount_map;
 
-       u32 num_clusters;
        u64 root_blkno;
        u64 system_dir_blkno;
        u64 bitmap_blkno;
@@ -237,6 +236,7 @@ struct ocfs2_super
 
        enum ocfs2_local_alloc_state local_alloc_state;
        struct buffer_head *local_alloc_bh;
+       u64 la_last_gd;
 
        /* Next two fields are for local node slot recovery during
         * mount. */
index 195523090c875cfd50a155f5a18df3e8269b786a..9d91e66f51a9fa4606a6f864e2bc7531e10c1a75 100644 (file)
@@ -70,12 +70,6 @@ static int ocfs2_block_group_search(struct inode *inode,
                                    struct buffer_head *group_bh,
                                    u32 bits_wanted, u32 min_bits,
                                    u16 *bit_off, u16 *bits_found);
-static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
-                             u32 bits_wanted,
-                             u32 min_bits,
-                             u16 *bit_off,
-                             unsigned int *num_bits,
-                             u64 *bg_blkno);
 static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb,
                                     struct ocfs2_alloc_context *ac,
                                     u32 bits_wanted,
@@ -85,11 +79,6 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb,
                                     u64 *bg_blkno);
 static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
                                         int nr);
-static int ocfs2_block_group_find_clear_bits(struct ocfs2_super *osb,
-                                            struct buffer_head *bg_bh,
-                                            unsigned int bits_wanted,
-                                            u16 *bit_off,
-                                            u16 *bits_found);
 static inline int ocfs2_block_group_set_bits(struct ocfs2_journal_handle *handle,
                                             struct inode *alloc_inode,
                                             struct ocfs2_group_desc *bg,
@@ -143,6 +132,64 @@ static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl)
        return (u32)le16_to_cpu(cl->cl_cpg) * (u32)le16_to_cpu(cl->cl_bpc);
 }
 
+/* somewhat more expensive than our other checks, so use sparingly. */
+static int ocfs2_check_group_descriptor(struct super_block *sb,
+                                       struct ocfs2_dinode *di,
+                                       struct ocfs2_group_desc *gd)
+{
+       unsigned int max_bits;
+
+       if (!OCFS2_IS_VALID_GROUP_DESC(gd)) {
+               OCFS2_RO_ON_INVALID_GROUP_DESC(sb, gd);
+               return -EIO;
+       }
+
+       if (di->i_blkno != gd->bg_parent_dinode) {
+               ocfs2_error(sb, "Group descriptor # %llu has bad parent "
+                           "pointer (%llu, expected %llu)",
+                           (unsigned long long)le64_to_cpu(gd->bg_blkno),
+                           (unsigned long long)le64_to_cpu(gd->bg_parent_dinode),
+                           (unsigned long long)le64_to_cpu(di->i_blkno));
+               return -EIO;
+       }
+
+       max_bits = le16_to_cpu(di->id2.i_chain.cl_cpg) * le16_to_cpu(di->id2.i_chain.cl_bpc);
+       if (le16_to_cpu(gd->bg_bits) > max_bits) {
+               ocfs2_error(sb, "Group descriptor # %llu has bit count of %u",
+                           (unsigned long long)le64_to_cpu(gd->bg_blkno),
+                           le16_to_cpu(gd->bg_bits));
+               return -EIO;
+       }
+
+       if (le16_to_cpu(gd->bg_chain) >=
+           le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) {
+               ocfs2_error(sb, "Group descriptor # %llu has bad chain %u",
+                           (unsigned long long)le64_to_cpu(gd->bg_blkno),
+                           le16_to_cpu(gd->bg_chain));
+               return -EIO;
+       }
+
+       if (le16_to_cpu(gd->bg_free_bits_count) > le16_to_cpu(gd->bg_bits)) {
+               ocfs2_error(sb, "Group descriptor # %llu has bit count %u but "
+                           "claims that %u are free",
+                           (unsigned long long)le64_to_cpu(gd->bg_blkno),
+                           le16_to_cpu(gd->bg_bits),
+                           le16_to_cpu(gd->bg_free_bits_count));
+               return -EIO;
+       }
+
+       if (le16_to_cpu(gd->bg_bits) > (8 * le16_to_cpu(gd->bg_size))) {
+               ocfs2_error(sb, "Group descriptor # %llu has bit count %u but "
+                           "max bitmap bits of %u",
+                           (unsigned long long)le64_to_cpu(gd->bg_blkno),
+                           le16_to_cpu(gd->bg_bits),
+                           8 * le16_to_cpu(gd->bg_size));
+               return -EIO;
+       }
+
+       return 0;
+}
+
 static int ocfs2_block_group_fill(struct ocfs2_journal_handle *handle,
                                  struct inode *alloc_inode,
                                  struct buffer_head *bg_bh,
@@ -663,6 +710,7 @@ static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
 static int ocfs2_block_group_find_clear_bits(struct ocfs2_super *osb,
                                             struct buffer_head *bg_bh,
                                             unsigned int bits_wanted,
+                                            unsigned int total_bits,
                                             u16 *bit_off,
                                             u16 *bits_found)
 {
@@ -679,10 +727,8 @@ static int ocfs2_block_group_find_clear_bits(struct ocfs2_super *osb,
        found = start = best_offset = best_size = 0;
        bitmap = bg->bg_bitmap;
 
-       while((offset = ocfs2_find_next_zero_bit(bitmap,
-                                                le16_to_cpu(bg->bg_bits),
-                                                start)) != -1) {
-               if (offset == le16_to_cpu(bg->bg_bits))
+       while((offset = ocfs2_find_next_zero_bit(bitmap, total_bits, start)) != -1) {
+               if (offset == total_bits)
                        break;
 
                if (!ocfs2_test_bg_bit_allocatable(bg_bh, offset)) {
@@ -911,14 +957,35 @@ static int ocfs2_cluster_group_search(struct inode *inode,
 {
        int search = -ENOSPC;
        int ret;
-       struct ocfs2_group_desc *bg = (struct ocfs2_group_desc *) group_bh->b_data;
+       struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *) group_bh->b_data;
        u16 tmp_off, tmp_found;
+       unsigned int max_bits, gd_cluster_off;
 
        BUG_ON(!ocfs2_is_cluster_bitmap(inode));
 
-       if (bg->bg_free_bits_count) {
+       if (gd->bg_free_bits_count) {
+               max_bits = le16_to_cpu(gd->bg_bits);
+
+               /* Tail groups in cluster bitmaps which aren't cpg
+                * aligned are prone to partial extention by a failed
+                * fs resize. If the file system resize never got to
+                * update the dinode cluster count, then we don't want
+                * to trust any clusters past it, regardless of what
+                * the group descriptor says. */
+               gd_cluster_off = ocfs2_blocks_to_clusters(inode->i_sb,
+                                                         le64_to_cpu(gd->bg_blkno));
+               if ((gd_cluster_off + max_bits) >
+                   OCFS2_I(inode)->ip_clusters) {
+                       max_bits = OCFS2_I(inode)->ip_clusters - gd_cluster_off;
+                       mlog(0, "Desc %llu, bg_bits %u, clusters %u, use %u\n",
+                            (unsigned long long)le64_to_cpu(gd->bg_blkno),
+                            le16_to_cpu(gd->bg_bits),
+                            OCFS2_I(inode)->ip_clusters, max_bits);
+               }
+
                ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
                                                        group_bh, bits_wanted,
+                                                       max_bits,
                                                        &tmp_off, &tmp_found);
                if (ret)
                        return ret;
@@ -951,17 +1018,109 @@ static int ocfs2_block_group_search(struct inode *inode,
        if (bg->bg_free_bits_count)
                ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
                                                        group_bh, bits_wanted,
+                                                       le16_to_cpu(bg->bg_bits),
                                                        bit_off, bits_found);
 
        return ret;
 }
 
+static int ocfs2_alloc_dinode_update_counts(struct inode *inode,
+                                      struct ocfs2_journal_handle *handle,
+                                      struct buffer_head *di_bh,
+                                      u32 num_bits,
+                                      u16 chain)
+{
+       int ret;
+       u32 tmp_used;
+       struct ocfs2_dinode *di = (struct ocfs2_dinode *) di_bh->b_data;
+       struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain;
+
+       ret = ocfs2_journal_access(handle, inode, di_bh,
+                                  OCFS2_JOURNAL_ACCESS_WRITE);
+       if (ret < 0) {
+               mlog_errno(ret);
+               goto out;
+       }
+
+       tmp_used = le32_to_cpu(di->id1.bitmap1.i_used);
+       di->id1.bitmap1.i_used = cpu_to_le32(num_bits + tmp_used);
+       le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits);
+
+       ret = ocfs2_journal_dirty(handle, di_bh);
+       if (ret < 0)
+               mlog_errno(ret);
+
+out:
+       return ret;
+}
+
+static int ocfs2_search_one_group(struct ocfs2_alloc_context *ac,
+                                 u32 bits_wanted,
+                                 u32 min_bits,
+                                 u16 *bit_off,
+                                 unsigned int *num_bits,
+                                 u64 gd_blkno,
+                                 u16 *bits_left)
+{
+       int ret;
+       u16 found;
+       struct buffer_head *group_bh = NULL;
+       struct ocfs2_group_desc *gd;
+       struct inode *alloc_inode = ac->ac_inode;
+       struct ocfs2_journal_handle *handle = ac->ac_handle;
+
+       ret = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb), gd_blkno,
+                              &group_bh, OCFS2_BH_CACHED, alloc_inode);
+       if (ret < 0) {
+               mlog_errno(ret);
+               return ret;
+       }
+
+       gd = (struct ocfs2_group_desc *) group_bh->b_data;
+       if (!OCFS2_IS_VALID_GROUP_DESC(gd)) {
+               OCFS2_RO_ON_INVALID_GROUP_DESC(alloc_inode->i_sb, gd);
+               ret = -EIO;
+               goto out;
+       }
+
+       ret = ac->ac_group_search(alloc_inode, group_bh, bits_wanted, min_bits,
+                                 bit_off, &found);
+       if (ret < 0) {
+               if (ret != -ENOSPC)
+                       mlog_errno(ret);
+               goto out;
+       }
+
+       *num_bits = found;
+
+       ret = ocfs2_alloc_dinode_update_counts(alloc_inode, handle, ac->ac_bh,
+                                              *num_bits,
+                                              le16_to_cpu(gd->bg_chain));
+       if (ret < 0) {
+               mlog_errno(ret);
+               goto out;
+       }
+
+       ret = ocfs2_block_group_set_bits(handle, alloc_inode, gd, group_bh,
+                                        *bit_off, *num_bits);
+       if (ret < 0)
+               mlog_errno(ret);
+
+       *bits_left = le16_to_cpu(gd->bg_free_bits_count);
+
+out:
+       brelse(group_bh);
+
+       return ret;
+}
+
 static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
                              u32 bits_wanted,
                              u32 min_bits,
                              u16 *bit_off,
                              unsigned int *num_bits,
-                             u64 *bg_blkno)
+                             u64 *bg_blkno,
+                             u16 *bits_left)
 {
        int status;
        u16 chain, tmp_bits;
@@ -988,9 +1147,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
                goto bail;
        }
        bg = (struct ocfs2_group_desc *) group_bh->b_data;
-       if (!OCFS2_IS_VALID_GROUP_DESC(bg)) {
-               OCFS2_RO_ON_INVALID_GROUP_DESC(alloc_inode->i_sb, bg);
-               status = -EIO;
+       status = ocfs2_check_group_descriptor(alloc_inode->i_sb, fe, bg);
+       if (status) {
+               mlog_errno(status);
                goto bail;
        }
 
@@ -1018,9 +1177,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
                        goto bail;
                }
                bg = (struct ocfs2_group_desc *) group_bh->b_data;
-               if (!OCFS2_IS_VALID_GROUP_DESC(bg)) {
-                       OCFS2_RO_ON_INVALID_GROUP_DESC(alloc_inode->i_sb, bg);
-                       status = -EIO;
+               status = ocfs2_check_group_descriptor(alloc_inode->i_sb, fe, bg);
+               if (status) {
+                       mlog_errno(status);
                        goto bail;
                }
        }
@@ -1099,6 +1258,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
             (unsigned long long)fe->i_blkno);
 
        *bg_blkno = le64_to_cpu(bg->bg_blkno);
+       *bits_left = le16_to_cpu(bg->bg_free_bits_count);
 bail:
        if (group_bh)
                brelse(group_bh);
@@ -1120,6 +1280,8 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb,
 {
        int status;
        u16 victim, i;
+       u16 bits_left = 0;
+       u64 hint_blkno = ac->ac_last_group;
        struct ocfs2_chain_list *cl;
        struct ocfs2_dinode *fe;
 
@@ -1146,6 +1308,28 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb,
                goto bail;
        }
 
+       if (hint_blkno) {
+               /* Attempt to short-circuit the usual search mechanism
+                * by jumping straight to the most recently used
+                * allocation group. This helps us mantain some
+                * contiguousness across allocations. */
+               status = ocfs2_search_one_group(ac, bits_wanted, min_bits,
+                                               bit_off, num_bits,
+                                               hint_blkno, &bits_left);
+               if (!status) {
+                       /* Be careful to update *bg_blkno here as the
+                        * caller is expecting it to be filled in, and
+                        * ocfs2_search_one_group() won't do that for
+                        * us. */
+                       *bg_blkno = hint_blkno;
+                       goto set_hint;
+               }
+               if (status < 0 && status != -ENOSPC) {
+                       mlog_errno(status);
+                       goto bail;
+               }
+       }
+
        cl = (struct ocfs2_chain_list *) &fe->id2.i_chain;
 
        victim = ocfs2_find_victim_chain(cl);
@@ -1153,9 +1337,9 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb,
        ac->ac_allow_chain_relink = 1;
 
        status = ocfs2_search_chain(ac, bits_wanted, min_bits, bit_off,
-                                   num_bits, bg_blkno);
+                                   num_bits, bg_blkno, &bits_left);
        if (!status)
-               goto bail;
+               goto set_hint;
        if (status < 0 && status != -ENOSPC) {
                mlog_errno(status);
                goto bail;
@@ -1177,8 +1361,8 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb,
 
                ac->ac_chain = i;
                status = ocfs2_search_chain(ac, bits_wanted, min_bits,
-                                           bit_off, num_bits,
-                                           bg_blkno);
+                                           bit_off, num_bits, bg_blkno,
+                                           &bits_left);
                if (!status)
                        break;
                if (status < 0 && status != -ENOSPC) {
@@ -1186,8 +1370,19 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb,
                        goto bail;
                }
        }
-bail:
 
+set_hint:
+       if (status != -ENOSPC) {
+               /* If the next search of this group is not likely to
+                * yield a suitable extent, then we reset the last
+                * group hint so as to not waste a disk read */
+               if (bits_left < min_bits)
+                       ac->ac_last_group = 0;
+               else
+                       ac->ac_last_group = *bg_blkno;
+       }
+
+bail:
        mlog_exit(status);
        return status;
 }
@@ -1341,7 +1536,7 @@ int ocfs2_claim_clusters(struct ocfs2_super *osb,
 {
        int status;
        unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given;
-       u64 bg_blkno;
+       u64 bg_blkno = 0;
        u16 bg_bit_off;
 
        mlog_entry_void();
@@ -1494,9 +1689,9 @@ static int ocfs2_free_suballoc_bits(struct ocfs2_journal_handle *handle,
        }
 
        group = (struct ocfs2_group_desc *) group_bh->b_data;
-       if (!OCFS2_IS_VALID_GROUP_DESC(group)) {
-               OCFS2_RO_ON_INVALID_GROUP_DESC(alloc_inode->i_sb, group);
-               status = -EIO;
+       status = ocfs2_check_group_descriptor(alloc_inode->i_sb, fe, group);
+       if (status) {
+               mlog_errno(status);
                goto bail;
        }
        BUG_ON((count + start_bit) > le16_to_cpu(group->bg_bits));
index a76c82a7ceac30bb69dfef2f818e9cac43c9353b..c787838d1052474d335b2754c88cf0a1d68f06c1 100644 (file)
@@ -49,6 +49,8 @@ struct ocfs2_alloc_context {
        u16    ac_chain;
        int    ac_allow_chain_relink;
        group_search_t *ac_group_search;
+
+       u64    ac_last_group;
 };
 
 void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac);
index 382706a67ffdce24decb8349851384739e2d05e3..d17e33e66a1e5228cead65463a3255adb383fa71 100644 (file)
@@ -1442,8 +1442,13 @@ static int ocfs2_initialize_super(struct super_block *sb,
 
        osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
 
+       /* We don't have a cluster lock on the bitmap here because
+        * we're only interested in static information and the extra
+        * complexity at mount time isn't worht it. Don't pass the
+        * inode in to the read function though as we don't want it to
+        * be put in the cache. */
        status = ocfs2_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0,
-                                 inode);
+                                 NULL);
        iput(inode);
        if (status < 0) {
                mlog_errno(status);
@@ -1452,7 +1457,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
 
        di = (struct ocfs2_dinode *) bitmap_bh->b_data;
        osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg);
-       osb->num_clusters = le32_to_cpu(di->id1.bitmap1.i_total);
        brelse(bitmap_bh);
        mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n",
             (unsigned long long)osb->bitmap_blkno, osb->bitmap_cpg);
index c9a478099281711e134b5df8be37b9f1ac0ef5f0..e478f194183147b21169aa91a7b8d81b9415f823 100644 (file)
@@ -99,7 +99,7 @@ config IBM_PARTITION
 
 config MAC_PARTITION
        bool "Macintosh partition map support" if PARTITION_ADVANCED
-       default y if MAC
+       default y if (MAC || PPC_PMAC)
        help
          Say Y here if you would like to use hard disks under Linux which
          were partitioned on a Macintosh.
index f318b58510fd896b2b68c04fadb5ca6af5daa3fc..1627edd50810b94df2f4003479092022c9952d9d 100644 (file)
@@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
                return 0;
        }
 
-       reiserfs_write_lock(inode->i_sb);
        mutex_lock(&inode->i_mutex);
+       reiserfs_write_lock(inode->i_sb);
        /* freeing preallocation only involves relogging blocks that
         * are already in the current transaction.  preallocation gets
         * freed at the end of each transaction, so it is impossible for
index 12dfdcfbee3dfb8666712f81fb8ca28f203568cb..52f1e2136546f215f7bd13ea403735222a621e46 100644 (file)
@@ -39,14 +39,10 @@ void reiserfs_delete_inode(struct inode *inode)
 
        /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
        if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) {  /* also handles bad_inode case */
-               mutex_lock(&inode->i_mutex);
-
                reiserfs_delete_xattrs(inode);
 
-               if (journal_begin(&th, inode->i_sb, jbegin_count)) {
-                       mutex_unlock(&inode->i_mutex);
+               if (journal_begin(&th, inode->i_sb, jbegin_count))
                        goto out;
-               }
                reiserfs_update_inode_transaction(inode);
 
                err = reiserfs_delete_object(&th, inode);
@@ -57,12 +53,8 @@ void reiserfs_delete_inode(struct inode *inode)
                if (!err) 
                        DQUOT_FREE_INODE(inode);
 
-               if (journal_end(&th, inode->i_sb, jbegin_count)) {
-                       mutex_unlock(&inode->i_mutex);
+               if (journal_end(&th, inode->i_sb, jbegin_count))
                        goto out;
-               }
-
-               mutex_unlock(&inode->i_mutex);
 
                /* check return value from reiserfs_delete_object after
                 * ending the transaction
@@ -2348,6 +2340,7 @@ static int reiserfs_write_full_page(struct page *page,
        unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT;
        int error = 0;
        unsigned long block;
+       sector_t last_block;
        struct buffer_head *head, *bh;
        int partial = 0;
        int nr = 0;
@@ -2395,10 +2388,19 @@ static int reiserfs_write_full_page(struct page *page,
        }
        bh = head;
        block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits);
+       last_block = (i_size_read(inode) - 1) >> inode->i_blkbits;
        /* first map all the buffers, logging any direct items we find */
        do {
-               if ((checked || buffer_dirty(bh)) && (!buffer_mapped(bh) ||
-                                                     (buffer_mapped(bh)
+               if (block > last_block) {
+                       /*
+                        * This can happen when the block size is less than
+                        * the page size.  The corresponding bytes in the page
+                        * were zero filled above
+                        */
+                       clear_buffer_dirty(bh);
+                       set_buffer_uptodate(bh);
+               } else if ((checked || buffer_dirty(bh)) &&
+                          (!buffer_mapped(bh) || (buffer_mapped(bh)
                                                       && bh->b_blocknr ==
                                                       0))) {
                        /* not mapped yet, or it points to a direct item, search
index 745c8810089512e0b9a77d6f3847ea7683500037..a986b5e1e288c8dd47eca5ea525c9cfe2fc26b77 100644 (file)
@@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
        if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
                return 0;
        }
-       reiserfs_write_lock(inode->i_sb);
 
        /* we need to make sure nobody is changing the file size beneath
         ** us
         */
        mutex_lock(&inode->i_mutex);
+       reiserfs_write_lock(inode->i_sb);
 
        write_from = inode->i_size & (blocksize - 1);
        /* if we are on a block boundary, we are already unpacked.  */
index 3873c672cb4c0ce09b63a5d06801ddeba029b800..33323473e3c43edfbd53a16014f3bf313d580ac4 100644 (file)
@@ -75,6 +75,12 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
        }
        *err = -ENOSPC;
 
+       UDF_I_UNIQUE(inode) = 0;
+       UDF_I_LENEXTENTS(inode) = 0;
+       UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
+       UDF_I_NEXT_ALLOC_GOAL(inode) = 0;
+       UDF_I_STRAT4096(inode) = 0;
+
        block = udf_new_block(dir->i_sb, NULL, UDF_I_LOCATION(dir).partitionReferenceNum,
                start, err);
        if (*err)
@@ -84,11 +90,6 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
        }
 
        mutex_lock(&sbi->s_alloc_mutex);
-       UDF_I_UNIQUE(inode) = 0;
-       UDF_I_LENEXTENTS(inode) = 0;
-       UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
-       UDF_I_NEXT_ALLOC_GOAL(inode) = 0;
-       UDF_I_STRAT4096(inode) = 0;
        if (UDF_SB_LVIDBH(sb))
        {
                struct logicalVolHeaderDesc *lvhd;
index 4df822c881b69357038f96f0d91f6231f7da4a15..7de172efa0841eac8239b72b839138e0adab4146 100644 (file)
@@ -115,6 +115,13 @@ static struct inode *udf_alloc_inode(struct super_block *sb)
        ei = (struct udf_inode_info *)kmem_cache_alloc(udf_inode_cachep, SLAB_KERNEL);
        if (!ei)
                return NULL;
+
+       ei->i_unique = 0;
+       ei->i_lenExtents = 0;
+       ei->i_next_alloc_block = 0;
+       ei->i_next_alloc_goal = 0;
+       ei->i_strat4096 = 0;
+
        return &ei->vfs_inode;
 }
 
index b01804baa120f630c1fe2480a970086e96e58cde..b82381475779b59ecdd52685eafc05db391d6bb2 100644 (file)
@@ -248,7 +248,7 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
 
                if (likely(cur_index != index)) {
                        page = ufs_get_locked_page(mapping, index);
-                       if (IS_ERR(page))
+                       if (!page || IS_ERR(page)) /* it was truncated or EIO */
                                continue;
                } else
                        page = locked_page;
index abd5f23a426d5918f0bbe5b41ce4f6600a63d19f..d344b411e2617eca708d104a7b8dc5266e26ab7b 100644 (file)
@@ -129,7 +129,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
        struct inode * inode;
 
        if (l > sb->s_blocksize)
-               goto out;
+               goto out_notlocked;
 
        lock_kernel();
        inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO);
@@ -155,6 +155,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
        err = ufs_add_nondir(dentry, inode);
 out:
        unlock_kernel();
+out_notlocked:
        return err;
 
 out_fail:
index 337cf2c46d109f1e9c9cef3492ed2dd26bffe07e..22f820a9b15c782dace5e86fc2a6bf9d9ad74ab0 100644 (file)
@@ -251,12 +251,12 @@ struct page *ufs_get_locked_page(struct address_space *mapping,
 {
        struct page *page;
 
-try_again:
        page = find_lock_page(mapping, index);
        if (!page) {
                page = read_cache_page(mapping, index,
                                       (filler_t*)mapping->a_ops->readpage,
                                       NULL);
+
                if (IS_ERR(page)) {
                        printk(KERN_ERR "ufs_change_blocknr: "
                               "read_cache_page error: ino %lu, index: %lu\n",
@@ -266,6 +266,14 @@ try_again:
 
                lock_page(page);
 
+               if (unlikely(page->mapping == NULL)) {
+                       /* Truncate got there first */
+                       unlock_page(page);
+                       page_cache_release(page);
+                       page = NULL;
+                       goto out;
+               }
+
                if (!PageUptodate(page) || PageError(page)) {
                        unlock_page(page);
                        page_cache_release(page);
@@ -275,15 +283,8 @@ try_again:
                               mapping->host->i_ino, index);
 
                        page = ERR_PTR(-EIO);
-                       goto out;
                }
        }
-
-       if (unlikely(!page->mapping || !page_has_buffers(page))) {
-               unlock_page(page);
-               page_cache_release(page);
-               goto try_again;/*we really need these buffers*/
-       }
 out:
        return page;
 }
index ceda3a2859d2db29975b5ace0994e9624b327db5..7858703ed84cf42130de0bf5444eac74111c4c82 100644 (file)
@@ -246,8 +246,8 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
 #define BUF_BUSY               XBF_DONT_BLOCK
 
 #define XFS_BUF_BFLAGS(bp)     ((bp)->b_flags)
-#define XFS_BUF_ZEROFLAGS(bp)  \
-       ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI))
+#define XFS_BUF_ZEROFLAGS(bp)  ((bp)->b_flags &= \
+               ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI|XBF_ORDERED))
 
 #define XFS_BUF_STALE(bp)      ((bp)->b_flags |= XFS_B_STALE)
 #define XFS_BUF_UNSTALE(bp)    ((bp)->b_flags &= ~XFS_B_STALE)
index 9bdef9d519005c9c4fad27d9eb0d404cc09adcc4..4754f342a5d3b0cf8f9f57790fa63ed1012ee92a 100644 (file)
@@ -314,6 +314,13 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp)
                return;
        }
 
+       if (xfs_readonly_buftarg(mp->m_ddev_targp)) {
+               xfs_fs_cmn_err(CE_NOTE, mp,
+                 "Disabling barriers, underlying device is readonly");
+               mp->m_flags &= ~XFS_MOUNT_BARRIER;
+               return;
+       }
+
        error = xfs_barrier_test(mp);
        if (error) {
                xfs_fs_cmn_err(CE_NOTE, mp,
index e95e99f7168fdb78f6f7b724fbc66a5acdf35aef..f137856c3261b3ebabf84345aa492c0897d3c932 100644 (file)
@@ -217,17 +217,24 @@ xfs_qm_statvfs(
                return 0;
        dp = &dqp->q_core;
 
-       limit = dp->d_blk_softlimit ? dp->d_blk_softlimit : dp->d_blk_hardlimit;
+       limit = dp->d_blk_softlimit ?
+               be64_to_cpu(dp->d_blk_softlimit) :
+               be64_to_cpu(dp->d_blk_hardlimit);
        if (limit && statp->f_blocks > limit) {
                statp->f_blocks = limit;
-               statp->f_bfree = (statp->f_blocks > dp->d_bcount) ?
-                                       (statp->f_blocks - dp->d_bcount) : 0;
+               statp->f_bfree =
+                       (statp->f_blocks > be64_to_cpu(dp->d_bcount)) ?
+                        (statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0;
        }
-       limit = dp->d_ino_softlimit ? dp->d_ino_softlimit : dp->d_ino_hardlimit;
+
+       limit = dp->d_ino_softlimit ?
+               be64_to_cpu(dp->d_ino_softlimit) :
+               be64_to_cpu(dp->d_ino_hardlimit);
        if (limit && statp->f_files > limit) {
                statp->f_files = limit;
-               statp->f_ffree = (statp->f_files > dp->d_icount) ?
-                                       (statp->f_ffree - dp->d_icount) : 0;
+               statp->f_ffree =
+                       (statp->f_files > be64_to_cpu(dp->d_icount)) ?
+                        (statp->f_ffree - be64_to_cpu(dp->d_icount)) : 0;
        }
 
        xfs_qm_dqput(dqp);
index eef6763f3a6732084ede458d4a8b38b5e01e3fd4..d2bbcd882a69578174110f3655e4aadf190a52f4 100644 (file)
@@ -1835,40 +1835,47 @@ xfs_alloc_fix_freelist(
                                &agbp)))
                        return error;
                if (!pag->pagf_init) {
+                       ASSERT(flags & XFS_ALLOC_FLAG_TRYLOCK);
+                       ASSERT(!(flags & XFS_ALLOC_FLAG_FREEING));
                        args->agbp = NULL;
                        return 0;
                }
        } else
                agbp = NULL;
 
-       /* If this is a metadata preferred pag and we are user data
+       /*
+        * If this is a metadata preferred pag and we are user data
         * then try somewhere else if we are not being asked to
         * try harder at this point
         */
-       if (pag->pagf_metadata && args->userdata && flags) {
+       if (pag->pagf_metadata && args->userdata &&
+           (flags & XFS_ALLOC_FLAG_TRYLOCK)) {
+               ASSERT(!(flags & XFS_ALLOC_FLAG_FREEING));
                args->agbp = NULL;
                return 0;
        }
 
-       need = XFS_MIN_FREELIST_PAG(pag, mp);
-       delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0;
-       /*
-        * If it looks like there isn't a long enough extent, or enough
-        * total blocks, reject it.
-        */
-       longest = (pag->pagf_longest > delta) ?
-               (pag->pagf_longest - delta) :
-               (pag->pagf_flcount > 0 || pag->pagf_longest > 0);
-       if (args->minlen + args->alignment + args->minalignslop - 1 > longest ||
-           (!(flags & XFS_ALLOC_FLAG_FREEING) &&
-            (int)(pag->pagf_freeblks + pag->pagf_flcount -
-                  need - args->total) <
-            (int)args->minleft)) {
-               if (agbp)
-                       xfs_trans_brelse(tp, agbp);
-               args->agbp = NULL;
-               return 0;
+       if (!(flags & XFS_ALLOC_FLAG_FREEING)) {
+               need = XFS_MIN_FREELIST_PAG(pag, mp);
+               delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0;
+               /*
+                * If it looks like there isn't a long enough extent, or enough
+                * total blocks, reject it.
+                */
+               longest = (pag->pagf_longest > delta) ?
+                       (pag->pagf_longest - delta) :
+                       (pag->pagf_flcount > 0 || pag->pagf_longest > 0);
+               if ((args->minlen + args->alignment + args->minalignslop - 1) >
+                               longest ||
+                   ((int)(pag->pagf_freeblks + pag->pagf_flcount -
+                          need - args->total) < (int)args->minleft)) {
+                       if (agbp)
+                               xfs_trans_brelse(tp, agbp);
+                       args->agbp = NULL;
+                       return 0;
+               }
        }
+
        /*
         * Get the a.g. freespace buffer.
         * Can fail if we're not blocking on locks, and it's held.
@@ -1878,6 +1885,8 @@ xfs_alloc_fix_freelist(
                                &agbp)))
                        return error;
                if (agbp == NULL) {
+                       ASSERT(flags & XFS_ALLOC_FLAG_TRYLOCK);
+                       ASSERT(!(flags & XFS_ALLOC_FLAG_FREEING));
                        args->agbp = NULL;
                        return 0;
                }
@@ -1887,22 +1896,24 @@ xfs_alloc_fix_freelist(
         */
        agf = XFS_BUF_TO_AGF(agbp);
        need = XFS_MIN_FREELIST(agf, mp);
-       delta = need > be32_to_cpu(agf->agf_flcount) ?
-               (need - be32_to_cpu(agf->agf_flcount)) : 0;
        /*
         * If there isn't enough total or single-extent, reject it.
         */
-       longest = be32_to_cpu(agf->agf_longest);
-       longest = (longest > delta) ? (longest - delta) :
-               (be32_to_cpu(agf->agf_flcount) > 0 || longest > 0);
-       if (args->minlen + args->alignment + args->minalignslop - 1 > longest ||
-            (!(flags & XFS_ALLOC_FLAG_FREEING) &&
-               (int)(be32_to_cpu(agf->agf_freeblks) +
-                  be32_to_cpu(agf->agf_flcount) - need - args->total) <
-            (int)args->minleft)) {
-               xfs_trans_brelse(tp, agbp);
-               args->agbp = NULL;
-               return 0;
+       if (!(flags & XFS_ALLOC_FLAG_FREEING)) {
+               delta = need > be32_to_cpu(agf->agf_flcount) ?
+                       (need - be32_to_cpu(agf->agf_flcount)) : 0;
+               longest = be32_to_cpu(agf->agf_longest);
+               longest = (longest > delta) ? (longest - delta) :
+                       (be32_to_cpu(agf->agf_flcount) > 0 || longest > 0);
+               if ((args->minlen + args->alignment + args->minalignslop - 1) >
+                               longest ||
+                   ((int)(be32_to_cpu(agf->agf_freeblks) +
+                    be32_to_cpu(agf->agf_flcount) - need - args->total) <
+                               (int)args->minleft)) {
+                       xfs_trans_brelse(tp, agbp);
+                       args->agbp = NULL;
+                       return 0;
+               }
        }
        /*
         * Make the freelist shorter if it's too long.
@@ -1950,12 +1961,11 @@ xfs_alloc_fix_freelist(
                 * on a completely full ag.
                 */
                if (targs.agbno == NULLAGBLOCK) {
-                       if (!(flags & XFS_ALLOC_FLAG_FREEING)) {
-                               xfs_trans_brelse(tp, agflbp);
-                               args->agbp = NULL;
-                               return 0;
-                       }
-                       break;
+                       if (flags & XFS_ALLOC_FLAG_FREEING)
+                               break;
+                       xfs_trans_brelse(tp, agflbp);
+                       args->agbp = NULL;
+                       return 0;
                }
                /*
                 * Put each allocated block on the list.
@@ -2442,31 +2452,26 @@ xfs_free_extent(
        xfs_fsblock_t   bno,    /* starting block number of extent */
        xfs_extlen_t    len)    /* length of extent */
 {
-#ifdef DEBUG
-       xfs_agf_t       *agf;   /* a.g. freespace header */
-#endif
-       xfs_alloc_arg_t args;   /* allocation argument structure */
+       xfs_alloc_arg_t args;
        int             error;
 
        ASSERT(len != 0);
+       memset(&args, 0, sizeof(xfs_alloc_arg_t));
        args.tp = tp;
        args.mp = tp->t_mountp;
        args.agno = XFS_FSB_TO_AGNO(args.mp, bno);
        ASSERT(args.agno < args.mp->m_sb.sb_agcount);
        args.agbno = XFS_FSB_TO_AGBNO(args.mp, bno);
-       args.alignment = 1;
-       args.minlen = args.minleft = args.minalignslop = 0;
        down_read(&args.mp->m_peraglock);
        args.pag = &args.mp->m_perag[args.agno];
        if ((error = xfs_alloc_fix_freelist(&args, XFS_ALLOC_FLAG_FREEING)))
                goto error0;
 #ifdef DEBUG
        ASSERT(args.agbp != NULL);
-       agf = XFS_BUF_TO_AGF(args.agbp);
-       ASSERT(args.agbno + len <= be32_to_cpu(agf->agf_length));
+       ASSERT((args.agbno + len) <=
+               be32_to_cpu(XFS_BUF_TO_AGF(args.agbp)->agf_length));
 #endif
-       error = xfs_free_ag_extent(tp, args.agbp, args.agno, args.agbno,
-               len, 0);
+       error = xfs_free_ag_extent(tp, args.agbp, args.agno, args.agbno, len, 0);
 error0:
        up_read(&args.mp->m_peraglock);
        return error;
index 86c1bf0bba9ea19bc0f38cdb98adfd76769ef053..1f8ecff8553a3b205525d3998abc0968f25bd2e5 100644 (file)
@@ -334,10 +334,9 @@ xfs_itobp(
 #if !defined(__KERNEL__)
        ni = 0;
 #elif defined(DEBUG)
-       ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 :
-               (BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog);
+       ni = BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog;
 #else  /* usual case */
-       ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 : 1;
+       ni = 1;
 #endif
 
        for (i = 0; i < ni; i++) {
@@ -348,11 +347,15 @@ xfs_itobp(
                                        (i << mp->m_sb.sb_inodelog));
                di_ok = INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC &&
                            XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT));
-               if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP,
-                                XFS_RANDOM_ITOBP_INOTOBP))) {
+               if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
+                                               XFS_ERRTAG_ITOBP_INOTOBP,
+                                               XFS_RANDOM_ITOBP_INOTOBP))) {
+                       if (imap_flags & XFS_IMAP_BULKSTAT) {
+                               xfs_trans_brelse(tp, bp);
+                               return XFS_ERROR(EINVAL);
+                       }
 #ifdef DEBUG
-                       if (!(imap_flags & XFS_IMAP_BULKSTAT))
-                               cmn_err(CE_ALERT,
+                       cmn_err(CE_ALERT,
                                        "Device %s - bad inode magic/vsn "
                                        "daddr %lld #%d (magic=%x)",
                                XFS_BUFTARG_NAME(mp->m_ddev_targp),
index e730328636c31283c46cd2ce1fac1ccd18c4bf72..21ac1a67e3e03c763eb61ea9be1e2a2eb170631e 100644 (file)
@@ -1413,7 +1413,7 @@ xlog_sync(xlog_t          *log,
        ops = iclog->ic_header.h_num_logops;
        INT_SET(iclog->ic_header.h_num_logops, ARCH_CONVERT, ops);
 
-       bp          = iclog->ic_bp;
+       bp = iclog->ic_bp;
        ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == (unsigned long)1);
        XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2);
        XFS_BUF_SET_ADDR(bp, BLOCK_LSN(INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT)));
@@ -1430,15 +1430,14 @@ xlog_sync(xlog_t                *log,
        }
        XFS_BUF_SET_PTR(bp, (xfs_caddr_t) &(iclog->ic_header), count);
        XFS_BUF_SET_FSPRIVATE(bp, iclog);       /* save for later */
+       XFS_BUF_ZEROFLAGS(bp);
        XFS_BUF_BUSY(bp);
        XFS_BUF_ASYNC(bp);
        /*
         * Do an ordered write for the log block.
-        *
-        * It may not be needed to flush the first split block in the log wrap
-        * case, but do it anyways to be safe -AK
+        * Its unnecessary to flush the first split block in the log wrap case.
         */
-       if (log->l_mp->m_flags & XFS_MOUNT_BARRIER)
+       if (!split && (log->l_mp->m_flags & XFS_MOUNT_BARRIER))
                XFS_BUF_ORDERED(bp);
 
        ASSERT(XFS_BUF_ADDR(bp) <= log->l_logBBsize-1);
@@ -1460,7 +1459,7 @@ xlog_sync(xlog_t          *log,
                return error;
        }
        if (split) {
-               bp              = iclog->ic_log->l_xbuf;
+               bp = iclog->ic_log->l_xbuf;
                ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) ==
                                                        (unsigned long)1);
                XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2);
@@ -1468,6 +1467,7 @@ xlog_sync(xlog_t          *log,
                XFS_BUF_SET_PTR(bp, (xfs_caddr_t)((__psint_t)&(iclog->ic_header)+
                                            (__psint_t)count), split);
                XFS_BUF_SET_FSPRIVATE(bp, iclog);
+               XFS_BUF_ZEROFLAGS(bp);
                XFS_BUF_BUSY(bp);
                XFS_BUF_ASYNC(bp);
                if (log->l_mp->m_flags & XFS_MOUNT_BARRIER)
index 6c96391f3f1aad091982840e85e13d107757f461..b427d220a1697f2b64099b9d6c1a5f85ef37c0b5 100644 (file)
@@ -515,7 +515,7 @@ xfs_mount(
        if (error)
                goto error2;
 
-       if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY))
+       if (mp->m_flags & XFS_MOUNT_BARRIER)
                xfs_mountfs_check_barriers(mp);
 
        error = XFS_IOINIT(vfsp, args, flags);
index 8ff73d487222596ecca2641587fca2790a56809c..7135ad7e335e56044c46fbca91c4069f11318de7 100644 (file)
@@ -91,7 +91,6 @@
 #define NR_IRQS                        NR_IOP331_IRQS
 
 
-#if defined(CONFIG_ARCH_IQ80331)
 /*
  * Interrupts available on the IQ80331 board
  */
 #define        IRQ_IQ80331_INTC        IRQ_IOP331_XINT2
 #define        IRQ_IQ80331_INTD        IRQ_IOP331_XINT3
 
-#elif defined(CONFIG_MACH_IQ80332)
 /*
  * Interrupts available on the IQ80332 board
  */
 #define        IRQ_IQ80332_INTC        IRQ_IOP331_XINT2
 #define        IRQ_IQ80332_INTD        IRQ_IOP331_XINT3
 
-#endif
-
 #endif // _IOP331_IRQ_H_
index 3c4eb9fbe48ac58aae335666168b0a6dc0454ad6..f83003f5287b04dbd63b3998ea8e98beae0b7286 100644 (file)
@@ -48,8 +48,6 @@ struct clk_functions {
 };
 
 extern unsigned int mpurate;
-extern struct list_head clocks;
-extern spinlock_t clockfw_lock;
 
 extern int clk_init(struct clk_functions * custom_clocks);
 extern int clk_register(struct clk *clk);
index 0730a20f6db8100918887179f7924b37bc5fecac..8774d06689daa3eb53cdbdb2727bc8827b5e09bf 100644 (file)
@@ -45,6 +45,7 @@ typedef u8 kprobe_opcode_t;
 #define JPROBE_ENTRY(pentry)   (kprobe_opcode_t *)pentry
 #define ARCH_SUPPORTS_KRETPROBES
 #define  ARCH_INACTIVE_KPROBE_COUNT 0
+#define flush_insn_slot(p)     do { } while (0)
 
 void arch_remove_kprobe(struct kprobe *p);
 void kretprobe_trampoline(void);
index 2418a787c4055fb3fb2cd79a43b2e87187b1b162..9389049101157360555125760c2c4c268d9426ff 100644 (file)
@@ -125,5 +125,6 @@ static inline void jprobe_return(void)
 }
 extern void invalidate_stacked_regs(void);
 extern void flush_register_stack(void);
+extern void flush_insn_slot(struct kprobe *p);
 
 #endif                         /* _ASM_KPROBES_H */
index 894bc4d89dc02b718ba01f8c2e1a6a772fc9ae18..6a33a07b3f1dfc608a5995a871896dac5c00b4ef 100644 (file)
@@ -56,6 +56,11 @@ extern void efi_memmap_init(unsigned long *, unsigned long *);
   extern struct page *vmem_map;
   extern int find_largest_hole (u64 start, u64 end, void *arg);
   extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
+  extern int vmemmap_find_next_valid_pfn(int, int);
+#else
+static inline int vmemmap_find_next_valid_pfn(int node, int i)
+{
+       return i + 1;
+}
 #endif
-
 #endif /* meminit_h */
index 37e52a2836b03e78a7b057a5b1d08a97684f0804..20a8d618c8454776b441245317c21d7e19444a87 100644 (file)
@@ -1433,7 +1433,12 @@ typedef union  pal_version_u {
 } pal_version_u_t;
 
 
-/* Return PAL version information */
+/*
+ * Return PAL version information.  While the documentation states that
+ * PAL_VERSION can be called in either physical or virtual mode, some
+ * implementations only allow physical calls.  We don't call it very often,
+ * so the overhead isn't worth eliminating.
+ */
 static inline s64
 ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
 {
index 8406f1ef4cafa39238ff5f00ecf923ed2bf38f87..b72af597878dc21218f9242ad4c5faf42b1c244f 100644 (file)
@@ -1124,8 +1124,8 @@ xpc_notify_IRQ_send_local(struct xpc_channel *ch, u8 ipi_flag,
 #define XPC_GET_IPI_FLAGS(_amo, _c)    ((u8) (((_amo) >> ((_c) * 8)) & 0xff))
 #define XPC_SET_IPI_FLAGS(_amo, _c, _f)        (_amo) |= ((u64) (_f) << ((_c) * 8))
 
-#define        XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(_amo) ((_amo) & 0x0f0f0f0f0f0f0f0f)
-#define XPC_ANY_MSG_IPI_FLAGS_SET(_amo)       ((_amo) & 0x1010101010101010)
+#define        XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(_amo) ((_amo) & __IA64_UL_CONST(0x0f0f0f0f0f0f0f0f))
+#define XPC_ANY_MSG_IPI_FLAGS_SET(_amo)       ((_amo) & __IA64_UL_CONST(0x1010101010101010))
 
 
 static inline void
index fc9677bc87ee8f1e1a0b4d9d501da8ea798a6482..384fbf7f2a0fe9de8a61f91384a1c6288fd1d15b 100644 (file)
@@ -24,7 +24,7 @@
  * 0xa000000000000000+2*PERCPU_PAGE_SIZE
  * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
  */
-#define KERNEL_START            (GATE_ADDR+0x100000000)
+#define KERNEL_START            (GATE_ADDR+__IA64_UL_CONST(0x100000000))
 #define PERCPU_ADDR            (-PERCPU_PAGE_SIZE)
 
 #ifndef __ASSEMBLY__
index 58d4b6f8d8270e7d39b8962d3688ffd602218267..8cf5c37c3817c55af33ec1f5b5a24ebdf2a77f06 100644 (file)
@@ -30,8 +30,12 @@ static inline void pmac_backlight_key_down(void)
        pmac_backlight_key(1);
 }
 
+extern void pmac_backlight_set_legacy_brightness_pmu(int brightness);
 extern int pmac_backlight_set_legacy_brightness(int brightness);
 extern int pmac_backlight_get_legacy_brightness(void);
 
+extern void pmac_backlight_enable(void);
+extern void pmac_backlight_disable(void);
+
 #endif /* __KERNEL__ */
 #endif
index 8f7fd5cfec34f4c9fa0a39843ae443825f277fda..11cbdf81fd2e8f5113f1359660ce1f16eb1add91 100644 (file)
@@ -32,6 +32,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
+#include <linux/cpumask.h>
 
 #ifdef CONFIG_KEXEC
 
@@ -109,7 +110,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
 
 #define MAX_NOTE_BYTES 1024
 
-#ifdef __powerpc64__
 extern void kexec_smp_wait(void);      /* get and clear naca physid, wait for
                                          master to copy new code to 0 */
 extern int crashing_cpu;
@@ -119,7 +119,6 @@ static inline int kexec_sr_activated(int cpu)
 {
        return cpu_isset(cpu,cpus_in_sr);
 }
-#endif /* __powerpc64 __ */
 
 struct kimage;
 struct pt_regs;
index 2d0af52c823dde7c480bdd92fdc9e1a005482d0c..34e1f89a5fa02eda188e2654e47dda3555066686 100644 (file)
@@ -51,6 +51,7 @@ typedef unsigned int kprobe_opcode_t;
 
 #define ARCH_SUPPORTS_KRETPROBES
 #define  ARCH_INACTIVE_KPROBE_COUNT 1
+#define flush_insn_slot(p)     do { } while (0)
 
 void kretprobe_trampoline(void);
 extern void arch_remove_kprobe(struct kprobe *p);
index a33c6acffa61f5c8bad8fbb007b1fc0dd0590563..82a27e9a041ff292eba8e103b4ebf7aca1ca27bf 100644 (file)
@@ -170,6 +170,7 @@ extern int rtas_get_sensor(int sensor, int index, int *state);
 extern int rtas_get_power_level(int powerdomain, int *level);
 extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
 extern int rtas_set_indicator(int indicator, int index, int new_value);
+extern int rtas_set_indicator_fast(int indicator, int index, int new_value);
 extern void rtas_progress(char *s, unsigned short hex);
 extern void rtas_initialize(void);
 
index 0ae5084c427b3f4d2a9dab4cde24d6a57e095e8f..d03a21c97abbda83d56ba4264cd9e4921d659158 100644 (file)
@@ -168,7 +168,7 @@ struct sigstack {
  * statically allocated data.. which is NOT GOOD.
  *
  */
-#define SA_STATIC_ALLOC                0x80
+#define SA_STATIC_ALLOC                0x8000
 #endif
 
 #include <asm-generic/signal.h>
index 15065af566c24924d22a5600b6de5647f2275bb4..c9f5c34d318c92c0bf4f3f8d8d5f329526b44af3 100644 (file)
@@ -13,6 +13,7 @@ typedef u32 kprobe_opcode_t;
 #define JPROBE_ENTRY(pentry)   (kprobe_opcode_t *)pentry
 #define arch_remove_kprobe(p)  do {} while (0)
 #define  ARCH_INACTIVE_KPROBE_COUNT 0
+#define flush_insn_slot(p)     do { } while (0)
 
 /* Architecture specific copy of original instruction*/
 struct arch_specific_insn {
index 03f5bc9b6becdcbfbe8fabd2be36d0cc2163c97f..1ba19eb34ce32120b7a71366ba9e7a401597c91b 100644 (file)
@@ -339,7 +339,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)
        "       .section        .sun4v_2insn_patch, \"ax\"\n"
        "       .word           661b\n"
        "       andn            %0, %4, %0\n"
-       "       or              %0, %3, %0\n"
+       "       or              %0, %5, %0\n"
        "       .previous\n"
        : "=r" (val)
        : "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U),
index 5015bb8d6c3250a03720a50faefe485de13fc9ae..89d42431efb58e0cba76b903623c678cdfaf1e67 100644 (file)
@@ -34,7 +34,7 @@
 #define _FP_MUL_MEAT_D(R,X,Y)                                  \
   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
 #define _FP_MUL_MEAT_Q(R,X,Y)                                  \
-  _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
 #define _FP_DIV_MEAT_S(R,X,Y)  _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
 #define _FP_DIV_MEAT_D(R,X,Y)  _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
index fbfb50136edbbe092c335b70a567d3cbe5f0814f..4e3919524240b66b1d26b02a9df1bde18d0ca346 100644 (file)
@@ -60,9 +60,4 @@ static inline int calgary_iommu_init(void) { return 1; }
 static inline void detect_calgary(void) { return; }
 #endif
 
-static inline unsigned int bus_to_phb(unsigned char busno)
-{
-       return ((busno % 15 == 0) ? 0 : busno / 2 + 1);
-}
-
 #endif /* _ASM_X86_64_CALGARY_H */
index d36febd9bb183d10c6625e26a79657fa0ae6ec1d..cf5317898fb0fdc50301ad42123623a448f79262 100644 (file)
@@ -47,6 +47,7 @@ typedef u8 kprobe_opcode_t;
 
 void kretprobe_trampoline(void);
 extern void arch_remove_kprobe(struct kprobe *p);
+#define flush_insn_slot(p)     do { } while (0)
 
 /* Architecture specific copy of original instruction*/
 struct arch_specific_insn {
index f7bf875aae4050d322c5ed15893be6a1537f76ba..10f346165cabe294ecc52412ac09e8290ae8ddb7 100644 (file)
@@ -19,7 +19,7 @@
 #define EXCEPTION_STACK_ORDER 0
 #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
 
-#define DEBUG_STACK_ORDER EXCEPTION_STACK_ORDER
+#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
 #define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
 
 #define IRQSTACK_ORDER 2
index 5f9a0180582187b1b23196955b66dda63951b214..ba94ab3d2673572d6c6eb07a3bd1bb1a840174ef 100644 (file)
@@ -42,6 +42,8 @@ extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
 extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);
 extern void swiotlb_init(void);
 
+extern int swiotlb_force;
+
 #ifdef CONFIG_SWIOTLB
 extern int swiotlb;
 #else
index b27d7debc5a1df971dd5778f4a9bfae3237d8376..64f9f9e56ac5c6d0d5b572e1cffd99cb9b8d917e 100644 (file)
@@ -327,21 +327,31 @@ extern void __audit_getname(const char *name);
 extern void audit_putname(const char *name);
 extern void __audit_inode(const char *name, const struct inode *inode);
 extern void __audit_inode_child(const char *dname, const struct inode *inode,
-                               unsigned long pino);
+                               const struct inode *parent);
+extern void __audit_inode_update(const struct inode *inode);
+static inline int audit_dummy_context(void)
+{
+       void *p = current->audit_context;
+       return !p || *(int *)p;
+}
 static inline void audit_getname(const char *name)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                __audit_getname(name);
 }
 static inline void audit_inode(const char *name, const struct inode *inode) {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                __audit_inode(name, inode);
 }
 static inline void audit_inode_child(const char *dname, 
-                                    const struct inode *inode, 
-                                    unsigned long pino) {
-       if (unlikely(current->audit_context))
-               __audit_inode_child(dname, inode, pino);
+                                    const struct inode *inode,
+                                    const struct inode *parent) {
+       if (unlikely(!audit_dummy_context()))
+               __audit_inode_child(dname, inode, parent);
+}
+static inline void audit_inode_update(const struct inode *inode) {
+       if (unlikely(!audit_dummy_context()))
+               __audit_inode_update(inode);
 }
 
                                /* Private API (for audit.c only) */
@@ -365,57 +375,61 @@ extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
 
 static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                return __audit_ipc_obj(ipcp);
        return 0;
 }
 static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                return __audit_ipc_set_perm(qbytes, uid, gid, mode);
        return 0;
 }
 static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                return __audit_mq_open(oflag, mode, u_attr);
        return 0;
 }
 static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);
        return 0;
 }
 static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);
        return 0;
 }
 static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                return __audit_mq_notify(mqdes, u_notification);
        return 0;
 }
 static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
 {
-       if (unlikely(current->audit_context))
+       if (unlikely(!audit_dummy_context()))
                return __audit_mq_getsetattr(mqdes, mqstat);
        return 0;
 }
+extern int audit_n_rules;
 #else
 #define audit_alloc(t) ({ 0; })
 #define audit_free(t) do { ; } while (0)
 #define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
 #define audit_syscall_exit(f,r) do { ; } while (0)
+#define audit_dummy_context() 1
 #define audit_getname(n) do { ; } while (0)
 #define audit_putname(n) do { ; } while (0)
 #define __audit_inode(n,i) do { ; } while (0)
 #define __audit_inode_child(d,i,p) do { ; } while (0)
+#define __audit_inode_update(i) do { ; } while (0)
 #define audit_inode(n,i) do { ; } while (0)
 #define audit_inode_child(d,i,p) do { ; } while (0)
+#define audit_inode_update(i) do { ; } while (0)
 #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
 #define audit_get_loginuid(c) ({ -1; })
 #define audit_ipc_obj(i) ({ 0; })
@@ -430,6 +444,7 @@ static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
 #define audit_mq_timedreceive(d,l,p,t) ({ 0; })
 #define audit_mq_notify(d,n) ({ 0; })
 #define audit_mq_getsetattr(d,s) ({ 0; })
+#define audit_n_rules 0
 #endif
 
 #ifdef CONFIG_AUDIT
index dbb7769009be05a49af5f73ff7ec59afd09cbd24..1c86d65bc4b9aaf8aa9955bb283fd0670a05bf39 100644 (file)
@@ -57,7 +57,8 @@ struct proc_event {
                PROC_EVENT_EXIT = 0x80000000
        } what;
        __u32 cpu;
-       struct timespec timestamp;
+       __u64 __attribute__((aligned(8))) timestamp_ns;
+               /* Number of nano seconds since system boot */
        union { /* must be last field of proc_event struct */
                struct {
                        __u32 err;
index 35e137636b0b4c6dc44cdfc04ef53ec787ffadfd..4ea39fee99c7938e4bd9dfec951773b025ada1a7 100644 (file)
@@ -172,9 +172,6 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
                                   unsigned int relation);
 
 
-/* pass an event to the cpufreq governor */
-int cpufreq_governor(unsigned int cpu, unsigned int event);
-
 int cpufreq_register_governor(struct cpufreq_governor *governor);
 void cpufreq_unregister_governor(struct cpufreq_governor *governor);
 
index 6a7047851e48b8174ffa0360e95e056a5d9921fa..88dafa246d87a968b61163ad500dd7da2d5bb812 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __LINUX_DEBUG_LOCKING_H
 #define __LINUX_DEBUG_LOCKING_H
 
+struct task_struct;
+
 extern int debug_locks;
 extern int debug_locks_silent;
 
index 7e8b6011b8f3e0c5b7b0ff6ab459a4aa158ab64b..11487b6e7127ff68ec12cada74c672af72efcffb 100644 (file)
@@ -55,7 +55,7 @@ static inline void delayacct_tsk_init(struct task_struct *tsk)
 {
        /* reinitialize in case parent's non-null pointer was dup'ed*/
        tsk->delays = NULL;
-       if (unlikely(delayacct_on))
+       if (delayacct_on)
                __delayacct_tsk_init(tsk);
 }
 
@@ -80,9 +80,7 @@ static inline void delayacct_blkio_end(void)
 static inline int delayacct_add_tsk(struct taskstats *d,
                                        struct task_struct *tsk)
 {
-       if (likely(!delayacct_on))
-               return -EINVAL;
-       if (!tsk->delays)
+       if (!delayacct_on || !tsk->delays)
                return 0;
        return __delayacct_add_tsk(d, tsk);
 }
index 5607e6457a65b8fc9df2bcd081532a833d41599c..9f9cce7bd86dd0f5e4991040cf94dee4401c8f95 100644 (file)
@@ -492,6 +492,15 @@ static inline struct ext3_inode_info *EXT3_I(struct inode *inode)
 {
        return container_of(inode, struct ext3_inode_info, vfs_inode);
 }
+
+static inline int ext3_valid_inum(struct super_block *sb, unsigned long ino)
+{
+       return ino == EXT3_ROOT_INO ||
+               ino == EXT3_JOURNAL_INO ||
+               ino == EXT3_RESIZE_INO ||
+               (ino >= EXT3_FIRST_INO(sb) &&
+                ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count));
+}
 #else
 /* Assume that user mode programs are passing in an ext3fs superblock, not
  * a kernel struct super_block.  This will allow us to call the feature-test
index 405f44e44e5d503c0785713ce0e715caee4fa91e..2f335e966011510df9944119d33daae9850580aa 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _LINUX_FB_H
 #define _LINUX_FB_H
 
-#include <linux/backlight.h>
 #include <asm/types.h>
 
 /* Definitions of frame buffers                                                */
@@ -381,6 +380,7 @@ struct fb_cursor {
 #include <linux/workqueue.h>
 #include <linux/notifier.h>
 #include <linux/list.h>
+#include <linux/backlight.h>
 #include <asm/io.h>
 
 struct vm_area_struct;
@@ -524,7 +524,7 @@ struct fb_event {
 
 extern int fb_register_client(struct notifier_block *nb);
 extern int fb_unregister_client(struct notifier_block *nb);
-
+extern int fb_notifier_call_chain(unsigned long val, void *v);
 /*
  * Pixmap structure definition
  *
index cc5dec70c32c216f72d238c600ae64f577407e86..d4f219ffaa5dbffa831e0eefcfb27cc7949b6f83 100644 (file)
@@ -67,7 +67,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
        if (source) {
                inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
        }
-       audit_inode_child(new_name, source, new_dir->i_ino);
+       audit_inode_child(new_name, source, new_dir);
 }
 
 /*
@@ -98,7 +98,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
        inode_dir_notify(inode, DN_CREATE);
        inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
                                  dentry->d_inode);
-       audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
+       audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
 }
 
 /*
@@ -109,7 +109,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
        inode_dir_notify(inode, DN_CREATE);
        inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 
                                  dentry->d_name.name, dentry->d_inode);
-       audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
+       audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
 }
 
 /*
index 34c3a215f2cd9affe3583451063a09887ee0669c..d097b5b72bc653b0a3a35c17d22c66edc6839cb3 100644 (file)
@@ -96,7 +96,8 @@ struct robust_list_head {
 long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
              u32 __user *uaddr2, u32 val2, u32 val3);
 
-extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr);
+extern int
+handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi);
 
 #ifdef CONFIG_FUTEX
 extern void exit_robust_list(struct task_struct *curr);
index dc7abef1096545c167e9ee7122ddc32b5712413b..99620451d958730a7754cf80acf572a770d75e40 100644 (file)
@@ -571,6 +571,7 @@ typedef struct ide_drive_s {
        u8      waiting_for_dma;        /* dma currently in progress */
        u8      unmask;                 /* okay to unmask other irqs */
        u8      bswap;                  /* byte swap data */
+       u8      noflush;                /* don't attempt flushes */
        u8      dsc_overlap;            /* DSC overlap */
        u8      nice1;                  /* give potential excess bandwidth */
 
index 383627ad328f383bfe07f78ddc77e09e37066d95..ab2740832742e85c6a6870384aa47bbe70c8a201 100644 (file)
@@ -155,6 +155,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
 {
        struct net_device_stats *stats;
 
+       if (skb_bond_should_drop(skb)) {
+               dev_kfree_skb_any(skb);
+               return NET_RX_DROP;
+       }
+
        skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
        if (skb->dev == NULL) {
                dev_kfree_skb_any(skb);
index 56f1e0e1e59868a3372069a7a4863c1356aeebe6..b3253ab72ff7da2914e225550d1a0c3db42b6d8d 100644 (file)
@@ -893,7 +893,6 @@ struct input_dev {
 
        int (*open)(struct input_dev *dev);
        void (*close)(struct input_dev *dev);
-       int (*accept)(struct input_dev *dev, struct file *file);
        int (*flush)(struct input_dev *dev, struct file *file);
        int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
        int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect);
@@ -961,6 +960,26 @@ struct input_dev {
 
 struct input_handle;
 
+/**
+ * struct input_handler - implements one of interfaces for input devices
+ * @private: driver-specific data
+ * @event: event handler
+ * @connect: called when attaching a handler to an input device
+ * @disconnect: disconnects a handler from input device
+ * @start: starts handler for given handle. This function is called by
+ *     input core right after connect() method and also when a process
+ *     that "grabbed" a device releases it
+ * @fops: file operations this driver implements
+ * @minor: beginning of range of 32 minors for devices this driver
+ *     can provide
+ * @name: name of the handler, to be shown in /proc/bus/input/handlers
+ * @id_table: pointer to a table of input_device_ids this driver can
+ *     handle
+ * @blacklist: prointer to a table of input_device_ids this driver should
+ *     ignore even if they match @id_table
+ * @h_list: list of input handles associated with the handler
+ * @node: for placing the driver onto input_handler_list
+ */
 struct input_handler {
 
        void *private;
@@ -968,6 +987,7 @@ struct input_handler {
        void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
        struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id);
        void (*disconnect)(struct input_handle *handle);
+       void (*start)(struct input_handle *handle);
 
        const struct file_operations *fops;
        int minor;
@@ -1030,10 +1050,10 @@ void input_release_device(struct input_handle *);
 int input_open_device(struct input_handle *);
 void input_close_device(struct input_handle *);
 
-int input_accept_process(struct input_handle *handle, struct file *file);
 int input_flush_device(struct input_handle* handle, struct file* file);
 
 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
+void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);
 
 static inline void input_report_key(struct input_dev *dev, unsigned int code, int value)
 {
index b48eae32dc61c05eb5afd83c1c6c23ab4d10b85f..fbf6d901e9c2643a76d18e485864fcfbc8bfc85c 100644 (file)
@@ -47,8 +47,8 @@
 #define IRQ_WAITING            0x00200000      /* IRQ not yet seen - for autodetection */
 #define IRQ_LEVEL              0x00400000      /* IRQ level triggered */
 #define IRQ_MASKED             0x00800000      /* IRQ masked - shouldn't be seen again */
+#define IRQ_PER_CPU            0x01000000      /* IRQ is per CPU */
 #ifdef CONFIG_IRQ_PER_CPU
-# define IRQ_PER_CPU           0x01000000      /* IRQ is per CPU */
 # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
 #else
 # define CHECK_IRQ_PER_CPU(var) 0
@@ -58,6 +58,7 @@
 #define IRQ_NOREQUEST          0x04000000      /* IRQ cannot be requested */
 #define IRQ_NOAUTOEN           0x08000000      /* IRQ will not be enabled on request irq */
 #define IRQ_DELAYED_DISABLE    0x10000000      /* IRQ disable (masking) happens delayed. */
+#define IRQ_WAKEUP             0x20000000      /* IRQ triggers system wakeup */
 
 struct proc_dir_entry;
 
@@ -124,6 +125,7 @@ struct irq_chip {
  * @action:            the irq action chain
  * @status:            status information
  * @depth:             disable-depth, for nested irq_disable() calls
+ * @wake_depth:                enable depth, for multiple set_irq_wake() callers
  * @irq_count:         stats field to detect stalled irqs
  * @irqs_unhandled:    stats field for spurious unhandled interrupts
  * @lock:              locking for SMP
@@ -147,6 +149,7 @@ struct irq_desc {
        unsigned int            status;         /* IRQ status */
 
        unsigned int            depth;          /* nested irq disables */
+       unsigned int            wake_depth;     /* nested wake enables */
        unsigned int            irq_count;      /* For detecting broken IRQs */
        unsigned int            irqs_unhandled;
        spinlock_t              lock;
index 043376920f51af0aaa317459a8172b00c814dab0..329ebcffa106801f012472e281840c4756382f9e 100644 (file)
@@ -47,8 +47,8 @@
  *   - (NOM / DEN) fits in (32 - LSH) bits.
  *   - (NOM % DEN) fits in (32 - LSH) bits.
  */
-#define SH_DIV(NOM,DEN,LSH) (   ((NOM / DEN) << LSH)                    \
-                             + (((NOM % DEN) << LSH) + DEN / 2) / DEN)
+#define SH_DIV(NOM,DEN,LSH) (   (((NOM) / (DEN)) << (LSH))              \
+                             + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
 
 /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
 #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
index 181c69cad4e3a45dca58bd6c50c2ae3d3e95f5b1..851aa1bcfc1a25c65db7fd2829e1844fb6086e33 100644 (file)
@@ -210,6 +210,7 @@ extern enum system_states {
 extern void dump_stack(void);
 
 #ifdef DEBUG
+/* If you are writing a driver, please use dev_dbg instead */
 #define pr_debug(fmt,arg...) \
        printk(KERN_DEBUG fmt,##arg)
 #else
index 0503b2ed8bae8ae4e2fb89f01df052e5cebe3497..2d229327959ed9809042af03c8fdb917913e000e 100644 (file)
@@ -46,8 +46,6 @@ enum kobject_action {
        KOBJ_UMOUNT     = (__force kobject_action_t) 0x05,      /* umount event for block devices (broken) */
        KOBJ_OFFLINE    = (__force kobject_action_t) 0x06,      /* device offline */
        KOBJ_ONLINE     = (__force kobject_action_t) 0x07,      /* device online */
-       KOBJ_UNDOCK     = (__force kobject_action_t) 0x08,      /* undocking */
-       KOBJ_DOCK       = (__force kobject_action_t) 0x09,      /* dock */
 };
 
 struct kobject {
index 6cc497a2b6da37b289ba2dcfc96ec12a2863fc8d..66c3100c2b94c19dc2eb581e000ce5fce24deb75 100644 (file)
@@ -265,12 +265,14 @@ enum {
 
        /* ata_eh_info->flags */
        ATA_EHI_HOTPLUGGED      = (1 << 0),  /* could have been hotplugged */
-       ATA_EHI_RESUME_LINK     = (1 << 1),  /* need to resume link */
+       ATA_EHI_RESUME_LINK     = (1 << 1),  /* resume link (reset modifier) */
        ATA_EHI_NO_AUTOPSY      = (1 << 2),  /* no autopsy */
        ATA_EHI_QUIET           = (1 << 3),  /* be quiet */
 
        ATA_EHI_DID_RESET       = (1 << 16), /* already reset this port */
 
+       ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,
+
        /* max repeat if error condition is still set after ->error_handler */
        ATA_EH_MAX_REPEAT       = 5,
 
index aa4fe905bb4dada8f1ce710e44333923b292300b..0d92c468d55aeeb1f4b83e5847ef3bc5c529b2b7 100644 (file)
@@ -123,7 +123,6 @@ struct nlm_block {
        unsigned int            b_id;           /* block id */
        unsigned char           b_queued;       /* re-queued */
        unsigned char           b_granted;      /* VFS granted lock */
-       unsigned char           b_done;         /* callback complete */
        struct nlm_file *       b_file;         /* file in question */
 };
 
index 990957e0929f2319f217115df75977b3467ce5a4..f0b135cd86da1e54789bce46eb7bb8f6487edcaa 100644 (file)
@@ -336,6 +336,7 @@ static inline void init_page_count(struct page *page)
 }
 
 void put_page(struct page *page);
+void put_pages_list(struct list_head *pages);
 
 void split_page(struct page *page, unsigned int order);
 
index 75f02d8c6ed376b192858faff4de312c3b71e2ab..50a4719512ede141d2fbf045031ff2096227f98b 100644 (file)
@@ -320,6 +320,9 @@ struct net_device
 #define NETIF_F_TSO_ECN                (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
 #define NETIF_F_TSO6           (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
 
+       /* List of features with software fallbacks. */
+#define NETIF_F_GSO_SOFTWARE   (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
+
 #define NETIF_F_GEN_CSUM       (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
 #define NETIF_F_ALL_CSUM       (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
 
@@ -1012,6 +1015,30 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
                unlikely(skb->ip_summed != CHECKSUM_HW));
 }
 
+/* On bonding slaves other than the currently active slave, suppress
+ * duplicates except for 802.3ad ETH_P_SLOW and alb non-mcast/bcast.
+ */
+static inline int skb_bond_should_drop(struct sk_buff *skb)
+{
+       struct net_device *dev = skb->dev;
+       struct net_device *master = dev->master;
+
+       if (master &&
+           (dev->priv_flags & IFF_SLAVE_INACTIVE)) {
+               if (master->priv_flags & IFF_MASTER_ALB) {
+                       if (skb->pkt_type != PACKET_BROADCAST &&
+                           skb->pkt_type != PACKET_MULTICAST)
+                               return 0;
+               }
+               if (master->priv_flags & IFF_MASTER_8023AD &&
+                   skb->protocol == __constant_htons(ETH_P_SLOW))
+                       return 0;
+
+               return 1;
+       }
+       return 0;
+}
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_DEV_H */
index 87764022cc670050ec0573d2a454f16fabfa61c3..10c13dc4665b7add3c2e5a78143cc2c4a4257619 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <linux/netfilter.h>
 #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
-#include <asm/atomic.h>
 #include <linux/if_ether.h>
 #endif
 
@@ -79,6 +78,8 @@ struct bridge_skb_cb {
                __u32 ipv4;
        } daddr;
 };
+
+extern int brnf_deferred_hooks;
 #endif /* CONFIG_BRIDGE_NETFILTER */
 
 #endif /* __KERNEL__ */
index 55ea853d57bcbce9c6acfff30c132001954314e5..247434553ae881794a4188c05e6ea69c6a625bb0 100644 (file)
@@ -476,10 +476,9 @@ static inline int nfs_wb_page(struct inode *inode, struct page* page)
 }
 
 /*
- * Allocate and free nfs_write_data structures
+ * Allocate nfs_write_data structures
  */
 extern struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount);
-extern void nfs_writedata_free(struct nfs_write_data *p);
 
 /*
  * linux/fs/nfs/read.c
@@ -491,10 +490,9 @@ extern int  nfs_readpage_result(struct rpc_task *, struct nfs_read_data *);
 extern void nfs_readdata_release(void *data);
 
 /*
- * Allocate and free nfs_read_data structures
+ * Allocate nfs_read_data structures
  */
 extern struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount);
-extern void nfs_readdata_free(struct nfs_read_data *p);
 
 /*
  * linux/fs/nfs3proc.c
index c09396d2c77b62d507fd0574cdce7d18fa295b41..4eae06b08cf2256bcd7b640aef3b8ce1d99fb6fe 100644 (file)
 #define PCI_DEVICE_ID_INTEL_82820_UP_HB        0x2501
 #define PCI_DEVICE_ID_INTEL_82850_HB   0x2530
 #define PCI_DEVICE_ID_INTEL_82860_HB   0x2531
+#define PCI_DEVICE_ID_INTEL_E7501_MCH  0x254c
 #define PCI_DEVICE_ID_INTEL_82845G_HB  0x2560
 #define PCI_DEVICE_ID_INTEL_82845G_IG  0x2562
 #define PCI_DEVICE_ID_INTEL_82865_HB   0x2570
index 2ed807ddc08c1cb1e1919a09c8a16e32a3bc1058..783177387ac61323fdfff6db8c3b717665d62c7c 100644 (file)
@@ -231,7 +231,6 @@ extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
 extern unsigned int pmu_power_flags;
 
 /* Backlight */
-extern int disable_kernel_backlight;
-extern void pmu_backlight_init(struct device_node*);
+extern void pmu_backlight_init(void);
 
 #endif /* __KERNEL__ */
index 6afa72e080cb7665bc4be600db1b4fe382460ccd..6674fc1e51bf3dfe0677633e489231a91c271dac 100644 (file)
@@ -1557,6 +1557,14 @@ static inline void freeze(struct task_struct *p)
        p->flags |= PF_FREEZE;
 }
 
+/*
+ * Sometimes we may need to cancel the previous 'freeze' request
+ */
+static inline void do_not_freeze(struct task_struct *p)
+{
+       p->flags &= ~PF_FREEZE;
+}
+
 /*
  * Wake up a frozen process
  */
index f75303831d09b1c8645530c9c2f90c27385afe91..6bc2aad494ffcbca799907f15c005991d5ad2bb7 100644 (file)
@@ -1109,6 +1109,16 @@ struct swap_info_struct;
  *     @name contains the name of the security module being unstacked.
  *     @ops contains a pointer to the struct security_operations of the module to unstack.
  * 
+ * @secid_to_secctx:
+ *     Convert secid to security context.
+ *     @secid contains the security ID.
+ *     @secdata contains the pointer that stores the converted security context.
+ *
+ * @release_secctx:
+ *     Release the security context.
+ *     @secdata contains the security context.
+ *     @seclen contains the length of the security context.
+ *
  * This is the main security structure.
  */
 struct security_operations {
@@ -1289,6 +1299,8 @@ struct security_operations {
 
        int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size);
        int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size);
+       int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen);
+       void (*release_secctx)(char *secdata, u32 seclen);
 
 #ifdef CONFIG_SECURITY_NETWORK
        int (*unix_stream_connect) (struct socket * sock,
@@ -1317,7 +1329,7 @@ struct security_operations {
        int (*socket_shutdown) (struct socket * sock, int how);
        int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
        int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
-       int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen);
+       int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid);
        int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
        void (*sk_free_security) (struct sock *sk);
        unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir);
@@ -2059,6 +2071,16 @@ static inline int security_netlink_recv(struct sk_buff * skb, int cap)
        return security_ops->netlink_recv(skb, cap);
 }
 
+static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
+{
+       return security_ops->secid_to_secctx(secid, secdata, seclen);
+}
+
+static inline void security_release_secctx(char *secdata, u32 seclen)
+{
+       return security_ops->release_secctx(secdata, seclen);
+}
+
 /* prototypes */
 extern int security_init       (void);
 extern int register_security   (struct security_operations *ops);
@@ -2725,6 +2747,14 @@ static inline void securityfs_remove(struct dentry *dentry)
 {
 }
 
+static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
+{
+       return -EOPNOTSUPP;
+}
+
+static inline void security_release_secctx(char *secdata, u32 seclen)
+{
+}
 #endif /* CONFIG_SECURITY */
 
 #ifdef CONFIG_SECURITY_NETWORK
@@ -2840,10 +2870,9 @@ static inline int security_socket_getpeersec_stream(struct socket *sock, char __
        return security_ops->socket_getpeersec_stream(sock, optval, optlen, len);
 }
 
-static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,
-                                                  u32 *seclen)
+static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
 {
-       return security_ops->socket_getpeersec_dgram(skb, secdata, seclen);
+       return security_ops->socket_getpeersec_dgram(sock, skb, secid);
 }
 
 static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
@@ -2968,8 +2997,7 @@ static inline int security_socket_getpeersec_stream(struct socket *sock, char __
        return -ENOPROTOOPT;
 }
 
-static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,
-                                                  u32 *seclen)
+static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
 {
        return -ENOPROTOOPT;
 }
index 4307e764ef0aeb675989e6dbc40fcd6d66de7e4b..755e9cddac47eebe516751a55929f4339b576c5f 100644 (file)
@@ -604,12 +604,17 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
        return list_->qlen;
 }
 
-extern struct lock_class_key skb_queue_lock_key;
-
+/*
+ * This function creates a split out lock class for each invocation;
+ * this is needed for now since a whole lot of users of the skb-queue
+ * infrastructure in drivers have different locking usage (in hardirq)
+ * than the networking core (in softirq only). In the long run either the
+ * network layer or drivers should need annotation to consolidate the
+ * main types of usage into 3 classes.
+ */
 static inline void skb_queue_head_init(struct sk_buff_head *list)
 {
        spin_lock_init(&list->lock);
-       lockdep_set_class(&list->lock, &skb_queue_lock_key);
        list->prev = list->next = (struct sk_buff *)list;
        list->qlen = 0;
 }
@@ -1034,6 +1039,21 @@ static inline int pskb_trim(struct sk_buff *skb, unsigned int len)
        return (len < skb->len) ? __pskb_trim(skb, len) : 0;
 }
 
+/**
+ *     pskb_trim_unique - remove end from a paged unique (not cloned) buffer
+ *     @skb: buffer to alter
+ *     @len: new length
+ *
+ *     This is identical to pskb_trim except that the caller knows that
+ *     the skb is not cloned so we should never get an error due to out-
+ *     of-memory.
+ */
+static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
+{
+       int err = pskb_trim(skb, len);
+       BUG_ON(err);
+}
+
 /**
  *     skb_orphan - orphan a buffer
  *     @skb: buffer to orphan
@@ -1076,7 +1096,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
  *     the headroom they think they need without accounting for the
  *     built in space. The built in space is used for optimisations.
  *
- *     %NULL is returned in there is no free memory.
+ *     %NULL is returned if there is no free memory.
  */
 static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
                                              gfp_t gfp_mask)
@@ -1096,7 +1116,7 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
  *     the headroom they think they need without accounting for the
  *     built in space. The built in space is used for optimisations.
  *
- *     %NULL is returned in there is no free memory. Although this function
+ *     %NULL is returned if there is no free memory. Although this function
  *     allocates memory it can be called from an interrupt.
  */
 static inline struct sk_buff *dev_alloc_skb(unsigned int length)
@@ -1104,6 +1124,28 @@ static inline struct sk_buff *dev_alloc_skb(unsigned int length)
        return __dev_alloc_skb(length, GFP_ATOMIC);
 }
 
+extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
+               unsigned int length, gfp_t gfp_mask);
+
+/**
+ *     netdev_alloc_skb - allocate an skbuff for rx on a specific device
+ *     @dev: network device to receive on
+ *     @length: length to allocate
+ *
+ *     Allocate a new &sk_buff and assign it a usage count of one. The
+ *     buffer has unspecified headroom built in. Users should allocate
+ *     the headroom they think they need without accounting for the
+ *     built in space. The built in space is used for optimisations.
+ *
+ *     %NULL is returned if there is no free memory. Although this function
+ *     allocates memory it can be called from an interrupt.
+ */
+static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
+               unsigned int length)
+{
+       return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
+}
+
 /**
  *     skb_cow - copy header of skb when it is required
  *     @skb: buffer to cow
index e8bbe8118de8118dc6f5fd1b7e21cacafa8afef4..840e47a4ccc5b55a59c9d6f524fe044625911dc7 100644 (file)
@@ -229,7 +229,7 @@ int                 xprt_reserve_xprt(struct rpc_task *task);
 int                    xprt_reserve_xprt_cong(struct rpc_task *task);
 int                    xprt_prepare_transmit(struct rpc_task *task);
 void                   xprt_transmit(struct rpc_task *task);
-void                   xprt_abort_transmit(struct rpc_task *task);
+void                   xprt_end_transmit(struct rpc_task *task);
 int                    xprt_adjust_timeout(struct rpc_rqst *req);
 void                   xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
 void                   xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
index c944e8f06a4a2a3ce7519f82565c1780fc359d57..d2bd0c8e015408c0152fe7b9927ec2d5deda5100 100644 (file)
@@ -103,8 +103,7 @@ enum usb_interface_condition {
  * @condition: binding state of the interface: not bound, binding
  *     (in probe()), bound to a driver, or unbinding (in disconnect())
  * @dev: driver model's view of this device
- * @usb_dev: if an interface is bound to the USB major, this will point
- *     to the sysfs representation for that device.
+ * @class_dev: driver model's class view of this device.
  *
  * USB device drivers attach to interfaces on a physical device.  Each
  * interface encapsulates a single high level function, such as feeding
@@ -144,7 +143,7 @@ struct usb_interface {
                                         * bound to */
        enum usb_interface_condition condition;         /* state of binding */
        struct device dev;              /* interface specific device info */
-       struct device *usb_dev;         /* pointer to the usb class's device, if any */
+       struct class_device *class_dev;
 };
 #define        to_usb_interface(d) container_of(d, struct usb_interface, dev)
 #define        interface_to_usbdev(intf) \
@@ -361,7 +360,7 @@ struct usb_device {
        char *serial;                   /* iSerialNumber string, if present */
 
        struct list_head filelist;
-       struct device *usbfs_dev;
+       struct class_device *class_dev;
        struct dentry *usbfs_dentry;    /* usbfs dentry entry for the device */
 
        /*
index f38f43f20faea4eefb94a1c84c71eb0e302e931a..e7fc5fed5b98b8044d940fa4a7ded769a09a0452 100644 (file)
@@ -44,7 +44,9 @@
        US_FLAG(NO_WP_DETECT,   0x00000200)                     \
                /* Don't check for write-protect */             \
        US_FLAG(MAX_SECTORS_64, 0x00000400)                     \
-               /* Sets max_sectors to 64    */
+               /* Sets max_sectors to 64    */                 \
+       US_FLAG(IGNORE_DEVICE,  0x00000800)                     \
+               /* Don't claim device */
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
index 41bc7e9603cdf690debf168fc936252e9dad798e..518c7a32175eb6314f47b1cd76e214a3987256f4 100644 (file)
 #ifndef __LINUX_VIDEODEV_H
 #define __LINUX_VIDEODEV_H
 
-#define HAVE_V4L1 1
-
 #include <linux/videodev2.h>
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+#define HAVE_V4L1 1
+
 struct video_capability
 {
        char name[32];
@@ -336,6 +337,8 @@ struct video_code
 #define VID_HARDWARE_SN9C102   38
 #define VID_HARDWARE_ARV       39
 
+#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+
 #endif /* __LINUX_VIDEODEV_H */
 
 /*
index a62673dad76e41809ff88df2c4e34773347268ed..b7146956a9293be2091787ec445d7da2f8cead1a 100644 (file)
@@ -716,7 +716,7 @@ struct v4l2_ext_control
                __s64 value64;
                void *reserved;
        };
-};
+} __attribute__ ((packed));
 
 struct v4l2_ext_controls
 {
index 1ab806c47514e5e6a468063f37fa4fcb1ce9c038..2d9b1b60798aca15f99c9fe46afe5587f1605b6e 100644 (file)
@@ -41,23 +41,23 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
 
 static inline void __count_vm_event(enum vm_event_item item)
 {
-       __get_cpu_var(vm_event_states.event[item])++;
+       __get_cpu_var(vm_event_states).event[item]++;
 }
 
 static inline void count_vm_event(enum vm_event_item item)
 {
-       get_cpu_var(vm_event_states.event[item])++;
+       get_cpu_var(vm_event_states).event[item]++;
        put_cpu();
 }
 
 static inline void __count_vm_events(enum vm_event_item item, long delta)
 {
-       __get_cpu_var(vm_event_states.event[item]) += delta;
+       __get_cpu_var(vm_event_states).event[item] += delta;
 }
 
 static inline void count_vm_events(enum vm_event_item item, long delta)
 {
-       get_cpu_var(vm_event_states.event[item]) += delta;
+       get_cpu_var(vm_event_states).event[item] += delta;
        put_cpu();
 }
 
index 62dae1a8c4412c3f363193ad8efdd898f3fd0c22..600d61d7d2ab8e190b1c8a763cd6f107efa20d7d 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/compiler.h> /* need __user */
-#ifdef CONFIG_VIDEO_V4L1
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
 #include <linux/videodev.h>
 #else
 #include <linux/videodev2.h>
@@ -341,11 +341,14 @@ extern int video_usercopy(struct inode *inode, struct file *file,
 extern struct video_device* video_devdata(struct file*);
 
 #define to_video_device(cd) container_of(cd, struct video_device, class_dev)
-static inline void
+static inline int
 video_device_create_file(struct video_device *vfd,
                         struct class_device_attribute *attr)
 {
-       class_device_create_file(&vfd->class_dev, attr);
+       int ret = class_device_create_file(&vfd->class_dev, attr);
+       if (ret < 0)
+               printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
+       return ret;
 }
 static inline void
 video_device_remove_file(struct video_device *vfd,
index 2fec827c8801456e6058c4a94ea16917559ace83..c0398f5a8cb98667d77f979ac863ed2a7822ad10 100644 (file)
@@ -54,15 +54,13 @@ struct unix_skb_parms {
        struct ucred            creds;          /* Skb credentials      */
        struct scm_fp_list      *fp;            /* Passed files         */
 #ifdef CONFIG_SECURITY_NETWORK
-       char                    *secdata;       /* Security context     */
-       u32                     seclen;         /* Security length      */
+       u32                     secid;          /* Security ID          */
 #endif
 };
 
 #define UNIXCB(skb)    (*(struct unix_skb_parms*)&((skb)->cb))
 #define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
-#define UNIXSECDATA(skb)       (&UNIXCB((skb)).secdata)
-#define UNIXSECLEN(skb)                (&UNIXCB((skb)).seclen)
+#define UNIXSID(skb)   (&UNIXCB((skb)).secid)
 
 #define unix_state_rlock(s)    spin_lock(&unix_sk(s)->lock)
 #define unix_state_runlock(s)  spin_unlock(&unix_sk(s)->lock)
index ab29dafb1a6af2711557a202e70127e882e3b18c..96b0e66406eccc9a164e0bf6881aa437343563da 100644 (file)
@@ -139,16 +139,22 @@ extern rwlock_t rt6_lock;
 /*
  *     Store a destination cache entry in a socket
  */
-static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
-                                    struct in6_addr *daddr)
+static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
+                                  struct in6_addr *daddr)
 {
        struct ipv6_pinfo *np = inet6_sk(sk);
        struct rt6_info *rt = (struct rt6_info *) dst;
 
-       write_lock(&sk->sk_dst_lock);
        sk_setup_caps(sk, dst);
        np->daddr_cache = daddr;
        np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
+}
+
+static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
+                                struct in6_addr *daddr)
+{
+       write_lock(&sk->sk_dst_lock);
+       __ip6_dst_store(sk, dst, daddr);
        write_unlock(&sk->sk_dst_lock);
 }
 
index a8fdf7970b370a8aca9f216a72fec4b7b378d60e..ece7e8a84ffd089ef1902581f5c0b690610ec6fa 100644 (file)
@@ -468,6 +468,9 @@ extern void                 ip6_flush_pending_frames(struct sock *sk);
 extern int                     ip6_dst_lookup(struct sock *sk,
                                               struct dst_entry **dst,
                                               struct flowi *fl);
+extern int                     ip6_sk_dst_lookup(struct sock *sk,
+                                                 struct dst_entry **dst,
+                                                 struct flowi *fl);
 
 /*
  *     skb processing functions
index ceae5ee85c0490178041aa9705944094e6e188cb..7f53cd1d8b1eb8b54e8e88fbd286edef6e6673b7 100644 (file)
@@ -29,7 +29,7 @@ static inline struct dma_chan *get_softnet_dma(void)
 {
        struct dma_chan *chan;
        rcu_read_lock();
-       chan = rcu_dereference(__get_cpu_var(softnet_data.net_dma));
+       chan = rcu_dereference(__get_cpu_var(softnet_data).net_dma);
        if (chan)
                dma_chan_get(chan);
        rcu_read_unlock();
diff --git a/include/net/netevent.h b/include/net/netevent.h
new file mode 100644 (file)
index 0000000..e5d2162
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _NET_EVENT_H
+#define _NET_EVENT_H
+
+/*
+ *     Generic netevent notifiers
+ *
+ *     Authors:
+ *      Tom Tucker              <tom@opengridcomputing.com>
+ *      Steve Wise              <swise@opengridcomputing.com>
+ *
+ *     Changes:
+ */
+#ifdef __KERNEL__
+
+#include <net/dst.h>
+
+struct netevent_redirect {
+       struct dst_entry *old;
+       struct dst_entry *new;
+};
+
+enum netevent_notif_type {
+       NETEVENT_NEIGH_UPDATE = 1, /* arg is struct neighbour ptr */
+       NETEVENT_PMTU_UPDATE,      /* arg is struct dst_entry ptr */
+       NETEVENT_REDIRECT,         /* arg is struct netevent_redirect ptr */
+};
+
+extern int register_netevent_notifier(struct notifier_block *nb);
+extern int unregister_netevent_notifier(struct notifier_block *nb);
+extern int call_netevent_notifiers(unsigned long val, void *v);
+
+#endif
+#endif
index 5ccdbb3d4722ab400281b3692db23f0a212a14f3..a4eb37946f2cdf1c63f22cc19341a88e6bd76cca 100644 (file)
@@ -212,7 +212,7 @@ static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p)
                 * Seems, it is the best solution to
                 * problem of too coarse exponent tabulation.
                 */
-               us_idle = (p->qavg * us_idle) >> p->Scell_log;
+               us_idle = (p->qavg * (u64)us_idle) >> p->Scell_log;
 
                if (us_idle < (p->qavg >> 1))
                        return p->qavg - us_idle;
index 02daa097cdcd0cefcf81be18e75667a910ccf1a6..5637d5e22d5ff76012daf46ba30e04546d24a5bd 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/limits.h>
 #include <linux/net.h>
+#include <linux/security.h>
 
 /* Well, we should have at least one descriptor open
  * to accept passed FDs 8)
@@ -20,8 +21,7 @@ struct scm_cookie
        struct ucred            creds;          /* Skb credentials      */
        struct scm_fp_list      *fp;            /* Passed files         */
 #ifdef CONFIG_SECURITY_NETWORK
-       char                    *secdata;       /* Security context     */
-       u32                     seclen;         /* Security length      */
+       u32                     secid;          /* Passed security ID   */
 #endif
        unsigned long           seq;            /* Connection seqno     */
 };
@@ -32,6 +32,16 @@ extern int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie
 extern void __scm_destroy(struct scm_cookie *scm);
 extern struct scm_fp_list * scm_fp_dup(struct scm_fp_list *fpl);
 
+#ifdef CONFIG_SECURITY_NETWORK
+static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm)
+{
+       security_socket_getpeersec_dgram(sock, NULL, &scm->secid);
+}
+#else
+static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm)
+{ }
+#endif /* CONFIG_SECURITY_NETWORK */
+
 static __inline__ void scm_destroy(struct scm_cookie *scm)
 {
        if (scm && scm->fp)
@@ -47,6 +57,7 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
        scm->creds.pid = p->tgid;
        scm->fp = NULL;
        scm->seq = 0;
+       unix_get_peersec_dgram(sock, scm);
        if (msg->msg_controllen <= 0)
                return 0;
        return __scm_send(sock, msg, scm);
@@ -55,8 +66,18 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
 #ifdef CONFIG_SECURITY_NETWORK
 static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm)
 {
-       if (test_bit(SOCK_PASSSEC, &sock->flags) && scm->secdata != NULL)
-               put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, scm->seclen, scm->secdata);
+       char *secdata;
+       u32 seclen;
+       int err;
+
+       if (test_bit(SOCK_PASSSEC, &sock->flags)) {
+               err = security_secid_to_secctx(scm->secid, &secdata, &seclen);
+
+               if (!err) {
+                       put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, seclen, secdata);
+                       security_release_secctx(secdata, seclen);
+               }
+       }
 }
 #else
 static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm)
index 0720bddff1e9cee11ac9f176b4ef2d59c1356ded..7a093d0aa0fed4642ecdb3637e03ed0bdbb2e234 100644 (file)
@@ -914,6 +914,9 @@ static inline void tcp_set_state(struct sock *sk, int state)
 
 static inline void tcp_done(struct sock *sk)
 {
+       if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
+               TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
+
        tcp_set_state(sk, TCP_CLOSE);
        tcp_clear_xmit_timers(sk);
 
index cd92d342953e500717557a475f09dca9535c6c1a..2b4fccf8ea55a9a2babc5f92b36fcdf6a1dd5a7d 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -1,6 +1,6 @@
 /*
  * linux/ipc/msg.c
- * Copyright (C) 1992 Krishna Balasubramanian 
+ * Copyright (C) 1992 Krishna Balasubramanian
  *
  * Removed all the remaining kerneld mess
  * Catch the -EFAULT stuff properly
@@ -41,22 +41,24 @@ int msg_ctlmax = MSGMAX;
 int msg_ctlmnb = MSGMNB;
 int msg_ctlmni = MSGMNI;
 
-/* one msg_receiver structure for each sleeping receiver */
+/*
+ * one msg_receiver structure for each sleeping receiver:
+ */
 struct msg_receiver {
-       struct list_head r_list;
-       struct task_structr_tsk;
+       struct list_head        r_list;
+       struct task_struct      *r_tsk;
 
-       int r_mode;
-       long r_msgtype;
-       long r_maxsize;
+       int                     r_mode;
+       long                    r_msgtype;
+       long                    r_maxsize;
 
-       struct msg_msg* volatile r_msg;
+       volatile struct msg_msg *r_msg;
 };
 
 /* one msg_sender for each sleeping sender */
 struct msg_sender {
-       struct list_head list;
-       struct task_structtsk;
+       struct list_head        list;
+       struct task_struct      *tsk;
 };
 
 #define SEARCH_ANY             1
@@ -64,45 +66,42 @@ struct msg_sender {
 #define SEARCH_NOTEQUAL                3
 #define SEARCH_LESSEQUAL       4
 
-static atomic_t msg_bytes = ATOMIC_INIT(0);
-static atomic_t msg_hdrs = ATOMIC_INIT(0);
+static atomic_t msg_bytes =    ATOMIC_INIT(0);
+static atomic_t msg_hdrs =     ATOMIC_INIT(0);
 
 static struct ipc_ids msg_ids;
 
-#define msg_lock(id)   ((struct msg_queue*)ipc_lock(&msg_ids,id))
-#define msg_unlock(msq)        ipc_unlock(&(msq)->q_perm)
-#define msg_rmid(id)   ((struct msg_queue*)ipc_rmid(&msg_ids,id))
-#define msg_checkid(msq, msgid)        \
-       ipc_checkid(&msg_ids,&msq->q_perm,msgid)
-#define msg_buildid(id, seq) \
-       ipc_buildid(&msg_ids, id, seq)
+#define msg_lock(id)           ((struct msg_queue *)ipc_lock(&msg_ids, id))
+#define msg_unlock(msq)                ipc_unlock(&(msq)->q_perm)
+#define msg_rmid(id)           ((struct msg_queue *)ipc_rmid(&msg_ids, id))
+#define msg_checkid(msq, msgid)        ipc_checkid(&msg_ids, &msq->q_perm, msgid)
+#define msg_buildid(id, seq)   ipc_buildid(&msg_ids, id, seq)
 
-static void freeque (struct msg_queue *msq, int id);
-static int newque (key_t key, int msgflg);
+static void freeque(struct msg_queue *msq, int id);
+static int newque(key_t key, int msgflg);
 #ifdef CONFIG_PROC_FS
 static int sysvipc_msg_proc_show(struct seq_file *s, void *it);
 #endif
 
-void __init msg_init (void)
+void __init msg_init(void)
 {
-       ipc_init_ids(&msg_ids,msg_ctlmni);
+       ipc_init_ids(&msg_ids, msg_ctlmni);
        ipc_init_proc_interface("sysvipc/msg",
                                "       key      msqid perms      cbytes       qnum lspid lrpid   uid   gid  cuid  cgid      stime      rtime      ctime\n",
                                &msg_ids,
                                sysvipc_msg_proc_show);
 }
 
-static int newque (key_t key, int msgflg)
+static int newque(key_t key, int msgflg)
 {
-       int id;
-       int retval;
        struct msg_queue *msq;
+       int id, retval;
 
-       msq  = ipc_rcu_alloc(sizeof(*msq));
-       if (!msq) 
+       msq = ipc_rcu_alloc(sizeof(*msq));
+       if (!msq)
                return -ENOMEM;
 
-       msq->q_perm.mode = (msgflg & S_IRWXUGO);
+       msq->q_perm.mode = msgflg & S_IRWXUGO;
        msq->q_perm.key = key;
 
        msq->q_perm.security = NULL;
@@ -113,13 +112,13 @@ static int newque (key_t key, int msgflg)
        }
 
        id = ipc_addid(&msg_ids, &msq->q_perm, msg_ctlmni);
-       if(id == -1) {
+       if (id == -1) {
                security_msg_queue_free(msq);
                ipc_rcu_putref(msq);
                return -ENOSPC;
        }
 
-       msq->q_id = msg_buildid(id,msq->q_perm.seq);
+       msq->q_id = msg_buildid(id, msq->q_perm.seq);
        msq->q_stime = msq->q_rtime = 0;
        msq->q_ctime = get_seconds();
        msq->q_cbytes = msq->q_qnum = 0;
@@ -133,44 +132,44 @@ static int newque (key_t key, int msgflg)
        return msq->q_id;
 }
 
-static inline void ss_add(struct msg_queue* msq, struct msg_sender* mss)
+static inline void ss_add(struct msg_queue *msq, struct msg_sender *mss)
 {
-       mss->tsk=current;
-       current->state=TASK_INTERRUPTIBLE;
-       list_add_tail(&mss->list,&msq->q_senders);
+       mss->tsk = current;
+       current->state = TASK_INTERRUPTIBLE;
+       list_add_tail(&mss->list, &msq->q_senders);
 }
 
-static inline void ss_del(struct msg_sendermss)
+static inline void ss_del(struct msg_sender *mss)
 {
-       if(mss->list.next != NULL)
+       if (mss->list.next != NULL)
                list_del(&mss->list);
 }
 
-static void ss_wakeup(struct list_headh, int kill)
+static void ss_wakeup(struct list_head *h, int kill)
 {
        struct list_head *tmp;
 
        tmp = h->next;
        while (tmp != h) {
-               struct msg_sendermss;
-               
-               mss = list_entry(tmp,struct msg_sender,list);
+               struct msg_sender *mss;
+
+               mss = list_entry(tmp, struct msg_sender, list);
                tmp = tmp->next;
-               if(kill)
-                       mss->list.next=NULL;
+               if (kill)
+                       mss->list.next = NULL;
                wake_up_process(mss->tsk);
        }
 }
 
-static void expunge_all(struct msg_queuemsq, int res)
+static void expunge_all(struct msg_queue *msq, int res)
 {
        struct list_head *tmp;
 
        tmp = msq->q_receivers.next;
        while (tmp != &msq->q_receivers) {
-               struct msg_receivermsr;
-               
-               msr = list_entry(tmp,struct msg_receiver,r_list);
+               struct msg_receiver *msr;
+
+               msr = list_entry(tmp, struct msg_receiver, r_list);
                tmp = tmp->next;
                msr->r_msg = NULL;
                wake_up_process(msr->r_tsk);
@@ -178,26 +177,28 @@ static void expunge_all(struct msg_queue* msq, int res)
                msr->r_msg = ERR_PTR(res);
        }
 }
-/* 
- * freeque() wakes up waiters on the sender and receiver waiting queue, 
- * removes the message queue from message queue ID 
+
+/*
+ * freeque() wakes up waiters on the sender and receiver waiting queue,
+ * removes the message queue from message queue ID
  * array, and cleans up all the messages associated with this queue.
  *
  * msg_ids.mutex and the spinlock for this message queue is hold
  * before freeque() is called. msg_ids.mutex remains locked on exit.
  */
-static void freeque (struct msg_queue *msq, int id)
+static void freeque(struct msg_queue *msq, int id)
 {
        struct list_head *tmp;
 
-       expunge_all(msq,-EIDRM);
-       ss_wakeup(&msq->q_senders,1);
+       expunge_all(msq, -EIDRM);
+       ss_wakeup(&msq->q_senders, 1);
        msq = msg_rmid(id);
        msg_unlock(msq);
-               
+
        tmp = msq->q_messages.next;
-       while(tmp != &msq->q_messages) {
-               struct msg_msg* msg = list_entry(tmp,struct msg_msg,m_list);
+       while (tmp != &msq->q_messages) {
+               struct msg_msg *msg = list_entry(tmp, struct msg_msg, m_list);
+
                tmp = tmp->next;
                atomic_dec(&msg_hdrs);
                free_msg(msg);
@@ -207,10 +208,10 @@ static void freeque (struct msg_queue *msq, int id)
        ipc_rcu_putref(msq);
 }
 
-asmlinkage long sys_msgget (key_t key, int msgflg)
+asmlinkage long sys_msgget(key_t key, int msgflg)
 {
-       int id, ret = -EPERM;
        struct msg_queue *msq;
+       int id, ret = -EPERM;
        
        mutex_lock(&msg_ids.mutex);
        if (key == IPC_PRIVATE) 
@@ -224,31 +225,34 @@ asmlinkage long sys_msgget (key_t key, int msgflg)
                ret = -EEXIST;
        } else {
                msq = msg_lock(id);
-               BUG_ON(msq==NULL);
+               BUG_ON(msq == NULL);
                if (ipcperms(&msq->q_perm, msgflg))
                        ret = -EACCES;
                else {
                        int qid = msg_buildid(id, msq->q_perm.seq);
-                       ret = security_msg_queue_associate(msq, msgflg);
+
+                       ret = security_msg_queue_associate(msq, msgflg);
                        if (!ret)
                                ret = qid;
                }
                msg_unlock(msq);
        }
        mutex_unlock(&msg_ids.mutex);
+
        return ret;
 }
 
-static inline unsigned long copy_msqid_to_user(void __user *buf, struct msqid64_ds *in, int version)
+static inline unsigned long
+copy_msqid_to_user(void __user *buf, struct msqid64_ds *in, int version)
 {
        switch(version) {
        case IPC_64:
-               return copy_to_user (buf, in, sizeof(*in));
+               return copy_to_user(buf, in, sizeof(*in));
        case IPC_OLD:
-           {
+       {
                struct msqid_ds out;
 
-               memset(&out,0,sizeof(out));
+               memset(&out, 0, sizeof(out));
 
                ipc64_perm_to_ipc_perm(&in->msg_perm, &out.msg_perm);
 
@@ -256,18 +260,18 @@ static inline unsigned long copy_msqid_to_user(void __user *buf, struct msqid64_
                out.msg_rtime           = in->msg_rtime;
                out.msg_ctime           = in->msg_ctime;
 
-               if(in->msg_cbytes > USHRT_MAX)
+               if (in->msg_cbytes > USHRT_MAX)
                        out.msg_cbytes  = USHRT_MAX;
                else
                        out.msg_cbytes  = in->msg_cbytes;
                out.msg_lcbytes         = in->msg_cbytes;
 
-               if(in->msg_qnum > USHRT_MAX)
+               if (in->msg_qnum > USHRT_MAX)
                        out.msg_qnum    = USHRT_MAX;
                else
                        out.msg_qnum    = in->msg_qnum;
 
-               if(in->msg_qbytes > USHRT_MAX)
+               if (in->msg_qbytes > USHRT_MAX)
                        out.msg_qbytes  = USHRT_MAX;
                else
                        out.msg_qbytes  = in->msg_qbytes;
@@ -276,8 +280,8 @@ static inline unsigned long copy_msqid_to_user(void __user *buf, struct msqid64_
                out.msg_lspid           = in->msg_lspid;
                out.msg_lrpid           = in->msg_lrpid;
 
-               return copy_to_user (buf, &out, sizeof(out));
-           }
+               return copy_to_user(buf, &out, sizeof(out));
+       }
        default:
                return -EINVAL;
        }
@@ -290,14 +294,15 @@ struct msq_setbuf {
        mode_t          mode;
 };
 
-static inline unsigned long copy_msqid_from_user(struct msq_setbuf *out, void __user *buf, int version)
+static inline unsigned long
+copy_msqid_from_user(struct msq_setbuf *out, void __user *buf, int version)
 {
        switch(version) {
        case IPC_64:
-           {
+       {
                struct msqid64_ds tbuf;
 
-               if (copy_from_user (&tbuf, buf, sizeof (tbuf)))
+               if (copy_from_user(&tbuf, buf, sizeof(tbuf)))
                        return -EFAULT;
 
                out->qbytes             = tbuf.msg_qbytes;
@@ -306,60 +311,61 @@ static inline unsigned long copy_msqid_from_user(struct msq_setbuf *out, void __
                out->mode               = tbuf.msg_perm.mode;
 
                return 0;
-           }
+       }
        case IPC_OLD:
-           {
+       {
                struct msqid_ds tbuf_old;
 
-               if (copy_from_user (&tbuf_old, buf, sizeof (tbuf_old)))
+               if (copy_from_user(&tbuf_old, buf, sizeof(tbuf_old)))
                        return -EFAULT;
 
                out->uid                = tbuf_old.msg_perm.uid;
                out->gid                = tbuf_old.msg_perm.gid;
                out->mode               = tbuf_old.msg_perm.mode;
 
-               if(tbuf_old.msg_qbytes == 0)
+               if (tbuf_old.msg_qbytes == 0)
                        out->qbytes     = tbuf_old.msg_lqbytes;
                else
                        out->qbytes     = tbuf_old.msg_qbytes;
 
                return 0;
-           }
+       }
        default:
                return -EINVAL;
        }
 }
 
-asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
+asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf)
 {
-       int err, version;
-       struct msg_queue *msq;
-       struct msq_setbuf setbuf;
        struct kern_ipc_perm *ipcp;
-       
+       struct msq_setbuf setbuf;
+       struct msg_queue *msq;
+       int err, version;
+
        if (msqid < 0 || cmd < 0)
                return -EINVAL;
 
        version = ipc_parse_version(&cmd);
 
        switch (cmd) {
-       case IPC_INFO: 
-       case MSG_INFO: 
-       { 
+       case IPC_INFO:
+       case MSG_INFO:
+       {
                struct msginfo msginfo;
                int max_id;
+
                if (!buf)
                        return -EFAULT;
-               /* We must not return kernel stack data.
+               /*
+                * We must not return kernel stack data.
                 * due to padding, it's not enough
                 * to set all member fields.
                 */
-
                err = security_msg_queue_msgctl(NULL, cmd);
                if (err)
                        return err;
 
-               memset(&msginfo,0,sizeof(msginfo));     
+               memset(&msginfo, 0, sizeof(msginfo));
                msginfo.msgmni = msg_ctlmni;
                msginfo.msgmax = msg_ctlmax;
                msginfo.msgmnb = msg_ctlmnb;
@@ -377,36 +383,37 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
                }
                max_id = msg_ids.max_id;
                mutex_unlock(&msg_ids.mutex);
-               if (copy_to_user (buf, &msginfo, sizeof(struct msginfo)))
+               if (copy_to_user(buf, &msginfo, sizeof(struct msginfo)))
                        return -EFAULT;
-               return (max_id < 0) ? 0: max_id;
+               return (max_id < 0) ? 0 : max_id;
        }
        case MSG_STAT:
        case IPC_STAT:
        {
                struct msqid64_ds tbuf;
                int success_return;
+
                if (!buf)
                        return -EFAULT;
-               if(cmd == MSG_STAT && msqid >= msg_ids.entries->size)
+               if (cmd == MSG_STAT && msqid >= msg_ids.entries->size)
                        return -EINVAL;
 
-               memset(&tbuf,0,sizeof(tbuf));
+               memset(&tbuf, 0, sizeof(tbuf));
 
                msq = msg_lock(msqid);
                if (msq == NULL)
                        return -EINVAL;
 
-               if(cmd == MSG_STAT) {
+               if (cmd == MSG_STAT) {
                        success_return = msg_buildid(msqid, msq->q_perm.seq);
                } else {
                        err = -EIDRM;
-                       if (msg_checkid(msq,msqid))
+                       if (msg_checkid(msq, msqid))
                                goto out_unlock;
                        success_return = 0;
                }
                err = -EACCES;
-               if (ipcperms (&msq->q_perm, S_IRUGO))
+               if (ipcperms(&msq->q_perm, S_IRUGO))
                        goto out_unlock;
 
                err = security_msg_queue_msgctl(msq, cmd);
@@ -430,7 +437,7 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
        case IPC_SET:
                if (!buf)
                        return -EFAULT;
-               if (copy_msqid_from_user (&setbuf, buf, version))
+               if (copy_msqid_from_user(&setbuf, buf, version))
                        return -EFAULT;
                break;
        case IPC_RMID:
@@ -441,12 +448,12 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
 
        mutex_lock(&msg_ids.mutex);
        msq = msg_lock(msqid);
-       err=-EINVAL;
+       err = -EINVAL;
        if (msq == NULL)
                goto out_up;
 
        err = -EIDRM;
-       if (msg_checkid(msq,msqid))
+       if (msg_checkid(msq, msqid))
                goto out_unlock_up;
        ipcp = &msq->q_perm;
 
@@ -454,15 +461,16 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
        if (err)
                goto out_unlock_up;
        if (cmd==IPC_SET) {
-               err = audit_ipc_set_perm(setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode);
+               err = audit_ipc_set_perm(setbuf.qbytes, setbuf.uid, setbuf.gid,
+                                        setbuf.mode);
                if (err)
                        goto out_unlock_up;
        }
 
        err = -EPERM;
-       if (current->euid != ipcp->cuid && 
+       if (current->euid != ipcp->cuid &&
            current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN))
-           /* We _could_ check for CAP_CHOWN above, but we don't */
+               /* We _could_ check for CAP_CHOWN above, but we don't */
                goto out_unlock_up;
 
        err = security_msg_queue_msgctl(msq, cmd);
@@ -480,22 +488,22 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
 
                ipcp->uid = setbuf.uid;
                ipcp->gid = setbuf.gid;
-               ipcp->mode = (ipcp->mode & ~S_IRWXUGO) | 
-                       (S_IRWXUGO & setbuf.mode);
+               ipcp->mode = (ipcp->mode & ~S_IRWXUGO) |
+                            (S_IRWXUGO & setbuf.mode);
                msq->q_ctime = get_seconds();
                /* sleeping receivers might be excluded by
                 * stricter permissions.
                 */
-               expunge_all(msq,-EAGAIN);
+               expunge_all(msq, -EAGAIN);
                /* sleeping senders might be able to send
                 * due to a larger queue size.
                 */
-               ss_wakeup(&msq->q_senders,0);
+               ss_wakeup(&msq->q_senders, 0);
                msg_unlock(msq);
                break;
        }
        case IPC_RMID:
-               freeque (msq, msqid); 
+               freeque(msq, msqid);
                break;
        }
        err = 0;
@@ -510,41 +518,44 @@ out_unlock:
        return err;
 }
 
-static int testmsg(struct msg_msg* msg,long type,int mode)
+static int testmsg(struct msg_msg *msg, long type, int mode)
 {
        switch(mode)
        {
                case SEARCH_ANY:
                        return 1;
                case SEARCH_LESSEQUAL:
-                       if(msg->m_type <=type)
+                       if (msg->m_type <=type)
                                return 1;
                        break;
                case SEARCH_EQUAL:
-                       if(msg->m_type == type)
+                       if (msg->m_type == type)
                                return 1;
                        break;
                case SEARCH_NOTEQUAL:
-                       if(msg->m_type != type)
+                       if (msg->m_type != type)
                                return 1;
                        break;
        }
        return 0;
 }
 
-static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg)
+static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg)
 {
-       struct list_headtmp;
+       struct list_head *tmp;
 
        tmp = msq->q_receivers.next;
        while (tmp != &msq->q_receivers) {
-               struct msg_receiver* msr;
-               msr = list_entry(tmp,struct msg_receiver,r_list);
+               struct msg_receiver *msr;
+
+               msr = list_entry(tmp, struct msg_receiver, r_list);
                tmp = tmp->next;
-               if(testmsg(msg,msr->r_msgtype,msr->r_mode) &&
-                  !security_msg_queue_msgrcv(msq, msg, msr->r_tsk, msr->r_msgtype, msr->r_mode)) {
+               if (testmsg(msg, msr->r_msgtype, msr->r_mode) &&
+                   !security_msg_queue_msgrcv(msq, msg, msr->r_tsk,
+                                              msr->r_msgtype, msr->r_mode)) {
+
                        list_del(&msr->r_list);
-                       if(msr->r_maxsize < msg->m_ts) {
+                       if (msr->r_maxsize < msg->m_ts) {
                                msr->r_msg = NULL;
                                wake_up_process(msr->r_tsk);
                                smp_mb();
@@ -556,6 +567,7 @@ static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg)
                                wake_up_process(msr->r_tsk);
                                smp_mb();
                                msr->r_msg = msg;
+
                                return 1;
                        }
                }
@@ -563,40 +575,41 @@ static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg)
        return 0;
 }
 
-asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg)
+asmlinkage long
+sys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg)
 {
        struct msg_queue *msq;
        struct msg_msg *msg;
        long mtype;
        int err;
-       
+
        if (msgsz > msg_ctlmax || (long) msgsz < 0 || msqid < 0)
                return -EINVAL;
        if (get_user(mtype, &msgp->mtype))
-               return -EFAULT; 
+               return -EFAULT;
        if (mtype < 1)
                return -EINVAL;
 
        msg = load_msg(msgp->mtext, msgsz);
-       if(IS_ERR(msg))
+       if (IS_ERR(msg))
                return PTR_ERR(msg);
 
        msg->m_type = mtype;
        msg->m_ts = msgsz;
 
        msq = msg_lock(msqid);
-       err=-EINVAL;
-       if(msq==NULL)
+       err = -EINVAL;
+       if (msq == NULL)
                goto out_free;
 
        err= -EIDRM;
-       if (msg_checkid(msq,msqid))
+       if (msg_checkid(msq, msqid))
                goto out_unlock_free;
 
        for (;;) {
                struct msg_sender s;
 
-               err=-EACCES;
+               err = -EACCES;
                if (ipcperms(&msq->q_perm, S_IWUGO))
                        goto out_unlock_free;
 
@@ -604,14 +617,14 @@ asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz,
                if (err)
                        goto out_unlock_free;
 
-               if(msgsz + msq->q_cbytes <= msq->q_qbytes &&
+               if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
                                1 + msq->q_qnum <= msq->q_qbytes) {
                        break;
                }
 
                /* queue full, wait: */
-               if(msgflg&IPC_NOWAIT) {
-                       err=-EAGAIN;
+               if (msgflg & IPC_NOWAIT) {
+                       err = -EAGAIN;
                        goto out_unlock_free;
                }
                ss_add(msq, &s);
@@ -626,9 +639,9 @@ asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz,
                        goto out_unlock_free;
                }
                ss_del(&s);
-               
+
                if (signal_pending(current)) {
-                       err=-ERESTARTNOHAND;
+                       err = -ERESTARTNOHAND;
                        goto out_unlock_free;
                }
        }
@@ -636,47 +649,47 @@ asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz,
        msq->q_lspid = current->tgid;
        msq->q_stime = get_seconds();
 
-       if(!pipelined_send(msq,msg)) {
+       if (!pipelined_send(msq, msg)) {
                /* noone is waiting for this message, enqueue it */
-               list_add_tail(&msg->m_list,&msq->q_messages);
+               list_add_tail(&msg->m_list, &msq->q_messages);
                msq->q_cbytes += msgsz;
                msq->q_qnum++;
-               atomic_add(msgsz,&msg_bytes);
+               atomic_add(msgsz, &msg_bytes);
                atomic_inc(&msg_hdrs);
        }
-       
+
        err = 0;
        msg = NULL;
 
 out_unlock_free:
        msg_unlock(msq);
 out_free:
-       if(msg!=NULL)
+       if (msg != NULL)
                free_msg(msg);
        return err;
 }
 
-static inline int convert_mode(longmsgtyp, int msgflg)
+static inline int convert_mode(long *msgtyp, int msgflg)
 {
-       /* 
+       /*
         *  find message of correct type.
         *  msgtyp = 0 => get first.
         *  msgtyp > 0 => get first message of matching type.
-        *  msgtyp < 0 => get message with least type must be < abs(msgtype).  
+        *  msgtyp < 0 => get message with least type must be < abs(msgtype).
         */
-       if(*msgtyp==0)
+       if (*msgtyp == 0)
                return SEARCH_ANY;
-       if(*msgtyp<0) {
-               *msgtyp=-(*msgtyp);
+       if (*msgtyp < 0) {
+               *msgtyp = -*msgtyp;
                return SEARCH_LESSEQUAL;
        }
-       if(msgflg & MSG_EXCEPT)
+       if (msgflg & MSG_EXCEPT)
                return SEARCH_NOTEQUAL;
        return SEARCH_EQUAL;
 }
 
-asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
-                           long msgtyp, int msgflg)
+asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz,
+                          long msgtyp, int msgflg)
 {
        struct msg_queue *msq;
        struct msg_msg *msg;
@@ -684,44 +697,51 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
 
        if (msqid < 0 || (long) msgsz < 0)
                return -EINVAL;
-       mode = convert_mode(&msgtyp,msgflg);
+       mode = convert_mode(&msgtyp, msgflg);
 
        msq = msg_lock(msqid);
-       if(msq==NULL)
+       if (msq == NULL)
                return -EINVAL;
 
        msg = ERR_PTR(-EIDRM);
-       if (msg_checkid(msq,msqid))
+       if (msg_checkid(msq, msqid))
                goto out_unlock;
 
        for (;;) {
                struct msg_receiver msr_d;
-               struct list_headtmp;
+               struct list_head *tmp;
 
                msg = ERR_PTR(-EACCES);
-               if (ipcperms (&msq->q_perm, S_IRUGO))
+               if (ipcperms(&msq->q_perm, S_IRUGO))
                        goto out_unlock;
 
                msg = ERR_PTR(-EAGAIN);
                tmp = msq->q_messages.next;
                while (tmp != &msq->q_messages) {
                        struct msg_msg *walk_msg;
-                       walk_msg = list_entry(tmp,struct msg_msg,m_list);
-                       if(testmsg(walk_msg,msgtyp,mode) &&
-                          !security_msg_queue_msgrcv(msq, walk_msg, current, msgtyp, mode)) {
+
+                       walk_msg = list_entry(tmp, struct msg_msg, m_list);
+                       if (testmsg(walk_msg, msgtyp, mode) &&
+                           !security_msg_queue_msgrcv(msq, walk_msg, current,
+                                                      msgtyp, mode)) {
+
                                msg = walk_msg;
-                               if(mode == SEARCH_LESSEQUAL && walk_msg->m_type != 1) {
-                                       msg=walk_msg;
-                                       msgtyp=walk_msg->m_type-1;
+                               if (mode == SEARCH_LESSEQUAL &&
+                                               walk_msg->m_type != 1) {
+                                       msg = walk_msg;
+                                       msgtyp = walk_msg->m_type - 1;
                                } else {
-                                       msg=walk_msg;
+                                       msg = walk_msg;
                                        break;
                                }
                        }
                        tmp = tmp->next;
                }
-               if(!IS_ERR(msg)) {
-                       /* Found a suitable message. Unlink it from the queue. */
+               if (!IS_ERR(msg)) {
+                       /*
+                        * Found a suitable message.
+                        * Unlink it from the queue.
+                        */
                        if ((msgsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) {
                                msg = ERR_PTR(-E2BIG);
                                goto out_unlock;
@@ -731,9 +751,9 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
                        msq->q_rtime = get_seconds();
                        msq->q_lrpid = current->tgid;
                        msq->q_cbytes -= msg->m_ts;
-                       atomic_sub(msg->m_ts,&msg_bytes);
+                       atomic_sub(msg->m_ts, &msg_bytes);
                        atomic_dec(&msg_hdrs);
-                       ss_wakeup(&msq->q_senders,0);
+                       ss_wakeup(&msq->q_senders, 0);
                        msg_unlock(msq);
                        break;
                }
@@ -742,13 +762,13 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
                        msg = ERR_PTR(-ENOMSG);
                        goto out_unlock;
                }
-               list_add_tail(&msr_d.r_list,&msq->q_receivers);
+               list_add_tail(&msr_d.r_list, &msq->q_receivers);
                msr_d.r_tsk = current;
                msr_d.r_msgtype = msgtyp;
                msr_d.r_mode = mode;
-               if(msgflg & MSG_NOERROR)
+               if (msgflg & MSG_NOERROR)
                        msr_d.r_maxsize = INT_MAX;
-                else
+               else
                        msr_d.r_maxsize = msgsz;
                msr_d.r_msg = ERR_PTR(-EAGAIN);
                current->state = TASK_INTERRUPTIBLE;
@@ -773,17 +793,17 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
                 * wake_up_process(). There is a race with exit(), see
                 * ipc/mqueue.c for the details.
                 */
-               msg = (struct msg_msg*) msr_d.r_msg;
+               msg = (struct msg_msg*)msr_d.r_msg;
                while (msg == NULL) {
                        cpu_relax();
-                       msg = (struct msg_msg*) msr_d.r_msg;
+                       msg = (struct msg_msg *)msr_d.r_msg;
                }
 
                /* Lockless receive, part 3:
                 * If there is a message or an error then accept it without
                 * locking.
                 */
-               if(msg != ERR_PTR(-EAGAIN)) {
+               if (msg != ERR_PTR(-EAGAIN)) {
                        rcu_read_unlock();
                        break;
                }
@@ -798,7 +818,7 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
                 * Repeat test after acquiring the spinlock.
                 */
                msg = (struct msg_msg*)msr_d.r_msg;
-               if(msg != ERR_PTR(-EAGAIN))
+               if (msg != ERR_PTR(-EAGAIN))
                        goto out_unlock;
 
                list_del(&msr_d.r_list);
@@ -810,14 +830,15 @@ out_unlock:
                }
        }
        if (IS_ERR(msg))
-                       return PTR_ERR(msg);
+               return PTR_ERR(msg);
 
        msgsz = (msgsz > msg->m_ts) ? msg->m_ts : msgsz;
        if (put_user (msg->m_type, &msgp->mtype) ||
            store_msg(msgp->mtext, msg, msgsz)) {
-                   msgsz = -EFAULT;
+               msgsz = -EFAULT;
        }
        free_msg(msg);
+
        return msgsz;
 }
 
@@ -827,20 +848,20 @@ static int sysvipc_msg_proc_show(struct seq_file *s, void *it)
        struct msg_queue *msq = it;
 
        return seq_printf(s,
-                         "%10d %10d  %4o  %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n",
-                         msq->q_perm.key,
-                         msq->q_id,
-                         msq->q_perm.mode,
-                         msq->q_cbytes,
-                         msq->q_qnum,
-                         msq->q_lspid,
-                         msq->q_lrpid,
-                         msq->q_perm.uid,
-                         msq->q_perm.gid,
-                         msq->q_perm.cuid,
-                         msq->q_perm.cgid,
-                         msq->q_stime,
-                         msq->q_rtime,
-                         msq->q_ctime);
+                       "%10d %10d  %4o  %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n",
+                       msq->q_perm.key,
+                       msq->q_id,
+                       msq->q_perm.mode,
+                       msq->q_cbytes,
+                       msq->q_qnum,
+                       msq->q_lspid,
+                       msq->q_lrpid,
+                       msq->q_perm.uid,
+                       msq->q_perm.gid,
+                       msq->q_perm.cuid,
+                       msq->q_perm.cgid,
+                       msq->q_stime,
+                       msq->q_rtime,
+                       msq->q_ctime);
 }
 #endif
index d417ca1db79b02fc3cb2d30a3a2122494afd0f14..0a36091ed712c069f49ac2b7c02a53ddb14cf929 100644 (file)
@@ -690,9 +690,7 @@ static const struct inotify_operations audit_inotify_ops = {
 /* Initialize audit support at boot time. */
 static int __init audit_init(void)
 {
-#ifdef CONFIG_AUDITSYSCALL
        int i;
-#endif
 
        printk(KERN_INFO "audit: initializing netlink socket (%s)\n",
               audit_default ? "enabled" : "disabled");
@@ -717,10 +715,10 @@ static int __init audit_init(void)
        audit_ih = inotify_init(&audit_inotify_ops);
        if (IS_ERR(audit_ih))
                audit_panic("cannot initialize inotify handle");
+#endif
 
        for (i = 0; i < AUDIT_INODE_BUCKETS; i++)
                INIT_LIST_HEAD(&audit_inode_hash[i]);
-#endif
 
        return 0;
 }
index 5b4e16276ca05a4bd91512762a6f2fc86e5509a1..6a9a5c5a4e7db9f03cb175e5448cf9a3bf209dc7 100644 (file)
@@ -442,6 +442,7 @@ static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule)
                case AUDIT_EQUAL:
                        break;
                default:
+                       err = -EINVAL;
                        goto exit_free;
                }
        }
@@ -579,6 +580,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
                case AUDIT_EQUAL:
                        break;
                default:
+                       err = -EINVAL;
                        goto exit_free;
                }
        }
@@ -1134,6 +1136,14 @@ static inline int audit_add_rule(struct audit_entry *entry,
        struct audit_watch *watch = entry->rule.watch;
        struct nameidata *ndp, *ndw;
        int h, err, putnd_needed = 0;
+#ifdef CONFIG_AUDITSYSCALL
+       int dont_count = 0;
+
+       /* If either of these, don't count towards total */
+       if (entry->rule.listnr == AUDIT_FILTER_USER ||
+               entry->rule.listnr == AUDIT_FILTER_TYPE)
+               dont_count = 1;
+#endif
 
        if (inode_f) {
                h = audit_hash_ino(inode_f->val);
@@ -1174,6 +1184,10 @@ static inline int audit_add_rule(struct audit_entry *entry,
        } else {
                list_add_tail_rcu(&entry->list, list);
        }
+#ifdef CONFIG_AUDITSYSCALL
+       if (!dont_count)
+               audit_n_rules++;
+#endif
        mutex_unlock(&audit_filter_mutex);
 
        if (putnd_needed)
@@ -1198,6 +1212,14 @@ static inline int audit_del_rule(struct audit_entry *entry,
        struct audit_watch *watch, *tmp_watch = entry->rule.watch;
        LIST_HEAD(inotify_list);
        int h, ret = 0;
+#ifdef CONFIG_AUDITSYSCALL
+       int dont_count = 0;
+
+       /* If either of these, don't count towards total */
+       if (entry->rule.listnr == AUDIT_FILTER_USER ||
+               entry->rule.listnr == AUDIT_FILTER_TYPE)
+               dont_count = 1;
+#endif
 
        if (inode_f) {
                h = audit_hash_ino(inode_f->val);
@@ -1235,6 +1257,10 @@ static inline int audit_del_rule(struct audit_entry *entry,
        list_del_rcu(&e->list);
        call_rcu(&e->rcu, audit_free_rule_rcu);
 
+#ifdef CONFIG_AUDITSYSCALL
+       if (!dont_count)
+               audit_n_rules--;
+#endif
        mutex_unlock(&audit_filter_mutex);
 
        if (!list_empty(&inotify_list))
index ae40ac8c39e7246c5d2b11c96429073f6daffbc0..efc1b74bebf3bc1da8f41c64c7e2deeeb8ba3d0f 100644 (file)
@@ -85,6 +85,9 @@ extern int audit_enabled;
 /* Indicates that audit should log the full pathname. */
 #define AUDIT_NAME_FULL -1
 
+/* number of audit rules */
+int audit_n_rules;
+
 /* When fs/namei.c:getname() is called, we store the pointer in name and
  * we don't let putname() free it (instead we free all of the saved
  * pointers at syscall exit time).
@@ -174,6 +177,7 @@ struct audit_aux_data_path {
 
 /* The per-task audit context. */
 struct audit_context {
+       int                 dummy;      /* must be the first element */
        int                 in_syscall; /* 1 if task is in a syscall */
        enum audit_state    state;
        unsigned int        serial;     /* serial number for record */
@@ -514,7 +518,7 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk,
        context->return_valid = return_valid;
        context->return_code  = return_code;
 
-       if (context->in_syscall && !context->auditable) {
+       if (context->in_syscall && !context->dummy && !context->auditable) {
                enum audit_state state;
 
                state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_EXIT]);
@@ -530,17 +534,7 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk,
        }
 
 get_context:
-       context->pid = tsk->pid;
-       context->ppid = sys_getppid();  /* sic.  tsk == current in all cases */
-       context->uid = tsk->uid;
-       context->gid = tsk->gid;
-       context->euid = tsk->euid;
-       context->suid = tsk->suid;
-       context->fsuid = tsk->fsuid;
-       context->egid = tsk->egid;
-       context->sgid = tsk->sgid;
-       context->fsgid = tsk->fsgid;
-       context->personality = tsk->personality;
+
        tsk->audit_context = NULL;
        return context;
 }
@@ -749,6 +743,17 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
        const char *tty;
 
        /* tsk == current */
+       context->pid = tsk->pid;
+       context->ppid = sys_getppid();  /* sic.  tsk == current in all cases */
+       context->uid = tsk->uid;
+       context->gid = tsk->gid;
+       context->euid = tsk->euid;
+       context->suid = tsk->suid;
+       context->fsuid = tsk->fsuid;
+       context->egid = tsk->egid;
+       context->sgid = tsk->sgid;
+       context->fsgid = tsk->fsgid;
+       context->personality = tsk->personality;
 
        ab = audit_log_start(context, GFP_KERNEL, AUDIT_SYSCALL);
        if (!ab)
@@ -1066,7 +1071,8 @@ void audit_syscall_entry(int arch, int major,
        context->argv[3]    = a4;
 
        state = context->state;
-       if (state == AUDIT_SETUP_CONTEXT || state == AUDIT_BUILD_CONTEXT)
+       context->dummy = !audit_n_rules;
+       if (!context->dummy && (state == AUDIT_SETUP_CONTEXT || state == AUDIT_BUILD_CONTEXT))
                state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_ENTRY]);
        if (likely(state == AUDIT_DISABLED))
                return;
@@ -1199,14 +1205,18 @@ void audit_putname(const char *name)
 #endif
 }
 
-static void audit_inode_context(int idx, const struct inode *inode)
+/* Copy inode data into an audit_names. */
+static void audit_copy_inode(struct audit_names *name, const struct inode *inode)
 {
-       struct audit_context *context = current->audit_context;
-
-       selinux_get_inode_sid(inode, &context->names[idx].osid);
+       name->ino   = inode->i_ino;
+       name->dev   = inode->i_sb->s_dev;
+       name->mode  = inode->i_mode;
+       name->uid   = inode->i_uid;
+       name->gid   = inode->i_gid;
+       name->rdev  = inode->i_rdev;
+       selinux_get_inode_sid(inode, &name->osid);
 }
 
-
 /**
  * audit_inode - store the inode and device from a lookup
  * @name: name being audited
@@ -1240,20 +1250,14 @@ void __audit_inode(const char *name, const struct inode *inode)
                ++context->ino_count;
 #endif
        }
-       context->names[idx].ino   = inode->i_ino;
-       context->names[idx].dev   = inode->i_sb->s_dev;
-       context->names[idx].mode  = inode->i_mode;
-       context->names[idx].uid   = inode->i_uid;
-       context->names[idx].gid   = inode->i_gid;
-       context->names[idx].rdev  = inode->i_rdev;
-       audit_inode_context(idx, inode);
+       audit_copy_inode(&context->names[idx], inode);
 }
 
 /**
  * audit_inode_child - collect inode info for created/removed objects
  * @dname: inode's dentry name
  * @inode: inode being audited
- * @pino: inode number of dentry parent
+ * @parent: inode of dentry parent
  *
  * For syscalls that create or remove filesystem objects, audit_inode
  * can only collect information for the filesystem object's parent.
@@ -1264,7 +1268,7 @@ void __audit_inode(const char *name, const struct inode *inode)
  * unsuccessful attempts.
  */
 void __audit_inode_child(const char *dname, const struct inode *inode,
-                        unsigned long pino)
+                        const struct inode *parent)
 {
        int idx;
        struct audit_context *context = current->audit_context;
@@ -1278,7 +1282,7 @@ void __audit_inode_child(const char *dname, const struct inode *inode,
        if (!dname)
                goto update_context;
        for (idx = 0; idx < context->name_count; idx++)
-               if (context->names[idx].ino == pino) {
+               if (context->names[idx].ino == parent->i_ino) {
                        const char *name = context->names[idx].name;
 
                        if (!name)
@@ -1302,16 +1306,47 @@ update_context:
        context->names[idx].name_len = AUDIT_NAME_FULL;
        context->names[idx].name_put = 0;       /* don't call __putname() */
 
-       if (inode) {
-               context->names[idx].ino   = inode->i_ino;
-               context->names[idx].dev   = inode->i_sb->s_dev;
-               context->names[idx].mode  = inode->i_mode;
-               context->names[idx].uid   = inode->i_uid;
-               context->names[idx].gid   = inode->i_gid;
-               context->names[idx].rdev  = inode->i_rdev;
-               audit_inode_context(idx, inode);
-       } else
-               context->names[idx].ino   = (unsigned long)-1;
+       if (!inode)
+               context->names[idx].ino = (unsigned long)-1;
+       else
+               audit_copy_inode(&context->names[idx], inode);
+
+       /* A parent was not found in audit_names, so copy the inode data for the
+        * provided parent. */
+       if (!found_name) {
+               idx = context->name_count++;
+#if AUDIT_DEBUG
+               context->ino_count++;
+#endif
+               audit_copy_inode(&context->names[idx], parent);
+       }
+}
+
+/**
+ * audit_inode_update - update inode info for last collected name
+ * @inode: inode being audited
+ *
+ * When open() is called on an existing object with the O_CREAT flag, the inode
+ * data audit initially collects is incorrect.  This additional hook ensures
+ * audit has the inode data for the actual object to be opened.
+ */
+void __audit_inode_update(const struct inode *inode)
+{
+       struct audit_context *context = current->audit_context;
+       int idx;
+
+       if (!context->in_syscall || !inode)
+               return;
+
+       if (context->name_count == 0) {
+               context->name_count++;
+#if AUDIT_DEBUG
+               context->ino_count++;
+#endif
+       }
+       idx = context->name_count - 1;
+
+       audit_copy_inode(&context->names[idx], inode);
 }
 
 /**
@@ -1642,7 +1677,7 @@ int audit_bprm(struct linux_binprm *bprm)
        unsigned long p, next;
        void *to;
 
-       if (likely(!audit_enabled || !context))
+       if (likely(!audit_enabled || !context || context->dummy))
                return 0;
 
        ax = kmalloc(sizeof(*ax) + PAGE_SIZE * MAX_ARG_PAGES - bprm->p,
@@ -1680,7 +1715,7 @@ int audit_socketcall(int nargs, unsigned long *args)
        struct audit_aux_data_socketcall *ax;
        struct audit_context *context = current->audit_context;
 
-       if (likely(!context))
+       if (likely(!context || context->dummy))
                return 0;
 
        ax = kmalloc(sizeof(*ax) + nargs * sizeof(unsigned long), GFP_KERNEL);
@@ -1708,7 +1743,7 @@ int audit_sockaddr(int len, void *a)
        struct audit_aux_data_sockaddr *ax;
        struct audit_context *context = current->audit_context;
 
-       if (likely(!context))
+       if (likely(!context || context->dummy))
                return 0;
 
        ax = kmalloc(sizeof(*ax) + len, GFP_KERNEL);
index f05392d64267eafddf4d86a8c99a62233782b7fa..57ca3730205d75f0734ac7ad418d85cced3025ef 100644 (file)
 #include <linux/sysctl.h>
 #include <linux/delayacct.h>
 
-int delayacct_on __read_mostly;        /* Delay accounting turned on/off */
+int delayacct_on __read_mostly = 1;    /* Delay accounting turned on/off */
 kmem_cache_t *delayacct_cache;
 
-static int __init delayacct_setup_enable(char *str)
+static int __init delayacct_setup_disable(char *str)
 {
-       delayacct_on = 1;
+       delayacct_on = 0;
        return 1;
 }
-__setup("delayacct", delayacct_setup_enable);
+__setup("nodelayacct", delayacct_setup_disable);
 
 void delayacct_init(void)
 {
index 1b0f7b1e088189a53d531e038b1dce75ad3f7a6a..aa36c43783cc01f296eb1c755cc4f17b51b55ccc 100644 (file)
@@ -1387,8 +1387,10 @@ long do_fork(unsigned long clone_flags,
 
                if (clone_flags & CLONE_VFORK) {
                        wait_for_completion(&vfork);
-                       if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE))
+                       if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) {
+                               current->ptrace_message = nr;
                                ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP);
+                       }
                }
        } else {
                free_pid(pid);
index cf0c8e21d1abaae85c17a816dbd42a8ed3132dd5..d4633c588f33e417df960bff848ba5fa26eb78fe 100644 (file)
@@ -297,7 +297,7 @@ static int futex_handle_fault(unsigned long address, int attempt)
        struct vm_area_struct * vma;
        struct mm_struct *mm = current->mm;
 
-       if (attempt >= 2 || !(vma = find_vma(mm, address)) ||
+       if (attempt > 2 || !(vma = find_vma(mm, address)) ||
            vma->vm_start > address || !(vma->vm_flags & VM_WRITE))
                return -EFAULT;
 
@@ -415,15 +415,15 @@ out_unlock:
  */
 void exit_pi_state_list(struct task_struct *curr)
 {
-       struct futex_hash_bucket *hb;
        struct list_head *next, *head = &curr->pi_state_list;
        struct futex_pi_state *pi_state;
+       struct futex_hash_bucket *hb;
        union futex_key key;
 
        /*
         * We are a ZOMBIE and nobody can enqueue itself on
         * pi_state_list anymore, but we have to be careful
-        * versus waiters unqueueing themselfs
+        * versus waiters unqueueing themselves:
         */
        spin_lock_irq(&curr->pi_lock);
        while (!list_empty(head)) {
@@ -431,21 +431,24 @@ void exit_pi_state_list(struct task_struct *curr)
                next = head->next;
                pi_state = list_entry(next, struct futex_pi_state, list);
                key = pi_state->key;
+               hb = hash_futex(&key);
                spin_unlock_irq(&curr->pi_lock);
 
-               hb = hash_futex(&key);
                spin_lock(&hb->lock);
 
                spin_lock_irq(&curr->pi_lock);
+               /*
+                * We dropped the pi-lock, so re-check whether this
+                * task still owns the PI-state:
+                */
                if (head->next != next) {
                        spin_unlock(&hb->lock);
                        continue;
                }
 
-               list_del_init(&pi_state->list);
-
                WARN_ON(pi_state->owner != curr);
-
+               WARN_ON(list_empty(&pi_state->list));
+               list_del_init(&pi_state->list);
                pi_state->owner = NULL;
                spin_unlock_irq(&curr->pi_lock);
 
@@ -470,7 +473,7 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me)
        head = &hb->chain;
 
        list_for_each_entry_safe(this, next, head, list) {
-               if (match_futex (&this->key, &me->key)) {
+               if (match_futex(&this->key, &me->key)) {
                        /*
                         * Another waiter already exists - bump up
                         * the refcount and return its pi_state:
@@ -482,6 +485,8 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me)
                        if (unlikely(!pi_state))
                                return -EINVAL;
 
+                       WARN_ON(!atomic_read(&pi_state->refcount));
+
                        atomic_inc(&pi_state->refcount);
                        me->pi_state = pi_state;
 
@@ -490,10 +495,13 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me)
        }
 
        /*
-        * We are the first waiter - try to look up the real owner and
-        * attach the new pi_state to it:
+        * We are the first waiter - try to look up the real owner and attach
+        * the new pi_state to it, but bail out when the owner died bit is set
+        * and TID = 0:
         */
        pid = uval & FUTEX_TID_MASK;
+       if (!pid && (uval & FUTEX_OWNER_DIED))
+               return -ESRCH;
        p = futex_find_get_task(pid);
        if (!p)
                return -ESRCH;
@@ -510,6 +518,7 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me)
        pi_state->key = me->key;
 
        spin_lock_irq(&p->pi_lock);
+       WARN_ON(!list_empty(&pi_state->list));
        list_add(&pi_state->list, &p->pi_state_list);
        pi_state->owner = p;
        spin_unlock_irq(&p->pi_lock);
@@ -573,20 +582,29 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
         * kept enabled while there is PI state around. We must also
         * preserve the owner died bit.)
         */
-       newval = (uval & FUTEX_OWNER_DIED) | FUTEX_WAITERS | new_owner->pid;
+       if (!(uval & FUTEX_OWNER_DIED)) {
+               newval = FUTEX_WAITERS | new_owner->pid;
 
-       inc_preempt_count();
-       curval = futex_atomic_cmpxchg_inatomic(uaddr, uval, newval);
-       dec_preempt_count();
+               inc_preempt_count();
+               curval = futex_atomic_cmpxchg_inatomic(uaddr, uval, newval);
+               dec_preempt_count();
+               if (curval == -EFAULT)
+                       return -EFAULT;
+               if (curval != uval)
+                       return -EINVAL;
+       }
 
-       if (curval == -EFAULT)
-               return -EFAULT;
-       if (curval != uval)
-               return -EINVAL;
+       spin_lock_irq(&pi_state->owner->pi_lock);
+       WARN_ON(list_empty(&pi_state->list));
+       list_del_init(&pi_state->list);
+       spin_unlock_irq(&pi_state->owner->pi_lock);
 
-       list_del_init(&pi_state->owner->pi_state_list);
+       spin_lock_irq(&new_owner->pi_lock);
+       WARN_ON(!list_empty(&pi_state->list));
        list_add(&pi_state->list, &new_owner->pi_state_list);
        pi_state->owner = new_owner;
+       spin_unlock_irq(&new_owner->pi_lock);
+
        rt_mutex_unlock(&pi_state->pi_mutex);
 
        return 0;
@@ -729,8 +747,10 @@ retry:
                 */
                if (attempt++) {
                        if (futex_handle_fault((unsigned long)uaddr2,
-                                              attempt))
+                                               attempt)) {
+                               ret = -EFAULT;
                                goto out;
+                       }
                        goto retry;
                }
 
@@ -930,6 +950,7 @@ static int unqueue_me(struct futex_q *q)
        /* In the common case we don't take the spinlock, which is nice. */
  retry:
        lock_ptr = q->lock_ptr;
+       barrier();
        if (lock_ptr != 0) {
                spin_lock(lock_ptr);
                /*
@@ -1236,6 +1257,7 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
                /* Owner died? */
                if (q.pi_state->owner != NULL) {
                        spin_lock_irq(&q.pi_state->owner->pi_lock);
+                       WARN_ON(list_empty(&q.pi_state->list));
                        list_del_init(&q.pi_state->list);
                        spin_unlock_irq(&q.pi_state->owner->pi_lock);
                } else
@@ -1244,6 +1266,7 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
                q.pi_state->owner = current;
 
                spin_lock_irq(&current->pi_lock);
+               WARN_ON(!list_empty(&q.pi_state->list));
                list_add(&q.pi_state->list, &current->pi_state_list);
                spin_unlock_irq(&current->pi_lock);
 
@@ -1301,9 +1324,10 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
         * still holding the mmap_sem.
         */
        if (attempt++) {
-               if (futex_handle_fault((unsigned long)uaddr, attempt))
+               if (futex_handle_fault((unsigned long)uaddr, attempt)) {
+                       ret = -EFAULT;
                        goto out_unlock_release_sem;
-
+               }
                goto retry_locked;
        }
 
@@ -1427,9 +1451,11 @@ retry_locked:
         * again. If it succeeds then we can return without waking
         * anyone else up:
         */
-       inc_preempt_count();
-       uval = futex_atomic_cmpxchg_inatomic(uaddr, current->pid, 0);
-       dec_preempt_count();
+       if (!(uval & FUTEX_OWNER_DIED)) {
+               inc_preempt_count();
+               uval = futex_atomic_cmpxchg_inatomic(uaddr, current->pid, 0);
+               dec_preempt_count();
+       }
 
        if (unlikely(uval == -EFAULT))
                goto pi_faulted;
@@ -1462,9 +1488,11 @@ retry_locked:
        /*
         * No waiters - kernel unlocks the futex:
         */
-       ret = unlock_futex_pi(uaddr, uval);
-       if (ret == -EFAULT)
-               goto pi_faulted;
+       if (!(uval & FUTEX_OWNER_DIED)) {
+               ret = unlock_futex_pi(uaddr, uval);
+               if (ret == -EFAULT)
+                       goto pi_faulted;
+       }
 
 out_unlock:
        spin_unlock(&hb->lock);
@@ -1481,9 +1509,10 @@ pi_faulted:
         * still holding the mmap_sem.
         */
        if (attempt++) {
-               if (futex_handle_fault((unsigned long)uaddr, attempt))
+               if (futex_handle_fault((unsigned long)uaddr, attempt)) {
+                       ret = -EFAULT;
                        goto out_unlock;
-
+               }
                goto retry_locked;
        }
 
@@ -1683,9 +1712,9 @@ err_unlock:
  * Process a futex-list entry, check whether it's owned by the
  * dying task, and do notification if so:
  */
-int handle_futex_death(u32 __user *uaddr, struct task_struct *curr)
+int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi)
 {
-       u32 uval, nval;
+       u32 uval, nval, mval;
 
 retry:
        if (get_user(uval, uaddr))
@@ -1702,20 +1731,44 @@ retry:
                 * thread-death.) The rest of the cleanup is done in
                 * userspace.
                 */
-               nval = futex_atomic_cmpxchg_inatomic(uaddr, uval,
-                                                    uval | FUTEX_OWNER_DIED);
+               mval = (uval & FUTEX_WAITERS) | FUTEX_OWNER_DIED;
+               nval = futex_atomic_cmpxchg_inatomic(uaddr, uval, mval);
+
                if (nval == -EFAULT)
                        return -1;
 
                if (nval != uval)
                        goto retry;
 
-               if (uval & FUTEX_WAITERS)
-                       futex_wake(uaddr, 1);
+               /*
+                * Wake robust non-PI futexes here. The wakeup of
+                * PI futexes happens in exit_pi_state():
+                */
+               if (!pi) {
+                       if (uval & FUTEX_WAITERS)
+                               futex_wake(uaddr, 1);
+               }
        }
        return 0;
 }
 
+/*
+ * Fetch a robust-list pointer. Bit 0 signals PI futexes:
+ */
+static inline int fetch_robust_entry(struct robust_list __user **entry,
+                                    struct robust_list __user **head, int *pi)
+{
+       unsigned long uentry;
+
+       if (get_user(uentry, (unsigned long *)head))
+               return -EFAULT;
+
+       *entry = (void *)(uentry & ~1UL);
+       *pi = uentry & 1;
+
+       return 0;
+}
+
 /*
  * Walk curr->robust_list (very carefully, it's a userspace list!)
  * and mark any locks found there dead, and notify any waiters.
@@ -1726,14 +1779,14 @@ void exit_robust_list(struct task_struct *curr)
 {
        struct robust_list_head __user *head = curr->robust_list;
        struct robust_list __user *entry, *pending;
-       unsigned int limit = ROBUST_LIST_LIMIT;
+       unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
        unsigned long futex_offset;
 
        /*
         * Fetch the list head (which was registered earlier, via
         * sys_set_robust_list()):
         */
-       if (get_user(entry, &head->list.next))
+       if (fetch_robust_entry(&entry, &head->list.next, &pi))
                return;
        /*
         * Fetch the relative futex offset:
@@ -1744,10 +1797,11 @@ void exit_robust_list(struct task_struct *curr)
         * Fetch any possibly pending lock-add first, and handle it
         * if it exists:
         */
-       if (get_user(pending, &head->list_op_pending))
+       if (fetch_robust_entry(&pending, &head->list_op_pending, &pip))
                return;
+
        if (pending)
-               handle_futex_death((void *)pending + futex_offset, curr);
+               handle_futex_death((void *)pending + futex_offset, curr, pip);
 
        while (entry != &head->list) {
                /*
@@ -1756,12 +1810,12 @@ void exit_robust_list(struct task_struct *curr)
                 */
                if (entry != pending)
                        if (handle_futex_death((void *)entry + futex_offset,
-                                               curr))
+                                               curr, pi))
                                return;
                /*
                 * Fetch the next entry in the list:
                 */
-               if (get_user(entry, &entry->next))
+               if (fetch_robust_entry(&entry, &entry->next, &pi))
                        return;
                /*
                 * Avoid excessively long or circular lists:
index d1d92b441fb7d7a327f229def2db99d4359063ee..c5cca3f65cb776f2757e4bd5eeb167a4f84f6ffd 100644 (file)
 
 #include <asm/uaccess.h>
 
+
+/*
+ * Fetch a robust-list pointer. Bit 0 signals PI futexes:
+ */
+static inline int
+fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
+                  compat_uptr_t *head, int *pi)
+{
+       if (get_user(*uentry, head))
+               return -EFAULT;
+
+       *entry = compat_ptr((*uentry) & ~1);
+       *pi = (unsigned int)(*uentry) & 1;
+
+       return 0;
+}
+
 /*
  * Walk curr->robust_list (very carefully, it's a userspace list!)
  * and mark any locks found there dead, and notify any waiters.
@@ -22,17 +39,16 @@ void compat_exit_robust_list(struct task_struct *curr)
 {
        struct compat_robust_list_head __user *head = curr->compat_robust_list;
        struct robust_list __user *entry, *pending;
+       unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
        compat_uptr_t uentry, upending;
-       unsigned int limit = ROBUST_LIST_LIMIT;
        compat_long_t futex_offset;
 
        /*
         * Fetch the list head (which was registered earlier, via
         * sys_set_robust_list()):
         */
-       if (get_user(uentry, &head->list.next))
+       if (fetch_robust_entry(&uentry, &entry, &head->list.next, &pi))
                return;
-       entry = compat_ptr(uentry);
        /*
         * Fetch the relative futex offset:
         */
@@ -42,11 +58,11 @@ void compat_exit_robust_list(struct task_struct *curr)
         * Fetch any possibly pending lock-add first, and handle it
         * if it exists:
         */
-       if (get_user(upending, &head->list_op_pending))
+       if (fetch_robust_entry(&upending, &pending,
+                              &head->list_op_pending, &pip))
                return;
-       pending = compat_ptr(upending);
        if (upending)
-               handle_futex_death((void *)pending + futex_offset, curr);
+               handle_futex_death((void *)pending + futex_offset, curr, pip);
 
        while (compat_ptr(uentry) != &head->list) {
                /*
@@ -55,15 +71,15 @@ void compat_exit_robust_list(struct task_struct *curr)
                 */
                if (entry != pending)
                        if (handle_futex_death((void *)entry + futex_offset,
-                                               curr))
+                                               curr, pi))
                                return;
 
                /*
                 * Fetch the next entry in the list:
                 */
-               if (get_user(uentry, (compat_uptr_t *)&entry->next))
+               if (fetch_robust_entry(&uentry, &entry,
+                                      (compat_uptr_t *)&entry->next, &pi))
                        return;
-               entry = compat_ptr(uentry);
                /*
                 * Avoid excessively long or circular lists:
                 */
index d17766d40dab781ea1d189e715de32b61a4972ed..21c38a7e666ba74f373b9693770af4b22b63a685 100644 (file)
@@ -187,7 +187,7 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_base *base)
 {
        struct hrtimer_base *new_base;
 
-       new_base = &__get_cpu_var(hrtimer_bases[base->index]);
+       new_base = &__get_cpu_var(hrtimer_bases)[base->index];
 
        if (base != new_base) {
                /*
@@ -835,7 +835,7 @@ static void migrate_hrtimers(int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-static int __devinit hrtimer_cpu_notify(struct notifier_block *self,
+static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
                                        unsigned long action, void *hcpu)
 {
        long cpu = (long)hcpu;
@@ -859,7 +859,7 @@ static int __devinit hrtimer_cpu_notify(struct notifier_block *self,
        return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata hrtimers_nb = {
+static struct notifier_block __cpuinitdata hrtimers_nb = {
        .notifier_call = hrtimer_cpu_notify,
 };
 
index 4e461438e48bfe687f4ced338a0f2c69791fb33e..92be519eff26fe3fd467eb6ca0e3e063a36f50ce 100644 (file)
@@ -137,16 +137,40 @@ EXPORT_SYMBOL(enable_irq);
  *     @irq:   interrupt to control
  *     @on:    enable/disable power management wakeup
  *
- *     Enable/disable power management wakeup mode
+ *     Enable/disable power management wakeup mode, which is
+ *     disabled by default.  Enables and disables must match,
+ *     just as they match for non-wakeup mode support.
+ *
+ *     Wakeup mode lets this IRQ wake the system from sleep
+ *     states like "suspend to RAM".
  */
 int set_irq_wake(unsigned int irq, unsigned int on)
 {
        struct irq_desc *desc = irq_desc + irq;
        unsigned long flags;
        int ret = -ENXIO;
+       int (*set_wake)(unsigned, unsigned) = desc->chip->set_wake;
 
+       /* wakeup-capable irqs can be shared between drivers that
+        * don't need to have the same sleep mode behaviors.
+        */
        spin_lock_irqsave(&desc->lock, flags);
-       if (desc->chip->set_wake)
+       if (on) {
+               if (desc->wake_depth++ == 0)
+                       desc->status |= IRQ_WAKEUP;
+               else
+                       set_wake = NULL;
+       } else {
+               if (desc->wake_depth == 0) {
+                       printk(KERN_WARNING "Unbalanced IRQ %d "
+                                       "wake disable\n", irq);
+                       WARN_ON(1);
+               } else if (--desc->wake_depth == 0)
+                       desc->status &= ~IRQ_WAKEUP;
+               else
+                       set_wake = NULL;
+       }
+       if (set_wake)
                ret = desc->chip->set_wake(irq, on);
        spin_unlock_irqrestore(&desc->lock, flags);
        return ret;
index 64aab081153b8345649710623b12704f5a87aec6..3f57dfdc8f92ba2d60e0b49af23ce6823d0598f1 100644 (file)
@@ -393,6 +393,7 @@ static int __kprobes add_new_kprobe(struct kprobe *old_p, struct kprobe *p)
 static inline void add_aggr_kprobe(struct kprobe *ap, struct kprobe *p)
 {
        copy_kprobe(p, ap);
+       flush_insn_slot(ap);
        ap->addr = p->addr;
        ap->pre_handler = aggr_pre_handler;
        ap->fault_handler = aggr_fault_handler;
index d8a0bca21233e12d413fa9ab60c436b9b36e0db7..9b8dcfd1ca931e6f728c79655e4edead123a0f11 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/nmi.h>
 #include <linux/kexec.h>
+#include <linux/debug_locks.h>
 
 int panic_on_oops;
 int tainted;
index b2a5f671d6cd3f2d164e44ad20ad7780a7e00377..72e72d2c61e6e412106c2e58733087b9ba16ac81 100644 (file)
@@ -66,13 +66,25 @@ static inline void freeze_process(struct task_struct *p)
        }
 }
 
+static void cancel_freezing(struct task_struct *p)
+{
+       unsigned long flags;
+
+       if (freezing(p)) {
+               pr_debug("  clean up: %s\n", p->comm);
+               do_not_freeze(p);
+               spin_lock_irqsave(&p->sighand->siglock, flags);
+               recalc_sigpending_tsk(p);
+               spin_unlock_irqrestore(&p->sighand->siglock, flags);
+       }
+}
+
 /* 0 = success, else # of processes that we failed to stop */
 int freeze_processes(void)
 {
        int todo, nr_user, user_frozen;
        unsigned long start_time;
        struct task_struct *g, *p;
-       unsigned long flags;
 
        printk( "Stopping tasks: " );
        start_time = jiffies;
@@ -85,6 +97,10 @@ int freeze_processes(void)
                                continue;
                        if (frozen(p))
                                continue;
+                       if (p->state == TASK_TRACED && frozen(p->parent)) {
+                               cancel_freezing(p);
+                               continue;
+                       }
                        if (p->mm && !(p->flags & PF_BORROWED_MM)) {
                                /* The task is a user-space one.
                                 * Freeze it unless there's a vfork completion
@@ -126,13 +142,7 @@ int freeze_processes(void)
                do_each_thread(g, p) {
                        if (freezeable(p) && !frozen(p))
                                printk(KERN_ERR "  %s\n", p->comm);
-                       if (freezing(p)) {
-                               pr_debug("  clean up: %s\n", p->comm);
-                               p->flags &= ~PF_FREEZE;
-                               spin_lock_irqsave(&p->sighand->siglock, flags);
-                               recalc_sigpending_tsk(p);
-                               spin_unlock_irqrestore(&p->sighand->siglock, flags);
-                       }
+                       cancel_freezing(p);
                } while_each_thread(g, p);
                read_unlock(&tasklist_lock);
                return todo;
index 65ca0688f86f1b78fafd144671a17015b2fd1525..1149365e989edee40639bda0cd6865204e05cc89 100644 (file)
@@ -799,6 +799,9 @@ void release_console_sem(void)
                up(&secondary_console_sem);
                return;
        }
+
+       console_may_schedule = 0;
+
        for ( ; ; ) {
                spin_lock_irqsave(&logbuf_lock, flags);
                wake_klogd |= log_start - log_end;
@@ -812,7 +815,6 @@ void release_console_sem(void)
                local_irq_restore(flags);
        }
        console_locked = 0;
-       console_may_schedule = 0;
        up(&console_sem);
        spin_unlock_irqrestore(&logbuf_lock, flags);
        if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) {
index 759805c9859a28f7552363c8e7fdce680e0f694a..436ab35f6fa74821b7f40d1625cce47ccf674121 100644 (file)
@@ -548,7 +548,7 @@ static void __devinit rcu_online_cpu(int cpu)
        tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL);
 }
 
-static int __devinit rcu_cpu_notify(struct notifier_block *self,
+static int __cpuinit rcu_cpu_notify(struct notifier_block *self,
                                unsigned long action, void *hcpu)
 {
        long cpu = (long)hcpu;
@@ -565,7 +565,7 @@ static int __devinit rcu_cpu_notify(struct notifier_block *self,
        return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata rcu_nb = {
+static struct notifier_block __cpuinitdata rcu_nb = {
        .notifier_call  = rcu_cpu_notify,
 };
 
index 0dd3a857579e4fe1b9aae9463aac4717e149eaa9..46286434af8066af359143df81244e0c3024de19 100644 (file)
@@ -244,6 +244,7 @@ int find_next_system_ram(struct resource *res)
 
        start = res->start;
        end = res->end;
+       BUG_ON(start >= end);
 
        read_lock(&resource_lock);
        for (p = iomem_resource.child; p ; p = p->sibling) {
@@ -254,15 +255,17 @@ int find_next_system_ram(struct resource *res)
                        p = NULL;
                        break;
                }
-               if (p->start >= start)
+               if ((p->end >= start) && (p->start < end))
                        break;
        }
        read_unlock(&resource_lock);
        if (!p)
                return -1;
        /* copy data */
-       res->start = p->start;
-       res->end = p->end;
+       if (res->start < p->start)
+               res->start = p->start;
+       if (res->end > p->end)
+               res->end = p->end;
        return 0;
 }
 #endif
index d2ef13b485e7a802641ecaa480640a56e7ab1d86..3e13a1e5856fecf8a06eab48372d12a01efb428b 100644 (file)
@@ -7,6 +7,8 @@
  *  Copyright (C) 2005-2006 Timesys Corp., Thomas Gleixner <tglx@timesys.com>
  *  Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt
  *  Copyright (C) 2006 Esben Nielsen
+ *
+ *  See Documentation/rt-mutex-design.txt for details.
  */
 #include <linux/spinlock.h>
 #include <linux/module.h>
index b44b9a43b0fcadbe0745aafd876e2a17a7daa9d5..a2be2d05529910594e24d19b2c1f1937df6a0ef4 100644 (file)
@@ -4456,9 +4456,9 @@ asmlinkage long sys_sched_yield(void)
        return 0;
 }
 
-static inline int __resched_legal(void)
+static inline int __resched_legal(int expected_preempt_count)
 {
-       if (unlikely(preempt_count()))
+       if (unlikely(preempt_count() != expected_preempt_count))
                return 0;
        if (unlikely(system_state != SYSTEM_RUNNING))
                return 0;
@@ -4484,7 +4484,7 @@ static void __cond_resched(void)
 
 int __sched cond_resched(void)
 {
-       if (need_resched() && __resched_legal()) {
+       if (need_resched() && __resched_legal(0)) {
                __cond_resched();
                return 1;
        }
@@ -4510,7 +4510,7 @@ int cond_resched_lock(spinlock_t *lock)
                ret = 1;
                spin_lock(lock);
        }
-       if (need_resched() && __resched_legal()) {
+       if (need_resched() && __resched_legal(1)) {
                spin_release(&lock->dep_map, 1, _THIS_IP_);
                _raw_spin_unlock(lock);
                preempt_enable_no_resched();
@@ -4526,7 +4526,7 @@ int __sched cond_resched_softirq(void)
 {
        BUG_ON(!in_softirq());
 
-       if (need_resched() && __resched_legal()) {
+       if (need_resched() && __resched_legal(0)) {
                raw_local_irq_disable();
                _local_bh_enable();
                raw_local_irq_enable();
@@ -6494,7 +6494,12 @@ static int build_sched_domains(const cpumask_t *cpu_map)
        for (i = 0; i < MAX_NUMNODES; i++)
                init_numa_sched_groups_power(sched_group_nodes[i]);
 
-       init_numa_sched_groups_power(sched_group_allnodes);
+       if (sched_group_allnodes) {
+               int group = cpu_to_allnodes_group(first_cpu(*cpu_map));
+               struct sched_group *sg = &sched_group_allnodes[group];
+
+               init_numa_sched_groups_power(sg);
+       }
 #endif
 
        /* Attach the domains */
@@ -6761,6 +6766,11 @@ void __init sched_init(void)
        }
 
        set_load_weight(&init_task);
+
+#ifdef CONFIG_RT_MUTEXES
+       plist_head_init(&init_task.pi_waiters, &init_task.pi_lock);
+#endif
+
        /*
         * The boot idle thread does lazy MMU switching as well:
         */
index 7fe874d12faeb4dba5cb6cfa30b376c045831f4b..bfdb5686fa3e4e3d23075afd2bf21bf680ba0aae 100644 (file)
@@ -791,22 +791,31 @@ out:
 /*
  * Force a signal that the process can't ignore: if necessary
  * we unblock the signal and change any SIG_IGN to SIG_DFL.
+ *
+ * Note: If we unblock the signal, we always reset it to SIG_DFL,
+ * since we do not want to have a signal handler that was blocked
+ * be invoked when user space had explicitly blocked it.
+ *
+ * We don't want to have recursive SIGSEGV's etc, for example.
  */
-
 int
 force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
 {
        unsigned long int flags;
-       int ret;
+       int ret, blocked, ignored;
+       struct k_sigaction *action;
 
        spin_lock_irqsave(&t->sighand->siglock, flags);
-       if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) {
-               t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;
-       }
-       if (sigismember(&t->blocked, sig)) {
-               sigdelset(&t->blocked, sig);
+       action = &t->sighand->action[sig-1];
+       ignored = action->sa.sa_handler == SIG_IGN;
+       blocked = sigismember(&t->blocked, sig);
+       if (blocked || ignored) {
+               action->sa.sa_handler = SIG_DFL;
+               if (blocked) {
+                       sigdelset(&t->blocked, sig);
+                       recalc_sigpending_tsk(t);
+               }
        }
-       recalc_sigpending_tsk(t);
        ret = specific_send_sig_info(sig, info, t);
        spin_unlock_irqrestore(&t->sighand->siglock, flags);
 
index 0f08a84ae30718fe21d5430c5f33c86edebff1e9..3789ca98197c2a793b25dc6ac403e26202312133 100644 (file)
@@ -65,6 +65,7 @@ static inline void wakeup_softirqd(void)
  * This one is for softirq.c-internal use,
  * where hardirqs are disabled legitimately:
  */
+#ifdef CONFIG_TRACE_IRQFLAGS
 static void __local_bh_disable(unsigned long ip)
 {
        unsigned long flags;
@@ -80,6 +81,13 @@ static void __local_bh_disable(unsigned long ip)
                trace_softirqs_off(ip);
        raw_local_irq_restore(flags);
 }
+#else /* !CONFIG_TRACE_IRQFLAGS */
+static inline void __local_bh_disable(unsigned long ip)
+{
+       add_preempt_count(SOFTIRQ_OFFSET);
+       barrier();
+}
+#endif /* CONFIG_TRACE_IRQFLAGS */
 
 void local_bh_disable(void)
 {
@@ -121,12 +129,16 @@ EXPORT_SYMBOL(_local_bh_enable);
 
 void local_bh_enable(void)
 {
+#ifdef CONFIG_TRACE_IRQFLAGS
        unsigned long flags;
 
        WARN_ON_ONCE(in_irq());
+#endif
        WARN_ON_ONCE(irqs_disabled());
 
+#ifdef CONFIG_TRACE_IRQFLAGS
        local_irq_save(flags);
+#endif
        /*
         * Are softirqs going to be turned on now:
         */
@@ -142,18 +154,22 @@ void local_bh_enable(void)
                do_softirq();
 
        dec_preempt_count();
+#ifdef CONFIG_TRACE_IRQFLAGS
        local_irq_restore(flags);
+#endif
        preempt_check_resched();
 }
 EXPORT_SYMBOL(local_bh_enable);
 
 void local_bh_enable_ip(unsigned long ip)
 {
+#ifdef CONFIG_TRACE_IRQFLAGS
        unsigned long flags;
 
        WARN_ON_ONCE(in_irq());
 
        local_irq_save(flags);
+#endif
        /*
         * Are softirqs going to be turned on now:
         */
@@ -169,7 +185,9 @@ void local_bh_enable_ip(unsigned long ip)
                do_softirq();
 
        dec_preempt_count();
+#ifdef CONFIG_TRACE_IRQFLAGS
        local_irq_restore(flags);
+#endif
        preempt_check_resched();
 }
 EXPORT_SYMBOL(local_bh_enable_ip);
@@ -547,7 +565,7 @@ static void takeover_tasklets(unsigned int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-static int __devinit cpu_callback(struct notifier_block *nfb,
+static int __cpuinit cpu_callback(struct notifier_block *nfb,
                                  unsigned long action,
                                  void *hcpu)
 {
@@ -587,7 +605,7 @@ static int __devinit cpu_callback(struct notifier_block *nfb,
        return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata cpu_nfb = {
+static struct notifier_block __cpuinitdata cpu_nfb = {
        .notifier_call = cpu_callback
 };
 
index 6b76caa229818811f61aaacf16afd9c2b6da5dc5..03e6a2b0b787a97f426887f6ecdf709951acaced 100644 (file)
@@ -104,7 +104,7 @@ static int watchdog(void * __bind_cpu)
 /*
  * Create/destroy watchdog threads as CPUs come and go:
  */
-static int __devinit
+static int __cpuinit
 cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
        int hotcpu = (unsigned long)hcpu;
@@ -142,7 +142,7 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
        return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata cpu_nfb = {
+static struct notifier_block __cpuinitdata cpu_nfb = {
        .notifier_call = cpu_callback
 };
 
index f45179ce028e9a4370ac3227c59614999a393feb..e781876573304e5350ec8c209760d4ebdc4fd266 100644 (file)
@@ -121,46 +121,45 @@ static int send_reply(struct sk_buff *skb, pid_t pid)
 /*
  * Send taskstats data in @skb to listeners registered for @cpu's exit data
  */
-static int send_cpu_listeners(struct sk_buff *skb, unsigned int cpu)
+static void send_cpu_listeners(struct sk_buff *skb, unsigned int cpu)
 {
        struct genlmsghdr *genlhdr = nlmsg_data((struct nlmsghdr *)skb->data);
        struct listener_list *listeners;
        struct listener *s, *tmp;
        struct sk_buff *skb_next, *skb_cur = skb;
        void *reply = genlmsg_data(genlhdr);
-       int rc, ret, delcount = 0;
+       int rc, delcount = 0;
 
        rc = genlmsg_end(skb, reply);
        if (rc < 0) {
                nlmsg_free(skb);
-               return rc;
+               return;
        }
 
        rc = 0;
        listeners = &per_cpu(listener_array, cpu);
        down_read(&listeners->sem);
-       list_for_each_entry_safe(s, tmp, &listeners->list, list) {
+       list_for_each_entry(s, &listeners->list, list) {
                skb_next = NULL;
                if (!list_is_last(&s->list, &listeners->list)) {
                        skb_next = skb_clone(skb_cur, GFP_KERNEL);
-                       if (!skb_next) {
-                               nlmsg_free(skb_cur);
-                               rc = -ENOMEM;
+                       if (!skb_next)
                                break;
-                       }
                }
-               ret = genlmsg_unicast(skb_cur, s->pid);
-               if (ret == -ECONNREFUSED) {
+               rc = genlmsg_unicast(skb_cur, s->pid);
+               if (rc == -ECONNREFUSED) {
                        s->valid = 0;
                        delcount++;
-                       rc = ret;
                }
                skb_cur = skb_next;
        }
        up_read(&listeners->sem);
 
+       if (skb_cur)
+               nlmsg_free(skb_cur);
+
        if (!delcount)
-               return rc;
+               return;
 
        /* Delete invalidated entries */
        down_write(&listeners->sem);
@@ -171,13 +170,12 @@ static int send_cpu_listeners(struct sk_buff *skb, unsigned int cpu)
                }
        }
        up_write(&listeners->sem);
-       return rc;
 }
 
 static int fill_pid(pid_t pid, struct task_struct *pidtsk,
                struct taskstats *stats)
 {
-       int rc;
+       int rc = 0;
        struct task_struct *tsk = pidtsk;
 
        if (!pidtsk) {
@@ -196,12 +194,10 @@ static int fill_pid(pid_t pid, struct task_struct *pidtsk,
         * Each accounting subsystem adds calls to its functions to
         * fill in relevant parts of struct taskstsats as follows
         *
-        *      rc = per-task-foo(stats, tsk);
-        *      if (rc)
-        *              goto err;
+        *      per-task-foo(stats, tsk);
         */
 
-       rc = delayacct_add_tsk(stats, tsk);
+       delayacct_add_tsk(stats, tsk);
        stats->version = TASKSTATS_VERSION;
 
        /* Define err: label here if needed */
index 05809c2e2fd601069bba39b591962e19d90d21e9..1d7dd6267c2de52206bb2f09ca981ff81db4b1a1 100644 (file)
@@ -84,7 +84,7 @@ typedef struct tvec_t_base_s tvec_base_t;
 
 tvec_base_t boot_tvec_bases;
 EXPORT_SYMBOL(boot_tvec_bases);
-static DEFINE_PER_CPU(tvec_base_t *, tvec_bases) = { &boot_tvec_bases };
+static DEFINE_PER_CPU(tvec_base_t *, tvec_bases) = &boot_tvec_bases;
 
 static inline void set_running_timer(tvec_base_t *base,
                                        struct timer_list *timer)
@@ -408,7 +408,7 @@ static int cascade(tvec_base_t *base, tvec_t *tv, int index)
  * This function cascades all vectors and executes all expired timer
  * vectors.
  */
-#define INDEX(N) (base->timer_jiffies >> (TVR_BITS + N * TVN_BITS)) & TVN_MASK
+#define INDEX(N) ((base->timer_jiffies >> (TVR_BITS + (N) * TVN_BITS)) & TVN_MASK)
 
 static inline void __run_timers(tvec_base_t *base)
 {
@@ -1324,46 +1324,19 @@ asmlinkage long sys_getpid(void)
 }
 
 /*
- * Accessing ->group_leader->real_parent is not SMP-safe, it could
- * change from under us. However, rather than getting any lock
- * we can use an optimistic algorithm: get the parent
- * pid, and go back and check that the parent is still
- * the same. If it has changed (which is extremely unlikely
- * indeed), we just try again..
- *
- * NOTE! This depends on the fact that even if we _do_
- * get an old value of "parent", we can happily dereference
- * the pointer (it was and remains a dereferencable kernel pointer
- * no matter what): we just can't necessarily trust the result
- * until we know that the parent pointer is valid.
- *
- * NOTE2: ->group_leader never changes from under us.
+ * Accessing ->real_parent is not SMP-safe, it could
+ * change from under us. However, we can use a stale
+ * value of ->real_parent under rcu_read_lock(), see
+ * release_task()->call_rcu(delayed_put_task_struct).
  */
 asmlinkage long sys_getppid(void)
 {
        int pid;
-       struct task_struct *me = current;
-       struct task_struct *parent;
 
-       parent = me->group_leader->real_parent;
-       for (;;) {
-               pid = parent->tgid;
-#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
-{
-               struct task_struct *old = parent;
+       rcu_read_lock();
+       pid = rcu_dereference(current->real_parent)->tgid;
+       rcu_read_unlock();
 
-               /*
-                * Make sure we read the pid before re-reading the
-                * parent pointer:
-                */
-               smp_rmb();
-               parent = me->group_leader->real_parent;
-               if (old != parent)
-                       continue;
-}
-#endif
-               break;
-       }
        return pid;
 }
 
@@ -1688,7 +1661,7 @@ static void __devinit migrate_timers(int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-static int __devinit timer_cpu_notify(struct notifier_block *self,
+static int __cpuinit timer_cpu_notify(struct notifier_block *self,
                                unsigned long action, void *hcpu)
 {
        long cpu = (long)hcpu;
@@ -1708,7 +1681,7 @@ static int __devinit timer_cpu_notify(struct notifier_block *self,
        return NOTIFY_OK;
 }
 
-static struct notifier_block __devinitdata timers_nb = {
+static struct notifier_block __cpuinitdata timers_nb = {
        .notifier_call  = timer_cpu_notify,
 };
 
index eebb1d83923515d02a848e69bf363b83d871ae67..835fe28b87a8325c1cfb691de03dd7e2615ea943 100644 (file)
@@ -68,7 +68,7 @@ struct workqueue_struct {
 
 /* All the per-cpu workqueues on the system, for hotplug cpu to add/remove
    threads to each one as cpus come/go. */
-static DEFINE_SPINLOCK(workqueue_lock);
+static DEFINE_MUTEX(workqueue_mutex);
 static LIST_HEAD(workqueues);
 
 static int singlethread_cpu;
@@ -93,9 +93,12 @@ static void __queue_work(struct cpu_workqueue_struct *cwq,
        spin_unlock_irqrestore(&cwq->lock, flags);
 }
 
-/*
- * Queue work on a workqueue. Return non-zero if it was successfully
- * added.
+/**
+ * queue_work - queue work on a workqueue
+ * @wq: workqueue to use
+ * @work: work to queue
+ *
+ * Returns non-zero if it was successfully added.
  *
  * We queue the work to the CPU it was submitted, but there is no
  * guarantee that it will be processed by that CPU.
@@ -128,6 +131,14 @@ static void delayed_work_timer_fn(unsigned long __data)
        __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work);
 }
 
+/**
+ * queue_delayed_work - queue work on a workqueue after delay
+ * @wq: workqueue to use
+ * @work: work to queue
+ * @delay: number of jiffies to wait before queueing
+ *
+ * Returns non-zero if it was successfully added.
+ */
 int fastcall queue_delayed_work(struct workqueue_struct *wq,
                        struct work_struct *work, unsigned long delay)
 {
@@ -150,6 +161,15 @@ int fastcall queue_delayed_work(struct workqueue_struct *wq,
 }
 EXPORT_SYMBOL_GPL(queue_delayed_work);
 
+/**
+ * queue_delayed_work_on - queue work on specific CPU after delay
+ * @cpu: CPU number to execute work on
+ * @wq: workqueue to use
+ * @work: work to queue
+ * @delay: number of jiffies to wait before queueing
+ *
+ * Returns non-zero if it was successfully added.
+ */
 int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
                        struct work_struct *work, unsigned long delay)
 {
@@ -275,8 +295,9 @@ static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
        }
 }
 
-/*
+/**
  * flush_workqueue - ensure that any scheduled work has run to completion.
+ * @wq: workqueue to flush
  *
  * Forces execution of the workqueue and blocks until its completion.
  * This is typically used in driver shutdown handlers.
@@ -299,10 +320,10 @@ void fastcall flush_workqueue(struct workqueue_struct *wq)
        } else {
                int cpu;
 
-               lock_cpu_hotplug();
+               mutex_lock(&workqueue_mutex);
                for_each_online_cpu(cpu)
                        flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, cpu));
-               unlock_cpu_hotplug();
+               mutex_unlock(&workqueue_mutex);
        }
 }
 EXPORT_SYMBOL_GPL(flush_workqueue);
@@ -350,8 +371,7 @@ struct workqueue_struct *__create_workqueue(const char *name,
        }
 
        wq->name = name;
-       /* We don't need the distraction of CPUs appearing and vanishing. */
-       lock_cpu_hotplug();
+       mutex_lock(&workqueue_mutex);
        if (singlethread) {
                INIT_LIST_HEAD(&wq->list);
                p = create_workqueue_thread(wq, singlethread_cpu);
@@ -360,9 +380,7 @@ struct workqueue_struct *__create_workqueue(const char *name,
                else
                        wake_up_process(p);
        } else {
-               spin_lock(&workqueue_lock);
                list_add(&wq->list, &workqueues);
-               spin_unlock(&workqueue_lock);
                for_each_online_cpu(cpu) {
                        p = create_workqueue_thread(wq, cpu);
                        if (p) {
@@ -372,7 +390,7 @@ struct workqueue_struct *__create_workqueue(const char *name,
                                destroy = 1;
                }
        }
-       unlock_cpu_hotplug();
+       mutex_unlock(&workqueue_mutex);
 
        /*
         * Was there any error during startup? If yes then clean up:
@@ -400,6 +418,12 @@ static void cleanup_workqueue_thread(struct workqueue_struct *wq, int cpu)
                kthread_stop(p);
 }
 
+/**
+ * destroy_workqueue - safely terminate a workqueue
+ * @wq: target workqueue
+ *
+ * Safely destroy a workqueue. All work currently pending will be done first.
+ */
 void destroy_workqueue(struct workqueue_struct *wq)
 {
        int cpu;
@@ -407,17 +431,15 @@ void destroy_workqueue(struct workqueue_struct *wq)
        flush_workqueue(wq);
 
        /* We don't need the distraction of CPUs appearing and vanishing. */
-       lock_cpu_hotplug();
+       mutex_lock(&workqueue_mutex);
        if (is_single_threaded(wq))
                cleanup_workqueue_thread(wq, singlethread_cpu);
        else {
                for_each_online_cpu(cpu)
                        cleanup_workqueue_thread(wq, cpu);
-               spin_lock(&workqueue_lock);
                list_del(&wq->list);
-               spin_unlock(&workqueue_lock);
        }
-       unlock_cpu_hotplug();
+       mutex_unlock(&workqueue_mutex);
        free_percpu(wq->cpu_wq);
        kfree(wq);
 }
@@ -425,18 +447,41 @@ EXPORT_SYMBOL_GPL(destroy_workqueue);
 
 static struct workqueue_struct *keventd_wq;
 
+/**
+ * schedule_work - put work task in global workqueue
+ * @work: job to be done
+ *
+ * This puts a job in the kernel-global workqueue.
+ */
 int fastcall schedule_work(struct work_struct *work)
 {
        return queue_work(keventd_wq, work);
 }
 EXPORT_SYMBOL(schedule_work);
 
+/**
+ * schedule_delayed_work - put work task in global workqueue after delay
+ * @work: job to be done
+ * @delay: number of jiffies to wait
+ *
+ * After waiting for a given time this puts a job in the kernel-global
+ * workqueue.
+ */
 int fastcall schedule_delayed_work(struct work_struct *work, unsigned long delay)
 {
        return queue_delayed_work(keventd_wq, work, delay);
 }
 EXPORT_SYMBOL(schedule_delayed_work);
 
+/**
+ * schedule_delayed_work_on - queue work in global workqueue on CPU after delay
+ * @cpu: cpu to use
+ * @work: job to be done
+ * @delay: number of jiffies to wait
+ *
+ * After waiting for a given time this puts a job in the kernel-global
+ * workqueue on the specified CPU.
+ */
 int schedule_delayed_work_on(int cpu,
                        struct work_struct *work, unsigned long delay)
 {
@@ -465,11 +510,13 @@ int schedule_on_each_cpu(void (*func)(void *info), void *info)
        if (!works)
                return -ENOMEM;
 
+       mutex_lock(&workqueue_mutex);
        for_each_online_cpu(cpu) {
                INIT_WORK(per_cpu_ptr(works, cpu), func, info);
                __queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu),
                                per_cpu_ptr(works, cpu));
        }
+       mutex_unlock(&workqueue_mutex);
        flush_workqueue(keventd_wq);
        free_percpu(works);
        return 0;
@@ -585,6 +632,7 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
 
        switch (action) {
        case CPU_UP_PREPARE:
+               mutex_lock(&workqueue_mutex);
                /* Create a new workqueue thread for it. */
                list_for_each_entry(wq, &workqueues, list) {
                        if (!create_workqueue_thread(wq, hotcpu)) {
@@ -603,6 +651,7 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
                        kthread_bind(cwq->thread, hotcpu);
                        wake_up_process(cwq->thread);
                }
+               mutex_unlock(&workqueue_mutex);
                break;
 
        case CPU_UP_CANCELED:
@@ -614,6 +663,15 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
                                     any_online_cpu(cpu_online_map));
                        cleanup_workqueue_thread(wq, hotcpu);
                }
+               mutex_unlock(&workqueue_mutex);
+               break;
+
+       case CPU_DOWN_PREPARE:
+               mutex_lock(&workqueue_mutex);
+               break;
+
+       case CPU_DOWN_FAILED:
+               mutex_unlock(&workqueue_mutex);
                break;
 
        case CPU_DEAD:
@@ -621,6 +679,7 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
                        cleanup_workqueue_thread(wq, hotcpu);
                list_for_each_entry(wq, &workqueues, list)
                        take_over_work(wq, hotcpu);
+               mutex_unlock(&workqueue_mutex);
                break;
        }
 
index 2b1530fc573bfaa4af0c7288eba1fce7af51513f..7f20e7b857cb559b7624d89ca4c52bbf86bc1b65 100644 (file)
@@ -50,10 +50,6 @@ static char *action_to_string(enum kobject_action action)
                return "offline";
        case KOBJ_ONLINE:
                return "online";
-       case KOBJ_DOCK:
-               return "dock";
-       case KOBJ_UNDOCK:
-               return "undock";
        default:
                return NULL;
        }
index 3d9c4dc965ed5d3f90173eff828da22fac0ccb4b..58c577dd82e5240e551d151b73ea31c55de8c309 100644 (file)
@@ -162,6 +162,7 @@ static void rwlock_bug(rwlock_t *lock, const char *msg)
 
 #define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)
 
+#if 0          /* __write_lock_debug() can lock up - maybe this can too? */
 static void __read_lock_debug(rwlock_t *lock)
 {
        int print_once = 1;
@@ -184,12 +185,12 @@ static void __read_lock_debug(rwlock_t *lock)
                }
        }
 }
+#endif
 
 void _raw_read_lock(rwlock_t *lock)
 {
        RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
-       if (unlikely(!__raw_read_trylock(&lock->raw_lock)))
-               __read_lock_debug(lock);
+       __raw_read_lock(&lock->raw_lock);
 }
 
 int _raw_read_trylock(rwlock_t *lock)
@@ -235,6 +236,7 @@ static inline void debug_write_unlock(rwlock_t *lock)
        lock->owner_cpu = -1;
 }
 
+#if 0          /* This can cause lockups */
 static void __write_lock_debug(rwlock_t *lock)
 {
        int print_once = 1;
@@ -257,12 +259,12 @@ static void __write_lock_debug(rwlock_t *lock)
                }
        }
 }
+#endif
 
 void _raw_write_lock(rwlock_t *lock)
 {
        debug_write_lock_before(lock);
-       if (unlikely(!__raw_write_trylock(&lock->raw_lock)))
-               __write_lock_debug(lock);
+       __raw_write_lock(&lock->raw_lock);
        debug_write_lock_after(lock);
 }
 
index 7f922dccf1a5dd618c8553f4cf70cbd1ad2fd3b4..fceb97c3aff77f96fb7097ee9de6143f44850992 100644 (file)
@@ -347,7 +347,10 @@ int zlib_inflate(z_streamp strm, int flush)
     static const unsigned short order[19] = /* permutation of code lengths */
         {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
 
-    if (strm == NULL || strm->state == NULL || strm->next_out == NULL ||
+    /* Do not check for strm->next_out == NULL here as ppc zImage
+       inflates to strm->next_out = 0 */
+
+    if (strm == NULL || strm->state == NULL ||
         (strm->next_in == NULL && strm->avail_in != 0))
         return Z_STREAM_ERROR;
 
index 60a5d55e51d949588cc60fb5ed8f138b37f372ad..168c78a121bb0f67835dabcae5e3f4edb74e8e7d 100644 (file)
@@ -73,7 +73,6 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
                file->f_ra.ra_pages = bdi->ra_pages * 2;
                break;
        case POSIX_FADV_WILLNEED:
-       case POSIX_FADV_NOREUSE:
                if (!mapping->a_ops->readpage) {
                        ret = -EINVAL;
                        break;
@@ -94,6 +93,8 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
                if (ret > 0)
                        ret = 0;
                break;
+       case POSIX_FADV_NOREUSE:
+               break;
        case POSIX_FADV_DONTNEED:
                if (!bdi_write_congested(mapping->backing_dev_info))
                        filemap_flush(mapping);
index d087fc3d3281cdeab1d751652b34702d65bf023e..b9a60c43b61a4649f19a418584af345088e74daf 100644 (file)
@@ -849,8 +849,6 @@ static void shrink_readahead_size_eio(struct file *filp,
                return;
 
        ra->ra_pages /= 4;
-       printk(KERN_WARNING "Reducing readahead size to %luK\n",
-                       ra->ra_pages << (PAGE_CACHE_SHIFT - 10));
 }
 
 /**
index 01c9fb97c619135edce3431d265e397f49113b58..c37319542b700a92339fdfc4427a5fc4d6fa2ee4 100644 (file)
@@ -52,6 +52,9 @@ static int __add_section(struct zone *zone, unsigned long phys_start_pfn)
        int nr_pages = PAGES_PER_SECTION;
        int ret;
 
+       if (pfn_valid(phys_start_pfn))
+               return -EEXIST;
+
        ret = sparse_add_one_section(zone, phys_start_pfn, nr_pages);
 
        if (ret < 0)
@@ -76,15 +79,22 @@ int __add_pages(struct zone *zone, unsigned long phys_start_pfn,
 {
        unsigned long i;
        int err = 0;
+       int start_sec, end_sec;
+       /* during initialize mem_map, align hot-added range to section */
+       start_sec = pfn_to_section_nr(phys_start_pfn);
+       end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);
 
-       for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) {
-               err = __add_section(zone, phys_start_pfn + i);
+       for (i = start_sec; i <= end_sec; i++) {
+               err = __add_section(zone, i << PFN_SECTION_SHIFT);
 
-               /* We want to keep adding the rest of the
-                * sections if the first ones already exist
+               /*
+                * EEXIST is finally dealed with by ioresource collision
+                * check. see add_memory() => register_memory_resource()
+                * Warning will be printed if there is collision.
                 */
                if (err && (err != -EEXIST))
                        break;
+               err = 0;
        }
 
        return err;
@@ -156,7 +166,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
        res.flags = IORESOURCE_MEM; /* we just need system ram */
        section_end = res.end;
 
-       while (find_next_system_ram(&res) >= 0) {
+       while ((res.start < res.end) && (find_next_system_ram(&res) >= 0)) {
                start_pfn = (unsigned long)(res.start >> PAGE_SHIFT);
                nr_pages = (unsigned long)
                            ((res.end + 1 - res.start) >> PAGE_SHIFT);
@@ -213,10 +223,9 @@ static void rollback_node_hotadd(int nid, pg_data_t *pgdat)
 }
 
 /* add this memory to iomem resource */
-static void register_memory_resource(u64 start, u64 size)
+static struct resource *register_memory_resource(u64 start, u64 size)
 {
        struct resource *res;
-
        res = kzalloc(sizeof(struct resource), GFP_KERNEL);
        BUG_ON(!res);
 
@@ -228,7 +237,18 @@ static void register_memory_resource(u64 start, u64 size)
                printk("System RAM resource %llx - %llx cannot be added\n",
                (unsigned long long)res->start, (unsigned long long)res->end);
                kfree(res);
+               res = NULL;
        }
+       return res;
+}
+
+static void release_memory_resource(struct resource *res)
+{
+       if (!res)
+               return;
+       release_resource(res);
+       kfree(res);
+       return;
 }
 
 
@@ -237,8 +257,13 @@ int add_memory(int nid, u64 start, u64 size)
 {
        pg_data_t *pgdat = NULL;
        int new_pgdat = 0;
+       struct resource *res;
        int ret;
 
+       res = register_memory_resource(start, size);
+       if (!res)
+               return -EEXIST;
+
        if (!node_online(nid)) {
                pgdat = hotadd_new_pgdat(nid, start);
                if (!pgdat)
@@ -268,14 +293,13 @@ int add_memory(int nid, u64 start, u64 size)
                BUG_ON(ret);
        }
 
-       /* register this memory as resource */
-       register_memory_resource(start, size);
-
        return ret;
 error:
        /* rollback pgdat allocation and others */
        if (new_pgdat)
                rollback_node_hotadd(nid, pgdat);
+       if (res)
+               release_memory_resource(res);
 
        return ret;
 }
index 0f20843beffdb504574dc471bfaacf12abfd902d..21ba0603570001bccb5cf97e3a1bf2adbb3a470d 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1106,7 +1106,7 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
 
 #endif
 
-static int __devinit cpuup_callback(struct notifier_block *nfb,
+static int __cpuinit cpuup_callback(struct notifier_block *nfb,
                                    unsigned long action, void *hcpu)
 {
        long cpu = (long)hcpu;
@@ -3224,7 +3224,7 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 EXPORT_SYMBOL(kmem_cache_alloc);
 
 /**
- * kmem_cache_alloc - Allocate an object. The memory is set to zero.
+ * kmem_cache_zalloc - Allocate an object. The memory is set to zero.
  * @cache: The cache to allocate from.
  * @flags: See kmalloc().
  *
index 8fd095c4ae51b00b314e732ac9ea5547a5cd26b2..687686a61f7cb81cc75cd65a636ade65eb00d08d 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -54,6 +54,26 @@ void put_page(struct page *page)
 }
 EXPORT_SYMBOL(put_page);
 
+/**
+ * put_pages_list(): release a list of pages
+ *
+ * Release a list of pages which are strung together on page.lru.  Currently
+ * used by read_cache_pages() and related error recovery code.
+ *
+ * @pages: list of pages threaded on page->lru
+ */
+void put_pages_list(struct list_head *pages)
+{
+       while (!list_empty(pages)) {
+               struct page *victim;
+
+               victim = list_entry(pages->prev, struct page, lru);
+               list_del(&victim->lru);
+               page_cache_release(victim);
+       }
+}
+EXPORT_SYMBOL(put_pages_list);
+
 /*
  * Writeback is about to end against a page which has been marked for immediate
  * reclaim.  If it still appears to be reclaimable, move it to the tail of the
index 3f95b0886a6a659afd540ea8cb9f12011a03a3c5..91fe5f53ff112377755054d16ff82cd599dd54a5 100644 (file)
@@ -507,7 +507,7 @@ err_out:
        goto out;
 }
 
-void __exit atm_proc_exit(void)
+void atm_proc_exit(void)
 {
        atm_proc_dirs_remove();
 }
index f55ef682ef846e979b7e1b24569399a7c2fbd7da..b1211d5342f6cac5f43926a2c6a39f1651cb6761 100644 (file)
@@ -386,12 +386,17 @@ void br_features_recompute(struct net_bridge *br)
                        checksum = 0;
 
                if (feature & NETIF_F_GSO)
-                       feature |= NETIF_F_TSO;
+                       feature |= NETIF_F_GSO_SOFTWARE;
                feature |= NETIF_F_GSO;
 
                features &= feature;
        }
 
+       if (!(checksum & NETIF_F_ALL_CSUM))
+               features &= ~NETIF_F_SG;
+       if (!(features & NETIF_F_SG))
+               features &= ~NETIF_F_GSO_MASK;
+
        br->dev->features = features | checksum | NETIF_F_LLTX |
                            NETIF_F_GSO_ROBUST;
 }
index cbc8a389a0a8ceb4063661eb42239c0cfd4a0b52..05b3de88824362fd797c1fe3309567520cc163df 100644 (file)
@@ -61,6 +61,9 @@ static int brnf_filter_vlan_tagged = 1;
 #define brnf_filter_vlan_tagged 1
 #endif
 
+int brnf_deferred_hooks;
+EXPORT_SYMBOL_GPL(brnf_deferred_hooks);
+
 static __be16 inline vlan_proto(const struct sk_buff *skb)
 {
        return vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
@@ -890,6 +893,8 @@ static unsigned int ip_sabotage_out(unsigned int hook, struct sk_buff **pskb,
                                return NF_ACCEPT;
                        else if (ip->version == 6 && !brnf_call_ip6tables)
                                return NF_ACCEPT;
+                       else if (!brnf_deferred_hooks)
+                               return NF_ACCEPT;
 #endif
                        if (hook == NF_IP_POST_ROUTING)
                                return NF_ACCEPT;
index 06abb6634f5be777a374c389b1d4778cb79ee210..53086fb75089346c0fd8658a0d2edcc41d9324ce 100644 (file)
@@ -85,7 +85,7 @@ void br_ifinfo_notify(int event, struct net_bridge_port *port)
                goto err_out;
 
        err = br_fill_ifinfo(skb, port, current->pid, 0, event, 0);
-       if (err)
+       if (err < 0)
                goto err_kfree;
 
        NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
index 02693a230dc1faae5d3252f62c4f9a2334ea3f00..9f950db3b76f5135cbb7e1ca7aca9022e5fbcc30 100644 (file)
@@ -74,6 +74,9 @@ static void ulog_send(unsigned int nlgroup)
        if (timer_pending(&ub->timer))
                del_timer(&ub->timer);
 
+       if (!ub->skb)
+               return;
+
        /* last nlmsg needs NLMSG_DONE */
        if (ub->qlen > 1)
                ub->lastnlh->nlmsg_type = NLMSG_DONE;
index e9bd2467d5a9362aec0b1488d4e4a58962a4b890..2645ba428d4890a4b769c8771ccc99e499da4b6e 100644 (file)
@@ -7,7 +7,7 @@ obj-y := sock.o request_sock.o skbuff.o iovec.o datagram.o stream.o scm.o \
 
 obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
 
-obj-y               += dev.o ethtool.o dev_mcast.o dst.o \
+obj-y               += dev.o ethtool.o dev_mcast.o dst.o netevent.o \
                        neighbour.o rtnetlink.o utils.o link_watch.o filter.o
 
 obj-$(CONFIG_XFRM) += flow.o
index 4d2b5167d7f5f7b3088d1b12d7d7f5e2945fb11a..d4a1ec3bded5f6afa92c0cbb860101b509f0f338 100644 (file)
 #include <linux/audit.h>
 #include <linux/dmaengine.h>
 #include <linux/err.h>
+#include <linux/ctype.h>
 
 /*
  *     The list of packet types we will receive (as opposed to discard)
@@ -632,14 +633,22 @@ struct net_device * dev_get_by_flags(unsigned short if_flags, unsigned short mas
  *     @name: name string
  *
  *     Network device names need to be valid file names to
- *     to allow sysfs to work
+ *     to allow sysfs to work.  We also disallow any kind of
+ *     whitespace.
  */
 int dev_valid_name(const char *name)
 {
-       return !(*name == '\0' 
-                || !strcmp(name, ".")
-                || !strcmp(name, "..")
-                || strchr(name, '/'));
+       if (*name == '\0')
+               return 0;
+       if (!strcmp(name, ".") || !strcmp(name, ".."))
+               return 0;
+
+       while (*name) {
+               if (*name == '/' || isspace(*name))
+                       return 0;
+               name++;
+       }
+       return 1;
 }
 
 /**
@@ -1166,11 +1175,6 @@ int skb_checksum_help(struct sk_buff *skb, int inward)
                goto out_set_summed;
 
        if (unlikely(skb_shinfo(skb)->gso_size)) {
-               static int warned;
-
-               WARN_ON(!warned);
-               warned = 1;
-
                /* Let GSO fix up the checksum. */
                goto out_set_summed;
        }
@@ -1220,11 +1224,6 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
        __skb_pull(skb, skb->mac_len);
 
        if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
-               static int warned;
-
-               WARN_ON(!warned);
-               warned = 1;
-
                if (skb_header_cloned(skb) &&
                    (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
                        return ERR_PTR(err);
@@ -1629,26 +1628,10 @@ static inline struct net_device *skb_bond(struct sk_buff *skb)
        struct net_device *dev = skb->dev;
 
        if (dev->master) {
-               /*
-                * On bonding slaves other than the currently active
-                * slave, suppress duplicates except for 802.3ad
-                * ETH_P_SLOW and alb non-mcast/bcast.
-                */
-               if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
-                       if (dev->master->priv_flags & IFF_MASTER_ALB) {
-                               if (skb->pkt_type != PACKET_BROADCAST &&
-                                   skb->pkt_type != PACKET_MULTICAST)
-                                       goto keep;
-                       }
-
-                       if (dev->master->priv_flags & IFF_MASTER_8023AD &&
-                           skb->protocol == __constant_htons(ETH_P_SLOW))
-                               goto keep;
-               
+               if (skb_bond_should_drop(skb)) {
                        kfree_skb(skb);
                        return NULL;
                }
-keep:
                skb->dev = dev->master;
        }
 
@@ -3429,12 +3412,9 @@ static void net_dma_rebalance(void)
        unsigned int cpu, i, n;
        struct dma_chan *chan;
 
-       lock_cpu_hotplug();
-
        if (net_dma_count == 0) {
                for_each_online_cpu(cpu)
-                       rcu_assign_pointer(per_cpu(softnet_data.net_dma, cpu), NULL);
-               unlock_cpu_hotplug();
+                       rcu_assign_pointer(per_cpu(softnet_data, cpu).net_dma, NULL);
                return;
        }
 
@@ -3447,15 +3427,13 @@ static void net_dma_rebalance(void)
                   + (i < (num_online_cpus() % net_dma_count) ? 1 : 0));
 
                while(n) {
-                       per_cpu(softnet_data.net_dma, cpu) = chan;
+                       per_cpu(softnet_data, cpu).net_dma = chan;
                        cpu = next_cpu(cpu, cpu_online_map);
                        n--;
                }
                i++;
        }
        rcu_read_unlock();
-
-       unlock_cpu_hotplug();
 }
 
 /**
index 470c05bc4cb2bd513f1ba37002a81f46266c8905..1a5e49da0e77bdaaaaebf5369a97153ff75f4918 100644 (file)
@@ -95,12 +95,11 @@ static void dst_run_gc(unsigned long dummy)
                dst_gc_timer_inc = DST_GC_INC;
                dst_gc_timer_expires = DST_GC_MIN;
        }
-       dst_gc_timer.expires = jiffies + dst_gc_timer_expires;
 #if RT_CACHE_DEBUG >= 2
        printk("dst_total: %d/%d %ld\n",
               atomic_read(&dst_total), delayed,  dst_gc_timer_expires);
 #endif
-       add_timer(&dst_gc_timer);
+       mod_timer(&dst_gc_timer, jiffies + dst_gc_timer_expires);
 
 out:
        spin_unlock(&dst_lock);
index 7ad681f5e71269c228112b539c6359c69d37c1f4..5130d2efdbbeaed9ce896782fe7f867ab03d6d90 100644 (file)
@@ -29,6 +29,7 @@
 #include <net/neighbour.h>
 #include <net/dst.h>
 #include <net/sock.h>
+#include <net/netevent.h>
 #include <linux/rtnetlink.h>
 #include <linux/random.h>
 #include <linux/string.h>
@@ -754,6 +755,7 @@ static void neigh_timer_handler(unsigned long arg)
                        neigh->nud_state = NUD_STALE;
                        neigh->updated = jiffies;
                        neigh_suspect(neigh);
+                       notify = 1;
                }
        } else if (state & NUD_DELAY) {
                if (time_before_eq(now, 
@@ -762,6 +764,7 @@ static void neigh_timer_handler(unsigned long arg)
                        neigh->nud_state = NUD_REACHABLE;
                        neigh->updated = jiffies;
                        neigh_connect(neigh);
+                       notify = 1;
                        next = neigh->confirmed + neigh->parms->reachable_time;
                } else {
                        NEIGH_PRINTK2("neigh %p is probed.\n", neigh);
@@ -819,6 +822,8 @@ static void neigh_timer_handler(unsigned long arg)
 out:
                write_unlock(&neigh->lock);
        }
+       if (notify)
+               call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
 
 #ifdef CONFIG_ARPD
        if (notify && neigh->parms->app_probes)
@@ -926,9 +931,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
 {
        u8 old;
        int err;
-#ifdef CONFIG_ARPD
        int notify = 0;
-#endif
        struct net_device *dev;
        int update_isrouter = 0;
 
@@ -948,9 +951,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
                        neigh_suspect(neigh);
                neigh->nud_state = new;
                err = 0;
-#ifdef CONFIG_ARPD
                notify = old & NUD_VALID;
-#endif
                goto out;
        }
 
@@ -1022,9 +1023,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
                if (!(new & NUD_CONNECTED))
                        neigh->confirmed = jiffies -
                                      (neigh->parms->base_reachable_time << 1);
-#ifdef CONFIG_ARPD
                notify = 1;
-#endif
        }
        if (new == old)
                goto out;
@@ -1056,6 +1055,9 @@ out:
                        (neigh->flags & ~NTF_ROUTER);
        }
        write_unlock_bh(&neigh->lock);
+
+       if (notify)
+               call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
 #ifdef CONFIG_ARPD
        if (notify && neigh->parms->app_probes)
                neigh_app_notify(neigh);
diff --git a/net/core/netevent.c b/net/core/netevent.c
new file mode 100644 (file)
index 0000000..35d02c3
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ *     Network event notifiers
+ *
+ *     Authors:
+ *      Tom Tucker             <tom@opengridcomputing.com>
+ *      Steve Wise             <swise@opengridcomputing.com>
+ *
+ *     This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ *
+ *     Fixes:
+ */
+
+#include <linux/rtnetlink.h>
+#include <linux/notifier.h>
+
+static ATOMIC_NOTIFIER_HEAD(netevent_notif_chain);
+
+/**
+ *     register_netevent_notifier - register a netevent notifier block
+ *     @nb: notifier
+ *
+ *     Register a notifier to be called when a netevent occurs.
+ *     The notifier passed is linked into the kernel structures and must
+ *     not be reused until it has been unregistered. A negative errno code
+ *     is returned on a failure.
+ */
+int register_netevent_notifier(struct notifier_block *nb)
+{
+       int err;
+
+       err = atomic_notifier_chain_register(&netevent_notif_chain, nb);
+       return err;
+}
+
+/**
+ *     netevent_unregister_notifier - unregister a netevent notifier block
+ *     @nb: notifier
+ *
+ *     Unregister a notifier previously registered by
+ *     register_neigh_notifier(). The notifier is unlinked into the
+ *     kernel structures and may then be reused. A negative errno code
+ *     is returned on a failure.
+ */
+
+int unregister_netevent_notifier(struct notifier_block *nb)
+{
+       return atomic_notifier_chain_unregister(&netevent_notif_chain, nb);
+}
+
+/**
+ *     call_netevent_notifiers - call all netevent notifier blocks
+ *      @val: value passed unmodified to notifier function
+ *      @v:   pointer passed unmodified to notifier function
+ *
+ *     Call all neighbour notifier blocks.  Parameters and return value
+ *     are as for notifier_call_chain().
+ */
+
+int call_netevent_notifiers(unsigned long val, void *v)
+{
+       return atomic_notifier_call_chain(&netevent_notif_chain, val, v);
+}
+
+EXPORT_SYMBOL_GPL(register_netevent_notifier);
+EXPORT_SYMBOL_GPL(unregister_netevent_notifier);
+EXPORT_SYMBOL_GPL(call_netevent_notifiers);
index 67ed14ddabd2b83a32bef68b002c67298bcc2f42..6a7320b39ed0c21fd104afc543e961e758f993d3 100644 (file)
@@ -2149,6 +2149,8 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
        skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
        skb->dev = odev;
        skb->pkt_type = PACKET_HOST;
+       skb->nh.iph = iph;
+       skb->h.uh = udph;
 
        if (pkt_dev->nfrags <= 0)
                pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
@@ -2460,6 +2462,8 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
        skb->protocol = protocol;
        skb->dev = odev;
        skb->pkt_type = PACKET_HOST;
+       skb->nh.ipv6h = iph;
+       skb->h.uh = udph;
 
        if (pkt_dev->nfrags <= 0)
                pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
index 20e5bb73f147b6c0f6d84d02e562560e8b500f63..30cc1ba6ed5c46259bc939e425b88b0402e2a436 100644 (file)
@@ -394,6 +394,9 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
        }
 
        if (ida[IFLA_ADDRESS - 1]) {
+               struct sockaddr *sa;
+               int len;
+
                if (!dev->set_mac_address) {
                        err = -EOPNOTSUPP;
                        goto out;
@@ -405,7 +408,17 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
                if (ida[IFLA_ADDRESS - 1]->rta_len != RTA_LENGTH(dev->addr_len))
                        goto out;
 
-               err = dev->set_mac_address(dev, RTA_DATA(ida[IFLA_ADDRESS - 1]));
+               len = sizeof(sa_family_t) + dev->addr_len;
+               sa = kmalloc(len, GFP_KERNEL);
+               if (!sa) {
+                       err = -ENOMEM;
+                       goto out;
+               }
+               sa->sa_family = dev->type;
+               memcpy(sa->sa_data, RTA_DATA(ida[IFLA_ADDRESS - 1]),
+                      dev->addr_len);
+               err = dev->set_mac_address(dev, sa);
+               kfree(sa);
                if (err)
                        goto out;
                send_addr_notify = 1;
index 476aa397850451555cd1e88661f38200b42a4fb7..c54f3664bce5b0e868928df71c392dc18f89f2a0 100644 (file)
 static kmem_cache_t *skbuff_head_cache __read_mostly;
 static kmem_cache_t *skbuff_fclone_cache __read_mostly;
 
-/*
- * lockdep: lock class key used by skb_queue_head_init():
- */
-struct lock_class_key skb_queue_lock_key;
-
-EXPORT_SYMBOL(skb_queue_lock_key);
-
 /*
  *     Keep out-of-line to prevent kernel bloat.
  *     __builtin_return_address is not used because it is not always
@@ -256,6 +249,31 @@ nodata:
        goto out;
 }
 
+/**
+ *     __netdev_alloc_skb - allocate an skbuff for rx on a specific device
+ *     @dev: network device to receive on
+ *     @length: length to allocate
+ *     @gfp_mask: get_free_pages mask, passed to alloc_skb
+ *
+ *     Allocate a new &sk_buff and assign it a usage count of one. The
+ *     buffer has unspecified headroom built in. Users should allocate
+ *     the headroom they think they need without accounting for the
+ *     built in space. The built in space is used for optimisations.
+ *
+ *     %NULL is returned if there is no free memory.
+ */
+struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
+               unsigned int length, gfp_t gfp_mask)
+{
+       struct sk_buff *skb;
+
+       skb = alloc_skb(length + NET_SKB_PAD, gfp_mask);
+       if (likely(skb)) {
+               skb_reserve(skb, NET_SKB_PAD);
+               skb->dev = dev;
+       }
+       return skb;
+}
 
 static void skb_drop_list(struct sk_buff **listp)
 {
@@ -846,7 +864,11 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
            unlikely((err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))))
                return err;
 
-       for (i = 0; i < nfrags; i++) {
+       i = 0;
+       if (offset >= len)
+               goto drop_pages;
+
+       for (; i < nfrags; i++) {
                int end = offset + skb_shinfo(skb)->frags[i].size;
 
                if (end < len) {
@@ -854,9 +876,9 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
                        continue;
                }
 
-               if (len > offset)
-                       skb_shinfo(skb)->frags[i++].size = len - offset;
+               skb_shinfo(skb)->frags[i++].size = len - offset;
 
+drop_pages:
                skb_shinfo(skb)->nr_frags = i;
 
                for (; i < nfrags; i++)
@@ -864,7 +886,7 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
 
                if (skb_shinfo(skb)->frag_list)
                        skb_drop_fraglist(skb);
-               break;
+               goto done;
        }
 
        for (fragp = &skb_shinfo(skb)->frag_list; (frag = *fragp);
@@ -879,6 +901,7 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
                                return -ENOMEM;
 
                        nfrag->next = frag->next;
+                       kfree_skb(frag);
                        frag = nfrag;
                        *fragp = frag;
                }
@@ -897,6 +920,7 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
                break;
        }
 
+done:
        if (len > skb_headlen(skb)) {
                skb->data_len -= skb->len - len;
                skb->len       = len;
@@ -2042,6 +2066,7 @@ EXPORT_SYMBOL(__kfree_skb);
 EXPORT_SYMBOL(kfree_skb);
 EXPORT_SYMBOL(__pskb_pull_tail);
 EXPORT_SYMBOL(__alloc_skb);
+EXPORT_SYMBOL(__netdev_alloc_skb);
 EXPORT_SYMBOL(pskb_copy);
 EXPORT_SYMBOL(pskb_expand_head);
 EXPORT_SYMBOL(skb_checksum);
index 4f96f389243d7d6322288609f6477c74eab5ac09..e31c90e055941e73f020e07adcd92360e81960da 100644 (file)
@@ -130,12 +130,13 @@ void __init net_random_init(void)
 static int net_random_reseed(void)
 {
        int i;
-       unsigned long seed[NR_CPUS];
+       unsigned long seed;
 
-       get_random_bytes(seed, sizeof(seed));
        for_each_possible_cpu(i) {
                struct nrnd_state *state = &per_cpu(net_rand_state,i);
-               __net_srandom(state, seed[i]);
+
+               get_random_bytes(&seed, sizeof(seed));
+               __net_srandom(state, seed);
        }
        return 0;
 }
index d2bc72d318f7bdb41dc4ab9c1ab3c08978c5af4e..de0bde4b51dd5d0bd449e434d70d8f6a7e6d031b 100644 (file)
@@ -82,6 +82,7 @@
 #include <linux/init.h>                        /* for __init */
 #include <linux/if_arp.h>              /* ARPHRD_ETHER */
 #include <linux/etherdevice.h>         /* compare_ether_addr */
+#include <linux/interrupt.h>
 
 #include <linux/wireless.h>            /* Pretty obvious */
 #include <net/iw_handler.h>            /* New driver API */
@@ -1842,6 +1843,18 @@ int wireless_rtnetlink_set(struct net_device *   dev,
  */
 
 #ifdef WE_EVENT_RTNETLINK
+static struct sk_buff_head wireless_nlevent_queue;
+
+static void wireless_nlevent_process(unsigned long data)
+{
+       struct sk_buff *skb;
+
+       while ((skb = skb_dequeue(&wireless_nlevent_queue)))
+               netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_ATOMIC);
+}
+
+static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0);
+
 /* ---------------------------------------------------------------- */
 /*
  * Fill a rtnetlink message with our event data.
@@ -1904,8 +1917,17 @@ static inline void rtmsg_iwinfo(struct net_device *      dev,
                return;
        }
        NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
-       netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_ATOMIC);
+       skb_queue_tail(&wireless_nlevent_queue, skb);
+       tasklet_schedule(&wireless_nlevent_tasklet);
+}
+
+static int __init wireless_nlevent_init(void)
+{
+       skb_queue_head_init(&wireless_nlevent_queue);
+       return 0;
 }
+
+subsys_initcall(wireless_nlevent_init);
 #endif /* WE_EVENT_RTNETLINK */
 
 /* ---------------------------------------------------------------- */
index 9f3d4d7cd0bfa6085cfce0410fb17662bc82a983..610c722ac27f09a7308df128c56caecc0180bb4b 100644 (file)
@@ -230,7 +230,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
        ipv6_addr_copy(&np->saddr, saddr);
        inet->rcv_saddr = LOOPBACK4_IPV6;
 
-       ip6_dst_store(sk, dst, NULL);
+       __ip6_dst_store(sk, dst, NULL);
 
        icsk->icsk_ext_hdr_len = 0;
        if (np->opt != NULL)
@@ -863,7 +863,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
         * comment in that function for the gory details. -acme
         */
 
-       ip6_dst_store(newsk, dst, NULL);
+       __ip6_dst_store(newsk, dst, NULL);
        newsk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM |
                                                      NETIF_F_TSO);
        newdp6 = (struct dccp6_sock *)newsk;
index 1355614ec11b90567f50d0073555a0aa1d57c185..743e9fcf7c5ae2f4697f5a796be7e69e319868ae 100644 (file)
@@ -925,8 +925,13 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
                for(dev_out = dev_base; dev_out; dev_out = dev_out->next) {
                        if (!dev_out->dn_ptr)
                                continue;
-                       if (dn_dev_islocal(dev_out, oldflp->fld_src))
-                               break;
+                       if (!dn_dev_islocal(dev_out, oldflp->fld_src))
+                               continue;
+                       if ((dev_out->flags & IFF_LOOPBACK) &&
+                           oldflp->fld_dst &&
+                           !dn_dev_islocal(dev_out, oldflp->fld_dst))
+                               continue;
+                       break;
                }
                read_unlock(&dev_base_lock);
                if (dev_out == NULL)
index dbb08528ddf5ef3f974ad06f2950552e55c762a6..f7e84e9d13ad347d7e56a5d9db76b4d70744d8c7 100644 (file)
@@ -58,6 +58,7 @@ config IEEE80211_CRYPT_TKIP
        depends on IEEE80211 && NET_RADIO
        select CRYPTO
        select CRYPTO_MICHAEL_MIC
+       select CRC32
        ---help---
        Include software based cipher suites in support of IEEE 802.11i
        (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with TKIP enabled
index ebc33ca6e6920d19b870d8b24e0e657356bcc7b3..4cef39e171d007cf4570f28ae793070f5ccaf5ff 100644 (file)
@@ -116,6 +116,16 @@ ieee80211softmac_auth_queue(void *data)
        kfree(auth);
 }
 
+/* Sends a response to an auth challenge (for shared key auth). */
+static void
+ieee80211softmac_auth_challenge_response(void *_aq)
+{
+       struct ieee80211softmac_auth_queue_item *aq = _aq;
+
+       /* Send our response */
+       ieee80211softmac_send_mgt_frame(aq->mac, aq->net, IEEE80211_STYPE_AUTH, aq->state);
+}
+
 /* Handle the auth response from the AP
  * This should be registered with ieee80211 as handle_auth 
  */
@@ -197,24 +207,30 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
                case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE:
                        /* Check to make sure we have a challenge IE */
                        data = (u8 *)auth->info_element;
-                       if(*data++ != MFIE_TYPE_CHALLENGE){
+                       if (*data++ != MFIE_TYPE_CHALLENGE) {
                                printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n");
                                break;  
                        }
                        /* Save the challenge */
                        spin_lock_irqsave(&mac->lock, flags);
                        net->challenge_len = *data++;   
-                       if(net->challenge_len > WLAN_AUTH_CHALLENGE_LEN)
+                       if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN)
                                net->challenge_len = WLAN_AUTH_CHALLENGE_LEN;
-                       if(net->challenge != NULL)
+                       if (net->challenge != NULL)
                                kfree(net->challenge);
                        net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC);
                        memcpy(net->challenge, data, net->challenge_len);
                        aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; 
-                       spin_unlock_irqrestore(&mac->lock, flags);
 
-                       /* Send our response */
-                       ieee80211softmac_send_mgt_frame(mac, aq->net, IEEE80211_STYPE_AUTH, aq->state);
+                       /* We reuse the work struct from the auth request here.
+                        * It is safe to do so as each one is per-request, and
+                        * at this point (dealing with authentication response)
+                        * we have obviously already sent the initial auth
+                        * request. */
+                       cancel_delayed_work(&aq->work);
+                       INIT_WORK(&aq->work, &ieee80211softmac_auth_challenge_response, (void *)aq);
+                       schedule_work(&aq->work);
+                       spin_unlock_irqrestore(&mac->lock, flags);
                        return 0;
                case IEEE80211SOFTMAC_AUTH_SHARED_PASS:
                        kfree(net->challenge);
index 9be53a8e72c338d7865dadcc747d6003cd1c8b20..51738000f3dc4c12c5db72063548b8535f7517e6 100644 (file)
@@ -159,7 +159,7 @@ void free_fib_info(struct fib_info *fi)
 
 void fib_release_info(struct fib_info *fi)
 {
-       write_lock(&fib_info_lock);
+       write_lock_bh(&fib_info_lock);
        if (fi && --fi->fib_treeref == 0) {
                hlist_del(&fi->fib_hash);
                if (fi->fib_prefsrc)
@@ -172,7 +172,7 @@ void fib_release_info(struct fib_info *fi)
                fi->fib_dead = 1;
                fib_info_put(fi);
        }
-       write_unlock(&fib_info_lock);
+       write_unlock_bh(&fib_info_lock);
 }
 
 static __inline__ int nh_comp(const struct fib_info *fi, const struct fib_info *ofi)
@@ -598,7 +598,7 @@ static void fib_hash_move(struct hlist_head *new_info_hash,
        unsigned int old_size = fib_hash_size;
        unsigned int i, bytes;
 
-       write_lock(&fib_info_lock);
+       write_lock_bh(&fib_info_lock);
        old_info_hash = fib_info_hash;
        old_laddrhash = fib_info_laddrhash;
        fib_hash_size = new_size;
@@ -639,7 +639,7 @@ static void fib_hash_move(struct hlist_head *new_info_hash,
        }
        fib_info_laddrhash = new_laddrhash;
 
-       write_unlock(&fib_info_lock);
+       write_unlock_bh(&fib_info_lock);
 
        bytes = old_size * sizeof(struct hlist_head *);
        fib_hash_free(old_info_hash, bytes);
@@ -820,7 +820,7 @@ link_it:
 
        fi->fib_treeref++;
        atomic_inc(&fi->fib_clntref);
-       write_lock(&fib_info_lock);
+       write_lock_bh(&fib_info_lock);
        hlist_add_head(&fi->fib_hash,
                       &fib_info_hash[fib_info_hashfn(fi)]);
        if (fi->fib_prefsrc) {
@@ -839,7 +839,7 @@ link_it:
                head = &fib_info_devhash[hash];
                hlist_add_head(&nh->nh_hash, head);
        } endfor_nexthops(fi)
-       write_unlock(&fib_info_lock);
+       write_unlock_bh(&fib_info_lock);
        return fi;
 
 err_inval:
index 9f4b752f5a337e7dfae09970d5112dc4bc6dc54b..8e8117c19e4db24ad74d55cfe540fb0d4c9816f3 100644 (file)
@@ -1793,29 +1793,35 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
        struct in_device *in_dev;
        u32 group = imr->imr_multiaddr.s_addr;
        u32 ifindex;
+       int ret = -EADDRNOTAVAIL;
 
        rtnl_lock();
        in_dev = ip_mc_find_dev(imr);
-       if (!in_dev) {
-               rtnl_unlock();
-               return -ENODEV;
-       }
        ifindex = imr->imr_ifindex;
        for (imlp = &inet->mc_list; (iml = *imlp) != NULL; imlp = &iml->next) {
-               if (iml->multi.imr_multiaddr.s_addr == group &&
-                   iml->multi.imr_ifindex == ifindex) {
-                       (void) ip_mc_leave_src(sk, iml, in_dev);
+               if (iml->multi.imr_multiaddr.s_addr != group)
+                       continue;
+               if (ifindex) {
+                       if (iml->multi.imr_ifindex != ifindex)
+                               continue;
+               } else if (imr->imr_address.s_addr && imr->imr_address.s_addr !=
+                               iml->multi.imr_address.s_addr)
+                       continue;
+
+               (void) ip_mc_leave_src(sk, iml, in_dev);
 
-                       *imlp = iml->next;
+               *imlp = iml->next;
 
+               if (in_dev)
                        ip_mc_dec_group(in_dev, group);
-                       rtnl_unlock();
-                       sock_kfree_s(sk, iml, sizeof(*iml));
-                       return 0;
-               }
+               rtnl_unlock();
+               sock_kfree_s(sk, iml, sizeof(*iml));
+               return 0;
        }
+       if (!in_dev)
+               ret = -ENODEV;
        rtnl_unlock();
-       return -EADDRNOTAVAIL;
+       return ret;
 }
 
 int ip_mc_source(int add, int omode, struct sock *sk, struct
@@ -2199,13 +2205,13 @@ void ip_mc_drop_socket(struct sock *sk)
                struct in_device *in_dev;
                inet->mc_list = iml->next;
 
-               if ((in_dev = inetdev_by_index(iml->multi.imr_ifindex)) != NULL) {
-                       (void) ip_mc_leave_src(sk, iml, in_dev);
+               in_dev = inetdev_by_index(iml->multi.imr_ifindex);
+               (void) ip_mc_leave_src(sk, iml, in_dev);
+               if (in_dev != NULL) {
                        ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr);
                        in_dev_put(in_dev);
                }
                sock_kfree_s(sk, iml, sizeof(*iml));
-
        }
        rtnl_unlock();
 }
index 184c78ca79e65e895800153e351ca4fbaa7e7e60..212734ca238fa88e2bcee0eb43e13c246a5f9720 100644 (file)
@@ -429,7 +429,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
        }
 
        /* Remove any debris in the socket control block */
-       memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
+       memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
 
        return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL,
                       ip_rcv_finish);
index 7c9f9a6421b8f3acdf7ccff1a106402913c75dd9..4c20f5546893dc104afd7cdf32dc4f148b38821b 100644 (file)
@@ -526,6 +526,8 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 
                        err = output(skb);
 
+                       if (!err)
+                               IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
                        if (err || !frag)
                                break;
 
@@ -649,9 +651,6 @@ slow_path:
                /*
                 *      Put this fragment into the sending queue.
                 */
-
-               IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
-
                iph->tot_len = htons(len + hlen);
 
                ip_send_check(iph);
@@ -659,6 +658,8 @@ slow_path:
                err = output(skb2);
                if (err)
                        goto fail;
+
+               IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
        }
        kfree_skb(skb);
        IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
@@ -946,7 +947,7 @@ alloc_new_skb:
                                skb_prev->csum = csum_sub(skb_prev->csum,
                                                          skb->csum);
                                data += fraggap;
-                               skb_trim(skb_prev, maxfraglen);
+                               pskb_trim_unique(skb_prev, maxfraglen);
                        }
 
                        copy = datalen - transhdrlen - fraggap;
@@ -1141,7 +1142,7 @@ ssize_t   ip_append_page(struct sock *sk, struct page *page,
                                        data, fraggap, 0);
                                skb_prev->csum = csum_sub(skb_prev->csum,
                                                          skb->csum);
-                               skb_trim(skb_prev, maxfraglen);
+                               pskb_trim_unique(skb_prev, maxfraglen);
                        }
 
                        /*
index 84f43a3c909811116ba8ed39cc01c98600c13afe..2d05c4133d3e350b7940c737ecf4055b4f197a24 100644 (file)
@@ -112,14 +112,19 @@ static void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb)
 static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
 {
        char *secdata;
-       u32 seclen;
+       u32 seclen, secid;
        int err;
 
-       err = security_socket_getpeersec_dgram(skb, &secdata, &seclen);
+       err = security_socket_getpeersec_dgram(NULL, skb, &secid);
+       if (err)
+               return;
+
+       err = security_secid_to_secctx(secid, &secdata, &seclen);
        if (err)
                return;
 
        put_cmsg(msg, SOL_IP, SCM_SECURITY, seclen, secdata);
+       security_release_secctx(secdata, seclen);
 }
 
 
index 9ccacf57f08bd8ff7a0e6315ae6766f6744fb59c..85893eef6b16c5488ab01d0be5c168874b338293 100644 (file)
@@ -1578,6 +1578,7 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait)
        cache = ipmr_cache_find(rt->rt_src, rt->rt_dst);
 
        if (cache==NULL) {
+               struct sk_buff *skb2;
                struct net_device *dev;
                int vif;
 
@@ -1591,12 +1592,18 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait)
                        read_unlock(&mrt_lock);
                        return -ENODEV;
                }
-               skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
-               skb->nh.iph->ihl = sizeof(struct iphdr)>>2;
-               skb->nh.iph->saddr = rt->rt_src;
-               skb->nh.iph->daddr = rt->rt_dst;
-               skb->nh.iph->version = 0;
-               err = ipmr_cache_unresolved(vif, skb);
+               skb2 = skb_clone(skb, GFP_ATOMIC);
+               if (!skb2) {
+                       read_unlock(&mrt_lock);
+                       return -ENOMEM;
+               }
+
+               skb2->nh.raw = skb_push(skb2, sizeof(struct iphdr));
+               skb2->nh.iph->ihl = sizeof(struct iphdr)>>2;
+               skb2->nh.iph->saddr = rt->rt_src;
+               skb2->nh.iph->daddr = rt->rt_dst;
+               skb2->nh.iph->version = 0;
+               err = ipmr_cache_unresolved(vif, skb2);
                read_unlock(&mrt_lock);
                return err;
        }
index 80c73ca90116f51ecff0cc2e52b8e4201f747920..df4854cf598bbea46da6b19b6c2bb0ffdc0436fe 100644 (file)
@@ -1170,21 +1170,34 @@ static int __init arp_tables_init(void)
 {
        int ret;
 
-       xt_proto_init(NF_ARP);
+       ret = xt_proto_init(NF_ARP);
+       if (ret < 0)
+               goto err1;
 
        /* Noone else will be downing sem now, so we won't sleep */
-       xt_register_target(&arpt_standard_target);
-       xt_register_target(&arpt_error_target);
+       ret = xt_register_target(&arpt_standard_target);
+       if (ret < 0)
+               goto err2;
+       ret = xt_register_target(&arpt_error_target);
+       if (ret < 0)
+               goto err3;
 
        /* Register setsockopt */
        ret = nf_register_sockopt(&arpt_sockopts);
-       if (ret < 0) {
-               duprintf("Unable to register sockopts.\n");
-               return ret;
-       }
+       if (ret < 0)
+               goto err4;
 
        printk("arp_tables: (C) 2002 David S. Miller\n");
        return 0;
+
+err4:
+       xt_unregister_target(&arpt_error_target);
+err3:
+       xt_unregister_target(&arpt_standard_target);
+err2:
+       xt_proto_fini(NF_ARP);
+err1:
+       return ret;
 }
 
 static void __exit arp_tables_fini(void)
index af35235672d58f9ce0ec320073b838930b0352a7..9a39e2969712701d0ab45b9bb0dcd1d3c6ccf0e6 100644 (file)
@@ -1200,7 +1200,7 @@ static struct ip_conntrack_expect *find_expect(struct ip_conntrack *ct,
        tuple.dst.protonum = IPPROTO_TCP;
 
        exp = __ip_conntrack_expect_find(&tuple);
-       if (exp->master == ct)
+       if (exp && exp->master == ct)
                return exp;
        return NULL;
 }
index 33891bb1fde438a97c5d85516b3c25bb826d1ba4..0d4cc92391fa54a23d26e64564c7b58b7e250d2f 100644 (file)
@@ -415,21 +415,18 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
                        cb->args[0], *id);
 
        read_lock_bh(&ip_conntrack_lock);
+       last = (struct ip_conntrack *)cb->args[1];
        for (; cb->args[0] < ip_conntrack_htable_size; cb->args[0]++) {
 restart:
-               last = (struct ip_conntrack *)cb->args[1];
                list_for_each_prev(i, &ip_conntrack_hash[cb->args[0]]) {
                        h = (struct ip_conntrack_tuple_hash *) i;
                        if (DIRECTION(h) != IP_CT_DIR_ORIGINAL)
                                continue;
                        ct = tuplehash_to_ctrack(h);
-                       if (last != NULL) {
-                               if (ct == last) {
-                                       ip_conntrack_put(last);
-                                       cb->args[1] = 0;
-                                       last = NULL;
-                               } else
+                       if (cb->args[1]) {
+                               if (ct != last)
                                        continue;
+                               cb->args[1] = 0;
                        }
                        if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid,
                                                cb->nlh->nlmsg_seq,
@@ -440,17 +437,17 @@ restart:
                                goto out;
                        }
                }
-               if (last != NULL) {
-                       ip_conntrack_put(last);
+               if (cb->args[1]) {
                        cb->args[1] = 0;
                        goto restart;
                }
        }
 out:
        read_unlock_bh(&ip_conntrack_lock);
+       if (last)
+               ip_conntrack_put(last);
 
        DEBUGP("leaving, last bucket=%lu id=%u\n", cb->args[0], *id);
-
        return skb->len;
 }
 
index fc87ce0da40d37c8f5f93e0113f43b60f16ea828..4f222d6be009ac22aa6519b1619aedc1df65500a 100644 (file)
@@ -442,7 +442,7 @@ static int __init init(void)
                sip[i].tuple.src.u.udp.port = htons(ports[i]);
                sip[i].mask.src.u.udp.port = 0xFFFF;
                sip[i].mask.dst.protonum = 0xFF;
-               sip[i].max_expected = 1;
+               sip[i].max_expected = 2;
                sip[i].timeout = 3 * 60; /* 3 minutes */
                sip[i].me = THIS_MODULE;
                sip[i].help = sip_help;
index 7bd3c22003a20a84b9e92479db92a0c1b871edcf..7a9fa04a467a2b807c7fed4d16245fa7201dab04 100644 (file)
@@ -534,6 +534,8 @@ static struct nf_hook_ops ip_conntrack_ops[] = {
 
 /* Sysctl support */
 
+int ip_conntrack_checksum = 1;
+
 #ifdef CONFIG_SYSCTL
 
 /* From ip_conntrack_core.c */
@@ -568,8 +570,6 @@ extern unsigned int ip_ct_generic_timeout;
 static int log_invalid_proto_min = 0;
 static int log_invalid_proto_max = 255;
 
-int ip_conntrack_checksum = 1;
-
 static struct ctl_table_header *ip_ct_sysctl_header;
 
 static ctl_table ip_ct_sysctl_table[] = {
index 0b1b416759ccc948a54c9e78aabcda86b68fe89d..18b7fbdccb6126684f67478fa6a7ba1580445b23 100644 (file)
@@ -1255,9 +1255,9 @@ static int help(struct sk_buff **pskb,
        struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl);
 
        /* SNMP replies and originating SNMP traps get mangled */
-       if (udph->source == ntohs(SNMP_PORT) && dir != IP_CT_DIR_REPLY)
+       if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY)
                return NF_ACCEPT;
-       if (udph->dest == ntohs(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL)
+       if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL)
                return NF_ACCEPT;
 
        /* No NAT? */
index fc5bdd5eb7d35aa7de0f4fd5a2c7a8bc794dd643..048514f15f2ffe116dcbebc0aa1672eae54045f4 100644 (file)
@@ -230,7 +230,7 @@ ipt_do_table(struct sk_buff **pskb,
        const char *indev, *outdev;
        void *table_base;
        struct ipt_entry *e, *back;
-       struct xt_table_info *private = table->private;
+       struct xt_table_info *private;
 
        /* Initialization */
        ip = (*pskb)->nh.iph;
@@ -247,6 +247,7 @@ ipt_do_table(struct sk_buff **pskb,
 
        read_lock_bh(&table->lock);
        IP_NF_ASSERT(table->valid_hooks & (1 << hook));
+       private = table->private;
        table_base = (void *)private->entries[smp_processor_id()];
        e = get_entry(table_base, private->hook_entry[hook]);
 
@@ -2239,22 +2240,39 @@ static int __init ip_tables_init(void)
 {
        int ret;
 
-       xt_proto_init(AF_INET);
+       ret = xt_proto_init(AF_INET);
+       if (ret < 0)
+               goto err1;
 
        /* Noone else will be downing sem now, so we won't sleep */
-       xt_register_target(&ipt_standard_target);
-       xt_register_target(&ipt_error_target);
-       xt_register_match(&icmp_matchstruct);
+       ret = xt_register_target(&ipt_standard_target);
+       if (ret < 0)
+               goto err2;
+       ret = xt_register_target(&ipt_error_target);
+       if (ret < 0)
+               goto err3;
+       ret = xt_register_match(&icmp_matchstruct);
+       if (ret < 0)
+               goto err4;
 
        /* Register setsockopt */
        ret = nf_register_sockopt(&ipt_sockopts);
-       if (ret < 0) {
-               duprintf("Unable to register sockopts.\n");
-               return ret;
-       }
+       if (ret < 0)
+               goto err5;
 
        printk("ip_tables: (C) 2000-2006 Netfilter Core Team\n");
        return 0;
+
+err5:
+       xt_unregister_match(&icmp_matchstruct);
+err4:
+       xt_unregister_target(&ipt_error_target);
+err3:
+       xt_unregister_target(&ipt_standard_target);
+err2:
+       xt_proto_fini(AF_INET);
+err1:
+       return ret;
 }
 
 static void __exit ip_tables_fini(void)
index d7dd7fe7051ca4413de76da6e631403499b67925..d46fd677fa11f8f48f30e136d843cb95f3ae8c45 100644 (file)
@@ -115,6 +115,11 @@ static void ulog_send(unsigned int nlgroupnum)
                del_timer(&ub->timer);
        }
 
+       if (!ub->skb) {
+               DEBUGP("ipt_ULOG: ulog_send: nothing to send\n");
+               return;
+       }
+
        /* last nlmsg needs NLMSG_DONE */
        if (ub->qlen > 1)
                ub->lastnlh->nlmsg_type = NLMSG_DONE;
index 92980ab8ce489dacaad95a4c259c19855e0cfd01..3bd2368e1fc9757da9cb6f21a60aea872a0ecb1f 100644 (file)
@@ -454,15 +454,12 @@ hashlimit_match(const struct sk_buff *skb,
                dh->rateinfo.credit_cap = user2credits(hinfo->cfg.avg * 
                                                        hinfo->cfg.burst);
                dh->rateinfo.cost = user2credits(hinfo->cfg.avg);
-
-               spin_unlock_bh(&hinfo->lock);
-               return 1;
+       } else {
+               /* update expiration timeout */
+               dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
+               rateinfo_recalc(dh, now);
        }
 
-       /* update expiration timeout */
-       dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
-
-       rateinfo_recalc(dh, now);
        if (dh->rateinfo.credit >= dh->rateinfo.cost) {
                /* We're underlimit. */
                dh->rateinfo.credit -= dh->rateinfo.cost;
@@ -508,6 +505,9 @@ hashlimit_checkentry(const char *tablename,
        if (!r->cfg.expire)
                return 0;
 
+       if (r->name[sizeof(r->name) - 1] != '\0')
+               return 0;
+
        /* This is the best we've got: We cannot release and re-grab lock,
         * since checkentry() is called before ip_tables.c grabs ipt_mutex.  
         * We also cannot grab the hashtable spinlock, since htable_create will 
index bd221ec3f81eb668390d9e811712c8bc3da6fdfd..62b2762a2420bb1331d88d0d076737c1cc358ac3 100644 (file)
@@ -609,6 +609,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
        if (sin) {
                sin->sin_family = AF_INET;
                sin->sin_addr.s_addr = skb->nh.iph->saddr;
+               sin->sin_port = 0;
                memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
        }
        if (inet->cmsg_flags)
index 2dc6dbb284678916db25257405da673cfea06f72..b873cbcdd0b8f2e2745b2be633febeabccde1db1 100644 (file)
 #include <net/icmp.h>
 #include <net/xfrm.h>
 #include <net/ip_mp_alg.h>
+#include <net/netevent.h>
 #ifdef CONFIG_SYSCTL
 #include <linux/sysctl.h>
 #endif
@@ -1125,6 +1126,7 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
        struct rtable *rth, **rthp;
        u32  skeys[2] = { saddr, 0 };
        int  ikeys[2] = { dev->ifindex, 0 };
+       struct netevent_redirect netevent;
 
        if (!in_dev)
                return;
@@ -1216,6 +1218,11 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
                                        rt_drop(rt);
                                        goto do_next;
                                }
+                               
+                               netevent.old = &rth->u.dst;
+                               netevent.new = &rt->u.dst;
+                               call_netevent_notifiers(NETEVENT_REDIRECT, 
+                                                       &netevent);
 
                                rt_del(hash, rth);
                                if (!rt_intern_hash(hash, rt, &rt))
@@ -1452,6 +1459,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
                }
                dst->metrics[RTAX_MTU-1] = mtu;
                dst_set_expires(dst, ip_rt_mtu_expires);
+               call_netevent_notifiers(NETEVENT_PMTU_UPDATE, dst);
        }
 }
 
@@ -3149,7 +3157,7 @@ int __init ip_rt_init(void)
                                        rhash_entries,
                                        (num_physpages >= 128 * 1024) ?
                                        15 : 17,
-                                       HASH_HIGHMEM,
+                                       0,
                                        &rt_hash_log,
                                        &rt_hash_mask,
                                        0);
index f6a2d9223d07ca1503aecfdaa9124e09b8e22247..934396bb1376f84b43dd60215c04466690686f93 100644 (file)
@@ -1132,7 +1132,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
        tp->ucopy.dma_chan = NULL;
        preempt_disable();
        if ((len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) &&
-           !sysctl_tcp_low_latency && __get_cpu_var(softnet_data.net_dma)) {
+           !sysctl_tcp_low_latency && __get_cpu_var(softnet_data).net_dma) {
                preempt_enable_no_resched();
                tp->ucopy.pinned_list = dma_pin_iovec_pages(msg->msg_iov, len);
        } else
@@ -1659,7 +1659,8 @@ adjudge_to_death:
                        const int tmo = tcp_fin_time(sk);
 
                        if (tmo > TCP_TIMEWAIT_LEN) {
-                               inet_csk_reset_keepalive_timer(sk, tcp_fin_time(sk));
+                               inet_csk_reset_keepalive_timer(sk,
+                                               tmo - TCP_TIMEWAIT_LEN);
                        } else {
                                tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
                                goto out;
index 738dad9f7d498d40538aa77c3161900353470c7a..104af5d5bcbcb75f84ffaee403f830743fc0a982 100644 (file)
@@ -3541,7 +3541,8 @@ void tcp_cwnd_application_limited(struct sock *sk)
        if (inet_csk(sk)->icsk_ca_state == TCP_CA_Open &&
            sk->sk_socket && !test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
                /* Limited by application or receiver window. */
-               u32 win_used = max(tp->snd_cwnd_used, 2U);
+               u32 init_win = tcp_init_cwnd(tp, __sk_dst_get(sk));
+               u32 win_used = max(tp->snd_cwnd_used, init_win);
                if (win_used < tp->snd_cwnd) {
                        tp->snd_ssthresh = tcp_current_ssthresh(sk);
                        tp->snd_cwnd = (tp->snd_cwnd + win_used) >> 1;
index f6f39e8142917e5a7fa841adaaf096b340c7c1d6..4b04c3edd4a95518a878e294096424c053037912 100644 (file)
@@ -438,7 +438,6 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
                               It can f.e. if SYNs crossed.
                             */
                if (!sock_owned_by_user(sk)) {
-                       TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
                        sk->sk_err = err;
 
                        sk->sk_error_report(sk);
@@ -874,7 +873,6 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 drop_and_free:
        reqsk_free(req);
 drop:
-       TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
        return 0;
 }
 
index 0ccb7cb22b1518a3fc14f4ed2d95829615716753..624e2b2c7f53a737e98197c0928f6eaad4189a86 100644 (file)
@@ -589,8 +589,10 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
                /* RFC793: "second check the RST bit" and
                 *         "fourth, check the SYN bit"
                 */
-               if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN))
+               if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) {
+                       TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
                        goto embryonic_reset;
+               }
 
                /* ACK sequence verified above, just make sure ACK is
                 * set.  If ACK not set, just silently drop the packet.
index 5c08ea20a18dfb8fa965fc23070729c176aba4f0..507adefbc17cdf18d1b7a814630711fbaca5cf81 100644 (file)
@@ -466,7 +466,8 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
        if (skb->len != tcp_header_size)
                tcp_event_data_sent(tp, skb, sk);
 
-       TCP_INC_STATS(TCP_MIB_OUTSEGS);
+       if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq)
+               TCP_INC_STATS(TCP_MIB_OUTSEGS);
 
        err = icsk->icsk_af_ops->queue_xmit(skb, 0);
        if (likely(err <= 0))
@@ -2157,10 +2158,9 @@ int tcp_connect(struct sock *sk)
        skb_shinfo(buff)->gso_size = 0;
        skb_shinfo(buff)->gso_type = 0;
        buff->csum = 0;
+       tp->snd_nxt = tp->write_seq;
        TCP_SKB_CB(buff)->seq = tp->write_seq++;
        TCP_SKB_CB(buff)->end_seq = tp->write_seq;
-       tp->snd_nxt = tp->write_seq;
-       tp->pushed_seq = tp->write_seq;
 
        /* Send it off. */
        TCP_SKB_CB(buff)->when = tcp_time_stamp;
@@ -2170,6 +2170,12 @@ int tcp_connect(struct sock *sk)
        sk_charge_skb(sk, buff);
        tp->packets_out += tcp_skb_pcount(buff);
        tcp_transmit_skb(sk, buff, 1, GFP_KERNEL);
+
+       /* We change tp->snd_nxt after the tcp_transmit_skb() call
+        * in order to make this packet get counted in tcpOutSegs.
+        */
+       tp->snd_nxt = tp->write_seq;
+       tp->pushed_seq = tp->write_seq;
        TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);
 
        /* Timer for repeating the SYN until an answer. */
index d7d517a3a238b918862896e114e3ea0261f5652c..dab37d2f65fcf09a820bce52300d7f335ab5066c 100644 (file)
@@ -114,7 +114,7 @@ static int tcpprobe_open(struct inode * inode, struct file * file)
 static ssize_t tcpprobe_read(struct file *file, char __user *buf,
                             size_t len, loff_t *ppos)
 {
-       int error = 0, cnt;
+       int error = 0, cnt = 0;
        unsigned char *tbuf;
 
        if (!buf || len < 0)
@@ -130,11 +130,12 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf,
        error = wait_event_interruptible(tcpw.wait,
                                         __kfifo_len(tcpw.fifo) != 0);
        if (error)
-               return error;
+               goto out_free;
 
        cnt = kfifo_get(tcpw.fifo, tbuf, len);
        error = copy_to_user(buf, tbuf, cnt);
 
+out_free:
        vfree(tbuf);
 
        return error ? error : cnt;
index 2316a4315a1800f7d750f9237eb8e29d7b5e77ac..0c5042e7380d391769f8e484132157735cb35e6e 100644 (file)
@@ -1869,15 +1869,21 @@ err_exit:
 /*
  *     Manual configuration of address on an interface
  */
-static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen)
+static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen,
+                         __u32 prefered_lft, __u32 valid_lft)
 {
        struct inet6_ifaddr *ifp;
        struct inet6_dev *idev;
        struct net_device *dev;
+       __u8 ifa_flags = 0;
        int scope;
 
        ASSERT_RTNL();
        
+       /* check the lifetime */
+       if (!valid_lft || prefered_lft > valid_lft)
+               return -EINVAL;
+
        if ((dev = __dev_get_by_index(ifindex)) == NULL)
                return -ENODEV;
        
@@ -1889,10 +1895,29 @@ static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen)
 
        scope = ipv6_addr_scope(pfx);
 
-       ifp = ipv6_add_addr(idev, pfx, plen, scope, IFA_F_PERMANENT);
+       if (valid_lft == INFINITY_LIFE_TIME)
+               ifa_flags |= IFA_F_PERMANENT;
+       else if (valid_lft >= 0x7FFFFFFF/HZ)
+               valid_lft = 0x7FFFFFFF/HZ;
+
+       if (prefered_lft == 0)
+               ifa_flags |= IFA_F_DEPRECATED;
+       else if ((prefered_lft >= 0x7FFFFFFF/HZ) &&
+                (prefered_lft != INFINITY_LIFE_TIME))
+               prefered_lft = 0x7FFFFFFF/HZ;
+
+       ifp = ipv6_add_addr(idev, pfx, plen, scope, ifa_flags);
+
        if (!IS_ERR(ifp)) {
+               spin_lock_bh(&ifp->lock);
+               ifp->valid_lft = valid_lft;
+               ifp->prefered_lft = prefered_lft;
+               ifp->tstamp = jiffies;
+               spin_unlock_bh(&ifp->lock);
+
                addrconf_dad_start(ifp, 0);
                in6_ifa_put(ifp);
+               addrconf_verify(0);
                return 0;
        }
 
@@ -1945,7 +1970,8 @@ int addrconf_add_ifaddr(void __user *arg)
                return -EFAULT;
 
        rtnl_lock();
-       err = inet6_addr_add(ireq.ifr6_ifindex, &ireq.ifr6_addr, ireq.ifr6_prefixlen);
+       err = inet6_addr_add(ireq.ifr6_ifindex, &ireq.ifr6_addr, ireq.ifr6_prefixlen,
+                            INFINITY_LIFE_TIME, INFINITY_LIFE_TIME);
        rtnl_unlock();
        return err;
 }
@@ -2771,12 +2797,16 @@ restart:
                                        ifp->idev->nd_parms->retrans_time / HZ;
 #endif
 
-                       if (age >= ifp->valid_lft) {
+                       if (ifp->valid_lft != INFINITY_LIFE_TIME &&
+                           age >= ifp->valid_lft) {
                                spin_unlock(&ifp->lock);
                                in6_ifa_hold(ifp);
                                read_unlock(&addrconf_hash_lock);
                                ipv6_del_addr(ifp);
                                goto restart;
+                       } else if (ifp->prefered_lft == INFINITY_LIFE_TIME) {
+                               spin_unlock(&ifp->lock);
+                               continue;
                        } else if (age >= ifp->prefered_lft) {
                                /* jiffies - ifp->tsamp > age >= ifp->prefered_lft */
                                int deprecate = 0;
@@ -2853,7 +2883,8 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
                pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
        }
        if (rta[IFA_LOCAL-1]) {
-               if (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx)))
+               if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
+                   (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
                        return -EINVAL;
                pfx = RTA_DATA(rta[IFA_LOCAL-1]);
        }
@@ -2863,12 +2894,62 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
        return inet6_addr_del(ifm->ifa_index, pfx, ifm->ifa_prefixlen);
 }
 
+static int
+inet6_addr_modify(int ifindex, struct in6_addr *pfx,
+                 __u32 prefered_lft, __u32 valid_lft)
+{
+       struct inet6_ifaddr *ifp = NULL;
+       struct net_device *dev;
+       int ifa_flags = 0;
+
+       if ((dev = __dev_get_by_index(ifindex)) == NULL)
+               return -ENODEV;
+
+       if (!(dev->flags&IFF_UP))
+               return -ENETDOWN;
+
+       if (!valid_lft || (prefered_lft > valid_lft))
+               return -EINVAL;
+
+       ifp = ipv6_get_ifaddr(pfx, dev, 1);
+       if (ifp == NULL)
+               return -ENOENT;
+
+       if (valid_lft == INFINITY_LIFE_TIME)
+               ifa_flags = IFA_F_PERMANENT;
+       else if (valid_lft >= 0x7FFFFFFF/HZ)
+               valid_lft = 0x7FFFFFFF/HZ;
+
+       if (prefered_lft == 0)
+               ifa_flags = IFA_F_DEPRECATED;
+       else if ((prefered_lft >= 0x7FFFFFFF/HZ) &&
+                (prefered_lft != INFINITY_LIFE_TIME))
+               prefered_lft = 0x7FFFFFFF/HZ;
+
+       spin_lock_bh(&ifp->lock);
+       ifp->flags = (ifp->flags & ~(IFA_F_DEPRECATED|IFA_F_PERMANENT)) | ifa_flags;
+
+       ifp->tstamp = jiffies;
+       ifp->valid_lft = valid_lft;
+       ifp->prefered_lft = prefered_lft;
+
+       spin_unlock_bh(&ifp->lock);
+       if (!(ifp->flags&IFA_F_TENTATIVE))
+               ipv6_ifa_notify(0, ifp);
+       in6_ifa_put(ifp);
+
+       addrconf_verify(0);
+
+       return 0;
+}
+
 static int
 inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 {
        struct rtattr  **rta = arg;
        struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
        struct in6_addr *pfx;
+       __u32 valid_lft = INFINITY_LIFE_TIME, prefered_lft = INFINITY_LIFE_TIME;
 
        pfx = NULL;
        if (rta[IFA_ADDRESS-1]) {
@@ -2877,14 +2958,34 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
                pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
        }
        if (rta[IFA_LOCAL-1]) {
-               if (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx)))
+               if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
+                   (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
                        return -EINVAL;
                pfx = RTA_DATA(rta[IFA_LOCAL-1]);
        }
        if (pfx == NULL)
                return -EINVAL;
 
-       return inet6_addr_add(ifm->ifa_index, pfx, ifm->ifa_prefixlen);
+       if (rta[IFA_CACHEINFO-1]) {
+               struct ifa_cacheinfo *ci;
+               if (RTA_PAYLOAD(rta[IFA_CACHEINFO-1]) < sizeof(*ci))
+                       return -EINVAL;
+               ci = RTA_DATA(rta[IFA_CACHEINFO-1]);
+               valid_lft = ci->ifa_valid;
+               prefered_lft = ci->ifa_prefered;
+       }
+
+       if (nlh->nlmsg_flags & NLM_F_REPLACE) {
+               int ret;
+               ret = inet6_addr_modify(ifm->ifa_index, pfx,
+                                       prefered_lft, valid_lft);
+               if (ret == 0 || !(nlh->nlmsg_flags & NLM_F_CREATE))
+                       return ret;
+       }
+
+       return inet6_addr_add(ifm->ifa_index, pfx, ifm->ifa_prefixlen,
+                             prefered_lft, valid_lft);
+
 }
 
 /* Maximum length of ifa_cacheinfo attributes */
@@ -3121,6 +3222,62 @@ static int inet6_dump_ifacaddr(struct sk_buff *skb, struct netlink_callback *cb)
        return inet6_dump_addr(skb, cb, type);
 }
 
+static int inet6_rtm_getaddr(struct sk_buff *in_skb,
+               struct nlmsghdr* nlh, void *arg)
+{
+       struct rtattr **rta = arg;
+       struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
+       struct in6_addr *addr = NULL;
+       struct net_device *dev = NULL;
+       struct inet6_ifaddr *ifa;
+       struct sk_buff *skb;
+       int size = NLMSG_SPACE(sizeof(struct ifaddrmsg) + INET6_IFADDR_RTA_SPACE);
+       int err;
+
+       if (rta[IFA_ADDRESS-1]) {
+               if (RTA_PAYLOAD(rta[IFA_ADDRESS-1]) < sizeof(*addr))
+                       return -EINVAL;
+               addr = RTA_DATA(rta[IFA_ADDRESS-1]);
+       }
+       if (rta[IFA_LOCAL-1]) {
+               if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*addr) ||
+                   (addr && memcmp(addr, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*addr))))
+                       return -EINVAL;
+               addr = RTA_DATA(rta[IFA_LOCAL-1]);
+       }
+       if (addr == NULL)
+               return -EINVAL;
+
+       if (ifm->ifa_index)
+               dev = __dev_get_by_index(ifm->ifa_index);
+
+       if ((ifa = ipv6_get_ifaddr(addr, dev, 1)) == NULL)
+               return -EADDRNOTAVAIL;
+
+       if ((skb = alloc_skb(size, GFP_KERNEL)) == NULL) {
+               err = -ENOBUFS;
+               goto out;
+       }
+
+       NETLINK_CB(skb).dst_pid = NETLINK_CB(in_skb).pid;
+       err = inet6_fill_ifaddr(skb, ifa, NETLINK_CB(in_skb).pid,
+                               nlh->nlmsg_seq, RTM_NEWADDR, 0);
+       if (err < 0) {
+               err = -EMSGSIZE;
+               goto out_free;
+       }
+
+       err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT);
+       if (err > 0)
+               err = 0;
+out:
+       in6_ifa_put(ifa);
+       return err;
+out_free:
+       kfree_skb(skb);
+       goto out;
+}
+
 static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa)
 {
        struct sk_buff *skb;
@@ -3363,7 +3520,8 @@ static struct rtnetlink_link inet6_rtnetlink_table[RTM_NR_MSGTYPES] = {
        [RTM_GETLINK - RTM_BASE] = { .dumpit    = inet6_dump_ifinfo, },
        [RTM_NEWADDR - RTM_BASE] = { .doit      = inet6_rtm_newaddr, },
        [RTM_DELADDR - RTM_BASE] = { .doit      = inet6_rtm_deladdr, },
-       [RTM_GETADDR - RTM_BASE] = { .dumpit    = inet6_dump_ifaddr, },
+       [RTM_GETADDR - RTM_BASE] = { .doit      = inet6_rtm_getaddr,
+                                    .dumpit    = inet6_dump_ifaddr, },
        [RTM_GETMULTICAST - RTM_BASE] = { .dumpit = inet6_dump_ifmcaddr, },
        [RTM_GETANYCAST - RTM_BASE] = { .dumpit = inet6_dump_ifacaddr, },
        [RTM_NEWROUTE - RTM_BASE] = { .doit     = inet6_rtm_newroute, },
index 5a0ba58b86cc055845c74dba1ca8c6c0a47fdc31..ac85e9c532c20aa6c2a6981605a5a26fc211cbb5 100644 (file)
@@ -658,7 +658,7 @@ int inet6_sk_rebuild_header(struct sock *sk)
                        return err;
                }
 
-               ip6_dst_store(sk, dst, NULL);
+               __ip6_dst_store(sk, dst, NULL);
        }
 
        return 0;
index 1044b6fce0d5d472b11b0eef3a2e261650869e5e..3d6e9a351150294376557616ab29c72a783ed2c4 100644 (file)
@@ -712,6 +712,11 @@ discard_it:
        return 0;
 }
 
+/*
+ * Special lock-class for __icmpv6_socket:
+ */
+static struct lock_class_key icmpv6_socket_sk_dst_lock_key;
+
 int __init icmpv6_init(struct net_proto_family *ops)
 {
        struct sock *sk;
@@ -730,6 +735,14 @@ int __init icmpv6_init(struct net_proto_family *ops)
 
                sk = per_cpu(__icmpv6_socket, i)->sk;
                sk->sk_allocation = GFP_ATOMIC;
+               /*
+                * Split off their lock-class, because sk->sk_dst_lock
+                * gets used from softirqs, which is safe for
+                * __icmpv6_socket (because those never get directly used
+                * via userspace syscalls), but unsafe for normal sockets.
+                */
+               lockdep_set_class(&sk->sk_dst_lock,
+                                 &icmpv6_socket_sk_dst_lock_key);
 
                /* Enough space for 2 64K ICMP packets, including
                 * sk_buff struct overhead.
index 5c950cc79d80a3c04384b8238e2573e9f827fdb5..bf491077b822158302efdd22458f64b5a31d5764 100644 (file)
@@ -185,7 +185,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
                        return err;
                }
 
-               ip6_dst_store(sk, dst, NULL);
+               __ip6_dst_store(sk, dst, NULL);
        }
 
        skb->dst = dst_clone(dst);
index df8f051c0fce2eb910429a9313ec0db8e3ba9462..25c2a9e0389549f05578c2ad3155ab105ef8ecfa 100644 (file)
@@ -71,6 +71,8 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
                goto out;
        }
 
+       memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
+
        /*
         * Store incoming device index. When the packet will
         * be queued, we cannot refer to skb->dev anymore.
index 3bc74ce78800322cc70b88846a5970cca201a0cd..4fb47a25291313ea0851a6539bed48a73a97c1c8 100644 (file)
@@ -356,6 +356,7 @@ int ip6_forward(struct sk_buff *skb)
                skb->dev = dst->dev;
                icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
                            0, skb->dev);
+               IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 
                kfree_skb(skb);
                return -ETIMEDOUT;
@@ -595,6 +596,9 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
                        }
                        
                        err = output(skb);
+                       if(!err)
+                               IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
+
                        if (err || !frag)
                                break;
 
@@ -706,12 +710,11 @@ slow_path:
                /*
                 *      Put this fragment into the sending queue.
                 */
-
-               IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
-
                err = output(frag);
                if (err)
                        goto fail;
+
+               IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
        }
        kfree_skb(skb);
        IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
@@ -723,48 +726,51 @@ fail:
        return err;
 }
 
-int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
+static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
+                                         struct dst_entry *dst,
+                                         struct flowi *fl)
 {
-       int err = 0;
+       struct ipv6_pinfo *np = inet6_sk(sk);
+       struct rt6_info *rt = (struct rt6_info *)dst;
 
-       *dst = NULL;
-       if (sk) {
-               struct ipv6_pinfo *np = inet6_sk(sk);
-       
-               *dst = sk_dst_check(sk, np->dst_cookie);
-               if (*dst) {
-                       struct rt6_info *rt = (struct rt6_info*)*dst;
-       
-                       /* Yes, checking route validity in not connected
-                        * case is not very simple. Take into account,
-                        * that we do not support routing by source, TOS,
-                        * and MSG_DONTROUTE            --ANK (980726)
-                        *
-                        * 1. If route was host route, check that
-                        *    cached destination is current.
-                        *    If it is network route, we still may
-                        *    check its validity using saved pointer
-                        *    to the last used address: daddr_cache.
-                        *    We do not want to save whole address now,
-                        *    (because main consumer of this service
-                        *    is tcp, which has not this problem),
-                        *    so that the last trick works only on connected
-                        *    sockets.
-                        * 2. oif also should be the same.
-                        */
-                       if (((rt->rt6i_dst.plen != 128 ||
-                             !ipv6_addr_equal(&fl->fl6_dst,
-                                              &rt->rt6i_dst.addr))
-                            && (np->daddr_cache == NULL ||
-                                !ipv6_addr_equal(&fl->fl6_dst,
-                                                 np->daddr_cache)))
-                           || (fl->oif && fl->oif != (*dst)->dev->ifindex)) {
-                               dst_release(*dst);
-                               *dst = NULL;
-                       }
-               }
+       if (!dst)
+               goto out;
+
+       /* Yes, checking route validity in not connected
+        * case is not very simple. Take into account,
+        * that we do not support routing by source, TOS,
+        * and MSG_DONTROUTE            --ANK (980726)
+        *
+        * 1. If route was host route, check that
+        *    cached destination is current.
+        *    If it is network route, we still may
+        *    check its validity using saved pointer
+        *    to the last used address: daddr_cache.
+        *    We do not want to save whole address now,
+        *    (because main consumer of this service
+        *    is tcp, which has not this problem),
+        *    so that the last trick works only on connected
+        *    sockets.
+        * 2. oif also should be the same.
+        */
+       if (((rt->rt6i_dst.plen != 128 ||
+             !ipv6_addr_equal(&fl->fl6_dst, &rt->rt6i_dst.addr))
+            && (np->daddr_cache == NULL ||
+                !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache)))
+           || (fl->oif && fl->oif != dst->dev->ifindex)) {
+               dst_release(dst);
+               dst = NULL;
        }
 
+out:
+       return dst;
+}
+
+static int ip6_dst_lookup_tail(struct sock *sk,
+                              struct dst_entry **dst, struct flowi *fl)
+{
+       int err;
+
        if (*dst == NULL)
                *dst = ip6_route_output(sk, fl);
 
@@ -773,7 +779,6 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
 
        if (ipv6_addr_any(&fl->fl6_src)) {
                err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src);
-
                if (err)
                        goto out_err_release;
        }
@@ -786,8 +791,48 @@ out_err_release:
        return err;
 }
 
+/**
+ *     ip6_dst_lookup - perform route lookup on flow
+ *     @sk: socket which provides route info
+ *     @dst: pointer to dst_entry * for result
+ *     @fl: flow to lookup
+ *
+ *     This function performs a route lookup on the given flow.
+ *
+ *     It returns zero on success, or a standard errno code on error.
+ */
+int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
+{
+       *dst = NULL;
+       return ip6_dst_lookup_tail(sk, dst, fl);
+}
 EXPORT_SYMBOL_GPL(ip6_dst_lookup);
 
+/**
+ *     ip6_sk_dst_lookup - perform socket cached route lookup on flow
+ *     @sk: socket which provides the dst cache and route info
+ *     @dst: pointer to dst_entry * for result
+ *     @fl: flow to lookup
+ *
+ *     This function performs a route lookup on the given flow with the
+ *     possibility of using the cached route in the socket if it is valid.
+ *     It will take the socket dst lock when operating on the dst cache.
+ *     As a result, this function can only be used in process context.
+ *
+ *     It returns zero on success, or a standard errno code on error.
+ */
+int ip6_sk_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
+{
+       *dst = NULL;
+       if (sk) {
+               *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
+               *dst = ip6_sk_dst_check(sk, *dst, fl);
+       }
+
+       return ip6_dst_lookup_tail(sk, dst, fl);
+}
+EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup);
+
 static inline int ip6_ufo_append_data(struct sock *sk,
                        int getfrag(void *from, char *to, int offset, int len,
                        int odd, struct sk_buff *skb),
@@ -1050,7 +1095,7 @@ alloc_new_skb:
                                skb_prev->csum = csum_sub(skb_prev->csum,
                                                          skb->csum);
                                data += fraggap;
-                               skb_trim(skb_prev, maxfraglen);
+                               pskb_trim_unique(skb_prev, maxfraglen);
                        }
                        copy = datalen - transhdrlen - fraggap;
                        if (copy < 0) {
index 9d697d4dcffccde33651b99a5e9b7fe9b37ddf48..639eb20c9f1fd08181c104593f3f39bc8bad3e0d 100644 (file)
@@ -268,13 +268,14 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
                        if ((dev = dev_get_by_index(mc_lst->ifindex)) != NULL) {
                                struct inet6_dev *idev = in6_dev_get(dev);
 
+                               (void) ip6_mc_leave_src(sk, mc_lst, idev);
                                if (idev) {
-                                       (void) ip6_mc_leave_src(sk,mc_lst,idev);
                                        __ipv6_dev_mc_dec(idev, &mc_lst->addr);
                                        in6_dev_put(idev);
                                }
                                dev_put(dev);
-                       }
+                       } else
+                               (void) ip6_mc_leave_src(sk, mc_lst, NULL);
                        sock_kfree_s(sk, mc_lst, sizeof(*mc_lst));
                        return 0;
                }
@@ -334,13 +335,14 @@ void ipv6_sock_mc_close(struct sock *sk)
                if (dev) {
                        struct inet6_dev *idev = in6_dev_get(dev);
 
+                       (void) ip6_mc_leave_src(sk, mc_lst, idev);
                        if (idev) {
-                               (void) ip6_mc_leave_src(sk, mc_lst, idev);
                                __ipv6_dev_mc_dec(idev, &mc_lst->addr);
                                in6_dev_put(idev);
                        }
                        dev_put(dev);
-               }
+               } else
+                       (void) ip6_mc_leave_src(sk, mc_lst, NULL);
 
                sock_kfree_s(sk, mc_lst, sizeof(*mc_lst));
 
index f26898b003475cb1358d6ab5dc9e7c831bca21c9..c9d6b23cd3f7141ff91b8cf11c3fff6e622a9e9c 100644 (file)
@@ -1398,23 +1398,39 @@ static int __init ip6_tables_init(void)
 {
        int ret;
 
-       xt_proto_init(AF_INET6);
+       ret = xt_proto_init(AF_INET6);
+       if (ret < 0)
+               goto err1;
 
        /* Noone else will be downing sem now, so we won't sleep */
-       xt_register_target(&ip6t_standard_target);
-       xt_register_target(&ip6t_error_target);
-       xt_register_match(&icmp6_matchstruct);
+       ret = xt_register_target(&ip6t_standard_target);
+       if (ret < 0)
+               goto err2;
+       ret = xt_register_target(&ip6t_error_target);
+       if (ret < 0)
+               goto err3;
+       ret = xt_register_match(&icmp6_matchstruct);
+       if (ret < 0)
+               goto err4;
 
        /* Register setsockopt */
        ret = nf_register_sockopt(&ip6t_sockopts);
-       if (ret < 0) {
-               duprintf("Unable to register sockopts.\n");
-               xt_proto_fini(AF_INET6);
-               return ret;
-       }
+       if (ret < 0)
+               goto err5;
 
        printk("ip6_tables: (C) 2000-2006 Netfilter Core Team\n");
        return 0;
+
+err5:
+       xt_unregister_match(&icmp6_matchstruct);
+err4:
+       xt_unregister_target(&ip6t_error_target);
+err3:
+       xt_unregister_target(&ip6t_standard_target);
+err2:
+       xt_proto_fini(AF_INET6);
+err1:
+       return ret;
 }
 
 static void __exit ip6_tables_fini(void)
index fa1ce0ae123ed0d855d9db3cfb44c380cb668058..d57e61ce4a7db05f776d58f546d8d3c2d0a865ef 100644 (file)
@@ -411,6 +411,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
        /* Copy the address. */
        if (sin6) {
                sin6->sin6_family = AF_INET6;
+               sin6->sin6_port = 0;
                ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr);
                sin6->sin6_flowinfo = 0;
                sin6->sin6_scope_id = 0;
index 87c39c978cd0e12dc44ecddd521d5a220e40ff9f..4b163711f3a86382609d925b62e5d3e52cc1b4b7 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/rtnetlink.h>
 #include <net/dst.h>
 #include <net/xfrm.h>
+#include <net/netevent.h>
 
 #include <asm/uaccess.h>
 
@@ -742,6 +743,7 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
                        dst->metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG;
                }
                dst->metrics[RTAX_MTU-1] = mtu;
+               call_netevent_notifiers(NETEVENT_PMTU_UPDATE, dst);
        }
 }
 
@@ -1155,6 +1157,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
        struct rt6_info *rt, *nrt = NULL;
        int strict;
        struct fib6_node *fn;
+       struct netevent_redirect netevent;
 
        /*
         * Get the "current" route for this destination and
@@ -1252,6 +1255,10 @@ restart:
        if (ip6_ins_rt(nrt, NULL, NULL, NULL))
                goto out;
 
+       netevent.old = &rt->u.dst;
+       netevent.new = &nrt->u.dst;
+       call_netevent_notifiers(NETEVENT_REDIRECT, &netevent);
+
        if (rt->rt6i_flags&RTF_CACHE) {
                ip6_del_rt(rt, NULL, NULL, NULL);
                return;
index 923989d0520d98f4527518b220b41442fcb84803..b843a650be7156ba31ee696854b2130b2a6ea0fd 100644 (file)
@@ -270,7 +270,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
        inet->rcv_saddr = LOOPBACK4_IPV6;
 
        sk->sk_gso_type = SKB_GSO_TCPV6;
-       ip6_dst_store(sk, dst, NULL);
+       __ip6_dst_store(sk, dst, NULL);
 
        icsk->icsk_ext_hdr_len = 0;
        if (np->opt)
@@ -427,7 +427,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        case TCP_SYN_RECV:  /* Cannot happen.
                               It can, it SYNs are crossed. --ANK */ 
                if (!sock_owned_by_user(sk)) {
-                       TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
                        sk->sk_err = err;
                        sk->sk_error_report(sk);                /* Wake people up to see the error (see connect in sock.c) */
 
@@ -831,7 +830,6 @@ drop:
        if (req)
                reqsk_free(req);
 
-       TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
        return 0; /* don't send reset */
 }
 
@@ -947,7 +945,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
         */
 
        sk->sk_gso_type = SKB_GSO_TCPV6;
-       ip6_dst_store(newsk, dst, NULL);
+       __ip6_dst_store(newsk, dst, NULL);
 
        newtcp6sk = (struct tcp6_sock *)newsk;
        inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;
index ccc57f434cd3cde752edbf840eb624d8b6edfe7a..3d54f246411e9da1f1d2be9f8f5d3040828175a2 100644 (file)
@@ -782,7 +782,7 @@ do_udp_sendmsg:
                connected = 0;
        }
 
-       err = ip6_dst_lookup(sk, &dst, fl);
+       err = ip6_sk_dst_lookup(sk, &dst, fl);
        if (err)
                goto out;
        if (final_p)
index 0eea60ea9ebc540c243a9b02861afd47cdf9ef74..c8c8b44a0f581ee2e486ab5469ed8f9e4ba0bc81 100644 (file)
@@ -125,7 +125,7 @@ static int xfrm6_output_finish(struct sk_buff *skb)
        if (!skb_is_gso(skb))
                return xfrm6_output_finish2(skb);
 
-       skb->protocol = htons(ETH_P_IP);
+       skb->protocol = htons(ETH_P_IPV6);
        segs = skb_gso_segment(skb, 0);
        kfree_skb(skb);
        if (unlikely(IS_ERR(segs)))
index aa34ff4b707ca9a4151c6ce783761370901eaf4c..bef3f61569f76470248a9993a0ed4aae6ef1e8dc 100644 (file)
@@ -1642,13 +1642,17 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
        if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
                goto out;
 
-       ipx             = ipx_hdr(skb);
-       ipx_pktsize     = ntohs(ipx->ipx_pktsize);
+       if (!pskb_may_pull(skb, sizeof(struct ipxhdr)))
+               goto drop;
+
+       ipx_pktsize = ntohs(ipx_hdr(skb)->ipx_pktsize);
        
        /* Too small or invalid header? */
-       if (ipx_pktsize < sizeof(struct ipxhdr) || ipx_pktsize > skb->len)
+       if (ipx_pktsize < sizeof(struct ipxhdr) ||
+           !pskb_may_pull(skb, ipx_pktsize))
                goto drop;
                         
+       ipx = ipx_hdr(skb);
        if (ipx->ipx_checksum != IPX_NO_CHECKSUM &&
           ipx->ipx_checksum != ipx_cksum(ipx, ipx_pktsize))
                goto drop;
index d504eed416f6a468fb95c7d8da9aa2cebdf3813a..7e6bc41eeb216df942fcaf4b0575a1d4e26a6d05 100644 (file)
@@ -238,11 +238,13 @@ int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms)
                goto out_put;
 
        if (lapb->state == LAPB_STATE_0) {
-               if (((parms->mode & LAPB_EXTENDED) &&
-                    (parms->window < 1 || parms->window > 127)) ||
-                   (parms->window < 1 || parms->window > 7))
-                       goto out_put;
-
+               if (parms->mode & LAPB_EXTENDED) {
+                       if (parms->window < 1 || parms->window > 127)
+                               goto out_put;
+               } else {
+                       if (parms->window < 1 || parms->window > 7)
+                               goto out_put;
+               }
                lapb->mode    = parms->mode;
                lapb->window  = parms->window;
        }
index d6cfe84d521ba9fdb9e7321e03d6c9c754f19ed1..2652ead96c64e329b7c2f929316d1324d8aecfd5 100644 (file)
@@ -784,24 +784,20 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
                copied += used;
                len -= used;
 
-               if (used + offset < skb->len)
-                       continue;
-
                if (!(flags & MSG_PEEK)) {
                        sk_eat_skb(sk, skb, 0);
                        *seq = 0;
                }
+
+               /* For non stream protcols we get one packet per recvmsg call */
+               if (sk->sk_type != SOCK_STREAM)
+                       goto copy_uaddr;
+
+               /* Partial read */
+               if (used + offset < skb->len)
+                       continue;
        } while (len > 0);
 
-       /* 
-        * According to UNIX98, msg_name/msg_namelen are ignored
-        * on connected socket. -ANK
-        * But... af_llc still doesn't have separate sets of methods for
-        * SOCK_DGRAM and SOCK_STREAM :-( So we have to do this test, will
-        * eventually fix this tho :-) -acme
-        */
-       if (sk->sk_type == SOCK_DGRAM)
-               goto copy_uaddr;
 out:
        release_sock(sk);
        return copied;
index 20c4eb5c1ac6829f425382d87cb1d3d52052865b..61cb8cf7d1532a4d4b1abd51244e863fc7e8b887 100644 (file)
@@ -51,10 +51,10 @@ void llc_save_primitive(struct sock *sk, struct sk_buff* skb, u8 prim)
 {
        struct sockaddr_llc *addr;
 
-       if (skb->sk->sk_type == SOCK_STREAM) /* See UNIX98 */
-               return;
        /* save primitive for use by the user. */
        addr              = llc_ui_skb_cb(skb);
+
+       memset(addr, 0, sizeof(*addr));
        addr->sllc_family = sk->sk_family;
        addr->sllc_arphrd = skb->dev->type;
        addr->sllc_test   = prim == LLC_TEST_PRIM;
@@ -330,6 +330,9 @@ static void llc_sap_mcast(struct llc_sap *sap,
                if (llc->laddr.lsap != laddr->lsap)
                        continue;
 
+               if (llc->dev != skb->dev)
+                       continue;
+
                skb1 = skb_clone(skb, GFP_ATOMIC);
                if (!skb1)
                        break;
index 42a178aa30f9fde82b434b48ece146e8b1e27b98..a9894ddfd72af22044e12de52ea397ac3c50e3de 100644 (file)
@@ -386,8 +386,8 @@ config NETFILTER_XT_MATCH_REALM
          <file:Documentation/modules.txt>.  If unsure, say `N'.
 
 config NETFILTER_XT_MATCH_SCTP
-       tristate  '"sctp" protocol match support'
-       depends on NETFILTER_XTABLES
+       tristate  '"sctp" protocol match support (EXPERIMENTAL)'
+       depends on NETFILTER_XTABLES && EXPERIMENTAL
        help
          With this option enabled, you will be able to use the 
          `sctp' match in order to match on SCTP source/destination ports
index af4845971f70606d568e731093118b74c0fbf104..6527d4e048d81395f1e5263eb3103f6d65ed2114 100644 (file)
@@ -429,9 +429,9 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
                        cb->args[0], *id);
 
        read_lock_bh(&nf_conntrack_lock);
+       last = (struct nf_conn *)cb->args[1];
        for (; cb->args[0] < nf_conntrack_htable_size; cb->args[0]++) {
 restart:
-               last = (struct nf_conn *)cb->args[1];
                list_for_each_prev(i, &nf_conntrack_hash[cb->args[0]]) {
                        h = (struct nf_conntrack_tuple_hash *) i;
                        if (DIRECTION(h) != IP_CT_DIR_ORIGINAL)
@@ -442,13 +442,10 @@ restart:
                         * then dump everything. */
                        if (l3proto && L3PROTO(ct) != l3proto)
                                continue;
-                       if (last != NULL) {
-                               if (ct == last) {
-                                       nf_ct_put(last);
-                                       cb->args[1] = 0;
-                                       last = NULL;
-                               } else
+                       if (cb->args[1]) {
+                               if (ct != last)
                                        continue;
+                               cb->args[1] = 0;
                        }
                        if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid,
                                                cb->nlh->nlmsg_seq,
@@ -459,17 +456,17 @@ restart:
                                goto out;
                        }
                }
-               if (last != NULL) {
-                       nf_ct_put(last);
+               if (cb->args[1]) {
                        cb->args[1] = 0;
                        goto restart;
                }
        }
 out:
        read_unlock_bh(&nf_conntrack_lock);
+       if (last)
+               nf_ct_put(last);
 
        DEBUGP("leaving, last bucket=%lu id=%u\n", cb->args[0], *id);
-
        return skb->len;
 }
 
index 5fcab2ef231f56d62d5f39deb8ec7b1bc0117e05..4ef8366999623b6723a9e104e56c1ba673989b8c 100644 (file)
@@ -428,6 +428,8 @@ static struct file_operations ct_cpu_seq_fops = {
 
 /* Sysctl support */
 
+int nf_conntrack_checksum = 1;
+
 #ifdef CONFIG_SYSCTL
 
 /* From nf_conntrack_core.c */
@@ -459,8 +461,6 @@ extern unsigned int nf_ct_generic_timeout;
 static int log_invalid_proto_min = 0;
 static int log_invalid_proto_max = 255;
 
-int nf_conntrack_checksum = 1;
-
 static struct ctl_table_header *nf_ct_sysctl_header;
 
 static ctl_table nf_ct_sysctl_table[] = {
index bb6fcee452ca37f8a683d89a4c63775ea250b004..662a869593bff6ea852180428b8ac0dbf8af1692 100644 (file)
@@ -219,21 +219,20 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
 
        switch (verdict & NF_VERDICT_MASK) {
        case NF_ACCEPT:
+       case NF_STOP:
                info->okfn(skb);
+       case NF_STOLEN:
                break;
-
        case NF_QUEUE:
                if (!nf_queue(&skb, elem, info->pf, info->hook, 
                              info->indev, info->outdev, info->okfn,
                              verdict >> NF_VERDICT_BITS))
                        goto next_hook;
                break;
+       default:
+               kfree_skb(skb);
        }
        rcu_read_unlock();
-
-       if (verdict == NF_DROP)
-               kfree_skb(skb);
-
        kfree(info);
        return;
 }
index 61cdda4e5d3ba8b25f02af19a7bbb634fc9a0d84..b59d3b2bde21815ad8c20f8fe758c226eff566f4 100644 (file)
@@ -366,6 +366,9 @@ __nfulnl_send(struct nfulnl_instance *inst)
        if (timer_pending(&inst->timer))
                del_timer(&inst->timer);
 
+       if (!inst->skb)
+               return 0;
+
        if (inst->qlen > 1)
                inst->lastnlh->nlmsg_type = NLMSG_DONE;
 
index c2ce9c4011cc4997bdcc9c1c5e7f9e3a39155fae..de9537ad9a7c5307f48cdbe41147e88ae19132a3 100644 (file)
@@ -57,6 +57,8 @@ static int checkentry_selinux(struct xt_secmark_target_info *info)
 {
        int err;
        struct xt_secmark_target_selinux_info *sel = &info->u.sel;
+       
+       sel->selctx[SECMARK_SELCTX_MAX - 1] = '\0';
 
        err = selinux_string_to_sid(sel->selctx, &sel->selsid);
        if (err) {
index 5fe4c9df17f5e7e015b524e3caa03a0acb3a1781..63a96546746575979e2200b87d9a557c774e6970 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <linux/module.h>
 #include <linux/skbuff.h>
+#include <linux/netfilter_bridge.h>
 #include <linux/netfilter/xt_physdev.h>
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter_bridge.h>
@@ -113,6 +114,21 @@ checkentry(const char *tablename,
        if (!(info->bitmask & XT_PHYSDEV_OP_MASK) ||
            info->bitmask & ~XT_PHYSDEV_OP_MASK)
                return 0;
+       if (brnf_deferred_hooks == 0 &&
+           info->bitmask & XT_PHYSDEV_OP_OUT &&
+           (!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) ||
+            info->invert & XT_PHYSDEV_OP_BRIDGED) &&
+           hook_mask & ((1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) |
+                        (1 << NF_IP_POST_ROUTING))) {
+               printk(KERN_WARNING "physdev match: using --physdev-out in the "
+                      "OUTPUT, FORWARD and POSTROUTING chains for non-bridged "
+                      "traffic is deprecated and breaks other things, it will "
+                      "be removed in January 2007. See Documentation/"
+                      "feature-removal-schedule.txt for details. This doesn't "
+                      "affect you in case you're using it for purely bridged "
+                      "traffic.\n");
+               brnf_deferred_hooks = 1;
+       }
        return 1;
 }
 
index 3ac703b5cb8ffb9413d8c5a7f12f616d576189e3..d2f5320a80bf6a91f97ff2790ec2f3d5540c87e2 100644 (file)
@@ -9,6 +9,8 @@
 #include <linux/skbuff.h>
 #include <linux/if_ether.h>
 #include <linux/if_packet.h>
+#include <linux/in.h>
+#include <linux/ip.h>
 
 #include <linux/netfilter/xt_pkttype.h>
 #include <linux/netfilter/x_tables.h>
@@ -28,9 +30,17 @@ static int match(const struct sk_buff *skb,
       unsigned int protoff,
       int *hotdrop)
 {
+       u_int8_t type;
        const struct xt_pkttype_info *info = matchinfo;
 
-       return (skb->pkt_type == info->pkttype) ^ info->invert;
+       if (skb->pkt_type == PACKET_LOOPBACK)
+               type = (MULTICAST(skb->nh.iph->daddr)
+                       ? PACKET_MULTICAST
+                       : PACKET_BROADCAST);
+       else
+               type = skb->pkt_type;
+
+       return (type == info->pkttype) ^ info->invert;
 }
 
 static struct xt_match pkttype_match = {
index 0ebb6ac2c8c769a2b1a19075d10dc35a1143a32a..275330fcdaaab9dfebba281e3baf5e80671c884c 100644 (file)
@@ -37,7 +37,7 @@ static int match(const struct sk_buff *skb,
 
        return (skb_find_text((struct sk_buff *)skb, conf->from_offset, 
                             conf->to_offset, conf->config, &state) 
-                            != UINT_MAX) && !conf->invert;
+                            != UINT_MAX) conf->invert;
 }
 
 #define STRING_TEXT_PRIV(m) ((struct xt_string_info *) m)
@@ -55,7 +55,10 @@ static int checkentry(const char *tablename,
        /* Damn, can't handle this case properly with iptables... */
        if (conf->from_offset > conf->to_offset)
                return 0;
-
+       if (conf->algo[XT_STRING_MAX_ALGO_NAME_SIZE - 1] != '\0')
+               return 0;
+       if (conf->patlen > XT_STRING_MAX_PATTERN_SIZE)
+               return 0;
        ts_conf = textsearch_prepare(conf->algo, conf->pattern, conf->patlen,
                                     GFP_KERNEL, TS_AUTOLOAD);
        if (IS_ERR(ts_conf))
index eea3669667400868ccde06397175a6bf48fe50a5..0a6cfa0005bed31627f6ec8de3c7ffc3763abe36 100644 (file)
@@ -796,7 +796,7 @@ static int __init init_u32(void)
 {
        printk("u32 classifier\n");
 #ifdef CONFIG_CLS_U32_PERF
-       printk("    Perfomance counters on\n");
+       printk("    Performance counters on\n");
 #endif
 #ifdef CONFIG_NET_CLS_POLICE
        printk("    OLD policer on \n");
index c7844bacbbcbb3770804ff1d2e0afb7a18ce3ead..a19eff12cf78b9013d66f070153c869f8242b151 100644 (file)
@@ -430,7 +430,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
        }
 #endif
 
-       err = -EINVAL;
+       err = -ENOENT;
        if (ops == NULL)
                goto err_out;
 
index 7026b0866b7b0d50b0003b15bb14fde24a569a65..00cb388ece032cec8aeba948bb97c0e653eede5e 100644 (file)
@@ -71,7 +71,12 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
        new = detail->alloc();
        if (!new)
                return NULL;
+       /* must fully initialise 'new', else
+        * we might get lose if we need to
+        * cache_put it soon.
+        */
        cache_init(new);
+       detail->init(new, key);
 
        write_lock(&detail->hash_lock);
 
@@ -85,7 +90,6 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
                        return tmp;
                }
        }
-       detail->init(new, key);
        new->next = *head;
        *head = new;
        detail->entries++;
index 4ba271f892c8791714e635f91f32d50eb1dbd32d..d6409e757219fb2736be52e62d56015990178108 100644 (file)
@@ -921,26 +921,43 @@ call_transmit(struct rpc_task *task)
        task->tk_status = xprt_prepare_transmit(task);
        if (task->tk_status != 0)
                return;
+       task->tk_action = call_transmit_status;
        /* Encode here so that rpcsec_gss can use correct sequence number. */
        if (rpc_task_need_encode(task)) {
-               task->tk_rqstp->rq_bytes_sent = 0;
+               BUG_ON(task->tk_rqstp->rq_bytes_sent != 0);
                call_encode(task);
                /* Did the encode result in an error condition? */
                if (task->tk_status != 0)
-                       goto out_nosend;
+                       return;
        }
-       task->tk_action = call_transmit_status;
        xprt_transmit(task);
        if (task->tk_status < 0)
                return;
-       if (!task->tk_msg.rpc_proc->p_decode) {
-               task->tk_action = rpc_exit_task;
-               rpc_wake_up_task(task);
-       }
-       return;
-out_nosend:
-       /* release socket write lock before attempting to handle error */
-       xprt_abort_transmit(task);
+       /*
+        * On success, ensure that we call xprt_end_transmit() before sleeping
+        * in order to allow access to the socket to other RPC requests.
+        */
+       call_transmit_status(task);
+       if (task->tk_msg.rpc_proc->p_decode != NULL)
+               return;
+       task->tk_action = rpc_exit_task;
+       rpc_wake_up_task(task);
+}
+
+/*
+ * 5a. Handle cleanup after a transmission
+ */
+static void
+call_transmit_status(struct rpc_task *task)
+{
+       task->tk_action = call_status;
+       /*
+        * Special case: if we've been waiting on the socket's write_space()
+        * callback, then don't call xprt_end_transmit().
+        */
+       if (task->tk_status == -EAGAIN)
+               return;
+       xprt_end_transmit(task);
        rpc_task_force_reencode(task);
 }
 
@@ -992,18 +1009,7 @@ call_status(struct rpc_task *task)
 }
 
 /*
- * 6a. Handle transmission errors.
- */
-static void
-call_transmit_status(struct rpc_task *task)
-{
-       if (task->tk_status != -EAGAIN)
-               rpc_task_force_reencode(task);
-       call_status(task);
-}
-
-/*
- * 6b. Handle RPC timeout
+ * 6a. Handle RPC timeout
  *     We do not release the request slot, so we keep using the
  *     same XID for all retransmits.
  */
index dc6cb93c88308ef0f966b13bf40d09978db0c7c6..a3bd2db2e024d36112394766e42166b0dbb9b0b2 100644 (file)
@@ -667,10 +667,11 @@ rpc_mkdir(char *path, struct rpc_clnt *rpc_client)
                        RPCAUTH_info, RPCAUTH_EOF);
        if (error)
                goto err_depopulate;
+       dget(dentry);
 out:
        mutex_unlock(&dir->i_mutex);
        rpc_release_path(&nd);
-       return dget(dentry);
+       return dentry;
 err_depopulate:
        rpc_depopulate(dentry);
        __rpc_rmdir(dir, dentry);
@@ -731,10 +732,11 @@ rpc_mkpipe(char *path, void *private, struct rpc_pipe_ops *ops, int flags)
        rpci->flags = flags;
        rpci->ops = ops;
        inode_dir_notify(dir, DN_CREATE);
+       dget(dentry);
 out:
        mutex_unlock(&dir->i_mutex);
        rpc_release_path(&nd);
-       return dget(dentry);
+       return dentry;
 err_dput:
        dput(dentry);
        dentry = ERR_PTR(-ENOMEM);
index 313b68d892c644c82ea5eb79c84ed6a163c76355..e8c2bc4977f3a41dbfbd6c3a85a4c15b6a14e6eb 100644 (file)
@@ -707,12 +707,9 @@ out_unlock:
        return err;
 }
 
-void
-xprt_abort_transmit(struct rpc_task *task)
+void xprt_end_transmit(struct rpc_task *task)
 {
-       struct rpc_xprt *xprt = task->tk_xprt;
-
-       xprt_release_write(xprt, task);
+       xprt_release_write(task->tk_xprt, task);
 }
 
 /**
@@ -761,8 +758,6 @@ void xprt_transmit(struct rpc_task *task)
                        task->tk_status = -ENOTCONN;
                else if (!req->rq_received)
                        rpc_sleep_on(&xprt->pending, task, NULL, xprt_timer);
-
-               xprt->ops->release_xprt(xprt, task);
                spin_unlock_bh(&xprt->transport_lock);
                return;
        }
@@ -772,18 +767,8 @@ void xprt_transmit(struct rpc_task *task)
         *       schedq, and being picked up by a parallel run of rpciod().
         */
        task->tk_status = status;
-
-       switch (status) {
-       case -ECONNREFUSED:
+       if (status == -ECONNREFUSED)
                rpc_sleep_on(&xprt->sending, task, NULL, NULL);
-       case -EAGAIN:
-       case -ENOTCONN:
-               return;
-       default:
-               break;
-       }
-       xprt_release_write(xprt, task);
-       return;
 }
 
 static inline void do_xprt_reserve(struct rpc_task *task)
index ee678ed13b6f26ac61ce9016787b5fa76705b05d..441bd53f5eca81fbb8d4bb495f5c72bfac1aebb0 100644 (file)
@@ -413,6 +413,33 @@ static int xs_tcp_send_request(struct rpc_task *task)
        return status;
 }
 
+/**
+ * xs_tcp_release_xprt - clean up after a tcp transmission
+ * @xprt: transport
+ * @task: rpc task
+ *
+ * This cleans up if an error causes us to abort the transmission of a request.
+ * In this case, the socket may need to be reset in order to avoid confusing
+ * the server.
+ */
+static void xs_tcp_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
+{
+       struct rpc_rqst *req;
+
+       if (task != xprt->snd_task)
+               return;
+       if (task == NULL)
+               goto out_release;
+       req = task->tk_rqstp;
+       if (req->rq_bytes_sent == 0)
+               goto out_release;
+       if (req->rq_bytes_sent == req->rq_snd_buf.len)
+               goto out_release;
+       set_bit(XPRT_CLOSE_WAIT, &task->tk_xprt->state);
+out_release:
+       xprt_release_xprt(xprt, task);
+}
+
 /**
  * xs_close - close a socket
  * @xprt: transport
@@ -1250,7 +1277,7 @@ static struct rpc_xprt_ops xs_udp_ops = {
 
 static struct rpc_xprt_ops xs_tcp_ops = {
        .reserve_xprt           = xprt_reserve_xprt,
-       .release_xprt           = xprt_release_xprt,
+       .release_xprt           = xs_tcp_release_xprt,
        .set_port               = xs_set_port,
        .connect                = xs_connect,
        .buf_alloc              = rpc_malloc,
index 6f2909279268aadd136f28a3c210e6533f2c92c7..de6ec519272e5225f85bce0b909a5241a6371a6f 100644 (file)
@@ -128,23 +128,17 @@ static atomic_t unix_nr_socks = ATOMIC_INIT(0);
 #define UNIX_ABSTRACT(sk)      (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE)
 
 #ifdef CONFIG_SECURITY_NETWORK
-static void unix_get_peersec_dgram(struct sk_buff *skb)
+static void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb)
 {
-       int err;
-
-       err = security_socket_getpeersec_dgram(skb, UNIXSECDATA(skb),
-                                              UNIXSECLEN(skb));
-       if (err)
-               *(UNIXSECDATA(skb)) = NULL;
+       memcpy(UNIXSID(skb), &scm->secid, sizeof(u32));
 }
 
 static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
 {
-       scm->secdata = *UNIXSECDATA(skb);
-       scm->seclen = *UNIXSECLEN(skb);
+       scm->secid = *UNIXSID(skb);
 }
 #else
-static inline void unix_get_peersec_dgram(struct sk_buff *skb)
+static inline void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb)
 { }
 
 static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
@@ -1322,8 +1316,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
        memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
        if (siocb->scm->fp)
                unix_attach_fds(siocb->scm, skb);
-
-       unix_get_peersec_dgram(skb);
+       unix_get_secdata(siocb->scm, skb);
 
        skb->h.raw = skb->data;
        err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
index f35bc676128c1a1f5f836816b285fe59af3f070e..3da67ca2c3ce9890b9774e4d2757d3f33928c493 100644 (file)
@@ -1134,12 +1134,33 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
 }
 EXPORT_SYMBOL(__xfrm_route_forward);
 
+/* Optimize later using cookies and generation ids. */
+
 static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie)
 {
-       /* If it is marked obsolete, which is how we even get here,
-        * then we have purged it from the policy bundle list and we
-        * did that for a good reason.
+       /* Code (such as __xfrm4_bundle_create()) sets dst->obsolete
+        * to "-1" to force all XFRM destinations to get validated by
+        * dst_ops->check on every use.  We do this because when a
+        * normal route referenced by an XFRM dst is obsoleted we do
+        * not go looking around for all parent referencing XFRM dsts
+        * so that we can invalidate them.  It is just too much work.
+        * Instead we make the checks here on every use.  For example:
+        *
+        *      XFRM dst A --> IPv4 dst X
+        *
+        * X is the "xdst->route" of A (X is also the "dst->path" of A
+        * in this example).  If X is marked obsolete, "A" will not
+        * notice.  That's what we are validating here via the
+        * stale_bundle() check.
+        *
+        * When a policy's bundle is pruned, we dst_free() the XFRM
+        * dst which causes it's ->obsolete field to be set to a
+        * positive non-zero integer.  If an XFRM dst has been pruned
+        * like this, we want to force a new route lookup.
         */
+       if (dst->obsolete < 0 && !stale_bundle(dst))
+               return dst;
+
        return NULL;
 }
 
index 2180c88cfe89111a79cfb15bb8361aefcd067d59..bb19c1561f1e0bb1701c72b44a863284e42061fa 100644 (file)
@@ -77,14 +77,20 @@ cc-option-align = $(subst -functions=0,,\
 
 # cc-version
 # Usage gcc-ver := $(call cc-version, $(CC))
-cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
-              $(if $(1), $(1), $(CC)))
+cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
 
 # cc-ifversion
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
 cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \
                        echo $(3); fi;)
 
+# ld-option
+# Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
+ld-option = $(shell if $(CC) $(1) \
+                            -nostdlib -o ldtest$$$$.out -xc /dev/null \
+             > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi; \
+            rm -f ldtest$$$$.out)
+
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Usage:
index a49550205dcc5eab6147dab893334a96d34f9123..0a64688c2b5db9352c91878103d8dd2cc1161510 100644 (file)
@@ -40,7 +40,7 @@ include scripts/Kbuild.include
 include scripts/Makefile.lib
 
 kernelsymfile := $(objtree)/Module.symvers
-modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers
+modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
 
 # Step 1), find all modules listed in $(MODVERDIR)/
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
index 2ee48c377b66b5e3f01ba752ad1944f303e22ad9..a69d8acbf274fc958c8e0eff2c5038e72fa03b00 100644 (file)
@@ -357,7 +357,7 @@ int conf_read(const char *name)
                for (e = prop->expr; e; e = e->left.expr)
                        if (e->right.sym->visible != no)
                                flags &= e->right.sym->flags;
-               sym->flags |= flags & SYMBOL_DEF_USER;
+               sym->flags &= flags | ~SYMBOL_DEF_USER;
        }
 
        sym_change_count += conf_warnings || conf_unsaved;
index f9460a6218de414b04d4e3785b28de0b6e9331a2..c9ca0c23bd9100f3b583c4a87b7a3e096ce324dc 100755 (executable)
@@ -1518,6 +1518,7 @@ sub dump_function($$) {
     $prototype =~ s/^asmlinkage +//;
     $prototype =~ s/^inline +//;
     $prototype =~ s/^__inline__ +//;
+    $prototype =~ s/__devinit +//;
     $prototype =~ s/^#define +//; #ak added
     $prototype =~ s/__attribute__ \(\([a-z,]*\)\)//;
 
index 37f67c23e11b277bc9b999cf0e1df6bb6e9859c6..e2de650d3dbff82ea73de953aec6edffc63f28e5 100644 (file)
@@ -52,6 +52,23 @@ do {                                                            \
                 sprintf(str + strlen(str), "*");                \
 } while(0)
 
+/**
+ * Check that sizeof(device_id type) are consistent with size of section
+ * in .o file. If in-consistent then userspace and kernel does not agree
+ * on actual size which is a bug.
+ **/
+static void device_id_size_check(const char *modname, const char *device_id,
+                                unsigned long size, unsigned long id_size)
+{
+       if (size % id_size || size < id_size) {
+               fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
+                     "of the size of section __mod_%s_device_table=%lu.\n"
+                     "Fix definition of struct %s_device_id "
+                     "in mod_devicetable.h\n",
+                     modname, device_id, id_size, device_id, size, device_id);
+       }
+}
+
 /* USB is special because the bcdDevice can be matched against a numeric range */
 /* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */
 static void do_usb_entry(struct usb_device_id *id,
@@ -152,10 +169,8 @@ static void do_usb_table(void *symval, unsigned long size,
        unsigned int i;
        const unsigned long id_size = sizeof(struct usb_device_id);
 
-       if (size % id_size || size < id_size) {
-               warn("%s ids %lu bad size "
-                    "(each on %lu)\n", mod->name, size, id_size);
-       }
+       device_id_size_check(mod->name, "usb", size, id_size);
+
        /* Leave last one: it's the terminator. */
        size -= id_size;
 
@@ -376,7 +391,7 @@ static void do_input(char *alias,
        unsigned int i;
 
        for (i = min; i < max; i++)
-               if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG)))
+               if (arr[i / BITS_PER_LONG] & (1L << (i%BITS_PER_LONG)))
                        sprintf(alias + strlen(alias), "%X,*", i);
 }
 
@@ -434,6 +449,7 @@ static inline int sym_is(const char *symbol, const char *name)
 
 static void do_table(void *symval, unsigned long size,
                     unsigned long id_size,
+                    const char *device_id,
                     void *function,
                     struct module *mod)
 {
@@ -441,10 +457,7 @@ static void do_table(void *symval, unsigned long size,
        char alias[500];
        int (*do_entry)(const char *, void *entry, char *alias) = function;
 
-       if (size % id_size || size < id_size) {
-               warn("%s ids %lu bad size "
-                    "(each on %lu)\n", mod->name, size, id_size);
-       }
+       device_id_size_check(mod->name, device_id, size, id_size);
        /* Leave last one: it's the terminator. */
        size -= id_size;
 
@@ -476,40 +489,51 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
                + sym->st_value;
 
        if (sym_is(symname, "__mod_pci_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct pci_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct pci_device_id), "pci",
                         do_pci_entry, mod);
        else if (sym_is(symname, "__mod_usb_device_table"))
                /* special case to handle bcdDevice ranges */
                do_usb_table(symval, sym->st_size, mod);
        else if (sym_is(symname, "__mod_ieee1394_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct ieee1394_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct ieee1394_device_id), "ieee1394",
                         do_ieee1394_entry, mod);
        else if (sym_is(symname, "__mod_ccw_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct ccw_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct ccw_device_id), "ccw",
                         do_ccw_entry, mod);
        else if (sym_is(symname, "__mod_serio_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct serio_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct serio_device_id), "serio",
                         do_serio_entry, mod);
        else if (sym_is(symname, "__mod_pnp_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct pnp_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct pnp_device_id), "pnp",
                         do_pnp_entry, mod);
        else if (sym_is(symname, "__mod_pnp_card_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct pnp_card_device_id), "pnp_card",
                         do_pnp_card_entry, mod);
        else if (sym_is(symname, "__mod_pcmcia_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct pcmcia_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct pcmcia_device_id), "pcmcia",
                         do_pcmcia_entry, mod);
         else if (sym_is(symname, "__mod_of_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct of_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct of_device_id), "of",
                         do_of_entry, mod);
         else if (sym_is(symname, "__mod_vio_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct vio_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct vio_device_id), "vio",
                         do_vio_entry, mod);
        else if (sym_is(symname, "__mod_i2c_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct i2c_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct i2c_device_id), "i2c",
                         do_i2c_entry, mod);
        else if (sym_is(symname, "__mod_input_device_table"))
-               do_table(symval, sym->st_size, sizeof(struct input_device_id),
+               do_table(symval, sym->st_size,
+                        sizeof(struct input_device_id), "input",
                         do_input_entry, mod);
 }
 
index bbbfda70e1316effbc0475687cd02fd210813e94..58c6d399c844bb483c97337adbde561d6e2980d1 100644 (file)
@@ -791,8 +791,7 @@ static int dummy_socket_getpeersec_stream(struct socket *sock, char __user *optv
        return -ENOPROTOOPT;
 }
 
-static int dummy_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,
-                                        u32 *seclen)
+static int dummy_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
 {
        return -ENOPROTOOPT;
 }
@@ -876,6 +875,15 @@ static int dummy_setprocattr(struct task_struct *p, char *name, void *value, siz
        return -EINVAL;
 }
 
+static int dummy_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
+{
+       return -EOPNOTSUPP;
+}
+
+static void dummy_release_secctx(char *secdata, u32 seclen)
+{
+}
+
 #ifdef CONFIG_KEYS
 static inline int dummy_key_alloc(struct key *key, struct task_struct *ctx,
                                  unsigned long flags)
@@ -1028,6 +1036,8 @@ void security_fixup_ops (struct security_operations *ops)
        set_to_dummy_if_null(ops, d_instantiate);
        set_to_dummy_if_null(ops, getprocattr);
        set_to_dummy_if_null(ops, setprocattr);
+       set_to_dummy_if_null(ops, secid_to_secctx);
+       set_to_dummy_if_null(ops, release_secctx);
 #ifdef CONFIG_SECURITY_NETWORK
        set_to_dummy_if_null(ops, unix_stream_connect);
        set_to_dummy_if_null(ops, unix_may_send);
index a91c961ba38b5d93deb4a005f79336f17f6d8acd..5d1b8c733199ed57700757ffc1e0b0c3a8077f05 100644 (file)
@@ -3524,25 +3524,21 @@ out:
        return err;
 }
 
-static int selinux_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, u32 *seclen)
+static int selinux_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
 {
+       u32 peer_secid = SECSID_NULL;
        int err = 0;
-       u32 peer_sid;
 
-       if (skb->sk->sk_family == PF_UNIX)
-               selinux_get_inode_sid(SOCK_INODE(skb->sk->sk_socket),
-                                     &peer_sid);
-       else
-               peer_sid = selinux_socket_getpeer_dgram(skb);
-
-       if (peer_sid == SECSID_NULL)
-               return -EINVAL;
+       if (sock && (sock->sk->sk_family == PF_UNIX))
+               selinux_get_inode_sid(SOCK_INODE(sock), &peer_secid);
+       else if (skb)
+               peer_secid = selinux_socket_getpeer_dgram(skb);
 
-       err = security_sid_to_context(peer_sid, secdata, seclen);
-       if (err)
-               return err;
+       if (peer_secid == SECSID_NULL)
+               err = -EINVAL;
+       *secid = peer_secid;
 
-       return 0;
+       return err;
 }
 
 static int selinux_sk_alloc_security(struct sock *sk, int family, gfp_t priority)
@@ -4407,6 +4403,17 @@ static int selinux_setprocattr(struct task_struct *p,
        return size;
 }
 
+static int selinux_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
+{
+       return security_sid_to_context(secid, secdata, seclen);
+}
+
+static void selinux_release_secctx(char *secdata, u32 seclen)
+{
+       if (secdata)
+               kfree(secdata);
+}
+
 #ifdef CONFIG_KEYS
 
 static int selinux_key_alloc(struct key *k, struct task_struct *tsk,
@@ -4587,6 +4594,9 @@ static struct security_operations selinux_ops = {
        .getprocattr =                  selinux_getprocattr,
        .setprocattr =                  selinux_setprocattr,
 
+       .secid_to_secctx =              selinux_secid_to_secctx,
+       .release_secctx =               selinux_release_secctx,
+
         .unix_stream_connect =         selinux_socket_unix_stream_connect,
        .unix_may_send =                selinux_socket_unix_may_send,
 
index 0111990ba8378e6ac8222817f92b188aa50ea299..f03960e697ceb5a3f27e1b54dc0bbbaba437b0bb 100644 (file)
@@ -644,10 +644,18 @@ void policydb_destroy(struct policydb *p)
        kfree(lra);
 
        for (rt = p->range_tr; rt; rt = rt -> next) {
-               kfree(lrt);
+               if (lrt) {
+                       ebitmap_destroy(&lrt->range.level[0].cat);
+                       ebitmap_destroy(&lrt->range.level[1].cat);
+                       kfree(lrt);
+               }
                lrt = rt;
        }
-       kfree(lrt);
+       if (lrt) {
+               ebitmap_destroy(&lrt->range.level[0].cat);
+               ebitmap_destroy(&lrt->range.level[1].cat);
+               kfree(lrt);
+       }
 
        if (p->type_attr_map) {
                for (i = 0; i < p->p_types.nprim; i++)
index d2e80e62ff0c9595414f38d00e3d5e49487cb77d..85e4298843936fb920533ee9007f706774a240c9 100644 (file)
@@ -833,6 +833,8 @@ static int security_compute_sid(u32 ssid,
                goto out;
        }
 
+       context_init(&newcontext);
+
        POLICY_RDLOCK;
 
        scontext = sidtab_search(&sidtab, ssid);
@@ -850,8 +852,6 @@ static int security_compute_sid(u32 ssid,
                goto out_unlock;
        }
 
-       context_init(&newcontext);
-
        /* Set the user identity. */
        switch (specified) {
        case AVTAB_TRANSITION:
index bcc555647e79677a2759f9b9e5079501ef0eff87..3c7d1d8a9a6f3f2568c40502e886a3d6e7ccd6ff 100644 (file)
@@ -51,6 +51,13 @@ static struct transfer_info toonie_transfers[] = {
        {}
 };
 
+static int toonie_usable(struct codec_info_item *cii,
+                        struct transfer_info *ti,
+                        struct transfer_info *out)
+{
+       return 1;
+}
+
 #ifdef CONFIG_PM
 static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
 {
@@ -69,6 +76,7 @@ static struct codec_info toonie_codec_info = {
        .sysclock_factor = 256,
        .bus_factor = 64,
        .owner = THIS_MODULE,
+       .usable = toonie_usable,
 #ifdef CONFIG_PM
        .suspend = toonie_suspend,
        .resume = toonie_resume,
@@ -79,19 +87,20 @@ static int toonie_init_codec(struct aoa_codec *codec)
 {
        struct toonie *toonie = codec_to_toonie(codec);
 
+       /* nothing connected? what a joke! */
+       if (toonie->codec.connected != 1)
+               return -ENOTCONN;
+
        if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
                printk(KERN_ERR PFX "failed to create toonie snd device!\n");
                return -ENODEV;
        }
 
-       /* nothing connected? what a joke! */
-       if (toonie->codec.connected != 1)
-               return -ENOTCONN;
-
        if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
                                                     aoa_get_card(),
                                                     &toonie_codec_info, toonie)) {
                printk(KERN_ERR PFX "error creating toonie pcm\n");
+               snd_device_free(aoa_get_card(), toonie);
                return -ENODEV;
        }
 
index 7ae0c0bdfad8fec28e49f4bb3cde0c18e5c3ee9d..f69d33357a28777eab460943bcec783bd52d70c6 100644 (file)
@@ -112,7 +112,10 @@ static struct device_node *get_gpio(char *name,
 
 static void get_irq(struct device_node * np, int *irqptr)
 {
-       *irqptr = irq_of_parse_and_map(np, 0);
+       if (np)
+               *irqptr = irq_of_parse_and_map(np, 0);
+       else
+               *irqptr = NO_IRQ;
 }
 
 /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
@@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_runtime *rt,
                return -EINVAL;
        }
 
-       if (irq == -1)
+       if (irq == NO_IRQ)
                return -ENODEV;
 
        mutex_lock(&notif->mutex);
index 3d57fd1aec4b6888c6d4664015404425143c6285..2836c3218391c549156e0b3e53048daf6ec64cd1 100644 (file)
@@ -18,7 +18,7 @@ static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
                                                        \
        if (unlikely(!rt)) return;                              \
        rc = pmf_call_function(rt->node, #name "-mute", &args); \
-       if (rc)                                                 \
+       if (rc && rc != -ENODEV)                                \
                printk(KERN_WARNING "pmf_gpio_set_" #name       \
                " failed, rc: %d\n", rc);                       \
        rt->implementation_private &= ~(1<<bit);                \
index 71b5080fa66d0dc603785046fcb001a341da9f74..75a9505c744556551f2e12c090e3eb2c03f4d789 100644 (file)
@@ -988,13 +988,12 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
        if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) {
                struct snd_ctl_elem_info *uinfo;
 
-               uinfo = kmalloc(sizeof(*uinfo), GFP_KERNEL);
+               uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
                if (! uinfo) {
                        up_read(&mixer->card->controls_rwsem);
                        return -ENOMEM;
                }
                        
-               memset(uinfo, 0, sizeof(*uinfo));
                if (kctl->info(kctl, uinfo)) {
                        up_read(&mixer->card->controls_rwsem);
                        return 0;
index f5ff4f4a16ee0b7964599c49f1311176dc7a6aa1..472fce0ee0e8111210e68ead84424f4f477635f2 100644 (file)
@@ -2228,6 +2228,8 @@ static int snd_pcm_oss_open_file(struct file *file,
        for (idx = 0; idx < 2; idx++) {
                if (setup[idx].disable)
                        continue;
+               if (! pcm->streams[idx].substream_count)
+                       continue; /* no matching substream */
                if (idx == SNDRV_PCM_STREAM_PLAYBACK) {
                        if (! (f_mode & FMODE_WRITE))
                                continue;
index 4260de90f36fb39468d7a623649f7f7486a4ab9c..102ff548ce6931df6ec5e946c5df04138cb63734 100644 (file)
@@ -372,10 +372,9 @@ static struct ops_list * create_driver(char *id)
 {
        struct ops_list *ops;
 
-       ops = kmalloc(sizeof(*ops), GFP_KERNEL);
+       ops = kzalloc(sizeof(*ops), GFP_KERNEL);
        if (ops == NULL)
                return ops;
-       memset(ops, 0, sizeof(*ops));
 
        /* set up driver entry */
        strlcpy(ops->id, id, sizeof(ops->id));
index 6e4d4ab34632f009e3507e3ffc932066a2d3f567..c30669f14ac0f2f386ba524aae4eaba5add06c03 100644 (file)
@@ -68,21 +68,18 @@ void *snd_malloc_sgbuf_pages(struct device *device,
 
        dmab->area = NULL;
        dmab->addr = 0;
-       dmab->private_data = sgbuf = kmalloc(sizeof(*sgbuf), GFP_KERNEL);
+       dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL);
        if (! sgbuf)
                return NULL;
-       memset(sgbuf, 0, sizeof(*sgbuf));
        sgbuf->dev = device;
        pages = snd_sgbuf_aligned_pages(size);
        sgbuf->tblsize = sgbuf_align_table(pages);
-       sgbuf->table = kmalloc(sizeof(*sgbuf->table) * sgbuf->tblsize, GFP_KERNEL);
+       sgbuf->table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->table), GFP_KERNEL);
        if (! sgbuf->table)
                goto _failed;
-       memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize);
-       sgbuf->page_table = kmalloc(sizeof(*sgbuf->page_table) * sgbuf->tblsize, GFP_KERNEL);
+       sgbuf->page_table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->page_table), GFP_KERNEL);
        if (! sgbuf->page_table)
                goto _failed;
-       memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize);
 
        /* allocate each page */
        for (i = 0; i < pages; i++) {
index c4af84995d0544b1173b2152be2c0ab46ab09001..7e65a103fbb2f357ebbf59789cbac13c81aea8f5 100644 (file)
@@ -1252,18 +1252,15 @@ static int vx_init_audio_io(struct vx_core *chip)
        chip->audio_info = rmh.Stat[1];
 
        /* allocate pipes */
-       chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL);
+       chip->playback_pipes = kcalloc(chip->audio_outs, sizeof(struct vx_pipe *), GFP_KERNEL);
        if (!chip->playback_pipes)
                return -ENOMEM;
-       chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL);
+       chip->capture_pipes = kcalloc(chip->audio_ins, sizeof(struct vx_pipe *), GFP_KERNEL);
        if (!chip->capture_pipes) {
                kfree(chip->playback_pipes);
                return -ENOMEM;
        }
 
-       memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs);
-       memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins);
-
        preferred = chip->ibl.size;
        chip->ibl.size = 0;
        vx_set_ibl(chip, &chip->ibl); /* query the info */
index f4980ca5c05c86d9f4cbd8c86c885f2bd35af09c..1b7c3dfc2b41352c24e9fd6833dcb90a2d19beca 100644 (file)
@@ -31,7 +31,7 @@ config SOUND_EMU10K1
          For more information on this driver and the degree of support for
          the different card models please check:
 
-               <http://sourceforge.net/projects/emu10k1/>
+               <http://sourceforge.net/projects/emu10k1/>
 
          It is now possible to load dsp microcode patches into the EMU10K1
          chip.  These patches are used to implement real time sound
@@ -140,7 +140,7 @@ config SOUND_TRIDENT
          system support" and "Sysctl support", and after the /proc file
          system has been mounted, executing the command
 
-               command                 what is enabled
+               command                 what is enabled
 
          echo 0>/proc/ALi5451  pcm out is also set to S/PDIF out. (Default).
 
@@ -838,7 +838,7 @@ config SOUND_WAVEARTIST
 
 config SOUND_TVMIXER
        tristate "TV card (bt848) mixer support"
-       depends on SOUND_PRIME && I2C
+       depends on SOUND_PRIME && I2C && VIDEO_V4L1
        help
          Support for audio mixer facilities on the BT848 TV frame-grabber
          card.
index d7ad32f514da5f20f38f159fd96d40cc47d1c86a..e49c0fe21b0d13d12283c5fe908e7cc60e74df6d 100644 (file)
@@ -16,16 +16,16 @@ config SND_AD1889
          will be called snd-ad1889.
 
 config SND_ALS300
-        tristate "Avance Logic ALS300/ALS300+"
-        depends on SND
-        select SND_PCM
-        select SND_AC97_CODEC
-        select SND_OPL3_LIB
-        help
-          Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+
+       tristate "Avance Logic ALS300/ALS300+"
+       depends on SND
+       select SND_PCM
+       select SND_AC97_CODEC
+       select SND_OPL3_LIB
+       help
+         Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+
 
-          To compile this driver as a module, choose M here: the module
-          will be called snd-als300
+         To compile this driver as a module, choose M here: the module
+         will be called snd-als300
 
 config SND_ALS4000
        tristate "Avance Logic ALS4000"
@@ -78,49 +78,49 @@ config SND_ATIIXP_MODEM
          will be called snd-atiixp-modem.
 
 config SND_AU8810
-        tristate "Aureal Advantage"
-        depends on SND
+       tristate "Aureal Advantage"
+       depends on SND
        select SND_MPU401_UART
        select SND_AC97_CODEC
-        help
+       help
          Say Y here to include support for Aureal Advantage soundcards.
 
          Supported features: Hardware Mixer, SRC, EQ and SPDIF output.
-          3D support code is in place, but not yet useable. For more info, 
-          email the ALSA developer list, or <mjander@users.sourceforge.net>.
+         3D support code is in place, but not yet useable. For more info,
+         email the ALSA developer list, or <mjander@users.sourceforge.net>.
 
          To compile this driver as a module, choose M here: the module
          will be called snd-au8810.
+
 config SND_AU8820
-        tristate "Aureal Vortex"
-        depends on SND
+       tristate "Aureal Vortex"
+       depends on SND
        select SND_MPU401_UART
        select SND_AC97_CODEC
-        help
+       help
          Say Y here to include support for Aureal Vortex soundcards.
 
-          Supported features: Hardware Mixer and SRC. For more info, email 
-          the ALSA developer list, or <mjander@users.sourceforge.net>.
+         Supported features: Hardware Mixer and SRC. For more info, email
+         the ALSA developer list, or <mjander@users.sourceforge.net>.
 
          To compile this driver as a module, choose M here: the module
          will be called snd-au8820.
+
 config SND_AU8830
-        tristate "Aureal Vortex 2"
-        depends on SND
+       tristate "Aureal Vortex 2"
+       depends on SND
        select SND_MPU401_UART
        select SND_AC97_CODEC
-        help
+       help
          Say Y here to include support for Aureal Vortex 2 soundcards.
 
-          Supported features: Hardware Mixer, SRC, EQ and SPDIF output.
-          3D support code is in place, but not yet useable. For more info, 
-          email the ALSA developer list, or <mjander@users.sourceforge.net>.
+         Supported features: Hardware Mixer, SRC, EQ and SPDIF output.
+         3D support code is in place, but not yet useable. For more info,
+         email the ALSA developer list, or <mjander@users.sourceforge.net>.
 
          To compile this driver as a module, choose M here: the module
          will be called snd-au8830.
+
 config SND_AZT3328
        tristate "Aztech AZF3328 / PCI168 (EXPERIMENTAL)"
        depends on SND && EXPERIMENTAL
@@ -135,10 +135,10 @@ config SND_AZT3328
          will be called snd-azt3328.
 
 config SND_BT87X
-        tristate "Bt87x Audio Capture"
-        depends on SND
+       tristate "Bt87x Audio Capture"
+       depends on SND
        select SND_PCM
-        help
+       help
          If you want to record audio from TV cards based on
          Brooktree Bt878/Bt879 chips, say Y here and read
          <file:Documentation/sound/alsa/Bt87x.txt>.
@@ -209,7 +209,7 @@ config SND_CS46XX
 config SND_CS46XX_NEW_DSP
        bool "Cirrus Logic (Sound Fusion) New DSP support"
        depends on SND_CS46XX
-        default y
+       default y
        help
          Say Y here to use a new DSP image for SPDIF and dual codecs.
 
@@ -225,7 +225,7 @@ config SND_CS5535AUDIO
          referred to as NS CS5535 IO or AMD CS5535 IO companion in
          various literature. This driver also supports the CS5536 audio
          device. However, for both chips, on certain boards, you may
-         need to use ac97_quirk=hp_only if your board has physically 
+         need to use ac97_quirk=hp_only if your board has physically
          mapped headphone out to master output. If that works for you,
          send lspci -vvv output to the mailing list so that your board
          can be identified in the quirks list.
@@ -468,11 +468,13 @@ config SND_FM801_TEA575X_BOOL
          FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media
          Forte SF256-PCS-02) into the snd-fm801 driver.
 
+         This will enable support for the old V4L1 API.
+
 config SND_FM801_TEA575X
        tristate
        depends on SND_FM801_TEA575X_BOOL
        default SND_FM801
-       select VIDEO_DEV
+       select VIDEO_V4L1
 
 config SND_HDA_INTEL
        tristate "Intel HD Audio"
index 27a8dbe6f6a8ad9aadf564b40a2b6c368c7f5bc4..c3dafa29054f96c618c1c824830ec06623c47014 100644 (file)
@@ -236,9 +236,9 @@ static int pcm_open(struct snd_pcm_substream *substream,
        chip = snd_pcm_substream_chip(substream);
        runtime = substream->runtime;
 
-       if (!(pipe = kmalloc(sizeof(struct audiopipe), GFP_KERNEL)))
+       pipe = kzalloc(sizeof(struct audiopipe), GFP_KERNEL);
+       if (!pipe)
                return -ENOMEM;
-       memset(pipe, 0, sizeof(struct audiopipe));
        pipe->index = -1;               /* Not configured yet */
 
        /* Set up hw capabilities and contraints */
index f9b5c3dc3b346ac51bb5f9e0543d85268475fd50..79f24cdf5fbf0b121b6c7564325d8983e89e86d1 100644 (file)
@@ -936,6 +936,17 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .ca0151_chip = 1,
         .spk71 = 1,
         .spdif_bug = 1} ,
+       /* Dell OEM/Creative Labs Audigy 2 ZS */
+       /* See ALSA bug#1365 */
+       {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10031102,
+        .driver = "Audigy2", .name = "Audigy 2 ZS [SB0353]",
+        .id = "Audigy2",
+        .emu10k2_chip = 1,
+        .ca0102_chip = 1,
+        .ca0151_chip = 1,
+        .spk71 = 1,
+        .spdif_bug = 1,
+        .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
         .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]", 
         .id = "Audigy2",
index a8b31286b6db773de31d7157f5df84683d0779b3..1076af4c36696cf2572fe5f1c8b034639c43905f 100644 (file)
@@ -37,9 +37,13 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        int handled = 0;
 
        while ((status = inl(emu->port + IPR)) != 0) {
-               //printk("emu10k1 irq - status = 0x%x\n", status);
+               //snd_printk(KERN_INFO "emu10k1 irq - status = 0x%x\n", status);
                orig_status = status;
                handled = 1;
+               if ((status & 0xffffffff) == 0xffffffff) {
+                       snd_printk(KERN_INFO "snd-emu10k1: Suspected sound card removal\n");
+                       break;
+               }
                if (status & IPR_PCIERROR) {
                        snd_printk(KERN_ERR "interrupt: PCI error\n");
                        snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE);
index 82d791be74993574aa8b3865b23ca269e90adb16..05dabe4546587d53d597ae5e57e169e8de30afa1 100644 (file)
@@ -801,11 +801,10 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
        chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf;
 #ifdef PMAC_AMP_AVAIL
        if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) {
-               struct awacs_amp *amp = kmalloc(sizeof(*amp), GFP_KERNEL);
+               struct awacs_amp *amp = kzalloc(sizeof(*amp), GFP_KERNEL);
                if (! amp)
                        return -ENOMEM;
                chip->mixer_data = amp;
-               memset(amp, 0, sizeof(*amp));
                chip->mixer_free = awacs_amp_free;
                awacs_amp_set_vol(amp, 0, 63, 63, 0); /* mute and zero vol */
                awacs_amp_set_vol(amp, 1, 63, 63, 0);
index 46eebf5610e39386cd3fc72eb40ccba456380d80..57202b0f033ecf977e121bf732a1834c17f6f5dd 100644 (file)
@@ -258,10 +258,9 @@ int __init snd_pmac_daca_init(struct snd_pmac *chip)
                request_module("i2c-powermac");
 #endif /* CONFIG_KMOD */       
 
-       mix = kmalloc(sizeof(*mix), GFP_KERNEL);
+       mix = kzalloc(sizeof(*mix), GFP_KERNEL);
        if (! mix)
                return -ENOMEM;
-       memset(mix, 0, sizeof(*mix));
        chip->mixer_data = mix;
        chip->mixer_free = daca_cleanup;
        mix->amp_on = 1; /* default on */
index fb05938dcbd91c5a6f75e4191c1f74835010f4b0..59482a4cd44641ecd8d9ab253c128c93ae1dd3a3 100644 (file)
@@ -64,11 +64,10 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
        if (strncmp(i2c_device_name(adapter), "mac-io", 6))
                return 0; /* ignored */
 
-       new_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+       new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
        if (! new_client)
                return -ENOMEM;
 
-       memset(new_client, 0, sizeof(*new_client));
        new_client->addr = keywest_ctx->addr;
        i2c_set_clientdata(new_client, keywest_ctx);
        new_client->adapter = adapter;
index fa9a44ab487e8a35a46e0a4086849943719c5f5f..2264574fa06b7c317252653f75068f5e841a6235 100644 (file)
@@ -181,21 +181,14 @@ static int __init alsa_card_pmac_init(void)
        if ((err = platform_driver_register(&snd_pmac_driver)) < 0)
                return err;
        device = platform_device_register_simple(SND_PMAC_DRIVER, -1, NULL, 0);
-       if (!IS_ERR(device)) {
-               if (platform_get_drvdata(device))
-                       return 0;
-               platform_device_unregister(device);
-               err = -ENODEV;
-       } else
-               err = PTR_ERR(device);
-       platform_driver_unregister(&snd_pmac_driver);
-       return err;
+       return 0;
 
 }
 
 static void __exit alsa_card_pmac_exit(void)
 {
-       platform_device_unregister(device);
+       if (!IS_ERR(device))
+               platform_device_unregister(device);
        platform_driver_unregister(&snd_pmac_driver);
 }
 
index 692c6117767859f3749602372b0cb61112466ece..84f6b19c07ca0c38f7c4057bb7a87ef3fd8b74b8 100644 (file)
@@ -1316,10 +1316,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
                request_module("i2c-powermac");
 #endif /* CONFIG_KMOD */       
 
-       mix = kmalloc(sizeof(*mix), GFP_KERNEL);
+       mix = kzalloc(sizeof(*mix), GFP_KERNEL);
        if (! mix)
                return -ENOMEM;
-       memset(mix, 0, sizeof(*mix));
        mix->headphone_irq = -1;
 
        chip->mixer_data = mix;
index d32d83d970cc9807f0fc19d31f35f5cb8d49104e..1b7f499c549da7f2457bbff3f7c3e1ab63cf7e40 100644 (file)
@@ -2260,10 +2260,9 @@ static int add_audio_endpoint(struct snd_usb_audio *chip, int stream, struct aud
        }
 
        /* create a new pcm */
-       as = kmalloc(sizeof(*as), GFP_KERNEL);
+       as = kzalloc(sizeof(*as), GFP_KERNEL);
        if (! as)
                return -ENOMEM;
-       memset(as, 0, sizeof(*as));
        as->pcm_index = chip->pcm_devs;
        as->chip = chip;
        as->fmt_type = fp->fmt_type;
@@ -2633,13 +2632,12 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
                        csep = NULL;
                }
 
-               fp = kmalloc(sizeof(*fp), GFP_KERNEL);
+               fp = kzalloc(sizeof(*fp), GFP_KERNEL);
                if (! fp) {
                        snd_printk(KERN_ERR "cannot malloc\n");
                        return -ENOMEM;
                }
 
-               memset(fp, 0, sizeof(*fp));
                fp->iface = iface_no;
                fp->altsetting = altno;
                fp->altset_idx = i;
index e93824269da2aeebdd99c41aebda07a0eb0e5993..5b31c0b61c76a908a42f3b42b8868f3a4de06536 100644 (file)
@@ -35,6 +35,9 @@ quiet_cmd_initfs = GEN     $@
       cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
 
 targets := initramfs_data.cpio.gz
+# do not try to update files included in initramfs
+$(deps_initramfs): ;
+
 $(deps_initramfs): klibcdirs
 # We rebuild initramfs_data.cpio.gz if:
 # 1) Any included file is newer then initramfs_data.cpio.gz