Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/genesis-2.6
Russell King [Mon, 15 Mar 2010 14:27:06 +0000 (14:27 +0000)]
268 files changed:
MAINTAINERS
arch/arm/kernel/perf_event.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-g3evm.c
arch/arm/mach-shmobile/board-g4evm.c
arch/arm/mach-shmobile/clock-sh7367.c
arch/arm/mach-shmobile/intc-sh7367.c
arch/arm/mach-shmobile/intc-sh7372.c
arch/arm/mach-shmobile/intc-sh7377.c
arch/powerpc/kernel/perf_event.c
arch/sparc/kernel/perf_event.c
arch/x86/Kconfig
arch/x86/include/asm/hw_breakpoint.h
arch/x86/include/asm/perf_event.h
arch/x86/kernel/aperture_64.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/cpu/mcheck/mce_intel.c
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/cpu/perf_event_intel.c
arch/x86/kernel/cpu/perf_event_p6.c
arch/x86/kernel/cpu/perfctr-watchdog.c
arch/x86/kernel/dumpstack_64.c
arch/x86/kernel/hw_breakpoint.c
arch/x86/kernel/k8.c
arch/x86/kernel/pci-gart_64.c
arch/x86/kernel/process.c
arch/x86/mm/pageattr.c
arch/x86/oprofile/op_model_amd.c
arch/x86/oprofile/op_model_ppro.c
drivers/char/agp/Kconfig
drivers/hid/hid-input.c
drivers/i2c/Kconfig
drivers/i2c/Makefile
drivers/i2c/algos/i2c-algo-bit.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-powermac.c
drivers/i2c/busses/i2c-xiic.c
drivers/i2c/chips/Kconfig [deleted file]
drivers/i2c/chips/Makefile [deleted file]
drivers/i2c/i2c-smbus.c
drivers/infiniband/core/mad.c
drivers/infiniband/hw/cxgb3/iwch.c
drivers/infiniband/hw/nes/nes_hw.c
drivers/infiniband/hw/nes/nes_hw.h
drivers/infiniband/hw/nes/nes_nic.c
drivers/infiniband/hw/nes/nes_verbs.c
drivers/infiniband/ulp/ipoib/ipoib_cm.c
drivers/infiniband/ulp/ipoib/ipoib_ib.c
drivers/input/evdev.c
drivers/input/input.c
drivers/input/joystick/gamecon.c
drivers/input/keyboard/bf54x-keys.c
drivers/input/misc/Kconfig
drivers/input/misc/Makefile
drivers/input/misc/ati_remote2.c
drivers/input/misc/twl4030-vibra.c [new file with mode: 0644]
drivers/input/misc/winbond-cir.c
drivers/input/misc/wm831x-on.c
drivers/input/mouse/alps.c
drivers/input/mouse/appletouch.c
drivers/input/mousedev.c
drivers/input/serio/i8042-x86ia64io.h
drivers/input/serio/i8042.c
drivers/input/serio/serio_raw.c
drivers/input/sparse-keymap.c
drivers/input/tablet/wacom_sys.c
drivers/input/tablet/wacom_wac.c
drivers/input/tablet/wacom_wac.h
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/ad7877.c
drivers/input/touchscreen/ads7846.c
drivers/media/IR/ir-keytable.c
drivers/media/dvb/dvb-usb/dvb-usb-remote.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/eeprom/at24.c
drivers/misc/tsl2550.c [moved from drivers/i2c/chips/tsl2550.c with 99% similarity]
drivers/mtd/nand/Kconfig
drivers/net/Kconfig
drivers/net/arm/ks8695net.c
drivers/net/benet/be.h
drivers/net/benet/be_cmds.c
drivers/net/benet/be_hw.h
drivers/net/benet/be_main.c
drivers/net/can/bfin_can.c
drivers/net/can/usb/ems_usb.c
drivers/net/cassini.c
drivers/net/cpmac.c
drivers/net/cxgb3/cxgb3_main.c
drivers/net/davinci_emac.c
drivers/net/e1000e/defines.h
drivers/net/e1000e/ich8lan.c
drivers/net/gianfar.c
drivers/net/irda/irda-usb.c
drivers/net/qlcnic/qlcnic.h
drivers/net/qlcnic/qlcnic_ethtool.c
drivers/net/qlcnic/qlcnic_hw.c
drivers/net/qlcnic/qlcnic_init.c
drivers/net/qlcnic/qlcnic_main.c
drivers/net/r8169.c
drivers/net/s2io.c
drivers/net/sky2.c
drivers/net/smc91x.h
drivers/net/tg3.c
drivers/net/tulip/eeprom.c
drivers/net/typhoon.c
drivers/net/usb/asix.c
drivers/net/usb/pegasus.h
drivers/net/wireless/airo.c
drivers/net/wireless/ath/ar9170/ar9170.h
drivers/net/wireless/ath/ar9170/main.c
drivers/net/wireless/ath/ar9170/usb.c
drivers/net/wireless/ath/ath5k/eeprom.c
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/ath/ath5k/reg.h
drivers/net/wireless/ath/ath5k/reset.c
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/ath/ath9k/xmit.c
drivers/net/wireless/ipw2x00/ipw2200.c
drivers/net/wireless/ipw2x00/libipw.h
drivers/net/wireless/ipw2x00/libipw_module.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/rndis_wlan.c
drivers/net/wireless/rt2x00/rt2800pci.c
drivers/net/wireless/rt2x00/rt2x00soc.c
drivers/net/wireless/rt2x00/rt2x00soc.h
drivers/net/wireless/rt2x00/rt73usb.c
drivers/net/wireless/zd1211rw/zd_mac.c
drivers/platform/x86/dell-wmi.c
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/panasonic-laptop.c
drivers/platform/x86/topstar-laptop.c
drivers/platform/x86/toshiba_acpi.c
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_core_sys.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/scsi/qlogicpti.c
drivers/video/Kconfig
drivers/video/Makefile
drivers/video/sunxvr1000.c [new file with mode: 0644]
firmware/bnx2x-e1-5.2.7.0.fw.ihex [deleted file]
firmware/bnx2x-e1h-5.2.7.0.fw.ihex [deleted file]
fs/9p/v9fs.h
fs/9p/vfs_dir.c
fs/9p/vfs_file.c
fs/gfs2/Kconfig
fs/gfs2/file.c
fs/gfs2/incore.h
fs/gfs2/log.c
fs/nilfs2/alloc.h
fs/nilfs2/dat.c
fs/nilfs2/dir.c
fs/nilfs2/gcinode.c
fs/nilfs2/page.c
fs/nilfs2/segbuf.c
fs/nilfs2/segment.c
fs/nilfs2/segment.h
fs/nilfs2/sufile.c
fs/nilfs2/super.c
fs/nilfs2/the_nilfs.c
include/linux/cred.h
include/linux/ethtool.h
include/linux/hw_breakpoint.h
include/linux/i2c-algo-bit.h
include/linux/i2c-xiic.h [new file with mode: 0644]
include/linux/input.h
include/linux/perf_event.h
include/linux/rcupdate.h
include/linux/rfkill.h
include/linux/rwlock.h
include/linux/sched.h
include/linux/snmp.h
include/linux/spi/ads7846.h
include/linux/spinlock.h
include/linux/virtio.h
include/linux/virtio_9p.h
include/net/9p/client.h
include/net/ip6_route.h
include/net/ip6_tunnel.h
include/net/mac80211.h
include/net/sock.h
include/net/tcp.h
include/net/xfrm.h
include/trace/ftrace.h
kernel/exit.c
kernel/fork.c
kernel/hw_breakpoint.c
kernel/lockdep.c
kernel/perf_event.c
kernel/pid.c
kernel/rcutree.h
kernel/rcutree_plugin.h
kernel/sched.c
kernel/sched_fair.c
kernel/sched_rt.c
kernel/trace/ftrace.c
kernel/trace/ring_buffer.c
kernel/trace/trace.c
kernel/trace/trace.h
kernel/trace/trace_clock.c
kernel/trace/trace_event_profile.c
kernel/trace/trace_functions_graph.c
lib/Kconfig.debug
mm/mempolicy.c
net/9p/client.c
net/9p/trans_virtio.c
net/bluetooth/hci_sysfs.c
net/bridge/Kconfig
net/bridge/br_multicast.c
net/core/dev_mcast.c
net/core/ethtool.c
net/core/neighbour.c
net/core/sock.c
net/dccp/minisocks.c
net/ipv4/ip_gre.c
net/ipv4/ipconfig.c
net/ipv4/proc.c
net/ipv4/route.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_output.c
net/ipv4/udp.c
net/ipv4/xfrm4_policy.c
net/ipv6/addrconf.c
net/ipv6/fib6_rules.c
net/ipv6/route.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/xfrm6_policy.c
net/llc/llc_c_ac.c
net/llc/llc_conn.c
net/mac80211/debugfs_netdev.c
net/mac80211/mlme.c
net/mac80211/rate.h
net/mac80211/sta_info.c
net/packet/af_packet.c
net/rfkill/input.c
net/sctp/input.c
net/sctp/socket.c
net/sunrpc/xprtrdma/transport.c
net/sunrpc/xprtsock.c
net/tipc/bearer.c
net/tipc/bearer.h
net/tipc/link.c
net/tipc/net.c
net/tipc/socket.c
net/tipc/subscr.c
net/tipc/subscr.h
net/x25/x25_dev.c
net/xfrm/xfrm_policy.c
samples/hw_breakpoint/data_breakpoint.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_realtek.c
tools/perf/Documentation/perf-lock.txt [new file with mode: 0644]
tools/perf/builtin-lock.c
tools/perf/builtin-trace.c
tools/perf/command-list.txt
tools/perf/perf-archive.sh
tools/perf/perf.h
tools/perf/util/probe-event.c

index fe88b5f..47cc449 100644 (file)
@@ -1405,20 +1405,30 @@ F:      arch/x86/include/asm/calgary.h
 F:     arch/x86/include/asm/tce.h
 
 CAN NETWORK LAYER
-M:     Urs Thuermann <urs.thuermann@volkswagen.de>
+M:     Oliver Hartkopp <socketcan@hartkopp.net>
 M:     Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
-L:     socketcan-core@lists.berlios.de (subscribers-only)
+M:     Urs Thuermann <urs.thuermann@volkswagen.de>
+L:     socketcan-core@lists.berlios.de
+L:     netdev@vger.kernel.org
 W:     http://developer.berlios.de/projects/socketcan/
 S:     Maintained
-F:     drivers/net/can/
-F:     include/linux/can/
+F:     net/can/
 F:     include/linux/can.h
+F:     include/linux/can/core.h
+F:     include/linux/can/bcm.h
+F:     include/linux/can/raw.h
 
 CAN NETWORK DRIVERS
 M:     Wolfgang Grandegger <wg@grandegger.com>
-L:     socketcan-core@lists.berlios.de (subscribers-only)
+L:     socketcan-core@lists.berlios.de
+L:     netdev@vger.kernel.org
 W:     http://developer.berlios.de/projects/socketcan/
 S:     Maintained
+F:     drivers/net/can/
+F:     include/linux/can/dev.h
+F:     include/linux/can/error.h
+F:     include/linux/can/netlink.h
+F:     include/linux/can/platform/
 
 CELL BROADBAND ENGINE ARCHITECTURE
 M:     Arnd Bergmann <arnd@arndb.de>
@@ -2130,6 +2140,7 @@ F:        drivers/net/eexpress.*
 ETHERNET BRIDGE
 M:     Stephen Hemminger <shemminger@linux-foundation.org>
 L:     bridge@lists.linux-foundation.org
+L:     netdev@vger.kernel.org
 W:     http://www.linux-foundation.org/en/Net:Bridge
 S:     Maintained
 F:     include/linux/netfilter_bridge/
@@ -4316,6 +4327,7 @@ PERFORMANCE EVENTS SUBSYSTEM
 M:     Peter Zijlstra <a.p.zijlstra@chello.nl>
 M:     Paul Mackerras <paulus@samba.org>
 M:     Ingo Molnar <mingo@elte.hu>
+M:     Arnaldo Carvalho de Melo <acme@redhat.com>
 S:     Supported
 F:     kernel/perf_event.c
 F:     include/linux/perf_event.h
