From 3922d1416f3ea54aae6a0355ec9659035daf6552 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 26 Jun 2006 18:18:11 +0200 Subject: [PATCH] --- yaml --- r: 32542 b: refs/heads/master c: d608ab9917fbe9926704c07b27df72ac78133870 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/CREDITS | 10 +- trunk/Documentation/RCU/whatisRCU.txt | 5 +- trunk/Documentation/SubmitChecklist | 76 +- trunk/Documentation/drivers/edac/edac.txt | 152 +- .../feature-removal-schedule.txt | 30 +- trunk/Documentation/filesystems/Locking | 4 +- trunk/Documentation/filesystems/vfs.txt | 4 +- trunk/Documentation/hwmon/abituguru | 32 +- trunk/Documentation/i2c/busses/i2c-sis96x | 4 +- trunk/Documentation/nfsroot.txt | 275 ++- .../alsa/DocBook/writing-an-alsa-driver.tmpl | 4 +- trunk/Documentation/usb/usb-serial.txt | 4 +- trunk/MAINTAINERS | 33 +- trunk/arch/alpha/kernel/alpha_ksyms.c | 1 - trunk/arch/alpha/kernel/process.c | 1 - trunk/arch/alpha/kernel/setup.c | 2 +- trunk/arch/alpha/kernel/sys_sio.c | 2 +- trunk/arch/arm/common/locomo.c | 3 +- trunk/arch/arm/common/sharpsl_pm.c | 4 +- trunk/arch/arm/configs/ep93xx_defconfig | 68 +- trunk/arch/arm/configs/ixp2000_defconfig | 55 +- trunk/arch/arm/configs/ixp23xx_defconfig | 59 +- trunk/arch/arm/configs/lpd270_defconfig | 34 +- trunk/arch/arm/configs/onearm_defconfig | 36 +- trunk/arch/arm/kernel/bios32.c | 11 + trunk/arch/arm/kernel/irq.c | 10 - trunk/arch/arm/kernel/setup.c | 2 +- trunk/arch/arm/mach-sa1100/collie.c | 4 +- trunk/arch/arm/mach-sa1100/collie_pm.c | 69 +- trunk/arch/arm/mach-versatile/core.c | 11 +- trunk/arch/arm/nwfpe/softfloat.h | 2 +- trunk/arch/arm26/kernel/setup.c | 2 +- trunk/arch/cris/arch-v10/drivers/eeprom.c | 4 +- trunk/arch/cris/arch-v10/drivers/gpio.c | 2 +- trunk/arch/cris/arch-v32/drivers/cryptocop.c | 2 +- trunk/arch/cris/arch-v32/drivers/gpio.c | 2 +- trunk/arch/cris/arch-v32/drivers/pcf8563.c | 2 + .../arch/cris/arch-v32/drivers/sync_serial.c | 12 +- trunk/arch/cris/kernel/setup.c | 2 +- trunk/arch/frv/kernel/asm-offsets.c | 116 +- trunk/arch/frv/kernel/break.S | 34 +- trunk/arch/frv/kernel/debug-stub.c | 13 +- trunk/arch/frv/kernel/entry.S | 1 + trunk/arch/frv/kernel/gdb-stub.c | 159 +- trunk/arch/frv/kernel/head.S | 1 - trunk/arch/frv/kernel/local.h | 3 - trunk/arch/frv/kernel/pm.c | 5 + trunk/arch/frv/kernel/process.c | 15 +- trunk/arch/frv/kernel/switch_to.S | 3 +- trunk/arch/frv/kernel/traps.c | 25 +- trunk/arch/frv/mb93090-mb00/pci-vdk.c | 11 +- trunk/arch/i386/defconfig | 2 +- trunk/arch/i386/kernel/ioport.c | 1 - trunk/arch/i386/kernel/process.c | 50 +- trunk/arch/i386/kernel/ptrace.c | 5 +- trunk/arch/i386/kernel/setup.c | 2 +- trunk/arch/i386/kernel/time.c | 5 +- trunk/arch/i386/kernel/traps.c | 4 +- trunk/arch/i386/oprofile/nmi_int.c | 5 +- trunk/arch/i386/pci/common.c | 4 + trunk/arch/i386/pci/pci.h | 2 +- trunk/arch/ia64/dig/setup.c | 2 +- trunk/arch/ia64/kernel/efi.c | 2 +- trunk/arch/ia64/kernel/setup.c | 2 +- trunk/arch/ia64/pci/pci.c | 2 +- trunk/arch/ia64/sn/kernel/setup.c | 2 +- trunk/arch/m32r/kernel/setup.c | 2 +- trunk/arch/mips/kernel/irixelf.c | 2 + trunk/arch/mips/kernel/setup.c | 2 +- .../arch/mips/mips-boards/malta/malta_setup.c | 2 +- trunk/arch/mips/sibyte/swarm/setup.c | 2 +- trunk/arch/mips/sni/setup.c | 2 +- trunk/arch/parisc/kernel/pdc_cons.c | 2 - trunk/arch/powerpc/kernel/ibmebus.c | 2 +- trunk/arch/powerpc/kernel/irq.c | 47 +- trunk/arch/powerpc/kernel/pci_32.c | 36 +- trunk/arch/powerpc/kernel/pci_64.c | 36 +- trunk/arch/powerpc/kernel/ppc_ksyms.c | 2 +- trunk/arch/powerpc/kernel/prom_parse.c | 2 +- trunk/arch/powerpc/kernel/setup-common.c | 2 +- trunk/arch/powerpc/platforms/cell/interrupt.c | 4 +- .../arch/powerpc/platforms/cell/spider-pic.c | 70 +- trunk/arch/powerpc/platforms/cell/spu_base.c | 6 +- trunk/arch/powerpc/platforms/iseries/irq.c | 4 +- .../powerpc/platforms/powermac/backlight.c | 31 +- trunk/arch/powerpc/platforms/powermac/pci.c | 13 +- trunk/arch/powerpc/platforms/powermac/pic.c | 8 +- trunk/arch/powerpc/platforms/pseries/ras.c | 3 +- trunk/arch/powerpc/platforms/pseries/xics.c | 34 +- trunk/arch/powerpc/sysdev/i8259.c | 4 +- trunk/arch/powerpc/sysdev/mpic.c | 210 +- trunk/arch/ppc/kernel/ppc_ksyms.c | 2 +- trunk/arch/ppc/kernel/setup.c | 2 +- trunk/arch/ppc/platforms/prep_setup.c | 2 +- trunk/arch/s390/Kconfig | 7 + trunk/arch/s390/hypfs/hypfs_diag.c | 2 +- trunk/arch/s390/kernel/Makefile | 4 +- trunk/arch/s390/kernel/compat_linux.c | 19 +- trunk/arch/s390/kernel/machine_kexec.c | 1 - trunk/arch/s390/kernel/module.c | 2 +- trunk/arch/s390/kernel/process.c | 2 +- trunk/arch/s390/kernel/profile.c | 2 +- trunk/arch/s390/kernel/s390_ext.c | 2 +- trunk/arch/s390/kernel/time.c | 2 +- trunk/arch/s390/kernel/traps.c | 18 +- trunk/arch/s390/lib/string.c | 4 +- trunk/arch/s390/mm/cmm.c | 2 +- trunk/arch/s390/mm/fault.c | 2 +- trunk/arch/sh/kernel/setup.c | 2 +- trunk/arch/sh64/kernel/setup.c | 2 +- trunk/arch/sh64/kernel/sh_ksyms.c | 2 +- trunk/arch/sparc/kernel/of_device.c | 173 +- trunk/arch/sparc/kernel/setup.c | 2 +- trunk/arch/sparc64/Kconfig | 2 +- trunk/arch/sparc64/defconfig | 39 +- trunk/arch/sparc64/kernel/of_device.c | 314 ++- trunk/arch/sparc64/kernel/prom.c | 51 +- trunk/arch/sparc64/kernel/setup.c | 2 +- trunk/arch/um/Kconfig.debug | 9 + trunk/arch/um/defconfig | 1 + trunk/arch/um/drivers/mconsole_user.c | 7 +- trunk/arch/um/drivers/net_user.c | 80 +- trunk/arch/um/drivers/tty.c | 31 +- trunk/arch/um/drivers/ubd_kern.c | 1 + trunk/arch/um/include/irq_user.h | 9 +- trunk/arch/um/include/kern_util.h | 2 + trunk/arch/um/include/os.h | 6 +- trunk/arch/um/include/skas/mode_kern_skas.h | 3 +- trunk/arch/um/include/tt/mode_kern_tt.h | 3 +- trunk/arch/um/kernel/Makefile | 10 +- trunk/arch/um/kernel/{exec.c => exec_kern.c} | 13 +- trunk/arch/um/kernel/irq.c | 62 +- trunk/arch/um/kernel/ksyms.c | 6 + trunk/arch/um/kernel/mem.c | 11 + trunk/arch/um/kernel/physmem.c | 2 +- .../arch/um/kernel/{sigio.c => sigio_kern.c} | 16 +- .../um/kernel/{signal.c => signal_kern.c} | 10 +- trunk/arch/um/kernel/skas/mem.c | 24 +- trunk/arch/um/kernel/skas/process_kern.c | 2 +- trunk/arch/um/kernel/skas/syscall.c | 7 + trunk/arch/um/kernel/syscall.c | 174 +- trunk/arch/um/kernel/syscall_kern.c | 166 ++ trunk/arch/um/kernel/{time.c => time_kern.c} | 84 +- trunk/arch/um/kernel/{trap.c => trap_kern.c} | 18 +- trunk/arch/um/kernel/tt/exec_kern.c | 2 +- trunk/arch/um/kernel/tt/mem.c | 21 +- trunk/arch/um/kernel/tt/process_kern.c | 2 +- trunk/arch/um/kernel/tt/syscall_kern.c | 12 +- trunk/arch/um/kernel/tt/tracer.c | 22 +- trunk/arch/um/kernel/um_arch.c | 9 +- trunk/arch/um/kernel/uml.lds.S | 13 +- trunk/arch/um/os-Linux/file.c | 143 +- trunk/arch/um/os-Linux/irq.c | 16 +- trunk/arch/um/os-Linux/process.c | 19 +- trunk/arch/um/os-Linux/sigio.c | 33 +- trunk/arch/um/os-Linux/signal.c | 23 + trunk/arch/um/os-Linux/skas/process.c | 2 +- trunk/arch/um/os-Linux/time.c | 23 +- trunk/arch/x86_64/defconfig | 36 +- trunk/arch/x86_64/ia32/ia32_binfmt.c | 2 +- trunk/arch/x86_64/ia32/ptrace32.c | 13 +- trunk/arch/x86_64/kernel/e820.c | 1 - trunk/arch/x86_64/kernel/early_printk.c | 2 +- trunk/arch/x86_64/kernel/mce_amd.c | 2 +- trunk/arch/x86_64/kernel/pci-calgary.c | 6 +- trunk/arch/x86_64/kernel/setup.c | 2 +- trunk/arch/x86_64/kernel/smpboot.c | 4 +- trunk/arch/x86_64/kernel/tce.c | 6 +- trunk/arch/x86_64/kernel/traps.c | 4 +- trunk/arch/xtensa/kernel/setup.c | 2 +- trunk/block/blktrace.c | 5 +- trunk/block/ll_rw_blk.c | 4 +- trunk/drivers/acpi/Kconfig | 6 +- trunk/drivers/acpi/ac.c | 2 +- trunk/drivers/acpi/battery.c | 6 +- trunk/drivers/acpi/bus.c | 4 +- trunk/drivers/acpi/button.c | 4 +- trunk/drivers/acpi/cm_sbs.c | 46 +- trunk/drivers/acpi/dispatcher/dsinit.c | 10 + trunk/drivers/acpi/dispatcher/dsmethod.c | 23 +- trunk/drivers/acpi/dispatcher/dswexec.c | 4 +- trunk/drivers/acpi/dock.c | 1 - trunk/drivers/acpi/ec.c | 2 +- trunk/drivers/acpi/event.c | 2 +- trunk/drivers/acpi/events/evregion.c | 44 +- trunk/drivers/acpi/events/evxface.c | 44 +- trunk/drivers/acpi/events/evxfregn.c | 13 +- trunk/drivers/acpi/executer/exconfig.c | 1 + trunk/drivers/acpi/executer/exconvrt.c | 3 - trunk/drivers/acpi/executer/exmutex.c | 4 +- trunk/drivers/acpi/executer/exsystem.c | 8 +- trunk/drivers/acpi/fan.c | 2 +- trunk/drivers/acpi/hotkey.c | 10 +- trunk/drivers/acpi/namespace/nsalloc.c | 13 +- trunk/drivers/acpi/osl.c | 90 +- trunk/drivers/acpi/parser/psutils.c | 2 + trunk/drivers/acpi/pci_link.c | 7 + trunk/drivers/acpi/power.c | 2 +- trunk/drivers/acpi/processor_core.c | 2 +- trunk/drivers/acpi/processor_idle.c | 2 +- trunk/drivers/acpi/sleep/proc.c | 6 +- trunk/drivers/acpi/system.c | 6 +- trunk/drivers/acpi/tables/tbget.c | 12 +- trunk/drivers/acpi/tables/tbinstal.c | 21 +- trunk/drivers/acpi/tables/tbrsdt.c | 27 +- trunk/drivers/acpi/tables/tbxface.c | 32 +- trunk/drivers/acpi/thermal.c | 27 +- trunk/drivers/acpi/utilities/utalloc.c | 2 - trunk/drivers/acpi/utilities/utdebug.c | 4 +- trunk/drivers/acpi/utilities/utdelete.c | 13 +- trunk/drivers/acpi/utilities/utmisc.c | 25 +- trunk/drivers/acpi/utilities/utmutex.c | 8 +- trunk/drivers/acpi/utilities/utstate.c | 7 - trunk/drivers/atm/Kconfig | 2 +- trunk/drivers/base/Kconfig | 2 +- trunk/drivers/base/bus.c | 5 +- trunk/drivers/base/core.c | 30 +- trunk/drivers/block/aoe/aoechr.c | 2 +- trunk/drivers/bluetooth/bcm203x.c | 1 - trunk/drivers/bluetooth/hci_ldisc.c | 4 +- trunk/drivers/cdrom/cdrom.c | 2 +- trunk/drivers/char/hvsi.c | 2 +- trunk/drivers/char/ip2/ip2main.c | 7 - trunk/drivers/char/mem.c | 4 +- trunk/drivers/char/pc8736x_gpio.c | 46 +- trunk/drivers/char/rtc.c | 47 +- trunk/drivers/char/snsc_event.c | 15 +- trunk/drivers/char/specialix.c | 6 - trunk/drivers/edac/edac_mc.c | 687 +++++-- trunk/drivers/hwmon/abituguru.c | 21 +- trunk/drivers/i2c/algos/i2c-algo-bit.c | 4 +- trunk/drivers/i2c/algos/i2c-algo-ite.c | 4 +- trunk/drivers/i2c/algos/i2c-algo-pca.c | 6 +- trunk/drivers/i2c/algos/i2c-algo-pcf.c | 8 +- trunk/drivers/i2c/algos/i2c-algo-sibyte.c | 4 +- trunk/drivers/i2c/busses/i2c-iop3xx.c | 17 +- trunk/drivers/i2c/busses/i2c-iop3xx.h | 2 +- trunk/drivers/i2c/busses/i2c-powermac.c | 4 +- trunk/drivers/i2c/busses/scx200_acb.c | 20 +- trunk/drivers/i2c/chips/pca9539.c | 12 +- trunk/drivers/i2c/i2c-core.c | 4 +- trunk/drivers/ide/legacy/ide-cs.c | 81 +- trunk/drivers/ide/pci/generic.c | 8 - trunk/drivers/isdn/hisax/asuscom.c | 6 +- trunk/drivers/isdn/hisax/avm_a1.c | 2 +- trunk/drivers/isdn/hisax/avm_pci.c | 8 +- trunk/drivers/isdn/hisax/bkm_a4t.c | 4 +- trunk/drivers/isdn/hisax/bkm_a8.c | 16 +- trunk/drivers/isdn/hisax/config.c | 2 +- trunk/drivers/isdn/hisax/diva.c | 14 +- trunk/drivers/isdn/hisax/enternow_pci.c | 4 +- trunk/drivers/isdn/hisax/gazel.c | 8 +- trunk/drivers/isdn/hisax/hfc4s8s_l1.c | 2 +- trunk/drivers/isdn/hisax/hfc_2bds0.c | 4 +- trunk/drivers/isdn/hisax/hfc_2bs0.c | 4 +- trunk/drivers/isdn/hisax/hfc_pci.c | 6 +- trunk/drivers/isdn/hisax/hfcscard.c | 6 +- trunk/drivers/isdn/hisax/icc.c | 8 +- trunk/drivers/isdn/hisax/icc.h | 2 +- trunk/drivers/isdn/hisax/ipacx.c | 18 +- trunk/drivers/isdn/hisax/isurf.c | 4 +- trunk/drivers/isdn/hisax/ix1_micro.c | 6 +- trunk/drivers/isdn/hisax/jade.c | 6 +- trunk/drivers/isdn/hisax/mic.c | 2 +- trunk/drivers/isdn/hisax/netjet.c | 2 +- trunk/drivers/isdn/hisax/niccy.c | 4 +- trunk/drivers/isdn/hisax/nj_s.c | 4 +- trunk/drivers/isdn/hisax/nj_u.c | 4 +- trunk/drivers/isdn/hisax/s0box.c | 2 +- trunk/drivers/isdn/hisax/saphir.c | 2 +- trunk/drivers/isdn/hisax/sportster.c | 4 +- trunk/drivers/isdn/hisax/teleint.c | 2 +- trunk/drivers/isdn/hisax/teles0.c | 2 +- trunk/drivers/isdn/hisax/telespci.c | 4 +- trunk/drivers/isdn/hisax/w6692.c | 10 +- trunk/drivers/isdn/i4l/isdn_common.c | 12 +- trunk/drivers/isdn/i4l/isdn_ppp.c | 2 +- trunk/drivers/leds/Kconfig | 7 - trunk/drivers/leds/Makefile | 1 - trunk/drivers/leds/leds-net48xx.c | 115 -- trunk/drivers/macintosh/Kconfig | 5 +- trunk/drivers/macintosh/macio_asic.c | 2 +- trunk/drivers/macintosh/smu.c | 53 +- trunk/drivers/md/md.c | 86 +- trunk/drivers/md/raid1.c | 5 +- trunk/drivers/md/raid10.c | 4 - trunk/drivers/md/raid5.c | 84 +- trunk/drivers/media/dvb/frontends/nxt200x.c | 4 +- trunk/drivers/media/dvb/frontends/or51211.c | 2 +- trunk/drivers/media/dvb/frontends/sp8870.c | 2 +- trunk/drivers/media/dvb/frontends/sp887x.c | 2 +- .../drivers/media/video/cx88/cx88-blackbird.c | 3 - trunk/drivers/message/i2o/core.h | 3 - trunk/drivers/message/i2o/i2o_config.c | 4 +- trunk/drivers/mfd/ucb1x00-core.c | 2 +- trunk/drivers/mfd/ucb1x00.h | 1 - trunk/drivers/net/3c59x.c | 166 ++ trunk/drivers/net/8139cp.c | 2 +- trunk/drivers/net/8139too.c | 5 +- trunk/drivers/net/bnx2.c | 2 +- trunk/drivers/net/chelsio/sge.c | 2 +- trunk/drivers/net/e1000/e1000.h | 10 +- trunk/drivers/net/e1000/e1000_ethtool.c | 141 +- trunk/drivers/net/e1000/e1000_hw.c | 1772 ++--------------- trunk/drivers/net/e1000/e1000_hw.h | 398 +--- trunk/drivers/net/e1000/e1000_main.c | 385 ++-- trunk/drivers/net/e1000/e1000_osdep.h | 13 - trunk/drivers/net/e1000/e1000_param.c | 199 +- trunk/drivers/net/forcedeth.c | 51 +- trunk/drivers/net/hamradio/bpqether.c | 7 - trunk/drivers/net/irda/ali-ircc.c | 3 +- trunk/drivers/net/irda/smsc-ircc2.c | 2 +- trunk/drivers/net/ixgb/ixgb_main.c | 6 +- trunk/drivers/net/loopback.c | 2 +- trunk/drivers/net/myri10ge/myri10ge.c | 15 +- trunk/drivers/net/s2io.c | 285 ++- trunk/drivers/net/s2io.h | 5 +- trunk/drivers/net/sk98lin/h/xmac_ii.h | 2 +- trunk/drivers/net/skge.h | 4 +- trunk/drivers/net/sky2.c | 45 +- trunk/drivers/net/sky2.h | 2 +- trunk/drivers/net/smc91x.h | 18 - trunk/drivers/net/tg3.c | 2 - trunk/drivers/net/typhoon.c | 4 +- trunk/drivers/net/wan/c101.c | 26 +- trunk/drivers/net/wan/hd6457x.c | 26 +- trunk/drivers/net/wan/hdlc_cisco.c | 14 +- trunk/drivers/net/wan/hdlc_fr.c | 14 +- trunk/drivers/net/wan/hdlc_generic.c | 65 +- trunk/drivers/net/wan/wanxl.c | 5 +- .../net/wireless/bcm43xx/bcm43xx_main.c | 2 +- trunk/drivers/net/wireless/spectrum_cs.c | 37 +- trunk/drivers/net/wireless/zd1211rw/zd_usb.c | 12 +- trunk/drivers/pci/hotplug/Kconfig | 5 +- trunk/drivers/pci/msi.c | 4 +- trunk/drivers/pci/pci.c | 11 +- trunk/drivers/pci/pci.h | 10 +- trunk/drivers/pci/probe.c | 1 - trunk/drivers/pci/quirks.c | 108 - trunk/drivers/pcmcia/Kconfig | 2 +- trunk/drivers/s390/block/dasd_devmap.c | 8 +- trunk/drivers/s390/block/dasd_eckd.c | 20 +- trunk/drivers/s390/block/dasd_fba.c | 4 +- trunk/drivers/s390/block/dasd_genhd.c | 8 +- trunk/drivers/s390/block/dasd_ioctl.c | 2 +- trunk/drivers/s390/block/xpram.c | 63 +- trunk/drivers/s390/char/con3215.c | 2 +- trunk/drivers/s390/char/ctrlchar.c | 2 +- trunk/drivers/s390/char/defkeymap.c | 6 +- trunk/drivers/s390/char/fs3270.c | 12 +- trunk/drivers/s390/char/keyboard.c | 6 +- trunk/drivers/s390/char/raw3270.c | 34 +- trunk/drivers/s390/char/raw3270.h | 2 +- trunk/drivers/s390/char/tape_34xx.c | 6 +- trunk/drivers/s390/char/tty3270.c | 24 +- trunk/drivers/s390/char/vmlogrdr.c | 6 +- trunk/drivers/s390/char/vmwatchdog.c | 2 +- trunk/drivers/s390/cio/ccwgroup.c | 2 +- trunk/drivers/s390/cio/chsc.c | 34 - trunk/drivers/s390/cio/cio.c | 4 +- trunk/drivers/s390/cio/cio.h | 3 +- trunk/drivers/s390/cio/cmf.c | 4 +- trunk/drivers/s390/cio/css.c | 36 +- trunk/drivers/s390/cio/css.h | 4 +- trunk/drivers/s390/cio/device.c | 14 +- trunk/drivers/s390/cio/device_fsm.c | 85 +- trunk/drivers/s390/cio/device_pgid.c | 122 +- trunk/drivers/s390/cio/device_status.c | 7 +- trunk/drivers/s390/cio/qdio.c | 2 +- trunk/drivers/s390/net/claw.c | 2 +- trunk/drivers/s390/net/iucv.c | 2 +- trunk/drivers/s390/net/netiucv.c | 2 +- trunk/drivers/s390/net/qeth_main.c | 20 +- trunk/drivers/s390/net/qeth_sys.c | 4 +- trunk/drivers/s390/net/smsgiucv.c | 14 +- trunk/drivers/s390/s390mach.c | 10 - trunk/drivers/s390/scsi/zfcp_fsf.c | 2 +- trunk/drivers/s390/scsi/zfcp_scsi.c | 47 +- trunk/drivers/scsi/aic7xxx/aic79xx_osm.h | 1 + trunk/drivers/serial/dz.c | 2 +- trunk/drivers/serial/sunsu.c | 35 +- trunk/drivers/usb/Kconfig | 1 - trunk/drivers/usb/Makefile | 2 +- trunk/drivers/usb/class/cdc-acm.c | 49 +- trunk/drivers/usb/core/Kconfig | 3 + trunk/drivers/usb/core/hub.c | 10 +- trunk/drivers/usb/core/inode.c | 2 +- trunk/drivers/usb/gadget/epautoconf.c | 16 +- trunk/drivers/usb/gadget/ether.c | 8 +- trunk/drivers/usb/gadget/file_storage.c | 2 +- trunk/drivers/usb/gadget/rndis.c | 2 +- trunk/drivers/usb/gadget/rndis.h | 2 +- trunk/drivers/usb/gadget/serial.c | 2 +- trunk/drivers/usb/gadget/zero.c | 2 +- trunk/drivers/usb/host/ehci-au1xxx.c | 23 +- trunk/drivers/usb/host/ehci-hcd.c | 7 +- trunk/drivers/usb/host/ohci-au1xxx.c | 7 +- trunk/drivers/usb/host/ohci-ep93xx.c | 225 --- trunk/drivers/usb/host/ohci-hcd.c | 5 - trunk/drivers/usb/host/ohci-hub.c | 4 +- trunk/drivers/usb/host/pci-quirks.c | 8 +- trunk/drivers/usb/input/hid-core.c | 4 - trunk/drivers/usb/misc/Kconfig | 10 +- trunk/drivers/usb/misc/Makefile | 2 +- trunk/drivers/usb/misc/cy7c63.c | 244 +++ trunk/drivers/usb/misc/cypress_cy7c63.c | 279 --- trunk/drivers/usb/misc/usblcd.c | 6 +- trunk/drivers/usb/mon/mon_text.c | 7 +- trunk/drivers/usb/net/rtl8150.c | 3 - trunk/drivers/usb/serial/Kconfig | 11 - trunk/drivers/usb/serial/Makefile | 1 - trunk/drivers/usb/serial/airprime.c | 2 +- trunk/drivers/usb/serial/anydata.c | 4 +- trunk/drivers/usb/serial/ark3116.c | 2 +- trunk/drivers/usb/serial/belkin_sa.c | 2 +- trunk/drivers/usb/serial/bus.c | 2 +- trunk/drivers/usb/serial/console.c | 3 +- trunk/drivers/usb/serial/cp2101.c | 2 +- trunk/drivers/usb/serial/cyberjack.c | 2 +- trunk/drivers/usb/serial/cypress_m8.c | 2 +- trunk/drivers/usb/serial/digi_acceleport.c | 2 +- trunk/drivers/usb/serial/empeg.c | 2 +- trunk/drivers/usb/serial/ezusb.c | 2 +- trunk/drivers/usb/serial/ftdi_sio.c | 108 +- trunk/drivers/usb/serial/ftdi_sio.h | 15 - trunk/drivers/usb/serial/funsoft.c | 2 +- trunk/drivers/usb/serial/garmin_gps.c | 3 +- trunk/drivers/usb/serial/generic.c | 3 +- trunk/drivers/usb/serial/hp4x.c | 2 +- trunk/drivers/usb/serial/io_edgeport.c | 2 +- trunk/drivers/usb/serial/io_ti.c | 2 +- trunk/drivers/usb/serial/ipaq.c | 25 +- trunk/drivers/usb/serial/ipw.c | 4 +- trunk/drivers/usb/serial/ir-usb.c | 2 +- trunk/drivers/usb/serial/keyspan.c | 2 +- trunk/drivers/usb/serial/keyspan_pda.c | 3 +- trunk/drivers/usb/serial/kl5kusb105.c | 2 +- trunk/drivers/usb/serial/kobil_sct.c | 2 +- trunk/drivers/usb/serial/mct_u232.c | 2 +- trunk/drivers/usb/serial/navman.c | 2 +- trunk/drivers/usb/serial/omninet.c | 2 +- trunk/drivers/usb/serial/option.c | 8 +- trunk/drivers/usb/serial/pl2303.c | 4 +- trunk/drivers/usb/serial/pl2303.h | 5 - trunk/drivers/usb/serial/safe_serial.c | 2 +- trunk/drivers/usb/serial/sierra.c | 75 - trunk/drivers/usb/serial/ti_usb_3410_5052.c | 2 +- trunk/drivers/usb/serial/usb-serial.c | 25 +- .../usb/serial/usb-serial.h} | 6 +- trunk/drivers/usb/serial/visor.c | 39 +- trunk/drivers/usb/serial/whiteheat.c | 2 +- trunk/drivers/usb/storage/scsiglue.c | 12 +- trunk/drivers/usb/storage/transport.c | 2 +- trunk/drivers/usb/storage/unusual_devs.h | 60 +- trunk/drivers/usb/storage/usb.c | 29 +- trunk/drivers/usb/storage/usb.h | 4 + trunk/drivers/video/68328fb.c | 1 + trunk/drivers/video/S3triofb.c | 1 + trunk/drivers/video/amifb.c | 1 + trunk/drivers/video/arcfb.c | 1 + trunk/drivers/video/asiliantfb.c | 1 + trunk/drivers/video/atafb.c | 1 + trunk/drivers/video/aty/aty128fb.c | 67 +- trunk/drivers/video/aty/atyfb_base.c | 53 +- trunk/drivers/video/aty/radeon_base.c | 1 + trunk/drivers/video/chipsfb.c | 4 +- trunk/drivers/video/cirrusfb.c | 1 + trunk/drivers/video/console/dummycon.c | 2 +- trunk/drivers/video/console/fbcon.c | 1 + trunk/drivers/video/console/mdacon.c | 1 + trunk/drivers/video/console/newport_con.c | 1 + trunk/drivers/video/console/promcon.c | 1 + trunk/drivers/video/console/softcursor.c | 1 + trunk/drivers/video/console/sticon.c | 1 + trunk/drivers/video/console/vgacon.c | 2 +- trunk/drivers/video/controlfb.c | 1 + trunk/drivers/video/cyber2000fb.c | 1 + trunk/drivers/video/cyberfb.c | 1 + trunk/drivers/video/dnfb.c | 1 + trunk/drivers/video/epson1355fb.c | 1 + trunk/drivers/video/fbcmap.c | 1 + trunk/drivers/video/fbmem.c | 2 +- trunk/drivers/video/fbmon.c | 1 + trunk/drivers/video/g364fb.c | 1 + trunk/drivers/video/geode/gx1fb_core.c | 1 + trunk/drivers/video/geode/gxfb_core.c | 1 + trunk/drivers/video/hgafb.c | 1 + trunk/drivers/video/hitfb.c | 1 + trunk/drivers/video/hpfb.c | 1 + trunk/drivers/video/i810/i810_main.c | 1 + trunk/drivers/video/igafb.c | 1 + trunk/drivers/video/imacfb.c | 2 +- trunk/drivers/video/imsttfb.c | 1 + trunk/drivers/video/intelfb/intelfbdrv.c | 2 +- trunk/drivers/video/intelfb/intelfbhw.c | 1 + trunk/drivers/video/kyro/fbdev.c | 1 + trunk/drivers/video/macfb.c | 1 + trunk/drivers/video/matrox/matroxfb_base.h | 1 + trunk/drivers/video/maxinefb.c | 1 + trunk/drivers/video/modedb.c | 1 + trunk/drivers/video/neofb.c | 1 + trunk/drivers/video/nvidia/nv_backlight.c | 32 +- trunk/drivers/video/nvidia/nv_proto.h | 2 - trunk/drivers/video/nvidia/nvidia.c | 12 +- trunk/drivers/video/offb.c | 1 + trunk/drivers/video/platinumfb.c | 1 + trunk/drivers/video/pm2fb.c | 1 + trunk/drivers/video/pm3fb.c | 1 + trunk/drivers/video/pmag-aa-fb.c | 1 + trunk/drivers/video/pvr2fb.c | 1 + trunk/drivers/video/q40fb.c | 1 + trunk/drivers/video/retz3fb.c | 1 + trunk/drivers/video/riva/fbdev.c | 45 +- trunk/drivers/video/s3c2410fb.c | 1 + trunk/drivers/video/savage/savagefb_driver.c | 1 + trunk/drivers/video/sis/sis_main.c | 6 - trunk/drivers/video/skeletonfb.c | 1 + trunk/drivers/video/sun3fb.c | 1 + trunk/drivers/video/tdfxfb.c | 1 + trunk/drivers/video/tgafb.c | 1 + trunk/drivers/video/tx3912fb.c | 1 + trunk/drivers/video/valkyriefb.c | 1 + trunk/drivers/video/vesafb.c | 2 +- trunk/drivers/video/vfb.c | 1 + trunk/drivers/video/vga16fb.c | 2 +- trunk/drivers/video/virgefb.c | 1 + trunk/drivers/w1/masters/ds2482.c | 2 +- trunk/drivers/w1/w1_io.h | 36 + trunk/fs/binfmt_elf.c | 2 + trunk/fs/binfmt_elf_fdpic.c | 980 ++------- trunk/fs/ext3/acl.h | 3 + trunk/fs/file.c | 14 +- trunk/fs/hugetlbfs/inode.c | 4 +- trunk/fs/nfsd/nfs4proc.c | 8 - trunk/fs/nfsd/stats.c | 10 - trunk/fs/partitions/check.c | 1 - trunk/fs/proc/kcore.c | 4 +- trunk/fs/ramfs/file-nommu.c | 4 +- trunk/fs/read_write.c | 2 +- trunk/fs/reiserfs/file.c | 6 +- trunk/fs/splice.c | 238 +-- trunk/fs/sysfs/inode.c | 12 - trunk/fs/xfs/linux-2.6/xfs_linux.h | 1 + trunk/include/acpi/acconfig.h | 2 +- trunk/include/acpi/acinterp.h | 10 +- trunk/include/acpi/aclocal.h | 4 +- trunk/include/acpi/acmacros.h | 8 +- trunk/include/acpi/acresrc.h | 8 +- trunk/include/acpi/platform/aclinux.h | 27 +- .../include/asm-arm/arch-versatile/platform.h | 2 - trunk/include/asm-frv/elf.h | 6 +- trunk/include/asm-frv/gdb-stub.h | 22 - trunk/include/asm-frv/processor.h | 3 +- trunk/include/asm-frv/ptrace.h | 12 +- trunk/include/asm-frv/registers.h | 97 +- trunk/include/asm-frv/thread_info.h | 24 +- trunk/include/asm-h8300/page.h | 1 + trunk/include/asm-h8300/processor.h | 3 +- trunk/include/asm-i386/system.h | 21 +- trunk/include/asm-i386/thread_info.h | 7 - trunk/include/asm-ia64/io.h | 2 +- trunk/include/asm-m68knommu/processor.h | 3 +- trunk/include/asm-m68knommu/uaccess.h | 12 +- trunk/include/asm-mips/mach-dec/mc146818rtc.h | 2 - trunk/include/asm-powerpc/backlight.h | 12 +- trunk/include/asm-powerpc/irq.h | 38 +- trunk/include/asm-s390/bug.h | 11 +- trunk/include/asm-s390/ccwdev.h | 2 +- trunk/include/asm-s390/cio.h | 2 - trunk/include/asm-s390/futex.h | 5 +- trunk/include/asm-s390/irqflags.h | 18 +- trunk/include/asm-s390/pgalloc.h | 2 +- trunk/include/asm-s390/processor.h | 16 +- trunk/include/asm-s390/setup.h | 3 +- trunk/include/asm-sh/processor.h | 3 +- trunk/include/asm-sh64/processor.h | 3 +- trunk/include/asm-sparc64/Kbuild | 2 +- trunk/include/asm-v850/processor.h | 3 +- trunk/include/asm-x86_64/calgary.h | 6 +- trunk/include/asm-x86_64/tce.h | 8 +- trunk/include/asm-xtensa/processor.h | 3 +- trunk/include/linux/blktrace_api.h | 5 +- trunk/include/linux/bootmem.h | 2 +- trunk/include/linux/completion.h | 5 +- trunk/include/linux/console_struct.h | 1 - trunk/include/linux/elfcore.h | 10 - trunk/include/linux/fb.h | 1 + trunk/include/linux/fs.h | 4 - trunk/include/linux/hdlc.h | 2 + trunk/include/linux/i2c.h | 2 - trunk/include/linux/ioport.h | 2 +- trunk/include/linux/kernel.h | 1 - trunk/include/linux/lockdep.h | 2 +- trunk/include/linux/mc146818rtc.h | 7 - trunk/include/linux/netdevice.h | 8 +- trunk/include/linux/nfs4.h | 6 - trunk/include/linux/nfsd/stats.h | 6 - trunk/include/linux/pci.h | 1 - trunk/include/linux/pci_regs.h | 16 - trunk/include/linux/pm_legacy.h | 7 + trunk/include/linux/raid/md_k.h | 3 +- trunk/include/linux/root_dev.h | 2 - trunk/include/linux/rwsem.h | 17 +- trunk/include/linux/skbuff.h | 5 - trunk/include/linux/tty.h | 12 + trunk/include/linux/usb.h | 2 +- trunk/include/linux/usb_ch9.h | 7 - trunk/include/linux/usb_gadget.h | 4 +- trunk/include/linux/usb_usual.h | 2 - trunk/include/linux/vmstat.h | 11 +- trunk/include/linux/vt.h | 10 - trunk/include/linux/vt_kern.h | 1 - trunk/include/linux/wait.h | 12 +- trunk/include/net/protocol.h | 2 - trunk/include/net/tcp.h | 1 - trunk/include/sound/core.h | 2 + trunk/include/sound/cs46xx.h | 1 - trunk/kernel/fork.c | 4 +- trunk/kernel/futex.c | 6 - trunk/kernel/lockdep.c | 136 +- trunk/kernel/panic.c | 2 - trunk/kernel/power/pm.c | 37 + trunk/kernel/power/snapshot.c | 10 +- trunk/kernel/power/swap.c | 26 +- trunk/kernel/printk.c | 4 +- trunk/kernel/resource.c | 2 + trunk/kernel/sched.c | 19 +- trunk/kernel/softirq.c | 2 +- trunk/kernel/sys.c | 2 +- trunk/kernel/timer.c | 85 +- trunk/kernel/wait.c | 8 +- trunk/mm/bootmem.c | 4 +- trunk/mm/fadvise.c | 12 + trunk/mm/memory.c | 2 +- trunk/mm/mmzone.c | 6 +- trunk/mm/slab.c | 74 +- trunk/mm/vmstat.c | 1 - trunk/net/atm/clip.c | 13 +- trunk/net/atm/ipcommon.c | 17 +- trunk/net/ax25/af_ax25.c | 17 +- trunk/net/ax25/ax25_dev.c | 4 +- trunk/net/ax25/ax25_ds_subr.c | 8 +- trunk/net/ax25/ax25_ds_timer.c | 4 +- trunk/net/ax25/ax25_iface.c | 18 +- trunk/net/ax25/ax25_in.c | 2 +- trunk/net/bluetooth/cmtp/capi.c | 4 +- trunk/net/bluetooth/cmtp/core.c | 3 +- trunk/net/bluetooth/hci_core.c | 7 +- trunk/net/bluetooth/hidp/Kconfig | 3 +- trunk/net/bluetooth/hidp/core.c | 3 +- trunk/net/bluetooth/l2cap.c | 18 +- trunk/net/bluetooth/rfcomm/core.c | 9 +- trunk/net/bluetooth/rfcomm/tty.c | 3 +- trunk/net/bluetooth/sco.c | 12 +- trunk/net/bridge/br_forward.c | 2 +- trunk/net/bridge/br_netfilter.c | 2 +- trunk/net/core/dev.c | 42 +- trunk/net/core/stream.c | 16 +- trunk/net/dccp/proto.c | 4 +- trunk/net/decnet/dn_rules.c | 3 +- trunk/net/ipv4/Kconfig | 10 + trunk/net/ipv4/Makefile | 1 + trunk/net/ipv4/af_inet.c | 36 - trunk/net/ipv4/fib_rules.c | 4 +- trunk/net/ipv4/fib_trie.c | 2 +- trunk/net/ipv4/inetpeer.c | 2 +- trunk/net/ipv4/ip_output.c | 4 +- trunk/net/ipv4/ipcomp.c | 3 +- trunk/net/ipv4/tcp_compound.c | 448 +++++ trunk/net/ipv4/tcp_highspeed.c | 13 +- trunk/net/ipv4/tcp_ipv4.c | 18 - trunk/net/ipv4/xfrm4_output.c | 2 +- trunk/net/ipv6/addrconf.c | 25 +- trunk/net/ipv6/ip6_output.c | 4 +- trunk/net/ipv6/ipcomp6.c | 3 +- trunk/net/ipv6/ipv6_sockglue.c | 89 +- trunk/net/ipv6/tcp_ipv6.c | 19 - trunk/net/ipv6/xfrm6_output.c | 2 +- trunk/net/netrom/af_netrom.c | 25 +- trunk/net/netrom/nr_timer.c | 2 +- trunk/net/rose/af_rose.c | 12 +- trunk/net/sched/act_api.c | 4 +- trunk/security/selinux/hooks.c | 129 +- trunk/security/selinux/include/objsec.h | 3 +- trunk/sound/aoa/Makefile | 4 +- .../aoa/codecs/snd-aoa-codec-tas-basstreble.h | 134 -- trunk/sound/aoa/codecs/snd-aoa-codec-tas.c | 331 +-- trunk/sound/aoa/codecs/snd-aoa-codec-tas.h | 8 - trunk/sound/aoa/core/snd-aoa-gpio-pmf.c | 14 +- .../sound/aoa/fabrics/snd-aoa-fabric-layout.c | 26 +- trunk/sound/aoa/soundbus/core.c | 22 +- .../aoa/soundbus/i2sbus/i2sbus-control.c | 79 +- .../aoa/soundbus/i2sbus/i2sbus-control.h | 37 + trunk/sound/aoa/soundbus/i2sbus/i2sbus-core.c | 129 +- trunk/sound/aoa/soundbus/i2sbus/i2sbus.h | 18 +- trunk/sound/core/sound.c | 3 +- trunk/sound/core/timer.c | 5 +- trunk/sound/i2c/cs8427.c | 116 +- trunk/sound/isa/cs423x/Makefile | 1 - trunk/sound/isa/gus/gusextreme.c | 2 +- trunk/sound/isa/wavefront/wavefront_fx.c | 36 +- trunk/sound/isa/wavefront/wavefront_midi.c | 2 +- trunk/sound/isa/wavefront/wavefront_synth.c | 14 +- trunk/sound/pci/Kconfig | 14 +- trunk/sound/pci/ad1889.c | 8 +- trunk/sound/pci/ali5451/ali5451.c | 2 +- trunk/sound/pci/als300.c | 2 +- trunk/sound/pci/als4000.c | 2 +- trunk/sound/pci/atiixp.c | 2 +- trunk/sound/pci/atiixp_modem.c | 2 +- trunk/sound/pci/au88x0/au8810.c | 2 +- trunk/sound/pci/au88x0/au8820.c | 2 +- trunk/sound/pci/au88x0/au8830.c | 2 +- trunk/sound/pci/au88x0/au88x0.h | 3 +- trunk/sound/pci/au88x0/au88x0_a3d.c | 29 +- trunk/sound/pci/au88x0/au88x0_core.c | 4 +- trunk/sound/pci/azt3328.c | 2 +- trunk/sound/pci/bt87x.c | 2 +- trunk/sound/pci/ca0106/ca0106_main.c | 2 +- trunk/sound/pci/cmipci.c | 2 +- trunk/sound/pci/cs4281.c | 2 +- trunk/sound/pci/cs46xx/cs46xx.c | 2 +- trunk/sound/pci/cs46xx/cs46xx_lib.c | 7 +- trunk/sound/pci/cs5535audio/cs5535audio.c | 2 +- trunk/sound/pci/emu10k1/emu10k1.c | 2 +- trunk/sound/pci/emu10k1/emu10k1_main.c | 10 +- trunk/sound/pci/emu10k1/emu10k1x.c | 37 +- trunk/sound/pci/emu10k1/emumpu401.c | 35 +- trunk/sound/pci/ens1370.c | 2 +- trunk/sound/pci/es1938.c | 2 +- trunk/sound/pci/es1968.c | 2 +- trunk/sound/pci/fm801.c | 4 +- trunk/sound/pci/hda/hda_intel.c | 2 +- trunk/sound/pci/hda/patch_analog.c | 19 +- trunk/sound/pci/hda/patch_sigmatel.c | 1 - trunk/sound/pci/ice1712/aureon.c | 2 +- trunk/sound/pci/ice1712/ice1712.c | 2 +- trunk/sound/pci/ice1712/ice1724.c | 2 +- trunk/sound/pci/intel8x0.c | 8 +- trunk/sound/pci/intel8x0m.c | 2 +- trunk/sound/pci/korg1212/korg1212.c | 2 +- trunk/sound/pci/maestro3.c | 10 +- trunk/sound/pci/mixart/mixart.c | 2 +- trunk/sound/pci/nm256/nm256.c | 2 +- trunk/sound/pci/pcxhr/pcxhr.c | 2 +- trunk/sound/pci/riptide/riptide.c | 2 +- trunk/sound/pci/rme32.c | 2 +- trunk/sound/pci/rme96.c | 2 +- trunk/sound/pci/rme9652/hdsp.c | 4 +- trunk/sound/pci/rme9652/rme9652.c | 2 +- trunk/sound/pci/sonicvibes.c | 2 +- trunk/sound/pci/trident/trident.c | 2 +- trunk/sound/pci/via82xx.c | 2 +- trunk/sound/pci/via82xx_modem.c | 2 +- trunk/sound/pci/vx222/vx222.c | 2 +- trunk/sound/pci/ymfpci/ymfpci.c | 2 +- trunk/sound/pcmcia/pdaudiocf/pdaudiocf.c | 4 +- 758 files changed, 6328 insertions(+), 10707 deletions(-) rename trunk/arch/um/kernel/{exec.c => exec_kern.c} (87%) rename trunk/arch/um/kernel/{sigio.c => sigio_kern.c} (68%) rename trunk/arch/um/kernel/{signal.c => signal_kern.c} (96%) create mode 100644 trunk/arch/um/kernel/syscall_kern.c rename trunk/arch/um/kernel/{time.c => time_kern.c} (84%) rename trunk/arch/um/kernel/{trap.c => trap_kern.c} (95%) delete mode 100644 trunk/drivers/leds/leds-net48xx.c delete mode 100644 trunk/drivers/usb/host/ohci-ep93xx.c create mode 100644 trunk/drivers/usb/misc/cy7c63.c delete mode 100644 trunk/drivers/usb/misc/cypress_cy7c63.c delete mode 100644 trunk/drivers/usb/serial/sierra.c rename trunk/{include/linux/usb/serial.h => drivers/usb/serial/usb-serial.h} (99%) create mode 100644 trunk/drivers/w1/w1_io.h create mode 100644 trunk/net/ipv4/tcp_compound.c delete mode 100644 trunk/sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h create mode 100644 trunk/sound/aoa/soundbus/i2sbus/i2sbus-control.h diff --git a/[refs] b/[refs] index 91921ecb1875..487a4f13d299 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a23f4636c9ae7f1f15c448080f1552864b404136 +refs/heads/master: d608ab9917fbe9926704c07b27df72ac78133870 diff --git a/trunk/CREDITS b/trunk/CREDITS index 29be6d1fdf49..66b9e7a9abff 100644 --- a/trunk/CREDITS +++ b/trunk/CREDITS @@ -528,11 +528,11 @@ S: Oxford S: United Kingdom N: Luiz Fernando N. Capitulino -E: lcapitulino@mandriva.com.br -E: lcapitulino@gmail.com -W: http://www.cpu.eti.br -D: misc kernel hacking -S: Mandriva +E: lcapitulino@terra.com.br +E: lcapitulino@prefeitura.sp.gov.br +W: http://www.telecentros.sp.gov.br +D: Little fixes and a lot of janitorial work +S: E-GOV Telecentros SP S: Brazil N: Remy Card diff --git a/trunk/Documentation/RCU/whatisRCU.txt b/trunk/Documentation/RCU/whatisRCU.txt index 318df44259b3..4f41a60e5111 100644 --- a/trunk/Documentation/RCU/whatisRCU.txt +++ b/trunk/Documentation/RCU/whatisRCU.txt @@ -687,9 +687,8 @@ diff shows how closely related RCU and reader-writer locking can be. + spin_lock(&listmutex); list_for_each_entry(p, head, lp) { if (p->key == key) { - - list_del(&p->list); + list_del(&p->list); - write_unlock(&listmutex); - + list_del_rcu(&p->list); + spin_unlock(&listmutex); + synchronize_rcu(); kfree(p); @@ -737,7 +736,7 @@ Or, for those who prefer a side-by-side listing: 5 write_lock(&listmutex); 5 spin_lock(&listmutex); 6 list_for_each_entry(p, head, lp) { 6 list_for_each_entry(p, head, lp) { 7 if (p->key == key) { 7 if (p->key == key) { - 8 list_del(&p->list); 8 list_del_rcu(&p->list); + 8 list_del(&p->list); 8 list_del(&p->list); 9 write_unlock(&listmutex); 9 spin_unlock(&listmutex); 10 synchronize_rcu(); 10 kfree(p); 11 kfree(p); diff --git a/trunk/Documentation/SubmitChecklist b/trunk/Documentation/SubmitChecklist index a10bfb6ecd9f..8230098da529 100644 --- a/trunk/Documentation/SubmitChecklist +++ b/trunk/Documentation/SubmitChecklist @@ -1,63 +1,57 @@ Linux Kernel patch sumbittal checklist ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Here are some basic things that developers should do if they want to see their -kernel patch submissions accepted more quickly. +Here are some basic things that developers should do if they +want to see their kernel patch submittals accepted quicker. -These are all above and beyond the documentation that is provided in -Documentation/SubmittingPatches and elsewhere regarding submitting Linux -kernel patches. +These are all above and beyond the documentation that is provided +in Documentation/SubmittingPatches and elsewhere about submitting +Linux kernel patches. -1: Builds cleanly with applicable or modified CONFIG options =y, =m, and - =n. No gcc warnings/errors, no linker warnings/errors. +- Builds cleanly with applicable or modified CONFIG options =y, =m, and =n. + No gcc warnings/errors, no linker warnings/errors. -2: Passes allnoconfig, allmodconfig +- Passes allnoconfig, allmodconfig -3: Builds on multiple CPU architectures by using local cross-compile tools - or something like PLM at OSDL. +- Builds on multiple CPU arch-es by using local cross-compile tools + or something like PLM at OSDL. -4: ppc64 is a good architecture for cross-compilation checking because it - tends to use `unsigned long' for 64-bit quantities. +- ppc64 is a good architecture for cross-compilation checking because it + tends to use `unsigned long' for 64-bit quantities. -5: Matches kernel coding style(!) +- Matches kernel coding style(!) -6: Any new or modified CONFIG options don't muck up the config menu. +- Any new or modified CONFIG options don't muck up the config menu. -7: All new Kconfig options have help text. +- All new Kconfig options have help text. -8: Has been carefully reviewed with respect to relevant Kconfig - combinations. This is very hard to get right with testing -- brainpower - pays off here. +- Has been carefully reviewed with respect to relevant Kconfig + combinations. This is very hard to get right with testing -- + brainpower pays off here. -9: Check cleanly with sparse. +- Check cleanly with sparse. -10: Use 'make checkstack' and 'make namespacecheck' and fix any problems - that they find. Note: checkstack does not point out problems explicitly, - but any one function that uses more than 512 bytes on the stack is a - candidate for change. +- Use 'make checkstack' and 'make namespacecheck' and fix any + problems that they find. Note: checkstack does not point out + problems explicitly, but any one function that uses more than + 512 bytes on the stack is a candidate for change. -11: Include kernel-doc to document global kernel APIs. (Not required for - static functions, but OK there also.) Use 'make htmldocs' or 'make - mandocs' to check the kernel-doc and fix any issues. +- Include kernel-doc to document global kernel APIs. (Not required + for static functions, but OK there also.) Use 'make htmldocs' + or 'make mandocs' to check the kernel-doc and fix any issues. -12: Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, - CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, - CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP all simultaneously - enabled. +- Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, + CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, + CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP all simultaneously + enabled. -13: Has been build- and runtime tested with and without CONFIG_SMP and - CONFIG_PREEMPT. +- Has been build- and runtime tested with and without CONFIG_SMP and + CONFIG_PREEMPT. -14: If the patch affects IO/Disk, etc: has been tested with and without - CONFIG_LBD. +- If the patch affects IO/Disk, etc: has been tested with and without + CONFIG_LBD. -15: All codepaths have been exercised with all lockdep features enabled. -16: All new /proc entries are documented under Documentation/ - -17: All new kernel boot parameters are documented in - Documentation/kernel-parameters.txt. - -18: All new module parameters are documented with MODULE_PARM_DESC() +2006-APR-27 diff --git a/trunk/Documentation/drivers/edac/edac.txt b/trunk/Documentation/drivers/edac/edac.txt index 7b3d969d2964..70d96a62e5e1 100644 --- a/trunk/Documentation/drivers/edac/edac.txt +++ b/trunk/Documentation/drivers/edac/edac.txt @@ -35,14 +35,15 @@ the vendor should tie the parity status bits to 0 if they do not intend to generate parity. Some vendors do not do this, and thus the parity bit can "float" giving false positives. -[There are patches in the kernel queue which will allow for storage of -quirks of PCI devices reporting false parity positives. The 2.6.18 -kernel should have those patches included. When that becomes available, -then EDAC will be patched to utilize that information to "skip" such -devices.] +The PCI Parity EDAC device has the ability to "skip" known flaky +cards during the parity scan. These are set by the parity "blacklist" +interface in the sysfs for PCI Parity. (See the PCI section in the sysfs +section below.) There is also a parity "whitelist" which is used as +an explicit list of devices to scan, while the blacklist is a list +of devices to skip. -EDAC will have future error detectors that will be integrated with -EDAC or added to it, in the following list: +EDAC will have future error detectors that will be added or integrated +into EDAC in the following list: MCE Machine Check Exception MCA Machine Check Architecture @@ -92,24 +93,22 @@ EDAC lives in the /sys/devices/system/edac directory. Within this directory there currently reside 2 'edac' components: mc memory controller(s) system - pci PCI control and status system + pci PCI status system ============================================================================ Memory Controller (mc) Model First a background on the memory controller's model abstracted in EDAC. -Each 'mc' device controls a set of DIMM memory modules. These modules are +Each mc device controls a set of DIMM memory modules. These modules are laid out in a Chip-Select Row (csrowX) and Channel table (chX). There can -be multiple csrows and multiple channels. +be multiple csrows and two channels. Memory controllers allow for several csrows, with 8 csrows being a typical value. Yet, the actual number of csrows depends on the electrical "loading" of a given motherboard, memory controller and DIMM characteristics. Dual channels allows for 128 bit data transfers to the CPU from memory. -Some newer chipsets allow for more than 2 channels, like Fully Buffered DIMMs -(FB-DIMMs). The following example will assume 2 channels: Channel 0 Channel 1 @@ -235,15 +234,23 @@ Polling period control file: The time period, in milliseconds, for polling for error information. Too small a value wastes resources. Too large a value might delay necessary handling of errors and might loose valuable information for - locating the error. 1000 milliseconds (once each second) is the current - default. Systems which require all the bandwidth they can get, may - increase this. + locating the error. 1000 milliseconds (once each second) is about + right for most uses. LOAD TIME: module/kernel parameter: poll_msec=[0|1] RUN TIME: echo "1000" >/sys/devices/system/edac/mc/poll_msec +Module Version read-only attribute file: + + 'mc_version' + + The EDAC CORE module's version and compile date are shown here to + indicate what EDAC is running. + + + ============================================================================ 'mcX' DIRECTORIES @@ -277,6 +284,35 @@ Seconds since last counter reset control file: +DIMM capability attribute file: + + 'edac_capability' + + The EDAC (Error Detection and Correction) capabilities/modes of + the memory controller hardware. + + +DIMM Current Capability attribute file: + + 'edac_current_capability' + + The EDAC capabilities available with the hardware + configuration. This may not be the same as "EDAC capability" + if the correct memory is not used. If a memory controller is + capable of EDAC, but DIMMs without check bits are in use, then + Parity, SECDED, S4ECD4ED capabilities will not be available + even though the memory controller might be capable of those + modes with the proper memory loaded. + + +Memory Type supported on this controller attribute file: + + 'supported_mem_type' + + This attribute file displays the memory type, usually + buffered and unbuffered DIMMs. + + Memory Controller name attribute file: 'mc_name' @@ -285,6 +321,16 @@ Memory Controller name attribute file: that is being utilized. +Memory Controller Module name attribute file: + + 'module_name' + + This attribute file displays the memory controller module name, + version and date built. The name of the memory controller + hardware - some drivers work with multiple controllers and + this field shows which hardware is present. + + Total memory managed by this memory controller attribute file: 'size_mb' @@ -386,9 +432,6 @@ Memory Type attribute file: This attribute file will display what type of memory is currently on this csrow. Normally, either buffered or unbuffered memory. - Examples: - Registered-DDR - Unbuffered-DDR EDAC Mode of operation attribute file: @@ -403,13 +446,8 @@ Device type attribute file: 'dev_type' - This attribute file will display what type of DRAM device is - being utilized on this DIMM. - Examples: - x1 - x2 - x4 - x8 + This attribute file will display what type of DIMM device is + being utilized. Example: x4 Channel 0 CE Count attribute file: @@ -484,10 +522,10 @@ SYSTEM LOGGING If logging for UEs and CEs are enabled then system logs will have error notices indicating errors that have been detected: -EDAC MC0: CE page 0x283, offset 0xce0, grain 8, syndrome 0x6ec3, row 0, +MC0: CE page 0x283, offset 0xce0, grain 8, syndrome 0x6ec3, row 0, channel 1 "DIMM_B1": amd76x_edac -EDAC MC0: CE page 0x1e5, offset 0xfb0, grain 8, syndrome 0xb741, row 0, +MC0: CE page 0x1e5, offset 0xfb0, grain 8, syndrome 0xb741, row 0, channel 1 "DIMM_B1": amd76x_edac @@ -572,4 +610,64 @@ Parity Count: +PCI Device Whitelist: + + 'pci_parity_whitelist' + + This control file allows for an explicit list of PCI devices to be + scanned for parity errors. Only devices found on this list will + be examined. The list is a line of hexadecimal VENDOR and DEVICE + ID tuples: + + 1022:7450,1434:16a6 + + One or more can be inserted, separated by a comma. + + To write the above list doing the following as one command line: + + echo "1022:7450,1434:16a6" + > /sys/devices/system/edac/pci/pci_parity_whitelist + + + + To display what the whitelist is, simply 'cat' the same file. + + +PCI Device Blacklist: + + 'pci_parity_blacklist' + + This control file allows for a list of PCI devices to be + skipped for scanning. + The list is a line of hexadecimal VENDOR and DEVICE ID tuples: + + 1022:7450,1434:16a6 + + One or more can be inserted, separated by a comma. + + To write the above list doing the following as one command line: + + echo "1022:7450,1434:16a6" + > /sys/devices/system/edac/pci/pci_parity_blacklist + + + To display what the whitelist currently contains, + simply 'cat' the same file. + ======================================================================= + +PCI Vendor and Devices IDs can be obtained with the lspci command. Using +the -n option lspci will display the vendor and device IDs. The system +administrator will have to determine which devices should be scanned or +skipped. + + + +The two lists (white and black) are prioritized. blacklist is the lower +priority and will NOT be utilized when a whitelist has been set. +Turn OFF a whitelist by an empty echo command: + + echo > /sys/devices/system/edac/pci/pci_parity_whitelist + +and any previous blacklist will be utilized. + diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index 9d3a0775a11d..99f219a01e0e 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -55,6 +55,14 @@ Who: Mauro Carvalho Chehab --------------------------- +What: remove EXPORT_SYMBOL(insert_resource) +When: April 2006 +Files: kernel/resource.c +Why: No modular usage in the kernel. +Who: Adrian Bunk + +--------------------------- + What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) When: November 2005 Files: drivers/pcmcia/: pcmcia_ioctl.c @@ -158,6 +166,17 @@ Who: Arjan van de Ven --------------------------- +What: remove EXPORT_SYMBOL(tasklist_lock) +When: August 2006 +Files: kernel/fork.c +Why: tasklist_lock protects the kernel internal task list. Modules have + no business looking at it, and all instances in drivers have been due + to use of too-lowlevel APIs. Having this symbol exported prevents + moving to more scalable locking schemes for the task list. +Who: Christoph Hellwig + +--------------------------- + What: mount/umount uevents When: February 2007 Why: These events are not correct, and do not properly let userspace know @@ -247,14 +266,3 @@ Why: The interrupt related SA_* flags are replaced by IRQF_* to move them Who: Thomas Gleixner --------------------------- - -What: i2c-ite and i2c-algo-ite drivers -When: September 2006 -Why: These drivers never compiled since they were added to the kernel - tree 5 years ago. This feature removal can be reevaluated if - someone shows interest in the drivers, fixes them and takes over - maintenance. - http://marc.theaimsgroup.com/?l=linux-mips&m=115040510817448 -Who: Jean Delvare - ---------------------------- diff --git a/trunk/Documentation/filesystems/Locking b/trunk/Documentation/filesystems/Locking index 247d7f619aa2..d31efbbdfe50 100644 --- a/trunk/Documentation/filesystems/Locking +++ b/trunk/Documentation/filesystems/Locking @@ -142,8 +142,8 @@ see also dquot_operations section. --------------------------- file_system_type --------------------------- prototypes: - int (*get_sb) (struct file_system_type *, int, - const char *, void *, struct vfsmount *); + struct int (*get_sb) (struct file_system_type *, int, + const char *, void *, struct vfsmount *); void (*kill_sb) (struct super_block *); locking rules: may block BKL diff --git a/trunk/Documentation/filesystems/vfs.txt b/trunk/Documentation/filesystems/vfs.txt index 1cb7e8be927a..9d3aed628bc1 100644 --- a/trunk/Documentation/filesystems/vfs.txt +++ b/trunk/Documentation/filesystems/vfs.txt @@ -113,8 +113,8 @@ members are defined: struct file_system_type { const char *name; int fs_flags; - int (*get_sb) (struct file_system_type *, int, - const char *, void *, struct vfsmount *); + struct int (*get_sb) (struct file_system_type *, int, + const char *, void *, struct vfsmount *); void (*kill_sb) (struct super_block *); struct module *owner; struct file_system_type * next; diff --git a/trunk/Documentation/hwmon/abituguru b/trunk/Documentation/hwmon/abituguru index b2c0d61b39a2..69cdb527d58f 100644 --- a/trunk/Documentation/hwmon/abituguru +++ b/trunk/Documentation/hwmon/abituguru @@ -2,36 +2,13 @@ Kernel driver abituguru ======================= Supported chips: - * Abit uGuru revision 1-3 (Hardware Monitor part only) + * Abit uGuru (Hardware Monitor part only) Prefix: 'abituguru' Addresses scanned: ISA 0x0E0 Datasheet: Not available, this driver is based on reverse engineering. A "Datasheet" has been written based on the reverse engineering it should be available in the same dir as this file under the name abituguru-datasheet. - Note: - The uGuru is a microcontroller with onboard firmware which programs - it to behave as a hwmon IC. There are many different revisions of the - firmware and thus effectivly many different revisions of the uGuru. - Below is an incomplete list with which revisions are used for which - Motherboards: - uGuru 1.00 ~ 1.24 (AI7, KV8-MAX3, AN7) (1) - uGuru 2.0.0.0 ~ 2.0.4.2 (KV8-PRO) - uGuru 2.1.0.0 ~ 2.1.2.8 (AS8, AV8, AA8, AG8, AA8XE, AX8) - uGuru 2.2.0.0 ~ 2.2.0.6 (AA8 Fatal1ty) - uGuru 2.3.0.0 ~ 2.3.0.9 (AN8) - uGuru 3.0.0.0 ~ 3.0.1.2 (AW8, AL8, NI8) - uGuru 4.xxxxx? (AT8 32X) (2) - 1) For revisions 2 and 3 uGuru's the driver can autodetect the - sensortype (Volt or Temp) for bank1 sensors, for revision 1 uGuru's - this doesnot always work. For these uGuru's the autodection can - be overriden with the bank1_types module param. For all 3 known - revison 1 motherboards the correct use of this param is: - bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1 - You may also need to specify the fan_sensors option for these boards - fan_sensors=5 - 2) The current version of the abituguru driver is known to NOT work - on these Motherboards Authors: Hans de Goede , @@ -45,11 +22,6 @@ Module Parameters * force: bool Force detection. Note this parameter only causes the detection to be skipped, if the uGuru can't be read the module initialization (insmod) will still fail. -* bank1_types: int[] Bank1 sensortype autodetection override: - -1 autodetect (default) - 0 volt sensor - 1 temp sensor - 2 not connected * fan_sensors: int Tell the driver how many fan speed sensors there are on your motherboard. Default: 0 (autodetect). * pwms: int Tell the driver how many fan speed controls (fan @@ -57,7 +29,7 @@ Module Parameters * verbose: int How verbose should the driver be? (0-3): 0 normal output 1 + verbose error reporting - 2 + sensors type probing info (default) + 2 + sensors type probing info\n" 3 + retryable error reporting Default: 2 (the driver is still in the testing phase) diff --git a/trunk/Documentation/i2c/busses/i2c-sis96x b/trunk/Documentation/i2c/busses/i2c-sis96x index 08d7b2dac69a..00a009b977e9 100644 --- a/trunk/Documentation/i2c/busses/i2c-sis96x +++ b/trunk/Documentation/i2c/busses/i2c-sis96x @@ -42,8 +42,8 @@ I suspect that this driver could be made to work for the following SiS chipsets as well: 635, and 635T. If anyone owns a board with those chips AND is willing to risk crashing & burning an otherwise well-behaved kernel in the name of progress... please contact me at or -via the project's mailing list: . Please send bug -reports and/or success stories as well. +via the project's mailing list: . Please +send bug reports and/or success stories as well. TO DOs diff --git a/trunk/Documentation/nfsroot.txt b/trunk/Documentation/nfsroot.txt index 3cc953cb288f..d56dc71d9430 100644 --- a/trunk/Documentation/nfsroot.txt +++ b/trunk/Documentation/nfsroot.txt @@ -4,16 +4,15 @@ Mounting the root filesystem via NFS (nfsroot) Written 1996 by Gero Kuhlmann Updated 1997 by Martin Mares Updated 2006 by Nico Schottelius -Updated 2006 by Horms -In order to use a diskless system, such as an X-terminal or printer server -for example, it is necessary for the root filesystem to be present on a -non-disk device. This may be an initramfs (see Documentation/filesystems/ -ramfs-rootfs-initramfs.txt), a ramdisk (see Documenation/initrd.txt) or a -filesystem mounted via NFS. The following text describes on how to use NFS -for the root filesystem. For the rest of this text 'client' means the +If you want to use a diskless system, as an X-terminal or printer +server for example, you have to put your root filesystem onto a +non-disk device. This can either be a ramdisk (see initrd.txt in +this directory for further information) or a filesystem mounted +via NFS. The following text describes on how to use NFS for the +root filesystem. For the rest of this text 'client' means the diskless system, and 'server' means the NFS server. @@ -22,13 +21,11 @@ diskless system, and 'server' means the NFS server. 1.) Enabling nfsroot capabilities ----------------------------- -In order to use nfsroot, NFS client support needs to be selected as -built-in during configuration. Once this has been selected, the nfsroot -option will become available, which should also be selected. - -In the networking options, kernel level autoconfiguration can be selected, -along with the types of autoconfiguration to support. Selecting all of -DHCP, BOOTP and RARP is safe. +In order to use nfsroot you have to select support for NFS during +kernel configuration. Note that NFS cannot be loaded as a module +in this case. The configuration script will then ask you whether +you want to use nfsroot, and if yes what kind of auto configuration +system you want to use. Selecting both BOOTP and RARP is safe. @@ -36,10 +33,11 @@ DHCP, BOOTP and RARP is safe. 2.) Kernel command line ------------------- -When the kernel has been loaded by a boot loader (see below) it needs to be -told what root fs device to use. And in the case of nfsroot, where to find -both the server and the name of the directory on the server to mount as root. -This can be established using the following kernel command line parameters: +When the kernel has been loaded by a boot loader (either by loadlin, +LILO or a network boot program) it has to be told what root fs device +to use, and where to find the server and the name of the directory +on the server to mount as root. This can be established by a couple +of kernel command line parameters: root=/dev/nfs @@ -51,21 +49,23 @@ root=/dev/nfs nfsroot=[:][,] - If the `nfsroot' parameter is NOT given on the command line, - the default "/tftpboot/%s" will be used. + If the `nfsroot' parameter is NOT given on the command line, the default + "/tftpboot/%s" will be used. - Specifies the IP address of the NFS server. - The default address is determined by the `ip' parameter - (see below). This parameter allows the use of different - servers for IP autoconfiguration and NFS. + Specifies the IP address of the NFS server. If this field + is not given, the default address as determined by the + `ip' variable (see below) is used. One use of this + parameter is for example to allow using different servers + for RARP and NFS. Usually you can leave this blank. - Name of the directory on the server to mount as root. - If there is a "%s" token in the string, it will be - replaced by the ASCII-representation of the client's - IP address. + Name of the directory on the server to mount as root. If + there is a "%s" token in the string, the token will be + replaced by the ASCII-representation of the client's IP + address. Standard NFS options. All options are separated by commas. - The following defaults are used: + If the options field is not given, the following defaults + will be used: port = as given by server portmap daemon rsize = 1024 wsize = 1024 @@ -81,174 +81,129 @@ nfsroot=[:][,] ip=:::::: This parameter tells the kernel how to configure IP addresses of devices - and also how to set up the IP routing table. It was originally called - `nfsaddrs', but now the boot-time IP configuration works independently of - NFS, so it was renamed to `ip' and the old name remained as an alias for - compatibility reasons. + and also how to set up the IP routing table. It was originally called `nfsaddrs', + but now the boot-time IP configuration works independently of NFS, so it + was renamed to `ip' and the old name remained as an alias for compatibility + reasons. If this parameter is missing from the kernel command line, all fields are assumed to be empty, and the defaults mentioned below apply. In general - this means that the kernel tries to configure everything using - autoconfiguration. - - The parameter can appear alone as the value to the `ip' - parameter (without all the ':' characters before) in which case auto- - configuration is used. - - IP address of the client. + this means that the kernel tries to configure everything using both + RARP and BOOTP (depending on what has been enabled during kernel confi- + guration, and if both what protocol answer got in first). - Default: Determined using autoconfiguration. + IP address of the client. If empty, the address will either + be determined by RARP or BOOTP. What protocol is used de- + pends on what has been enabled during kernel configuration + and on the parameter. If this parameter is not + empty, neither RARP nor BOOTP will be used. IP address of the NFS server. If RARP is used to determine the client address and this parameter is NOT empty only - replies from the specified server are accepted. - - Only required for for NFS root. That is autoconfiguration - will not be triggered if it is missing and NFS root is not - in operation. - - Default: Determined using autoconfiguration. - The address of the autoconfiguration server is used. - - IP address of a gateway if the server is on a different subnet. - - Default: Determined using autoconfiguration. - - Netmask for local network interface. If unspecified + replies from the specified server are accepted. To use + different RARP and NFS server, specify your RARP server + here (or leave it blank), and specify your NFS server in + the `nfsroot' parameter (see above). If this entry is blank + the address of the server is used which answered the RARP + or BOOTP request. + + IP address of a gateway if the server is on a different + subnet. If this entry is empty no gateway is used and the + server is assumed to be on the local network, unless a + value has been received by BOOTP. + + Netmask for local network interface. If this is empty, the netmask is derived from the client IP address assuming - classful addressing. - - Default: Determined using autoconfiguration. - - Name of the client. May be supplied by autoconfiguration, - but its absence will not trigger autoconfiguration. - - Default: Client IP address is used in ASCII notation. - - Name of network device to use. + classful addressing, unless overridden in BOOTP reply. - Default: If the host only has one device, it is used. - Otherwise the device is determined using - autoconfiguration. This is done by sending - autoconfiguration requests out of all devices, - and using the device that received the first reply. + Name of the client. If empty, the client IP address is + used in ASCII notation, or the value received by BOOTP. - Method to use for autoconfiguration. In the case of options - which specify multiple autoconfiguration protocols, - requests are sent using all protocols, and the first one - to reply is used. + Name of network device to use. If this is empty, all + devices are used for RARP and BOOTP requests, and the + first one we receive a reply on is configured. If you have + only one device, you can safely leave this blank. - Only autoconfiguration protocols that have been compiled - into the kernel will be used, regardless of the value of - this option. + Method to use for autoconfiguration. If this is either + 'rarp' or 'bootp', the specified protocol is used. + If the value is 'both' or empty, both protocols are used + so far as they have been enabled during kernel configura- + tion. 'off' means no autoconfiguration. - off or none: don't use autoconfiguration (default) - on or any: use any protocol available in the kernel - dhcp: use DHCP - bootp: use BOOTP - rarp: use RARP - both: use both BOOTP and RARP but not DHCP - (old option kept for backwards compatibility) - - Default: any - - - - -3.) Boot Loader - ---------- - -To get the kernel into memory different approaches can be used. -They depend on various facilities being available: + The parameter can appear alone as the value to the `ip' + parameter (without all the ':' characters before) in which case auto- + configuration is used. -3.1) Booting from a floppy using syslinux - When building kernels, an easy way to create a boot floppy that uses - syslinux is to use the zdisk or bzdisk make targets which use - and bzimage images respectively. Both targets accept the - FDARGS parameter which can be used to set the kernel command line. - e.g. - make bzdisk FDARGS="root=/dev/nfs" +3.) Kernel loader + ------------- - Note that the user running this command will need to have - access to the floppy drive device, /dev/fd0 +To get the kernel into memory different approaches can be used. They +depend on what facilities are available: - For more information on syslinux, including how to create bootdisks - for prebuilt kernels, see http://syslinux.zytor.com/ - N.B: Previously it was possible to write a kernel directly to - a floppy using dd, configure the boot device using rdev, and - boot using the resulting floppy. Linux no longer supports this - method of booting. +3.1) Writing the kernel onto a floppy using dd: + As always you can just write the kernel onto a floppy using dd, + but then it's not possible to use kernel command lines at all. + To substitute the 'root=' parameter, create a dummy device on any + linux system with major number 0 and minor number 255 using mknod: -3.2) Booting from a cdrom using isolinux + mknod /dev/boot255 c 0 255 - When building kernels, an easy way to create a bootable cdrom that - uses isolinux is to use the isoimage target which uses a bzimage - image. Like zdisk and bzdisk, this target accepts the FDARGS - parameter which can be used to set the kernel command line. + Then copy the kernel zImage file onto a floppy using dd: - e.g. - make isoimage FDARGS="root=/dev/nfs" + dd if=/usr/src/linux/arch/i386/boot/zImage of=/dev/fd0 - The resulting iso image will be arch//boot/image.iso - This can be written to a cdrom using a variety of tools including - cdrecord. + And finally use rdev to set the root device: - e.g. - cdrecord dev=ATAPI:1,0,0 arch/i386/boot/image.iso + rdev /dev/fd0 /dev/boot255 - For more information on isolinux, including how to create bootdisks - for prebuilt kernels, see http://syslinux.zytor.com/ + You can then remove the dummy device /dev/boot255 again. There + is no real device available for it. + The other two kernel command line parameters cannot be substi- + tuted with rdev. Therefore, using this method the kernel will + by default use RARP and/or BOOTP, and if it gets an answer via + RARP will mount the directory /tftpboot// as its + root. If it got a BOOTP answer the directory name in that answer + is used. 3.2) Using LILO - When using LILO all the necessary command line parameters may be - specified using the 'append=' directive in the LILO configuration - file. - - However, to use the 'root=' directive you also need to create - a dummy root device, which may be removed after LILO is run. - - mknod /dev/boot255 c 0 255 - - For information on configuring LILO, please refer to its documentation. + When using LILO you can specify all necessary command line + parameters with the 'append=' command in the LILO configuration + file. However, to use the 'root=' command you also need to + set up a dummy device as described in 3.1 above. For how to use + LILO and its 'append=' command please refer to the LILO + documentation. 3.3) Using GRUB - When using GRUB, kernel parameter are simply appended after the kernel - specification: kernel + When you use GRUB, you simply append the parameters after the kernel + specification: "kernel " (without the quotes). 3.4) Using loadlin - loadlin may be used to boot Linux from a DOS command prompt without - requiring a local hard disk to mount as root. This has not been - thoroughly tested by the authors of this document, but in general - it should be possible configure the kernel command line similarly - to the configuration of LILO. - - Please refer to the loadlin documentation for further information. + When you want to boot Linux from a DOS command prompt without + having a local hard disk to mount as root, you can use loadlin. + I was told that it works, but haven't used it myself yet. In + general you should be able to create a kernel command line simi- + lar to how LILO is doing it. Please refer to the loadlin docu- + mentation for further information. 3.5) Using a boot ROM - This is probably the most elegant way of booting a diskless client. - With a boot ROM the kernel is loaded using the TFTP protocol. The - authors of this document are not aware of any no commercial boot - ROMs that support booting Linux over the network. However, there - are two free implementations of a boot ROM, netboot-nfs and - etherboot, both of which are available on sunsite.unc.edu, and both - of which contain everything you need to boot a diskless Linux client. + This is probably the most elegant way of booting a diskless + client. With a boot ROM the kernel gets loaded using the TFTP + protocol. As far as I know, no commercial boot ROMs yet + support booting Linux over the network, but there are two + free implementations of a boot ROM available on sunsite.unc.edu + and its mirrors. They are called 'netboot-nfs' and 'etherboot'. + Both contain everything you need to boot a diskless Linux client. 3.6) Using pxelinux - Pxelinux may be used to boot linux using the PXE boot loader - which is present on many modern network cards. - - When using pxelinux, the kernel image is specified using + Using pxelinux you specify the kernel you built with "kernel ". The nfsroot parameters are passed to the kernel by adding them to the "append" line. - It is common to use serial console in conjunction with pxeliunx, - see Documentation/serial-console.txt for more information. - - For more information on isolinux, including how to create bootdisks - for prebuilt kernels, see http://syslinux.zytor.com/ + You may perhaps also want to fine tune the console output, + see Documentation/serial-console.txt for serial console help. diff --git a/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index b8dc51ca776c..69866d5997a4 100644 --- a/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl @@ -1172,7 +1172,7 @@ } /* PCI IDs */ - static struct pci_device_id snd_mychip_ids[] = { + static struct pci_device_id snd_mychip_ids[] __devinitdata = { { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, .... @@ -1565,7 +1565,7 @@ #include #include -#include #include #include #include diff --git a/trunk/arch/alpha/kernel/process.c b/trunk/arch/alpha/kernel/process.c index b3a8a2980365..41ebf51a107a 100644 --- a/trunk/arch/alpha/kernel/process.c +++ b/trunk/arch/alpha/kernel/process.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/arch/alpha/kernel/setup.c b/trunk/arch/alpha/kernel/setup.c index 2cb9c4380113..254c507a608c 100644 --- a/trunk/arch/alpha/kernel/setup.c +++ b/trunk/arch/alpha/kernel/setup.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include /* CONFIG_ALPHA_LCA etc */ #include diff --git a/trunk/arch/alpha/kernel/sys_sio.c b/trunk/arch/alpha/kernel/sys_sio.c index a654014d202a..cd85ef725e0e 100644 --- a/trunk/arch/alpha/kernel/sys_sio.c +++ b/trunk/arch/alpha/kernel/sys_sio.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/arch/arm/common/locomo.c b/trunk/arch/arm/common/locomo.c index 04de83f4f008..fbc3ab0e1011 100644 --- a/trunk/arch/arm/common/locomo.c +++ b/trunk/arch/arm/common/locomo.c @@ -506,7 +506,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info) goto out; } - strncpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id)); + strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); /* * If the parent device has a DMA mask associated with it, * propagate it down to the children. @@ -729,6 +729,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) for (i = 0; i < ARRAY_SIZE(locomo_devices); i++) locomo_init_one_child(lchip, &locomo_devices[i]); + return 0; out: diff --git a/trunk/arch/arm/common/sharpsl_pm.c b/trunk/arch/arm/common/sharpsl_pm.c index 59b5ddec480f..045e37e07330 100644 --- a/trunk/arch/arm/common/sharpsl_pm.c +++ b/trunk/arch/arm/common/sharpsl_pm.c @@ -412,10 +412,8 @@ static int sharpsl_check_battery_temp(void) val = get_select_val(buff); dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val); - if (val > sharpsl_pm.machinfo->charge_on_temp) { - printk(KERN_WARNING "Not charging: temperature out of limits.\n"); + if (val > sharpsl_pm.machinfo->charge_on_temp) return -1; - } return 0; } diff --git a/trunk/arch/arm/configs/ep93xx_defconfig b/trunk/arch/arm/configs/ep93xx_defconfig index c0de6fcd488a..b69e88bbc909 100644 --- a/trunk/arch/arm/configs/ep93xx_defconfig +++ b/trunk/arch/arm/configs/ep93xx_defconfig @@ -1,18 +1,14 @@ # # 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.17-rc2 +# Wed Apr 19 21:21:01 2006 # CONFIG_ARM=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options @@ -47,15 +43,14 @@ 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 +CONFIG_OBSOLETE_INTERMODULE=y # # Loadable module support @@ -88,26 +83,18 @@ CONFIG_DEFAULT_IOSCHED="deadline" # # System Type # -# CONFIG_ARCH_AAEC2000 is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_AT91 is not set # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set CONFIG_ARCH_EP93XX=y # CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_H720X is not set -# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set # CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_IXP23XX is not set # CONFIG_ARCH_L7200 is not set -# CONFIG_ARCH_PNX4008 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set # CONFIG_ARCH_SA1100 is not set @@ -115,18 +102,20 @@ CONFIG_ARCH_EP93XX=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_AT91RM9200 is not set # # Cirrus EP93xx Implementation Options # -CONFIG_CRUNCH=y # # EP93xx Platforms # -CONFIG_MACH_EDB9302=y -CONFIG_MACH_EDB9315=y -CONFIG_MACH_EDB9315A=y CONFIG_MACH_GESBC9312=y CONFIG_MACH_TS72XX=y @@ -177,7 +166,6 @@ CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4096 -# CONFIG_RESOURCES_64BIT is not set CONFIG_ALIGNMENT_TRAP=y # @@ -245,8 +233,6 @@ CONFIG_SYN_COOKIES=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 @@ -254,7 +240,6 @@ 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 is not set # @@ -309,7 +294,6 @@ CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set -# CONFIG_SYS_HYPERVISOR is not set # # Connector - unified userspace <-> kernelspace linker @@ -402,8 +386,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1 # CONFIG_MTD_NAND=y CONFIG_MTD_NAND_VERIFY_WRITE=y -# CONFIG_MTD_NAND_ECC_SMC is not set -CONFIG_MTD_NAND_TS7250=y CONFIG_MTD_NAND_IDS=y # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_NANDSIM is not set @@ -600,7 +582,6 @@ CONFIG_EP93XX_WATCHDOG=y # USB-based Watchdog Cards # # CONFIG_USBPCWATCHDOG is not set -# CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -632,7 +613,6 @@ CONFIG_I2C_ALGOBIT=y # # I2C Hardware Bus support # -# CONFIG_I2C_OCORES is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_PCA_ISA is not set @@ -661,13 +641,13 @@ CONFIG_I2C_DEBUG_CHIP=y # # Dallas's 1-wire bus # +# CONFIG_W1 is not set # # Hardware Monitoring support # CONFIG_HWMON=y # CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_ABITUGURU is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set @@ -695,10 +675,8 @@ CONFIG_HWMON=y # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set # CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set # CONFIG_SENSORS_W83792D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set @@ -726,7 +704,6 @@ CONFIG_HWMON=y # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -737,7 +714,6 @@ CONFIG_VIDEO_V4L2=y # # Graphics support # -# CONFIG_FIRMWARE_EDID is not set # CONFIG_FB is not set # @@ -830,7 +806,6 @@ CONFIG_USB_SERIAL_CONSOLE=y # CONFIG_USB_SERIAL_GENERIC is not set # 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 is not set # CONFIG_USB_SERIAL_WHITEHEAT is not set # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set @@ -858,7 +833,6 @@ CONFIG_USB_SERIAL_PL2303=y # CONFIG_USB_SERIAL_TI is not set # CONFIG_USB_SERIAL_CYBERJACK is not set # CONFIG_USB_SERIAL_XIRCOM is not set -# CONFIG_USB_SERIAL_OPTION is not set # CONFIG_USB_SERIAL_OMNINET is not set # @@ -871,12 +845,10 @@ 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_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_LD is not set # CONFIG_USB_TEST is not set @@ -908,24 +880,17 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc0" CONFIG_RTC_INTF_SYSFS=y CONFIG_RTC_INTF_PROC=y CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set # # RTC drivers # # CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1553 is not set # CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_DS1742 is not set # CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_RS5C372 is not set CONFIG_RTC_DRV_M48T86=y CONFIG_RTC_DRV_EP93XX=y -# CONFIG_RTC_DRV_PL031 is not set # CONFIG_RTC_DRV_TEST is not set -# CONFIG_RTC_DRV_V3020 is not set # # File systems @@ -945,7 +910,6 @@ CONFIG_JBD=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 @@ -993,7 +957,6 @@ CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y # CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -1023,7 +986,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 @@ -1104,20 +1066,15 @@ CONFIG_NLS_ISO8859_1=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=14 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set CONFIG_DEBUG_SLAB=y # CONFIG_DEBUG_SLAB_LEAK is not set -# 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_SPINLOCK=y # CONFIG_DEBUG_SPINLOCK_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set @@ -1157,4 +1114,3 @@ CONFIG_CRC32=y CONFIG_LIBCRC32C=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y diff --git a/trunk/arch/arm/configs/ixp2000_defconfig b/trunk/arch/arm/configs/ixp2000_defconfig index 27b3e31a8ad8..e6f3e4873d6c 100644 --- a/trunk/arch/arm/configs/ixp2000_defconfig +++ b/trunk/arch/arm/configs/ixp2000_defconfig @@ -1,18 +1,14 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc1 -# Sun Jul 9 15:28:50 2006 +# Linux kernel version: 2.6.17-rc2 +# Wed Apr 19 21:12:49 2006 # CONFIG_ARM=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options @@ -47,15 +43,14 @@ 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 +CONFIG_OBSOLETE_INTERMODULE=y # # Loadable module support @@ -88,26 +83,18 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # # System Type # -# CONFIG_ARCH_AAEC2000 is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_AT91 is not set # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set # CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_H720X is not set -# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set CONFIG_ARCH_IXP2000=y # CONFIG_ARCH_IXP23XX is not set # CONFIG_ARCH_L7200 is not set -# CONFIG_ARCH_PNX4008 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set # CONFIG_ARCH_SA1100 is not set @@ -115,6 +102,12 @@ CONFIG_ARCH_IXP2000=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_AT91RM9200 is not set CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y # @@ -178,7 +171,6 @@ CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4096 -# CONFIG_RESOURCES_64BIT is not set CONFIG_ALIGNMENT_TRAP=y # @@ -226,8 +218,6 @@ CONFIG_NET=y CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y -CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -246,8 +236,6 @@ CONFIG_SYN_COOKIES=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 @@ -255,7 +243,6 @@ 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 is not set # @@ -310,7 +297,6 @@ CONFIG_STANDALONE=y # CONFIG_PREVENT_FIRMWARE_BUILD is not set # CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set -# CONFIG_SYS_HYPERVISOR is not set # # Connector - unified userspace <-> kernelspace linker @@ -539,7 +525,6 @@ CONFIG_ENP2611_MSF_NET=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 @@ -557,6 +542,7 @@ CONFIG_ENP2611_MSF_NET=y CONFIG_WAN=y # CONFIG_DSCC4 is not set # CONFIG_LANMEDIA is not set +# CONFIG_SYNCLINK_SYNCPPP is not set CONFIG_HDLC=y CONFIG_HDLC_RAW=y # CONFIG_HDLC_RAW_ETH is not set @@ -668,7 +654,6 @@ CONFIG_IXP2000_WATCHDOG=y # # CONFIG_PCIPCWATCHDOG is not set # CONFIG_WDTPCI is not set -# CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -712,7 +697,6 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_PIIX4 is not set CONFIG_I2C_IXP2000=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 @@ -749,13 +733,13 @@ CONFIG_SENSORS_EEPROM=y # # Dallas's 1-wire bus # +# CONFIG_W1 is not set # # Hardware Monitoring support # CONFIG_HWMON=y # CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_ABITUGURU is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set @@ -784,12 +768,10 @@ CONFIG_HWMON=y # CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SIS5595 is not set # CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set # CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_VT8231 is not set # CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set # CONFIG_SENSORS_W83792D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set @@ -817,7 +799,6 @@ CONFIG_HWMON=y # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -827,7 +808,6 @@ CONFIG_VIDEO_V4L2=y # # Graphics support # -# CONFIG_FIRMWARE_EDID is not set # CONFIG_FB is not set # @@ -886,7 +866,6 @@ 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 @@ -931,7 +910,6 @@ CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y # CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -961,7 +939,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 @@ -1003,19 +980,14 @@ CONFIG_MSDOS_PARTITION=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=14 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB 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=y -# CONFIG_DEBUG_RWSEMS is not set +# CONFIG_DEBUG_SPINLOCK 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_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set @@ -1055,4 +1027,3 @@ CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y diff --git a/trunk/arch/arm/configs/ixp23xx_defconfig b/trunk/arch/arm/configs/ixp23xx_defconfig index 7b18997083ce..9ce898a6cf87 100644 --- a/trunk/arch/arm/configs/ixp23xx_defconfig +++ b/trunk/arch/arm/configs/ixp23xx_defconfig @@ -1,18 +1,14 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc1 -# Sun Jul 9 14:13:35 2006 +# Linux kernel version: 2.6.17-rc2 +# Wed Apr 19 21:13:50 2006 # CONFIG_ARM=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options @@ -47,15 +43,14 @@ 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 +CONFIG_OBSOLETE_INTERMODULE=y # # Loadable module support @@ -88,26 +83,18 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # # System Type # -# CONFIG_ARCH_AAEC2000 is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_AT91 is not set # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set # CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_H720X is not set -# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set # CONFIG_ARCH_IXP2000 is not set CONFIG_ARCH_IXP23XX=y # CONFIG_ARCH_L7200 is not set -# CONFIG_ARCH_PNX4008 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set # CONFIG_ARCH_SA1100 is not set @@ -115,6 +102,12 @@ CONFIG_ARCH_IXP23XX=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_AT91RM9200 is not set CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y # @@ -172,7 +165,6 @@ CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4096 -CONFIG_RESOURCES_64BIT=y CONFIG_ALIGNMENT_TRAP=y # @@ -220,8 +212,6 @@ CONFIG_NET=y CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y -CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -240,8 +230,6 @@ CONFIG_SYN_COOKIES=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 @@ -249,7 +237,6 @@ 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 is not set # @@ -304,7 +291,6 @@ CONFIG_STANDALONE=y # CONFIG_PREVENT_FIRMWARE_BUILD is not set # CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set -# CONFIG_SYS_HYPERVISOR is not set # # Connector - unified userspace <-> kernelspace linker @@ -534,7 +520,6 @@ CONFIG_BLK_DEV_SD=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_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_IPS is not set @@ -656,7 +641,6 @@ CONFIG_E1000_NAPI=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 @@ -674,6 +658,7 @@ CONFIG_E1000_NAPI=y CONFIG_WAN=y # CONFIG_DSCC4 is not set # CONFIG_LANMEDIA is not set +# CONFIG_SYNCLINK_SYNCPPP is not set CONFIG_HDLC=y CONFIG_HDLC_RAW=y # CONFIG_HDLC_RAW_ETH is not set @@ -790,7 +775,6 @@ CONFIG_WATCHDOG=y # USB-based Watchdog Cards # # CONFIG_USBPCWATCHDOG is not set -# CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -833,7 +817,6 @@ 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_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set @@ -870,13 +853,13 @@ CONFIG_SENSORS_EEPROM=y # # Dallas's 1-wire bus # +# CONFIG_W1 is not set # # Hardware Monitoring support # CONFIG_HWMON=y # CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_ABITUGURU is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set @@ -905,12 +888,10 @@ CONFIG_HWMON=y # CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SIS5595 is not set # CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set # CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_VT8231 is not set # CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set # CONFIG_SENSORS_W83792D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set @@ -938,7 +919,6 @@ CONFIG_HWMON=y # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -949,7 +929,6 @@ CONFIG_VIDEO_V4L2=y # # Graphics support # -# CONFIG_FIRMWARE_EDID is not set # CONFIG_FB is not set # @@ -980,7 +959,6 @@ CONFIG_USB=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 @@ -1072,12 +1050,10 @@ 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_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 @@ -1124,7 +1100,6 @@ 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 @@ -1171,7 +1146,6 @@ CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y # CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -1201,7 +1175,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 @@ -1282,19 +1255,14 @@ CONFIG_NLS_CODEPAGE_437=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=14 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB 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=y -# CONFIG_DEBUG_RWSEMS is not set +# CONFIG_DEBUG_SPINLOCK 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_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set @@ -1334,4 +1302,3 @@ CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y diff --git a/trunk/arch/arm/configs/lpd270_defconfig b/trunk/arch/arm/configs/lpd270_defconfig index 4b29e099640d..d08bbe59483a 100644 --- a/trunk/arch/arm/configs/lpd270_defconfig +++ b/trunk/arch/arm/configs/lpd270_defconfig @@ -1,19 +1,15 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc1 -# Sun Jul 9 14:15:23 2006 +# Linux kernel version: 2.6.17-git2 +# Wed Jun 21 22:20:18 2006 # CONFIG_ARM=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_MTD_XIP=y CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options @@ -47,12 +43,10 @@ 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 @@ -91,7 +85,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_AT91RM9200 is not set # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set @@ -123,7 +117,6 @@ CONFIG_MACH_LOGICPD_PXA270=y # CONFIG_MACH_MAINSTONE is not set # CONFIG_ARCH_PXA_IDP is not set # CONFIG_PXA_SHARPSL is not set -# CONFIG_MACH_TRIZEPS4 is not set CONFIG_PXA27x=y CONFIG_IWMMXT=y @@ -168,7 +161,6 @@ CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4096 -# CONFIG_RESOURCES_64BIT is not set CONFIG_ALIGNMENT_TRAP=y # @@ -202,6 +194,8 @@ CONFIG_BINFMT_ELF=y # Power management options # # CONFIG_PM is not set +# CONFIG_PM_LEGACY is not set +# CONFIG_PM_DEBUG is not set # CONFIG_APM is not set # @@ -299,7 +293,6 @@ CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set -# CONFIG_SYS_HYPERVISOR is not set # # Connector - unified userspace <-> kernelspace linker @@ -568,7 +561,6 @@ 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 # @@ -596,7 +588,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -626,13 +617,13 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Dallas's 1-wire bus # +# CONFIG_W1 is not set # # Hardware Monitoring support # CONFIG_HWMON=y # CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_ABITUGURU is not set # CONFIG_SENSORS_F71805F is not set # CONFIG_HWMON_DEBUG_CHIP is not set @@ -667,13 +658,12 @@ 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 is not set -# CONFIG_FB_BACKLIGHT is not set +CONFIG_FB_FIRMWARE_EDID=y # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_S1D13XXX is not set @@ -832,7 +822,6 @@ CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y # CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -860,7 +849,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 @@ -926,19 +914,14 @@ CONFIG_NLS_ISO8859_1=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=14 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB 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 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_BUGVERBOSE=y CONFIG_DEBUG_INFO=y @@ -978,4 +961,3 @@ CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y diff --git a/trunk/arch/arm/configs/onearm_defconfig b/trunk/arch/arm/configs/onearm_defconfig index 6a93e3aae106..2b4a63be03f7 100644 --- a/trunk/arch/arm/configs/onearm_defconfig +++ b/trunk/arch/arm/configs/onearm_defconfig @@ -1,18 +1,14 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc1 -# Sun Jul 9 14:16:20 2006 +# Linux kernel version: 2.6.17-git10 +# Mon Jun 26 13:45:44 2006 # CONFIG_ARM=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options @@ -46,12 +42,10 @@ 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 @@ -92,6 +86,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_VERSATILE is not set CONFIG_ARCH_AT91=y +CONFIG_ARCH_AT91RM9200=y # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set @@ -116,15 +111,8 @@ CONFIG_ARCH_AT91=y # CONFIG_ARCH_OMAP is not set # -# Atmel AT91 System-on-Chip -# - +# AT91RM9200 Implementations # -# Atmel AT91 Processors -# -CONFIG_ARCH_AT91RM9200=y -# CONFIG_ARCH_AT91SAM9260 is not set -# CONFIG_ARCH_AT91SAM9261 is not set # # AT91RM9200 Board Type @@ -135,12 +123,12 @@ CONFIG_MACH_ONEARM=y # CONFIG_MACH_CSB337 is not set # CONFIG_MACH_CSB637 is not set # CONFIG_MACH_CARMEVA is not set -# CONFIG_MACH_ATEB9200 is not set # CONFIG_MACH_KB9200 is not set +# CONFIG_MACH_ATEB9200 is not set # CONFIG_MACH_KAFA is not set # -# AT91 Feature Selections +# AT91RM9200 Feature Selections # CONFIG_AT91_PROGRAMMABLE_CLOCKS=y @@ -198,7 +186,6 @@ CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4096 -# CONFIG_RESOURCES_64BIT is not set CONFIG_LEDS=y CONFIG_LEDS_TIMER=y # CONFIG_LEDS_CPU is not set @@ -613,7 +600,6 @@ CONFIG_AT91_WATCHDOG=y # USB-based Watchdog Cards # # CONFIG_USBPCWATCHDOG is not set -# CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -757,7 +743,6 @@ CONFIG_VIDEO_V4L2=y # # Graphics support # -# CONFIG_FIRMWARE_EDID is not set # CONFIG_FB is not set # @@ -995,7 +980,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 @@ -1022,19 +1006,14 @@ CONFIG_MSDOS_PARTITION=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_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 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_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set @@ -1073,4 +1052,3 @@ CONFIG_DEBUG_LL=y CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y -CONFIG_PLIST=y diff --git a/trunk/arch/arm/kernel/bios32.c b/trunk/arch/arm/kernel/bios32.c index 240c448ec31c..964faac104fb 100644 --- a/trunk/arch/arm/kernel/bios32.c +++ b/trunk/arch/arm/kernel/bios32.c @@ -370,6 +370,17 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) features &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY); switch (dev->class >> 8) { +#if defined(CONFIG_ISA) || defined(CONFIG_EISA) + case PCI_CLASS_BRIDGE_ISA: + case PCI_CLASS_BRIDGE_EISA: + /* + * If this device is an ISA bridge, set isa_bridge + * to point at this device. We will then go looking + * for things like keyboard, etc. + */ + isa_bridge = dev; + break; +#endif case PCI_CLASS_BRIDGE_PCI: pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &status); status |= PCI_BRIDGE_CTL_PARITY|PCI_BRIDGE_CTL_MASTER_ABORT; diff --git a/trunk/arch/arm/kernel/irq.c b/trunk/arch/arm/kernel/irq.c index 626feeec0ade..c3d4e94ef5bf 100644 --- a/trunk/arch/arm/kernel/irq.c +++ b/trunk/arch/arm/kernel/irq.c @@ -167,16 +167,6 @@ void __init init_IRQ(void) } #ifdef CONFIG_HOTPLUG_CPU - -static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu) -{ - pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu); - - spin_lock_irq(&desc->lock); - desc->chip->set_affinity(irq, cpumask_of_cpu(cpu)); - spin_unlock_irq(&desc->lock); -} - /* * The CPU has been marked offline. Migrate IRQs off this CPU. If * the affinity settings do not allow other CPUs, force them onto any diff --git a/trunk/arch/arm/kernel/setup.c b/trunk/arch/arm/kernel/setup.c index 0a722e77c143..ed1c4d62d999 100644 --- a/trunk/arch/arm/kernel/setup.c +++ b/trunk/arch/arm/kernel/setup.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/arm/mach-sa1100/collie.c b/trunk/arch/arm/mach-sa1100/collie.c index a0dfa390e34b..a6bab50dab61 100644 --- a/trunk/arch/arm/mach-sa1100/collie.c +++ b/trunk/arch/arm/mach-sa1100/collie.c @@ -83,8 +83,8 @@ static struct scoop_pcmcia_config collie_pcmcia_config = { static struct mcp_plat_data collie_mcp_data = { - .mccr0 = MCCR0_ADM | MCCR0_ExtClk, - .sclk_rate = 9216000, + .mccr0 = MCCR0_ADM, + .sclk_rate = 11981000, }; #ifdef CONFIG_SHARP_LOCOMO diff --git a/trunk/arch/arm/mach-sa1100/collie_pm.c b/trunk/arch/arm/mach-sa1100/collie_pm.c index 1e25b1d19fce..45b1e71f111d 100644 --- a/trunk/arch/arm/mach-sa1100/collie_pm.c +++ b/trunk/arch/arm/mach-sa1100/collie_pm.c @@ -9,9 +9,6 @@ * Li-ion batteries are angry beasts, and they like to explode. This driver is not finished, * and sometimes charges them when it should not. If it makes angry lithium to come your way... * ...well, you have been warned. - * - * Actually, this should be quite safe, it seems sharp leaves charger enabled by default, - * and my collie did not explode (yet). */ #include @@ -43,8 +40,9 @@ static void collie_charger_init(void) { int err; - if (sharpsl_param.adadj != -1) + if (sharpsl_param.adadj != -1) { ad_revise = sharpsl_param.adadj; + } /* Register interrupt handler. */ if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, IRQF_DISABLED, @@ -74,17 +72,27 @@ static void collie_measure_temp(int on) static void collie_charge(int on) { - extern struct platform_device colliescoop_device; + if (on) { + printk("Should start charger\n"); + } else { + printk("Should stop charger\n"); + } +#ifdef I_AM_SURE - /* Zaurus seems to contain LTC1731; it should know when to + /* Zaurus seems to contain LTC1731 ; it should know when to * stop charging itself, so setting charge on should be * relatively harmless (as long as it is not done too often). */ +#define CF_BUF_CTRL_BASE 0xF0800000 +#define SCOOP_REG(adr) (*(volatile unsigned short*)(CF_BUF_CTRL_BASE+(adr))) +#define SCOOP_REG_GPWR SCOOP_REG(SCOOP_GPWR) + if (on) { set_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON); } else { reset_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON); } +#endif } static void collie_discharge(int on) @@ -119,6 +127,7 @@ int collie_read_backup_battery(void) ucb1x00_adc_enable(ucb); + /* Gives 75..130 */ ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_BBAT_ON, 0); voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC); @@ -137,8 +146,9 @@ int collie_read_main_battery(void) ucb1x00_adc_enable(ucb); ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_BBAT_ON); ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_MBAT_ON, 0); - - mdelay(1); + /* gives values 160..255 with battery removed... and + 145..255 with battery inserted. (on AC), goes as low as + 80 on DC. */ voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC); ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON); @@ -182,7 +192,7 @@ static unsigned long read_devdata(int which) case SHARPSL_BATT_TEMP: return collie_read_temp(); case SHARPSL_ACIN_VOLT: - return 500; + return 0x1; case SHARPSL_STATUS_ACIN: { int ret = GPLR & COLLIE_GPIO_AC_IN; printk("AC status = %d\n", ret); @@ -198,33 +208,10 @@ static unsigned long read_devdata(int which) } } -struct battery_thresh collie_battery_levels_acin[] = { - { 420, 100}, - { 417, 95}, - { 415, 90}, - { 413, 80}, - { 411, 75}, - { 408, 70}, - { 406, 60}, - { 403, 50}, - { 398, 40}, - { 391, 25}, - { 10, 5}, - { 0, 0}, -}; - struct battery_thresh collie_battery_levels[] = { - { 394, 100}, - { 390, 95}, - { 380, 90}, - { 370, 80}, - { 368, 75}, /* From sharp code: battery high with frontlight */ - { 366, 70}, /* 60..90 -- fake values invented by me for testing */ - { 364, 60}, - { 362, 50}, - { 360, 40}, - { 358, 25}, /* From sharp code: battery low with frontlight */ - { 356, 5}, /* From sharp code: battery verylow with frontlight */ + { 368, 100}, + { 358, 25}, + { 356, 5}, { 0, 0}, }; @@ -239,21 +226,13 @@ struct sharpsl_charger_machinfo collie_pm_machinfo = { .postsuspend = collie_postsuspend, .charger_wakeup = collie_charger_wakeup, .should_wakeup = collie_should_wakeup, - .bat_levels = 12, + .bat_levels = 3, .bat_levels_noac = collie_battery_levels, - .bat_levels_acin = collie_battery_levels_acin, + .bat_levels_acin = collie_battery_levels, .status_high_acin = 368, .status_low_acin = 358, .status_high_noac = 368, .status_low_noac = 358, - .charge_on_volt = 350, /* spitz uses 2.90V, but lets play it safe. */ - .charge_on_temp = 550, - .charge_acin_high = 550, /* collie does not seem to have sensor for this, anyway */ - .charge_acin_low = 450, /* ignored, too */ - .fatal_acin_volt = 356, - .fatal_noacin_volt = 356, - - .batfull_irq = 1, /* We do not want periodical charge restarts */ }; static int __init collie_pm_ucb_add(struct ucb1x00_dev *pdev) diff --git a/trunk/arch/arm/mach-versatile/core.c b/trunk/arch/arm/mach-versatile/core.c index 864377176015..a432539cc1bd 100644 --- a/trunk/arch/arm/mach-versatile/core.c +++ b/trunk/arch/arm/mach-versatile/core.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -353,7 +352,11 @@ static const struct icst307_params versatile_oscvco_params = { static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) { void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; - void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET; +#if defined(CONFIG_ARCH_VERSATILE_PB) + void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET; +#elif defined(CONFIG_MACH_VERSATILE_AB) + void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET; +#endif u32 val; val = readl(sys_osc) & ~0x7ffff; @@ -526,7 +529,7 @@ static void versatile_clcd_disable(struct clcd_fb *fb) /* * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off */ - if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) { + if (fb->panel == &sanyo_2_5_in) { void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); unsigned long ctrl; @@ -575,7 +578,7 @@ static void versatile_clcd_enable(struct clcd_fb *fb) /* * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on */ - if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) { + if (fb->panel == &sanyo_2_5_in) { void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); unsigned long ctrl; diff --git a/trunk/arch/arm/nwfpe/softfloat.h b/trunk/arch/arm/nwfpe/softfloat.h index 0a3067452cd2..e1125bc39ee4 100644 --- a/trunk/arch/arm/nwfpe/softfloat.h +++ b/trunk/arch/arm/nwfpe/softfloat.h @@ -61,7 +61,7 @@ typedef struct { u16 __padding; #endif u64 low; -} __attribute__ ((packed,aligned(4))) floatx80; +} floatx80; /* ------------------------------------------------------------------------------- diff --git a/trunk/arch/arm26/kernel/setup.c b/trunk/arch/arm26/kernel/setup.c index e7eb070f794f..843c29fe9af5 100644 --- a/trunk/arch/arm26/kernel/setup.c +++ b/trunk/arch/arm26/kernel/setup.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/arch/cris/arch-v10/drivers/eeprom.c b/trunk/arch/cris/arch-v10/drivers/eeprom.c index 6e1f191a71e3..037582028560 100644 --- a/trunk/arch/cris/arch-v10/drivers/eeprom.c +++ b/trunk/arch/cris/arch-v10/drivers/eeprom.c @@ -450,9 +450,9 @@ int __init eeprom_init(void) static int eeprom_open(struct inode * inode, struct file * file) { - if(iminor(inode) != EEPROM_MINOR_NR) + if(MINOR(inode->i_rdev) != EEPROM_MINOR_NR) return -ENXIO; - if(imajor(inode) != EEPROM_MAJOR_NR) + if(MAJOR(inode->i_rdev) != EEPROM_MAJOR_NR) return -ENXIO; if( eeprom.size > 0 ) diff --git a/trunk/arch/cris/arch-v10/drivers/gpio.c b/trunk/arch/cris/arch-v10/drivers/gpio.c index fcba6632ed7b..48fd801792d1 100644 --- a/trunk/arch/cris/arch-v10/drivers/gpio.c +++ b/trunk/arch/cris/arch-v10/drivers/gpio.c @@ -435,7 +435,7 @@ static int gpio_open(struct inode *inode, struct file *filp) { struct gpio_private *priv; - int p = iminor(inode); + int p = MINOR(inode->i_rdev); if (p > GPIO_MINOR_LAST) return -EINVAL; diff --git a/trunk/arch/cris/arch-v32/drivers/cryptocop.c b/trunk/arch/cris/arch-v32/drivers/cryptocop.c index ba096ebb0b15..c59ee28a35f4 100644 --- a/trunk/arch/cris/arch-v32/drivers/cryptocop.c +++ b/trunk/arch/cris/arch-v32/drivers/cryptocop.c @@ -2302,7 +2302,7 @@ static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_ static int cryptocop_open(struct inode *inode, struct file *filp) { - int p = iminor(inode); + int p = MINOR(inode->i_rdev); if (p != CRYPTOCOP_MINOR) return -EINVAL; diff --git a/trunk/arch/cris/arch-v32/drivers/gpio.c b/trunk/arch/cris/arch-v32/drivers/gpio.c index c3f876b4da6b..00e9167de530 100644 --- a/trunk/arch/cris/arch-v32/drivers/gpio.c +++ b/trunk/arch/cris/arch-v32/drivers/gpio.c @@ -418,7 +418,7 @@ static int gpio_open(struct inode *inode, struct file *filp) { struct gpio_private *priv; - int p = iminor(inode); + int p = MINOR(inode->i_rdev); if (p > GPIO_MINOR_LAST) return -EINVAL; diff --git a/trunk/arch/cris/arch-v32/drivers/pcf8563.c b/trunk/arch/cris/arch-v32/drivers/pcf8563.c index 2fc7d75a35de..ffc6d2572f2b 100644 --- a/trunk/arch/cris/arch-v32/drivers/pcf8563.c +++ b/trunk/arch/cris/arch-v32/drivers/pcf8563.c @@ -324,12 +324,14 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned int pcf8563_open(struct inode *inode, struct file *filp) { + MOD_INC_USE_COUNT; return 0; } int pcf8563_release(struct inode *inode, struct file *filp) { + MOD_DEC_USE_COUNT; return 0; } diff --git a/trunk/arch/cris/arch-v32/drivers/sync_serial.c b/trunk/arch/cris/arch-v32/drivers/sync_serial.c index e067806b2208..7c29957f5f02 100644 --- a/trunk/arch/cris/arch-v32/drivers/sync_serial.c +++ b/trunk/arch/cris/arch-v32/drivers/sync_serial.c @@ -340,7 +340,7 @@ static inline int sync_data_avail_to_end(struct sync_port *port) static int sync_serial_open(struct inode *inode, struct file *file) { - int dev = iminor(inode); + int dev = MINOR(inode->i_rdev); sync_port* port; reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; @@ -486,7 +486,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) static int sync_serial_release(struct inode *inode, struct file *file) { - int dev = iminor(inode); + int dev = MINOR(inode->i_rdev); sync_port* port; if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) @@ -504,7 +504,7 @@ static int sync_serial_release(struct inode *inode, struct file *file) static unsigned int sync_serial_poll(struct file *file, poll_table *wait) { - int dev = iminor(file->f_dentry->d_inode); + int dev = MINOR(file->f_dentry->d_inode->i_rdev); unsigned int mask = 0; sync_port* port; DEBUGPOLL( static unsigned int prev_mask = 0; ); @@ -531,7 +531,7 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { int return_val = 0; - int dev = iminor(file->f_dentry->d_inode); + int dev = MINOR(file->f_dentry->d_inode->i_rdev); sync_port* port; reg_sser_rw_tr_cfg tr_cfg; reg_sser_rw_rec_cfg rec_cfg; @@ -789,7 +789,7 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file, static ssize_t sync_serial_write(struct file * file, const char * buf, size_t count, loff_t *ppos) { - int dev = iminor(file->f_dentry->d_inode); + int dev = MINOR(file->f_dentry->d_inode->i_rdev); DECLARE_WAITQUEUE(wait, current); sync_port *port; unsigned long c, c1; @@ -919,7 +919,7 @@ static ssize_t sync_serial_write(struct file * file, const char * buf, static ssize_t sync_serial_read(struct file * file, char * buf, size_t count, loff_t *ppos) { - int dev = iminor(file->f_dentry->d_inode); + int dev = MINOR(file->f_dentry->d_inode->i_rdev); int avail; sync_port *port; unsigned char* start; diff --git a/trunk/arch/cris/kernel/setup.c b/trunk/arch/cris/kernel/setup.c index 7af3d5d43e43..6d941fb9f379 100644 --- a/trunk/arch/cris/kernel/setup.c +++ b/trunk/arch/cris/kernel/setup.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/arch/frv/kernel/asm-offsets.c b/trunk/arch/frv/kernel/asm-offsets.c index fbb19fc1af40..9e263112a6e2 100644 --- a/trunk/arch/frv/kernel/asm-offsets.c +++ b/trunk/arch/frv/kernel/asm-offsets.c @@ -1,115 +1 @@ -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed - * to extract and format the required data. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define DEF_PTREG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct pt_regs, " #reg ")" \ - : : "i" (offsetof(struct pt_regs, reg))) - -#define DEF_IREG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \ - : : "i" (offsetof(struct user_context, reg))) - -#define DEF_FREG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \ - : : "i" (offsetof(struct user_context, reg))) - -#define DEF_0REG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct frv_frame0, " #reg ")" \ - : : "i" (offsetof(struct frv_frame0, reg))) - -#define BLANK() asm volatile("\n->" : : ) - -#define OFFSET(sym, str, mem) \ - DEFINE(sym, offsetof(struct str, mem)); - -void foo(void) -{ - /* offsets into the thread_info structure */ - OFFSET(TI_TASK, thread_info, task); - OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain); - OFFSET(TI_FLAGS, thread_info, flags); - OFFSET(TI_STATUS, thread_info, status); - OFFSET(TI_CPU, thread_info, cpu); - OFFSET(TI_PREEMPT_COUNT, thread_info, preempt_count); - OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); - OFFSET(TI_RESTART_BLOCK, thread_info, restart_block); - BLANK(); - - /* offsets into register file storage */ - DEF_PTREG(REG_PSR, psr); - DEF_PTREG(REG_ISR, isr); - DEF_PTREG(REG_CCR, ccr); - DEF_PTREG(REG_CCCR, cccr); - DEF_PTREG(REG_LR, lr); - DEF_PTREG(REG_LCR, lcr); - DEF_PTREG(REG_PC, pc); - DEF_PTREG(REG__STATUS, __status); - DEF_PTREG(REG_SYSCALLNO, syscallno); - DEF_PTREG(REG_ORIG_GR8, orig_gr8); - DEF_PTREG(REG_GNER0, gner0); - DEF_PTREG(REG_GNER1, gner1); - DEF_PTREG(REG_IACC0, iacc0); - DEF_PTREG(REG_TBR, tbr); - DEF_PTREG(REG_GR0, tbr); - DEFINE(REG__END, sizeof(struct pt_regs)); - BLANK(); - - DEF_0REG(REG_DCR, debug.dcr); - DEF_0REG(REG_IBAR0, debug.ibar[0]); - DEF_0REG(REG_DBAR0, debug.dbar[0]); - DEF_0REG(REG_DBDR00, debug.dbdr[0][0]); - DEF_0REG(REG_DBMR00, debug.dbmr[0][0]); - BLANK(); - - DEF_IREG(__INT_GR0, i.gr[0]); - DEF_FREG(__USER_FPMEDIA, f); - DEF_FREG(__FPMEDIA_FR0, f.fr[0]); - DEF_FREG(__FPMEDIA_FNER0, f.fner[0]); - DEF_FREG(__FPMEDIA_MSR0, f.msr[0]); - DEF_FREG(__FPMEDIA_ACC0, f.acc[0]); - DEF_FREG(__FPMEDIA_ACCG0, f.accg[0]); - DEF_FREG(__FPMEDIA_FSR0, f.fsr[0]); - BLANK(); - - DEFINE(NR_PT_REGS, sizeof(struct pt_regs) / 4); - DEFINE(NR_USER_INT_REGS, sizeof(struct user_int_regs) / 4); - DEFINE(NR_USER_FPMEDIA_REGS, sizeof(struct user_fpmedia_regs) / 4); - DEFINE(NR_USER_CONTEXT, sizeof(struct user_context) / 4); - DEFINE(FRV_FRAME0_SIZE, sizeof(struct frv_frame0)); - BLANK(); - - /* offsets into thread_struct */ - OFFSET(__THREAD_FRAME, thread_struct, frame); - OFFSET(__THREAD_CURR, thread_struct, curr); - OFFSET(__THREAD_SP, thread_struct, sp); - OFFSET(__THREAD_FP, thread_struct, fp); - OFFSET(__THREAD_LR, thread_struct, lr); - OFFSET(__THREAD_PC, thread_struct, pc); - OFFSET(__THREAD_GR16, thread_struct, gr[0]); - OFFSET(__THREAD_SCHED_LR, thread_struct, sched_lr); - OFFSET(__THREAD_FRAME0, thread_struct, frame0); - OFFSET(__THREAD_USER, thread_struct, user); - BLANK(); - - /* offsets into frv_debug_status */ - OFFSET(DEBUG_BPSR, frv_debug_status, bpsr); - OFFSET(DEBUG_DCR, frv_debug_status, dcr); - OFFSET(DEBUG_BRR, frv_debug_status, brr); - OFFSET(DEBUG_NMAR, frv_debug_status, nmar); - BLANK(); -} +/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */ diff --git a/trunk/arch/frv/kernel/break.S b/trunk/arch/frv/kernel/break.S index dac4a5f68c2e..ea161f0ca427 100644 --- a/trunk/arch/frv/kernel/break.S +++ b/trunk/arch/frv/kernel/break.S @@ -9,11 +9,11 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include #include -#include #include #include @@ -23,11 +23,13 @@ # .section .bss.stack .globl __break_user_context - .balign THREAD_SIZE + .balign 8192 __break_stack: - .space THREAD_SIZE - FRV_FRAME0_SIZE -__break_frame_0: - .space FRV_FRAME0_SIZE + .space (8192 - (USER_CONTEXT_SIZE + REG__DEBUG_XTRA)) & ~7 +__break_stack_tos: + .space REG__DEBUG_XTRA +__break_user_context: + .space USER_CONTEXT_SIZE # # miscellaneous variables @@ -72,8 +74,8 @@ __entry_break: #endif LEDS 0x1001,gr31 - sethi.p %hi(__break_frame_0),gr31 - setlo %lo(__break_frame_0),gr31 + sethi.p %hi(__break_user_context),gr31 + setlo %lo(__break_user_context),gr31 stdi gr2,@(gr31,#REG_GR(2)) movsg ccr,gr3 @@ -583,8 +585,8 @@ __break_continue: # set up the kernel stack pointer sti sp,@(gr31,#REG_SP) - sethi.p %hi(__break_frame_0),sp - setlo %lo(__break_frame_0),sp + sethi.p %hi(__break_stack_tos),sp + setlo %lo(__break_stack_tos),sp # finish building the exception frame stdi gr4 ,@(gr31,#REG_GR(4)) @@ -649,12 +651,9 @@ __break_continue: movsg nmar,gr5 movsg dcr,gr6 - sethi.p %hi(__debug_status),gr7 - setlo %lo(__debug_status),gr7 - - stdi gr4 ,@(gr7,#DEBUG_BRR) - sti gr19,@(gr7,#DEBUG_BPSR) - sti.p gr6 ,@(gr7,#DEBUG_DCR) + stdi gr4 ,@(gr31,#REG_BRR) + sti gr19,@(gr31,#REG_BPSR) + sti.p gr6 ,@(gr31,#REG_DCR) # trap exceptions during break handling and disable h/w breakpoints/watchpoints sethi %hi(DCR_EBE),gr5 @@ -699,10 +698,7 @@ __break_continue: lddi @(gr31,#REG_PSR) ,gr22 ldi @(gr31,#REG_PC) ,gr21 ldi @(gr31,#REG_TBR) ,gr20 - - sethi.p %hi(__debug_status),gr6 - setlo %lo(__debug_status),gr6 - ldi.p @(gr6,#DEBUG_DCR) ,gr6 + ldi.p @(gr31,#REG_DCR) ,gr6 andi gr22,#PSR_S,gr19 /* rebuild BPSR */ andi.p gr22,#PSR_ET,gr5 diff --git a/trunk/arch/frv/kernel/debug-stub.c b/trunk/arch/frv/kernel/debug-stub.c index 2f6c60c921e0..4761cc4b4a90 100644 --- a/trunk/arch/frv/kernel/debug-stub.c +++ b/trunk/arch/frv/kernel/debug-stub.c @@ -39,10 +39,11 @@ do { \ gdbstub_do_rx(); \ } while(!FLOWCTL_QUERY(LINE)) -struct frv_debug_status __debug_status; - static void __init debug_stub_init(void); +extern asmlinkage void __break_hijack_kernel_event(void); +extern asmlinkage void __break_hijack_kernel_event_breaks_here(void); + /*****************************************************************************/ /* * debug mode handler stub @@ -66,7 +67,7 @@ asmlinkage void debug_stub(void) __set_HSR(0, hsr0 & ~HSR0_ETMD); /* disable single stepping */ - __debug_status.dcr &= ~DCR_SE; + __debug_regs->dcr &= ~DCR_SE; /* kernel mode can propose an exception be handled in debug mode by jumping to a special * location */ @@ -75,8 +76,8 @@ asmlinkage void debug_stub(void) * the top kernel context */ *__debug_frame = *__frame; __frame = __debug_frame->next_frame; - __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12; - __debug_status.brr |= BRR_EB; + __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12; + __debug_regs->brr |= BRR_EB; } if (__debug_frame->pc == (unsigned long) __debug_bug_trap + 4) { @@ -123,7 +124,7 @@ static void __init debug_stub_init(void) __debug_frame->pc = (unsigned long) start_kernel; /* enable the debug events we want to trap */ - __debug_status.dcr = DCR_EBE; + __debug_regs->dcr = DCR_EBE; #ifdef CONFIG_GDBSTUB gdbstub_init(); diff --git a/trunk/arch/frv/kernel/entry.S b/trunk/arch/frv/kernel/entry.S index 940ac306e9a0..2a1ff1ff8692 100644 --- a/trunk/arch/frv/kernel/entry.S +++ b/trunk/arch/frv/kernel/entry.S @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/gdb-stub.c b/trunk/arch/frv/kernel/gdb-stub.c index 9550f37fb62c..508601fad079 100644 --- a/trunk/arch/frv/kernel/gdb-stub.c +++ b/trunk/arch/frv/kernel/gdb-stub.c @@ -124,7 +124,6 @@ #include #include -#include #include #include #include @@ -137,6 +136,7 @@ extern void debug_to_serial(const char *p, int n); extern void gdbstub_console_write(struct console *co, const char *p, unsigned n); extern volatile uint32_t __break_error_detect[3]; /* ESFR1, ESR15, EAR15 */ +extern struct user_context __break_user_context; struct __debug_amr { unsigned long L, P; @@ -926,7 +926,6 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign if (!(__debug_regs->dcr & DCR_IBE0)) { //gdbstub_printk("set h/w break 0: %08lx\n", addr); __debug_regs->dcr |= DCR_IBE0; - __debug_regs->ibar[0] = addr; asm volatile("movgs %0,ibar0" : : "r"(addr)); return 0; } @@ -934,7 +933,6 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign if (!(__debug_regs->dcr & DCR_IBE1)) { //gdbstub_printk("set h/w break 1: %08lx\n", addr); __debug_regs->dcr |= DCR_IBE1; - __debug_regs->ibar[1] = addr; asm volatile("movgs %0,ibar1" : : "r"(addr)); return 0; } @@ -942,7 +940,6 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign if (!(__debug_regs->dcr & DCR_IBE2)) { //gdbstub_printk("set h/w break 2: %08lx\n", addr); __debug_regs->dcr |= DCR_IBE2; - __debug_regs->ibar[2] = addr; asm volatile("movgs %0,ibar2" : : "r"(addr)); return 0; } @@ -950,7 +947,6 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign if (!(__debug_regs->dcr & DCR_IBE3)) { //gdbstub_printk("set h/w break 3: %08lx\n", addr); __debug_regs->dcr |= DCR_IBE3; - __debug_regs->ibar[3] = addr; asm volatile("movgs %0,ibar3" : : "r"(addr)); return 0; } @@ -975,14 +971,7 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign if (!(__debug_regs->dcr & (DCR_DRBE0|DCR_DWBE0))) { //gdbstub_printk("set h/w watchpoint 0 type %ld: %08lx\n", type, addr); tmp = type==2 ? DCR_DWBE0 : type==3 ? DCR_DRBE0 : DCR_DRBE0|DCR_DWBE0; - __debug_regs->dcr |= tmp; - __debug_regs->dbar[0] = addr; - __debug_regs->dbmr[0][0] = dbmr.mask0; - __debug_regs->dbmr[0][1] = dbmr.mask1; - __debug_regs->dbdr[0][0] = 0; - __debug_regs->dbdr[0][1] = 0; - asm volatile(" movgs %0,dbar0 \n" " movgs %1,dbmr00 \n" " movgs %2,dbmr01 \n" @@ -995,14 +984,7 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign if (!(__debug_regs->dcr & (DCR_DRBE1|DCR_DWBE1))) { //gdbstub_printk("set h/w watchpoint 1 type %ld: %08lx\n", type, addr); tmp = type==2 ? DCR_DWBE1 : type==3 ? DCR_DRBE1 : DCR_DRBE1|DCR_DWBE1; - __debug_regs->dcr |= tmp; - __debug_regs->dbar[1] = addr; - __debug_regs->dbmr[1][0] = dbmr.mask0; - __debug_regs->dbmr[1][1] = dbmr.mask1; - __debug_regs->dbdr[1][0] = 0; - __debug_regs->dbdr[1][1] = 0; - asm volatile(" movgs %0,dbar1 \n" " movgs %1,dbmr10 \n" " movgs %2,dbmr11 \n" @@ -1065,7 +1047,6 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo if (__debug_regs->dcr & DCR_IBE0 && __get_ibar(0) == addr) { //gdbstub_printk("clear h/w break 0: %08lx\n", addr); __debug_regs->dcr &= ~DCR_IBE0; - __debug_regs->ibar[0] = 0; asm volatile("movgs gr0,ibar0"); return 0; } @@ -1073,7 +1054,6 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo if (__debug_regs->dcr & DCR_IBE1 && __get_ibar(1) == addr) { //gdbstub_printk("clear h/w break 1: %08lx\n", addr); __debug_regs->dcr &= ~DCR_IBE1; - __debug_regs->ibar[1] = 0; asm volatile("movgs gr0,ibar1"); return 0; } @@ -1081,7 +1061,6 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo if (__debug_regs->dcr & DCR_IBE2 && __get_ibar(2) == addr) { //gdbstub_printk("clear h/w break 2: %08lx\n", addr); __debug_regs->dcr &= ~DCR_IBE2; - __debug_regs->ibar[2] = 0; asm volatile("movgs gr0,ibar2"); return 0; } @@ -1089,7 +1068,6 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo if (__debug_regs->dcr & DCR_IBE3 && __get_ibar(3) == addr) { //gdbstub_printk("clear h/w break 3: %08lx\n", addr); __debug_regs->dcr &= ~DCR_IBE3; - __debug_regs->ibar[3] = 0; asm volatile("movgs gr0,ibar3"); return 0; } @@ -1126,12 +1104,6 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo //gdbstub_printk("clear h/w watchpoint 0 type %ld: %08lx\n", type, addr); __debug_regs->dcr &= ~(DCR_DRBE0|DCR_DWBE0); - __debug_regs->dbar[0] = 0; - __debug_regs->dbmr[0][0] = 0; - __debug_regs->dbmr[0][1] = 0; - __debug_regs->dbdr[0][0] = 0; - __debug_regs->dbdr[0][1] = 0; - asm volatile(" movgs gr0,dbar0 \n" " movgs gr0,dbmr00 \n" " movgs gr0,dbmr01 \n" @@ -1151,12 +1123,6 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo //gdbstub_printk("clear h/w watchpoint 1 type %ld: %08lx\n", type, addr); __debug_regs->dcr &= ~(DCR_DRBE1|DCR_DWBE1); - __debug_regs->dbar[1] = 0; - __debug_regs->dbmr[1][0] = 0; - __debug_regs->dbmr[1][1] = 0; - __debug_regs->dbdr[1][0] = 0; - __debug_regs->dbdr[1][1] = 0; - asm volatile(" movgs gr0,dbar1 \n" " movgs gr0,dbmr10 \n" " movgs gr0,dbmr11 \n" @@ -1197,7 +1163,7 @@ static void gdbstub_check_breakpoint(void) */ static void __attribute__((unused)) gdbstub_show_regs(void) { - unsigned long *reg; + uint32_t *reg; int loop; gdbstub_printk("\n"); @@ -1206,11 +1172,11 @@ static void __attribute__((unused)) gdbstub_show_regs(void) __debug_frame, __debug_frame->psr & PSR_S ? "kernel" : "user"); - reg = (unsigned long *) __debug_frame; - for (loop = 0; loop < NR_PT_REGS; loop++) { - printk("%s %08lx", regnames[loop + 0], reg[loop + 0]); + reg = (uint32_t *) __debug_frame; + for (loop = 0; loop < REG__END; loop++) { + printk("%s %08x", regnames[loop + 0], reg[loop + 0]); - if (loop == NR_PT_REGS - 1 || loop % 5 == 4) + if (loop == REG__END - 1 || loop % 5 == 4) printk("\n"); else printk(" | "); @@ -1225,8 +1191,13 @@ static void __attribute__((unused)) gdbstub_show_regs(void) */ static void __attribute__((unused)) gdbstub_dump_debugregs(void) { - gdbstub_printk("DCR %08lx ", __debug_status.dcr); - gdbstub_printk("BRR %08lx\n", __debug_status.brr); + unsigned long x; + + x = __debug_regs->dcr; + gdbstub_printk("DCR %08lx ", x); + + x = __debug_regs->brr; + gdbstub_printk("BRR %08lx\n", x); gdbstub_printk("IBAR0 %08lx ", __get_ibar(0)); gdbstub_printk("IBAR1 %08lx ", __get_ibar(1)); @@ -1389,7 +1360,7 @@ void gdbstub(int sigval) #endif } - save_user_regs(&__debug_frame0->uc); + save_user_regs(&__break_user_context); #if 0 gdbstub_printk("--> gdbstub() %08x %p %08x %08x\n", @@ -1418,8 +1389,8 @@ void gdbstub(int sigval) __debug_frame->psr &= ~PSR_S; if (__debug_frame->psr & PSR_PS) __debug_frame->psr |= PSR_S; - __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12; - __debug_status.brr |= BRR_EB; + __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12; + __debug_regs->brr |= BRR_EB; sigval = SIGINT; } @@ -1433,15 +1404,15 @@ void gdbstub(int sigval) __debug_frame->psr &= ~PSR_S; if (__debug_frame->psr & PSR_PS) __debug_frame->psr |= PSR_S; - __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12; - __debug_status.brr |= BRR_EB; + __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12; + __debug_regs->brr |= BRR_EB; sigval = SIGXCPU; } LEDS(0x5002); /* after a BREAK insn, the PC lands on the far side of it */ - if (__debug_status.brr & BRR_SB) + if (__debug_regs->brr & BRR_SB) gdbstub_check_breakpoint(); LEDS(0x5003); @@ -1460,7 +1431,7 @@ void gdbstub(int sigval) } if (!sigval) - sigval = gdbstub_compute_signal(__debug_status.brr); + sigval = gdbstub_compute_signal(__debug_regs->brr); LEDS(0x5004); @@ -1470,7 +1441,7 @@ void gdbstub(int sigval) if (sigval != SIGINT && sigval != SIGTRAP && sigval != SIGILL) { static const char title[] = "Break "; static const char crlf[] = "\r\n"; - unsigned long brr = __debug_status.brr; + unsigned long brr = __debug_regs->brr; char hx; ptr = output_buffer; @@ -1594,24 +1565,28 @@ void gdbstub(int sigval) ptr = mem2hex(&zero, ptr, 4, 0); for (loop = 1; loop <= 27; loop++) - ptr = mem2hex(&__debug_user_context->i.gr[loop], ptr, 4, 0); + ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(loop), + ptr, 4, 0); temp = (unsigned long) __frame; ptr = mem2hex(&temp, ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->i.gr[29], ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->i.gr[30], ptr, 4, 0); + ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(29), ptr, 4, 0); + ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(30), ptr, 4, 0); #ifdef CONFIG_MMU - ptr = mem2hex(&__debug_user_context->i.gr[31], ptr, 4, 0); + ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(31), ptr, 4, 0); #else temp = (unsigned long) __debug_frame; ptr = mem2hex(&temp, ptr, 4, 0); #endif for (loop = 32; loop <= 63; loop++) - ptr = mem2hex(&__debug_user_context->i.gr[loop], ptr, 4, 0); + ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(loop), + ptr, 4, 0); /* deal with FR0-FR63 */ for (loop = 0; loop <= 63; loop++) - ptr = mem2hex(&__debug_user_context->f.fr[loop], ptr, 4, 0); + ptr = mem2hex((unsigned long *)&__break_user_context + + __FPMEDIA_FR(loop), + ptr, 4, 0); /* deal with special registers */ ptr = mem2hex(&__debug_frame->pc, ptr, 4, 0); @@ -1622,7 +1597,7 @@ void gdbstub(int sigval) ptr = mem2hex(&zero, ptr, 4, 0); ptr = mem2hex(&zero, ptr, 4, 0); ptr = mem2hex(&__debug_frame->tbr, ptr, 4, 0); - ptr = mem2hex(&__debug_status.brr , ptr, 4, 0); + ptr = mem2hex(&__debug_regs->brr , ptr, 4, 0); asm volatile("movsg dbar0,%0" : "=r"(dbar)); ptr = mem2hex(&dbar, ptr, 4, 0); @@ -1647,21 +1622,21 @@ void gdbstub(int sigval) ptr = mem2hex(&__debug_frame->iacc0, ptr, 8, 0); - ptr = mem2hex(&__debug_user_context->f.fsr[0], ptr, 4, 0); + ptr = mem2hex(&__break_user_context.f.fsr[0], ptr, 4, 0); for (loop = 0; loop <= 7; loop++) - ptr = mem2hex(&__debug_user_context->f.acc[loop], ptr, 4, 0); + ptr = mem2hex(&__break_user_context.f.acc[loop], ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->f.accg, ptr, 8, 0); + ptr = mem2hex(&__break_user_context.f.accg, ptr, 8, 0); for (loop = 0; loop <= 1; loop++) - ptr = mem2hex(&__debug_user_context->f.msr[loop], ptr, 4, 0); + ptr = mem2hex(&__break_user_context.f.msr[loop], ptr, 4, 0); ptr = mem2hex(&__debug_frame->gner0, ptr, 4, 0); ptr = mem2hex(&__debug_frame->gner1, ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->f.fner[0], ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->f.fner[1], ptr, 4, 0); + ptr = mem2hex(&__break_user_context.f.fner[0], ptr, 4, 0); + ptr = mem2hex(&__break_user_context.f.fner[1], ptr, 4, 0); break; @@ -1673,7 +1648,8 @@ void gdbstub(int sigval) ptr = hex2mem(ptr, &temp, 4); for (loop = 1; loop <= 27; loop++) - ptr = hex2mem(ptr, &__debug_user_context->i.gr[loop], 4); + ptr = hex2mem(ptr, (unsigned long *)__debug_frame + REG_GR(loop), + 4); ptr = hex2mem(ptr, &temp, 4); __frame = (struct pt_regs *) temp; @@ -1686,11 +1662,14 @@ void gdbstub(int sigval) #endif for (loop = 32; loop <= 63; loop++) - ptr = hex2mem(ptr, &__debug_user_context->i.gr[loop], 4); + ptr = hex2mem(ptr, (unsigned long *)__debug_frame + REG_GR(loop), + 4); /* deal with FR0-FR63 */ for (loop = 0; loop <= 63; loop++) - ptr = mem2hex(&__debug_user_context->f.fr[loop], ptr, 4, 0); + ptr = mem2hex((unsigned long *)&__break_user_context + + __FPMEDIA_FR(loop), + ptr, 4, 0); /* deal with special registers */ ptr = hex2mem(ptr, &__debug_frame->pc, 4); @@ -1715,21 +1694,21 @@ void gdbstub(int sigval) ptr = hex2mem(ptr, &__debug_frame->iacc0, 8); - ptr = hex2mem(ptr, &__debug_user_context->f.fsr[0], 4); + ptr = hex2mem(ptr, &__break_user_context.f.fsr[0], 4); for (loop = 0; loop <= 7; loop++) - ptr = hex2mem(ptr, &__debug_user_context->f.acc[loop], 4); + ptr = hex2mem(ptr, &__break_user_context.f.acc[loop], 4); - ptr = hex2mem(ptr, &__debug_user_context->f.accg, 8); + ptr = hex2mem(ptr, &__break_user_context.f.accg, 8); for (loop = 0; loop <= 1; loop++) - ptr = hex2mem(ptr, &__debug_user_context->f.msr[loop], 4); + ptr = hex2mem(ptr, &__break_user_context.f.msr[loop], 4); ptr = hex2mem(ptr, &__debug_frame->gner0, 4); ptr = hex2mem(ptr, &__debug_frame->gner1, 4); - ptr = hex2mem(ptr, &__debug_user_context->f.fner[0], 4); - ptr = hex2mem(ptr, &__debug_user_context->f.fner[1], 4); + ptr = hex2mem(ptr, &__break_user_context.f.fner[0], 4); + ptr = hex2mem(ptr, &__break_user_context.f.fner[1], 4); gdbstub_strcpy(output_buffer,"OK"); break; @@ -1790,52 +1769,52 @@ void gdbstub(int sigval) case GDB_REG_GR(0): break; case GDB_REG_GR(1) ... GDB_REG_GR(63): - __debug_user_context->i.gr[addr - GDB_REG_GR(0)] = temp; + __break_user_context.i.gr[addr - GDB_REG_GR(0)] = temp; break; case GDB_REG_FR(0) ... GDB_REG_FR(63): - __debug_user_context->f.fr[addr - GDB_REG_FR(0)] = temp; + __break_user_context.f.fr[addr - GDB_REG_FR(0)] = temp; break; case GDB_REG_PC: - __debug_user_context->i.pc = temp; + __break_user_context.i.pc = temp; break; case GDB_REG_PSR: - __debug_user_context->i.psr = temp; + __break_user_context.i.psr = temp; break; case GDB_REG_CCR: - __debug_user_context->i.ccr = temp; + __break_user_context.i.ccr = temp; break; case GDB_REG_CCCR: - __debug_user_context->i.cccr = temp; + __break_user_context.i.cccr = temp; break; case GDB_REG_BRR: - __debug_status.brr = temp; + __debug_regs->brr = temp; break; case GDB_REG_LR: - __debug_user_context->i.lr = temp; + __break_user_context.i.lr = temp; break; case GDB_REG_LCR: - __debug_user_context->i.lcr = temp; + __break_user_context.i.lcr = temp; break; case GDB_REG_FSR0: - __debug_user_context->f.fsr[0] = temp; + __break_user_context.f.fsr[0] = temp; break; case GDB_REG_ACC(0) ... GDB_REG_ACC(7): - __debug_user_context->f.acc[addr - GDB_REG_ACC(0)] = temp; + __break_user_context.f.acc[addr - GDB_REG_ACC(0)] = temp; break; case GDB_REG_ACCG(0): - *(uint32_t *) &__debug_user_context->f.accg[0] = temp; + *(uint32_t *) &__break_user_context.f.accg[0] = temp; break; case GDB_REG_ACCG(4): - *(uint32_t *) &__debug_user_context->f.accg[4] = temp; + *(uint32_t *) &__break_user_context.f.accg[4] = temp; break; case GDB_REG_MSR(0) ... GDB_REG_MSR(1): - __debug_user_context->f.msr[addr - GDB_REG_MSR(0)] = temp; + __break_user_context.f.msr[addr - GDB_REG_MSR(0)] = temp; break; case GDB_REG_GNER(0) ... GDB_REG_GNER(1): - __debug_user_context->i.gner[addr - GDB_REG_GNER(0)] = temp; + __break_user_context.i.gner[addr - GDB_REG_GNER(0)] = temp; break; case GDB_REG_FNER(0) ... GDB_REG_FNER(1): - __debug_user_context->f.fner[addr - GDB_REG_FNER(0)] = temp; + __break_user_context.f.fner[addr - GDB_REG_FNER(0)] = temp; break; default: temp2 = 0; @@ -1871,7 +1850,6 @@ void gdbstub(int sigval) /* step to next instruction */ case 's': __debug_regs->dcr |= DCR_SE; - __debug_status.dcr |= DCR_SE; goto done; /* set baud rate (bBB) */ @@ -1956,7 +1934,7 @@ void gdbstub(int sigval) } done: - restore_user_regs(&__debug_frame0->uc); + restore_user_regs(&__break_user_context); //gdbstub_dump_debugregs(); //gdbstub_printk("<-- gdbstub() %08x\n", __debug_frame->pc); @@ -1988,6 +1966,7 @@ void __init gdbstub_init(void) #endif gdbstub_printk("%s", gdbstub_banner); + gdbstub_printk("DCR: %x\n", __debug_regs->dcr); gdbstub_io_init(); diff --git a/trunk/arch/frv/kernel/head.S b/trunk/arch/frv/kernel/head.S index fecf751c5cae..47c990af2e06 100644 --- a/trunk/arch/frv/kernel/head.S +++ b/trunk/arch/frv/kernel/head.S @@ -11,7 +11,6 @@ #include #include -#include #include #include #include diff --git a/trunk/arch/frv/kernel/local.h b/trunk/arch/frv/kernel/local.h index 76606d13b1aa..e9471761d78b 100644 --- a/trunk/arch/frv/kernel/local.h +++ b/trunk/arch/frv/kernel/local.h @@ -51,9 +51,6 @@ extern void (*__power_switch_wake_cleanup)(void); /* time.c */ extern void time_divisor_init(void); -/* cmode.S */ -extern asmlinkage void frv_change_cmode(int); - #endif /* __ASSEMBLY__ */ #endif /* _FRV_LOCAL_H */ diff --git a/trunk/arch/frv/kernel/pm.c b/trunk/arch/frv/kernel/pm.c index c1d9fc8f1a85..e65a9f1c0c26 100644 --- a/trunk/arch/frv/kernel/pm.c +++ b/trunk/arch/frv/kernel/pm.c @@ -26,6 +26,11 @@ #include "local.h" +void (*pm_power_off)(void); +EXPORT_SYMBOL(pm_power_off); + +extern void frv_change_cmode(int); + /* * Debug macros */ diff --git a/trunk/arch/frv/kernel/process.c b/trunk/arch/frv/kernel/process.c index 515a5cea5469..eeeb1e2641d5 100644 --- a/trunk/arch/frv/kernel/process.c +++ b/trunk/arch/frv/kernel/process.c @@ -10,7 +10,6 @@ * 2 of the License, or (at your option) any later version. */ -#include #include #include #include @@ -26,7 +25,6 @@ #include #include -#include #include #include #include @@ -40,9 +38,6 @@ asmlinkage void ret_from_fork(void); #include -void (*pm_power_off)(void); -EXPORT_SYMBOL(pm_power_off); - struct task_struct *alloc_task_struct(void) { struct task_struct *p = kmalloc(THREAD_SIZE, GFP_KERNEL); @@ -208,7 +203,7 @@ int copy_thread(int nr, unsigned long clone_flags, regs0 = __kernel_frame0_ptr; childregs0 = (struct pt_regs *) - (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE); + (task_stack_page(p) + THREAD_SIZE - USER_CONTEXT_SIZE); childregs = childregs0; /* set up the userspace frame (the only place that the USP is stored) */ @@ -372,11 +367,3 @@ int elf_check_arch(const struct elf32_hdr *hdr) return 1; } - -int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs) -{ - memcpy(fpregs, - ¤t->thread.user->f, - sizeof(current->thread.user->f)); - return 1; -} diff --git a/trunk/arch/frv/kernel/switch_to.S b/trunk/arch/frv/kernel/switch_to.S index b5275fa9cd0d..9e5a583991a3 100644 --- a/trunk/arch/frv/kernel/switch_to.S +++ b/trunk/arch/frv/kernel/switch_to.S @@ -11,7 +11,6 @@ # 2 of the License, or (at your option) any later version. # ############################################################################### - #include #include #include @@ -31,7 +30,7 @@ # address of frame 0 (userspace) on current kernel stack .globl __kernel_frame0_ptr __kernel_frame0_ptr: - .long init_thread_union + THREAD_SIZE - FRV_FRAME0_SIZE + .long init_thread_union + THREAD_SIZE - USER_CONTEXT_SIZE # address of current task .globl __kernel_current_task diff --git a/trunk/arch/frv/kernel/traps.c b/trunk/arch/frv/kernel/traps.c index 2e6098c85578..98ce3628ebde 100644 --- a/trunk/arch/frv/kernel/traps.c +++ b/trunk/arch/frv/kernel/traps.c @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -280,20 +279,20 @@ static const char *regnames[] = { void show_regs(struct pt_regs *regs) { - unsigned long *reg; + uint32_t *reg; int loop; printk("\n"); - printk("Frame: @%08lx [%s]\n", - (unsigned long) regs, + printk("Frame: @%08x [%s]\n", + (uint32_t) regs, regs->psr & PSR_S ? "kernel" : "user"); - reg = (unsigned long *) regs; - for (loop = 0; loop < NR_PT_REGS; loop++) { - printk("%s %08lx", regnames[loop + 0], reg[loop + 0]); + reg = (uint32_t *) regs; + for (loop = 0; loop < REG__END; loop++) { + printk("%s %08x", regnames[loop + 0], reg[loop + 0]); - if (loop == NR_PT_REGS - 1 || loop % 5 == 4) + if (loop == REG__END - 1 || loop % 5 == 4) printk("\n"); else printk(" | "); @@ -329,7 +328,7 @@ void die_if_kernel(const char *str, ...) */ static void show_backtrace_regs(struct pt_regs *frame) { - unsigned long *reg; + uint32_t *reg; int loop; /* print the registers for this frame */ @@ -337,11 +336,11 @@ static void show_backtrace_regs(struct pt_regs *frame) frame->psr & PSR_S ? "Kernel Mode" : "User Mode", frame); - reg = (unsigned long *) frame; - for (loop = 0; loop < NR_PT_REGS; loop++) { - printk("%s %08lx", regnames[loop + 0], reg[loop + 0]); + reg = (uint32_t *) frame; + for (loop = 0; loop < REG__END; loop++) { + printk("%s %08x", regnames[loop + 0], reg[loop + 0]); - if (loop == NR_PT_REGS - 1 || loop % 5 == 4) + if (loop == REG__END - 1 || loop % 5 == 4) printk("\n"); else printk(" | "); diff --git a/trunk/arch/frv/mb93090-mb00/pci-vdk.c b/trunk/arch/frv/mb93090-mb00/pci-vdk.c index f7279d78995a..fb98e90c5794 100644 --- a/trunk/arch/frv/mb93090-mb00/pci-vdk.c +++ b/trunk/arch/frv/mb93090-mb00/pci-vdk.c @@ -406,9 +406,7 @@ int __init pcibios_init(void) ioport_resource.end = (__reg_MB86943_sl_pci_io_range << 9) | 0x3ff; ioport_resource.end += ioport_resource.start; - printk("PCI IO window: %08llx-%08llx\n", - (unsigned long long) ioport_resource.start, - (unsigned long long) ioport_resource.end); + printk("PCI IO window: %08lx-%08lx\n", ioport_resource.start, ioport_resource.end); iomem_resource.start = (__reg_MB86943_sl_pci_mem_base << 9) & 0xfffffc00; @@ -418,11 +416,8 @@ int __init pcibios_init(void) iomem_resource.end = (__reg_MB86943_sl_pci_mem_range << 9) | 0x3ff; iomem_resource.end += iomem_resource.start; - printk("PCI MEM window: %08llx-%08llx\n", - (unsigned long long) iomem_resource.start, - (unsigned long long) iomem_resource.end); - printk("PCI DMA memory: %08lx-%08lx\n", - dma_coherent_mem_start, dma_coherent_mem_end); + printk("PCI MEM window: %08lx-%08lx\n", iomem_resource.start, iomem_resource.end); + printk("PCI DMA memory: %08lx-%08lx\n", dma_coherent_mem_start, dma_coherent_mem_end); if (!pci_probe) return -ENXIO; diff --git a/trunk/arch/i386/defconfig b/trunk/arch/i386/defconfig index 89ebb7a316ab..1629c3ac9bee 100644 --- a/trunk/arch/i386/defconfig +++ b/trunk/arch/i386/defconfig @@ -197,7 +197,7 @@ CONFIG_PM=y # CONFIG_PM_LEGACY is not set # CONFIG_PM_DEBUG is not set CONFIG_SOFTWARE_SUSPEND=y -CONFIG_PM_STD_PARTITION="" +CONFIG_PM_STD_PARTITION="/dev/hda2" # # ACPI (Advanced Configuration and Power Interface) Support diff --git a/trunk/arch/i386/kernel/ioport.c b/trunk/arch/i386/kernel/ioport.c index 498e8bc197d5..79026f026b85 100644 --- a/trunk/arch/i386/kernel/ioport.c +++ b/trunk/arch/i386/kernel/ioport.c @@ -79,7 +79,6 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) memset(bitmap, 0xff, IO_BITMAP_BYTES); t->io_bitmap_ptr = bitmap; - set_thread_flag(TIF_IO_BITMAP); } /* diff --git a/trunk/arch/i386/kernel/process.c b/trunk/arch/i386/kernel/process.c index 923bb292f47f..94e2c87edeaa 100644 --- a/trunk/arch/i386/kernel/process.c +++ b/trunk/arch/i386/kernel/process.c @@ -359,16 +359,16 @@ EXPORT_SYMBOL(kernel_thread); */ void exit_thread(void) { + struct task_struct *tsk = current; + struct thread_struct *t = &tsk->thread; + /* The process may have allocated an io port bitmap... nuke it. */ - if (unlikely(test_thread_flag(TIF_IO_BITMAP))) { - struct task_struct *tsk = current; - struct thread_struct *t = &tsk->thread; + if (unlikely(NULL != t->io_bitmap_ptr)) { int cpu = get_cpu(); struct tss_struct *tss = &per_cpu(init_tss, cpu); kfree(t->io_bitmap_ptr); t->io_bitmap_ptr = NULL; - clear_thread_flag(TIF_IO_BITMAP); /* * Careful, clear this in the TSS too: */ @@ -387,7 +387,6 @@ void flush_thread(void) memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); - clear_tsk_thread_flag(tsk, TIF_DEBUG); /* * Forget coprocessor state.. */ @@ -432,7 +431,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, savesegment(gs,p->thread.gs); tsk = current; - if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) { + if (unlikely(NULL != tsk->thread.io_bitmap_ptr)) { p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); if (!p->thread.io_bitmap_ptr) { p->thread.io_bitmap_max = 0; @@ -440,7 +439,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, } memcpy(p->thread.io_bitmap_ptr, tsk->thread.io_bitmap_ptr, IO_BITMAP_BYTES); - set_tsk_thread_flag(p, TIF_IO_BITMAP); } /* @@ -535,24 +533,10 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) return 1; } -static noinline void __switch_to_xtra(struct task_struct *next_p, - struct tss_struct *tss) +static inline void +handle_io_bitmap(struct thread_struct *next, struct tss_struct *tss) { - struct thread_struct *next; - - next = &next_p->thread; - - if (test_tsk_thread_flag(next_p, TIF_DEBUG)) { - set_debugreg(next->debugreg[0], 0); - set_debugreg(next->debugreg[1], 1); - set_debugreg(next->debugreg[2], 2); - set_debugreg(next->debugreg[3], 3); - /* no 4 and 5 */ - set_debugreg(next->debugreg[6], 6); - set_debugreg(next->debugreg[7], 7); - } - - if (!test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) { + if (!next->io_bitmap_ptr) { /* * Disable the bitmap via an invalid offset. We still cache * the previous bitmap owner and the IO bitmap contents: @@ -560,7 +544,6 @@ static noinline void __switch_to_xtra(struct task_struct *next_p, tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET; return; } - if (likely(next == tss->io_bitmap_owner)) { /* * Previous owner of the bitmap (hence the bitmap content) @@ -688,11 +671,20 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas set_iopl_mask(next->iopl); /* - * Now maybe handle debug registers and/or IO bitmaps + * Now maybe reload the debug registers */ - 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); + if (unlikely(next->debugreg[7])) { + set_debugreg(next->debugreg[0], 0); + set_debugreg(next->debugreg[1], 1); + set_debugreg(next->debugreg[2], 2); + set_debugreg(next->debugreg[3], 3); + /* no 4 and 5 */ + set_debugreg(next->debugreg[6], 6); + set_debugreg(next->debugreg[7], 7); + } + + if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) + handle_io_bitmap(next, tss); disable_tsc(prev_p, next_p); diff --git a/trunk/arch/i386/kernel/ptrace.c b/trunk/arch/i386/kernel/ptrace.c index d3db03f4085d..fd7eaf7866e0 100644 --- a/trunk/arch/i386/kernel/ptrace.c +++ b/trunk/arch/i386/kernel/ptrace.c @@ -468,11 +468,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) for(i=0; i<4; i++) if ((0x5f54 >> ((data >> (16 + 4*i)) & 0xf)) & 1) goto out_tsk; - if (data) - set_tsk_thread_flag(child, TIF_DEBUG); - else - clear_tsk_thread_flag(child, TIF_DEBUG); } + addr -= (long) &dummy->u_debugreg; addr = addr >> 2; child->thread.debugreg[addr] = data; diff --git a/trunk/arch/i386/kernel/setup.c b/trunk/arch/i386/kernel/setup.c index 7864395c1441..08c00d20f162 100644 --- a/trunk/arch/i386/kernel/setup.c +++ b/trunk/arch/i386/kernel/setup.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/time.c b/trunk/arch/i386/kernel/time.c index 8705c0f05788..316421a7f56f 100644 --- a/trunk/arch/i386/kernel/time.c +++ b/trunk/arch/i386/kernel/time.c @@ -206,16 +206,15 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) unsigned long get_cmos_time(void) { unsigned long retval; - unsigned long flags; - spin_lock_irqsave(&rtc_lock, flags); + spin_lock(&rtc_lock); if (efi_enabled) retval = efi_get_time(); else retval = mach_get_cmos_time(); - spin_unlock_irqrestore(&rtc_lock, flags); + spin_unlock(&rtc_lock); return retval; } diff --git a/trunk/arch/i386/kernel/traps.c b/trunk/arch/i386/kernel/traps.c index 5cfd4f42eeba..2bf8b55b91f8 100644 --- a/trunk/arch/i386/kernel/traps.c +++ b/trunk/arch/i386/kernel/traps.c @@ -100,13 +100,13 @@ int register_die_notifier(struct notifier_block *nb) vmalloc_sync_all(); return atomic_notifier_chain_register(&i386die_chain, nb); } -EXPORT_SYMBOL(register_die_notifier); /* used modular by kdb */ +EXPORT_SYMBOL(register_die_notifier); int unregister_die_notifier(struct notifier_block *nb) { return atomic_notifier_chain_unregister(&i386die_chain, nb); } -EXPORT_SYMBOL(unregister_die_notifier); /* used modular by kdb */ +EXPORT_SYMBOL(unregister_die_notifier); static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) { diff --git a/trunk/arch/i386/oprofile/nmi_int.c b/trunk/arch/i386/oprofile/nmi_int.c index c8c1df8ff2b4..fa8a37bcb391 100644 --- a/trunk/arch/i386/oprofile/nmi_int.c +++ b/trunk/arch/i386/oprofile/nmi_int.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -297,14 +296,12 @@ static int nmi_create_files(struct super_block * sb, struct dentry * root) return 0; } -static int p4force; -module_param(p4force, int, 0); static int __init p4_init(char ** cpu_type) { __u8 cpu_model = boot_cpu_data.x86_model; - if (!p4force && (cpu_model > 6 || cpu_model == 5)) + if (cpu_model > 4) return 0; #ifndef CONFIG_SMP diff --git a/trunk/arch/i386/pci/common.c b/trunk/arch/i386/pci/common.c index 0a362e3aeac5..c624b61e1104 100644 --- a/trunk/arch/i386/pci/common.c +++ b/trunk/arch/i386/pci/common.c @@ -17,6 +17,10 @@ #include "pci.h" +#ifdef CONFIG_PCI_BIOS +extern void pcibios_sort(void); +#endif + unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | PCI_PROBE_MMCONF; diff --git a/trunk/arch/i386/pci/pci.h b/trunk/arch/i386/pci/pci.h index bf4e79335388..12bf3d8dda29 100644 --- a/trunk/arch/i386/pci/pci.h +++ b/trunk/arch/i386/pci/pci.h @@ -84,4 +84,4 @@ extern int pci_conf1_read(unsigned int seg, unsigned int bus, extern void pci_direct_init(void); extern void pci_pcbios_init(void); extern void pci_mmcfg_init(void); -extern void pcibios_sort(void); + diff --git a/trunk/arch/ia64/dig/setup.c b/trunk/arch/ia64/dig/setup.c index 9196b330ff7f..5ab12b8351d0 100644 --- a/trunk/arch/ia64/dig/setup.c +++ b/trunk/arch/ia64/dig/setup.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/efi.c b/trunk/arch/ia64/kernel/efi.c index e4bfa9dafbce..b13c0555c3ba 100644 --- a/trunk/arch/ia64/kernel/efi.c +++ b/trunk/arch/ia64/kernel/efi.c @@ -759,7 +759,7 @@ valid_phys_addr_range (unsigned long phys_addr, unsigned long size) } int -valid_mmap_phys_addr_range (unsigned long pfn, unsigned long size) +valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long size) { /* * MMIO regions are often missing from the EFI memory map. diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index 7ad0d9cc6db6..6a33f414de58 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/ia64/pci/pci.c b/trunk/arch/ia64/pci/pci.c index 60b45e79f080..276512fd8922 100644 --- a/trunk/arch/ia64/pci/pci.c +++ b/trunk/arch/ia64/pci/pci.c @@ -650,7 +650,7 @@ pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma) * Avoid attribute aliasing. See Documentation/ia64/aliasing.txt * for more details. */ - if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size)) + if (!valid_mmap_phys_addr_range(vma->vm_pgoff << PAGE_SHIFT, size)) return -EINVAL; prot = phys_mem_access_prot(NULL, vma->vm_pgoff, size, vma->vm_page_prot); diff --git a/trunk/arch/ia64/sn/kernel/setup.c b/trunk/arch/ia64/sn/kernel/setup.c index c119e8b620de..dd6bcf4d58bf 100644 --- a/trunk/arch/ia64/sn/kernel/setup.c +++ b/trunk/arch/ia64/sn/kernel/setup.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup.c b/trunk/arch/m32r/kernel/setup.c index 3f35ab3d2dc2..0a6c6e677afe 100644 --- a/trunk/arch/m32r/kernel/setup.c +++ b/trunk/arch/m32r/kernel/setup.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/mips/kernel/irixelf.c b/trunk/arch/mips/kernel/irixelf.c index ab12c8f01518..10d3644e3608 100644 --- a/trunk/arch/mips/kernel/irixelf.c +++ b/trunk/arch/mips/kernel/irixelf.c @@ -999,6 +999,8 @@ static inline int maydump(struct vm_area_struct *vma) return 1; } +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) + /* An ELF note in memory. */ struct memelfnote { diff --git a/trunk/arch/mips/kernel/setup.c b/trunk/arch/mips/kernel/setup.c index 8c2b596a136f..5edd8d4bb665 100644 --- a/trunk/arch/mips/kernel/setup.c +++ b/trunk/arch/mips/kernel/setup.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/malta/malta_setup.c b/trunk/arch/mips/mips-boards/malta/malta_setup.c index 7a54195c78fb..bc4ac6f01877 100644 --- a/trunk/arch/mips/mips-boards/malta/malta_setup.c +++ b/trunk/arch/mips/mips-boards/malta/malta_setup.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #ifdef CONFIG_MTD #include diff --git a/trunk/arch/mips/sibyte/swarm/setup.c b/trunk/arch/mips/sibyte/swarm/setup.c index 2996e338cfbd..a9a6dbc06849 100644 --- a/trunk/arch/mips/sibyte/swarm/setup.c +++ b/trunk/arch/mips/sibyte/swarm/setup.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/arch/mips/sni/setup.c b/trunk/arch/mips/sni/setup.c index e5646b027f72..870486d6cd75 100644 --- a/trunk/arch/mips/sni/setup.c +++ b/trunk/arch/mips/sni/setup.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #ifdef CONFIG_ARC #include diff --git a/trunk/arch/parisc/kernel/pdc_cons.c b/trunk/arch/parisc/kernel/pdc_cons.c index aab05767427c..ce78f412ff2e 100644 --- a/trunk/arch/parisc/kernel/pdc_cons.c +++ b/trunk/arch/parisc/kernel/pdc_cons.c @@ -89,8 +89,6 @@ static int pdc_console_setup(struct console *co, char *options) } #if defined(CONFIG_PDC_CONSOLE) -#include - static struct tty_driver * pdc_console_device (struct console *c, int *index) { extern struct tty_driver console_driver; diff --git a/trunk/arch/powerpc/kernel/ibmebus.c b/trunk/arch/powerpc/kernel/ibmebus.c index 68e5ab0443d2..97ddc02a3d42 100644 --- a/trunk/arch/powerpc/kernel/ibmebus.c +++ b/trunk/arch/powerpc/kernel/ibmebus.c @@ -323,7 +323,7 @@ int ibmebus_request_irq(struct ibmebus_dev *dev, unsigned long irq_flags, const char * devname, void *dev_id) { - unsigned int irq = irq_create_mapping(NULL, ist); + unsigned int irq = irq_create_mapping(NULL, ist, 0); if (irq == NO_IRQ) return -EINVAL; diff --git a/trunk/arch/powerpc/kernel/irq.c b/trunk/arch/powerpc/kernel/irq.c index 01bdae35cb55..8cf987809c66 100644 --- a/trunk/arch/powerpc/kernel/irq.c +++ b/trunk/arch/powerpc/kernel/irq.c @@ -391,14 +391,15 @@ struct irq_host *irq_alloc_host(unsigned int revmap_type, irq_map[i].host = host; smp_wmb(); - /* Clear norequest flags */ - get_irq_desc(i)->status &= ~IRQ_NOREQUEST; + /* Clear some flags */ + get_irq_desc(i)->status + &= ~(IRQ_NOREQUEST | IRQ_LEVEL); /* Legacy flags are left to default at this point, * one can then use irq_create_mapping() to * explicitely change them */ - ops->map(host, i, i); + ops->map(host, i, i, 0); } break; case IRQ_HOST_MAP_LINEAR: @@ -456,11 +457,13 @@ void irq_set_virq_count(unsigned int count) } unsigned int irq_create_mapping(struct irq_host *host, - irq_hw_number_t hwirq) + irq_hw_number_t hwirq, + unsigned int flags) { unsigned int virq, hint; - pr_debug("irq: irq_create_mapping(0x%p, 0x%lx)\n", host, hwirq); + pr_debug("irq: irq_create_mapping(0x%p, 0x%lx, 0x%x)\n", + host, hwirq, flags); /* Look for default host if nececssary */ if (host == NULL) @@ -479,6 +482,7 @@ unsigned int irq_create_mapping(struct irq_host *host, virq = irq_find_mapping(host, hwirq); if (virq != IRQ_NONE) { pr_debug("irq: -> existing mapping on virq %d\n", virq); + host->ops->map(host, virq, hwirq, flags); return virq; } @@ -500,18 +504,18 @@ unsigned int irq_create_mapping(struct irq_host *host, } pr_debug("irq: -> obtained virq %d\n", virq); - /* Clear IRQ_NOREQUEST flag */ - get_irq_desc(virq)->status &= ~IRQ_NOREQUEST; + /* Clear some flags */ + get_irq_desc(virq)->status &= ~(IRQ_NOREQUEST | IRQ_LEVEL); /* map it */ - smp_wmb(); - irq_map[virq].hwirq = hwirq; - smp_mb(); - if (host->ops->map(host, virq, hwirq)) { + if (host->ops->map(host, virq, hwirq, flags)) { pr_debug("irq: -> mapping failed, freeing\n"); irq_free_virt(virq, 1); return NO_IRQ; } + smp_wmb(); + irq_map[virq].hwirq = hwirq; + smp_mb(); return virq; } EXPORT_SYMBOL_GPL(irq_create_mapping); @@ -521,38 +525,25 @@ extern unsigned int irq_create_of_mapping(struct device_node *controller, { struct irq_host *host; irq_hw_number_t hwirq; - unsigned int type = IRQ_TYPE_NONE; - unsigned int virq; + unsigned int flags = IRQ_TYPE_NONE; if (controller == NULL) host = irq_default_host; else host = irq_find_host(controller); - if (host == NULL) { - printk(KERN_WARNING "irq: no irq host found for %s !\n", - controller->full_name); + if (host == NULL) return NO_IRQ; - } /* If host has no translation, then we assume interrupt line */ if (host->ops->xlate == NULL) hwirq = intspec[0]; else { if (host->ops->xlate(host, controller, intspec, intsize, - &hwirq, &type)) + &hwirq, &flags)) return NO_IRQ; } - /* Create mapping */ - virq = irq_create_mapping(host, hwirq); - if (virq == NO_IRQ) - return virq; - - /* Set type if specified and different than the current one */ - if (type != IRQ_TYPE_NONE && - type != (get_irq_desc(virq)->status & IRQF_TRIGGER_MASK)) - set_irq_type(virq, type); - return virq; + return irq_create_mapping(host, hwirq, flags); } EXPORT_SYMBOL_GPL(irq_create_of_mapping); diff --git a/trunk/arch/powerpc/kernel/pci_32.c b/trunk/arch/powerpc/kernel/pci_32.c index 09b1e1bbb29b..898dae8ab6d9 100644 --- a/trunk/arch/powerpc/kernel/pci_32.c +++ b/trunk/arch/powerpc/kernel/pci_32.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include #include @@ -1420,37 +1420,15 @@ int pci_read_irq_line(struct pci_dev *pci_dev) DBG("Try to map irq for %s...\n", pci_name(pci_dev)); - /* Try to get a mapping from the device-tree */ if (of_irq_map_pci(pci_dev, &oirq)) { - u8 line, pin; - - /* If that fails, lets fallback to what is in the config - * space and map that through the default controller. We - * also set the type to level low since that's what PCI - * interrupts are. If your platform does differently, then - * either provide a proper interrupt tree or don't use this - * function. - */ - if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin)) - return -1; - if (pin == 0) - return -1; - if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) || - line == 0xff) { - return -1; - } - DBG(" -> no map ! Using irq line %d from PCI config\n", line); + DBG(" -> failed !\n"); + return -1; + } - virq = irq_create_mapping(NULL, line); - if (virq != NO_IRQ) - set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); - } else { - DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", - oirq.size, oirq.specifier[0], oirq.controller->full_name); + DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", + oirq.size, oirq.specifier[0], oirq.controller->full_name); - virq = irq_create_of_mapping(oirq.controller, oirq.specifier, - oirq.size); - } + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); if(virq == NO_IRQ) { DBG(" -> failed to map !\n"); return -1; diff --git a/trunk/arch/powerpc/kernel/pci_64.c b/trunk/arch/powerpc/kernel/pci_64.c index 2fce7738e9e2..efc0b5559ee0 100644 --- a/trunk/arch/powerpc/kernel/pci_64.c +++ b/trunk/arch/powerpc/kernel/pci_64.c @@ -21,13 +21,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include @@ -1289,37 +1289,15 @@ int pci_read_irq_line(struct pci_dev *pci_dev) DBG("Try to map irq for %s...\n", pci_name(pci_dev)); - /* Try to get a mapping from the device-tree */ if (of_irq_map_pci(pci_dev, &oirq)) { - u8 line, pin; - - /* If that fails, lets fallback to what is in the config - * space and map that through the default controller. We - * also set the type to level low since that's what PCI - * interrupts are. If your platform does differently, then - * either provide a proper interrupt tree or don't use this - * function. - */ - if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin)) - return -1; - if (pin == 0) - return -1; - if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) || - line == 0xff) { - return -1; - } - DBG(" -> no map ! Using irq line %d from PCI config\n", line); + DBG(" -> failed !\n"); + return -1; + } - virq = irq_create_mapping(NULL, line); - if (virq != NO_IRQ) - set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); - } else { - DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", - oirq.size, oirq.specifier[0], oirq.controller->full_name); + DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", + oirq.size, oirq.specifier[0], oirq.controller->full_name); - virq = irq_create_of_mapping(oirq.controller, oirq.specifier, - oirq.size); - } + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); if(virq == NO_IRQ) { DBG(" -> failed to map !\n"); return -1; diff --git a/trunk/arch/powerpc/kernel/ppc_ksyms.c b/trunk/arch/powerpc/kernel/ppc_ksyms.c index f6a05f090b25..e3b80f71748e 100644 --- a/trunk/arch/powerpc/kernel/ppc_ksyms.c +++ b/trunk/arch/powerpc/kernel/ppc_ksyms.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/prom_parse.c b/trunk/arch/powerpc/kernel/prom_parse.c index 6a7e997c401d..21009b1f7869 100644 --- a/trunk/arch/powerpc/kernel/prom_parse.c +++ b/trunk/arch/powerpc/kernel/prom_parse.c @@ -881,7 +881,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq intsize = *tmp; /* Check index */ - if ((index + 1) * intsize > intlen) + if (index * intsize >= intlen) return -EINVAL; /* Get new specifier and map it */ diff --git a/trunk/arch/powerpc/kernel/setup-common.c b/trunk/arch/powerpc/kernel/setup-common.c index 499c3861074f..c6d7b98af7d5 100644 --- a/trunk/arch/powerpc/kernel/setup-common.c +++ b/trunk/arch/powerpc/kernel/setup-common.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/cell/interrupt.c b/trunk/arch/powerpc/platforms/cell/interrupt.c index d7bbb61109f9..9d5da7896892 100644 --- a/trunk/arch/powerpc/platforms/cell/interrupt.c +++ b/trunk/arch/powerpc/platforms/cell/interrupt.c @@ -159,7 +159,7 @@ static void iic_request_ipi(int ipi, const char *name) if (iic_hosts[node] == NULL) continue; virq = irq_create_mapping(iic_hosts[node], - iic_ipi_to_irq(ipi)); + iic_ipi_to_irq(ipi), 0); if (virq == NO_IRQ) { printk(KERN_ERR "iic: failed to map IPI %s on node %d\n", @@ -197,7 +197,7 @@ static int iic_host_match(struct irq_host *h, struct device_node *node) } static int iic_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hw, unsigned int flags) { if (hw < IIC_IRQ_IPI0) set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq); diff --git a/trunk/arch/powerpc/platforms/cell/spider-pic.c b/trunk/arch/powerpc/platforms/cell/spider-pic.c index 15217bb0402f..ae7ef88f1a37 100644 --- a/trunk/arch/powerpc/platforms/cell/spider-pic.c +++ b/trunk/arch/powerpc/platforms/cell/spider-pic.c @@ -85,6 +85,9 @@ static void spider_unmask_irq(unsigned int virq) struct spider_pic *pic = spider_virq_to_pic(virq); void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); + /* We use no locking as we should be covered by the descriptor lock + * for access to invidual source configuration registers + */ out_be32(cfg, in_be32(cfg) | 0x30000000u); } @@ -93,6 +96,9 @@ static void spider_mask_irq(unsigned int virq) struct spider_pic *pic = spider_virq_to_pic(virq); void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); + /* We use no locking as we should be covered by the descriptor lock + * for access to invidual source configuration registers + */ out_be32(cfg, in_be32(cfg) & ~0x30000000u); } @@ -114,14 +120,26 @@ static void spider_ack_irq(unsigned int virq) out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf)); } -static int spider_set_irq_type(unsigned int virq, unsigned int type) +static struct irq_chip spider_pic = { + .typename = " SPIDER ", + .unmask = spider_unmask_irq, + .mask = spider_mask_irq, + .ack = spider_ack_irq, +}; + +static int spider_host_match(struct irq_host *h, struct device_node *node) +{ + struct spider_pic *pic = h->host_data; + return node == pic->of_node; +} + +static int spider_host_map(struct irq_host *h, unsigned int virq, + irq_hw_number_t hw, unsigned int flags) { - unsigned int sense = type & IRQ_TYPE_SENSE_MASK; - struct spider_pic *pic = spider_virq_to_pic(virq); - unsigned int hw = irq_map[virq].hwirq; + unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; + struct spider_pic *pic = h->host_data; void __iomem *cfg = spider_get_irq_config(pic, hw); - struct irq_desc *desc = get_irq_desc(virq); - u32 old_mask; + int level = 0; u32 ic; /* Note that only level high is supported for most interrupts */ @@ -139,57 +157,29 @@ static int spider_set_irq_type(unsigned int virq, unsigned int type) break; case IRQ_TYPE_LEVEL_LOW: ic = 0x0; + level = 1; break; case IRQ_TYPE_LEVEL_HIGH: case IRQ_TYPE_NONE: ic = 0x1; + level = 1; break; default: return -EINVAL; } - /* Update irq_desc */ - desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); - desc->status |= type & IRQ_TYPE_SENSE_MASK; - if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) - desc->status |= IRQ_LEVEL; - /* Configure the source. One gross hack that was there before and * that I've kept around is the priority to the BE which I set to * be the same as the interrupt source number. I don't know wether * that's supposed to make any kind of sense however, we'll have to * decide that, but for now, I'm not changing the behaviour. */ - old_mask = in_be32(cfg) & 0x30000000u; - out_be32(cfg, old_mask | (ic << 24) | (0x7 << 16) | - (pic->node_id << 4) | 0xe); + out_be32(cfg, (ic << 24) | (0x7 << 16) | (pic->node_id << 4) | 0xe); out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff)); - return 0; -} - -static struct irq_chip spider_pic = { - .typename = " SPIDER ", - .unmask = spider_unmask_irq, - .mask = spider_mask_irq, - .ack = spider_ack_irq, - .set_type = spider_set_irq_type, -}; - -static int spider_host_match(struct irq_host *h, struct device_node *node) -{ - struct spider_pic *pic = h->host_data; - return node == pic->of_node; -} - -static int spider_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) -{ + if (level) + get_irq_desc(virq)->status |= IRQ_LEVEL; set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq); - - /* Set default irq type */ - set_irq_type(virq, IRQ_TYPE_NONE); - return 0; } @@ -293,7 +283,7 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) if (iic_host == NULL) return NO_IRQ; /* Manufacture an IIC interrupt number of class 2 */ - virq = irq_create_mapping(iic_host, 0x20 | unit); + virq = irq_create_mapping(iic_host, 0x20 | unit, 0); if (virq == NO_IRQ) printk(KERN_ERR "spider_pic: failed to map cascade !"); return virq; diff --git a/trunk/arch/powerpc/platforms/cell/spu_base.c b/trunk/arch/powerpc/platforms/cell/spu_base.c index d06042deb021..5d2313a6c82b 100644 --- a/trunk/arch/powerpc/platforms/cell/spu_base.c +++ b/trunk/arch/powerpc/platforms/cell/spu_base.c @@ -583,9 +583,9 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) spu->isrc = isrc = tmp[0]; /* Now map interrupts of all 3 classes */ - spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc); - spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc); - spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc); + spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0); + spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0); + spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0); /* Right now, we only fail if class 2 failed */ return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; diff --git a/trunk/arch/powerpc/platforms/iseries/irq.c b/trunk/arch/powerpc/platforms/iseries/irq.c index e32446877e78..2275e64f3152 100644 --- a/trunk/arch/powerpc/platforms/iseries/irq.c +++ b/trunk/arch/powerpc/platforms/iseries/irq.c @@ -300,7 +300,7 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus, realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3) + function; - return irq_create_mapping(NULL, realirq); + return irq_create_mapping(NULL, realirq, IRQ_TYPE_NONE); } #endif /* CONFIG_PCI */ @@ -341,7 +341,7 @@ unsigned int iSeries_get_irq(struct pt_regs *regs) } static int iseries_irq_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hw, unsigned int flags) { set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq); diff --git a/trunk/arch/powerpc/platforms/powermac/backlight.c b/trunk/arch/powerpc/platforms/powermac/backlight.c index 74eed6b74cd6..69f65e215a5c 100644 --- a/trunk/arch/powerpc/platforms/powermac/backlight.c +++ b/trunk/arch/powerpc/platforms/powermac/backlight.c @@ -15,15 +15,6 @@ #define OLD_BACKLIGHT_MAX 15 -static void pmac_backlight_key_worker(void *data); -static DECLARE_WORK(pmac_backlight_key_work, pmac_backlight_key_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 - * notice the errors that might happen. - */ -static int pmac_backlight_key_queued; - /* Protect the pmac_backlight variable */ DEFINE_MUTEX(pmac_backlight_mutex); @@ -80,7 +71,7 @@ int pmac_backlight_curve_lookup(struct fb_info *info, int value) return level; } -static void pmac_backlight_key_worker(void *data) +static void pmac_backlight_key(int direction) { mutex_lock(&pmac_backlight_mutex); if (pmac_backlight) { @@ -91,8 +82,7 @@ static void pmac_backlight_key_worker(void *data) props = pmac_backlight->props; brightness = props->brightness + - ((pmac_backlight_key_queued?-1:1) * - (props->max_brightness / 15)); + ((direction?-1:1) * (props->max_brightness / 15)); if (brightness < 0) brightness = 0; @@ -107,13 +97,14 @@ static void pmac_backlight_key_worker(void *data) mutex_unlock(&pmac_backlight_mutex); } -void pmac_backlight_key(int direction) +void pmac_backlight_key_up() { - /* we can receive multiple interrupts here, but the scheduled work - * will run only once, with the last value - */ - pmac_backlight_key_queued = direction; - schedule_work(&pmac_backlight_key_work); + pmac_backlight_key(0); +} + +void pmac_backlight_key_down() +{ + pmac_backlight_key(1); } int pmac_backlight_set_legacy_brightness(int brightness) @@ -166,7 +157,3 @@ int pmac_backlight_get_legacy_brightness() return result; } - -EXPORT_SYMBOL_GPL(pmac_backlight); -EXPORT_SYMBOL_GPL(pmac_backlight_mutex); -EXPORT_SYMBOL_GPL(pmac_has_backlight_type); diff --git a/trunk/arch/powerpc/platforms/powermac/pci.c b/trunk/arch/powerpc/platforms/powermac/pci.c index 205d04471161..556b349797e8 100644 --- a/trunk/arch/powerpc/platforms/powermac/pci.c +++ b/trunk/arch/powerpc/platforms/powermac/pci.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -25,7 +24,10 @@ #include #include #include +#ifdef CONFIG_PPC64 +//#include #include +#endif #undef DEBUG @@ -44,6 +46,7 @@ static int has_uninorth; static struct pci_controller *u3_agp; static struct pci_controller *u4_pcie; static struct pci_controller *u3_ht; +#define has_second_ohare 0 #else static int has_second_ohare; #endif /* CONFIG_PPC64 */ @@ -990,7 +993,6 @@ void __init pmac_pcibios_fixup(void) /* Read interrupt from the device-tree */ pci_read_irq_line(dev); -#ifdef CONFIG_PPC32 /* Fixup interrupt for the modem/ethernet combo controller. * on machines with a second ohare chip. * The number in the device tree (27) is bogus (correct for @@ -1000,11 +1002,8 @@ void __init pmac_pcibios_fixup(void) */ if (has_second_ohare && dev->vendor == PCI_VENDOR_ID_DEC && - dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) { - dev->irq = irq_create_mapping(NULL, 60); - set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); - } -#endif /* CONFIG_PPC32 */ + dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) + dev->irq = irq_create_mapping(NULL, 60, 0); } } diff --git a/trunk/arch/powerpc/platforms/powermac/pic.c b/trunk/arch/powerpc/platforms/powermac/pic.c index 060789e31c67..3d328bc1f7e0 100644 --- a/trunk/arch/powerpc/platforms/powermac/pic.c +++ b/trunk/arch/powerpc/platforms/powermac/pic.c @@ -291,7 +291,7 @@ static int pmac_pic_host_match(struct irq_host *h, struct device_node *node) } static int pmac_pic_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hw, unsigned int flags) { struct irq_desc *desc = get_irq_desc(virq); int level; @@ -318,7 +318,6 @@ static int pmac_pic_host_xlate(struct irq_host *h, struct device_node *ct, unsigned int *out_flags) { - *out_flags = IRQ_TYPE_NONE; *out_hwirq = *intspec; return 0; } @@ -435,7 +434,7 @@ static void __init pmac_pic_probe_oldstyle(void) printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); #ifdef CONFIG_XMON - setup_irq(irq_create_mapping(NULL, 20), &xmon_action); + setup_irq(irq_create_mapping(NULL, 20, 0), &xmon_action); #endif } #endif /* CONFIG_PPC32 */ @@ -580,9 +579,8 @@ void __init pmac_pic_init(void) flags |= OF_IMAP_OLDWORLD_MAC; if (get_property(of_chosen, "linux,bootx", NULL) != NULL) flags |= OF_IMAP_NO_PHANDLE; -#endif /* CONFIG_PPC_32 */ - of_irq_map_init(flags); +#endif /* CONFIG_PPC_32 */ /* We first try to detect Apple's new Core99 chipset, since mac-io * is quite different on those machines and contains an IBM MPIC2. diff --git a/trunk/arch/powerpc/platforms/pseries/ras.c b/trunk/arch/powerpc/platforms/pseries/ras.c index c7ffde1a614e..9df783088b61 100644 --- a/trunk/arch/powerpc/platforms/pseries/ras.c +++ b/trunk/arch/powerpc/platforms/pseries/ras.c @@ -93,7 +93,8 @@ static void request_ras_irqs(struct device_node *np, for (i = 0; i < opicplen; i++) { if (count > 15) break; - virqs[count] = irq_create_mapping(NULL, *(opicprop++)); + virqs[count] = irq_create_mapping(NULL, *(opicprop++), + IRQ_TYPE_NONE); if (virqs[count] == NO_IRQ) printk(KERN_ERR "Unable to allocate interrupt " "number for %s\n", np->full_name); diff --git a/trunk/arch/powerpc/platforms/pseries/xics.c b/trunk/arch/powerpc/platforms/pseries/xics.c index 2d0da6f9e244..716972aa9777 100644 --- a/trunk/arch/powerpc/platforms/pseries/xics.c +++ b/trunk/arch/powerpc/platforms/pseries/xics.c @@ -502,9 +502,16 @@ static int xics_host_match(struct irq_host *h, struct device_node *node) } static int xics_host_map_direct(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hw, unsigned int flags) { - pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw); + unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; + + pr_debug("xics: map_direct virq %d, hwirq 0x%lx, flags: 0x%x\n", + virq, hw, flags); + + if (sense && sense != IRQ_TYPE_LEVEL_LOW) + printk(KERN_WARNING "xics: using unsupported sense 0x%x" + " for irq %d (h: 0x%lx)\n", flags, virq, hw); get_irq_desc(virq)->status |= IRQ_LEVEL; set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq); @@ -512,9 +519,16 @@ static int xics_host_map_direct(struct irq_host *h, unsigned int virq, } static int xics_host_map_lpar(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hw, unsigned int flags) { - pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw); + unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; + + pr_debug("xics: map_lpar virq %d, hwirq 0x%lx, flags: 0x%x\n", + virq, hw, flags); + + if (sense && sense != IRQ_TYPE_LEVEL_LOW) + printk(KERN_WARNING "xics: using unsupported sense 0x%x" + " for irq %d (h: 0x%lx)\n", flags, virq, hw); get_irq_desc(virq)->status |= IRQ_LEVEL; set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq); @@ -743,7 +757,7 @@ void xics_request_IPIs(void) { unsigned int ipi; - ipi = irq_create_mapping(xics_host, XICS_IPI); + ipi = irq_create_mapping(xics_host, XICS_IPI, 0); BUG_ON(ipi == NO_IRQ); /* @@ -768,14 +782,6 @@ void xics_teardown_cpu(int secondary) xics_set_cpu_priority(cpu, 0); - /* - * Clear IPI - */ - if (firmware_has_feature(FW_FEATURE_LPAR)) - lpar_qirr_info(cpu, 0xff); - else - direct_qirr_info(cpu, 0xff); - /* * we need to EOI the IPI if we got here from kexec down IPI * @@ -789,7 +795,7 @@ void xics_teardown_cpu(int secondary) return; desc = get_irq_desc(ipi); if (desc->chip && desc->chip->eoi) - desc->chip->eoi(ipi); + desc->chip->eoi(XICS_IPI); /* * Some machines need to have at least one cpu in the GIQ, diff --git a/trunk/arch/powerpc/sysdev/i8259.c b/trunk/arch/powerpc/sysdev/i8259.c index 9855820b9548..72c73a6105cd 100644 --- a/trunk/arch/powerpc/sysdev/i8259.c +++ b/trunk/arch/powerpc/sysdev/i8259.c @@ -169,7 +169,7 @@ static int i8259_host_match(struct irq_host *h, struct device_node *node) } static int i8259_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hw, unsigned int flags) { pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); @@ -177,7 +177,7 @@ static int i8259_host_map(struct irq_host *h, unsigned int virq, if (hw == 2) get_irq_desc(virq)->status |= IRQ_NOREQUEST; - /* We use the level handler only for now, we might want to + /* We use the level stuff only for now, we might want to * be more cautious here but that works for now */ get_irq_desc(virq)->status |= IRQ_LEVEL; diff --git a/trunk/arch/powerpc/sysdev/mpic.c b/trunk/arch/powerpc/sysdev/mpic.c index 6e0281afa6c3..9cecebaa0360 100644 --- a/trunk/arch/powerpc/sysdev/mpic.c +++ b/trunk/arch/powerpc/sysdev/mpic.c @@ -204,7 +204,7 @@ static void mpic_startup_ht_interrupt(struct mpic *mpic, unsigned int source, if (fixup->base == NULL) return; - DBG("startup_ht_interrupt(0x%x, 0x%x) index: %d\n", + DBG("startup_ht_interrupt(%u, %u) index: %d\n", source, irqflags, fixup->index); spin_lock_irqsave(&mpic->fixup_lock, flags); /* Enable and configure */ @@ -227,7 +227,7 @@ static void mpic_shutdown_ht_interrupt(struct mpic *mpic, unsigned int source, if (fixup->base == NULL) return; - DBG("shutdown_ht_interrupt(0x%x, 0x%x)\n", source, irqflags); + DBG("shutdown_ht_interrupt(%u, %u)\n", source, irqflags); /* Disable */ spin_lock_irqsave(&mpic->fixup_lock, flags); @@ -337,17 +337,6 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic) } } -#else /* CONFIG_MPIC_BROKEN_U3 */ - -static inline int mpic_is_ht_interrupt(struct mpic *mpic, unsigned int source) -{ - return 0; -} - -static void __init mpic_scan_ht_pics(struct mpic *mpic) -{ -} - #endif /* CONFIG_MPIC_BROKEN_U3 */ @@ -416,9 +405,11 @@ static void mpic_unmask_irq(unsigned int irq) unsigned int loops = 100000; struct mpic *mpic = mpic_from_irq(irq); unsigned int src = mpic_irq_to_hw(irq); + unsigned long flags; DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); + spin_lock_irqsave(&mpic_lock, flags); mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & ~MPIC_VECPRI_MASK); @@ -429,6 +420,7 @@ static void mpic_unmask_irq(unsigned int irq) break; } } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK); + spin_unlock_irqrestore(&mpic_lock, flags); } static void mpic_mask_irq(unsigned int irq) @@ -436,9 +428,11 @@ static void mpic_mask_irq(unsigned int irq) unsigned int loops = 100000; struct mpic *mpic = mpic_from_irq(irq); unsigned int src = mpic_irq_to_hw(irq); + unsigned long flags; DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); + spin_lock_irqsave(&mpic_lock, flags); mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | MPIC_VECPRI_MASK); @@ -450,6 +444,7 @@ static void mpic_mask_irq(unsigned int irq) break; } } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK)); + spin_unlock_irqrestore(&mpic_lock, flags); } static void mpic_end_irq(unsigned int irq) @@ -517,7 +512,8 @@ static void mpic_end_ht_irq(unsigned int irq) mpic_ht_end_irq(mpic, src); mpic_eoi(mpic); } -#endif /* !CONFIG_MPIC_BROKEN_U3 */ + +#endif /* CONFIG_MPIC_BROKEN_U3 */ #ifdef CONFIG_SMP @@ -564,74 +560,47 @@ static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask) mpic_physmask(cpus_addr(tmp)[0])); } -static unsigned int mpic_type_to_vecpri(unsigned int type) +static unsigned int mpic_flags_to_vecpri(unsigned int flags, int *level) { + unsigned int vecpri; + /* Now convert sense value */ - switch(type & IRQ_TYPE_SENSE_MASK) { + switch(flags & IRQ_TYPE_SENSE_MASK) { case IRQ_TYPE_EDGE_RISING: - return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_POSITIVE; + vecpri = MPIC_VECPRI_SENSE_EDGE | + MPIC_VECPRI_POLARITY_POSITIVE; + *level = 0; + break; case IRQ_TYPE_EDGE_FALLING: - case IRQ_TYPE_EDGE_BOTH: - return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_NEGATIVE; + vecpri = MPIC_VECPRI_SENSE_EDGE | + MPIC_VECPRI_POLARITY_NEGATIVE; + *level = 0; + break; case IRQ_TYPE_LEVEL_HIGH: - return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_POSITIVE; + vecpri = MPIC_VECPRI_SENSE_LEVEL | + MPIC_VECPRI_POLARITY_POSITIVE; + *level = 1; + break; case IRQ_TYPE_LEVEL_LOW: default: - return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_NEGATIVE; + vecpri = MPIC_VECPRI_SENSE_LEVEL | + MPIC_VECPRI_POLARITY_NEGATIVE; + *level = 1; } -} - -static int mpic_set_irq_type(unsigned int virq, unsigned int flow_type) -{ - struct mpic *mpic = mpic_from_irq(virq); - unsigned int src = mpic_irq_to_hw(virq); - struct irq_desc *desc = get_irq_desc(virq); - unsigned int vecpri, vold, vnew; - - DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%x)\n", - mpic, virq, src, flow_type); - - if (src >= mpic->irq_count) - return -EINVAL; - - if (flow_type == IRQ_TYPE_NONE) - if (mpic->senses && src < mpic->senses_count) - flow_type = mpic->senses[src]; - if (flow_type == IRQ_TYPE_NONE) - flow_type = IRQ_TYPE_LEVEL_LOW; - - desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); - desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; - if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) - desc->status |= IRQ_LEVEL; - - if (mpic_is_ht_interrupt(mpic, src)) - vecpri = MPIC_VECPRI_POLARITY_POSITIVE | - MPIC_VECPRI_SENSE_EDGE; - else - vecpri = mpic_type_to_vecpri(flow_type); - - vold = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI); - vnew = vold & ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK); - vnew |= vecpri; - if (vold != vnew) - mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, vnew); - - return 0; + return vecpri; } static struct irq_chip mpic_irq_chip = { - .mask = mpic_mask_irq, - .unmask = mpic_unmask_irq, - .eoi = mpic_end_irq, - .set_type = mpic_set_irq_type, + .mask = mpic_mask_irq, + .unmask = mpic_unmask_irq, + .eoi = mpic_end_irq, }; #ifdef CONFIG_SMP static struct irq_chip mpic_ipi_chip = { - .mask = mpic_mask_ipi, - .unmask = mpic_unmask_ipi, - .eoi = mpic_end_ipi, + .mask = mpic_mask_ipi, + .unmask = mpic_unmask_ipi, + .eoi = mpic_end_ipi, }; #endif /* CONFIG_SMP */ @@ -642,7 +611,6 @@ static struct irq_chip mpic_irq_ht_chip = { .mask = mpic_mask_irq, .unmask = mpic_unmask_ht_irq, .eoi = mpic_end_ht_irq, - .set_type = mpic_set_irq_type, }; #endif /* CONFIG_MPIC_BROKEN_U3 */ @@ -656,21 +624,26 @@ static int mpic_host_match(struct irq_host *h, struct device_node *node) } static int mpic_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hw, unsigned int flags) { - struct mpic *mpic = h->host_data; + struct irq_desc *desc = get_irq_desc(virq); struct irq_chip *chip; + struct mpic *mpic = h->host_data; + u32 v, vecpri = MPIC_VECPRI_SENSE_LEVEL | + MPIC_VECPRI_POLARITY_NEGATIVE; + int level; + unsigned long iflags; - DBG("mpic: map virq %d, hwirq 0x%lx\n", virq, hw); + pr_debug("mpic: map virq %d, hwirq 0x%lx, flags: 0x%x\n", + virq, hw, flags); if (hw == MPIC_VEC_SPURRIOUS) return -EINVAL; - #ifdef CONFIG_SMP else if (hw >= MPIC_VEC_IPI_0) { WARN_ON(!(mpic->flags & MPIC_PRIMARY)); - DBG("mpic: mapping as IPI\n"); + pr_debug("mpic: mapping as IPI\n"); set_irq_chip_data(virq, mpic); set_irq_chip_and_handler(virq, &mpic->hc_ipi, handle_percpu_irq); @@ -681,23 +654,44 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, if (hw >= mpic->irq_count) return -EINVAL; - /* Default chip */ + /* If no sense provided, check default sense array */ + if (((flags & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_NONE) && + mpic->senses && hw < mpic->senses_count) + flags |= mpic->senses[hw]; + + vecpri = mpic_flags_to_vecpri(flags, &level); + if (level) + desc->status |= IRQ_LEVEL; chip = &mpic->hc_irq; #ifdef CONFIG_MPIC_BROKEN_U3 /* Check for HT interrupts, override vecpri */ - if (mpic_is_ht_interrupt(mpic, hw)) + if (mpic_is_ht_interrupt(mpic, hw)) { + vecpri &= ~(MPIC_VECPRI_SENSE_MASK | + MPIC_VECPRI_POLARITY_MASK); + vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; chip = &mpic->hc_ht_irq; -#endif /* CONFIG_MPIC_BROKEN_U3 */ + } +#endif - DBG("mpic: mapping to irq chip @%p\n", chip); + /* Reconfigure irq. We must preserve the mask bit as we can be called + * while the interrupt is still active (This may change in the future + * but for now, it is the case). + */ + spin_lock_irqsave(&mpic_lock, iflags); + v = mpic_irq_read(hw, MPIC_IRQ_VECTOR_PRI); + vecpri = (v & + ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK)) | + vecpri; + if (vecpri != v) + mpic_irq_write(hw, MPIC_IRQ_VECTOR_PRI, vecpri); + spin_unlock_irqrestore(&mpic_lock, iflags); + + pr_debug("mpic: mapping as IRQ, vecpri = 0x%08x (was 0x%08x)\n", + vecpri, v); set_irq_chip_data(virq, mpic); set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq); - - /* Set default irq type */ - set_irq_type(virq, IRQ_TYPE_NONE); - return 0; } @@ -714,28 +708,11 @@ static int mpic_host_xlate(struct irq_host *h, struct device_node *ct, }; *out_hwirq = intspec[0]; - if (intsize > 1) { - u32 mask = 0x3; - - /* Apple invented a new race of encoding on machines with - * an HT APIC. They encode, among others, the index within - * the HT APIC. We don't care about it here since thankfully, - * it appears that they have the APIC already properly - * configured, and thus our current fixup code that reads the - * APIC config works fine. However, we still need to mask out - * bits in the specifier to make sure we only get bit 0 which - * is the level/edge bit (the only sense bit exposed by Apple), - * as their bit 1 means something else. - */ - if (machine_is(powermac)) - mask = 0x1; - *out_flags = map_mpic_senses[intspec[1] & mask]; - } else + if (intsize > 1 && intspec[1] < 4) + *out_flags = map_mpic_senses[intspec[1]]; + else *out_flags = IRQ_TYPE_NONE; - DBG("mpic: xlate (%d cells: 0x%08x 0x%08x) to line 0x%lx sense 0x%x\n", - intsize, intspec[0], intspec[1], *out_hwirq, *out_flags); - return 0; } @@ -929,16 +906,41 @@ void __init mpic_init(struct mpic *mpic) if (mpic->irq_count == 0) mpic->irq_count = mpic->num_sources; +#ifdef CONFIG_MPIC_BROKEN_U3 /* Do the HT PIC fixups on U3 broken mpic */ DBG("MPIC flags: %x\n", mpic->flags); if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY)) mpic_scan_ht_pics(mpic); +#endif /* CONFIG_MPIC_BROKEN_U3 */ for (i = 0; i < mpic->num_sources; i++) { /* start with vector = source number, and masked */ - u32 vecpri = MPIC_VECPRI_MASK | i | - (8 << MPIC_VECPRI_PRIORITY_SHIFT); + u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT); + int level = 1; + /* do senses munging */ + if (mpic->senses && i < mpic->senses_count) + vecpri |= mpic_flags_to_vecpri(mpic->senses[i], + &level); + else + vecpri |= MPIC_VECPRI_SENSE_LEVEL; + + /* deal with broken U3 */ + if (mpic->flags & MPIC_BROKEN_U3) { +#ifdef CONFIG_MPIC_BROKEN_U3 + if (mpic_is_ht_interrupt(mpic, i)) { + vecpri &= ~(MPIC_VECPRI_SENSE_MASK | + MPIC_VECPRI_POLARITY_MASK); + vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; + } +#else + printk(KERN_ERR "mpic: BROKEN_U3 set, but CONFIG doesn't match\n"); +#endif + } + + DBG("setup source %d, vecpri: %08x, level: %d\n", i, vecpri, + (level != 0)); + /* init hw */ mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri); mpic_irq_write(i, MPIC_IRQ_DESTINATION, @@ -1152,7 +1154,7 @@ void mpic_request_ipis(void) for (i = 0; i < 4; i++) { unsigned int vipi = irq_create_mapping(mpic->irqhost, - MPIC_VEC_IPI_0 + i); + MPIC_VEC_IPI_0 + i, 0); if (vipi == NO_IRQ) { printk(KERN_ERR "Failed to map IPI %d\n", i); break; diff --git a/trunk/arch/ppc/kernel/ppc_ksyms.c b/trunk/arch/ppc/kernel/ppc_ksyms.c index d1735401384c..50c1b4739ca7 100644 --- a/trunk/arch/ppc/kernel/ppc_ksyms.c +++ b/trunk/arch/ppc/kernel/ppc_ksyms.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/setup.c b/trunk/arch/ppc/kernel/setup.c index a74f46d9826f..faf2940300b0 100644 --- a/trunk/arch/ppc/kernel/setup.c +++ b/trunk/arch/ppc/kernel/setup.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/prep_setup.c b/trunk/arch/ppc/platforms/prep_setup.c index 1cb75a1f825e..6436beffdc96 100644 --- a/trunk/arch/ppc/platforms/prep_setup.c +++ b/trunk/arch/ppc/platforms/prep_setup.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/s390/Kconfig b/trunk/arch/s390/Kconfig index ae071a11ce71..224fbff79969 100644 --- a/trunk/arch/s390/Kconfig +++ b/trunk/arch/s390/Kconfig @@ -118,6 +118,13 @@ config SYSVIPC_COMPAT depends on COMPAT && SYSVIPC default y +config BINFMT_ELF32 + tristate "Kernel support for 31 bit ELF binaries" + depends on COMPAT + help + This allows you to run 32-bit Linux/ELF binaries on your zSeries + in 64 bit mode. Everybody wants this; say Y. + comment "Code generation options" choice diff --git a/trunk/arch/s390/hypfs/hypfs_diag.c b/trunk/arch/s390/hypfs/hypfs_diag.c index 1785bce2b919..efa74af7f04a 100644 --- a/trunk/arch/s390/hypfs/hypfs_diag.c +++ b/trunk/arch/s390/hypfs/hypfs_diag.c @@ -403,7 +403,7 @@ static void *diag204_get_buffer(enum diag204_format fmt, int *pages) *pages = 1; return diag204_alloc_rbuf(); } else {/* INFO_EXT */ - *pages = diag204(SUBC_RSI | INFO_EXT, 0, NULL); + *pages = diag204(SUBC_RSI | INFO_EXT, 0, 0); if (*pages <= 0) return ERR_PTR(-ENOSYS); else diff --git a/trunk/arch/s390/kernel/Makefile b/trunk/arch/s390/kernel/Makefile index 86601a945709..eabf00a6f770 100644 --- a/trunk/arch/s390/kernel/Makefile +++ b/trunk/arch/s390/kernel/Makefile @@ -17,8 +17,8 @@ obj-$(CONFIG_MODULES) += s390_ksyms.o module.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \ - compat_wrapper.o compat_exec_domain.o \ - binfmt_elf32.o + compat_wrapper.o compat_exec_domain.o +obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o obj-$(CONFIG_VIRT_TIMER) += vtime.o obj-$(CONFIG_STACKTRACE) += stacktrace.o diff --git a/trunk/arch/s390/kernel/compat_linux.c b/trunk/arch/s390/kernel/compat_linux.c index 785c9f70ac98..cabb4ff54cd7 100644 --- a/trunk/arch/s390/kernel/compat_linux.c +++ b/trunk/arch/s390/kernel/compat_linux.c @@ -409,7 +409,7 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info) mm_segment_t old_fs = get_fs (); set_fs (KERNEL_DS); - ret = sys_sysinfo((struct sysinfo __user *) &s); + ret = sys_sysinfo(&s); set_fs (old_fs); err = put_user (s.uptime, &info->uptime); err |= __put_user (s.loads[0], &info->loads[0]); @@ -438,7 +438,7 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid, mm_segment_t old_fs = get_fs (); set_fs (KERNEL_DS); - ret = sys_sched_rr_get_interval(pid, (struct timespec __user *) &t); + ret = sys_sched_rr_get_interval(pid, &t); set_fs (old_fs); if (put_compat_timespec(&t, interval)) return -EFAULT; @@ -464,10 +464,7 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, } } set_fs (KERNEL_DS); - ret = sys_rt_sigprocmask(how, - set ? (sigset_t __user *) &s : NULL, - oset ? (sigset_t __user *) &s : NULL, - sigsetsize); + ret = sys_rt_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL, sigsetsize); set_fs (old_fs); if (ret) return ret; if (oset) { @@ -492,7 +489,7 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, mm_segment_t old_fs = get_fs(); set_fs (KERNEL_DS); - ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize); + ret = sys_rt_sigpending(&s, sigsetsize); set_fs (old_fs); if (!ret) { switch (_NSIG_WORDS) { @@ -517,7 +514,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) if (copy_siginfo_from_user32(&info, uinfo)) return -EFAULT; set_fs (KERNEL_DS); - ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info); + ret = sys_rt_sigqueueinfo(pid, sig, &info); set_fs (old_fs); return ret; } @@ -677,8 +674,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offse return -EFAULT; set_fs(KERNEL_DS); - ret = sys_sendfile(out_fd, in_fd, - offset ? (off_t __user *) &of : NULL, count); + ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); set_fs(old_fs); if (offset && put_user(of, offset)) @@ -698,8 +694,7 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd, return -EFAULT; set_fs(KERNEL_DS); - ret = sys_sendfile64(out_fd, in_fd, - offset ? (loff_t __user *) &lof : NULL, count); + ret = sys_sendfile64(out_fd, in_fd, offset ? &lof : NULL, count); set_fs(old_fs); if (offset && put_user(lof, offset)) diff --git a/trunk/arch/s390/kernel/machine_kexec.c b/trunk/arch/s390/kernel/machine_kexec.c index 60b1ea9f946b..fbde6a915264 100644 --- a/trunk/arch/s390/kernel/machine_kexec.c +++ b/trunk/arch/s390/kernel/machine_kexec.c @@ -63,7 +63,6 @@ NORET_TYPE void machine_kexec(struct kimage *image) { clear_all_subchannels(); - cio_reset_channel_paths(); /* Disable lowcore protection */ ctl_clear_bit(0,28); diff --git a/trunk/arch/s390/kernel/module.c b/trunk/arch/s390/kernel/module.c index d989ed45a7aa..c271cdab58e2 100644 --- a/trunk/arch/s390/kernel/module.c +++ b/trunk/arch/s390/kernel/module.c @@ -119,7 +119,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, int nrela, i, j; /* Find symbol table and string table. */ - symtab = NULL; + symtab = 0; for (i = 0; i < hdr->e_shnum; i++) switch (sechdrs[i].sh_type) { case SHT_SYMTAB: diff --git a/trunk/arch/s390/kernel/process.c b/trunk/arch/s390/kernel/process.c index d3cbfa3005ec..78c8e5548caf 100644 --- a/trunk/arch/s390/kernel/process.c +++ b/trunk/arch/s390/kernel/process.c @@ -172,7 +172,7 @@ void show_regs(struct pt_regs *regs) show_registers(regs); /* Show stack backtrace if pt_regs is from kernel mode */ if (!(regs->psw.mask & PSW_MASK_PSTATE)) - show_trace(NULL, (unsigned long *) regs->gprs[15]); + show_trace(0,(unsigned long *) regs->gprs[15]); } extern void kernel_thread_starter(void); diff --git a/trunk/arch/s390/kernel/profile.c b/trunk/arch/s390/kernel/profile.c index b81aa1f569ca..7ba777eec1a8 100644 --- a/trunk/arch/s390/kernel/profile.c +++ b/trunk/arch/s390/kernel/profile.c @@ -13,7 +13,7 @@ static struct proc_dir_entry * root_irq_dir; void init_irq_proc(void) { /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", NULL); + root_irq_dir = proc_mkdir("irq", 0); /* create /proc/irq/prof_cpu_mask */ create_prof_cpu_mask(root_irq_dir); diff --git a/trunk/arch/s390/kernel/s390_ext.c b/trunk/arch/s390/kernel/s390_ext.c index c1b383537fec..207bc511a6e3 100644 --- a/trunk/arch/s390/kernel/s390_ext.c +++ b/trunk/arch/s390/kernel/s390_ext.c @@ -24,7 +24,7 @@ * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 * iucv and 0x2603 pfault) this is always the first element. */ -ext_int_info_t *ext_int_hash[256] = { NULL, }; +ext_int_info_t *ext_int_hash[256] = { 0, }; static inline int ext_hash(__u16 code) { diff --git a/trunk/arch/s390/kernel/time.c b/trunk/arch/s390/kernel/time.c index 74e6178fbaf2..f7fe9bc43397 100644 --- a/trunk/arch/s390/kernel/time.c +++ b/trunk/arch/s390/kernel/time.c @@ -379,7 +379,7 @@ void __init time_init(void) -xtime.tv_sec, -xtime.tv_nsec); /* request the clock comparator external interrupt */ - if (register_early_external_interrupt(0x1004, NULL, + if (register_early_external_interrupt(0x1004, 0, &ext_int_info_cc) != 0) panic("Couldn't request external interrupt 0x1004"); diff --git a/trunk/arch/s390/kernel/traps.c b/trunk/arch/s390/kernel/traps.c index bde1d1d59858..12240c03a6dd 100644 --- a/trunk/arch/s390/kernel/traps.c +++ b/trunk/arch/s390/kernel/traps.c @@ -170,7 +170,7 @@ void show_stack(struct task_struct *task, unsigned long *sp) */ void dump_stack(void) { - show_stack(NULL, NULL); + show_stack(0, 0); } EXPORT_SYMBOL(dump_stack); @@ -331,9 +331,9 @@ static void inline do_trap(long interruption_code, int signr, char *str, } } -static inline void __user *get_check_address(struct pt_regs *regs) +static inline void *get_check_address(struct pt_regs *regs) { - return (void __user *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN); + return (void *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN); } void do_single_step(struct pt_regs *regs) @@ -360,7 +360,7 @@ asmlinkage void name(struct pt_regs * regs, long interruption_code) \ info.si_signo = signr; \ info.si_errno = 0; \ info.si_code = sicode; \ - info.si_addr = siaddr; \ + info.si_addr = (void *)siaddr; \ do_trap(interruption_code, signr, str, regs, &info); \ } @@ -392,7 +392,7 @@ DO_ERROR_INFO(SIGILL, "translation exception", translation_exception, ILL_ILLOPN, get_check_address(regs)) static inline void -do_fp_trap(struct pt_regs *regs, void __user *location, +do_fp_trap(struct pt_regs *regs, void *location, int fpc, long interruption_code) { siginfo_t si; @@ -424,10 +424,10 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) { siginfo_t info; __u8 opcode[6]; - __u16 __user *location; + __u16 *location; int signal = 0; - location = get_check_address(regs); + location = (__u16 *) get_check_address(regs); /* * We got all needed information from the lowcore and can @@ -559,10 +559,10 @@ DO_ERROR_INFO(SIGILL, "specification exception", specification_exception, asmlinkage void data_exception(struct pt_regs * regs, long interruption_code) { - __u16 __user *location; + __u16 *location; int signal = 0; - location = get_check_address(regs); + location = (__u16 *) get_check_address(regs); /* * We got all needed information from the lowcore and can diff --git a/trunk/arch/s390/lib/string.c b/trunk/arch/s390/lib/string.c index ae5cf5d03d41..8240cc77e06e 100644 --- a/trunk/arch/s390/lib/string.c +++ b/trunk/arch/s390/lib/string.c @@ -233,7 +233,7 @@ char * strrchr(const char * s, int c) if (s[len] == (char) c) return (char *) s + len; } while (--len > 0); - return NULL; + return 0; } EXPORT_SYMBOL(strrchr); @@ -267,7 +267,7 @@ char * strstr(const char * s1,const char * s2) return (char *) s1; s1++; } - return NULL; + return 0; } EXPORT_SYMBOL(strstr); diff --git a/trunk/arch/s390/mm/cmm.c b/trunk/arch/s390/mm/cmm.c index ceea51cff03b..81be2fec7dc5 100644 --- a/trunk/arch/s390/mm/cmm.c +++ b/trunk/arch/s390/mm/cmm.c @@ -161,7 +161,7 @@ cmm_thread(void *dummy) static void cmm_start_thread(void) { - kernel_thread(cmm_thread, NULL, 0); + kernel_thread(cmm_thread, 0, 0); } static void diff --git a/trunk/arch/s390/mm/fault.c b/trunk/arch/s390/mm/fault.c index 7cd82575813d..833d5941746a 100644 --- a/trunk/arch/s390/mm/fault.c +++ b/trunk/arch/s390/mm/fault.c @@ -144,7 +144,7 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long error_code, #endif si.si_signo = SIGSEGV; si.si_code = si_code; - si.si_addr = (void __user *) address; + si.si_addr = (void *) address; force_sig_info(SIGSEGV, &si, current); } diff --git a/trunk/arch/sh/kernel/setup.c b/trunk/arch/sh/kernel/setup.c index e75189cb1db7..9af22116c9a2 100644 --- a/trunk/arch/sh/kernel/setup.c +++ b/trunk/arch/sh/kernel/setup.c @@ -10,7 +10,7 @@ * This file handles the architecture-dependent parts of initialization */ -#include +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/setup.c b/trunk/arch/sh64/kernel/setup.c index ffb310e33cef..0359fa647bbc 100644 --- a/trunk/arch/sh64/kernel/setup.c +++ b/trunk/arch/sh64/kernel/setup.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/sh_ksyms.c b/trunk/arch/sh64/kernel/sh_ksyms.c index 4b2df7247b59..6efdfa2c3994 100644 --- a/trunk/arch/sh64/kernel/sh_ksyms.c +++ b/trunk/arch/sh64/kernel/sh_ksyms.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/arch/sparc/kernel/of_device.c b/trunk/arch/sparc/kernel/of_device.c index 5a2faad5d043..bc956c530376 100644 --- a/trunk/arch/sparc/kernel/of_device.c +++ b/trunk/arch/sparc/kernel/of_device.c @@ -183,7 +183,7 @@ struct bus_type of_bus_type = { }; EXPORT_SYMBOL(of_bus_type); -static inline u64 of_read_addr(const u32 *cell, int size) +static inline u64 of_read_addr(u32 *cell, int size) { u64 r = 0; while (size--) @@ -209,8 +209,8 @@ struct of_bus { int (*match)(struct device_node *parent); void (*count_cells)(struct device_node *child, int *addrc, int *sizec); - int (*map)(u32 *addr, const u32 *range, - int na, int ns, int pna); + u64 (*map)(u32 *addr, u32 *range, int na, int ns, int pna); + int (*translate)(u32 *addr, u64 offset, int na); unsigned int (*get_flags)(u32 *addr); }; @@ -224,49 +224,27 @@ static void of_bus_default_count_cells(struct device_node *dev, get_cells(dev, addrc, sizec); } -/* Make sure the least significant 64-bits are in-range. Even - * for 3 or 4 cell values it is a good enough approximation. - */ -static int of_out_of_range(const u32 *addr, const u32 *base, - const u32 *size, int na, int ns) +static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna) { - u64 a = of_read_addr(addr, na); - u64 b = of_read_addr(base, na); - - if (a < b) - return 1; + u64 cp, s, da; - b += of_read_addr(size, ns); - if (a >= b) - return 1; + cp = of_read_addr(range, na); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr, na); - return 0; + if (da < cp || da >= (cp + s)) + return OF_BAD_ADDR; + return da - cp; } -static int of_bus_default_map(u32 *addr, const u32 *range, - int na, int ns, int pna) +static int of_bus_default_translate(u32 *addr, u64 offset, int na) { - u32 result[OF_MAX_ADDR_CELLS]; - int i; - - if (ns > 2) { - printk("of_device: Cannot handle size cells (%d) > 2.", ns); - return -EINVAL; - } - - if (of_out_of_range(addr, range, range + na + pna, na, ns)) - return -EINVAL; - - /* Start with the parent range base. */ - memcpy(result, range + na, pna * 4); - - /* Add in the child address offset. */ - for (i = 0; i < na; i++) - result[pna - 1 - i] += - (addr[na - 1 - i] - - range[na - 1 - i]); - - memcpy(addr, result, pna * 4); + u64 a = of_read_addr(addr, na); + memset(addr, 0, na * 4); + a += offset; + if (na > 1) + addr[na - 2] = a >> 32; + addr[na - 1] = a & 0xffffffffu; return 0; } @@ -276,26 +254,14 @@ static unsigned int of_bus_default_get_flags(u32 *addr) return IORESOURCE_MEM; } + /* * PCI bus specific translator */ static int of_bus_pci_match(struct device_node *np) { - if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) { - /* Do not do PCI specific frobbing if the - * PCI bridge lacks a ranges property. We - * want to pass it through up to the next - * parent as-is, not with the PCI translate - * method which chops off the top address cell. - */ - if (!of_find_property(np, "ranges", NULL)) - return 0; - - return 1; - } - - return 0; + return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex"); } static void of_bus_pci_count_cells(struct device_node *np, @@ -307,32 +273,27 @@ static void of_bus_pci_count_cells(struct device_node *np, *sizec = 2; } -static int of_bus_pci_map(u32 *addr, const u32 *range, - int na, int ns, int pna) +static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna) { - u32 result[OF_MAX_ADDR_CELLS]; - int i; + u64 cp, s, da; /* Check address type match */ if ((addr[0] ^ range[0]) & 0x03000000) - return -EINVAL; - - if (of_out_of_range(addr + 1, range + 1, range + na + pna, - na - 1, ns)) - return -EINVAL; + return OF_BAD_ADDR; - /* Start with the parent range base. */ - memcpy(result, range + na, pna * 4); + /* Read address values, skipping high cell */ + cp = of_read_addr(range + 1, na - 1); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr + 1, na - 1); - /* Add in the child address offset, skipping high cell. */ - for (i = 0; i < na - 1; i++) - result[pna - 1 - i] += - (addr[na - 1 - i] - - range[na - 1 - i]); - - memcpy(addr, result, pna * 4); + if (da < cp || da >= (cp + s)) + return OF_BAD_ADDR; + return da - cp; +} - return 0; +static int of_bus_pci_translate(u32 *addr, u64 offset, int na) +{ + return of_bus_default_translate(addr + 1, offset, na - 1); } static unsigned int of_bus_pci_get_flags(u32 *addr) @@ -371,11 +332,16 @@ static void of_bus_sbus_count_cells(struct device_node *child, *sizec = 1; } -static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna) +static u64 of_bus_sbus_map(u32 *addr, u32 *range, int na, int ns, int pna) { return of_bus_default_map(addr, range, na, ns, pna); } +static int of_bus_sbus_translate(u32 *addr, u64 offset, int na) +{ + return of_bus_default_translate(addr, offset, na); +} + static unsigned int of_bus_sbus_get_flags(u32 *addr) { return IORESOURCE_MEM; @@ -394,6 +360,7 @@ static struct of_bus of_busses[] = { .match = of_bus_pci_match, .count_cells = of_bus_pci_count_cells, .map = of_bus_pci_map, + .translate = of_bus_pci_translate, .get_flags = of_bus_pci_get_flags, }, /* SBUS */ @@ -403,6 +370,7 @@ static struct of_bus of_busses[] = { .match = of_bus_sbus_match, .count_cells = of_bus_sbus_count_cells, .map = of_bus_sbus_map, + .translate = of_bus_sbus_translate, .get_flags = of_bus_sbus_get_flags, }, /* Default */ @@ -412,6 +380,7 @@ static struct of_bus of_busses[] = { .match = NULL, .count_cells = of_bus_default_count_cells, .map = of_bus_default_map, + .translate = of_bus_default_translate, .get_flags = of_bus_default_get_flags, }, }; @@ -436,33 +405,32 @@ static int __init build_one_resource(struct device_node *parent, u32 *ranges; unsigned int rlen; int rone; + u64 offset = OF_BAD_ADDR; ranges = of_get_property(parent, "ranges", &rlen); if (ranges == NULL || rlen == 0) { - u32 result[OF_MAX_ADDR_CELLS]; - int i; - - memset(result, 0, pna * 4); - for (i = 0; i < na; i++) - result[pna - 1 - i] = - addr[na - 1 - i]; - - memcpy(addr, result, pna * 4); - return 0; + offset = of_read_addr(addr, na); + memset(addr, 0, pna * 4); + goto finish; } /* Now walk through the ranges */ rlen /= 4; rone = na + pna + ns; for (; rlen >= rone; rlen -= rone, ranges += rone) { - if (!bus->map(addr, ranges, na, ns, pna)) - return 0; + offset = bus->map(addr, ranges, na, ns, pna); + if (offset != OF_BAD_ADDR) + break; } + if (offset == OF_BAD_ADDR) + return 1; - return 1; -} + memcpy(addr, ranges + na, 4 * pna); -static int of_resource_verbose; +finish: + /* Translate it into parent bus space */ + return pbus->translate(addr, offset, pna); +} static void __init build_device_resources(struct of_device *op, struct device *parent) @@ -529,8 +497,7 @@ static void __init build_device_resources(struct of_device *op, pbus = of_match_bus(pp); pbus->count_cells(dp, &pna, &pns); - if (build_one_resource(dp, bus, pbus, addr, - dna, dns, pna)) + if (build_one_resource(dp, bus, pbus, addr, dna, dns, pna)) break; dna = pna; @@ -540,12 +507,6 @@ static void __init build_device_resources(struct of_device *op, build_res: memset(r, 0, sizeof(*r)); - - if (of_resource_verbose) - printk("%s reg[%d] -> %llx\n", - op->node->full_name, index, - result); - if (result != OF_BAD_ADDR) { r->start = result & 0xffffffff; r->end = result + size - 1; @@ -682,18 +643,6 @@ static int __init of_bus_driver_init(void) postcore_initcall(of_bus_driver_init); -static int __init of_debug(char *str) -{ - int val = 0; - - get_option(&str, &val); - if (val & 1) - of_resource_verbose = 1; - return 1; -} - -__setup("of_debug=", of_debug); - int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) { /* initialize common driver fields */ @@ -746,11 +695,9 @@ int of_device_register(struct of_device *ofdev) if (rc) return rc; - rc = device_create_file(&ofdev->dev, &dev_attr_devspec); - if (rc) - device_unregister(&ofdev->dev); + device_create_file(&ofdev->dev, &dev_attr_devspec); - return rc; + return 0; } void of_device_unregister(struct of_device *ofdev) diff --git a/trunk/arch/sparc/kernel/setup.c b/trunk/arch/sparc/kernel/setup.c index 35488d6c7457..8606ef4e52e9 100644 --- a/trunk/arch/sparc/kernel/setup.c +++ b/trunk/arch/sparc/kernel/setup.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/sparc64/Kconfig b/trunk/arch/sparc64/Kconfig index 8a36ba8868db..a7a111db25b2 100644 --- a/trunk/arch/sparc64/Kconfig +++ b/trunk/arch/sparc64/Kconfig @@ -334,7 +334,7 @@ config COMPAT default y config BINFMT_ELF32 - bool "Kernel support for 32-bit ELF binaries" + tristate "Kernel support for 32-bit ELF binaries" depends on SPARC32_COMPAT help This allows you to run 32-bit Linux/ELF binaries on your Ultra. diff --git a/trunk/arch/sparc64/defconfig b/trunk/arch/sparc64/defconfig index 38353621069e..b2f41147d0e4 100644 --- a/trunk/arch/sparc64/defconfig +++ b/trunk/arch/sparc64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc1 -# Wed Jul 12 14:00:58 2006 +# Linux kernel version: 2.6.17 +# Fri Jun 23 23:17:09 2006 # CONFIG_SPARC=y CONFIG_SPARC64=y @@ -18,7 +18,6 @@ CONFIG_SECCOMP=y CONFIG_HZ_250=y # CONFIG_HZ_1000 is not set CONFIG_HZ=250 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options @@ -52,12 +51,10 @@ 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 @@ -130,8 +127,8 @@ CONFIG_SPARSEMEM=y CONFIG_HAVE_MEMORY_PRESENT=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPARSEMEM_EXTREME=y +CONFIG_MEMORY_HOTPLUG=y CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_RESOURCES_64BIT=y CONFIG_GENERIC_ISA_DMA=y CONFIG_SBUS=y CONFIG_SBUSCHAR=y @@ -206,6 +203,7 @@ CONFIG_TCP_CONG_VEGAS=m CONFIG_TCP_CONG_SCALABLE=m CONFIG_TCP_CONG_LP=m CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_COMPOUND=m CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y CONFIG_IPV6_ROUTER_PREF=y @@ -463,8 +461,9 @@ CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m -CONFIG_MD_RAID456=m +CONFIG_MD_RAID5=m # CONFIG_MD_RAID5_RESHAPE is not set +CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m # CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m @@ -664,7 +663,6 @@ CONFIG_SERIO_RAW=m 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 # @@ -695,7 +693,6 @@ CONFIG_UNIX98_PTYS=y # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_HW_RANDOM is not set CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -842,13 +839,12 @@ 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 is not set -# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_FIRMWARE_EDID is not set CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y # CONFIG_FB_CIRRUS is not set @@ -958,18 +954,6 @@ CONFIG_SND_ALI5451=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 @@ -1279,7 +1263,6 @@ CONFIG_RAMFS=y # CONFIG_NFSD 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 @@ -1348,19 +1331,14 @@ CONFIG_KPROBES=y # CONFIG_PRINTK_TIME=y CONFIG_MAGIC_SYSRQ=y -# CONFIG_UNUSED_SYMBOLS is not set CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_DETECT_SOFTLOCKUP=y CONFIG_SCHEDSTATS=y # CONFIG_DEBUG_SLAB 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 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_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set @@ -1424,4 +1402,3 @@ CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y diff --git a/trunk/arch/sparc64/kernel/of_device.c b/trunk/arch/sparc64/kernel/of_device.c index 7064cee290ae..169b017eec0b 100644 --- a/trunk/arch/sparc64/kernel/of_device.c +++ b/trunk/arch/sparc64/kernel/of_device.c @@ -210,7 +210,7 @@ struct bus_type of_bus_type = { }; EXPORT_SYMBOL(of_bus_type); -static inline u64 of_read_addr(const u32 *cell, int size) +static inline u64 of_read_addr(u32 *cell, int size) { u64 r = 0; while (size--) @@ -236,8 +236,8 @@ struct of_bus { int (*match)(struct device_node *parent); void (*count_cells)(struct device_node *child, int *addrc, int *sizec); - int (*map)(u32 *addr, const u32 *range, - int na, int ns, int pna); + u64 (*map)(u32 *addr, u32 *range, int na, int ns, int pna); + int (*translate)(u32 *addr, u64 offset, int na); unsigned int (*get_flags)(u32 *addr); }; @@ -251,49 +251,27 @@ static void of_bus_default_count_cells(struct device_node *dev, get_cells(dev, addrc, sizec); } -/* Make sure the least significant 64-bits are in-range. Even - * for 3 or 4 cell values it is a good enough approximation. - */ -static int of_out_of_range(const u32 *addr, const u32 *base, - const u32 *size, int na, int ns) +static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna) { - u64 a = of_read_addr(addr, na); - u64 b = of_read_addr(base, na); + u64 cp, s, da; - if (a < b) - return 1; + cp = of_read_addr(range, na); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr, na); - b += of_read_addr(size, ns); - if (a >= b) - return 1; - - return 0; + if (da < cp || da >= (cp + s)) + return OF_BAD_ADDR; + return da - cp; } -static int of_bus_default_map(u32 *addr, const u32 *range, - int na, int ns, int pna) +static int of_bus_default_translate(u32 *addr, u64 offset, int na) { - u32 result[OF_MAX_ADDR_CELLS]; - int i; - - if (ns > 2) { - printk("of_device: Cannot handle size cells (%d) > 2.", ns); - return -EINVAL; - } - - if (of_out_of_range(addr, range, range + na + pna, na, ns)) - return -EINVAL; - - /* Start with the parent range base. */ - memcpy(result, range + na, pna * 4); - - /* Add in the child address offset. */ - for (i = 0; i < na; i++) - result[pna - 1 - i] += - (addr[na - 1 - i] - - range[na - 1 - i]); - - memcpy(addr, result, pna * 4); + u64 a = of_read_addr(addr, na); + memset(addr, 0, na * 4); + a += offset; + if (na > 1) + addr[na - 2] = a >> 32; + addr[na - 1] = a & 0xffffffffu; return 0; } @@ -309,20 +287,7 @@ static unsigned int of_bus_default_get_flags(u32 *addr) static int of_bus_pci_match(struct device_node *np) { - if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) { - /* Do not do PCI specific frobbing if the - * PCI bridge lacks a ranges property. We - * want to pass it through up to the next - * parent as-is, not with the PCI translate - * method which chops off the top address cell. - */ - if (!of_find_property(np, "ranges", NULL)) - return 0; - - return 1; - } - - return 0; + return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex"); } static void of_bus_pci_count_cells(struct device_node *np, @@ -334,32 +299,27 @@ static void of_bus_pci_count_cells(struct device_node *np, *sizec = 2; } -static int of_bus_pci_map(u32 *addr, const u32 *range, - int na, int ns, int pna) +static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna) { - u32 result[OF_MAX_ADDR_CELLS]; - int i; + u64 cp, s, da; /* Check address type match */ if ((addr[0] ^ range[0]) & 0x03000000) - return -EINVAL; + return OF_BAD_ADDR; - if (of_out_of_range(addr + 1, range + 1, range + na + pna, - na - 1, ns)) - return -EINVAL; + /* Read address values, skipping high cell */ + cp = of_read_addr(range + 1, na - 1); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr + 1, na - 1); - /* Start with the parent range base. */ - memcpy(result, range + na, pna * 4); - - /* Add in the child address offset, skipping high cell. */ - for (i = 0; i < na - 1; i++) - result[pna - 1 - i] += - (addr[na - 1 - i] - - range[na - 1 - i]); - - memcpy(addr, result, pna * 4); + if (da < cp || da >= (cp + s)) + return OF_BAD_ADDR; + return da - cp; +} - return 0; +static int of_bus_pci_translate(u32 *addr, u64 offset, int na) +{ + return of_bus_default_translate(addr + 1, offset, na - 1); } static unsigned int of_bus_pci_get_flags(u32 *addr) @@ -379,6 +339,59 @@ static unsigned int of_bus_pci_get_flags(u32 *addr) return flags; } +/* + * ISA bus specific translator + */ + +static int of_bus_isa_match(struct device_node *np) +{ + return !strcmp(np->name, "isa"); +} + +static void of_bus_isa_count_cells(struct device_node *child, + int *addrc, int *sizec) +{ + if (addrc) + *addrc = 2; + if (sizec) + *sizec = 1; +} + +static u64 of_bus_isa_map(u32 *addr, u32 *range, int na, int ns, int pna) +{ + u64 cp, s, da; + + /* Check address type match */ + if ((addr[0] ^ range[0]) & 0x00000001) + return OF_BAD_ADDR; + + /* Read address values, skipping high cell */ + cp = of_read_addr(range + 1, na - 1); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr + 1, na - 1); + + if (da < cp || da >= (cp + s)) + return OF_BAD_ADDR; + return da - cp; +} + +static int of_bus_isa_translate(u32 *addr, u64 offset, int na) +{ + return of_bus_default_translate(addr + 1, offset, na - 1); +} + +static unsigned int of_bus_isa_get_flags(u32 *addr) +{ + unsigned int flags = 0; + u32 w = addr[0]; + + if (w & 1) + flags |= IORESOURCE_IO; + else + flags |= IORESOURCE_MEM; + return flags; +} + /* * SBUS bus specific translator */ @@ -398,11 +411,16 @@ static void of_bus_sbus_count_cells(struct device_node *child, *sizec = 1; } -static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna) +static u64 of_bus_sbus_map(u32 *addr, u32 *range, int na, int ns, int pna) { return of_bus_default_map(addr, range, na, ns, pna); } +static int of_bus_sbus_translate(u32 *addr, u64 offset, int na) +{ + return of_bus_default_translate(addr, offset, na); +} + static unsigned int of_bus_sbus_get_flags(u32 *addr) { return IORESOURCE_MEM; @@ -421,8 +439,19 @@ static struct of_bus of_busses[] = { .match = of_bus_pci_match, .count_cells = of_bus_pci_count_cells, .map = of_bus_pci_map, + .translate = of_bus_pci_translate, .get_flags = of_bus_pci_get_flags, }, + /* ISA */ + { + .name = "isa", + .addr_prop_name = "reg", + .match = of_bus_isa_match, + .count_cells = of_bus_isa_count_cells, + .map = of_bus_isa_map, + .translate = of_bus_isa_translate, + .get_flags = of_bus_isa_get_flags, + }, /* SBUS */ { .name = "sbus", @@ -430,6 +459,7 @@ static struct of_bus of_busses[] = { .match = of_bus_sbus_match, .count_cells = of_bus_sbus_count_cells, .map = of_bus_sbus_map, + .translate = of_bus_sbus_translate, .get_flags = of_bus_sbus_get_flags, }, /* Default */ @@ -439,6 +469,7 @@ static struct of_bus of_busses[] = { .match = NULL, .count_cells = of_bus_default_count_cells, .map = of_bus_default_map, + .translate = of_bus_default_translate, .get_flags = of_bus_default_get_flags, }, }; @@ -463,62 +494,33 @@ static int __init build_one_resource(struct device_node *parent, u32 *ranges; unsigned int rlen; int rone; + u64 offset = OF_BAD_ADDR; ranges = of_get_property(parent, "ranges", &rlen); if (ranges == NULL || rlen == 0) { - u32 result[OF_MAX_ADDR_CELLS]; - int i; - - memset(result, 0, pna * 4); - for (i = 0; i < na; i++) - result[pna - 1 - i] = - addr[na - 1 - i]; - - memcpy(addr, result, pna * 4); - return 0; + offset = of_read_addr(addr, na); + memset(addr, 0, pna * 4); + goto finish; } /* Now walk through the ranges */ rlen /= 4; rone = na + pna + ns; for (; rlen >= rone; rlen -= rone, ranges += rone) { - if (!bus->map(addr, ranges, na, ns, pna)) - return 0; + offset = bus->map(addr, ranges, na, ns, pna); + if (offset != OF_BAD_ADDR) + break; } - - return 1; -} - -static int __init use_1to1_mapping(struct device_node *pp) -{ - char *model; - - /* If this is on the PMU bus, don't try to translate it even - * if a ranges property exists. - */ - if (!strcmp(pp->name, "pmu")) + if (offset == OF_BAD_ADDR) return 1; - /* If we have a ranges property in the parent, use it. */ - if (of_find_property(pp, "ranges", NULL) != NULL) - return 0; - - /* If the parent is the dma node of an ISA bus, pass - * the translation up to the root. - */ - if (!strcmp(pp->name, "dma")) - return 0; - - /* Similarly for Simba PCI bridges. */ - model = of_get_property(pp, "model", NULL); - if (model && !strcmp(model, "SUNW,simba")) - return 0; + memcpy(addr, ranges + na, 4 * pna); - return 1; +finish: + /* Translate it into parent bus space */ + return pbus->translate(addr, offset, pna); } -static int of_resource_verbose; - static void __init build_device_resources(struct of_device *op, struct device *parent) { @@ -562,7 +564,15 @@ static void __init build_device_resources(struct of_device *op, memcpy(addr, reg, na * 4); - if (use_1to1_mapping(pp)) { + /* If the immediate parent has no ranges property to apply, + * just use a 1<->1 mapping. Unless it is the 'dma' child + * of an isa bus, which must be passed up towards the root. + * + * Also, don't try to translate PMU bus device registers. + */ + if ((of_find_property(pp, "ranges", NULL) == NULL && + strcmp(pp->name, "dma") != 0) || + !strcmp(pp->name, "pmu")) { result = of_read_addr(addr, na); goto build_res; } @@ -581,8 +591,7 @@ static void __init build_device_resources(struct of_device *op, pbus = of_match_bus(pp); pbus->count_cells(dp, &pna, &pns); - if (build_one_resource(dp, bus, pbus, addr, - dna, dns, pna)) + if (build_one_resource(dp, bus, pbus, addr, dna, dns, pna)) break; dna = pna; @@ -592,12 +601,6 @@ static void __init build_device_resources(struct of_device *op, build_res: memset(r, 0, sizeof(*r)); - - if (of_resource_verbose) - printk("%s reg[%d] -> %lx\n", - op->node->full_name, index, - result); - if (result != OF_BAD_ADDR) { if (tlb_type == hypervisor) result &= 0x0fffffffffffffffUL; @@ -681,8 +684,6 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp, return ret; } -static int of_irq_verbose; - static unsigned int __init build_one_device_irq(struct of_device *op, struct device *parent, unsigned int irq) @@ -697,11 +698,10 @@ static unsigned int __init build_one_device_irq(struct of_device *op, if (dp->irq_trans) { irq = dp->irq_trans->irq_build(dp, irq, dp->irq_trans->data); - - if (of_irq_verbose) - printk("%s: direct translate %x --> %x\n", - dp->full_name, orig_irq, irq); - +#if 1 + printk("%s: direct translate %x --> %x\n", + dp->full_name, orig_irq, irq); +#endif return irq; } @@ -728,13 +728,12 @@ static unsigned int __init build_one_device_irq(struct of_device *op, iret = apply_interrupt_map(dp, pp, imap, imlen, imsk, &irq); - - if (of_irq_verbose) - printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", - op->node->full_name, - pp->full_name, this_orig_irq, - (iret ? iret->full_name : "NULL"), irq); - +#if 1 + printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", + op->node->full_name, + pp->full_name, this_orig_irq, + (iret ? iret->full_name : "NULL"), irq); +#endif if (!iret) break; @@ -748,13 +747,11 @@ static unsigned int __init build_one_device_irq(struct of_device *op, unsigned int this_orig_irq = irq; irq = pci_irq_swizzle(dp, pp, irq); - if (of_irq_verbose) - printk("%s: PCI swizzle [%s] " - "%x --> %x\n", - op->node->full_name, - pp->full_name, this_orig_irq, - irq); - +#if 1 + printk("%s: PCI swizzle [%s] %x --> %x\n", + op->node->full_name, + pp->full_name, this_orig_irq, irq); +#endif } if (pp->irq_trans) { @@ -770,9 +767,10 @@ static unsigned int __init build_one_device_irq(struct of_device *op, irq = ip->irq_trans->irq_build(op->node, irq, ip->irq_trans->data); - if (of_irq_verbose) - printk("%s: Apply IRQ trans [%s] %x --> %x\n", - op->node->full_name, ip->full_name, orig_irq, irq); +#if 1 + printk("%s: Apply IRQ trans [%s] %x --> %x\n", + op->node->full_name, ip->full_name, orig_irq, irq); +#endif return irq; } @@ -872,20 +870,6 @@ static int __init of_bus_driver_init(void) postcore_initcall(of_bus_driver_init); -static int __init of_debug(char *str) -{ - int val = 0; - - get_option(&str, &val); - if (val & 1) - of_resource_verbose = 1; - if (val & 2) - of_irq_verbose = 1; - return 1; -} - -__setup("of_debug=", of_debug); - int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) { /* initialize common driver fields */ @@ -938,11 +922,9 @@ int of_device_register(struct of_device *ofdev) if (rc) return rc; - rc = device_create_file(&ofdev->dev, &dev_attr_devspec); - if (rc) - device_unregister(&ofdev->dev); + device_create_file(&ofdev->dev, &dev_attr_devspec); - return rc; + return 0; } void of_device_unregister(struct of_device *ofdev) diff --git a/trunk/arch/sparc64/kernel/prom.c b/trunk/arch/sparc64/kernel/prom.c index c86007a2aa3f..99daeee4209d 100644 --- a/trunk/arch/sparc64/kernel/prom.c +++ b/trunk/arch/sparc64/kernel/prom.c @@ -539,45 +539,6 @@ static unsigned long __sabre_onboard_imap_off[] = { ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) -static int sabre_device_needs_wsync(struct device_node *dp) -{ - struct device_node *parent = dp->parent; - char *parent_model, *parent_compat; - - /* This traversal up towards the root is meant to - * handle two cases: - * - * 1) non-PCI bus sitting under PCI, such as 'ebus' - * 2) the PCI controller interrupts themselves, which - * will use the sabre_irq_build but do not need - * the DMA synchronization handling - */ - while (parent) { - if (!strcmp(parent->type, "pci")) - break; - parent = parent->parent; - } - - if (!parent) - return 0; - - parent_model = of_get_property(parent, - "model", NULL); - if (parent_model && - (!strcmp(parent_model, "SUNW,sabre") || - !strcmp(parent_model, "SUNW,simba"))) - return 0; - - parent_compat = of_get_property(parent, - "compatible", NULL); - if (parent_compat && - (!strcmp(parent_compat, "pci108e,a000") || - !strcmp(parent_compat, "pci108e,a001"))) - return 0; - - return 1; -} - static unsigned int sabre_irq_build(struct device_node *dp, unsigned int ino, void *_data) @@ -616,17 +577,15 @@ static unsigned int sabre_irq_build(struct device_node *dp, virt_irq = build_irq(inofixup, iclr, imap); - /* If the parent device is a PCI<->PCI bridge other than - * APB, we have to install a pre-handler to ensure that - * all pending DMA is drained before the interrupt handler - * is run. - */ regs = of_get_property(dp, "reg", NULL); - if (regs && sabre_device_needs_wsync(dp)) { + if (regs && + ((regs->phys_hi >> 16) & 0xff) != irq_data->pci_first_busno) { irq_install_pre_handler(virt_irq, sabre_wsync_handler, (void *) (long) regs->phys_hi, - (void *) irq_data); + (void *) + controller_regs + + SABRE_WRSYNC); } return virt_irq; diff --git a/trunk/arch/sparc64/kernel/setup.c b/trunk/arch/sparc64/kernel/setup.c index 958287448cfe..a73140466e01 100644 --- a/trunk/arch/sparc64/kernel/setup.c +++ b/trunk/arch/sparc64/kernel/setup.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/um/Kconfig.debug b/trunk/arch/um/Kconfig.debug index 09c1aca6339f..bab51d619173 100644 --- a/trunk/arch/um/Kconfig.debug +++ b/trunk/arch/um/Kconfig.debug @@ -47,4 +47,13 @@ config GCOV If you're involved in UML kernel development and want to use gcov, say Y. If you're unsure, say N. +config SYSCALL_DEBUG + bool "Enable system call debugging" + depends on DEBUG_INFO + help + This adds some system debugging to UML, including keeping a ring buffer + with recent system calls and some global and per-task statistics. + + If unsure, say N + endmenu diff --git a/trunk/arch/um/defconfig b/trunk/arch/um/defconfig index 780cc0a4a128..402a74dc5026 100644 --- a/trunk/arch/um/defconfig +++ b/trunk/arch/um/defconfig @@ -526,3 +526,4 @@ CONFIG_FORCED_INLINING=y # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_GPROF is not set # CONFIG_GCOV is not set +# CONFIG_SYSCALL_DEBUG is not set diff --git a/trunk/arch/um/drivers/mconsole_user.c b/trunk/arch/um/drivers/mconsole_user.c index 9bfd405c3bd8..4b109fe7fff8 100644 --- a/trunk/arch/um/drivers/mconsole_user.c +++ b/trunk/arch/um/drivers/mconsole_user.c @@ -18,12 +18,7 @@ #include "umid.h" static struct mconsole_command commands[] = { - /* With uts namespaces, uts information becomes process-specific, so - * we need a process context. If we try handling this in interrupt - * context, we may hit an exiting process without a valid uts - * namespace. - */ - { "version", mconsole_version, MCONSOLE_PROC }, + { "version", mconsole_version, MCONSOLE_INTR }, { "halt", mconsole_halt, MCONSOLE_PROC }, { "reboot", mconsole_reboot, MCONSOLE_PROC }, { "config", mconsole_config, MCONSOLE_PROC }, diff --git a/trunk/arch/um/drivers/net_user.c b/trunk/arch/um/drivers/net_user.c index 107c5e43fa00..0a7786e00cfb 100644 --- a/trunk/arch/um/drivers/net_user.c +++ b/trunk/arch/um/drivers/net_user.c @@ -22,14 +22,13 @@ int tap_open_common(void *dev, char *gate_addr) { int tap_addr[4]; - if(gate_addr == NULL) - return 0; + if(gate_addr == NULL) return(0); if(sscanf(gate_addr, "%d.%d.%d.%d", &tap_addr[0], &tap_addr[1], &tap_addr[2], &tap_addr[3]) != 4){ printk("Invalid tap IP address - '%s'\n", gate_addr); - return -EINVAL; + return(-EINVAL); } - return 0; + return(0); } void tap_check_ips(char *gate_addr, unsigned char *eth_addr) @@ -95,25 +94,25 @@ int net_read(int fd, void *buf, int len) n = os_read_file(fd, buf, len); if(n == -EAGAIN) - return 0; + return(0); else if(n == 0) - return -ENOTCONN; - return n; + return(-ENOTCONN); + return(n); } int net_recvfrom(int fd, void *buf, int len) { int n; - CATCH_EINTR(n = recvfrom(fd, buf, len, 0, NULL, NULL)); + while(((n = recvfrom(fd, buf, len, 0, NULL, NULL)) < 0) && + (errno == EINTR)) ; + if(n < 0){ - if(errno == EAGAIN) - return 0; - return -errno; + if(errno == EAGAIN) return(0); + return(-errno); } - else if(n == 0) - return -ENOTCONN; - return n; + else if(n == 0) return(-ENOTCONN); + return(n); } int net_write(int fd, void *buf, int len) @@ -123,41 +122,37 @@ int net_write(int fd, void *buf, int len) n = os_write_file(fd, buf, len); if(n == -EAGAIN) - return 0; + return(0); else if(n == 0) - return -ENOTCONN; - return n; + return(-ENOTCONN); + return(n); } int net_send(int fd, void *buf, int len) { int n; - CATCH_EINTR(n = send(fd, buf, len, 0)); + while(((n = send(fd, buf, len, 0)) < 0) && (errno == EINTR)) ; if(n < 0){ - if(errno == EAGAIN) - return 0; - return -errno; + if(errno == EAGAIN) return(0); + return(-errno); } - else if(n == 0) - return -ENOTCONN; - return n; + else if(n == 0) return(-ENOTCONN); + return(n); } int net_sendto(int fd, void *buf, int len, void *to, int sock_len) { int n; - CATCH_EINTR(n = sendto(fd, buf, len, 0, (struct sockaddr *) to, - sock_len)); + while(((n = sendto(fd, buf, len, 0, (struct sockaddr *) to, + sock_len)) < 0) && (errno == EINTR)) ; if(n < 0){ - if(errno == EAGAIN) - return 0; - return -errno; + if(errno == EAGAIN) return(0); + return(-errno); } - else if(n == 0) - return -ENOTCONN; - return n; + else if(n == 0) return(-ENOTCONN); + return(n); } struct change_pre_exec_data { @@ -181,7 +176,7 @@ static int change_tramp(char **argv, char *output, int output_len) err = os_pipe(fds, 1, 0); if(err < 0){ printk("change_tramp - pipe failed, err = %d\n", -err); - return err; + return(err); } pe_data.close_me = fds[0]; pe_data.stdout = fds[1]; @@ -195,7 +190,7 @@ static int change_tramp(char **argv, char *output, int output_len) if (pid > 0) CATCH_EINTR(err = waitpid(pid, NULL, 0)); - return pid; + return(pid); } static void change(char *dev, char *what, unsigned char *addr, @@ -246,15 +241,26 @@ char *split_if_spec(char *str, ...) va_start(ap, str); while((arg = va_arg(ap, char **)) != NULL){ if(*str == '\0') - return NULL; + return(NULL); end = strchr(str, ','); if(end != str) *arg = str; if(end == NULL) - return NULL; + return(NULL); *end++ = '\0'; str = end; } va_end(ap); - return str; + return(str); } + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/trunk/arch/um/drivers/tty.c b/trunk/arch/um/drivers/tty.c index 9f70edf5d8ef..94c9265a4f2c 100644 --- a/trunk/arch/um/drivers/tty.c +++ b/trunk/arch/um/drivers/tty.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -25,17 +25,17 @@ static void *tty_chan_init(char *str, int device, struct chan_opts *opts) if(*str != ':'){ printk("tty_init : channel type 'tty' must specify " "a device\n"); - return NULL; + return(NULL); } str++; data = um_kmalloc(sizeof(*data)); if(data == NULL) - return NULL; + return(NULL); *data = ((struct tty_chan) { .dev = str, .raw = opts->raw }); - - return data; + + return(data); } static int tty_open(int input, int output, int primary, void *d, @@ -45,21 +45,19 @@ static int tty_open(int input, int output, int primary, void *d, int fd, err; fd = os_open_file(data->dev, of_set_rw(OPENFLAGS(), input, output), 0); - if(fd < 0) - return fd; - + if(fd < 0) return(fd); if(data->raw){ CATCH_EINTR(err = tcgetattr(fd, &data->tt)); if(err) - return err; + return(err); err = raw(fd); if(err) - return err; + return(err); } *dev_out = data->dev; - return fd; + return(fd); } struct chan_ops tty_ops = { @@ -74,3 +72,14 @@ struct chan_ops tty_ops = { .free = generic_free, .winch = 0, }; + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/trunk/arch/um/drivers/ubd_kern.c b/trunk/arch/um/drivers/ubd_kern.c index 34085315aa57..602d7286b9e0 100644 --- a/trunk/arch/um/drivers/ubd_kern.c +++ b/trunk/arch/um/drivers/ubd_kern.c @@ -627,6 +627,7 @@ static int ubd_new_disk(int major, u64 size, int unit, { struct gendisk *disk; + int err; disk = alloc_disk(1 << UBD_SHIFT); if(disk == NULL) diff --git a/trunk/arch/um/include/irq_user.h b/trunk/arch/um/include/irq_user.h index 15d311b9be9e..69a93c804f0e 100644 --- a/trunk/arch/um/include/irq_user.h +++ b/trunk/arch/um/include/irq_user.h @@ -6,8 +6,6 @@ #ifndef __IRQ_USER_H__ #define __IRQ_USER_H__ -#include "uml-config.h" - struct irq_fd { struct irq_fd *next; void *id; @@ -28,10 +26,9 @@ extern void free_irq_by_fd(int fd); extern void reactivate_fd(int fd, int irqnum); extern void deactivate_fd(int fd, int irqnum); extern int deactivate_all_fds(void); -extern int activate_ipi(int fd, int pid); - -#ifdef CONFIG_MODE_TT extern void forward_interrupts(int pid); -#endif +extern int activate_ipi(int fd, int pid); +extern unsigned long irq_lock(void); +extern void irq_unlock(unsigned long flags); #endif diff --git a/trunk/arch/um/include/kern_util.h b/trunk/arch/um/include/kern_util.h index b98bdd8e052a..310980b32173 100644 --- a/trunk/arch/um/include/kern_util.h +++ b/trunk/arch/um/include/kern_util.h @@ -72,8 +72,10 @@ extern void init_flush_vm(void); extern void *syscall_sp(void *t); extern void syscall_trace(union uml_pt_regs *regs, int entryexit); extern int hz(void); +extern void uml_idle_timer(void); extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs); extern int external_pid(void *t); +extern void boot_timer_handler(int sig); extern void interrupt_end(void); extern void initial_thread_cb(void (*proc)(void *), void *arg); extern int debugger_signal(int status, int pid); diff --git a/trunk/arch/um/include/os.h b/trunk/arch/um/include/os.h index b6c52496e15a..f88856c28a66 100644 --- a/trunk/arch/um/include/os.h +++ b/trunk/arch/um/include/os.h @@ -199,7 +199,7 @@ extern int os_getpid(void); extern int os_getpgrp(void); extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); -extern void init_new_thread_signals(void); +extern void init_new_thread_signals(int altstack); extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); extern int os_map_memory(void *virt, int fd, unsigned long long off, @@ -318,6 +318,7 @@ extern void reboot_skas(void); /* irq.c */ extern int os_waiting_for_events(struct irq_fd *active_fds); +extern int os_isatty(int fd); extern int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds); extern void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2); @@ -329,8 +330,9 @@ extern void os_set_ioignore(void); extern void init_irq_signals(int on_sigstack); /* sigio.c */ +extern void write_sigio_workaround(void); +extern int add_sigio_fd(int fd, int read); extern int ignore_sigio_fd(int fd); -extern void maybe_sigio_broken(int fd, int read); /* skas/trap */ extern void sig_handler_common_skas(int sig, void *sc_ptr); diff --git a/trunk/arch/um/include/skas/mode_kern_skas.h b/trunk/arch/um/include/skas/mode_kern_skas.h index 9cd9c6ec9a63..63c58739bde0 100644 --- a/trunk/arch/um/include/skas/mode_kern_skas.h +++ b/trunk/arch/um/include/skas/mode_kern_skas.h @@ -29,7 +29,8 @@ extern void flush_tlb_mm_skas(struct mm_struct *mm); extern void force_flush_all_skas(void); extern long execute_syscall_skas(void *r); extern void before_mem_skas(unsigned long unused); -extern unsigned long set_task_sizes_skas(unsigned long *task_size_out); +extern unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, + unsigned long *task_size_out); extern int start_uml_skas(void); extern int external_pid_skas(struct task_struct *task); extern int thread_pid_skas(struct task_struct *task); diff --git a/trunk/arch/um/include/tt/mode_kern_tt.h b/trunk/arch/um/include/tt/mode_kern_tt.h index a4fc63057195..efa0012550d0 100644 --- a/trunk/arch/um/include/tt/mode_kern_tt.h +++ b/trunk/arch/um/include/tt/mode_kern_tt.h @@ -30,7 +30,8 @@ extern void flush_tlb_mm_tt(struct mm_struct *mm); extern void force_flush_all_tt(void); extern long execute_syscall_tt(void *r); extern void before_mem_tt(unsigned long brk_start); -extern unsigned long set_task_sizes_tt(unsigned long *task_size_out); +extern unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, + unsigned long *task_size_out); extern int start_uml_tt(void); extern int external_pid_tt(struct task_struct *task); extern int thread_pid_tt(struct task_struct *task); diff --git a/trunk/arch/um/kernel/Makefile b/trunk/arch/um/kernel/Makefile index a2d93065b2d0..fe08971b64cf 100644 --- a/trunk/arch/um/kernel/Makefile +++ b/trunk/arch/um/kernel/Makefile @@ -6,14 +6,16 @@ extra-y := vmlinux.lds clean-files := -obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \ - physmem.o process_kern.o ptrace.o reboot.o resource.o sigio.o \ - signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o uaccess.o \ - um_arch.o umid.o +obj-y = config.o exec_kern.o exitcode.o \ + init_task.o irq.o ksyms.o mem.o physmem.o \ + process_kern.o ptrace.o reboot.o resource.o sigio_kern.o \ + signal_kern.o smp.o syscall_kern.o sysrq.o \ + time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o obj-$(CONFIG_GPROF) += gprof_syms.o obj-$(CONFIG_GCOV) += gmon_syms.o +obj-$(CONFIG_SYSCALL_DEBUG) += syscall.o obj-$(CONFIG_MODE_TT) += tt/ obj-$(CONFIG_MODE_SKAS) += skas/ diff --git a/trunk/arch/um/kernel/exec.c b/trunk/arch/um/kernel/exec_kern.c similarity index 87% rename from trunk/arch/um/kernel/exec.c rename to trunk/arch/um/kernel/exec_kern.c index fc38a6d5906d..c0cb627bf594 100644 --- a/trunk/arch/um/kernel/exec.c +++ b/trunk/arch/um/kernel/exec_kern.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -31,27 +31,18 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp); } -#ifdef CONFIG_TTY_LOG -extern void log_exec(char **argv, void *tty); -#endif - static long execve1(char *file, char __user * __user *argv, char __user *__user *env) { long error; #ifdef CONFIG_TTY_LOG - task_lock(current); - log_exec(argv, current->signal->tty); - task_unlock(current); + log_exec(argv, current->tty); #endif error = do_execve(file, argv, env, ¤t->thread.regs); if (error == 0){ task_lock(current); current->ptrace &= ~PT_DTRACE; -#ifdef SUBARCH_EXECVE1 - SUBARCH_EXECVE1(¤t->thread.regs.regs); -#endif task_unlock(current); set_cmdline(current_cmd()); } diff --git a/trunk/arch/um/kernel/irq.c b/trunk/arch/um/kernel/irq.c index 589c69a75043..bfd0bdc8cd40 100644 --- a/trunk/arch/um/kernel/irq.c +++ b/trunk/arch/um/kernel/irq.c @@ -110,7 +110,18 @@ void sigio_handler(int sig, union uml_pt_regs *regs) free_irqs(); } -static DEFINE_SPINLOCK(irq_lock); +static void maybe_sigio_broken(int fd, int type) +{ + if (os_isatty(fd)) { + if ((type == IRQ_WRITE) && !pty_output_sigio) { + write_sigio_workaround(); + add_sigio_fd(fd, 0); + } else if ((type == IRQ_READ) && !pty_close_sigio) { + write_sigio_workaround(); + add_sigio_fd(fd, 1); + } + } +} int activate_fd(int irq, int fd, int type, void *dev_id) { @@ -155,7 +166,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id) * this is called only from process context, and can be locked with * a semaphore. */ - spin_lock_irqsave(&irq_lock, flags); + flags = irq_lock(); for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { if ((irq_fd->fd == fd) && (irq_fd->type == type)) { printk("Registering fd %d twice\n", fd); @@ -188,7 +199,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id) * so we will not be able to put new pollfd struct to pollfds * then we free the buffer tmp_fds and try again. */ - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); kfree(tmp_pfd); tmp_pfd = NULL; @@ -196,24 +207,24 @@ int activate_fd(int irq, int fd, int type, void *dev_id) if (tmp_pfd == NULL) goto out_kfree; - spin_lock_irqsave(&irq_lock, flags); + flags = irq_lock(); } /*-------------*/ *last_irq_ptr = new_fd; last_irq_ptr = &new_fd->next; - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); /* This calls activate_fd, so it has to be outside the critical * section. */ - maybe_sigio_broken(fd, (type == IRQ_READ)); + maybe_sigio_broken(fd, type); return(0); out_unlock: - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); out_kfree: kfree(new_fd); out: @@ -224,9 +235,9 @@ static void free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg) { unsigned long flags; - spin_lock_irqsave(&irq_lock, flags); + flags = irq_lock(); os_free_irq_by_cb(test, arg, active_fds, &last_irq_ptr); - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); } struct irq_and_dev { @@ -293,19 +304,19 @@ void reactivate_fd(int fd, int irqnum) unsigned long flags; int i; - spin_lock_irqsave(&irq_lock, flags); + flags = irq_lock(); irq = find_irq_by_fd(fd, irqnum, &i); if (irq == NULL) { - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); return; } os_set_pollfd(i, irq->fd); - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); /* This calls activate_fd, so it has to be outside the critical * section. */ - maybe_sigio_broken(fd, (irq->type == IRQ_READ)); + maybe_sigio_broken(fd, irq->type); } void deactivate_fd(int fd, int irqnum) @@ -314,13 +325,13 @@ void deactivate_fd(int fd, int irqnum) unsigned long flags; int i; - spin_lock_irqsave(&irq_lock, flags); + flags = irq_lock(); irq = find_irq_by_fd(fd, irqnum, &i); if (irq == NULL) goto out; os_set_pollfd(i, -1); out: - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); } int deactivate_all_fds(void) @@ -339,14 +350,13 @@ int deactivate_all_fds(void) return 0; } -#ifdef CONFIG_MODE_TT void forward_interrupts(int pid) { struct irq_fd *irq; unsigned long flags; int err; - spin_lock_irqsave(&irq_lock, flags); + flags = irq_lock(); for (irq = active_fds; irq != NULL; irq = irq->next) { err = os_set_owner(irq->fd, pid); if (err < 0) { @@ -359,9 +369,8 @@ void forward_interrupts(int pid) irq->pid = pid; } - spin_unlock_irqrestore(&irq_lock, flags); + irq_unlock(flags); } -#endif /* * do_IRQ handles all normal device IRQ's (the special @@ -394,6 +403,21 @@ int um_request_irq(unsigned int irq, int fd, int type, EXPORT_SYMBOL(um_request_irq); EXPORT_SYMBOL(reactivate_fd); +static DEFINE_SPINLOCK(irq_spinlock); + +unsigned long irq_lock(void) +{ + unsigned long flags; + + spin_lock_irqsave(&irq_spinlock, flags); + return flags; +} + +void irq_unlock(unsigned long flags) +{ + spin_unlock_irqrestore(&irq_spinlock, flags); +} + /* hw_interrupt_type must define (startup || enable) && * (shutdown || disable) && end */ static void dummy(unsigned int irq) diff --git a/trunk/arch/um/kernel/ksyms.c b/trunk/arch/um/kernel/ksyms.c index c97045d6d89f..432cf0b97a13 100644 --- a/trunk/arch/um/kernel/ksyms.c +++ b/trunk/arch/um/kernel/ksyms.c @@ -88,6 +88,12 @@ EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(do_gettimeofday); EXPORT_SYMBOL(do_settimeofday); +/* This is here because UML expands lseek to sys_lseek, not to a system + * call instruction. + */ +EXPORT_SYMBOL(sys_lseek); +EXPORT_SYMBOL(sys_wait4); + #ifdef CONFIG_SMP /* required for SMP */ diff --git a/trunk/arch/um/kernel/mem.c b/trunk/arch/um/kernel/mem.c index 61280167c560..44e41a35f000 100644 --- a/trunk/arch/um/kernel/mem.c +++ b/trunk/arch/um/kernel/mem.c @@ -24,6 +24,8 @@ #include "init.h" #include "kern_constants.h" +extern char __binary_start; + /* Changed during early boot */ unsigned long *empty_zero_page = NULL; unsigned long *empty_bad_page = NULL; @@ -63,6 +65,8 @@ static void setup_highmem(unsigned long highmem_start, void mem_init(void) { + unsigned long start; + max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; /* clear the zero-page */ @@ -77,6 +81,13 @@ void mem_init(void) free_bootmem(__pa(brk_end), uml_reserved - brk_end); uml_reserved = brk_end; + /* Fill in any hole at the start of the binary */ + start = (unsigned long) &__binary_start & PAGE_MASK; + if(uml_physmem != start){ + map_memory(uml_physmem, __pa(uml_physmem), start - uml_physmem, + 1, 1, 0); + } + /* this will put all low memory onto the freelists */ totalram_pages = free_all_bootmem(); totalhigh_pages = highmem >> PAGE_SHIFT; diff --git a/trunk/arch/um/kernel/physmem.c b/trunk/arch/um/kernel/physmem.c index abafa64b8727..166cb09cae4c 100644 --- a/trunk/arch/um/kernel/physmem.c +++ b/trunk/arch/um/kernel/physmem.c @@ -317,7 +317,7 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len, } } -extern int __syscall_stub_start; +extern int __syscall_stub_start, __binary_start; void setup_physmem(unsigned long start, unsigned long reserve_end, unsigned long len, unsigned long long highmem) diff --git a/trunk/arch/um/kernel/sigio.c b/trunk/arch/um/kernel/sigio_kern.c similarity index 68% rename from trunk/arch/um/kernel/sigio.c rename to trunk/arch/um/kernel/sigio_kern.c index 0ad755ceb212..51b677083948 100644 --- a/trunk/arch/um/kernel/sigio.c +++ b/trunk/arch/um/kernel/sigio_kern.c @@ -31,7 +31,7 @@ int write_sigio_irq(int fd) int err; err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt, - IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio", + IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "write sigio", NULL); if(err){ printk("write_sigio_irq : um_request_irq failed, err = %d\n", @@ -53,3 +53,17 @@ void sigio_unlock(void) { spin_unlock(&sigio_spinlock); } + +extern void sigio_cleanup(void); +__uml_exitcall(sigio_cleanup); + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/trunk/arch/um/kernel/signal.c b/trunk/arch/um/kernel/signal_kern.c similarity index 96% rename from trunk/arch/um/kernel/signal.c rename to trunk/arch/um/kernel/signal_kern.c index 4aa9808ba264..da17b7541e08 100644 --- a/trunk/arch/um/kernel/signal.c +++ b/trunk/arch/um/kernel/signal_kern.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -36,7 +36,7 @@ EXPORT_SYMBOL(unblock_signals); /* * OK, we're invoking a handler - */ + */ static int handle_signal(struct pt_regs *regs, unsigned long signr, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset) @@ -88,7 +88,7 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr, force_sigsegv(signr, current); } else { spin_lock_irq(¤t->sighand->siglock); - sigorsets(¤t->blocked, ¤t->blocked, + sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); if(!(ka->sa.sa_flags & SA_NODEFER)) sigaddset(¤t->blocked, signr); @@ -136,7 +136,7 @@ static int kern_do_signal(struct pt_regs *regs) PT_REGS_RESTART_SYSCALL(regs); break; case -ERESTART_RESTARTBLOCK: - PT_REGS_ORIG_SYSCALL(regs) = __NR_restart_syscall; + PT_REGS_SYSCALL_RET(regs) = __NR_restart_syscall; PT_REGS_RESTART_SYSCALL(regs); break; } @@ -146,7 +146,7 @@ static int kern_do_signal(struct pt_regs *regs) * you set a breakpoint on a system call instruction and singlestep * from it, the tracing thread used to PTRACE_SINGLESTEP the process * rather than PTRACE_SYSCALL it, allowing the system call to execute - * on the host. The tracing thread will check this flag and + * on the host. The tracing thread will check this flag and * PTRACE_SYSCALL if necessary. */ if(current->ptrace & PT_DTRACE) diff --git a/trunk/arch/um/kernel/skas/mem.c b/trunk/arch/um/kernel/skas/mem.c index 27bbf54b1e52..88ab96c609ce 100644 --- a/trunk/arch/um/kernel/skas/mem.c +++ b/trunk/arch/um/kernel/skas/mem.c @@ -9,19 +9,31 @@ #include "mem_user.h" #include "skas.h" -unsigned long set_task_sizes_skas(unsigned long *task_size_out) +unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, + unsigned long *task_size_out) { /* Round up to the nearest 4M */ - unsigned long host_task_size = ROUND_4M((unsigned long) - &host_task_size); + unsigned long top = ROUND_4M((unsigned long) &arg); #ifdef CONFIG_HOST_TASK_SIZE - *host_size_out = ROUND_4M(CONFIG_HOST_TASK_SIZE); + *host_size_out = CONFIG_HOST_TASK_SIZE; *task_size_out = CONFIG_HOST_TASK_SIZE; #else + *host_size_out = top; if (!skas_needs_stub) - *task_size_out = host_task_size; + *task_size_out = top; else *task_size_out = CONFIG_STUB_START & PGDIR_MASK; #endif - return host_task_size; + return(((unsigned long) set_task_sizes_skas) & ~0xffffff); } + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/trunk/arch/um/kernel/skas/process_kern.c b/trunk/arch/um/kernel/skas/process_kern.c index 55caeec8b257..2135eaf98a93 100644 --- a/trunk/arch/um/kernel/skas/process_kern.c +++ b/trunk/arch/um/kernel/skas/process_kern.c @@ -177,7 +177,7 @@ int start_uml_skas(void) if(proc_mm) userspace_pid[0] = start_userspace(0); - init_new_thread_signals(); + init_new_thread_signals(1); init_task.thread.request.u.thread.proc = start_kernel_proc; init_task.thread.request.u.thread.arg = NULL; diff --git a/trunk/arch/um/kernel/skas/syscall.c b/trunk/arch/um/kernel/skas/syscall.c index 0ae4eea21be4..51fb94076fcf 100644 --- a/trunk/arch/um/kernel/skas/syscall.c +++ b/trunk/arch/um/kernel/skas/syscall.c @@ -18,7 +18,11 @@ void handle_syscall(union uml_pt_regs *r) struct pt_regs *regs = container_of(r, struct pt_regs, regs); long result; int syscall; +#ifdef UML_CONFIG_SYSCALL_DEBUG + int index; + index = record_syscall_start(UPT_SYSCALL_NR(r)); +#endif syscall_trace(r, 0); current->thread.nsyscalls++; @@ -40,4 +44,7 @@ void handle_syscall(union uml_pt_regs *r) REGS_SET_SYSCALL_RETURN(r->skas.regs, result); syscall_trace(r, 1); +#ifdef UML_CONFIG_SYSCALL_DEBUG + record_syscall_end(index, result); +#endif } diff --git a/trunk/arch/um/kernel/syscall.c b/trunk/arch/um/kernel/syscall.c index abf14aaf905f..1731d90e6850 100644 --- a/trunk/arch/um/kernel/syscall.c +++ b/trunk/arch/um/kernel/syscall.c @@ -1,166 +1,36 @@ /* - * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ -#include "linux/sched.h" -#include "linux/file.h" -#include "linux/smp_lock.h" -#include "linux/mm.h" -#include "linux/utsname.h" -#include "linux/msg.h" -#include "linux/shm.h" -#include "linux/sys.h" -#include "linux/syscalls.h" -#include "linux/unistd.h" -#include "linux/slab.h" -#include "linux/utime.h" -#include "asm/mman.h" -#include "asm/uaccess.h" #include "kern_util.h" -#include "user_util.h" -#include "sysdep/syscalls.h" -#include "mode_kern.h" -#include "choose-mode.h" +#include "syscall.h" +#include "os.h" -/* Unlocked, I don't care if this is a bit off */ -int nsyscalls = 0; +struct { + int syscall; + int pid; + long result; + unsigned long long start; + unsigned long long end; +} syscall_record[1024]; -long sys_fork(void) +int record_syscall_start(int syscall) { - long ret; + int max, index; - current->thread.forking = 1; - ret = do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), - ¤t->thread.regs, 0, NULL, NULL); - current->thread.forking = 0; - return(ret); -} - -long sys_vfork(void) -{ - long ret; - - current->thread.forking = 1; - ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, - UPT_SP(¤t->thread.regs.regs), - ¤t->thread.regs, 0, NULL, NULL); - current->thread.forking = 0; - return(ret); -} - -/* common code for old and new mmaps */ -long sys_mmap2(unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff) -{ - long error = -EBADF; - struct file * file = NULL; - - flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); - if (!(flags & MAP_ANONYMOUS)) { - file = fget(fd); - if (!file) - goto out; - } - - down_write(¤t->mm->mmap_sem); - error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); - up_write(¤t->mm->mmap_sem); - - if (file) - fput(file); - out: - return error; -} - -long old_mmap(unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long offset) -{ - long err = -EINVAL; - if (offset & ~PAGE_MASK) - goto out; - - err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); - out: - return err; -} -/* - * sys_pipe() is the normal C calling standard for creating - * a pipe. It's not the way unix traditionally does this, though. - */ -long sys_pipe(unsigned long __user * fildes) -{ - int fd[2]; - long error; - - error = do_pipe(fd); - if (!error) { - if (copy_to_user(fildes, fd, sizeof(fd))) - error = -EFAULT; - } - return error; -} + max = sizeof(syscall_record)/sizeof(syscall_record[0]); + index = next_syscall_index(max); - -long sys_uname(struct old_utsname __user * name) -{ - long err; - if (!name) - return -EFAULT; - down_read(&uts_sem); - err = copy_to_user(name, utsname(), sizeof (*name)); - up_read(&uts_sem); - return err?-EFAULT:0; + syscall_record[index].syscall = syscall; + syscall_record[index].pid = current_pid(); + syscall_record[index].result = 0xdeadbeef; + syscall_record[index].start = os_nsecs(); + return(index); } -long sys_olduname(struct oldold_utsname __user * name) +void record_syscall_end(int index, long result) { - long error; - - if (!name) - return -EFAULT; - if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) - return -EFAULT; - - down_read(&uts_sem); - - error = __copy_to_user(&name->sysname, &utsname()->sysname, - __OLD_UTS_LEN); - error |= __put_user(0, name->sysname + __OLD_UTS_LEN); - error |= __copy_to_user(&name->nodename, &utsname()->nodename, - __OLD_UTS_LEN); - error |= __put_user(0, name->nodename + __OLD_UTS_LEN); - error |= __copy_to_user(&name->release, &utsname()->release, - __OLD_UTS_LEN); - error |= __put_user(0, name->release + __OLD_UTS_LEN); - error |= __copy_to_user(&name->version, &utsname()->version, - __OLD_UTS_LEN); - error |= __put_user(0, name->version + __OLD_UTS_LEN); - error |= __copy_to_user(&name->machine, &utsname()->machine, - __OLD_UTS_LEN); - error |= __put_user(0, name->machine + __OLD_UTS_LEN); - - up_read(&uts_sem); - - error = error ? -EFAULT : 0; - - return error; -} - -DEFINE_SPINLOCK(syscall_lock); - -static int syscall_index = 0; - -int next_syscall_index(int limit) -{ - int ret; - - spin_lock(&syscall_lock); - ret = syscall_index; - if(++syscall_index == limit) - syscall_index = 0; - spin_unlock(&syscall_lock); - return(ret); + syscall_record[index].result = result; + syscall_record[index].end = os_nsecs(); } diff --git a/trunk/arch/um/kernel/syscall_kern.c b/trunk/arch/um/kernel/syscall_kern.c new file mode 100644 index 000000000000..37d3978337d8 --- /dev/null +++ b/trunk/arch/um/kernel/syscall_kern.c @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) + * Licensed under the GPL + */ + +#include "linux/sched.h" +#include "linux/file.h" +#include "linux/smp_lock.h" +#include "linux/mm.h" +#include "linux/utsname.h" +#include "linux/msg.h" +#include "linux/shm.h" +#include "linux/sys.h" +#include "linux/syscalls.h" +#include "linux/unistd.h" +#include "linux/slab.h" +#include "linux/utime.h" +#include "asm/mman.h" +#include "asm/uaccess.h" +#include "kern_util.h" +#include "user_util.h" +#include "sysdep/syscalls.h" +#include "mode_kern.h" +#include "choose-mode.h" + +/* Unlocked, I don't care if this is a bit off */ +int nsyscalls = 0; + +long sys_fork(void) +{ + long ret; + + current->thread.forking = 1; + ret = do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), + ¤t->thread.regs, 0, NULL, NULL); + current->thread.forking = 0; + return(ret); +} + +long sys_vfork(void) +{ + long ret; + + current->thread.forking = 1; + ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, + UPT_SP(¤t->thread.regs.regs), + ¤t->thread.regs, 0, NULL, NULL); + current->thread.forking = 0; + return(ret); +} + +/* common code for old and new mmaps */ +long sys_mmap2(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff) +{ + long error = -EBADF; + struct file * file = NULL; + + flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + if (!(flags & MAP_ANONYMOUS)) { + file = fget(fd); + if (!file) + goto out; + } + + down_write(¤t->mm->mmap_sem); + error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); + up_write(¤t->mm->mmap_sem); + + if (file) + fput(file); + out: + return error; +} + +long old_mmap(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long offset) +{ + long err = -EINVAL; + if (offset & ~PAGE_MASK) + goto out; + + err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); + out: + return err; +} +/* + * sys_pipe() is the normal C calling standard for creating + * a pipe. It's not the way unix traditionally does this, though. + */ +long sys_pipe(unsigned long __user * fildes) +{ + int fd[2]; + long error; + + error = do_pipe(fd); + if (!error) { + if (copy_to_user(fildes, fd, sizeof(fd))) + error = -EFAULT; + } + return error; +} + + +long sys_uname(struct old_utsname __user * name) +{ + long err; + if (!name) + return -EFAULT; + down_read(&uts_sem); + err=copy_to_user(name, &system_utsname, sizeof (*name)); + up_read(&uts_sem); + return err?-EFAULT:0; +} + +long sys_olduname(struct oldold_utsname __user * name) +{ + long error; + + if (!name) + return -EFAULT; + if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) + return -EFAULT; + + down_read(&uts_sem); + + error = __copy_to_user(&name->sysname,&system_utsname.sysname, + __OLD_UTS_LEN); + error |= __put_user(0,name->sysname+__OLD_UTS_LEN); + error |= __copy_to_user(&name->nodename,&system_utsname.nodename, + __OLD_UTS_LEN); + error |= __put_user(0,name->nodename+__OLD_UTS_LEN); + error |= __copy_to_user(&name->release,&system_utsname.release, + __OLD_UTS_LEN); + error |= __put_user(0,name->release+__OLD_UTS_LEN); + error |= __copy_to_user(&name->version,&system_utsname.version, + __OLD_UTS_LEN); + error |= __put_user(0,name->version+__OLD_UTS_LEN); + error |= __copy_to_user(&name->machine,&system_utsname.machine, + __OLD_UTS_LEN); + error |= __put_user(0,name->machine+__OLD_UTS_LEN); + + up_read(&uts_sem); + + error = error ? -EFAULT : 0; + + return error; +} + +DEFINE_SPINLOCK(syscall_lock); + +static int syscall_index = 0; + +int next_syscall_index(int limit) +{ + int ret; + + spin_lock(&syscall_lock); + ret = syscall_index; + if(++syscall_index == limit) + syscall_index = 0; + spin_unlock(&syscall_lock); + return(ret); +} diff --git a/trunk/arch/um/kernel/time.c b/trunk/arch/um/kernel/time_kern.c similarity index 84% rename from trunk/arch/um/kernel/time.c rename to trunk/arch/um/kernel/time_kern.c index 552ca1cb9847..d7e044b5e5ee 100644 --- a/trunk/arch/um/kernel/time.c +++ b/trunk/arch/um/kernel/time_kern.c @@ -38,6 +38,7 @@ unsigned long long sched_clock(void) /* Changed at early boot */ int timer_irq_inited = 0; +static int first_tick; static unsigned long long prev_nsecs; #ifdef CONFIG_UML_REAL_TIME_CLOCK static long long delta; /* Deviation per interval */ @@ -47,8 +48,15 @@ void timer_irq(union uml_pt_regs *regs) { unsigned long long ticks = 0; + if(!timer_irq_inited){ + /* This is to ensure that ticks don't pile up when + * the timer handler is suspended */ + first_tick = 0; + return; + } + + if(first_tick){ #ifdef CONFIG_UML_REAL_TIME_CLOCK - if(prev_nsecs){ /* We've had 1 tick */ unsigned long long nsecs = os_nsecs(); @@ -61,17 +69,44 @@ void timer_irq(union uml_pt_regs *regs) ticks += (delta * HZ) / BILLION; delta -= (ticks * BILLION) / HZ; - } - else prev_nsecs = os_nsecs(); #else - ticks = 1; + ticks = 1; #endif + } + else { + prev_nsecs = os_nsecs(); + first_tick = 1; + } + while(ticks > 0){ do_IRQ(TIMER_IRQ, regs); ticks--; } } + +void time_init_kern(void) +{ + long long nsecs; + + nsecs = os_nsecs(); + set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION, + -nsecs % BILLION); +} + +void do_boot_timer_handler(struct sigcontext * sc) +{ + unsigned long flags; + struct pt_regs regs; + + CHOOSE_MODE((void) (UPT_SC(®s.regs) = sc), + (void) (regs.regs.skas.is_user = 0)); + + write_seqlock_irqsave(&xtime_lock, flags); + do_timer(®s); + write_sequnlock_irqrestore(&xtime_lock, flags); +} + static DEFINE_SPINLOCK(timer_spinlock); static unsigned long long local_offset = 0; @@ -107,32 +142,6 @@ irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs) return IRQ_HANDLED; } -static void register_timer(void) -{ - int err; - - err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL); - if(err != 0) - printk(KERN_ERR "timer_init : request_irq failed - " - "errno = %d\n", -err); - - timer_irq_inited = 1; - - user_time_init(); -} - -extern void (*late_time_init)(void); - -void time_init(void) -{ - long long nsecs; - - nsecs = os_nsecs(); - set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION, - -nsecs % BILLION); - late_time_init = register_timer; -} - void do_gettimeofday(struct timeval *tv) { unsigned long long nsecs = get_time(); @@ -180,3 +189,18 @@ void timer_handler(int sig, union uml_pt_regs *regs) if(current_thread->cpu == 0) timer_irq(regs); } + +int __init timer_init(void) +{ + int err; + + user_time_init(); + err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL); + if(err != 0) + printk(KERN_ERR "timer_init : request_irq failed - " + "errno = %d\n", -err); + timer_irq_inited = 1; + return(0); +} + +arch_initcall(timer_init); diff --git a/trunk/arch/um/kernel/trap.c b/trunk/arch/um/kernel/trap_kern.c similarity index 95% rename from trunk/arch/um/kernel/trap.c rename to trunk/arch/um/kernel/trap_kern.c index ac70fa5a2e2a..02f6d4d8dc3a 100644 --- a/trunk/arch/um/kernel/trap.c +++ b/trunk/arch/um/kernel/trap_kern.c @@ -35,7 +35,7 @@ #include "os.h" /* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */ -int handle_page_fault(unsigned long address, unsigned long ip, +int handle_page_fault(unsigned long address, unsigned long ip, int is_write, int is_user, int *code_out) { struct mm_struct *mm = current->mm; @@ -55,20 +55,20 @@ int handle_page_fault(unsigned long address, unsigned long ip, down_read(&mm->mmap_sem); vma = find_vma(mm, address); - if(!vma) + if(!vma) goto out; - else if(vma->vm_start <= address) + else if(vma->vm_start <= address) goto good_area; - else if(!(vma->vm_flags & VM_GROWSDOWN)) + else if(!(vma->vm_flags & VM_GROWSDOWN)) goto out; else if(is_user && !ARCH_IS_STACKGROW(address)) goto out; - else if(expand_stack(vma, address)) + else if(expand_stack(vma, address)) goto out; good_area: *code_out = SEGV_ACCERR; - if(is_write && !(vma->vm_flags & VM_WRITE)) + if(is_write && !(vma->vm_flags & VM_WRITE)) goto out; /* Don't require VM_READ|VM_EXEC for write faults! */ @@ -184,14 +184,14 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc) else if(catcher != NULL){ current->thread.fault_addr = (void *) address; do_longjmp(catcher, 1); - } + } else if(current->thread.fault_addr != NULL) panic("fault_addr set but no fault catcher"); else if(!is_user && arch_fixup(ip, sc)) return(0); - if(!is_user) - panic("Kernel mode fault at addr 0x%lx, ip 0x%lx", + if(!is_user) + panic("Kernel mode fault at addr 0x%lx, ip 0x%lx", address, ip); if (err == -EACCES) { diff --git a/trunk/arch/um/kernel/tt/exec_kern.c b/trunk/arch/um/kernel/tt/exec_kern.c index ad66df17d9d7..5c1e4cc1c049 100644 --- a/trunk/arch/um/kernel/tt/exec_kern.c +++ b/trunk/arch/um/kernel/tt/exec_kern.c @@ -21,7 +21,7 @@ static int exec_tramp(void *sig_stack) { init_new_thread_stack(sig_stack, NULL); - init_new_thread_signals(); + init_new_thread_signals(1); os_stop_process(os_getpid()); return(0); } diff --git a/trunk/arch/um/kernel/tt/mem.c b/trunk/arch/um/kernel/tt/mem.c index 84a23b14f770..bcb8796c3cb1 100644 --- a/trunk/arch/um/kernel/tt/mem.c +++ b/trunk/arch/um/kernel/tt/mem.c @@ -24,13 +24,22 @@ void before_mem_tt(unsigned long brk_start) #define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000) #define START (CONFIG_TOP_ADDR - SIZE) -unsigned long set_task_sizes_tt(unsigned long *task_size_out) +unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, + unsigned long *task_size_out) { - unsigned long host_task_size; - /* Round up to the nearest 4M */ - host_task_size = ROUND_4M((unsigned long) &host_task_size); + *host_size_out = ROUND_4M((unsigned long) &arg); *task_size_out = START; - - return host_task_size; + return(START); } + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/trunk/arch/um/kernel/tt/process_kern.c b/trunk/arch/um/kernel/tt/process_kern.c index 1e86f0bfef72..8368c2dbe635 100644 --- a/trunk/arch/um/kernel/tt/process_kern.c +++ b/trunk/arch/um/kernel/tt/process_kern.c @@ -142,7 +142,7 @@ static void new_thread_handler(int sig) schedule_tail(current->thread.prev_sched); current->thread.prev_sched = NULL; - init_new_thread_signals(); + init_new_thread_signals(1); enable_timer(); free_page(current->thread.temp_stack); set_cmdline("(kernel thread)"); diff --git a/trunk/arch/um/kernel/tt/syscall_kern.c b/trunk/arch/um/kernel/tt/syscall_kern.c index 293caa6d0c2d..3fda9a03c59a 100644 --- a/trunk/arch/um/kernel/tt/syscall_kern.c +++ b/trunk/arch/um/kernel/tt/syscall_kern.c @@ -21,11 +21,18 @@ void syscall_handler_tt(int sig, struct pt_regs *regs) void *sc; long result; int syscall; - +#ifdef CONFIG_SYSCALL_DEBUG + int index; +#endif sc = UPT_SC(®s->regs); SC_START_SYSCALL(sc); syscall = UPT_SYSCALL_NR(®s->regs); + +#ifdef CONFIG_SYSCALL_DEBUG + index = record_syscall_start(syscall); +#endif + syscall_trace(®s->regs, 0); current->thread.nsyscalls++; @@ -43,4 +50,7 @@ void syscall_handler_tt(int sig, struct pt_regs *regs) SC_SET_SYSCALL_RETURN(sc, result); syscall_trace(®s->regs, 1); +#ifdef CONFIG_SYSCALL_DEBUG + record_syscall_end(index, result); +#endif } diff --git a/trunk/arch/um/kernel/tt/tracer.c b/trunk/arch/um/kernel/tt/tracer.c index 9882342206ec..71daae24e48a 100644 --- a/trunk/arch/um/kernel/tt/tracer.c +++ b/trunk/arch/um/kernel/tt/tracer.c @@ -188,7 +188,10 @@ int tracer(int (*init_proc)(void *), void *sp) int status, pid = 0, sig = 0, cont_type, tracing = 0, op = 0; int proc_id = 0, n, err, old_tracing = 0, strace = 0; int local_using_sysemu = 0; - +#ifdef UML_CONFIG_SYSCALL_DEBUG + unsigned long eip = 0; + int last_index; +#endif signal(SIGPIPE, SIG_IGN); setup_tracer_winch(); tracing_pid = os_getpid(); @@ -279,6 +282,23 @@ int tracer(int (*init_proc)(void *), void *sp) else if(WIFSTOPPED(status)){ proc_id = pid_to_processor_id(pid); sig = WSTOPSIG(status); +#ifdef UML_CONFIG_SYSCALL_DEBUG + if(signal_index[proc_id] == 1024){ + signal_index[proc_id] = 0; + last_index = 1023; + } + else last_index = signal_index[proc_id] - 1; + if(((sig == SIGPROF) || (sig == SIGVTALRM) || + (sig == SIGALRM)) && + (signal_record[proc_id][last_index].signal == sig)&& + (signal_record[proc_id][last_index].pid == pid)) + signal_index[proc_id] = last_index; + signal_record[proc_id][signal_index[proc_id]].pid = pid; + gettimeofday(&signal_record[proc_id][signal_index[proc_id]].time, NULL); + eip = ptrace(PTRACE_PEEKUSR, pid, PT_IP_OFFSET, 0); + signal_record[proc_id][signal_index[proc_id]].addr = eip; + signal_record[proc_id][signal_index[proc_id]++].signal = sig; +#endif if(proc_id == -1){ sleeping_process_signal(pid, sig); continue; diff --git a/trunk/arch/um/kernel/um_arch.c b/trunk/arch/um/kernel/um_arch.c index 7896cf98232d..37cfe7701f06 100644 --- a/trunk/arch/um/kernel/um_arch.c +++ b/trunk/arch/um/kernel/um_arch.c @@ -330,8 +330,6 @@ EXPORT_SYMBOL(end_iomem); #define MIN_VMALLOC (32 * 1024 * 1024) -extern char __binary_start; - int linux_main(int argc, char **argv) { unsigned long avail, diff; @@ -376,9 +374,8 @@ int linux_main(int argc, char **argv) printf("UML running in %s mode\n", mode); - uml_start = (unsigned long) &__binary_start; - host_task_size = CHOOSE_MODE_PROC(set_task_sizes_tt, - set_task_sizes_skas, &task_size); + uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, + &host_task_size, &task_size); /* * Setting up handlers to 'sig_info' struct @@ -398,7 +395,7 @@ int linux_main(int argc, char **argv) physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); } - uml_physmem = uml_start & PAGE_MASK; + uml_physmem = uml_start; /* Reserve up to 4M after the current brk */ uml_reserved = ROUND_4M(brk_start) + (1 << 22); diff --git a/trunk/arch/um/kernel/uml.lds.S b/trunk/arch/um/kernel/uml.lds.S index 8eca47a6ff08..af11915ce0a8 100644 --- a/trunk/arch/um/kernel/uml.lds.S +++ b/trunk/arch/um/kernel/uml.lds.S @@ -7,17 +7,14 @@ jiffies = jiffies_64; SECTIONS { - /* This must contain the right address - not quite the default ELF one.*/ + /*This must contain the right address - not quite the default ELF one.*/ PROVIDE (__executable_start = START); - /* Static binaries stick stuff here, like the sigreturn trampoline, - * invisibly to objdump. So, just make __binary_start equal to the very - * beginning of the executable, and if there are unmapped pages after this, - * they are forever unusable. - */ - __binary_start = START; - . = START + SIZEOF_HEADERS; + /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start + * is remapped.*/ + __binary_start = .; + #ifdef MODE_TT .remap_data : { UNMAP_PATH (.data .bss) } .remap : { UNMAP_PATH (.text) } diff --git a/trunk/arch/um/os-Linux/file.c b/trunk/arch/um/os-Linux/file.c index 189fa677085a..09251338d99e 100644 --- a/trunk/arch/um/os-Linux/file.c +++ b/trunk/arch/um/os-Linux/file.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -18,7 +18,6 @@ #include "os.h" #include "user.h" #include "kern_util.h" -#include "user_util.h" static void copy_stat(struct uml_stat *dst, struct stat64 *src) { @@ -43,13 +42,16 @@ int os_stat_fd(const int fd, struct uml_stat *ubuf) struct stat64 sbuf; int err; - CATCH_EINTR(err = fstat64(fd, &sbuf)); + do { + err = fstat64(fd, &sbuf); + } while((err < 0) && (errno == EINTR)) ; + if(err < 0) - return -errno; + return(-errno); if(ubuf != NULL) copy_stat(ubuf, &sbuf); - return err; + return(err); } int os_stat_file(const char *file_name, struct uml_stat *ubuf) @@ -62,11 +64,11 @@ int os_stat_file(const char *file_name, struct uml_stat *ubuf) } while((err < 0) && (errno == EINTR)) ; if(err < 0) - return -errno; + return(-errno); if(ubuf != NULL) copy_stat(ubuf, &sbuf); - return err; + return(err); } int os_access(const char* file, int mode) @@ -78,9 +80,9 @@ int os_access(const char* file, int mode) err = access(file, amode); if(err < 0) - return -errno; + return(-errno); - return 0; + return(0); } void os_print_error(int error, const char* str) @@ -97,9 +99,9 @@ int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) err = ioctl(fd, cmd, arg); if(err < 0) - return -errno; + return(-errno); - return err; + return(err); } int os_window_size(int fd, int *rows, int *cols) @@ -107,12 +109,12 @@ int os_window_size(int fd, int *rows, int *cols) struct winsize size; if(ioctl(fd, TIOCGWINSZ, &size) < 0) - return -errno; + return(-errno); *rows = size.ws_row; *cols = size.ws_col; - return 0; + return(0); } int os_new_tty_pgrp(int fd, int pid) @@ -123,16 +125,16 @@ int os_new_tty_pgrp(int fd, int pid) if(tcsetpgrp(fd, pid) < 0) return -errno; - return 0; + return(0); } /* FIXME: ensure namebuf in os_get_if_name is big enough */ int os_get_ifname(int fd, char* namebuf) { if(ioctl(fd, SIOCGIFNAME, namebuf) < 0) - return -errno; + return(-errno); - return 0; + return(0); } int os_set_slip(int fd) @@ -147,7 +149,7 @@ int os_set_slip(int fd) if(ioctl(fd, SIOCSIFENCAP, &sencap) < 0) return -errno; - return 0; + return(0); } int os_set_owner(int fd, int pid) @@ -156,10 +158,10 @@ int os_set_owner(int fd, int pid) int save_errno = errno; if(fcntl(fd, F_GETOWN, 0) != pid) - return -save_errno; + return(-save_errno); } - return 0; + return(0); } /* FIXME? moved wholesale from sigio_user.c to get fcntls out of that file */ @@ -190,9 +192,9 @@ int os_mode_fd(int fd, int mode) } while((err < 0) && (errno==EINTR)) ; if(err < 0) - return -errno; + return(-errno); - return 0; + return(0); } int os_file_type(char *file) @@ -202,21 +204,15 @@ int os_file_type(char *file) err = os_stat_file(file, &buf); if(err < 0) - return err; + return(err); - if(S_ISDIR(buf.ust_mode)) - return OS_TYPE_DIR; - else if(S_ISLNK(buf.ust_mode)) - return OS_TYPE_SYMLINK; - else if(S_ISCHR(buf.ust_mode)) - return OS_TYPE_CHARDEV; - else if(S_ISBLK(buf.ust_mode)) - return OS_TYPE_BLOCKDEV; - else if(S_ISFIFO(buf.ust_mode)) - return OS_TYPE_FIFO; - else if(S_ISSOCK(buf.ust_mode)) - return OS_TYPE_SOCK; - else return OS_TYPE_FILE; + if(S_ISDIR(buf.ust_mode)) return(OS_TYPE_DIR); + else if(S_ISLNK(buf.ust_mode)) return(OS_TYPE_SYMLINK); + else if(S_ISCHR(buf.ust_mode)) return(OS_TYPE_CHARDEV); + else if(S_ISBLK(buf.ust_mode)) return(OS_TYPE_BLOCKDEV); + else if(S_ISFIFO(buf.ust_mode)) return(OS_TYPE_FIFO); + else if(S_ISSOCK(buf.ust_mode)) return(OS_TYPE_SOCK); + else return(OS_TYPE_FILE); } int os_file_mode(char *file, struct openflags *mode_out) @@ -306,8 +302,8 @@ int os_seek_file(int fd, __u64 offset) actual = lseek64(fd, offset, SEEK_SET); if(actual != offset) - return -errno; - return 0; + return(-errno); + return(0); } static int fault_buffer(void *start, int len, @@ -318,13 +314,13 @@ static int fault_buffer(void *start, int len, for(i = 0; i < len; i += page){ if((*copy_proc)(start + i, &c, sizeof(c))) - return -EFAULT; + return(-EFAULT); } if((len % page) != 0){ if((*copy_proc)(start + len - 1, &c, sizeof(c))) - return -EFAULT; + return(-EFAULT); } - return 0; + return(0); } static int file_io(int fd, void *buf, int len, @@ -338,26 +334,26 @@ static int file_io(int fd, void *buf, int len, if((n < 0) && (errno == EFAULT)){ err = fault_buffer(buf, len, copy_user_proc); if(err) - return err; + return(err); n = (*io_proc)(fd, buf, len); } } while((n < 0) && (errno == EINTR)); if(n < 0) - return -errno; - return n; + return(-errno); + return(n); } int os_read_file(int fd, void *buf, int len) { - return file_io(fd, buf, len, (int (*)(int, void *, int)) read, - copy_from_user_proc); + return(file_io(fd, buf, len, (int (*)(int, void *, int)) read, + copy_from_user_proc)); } int os_write_file(int fd, const void *buf, int len) { - return file_io(fd, (void *) buf, len, - (int (*)(int, void *, int)) write, copy_to_user_proc); + return(file_io(fd, (void *) buf, len, + (int (*)(int, void *, int)) write, copy_to_user_proc)); } int os_file_size(char *file, unsigned long long *size_out) @@ -402,11 +398,11 @@ int os_file_modtime(char *file, unsigned long *modtime) err = os_stat_file(file, &buf); if(err < 0){ printk("Couldn't stat \"%s\" : err = %d\n", file, -err); - return err; + return(err); } *modtime = buf.ust_mtime; - return 0; + return(0); } int os_get_exec_close(int fd, int* close_on_exec) @@ -459,7 +455,7 @@ int os_pipe(int *fds, int stream, int close_on_exec) if(err < 0) goto error; - return 0; + return(0); error: printk("os_pipe : Setting FD_CLOEXEC failed, err = %d\n", -err); @@ -490,12 +486,12 @@ int os_set_fd_async(int fd, int owner) (fcntl(fd, F_SETOWN, owner) < 0)){ err = -errno; printk("os_set_fd_async : Failed to fcntl F_SETOWN " - "(or F_SETSIG) fd %d to pid %d, errno = %d\n", fd, + "(or F_SETSIG) fd %d to pid %d, errno = %d\n", fd, owner, errno); return err; } - return 0; + return(0); } int os_clear_fd_async(int fd) @@ -504,8 +500,8 @@ int os_clear_fd_async(int fd) flags &= ~(O_ASYNC | O_NONBLOCK); if(fcntl(fd, F_SETFL, flags) < 0) - return -errno; - return 0; + return(-errno); + return(0); } int os_set_fd_block(int fd, int blocking) @@ -520,7 +516,7 @@ int os_set_fd_block(int fd, int blocking) if(fcntl(fd, F_SETFL, flags) < 0) return -errno; - return 0; + return(0); } int os_accept_connection(int fd) @@ -528,9 +524,9 @@ int os_accept_connection(int fd) int new; new = accept(fd, NULL, 0); - if(new < 0) - return -errno; - return new; + if(new < 0) + return(-errno); + return(new); } #ifndef SHUT_RD @@ -554,12 +550,12 @@ int os_shutdown_socket(int fd, int r, int w) else if(w) what = SHUT_WR; else { printk("os_shutdown_socket : neither r or w was set\n"); - return -EINVAL; + return(-EINVAL); } err = shutdown(fd, what); if(err < 0) - return -errno; - return 0; + return(-errno); + return(0); } int os_rcv_fd(int fd, int *helper_pid_out) @@ -582,7 +578,7 @@ int os_rcv_fd(int fd, int *helper_pid_out) n = recvmsg(fd, &msg, 0); if(n < 0) - return -errno; + return(-errno); else if(n != sizeof(iov.iov_len)) *helper_pid_out = -1; @@ -590,16 +586,16 @@ int os_rcv_fd(int fd, int *helper_pid_out) cmsg = CMSG_FIRSTHDR(&msg); if(cmsg == NULL){ printk("rcv_fd didn't receive anything, error = %d\n", errno); - return -1; + return(-1); } - if((cmsg->cmsg_level != SOL_SOCKET) || + if((cmsg->cmsg_level != SOL_SOCKET) || (cmsg->cmsg_type != SCM_RIGHTS)){ printk("rcv_fd didn't receive a descriptor\n"); - return -1; + return(-1); } new = ((int *) CMSG_DATA(cmsg))[0]; - return new; + return(new); } int os_create_unix_socket(char *file, int len, int close_on_exec) @@ -627,7 +623,7 @@ int os_create_unix_socket(char *file, int len, int close_on_exec) if(err < 0) return -errno; - return sock; + return(sock); } void os_flush_stdout(void) @@ -658,5 +654,16 @@ int os_lock_file(int fd, int excl) printk("F_SETLK failed, file already locked by pid %d\n", lock.l_pid); err = save; out: - return err; + return(err); } + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/trunk/arch/um/os-Linux/irq.c b/trunk/arch/um/os-Linux/irq.c index 7555bf9c33d9..3788d4568d33 100644 --- a/trunk/arch/um/os-Linux/irq.c +++ b/trunk/arch/um/os-Linux/irq.c @@ -52,6 +52,11 @@ int os_waiting_for_events(struct irq_fd *active_fds) return n; } +int os_isatty(int fd) +{ + return isatty(fd); +} + int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) { if (pollfds_num == pollfds_size) { @@ -137,14 +142,17 @@ void os_set_ioignore(void) void init_irq_signals(int on_sigstack) { + __sighandler_t h; int flags; flags = on_sigstack ? SA_ONSTACK : 0; + if (timer_irq_inited) + h = (__sighandler_t)alarm_handler; + else + h = boot_timer_handler; - set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, - flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); - set_handler(SIGALRM, (__sighandler_t) alarm_handler, - flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); + set_handler(SIGVTALRM, h, flags | SA_RESTART, + SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); signal(SIGWINCH, SIG_IGN); diff --git a/trunk/arch/um/os-Linux/process.c b/trunk/arch/um/os-Linux/process.c index b1cda818f5b5..233be2f4f8cb 100644 --- a/trunk/arch/um/os-Linux/process.c +++ b/trunk/arch/um/os-Linux/process.c @@ -250,24 +250,25 @@ void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1); } -void init_new_thread_signals(void) +void init_new_thread_signals(int altstack) { - set_handler(SIGSEGV, (__sighandler_t) sig_handler, SA_ONSTACK, + int flags = altstack ? SA_ONSTACK : 0; + + set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); - set_handler(SIGTRAP, (__sighandler_t) sig_handler, SA_ONSTACK, + set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); - set_handler(SIGFPE, (__sighandler_t) sig_handler, SA_ONSTACK, + set_handler(SIGFPE, (__sighandler_t) sig_handler, flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); - set_handler(SIGILL, (__sighandler_t) sig_handler, SA_ONSTACK, + set_handler(SIGILL, (__sighandler_t) sig_handler, flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); - set_handler(SIGBUS, (__sighandler_t) sig_handler, SA_ONSTACK, + set_handler(SIGBUS, (__sighandler_t) sig_handler, flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); set_handler(SIGUSR2, (__sighandler_t) sig_handler, - SA_ONSTACK, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, - -1); + flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); signal(SIGHUP, SIG_IGN); - init_irq_signals(1); + init_irq_signals(altstack); } int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) diff --git a/trunk/arch/um/os-Linux/sigio.c b/trunk/arch/um/os-Linux/sigio.c index 0ecac563c7b3..00e9388e947a 100644 --- a/trunk/arch/um/os-Linux/sigio.c +++ b/trunk/arch/um/os-Linux/sigio.c @@ -43,13 +43,13 @@ struct pollfds { /* Protected by sigio_lock(). Used by the sigio thread, but the UML thread * synchronizes with it. */ -static struct pollfds current_poll = { +struct pollfds current_poll = { .poll = NULL, .size = 0, .used = 0 }; -static struct pollfds next_poll = { +struct pollfds next_poll = { .poll = NULL, .size = 0, .used = 0 @@ -156,7 +156,7 @@ static void update_thread(void) set_signals(flags); } -static int add_sigio_fd(int fd, int read) +int add_sigio_fd(int fd, int read) { int err = 0, i, n, events; @@ -191,13 +191,6 @@ int ignore_sigio_fd(int fd) struct pollfd *p; int err = 0, i, n = 0; - /* This is called from exitcalls elsewhere in UML - if - * sigio_cleanup has already run, then update_thread will hang - * or fail because the thread is no longer running. - */ - if(write_sigio_pid == -1) - return -EIO; - sigio_lock(); for(i = 0; i < current_poll.used; i++){ if(current_poll.poll[i].fd == fd) break; @@ -222,7 +215,7 @@ int ignore_sigio_fd(int fd) update_thread(); out: sigio_unlock(); - return err; + return(err); } static struct pollfd *setup_initial_poll(int fd) @@ -240,7 +233,7 @@ static struct pollfd *setup_initial_poll(int fd) return p; } -static void write_sigio_workaround(void) +void write_sigio_workaround(void) { unsigned long stack; struct pollfd *p; @@ -321,24 +314,10 @@ static void write_sigio_workaround(void) close(l_write_sigio_fds[1]); } -void maybe_sigio_broken(int fd, int read) -{ - if(!isatty(fd)) - return; - - if((read || pty_output_sigio) && (!read || pty_close_sigio)) - return; - - write_sigio_workaround(); - add_sigio_fd(fd, read); -} - -static void sigio_cleanup(void) +void sigio_cleanup(void) { if(write_sigio_pid != -1){ os_kill_process(write_sigio_pid, 1); write_sigio_pid = -1; } } - -__uml_exitcall(sigio_cleanup); diff --git a/trunk/arch/um/os-Linux/signal.c b/trunk/arch/um/os-Linux/signal.c index 60e4faedf254..f11b3124a0c8 100644 --- a/trunk/arch/um/os-Linux/signal.c +++ b/trunk/arch/um/os-Linux/signal.c @@ -106,6 +106,29 @@ void alarm_handler(ARCH_SIGHDLR_PARAM) set_signals(enabled); } +extern void do_boot_timer_handler(struct sigcontext * sc); + +void boot_timer_handler(ARCH_SIGHDLR_PARAM) +{ + struct sigcontext *sc; + int enabled; + + ARCH_GET_SIGCONTEXT(sc, sig); + + enabled = signals_enabled; + if(!enabled){ + if(sig == SIGVTALRM) + pending |= SIGVTALRM_MASK; + else pending |= SIGALRM_MASK; + return; + } + + block_signals(); + + do_boot_timer_handler(sc); + set_signals(enabled); +} + void set_sigstack(void *sig_stack, int size) { stack_t stack = ((stack_t) { .ss_flags = 0, diff --git a/trunk/arch/um/os-Linux/skas/process.c b/trunk/arch/um/os-Linux/skas/process.c index bf35572d9cfa..bd89c6b99d5d 100644 --- a/trunk/arch/um/os-Linux/skas/process.c +++ b/trunk/arch/um/os-Linux/skas/process.c @@ -159,7 +159,7 @@ static int userspace_tramp(void *stack) ptrace(PTRACE_TRACEME, 0, 0, 0); - init_new_thread_signals(); + init_new_thread_signals(1); enable_timer(); if(!proc_mm){ diff --git a/trunk/arch/um/os-Linux/time.c b/trunk/arch/um/os-Linux/time.c index 4ae73c0e5485..280c4fb9b585 100644 --- a/trunk/arch/um/os-Linux/time.c +++ b/trunk/arch/um/os-Linux/time.c @@ -17,6 +17,11 @@ #include "kern_constants.h" #include "os.h" +/* XXX This really needs to be declared and initialized in a kernel file since + * it's in + */ +extern struct timespec wall_to_monotonic; + static void set_interval(int timer_type) { int usec = 1000000/hz(); @@ -66,7 +71,6 @@ void switch_timers(int to_real) errno); } -#ifdef UML_CONFIG_MODE_TT void uml_idle_timer(void) { if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR) @@ -76,7 +80,14 @@ void uml_idle_timer(void) SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1); set_interval(ITIMER_REAL); } -#endif + +void time_init(void) +{ + if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) + panic("Couldn't set SIGVTALRM handler"); + set_interval(ITIMER_VIRTUAL); + time_init_kern(); +} unsigned long long os_nsecs(void) { @@ -95,7 +106,15 @@ void idle_sleep(int secs) nanosleep(&ts, NULL); } +/* XXX This partly duplicates init_irq_signals */ + void user_time_init(void) { + set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, + SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, + SIGALRM, SIGUSR2, -1); + set_handler(SIGALRM, (__sighandler_t) alarm_handler, + SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, + SIGVTALRM, SIGUSR2, -1); set_interval(ITIMER_VIRTUAL); } diff --git a/trunk/arch/x86_64/defconfig b/trunk/arch/x86_64/defconfig index 83d389b8ebd8..e69d403949c8 100644 --- a/trunk/arch/x86_64/defconfig +++ b/trunk/arch/x86_64/defconfig @@ -1,13 +1,11 @@ # # 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.17-git6 +# Sat Jun 24 00:52:28 2006 # CONFIG_X86_64=y CONFIG_64BIT=y CONFIG_X86=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_STACKTRACE_SUPPORT=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_MMU=y CONFIG_RWSEM_GENERIC_SPINLOCK=y @@ -19,7 +17,6 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMI=y -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options @@ -55,12 +52,10 @@ 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 @@ -141,12 +136,10 @@ CONFIG_NEED_MULTIPLE_NODES=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_MIGRATION=y -CONFIG_RESOURCES_64BIT=y CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y CONFIG_OUT_OF_LINE_PFN_TO_PAGE=y CONFIG_NR_CPUS=32 CONFIG_HOTPLUG_CPU=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_IOMMU=y @@ -193,7 +186,6 @@ CONFIG_ACPI_BUTTON=y # CONFIG_ACPI_VIDEO is not set # CONFIG_ACPI_HOTKEY is not set CONFIG_ACPI_FAN=y -# CONFIG_ACPI_DOCK is not set CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_THERMAL=y @@ -208,7 +200,7 @@ CONFIG_ACPI_POWER=y CONFIG_ACPI_SYSTEM=y CONFIG_X86_PM_TIMER=y CONFIG_ACPI_CONTAINER=y -# CONFIG_ACPI_SBS is not set +CONFIG_ACPI_HOTPLUG_MEMORY=y # # CPU Frequency scaling @@ -809,7 +801,6 @@ 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 # @@ -879,9 +870,6 @@ CONFIG_SOFT_WATCHDOG=y # # CONFIG_USBPCWATCHDOG is not set CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_INTEL=y -CONFIG_HW_RANDOM_AMD=y -# CONFIG_HW_RANDOM_GEODE is not set # CONFIG_NVRAM is not set CONFIG_RTC=y # CONFIG_DTLK is not set @@ -898,7 +886,6 @@ CONFIG_AGP_INTEL=y # CONFIG_AGP_VIA is not set # CONFIG_DRM is not set # CONFIG_MWAVE is not set -# CONFIG_PC8736x_GPIO is not set CONFIG_RAW_DRIVER=y CONFIG_MAX_RAW_DEVS=256 CONFIG_HPET=y @@ -1043,8 +1030,8 @@ CONFIG_VIDEO_V4L2=y # # Graphics support # -# CONFIG_FIRMWARE_EDID is not set # CONFIG_FB is not set +CONFIG_VIDEO_SELECT=y # # Console display driver support @@ -1052,7 +1039,6 @@ CONFIG_VIDEO_V4L2=y CONFIG_VGA_CONSOLE=y CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256 -CONFIG_VIDEO_SELECT=y CONFIG_DUMMY_CONSOLE=y # @@ -1373,7 +1359,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 @@ -1439,24 +1424,16 @@ CONFIG_KPROBES=y # # Kernel hacking # -CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_PRINTK_TIME is not set CONFIG_MAGIC_SYSRQ=y -CONFIG_UNUSED_SYMBOLS=y CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB 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_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set +# CONFIG_DEBUG_SPINLOCK 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 @@ -1468,8 +1445,6 @@ CONFIG_STACK_UNWIND=y # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_RODATA is not set # CONFIG_IOMMU_DEBUG is not set -CONFIG_DEBUG_STACKOVERFLOW=y -# CONFIG_DEBUG_STACK_USAGE is not set # # Security options @@ -1493,4 +1468,3 @@ CONFIG_DEBUG_STACKOVERFLOW=y # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set -CONFIG_PLIST=y diff --git a/trunk/arch/x86_64/ia32/ia32_binfmt.c b/trunk/arch/x86_64/ia32/ia32_binfmt.c index a9dc0f3b5b51..926c4743d13b 100644 --- a/trunk/arch/x86_64/ia32/ia32_binfmt.c +++ b/trunk/arch/x86_64/ia32/ia32_binfmt.c @@ -182,7 +182,7 @@ struct elf_prpsinfo #define user user32 #define __ASM_X86_64_ELF_H 1 -#define elf_read_implies_exec(ex, executable_stack) (executable_stack != EXSTACK_DISABLE_X) +#define elf_read_implies_exec(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack)) //#include #include diff --git a/trunk/arch/x86_64/ia32/ptrace32.c b/trunk/arch/x86_64/ia32/ptrace32.c index 659c0722f6b8..a590b7a0d92d 100644 --- a/trunk/arch/x86_64/ia32/ptrace32.c +++ b/trunk/arch/x86_64/ia32/ptrace32.c @@ -202,24 +202,17 @@ static long ptrace32_siginfo(unsigned request, u32 pid, u32 addr, u32 data) { int ret; compat_siginfo_t *si32 = (compat_siginfo_t *)compat_ptr(data); - siginfo_t ssi; siginfo_t *si = compat_alloc_user_space(sizeof(siginfo_t)); if (request == PTRACE_SETSIGINFO) { - memset(&ssi, 0, sizeof(siginfo_t)); - ret = copy_siginfo_from_user32(&ssi, si32); + ret = copy_siginfo_from_user32(si, si32); if (ret) return ret; - if (copy_to_user(si, &ssi, sizeof(siginfo_t))) - return -EFAULT; } ret = sys_ptrace(request, pid, addr, (unsigned long)si); if (ret) return ret; - if (request == PTRACE_GETSIGINFO) { - if (copy_from_user(&ssi, si, sizeof(siginfo_t))) - return -EFAULT; - ret = copy_siginfo_to_user32(si32, &ssi); - } + if (request == PTRACE_GETSIGINFO) + ret = copy_siginfo_to_user32(si32, si); return ret; } diff --git a/trunk/arch/x86_64/kernel/e820.c b/trunk/arch/x86_64/kernel/e820.c index e56c2adf57a4..b8eee4c7888b 100644 --- a/trunk/arch/x86_64/kernel/e820.c +++ b/trunk/arch/x86_64/kernel/e820.c @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/early_printk.c b/trunk/arch/x86_64/kernel/early_printk.c index 140051e07fa6..b93ef5b51980 100644 --- a/trunk/arch/x86_64/kernel/early_printk.c +++ b/trunk/arch/x86_64/kernel/early_printk.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/mce_amd.c b/trunk/arch/x86_64/kernel/mce_amd.c index db2acbf7ad28..335200aa2737 100644 --- a/trunk/arch/x86_64/kernel/mce_amd.c +++ b/trunk/arch/x86_64/kernel/mce_amd.c @@ -597,7 +597,7 @@ static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank) /* sibling symlink */ if (shared_bank[bank] && b->blocks->cpu != cpu) { sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name); - per_cpu(threshold_banks, cpu)[bank] = NULL; + per_cpu(threshold_banks, i)[bank] = NULL; return; } diff --git a/trunk/arch/x86_64/kernel/pci-calgary.c b/trunk/arch/x86_64/kernel/pci-calgary.c index e71ed53b08fb..d91cb843f54d 100644 --- a/trunk/arch/x86_64/kernel/pci-calgary.c +++ b/trunk/arch/x86_64/kernel/pci-calgary.c @@ -1,11 +1,9 @@ /* * Derived from arch/powerpc/kernel/iommu.c * - * Copyright (C) IBM Corporation, 2006 + * Copyright (C) 2006 Jon Mason , IBM Corporation + * Copyright (C) 2006 Muli Ben-Yehuda , IBM Corporation * - * Author: Jon Mason - * Author: Muli Ben-Yehuda - * 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 diff --git a/trunk/arch/x86_64/kernel/setup.c b/trunk/arch/x86_64/kernel/setup.c index 8a099ff1f8bc..0925518b58d0 100644 --- a/trunk/arch/x86_64/kernel/setup.c +++ b/trunk/arch/x86_64/kernel/setup.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/smpboot.c b/trunk/arch/x86_64/kernel/smpboot.c index 975380207b46..b7c705969791 100644 --- a/trunk/arch/x86_64/kernel/smpboot.c +++ b/trunk/arch/x86_64/kernel/smpboot.c @@ -771,10 +771,12 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid) unsigned long start_rip; struct create_idle c_idle = { .cpu = cpu, - .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done), + .done = COMPLETION_INITIALIZER(c_idle.done), }; DECLARE_WORK(work, do_fork_idle, &c_idle); + lockdep_set_class(&c_idle.done.wait.lock, &waitqueue_lock_key); + /* allocate memory for gdts of secondary cpus. Hotplug is considered */ if (!cpu_gdt_descr[cpu].address && !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) { diff --git a/trunk/arch/x86_64/kernel/tce.c b/trunk/arch/x86_64/kernel/tce.c index d3a9e79e954c..8d4c67f61b8e 100644 --- a/trunk/arch/x86_64/kernel/tce.c +++ b/trunk/arch/x86_64/kernel/tce.c @@ -1,10 +1,8 @@ /* * Derived from arch/powerpc/platforms/pseries/iommu.c * - * Copyright (C) IBM Corporation, 2006 - * - * Author: Jon Mason - * Author: Muli Ben-Yehuda + * Copyright (C) 2006 Jon Mason , IBM Corporation + * Copyright (C) 2006 Muli Ben-Yehuda , IBM Corporation * * 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 diff --git a/trunk/arch/x86_64/kernel/traps.c b/trunk/arch/x86_64/kernel/traps.c index eb39a2775236..79d05c482072 100644 --- a/trunk/arch/x86_64/kernel/traps.c +++ b/trunk/arch/x86_64/kernel/traps.c @@ -76,13 +76,13 @@ int register_die_notifier(struct notifier_block *nb) vmalloc_sync_all(); return atomic_notifier_chain_register(&die_chain, nb); } -EXPORT_SYMBOL(register_die_notifier); /* used modular by kdb */ +EXPORT_SYMBOL(register_die_notifier); int unregister_die_notifier(struct notifier_block *nb) { return atomic_notifier_chain_unregister(&die_chain, nb); } -EXPORT_SYMBOL(unregister_die_notifier); /* used modular by kdb */ +EXPORT_SYMBOL(unregister_die_notifier); static inline void conditional_sti(struct pt_regs *regs) { diff --git a/trunk/arch/xtensa/kernel/setup.c b/trunk/arch/xtensa/kernel/setup.c index 82684d05910a..edb29410d953 100644 --- a/trunk/arch/xtensa/kernel/setup.c +++ b/trunk/arch/xtensa/kernel/setup.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/block/blktrace.c b/trunk/block/blktrace.c index b8c0702777ff..92925e7d9e6c 100644 --- a/trunk/block/blktrace.c +++ b/trunk/block/blktrace.c @@ -69,7 +69,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK /* * Bio action bits of interest */ -static u32 bio_act[5] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC), 0, BLK_TC_ACT(BLK_TC_AHEAD) }; +static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC) }; /* * More could be added as needed, taking care to increment the decrementer @@ -79,8 +79,6 @@ static u32 bio_act[5] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0)) #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)) /* * The worker for the various blk_add_trace*() types. Fills out a @@ -102,7 +100,6 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, what |= ddir_act[rw & WRITE]; what |= bio_act[trace_barrier_bit(rw)]; what |= bio_act[trace_sync_bit(rw)]; - what |= bio_act[trace_ahead_bit(rw)]; pid = tsk->pid; if (unlikely(act_log_check(bt, what, sector, pid))) diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index 61d6b3c65b66..ab17c7224bb6 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -3491,8 +3491,8 @@ EXPORT_SYMBOL(end_request); void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio) { - /* first two bits are identical in rq->flags and bio->bi_rw */ - rq->flags |= (bio->bi_rw & 3); + /* first three bits are identical in rq->flags and bio->bi_rw */ + rq->flags |= (bio->bi_rw & 7); rq->nr_phys_segments = bio_phys_segments(q, bio); rq->nr_hw_segments = bio_hw_segments(q, bio); diff --git a/trunk/drivers/acpi/Kconfig b/trunk/drivers/acpi/Kconfig index 56c5ba874623..fef7bab12244 100644 --- a/trunk/drivers/acpi/Kconfig +++ b/trunk/drivers/acpi/Kconfig @@ -107,6 +107,7 @@ config ACPI_BUTTON config ACPI_VIDEO tristate "Video" depends on X86 + default y help This driver implement the ACPI Extensions For Display Adapters for integrated graphics devices on motherboard, as specified in @@ -134,7 +135,8 @@ config ACPI_FAN config ACPI_DOCK tristate "Dock" - depends on EXPERIMENTAL + depends on !ACPI_IBM_DOCK + default y help This driver adds support for ACPI controlled docking stations @@ -212,7 +214,6 @@ config ACPI_IBM config ACPI_IBM_DOCK bool "Legacy Docking Station Support" depends on ACPI_IBM - depends on ACPI_DOCK=n default n ---help--- Allows the ibm_acpi driver to handle docking station events. @@ -356,6 +357,7 @@ config ACPI_SBS tristate "Smart Battery System (EXPERIMENTAL)" depends on X86 && I2C depends on EXPERIMENTAL + default y help This driver adds support for the Smart Battery System. Depends on I2C (Device Drivers ---> I2C support) diff --git a/trunk/drivers/acpi/ac.c b/trunk/drivers/acpi/ac.c index 96309b9660da..24ccf81d135f 100644 --- a/trunk/drivers/acpi/ac.c +++ b/trunk/drivers/acpi/ac.c @@ -72,7 +72,7 @@ struct acpi_ac { unsigned long state; }; -static const struct file_operations acpi_ac_fops = { +static struct file_operations acpi_ac_fops = { .open = acpi_ac_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c index 6e5221707d97..24bf4dca88cc 100644 --- a/trunk/drivers/acpi/battery.c +++ b/trunk/drivers/acpi/battery.c @@ -557,7 +557,7 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) return single_open(file, acpi_battery_read_alarm, PDE(inode)->data); } -static const struct file_operations acpi_battery_info_ops = { +static struct file_operations acpi_battery_info_ops = { .open = acpi_battery_info_open_fs, .read = seq_read, .llseek = seq_lseek, @@ -565,7 +565,7 @@ static const struct file_operations acpi_battery_info_ops = { .owner = THIS_MODULE, }; -static const struct file_operations acpi_battery_state_ops = { +static struct file_operations acpi_battery_state_ops = { .open = acpi_battery_state_open_fs, .read = seq_read, .llseek = seq_lseek, @@ -573,7 +573,7 @@ static const struct file_operations acpi_battery_state_ops = { .owner = THIS_MODULE, }; -static const struct file_operations acpi_battery_alarm_ops = { +static struct file_operations acpi_battery_alarm_ops = { .open = acpi_battery_alarm_open_fs, .read = seq_read, .write = acpi_battery_write_alarm, diff --git a/trunk/drivers/acpi/bus.c b/trunk/drivers/acpi/bus.c index b2977695e120..ea5a0496a4fd 100644 --- a/trunk/drivers/acpi/bus.c +++ b/trunk/drivers/acpi/bus.c @@ -192,8 +192,8 @@ 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", - device->kobj.name)); + printk(KERN_DEBUG "Device `[%s]' is not power manageable", + device->kobj.name); return -ENODEV; } /* diff --git a/trunk/drivers/acpi/button.c b/trunk/drivers/acpi/button.c index 5ef885e82c78..fd1ba05eab68 100644 --- a/trunk/drivers/acpi/button.c +++ b/trunk/drivers/acpi/button.c @@ -87,14 +87,14 @@ struct acpi_button { unsigned long pushed; }; -static const struct file_operations acpi_button_info_fops = { +static struct file_operations acpi_button_info_fops = { .open = acpi_button_info_open_fs, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations acpi_button_state_fops = { +static struct file_operations acpi_button_state_fops = { .open = acpi_button_state_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acpi/cm_sbs.c b/trunk/drivers/acpi/cm_sbs.c index a01ce6700bfe..574a75a166c5 100644 --- a/trunk/drivers/acpi/cm_sbs.c +++ b/trunk/drivers/acpi/cm_sbs.c @@ -39,43 +39,50 @@ ACPI_MODULE_NAME("cm_sbs") static struct proc_dir_entry *acpi_ac_dir; static struct proc_dir_entry *acpi_battery_dir; -static DEFINE_MUTEX(cm_sbs_mutex); +static struct semaphore cm_sbs_sem; -static int lock_ac_dir_cnt; -static int lock_battery_dir_cnt; +static int lock_ac_dir_cnt = 0; +static int lock_battery_dir_cnt = 0; struct proc_dir_entry *acpi_lock_ac_dir(void) { - mutex_lock(&cm_sbs_mutex); - if (!acpi_ac_dir) + + down(&cm_sbs_sem); + if (!acpi_ac_dir) { acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); + } if (acpi_ac_dir) { lock_ac_dir_cnt++; } else { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Cannot create %s\n", ACPI_AC_CLASS)); } - mutex_unlock(&cm_sbs_mutex); + up(&cm_sbs_sem); return acpi_ac_dir; } + EXPORT_SYMBOL(acpi_lock_ac_dir); void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param) { - mutex_lock(&cm_sbs_mutex); - if (acpi_ac_dir_param) + + down(&cm_sbs_sem); + if (acpi_ac_dir_param) { lock_ac_dir_cnt--; + } if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) { remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); acpi_ac_dir = 0; } - mutex_unlock(&cm_sbs_mutex); + up(&cm_sbs_sem); } + EXPORT_SYMBOL(acpi_unlock_ac_dir); struct proc_dir_entry *acpi_lock_battery_dir(void) { - mutex_lock(&cm_sbs_mutex); + + down(&cm_sbs_sem); if (!acpi_battery_dir) { acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); @@ -86,28 +93,39 @@ struct proc_dir_entry *acpi_lock_battery_dir(void) ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Cannot create %s\n", ACPI_BATTERY_CLASS)); } - mutex_unlock(&cm_sbs_mutex); + up(&cm_sbs_sem); return acpi_battery_dir; } + EXPORT_SYMBOL(acpi_lock_battery_dir); void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param) { - mutex_lock(&cm_sbs_mutex); - if (acpi_battery_dir_param) + + down(&cm_sbs_sem); + if (acpi_battery_dir_param) { lock_battery_dir_cnt--; + } if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param && acpi_battery_dir) { remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); acpi_battery_dir = 0; } - mutex_unlock(&cm_sbs_mutex); + up(&cm_sbs_sem); return; } + EXPORT_SYMBOL(acpi_unlock_battery_dir); static int __init acpi_cm_sbs_init(void) { + + if (acpi_disabled) + return 0; + + init_MUTEX(&cm_sbs_sem); + return 0; } + subsys_initcall(acpi_cm_sbs_init); diff --git a/trunk/drivers/acpi/dispatcher/dsinit.c b/trunk/drivers/acpi/dispatcher/dsinit.c index 1888c055d10f..daf51b5b5875 100644 --- a/trunk/drivers/acpi/dispatcher/dsinit.c +++ b/trunk/drivers/acpi/dispatcher/dsinit.c @@ -116,6 +116,16 @@ acpi_ds_init_one_object(acpi_handle obj_handle, case ACPI_TYPE_METHOD: + /* + * Set the execution data width (32 or 64) based upon the + * revision number of the parent ACPI table. + * TBD: This is really for possible future support of integer width + * on a per-table basis. Currently, we just use a global for the width. + */ + if (info->table_desc->pointer->revision == 1) { + node->flags |= ANOBJ_DATA_WIDTH_32; + } + info->method_count++; break; diff --git a/trunk/drivers/acpi/dispatcher/dsmethod.c b/trunk/drivers/acpi/dispatcher/dsmethod.c index cf888add3191..a39a33f4847a 100644 --- a/trunk/drivers/acpi/dispatcher/dsmethod.c +++ b/trunk/drivers/acpi/dispatcher/dsmethod.c @@ -134,7 +134,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc) union acpi_operand_object *mutex_desc; acpi_status status; - ACPI_FUNCTION_TRACE(ds_create_method_mutex); + ACPI_FUNCTION_NAME(ds_create_method_mutex); /* Create the new mutex object */ @@ -493,7 +493,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "****Restart [%4.4s] Op %p ReturnValueFromCallee %p\n", - acpi_ut_get_node_name(walk_state->method_node), + (char *)&walk_state->method_node->name, walk_state->method_call_op, return_desc)); ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, @@ -610,7 +610,6 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, acpi_os_release_mutex(method_desc->method.mutex->mutex. os_mutex); - method_desc->method.mutex->mutex.owner_thread = NULL; } } @@ -621,11 +620,27 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, */ method_node = walk_state->method_node; + /* Lock namespace for possible update */ + + status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE(status)) { + return_VOID; + } + + /* + * Delete any namespace entries created immediately underneath + * the method + */ + if (method_node && method_node->child) { + acpi_ns_delete_namespace_subtree(method_node); + } + /* - * Delete any namespace objects created anywhere within + * Delete any namespace entries created anywhere else within * the namespace by the execution of this method */ acpi_ns_delete_namespace_by_owner(method_desc->method.owner_id); + status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); } /* Decrement the thread count on the method */ diff --git a/trunk/drivers/acpi/dispatcher/dswexec.c b/trunk/drivers/acpi/dispatcher/dswexec.c index d7a616c3104e..b1ded62d0df1 100644 --- a/trunk/drivers/acpi/dispatcher/dswexec.c +++ b/trunk/drivers/acpi/dispatcher/dswexec.c @@ -313,10 +313,10 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, case AML_CLASS_EXECUTE: case AML_CLASS_CREATE: /* - * Most operators with arguments (except create_xxx_field operators) + * Most operators with arguments. * Start a new result/operand state */ - if (walk_state->op_info->object_type != ACPI_TYPE_BUFFER_FIELD) { + if (walk_state->opcode != AML_CREATE_FIELD_OP) { status = acpi_ds_result_stack_push(walk_state); } break; diff --git a/trunk/drivers/acpi/dock.c b/trunk/drivers/acpi/dock.c index 1c0a39d8b04e..510a94524298 100644 --- a/trunk/drivers/acpi/dock.c +++ b/trunk/drivers/acpi/dock.c @@ -627,7 +627,6 @@ static int dock_add(acpi_handle handle) INIT_LIST_HEAD(&dock_station->hotplug_devices); spin_lock_init(&dock_station->dd_lock); spin_lock_init(&dock_station->hp_lock); - ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); /* Find dependent devices */ acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index e5d796362854..8c5d7df7d343 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -929,7 +929,7 @@ static int acpi_ec_info_open_fs(struct inode *inode, struct file *file) return single_open(file, acpi_ec_read_info, PDE(inode)->data); } -static const struct file_operations acpi_ec_info_ops = { +static struct file_operations acpi_ec_info_ops = { .open = acpi_ec_info_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acpi/event.c b/trunk/drivers/acpi/event.c index 959a893c8d1f..a901b23e95e7 100644 --- a/trunk/drivers/acpi/event.c +++ b/trunk/drivers/acpi/event.c @@ -99,7 +99,7 @@ static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait) return 0; } -static const struct file_operations acpi_system_event_ops = { +static struct file_operations acpi_system_event_ops = { .open = acpi_system_open_event, .read = acpi_system_read_event, .release = acpi_system_close_event, diff --git a/trunk/drivers/acpi/events/evregion.c b/trunk/drivers/acpi/events/evregion.c index 21caae04fe85..094a17e4c86d 100644 --- a/trunk/drivers/acpi/events/evregion.c +++ b/trunk/drivers/acpi/events/evregion.c @@ -528,40 +528,34 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj, } } - /* - * If the region has been activated, call the setup handler - * with the deactivate notification - */ - if (region_obj->region.flags & AOPOBJ_SETUP_COMPLETE) { - region_setup = handler_obj->address_space.setup; - status = - region_setup(region_obj, - ACPI_REGION_DEACTIVATE, - handler_obj->address_space. - context, region_context); + /* Call the setup handler with the deactivate notification */ - /* Init routine may fail, Just ignore errors */ + region_setup = handler_obj->address_space.setup; + status = + region_setup(region_obj, ACPI_REGION_DEACTIVATE, + handler_obj->address_space.context, + region_context); - if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "from region handler - deactivate, [%s]", - acpi_ut_get_region_name - (region_obj->region. - space_id))); - } + /* Init routine may fail, Just ignore errors */ - region_obj->region.flags &= - ~(AOPOBJ_SETUP_COMPLETE); + if (ACPI_FAILURE(status)) { + ACPI_EXCEPTION((AE_INFO, status, + "from region init, [%s]", + acpi_ut_get_region_name + (region_obj->region.space_id))); } + region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); + /* * Remove handler reference in the region * - * NOTE: this doesn't mean that the region goes away, the region - * is just inaccessible as indicated to the _REG method + * NOTE: this doesn't mean that the region goes away + * The region is just inaccessible as indicated to + * the _REG method * - * If the region is on the handler's list, this must be the - * region's handler + * If the region is on the handler's list + * this better be the region's handler */ region_obj->region.handler = NULL; acpi_ut_remove_reference(handler_obj); diff --git a/trunk/drivers/acpi/events/evxface.c b/trunk/drivers/acpi/events/evxface.c index 923fd2b46955..4f948df17ab9 100644 --- a/trunk/drivers/acpi/events/evxface.c +++ b/trunk/drivers/acpi/events/evxface.c @@ -428,7 +428,7 @@ acpi_remove_notify_handler(acpi_handle device, node = acpi_ns_map_handle_to_node(device); if (!node) { status = AE_BAD_PARAMETER; - goto unlock_and_exit; + goto unlock; } /* Root Object */ @@ -442,7 +442,7 @@ acpi_remove_notify_handler(acpi_handle device, ((handler_type & ACPI_DEVICE_NOTIFY) && !acpi_gbl_device_notify.handler)) { status = AE_NOT_EXIST; - goto unlock_and_exit; + goto unlock; } /* Make sure all deferred tasks are completed */ @@ -474,7 +474,7 @@ acpi_remove_notify_handler(acpi_handle device, if (!acpi_ev_is_notify_object(node)) { status = AE_TYPE; - goto unlock_and_exit; + goto unlock; } /* Check for an existing internal object */ @@ -482,21 +482,17 @@ acpi_remove_notify_handler(acpi_handle device, obj_desc = acpi_ns_get_attached_object(node); if (!obj_desc) { status = AE_NOT_EXIST; - goto unlock_and_exit; + goto unlock; } /* Object exists - make sure there's an existing handler */ if (handler_type & ACPI_SYSTEM_NOTIFY) { notify_obj = obj_desc->common_notify.system_notify; - if (!notify_obj) { - status = AE_NOT_EXIST; - goto unlock_and_exit; - } - - if (notify_obj->notify.handler != handler) { + if ((!notify_obj) || + (notify_obj->notify.handler != handler)) { status = AE_BAD_PARAMETER; - goto unlock_and_exit; + goto unlock; } /* Make sure all deferred tasks are completed */ @@ -514,14 +510,10 @@ acpi_remove_notify_handler(acpi_handle device, if (handler_type & ACPI_DEVICE_NOTIFY) { notify_obj = obj_desc->common_notify.device_notify; - if (!notify_obj) { - status = AE_NOT_EXIST; - goto unlock_and_exit; - } - - if (notify_obj->notify.handler != handler) { + if ((!notify_obj) || + (notify_obj->notify.handler != handler)) { status = AE_BAD_PARAMETER; - goto unlock_and_exit; + goto unlock; } /* Make sure all deferred tasks are completed */ @@ -538,9 +530,9 @@ acpi_remove_notify_handler(acpi_handle device, } } - unlock_and_exit: +unlock: (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); - exit: +exit: if (ACPI_FAILURE(status)) ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler")); return_ACPI_STATUS(status); @@ -594,7 +586,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); if (!gpe_event_info) { status = AE_BAD_PARAMETER; - goto unlock_and_exit; + goto unlock; } /* Make sure that there isn't a handler there already */ @@ -602,7 +594,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { status = AE_ALREADY_EXISTS; - goto unlock_and_exit; + goto unlock; } /* Allocate and init handler object */ @@ -610,7 +602,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info)); if (!handler) { status = AE_NO_MEMORY; - goto unlock_and_exit; + goto unlock; } handler->address = address; @@ -621,7 +613,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, status = acpi_ev_disable_gpe(gpe_event_info); if (ACPI_FAILURE(status)) { - goto unlock_and_exit; + goto unlock; } /* Install the handler */ @@ -636,9 +628,9 @@ acpi_install_gpe_handler(acpi_handle gpe_device, acpi_os_release_lock(acpi_gbl_gpe_lock, flags); - unlock_and_exit: +unlock: (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - exit: +exit: if (ACPI_FAILURE(status)) ACPI_EXCEPTION((AE_INFO, status, "Installing notify handler failed")); diff --git a/trunk/drivers/acpi/events/evxfregn.c b/trunk/drivers/acpi/events/evxfregn.c index 83b12a9afa32..e8b86a0baad0 100644 --- a/trunk/drivers/acpi/events/evxfregn.c +++ b/trunk/drivers/acpi/events/evxfregn.c @@ -155,11 +155,7 @@ acpi_remove_address_space_handler(acpi_handle device, /* Convert and validate the device handle */ node = acpi_ns_map_handle_to_node(device); - if (!node || - ((node->type != ACPI_TYPE_DEVICE) && - (node->type != ACPI_TYPE_PROCESSOR) && - (node->type != ACPI_TYPE_THERMAL) && - (node != acpi_gbl_root_node))) { + if (!node) { status = AE_BAD_PARAMETER; goto unlock_and_exit; } @@ -182,13 +178,6 @@ acpi_remove_address_space_handler(acpi_handle device, if (handler_obj->address_space.space_id == space_id) { - /* Handler must be the same as the installed handler */ - - if (handler_obj->address_space.handler != handler) { - status = AE_BAD_PARAMETER; - goto unlock_and_exit; - } - /* Matched space_id, first dereference this in the Regions */ ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, diff --git a/trunk/drivers/acpi/executer/exconfig.c b/trunk/drivers/acpi/executer/exconfig.c index c8341fa5fe01..83fed079a276 100644 --- a/trunk/drivers/acpi/executer/exconfig.c +++ b/trunk/drivers/acpi/executer/exconfig.c @@ -502,6 +502,7 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle) * (Offset contains the table_id) */ acpi_ns_delete_namespace_by_owner(table_info->owner_id); + acpi_ut_release_owner_id(&table_info->owner_id); /* Delete the table itself */ diff --git a/trunk/drivers/acpi/executer/exconvrt.c b/trunk/drivers/acpi/executer/exconvrt.c index 544e81a6a438..b732e399b1ef 100644 --- a/trunk/drivers/acpi/executer/exconvrt.c +++ b/trunk/drivers/acpi/executer/exconvrt.c @@ -170,9 +170,6 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, return_ACPI_STATUS(AE_NO_MEMORY); } - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n", - ACPI_FORMAT_UINT64(result))); - /* Save the Result */ return_desc->integer.value = result; diff --git a/trunk/drivers/acpi/executer/exmutex.c b/trunk/drivers/acpi/executer/exmutex.c index 3a39c2e8e104..d8ac2877cf05 100644 --- a/trunk/drivers/acpi/executer/exmutex.c +++ b/trunk/drivers/acpi/executer/exmutex.c @@ -267,9 +267,9 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) { ACPI_ERROR((AE_INFO, "Thread %X cannot release Mutex [%4.4s] acquired by thread %X", - (u32) walk_state->thread->thread_id, + walk_state->thread->thread_id, acpi_ut_get_node_name(obj_desc->mutex.node), - (u32) obj_desc->mutex.owner_thread->thread_id)); + obj_desc->mutex.owner_thread->thread_id)); return_ACPI_STATUS(AE_AML_NOT_OWNER); } diff --git a/trunk/drivers/acpi/executer/exsystem.c b/trunk/drivers/acpi/executer/exsystem.c index 28aef3e69ecc..6b5d1e6ce94b 100644 --- a/trunk/drivers/acpi/executer/exsystem.c +++ b/trunk/drivers/acpi/executer/exsystem.c @@ -60,7 +60,7 @@ ACPI_MODULE_NAME("exsystem") * * DESCRIPTION: Implements a semaphore wait with a check to see if the * semaphore is available immediately. If it is not, the - * interpreter is released before waiting. + * interpreter is released. * ******************************************************************************/ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) @@ -110,9 +110,9 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) * * RETURN: Status * - * DESCRIPTION: Implements a mutex wait with a check to see if the - * mutex is available immediately. If it is not, the - * interpreter is released before waiting. + * DESCRIPTION: Implements a semaphore wait with a check to see if the + * semaphore is available immediately. If it is not, the + * interpreter is released. * ******************************************************************************/ diff --git a/trunk/drivers/acpi/fan.c b/trunk/drivers/acpi/fan.c index 045c89477e59..daed2460924d 100644 --- a/trunk/drivers/acpi/fan.c +++ b/trunk/drivers/acpi/fan.c @@ -120,7 +120,7 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, return count; } -static const struct file_operations acpi_fan_state_ops = { +static struct file_operations acpi_fan_state_ops = { .open = acpi_fan_state_open_fs, .read = seq_read, .write = acpi_fan_write_state, diff --git a/trunk/drivers/acpi/hotkey.c b/trunk/drivers/acpi/hotkey.c index 32c9d88fd196..fd81a0f5222f 100644 --- a/trunk/drivers/acpi/hotkey.c +++ b/trunk/drivers/acpi/hotkey.c @@ -184,7 +184,7 @@ static union acpi_hotkey *get_hotkey_by_event(struct *hotkey_list, int event); /* event based config */ -static const struct file_operations hotkey_config_fops = { +static struct file_operations hotkey_config_fops = { .open = hotkey_open_config, .read = seq_read, .write = hotkey_write_config, @@ -193,7 +193,7 @@ static const struct file_operations hotkey_config_fops = { }; /* polling based config */ -static const struct file_operations hotkey_poll_config_fops = { +static struct file_operations hotkey_poll_config_fops = { .open = hotkey_poll_open_config, .read = seq_read, .write = hotkey_write_config, @@ -202,7 +202,7 @@ static const struct file_operations hotkey_poll_config_fops = { }; /* hotkey driver info */ -static const struct file_operations hotkey_info_fops = { +static struct file_operations hotkey_info_fops = { .open = hotkey_info_open_fs, .read = seq_read, .llseek = seq_lseek, @@ -210,7 +210,7 @@ static const struct file_operations hotkey_info_fops = { }; /* action */ -static const struct file_operations hotkey_action_fops = { +static struct file_operations hotkey_action_fops = { .open = hotkey_action_open_fs, .read = seq_read, .write = hotkey_execute_aml_method, @@ -219,7 +219,7 @@ static const struct file_operations hotkey_action_fops = { }; /* polling results */ -static const struct file_operations hotkey_polling_fops = { +static struct file_operations hotkey_polling_fops = { .open = hotkey_polling_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acpi/namespace/nsalloc.c b/trunk/drivers/acpi/namespace/nsalloc.c index 55b407aae266..dc3f0739a46b 100644 --- a/trunk/drivers/acpi/namespace/nsalloc.c +++ b/trunk/drivers/acpi/namespace/nsalloc.c @@ -386,17 +386,14 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) * specific ID. Used to delete entire ACPI tables. All * reference counts are updated. * - * MUTEX: Locks namespace during deletion walk. - * ******************************************************************************/ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) { struct acpi_namespace_node *child_node; struct acpi_namespace_node *deletion_node; - struct acpi_namespace_node *parent_node; u32 level; - acpi_status status; + struct acpi_namespace_node *parent_node; ACPI_FUNCTION_TRACE_U32(ns_delete_namespace_by_owner, owner_id); @@ -404,13 +401,6 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) return_VOID; } - /* Lock namespace for possible update */ - - status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE(status)) { - return_VOID; - } - deletion_node = NULL; parent_node = acpi_gbl_root_node; child_node = NULL; @@ -479,6 +469,5 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) } } - (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); return_VOID; } diff --git a/trunk/drivers/acpi/osl.c b/trunk/drivers/acpi/osl.c index b7d1514cd199..eedb05c6dc7b 100644 --- a/trunk/drivers/acpi/osl.c +++ b/trunk/drivers/acpi/osl.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -135,6 +136,16 @@ void acpi_os_vprintf(const char *fmt, va_list args) #endif } + +extern int acpi_in_resume; +void *acpi_os_allocate(acpi_size size) +{ + if (acpi_in_resume) + return kmalloc(size, GFP_ATOMIC); + else + return kmalloc(size, GFP_KERNEL); +} + acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr) { if (efi_enabled) { @@ -582,6 +593,16 @@ static void acpi_os_execute_deferred(void *context) return; } +static int acpi_os_execute_thread(void *context) +{ + struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context; + if (dpc) { + dpc->function(dpc->context); + kfree(dpc); + } + do_exit(0); +} + /******************************************************************************* * * FUNCTION: acpi_os_execute @@ -603,16 +624,10 @@ acpi_status acpi_os_execute(acpi_execute_type type, acpi_status status = AE_OK; struct acpi_os_dpc *dpc; struct work_struct *task; - - ACPI_FUNCTION_TRACE("os_queue_for_execution"); - - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, - "Scheduling function [%p(%p)] for deferred execution.\n", - function, context)); + struct task_struct *p; if (!function) - return_ACPI_STATUS(AE_BAD_PARAMETER); - + return AE_BAD_PARAMETER; /* * Allocate/initialize DPC structure. Note that this memory will be * freed by the callee. The kernel handles the tq_struct list in a @@ -623,27 +638,34 @@ acpi_status acpi_os_execute(acpi_execute_type type, * We can save time and code by allocating the DPC and tq_structs * from the same memory. */ - - dpc = - kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct), - GFP_ATOMIC); + if (type == OSL_NOTIFY_HANDLER) { + dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_KERNEL); + } else { + dpc = kmalloc(sizeof(struct acpi_os_dpc) + + sizeof(struct work_struct), GFP_ATOMIC); + } if (!dpc) - return_ACPI_STATUS(AE_NO_MEMORY); - + return AE_NO_MEMORY; dpc->function = function; dpc->context = context; - task = (void *)(dpc + 1); - INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); - - if (!queue_work(kacpid_wq, task)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Call to queue_work() failed.\n")); - kfree(dpc); - status = AE_ERROR; + if (type == OSL_NOTIFY_HANDLER) { + p = kthread_create(acpi_os_execute_thread, dpc, "kacpid_notify"); + if (!IS_ERR(p)) { + wake_up_process(p); + } else { + status = AE_NO_MEMORY; + kfree(dpc); + } + } else { + task = (void *)(dpc + 1); + INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); + if (!queue_work(kacpid_wq, task)) { + status = AE_ERROR; + kfree(dpc); + } } - - return_ACPI_STATUS(status); + return status; } EXPORT_SYMBOL(acpi_os_execute); @@ -1093,6 +1115,26 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) return (AE_OK); } +/******************************************************************************* + * + * FUNCTION: acpi_os_acquire_object + * + * PARAMETERS: Cache - Handle to cache object + * ReturnObject - Where the object is returned + * + * RETURN: Status + * + * DESCRIPTION: Return a zero-filled object. + * + ******************************************************************************/ + +void *acpi_os_acquire_object(acpi_cache_t * cache) +{ + void *object = kmem_cache_zalloc(cache, GFP_KERNEL); + WARN_ON(!object); + return object; +} + /****************************************************************************** * * FUNCTION: acpi_os_validate_interface diff --git a/trunk/drivers/acpi/parser/psutils.c b/trunk/drivers/acpi/parser/psutils.c index d405387b7414..182474ae8ce9 100644 --- a/trunk/drivers/acpi/parser/psutils.c +++ b/trunk/drivers/acpi/parser/psutils.c @@ -139,10 +139,12 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode) /* The generic op (default) is by far the most common (16 to 1) */ op = acpi_os_acquire_object(acpi_gbl_ps_node_cache); + memset(op, 0, sizeof(struct acpi_parse_obj_common)); } else { /* Extended parseop */ op = acpi_os_acquire_object(acpi_gbl_ps_node_ext_cache); + memset(op, 0, sizeof(struct acpi_parse_obj_named)); } /* Initialize the Op */ diff --git a/trunk/drivers/acpi/pci_link.c b/trunk/drivers/acpi/pci_link.c index 7f3e7e77e794..8197c0e40769 100644 --- a/trunk/drivers/acpi/pci_link.c +++ b/trunk/drivers/acpi/pci_link.c @@ -780,6 +780,11 @@ static int acpi_pci_link_resume(struct acpi_pci_link *link) return 0; } +/* + * FIXME: this is a workaround to avoid nasty warning. It will be removed + * after every device calls pci_disable_device in .resume. + */ +int acpi_in_resume; static int irqrouter_resume(struct sys_device *dev) { struct list_head *node = NULL; @@ -789,6 +794,7 @@ static int irqrouter_resume(struct sys_device *dev) /* Make sure SCI is enabled again (Apple firmware bug?) */ acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK); + acpi_in_resume = 1; list_for_each(node, &acpi_link.entries) { link = list_entry(node, struct acpi_pci_link, node); if (!link) { @@ -797,6 +803,7 @@ static int irqrouter_resume(struct sys_device *dev) } acpi_pci_link_resume(link); } + acpi_in_resume = 0; return 0; } diff --git a/trunk/drivers/acpi/power.c b/trunk/drivers/acpi/power.c index fec225d1b6b7..5d3447f4582c 100644 --- a/trunk/drivers/acpi/power.c +++ b/trunk/drivers/acpi/power.c @@ -80,7 +80,7 @@ struct acpi_power_resource { static struct list_head acpi_power_resource_list; -static const struct file_operations acpi_power_fops = { +static struct file_operations acpi_power_fops = { .open = acpi_power_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acpi/processor_core.c b/trunk/drivers/acpi/processor_core.c index b13d64415b7a..52674323b14d 100644 --- a/trunk/drivers/acpi/processor_core.c +++ b/trunk/drivers/acpi/processor_core.c @@ -102,7 +102,7 @@ static struct acpi_driver acpi_processor_driver = { #define INSTALL_NOTIFY_HANDLER 1 #define UNINSTALL_NOTIFY_HANDLER 2 -static const struct file_operations acpi_processor_info_fops = { +static struct file_operations acpi_processor_info_fops = { .open = acpi_processor_info_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index 71066066d626..8e9c26aae8fe 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -1070,7 +1070,7 @@ static int acpi_processor_power_open_fs(struct inode *inode, struct file *file) PDE(inode)->data); } -static const struct file_operations acpi_processor_power_fops = { +static struct file_operations acpi_processor_power_fops = { .open = acpi_processor_power_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acpi/sleep/proc.c b/trunk/drivers/acpi/sleep/proc.c index 34962578039d..4696a85a98b9 100644 --- a/trunk/drivers/acpi/sleep/proc.c +++ b/trunk/drivers/acpi/sleep/proc.c @@ -434,7 +434,7 @@ acpi_system_wakeup_device_open_fs(struct inode *inode, struct file *file) PDE(inode)->data); } -static const struct file_operations acpi_system_wakeup_device_fops = { +static struct file_operations acpi_system_wakeup_device_fops = { .open = acpi_system_wakeup_device_open_fs, .read = seq_read, .write = acpi_system_write_wakeup_device, @@ -443,7 +443,7 @@ static const struct file_operations acpi_system_wakeup_device_fops = { }; #ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP -static const struct file_operations acpi_system_sleep_fops = { +static struct file_operations acpi_system_sleep_fops = { .open = acpi_system_sleep_open_fs, .read = seq_read, .write = acpi_system_write_sleep, @@ -452,7 +452,7 @@ static const struct file_operations acpi_system_sleep_fops = { }; #endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ -static const struct file_operations acpi_system_alarm_fops = { +static struct file_operations acpi_system_alarm_fops = { .open = acpi_system_alarm_open_fs, .read = seq_read, .write = acpi_system_write_alarm, diff --git a/trunk/drivers/acpi/system.c b/trunk/drivers/acpi/system.c index d86dcb3c2366..c3bb7faad75e 100644 --- a/trunk/drivers/acpi/system.c +++ b/trunk/drivers/acpi/system.c @@ -57,7 +57,7 @@ static int acpi_system_info_open_fs(struct inode *inode, struct file *file) return single_open(file, acpi_system_read_info, PDE(inode)->data); } -static const struct file_operations acpi_system_info_ops = { +static struct file_operations acpi_system_info_ops = { .open = acpi_system_info_open_fs, .read = seq_read, .llseek = seq_lseek, @@ -67,7 +67,7 @@ static const struct file_operations acpi_system_info_ops = { static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t, loff_t *); -static const struct file_operations acpi_system_dsdt_ops = { +static struct file_operations acpi_system_dsdt_ops = { .read = acpi_system_read_dsdt, }; @@ -94,7 +94,7 @@ acpi_system_read_dsdt(struct file *file, static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t, loff_t *); -static const struct file_operations acpi_system_fadt_ops = { +static struct file_operations acpi_system_fadt_ops = { .read = acpi_system_read_fadt, }; diff --git a/trunk/drivers/acpi/tables/tbget.c b/trunk/drivers/acpi/tables/tbget.c index 7856db759af0..99eacceff563 100644 --- a/trunk/drivers/acpi/tables/tbget.c +++ b/trunk/drivers/acpi/tables/tbget.c @@ -320,16 +320,6 @@ acpi_tb_get_this_table(struct acpi_pointer *address, ACPI_FUNCTION_TRACE(tb_get_this_table); - /* Validate minimum length */ - - if (header->length < sizeof(struct acpi_table_header)) { - ACPI_ERROR((AE_INFO, - "Table length (%X) is smaller than minimum (%X)", - header->length, sizeof(struct acpi_table_header))); - - return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); - } - /* * Flags contains the current processor mode (Virtual or Physical * addressing) The pointer_type is either Logical or Physical @@ -366,7 +356,7 @@ acpi_tb_get_this_table(struct acpi_pointer *address, */ status = acpi_os_map_memory(address->pointer.physical, (acpi_size) header->length, - ACPI_CAST_PTR(void, &full_table)); + (void *)&full_table); if (ACPI_FAILURE(status)) { ACPI_ERROR((AE_INFO, "Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X", diff --git a/trunk/drivers/acpi/tables/tbinstal.c b/trunk/drivers/acpi/tables/tbinstal.c index 1668a232fb67..7ca2df75bb11 100644 --- a/trunk/drivers/acpi/tables/tbinstal.c +++ b/trunk/drivers/acpi/tables/tbinstal.c @@ -256,7 +256,7 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type, status = acpi_ut_allocate_owner_id(&table_desc->owner_id); if (ACPI_FAILURE(status)) { - goto error_exit1; + return_ACPI_STATUS(status); } /* Install the table into the global data structure */ @@ -274,8 +274,8 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type, * at this location, so return an error. */ if (list_head->next) { - status = AE_ALREADY_EXISTS; - goto error_exit2; + ACPI_FREE(table_desc); + return_ACPI_STATUS(AE_ALREADY_EXISTS); } table_desc->next = list_head->next; @@ -335,17 +335,6 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type, table_info->owner_id = table_desc->owner_id; table_info->installed_desc = table_desc; return_ACPI_STATUS(AE_OK); - - /* Error exit with cleanup */ - - error_exit2: - - acpi_ut_release_owner_id(&table_desc->owner_id); - - error_exit1: - - ACPI_FREE(table_desc); - return_ACPI_STATUS(status); } /******************************************************************************* @@ -536,10 +525,6 @@ struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc acpi_tb_delete_single_table(table_desc); - /* Free the owner ID associated with this table */ - - acpi_ut_release_owner_id(&table_desc->owner_id); - /* Free the table descriptor */ next_desc = table_desc->next; diff --git a/trunk/drivers/acpi/tables/tbrsdt.c b/trunk/drivers/acpi/tables/tbrsdt.c index 0ad3dbb9ebca..abcb08c2592a 100644 --- a/trunk/drivers/acpi/tables/tbrsdt.c +++ b/trunk/drivers/acpi/tables/tbrsdt.c @@ -183,17 +183,6 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr) ACPI_FUNCTION_ENTRY(); - /* Validate minimum length */ - - if (table_ptr->length < sizeof(struct acpi_table_header)) { - ACPI_ERROR((AE_INFO, - "RSDT/XSDT length (%X) is smaller than minimum (%X)", - table_ptr->length, - sizeof(struct acpi_table_header))); - - return (AE_INVALID_TABLE_LENGTH); - } - /* Search for appropriate signature, RSDT or XSDT */ if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { @@ -221,7 +210,7 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr) ACPI_ERROR((AE_INFO, "Looking for XSDT")); } - ACPI_DUMP_BUFFER(ACPI_CAST_PTR(char, table_ptr), 48); + ACPI_DUMP_BUFFER((char *)table_ptr, 48); return (AE_BAD_SIGNATURE); } @@ -269,7 +258,7 @@ acpi_status acpi_tb_get_table_rsdt(void) status = acpi_tb_validate_rsdt(table_info.pointer); if (ACPI_FAILURE(status)) { - goto error_cleanup; + return_ACPI_STATUS(status); } /* Get the number of tables defined in the RSDT or XSDT */ @@ -281,14 +270,14 @@ acpi_status acpi_tb_get_table_rsdt(void) status = acpi_tb_convert_to_xsdt(&table_info); if (ACPI_FAILURE(status)) { - goto error_cleanup; + return_ACPI_STATUS(status); } /* Save the table pointers and allocation info */ status = acpi_tb_init_table_descriptor(ACPI_TABLE_ID_XSDT, &table_info); if (ACPI_FAILURE(status)) { - goto error_cleanup; + return_ACPI_STATUS(status); } acpi_gbl_XSDT = @@ -296,12 +285,4 @@ acpi_status acpi_tb_get_table_rsdt(void) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT)); return_ACPI_STATUS(status); - - error_cleanup: - - /* Free table allocated by acpi_tb_get_table */ - - acpi_tb_delete_single_table(&table_info); - - return_ACPI_STATUS(status); } diff --git a/trunk/drivers/acpi/tables/tbxface.c b/trunk/drivers/acpi/tables/tbxface.c index 7767987be15a..4e91f2984815 100644 --- a/trunk/drivers/acpi/tables/tbxface.c +++ b/trunk/drivers/acpi/tables/tbxface.c @@ -134,8 +134,8 @@ ACPI_EXPORT_SYMBOL(acpi_load_tables) * RETURN: Status * * DESCRIPTION: This function is called to load a table from the caller's - * buffer. The buffer must contain an entire ACPI Table including - * a valid header. The header fields will be verified, and if it + * buffer. The buffer must contain an entire ACPI Table including + * a valid header. The header fields will be verified, and if it * is determined that the table is invalid, the call will fail. * ******************************************************************************/ @@ -245,18 +245,15 @@ acpi_status acpi_unload_table(acpi_table_type table_type) /* Find all tables of the requested type */ table_desc = acpi_gbl_table_lists[table_type].next; - if (!table_desc) { - return_ACPI_STATUS(AE_NOT_EXIST); - } - while (table_desc) { /* - * Delete all namespace objects owned by this table. Note that these - * objects can appear anywhere in the namespace by virtue of the AML - * "Scope" operator. Thus, we need to track ownership by an ID, not + * Delete all namespace entries owned by this table. Note that these + * entries can appear anywhere in the namespace by virtue of the AML + * "Scope" operator. Thus, we need to track ownership by an ID, not * simply a position within the hierarchy */ acpi_ns_delete_namespace_by_owner(table_desc->owner_id); + acpi_ut_release_owner_id(&table_desc->owner_id); table_desc = table_desc->next; } @@ -278,12 +275,12 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table) * see acpi_gbl_acpi_table_flag * out_table_header - pointer to the struct acpi_table_header if successful * - * DESCRIPTION: This function is called to get an ACPI table header. The caller + * DESCRIPTION: This function is called to get an ACPI table header. The caller * supplies an pointer to a data area sufficient to contain an ACPI * struct acpi_table_header structure. * * The header contains a length field that can be used to determine - * the size of the buffer needed to contain the entire table. This + * the size of the buffer needed to contain the entire table. This * function is not valid for the RSD PTR table since it does not * have a standard header and is fixed length. * @@ -325,8 +322,7 @@ acpi_get_table_header(acpi_table_type table_type, /* Copy the header to the caller's buffer */ - ACPI_MEMCPY(ACPI_CAST_PTR(void, out_table_header), - ACPI_CAST_PTR(void, tbl_ptr), + ACPI_MEMCPY((void *)out_table_header, (void *)tbl_ptr, sizeof(struct acpi_table_header)); return_ACPI_STATUS(status); @@ -348,10 +344,10 @@ ACPI_EXPORT_SYMBOL(acpi_get_table_header) * * RETURN: Status * - * DESCRIPTION: This function is called to get an ACPI table. The caller + * DESCRIPTION: This function is called to get an ACPI table. The caller * supplies an out_buffer large enough to contain the entire ACPI - * table. The caller should call the acpi_get_table_header function - * first to determine the buffer size needed. Upon completion + * table. The caller should call the acpi_get_table_header function + * first to determine the buffer size needed. Upon completion * the out_buffer->Length field will indicate the number of bytes * copied into the out_buffer->buf_ptr buffer. This table will be * a complete table including the header. @@ -421,9 +417,7 @@ acpi_get_table(acpi_table_type table_type, /* Copy the table to the buffer */ - ACPI_MEMCPY(ACPI_CAST_PTR(void, ret_buffer->pointer), - ACPI_CAST_PTR(void, tbl_ptr), table_length); - + ACPI_MEMCPY((void *)ret_buffer->pointer, (void *)tbl_ptr, table_length); return_ACPI_STATUS(AE_OK); } diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 5753d06b7860..503c0b99db12 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -176,21 +176,21 @@ struct acpi_thermal { struct timer_list timer; }; -static const struct file_operations acpi_thermal_state_fops = { +static struct file_operations acpi_thermal_state_fops = { .open = acpi_thermal_state_open_fs, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations acpi_thermal_temp_fops = { +static struct file_operations acpi_thermal_temp_fops = { .open = acpi_thermal_temp_open_fs, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations acpi_thermal_trip_fops = { +static struct file_operations acpi_thermal_trip_fops = { .open = acpi_thermal_trip_open_fs, .read = seq_read, .write = acpi_thermal_write_trip_points, @@ -198,7 +198,7 @@ static const struct file_operations acpi_thermal_trip_fops = { .release = single_release, }; -static const struct file_operations acpi_thermal_cooling_fops = { +static struct file_operations acpi_thermal_cooling_fops = { .open = acpi_thermal_cooling_open_fs, .read = seq_read, .write = acpi_thermal_write_cooling_mode, @@ -206,7 +206,7 @@ static const struct file_operations acpi_thermal_cooling_fops = { .release = single_release, }; -static const struct file_operations acpi_thermal_polling_fops = { +static struct file_operations acpi_thermal_polling_fops = { .open = acpi_thermal_polling_open_fs, .read = seq_read, .write = acpi_thermal_write_polling, @@ -1359,28 +1359,13 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) static int acpi_thermal_resume(struct acpi_device *device, int state) { struct acpi_thermal *tz = NULL; - int i; if (!device || !acpi_driver_data(device)) return -EINVAL; tz = (struct acpi_thermal *)acpi_driver_data(device); - acpi_thermal_get_temperature(tz); - - for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { - if (tz->trips.active[i].flags.valid) { - tz->temperature = tz->trips.active[i].temperature; - tz->trips.active[i].flags.enabled = 0; - - acpi_thermal_active(tz); - - tz->state.active |= tz->trips.active[i].flags.enabled; - tz->state.active_index = i; - } - } - - acpi_thermal_check(tz); + acpi_thermal_check(tz); return AE_OK; } diff --git a/trunk/drivers/acpi/utilities/utalloc.c b/trunk/drivers/acpi/utilities/utalloc.c index f6cbc0b1bfd0..5cff17dc78b3 100644 --- a/trunk/drivers/acpi/utilities/utalloc.c +++ b/trunk/drivers/acpi/utilities/utalloc.c @@ -285,7 +285,6 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, return (status); } -#ifdef NOT_USED_BY_LINUX /******************************************************************************* * * FUNCTION: acpi_ut_allocate @@ -361,4 +360,3 @@ void *acpi_ut_allocate_zeroed(acpi_size size, return (allocation); } -#endif diff --git a/trunk/drivers/acpi/utilities/utdebug.c b/trunk/drivers/acpi/utilities/utdebug.c index bb1eaf9aa653..5ec1cfcc611d 100644 --- a/trunk/drivers/acpi/utilities/utdebug.c +++ b/trunk/drivers/acpi/utilities/utdebug.c @@ -47,7 +47,7 @@ ACPI_MODULE_NAME("utdebug") #ifdef ACPI_DEBUG_OUTPUT -static acpi_thread_id acpi_gbl_prev_thread_id; +static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; static char *acpi_gbl_fn_entry_str = "----Entry"; static char *acpi_gbl_fn_exit_str = "----Exit-"; @@ -181,7 +181,7 @@ acpi_ut_debug_print(u32 requested_debug_level, if (ACPI_LV_THREADS & acpi_dbg_level) { acpi_os_printf ("\n**** Context Switch from TID %X to TID %X ****\n\n", - (u32) acpi_gbl_prev_thread_id, (u32) thread_id); + acpi_gbl_prev_thread_id, thread_id); } acpi_gbl_prev_thread_id = thread_id; diff --git a/trunk/drivers/acpi/utilities/utdelete.c b/trunk/drivers/acpi/utilities/utdelete.c index 9d3f1149ba21..38ebe1c54330 100644 --- a/trunk/drivers/acpi/utilities/utdelete.c +++ b/trunk/drivers/acpi/utilities/utdelete.c @@ -447,16 +447,11 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) */ switch (ACPI_GET_OBJECT_TYPE(object)) { case ACPI_TYPE_DEVICE: - case ACPI_TYPE_PROCESSOR: - case ACPI_TYPE_POWER: - case ACPI_TYPE_THERMAL: - /* Update the notify objects for these types (if present) */ - - acpi_ut_update_ref_count(object->common_notify. - system_notify, action); - acpi_ut_update_ref_count(object->common_notify. - device_notify, action); + acpi_ut_update_ref_count(object->device.system_notify, + action); + acpi_ut_update_ref_count(object->device.device_notify, + action); break; case ACPI_TYPE_PACKAGE: diff --git a/trunk/drivers/acpi/utilities/utmisc.c b/trunk/drivers/acpi/utilities/utmisc.c index 6d8a8211be90..33268310c738 100644 --- a/trunk/drivers/acpi/utilities/utmisc.c +++ b/trunk/drivers/acpi/utilities/utmisc.c @@ -65,7 +65,7 @@ ACPI_MODULE_NAME("utmisc") u8 acpi_ut_is_aml_table(struct acpi_table_header *table) { - /* These are the only tables that contain executable AML */ + /* Ignore tables that contain AML */ if (ACPI_COMPARE_NAME(table->signature, DSDT_SIG) || ACPI_COMPARE_NAME(table->signature, PSDT_SIG) || @@ -419,15 +419,10 @@ void acpi_ut_set_integer_width(u8 revision) { if (revision <= 1) { - - /* 32-bit case */ - acpi_gbl_integer_bit_width = 32; acpi_gbl_integer_nybble_width = 8; acpi_gbl_integer_byte_width = 4; } else { - /* 64-bit case (ACPI 2.0+) */ - acpi_gbl_integer_bit_width = 64; acpi_gbl_integer_nybble_width = 16; acpi_gbl_integer_byte_width = 8; @@ -507,7 +502,6 @@ acpi_ut_display_init_pathname(u8 type, * FUNCTION: acpi_ut_valid_acpi_char * * PARAMETERS: Char - The character to be examined - * Position - Byte position (0-3) * * RETURN: TRUE if the character is valid, FALSE otherwise * @@ -615,9 +609,7 @@ acpi_name acpi_ut_repair_name(acpi_name name) * * RETURN: Status and Converted value * - * DESCRIPTION: Convert a string into an unsigned value. Performs either a - * 32-bit or 64-bit conversion, depending on the current mode - * of the interpreter. + * DESCRIPTION: Convert a string into an unsigned value. * NOTE: Does not support Octal strings, not needed. * ******************************************************************************/ @@ -635,7 +627,7 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) u8 sign_of0x = 0; u8 term = 0; - ACPI_FUNCTION_TRACE_STR(ut_stroul64, string); + ACPI_FUNCTION_TRACE(ut_stroul64); switch (base) { case ACPI_ANY_BASE: @@ -683,13 +675,11 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) } } - /* - * Perform a 32-bit or 64-bit conversion, depending upon the current - * execution mode of the interpreter - */ dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; - /* Main loop: convert the string to a 32- or 64-bit integer */ + /* At least one character in the string here */ + + /* Main loop: convert the string to a 64-bit integer */ while (*string) { if (ACPI_IS_DIGIT(*string)) { @@ -764,9 +754,6 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) all_done: - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n", - ACPI_FORMAT_UINT64(return_value))); - *ret_integer = return_value; return_ACPI_STATUS(AE_OK); diff --git a/trunk/drivers/acpi/utilities/utmutex.c b/trunk/drivers/acpi/utilities/utmutex.c index c39062a047cd..dfc8f30ca892 100644 --- a/trunk/drivers/acpi/utilities/utmutex.c +++ b/trunk/drivers/acpi/utilities/utmutex.c @@ -244,14 +244,14 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %X attempting to acquire Mutex [%s]\n", - (u32) this_thread_id, acpi_ut_get_mutex_name(mutex_id))); + this_thread_id, acpi_ut_get_mutex_name(mutex_id))); status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, ACPI_WAIT_FOREVER); if (ACPI_SUCCESS(status)) { ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n", - (u32) this_thread_id, + this_thread_id, acpi_ut_get_mutex_name(mutex_id))); acpi_gbl_mutex_info[mutex_id].use_count++; @@ -259,7 +259,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) } else { ACPI_EXCEPTION((AE_INFO, status, "Thread %X could not acquire Mutex [%X]", - (u32) this_thread_id, mutex_id)); + this_thread_id, mutex_id)); } return (status); @@ -285,7 +285,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) this_thread_id = acpi_os_get_thread_id(); ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, - "Thread %X releasing Mutex [%s]\n", (u32) this_thread_id, + "Thread %X releasing Mutex [%s]\n", this_thread_id, acpi_ut_get_mutex_name(mutex_id))); if (mutex_id > ACPI_MAX_MUTEX) { diff --git a/trunk/drivers/acpi/utilities/utstate.c b/trunk/drivers/acpi/utilities/utstate.c index eaa13d05c859..0f5c5bb5deff 100644 --- a/trunk/drivers/acpi/utilities/utstate.c +++ b/trunk/drivers/acpi/utilities/utstate.c @@ -199,13 +199,6 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD; state->thread.thread_id = acpi_os_get_thread_id(); - /* Check for invalid thread ID - zero is very bad, it will break things */ - - if (!state->thread.thread_id) { - ACPI_ERROR((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId")); - state->thread.thread_id = (acpi_thread_id) 1; - } - return_PTR((struct acpi_thread_state *)state); } diff --git a/trunk/drivers/atm/Kconfig b/trunk/drivers/atm/Kconfig index cfa5af883e13..01a9f1cb7743 100644 --- a/trunk/drivers/atm/Kconfig +++ b/trunk/drivers/atm/Kconfig @@ -398,7 +398,7 @@ config ATM_FORE200E_USE_TASKLET default n help This defers work to be done by the interrupt handler to a - tasklet instead of handling everything at interrupt time. This + tasklet instead of hanlding everything at interrupt time. This may improve the responsive of the host. config ATM_FORE200E_TX_RETRY diff --git a/trunk/drivers/base/Kconfig b/trunk/drivers/base/Kconfig index 0b4e22436935..80502dc6ed66 100644 --- a/trunk/drivers/base/Kconfig +++ b/trunk/drivers/base/Kconfig @@ -20,7 +20,7 @@ config PREVENT_FIRMWARE_BUILD config FW_LOADER tristate "Userspace firmware loading support" - depends on HOTPLUG + select HOTPLUG ---help--- This option is provided for the case where no in-kernel-tree modules require userspace firmware loading support, but a module built outside diff --git a/trunk/drivers/base/bus.c b/trunk/drivers/base/bus.c index 2e954d07175a..83fa8b291a59 100644 --- a/trunk/drivers/base/bus.c +++ b/trunk/drivers/base/bus.c @@ -129,7 +129,7 @@ static struct kobj_type ktype_bus = { }; -static decl_subsys(bus, &ktype_bus, NULL); +decl_subsys(bus, &ktype_bus, NULL); #ifdef CONFIG_HOTPLUG @@ -598,13 +598,12 @@ void put_bus(struct bus_type * bus) * * Note that kset_find_obj increments bus' reference count. */ -#if 0 + struct bus_type * find_bus(char * name) { struct kobject * k = kset_find_obj(&bus_subsys.kset, name); return k ? to_bus(k) : NULL; } -#endif /* 0 */ /** diff --git a/trunk/drivers/base/core.c b/trunk/drivers/base/core.c index be6b5bc0677d..b21f864c9ce8 100644 --- a/trunk/drivers/base/core.c +++ b/trunk/drivers/base/core.c @@ -559,20 +559,20 @@ static void device_create_release(struct device *dev) /** * device_create - creates a device and registers it with sysfs - * @class: pointer to the struct class that this device should be registered to - * @parent: pointer to the parent struct device of this new device, if any - * @devt: the dev_t for the char device to be added - * @fmt: string for the device's name - * - * This function can be used by char device classes. A struct device - * will be created in sysfs, registered to the specified class. + * @cs: pointer to the struct class that this device should be registered to. + * @parent: pointer to the parent struct device of this new device, if any. + * @dev: the dev_t for the char device to be added. + * @fmt: string for the class device's name * + * This function can be used by char device classes. A struct + * device will be created in sysfs, registered to the specified + * class. * A "dev" file will be created, showing the dev_t for the device, if * the dev_t is not 0,0. - * If a pointer to a parent struct device is passed in, the newly created - * struct device will be a child of that device in sysfs. - * The pointer to the struct device will be returned from the call. - * Any further sysfs files that might be required can be created using this + * If a pointer to a parent struct device is passed in, the newly + * created struct device will be a child of that device in sysfs. The + * pointer to the struct device will be returned from the call. Any + * further sysfs files that might be required can be created using this * pointer. * * Note: the struct class passed to this function must have previously @@ -620,11 +620,11 @@ EXPORT_SYMBOL_GPL(device_create); /** * device_destroy - removes a device that was created with device_create() - * @class: pointer to the struct class that this device was registered with - * @devt: the dev_t of the device that was previously registered + * @class: the pointer to the struct class that this device was registered * with. + * @dev: the dev_t of the device that was previously registered. * - * This call unregisters and cleans up a device that was created with a - * call to device_create(). + * This call unregisters and cleans up a class device that was created with a + * call to class_device_create() */ void device_destroy(struct class *class, dev_t devt) { diff --git a/trunk/drivers/block/aoe/aoechr.c b/trunk/drivers/block/aoe/aoechr.c index 1bc1cf9603f1..5327f553b4f5 100644 --- a/trunk/drivers/block/aoe/aoechr.c +++ b/trunk/drivers/block/aoe/aoechr.c @@ -162,7 +162,7 @@ aoechr_open(struct inode *inode, struct file *filp) { int n, i; - n = iminor(inode); + n = MINOR(inode->i_rdev); filp->private_data = (void *) (unsigned long) n; for (i = 0; i < ARRAY_SIZE(chardevs); ++i) diff --git a/trunk/drivers/bluetooth/bcm203x.c b/trunk/drivers/bluetooth/bcm203x.c index 13ba729cdd57..6f67141f4de0 100644 --- a/trunk/drivers/bluetooth/bcm203x.c +++ b/trunk/drivers/bluetooth/bcm203x.c @@ -234,7 +234,6 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id data->fw_data = kmalloc(firmware->size, GFP_KERNEL); if (!data->fw_data) { BT_ERR("Can't allocate memory for firmware image"); - release_firmware(firmware); usb_free_urb(data->urb); kfree(data->buffer); kfree(data); diff --git a/trunk/drivers/bluetooth/hci_ldisc.c b/trunk/drivers/bluetooth/hci_ldisc.c index 93ba25b7ea32..1994270c16e1 100644 --- a/trunk/drivers/bluetooth/hci_ldisc.c +++ b/trunk/drivers/bluetooth/hci_ldisc.c @@ -191,7 +191,7 @@ static int hci_uart_flush(struct hci_dev *hdev) /* Flush any pending characters in the driver and discipline. */ tty_ldisc_flush(tty); - if (tty->driver && tty->driver->flush_buffer) + if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) @@ -290,7 +290,7 @@ static int hci_uart_tty_open(struct tty_struct *tty) if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - if (tty->driver && tty->driver->flush_buffer) + if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); return 0; diff --git a/trunk/drivers/cdrom/cdrom.c b/trunk/drivers/cdrom/cdrom.c index d239cf8b20bd..ca27ee89240b 100644 --- a/trunk/drivers/cdrom/cdrom.c +++ b/trunk/drivers/cdrom/cdrom.c @@ -1837,7 +1837,7 @@ static int dvd_read_bca(struct cdrom_device_info *cdi, dvd_struct *s) init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ); cgc.cmd[0] = GPCMD_READ_DVD_STRUCTURE; cgc.cmd[7] = s->type; - cgc.cmd[9] = cgc.buflen & 0xff; + cgc.cmd[9] = cgc.buflen = 0xff; if ((ret = cdo->generic_packet(cdi, &cgc))) return ret; diff --git a/trunk/drivers/char/hvsi.c b/trunk/drivers/char/hvsi.c index 41db8060e8f7..56612a2dca6b 100644 --- a/trunk/drivers/char/hvsi.c +++ b/trunk/drivers/char/hvsi.c @@ -1299,7 +1299,7 @@ static int __init hvsi_console_init(void) hp->inbuf_end = hp->inbuf; hp->state = HVSI_CLOSED; hp->vtermno = *vtermno; - hp->virq = irq_create_mapping(NULL, irq[0]); + hp->virq = irq_create_mapping(NULL, irq[0], 0); if (hp->virq == NO_IRQ) { printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n", __FUNCTION__, irq[0]); diff --git a/trunk/drivers/char/ip2/ip2main.c b/trunk/drivers/char/ip2/ip2main.c index 7907ae88c2f4..518ece7ac656 100644 --- a/trunk/drivers/char/ip2/ip2main.c +++ b/trunk/drivers/char/ip2/ip2main.c @@ -3186,10 +3186,3 @@ ip2trace (unsigned short pn, unsigned char cat, unsigned char label, unsigned lo MODULE_LICENSE("GPL"); - -static struct pci_device_id ip2main_pci_tbl[] __devinitdata = { - { PCI_DEVICE(PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_IP2EX) }, - { } -}; - -MODULE_DEVICE_TABLE(pci, ip2main_pci_tbl); diff --git a/trunk/drivers/char/mem.c b/trunk/drivers/char/mem.c index 917b20402664..e97c32ceb796 100644 --- a/trunk/drivers/char/mem.c +++ b/trunk/drivers/char/mem.c @@ -95,7 +95,7 @@ static inline int valid_phys_addr_range(unsigned long addr, size_t count) return 1; } -static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) +static inline int valid_mmap_phys_addr_range(unsigned long addr, size_t size) { return 1; } @@ -242,7 +242,7 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma) { size_t size = vma->vm_end - vma->vm_start; - if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size)) + if (!valid_mmap_phys_addr_range(vma->vm_pgoff << PAGE_SHIFT, size)) return -EINVAL; vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff, diff --git a/trunk/drivers/char/pc8736x_gpio.c b/trunk/drivers/char/pc8736x_gpio.c index 11bd78c80628..4005ee0aa11e 100644 --- a/trunk/drivers/char/pc8736x_gpio.c +++ b/trunk/drivers/char/pc8736x_gpio.c @@ -3,18 +3,18 @@ National Semiconductor PC8736x GPIO driver. Allows a user space process to play with the GPIO pins. - Copyright (c) 2005,2006 Jim Cromie + Copyright (c) 2005 Jim Cromie adapted from linux/drivers/char/scx200_gpio.c Copyright (c) 2001,2002 Christer Weinigel , */ +#include #include #include #include #include #include -#include #include #include #include @@ -25,7 +25,7 @@ #define DEVNAME "pc8736x_gpio" MODULE_AUTHOR("Jim Cromie "); -MODULE_DESCRIPTION("NatSemi/Winbond PC-8736x GPIO Pin Driver"); +MODULE_DESCRIPTION("NatSemi PC-8736x GPIO Pin Driver"); MODULE_LICENSE("GPL"); static int major; /* default to dynamic major */ @@ -38,14 +38,14 @@ static u8 pc8736x_gpio_shadow[4]; #define SIO_BASE1 0x2E /* 1st command-reg to check */ #define SIO_BASE2 0x4E /* alt command-reg to check */ +#define SIO_BASE_OFFSET 0x20 #define SIO_SID 0x20 /* SuperI/O ID Register */ #define SIO_SID_VALUE 0xe9 /* Expected value in SuperI/O ID Register */ #define SIO_CF1 0x21 /* chip config, bit0 is chip enable */ -#define PC8736X_GPIO_RANGE 16 /* ioaddr range */ -#define PC8736X_GPIO_CT 32 /* minors matching 4 8 bit ports */ +#define PC8736X_GPIO_SIZE 16 #define SIO_UNIT_SEL 0x7 /* unit select reg */ #define SIO_UNIT_ACT 0x30 /* unit enable */ @@ -231,7 +231,7 @@ static int pc8736x_gpio_open(struct inode *inode, struct file *file) dev_dbg(&pdev->dev, "open %d\n", m); - if (m >= PC8736X_GPIO_CT) + if (m > 63) return -EINVAL; return nonseekable_open(inode, file); } @@ -255,12 +255,9 @@ static void __init pc8736x_init_shadow(void) } -static struct cdev pc8736x_gpio_cdev; - static int __init pc8736x_gpio_init(void) { - int rc; - dev_t devid; + int rc = 0; pdev = platform_device_alloc(DEVNAME, 0); if (!pdev) @@ -300,7 +297,7 @@ static int __init pc8736x_gpio_init(void) pc8736x_gpio_base = (superio_inb(SIO_BASE_HADDR) << 8 | superio_inb(SIO_BASE_LADDR)); - if (!request_region(pc8736x_gpio_base, PC8736X_GPIO_RANGE, DEVNAME)) { + if (!request_region(pc8736x_gpio_base, 16, DEVNAME)) { rc = -ENODEV; dev_err(&pdev->dev, "GPIO ioport %x busy\n", pc8736x_gpio_base); @@ -308,17 +305,10 @@ static int __init pc8736x_gpio_init(void) } dev_info(&pdev->dev, "GPIO ioport %x reserved\n", pc8736x_gpio_base); - if (major) { - devid = MKDEV(major, 0); - rc = register_chrdev_region(devid, PC8736X_GPIO_CT, DEVNAME); - } else { - rc = alloc_chrdev_region(&devid, 0, PC8736X_GPIO_CT, DEVNAME); - major = MAJOR(devid); - } - + rc = register_chrdev(major, DEVNAME, &pc8736x_gpio_fops); if (rc < 0) { dev_err(&pdev->dev, "register-chrdev failed: %d\n", rc); - goto undo_request_region; + goto undo_platform_dev_add; } if (!major) { major = rc; @@ -326,15 +316,8 @@ static int __init pc8736x_gpio_init(void) } pc8736x_init_shadow(); - - /* ignore minor errs, and succeed */ - cdev_init(&pc8736x_gpio_cdev, &pc8736x_gpio_fops); - cdev_add(&pc8736x_gpio_cdev, devid, PC8736X_GPIO_CT); - return 0; -undo_request_region: - release_region(pc8736x_gpio_base, PC8736X_GPIO_RANGE); undo_platform_dev_add: platform_device_del(pdev); undo_platform_dev_alloc: @@ -345,14 +328,11 @@ static int __init pc8736x_gpio_init(void) static void __exit pc8736x_gpio_cleanup(void) { - dev_dbg(&pdev->dev, "cleanup\n"); + dev_dbg(&pdev->dev, " cleanup\n"); - cdev_del(&pc8736x_gpio_cdev); - unregister_chrdev_region(MKDEV(major,0), PC8736X_GPIO_CT); - release_region(pc8736x_gpio_base, PC8736X_GPIO_RANGE); + release_region(pc8736x_gpio_base, 16); - platform_device_del(pdev); - platform_device_put(pdev); + unregister_chrdev(major, DEVNAME); } EXPORT_SYMBOL(pc8736x_access); diff --git a/trunk/drivers/char/rtc.c b/trunk/drivers/char/rtc.c index 6e6a7c7a7eff..cc7bd1a3095b 100644 --- a/trunk/drivers/char/rtc.c +++ b/trunk/drivers/char/rtc.c @@ -46,12 +46,13 @@ * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer * CONFIG_HPET_EMULATE_RTC - * 1.12a Maciej W. Rozycki: Handle memory-mapped chips properly. * 1.12ac Alan Cox: Allow read access to the day of week register */ #define RTC_VERSION "1.12ac" +#define RTC_IO_EXTENT 0x8 + /* * Note that *all* calls to CMOS_READ and CMOS_WRITE are done with * interrupts disabled. Due to the index-port/data-port (0x70/0x71) @@ -336,15 +337,7 @@ static ssize_t rtc_read(struct file *file, char __user *buf, if (rtc_has_irq == 0) return -EIO; - /* - * Historically this function used to assume that sizeof(unsigned long) - * is the same in userspace and kernelspace. This lead to problems - * for configurations with multiple ABIs such a the MIPS o32 and 64 - * ABIs supported on the same kernel. So now we support read of both - * 4 and 8 bytes and assume that's the sizeof(unsigned long) in the - * userspace ABI. - */ - if (count != sizeof(unsigned int) && count != sizeof(unsigned long)) + if (count < sizeof(unsigned)) return -EINVAL; add_wait_queue(&rtc_wait, &wait); @@ -375,12 +368,10 @@ static ssize_t rtc_read(struct file *file, char __user *buf, schedule(); } while (1); - if (count == sizeof(unsigned int)) - retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int); + if (count < sizeof(unsigned long)) + retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int); else retval = put_user(data, (unsigned long __user *)buf) ?: sizeof(long); - if (!retval) - retval = count; out: current->state = TASK_RUNNING; remove_wait_queue(&rtc_wait, &wait); @@ -932,9 +923,6 @@ static int __init rtc_init(void) struct sparc_isa_device *isa_dev; #endif #endif -#ifndef __sparc__ - void *r; -#endif #ifdef __sparc__ for_each_ebus(ebus) { @@ -976,13 +964,8 @@ static int __init rtc_init(void) } no_irq: #else - if (RTC_IOMAPPED) - r = request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); - else - r = request_mem_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); - if (!r) { - printk(KERN_ERR "rtc: I/O resource %lx is not free.\n", - (long)(RTC_PORT(0))); + if (!request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc")) { + printk(KERN_ERR "rtc: I/O port %d is not free.\n", RTC_PORT (0)); return -EIO; } @@ -996,10 +979,7 @@ static int __init rtc_init(void) if(request_irq(RTC_IRQ, rtc_int_handler_ptr, IRQF_DISABLED, "rtc", NULL)) { /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); - if (RTC_IOMAPPED) - release_region(RTC_PORT(0), RTC_IO_EXTENT); - else - release_mem_region(RTC_PORT(0), RTC_IO_EXTENT); + release_region(RTC_PORT(0), RTC_IO_EXTENT); return -EIO; } hpet_rtc_timer_init(); @@ -1099,10 +1079,7 @@ static void __exit rtc_exit (void) if (rtc_has_irq) free_irq (rtc_irq, &rtc_port); #else - if (RTC_IOMAPPED) - release_region(RTC_PORT(0), RTC_IO_EXTENT); - else - release_mem_region(RTC_PORT(0), RTC_IO_EXTENT); + release_region (RTC_PORT (0), RTC_IO_EXTENT); #ifdef RTC_IRQ if (rtc_has_irq) free_irq (RTC_IRQ, NULL); @@ -1245,7 +1222,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file) void rtc_get_rtc_time(struct rtc_time *rtc_tm) { - unsigned long uip_watchdog = jiffies, flags; + unsigned long uip_watchdog = jiffies; unsigned char ctrl; #ifdef CONFIG_MACH_DECSTATION unsigned int real_year; @@ -1272,7 +1249,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm) * RTC has RTC_DAY_OF_WEEK, we should usually ignore it, as it is * only updated by the RTC when initially set to a non-zero value. */ - spin_lock_irqsave(&rtc_lock, flags); + spin_lock_irq(&rtc_lock); rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); rtc_tm->tm_hour = CMOS_READ(RTC_HOURS); @@ -1286,7 +1263,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm) real_year = CMOS_READ(RTC_DEC_YEAR); #endif ctrl = CMOS_READ(RTC_CONTROL); - spin_unlock_irqrestore(&rtc_lock, flags); + spin_unlock_irq(&rtc_lock); if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { diff --git a/trunk/drivers/char/snsc_event.c b/trunk/drivers/char/snsc_event.c index d12d4f629cec..8b2210b633df 100644 --- a/trunk/drivers/char/snsc_event.c +++ b/trunk/drivers/char/snsc_event.c @@ -220,7 +220,20 @@ scdrv_dispatch_event(char *event, int len) " Sending SIGPWR to init...\n"); /* give a SIGPWR signal to init proc */ - kill_proc(1, SIGPWR, 0); + + /* first find init's task */ + read_lock(&tasklist_lock); + for_each_process(p) { + if (p->pid == 1) + break; + } + if (p) { + force_sig(SIGPWR, p); + } else { + printk(KERN_ERR "Failed to signal init!\n"); + snsc_shutting_down = 0; /* so can try again (?) */ + } + read_unlock(&tasklist_lock); } else { /* print to system log */ printk("%s|$(0x%x)%s\n", severity, esp_code, desc); diff --git a/trunk/drivers/char/specialix.c b/trunk/drivers/char/specialix.c index a1d303f9a33d..cb2859249d49 100644 --- a/trunk/drivers/char/specialix.c +++ b/trunk/drivers/char/specialix.c @@ -2584,12 +2584,6 @@ static void __exit specialix_exit_module(void) func_exit(); } -static struct pci_device_id specialx_pci_tbl[] __devinitdata = { - { PCI_DEVICE(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_IO8) }, - { } -}; -MODULE_DEVICE_TABLE(pci, specialx_pci_tbl); - module_init(specialix_init_module); module_exit(specialix_exit_module); diff --git a/trunk/drivers/edac/edac_mc.c b/trunk/drivers/edac/edac_mc.c index 4bde30bb3be7..3a7cfe88b169 100644 --- a/trunk/drivers/edac/edac_mc.c +++ b/trunk/drivers/edac/edac_mc.c @@ -1,6 +1,6 @@ /* * edac_mc kernel module - * (C) 2005, 2006 Linux Networx (http://lnxi.com) + * (C) 2005 Linux Networx (http://lnxi.com) * This file may be distributed under the terms of the * GNU General Public License. * @@ -33,8 +33,13 @@ #include #include "edac_mc.h" -#define EDAC_MC_VERSION "Ver: 2.0.1 " __DATE__ +#define EDAC_MC_VERSION "Ver: 2.0.0 " __DATE__ +/* For now, disable the EDAC sysfs code. The sysfs interface that EDAC + * presents to user space needs more thought, and is likely to change + * substantially. + */ +#define DISABLE_EDAC_SYSFS #ifdef CONFIG_EDAC_DEBUG /* Values of 0 to 4 will generate output */ @@ -59,12 +64,31 @@ static int check_pci_parity = 0; /* default YES check PCI parity */ static int panic_on_pci_parity; /* default no panic on PCI Parity */ static atomic_t pci_parity_count = ATOMIC_INIT(0); +/* Structure of the whitelist and blacklist arrays */ +struct edac_pci_device_list { + unsigned int vendor; /* Vendor ID */ + unsigned int device; /* Deviice ID */ +}; + +#define MAX_LISTED_PCI_DEVICES 32 + +/* List of PCI devices (vendor-id:device-id) that should be skipped */ +static struct edac_pci_device_list pci_blacklist[MAX_LISTED_PCI_DEVICES]; +static int pci_blacklist_count; + +/* List of PCI devices (vendor-id:device-id) that should be scanned */ +static struct edac_pci_device_list pci_whitelist[MAX_LISTED_PCI_DEVICES]; +static int pci_whitelist_count ; + +#ifndef DISABLE_EDAC_SYSFS static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */ static struct completion edac_pci_kobj_complete; +#endif /* DISABLE_EDAC_SYSFS */ #endif /* CONFIG_PCI */ /* START sysfs data and methods */ +#ifndef DISABLE_EDAC_SYSFS static const char *mem_types[] = { [MEM_EMPTY] = "Empty", @@ -123,10 +147,18 @@ static struct completion edac_memctrl_kobj_complete; * /sys/devices/system/edac/mc; * data structures and methods */ +#if 0 +static ssize_t memctrl_string_show(void *ptr, char *buffer) +{ + char *value = (char*) ptr; + return sprintf(buffer, "%s\n", value); +} +#endif + static ssize_t memctrl_int_show(void *ptr, char *buffer) { int *value = (int*) ptr; - return sprintf(buffer, "%u\n", *value); + return sprintf(buffer, "%d\n", *value); } static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count) @@ -192,6 +224,11 @@ struct memctrl_dev_attribute attr_##_name = { \ .store = _store, \ }; +/* cwrow attribute f*/ +#if 0 +MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL); +#endif + /* csrow control files */ MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); MEMCTRL_ATTR(log_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); @@ -220,6 +257,8 @@ static struct kobj_type ktype_memctrl = { .default_attrs = (struct attribute **) memctrl_attr, }; +#endif /* DISABLE_EDAC_SYSFS */ + /* Initialize the main sysfs entries for edac: * /sys/devices/system/edac * @@ -229,6 +268,11 @@ static struct kobj_type ktype_memctrl = { * !0 FAILURE */ static int edac_sysfs_memctrl_setup(void) +#ifdef DISABLE_EDAC_SYSFS +{ + return 0; +} +#else { int err=0; @@ -260,6 +304,7 @@ static int edac_sysfs_memctrl_setup(void) return err; } +#endif /* DISABLE_EDAC_SYSFS */ /* * MC teardown: @@ -267,6 +312,7 @@ static int edac_sysfs_memctrl_setup(void) */ static void edac_sysfs_memctrl_teardown(void) { +#ifndef DISABLE_EDAC_SYSFS debugf0("MC: " __FILE__ ": %s()\n", __func__); /* Unregister the MC's kobject and wait for reference count to reach @@ -278,9 +324,144 @@ static void edac_sysfs_memctrl_teardown(void) /* Unregister the 'edac' object */ sysdev_class_unregister(&edac_class); +#endif /* DISABLE_EDAC_SYSFS */ } #ifdef CONFIG_PCI + +#ifndef DISABLE_EDAC_SYSFS + +/* + * /sys/devices/system/edac/pci; + * data structures and methods + */ + +struct list_control { + struct edac_pci_device_list *list; + int *count; +}; + +#if 0 +/* Output the list as: vendor_id:device:id<,vendor_id:device_id> */ +static ssize_t edac_pci_list_string_show(void *ptr, char *buffer) +{ + struct list_control *listctl; + struct edac_pci_device_list *list; + char *p = buffer; + int len=0; + int i; + + listctl = ptr; + list = listctl->list; + + for (i = 0; i < *(listctl->count); i++, list++ ) { + if (len > 0) + len += snprintf(p + len, (PAGE_SIZE-len), ","); + + len += snprintf(p + len, + (PAGE_SIZE-len), + "%x:%x", + list->vendor,list->device); + } + + len += snprintf(p + len,(PAGE_SIZE-len), "\n"); + return (ssize_t) len; +} + +/** + * + * Scan string from **s to **e looking for one 'vendor:device' tuple + * where each field is a hex value + * + * return 0 if an entry is NOT found + * return 1 if an entry is found + * fill in *vendor_id and *device_id with values found + * + * In both cases, make sure *s has been moved forward toward *e + */ +static int parse_one_device(const char **s,const char **e, + unsigned int *vendor_id, unsigned int *device_id) +{ + const char *runner, *p; + + /* if null byte, we are done */ + if (!**s) { + (*s)++; /* keep *s moving */ + return 0; + } + + /* skip over newlines & whitespace */ + if ((**s == '\n') || isspace(**s)) { + (*s)++; + return 0; + } + + if (!isxdigit(**s)) { + (*s)++; + return 0; + } + + /* parse vendor_id */ + runner = *s; + + while (runner < *e) { + /* scan for vendor:device delimiter */ + if (*runner == ':') { + *vendor_id = simple_strtol((char*) *s, (char**) &p, 16); + runner = p + 1; + break; + } + + runner++; + } + + if (!isxdigit(*runner)) { + *s = ++runner; + return 0; + } + + /* parse device_id */ + if (runner < *e) { + *device_id = simple_strtol((char*)runner, (char**)&p, 16); + runner = p; + } + + *s = runner; + return 1; +} + +static ssize_t edac_pci_list_string_store(void *ptr, const char *buffer, + size_t count) +{ + struct list_control *listctl; + struct edac_pci_device_list *list; + unsigned int vendor_id, device_id; + const char *s, *e; + int *index; + + s = (char*)buffer; + e = s + count; + listctl = ptr; + list = listctl->list; + index = listctl->count; + *index = 0; + + while (*index < MAX_LISTED_PCI_DEVICES) { + if (parse_one_device(&s,&e,&vendor_id,&device_id)) { + list[ *index ].vendor = vendor_id; + list[ *index ].device = device_id; + (*index)++; + } + + /* check for all data consume */ + if (s >= e) + break; + } + + return count; +} + +#endif static ssize_t edac_pci_int_show(void *ptr, char *buffer) { int *value = ptr; @@ -348,6 +529,31 @@ struct edac_pci_dev_attribute edac_pci_attr_##_name = { \ .store = _store, \ }; +#if 0 +static struct list_control pci_whitelist_control = { + .list = pci_whitelist, + .count = &pci_whitelist_count +}; + +static struct list_control pci_blacklist_control = { + .list = pci_blacklist, + .count = &pci_blacklist_count +}; + +/* whitelist attribute */ +EDAC_PCI_STRING_ATTR(pci_parity_whitelist, + &pci_whitelist_control, + S_IRUGO|S_IWUSR, + edac_pci_list_string_show, + edac_pci_list_string_store); + +EDAC_PCI_STRING_ATTR(pci_parity_blacklist, + &pci_blacklist_control, + S_IRUGO|S_IWUSR, + edac_pci_list_string_show, + edac_pci_list_string_store); +#endif + /* PCI Parity control files */ EDAC_PCI_ATTR(check_pci_parity, S_IRUGO|S_IWUSR, edac_pci_int_show, edac_pci_int_store); @@ -376,11 +582,18 @@ static struct kobj_type ktype_edac_pci = { .default_attrs = (struct attribute **) edac_pci_attr, }; +#endif /* DISABLE_EDAC_SYSFS */ + /** * edac_sysfs_pci_setup() * */ static int edac_sysfs_pci_setup(void) +#ifdef DISABLE_EDAC_SYSFS +{ + return 0; +} +#else { int err; @@ -404,13 +617,16 @@ static int edac_sysfs_pci_setup(void) return err; } +#endif /* DISABLE_EDAC_SYSFS */ static void edac_sysfs_pci_teardown(void) { +#ifndef DISABLE_EDAC_SYSFS debugf0("%s()\n", __func__); init_completion(&edac_pci_kobj_complete); kobject_unregister(&edac_pci_kobj); wait_for_completion(&edac_pci_kobj_complete); +#endif } @@ -539,6 +755,36 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) } } +/* + * check_dev_on_list: Scan for a PCI device on a white/black list + * @list: an EDAC &edac_pci_device_list white/black list pointer + * @free_index: index of next free entry on the list + * @pci_dev: PCI Device pointer + * + * see if list contains the device. + * + * Returns: 0 not found + * 1 found on list + */ +static int check_dev_on_list(struct edac_pci_device_list *list, + int free_index, struct pci_dev *dev) +{ + int i; + int rc = 0; /* Assume not found */ + unsigned short vendor=dev->vendor; + unsigned short device=dev->device; + + /* Scan the list, looking for a vendor/device match */ + for (i = 0; i < free_index; i++, list++ ) { + if ((list->vendor == vendor ) && (list->device == device )) { + rc = 1; + break; + } + } + + return rc; +} + /* * pci_dev parity list iterator * Scan the PCI device list for one iteration, looking for SERRORs @@ -553,7 +799,22 @@ static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn) * bumped until we are done with it */ while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { - fn(dev); + /* if whitelist exists then it has priority, so only scan + * those devices on the whitelist + */ + if (pci_whitelist_count > 0 ) { + if (check_dev_on_list(pci_whitelist, + pci_whitelist_count, dev)) + fn(dev); + } else { + /* + * if no whitelist, then check if this devices is + * blacklisted + */ + if (!check_dev_on_list(pci_blacklist, + pci_blacklist_count, dev)) + fn(dev); + } } } @@ -594,101 +855,154 @@ static inline void clear_pci_parity_errors(void) #else /* CONFIG_PCI */ -/* pre-process these away */ -#define do_pci_parity_check() -#define clear_pci_parity_errors() -#define edac_sysfs_pci_teardown() -#define edac_sysfs_pci_setup() (0) +static inline void do_pci_parity_check(void) +{ + /* no-op */ +} + +static inline void clear_pci_parity_errors(void) +{ + /* no-op */ +} + +static void edac_sysfs_pci_teardown(void) +{ +} +static int edac_sysfs_pci_setup(void) +{ + return 0; +} #endif /* CONFIG_PCI */ -/* EDAC sysfs CSROW data structures and methods - */ +#ifndef DISABLE_EDAC_SYSFS + +/* EDAC sysfs CSROW data structures and methods */ -/* Set of more default csrow attribute show/store functions */ -static ssize_t csrow_ue_count_show(struct csrow_info *csrow, char *data, int private) +/* Set of more detailed csrow attribute show/store functions */ +static ssize_t csrow_ch0_dimm_label_show(struct csrow_info *csrow, char *data) { - return sprintf(data,"%u\n", csrow->ue_count); + ssize_t size = 0; + + if (csrow->nr_channels > 0) { + size = snprintf(data, EDAC_MC_LABEL_LEN,"%s\n", + csrow->channels[0].label); + } + + return size; } -static ssize_t csrow_ce_count_show(struct csrow_info *csrow, char *data, int private) +static ssize_t csrow_ch1_dimm_label_show(struct csrow_info *csrow, char *data) { - return sprintf(data,"%u\n", csrow->ce_count); + ssize_t size = 0; + + if (csrow->nr_channels > 0) { + size = snprintf(data, EDAC_MC_LABEL_LEN, "%s\n", + csrow->channels[1].label); + } + + return size; } -static ssize_t csrow_size_show(struct csrow_info *csrow, char *data, int private) +static ssize_t csrow_ch0_dimm_label_store(struct csrow_info *csrow, + const char *data, size_t size) { - return sprintf(data,"%u\n", PAGES_TO_MiB(csrow->nr_pages)); + ssize_t max_size = 0; + + if (csrow->nr_channels > 0) { + max_size = min((ssize_t)size,(ssize_t)EDAC_MC_LABEL_LEN-1); + strncpy(csrow->channels[0].label, data, max_size); + csrow->channels[0].label[max_size] = '\0'; + } + + return size; } -static ssize_t csrow_mem_type_show(struct csrow_info *csrow, char *data, int private) +static ssize_t csrow_ch1_dimm_label_store(struct csrow_info *csrow, + const char *data, size_t size) { - return sprintf(data,"%s\n", mem_types[csrow->mtype]); + ssize_t max_size = 0; + + if (csrow->nr_channels > 1) { + max_size = min((ssize_t)size,(ssize_t)EDAC_MC_LABEL_LEN-1); + strncpy(csrow->channels[1].label, data, max_size); + csrow->channels[1].label[max_size] = '\0'; + } + + return max_size; } -static ssize_t csrow_dev_type_show(struct csrow_info *csrow, char *data, int private) +static ssize_t csrow_ue_count_show(struct csrow_info *csrow, char *data) { - return sprintf(data,"%s\n", dev_types[csrow->dtype]); + return sprintf(data,"%u\n", csrow->ue_count); } -static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data, int private) +static ssize_t csrow_ce_count_show(struct csrow_info *csrow, char *data) { - return sprintf(data,"%s\n", edac_caps[csrow->edac_mode]); + return sprintf(data,"%u\n", csrow->ce_count); } -/* show/store functions for DIMM Label attributes */ -static ssize_t channel_dimm_label_show(struct csrow_info *csrow, - char *data, int channel) +static ssize_t csrow_ch0_ce_count_show(struct csrow_info *csrow, char *data) { - return snprintf(data, EDAC_MC_LABEL_LEN,"%s", - csrow->channels[channel].label); + ssize_t size = 0; + + if (csrow->nr_channels > 0) { + size = sprintf(data,"%u\n", csrow->channels[0].ce_count); + } + + return size; } -static ssize_t channel_dimm_label_store(struct csrow_info *csrow, - const char *data, - size_t count, - int channel) +static ssize_t csrow_ch1_ce_count_show(struct csrow_info *csrow, char *data) { - ssize_t max_size = 0; + ssize_t size = 0; - max_size = min((ssize_t)count,(ssize_t)EDAC_MC_LABEL_LEN-1); - strncpy(csrow->channels[channel].label, data, max_size); - csrow->channels[channel].label[max_size] = '\0'; + if (csrow->nr_channels > 1) { + size = sprintf(data,"%u\n", csrow->channels[1].ce_count); + } - return max_size; + return size; } -/* show function for dynamic chX_ce_count attribute */ -static ssize_t channel_ce_count_show(struct csrow_info *csrow, - char *data, - int channel) +static ssize_t csrow_size_show(struct csrow_info *csrow, char *data) { - return sprintf(data, "%u\n", csrow->channels[channel].ce_count); + return sprintf(data,"%u\n", PAGES_TO_MiB(csrow->nr_pages)); +} + +static ssize_t csrow_mem_type_show(struct csrow_info *csrow, char *data) +{ + return sprintf(data,"%s\n", mem_types[csrow->mtype]); +} + +static ssize_t csrow_dev_type_show(struct csrow_info *csrow, char *data) +{ + return sprintf(data,"%s\n", dev_types[csrow->dtype]); +} + +static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data) +{ + return sprintf(data,"%s\n", edac_caps[csrow->edac_mode]); } -/* csrow specific attribute structure */ struct csrowdev_attribute { struct attribute attr; - ssize_t (*show)(struct csrow_info *,char *,int); - ssize_t (*store)(struct csrow_info *, const char *,size_t,int); - int private; + ssize_t (*show)(struct csrow_info *,char *); + ssize_t (*store)(struct csrow_info *, const char *,size_t); }; #define to_csrow(k) container_of(k, struct csrow_info, kobj) #define to_csrowdev_attr(a) container_of(a, struct csrowdev_attribute, attr) -/* Set of show/store higher level functions for default csrow attributes */ -static ssize_t csrowdev_show(struct kobject *kobj, - struct attribute *attr, - char *buffer) +/* Set of show/store higher level functions for csrow objects */ +static ssize_t csrowdev_show(struct kobject *kobj, struct attribute *attr, + char *buffer) { struct csrow_info *csrow = to_csrow(kobj); struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr); if (csrowdev_attr->show) - return csrowdev_attr->show(csrow, - buffer, - csrowdev_attr->private); + return csrowdev_attr->show(csrow, buffer); + return -EIO; } @@ -699,10 +1013,8 @@ static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr, struct csrowdev_attribute * csrowdev_attr = to_csrowdev_attr(attr); if (csrowdev_attr->store) - return csrowdev_attr->store(csrow, - buffer, - count, - csrowdev_attr->private); + return csrowdev_attr->store(csrow, buffer, count); + return -EIO; } @@ -711,157 +1023,69 @@ static struct sysfs_ops csrowfs_ops = { .store = csrowdev_store }; -#define CSROWDEV_ATTR(_name,_mode,_show,_store,_private) \ +#define CSROWDEV_ATTR(_name,_mode,_show,_store) \ struct csrowdev_attribute attr_##_name = { \ .attr = {.name = __stringify(_name), .mode = _mode }, \ .show = _show, \ .store = _store, \ - .private = _private, \ }; -/* default cwrow/attribute files */ -CSROWDEV_ATTR(size_mb,S_IRUGO,csrow_size_show,NULL,0); -CSROWDEV_ATTR(dev_type,S_IRUGO,csrow_dev_type_show,NULL,0); -CSROWDEV_ATTR(mem_type,S_IRUGO,csrow_mem_type_show,NULL,0); -CSROWDEV_ATTR(edac_mode,S_IRUGO,csrow_edac_mode_show,NULL,0); -CSROWDEV_ATTR(ue_count,S_IRUGO,csrow_ue_count_show,NULL,0); -CSROWDEV_ATTR(ce_count,S_IRUGO,csrow_ce_count_show,NULL,0); +/* cwrow/attribute files */ +CSROWDEV_ATTR(size_mb,S_IRUGO,csrow_size_show,NULL); +CSROWDEV_ATTR(dev_type,S_IRUGO,csrow_dev_type_show,NULL); +CSROWDEV_ATTR(mem_type,S_IRUGO,csrow_mem_type_show,NULL); +CSROWDEV_ATTR(edac_mode,S_IRUGO,csrow_edac_mode_show,NULL); +CSROWDEV_ATTR(ue_count,S_IRUGO,csrow_ue_count_show,NULL); +CSROWDEV_ATTR(ce_count,S_IRUGO,csrow_ce_count_show,NULL); +CSROWDEV_ATTR(ch0_ce_count,S_IRUGO,csrow_ch0_ce_count_show,NULL); +CSROWDEV_ATTR(ch1_ce_count,S_IRUGO,csrow_ch1_ce_count_show,NULL); + +/* control/attribute files */ +CSROWDEV_ATTR(ch0_dimm_label,S_IRUGO|S_IWUSR, + csrow_ch0_dimm_label_show, + csrow_ch0_dimm_label_store); +CSROWDEV_ATTR(ch1_dimm_label,S_IRUGO|S_IWUSR, + csrow_ch1_dimm_label_show, + csrow_ch1_dimm_label_store); -/* default attributes of the CSROW object */ -static struct csrowdev_attribute *default_csrow_attr[] = { +/* Attributes of the CSROW object */ +static struct csrowdev_attribute *csrow_attr[] = { &attr_dev_type, &attr_mem_type, &attr_edac_mode, &attr_size_mb, &attr_ue_count, &attr_ce_count, + &attr_ch0_ce_count, + &attr_ch1_ce_count, + &attr_ch0_dimm_label, + &attr_ch1_dimm_label, NULL, }; - -/* possible dynamic channel DIMM Label attribute files */ -CSROWDEV_ATTR(ch0_dimm_label,S_IRUGO|S_IWUSR, - channel_dimm_label_show, - channel_dimm_label_store, - 0 ); -CSROWDEV_ATTR(ch1_dimm_label,S_IRUGO|S_IWUSR, - channel_dimm_label_show, - channel_dimm_label_store, - 1 ); -CSROWDEV_ATTR(ch2_dimm_label,S_IRUGO|S_IWUSR, - channel_dimm_label_show, - channel_dimm_label_store, - 2 ); -CSROWDEV_ATTR(ch3_dimm_label,S_IRUGO|S_IWUSR, - channel_dimm_label_show, - channel_dimm_label_store, - 3 ); -CSROWDEV_ATTR(ch4_dimm_label,S_IRUGO|S_IWUSR, - channel_dimm_label_show, - channel_dimm_label_store, - 4 ); -CSROWDEV_ATTR(ch5_dimm_label,S_IRUGO|S_IWUSR, - channel_dimm_label_show, - channel_dimm_label_store, - 5 ); - -/* Total possible dynamic DIMM Label attribute file table */ -static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = { - &attr_ch0_dimm_label, - &attr_ch1_dimm_label, - &attr_ch2_dimm_label, - &attr_ch3_dimm_label, - &attr_ch4_dimm_label, - &attr_ch5_dimm_label -}; - -/* possible dynamic channel ce_count attribute files */ -CSROWDEV_ATTR(ch0_ce_count,S_IRUGO|S_IWUSR, - channel_ce_count_show, - NULL, - 0 ); -CSROWDEV_ATTR(ch1_ce_count,S_IRUGO|S_IWUSR, - channel_ce_count_show, - NULL, - 1 ); -CSROWDEV_ATTR(ch2_ce_count,S_IRUGO|S_IWUSR, - channel_ce_count_show, - NULL, - 2 ); -CSROWDEV_ATTR(ch3_ce_count,S_IRUGO|S_IWUSR, - channel_ce_count_show, - NULL, - 3 ); -CSROWDEV_ATTR(ch4_ce_count,S_IRUGO|S_IWUSR, - channel_ce_count_show, - NULL, - 4 ); -CSROWDEV_ATTR(ch5_ce_count,S_IRUGO|S_IWUSR, - channel_ce_count_show, - NULL, - 5 ); - -/* Total possible dynamic ce_count attribute file table */ -static struct csrowdev_attribute *dynamic_csrow_ce_count_attr[] = { - &attr_ch0_ce_count, - &attr_ch1_ce_count, - &attr_ch2_ce_count, - &attr_ch3_ce_count, - &attr_ch4_ce_count, - &attr_ch5_ce_count -}; - - -#define EDAC_NR_CHANNELS 6 - -/* Create dynamic CHANNEL files, indexed by 'chan', under specifed CSROW */ -static int edac_create_channel_files(struct kobject *kobj, int chan) -{ - int err=-ENODEV; - - if (chan >= EDAC_NR_CHANNELS) - return err; - - /* create the DIMM label attribute file */ - err = sysfs_create_file(kobj, - (struct attribute *) dynamic_csrow_dimm_attr[chan]); - - if (!err) { - /* create the CE Count attribute file */ - err = sysfs_create_file(kobj, - (struct attribute *) dynamic_csrow_ce_count_attr[chan]); - } else { - debugf1("%s() dimm labels and ce_count files created", __func__); - } - - return err; -} - -/* No memory to release for this kobj */ +/* No memory to release */ static void edac_csrow_instance_release(struct kobject *kobj) { struct csrow_info *cs; + debugf1("%s()\n", __func__); cs = container_of(kobj, struct csrow_info, kobj); complete(&cs->kobj_complete); } -/* the kobj_type instance for a CSROW */ static struct kobj_type ktype_csrow = { .release = edac_csrow_instance_release, .sysfs_ops = &csrowfs_ops, - .default_attrs = (struct attribute **) default_csrow_attr, + .default_attrs = (struct attribute **) csrow_attr, }; /* Create a CSROW object under specifed edac_mc_device */ -static int edac_create_csrow_object( - struct kobject *edac_mci_kobj, - struct csrow_info *csrow, - int index) +static int edac_create_csrow_object(struct kobject *edac_mci_kobj, + struct csrow_info *csrow, int index) { int err = 0; - int chan; + debugf0("%s()\n", __func__); memset(&csrow->kobj, 0, sizeof(csrow->kobj)); /* generate ..../edac/mc/mc/csrow */ @@ -871,27 +1095,21 @@ static int edac_create_csrow_object( /* name this instance of csrow */ err = kobject_set_name(&csrow->kobj,"csrow%d",index); - if (err) - goto error_exit; - /* Instanstiate the csrow object */ - err = kobject_register(&csrow->kobj); if (!err) { - /* Create the dyanmic attribute files on this csrow, - * namely, the DIMM labels and the channel ce_count - */ - for (chan = 0; chan < csrow->nr_channels; chan++) { - err = edac_create_channel_files(&csrow->kobj,chan); - if (err) - break; - } + /* Instanstiate the csrow object */ + err = kobject_register(&csrow->kobj); + + if (err) + debugf0("Failed to register CSROW%d\n",index); + else + debugf0("Registered CSROW%d\n",index); } -error_exit: return err; } -/* default sysfs methods and data structures for the main MCI kobject */ +/* sysfs data structures and methods for the MCI kobjects */ static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci, const char *data, size_t count) @@ -917,7 +1135,6 @@ static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci, return count; } -/* default attribute files for the MCI object */ static ssize_t mci_ue_count_show(struct mem_ctl_info *mci, char *data) { return sprintf(data,"%d\n", mci->ue_count); @@ -943,11 +1160,71 @@ static ssize_t mci_seconds_show(struct mem_ctl_info *mci, char *data) return sprintf(data,"%ld\n", (jiffies - mci->start_time) / HZ); } +static ssize_t mci_mod_name_show(struct mem_ctl_info *mci, char *data) +{ + return sprintf(data,"%s %s\n", mci->mod_name, mci->mod_ver); +} + static ssize_t mci_ctl_name_show(struct mem_ctl_info *mci, char *data) { return sprintf(data,"%s\n", mci->ctl_name); } +static int mci_output_edac_cap(char *buf, unsigned long edac_cap) +{ + char *p = buf; + int bit_idx; + + for (bit_idx = 0; bit_idx < 8 * sizeof(edac_cap); bit_idx++) { + if ((edac_cap >> bit_idx) & 0x1) + p += sprintf(p, "%s ", edac_caps[bit_idx]); + } + + return p - buf; +} + +static ssize_t mci_edac_capability_show(struct mem_ctl_info *mci, char *data) +{ + char *p = data; + + p += mci_output_edac_cap(p,mci->edac_ctl_cap); + p += sprintf(p, "\n"); + return p - data; +} + +static ssize_t mci_edac_current_capability_show(struct mem_ctl_info *mci, + char *data) +{ + char *p = data; + + p += mci_output_edac_cap(p,mci->edac_cap); + p += sprintf(p, "\n"); + return p - data; +} + +static int mci_output_mtype_cap(char *buf, unsigned long mtype_cap) +{ + char *p = buf; + int bit_idx; + + for (bit_idx = 0; bit_idx < 8 * sizeof(mtype_cap); bit_idx++) { + if ((mtype_cap >> bit_idx) & 0x1) + p += sprintf(p, "%s ", mem_types[bit_idx]); + } + + return p - buf; +} + +static ssize_t mci_supported_mem_type_show(struct mem_ctl_info *mci, + char *data) +{ + char *p = data; + + p += mci_output_mtype_cap(p,mci->mtype_cap); + p += sprintf(p, "\n"); + return p - data; +} + static ssize_t mci_size_mb_show(struct mem_ctl_info *mci, char *data) { int total_pages, csrow_idx; @@ -974,7 +1251,6 @@ struct mcidev_attribute { #define to_mci(k) container_of(k, struct mem_ctl_info, edac_mci_kobj) #define to_mcidev_attr(a) container_of(a, struct mcidev_attribute, attr) -/* MCI show/store functions for top most object */ static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr, char *buffer) { @@ -1011,21 +1287,31 @@ struct mcidev_attribute mci_attr_##_name = { \ .store = _store, \ }; -/* default Control file */ +/* Control file */ MCIDEV_ATTR(reset_counters,S_IWUSR,NULL,mci_reset_counters_store); -/* default Attribute files */ +/* Attribute files */ MCIDEV_ATTR(mc_name,S_IRUGO,mci_ctl_name_show,NULL); +MCIDEV_ATTR(module_name,S_IRUGO,mci_mod_name_show,NULL); +MCIDEV_ATTR(edac_capability,S_IRUGO,mci_edac_capability_show,NULL); MCIDEV_ATTR(size_mb,S_IRUGO,mci_size_mb_show,NULL); MCIDEV_ATTR(seconds_since_reset,S_IRUGO,mci_seconds_show,NULL); MCIDEV_ATTR(ue_noinfo_count,S_IRUGO,mci_ue_noinfo_show,NULL); MCIDEV_ATTR(ce_noinfo_count,S_IRUGO,mci_ce_noinfo_show,NULL); MCIDEV_ATTR(ue_count,S_IRUGO,mci_ue_count_show,NULL); MCIDEV_ATTR(ce_count,S_IRUGO,mci_ce_count_show,NULL); +MCIDEV_ATTR(edac_current_capability,S_IRUGO, + mci_edac_current_capability_show,NULL); +MCIDEV_ATTR(supported_mem_type,S_IRUGO, + mci_supported_mem_type_show,NULL); static struct mcidev_attribute *mci_attr[] = { &mci_attr_reset_counters, + &mci_attr_module_name, &mci_attr_mc_name, + &mci_attr_edac_capability, + &mci_attr_edac_current_capability, + &mci_attr_supported_mem_type, &mci_attr_size_mb, &mci_attr_seconds_since_reset, &mci_attr_ue_noinfo_count, @@ -1053,6 +1339,7 @@ static struct kobj_type ktype_mci = { .default_attrs = (struct attribute **) mci_attr, }; +#endif /* DISABLE_EDAC_SYSFS */ #define EDAC_DEVICE_SYMLINK "device" @@ -1065,6 +1352,11 @@ static struct kobj_type ktype_mci = { * !0 Failure */ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) +#ifdef DISABLE_EDAC_SYSFS +{ + return 0; +} +#else { int i; int err; @@ -1076,6 +1368,7 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) /* set the name of the mc object */ err = kobject_set_name(edac_mci_kobj,"mc%d",mci->mc_idx); + if (err) return err; @@ -1085,12 +1378,14 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) /* register the mc kobject */ err = kobject_register(edac_mci_kobj); + if (err) return err; /* create a symlink for the device */ err = sysfs_create_link(edac_mci_kobj, &mci->dev->kobj, EDAC_DEVICE_SYMLINK); + if (err) goto fail0; @@ -1103,6 +1398,7 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) /* Only expose populated CSROWs */ if (csrow->nr_pages > 0) { err = edac_create_csrow_object(edac_mci_kobj,csrow,i); + if (err) goto fail1; } @@ -1126,12 +1422,14 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) wait_for_completion(&mci->kobj_complete); return err; } +#endif /* DISABLE_EDAC_SYSFS */ /* * remove a Memory Controller instance */ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) { +#ifndef DISABLE_EDAC_SYSFS int i; debugf0("%s()\n", __func__); @@ -1149,6 +1447,7 @@ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) init_completion(&mci->kobj_complete); kobject_unregister(&mci->edac_mci_kobj); wait_for_completion(&mci->kobj_complete); +#endif /* DISABLE_EDAC_SYSFS */ } /* END OF sysfs data and methods */ diff --git a/trunk/drivers/hwmon/abituguru.c b/trunk/drivers/hwmon/abituguru.c index cc15c4f2e9ec..59122cc0a50a 100644 --- a/trunk/drivers/hwmon/abituguru.c +++ b/trunk/drivers/hwmon/abituguru.c @@ -142,14 +142,6 @@ static const u8 abituguru_pwm_max[5] = { 0, 255, 255, 75, 75 }; static int force; module_param(force, bool, 0); MODULE_PARM_DESC(force, "Set to one to force detection."); -static int bank1_types[ABIT_UGURU_MAX_BANK1_SENSORS] = { -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -module_param_array(bank1_types, int, NULL, 0); -MODULE_PARM_DESC(bank1_types, "Bank1 sensortype autodetection override:\n" - " -1 autodetect\n" - " 0 volt sensor\n" - " 1 temp sensor\n" - " 2 not connected"); static int fan_sensors; module_param(fan_sensors, int, 0); MODULE_PARM_DESC(fan_sensors, "Number of fan sensors on the uGuru " @@ -405,15 +397,6 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data, u8 val, buf[3]; int ret = ABIT_UGURU_NC; - /* If overriden by the user return the user selected type */ - if (bank1_types[sensor_addr] >= ABIT_UGURU_IN_SENSOR && - bank1_types[sensor_addr] <= ABIT_UGURU_NC) { - ABIT_UGURU_DEBUG(2, "assuming sensor type %d for bank1 sensor " - "%d because of \"bank1_types\" module param\n", - bank1_types[sensor_addr], (int)sensor_addr); - return bank1_types[sensor_addr]; - } - /* First read the sensor and the current settings */ if (abituguru_read(data, ABIT_UGURU_SENSOR_BANK1, sensor_addr, &val, 1, ABIT_UGURU_MAX_RETRIES) != 1) @@ -531,7 +514,7 @@ abituguru_detect_no_bank2_sensors(struct abituguru_data *data) { int i; - if (fan_sensors > 0 && fan_sensors <= ABIT_UGURU_MAX_BANK2_SENSORS) { + if (fan_sensors) { data->bank2_sensors = fan_sensors; ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of " "\"fan_sensors\" module param\n", @@ -585,7 +568,7 @@ abituguru_detect_no_pwms(struct abituguru_data *data) { int i, j; - if (pwms > 0 && pwms <= ABIT_UGURU_MAX_PWMS) { + if (pwms) { data->pwms = pwms; ABIT_UGURU_DEBUG(2, "assuming %d PWM outputs because of " "\"pwms\" module param\n", (int)data->pwms); diff --git a/trunk/drivers/i2c/algos/i2c-algo-bit.c b/trunk/drivers/i2c/algos/i2c-algo-bit.c index ab230c033f99..df05df1a0ef6 100644 --- a/trunk/drivers/i2c/algos/i2c-algo-bit.c +++ b/trunk/drivers/i2c/algos/i2c-algo-bit.c @@ -372,6 +372,7 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) while (count > 0) { inval = i2c_inb(i2c_adap); +/*printk("%#02x ",inval); if ( ! (count % 16) ) printk("\n"); */ if (inval>=0) { *temp = inval; rdcount++; @@ -543,7 +544,8 @@ int i2c_bit_add_bus(struct i2c_adapter *adap) adap->timeout = 100; /* default values, should */ adap->retries = 3; /* be replaced by defines */ - return i2c_add_adapter(adap); + i2c_add_adapter(adap); + return 0; } diff --git a/trunk/drivers/i2c/algos/i2c-algo-ite.c b/trunk/drivers/i2c/algos/i2c-algo-ite.c index 70d8eefb5efc..2db7bfc85225 100644 --- a/trunk/drivers/i2c/algos/i2c-algo-ite.c +++ b/trunk/drivers/i2c/algos/i2c-algo-ite.c @@ -742,8 +742,10 @@ int i2c_iic_add_bus(struct i2c_adapter *adap) adap->retries = 3; /* be replaced by defines */ adap->flags = 0; + i2c_add_adapter(adap); iic_init(iic_adap); - return i2c_add_adapter(adap); + + return 0; } diff --git a/trunk/drivers/i2c/algos/i2c-algo-pca.c b/trunk/drivers/i2c/algos/i2c-algo-pca.c index b88a6fcf7bd0..82946acab4c7 100644 --- a/trunk/drivers/i2c/algos/i2c-algo-pca.c +++ b/trunk/drivers/i2c/algos/i2c-algo-pca.c @@ -374,10 +374,10 @@ int i2c_pca_add_bus(struct i2c_adapter *adap) adap->timeout = 100; /* default values, should */ adap->retries = 3; /* be replaced by defines */ - if ((rval = pca_init(pca_adap))) - return rval; + rval = pca_init(pca_adap); - rval = i2c_add_adapter(adap); + if (!rval) + i2c_add_adapter(adap); return rval; } diff --git a/trunk/drivers/i2c/algos/i2c-algo-pcf.c b/trunk/drivers/i2c/algos/i2c-algo-pcf.c index 5b24930adb5a..6e498df1f717 100644 --- a/trunk/drivers/i2c/algos/i2c-algo-pcf.c +++ b/trunk/drivers/i2c/algos/i2c-algo-pcf.c @@ -479,11 +479,9 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap) adap->timeout = 100; /* default values, should */ adap->retries = 3; /* be replaced by defines */ - if ((rval = pcf_init_8584(pcf_adap))) - return rval; - - rval = i2c_add_adapter(adap); - + rval = pcf_init_8584(pcf_adap); + if (!rval) + i2c_add_adapter(adap); return rval; } diff --git a/trunk/drivers/i2c/algos/i2c-algo-sibyte.c b/trunk/drivers/i2c/algos/i2c-algo-sibyte.c index 32d41c6fac0f..3df3f09995c2 100644 --- a/trunk/drivers/i2c/algos/i2c-algo-sibyte.c +++ b/trunk/drivers/i2c/algos/i2c-algo-sibyte.c @@ -173,7 +173,9 @@ int i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed) printk("\n"); } - return i2c_add_adapter(i2c_adap); + i2c_add_adapter(i2c_adap); + + return 0; } diff --git a/trunk/drivers/i2c/busses/i2c-iop3xx.c b/trunk/drivers/i2c/busses/i2c-iop3xx.c index 48c56939c861..aca7e1668605 100644 --- a/trunk/drivers/i2c/busses/i2c-iop3xx.c +++ b/trunk/drivers/i2c/busses/i2c-iop3xx.c @@ -21,9 +21,6 @@ * - Make it work with IXP46x chips * - Cleanup function names, coding style, etc * - * - writing to slave address causes latchup on iop331. - * fix: driver refuses to address self. - * * 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, version 2. @@ -75,6 +72,12 @@ iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap) __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET); } +static void +iop3xx_i2c_set_slave_addr(struct i2c_algo_iop3xx_data *iop3xx_adap) +{ + __raw_writel(MYSAR, iop3xx_adap->ioaddr + SAR_OFFSET); +} + static void iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) { @@ -245,13 +248,6 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, int status; int rc; - /* avoid writing to my slave address (hangs on 80331), - * forbidden in Intel developer manual - */ - if (msg->addr == MYSAR) { - return -EBUSY; - } - __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); @@ -502,6 +498,7 @@ iop3xx_i2c_probe(struct platform_device *pdev) spin_lock_init(&adapter_data->lock); iop3xx_i2c_reset(adapter_data); + iop3xx_i2c_set_slave_addr(adapter_data); iop3xx_i2c_enable(adapter_data); platform_set_drvdata(pdev, new_adapter); diff --git a/trunk/drivers/i2c/busses/i2c-iop3xx.h b/trunk/drivers/i2c/busses/i2c-iop3xx.h index 8485861f6a36..e46ebaea7b1e 100644 --- a/trunk/drivers/i2c/busses/i2c-iop3xx.h +++ b/trunk/drivers/i2c/busses/i2c-iop3xx.h @@ -80,7 +80,7 @@ #define IOP3XX_GPOD_I2C0 0x00c0 /* clear these bits to enable ch0 */ #define IOP3XX_GPOD_I2C1 0x0030 /* clear these bits to enable ch1 */ -#define MYSAR 0 /* default slave address */ +#define MYSAR 0x02 /* SWAG a suitable slave address */ #define I2C_ERR 321 #define I2C_ERR_BERR (I2C_ERR+0) diff --git a/trunk/drivers/i2c/busses/i2c-powermac.c b/trunk/drivers/i2c/busses/i2c-powermac.c index 53bb43593863..2a0b3be7cdd0 100644 --- a/trunk/drivers/i2c/busses/i2c-powermac.c +++ b/trunk/drivers/i2c/busses/i2c-powermac.c @@ -148,6 +148,8 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap, int read; int addrdir; + if (num != 1) + return -EINVAL; if (msgs->flags & I2C_M_TEN) return -EINVAL; read = (msgs->flags & I2C_M_RD) != 0; @@ -164,7 +166,7 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap, rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len); bail: pmac_i2c_close(bus); - return rc < 0 ? rc : 1; + return rc < 0 ? rc : msgs->len; } static u32 i2c_powermac_func(struct i2c_adapter * adapter) diff --git a/trunk/drivers/i2c/busses/scx200_acb.c b/trunk/drivers/i2c/busses/scx200_acb.c index ced309ff056f..22a3eda04166 100644 --- a/trunk/drivers/i2c/busses/scx200_acb.c +++ b/trunk/drivers/i2c/busses/scx200_acb.c @@ -184,21 +184,21 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status) break; case state_read: - /* Set ACK if _next_ byte will be the last one */ - if (iface->len == 2) + /* Set ACK if receiving the last byte */ + if (iface->len == 1) outb(inb(ACBCTL1) | ACBCTL1_ACK, ACBCTL1); else outb(inb(ACBCTL1) & ~ACBCTL1_ACK, ACBCTL1); - if (iface->len == 1) { + *iface->ptr++ = inb(ACBSDA); + --iface->len; + + if (iface->len == 0) { iface->result = 0; iface->state = state_idle; outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); } - *iface->ptr++ = inb(ACBSDA); - --iface->len; - break; case state_write: @@ -307,12 +307,8 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter, buffer = (u8 *)&cur_word; break; - case I2C_SMBUS_I2C_BLOCK_DATA: - if (rw == I2C_SMBUS_READ) - data->block[0] = I2C_SMBUS_BLOCK_MAX; /* For now */ + case I2C_SMBUS_BLOCK_DATA: len = data->block[0]; - if (len == 0 || len > I2C_SMBUS_BLOCK_MAX) - return -EINVAL; buffer = &data->block[1]; break; @@ -376,7 +372,7 @@ static u32 scx200_acb_func(struct i2c_adapter *adapter) { return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | - I2C_FUNC_SMBUS_I2C_BLOCK; + I2C_FUNC_SMBUS_BLOCK_DATA; } /* For now, we only handle combined mode (smbus) */ diff --git a/trunk/drivers/i2c/chips/pca9539.c b/trunk/drivers/i2c/chips/pca9539.c index cb22280cdd27..54b6e6a4beed 100644 --- a/trunk/drivers/i2c/chips/pca9539.c +++ b/trunk/drivers/i2c/chips/pca9539.c @@ -134,13 +134,11 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind) new_client->driver = &pca9539_driver; new_client->flags = 0; - if (kind < 0) { - /* Detection: the pca9539 only has 8 registers (0-7). - A read of 7 should succeed, but a read of 8 should fail. */ - if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || - (i2c_smbus_read_byte_data(new_client, 8) >= 0)) - goto exit_kfree; - } + /* Detection: the pca9539 only has 8 registers (0-7). + A read of 7 should succeed, but a read of 8 should fail. */ + if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || + (i2c_smbus_read_byte_data(new_client, 8) >= 0)) + goto exit_kfree; strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE); diff --git a/trunk/drivers/i2c/i2c-core.c b/trunk/drivers/i2c/i2c-core.c index 9cb277d6aa48..a45155f799d4 100644 --- a/trunk/drivers/i2c/i2c-core.c +++ b/trunk/drivers/i2c/i2c-core.c @@ -756,9 +756,9 @@ int i2c_probe(struct i2c_adapter *adapter, "parameter for adapter %d, " "addr 0x%02x\n", adap_id, address_data->ignore[j + 1]); - ignore = 1; - break; } + ignore = 1; + break; } if (ignore) continue; diff --git a/trunk/drivers/ide/legacy/ide-cs.c b/trunk/drivers/ide/legacy/ide-cs.c index 602797a44208..b7e459e4f284 100644 --- a/trunk/drivers/ide/legacy/ide-cs.c +++ b/trunk/drivers/ide/legacy/ide-cs.c @@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_device *link) kfree(link->priv); } /* ide_detach */ -static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) +static void idecs_mmio_fixup(ide_hwif_t *hwif) +{ + default_hwif_mmiops(hwif); + hwif->mmio = 2; + + ide_undecoded_slave(hwif); +} + +static int idecs_register(unsigned long io, unsigned long ctl, + unsigned long irq, struct pcmcia_device *handle, int is_mmio) { hw_regs_t hw; memset(&hw, 0, sizeof(hw)); @@ -154,7 +163,19 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq hw.irq = irq; hw.chipset = ide_pci; hw.dev = &handle->dev; - return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); + + if(is_mmio) + return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup); + else + return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); +} + +void outb_io(unsigned char value, unsigned long port) { + outb(value, port); +} + +void outb_mem(unsigned char value, unsigned long port) { + writeb(value, (void __iomem *) port); } /*====================================================================== @@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_device *link) } *stk = NULL; cistpl_cftable_entry_t *cfg; int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; - unsigned long io_base, ctl_base; + unsigned long io_base, ctl_base, is_mmio, try_slave; + void (*my_outb)(unsigned char, unsigned long); DEBUG(0, "ide_config(0x%p)\n", link); @@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_device *link) /* Not sure if this is right... look up the current Vcc */ CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); - pass = io_base = ctl_base = 0; + pass = io_base = ctl_base = is_mmio = try_slave = 0; tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.Attributes = 0; CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); @@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_device *link) goto next_entry; io_base = link->io.BasePort1; ctl_base = link->io.BasePort1 + 0x0e; + + if (io->win[0].len >= 0x20) + try_slave = 1; + } else goto next_entry; /* If we've got this far, we're done */ break; } + if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) { + win_req_t req; + memreq_t map; + cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem; + + if (mem->win[0].len < 16) + goto next_entry; + + req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; + req.Attributes |= WIN_ENABLE; + req.Base = mem->win[0].host_addr; + req.Size = 0; + + req.AccessSpeed = 0; + if (pcmcia_request_window(&link, &req, &link->win) != 0) + goto next_entry; + map.Page = 0; map.CardOffset = mem->win[0].card_addr; + if (pcmcia_map_mem_page(link->win, &map) != 0) + goto next_entry; + + io_base = (unsigned long) ioremap(req.Base, req.Size); + ctl_base = io_base + 0x0e; + is_mmio = 1; + + if (mem->win[0].len >= 0x20) + try_slave = 1; + + break; + } + next_entry: if (cfg->flags & CISTPL_CFTABLE_DEFAULT) memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); @@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_device *link) CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); + if(is_mmio) + my_outb = outb_mem; + else + my_outb = outb_io; + /* disable drive interrupts during IDE probe */ - outb(0x02, ctl_base); + my_outb(0x02, ctl_base); /* special setup for KXLC005 card */ if (is_kme) - outb(0x81, ctl_base+1); + my_outb(0x81, ctl_base+1); /* retry registration in case device is still spinning up */ for (hd = -1, i = 0; i < 10; i++) { - hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); + hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio); if (hd >= 0) break; - if (link->io.NumPorts1 == 0x20) { - outb(0x02, ctl_base + 0x10); + if (try_slave) { + my_outb(0x02, ctl_base + 0x10); hd = idecs_register(io_base + 0x10, ctl_base + 0x10, - link->irq.AssignedIRQ, link); + link->irq.AssignedIRQ, link, is_mmio); if (hd >= 0) { io_base += 0x10; ctl_base += 0x10; diff --git a/trunk/drivers/ide/pci/generic.c b/trunk/drivers/ide/pci/generic.c index 2f962cfa3f7f..f82e82109728 100644 --- a/trunk/drivers/ide/pci/generic.c +++ b/trunk/drivers/ide/pci/generic.c @@ -212,9 +212,6 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi (!(PCI_FUNC(dev->devfn) & 1))) goto out; - if (dev->vendor == PCI_VENDOR_ID_JMICRON && PCI_FUNC(dev->devfn) != 1) - goto out; - pci_read_config_word(dev, PCI_COMMAND, &command); if (!(command & PCI_COMMAND_IO)) { printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name); @@ -242,11 +239,6 @@ static struct pci_device_id generic_pci_tbl[] = { { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19}, /* Must come last. If you add entries adjust this table appropriately and the init_one code */ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, { 0, }, diff --git a/trunk/drivers/isdn/hisax/asuscom.c b/trunk/drivers/isdn/hisax/asuscom.c index 93ff941c48f1..a98c5e38bbbc 100644 --- a/trunk/drivers/isdn/hisax/asuscom.c +++ b/trunk/drivers/isdn/hisax/asuscom.c @@ -297,7 +297,7 @@ Asus_card_msg(struct IsdnCardState *cs, int mt, void *arg) } #ifdef __ISAPNP__ -static struct isapnp_device_id asus_ids[] __devinitdata = { +static struct isapnp_device_id asus_ids[] __initdata = { { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688), ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688), (unsigned long) "Asus1688 PnP" }, @@ -313,11 +313,11 @@ static struct isapnp_device_id asus_ids[] __devinitdata = { { 0, } }; -static struct isapnp_device_id *ipid __devinitdata = &asus_ids[0]; +static struct isapnp_device_id *ipid __initdata = &asus_ids[0]; static struct pnp_card *pnp_c __devinitdata = NULL; #endif -int __devinit +int __init setup_asuscom(struct IsdnCard *card) { int bytecnt; diff --git a/trunk/drivers/isdn/hisax/avm_a1.c b/trunk/drivers/isdn/hisax/avm_a1.c index 729e906bdc61..9a8b02557ff9 100644 --- a/trunk/drivers/isdn/hisax/avm_a1.c +++ b/trunk/drivers/isdn/hisax/avm_a1.c @@ -178,7 +178,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -int __devinit +int __init setup_avm_a1(struct IsdnCard *card) { u_char val; diff --git a/trunk/drivers/isdn/hisax/avm_pci.c b/trunk/drivers/isdn/hisax/avm_pci.c index 369afd3a3a4b..04f5917bf5a1 100644 --- a/trunk/drivers/isdn/hisax/avm_pci.c +++ b/trunk/drivers/isdn/hisax/avm_pci.c @@ -639,7 +639,7 @@ clear_pending_hdlc_ints(struct IsdnCardState *cs) } #endif /* 0 */ -static void +static void __init inithdlc(struct IsdnCardState *cs) { cs->bcs[0].BC_SetStack = setstack_hdlc; @@ -727,13 +727,13 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) } #ifdef CONFIG_PCI -static struct pci_dev *dev_avm __devinitdata = NULL; +static struct pci_dev *dev_avm __initdata = NULL; #endif #ifdef __ISAPNP__ -static struct pnp_card *pnp_avm_c __devinitdata = NULL; +static struct pnp_card *pnp_avm_c __initdata = NULL; #endif -int __devinit +int __init setup_avm_pcipnp(struct IsdnCard *card) { u_int val, ver; diff --git a/trunk/drivers/isdn/hisax/bkm_a4t.c b/trunk/drivers/isdn/hisax/bkm_a4t.c index 87a630128a6c..3cf1f2421789 100644 --- a/trunk/drivers/isdn/hisax/bkm_a4t.c +++ b/trunk/drivers/isdn/hisax/bkm_a4t.c @@ -255,9 +255,9 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return (0); } -static struct pci_dev *dev_a4t __devinitdata = NULL; +static struct pci_dev *dev_a4t __initdata = NULL; -int __devinit +int __init setup_bkm_a4t(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/bkm_a8.c b/trunk/drivers/isdn/hisax/bkm_a8.c index dae090a9a489..15681f3e73b8 100644 --- a/trunk/drivers/isdn/hisax/bkm_a8.c +++ b/trunk/drivers/isdn/hisax/bkm_a8.c @@ -260,7 +260,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return (0); } -static int __devinit +static int __init sct_alloc_io(u_int adr, u_int len) { if (!request_region(adr, len, "scitel")) { @@ -272,16 +272,16 @@ sct_alloc_io(u_int adr, u_int len) return(0); } -static struct pci_dev *dev_a8 __devinitdata = NULL; -static u16 sub_vendor_id __devinitdata = 0; -static u16 sub_sys_id __devinitdata = 0; -static u_char pci_bus __devinitdata = 0; -static u_char pci_device_fn __devinitdata = 0; -static u_char pci_irq __devinitdata = 0; +static struct pci_dev *dev_a8 __initdata = NULL; +static u16 sub_vendor_id __initdata = 0; +static u16 sub_sys_id __initdata = 0; +static u_char pci_bus __initdata = 0; +static u_char pci_device_fn __initdata = 0; +static u_char pci_irq __initdata = 0; #endif /* CONFIG_PCI */ -int __devinit +int __init setup_sct_quadro(struct IsdnCard *card) { #ifdef CONFIG_PCI diff --git a/trunk/drivers/isdn/hisax/config.c b/trunk/drivers/isdn/hisax/config.c index e10350360f2f..5333be5d2c47 100644 --- a/trunk/drivers/isdn/hisax/config.c +++ b/trunk/drivers/isdn/hisax/config.c @@ -1875,7 +1875,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if) #ifdef CONFIG_PCI #include -static struct pci_device_id hisax_pci_tbl[] __devinitdata = { +static struct pci_device_id hisax_pci_tbl[] __initdata = { #ifdef CONFIG_HISAX_FRITZPCI {PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID}, #endif diff --git a/trunk/drivers/isdn/hisax/diva.c b/trunk/drivers/isdn/hisax/diva.c index e294fa3918f3..323a02ef3844 100644 --- a/trunk/drivers/isdn/hisax/diva.c +++ b/trunk/drivers/isdn/hisax/diva.c @@ -887,13 +887,13 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *dev_diva __devinitdata = NULL; -static struct pci_dev *dev_diva_u __devinitdata = NULL; -static struct pci_dev *dev_diva201 __devinitdata = NULL; -static struct pci_dev *dev_diva202 __devinitdata = NULL; +static struct pci_dev *dev_diva __initdata = NULL; +static struct pci_dev *dev_diva_u __initdata = NULL; +static struct pci_dev *dev_diva201 __initdata = NULL; +static struct pci_dev *dev_diva202 __initdata = NULL; #ifdef __ISAPNP__ -static struct isapnp_device_id diva_ids[] __devinitdata = { +static struct isapnp_device_id diva_ids[] __initdata = { { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), (unsigned long) "Diva picola" }, @@ -915,12 +915,12 @@ static struct isapnp_device_id diva_ids[] __devinitdata = { { 0, } }; -static struct isapnp_device_id *ipid __devinitdata = &diva_ids[0]; +static struct isapnp_device_id *ipid __initdata = &diva_ids[0]; static struct pnp_card *pnp_c __devinitdata = NULL; #endif -int __devinit +int __init setup_diva(struct IsdnCard *card) { int bytecnt = 8; diff --git a/trunk/drivers/isdn/hisax/enternow_pci.c b/trunk/drivers/isdn/hisax/enternow_pci.c index 76c7d29d1b2f..8fcbe2e7d765 100644 --- a/trunk/drivers/isdn/hisax/enternow_pci.c +++ b/trunk/drivers/isdn/hisax/enternow_pci.c @@ -301,10 +301,10 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) } -static struct pci_dev *dev_netjet __devinitdata = NULL; +static struct pci_dev *dev_netjet __initdata = NULL; /* called by config.c */ -int __devinit +int __init setup_enternow_pci(struct IsdnCard *card) { int bytecnt; diff --git a/trunk/drivers/isdn/hisax/gazel.c b/trunk/drivers/isdn/hisax/gazel.c index fe2937267777..3e7d92303582 100644 --- a/trunk/drivers/isdn/hisax/gazel.c +++ b/trunk/drivers/isdn/hisax/gazel.c @@ -484,7 +484,7 @@ reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs) return 1; } -static int __devinit +static int __init setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs) { printk(KERN_INFO "Gazel: ISA PnP card automatic recognition\n"); @@ -532,9 +532,9 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs) return (0); } -static struct pci_dev *dev_tel __devinitdata = NULL; +static struct pci_dev *dev_tel __initdata = NULL; -static int __devinit +static int __init setup_gazelpci(struct IsdnCardState *cs) { u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0; @@ -621,7 +621,7 @@ setup_gazelpci(struct IsdnCardState *cs) return (0); } -int __devinit +int __init setup_gazel(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/hfc4s8s_l1.c b/trunk/drivers/isdn/hisax/hfc4s8s_l1.c index 3a5ca8a68fc4..0f967b3df79d 100644 --- a/trunk/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/trunk/drivers/isdn/hisax/hfc4s8s_l1.c @@ -1703,7 +1703,7 @@ hfc4s8s_module_init(void) /* driver module exit : */ /* release the HFC-4s/8s hardware */ /*************************************/ -static void __exit +static void hfc4s8s_module_exit(void) { pci_unregister_driver(&hfc4s8s_driver); diff --git a/trunk/drivers/isdn/hisax/hfc_2bds0.c b/trunk/drivers/isdn/hisax/hfc_2bds0.c index 6360e8214720..637a261c9312 100644 --- a/trunk/drivers/isdn/hisax/hfc_2bds0.c +++ b/trunk/drivers/isdn/hisax/hfc_2bds0.c @@ -1015,7 +1015,7 @@ hfc_dbusy_timer(struct IsdnCardState *cs) { } -static unsigned int +static unsigned int __init *init_send_hfcd(int cnt) { int i, *send; @@ -1030,7 +1030,7 @@ static unsigned int return(send); } -void +void __init init2bds0(struct IsdnCardState *cs) { cs->setstack_d = setstack_hfcd; diff --git a/trunk/drivers/isdn/hisax/hfc_2bs0.c b/trunk/drivers/isdn/hisax/hfc_2bs0.c index d0520ad30677..c964539cc43e 100644 --- a/trunk/drivers/isdn/hisax/hfc_2bs0.c +++ b/trunk/drivers/isdn/hisax/hfc_2bs0.c @@ -551,7 +551,7 @@ setstack_hfc(struct PStack *st, struct BCState *bcs) return (0); } -static void +static void __init init_send(struct BCState *bcs) { int i; @@ -565,7 +565,7 @@ init_send(struct BCState *bcs) bcs->hw.hfc.send[i] = 0x1fff; } -void +void __init inithfc(struct IsdnCardState *cs) { init_send(&cs->bcs[0]); diff --git a/trunk/drivers/isdn/hisax/hfc_pci.c b/trunk/drivers/isdn/hisax/hfc_pci.c index 1df60ca9481f..7241e73879ba 100644 --- a/trunk/drivers/isdn/hisax/hfc_pci.c +++ b/trunk/drivers/isdn/hisax/hfc_pci.c @@ -1581,7 +1581,7 @@ hfcpci_bh(struct IsdnCardState *cs) /********************************/ /* called for card init message */ /********************************/ -static void +static void __init inithfcpci(struct IsdnCardState *cs) { cs->bcs[0].BC_SetStack = setstack_2b; @@ -1638,11 +1638,11 @@ hfcpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) /* this variable is used as card index when more than one cards are present */ -static struct pci_dev *dev_hfcpci __devinitdata = NULL; +static struct pci_dev *dev_hfcpci __initdata = NULL; #endif /* CONFIG_PCI */ -int __devinit +int __init setup_hfcpci(struct IsdnCard *card) { u_long flags; diff --git a/trunk/drivers/isdn/hisax/hfcscard.c b/trunk/drivers/isdn/hisax/hfcscard.c index 4e7f472877e9..86ab1c13f6b1 100644 --- a/trunk/drivers/isdn/hisax/hfcscard.c +++ b/trunk/drivers/isdn/hisax/hfcscard.c @@ -139,7 +139,7 @@ hfcs_card_msg(struct IsdnCardState *cs, int mt, void *arg) } #ifdef __ISAPNP__ -static struct isapnp_device_id hfc_ids[] __devinitdata = { +static struct isapnp_device_id hfc_ids[] __initdata = { { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114), ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114), (unsigned long) "Acer P10" }, @@ -164,11 +164,11 @@ static struct isapnp_device_id hfc_ids[] __devinitdata = { { 0, } }; -static struct isapnp_device_id *ipid __devinitdata = &hfc_ids[0]; +static struct isapnp_device_id *ipid __initdata = &hfc_ids[0]; static struct pnp_card *pnp_c __devinitdata = NULL; #endif -int __devinit +int __init setup_hfcs(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/icc.c b/trunk/drivers/isdn/hisax/icc.c index 2cf7b665609e..c615752b96aa 100644 --- a/trunk/drivers/isdn/hisax/icc.c +++ b/trunk/drivers/isdn/hisax/icc.c @@ -24,10 +24,10 @@ #define DBUSY_TIMER_VALUE 80 #define ARCOFI_USE 0 -static char *ICCVer[] = +static char *ICCVer[] __initdata = {"2070 A1/A3", "2070 B1", "2070 B2/B3", "2070 V2.4"}; -void +void __init ICCVersion(struct IsdnCardState *cs, char *s) { int val; @@ -613,7 +613,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) } } -void +void __init initicc(struct IsdnCardState *cs) { cs->setstack_d = setstack_icc; @@ -646,7 +646,7 @@ initicc(struct IsdnCardState *cs) ph_command(cs, ICC_CMD_DI); } -void +void __init clear_pending_icc_ints(struct IsdnCardState *cs) { int val, eval; diff --git a/trunk/drivers/isdn/hisax/icc.h b/trunk/drivers/isdn/hisax/icc.h index e7f593967e43..b3bb3d5de532 100644 --- a/trunk/drivers/isdn/hisax/icc.h +++ b/trunk/drivers/isdn/hisax/icc.h @@ -65,7 +65,7 @@ #define ICC_IND_AIL 0xE #define ICC_IND_DC 0xF -extern void ICCVersion(struct IsdnCardState *cs, char *s); +extern void __init ICCVersion(struct IsdnCardState *cs, char *s); extern void initicc(struct IsdnCardState *cs); extern void icc_interrupt(struct IsdnCardState *cs, u_char val); extern void clear_pending_icc_ints(struct IsdnCardState *cs); diff --git a/trunk/drivers/isdn/hisax/ipacx.c b/trunk/drivers/isdn/hisax/ipacx.c index 00afd5538909..df5fc92a89b2 100644 --- a/trunk/drivers/isdn/hisax/ipacx.c +++ b/trunk/drivers/isdn/hisax/ipacx.c @@ -38,8 +38,8 @@ static void dbusy_timer_handler(struct IsdnCardState *cs); static void dch_empty_fifo(struct IsdnCardState *cs, int count); static void dch_fill_fifo(struct IsdnCardState *cs); static inline void dch_int(struct IsdnCardState *cs); -static void dch_setstack(struct PStack *st, struct IsdnCardState *cs); -static void dch_init(struct IsdnCardState *cs); +static void __devinit dch_setstack(struct PStack *st, struct IsdnCardState *cs); +static void __devinit dch_init(struct IsdnCardState *cs); static void bch_l2l1(struct PStack *st, int pr, void *arg); static void bch_empty_fifo(struct BCState *bcs, int count); static void bch_fill_fifo(struct BCState *bcs); @@ -48,8 +48,8 @@ static void bch_mode(struct BCState *bcs, int mode, int bc); static void bch_close_state(struct BCState *bcs); static int bch_open_state(struct IsdnCardState *cs, struct BCState *bcs); static int bch_setstack(struct PStack *st, struct BCState *bcs); -static void bch_init(struct IsdnCardState *cs, int hscx); -static void clear_pending_ints(struct IsdnCardState *cs); +static void __devinit bch_init(struct IsdnCardState *cs, int hscx); +static void __init clear_pending_ints(struct IsdnCardState *cs); //---------------------------------------------------------- // Issue Layer 1 command to chip @@ -408,7 +408,7 @@ dch_int(struct IsdnCardState *cs) //---------------------------------------------------------- //---------------------------------------------------------- -static void +static void __devinit dch_setstack(struct PStack *st, struct IsdnCardState *cs) { st->l1.l1hw = dch_l2l1; @@ -416,7 +416,7 @@ dch_setstack(struct PStack *st, struct IsdnCardState *cs) //---------------------------------------------------------- //---------------------------------------------------------- -static void +static void __devinit dch_init(struct IsdnCardState *cs) { printk(KERN_INFO "HiSax: IPACX ISDN driver v0.1.0\n"); @@ -823,7 +823,7 @@ bch_setstack(struct PStack *st, struct BCState *bcs) //---------------------------------------------------------- //---------------------------------------------------------- -static void +static void __devinit bch_init(struct IsdnCardState *cs, int hscx) { cs->bcs[hscx].BC_SetStack = bch_setstack; @@ -861,7 +861,7 @@ interrupt_ipacx(struct IsdnCardState *cs) //---------------------------------------------------------- // Clears chip interrupt status //---------------------------------------------------------- -static void +static void __init clear_pending_ints(struct IsdnCardState *cs) { int ista; @@ -883,7 +883,7 @@ clear_pending_ints(struct IsdnCardState *cs) // Does chip configuration work // Work to do depends on bit mask in part //---------------------------------------------------------- -void +void __init init_ipacx(struct IsdnCardState *cs, int part) { if (part &1) { // initialise chip diff --git a/trunk/drivers/isdn/hisax/isurf.c b/trunk/drivers/isdn/hisax/isurf.c index 715a1a8cd694..33747afc984d 100644 --- a/trunk/drivers/isdn/hisax/isurf.c +++ b/trunk/drivers/isdn/hisax/isurf.c @@ -196,10 +196,10 @@ isurf_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) { } #ifdef __ISAPNP__ -static struct pnp_card *pnp_c __devinitdata = NULL; +static struct pnp_card *pnp_c __initdata = NULL; #endif -int __devinit +int __init setup_isurf(struct IsdnCard *card) { int ver; diff --git a/trunk/drivers/isdn/hisax/ix1_micro.c b/trunk/drivers/isdn/hisax/ix1_micro.c index 39717506c678..908a7e144421 100644 --- a/trunk/drivers/isdn/hisax/ix1_micro.c +++ b/trunk/drivers/isdn/hisax/ix1_micro.c @@ -210,7 +210,7 @@ ix1_card_msg(struct IsdnCardState *cs, int mt, void *arg) } #ifdef __ISAPNP__ -static struct isapnp_device_id itk_ids[] __devinitdata = { +static struct isapnp_device_id itk_ids[] __initdata = { { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25), ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25), (unsigned long) "ITK micro 2" }, @@ -220,12 +220,12 @@ static struct isapnp_device_id itk_ids[] __devinitdata = { { 0, } }; -static struct isapnp_device_id *ipid __devinitdata = &itk_ids[0]; +static struct isapnp_device_id *ipid __initdata = &itk_ids[0]; static struct pnp_card *pnp_c __devinitdata = NULL; #endif -int __devinit +int __init setup_ix1micro(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/jade.c b/trunk/drivers/isdn/hisax/jade.c index 43d61d1bc5b6..2659fecc2674 100644 --- a/trunk/drivers/isdn/hisax/jade.c +++ b/trunk/drivers/isdn/hisax/jade.c @@ -19,7 +19,7 @@ #include -int +int __init JadeVersion(struct IsdnCardState *cs, char *s) { int ver,i; @@ -253,7 +253,7 @@ setstack_jade(struct PStack *st, struct BCState *bcs) return (0); } -void +void __init clear_pending_jade_ints(struct IsdnCardState *cs) { int val; @@ -279,7 +279,7 @@ clear_pending_jade_ints(struct IsdnCardState *cs) cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0xF8); } -void +void __init initjade(struct IsdnCardState *cs) { cs->bcs[0].BC_SetStack = setstack_jade; diff --git a/trunk/drivers/isdn/hisax/mic.c b/trunk/drivers/isdn/hisax/mic.c index 8c82519593a8..fe11f226b285 100644 --- a/trunk/drivers/isdn/hisax/mic.c +++ b/trunk/drivers/isdn/hisax/mic.c @@ -189,7 +189,7 @@ mic_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -int __devinit +int __init setup_mic(struct IsdnCard *card) { int bytecnt; diff --git a/trunk/drivers/isdn/hisax/netjet.c b/trunk/drivers/isdn/hisax/netjet.c index 38f648f9b0ed..47a47ef0968b 100644 --- a/trunk/drivers/isdn/hisax/netjet.c +++ b/trunk/drivers/isdn/hisax/netjet.c @@ -909,7 +909,7 @@ setstack_tiger(struct PStack *st, struct BCState *bcs) } -void +void __init inittiger(struct IsdnCardState *cs) { if (!(cs->bcs[0].hw.tiger.send = kmalloc(NETJET_DMA_TXSIZE * sizeof(unsigned int), diff --git a/trunk/drivers/isdn/hisax/niccy.c b/trunk/drivers/isdn/hisax/niccy.c index 489022bdef7b..79a97b1c3812 100644 --- a/trunk/drivers/isdn/hisax/niccy.c +++ b/trunk/drivers/isdn/hisax/niccy.c @@ -232,12 +232,12 @@ niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *niccy_dev __devinitdata = NULL; +static struct pci_dev *niccy_dev __initdata = NULL; #ifdef __ISAPNP__ static struct pnp_card *pnp_c __devinitdata = NULL; #endif -int __devinit +int __init setup_niccy(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/nj_s.c b/trunk/drivers/isdn/hisax/nj_s.c index 80025fd890f4..e5b900a6fa0b 100644 --- a/trunk/drivers/isdn/hisax/nj_s.c +++ b/trunk/drivers/isdn/hisax/nj_s.c @@ -148,9 +148,9 @@ NETjet_S_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *dev_netjet __devinitdata = NULL; +static struct pci_dev *dev_netjet __initdata = NULL; -int __devinit +int __init setup_netjet_s(struct IsdnCard *card) { int bytecnt,cfg; diff --git a/trunk/drivers/isdn/hisax/nj_u.c b/trunk/drivers/isdn/hisax/nj_u.c index 37497162d539..7002b09936d4 100644 --- a/trunk/drivers/isdn/hisax/nj_u.c +++ b/trunk/drivers/isdn/hisax/nj_u.c @@ -128,9 +128,9 @@ NETjet_U_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *dev_netjet __devinitdata = NULL; +static struct pci_dev *dev_netjet __initdata = NULL; -int __devinit +int __init setup_netjet_u(struct IsdnCard *card) { int bytecnt; diff --git a/trunk/drivers/isdn/hisax/s0box.c b/trunk/drivers/isdn/hisax/s0box.c index e76042d323ea..7b63085ea6e5 100644 --- a/trunk/drivers/isdn/hisax/s0box.c +++ b/trunk/drivers/isdn/hisax/s0box.c @@ -211,7 +211,7 @@ S0Box_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -int __devinit +int __init setup_s0box(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/saphir.c b/trunk/drivers/isdn/hisax/saphir.c index d943d365890b..821776e1561a 100644 --- a/trunk/drivers/isdn/hisax/saphir.c +++ b/trunk/drivers/isdn/hisax/saphir.c @@ -241,7 +241,7 @@ saphir_card_msg(struct IsdnCardState *cs, int mt, void *arg) } -int __devinit +int __init setup_saphir(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/sportster.c b/trunk/drivers/isdn/hisax/sportster.c index a49b694eb730..cdf35dc564c4 100644 --- a/trunk/drivers/isdn/hisax/sportster.c +++ b/trunk/drivers/isdn/hisax/sportster.c @@ -184,7 +184,7 @@ Sportster_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static int __devinit +static int __init get_io_range(struct IsdnCardState *cs) { int i, j, adr; @@ -209,7 +209,7 @@ get_io_range(struct IsdnCardState *cs) } } -int __devinit +int __init setup_sportster(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/teleint.c b/trunk/drivers/isdn/hisax/teleint.c index e94dc6f5bd62..a2b1816af37a 100644 --- a/trunk/drivers/isdn/hisax/teleint.c +++ b/trunk/drivers/isdn/hisax/teleint.c @@ -261,7 +261,7 @@ TeleInt_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -int __devinit +int __init setup_TeleInt(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/teles0.c b/trunk/drivers/isdn/hisax/teles0.c index f94af0930a17..2b7df8f98233 100644 --- a/trunk/drivers/isdn/hisax/teles0.c +++ b/trunk/drivers/isdn/hisax/teles0.c @@ -265,7 +265,7 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -int __devinit +int __init setup_teles0(struct IsdnCard *card) { u_char val; diff --git a/trunk/drivers/isdn/hisax/telespci.c b/trunk/drivers/isdn/hisax/telespci.c index dca446865f24..9382cdf04d8d 100644 --- a/trunk/drivers/isdn/hisax/telespci.c +++ b/trunk/drivers/isdn/hisax/telespci.c @@ -284,9 +284,9 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *dev_tel __devinitdata = NULL; +static struct pci_dev *dev_tel __initdata = NULL; -int __devinit +int __init setup_telespci(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/hisax/w6692.c b/trunk/drivers/isdn/hisax/w6692.c index 0595293b8659..6c68419c05ff 100644 --- a/trunk/drivers/isdn/hisax/w6692.c +++ b/trunk/drivers/isdn/hisax/w6692.c @@ -44,11 +44,11 @@ static const char *w6692_revision = "$Revision: 1.18.2.4 $"; #define DBUSY_TIMER_VALUE 80 -static char *W6692Ver[] = +static char *W6692Ver[] __initdata = {"W6692 V00", "W6692 V01", "W6692 V10", "W6692 V11"}; -static void +static void __init W6692Version(struct IsdnCardState *cs, char *s) { int val; @@ -897,7 +897,7 @@ static void resetW6692(struct IsdnCardState *cs) } } -static void initW6692(struct IsdnCardState *cs, int part) +static void __init initW6692(struct IsdnCardState *cs, int part) { if (part & 1) { cs->setstack_d = setstack_W6692; @@ -992,9 +992,9 @@ w6692_card_msg(struct IsdnCardState *cs, int mt, void *arg) static int id_idx ; -static struct pci_dev *dev_w6692 __devinitdata = NULL; +static struct pci_dev *dev_w6692 __initdata = NULL; -int __devinit +int __init setup_w6692(struct IsdnCard *card) { struct IsdnCardState *cs = card->cs; diff --git a/trunk/drivers/isdn/i4l/isdn_common.c b/trunk/drivers/isdn/i4l/isdn_common.c index c3d79eef9e32..9f6c6375ff75 100644 --- a/trunk/drivers/isdn/i4l/isdn_common.c +++ b/trunk/drivers/isdn/i4l/isdn_common.c @@ -1059,7 +1059,7 @@ isdn_info_update(void) static ssize_t isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off) { - uint minor = iminor(file->f_dentry->d_inode); + uint minor = MINOR(file->f_dentry->d_inode->i_rdev); int len = 0; int drvidx; int chidx; @@ -1163,7 +1163,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off) static ssize_t isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off) { - uint minor = iminor(file->f_dentry->d_inode); + uint minor = MINOR(file->f_dentry->d_inode->i_rdev); int drvidx; int chidx; int retval; @@ -1225,7 +1225,7 @@ static unsigned int isdn_poll(struct file *file, poll_table * wait) { unsigned int mask = 0; - unsigned int minor = iminor(file->f_dentry->d_inode); + unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL); lock_kernel(); @@ -1266,7 +1266,7 @@ isdn_poll(struct file *file, poll_table * wait) static int isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) { - uint minor = iminor(inode); + uint minor = MINOR(inode->i_rdev); isdn_ctrl c; int drvidx; int chidx; @@ -1717,7 +1717,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) static int isdn_open(struct inode *ino, struct file *filep) { - uint minor = iminor(ino); + uint minor = MINOR(ino->i_rdev); int drvidx; int chidx; int retval = -ENODEV; @@ -1779,7 +1779,7 @@ isdn_open(struct inode *ino, struct file *filep) static int isdn_close(struct inode *ino, struct file *filep) { - uint minor = iminor(ino); + uint minor = MINOR(ino->i_rdev); lock_kernel(); if (minor == ISDN_MINOR_STATUS) { diff --git a/trunk/drivers/isdn/i4l/isdn_ppp.c b/trunk/drivers/isdn/i4l/isdn_ppp.c index 119412d6bd15..29e7667ec962 100644 --- a/trunk/drivers/isdn/i4l/isdn_ppp.c +++ b/trunk/drivers/isdn/i4l/isdn_ppp.c @@ -667,7 +667,7 @@ isdn_ppp_poll(struct file *file, poll_table * wait) if (is->debug & 0x2) printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n", - iminor(file->f_dentry->d_inode)); + MINOR(file->f_dentry->d_inode->i_rdev)); /* just registers wait_queue hook. This doesn't really wait. */ poll_wait(file, &is->wq, wait); diff --git a/trunk/drivers/leds/Kconfig b/trunk/drivers/leds/Kconfig index 9c39b98d5a5b..96509989e921 100644 --- a/trunk/drivers/leds/Kconfig +++ b/trunk/drivers/leds/Kconfig @@ -69,13 +69,6 @@ config LEDS_AMS_DELTA help This option enables support for the LEDs on Amstrad Delta (E3). -config LEDS_NET48XX - tristate "LED Support for Soekris net48xx series Error LED" - depends on LEDS_CLASS && SCx200_GPIO - help - This option enables support for the Soekris net4801 and net4826 error - LED. - comment "LED Triggers" config LEDS_TRIGGERS diff --git a/trunk/drivers/leds/Makefile b/trunk/drivers/leds/Makefile index 6aa2aed7539d..88d3b6eaa6a2 100644 --- a/trunk/drivers/leds/Makefile +++ b/trunk/drivers/leds/Makefile @@ -12,7 +12,6 @@ obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o -obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o # LED Triggers obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o diff --git a/trunk/drivers/leds/leds-net48xx.c b/trunk/drivers/leds/leds-net48xx.c deleted file mode 100644 index 35ee52f9b79e..000000000000 --- a/trunk/drivers/leds/leds-net48xx.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * LEDs driver for Soekris net48xx - * - * Copyright (C) 2006 Chris Boot - * - * Based on leds-ams-delta.c - * - * 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 -#include -#include -#include -#include -#include -#include - -#define NET48XX_ERROR_LED_GPIO 20 - -static struct platform_device *pdev; - -static void net48xx_error_led_set(struct led_classdev *led_cdev, - enum led_brightness value) -{ - if (value) - scx200_gpio_set_high(NET48XX_ERROR_LED_GPIO); - else - scx200_gpio_set_low(NET48XX_ERROR_LED_GPIO); -} - -static struct led_classdev net48xx_error_led = { - .name = "net48xx:error", - .brightness_set = net48xx_error_led_set, -}; - -#ifdef CONFIG_PM -static int net48xx_led_suspend(struct platform_device *dev, - pm_message_t state) -{ - led_classdev_suspend(&net48xx_error_led); - return 0; -} - -static int net48xx_led_resume(struct platform_device *dev) -{ - led_classdev_resume(&net48xx_error_led); - return 0; -} -#else -#define net48xx_led_suspend NULL -#define net48xx_led_resume NULL -#endif - -static int net48xx_led_probe(struct platform_device *pdev) -{ - return led_classdev_register(&pdev->dev, &net48xx_error_led); -} - -static int net48xx_led_remove(struct platform_device *pdev) -{ - led_classdev_unregister(&net48xx_error_led); - return 0; -} - -static struct platform_driver net48xx_led_driver = { - .driver.owner = THIS_MODULE, - .probe = net48xx_led_probe, - .remove = net48xx_led_remove, - .suspend = net48xx_led_suspend, - .resume = net48xx_led_resume, - .driver = { - .name = "net48xx-led", - }, -}; - -static int __init net48xx_led_init(void) -{ - int ret; - - if (!scx200_gpio_present()) { - ret = -ENODEV; - goto out; - } - - ret = platform_driver_register(&net48xx_led_driver); - if (ret < 0) - goto out; - - pdev = platform_device_register_simple("net48xx-led", -1, NULL, 0); - if (IS_ERR(pdev)) { - ret = PTR_ERR(pdev); - platform_driver_unregister(&net48xx_led_driver); - goto out; - } - -out: - return ret; -} - -static void __exit net48xx_led_exit(void) -{ - platform_device_unregister(pdev); - platform_driver_unregister(&net48xx_led_driver); -} - -module_init(net48xx_led_init); -module_exit(net48xx_led_exit); - -MODULE_AUTHOR("Chris Boot "); -MODULE_DESCRIPTION("Soekris net48xx LED driver"); -MODULE_LICENSE("GPL"); - diff --git a/trunk/drivers/macintosh/Kconfig b/trunk/drivers/macintosh/Kconfig index f5fe7fb4b3ad..54f3f6b94efc 100644 --- a/trunk/drivers/macintosh/Kconfig +++ b/trunk/drivers/macintosh/Kconfig @@ -113,10 +113,7 @@ config PMAC_MEDIABAY 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 + depends on ADB_PMU && (BROKEN || !PPC64) help Say Y here to enable Macintosh specific extensions of the generic backlight code. With this enabled, the brightness keys on older diff --git a/trunk/drivers/macintosh/macio_asic.c b/trunk/drivers/macintosh/macio_asic.c index 82657bc86d19..80c0c665b5f6 100644 --- a/trunk/drivers/macintosh/macio_asic.c +++ b/trunk/drivers/macintosh/macio_asic.c @@ -330,7 +330,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index, { unsigned int irq; - irq = irq_create_mapping(NULL, line); + irq = irq_create_mapping(NULL, line, 0); if (irq != NO_IRQ) { dev->interrupt[index].start = irq; dev->interrupt[index].flags = IORESOURCE_IRQ; diff --git a/trunk/drivers/macintosh/smu.c b/trunk/drivers/macintosh/smu.c index 00ef46898147..f139a74696fe 100644 --- a/trunk/drivers/macintosh/smu.c +++ b/trunk/drivers/macintosh/smu.c @@ -75,11 +75,9 @@ struct smu_device { struct of_device *of_dev; int doorbell; /* doorbell gpio */ u32 __iomem *db_buf; /* doorbell buffer */ - struct device_node *db_node; - unsigned int db_irq; + int db_irq; int msg; - struct device_node *msg_node; - unsigned int msg_irq; + int msg_irq; struct smu_cmd_buf *cmd_buf; /* command buffer virtual */ u32 cmd_buf_abs; /* command buffer absolute */ struct list_head cmd_list; @@ -95,7 +93,6 @@ struct smu_device { */ static struct smu_device *smu; static DEFINE_MUTEX(smu_part_access); -static int smu_irq_inited; static void smu_i2c_retry(unsigned long data); @@ -260,10 +257,6 @@ int smu_queue_cmd(struct smu_cmd *cmd) smu_start_cmd(); spin_unlock_irqrestore(&smu->lock, flags); - /* Workaround for early calls when irq isn't available */ - if (!smu_irq_inited || smu->db_irq == NO_IRQ) - smu_spinwait_cmd(cmd); - return 0; } EXPORT_SYMBOL(smu_queue_cmd); @@ -485,15 +478,14 @@ int __init smu_init (void) smu->cmd_buf_abs = (u32)smu_cmdbuf_abs; smu->cmd_buf = (struct smu_cmd_buf *)abs_to_virt(smu_cmdbuf_abs); - smu->db_node = of_find_node_by_name(NULL, "smu-doorbell"); - if (smu->db_node == NULL) { + np = of_find_node_by_name(NULL, "smu-doorbell"); + if (np == NULL) { printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n"); goto fail; } - data = (u32 *)get_property(smu->db_node, "reg", NULL); + data = (u32 *)get_property(np, "reg", NULL); if (data == NULL) { - of_node_put(smu->db_node); - smu->db_node = NULL; + of_node_put(np); printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n"); goto fail; } @@ -505,21 +497,25 @@ int __init smu_init (void) smu->doorbell = *data; if (smu->doorbell < 0x50) smu->doorbell += 0x50; + smu->db_irq = irq_of_parse_and_map(np, 0); + + of_node_put(np); /* Now look for the smu-interrupt GPIO */ do { - smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt"); - if (smu->msg_node == NULL) + np = of_find_node_by_name(NULL, "smu-interrupt"); + if (np == NULL) break; - data = (u32 *)get_property(smu->msg_node, "reg", NULL); + data = (u32 *)get_property(np, "reg", NULL); if (data == NULL) { - of_node_put(smu->msg_node); - smu->msg_node = NULL; + of_node_put(np); break; } smu->msg = *data; if (smu->msg < 0x50) smu->msg += 0x50; + smu->msg_irq = irq_of_parse_and_map(np, 0); + of_node_put(np); } while(0); /* Doorbell buffer is currently hard-coded, I didn't find a proper @@ -551,19 +547,6 @@ static int smu_late_init(void) smu->i2c_timer.function = smu_i2c_retry; smu->i2c_timer.data = (unsigned long)smu; - if (smu->db_node) { - smu->db_irq = irq_of_parse_and_map(smu->db_node, 0); - if (smu->db_irq == NO_IRQ) - printk(KERN_ERR "smu: failed to map irq for node %s\n", - smu->db_node->full_name); - } - if (smu->msg_node) { - smu->msg_irq = irq_of_parse_and_map(smu->msg_node, 0); - if (smu->msg_irq == NO_IRQ) - printk(KERN_ERR "smu: failed to map irq for node %s\n", - smu->msg_node->full_name); - } - /* * Try to request the interrupts */ @@ -588,7 +571,6 @@ static int smu_late_init(void) } } - smu_irq_inited = 1; return 0; } /* This has to be before arch_initcall as the low i2c stuff relies on the @@ -760,11 +742,6 @@ static void smu_i2c_low_completion(struct smu_cmd *scmd, void *misc) if (fail && --cmd->retries > 0) { DPRINTK("SMU: i2c failure, starting timer...\n"); BUG_ON(cmd != smu->cmd_i2c_cur); - if (!smu_irq_inited) { - mdelay(5); - smu_i2c_retry(0); - return; - } mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5)); return; } diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index b6d16022a53e..e4e161372a3e 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -110,7 +110,7 @@ static ctl_table raid_table[] = { .procname = "speed_limit_min", .data = &sysctl_speed_limit_min, .maxlen = sizeof(int), - .mode = S_IRUGO|S_IWUSR, + .mode = 0644, .proc_handler = &proc_dointvec, }, { @@ -118,7 +118,7 @@ static ctl_table raid_table[] = { .procname = "speed_limit_max", .data = &sysctl_speed_limit_max, .maxlen = sizeof(int), - .mode = S_IRUGO|S_IWUSR, + .mode = 0644, .proc_handler = &proc_dointvec, }, { .ctl_name = 0 } @@ -129,7 +129,7 @@ static ctl_table raid_dir_table[] = { .ctl_name = DEV_RAID, .procname = "raid", .maxlen = 0, - .mode = S_IRUGO|S_IXUGO, + .mode = 0555, .child = raid_table, }, { .ctl_name = 0 } @@ -1062,11 +1062,6 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) if (rdev->sb_size & bmask) rdev-> sb_size = (rdev->sb_size | bmask)+1; - if (sb->level == cpu_to_le32(LEVEL_MULTIPATH)) - rdev->desc_nr = -1; - else - rdev->desc_nr = le32_to_cpu(sb->dev_number); - if (refdev == 0) ret = 1; else { @@ -1176,6 +1171,7 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev) } if (mddev->level != LEVEL_MULTIPATH) { int role; + rdev->desc_nr = le32_to_cpu(sb->dev_number); role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]); switch(role) { case 0xffff: /* spare */ @@ -1783,8 +1779,8 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) } return err ? err : len; } -static struct rdev_sysfs_entry rdev_state = -__ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); +static struct rdev_sysfs_entry +rdev_state = __ATTR(state, 0644, state_show, state_store); static ssize_t super_show(mdk_rdev_t *rdev, char *page) @@ -1815,7 +1811,7 @@ errors_store(mdk_rdev_t *rdev, const char *buf, size_t len) return -EINVAL; } static struct rdev_sysfs_entry rdev_errors = -__ATTR(errors, S_IRUGO|S_IWUSR, errors_show, errors_store); +__ATTR(errors, 0644, errors_show, errors_store); static ssize_t slot_show(mdk_rdev_t *rdev, char *page) @@ -1849,7 +1845,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) static struct rdev_sysfs_entry rdev_slot = -__ATTR(slot, S_IRUGO|S_IWUSR, slot_show, slot_store); +__ATTR(slot, 0644, slot_show, slot_store); static ssize_t offset_show(mdk_rdev_t *rdev, char *page) @@ -1871,7 +1867,7 @@ offset_store(mdk_rdev_t *rdev, const char *buf, size_t len) } static struct rdev_sysfs_entry rdev_offset = -__ATTR(offset, S_IRUGO|S_IWUSR, offset_show, offset_store); +__ATTR(offset, 0644, offset_show, offset_store); static ssize_t rdev_size_show(mdk_rdev_t *rdev, char *page) @@ -1895,7 +1891,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len) } static struct rdev_sysfs_entry rdev_size = -__ATTR(size, S_IRUGO|S_IWUSR, rdev_size_show, rdev_size_store); +__ATTR(size, 0644, rdev_size_show, rdev_size_store); static struct attribute *rdev_default_attrs[] = { &rdev_state.attr, @@ -1926,8 +1922,6 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr, if (!entry->store) return -EIO; - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; return entry->store(rdev, page, length); } @@ -2134,7 +2128,7 @@ safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len) return len; } static struct md_sysfs_entry md_safe_delay = -__ATTR(safe_mode_delay, S_IRUGO|S_IWUSR,safe_delay_show, safe_delay_store); +__ATTR(safe_mode_delay, 0644,safe_delay_show, safe_delay_store); static ssize_t level_show(mddev_t *mddev, char *page) @@ -2169,7 +2163,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len) } static struct md_sysfs_entry md_level = -__ATTR(level, S_IRUGO|S_IWUSR, level_show, level_store); +__ATTR(level, 0644, level_show, level_store); static ssize_t @@ -2194,7 +2188,7 @@ layout_store(mddev_t *mddev, const char *buf, size_t len) return len; } static struct md_sysfs_entry md_layout = -__ATTR(layout, S_IRUGO|S_IWUSR, layout_show, layout_store); +__ATTR(layout, 0655, layout_show, layout_store); static ssize_t @@ -2225,7 +2219,7 @@ raid_disks_store(mddev_t *mddev, const char *buf, size_t len) return rv ? rv : len; } static struct md_sysfs_entry md_raid_disks = -__ATTR(raid_disks, S_IRUGO|S_IWUSR, raid_disks_show, raid_disks_store); +__ATTR(raid_disks, 0644, raid_disks_show, raid_disks_store); static ssize_t chunk_size_show(mddev_t *mddev, char *page) @@ -2249,7 +2243,7 @@ chunk_size_store(mddev_t *mddev, const char *buf, size_t len) return len; } static struct md_sysfs_entry md_chunk_size = -__ATTR(chunk_size, S_IRUGO|S_IWUSR, chunk_size_show, chunk_size_store); +__ATTR(chunk_size, 0644, chunk_size_show, chunk_size_store); static ssize_t resync_start_show(mddev_t *mddev, char *page) @@ -2273,7 +2267,7 @@ resync_start_store(mddev_t *mddev, const char *buf, size_t len) return len; } static struct md_sysfs_entry md_resync_start = -__ATTR(resync_start, S_IRUGO|S_IWUSR, resync_start_show, resync_start_store); +__ATTR(resync_start, 0644, resync_start_show, resync_start_store); /* * The array state can be: @@ -2443,8 +2437,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) else return len; } -static struct md_sysfs_entry md_array_state = -__ATTR(array_state, S_IRUGO|S_IWUSR, array_state_show, array_state_store); +static struct md_sysfs_entry md_array_state = __ATTR(array_state, 0644, array_state_show, array_state_store); static ssize_t null_show(mddev_t *mddev, char *page) @@ -2504,7 +2497,7 @@ new_dev_store(mddev_t *mddev, const char *buf, size_t len) } static struct md_sysfs_entry md_new_device = -__ATTR(new_dev, S_IWUSR, null_show, new_dev_store); +__ATTR(new_dev, 0200, null_show, new_dev_store); static ssize_t size_show(mddev_t *mddev, char *page) @@ -2542,7 +2535,7 @@ size_store(mddev_t *mddev, const char *buf, size_t len) } static struct md_sysfs_entry md_size = -__ATTR(component_size, S_IRUGO|S_IWUSR, size_show, size_store); +__ATTR(component_size, 0644, size_show, size_store); /* Metdata version. @@ -2590,7 +2583,7 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len) } static struct md_sysfs_entry md_metadata = -__ATTR(metadata_version, S_IRUGO|S_IWUSR, metadata_show, metadata_store); +__ATTR(metadata_version, 0644, metadata_show, metadata_store); static ssize_t action_show(mddev_t *mddev, char *page) @@ -2658,11 +2651,12 @@ mismatch_cnt_show(mddev_t *mddev, char *page) (unsigned long long) mddev->resync_mismatches); } -static struct md_sysfs_entry md_scan_mode = -__ATTR(sync_action, S_IRUGO|S_IWUSR, action_show, action_store); +static struct md_sysfs_entry +md_scan_mode = __ATTR(sync_action, S_IRUGO|S_IWUSR, action_show, action_store); -static struct md_sysfs_entry md_mismatches = __ATTR_RO(mismatch_cnt); +static struct md_sysfs_entry +md_mismatches = __ATTR_RO(mismatch_cnt); static ssize_t sync_min_show(mddev_t *mddev, char *page) @@ -2721,14 +2715,15 @@ static ssize_t sync_speed_show(mddev_t *mddev, char *page) { unsigned long resync, dt, db; - resync = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active)); + resync = (mddev->curr_resync - atomic_read(&mddev->recovery_active)); dt = ((jiffies - mddev->resync_mark) / HZ); if (!dt) dt++; db = resync - (mddev->resync_mark_cnt); return sprintf(page, "%ld\n", db/dt/2); /* K/sec */ } -static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed); +static struct md_sysfs_entry +md_sync_speed = __ATTR_RO(sync_speed); static ssize_t sync_completed_show(mddev_t *mddev, char *page) @@ -2744,7 +2739,8 @@ sync_completed_show(mddev_t *mddev, char *page) return sprintf(page, "%lu / %lu\n", resync, max_blocks); } -static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed); +static struct md_sysfs_entry +md_sync_completed = __ATTR_RO(sync_completed); static ssize_t suspend_lo_show(mddev_t *mddev, char *page) @@ -2861,8 +2857,6 @@ md_attr_store(struct kobject *kobj, struct attribute *attr, if (!entry->store) return -EIO; - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; rv = mddev_lock(mddev); if (!rv) { rv = entry->store(mddev, page, length); @@ -3097,6 +3091,7 @@ static int do_md_run(mddev_t * mddev) } set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); + md_wakeup_thread(mddev->thread); if (mddev->sb_dirty) md_update_sb(mddev); @@ -3117,7 +3112,7 @@ static int do_md_run(mddev_t * mddev) * start recovery here. If we leave it to md_check_recovery, * it will remove the drives and not do the right thing */ - if (mddev->degraded && !mddev->sync_thread) { + if (mddev->degraded) { struct list_head *rtmp; int spares = 0; ITERATE_RDEV(mddev,rdev,rtmp) @@ -3138,11 +3133,10 @@ static int do_md_run(mddev_t * mddev) mdname(mddev)); /* leave the spares where they are, it shouldn't hurt */ mddev->recovery = 0; - } + } else + md_wakeup_thread(mddev->sync_thread); } } - md_wakeup_thread(mddev->thread); - md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */ mddev->changed = 1; md_new_event(mddev); @@ -4592,8 +4586,6 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev) __builtin_return_address(0),__builtin_return_address(1), __builtin_return_address(2),__builtin_return_address(3)); */ - if (!mddev->pers) - return; if (!mddev->pers->error_handler) return; mddev->pers->error_handler(mddev,rdev); @@ -4691,13 +4683,12 @@ static void status_resync(struct seq_file *seq, mddev_t * mddev) */ dt = ((jiffies - mddev->resync_mark) / HZ); if (!dt) dt++; - db = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active)) - - mddev->resync_mark_cnt; - rt = (dt * ((unsigned long)(max_blocks-resync) / (db/2/100+1)))/100; + db = resync - (mddev->resync_mark_cnt/2); + rt = (dt * ((unsigned long)(max_blocks-resync) / (db/100+1)))/100; seq_printf(seq, " finish=%lu.%lumin", rt / 60, (rt % 60)/6); - seq_printf(seq, " speed=%ldK/sec", db/2/dt); + seq_printf(seq, " speed=%ldK/sec", db/dt); } static void *md_seq_start(struct seq_file *seq, loff_t *pos) @@ -5208,7 +5199,6 @@ void md_do_sync(mddev_t *mddev) j += sectors; if (j>1) mddev->curr_resync = j; - mddev->curr_mark_cnt = io_sectors; if (last_check == 0) /* this is the earliers that rebuilt will be * visible in /proc/mdstat @@ -5655,8 +5645,8 @@ static int set_ro(const char *val, struct kernel_param *kp) return -EINVAL; } -module_param_call(start_ro, set_ro, get_ro, NULL, S_IRUSR|S_IWUSR); -module_param(start_dirty_degraded, int, S_IRUGO|S_IWUSR); +module_param_call(start_ro, set_ro, get_ro, NULL, 0600); +module_param(start_dirty_degraded, int, 0644); EXPORT_SYMBOL(register_md_personality); diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index 1efe22a2d041..cead918578a7 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -1145,7 +1145,7 @@ static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error) long sectors_to_go = r1_bio->sectors; /* make sure these bits doesn't get cleared. */ do { - bitmap_end_sync(mddev->bitmap, s, + bitmap_end_sync(mddev->bitmap, r1_bio->sector, &sync_blocks, 1); s += sync_blocks; sectors_to_go -= sync_blocks; @@ -1509,9 +1509,6 @@ static void raid1d(mddev_t *mddev) s<<9, conf->tmppage, READ) == 0) /* Well, this device is dead */ md_error(mddev, rdev); - else - printk(KERN_INFO "raid1:%s: read error corrected (%d sectors at %llu on %s)\n", - mdname(mddev), s, (unsigned long long)(sect + rdev->data_offset), bdevname(rdev->bdev, b)); } } } else { diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index 016ddb831c9b..7f636283a1ba 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -1492,10 +1492,6 @@ static void raid10d(mddev_t *mddev) s<<9, conf->tmppage, READ) == 0) /* Well, this device is dead */ md_error(mddev, rdev); - else - printk(KERN_INFO "raid10:%s: read error corrected (%d sectors at %llu on %s)\n", - mdname(mddev), s, (unsigned long long)(sect+rdev->data_offset), bdevname(rdev->bdev, b)); - rdev_dec_pending(rdev, mddev); rcu_read_lock(); } diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 450066007160..7433871f4b3a 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -18,30 +18,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* - * BITMAP UNPLUGGING: - * - * The sequencing for updating the bitmap reliably is a little - * subtle (and I got it wrong the first time) so it deserves some - * explanation. - * - * We group bitmap updates into batches. Each batch has a number. - * We may write out several batches at once, but that isn't very important. - * conf->bm_write is the number of the last batch successfully written. - * conf->bm_flush is the number of the last batch that was closed to - * new additions. - * When we discover that we will need to write to any block in a stripe - * (in add_stripe_bio) we update the in-memory bitmap and record in sh->bm_seq - * the number of the batch it will be in. This is bm_flush+1. - * When we are ready to do a write, if that batch hasn't been written yet, - * we plug the array and queue the stripe for later. - * When an unplug happens, we increment bm_flush, thus closing the current - * batch. - * When we notice that bm_flush > bm_write, we write out all pending updates - * to the bitmap, and advance bm_write to where bm_flush was. - * This may occasionally write a bit out twice, but is sure never to - * miss any bits. - */ #include #include @@ -112,14 +88,12 @@ static void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh) BUG_ON(!list_empty(&sh->lru)); BUG_ON(atomic_read(&conf->active_stripes)==0); if (test_bit(STRIPE_HANDLE, &sh->state)) { - if (test_bit(STRIPE_DELAYED, &sh->state)) { + if (test_bit(STRIPE_DELAYED, &sh->state)) list_add_tail(&sh->lru, &conf->delayed_list); - blk_plug_device(conf->mddev->queue); - } else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && - sh->bm_seq - conf->seq_write > 0) { + else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && + conf->seq_write == sh->bm_seq) list_add_tail(&sh->lru, &conf->bitmap_list); - blk_plug_device(conf->mddev->queue); - } else { + else { clear_bit(STRIPE_BIT_DELAY, &sh->state); list_add_tail(&sh->lru, &conf->handle_list); } @@ -296,7 +270,7 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector < (conf->max_nr_stripes *3/4) || !conf->inactive_blocked), conf->device_lock, - raid5_unplug_device(conf->mddev->queue) + unplug_slaves(conf->mddev) ); conf->inactive_blocked = 0; } else @@ -307,8 +281,7 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector } else { if (!test_bit(STRIPE_HANDLE, &sh->state)) atomic_inc(&conf->active_stripes); - if (list_empty(&sh->lru) && - !test_bit(STRIPE_EXPANDING, &sh->state)) + if (list_empty(&sh->lru)) BUG(); list_del_init(&sh->lru); } @@ -523,8 +496,6 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, raid5_conf_t *conf = sh->raid_conf; int disks = sh->disks, i; int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); - char b[BDEVNAME_SIZE]; - mdk_rdev_t *rdev; if (bi->bi_size) return 1; @@ -572,39 +543,25 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, set_bit(R5_UPTODATE, &sh->dev[i].flags); #endif if (test_bit(R5_ReadError, &sh->dev[i].flags)) { - rdev = conf->disks[i].rdev; - printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n", - mdname(conf->mddev), STRIPE_SECTORS, - (unsigned long long)sh->sector + rdev->data_offset, - bdevname(rdev->bdev, b)); + printk(KERN_INFO "raid5: read error corrected!!\n"); clear_bit(R5_ReadError, &sh->dev[i].flags); clear_bit(R5_ReWrite, &sh->dev[i].flags); } if (atomic_read(&conf->disks[i].rdev->read_errors)) atomic_set(&conf->disks[i].rdev->read_errors, 0); } else { - const char *bdn = bdevname(conf->disks[i].rdev->bdev, b); int retry = 0; - rdev = conf->disks[i].rdev; - clear_bit(R5_UPTODATE, &sh->dev[i].flags); - atomic_inc(&rdev->read_errors); + atomic_inc(&conf->disks[i].rdev->read_errors); if (conf->mddev->degraded) - printk(KERN_WARNING "raid5:%s: read error not correctable (sector %llu on %s).\n", - mdname(conf->mddev), - (unsigned long long)sh->sector + rdev->data_offset, - bdn); + printk(KERN_WARNING "raid5: read error not correctable.\n"); else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) /* Oh, no!!! */ - printk(KERN_WARNING "raid5:%s: read error NOT corrected!! (sector %llu on %s).\n", - mdname(conf->mddev), - (unsigned long long)sh->sector + rdev->data_offset, - bdn); - else if (atomic_read(&rdev->read_errors) + printk(KERN_WARNING "raid5: read error NOT corrected!!\n"); + else if (atomic_read(&conf->disks[i].rdev->read_errors) > conf->max_nr_stripes) printk(KERN_WARNING - "raid5:%s: Too many read errors, failing device %s.\n", - mdname(conf->mddev), bdn); + "raid5: Too many read errors, failing device.\n"); else retry = 1; if (retry) @@ -612,7 +569,7 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, else { clear_bit(R5_ReadError, &sh->dev[i].flags); clear_bit(R5_ReWrite, &sh->dev[i].flags); - md_error(conf->mddev, rdev); + md_error(conf->mddev, conf->disks[i].rdev); } } rdev_dec_pending(conf->disks[i].rdev, conf->mddev); @@ -1313,9 +1270,9 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, in (unsigned long long)sh->sector, dd_idx); if (conf->mddev->bitmap && firstwrite) { + sh->bm_seq = conf->seq_write; bitmap_startwrite(conf->mddev->bitmap, sh->sector, STRIPE_SECTORS, 0); - sh->bm_seq = conf->seq_flush+1; set_bit(STRIPE_BIT_DELAY, &sh->state); } @@ -2597,6 +2554,13 @@ static int raid5_issue_flush(request_queue_t *q, struct gendisk *disk, return ret; } +static inline void raid5_plug_device(raid5_conf_t *conf) +{ + spin_lock_irq(&conf->device_lock); + blk_plug_device(conf->mddev->queue); + spin_unlock_irq(&conf->device_lock); +} + static int make_request(request_queue_t *q, struct bio * bi) { mddev_t *mddev = q->queuedata; @@ -2706,6 +2670,7 @@ static int make_request(request_queue_t *q, struct bio * bi) goto retry; } finish_wait(&conf->wait_for_overlap, &w); + raid5_plug_device(conf); handle_stripe(sh, NULL); release_stripe(sh); } else { @@ -2958,7 +2923,7 @@ static void raid5d (mddev_t *mddev) while (1) { struct list_head *first; - if (conf->seq_flush != conf->seq_write) { + if (conf->seq_flush - conf->seq_write > 0) { int seq = conf->seq_flush; spin_unlock_irq(&conf->device_lock); bitmap_unplug(mddev->bitmap); @@ -3281,6 +3246,9 @@ static int run(mddev_t *mddev) set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); mddev->sync_thread = md_register_thread(md_do_sync, mddev, "%s_reshape"); + /* FIXME if md_register_thread fails?? */ + md_wakeup_thread(mddev->sync_thread); + } /* read-ahead size must cover two whole stripes, which is diff --git a/trunk/drivers/media/dvb/frontends/nxt200x.c b/trunk/drivers/media/dvb/frontends/nxt200x.c index 87c286ee6a00..55671cb5255e 100644 --- a/trunk/drivers/media/dvb/frontends/nxt200x.c +++ b/trunk/drivers/media/dvb/frontends/nxt200x.c @@ -896,9 +896,9 @@ static int nxt2002_init(struct dvb_frontend* fe) } ret = nxt2002_load_firmware(fe, fw); - release_firmware(fw); if (ret) { printk("nxt2002: Writing firmware to device failed\n"); + release_firmware(fw); return ret; } printk("nxt2002: Firmware upload complete\n"); @@ -960,9 +960,9 @@ static int nxt2004_init(struct dvb_frontend* fe) } ret = nxt2004_load_firmware(fe, fw); - release_firmware(fw); if (ret) { printk("nxt2004: Writing firmware to device failed\n"); + release_firmware(fw); return ret; } printk("nxt2004: Firmware upload complete\n"); diff --git a/trunk/drivers/media/dvb/frontends/or51211.c b/trunk/drivers/media/dvb/frontends/or51211.c index 2bf124b53689..26bed616fabe 100644 --- a/trunk/drivers/media/dvb/frontends/or51211.c +++ b/trunk/drivers/media/dvb/frontends/or51211.c @@ -437,10 +437,10 @@ static int or51211_init(struct dvb_frontend* fe) } ret = or51211_load_firmware(fe, fw); - release_firmware(fw); if (ret) { printk(KERN_WARNING "or51211: Writing firmware to " "device failed!\n"); + release_firmware(fw); return ret; } printk(KERN_INFO "or51211: Firmware upload complete.\n"); diff --git a/trunk/drivers/media/dvb/frontends/sp8870.c b/trunk/drivers/media/dvb/frontends/sp8870.c index d98fd5c2e13e..44ec5b9a4695 100644 --- a/trunk/drivers/media/dvb/frontends/sp8870.c +++ b/trunk/drivers/media/dvb/frontends/sp8870.c @@ -318,6 +318,7 @@ static int sp8870_init (struct dvb_frontend* fe) printk("sp8870: waiting for firmware upload (%s)...\n", SP8870_DEFAULT_FIRMWARE); if (state->config->request_firmware(fe, &fw, SP8870_DEFAULT_FIRMWARE)) { printk("sp8870: no firmware upload (timeout or file not found?)\n"); + release_firmware(fw); return -EIO; } @@ -326,7 +327,6 @@ static int sp8870_init (struct dvb_frontend* fe) release_firmware(fw); return -EIO; } - release_firmware(fw); printk("sp8870: firmware upload complete\n"); /* enable TS output and interface pins */ diff --git a/trunk/drivers/media/dvb/frontends/sp887x.c b/trunk/drivers/media/dvb/frontends/sp887x.c index 5c2f8f4e0ae5..b0a2b02f6608 100644 --- a/trunk/drivers/media/dvb/frontends/sp887x.c +++ b/trunk/drivers/media/dvb/frontends/sp887x.c @@ -520,9 +520,9 @@ static int sp887x_init(struct dvb_frontend* fe) } ret = sp887x_initial_setup(fe, fw); - release_firmware(fw); if (ret) { printk("sp887x: writing firmware to device failed\n"); + release_firmware(fw); return ret; } printk("sp887x: firmware upload complete\n"); diff --git a/trunk/drivers/media/video/cx88/cx88-blackbird.c b/trunk/drivers/media/video/cx88/cx88-blackbird.c index b60177f173c3..349632b48e93 100644 --- a/trunk/drivers/media/video/cx88/cx88-blackbird.c +++ b/trunk/drivers/media/video/cx88/cx88-blackbird.c @@ -453,13 +453,11 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) { dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected %d)\n", firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE); - release_firmware(firmware); return -1; } if (0 != memcmp(firmware->data, magic, 8)) { dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n"); - release_firmware(firmware); return -1; } @@ -480,7 +478,6 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) } if (checksum) { dprintk(0, "ERROR: Firmware load failed (checksum mismatch).\n"); - release_firmware(firmware); return -1; } release_firmware(firmware); diff --git a/trunk/drivers/message/i2o/core.h b/trunk/drivers/message/i2o/core.h index dc388a3ff5e0..184974cc734d 100644 --- a/trunk/drivers/message/i2o/core.h +++ b/trunk/drivers/message/i2o/core.h @@ -38,9 +38,6 @@ extern struct device_attribute i2o_device_attrs[]; extern void i2o_device_remove(struct i2o_device *); extern int i2o_device_parse_lct(struct i2o_controller *); -int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist, - int oplen, void *reslist, int reslen); - /* IOP */ extern struct i2o_controller *i2o_iop_alloc(void); diff --git a/trunk/drivers/message/i2o/i2o_config.c b/trunk/drivers/message/i2o/i2o_config.c index 7d23e082bf26..89daf67b764d 100644 --- a/trunk/drivers/message/i2o/i2o_config.c +++ b/trunk/drivers/message/i2o/i2o_config.c @@ -36,10 +36,10 @@ #include -#include "core.h" - #define SG_TABLESIZE 30 +extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); + static int i2o_cfg_ioctl(struct inode *, struct file *, unsigned int, unsigned long); diff --git a/trunk/drivers/mfd/ucb1x00-core.c b/trunk/drivers/mfd/ucb1x00-core.c index 2bf32721eb53..632bc218c86a 100644 --- a/trunk/drivers/mfd/ucb1x00-core.c +++ b/trunk/drivers/mfd/ucb1x00-core.c @@ -479,7 +479,7 @@ static int ucb1x00_probe(struct mcp *mcp) mcp_enable(mcp); id = mcp_reg_read(mcp, UCB_ID); - if (id != UCB_ID_1200 && id != UCB_ID_1300 && id != UCB_ID_TC35143) { + if (id != UCB_ID_1200 && id != UCB_ID_1300) { printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id); goto err_disable; } diff --git a/trunk/drivers/mfd/ucb1x00.h b/trunk/drivers/mfd/ucb1x00.h index ca8df8072d43..9c9a647d8b7b 100644 --- a/trunk/drivers/mfd/ucb1x00.h +++ b/trunk/drivers/mfd/ucb1x00.h @@ -94,7 +94,6 @@ #define UCB_ID 0x0c #define UCB_ID_1200 0x1004 #define UCB_ID_1300 0x1005 -#define UCB_ID_TC35143 0x9712 #define UCB_MODE 0x0d #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) diff --git a/trunk/drivers/net/3c59x.c b/trunk/drivers/net/3c59x.c index 80e8ca013e44..2819de79442c 100644 --- a/trunk/drivers/net/3c59x.c +++ b/trunk/drivers/net/3c59x.c @@ -17,6 +17,172 @@ 410 Severn Ave., Suite 210 Annapolis MD 21403 + Linux Kernel Additions: + + 0.99H+lk0.9 - David S. Miller - softnet, PCI DMA updates + 0.99H+lk1.0 - Jeff Garzik + Remove compatibility defines for kernel versions < 2.2.x. + Update for new 2.3.x module interface + LK1.1.2 (March 19, 2000) + * New PCI interface (jgarzik) + + LK1.1.3 25 April 2000, Andrew Morton + - Merged with 3c575_cb.c + - Don't set RxComplete in boomerang interrupt enable reg + - spinlock in vortex_timer to protect mdio functions + - disable local interrupts around call to vortex_interrupt in + vortex_tx_timeout() (So vortex_interrupt can use spin_lock()) + - Select window 3 in vortex_timer()'s write to Wn3_MAC_Ctrl + - In vortex_start_xmit(), move the lock to _after_ we've altered + vp->cur_tx and vp->tx_full. This defeats the race between + vortex_start_xmit() and vortex_interrupt which was identified + by Bogdan Costescu. + - Merged back support for six new cards from various sources + - Set vortex_have_pci if pci_module_init returns zero (fixes cardbus + insertion oops) + - Tell it that 3c905C has NWAY for 100bT autoneg + - Fix handling of SetStatusEnd in 'Too much work..' code, as + per 2.3.99's 3c575_cb (Dave Hinds). + - Split ISR into two for vortex & boomerang + - Fix MOD_INC/DEC races + - Handle resource allocation failures. + - Fix 3CCFE575CT LED polarity + - Make tx_interrupt_mitigation the default + + LK1.1.4 25 April 2000, Andrew Morton + - Add extra TxReset to vortex_up() to fix 575_cb hotplug initialisation probs. + - Put vortex_info_tbl into __devinitdata + - In the vortex_error StatsFull HACK, disable stats in vp->intr_enable as well + as in the hardware. + - Increased the loop counter in issue_and_wait from 2,000 to 4,000. + + LK1.1.5 28 April 2000, andrewm + - Added powerpc defines (John Daniel said these work...) + - Some extra diagnostics + - In vortex_error(), reset the Tx on maxCollisions. Otherwise most + chips usually get a Tx timeout. + - Added extra_reset module parm + - Replaced some inline timer manip with mod_timer + (Franois romieu ) + - In vortex_up(), don't make Wn3_config initialisation dependent upon has_nway + (this came across from 3c575_cb). + + LK1.1.6 06 Jun 2000, andrewm + - Backed out the PPC defines. + - Use del_timer_sync(), mod_timer(). + - Fix wrapped ulong comparison in boomerang_rx() + - Add IS_TORNADO, use it to suppress 3c905C checksum error msg + (Donald Becker, I Lee Hetherington ) + - Replace union wn3_config with BFINS/BFEXT manipulation for + sparc64 (Pete Zaitcev, Peter Jones) + - In vortex_error, do_tx_reset and vortex_tx_timeout(Vortex): + do a netif_wake_queue() to better recover from errors. (Anders Pedersen, + Donald Becker) + - Print a warning on out-of-memory (rate limited to 1 per 10 secs) + - Added two more Cardbus 575 NICs: 5b57 and 6564 (Paul Wagland) + + LK1.1.7 2 Jul 2000 andrewm + - Better handling of shared IRQs + - Reset the transmitter on a Tx reclaim error + - Fixed crash under OOM during vortex_open() (Mark Hemment) + - Fix Rx cessation problem during OOM (help from Mark Hemment) + - The spinlocks around the mdio access were blocking interrupts for 300uS. + Fix all this to use spin_lock_bh() within mdio_read/write + - Only write to TxFreeThreshold if it's a boomerang - other NICs don't + have one. + - Added 802.3x MAC-layer flow control support + + LK1.1.8 13 Aug 2000 andrewm + - Ignore request_region() return value - already reserved if Cardbus. + - Merged some additional Cardbus flags from Don's 0.99Qk + - Some fixes for 3c556 (Fred Maciel) + - Fix for EISA initialisation (Jan Rekorajski) + - Renamed MII_XCVR_PWR and EEPROM_230 to align with 3c575_cb and D. Becker's drivers + - Fixed MII_XCVR_PWR for 3CCFE575CT + - Added INVERT_LED_PWR, used it. + - Backed out the extra_reset stuff + + LK1.1.9 12 Sep 2000 andrewm + - Backed out the tx_reset_resume flags. It was a no-op. + - In vortex_error, don't reset the Tx on txReclaim errors + - In vortex_error, don't reset the Tx on maxCollisions errors. + Hence backed out all the DownListPtr logic here. + - In vortex_error, give Tornado cards a partial TxReset on + maxCollisions (David Hinds). Defined MAX_COLLISION_RESET for this. + - Redid some driver flags and device names based on pcmcia_cs-3.1.20. + - Fixed a bug where, if vp->tx_full is set when the interface + is downed, it remains set when the interface is upped. Bad + things happen. + + LK1.1.10 17 Sep 2000 andrewm + - Added EEPROM_8BIT for 3c555 (Fred Maciel) + - Added experimental support for the 3c556B Laptop Hurricane (Louis Gerbarg) + - Add HAS_NWAY to "3c900 Cyclone 10Mbps TPO" + + LK1.1.11 13 Nov 2000 andrewm + - Dump MOD_INC/DEC_USE_COUNT, use SET_MODULE_OWNER + + LK1.1.12 1 Jan 2001 andrewm (2.4.0-pre1) + - Call pci_enable_device before we request our IRQ (Tobias Ringstrom) + - Add 3c590 PCI latency timer hack to vortex_probe1 (from 0.99Ra) + - Added extended issue_and_wait for the 3c905CX. + - Look for an MII on PHY index 24 first (3c905CX oddity). + - Add HAS_NWAY to 3cSOHO100-TX (Brett Frankenberger) + - Don't free skbs we don't own on oom path in vortex_open(). + + LK1.1.13 27 Jan 2001 + - Added explicit `medialock' flag so we can truly + lock the media type down with `options'. + - "check ioremap return and some tidbits" (Arnaldo Carvalho de Melo ) + - Added and used EEPROM_NORESET for 3c556B PM resumes. + - Fixed leakage of vp->rx_ring. + - Break out separate HAS_HWCKSM device capability flag. + - Kill vp->tx_full (ANK) + - Merge zerocopy fragment handling (ANK?) + + LK1.1.14 15 Feb 2001 + - Enable WOL. Can be turned on with `enable_wol' module option. + - EISA and PCI initialisation fixes (jgarzik, Manfred Spraul) + - If a device's internalconfig register reports it has NWAY, + use it, even if autoselect is enabled. + + LK1.1.15 6 June 2001 akpm + - Prevent double counting of received bytes (Lars Christensen) + - Add ethtool support (jgarzik) + - Add module parm descriptions (Andrzej M. Krzysztofowicz) + - Implemented alloc_etherdev() API + - Special-case the 'Tx error 82' message. + + LK1.1.16 18 July 2001 akpm + - Make NETIF_F_SG dependent upon nr_free_highpages(), not on CONFIG_HIGHMEM + - Lessen verbosity of bootup messages + - Fix WOL - use new PM API functions. + - Use netif_running() instead of vp->open in suspend/resume. + - Don't reset the interface logic on open/close/rmmod. It upsets + autonegotiation, and hence DHCP (from 0.99T). + - Back out EEPROM_NORESET flag because of the above (we do it for all + NICs). + - Correct 3c982 identification string + - Rename wait_for_completion() to issue_and_wait() to avoid completion.h + clash. + + LK1.1.17 18Dec01 akpm + - PCI ID 9805 is a Python-T, not a dual-port Cyclone. Apparently. + And it has NWAY. + - Mask our advertised modes (vp->advertising) with our capabilities + (MII reg5) when deciding which duplex mode to use. + - Add `global_options' as default for options[]. Ditto global_enable_wol, + global_full_duplex. + + LK1.1.18 01Jul02 akpm + - Fix for undocumented transceiver power-up bit on some 3c566B's + (Donald Becker, Rahul Karnik) + + - See http://www.zip.com.au/~akpm/linux/#3c59x-2.3 for more details. + - Also see Documentation/networking/vortex.txt + + LK1.1.19 10Nov02 Marc Zyngier + - EISA sysfs integration. */ /* diff --git a/trunk/drivers/net/8139cp.c b/trunk/drivers/net/8139cp.c index 1428bb7715af..d2150baa7e35 100644 --- a/trunk/drivers/net/8139cp.c +++ b/trunk/drivers/net/8139cp.c @@ -1916,7 +1916,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) regs = ioremap(pciaddr, CP_REGS_SIZE); if (!regs) { rc = -EIO; - dev_err(&pdev->dev, "Cannot map PCI MMIO (%Lx@%Lx)\n", + dev_err(&pdev->dev, "Cannot map PCI MMIO (%lx@%lx)\n", (unsigned long long)pci_resource_len(pdev, 1), (unsigned long long)pciaddr); goto err_out_res; diff --git a/trunk/drivers/net/8139too.c b/trunk/drivers/net/8139too.c index e4f4eaff7679..cd9718512d1c 100644 --- a/trunk/drivers/net/8139too.c +++ b/trunk/drivers/net/8139too.c @@ -1709,7 +1709,6 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) void __iomem *ioaddr = tp->mmio_addr; unsigned int entry; unsigned int len = skb->len; - unsigned long flags; /* Calculate the next Tx descriptor entry. */ entry = tp->cur_tx % NUM_TX_DESC; @@ -1726,7 +1725,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) return 0; } - spin_lock_irqsave(&tp->lock, flags); + spin_lock_irq(&tp->lock); RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); @@ -1737,7 +1736,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) netif_stop_queue (dev); - spin_unlock_irqrestore(&tp->lock, flags); + spin_unlock_irq(&tp->lock); if (netif_msg_tx_queued(tp)) printk (KERN_DEBUG "%s: Queued Tx packet size %u to slot %d.\n", diff --git a/trunk/drivers/net/bnx2.c b/trunk/drivers/net/bnx2.c index db73de0d2511..64b6a72b4f6a 100644 --- a/trunk/drivers/net/bnx2.c +++ b/trunk/drivers/net/bnx2.c @@ -1639,7 +1639,7 @@ bnx2_tx_int(struct bnx2 *bp) skb = tx_buf->skb; #ifdef BCM_TSO /* partial BD completions possible with TSO packets */ - if (skb_is_gso(skb)) { + if (skb_shinfo(skb)->gso_size) { u16 last_idx, last_ring_idx; last_idx = sw_cons + diff --git a/trunk/drivers/net/chelsio/sge.c b/trunk/drivers/net/chelsio/sge.c index 61b3754f50ff..87f94d939ff8 100644 --- a/trunk/drivers/net/chelsio/sge.c +++ b/trunk/drivers/net/chelsio/sge.c @@ -1417,7 +1417,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) struct cpl_tx_pkt *cpl; #ifdef NETIF_F_TSO - if (skb_is_gso(skb)) { + if (skb_shinfo(skb)->gso_size) { int eth_type; struct cpl_tx_pkt_lso *hdr; diff --git a/trunk/drivers/net/e1000/e1000.h b/trunk/drivers/net/e1000/e1000.h index f411bbb44f86..3042d33e2d4d 100644 --- a/trunk/drivers/net/e1000/e1000.h +++ b/trunk/drivers/net/e1000/e1000.h @@ -68,6 +68,7 @@ #ifdef NETIF_F_TSO #include #endif +#include #include #include #include @@ -142,7 +143,6 @@ struct e1000_adapter; #define AUTO_ALL_MODES 0 #define E1000_EEPROM_82544_APM 0x0004 -#define E1000_EEPROM_ICH8_APME 0x0004 #define E1000_EEPROM_APME 0x0400 #ifndef E1000_MASTER_SLAVE @@ -254,6 +254,7 @@ struct e1000_adapter { spinlock_t tx_queue_lock; #endif atomic_t irq_sem; + struct work_struct watchdog_task; struct work_struct reset_task; uint8_t fc_autoneg; @@ -338,14 +339,8 @@ struct e1000_adapter { #ifdef NETIF_F_TSO boolean_t tso_force; #endif - boolean_t smart_power_down; /* phy smart power down */ - unsigned long flags; }; -enum e1000_state_t { - __E1000_DRIVER_TESTING, - __E1000_RESETTING, -}; /* e1000_main.c */ extern char e1000_driver_name[]; @@ -353,7 +348,6 @@ extern char e1000_driver_version[]; int e1000_up(struct e1000_adapter *adapter); void e1000_down(struct e1000_adapter *adapter); void e1000_reset(struct e1000_adapter *adapter); -void e1000_reinit_locked(struct e1000_adapter *adapter); int e1000_setup_all_tx_resources(struct e1000_adapter *adapter); void e1000_free_all_tx_resources(struct e1000_adapter *adapter); int e1000_setup_all_rx_resources(struct e1000_adapter *adapter); diff --git a/trunk/drivers/net/e1000/e1000_ethtool.c b/trunk/drivers/net/e1000/e1000_ethtool.c index 88a82ba88f57..d19664891768 100644 --- a/trunk/drivers/net/e1000/e1000_ethtool.c +++ b/trunk/drivers/net/e1000/e1000_ethtool.c @@ -109,8 +109,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) SUPPORTED_1000baseT_Full| SUPPORTED_Autoneg | SUPPORTED_TP); - if (hw->phy_type == e1000_phy_ife) - ecmd->supported &= ~SUPPORTED_1000baseT_Full; + ecmd->advertising = ADVERTISED_TP; if (hw->autoneg == 1) { @@ -204,9 +203,11 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) /* reset the link */ - if (netif_running(adapter->netdev)) - e1000_reinit_locked(adapter); - else + if (netif_running(adapter->netdev)) { + e1000_down(adapter); + e1000_reset(adapter); + e1000_up(adapter); + } else e1000_reset(adapter); return 0; @@ -253,9 +254,10 @@ e1000_set_pauseparam(struct net_device *netdev, hw->original_fc = hw->fc; if (adapter->fc_autoneg == AUTONEG_ENABLE) { - if (netif_running(adapter->netdev)) - e1000_reinit_locked(adapter); - else + if (netif_running(adapter->netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } else e1000_reset(adapter); } else return ((hw->media_type == e1000_media_type_fiber) ? @@ -277,9 +279,10 @@ e1000_set_rx_csum(struct net_device *netdev, uint32_t data) struct e1000_adapter *adapter = netdev_priv(netdev); adapter->rx_csum = data; - if (netif_running(netdev)) - e1000_reinit_locked(adapter); - else + if (netif_running(netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } else e1000_reset(adapter); return 0; } @@ -574,7 +577,6 @@ e1000_get_drvinfo(struct net_device *netdev, case e1000_82572: case e1000_82573: case e1000_80003es2lan: - case e1000_ich8lan: sprintf(firmware_version, "%d.%d-%d", (eeprom_data & 0xF000) >> 12, (eeprom_data & 0x0FF0) >> 4, @@ -629,9 +631,6 @@ e1000_set_ringparam(struct net_device *netdev, tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues; rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues; - while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) - msleep(1); - if (netif_running(adapter->netdev)) e1000_down(adapter); @@ -692,11 +691,9 @@ e1000_set_ringparam(struct net_device *netdev, adapter->rx_ring = rx_new; adapter->tx_ring = tx_new; if ((err = e1000_up(adapter))) - goto err_setup; + return err; } - clear_bit(__E1000_RESETTING, &adapter->flags); - return 0; err_setup_tx: e1000_free_all_rx_resources(adapter); @@ -704,8 +701,6 @@ e1000_set_ringparam(struct net_device *netdev, adapter->rx_ring = rx_old; adapter->tx_ring = tx_old; e1000_up(adapter); -err_setup: - clear_bit(__E1000_RESETTING, &adapter->flags); return err; } @@ -759,7 +754,6 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) toggle = 0x7FFFF3FF; break; case e1000_82573: - case e1000_ich8lan: toggle = 0x7FFFF033; break; default: @@ -779,12 +773,11 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) } /* restore previous status */ E1000_WRITE_REG(&adapter->hw, STATUS, before); - if (adapter->hw.mac_type != e1000_ich8lan) { - REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); - REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); - REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); - REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); - } + + REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); + REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); + REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); + REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); @@ -797,22 +790,20 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); - before = (adapter->hw.mac_type == e1000_ich8lan ? - 0x06C3B33E : 0x06DFB3FE); - REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB); + REG_SET_AND_CHECK(RCTL, 0x06DFB3FE, 0x003FFFFB); REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); if (adapter->hw.mac_type >= e1000_82543) { - REG_SET_AND_CHECK(RCTL, before, 0xFFFFFFFF); + REG_SET_AND_CHECK(RCTL, 0x06DFB3FE, 0xFFFFFFFF); REG_PATTERN_TEST(RDBAL, 0xFFFFFFF0, 0xFFFFFFFF); - if (adapter->hw.mac_type != e1000_ich8lan) - REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF); + REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF); REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF); - value = (adapter->hw.mac_type == e1000_ich8lan ? - E1000_RAR_ENTRIES_ICH8LAN : E1000_RAR_ENTRIES); - for (i = 0; i < value; i++) { + + for (i = 0; i < E1000_RAR_ENTRIES; i++) { + REG_PATTERN_TEST(RA + ((i << 1) << 2), 0xFFFFFFFF, + 0xFFFFFFFF); REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, 0xFFFFFFFF); } @@ -826,9 +817,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) } - value = (adapter->hw.mac_type == e1000_ich8lan ? - E1000_MC_TBL_SIZE_ICH8LAN : E1000_MC_TBL_SIZE); - for (i = 0; i < value; i++) + for (i = 0; i < E1000_MC_TBL_SIZE; i++) REG_PATTERN_TEST(MTA + (i << 2), 0xFFFFFFFF, 0xFFFFFFFF); *data = 0; @@ -900,8 +889,6 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) /* Test each interrupt */ for (; i < 10; i++) { - if (adapter->hw.mac_type == e1000_ich8lan && i == 8) - continue; /* Interrupt to test */ mask = 1 << i; @@ -1259,33 +1246,18 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter) } else if (adapter->hw.phy_type == e1000_phy_gg82563) { e1000_write_phy_reg(&adapter->hw, GG82563_PHY_KMRN_MODE_CTRL, - 0x1CC); + 0x1CE); } + /* force 1000, set loopback */ + e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x4140); + /* Now set up the MAC to the same speed/duplex as the PHY. */ ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL); - - if (adapter->hw.phy_type == e1000_phy_ife) { - /* force 100, set loopback */ - e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x6100); - - /* Now set up the MAC to the same speed/duplex as the PHY. */ - ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */ - ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */ - E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */ - E1000_CTRL_SPD_100 |/* Force Speed to 100 */ - E1000_CTRL_FD); /* Force Duplex to FULL */ - } else { - /* force 1000, set loopback */ - e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x4140); - - /* Now set up the MAC to the same speed/duplex as the PHY. */ - ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL); - ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */ - ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */ - E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */ - E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */ - E1000_CTRL_FD); /* Force Duplex to FULL */ - } + ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */ + ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */ + E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */ + E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */ + E1000_CTRL_FD); /* Force Duplex to FULL */ if (adapter->hw.media_type == e1000_media_type_copper && adapter->hw.phy_type == e1000_phy_m88) { @@ -1345,7 +1317,6 @@ e1000_set_phy_loopback(struct e1000_adapter *adapter) case e1000_82572: case e1000_82573: case e1000_80003es2lan: - case e1000_ich8lan: return e1000_integrated_phy_loopback(adapter); break; @@ -1597,7 +1568,6 @@ e1000_diag_test(struct net_device *netdev, struct e1000_adapter *adapter = netdev_priv(netdev); boolean_t if_running = netif_running(netdev); - set_bit(__E1000_DRIVER_TESTING, &adapter->flags); if (eth_test->flags == ETH_TEST_FL_OFFLINE) { /* Offline tests */ @@ -1612,8 +1582,7 @@ e1000_diag_test(struct net_device *netdev, eth_test->flags |= ETH_TEST_FL_FAILED; if (if_running) - /* indicate we're in test mode */ - dev_close(netdev); + e1000_down(adapter); else e1000_reset(adapter); @@ -1638,9 +1607,8 @@ e1000_diag_test(struct net_device *netdev, adapter->hw.autoneg = autoneg; e1000_reset(adapter); - clear_bit(__E1000_DRIVER_TESTING, &adapter->flags); if (if_running) - dev_open(netdev); + e1000_up(adapter); } else { /* Online tests */ if (e1000_link_test(adapter, &data[4])) @@ -1651,8 +1619,6 @@ e1000_diag_test(struct net_device *netdev, data[1] = 0; data[2] = 0; data[3] = 0; - - clear_bit(__E1000_DRIVER_TESTING, &adapter->flags); } msleep_interruptible(4 * 1000); } @@ -1812,18 +1778,21 @@ e1000_phys_id(struct net_device *netdev, uint32_t data) mod_timer(&adapter->blink_timer, jiffies); msleep_interruptible(data * 1000); del_timer_sync(&adapter->blink_timer); - } else if (adapter->hw.phy_type == e1000_phy_ife) { - if (!adapter->blink_timer.function) { - init_timer(&adapter->blink_timer); - adapter->blink_timer.function = e1000_led_blink_callback; - adapter->blink_timer.data = (unsigned long) adapter; - } - mod_timer(&adapter->blink_timer, jiffies); + } else if (adapter->hw.mac_type < e1000_82573) { + E1000_WRITE_REG(&adapter->hw, LEDCTL, + (E1000_LEDCTL_LED2_BLINK_RATE | + E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK | + (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) | + (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) | + (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT))); msleep_interruptible(data * 1000); - del_timer_sync(&adapter->blink_timer); - e1000_write_phy_reg(&(adapter->hw), IFE_PHY_SPECIAL_CONTROL_LED, 0); } else { - e1000_blink_led_start(&adapter->hw); + E1000_WRITE_REG(&adapter->hw, LEDCTL, + (E1000_LEDCTL_LED2_BLINK_RATE | + E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK | + (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) | + (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) | + (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT))); msleep_interruptible(data * 1000); } @@ -1838,8 +1807,10 @@ static int e1000_nway_reset(struct net_device *netdev) { struct e1000_adapter *adapter = netdev_priv(netdev); - if (netif_running(netdev)) - e1000_reinit_locked(adapter); + if (netif_running(netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } return 0; } diff --git a/trunk/drivers/net/e1000/e1000_hw.c b/trunk/drivers/net/e1000/e1000_hw.c index 583518ae49ce..3959039b16ec 100644 --- a/trunk/drivers/net/e1000/e1000_hw.c +++ b/trunk/drivers/net/e1000/e1000_hw.c @@ -101,8 +101,7 @@ static void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset, #define E1000_WRITE_REG_IO(a, reg, val) \ e1000_write_reg_io((a), E1000_##reg, val) -static int32_t e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, - uint16_t duplex); +static int32_t e1000_configure_kmrn_for_10_100(struct e1000_hw *hw); static int32_t e1000_configure_kmrn_for_1000(struct e1000_hw *hw); /* IGP cable length table */ @@ -157,14 +156,6 @@ e1000_set_phy_type(struct e1000_hw *hw) hw->phy_type = e1000_phy_igp; break; } - case IGP03E1000_E_PHY_ID: - hw->phy_type = e1000_phy_igp_3; - break; - case IFE_E_PHY_ID: - case IFE_PLUS_E_PHY_ID: - case IFE_C_E_PHY_ID: - hw->phy_type = e1000_phy_ife; - break; case GG82563_E_PHY_ID: if (hw->mac_type == e1000_80003es2lan) { hw->phy_type = e1000_phy_gg82563; @@ -341,7 +332,6 @@ e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_82541EI: case E1000_DEV_ID_82541EI_MOBILE: - case E1000_DEV_ID_82541ER_LOM: hw->mac_type = e1000_82541; break; case E1000_DEV_ID_82541ER: @@ -351,7 +341,6 @@ e1000_set_mac_type(struct e1000_hw *hw) hw->mac_type = e1000_82541_rev_2; break; case E1000_DEV_ID_82547EI: - case E1000_DEV_ID_82547EI_MOBILE: hw->mac_type = e1000_82547; break; case E1000_DEV_ID_82547GI: @@ -365,7 +354,6 @@ e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_82572EI_COPPER: case E1000_DEV_ID_82572EI_FIBER: case E1000_DEV_ID_82572EI_SERDES: - case E1000_DEV_ID_82572EI: hw->mac_type = e1000_82572; break; case E1000_DEV_ID_82573E: @@ -373,29 +361,16 @@ e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_82573L: hw->mac_type = e1000_82573; break; - case E1000_DEV_ID_80003ES2LAN_COPPER_SPT: - case E1000_DEV_ID_80003ES2LAN_SERDES_SPT: case E1000_DEV_ID_80003ES2LAN_COPPER_DPT: case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: hw->mac_type = e1000_80003es2lan; break; - case E1000_DEV_ID_ICH8_IGP_M_AMT: - case E1000_DEV_ID_ICH8_IGP_AMT: - case E1000_DEV_ID_ICH8_IGP_C: - case E1000_DEV_ID_ICH8_IFE: - case E1000_DEV_ID_ICH8_IGP_M: - hw->mac_type = e1000_ich8lan; - break; default: /* Should never have loaded on this device */ return -E1000_ERR_MAC_TYPE; } switch(hw->mac_type) { - case e1000_ich8lan: - hw->swfwhw_semaphore_present = TRUE; - hw->asf_firmware_present = TRUE; - break; case e1000_80003es2lan: hw->swfw_sync_present = TRUE; /* fall through */ @@ -448,7 +423,6 @@ e1000_set_media_type(struct e1000_hw *hw) case e1000_82542_rev2_1: hw->media_type = e1000_media_type_fiber; break; - case e1000_ich8lan: case e1000_82573: /* The STATUS_TBIMODE bit is reserved or reused for the this * device. @@ -553,14 +527,6 @@ e1000_reset_hw(struct e1000_hw *hw) } while(timeout); } - /* Workaround for ICH8 bit corruption issue in FIFO memory */ - if (hw->mac_type == e1000_ich8lan) { - /* Set Tx and Rx buffer allocation to 8k apiece. */ - E1000_WRITE_REG(hw, PBA, E1000_PBA_8K); - /* Set Packet Buffer Size to 16k. */ - E1000_WRITE_REG(hw, PBS, E1000_PBS_16K); - } - /* Issue a global reset to the MAC. This will reset the chip's * transmit, receive, DMA, and link units. It will not effect * the current PCI configuration. The global reset bit is self- @@ -584,20 +550,6 @@ e1000_reset_hw(struct e1000_hw *hw) /* Reset is performed on a shadow of the control register */ E1000_WRITE_REG(hw, CTRL_DUP, (ctrl | E1000_CTRL_RST)); break; - case e1000_ich8lan: - if (!hw->phy_reset_disable && - e1000_check_phy_reset_block(hw) == E1000_SUCCESS) { - /* e1000_ich8lan PHY HW reset requires MAC CORE reset - * at the same time to make sure the interface between - * MAC and the external PHY is reset. - */ - ctrl |= E1000_CTRL_PHY_RST; - } - - e1000_get_software_flag(hw); - E1000_WRITE_REG(hw, CTRL, (ctrl | E1000_CTRL_RST)); - msec_delay(5); - break; default: E1000_WRITE_REG(hw, CTRL, (ctrl | E1000_CTRL_RST)); break; @@ -639,7 +591,6 @@ e1000_reset_hw(struct e1000_hw *hw) /* fall through */ case e1000_82571: case e1000_82572: - case e1000_ich8lan: case e1000_80003es2lan: ret_val = e1000_get_auto_rd_done(hw); if(ret_val) @@ -682,12 +633,6 @@ e1000_reset_hw(struct e1000_hw *hw) e1000_pci_set_mwi(hw); } - if (hw->mac_type == e1000_ich8lan) { - uint32_t kab = E1000_READ_REG(hw, KABGTXD); - kab |= E1000_KABGTXD_BGSQLBIAS; - E1000_WRITE_REG(hw, KABGTXD, kab); - } - return E1000_SUCCESS; } @@ -730,12 +675,9 @@ e1000_init_hw(struct e1000_hw *hw) /* Disabling VLAN filtering. */ DEBUGOUT("Initializing the IEEE VLAN\n"); - /* VET hardcoded to standard value and VFTA removed in ICH8 LAN */ - if (hw->mac_type != e1000_ich8lan) { - if (hw->mac_type < e1000_82545_rev_3) - E1000_WRITE_REG(hw, VET, 0); - e1000_clear_vfta(hw); - } + if (hw->mac_type < e1000_82545_rev_3) + E1000_WRITE_REG(hw, VET, 0); + e1000_clear_vfta(hw); /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */ if(hw->mac_type == e1000_82542_rev2_0) { @@ -763,14 +705,8 @@ e1000_init_hw(struct e1000_hw *hw) /* Zero out the Multicast HASH table */ DEBUGOUT("Zeroing the MTA\n"); mta_size = E1000_MC_TBL_SIZE; - if (hw->mac_type == e1000_ich8lan) - mta_size = E1000_MC_TBL_SIZE_ICH8LAN; - for(i = 0; i < mta_size; i++) { + for(i = 0; i < mta_size; i++) E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); - /* use write flush to prevent Memory Write Block (MWB) from - * occuring when accessing our register space */ - E1000_WRITE_FLUSH(hw); - } /* Set the PCI priority bit correctly in the CTRL register. This * determines if the adapter gives priority to receives, or if it @@ -808,10 +744,6 @@ e1000_init_hw(struct e1000_hw *hw) break; } - /* More time needed for PHY to initialize */ - if (hw->mac_type == e1000_ich8lan) - msec_delay(15); - /* Call a subroutine to configure the link and setup flow control. */ ret_val = e1000_setup_link(hw); @@ -825,7 +757,6 @@ e1000_init_hw(struct e1000_hw *hw) case e1000_82571: case e1000_82572: case e1000_82573: - case e1000_ich8lan: case e1000_80003es2lan: ctrl |= E1000_TXDCTL_COUNT_DESC; break; @@ -864,7 +795,6 @@ e1000_init_hw(struct e1000_hw *hw) /* Fall through */ case e1000_82571: case e1000_82572: - case e1000_ich8lan: ctrl = E1000_READ_REG(hw, TXDCTL1); ctrl = (ctrl & ~E1000_TXDCTL_WTHRESH) | E1000_TXDCTL_FULL_TX_DESC_WB; if(hw->mac_type >= e1000_82571) @@ -888,11 +818,6 @@ e1000_init_hw(struct e1000_hw *hw) */ e1000_clear_hw_cntrs(hw); - /* ICH8 No-snoop bits are opposite polarity. - * Set to snoop by default after reset. */ - if (hw->mac_type == e1000_ich8lan) - e1000_set_pci_ex_no_snoop(hw, PCI_EX_82566_SNOOP_ALL); - if (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER || hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3) { ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); @@ -980,7 +905,6 @@ e1000_setup_link(struct e1000_hw *hw) */ if (hw->fc == e1000_fc_default) { switch (hw->mac_type) { - case e1000_ich8lan: case e1000_82573: hw->fc = e1000_fc_full; break; @@ -1047,12 +971,9 @@ e1000_setup_link(struct e1000_hw *hw) */ DEBUGOUT("Initializing the Flow Control address, type and timer regs\n"); - /* FCAL/H and FCT are hardcoded to standard values in e1000_ich8lan. */ - if (hw->mac_type != e1000_ich8lan) { - E1000_WRITE_REG(hw, FCT, FLOW_CONTROL_TYPE); - E1000_WRITE_REG(hw, FCAH, FLOW_CONTROL_ADDRESS_HIGH); - E1000_WRITE_REG(hw, FCAL, FLOW_CONTROL_ADDRESS_LOW); - } + E1000_WRITE_REG(hw, FCAL, FLOW_CONTROL_ADDRESS_LOW); + E1000_WRITE_REG(hw, FCAH, FLOW_CONTROL_ADDRESS_HIGH); + E1000_WRITE_REG(hw, FCT, FLOW_CONTROL_TYPE); E1000_WRITE_REG(hw, FCTTV, hw->fc_pause_time); @@ -1316,13 +1237,12 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw) /* Wait 10ms for MAC to configure PHY from eeprom settings */ msec_delay(15); - if (hw->mac_type != e1000_ich8lan) { + /* Configure activity LED after PHY reset */ led_ctrl = E1000_READ_REG(hw, LEDCTL); led_ctrl &= IGP_ACTIVITY_LED_MASK; led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE); E1000_WRITE_REG(hw, LEDCTL, led_ctrl); - } /* disable lplu d3 during driver init */ ret_val = e1000_set_d3_lplu_state(hw, FALSE); @@ -1558,7 +1478,8 @@ e1000_copper_link_ggp_setup(struct e1000_hw *hw) if (ret_val) return ret_val; - phy_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; + /* Enable Pass False Carrier on the PHY */ + phy_data |= GG82563_KMCR_PASS_FALSE_CARRIER; ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, phy_data); @@ -1640,40 +1561,28 @@ e1000_copper_link_mgp_setup(struct e1000_hw *hw) phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL; if(hw->disable_polarity_correction == 1) phy_data |= M88E1000_PSCR_POLARITY_REVERSAL; - ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); - if (ret_val) - return ret_val; - - if (hw->phy_revision < M88E1011_I_REV_4) { - /* Force TX_CLK in the Extended PHY Specific Control Register - * to 25MHz clock. - */ - ret_val = e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); - if (ret_val) + ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); + if(ret_val) return ret_val; - phy_data |= M88E1000_EPSCR_TX_CLK_25; + /* Force TX_CLK in the Extended PHY Specific Control Register + * to 25MHz clock. + */ + ret_val = e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); + if(ret_val) + return ret_val; - if ((hw->phy_revision == E1000_REVISION_2) && - (hw->phy_id == M88E1111_I_PHY_ID)) { - /* Vidalia Phy, set the downshift counter to 5x */ - phy_data &= ~(M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK); - phy_data |= M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X; - ret_val = e1000_write_phy_reg(hw, - M88E1000_EXT_PHY_SPEC_CTRL, phy_data); - if (ret_val) - return ret_val; - } else { - /* Configure Master and Slave downshift values */ - phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK | + phy_data |= M88E1000_EPSCR_TX_CLK_25; + + if (hw->phy_revision < M88E1011_I_REV_4) { + /* Configure Master and Slave downshift values */ + phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK | M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK); - phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X | + phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X | M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X); - ret_val = e1000_write_phy_reg(hw, - M88E1000_EXT_PHY_SPEC_CTRL, phy_data); - if (ret_val) - return ret_val; - } + ret_val = e1000_write_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); + if(ret_val) + return ret_val; } /* SW Reset the PHY so all changes take effect */ @@ -1711,10 +1620,6 @@ e1000_copper_link_autoneg(struct e1000_hw *hw) if(hw->autoneg_advertised == 0) hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT; - /* IFE phy only supports 10/100 */ - if (hw->phy_type == e1000_phy_ife) - hw->autoneg_advertised &= AUTONEG_ADVERTISE_10_100_ALL; - DEBUGOUT("Reconfiguring auto-neg advertisement params\n"); ret_val = e1000_phy_setup_autoneg(hw); if(ret_val) { @@ -1812,26 +1717,6 @@ e1000_setup_copper_link(struct e1000_hw *hw) DEBUGFUNC("e1000_setup_copper_link"); - switch (hw->mac_type) { - case e1000_80003es2lan: - case e1000_ich8lan: - /* Set the mac to wait the maximum time between each - * iteration and increase the max iterations when - * polling the phy; this fixes erroneous timeouts at 10Mbps. */ - ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF); - if (ret_val) - return ret_val; - ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), ®_data); - if (ret_val) - return ret_val; - reg_data |= 0x3F; - ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data); - if (ret_val) - return ret_val; - default: - break; - } - /* Check if it is a valid PHY and set PHY mode if necessary. */ ret_val = e1000_copper_link_preconfig(hw); if(ret_val) @@ -1839,8 +1724,10 @@ e1000_setup_copper_link(struct e1000_hw *hw) switch (hw->mac_type) { case e1000_80003es2lan: - /* Kumeran registers are written-only */ - reg_data = E1000_KUMCTRLSTA_INB_CTRL_LINK_STATUS_TX_TIMEOUT_DEFAULT; + ret_val = e1000_read_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_INB_CTRL, + ®_data); + if (ret_val) + return ret_val; reg_data |= E1000_KUMCTRLSTA_INB_CTRL_DIS_PADDING; ret_val = e1000_write_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_INB_CTRL, reg_data); @@ -1852,7 +1739,6 @@ e1000_setup_copper_link(struct e1000_hw *hw) } if (hw->phy_type == e1000_phy_igp || - hw->phy_type == e1000_phy_igp_3 || hw->phy_type == e1000_phy_igp_2) { ret_val = e1000_copper_link_igp_setup(hw); if(ret_val) @@ -1917,7 +1803,7 @@ e1000_setup_copper_link(struct e1000_hw *hw) * hw - Struct containing variables accessed by shared code ******************************************************************************/ static int32_t -e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, uint16_t duplex) +e1000_configure_kmrn_for_10_100(struct e1000_hw *hw) { int32_t ret_val = E1000_SUCCESS; uint32_t tipg; @@ -1937,18 +1823,6 @@ e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, uint16_t duplex) tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_10_100; E1000_WRITE_REG(hw, TIPG, tipg); - ret_val = e1000_read_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); - - if (ret_val) - return ret_val; - - if (duplex == HALF_DUPLEX) - reg_data |= GG82563_KMCR_PASS_FALSE_CARRIER; - else - reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; - - ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data); - return ret_val; } @@ -1973,14 +1847,6 @@ e1000_configure_kmrn_for_1000(struct e1000_hw *hw) tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_1000; E1000_WRITE_REG(hw, TIPG, tipg); - ret_val = e1000_read_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); - - if (ret_val) - return ret_val; - - reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; - ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data); - return ret_val; } @@ -2003,13 +1869,10 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) if(ret_val) return ret_val; - if (hw->phy_type != e1000_phy_ife) { - /* Read the MII 1000Base-T Control Register (Address 9). */ - ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg); - if (ret_val) - return ret_val; - } else - mii_1000t_ctrl_reg=0; + /* Read the MII 1000Base-T Control Register (Address 9). */ + ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg); + if(ret_val) + return ret_val; /* Need to parse both autoneg_advertised and fc and set up * the appropriate PHY registers. First we will parse for @@ -2060,9 +1923,6 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) if(hw->autoneg_advertised & ADVERTISE_1000_FULL) { DEBUGOUT("Advertise 1000mb Full duplex\n"); mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS; - if (hw->phy_type == e1000_phy_ife) { - DEBUGOUT("e1000_phy_ife is a 10/100 PHY. Gigabit speed is not supported.\n"); - } } /* Check for a software override of the flow control settings, and @@ -2124,11 +1984,9 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg); - if (hw->phy_type != e1000_phy_ife) { - ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg); - if (ret_val) - return ret_val; - } + ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg); + if(ret_val) + return ret_val; return E1000_SUCCESS; } @@ -2231,18 +2089,6 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) /* Need to reset the PHY or these changes will be ignored */ mii_ctrl_reg |= MII_CR_RESET; - /* Disable MDI-X support for 10/100 */ - } else if (hw->phy_type == e1000_phy_ife) { - ret_val = e1000_read_phy_reg(hw, IFE_PHY_MDIX_CONTROL, &phy_data); - if (ret_val) - return ret_val; - - phy_data &= ~IFE_PMC_AUTO_MDIX; - phy_data &= ~IFE_PMC_FORCE_MDIX; - - ret_val = e1000_write_phy_reg(hw, IFE_PHY_MDIX_CONTROL, phy_data); - if (ret_val) - return ret_val; } else { /* Clear Auto-Crossover to force MDI manually. IGP requires MDI * forced whenever speed or duplex are forced. @@ -2875,12 +2721,8 @@ e1000_check_for_link(struct e1000_hw *hw) */ if(hw->tbi_compatibility_en) { uint16_t speed, duplex; - ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex); - if (ret_val) { - DEBUGOUT("Error getting link speed and duplex\n"); - return ret_val; - } - if (speed != SPEED_1000) { + e1000_get_speed_and_duplex(hw, &speed, &duplex); + if(speed != SPEED_1000) { /* If link speed is not set to gigabit speed, we do not need * to enable TBI compatibility. */ @@ -3047,13 +2889,7 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw, if (*speed == SPEED_1000) ret_val = e1000_configure_kmrn_for_1000(hw); else - ret_val = e1000_configure_kmrn_for_10_100(hw, *duplex); - if (ret_val) - return ret_val; - } - - if ((hw->phy_type == e1000_phy_igp_3) && (*speed == SPEED_1000)) { - ret_val = e1000_kumeran_lock_loss_workaround(hw); + ret_val = e1000_configure_kmrn_for_10_100(hw); if (ret_val) return ret_val; } @@ -3243,9 +3079,6 @@ e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask) DEBUGFUNC("e1000_swfw_sync_acquire"); - if (hw->swfwhw_semaphore_present) - return e1000_get_software_flag(hw); - if (!hw->swfw_sync_present) return e1000_get_hw_eeprom_semaphore(hw); @@ -3285,11 +3118,6 @@ e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask) DEBUGFUNC("e1000_swfw_sync_release"); - if (hw->swfwhw_semaphore_present) { - e1000_release_software_flag(hw); - return; - } - if (!hw->swfw_sync_present) { e1000_put_hw_eeprom_semaphore(hw); return; @@ -3332,8 +3160,7 @@ e1000_read_phy_reg(struct e1000_hw *hw, if (e1000_swfw_sync_acquire(hw, swfw)) return -E1000_ERR_SWFW_SYNC; - if ((hw->phy_type == e1000_phy_igp || - hw->phy_type == e1000_phy_igp_3 || + if((hw->phy_type == e1000_phy_igp || hw->phy_type == e1000_phy_igp_2) && (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, @@ -3472,8 +3299,7 @@ e1000_write_phy_reg(struct e1000_hw *hw, if (e1000_swfw_sync_acquire(hw, swfw)) return -E1000_ERR_SWFW_SYNC; - if ((hw->phy_type == e1000_phy_igp || - hw->phy_type == e1000_phy_igp_3 || + if((hw->phy_type == e1000_phy_igp || hw->phy_type == e1000_phy_igp_2) && (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, @@ -3688,7 +3514,7 @@ e1000_phy_hw_reset(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); if (hw->mac_type >= e1000_82571) - msec_delay_irq(10); + msec_delay(10); e1000_swfw_sync_release(hw, swfw); } else { /* Read the Extended Device Control Register, assert the PHY_RESET_DIR @@ -3718,12 +3544,6 @@ e1000_phy_hw_reset(struct e1000_hw *hw) ret_val = e1000_get_phy_cfg_done(hw); e1000_release_software_semaphore(hw); - if ((hw->mac_type == e1000_ich8lan) && - (hw->phy_type == e1000_phy_igp_3)) { - ret_val = e1000_init_lcd_from_nvm(hw); - if (ret_val) - return ret_val; - } return ret_val; } @@ -3752,11 +3572,9 @@ e1000_phy_reset(struct e1000_hw *hw) case e1000_82541_rev_2: case e1000_82571: case e1000_82572: - case e1000_ich8lan: ret_val = e1000_phy_hw_reset(hw); if(ret_val) return ret_val; - break; default: ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data); @@ -3778,121 +3596,12 @@ e1000_phy_reset(struct e1000_hw *hw) return E1000_SUCCESS; } -/****************************************************************************** -* Work-around for 82566 power-down: on D3 entry- -* 1) disable gigabit link -* 2) write VR power-down enable -* 3) read it back -* if successful continue, else issue LCD reset and repeat -* -* hw - struct containing variables accessed by shared code -******************************************************************************/ -void -e1000_phy_powerdown_workaround(struct e1000_hw *hw) -{ - int32_t reg; - uint16_t phy_data; - int32_t retry = 0; - - DEBUGFUNC("e1000_phy_powerdown_workaround"); - - if (hw->phy_type != e1000_phy_igp_3) - return; - - do { - /* Disable link */ - reg = E1000_READ_REG(hw, PHY_CTRL); - E1000_WRITE_REG(hw, PHY_CTRL, reg | E1000_PHY_CTRL_GBE_DISABLE | - E1000_PHY_CTRL_NOND0A_GBE_DISABLE); - - /* Write VR power-down enable */ - e1000_read_phy_reg(hw, IGP3_VR_CTRL, &phy_data); - e1000_write_phy_reg(hw, IGP3_VR_CTRL, phy_data | - IGP3_VR_CTRL_MODE_SHUT); - - /* Read it back and test */ - e1000_read_phy_reg(hw, IGP3_VR_CTRL, &phy_data); - if ((phy_data & IGP3_VR_CTRL_MODE_SHUT) || retry) - break; - - /* Issue PHY reset and repeat at most one more time */ - reg = E1000_READ_REG(hw, CTRL); - E1000_WRITE_REG(hw, CTRL, reg | E1000_CTRL_PHY_RST); - retry++; - } while (retry); - - return; - -} - -/****************************************************************************** -* Work-around for 82566 Kumeran PCS lock loss: -* On link status change (i.e. PCI reset, speed change) and link is up and -* speed is gigabit- -* 0) if workaround is optionally disabled do nothing -* 1) wait 1ms for Kumeran link to come up -* 2) check Kumeran Diagnostic register PCS lock loss bit -* 3) if not set the link is locked (all is good), otherwise... -* 4) reset the PHY -* 5) repeat up to 10 times -* Note: this is only called for IGP3 copper when speed is 1gb. -* -* hw - struct containing variables accessed by shared code -******************************************************************************/ -int32_t -e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw) -{ - int32_t ret_val; - int32_t reg; - int32_t cnt; - uint16_t phy_data; - - if (hw->kmrn_lock_loss_workaround_disabled) - return E1000_SUCCESS; - - /* Make sure link is up before proceeding. If not just return. - * Attempting this while link is negotiating fouls up link - * stability */ - ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); - ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); - - if (phy_data & MII_SR_LINK_STATUS) { - for (cnt = 0; cnt < 10; cnt++) { - /* read once to clear */ - ret_val = e1000_read_phy_reg(hw, IGP3_KMRN_DIAG, &phy_data); - if (ret_val) - return ret_val; - /* and again to get new status */ - ret_val = e1000_read_phy_reg(hw, IGP3_KMRN_DIAG, &phy_data); - if (ret_val) - return ret_val; - - /* check for PCS lock */ - if (!(phy_data & IGP3_KMRN_DIAG_PCS_LOCK_LOSS)) - return E1000_SUCCESS; - - /* Issue PHY reset */ - e1000_phy_hw_reset(hw); - msec_delay_irq(5); - } - /* Disable GigE link negotiation */ - reg = E1000_READ_REG(hw, PHY_CTRL); - E1000_WRITE_REG(hw, PHY_CTRL, reg | E1000_PHY_CTRL_GBE_DISABLE | - E1000_PHY_CTRL_NOND0A_GBE_DISABLE); - - /* unable to acquire PCS lock */ - return E1000_ERR_PHY; - } - - return E1000_SUCCESS; -} - /****************************************************************************** * Probes the expected PHY address for known PHY IDs * * hw - Struct containing variables accessed by shared code ******************************************************************************/ -int32_t +static int32_t e1000_detect_gig_phy(struct e1000_hw *hw) { int32_t phy_init_status, ret_val; @@ -3904,8 +3613,8 @@ e1000_detect_gig_phy(struct e1000_hw *hw) /* The 82571 firmware may still be configuring the PHY. In this * case, we cannot access the PHY until the configuration is done. So * we explicitly set the PHY values. */ - if (hw->mac_type == e1000_82571 || - hw->mac_type == e1000_82572) { + if(hw->mac_type == e1000_82571 || + hw->mac_type == e1000_82572) { hw->phy_id = IGP01E1000_I_PHY_ID; hw->phy_type = e1000_phy_igp_2; return E1000_SUCCESS; @@ -3922,7 +3631,7 @@ e1000_detect_gig_phy(struct e1000_hw *hw) /* Read the PHY ID Registers to identify which PHY is onboard. */ ret_val = e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high); - if (ret_val) + if(ret_val) return ret_val; hw->phy_id = (uint32_t) (phy_id_high << 16); @@ -3960,12 +3669,6 @@ e1000_detect_gig_phy(struct e1000_hw *hw) case e1000_80003es2lan: if (hw->phy_id == GG82563_E_PHY_ID) match = TRUE; break; - case e1000_ich8lan: - if (hw->phy_id == IGP03E1000_E_PHY_ID) match = TRUE; - if (hw->phy_id == IFE_E_PHY_ID) match = TRUE; - if (hw->phy_id == IFE_PLUS_E_PHY_ID) match = TRUE; - if (hw->phy_id == IFE_C_E_PHY_ID) match = TRUE; - break; default: DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type); return -E1000_ERR_CONFIG; @@ -4080,53 +3783,6 @@ e1000_phy_igp_get_info(struct e1000_hw *hw, return E1000_SUCCESS; } -/****************************************************************************** -* Get PHY information from various PHY registers for ife PHY only. -* -* hw - Struct containing variables accessed by shared code -* phy_info - PHY information structure -******************************************************************************/ -int32_t -e1000_phy_ife_get_info(struct e1000_hw *hw, - struct e1000_phy_info *phy_info) -{ - int32_t ret_val; - uint16_t phy_data, polarity; - - DEBUGFUNC("e1000_phy_ife_get_info"); - - phy_info->downshift = (e1000_downshift)hw->speed_downgraded; - phy_info->extended_10bt_distance = e1000_10bt_ext_dist_enable_normal; - - ret_val = e1000_read_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, &phy_data); - if (ret_val) - return ret_val; - phy_info->polarity_correction = - (phy_data & IFE_PSC_AUTO_POLARITY_DISABLE) >> - IFE_PSC_AUTO_POLARITY_DISABLE_SHIFT; - - if (phy_info->polarity_correction == e1000_polarity_reversal_enabled) { - ret_val = e1000_check_polarity(hw, &polarity); - if (ret_val) - return ret_val; - } else { - /* Polarity is forced. */ - polarity = (phy_data & IFE_PSC_FORCE_POLARITY) >> - IFE_PSC_FORCE_POLARITY_SHIFT; - } - phy_info->cable_polarity = polarity; - - ret_val = e1000_read_phy_reg(hw, IFE_PHY_MDIX_CONTROL, &phy_data); - if (ret_val) - return ret_val; - - phy_info->mdix_mode = - (phy_data & (IFE_PMC_AUTO_MDIX | IFE_PMC_FORCE_MDIX)) >> - IFE_PMC_MDIX_MODE_SHIFT; - - return E1000_SUCCESS; -} - /****************************************************************************** * Get PHY information from various PHY registers fot m88 PHY only. * @@ -4242,12 +3898,9 @@ e1000_phy_get_info(struct e1000_hw *hw, return -E1000_ERR_CONFIG; } - if (hw->phy_type == e1000_phy_igp || - hw->phy_type == e1000_phy_igp_3 || + if(hw->phy_type == e1000_phy_igp || hw->phy_type == e1000_phy_igp_2) return e1000_phy_igp_get_info(hw, phy_info); - else if (hw->phy_type == e1000_phy_ife) - return e1000_phy_ife_get_info(hw, phy_info); else return e1000_phy_m88_get_info(hw, phy_info); } @@ -4396,35 +4049,6 @@ e1000_init_eeprom_params(struct e1000_hw *hw) eeprom->use_eerd = TRUE; eeprom->use_eewr = FALSE; break; - case e1000_ich8lan: - { - int32_t i = 0; - uint32_t flash_size = E1000_READ_ICH8_REG(hw, ICH8_FLASH_GFPREG); - - eeprom->type = e1000_eeprom_ich8; - eeprom->use_eerd = FALSE; - eeprom->use_eewr = FALSE; - eeprom->word_size = E1000_SHADOW_RAM_WORDS; - - /* Zero the shadow RAM structure. But don't load it from NVM - * so as to save time for driver init */ - if (hw->eeprom_shadow_ram != NULL) { - for (i = 0; i < E1000_SHADOW_RAM_WORDS; i++) { - hw->eeprom_shadow_ram[i].modified = FALSE; - hw->eeprom_shadow_ram[i].eeprom_word = 0xFFFF; - } - } - - hw->flash_base_addr = (flash_size & ICH8_GFPREG_BASE_MASK) * - ICH8_FLASH_SECTOR_SIZE; - - hw->flash_bank_size = ((flash_size >> 16) & ICH8_GFPREG_BASE_MASK) + 1; - hw->flash_bank_size -= (flash_size & ICH8_GFPREG_BASE_MASK); - hw->flash_bank_size *= ICH8_FLASH_SECTOR_SIZE; - hw->flash_bank_size /= 2 * sizeof(uint16_t); - - break; - } default: break; } @@ -4845,10 +4469,7 @@ e1000_read_eeprom(struct e1000_hw *hw, return ret_val; } - if (eeprom->type == e1000_eeprom_ich8) - return e1000_read_eeprom_ich8(hw, offset, words, data); - - if (eeprom->type == e1000_eeprom_spi) { + if(eeprom->type == e1000_eeprom_spi) { uint16_t word_in; uint8_t read_opcode = EEPROM_READ_OPCODE_SPI; @@ -5015,10 +4636,7 @@ e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) DEBUGFUNC("e1000_is_onboard_nvm_eeprom"); - if (hw->mac_type == e1000_ich8lan) - return FALSE; - - if (hw->mac_type == e1000_82573) { + if(hw->mac_type == e1000_82573) { eecd = E1000_READ_REG(hw, EECD); /* Isolate bits 15 & 16 */ @@ -5068,22 +4686,8 @@ e1000_validate_eeprom_checksum(struct e1000_hw *hw) } } - if (hw->mac_type == e1000_ich8lan) { - /* Drivers must allocate the shadow ram structure for the - * EEPROM checksum to be updated. Otherwise, this bit as well - * as the checksum must both be set correctly for this - * validation to pass. - */ - e1000_read_eeprom(hw, 0x19, 1, &eeprom_data); - if ((eeprom_data & 0x40) == 0) { - eeprom_data |= 0x40; - e1000_write_eeprom(hw, 0x19, 1, &eeprom_data); - e1000_update_eeprom_checksum(hw); - } - } - - for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) { - if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { + for(i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) { + if(e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { DEBUGOUT("EEPROM Read Error\n"); return -E1000_ERR_EEPROM; } @@ -5109,7 +4713,6 @@ e1000_validate_eeprom_checksum(struct e1000_hw *hw) int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw) { - uint32_t ctrl_ext; uint16_t checksum = 0; uint16_t i, eeprom_data; @@ -5128,14 +4731,6 @@ e1000_update_eeprom_checksum(struct e1000_hw *hw) return -E1000_ERR_EEPROM; } else if (hw->eeprom.type == e1000_eeprom_flash) { e1000_commit_shadow_ram(hw); - } else if (hw->eeprom.type == e1000_eeprom_ich8) { - e1000_commit_shadow_ram(hw); - /* Reload the EEPROM, or else modifications will not appear - * until after next adapter reset. */ - ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); - ctrl_ext |= E1000_CTRL_EXT_EE_RST; - E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); - msec_delay(10); } return E1000_SUCCESS; } @@ -5175,9 +4770,6 @@ e1000_write_eeprom(struct e1000_hw *hw, if(eeprom->use_eewr == TRUE) return e1000_write_eeprom_eewr(hw, offset, words, data); - if (eeprom->type == e1000_eeprom_ich8) - return e1000_write_eeprom_ich8(hw, offset, words, data); - /* Prepare the EEPROM for writing */ if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) return -E1000_ERR_EEPROM; @@ -5365,17 +4957,11 @@ e1000_commit_shadow_ram(struct e1000_hw *hw) uint32_t flop = 0; uint32_t i = 0; int32_t error = E1000_SUCCESS; - uint32_t old_bank_offset = 0; - uint32_t new_bank_offset = 0; - uint32_t sector_retries = 0; - uint8_t low_byte = 0; - uint8_t high_byte = 0; - uint8_t temp_byte = 0; - boolean_t sector_write_failed = FALSE; + + /* The flop register will be used to determine if flash type is STM */ + flop = E1000_READ_REG(hw, FLOP); if (hw->mac_type == e1000_82573) { - /* The flop register will be used to determine if flash type is STM */ - flop = E1000_READ_REG(hw, FLOP); for (i=0; i < attempts; i++) { eecd = E1000_READ_REG(hw, EECD); if ((eecd & E1000_EECD_FLUPD) == 0) { @@ -5409,106 +4995,6 @@ e1000_commit_shadow_ram(struct e1000_hw *hw) } } - if (hw->mac_type == e1000_ich8lan && hw->eeprom_shadow_ram != NULL) { - /* We're writing to the opposite bank so if we're on bank 1, - * write to bank 0 etc. We also need to erase the segment that - * is going to be written */ - if (!(E1000_READ_REG(hw, EECD) & E1000_EECD_SEC1VAL)) { - new_bank_offset = hw->flash_bank_size * 2; - old_bank_offset = 0; - e1000_erase_ich8_4k_segment(hw, 1); - } else { - old_bank_offset = hw->flash_bank_size * 2; - new_bank_offset = 0; - e1000_erase_ich8_4k_segment(hw, 0); - } - - do { - sector_write_failed = FALSE; - /* Loop for every byte in the shadow RAM, - * which is in units of words. */ - for (i = 0; i < E1000_SHADOW_RAM_WORDS; i++) { - /* Determine whether to write the value stored - * in the other NVM bank or a modified value stored - * in the shadow RAM */ - if (hw->eeprom_shadow_ram[i].modified == TRUE) { - low_byte = (uint8_t)hw->eeprom_shadow_ram[i].eeprom_word; - e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset, - &temp_byte); - udelay(100); - error = e1000_verify_write_ich8_byte(hw, - (i << 1) + new_bank_offset, - low_byte); - if (error != E1000_SUCCESS) - sector_write_failed = TRUE; - high_byte = - (uint8_t)(hw->eeprom_shadow_ram[i].eeprom_word >> 8); - e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset + 1, - &temp_byte); - udelay(100); - } else { - e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset, - &low_byte); - udelay(100); - error = e1000_verify_write_ich8_byte(hw, - (i << 1) + new_bank_offset, low_byte); - if (error != E1000_SUCCESS) - sector_write_failed = TRUE; - e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset + 1, - &high_byte); - } - - /* If the word is 0x13, then make sure the signature bits - * (15:14) are 11b until the commit has completed. - * This will allow us to write 10b which indicates the - * signature is valid. We want to do this after the write - * has completed so that we don't mark the segment valid - * while the write is still in progress */ - if (i == E1000_ICH8_NVM_SIG_WORD) - high_byte = E1000_ICH8_NVM_SIG_MASK | high_byte; - - error = e1000_verify_write_ich8_byte(hw, - (i << 1) + new_bank_offset + 1, high_byte); - if (error != E1000_SUCCESS) - sector_write_failed = TRUE; - - if (sector_write_failed == FALSE) { - /* Clear the now not used entry in the cache */ - hw->eeprom_shadow_ram[i].modified = FALSE; - hw->eeprom_shadow_ram[i].eeprom_word = 0xFFFF; - } - } - - /* Don't bother writing the segment valid bits if sector - * programming failed. */ - if (sector_write_failed == FALSE) { - /* Finally validate the new segment by setting bit 15:14 - * to 10b in word 0x13 , this can be done without an - * erase as well since these bits are 11 to start with - * and we need to change bit 14 to 0b */ - e1000_read_ich8_byte(hw, - E1000_ICH8_NVM_SIG_WORD * 2 + 1 + new_bank_offset, - &high_byte); - high_byte &= 0xBF; - error = e1000_verify_write_ich8_byte(hw, - E1000_ICH8_NVM_SIG_WORD * 2 + 1 + new_bank_offset, - high_byte); - if (error != E1000_SUCCESS) - sector_write_failed = TRUE; - - /* And invalidate the previously valid segment by setting - * its signature word (0x13) high_byte to 0b. This can be - * done without an erase because flash erase sets all bits - * to 1's. We can write 1's to 0's without an erase */ - error = e1000_verify_write_ich8_byte(hw, - E1000_ICH8_NVM_SIG_WORD * 2 + 1 + old_bank_offset, - 0); - if (error != E1000_SUCCESS) - sector_write_failed = TRUE; - } - } while (++sector_retries < 10 && sector_write_failed == TRUE); - } - return error; } @@ -5616,19 +5102,15 @@ e1000_init_rx_addrs(struct e1000_hw *hw) * the other port. */ if ((hw->mac_type == e1000_82571) && (hw->laa_is_present == TRUE)) rar_num -= 1; - if (hw->mac_type == e1000_ich8lan) - rar_num = E1000_RAR_ENTRIES_ICH8LAN; - /* Zero out the other 15 receive addresses. */ DEBUGOUT("Clearing RAR[1-15]\n"); for(i = 1; i < rar_num; i++) { E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); - E1000_WRITE_FLUSH(hw); E1000_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); - E1000_WRITE_FLUSH(hw); } } +#if 0 /****************************************************************************** * Updates the MAC's list of multicast addresses. * @@ -5663,8 +5145,6 @@ e1000_mc_addr_list_update(struct e1000_hw *hw, /* Clear RAR[1-15] */ DEBUGOUT(" Clearing RAR[1-15]\n"); num_rar_entry = E1000_RAR_ENTRIES; - if (hw->mac_type == e1000_ich8lan) - num_rar_entry = E1000_RAR_ENTRIES_ICH8LAN; /* Reserve a spot for the Locally Administered Address to work around * an 82571 issue in which a reset on one port will reload the MAC on * the other port. */ @@ -5673,19 +5153,14 @@ e1000_mc_addr_list_update(struct e1000_hw *hw, for(i = rar_used_count; i < num_rar_entry; i++) { E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); - E1000_WRITE_FLUSH(hw); E1000_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); - E1000_WRITE_FLUSH(hw); } /* Clear the MTA */ DEBUGOUT(" Clearing MTA\n"); num_mta_entry = E1000_NUM_MTA_REGISTERS; - if (hw->mac_type == e1000_ich8lan) - num_mta_entry = E1000_NUM_MTA_REGISTERS_ICH8LAN; for(i = 0; i < num_mta_entry; i++) { E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); - E1000_WRITE_FLUSH(hw); } /* Add the new addresses */ @@ -5719,6 +5194,7 @@ e1000_mc_addr_list_update(struct e1000_hw *hw, } DEBUGOUT("MC Update Complete\n"); } +#endif /* 0 */ /****************************************************************************** * Hashes an address to determine its location in the multicast table @@ -5741,46 +5217,24 @@ e1000_hash_mc_addr(struct e1000_hw *hw, * LSB MSB */ case 0: - if (hw->mac_type == e1000_ich8lan) { - /* [47:38] i.e. 0x158 for above example address */ - hash_value = ((mc_addr[4] >> 6) | (((uint16_t) mc_addr[5]) << 2)); - } else { - /* [47:36] i.e. 0x563 for above example address */ - hash_value = ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4)); - } + /* [47:36] i.e. 0x563 for above example address */ + hash_value = ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4)); break; case 1: - if (hw->mac_type == e1000_ich8lan) { - /* [46:37] i.e. 0x2B1 for above example address */ - hash_value = ((mc_addr[4] >> 5) | (((uint16_t) mc_addr[5]) << 3)); - } else { - /* [46:35] i.e. 0xAC6 for above example address */ - hash_value = ((mc_addr[4] >> 3) | (((uint16_t) mc_addr[5]) << 5)); - } + /* [46:35] i.e. 0xAC6 for above example address */ + hash_value = ((mc_addr[4] >> 3) | (((uint16_t) mc_addr[5]) << 5)); break; case 2: - if (hw->mac_type == e1000_ich8lan) { - /*[45:36] i.e. 0x163 for above example address */ - hash_value = ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4)); - } else { - /* [45:34] i.e. 0x5D8 for above example address */ - hash_value = ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6)); - } + /* [45:34] i.e. 0x5D8 for above example address */ + hash_value = ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6)); break; case 3: - if (hw->mac_type == e1000_ich8lan) { - /* [43:34] i.e. 0x18D for above example address */ - hash_value = ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6)); - } else { - /* [43:32] i.e. 0x634 for above example address */ - hash_value = ((mc_addr[4]) | (((uint16_t) mc_addr[5]) << 8)); - } + /* [43:32] i.e. 0x634 for above example address */ + hash_value = ((mc_addr[4]) | (((uint16_t) mc_addr[5]) << 8)); break; } hash_value &= 0xFFF; - if (hw->mac_type == e1000_ich8lan) - hash_value &= 0x3FF; return hash_value; } @@ -5808,8 +5262,6 @@ e1000_mta_set(struct e1000_hw *hw, * register are determined by the lower 5 bits of the value. */ hash_reg = (hash_value >> 5) & 0x7F; - if (hw->mac_type == e1000_ich8lan) - hash_reg &= 0x1F; hash_bit = hash_value & 0x1F; mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg); @@ -5823,12 +5275,9 @@ e1000_mta_set(struct e1000_hw *hw, if((hw->mac_type == e1000_82544) && ((hash_reg & 0x1) == 1)) { temp = E1000_READ_REG_ARRAY(hw, MTA, (hash_reg - 1)); E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta); - E1000_WRITE_FLUSH(hw); E1000_WRITE_REG_ARRAY(hw, MTA, (hash_reg - 1), temp); - E1000_WRITE_FLUSH(hw); } else { E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta); - E1000_WRITE_FLUSH(hw); } } @@ -5885,9 +5334,7 @@ e1000_rar_set(struct e1000_hw *hw, } E1000_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low); - E1000_WRITE_FLUSH(hw); E1000_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high); - E1000_WRITE_FLUSH(hw); } /****************************************************************************** @@ -5904,18 +5351,12 @@ e1000_write_vfta(struct e1000_hw *hw, { uint32_t temp; - if (hw->mac_type == e1000_ich8lan) - return; - - if ((hw->mac_type == e1000_82544) && ((offset & 0x1) == 1)) { + if((hw->mac_type == e1000_82544) && ((offset & 0x1) == 1)) { temp = E1000_READ_REG_ARRAY(hw, VFTA, (offset - 1)); E1000_WRITE_REG_ARRAY(hw, VFTA, offset, value); - E1000_WRITE_FLUSH(hw); E1000_WRITE_REG_ARRAY(hw, VFTA, (offset - 1), temp); - E1000_WRITE_FLUSH(hw); } else { E1000_WRITE_REG_ARRAY(hw, VFTA, offset, value); - E1000_WRITE_FLUSH(hw); } } @@ -5932,9 +5373,6 @@ e1000_clear_vfta(struct e1000_hw *hw) uint32_t vfta_offset = 0; uint32_t vfta_bit_in_reg = 0; - if (hw->mac_type == e1000_ich8lan) - return; - if (hw->mac_type == e1000_82573) { if (hw->mng_cookie.vlan_id != 0) { /* The VFTA is a 4096b bit-field, each identifying a single VLAN @@ -5954,7 +5392,6 @@ e1000_clear_vfta(struct e1000_hw *hw) * manageability unit */ vfta_value = (offset == vfta_offset) ? vfta_bit_in_reg : 0; E1000_WRITE_REG_ARRAY(hw, VFTA, offset, vfta_value); - E1000_WRITE_FLUSH(hw); } } @@ -5984,18 +5421,9 @@ e1000_id_led_init(struct e1000_hw * hw) DEBUGOUT("EEPROM Read Error\n"); return -E1000_ERR_EEPROM; } - - if ((hw->mac_type == e1000_82573) && - (eeprom_data == ID_LED_RESERVED_82573)) - eeprom_data = ID_LED_DEFAULT_82573; - else if ((eeprom_data == ID_LED_RESERVED_0000) || - (eeprom_data == ID_LED_RESERVED_FFFF)) { - if (hw->mac_type == e1000_ich8lan) - eeprom_data = ID_LED_DEFAULT_ICH8LAN; - else - eeprom_data = ID_LED_DEFAULT; - } - for (i = 0; i < 4; i++) { + if((eeprom_data== ID_LED_RESERVED_0000) || + (eeprom_data == ID_LED_RESERVED_FFFF)) eeprom_data = ID_LED_DEFAULT; + for(i = 0; i < 4; i++) { temp = (eeprom_data >> (i << 2)) & led_mask; switch(temp) { case ID_LED_ON1_DEF2: @@ -6090,44 +5518,6 @@ e1000_setup_led(struct e1000_hw *hw) return E1000_SUCCESS; } -/****************************************************************************** - * Used on 82571 and later Si that has LED blink bits. - * Callers must use their own timer and should have already called - * e1000_id_led_init() - * Call e1000_cleanup led() to stop blinking - * - * hw - Struct containing variables accessed by shared code - *****************************************************************************/ -int32_t -e1000_blink_led_start(struct e1000_hw *hw) -{ - int16_t i; - uint32_t ledctl_blink = 0; - - DEBUGFUNC("e1000_id_led_blink_on"); - - if (hw->mac_type < e1000_82571) { - /* Nothing to do */ - return E1000_SUCCESS; - } - if (hw->media_type == e1000_media_type_fiber) { - /* always blink LED0 for PCI-E fiber */ - ledctl_blink = E1000_LEDCTL_LED0_BLINK | - (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT); - } else { - /* set the blink bit for each LED that's "on" (0x0E) in ledctl_mode2 */ - ledctl_blink = hw->ledctl_mode2; - for (i=0; i < 4; i++) - if (((hw->ledctl_mode2 >> (i * 8)) & 0xFF) == - E1000_LEDCTL_MODE_LED_ON) - ledctl_blink |= (E1000_LEDCTL_LED0_BLINK << (i * 8)); - } - - E1000_WRITE_REG(hw, LEDCTL, ledctl_blink); - - return E1000_SUCCESS; -} - /****************************************************************************** * Restores the saved state of the SW controlable LED. * @@ -6158,10 +5548,6 @@ e1000_cleanup_led(struct e1000_hw *hw) return ret_val; /* Fall Through */ default: - if (hw->phy_type == e1000_phy_ife) { - e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0); - break; - } /* Restore LEDCTL settings */ E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_default); break; @@ -6206,10 +5592,7 @@ e1000_led_on(struct e1000_hw *hw) /* Clear SW Defineable Pin 0 to turn on the LED */ ctrl &= ~E1000_CTRL_SWDPIN0; ctrl |= E1000_CTRL_SWDPIO0; - } else if (hw->phy_type == e1000_phy_ife) { - e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL_LED, - (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_ON)); - } else if (hw->media_type == e1000_media_type_copper) { + } else if(hw->media_type == e1000_media_type_copper) { E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode2); return E1000_SUCCESS; } @@ -6257,10 +5640,7 @@ e1000_led_off(struct e1000_hw *hw) /* Set SW Defineable Pin 0 to turn off the LED */ ctrl |= E1000_CTRL_SWDPIN0; ctrl |= E1000_CTRL_SWDPIO0; - } else if (hw->phy_type == e1000_phy_ife) { - e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL_LED, - (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_OFF)); - } else if (hw->media_type == e1000_media_type_copper) { + } else if(hw->media_type == e1000_media_type_copper) { E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode1); return E1000_SUCCESS; } @@ -6298,16 +5678,12 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw) temp = E1000_READ_REG(hw, XOFFRXC); temp = E1000_READ_REG(hw, XOFFTXC); temp = E1000_READ_REG(hw, FCRUC); - - if (hw->mac_type != e1000_ich8lan) { temp = E1000_READ_REG(hw, PRC64); temp = E1000_READ_REG(hw, PRC127); temp = E1000_READ_REG(hw, PRC255); temp = E1000_READ_REG(hw, PRC511); temp = E1000_READ_REG(hw, PRC1023); temp = E1000_READ_REG(hw, PRC1522); - } - temp = E1000_READ_REG(hw, GPRC); temp = E1000_READ_REG(hw, BPRC); temp = E1000_READ_REG(hw, MPRC); @@ -6327,16 +5703,12 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw) temp = E1000_READ_REG(hw, TOTH); temp = E1000_READ_REG(hw, TPR); temp = E1000_READ_REG(hw, TPT); - - if (hw->mac_type != e1000_ich8lan) { temp = E1000_READ_REG(hw, PTC64); temp = E1000_READ_REG(hw, PTC127); temp = E1000_READ_REG(hw, PTC255); temp = E1000_READ_REG(hw, PTC511); temp = E1000_READ_REG(hw, PTC1023); temp = E1000_READ_REG(hw, PTC1522); - } - temp = E1000_READ_REG(hw, MPTC); temp = E1000_READ_REG(hw, BPTC); @@ -6359,9 +5731,6 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw) temp = E1000_READ_REG(hw, IAC); temp = E1000_READ_REG(hw, ICRXOC); - - if (hw->mac_type == e1000_ich8lan) return; - temp = E1000_READ_REG(hw, ICRXPTC); temp = E1000_READ_REG(hw, ICRXATC); temp = E1000_READ_REG(hw, ICTXPTC); @@ -6542,7 +5911,6 @@ e1000_get_bus_info(struct e1000_hw *hw) hw->bus_width = e1000_bus_width_pciex_1; break; case e1000_82571: - case e1000_ich8lan: case e1000_80003es2lan: hw->bus_type = e1000_bus_type_pci_express; hw->bus_speed = e1000_bus_speed_2500; @@ -6580,6 +5948,8 @@ e1000_get_bus_info(struct e1000_hw *hw) break; } } + +#if 0 /****************************************************************************** * Reads a value from one of the devices registers using port I/O (as opposed * memory mapped I/O). Only 82544 and newer devices support port I/O. @@ -6597,6 +5967,7 @@ e1000_read_reg_io(struct e1000_hw *hw, e1000_io_write(hw, io_addr, offset); return e1000_io_read(hw, io_data); } +#endif /* 0 */ /****************************************************************************** * Writes a value to one of the devices registers using port I/O (as opposed to @@ -6641,6 +6012,8 @@ e1000_get_cable_length(struct e1000_hw *hw, { int32_t ret_val; uint16_t agc_value = 0; + uint16_t cur_agc, min_agc = IGP01E1000_AGC_LENGTH_TABLE_SIZE; + uint16_t max_agc = 0; uint16_t i, phy_data; uint16_t cable_length; @@ -6713,8 +6086,6 @@ e1000_get_cable_length(struct e1000_hw *hw, break; } } else if(hw->phy_type == e1000_phy_igp) { /* For IGP PHY */ - uint16_t cur_agc_value; - uint16_t min_agc_value = IGP01E1000_AGC_LENGTH_TABLE_SIZE; uint16_t agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {IGP01E1000_PHY_AGC_A, IGP01E1000_PHY_AGC_B, @@ -6727,23 +6098,23 @@ e1000_get_cable_length(struct e1000_hw *hw, if(ret_val) return ret_val; - cur_agc_value = phy_data >> IGP01E1000_AGC_LENGTH_SHIFT; + cur_agc = phy_data >> IGP01E1000_AGC_LENGTH_SHIFT; - /* Value bound check. */ - if ((cur_agc_value >= IGP01E1000_AGC_LENGTH_TABLE_SIZE - 1) || - (cur_agc_value == 0)) + /* Array bound check. */ + if((cur_agc >= IGP01E1000_AGC_LENGTH_TABLE_SIZE - 1) || + (cur_agc == 0)) return -E1000_ERR_PHY; - agc_value += cur_agc_value; + agc_value += cur_agc; /* Update minimal AGC value. */ - if (min_agc_value > cur_agc_value) - min_agc_value = cur_agc_value; + if(min_agc > cur_agc) + min_agc = cur_agc; } /* Remove the minimal AGC result for length < 50m */ - if (agc_value < IGP01E1000_PHY_CHANNEL_NUM * e1000_igp_cable_length_50) { - agc_value -= min_agc_value; + if(agc_value < IGP01E1000_PHY_CHANNEL_NUM * e1000_igp_cable_length_50) { + agc_value -= min_agc; /* Get the average length of the remaining 3 channels */ agc_value /= (IGP01E1000_PHY_CHANNEL_NUM - 1); @@ -6759,10 +6130,7 @@ e1000_get_cable_length(struct e1000_hw *hw, IGP01E1000_AGC_RANGE) : 0; *max_length = e1000_igp_cable_length_table[agc_value] + IGP01E1000_AGC_RANGE; - } else if (hw->phy_type == e1000_phy_igp_2 || - hw->phy_type == e1000_phy_igp_3) { - uint16_t cur_agc_index, max_agc_index = 0; - uint16_t min_agc_index = IGP02E1000_AGC_LENGTH_TABLE_SIZE - 1; + } else if (hw->phy_type == e1000_phy_igp_2) { uint16_t agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = {IGP02E1000_PHY_AGC_A, IGP02E1000_PHY_AGC_B, @@ -6777,27 +6145,19 @@ e1000_get_cable_length(struct e1000_hw *hw, /* Getting bits 15:9, which represent the combination of course and * fine gain values. The result is a number that can be put into * the lookup table to obtain the approximate cable length. */ - cur_agc_index = (phy_data >> IGP02E1000_AGC_LENGTH_SHIFT) & - IGP02E1000_AGC_LENGTH_MASK; - - /* Array index bound check. */ - if ((cur_agc_index >= IGP02E1000_AGC_LENGTH_TABLE_SIZE) || - (cur_agc_index == 0)) - return -E1000_ERR_PHY; + cur_agc = (phy_data >> IGP02E1000_AGC_LENGTH_SHIFT) & + IGP02E1000_AGC_LENGTH_MASK; /* Remove min & max AGC values from calculation. */ - if (e1000_igp_2_cable_length_table[min_agc_index] > - e1000_igp_2_cable_length_table[cur_agc_index]) - min_agc_index = cur_agc_index; - if (e1000_igp_2_cable_length_table[max_agc_index] < - e1000_igp_2_cable_length_table[cur_agc_index]) - max_agc_index = cur_agc_index; - - agc_value += e1000_igp_2_cable_length_table[cur_agc_index]; + if (e1000_igp_2_cable_length_table[min_agc] > e1000_igp_2_cable_length_table[cur_agc]) + min_agc = cur_agc; + if (e1000_igp_2_cable_length_table[max_agc] < e1000_igp_2_cable_length_table[cur_agc]) + max_agc = cur_agc; + + agc_value += e1000_igp_2_cable_length_table[cur_agc]; } - agc_value -= (e1000_igp_2_cable_length_table[min_agc_index] + - e1000_igp_2_cable_length_table[max_agc_index]); + agc_value -= (e1000_igp_2_cable_length_table[min_agc] + e1000_igp_2_cable_length_table[max_agc]); agc_value /= (IGP02E1000_PHY_CHANNEL_NUM - 2); /* Calculate cable length with the error range of +/- 10 meters. */ @@ -6843,8 +6203,7 @@ e1000_check_polarity(struct e1000_hw *hw, return ret_val; *polarity = (phy_data & M88E1000_PSSR_REV_POLARITY) >> M88E1000_PSSR_REV_POLARITY_SHIFT; - } else if (hw->phy_type == e1000_phy_igp || - hw->phy_type == e1000_phy_igp_3 || + } else if(hw->phy_type == e1000_phy_igp || hw->phy_type == e1000_phy_igp_2) { /* Read the Status register to check the speed */ ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, @@ -6870,13 +6229,6 @@ e1000_check_polarity(struct e1000_hw *hw, * 100 Mbps this bit is always 0) */ *polarity = phy_data & IGP01E1000_PSSR_POLARITY_REVERSED; } - } else if (hw->phy_type == e1000_phy_ife) { - ret_val = e1000_read_phy_reg(hw, IFE_PHY_EXTENDED_STATUS_CONTROL, - &phy_data); - if (ret_val) - return ret_val; - *polarity = (phy_data & IFE_PESC_POLARITY_REVERSED) >> - IFE_PESC_POLARITY_REVERSED_SHIFT; } return E1000_SUCCESS; } @@ -6904,8 +6256,7 @@ e1000_check_downshift(struct e1000_hw *hw) DEBUGFUNC("e1000_check_downshift"); - if (hw->phy_type == e1000_phy_igp || - hw->phy_type == e1000_phy_igp_3 || + if(hw->phy_type == e1000_phy_igp || hw->phy_type == e1000_phy_igp_2) { ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, &phy_data); @@ -6922,9 +6273,6 @@ e1000_check_downshift(struct e1000_hw *hw) hw->speed_downgraded = (phy_data & M88E1000_PSSR_DOWNSHIFT) >> M88E1000_PSSR_DOWNSHIFT_SHIFT; - } else if (hw->phy_type == e1000_phy_ife) { - /* e1000_phy_ife supports 10/100 speed only */ - hw->speed_downgraded = FALSE; } return E1000_SUCCESS; @@ -6969,9 +6317,7 @@ e1000_config_dsp_after_link_change(struct e1000_hw *hw, if(speed == SPEED_1000) { - ret_val = e1000_get_cable_length(hw, &min_length, &max_length); - if (ret_val) - return ret_val; + e1000_get_cable_length(hw, &min_length, &max_length); if((hw->dsp_config_state == e1000_dsp_config_enabled) && min_length >= e1000_igp_cable_length_50) { @@ -7179,27 +6525,20 @@ static int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active) { - uint32_t phy_ctrl = 0; int32_t ret_val; uint16_t phy_data; DEBUGFUNC("e1000_set_d3_lplu_state"); - if (hw->phy_type != e1000_phy_igp && hw->phy_type != e1000_phy_igp_2 - && hw->phy_type != e1000_phy_igp_3) + if(hw->phy_type != e1000_phy_igp && hw->phy_type != e1000_phy_igp_2) return E1000_SUCCESS; /* During driver activity LPLU should not be used or it will attain link * from the lowest speeds starting from 10Mbps. The capability is used for * Dx transitions and states */ - if (hw->mac_type == e1000_82541_rev_2 || hw->mac_type == e1000_82547_rev_2) { + if(hw->mac_type == e1000_82541_rev_2 || hw->mac_type == e1000_82547_rev_2) { ret_val = e1000_read_phy_reg(hw, IGP01E1000_GMII_FIFO, &phy_data); - if (ret_val) + if(ret_val) return ret_val; - } else if (hw->mac_type == e1000_ich8lan) { - /* MAC writes into PHY register based on the state transition - * and start auto-negotiation. SW driver can overwrite the settings - * in CSR PHY power control E1000_PHY_CTRL register. */ - phy_ctrl = E1000_READ_REG(hw, PHY_CTRL); } else { ret_val = e1000_read_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, &phy_data); if(ret_val) @@ -7214,16 +6553,11 @@ e1000_set_d3_lplu_state(struct e1000_hw *hw, if(ret_val) return ret_val; } else { - if (hw->mac_type == e1000_ich8lan) { - phy_ctrl &= ~E1000_PHY_CTRL_NOND0A_LPLU; - E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl); - } else { phy_data &= ~IGP02E1000_PM_D3_LPLU; ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data); if (ret_val) return ret_val; - } } /* LPLU and SmartSpeed are mutually exclusive. LPLU is used during @@ -7259,22 +6593,17 @@ e1000_set_d3_lplu_state(struct e1000_hw *hw, (hw->autoneg_advertised == AUTONEG_ADVERTISE_10_100_ALL)) { if(hw->mac_type == e1000_82541_rev_2 || - hw->mac_type == e1000_82547_rev_2) { + hw->mac_type == e1000_82547_rev_2) { phy_data |= IGP01E1000_GMII_FLEX_SPD; ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, phy_data); if(ret_val) return ret_val; } else { - if (hw->mac_type == e1000_ich8lan) { - phy_ctrl |= E1000_PHY_CTRL_NOND0A_LPLU; - E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl); - } else { phy_data |= IGP02E1000_PM_D3_LPLU; ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data); if (ret_val) return ret_val; - } } /* When LPLU is enabled we should disable SmartSpeed */ @@ -7309,7 +6638,6 @@ static int32_t e1000_set_d0_lplu_state(struct e1000_hw *hw, boolean_t active) { - uint32_t phy_ctrl = 0; int32_t ret_val; uint16_t phy_data; DEBUGFUNC("e1000_set_d0_lplu_state"); @@ -7317,24 +6645,15 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw, if(hw->mac_type <= e1000_82547_rev_2) return E1000_SUCCESS; - if (hw->mac_type == e1000_ich8lan) { - phy_ctrl = E1000_READ_REG(hw, PHY_CTRL); - } else { ret_val = e1000_read_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, &phy_data); if(ret_val) return ret_val; - } if (!active) { - if (hw->mac_type == e1000_ich8lan) { - phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU; - E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl); - } else { phy_data &= ~IGP02E1000_PM_D0_LPLU; ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data); if (ret_val) return ret_val; - } /* LPLU and SmartSpeed are mutually exclusive. LPLU is used during * Dx states where the power conservation is most important. During @@ -7367,15 +6686,10 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw, } else { - if (hw->mac_type == e1000_ich8lan) { - phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU; - E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl); - } else { phy_data |= IGP02E1000_PM_D0_LPLU; ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data); if (ret_val) return ret_val; - } /* When LPLU is enabled we should disable SmartSpeed */ ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &phy_data); @@ -7614,10 +6928,8 @@ e1000_mng_write_cmd_header(struct e1000_hw * hw, length >>= 2; /* The device driver writes the relevant command block into the ram area. */ - for (i = 0; i < length; i++) { + for (i = 0; i < length; i++) E1000_WRITE_REG_ARRAY_DWORD(hw, HOST_IF, i, *((uint32_t *) hdr + i)); - E1000_WRITE_FLUSH(hw); - } return E1000_SUCCESS; } @@ -7649,18 +6961,15 @@ e1000_mng_write_commit( * returns - TRUE when the mode is IAMT or FALSE. ****************************************************************************/ boolean_t -e1000_check_mng_mode(struct e1000_hw *hw) +e1000_check_mng_mode( + struct e1000_hw *hw) { uint32_t fwsm; fwsm = E1000_READ_REG(hw, FWSM); - if (hw->mac_type == e1000_ich8lan) { - if ((fwsm & E1000_FWSM_MODE_MASK) == - (E1000_MNG_ICH_IAMT_MODE << E1000_FWSM_MODE_SHIFT)) - return TRUE; - } else if ((fwsm & E1000_FWSM_MODE_MASK) == - (E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT)) + if((fwsm & E1000_FWSM_MODE_MASK) == + (E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT)) return TRUE; return FALSE; @@ -7900,6 +7209,7 @@ e1000_set_pci_express_master_disable(struct e1000_hw *hw) E1000_WRITE_REG(hw, CTRL, ctrl); } +#if 0 /*************************************************************************** * * Enables PCI-Express master access. @@ -7923,6 +7233,7 @@ e1000_enable_pciex_master(struct e1000_hw *hw) ctrl &= ~E1000_CTRL_GIO_MASTER_DISABLE; E1000_WRITE_REG(hw, CTRL, ctrl); } +#endif /* 0 */ /******************************************************************************* * @@ -7988,10 +7299,8 @@ e1000_get_auto_rd_done(struct e1000_hw *hw) case e1000_82572: case e1000_82573: case e1000_80003es2lan: - case e1000_ich8lan: - while (timeout) { - if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD) - break; + while(timeout) { + if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD) break; else msec_delay(1); timeout--; } @@ -8031,7 +7340,7 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw) switch (hw->mac_type) { default: - msec_delay_irq(10); + msec_delay(10); break; case e1000_80003es2lan: /* Separate *_CFG_DONE_* bit for each port */ @@ -8214,13 +7523,6 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw) { uint32_t manc = 0; - uint32_t fwsm = 0; - - if (hw->mac_type == e1000_ich8lan) { - fwsm = E1000_READ_REG(hw, FWSM); - return (fwsm & E1000_FWSM_RSPCIPHY) ? E1000_SUCCESS - : E1000_BLK_PHY_RESET; - } if (hw->mac_type > e1000_82547_rev_2) manc = E1000_READ_REG(hw, MANC); @@ -8247,8 +7549,6 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw) if((fwsm & E1000_FWSM_MODE_MASK) != 0) return TRUE; break; - case e1000_ich8lan: - return TRUE; default: break; } @@ -8256,846 +7556,4 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw) } -/****************************************************************************** - * Configure PCI-Ex no-snoop - * - * hw - Struct containing variables accessed by shared code. - * no_snoop - Bitmap of no-snoop events. - * - * returns: E1000_SUCCESS - * - *****************************************************************************/ -int32_t -e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, uint32_t no_snoop) -{ - uint32_t gcr_reg = 0; - - DEBUGFUNC("e1000_set_pci_ex_no_snoop"); - - if (hw->bus_type == e1000_bus_type_unknown) - e1000_get_bus_info(hw); - - if (hw->bus_type != e1000_bus_type_pci_express) - return E1000_SUCCESS; - - if (no_snoop) { - gcr_reg = E1000_READ_REG(hw, GCR); - gcr_reg &= ~(PCI_EX_NO_SNOOP_ALL); - gcr_reg |= no_snoop; - E1000_WRITE_REG(hw, GCR, gcr_reg); - } - if (hw->mac_type == e1000_ich8lan) { - uint32_t ctrl_ext; - - E1000_WRITE_REG(hw, GCR, PCI_EX_82566_SNOOP_ALL); - - ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); - ctrl_ext |= E1000_CTRL_EXT_RO_DIS; - E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); - } - - return E1000_SUCCESS; -} - -/*************************************************************************** - * - * Get software semaphore FLAG bit (SWFLAG). - * SWFLAG is used to synchronize the access to all shared resource between - * SW, FW and HW. - * - * hw: Struct containing variables accessed by shared code - * - ***************************************************************************/ -int32_t -e1000_get_software_flag(struct e1000_hw *hw) -{ - int32_t timeout = PHY_CFG_TIMEOUT; - uint32_t extcnf_ctrl; - - DEBUGFUNC("e1000_get_software_flag"); - - if (hw->mac_type == e1000_ich8lan) { - while (timeout) { - extcnf_ctrl = E1000_READ_REG(hw, EXTCNF_CTRL); - extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG; - E1000_WRITE_REG(hw, EXTCNF_CTRL, extcnf_ctrl); - - extcnf_ctrl = E1000_READ_REG(hw, EXTCNF_CTRL); - if (extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG) - break; - msec_delay_irq(1); - timeout--; - } - - if (!timeout) { - DEBUGOUT("FW or HW locks the resource too long.\n"); - return -E1000_ERR_CONFIG; - } - } - - return E1000_SUCCESS; -} - -/*************************************************************************** - * - * Release software semaphore FLAG bit (SWFLAG). - * SWFLAG is used to synchronize the access to all shared resource between - * SW, FW and HW. - * - * hw: Struct containing variables accessed by shared code - * - ***************************************************************************/ -void -e1000_release_software_flag(struct e1000_hw *hw) -{ - uint32_t extcnf_ctrl; - - DEBUGFUNC("e1000_release_software_flag"); - - if (hw->mac_type == e1000_ich8lan) { - extcnf_ctrl= E1000_READ_REG(hw, EXTCNF_CTRL); - extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; - E1000_WRITE_REG(hw, EXTCNF_CTRL, extcnf_ctrl); - } - - return; -} - -/*************************************************************************** - * - * Disable dynamic power down mode in ife PHY. - * It can be used to workaround band-gap problem. - * - * hw: Struct containing variables accessed by shared code - * - ***************************************************************************/ -int32_t -e1000_ife_disable_dynamic_power_down(struct e1000_hw *hw) -{ - uint16_t phy_data; - int32_t ret_val = E1000_SUCCESS; - - DEBUGFUNC("e1000_ife_disable_dynamic_power_down"); - - if (hw->phy_type == e1000_phy_ife) { - ret_val = e1000_read_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, &phy_data); - if (ret_val) - return ret_val; - - phy_data |= IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN; - ret_val = e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, phy_data); - } - - return ret_val; -} - -/*************************************************************************** - * - * Enable dynamic power down mode in ife PHY. - * It can be used to workaround band-gap problem. - * - * hw: Struct containing variables accessed by shared code - * - ***************************************************************************/ -int32_t -e1000_ife_enable_dynamic_power_down(struct e1000_hw *hw) -{ - uint16_t phy_data; - int32_t ret_val = E1000_SUCCESS; - - DEBUGFUNC("e1000_ife_enable_dynamic_power_down"); - - if (hw->phy_type == e1000_phy_ife) { - ret_val = e1000_read_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, &phy_data); - if (ret_val) - return ret_val; - - phy_data &= ~IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN; - ret_val = e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, phy_data); - } - - return ret_val; -} - -/****************************************************************************** - * Reads a 16 bit word or words from the EEPROM using the ICH8's flash access - * register. - * - * hw - Struct containing variables accessed by shared code - * offset - offset of word in the EEPROM to read - * data - word read from the EEPROM - * words - number of words to read - *****************************************************************************/ -int32_t -e1000_read_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, uint16_t words, - uint16_t *data) -{ - int32_t error = E1000_SUCCESS; - uint32_t flash_bank = 0; - uint32_t act_offset = 0; - uint32_t bank_offset = 0; - uint16_t word = 0; - uint16_t i = 0; - - /* We need to know which is the valid flash bank. In the event - * that we didn't allocate eeprom_shadow_ram, we may not be - * managing flash_bank. So it cannot be trusted and needs - * to be updated with each read. - */ - /* Value of bit 22 corresponds to the flash bank we're on. */ - flash_bank = (E1000_READ_REG(hw, EECD) & E1000_EECD_SEC1VAL) ? 1 : 0; - - /* Adjust offset appropriately if we're on bank 1 - adjust for word size */ - bank_offset = flash_bank * (hw->flash_bank_size * 2); - - error = e1000_get_software_flag(hw); - if (error != E1000_SUCCESS) - return error; - - for (i = 0; i < words; i++) { - if (hw->eeprom_shadow_ram != NULL && - hw->eeprom_shadow_ram[offset+i].modified == TRUE) { - data[i] = hw->eeprom_shadow_ram[offset+i].eeprom_word; - } else { - /* The NVM part needs a byte offset, hence * 2 */ - act_offset = bank_offset + ((offset + i) * 2); - error = e1000_read_ich8_word(hw, act_offset, &word); - if (error != E1000_SUCCESS) - break; - data[i] = word; - } - } - - e1000_release_software_flag(hw); - - return error; -} - -/****************************************************************************** - * Writes a 16 bit word or words to the EEPROM using the ICH8's flash access - * register. Actually, writes are written to the shadow ram cache in the hw - * structure hw->e1000_shadow_ram. e1000_commit_shadow_ram flushes this to - * the NVM, which occurs when the NVM checksum is updated. - * - * hw - Struct containing variables accessed by shared code - * offset - offset of word in the EEPROM to write - * words - number of words to write - * data - words to write to the EEPROM - *****************************************************************************/ -int32_t -e1000_write_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, uint16_t words, - uint16_t *data) -{ - uint32_t i = 0; - int32_t error = E1000_SUCCESS; - - error = e1000_get_software_flag(hw); - if (error != E1000_SUCCESS) - return error; - - /* A driver can write to the NVM only if it has eeprom_shadow_ram - * allocated. Subsequent reads to the modified words are read from - * this cached structure as well. Writes will only go into this - * cached structure unless it's followed by a call to - * e1000_update_eeprom_checksum() where it will commit the changes - * and clear the "modified" field. - */ - if (hw->eeprom_shadow_ram != NULL) { - for (i = 0; i < words; i++) { - if ((offset + i) < E1000_SHADOW_RAM_WORDS) { - hw->eeprom_shadow_ram[offset+i].modified = TRUE; - hw->eeprom_shadow_ram[offset+i].eeprom_word = data[i]; - } else { - error = -E1000_ERR_EEPROM; - break; - } - } - } else { - /* Drivers have the option to not allocate eeprom_shadow_ram as long - * as they don't perform any NVM writes. An attempt in doing so - * will result in this error. - */ - error = -E1000_ERR_EEPROM; - } - - e1000_release_software_flag(hw); - - return error; -} - -/****************************************************************************** - * This function does initial flash setup so that a new read/write/erase cycle - * can be started. - * - * hw - The pointer to the hw structure - ****************************************************************************/ -int32_t -e1000_ich8_cycle_init(struct e1000_hw *hw) -{ - union ich8_hws_flash_status hsfsts; - int32_t error = E1000_ERR_EEPROM; - int32_t i = 0; - - DEBUGFUNC("e1000_ich8_cycle_init"); - - hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS); - - /* May be check the Flash Des Valid bit in Hw status */ - if (hsfsts.hsf_status.fldesvalid == 0) { - DEBUGOUT("Flash descriptor invalid. SW Sequencing must be used."); - return error; - } - - /* Clear FCERR in Hw status by writing 1 */ - /* Clear DAEL in Hw status by writing a 1 */ - hsfsts.hsf_status.flcerr = 1; - hsfsts.hsf_status.dael = 1; - - E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFSTS, hsfsts.regval); - - /* Either we should have a hardware SPI cycle in progress bit to check - * against, in order to start a new cycle or FDONE bit should be changed - * in the hardware so that it is 1 after harware reset, which can then be - * used as an indication whether a cycle is in progress or has been - * completed .. we should also have some software semaphore mechanism to - * guard FDONE or the cycle in progress bit so that two threads access to - * those bits can be sequentiallized or a way so that 2 threads dont - * start the cycle at the same time */ - - if (hsfsts.hsf_status.flcinprog == 0) { - /* There is no cycle running at present, so we can start a cycle */ - /* Begin by setting Flash Cycle Done. */ - hsfsts.hsf_status.flcdone = 1; - E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFSTS, hsfsts.regval); - error = E1000_SUCCESS; - } else { - /* otherwise poll for sometime so the current cycle has a chance - * to end before giving up. */ - for (i = 0; i < ICH8_FLASH_COMMAND_TIMEOUT; i++) { - hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS); - if (hsfsts.hsf_status.flcinprog == 0) { - error = E1000_SUCCESS; - break; - } - udelay(1); - } - if (error == E1000_SUCCESS) { - /* Successful in waiting for previous cycle to timeout, - * now set the Flash Cycle Done. */ - hsfsts.hsf_status.flcdone = 1; - E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFSTS, hsfsts.regval); - } else { - DEBUGOUT("Flash controller busy, cannot get access"); - } - } - return error; -} - -/****************************************************************************** - * This function starts a flash cycle and waits for its completion - * - * hw - The pointer to the hw structure - ****************************************************************************/ -int32_t -e1000_ich8_flash_cycle(struct e1000_hw *hw, uint32_t timeout) -{ - union ich8_hws_flash_ctrl hsflctl; - union ich8_hws_flash_status hsfsts; - int32_t error = E1000_ERR_EEPROM; - uint32_t i = 0; - - /* Start a cycle by writing 1 in Flash Cycle Go in Hw Flash Control */ - hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL); - hsflctl.hsf_ctrl.flcgo = 1; - E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval); - - /* wait till FDONE bit is set to 1 */ - do { - hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS); - if (hsfsts.hsf_status.flcdone == 1) - break; - udelay(1); - i++; - } while (i < timeout); - if (hsfsts.hsf_status.flcdone == 1 && hsfsts.hsf_status.flcerr == 0) { - error = E1000_SUCCESS; - } - return error; -} - -/****************************************************************************** - * Reads a byte or word from the NVM using the ICH8 flash access registers. - * - * hw - The pointer to the hw structure - * index - The index of the byte or word to read. - * size - Size of data to read, 1=byte 2=word - * data - Pointer to the word to store the value read. - *****************************************************************************/ -int32_t -e1000_read_ich8_data(struct e1000_hw *hw, uint32_t index, - uint32_t size, uint16_t* data) -{ - union ich8_hws_flash_status hsfsts; - union ich8_hws_flash_ctrl hsflctl; - uint32_t flash_linear_address; - uint32_t flash_data = 0; - int32_t error = -E1000_ERR_EEPROM; - int32_t count = 0; - - DEBUGFUNC("e1000_read_ich8_data"); - - if (size < 1 || size > 2 || data == 0x0 || - index > ICH8_FLASH_LINEAR_ADDR_MASK) - return error; - - flash_linear_address = (ICH8_FLASH_LINEAR_ADDR_MASK & index) + - hw->flash_base_addr; - - do { - udelay(1); - /* Steps */ - error = e1000_ich8_cycle_init(hw); - if (error != E1000_SUCCESS) - break; - - hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL); - /* 0b/1b corresponds to 1 or 2 byte size, respectively. */ - hsflctl.hsf_ctrl.fldbcount = size - 1; - hsflctl.hsf_ctrl.flcycle = ICH8_CYCLE_READ; - E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval); - - /* Write the last 24 bits of index into Flash Linear address field in - * Flash Address */ - /* TODO: TBD maybe check the index against the size of flash */ - - E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FADDR, flash_linear_address); - - error = e1000_ich8_flash_cycle(hw, ICH8_FLASH_COMMAND_TIMEOUT); - - /* Check if FCERR is set to 1, if set to 1, clear it and try the whole - * sequence a few more times, else read in (shift in) the Flash Data0, - * the order is least significant byte first msb to lsb */ - if (error == E1000_SUCCESS) { - flash_data = E1000_READ_ICH8_REG(hw, ICH8_FLASH_FDATA0); - if (size == 1) { - *data = (uint8_t)(flash_data & 0x000000FF); - } else if (size == 2) { - *data = (uint16_t)(flash_data & 0x0000FFFF); - } - break; - } else { - /* If we've gotten here, then things are probably completely hosed, - * but if the error condition is detected, it won't hurt to give - * it another try...ICH8_FLASH_CYCLE_REPEAT_COUNT times. - */ - hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS); - if (hsfsts.hsf_status.flcerr == 1) { - /* Repeat for some time before giving up. */ - continue; - } else if (hsfsts.hsf_status.flcdone == 0) { - DEBUGOUT("Timeout error - flash cycle did not complete."); - break; - } - } - } while (count++ < ICH8_FLASH_CYCLE_REPEAT_COUNT); - - return error; -} - -/****************************************************************************** - * Writes One /two bytes to the NVM using the ICH8 flash access registers. - * - * hw - The pointer to the hw structure - * index - The index of the byte/word to read. - * size - Size of data to read, 1=byte 2=word - * data - The byte(s) to write to the NVM. - *****************************************************************************/ -int32_t -e1000_write_ich8_data(struct e1000_hw *hw, uint32_t index, uint32_t size, - uint16_t data) -{ - union ich8_hws_flash_status hsfsts; - union ich8_hws_flash_ctrl hsflctl; - uint32_t flash_linear_address; - uint32_t flash_data = 0; - int32_t error = -E1000_ERR_EEPROM; - int32_t count = 0; - - DEBUGFUNC("e1000_write_ich8_data"); - - if (size < 1 || size > 2 || data > size * 0xff || - index > ICH8_FLASH_LINEAR_ADDR_MASK) - return error; - - flash_linear_address = (ICH8_FLASH_LINEAR_ADDR_MASK & index) + - hw->flash_base_addr; - - do { - udelay(1); - /* Steps */ - error = e1000_ich8_cycle_init(hw); - if (error != E1000_SUCCESS) - break; - - hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL); - /* 0b/1b corresponds to 1 or 2 byte size, respectively. */ - hsflctl.hsf_ctrl.fldbcount = size -1; - hsflctl.hsf_ctrl.flcycle = ICH8_CYCLE_WRITE; - E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval); - - /* Write the last 24 bits of index into Flash Linear address field in - * Flash Address */ - E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FADDR, flash_linear_address); - - if (size == 1) - flash_data = (uint32_t)data & 0x00FF; - else - flash_data = (uint32_t)data; - - E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FDATA0, flash_data); - - /* check if FCERR is set to 1 , if set to 1, clear it and try the whole - * sequence a few more times else done */ - error = e1000_ich8_flash_cycle(hw, ICH8_FLASH_COMMAND_TIMEOUT); - if (error == E1000_SUCCESS) { - break; - } else { - /* If we're here, then things are most likely completely hosed, - * but if the error condition is detected, it won't hurt to give - * it another try...ICH8_FLASH_CYCLE_REPEAT_COUNT times. - */ - hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS); - if (hsfsts.hsf_status.flcerr == 1) { - /* Repeat for some time before giving up. */ - continue; - } else if (hsfsts.hsf_status.flcdone == 0) { - DEBUGOUT("Timeout error - flash cycle did not complete."); - break; - } - } - } while (count++ < ICH8_FLASH_CYCLE_REPEAT_COUNT); - - return error; -} - -/****************************************************************************** - * Reads a single byte from the NVM using the ICH8 flash access registers. - * - * hw - pointer to e1000_hw structure - * index - The index of the byte to read. - * data - Pointer to a byte to store the value read. - *****************************************************************************/ -int32_t -e1000_read_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t* data) -{ - int32_t status = E1000_SUCCESS; - uint16_t word = 0; - - status = e1000_read_ich8_data(hw, index, 1, &word); - if (status == E1000_SUCCESS) { - *data = (uint8_t)word; - } - - return status; -} - -/****************************************************************************** - * Writes a single byte to the NVM using the ICH8 flash access registers. - * Performs verification by reading back the value and then going through - * a retry algorithm before giving up. - * - * hw - pointer to e1000_hw structure - * index - The index of the byte to write. - * byte - The byte to write to the NVM. - *****************************************************************************/ -int32_t -e1000_verify_write_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t byte) -{ - int32_t error = E1000_SUCCESS; - int32_t program_retries; - uint8_t temp_byte; - - e1000_write_ich8_byte(hw, index, byte); - udelay(100); - - for (program_retries = 0; program_retries < 100; program_retries++) { - e1000_read_ich8_byte(hw, index, &temp_byte); - if (temp_byte == byte) - break; - udelay(10); - e1000_write_ich8_byte(hw, index, byte); - udelay(100); - } - if (program_retries == 100) - error = E1000_ERR_EEPROM; - - return error; -} - -/****************************************************************************** - * Writes a single byte to the NVM using the ICH8 flash access registers. - * - * hw - pointer to e1000_hw structure - * index - The index of the byte to read. - * data - The byte to write to the NVM. - *****************************************************************************/ -int32_t -e1000_write_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t data) -{ - int32_t status = E1000_SUCCESS; - uint16_t word = (uint16_t)data; - - status = e1000_write_ich8_data(hw, index, 1, word); - - return status; -} - -/****************************************************************************** - * Reads a word from the NVM using the ICH8 flash access registers. - * - * hw - pointer to e1000_hw structure - * index - The starting byte index of the word to read. - * data - Pointer to a word to store the value read. - *****************************************************************************/ -int32_t -e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index, uint16_t *data) -{ - int32_t status = E1000_SUCCESS; - status = e1000_read_ich8_data(hw, index, 2, data); - return status; -} - -/****************************************************************************** - * Writes a word to the NVM using the ICH8 flash access registers. - * - * hw - pointer to e1000_hw structure - * index - The starting byte index of the word to read. - * data - The word to write to the NVM. - *****************************************************************************/ -int32_t -e1000_write_ich8_word(struct e1000_hw *hw, uint32_t index, uint16_t data) -{ - int32_t status = E1000_SUCCESS; - status = e1000_write_ich8_data(hw, index, 2, data); - return status; -} - -/****************************************************************************** - * Erases the bank specified. Each bank is a 4k block. Segments are 0 based. - * segment N is 4096 * N + flash_reg_addr. - * - * hw - pointer to e1000_hw structure - * segment - 0 for first segment, 1 for second segment, etc. - *****************************************************************************/ -int32_t -e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment) -{ - union ich8_hws_flash_status hsfsts; - union ich8_hws_flash_ctrl hsflctl; - uint32_t flash_linear_address; - int32_t count = 0; - int32_t error = E1000_ERR_EEPROM; - int32_t iteration, seg_size; - int32_t sector_size; - int32_t j = 0; - int32_t error_flag = 0; - - hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS); - - /* Determine HW Sector size: Read BERASE bits of Hw flash Status register */ - /* 00: The Hw sector is 256 bytes, hence we need to erase 16 - * consecutive sectors. The start index for the nth Hw sector can be - * calculated as = segment * 4096 + n * 256 - * 01: The Hw sector is 4K bytes, hence we need to erase 1 sector. - * The start index for the nth Hw sector can be calculated - * as = segment * 4096 - * 10: Error condition - * 11: The Hw sector size is much bigger than the size asked to - * erase...error condition */ - if (hsfsts.hsf_status.berasesz == 0x0) { - /* Hw sector size 256 */ - sector_size = seg_size = ICH8_FLASH_SEG_SIZE_256; - iteration = ICH8_FLASH_SECTOR_SIZE / ICH8_FLASH_SEG_SIZE_256; - } else if (hsfsts.hsf_status.berasesz == 0x1) { - sector_size = seg_size = ICH8_FLASH_SEG_SIZE_4K; - iteration = 1; - } else if (hsfsts.hsf_status.berasesz == 0x3) { - sector_size = seg_size = ICH8_FLASH_SEG_SIZE_64K; - iteration = 1; - } else { - return error; - } - - for (j = 0; j < iteration ; j++) { - do { - count++; - /* Steps */ - error = e1000_ich8_cycle_init(hw); - if (error != E1000_SUCCESS) { - error_flag = 1; - break; - } - - /* Write a value 11 (block Erase) in Flash Cycle field in Hw flash - * Control */ - hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL); - hsflctl.hsf_ctrl.flcycle = ICH8_CYCLE_ERASE; - E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval); - - /* Write the last 24 bits of an index within the block into Flash - * Linear address field in Flash Address. This probably needs to - * be calculated here based off the on-chip segment size and the - * software segment size assumed (4K) */ - /* TBD */ - flash_linear_address = segment * sector_size + j * seg_size; - flash_linear_address &= ICH8_FLASH_LINEAR_ADDR_MASK; - flash_linear_address += hw->flash_base_addr; - - E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FADDR, flash_linear_address); - - error = e1000_ich8_flash_cycle(hw, 1000000); - /* Check if FCERR is set to 1. If 1, clear it and try the whole - * sequence a few more times else Done */ - if (error == E1000_SUCCESS) { - break; - } else { - hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS); - if (hsfsts.hsf_status.flcerr == 1) { - /* repeat for some time before giving up */ - continue; - } else if (hsfsts.hsf_status.flcdone == 0) { - error_flag = 1; - break; - } - } - } while ((count < ICH8_FLASH_CYCLE_REPEAT_COUNT) && !error_flag); - if (error_flag == 1) - break; - } - if (error_flag != 1) - error = E1000_SUCCESS; - return error; -} - -/****************************************************************************** - * - * Reverse duplex setting without breaking the link. - * - * hw: Struct containing variables accessed by shared code - * - *****************************************************************************/ -int32_t -e1000_duplex_reversal(struct e1000_hw *hw) -{ - int32_t ret_val; - uint16_t phy_data; - - if (hw->phy_type != e1000_phy_igp_3) - return E1000_SUCCESS; - - ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data); - if (ret_val) - return ret_val; - - phy_data ^= MII_CR_FULL_DUPLEX; - - ret_val = e1000_write_phy_reg(hw, PHY_CTRL, phy_data); - if (ret_val) - return ret_val; - - ret_val = e1000_read_phy_reg(hw, IGP3E1000_PHY_MISC_CTRL, &phy_data); - if (ret_val) - return ret_val; - - phy_data |= IGP3_PHY_MISC_DUPLEX_MANUAL_SET; - ret_val = e1000_write_phy_reg(hw, IGP3E1000_PHY_MISC_CTRL, phy_data); - - return ret_val; -} - -int32_t -e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, - uint32_t cnf_base_addr, uint32_t cnf_size) -{ - uint32_t ret_val = E1000_SUCCESS; - uint16_t word_addr, reg_data, reg_addr; - uint16_t i; - - /* cnf_base_addr is in DWORD */ - word_addr = (uint16_t)(cnf_base_addr << 1); - - /* cnf_size is returned in size of dwords */ - for (i = 0; i < cnf_size; i++) { - ret_val = e1000_read_eeprom(hw, (word_addr + i*2), 1, ®_data); - if (ret_val) - return ret_val; - - ret_val = e1000_read_eeprom(hw, (word_addr + i*2 + 1), 1, ®_addr); - if (ret_val) - return ret_val; - - ret_val = e1000_get_software_flag(hw); - if (ret_val != E1000_SUCCESS) - return ret_val; - - ret_val = e1000_write_phy_reg_ex(hw, (uint32_t)reg_addr, reg_data); - - e1000_release_software_flag(hw); - } - - return ret_val; -} - - -int32_t -e1000_init_lcd_from_nvm(struct e1000_hw *hw) -{ - uint32_t reg_data, cnf_base_addr, cnf_size, ret_val, loop; - - if (hw->phy_type != e1000_phy_igp_3) - return E1000_SUCCESS; - - /* Check if SW needs configure the PHY */ - reg_data = E1000_READ_REG(hw, FEXTNVM); - if (!(reg_data & FEXTNVM_SW_CONFIG)) - return E1000_SUCCESS; - - /* Wait for basic configuration completes before proceeding*/ - loop = 0; - do { - reg_data = E1000_READ_REG(hw, STATUS) & E1000_STATUS_LAN_INIT_DONE; - udelay(100); - loop++; - } while ((!reg_data) && (loop < 50)); - - /* Clear the Init Done bit for the next init event */ - reg_data = E1000_READ_REG(hw, STATUS); - reg_data &= ~E1000_STATUS_LAN_INIT_DONE; - E1000_WRITE_REG(hw, STATUS, reg_data); - - /* Make sure HW does not configure LCD from PHY extended configuration - before SW configuration */ - reg_data = E1000_READ_REG(hw, EXTCNF_CTRL); - if ((reg_data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) == 0x0000) { - reg_data = E1000_READ_REG(hw, EXTCNF_SIZE); - cnf_size = reg_data & E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH; - cnf_size >>= 16; - if (cnf_size) { - reg_data = E1000_READ_REG(hw, EXTCNF_CTRL); - cnf_base_addr = reg_data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER; - /* cnf_base_addr is in DWORD */ - cnf_base_addr >>= 16; - - /* Configure LCD from extended configuration region. */ - ret_val = e1000_init_lcd_from_nvm_config_region(hw, cnf_base_addr, - cnf_size); - if (ret_val) - return ret_val; - } - } - - return E1000_SUCCESS; -} - - diff --git a/trunk/drivers/net/e1000/e1000_hw.h b/trunk/drivers/net/e1000/e1000_hw.h index f9341e3276b3..467c9ed944f8 100644 --- a/trunk/drivers/net/e1000/e1000_hw.h +++ b/trunk/drivers/net/e1000/e1000_hw.h @@ -62,7 +62,6 @@ typedef enum { e1000_82572, e1000_82573, e1000_80003es2lan, - e1000_ich8lan, e1000_num_macs } e1000_mac_type; @@ -71,7 +70,6 @@ typedef enum { e1000_eeprom_spi, e1000_eeprom_microwire, e1000_eeprom_flash, - e1000_eeprom_ich8, e1000_eeprom_none, /* No NVM support */ e1000_num_eeprom_types } e1000_eeprom_type; @@ -100,11 +98,6 @@ typedef enum { e1000_fc_default = 0xFF } e1000_fc_type; -struct e1000_shadow_ram { - uint16_t eeprom_word; - boolean_t modified; -}; - /* PCI bus types */ typedef enum { e1000_bus_type_unknown = 0, @@ -225,8 +218,6 @@ typedef enum { e1000_phy_igp, e1000_phy_igp_2, e1000_phy_gg82563, - e1000_phy_igp_3, - e1000_phy_ife, e1000_phy_undefined = 0xFF } e1000_phy_type; @@ -322,10 +313,6 @@ int32_t e1000_read_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *phy int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t data); int32_t e1000_phy_hw_reset(struct e1000_hw *hw); int32_t e1000_phy_reset(struct e1000_hw *hw); -void e1000_phy_powerdown_workaround(struct e1000_hw *hw); -int32_t e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw); -int32_t e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, uint32_t cnf_base_addr, uint32_t cnf_size); -int32_t e1000_init_lcd_from_nvm(struct e1000_hw *hw); int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); int32_t e1000_validate_mdi_setting(struct e1000_hw *hw); int32_t e1000_read_kmrn_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *data); @@ -344,7 +331,6 @@ uint32_t e1000_enable_mng_pass_thru(struct e1000_hw *hw); #define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0 /* Cookie offset */ #define E1000_MNG_DHCP_COOKIE_LENGTH 0x10 /* Cookie length */ #define E1000_MNG_IAMT_MODE 0x3 -#define E1000_MNG_ICH_IAMT_MODE 0x2 #define E1000_IAMT_SIGNATURE 0x544D4149 /* Intel(R) Active Management Technology signature */ #define E1000_MNG_DHCP_COOKIE_STATUS_PARSING_SUPPORT 0x1 /* DHCP parsing enabled */ @@ -402,8 +388,6 @@ int32_t e1000_read_part_num(struct e1000_hw *hw, uint32_t * part_num); int32_t e1000_read_mac_addr(struct e1000_hw * hw); int32_t e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask); void e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask); -void e1000_release_software_flag(struct e1000_hw *hw); -int32_t e1000_get_software_flag(struct e1000_hw *hw); /* Filters (multicast, vlan, receive) */ void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad, uint32_t rar_used_count); @@ -417,7 +401,6 @@ int32_t e1000_setup_led(struct e1000_hw *hw); int32_t e1000_cleanup_led(struct e1000_hw *hw); int32_t e1000_led_on(struct e1000_hw *hw); int32_t e1000_led_off(struct e1000_hw *hw); -int32_t e1000_blink_led_start(struct e1000_hw *hw); /* Adaptive IFS Functions */ @@ -439,29 +422,6 @@ int32_t e1000_disable_pciex_master(struct e1000_hw *hw); int32_t e1000_get_software_semaphore(struct e1000_hw *hw); void e1000_release_software_semaphore(struct e1000_hw *hw); int32_t e1000_check_phy_reset_block(struct e1000_hw *hw); -int32_t e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, uint32_t no_snoop); - -int32_t e1000_read_ich8_byte(struct e1000_hw *hw, uint32_t index, - uint8_t *data); -int32_t e1000_verify_write_ich8_byte(struct e1000_hw *hw, uint32_t index, - uint8_t byte); -int32_t e1000_write_ich8_byte(struct e1000_hw *hw, uint32_t index, - uint8_t byte); -int32_t e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index, - uint16_t *data); -int32_t e1000_read_ich8_data(struct e1000_hw *hw, uint32_t index, - uint32_t size, uint16_t *data); -int32_t e1000_read_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, - uint16_t words, uint16_t *data); -int32_t e1000_write_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, - uint16_t words, uint16_t *data); -int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment); - - -#define E1000_READ_REG_IO(a, reg) \ - e1000_read_reg_io((a), E1000_##reg) -#define E1000_WRITE_REG_IO(a, reg, val) \ - e1000_write_reg_io((a), E1000_##reg, val) /* PCI Device IDs */ #define E1000_DEV_ID_82542 0x1000 @@ -486,7 +446,6 @@ int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment); #define E1000_DEV_ID_82546EB_QUAD_COPPER 0x101D #define E1000_DEV_ID_82541EI 0x1013 #define E1000_DEV_ID_82541EI_MOBILE 0x1018 -#define E1000_DEV_ID_82541ER_LOM 0x1014 #define E1000_DEV_ID_82541ER 0x1078 #define E1000_DEV_ID_82547GI 0x1075 #define E1000_DEV_ID_82541GI 0x1076 @@ -498,28 +457,18 @@ int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment); #define E1000_DEV_ID_82546GB_PCIE 0x108A #define E1000_DEV_ID_82546GB_QUAD_COPPER 0x1099 #define E1000_DEV_ID_82547EI 0x1019 -#define E1000_DEV_ID_82547EI_MOBILE 0x101A #define E1000_DEV_ID_82571EB_COPPER 0x105E #define E1000_DEV_ID_82571EB_FIBER 0x105F #define E1000_DEV_ID_82571EB_SERDES 0x1060 #define E1000_DEV_ID_82572EI_COPPER 0x107D #define E1000_DEV_ID_82572EI_FIBER 0x107E #define E1000_DEV_ID_82572EI_SERDES 0x107F -#define E1000_DEV_ID_82572EI 0x10B9 #define E1000_DEV_ID_82573E 0x108B #define E1000_DEV_ID_82573E_IAMT 0x108C #define E1000_DEV_ID_82573L 0x109A #define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5 #define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096 #define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098 -#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT 0x10BA -#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT 0x10BB - -#define E1000_DEV_ID_ICH8_IGP_M_AMT 0x1049 -#define E1000_DEV_ID_ICH8_IGP_AMT 0x104A -#define E1000_DEV_ID_ICH8_IGP_C 0x104B -#define E1000_DEV_ID_ICH8_IFE 0x104C -#define E1000_DEV_ID_ICH8_IGP_M 0x104D #define NODE_ADDRESS_SIZE 6 @@ -590,14 +539,6 @@ int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment); E1000_IMS_RXSEQ | \ E1000_IMS_LSC) -/* Additional interrupts need to be handled for e1000_ich8lan: - DSW = The FW changed the status of the DISSW bit in FWSM - PHYINT = The LAN connected device generates an interrupt - EPRST = Manageability reset event */ -#define IMS_ICH8LAN_ENABLE_MASK (\ - E1000_IMS_DSW | \ - E1000_IMS_PHYINT | \ - E1000_IMS_EPRST) /* Number of high/low register pairs in the RAR. The RAR (Receive Address * Registers) holds the directed and multicast addresses that we monitor. We @@ -605,7 +546,6 @@ int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment); * E1000_RAR_ENTRIES - 1 multicast addresses. */ #define E1000_RAR_ENTRIES 15 -#define E1000_RAR_ENTRIES_ICH8LAN 7 #define MIN_NUMBER_OF_DESCRIPTORS 8 #define MAX_NUMBER_OF_DESCRIPTORS 0xFFF8 @@ -827,9 +767,6 @@ struct e1000_data_desc { #define E1000_MC_TBL_SIZE 128 /* Multicast Filter Table (4096 bits) */ #define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */ -#define E1000_NUM_UNICAST_ICH8LAN 7 -#define E1000_MC_TBL_SIZE_ICH8LAN 32 - /* Receive Address Register */ struct e1000_rar { @@ -839,7 +776,6 @@ struct e1000_rar { /* Number of entries in the Multicast Table Array (MTA). */ #define E1000_NUM_MTA_REGISTERS 128 -#define E1000_NUM_MTA_REGISTERS_ICH8LAN 32 /* IPv4 Address Table Entry */ struct e1000_ipv4_at_entry { @@ -850,7 +786,6 @@ struct e1000_ipv4_at_entry { /* Four wakeup IP addresses are supported */ #define E1000_WAKEUP_IP_ADDRESS_COUNT_MAX 4 #define E1000_IP4AT_SIZE E1000_WAKEUP_IP_ADDRESS_COUNT_MAX -#define E1000_IP4AT_SIZE_ICH8LAN 3 #define E1000_IP6AT_SIZE 1 /* IPv6 Address Table Entry */ @@ -909,7 +844,6 @@ struct e1000_ffvt_entry { #define E1000_FLA 0x0001C /* Flash Access - RW */ #define E1000_MDIC 0x00020 /* MDI Control - RW */ #define E1000_SCTL 0x00024 /* SerDes Control - RW */ -#define E1000_FEXTNVM 0x00028 /* Future Extended NVM register */ #define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */ #define E1000_FCAH 0x0002C /* Flow Control Address High -RW */ #define E1000_FCT 0x00030 /* Flow Control Type - RW */ @@ -938,8 +872,6 @@ struct e1000_ffvt_entry { #define E1000_LEDCTL 0x00E00 /* LED Control - RW */ #define E1000_EXTCNF_CTRL 0x00F00 /* Extended Configuration Control */ #define E1000_EXTCNF_SIZE 0x00F08 /* Extended Configuration Size */ -#define E1000_PHY_CTRL 0x00F10 /* PHY Control Register in CSR */ -#define FEXTNVM_SW_CONFIG 0x0001 #define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */ #define E1000_PBS 0x01008 /* Packet Buffer Size */ #define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */ @@ -967,13 +899,11 @@ struct e1000_ffvt_entry { #define E1000_RDH0 E1000_RDH /* RX Desc Head (0) - RW */ #define E1000_RDT0 E1000_RDT /* RX Desc Tail (0) - RW */ #define E1000_RDTR0 E1000_RDTR /* RX Delay Timer (0) - RW */ -#define E1000_RXDCTL 0x02828 /* RX Descriptor Control queue 0 - RW */ -#define E1000_RXDCTL1 0x02928 /* RX Descriptor Control queue 1 - RW */ +#define E1000_RXDCTL 0x02828 /* RX Descriptor Control - RW */ #define E1000_RADV 0x0282C /* RX Interrupt Absolute Delay Timer - RW */ #define E1000_RSRPD 0x02C00 /* RX Small Packet Detect - RW */ #define E1000_RAID 0x02C08 /* Receive Ack Interrupt Delay - RW */ #define E1000_TXDMAC 0x03000 /* TX DMA Control - RW */ -#define E1000_KABGTXD 0x03004 /* AFE Band Gap Transmit Ref Data */ #define E1000_TDFH 0x03410 /* TX Data FIFO Head - RW */ #define E1000_TDFT 0x03418 /* TX Data FIFO Tail - RW */ #define E1000_TDFHS 0x03420 /* TX Data FIFO Head Saved - RW */ @@ -1120,7 +1050,6 @@ struct e1000_ffvt_entry { #define E1000_82542_FLA E1000_FLA #define E1000_82542_MDIC E1000_MDIC #define E1000_82542_SCTL E1000_SCTL -#define E1000_82542_FEXTNVM E1000_FEXTNVM #define E1000_82542_FCAL E1000_FCAL #define E1000_82542_FCAH E1000_FCAH #define E1000_82542_FCT E1000_FCT @@ -1144,19 +1073,6 @@ struct e1000_ffvt_entry { #define E1000_82542_RDLEN0 E1000_82542_RDLEN #define E1000_82542_RDH0 E1000_82542_RDH #define E1000_82542_RDT0 E1000_82542_RDT -#define E1000_82542_SRRCTL(_n) (0x280C + ((_n) << 8)) /* Split and Replication - * RX Control - RW */ -#define E1000_82542_DCA_RXCTRL(_n) (0x02814 + ((_n) << 8)) -#define E1000_82542_RDBAH3 0x02B04 /* RX Desc Base High Queue 3 - RW */ -#define E1000_82542_RDBAL3 0x02B00 /* RX Desc Low Queue 3 - RW */ -#define E1000_82542_RDLEN3 0x02B08 /* RX Desc Length Queue 3 - RW */ -#define E1000_82542_RDH3 0x02B10 /* RX Desc Head Queue 3 - RW */ -#define E1000_82542_RDT3 0x02B18 /* RX Desc Tail Queue 3 - RW */ -#define E1000_82542_RDBAL2 0x02A00 /* RX Desc Base Low Queue 2 - RW */ -#define E1000_82542_RDBAH2 0x02A04 /* RX Desc Base High Queue 2 - RW */ -#define E1000_82542_RDLEN2 0x02A08 /* RX Desc Length Queue 2 - RW */ -#define E1000_82542_RDH2 0x02A10 /* RX Desc Head Queue 2 - RW */ -#define E1000_82542_RDT2 0x02A18 /* RX Desc Tail Queue 2 - RW */ #define E1000_82542_RDTR1 0x00130 #define E1000_82542_RDBAL1 0x00138 #define E1000_82542_RDBAH1 0x0013C @@ -1194,14 +1110,11 @@ struct e1000_ffvt_entry { #define E1000_82542_FLOP E1000_FLOP #define E1000_82542_EXTCNF_CTRL E1000_EXTCNF_CTRL #define E1000_82542_EXTCNF_SIZE E1000_EXTCNF_SIZE -#define E1000_82542_PHY_CTRL E1000_PHY_CTRL #define E1000_82542_ERT E1000_ERT #define E1000_82542_RXDCTL E1000_RXDCTL -#define E1000_82542_RXDCTL1 E1000_RXDCTL1 #define E1000_82542_RADV E1000_RADV #define E1000_82542_RSRPD E1000_RSRPD #define E1000_82542_TXDMAC E1000_TXDMAC -#define E1000_82542_KABGTXD E1000_KABGTXD #define E1000_82542_TDFHS E1000_TDFHS #define E1000_82542_TDFTS E1000_TDFTS #define E1000_82542_TDFPC E1000_TDFPC @@ -1397,16 +1310,13 @@ struct e1000_hw_stats { /* Structure containing variables used by the shared code (e1000_hw.c) */ struct e1000_hw { - uint8_t *hw_addr; + uint8_t __iomem *hw_addr; uint8_t *flash_address; e1000_mac_type mac_type; e1000_phy_type phy_type; uint32_t phy_init_script; e1000_media_type media_type; void *back; - struct e1000_shadow_ram *eeprom_shadow_ram; - uint32_t flash_bank_size; - uint32_t flash_base_addr; e1000_fc_type fc; e1000_bus_speed bus_speed; e1000_bus_width bus_width; @@ -1418,7 +1328,6 @@ struct e1000_hw { uint32_t asf_firmware_present; uint32_t eeprom_semaphore_present; uint32_t swfw_sync_present; - uint32_t swfwhw_semaphore_present; unsigned long io_base; uint32_t phy_id; uint32_t phy_revision; @@ -1478,7 +1387,6 @@ struct e1000_hw { boolean_t in_ifs_mode; boolean_t mng_reg_access_disabled; boolean_t leave_av_bit_off; - boolean_t kmrn_lock_loss_workaround_disabled; }; @@ -1527,7 +1435,6 @@ struct e1000_hw { #define E1000_CTRL_RTE 0x20000000 /* Routing tag enable */ #define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */ #define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */ -#define E1000_CTRL_SW2FW_INT 0x02000000 /* Initiate an interrupt to manageability engine */ /* Device Status */ #define E1000_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */ @@ -1542,8 +1449,6 @@ struct e1000_hw { #define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */ #define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */ #define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */ -#define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion - by EEPROM/Flash */ #define E1000_STATUS_ASDV 0x00000300 /* Auto speed detect value */ #define E1000_STATUS_DOCK_CI 0x00000800 /* Change in Dock/Undock state. Clear on write '0'. */ #define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */ @@ -1601,10 +1506,6 @@ struct e1000_hw { #define E1000_STM_OPCODE 0xDB00 #define E1000_HICR_FW_RESET 0xC0 -#define E1000_SHADOW_RAM_WORDS 2048 -#define E1000_ICH8_NVM_SIG_WORD 0x13 -#define E1000_ICH8_NVM_SIG_MASK 0xC0 - /* EEPROM Read */ #define E1000_EERD_START 0x00000001 /* Start Read */ #define E1000_EERD_DONE 0x00000010 /* Read Done */ @@ -1650,6 +1551,7 @@ struct e1000_hw { #define E1000_CTRL_EXT_WR_WMARK_320 0x01000000 #define E1000_CTRL_EXT_WR_WMARK_384 0x02000000 #define E1000_CTRL_EXT_WR_WMARK_448 0x03000000 +#define E1000_CTRL_EXT_CANC 0x04000000 /* Interrupt delay cancellation */ #define E1000_CTRL_EXT_DRV_LOAD 0x10000000 /* Driver loaded bit for FW */ #define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */ #define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */ @@ -1689,31 +1591,12 @@ struct e1000_hw { #define E1000_KUMCTRLSTA_FIFO_CTRL_TX_BYPASS 0x00000800 /* In-Band Control */ -#define E1000_KUMCTRLSTA_INB_CTRL_LINK_STATUS_TX_TIMEOUT_DEFAULT 0x00000500 #define E1000_KUMCTRLSTA_INB_CTRL_DIS_PADDING 0x00000010 /* Half-Duplex Control */ #define E1000_KUMCTRLSTA_HD_CTRL_10_100_DEFAULT 0x00000004 #define E1000_KUMCTRLSTA_HD_CTRL_1000_DEFAULT 0x00000000 -#define E1000_KUMCTRLSTA_OFFSET_K0S_CTRL 0x0000001E - -#define E1000_KUMCTRLSTA_DIAG_FELPBK 0x2000 -#define E1000_KUMCTRLSTA_DIAG_NELPBK 0x1000 - -#define E1000_KUMCTRLSTA_K0S_100_EN 0x2000 -#define E1000_KUMCTRLSTA_K0S_GBE_EN 0x1000 -#define E1000_KUMCTRLSTA_K0S_ENTRY_LATENCY_MASK 0x0003 - -#define E1000_KABGTXD_BGSQLBIAS 0x00050000 - -#define E1000_PHY_CTRL_SPD_EN 0x00000001 -#define E1000_PHY_CTRL_D0A_LPLU 0x00000002 -#define E1000_PHY_CTRL_NOND0A_LPLU 0x00000004 -#define E1000_PHY_CTRL_NOND0A_GBE_DISABLE 0x00000008 -#define E1000_PHY_CTRL_GBE_DISABLE 0x00000040 -#define E1000_PHY_CTRL_B2B_EN 0x00000080 - /* LED Control */ #define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F #define E1000_LEDCTL_LED0_MODE_SHIFT 0 @@ -1783,9 +1666,6 @@ struct e1000_hw { #define E1000_ICR_RXD_FIFO_PAR1 0x01000000 /* queue 1 Rx descriptor FIFO parity error */ #define E1000_ICR_TXD_FIFO_PAR1 0x02000000 /* queue 1 Tx descriptor FIFO parity error */ #define E1000_ICR_ALL_PARITY 0x03F00000 /* all parity error bits */ -#define E1000_ICR_DSW 0x00000020 /* FW changed the status of DISSW bit in the FWSM */ -#define E1000_ICR_PHYINT 0x00001000 /* LAN connected device generates an interrupt */ -#define E1000_ICR_EPRST 0x00100000 /* ME handware reset occurs */ /* Interrupt Cause Set */ #define E1000_ICS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ @@ -1812,9 +1692,6 @@ struct e1000_hw { #define E1000_ICS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */ #define E1000_ICS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */ #define E1000_ICS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */ -#define E1000_ICS_DSW E1000_ICR_DSW -#define E1000_ICS_PHYINT E1000_ICR_PHYINT -#define E1000_ICS_EPRST E1000_ICR_EPRST /* Interrupt Mask Set */ #define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ @@ -1841,9 +1718,6 @@ struct e1000_hw { #define E1000_IMS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */ #define E1000_IMS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */ #define E1000_IMS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */ -#define E1000_IMS_DSW E1000_ICR_DSW -#define E1000_IMS_PHYINT E1000_ICR_PHYINT -#define E1000_IMS_EPRST E1000_ICR_EPRST /* Interrupt Mask Clear */ #define E1000_IMC_TXDW E1000_ICR_TXDW /* Transmit desc written back */ @@ -1870,9 +1744,6 @@ struct e1000_hw { #define E1000_IMC_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */ #define E1000_IMC_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */ #define E1000_IMC_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */ -#define E1000_IMC_DSW E1000_ICR_DSW -#define E1000_IMC_PHYINT E1000_ICR_PHYINT -#define E1000_IMC_EPRST E1000_ICR_EPRST /* Receive Control */ #define E1000_RCTL_RST 0x00000001 /* Software reset */ @@ -2047,10 +1918,9 @@ struct e1000_hw { #define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000 #define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000 #define E1000_MRQC_RSS_FIELD_IPV4 0x00020000 -#define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000 +#define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00040000 #define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000 #define E1000_MRQC_RSS_FIELD_IPV6 0x00100000 -#define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00200000 /* Definitions for power management and wakeup registers */ /* Wake Up Control */ @@ -2140,15 +2010,6 @@ struct e1000_hw { #define E1000_FWSM_MODE_SHIFT 1 #define E1000_FWSM_FW_VALID 0x00008000 /* FW established a valid mode */ -#define E1000_FWSM_RSPCIPHY 0x00000040 /* Reset PHY on PCI reset */ -#define E1000_FWSM_DISSW 0x10000000 /* FW disable SW Write Access */ -#define E1000_FWSM_SKUSEL_MASK 0x60000000 /* LAN SKU select */ -#define E1000_FWSM_SKUEL_SHIFT 29 -#define E1000_FWSM_SKUSEL_EMB 0x0 /* Embedded SKU */ -#define E1000_FWSM_SKUSEL_CONS 0x1 /* Consumer SKU */ -#define E1000_FWSM_SKUSEL_PERF_100 0x2 /* Perf & Corp 10/100 SKU */ -#define E1000_FWSM_SKUSEL_PERF_GBE 0x3 /* Perf & Copr GbE SKU */ - /* FFLT Debug Register */ #define E1000_FFLT_DBG_INVC 0x00100000 /* Invalid /C/ code handling */ @@ -2221,8 +2082,6 @@ struct e1000_host_command_info { E1000_GCR_TXDSCW_NO_SNOOP | \ E1000_GCR_TXDSCR_NO_SNOOP) -#define PCI_EX_82566_SNOOP_ALL PCI_EX_NO_SNOOP_ALL - #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 /* Function Active and Power State to MNG */ #define E1000_FACTPS_FUNC0_POWER_STATE_MASK 0x00000003 @@ -2281,10 +2140,8 @@ struct e1000_host_command_info { #define EEPROM_PHY_CLASS_WORD 0x0007 #define EEPROM_INIT_CONTROL1_REG 0x000A #define EEPROM_INIT_CONTROL2_REG 0x000F -#define EEPROM_SWDEF_PINS_CTRL_PORT_1 0x0010 #define EEPROM_INIT_CONTROL3_PORT_B 0x0014 #define EEPROM_INIT_3GIO_3 0x001A -#define EEPROM_SWDEF_PINS_CTRL_PORT_0 0x0020 #define EEPROM_INIT_CONTROL3_PORT_A 0x0024 #define EEPROM_CFG 0x0012 #define EEPROM_FLASH_VERSION 0x0032 @@ -2296,16 +2153,10 @@ struct e1000_host_command_info { /* Word definitions for ID LED Settings */ #define ID_LED_RESERVED_0000 0x0000 #define ID_LED_RESERVED_FFFF 0xFFFF -#define ID_LED_RESERVED_82573 0xF746 -#define ID_LED_DEFAULT_82573 0x1811 #define ID_LED_DEFAULT ((ID_LED_OFF1_ON2 << 12) | \ (ID_LED_OFF1_OFF2 << 8) | \ (ID_LED_DEF1_DEF2 << 4) | \ (ID_LED_DEF1_DEF2)) -#define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \ - (ID_LED_DEF1_OFF2 << 8) | \ - (ID_LED_DEF1_ON2 << 4) | \ - (ID_LED_DEF1_DEF2)) #define ID_LED_DEF1_DEF2 0x1 #define ID_LED_DEF1_ON2 0x2 #define ID_LED_DEF1_OFF2 0x3 @@ -2340,11 +2191,6 @@ struct e1000_host_command_info { #define EEPROM_WORD0F_ASM_DIR 0x2000 #define EEPROM_WORD0F_ANE 0x0800 #define EEPROM_WORD0F_SWPDIO_EXT 0x00F0 -#define EEPROM_WORD0F_LPLU 0x0001 - -/* Mask bits for fields in Word 0x10/0x20 of the EEPROM */ -#define EEPROM_WORD1020_GIGA_DISABLE 0x0010 -#define EEPROM_WORD1020_GIGA_DISABLE_NON_D0A 0x0008 /* Mask bits for fields in Word 0x1a of the EEPROM */ #define EEPROM_WORD1A_ASPM_MASK 0x000C @@ -2419,29 +2265,23 @@ struct e1000_host_command_info { #define E1000_EXTCNF_CTRL_D_UD_OWNER 0x00000010 #define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020 #define E1000_EXTCNF_CTRL_MDIO_HW_OWNERSHIP 0x00000040 -#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER 0x0FFF0000 +#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER 0x1FFF0000 #define E1000_EXTCNF_SIZE_EXT_PHY_LENGTH 0x000000FF #define E1000_EXTCNF_SIZE_EXT_DOCK_LENGTH 0x0000FF00 #define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH 0x00FF0000 -#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001 -#define E1000_EXTCNF_CTRL_SWFLAG 0x00000020 /* PBA constants */ -#define E1000_PBA_8K 0x0008 /* 8KB, default Rx allocation */ #define E1000_PBA_12K 0x000C /* 12KB, default Rx allocation */ #define E1000_PBA_16K 0x0010 /* 16KB, default TX allocation */ #define E1000_PBA_22K 0x0016 #define E1000_PBA_24K 0x0018 #define E1000_PBA_30K 0x001E #define E1000_PBA_32K 0x0020 -#define E1000_PBA_34K 0x0022 #define E1000_PBA_38K 0x0026 #define E1000_PBA_40K 0x0028 #define E1000_PBA_48K 0x0030 /* 48KB, default RX allocation */ -#define E1000_PBS_16K E1000_PBA_16K - /* Flow Control Constants */ #define FLOW_CONTROL_ADDRESS_LOW 0x00C28001 #define FLOW_CONTROL_ADDRESS_HIGH 0x00000100 @@ -2496,7 +2336,7 @@ struct e1000_host_command_info { /* Number of milliseconds we wait for Eeprom auto read bit done after MAC reset */ #define AUTO_READ_DONE_TIMEOUT 10 /* Number of milliseconds we wait for PHY configuration done after MAC reset */ -#define PHY_CFG_TIMEOUT 100 +#define PHY_CFG_TIMEOUT 40 #define E1000_TX_BUFFER_SIZE ((uint32_t)1514) @@ -2924,17 +2764,6 @@ struct e1000_host_command_info { #define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */ #define M88E1000_EPSCR_TX_CLK_0 0x0000 /* NO TX_CLK */ -/* M88EC018 Rev 2 specific DownShift settings */ -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK 0x0E00 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_1X 0x0000 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_2X 0x0200 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_3X 0x0400 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_4X 0x0600 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X 0x0800 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_6X 0x0A00 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_7X 0x0C00 -#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_8X 0x0E00 - /* IGP01E1000 Specific Port Config Register - R/W */ #define IGP01E1000_PSCFR_AUTO_MDIX_PAR_DETECT 0x0010 #define IGP01E1000_PSCFR_PRE_EN 0x0020 @@ -3161,221 +2990,6 @@ struct e1000_host_command_info { #define L1LXT971A_PHY_ID 0x001378E0 #define GG82563_E_PHY_ID 0x01410CA0 - -/* Bits... - * 15-5: page - * 4-0: register offset - */ -#define PHY_PAGE_SHIFT 5 -#define PHY_REG(page, reg) \ - (((page) << PHY_PAGE_SHIFT) | ((reg) & MAX_PHY_REG_ADDRESS)) - -#define IGP3_PHY_PORT_CTRL \ - PHY_REG(769, 17) /* Port General Configuration */ -#define IGP3_PHY_RATE_ADAPT_CTRL \ - PHY_REG(769, 25) /* Rate Adapter Control Register */ - -#define IGP3_KMRN_FIFO_CTRL_STATS \ - PHY_REG(770, 16) /* KMRN FIFO's control/status register */ -#define IGP3_KMRN_POWER_MNG_CTRL \ - PHY_REG(770, 17) /* KMRN Power Management Control Register */ -#define IGP3_KMRN_INBAND_CTRL \ - PHY_REG(770, 18) /* KMRN Inband Control Register */ -#define IGP3_KMRN_DIAG \ - PHY_REG(770, 19) /* KMRN Diagnostic register */ -#define IGP3_KMRN_DIAG_PCS_LOCK_LOSS 0x0002 /* RX PCS is not synced */ -#define IGP3_KMRN_ACK_TIMEOUT \ - PHY_REG(770, 20) /* KMRN Acknowledge Timeouts register */ - -#define IGP3_VR_CTRL \ - PHY_REG(776, 18) /* Voltage regulator control register */ -#define IGP3_VR_CTRL_MODE_SHUT 0x0200 /* Enter powerdown, shutdown VRs */ - -#define IGP3_CAPABILITY \ - PHY_REG(776, 19) /* IGP3 Capability Register */ - -/* Capabilities for SKU Control */ -#define IGP3_CAP_INITIATE_TEAM 0x0001 /* Able to initiate a team */ -#define IGP3_CAP_WFM 0x0002 /* Support WoL and PXE */ -#define IGP3_CAP_ASF 0x0004 /* Support ASF */ -#define IGP3_CAP_LPLU 0x0008 /* Support Low Power Link Up */ -#define IGP3_CAP_DC_AUTO_SPEED 0x0010 /* Support AC/DC Auto Link Speed */ -#define IGP3_CAP_SPD 0x0020 /* Support Smart Power Down */ -#define IGP3_CAP_MULT_QUEUE 0x0040 /* Support 2 tx & 2 rx queues */ -#define IGP3_CAP_RSS 0x0080 /* Support RSS */ -#define IGP3_CAP_8021PQ 0x0100 /* Support 802.1Q & 802.1p */ -#define IGP3_CAP_AMT_CB 0x0200 /* Support active manageability and circuit breaker */ - -#define IGP3_PPC_JORDAN_EN 0x0001 -#define IGP3_PPC_JORDAN_GIGA_SPEED 0x0002 - -#define IGP3_KMRN_PMC_EE_IDLE_LINK_DIS 0x0001 -#define IGP3_KMRN_PMC_K0S_ENTRY_LATENCY_MASK 0x001E -#define IGP3_KMRN_PMC_K0S_MODE1_EN_GIGA 0x0020 -#define IGP3_KMRN_PMC_K0S_MODE1_EN_100 0x0040 - -#define IGP3E1000_PHY_MISC_CTRL 0x1B /* Misc. Ctrl register */ -#define IGP3_PHY_MISC_DUPLEX_MANUAL_SET 0x1000 /* Duplex Manual Set */ - -#define IGP3_KMRN_EXT_CTRL PHY_REG(770, 18) -#define IGP3_KMRN_EC_DIS_INBAND 0x0080 - -#define IGP03E1000_E_PHY_ID 0x02A80390 -#define IFE_E_PHY_ID 0x02A80330 /* 10/100 PHY */ -#define IFE_PLUS_E_PHY_ID 0x02A80320 -#define IFE_C_E_PHY_ID 0x02A80310 - -#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10 /* 100BaseTx Extended Status, Control and Address */ -#define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY special control register */ -#define IFE_PHY_RCV_FALSE_CARRIER 0x13 /* 100BaseTx Receive False Carrier Counter */ -#define IFE_PHY_RCV_DISCONNECT 0x14 /* 100BaseTx Receive Disconnet Counter */ -#define IFE_PHY_RCV_ERROT_FRAME 0x15 /* 100BaseTx Receive Error Frame Counter */ -#define IFE_PHY_RCV_SYMBOL_ERR 0x16 /* Receive Symbol Error Counter */ -#define IFE_PHY_PREM_EOF_ERR 0x17 /* 100BaseTx Receive Premature End Of Frame Error Counter */ -#define IFE_PHY_RCV_EOF_ERR 0x18 /* 10BaseT Receive End Of Frame Error Counter */ -#define IFE_PHY_TX_JABBER_DETECT 0x19 /* 10BaseT Transmit Jabber Detect Counter */ -#define IFE_PHY_EQUALIZER 0x1A /* PHY Equalizer Control and Status */ -#define IFE_PHY_SPECIAL_CONTROL_LED 0x1B /* PHY special control and LED configuration */ -#define IFE_PHY_MDIX_CONTROL 0x1C /* MDI/MDI-X Control register */ -#define IFE_PHY_HWI_CONTROL 0x1D /* Hardware Integrity Control (HWI) */ - -#define IFE_PESC_REDUCED_POWER_DOWN_DISABLE 0x2000 /* Defaut 1 = Disable auto reduced power down */ -#define IFE_PESC_100BTX_POWER_DOWN 0x0400 /* Indicates the power state of 100BASE-TX */ -#define IFE_PESC_10BTX_POWER_DOWN 0x0200 /* Indicates the power state of 10BASE-T */ -#define IFE_PESC_POLARITY_REVERSED 0x0100 /* Indicates 10BASE-T polarity */ -#define IFE_PESC_PHY_ADDR_MASK 0x007C /* Bit 6:2 for sampled PHY address */ -#define IFE_PESC_SPEED 0x0002 /* Auto-negotiation speed result 1=100Mbs, 0=10Mbs */ -#define IFE_PESC_DUPLEX 0x0001 /* Auto-negotiation duplex result 1=Full, 0=Half */ -#define IFE_PESC_POLARITY_REVERSED_SHIFT 8 - -#define IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN 0x0100 /* 1 = Dyanmic Power Down disabled */ -#define IFE_PSC_FORCE_POLARITY 0x0020 /* 1=Reversed Polarity, 0=Normal */ -#define IFE_PSC_AUTO_POLARITY_DISABLE 0x0010 /* 1=Auto Polarity Disabled, 0=Enabled */ -#define IFE_PSC_JABBER_FUNC_DISABLE 0x0001 /* 1=Jabber Disabled, 0=Normal Jabber Operation */ -#define IFE_PSC_FORCE_POLARITY_SHIFT 5 -#define IFE_PSC_AUTO_POLARITY_DISABLE_SHIFT 4 - -#define IFE_PMC_AUTO_MDIX 0x0080 /* 1=enable MDI/MDI-X feature, default 0=disabled */ -#define IFE_PMC_FORCE_MDIX 0x0040 /* 1=force MDIX-X, 0=force MDI */ -#define IFE_PMC_MDIX_STATUS 0x0020 /* 1=MDI-X, 0=MDI */ -#define IFE_PMC_AUTO_MDIX_COMPLETE 0x0010 /* Resolution algorthm is completed */ -#define IFE_PMC_MDIX_MODE_SHIFT 6 -#define IFE_PHC_MDIX_RESET_ALL_MASK 0x0000 /* Disable auto MDI-X */ - -#define IFE_PHC_HWI_ENABLE 0x8000 /* Enable the HWI feature */ -#define IFE_PHC_ABILITY_CHECK 0x4000 /* 1= Test Passed, 0=failed */ -#define IFE_PHC_TEST_EXEC 0x2000 /* PHY launch test pulses on the wire */ -#define IFE_PHC_HIGHZ 0x0200 /* 1 = Open Circuit */ -#define IFE_PHC_LOWZ 0x0400 /* 1 = Short Circuit */ -#define IFE_PHC_LOW_HIGH_Z_MASK 0x0600 /* Mask for indication type of problem on the line */ -#define IFE_PHC_DISTANCE_MASK 0x01FF /* Mask for distance to the cable problem, in 80cm granularity */ -#define IFE_PHC_RESET_ALL_MASK 0x0000 /* Disable HWI */ -#define IFE_PSCL_PROBE_MODE 0x0020 /* LED Probe mode */ -#define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */ -#define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */ - -#define ICH8_FLASH_COMMAND_TIMEOUT 500 /* 500 ms , should be adjusted */ -#define ICH8_FLASH_CYCLE_REPEAT_COUNT 10 /* 10 cycles , should be adjusted */ -#define ICH8_FLASH_SEG_SIZE_256 256 -#define ICH8_FLASH_SEG_SIZE_4K 4096 -#define ICH8_FLASH_SEG_SIZE_64K 65536 - -#define ICH8_CYCLE_READ 0x0 -#define ICH8_CYCLE_RESERVED 0x1 -#define ICH8_CYCLE_WRITE 0x2 -#define ICH8_CYCLE_ERASE 0x3 - -#define ICH8_FLASH_GFPREG 0x0000 -#define ICH8_FLASH_HSFSTS 0x0004 -#define ICH8_FLASH_HSFCTL 0x0006 -#define ICH8_FLASH_FADDR 0x0008 -#define ICH8_FLASH_FDATA0 0x0010 -#define ICH8_FLASH_FRACC 0x0050 -#define ICH8_FLASH_FREG0 0x0054 -#define ICH8_FLASH_FREG1 0x0058 -#define ICH8_FLASH_FREG2 0x005C -#define ICH8_FLASH_FREG3 0x0060 -#define ICH8_FLASH_FPR0 0x0074 -#define ICH8_FLASH_FPR1 0x0078 -#define ICH8_FLASH_SSFSTS 0x0090 -#define ICH8_FLASH_SSFCTL 0x0092 -#define ICH8_FLASH_PREOP 0x0094 -#define ICH8_FLASH_OPTYPE 0x0096 -#define ICH8_FLASH_OPMENU 0x0098 - -#define ICH8_FLASH_REG_MAPSIZE 0x00A0 -#define ICH8_FLASH_SECTOR_SIZE 4096 -#define ICH8_GFPREG_BASE_MASK 0x1FFF -#define ICH8_FLASH_LINEAR_ADDR_MASK 0x00FFFFFF - -/* ICH8 GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ -/* Offset 04h HSFSTS */ -union ich8_hws_flash_status { - struct ich8_hsfsts { -#ifdef E1000_BIG_ENDIAN - uint16_t reserved2 :6; - uint16_t fldesvalid :1; - uint16_t flockdn :1; - uint16_t flcdone :1; - uint16_t flcerr :1; - uint16_t dael :1; - uint16_t berasesz :2; - uint16_t flcinprog :1; - uint16_t reserved1 :2; -#else - uint16_t flcdone :1; /* bit 0 Flash Cycle Done */ - uint16_t flcerr :1; /* bit 1 Flash Cycle Error */ - uint16_t dael :1; /* bit 2 Direct Access error Log */ - uint16_t berasesz :2; /* bit 4:3 Block/Sector Erase Size */ - uint16_t flcinprog :1; /* bit 5 flash SPI cycle in Progress */ - uint16_t reserved1 :2; /* bit 13:6 Reserved */ - uint16_t reserved2 :6; /* bit 13:6 Reserved */ - uint16_t fldesvalid :1; /* bit 14 Flash Descriptor Valid */ - uint16_t flockdn :1; /* bit 15 Flash Configuration Lock-Down */ -#endif - } hsf_status; - uint16_t regval; -}; - -/* ICH8 GbE Flash Hardware Sequencing Flash control Register bit breakdown */ -/* Offset 06h FLCTL */ -union ich8_hws_flash_ctrl { - struct ich8_hsflctl { -#ifdef E1000_BIG_ENDIAN - uint16_t fldbcount :2; - uint16_t flockdn :6; - uint16_t flcgo :1; - uint16_t flcycle :2; - uint16_t reserved :5; -#else - uint16_t flcgo :1; /* 0 Flash Cycle Go */ - uint16_t flcycle :2; /* 2:1 Flash Cycle */ - uint16_t reserved :5; /* 7:3 Reserved */ - uint16_t fldbcount :2; /* 9:8 Flash Data Byte Count */ - uint16_t flockdn :6; /* 15:10 Reserved */ -#endif - } hsf_ctrl; - uint16_t regval; -}; - -/* ICH8 Flash Region Access Permissions */ -union ich8_hws_flash_regacc { - struct ich8_flracc { -#ifdef E1000_BIG_ENDIAN - uint32_t gmwag :8; - uint32_t gmrag :8; - uint32_t grwa :8; - uint32_t grra :8; -#else - uint32_t grra :8; /* 0:7 GbE region Read Access */ - uint32_t grwa :8; /* 8:15 GbE region Write Access */ - uint32_t gmrag :8; /* 23:16 GbE Master Read Access Grant */ - uint32_t gmwag :8; /* 31:24 GbE Master Write Access Grant */ -#endif - } hsf_flregacc; - uint16_t regval; -}; - /* Miscellaneous PHY bit definitions. */ #define PHY_PREAMBLE 0xFFFFFFFF #define PHY_SOF 0x01 diff --git a/trunk/drivers/net/e1000/e1000_main.c b/trunk/drivers/net/e1000/e1000_main.c index 6d3d41934503..f77624f5f17b 100644 --- a/trunk/drivers/net/e1000/e1000_main.c +++ b/trunk/drivers/net/e1000/e1000_main.c @@ -36,7 +36,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; #else #define DRIVERNAPI "-NAPI" #endif -#define DRV_VERSION "7.1.9-k2"DRIVERNAPI +#define DRV_VERSION "7.0.38-k4"DRIVERNAPI char e1000_driver_version[] = DRV_VERSION; static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; @@ -73,11 +73,6 @@ static struct pci_device_id e1000_pci_tbl[] = { INTEL_E1000_ETHERNET_DEVICE(0x1026), INTEL_E1000_ETHERNET_DEVICE(0x1027), INTEL_E1000_ETHERNET_DEVICE(0x1028), - INTEL_E1000_ETHERNET_DEVICE(0x1049), - INTEL_E1000_ETHERNET_DEVICE(0x104A), - INTEL_E1000_ETHERNET_DEVICE(0x104B), - INTEL_E1000_ETHERNET_DEVICE(0x104C), - INTEL_E1000_ETHERNET_DEVICE(0x104D), INTEL_E1000_ETHERNET_DEVICE(0x105E), INTEL_E1000_ETHERNET_DEVICE(0x105F), INTEL_E1000_ETHERNET_DEVICE(0x1060), @@ -101,8 +96,6 @@ static struct pci_device_id e1000_pci_tbl[] = { INTEL_E1000_ETHERNET_DEVICE(0x109A), INTEL_E1000_ETHERNET_DEVICE(0x10B5), INTEL_E1000_ETHERNET_DEVICE(0x10B9), - INTEL_E1000_ETHERNET_DEVICE(0x10BA), - INTEL_E1000_ETHERNET_DEVICE(0x10BB), /* required last entry */ {0,} }; @@ -140,6 +133,7 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter, static void e1000_set_multi(struct net_device *netdev); static void e1000_update_phy_info(unsigned long data); static void e1000_watchdog(unsigned long data); +static void e1000_watchdog_task(struct e1000_adapter *adapter); static void e1000_82547_tx_fifo_stall(unsigned long data); static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev); static struct net_device_stats * e1000_get_stats(struct net_device *netdev); @@ -184,8 +178,8 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); static void e1000_restore_vlan(struct e1000_adapter *adapter); -static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); #ifdef CONFIG_PM +static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); static int e1000_resume(struct pci_dev *pdev); #endif static void e1000_shutdown(struct pci_dev *pdev); @@ -212,8 +206,8 @@ static struct pci_driver e1000_driver = { .probe = e1000_probe, .remove = __devexit_p(e1000_remove), /* Power Managment Hooks */ - .suspend = e1000_suspend, #ifdef CONFIG_PM + .suspend = e1000_suspend, .resume = e1000_resume, #endif .shutdown = e1000_shutdown, @@ -267,44 +261,6 @@ e1000_exit_module(void) module_exit(e1000_exit_module); -static int e1000_request_irq(struct e1000_adapter *adapter) -{ - struct net_device *netdev = adapter->netdev; - int flags, err = 0; - - flags = IRQF_SHARED; -#ifdef CONFIG_PCI_MSI - if (adapter->hw.mac_type > e1000_82547_rev_2) { - adapter->have_msi = TRUE; - if ((err = pci_enable_msi(adapter->pdev))) { - DPRINTK(PROBE, ERR, - "Unable to allocate MSI interrupt Error: %d\n", err); - adapter->have_msi = FALSE; - } - } - if (adapter->have_msi) - flags &= ~IRQF_SHARED; -#endif - if ((err = request_irq(adapter->pdev->irq, &e1000_intr, flags, - netdev->name, netdev))) - DPRINTK(PROBE, ERR, - "Unable to allocate interrupt Error: %d\n", err); - - return err; -} - -static void e1000_free_irq(struct e1000_adapter *adapter) -{ - struct net_device *netdev = adapter->netdev; - - free_irq(adapter->pdev->irq, netdev); - -#ifdef CONFIG_PCI_MSI - if (adapter->have_msi) - pci_disable_msi(adapter->pdev); -#endif -} - /** * e1000_irq_disable - Mask off interrupt generation on the NIC * @adapter: board private structure @@ -373,7 +329,6 @@ e1000_release_hw_control(struct e1000_adapter *adapter) { uint32_t ctrl_ext; uint32_t swsm; - uint32_t extcnf; /* Let firmware taken over control of h/w */ switch (adapter->hw.mac_type) { @@ -388,11 +343,6 @@ e1000_release_hw_control(struct e1000_adapter *adapter) swsm = E1000_READ_REG(&adapter->hw, SWSM); E1000_WRITE_REG(&adapter->hw, SWSM, swsm & ~E1000_SWSM_DRV_LOAD); - case e1000_ich8lan: - extcnf = E1000_READ_REG(&adapter->hw, CTRL_EXT); - E1000_WRITE_REG(&adapter->hw, CTRL_EXT, - extcnf & ~E1000_CTRL_EXT_DRV_LOAD); - break; default: break; } @@ -414,7 +364,6 @@ e1000_get_hw_control(struct e1000_adapter *adapter) { uint32_t ctrl_ext; uint32_t swsm; - uint32_t extcnf; /* Let firmware know the driver has taken over */ switch (adapter->hw.mac_type) { case e1000_82571: @@ -429,11 +378,6 @@ e1000_get_hw_control(struct e1000_adapter *adapter) E1000_WRITE_REG(&adapter->hw, SWSM, swsm | E1000_SWSM_DRV_LOAD); break; - case e1000_ich8lan: - extcnf = E1000_READ_REG(&adapter->hw, EXTCNF_CTRL); - E1000_WRITE_REG(&adapter->hw, EXTCNF_CTRL, - extcnf | E1000_EXTCNF_CTRL_SWFLAG); - break; default: break; } @@ -443,10 +387,18 @@ int e1000_up(struct e1000_adapter *adapter) { struct net_device *netdev = adapter->netdev; - int i; + int i, err; /* hardware has been reset, we need to reload some things */ + /* Reset the PHY if it was previously powered down */ + if (adapter->hw.media_type == e1000_media_type_copper) { + uint16_t mii_reg; + e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg); + if (mii_reg & MII_CR_POWER_DOWN) + e1000_phy_hw_reset(&adapter->hw); + } + e1000_set_multi(netdev); e1000_restore_vlan(adapter); @@ -463,6 +415,24 @@ e1000_up(struct e1000_adapter *adapter) E1000_DESC_UNUSED(ring)); } +#ifdef CONFIG_PCI_MSI + if (adapter->hw.mac_type > e1000_82547_rev_2) { + adapter->have_msi = TRUE; + if ((err = pci_enable_msi(adapter->pdev))) { + DPRINTK(PROBE, ERR, + "Unable to allocate MSI interrupt Error: %d\n", err); + adapter->have_msi = FALSE; + } + } +#endif + if ((err = request_irq(adapter->pdev->irq, &e1000_intr, + IRQF_SHARED | IRQF_SAMPLE_RANDOM, + netdev->name, netdev))) { + DPRINTK(PROBE, ERR, + "Unable to allocate interrupt Error: %d\n", err); + return err; + } + adapter->tx_queue_len = netdev->tx_queue_len; mod_timer(&adapter->watchdog_timer, jiffies); @@ -475,60 +445,21 @@ e1000_up(struct e1000_adapter *adapter) return 0; } -/** - * e1000_power_up_phy - restore link in case the phy was powered down - * @adapter: address of board private structure - * - * The phy may be powered down to save power and turn off link when the - * driver is unloaded and wake on lan is not enabled (among others) - * *** this routine MUST be followed by a call to e1000_reset *** - * - **/ - -static void e1000_power_up_phy(struct e1000_adapter *adapter) -{ - uint16_t mii_reg = 0; - - /* Just clear the power down bit to wake the phy back up */ - if (adapter->hw.media_type == e1000_media_type_copper) { - /* according to the manual, the phy will retain its - * settings across a power-down/up cycle */ - e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg); - mii_reg &= ~MII_CR_POWER_DOWN; - e1000_write_phy_reg(&adapter->hw, PHY_CTRL, mii_reg); - } -} - -static void e1000_power_down_phy(struct e1000_adapter *adapter) -{ - boolean_t mng_mode_enabled = (adapter->hw.mac_type >= e1000_82571) && - e1000_check_mng_mode(&adapter->hw); - /* Power down the PHY so no link is implied when interface is down - * The PHY cannot be powered down if any of the following is TRUE - * (a) WoL is enabled - * (b) AMT is active - * (c) SoL/IDER session is active */ - if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 && - adapter->hw.mac_type != e1000_ich8lan && - adapter->hw.media_type == e1000_media_type_copper && - !(E1000_READ_REG(&adapter->hw, MANC) & E1000_MANC_SMBUS_EN) && - !mng_mode_enabled && - !e1000_check_phy_reset_block(&adapter->hw)) { - uint16_t mii_reg = 0; - e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg); - mii_reg |= MII_CR_POWER_DOWN; - e1000_write_phy_reg(&adapter->hw, PHY_CTRL, mii_reg); - mdelay(1); - } -} - void e1000_down(struct e1000_adapter *adapter) { struct net_device *netdev = adapter->netdev; + boolean_t mng_mode_enabled = (adapter->hw.mac_type >= e1000_82571) && + e1000_check_mng_mode(&adapter->hw); e1000_irq_disable(adapter); + free_irq(adapter->pdev->irq, netdev); +#ifdef CONFIG_PCI_MSI + if (adapter->hw.mac_type > e1000_82547_rev_2 && + adapter->have_msi == TRUE) + pci_disable_msi(adapter->pdev); +#endif del_timer_sync(&adapter->tx_fifo_stall_timer); del_timer_sync(&adapter->watchdog_timer); del_timer_sync(&adapter->phy_info_timer); @@ -545,17 +476,23 @@ e1000_down(struct e1000_adapter *adapter) e1000_reset(adapter); e1000_clean_all_tx_rings(adapter); e1000_clean_all_rx_rings(adapter); -} -void -e1000_reinit_locked(struct e1000_adapter *adapter) -{ - WARN_ON(in_interrupt()); - while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) - msleep(1); - e1000_down(adapter); - e1000_up(adapter); - clear_bit(__E1000_RESETTING, &adapter->flags); + /* Power down the PHY so no link is implied when interface is down * + * The PHY cannot be powered down if any of the following is TRUE * + * (a) WoL is enabled + * (b) AMT is active + * (c) SoL/IDER session is active */ + if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 && + adapter->hw.media_type == e1000_media_type_copper && + !(E1000_READ_REG(&adapter->hw, MANC) & E1000_MANC_SMBUS_EN) && + !mng_mode_enabled && + !e1000_check_phy_reset_block(&adapter->hw)) { + uint16_t mii_reg; + e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg); + mii_reg |= MII_CR_POWER_DOWN; + e1000_write_phy_reg(&adapter->hw, PHY_CTRL, mii_reg); + mdelay(1); + } } void @@ -581,9 +518,6 @@ e1000_reset(struct e1000_adapter *adapter) case e1000_82573: pba = E1000_PBA_12K; break; - case e1000_ich8lan: - pba = E1000_PBA_8K; - break; default: pba = E1000_PBA_48K; break; @@ -608,12 +542,6 @@ e1000_reset(struct e1000_adapter *adapter) /* Set the FC high water mark to 90% of the FIFO size. * Required to clear last 3 LSB */ fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8; - /* We can't use 90% on small FIFOs because the remainder - * would be less than 1 full frame. In this case, we size - * it to allow at least a full frame above the high water - * mark. */ - if (pba < E1000_PBA_16K) - fc_high_water_mark = (pba * 1024) - 1600; adapter->hw.fc_high_water = fc_high_water_mark; adapter->hw.fc_low_water = fc_high_water_mark - 8; @@ -636,23 +564,6 @@ e1000_reset(struct e1000_adapter *adapter) e1000_reset_adaptive(&adapter->hw); e1000_phy_get_info(&adapter->hw, &adapter->phy_info); - - if (!adapter->smart_power_down && - (adapter->hw.mac_type == e1000_82571 || - adapter->hw.mac_type == e1000_82572)) { - uint16_t phy_data = 0; - /* speed up time to link by disabling smart power down, ignore - * the return value of this function because there is nothing - * different we would do if it failed */ - e1000_read_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT, - &phy_data); - phy_data &= ~IGP02E1000_PM_SPD; - e1000_write_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT, - phy_data); - } - - if (adapter->hw.mac_type < e1000_ich8lan) - /* FIXME: this code is duplicate and wrong for PCI Express */ if (adapter->en_mng_pt) { manc = E1000_READ_REG(&adapter->hw, MANC); manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST); @@ -679,7 +590,6 @@ e1000_probe(struct pci_dev *pdev, struct net_device *netdev; struct e1000_adapter *adapter; unsigned long mmio_start, mmio_len; - unsigned long flash_start, flash_len; static int cards_found = 0; static int e1000_ksp3_port_a = 0; /* global ksp3 port a indication */ @@ -689,12 +599,10 @@ e1000_probe(struct pci_dev *pdev, if ((err = pci_enable_device(pdev))) return err; - if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) && - !(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) { + if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { pci_using_dac = 1; } else { - if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) && - (err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))) { + if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { E1000_ERR("No usable DMA configuration, aborting\n"); return err; } @@ -774,19 +682,6 @@ e1000_probe(struct pci_dev *pdev, if ((err = e1000_sw_init(adapter))) goto err_sw_init; - /* Flash BAR mapping must happen after e1000_sw_init - * because it depends on mac_type */ - if ((adapter->hw.mac_type == e1000_ich8lan) && - (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { - flash_start = pci_resource_start(pdev, 1); - flash_len = pci_resource_len(pdev, 1); - adapter->hw.flash_address = ioremap(flash_start, flash_len); - if (!adapter->hw.flash_address) { - err = -EIO; - goto err_flashmap; - } - } - if ((err = e1000_check_phy_reset_block(&adapter->hw))) DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n"); @@ -805,8 +700,6 @@ e1000_probe(struct pci_dev *pdev, NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; - if (adapter->hw.mac_type == e1000_ich8lan) - netdev->features &= ~NETIF_F_HW_VLAN_FILTER; } #ifdef NETIF_F_TSO @@ -822,17 +715,11 @@ e1000_probe(struct pci_dev *pdev, if (pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; + /* hard_start_xmit is safe against parallel locking */ netdev->features |= NETIF_F_LLTX; adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw); - /* initialize eeprom parameters */ - - if (e1000_init_eeprom_params(&adapter->hw)) { - E1000_ERR("EEPROM initialization failed\n"); - return -EIO; - } - /* before reading the EEPROM, reset the controller to * put the device in a known good starting state */ @@ -871,6 +758,9 @@ e1000_probe(struct pci_dev *pdev, adapter->watchdog_timer.function = &e1000_watchdog; adapter->watchdog_timer.data = (unsigned long) adapter; + INIT_WORK(&adapter->watchdog_task, + (void (*)(void *))e1000_watchdog_task, adapter); + init_timer(&adapter->phy_info_timer); adapter->phy_info_timer.function = &e1000_update_phy_info; adapter->phy_info_timer.data = (unsigned long) adapter; @@ -900,11 +790,6 @@ e1000_probe(struct pci_dev *pdev, EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data); eeprom_apme_mask = E1000_EEPROM_82544_APM; break; - case e1000_ich8lan: - e1000_read_eeprom(&adapter->hw, - EEPROM_INIT_CONTROL1_REG, 1, &eeprom_data); - eeprom_apme_mask = E1000_EEPROM_ICH8_APME; - break; case e1000_82546: case e1000_82546_rev_3: case e1000_82571: @@ -964,9 +849,6 @@ e1000_probe(struct pci_dev *pdev, return 0; err_register: - if (adapter->hw.flash_address) - iounmap(adapter->hw.flash_address); -err_flashmap: err_sw_init: err_eeprom: iounmap(adapter->hw.hw_addr); @@ -1000,7 +882,6 @@ e1000_remove(struct pci_dev *pdev) flush_scheduled_work(); if (adapter->hw.mac_type >= e1000_82540 && - adapter->hw.mac_type != e1000_ich8lan && adapter->hw.media_type == e1000_media_type_copper) { manc = E1000_READ_REG(&adapter->hw, MANC); if (manc & E1000_MANC_SMBUS_EN) { @@ -1029,8 +910,6 @@ e1000_remove(struct pci_dev *pdev) #endif iounmap(adapter->hw.hw_addr); - if (adapter->hw.flash_address) - iounmap(adapter->hw.flash_address); pci_release_regions(pdev); free_netdev(netdev); @@ -1081,6 +960,13 @@ e1000_sw_init(struct e1000_adapter *adapter) return -EIO; } + /* initialize eeprom parameters */ + + if (e1000_init_eeprom_params(hw)) { + E1000_ERR("EEPROM initialization failed\n"); + return -EIO; + } + switch (hw->mac_type) { default: break; @@ -1192,10 +1078,6 @@ e1000_open(struct net_device *netdev) struct e1000_adapter *adapter = netdev_priv(netdev); int err; - /* disallow open during test */ - if (test_bit(__E1000_DRIVER_TESTING, &adapter->flags)) - return -EBUSY; - /* allocate transmit descriptors */ if ((err = e1000_setup_all_tx_resources(adapter))) @@ -1206,12 +1088,6 @@ e1000_open(struct net_device *netdev) if ((err = e1000_setup_all_rx_resources(adapter))) goto err_setup_rx; - err = e1000_request_irq(adapter); - if (err) - goto err_up; - - e1000_power_up_phy(adapter); - if ((err = e1000_up(adapter))) goto err_up; adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; @@ -1255,10 +1131,7 @@ e1000_close(struct net_device *netdev) { struct e1000_adapter *adapter = netdev_priv(netdev); - WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); e1000_down(adapter); - e1000_power_down_phy(adapter); - e1000_free_irq(adapter); e1000_free_all_tx_resources(adapter); e1000_free_all_rx_resources(adapter); @@ -1316,7 +1189,8 @@ e1000_setup_tx_resources(struct e1000_adapter *adapter, int size; size = sizeof(struct e1000_buffer) * txdr->count; - txdr->buffer_info = vmalloc(size); + + txdr->buffer_info = vmalloc_node(size, pcibus_to_node(pdev->bus)); if (!txdr->buffer_info) { DPRINTK(PROBE, ERR, "Unable to allocate memory for the transmit descriptor ring\n"); @@ -1428,11 +1302,11 @@ e1000_configure_tx(struct e1000_adapter *adapter) tdba = adapter->tx_ring[0].dma; tdlen = adapter->tx_ring[0].count * sizeof(struct e1000_tx_desc); - E1000_WRITE_REG(hw, TDLEN, tdlen); - E1000_WRITE_REG(hw, TDBAH, (tdba >> 32)); E1000_WRITE_REG(hw, TDBAL, (tdba & 0x00000000ffffffffULL)); - E1000_WRITE_REG(hw, TDT, 0); + E1000_WRITE_REG(hw, TDBAH, (tdba >> 32)); + E1000_WRITE_REG(hw, TDLEN, tdlen); E1000_WRITE_REG(hw, TDH, 0); + E1000_WRITE_REG(hw, TDT, 0); adapter->tx_ring[0].tdh = E1000_TDH; adapter->tx_ring[0].tdt = E1000_TDT; break; @@ -1544,7 +1418,7 @@ e1000_setup_rx_resources(struct e1000_adapter *adapter, int size, desc_len; size = sizeof(struct e1000_buffer) * rxdr->count; - rxdr->buffer_info = vmalloc(size); + rxdr->buffer_info = vmalloc_node(size, pcibus_to_node(pdev->bus)); if (!rxdr->buffer_info) { DPRINTK(PROBE, ERR, "Unable to allocate memory for the receive descriptor ring\n"); @@ -1686,6 +1560,9 @@ e1000_setup_rctl(struct e1000_adapter *adapter) E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF | (adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT); + if (adapter->hw.mac_type > e1000_82543) + rctl |= E1000_RCTL_SECRC; + if (adapter->hw.tbi_compatibility_on == 1) rctl |= E1000_RCTL_SBP; else @@ -1751,7 +1628,7 @@ e1000_setup_rctl(struct e1000_adapter *adapter) rfctl |= E1000_RFCTL_IPV6_DIS; E1000_WRITE_REG(&adapter->hw, RFCTL, rfctl); - rctl |= E1000_RCTL_DTYP_PS; + rctl |= E1000_RCTL_DTYP_PS | E1000_RCTL_SECRC; psrctl |= adapter->rx_ps_bsize0 >> E1000_PSRCTL_BSIZE0_SHIFT; @@ -1835,11 +1712,11 @@ e1000_configure_rx(struct e1000_adapter *adapter) case 1: default: rdba = adapter->rx_ring[0].dma; - E1000_WRITE_REG(hw, RDLEN, rdlen); - E1000_WRITE_REG(hw, RDBAH, (rdba >> 32)); E1000_WRITE_REG(hw, RDBAL, (rdba & 0x00000000ffffffffULL)); - E1000_WRITE_REG(hw, RDT, 0); + E1000_WRITE_REG(hw, RDBAH, (rdba >> 32)); + E1000_WRITE_REG(hw, RDLEN, rdlen); E1000_WRITE_REG(hw, RDH, 0); + E1000_WRITE_REG(hw, RDT, 0); adapter->rx_ring[0].rdh = E1000_RDH; adapter->rx_ring[0].rdt = E1000_RDT; break; @@ -1864,6 +1741,9 @@ e1000_configure_rx(struct e1000_adapter *adapter) E1000_WRITE_REG(hw, RXCSUM, rxcsum); } + if (hw->mac_type == e1000_82573) + E1000_WRITE_REG(hw, ERT, 0x0100); + /* Enable Receives */ E1000_WRITE_REG(hw, RCTL, rctl); } @@ -2203,12 +2083,6 @@ e1000_set_multi(struct net_device *netdev) uint32_t rctl; uint32_t hash_value; int i, rar_entries = E1000_RAR_ENTRIES; - int mta_reg_count = (hw->mac_type == e1000_ich8lan) ? - E1000_NUM_MTA_REGISTERS_ICH8LAN : - E1000_NUM_MTA_REGISTERS; - - if (adapter->hw.mac_type == e1000_ich8lan) - rar_entries = E1000_RAR_ENTRIES_ICH8LAN; /* reserve RAR[14] for LAA over-write work-around */ if (adapter->hw.mac_type == e1000_82571) @@ -2247,18 +2121,14 @@ e1000_set_multi(struct net_device *netdev) mc_ptr = mc_ptr->next; } else { E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0); - E1000_WRITE_FLUSH(hw); E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0); - E1000_WRITE_FLUSH(hw); } } /* clear the old settings from the multicast hash table */ - for (i = 0; i < mta_reg_count; i++) { + for (i = 0; i < E1000_NUM_MTA_REGISTERS; i++) E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); - E1000_WRITE_FLUSH(hw); - } /* load any remaining addresses into the hash table */ @@ -2331,19 +2201,19 @@ static void e1000_watchdog(unsigned long data) { struct e1000_adapter *adapter = (struct e1000_adapter *) data; + + /* Do the rest outside of interrupt context */ + schedule_work(&adapter->watchdog_task); +} + +static void +e1000_watchdog_task(struct e1000_adapter *adapter) +{ struct net_device *netdev = adapter->netdev; struct e1000_tx_ring *txdr = adapter->tx_ring; uint32_t link, tctl; - int32_t ret_val; - - ret_val = e1000_check_for_link(&adapter->hw); - if ((ret_val == E1000_ERR_PHY) && - (adapter->hw.phy_type == e1000_phy_igp_3) && - (E1000_READ_REG(&adapter->hw, CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) { - /* See e1000_kumeran_lock_loss_workaround() */ - DPRINTK(LINK, INFO, - "Gigabit has been disabled, downgrading speed\n"); - } + + e1000_check_for_link(&adapter->hw); if (adapter->hw.mac_type == e1000_82573) { e1000_enable_tx_pkt_filtering(&adapter->hw); if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id) @@ -2524,7 +2394,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, uint8_t ipcss, ipcso, tucss, tucso, hdr_len; int err; - if (skb_is_gso(skb)) { + if (skb_shinfo(skb)->gso_size) { if (skb_header_cloned(skb)) { err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err) @@ -2649,7 +2519,7 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, * tso gets written back prematurely before the data is fully * DMA'd to the controller */ if (!skb->data_len && tx_ring->last_tx_tso && - !skb_is_gso(skb)) { + !skb_shinfo(skb)->gso_size) { tx_ring->last_tx_tso = 0; size -= 4; } @@ -2909,10 +2779,9 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) case e1000_82571: case e1000_82572: case e1000_82573: - case e1000_ich8lan: pull_size = min((unsigned int)4, skb->data_len); if (!__pskb_pull_tail(skb, pull_size)) { - DPRINTK(DRV, ERR, + printk(KERN_ERR "__pskb_pull_tail failed.\n"); dev_kfree_skb_any(skb); return NETDEV_TX_OK; @@ -2937,7 +2806,8 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) #ifdef NETIF_F_TSO /* Controller Erratum workaround */ - if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb)) + if (!skb->data_len && tx_ring->last_tx_tso && + !skb_shinfo(skb)->gso_size) count++; #endif @@ -3049,7 +2919,8 @@ e1000_reset_task(struct net_device *netdev) { struct e1000_adapter *adapter = netdev_priv(netdev); - e1000_reinit_locked(adapter); + e1000_down(adapter); + e1000_up(adapter); } /** @@ -3093,7 +2964,6 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) /* Adapter-specific max frame size limits. */ switch (adapter->hw.mac_type) { case e1000_undefined ... e1000_82542_rev2_1: - case e1000_ich8lan: if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) { DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n"); return -EINVAL; @@ -3156,8 +3026,10 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) netdev->mtu = new_mtu; - if (netif_running(netdev)) - e1000_reinit_locked(adapter); + if (netif_running(netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } adapter->hw.max_frame_size = max_frame; @@ -3202,15 +3074,12 @@ e1000_update_stats(struct e1000_adapter *adapter) adapter->stats.bprc += E1000_READ_REG(hw, BPRC); adapter->stats.mprc += E1000_READ_REG(hw, MPRC); adapter->stats.roc += E1000_READ_REG(hw, ROC); - - if (adapter->hw.mac_type != e1000_ich8lan) { adapter->stats.prc64 += E1000_READ_REG(hw, PRC64); adapter->stats.prc127 += E1000_READ_REG(hw, PRC127); adapter->stats.prc255 += E1000_READ_REG(hw, PRC255); adapter->stats.prc511 += E1000_READ_REG(hw, PRC511); adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023); adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522); - } adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS); adapter->stats.mpc += E1000_READ_REG(hw, MPC); @@ -3238,16 +3107,12 @@ e1000_update_stats(struct e1000_adapter *adapter) adapter->stats.totl += E1000_READ_REG(hw, TOTL); adapter->stats.toth += E1000_READ_REG(hw, TOTH); adapter->stats.tpr += E1000_READ_REG(hw, TPR); - - if (adapter->hw.mac_type != e1000_ich8lan) { adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64); adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127); adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255); adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511); adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023); adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522); - } - adapter->stats.mptc += E1000_READ_REG(hw, MPTC); adapter->stats.bptc += E1000_READ_REG(hw, BPTC); @@ -3269,8 +3134,6 @@ e1000_update_stats(struct e1000_adapter *adapter) if (hw->mac_type > e1000_82547_rev_2) { adapter->stats.iac += E1000_READ_REG(hw, IAC); adapter->stats.icrxoc += E1000_READ_REG(hw, ICRXOC); - - if (adapter->hw.mac_type != e1000_ich8lan) { adapter->stats.icrxptc += E1000_READ_REG(hw, ICRXPTC); adapter->stats.icrxatc += E1000_READ_REG(hw, ICRXATC); adapter->stats.ictxptc += E1000_READ_REG(hw, ICTXPTC); @@ -3278,7 +3141,6 @@ e1000_update_stats(struct e1000_adapter *adapter) adapter->stats.ictxqec += E1000_READ_REG(hw, ICTXQEC); adapter->stats.ictxqmtc += E1000_READ_REG(hw, ICTXQMTC); adapter->stats.icrxdmtc += E1000_READ_REG(hw, ICRXDMTC); - } } /* Fill out the OS statistics structure */ @@ -3685,8 +3547,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, /* All receives must fit into a single buffer */ E1000_DBG("%s: Receive packet consumed multiple" " buffers\n", netdev->name); - /* recycle */ - buffer_info-> skb = skb; + dev_kfree_skb_irq(skb); goto next_desc; } @@ -3814,6 +3675,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, buffer_info = &rx_ring->buffer_info[i]; while (staterr & E1000_RXD_STAT_DD) { + buffer_info = &rx_ring->buffer_info[i]; ps_page = &rx_ring->ps_page[i]; ps_page_dma = &rx_ring->ps_page_dma[i]; #ifdef CONFIG_E1000_NAPI @@ -4318,9 +4180,10 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) return retval; } } - if (netif_running(adapter->netdev)) - e1000_reinit_locked(adapter); - else + if (netif_running(adapter->netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } else e1000_reset(adapter); break; case M88E1000_PHY_SPEC_CTRL: @@ -4337,9 +4200,10 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) case PHY_CTRL: if (mii_reg & MII_CR_POWER_DOWN) break; - if (netif_running(adapter->netdev)) - e1000_reinit_locked(adapter); - else + if (netif_running(adapter->netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } else e1000_reset(adapter); break; } @@ -4413,21 +4277,18 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) ctrl |= E1000_CTRL_VME; E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); - if (adapter->hw.mac_type != e1000_ich8lan) { /* enable VLAN receive filtering */ rctl = E1000_READ_REG(&adapter->hw, RCTL); rctl |= E1000_RCTL_VFE; rctl &= ~E1000_RCTL_CFIEN; E1000_WRITE_REG(&adapter->hw, RCTL, rctl); e1000_update_mng_vlan(adapter); - } } else { /* disable VLAN tag insert/strip */ ctrl = E1000_READ_REG(&adapter->hw, CTRL); ctrl &= ~E1000_CTRL_VME; E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); - if (adapter->hw.mac_type != e1000_ich8lan) { /* disable VLAN filtering */ rctl = E1000_READ_REG(&adapter->hw, RCTL); rctl &= ~E1000_RCTL_VFE; @@ -4436,7 +4297,6 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; } - } } e1000_irq_enable(adapter); @@ -4598,16 +4458,12 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) struct e1000_adapter *adapter = netdev_priv(netdev); uint32_t ctrl, ctrl_ext, rctl, manc, status; uint32_t wufc = adapter->wol; -#ifdef CONFIG_PM int retval = 0; -#endif netif_device_detach(netdev); - if (netif_running(netdev)) { - WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); + if (netif_running(netdev)) e1000_down(adapter); - } #ifdef CONFIG_PM /* Implement our own version of pci_save_state(pdev) because pci- @@ -4665,9 +4521,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) pci_enable_wake(pdev, PCI_D3cold, 0); } - /* FIXME: this code is incorrect for PCI Express */ if (adapter->hw.mac_type >= e1000_82540 && - adapter->hw.mac_type != e1000_ich8lan && adapter->hw.media_type == e1000_media_type_copper) { manc = E1000_READ_REG(&adapter->hw, MANC); if (manc & E1000_MANC_SMBUS_EN) { @@ -4678,9 +4532,6 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) } } - if (adapter->hw.phy_type == e1000_phy_igp_3) - e1000_phy_powerdown_workaround(&adapter->hw); - /* Release control of h/w to f/w. If f/w is AMT enabled, this * would have already happened in close and is redundant. */ e1000_release_hw_control(adapter); @@ -4716,9 +4567,7 @@ e1000_resume(struct pci_dev *pdev) netif_device_attach(netdev); - /* FIXME: this code is incorrect for PCI Express */ if (adapter->hw.mac_type >= e1000_82540 && - adapter->hw.mac_type != e1000_ich8lan && adapter->hw.media_type == e1000_media_type_copper) { manc = E1000_READ_REG(&adapter->hw, MANC); manc &= ~(E1000_MANC_ARP_EN); diff --git a/trunk/drivers/net/e1000/e1000_osdep.h b/trunk/drivers/net/e1000/e1000_osdep.h index 2d3e8b06cab0..048d052be29d 100644 --- a/trunk/drivers/net/e1000/e1000_osdep.h +++ b/trunk/drivers/net/e1000/e1000_osdep.h @@ -127,17 +127,4 @@ typedef enum { #define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, STATUS) -#define E1000_WRITE_ICH8_REG(a, reg, value) ( \ - writel((value), ((a)->flash_address + reg))) - -#define E1000_READ_ICH8_REG(a, reg) ( \ - readl((a)->flash_address + reg)) - -#define E1000_WRITE_ICH8_REG16(a, reg, value) ( \ - writew((value), ((a)->flash_address + reg))) - -#define E1000_READ_ICH8_REG16(a, reg) ( \ - readw((a)->flash_address + reg)) - - #endif /* _E1000_OSDEP_H_ */ diff --git a/trunk/drivers/net/e1000/e1000_param.c b/trunk/drivers/net/e1000/e1000_param.c index 0ef413172c68..e55f8969a0fb 100644 --- a/trunk/drivers/net/e1000/e1000_param.c +++ b/trunk/drivers/net/e1000/e1000_param.c @@ -45,16 +45,6 @@ */ #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET } -/* Module Parameters are always initialized to -1, so that the driver - * can tell the difference between no user specified value or the - * user asking for the default value. - * The true default values are loaded in when e1000_check_options is called. - * - * This is a GCC extension to ANSI C. - * See the item "Labeled Elements in Initializers" in the section - * "Extensions to the C Language Family" of the GCC documentation. - */ - #define E1000_PARAM(X, desc) \ static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \ static int num_##X = 0; \ @@ -193,24 +183,6 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay"); E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); -/* Enable Smart Power Down of the PHY - * - * Valid Range: 0, 1 - * - * Default Value: 0 (disabled) - */ - -E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down"); - -/* Enable Kumeran Lock Loss workaround - * - * Valid Range: 0, 1 - * - * Default Value: 1 (enabled) - */ - -E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); - #define AUTONEG_ADV_DEFAULT 0x2F #define AUTONEG_ADV_MASK 0x2F #define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL @@ -324,7 +296,6 @@ e1000_check_options(struct e1000_adapter *adapter) DPRINTK(PROBE, NOTICE, "Warning: no configuration for board #%i\n", bd); DPRINTK(PROBE, NOTICE, "Using defaults for all values\n"); - bd = E1000_MAX_NIC; } { /* Transmit Descriptor Count */ @@ -342,9 +313,14 @@ e1000_check_options(struct e1000_adapter *adapter) opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_TXD : E1000_MAX_82544_TXD; - tx_ring->count = TxDescriptors[bd]; - e1000_validate_option(&tx_ring->count, &opt, adapter); - E1000_ROUNDUP(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE); + if (num_TxDescriptors > bd) { + tx_ring->count = TxDescriptors[bd]; + e1000_validate_option(&tx_ring->count, &opt, adapter); + E1000_ROUNDUP(tx_ring->count, + REQ_TX_DESCRIPTOR_MULTIPLE); + } else { + tx_ring->count = opt.def; + } for (i = 0; i < adapter->num_tx_queues; i++) tx_ring[i].count = tx_ring->count; } @@ -363,9 +339,14 @@ e1000_check_options(struct e1000_adapter *adapter) opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_RXD : E1000_MAX_82544_RXD; - rx_ring->count = RxDescriptors[bd]; - e1000_validate_option(&rx_ring->count, &opt, adapter); - E1000_ROUNDUP(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE); + if (num_RxDescriptors > bd) { + rx_ring->count = RxDescriptors[bd]; + e1000_validate_option(&rx_ring->count, &opt, adapter); + E1000_ROUNDUP(rx_ring->count, + REQ_RX_DESCRIPTOR_MULTIPLE); + } else { + rx_ring->count = opt.def; + } for (i = 0; i < adapter->num_rx_queues; i++) rx_ring[i].count = rx_ring->count; } @@ -377,9 +358,13 @@ e1000_check_options(struct e1000_adapter *adapter) .def = OPTION_ENABLED }; - int rx_csum = XsumRX[bd]; - e1000_validate_option(&rx_csum, &opt, adapter); - adapter->rx_csum = rx_csum; + if (num_XsumRX > bd) { + int rx_csum = XsumRX[bd]; + e1000_validate_option(&rx_csum, &opt, adapter); + adapter->rx_csum = rx_csum; + } else { + adapter->rx_csum = opt.def; + } } { /* Flow Control */ @@ -399,9 +384,13 @@ e1000_check_options(struct e1000_adapter *adapter) .p = fc_list }} }; - int fc = FlowControl[bd]; - e1000_validate_option(&fc, &opt, adapter); - adapter->hw.fc = adapter->hw.original_fc = fc; + if (num_FlowControl > bd) { + int fc = FlowControl[bd]; + e1000_validate_option(&fc, &opt, adapter); + adapter->hw.fc = adapter->hw.original_fc = fc; + } else { + adapter->hw.fc = adapter->hw.original_fc = opt.def; + } } { /* Transmit Interrupt Delay */ struct e1000_option opt = { @@ -413,8 +402,13 @@ e1000_check_options(struct e1000_adapter *adapter) .max = MAX_TXDELAY }} }; - adapter->tx_int_delay = TxIntDelay[bd]; - e1000_validate_option(&adapter->tx_int_delay, &opt, adapter); + if (num_TxIntDelay > bd) { + adapter->tx_int_delay = TxIntDelay[bd]; + e1000_validate_option(&adapter->tx_int_delay, &opt, + adapter); + } else { + adapter->tx_int_delay = opt.def; + } } { /* Transmit Absolute Interrupt Delay */ struct e1000_option opt = { @@ -426,9 +420,13 @@ e1000_check_options(struct e1000_adapter *adapter) .max = MAX_TXABSDELAY }} }; - adapter->tx_abs_int_delay = TxAbsIntDelay[bd]; - e1000_validate_option(&adapter->tx_abs_int_delay, &opt, - adapter); + if (num_TxAbsIntDelay > bd) { + adapter->tx_abs_int_delay = TxAbsIntDelay[bd]; + e1000_validate_option(&adapter->tx_abs_int_delay, &opt, + adapter); + } else { + adapter->tx_abs_int_delay = opt.def; + } } { /* Receive Interrupt Delay */ struct e1000_option opt = { @@ -440,8 +438,13 @@ e1000_check_options(struct e1000_adapter *adapter) .max = MAX_RXDELAY }} }; - adapter->rx_int_delay = RxIntDelay[bd]; - e1000_validate_option(&adapter->rx_int_delay, &opt, adapter); + if (num_RxIntDelay > bd) { + adapter->rx_int_delay = RxIntDelay[bd]; + e1000_validate_option(&adapter->rx_int_delay, &opt, + adapter); + } else { + adapter->rx_int_delay = opt.def; + } } { /* Receive Absolute Interrupt Delay */ struct e1000_option opt = { @@ -453,9 +456,13 @@ e1000_check_options(struct e1000_adapter *adapter) .max = MAX_RXABSDELAY }} }; - adapter->rx_abs_int_delay = RxAbsIntDelay[bd]; - e1000_validate_option(&adapter->rx_abs_int_delay, &opt, - adapter); + if (num_RxAbsIntDelay > bd) { + adapter->rx_abs_int_delay = RxAbsIntDelay[bd]; + e1000_validate_option(&adapter->rx_abs_int_delay, &opt, + adapter); + } else { + adapter->rx_abs_int_delay = opt.def; + } } { /* Interrupt Throttling Rate */ struct e1000_option opt = { @@ -467,44 +474,26 @@ e1000_check_options(struct e1000_adapter *adapter) .max = MAX_ITR }} }; - adapter->itr = InterruptThrottleRate[bd]; - switch (adapter->itr) { - case 0: - DPRINTK(PROBE, INFO, "%s turned off\n", opt.name); - break; - case 1: - DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", - opt.name); - break; - default: - e1000_validate_option(&adapter->itr, &opt, adapter); - break; + if (num_InterruptThrottleRate > bd) { + adapter->itr = InterruptThrottleRate[bd]; + switch (adapter->itr) { + case 0: + DPRINTK(PROBE, INFO, "%s turned off\n", + opt.name); + break; + case 1: + DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", + opt.name); + break; + default: + e1000_validate_option(&adapter->itr, &opt, + adapter); + break; + } + } else { + adapter->itr = opt.def; } } - { /* Smart Power Down */ - struct e1000_option opt = { - .type = enable_option, - .name = "PHY Smart Power Down", - .err = "defaulting to Disabled", - .def = OPTION_DISABLED - }; - - int spd = SmartPowerDownEnable[bd]; - e1000_validate_option(&spd, &opt, adapter); - adapter->smart_power_down = spd; - } - { /* Kumeran Lock Loss Workaround */ - struct e1000_option opt = { - .type = enable_option, - .name = "Kumeran Lock Loss Workaround", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED - }; - - int kmrn_lock_loss = KumeranLockLoss[bd]; - e1000_validate_option(&kmrn_lock_loss, &opt, adapter); - adapter->hw.kmrn_lock_loss_workaround_disabled = !kmrn_lock_loss; - } switch (adapter->hw.media_type) { case e1000_media_type_fiber: @@ -530,18 +519,17 @@ static void __devinit e1000_check_fiber_options(struct e1000_adapter *adapter) { int bd = adapter->bd_number; - bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd; - if ((Speed[bd] != OPTION_UNSET)) { + if (num_Speed > bd) { DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, " "parameter ignored\n"); } - if ((Duplex[bd] != OPTION_UNSET)) { + if (num_Duplex > bd) { DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, " "parameter ignored\n"); } - if ((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) { + if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) { DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is " "not valid for fiber adapters, " "parameter ignored\n"); @@ -560,7 +548,6 @@ e1000_check_copper_options(struct e1000_adapter *adapter) { int speed, dplx, an; int bd = adapter->bd_number; - bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd; { /* Speed */ struct e1000_opt_list speed_list[] = {{ 0, "" }, @@ -577,8 +564,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter) .p = speed_list }} }; - speed = Speed[bd]; - e1000_validate_option(&speed, &opt, adapter); + if (num_Speed > bd) { + speed = Speed[bd]; + e1000_validate_option(&speed, &opt, adapter); + } else { + speed = opt.def; + } } { /* Duplex */ struct e1000_opt_list dplx_list[] = {{ 0, "" }, @@ -600,11 +591,15 @@ e1000_check_copper_options(struct e1000_adapter *adapter) "Speed/Duplex/AutoNeg parameter ignored.\n"); return; } - dplx = Duplex[bd]; - e1000_validate_option(&dplx, &opt, adapter); + if (num_Duplex > bd) { + dplx = Duplex[bd]; + e1000_validate_option(&dplx, &opt, adapter); + } else { + dplx = opt.def; + } } - if (AutoNeg[bd] != OPTION_UNSET && (speed != 0 || dplx != 0)) { + if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) { DPRINTK(PROBE, INFO, "AutoNeg specified along with Speed or Duplex, " "parameter ignored\n"); @@ -653,15 +648,19 @@ e1000_check_copper_options(struct e1000_adapter *adapter) .p = an_list }} }; - an = AutoNeg[bd]; - e1000_validate_option(&an, &opt, adapter); + if (num_AutoNeg > bd) { + an = AutoNeg[bd]; + e1000_validate_option(&an, &opt, adapter); + } else { + an = opt.def; + } adapter->hw.autoneg_advertised = an; } switch (speed + dplx) { case 0: adapter->hw.autoneg = adapter->fc_autoneg = 1; - if (Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET) + if ((num_Speed > bd) && (speed != 0 || dplx != 0)) DPRINTK(PROBE, INFO, "Speed and duplex autonegotiation enabled\n"); break; diff --git a/trunk/drivers/net/forcedeth.c b/trunk/drivers/net/forcedeth.c index 11b8f1b43dd5..037d870712ff 100644 --- a/trunk/drivers/net/forcedeth.c +++ b/trunk/drivers/net/forcedeth.c @@ -240,12 +240,10 @@ enum { #define NVREG_RNDSEED_FORCE2 0x2d00 #define NVREG_RNDSEED_FORCE3 0x7400 - NvRegTxDeferral = 0xA0, -#define NVREG_TX_DEFERRAL_DEFAULT 0x15050f -#define NVREG_TX_DEFERRAL_RGMII_10_100 0x16070f -#define NVREG_TX_DEFERRAL_RGMII_1000 0x14050f - NvRegRxDeferral = 0xA4, -#define NVREG_RX_DEFERRAL_DEFAULT 0x16 + NvRegUnknownSetupReg1 = 0xA0, +#define NVREG_UNKSETUP1_VAL 0x16070f + NvRegUnknownSetupReg2 = 0xA4, +#define NVREG_UNKSETUP2_VAL 0x16 NvRegMacAddrA = 0xA8, NvRegMacAddrB = 0xAC, NvRegMulticastAddrA = 0xB0, @@ -271,10 +269,8 @@ enum { #define NVREG_LINKSPEED_MASK (0xFFF) NvRegUnknownSetupReg5 = 0x130, #define NVREG_UNKSETUP5_BIT31 (1<<31) - NvRegTxWatermark = 0x13c, -#define NVREG_TX_WM_DESC1_DEFAULT 0x0200010 -#define NVREG_TX_WM_DESC2_3_DEFAULT 0x1e08000 -#define NVREG_TX_WM_DESC2_3_1000 0xfe08000 + NvRegUnknownSetupReg3 = 0x13c, +#define NVREG_UNKSETUP3_VAL1 0x200010 NvRegTxRxControl = 0x144, #define NVREG_TXRXCTL_KICK 0x0001 #define NVREG_TXRXCTL_BIT1 0x0002 @@ -662,7 +658,7 @@ static const struct register_test nv_registers_test[] = { { NvRegMisc1, 0x03c }, { NvRegOffloadConfig, 0x03ff }, { NvRegMulticastAddrA, 0xffffffff }, - { NvRegTxWatermark, 0x0ff }, + { NvRegUnknownSetupReg3, 0x0ff }, { NvRegWakeUpFlags, 0x07777 }, { 0,0 } }; @@ -1499,7 +1495,7 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) np->tx_skbuff[nr] = skb; #ifdef NETIF_F_TSO - if (skb_is_gso(skb)) + if (skb_shinfo(skb)->gso_size) tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT); else #endif @@ -2131,7 +2127,7 @@ static int nv_update_linkspeed(struct net_device *dev) int newdup = np->duplex; int mii_status; int retval = 0; - u32 control_1000, status_1000, phyreg, pause_flags, txreg; + u32 control_1000, status_1000, phyreg, pause_flags; /* BMSR_LSTATUS is latched, read it twice: * we want the current value. @@ -2249,26 +2245,6 @@ static int nv_update_linkspeed(struct net_device *dev) phyreg |= PHY_1000; writel(phyreg, base + NvRegPhyInterface); - if (phyreg & PHY_RGMII) { - if ((np->linkspeed & NVREG_LINKSPEED_MASK) == NVREG_LINKSPEED_1000) - txreg = NVREG_TX_DEFERRAL_RGMII_1000; - else - txreg = NVREG_TX_DEFERRAL_RGMII_10_100; - } else { - txreg = NVREG_TX_DEFERRAL_DEFAULT; - } - writel(txreg, base + NvRegTxDeferral); - - if (np->desc_ver == DESC_VER_1) { - txreg = NVREG_TX_WM_DESC1_DEFAULT; - } else { - if ((np->linkspeed & NVREG_LINKSPEED_MASK) == NVREG_LINKSPEED_1000) - txreg = NVREG_TX_WM_DESC2_3_1000; - else - txreg = NVREG_TX_WM_DESC2_3_DEFAULT; - } - writel(txreg, base + NvRegTxWatermark); - writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD), base + NvRegMisc1); pci_push(base); @@ -3934,10 +3910,7 @@ static int nv_open(struct net_device *dev) /* 5) continue setup */ writel(np->linkspeed, base + NvRegLinkSpeed); - if (np->desc_ver == DESC_VER_1) - writel(NVREG_TX_WM_DESC1_DEFAULT, base + NvRegTxWatermark); - else - writel(NVREG_TX_WM_DESC2_3_DEFAULT, base + NvRegTxWatermark); + writel(NVREG_UNKSETUP3_VAL1, base + NvRegUnknownSetupReg3); writel(np->txrxctl_bits, base + NvRegTxRxControl); writel(np->vlanctl_bits, base + NvRegVlanControl); pci_push(base); @@ -3959,8 +3932,8 @@ static int nv_open(struct net_device *dev) writel(readl(base + NvRegReceiverStatus), base + NvRegReceiverStatus); get_random_bytes(&i, sizeof(i)); writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed); - writel(NVREG_TX_DEFERRAL_DEFAULT, base + NvRegTxDeferral); - writel(NVREG_RX_DEFERRAL_DEFAULT, base + NvRegRxDeferral); + writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1); + writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2); if (poll_interval == -1) { if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT) writel(NVREG_POLL_DEFAULT_THROUGHPUT, base + NvRegPollingInterval); diff --git a/trunk/drivers/net/hamradio/bpqether.c b/trunk/drivers/net/hamradio/bpqether.c index 889f338132fa..0641f54fc638 100644 --- a/trunk/drivers/net/hamradio/bpqether.c +++ b/trunk/drivers/net/hamradio/bpqether.c @@ -122,12 +122,6 @@ struct bpqdev { static LIST_HEAD(bpq_devices); -/* - * bpqether network devices are paired with ethernet devices below them, so - * form a special "super class" of normal ethernet devices; split their locks - * off into a separate class since they always nest. - */ -static struct lock_class_key bpq_netdev_xmit_lock_key; /* ------------------------------------------------------------------------ */ @@ -534,7 +528,6 @@ static int bpq_new_device(struct net_device *edev) err = register_netdevice(ndev); if (err) goto error; - lockdep_set_class(&ndev->_xmit_lock, &bpq_netdev_xmit_lock_key); /* List protected by RTNL */ list_add_rcu(&bpq->bpq_list, &bpq_devices); diff --git a/trunk/drivers/net/irda/ali-ircc.c b/trunk/drivers/net/irda/ali-ircc.c index e3c8cd5eca67..bf1fca5a3fa0 100644 --- a/trunk/drivers/net/irda/ali-ircc.c +++ b/trunk/drivers/net/irda/ali-ircc.c @@ -146,7 +146,7 @@ static int __init ali_ircc_init(void) { ali_chip_t *chip; chipio_t info; - int ret; + int ret = -ENODEV; int cfg, cfg_base; int reg, revision; int i = 0; @@ -160,7 +160,6 @@ static int __init ali_ircc_init(void) return ret; } - ret = -ENODEV; /* Probe for all the ALi chipsets we know about */ for (chip= chips; chip->name; chip++, i++) diff --git a/trunk/drivers/net/irda/smsc-ircc2.c b/trunk/drivers/net/irda/smsc-ircc2.c index 2eff45bedc7c..a4674044bd6f 100644 --- a/trunk/drivers/net/irda/smsc-ircc2.c +++ b/trunk/drivers/net/irda/smsc-ircc2.c @@ -2353,7 +2353,7 @@ static int __init smsc_superio_lpc(unsigned short cfg_base) #ifdef CONFIG_PCI #define PCIID_VENDOR_INTEL 0x8086 #define PCIID_VENDOR_ALI 0x10b9 -static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __initdata = { +static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __devinitdata = { { .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */ .device = 0x24cc, diff --git a/trunk/drivers/net/ixgb/ixgb_main.c b/trunk/drivers/net/ixgb/ixgb_main.c index 7bbd447289b5..b91e082483f6 100644 --- a/trunk/drivers/net/ixgb/ixgb_main.c +++ b/trunk/drivers/net/ixgb/ixgb_main.c @@ -1173,7 +1173,7 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) uint16_t ipcse, tucse, mss; int err; - if (likely(skb_is_gso(skb))) { + if(likely(skb_shinfo(skb)->gso_size)) { if (skb_header_cloned(skb)) { err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (err) @@ -1281,7 +1281,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb, while(len) { buffer_info = &tx_ring->buffer_info[i]; - size = min(len, IXGB_MAX_DATA_PER_TXD); + size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); buffer_info->length = size; buffer_info->dma = pci_map_single(adapter->pdev, @@ -1306,7 +1306,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb, while(len) { buffer_info = &tx_ring->buffer_info[i]; - size = min(len, IXGB_MAX_DATA_PER_TXD); + size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); buffer_info->length = size; buffer_info->dma = pci_map_page(adapter->pdev, diff --git a/trunk/drivers/net/loopback.c b/trunk/drivers/net/loopback.c index 997cbce9af6e..43fef7de8cb9 100644 --- a/trunk/drivers/net/loopback.c +++ b/trunk/drivers/net/loopback.c @@ -139,7 +139,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) #endif #ifdef LOOPBACK_TSO - if (skb_is_gso(skb)) { + if (skb_shinfo(skb)->gso_size) { BUG_ON(skb->protocol != htons(ETH_P_IP)); BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP); diff --git a/trunk/drivers/net/myri10ge/myri10ge.c b/trunk/drivers/net/myri10ge/myri10ge.c index 07ca9480a6fe..f4c8fd373b9b 100644 --- a/trunk/drivers/net/myri10ge/myri10ge.c +++ b/trunk/drivers/net/myri10ge/myri10ge.c @@ -2116,7 +2116,7 @@ static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev) } idx = (idx + 1) & tx->mask; } while (idx != last_idx); - if (skb_is_gso(skb)) { + if (skb_shinfo(skb)->gso_size) { printk(KERN_ERR "myri10ge: %s: TSO but wanted to linearize?!?!?\n", mgp->dev->name); @@ -2412,20 +2412,14 @@ static int myri10ge_resume(struct pci_dev *pdev) return -EIO; } myri10ge_restore_state(mgp); - - status = pci_enable_device(pdev); - if (status < 0) { - dev_err(&pdev->dev, "failed to enable device\n"); - return -EIO; - } - + pci_enable_device(pdev); pci_set_master(pdev); status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED, netdev->name, mgp); if (status != 0) { dev_err(&pdev->dev, "failed to allocate IRQ\n"); - goto abort_with_enabled; + goto abort_with_msi; } myri10ge_reset(mgp); @@ -2444,8 +2438,7 @@ static int myri10ge_resume(struct pci_dev *pdev) return 0; -abort_with_enabled: - pci_disable_device(pdev); +abort_with_msi: return -EIO; } diff --git a/trunk/drivers/net/s2io.c b/trunk/drivers/net/s2io.c index e1fe3a0a7b0b..c6b77acb35ef 100644 --- a/trunk/drivers/net/s2io.c +++ b/trunk/drivers/net/s2io.c @@ -1976,6 +1976,7 @@ static int start_nic(struct s2io_nic *nic) XENA_dev_config_t __iomem *bar0 = nic->bar0; struct net_device *dev = nic->dev; register u64 val64 = 0; + u16 interruptible; u16 subid, i; mac_info_t *mac_control; struct config_param *config; @@ -2046,6 +2047,16 @@ static int start_nic(struct s2io_nic *nic) return FAILURE; } + /* Enable select interrupts */ + if (nic->intr_type != INTA) + en_dis_able_nic_intrs(nic, ENA_ALL_INTRS, DISABLE_INTRS); + else { + interruptible = TX_TRAFFIC_INTR | RX_TRAFFIC_INTR; + interruptible |= TX_PIC_INTR | RX_PIC_INTR; + interruptible |= TX_MAC_INTR | RX_MAC_INTR; + en_dis_able_nic_intrs(nic, interruptible, ENABLE_INTRS); + } + /* * With some switches, link might be already up at this point. * Because of this weird behavior, when we enable laser, @@ -3738,19 +3749,101 @@ static int s2io_open(struct net_device *dev) if (err) { DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n", dev->name); - goto hw_init_failed; + if (err == -ENODEV) + goto hw_init_failed; + else + goto hw_enable_failed; + } + + /* Store the values of the MSIX table in the nic_t structure */ + store_xmsi_data(sp); + + /* After proper initialization of H/W, register ISR */ + if (sp->intr_type == MSI) { + err = request_irq((int) sp->pdev->irq, s2io_msi_handle, + IRQF_SHARED, sp->name, dev); + if (err) { + DBG_PRINT(ERR_DBG, "%s: MSI registration \ +failed\n", dev->name); + goto isr_registration_failed; + } + } + if (sp->intr_type == MSI_X) { + int i; + + for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) { + if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) { + sprintf(sp->desc1, "%s:MSI-X-%d-TX", + dev->name, i); + err = request_irq(sp->entries[i].vector, + s2io_msix_fifo_handle, 0, sp->desc1, + sp->s2io_entries[i].arg); + DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc1, + (unsigned long long)sp->msix_info[i].addr); + } else { + sprintf(sp->desc2, "%s:MSI-X-%d-RX", + dev->name, i); + err = request_irq(sp->entries[i].vector, + s2io_msix_ring_handle, 0, sp->desc2, + sp->s2io_entries[i].arg); + DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc2, + (unsigned long long)sp->msix_info[i].addr); + } + if (err) { + DBG_PRINT(ERR_DBG, "%s: MSI-X-%d registration \ +failed\n", dev->name, i); + DBG_PRINT(ERR_DBG, "Returned: %d\n", err); + goto isr_registration_failed; + } + sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS; + } + } + if (sp->intr_type == INTA) { + err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED, + sp->name, dev); + if (err) { + DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n", + dev->name); + goto isr_registration_failed; + } } if (s2io_set_mac_addr(dev, dev->dev_addr) == FAILURE) { DBG_PRINT(ERR_DBG, "Set Mac Address Failed\n"); - s2io_card_down(sp); err = -ENODEV; - goto hw_init_failed; + goto setting_mac_address_failed; } netif_start_queue(dev); return 0; +setting_mac_address_failed: + if (sp->intr_type != MSI_X) + free_irq(sp->pdev->irq, dev); +isr_registration_failed: + del_timer_sync(&sp->alarm_timer); + if (sp->intr_type == MSI_X) { + int i; + u16 msi_control; /* Temp variable */ + + for (i=1; (sp->s2io_entries[i].in_use == + MSIX_REGISTERED_SUCCESS); i++) { + int vector = sp->entries[i].vector; + void *arg = sp->s2io_entries[i].arg; + + free_irq(vector, arg); + } + pci_disable_msix(sp->pdev); + + /* Temp */ + pci_read_config_word(sp->pdev, 0x42, &msi_control); + msi_control &= 0xFFFE; /* Disable MSI */ + pci_write_config_word(sp->pdev, 0x42, msi_control); + } + else if (sp->intr_type == MSI) + pci_disable_msi(sp->pdev); +hw_enable_failed: + s2io_reset(sp); hw_init_failed: if (sp->intr_type == MSI_X) { if (sp->entries) @@ -3781,7 +3874,7 @@ static int s2io_close(struct net_device *dev) flush_scheduled_work(); netif_stop_queue(dev); /* Reset card, kill tasklet and free Tx and Rx buffers. */ - s2io_card_down(sp); + s2io_card_down(sp, 1); sp->device_close_flag = TRUE; /* Device is shut down. */ return 0; @@ -5826,7 +5919,7 @@ static int s2io_change_mtu(struct net_device *dev, int new_mtu) dev->mtu = new_mtu; if (netif_running(dev)) { - s2io_card_down(sp); + s2io_card_down(sp, 0); netif_stop_queue(dev); if (s2io_card_up(sp)) { DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n", @@ -6123,106 +6216,43 @@ static int rxd_owner_bit_reset(nic_t *sp) } -static int s2io_add_isr(nic_t * sp) +static void s2io_card_down(nic_t * sp, int flag) { - int ret = 0; + int cnt = 0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; + unsigned long flags; + register u64 val64 = 0; struct net_device *dev = sp->dev; - int err = 0; - if (sp->intr_type == MSI) - ret = s2io_enable_msi(sp); - else if (sp->intr_type == MSI_X) - ret = s2io_enable_msi_x(sp); - if (ret) { - DBG_PRINT(ERR_DBG, "%s: Defaulting to INTA\n", dev->name); - sp->intr_type = INTA; + del_timer_sync(&sp->alarm_timer); + /* If s2io_set_link task is executing, wait till it completes. */ + while (test_and_set_bit(0, &(sp->link_state))) { + msleep(50); } + atomic_set(&sp->card_state, CARD_DOWN); - /* Store the values of the MSIX table in the nic_t structure */ - store_xmsi_data(sp); + /* disable Tx and Rx traffic on the NIC */ + stop_nic(sp); + if (flag) { + if (sp->intr_type == MSI_X) { + int i; + u16 msi_control; - /* After proper initialization of H/W, register ISR */ - if (sp->intr_type == MSI) { - err = request_irq((int) sp->pdev->irq, s2io_msi_handle, - IRQF_SHARED, sp->name, dev); - if (err) { - pci_disable_msi(sp->pdev); - DBG_PRINT(ERR_DBG, "%s: MSI registration failed\n", - dev->name); - return -1; - } - } - if (sp->intr_type == MSI_X) { - int i; + for (i=1; (sp->s2io_entries[i].in_use == + MSIX_REGISTERED_SUCCESS); i++) { + int vector = sp->entries[i].vector; + void *arg = sp->s2io_entries[i].arg; - for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) { - if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) { - sprintf(sp->desc[i], "%s:MSI-X-%d-TX", - dev->name, i); - err = request_irq(sp->entries[i].vector, - s2io_msix_fifo_handle, 0, sp->desc[i], - sp->s2io_entries[i].arg); - DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i], - (unsigned long long)sp->msix_info[i].addr); - } else { - sprintf(sp->desc[i], "%s:MSI-X-%d-RX", - dev->name, i); - err = request_irq(sp->entries[i].vector, - s2io_msix_ring_handle, 0, sp->desc[i], - sp->s2io_entries[i].arg); - DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i], - (unsigned long long)sp->msix_info[i].addr); - } - if (err) { - DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration " - "failed\n", dev->name, i); - DBG_PRINT(ERR_DBG, "Returned: %d\n", err); - return -1; + free_irq(vector, arg); } - sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS; - } - } - if (sp->intr_type == INTA) { - err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED, - sp->name, dev); - if (err) { - DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n", - dev->name); - return -1; - } - } - return 0; -} -static void s2io_rem_isr(nic_t * sp) -{ - int cnt = 0; - struct net_device *dev = sp->dev; - - if (sp->intr_type == MSI_X) { - int i; - u16 msi_control; - - for (i=1; (sp->s2io_entries[i].in_use == - MSIX_REGISTERED_SUCCESS); i++) { - int vector = sp->entries[i].vector; - void *arg = sp->s2io_entries[i].arg; - - free_irq(vector, arg); - } - pci_read_config_word(sp->pdev, 0x42, &msi_control); - msi_control &= 0xFFFE; /* Disable MSI */ - pci_write_config_word(sp->pdev, 0x42, msi_control); - - pci_disable_msix(sp->pdev); - } else { - free_irq(sp->pdev->irq, dev); - if (sp->intr_type == MSI) { - u16 val; - - pci_disable_msi(sp->pdev); - pci_read_config_word(sp->pdev, 0x4c, &val); - val ^= 0x1; - pci_write_config_word(sp->pdev, 0x4c, val); + pci_read_config_word(sp->pdev, 0x42, &msi_control); + msi_control &= 0xFFFE; /* Disable MSI */ + pci_write_config_word(sp->pdev, 0x42, msi_control); + pci_disable_msix(sp->pdev); + } else { + free_irq(sp->pdev->irq, dev); + if (sp->intr_type == MSI) + pci_disable_msi(sp->pdev); } } /* Waiting till all Interrupt handlers are complete */ @@ -6233,26 +6263,6 @@ static void s2io_rem_isr(nic_t * sp) break; cnt++; } while(cnt < 5); -} - -static void s2io_card_down(nic_t * sp) -{ - int cnt = 0; - XENA_dev_config_t __iomem *bar0 = sp->bar0; - unsigned long flags; - register u64 val64 = 0; - - del_timer_sync(&sp->alarm_timer); - /* If s2io_set_link task is executing, wait till it completes. */ - while (test_and_set_bit(0, &(sp->link_state))) { - msleep(50); - } - atomic_set(&sp->card_state, CARD_DOWN); - - /* disable Tx and Rx traffic on the NIC */ - stop_nic(sp); - - s2io_rem_isr(sp); /* Kill tasklet. */ tasklet_kill(&sp->task); @@ -6304,16 +6314,23 @@ static int s2io_card_up(nic_t * sp) mac_info_t *mac_control; struct config_param *config; struct net_device *dev = (struct net_device *) sp->dev; - u16 interruptible; /* Initialize the H/W I/O registers */ if (init_nic(sp) != 0) { DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n", dev->name); - s2io_reset(sp); return -ENODEV; } + if (sp->intr_type == MSI) + ret = s2io_enable_msi(sp); + else if (sp->intr_type == MSI_X) + ret = s2io_enable_msi_x(sp); + if (ret) { + DBG_PRINT(ERR_DBG, "%s: Defaulting to INTA\n", dev->name); + sp->intr_type = INTA; + } + /* * Initializing the Rx buffers. For now we are considering only 1 * Rx ring and initializing buffers into 30 Rx blocks @@ -6344,39 +6361,21 @@ static int s2io_card_up(nic_t * sp) sp->lro_max_aggr_per_sess = lro_max_pkts; } + /* Enable tasklet for the device */ + tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev); + /* Enable Rx Traffic and interrupts on the NIC */ if (start_nic(sp)) { DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name); + tasklet_kill(&sp->task); s2io_reset(sp); - free_rx_buffers(sp); - return -ENODEV; - } - - /* Add interrupt service routine */ - if (s2io_add_isr(sp) != 0) { - if (sp->intr_type == MSI_X) - s2io_rem_isr(sp); - s2io_reset(sp); + free_irq(dev->irq, dev); free_rx_buffers(sp); return -ENODEV; } S2IO_TIMER_CONF(sp->alarm_timer, s2io_alarm_handle, sp, (HZ/2)); - /* Enable tasklet for the device */ - tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev); - - /* Enable select interrupts */ - if (sp->intr_type != INTA) - en_dis_able_nic_intrs(sp, ENA_ALL_INTRS, DISABLE_INTRS); - else { - interruptible = TX_TRAFFIC_INTR | RX_TRAFFIC_INTR; - interruptible |= TX_PIC_INTR | RX_PIC_INTR; - interruptible |= TX_MAC_INTR | RX_MAC_INTR; - en_dis_able_nic_intrs(sp, interruptible, ENABLE_INTRS); - } - - atomic_set(&sp->card_state, CARD_UP); return 0; } @@ -6396,7 +6395,7 @@ static void s2io_restart_nic(unsigned long data) struct net_device *dev = (struct net_device *) data; nic_t *sp = dev->priv; - s2io_card_down(sp); + s2io_card_down(sp, 0); if (s2io_card_up(sp)) { DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n", dev->name); diff --git a/trunk/drivers/net/s2io.h b/trunk/drivers/net/s2io.h index 217097bc22f1..c43f52179708 100644 --- a/trunk/drivers/net/s2io.h +++ b/trunk/drivers/net/s2io.h @@ -829,7 +829,8 @@ struct s2io_nic { #define MSIX_FLG 0xA5 struct msix_entry *entries; struct s2io_msix_entry *s2io_entries; - char desc[MAX_REQUESTED_MSI_X][25]; + char desc1[35]; + char desc2[35]; int avail_msix_vectors; /* No. of MSI-X vectors granted by system */ @@ -1001,7 +1002,7 @@ static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); static struct ethtool_ops netdev_ethtool_ops; static void s2io_set_link(unsigned long data); static int s2io_set_swapper(nic_t * sp); -static void s2io_card_down(nic_t *nic); +static void s2io_card_down(nic_t *nic, int flag); static int s2io_card_up(nic_t *nic); static int get_xena_rev_id(struct pci_dev *pdev); static void restore_xmsi_data(nic_t *nic); diff --git a/trunk/drivers/net/sk98lin/h/xmac_ii.h b/trunk/drivers/net/sk98lin/h/xmac_ii.h index 7f8e6d0084c7..2b19f8ad0318 100644 --- a/trunk/drivers/net/sk98lin/h/xmac_ii.h +++ b/trunk/drivers/net/sk98lin/h/xmac_ii.h @@ -1473,7 +1473,7 @@ extern "C" { #define GM_TXCR_FORCE_JAM (1<<15) /* Bit 15: Force Jam / Flow-Control */ #define GM_TXCR_CRC_DIS (1<<14) /* Bit 14: Disable insertion of CRC */ #define GM_TXCR_PAD_DIS (1<<13) /* Bit 13: Disable padding of packets */ -#define GM_TXCR_COL_THR_MSK (7<<10) /* Bit 12..10: Collision Threshold */ +#define GM_TXCR_COL_THR_MSK (1<<10) /* Bit 12..10: Collision Threshold */ #define TX_COL_THR(x) (SHIFT10(x) & GM_TXCR_COL_THR_MSK) diff --git a/trunk/drivers/net/skge.h b/trunk/drivers/net/skge.h index 593387b3c0dd..ed19ff47ce11 100644 --- a/trunk/drivers/net/skge.h +++ b/trunk/drivers/net/skge.h @@ -1734,11 +1734,11 @@ enum { GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ - GM_TXCR_COL_THR_MSK = 7<<10, /* Bit 12..10: Collision Threshold */ + GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ }; #define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) -#define TX_COL_DEF 0x04 /* late collision after 64 byte */ +#define TX_COL_DEF 0x04 /* GM_RX_CTRL 16 bit r/w Receive Control Register */ enum { diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c index d98f28c34e5c..418f169a6a31 100644 --- a/trunk/drivers/net/sky2.c +++ b/trunk/drivers/net/sky2.c @@ -65,7 +65,6 @@ #define RX_MAX_PENDING (RX_LE_SIZE/2 - 2) #define RX_DEF_PENDING RX_MAX_PENDING #define RX_SKB_ALIGN 8 -#define RX_BUF_WRITE 16 #define TX_RING_SIZE 512 #define TX_DEF_PENDING (TX_RING_SIZE - 1) @@ -235,6 +234,7 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state) } if (hw->chip_id == CHIP_ID_YUKON_EC_U) { + sky2_write16(hw, B0_CTST, Y2_HW_WOL_ON); sky2_pci_write32(hw, PCI_DEV_REG3, 0); reg1 = sky2_pci_read32(hw, PCI_DEV_REG4); reg1 &= P_ASPM_CONTROL_MSK; @@ -243,7 +243,6 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state) } sky2_pci_write32(hw, PCI_DEV_REG1, reg1); - udelay(100); break; @@ -256,7 +255,6 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state) else reg1 |= (PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); sky2_pci_write32(hw, PCI_DEV_REG1, reg1); - udelay(100); if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) sky2_write8(hw, B2_Y2_CLK_GATE, 0); @@ -1161,7 +1159,7 @@ static unsigned tx_le_req(const struct sk_buff *skb) count = sizeof(dma_addr_t) / sizeof(u32); count += skb_shinfo(skb)->nr_frags * count; - if (skb_is_gso(skb)) + if (skb_shinfo(skb)->gso_size) ++count; if (skb->ip_summed == CHECKSUM_HW) @@ -1391,7 +1389,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) } sky2->tx_cons = put; - if (tx_avail(sky2) > MAX_SKB_TX_LE + 4) + if (tx_avail(sky2) > MAX_SKB_TX_LE) netif_wake_queue(dev); } @@ -1890,6 +1888,9 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2, re->skb->ip_summed = CHECKSUM_NONE; sky2_rx_add(sky2, re->mapaddr); + /* Tell receiver about new buffers. */ + sky2_put_idx(sky2->hw, rxqaddr[sky2->port], sky2->rx_put); + return skb; oversize: @@ -1936,9 +1937,7 @@ static inline int sky2_more_work(const struct sky2_hw *hw) /* Process status response ring */ static int sky2_status_intr(struct sky2_hw *hw, int to_do) { - struct sky2_port *sky2; int work_done = 0; - unsigned buf_write[2] = { 0, 0 }; u16 hwidx = sky2_read16(hw, STAT_PUT_IDX); rmb(); @@ -1946,6 +1945,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) while (hw->st_idx != hwidx) { struct sky2_status_le *le = hw->st_le + hw->st_idx; struct net_device *dev; + struct sky2_port *sky2; struct sk_buff *skb; u32 status; u16 length; @@ -1978,14 +1978,6 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) #endif netif_receive_skb(skb); - /* Update receiver after 16 frames */ - if (++buf_write[le->link] == RX_BUF_WRITE) { - sky2_put_idx(hw, rxqaddr[le->link], - sky2->rx_put); - buf_write[le->link] = 0; - } - - /* Stop after net poll weight */ if (++work_done >= to_do) goto exit_loop; break; @@ -2024,16 +2016,6 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) } exit_loop: - if (buf_write[0]) { - sky2 = netdev_priv(hw->dev[0]); - sky2_put_idx(hw, Q_R1, sky2->rx_put); - } - - if (buf_write[1]) { - sky2 = netdev_priv(hw->dev[1]); - sky2_put_idx(hw, Q_R2, sky2->rx_put); - } - return work_done; } @@ -2304,7 +2286,7 @@ static inline u32 sky2_clk2us(const struct sky2_hw *hw, u32 clk) } -static int sky2_reset(struct sky2_hw *hw) +static int __devinit sky2_reset(struct sky2_hw *hw) { u16 status; u8 t8, pmd_type; @@ -3455,14 +3437,17 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) return -EINVAL; del_timer_sync(&hw->idle_timer); - netif_poll_disable(hw->dev[0]); for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; - if (netif_running(dev)) { + if (dev) { + if (!netif_running(dev)) + continue; + sky2_down(dev); netif_device_detach(dev); + netif_poll_disable(dev); } } @@ -3489,8 +3474,9 @@ static int sky2_resume(struct pci_dev *pdev) for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; - if (netif_running(dev)) { + if (dev && netif_running(dev)) { netif_device_attach(dev); + netif_poll_enable(dev); err = sky2_up(dev); if (err) { @@ -3502,7 +3488,6 @@ static int sky2_resume(struct pci_dev *pdev) } } - netif_poll_enable(hw->dev[0]); sky2_idle_start(hw); out: return err; diff --git a/trunk/drivers/net/sky2.h b/trunk/drivers/net/sky2.h index 2db8d19b22d1..8a0bc5525f0a 100644 --- a/trunk/drivers/net/sky2.h +++ b/trunk/drivers/net/sky2.h @@ -1480,7 +1480,7 @@ enum { GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ - GM_TXCR_COL_THR_MSK = 7<<10, /* Bit 12..10: Collision Threshold */ + GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ }; #define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) diff --git a/trunk/drivers/net/smc91x.h b/trunk/drivers/net/smc91x.h index 4ec4b4d23ae5..b4028049ed76 100644 --- a/trunk/drivers/net/smc91x.h +++ b/trunk/drivers/net/smc91x.h @@ -354,24 +354,6 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r, #define SMC_IRQ_FLAGS (0) -#elif defined(CONFIG_ARCH_VERSATILE) - -#define SMC_CAN_USE_8BIT 1 -#define SMC_CAN_USE_16BIT 1 -#define SMC_CAN_USE_32BIT 1 -#define SMC_NOWAIT 1 - -#define SMC_inb(a, r) readb((a) + (r)) -#define SMC_inw(a, r) readw((a) + (r)) -#define SMC_inl(a, r) readl((a) + (r)) -#define SMC_outb(v, a, r) writeb(v, (a) + (r)) -#define SMC_outw(v, a, r) writew(v, (a) + (r)) -#define SMC_outl(v, a, r) writel(v, (a) + (r)) -#define SMC_insl(a, r, p, l) readsl((a) + (r), p, l) -#define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l) - -#define SMC_IRQ_FLAGS (0) - #else #define SMC_CAN_USE_8BIT 1 diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index ce6f3be86da0..f645921aff8b 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -10078,8 +10078,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) static struct pci_device_id write_reorder_chipsets[] = { { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_8131_BRIDGE) }, { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8385_0) }, { }, diff --git a/trunk/drivers/net/typhoon.c b/trunk/drivers/net/typhoon.c index 4103c37172f9..063816f2b11e 100644 --- a/trunk/drivers/net/typhoon.c +++ b/trunk/drivers/net/typhoon.c @@ -805,7 +805,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev) * If problems develop with TSO, check this first. */ numDesc = skb_shinfo(skb)->nr_frags + 1; - if (skb_is_gso(skb)) + if(skb_tso_size(skb)) numDesc++; /* When checking for free space in the ring, we need to also @@ -845,7 +845,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev) TYPHOON_TX_PF_VLAN_TAG_SHIFT); } - if (skb_is_gso(skb)) { + if(skb_tso_size(skb)) { first_txd->processFlags |= TYPHOON_TX_PF_TCP_SEGMENT; first_txd->numDesc++; diff --git a/trunk/drivers/net/wan/c101.c b/trunk/drivers/net/wan/c101.c index 2c09ec908a3f..c92ac9fde083 100644 --- a/trunk/drivers/net/wan/c101.c +++ b/trunk/drivers/net/wan/c101.c @@ -116,33 +116,27 @@ static inline void openwin(card_t *card, u8 page) #include "hd6457x.c" -static inline void set_carrier(port_t *port) -{ - if (!sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD) - netif_carrier_on(port_to_dev(port)); - else - netif_carrier_off(port_to_dev(port)); -} - - static void sca_msci_intr(port_t *port) { - u8 stat = sca_in(MSCI1_OFFSET + ST1, port); /* read MSCI ST1 status */ + struct net_device *dev = port_to_dev(port); + card_t* card = port_to_card(port); + u8 stat = sca_in(MSCI1_OFFSET + ST1, card); /* read MSCI ST1 status */ /* Reset MSCI TX underrun status bit */ - sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, port); + sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, card); if (stat & ST1_UDRN) { - struct net_device_stats *stats = hdlc_stats(port_to_dev(port)); + struct net_device_stats *stats = hdlc_stats(dev); stats->tx_errors++; /* TX Underrun error detected */ stats->tx_fifo_errors++; } /* Reset MSCI CDCD status bit - uses ch#2 DCD input */ - sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, port); + sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, card); if (stat & ST1_CDCD) - set_carrier(port); + hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), + dev); } @@ -196,7 +190,7 @@ static int c101_open(struct net_device *dev) sca_out(IE1_UDRN, MSCI0_OFFSET + IE1, port); sca_out(IE0_TXINT, MSCI0_OFFSET + IE0, port); - set_carrier(port); + hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD), dev); printk(KERN_DEBUG "0x%X\n", sca_in(MSCI1_OFFSET + ST3, port)); /* enable MSCI1 CDCD interrupt */ @@ -384,7 +378,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) } sca_init_sync_port(card); /* Set up C101 memory */ - set_carrier(card); + hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), dev); printk(KERN_INFO "%s: Moxa C101 on IRQ%u," " using %u TX + %u RX packets rings\n", diff --git a/trunk/drivers/net/wan/hd6457x.c b/trunk/drivers/net/wan/hd6457x.c index dce2bb317b82..d3743321a977 100644 --- a/trunk/drivers/net/wan/hd6457x.c +++ b/trunk/drivers/net/wan/hd6457x.c @@ -168,23 +168,6 @@ static inline u32 buffer_offset(port_t *port, u16 desc, int transmit) } -static inline void sca_set_carrier(port_t *port) -{ - if (!(sca_in(get_msci(port) + ST3, port_to_card(port)) & ST3_DCD)) { -#ifdef DEBUG_LINK - printk(KERN_DEBUG "%s: sca_set_carrier on\n", - port_to_dev(port)->name); -#endif - netif_carrier_on(port_to_dev(port)); - } else { -#ifdef DEBUG_LINK - printk(KERN_DEBUG "%s: sca_set_carrier off\n", - port_to_dev(port)->name); -#endif - netif_carrier_off(port_to_dev(port)); - } -} - static void sca_init_sync_port(port_t *port) { @@ -254,7 +237,9 @@ static void sca_init_sync_port(port_t *port) sca_out(DIR_BOFE, DIR_TX(phy_node(port)), card); } } - sca_set_carrier(port); + + hdlc_set_carrier(!(sca_in(get_msci(port) + ST3, card) & ST3_DCD), + port_to_dev(port)); } @@ -277,7 +262,8 @@ static inline void sca_msci_intr(port_t *port) } if (stat & ST1_CDCD) - sca_set_carrier(port); + hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), + port_to_dev(port)); } #endif @@ -580,7 +566,7 @@ static void sca_open(struct net_device *dev) - all DMA interrupts */ - sca_set_carrier(port); + hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), dev); #ifdef __HD64570_H /* MSCI TX INT and RX INT A IRQ enable */ diff --git a/trunk/drivers/net/wan/hdlc_cisco.c b/trunk/drivers/net/wan/hdlc_cisco.c index f289daba0c7b..1fd04662c4fc 100644 --- a/trunk/drivers/net/wan/hdlc_cisco.c +++ b/trunk/drivers/net/wan/hdlc_cisco.c @@ -192,7 +192,9 @@ static int cisco_rx(struct sk_buff *skb) "uptime %ud%uh%um%us)\n", dev->name, days, hrs, min, sec); - netif_dormant_off(dev); +#if 0 + netif_carrier_on(dev); +#endif hdlc->state.cisco.up = 1; } } @@ -225,7 +227,9 @@ static void cisco_timer(unsigned long arg) hdlc->state.cisco.settings.timeout * HZ)) { hdlc->state.cisco.up = 0; printk(KERN_INFO "%s: Link down\n", dev->name); - netif_dormant_on(dev); +#if 0 + netif_carrier_off(dev); +#endif } cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, @@ -261,7 +265,10 @@ static void cisco_stop(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); del_timer_sync(&hdlc->state.cisco.timer); - netif_dormant_on(dev); +#if 0 + if (netif_carrier_ok(dev)) + netif_carrier_off(dev); +#endif hdlc->state.cisco.up = 0; hdlc->state.cisco.request_sent = 0; } @@ -321,7 +328,6 @@ int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr) dev->type = ARPHRD_CISCO; dev->flags = IFF_POINTOPOINT | IFF_NOARP; dev->addr_len = 0; - netif_dormant_on(dev); return 0; } diff --git a/trunk/drivers/net/wan/hdlc_fr.c b/trunk/drivers/net/wan/hdlc_fr.c index 7bb737bbdeb9..523afe17564e 100644 --- a/trunk/drivers/net/wan/hdlc_fr.c +++ b/trunk/drivers/net/wan/hdlc_fr.c @@ -301,7 +301,7 @@ static int pvc_open(struct net_device *dev) if (pvc->open_count++ == 0) { hdlc_device *hdlc = dev_to_hdlc(pvc->master); if (hdlc->state.fr.settings.lmi == LMI_NONE) - pvc->state.active = netif_carrier_ok(pvc->master); + pvc->state.active = hdlc->carrier; pvc_carrier(pvc->state.active, pvc); hdlc->state.fr.dce_changed = 1; @@ -545,7 +545,11 @@ static void fr_set_link_state(int reliable, struct net_device *dev) hdlc->state.fr.reliable = reliable; if (reliable) { - netif_dormant_off(dev); +#if 0 + if (!netif_carrier_ok(dev)) + netif_carrier_on(dev); +#endif + hdlc->state.fr.n391cnt = 0; /* Request full status */ hdlc->state.fr.dce_changed = 1; @@ -558,7 +562,11 @@ static void fr_set_link_state(int reliable, struct net_device *dev) } } } else { - netif_dormant_on(dev); +#if 0 + if (netif_carrier_ok(dev)) + netif_carrier_off(dev); +#endif + while (pvc) { /* Deactivate all PVCs */ pvc_carrier(0, pvc); pvc->state.exist = pvc->state.active = 0; diff --git a/trunk/drivers/net/wan/hdlc_generic.c b/trunk/drivers/net/wan/hdlc_generic.c index 04ca1f7b6424..b7da55140fbd 100644 --- a/trunk/drivers/net/wan/hdlc_generic.c +++ b/trunk/drivers/net/wan/hdlc_generic.c @@ -34,11 +34,10 @@ #include #include #include -#include #include -static const char* version = "HDLC support module revision 1.19"; +static const char* version = "HDLC support module revision 1.18"; #undef DEBUG_LINK @@ -74,51 +73,57 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev, -static inline void hdlc_proto_start(struct net_device *dev) +static void __hdlc_set_carrier_on(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); if (hdlc->proto.start) return hdlc->proto.start(dev); +#if 0 +#ifdef DEBUG_LINK + if (netif_carrier_ok(dev)) + printk(KERN_ERR "hdlc_set_carrier_on(): already on\n"); +#endif + netif_carrier_on(dev); +#endif } -static inline void hdlc_proto_stop(struct net_device *dev) +static void __hdlc_set_carrier_off(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); if (hdlc->proto.stop) return hdlc->proto.stop(dev); + +#if 0 +#ifdef DEBUG_LINK + if (!netif_carrier_ok(dev)) + printk(KERN_ERR "hdlc_set_carrier_off(): already off\n"); +#endif + netif_carrier_off(dev); +#endif } -static int hdlc_device_event(struct notifier_block *this, unsigned long event, - void *ptr) +void hdlc_set_carrier(int on, struct net_device *dev) { - struct net_device *dev = ptr; - hdlc_device *hdlc; + hdlc_device *hdlc = dev_to_hdlc(dev); unsigned long flags; - int on; - - if (dev->get_stats != hdlc_get_stats) - return NOTIFY_DONE; /* not an HDLC device */ - - if (event != NETDEV_CHANGE) - return NOTIFY_DONE; /* Only interrested in carrier changes */ - - on = netif_carrier_ok(dev); + on = on ? 1 : 0; #ifdef DEBUG_LINK - printk(KERN_DEBUG "%s: hdlc_device_event NETDEV_CHANGE, carrier %i\n", - dev->name, on); + printk(KERN_DEBUG "hdlc_set_carrier %i\n", on); #endif - hdlc = dev_to_hdlc(dev); spin_lock_irqsave(&hdlc->state_lock, flags); if (hdlc->carrier == on) goto carrier_exit; /* no change in DCD line level */ +#ifdef DEBUG_LINK + printk(KERN_INFO "%s: carrier %s\n", dev->name, on ? "ON" : "off"); +#endif hdlc->carrier = on; if (!hdlc->open) @@ -126,15 +131,14 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event, if (hdlc->carrier) { printk(KERN_INFO "%s: Carrier detected\n", dev->name); - hdlc_proto_start(dev); + __hdlc_set_carrier_on(dev); } else { printk(KERN_INFO "%s: Carrier lost\n", dev->name); - hdlc_proto_stop(dev); + __hdlc_set_carrier_off(dev); } carrier_exit: spin_unlock_irqrestore(&hdlc->state_lock, flags); - return NOTIFY_DONE; } @@ -161,7 +165,7 @@ int hdlc_open(struct net_device *dev) if (hdlc->carrier) { printk(KERN_INFO "%s: Carrier detected\n", dev->name); - hdlc_proto_start(dev); + __hdlc_set_carrier_on(dev); } else printk(KERN_INFO "%s: No carrier\n", dev->name); @@ -186,7 +190,7 @@ void hdlc_close(struct net_device *dev) hdlc->open = 0; if (hdlc->carrier) - hdlc_proto_stop(dev); + __hdlc_set_carrier_off(dev); spin_unlock_irq(&hdlc->state_lock); @@ -299,6 +303,7 @@ MODULE_LICENSE("GPL v2"); EXPORT_SYMBOL(hdlc_open); EXPORT_SYMBOL(hdlc_close); +EXPORT_SYMBOL(hdlc_set_carrier); EXPORT_SYMBOL(hdlc_ioctl); EXPORT_SYMBOL(hdlc_setup); EXPORT_SYMBOL(alloc_hdlcdev); @@ -310,18 +315,9 @@ static struct packet_type hdlc_packet_type = { }; -static struct notifier_block hdlc_notifier = { - .notifier_call = hdlc_device_event, -}; - - static int __init hdlc_module_init(void) { - int result; - printk(KERN_INFO "%s\n", version); - if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0) - return result; dev_add_pack(&hdlc_packet_type); return 0; } @@ -331,7 +327,6 @@ static int __init hdlc_module_init(void) static void __exit hdlc_module_exit(void) { dev_remove_pack(&hdlc_packet_type); - unregister_netdevice_notifier(&hdlc_notifier); } diff --git a/trunk/drivers/net/wan/wanxl.c b/trunk/drivers/net/wan/wanxl.c index b2031dfc4bb1..d564224cdca9 100644 --- a/trunk/drivers/net/wan/wanxl.c +++ b/trunk/drivers/net/wan/wanxl.c @@ -149,10 +149,7 @@ static inline void wanxl_cable_intr(port_t *port) printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n", port->dev->name, pm, dte, cable, dsr, dcd); - if (value & STATUS_CABLE_DCD) - netif_carrier_on(port->dev); - else - netif_carrier_off(port->dev); + hdlc_set_carrier(value & STATUS_CABLE_DCD, port->dev); } diff --git a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 3889f79e7128..e1c5a939bca4 100644 --- a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c @@ -1547,7 +1547,7 @@ static void handle_irq_noise(struct bcm43xx_private *bcm) goto generate_new; /* Get the noise samples. */ - assert(bcm->noisecalc.nr_samples < 8); + assert(bcm->noisecalc.nr_samples <= 8); i = bcm->noisecalc.nr_samples; noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(radio->nrssi_lt) - 1); noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(radio->nrssi_lt) - 1); diff --git a/trunk/drivers/net/wireless/spectrum_cs.c b/trunk/drivers/net/wireless/spectrum_cs.c index 7f78b7801fb3..15465278c789 100644 --- a/trunk/drivers/net/wireless/spectrum_cs.c +++ b/trunk/drivers/net/wireless/spectrum_cs.c @@ -34,6 +34,8 @@ #include "orinoco.h" +static unsigned char *primsym; +static unsigned char *secsym; static const char primary_fw_name[] = "symbol_sp24t_prim_fw"; static const char secondary_fw_name[] = "symbol_sp24t_sec_fw"; @@ -438,7 +440,7 @@ spectrum_load_blocks(hermes_t *hw, const struct dblock *first_block) */ static int spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link, - const unsigned char *image, int secondary) + const unsigned char *image) { int ret; const unsigned char *ptr; @@ -453,7 +455,7 @@ spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link, first_block = (const struct dblock *) ptr; /* Read the PDA */ - if (secondary) { + if (image != primsym) { ret = spectrum_read_pda(hw, pda, sizeof(pda)); if (ret) return ret; @@ -470,7 +472,7 @@ spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link, return ret; /* Write the PDA to the adapter */ - if (secondary) { + if (image != primsym) { ret = spectrum_apply_pda(hw, first_block, pda); if (ret) return ret; @@ -485,7 +487,7 @@ spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link, ret = hermes_init(hw); /* hermes_reset() should return 0 with the secondary firmware */ - if (secondary && ret != 0) + if (image != primsym && ret != 0) return -ENODEV; /* And this should work with any firmware */ @@ -507,30 +509,33 @@ spectrum_dl_firmware(hermes_t *hw, struct pcmcia_device *link) const struct firmware *fw_entry; if (request_firmware(&fw_entry, primary_fw_name, - &handle_to_dev(link)) != 0) { + &handle_to_dev(link)) == 0) { + primsym = fw_entry->data; + } else { printk(KERN_ERR PFX "Cannot find firmware: %s\n", primary_fw_name); return -ENOENT; } - /* Load primary firmware */ - ret = spectrum_dl_image(hw, link, fw_entry->data, 0); - release_firmware(fw_entry); - if (ret) { - printk(KERN_ERR PFX "Primary firmware download failed\n"); - return ret; - } - if (request_firmware(&fw_entry, secondary_fw_name, - &handle_to_dev(link)) != 0) { + &handle_to_dev(link)) == 0) { + secsym = fw_entry->data; + } else { printk(KERN_ERR PFX "Cannot find firmware: %s\n", secondary_fw_name); return -ENOENT; } + /* Load primary firmware */ + ret = spectrum_dl_image(hw, link, primsym); + if (ret) { + printk(KERN_ERR PFX "Primary firmware download failed\n"); + return ret; + } + /* Load secondary firmware */ - ret = spectrum_dl_image(hw, link, fw_entry->data, 1); - release_firmware(fw_entry); + ret = spectrum_dl_image(hw, link, secsym); + if (ret) { printk(KERN_ERR PFX "Secondary firmware download failed\n"); } diff --git a/trunk/drivers/net/wireless/zd1211rw/zd_usb.c b/trunk/drivers/net/wireless/zd1211rw/zd_usb.c index 72f90525bf68..ce1cb2c6aa8d 100644 --- a/trunk/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/trunk/drivers/net/wireless/zd1211rw/zd_usb.c @@ -375,8 +375,10 @@ static void int_urb_complete(struct urb *urb, struct pt_regs *pt_regs) case -ENODEV: case -ENOENT: case -ECONNRESET: - case -EPIPE: goto kfree; + case -EPIPE: + usb_clear_halt(urb->dev, EP_INT_IN); + /* FALL-THROUGH */ default: goto resubmit; } @@ -578,8 +580,10 @@ static void rx_urb_complete(struct urb *urb, struct pt_regs *pt_regs) case -ENODEV: case -ENOENT: case -ECONNRESET: - case -EPIPE: return; + case -EPIPE: + usb_clear_halt(urb->dev, EP_DATA_IN); + /* FALL-THROUGH */ default: dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status); goto resubmit; @@ -745,9 +749,11 @@ static void tx_urb_complete(struct urb *urb, struct pt_regs *pt_regs) case -ENODEV: case -ENOENT: case -ECONNRESET: - case -EPIPE: dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status); break; + case -EPIPE: + usb_clear_halt(urb->dev, EP_DATA_OUT); + /* FALL-THROUGH */ default: dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status); goto resubmit; diff --git a/trunk/drivers/pci/hotplug/Kconfig b/trunk/drivers/pci/hotplug/Kconfig index 3fae77ffb2fa..222a1cc4aa28 100644 --- a/trunk/drivers/pci/hotplug/Kconfig +++ b/trunk/drivers/pci/hotplug/Kconfig @@ -6,7 +6,8 @@ menu "PCI Hotplug Support" config HOTPLUG_PCI tristate "Support for PCI Hotplug (EXPERIMENTAL)" - depends on PCI && EXPERIMENTAL && HOTPLUG + depends on PCI && EXPERIMENTAL + select HOTPLUG ---help--- Say Y here if you have a motherboard with a PCI Hotplug controller. This allows you to add and remove PCI cards while the machine is @@ -76,7 +77,7 @@ config HOTPLUG_PCI_IBM config HOTPLUG_PCI_ACPI tristate "ACPI PCI Hotplug driver" - depends on ACPI_DOCK && HOTPLUG_PCI + depends on ACPI && HOTPLUG_PCI help Say Y here if you have a system that supports PCI Hotplug using ACPI. diff --git a/trunk/drivers/pci/msi.c b/trunk/drivers/pci/msi.c index a83c1f5735d6..36bc7c415af7 100644 --- a/trunk/drivers/pci/msi.c +++ b/trunk/drivers/pci/msi.c @@ -47,13 +47,13 @@ msi_register(struct msi_ops *ops) static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) { - memset(p, 0, sizeof(struct msi_desc)); + memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); } static int msi_cache_init(void) { msi_cachep = kmem_cache_create("msi_cache", - sizeof(struct msi_desc), + NR_IRQS * sizeof(struct msi_desc), 0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL); if (!msi_cachep) return -ENOMEM; diff --git a/trunk/drivers/pci/pci.c b/trunk/drivers/pci/pci.c index 9f79dd6d51ab..cf57d7de3765 100644 --- a/trunk/drivers/pci/pci.c +++ b/trunk/drivers/pci/pci.c @@ -19,7 +19,6 @@ #include /* isa_dma_bridge_buggy */ #include "pci.h" -unsigned int pci_pm_d3_delay = 10; /** * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children @@ -314,14 +313,6 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) } else if (dev->current_state == state) return 0; /* we're already there */ - /* - * If the device or the parent bridge can't support PCI PM, ignore - * the request if we're doing anything besides putting it into D0 - * (which would only happen on boot). - */ - if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev)) - return 0; - /* find PCI PM capability in list */ pm = pci_find_capability(dev, PCI_CAP_ID_PM); @@ -372,7 +363,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) /* Mandatory power management transition delays */ /* see PCI PM 1.1 5.6.1 table 18 */ if (state == PCI_D3hot || dev->current_state == PCI_D3hot) - msleep(pci_pm_d3_delay); + msleep(10); else if (state == PCI_D2 || dev->current_state == PCI_D2) udelay(200); diff --git a/trunk/drivers/pci/pci.h b/trunk/drivers/pci/pci.h index 08d58fc78ee1..9cc842b666eb 100644 --- a/trunk/drivers/pci/pci.h +++ b/trunk/drivers/pci/pci.h @@ -47,7 +47,7 @@ extern int pci_msi_quirk; #else #define pci_msi_quirk 0 #endif -extern unsigned int pci_pm_d3_delay; + #ifdef CONFIG_PCI_MSI void disable_msi_mode(struct pci_dev *dev, int pos, int type); void pci_no_msi(void); @@ -66,15 +66,7 @@ static inline int pci_save_msix_state(struct pci_dev *dev) { return 0; } static inline void pci_restore_msi_state(struct pci_dev *dev) {} static inline void pci_restore_msix_state(struct pci_dev *dev) {} #endif -static inline int pci_no_d1d2(struct pci_dev *dev) -{ - unsigned int parent_dstates = 0; - if (dev->bus->self) - parent_dstates = dev->bus->self->no_d1d2; - return (dev->no_d1d2 || parent_dstates); - -} extern int pcie_mch_quirk; extern struct device_attribute pci_dev_attrs[]; extern struct class_device_attribute class_device_attr_cpuaffinity; diff --git a/trunk/drivers/pci/probe.c b/trunk/drivers/pci/probe.c index c5a58d1c6c1c..f89dbc3738b7 100644 --- a/trunk/drivers/pci/probe.c +++ b/trunk/drivers/pci/probe.c @@ -815,7 +815,6 @@ pci_scan_device(struct pci_bus *bus, int devfn) dev->vendor = l & 0xffff; dev->device = (l >> 16) & 0xffff; dev->cfg_size = pci_cfg_space_size(dev); - dev->error_state = pci_channel_io_normal; /* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer) set this higher, assuming the system even supports it. */ diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c index e3c78c39b7e4..d1d7333bb71b 100644 --- a/trunk/drivers/pci/quirks.c +++ b/trunk/drivers/pci/quirks.c @@ -400,7 +400,6 @@ static void __devinit quirk_piix4_acpi(struct pci_dev *dev) piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi ); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, quirk_piix4_acpi ); /* * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at @@ -683,33 +682,6 @@ static void __devinit quirk_vt82c598_id(struct pci_dev *dev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); -#ifdef CONFIG_ACPI_SLEEP - -/* - * Some VIA systems boot with the abnormal status flag set. This can cause - * the BIOS to re-POST the system on resume rather than passing control - * back to the OS. Clear the flag on boot - */ -static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev) -{ - u32 reg; - - acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, - ®); - - if (reg & 0x800) { - printk("Clearing abnormal poweroff flag\n"); - acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_STATUS, - (u16)0x800); - } -} - -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff); - -#endif - /* * CardBus controllers have a legacy base address that enables them * to respond as i82365 pcmcia controllers. We don't want them to @@ -1202,55 +1174,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); -#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE) - -/* - * If we are using libata we can drive this chip properly but must - * do this early on to make the additional device appear during - * the PCI scanning. - */ - -static void __devinit quirk_jmicron_dualfn(struct pci_dev *pdev) -{ - u32 conf; - u8 hdr; - - /* Only poke fn 0 */ - if (PCI_FUNC(pdev->devfn)) - return; - - switch(pdev->device) { - case PCI_DEVICE_ID_JMICRON_JMB365: - case PCI_DEVICE_ID_JMICRON_JMB366: - /* Redirect IDE second PATA port to the right spot */ - pci_read_config_dword(pdev, 0x80, &conf); - conf |= (1 << 24); - /* Fall through */ - pci_write_config_dword(pdev, 0x80, conf); - case PCI_DEVICE_ID_JMICRON_JMB361: - case PCI_DEVICE_ID_JMICRON_JMB363: - pci_read_config_dword(pdev, 0x40, &conf); - /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ - /* Set the class codes correctly and then direct IDE 0 */ - conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */ - conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */ - pci_write_config_dword(pdev, 0x40, conf); - - /* Reconfigure so that the PCI scanner discovers the - device is now multifunction */ - - pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr); - pdev->hdr_type = hdr & 0x7f; - pdev->multifunction = !!(hdr & 0x80); - - break; - } -} - -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn); - -#endif - #ifdef CONFIG_X86_IO_APIC static void __init quirk_alder_ioapic(struct pci_dev *pdev) { @@ -1418,37 +1341,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pc DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); -/* - * Some Intel PCI Express chipsets have trouble with downstream - * device power management. - */ -static void quirk_intel_pcie_pm(struct pci_dev * dev) -{ - pci_pm_d3_delay = 120; - dev->no_d1d2 = 1; -} - -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2601, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2602, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2603, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2604, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2605, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2606, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2607, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2608, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); /* * Fixup the cardbus bridges on the IBM Dock II docking station diff --git a/trunk/drivers/pcmcia/Kconfig b/trunk/drivers/pcmcia/Kconfig index 35f88649d3b7..61cb4b29f55c 100644 --- a/trunk/drivers/pcmcia/Kconfig +++ b/trunk/drivers/pcmcia/Kconfig @@ -6,7 +6,7 @@ menu "PCCARD (PCMCIA/CardBus) support" config PCCARD tristate "PCCard (PCMCIA/CardBus) support" - depends on HOTPLUG + select HOTPLUG ---help--- Say Y here if you want to attach PCMCIA- or PC-cards to your Linux computer. These are credit-card size devices such as network cards, diff --git a/trunk/drivers/s390/block/dasd_devmap.c b/trunk/drivers/s390/block/dasd_devmap.c index 7f6fdac74706..d7295386821c 100644 --- a/trunk/drivers/s390/block/dasd_devmap.c +++ b/trunk/drivers/s390/block/dasd_devmap.c @@ -394,7 +394,7 @@ dasd_add_busid(char *bus_id, int features) if (!new) return ERR_PTR(-ENOMEM); spin_lock(&dasd_devmap_lock); - devmap = NULL; + devmap = 0; hash = dasd_hash_busid(bus_id); list_for_each_entry(tmp, &dasd_hashlists[hash], list) if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) { @@ -406,10 +406,10 @@ dasd_add_busid(char *bus_id, int features) new->devindex = dasd_max_devindex++; strncpy(new->bus_id, bus_id, BUS_ID_SIZE); new->features = features; - new->device = NULL; + new->device = 0; list_add(&new->list, &dasd_hashlists[hash]); devmap = new; - new = NULL; + new = 0; } spin_unlock(&dasd_devmap_lock); kfree(new); @@ -479,7 +479,7 @@ dasd_device_from_devindex(int devindex) int i; spin_lock(&dasd_devmap_lock); - devmap = NULL; + devmap = 0; for (i = 0; (i < 256) && !devmap; i++) list_for_each_entry(tmp, &dasd_hashlists[i], list) if (tmp->devindex == devindex) { diff --git a/trunk/drivers/s390/block/dasd_eckd.c b/trunk/drivers/s390/block/dasd_eckd.c index 39c2281371b5..2e655f466743 100644 --- a/trunk/drivers/s390/block/dasd_eckd.c +++ b/trunk/drivers/s390/block/dasd_eckd.c @@ -65,16 +65,16 @@ struct dasd_eckd_private { /* The ccw bus type uses this table to find devices that it sends to * dasd_eckd_probe */ static struct ccw_device_id dasd_eckd_ids[] = { - { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), .driver_info = 0x1}, - { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), .driver_info = 0x2}, - { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), .driver_info = 0x3}, - { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), .driver_info = 0x4}, - { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), .driver_info = 0x5}, - { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), .driver_info = 0x6}, - { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), .driver_info = 0x7}, - { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), .driver_info = 0x8}, - { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), .driver_info = 0x9}, - { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), .driver_info = 0xa}, + { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), driver_info: 0x1}, + { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), driver_info: 0x2}, + { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), driver_info: 0x3}, + { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), driver_info: 0x4}, + { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), driver_info: 0x5}, + { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), driver_info: 0x6}, + { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), driver_info: 0x7}, + { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), driver_info: 0x8}, + { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), driver_info: 0x9}, + { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), driver_info: 0xa}, { /* end of list */ }, }; diff --git a/trunk/drivers/s390/block/dasd_fba.c b/trunk/drivers/s390/block/dasd_fba.c index e85015be109b..808434d38526 100644 --- a/trunk/drivers/s390/block/dasd_fba.c +++ b/trunk/drivers/s390/block/dasd_fba.c @@ -44,8 +44,8 @@ struct dasd_fba_private { }; static struct ccw_device_id dasd_fba_ids[] = { - { CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), .driver_info = 0x1}, - { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), .driver_info = 0x2}, + { CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), driver_info: 0x1}, + { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), driver_info: 0x2}, { /* end of list */ }, }; diff --git a/trunk/drivers/s390/block/dasd_genhd.c b/trunk/drivers/s390/block/dasd_genhd.c index 4c272b70f41a..12c7d296eaa8 100644 --- a/trunk/drivers/s390/block/dasd_genhd.c +++ b/trunk/drivers/s390/block/dasd_genhd.c @@ -84,9 +84,9 @@ void dasd_gendisk_free(struct dasd_device *device) { del_gendisk(device->gdp); - device->gdp->queue = NULL; + device->gdp->queue = 0; put_disk(device->gdp); - device->gdp = NULL; + device->gdp = 0; } /* @@ -136,7 +136,7 @@ dasd_destroy_partitions(struct dasd_device * device) * device->bdev to lower the offline open_count limit again. */ bdev = device->bdev; - device->bdev = NULL; + device->bdev = 0; /* * See fs/partition/check.c:delete_partition @@ -145,7 +145,7 @@ dasd_destroy_partitions(struct dasd_device * device) */ memset(&bpart, 0, sizeof(struct blkpg_partition)); memset(&barg, 0, sizeof(struct blkpg_ioctl_arg)); - barg.data = (void __user *) &bpart; + barg.data = &bpart; barg.op = BLKPG_DEL_PARTITION; for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--) ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg); diff --git a/trunk/drivers/s390/block/dasd_ioctl.c b/trunk/drivers/s390/block/dasd_ioctl.c index 8fed3603e9ea..e97f5316ad2d 100644 --- a/trunk/drivers/s390/block/dasd_ioctl.c +++ b/trunk/drivers/s390/block/dasd_ioctl.c @@ -345,7 +345,7 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) if (bdev != bdev->bd_contains) // ro setting is not allowed for partitions return -EINVAL; - if (get_user(intval, (int __user *)argp)) + if (get_user(intval, (int *)argp)) return -EFAULT; set_disk_ro(bdev->bd_disk, intval); diff --git a/trunk/drivers/s390/block/xpram.c b/trunk/drivers/s390/block/xpram.c index 4cd879cb9bdd..4c1e56b9b98d 100644 --- a/trunk/drivers/s390/block/xpram.c +++ b/trunk/drivers/s390/block/xpram.c @@ -71,11 +71,11 @@ static int xpram_devs; /* * Parameter parsing functions. */ -static int __initdata devs = XPRAM_DEVS; -static char __initdata *sizes[XPRAM_MAX_DEVS]; +static int devs = XPRAM_DEVS; +static unsigned int sizes[XPRAM_MAX_DEVS]; module_param(devs, int, 0); -module_param_array(sizes, charp, NULL, 0); +module_param_array(sizes, int, NULL, 0); MODULE_PARM_DESC(devs, "number of devices (\"partitions\"), " \ "the default is " __MODULE_STRING(XPRAM_DEVS) "\n"); @@ -86,6 +86,59 @@ MODULE_PARM_DESC(sizes, "list of device (partition) sizes " \ "claimed by explicit sizes\n"); MODULE_LICENSE("GPL"); +#ifndef MODULE +/* + * Parses the kernel parameters given in the kernel parameter line. + * The expected format is + * [","]* + * where + * devices is a positive integer that initializes xpram_devs + * each size is a non-negative integer possibly followed by a + * magnitude (k,K,m,M,g,G), the list of sizes initialises + * xpram_sizes + * + * Arguments + * str: substring of kernel parameter line that contains xprams + * kernel parameters. + * + * Result 0 on success, -EINVAL else -- only for Version > 2.3 + * + * Side effects + * the global variabls devs is set to the value of + * and sizes[i] is set to the i-th + * partition size (if provided). A parsing error of a value + * results in this value being set to -EINVAL. + */ +static int __init xpram_setup (char *str) +{ + char *cp; + int i; + + devs = simple_strtoul(str, &cp, 10); + if (cp <= str || devs > XPRAM_MAX_DEVS) + return 0; + for (i = 0; (i < devs) && (*cp++ == ','); i++) { + sizes[i] = simple_strtoul(cp, &cp, 10); + if (*cp == 'g' || *cp == 'G') { + sizes[i] <<= 20; + cp++; + } else if (*cp == 'm' || *cp == 'M') { + sizes[i] <<= 10; + cp++; + } else if (*cp == 'k' || *cp == 'K') + cp++; + while (isspace(*cp)) cp++; + } + if (*cp == ',' && i >= devs) + PRINT_WARN("partition sizes list has too many entries.\n"); + else if (*cp != 0) + PRINT_WARN("ignored '%s' at end of parameter string.\n", cp); + return 1; +} + +__setup("xpram_parts=", xpram_setup); +#endif + /* * Copy expanded memory page (4kB) into main memory * Arguments @@ -321,9 +374,7 @@ static int __init xpram_setup_sizes(unsigned long pages) mem_needed = 0; mem_auto_no = 0; for (i = 0; i < xpram_devs; i++) { - if (sizes[i]) - xpram_sizes[i] = - (memparse(sizes[i], &sizes[i]) + 3) & -4UL; + xpram_sizes[i] = (sizes[i] + 3) & -4UL; if (xpram_sizes[i]) mem_needed += xpram_sizes[i]; else diff --git a/trunk/drivers/s390/char/con3215.c b/trunk/drivers/s390/char/con3215.c index 2fa566fa6da4..f25c6d116f6f 100644 --- a/trunk/drivers/s390/char/con3215.c +++ b/trunk/drivers/s390/char/con3215.c @@ -693,7 +693,7 @@ raw3215_probe (struct ccw_device *cdev) GFP_KERNEL|GFP_DMA); if (raw->buffer == NULL) { spin_lock(&raw3215_device_lock); - raw3215[line] = NULL; + raw3215[line] = 0; spin_unlock(&raw3215_device_lock); kfree(raw); return -ENOMEM; diff --git a/trunk/drivers/s390/char/ctrlchar.c b/trunk/drivers/s390/char/ctrlchar.c index d83eb6358bac..0ea6f36a2527 100644 --- a/trunk/drivers/s390/char/ctrlchar.c +++ b/trunk/drivers/s390/char/ctrlchar.c @@ -23,7 +23,7 @@ ctrlchar_handle_sysrq(void *tty) handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty); } -static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL); +static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, 0); #endif diff --git a/trunk/drivers/s390/char/defkeymap.c b/trunk/drivers/s390/char/defkeymap.c index 17027d918cf7..ca15adb140d1 100644 --- a/trunk/drivers/s390/char/defkeymap.c +++ b/trunk/drivers/s390/char/defkeymap.c @@ -83,8 +83,8 @@ static u_short shift_ctrl_map[NR_KEYS] = { }; ushort *key_maps[MAX_NR_KEYMAPS] = { - plain_map, shift_map, NULL, NULL, - ctrl_map, shift_ctrl_map, NULL, + plain_map, shift_map, 0, 0, + ctrl_map, shift_ctrl_map, 0 }; unsigned int keymap_count = 4; @@ -145,7 +145,7 @@ char *func_table[MAX_NR_FUNC] = { func_buf + 97, func_buf + 103, func_buf + 109, - NULL, + 0, }; struct kbdiacr accent_table[MAX_DIACR] = { diff --git a/trunk/drivers/s390/char/fs3270.c b/trunk/drivers/s390/char/fs3270.c index ef004d089712..6099c14de429 100644 --- a/trunk/drivers/s390/char/fs3270.c +++ b/trunk/drivers/s390/char/fs3270.c @@ -236,7 +236,7 @@ fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb) * Process reads from fullscreen 3270. */ static ssize_t -fs3270_read(struct file *filp, char __user *data, size_t count, loff_t *off) +fs3270_read(struct file *filp, char *data, size_t count, loff_t *off) { struct fs3270 *fp; struct raw3270_request *rq; @@ -281,7 +281,7 @@ fs3270_read(struct file *filp, char __user *data, size_t count, loff_t *off) * Process writes to fullscreen 3270. */ static ssize_t -fs3270_write(struct file *filp, const char __user *data, size_t count, loff_t *off) +fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off) { struct fs3270 *fp; struct raw3270_request *rq; @@ -338,10 +338,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) fp->write_command = arg; break; case TUBGETI: - rc = put_user(fp->read_command, (char __user *) arg); + rc = put_user(fp->read_command, (char *) arg); break; case TUBGETO: - rc = put_user(fp->write_command,(char __user *) arg); + rc = put_user(fp->write_command,(char *) arg); break; case TUBGETMOD: iocb.model = fp->view.model; @@ -350,7 +350,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) iocb.pf_cnt = 24; iocb.re_cnt = 20; iocb.map = 0; - if (copy_to_user((char __user *) arg, &iocb, + if (copy_to_user((char *) arg, &iocb, sizeof(struct raw3270_iocb))) rc = -EFAULT; break; @@ -479,7 +479,7 @@ fs3270_close(struct inode *inode, struct file *filp) struct fs3270 *fp; fp = filp->private_data; - filp->private_data = NULL; + filp->private_data = 0; if (fp) { fp->fs_pid = 0; raw3270_reset(&fp->view); diff --git a/trunk/drivers/s390/char/keyboard.c b/trunk/drivers/s390/char/keyboard.c index 3be06569180d..547ef906ae2c 100644 --- a/trunk/drivers/s390/char/keyboard.c +++ b/trunk/drivers/s390/char/keyboard.c @@ -103,7 +103,7 @@ kbd_alloc(void) { out_kbd: kfree(kbd); out: - return NULL; + return 0; } void @@ -304,7 +304,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode) if (kbd->sysrq) { if (kbd->sysrq == K(KT_LATIN, '-')) { kbd->sysrq = 0; - handle_sysrq(value, NULL, kbd->tty); + handle_sysrq(value, 0, kbd->tty); return; } if (value == '-') { @@ -363,7 +363,7 @@ do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe, /* disallocate map */ key_map = kbd->key_maps[tmp.kb_table]; if (key_map) { - kbd->key_maps[tmp.kb_table] = NULL; + kbd->key_maps[tmp.kb_table] = 0; kfree(key_map); } break; diff --git a/trunk/drivers/s390/char/raw3270.c b/trunk/drivers/s390/char/raw3270.c index 95e285b2e25c..e95b56f810db 100644 --- a/trunk/drivers/s390/char/raw3270.c +++ b/trunk/drivers/s390/char/raw3270.c @@ -555,7 +555,7 @@ raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view, #ifdef CONFIG_TN3270_CONSOLE if (raw3270_registered == 0) { spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags); - rq->callback = NULL; + rq->callback = 0; rc = __raw3270_start(rp, view, rq); if (rc == 0) while (!raw3270_request_final(rq)) { @@ -719,8 +719,8 @@ raw3270_size_device(struct raw3270 *rp) rc = __raw3270_size_device_vm(rp); else rc = __raw3270_size_device(rp); - raw3270_init_view.dev = NULL; - rp->view = NULL; + raw3270_init_view.dev = 0; + rp->view = 0; up(&raw3270_init_sem); if (rc == 0) { /* Found something. */ /* Try to find a model. */ @@ -761,8 +761,8 @@ raw3270_reset_device(struct raw3270 *rp) rp->view = &raw3270_init_view; raw3270_init_view.dev = rp; rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request); - raw3270_init_view.dev = NULL; - rp->view = NULL; + raw3270_init_view.dev = 0; + rp->view = 0; up(&raw3270_init_sem); return rc; } @@ -934,7 +934,7 @@ raw3270_activate_view(struct raw3270_view *view) else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags)) rc = -ENODEV; else { - oldview = NULL; + oldview = 0; if (rp->view) { oldview = rp->view; oldview->fn->deactivate(oldview); @@ -951,7 +951,7 @@ raw3270_activate_view(struct raw3270_view *view) rp->view = nv; if (nv->fn->activate(nv) == 0) break; - rp->view = NULL; + rp->view = 0; } } } @@ -975,7 +975,7 @@ raw3270_deactivate_view(struct raw3270_view *view) spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); if (rp->view == view) { view->fn->deactivate(view); - rp->view = NULL; + rp->view = 0; /* Move deactivated view to end of list. */ list_del_init(&view->list); list_add_tail(&view->list, &rp->view_list); @@ -985,7 +985,7 @@ raw3270_deactivate_view(struct raw3270_view *view) rp->view = view; if (view->fn->activate(view) == 0) break; - rp->view = NULL; + rp->view = 0; } } } @@ -1076,7 +1076,7 @@ raw3270_del_view(struct raw3270_view *view) spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); if (rp->view == view) { view->fn->deactivate(view); - rp->view = NULL; + rp->view = 0; } list_del_init(&view->list); if (!rp->view && test_bit(RAW3270_FLAGS_READY, &rp->flags)) { @@ -1117,9 +1117,9 @@ raw3270_delete_device(struct raw3270 *rp) /* Disconnect from ccw_device. */ cdev = rp->cdev; - rp->cdev = NULL; - cdev->dev.driver_data = NULL; - cdev->handler = NULL; + rp->cdev = 0; + cdev->dev.driver_data = 0; + cdev->handler = 0; /* Put ccw_device structure. */ put_device(&cdev->dev); @@ -1144,7 +1144,7 @@ raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) return snprintf(buf, PAGE_SIZE, "%i\n", ((struct raw3270 *) dev->driver_data)->model); } -static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); +static DEVICE_ATTR(model, 0444, raw3270_model_show, 0); static ssize_t raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -1152,7 +1152,7 @@ raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) return snprintf(buf, PAGE_SIZE, "%i\n", ((struct raw3270 *) dev->driver_data)->rows); } -static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); +static DEVICE_ATTR(rows, 0444, raw3270_rows_show, 0); static ssize_t raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -1160,7 +1160,7 @@ raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *bu return snprintf(buf, PAGE_SIZE, "%i\n", ((struct raw3270 *) dev->driver_data)->cols); } -static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); +static DEVICE_ATTR(columns, 0444, raw3270_columns_show, 0); static struct attribute * raw3270_attrs[] = { &dev_attr_model.attr, @@ -1296,7 +1296,7 @@ raw3270_remove (struct ccw_device *cdev) spin_lock_irqsave(get_ccwdev_lock(cdev), flags); if (rp->view) { rp->view->fn->deactivate(rp->view); - rp->view = NULL; + rp->view = 0; } while (!list_empty(&rp->view_list)) { v = list_entry(rp->view_list.next, struct raw3270_view, list); diff --git a/trunk/drivers/s390/char/raw3270.h b/trunk/drivers/s390/char/raw3270.h index 90beaa80a782..b635bf8e7775 100644 --- a/trunk/drivers/s390/char/raw3270.h +++ b/trunk/drivers/s390/char/raw3270.h @@ -231,7 +231,7 @@ alloc_string(struct list_head *free_list, unsigned long len) INIT_LIST_HEAD(&cs->update); return cs; } - return NULL; + return 0; } static inline unsigned long diff --git a/trunk/drivers/s390/char/tape_34xx.c b/trunk/drivers/s390/char/tape_34xx.c index 7b95dab913d0..48b4d30a7256 100644 --- a/trunk/drivers/s390/char/tape_34xx.c +++ b/trunk/drivers/s390/char/tape_34xx.c @@ -1309,9 +1309,9 @@ static struct tape_discipline tape_discipline_34xx = { }; static struct ccw_device_id tape_34xx_ids[] = { - { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), .driver_info = tape_3480}, - { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), .driver_info = tape_3490}, - { /* end of list */ }, + { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), driver_info: tape_3480}, + { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), driver_info: tape_3490}, + { /* end of list */ } }; static int diff --git a/trunk/drivers/s390/char/tty3270.c b/trunk/drivers/s390/char/tty3270.c index 29718042c6c9..f496f236b9c0 100644 --- a/trunk/drivers/s390/char/tty3270.c +++ b/trunk/drivers/s390/char/tty3270.c @@ -437,7 +437,7 @@ tty3270_rcl_add(struct tty3270 *tp, char *input, int len) { struct string *s; - tp->rcl_walk = NULL; + tp->rcl_walk = 0; if (len <= 0) return; if (tp->rcl_nr >= tp->rcl_max) { @@ -466,12 +466,12 @@ tty3270_rcl_backward(struct kbd_data *kbd) else if (!list_empty(&tp->rcl_lines)) tp->rcl_walk = tp->rcl_lines.prev; s = tp->rcl_walk ? - list_entry(tp->rcl_walk, struct string, list) : NULL; + list_entry(tp->rcl_walk, struct string, list) : 0; if (tp->rcl_walk) { s = list_entry(tp->rcl_walk, struct string, list); tty3270_update_prompt(tp, s->string, s->len); } else - tty3270_update_prompt(tp, NULL, 0); + tty3270_update_prompt(tp, 0, 0); tty3270_set_timer(tp, 1); } spin_unlock_bh(&tp->view.lock); @@ -553,7 +553,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq) * has to be emitted to the tty and for 0x6d the screen * needs to be redrawn. */ - input = NULL; + input = 0; len = 0; if (tp->input->string[0] == 0x7d) { /* Enter: write input to tty. */ @@ -567,7 +567,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq) tty3270_update_status(tp); } /* Clear input area. */ - tty3270_update_prompt(tp, NULL, 0); + tty3270_update_prompt(tp, 0, 0); tty3270_set_timer(tp, 1); } else if (tp->input->string[0] == 0x6d) { /* Display has been cleared. Redraw. */ @@ -808,8 +808,8 @@ tty3270_release(struct raw3270_view *view) tp = (struct tty3270 *) view; tty = tp->tty; if (tty) { - tty->driver_data = NULL; - tp->tty = tp->kbd->tty = NULL; + tty->driver_data = 0; + tp->tty = tp->kbd->tty = 0; tty_hangup(tty); raw3270_put_view(&tp->view); } @@ -948,8 +948,8 @@ tty3270_close(struct tty_struct *tty, struct file * filp) return; tp = (struct tty3270 *) tty->driver_data; if (tp) { - tty->driver_data = NULL; - tp->tty = tp->kbd->tty = NULL; + tty->driver_data = 0; + tp->tty = tp->kbd->tty = 0; raw3270_put_view(&tp->view); } } @@ -1673,7 +1673,7 @@ tty3270_set_termios(struct tty_struct *tty, struct termios *old) new = L_ECHO(tty) ? TF_INPUT: TF_INPUTN; if (new != tp->inattr) { tp->inattr = new; - tty3270_update_prompt(tp, NULL, 0); + tty3270_update_prompt(tp, 0, 0); tty3270_set_timer(tp, 1); } } @@ -1759,7 +1759,7 @@ void tty3270_notifier(int index, int active) { if (active) - tty_register_device(tty3270_driver, index, NULL); + tty_register_device(tty3270_driver, index, 0); else tty_unregister_device(tty3270_driver, index); } @@ -1818,7 +1818,7 @@ tty3270_exit(void) raw3270_unregister_notifier(tty3270_notifier); driver = tty3270_driver; - tty3270_driver = NULL; + tty3270_driver = 0; tty_unregister_driver(driver); tty3270_del_views(); } diff --git a/trunk/drivers/s390/char/vmlogrdr.c b/trunk/drivers/s390/char/vmlogrdr.c index 6cb23040954b..c625b69ebd19 100644 --- a/trunk/drivers/s390/char/vmlogrdr.c +++ b/trunk/drivers/s390/char/vmlogrdr.c @@ -86,8 +86,8 @@ struct vmlogrdr_priv_t { */ static int vmlogrdr_open(struct inode *, struct file *); static int vmlogrdr_release(struct inode *, struct file *); -static ssize_t vmlogrdr_read (struct file *filp, char __user *data, - size_t count, loff_t * ppos); +static ssize_t vmlogrdr_read (struct file *filp, char *data, size_t count, + loff_t * ppos); static struct file_operations vmlogrdr_fops = { .owner = THIS_MODULE, @@ -515,7 +515,7 @@ vmlogrdr_receive_data(struct vmlogrdr_priv_t *priv) { static ssize_t -vmlogrdr_read(struct file *filp, char __user *data, size_t count, loff_t * ppos) +vmlogrdr_read (struct file *filp, char *data, size_t count, loff_t * ppos) { int rc; struct vmlogrdr_priv_t * priv = filp->private_data; diff --git a/trunk/drivers/s390/char/vmwatchdog.c b/trunk/drivers/s390/char/vmwatchdog.c index 807320a41fa4..5acc0ace3d7d 100644 --- a/trunk/drivers/s390/char/vmwatchdog.c +++ b/trunk/drivers/s390/char/vmwatchdog.c @@ -193,7 +193,7 @@ static int vmwdt_ioctl(struct inode *i, struct file *f, return 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int __user *)arg); + return put_user(0, (int *)arg); case WDIOC_GETTEMP: return -EINVAL; case WDIOC_SETOPTIONS: diff --git a/trunk/drivers/s390/cio/ccwgroup.c b/trunk/drivers/s390/cio/ccwgroup.c index f26a2ee3aad8..c7319a07ba35 100644 --- a/trunk/drivers/s390/cio/ccwgroup.c +++ b/trunk/drivers/s390/cio/ccwgroup.c @@ -319,7 +319,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const if (!try_module_get(gdrv->owner)) return -EINVAL; - value = simple_strtoul(buf, NULL, 0); + value = simple_strtoul(buf, 0, 0); ret = count; if (value == 1) ccwgroup_set_online(gdev); diff --git a/trunk/drivers/s390/cio/chsc.c b/trunk/drivers/s390/cio/chsc.c index 61ce3f1d5228..a01f3bba4a7b 100644 --- a/trunk/drivers/s390/cio/chsc.c +++ b/trunk/drivers/s390/cio/chsc.c @@ -1464,40 +1464,6 @@ chsc_get_chp_desc(struct subchannel *sch, int chp_no) return desc; } -static int reset_channel_path(struct channel_path *chp) -{ - int cc; - - cc = rchp(chp->id); - switch (cc) { - case 0: - return 0; - case 2: - return -EBUSY; - default: - return -ENODEV; - } -} - -static void reset_channel_paths_css(struct channel_subsystem *css) -{ - int i; - - for (i = 0; i <= __MAX_CHPID; i++) { - if (css->chps[i]) - reset_channel_path(css->chps[i]); - } -} - -void cio_reset_channel_paths(void) -{ - int i; - - for (i = 0; i <= __MAX_CSSID; i++) { - if (css[i] && css[i]->valid) - reset_channel_paths_css(css[i]); - } -} static int __init chsc_alloc_sei_area(void) diff --git a/trunk/drivers/s390/cio/cio.c b/trunk/drivers/s390/cio/cio.c index 89320c1ad825..6fec90eab00e 100644 --- a/trunk/drivers/s390/cio/cio.c +++ b/trunk/drivers/s390/cio/cio.c @@ -519,7 +519,6 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid) memset(sch, 0, sizeof(struct subchannel)); spin_lock_init(&sch->lock); - mutex_init(&sch->reg_mutex); /* Set a name for the subchannel */ snprintf (sch->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", schid.ssid, @@ -798,7 +797,7 @@ struct subchannel * cio_get_console_subchannel(void) { if (!console_subchannel_in_use) - return NULL; + return 0; return &console_subchannel; } @@ -876,6 +875,5 @@ void reipl(unsigned long devno) { clear_all_subchannels(); - cio_reset_channel_paths(); do_reipl(devno); } diff --git a/trunk/drivers/s390/cio/cio.h b/trunk/drivers/s390/cio/cio.h index 4541c1af4b66..0ca987344e07 100644 --- a/trunk/drivers/s390/cio/cio.h +++ b/trunk/drivers/s390/cio/cio.h @@ -2,7 +2,6 @@ #define S390_CIO_H #include "schid.h" -#include /* * where we put the ssd info @@ -88,7 +87,7 @@ struct orb { struct subchannel { struct subchannel_id schid; spinlock_t lock; /* subchannel lock */ - struct mutex reg_mutex; + enum { SUBCHANNEL_TYPE_IO = 0, SUBCHANNEL_TYPE_CHSC = 1, diff --git a/trunk/drivers/s390/cio/cmf.c b/trunk/drivers/s390/cio/cmf.c index 0df3af1f08de..1c3e8e9012b0 100644 --- a/trunk/drivers/s390/cio/cmf.c +++ b/trunk/drivers/s390/cio/cmf.c @@ -1140,7 +1140,7 @@ static struct attribute *cmf_attributes[] = { &dev_attr_avg_device_disconnect_time.attr, &dev_attr_avg_control_unit_queuing_time.attr, &dev_attr_avg_device_active_only_time.attr, - NULL, + 0, }; static struct attribute_group cmf_attr_group = { @@ -1160,7 +1160,7 @@ static struct attribute *cmf_attributes_ext[] = { &dev_attr_avg_device_active_only_time.attr, &dev_attr_avg_device_busy_time.attr, &dev_attr_avg_initial_command_response_time.attr, - NULL, + 0, }; static struct attribute_group cmf_attr_group_ext = { diff --git a/trunk/drivers/s390/cio/css.c b/trunk/drivers/s390/cio/css.c index 13eeea3d547f..1d3be80797f8 100644 --- a/trunk/drivers/s390/cio/css.c +++ b/trunk/drivers/s390/cio/css.c @@ -108,24 +108,6 @@ css_subchannel_release(struct device *dev) extern int css_get_ssd_info(struct subchannel *sch); - -int css_sch_device_register(struct subchannel *sch) -{ - int ret; - - mutex_lock(&sch->reg_mutex); - ret = device_register(&sch->dev); - mutex_unlock(&sch->reg_mutex); - return ret; -} - -void css_sch_device_unregister(struct subchannel *sch) -{ - mutex_lock(&sch->reg_mutex); - device_unregister(&sch->dev); - mutex_unlock(&sch->reg_mutex); -} - static int css_register_subchannel(struct subchannel *sch) { @@ -137,7 +119,7 @@ css_register_subchannel(struct subchannel *sch) sch->dev.release = &css_subchannel_release; /* make it known to the system */ - ret = css_sch_device_register(sch); + ret = device_register(&sch->dev); if (ret) printk (KERN_WARNING "%s: could not register %s\n", __func__, sch->dev.bus_id); @@ -268,7 +250,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow) * The device will be killed automatically. */ cio_disable_subchannel(sch); - css_sch_device_unregister(sch); + device_unregister(&sch->dev); /* Reset intparm to zeroes. */ sch->schib.pmcw.intparm = 0; cio_modify(sch); @@ -282,7 +264,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow) * away in any case. */ if (!disc) { - css_sch_device_unregister(sch); + device_unregister(&sch->dev); /* Reset intparm to zeroes. */ sch->schib.pmcw.intparm = 0; cio_modify(sch); @@ -623,13 +605,9 @@ init_channel_subsystem (void) ret = device_register(&css[i]->device); if (ret) goto out_free; - if (css_characteristics_avail && - css_chsc_characteristics.secm) { - ret = device_create_file(&css[i]->device, - &dev_attr_cm_enable); - if (ret) - goto out_device; - } + if (css_characteristics_avail && css_chsc_characteristics.secm) + device_create_file(&css[i]->device, + &dev_attr_cm_enable); } css_init_done = 1; @@ -637,8 +615,6 @@ init_channel_subsystem (void) for_each_subchannel(__init_channel_subsystem, NULL); return 0; -out_device: - device_unregister(&css[i]->device); out_free: kfree(css[i]); out_unregister: diff --git a/trunk/drivers/s390/cio/css.h b/trunk/drivers/s390/cio/css.h index 8aabb4adeb5f..e210f89a2449 100644 --- a/trunk/drivers/s390/cio/css.h +++ b/trunk/drivers/s390/cio/css.h @@ -100,7 +100,7 @@ struct ccw_device_private { struct qdio_irq *qdio_data; struct irb irb; /* device status */ struct senseid senseid; /* SenseID info */ - struct pgid pgid[8]; /* path group IDs per chpid*/ + struct pgid pgid; /* path group ID */ struct ccw1 iccws[2]; /* ccws for SNID/SID/SPGID commands */ struct work_struct kick_work; wait_queue_head_t wait_q; @@ -136,8 +136,6 @@ extern struct bus_type css_bus_type; extern struct css_driver io_subchannel_driver; extern int css_probe_device(struct subchannel_id); -extern int css_sch_device_register(struct subchannel *); -extern void css_sch_device_unregister(struct subchannel *); extern struct subchannel * get_subchannel_by_schid(struct subchannel_id); extern int css_init_done; extern int for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *); diff --git a/trunk/drivers/s390/cio/device.c b/trunk/drivers/s390/cio/device.c index 585fa04233c3..67f0de6aed33 100644 --- a/trunk/drivers/s390/cio/device.c +++ b/trunk/drivers/s390/cio/device.c @@ -100,7 +100,7 @@ ccw_uevent (struct device *dev, char **envp, int num_envp, if ((buffer_size - length <= 0) || (i >= num_envp)) return -ENOMEM; - envp[i] = NULL; + envp[i] = 0; return 0; } @@ -280,7 +280,7 @@ ccw_device_remove_disconnected(struct ccw_device *cdev) * 'throw away device'. */ sch = to_subchannel(cdev->dev.parent); - css_sch_device_unregister(sch); + device_unregister(&sch->dev); /* Reset intparm to zeroes. */ sch->schib.pmcw.intparm = 0; cio_modify(sch); @@ -625,7 +625,7 @@ ccw_device_do_unreg_rereg(void *data) other_sch->schib.pmcw.intparm = 0; cio_modify(other_sch); } - css_sch_device_unregister(other_sch); + device_unregister(&other_sch->dev); } } /* Update ssd info here. */ @@ -709,7 +709,7 @@ ccw_device_call_sch_unregister(void *data) struct subchannel *sch; sch = to_subchannel(cdev->dev.parent); - css_sch_device_unregister(sch); + device_unregister(&sch->dev); /* Reset intparm to zeroes. */ sch->schib.pmcw.intparm = 0; cio_modify(sch); @@ -1057,7 +1057,7 @@ get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id) __ccwdev_check_busid); put_driver(drv); - return dev ? to_ccwdev(dev) : NULL; + return dev ? to_ccwdev(dev) : 0; } /************************** device driver handling ************************/ @@ -1082,7 +1082,7 @@ ccw_device_probe (struct device *dev) ret = cdrv->probe ? cdrv->probe(cdev) : -ENODEV; if (ret) { - cdev->drv = NULL; + cdev->drv = 0; return ret; } @@ -1113,7 +1113,7 @@ ccw_device_remove (struct device *dev) ret, cdev->dev.bus_id); } ccw_device_set_timeout(cdev, 0); - cdev->drv = NULL; + cdev->drv = 0; return 0; } diff --git a/trunk/drivers/s390/cio/device_fsm.c b/trunk/drivers/s390/cio/device_fsm.c index ac6e0c7e43d9..cb1af0b6f033 100644 --- a/trunk/drivers/s390/cio/device_fsm.c +++ b/trunk/drivers/s390/cio/device_fsm.c @@ -378,56 +378,6 @@ ccw_device_done(struct ccw_device *cdev, int state) put_device (&cdev->dev); } -static inline int cmp_pgid(struct pgid *p1, struct pgid *p2) -{ - char *c1; - char *c2; - - c1 = (char *)p1; - c2 = (char *)p2; - - return memcmp(c1 + 1, c2 + 1, sizeof(struct pgid) - 1); -} - -static void __ccw_device_get_common_pgid(struct ccw_device *cdev) -{ - int i; - int last; - - last = 0; - for (i = 0; i < 8; i++) { - if (cdev->private->pgid[i].inf.ps.state1 == SNID_STATE1_RESET) - /* No PGID yet */ - continue; - if (cdev->private->pgid[last].inf.ps.state1 == - SNID_STATE1_RESET) { - /* First non-zero PGID */ - last = i; - continue; - } - if (cmp_pgid(&cdev->private->pgid[i], - &cdev->private->pgid[last]) == 0) - /* Non-conflicting PGIDs */ - continue; - - /* PGID mismatch, can't pathgroup. */ - CIO_MSG_EVENT(0, "SNID - pgid mismatch for device " - "0.%x.%04x, can't pathgroup\n", - cdev->private->ssid, cdev->private->devno); - cdev->private->options.pgroup = 0; - return; - } - if (cdev->private->pgid[last].inf.ps.state1 == - SNID_STATE1_RESET) - /* No previous pgid found */ - memcpy(&cdev->private->pgid[0], &css[0]->global_pgid, - sizeof(struct pgid)); - else - /* Use existing pgid */ - memcpy(&cdev->private->pgid[0], &cdev->private->pgid[last], - sizeof(struct pgid)); -} - /* * Function called from device_pgid.c after sense path ground has completed. */ @@ -438,26 +388,24 @@ ccw_device_sense_pgid_done(struct ccw_device *cdev, int err) sch = to_subchannel(cdev->dev.parent); switch (err) { - case -EOPNOTSUPP: /* path grouping not supported, use nop instead. */ - cdev->private->options.pgroup = 0; - break; - case 0: /* success */ - case -EACCES: /* partial success, some paths not operational */ - /* Check if all pgids are equal or 0. */ - __ccw_device_get_common_pgid(cdev); + case 0: + /* Start Path Group verification. */ + sch->vpm = 0; /* Start with no path groups set. */ + cdev->private->state = DEV_STATE_VERIFY; + ccw_device_verify_start(cdev); break; case -ETIME: /* Sense path group id stopped by timeout. */ case -EUSERS: /* device is reserved for someone else. */ ccw_device_done(cdev, DEV_STATE_BOXED); - return; + break; + case -EOPNOTSUPP: /* path grouping not supported, just set online. */ + cdev->private->options.pgroup = 0; + ccw_device_done(cdev, DEV_STATE_ONLINE); + break; default: ccw_device_done(cdev, DEV_STATE_NOT_OPER); - return; + break; } - /* Start Path Group verification. */ - sch->vpm = 0; /* Start with no path groups set. */ - cdev->private->state = DEV_STATE_VERIFY; - ccw_device_verify_start(cdev); } /* @@ -614,9 +562,8 @@ ccw_device_online(struct ccw_device *cdev) } /* Do we want to do path grouping? */ if (!cdev->private->options.pgroup) { - /* Start initial path verification. */ - cdev->private->state = DEV_STATE_VERIFY; - ccw_device_verify_start(cdev); + /* No, set state online immediately. */ + ccw_device_done(cdev, DEV_STATE_ONLINE); return 0; } /* Do a SensePGID first. */ @@ -662,7 +609,6 @@ ccw_device_offline(struct ccw_device *cdev) /* Are we doing path grouping? */ if (!cdev->private->options.pgroup) { /* No, set state offline immediately. */ - sch->vpm = 0; ccw_device_done(cdev, DEV_STATE_OFFLINE); return 0; } @@ -759,6 +705,8 @@ ccw_device_online_verify(struct ccw_device *cdev, enum dev_event dev_event) { struct subchannel *sch; + if (!cdev->private->options.pgroup) + return; if (cdev->private->state == DEV_STATE_W4SENSE) { cdev->private->flags.doverify = 1; return; @@ -1047,7 +995,8 @@ static void ccw_device_wait4io_verify(struct ccw_device *cdev, enum dev_event dev_event) { /* When the I/O has terminated, we have to start verification. */ - cdev->private->flags.doverify = 1; + if (cdev->private->options.pgroup) + cdev->private->flags.doverify = 1; } static void diff --git a/trunk/drivers/s390/cio/device_pgid.c b/trunk/drivers/s390/cio/device_pgid.c index 32610fd8868e..54cb64ed0786 100644 --- a/trunk/drivers/s390/cio/device_pgid.c +++ b/trunk/drivers/s390/cio/device_pgid.c @@ -33,17 +33,12 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev) struct subchannel *sch; struct ccw1 *ccw; int ret; - int i; sch = to_subchannel(cdev->dev.parent); - /* Return if we already checked on all paths. */ - if (cdev->private->imask == 0) - return (sch->lpm == 0) ? -ENODEV : -EACCES; - i = 8 - ffs(cdev->private->imask); - /* Setup sense path group id channel program. */ ccw = cdev->private->iccws; ccw->cmd_code = CCW_CMD_SENSE_PGID; + ccw->cda = (__u32) __pa (&cdev->private->pgid); ccw->count = sizeof (struct pgid); ccw->flags = CCW_FLAG_SLI; @@ -53,7 +48,6 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev) ret = -ENODEV; while (cdev->private->imask != 0) { /* Try every path multiple times. */ - ccw->cda = (__u32) __pa (&cdev->private->pgid[i]); if (cdev->private->iretry > 0) { cdev->private->iretry--; ret = cio_start (sch, cdev->private->iccws, @@ -70,9 +64,7 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev) } cdev->private->imask >>= 1; cdev->private->iretry = 5; - i++; } - return ret; } @@ -84,7 +76,7 @@ ccw_device_sense_pgid_start(struct ccw_device *cdev) cdev->private->state = DEV_STATE_SENSE_PGID; cdev->private->imask = 0x80; cdev->private->iretry = 5; - memset (&cdev->private->pgid, 0, sizeof (cdev->private->pgid)); + memset (&cdev->private->pgid, 0, sizeof (struct pgid)); ret = __ccw_device_sense_pgid_start(cdev); if (ret && ret != -EBUSY) ccw_device_sense_pgid_done(cdev, ret); @@ -99,7 +91,6 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev) { struct subchannel *sch; struct irb *irb; - int i; sch = to_subchannel(cdev->dev.parent); irb = &cdev->private->irb; @@ -133,8 +124,7 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev) sch->schid.sch_no, sch->orb.lpm); return -EACCES; } - i = 8 - ffs(cdev->private->imask); - if (cdev->private->pgid[i].inf.ps.state2 == SNID_STATE2_RESVD_ELSE) { + if (cdev->private->pgid.inf.ps.state2 == SNID_STATE2_RESVD_ELSE) { CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x " "is reserved by someone else\n", cdev->private->devno, sch->schid.ssid, @@ -172,6 +162,12 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event) memset(&cdev->private->irb, 0, sizeof(struct irb)); switch (ret) { /* 0, -ETIME, -EOPNOTSUPP, -EAGAIN, -EACCES or -EUSERS */ + case 0: /* Sense Path Group ID successful. */ + if (cdev->private->pgid.inf.ps.state1 == SNID_STATE1_RESET) + memcpy(&cdev->private->pgid, &css[0]->global_pgid, + sizeof(struct pgid)); + ccw_device_sense_pgid_done(cdev, 0); + break; case -EOPNOTSUPP: /* Sense Path Group ID not supported */ ccw_device_sense_pgid_done(cdev, -EOPNOTSUPP); break; @@ -180,15 +176,13 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event) break; case -EACCES: /* channel is not operational. */ sch->lpm &= ~cdev->private->imask; - /* Fall through. */ - case 0: /* Sense Path Group ID successful. */ cdev->private->imask >>= 1; cdev->private->iretry = 5; /* Fall through. */ case -EAGAIN: /* Try again. */ ret = __ccw_device_sense_pgid_start(cdev); if (ret != 0 && ret != -EBUSY) - ccw_device_sense_pgid_done(cdev, ret); + ccw_device_sense_pgid_done(cdev, -ENODEV); break; case -EUSERS: /* device is reserved for someone else. */ ccw_device_sense_pgid_done(cdev, -EUSERS); @@ -209,20 +203,20 @@ __ccw_device_do_pgid(struct ccw_device *cdev, __u8 func) sch = to_subchannel(cdev->dev.parent); /* Setup sense path group id channel program. */ - cdev->private->pgid[0].inf.fc = func; + cdev->private->pgid.inf.fc = func; ccw = cdev->private->iccws; if (!cdev->private->flags.pgid_single) { - cdev->private->pgid[0].inf.fc |= SPID_FUNC_MULTI_PATH; + cdev->private->pgid.inf.fc |= SPID_FUNC_MULTI_PATH; ccw->cmd_code = CCW_CMD_SUSPEND_RECONN; ccw->cda = 0; ccw->count = 0; ccw->flags = CCW_FLAG_SLI | CCW_FLAG_CC; ccw++; } else - cdev->private->pgid[0].inf.fc |= SPID_FUNC_SINGLE_PATH; + cdev->private->pgid.inf.fc |= SPID_FUNC_SINGLE_PATH; ccw->cmd_code = CCW_CMD_SET_PGID; - ccw->cda = (__u32) __pa (&cdev->private->pgid[0]); + ccw->cda = (__u32) __pa (&cdev->private->pgid); ccw->count = sizeof (struct pgid); ccw->flags = CCW_FLAG_SLI; @@ -249,48 +243,6 @@ __ccw_device_do_pgid(struct ccw_device *cdev, __u8 func) return ret; } -/* - * Helper function to send a nop ccw down a path. - */ -static int __ccw_device_do_nop(struct ccw_device *cdev) -{ - struct subchannel *sch; - struct ccw1 *ccw; - int ret; - - sch = to_subchannel(cdev->dev.parent); - - /* Setup nop channel program. */ - ccw = cdev->private->iccws; - ccw->cmd_code = CCW_CMD_NOOP; - ccw->cda = 0; - ccw->count = 0; - ccw->flags = CCW_FLAG_SLI; - - /* Reset device status. */ - memset(&cdev->private->irb, 0, sizeof(struct irb)); - - /* Try multiple times. */ - ret = -ENODEV; - if (cdev->private->iretry > 0) { - cdev->private->iretry--; - ret = cio_start (sch, cdev->private->iccws, - cdev->private->imask); - /* ret is 0, -EBUSY, -EACCES or -ENODEV */ - if ((ret != -EACCES) && (ret != -ENODEV)) - return ret; - } - /* nop command failed on this path. Switch it off. */ - sch->lpm &= ~cdev->private->imask; - sch->vpm &= ~cdev->private->imask; - CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel " - "0.%x.%04x, lpm %02X, became 'not operational'\n", - cdev->private->devno, sch->schid.ssid, - sch->schid.sch_no, cdev->private->imask); - return ret; -} - - /* * Called from interrupt context to check if a valid answer * to Set Path Group ID was received. @@ -330,29 +282,6 @@ __ccw_device_check_pgid(struct ccw_device *cdev) return 0; } -/* - * Called from interrupt context to check the path status after a nop has - * been send. - */ -static int __ccw_device_check_nop(struct ccw_device *cdev) -{ - struct subchannel *sch; - struct irb *irb; - - sch = to_subchannel(cdev->dev.parent); - irb = &cdev->private->irb; - if (irb->scsw.fctl & (SCSW_FCTL_HALT_FUNC | SCSW_FCTL_CLEAR_FUNC)) - return -ETIME; - if (irb->scsw.cc == 3) { - CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel 0.%x.%04x," - " lpm %02X, became 'not operational'\n", - cdev->private->devno, sch->schid.ssid, - sch->schid.sch_no, cdev->private->imask); - return -EACCES; - } - return 0; -} - static void __ccw_device_verify_start(struct ccw_device *cdev) { @@ -367,12 +296,9 @@ __ccw_device_verify_start(struct ccw_device *cdev) if ((sch->vpm & imask) != (sch->lpm & imask)) break; cdev->private->imask = imask; - if (cdev->private->options.pgroup) { - func = (sch->vpm & imask) ? - SPID_FUNC_RESIGN : SPID_FUNC_ESTABLISH; - ret = __ccw_device_do_pgid(cdev, func); - } else - ret = __ccw_device_do_nop(cdev); + func = (sch->vpm & imask) ? + SPID_FUNC_RESIGN : SPID_FUNC_ESTABLISH; + ret = __ccw_device_do_pgid(cdev, func); if (ret == 0 || ret == -EBUSY) return; cdev->private->iretry = 5; @@ -401,10 +327,7 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event) if (ccw_device_accumulate_and_sense(cdev, irb) != 0) return; sch = to_subchannel(cdev->dev.parent); - if (cdev->private->options.pgroup) - ret = __ccw_device_check_pgid(cdev); - else - ret = __ccw_device_check_nop(cdev); + ret = __ccw_device_check_pgid(cdev); memset(&cdev->private->irb, 0, sizeof(struct irb)); switch (ret) { /* 0, -ETIME, -EAGAIN, -EOPNOTSUPP or -EACCES */ @@ -422,10 +345,11 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event) * One of those strange devices which claim to be able * to do multipathing but not for Set Path Group ID. */ - if (cdev->private->flags.pgid_single) - cdev->private->options.pgroup = 0; - else - cdev->private->flags.pgid_single = 1; + if (cdev->private->flags.pgid_single) { + ccw_device_verify_done(cdev, -EOPNOTSUPP); + break; + } + cdev->private->flags.pgid_single = 1; /* fall through. */ case -EAGAIN: /* Try again. */ __ccw_device_verify_start(cdev); diff --git a/trunk/drivers/s390/cio/device_status.c b/trunk/drivers/s390/cio/device_status.c index caf148d5caad..14bef2c179bf 100644 --- a/trunk/drivers/s390/cio/device_status.c +++ b/trunk/drivers/s390/cio/device_status.c @@ -67,7 +67,8 @@ ccw_device_path_notoper(struct ccw_device *cdev) sch->schib.pmcw.pnom); sch->lpm &= ~sch->schib.pmcw.pnom; - cdev->private->flags.doverify = 1; + if (cdev->private->options.pgroup) + cdev->private->flags.doverify = 1; } /* @@ -179,7 +180,7 @@ ccw_device_accumulate_esw(struct ccw_device *cdev, struct irb *irb) cdev_irb->esw.esw0.erw.auth = irb->esw.esw0.erw.auth; /* Copy path verification required flag. */ cdev_irb->esw.esw0.erw.pvrf = irb->esw.esw0.erw.pvrf; - if (irb->esw.esw0.erw.pvrf) + if (irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup) cdev->private->flags.doverify = 1; /* Copy concurrent sense bit. */ cdev_irb->esw.esw0.erw.cons = irb->esw.esw0.erw.cons; @@ -353,7 +354,7 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb) } /* Check if path verification is required. */ if (ccw_device_accumulate_esw_valid(irb) && - irb->esw.esw0.erw.pvrf) + irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup) cdev->private->flags.doverify = 1; } diff --git a/trunk/drivers/s390/cio/qdio.c b/trunk/drivers/s390/cio/qdio.c index 7c93a8798d23..b70039af70d6 100644 --- a/trunk/drivers/s390/cio/qdio.c +++ b/trunk/drivers/s390/cio/qdio.c @@ -2735,7 +2735,7 @@ qdio_free(struct ccw_device *cdev) QDIO_DBF_TEXT1(0,trace,dbf_text); QDIO_DBF_TEXT0(0,setup,dbf_text); - cdev->private->qdio_data = NULL; + cdev->private->qdio_data = 0; up(&irq_ptr->setting_up_sema); diff --git a/trunk/drivers/s390/net/claw.c b/trunk/drivers/s390/net/claw.c index 95f4e105cb96..23d53bf9daf1 100644 --- a/trunk/drivers/s390/net/claw.c +++ b/trunk/drivers/s390/net/claw.c @@ -529,7 +529,7 @@ claw_open(struct net_device *dev) printk(KERN_INFO "%s:%s Enter \n",dev->name,__FUNCTION__); #endif CLAW_DBF_TEXT(4,trace,"open"); - if (!dev || (dev->name[0] == 0x00)) { + if (!dev | (dev->name[0] == 0x00)) { CLAW_DBF_TEXT(2,trace,"BadDev"); printk(KERN_WARNING "claw: Bad device at open failing \n"); return -ENODEV; diff --git a/trunk/drivers/s390/net/iucv.c b/trunk/drivers/s390/net/iucv.c index 0e863df4027a..189a49275433 100644 --- a/trunk/drivers/s390/net/iucv.c +++ b/trunk/drivers/s390/net/iucv.c @@ -692,7 +692,7 @@ iucv_retrieve_buffer (void) iucv_debug(1, "entering"); if (iucv_cpuid != -1) { smp_call_function_on(iucv_retrieve_buffer_cpuid, - NULL, 0, 1, iucv_cpuid); + 0, 0, 1, iucv_cpuid); /* Release the cpu reserved by iucv_declare_buffer. */ smp_put_cpu(iucv_cpuid); iucv_cpuid = -1; diff --git a/trunk/drivers/s390/net/netiucv.c b/trunk/drivers/s390/net/netiucv.c index 5d6e6cbfa360..b452cc1afd55 100644 --- a/trunk/drivers/s390/net/netiucv.c +++ b/trunk/drivers/s390/net/netiucv.c @@ -2029,7 +2029,7 @@ remove_write (struct device_driver *drv, const char *buf, size_t count) count = IFNAMSIZ-1; for (i=0, p=(char *)buf; ilen; -#ifdef CONFIG_QETH_PERF_STATS unsigned short nr_frags = skb_shinfo(skb)->nr_frags; unsigned short tso_size = skb_shinfo(skb)->gso_size; -#endif int rc; QETH_DBF_TEXT(trace, 6, "sendpkt"); @@ -4459,7 +4457,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) queue = card->qdio.out_qs [qeth_get_priority_queue(card, skb, ipv, cast_type)]; - if (skb_is_gso(skb)) + if (skb_shinfo(skb)->gso_size) large_send = card->options.large_send; /*are we able to do TSO ? If so ,prepare and send it from here */ @@ -4804,7 +4802,7 @@ static struct qeth_cmd_buffer * qeth_get_setassparms_cmd(struct qeth_card *, enum qeth_ipa_funcs, __u16, __u16, enum qeth_prot_versions); static int -qeth_arp_query(struct qeth_card *card, char __user *udata) +qeth_arp_query(struct qeth_card *card, char *udata) { struct qeth_cmd_buffer *iob; struct qeth_arp_query_info qinfo = {0, }; @@ -4937,7 +4935,7 @@ qeth_get_adapter_cmd(struct qeth_card *card, __u32 command, __u32 cmdlen) * function to send SNMP commands to OSA-E card */ static int -qeth_snmp_command(struct qeth_card *card, char __user *udata) +qeth_snmp_command(struct qeth_card *card, char *udata) { struct qeth_cmd_buffer *iob; struct qeth_ipa_cmd *cmd; @@ -7909,9 +7907,9 @@ qeth_set_online(struct ccwgroup_device *gdev) } static struct ccw_device_id qeth_ids[] = { - {CCW_DEVICE(0x1731, 0x01), .driver_info = QETH_CARD_TYPE_OSAE}, - {CCW_DEVICE(0x1731, 0x05), .driver_info = QETH_CARD_TYPE_IQD}, - {CCW_DEVICE(0x1731, 0x06), .driver_info = QETH_CARD_TYPE_OSN}, + {CCW_DEVICE(0x1731, 0x01), driver_info:QETH_CARD_TYPE_OSAE}, + {CCW_DEVICE(0x1731, 0x05), driver_info:QETH_CARD_TYPE_IQD}, + {CCW_DEVICE(0x1731, 0x06), driver_info:QETH_CARD_TYPE_OSN}, {}, }; MODULE_DEVICE_TABLE(ccw, qeth_ids); @@ -8380,7 +8378,7 @@ qeth_ip_event(struct notifier_block *this, static struct notifier_block qeth_ip_notifier = { qeth_ip_event, - NULL, + 0 }; #ifdef CONFIG_QETH_IPV6 @@ -8433,7 +8431,7 @@ qeth_ip6_event(struct notifier_block *this, static struct notifier_block qeth_ip6_notifier = { qeth_ip6_event, - NULL, + 0 }; #endif @@ -8460,7 +8458,7 @@ qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) static struct notifier_block qeth_reboot_notifier = { qeth_reboot_event, - NULL, + 0 }; static int diff --git a/trunk/drivers/s390/net/qeth_sys.c b/trunk/drivers/s390/net/qeth_sys.c index 001497bbea16..185a9cfbcbdc 100644 --- a/trunk/drivers/s390/net/qeth_sys.c +++ b/trunk/drivers/s390/net/qeth_sys.c @@ -1755,7 +1755,7 @@ qeth_driver_group_store(struct device_driver *ddrv, const char *buf, } -static DRIVER_ATTR(group, 0200, NULL, qeth_driver_group_store); +static DRIVER_ATTR(group, 0200, 0, qeth_driver_group_store); static ssize_t qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf, @@ -1783,7 +1783,7 @@ qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf, return count; } -static DRIVER_ATTR(notifier_register, 0200, NULL, +static DRIVER_ATTR(notifier_register, 0200, 0, qeth_driver_notifier_register_store); int diff --git a/trunk/drivers/s390/net/smsgiucv.c b/trunk/drivers/s390/net/smsgiucv.c index b8179c27ceb6..72118ee68954 100644 --- a/trunk/drivers/s390/net/smsgiucv.c +++ b/trunk/drivers/s390/net/smsgiucv.c @@ -66,7 +66,7 @@ smsg_message_pending(iucv_MessagePending *eib, void *pgm_data) return; } rc = iucv_receive(eib->ippathid, eib->ipmsgid, eib->iptrgcls, - msg, len, NULL, NULL, NULL); + msg, len, 0, 0, 0); if (rc == 0) { msg[len] = 0; EBCASC(msg, len); @@ -122,7 +122,7 @@ smsg_unregister_callback(char *prefix, void (*callback)(char *from, char *str)) struct smsg_callback *cb, *tmp; spin_lock(&smsg_list_lock); - cb = NULL; + cb = 0; list_for_each_entry(tmp, &smsg_list, list) if (tmp->callback == callback && strcmp(tmp->prefix, prefix) == 0) { @@ -139,7 +139,7 @@ smsg_exit(void) { if (smsg_handle > 0) { cpcmd("SET SMSG OFF", NULL, 0, NULL); - iucv_sever(smsg_pathid, NULL); + iucv_sever(smsg_pathid, 0); iucv_unregister_program(smsg_handle); driver_unregister(&smsg_driver); } @@ -162,19 +162,19 @@ smsg_init(void) return rc; } smsg_handle = iucv_register_program("SMSGIUCV ", "*MSG ", - pgmmask, &smsg_ops, NULL); + pgmmask, &smsg_ops, 0); if (!smsg_handle) { printk(KERN_ERR "SMSGIUCV: failed to register to iucv"); driver_unregister(&smsg_driver); return -EIO; /* better errno ? */ } - rc = iucv_connect (&smsg_pathid, 255, NULL, "*MSG ", NULL, 0, - NULL, NULL, smsg_handle, NULL); + rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG ", 0, 0, 0, 0, + smsg_handle, 0); if (rc) { printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG"); iucv_unregister_program(smsg_handle); driver_unregister(&smsg_driver); - smsg_handle = NULL; + smsg_handle = 0; return -EIO; } cpcmd("SET SMSG IUCV", NULL, 0, NULL); diff --git a/trunk/drivers/s390/s390mach.c b/trunk/drivers/s390/s390mach.c index 5399c5d99b81..ffb3677e354f 100644 --- a/trunk/drivers/s390/s390mach.c +++ b/trunk/drivers/s390/s390mach.c @@ -111,16 +111,6 @@ s390_collect_crw_info(void *param) break; case CRW_RSC_CPATH: pr_debug("source is channel path %02X\n", crw[0].rsid); - /* - * Check for solicited machine checks. These are - * created by reset channel path and need not be - * reported to the common I/O layer. - */ - if (crw[chain].slct) { - DBG(KERN_INFO"solicited machine check for " - "channel path %02X\n", crw[0].rsid); - break; - } switch (crw[0].erc) { case CRW_ERC_IPARM: /* Path has come. */ ret = chp_process_crw(crw[0].rsid, 1); diff --git a/trunk/drivers/s390/scsi/zfcp_fsf.c b/trunk/drivers/s390/scsi/zfcp_fsf.c index 31db2b06faba..6335f9229184 100644 --- a/trunk/drivers/s390/scsi/zfcp_fsf.c +++ b/trunk/drivers/s390/scsi/zfcp_fsf.c @@ -2227,7 +2227,7 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, /* setup new FSF request */ retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, erp_action ? ZFCP_REQ_AUTO_CLEANUP : 0, - NULL, &lock_flags, &fsf_req); + 0, &lock_flags, &fsf_req); if (retval < 0) { ZFCP_LOG_INFO("error: Out of resources. Could not create an " "exchange port data request for" diff --git a/trunk/drivers/s390/scsi/zfcp_scsi.c b/trunk/drivers/s390/scsi/zfcp_scsi.c index 671f4a6a5d18..46e14f22ec18 100644 --- a/trunk/drivers/s390/scsi/zfcp_scsi.c +++ b/trunk/drivers/s390/scsi/zfcp_scsi.c @@ -44,29 +44,30 @@ struct scsi_transport_template *zfcp_transport_template; struct zfcp_data zfcp_data = { .scsi_host_template = { - .name = ZFCP_NAME, - .proc_name = "zfcp", - .proc_info = NULL, - .detect = NULL, - .slave_alloc = zfcp_scsi_slave_alloc, - .slave_configure = zfcp_scsi_slave_configure, - .slave_destroy = zfcp_scsi_slave_destroy, - .queuecommand = zfcp_scsi_queuecommand, - .eh_abort_handler = zfcp_scsi_eh_abort_handler, - .eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler, - .eh_bus_reset_handler = zfcp_scsi_eh_bus_reset_handler, - .eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler, - .can_queue = 4096, - .this_id = -1, - /* - * FIXME: - * one less? can zfcp_create_sbale cope with it? - */ - .sg_tablesize = ZFCP_MAX_SBALES_PER_REQ, - .cmd_per_lun = 1, - .unchecked_isa_dma = 0, - .use_clustering = 1, - .sdev_attrs = zfcp_sysfs_sdev_attrs, + name: ZFCP_NAME, + proc_name: "zfcp", + proc_info: NULL, + detect: NULL, + slave_alloc: zfcp_scsi_slave_alloc, + slave_configure: zfcp_scsi_slave_configure, + slave_destroy: zfcp_scsi_slave_destroy, + queuecommand: zfcp_scsi_queuecommand, + eh_abort_handler: zfcp_scsi_eh_abort_handler, + eh_device_reset_handler: zfcp_scsi_eh_device_reset_handler, + eh_bus_reset_handler: zfcp_scsi_eh_bus_reset_handler, + eh_host_reset_handler: zfcp_scsi_eh_host_reset_handler, + /* FIXME(openfcp): Tune */ + can_queue: 4096, + this_id: -1, + /* + * FIXME: + * one less? can zfcp_create_sbale cope with it? + */ + sg_tablesize: ZFCP_MAX_SBALES_PER_REQ, + cmd_per_lun: 1, + unchecked_isa_dma: 0, + use_clustering: 1, + sdev_attrs: zfcp_sysfs_sdev_attrs, }, .driver_version = ZFCP_VERSION, /* rest initialised with zeros */ diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h index 601340d84410..9e871de23835 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h @@ -93,6 +93,7 @@ #endif /********************************** Misc Macros *******************************/ +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) #define powerof2(x) ((((x)-1)&(x))==0) /************************* Forward Declarations *******************************/ diff --git a/trunk/drivers/serial/dz.c b/trunk/drivers/serial/dz.c index d119c8296a78..8a98aae80e22 100644 --- a/trunk/drivers/serial/dz.c +++ b/trunk/drivers/serial/dz.c @@ -673,7 +673,7 @@ static void dz_reset(struct dz_port *dport) } #ifdef CONFIG_SERIAL_DZ_CONSOLE -static void dz_console_putchar(struct uart_port *port, int ch) +static void dz_console_putchar(struct uart_port *uport, int ch) { struct dz_port *dport = (struct dz_port *)uport; unsigned long flags; diff --git a/trunk/drivers/serial/sunsu.c b/trunk/drivers/serial/sunsu.c index 93bdaa3169fc..f9013baba05b 100644 --- a/trunk/drivers/serial/sunsu.c +++ b/trunk/drivers/serial/sunsu.c @@ -1406,35 +1406,25 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m struct device_node *dp = op->node; struct uart_sunsu_port *up; struct resource *rp; - enum su_type type; int err; - type = su_get_type(dp); - if (type == SU_PORT_PORT) { - if (inst >= UART_NR) - return -EINVAL; - up = &sunsu_ports[inst]; - } else { - up = kzalloc(sizeof(*up), GFP_KERNEL); - if (!up) - return -ENOMEM; - } + if (inst >= UART_NR) + return -EINVAL; + up = &sunsu_ports[inst]; up->port.line = inst; spin_lock_init(&up->port.lock); - up->su_type = type; + up->su_type = su_get_type(dp); rp = &op->resource[0]; - up->port.mapbase = rp->start; + up->port.mapbase = op->resource[0].start; + up->reg_size = (rp->end - rp->start) + 1; up->port.membase = of_ioremap(rp, 0, up->reg_size, "su"); - if (!up->port.membase) { - if (type != SU_PORT_PORT) - kfree(up); + if (!up->port.membase) return -ENOMEM; - } up->port.irq = op->irqs[0]; @@ -1446,11 +1436,8 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m err = 0; if (up->su_type == SU_PORT_KBD || up->su_type == SU_PORT_MS) { err = sunsu_kbd_ms_init(up); - if (err) { - kfree(up); + if (err) goto out_unmap; - } - dev_set_drvdata(&op->dev, up); return 0; } @@ -1489,12 +1476,8 @@ static int __devexit su_remove(struct of_device *dev) #ifdef CONFIG_SERIO serio_unregister_port(&up->serio); #endif - kfree(up); - } else if (up->port.type != PORT_UNKNOWN) { + } else if (up->port.type != PORT_UNKNOWN) uart_remove_one_port(&sunsu_reg, &up->port); - } - - dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/usb/Kconfig b/trunk/drivers/usb/Kconfig index 2ee742d40c43..7fdbc5dad5fd 100644 --- a/trunk/drivers/usb/Kconfig +++ b/trunk/drivers/usb/Kconfig @@ -23,7 +23,6 @@ config USB_ARCH_HAS_OHCI default y if ARCH_LH7A404 default y if ARCH_S3C2410 default y if PXA27x - default y if ARCH_EP93XX default y if ARCH_AT91RM9200 # PPC: default y if STB03xxx diff --git a/trunk/drivers/usb/Makefile b/trunk/drivers/usb/Makefile index 4710eb02ed64..c7123bf71c58 100644 --- a/trunk/drivers/usb/Makefile +++ b/trunk/drivers/usb/Makefile @@ -48,7 +48,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/ obj-$(CONFIG_USB_SERIAL) += serial/ obj-$(CONFIG_USB_AUERSWALD) += misc/ -obj-$(CONFIG_USB_CYPRESS_CY7C63)+= misc/ +obj-$(CONFIG_USB_CY7C63) += misc/ obj-$(CONFIG_USB_CYTHERM) += misc/ obj-$(CONFIG_USB_EMI26) += misc/ obj-$(CONFIG_USB_EMI62) += misc/ diff --git a/trunk/drivers/usb/class/cdc-acm.c b/trunk/drivers/usb/class/cdc-acm.c index ca90326f2f5c..3670d77e912c 100644 --- a/trunk/drivers/usb/class/cdc-acm.c +++ b/trunk/drivers/usb/class/cdc-acm.c @@ -291,13 +291,13 @@ static void acm_read_bulk(struct urb *urb, struct pt_regs *regs) struct acm_ru *rcv = urb->context; struct acm *acm = rcv->instance; int status = urb->status; - dbg("Entering acm_read_bulk with status %d", urb->status); + dbg("Entering acm_read_bulk with status %d\n", urb->status); if (!ACM_READY(acm)) return; if (status) - dev_dbg(&acm->data->dev, "bulk rx status %d", status); + dev_dbg(&acm->data->dev, "bulk rx status %d\n", status); buf = rcv->buffer; buf->size = urb->actual_length; @@ -343,7 +343,7 @@ static void acm_rx_tasklet(unsigned long _acm) list_del(&buf->list); spin_unlock(&acm->read_lock); - dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size); + dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d\n", buf, buf->size); tty_buffer_request_room(tty, buf->size); if (!acm->throttle) @@ -394,7 +394,7 @@ static void acm_rx_tasklet(unsigned long _acm) rcv->urb->transfer_dma = buf->dma; rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p", rcv->urb, rcv, buf); + dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p\n", rcv->urb, rcv, buf); /* This shouldn't kill the driver as unsuccessful URBs are returned to the free-urbs-pool and resubmited ASAP */ @@ -413,7 +413,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs) { struct acm *acm = (struct acm *)urb->context; - dbg("Entering acm_write_bulk with status %d", urb->status); + dbg("Entering acm_write_bulk with status %d\n", urb->status); acm_write_done(acm); acm_write_start(acm); @@ -424,7 +424,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs) static void acm_softint(void *private) { struct acm *acm = private; - dbg("Entering acm_softint."); + dbg("Entering acm_softint.\n"); if (!ACM_READY(acm)) return; @@ -440,7 +440,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) struct acm *acm; int rv = -EINVAL; int i; - dbg("Entering acm_tty_open."); + dbg("Entering acm_tty_open.\n"); mutex_lock(&open_mutex); @@ -541,7 +541,7 @@ static int acm_tty_write(struct tty_struct *tty, const unsigned char *buf, int c int wbn; struct acm_wb *wb; - dbg("Entering acm_tty_write to write %d bytes,", count); + dbg("Entering acm_tty_write to write %d bytes,\n", count); if (!ACM_READY(acm)) return -EINVAL; @@ -793,7 +793,7 @@ static int acm_probe (struct usb_interface *intf, if (!buflen) { if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) { - dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint"); + dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint\n"); buflen = intf->cur_altsetting->endpoint->extralen; buffer = intf->cur_altsetting->endpoint->extra; } else { @@ -842,24 +842,24 @@ static int acm_probe (struct usb_interface *intf, if (!union_header) { if (call_interface_num > 0) { - dev_dbg(&intf->dev,"No union descriptor, using call management descriptor"); + dev_dbg(&intf->dev,"No union descriptor, using call management descriptor\n"); data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num)); control_interface = intf; } else { - dev_dbg(&intf->dev,"No union descriptor, giving up"); + dev_dbg(&intf->dev,"No union descriptor, giving up\n"); return -ENODEV; } } else { control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0); data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0)); if (!control_interface || !data_interface) { - dev_dbg(&intf->dev,"no interfaces"); + dev_dbg(&intf->dev,"no interfaces\n"); return -ENODEV; } } if (data_interface_num != call_interface_num) - dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported."); + dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n"); skip_normal_probe: @@ -867,7 +867,7 @@ static int acm_probe (struct usb_interface *intf, if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) { if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) { struct usb_interface *t; - dev_dbg(&intf->dev,"Your device has switched interfaces."); + dev_dbg(&intf->dev,"Your device has switched interfaces.\n"); t = control_interface; control_interface = data_interface; @@ -878,7 +878,7 @@ static int acm_probe (struct usb_interface *intf, } if (usb_interface_claimed(data_interface)) { /* valid in this context */ - dev_dbg(&intf->dev,"The data interface isn't available"); + dev_dbg(&intf->dev,"The data interface isn't available\n"); return -EBUSY; } @@ -895,7 +895,7 @@ static int acm_probe (struct usb_interface *intf, if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) { /* descriptors are swapped */ struct usb_endpoint_descriptor *t; - dev_dbg(&intf->dev,"The data interface has switched endpoints"); + dev_dbg(&intf->dev,"The data interface has switched endpoints\n"); t = epread; epread = epwrite; @@ -910,7 +910,7 @@ static int acm_probe (struct usb_interface *intf, } if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) { - dev_dbg(&intf->dev, "out of memory (acm kzalloc)"); + dev_dbg(&intf->dev, "out of memory (acm kzalloc)\n"); goto alloc_fail; } @@ -936,26 +936,26 @@ static int acm_probe (struct usb_interface *intf, buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); if (!buf) { - dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)"); + dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n"); goto alloc_fail2; } acm->ctrl_buffer = buf; if (acm_write_buffers_alloc(acm) < 0) { - dev_dbg(&intf->dev, "out of memory (write buffer alloc)"); + dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n"); goto alloc_fail4; } acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL); if (!acm->ctrlurb) { - dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)"); + dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n"); goto alloc_fail5; } for (i = 0; i < num_rx_buf; i++) { struct acm_ru *rcv = &(acm->ru[i]); if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) { - dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)"); + dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n"); goto alloc_fail7; } @@ -966,13 +966,13 @@ static int acm_probe (struct usb_interface *intf, struct acm_rb *buf = &(acm->rb[i]); if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) { - dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)"); + dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n"); goto alloc_fail7; } } acm->writeurb = usb_alloc_urb(0, GFP_KERNEL); if (!acm->writeurb) { - dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)"); + dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n"); goto alloc_fail7; } @@ -1086,9 +1086,6 @@ static struct usb_device_id acm_ids[] = { { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */ .driver_info = SINGLE_RX_URB, /* firmware bug */ }, - { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */ - .driver_info = SINGLE_RX_URB, /* firmware bug */ - }, /* control interfaces with various AT-command sets */ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, USB_CDC_ACM_PROTO_AT_V25TER) }, diff --git a/trunk/drivers/usb/core/Kconfig b/trunk/drivers/usb/core/Kconfig index 6e3b5358a760..a08787e253aa 100644 --- a/trunk/drivers/usb/core/Kconfig +++ b/trunk/drivers/usb/core/Kconfig @@ -31,6 +31,9 @@ config USB_DEVICEFS For the format of the various /proc/bus/usb/ files, please read . + Please note that this code is completely unrelated to devfs, the + "/dev file system support". + Most users want to say Y here. config USB_BANDWIDTH diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 26c8cb5f3e67..875596e98e42 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -1790,10 +1790,7 @@ static int finish_device_resume(struct usb_device *udev) * and device drivers will know about any resume quirks. */ status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); - if (status >= 0) - status = (status == 2 ? 0 : -ENODEV); - - if (status) + if (status < 2) dev_dbg(&udev->dev, "gone after usb resume? status %d\n", status); @@ -1882,12 +1879,7 @@ hub_port_resume(struct usb_hub *hub, int port1, struct usb_device *udev) dev_dbg(hub->intfdev, "port %d status %04x.%04x after resume, %d\n", port1, portchange, devstatus, status); - if (status >= 0) - status = -ENODEV; } else { - if (portchange & USB_PORT_STAT_C_SUSPEND) - clear_port_feature(hub->hdev, port1, - USB_PORT_FEAT_C_SUSPEND); /* TRSMRCY = 10 msec */ msleep(10); if (udev) diff --git a/trunk/drivers/usb/core/inode.c b/trunk/drivers/usb/core/inode.c index 3182c2224ba2..f48c3dbc367a 100644 --- a/trunk/drivers/usb/core/inode.c +++ b/trunk/drivers/usb/core/inode.c @@ -695,7 +695,7 @@ static void usbfs_remove_device(struct usb_device *dev) wake_up_all(&ds->wait); list_del_init(&ds->list); if (ds->discsignr) { - sinfo.si_signo = ds->discsignr; + sinfo.si_signo = SIGPIPE; sinfo.si_errno = EPIPE; sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = ds->disccontext; diff --git a/trunk/drivers/usb/gadget/epautoconf.c b/trunk/drivers/usb/gadget/epautoconf.c index 53d584589c26..f7c6d758e1b0 100644 --- a/trunk/drivers/usb/gadget/epautoconf.c +++ b/trunk/drivers/usb/gadget/epautoconf.c @@ -34,12 +34,12 @@ /* we must assign addresses for configurable endpoints (like net2280) */ -static __devinitdata unsigned epnum; +static __initdata unsigned epnum; // #define MANY_ENDPOINTS #ifdef MANY_ENDPOINTS /* more than 15 configurable endpoints */ -static __devinitdata unsigned in_epnum; +static __initdata unsigned in_epnum; #endif @@ -59,7 +59,7 @@ static __devinitdata unsigned in_epnum; * NOTE: each endpoint is unidirectional, as specified by its USB * descriptor; and isn't specific to a configuration or altsetting. */ -static int __devinit +static int __init ep_matches ( struct usb_gadget *gadget, struct usb_ep *ep, @@ -73,7 +73,7 @@ ep_matches ( /* endpoint already claimed? */ if (0 != ep->driver_data) return 0; - + /* only support ep0 for portable CONTROL traffic */ type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; if (USB_ENDPOINT_XFER_CONTROL == type) @@ -186,7 +186,7 @@ ep_matches ( return 1; } -static struct usb_ep * __devinit +static struct usb_ep * __init find_ep (struct usb_gadget *gadget, const char *name) { struct usb_ep *ep; @@ -228,7 +228,7 @@ find_ep (struct usb_gadget *gadget, const char *name) * * On failure, this returns a null endpoint descriptor. */ -struct usb_ep * __devinit usb_ep_autoconfig ( +struct usb_ep * __init usb_ep_autoconfig ( struct usb_gadget *gadget, struct usb_endpoint_descriptor *desc ) @@ -276,7 +276,7 @@ struct usb_ep * __devinit usb_ep_autoconfig ( return ep; } - /* Second, look at endpoints until an unclaimed one looks usable */ + /* Second, look at endpoints until an unclaimed one looks usable */ list_for_each_entry (ep, &gadget->ep_list, ep_list) { if (ep_matches (gadget, ep, desc)) return ep; @@ -295,7 +295,7 @@ struct usb_ep * __devinit usb_ep_autoconfig ( * state such as ep->driver_data and the record of assigned endpoints * used by usb_ep_autoconfig(). */ -void __devinit usb_ep_autoconfig_reset (struct usb_gadget *gadget) +void __init usb_ep_autoconfig_reset (struct usb_gadget *gadget) { struct usb_ep *ep; diff --git a/trunk/drivers/usb/gadget/ether.c b/trunk/drivers/usb/gadget/ether.c index 4fe1bec1c255..8320fcef0425 100644 --- a/trunk/drivers/usb/gadget/ether.c +++ b/trunk/drivers/usb/gadget/ether.c @@ -2131,7 +2131,7 @@ eth_req_free (struct usb_ep *ep, struct usb_request *req) } -static void /* __init_or_exit */ +static void __exit eth_unbind (struct usb_gadget *gadget) { struct eth_dev *dev = get_gadget_data (gadget); @@ -2158,7 +2158,7 @@ eth_unbind (struct usb_gadget *gadget) set_gadget_data (gadget, NULL); } -static u8 __devinit nibble (unsigned char c) +static u8 __init nibble (unsigned char c) { if (likely (isdigit (c))) return c - '0'; @@ -2168,7 +2168,7 @@ static u8 __devinit nibble (unsigned char c) return 0; } -static int __devinit get_ether_addr(const char *str, u8 *dev_addr) +static int __init get_ether_addr(const char *str, u8 *dev_addr) { if (str) { unsigned i; @@ -2189,7 +2189,7 @@ static int __devinit get_ether_addr(const char *str, u8 *dev_addr) return 1; } -static int __devinit +static int __init eth_bind (struct usb_gadget *gadget) { struct eth_dev *dev; diff --git a/trunk/drivers/usb/gadget/file_storage.c b/trunk/drivers/usb/gadget/file_storage.c index 8d7f1e84cd7b..b1a9cf06f3e6 100644 --- a/trunk/drivers/usb/gadget/file_storage.c +++ b/trunk/drivers/usb/gadget/file_storage.c @@ -3691,7 +3691,7 @@ static void lun_release(struct device *dev) kref_put(&fsg->ref, fsg_release); } -static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget) +static void __exit fsg_unbind(struct usb_gadget *gadget) { struct fsg_dev *fsg = get_gadget_data(gadget); int i; diff --git a/trunk/drivers/usb/gadget/rndis.c b/trunk/drivers/usb/gadget/rndis.c index 408c3380d602..354670d12308 100644 --- a/trunk/drivers/usb/gadget/rndis.c +++ b/trunk/drivers/usb/gadget/rndis.c @@ -1398,7 +1398,7 @@ static struct proc_dir_entry *rndis_connect_state [RNDIS_MAX_CONFIGS]; #endif /* CONFIG_USB_GADGET_DEBUG_FILES */ -int __devinit rndis_init (void) +int __init rndis_init (void) { u8 i; diff --git a/trunk/drivers/usb/gadget/rndis.h b/trunk/drivers/usb/gadget/rndis.h index 4c3c7259f019..2956608be751 100644 --- a/trunk/drivers/usb/gadget/rndis.h +++ b/trunk/drivers/usb/gadget/rndis.h @@ -264,7 +264,7 @@ int rndis_signal_disconnect (int configNr); int rndis_state (int configNr); extern void rndis_set_host_mac (int configNr, const u8 *addr); -int __devinit rndis_init (void); +int __init rndis_init (void); void rndis_exit (void); #endif /* _LINUX_RNDIS_H */ diff --git a/trunk/drivers/usb/gadget/serial.c b/trunk/drivers/usb/gadget/serial.c index e762aa19ab0a..30d7664d449d 100644 --- a/trunk/drivers/usb/gadget/serial.c +++ b/trunk/drivers/usb/gadget/serial.c @@ -1473,7 +1473,7 @@ static int __init gs_bind(struct usb_gadget *gadget) * Called on module unload. Frees the control request and device * structure. */ -static void /* __init_or_exit */ gs_unbind(struct usb_gadget *gadget) +static void __exit gs_unbind(struct usb_gadget *gadget) { struct gs_dev *dev = get_gadget_data(gadget); diff --git a/trunk/drivers/usb/gadget/zero.c b/trunk/drivers/usb/gadget/zero.c index b7018ee487ea..3a08a7ab4ce0 100644 --- a/trunk/drivers/usb/gadget/zero.c +++ b/trunk/drivers/usb/gadget/zero.c @@ -1121,7 +1121,7 @@ zero_autoresume (unsigned long _dev) /*-------------------------------------------------------------------------*/ -static void /* __init_or_exit */ +static void __exit zero_unbind (struct usb_gadget *gadget) { struct zero_dev *dev = get_gadget_data (gadget); diff --git a/trunk/drivers/usb/host/ehci-au1xxx.c b/trunk/drivers/usb/host/ehci-au1xxx.c index 26ed757d22a6..d66867aa527e 100644 --- a/trunk/drivers/usb/host/ehci-au1xxx.c +++ b/trunk/drivers/usb/host/ehci-au1xxx.c @@ -41,6 +41,8 @@ #endif #define USBH_DISABLE (USB_MCFG_EBMEN | USB_MCFG_EMEMEN) +#endif /* Au1200 */ + extern int usb_disabled(void); /*-------------------------------------------------------------------------*/ @@ -105,9 +107,9 @@ int usb_ehci_au1xxx_probe(const struct hc_driver *driver, /* Au1200 AB USB does not support coherent memory */ if (!(read_c0_prid() & 0xff)) { - pr_info("%s: this is chip revision AB!\n", dev->name); + pr_info("%s: this is chip revision AB!\n", dev->dev.name); pr_info("%s: update your board or re-configure the kernel\n", - dev->name); + dev->dev.name); return -ENODEV; } #endif @@ -226,8 +228,9 @@ static const struct hc_driver ehci_au1xxx_hc_driver = { /*-------------------------------------------------------------------------*/ -static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) +static int ehci_hcd_au1xxx_drv_probe(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct usb_hcd *hcd = NULL; int ret; @@ -240,9 +243,10 @@ static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) return ret; } -static int ehci_hcd_au1xxx_drv_remove(struct platform_device *pdev) +static int ehci_hcd_au1xxx_drv_remove(struct device *dev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct platform_device *pdev = to_platform_device(dev); + struct usb_hcd *hcd = dev_get_drvdata(dev); usb_ehci_au1xxx_remove(hcd, pdev); return 0; @@ -265,13 +269,12 @@ static int ehci_hcd_au1xxx_drv_resume(struct device *dev) } */ MODULE_ALIAS("au1xxx-ehci"); -static struct platform_driver ehci_hcd_au1xxx_driver = { +/* FIXME use "struct platform_driver" */ +static struct device_driver ehci_hcd_au1xxx_driver = { + .name = "au1xxx-ehci", + .bus = &platform_bus_type, .probe = ehci_hcd_au1xxx_drv_probe, .remove = ehci_hcd_au1xxx_drv_remove, /*.suspend = ehci_hcd_au1xxx_drv_suspend, */ /*.resume = ehci_hcd_au1xxx_drv_resume, */ - .driver = { - .name = "au1xxx-ehci", - .bus = &platform_bus_type - } }; diff --git a/trunk/drivers/usb/host/ehci-hcd.c b/trunk/drivers/usb/host/ehci-hcd.c index 85b0b4ad4c16..cee6f538de0a 100644 --- a/trunk/drivers/usb/host/ehci-hcd.c +++ b/trunk/drivers/usb/host/ehci-hcd.c @@ -625,11 +625,10 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs) writel (status | CMD_RUN, &ehci->regs->command); while (i--) { - int pstatus = readl (&ehci->regs->port_status [i]); - - if (pstatus & PORT_OWNER) + status = readl (&ehci->regs->port_status [i]); + if (status & PORT_OWNER) continue; - if (!(pstatus & PORT_RESUME) + if (!(status & PORT_RESUME) || ehci->reset_done [i] != 0) continue; diff --git a/trunk/drivers/usb/host/ohci-au1xxx.c b/trunk/drivers/usb/host/ohci-au1xxx.c index 822914e2f43b..689261e44018 100644 --- a/trunk/drivers/usb/host/ohci-au1xxx.c +++ b/trunk/drivers/usb/host/ohci-au1xxx.c @@ -101,16 +101,13 @@ static void au1xxx_start_ohc(struct platform_device *dev) #endif /* Au1200 */ -#ifndef CONFIG_SOC_AU1200 /* wait for reset complete (read register twice; see au1500 errata) */ while (au_readl(USB_HOST_CONFIG), !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD)) -#endif udelay(1000); printk(KERN_DEBUG __FILE__ ": Clock to USB host has been enabled \n"); -#endif } static void au1xxx_stop_ohc(struct platform_device *dev) @@ -160,9 +157,9 @@ static int usb_ohci_au1xxx_probe(const struct hc_driver *driver, /* Au1200 AB USB does not support coherent memory */ if (!(read_c0_prid() & 0xff)) { pr_info("%s: this is chip revision AB !!\n", - dev->name); + dev->dev.name); pr_info("%s: update your board or re-configure the kernel\n", - dev->name); + dev->dev.name); return -ENODEV; } #endif diff --git a/trunk/drivers/usb/host/ohci-ep93xx.c b/trunk/drivers/usb/host/ohci-ep93xx.c deleted file mode 100644 index 6531c4d26527..000000000000 --- a/trunk/drivers/usb/host/ohci-ep93xx.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * OHCI HCD (Host Controller Driver) for USB. - * - * (C) Copyright 1999 Roman Weissgaerber - * (C) Copyright 2000-2002 David Brownell - * (C) Copyright 2002 Hewlett-Packard Company - * - * Bus Glue for ep93xx. - * - * Written by Christopher Hoover - * Based on fragments of previous driver by Russell King et al. - * - * Modified for LH7A404 from ohci-sa1111.c - * by Durgesh Pattamatta - * - * Modified for pxa27x from ohci-lh7a404.c - * by Nick Bane 26-8-2004 - * - * Modified for ep93xx from ohci-pxa27x.c - * by Lennert Buytenhek 28-2-2006 - * Based on an earlier driver by Ray Lehtiniemi - * - * This file is licenced under the GPL. - */ - -#include -#include -#include -#include - -#include -#include - -static struct clk *usb_host_clock; - -static void ep93xx_start_hc(struct device *dev) -{ - clk_enable(usb_host_clock); -} - -static void ep93xx_stop_hc(struct device *dev) -{ - clk_disable(usb_host_clock); -} - -static int usb_hcd_ep93xx_probe(const struct hc_driver *driver, - struct platform_device *pdev) -{ - int retval; - struct usb_hcd *hcd; - - if (pdev->resource[1].flags != IORESOURCE_IRQ) { - pr_debug("resource[1] is not IORESOURCE_IRQ"); - return -ENOMEM; - } - - hcd = usb_create_hcd(driver, &pdev->dev, "ep93xx"); - if (hcd == NULL) - return -ENOMEM; - - hcd->rsrc_start = pdev->resource[0].start; - hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; - if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { - usb_put_hcd(hcd); - retval = -EBUSY; - goto err1; - } - - hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); - if (hcd->regs == NULL) { - pr_debug("ioremap failed"); - retval = -ENOMEM; - goto err2; - } - - usb_host_clock = clk_get(&pdev->dev, "usb_host"); - ep93xx_start_hc(&pdev->dev); - - ohci_hcd_init(hcd_to_ohci(hcd)); - - retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT); - if (retval == 0) - return retval; - - ep93xx_stop_hc(&pdev->dev); - iounmap(hcd->regs); -err2: - release_mem_region(hcd->rsrc_start, hcd->rsrc_len); -err1: - usb_put_hcd(hcd); - - return retval; -} - -static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd, - struct platform_device *pdev) -{ - usb_remove_hcd(hcd); - ep93xx_stop_hc(&pdev->dev); - clk_put(usb_host_clock); - iounmap(hcd->regs); - release_mem_region(hcd->rsrc_start, hcd->rsrc_len); - usb_put_hcd(hcd); -} - -static int __devinit ohci_ep93xx_start(struct usb_hcd *hcd) -{ - struct ohci_hcd *ohci = hcd_to_ohci(hcd); - int ret; - - if ((ret = ohci_init(ohci)) < 0) - return ret; - - if ((ret = ohci_run(ohci)) < 0) { - err("can't start %s", hcd->self.bus_name); - ohci_stop(hcd); - return ret; - } - - return 0; -} - -static struct hc_driver ohci_ep93xx_hc_driver = { - .description = hcd_name, - .product_desc = "EP93xx OHCI", - .hcd_priv_size = sizeof(struct ohci_hcd), - .irq = ohci_irq, - .flags = HCD_USB11 | HCD_MEMORY, - .start = ohci_ep93xx_start, - .stop = ohci_stop, - .urb_enqueue = ohci_urb_enqueue, - .urb_dequeue = ohci_urb_dequeue, - .endpoint_disable = ohci_endpoint_disable, - .get_frame_number = ohci_get_frame, - .hub_status_data = ohci_hub_status_data, - .hub_control = ohci_hub_control, -#ifdef CONFIG_PM - .bus_suspend = ohci_bus_suspend, - .bus_resume = ohci_bus_resume, -#endif - .start_port_reset = ohci_start_port_reset, -}; - -extern int usb_disabled(void); - -static int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev) -{ - int ret; - - ret = -ENODEV; - if (!usb_disabled()) - ret = usb_hcd_ep93xx_probe(&ohci_ep93xx_hc_driver, pdev); - - return ret; -} - -static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev) -{ - struct usb_hcd *hcd = platform_get_drvdata(pdev); - - usb_hcd_ep93xx_remove(hcd, pdev); - - return 0; -} - -#ifdef CONFIG_PM -static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state) -{ - struct usb_hcd *hcd = platform_get_drvdata(pdev); - struct ochi_hcd *ohci = hcd_to_ohci(hcd); - - if (time_before(jiffies, ohci->next_statechange)) - msleep(5); - ohci->next_statechange = jiffies; - - ep93xx_stop_hc(&pdev->dev); - hcd->state = HC_STATE_SUSPENDED; - pdev->dev.power.power_state = PMSG_SUSPEND; - - return 0; -} - -static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev) -{ - struct usb_hcd *hcd = platform_get_drvdata(pdev); - struct ohci_hcd *ohci = hcd_to_ohci(hcd); - int status; - - if (time_before(jiffies, ohci->next_statechange)) - msleep(5); - ohci->next_statechange = jiffies; - - ep93xx_start_hc(&pdev->dev); - pdev->dev.power.power_state = PMSG_ON; - usb_hcd_resume_root_hub(hcd); - - return 0; -} -#endif - - -static struct platform_driver ohci_hcd_ep93xx_driver = { - .probe = ohci_hcd_ep93xx_drv_probe, - .remove = ohci_hcd_ep93xx_drv_remove, -#ifdef CONFIG_PM - .suspend = ohci_hcd_ep93xx_drv_suspend, - .resume = ohci_hcd_ep93xx_drv_resume, -#endif - .driver = { - .name = "ep93xx-ohci", - }, -}; - -static int __init ohci_hcd_ep93xx_init(void) -{ - return platform_driver_register(&ohci_hcd_ep93xx_driver); -} - -static void __exit ohci_hcd_ep93xx_cleanup(void) -{ - platform_driver_unregister(&ohci_hcd_ep93xx_driver); -} - -module_init(ohci_hcd_ep93xx_init); -module_exit(ohci_hcd_ep93xx_cleanup); diff --git a/trunk/drivers/usb/host/ohci-hcd.c b/trunk/drivers/usb/host/ohci-hcd.c index afef5ac35b4a..8fb842ed5f6e 100644 --- a/trunk/drivers/usb/host/ohci-hcd.c +++ b/trunk/drivers/usb/host/ohci-hcd.c @@ -901,10 +901,6 @@ MODULE_LICENSE ("GPL"); #include "ohci-pxa27x.c" #endif -#ifdef CONFIG_ARCH_EP93XX -#include "ohci-ep93xx.c" -#endif - #ifdef CONFIG_SOC_AU1X00 #include "ohci-au1xxx.c" #endif @@ -923,7 +919,6 @@ MODULE_LICENSE ("GPL"); || defined(CONFIG_ARCH_OMAP) \ || defined (CONFIG_ARCH_LH7A404) \ || defined (CONFIG_PXA27x) \ - || defined (CONFIG_ARCH_EP93XX) \ || defined (CONFIG_SOC_AU1X00) \ || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ || defined (CONFIG_ARCH_AT91RM9200) \ diff --git a/trunk/drivers/usb/host/ohci-hub.c b/trunk/drivers/usb/host/ohci-hub.c index 5b0a23fd798b..0bb972b58336 100644 --- a/trunk/drivers/usb/host/ohci-hub.c +++ b/trunk/drivers/usb/host/ohci-hub.c @@ -581,14 +581,14 @@ static int ohci_hub_control ( break; case GetHubStatus: temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE); - put_unaligned(cpu_to_le32 (temp), (__le32 *) buf); + *(__le32 *) buf = cpu_to_le32 (temp); break; case GetPortStatus: if (!wIndex || wIndex > ports) goto error; wIndex--; temp = roothub_portstatus (ohci, wIndex); - put_unaligned(cpu_to_le32 (temp), (__le32 *) buf); + *(__le32 *) buf = cpu_to_le32 (temp); #ifndef OHCI_VERBOSE_DEBUG if (*(u16*)(buf+2)) /* only if wPortChange is interesting */ diff --git a/trunk/drivers/usb/host/pci-quirks.c b/trunk/drivers/usb/host/pci-quirks.c index 20861650905e..dff60568b4a1 100644 --- a/trunk/drivers/usb/host/pci-quirks.c +++ b/trunk/drivers/usb/host/pci-quirks.c @@ -167,6 +167,8 @@ static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx) static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) { void __iomem *base; + int wait_time; + u32 control; if (!mmio_resource_enabled(pdev, 0)) return; @@ -177,10 +179,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ #ifndef __hppa__ -{ - u32 control = readl(base + OHCI_CONTROL); + control = readl(base + OHCI_CONTROL); if (control & OHCI_CTRL_IR) { - int wait_time = 500; /* arbitrary; 5 seconds */ + wait_time = 500; /* arbitrary; 5 seconds */ writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); writel(OHCI_OCR, base + OHCI_CMDSTATUS); while (wait_time > 0 && @@ -197,7 +198,6 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) /* reset controller, preserving RWC */ writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); } -} #endif /* diff --git a/trunk/drivers/usb/input/hid-core.c b/trunk/drivers/usb/input/hid-core.c index 8ea9c915fbf9..b9fb9687f926 100644 --- a/trunk/drivers/usb/input/hid-core.c +++ b/trunk/drivers/usb/input/hid-core.c @@ -1507,9 +1507,6 @@ void hid_init_reports(struct hid_device *hid) #define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104 #define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 -#define USB_VENDOR_ID_WISEGROUP_LTD 0x6677 -#define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802 - #define USB_VENDOR_ID_CODEMERCS 0x07c0 #define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500 #define USB_DEVICE_ID_CODEMERCS_IOW24 0x1501 @@ -1673,7 +1670,6 @@ static const struct hid_blacklist { { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, - { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, diff --git a/trunk/drivers/usb/misc/Kconfig b/trunk/drivers/usb/misc/Kconfig index 88928a4be805..daa486dde8cf 100644 --- a/trunk/drivers/usb/misc/Kconfig +++ b/trunk/drivers/usb/misc/Kconfig @@ -88,19 +88,19 @@ config USB_LED To compile this driver as a module, choose M here: the module will be called usbled. -config USB_CYPRESS_CY7C63 +config USB_CY7C63 tristate "Cypress CY7C63xxx USB driver support" depends on USB help Say Y here if you want to connect a Cypress CY7C63xxx - micro controller to your computer's USB port. Currently this - driver supports the pre-programmed devices (incl. firmware) - by AK Modul-Bus Computer GmbH. + micro controller to your computer's USB port. This driver + supports the pre-programmed devices (incl. firmware) by + AK Modul-Bus Computer GmbH. Please see: http://www.ak-modul-bus.de/stat/mikrocontroller.html To compile this driver as a module, choose M here: the - module will be called cypress_cy7c63. + module will be called cy7c63. config USB_CYTHERM tristate "Cypress USB thermometer driver support" diff --git a/trunk/drivers/usb/misc/Makefile b/trunk/drivers/usb/misc/Makefile index 2927260c5812..f25a97227297 100644 --- a/trunk/drivers/usb/misc/Makefile +++ b/trunk/drivers/usb/misc/Makefile @@ -4,7 +4,7 @@ # obj-$(CONFIG_USB_AUERSWALD) += auerswald.o -obj-$(CONFIG_USB_CYPRESS_CY7C63)+= cypress_cy7c63.o +obj-$(CONFIG_USB_CY7C63) += cy7c63.o obj-$(CONFIG_USB_CYTHERM) += cytherm.o obj-$(CONFIG_USB_EMI26) += emi26.o obj-$(CONFIG_USB_EMI62) += emi62.o diff --git a/trunk/drivers/usb/misc/cy7c63.c b/trunk/drivers/usb/misc/cy7c63.c new file mode 100644 index 000000000000..8a1c10b89b76 --- /dev/null +++ b/trunk/drivers/usb/misc/cy7c63.c @@ -0,0 +1,244 @@ +/* +* cy7c63.c +* +* Copyright (c) 2006 Oliver Bock (bock@fh-wolfenbuettel.de) +* +* This driver is based on the Cypress Thermometer USB Driver by +* Marcus Maul and the 2.0 version of Greg Kroah-Hartman's +* USB Skeleton driver. +* +* Is is a generic driver for the Cypress CY7C63000 family. +* For the time being it enables you to toggle 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...) +* +* Chipsets families: CY7C63000, CY7C63001, CY7C63100, CY7C63101 +* +* +* 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, version 2. +*/ + +#include +#include +#include +#include + +#define DRIVER_AUTHOR "Oliver Bock (bock@fh-wolfenbuettel.de)" +#define DRIVER_DESC "Cypress CY7C63xxx USB driver" + +#define CY7C63_VENDOR_ID 0xa2c +#define CY7C63_PRODUCT_ID 0x8 + +#define CY7C63_READ_PORT 0x4 +#define CY7C63_WRITE_PORT 0x5 +#define CY7C63_READ_RAM 0x2 +#define CY7C63_WRITE_RAM 0x3 +#define CY7C63_READ_ROM 0x1 + +#define CY7C63_READ_PORT_ID0 0 +#define CY7C63_WRITE_PORT_ID0 0 +#define CY7C63_READ_PORT_ID1 0x2 +#define CY7C63_WRITE_PORT_ID1 1 + +#define CY7C63_MAX_REQSIZE 8 + + +/* table of devices that work with this driver */ +static struct usb_device_id cy7c63_table [] = { + { USB_DEVICE(CY7C63_VENDOR_ID, CY7C63_PRODUCT_ID) }, + { } +}; +MODULE_DEVICE_TABLE(usb, cy7c63_table); + +/* structure to hold all of our device specific stuff */ +struct cy7c63 { + struct usb_device * udev; + char port0; + char port1; +}; + +/* used to send usb control messages to device */ +int vendor_command(struct cy7c63 *dev, unsigned char request, + unsigned char address, unsigned char data) { + + int retval = 0; + unsigned int pipe; + unsigned char *iobuf; + + /* allocate some memory for the i/o buffer*/ + iobuf = kzalloc(CY7C63_MAX_REQSIZE, GFP_KERNEL); + if (!iobuf) { + dev_err(&dev->udev->dev, "Out of memory!\n"); + retval = -ENOMEM; + goto error; + } + + dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data); + + /* prepare usb control message and send it upstream */ + pipe = usb_rcvctrlpipe(dev->udev, 0); + retval = usb_control_msg(dev->udev, pipe, request, + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER, + address, data, iobuf, CY7C63_MAX_REQSIZE, + USB_CTRL_GET_TIMEOUT); + + /* store returned data (more READs to be added!) */ + switch (request) { + case CY7C63_READ_PORT: + if (address == CY7C63_READ_PORT_ID0) { + dev->port0 = iobuf[1]; + dev_dbg(&dev->udev->dev, + "READ_PORT0 returned: %d\n",dev->port0); + } + else if (address == CY7C63_READ_PORT_ID1) { + dev->port1 = iobuf[1]; + dev_dbg(&dev->udev->dev, + "READ_PORT1 returned: %d\n",dev->port1); + } + break; + } + + kfree(iobuf); +error: + return retval; +} + +#define get_set_port(num,read_id,write_id) \ +static ssize_t set_port##num(struct device *dev, struct device_attribute *attr, \ + const char *buf, size_t count) { \ + \ + int value; \ + int result = 0; \ + \ + struct usb_interface *intf = to_usb_interface(dev); \ + struct cy7c63 *cyp = usb_get_intfdata(intf); \ + \ + dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", num); \ + \ + /* validate input data */ \ + if (sscanf(buf, "%d", &value) < 1) { \ + result = -EINVAL; \ + goto error; \ + } \ + if (value>255 || value<0) { \ + result = -EINVAL; \ + goto error; \ + } \ + \ + result = vendor_command(cyp, CY7C63_WRITE_PORT, write_id, \ + (unsigned char)value); \ + \ + dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n",result); \ +error: \ + return result < 0 ? result : count; \ +} \ + \ +static ssize_t get_port##num(struct device *dev, \ + struct device_attribute *attr, char *buf) { \ + \ + int result = 0; \ + \ + struct usb_interface *intf = to_usb_interface(dev); \ + struct cy7c63 *cyp = usb_get_intfdata(intf); \ + \ + dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", num); \ + \ + result = vendor_command(cyp, CY7C63_READ_PORT, read_id, 0); \ + \ + dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result); \ + \ + return sprintf(buf, "%d", cyp->port##num); \ +} \ +static DEVICE_ATTR(port##num, S_IWUGO | S_IRUGO, get_port##num, set_port##num); + +get_set_port(0, CY7C63_READ_PORT_ID0, CY7C63_WRITE_PORT_ID0); +get_set_port(1, CY7C63_READ_PORT_ID1, CY7C63_WRITE_PORT_ID1); + +static int cy7c63_probe(struct usb_interface *interface, + const struct usb_device_id *id) { + + struct cy7c63 *dev = NULL; + int retval = -ENOMEM; + + /* allocate memory for our device state and initialize it */ + dev = kzalloc(sizeof(*dev), GFP_KERNEL); + if (dev == NULL) { + dev_err(&dev->udev->dev, "Out of memory!\n"); + goto error; + } + + dev->udev = usb_get_dev(interface_to_usbdev(interface)); + + /* save our data pointer in this interface device */ + usb_set_intfdata(interface, dev); + + /* create device attribute files */ + device_create_file(&interface->dev, &dev_attr_port0); + device_create_file(&interface->dev, &dev_attr_port1); + + /* let the user know what node this device is now attached to */ + dev_info(&interface->dev, + "Cypress CY7C63xxx device now attached\n"); + + retval = 0; +error: + return retval; +} + +static void cy7c63_disconnect(struct usb_interface *interface) { + + struct cy7c63 *dev; + + dev = usb_get_intfdata(interface); + usb_set_intfdata(interface, NULL); + + /* remove device attribute files */ + device_remove_file(&interface->dev, &dev_attr_port0); + device_remove_file(&interface->dev, &dev_attr_port1); + + usb_put_dev(dev->udev); + + dev_info(&interface->dev, + "Cypress CY7C63xxx device now disconnected\n"); + + kfree(dev); +} + +static struct usb_driver cy7c63_driver = { + .name = "cy7c63", + .probe = cy7c63_probe, + .disconnect = cy7c63_disconnect, + .id_table = cy7c63_table, +}; + +static int __init cy7c63_init(void) { + + int result; + + /* register this driver with the USB subsystem */ + result = usb_register(&cy7c63_driver); + if (result) { + err("Function usb_register failed! Error number: %d\n", result); + } + + return result; +} + +static void __exit cy7c63_exit(void) { + + /* deregister this driver with the USB subsystem */ + usb_deregister(&cy7c63_driver); +} + +module_init(cy7c63_init); +module_exit(cy7c63_exit); + +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); + +MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/usb/misc/cypress_cy7c63.c b/trunk/drivers/usb/misc/cypress_cy7c63.c deleted file mode 100644 index e091d327bd9e..000000000000 --- a/trunk/drivers/usb/misc/cypress_cy7c63.c +++ /dev/null @@ -1,279 +0,0 @@ -/* -* cypress_cy7c63.c -* -* Copyright (c) 2006 Oliver Bock (o.bock@fh-wolfenbuettel.de) -* -* This driver is based on the Cypress USB Driver by Marcus Maul -* (cyport) and the 2.0 version of Greg Kroah-Hartman's -* USB Skeleton driver. -* -* This is a generic driver for the Cypress CY7C63xxx family. -* For the time being it enables you to read from and write to -* 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...) -* -* -* 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, version 2. -*/ - -#include -#include -#include -#include - -#define DRIVER_AUTHOR "Oliver Bock (o.bock@fh-wolfenbuettel.de)" -#define DRIVER_DESC "Cypress CY7C63xxx USB driver" - -#define CYPRESS_VENDOR_ID 0xa2c -#define CYPRESS_PRODUCT_ID 0x8 - -#define CYPRESS_READ_PORT 0x4 -#define CYPRESS_WRITE_PORT 0x5 - -#define CYPRESS_READ_RAM 0x2 -#define CYPRESS_WRITE_RAM 0x3 -#define CYPRESS_READ_ROM 0x1 - -#define CYPRESS_READ_PORT_ID0 0 -#define CYPRESS_WRITE_PORT_ID0 0 -#define CYPRESS_READ_PORT_ID1 0x2 -#define CYPRESS_WRITE_PORT_ID1 1 - -#define CYPRESS_MAX_REQSIZE 8 - - -/* table of devices that work with this driver */ -static struct usb_device_id cypress_table [] = { - { USB_DEVICE(CYPRESS_VENDOR_ID, CYPRESS_PRODUCT_ID) }, - { } -}; -MODULE_DEVICE_TABLE(usb, cypress_table); - -/* structure to hold all of our device specific stuff */ -struct cypress { - struct usb_device * udev; - unsigned char port[2]; -}; - -/* used to send usb control messages to device */ -static int vendor_command(struct cypress *dev, unsigned char request, - unsigned char address, unsigned char data) -{ - int retval = 0; - unsigned int pipe; - unsigned char *iobuf; - - /* allocate some memory for the i/o buffer*/ - iobuf = kzalloc(CYPRESS_MAX_REQSIZE, GFP_KERNEL); - if (!iobuf) { - dev_err(&dev->udev->dev, "Out of memory!\n"); - retval = -ENOMEM; - goto error; - } - - dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data); - - /* prepare usb control message and send it upstream */ - pipe = usb_rcvctrlpipe(dev->udev, 0); - retval = usb_control_msg(dev->udev, pipe, request, - USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER, - address, data, iobuf, CYPRESS_MAX_REQSIZE, - USB_CTRL_GET_TIMEOUT); - - /* store returned data (more READs to be added) */ - switch (request) { - case CYPRESS_READ_PORT: - if (address == CYPRESS_READ_PORT_ID0) { - dev->port[0] = iobuf[1]; - dev_dbg(&dev->udev->dev, - "READ_PORT0 returned: %d\n", - dev->port[0]); - } - else if (address == CYPRESS_READ_PORT_ID1) { - dev->port[1] = iobuf[1]; - dev_dbg(&dev->udev->dev, - "READ_PORT1 returned: %d\n", - dev->port[1]); - } - break; - } - - kfree(iobuf); -error: - return retval; -} - -/* write port value */ -static ssize_t write_port(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count, - int port_num, int write_id) -{ - int value = -1; - int result = 0; - - struct usb_interface *intf = to_usb_interface(dev); - struct cypress *cyp = usb_get_intfdata(intf); - - dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", port_num); - - /* validate input data */ - if (sscanf(buf, "%d", &value) < 1) { - result = -EINVAL; - goto error; - } - if (value < 0 || value > 255) { - result = -EINVAL; - goto error; - } - - result = vendor_command(cyp, CYPRESS_WRITE_PORT, write_id, - (unsigned char)value); - - dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result); -error: - return result < 0 ? result : count; -} - -/* attribute callback handler (write) */ -static ssize_t set_port0_handler(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return write_port(dev, attr, buf, count, 0, CYPRESS_WRITE_PORT_ID0); -} - -/* attribute callback handler (write) */ -static ssize_t set_port1_handler(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - return write_port(dev, attr, buf, count, 1, CYPRESS_WRITE_PORT_ID1); -} - -/* read port value */ -static ssize_t read_port(struct device *dev, struct device_attribute *attr, - char *buf, int port_num, int read_id) -{ - int result = 0; - - struct usb_interface *intf = to_usb_interface(dev); - struct cypress *cyp = usb_get_intfdata(intf); - - dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", port_num); - - result = vendor_command(cyp, CYPRESS_READ_PORT, read_id, 0); - - dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result); - - return sprintf(buf, "%d", cyp->port[port_num]); -} - -/* attribute callback handler (read) */ -static ssize_t get_port0_handler(struct device *dev, - struct device_attribute *attr, char *buf) -{ - return read_port(dev, attr, buf, 0, CYPRESS_READ_PORT_ID0); -} - -/* attribute callback handler (read) */ -static ssize_t get_port1_handler(struct device *dev, - struct device_attribute *attr, char *buf) -{ - return read_port(dev, attr, buf, 1, CYPRESS_READ_PORT_ID1); -} - -static DEVICE_ATTR(port0, S_IWUGO | S_IRUGO, - get_port0_handler, set_port0_handler); - -static DEVICE_ATTR(port1, S_IWUGO | S_IRUGO, - get_port1_handler, set_port1_handler); - - -static int cypress_probe(struct usb_interface *interface, - const struct usb_device_id *id) -{ - struct cypress *dev = NULL; - int retval = -ENOMEM; - - /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (dev == NULL) { - dev_err(&dev->udev->dev, "Out of memory!\n"); - goto error; - } - - dev->udev = usb_get_dev(interface_to_usbdev(interface)); - - /* save our data pointer in this interface device */ - usb_set_intfdata(interface, dev); - - /* create device attribute files */ - device_create_file(&interface->dev, &dev_attr_port0); - device_create_file(&interface->dev, &dev_attr_port1); - - /* let the user know that the device is now attached */ - dev_info(&interface->dev, - "Cypress CY7C63xxx device now attached\n"); - - retval = 0; -error: - return retval; -} - -static void cypress_disconnect(struct usb_interface *interface) -{ - struct cypress *dev; - - dev = usb_get_intfdata(interface); - usb_set_intfdata(interface, NULL); - - /* remove device attribute files */ - device_remove_file(&interface->dev, &dev_attr_port0); - device_remove_file(&interface->dev, &dev_attr_port1); - - usb_put_dev(dev->udev); - - dev_info(&interface->dev, - "Cypress CY7C63xxx device now disconnected\n"); - - kfree(dev); -} - -static struct usb_driver cypress_driver = { - .name = "cypress_cy7c63", - .probe = cypress_probe, - .disconnect = cypress_disconnect, - .id_table = cypress_table, -}; - -static int __init cypress_init(void) -{ - int result; - - /* register this driver with the USB subsystem */ - result = usb_register(&cypress_driver); - if (result) { - err("Function usb_register failed! Error number: %d\n", result); - } - - return result; -} - -static void __exit cypress_exit(void) -{ - /* deregister this driver with the USB subsystem */ - usb_deregister(&cypress_driver); -} - -module_init(cypress_init); -module_exit(cypress_exit); - -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); - -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/usb/misc/usblcd.c b/trunk/drivers/usb/misc/usblcd.c index e095772dd8e9..c82c402285a0 100644 --- a/trunk/drivers/usb/misc/usblcd.c +++ b/trunk/drivers/usb/misc/usblcd.c @@ -200,8 +200,10 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz /* create a urb, and a buffer for it, and copy the data to the urb */ urb = usb_alloc_urb(0, GFP_KERNEL); - if (!urb) - return -ENOMEM; + if (!urb) { + retval = -ENOMEM; + goto error; + } buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); if (!buf) { diff --git a/trunk/drivers/usb/mon/mon_text.c b/trunk/drivers/usb/mon/mon_text.c index f961a770cee2..e02c1a30c4cd 100644 --- a/trunk/drivers/usb/mon/mon_text.c +++ b/trunk/drivers/usb/mon/mon_text.c @@ -64,6 +64,7 @@ struct mon_reader_text { }; static void mon_text_ctor(void *, kmem_cache_t *, unsigned long); +static void mon_text_dtor(void *, kmem_cache_t *, unsigned long); /* * mon_text_submit @@ -267,7 +268,7 @@ static int mon_text_open(struct inode *inode, struct file *file) (long)rp); rp->e_slab = kmem_cache_create(rp->slab_name, sizeof(struct mon_event_text), sizeof(long), 0, - mon_text_ctor, NULL); + mon_text_ctor, mon_text_dtor); if (rp->e_slab == NULL) { rc = -ENOMEM; goto err_slab; @@ -458,3 +459,7 @@ static void mon_text_ctor(void *mem, kmem_cache_t *slab, unsigned long sflags) memset(mem, 0xe5, sizeof(struct mon_event_text)); } +static void mon_text_dtor(void *mem, kmem_cache_t *slab, unsigned long sflags) +{ + ; +} diff --git a/trunk/drivers/usb/net/rtl8150.c b/trunk/drivers/usb/net/rtl8150.c index e5e6e4f3ef87..718f8e2b552b 100644 --- a/trunk/drivers/usb/net/rtl8150.c +++ b/trunk/drivers/usb/net/rtl8150.c @@ -128,13 +128,11 @@ #define VENDOR_ID_MELCO 0x0411 #define VENDOR_ID_MICRONET 0x3980 #define VENDOR_ID_LONGSHINE 0x07b8 -#define VENDOR_ID_ZYXEL 0x0586 #define PRODUCT_ID_RTL8150 0x8150 #define PRODUCT_ID_LUAKTX 0x0012 #define PRODUCT_ID_LCS8138TX 0x401a #define PRODUCT_ID_SP128AR 0x0003 -#define PRODUCT_ID_PRESTIGE 0x401a #undef EEPROM_WRITE @@ -144,7 +142,6 @@ static struct usb_device_id rtl8150_table[] = { {USB_DEVICE(VENDOR_ID_MELCO, PRODUCT_ID_LUAKTX)}, {USB_DEVICE(VENDOR_ID_MICRONET, PRODUCT_ID_SP128AR)}, {USB_DEVICE(VENDOR_ID_LONGSHINE, PRODUCT_ID_LCS8138TX)}, - {USB_DEVICE(VENDOR_ID_ZYXEL, PRODUCT_ID_PRESTIGE)}, {} }; diff --git a/trunk/drivers/usb/serial/Kconfig b/trunk/drivers/usb/serial/Kconfig index ac33bd47cfce..8bd44fda5eaf 100644 --- a/trunk/drivers/usb/serial/Kconfig +++ b/trunk/drivers/usb/serial/Kconfig @@ -456,17 +456,6 @@ config USB_SERIAL_SAFE_PADDED bool "USB Secure Encapsulated Driver - Padded" depends on USB_SERIAL_SAFE -config USB_SERIAL_SIERRAWIRELESS - tristate "USB Sierra Wireless Driver" - depends on USB_SERIAL - help - Say M here if you want to use a Sierra Wireless device (if - using an PC 5220 or AC580 please use the Airprime driver - instead). - - To compile this driver as a module, choose M here: the - module will be called sierra. - config USB_SERIAL_TI tristate "USB TI 3410/5052 Serial Driver" depends on USB_SERIAL diff --git a/trunk/drivers/usb/serial/Makefile b/trunk/drivers/usb/serial/Makefile index 35d4acc7f1d3..5a0960fc9d3e 100644 --- a/trunk/drivers/usb/serial/Makefile +++ b/trunk/drivers/usb/serial/Makefile @@ -39,7 +39,6 @@ obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o obj-$(CONFIG_USB_SERIAL_OPTION) += option.o obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o -obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS) += sierra.o obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o obj-$(CONFIG_USB_SERIAL_VISOR) += visor.o obj-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat.o diff --git a/trunk/drivers/usb/serial/airprime.c b/trunk/drivers/usb/serial/airprime.c index 62082532a8b3..94b9ba0ff875 100644 --- a/trunk/drivers/usb/serial/airprime.c +++ b/trunk/drivers/usb/serial/airprime.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include "usb-serial.h" static struct usb_device_id id_table [] = { { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ diff --git a/trunk/drivers/usb/serial/anydata.c b/trunk/drivers/usb/serial/anydata.c index 01843ef8c11e..343f6f228220 100644 --- a/trunk/drivers/usb/serial/anydata.c +++ b/trunk/drivers/usb/serial/anydata.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include "usb-serial.h" static struct usb_device_id id_table [] = { { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */ @@ -71,7 +71,7 @@ static int anydata_open(struct usb_serial_port *port, struct file *filp) port->bulk_in_endpointAddress), port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - usb_serial_generic_read_bulk_callback, port); + usb_serial_generic_write_bulk_callback, port); result = usb_submit_urb(port->read_urb, GFP_KERNEL); if (result) dev_err(&port->dev, diff --git a/trunk/drivers/usb/serial/ark3116.c b/trunk/drivers/usb/serial/ark3116.c index 970d9ef0a7a5..8dec796222a0 100644 --- a/trunk/drivers/usb/serial/ark3116.c +++ b/trunk/drivers/usb/serial/ark3116.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include "usb-serial.h" static int debug; diff --git a/trunk/drivers/usb/serial/belkin_sa.c b/trunk/drivers/usb/serial/belkin_sa.c index 70ece9e01ce4..3faa7aa0111a 100644 --- a/trunk/drivers/usb/serial/belkin_sa.c +++ b/trunk/drivers/usb/serial/belkin_sa.c @@ -74,7 +74,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "belkin_sa.h" static int debug; diff --git a/trunk/drivers/usb/serial/bus.c b/trunk/drivers/usb/serial/bus.c index 6542f220468f..f2d993b70c18 100644 --- a/trunk/drivers/usb/serial/bus.c +++ b/trunk/drivers/usb/serial/bus.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include "usb-serial.h" static int usb_serial_device_match (struct device *dev, struct device_driver *drv) { diff --git a/trunk/drivers/usb/serial/console.c b/trunk/drivers/usb/serial/console.c index 3a9073dbfe6a..3d456b32c316 100644 --- a/trunk/drivers/usb/serial/console.c +++ b/trunk/drivers/usb/serial/console.c @@ -17,10 +17,11 @@ #include #include #include -#include static int debug; +#include "usb-serial.h" + struct usbcons_info { int magic; int break_flag; diff --git a/trunk/drivers/usb/serial/cp2101.c b/trunk/drivers/usb/serial/cp2101.c index 486c7411b9a7..df0a4f98b4ae 100644 --- a/trunk/drivers/usb/serial/cp2101.c +++ b/trunk/drivers/usb/serial/cp2101.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include "usb-serial.h" /* * Version Information diff --git a/trunk/drivers/usb/serial/cyberjack.c b/trunk/drivers/usb/serial/cyberjack.c index 6286aba86fae..49b51ab0d4cb 100644 --- a/trunk/drivers/usb/serial/cyberjack.c +++ b/trunk/drivers/usb/serial/cyberjack.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include "usb-serial.h" #define CYBERJACK_LOCAL_BUF_SIZE 32 diff --git a/trunk/drivers/usb/serial/cypress_m8.c b/trunk/drivers/usb/serial/cypress_m8.c index ee70fddcab60..4ff2dfb299bd 100644 --- a/trunk/drivers/usb/serial/cypress_m8.c +++ b/trunk/drivers/usb/serial/cypress_m8.c @@ -59,11 +59,11 @@ #include #include #include -#include #include #include #include +#include "usb-serial.h" #include "cypress_m8.h" diff --git a/trunk/drivers/usb/serial/digi_acceleport.c b/trunk/drivers/usb/serial/digi_acceleport.c index 9b225183fc7a..6953d3ef5738 100644 --- a/trunk/drivers/usb/serial/digi_acceleport.c +++ b/trunk/drivers/usb/serial/digi_acceleport.c @@ -246,7 +246,7 @@ #include #include #include -#include +#include "usb-serial.h" /* Defines */ diff --git a/trunk/drivers/usb/serial/empeg.c b/trunk/drivers/usb/serial/empeg.c index daafe405d86d..1e2b31eeb497 100644 --- a/trunk/drivers/usb/serial/empeg.c +++ b/trunk/drivers/usb/serial/empeg.c @@ -62,7 +62,7 @@ #include #include #include -#include +#include "usb-serial.h" static int debug; diff --git a/trunk/drivers/usb/serial/ezusb.c b/trunk/drivers/usb/serial/ezusb.c index 5169c2d154ab..debc3b0f9662 100644 --- a/trunk/drivers/usb/serial/ezusb.c +++ b/trunk/drivers/usb/serial/ezusb.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include "usb-serial.h" /* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */ #define CPUCS_REG 0x7F92 diff --git a/trunk/drivers/usb/serial/ftdi_sio.c b/trunk/drivers/usb/serial/ftdi_sio.c index b458aedc5fb6..8a74b19f1283 100644 --- a/trunk/drivers/usb/serial/ftdi_sio.c +++ b/trunk/drivers/usb/serial/ftdi_sio.c @@ -257,7 +257,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "ftdi_sio.h" /* @@ -313,7 +313,6 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, - { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, @@ -501,8 +500,6 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, - { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, - { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ }; @@ -551,17 +548,11 @@ struct ftdi_private { spinlock_t rx_lock; /* spinlock for receive state */ struct work_struct rx_work; int rx_processed; - unsigned long rx_bytes; __u16 interface; /* FT2232C port interface (0 for FT232/245) */ int force_baud; /* if non-zero, force the baud rate to this value */ int force_rtscts; /* if non-zero, force RTS-CTS to always be enabled */ - - spinlock_t tx_lock; /* spinlock for transmit state */ - unsigned long tx_bytes; - unsigned long tx_outstanding_bytes; - unsigned long tx_outstanding_urbs; }; /* Used for TIOCMIWAIT */ @@ -635,9 +626,6 @@ static struct usb_serial_driver ftdi_sio_device = { #define HIGH 1 #define LOW 0 -/* number of outstanding urbs to prevent userspace DoS from happening */ -#define URB_UPPER_LIMIT 42 - /* * *************************************************************************** * Utlity functions @@ -1168,7 +1156,6 @@ static int ftdi_sio_attach (struct usb_serial *serial) } spin_lock_init(&priv->rx_lock); - spin_lock_init(&priv->tx_lock); init_waitqueue_head(&priv->delta_msr_wait); /* This will push the characters through immediately rather than queue a task to deliver them */ @@ -1283,13 +1270,6 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp) dbg("%s", __FUNCTION__); - spin_lock_irqsave(&priv->tx_lock, flags); - priv->tx_bytes = 0; - spin_unlock_irqrestore(&priv->tx_lock, flags); - spin_lock_irqsave(&priv->rx_lock, flags); - priv->rx_bytes = 0; - spin_unlock_irqrestore(&priv->rx_lock, flags); - if (port->tty) port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0; @@ -1392,7 +1372,6 @@ static int ftdi_write (struct usb_serial_port *port, int data_offset ; /* will be 1 for the SIO and 0 otherwise */ int status; int transfer_size; - unsigned long flags; dbg("%s port %d, %d bytes", __FUNCTION__, port->number, count); @@ -1400,13 +1379,6 @@ static int ftdi_write (struct usb_serial_port *port, dbg("write request of 0 bytes"); return 0; } - spin_lock_irqsave(&priv->tx_lock, flags); - if (priv->tx_outstanding_urbs > URB_UPPER_LIMIT) { - spin_unlock_irqrestore(&priv->tx_lock, flags); - dbg("%s - write limit hit\n", __FUNCTION__); - return 0; - } - spin_unlock_irqrestore(&priv->tx_lock, flags); data_offset = priv->write_offset; dbg("data_offset set to %d",data_offset); @@ -1473,12 +1445,6 @@ static int ftdi_write (struct usb_serial_port *port, err("%s - failed submitting write urb, error %d", __FUNCTION__, status); count = status; kfree (buffer); - } else { - spin_lock_irqsave(&priv->tx_lock, flags); - ++priv->tx_outstanding_urbs; - priv->tx_outstanding_bytes += count; - priv->tx_bytes += count; - spin_unlock_irqrestore(&priv->tx_lock, flags); } /* we are done with this urb, so let the host driver @@ -1494,11 +1460,7 @@ static int ftdi_write (struct usb_serial_port *port, static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs) { - unsigned long flags; struct usb_serial_port *port = (struct usb_serial_port *)urb->context; - struct ftdi_private *priv; - int data_offset; /* will be 1 for the SIO and 0 otherwise */ - unsigned long countback; /* free up the transfer buffer, as usb_free_urb() does not do this */ kfree (urb->transfer_buffer); @@ -1510,67 +1472,34 @@ static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs) return; } - priv = usb_get_serial_port_data(port); - if (!priv) { - dbg("%s - bad port private data pointer - exiting", __FUNCTION__); - return; - } - /* account for transferred data */ - countback = urb->actual_length; - data_offset = priv->write_offset; - if (data_offset > 0) { - /* Subtract the control bytes */ - countback -= (data_offset * ((countback + (PKTSZ - 1)) / PKTSZ)); - } - spin_lock_irqsave(&priv->tx_lock, flags); - --priv->tx_outstanding_urbs; - priv->tx_outstanding_bytes -= countback; - spin_unlock_irqrestore(&priv->tx_lock, flags); - usb_serial_port_softint(port); } /* ftdi_write_bulk_callback */ static int ftdi_write_room( struct usb_serial_port *port ) { - struct ftdi_private *priv = usb_get_serial_port_data(port); - int room; - unsigned long flags; - dbg("%s - port %d", __FUNCTION__, port->number); - spin_lock_irqsave(&priv->tx_lock, flags); - if (priv->tx_outstanding_urbs < URB_UPPER_LIMIT) { - /* - * We really can take anything the user throws at us - * but let's pick a nice big number to tell the tty - * layer that we have lots of free space - */ - room = 2048; - } else { - room = 0; - } - spin_unlock_irqrestore(&priv->tx_lock, flags); - return room; + /* + * We really can take anything the user throws at us + * but let's pick a nice big number to tell the tty + * layer that we have lots of free space + */ + return 2048; } /* ftdi_write_room */ static int ftdi_chars_in_buffer (struct usb_serial_port *port) { /* ftdi_chars_in_buffer */ - struct ftdi_private *priv = usb_get_serial_port_data(port); - int buffered; - unsigned long flags; - dbg("%s - port %d", __FUNCTION__, port->number); - spin_lock_irqsave(&priv->tx_lock, flags); - buffered = (int)priv->tx_outstanding_bytes; - spin_unlock_irqrestore(&priv->tx_lock, flags); - if (buffered < 0) { - err("%s outstanding tx bytes is negative!", __FUNCTION__); - buffered = 0; - } - return buffered; + /* + * We can't really account for how much data we + * have sent out, but hasn't made it through to the + * device, so just tell the tty layer that everything + * is flushed. + */ + return 0; } /* ftdi_chars_in_buffer */ @@ -1580,8 +1509,6 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs) struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct tty_struct *tty; struct ftdi_private *priv; - unsigned long countread; - unsigned long flags; if (urb->number_of_packets > 0) { err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__, @@ -1616,13 +1543,6 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs) return; } - /* count data bytes, but not status bytes */ - countread = urb->actual_length; - countread -= 2 * ((countread + (PKTSZ - 1)) / PKTSZ); - spin_lock_irqsave(&priv->rx_lock, flags); - priv->rx_bytes += countread; - spin_unlock_irqrestore(&priv->rx_lock, flags); - ftdi_process_read(port); } /* ftdi_read_bulk_callback */ diff --git a/trunk/drivers/usb/serial/ftdi_sio.h b/trunk/drivers/usb/serial/ftdi_sio.h index 04ef90fcb876..6ab2ac845bd7 100644 --- a/trunk/drivers/usb/serial/ftdi_sio.h +++ b/trunk/drivers/usb/serial/ftdi_sio.h @@ -36,9 +36,6 @@ #define FTDI_ACTZWAVE_PID 0xF2D0 -/* www.starting-point-systems.com µChameleon device */ -#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */ - /* www.irtrans.de device */ #define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ @@ -445,18 +442,6 @@ */ #define FTDI_YEI_SERVOCENTER31_PID 0xE050 /* YEI ServoCenter3.1 USB */ -/* - * ThorLabs USB motor drivers - */ -#define FTDI_THORLABS_PID 0xfaf0 /* ThorLabs USB motor drivers */ - -/* - * Testo products (http://www.testo.com/) - * Submitted by Colin Leroy - */ -#define TESTO_VID 0x128D -#define TESTO_USB_INTERFACE_PID 0x0001 - /* Commands */ #define FTDI_SIO_RESET 0 /* Reset the port */ #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ diff --git a/trunk/drivers/usb/serial/funsoft.c b/trunk/drivers/usb/serial/funsoft.c index 77b977206a8c..803721b97e2e 100644 --- a/trunk/drivers/usb/serial/funsoft.c +++ b/trunk/drivers/usb/serial/funsoft.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include "usb-serial.h" static struct usb_device_id id_table [] = { { USB_DEVICE(0x1404, 0xcddc) }, diff --git a/trunk/drivers/usb/serial/garmin_gps.c b/trunk/drivers/usb/serial/garmin_gps.c index 727852634be9..1f5d1620baa1 100644 --- a/trunk/drivers/usb/serial/garmin_gps.c +++ b/trunk/drivers/usb/serial/garmin_gps.c @@ -35,7 +35,6 @@ #include #include #include -#include /* the mode to be set when the port ist opened */ static int initial_mode = 1; @@ -43,6 +42,8 @@ static int initial_mode = 1; /* debug flag */ static int debug = 0; +#include "usb-serial.h" + #define GARMIN_VENDOR_ID 0x091E /* diff --git a/trunk/drivers/usb/serial/generic.c b/trunk/drivers/usb/serial/generic.c index 172713556393..945b8bb38c92 100644 --- a/trunk/drivers/usb/serial/generic.c +++ b/trunk/drivers/usb/serial/generic.c @@ -17,8 +17,8 @@ #include #include #include -#include #include +#include "usb-serial.h" static int debug; @@ -285,7 +285,6 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg if (result) dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); } -EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback); void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs) { diff --git a/trunk/drivers/usb/serial/hp4x.c b/trunk/drivers/usb/serial/hp4x.c index ebcac701b069..7e06358b0310 100644 --- a/trunk/drivers/usb/serial/hp4x.c +++ b/trunk/drivers/usb/serial/hp4x.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include "usb-serial.h" /* * Version Information diff --git a/trunk/drivers/usb/serial/io_edgeport.c b/trunk/drivers/usb/serial/io_edgeport.c index c49976c3ad52..bd2c05dac2a9 100644 --- a/trunk/drivers/usb/serial/io_edgeport.c +++ b/trunk/drivers/usb/serial/io_edgeport.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "io_edgeport.h" #include "io_ionsp.h" /* info for the iosp messages */ #include "io_16654.h" /* 16654 UART defines */ diff --git a/trunk/drivers/usb/serial/io_ti.c b/trunk/drivers/usb/serial/io_ti.c index 17c5b1d2311a..723a12ae87b5 100644 --- a/trunk/drivers/usb/serial/io_ti.c +++ b/trunk/drivers/usb/serial/io_ti.c @@ -39,8 +39,8 @@ #include #include #include -#include +#include "usb-serial.h" #include "io_16654.h" #include "io_usbvend.h" #include "io_ti.h" diff --git a/trunk/drivers/usb/serial/ipaq.c b/trunk/drivers/usb/serial/ipaq.c index 59c5d999009a..dbcfe172a5cc 100644 --- a/trunk/drivers/usb/serial/ipaq.c +++ b/trunk/drivers/usb/serial/ipaq.c @@ -55,7 +55,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "ipaq.h" #define KP_RETRIES 100 @@ -70,8 +70,6 @@ static __u16 product, vendor; static int debug; -static int connect_retries = KP_RETRIES; -static int initial_wait; /* Function prototypes for an ipaq */ static int ipaq_open (struct usb_serial_port *port, struct file *filp); @@ -584,7 +582,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) struct ipaq_private *priv; struct ipaq_packet *pkt; int i, result = 0; - int retries = connect_retries; + int retries = KP_RETRIES; dbg("%s - port %d", __FUNCTION__, port->number); @@ -648,12 +646,16 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) port->read_urb->transfer_buffer_length = URBDATA_SIZE; port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; - msleep(1000*initial_wait); /* Start reading from the device */ usb_fill_bulk_urb(port->read_urb, serial->dev, usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, ipaq_read_bulk_callback, port); + result = usb_submit_urb(port->read_urb, GFP_KERNEL); + if (result) { + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + goto error; + } /* * Send out control message observed in win98 sniffs. Not sure what @@ -668,14 +670,8 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, 0x1, 0, NULL, 0, 100); if (result == 0) { - result = usb_submit_urb(port->read_urb, GFP_KERNEL); - if (result) { - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - goto error; - } return 0; } - msleep(1000); } err("%s - failed doing control urb, error %d", __FUNCTION__, result); goto error; @@ -858,7 +854,6 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs) if (urb->status) { dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); - return; } spin_lock_irqsave(&write_list_lock, flags); @@ -971,9 +966,3 @@ MODULE_PARM_DESC(vendor, "User specified USB idVendor"); module_param(product, ushort, 0); MODULE_PARM_DESC(product, "User specified USB idProduct"); - -module_param(connect_retries, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(connect_retries, "Maximum number of connect retries (one second each)"); - -module_param(initial_wait, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(initial_wait, "Time to wait before attempting a connection (in seconds)"); diff --git a/trunk/drivers/usb/serial/ipw.c b/trunk/drivers/usb/serial/ipw.c index 87306cb6f9f5..a4a0bfeaab00 100644 --- a/trunk/drivers/usb/serial/ipw.c +++ b/trunk/drivers/usb/serial/ipw.c @@ -46,8 +46,8 @@ #include #include #include -#include #include +#include "usb-serial.h" /* * Version Information @@ -373,8 +373,6 @@ static void ipw_write_bulk_callback(struct urb *urb, struct pt_regs *regs) dbg("%s", __FUNCTION__); - port->write_urb_busy = 0; - if (urb->status) dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); diff --git a/trunk/drivers/usb/serial/ir-usb.c b/trunk/drivers/usb/serial/ir-usb.c index 1738b0b6a376..2cf1fed3de43 100644 --- a/trunk/drivers/usb/serial/ir-usb.c +++ b/trunk/drivers/usb/serial/ir-usb.c @@ -57,7 +57,7 @@ #include #include #include -#include +#include "usb-serial.h" /* * Version Information diff --git a/trunk/drivers/usb/serial/keyspan.c b/trunk/drivers/usb/serial/keyspan.c index 015ad6cc1bbb..d7c58f1bc960 100644 --- a/trunk/drivers/usb/serial/keyspan.c +++ b/trunk/drivers/usb/serial/keyspan.c @@ -107,7 +107,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "keyspan.h" static int debug; diff --git a/trunk/drivers/usb/serial/keyspan_pda.c b/trunk/drivers/usb/serial/keyspan_pda.c index 49b8dc039d1f..03ab3c0f3cce 100644 --- a/trunk/drivers/usb/serial/keyspan_pda.c +++ b/trunk/drivers/usb/serial/keyspan_pda.c @@ -78,7 +78,6 @@ #include #include #include -#include static int debug; @@ -108,6 +107,8 @@ struct ezusb_hex_record { #include "xircom_pgs_fw.h" #endif +#include "usb-serial.h" + /* * Version Information */ diff --git a/trunk/drivers/usb/serial/kl5kusb105.c b/trunk/drivers/usb/serial/kl5kusb105.c index 2a2f3e2da055..b45ff3e7ab40 100644 --- a/trunk/drivers/usb/serial/kl5kusb105.c +++ b/trunk/drivers/usb/serial/kl5kusb105.c @@ -55,7 +55,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "kl5kusb105.h" static int debug; diff --git a/trunk/drivers/usb/serial/kobil_sct.c b/trunk/drivers/usb/serial/kobil_sct.c index d50dce034958..457733374772 100644 --- a/trunk/drivers/usb/serial/kobil_sct.c +++ b/trunk/drivers/usb/serial/kobil_sct.c @@ -46,8 +46,8 @@ #include #include #include -#include #include +#include "usb-serial.h" #include "kobil_sct.h" static int debug; diff --git a/trunk/drivers/usb/serial/mct_u232.c b/trunk/drivers/usb/serial/mct_u232.c index f4d4305c2c02..ca05d3275f3e 100644 --- a/trunk/drivers/usb/serial/mct_u232.c +++ b/trunk/drivers/usb/serial/mct_u232.c @@ -75,7 +75,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "mct_u232.h" /* diff --git a/trunk/drivers/usb/serial/navman.c b/trunk/drivers/usb/serial/navman.c index ac3f8b5d2c49..7f544081032e 100644 --- a/trunk/drivers/usb/serial/navman.c +++ b/trunk/drivers/usb/serial/navman.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include "usb-serial.h" static int debug; diff --git a/trunk/drivers/usb/serial/omninet.c b/trunk/drivers/usb/serial/omninet.c index e49f40913c27..cfb711a21a45 100644 --- a/trunk/drivers/usb/serial/omninet.c +++ b/trunk/drivers/usb/serial/omninet.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include "usb-serial.h" static int debug; diff --git a/trunk/drivers/usb/serial/option.c b/trunk/drivers/usb/serial/option.c index f0530c1d7b7a..78ad4b3126a6 100644 --- a/trunk/drivers/usb/serial/option.c +++ b/trunk/drivers/usb/serial/option.c @@ -35,7 +35,6 @@ 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 Work sponsored by: Sigos GmbH, Germany @@ -54,7 +53,7 @@ device features. */ -#define DRIVER_VERSION "v0.7.1" +#define DRIVER_VERSION "v0.7.0" #define DRIVER_AUTHOR "Matthias Urlichs " #define DRIVER_DESC "USB Driver for GSM modems" @@ -65,7 +64,7 @@ #include #include #include -#include +#include "usb-serial.h" /* Function prototypes */ static int option_open(struct usb_serial_port *port, struct file *filp); @@ -103,7 +102,6 @@ static int option_send_setup(struct usb_serial_port *port); #define OPTION_PRODUCT_FUSION 0x6000 #define OPTION_PRODUCT_FUSION2 0x6300 #define OPTION_PRODUCT_COBRA 0x6500 -#define OPTION_PRODUCT_COBRA2 0x6600 #define HUAWEI_PRODUCT_E600 0x1001 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 #define SIERRAWIRELESS_PRODUCT_MC8755 0x6802 @@ -114,7 +112,6 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, - { 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) }, @@ -127,7 +124,6 @@ static struct usb_device_id option_ids1[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, - { 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(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, diff --git a/trunk/drivers/usb/serial/pl2303.c b/trunk/drivers/usb/serial/pl2303.c index 259db31b65c1..de93a2b909e7 100644 --- a/trunk/drivers/usb/serial/pl2303.c +++ b/trunk/drivers/usb/serial/pl2303.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "pl2303.h" /* @@ -52,7 +52,6 @@ struct pl2303_buf { static struct usb_device_id id_table [] = { { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) }, - { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, @@ -80,7 +79,6 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) }, { 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) }, { } /* Terminating entry */ }; diff --git a/trunk/drivers/usb/serial/pl2303.h b/trunk/drivers/usb/serial/pl2303.h index d9c1e6e0b4b3..7f29e81d3e35 100644 --- a/trunk/drivers/usb/serial/pl2303.h +++ b/trunk/drivers/usb/serial/pl2303.h @@ -10,7 +10,6 @@ #define PL2303_VENDOR_ID 0x067b #define PL2303_PRODUCT_ID 0x2303 #define PL2303_PRODUCT_ID_RSAQ2 0x04bb -#define PL2303_PRODUCT_ID_DCU11 0x1234 #define PL2303_PRODUCT_ID_PHAROS 0xaaa0 #define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 @@ -85,7 +84,3 @@ /* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */ #define OTI_VENDOR_ID 0x0ea0 #define OTI_PRODUCT_ID 0x6858 - -/* DATAPILOT Universal-2 Phone Cable */ -#define DATAPILOT_U2_VENDOR_ID 0x0731 -#define DATAPILOT_U2_PRODUCT_ID 0x2003 diff --git a/trunk/drivers/usb/serial/safe_serial.c b/trunk/drivers/usb/serial/safe_serial.c index 789771ecdb11..897d8447252b 100644 --- a/trunk/drivers/usb/serial/safe_serial.c +++ b/trunk/drivers/usb/serial/safe_serial.c @@ -71,7 +71,7 @@ #include #include #include -#include +#include "usb-serial.h" #ifndef CONFIG_USB_SAFE_PADDED diff --git a/trunk/drivers/usb/serial/sierra.c b/trunk/drivers/usb/serial/sierra.c deleted file mode 100644 index d29638daa987..000000000000 --- a/trunk/drivers/usb/serial/sierra.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Sierra Wireless CDMA Wireless Serial USB driver - * - * Current Copy modified by: Kevin Lloyd - * Original Copyright (C) 2005-2006 Greg Kroah-Hartman - * - * 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 -#include -#include -#include -#include -#include - -static struct usb_device_id id_table [] = { - { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ - { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ - { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ - { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ - { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ - { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ - { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */ - { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ - /* Following devices are supported in the airprime.c driver */ - /* { USB_DEVICE(0x1199, 0x0112) }, */ /* Sierra Wireless AirCard 580 */ - /* { USB_DEVICE(0x0F3D, 0x0112) }, */ /* AirPrime/Sierra PC 5220 */ - { } -}; -MODULE_DEVICE_TABLE(usb, id_table); - -static struct usb_driver sierra_driver = { - .name = "sierra_wireless", - .probe = usb_serial_probe, - .disconnect = usb_serial_disconnect, - .id_table = id_table, -}; - -static struct usb_serial_driver sierra_device = { - .driver = { - .owner = THIS_MODULE, - .name = "Sierra_Wireless", - }, - .id_table = id_table, - .num_interrupt_in = NUM_DONT_CARE, - .num_bulk_in = NUM_DONT_CARE, - .num_bulk_out = NUM_DONT_CARE, - .num_ports = 3, -}; - -static int __init sierra_init(void) -{ - int retval; - - retval = usb_serial_register(&sierra_device); - if (retval) - return retval; - retval = usb_register(&sierra_driver); - if (retval) - usb_serial_deregister(&sierra_device); - return retval; -} - -static void __exit sierra_exit(void) -{ - usb_deregister(&sierra_driver); - usb_serial_deregister(&sierra_device); -} - -module_init(sierra_init); -module_exit(sierra_exit); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/usb/serial/ti_usb_3410_5052.c b/trunk/drivers/usb/serial/ti_usb_3410_5052.c index ac9b8ee52d44..a9afff31a921 100644 --- a/trunk/drivers/usb/serial/ti_usb_3410_5052.c +++ b/trunk/drivers/usb/serial/ti_usb_3410_5052.c @@ -83,8 +83,8 @@ #include #include #include -#include +#include "usb-serial.h" #include "ti_usb_3410_5052.h" #include "ti_fw_3410.h" /* firmware image for 3410 */ #include "ti_fw_5052.h" /* firmware image for 5052 */ diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c index 12c1694d322e..b59a0536ea5c 100644 --- a/trunk/drivers/usb/serial/usb-serial.c +++ b/trunk/drivers/usb/serial/usb-serial.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "pl2303.h" /* @@ -40,8 +40,6 @@ #define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/" #define DRIVER_DESC "USB Serial Driver core" -static void port_free(struct usb_serial_port *port); - /* Driver structure we register with the USB core */ static struct usb_driver usb_serial_driver = { .name = "usbserial", @@ -148,10 +146,23 @@ static void destroy_serial(struct kref *kref) port = serial->port[i]; if (!port) continue; - port_free(port); + usb_kill_urb(port->read_urb); + usb_free_urb(port->read_urb); + usb_kill_urb(port->write_urb); + usb_free_urb(port->write_urb); + usb_kill_urb(port->interrupt_in_urb); + usb_free_urb(port->interrupt_in_urb); + usb_kill_urb(port->interrupt_out_urb); + usb_free_urb(port->interrupt_out_urb); + kfree(port->bulk_in_buffer); + kfree(port->bulk_out_buffer); + kfree(port->interrupt_in_buffer); + kfree(port->interrupt_out_buffer); } } + flush_scheduled_work(); /* port->work */ + usb_put_dev(serial->dev); /* free up any memory that we allocated */ @@ -553,11 +564,6 @@ static void port_release(struct device *dev) struct usb_serial_port *port = to_usb_serial_port(dev); dbg ("%s - %s", __FUNCTION__, dev->bus_id); - port_free(port); -} - -static void port_free(struct usb_serial_port *port) -{ usb_kill_urb(port->read_urb); usb_free_urb(port->read_urb); usb_kill_urb(port->write_urb); @@ -570,7 +576,6 @@ static void port_free(struct usb_serial_port *port) kfree(port->bulk_out_buffer); kfree(port->interrupt_in_buffer); kfree(port->interrupt_out_buffer); - flush_scheduled_work(); /* port->work */ kfree(port); } diff --git a/trunk/include/linux/usb/serial.h b/trunk/drivers/usb/serial/usb-serial.h similarity index 99% rename from trunk/include/linux/usb/serial.h rename to trunk/drivers/usb/serial/usb-serial.h index 91c983eef899..0f2802a60194 100644 --- a/trunk/include/linux/usb/serial.h +++ b/trunk/drivers/usb/serial/usb-serial.h @@ -1,12 +1,12 @@ /* - * USB Serial Converter stuff + * USB Serial Converter driver * * Copyright (C) 1999 - 2005 * Greg Kroah-Hartman (greg@kroah.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; version 2 of the License. + * the Free Software Foundation; either version 2 of the License. * */ @@ -171,7 +171,7 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data) * but before the device has been fully initialized by the usb_serial * subsystem. Use this function to download any firmware to the device, * or any other early initialization that might be needed. - * Return 0 to continue on with the initialization sequence. Anything + * Return 0 to continue on with the initialization sequence. Anything * else will abort it. * @attach: pointer to the driver's attach function. * This will be called when the struct usb_serial structure is fully set diff --git a/trunk/drivers/usb/serial/visor.c b/trunk/drivers/usb/serial/visor.c index 88949f7884ca..95a2936e902e 100644 --- a/trunk/drivers/usb/serial/visor.c +++ b/trunk/drivers/usb/serial/visor.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "visor.h" /* @@ -302,6 +302,7 @@ static int visor_open (struct usb_serial_port *port, struct file *filp) spin_lock_irqsave(&priv->lock, flags); priv->bytes_in = 0; priv->bytes_out = 0; + priv->outstanding_urbs = 0; priv->throttled = 0; spin_unlock_irqrestore(&priv->lock, flags); @@ -434,25 +435,13 @@ static int visor_write (struct usb_serial_port *port, const unsigned char *buf, static int visor_write_room (struct usb_serial_port *port) { - struct visor_private *priv = usb_get_serial_port_data(port); - unsigned long flags; - dbg("%s - port %d", __FUNCTION__, port->number); /* * We really can take anything the user throws at us * but let's pick a nice big number to tell the tty - * layer that we have lots of free space, unless we don't. + * layer that we have lots of free space */ - - spin_lock_irqsave(&priv->lock, flags); - if (priv->outstanding_urbs > URB_UPPER_LIMIT * 2 / 3) { - spin_unlock_irqrestore(&priv->lock, flags); - dbg("%s - write limit hit\n", __FUNCTION__); - return 0; - } - spin_unlock_irqrestore(&priv->lock, flags); - return 2048; } @@ -769,22 +758,15 @@ static int visor_calc_num_ports (struct usb_serial *serial) static int generic_startup(struct usb_serial *serial) { - struct usb_serial_port **ports = serial->port; struct visor_private *priv; int i; for (i = 0; i < serial->num_ports; ++i) { priv = kzalloc (sizeof(*priv), GFP_KERNEL); - if (!priv) { - while (i-- != 0) { - priv = usb_get_serial_port_data(ports[i]); - usb_set_serial_port_data(ports[i], NULL); - kfree(priv); - } + if (!priv) return -ENOMEM; - } spin_lock_init(&priv->lock); - usb_set_serial_port_data(ports[i], priv); + usb_set_serial_port_data(serial->port[i], priv); } return 0; } @@ -894,18 +876,7 @@ static int clie_5_attach (struct usb_serial *serial) static void visor_shutdown (struct usb_serial *serial) { - struct visor_private *priv; - int i; - dbg("%s", __FUNCTION__); - - for (i = 0; i < serial->num_ports; i++) { - priv = usb_get_serial_port_data(serial->port[i]); - if (priv) { - usb_set_serial_port_data(serial->port[i], NULL); - kfree(priv); - } - } } static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) diff --git a/trunk/drivers/usb/serial/whiteheat.c b/trunk/drivers/usb/serial/whiteheat.c index 6e6c7934be32..540438c3f381 100644 --- a/trunk/drivers/usb/serial/whiteheat.c +++ b/trunk/drivers/usb/serial/whiteheat.c @@ -79,7 +79,7 @@ #include #include #include -#include +#include "usb-serial.h" #include "whiteheat_fw.h" /* firmware for the ConnectTech WhiteHEAT device */ #include "whiteheat.h" /* WhiteHEAT specific commands */ diff --git a/trunk/drivers/usb/storage/scsiglue.c b/trunk/drivers/usb/storage/scsiglue.c index a4b7df9ff8c1..5715291ba540 100644 --- a/trunk/drivers/usb/storage/scsiglue.c +++ b/trunk/drivers/usb/storage/scsiglue.c @@ -112,11 +112,13 @@ static int slave_configure(struct scsi_device *sdev) if (sdev->scsi_level < SCSI_2) sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; - /* Many devices have trouble transfering more than 32KB at a time, - * while others have trouble with more than 64K. At this time we - * are limiting both to 32K (64 sectores). - */ - if ((us->flags & US_FL_MAX_SECTORS_64) && + /* According to the technical support people at Genesys Logic, + * devices using their chips have problems transferring more than + * 32 KB at a time. In practice people have found that 64 KB + * works okay and that's what Windows does. But we'll be + * conservative; people can always use the sysfs interface to + * increase max_sectors. */ + if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == USB_VENDOR_ID_GENESYS && sdev->request_queue->max_sectors > 64) blk_queue_max_sectors(sdev->request_queue, 64); diff --git a/trunk/drivers/usb/storage/transport.c b/trunk/drivers/usb/storage/transport.c index d6acc92a4ae3..eb7188b3565c 100644 --- a/trunk/drivers/usb/storage/transport.c +++ b/trunk/drivers/usb/storage/transport.c @@ -180,7 +180,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout) if (timeleft <= 0) { US_DEBUGP("%s -- cancelling URB\n", timeleft == 0 ? "Timeout" : "Signal"); - usb_kill_urb(us->current_urb); + usb_unlink_urb(us->current_urb); } /* return the URB status */ diff --git a/trunk/drivers/usb/storage/unusual_devs.h b/trunk/drivers/usb/storage/unusual_devs.h index a5ca449f6e64..c7e84e653df9 100644 --- a/trunk/drivers/usb/storage/unusual_devs.h +++ b/trunk/drivers/usb/storage/unusual_devs.h @@ -112,19 +112,6 @@ UNUSUAL_DEV( 0x0411, 0x001c, 0x0113, 0x0113, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY ), -/* Submitted by Ernestas Vaiciukevicius */ -UNUSUAL_DEV( 0x0419, 0x0100, 0x0100, 0x0100, - "Samsung Info. Systems America, Inc.", - "MP3 Player", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_RESIDUE ), - -/* Reported by Orgad Shaneh */ -UNUSUAL_DEV( 0x0419, 0xaace, 0x0100, 0x0100, - "Samsung", "MP3 Player", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_RESIDUE ), - /* Reported by Christian Leber */ UNUSUAL_DEV( 0x0419, 0xaaf5, 0x0100, 0x0100, "TrekStor", @@ -145,14 +132,6 @@ UNUSUAL_DEV( 0x0420, 0x0001, 0x0100, 0x0100, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), -/* Reported by Sumedha Swamy and - * Einar Th. Einarsson */ -UNUSUAL_DEV( 0x0421, 0x0444, 0x0100, 0x0100, - "Nokia", - "N91", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), - /* Reported by Jiri Slaby and * Rene C. Castberg */ UNUSUAL_DEV( 0x0421, 0x0446, 0x0100, 0x0100, @@ -161,13 +140,6 @@ UNUSUAL_DEV( 0x0421, 0x0446, 0x0100, 0x0100, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), -/* Reported by Matthew Bloch */ -UNUSUAL_DEV( 0x0421, 0x044e, 0x0100, 0x0100, - "Nokia", - "E61", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), - /* Reported by Olaf Hering from novell bug #105878 */ UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, "SMSC", @@ -501,11 +473,10 @@ UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0450, US_SC_SCSI, US_PR_DEVICE, NULL, US_FL_SINGLE_LUN | US_FL_NOT_LOCKABLE | US_FL_NO_WP_DETECT ), -/* Submitted by Lars Jacob - * This entry is needed because the device reports Sub=ff */ -UNUSUAL_DEV( 0x054c, 0x0010, 0x0500, 0x0610, +/* This entry is needed because the device reports Sub=ff */ +UNUSUAL_DEV( 0x054c, 0x0010, 0x0500, 0x0600, "Sony", - "DSC-T1/T5/H5", + "DSC-T1/T5", US_SC_8070, US_PR_DEVICE, NULL, US_FL_SINGLE_LUN ), @@ -737,22 +708,18 @@ UNUSUAL_DEV( 0x05dc, 0xb002, 0x0000, 0x0113, * They were originally reported by Alexander Oltu * and Peter Marks * respectively. - * - * US_FL_GO_SLOW and US_FL_MAX_SECTORS_64 added by Phil Dibowitz - * as these flags were made and hard-coded - * special-cases were pulled from scsiglue.c. */ UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff, "Genesys Logic", "USB to IDE Optical", US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ), + US_FL_GO_SLOW ), UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff, "Genesys Logic", "USB to IDE Disk", US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ), + US_FL_GO_SLOW ), /* Reported by Hanno Boeck * Taken from the Lycoris Kernel */ @@ -1229,14 +1196,6 @@ UNUSUAL_DEV( 0x0ea0, 0x6828, 0x0110, 0x0110, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), -/* Reported by Benjamin Schiller - * It is also sold by Easylite as DJ 20 */ -UNUSUAL_DEV( 0x0ed1, 0x7636, 0x0103, 0x0103, - "Typhoon", - "My DJ 1820", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_RESIDUE | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64), - /* Reported by Michael Stattmann */ UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, "Sony Ericsson", @@ -1268,15 +1227,6 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), -/* patch submitted by Davide Perini - * and Renato Perini - */ -UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001, - "Motorola", - "RAZR V3x", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), - /* Reported by Radovan Garabik */ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, "MPIO", diff --git a/trunk/drivers/usb/storage/usb.c b/trunk/drivers/usb/storage/usb.c index 5ee19be52f65..1185acac4b21 100644 --- a/trunk/drivers/usb/storage/usb.c +++ b/trunk/drivers/usb/storage/usb.c @@ -55,7 +55,6 @@ #include #include #include -#include #include #include @@ -374,12 +373,8 @@ static int usb_stor_control_thread(void * __us) /* lock access to the state */ scsi_lock(host); - /* did the command already complete because of a disconnect? */ - if (!us->srb) - ; /* nothing to do */ - /* indicate that the command is done */ - else if (us->srb->result != DID_ABORT << 16) { + if (us->srb->result != DID_ABORT << 16) { US_DEBUGP("scsi cmd done, result=0x%x\n", us->srb->result); us->srb->scsi_done(us->srb); @@ -529,8 +524,7 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id) if (msg >= 0 && !(us->flags & US_FL_NEED_OVERRIDE)) printk(KERN_NOTICE USB_STORAGE "This device " "(%04x,%04x,%04x S %02x P %02x)" - " has %s in unusual_devs.h (kernel" - " %s)\n" + " has %s in unusual_devs.h\n" " Please send a copy of this message to " "\n", le16_to_cpu(ddesc->idVendor), @@ -538,8 +532,7 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id) le16_to_cpu(ddesc->bcdDevice), idesc->bInterfaceSubClass, idesc->bInterfaceProtocol, - msgs[msg], - UTS_RELEASE); + msgs[msg]); } } @@ -843,34 +836,32 @@ static void dissociate_dev(struct us_data *us) * the host */ static void quiesce_and_remove_host(struct us_data *us) { - struct Scsi_Host *host = us_to_host(us); - /* Prevent new USB transfers, stop the current command, and * interrupt a SCSI-scan or device-reset delay */ - scsi_lock(host); set_bit(US_FLIDX_DISCONNECTING, &us->flags); - scsi_unlock(host); usb_stor_stop_transport(us); wake_up(&us->delay_wait); /* It doesn't matter if the SCSI-scanning thread is still running. * The thread will exit when it sees the DISCONNECTING flag. */ + /* Wait for the current command to finish, then remove the host */ + mutex_lock(&us->dev_mutex); + mutex_unlock(&us->dev_mutex); + /* queuecommand won't accept any new commands and the control * thread won't execute a previously-queued command. If there * is such a command pending, complete it with an error. */ - mutex_lock(&us->dev_mutex); if (us->srb) { us->srb->result = DID_NO_CONNECT << 16; - scsi_lock(host); + scsi_lock(us_to_host(us)); us->srb->scsi_done(us->srb); us->srb = NULL; - scsi_unlock(host); + scsi_unlock(us_to_host(us)); } - mutex_unlock(&us->dev_mutex); /* Now we own no commands so it's safe to remove the SCSI host */ - scsi_remove_host(host); + scsi_remove_host(us_to_host(us)); } /* Second stage of disconnect processing: deallocate all resources */ diff --git a/trunk/drivers/usb/storage/usb.h b/trunk/drivers/usb/storage/usb.h index 21f3ddbc9080..5284abe1b5eb 100644 --- a/trunk/drivers/usb/storage/usb.h +++ b/trunk/drivers/usb/storage/usb.h @@ -176,4 +176,8 @@ extern void fill_inquiry_response(struct us_data *us, #define scsi_unlock(host) spin_unlock_irq(host->host_lock) #define scsi_lock(host) spin_lock_irq(host->host_lock) + +/* Vendor ID list for devices that require special handling */ +#define USB_VENDOR_ID_GENESYS 0x05e3 /* Genesys Logic */ + #endif diff --git a/trunk/drivers/video/68328fb.c b/trunk/drivers/video/68328fb.c index 0dda73da8628..78488bb41aeb 100644 --- a/trunk/drivers/video/68328fb.c +++ b/trunk/drivers/video/68328fb.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/S3triofb.c b/trunk/drivers/video/S3triofb.c index afd146f5f683..e714e8449c1d 100644 --- a/trunk/drivers/video/S3triofb.c +++ b/trunk/drivers/video/S3triofb.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/amifb.c b/trunk/drivers/video/amifb.c index f1ba54f4fc39..f9bc9f777e75 100644 --- a/trunk/drivers/video/amifb.c +++ b/trunk/drivers/video/amifb.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/arcfb.c b/trunk/drivers/video/arcfb.c index 70dd8115a4d8..fd95c2dbd4f7 100644 --- a/trunk/drivers/video/arcfb.c +++ b/trunk/drivers/video/arcfb.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/asiliantfb.c b/trunk/drivers/video/asiliantfb.c index 1fd22f460b0f..eaeaf4d1a094 100644 --- a/trunk/drivers/video/asiliantfb.c +++ b/trunk/drivers/video/asiliantfb.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/atafb.c b/trunk/drivers/video/atafb.c index 5831893bf7a0..e69ab65f7843 100644 --- a/trunk/drivers/video/atafb.c +++ b/trunk/drivers/video/atafb.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/aty/aty128fb.c b/trunk/drivers/video/aty/aty128fb.c index c64a717e2d4b..72c589109471 100644 --- a/trunk/drivers/video/aty/aty128fb.c +++ b/trunk/drivers/video/aty/aty128fb.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -455,7 +456,6 @@ 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); -static void aty128_bl_set_power(struct fb_info *info, int power); #define BIOS_IN8(v) (readb(bios + (v))) #define BIOS_IN16(v) (readb(bios + (v)) | \ @@ -1258,11 +1258,25 @@ static void aty128_set_lcd_enable(struct aty128fb_par *par, int on) reg &= ~LVDS_DISPLAY_DIS; aty_st_le32(LVDS_GEN_CNTL, reg); #ifdef CONFIG_FB_ATY128_BACKLIGHT - aty128_bl_set_power(info, FB_BLANK_UNBLANK); + mutex_lock(&info->bl_mutex); + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); #endif } else { #ifdef CONFIG_FB_ATY128_BACKLIGHT - aty128_bl_set_power(info, FB_BLANK_POWERDOWN); + mutex_lock(&info->bl_mutex); + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->brightness = 0; + info->bl_dev->props->power = FB_BLANK_POWERDOWN; + info->bl_dev->props->update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); #endif reg = aty_ld_le32(LVDS_GEN_CNTL); reg |= LVDS_DISPLAY_DIS; @@ -1689,7 +1703,6 @@ static int __devinit aty128fb_setup(char *options) static struct backlight_properties aty128_bl_data; -/* Call with fb_info->bl_mutex held */ static int aty128_bl_get_level_brightness(struct aty128fb_par *par, int level) { @@ -1697,8 +1710,10 @@ static int aty128_bl_get_level_brightness(struct aty128fb_par *par, int atylevel; /* Get and convert the value */ + mutex_lock(&info->bl_mutex); atylevel = MAX_LEVEL - (info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL); + mutex_unlock(&info->bl_mutex); if (atylevel < 0) atylevel = 0; @@ -1716,8 +1731,7 @@ static int aty128_bl_get_level_brightness(struct aty128fb_par *par, /* That one prevents proper CRT output with LCD off */ #undef BACKLIGHT_DAC_OFF -/* Call with fb_info->bl_mutex held */ -static int __aty128_bl_update_status(struct backlight_device *bd) +static int aty128_bl_update_status(struct backlight_device *bd) { struct aty128fb_par *par = class_get_devdata(&bd->class_dev); unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL); @@ -1770,19 +1784,6 @@ static int __aty128_bl_update_status(struct backlight_device *bd) return 0; } -static int aty128_bl_update_status(struct backlight_device *bd) -{ - struct aty128fb_par *par = class_get_devdata(&bd->class_dev); - struct fb_info *info = pci_get_drvdata(par->pdev); - int ret; - - mutex_lock(&info->bl_mutex); - ret = __aty128_bl_update_status(bd); - mutex_unlock(&info->bl_mutex); - - return ret; -} - static int aty128_bl_get_brightness(struct backlight_device *bd) { return bd->props->brightness; @@ -1795,16 +1796,6 @@ static struct backlight_properties aty128_bl_data = { .max_brightness = (FB_BACKLIGHT_LEVELS - 1), }; -static void aty128_bl_set_power(struct fb_info *info, int power) -{ - mutex_lock(&info->bl_mutex); - up(&info->bl_dev->sem); - info->bl_dev->props->power = power; - __aty128_bl_update_status(info->bl_dev); - down(&info->bl_dev->sem); - mutex_unlock(&info->bl_mutex); -} - static void aty128_bl_init(struct aty128fb_par *par) { struct fb_info *info = pci_get_drvdata(par->pdev); @@ -2207,8 +2198,12 @@ static int aty128fb_blank(int blank, struct fb_info *fb) return 0; #ifdef CONFIG_FB_ATY128_BACKLIGHT - if (machine_is(powermac) && blank) - aty128_bl_set_power(fb, FB_BLANK_POWERDOWN); + if (machine_is(powermac) && blank) { + down(&fb->bl_dev->sem); + fb->bl_dev->props->power = FB_BLANK_POWERDOWN; + fb->bl_dev->props->update_status(fb->bl_dev); + up(&fb->bl_dev->sem); + } #endif if (blank & FB_BLANK_VSYNC_SUSPEND) @@ -2224,12 +2219,14 @@ static int aty128fb_blank(int blank, struct fb_info *fb) aty128_set_crt_enable(par, par->crt_on && !blank); aty128_set_lcd_enable(par, par->lcd_on && !blank); } - #ifdef CONFIG_FB_ATY128_BACKLIGHT - if (machine_is(powermac) && !blank) - aty128_bl_set_power(fb, FB_BLANK_UNBLANK); + if (machine_is(powermac) && !blank) { + down(&fb->bl_dev->sem); + fb->bl_dev->props->power = FB_BLANK_UNBLANK; + fb->bl_dev->props->update_status(fb->bl_dev); + up(&fb->bl_dev->sem); + } #endif - return 0; } diff --git a/trunk/drivers/video/aty/atyfb_base.c b/trunk/drivers/video/aty/atyfb_base.c index 1507d19f481f..0c9706746d79 100644 --- a/trunk/drivers/video/aty/atyfb_base.c +++ b/trunk/drivers/video/aty/atyfb_base.c @@ -2129,14 +2129,15 @@ static int atyfb_pci_resume(struct pci_dev *pdev) static struct backlight_properties aty_bl_data; -/* Call with fb_info->bl_mutex held */ static int aty_bl_get_level_brightness(struct atyfb_par *par, int level) { struct fb_info *info = pci_get_drvdata(par->pdev); int atylevel; /* Get and convert the value */ + mutex_lock(&info->bl_mutex); atylevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL; + mutex_unlock(&info->bl_mutex); if (atylevel < 0) atylevel = 0; @@ -2146,8 +2147,7 @@ static int aty_bl_get_level_brightness(struct atyfb_par *par, int level) return atylevel; } -/* Call with fb_info->bl_mutex held */ -static int __aty_bl_update_status(struct backlight_device *bd) +static int aty_bl_update_status(struct backlight_device *bd) { struct atyfb_par *par = class_get_devdata(&bd->class_dev); unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par); @@ -2172,19 +2172,6 @@ static int __aty_bl_update_status(struct backlight_device *bd) return 0; } -static int aty_bl_update_status(struct backlight_device *bd) -{ - struct atyfb_par *par = class_get_devdata(&bd->class_dev); - struct fb_info *info = pci_get_drvdata(par->pdev); - int ret; - - mutex_lock(&info->bl_mutex); - ret = __aty_bl_update_status(bd); - mutex_unlock(&info->bl_mutex); - - return ret; -} - static int aty_bl_get_brightness(struct backlight_device *bd) { return bd->props->brightness; @@ -2197,16 +2184,6 @@ static struct backlight_properties aty_bl_data = { .max_brightness = (FB_BACKLIGHT_LEVELS - 1), }; -static void aty_bl_set_power(struct fb_info *info, int power) -{ - mutex_lock(&info->bl_mutex); - up(&info->bl_dev->sem); - info->bl_dev->props->power = power; - __aty_bl_update_status(info->bl_dev); - down(&info->bl_dev->sem); - mutex_unlock(&info->bl_mutex); -} - static void aty_bl_init(struct atyfb_par *par) { struct fb_info *info = pci_get_drvdata(par->pdev); @@ -2813,8 +2790,16 @@ static int atyfb_blank(int blank, struct fb_info *info) return 0; #ifdef CONFIG_PMAC_BACKLIGHT - if (machine_is(powermac) && blank > FB_BLANK_NORMAL) - aty_bl_set_power(info, FB_BLANK_POWERDOWN); + if (machine_is(powermac) && blank > FB_BLANK_NORMAL) { + mutex_lock(&info->bl_mutex); + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->power = FB_BLANK_POWERDOWN; + info->bl_dev->props->update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); + } #elif defined(CONFIG_FB_ATY_GENERIC_LCD) if (par->lcd_table && blank > FB_BLANK_NORMAL && (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) { @@ -2845,8 +2830,16 @@ static int atyfb_blank(int blank, struct fb_info *info) aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); #ifdef CONFIG_PMAC_BACKLIGHT - if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) - aty_bl_set_power(info, FB_BLANK_UNBLANK); + if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) { + mutex_lock(&info->bl_mutex); + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->power = FB_BLANK_UNBLANK; + info->bl_dev->props->update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); + } #elif defined(CONFIG_FB_ATY_GENERIC_LCD) if (par->lcd_table && blank <= FB_BLANK_NORMAL && (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) { diff --git a/trunk/drivers/video/aty/radeon_base.c b/trunk/drivers/video/aty/radeon_base.c index 8d85fc58142e..51b78f8de949 100644 --- a/trunk/drivers/video/aty/radeon_base.c +++ b/trunk/drivers/video/aty/radeon_base.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/chipsfb.c b/trunk/drivers/video/chipsfb.c index 73cb426bf2d7..0e465c80ef24 100644 --- a/trunk/drivers/video/chipsfb.c +++ b/trunk/drivers/video/chipsfb.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -149,11 +150,12 @@ static int chipsfb_blank(int blank, struct fb_info *info) mutex_lock(&pmac_backlight_mutex); if (pmac_backlight) { + down(&pmac_backlight->sem); + /* used to disable backlight only for blank > 1, but it seems * useful at blank = 1 too (saves battery, extends backlight * life) */ - down(&pmac_backlight->sem); if (blank) pmac_backlight->props->power = FB_BLANK_POWERDOWN; else diff --git a/trunk/drivers/video/cirrusfb.c b/trunk/drivers/video/cirrusfb.c index daf43f535a0b..7355da09c721 100644 --- a/trunk/drivers/video/cirrusfb.c +++ b/trunk/drivers/video/cirrusfb.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/console/dummycon.c b/trunk/drivers/video/console/dummycon.c index d9315d99445f..878707a04398 100644 --- a/trunk/drivers/video/console/dummycon.c +++ b/trunk/drivers/video/console/dummycon.c @@ -7,9 +7,9 @@ #include #include +#include #include #include -#include #include #include diff --git a/trunk/drivers/video/console/fbcon.c b/trunk/drivers/video/console/fbcon.c index 390439b3d899..94e9f7069bef 100644 --- a/trunk/drivers/video/console/fbcon.c +++ b/trunk/drivers/video/console/fbcon.c @@ -64,6 +64,7 @@ #include #include #include /* MSch: for IRQ probe */ +#include #include #include #include diff --git a/trunk/drivers/video/console/mdacon.c b/trunk/drivers/video/console/mdacon.c index 52ed12b12acc..c89f90edf8ac 100644 --- a/trunk/drivers/video/console/mdacon.c +++ b/trunk/drivers/video/console/mdacon.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/console/newport_con.c b/trunk/drivers/video/console/newport_con.c index 7fa1afeae8dc..03041311711b 100644 --- a/trunk/drivers/video/console/newport_con.c +++ b/trunk/drivers/video/console/newport_con.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/console/promcon.c b/trunk/drivers/video/console/promcon.c index b78eac63459f..5cd5e114d1e6 100644 --- a/trunk/drivers/video/console/promcon.c +++ b/trunk/drivers/video/console/promcon.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/console/softcursor.c b/trunk/drivers/video/console/softcursor.c index 557c563e4aed..3957fc7523e2 100644 --- a/trunk/drivers/video/console/softcursor.c +++ b/trunk/drivers/video/console/softcursor.c @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/trunk/drivers/video/console/sticon.c b/trunk/drivers/video/console/sticon.c index 45586aaabd1e..45c4f227e56e 100644 --- a/trunk/drivers/video/console/sticon.c +++ b/trunk/drivers/video/console/sticon.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/video/console/vgacon.c b/trunk/drivers/video/console/vgacon.c index 0a2c10a1abf8..05735ff4e9c5 100644 --- a/trunk/drivers/video/console/vgacon.c +++ b/trunk/drivers/video/console/vgacon.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include #include