index c45a155..9e70f20 100644 (file)
@@ -966,7 +966,7 @@ armv6pmu_handle_irq(int irq_num,
         */
        armv6_pmcr_write(pmcr);
 
-       data.addr = 0;
+       perf_sample_data_init(&data, 0);
 
        cpuc = &__get_cpu_var(cpu_hw_events);
        for (idx = 0; idx <= armpmu->num_events; ++idx) {
@@ -1946,7 +1946,7 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
         */
        regs = get_irq_regs();
 
-       data.addr = 0;
+       perf_sample_data_init(&data, 0);
 
        cpuc = &__get_cpu_var(cpu_hw_events);
        for (idx = 0; idx <= armpmu->num_events; ++idx) {
index a0463d9..1c2ec96 100644 (file)
@@ -206,10 +206,32 @@ static struct platform_device keysc_device = {
        },
 };
 
+/* SDHI0 */
+static struct resource sdhi0_resources[] = {
+       [0] = {
+               .name   = "SDHI0",
+               .start  = 0xe6850000,
+               .end    = 0xe68501ff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 96,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sdhi0_device = {
+       .name           = "sh_mobile_sdhi",
+       .num_resources  = ARRAY_SIZE(sdhi0_resources),
+       .resource       = sdhi0_resources,
+       .id             = 0,
+};
+
 static struct platform_device *ap4evb_devices[] __initdata = {
        &nor_flash_device,
        &smc911x_device,
        &keysc_device,
+       &sdhi0_device,
 };
 
 static struct map_desc ap4evb_io_desc[] __initdata = {
@@ -286,6 +308,16 @@ static void __init ap4evb_init(void)
        gpio_request(GPIO_FN_KEYIN3_133, NULL);
        gpio_request(GPIO_FN_KEYIN4,     NULL);
 
+       /* SDHI0 */
+       gpio_request(GPIO_FN_SDHICD0, NULL);
+       gpio_request(GPIO_FN_SDHIWP0, NULL);
+       gpio_request(GPIO_FN_SDHICMD0, NULL);
+       gpio_request(GPIO_FN_SDHICLK0, NULL);
+       gpio_request(GPIO_FN_SDHID0_3, NULL);
+       gpio_request(GPIO_FN_SDHID0_2, NULL);
+       gpio_request(GPIO_FN_SDHID0_1, NULL);
+       gpio_request(GPIO_FN_SDHID0_0, NULL);
+
        sh7372_add_standard_devices();
 
        platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
index f36c9a9..9247503 100644 (file)
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
+#include <linux/mtd/sh_flctl.h>
 #include <linux/usb/r8a66597.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/input.h>
+#include <linux/input/sh_keysc.h>
 #include <mach/sh7367.h>
 #include <mach/common.h>
 #include <asm/mach-types.h>
@@ -127,9 +130,90 @@ static struct platform_device usb_host_device = {
        .resource       = usb_host_resources,
 };
 
+/* KEYSC */
+static struct sh_keysc_info keysc_info = {
+       .mode           = SH_KEYSC_MODE_5,
+       .scan_timing    = 3,
+       .delay          = 100,
+       .keycodes = {
+               KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
+               KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
+               KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
+               KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
+               KEY_WAKEUP, KEY_COFFEE, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4,
+               KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
+       },
+};
+
+static struct resource keysc_resources[] = {
+       [0] = {
+               .name   = "KEYSC",
+               .start  = 0xe61b0000,
+               .end    = 0xe61b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device keysc_device = {
+       .name           = "sh_keysc",
+       .num_resources  = ARRAY_SIZE(keysc_resources),
+       .resource       = keysc_resources,
+       .dev    = {
+               .platform_data  = &keysc_info,
+       },
+};
+
+static struct mtd_partition nand_partition_info[] = {
+       {
+               .name   = "system",
+               .offset = 0,
+               .size   = 64 * 1024 * 1024,
+       },
+       {
+               .name   = "userdata",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = 128 * 1024 * 1024,
+       },
+       {
+               .name   = "cache",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = 64 * 1024 * 1024,
+       },
+};
+
+static struct resource nand_flash_resources[] = {
+       [0] = {
+               .start  = 0xe6a30000,
+               .end    = 0xe6a3009b,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct sh_flctl_platform_data nand_flash_data = {
+       .parts          = nand_partition_info,
+       .nr_parts       = ARRAY_SIZE(nand_partition_info),
+       .flcmncr_val    = QTSEL_E | FCKSEL_E | TYPESEL_SET | NANWF_E
+                       | SHBUSSEL | SEL_16BIT,
+};
+
+static struct platform_device nand_flash_device = {
+       .name           = "sh_flctl",
+       .resource       = nand_flash_resources,
+       .num_resources  = ARRAY_SIZE(nand_flash_resources),
+       .dev            = {
+               .platform_data = &nand_flash_data,
+       },
+};
+
 static struct platform_device *g3evm_devices[] __initdata = {
        &nor_flash_device,
        &usb_host_device,
+       &keysc_device,
+       &nand_flash_device,
 };
 
 static struct map_desc g3evm_io_desc[] __initdata = {
@@ -196,6 +280,44 @@ static void __init g3evm_init(void)
        __raw_writew(0x6010, 0xe60581c6);       /* CGPOSR */
        __raw_writew(0x8a0a, 0xe605810c);       /* USBCR2 */
 
+       /* KEYSC @ CN7 */
+       gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL);
+       gpio_request(GPIO_FN_PORT43_KEYOUT1, NULL);
+       gpio_request(GPIO_FN_PORT44_KEYOUT2, NULL);
+       gpio_request(GPIO_FN_PORT45_KEYOUT3, NULL);
+       gpio_request(GPIO_FN_PORT46_KEYOUT4, NULL);
+       gpio_request(GPIO_FN_PORT47_KEYOUT5, NULL);
+       gpio_request(GPIO_FN_PORT48_KEYIN0_PU, NULL);
+       gpio_request(GPIO_FN_PORT49_KEYIN1_PU, NULL);
+       gpio_request(GPIO_FN_PORT50_KEYIN2_PU, NULL);
+       gpio_request(GPIO_FN_PORT55_KEYIN3_PU, NULL);
+       gpio_request(GPIO_FN_PORT56_KEYIN4_PU, NULL);
+       gpio_request(GPIO_FN_PORT57_KEYIN5_PU, NULL);
+       gpio_request(GPIO_FN_PORT58_KEYIN6_PU, NULL);
+
+       /* FLCTL */
+       gpio_request(GPIO_FN_FCE0, NULL);
+       gpio_request(GPIO_FN_D0_ED0_NAF0, NULL);
+       gpio_request(GPIO_FN_D1_ED1_NAF1, NULL);
+       gpio_request(GPIO_FN_D2_ED2_NAF2, NULL);
+       gpio_request(GPIO_FN_D3_ED3_NAF3, NULL);
+       gpio_request(GPIO_FN_D4_ED4_NAF4, NULL);
+       gpio_request(GPIO_FN_D5_ED5_NAF5, NULL);
+       gpio_request(GPIO_FN_D6_ED6_NAF6, NULL);
+       gpio_request(GPIO_FN_D7_ED7_NAF7, NULL);
+       gpio_request(GPIO_FN_D8_ED8_NAF8, NULL);
+       gpio_request(GPIO_FN_D9_ED9_NAF9, NULL);
+       gpio_request(GPIO_FN_D10_ED10_NAF10, NULL);
+       gpio_request(GPIO_FN_D11_ED11_NAF11, NULL);
+       gpio_request(GPIO_FN_D12_ED12_NAF12, NULL);
+       gpio_request(GPIO_FN_D13_ED13_NAF13, NULL);
+       gpio_request(GPIO_FN_D14_ED14_NAF14, NULL);
+       gpio_request(GPIO_FN_D15_ED15_NAF15, NULL);
+       gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL);
+       gpio_request(GPIO_FN_FRB, NULL);
+       /* FOE, FCDE, FSC on dedicated pins */
+       __raw_writel(__raw_readl(0xe6158048) & ~(1 << 15), 0xe6158048);
+
        sh7367_add_standard_devices();
 
        platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));
index 5acd623..10673a9 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/mtd/physmap.h>
 #include <linux/usb/r8a66597.h>
 #include <linux/io.h>
+#include <linux/input.h>
+#include <linux/input/sh_keysc.h>
 #include <linux/gpio.h>
 #include <mach/sh7377.h>
 #include <mach/common.h>
@@ -128,9 +130,49 @@ static struct platform_device usb_host_device = {
        .resource       = usb_host_resources,
 };
 
+/* KEYSC */
+static struct sh_keysc_info keysc_info = {
+       .mode           = SH_KEYSC_MODE_5,
+       .scan_timing    = 3,
+       .delay          = 100,
+       .keycodes = {
+               KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F,
+               KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L,
+               KEY_M, KEY_N, KEY_U, KEY_P, KEY_Q, KEY_R,
+               KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X,
+               KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE,
+               KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,
+               KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
+       },
+};
+
+static struct resource keysc_resources[] = {
+       [0] = {
+               .name   = "KEYSC",
+               .start  = 0xe61b0000,
+               .end    = 0xe61b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device keysc_device = {
+       .name           = "sh_keysc",
+       .id             = 0, /* keysc0 clock */
+       .num_resources  = ARRAY_SIZE(keysc_resources),
+       .resource       = keysc_resources,
+       .dev    = {
+               .platform_data  = &keysc_info,
+       },
+};
+
 static struct platform_device *g4evm_devices[] __initdata = {
        &nor_flash_device,
        &usb_host_device,
+       &keysc_device,
 };
 
 static struct map_desc g4evm_io_desc[] __initdata = {
@@ -196,6 +238,21 @@ static void __init g4evm_init(void)
        __raw_writew(0x6010, 0xe60581c6);       /* CGPOSR */
        __raw_writew(0x8a0a, 0xe605810c);       /* USBCR2 */
 
+       /* KEYSC @ CN31 */
+       gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL);
+       gpio_request(GPIO_FN_PORT61_KEYOUT4, NULL);
+       gpio_request(GPIO_FN_PORT62_KEYOUT3, NULL);
+       gpio_request(GPIO_FN_PORT63_KEYOUT2, NULL);
+       gpio_request(GPIO_FN_PORT64_KEYOUT1, NULL);
+       gpio_request(GPIO_FN_PORT65_KEYOUT0, NULL);
+       gpio_request(GPIO_FN_PORT66_KEYIN0_PU, NULL);
+       gpio_request(GPIO_FN_PORT67_KEYIN1_PU, NULL);
+       gpio_request(GPIO_FN_PORT68_KEYIN2_PU, NULL);
+       gpio_request(GPIO_FN_PORT69_KEYIN3_PU, NULL);
+       gpio_request(GPIO_FN_PORT70_KEYIN4_PU, NULL);
+       gpio_request(GPIO_FN_PORT71_KEYIN5_PU, NULL);
+       gpio_request(GPIO_FN_PORT72_KEYIN6_PU, NULL);
+
        sh7377_add_standard_devices();
 
        platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices));
index 58bd54e..bb940c6 100644 (file)
@@ -75,6 +75,11 @@ static struct clk usb0_clk = {
        .name       = "usb0",
 };
 
+/* a static keysc0 clk for now - enough to get sh_keysc working */
+static struct clk keysc0_clk = {
+       .name       = "keysc0",
+};
+
 static struct clk_lookup lookups[] = {
        {
                .clk = &peripheral_clk,
@@ -82,6 +87,8 @@ static struct clk_lookup lookups[] = {
                .clk = &r_clk,
        }, {
                .clk = &usb0_clk,
+       }, {
+               .clk = &keysc0_clk,
        }
 };
 
index 6a547b4..5ff70ca 100644 (file)
@@ -27,6 +27,8 @@
 
 enum {
        UNUSED_INTCA = 0,
+       ENABLED,
+       DISABLED,
 
        /* interrupt sources INTCA */
        IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
@@ -46,8 +48,8 @@ enum {
        MSIOF2, MSIOF1,
        SCIFA4, SCIFA5, SCIFB,
        FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
-       SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
-       SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2, SDHI1_SDHI1I3,
+       SDHI0,
+       SDHI1,
        MSU_MSU, MSU_MSU2,
        IREM,
        SIU,
@@ -59,7 +61,7 @@ enum {
        TTI20,
        MISTY,
        DDM,
-       SDHI2_SDHI2I0, SDHI2_SDHI2I1, SDHI2_SDHI2I2, SDHI2_SDHI2I3,
+       SDHI2,
        RWDT0, RWDT1,
        DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
        DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
@@ -70,7 +72,7 @@ enum {
 
        /* interrupt groups INTCA */
        DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2,
-       ETM11, ARM11, USBHS, FLCTL, IIC1, SDHI0, SDHI1, SDHI2,
+       ETM11, ARM11, USBHS, FLCTL, IIC1
 };
 
 static struct intc_vect intca_vectors[] = {
@@ -105,10 +107,10 @@ static struct intc_vect intca_vectors[] = {
        INTC_VECT(SCIFB, 0x0d60),
        INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
        INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
-       INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
-       INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
-       INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
-       INTC_VECT(SDHI1_SDHI1I2, 0x0ec0), INTC_VECT(SDHI1_SDHI1I3, 0x0ee0),
+       INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
+       INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
+       INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
+       INTC_VECT(SDHI1, 0x0ec0), INTC_VECT(SDHI1, 0x0ee0),
        INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
        INTC_VECT(IREM, 0x0f60),
        INTC_VECT(SIU, 0x0fa0),
@@ -122,8 +124,8 @@ static struct intc_vect intca_vectors[] = {
        INTC_VECT(TTI20, 0x1100),
        INTC_VECT(MISTY, 0x1120),
        INTC_VECT(DDM, 0x1140),
-       INTC_VECT(SDHI2_SDHI2I0, 0x1200), INTC_VECT(SDHI2_SDHI2I1, 0x1220),
-       INTC_VECT(SDHI2_SDHI2I2, 0x1240), INTC_VECT(SDHI2_SDHI2I3, 0x1260),
+       INTC_VECT(SDHI2, 0x1200), INTC_VECT(SDHI2, 0x1220),
+       INTC_VECT(SDHI2, 0x1240), INTC_VECT(SDHI2, 0x1260),
        INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
        INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
        INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
@@ -158,12 +160,6 @@ static struct intc_group intca_groups[] __initdata = {
        INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
                   FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
        INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
-       INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
-                  SDHI0_SDHI0I2, SDHI0_SDHI0I3),
-       INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
-                  SDHI1_SDHI1I2, SDHI1_SDHI1I3),
-       INTC_GROUP(SDHI2, SDHI2_SDHI2I0, SDHI2_SDHI2I1,
-                  SDHI2_SDHI2I2, SDHI2_SDHI2I3),
 };
 
 static struct intc_mask_reg intca_mask_registers[] = {
@@ -193,10 +189,10 @@ static struct intc_mask_reg intca_mask_registers[] = {
          { SCIFB, SCIFA5, SCIFA4, MSIOF1,
            0, 0, MSIOF2, 0 } },
        { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
-         { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
+         { DISABLED, DISABLED, ENABLED, ENABLED,
            FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
        { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
-         { SDHI1_SDHI1I3, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
+         { DISABLED, DISABLED, ENABLED, ENABLED,
            TTI20, USBDMAC_USHDMI, SPU, SIU } },
        { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
          { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
@@ -211,7 +207,7 @@ static struct intc_mask_reg intca_mask_registers[] = {
          { 0, 0, TPU0, TPU1,
            TPU2, TPU3, TPU4, 0 } },
        { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
-         { SDHI2_SDHI2I3, SDHI2_SDHI2I2, SDHI2_SDHI2I1, SDHI2_SDHI2I0,
+         { DISABLED, DISABLED, ENABLED, ENABLED,
            MISTY, CMT3, RWDT1, RWDT0 } },
 };
 
@@ -258,10 +254,14 @@ static struct intc_mask_reg intca_ack_registers[] __initdata = {
          { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
 };
 
-static DECLARE_INTC_DESC_ACK(intca_desc, "sh7367-intca",
-                            intca_vectors, intca_groups,
-                            intca_mask_registers, intca_prio_registers,
-                            intca_sense_registers, intca_ack_registers);
+static struct intc_desc intca_desc __initdata = {
+       .name = "sh7367-intca",
+       .force_enable = ENABLED,
+       .force_disable = DISABLED,
+       .hw = INTC_HW_DESC(intca_vectors, intca_groups,
+                          intca_mask_registers, intca_prio_registers,
+                          intca_sense_registers, intca_ack_registers),
+};
 
 void __init sh7367_init_irq(void)
 {
index c57a923..3ce9d9b 100644 (file)
@@ -27,6 +27,8 @@
 
 enum {
        UNUSED_INTCA = 0,
+       ENABLED,
+       DISABLED,
 
        /* interrupt sources INTCA */
        IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
@@ -47,14 +49,14 @@ enum {
        MSIOF2, MSIOF1,
        SCIFA4, SCIFA5, SCIFB,
        FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
-       SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
-       SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2,
+       SDHI0,
+       SDHI1,
        IRREM,
        IRDA,
        TPU0,
        TTI20,
        DDM,
-       SDHI2_SDHI2I0, SDHI2_SDHI2I1, SDHI2_SDHI2I2, SDHI2_SDHI2I3,
+       SDHI2,
        RWDT0,
        DMAC1_1_DEI0, DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3,
        DMAC1_2_DEI4, DMAC1_2_DEI5, DMAC1_2_DADERR,
@@ -82,7 +84,7 @@ enum {
 
        /* interrupt groups INTCA */
        DMAC1_1, DMAC1_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
-       AP_ARM1, AP_ARM2, SPU2, FLCTL, IIC1, SDHI0, SDHI1, SDHI2
+       AP_ARM1, AP_ARM2, SPU2, FLCTL, IIC1
 };
 
 static struct intc_vect intca_vectors[] __initdata = {
@@ -123,17 +125,17 @@ static struct intc_vect intca_vectors[] __initdata = {
        INTC_VECT(SCIFB, 0x0d60),
        INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
        INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
-       INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
-       INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
-       INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
-       INTC_VECT(SDHI1_SDHI1I2, 0x0ec0),
+       INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
+       INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
+       INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
+       INTC_VECT(SDHI1, 0x0ec0),
        INTC_VECT(IRREM, 0x0f60),
        INTC_VECT(IRDA, 0x0480),
        INTC_VECT(TPU0, 0x04a0),
        INTC_VECT(TTI20, 0x1100),
        INTC_VECT(DDM, 0x1140),
-       INTC_VECT(SDHI2_SDHI2I0, 0x1200), INTC_VECT(SDHI2_SDHI2I1, 0x1220),
-       INTC_VECT(SDHI2_SDHI2I2, 0x1240), INTC_VECT(SDHI2_SDHI2I3, 0x1260),
+       INTC_VECT(SDHI2, 0x1200), INTC_VECT(SDHI2, 0x1220),
+       INTC_VECT(SDHI2, 0x1240), INTC_VECT(SDHI2, 0x1260),
        INTC_VECT(RWDT0, 0x1280),
        INTC_VECT(DMAC1_1_DEI0, 0x2000), INTC_VECT(DMAC1_1_DEI1, 0x2020),
        INTC_VECT(DMAC1_1_DEI2, 0x2040), INTC_VECT(DMAC1_1_DEI3, 0x2060),
@@ -193,12 +195,6 @@ static struct intc_group intca_groups[] __initdata = {
        INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
                   FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
        INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
-       INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
-                  SDHI0_SDHI0I2, SDHI0_SDHI0I3),
-       INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
-                  SDHI1_SDHI1I2),
-       INTC_GROUP(SDHI2, SDHI2_SDHI2I0, SDHI2_SDHI2I1,
-                  SDHI2_SDHI2I2, SDHI2_SDHI2I3),
        INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
 };
 
@@ -234,10 +230,10 @@ static struct intc_mask_reg intca_mask_registers[] __initdata = {
          { SCIFB, SCIFA5, SCIFA4, MSIOF1,
            0, 0, MSIOF2, 0 } },
        { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
-         { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
+         { DISABLED, DISABLED, ENABLED, ENABLED,
            FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
        { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
-         { 0, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
+         { 0, DISABLED, ENABLED, ENABLED,
            TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
        { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
          { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
@@ -252,7 +248,7 @@ static struct intc_mask_reg intca_mask_registers[] __initdata = {
          { 0, 0, TPU0, 0,
            0, 0, 0, 0 } },
        { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
-         { SDHI2_SDHI2I3, SDHI2_SDHI2I2, SDHI2_SDHI2I1, SDHI2_SDHI2I0,
+         { DISABLED, DISABLED, ENABLED, ENABLED,
            0, CMT3, 0, RWDT0 } },
        { 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */
          { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
@@ -358,10 +354,14 @@ static struct intc_mask_reg intca_ack_registers[] __initdata = {
          { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
 };
 
-static DECLARE_INTC_DESC_ACK(intca_desc, "sh7372-intca",
-                            intca_vectors, intca_groups,
-                            intca_mask_registers, intca_prio_registers,
-                            intca_sense_registers, intca_ack_registers);
+static struct intc_desc intca_desc __initdata = {
+       .name = "sh7372-intca",
+       .force_enable = ENABLED,
+       .force_disable = DISABLED,
+       .hw = INTC_HW_DESC(intca_vectors, intca_groups,
+                          intca_mask_registers, intca_prio_registers,
+                          intca_sense_registers, intca_ack_registers),
+};
 
 void __init sh7372_init_irq(void)
 {
index 125021c..5c781e2 100644 (file)
@@ -27,6 +27,8 @@
 
 enum {
        UNUSED_INTCA = 0,
+       ENABLED,
+       DISABLED,
 
        /* interrupt sources INTCA */
        IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
@@ -49,8 +51,8 @@ enum {
        MSIOF2, MSIOF1,
        SCIFA4, SCIFA5, SCIFB,
        FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
-       SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
-       SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2, SDHI1_SDHI1I3,
+       SDHI0,
+       SDHI1,
        MSU_MSU, MSU_MSU2,
        IRREM,
        MSUG,
@@ -84,7 +86,7 @@ enum {
 
        /* interrupt groups INTCA */
        DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
-       AP_ARM1, AP_ARM2, USBHS, SPU2, FLCTL, IIC1, SDHI0, SDHI1,
+       AP_ARM1, AP_ARM2, USBHS, SPU2, FLCTL, IIC1,
        ICUSB, ICUDMC
 };
 
@@ -128,10 +130,10 @@ static struct intc_vect intca_vectors[] = {
        INTC_VECT(SCIFB, 0x0d60),
        INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
        INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
-       INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
-       INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
-       INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
-       INTC_VECT(SDHI1_SDHI1I2, 0x0ec0), INTC_VECT(SDHI1_SDHI1I3, 0x0ee0),
+       INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
+       INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
+       INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
+       INTC_VECT(SDHI1, 0x0ec0), INTC_VECT(SDHI1, 0x0ee0),
        INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
        INTC_VECT(IRREM, 0x0f60),
        INTC_VECT(MSUG, 0x0fa0),
@@ -195,10 +197,6 @@ static struct intc_group intca_groups[] __initdata = {
        INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
                   FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
        INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
-       INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
-                  SDHI0_SDHI0I2, SDHI0_SDHI0I3),
-       INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
-                  SDHI1_SDHI1I2, SDHI1_SDHI1I3),
        INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
        INTC_GROUP(ICUSB, ICUSB_ICUSB0, ICUSB_ICUSB1),
        INTC_GROUP(ICUDMC, ICUDMC_ICUDMC1, ICUDMC_ICUDMC2),
@@ -236,10 +234,10 @@ static struct intc_mask_reg intca_mask_registers[] = {
          { SCIFB, SCIFA5, SCIFA4, MSIOF1,
            0, 0, MSIOF2, 0 } },
        { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
-         { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
+         { DISABLED, DISABLED, ENABLED, ENABLED,
            FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
        { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
-         { SDHI1_SDHI1I3, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
+         { DISABLED, DISABLED, ENABLED, ENABLED,
            TTI20, USBDMAC_USHDMI, 0, MSUG } },
        { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
          { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
@@ -339,10 +337,14 @@ static struct intc_mask_reg intca_ack_registers[] __initdata = {
          { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
 };
 
-static DECLARE_INTC_DESC_ACK(intca_desc, "sh7377-intca",
-                            intca_vectors, intca_groups,
-                            intca_mask_registers, intca_prio_registers,
-                            intca_sense_registers, intca_ack_registers);
+static struct intc_desc intca_desc __initdata = {
+       .name = "sh7377-intca",
+       .force_enable = ENABLED,
+       .force_disable = DISABLED,
+       .hw = INTC_HW_DESC(intca_vectors, intca_groups,
+                          intca_mask_registers, intca_prio_registers,
+                          intca_sense_registers, intca_ack_registers),
+};
 
 void __init sh7377_init_irq(void)
 {
index b6cf8f1..5120bd4 100644 (file)
@@ -1164,10 +1164,10 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
         * Finally record data if requested.
         */
        if (record) {
-               struct perf_sample_data data = {
-                       .addr   = ~0ULL,
-                       .period = event->hw.last_period,
-               };
+               struct perf_sample_data data;
+
+               perf_sample_data_init(&data, ~0ULL);
+               data.period = event->hw.last_period;
 
                if (event->attr.sample_type & PERF_SAMPLE_ADDR)
                        perf_get_data_addr(regs, &data.addr);
index b867ab3..68cb9b4 100644 (file)
@@ -1189,7 +1189,7 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,
 
        regs = args->regs;
 
-       data.addr = 0;
+       perf_sample_data_init(&data, 0);
 
        cpuc = &__get_cpu_var(cpu_hw_events);
 
index 93936de..0eacb1f 100644 (file)
@@ -662,7 +662,7 @@ config GART_IOMMU
        bool "GART IOMMU support" if EMBEDDED
        default y
        select SWIOTLB
-       depends on X86_64 && PCI
+       depends on X86_64 && PCI && K8_NB
        ---help---
          Support for full DMA access of devices with 32bit memory access only
          on systems with more than 3GB. This is usually needed for USB,
@@ -2061,7 +2061,7 @@ endif # X86_32
 
 config K8_NB
        def_bool y
-       depends on AGP_AMD64 || (X86_64 && (GART_IOMMU || (PCI && NUMA)))
+       depends on CPU_SUP_AMD && PCI
 
 source "drivers/pcmcia/Kconfig"
 
index 0675a7c..2a1bd8f 100644 (file)
@@ -10,7 +10,6 @@
  * (display/resolving)
  */
 struct arch_hw_breakpoint {
-       char            *name; /* Contains name of the symbol to set bkpt */
        unsigned long   address;
        u8              len;
        u8              type;
index befd172..db6109a 100644 (file)
@@ -18,7 +18,7 @@
 #define MSR_ARCH_PERFMON_EVENTSEL0                          0x186
 #define MSR_ARCH_PERFMON_EVENTSEL1                          0x187
 
-#define ARCH_PERFMON_EVENTSEL0_ENABLE                    (1 << 22)
+#define ARCH_PERFMON_EVENTSEL_ENABLE                     (1 << 22)
 #define ARCH_PERFMON_EVENTSEL_ANY                        (1 << 21)
 #define ARCH_PERFMON_EVENTSEL_INT                        (1 << 20)
 #define ARCH_PERFMON_EVENTSEL_OS                         (1 << 17)
@@ -50,7 +50,7 @@
         INTEL_ARCH_INV_MASK| \
         INTEL_ARCH_EDGE_MASK|\
         INTEL_ARCH_UNIT_MASK|\
-        INTEL_ARCH_EVTSEL_MASK)
+        INTEL_ARCH_EVENT_MASK)
 
 #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL                0x3c
 #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK                (0x00 << 8)
@@ -117,6 +117,18 @@ union cpuid10_edx {
  */
 #define X86_PMC_IDX_FIXED_BTS                          (X86_PMC_IDX_FIXED + 16)
 
+/* IbsFetchCtl bits/masks */
+#define IBS_FETCH_RAND_EN              (1ULL<<57)
+#define IBS_FETCH_VAL                  (1ULL<<49)
+#define IBS_FETCH_ENABLE               (1ULL<<48)
+#define IBS_FETCH_CNT                  0xFFFF0000ULL
+#define IBS_FETCH_MAX_CNT              0x0000FFFFULL
+
+/* IbsOpCtl bits */
+#define IBS_OP_CNT_CTL                 (1ULL<<19)
+#define IBS_OP_VAL                     (1ULL<<18)
+#define IBS_OP_ENABLE                  (1ULL<<17)
+#define IBS_OP_MAX_CNT                 0x0000FFFFULL
 
 #ifdef CONFIG_PERF_EVENTS
 extern void init_hw_perf_events(void);
index f147a95..3704997 100644 (file)
@@ -31,7 +31,6 @@
 #include <asm/x86_init.h>
 
 int gart_iommu_aperture;
-EXPORT_SYMBOL_GPL(gart_iommu_aperture);
 int gart_iommu_aperture_disabled __initdata;
 int gart_iommu_aperture_allowed __initdata;
 
index 3740c8a..49dbeae 100644 (file)
@@ -120,11 +120,9 @@ EXPORT_SYMBOL_GPL(uv_possible_blades);
 unsigned long sn_rtc_cycles_per_second;
 EXPORT_SYMBOL(sn_rtc_cycles_per_second);
 
-/* Start with all IRQs pointing to boot CPU.  IRQ balancing will shift them. */
-
 static const struct cpumask *uv_target_cpus(void)
 {
-       return cpumask_of(0);
+       return cpu_online_mask;
 }
 
 static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask)
index 879666f..7e1cca1 100644 (file)
@@ -70,7 +70,8 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
        if (c->x86_power & (1 << 8)) {
                set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
                set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
-               sched_clock_stable = 1;
+               if (!check_tsc_unstable())
+                       sched_clock_stable = 1;
        }
 
        /*
index 28cba46..3ab9c88 100644 (file)
 
 #include "mce-internal.h"
 
+static DEFINE_MUTEX(mce_read_mutex);
+
+#define rcu_dereference_check_mce(p) \
+       rcu_dereference_check((p), \
+                             rcu_read_lock_sched_held() || \
+                             lockdep_is_held(&mce_read_mutex))
+
 #define CREATE_TRACE_POINTS
 #include <trace/events/mce.h>
 
@@ -158,7 +165,7 @@ void mce_log(struct mce *mce)
        mce->finished = 0;
        wmb();
        for (;;) {
-               entry = rcu_dereference(mcelog.next);
+               entry = rcu_dereference_check_mce(mcelog.next);
                for (;;) {
                        /*
                         * When the buffer fills up discard new entries.
@@ -1485,8 +1492,6 @@ static void collect_tscs(void *data)
        rdtscll(cpu_tsc[smp_processor_id()]);
 }
 
-static DEFINE_MUTEX(mce_read_mutex);
-
 static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
                        loff_t *off)
 {
@@ -1500,7 +1505,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
                return -ENOMEM;
 
        mutex_lock(&mce_read_mutex);
-       next = rcu_dereference(mcelog.next);
+       next = rcu_dereference_check_mce(mcelog.next);
 
        /* Only supports full reads right now */
        if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) {
@@ -1565,7 +1570,7 @@ timeout:
 static unsigned int mce_poll(struct file *file, poll_table *wait)
 {
        poll_wait(file, &mce_wait, wait);
-       if (rcu_dereference(mcelog.next))
+       if (rcu_dereference_check_mce(mcelog.next))
                return POLLIN | POLLRDNORM;
        return 0;
 }
index 7c78563..d15df6e 100644 (file)
@@ -95,7 +95,7 @@ static void cmci_discover(int banks, int boot)
 
                /* Already owned by someone else? */
                if (val & CMCI_EN) {
-                       if (test_and_clear_bit(i, owned) || boot)
+                       if (test_and_clear_bit(i, owned) && !boot)
                                print_update("SHD", &hdr, i);
                        __clear_bit(i, __get_cpu_var(mce_poll_banks));
                        continue;
@@ -107,7 +107,7 @@ static void cmci_discover(int banks, int boot)
 
                /* Did the enable bit stick? -- the bank supports CMCI */
                if (val & CMCI_EN) {
-                       if (!test_and_set_bit(i, owned) || boot)
+                       if (!test_and_set_bit(i, owned) && !boot)
                                print_update("CMCI", &hdr, i);
                        __clear_bit(i, __get_cpu_var(mce_poll_banks));
                } else {
index b1fbdee..42aafd1 100644 (file)
@@ -73,10 +73,10 @@ struct debug_store {
 struct event_constraint {
        union {
                unsigned long   idxmsk[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
-               u64             idxmsk64[1];
+               u64             idxmsk64;
        };
-       int     code;
-       int     cmask;
+       u64     code;
+       u64     cmask;
        int     weight;
 };
 
@@ -103,7 +103,7 @@ struct cpu_hw_events {
 };
 
 #define __EVENT_CONSTRAINT(c, n, m, w) {\
-       { .idxmsk64[0] = (n) },         \
+       { .idxmsk64 = (n) },            \
        .code = (c),                    \
        .cmask = (m),                   \
        .weight = (w),                  \
@@ -116,7 +116,7 @@ struct cpu_hw_events {
        EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVTSEL_MASK)
 
 #define FIXED_EVENT_CONSTRAINT(c, n)   \
-       EVENT_CONSTRAINT(c, n, INTEL_ARCH_FIXED_MASK)
+       EVENT_CONSTRAINT(c, (1ULL << (32+n)), INTEL_ARCH_FIXED_MASK)
 
 #define EVENT_CONSTRAINT_END           \
        EVENT_CONSTRAINT(0, 0, 0)
@@ -503,6 +503,9 @@ static int __hw_perf_event_init(struct perf_event *event)
         */
        if (attr->type == PERF_TYPE_RAW) {
                hwc->config |= x86_pmu.raw_event(attr->config);
+               if ((hwc->config & ARCH_PERFMON_EVENTSEL_ANY) &&
+                   perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN))
+                       return -EACCES;
                return 0;
        }
 
@@ -553,9 +556,9 @@ static void x86_pmu_disable_all(void)
                if (!test_bit(idx, cpuc->active_mask))
                        continue;
                rdmsrl(x86_pmu.eventsel + idx, val);
-               if (!(val & ARCH_PERFMON_EVENTSEL0_ENABLE))
+               if (!(val & ARCH_PERFMON_EVENTSEL_ENABLE))
                        continue;
-               val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
+               val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
                wrmsrl(x86_pmu.eventsel + idx, val);
        }
 }
@@ -590,7 +593,7 @@ static void x86_pmu_enable_all(void)
                        continue;
 
                val = event->hw.config;
-               val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
+               val |= ARCH_PERFMON_EVENTSEL_ENABLE;
                wrmsrl(x86_pmu.eventsel + idx, val);
        }
 }
@@ -612,8 +615,8 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
        bitmap_zero(used_mask, X86_PMC_IDX_MAX);
 
        for (i = 0; i < n; i++) {
-               constraints[i] =
-                 x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]);
+               c = x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]);
+               constraints[i] = c;
        }
 
        /*
@@ -853,7 +856,7 @@ void hw_perf_enable(void)
 static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc, int idx)
 {
        (void)checking_wrmsrl(hwc->config_base + idx,
-                             hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE);
+                             hwc->config | ARCH_PERFMON_EVENTSEL_ENABLE);
 }
 
 static inline void x86_pmu_disable_event(struct hw_perf_event *hwc, int idx)
@@ -1094,8 +1097,7 @@ static int x86_pmu_handle_irq(struct pt_regs *regs)
        int idx, handled = 0;
        u64 val;
 
-       data.addr = 0;
-       data.raw = NULL;
+       perf_sample_data_init(&data, 0);
 
        cpuc = &__get_cpu_var(cpu_hw_events);
 
@@ -1347,6 +1349,7 @@ static void __init pmu_check_apic(void)
 
 void __init init_hw_perf_events(void)
 {
+       struct event_constraint *c;
        int err;
 
        pr_info("Performance Events: ");
@@ -1395,6 +1398,16 @@ void __init init_hw_perf_events(void)
                __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_events) - 1,
                                   0, x86_pmu.num_events);
 
+       if (x86_pmu.event_constraints) {
+               for_each_event_constraint(c, x86_pmu.event_constraints) {
+                       if (c->cmask != INTEL_ARCH_FIXED_MASK)
+                               continue;
+
+                       c->idxmsk64 |= (1ULL << x86_pmu.num_events) - 1;
+                       c->weight += x86_pmu.num_events;
+               }
+       }
+
        pr_info("... version:                %d\n",     x86_pmu.version);
        pr_info("... bit width:              %d\n",     x86_pmu.event_bits);
        pr_info("... generic registers:      %d\n",     x86_pmu.num_events);
index 977e754..44b60c8 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef CONFIG_CPU_SUP_INTEL
 
 /*
- * Intel PerfMon v3. Used on Core2 and later.
+ * Intel PerfMon, used on Core and later.
  */
 static const u64 intel_perfmon_event_map[] =
 {
@@ -27,8 +27,14 @@ static struct event_constraint intel_core_event_constraints[] =
 
 static struct event_constraint intel_core2_event_constraints[] =
 {
-       FIXED_EVENT_CONSTRAINT(0xc0, (0x3|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
-       FIXED_EVENT_CONSTRAINT(0x3c, (0x3|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+       FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+       FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+       /*
+        * Core2 has Fixed Counter 2 listed as CPU_CLK_UNHALTED.REF and event
+        * 0x013c as CPU_CLK_UNHALTED.BUS and specifies there is a fixed
+        * ratio between these counters.
+        */
+       /* FIXED_EVENT_CONSTRAINT(0x013c, 2),  CPU_CLK_UNHALTED.REF */
        INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
        INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
        INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
@@ -37,14 +43,16 @@ static struct event_constraint intel_core2_event_constraints[] =
        INTEL_EVENT_CONSTRAINT(0x18, 0x1), /* IDLE_DURING_DIV */
        INTEL_EVENT_CONSTRAINT(0x19, 0x2), /* DELAYED_BYPASS */
        INTEL_EVENT_CONSTRAINT(0xa1, 0x1), /* RS_UOPS_DISPATCH_CYCLES */
+       INTEL_EVENT_CONSTRAINT(0xc9, 0x1), /* ITLB_MISS_RETIRED (T30-9) */
        INTEL_EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED */
        EVENT_CONSTRAINT_END
 };
 
 static struct event_constraint intel_nehalem_event_constraints[] =
 {
-       FIXED_EVENT_CONSTRAINT(0xc0, (0xf|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
-       FIXED_EVENT_CONSTRAINT(0x3c, (0xf|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+       FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+       FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+       /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
        INTEL_EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */
        INTEL_EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */
        INTEL_EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */
@@ -58,8 +66,9 @@ static struct event_constraint intel_nehalem_event_constraints[] =
 
 static struct event_constraint intel_westmere_event_constraints[] =
 {
-       FIXED_EVENT_CONSTRAINT(0xc0, (0xf|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
-       FIXED_EVENT_CONSTRAINT(0x3c, (0xf|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+       FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+       FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+       /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
        INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
        INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */
        INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */
@@ -68,8 +77,9 @@ static struct event_constraint intel_westmere_event_constraints[] =
 
 static struct event_constraint intel_gen_event_constraints[] =
 {
-       FIXED_EVENT_CONSTRAINT(0xc0, (0x3|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
-       FIXED_EVENT_CONSTRAINT(0x3c, (0x3|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
+       FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+       FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+       /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
        EVENT_CONSTRAINT_END
 };
 
@@ -580,10 +590,9 @@ static void intel_pmu_drain_bts_buffer(void)
 
        ds->bts_index = ds->bts_buffer_base;
 
+       perf_sample_data_init(&data, 0);
 
        data.period     = event->hw.last_period;
-       data.addr       = 0;
-       data.raw        = NULL;
        regs.ip         = 0;
 
        /*
@@ -732,8 +741,7 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
        int bit, loops;
        u64 ack, status;
 
-       data.addr = 0;
-       data.raw = NULL;
+       perf_sample_data_init(&data, 0);
 
        cpuc = &__get_cpu_var(cpu_hw_events);
 
@@ -935,7 +943,7 @@ static __init int intel_pmu_init(void)
                x86_pmu.event_constraints = intel_nehalem_event_constraints;
                pr_cont("Nehalem/Corei7 events, ");
                break;
-       case 28:
+       case 28: /* Atom */
                memcpy(hw_cache_event_ids, atom_hw_cache_event_ids,
                       sizeof(hw_cache_event_ids));
 
@@ -951,6 +959,7 @@ static __init int intel_pmu_init(void)
                x86_pmu.event_constraints = intel_westmere_event_constraints;
                pr_cont("Westmere events, ");
                break;
+
        default:
                /*
                 * default constraints for v2 and up
index 1ca5ba0..a4e67b9 100644 (file)
@@ -62,7 +62,7 @@ static void p6_pmu_disable_all(void)
 
        /* p6 only has one enable register */
        rdmsrl(MSR_P6_EVNTSEL0, val);
-       val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
+       val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
        wrmsrl(MSR_P6_EVNTSEL0, val);
 }
 
@@ -72,7 +72,7 @@ static void p6_pmu_enable_all(void)
 
        /* p6 only has one enable register */
        rdmsrl(MSR_P6_EVNTSEL0, val);
-       val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
+       val |= ARCH_PERFMON_EVENTSEL_ENABLE;
        wrmsrl(MSR_P6_EVNTSEL0, val);
 }
 
@@ -83,7 +83,7 @@ p6_pmu_disable_event(struct hw_perf_event *hwc, int idx)
        u64 val = P6_NOP_EVENT;
 
        if (cpuc->enabled)
-               val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
+               val |= ARCH_PERFMON_EVENTSEL_ENABLE;
 
        (void)checking_wrmsrl(hwc->config_base + idx, val);
 }
@@ -95,7 +95,7 @@ static void p6_pmu_enable_event(struct hw_perf_event *hwc, int idx)
 
        val = hwc->config;
        if (cpuc->enabled)
-               val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
+               val |= ARCH_PERFMON_EVENTSEL_ENABLE;
 
        (void)checking_wrmsrl(hwc->config_base + idx, val);
 }
index 74f4e85..fb329e9 100644 (file)
@@ -680,7 +680,7 @@ static int setup_intel_arch_watchdog(unsigned nmi_hz)
        cpu_nmi_set_wd_enabled();
 
        apic_write(APIC_LVTPC, APIC_DM_NMI);
-       evntsel |= ARCH_PERFMON_EVENTSEL0_ENABLE;
+       evntsel |= ARCH_PERFMON_EVENTSEL_ENABLE;
        wrmsr(evntsel_msr, evntsel, 0);
        intel_arch_wd_ops.checkbit = 1ULL << (eax.split.bit_width - 1);
        return 1;
index dce99ab..d5e2a2e 100644 (file)
@@ -120,9 +120,15 @@ fixup_bp_irq_link(unsigned long bp, unsigned long *stack,
 {
 #ifdef CONFIG_FRAME_POINTER
        struct stack_frame *frame = (struct stack_frame *)bp;
+       unsigned long next;
 
-       if (!in_irq_stack(stack, irq_stack, irq_stack_end))
-               return (unsigned long)frame->next_frame;
+       if (!in_irq_stack(stack, irq_stack, irq_stack_end)) {
+               if (!probe_kernel_address(&frame->next_frame, next))
+                       return next;
+               else
+                       WARN_ONCE(1, "Perf: bad frame pointer = %p in "
+                                 "callchain\n", &frame->next_frame);
+       }
 #endif
        return bp;
 }
index dca2802..d6cc065 100644 (file)
@@ -344,13 +344,6 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp,
        }
 
        /*
-        * For kernel-addresses, either the address or symbol name can be
-        * specified.
-        */
-       if (info->name)
-               info->address = (unsigned long)
-                               kallsyms_lookup_name(info->name);
-       /*
         * Check that the low-order bits of the address are appropriate
         * for the alignment implied by len.
         */
@@ -535,8 +528,3 @@ void hw_breakpoint_pmu_read(struct perf_event *bp)
 {
        /* TODO */
 }
-
-void hw_breakpoint_pmu_unthrottle(struct perf_event *bp)
-{
-       /* TODO */
-}
index cbc4332..9b89546 100644 (file)
@@ -121,3 +121,17 @@ void k8_flush_garts(void)
 }
 EXPORT_SYMBOL_GPL(k8_flush_garts);
 
+static __init int init_k8_nbs(void)
+{
+       int err = 0;
+
+       err = cache_k8_northbridges();
+
+       if (err < 0)
+               printk(KERN_NOTICE "K8 NB: Cannot enumerate AMD northbridges.\n");
+
+       return err;
+}
+
+/* This has to go after the PCI subsystem */
+fs_initcall(init_k8_nbs);
index 34de53b..f3af115 100644 (file)
@@ -735,7 +735,7 @@ int __init gart_iommu_init(void)
        unsigned long scratch;
        long i;
 
-       if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0)
+       if (num_k8_northbridges == 0)
                return 0;
 
 #ifndef CONFIG_AGP_AMD64
index 02d6780..ad95406 100644 (file)
@@ -607,7 +607,7 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_SMP
        if (pm_idle == poll_idle && smp_num_siblings > 1) {
-               printk(KERN_WARNING "WARNING: polling idle and HT enabled,"
+               printk_once(KERN_WARNING "WARNING: polling idle and HT enabled,"
                        " performance may degrade.\n");
        }
 #endif
index 1d4eb93..cf07c26 100644 (file)
@@ -291,8 +291,29 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
         */
        if (kernel_set_to_readonly &&
            within(address, (unsigned long)_text,
-                  (unsigned long)__end_rodata_hpage_align))
-               pgprot_val(forbidden) |= _PAGE_RW;
+                  (unsigned long)__end_rodata_hpage_align)) {
+               unsigned int level;
+
+               /*
+                * Don't enforce the !RW mapping for the kernel text mapping,
+                * if the current mapping is already using small page mapping.
+                * No need to work hard to preserve large page mappings in this
+                * case.
+                *
+                * This also fixes the Linux Xen paravirt guest boot failure
+                * (because of unexpected read-only mappings for kernel identity
+                * mappings). In this paravirt guest case, the kernel text
+                * mapping and the kernel identity mapping share the same
+                * page-table pages. Thus we can't really use different
+                * protections for the kernel text and identity mappings. Also,
+                * these shared mappings are made of small page mappings.
+                * Thus this don't enforce !RW mapping for small page kernel
+                * text mapping logic will help Linux Xen parvirt guest boot
+                * aswell.
+                */
+               if (lookup_address(address, &level) && (level != PG_LEVEL_4K))
+                       pgprot_val(forbidden) |= _PAGE_RW;
+       }
 #endif
 
        prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden));
index 6a58256..090cbbe 100644 (file)
 
 static unsigned long reset_value[NUM_VIRT_COUNTERS];
 
-/* IbsFetchCtl bits/masks */
-#define IBS_FETCH_RAND_EN              (1ULL<<57)
-#define IBS_FETCH_VAL                  (1ULL<<49)
-#define IBS_FETCH_ENABLE               (1ULL<<48)
-#define IBS_FETCH_CNT_MASK             0xFFFF0000ULL
-
-/* IbsOpCtl bits */
-#define IBS_OP_CNT_CTL                 (1ULL<<19)
-#define IBS_OP_VAL                     (1ULL<<18)
-#define IBS_OP_ENABLE                  (1ULL<<17)
-
 #define IBS_FETCH_SIZE                 6
 #define IBS_OP_SIZE                    12
 
@@ -182,7 +171,7 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
                        continue;
                }
                rdmsrl(msrs->controls[i].addr, val);
-               if (val & ARCH_PERFMON_EVENTSEL0_ENABLE)
+               if (val & ARCH_PERFMON_EVENTSEL_ENABLE)
                        op_x86_warn_in_use(i);
                val &= model->reserved;
                wrmsrl(msrs->controls[i].addr, val);
@@ -290,7 +279,7 @@ op_amd_handle_ibs(struct pt_regs * const regs,
                        oprofile_write_commit(&entry);
 
                        /* reenable the IRQ */
-                       ctl &= ~(IBS_FETCH_VAL | IBS_FETCH_CNT_MASK);
+                       ctl &= ~(IBS_FETCH_VAL | IBS_FETCH_CNT);
                        ctl |= IBS_FETCH_ENABLE;
                        wrmsrl(MSR_AMD64_IBSFETCHCTL, ctl);
                }
@@ -330,7 +319,7 @@ static inline void op_amd_start_ibs(void)
                return;
 
        if (ibs_config.fetch_enabled) {
-               val = (ibs_config.max_cnt_fetch >> 4) & 0xFFFF;
+               val = (ibs_config.max_cnt_fetch >> 4) & IBS_FETCH_MAX_CNT;
                val |= ibs_config.rand_en ? IBS_FETCH_RAND_EN : 0;
                val |= IBS_FETCH_ENABLE;
                wrmsrl(MSR_AMD64_IBSFETCHCTL, val);
@@ -352,7 +341,7 @@ static inline void op_amd_start_ibs(void)
                         * avoid underflows.
                         */
                        ibs_op_ctl = min(ibs_op_ctl + IBS_RANDOM_MAXCNT_OFFSET,
-                                        0xFFFFULL);
+                                        IBS_OP_MAX_CNT);
                }
                if (ibs_caps & IBS_CAPS_OPCNT && ibs_config.dispatched_ops)
                        ibs_op_ctl |= IBS_OP_CNT_CTL;
@@ -409,7 +398,7 @@ static void op_amd_start(struct op_msrs const * const msrs)
                if (!reset_value[op_x86_phys_to_virt(i)])
                        continue;
                rdmsrl(msrs->controls[i].addr, val);
-               val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
+               val |= ARCH_PERFMON_EVENTSEL_ENABLE;
                wrmsrl(msrs->controls[i].addr, val);
        }
 
@@ -429,7 +418,7 @@ static void op_amd_stop(struct op_msrs const * const msrs)
                if (!reset_value[op_x86_phys_to_virt(i)])
                        continue;
                rdmsrl(msrs->controls[i].addr, val);
-               val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
+               val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
                wrmsrl(msrs->controls[i].addr, val);
        }
 
index 5d1727b..2bf90fa 100644 (file)
@@ -88,7 +88,7 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
                        continue;
                }
                rdmsrl(msrs->controls[i].addr, val);
-               if (val & ARCH_PERFMON_EVENTSEL0_ENABLE)
+               if (val & ARCH_PERFMON_EVENTSEL_ENABLE)
                        op_x86_warn_in_use(i);
                val &= model->reserved;
                wrmsrl(msrs->controls[i].addr, val);
@@ -166,7 +166,7 @@ static void ppro_start(struct op_msrs const * const msrs)
        for (i = 0; i < num_counters; ++i) {
                if (reset_value[i]) {
                        rdmsrl(msrs->controls[i].addr, val);
-                       val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
+                       val |= ARCH_PERFMON_EVENTSEL_ENABLE;
                        wrmsrl(msrs->controls[i].addr, val);
                }
        }
@@ -184,7 +184,7 @@ static void ppro_stop(struct op_msrs const * const msrs)
                if (!reset_value[i])
                        continue;
                rdmsrl(msrs->controls[i].addr, val);
-               val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
+               val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
                wrmsrl(msrs->controls[i].addr, val);
        }
 }
index 2fb3a48..4b66c69 100644 (file)
@@ -57,7 +57,7 @@ config AGP_AMD
 
 config AGP_AMD64
        tristate "AMD Opteron/Athlon64 on-CPU GART support"
-       depends on AGP && X86
+       depends on AGP && X86 && K8_NB
        help
          This option gives you AGP support for the GLX component of
          X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.
index 79d9edd..7a0d2e4 100644 (file)
@@ -68,22 +68,25 @@ static const struct {
 #define map_key_clear(c)       hid_map_usage_clear(hidinput, usage, &bit, \
                &max, EV_KEY, (c))
 
-static inline int match_scancode(int code, int scancode)
+static inline int match_scancode(unsigned int code, unsigned int scancode)
 {
        if (scancode == 0)
                return 1;
-       return ((code & (HID_USAGE_PAGE | HID_USAGE)) == scancode);
+
+       return (code & (HID_USAGE_PAGE | HID_USAGE)) == scancode;
 }
 
-static inline int match_keycode(int code, int keycode)
+static inline int match_keycode(unsigned int code, unsigned int keycode)
 {
        if (keycode == 0)
                return 1;
-       return (code == keycode);
+
+       return code == keycode;
 }
 
 static struct hid_usage *hidinput_find_key(struct hid_device *hid,
-               int scancode, int keycode)
+                                          unsigned int scancode,
+                                          unsigned int keycode)
 {
        int i, j, k;
        struct hid_report *report;
@@ -105,8 +108,8 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid,
        return NULL;
 }
 
-static int hidinput_getkeycode(struct input_dev *dev, int scancode,
-                               int *keycode)
+static int hidinput_getkeycode(struct input_dev *dev,
+                              unsigned int scancode, unsigned int *keycode)
 {
        struct hid_device *hid = input_get_drvdata(dev);
        struct hid_usage *usage;
@@ -119,16 +122,13 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode,
        return -EINVAL;
 }
 
-static int hidinput_setkeycode(struct input_dev *dev, int scancode,
-                               int keycode)
+static int hidinput_setkeycode(struct input_dev *dev,
+                              unsigned int scancode, unsigned int keycode)
 {
        struct hid_device *hid = input_get_drvdata(dev);
        struct hid_usage *usage;
        int old_keycode;
 
-       if (keycode < 0 || keycode > KEY_MAX)
-               return -EINVAL;
-
        usage = hidinput_find_key(hid, scancode, 0);
        if (usage) {
                old_keycode = usage->code;
index 02ce9cf..d06083f 100644 (file)
@@ -73,7 +73,6 @@ config I2C_SMBUS
 
 source drivers/i2c/algos/Kconfig
 source drivers/i2c/busses/Kconfig
-source drivers/i2c/chips/Kconfig
 
 config I2C_DEBUG_CORE
        bool "I2C Core debugging messages"
@@ -98,12 +97,4 @@ config I2C_DEBUG_BUS
          a problem with I2C support and want to see more of what is going
          on.
 
-config I2C_DEBUG_CHIP
-       bool "I2C Chip debugging messages"
-       help
-         Say Y here if you want the I2C chip drivers to produce a bunch of
-         debug messages to the system log.  Select this if you are having
-         a problem with I2C support and want to see more of what is going
-         on.
-
 endif # I2C
index acd0250..a7d9b4b 100644 (file)
@@ -6,7 +6,7 @@ obj-$(CONFIG_I2C_BOARDINFO)     += i2c-boardinfo.o
 obj-$(CONFIG_I2C)              += i2c-core.o
 obj-$(CONFIG_I2C_SMBUS)                += i2c-smbus.o
 obj-$(CONFIG_I2C_CHARDEV)      += i2c-dev.o
-obj-y                          += busses/ chips/ algos/
+obj-y                          += algos/ busses/
 
 ifeq ($(CONFIG_I2C_DEBUG_CORE),y)
 EXTRA_CFLAGS += -DDEBUG
index e25e139..e8d568c 100644 (file)
@@ -522,6 +522,12 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
        int i, ret;
        unsigned short nak_ok;
 
+       if (adap->pre_xfer) {
+               ret = adap->pre_xfer(i2c_adap);
+               if (ret < 0)
+                       return ret;
+       }
+
        bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
        i2c_start(adap);
        for (i = 0; i < num; i++) {
@@ -570,6 +576,9 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
 bailout:
        bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
        i2c_stop(adap);
+
+       if (adap->post_xfer)
+               adap->post_xfer(i2c_adap);
        return ret;
 }
 
index 9da5b05..299b918 100644 (file)
@@ -416,9 +416,11 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
                data->block[0] = 32;    /* max for SMBus block reads */
        }
 
+       /* Experience has shown that the block buffer can only be used for
+          SMBus (not I2C) block transactions, even though the datasheet
+          doesn't mention this limitation. */
        if ((i801_features & FEATURE_BLOCK_BUFFER)
-        && !(command == I2C_SMBUS_I2C_BLOCK_DATA
-             && read_write == I2C_SMBUS_READ)
+        && command != I2C_SMBUS_I2C_BLOCK_DATA
         && i801_set_block_buffer_mode() == 0)
                result = i801_block_transaction_by_block(data, read_write,
                                                         hwpec);
index 1c440a7..b289ec9 100644 (file)
@@ -122,9 +122,14 @@ static s32 i2c_powermac_smbus_xfer(        struct i2c_adapter*     adap,
 
        rc = pmac_i2c_xfer(bus, addrdir, subsize, subaddr, buf, len);
        if (rc) {
-               dev_err(&adap->dev,
-                       "I2C transfer at 0x%02x failed, size %d, err %d\n",
-                       addrdir >> 1, size, rc);
+               if (rc == -ENXIO)
+                       dev_dbg(&adap->dev,
+                               "I2C transfer at 0x%02x failed, size %d, "
+                               "err %d\n", addrdir >> 1, size, rc);
+               else
+                       dev_err(&adap->dev,
+                               "I2C transfer at 0x%02x failed, size %d, "
+                               "err %d\n", addrdir >> 1, size, rc);
                goto bail;
        }
 
@@ -175,10 +180,16 @@ static int i2c_powermac_master_xfer(      struct i2c_adapter *adap,
                goto bail;
        }
        rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len);
-       if (rc < 0)
-               dev_err(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
-                       addrdir & 1 ? "read from" : "write to", addrdir >> 1,
-                       rc);
+       if (rc < 0) {
+               if (rc == -ENXIO)
+                       dev_dbg(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
+                               addrdir & 1 ? "read from" : "write to",
+                               addrdir >> 1, rc);
+               else
+                       dev_err(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
+                               addrdir & 1 ? "read from" : "write to",
+                               addrdir >> 1, rc);
+       }
  bail:
        pmac_i2c_close(bus);
        return rc < 0 ? rc : 1;
index eece39a..f0ef8da 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/errno.h>
+#include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
deleted file mode 100644 (file)
index ae4539d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Miscellaneous I2C chip drivers configuration
-#
-# *** DEPRECATED! Do not add new entries! See Makefile ***
-#
-
-menu "Miscellaneous I2C Chip support"
-
-config SENSORS_TSL2550
-       tristate "Taos TSL2550 ambient light sensor"
-       depends on EXPERIMENTAL
-       help
-         If you say yes here you get support for the Taos TSL2550
-         ambient light sensor.
-
-         This driver can also be built as a module.  If so, the module
-         will be called tsl2550.
-
-endmenu
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
deleted file mode 100644 (file)
index fe0af0f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Makefile for miscellaneous I2C chip drivers.
-#
-# Do not add new drivers to this directory! It is DEPRECATED.
-#
-# Device drivers are better grouped according to the functionality they
-# implement rather than to the bus they are connected to. In particular:
-# * Hardware monitoring chip drivers go to drivers/hwmon
-# * RTC chip drivers go to drivers/rtc
-# * I/O expander drivers go to drivers/gpio
-#
-
-obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
-
-ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
-EXTRA_CFLAGS += -DDEBUG
-endif
-
index 4212782..7a8201e 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/device.h>
-#include <linux/semaphore.h>
 #include <linux/interrupt.h>
 #include <linux/workqueue.h>
 #include <linux/i2c.h>
@@ -55,7 +54,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
         * Drivers should either disable alerts, or provide at least
         * a minimal handler.  Lock so client->driver won't change.
         */
-       down(&dev->sem);
+       device_lock(dev);
        if (client->driver) {
                if (client->driver->alert)
                        client->driver->alert(client, data->flag);
@@ -63,7 +62,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
                        dev_warn(&client->dev, "no driver alert()!\n");
        } else
                dev_dbg(&client->dev, "alert with no driver\n");
-       up(&dev->sem);
+       device_unlock(dev);
 
        /* Stop iterating after we find the device */
        return -EBUSY;
index 58463da..e351b15 100644 (file)
@@ -2953,6 +2953,9 @@ static void ib_mad_remove_device(struct ib_device *device)
 {
        int i, num_ports, cur_port;
 
+       if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
+               return;
+
        if (device->node_type == RDMA_NODE_IB_SWITCH) {
                num_ports = 1;
                cur_port = 0;
index ee1d8b4..63f975f 100644 (file)
@@ -189,6 +189,7 @@ static void close_rnic_dev(struct t3cdev *tdev)
        list_for_each_entry_safe(dev, tmp, &dev_list, entry) {
                if (dev->rdev.t3cdev_p == tdev) {
                        dev->rdev.flags = CXIO_ERROR_FATAL;
+                       synchronize_net();
                        cancel_delayed_work_sync(&dev->db_drop_task);
                        list_del(&dev->entry);
                        iwch_unregister_device(dev);
@@ -217,6 +218,7 @@ static void iwch_event_handler(struct t3cdev *tdev, u32 evt, u32 port_id)
        switch (evt) {
        case OFFLOAD_STATUS_DOWN: {
                rdev->flags = CXIO_ERROR_FATAL;
+               synchronize_net();
                event.event  = IB_EVENT_DEVICE_FATAL;
                dispatch = 1;
                break;
index ce7f538..9250755 100644 (file)
@@ -1899,9 +1899,14 @@ void nes_destroy_nic_qp(struct nes_vnic *nesvnic)
        u16  wqe_fragment_index;
        u64 wqe_frag;
        u32 cqp_head;
+       u32 wqm_cfg0;
        unsigned long flags;
        int ret;
 
+       /* clear wqe stall before destroying NIC QP */
+       wqm_cfg0 = nes_read_indexed(nesdev, NES_IDX_WQM_CONFIG0);
+       nes_write_indexed(nesdev, NES_IDX_WQM_CONFIG0, wqm_cfg0 & 0xFFFF7FFF);
+
        /* Free remaining NIC receive buffers */
        while (nesvnic->nic.rq_head != nesvnic->nic.rq_tail) {
                nic_rqe   = &nesvnic->nic.rq_vbase[nesvnic->nic.rq_tail];
@@ -2020,6 +2025,9 @@ void nes_destroy_nic_qp(struct nes_vnic *nesvnic)
 
        pci_free_consistent(nesdev->pcidev, nesvnic->nic_mem_size, nesvnic->nic_vbase,
                        nesvnic->nic_pbase);
+
+       /* restore old wqm_cfg0 value */
+       nes_write_indexed(nesdev, NES_IDX_WQM_CONFIG0, wqm_cfg0);
 }
 
 /**
index 9b1e7f8..bbbfe9f 100644 (file)
@@ -160,6 +160,7 @@ enum indexed_regs {
        NES_IDX_ENDNODE0_NSTAT_TX_OCTETS_HI = 0x7004,
        NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_LO = 0x7008,
        NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_HI = 0x700c,
+       NES_IDX_WQM_CONFIG0 = 0x5000,
        NES_IDX_WQM_CONFIG1 = 0x5004,
        NES_IDX_CM_CONFIG = 0x5100,
        NES_IDX_NIC_LOGPORT_TO_PHYPORT = 0x6000,
index a1d79b6..91fdde3 100644 (file)
@@ -1595,7 +1595,6 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
        struct nes_vnic *nesvnic;
        struct net_device *netdev;
        struct nic_qp_map *curr_qp_map;
-       u32 u32temp;
        u8 phy_type = nesdev->nesadapter->phy_type[nesdev->mac_index];
 
        netdev = alloc_etherdev(sizeof(struct nes_vnic));
@@ -1707,6 +1706,10 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
             ((phy_type == NES_PHY_TYPE_PUMA_1G) &&
              (((PCI_FUNC(nesdev->pcidev->devfn) == 1) && (nesdev->mac_index == 2)) ||
               ((PCI_FUNC(nesdev->pcidev->devfn) == 2) && (nesdev->mac_index == 1)))))) {
+               u32 u32temp;
+               u32 link_mask;
+               u32 link_val;
+
                u32temp = nes_read_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 +
                                (0x200 * (nesdev->mac_index & 1)));
                if (phy_type != NES_PHY_TYPE_PUMA_1G) {
@@ -1715,13 +1718,36 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
                                (0x200 * (nesdev->mac_index & 1)), u32temp);
                }
 
+               /* Check and set linkup here.  This is for back to back */
+               /* configuration where second port won't get link interrupt */
+               switch (phy_type) {
+               case NES_PHY_TYPE_PUMA_1G:
+                       if (nesdev->mac_index < 2) {
+                               link_mask = 0x01010000;
+                               link_val = 0x01010000;
+                       } else {
+                               link_mask = 0x02020000;
+                               link_val = 0x02020000;
+                       }
+                       break;
+               default:
+                       link_mask = 0x0f1f0000;
+                       link_val = 0x0f0f0000;
+                       break;
+               }
+
+               u32temp = nes_read_indexed(nesdev,
+                                          NES_IDX_PHY_PCS_CONTROL_STATUS0 +
+                                          (0x200 * (nesdev->mac_index & 1)));
+               if ((u32temp & link_mask) == link_val)
+                       nesvnic->linkup = 1;
+
                /* clear the MAC interrupt status, assumes direct logical to physical mapping */
                u32temp = nes_read_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index));
                nes_debug(NES_DBG_INIT, "Phy interrupt status = 0x%X.\n", u32temp);
                nes_write_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index), u32temp);
 
                nes_init_phy(nesdev);
-
        }
 
        return netdev;
index 815725f..6992829 100644 (file)
@@ -1323,6 +1323,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
                        nesqp->nesqp_context->aeq_token_low =  cpu_to_le32((u32)((unsigned long)(nesqp)));
                        nesqp->nesqp_context->aeq_token_high =  cpu_to_le32((u32)(upper_32_bits((unsigned long)(nesqp))));
                        nesqp->nesqp_context->ird_ord_sizes = cpu_to_le32(NES_QPCONTEXT_ORDIRD_ALSMM |
+                                       NES_QPCONTEXT_ORDIRD_AAH |
                                        ((((u32)nesadapter->max_irrq_wr) <<
                                        NES_QPCONTEXT_ORDIRD_IRDSIZE_SHIFT) & NES_QPCONTEXT_ORDIRD_IRDSIZE_MASK));
                        if (disable_mpa_crc) {
index 83a7751..bc65837 100644 (file)
@@ -708,6 +708,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
        struct ipoib_dev_priv *priv = netdev_priv(dev);
        struct ipoib_cm_tx_buf *tx_req;
        u64 addr;
+       int rc;
 
        if (unlikely(skb->len > tx->mtu)) {
                ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
@@ -739,9 +740,10 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
 
        tx_req->mapping = addr;
 
-       if (unlikely(post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
-                              addr, skb->len))) {
-               ipoib_warn(priv, "post_send failed\n");
+       rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
+                      addr, skb->len);
+       if (unlikely(rc)) {
+               ipoib_warn(priv, "post_send failed, error %d\n", rc);
                ++dev->stats.tx_errors;
                ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE);
                dev_kfree_skb_any(skb);
@@ -752,6 +754,8 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
                if (++priv->tx_outstanding == ipoib_sendq_size) {
                        ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
                                  tx->qp->qp_num);
+                       if (ib_req_notify_cq(priv->send_cq, IB_CQ_NEXT_COMP))
+                               ipoib_warn(priv, "request notify on send CQ failed\n");
                        netif_stop_queue(dev);
                }
        }
index 8c91d9f..5df40b1 100644 (file)
@@ -529,7 +529,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
 {
        struct ipoib_dev_priv *priv = netdev_priv(dev);
        struct ipoib_tx_buf *tx_req;
-       int hlen;
+       int hlen, rc;
        void *phead;
 
        if (skb_is_gso(skb)) {
@@ -585,9 +585,10 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
                netif_stop_queue(dev);
        }
 
-       if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
-                              address->ah, qpn, tx_req, phead, hlen))) {
-               ipoib_warn(priv, "post_send failed\n");
+       rc = post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
+                      address->ah, qpn, tx_req, phead, hlen);
+       if (unlikely(rc)) {
+               ipoib_warn(priv, "post_send failed, error %d\n", rc);
                ++dev->stats.tx_errors;
                --priv->tx_outstanding;
                ipoib_dma_unmap_tx(priv->ca, tx_req);
index 9f9816b..2ee6c7a 100644 (file)
@@ -515,7 +515,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
        struct input_absinfo abs;
        struct ff_effect effect;
        int __user *ip = (int __user *)p;
-       int i, t, u, v;
+       unsigned int i, t, u, v;
        int error;
 
        switch (cmd) {
index 41168d5..e2aad0a 100644 (file)
@@ -582,7 +582,8 @@ static int input_fetch_keycode(struct input_dev *dev, int scancode)
 }
 
 static int input_default_getkeycode(struct input_dev *dev,
-                                   int scancode, int *keycode)
+                                   unsigned int scancode,
+                                   unsigned int *keycode)
 {
        if (!dev->keycodesize)
                return -EINVAL;
@@ -596,7 +597,8 @@ static int input_default_getkeycode(struct input_dev *dev,
 }
 
 static int input_default_setkeycode(struct input_dev *dev,
-                                   int scancode, int keycode)
+                                   unsigned int scancode,
+                                   unsigned int keycode)
 {
        int old_keycode;
        int i;
@@ -654,11 +656,9 @@ static int input_default_setkeycode(struct input_dev *dev,
  * This function should be called by anyone interested in retrieving current
  * keymap. Presently keyboard and evdev handlers use it.
  */
-int input_get_keycode(struct input_dev *dev, int scancode, int *keycode)
+int input_get_keycode(struct input_dev *dev,
+                     unsigned int scancode, unsigned int *keycode)
 {
-       if (scancode < 0)
-               return -EINVAL;
-
        return dev->getkeycode(dev, scancode, keycode);
 }
 EXPORT_SYMBOL(input_get_keycode);
@@ -672,16 +672,14 @@ EXPORT_SYMBOL(input_get_keycode);
  * This function should be called by anyone needing to update current
  * keymap. Presently keyboard and evdev handlers use it.
  */
-int input_set_keycode(struct input_dev *dev, int scancode, int keycode)
+int input_set_keycode(struct input_dev *dev,
+                     unsigned int scancode, unsigned int keycode)
 {
        unsigned long flags;
        int old_keycode;
        int retval;
 
-       if (scancode < 0)
-               return -EINVAL;
-
-       if (keycode < 0 || keycode > KEY_MAX)
+       if (keycode > KEY_MAX)
                return -EINVAL;
 
        spin_lock_irqsave(&dev->event_lock, flags);
@@ -1881,35 +1879,37 @@ static int input_open_file(struct inode *inode, struct file *file)
        const struct file_operations *old_fops, *new_fops = NULL;
        int err;
 
-       lock_kernel();
+       err = mutex_lock_interruptible(&input_mutex);
+       if (err)
+               return err;
+
        /* No load-on-demand here? */
        handler = input_table[iminor(inode) >> 5];
-       if (!handler || !(new_fops = fops_get(handler->fops))) {
-               err = -ENODEV;
-               goto out;
-       }
+       if (handler)
+               new_fops = fops_get(handler->fops);
+
+       mutex_unlock(&input_mutex);
 
        /*
         * That's _really_ odd. Usually NULL ->open means "nothing special",
         * not "no device". Oh, well...
         */
-       if (!new_fops->open) {
+       if (!new_fops || !new_fops->open) {
                fops_put(new_fops);
                err = -ENODEV;
                goto out;
        }
+
        old_fops = file->f_op;
        file->f_op = new_fops;
 
        err = new_fops->open(inode, file);
-
        if (err) {
                fops_put(file->f_op);
                file->f_op = fops_get(old_fops);
        }
        fops_put(old_fops);
 out:
-       unlock_kernel();
        return err;
 }
 
index ae998d9..7a55714 100644 (file)
@@ -819,7 +819,7 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
        int i;
        int err;
 
-       if (pad_type < 1 || pad_type > GC_MAX) {
+       if (pad_type < 1 || pad_type >= GC_MAX) {
                pr_err("Pad type %d unknown\n", pad_type);
                return -EINVAL;
        }
index fe376a2..593c052 100644 (file)
@@ -162,7 +162,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id)
        input_sync(input);
 
        if (bfin_kpad_get_keypressed(bf54x_kpad)) {
-               disable_irq(bf54x_kpad->irq);
+               disable_irq_nosync(bf54x_kpad->irq);
                bf54x_kpad->lastkey = key;
                mod_timer(&bf54x_kpad->timer,
                          jiffies + bf54x_kpad->keyup_test_jiffies);
index 7097bfe..23140a3 100644 (file)
@@ -214,6 +214,17 @@ config INPUT_TWL4030_PWRBUTTON
          To compile this driver as a module, choose M here. The module will
          be called twl4030_pwrbutton.
 
+config INPUT_TWL4030_VIBRA
+       tristate "Support for TWL4030 Vibrator"
+       depends on TWL4030_CORE
+       select TWL4030_CODEC
+       select INPUT_FF_MEMLESS
+       help
+         This option enables support for TWL4030 Vibrator Driver.
+
+         To compile this driver as a module, choose M here. The module will
+         be called twl4030_vibra.
+
 config INPUT_UINPUT
        tristate "User level driver support"
        help
index b611615..7e95a5d 100644 (file)
@@ -26,6 +26,7 @@ obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER)       += rotary_encoder.o
 obj-$(CONFIG_INPUT_SGI_BTNS)           += sgi_btns.o
 obj-$(CONFIG_INPUT_SPARCSPKR)          += sparcspkr.o
 obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON)  += twl4030-pwrbutton.o
+obj-$(CONFIG_INPUT_TWL4030_VIBRA)      += twl4030-vibra.o
 obj-$(CONFIG_INPUT_UINPUT)             += uinput.o
 obj-$(CONFIG_INPUT_WINBOND_CIR)                += winbond-cir.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)       += wistron_btns.o
index 0501f0e..15be543 100644 (file)
@@ -474,10 +474,11 @@ static void ati_remote2_complete_key(struct urb *urb)
 }
 
 static int ati_remote2_getkeycode(struct input_dev *idev,
-                                 int scancode, int *keycode)
+                                 unsigned int scancode, unsigned int *keycode)
 {
        struct ati_remote2 *ar2 = input_get_drvdata(idev);
-       int index, mode;
+       unsigned int mode;
+       int index;
 
        mode = scancode >> 8;
        if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask))
@@ -491,10 +492,12 @@ static int ati_remote2_getkeycode(struct input_dev *idev,
        return 0;
 }
 
-static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keycode)
+static int ati_remote2_setkeycode(struct input_dev *idev,
+                                 unsigned int scancode, unsigned int keycode)
 {
        struct ati_remote2 *ar2 = input_get_drvdata(idev);
-       int index, mode, old_keycode;
+       unsigned int mode, old_keycode;
+       int index;
 
        mode = scancode >> 8;
        if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask))
@@ -504,9 +507,6 @@ static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keyc
        if (index < 0)
                return -EINVAL;
 
-       if (keycode < KEY_RESERVED || keycode > KEY_MAX)
-               return -EINVAL;
-
        old_keycode = ar2->keycode[mode][index];
        ar2->keycode[mode][index] = keycode;
        __set_bit(keycode, idev->keybit);
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
new file mode 100644 (file)
index 0000000..2fb79e0
--- /dev/null
@@ -0,0 +1,297 @@
+/*
+ * twl4030-vibra.c - TWL4030 Vibrator driver
+ *
+ * Copyright (C) 2008-2010 Nokia Corporation
+ *
+ * Written by Henrik Saari <henrik.saari@nokia.com>
+ * Updates by Felipe Balbi <felipe.balbi@nokia.com>
+ * Input by Jari Vanhala <ext-jari.vanhala@nokia.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/jiffies.h>
+#include <linux/platform_device.h>
+#include <linux/workqueue.h>
+#include <linux/i2c/twl.h>
+#include <linux/mfd/twl4030-codec.h>
+#include <linux/input.h>
+
+/* MODULE ID2 */
+#define LEDEN          0x00
+
+/* ForceFeedback */
+#define EFFECT_DIR_180_DEG     0x8000 /* range is 0 - 0xFFFF */
+
+struct vibra_info {
+       struct device           *dev;
+       struct input_dev        *input_dev;
+
+       struct workqueue_struct *workqueue;
+       struct work_struct      play_work;
+
+       bool                    enabled;
+       int                     speed;
+       int                     direction;
+
+       bool                    coexist;
+};
+
+static void vibra_disable_leds(void)
+{
+       u8 reg;
+
+       /* Disable LEDA & LEDB, cannot be used with vibra (PWM) */
+       twl_i2c_read_u8(TWL4030_MODULE_LED, &reg, LEDEN);
+       reg &= ~0x03;
+       twl_i2c_write_u8(TWL4030_MODULE_LED, LEDEN, reg);
+}
+
+/* Powers H-Bridge and enables audio clk */
+static void vibra_enable(struct vibra_info *info)
+{
+       u8 reg;
+
+       twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER);
+
+       /* turn H-Bridge on */
+       twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
+                       &reg, TWL4030_REG_VIBRA_CTL);
+       twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
+                        (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
+
+       twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL);
+
+       info->enabled = true;
+}
+
+static void vibra_disable(struct vibra_info *info)
+{
+       u8 reg;
+
+       /* Power down H-Bridge */
+       twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
+                       &reg, TWL4030_REG_VIBRA_CTL);
+       twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
+                        (reg & ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
+
+       twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER);
+       twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
+
+       info->enabled = false;
+}
+
+static void vibra_play_work(struct work_struct *work)
+{
+       struct vibra_info *info = container_of(work,
+                       struct vibra_info, play_work);
+       int dir;
+       int pwm;
+       u8 reg;
+
+       dir = info->direction;
+       pwm = info->speed;
+
+       twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
+                       &reg, TWL4030_REG_VIBRA_CTL);
+       if (pwm && (!info->coexist || !(reg & TWL4030_VIBRA_SEL))) {
+
+               if (!info->enabled)
+                       vibra_enable(info);
+
+               /* set vibra rotation direction */
+               twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
+                               &reg, TWL4030_REG_VIBRA_CTL);
+               reg = (dir) ? (reg | TWL4030_VIBRA_DIR) :
+                       (reg & ~TWL4030_VIBRA_DIR);
+               twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
+                                reg, TWL4030_REG_VIBRA_CTL);
+
+               /* set PWM, 1 = max, 255 = min */
+               twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
+                                256 - pwm, TWL4030_REG_VIBRA_SET);
+       } else {
+               if (info->enabled)
+                       vibra_disable(info);
+       }
+}
+
+/*** Input/ForceFeedback ***/
+
+static int vibra_play(struct input_dev *input, void *data,
+                     struct ff_effect *effect)
+{
+       struct vibra_info *info = input_get_drvdata(input);
+
+       info->speed = effect->u.rumble.strong_magnitude >> 8;
+       if (!info->speed)
+               info->speed = effect->u.rumble.weak_magnitude >> 9;
+       info->direction = effect->direction < EFFECT_DIR_180_DEG ? 0 : 1;
+       queue_work(info->workqueue, &info->play_work);
+       return 0;
+}
+
+static int twl4030_vibra_open(struct input_dev *input)
+{
+       struct vibra_info *info = input_get_drvdata(input);
+
+       info->workqueue = create_singlethread_workqueue("vibra");
+       if (info->workqueue == NULL) {
+               dev_err(&input->dev, "couldn't create workqueue\n");
+               return -ENOMEM;
+       }
+       return 0;
+}
+
+static void twl4030_vibra_close(struct input_dev *input)
+{
+       struct vibra_info *info = input_get_drvdata(input);
+
+       cancel_work_sync(&info->play_work);
+       INIT_WORK(&info->play_work, vibra_play_work); /* cleanup */
+       destroy_workqueue(info->workqueue);
+       info->workqueue = NULL;
+
+       if (info->enabled)
+               vibra_disable(info);
+}
+
+/*** Module ***/
+#if CONFIG_PM
+static int twl4030_vibra_suspend(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct vibra_info *info = platform_get_drvdata(pdev);
+
+       if (info->enabled)
+               vibra_disable(info);
+
+       return 0;
+}
+
+static int twl4030_vibra_resume(struct device *dev)
+{
+       vibra_disable_leds();
+       return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
+                        twl4030_vibra_suspend, twl4030_vibra_resume);
+#endif
+
+static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
+{
+       struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data;
+       struct vibra_info *info;
+       int ret;
+
+       if (!pdata) {
+               dev_dbg(&pdev->dev, "platform_data not available\n");
+               return -EINVAL;
+       }
+
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
+       if (!info)
+               return -ENOMEM;
+
+       info->dev = &pdev->dev;
+       info->coexist = pdata->coexist;
+       INIT_WORK(&info->play_work, vibra_play_work);
+
+       info->input_dev = input_allocate_device();
+       if (info->input_dev == NULL) {
+               dev_err(&pdev->dev, "couldn't allocate input device\n");
+               ret = -ENOMEM;
+               goto err_kzalloc;
+       }
+
+       input_set_drvdata(info->input_dev, info);
+
+       info->input_dev->name = "twl4030:vibrator";
+       info->input_dev->id.version = 1;
+       info->input_dev->dev.parent = pdev->dev.parent;
+       info->input_dev->open = twl4030_vibra_open;
+       info->input_dev->close = twl4030_vibra_close;
+       __set_bit(FF_RUMBLE, info->input_dev->ffbit);
+
+       ret = input_ff_create_memless(info->input_dev, NULL, vibra_play);
+       if (ret < 0) {
+               dev_dbg(&pdev->dev, "couldn't register vibrator to FF\n");
+               goto err_ialloc;
+       }
+
+       ret = input_register_device(info->input_dev);
+       if (ret < 0) {
+               dev_dbg(&pdev->dev, "couldn't register input device\n");
+               goto err_iff;
+       }
+
+       vibra_disable_leds();
+
+       platform_set_drvdata(pdev, info);
+       return 0;
+
+err_iff:
+       input_ff_destroy(info->input_dev);
+err_ialloc:
+       input_free_device(info->input_dev);
+err_kzalloc:
+       kfree(info);
+       return ret;
+}
+
+static int __devexit twl4030_vibra_remove(struct platform_device *pdev)
+{
+       struct vibra_info *info = platform_get_drvdata(pdev);
+
+       /* this also free ff-memless and calls close if needed */
+       input_unregister_device(info->input_dev);
+       kfree(info);
+       platform_set_drvdata(pdev, NULL);
+
+       return 0;
+}
+
+static struct platform_driver twl4030_vibra_driver = {
+       .probe          = twl4030_vibra_probe,
+       .remove         = __devexit_p(twl4030_vibra_remove),
+       .driver         = {
+               .name   = "twl4030_codec_vibra",
+               .owner  = THIS_MODULE,
+#ifdef CONFIG_PM
+               .pm     = &twl4030_vibra_pm_ops,
+#endif
+       },
+};
+
+static int __init twl4030_vibra_init(void)
+{
+       return platform_driver_register(&twl4030_vibra_driver);
+}
+module_init(twl4030_vibra_init);
+
+static void __exit twl4030_vibra_exit(void)
+{
+       platform_driver_unregister(&twl4030_vibra_driver);
+}
+module_exit(twl4030_vibra_exit);
+
+MODULE_ALIAS("platform:twl4030_codec_vibra");
+
+MODULE_DESCRIPTION("TWL4030 Vibra driver");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Nokia Corporation");
index cbec3df..9c155a4 100644 (file)
@@ -385,26 +385,24 @@ wbcir_do_getkeycode(struct wbcir_data *data, u32 scancode)
 }
 
 static int
-wbcir_getkeycode(struct input_dev *dev, int scancode, int *keycode)
+wbcir_getkeycode(struct input_dev *dev,
+                unsigned int scancode, unsigned int *keycode)
 {
        struct wbcir_data *data = input_get_drvdata(dev);
 
-       *keycode = (int)wbcir_do_getkeycode(data, (u32)scancode);
+       *keycode = wbcir_do_getkeycode(data, scancode);
        return 0;
 }
 
 static int
-wbcir_setkeycode(struct input_dev *dev, int sscancode, int keycode)
+wbcir_setkeycode(struct input_dev *dev,
+                unsigned int scancode, unsigned int keycode)
 {
        struct wbcir_data *data = input_get_drvdata(dev);
        struct wbcir_keyentry *keyentry;
        struct wbcir_keyentry *new_keyentry;
        unsigned long flags;
        unsigned int old_keycode = KEY_RESERVED;
-       u32 scancode = (u32)sscancode;
-
-       if (keycode < 0 || keycode > KEY_MAX)
-               return -EINVAL;
 
        new_keyentry = kmalloc(sizeof(*new_keyentry), GFP_KERNEL);
        if (!new_keyentry)
index ba4f5dd..1e54bce 100644 (file)
@@ -97,8 +97,9 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev)
        wm831x_on->dev->phys = "wm831x_on/input0";
        wm831x_on->dev->dev.parent = &pdev->dev;
 
-       ret = wm831x_request_irq(wm831x, irq, wm831x_on_irq,
-                                IRQF_TRIGGER_RISING, "wm831x_on", wm831x_on);
+       ret = request_threaded_irq(irq, NULL, wm831x_on_irq,
+                                  IRQF_TRIGGER_RISING, "wm831x_on",
+                                  wm831x_on);
        if (ret < 0) {
                dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret);
                goto err_input_dev;
@@ -114,7 +115,7 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev)
        return 0;
 
 err_irq:
-       wm831x_free_irq(wm831x, irq, NULL);
+       free_irq(irq, wm831x_on);
 err_input_dev:
        input_free_device(wm831x_on->dev);
 err:
@@ -127,7 +128,7 @@ static int __devexit wm831x_on_remove(struct platform_device *pdev)
        struct wm831x_on *wm831x_on = platform_get_drvdata(pdev);
        int irq = platform_get_irq(pdev, 0);
 
-       wm831x_free_irq(wm831x_on->wm831x, irq, wm831x_on);
+       free_irq(irq, wm831x_on);
        cancel_delayed_work_sync(&wm831x_on->work);
        input_unregister_device(wm831x_on->dev);
        kfree(wm831x_on);
index f93c2c0..7490f1d 100644 (file)
@@ -63,6 +63,8 @@ static const struct alps_model_info alps_model_data[] = {
        { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf,
                ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },
        { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS },          /* Dell Vostro 1400 */
+       { { 0x52, 0x01, 0x14 }, 0xff, 0xff,
+               ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },      /* Toshiba Tecra A11-11L */
 };
 
 /*
@@ -118,40 +120,27 @@ static void alps_report_buttons(struct psmouse *psmouse,
                                struct input_dev *dev1, struct input_dev *dev2,
                                int left, int right, int middle)
 {
-       struct alps_data *priv = psmouse->private;
-       const struct alps_model_info *model = priv->i;
-
-       if (model->flags & ALPS_PS2_INTERLEAVED) {
-               struct input_dev *dev;
+       struct input_dev *dev;
 
-               /*
-                * If shared button has already been reported on the
-                * other device (dev2) then this event should be also
-                * sent through that device.
-                */
-               dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1;
-               input_report_key(dev, BTN_LEFT, left);
+       /*
+        * If shared button has already been reported on the
+        * other device (dev2) then this event should be also
+        * sent through that device.
+        */
+       dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1;
+       input_report_key(dev, BTN_LEFT, left);
 
-               dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
-               input_report_key(dev, BTN_RIGHT, right);
+       dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
+       input_report_key(dev, BTN_RIGHT, right);
 
-               dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
-               input_report_key(dev, BTN_MIDDLE, middle);
+       dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
+       input_report_key(dev, BTN_MIDDLE, middle);
 
-               /*
-                * Sync the _other_ device now, we'll do the first
-                * device later once we report the rest of the events.
-                */
-               input_sync(dev2);
-       } else {
-               /*
-                * For devices with non-interleaved packets we know what
-                * device buttons belong to so we can simply report them.
-                */
-               input_report_key(dev1, BTN_LEFT, left);
-               input_report_key(dev1, BTN_RIGHT, right);
-               input_report_key(dev1, BTN_MIDDLE, middle);
-       }
+       /*
+        * Sync the _other_ device now, we'll do the first
+        * device later once we report the rest of the events.
+        */
+       input_sync(dev2);
 }
 
 static void alps_process_packet(struct psmouse *psmouse)
index 908b5b4..53ec7dd 100644 (file)
@@ -205,8 +205,8 @@ struct atp {
        bool                    overflow_warned;
        int                     x_old;          /* last reported x/y, */
        int                     y_old;          /* used for smoothing */
-       signed char             xy_cur[ATP_XSENSORS + ATP_YSENSORS];
-       signed char             xy_old[ATP_XSENSORS + ATP_YSENSORS];
+       u8                      xy_cur[ATP_XSENSORS + ATP_YSENSORS];
+       u8                      xy_old[ATP_XSENSORS + ATP_YSENSORS];
        int                     xy_acc[ATP_XSENSORS + ATP_YSENSORS];
        int                     idlecount;      /* number of empty packets */
        struct work_struct      work;
@@ -531,7 +531,7 @@ static void atp_complete_geyser_1_2(struct urb *urb)
 
        for (i = 0; i < ATP_XSENSORS + ATP_YSENSORS; i++) {
                /* accumulate the change */
-               signed char change = dev->xy_old[i] - dev->xy_cur[i];
+               int change = dev->xy_old[i] - dev->xy_cur[i];
                dev->xy_acc[i] -= change;
 
                /* prevent down drifting */
index a13d80f..f34b22b 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <linux/sched.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/poll.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -542,10 +541,8 @@ static int mousedev_open(struct inode *inode, struct file *file)
        if (i >= MOUSEDEV_MINORS)
                return -ENODEV;
 
-       lock_kernel();
        error = mutex_lock_interruptible(&mousedev_table_mutex);
        if (error) {
-               unlock_kernel();
                return error;
        }
        mousedev = mousedev_table[i];
@@ -554,7 +551,6 @@ static int mousedev_open(struct inode *inode, struct file *file)
        mutex_unlock(&mousedev_table_mutex);
 
        if (!mousedev) {
-               unlock_kernel();
                return -ENODEV;
        }
 
@@ -575,7 +571,6 @@ static int mousedev_open(struct inode *inode, struct file *file)
                goto err_free_client;
 
        file->private_data = client;
-       unlock_kernel();
        return 0;
 
  err_free_client:
@@ -583,7 +578,6 @@ static int mousedev_open(struct inode *inode, struct file *file)
        kfree(client);
  err_put_mousedev:
        put_device(&mousedev->dev);
-       unlock_kernel();
        return error;
 }
 
index 2a5982e..ead0494 100644 (file)
@@ -442,6 +442,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
                },
        },
        {
+               /* Medion Akoya E1222 */
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
+               },
+       },
+       {
                /* Mivvy M310 */
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
@@ -624,6 +631,9 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *
                strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
        }
 
+       /* Keyboard ports are always supposed to be wakeup-enabled */
+       device_set_wakeup_enable(&dev->dev, true);
+
        i8042_pnp_kbd_devices++;
        return 0;
 }
index ff4d77c..9302ba0 100644 (file)
@@ -1386,6 +1386,8 @@ static int __init i8042_probe(struct platform_device *dev)
 {
        int error;
 
+       i8042_platform_device = dev;
+
        error = i8042_controller_selftest();
        if (error)
                return error;
@@ -1421,6 +1423,7 @@ static int __init i8042_probe(struct platform_device *dev)
        i8042_free_aux_ports(); /* in case KBD failed but AUX not */
        i8042_free_irqs();
        i8042_controller_reset();
+       i8042_platform_device = NULL;
 
        return error;
 }
@@ -1430,6 +1433,7 @@ static int __devexit i8042_remove(struct platform_device *dev)
        i8042_unregister_ports();
        i8042_free_irqs();
        i8042_controller_reset();
+       i8042_platform_device = NULL;
 
        return 0;
 }
@@ -1448,6 +1452,7 @@ static struct platform_driver i8042_driver = {
 
 static int __init i8042_init(void)
 {
+       struct platform_device *pdev;
        int err;
 
        dbg_init();
@@ -1460,31 +1465,18 @@ static int __init i8042_init(void)
        if (err)
                goto err_platform_exit;
 
-       i8042_platform_device = platform_device_alloc("i8042", -1);
-       if (!i8042_platform_device) {
-               err = -ENOMEM;
+       pdev = platform_create_bundle(&i8042_driver, i8042_probe, NULL, 0, NULL, 0);
+       if (IS_ERR(pdev)) {
+               err = PTR_ERR(pdev);
                goto err_platform_exit;
        }
 
-       err = platform_device_add(i8042_platform_device);
-       if (err)
-               goto err_free_device;
-
-       err = platform_driver_probe(&i8042_driver, i8042_probe);
-       if (err)
-               goto err_del_device;
-
        panic_blink = i8042_panic_blink;
 
        return 0;
 
- err_del_device:
-       platform_device_del(i8042_platform_device);
- err_free_device:
-       platform_device_put(i8042_platform_device);
  err_platform_exit:
        i8042_platform_exit();
-
        return err;
 }
 
index 27fdaaf..9986648 100644 (file)
@@ -81,12 +81,12 @@ static int serio_raw_open(struct inode *inode, struct file *file)
        struct serio_raw_list *list;
        int retval = 0;
 
-       lock_kernel();
        retval = mutex_lock_interruptible(&serio_raw_mutex);
        if (retval)
-               goto out_bkl;
+               return retval;
 
-       if (!(serio_raw = serio_raw_locate(iminor(inode)))) {
+       serio_raw = serio_raw_locate(iminor(inode));
+       if (!serio_raw) {
                retval = -ENODEV;
                goto out;
        }
@@ -96,7 +96,8 @@ static int serio_raw_open(struct inode *inode, struct file *file)
                goto out;
        }
 
-       if (!(list = kzalloc(sizeof(struct serio_raw_list), GFP_KERNEL))) {
+       list = kzalloc(sizeof(struct serio_raw_list), GFP_KERNEL);
+       if (!list) {
                retval = -ENOMEM;
                goto out;
        }
@@ -109,8 +110,6 @@ static int serio_raw_open(struct inode *inode, struct file *file)
 
 out:
        mutex_unlock(&serio_raw_mutex);
-out_bkl:
-       unlock_kernel();
        return retval;
 }
 
index fbd3987..e6bde55 100644 (file)
@@ -64,7 +64,8 @@ struct key_entry *sparse_keymap_entry_from_keycode(struct input_dev *dev,
 EXPORT_SYMBOL(sparse_keymap_entry_from_keycode);
 
 static int sparse_keymap_getkeycode(struct input_dev *dev,
-                                   int scancode, int *keycode)
+                                   unsigned int scancode,
+                                   unsigned int *keycode)
 {
        const struct key_entry *key =
                        sparse_keymap_entry_from_scancode(dev, scancode);
@@ -78,7 +79,8 @@ static int sparse_keymap_getkeycode(struct input_dev *dev,
 }
 
 static int sparse_keymap_setkeycode(struct input_dev *dev,
-                                   int scancode, int keycode)
+                                   unsigned int scancode,
+                                   unsigned int keycode)
 {
        struct key_entry *key;
        int old_keycode;
index a1770e6..8b5d287 100644 (file)
@@ -371,7 +371,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
                                        } else if (pen) {
                                                /* penabled only accepts exact bytes of data */
                                                if (features->type == TABLETPC2FG)
-                                                       features->pktlen = WACOM_PKGLEN_PENABLED;
+                                                       features->pktlen = WACOM_PKGLEN_GRAPHIRE;
                                                features->device_type = BTN_TOOL_PEN;
                                                features->x_max =
                                                        wacom_le16_to_cpu(&report[i + 3]);
@@ -410,7 +410,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
                                        } else if (pen) {
                                                /* penabled only accepts exact bytes of data */
                                                if (features->type == TABLETPC2FG)
-                                                       features->pktlen = WACOM_PKGLEN_PENABLED;
+                                                       features->pktlen = WACOM_PKGLEN_GRAPHIRE;
                                                features->device_type = BTN_TOOL_PEN;
                                                features->y_max =
                                                        wacom_le16_to_cpu(&report[i + 3]);
index 3d81443..b3ba343 100644 (file)
@@ -155,19 +155,19 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
 {
        struct wacom_features *features = &wacom->features;
        unsigned char *data = wacom->data;
-       int x, y, rw;
-       static int penData = 0;
+       int x, y, prox;
+       int rw = 0;
+       int retval = 0;
 
        if (data[0] != WACOM_REPORT_PENABLED) {
                dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
-               return 0;
+               goto exit;
        }
 
-       if (data[1] & 0x80) {
-               /* in prox and not a pad data */
-               penData = 1;
-
-               switch ((data[1] >> 5) & 3) {
+       prox = data[1] & 0x80;
+       if (prox || wacom->id[0]) {
+               if (prox) {
+                       switch ((data[1] >> 5) & 3) {
 
                        case 0: /* Pen */
                                wacom->tool[0] = BTN_TOOL_PEN;
@@ -181,23 +181,13 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
 
                        case 2: /* Mouse with wheel */
                                wacom_report_key(wcombo, BTN_MIDDLE, data[1] & 0x04);
-                               if (features->type == WACOM_G4 || features->type == WACOM_MO) {
-                                       rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03);
-                                       wacom_report_rel(wcombo, REL_WHEEL, -rw);
-                               } else
-                                       wacom_report_rel(wcombo, REL_WHEEL, -(signed char) data[6]);
                                /* fall through */
 
                        case 3: /* Mouse without wheel */
                                wacom->tool[0] = BTN_TOOL_MOUSE;
                                wacom->id[0] = CURSOR_DEVICE_ID;
-                               wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01);
-                               wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02);
-                               if (features->type == WACOM_G4 || features->type == WACOM_MO)
-                                       wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f);
-                               else
-                                       wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f);
                                break;
+                       }
                }
                x = wacom_le16_to_cpu(&data[2]);
                y = wacom_le16_to_cpu(&data[4]);
@@ -208,36 +198,32 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
                        wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x01);
                        wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02);
                        wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x04);
-               }
-               wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */
-               wacom_report_key(wcombo, wacom->tool[0], 1);
-       } else if (wacom->id[0]) {
-               wacom_report_abs(wcombo, ABS_X, 0);
-               wacom_report_abs(wcombo, ABS_Y, 0);
-               if (wacom->tool[0] == BTN_TOOL_MOUSE) {
-                       wacom_report_key(wcombo, BTN_LEFT, 0);
-                       wacom_report_key(wcombo, BTN_RIGHT, 0);
-                       wacom_report_abs(wcombo, ABS_DISTANCE, 0);
                } else {
-                       wacom_report_abs(wcombo, ABS_PRESSURE, 0);
-                       wacom_report_key(wcombo, BTN_TOUCH, 0);
-                       wacom_report_key(wcombo, BTN_STYLUS, 0);
-                       wacom_report_key(wcombo, BTN_STYLUS2, 0);
+                       wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01);
+                       wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02);
+                       if (features->type == WACOM_G4 ||
+                                       features->type == WACOM_MO) {
+                               wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f);
+                               rw = (signed)(data[7] & 0x04) - (data[7] & 0x03);
+                       } else {
+                               wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f);
+                               rw = -(signed)data[6];
+                       }
+                       wacom_report_rel(wcombo, REL_WHEEL, rw);
                }
-               wacom->id[0] = 0;
-               wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
-               wacom_report_key(wcombo, wacom->tool[0], 0);
+
+               if (!prox)
+                       wacom->id[0] = 0;
+               wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */
+               wacom_report_key(wcombo, wacom->tool[0], prox);
+               wacom_input_sync(wcombo); /* sync last event */
        }
 
        /* send pad data */
        switch (features->type) {
            case WACOM_G4:
-               if (data[7] & 0xf8) {
-                       if (penData) {
-                               wacom_input_sync(wcombo); /* sync last event */
-                               if (!wacom->id[0])
-                                       penData = 0;
-                       }
+               prox = data[7] & 0xf8;
+               if (prox || wacom->id[1]) {
                        wacom->id[1] = PAD_DEVICE_ID;
                        wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
                        wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
@@ -245,29 +231,16 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
                        wacom_report_rel(wcombo, REL_WHEEL, rw);
                        wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0);
                        wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
-                       wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
-               } else if (wacom->id[1]) {
-                       if (penData) {
-                               wacom_input_sync(wcombo); /* sync last event */
-                               if (!wacom->id[0])
-                                       penData = 0;
-                       }
-                       wacom->id[1] = 0;
-                       wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
-                       wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
-                       wacom_report_rel(wcombo, REL_WHEEL, 0);
-                       wacom_report_key(wcombo, BTN_TOOL_FINGER, 0);
-                       wacom_report_abs(wcombo, ABS_MISC, 0);
+                       if (!prox)
+                               wacom->id[1] = 0;
+                       wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
                        wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
                }
+               retval = 1;
                break;
            case WACOM_MO:
-               if ((data[7] & 0xf8) || (data[8] & 0xff)) {
-                       if (penData) {
-                               wacom_input_sync(wcombo); /* sync last event */
-                               if (!wacom->id[0])
-                                       penData = 0;
-                       }
+               prox = (data[7] & 0xf8) || data[8];
+               if (prox || wacom->id[1]) {
                        wacom->id[1] = PAD_DEVICE_ID;
                        wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
                        wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
@@ -275,27 +248,16 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
                        wacom_report_key(wcombo, BTN_5, (data[7] & 0x40));
                        wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f));
                        wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0);
+                       if (!prox)
+                               wacom->id[1] = 0;
                        wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
                        wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
-               } else if (wacom->id[1]) {
-                       if (penData) {
-                               wacom_input_sync(wcombo); /* sync last event */
-                               if (!wacom->id[0])
-                                       penData = 0;
-                       }
-                       wacom->id[1] = 0;
-                       wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
-                       wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
-                       wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
-                       wacom_report_key(wcombo, BTN_5, (data[7] & 0x40));
-                       wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f));
-                       wacom_report_key(wcombo, BTN_TOOL_FINGER, 0);
-                       wacom_report_abs(wcombo, ABS_MISC, 0);
-                       wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
                }
+               retval = 1;
                break;
        }
-       return 1;
+exit:
+       return retval;
 }
 
 static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
@@ -636,9 +598,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
 static void wacom_tpc_finger_in(struct wacom_wac *wacom, void *wcombo, char *data, int idx)
 {
        wacom_report_abs(wcombo, ABS_X,
-               (data[2 + idx * 2] & 0xff) | ((data[3 + idx * 2] & 0x7f) << 8));
+               data[2 + idx * 2] | ((data[3 + idx * 2] & 0x7f) << 8));
        wacom_report_abs(wcombo, ABS_Y,
-               (data[6 + idx * 2] & 0xff) | ((data[7 + idx * 2] & 0x7f) << 8));
+               data[6 + idx * 2] | ((data[7 + idx * 2] & 0x7f) << 8));
        wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]);
        wacom_report_key(wcombo, wacom->tool[idx], 1);
        if (idx)
@@ -782,31 +744,24 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, void *wcombo)
 
                touchInProx = 0;
 
-               if (prox) { /* in prox */
-                       if (!wacom->id[0]) {
-                               /* Going into proximity select tool */
-                               wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
-                               if (wacom->tool[0] == BTN_TOOL_PEN)
-                                       wacom->id[0] = STYLUS_DEVICE_ID;
-                               else
-                                       wacom->id[0] = ERASER_DEVICE_ID;
-                       }
-                       wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02);
-                       wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10);
-                       wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2]));
-                       wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4]));
-                       pressure = ((data[7] & 0x01) << 8) | data[6];
-                       if (pressure < 0)
-                               pressure = features->pressure_max + pressure + 1;
-                       wacom_report_abs(wcombo, ABS_PRESSURE, pressure);
-                       wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x05);
-               } else {
-                       wacom_report_abs(wcombo, ABS_X, 0);
-                       wacom_report_abs(wcombo, ABS_Y, 0);
-                       wacom_report_abs(wcombo, ABS_PRESSURE, 0);
-                       wacom_report_key(wcombo, BTN_STYLUS, 0);
-                       wacom_report_key(wcombo, BTN_STYLUS2, 0);
-                       wacom_report_key(wcombo, BTN_TOUCH, 0);
+               if (!wacom->id[0]) { /* first in prox */
+                       /* Going into proximity select tool */
+                       wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
+                       if (wacom->tool[0] == BTN_TOOL_PEN)
+                               wacom->id[0] = STYLUS_DEVICE_ID;
+                       else
+                               wacom->id[0] = ERASER_DEVICE_ID;
+               }
+               wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02);
+               wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10);
+               wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2]));
+               wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4]));
+               pressure = ((data[7] & 0x01) << 8) | data[6];
+               if (pressure < 0)
+                       pressure = features->pressure_max + pressure + 1;
+               wacom_report_abs(wcombo, ABS_PRESSURE, pressure);
+               wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x05);
+               if (!prox) { /* out-prox */
                        wacom->id[0] = 0;
                        /* pen is out so touch can be enabled now */
                        touchInProx = 1;
@@ -1028,7 +983,7 @@ static const struct wacom_features wacom_features_0x93 =
 static const struct wacom_features wacom_features_0x9A =
        { "Wacom ISDv4 9A",       WACOM_PKGLEN_GRAPHIRE,  26202, 16325,  255,  0, TABLETPC };
 static const struct wacom_features wacom_features_0x9F =
-       { "Wacom ISDv4 9F",       WACOM_PKGLEN_PENABLED,  26202, 16325,  255,  0, TABLETPC };
+       { "Wacom ISDv4 9F",       WACOM_PKGLEN_GRAPHIRE,  26202, 16325,  255,  0, TABLETPC };
 static const struct wacom_features wacom_features_0xE2 =
        { "Wacom ISDv4 E2",       WACOM_PKGLEN_TPC2FG,    26202, 16325,  255,  0, TABLETPC2FG };
 static const struct wacom_features wacom_features_0xE3 =
index 8590b1e..b50cf04 100644 (file)
@@ -17,7 +17,6 @@
 #define WACOM_PKGLEN_GRAPHIRE   8
 #define WACOM_PKGLEN_BBFUN      9
 #define WACOM_PKGLEN_INTUOS    10
-#define WACOM_PKGLEN_PENABLED   8
 #define WACOM_PKGLEN_TPC1FG     5
 #define WACOM_PKGLEN_TPC2FG    14
 
index 7208654..8a8fa4d 100644 (file)
@@ -24,17 +24,18 @@ config TOUCHSCREEN_88PM860X
          module will be called 88pm860x-ts.
 
 config TOUCHSCREEN_ADS7846
-       tristate "ADS7846/TSC2046 and ADS7843 based touchscreens"
+       tristate "ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens"
        depends on SPI_MASTER
        depends on HWMON = n || HWMON
        help
          Say Y here if you have a touchscreen interface using the
-         ADS7846/TSC2046 or ADS7843 controller, and your board-specific
-         setup code includes that in its table of SPI devices.
+         ADS7846/TSC2046/AD7873 or ADS7843/AD7843 controller,
+         and your board-specific setup code includes that in its
+         table of SPI devices.
 
          If HWMON is selected, and the driver is told the reference voltage
          on your board, you will also get hwmon interfaces for the voltage
-         (and on ads7846/tsc2046, temperature) sensors of this chip.
+         (and on ads7846/tsc2046/ad7873, temperature) sensors of this chip.
 
          If unsure, say N (but it's safe to say "Y").
 
index eb83939..e019d53 100644 (file)
@@ -46,7 +46,7 @@
 #include <linux/spi/ad7877.h>
 #include <asm/irq.h>
 
-#define        TS_PEN_UP_TIMEOUT       msecs_to_jiffies(50)
+#define        TS_PEN_UP_TIMEOUT       msecs_to_jiffies(100)
 
 #define MAX_SPI_FREQ_HZ                        20000000
 #define        MAX_12BIT                       ((1<<12)-1)
index 8b05d8e..532279c 100644 (file)
@@ -36,6 +36,7 @@
  * TSC2046 is just newer ads7846 silicon.
  * Support for ads7843 tested on Atmel at91sam926x-EK.
  * Support for ads7845 has only been stubbed in.
+ * Support for Analog Devices AD7873 and AD7843 tested.
  *
  * IRQ handling needs a workaround because of a shortcoming in handling
  * edge triggered IRQs on some platforms like the OMAP1/2. These
@@ -821,6 +822,9 @@ static int ads7846_suspend(struct spi_device *spi, pm_message_t message)
 
        spin_unlock_irq(&ts->lock);
 
+       if (device_may_wakeup(&ts->spi->dev))
+               enable_irq_wake(ts->spi->irq);
+
        return 0;
 
 }
@@ -829,6 +833,9 @@ static int ads7846_resume(struct spi_device *spi)
 {
        struct ads7846 *ts = dev_get_drvdata(&spi->dev);
 
+       if (device_may_wakeup(&ts->spi->dev))
+               disable_irq_wake(ts->spi->irq);
+
        spin_lock_irq(&ts->lock);
 
        ts->is_suspended = 0;
@@ -984,6 +991,15 @@ static int __devinit ads7846_probe(struct spi_device *spi)
 
        vref = pdata->keep_vref_on;
 
+       if (ts->model == 7873) {
+               /* The AD7873 is almost identical to the ADS7846
+                * keep VREF off during differential/ratiometric
+                * conversion modes
+                */
+               ts->model = 7846;
+               vref = 0;
+       }
+
        /* set up the transfers to read touchscreen state; this assumes we
         * use formula #2 for pressure, not #3.
         */
@@ -1191,6 +1207,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
        if (err)
                goto err_remove_attr_group;
 
+       device_init_wakeup(&spi->dev, pdata->wakeup);
+
        return 0;
 
  err_remove_attr_group:
@@ -1220,6 +1238,8 @@ static int __devexit ads7846_remove(struct spi_device *spi)
 {
        struct ads7846          *ts = dev_get_drvdata(&spi->dev);
 
+       device_init_wakeup(&spi->dev, false);
+
        ads784x_hwmon_unregister(spi, ts);
        input_unregister_device(ts->input);
 
index 0903f53..0a3b4ed 100644 (file)
@@ -123,7 +123,7 @@ static int ir_copy_table(struct ir_scancode_table *destin,
  * If the key is not found, returns -EINVAL, otherwise, returns 0.
  */
 static int ir_getkeycode(struct input_dev *dev,
-                        int scancode, int *keycode)
+                        unsigned int scancode, unsigned int *keycode)
 {
        int elem;
        struct ir_input_dev *ir_dev = input_get_drvdata(dev);
@@ -291,7 +291,7 @@ static int ir_insert_key(struct ir_scancode_table *rc_tab,
  * If the key is not found, returns -EINVAL, otherwise, returns 0.
  */
 static int ir_setkeycode(struct input_dev *dev,
-                        int scancode, int keycode)
+                        unsigned int scancode, unsigned int keycode)
 {
        int rc = 0;
        struct ir_input_dev *ir_dev = input_get_drvdata(dev);
index a03ef7e..852fe89 100644 (file)
@@ -9,7 +9,7 @@
 #include <linux/usb/input.h>
 
 static int dvb_usb_getkeycode(struct input_dev *dev,
-                                   int scancode, int *keycode)
+                               unsigned int scancode, unsigned int *keycode)
 {
        struct dvb_usb_device *d = input_get_drvdata(dev);
 
@@ -39,7 +39,7 @@ static int dvb_usb_getkeycode(struct input_dev *dev,
 }
 
 static int dvb_usb_setkeycode(struct input_dev *dev,
-                                   int scancode, int keycode)
+                               unsigned int scancode, unsigned int keycode)
 {
        struct dvb_usb_device *d = input_get_drvdata(dev);
 
index d16af6a..2191c8d 100644 (file)
@@ -268,6 +268,16 @@ config ISL29003
          This driver can also be built as a module.  If so, the module
          will be called isl29003.
 
+config SENSORS_TSL2550
+       tristate "Taos TSL2550 ambient light sensor"
+       depends on I2C && SYSFS
+       help
+         If you say yes here you get support for the Taos TSL2550
+         ambient light sensor.
+
+         This driver can also be built as a module.  If so, the module
+         will be called tsl2550.
+
 config EP93XX_PWM
        tristate "EP93xx PWM support"
        depends on ARCH_EP93XX
index 049ff24..27c4843 100644 (file)
@@ -21,6 +21,7 @@ obj-$(CONFIG_SGI_GRU)         += sgi-gru/
 obj-$(CONFIG_CS5535_MFGPT)     += cs5535-mfgpt.o
 obj-$(CONFIG_HP_ILO)           += hpilo.o
 obj-$(CONFIG_ISL29003)         += isl29003.o
+obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
 obj-$(CONFIG_EP93XX_PWM)       += ep93xx_pwm.o
 obj-$(CONFIG_DS1682)           += ds1682.o
 obj-$(CONFIG_TI_DAC7512)       += ti_dac7512.o
index 2cb2736..db7d0f2 100644 (file)
@@ -505,6 +505,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
         * Export the EEPROM bytes through sysfs, since that's convenient.
         * By default, only root should see the data (maybe passwords etc)
         */
+       sysfs_bin_attr_init(&at24->bin);
        at24->bin.attr.name = "eeprom";
        at24->bin.attr.mode = chip.flags & AT24_FLAG_IRUGO ? S_IRUGO : S_IRUSR;
        at24->bin.read = at24_bin_read;
similarity index 99%
rename from drivers/i2c/chips/tsl2550.c
rename to drivers/misc/tsl2550.c
index a0702f3..483ae5f 100644 (file)
@@ -47,8 +47,8 @@ struct tsl2550_data {
        struct i2c_client *client;
        struct mutex update_lock;
 
-       unsigned int power_state : 1;
-       unsigned int operating_mode : 1;
+       unsigned int power_state:1;
+       unsigned int operating_mode:1;
 };
 
 /*
index 1157d56..42e5ea4 100644 (file)
@@ -457,7 +457,7 @@ config MTD_NAND_NOMADIK
 
 config MTD_NAND_SH_FLCTL
        tristate "Support for NAND on Renesas SuperH FLCTL"
-       depends on MTD_NAND && SUPERH
+       depends on MTD_NAND && (SUPERH || ARCH_SHMOBILE)
        help
          Several Renesas SuperH CPU has FLCTL. This option enables support
          for NAND Flash using FLCTL.
index 7029cd5..0ba5b8e 100644 (file)
@@ -907,7 +907,7 @@ config SMC91X
        select CRC32
        select MII
        depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \
-               MIPS || BLACKFIN || MN10300
+               MIPS || BLACKFIN || MN10300 || COLDFIRE
        help
          This is a driver for SMC's 91x series of Ethernet chipsets,
          including the SMC91C94 and the SMC91C111. Say Y if you want it
index 8ca6391..a1d4188 100644 (file)
@@ -575,9 +575,9 @@ static int ks8695_poll(struct napi_struct *napi, int budget)
        if (work_done < budget) {
                unsigned long flags;
                spin_lock_irqsave(&ksp->rx_lock, flags);
+               __napi_complete(napi);
                /*enable rx interrupt*/
                writel(isr | mask_bit, KS8695_IRQ_VA + KS8695_INTEN);
-               __napi_complete(napi);
                spin_unlock_irqrestore(&ksp->rx_lock, flags);
        }
        return work_done;
index be81fb2..8f07525 100644 (file)
@@ -290,11 +290,6 @@ extern const struct ethtool_ops be_ethtool_ops;
 
 #define drvr_stats(adapter)            (&adapter->stats.drvr_stats)
 
-static inline unsigned int be_pci_func(struct be_adapter *adapter)
-{
-       return PCI_FUNC(adapter->pdev->devfn);
-}
-
 #define BE_SET_NETDEV_OPS(netdev, ops) (netdev->netdev_ops = ops)
 
 #define PAGE_SHIFT_4K          12
index 4b1f805..c592153 100644 (file)
@@ -465,8 +465,6 @@ int be_cmd_eq_create(struct be_adapter *adapter,
 
        req->num_pages =  cpu_to_le16(PAGES_4K_SPANNED(q_mem->va, q_mem->size));
 
-       AMAP_SET_BITS(struct amap_eq_context, func, req->context,
-                       be_pci_func(adapter));
        AMAP_SET_BITS(struct amap_eq_context, valid, req->context, 1);
        /* 4byte eqe*/
        AMAP_SET_BITS(struct amap_eq_context, size, req->context, 0);
@@ -629,7 +627,6 @@ int be_cmd_cq_create(struct be_adapter *adapter,
        AMAP_SET_BITS(struct amap_cq_context, eventable, ctxt, 1);
        AMAP_SET_BITS(struct amap_cq_context, eqid, ctxt, eq->id);
        AMAP_SET_BITS(struct amap_cq_context, armed, ctxt, 1);
-       AMAP_SET_BITS(struct amap_cq_context, func, ctxt, be_pci_func(adapter));
        be_dws_cpu_to_le(ctxt, sizeof(req->context));
 
        be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
@@ -678,7 +675,6 @@ int be_cmd_mccq_create(struct be_adapter *adapter,
 
        req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size);
 
-       AMAP_SET_BITS(struct amap_mcc_context, fid, ctxt, be_pci_func(adapter));
        AMAP_SET_BITS(struct amap_mcc_context, valid, ctxt, 1);
        AMAP_SET_BITS(struct amap_mcc_context, ring_size, ctxt,
                be_encoded_q_len(mccq->len));
@@ -727,8 +723,6 @@ int be_cmd_txq_create(struct be_adapter *adapter,
 
        AMAP_SET_BITS(struct amap_tx_context, tx_ring_size, ctxt,
                be_encoded_q_len(txq->len));
-       AMAP_SET_BITS(struct amap_tx_context, pci_func_id, ctxt,
-                       be_pci_func(adapter));
        AMAP_SET_BITS(struct amap_tx_context, ctx_valid, ctxt, 1);
        AMAP_SET_BITS(struct amap_tx_context, cq_id_send, ctxt, cq->id);
 
index 5ffb149..2d4a4b8 100644 (file)
 #define IMG_TYPE_ISCSI_BACKUP          9
 #define IMG_TYPE_FCOE_FW_ACTIVE                10
 #define IMG_TYPE_FCOE_FW_BACKUP        11
-#define IMG_TYPE_NCSI_BITFILE          13
-#define IMG_TYPE_NCSI_8051             14
+#define IMG_TYPE_NCSI_FW               13
 
 #define FLASHROM_OPER_FLASH            1
 #define FLASHROM_OPER_SAVE             2
 #define FLASH_IMAGE_MAX_SIZE_g3            (2097152) /* Max fw image size */
 #define FLASH_BIOS_IMAGE_MAX_SIZE_g3       (524288)  /* Max OPTION ROM img sz */
 #define FLASH_REDBOOT_IMAGE_MAX_SIZE_g3          (1048576)  /* Max Redboot image sz */
+#define FLASH_NCSI_IMAGE_MAX_SIZE_g3       (262144)  /* Max NSCI image sz */
 
 #define FLASH_NCSI_MAGIC               (0x16032009)
 #define FLASH_NCSI_DISABLED            (0)
 #define FLASH_FCoE_BIOS_START_g2           (524288)
 #define FLASH_REDBOOT_START_g2           (0)
 
+#define FLASH_NCSI_START_g3               (15990784)
 #define FLASH_iSCSI_PRIMARY_IMAGE_START_g3 (2097152)
 #define FLASH_iSCSI_BACKUP_IMAGE_START_g3  (4194304)
 #define FLASH_FCoE_PRIMARY_IMAGE_START_g3  (6291456)
index a703ed8..43e8032 100644 (file)
@@ -1382,7 +1382,7 @@ rx_eq_free:
 /* There are 8 evt ids per func. Retruns the evt id's bit number */
 static inline int be_evt_bit_get(struct be_adapter *adapter, u32 eq_id)
 {
-       return eq_id - 8 * be_pci_func(adapter);
+       return eq_id % 8;
 }
 
 static irqreturn_t be_intx(int irq, void *dev)
@@ -1880,8 +1880,9 @@ static int be_flash_data(struct be_adapter *adapter,
        const u8 *p = fw->data;
        struct be_cmd_write_flashrom *req = flash_cmd->va;
        struct flash_comp *pflashcomp;
+       int num_comp;
 
-       struct flash_comp gen3_flash_types[8] = {
+       struct flash_comp gen3_flash_types[9] = {
                { FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
                        FLASH_IMAGE_MAX_SIZE_g3},
                { FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
@@ -1897,7 +1898,9 @@ static int be_flash_data(struct be_adapter *adapter,
                { FLASH_FCoE_PRIMARY_IMAGE_START_g3, IMG_TYPE_FCOE_FW_ACTIVE,
                        FLASH_IMAGE_MAX_SIZE_g3},
                { FLASH_FCoE_BACKUP_IMAGE_START_g3, IMG_TYPE_FCOE_FW_BACKUP,
-                       FLASH_IMAGE_MAX_SIZE_g3}
+                       FLASH_IMAGE_MAX_SIZE_g3},
+               { FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
+                       FLASH_NCSI_IMAGE_MAX_SIZE_g3}
        };
        struct flash_comp gen2_flash_types[8] = {
                { FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
@@ -1921,11 +1924,16 @@ static int be_flash_data(struct be_adapter *adapter,
        if (adapter->generation == BE_GEN3) {
                pflashcomp = gen3_flash_types;
                filehdr_size = sizeof(struct flash_file_hdr_g3);
+               num_comp = 9;
        } else {
                pflashcomp = gen2_flash_types;
                filehdr_size = sizeof(struct flash_file_hdr_g2);
+               num_comp = 8;
        }
-       for (i = 0; i < 8; i++) {
+       for (i = 0; i < num_comp; i++) {
+               if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&
+                               memcmp(adapter->fw_ver, "3.102.148.0", 11) < 0)
+                       continue;
                if ((pflashcomp[i].optype == IMG_TYPE_REDBOOT) &&
                        (!be_flash_redboot(adapter, fw->data,
                         pflashcomp[i].offset, pflashcomp[i].size,
@@ -1985,16 +1993,7 @@ int be_load_fw(struct be_adapter *adapter, u8 *func)
        struct be_dma_mem flash_cmd;
        int status, i = 0;
        const u8 *p;
-       char fw_ver[FW_VER_LEN];
-       char fw_cfg;
-
-       status = be_cmd_get_fw_ver(adapter, fw_ver);
-       if (status)
-               return status;
 
-       fw_cfg = *(fw_ver + 2);
-       if (fw_cfg == '0')
-               fw_cfg = '1';
        strcpy(fw_file, func);
 
        status = request_firmware(&fw, fw_file, &adapter->pdev->dev);
index bf7f9ba..866905f 100644 (file)
@@ -26,6 +26,7 @@
 
 #define DRV_NAME "bfin_can"
 #define BFIN_CAN_TIMEOUT 100
+#define TX_ECHO_SKB_MAX  1
 
 /*
  * transmit and receive channels
@@ -593,7 +594,7 @@ struct net_device *alloc_bfin_candev(void)
        struct net_device *dev;
        struct bfin_can_priv *priv;
 
-       dev = alloc_candev(sizeof(*priv));
+       dev = alloc_candev(sizeof(*priv), TX_ECHO_SKB_MAX);
        if (!dev)
                return NULL;
 
index 11c8784..3345109 100644 (file)
@@ -876,9 +876,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
        return NETDEV_TX_OK;
 
 nomem:
-       if (skb)
-               dev_kfree_skb(skb);
-
+       dev_kfree_skb(skb);
        stats->tx_dropped++;
 
        return NETDEV_TX_OK;
index 7cbcfb0..9bd155e 100644 (file)
@@ -5072,7 +5072,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
        INIT_WORK(&cp->reset_task, cas_reset_task);
 
        /* Default link parameters */
-       if (link_mode >= 0 && link_mode <= 6)
+       if (link_mode >= 0 && link_mode < 6)
                cp->link_cntl = link_modes[link_mode];
        else
                cp->link_cntl = BMCR_ANENABLE;
index b85c81f..60777fd 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/delay.h>
 
 #include <linux/netdevice.h>
+#include <linux/if_vlan.h>
 #include <linux/etherdevice.h>
 #include <linux/ethtool.h>
 #include <linux/skbuff.h>
@@ -55,9 +56,9 @@ module_param(dumb_switch, int, 0444);
 MODULE_PARM_DESC(debug_level, "Number of NETIF_MSG bits to enable");
 MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus");
 
-#define CPMAC_VERSION "0.5.1"
-/* frame size + 802.1q tag */
-#define CPMAC_SKB_SIZE         (ETH_FRAME_LEN + 4)
+#define CPMAC_VERSION "0.5.2"
+/* frame size + 802.1q tag + FCS size */
+#define CPMAC_SKB_SIZE         (ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN)
 #define CPMAC_QUEUES   8
 
 /* Ethernet registers */
@@ -1136,8 +1137,9 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
        }
 
        if (phy_id == PHY_MAX_ADDR) {
-               dev_err(&pdev->dev, "no PHY present\n");
-               return -ENODEV;
+               dev_err(&pdev->dev, "no PHY present, falling back to switch on MDIO bus 0\n");
+               strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+               phy_id = pdev->id;
        }
 
        dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
@@ -1290,8 +1292,8 @@ void __devexit cpmac_exit(void)
 {
        platform_driver_unregister(&cpmac_driver);
        mdiobus_unregister(cpmac_mii);
-       mdiobus_free(cpmac_mii);
        iounmap(cpmac_mii->priv);
+       mdiobus_free(cpmac_mii);
 }
 
 module_init(cpmac_init);
index 3e453e1..9e3e875 100644 (file)
@@ -1294,6 +1294,7 @@ static void cxgb_down(struct adapter *adapter)
 
        free_irq_resources(adapter);
        quiesce_rx(adapter);
+       t3_sge_stop(adapter);
        flush_workqueue(cxgb3_wq);      /* wait for external IRQ handler */
 }
 
index 13f9869..8bd086a 100644 (file)
@@ -2385,7 +2385,7 @@ static int emac_dev_open(struct net_device *ndev)
        struct emac_priv *priv = netdev_priv(ndev);
 
        netif_carrier_off(ndev);
-       for (cnt = 0; cnt <= ETH_ALEN; cnt++)
+       for (cnt = 0; cnt < ETH_ALEN; cnt++)
                ndev->dev_addr[cnt] = priv->mac_addr[cnt];
 
        /* Configuration items */
index db05ec3..e301e26 100644 (file)
 #define E1000_RXCSUM_IPPCSE    0x00001000   /* IP payload checksum enable */
 
 /* Header split receive */
+#define E1000_RFCTL_NFSW_DIS            0x00000040
+#define E1000_RFCTL_NFSR_DIS            0x00000080
 #define E1000_RFCTL_ACK_DIS             0x00001000
 #define E1000_RFCTL_EXTEN               0x00008000
 #define E1000_RFCTL_IPV6_EX_DIS         0x00010000
index 54d03a0..8b5e157 100644 (file)
@@ -2740,6 +2740,16 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
                reg &= ~(1 << 31);
                ew32(STATUS, reg);
        }
+
+       /*
+        * work-around descriptor data corruption issue during nfs v2 udp
+        * traffic, just disable the nfs filtering capability
+        */
+       reg = er32(RFCTL);
+       reg |= (E1000_RFCTL_NFSW_DIS | E1000_RFCTL_NFSR_DIS);
+       ew32(RFCTL, reg);
+
+       return;
 }
 
 /**
index 61a7b43..b671555 100644 (file)
@@ -2021,7 +2021,6 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        /* setup the TxBD length and buffer pointer for the first BD */
-       tx_queue->tx_skbuff[tx_queue->skb_curtx] = skb;
        txbdp_start->bufPtr = dma_map_single(&priv->ofdev->dev, skb->data,
                        skb_headlen(skb), DMA_TO_DEVICE);
 
@@ -2053,6 +2052,10 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        txbdp_start->lstatus = lstatus;
 
+       eieio(); /* force lstatus write before tx_skbuff */
+
+       tx_queue->tx_skbuff[tx_queue->skb_curtx] = skb;
+
        /* Update the current skb pointer to the next entry we will use
         * (wrapping if necessary) */
        tx_queue->skb_curtx = (tx_queue->skb_curtx + 1) &
index e8e33bb..2c9b3af 100644 (file)
@@ -1651,6 +1651,8 @@ static int irda_usb_probe(struct usb_interface *intf,
 
        self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *),
                                GFP_KERNEL);
+       if (!self->rx_urb)
+               goto err_free_net;
 
        for (i = 0; i < self->max_rx_urb; i++) {
                self->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
@@ -1783,6 +1785,8 @@ err_out_2:
 err_out_1:
        for (i = 0; i < self->max_rx_urb; i++)
                usb_free_urb(self->rx_urb[i]);
+       kfree(self->rx_urb);
+err_free_net:
        free_netdev(net);
 err_out:
        return ret;
index b40a851..0da94b2 100644 (file)
@@ -423,6 +423,11 @@ struct qlcnic_adapter_stats {
        u64  lro_pkts;
        u64  rxbytes;
        u64  txbytes;
+       u64  lrobytes;
+       u64  lso_frames;
+       u64  xmit_on;
+       u64  xmit_off;
+       u64  skb_alloc_failure;
 };
 
 /*
@@ -1095,11 +1100,11 @@ struct qlcnic_brdinfo {
 
 static const struct qlcnic_brdinfo qlcnic_boards[] = {
        {0x1077, 0x8020, 0x1077, 0x203,
-               "8200 Series Single Port 10GbE Converged Network Adapter \
-               (TCP/IP Networking)"},
+               "8200 Series Single Port 10GbE Converged Network Adapter "
+               "(TCP/IP Networking)"},
        {0x1077, 0x8020, 0x1077, 0x207,
-               "8200 Series Dual Port 10GbE Converged Network Adapter \
-               (TCP/IP Networking)"},
+               "8200 Series Dual Port 10GbE Converged Network Adapter "
+               "(TCP/IP Networking)"},
        {0x1077, 0x8020, 0x1077, 0x20b,
                "3200 Series Dual Port 10Gb Intelligent Ethernet Adapter"},
        {0x1077, 0x8020, 0x1077, 0x20c,
index 8da6ec8..f83e15f 100644 (file)
@@ -59,6 +59,17 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = {
                QLC_SIZEOF(stats.rxbytes), QLC_OFF(stats.rxbytes)},
        {"tx_bytes",
                QLC_SIZEOF(stats.txbytes), QLC_OFF(stats.txbytes)},
+       {"lrobytes",
+               QLC_SIZEOF(stats.lrobytes), QLC_OFF(stats.lrobytes)},
+       {"lso_frames",
+               QLC_SIZEOF(stats.lso_frames), QLC_OFF(stats.lso_frames)},
+       {"xmit_on",
+               QLC_SIZEOF(stats.xmit_on), QLC_OFF(stats.xmit_on)},
+       {"xmit_off",
+               QLC_SIZEOF(stats.xmit_off), QLC_OFF(stats.xmit_off)},
+       {"skb_alloc_failure", QLC_SIZEOF(stats.skb_alloc_failure),
+               QLC_OFF(stats.skb_alloc_failure)},
+
 };
 
 #define QLCNIC_STATS_LEN       ARRAY_SIZE(qlcnic_gstrings_stats)
@@ -785,6 +796,11 @@ qlcnic_get_ethtool_stats(struct net_device *dev,
        }
 }
 
+static u32 qlcnic_get_tx_csum(struct net_device *dev)
+{
+       return dev->features & NETIF_F_IP_CSUM;
+}
+
 static u32 qlcnic_get_rx_csum(struct net_device *dev)
 {
        struct qlcnic_adapter *adapter = netdev_priv(dev);
@@ -995,6 +1011,7 @@ const struct ethtool_ops qlcnic_ethtool_ops = {
        .set_ringparam = qlcnic_set_ringparam,
        .get_pauseparam = qlcnic_get_pauseparam,
        .set_pauseparam = qlcnic_set_pauseparam,
+       .get_tx_csum = qlcnic_get_tx_csum,
        .set_tx_csum = ethtool_op_set_tx_csum,
        .set_sg = ethtool_op_set_sg,
        .get_tso = qlcnic_get_tso,
index 99a4d13..da00e16 100644 (file)
@@ -349,6 +349,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
        if (nr_desc >= qlcnic_tx_avail(tx_ring)) {
                netif_tx_stop_queue(tx_ring->txq);
                __netif_tx_unlock_bh(tx_ring->txq);
+               adapter->stats.xmit_off++;
                return -EBUSY;
        }
 
@@ -397,20 +398,16 @@ qlcnic_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr,
        return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
 }
 
-static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter,
-               u8 *addr, struct list_head *del_list)
+static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, u8 *addr)
 {
        struct list_head *head;
        struct qlcnic_mac_list_s *cur;
 
        /* look up if already exists */
-       list_for_each(head, del_list) {
+       list_for_each(head, &adapter->mac_list) {
                cur = list_entry(head, struct qlcnic_mac_list_s, list);
-
-               if (memcmp(addr, cur->mac_addr, ETH_ALEN) == 0) {
-                       list_move_tail(head, &adapter->mac_list);
+               if (memcmp(addr, cur->mac_addr, ETH_ALEN) == 0)
                        return 0;
-               }
        }
 
        cur = kzalloc(sizeof(struct qlcnic_mac_list_s), GFP_ATOMIC);
@@ -432,14 +429,9 @@ void qlcnic_set_multi(struct net_device *netdev)
        struct dev_mc_list *mc_ptr;
        u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
        u32 mode = VPORT_MISS_MODE_DROP;
-       LIST_HEAD(del_list);
-       struct list_head *head;
-       struct qlcnic_mac_list_s *cur;
 
-       list_splice_tail_init(&adapter->mac_list, &del_list);
-
-       qlcnic_nic_add_mac(adapter, adapter->mac_addr, &del_list);
-       qlcnic_nic_add_mac(adapter, bcast_addr, &del_list);
+       qlcnic_nic_add_mac(adapter, adapter->mac_addr);
+       qlcnic_nic_add_mac(adapter, bcast_addr);
 
        if (netdev->flags & IFF_PROMISC) {
                mode = VPORT_MISS_MODE_ACCEPT_ALL;
@@ -454,22 +446,12 @@ void qlcnic_set_multi(struct net_device *netdev)
 
        if (!netdev_mc_empty(netdev)) {
                netdev_for_each_mc_addr(mc_ptr, netdev) {
-                       qlcnic_nic_add_mac(adapter, mc_ptr->dmi_addr,
-                                                       &del_list);
+                       qlcnic_nic_add_mac(adapter, mc_ptr->dmi_addr);
                }
        }
 
 send_fw_cmd:
        qlcnic_nic_set_promisc(adapter, mode);
-       head = &del_list;
-       while (!list_empty(head)) {
-               cur = list_entry(head->next, struct qlcnic_mac_list_s, list);
-
-               qlcnic_sre_macaddr_change(adapter,
-                               cur->mac_addr, QLCNIC_MAC_DEL);
-               list_del(&cur->list);
-               kfree(cur);
-       }
 }
 
 int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter, u32 mode)
index ea00ab4..7c34e4e 100644 (file)
@@ -568,21 +568,123 @@ struct uni_table_desc *qlcnic_get_table_desc(const u8 *unirom, int section)
        return NULL;
 }
 
+#define FILEHEADER_SIZE (14 * 4)
+
 static int
-qlcnic_set_product_offs(struct qlcnic_adapter *adapter)
+qlcnic_validate_header(struct qlcnic_adapter *adapter)
 {
-       struct uni_table_desc *ptab_descr;
        const u8 *unirom = adapter->fw->data;
-       u32 i;
+       struct uni_table_desc *directory = (struct uni_table_desc *) &unirom[0];
+       __le32 fw_file_size = adapter->fw->size;
        __le32 entries;
+       __le32 entry_size;
+       __le32 tab_size;
+
+       if (fw_file_size < FILEHEADER_SIZE)
+               return -EINVAL;
+
+       entries = cpu_to_le32(directory->num_entries);
+       entry_size = cpu_to_le32(directory->entry_size);
+       tab_size = cpu_to_le32(directory->findex) + (entries * entry_size);
+
+       if (fw_file_size < tab_size)
+               return -EINVAL;
+
+       return 0;
+}
+
+static int
+qlcnic_validate_bootld(struct qlcnic_adapter *adapter)
+{
+       struct uni_table_desc *tab_desc;
+       struct uni_data_desc *descr;
+       const u8 *unirom = adapter->fw->data;
+       int idx = cpu_to_le32(*((int *)&unirom[adapter->file_prd_off] +
+                               QLCNIC_UNI_BOOTLD_IDX_OFF));
+       __le32 offs;
+       __le32 tab_size;
+       __le32 data_size;
+
+       tab_desc = qlcnic_get_table_desc(unirom, QLCNIC_UNI_DIR_SECT_BOOTLD);
+
+       if (!tab_desc)
+               return -EINVAL;
+
+       tab_size = cpu_to_le32(tab_desc->findex) +
+                       (cpu_to_le32(tab_desc->entry_size * (idx + 1)));
+
+       if (adapter->fw->size < tab_size)
+               return -EINVAL;
+
+       offs = cpu_to_le32(tab_desc->findex) +
+               (cpu_to_le32(tab_desc->entry_size) * (idx));
+       descr = (struct uni_data_desc *)&unirom[offs];
+
+       data_size = descr->findex + cpu_to_le32(descr->size);
+
+       if (adapter->fw->size < data_size)
+               return -EINVAL;
+
+       return 0;
+}
+
+static int
+qlcnic_validate_fw(struct qlcnic_adapter *adapter)
+{
+       struct uni_table_desc *tab_desc;
+       struct uni_data_desc *descr;
+       const u8 *unirom = adapter->fw->data;
+       int idx = cpu_to_le32(*((int *)&unirom[adapter->file_prd_off] +
+                               QLCNIC_UNI_FIRMWARE_IDX_OFF));
+       __le32 offs;
+       __le32 tab_size;
+       __le32 data_size;
+
+       tab_desc = qlcnic_get_table_desc(unirom, QLCNIC_UNI_DIR_SECT_FW);
+
+       if (!tab_desc)
+               return -EINVAL;
+
+       tab_size = cpu_to_le32(tab_desc->findex) +
+                       (cpu_to_le32(tab_desc->entry_size * (idx + 1)));
+
+       if (adapter->fw->size < tab_size)
+               return -EINVAL;
+
+       offs = cpu_to_le32(tab_desc->findex) +
+               (cpu_to_le32(tab_desc->entry_size) * (idx));
+       descr = (struct uni_data_desc *)&unirom[offs];
+       data_size = descr->findex + cpu_to_le32(descr->size);
+
+       if (adapter->fw->size < data_size)
+               return -EINVAL;
+
+       return 0;
+}
+
+static int
+qlcnic_validate_product_offs(struct qlcnic_adapter *adapter)
+{
+       struct uni_table_desc *ptab_descr;
+       const u8 *unirom = adapter->fw->data;
        int mn_present = qlcnic_has_mn(adapter);
+       __le32 entries;
+       __le32 entry_size;
+       __le32 tab_size;
+       u32 i;
 
        ptab_descr = qlcnic_get_table_desc(unirom,
                                QLCNIC_UNI_DIR_SECT_PRODUCT_TBL);
-       if (ptab_descr == NULL)
-               return -1;
+       if (!ptab_descr)
+               return -EINVAL;
 
        entries = cpu_to_le32(ptab_descr->num_entries);
+       entry_size = cpu_to_le32(ptab_descr->entry_size);
+       tab_size = cpu_to_le32(ptab_descr->findex) + (entries * entry_size);
+
+       if (adapter->fw->size < tab_size)
+               return -EINVAL;
+
 nomn:
        for (i = 0; i < entries; i++) {
 
@@ -609,7 +711,37 @@ nomn:
                mn_present = 0;
                goto nomn;
        }
-       return -1;
+       return -EINVAL;
+}
+
+static int
+qlcnic_validate_unified_romimage(struct qlcnic_adapter *adapter)
+{
+       if (qlcnic_validate_header(adapter)) {
+               dev_err(&adapter->pdev->dev,
+                               "unified image: header validation failed\n");
+               return -EINVAL;
+       }
+
+       if (qlcnic_validate_product_offs(adapter)) {
+               dev_err(&adapter->pdev->dev,
+                               "unified image: product validation failed\n");
+               return -EINVAL;
+       }
+
+       if (qlcnic_validate_bootld(adapter)) {
+               dev_err(&adapter->pdev->dev,
+                               "unified image: bootld validation failed\n");
+               return -EINVAL;
+       }
+
+       if (qlcnic_validate_fw(adapter)) {
+               dev_err(&adapter->pdev->dev,
+                               "unified image: firmware validation failed\n");
+               return -EINVAL;
+       }
+
+       return 0;
 }
 
 static
@@ -715,7 +847,7 @@ qlcnic_get_bios_version(struct qlcnic_adapter *adapter)
        bios_ver = cpu_to_le32(*((u32 *) (&fw->data[prd_off])
                                + QLCNIC_UNI_BIOS_VERSION_OFF));
 
-       return (bios_ver << 24) + ((bios_ver >> 8) & 0xff00) + (bios_ver >> 24);
+       return (bios_ver << 16) + ((bios_ver >> 8) & 0xff00) + (bios_ver >> 24);
 }
 
 int
@@ -858,7 +990,7 @@ qlcnic_validate_firmware(struct qlcnic_adapter *adapter)
        u8 fw_type = adapter->fw_type;
 
        if (fw_type == QLCNIC_UNIFIED_ROMIMAGE) {
-               if (qlcnic_set_product_offs(adapter))
+               if (qlcnic_validate_unified_romimage(adapter))
                        return -EINVAL;
 
                min_size = QLCNIC_UNI_FW_MIN_SIZE;
@@ -1114,8 +1246,10 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
        struct pci_dev *pdev = adapter->pdev;
 
        buffer->skb = dev_alloc_skb(rds_ring->skb_size);
-       if (!buffer->skb)
+       if (!buffer->skb) {
+               adapter->stats.skb_alloc_failure++;
                return -ENOMEM;
+       }
 
        skb = buffer->skb;
 
@@ -1289,7 +1423,7 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
        netif_receive_skb(skb);
 
        adapter->stats.lro_pkts++;
-       adapter->stats.rxbytes += length;
+       adapter->stats.lrobytes += length;
 
        return buffer;
 }
@@ -1505,6 +1639,8 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter,
                adapter->diag_cnt++;
 
        dev_kfree_skb_any(skb);
+       adapter->stats.rx_pkts++;
+       adapter->stats.rxbytes += length;
 
        return buffer;
 }
index 665e8e5..fc72156 100644 (file)
@@ -118,6 +118,7 @@ qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
        if (qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH) {
                netif_stop_queue(adapter->netdev);
                smp_mb();
+               adapter->stats.xmit_off++;
        }
 }
 
@@ -1385,6 +1386,7 @@ qlcnic_tso_check(struct net_device *netdev,
        int copied, offset, copy_len, hdr_len = 0, tso = 0, vlan_oob = 0;
        struct cmd_desc_type0 *hwdesc;
        struct vlan_ethhdr *vh;
+       struct qlcnic_adapter *adapter = netdev_priv(netdev);
 
        if (protocol == cpu_to_be16(ETH_P_8021Q)) {
 
@@ -1494,6 +1496,7 @@ qlcnic_tso_check(struct net_device *netdev,
 
        tx_ring->producer = producer;
        barrier();
+       adapter->stats.lso_frames++;
 }
 
 static int
@@ -1573,6 +1576,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 
        if (unlikely(no_of_desc + 2 > qlcnic_tx_avail(tx_ring))) {
                netif_stop_queue(netdev);
+               adapter->stats.xmit_off++;
                return NETDEV_TX_BUSY;
        }
 
@@ -1880,6 +1884,7 @@ static int qlcnic_process_cmd_ring(struct qlcnic_adapter *adapter)
                        if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH) {
                                netif_wake_queue(netdev);
                                adapter->tx_timeo_cnt = 0;
+                               adapter->stats.xmit_on++;
                        }
                        __netif_tx_unlock(tx_ring->txq);
                }
index dfc3573..9d3ebf3 100644 (file)
@@ -4270,7 +4270,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 
        tp->cur_tx += frags + 1;
 
-       smp_wmb();
+       wmb();
 
        RTL_W8(TxPoll, NPQ);    /* set polling bit */
 
@@ -4621,7 +4621,7 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
                 * until it does.
                 */
                tp->intr_mask = 0xffff;
-               smp_wmb();
+               wmb();
                RTL_W16(IntrMask, tp->intr_event);
        }
 
index 43bc66a..df70657 100644 (file)
@@ -923,8 +923,8 @@ static int init_shared_mem(struct s2io_nic *nic)
        tmp_v_addr = mac_control->stats_mem;
        mac_control->stats_info = (struct stat_block *)tmp_v_addr;
        memset(tmp_v_addr, 0, size);
-       DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n", dev->name,
-                 (unsigned long long)tmp_p_addr);
+       DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n",
+               dev_name(&nic->pdev->dev), (unsigned long long)tmp_p_addr);
        mac_control->stats_info->sw_stat.mem_allocated += mem_allocated;
        return SUCCESS;
 }
@@ -3480,7 +3480,7 @@ static void s2io_reset(struct s2io_nic *sp)
        struct swStat *swstats;
 
        DBG_PRINT(INIT_DBG, "%s: Resetting XFrame card %s\n",
-                 __func__, sp->dev->name);
+                 __func__, pci_name(sp->pdev));
 
        /* Back up  the PCI-X CMD reg, dont want to lose MMRBC, OST settings */
        pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(pci_cmd));
index 653bdd7..d8ec4c1 100644 (file)
@@ -4863,6 +4863,7 @@ static int sky2_resume(struct pci_dev *pdev)
        if (!hw)
                return 0;
 
+       rtnl_lock();
        err = pci_set_power_state(pdev, PCI_D0);
        if (err)
                goto out;
@@ -4884,7 +4885,6 @@ static int sky2_resume(struct pci_dev *pdev)
        sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
        napi_enable(&hw->napi);
 
-       rtnl_lock();
        for (i = 0; i < hw->ports; i++) {
                err = sky2_reattach(hw->dev[i]);
                if (err)
index 5479954..8d2772c 100644 (file)
@@ -330,6 +330,48 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
 
 #include <unit/smc91111.h>
 
+#elif defined(CONFIG_ARCH_MSM)
+
+#define SMC_CAN_USE_8BIT       0
+#define SMC_CAN_USE_16BIT      1
+#define SMC_CAN_USE_32BIT      0
+#define SMC_NOWAIT             1
+
+#define SMC_inw(a, r)          readw((a) + (r))
+#define SMC_outw(v, a, r)      writew(v, (a) + (r))
+#define SMC_insw(a, r, p, l)   readsw((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l)  writesw((a) + (r), p, l)
+
+#define SMC_IRQ_FLAGS          IRQF_TRIGGER_HIGH
+
+#elif defined(CONFIG_COLDFIRE)
+
+#define SMC_CAN_USE_8BIT       0
+#define SMC_CAN_USE_16BIT      1
+#define SMC_CAN_USE_32BIT      0
+#define SMC_NOWAIT             1
+
+static inline void mcf_insw(void *a, unsigned char *p, int l)
+{
+       u16 *wp = (u16 *) p;
+       while (l-- > 0)
+               *wp++ = readw(a);
+}
+
+static inline void mcf_outsw(void *a, unsigned char *p, int l)
+{
+       u16 *wp = (u16 *) p;
+       while (l-- > 0)
+               writew(*wp++, a);
+}
+
+#define SMC_inw(a, r)          _swapw(readw((a) + (r)))
+#define SMC_outw(v, a, r)      writew(_swapw(v), (a) + (r))
+#define SMC_insw(a, r, p, l)   mcf_insw(a + r, p, l)
+#define SMC_outsw(a, r, p, l)  mcf_outsw(a + r, p, l)
+
+#define SMC_IRQ_FLAGS          (IRQF_DISABLED)
+
 #else
 
 /*
index 0fa7688..22cf1c4 100644 (file)
@@ -5279,7 +5279,7 @@ static void tg3_poll_controller(struct net_device *dev)
        struct tg3 *tp = netdev_priv(dev);
 
        for (i = 0; i < tp->irq_cnt; i++)
-               tg3_interrupt(tp->napi[i].irq_vec, dev);
+               tg3_interrupt(tp->napi[i].irq_vec, &tp->napi[i]);
 }
 #endif
 
@@ -9776,7 +9776,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                           ADVERTISED_Pause |
                           ADVERTISED_Asym_Pause;
 
-               if (!(tp->tg3_flags2 & TG3_FLAG_10_100_ONLY))
+               if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))
                        mask |= ADVERTISED_1000baseT_Half |
                                ADVERTISED_1000baseT_Full;
 
index 93f4e83..49f05d1 100644 (file)
@@ -143,6 +143,12 @@ static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
 
 void __devinit tulip_parse_eeprom(struct net_device *dev)
 {
+       /*
+         dev is not registered at this point, so logging messages can't
+         use dev_<level> or netdev_<level> but dev->name is good via a
+         hack in the caller
+       */
+
        /* The last media info list parsed, for multiport boards.  */
        static struct mediatable *last_mediatable;
        static unsigned char *last_ee_data;
@@ -161,15 +167,14 @@ void __devinit tulip_parse_eeprom(struct net_device *dev)
                if (ee_data[0] == 0xff) {
                        if (last_mediatable) {
                                controller_index++;
-                               dev_info(&dev->dev,
-                                        "Controller %d of multiport board\n",
-                                        controller_index);
+                               pr_info("%s: Controller %d of multiport board\n",
+                                       dev->name, controller_index);
                                tp->mtable = last_mediatable;
                                ee_data = last_ee_data;
                                goto subsequent_board;
                        } else
-                               dev_info(&dev->dev,
-                                        "Missing EEPROM, this interface may not work correctly!\n");
+                               pr_info("%s: Missing EEPROM, this interface may not work correctly!\n",
+                                       dev->name);
                        return;
                }
          /* Do a fix-up based on the vendor half of the station address prefix. */
@@ -181,15 +186,14 @@ void __devinit tulip_parse_eeprom(struct net_device *dev)
                          i++;                  /* An Accton EN1207, not an outlaw Maxtech. */
                  memcpy(ee_data + 26, eeprom_fixups[i].newtable,
                                 sizeof(eeprom_fixups[i].newtable));
-                 dev_info(&dev->dev,
-                          "Old format EEPROM on '%s' board.  Using substitute media control info\n",
-                          eeprom_fixups[i].name);
+                 pr_info("%s: Old format EEPROM on '%s' board.  Using substitute media control info\n",
+                         dev->name, eeprom_fixups[i].name);
                  break;
                }
          }
          if (eeprom_fixups[i].name == NULL) { /* No fixup found. */
-                 dev_info(&dev->dev,
-                          "Old style EEPROM with no media selection information\n");
+                 pr_info("%s: Old style EEPROM with no media selection information\n",
+                         dev->name);
                return;
          }
        }
@@ -217,8 +221,8 @@ subsequent_board:
                /* there is no phy information, don't even try to build mtable */
                if (count == 0) {
                        if (tulip_debug > 0)
-                               dev_warn(&dev->dev,
-                                        "no phy info, aborting mtable build\n");
+                               pr_warning("%s: no phy info, aborting mtable build\n",
+                                          dev->name);
                        return;
                }
 
@@ -234,8 +238,10 @@ subsequent_board:
                mtable->has_nonmii = mtable->has_mii = mtable->has_reset = 0;
                mtable->csr15dir = mtable->csr15val = 0;
 
-               dev_info(&dev->dev, "EEPROM default media type %s\n",
-                        media & 0x0800 ? "Autosense" : medianame[media & MEDIA_MASK]);
+               pr_info("%s: EEPROM default media type %s\n",
+                       dev->name,
+                       media & 0x0800 ? "Autosense"
+                                      : medianame[media & MEDIA_MASK]);
                for (i = 0; i < count; i++) {
                        struct medialeaf *leaf = &mtable->mleaf[i];
 
@@ -298,17 +304,17 @@ subsequent_board:
                        }
                        if (tulip_debug > 1  &&  leaf->media == 11) {
                                unsigned char *bp = leaf->leafdata;
-                               dev_info(&dev->dev,
-                                        "MII interface PHY %d, setup/reset sequences %d/%d long, capabilities %02x %02x\n",
-                                        bp[0], bp[1], bp[2 + bp[1]*2],
-                                        bp[5 + bp[2 + bp[1]*2]*2],
-                                        bp[4 + bp[2 + bp[1]*2]*2]);
+                               pr_info("%s: MII interface PHY %d, setup/reset sequences %d/%d long, capabilities %02x %02x\n",
+                                       dev->name,
+                                       bp[0], bp[1], bp[2 + bp[1]*2],
+                                       bp[5 + bp[2 + bp[1]*2]*2],
+                                       bp[4 + bp[2 + bp[1]*2]*2]);
                        }
-                       dev_info(&dev->dev,
-                                "Index #%d - Media %s (#%d) described by a %s (%d) block\n",
-                                i, medianame[leaf->media & 15], leaf->media,
-                                leaf->type < ARRAY_SIZE(block_name) ? block_name[leaf->type] : "<unknown>",
-                                leaf->type);
+                       pr_info("%s: Index #%d - Media %s (#%d) described by a %s (%d) block\n",
+                               dev->name,
+                               i, medianame[leaf->media & 15], leaf->media,
+                               leaf->type < ARRAY_SIZE(block_name) ? block_name[leaf->type] : "<unknown>",
+                               leaf->type);
                }
                if (new_advertise)
                        tp->sym_advertise = new_advertise;
index 2fbf152..cd24e5f 100644 (file)
@@ -480,7 +480,7 @@ typhoon_hello(struct typhoon *tp)
                typhoon_inc_cmd_index(&ring->lastWrite, 1);
 
                INIT_COMMAND_NO_RESPONSE(cmd, TYPHOON_CMD_HELLO_RESP);
-               smp_wmb();
+               wmb();
                iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY);
                spin_unlock(&tp->command_lock);
        }
@@ -1311,13 +1311,15 @@ typhoon_init_interface(struct typhoon *tp)
 
        tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr);
        tp->card_state = Sleeping;
-       smp_wmb();
 
        tp->offload = TYPHOON_OFFLOAD_IP_CHKSUM | TYPHOON_OFFLOAD_TCP_CHKSUM;
        tp->offload |= TYPHOON_OFFLOAD_UDP_CHKSUM | TSO_OFFLOAD_ON;
 
        spin_lock_init(&tp->command_lock);
        spin_lock_init(&tp->state_lock);
+
+       /* Force the writes to the shared memory area out before continuing. */
+       wmb();
 }
 
 static void
index 20e3460..9e05639 100644 (file)
@@ -54,6 +54,7 @@ static const char driver_name [] = "asix";
 #define AX_CMD_WRITE_IPG0              0x12
 #define AX_CMD_WRITE_IPG1              0x13
 #define AX_CMD_READ_NODE_ID            0x13
+#define AX_CMD_WRITE_NODE_ID           0x14
 #define AX_CMD_WRITE_IPG2              0x14
 #define AX_CMD_WRITE_MULTI_FILTER      0x16
 #define AX88172_CMD_READ_NODE_ID       0x17
@@ -165,6 +166,7 @@ static const char driver_name [] = "asix";
 /* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
 struct asix_data {
        u8 multi_filter[AX_MCAST_FILTER_SIZE];
+       u8 mac_addr[ETH_ALEN];
        u8 phymode;
        u8 ledmode;
        u8 eeprom_len;
@@ -732,6 +734,30 @@ static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
        return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
 }
 
+static int asix_set_mac_address(struct net_device *net, void *p)
+{
+       struct usbnet *dev = netdev_priv(net);
+       struct asix_data *data = (struct asix_data *)&dev->data;
+       struct sockaddr *addr = p;
+
+       if (netif_running(net))
+               return -EBUSY;
+       if (!is_valid_ether_addr(addr->sa_data))
+               return -EADDRNOTAVAIL;
+
+       memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
+
+       /* We use the 20 byte dev->data
+        * for our 6 byte mac buffer
+        * to avoid allocating memory that
+        * is tricky to free later */
+       memcpy(data->mac_addr, addr->sa_data, ETH_ALEN);
+       asix_write_cmd_async(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
+                                                       data->mac_addr);
+
+       return 0;
+}
+
 /* We need to override some ethtool_ops so we require our
    own structure so we don't interfere with other usbnet
    devices that may be connected at the same time. */
@@ -919,7 +945,7 @@ static const struct net_device_ops ax88772_netdev_ops = {
        .ndo_start_xmit         = usbnet_start_xmit,
        .ndo_tx_timeout         = usbnet_tx_timeout,
        .ndo_change_mtu         = usbnet_change_mtu,
-       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_set_mac_address    = asix_set_mac_address,
        .ndo_validate_addr      = eth_validate_addr,
        .ndo_do_ioctl           = asix_ioctl,
        .ndo_set_multicast_list = asix_set_multicast,
@@ -1213,7 +1239,7 @@ static const struct net_device_ops ax88178_netdev_ops = {
        .ndo_stop               = usbnet_stop,
        .ndo_start_xmit         = usbnet_start_xmit,
        .ndo_tx_timeout         = usbnet_tx_timeout,
-       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_set_mac_address    = asix_set_mac_address,
        .ndo_validate_addr      = eth_validate_addr,
        .ndo_set_multicast_list = asix_set_multicast,
        .ndo_do_ioctl           = asix_ioctl,
index 5d02f02..b90d876 100644 (file)
@@ -177,7 +177,7 @@ PEGASUS_DEV( "USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0x400c,
 PEGASUS_DEV( "USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0xabc1,
                DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0x200c,
-               DEFAULT_GPIO_RESET | PEGASUS_II )       
+               DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "Accton USB 10/100 Ethernet Adapter", VENDOR_ACCTON, 0x1046,
                DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "SpeedStream USB 10/100 Ethernet", VENDOR_ACCTON, 0x5046,
@@ -208,6 +208,8 @@ PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100,
  */
 PEGASUS_DEV_CLASS( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121, 0x00,
                DEFAULT_GPIO_RESET | PEGASUS_II )
+PEGASUS_DEV( "Belkin F5U122 10/100 USB Ethernet", VENDOR_BELKIN, 0x0122,
+               DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
                DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,
@@ -249,7 +251,7 @@ PEGASUS_DEV( "GIGABYTE GN-BR402W Wireless Router", VENDOR_GIGABYTE, 0x8002,
 PEGASUS_DEV( "Hawking UF100 10/100 Ethernet", VENDOR_HAWKING, 0x400c,
                DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "HP hn210c Ethernet USB", VENDOR_HP, 0x811c,
-               DEFAULT_GPIO_RESET | PEGASUS_II )       
+               DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "IO DATA USB ET/TX", VENDOR_IODATA, 0x0904,
                DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "IO DATA USB ET/TX-S", VENDOR_IODATA, 0x0913,
index 698d567..dc5018a 100644 (file)
@@ -5255,7 +5255,8 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
        WepKeyRid wkr;
        int rc;
 
-       WARN_ON(keylen == 0);
+       if (WARN_ON(keylen == 0))
+               return -1;
 
        memset(&wkr, 0, sizeof(wkr));
        wkr.len = cpu_to_le16(sizeof(wkr));
index 8c8ce67..dc662b7 100644 (file)
@@ -166,6 +166,7 @@ struct ar9170 {
        struct ath_common common;
        struct mutex mutex;
        enum ar9170_device_state state;
+       bool registered;
        unsigned long bad_hw_nagger;
 
        int (*open)(struct ar9170 *);
index 08dc42d..257c734 100644 (file)
@@ -2701,7 +2701,8 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev)
        dev_info(pdev, "Atheros AR9170 is registered as '%s'\n",
                 wiphy_name(ar->hw->wiphy));
 
-       return err;
+       ar->registered = true;
+       return 0;
 
 err_unreg:
        ieee80211_unregister_hw(ar->hw);
@@ -2712,11 +2713,14 @@ err_out:
 
 void ar9170_unregister(struct ar9170 *ar)
 {
+       if (ar->registered) {
 #ifdef CONFIG_AR9170_LEDS
-       ar9170_unregister_leds(ar);
+               ar9170_unregister_leds(ar);
 #endif /* CONFIG_AR9170_LEDS */
 
-       kfree_skb(ar->rx_failover);
        ieee80211_unregister_hw(ar->hw);
+       }
+
+       kfree_skb(ar->rx_failover);
        mutex_destroy(&ar->mutex);
 }
index 0f36118..4e30197 100644 (file)
@@ -582,43 +582,6 @@ static int ar9170_usb_upload(struct ar9170_usb *aru, const void *data,
        return 0;
 }
 
-static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
-{
-       int err = 0;
-
-       err = request_firmware(&aru->firmware, "ar9170.fw",
-                              &aru->udev->dev);
-       if (!err) {
-               aru->init_values = NULL;
-               return 0;
-       }
-
-       if (aru->req_one_stage_fw) {
-               dev_err(&aru->udev->dev, "ar9170.fw firmware file "
-                       "not found and is required for this device\n");
-               return -EINVAL;
-       }
-
-       dev_err(&aru->udev->dev, "ar9170.fw firmware file "
-               "not found, trying old firmware...\n");
-
-       err = request_firmware(&aru->init_values, "ar9170-1.fw",
-                              &aru->udev->dev);
-       if (err) {
-               dev_err(&aru->udev->dev, "file with init values not found.\n");
-               return err;
-       }
-
-       err = request_firmware(&aru->firmware, "ar9170-2.fw", &aru->udev->dev);
-       if (err) {
-               release_firmware(aru->init_values);
-               dev_err(&aru->udev->dev, "firmware file not found.\n");
-               return err;
-       }
-
-       return err;
-}
-
 static int ar9170_usb_reset(struct ar9170_usb *aru)
 {
        int ret, lock = (aru->intf->condition != USB_INTERFACE_BINDING);
@@ -757,6 +720,103 @@ err_out:
        return err;
 }
 
+static void ar9170_usb_firmware_failed(struct ar9170_usb *aru)
+{
+       struct device *parent = aru->udev->dev.parent;
+
+       /* unbind anything failed */
+       if (parent)
+               down(&parent->sem);
+       device_release_driver(&aru->udev->dev);
+       if (parent)
+               up(&parent->sem);
+}
+
+static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
+{
+       struct ar9170_usb *aru = context;
+       int err;
+
+       aru->firmware = fw;
+
+       if (!fw) {
+               dev_err(&aru->udev->dev, "firmware file not found.\n");
+               goto err_freefw;
+       }
+
+       err = ar9170_usb_init_device(aru);
+       if (err)
+               goto err_freefw;
+
+       err = ar9170_usb_open(&aru->common);
+       if (err)
+               goto err_unrx;
+
+       err = ar9170_register(&aru->common, &aru->udev->dev);
+
+       ar9170_usb_stop(&aru->common);
+       if (err)
+               goto err_unrx;
+
+       return;
+
+ err_unrx:
+       ar9170_usb_cancel_urbs(aru);
+
+ err_freefw:
+       ar9170_usb_firmware_failed(aru);
+}
+
+static void ar9170_usb_firmware_inits(const struct firmware *fw,
+                                     void *context)
+{
+       struct ar9170_usb *aru = context;
+       int err;
+
+       if (!fw) {
+               dev_err(&aru->udev->dev, "file with init values not found.\n");
+               ar9170_usb_firmware_failed(aru);
+               return;
+       }
+
+       aru->init_values = fw;
+
+       /* ok so we have the init values -- get code for two-stage */
+
+       err = request_firmware_nowait(THIS_MODULE, 1, "ar9170-2.fw",
+                                     &aru->udev->dev, GFP_KERNEL, aru,
+                                     ar9170_usb_firmware_finish);
+       if (err)
+               ar9170_usb_firmware_failed(aru);
+}
+
+static void ar9170_usb_firmware_step2(const struct firmware *fw, void *context)
+{
+       struct ar9170_usb *aru = context;
+       int err;
+
+       if (fw) {
+               ar9170_usb_firmware_finish(fw, context);
+               return;
+       }
+
+       if (aru->req_one_stage_fw) {
+               dev_err(&aru->udev->dev, "ar9170.fw firmware file "
+                       "not found and is required for this device\n");
+               ar9170_usb_firmware_failed(aru);
+               return;
+       }
+
+       dev_err(&aru->udev->dev, "ar9170.fw firmware file "
+               "not found, trying old firmware...\n");
+
+       err = request_firmware_nowait(THIS_MODULE, 1, "ar9170-1.fw",
+                                     &aru->udev->dev, GFP_KERNEL, aru,
+                                     ar9170_usb_firmware_inits);
+       if (err)
+               ar9170_usb_firmware_failed(aru);
+}
+
 static bool ar9170_requires_one_stage(const struct usb_device_id *id)
 {
        if (!id->driver_info)
@@ -814,33 +874,9 @@ static int ar9170_usb_probe(struct usb_interface *intf,
        if (err)
                goto err_freehw;
 
-       err = ar9170_usb_request_firmware(aru);
-       if (err)
-               goto err_freehw;
-
-       err = ar9170_usb_init_device(aru);
-       if (err)
-               goto err_freefw;
-
-       err = ar9170_usb_open(ar);
-       if (err)
-               goto err_unrx;
-
-       err = ar9170_register(ar, &udev->dev);
-
-       ar9170_usb_stop(ar);
-       if (err)
-               goto err_unrx;
-
-       return 0;
-
-err_unrx:
-       ar9170_usb_cancel_urbs(aru);
-
-err_freefw:
-       release_firmware(aru->init_values);
-       release_firmware(aru->firmware);
-
+       return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw",
+                                      &aru->udev->dev, GFP_KERNEL, aru,
+                                      ar9170_usb_firmware_step2);
 err_freehw:
        usb_set_intfdata(intf, NULL);
        usb_put_dev(udev);
@@ -860,12 +896,12 @@ static void ar9170_usb_disconnect(struct usb_interface *intf)
        ar9170_unregister(&aru->common);
        ar9170_usb_cancel_urbs(aru);
 
-       release_firmware(aru->init_values);
-       release_firmware(aru->firmware);
-
        usb_put_dev(aru->udev);
        usb_set_intfdata(intf, NULL);
        ieee80211_free_hw(aru->common.hw);
+
+       release_firmware(aru->init_values);
+       release_firmware(aru->firmware);
 }
 
 #ifdef CONFIG_PM
index 6a3f4da..10b5226 100644 (file)
@@ -429,8 +429,8 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset,
                        ee->ee_margin_tx_rx[mode] = (val >> 8) & 0x3f;
 
                AR5K_EEPROM_READ(o++, val);
-               ee->ee_i_cal[mode] = (val >> 8) & 0x3f;
-               ee->ee_q_cal[mode] = (val >> 3) & 0x1f;
+               ee->ee_i_cal[mode] = (val >> 5) & 0x3f;
+               ee->ee_q_cal[mode] = val & 0x1f;
 
                if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_4_2) {
                        AR5K_EEPROM_READ(o++, val);
index 72474c0..eff3323 100644 (file)
@@ -1386,38 +1386,39 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
                goto done;
 
        /* Calibration has finished, get the results and re-run */
+
+       /* work around empty results which can apparently happen on 5212 */
        for (i = 0; i <= 10; i++) {
                iq_corr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_CORR);
                i_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_I);
                q_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_Q);
+               ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
+                       "iq_corr:%x i_pwr:%x q_pwr:%x", iq_corr, i_pwr, q_pwr);
+               if (i_pwr && q_pwr)
+                       break;
        }
 
        i_coffd = ((i_pwr >> 1) + (q_pwr >> 1)) >> 7;
        q_coffd = q_pwr >> 7;
 
-       /* No correction */
-       if (i_coffd == 0 || q_coffd == 0)
+       /* protect against divide by 0 and loss of sign bits */
+       if (i_coffd == 0 || q_coffd < 2)
                goto done;
 
-       i_coff = ((-iq_corr) / i_coffd);
-
-       /* Boundary check */
-       if (i_coff > 31)
-               i_coff = 31;
-       if (i_coff < -32)
-               i_coff = -32;
+       i_coff = (-iq_corr) / i_coffd;
+       i_coff = clamp(i_coff, -32, 31); /* signed 6 bit */
 
-       q_coff = (((s32)i_pwr / q_coffd) - 128);
+       q_coff = (i_pwr / q_coffd) - 128;
+       q_coff = clamp(q_coff, -16, 15); /* signed 5 bit */
 
-       /* Boundary check */
-       if (q_coff > 15)
-               q_coff = 15;
-       if (q_coff < -16)
-               q_coff = -16;
+       ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
+                       "new I:%d Q:%d (i_coffd:%x q_coffd:%x)",
+                       i_coff, q_coff, i_coffd, q_coffd);
 
-       /* Commit new I/Q value */
-       AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_ENABLE |
-               ((u32)q_coff) | ((u32)i_coff << AR5K_PHY_IQ_CORR_Q_I_COFF_S));
+       /* Commit new I/Q values (set enable bit last to match HAL sources) */
+       AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_Q_I_COFF, i_coff);
+       AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_Q_Q_COFF, q_coff);
+       AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_ENABLE);
 
        /* Re-enable calibration -if we don't we'll commit
         * the same values again and again */
@@ -1873,7 +1874,7 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode)
                break;
        case AR5K_ANTMODE_FIXED_A:
                def_ant = 1;
-               tx_ant = 0;
+               tx_ant = 1;
                use_def_for_tx = true;
                update_def_on_tx = false;
                use_def_for_rts = true;
@@ -1882,7 +1883,7 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode)
                break;
        case AR5K_ANTMODE_FIXED_B:
                def_ant = 2;
-               tx_ant = 0;
+               tx_ant = 2;
                use_def_for_tx = true;
                update_def_on_tx = false;
                use_def_for_rts = true;
index 4cb9c5d..1464f89 100644 (file)
  */
 #define        AR5K_PHY_IQ                     0x9920                  /* Register Address */
 #define        AR5K_PHY_IQ_CORR_Q_Q_COFF       0x0000001f      /* Mask for q correction info */
+#define        AR5K_PHY_IQ_CORR_Q_Q_COFF_S     0
 #define        AR5K_PHY_IQ_CORR_Q_I_COFF       0x000007e0      /* Mask for i correction info */
 #define        AR5K_PHY_IQ_CORR_Q_I_COFF_S     5
 #define        AR5K_PHY_IQ_CORR_ENABLE         0x00000800      /* Enable i/q correction */
index a35a7db..cbf28e3 100644 (file)
@@ -851,12 +851,15 @@ static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah,
                                AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1,
                                AR5K_INIT_CYCRSSI_THR1);
 
-       /* I/Q correction
-        * TODO: Per channel i/q infos ? */
-       AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ,
-               AR5K_PHY_IQ_CORR_ENABLE |
-               (ee->ee_i_cal[ee_mode] << AR5K_PHY_IQ_CORR_Q_I_COFF_S) |
-               ee->ee_q_cal[ee_mode]);
+       /* I/Q correction (set enable bit last to match HAL sources) */
+       /* TODO: Per channel i/q infos ? */
+       if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_4_0) {
+               AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_Q_I_COFF,
+                           ee->ee_i_cal[ee_mode]);
+               AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_Q_Q_COFF,
+                           ee->ee_q_cal[ee_mode]);
+               AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_ENABLE);
+       }
 
        /* Heavy clipping -disable for now */
        if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_5_1)
@@ -1379,11 +1382,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
                ath5k_hw_set_sleep_clock(ah, true);
 
        /*
-        * Disable beacons and reset the register
+        * Disable beacons and reset the TSF
         */
-       AR5K_REG_DISABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE |
-                       AR5K_BEACON_RESET_TSF);
-
+       AR5K_REG_DISABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE);
+       ath5k_hw_reset_tsf(ah);
        return 0;
 }
 
index ac34a05..0e79e58 100644 (file)
@@ -1323,7 +1323,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
 
 static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
                            struct ieee80211_sta *sta, void *priv_sta,
-                           u32 changed)
+                           u32 changed, enum nl80211_channel_type oper_chan_type)
 {
        struct ath_softc *sc = priv;
        struct ath_rate_priv *ath_rc_priv = priv_sta;
@@ -1340,8 +1340,8 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
                if (sc->sc_ah->opmode != NL80211_IFTYPE_STATION)
                        return;
 
-               if (sc->hw->conf.channel_type == NL80211_CHAN_HT40MINUS ||
-                   sc->hw->conf.channel_type == NL80211_CHAN_HT40PLUS)
+               if (oper_chan_type == NL80211_CHAN_HT40MINUS ||
+                   oper_chan_type == NL80211_CHAN_HT40PLUS)
                        oper_cw40 = true;
 
                oper_sgi40 = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ?
index 47294f9..b2c8207 100644 (file)
@@ -2258,7 +2258,7 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
                if (ATH_TXQ_SETUP(sc, i)) {
                        txq = &sc->tx.txq[i];
 
-                       spin_lock(&txq->axq_lock);
+                       spin_lock_bh(&txq->axq_lock);
 
                        list_for_each_entry_safe(ac,
                                        ac_tmp, &txq->axq_acq, list) {
@@ -2279,7 +2279,7 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
                                }
                        }
 
-                       spin_unlock(&txq->axq_lock);
+                       spin_unlock_bh(&txq->axq_lock);
                }
        }
 }
index 63c2a7a..5c7aa1b 100644 (file)
@@ -3177,14 +3177,27 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len)
        int total_nr = 0;
        int i;
        struct pci_pool *pool;
-       u32 *virts[CB_NUMBER_OF_ELEMENTS_SMALL];
-       dma_addr_t phys[CB_NUMBER_OF_ELEMENTS_SMALL];
+       void **virts;
+       dma_addr_t *phys;
 
        IPW_DEBUG_TRACE("<< : \n");
 
+       virts = kmalloc(sizeof(void *) * CB_NUMBER_OF_ELEMENTS_SMALL,
+                       GFP_KERNEL);
+       if (!virts)
+               return -ENOMEM;
+
+       phys = kmalloc(sizeof(dma_addr_t) * CB_NUMBER_OF_ELEMENTS_SMALL,
+                       GFP_KERNEL);
+       if (!phys) {
+               kfree(virts);
+               return -ENOMEM;
+       }
        pool = pci_pool_create("ipw2200", priv->pci_dev, CB_MAX_LENGTH, 0, 0);
        if (!pool) {
                IPW_ERROR("pci_pool_create failed\n");
+               kfree(phys);
+               kfree(virts);
                return -ENOMEM;
        }
 
@@ -3254,6 +3267,8 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len)
                pci_pool_free(pool, virts[i], phys[i]);
 
        pci_pool_destroy(pool);
+       kfree(phys);
+       kfree(virts);
 
        return ret;
 }
index bf45391..a6d5e42 100644 (file)
@@ -797,7 +797,7 @@ struct libipw_device {
        /* Probe / Beacon management */
        struct list_head network_free_list;
        struct list_head network_list;
-       struct libipw_network *networks;
+       struct libipw_network *networks[MAX_NETWORK_COUNT];
        int scans;
        int scan_age;
 
index 1ae0b2b..2fa5586 100644 (file)
@@ -67,16 +67,17 @@ void *libipw_wiphy_privid = &libipw_wiphy_privid;
 
 static int libipw_networks_allocate(struct libipw_device *ieee)
 {
-       if (ieee->networks)
-               return 0;
-
-       ieee->networks =
-           kzalloc(MAX_NETWORK_COUNT * sizeof(struct libipw_network),
-                   GFP_KERNEL);
-       if (!ieee->networks) {
-               printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
-                      ieee->dev->name);
-               return -ENOMEM;
+       int i, j;
+
+       for (i = 0; i < MAX_NETWORK_COUNT; i++) {
+               ieee->networks[i] = kzalloc(sizeof(struct libipw_network),
+                                           GFP_KERNEL);
+               if (!ieee->networks[i]) {
+                       LIBIPW_ERROR("Out of memory allocating beacons\n");
+                       for (j = 0; j < i; j++)
+                               kfree(ieee->networks[j]);
+                       return -ENOMEM;
+               }
        }
 
        return 0;
@@ -97,15 +98,11 @@ static inline void libipw_networks_free(struct libipw_device *ieee)
 {
        int i;
 
-       if (!ieee->networks)
-               return;
-
-       for (i = 0; i < MAX_NETWORK_COUNT; i++)
-               if (ieee->networks[i].ibss_dfs)
-                       kfree(ieee->networks[i].ibss_dfs);
-
-       kfree(ieee->networks);
-       ieee->networks = NULL;
+       for (i = 0; i < MAX_NETWORK_COUNT; i++) {
+               if (ieee->networks[i]->ibss_dfs)
+                       kfree(ieee->networks[i]->ibss_dfs);
+               kfree(ieee->networks[i]);
+       }
 }
 
 void libipw_networks_age(struct libipw_device *ieee,
@@ -130,7 +127,7 @@ static void libipw_networks_initialize(struct libipw_device *ieee)
        INIT_LIST_HEAD(&ieee->network_free_list);
        INIT_LIST_HEAD(&ieee->network_list);
        for (i = 0; i < MAX_NETWORK_COUNT; i++)
-               list_add_tail(&ieee->networks[i].list,
+               list_add_tail(&ieee->networks[i]->list,
                              &ieee->network_free_list);
 }