aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/traps.c33
-rw-r--r--drivers/ata/ata_generic.c2
-rw-r--r--drivers/ata/ata_piix.c72
-rw-r--r--drivers/ata/libata-core.c16
-rw-r--r--drivers/ata/pata_ali.c2
-rw-r--r--drivers/ata/pata_amd.c2
-rw-r--r--drivers/ata/pata_atiixp.c2
-rw-r--r--drivers/ata/pata_cs5520.c2
-rw-r--r--drivers/ata/pata_cs5530.c2
-rw-r--r--drivers/ata/pata_isapnp.c2
-rw-r--r--drivers/ata/pata_it821x.c2
-rw-r--r--drivers/ata/pata_marvell.c2
-rw-r--r--drivers/ata/pata_mpc52xx.c2
-rw-r--r--drivers/ata/pata_pcmcia.c2
-rw-r--r--drivers/ata/pata_pdc2027x.c2
-rw-r--r--drivers/ata/pata_platform.c2
-rw-r--r--drivers/ata/pata_sc1200.c2
-rw-r--r--drivers/ata/pata_scc.c2
-rw-r--r--drivers/ata/pata_serverworks.c2
-rw-r--r--drivers/ata/pata_sil680.c2
-rw-r--r--drivers/ata/pata_sl82c105.c2
-rw-r--r--drivers/ata/pdc_adma.c2
-rw-r--r--drivers/ata/sata_inic162x.c2
-rw-r--r--drivers/ata/sata_mv.c2
-rw-r--r--drivers/ata/sata_nv.c2
-rw-r--r--drivers/ata/sata_promise.c6
-rw-r--r--drivers/ata/sata_qstor.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/ata/sata_sil24.c2
-rw-r--r--drivers/ata/sata_sis.c2
-rw-r--r--drivers/ata/sata_svw.c2
-rw-r--r--drivers/ata/sata_sx4.c2
-rw-r--r--drivers/ata/sata_uli.c2
-rw-r--r--drivers/ata/sata_via.c2
-rw-r--r--drivers/ata/sata_vsc.c2
-rw-r--r--drivers/char/hpet.c3
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.c2
-rw-r--r--drivers/infiniband/hw/ehca/ehca_hca.c10
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c48
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c10
-rw-r--r--drivers/infiniband/hw/ehca/ipz_pt_fn.c2
-rw-r--r--drivers/net/cxgb3/adapter.h2
-rw-r--r--drivers/net/cxgb3/common.h3
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c252
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c16
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.h2
-rw-r--r--drivers/net/cxgb3/sge.c23
-rw-r--r--drivers/net/cxgb3/t3_hw.c46
-rw-r--r--drivers/net/cxgb3/t3cdev.h3
-rw-r--r--drivers/net/ioc3-eth.c80
-rw-r--r--drivers/net/netxen/netxen_nic_hdr.h6
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c8
-rw-r--r--drivers/net/netxen/netxen_nic_main.c19
-rw-r--r--drivers/net/ps3_gelic_net.c1
-rw-r--r--drivers/s390/net/qeth.h4
-rw-r--r--drivers/s390/net/qeth_main.c158
-rw-r--r--drivers/s390/net/qeth_mpc.h1
-rw-r--r--drivers/s390/net/qeth_sys.c8
-rw-r--r--fs/nfs/super.c110
-rw-r--r--include/linux/ata.h13
-rw-r--r--include/linux/libata.h1
-rw-r--r--include/linux/sched.h1
-rw-r--r--kernel/sched.c1
-rw-r--r--kernel/sched_fair.c46
64 files changed, 731 insertions, 337 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index cfffe3dd9e83..47b0bef335bd 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -100,36 +100,45 @@ asmlinkage void machine_check(void);
100int kstack_depth_to_print = 24; 100int kstack_depth_to_print = 24;
101static unsigned int code_bytes = 64; 101static unsigned int code_bytes = 64;
102 102
103static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) 103static inline int valid_stack_ptr(struct thread_info *tinfo, void *p, unsigned size)
104{ 104{
105 return p > (void *)tinfo && 105 return p > (void *)tinfo &&
106 p < (void *)tinfo + THREAD_SIZE - 3; 106 p <= (void *)tinfo + THREAD_SIZE - size;
107} 107}
108 108
109/* The form of the top of the frame on the stack */
110struct stack_frame {
111 struct stack_frame *next_frame;
112 unsigned long return_address;
113};
114
109static inline unsigned long print_context_stack(struct thread_info *tinfo, 115static inline unsigned long print_context_stack(struct thread_info *tinfo,
110 unsigned long *stack, unsigned long ebp, 116 unsigned long *stack, unsigned long ebp,
111 struct stacktrace_ops *ops, void *data) 117 struct stacktrace_ops *ops, void *data)
112{ 118{
113 unsigned long addr;
114
115#ifdef CONFIG_FRAME_POINTER 119#ifdef CONFIG_FRAME_POINTER
116 while (valid_stack_ptr(tinfo, (void *)ebp)) { 120 struct stack_frame *frame = (struct stack_frame *)ebp;
117 unsigned long new_ebp; 121 while (valid_stack_ptr(tinfo, frame, sizeof(*frame))) {
118 addr = *(unsigned long *)(ebp + 4); 122 struct stack_frame *next;
123 unsigned long addr;
124
125 addr = frame->return_address;
119 ops->address(data, addr); 126 ops->address(data, addr);
120 /* 127 /*
121 * break out of recursive entries (such as 128 * break out of recursive entries (such as
122 * end_of_stack_stop_unwind_function). Also, 129 * end_of_stack_stop_unwind_function). Also,
123 * we can never allow a frame pointer to 130 * we can never allow a frame pointer to
124 * move downwards! 131 * move downwards!
125 */ 132 */
126 new_ebp = *(unsigned long *)ebp; 133 next = frame->next_frame;
127 if (new_ebp <= ebp) 134 if (next <= frame)
128 break; 135 break;
129 ebp = new_ebp; 136 frame = next;
130 } 137 }
131#else 138#else
132 while (valid_stack_ptr(tinfo, stack)) { 139 while (valid_stack_ptr(tinfo, stack, sizeof(*stack))) {
140 unsigned long addr;
141
133 addr = *stack++; 142 addr = *stack++;
134 if (__kernel_text_address(addr)) 143 if (__kernel_text_address(addr))
135 ops->address(data, addr); 144 ops->address(data, addr);
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 430fcf4f9ef3..945466954724 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -26,7 +26,7 @@
26#include <linux/libata.h> 26#include <linux/libata.h>
27 27
28#define DRV_NAME "ata_generic" 28#define DRV_NAME "ata_generic"
29#define DRV_VERSION "0.2.12" 29#define DRV_VERSION "0.2.13"
30 30
31/* 31/*
32 * A generic parallel ATA driver using libata 32 * A generic parallel ATA driver using libata
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 071d274afaab..e40c94f5f59d 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -94,7 +94,7 @@
94#include <linux/dmi.h> 94#include <linux/dmi.h>
95 95
96#define DRV_NAME "ata_piix" 96#define DRV_NAME "ata_piix"
97#define DRV_VERSION "2.11" 97#define DRV_VERSION "2.12"
98 98
99enum { 99enum {
100 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ 100 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */
@@ -130,6 +130,7 @@ enum {
130 ich6m_sata_ahci = 8, 130 ich6m_sata_ahci = 8,
131 ich8_sata_ahci = 9, 131 ich8_sata_ahci = 9,
132 piix_pata_mwdma = 10, /* PIIX3 MWDMA only */ 132 piix_pata_mwdma = 10, /* PIIX3 MWDMA only */
133 tolapai_sata_ahci = 11,
133 134
134 /* constants for mapping table */ 135 /* constants for mapping table */
135 P0 = 0, /* port 0 */ 136 P0 = 0, /* port 0 */
@@ -253,6 +254,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
253 { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 254 { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
254 /* SATA Controller IDE (ICH9M) */ 255 /* SATA Controller IDE (ICH9M) */
255 { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 256 { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
257 /* SATA Controller IDE (Tolapai) */
258 { 0x8086, 0x5028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, tolapai_sata_ahci },
256 259
257 { } /* terminate list */ 260 { } /* terminate list */
258}; 261};
@@ -441,12 +444,25 @@ static const struct piix_map_db ich8_map_db = {
441 }, 444 },
442}; 445};
443 446
447static const struct piix_map_db tolapai_map_db = {
448 .mask = 0x3,
449 .port_enable = 0x3,
450 .map = {
451 /* PM PS SM SS MAP */
452 { P0, NA, P1, NA }, /* 00b */
453 { RV, RV, RV, RV }, /* 01b */
454 { RV, RV, RV, RV }, /* 10b */
455 { RV, RV, RV, RV },
456 },
457};
458
444static const struct piix_map_db *piix_map_db_table[] = { 459static const struct piix_map_db *piix_map_db_table[] = {
445 [ich5_sata] = &ich5_map_db, 460 [ich5_sata] = &ich5_map_db,
446 [ich6_sata] = &ich6_map_db, 461 [ich6_sata] = &ich6_map_db,
447 [ich6_sata_ahci] = &ich6_map_db, 462 [ich6_sata_ahci] = &ich6_map_db,
448 [ich6m_sata_ahci] = &ich6m_map_db, 463 [ich6m_sata_ahci] = &ich6m_map_db,
449 [ich8_sata_ahci] = &ich8_map_db, 464 [ich8_sata_ahci] = &ich8_map_db,
465 [tolapai_sata_ahci] = &tolapai_map_db,
450}; 466};
451 467
452static struct ata_port_info piix_port_info[] = { 468static struct ata_port_info piix_port_info[] = {
@@ -560,6 +576,17 @@ static struct ata_port_info piix_port_info[] = {
560 .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ 576 .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
561 .port_ops = &piix_pata_ops, 577 .port_ops = &piix_pata_ops,
562 }, 578 },
579
580 /* tolapai_sata_ahci: 11: */
581 {
582 .sht = &piix_sht,
583 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
584 PIIX_FLAG_AHCI,
585 .pio_mask = 0x1f, /* pio0-4 */
586 .mwdma_mask = 0x07, /* mwdma0-2 */
587 .udma_mask = ATA_UDMA6,
588 .port_ops = &piix_sata_ops,
589 },
563}; 590};
564 591
565static struct pci_bits piix_enable_bits[] = { 592static struct pci_bits piix_enable_bits[] = {
@@ -908,6 +935,13 @@ static int piix_broken_suspend(void)
908 }, 935 },
909 }, 936 },
910 { 937 {
938 .ident = "Satellite U200",
939 .matches = {
940 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
941 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
942 },
943 },
944 {
911 .ident = "Satellite U205", 945 .ident = "Satellite U205",
912 .matches = { 946 .matches = {
913 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 947 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
@@ -1139,6 +1173,39 @@ static void __devinit piix_init_sata_map(struct pci_dev *pdev,
1139 hpriv->map = map; 1173 hpriv->map = map;
1140} 1174}
1141 1175
1176static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
1177{
1178 static struct dmi_system_id sysids[] = {
1179 {
1180 /* Clevo M570U sets IOCFG bit 18 if the cdrom
1181 * isn't used to boot the system which
1182 * disables the channel.
1183 */
1184 .ident = "M570U",
1185 .matches = {
1186 DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."),
1187 DMI_MATCH(DMI_PRODUCT_NAME, "M570U"),
1188 },
1189 },
1190 };
1191 u32 iocfg;
1192
1193 if (!dmi_check_system(sysids))
1194 return;
1195
1196 /* The datasheet says that bit 18 is NOOP but certain systems
1197 * seem to use it to disable a channel. Clear the bit on the
1198 * affected systems.
1199 */
1200 pci_read_config_dword(pdev, PIIX_IOCFG, &iocfg);
1201 if (iocfg & (1 << 18)) {
1202 dev_printk(KERN_INFO, &pdev->dev,
1203 "applying IOCFG bit18 quirk\n");
1204 iocfg &= ~(1 << 18);
1205 pci_write_config_dword(pdev, PIIX_IOCFG, iocfg);
1206 }
1207}
1208
1142/** 1209/**
1143 * piix_init_one - Register PIIX ATA PCI device with kernel services 1210 * piix_init_one - Register PIIX ATA PCI device with kernel services
1144 * @pdev: PCI device to register 1211 * @pdev: PCI device to register
@@ -1200,6 +1267,9 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1200 piix_map_db_table[ent->driver_data]); 1267 piix_map_db_table[ent->driver_data]);
1201 } 1268 }
1202 1269
1270 /* apply IOCFG bit18 quirk */
1271 piix_iocfg_bit18_quirk(pdev);
1272
1203 /* On ICH5, some BIOSen disable the interrupt using the 1273 /* On ICH5, some BIOSen disable the interrupt using the
1204 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3. 1274 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3.
1205 * On ICH6, this bit has the same effect, but only when 1275 * On ICH6, this bit has the same effect, but only when
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2ad4dda6d4a7..a3ee087223de 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1911,8 +1911,9 @@ int ata_dev_configure(struct ata_device *dev)
1911 dev->flags |= ATA_DFLAG_FLUSH_EXT; 1911 dev->flags |= ATA_DFLAG_FLUSH_EXT;
1912 } 1912 }
1913 1913
1914 if (ata_id_hpa_enabled(dev->id)) 1914 if (!(dev->horkage & ATA_HORKAGE_BROKEN_HPA) &&
1915 dev->n_sectors = ata_hpa_resize(dev); 1915 ata_id_hpa_enabled(dev->id))
1916 dev->n_sectors = ata_hpa_resize(dev);
1916 1917
1917 /* config NCQ */ 1918 /* config NCQ */
1918 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc)); 1919 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc));
@@ -3795,7 +3796,11 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3795 { "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, }, 3796 { "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, },
3796 { "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, }, 3797 { "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, },
3797 3798
3798 /* Devices with NCQ limits */ 3799 /* devices which puke on READ_NATIVE_MAX */
3800 { "HDS724040KLSA80", "KFAOA20N", ATA_HORKAGE_BROKEN_HPA, },
3801 { "WDC WD3200JD-00KLB0", "WD-WCAMR1130137", ATA_HORKAGE_BROKEN_HPA },
3802 { "WDC WD2500JD-00HBB0", "WD-WMAL71490727", ATA_HORKAGE_BROKEN_HPA },
3803 { "MAXTOR 6L080L4", "A93.0500", ATA_HORKAGE_BROKEN_HPA },
3799 3804
3800 /* End Marker */ 3805 /* End Marker */
3801 { } 3806 { }
@@ -3985,6 +3990,11 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
3985 tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */ 3990 tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */
3986 3991
3987 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0); 3992 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
3993 /* A clean abort indicates an original or just out of spec drive
3994 and we should continue as we issue the setup based on the
3995 drive reported working geometry */
3996 if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
3997 err_mask = 0;
3988 3998
3989 DPRINTK("EXIT, err_mask=%x\n", err_mask); 3999 DPRINTK("EXIT, err_mask=%x\n", err_mask);
3990 return err_mask; 4000 return err_mask;
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index e8a28e94fe47..94e5edc12ac9 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -34,7 +34,7 @@
34#include <linux/dmi.h> 34#include <linux/dmi.h>
35 35
36#define DRV_NAME "pata_ali" 36#define DRV_NAME "pata_ali"
37#define DRV_VERSION "0.7.4" 37#define DRV_VERSION "0.7.5"
38 38
39/* 39/*
40 * Cable special cases 40 * Cable special cases
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index b09facad63e1..04048fcf6305 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_amd" 27#define DRV_NAME "pata_amd"
28#define DRV_VERSION "0.3.8" 28#define DRV_VERSION "0.3.9"
29 29
30/** 30/**
31 * timing_setup - shared timing computation and load 31 * timing_setup - shared timing computation and load
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 80509be49e7a..86f85a2cab7e 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -22,7 +22,7 @@
22#include <linux/libata.h> 22#include <linux/libata.h>
23 23
24#define DRV_NAME "pata_atiixp" 24#define DRV_NAME "pata_atiixp"
25#define DRV_VERSION "0.4.5" 25#define DRV_VERSION "0.4.6"
26 26
27enum { 27enum {
28 ATIIXP_IDE_PIO_TIMING = 0x40, 28 ATIIXP_IDE_PIO_TIMING = 0x40,
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 7dc76e71bd55..e2459088cdcd 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -41,7 +41,7 @@
41#include <linux/libata.h> 41#include <linux/libata.h>
42 42
43#define DRV_NAME "pata_cs5520" 43#define DRV_NAME "pata_cs5520"
44#define DRV_VERSION "0.6.5" 44#define DRV_VERSION "0.6.6"
45 45
46struct pio_clocks 46struct pio_clocks
47{ 47{
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index 68f150a1e2f4..c6066aa43ec8 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -35,7 +35,7 @@
35#include <linux/dmi.h> 35#include <linux/dmi.h>
36 36
37#define DRV_NAME "pata_cs5530" 37#define DRV_NAME "pata_cs5530"
38#define DRV_VERSION "0.7.3" 38#define DRV_VERSION "0.7.4"
39 39
40static void __iomem *cs5530_port_base(struct ata_port *ap) 40static void __iomem *cs5530_port_base(struct ata_port *ap)
41{ 41{
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c
index 91a396fa5b20..9e553c54203a 100644
--- a/drivers/ata/pata_isapnp.c
+++ b/drivers/ata/pata_isapnp.c
@@ -17,7 +17,7 @@
17#include <linux/libata.h> 17#include <linux/libata.h>
18 18
19#define DRV_NAME "pata_isapnp" 19#define DRV_NAME "pata_isapnp"
20#define DRV_VERSION "0.2.1" 20#define DRV_VERSION "0.2.2"
21 21
22static struct scsi_host_template isapnp_sht = { 22static struct scsi_host_template isapnp_sht = {
23 .module = THIS_MODULE, 23 .module = THIS_MODULE,
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 7225124d96c2..ed637ae33ece 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -80,7 +80,7 @@
80 80
81 81
82#define DRV_NAME "pata_it821x" 82#define DRV_NAME "pata_it821x"
83#define DRV_VERSION "0.3.7" 83#define DRV_VERSION "0.3.8"
84 84
85struct it821x_dev 85struct it821x_dev
86{ 86{
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index 87594c04d3a3..ae206f35f747 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -192,6 +192,8 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i
192 192
193static const struct pci_device_id marvell_pci_tbl[] = { 193static const struct pci_device_id marvell_pci_tbl[] = {
194 { PCI_DEVICE(0x11AB, 0x6101), }, 194 { PCI_DEVICE(0x11AB, 0x6101), },
195 { PCI_DEVICE(0x11AB, 0x6121), },
196 { PCI_DEVICE(0x11AB, 0x6123), },
195 { PCI_DEVICE(0x11AB, 0x6145), }, 197 { PCI_DEVICE(0x11AB, 0x6145), },
196 { } /* terminate list */ 198 { } /* terminate list */
197}; 199};
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 182e83c9047b..099f4cdc4cd9 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -24,7 +24,7 @@
24 24
25 25
26#define DRV_NAME "mpc52xx_ata" 26#define DRV_NAME "mpc52xx_ata"
27#define DRV_VERSION "0.1.0ac2" 27#define DRV_VERSION "0.1.2"
28 28
29 29
30/* Private structures used by the driver */ 30/* Private structures used by the driver */
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 6da23feed039..0f2b027624d6 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -42,7 +42,7 @@
42 42
43 43
44#define DRV_NAME "pata_pcmcia" 44#define DRV_NAME "pata_pcmcia"
45#define DRV_VERSION "0.3.1" 45#define DRV_VERSION "0.3.2"
46 46
47/* 47/*
48 * Private data structure to glue stuff together 48 * Private data structure to glue stuff together
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index e3245b36269a..bb64a986e8f5 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -35,7 +35,7 @@
35#include <linux/libata.h> 35#include <linux/libata.h>
36 36
37#define DRV_NAME "pata_pdc2027x" 37#define DRV_NAME "pata_pdc2027x"
38#define DRV_VERSION "0.9" 38#define DRV_VERSION "1.0"
39#undef PDC_DEBUG 39#undef PDC_DEBUG
40 40
41#ifdef PDC_DEBUG 41#ifdef PDC_DEBUG
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index a909f793ffc1..5086d03f2d7c 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -22,7 +22,7 @@
22#include <linux/pata_platform.h> 22#include <linux/pata_platform.h>
23 23
24#define DRV_NAME "pata_platform" 24#define DRV_NAME "pata_platform"
25#define DRV_VERSION "1.0" 25#define DRV_VERSION "1.1"
26 26
27static int pio_mask = 1; 27static int pio_mask = 1;
28 28
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
index b8b2d11e4180..5edf67b1f3bf 100644
--- a/drivers/ata/pata_sc1200.c
+++ b/drivers/ata/pata_sc1200.c
@@ -40,7 +40,7 @@
40#include <linux/libata.h> 40#include <linux/libata.h>
41 41
42#define DRV_NAME "sc1200" 42#define DRV_NAME "sc1200"
43#define DRV_VERSION "0.2.5" 43#define DRV_VERSION "0.2.6"
44 44
45#define SC1200_REV_A 0x00 45#define SC1200_REV_A 0x00
46#define SC1200_REV_B1 0x01 46#define SC1200_REV_B1 0x01
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c
index 36cdbd2b0bd5..2d048ef25a5a 100644
--- a/drivers/ata/pata_scc.c
+++ b/drivers/ata/pata_scc.c
@@ -43,7 +43,7 @@
43#include <linux/libata.h> 43#include <linux/libata.h>
44 44
45#define DRV_NAME "pata_scc" 45#define DRV_NAME "pata_scc"
46#define DRV_VERSION "0.2" 46#define DRV_VERSION "0.3"
47 47
48#define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4 48#define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4
49 49
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 89691541fe59..0faf99c8f13e 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -41,7 +41,7 @@
41#include <linux/libata.h> 41#include <linux/libata.h>
42 42
43#define DRV_NAME "pata_serverworks" 43#define DRV_NAME "pata_serverworks"
44#define DRV_VERSION "0.4.1" 44#define DRV_VERSION "0.4.2"
45 45
46#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ 46#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */
47#define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */ 47#define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index b0cd52d6e3fb..40395804a66f 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -33,7 +33,7 @@
33#include <linux/libata.h> 33#include <linux/libata.h>
34 34
35#define DRV_NAME "pata_sil680" 35#define DRV_NAME "pata_sil680"
36#define DRV_VERSION "0.4.6" 36#define DRV_VERSION "0.4.7"
37 37
38#define SIL680_MMIO_BAR 5 38#define SIL680_MMIO_BAR 5
39 39
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c
index 8c2813aa6cdb..c0f43bb25956 100644
--- a/drivers/ata/pata_sl82c105.c
+++ b/drivers/ata/pata_sl82c105.c
@@ -26,7 +26,7 @@
26#include <linux/libata.h> 26#include <linux/libata.h>
27 27
28#define DRV_NAME "pata_sl82c105" 28#define DRV_NAME "pata_sl82c105"
29#define DRV_VERSION "0.3.1" 29#define DRV_VERSION "0.3.2"
30 30
31enum { 31enum {
32 /* 32 /*
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index bec1de594de8..5c79271401af 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -44,7 +44,7 @@
44#include <linux/libata.h> 44#include <linux/libata.h>
45 45
46#define DRV_NAME "pdc_adma" 46#define DRV_NAME "pdc_adma"
47#define DRV_VERSION "0.06" 47#define DRV_VERSION "1.0"
48 48
49/* macro to calculate base address for ATA regs */ 49/* macro to calculate base address for ATA regs */
50#define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40)) 50#define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40))
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index a9c948d7604a..fdbed8ecdfc2 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -28,7 +28,7 @@
28#include <scsi/scsi_device.h> 28#include <scsi/scsi_device.h>
29 29
30#define DRV_NAME "sata_inic162x" 30#define DRV_NAME "sata_inic162x"
31#define DRV_VERSION "0.2" 31#define DRV_VERSION "0.3"
32 32
33enum { 33enum {
34 MMIO_BAR = 5, 34 MMIO_BAR = 5,
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 3acf65e75eb2..11bf6c7ac122 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -72,7 +72,7 @@
72#include <linux/libata.h> 72#include <linux/libata.h>
73 73
74#define DRV_NAME "sata_mv" 74#define DRV_NAME "sata_mv"
75#define DRV_VERSION "0.81" 75#define DRV_VERSION "1.0"
76 76
77enum { 77enum {
78 /* BAR's are enumerated in terms of pci_resource_start() terms */ 78 /* BAR's are enumerated in terms of pci_resource_start() terms */
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 0b58c4df6fd2..40dc73139858 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -49,7 +49,7 @@
49#include <linux/libata.h> 49#include <linux/libata.h>
50 50
51#define DRV_NAME "sata_nv" 51#define DRV_NAME "sata_nv"
52#define DRV_VERSION "3.4" 52#define DRV_VERSION "3.5"
53 53
54#define NV_ADMA_DMA_BOUNDARY 0xffffffffUL 54#define NV_ADMA_DMA_BOUNDARY 0xffffffffUL
55 55
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index d39ebc23c4a9..25698cf0dce0 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -45,7 +45,7 @@
45#include "sata_promise.h" 45#include "sata_promise.h"
46 46
47#define DRV_NAME "sata_promise" 47#define DRV_NAME "sata_promise"
48#define DRV_VERSION "2.09" 48#define DRV_VERSION "2.10"
49 49
50enum { 50enum {
51 PDC_MAX_PORTS = 4, 51 PDC_MAX_PORTS = 4,
@@ -328,8 +328,8 @@ static const struct pci_device_id pdc_ata_pci_tbl[] = {
328 328
329 { PCI_VDEVICE(PROMISE, 0x3318), board_20319 }, 329 { PCI_VDEVICE(PROMISE, 0x3318), board_20319 },
330 { PCI_VDEVICE(PROMISE, 0x3319), board_20319 }, 330 { PCI_VDEVICE(PROMISE, 0x3319), board_20319 },
331 { PCI_VDEVICE(PROMISE, 0x3515), board_20319 }, 331 { PCI_VDEVICE(PROMISE, 0x3515), board_40518 },
332 { PCI_VDEVICE(PROMISE, 0x3519), board_20319 }, 332 { PCI_VDEVICE(PROMISE, 0x3519), board_40518 },
333 { PCI_VDEVICE(PROMISE, 0x3d17), board_40518 }, 333 { PCI_VDEVICE(PROMISE, 0x3d17), board_40518 },
334 { PCI_VDEVICE(PROMISE, 0x3d18), board_40518 }, 334 { PCI_VDEVICE(PROMISE, 0x3d18), board_40518 },
335 335
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index c8f9242e7f44..5e1dfdda698f 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -39,7 +39,7 @@
39#include <linux/libata.h> 39#include <linux/libata.h>
40 40
41#define DRV_NAME "sata_qstor" 41#define DRV_NAME "sata_qstor"
42#define DRV_VERSION "0.08" 42#define DRV_VERSION "0.09"
43 43
44enum { 44enum {
45 QS_MMIO_BAR = 4, 45 QS_MMIO_BAR = 4,
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index db6763758952..8c72e714b456 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -46,7 +46,7 @@
46#include <linux/libata.h> 46#include <linux/libata.h>
47 47
48#define DRV_NAME "sata_sil" 48#define DRV_NAME "sata_sil"
49#define DRV_VERSION "2.2" 49#define DRV_VERSION "2.3"
50 50
51enum { 51enum {
52 SIL_MMIO_BAR = 5, 52 SIL_MMIO_BAR = 5,
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 46fbbe7f121c..ef83e6b1e314 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -30,7 +30,7 @@
30#include <linux/libata.h> 30#include <linux/libata.h>
31 31
32#define DRV_NAME "sata_sil24" 32#define DRV_NAME "sata_sil24"
33#define DRV_VERSION "0.9" 33#define DRV_VERSION "1.0"
34 34
35/* 35/*
36 * Port request block (PRB) 32 bytes 36 * Port request block (PRB) 32 bytes
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 31a2f55aae66..41c1d6e8f1fe 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -43,7 +43,7 @@
43#include "sis.h" 43#include "sis.h"
44 44
45#define DRV_NAME "sata_sis" 45#define DRV_NAME "sata_sis"
46#define DRV_VERSION "0.8" 46#define DRV_VERSION "1.0"
47 47
48enum { 48enum {
49 sis_180 = 0, 49 sis_180 = 0,
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 92e877075037..d9678e7bc3a9 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -53,7 +53,7 @@
53#endif /* CONFIG_PPC_OF */ 53#endif /* CONFIG_PPC_OF */
54 54
55#define DRV_NAME "sata_svw" 55#define DRV_NAME "sata_svw"
56#define DRV_VERSION "2.2" 56#define DRV_VERSION "2.3"
57 57
58enum { 58enum {
59 /* ap->flags bits */ 59 /* ap->flags bits */
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 5193bd8647ba..97aefdd87be4 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -92,7 +92,7 @@
92#include "sata_promise.h" 92#include "sata_promise.h"
93 93
94#define DRV_NAME "sata_sx4" 94#define DRV_NAME "sata_sx4"
95#define DRV_VERSION "0.11" 95#define DRV_VERSION "0.12"
96 96
97 97
98enum { 98enum {
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c
index 78c28512f01c..e6b8b45279af 100644
--- a/drivers/ata/sata_uli.c
+++ b/drivers/ata/sata_uli.c
@@ -36,7 +36,7 @@
36#include <linux/libata.h> 36#include <linux/libata.h>
37 37
38#define DRV_NAME "sata_uli" 38#define DRV_NAME "sata_uli"
39#define DRV_VERSION "1.2" 39#define DRV_VERSION "1.3"
40 40
41enum { 41enum {
42 uli_5289 = 0, 42 uli_5289 = 0,
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index 86b7bfc17324..a4e631766eee 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -46,7 +46,7 @@
46#include <linux/libata.h> 46#include <linux/libata.h>
47 47
48#define DRV_NAME "sata_via" 48#define DRV_NAME "sata_via"
49#define DRV_VERSION "2.2" 49#define DRV_VERSION "2.3"
50 50
51enum board_ids_enum { 51enum board_ids_enum {
52 vt6420, 52 vt6420,
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c
index 24344d0d0575..1920915dfa2c 100644
--- a/drivers/ata/sata_vsc.c
+++ b/drivers/ata/sata_vsc.c
@@ -47,7 +47,7 @@
47#include <linux/libata.h> 47#include <linux/libata.h>
48 48
49#define DRV_NAME "sata_vsc" 49#define DRV_NAME "sata_vsc"
50#define DRV_VERSION "2.2" 50#define DRV_VERSION "2.3"
51 51
52enum { 52enum {
53 VSC_MMIO_BAR = 0, 53 VSC_MMIO_BAR = 0,
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 77bf4aa217a8..7ecffc9c738f 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -909,6 +909,8 @@ int hpet_alloc(struct hpet_data *hdp)
909 909
910 hpetp->hp_delta = hpet_calibrate(hpetp); 910 hpetp->hp_delta = hpet_calibrate(hpetp);
911 911
912/* This clocksource driver currently only works on ia64 */
913#ifdef CONFIG_IA64
912 if (!hpet_clocksource) { 914 if (!hpet_clocksource) {
913 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; 915 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc;
914 CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr); 916 CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr);
@@ -918,6 +920,7 @@ int hpet_alloc(struct hpet_data *hdp)
918 hpetp->hp_clocksource = &clocksource_hpet; 920 hpetp->hp_clocksource = &clocksource_hpet;
919 hpet_clocksource = &clocksource_hpet; 921 hpet_clocksource = &clocksource_hpet;
920 } 922 }
923#endif
921 924
922 return 0; 925 return 0;
923} 926}
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index 1518b41482ae..beb2a381467f 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -916,7 +916,7 @@ int cxio_rdev_open(struct cxio_rdev *rdev_p)
916 PDBG("%s opening rnic dev %s\n", __FUNCTION__, rdev_p->dev_name); 916 PDBG("%s opening rnic dev %s\n", __FUNCTION__, rdev_p->dev_name);
917 memset(&rdev_p->ctrl_qp, 0, sizeof(rdev_p->ctrl_qp)); 917 memset(&rdev_p->ctrl_qp, 0, sizeof(rdev_p->ctrl_qp));
918 if (!rdev_p->t3cdev_p) 918 if (!rdev_p->t3cdev_p)
919 rdev_p->t3cdev_p = T3CDEV(netdev_p); 919 rdev_p->t3cdev_p = dev2t3cdev(netdev_p);
920 rdev_p->t3cdev_p->ulp = (void *) rdev_p; 920 rdev_p->t3cdev_p->ulp = (void *) rdev_p;
921 err = rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_GET_PARAMS, 921 err = rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_GET_PARAMS,
922 &(rdev_p->rnic_info)); 922 &(rdev_p->rnic_info));
diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index fc19ef9fd963..cf22472d9414 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -93,9 +93,13 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
93 props->max_pd = min_t(int, rblock->max_pd, INT_MAX); 93 props->max_pd = min_t(int, rblock->max_pd, INT_MAX);
94 props->max_ah = min_t(int, rblock->max_ah, INT_MAX); 94 props->max_ah = min_t(int, rblock->max_ah, INT_MAX);
95 props->max_fmr = min_t(int, rblock->max_mr, INT_MAX); 95 props->max_fmr = min_t(int, rblock->max_mr, INT_MAX);
96 props->max_srq = 0; 96
97 props->max_srq_wr = 0; 97 if (EHCA_BMASK_GET(HCA_CAP_SRQ, shca->hca_cap)) {
98 props->max_srq_sge = 0; 98 props->max_srq = props->max_qp;
99 props->max_srq_wr = props->max_qp_wr;
100 props->max_srq_sge = 3;
101 }
102
99 props->max_pkeys = 16; 103 props->max_pkeys = 16;
100 props->local_ca_ack_delay 104 props->local_ca_ack_delay
101 = rblock->local_ca_ack_delay; 105 = rblock->local_ca_ack_delay;
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index ee06d8bd7396..a925ea52443f 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -175,41 +175,55 @@ error_data1:
175 175
176} 176}
177 177
178static void qp_event_callback(struct ehca_shca *shca, u64 eqe, 178static void dispatch_qp_event(struct ehca_shca *shca, struct ehca_qp *qp,
179 enum ib_event_type event_type, int fatal) 179 enum ib_event_type event_type)
180{ 180{
181 struct ib_event event; 181 struct ib_event event;
182 struct ehca_qp *qp;
183 u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe);
184
185 read_lock(&ehca_qp_idr_lock);
186 qp = idr_find(&ehca_qp_idr, token);
187 read_unlock(&ehca_qp_idr_lock);
188
189
190 if (!qp)
191 return;
192
193 if (fatal)
194 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
195 182
196 event.device = &shca->ib_device; 183 event.device = &shca->ib_device;
184 event.event = event_type;
197 185
198 if (qp->ext_type == EQPT_SRQ) { 186 if (qp->ext_type == EQPT_SRQ) {
199 if (!qp->ib_srq.event_handler) 187 if (!qp->ib_srq.event_handler)
200 return; 188 return;
201 189
202 event.event = fatal ? IB_EVENT_SRQ_ERR : event_type;
203 event.element.srq = &qp->ib_srq; 190 event.element.srq = &qp->ib_srq;
204 qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context); 191 qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context);
205 } else { 192 } else {
206 if (!qp->ib_qp.event_handler) 193 if (!qp->ib_qp.event_handler)
207 return; 194 return;
208 195
209 event.event = event_type;
210 event.element.qp = &qp->ib_qp; 196 event.element.qp = &qp->ib_qp;
211 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context); 197 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context);
212 } 198 }
199}
200
201static void qp_event_callback(struct ehca_shca *shca, u64 eqe,
202 enum ib_event_type event_type, int fatal)
203{
204 struct ehca_qp *qp;
205 u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe);
206
207 read_lock(&ehca_qp_idr_lock);
208 qp = idr_find(&ehca_qp_idr, token);
209 read_unlock(&ehca_qp_idr_lock);
210
211 if (!qp)
212 return;
213
214 if (fatal)
215 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
216
217 dispatch_qp_event(shca, qp, fatal && qp->ext_type == EQPT_SRQ ?
218 IB_EVENT_SRQ_ERR : event_type);
219
220 /*
221 * eHCA only processes one WQE at a time for SRQ base QPs,
222 * so the last WQE has been processed as soon as the QP enters
223 * error state.
224 */
225 if (fatal && qp->ext_type == EQPT_SRQBASE)
226 dispatch_qp_event(shca, qp, IB_EVENT_QP_LAST_WQE_REACHED);
213 227
214 return; 228 return;
215} 229}
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index b178cba96345..84d435a5ee11 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -600,10 +600,12 @@ static struct ehca_qp *internal_create_qp(
600 600
601 if (EHCA_BMASK_GET(HCA_CAP_MINI_QP, shca->hca_cap) 601 if (EHCA_BMASK_GET(HCA_CAP_MINI_QP, shca->hca_cap)
602 && !(context && udata)) { /* no small QP support in userspace ATM */ 602 && !(context && udata)) { /* no small QP support in userspace ATM */
603 ehca_determine_small_queue( 603 if (HAS_SQ(my_qp))
604 &parms.squeue, max_send_sge, is_llqp); 604 ehca_determine_small_queue(
605 ehca_determine_small_queue( 605 &parms.squeue, max_send_sge, is_llqp);
606 &parms.rqueue, max_recv_sge, is_llqp); 606 if (HAS_RQ(my_qp))
607 ehca_determine_small_queue(
608 &parms.rqueue, max_recv_sge, is_llqp);
607 parms.qp_storage = 609 parms.qp_storage =
608 (parms.squeue.is_small || parms.rqueue.is_small); 610 (parms.squeue.is_small || parms.rqueue.is_small);
609 } 611 }
diff --git a/drivers/infiniband/hw/ehca/ipz_pt_fn.c b/drivers/infiniband/hw/ehca/ipz_pt_fn.c
index a090c679c397..29bd476fbd54 100644
--- a/drivers/infiniband/hw/ehca/ipz_pt_fn.c
+++ b/drivers/infiniband/hw/ehca/ipz_pt_fn.c
@@ -172,7 +172,7 @@ static void free_small_queue_page(struct ipz_queue *queue, struct ehca_pd *pd)
172 unsigned long bit; 172 unsigned long bit;
173 int free_page = 0; 173 int free_page = 0;
174 174
175 bit = ((unsigned long)queue->queue_pages[0] & PAGE_MASK) 175 bit = ((unsigned long)queue->queue_pages[0] & ~PAGE_MASK)
176 >> (order + 9); 176 >> (order + 9);
177 177
178 mutex_lock(&pd->lock); 178 mutex_lock(&pd->lock);
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index ab72563b81ee..20e887de2545 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -50,7 +50,9 @@ typedef irqreturn_t(*intr_handler_t) (int, void *);
50 50
51struct vlan_group; 51struct vlan_group;
52 52
53struct adapter;
53struct port_info { 54struct port_info {
55 struct adapter *adapter;
54 struct vlan_group *vlan_grp; 56 struct vlan_group *vlan_grp;
55 const struct port_type_info *port_type; 57 const struct port_type_info *port_type;
56 u8 port_id; 58 u8 port_id;
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index 16378004507a..2129210a67c1 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -679,7 +679,8 @@ const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
679int t3_seeprom_read(struct adapter *adapter, u32 addr, u32 *data); 679int t3_seeprom_read(struct adapter *adapter, u32 addr, u32 *data);
680int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data); 680int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data);
681int t3_seeprom_wp(struct adapter *adapter, int enable); 681int t3_seeprom_wp(struct adapter *adapter, int enable);
682int t3_check_tpsram_version(struct adapter *adapter); 682int t3_get_tp_version(struct adapter *adapter, u32 *vers);
683int t3_check_tpsram_version(struct adapter *adapter, int *must_load);
683int t3_check_tpsram(struct adapter *adapter, u8 *tp_ram, unsigned int size); 684int t3_check_tpsram(struct adapter *adapter, u8 *tp_ram, unsigned int size);
684int t3_set_proto_sram(struct adapter *adap, u8 *data); 685int t3_set_proto_sram(struct adapter *adap, u8 *data);
685int t3_read_flash(struct adapter *adapter, unsigned int addr, 686int t3_read_flash(struct adapter *adapter, unsigned int addr,
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index dc5d26988bb3..5ab319cfe5de 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -358,11 +358,14 @@ static int init_dummy_netdevs(struct adapter *adap)
358 358
359 for (j = 0; j < pi->nqsets - 1; j++) { 359 for (j = 0; j < pi->nqsets - 1; j++) {
360 if (!adap->dummy_netdev[dummy_idx]) { 360 if (!adap->dummy_netdev[dummy_idx]) {
361 nd = alloc_netdev(0, "", ether_setup); 361 struct port_info *p;
362
363 nd = alloc_netdev(sizeof(*p), "", ether_setup);
362 if (!nd) 364 if (!nd)
363 goto free_all; 365 goto free_all;
364 366
365 nd->priv = adap; 367 p = netdev_priv(nd);
368 p->adapter = adap;
366 nd->weight = 64; 369 nd->weight = 64;
367 set_bit(__LINK_STATE_START, &nd->state); 370 set_bit(__LINK_STATE_START, &nd->state);
368 adap->dummy_netdev[dummy_idx] = nd; 371 adap->dummy_netdev[dummy_idx] = nd;
@@ -482,7 +485,8 @@ static ssize_t attr_store(struct device *d, struct device_attribute *attr,
482#define CXGB3_SHOW(name, val_expr) \ 485#define CXGB3_SHOW(name, val_expr) \
483static ssize_t format_##name(struct net_device *dev, char *buf) \ 486static ssize_t format_##name(struct net_device *dev, char *buf) \
484{ \ 487{ \
485 struct adapter *adap = dev->priv; \ 488 struct port_info *pi = netdev_priv(dev); \
489 struct adapter *adap = pi->adapter; \
486 return sprintf(buf, "%u\n", val_expr); \ 490 return sprintf(buf, "%u\n", val_expr); \
487} \ 491} \
488static ssize_t show_##name(struct device *d, struct device_attribute *attr, \ 492static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
@@ -493,7 +497,8 @@ static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
493 497
494static ssize_t set_nfilters(struct net_device *dev, unsigned int val) 498static ssize_t set_nfilters(struct net_device *dev, unsigned int val)
495{ 499{
496 struct adapter *adap = dev->priv; 500 struct port_info *pi = netdev_priv(dev);
501 struct adapter *adap = pi->adapter;
497 int min_tids = is_offload(adap) ? MC5_MIN_TIDS : 0; 502 int min_tids = is_offload(adap) ? MC5_MIN_TIDS : 0;
498 503
499 if (adap->flags & FULL_INIT_DONE) 504 if (adap->flags & FULL_INIT_DONE)
@@ -515,7 +520,8 @@ static ssize_t store_nfilters(struct device *d, struct device_attribute *attr,
515 520
516static ssize_t set_nservers(struct net_device *dev, unsigned int val) 521static ssize_t set_nservers(struct net_device *dev, unsigned int val)
517{ 522{
518 struct adapter *adap = dev->priv; 523 struct port_info *pi = netdev_priv(dev);
524 struct adapter *adap = pi->adapter;
519 525
520 if (adap->flags & FULL_INIT_DONE) 526 if (adap->flags & FULL_INIT_DONE)
521 return -EBUSY; 527 return -EBUSY;
@@ -556,9 +562,10 @@ static struct attribute_group cxgb3_attr_group = {.attrs = cxgb3_attrs };
556static ssize_t tm_attr_show(struct device *d, struct device_attribute *attr, 562static ssize_t tm_attr_show(struct device *d, struct device_attribute *attr,
557 char *buf, int sched) 563 char *buf, int sched)
558{ 564{
559 ssize_t len; 565 struct port_info *pi = netdev_priv(to_net_dev(d));
566 struct adapter *adap = pi->adapter;
560 unsigned int v, addr, bpt, cpt; 567 unsigned int v, addr, bpt, cpt;
561 struct adapter *adap = to_net_dev(d)->priv; 568 ssize_t len;
562 569
563 addr = A_TP_TX_MOD_Q1_Q0_RATE_LIMIT - sched / 2; 570 addr = A_TP_TX_MOD_Q1_Q0_RATE_LIMIT - sched / 2;
564 rtnl_lock(); 571 rtnl_lock();
@@ -581,10 +588,11 @@ static ssize_t tm_attr_show(struct device *d, struct device_attribute *attr,
581static ssize_t tm_attr_store(struct device *d, struct device_attribute *attr, 588static ssize_t tm_attr_store(struct device *d, struct device_attribute *attr,
582 const char *buf, size_t len, int sched) 589 const char *buf, size_t len, int sched)
583{ 590{
591 struct port_info *pi = netdev_priv(to_net_dev(d));
592 struct adapter *adap = pi->adapter;
593 unsigned int val;
584 char *endp; 594 char *endp;
585 ssize_t ret; 595 ssize_t ret;
586 unsigned int val;
587 struct adapter *adap = to_net_dev(d)->priv;
588 596
589 if (!capable(CAP_NET_ADMIN)) 597 if (!capable(CAP_NET_ADMIN))
590 return -EPERM; 598 return -EPERM;
@@ -721,6 +729,7 @@ static void bind_qsets(struct adapter *adap)
721} 729}
722 730
723#define FW_FNAME "t3fw-%d.%d.%d.bin" 731#define FW_FNAME "t3fw-%d.%d.%d.bin"
732#define TPSRAM_NAME "t3%c_protocol_sram-%d.%d.%d.bin"
724 733
725static int upgrade_fw(struct adapter *adap) 734static int upgrade_fw(struct adapter *adap)
726{ 735{
@@ -739,6 +748,71 @@ static int upgrade_fw(struct adapter *adap)
739 } 748 }
740 ret = t3_load_fw(adap, fw->data, fw->size); 749 ret = t3_load_fw(adap, fw->data, fw->size);
741 release_firmware(fw); 750 release_firmware(fw);
751
752 if (ret == 0)
753 dev_info(dev, "successful upgrade to firmware %d.%d.%d\n",
754 FW_VERSION_MAJOR, FW_VERSION_MINOR, FW_VERSION_MICRO);
755 else
756 dev_err(dev, "failed to upgrade to firmware %d.%d.%d\n",
757 FW_VERSION_MAJOR, FW_VERSION_MINOR, FW_VERSION_MICRO);
758
759 return ret;
760}
761
762static inline char t3rev2char(struct adapter *adapter)
763{
764 char rev = 0;
765
766 switch(adapter->params.rev) {
767 case T3_REV_B:
768 case T3_REV_B2:
769 rev = 'b';
770 break;
771 }
772 return rev;
773}
774
775int update_tpsram(struct adapter *adap)
776{
777 const struct firmware *tpsram;
778 char buf[64];
779 struct device *dev = &adap->pdev->dev;
780 int ret;
781 char rev;
782
783 rev = t3rev2char(adap);
784 if (!rev)
785 return 0;
786
787 snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
788 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
789
790 ret = request_firmware(&tpsram, buf, dev);
791 if (ret < 0) {
792 dev_err(dev, "could not load TP SRAM: unable to load %s\n",
793 buf);
794 return ret;
795 }
796
797 ret = t3_check_tpsram(adap, tpsram->data, tpsram->size);
798 if (ret)
799 goto release_tpsram;
800
801 ret = t3_set_proto_sram(adap, tpsram->data);
802 if (ret == 0)
803 dev_info(dev,
804 "successful update of protocol engine "
805 "to %d.%d.%d\n",
806 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
807 else
808 dev_err(dev, "failed to update of protocol engine %d.%d.%d\n",
809 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
810 if (ret)
811 dev_err(dev, "loading protocol SRAM failed\n");
812
813release_tpsram:
814 release_firmware(tpsram);
815
742 return ret; 816 return ret;
743} 817}
744 818
@@ -755,6 +829,7 @@ static int upgrade_fw(struct adapter *adap)
755static int cxgb_up(struct adapter *adap) 829static int cxgb_up(struct adapter *adap)
756{ 830{
757 int err = 0; 831 int err = 0;
832 int must_load;
758 833
759 if (!(adap->flags & FULL_INIT_DONE)) { 834 if (!(adap->flags & FULL_INIT_DONE)) {
760 err = t3_check_fw_version(adap); 835 err = t3_check_fw_version(adap);
@@ -763,6 +838,13 @@ static int cxgb_up(struct adapter *adap)
763 if (err) 838 if (err)
764 goto out; 839 goto out;
765 840
841 err = t3_check_tpsram_version(adap, &must_load);
842 if (err == -EINVAL) {
843 err = update_tpsram(adap);
844 if (err && must_load)
845 goto out;
846 }
847
766 err = init_dummy_netdevs(adap); 848 err = init_dummy_netdevs(adap);
767 if (err) 849 if (err)
768 goto out; 850 goto out;
@@ -858,8 +940,9 @@ static void schedule_chk_task(struct adapter *adap)
858 940
859static int offload_open(struct net_device *dev) 941static int offload_open(struct net_device *dev)
860{ 942{
861 struct adapter *adapter = dev->priv; 943 struct port_info *pi = netdev_priv(dev);
862 struct t3cdev *tdev = T3CDEV(dev); 944 struct adapter *adapter = pi->adapter;
945 struct t3cdev *tdev = dev2t3cdev(dev);
863 int adap_up = adapter->open_device_map & PORT_MASK; 946 int adap_up = adapter->open_device_map & PORT_MASK;
864 int err = 0; 947 int err = 0;
865 948
@@ -924,10 +1007,10 @@ static int offload_close(struct t3cdev *tdev)
924 1007
925static int cxgb_open(struct net_device *dev) 1008static int cxgb_open(struct net_device *dev)
926{ 1009{
927 int err;
928 struct adapter *adapter = dev->priv;
929 struct port_info *pi = netdev_priv(dev); 1010 struct port_info *pi = netdev_priv(dev);
1011 struct adapter *adapter = pi->adapter;
930 int other_ports = adapter->open_device_map & PORT_MASK; 1012 int other_ports = adapter->open_device_map & PORT_MASK;
1013 int err;
931 1014
932 if (!adapter->open_device_map && (err = cxgb_up(adapter)) < 0) 1015 if (!adapter->open_device_map && (err = cxgb_up(adapter)) < 0)
933 return err; 1016 return err;
@@ -951,17 +1034,17 @@ static int cxgb_open(struct net_device *dev)
951 1034
952static int cxgb_close(struct net_device *dev) 1035static int cxgb_close(struct net_device *dev)
953{ 1036{
954 struct adapter *adapter = dev->priv; 1037 struct port_info *pi = netdev_priv(dev);
955 struct port_info *p = netdev_priv(dev); 1038 struct adapter *adapter = pi->adapter;
956 1039
957 t3_port_intr_disable(adapter, p->port_id); 1040 t3_port_intr_disable(adapter, pi->port_id);
958 netif_stop_queue(dev); 1041 netif_stop_queue(dev);
959 p->phy.ops->power_down(&p->phy, 1); 1042 pi->phy.ops->power_down(&pi->phy, 1);
960 netif_carrier_off(dev); 1043 netif_carrier_off(dev);
961 t3_mac_disable(&p->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); 1044 t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX);
962 1045
963 spin_lock(&adapter->work_lock); /* sync with update task */ 1046 spin_lock(&adapter->work_lock); /* sync with update task */
964 clear_bit(p->port_id, &adapter->open_device_map); 1047 clear_bit(pi->port_id, &adapter->open_device_map);
965 spin_unlock(&adapter->work_lock); 1048 spin_unlock(&adapter->work_lock);
966 1049
967 if (!(adapter->open_device_map & PORT_MASK)) 1050 if (!(adapter->open_device_map & PORT_MASK))
@@ -976,13 +1059,13 @@ static int cxgb_close(struct net_device *dev)
976 1059
977static struct net_device_stats *cxgb_get_stats(struct net_device *dev) 1060static struct net_device_stats *cxgb_get_stats(struct net_device *dev)
978{ 1061{
979 struct adapter *adapter = dev->priv; 1062 struct port_info *pi = netdev_priv(dev);
980 struct port_info *p = netdev_priv(dev); 1063 struct adapter *adapter = pi->adapter;
981 struct net_device_stats *ns = &p->netstats; 1064 struct net_device_stats *ns = &pi->netstats;
982 const struct mac_stats *pstats; 1065 const struct mac_stats *pstats;
983 1066
984 spin_lock(&adapter->stats_lock); 1067 spin_lock(&adapter->stats_lock);
985 pstats = t3_mac_update_stats(&p->mac); 1068 pstats = t3_mac_update_stats(&pi->mac);
986 spin_unlock(&adapter->stats_lock); 1069 spin_unlock(&adapter->stats_lock);
987 1070
988 ns->tx_bytes = pstats->tx_octets; 1071 ns->tx_bytes = pstats->tx_octets;
@@ -1015,14 +1098,16 @@ static struct net_device_stats *cxgb_get_stats(struct net_device *dev)
1015 1098
1016static u32 get_msglevel(struct net_device *dev) 1099static u32 get_msglevel(struct net_device *dev)
1017{ 1100{
1018 struct adapter *adapter = dev->priv; 1101 struct port_info *pi = netdev_priv(dev);
1102 struct adapter *adapter = pi->adapter;
1019 1103
1020 return adapter->msg_enable; 1104 return adapter->msg_enable;
1021} 1105}
1022 1106
1023static void set_msglevel(struct net_device *dev, u32 val) 1107static void set_msglevel(struct net_device *dev, u32 val)
1024{ 1108{
1025 struct adapter *adapter = dev->priv; 1109 struct port_info *pi = netdev_priv(dev);
1110 struct adapter *adapter = pi->adapter;
1026 1111
1027 adapter->msg_enable = val; 1112 adapter->msg_enable = val;
1028} 1113}
@@ -1096,10 +1181,13 @@ static int get_eeprom_len(struct net_device *dev)
1096 1181
1097static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 1182static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1098{ 1183{
1184 struct port_info *pi = netdev_priv(dev);
1185 struct adapter *adapter = pi->adapter;
1099 u32 fw_vers = 0; 1186 u32 fw_vers = 0;
1100 struct adapter *adapter = dev->priv; 1187 u32 tp_vers = 0;
1101 1188
1102 t3_get_fw_version(adapter, &fw_vers); 1189 t3_get_fw_version(adapter, &fw_vers);
1190 t3_get_tp_version(adapter, &tp_vers);
1103 1191
1104 strcpy(info->driver, DRV_NAME); 1192 strcpy(info->driver, DRV_NAME);
1105 strcpy(info->version, DRV_VERSION); 1193 strcpy(info->version, DRV_VERSION);
@@ -1108,11 +1196,14 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1108 strcpy(info->fw_version, "N/A"); 1196 strcpy(info->fw_version, "N/A");
1109 else { 1197 else {
1110 snprintf(info->fw_version, sizeof(info->fw_version), 1198 snprintf(info->fw_version, sizeof(info->fw_version),
1111 "%s %u.%u.%u", 1199 "%s %u.%u.%u TP %u.%u.%u",
1112 G_FW_VERSION_TYPE(fw_vers) ? "T" : "N", 1200 G_FW_VERSION_TYPE(fw_vers) ? "T" : "N",
1113 G_FW_VERSION_MAJOR(fw_vers), 1201 G_FW_VERSION_MAJOR(fw_vers),
1114 G_FW_VERSION_MINOR(fw_vers), 1202 G_FW_VERSION_MINOR(fw_vers),
1115 G_FW_VERSION_MICRO(fw_vers)); 1203 G_FW_VERSION_MICRO(fw_vers),
1204 G_TP_VERSION_MAJOR(tp_vers),
1205 G_TP_VERSION_MINOR(tp_vers),
1206 G_TP_VERSION_MICRO(tp_vers));
1116 } 1207 }
1117} 1208}
1118 1209
@@ -1136,8 +1227,8 @@ static unsigned long collect_sge_port_stats(struct adapter *adapter,
1136static void get_stats(struct net_device *dev, struct ethtool_stats *stats, 1227static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
1137 u64 *data) 1228 u64 *data)
1138{ 1229{
1139 struct adapter *adapter = dev->priv;
1140 struct port_info *pi = netdev_priv(dev); 1230 struct port_info *pi = netdev_priv(dev);
1231 struct adapter *adapter = pi->adapter;
1141 const struct mac_stats *s; 1232 const struct mac_stats *s;
1142 1233
1143 spin_lock(&adapter->stats_lock); 1234 spin_lock(&adapter->stats_lock);
@@ -1205,7 +1296,8 @@ static inline void reg_block_dump(struct adapter *ap, void *buf,
1205static void get_regs(struct net_device *dev, struct ethtool_regs *regs, 1296static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
1206 void *buf) 1297 void *buf)
1207{ 1298{
1208 struct adapter *ap = dev->priv; 1299 struct port_info *pi = netdev_priv(dev);
1300 struct adapter *ap = pi->adapter;
1209 1301
1210 /* 1302 /*
1211 * Version scheme: 1303 * Version scheme:
@@ -1246,8 +1338,9 @@ static int restart_autoneg(struct net_device *dev)
1246 1338
1247static int cxgb3_phys_id(struct net_device *dev, u32 data) 1339static int cxgb3_phys_id(struct net_device *dev, u32 data)
1248{ 1340{
1341 struct port_info *pi = netdev_priv(dev);
1342 struct adapter *adapter = pi->adapter;
1249 int i; 1343 int i;
1250 struct adapter *adapter = dev->priv;
1251 1344
1252 if (data == 0) 1345 if (data == 0)
1253 data = 2; 1346 data = 2;
@@ -1408,8 +1501,8 @@ static int set_rx_csum(struct net_device *dev, u32 data)
1408 1501
1409static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e) 1502static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1410{ 1503{
1411 const struct adapter *adapter = dev->priv; 1504 struct port_info *pi = netdev_priv(dev);
1412 const struct port_info *pi = netdev_priv(dev); 1505 struct adapter *adapter = pi->adapter;
1413 const struct qset_params *q = &adapter->params.sge.qset[pi->first_qset]; 1506 const struct qset_params *q = &adapter->params.sge.qset[pi->first_qset];
1414 1507
1415 e->rx_max_pending = MAX_RX_BUFFERS; 1508 e->rx_max_pending = MAX_RX_BUFFERS;
@@ -1425,10 +1518,10 @@ static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1425 1518
1426static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e) 1519static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1427{ 1520{
1428 int i; 1521 struct port_info *pi = netdev_priv(dev);
1522 struct adapter *adapter = pi->adapter;
1429 struct qset_params *q; 1523 struct qset_params *q;
1430 struct adapter *adapter = dev->priv; 1524 int i;
1431 const struct port_info *pi = netdev_priv(dev);
1432 1525
1433 if (e->rx_pending > MAX_RX_BUFFERS || 1526 if (e->rx_pending > MAX_RX_BUFFERS ||
1434 e->rx_jumbo_pending > MAX_RX_JUMBO_BUFFERS || 1527 e->rx_jumbo_pending > MAX_RX_JUMBO_BUFFERS ||
@@ -1457,7 +1550,8 @@ static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1457 1550
1458static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c) 1551static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1459{ 1552{
1460 struct adapter *adapter = dev->priv; 1553 struct port_info *pi = netdev_priv(dev);
1554 struct adapter *adapter = pi->adapter;
1461 struct qset_params *qsp = &adapter->params.sge.qset[0]; 1555 struct qset_params *qsp = &adapter->params.sge.qset[0];
1462 struct sge_qset *qs = &adapter->sge.qs[0]; 1556 struct sge_qset *qs = &adapter->sge.qs[0];
1463 1557
@@ -1471,7 +1565,8 @@ static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1471 1565
1472static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c) 1566static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1473{ 1567{
1474 struct adapter *adapter = dev->priv; 1568 struct port_info *pi = netdev_priv(dev);
1569 struct adapter *adapter = pi->adapter;
1475 struct qset_params *q = adapter->params.sge.qset; 1570 struct qset_params *q = adapter->params.sge.qset;
1476 1571
1477 c->rx_coalesce_usecs = q->coalesce_usecs; 1572 c->rx_coalesce_usecs = q->coalesce_usecs;
@@ -1481,8 +1576,9 @@ static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1481static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e, 1576static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
1482 u8 * data) 1577 u8 * data)
1483{ 1578{
1579 struct port_info *pi = netdev_priv(dev);
1580 struct adapter *adapter = pi->adapter;
1484 int i, err = 0; 1581 int i, err = 0;
1485 struct adapter *adapter = dev->priv;
1486 1582
1487 u8 *buf = kmalloc(EEPROMSIZE, GFP_KERNEL); 1583 u8 *buf = kmalloc(EEPROMSIZE, GFP_KERNEL);
1488 if (!buf) 1584 if (!buf)
@@ -1501,10 +1597,11 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
1501static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, 1597static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
1502 u8 * data) 1598 u8 * data)
1503{ 1599{
1600 struct port_info *pi = netdev_priv(dev);
1601 struct adapter *adapter = pi->adapter;
1602 u32 aligned_offset, aligned_len, *p;
1504 u8 *buf; 1603 u8 *buf;
1505 int err = 0; 1604 int err = 0;
1506 u32 aligned_offset, aligned_len, *p;
1507 struct adapter *adapter = dev->priv;
1508 1605
1509 if (eeprom->magic != EEPROM_MAGIC) 1606 if (eeprom->magic != EEPROM_MAGIC)
1510 return -EINVAL; 1607 return -EINVAL;
@@ -1592,9 +1689,10 @@ static int in_range(int val, int lo, int hi)
1592 1689
1593static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) 1690static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1594{ 1691{
1595 int ret; 1692 struct port_info *pi = netdev_priv(dev);
1693 struct adapter *adapter = pi->adapter;
1596 u32 cmd; 1694 u32 cmd;
1597 struct adapter *adapter = dev->priv; 1695 int ret;
1598 1696
1599 if (copy_from_user(&cmd, useraddr, sizeof(cmd))) 1697 if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
1600 return -EFAULT; 1698 return -EFAULT;
@@ -1923,10 +2021,10 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1923 2021
1924static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd) 2022static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1925{ 2023{
1926 int ret, mmd;
1927 struct adapter *adapter = dev->priv;
1928 struct port_info *pi = netdev_priv(dev);
1929 struct mii_ioctl_data *data = if_mii(req); 2024 struct mii_ioctl_data *data = if_mii(req);
2025 struct port_info *pi = netdev_priv(dev);
2026 struct adapter *adapter = pi->adapter;
2027 int ret, mmd;
1930 2028
1931 switch (cmd) { 2029 switch (cmd) {
1932 case SIOCGMIIPHY: 2030 case SIOCGMIIPHY:
@@ -1994,9 +2092,9 @@ static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1994 2092
1995static int cxgb_change_mtu(struct net_device *dev, int new_mtu) 2093static int cxgb_change_mtu(struct net_device *dev, int new_mtu)
1996{ 2094{
1997 int ret;
1998 struct adapter *adapter = dev->priv;
1999 struct port_info *pi = netdev_priv(dev); 2095 struct port_info *pi = netdev_priv(dev);
2096 struct adapter *adapter = pi->adapter;
2097 int ret;
2000 2098
2001 if (new_mtu < 81) /* accommodate SACK */ 2099 if (new_mtu < 81) /* accommodate SACK */
2002 return -EINVAL; 2100 return -EINVAL;
@@ -2013,8 +2111,8 @@ static int cxgb_change_mtu(struct net_device *dev, int new_mtu)
2013 2111
2014static int cxgb_set_mac_addr(struct net_device *dev, void *p) 2112static int cxgb_set_mac_addr(struct net_device *dev, void *p)
2015{ 2113{
2016 struct adapter *adapter = dev->priv;
2017 struct port_info *pi = netdev_priv(dev); 2114 struct port_info *pi = netdev_priv(dev);
2115 struct adapter *adapter = pi->adapter;
2018 struct sockaddr *addr = p; 2116 struct sockaddr *addr = p;
2019 2117
2020 if (!is_valid_ether_addr(addr->sa_data)) 2118 if (!is_valid_ether_addr(addr->sa_data))
@@ -2050,8 +2148,8 @@ static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
2050 2148
2051static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp) 2149static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
2052{ 2150{
2053 struct adapter *adapter = dev->priv;
2054 struct port_info *pi = netdev_priv(dev); 2151 struct port_info *pi = netdev_priv(dev);
2152 struct adapter *adapter = pi->adapter;
2055 2153
2056 pi->vlan_grp = grp; 2154 pi->vlan_grp = grp;
2057 if (adapter->params.rev > 0) 2155 if (adapter->params.rev > 0)
@@ -2070,8 +2168,8 @@ static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
2070#ifdef CONFIG_NET_POLL_CONTROLLER 2168#ifdef CONFIG_NET_POLL_CONTROLLER
2071static void cxgb_netpoll(struct net_device *dev) 2169static void cxgb_netpoll(struct net_device *dev)
2072{ 2170{
2073 struct adapter *adapter = dev->priv;
2074 struct port_info *pi = netdev_priv(dev); 2171 struct port_info *pi = netdev_priv(dev);
2172 struct adapter *adapter = pi->adapter;
2075 int qidx; 2173 int qidx;
2076 2174
2077 for (qidx = pi->first_qset; qidx < pi->first_qset + pi->nqsets; qidx++) { 2175 for (qidx = pi->first_qset; qidx < pi->first_qset + pi->nqsets; qidx++) {
@@ -2088,42 +2186,6 @@ static void cxgb_netpoll(struct net_device *dev)
2088} 2186}
2089#endif 2187#endif
2090 2188
2091#define TPSRAM_NAME "t3%c_protocol_sram-%d.%d.%d.bin"
2092int update_tpsram(struct adapter *adap)
2093{
2094 const struct firmware *tpsram;
2095 char buf[64];
2096 struct device *dev = &adap->pdev->dev;
2097 int ret;
2098 char rev;
2099
2100 rev = adap->params.rev == T3_REV_B2 ? 'b' : 'a';
2101
2102 snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
2103 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
2104
2105 ret = request_firmware(&tpsram, buf, dev);
2106 if (ret < 0) {
2107 dev_err(dev, "could not load TP SRAM: unable to load %s\n",
2108 buf);
2109 return ret;
2110 }
2111
2112 ret = t3_check_tpsram(adap, tpsram->data, tpsram->size);
2113 if (ret)
2114 goto release_tpsram;
2115
2116 ret = t3_set_proto_sram(adap, tpsram->data);
2117 if (ret)
2118 dev_err(dev, "loading protocol SRAM failed\n");
2119
2120release_tpsram:
2121 release_firmware(tpsram);
2122
2123 return ret;
2124}
2125
2126
2127/* 2189/*
2128 * Periodic accumulation of MAC statistics. 2190 * Periodic accumulation of MAC statistics.
2129 */ 2191 */
@@ -2433,6 +2495,7 @@ static int __devinit init_one(struct pci_dev *pdev,
2433 2495
2434 adapter->port[i] = netdev; 2496 adapter->port[i] = netdev;
2435 pi = netdev_priv(netdev); 2497 pi = netdev_priv(netdev);
2498 pi->adapter = adapter;
2436 pi->rx_csum_offload = 1; 2499 pi->rx_csum_offload = 1;
2437 pi->nqsets = 1; 2500 pi->nqsets = 1;
2438 pi->first_qset = i; 2501 pi->first_qset = i;
@@ -2442,7 +2505,6 @@ static int __devinit init_one(struct pci_dev *pdev,
2442 netdev->irq = pdev->irq; 2505 netdev->irq = pdev->irq;
2443 netdev->mem_start = mmio_start; 2506 netdev->mem_start = mmio_start;
2444 netdev->mem_end = mmio_start + mmio_len - 1; 2507 netdev->mem_end = mmio_start + mmio_len - 1;
2445 netdev->priv = adapter;
2446 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; 2508 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
2447 netdev->features |= NETIF_F_LLTX; 2509 netdev->features |= NETIF_F_LLTX;
2448 if (pci_using_dac) 2510 if (pci_using_dac)
@@ -2467,18 +2529,11 @@ static int __devinit init_one(struct pci_dev *pdev,
2467 SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops); 2529 SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops);
2468 } 2530 }
2469 2531
2470 pci_set_drvdata(pdev, adapter->port[0]); 2532 pci_set_drvdata(pdev, adapter);
2471 if (t3_prep_adapter(adapter, ai, 1) < 0) { 2533 if (t3_prep_adapter(adapter, ai, 1) < 0) {
2472 err = -ENODEV; 2534 err = -ENODEV;
2473 goto out_free_dev; 2535 goto out_free_dev;
2474 } 2536 }
2475
2476 err = t3_check_tpsram_version(adapter);
2477 if (err == -EINVAL)
2478 err = update_tpsram(adapter);
2479
2480 if (err)
2481 goto out_free_dev;
2482 2537
2483 /* 2538 /*
2484 * The card is now ready to go. If any errors occur during device 2539 * The card is now ready to go. If any errors occur during device
@@ -2547,11 +2602,10 @@ out_release_regions:
2547 2602
2548static void __devexit remove_one(struct pci_dev *pdev) 2603static void __devexit remove_one(struct pci_dev *pdev)
2549{ 2604{
2550 struct net_device *dev = pci_get_drvdata(pdev); 2605 struct adapter *adapter = pci_get_drvdata(pdev);
2551 2606
2552 if (dev) { 2607 if (adapter) {
2553 int i; 2608 int i;
2554 struct adapter *adapter = dev->priv;
2555 2609
2556 t3_sge_stop(adapter); 2610 t3_sge_stop(adapter);
2557 sysfs_remove_group(&adapter->port[0]->dev.kobj, 2611 sysfs_remove_group(&adapter->port[0]->dev.kobj,
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index e620ed4c3ff0..bdff7baeb59d 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -593,6 +593,16 @@ int cxgb3_alloc_stid(struct t3cdev *tdev, struct cxgb3_client *client,
593 593
594EXPORT_SYMBOL(cxgb3_alloc_stid); 594EXPORT_SYMBOL(cxgb3_alloc_stid);
595 595
596/* Get the t3cdev associated with a net_device */
597struct t3cdev *dev2t3cdev(struct net_device *dev)
598{
599 const struct port_info *pi = netdev_priv(dev);
600
601 return (struct t3cdev *)pi->adapter;
602}
603
604EXPORT_SYMBOL(dev2t3cdev);
605
596static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb) 606static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
597{ 607{
598 struct cpl_smt_write_rpl *rpl = cplhdr(skb); 608 struct cpl_smt_write_rpl *rpl = cplhdr(skb);
@@ -925,7 +935,7 @@ void cxgb_neigh_update(struct neighbour *neigh)
925 struct net_device *dev = neigh->dev; 935 struct net_device *dev = neigh->dev;
926 936
927 if (dev && (is_offloading(dev))) { 937 if (dev && (is_offloading(dev))) {
928 struct t3cdev *tdev = T3CDEV(dev); 938 struct t3cdev *tdev = dev2t3cdev(dev);
929 939
930 BUG_ON(!tdev); 940 BUG_ON(!tdev);
931 t3_l2t_update(tdev, neigh); 941 t3_l2t_update(tdev, neigh);
@@ -973,9 +983,9 @@ void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
973 "device ignored.\n", __FUNCTION__); 983 "device ignored.\n", __FUNCTION__);
974 return; 984 return;
975 } 985 }
976 tdev = T3CDEV(olddev); 986 tdev = dev2t3cdev(olddev);
977 BUG_ON(!tdev); 987 BUG_ON(!tdev);
978 if (tdev != T3CDEV(newdev)) { 988 if (tdev != dev2t3cdev(newdev)) {
979 printk(KERN_WARNING "%s: Redirect to different " 989 printk(KERN_WARNING "%s: Redirect to different "
980 "offload device ignored.\n", __FUNCTION__); 990 "offload device ignored.\n", __FUNCTION__);
981 return; 991 return;
diff --git a/drivers/net/cxgb3/cxgb3_offload.h b/drivers/net/cxgb3/cxgb3_offload.h
index f15446a32efc..7a379138b5a6 100644
--- a/drivers/net/cxgb3/cxgb3_offload.h
+++ b/drivers/net/cxgb3/cxgb3_offload.h
@@ -51,6 +51,8 @@ void cxgb3_offload_deactivate(struct adapter *adapter);
51 51
52void cxgb3_set_dummy_ops(struct t3cdev *dev); 52void cxgb3_set_dummy_ops(struct t3cdev *dev);
53 53
54struct t3cdev *dev2t3cdev(struct net_device *dev);
55
54/* 56/*
55 * Client registration. Users of T3 driver must register themselves. 57 * Client registration. Users of T3 driver must register themselves.
56 * The T3 driver will call the add function of every client for each T3 58 * The T3 driver will call the add function of every client for each T3
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index a2cfd68ac757..58a5f60521ed 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -1073,7 +1073,7 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
1073{ 1073{
1074 unsigned int ndesc, pidx, credits, gen, compl; 1074 unsigned int ndesc, pidx, credits, gen, compl;
1075 const struct port_info *pi = netdev_priv(dev); 1075 const struct port_info *pi = netdev_priv(dev);
1076 struct adapter *adap = dev->priv; 1076 struct adapter *adap = pi->adapter;
1077 struct sge_qset *qs = dev2qset(dev); 1077 struct sge_qset *qs = dev2qset(dev);
1078 struct sge_txq *q = &qs->txq[TXQ_ETH]; 1078 struct sge_txq *q = &qs->txq[TXQ_ETH];
1079 1079
@@ -1326,7 +1326,8 @@ static void restart_ctrlq(unsigned long data)
1326 struct sk_buff *skb; 1326 struct sk_buff *skb;
1327 struct sge_qset *qs = (struct sge_qset *)data; 1327 struct sge_qset *qs = (struct sge_qset *)data;
1328 struct sge_txq *q = &qs->txq[TXQ_CTRL]; 1328 struct sge_txq *q = &qs->txq[TXQ_CTRL];
1329 struct adapter *adap = qs->netdev->priv; 1329 const struct port_info *pi = netdev_priv(qs->netdev);
1330 struct adapter *adap = pi->adapter;
1330 1331
1331 spin_lock(&q->lock); 1332 spin_lock(&q->lock);
1332 again:reclaim_completed_tx_imm(q); 1333 again:reclaim_completed_tx_imm(q);
@@ -1531,7 +1532,8 @@ static void restart_offloadq(unsigned long data)
1531 struct sk_buff *skb; 1532 struct sk_buff *skb;
1532 struct sge_qset *qs = (struct sge_qset *)data; 1533 struct sge_qset *qs = (struct sge_qset *)data;
1533 struct sge_txq *q = &qs->txq[TXQ_OFLD]; 1534 struct sge_txq *q = &qs->txq[TXQ_OFLD];
1534 struct adapter *adap = qs->netdev->priv; 1535 const struct port_info *pi = netdev_priv(qs->netdev);
1536 struct adapter *adap = pi->adapter;
1535 1537
1536 spin_lock(&q->lock); 1538 spin_lock(&q->lock);
1537 again:reclaim_completed_tx(adap, q); 1539 again:reclaim_completed_tx(adap, q);
@@ -1675,7 +1677,8 @@ static inline void deliver_partial_bundle(struct t3cdev *tdev,
1675 */ 1677 */
1676static int ofld_poll(struct net_device *dev, int *budget) 1678static int ofld_poll(struct net_device *dev, int *budget)
1677{ 1679{
1678 struct adapter *adapter = dev->priv; 1680 const struct port_info *pi = netdev_priv(dev);
1681 struct adapter *adapter = pi->adapter;
1679 struct sge_qset *qs = dev2qset(dev); 1682 struct sge_qset *qs = dev2qset(dev);
1680 struct sge_rspq *q = &qs->rspq; 1683 struct sge_rspq *q = &qs->rspq;
1681 int work_done, limit = min(*budget, dev->quota), avail = limit; 1684 int work_done, limit = min(*budget, dev->quota), avail = limit;
@@ -2075,7 +2078,8 @@ static inline int is_pure_response(const struct rsp_desc *r)
2075 */ 2078 */
2076static int napi_rx_handler(struct net_device *dev, int *budget) 2079static int napi_rx_handler(struct net_device *dev, int *budget)
2077{ 2080{
2078 struct adapter *adap = dev->priv; 2081 const struct port_info *pi = netdev_priv(dev);
2082 struct adapter *adap = pi->adapter;
2079 struct sge_qset *qs = dev2qset(dev); 2083 struct sge_qset *qs = dev2qset(dev);
2080 int effective_budget = min(*budget, dev->quota); 2084 int effective_budget = min(*budget, dev->quota);
2081 2085
@@ -2205,7 +2209,8 @@ static inline int handle_responses(struct adapter *adap, struct sge_rspq *q)
2205irqreturn_t t3_sge_intr_msix(int irq, void *cookie) 2209irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
2206{ 2210{
2207 struct sge_qset *qs = cookie; 2211 struct sge_qset *qs = cookie;
2208 struct adapter *adap = qs->netdev->priv; 2212 const struct port_info *pi = netdev_priv(qs->netdev);
2213 struct adapter *adap = pi->adapter;
2209 struct sge_rspq *q = &qs->rspq; 2214 struct sge_rspq *q = &qs->rspq;
2210 2215
2211 spin_lock(&q->lock); 2216 spin_lock(&q->lock);
@@ -2224,7 +2229,8 @@ irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
2224irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie) 2229irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie)
2225{ 2230{
2226 struct sge_qset *qs = cookie; 2231 struct sge_qset *qs = cookie;
2227 struct adapter *adap = qs->netdev->priv; 2232 const struct port_info *pi = netdev_priv(qs->netdev);
2233 struct adapter *adap = pi->adapter;
2228 struct sge_rspq *q = &qs->rspq; 2234 struct sge_rspq *q = &qs->rspq;
2229 2235
2230 spin_lock(&q->lock); 2236 spin_lock(&q->lock);
@@ -2508,7 +2514,8 @@ static void sge_timer_cb(unsigned long data)
2508{ 2514{
2509 spinlock_t *lock; 2515 spinlock_t *lock;
2510 struct sge_qset *qs = (struct sge_qset *)data; 2516 struct sge_qset *qs = (struct sge_qset *)data;
2511 struct adapter *adap = qs->netdev->priv; 2517 const struct port_info *pi = netdev_priv(qs->netdev);
2518 struct adapter *adap = pi->adapter;
2512 2519
2513 if (spin_trylock(&qs->txq[TXQ_ETH].lock)) { 2520 if (spin_trylock(&qs->txq[TXQ_ETH].lock)) {
2514 reclaim_completed_tx(adap, &qs->txq[TXQ_ETH]); 2521 reclaim_completed_tx(adap, &qs->txq[TXQ_ETH]);
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index dd3149d94ba8..b02d15daf5d9 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -848,16 +848,15 @@ static int t3_write_flash(struct adapter *adapter, unsigned int addr,
848} 848}
849 849
850/** 850/**
851 * t3_check_tpsram_version - read the tp sram version 851 * t3_get_tp_version - read the tp sram version
852 * @adapter: the adapter 852 * @adapter: the adapter
853 * @vers: where to place the version
853 * 854 *
854 * Reads the protocol sram version from serial eeprom. 855 * Reads the protocol sram version from sram.
855 */ 856 */
856int t3_check_tpsram_version(struct adapter *adapter) 857int t3_get_tp_version(struct adapter *adapter, u32 *vers)
857{ 858{
858 int ret; 859 int ret;
859 u32 vers;
860 unsigned int major, minor;
861 860
862 /* Get version loaded in SRAM */ 861 /* Get version loaded in SRAM */
863 t3_write_reg(adapter, A_TP_EMBED_OP_FIELD0, 0); 862 t3_write_reg(adapter, A_TP_EMBED_OP_FIELD0, 0);
@@ -866,7 +865,32 @@ int t3_check_tpsram_version(struct adapter *adapter)
866 if (ret) 865 if (ret)
867 return ret; 866 return ret;
868 867
869 vers = t3_read_reg(adapter, A_TP_EMBED_OP_FIELD1); 868 *vers = t3_read_reg(adapter, A_TP_EMBED_OP_FIELD1);
869
870 return 0;
871}
872
873/**
874 * t3_check_tpsram_version - read the tp sram version
875 * @adapter: the adapter
876 * @must_load: set to 1 if loading a new microcode image is required
877 *
878 * Reads the protocol sram version from flash.
879 */
880int t3_check_tpsram_version(struct adapter *adapter, int *must_load)
881{
882 int ret;
883 u32 vers;
884 unsigned int major, minor;
885
886 if (adapter->params.rev == T3_REV_A)
887 return 0;
888
889 *must_load = 1;
890
891 ret = t3_get_tp_version(adapter, &vers);
892 if (ret)
893 return ret;
870 894
871 major = G_TP_VERSION_MAJOR(vers); 895 major = G_TP_VERSION_MAJOR(vers);
872 minor = G_TP_VERSION_MINOR(vers); 896 minor = G_TP_VERSION_MINOR(vers);
@@ -874,6 +898,16 @@ int t3_check_tpsram_version(struct adapter *adapter)
874 if (major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR) 898 if (major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR)
875 return 0; 899 return 0;
876 900
901 if (major != TP_VERSION_MAJOR)
902 CH_ERR(adapter, "found wrong TP version (%u.%u), "
903 "driver needs version %d.%d\n", major, minor,
904 TP_VERSION_MAJOR, TP_VERSION_MINOR);
905 else {
906 *must_load = 0;
907 CH_ERR(adapter, "found wrong TP version (%u.%u), "
908 "driver compiled for version %d.%d\n", major, minor,
909 TP_VERSION_MAJOR, TP_VERSION_MINOR);
910 }
877 return -EINVAL; 911 return -EINVAL;
878} 912}
879 913
diff --git a/drivers/net/cxgb3/t3cdev.h b/drivers/net/cxgb3/t3cdev.h
index fa4099bc0416..77fcc1a4984e 100644
--- a/drivers/net/cxgb3/t3cdev.h
+++ b/drivers/net/cxgb3/t3cdev.h
@@ -42,9 +42,6 @@
42 42
43#define T3CNAMSIZ 16 43#define T3CNAMSIZ 16
44 44
45/* Get the t3cdev associated with a net_device */
46#define T3CDEV(netdev) (struct t3cdev *)(netdev->priv)
47
48struct cxgb3_client; 45struct cxgb3_client;
49 46
50enum t3ctype { 47enum t3ctype {
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 3ca1e8ece548..0834ef0eddb4 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -48,6 +48,7 @@
48#ifdef CONFIG_SERIAL_8250 48#ifdef CONFIG_SERIAL_8250
49#include <linux/serial_core.h> 49#include <linux/serial_core.h>
50#include <linux/serial_8250.h> 50#include <linux/serial_8250.h>
51#include <linux/serial_reg.h>
51#endif 52#endif
52 53
53#include <linux/netdevice.h> 54#include <linux/netdevice.h>
@@ -1151,13 +1152,41 @@ static int ioc3_is_menet(struct pci_dev *pdev)
1151 * Also look in ip27-pci.c:pci_fixup_ioc3() for some comments on working 1152 * Also look in ip27-pci.c:pci_fixup_ioc3() for some comments on working
1152 * around ioc3 oddities in this respect. 1153 * around ioc3 oddities in this respect.
1153 * 1154 *
1154 * The IOC3 serials use a 22MHz clock rate with an additional divider by 3. 1155 * The IOC3 serials use a 22MHz clock rate with an additional divider which
1156 * can be programmed in the SCR register if the DLAB bit is set.
1157 *
1158 * Register to interrupt zero because we share the interrupt with
1159 * the serial driver which we don't properly support yet.
1160 *
1161 * Can't use UPF_IOREMAP as the whole of IOC3 resources have already been
1162 * registered.
1155 */ 1163 */
1164static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
1165{
1166#define COSMISC_CONSTANT 6
1167
1168 struct uart_port port = {
1169 .irq = 0,
1170 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
1171 .iotype = UPIO_MEM,
1172 .regshift = 0,
1173 .uartclk = (22000000 << 1) / COSMISC_CONSTANT,
1174
1175 .membase = (unsigned char __iomem *) uart,
1176 .mapbase = (unsigned long) uart,
1177 };
1178 unsigned char lcr;
1179
1180 lcr = uart->iu_lcr;
1181 uart->iu_lcr = lcr | UART_LCR_DLAB;
1182 uart->iu_scr = COSMISC_CONSTANT,
1183 uart->iu_lcr = lcr;
1184 uart->iu_lcr;
1185 serial8250_register_port(&port);
1186}
1156 1187
1157static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3) 1188static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
1158{ 1189{
1159 struct uart_port port;
1160
1161 /* 1190 /*
1162 * We need to recognice and treat the fourth MENET serial as it 1191 * We need to recognice and treat the fourth MENET serial as it
1163 * does not have an SuperIO chip attached to it, therefore attempting 1192 * does not have an SuperIO chip attached to it, therefore attempting
@@ -1171,24 +1200,35 @@ static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
1171 return; 1200 return;
1172 1201
1173 /* 1202 /*
1174 * Register to interrupt zero because we share the interrupt with 1203 * Switch IOC3 to PIO mode. It probably already was but let's be
1175 * the serial driver which we don't properly support yet. 1204 * paranoid
1176 *
1177 * Can't use UPF_IOREMAP as the whole of IOC3 resources have already
1178 * been registered.
1179 */ 1205 */
1180 memset(&port, 0, sizeof(port)); 1206 ioc3->gpcr_s = GPCR_UARTA_MODESEL | GPCR_UARTB_MODESEL;
1181 port.irq = 0; 1207 ioc3->gpcr_s;
1182 port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; 1208 ioc3->gppr_6 = 0;
1183 port.iotype = UPIO_MEM; 1209 ioc3->gppr_6;
1184 port.regshift = 0; 1210 ioc3->gppr_7 = 0;
1185 port.uartclk = 22000000 / 3; 1211 ioc3->gppr_7;
1186 1212 ioc3->sscr_a = ioc3->sscr_a & ~SSCR_DMA_EN;
1187 port.membase = (unsigned char *) &ioc3->sregs.uarta; 1213 ioc3->sscr_a;
1188 serial8250_register_port(&port); 1214 ioc3->sscr_b = ioc3->sscr_b & ~SSCR_DMA_EN;
1189 1215 ioc3->sscr_b;
1190 port.membase = (unsigned char *) &ioc3->sregs.uartb; 1216 /* Disable all SA/B interrupts except for SA/B_INT in SIO_IEC. */
1191 serial8250_register_port(&port); 1217 ioc3->sio_iec &= ~ (SIO_IR_SA_TX_MT | SIO_IR_SA_RX_FULL |
1218 SIO_IR_SA_RX_HIGH | SIO_IR_SA_RX_TIMER |
1219 SIO_IR_SA_DELTA_DCD | SIO_IR_SA_DELTA_CTS |
1220 SIO_IR_SA_TX_EXPLICIT | SIO_IR_SA_MEMERR);
1221 ioc3->sio_iec |= SIO_IR_SA_INT;
1222 ioc3->sscr_a = 0;
1223 ioc3->sio_iec &= ~ (SIO_IR_SB_TX_MT | SIO_IR_SB_RX_FULL |
1224 SIO_IR_SB_RX_HIGH | SIO_IR_SB_RX_TIMER |
1225 SIO_IR_SB_DELTA_DCD | SIO_IR_SB_DELTA_CTS |
1226 SIO_IR_SB_TX_EXPLICIT | SIO_IR_SB_MEMERR);
1227 ioc3->sio_iec |= SIO_IR_SB_INT;
1228 ioc3->sscr_b = 0;
1229
1230 ioc3_8250_register(&ioc3->sregs.uarta);
1231 ioc3_8250_register(&ioc3->sregs.uartb);
1192} 1232}
1193#endif 1233#endif
1194 1234
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h
index 3276866b17e2..d72f8f8fcb50 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -649,9 +649,11 @@ enum {
649#define PCIX_INT_VECTOR (0x10100) 649#define PCIX_INT_VECTOR (0x10100)
650#define PCIX_INT_MASK (0x10104) 650#define PCIX_INT_MASK (0x10104)
651 651
652#define PCIX_MN_WINDOW (0x10200) 652#define PCIX_MN_WINDOW_F0 (0x10200)
653#define PCIX_MN_WINDOW(_f) (PCIX_MN_WINDOW_F0 + (0x20 * (_f)))
653#define PCIX_MS_WINDOW (0x10204) 654#define PCIX_MS_WINDOW (0x10204)
654#define PCIX_SN_WINDOW (0x10208) 655#define PCIX_SN_WINDOW_F0 (0x10208)
656#define PCIX_SN_WINDOW(_f) (PCIX_SN_WINDOW_F0 + (0x20 * (_f)))
655#define PCIX_CRB_WINDOW (0x10210) 657#define PCIX_CRB_WINDOW (0x10210)
656#define PCIX_CRB_WINDOW_F0 (0x10210) 658#define PCIX_CRB_WINDOW_F0 (0x10210)
657#define PCIX_CRB_WINDOW_F1 (0x10230) 659#define PCIX_CRB_WINDOW_F1 (0x10230)
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index aac15421bd1e..a7b8d7f23259 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -904,11 +904,11 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter,
904 ddr_mn_window = window; 904 ddr_mn_window = window;
905 writel(window, PCI_OFFSET_SECOND_RANGE(adapter, 905 writel(window, PCI_OFFSET_SECOND_RANGE(adapter,
906 NETXEN_PCIX_PH_REG 906 NETXEN_PCIX_PH_REG
907 (PCIX_MN_WINDOW))); 907 (PCIX_MN_WINDOW(adapter->ahw.pci_func))));
908 /* MUST make sure window is set before we forge on... */ 908 /* MUST make sure window is set before we forge on... */
909 readl(PCI_OFFSET_SECOND_RANGE(adapter, 909 readl(PCI_OFFSET_SECOND_RANGE(adapter,
910 NETXEN_PCIX_PH_REG 910 NETXEN_PCIX_PH_REG
911 (PCIX_MN_WINDOW))); 911 (PCIX_MN_WINDOW(adapter->ahw.pci_func))));
912 } 912 }
913 addr -= (window * NETXEN_WINDOW_ONE); 913 addr -= (window * NETXEN_WINDOW_ONE);
914 addr += NETXEN_PCI_DDR_NET; 914 addr += NETXEN_PCI_DDR_NET;
@@ -929,11 +929,11 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter,
929 writel((window << 22), 929 writel((window << 22),
930 PCI_OFFSET_SECOND_RANGE(adapter, 930 PCI_OFFSET_SECOND_RANGE(adapter,
931 NETXEN_PCIX_PH_REG 931 NETXEN_PCIX_PH_REG
932 (PCIX_SN_WINDOW))); 932 (PCIX_SN_WINDOW(adapter->ahw.pci_func))));
933 /* MUST make sure window is set before we forge on... */ 933 /* MUST make sure window is set before we forge on... */
934 readl(PCI_OFFSET_SECOND_RANGE(adapter, 934 readl(PCI_OFFSET_SECOND_RANGE(adapter,
935 NETXEN_PCIX_PH_REG 935 NETXEN_PCIX_PH_REG
936 (PCIX_SN_WINDOW))); 936 (PCIX_SN_WINDOW(adapter->ahw.pci_func))));
937 } 937 }
938 addr -= (window * 0x400000); 938 addr -= (window * 0x400000);
939 addr += NETXEN_PCI_QDR_NET; 939 addr += NETXEN_PCI_QDR_NET;
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 08a62acde8bf..3122d0101638 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -639,10 +639,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
639 NETXEN_CRB_NORMALIZE(adapter, 639 NETXEN_CRB_NORMALIZE(adapter,
640 NETXEN_ROMUSB_GLB_PEGTUNE_DONE)); 640 NETXEN_ROMUSB_GLB_PEGTUNE_DONE));
641 /* Handshake with the card before we register the devices. */ 641 /* Handshake with the card before we register the devices. */
642 writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE));
643 netxen_pinit_from_rom(adapter, 0);
644 msleep(1);
645 netxen_load_firmware(adapter);
646 netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); 642 netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
647 } 643 }
648 644
@@ -750,9 +746,6 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
750 746
751 netxen_nic_disable_int(adapter); 747 netxen_nic_disable_int(adapter);
752 748
753 if (adapter->irq)
754 free_irq(adapter->irq, adapter);
755
756 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) { 749 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) {
757 init_firmware_done++; 750 init_firmware_done++;
758 netxen_free_hw_resources(adapter); 751 netxen_free_hw_resources(adapter);
@@ -776,13 +769,8 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
776 } 769 }
777 } 770 }
778 771
779 if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
780 pci_disable_msi(pdev);
781
782 vfree(adapter->cmd_buf_arr); 772 vfree(adapter->cmd_buf_arr);
783 773
784 pci_disable_device(pdev);
785
786 if (adapter->portnum == 0) { 774 if (adapter->portnum == 0) {
787 if (init_firmware_done) { 775 if (init_firmware_done) {
788 i = 100; 776 i = 100;
@@ -833,12 +821,19 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
833 } 821 }
834 } 822 }
835 823
824 if (adapter->irq)
825 free_irq(adapter->irq, adapter);
826
827 if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
828 pci_disable_msi(pdev);
829
836 iounmap(adapter->ahw.db_base); 830 iounmap(adapter->ahw.db_base);
837 iounmap(adapter->ahw.pci_base0); 831 iounmap(adapter->ahw.pci_base0);
838 iounmap(adapter->ahw.pci_base1); 832 iounmap(adapter->ahw.pci_base1);
839 iounmap(adapter->ahw.pci_base2); 833 iounmap(adapter->ahw.pci_base2);
840 834
841 pci_release_regions(pdev); 835 pci_release_regions(pdev);
836 pci_disable_device(pdev);
842 pci_set_drvdata(pdev, NULL); 837 pci_set_drvdata(pdev, NULL);
843 838
844 free_netdev(netdev); 839 free_netdev(netdev);
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 13d1c0a2a25f..e56503918436 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -556,7 +556,6 @@ static int gelic_net_stop(struct net_device *netdev)
556{ 556{
557 struct gelic_net_card *card = netdev_priv(netdev); 557 struct gelic_net_card *card = netdev_priv(netdev);
558 558
559 netif_poll_disable(netdev);
560 netif_stop_queue(netdev); 559 netif_stop_queue(netdev);
561 560
562 /* turn off DMA, force end */ 561 /* turn off DMA, force end */
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index ec18bae05df0..6d4959807abc 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -1178,9 +1178,9 @@ qeth_ipaddr_to_string(enum qeth_prot_versions proto, const __u8 *addr,
1178 char *buf) 1178 char *buf)
1179{ 1179{
1180 if (proto == QETH_PROT_IPV4) 1180 if (proto == QETH_PROT_IPV4)
1181 return qeth_ipaddr4_to_string(addr, buf); 1181 qeth_ipaddr4_to_string(addr, buf);
1182 else if (proto == QETH_PROT_IPV6) 1182 else if (proto == QETH_PROT_IPV6)
1183 return qeth_ipaddr6_to_string(addr, buf); 1183 qeth_ipaddr6_to_string(addr, buf);
1184} 1184}
1185 1185
1186static inline int 1186static inline int
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 57f69434fbf9..f3e6fbeb2123 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -561,7 +561,7 @@ qeth_set_offline(struct ccwgroup_device *cgdev)
561} 561}
562 562
563static int 563static int
564qeth_wait_for_threads(struct qeth_card *card, unsigned long threads); 564qeth_threads_running(struct qeth_card *card, unsigned long threads);
565 565
566 566
567static void 567static void
@@ -576,8 +576,7 @@ qeth_remove_device(struct ccwgroup_device *cgdev)
576 if (!card) 576 if (!card)
577 return; 577 return;
578 578
579 if (qeth_wait_for_threads(card, 0xffffffff)) 579 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
580 return;
581 580
582 if (cgdev->state == CCWGROUP_ONLINE){ 581 if (cgdev->state == CCWGROUP_ONLINE){
583 card->use_hard_stop = 1; 582 card->use_hard_stop = 1;
@@ -1542,16 +1541,21 @@ qeth_idx_write_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
1542 card = CARD_FROM_CDEV(channel->ccwdev); 1541 card = CARD_FROM_CDEV(channel->ccwdev);
1543 1542
1544 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { 1543 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
1545 PRINT_ERR("IDX_ACTIVATE on write channel device %s: negative " 1544 if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19)
1546 "reply\n", CARD_WDEV_ID(card)); 1545 PRINT_ERR("IDX_ACTIVATE on write channel device %s: "
1546 "adapter exclusively used by another host\n",
1547 CARD_WDEV_ID(card));
1548 else
1549 PRINT_ERR("IDX_ACTIVATE on write channel device %s: "
1550 "negative reply\n", CARD_WDEV_ID(card));
1547 goto out; 1551 goto out;
1548 } 1552 }
1549 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2); 1553 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2);
1550 if ((temp & ~0x0100) != qeth_peer_func_level(card->info.func_level)) { 1554 if ((temp & ~0x0100) != qeth_peer_func_level(card->info.func_level)) {
1551 PRINT_WARN("IDX_ACTIVATE on write channel device %s: " 1555 PRINT_WARN("IDX_ACTIVATE on write channel device %s: "
1552 "function level mismatch " 1556 "function level mismatch "
1553 "(sent: 0x%x, received: 0x%x)\n", 1557 "(sent: 0x%x, received: 0x%x)\n",
1554 CARD_WDEV_ID(card), card->info.func_level, temp); 1558 CARD_WDEV_ID(card), card->info.func_level, temp);
1555 goto out; 1559 goto out;
1556 } 1560 }
1557 channel->state = CH_STATE_UP; 1561 channel->state = CH_STATE_UP;
@@ -1597,8 +1601,13 @@ qeth_idx_read_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
1597 goto out; 1601 goto out;
1598 } 1602 }
1599 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { 1603 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
1600 PRINT_ERR("IDX_ACTIVATE on read channel device %s: negative " 1604 if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19)
1601 "reply\n", CARD_RDEV_ID(card)); 1605 PRINT_ERR("IDX_ACTIVATE on read channel device %s: "
1606 "adapter exclusively used by another host\n",
1607 CARD_RDEV_ID(card));
1608 else
1609 PRINT_ERR("IDX_ACTIVATE on read channel device %s: "
1610 "negative reply\n", CARD_RDEV_ID(card));
1602 goto out; 1611 goto out;
1603 } 1612 }
1604 1613
@@ -1613,8 +1622,8 @@ qeth_idx_read_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
1613 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2); 1622 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2);
1614 if (temp != qeth_peer_func_level(card->info.func_level)) { 1623 if (temp != qeth_peer_func_level(card->info.func_level)) {
1615 PRINT_WARN("IDX_ACTIVATE on read channel device %s: function " 1624 PRINT_WARN("IDX_ACTIVATE on read channel device %s: function "
1616 "level mismatch (sent: 0x%x, received: 0x%x)\n", 1625 "level mismatch (sent: 0x%x, received: 0x%x)\n",
1617 CARD_RDEV_ID(card), card->info.func_level, temp); 1626 CARD_RDEV_ID(card), card->info.func_level, temp);
1618 goto out; 1627 goto out;
1619 } 1628 }
1620 memcpy(&card->token.issuer_rm_r, 1629 memcpy(&card->token.issuer_rm_r,
@@ -2496,7 +2505,7 @@ qeth_rebuild_skb_fake_ll_tr(struct qeth_card *card, struct sk_buff *skb,
2496 struct iphdr *ip_hdr; 2505 struct iphdr *ip_hdr;
2497 2506
2498 QETH_DBF_TEXT(trace,5,"skbfktr"); 2507 QETH_DBF_TEXT(trace,5,"skbfktr");
2499 skb_set_mac_header(skb, -QETH_FAKE_LL_LEN_TR); 2508 skb_set_mac_header(skb, (int)-QETH_FAKE_LL_LEN_TR);
2500 /* this is a fake ethernet header */ 2509 /* this is a fake ethernet header */
2501 fake_hdr = tr_hdr(skb); 2510 fake_hdr = tr_hdr(skb);
2502 2511
@@ -2804,13 +2813,16 @@ qeth_queue_input_buffer(struct qeth_card *card, int index)
2804 if (newcount < count) { 2813 if (newcount < count) {
2805 /* we are in memory shortage so we switch back to 2814 /* we are in memory shortage so we switch back to
2806 traditional skb allocation and drop packages */ 2815 traditional skb allocation and drop packages */
2807 if (atomic_cmpxchg(&card->force_alloc_skb, 0, 1)) 2816 if (!atomic_read(&card->force_alloc_skb) &&
2808 printk(KERN_WARNING 2817 net_ratelimit())
2809 "qeth: switch to alloc skb\n"); 2818 PRINT_WARN("Switch to alloc skb\n");
2819 atomic_set(&card->force_alloc_skb, 3);
2810 count = newcount; 2820 count = newcount;
2811 } else { 2821 } else {
2812 if (atomic_cmpxchg(&card->force_alloc_skb, 1, 0)) 2822 if ((atomic_read(&card->force_alloc_skb) == 1) &&
2813 printk(KERN_WARNING "qeth: switch to sg\n"); 2823 net_ratelimit())
2824 PRINT_WARN("Switch to sg\n");
2825 atomic_add_unless(&card->force_alloc_skb, -1, 0);
2814 } 2826 }
2815 2827
2816 /* 2828 /*
@@ -3354,10 +3366,12 @@ out_freeoutq:
3354 while (i > 0) 3366 while (i > 0)
3355 kfree(card->qdio.out_qs[--i]); 3367 kfree(card->qdio.out_qs[--i]);
3356 kfree(card->qdio.out_qs); 3368 kfree(card->qdio.out_qs);
3369 card->qdio.out_qs = NULL;
3357out_freepool: 3370out_freepool:
3358 qeth_free_buffer_pool(card); 3371 qeth_free_buffer_pool(card);
3359out_freeinq: 3372out_freeinq:
3360 kfree(card->qdio.in_q); 3373 kfree(card->qdio.in_q);
3374 card->qdio.in_q = NULL;
3361out_nomem: 3375out_nomem:
3362 atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED); 3376 atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED);
3363 return -ENOMEM; 3377 return -ENOMEM;
@@ -3373,16 +3387,20 @@ qeth_free_qdio_buffers(struct qeth_card *card)
3373 QETH_QDIO_UNINITIALIZED) 3387 QETH_QDIO_UNINITIALIZED)
3374 return; 3388 return;
3375 kfree(card->qdio.in_q); 3389 kfree(card->qdio.in_q);
3390 card->qdio.in_q = NULL;
3376 /* inbound buffer pool */ 3391 /* inbound buffer pool */
3377 qeth_free_buffer_pool(card); 3392 qeth_free_buffer_pool(card);
3378 /* free outbound qdio_qs */ 3393 /* free outbound qdio_qs */
3379 for (i = 0; i < card->qdio.no_out_queues; ++i){ 3394 if (card->qdio.out_qs) {
3380 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) 3395 for (i = 0; i < card->qdio.no_out_queues; ++i) {
3381 qeth_clear_output_buffer(card->qdio.out_qs[i], 3396 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j)
3382 &card->qdio.out_qs[i]->bufs[j]); 3397 qeth_clear_output_buffer(card->qdio.out_qs[i],
3383 kfree(card->qdio.out_qs[i]); 3398 &card->qdio.out_qs[i]->bufs[j]);
3399 kfree(card->qdio.out_qs[i]);
3400 }
3401 kfree(card->qdio.out_qs);
3402 card->qdio.out_qs = NULL;
3384 } 3403 }
3385 kfree(card->qdio.out_qs);
3386} 3404}
3387 3405
3388static void 3406static void
@@ -3393,7 +3411,7 @@ qeth_clear_qdio_buffers(struct qeth_card *card)
3393 QETH_DBF_TEXT(trace, 2, "clearqdbf"); 3411 QETH_DBF_TEXT(trace, 2, "clearqdbf");
3394 /* clear outbound buffers to free skbs */ 3412 /* clear outbound buffers to free skbs */
3395 for (i = 0; i < card->qdio.no_out_queues; ++i) 3413 for (i = 0; i < card->qdio.no_out_queues; ++i)
3396 if (card->qdio.out_qs[i]){ 3414 if (card->qdio.out_qs && card->qdio.out_qs[i]) {
3397 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) 3415 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j)
3398 qeth_clear_output_buffer(card->qdio.out_qs[i], 3416 qeth_clear_output_buffer(card->qdio.out_qs[i],
3399 &card->qdio.out_qs[i]->bufs[j]); 3417 &card->qdio.out_qs[i]->bufs[j]);
@@ -4553,6 +4571,53 @@ qeth_get_elements_no(struct qeth_card *card, void *hdr,
4553 return elements_needed; 4571 return elements_needed;
4554} 4572}
4555 4573
4574static void qeth_tx_csum(struct sk_buff *skb)
4575{
4576 int tlen;
4577
4578 if (skb->protocol == htons(ETH_P_IP)) {
4579 tlen = ntohs(ip_hdr(skb)->tot_len) - (ip_hdr(skb)->ihl << 2);
4580 switch (ip_hdr(skb)->protocol) {
4581 case IPPROTO_TCP:
4582 tcp_hdr(skb)->check = 0;
4583 tcp_hdr(skb)->check = csum_tcpudp_magic(
4584 ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
4585 tlen, ip_hdr(skb)->protocol,
4586 skb_checksum(skb, skb_transport_offset(skb),
4587 tlen, 0));
4588 break;
4589 case IPPROTO_UDP:
4590 udp_hdr(skb)->check = 0;
4591 udp_hdr(skb)->check = csum_tcpudp_magic(
4592 ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
4593 tlen, ip_hdr(skb)->protocol,
4594 skb_checksum(skb, skb_transport_offset(skb),
4595 tlen, 0));
4596 break;
4597 }
4598 } else if (skb->protocol == htons(ETH_P_IPV6)) {
4599 switch (ipv6_hdr(skb)->nexthdr) {
4600 case IPPROTO_TCP:
4601 tcp_hdr(skb)->check = 0;
4602 tcp_hdr(skb)->check = csum_ipv6_magic(
4603 &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr,
4604 ipv6_hdr(skb)->payload_len,
4605 ipv6_hdr(skb)->nexthdr,
4606 skb_checksum(skb, skb_transport_offset(skb),
4607 ipv6_hdr(skb)->payload_len, 0));
4608 break;
4609 case IPPROTO_UDP:
4610 udp_hdr(skb)->check = 0;
4611 udp_hdr(skb)->check = csum_ipv6_magic(
4612 &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr,
4613 ipv6_hdr(skb)->payload_len,
4614 ipv6_hdr(skb)->nexthdr,
4615 skb_checksum(skb, skb_transport_offset(skb),
4616 ipv6_hdr(skb)->payload_len, 0));
4617 break;
4618 }
4619 }
4620}
4556 4621
4557static int 4622static int
4558qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) 4623qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
@@ -4638,12 +4703,22 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4638 elements_needed += elems; 4703 elements_needed += elems;
4639 } 4704 }
4640 4705
4706 if ((large_send == QETH_LARGE_SEND_NO) &&
4707 (skb->ip_summed == CHECKSUM_PARTIAL))
4708 qeth_tx_csum(new_skb);
4709
4641 if (card->info.type != QETH_CARD_TYPE_IQD) 4710 if (card->info.type != QETH_CARD_TYPE_IQD)
4642 rc = qeth_do_send_packet(card, queue, new_skb, hdr, 4711 rc = qeth_do_send_packet(card, queue, new_skb, hdr,
4643 elements_needed, ctx); 4712 elements_needed, ctx);
4644 else 4713 else {
4714 if ((skb->protocol == htons(ETH_P_ARP)) &&
4715 (card->dev->flags & IFF_NOARP)) {
4716 __qeth_free_new_skb(skb, new_skb);
4717 return -EPERM;
4718 }
4645 rc = qeth_do_send_packet_fast(card, queue, new_skb, hdr, 4719 rc = qeth_do_send_packet_fast(card, queue, new_skb, hdr,
4646 elements_needed, ctx); 4720 elements_needed, ctx);
4721 }
4647 if (!rc) { 4722 if (!rc) {
4648 card->stats.tx_packets++; 4723 card->stats.tx_packets++;
4649 card->stats.tx_bytes += tx_bytes; 4724 card->stats.tx_bytes += tx_bytes;
@@ -6385,20 +6460,18 @@ qeth_deregister_addr_entry(struct qeth_card *card, struct qeth_ipaddr *addr)
6385static u32 6460static u32
6386qeth_ethtool_get_tx_csum(struct net_device *dev) 6461qeth_ethtool_get_tx_csum(struct net_device *dev)
6387{ 6462{
6388 /* We may need to say that we support tx csum offload if 6463 return (dev->features & NETIF_F_HW_CSUM) != 0;
6389 * we do EDDP or TSO. There are discussions going on to
6390 * enforce rules in the stack and in ethtool that make
6391 * SG and TSO depend on HW_CSUM. At the moment there are
6392 * no such rules....
6393 * If we say yes here, we have to checksum outbound packets
6394 * any time. */
6395 return 0;
6396} 6464}
6397 6465
6398static int 6466static int
6399qeth_ethtool_set_tx_csum(struct net_device *dev, u32 data) 6467qeth_ethtool_set_tx_csum(struct net_device *dev, u32 data)
6400{ 6468{
6401 return -EINVAL; 6469 if (data)
6470 dev->features |= NETIF_F_HW_CSUM;
6471 else
6472 dev->features &= ~NETIF_F_HW_CSUM;
6473
6474 return 0;
6402} 6475}
6403 6476
6404static u32 6477static u32
@@ -7412,7 +7485,8 @@ qeth_start_ipa_tso(struct qeth_card *card)
7412 } 7485 }
7413 if (rc && (card->options.large_send == QETH_LARGE_SEND_TSO)){ 7486 if (rc && (card->options.large_send == QETH_LARGE_SEND_TSO)){
7414 card->options.large_send = QETH_LARGE_SEND_NO; 7487 card->options.large_send = QETH_LARGE_SEND_NO;
7415 card->dev->features &= ~ (NETIF_F_TSO | NETIF_F_SG); 7488 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
7489 NETIF_F_HW_CSUM);
7416 } 7490 }
7417 return rc; 7491 return rc;
7418} 7492}
@@ -7552,22 +7626,26 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
7552 card->options.large_send = type; 7626 card->options.large_send = type;
7553 switch (card->options.large_send) { 7627 switch (card->options.large_send) {
7554 case QETH_LARGE_SEND_EDDP: 7628 case QETH_LARGE_SEND_EDDP:
7555 card->dev->features |= NETIF_F_TSO | NETIF_F_SG; 7629 card->dev->features |= NETIF_F_TSO | NETIF_F_SG |
7630 NETIF_F_HW_CSUM;
7556 break; 7631 break;
7557 case QETH_LARGE_SEND_TSO: 7632 case QETH_LARGE_SEND_TSO:
7558 if (qeth_is_supported(card, IPA_OUTBOUND_TSO)){ 7633 if (qeth_is_supported(card, IPA_OUTBOUND_TSO)){
7559 card->dev->features |= NETIF_F_TSO | NETIF_F_SG; 7634 card->dev->features |= NETIF_F_TSO | NETIF_F_SG |
7635 NETIF_F_HW_CSUM;
7560 } else { 7636 } else {
7561 PRINT_WARN("TSO not supported on %s. " 7637 PRINT_WARN("TSO not supported on %s. "
7562 "large_send set to 'no'.\n", 7638 "large_send set to 'no'.\n",
7563 card->dev->name); 7639 card->dev->name);
7564 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); 7640 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
7641 NETIF_F_HW_CSUM);
7565 card->options.large_send = QETH_LARGE_SEND_NO; 7642 card->options.large_send = QETH_LARGE_SEND_NO;
7566 rc = -EOPNOTSUPP; 7643 rc = -EOPNOTSUPP;
7567 } 7644 }
7568 break; 7645 break;
7569 default: /* includes QETH_LARGE_SEND_NO */ 7646 default: /* includes QETH_LARGE_SEND_NO */
7570 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); 7647 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
7648 NETIF_F_HW_CSUM);
7571 break; 7649 break;
7572 } 7650 }
7573 if (card->state == CARD_STATE_UP) 7651 if (card->state == CARD_STATE_UP)
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
index 1d8083c91765..6de2da5ed5fd 100644
--- a/drivers/s390/net/qeth_mpc.h
+++ b/drivers/s390/net/qeth_mpc.h
@@ -565,6 +565,7 @@ extern unsigned char IDX_ACTIVATE_WRITE[];
565#define QETH_IDX_ACT_QDIO_DEV_REALADDR(buffer) (buffer+0x20) 565#define QETH_IDX_ACT_QDIO_DEV_REALADDR(buffer) (buffer+0x20)
566#define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08]&3)==2) 566#define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08]&3)==2)
567#define QETH_IDX_REPLY_LEVEL(buffer) (buffer+0x12) 567#define QETH_IDX_REPLY_LEVEL(buffer) (buffer+0x12)
568#define QETH_IDX_ACT_CAUSE_CODE(buffer) (buffer)[0x09]
568 569
569#define PDU_ENCAPSULATION(buffer) \ 570#define PDU_ENCAPSULATION(buffer) \
570 (buffer + *(buffer + (*(buffer+0x0b)) + \ 571 (buffer + *(buffer + (*(buffer+0x0b)) + \
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index bb0287ad1aac..2cc3f3a0e393 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -1760,10 +1760,10 @@ qeth_remove_device_attributes(struct device *dev)
1760{ 1760{
1761 struct qeth_card *card = dev->driver_data; 1761 struct qeth_card *card = dev->driver_data;
1762 1762
1763 if (card->info.type == QETH_CARD_TYPE_OSN) 1763 if (card->info.type == QETH_CARD_TYPE_OSN) {
1764 return sysfs_remove_group(&dev->kobj, 1764 sysfs_remove_group(&dev->kobj, &qeth_osn_device_attr_group);
1765 &qeth_osn_device_attr_group); 1765 return;
1766 1766 }
1767 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); 1767 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1768 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); 1768 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1769 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); 1769 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index b2a851c1b8cb..46139003ea0c 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1303,34 +1303,6 @@ static void nfs_clone_super(struct super_block *sb,
1303 nfs_initialise_sb(sb); 1303 nfs_initialise_sb(sb);
1304} 1304}
1305 1305
1306static int nfs_set_super(struct super_block *s, void *_server)
1307{
1308 struct nfs_server *server = _server;
1309 int ret;
1310
1311 s->s_fs_info = server;
1312 ret = set_anon_super(s, server);
1313 if (ret == 0)
1314 server->s_dev = s->s_dev;
1315 return ret;
1316}
1317
1318static int nfs_compare_super(struct super_block *sb, void *data)
1319{
1320 struct nfs_server *server = data, *old = NFS_SB(sb);
1321
1322 if (memcmp(&old->nfs_client->cl_addr,
1323 &server->nfs_client->cl_addr,
1324 sizeof(old->nfs_client->cl_addr)) != 0)
1325 return 0;
1326 /* Note: NFS_MOUNT_UNSHARED == NFS4_MOUNT_UNSHARED */
1327 if (old->flags & NFS_MOUNT_UNSHARED)
1328 return 0;
1329 if (memcmp(&old->fsid, &server->fsid, sizeof(old->fsid)) != 0)
1330 return 0;
1331 return 1;
1332}
1333
1334#define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) 1306#define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS)
1335 1307
1336static int nfs_compare_mount_options(const struct super_block *s, const struct nfs_server *b, int flags) 1308static int nfs_compare_mount_options(const struct super_block *s, const struct nfs_server *b, int flags)
@@ -1359,9 +1331,46 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n
1359 goto Ebusy; 1331 goto Ebusy;
1360 if (clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor) 1332 if (clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor)
1361 goto Ebusy; 1333 goto Ebusy;
1362 return 0; 1334 return 1;
1363Ebusy: 1335Ebusy:
1364 return -EBUSY; 1336 return 0;
1337}
1338
1339struct nfs_sb_mountdata {
1340 struct nfs_server *server;
1341 int mntflags;
1342};
1343
1344static int nfs_set_super(struct super_block *s, void *data)
1345{
1346 struct nfs_sb_mountdata *sb_mntdata = data;
1347 struct nfs_server *server = sb_mntdata->server;
1348 int ret;
1349
1350 s->s_flags = sb_mntdata->mntflags;
1351 s->s_fs_info = server;
1352 ret = set_anon_super(s, server);
1353 if (ret == 0)
1354 server->s_dev = s->s_dev;
1355 return ret;
1356}
1357
1358static int nfs_compare_super(struct super_block *sb, void *data)
1359{
1360 struct nfs_sb_mountdata *sb_mntdata = data;
1361 struct nfs_server *server = sb_mntdata->server, *old = NFS_SB(sb);
1362 int mntflags = sb_mntdata->mntflags;
1363
1364 if (memcmp(&old->nfs_client->cl_addr,
1365 &server->nfs_client->cl_addr,
1366 sizeof(old->nfs_client->cl_addr)) != 0)
1367 return 0;
1368 /* Note: NFS_MOUNT_UNSHARED == NFS4_MOUNT_UNSHARED */
1369 if (old->flags & NFS_MOUNT_UNSHARED)
1370 return 0;
1371 if (memcmp(&old->fsid, &server->fsid, sizeof(old->fsid)) != 0)
1372 return 0;
1373 return nfs_compare_mount_options(sb, server, mntflags);
1365} 1374}
1366 1375
1367static int nfs_get_sb(struct file_system_type *fs_type, 1376static int nfs_get_sb(struct file_system_type *fs_type,
@@ -1373,6 +1382,9 @@ static int nfs_get_sb(struct file_system_type *fs_type,
1373 struct nfs_mount_data *data = raw_data; 1382 struct nfs_mount_data *data = raw_data;
1374 struct dentry *mntroot; 1383 struct dentry *mntroot;
1375 int (*compare_super)(struct super_block *, void *) = nfs_compare_super; 1384 int (*compare_super)(struct super_block *, void *) = nfs_compare_super;
1385 struct nfs_sb_mountdata sb_mntdata = {
1386 .mntflags = flags,
1387 };
1376 int error; 1388 int error;
1377 1389
1378 /* Validate the mount data */ 1390 /* Validate the mount data */
@@ -1386,28 +1398,25 @@ static int nfs_get_sb(struct file_system_type *fs_type,
1386 error = PTR_ERR(server); 1398 error = PTR_ERR(server);
1387 goto out; 1399 goto out;
1388 } 1400 }
1401 sb_mntdata.server = server;
1389 1402
1390 if (server->flags & NFS_MOUNT_UNSHARED) 1403 if (server->flags & NFS_MOUNT_UNSHARED)
1391 compare_super = NULL; 1404 compare_super = NULL;
1392 1405
1393 /* Get a superblock - note that we may end up sharing one that already exists */ 1406 /* Get a superblock - note that we may end up sharing one that already exists */
1394 s = sget(fs_type, compare_super, nfs_set_super, server); 1407 s = sget(fs_type, compare_super, nfs_set_super, &sb_mntdata);
1395 if (IS_ERR(s)) { 1408 if (IS_ERR(s)) {
1396 error = PTR_ERR(s); 1409 error = PTR_ERR(s);
1397 goto out_err_nosb; 1410 goto out_err_nosb;
1398 } 1411 }
1399 1412
1400 if (s->s_fs_info != server) { 1413 if (s->s_fs_info != server) {
1401 error = nfs_compare_mount_options(s, server, flags);
1402 nfs_free_server(server); 1414 nfs_free_server(server);
1403 server = NULL; 1415 server = NULL;
1404 if (error < 0)
1405 goto error_splat_super;
1406 } 1416 }
1407 1417
1408 if (!s->s_root) { 1418 if (!s->s_root) {
1409 /* initial superblock/root creation */ 1419 /* initial superblock/root creation */
1410 s->s_flags = flags;
1411 nfs_fill_super(s, data); 1420 nfs_fill_super(s, data);
1412 } 1421 }
1413 1422
@@ -1460,6 +1469,9 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
1460 struct nfs_server *server; 1469 struct nfs_server *server;
1461 struct dentry *mntroot; 1470 struct dentry *mntroot;
1462 int (*compare_super)(struct super_block *, void *) = nfs_compare_super; 1471 int (*compare_super)(struct super_block *, void *) = nfs_compare_super;
1472 struct nfs_sb_mountdata sb_mntdata = {
1473 .mntflags = flags,
1474 };
1463 int error; 1475 int error;
1464 1476
1465 dprintk("--> nfs_xdev_get_sb()\n"); 1477 dprintk("--> nfs_xdev_get_sb()\n");
@@ -1470,28 +1482,25 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
1470 error = PTR_ERR(server); 1482 error = PTR_ERR(server);
1471 goto out_err_noserver; 1483 goto out_err_noserver;
1472 } 1484 }
1485 sb_mntdata.server = server;
1473 1486
1474 if (server->flags & NFS_MOUNT_UNSHARED) 1487 if (server->flags & NFS_MOUNT_UNSHARED)
1475 compare_super = NULL; 1488 compare_super = NULL;
1476 1489
1477 /* Get a superblock - note that we may end up sharing one that already exists */ 1490 /* Get a superblock - note that we may end up sharing one that already exists */
1478 s = sget(&nfs_fs_type, compare_super, nfs_set_super, server); 1491 s = sget(&nfs_fs_type, compare_super, nfs_set_super, &sb_mntdata);
1479 if (IS_ERR(s)) { 1492 if (IS_ERR(s)) {
1480 error = PTR_ERR(s); 1493 error = PTR_ERR(s);
1481 goto out_err_nosb; 1494 goto out_err_nosb;
1482 } 1495 }
1483 1496
1484 if (s->s_fs_info != server) { 1497 if (s->s_fs_info != server) {
1485 error = nfs_compare_mount_options(s, server, flags);
1486 nfs_free_server(server); 1498 nfs_free_server(server);
1487 server = NULL; 1499 server = NULL;
1488 if (error < 0)
1489 goto error_splat_super;
1490 } 1500 }
1491 1501
1492 if (!s->s_root) { 1502 if (!s->s_root) {
1493 /* initial superblock/root creation */ 1503 /* initial superblock/root creation */
1494 s->s_flags = flags;
1495 nfs_clone_super(s, data->sb); 1504 nfs_clone_super(s, data->sb);
1496 } 1505 }
1497 1506
@@ -1729,6 +1738,9 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
1729 struct dentry *mntroot; 1738 struct dentry *mntroot;
1730 char *mntpath = NULL, *hostname = NULL, *ip_addr = NULL; 1739 char *mntpath = NULL, *hostname = NULL, *ip_addr = NULL;
1731 int (*compare_super)(struct super_block *, void *) = nfs_compare_super; 1740 int (*compare_super)(struct super_block *, void *) = nfs_compare_super;
1741 struct nfs_sb_mountdata sb_mntdata = {
1742 .mntflags = flags,
1743 };
1732 int error; 1744 int error;
1733 1745
1734 /* Validate the mount data */ 1746 /* Validate the mount data */
@@ -1744,12 +1756,13 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
1744 error = PTR_ERR(server); 1756 error = PTR_ERR(server);
1745 goto out; 1757 goto out;
1746 } 1758 }
1759 sb_mntdata.server = server;
1747 1760
1748 if (server->flags & NFS4_MOUNT_UNSHARED) 1761 if (server->flags & NFS4_MOUNT_UNSHARED)
1749 compare_super = NULL; 1762 compare_super = NULL;
1750 1763
1751 /* Get a superblock - note that we may end up sharing one that already exists */ 1764 /* Get a superblock - note that we may end up sharing one that already exists */
1752 s = sget(fs_type, compare_super, nfs_set_super, server); 1765 s = sget(fs_type, compare_super, nfs_set_super, &sb_mntdata);
1753 if (IS_ERR(s)) { 1766 if (IS_ERR(s)) {
1754 error = PTR_ERR(s); 1767 error = PTR_ERR(s);
1755 goto out_free; 1768 goto out_free;
@@ -1762,7 +1775,6 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
1762 1775
1763 if (!s->s_root) { 1776 if (!s->s_root) {
1764 /* initial superblock/root creation */ 1777 /* initial superblock/root creation */
1765 s->s_flags = flags;
1766 nfs4_fill_super(s); 1778 nfs4_fill_super(s);
1767 } 1779 }
1768 1780
@@ -1816,6 +1828,9 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
1816 struct nfs_server *server; 1828 struct nfs_server *server;
1817 struct dentry *mntroot; 1829 struct dentry *mntroot;
1818 int (*compare_super)(struct super_block *, void *) = nfs_compare_super; 1830 int (*compare_super)(struct super_block *, void *) = nfs_compare_super;
1831 struct nfs_sb_mountdata sb_mntdata = {
1832 .mntflags = flags,
1833 };
1819 int error; 1834 int error;
1820 1835
1821 dprintk("--> nfs4_xdev_get_sb()\n"); 1836 dprintk("--> nfs4_xdev_get_sb()\n");
@@ -1826,12 +1841,13 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
1826 error = PTR_ERR(server); 1841 error = PTR_ERR(server);
1827 goto out_err_noserver; 1842 goto out_err_noserver;
1828 } 1843 }
1844 sb_mntdata.server = server;
1829 1845
1830 if (server->flags & NFS4_MOUNT_UNSHARED) 1846 if (server->flags & NFS4_MOUNT_UNSHARED)
1831 compare_super = NULL; 1847 compare_super = NULL;
1832 1848
1833 /* Get a superblock - note that we may end up sharing one that already exists */ 1849 /* Get a superblock - note that we may end up sharing one that already exists */
1834 s = sget(&nfs_fs_type, compare_super, nfs_set_super, server); 1850 s = sget(&nfs_fs_type, compare_super, nfs_set_super, &sb_mntdata);
1835 if (IS_ERR(s)) { 1851 if (IS_ERR(s)) {
1836 error = PTR_ERR(s); 1852 error = PTR_ERR(s);
1837 goto out_err_nosb; 1853 goto out_err_nosb;
@@ -1844,7 +1860,6 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
1844 1860
1845 if (!s->s_root) { 1861 if (!s->s_root) {
1846 /* initial superblock/root creation */ 1862 /* initial superblock/root creation */
1847 s->s_flags = flags;
1848 nfs4_clone_super(s, data->sb); 1863 nfs4_clone_super(s, data->sb);
1849 } 1864 }
1850 1865
@@ -1887,6 +1902,9 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
1887 struct dentry *mntroot; 1902 struct dentry *mntroot;
1888 struct nfs_fh mntfh; 1903 struct nfs_fh mntfh;
1889 int (*compare_super)(struct super_block *, void *) = nfs_compare_super; 1904 int (*compare_super)(struct super_block *, void *) = nfs_compare_super;
1905 struct nfs_sb_mountdata sb_mntdata = {
1906 .mntflags = flags,
1907 };
1890 int error; 1908 int error;
1891 1909
1892 dprintk("--> nfs4_referral_get_sb()\n"); 1910 dprintk("--> nfs4_referral_get_sb()\n");
@@ -1897,12 +1915,13 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
1897 error = PTR_ERR(server); 1915 error = PTR_ERR(server);
1898 goto out_err_noserver; 1916 goto out_err_noserver;
1899 } 1917 }
1918 sb_mntdata.server = server;
1900 1919
1901 if (server->flags & NFS4_MOUNT_UNSHARED) 1920 if (server->flags & NFS4_MOUNT_UNSHARED)
1902 compare_super = NULL; 1921 compare_super = NULL;
1903 1922
1904 /* Get a superblock - note that we may end up sharing one that already exists */ 1923 /* Get a superblock - note that we may end up sharing one that already exists */
1905 s = sget(&nfs_fs_type, compare_super, nfs_set_super, server); 1924 s = sget(&nfs_fs_type, compare_super, nfs_set_super, &sb_mntdata);
1906 if (IS_ERR(s)) { 1925 if (IS_ERR(s)) {
1907 error = PTR_ERR(s); 1926 error = PTR_ERR(s);
1908 goto out_err_nosb; 1927 goto out_err_nosb;
@@ -1915,7 +1934,6 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
1915 1934
1916 if (!s->s_root) { 1935 if (!s->s_root) {
1917 /* initial superblock/root creation */ 1936 /* initial superblock/root creation */
1918 s->s_flags = flags;
1919 nfs4_fill_super(s); 1937 nfs4_fill_super(s);
1920 } 1938 }
1921 1939
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 23a22df039d8..c043c1ccf1c5 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -73,6 +73,19 @@ enum {
73 ATA_PIO5 = ATA_PIO4 | (1 << 5), 73 ATA_PIO5 = ATA_PIO4 | (1 << 5),
74 ATA_PIO6 = ATA_PIO5 | (1 << 6), 74 ATA_PIO6 = ATA_PIO5 | (1 << 6),
75 75
76 ATA_SWDMA0 = (1 << 0),
77 ATA_SWDMA1 = ATA_SWDMA0 | (1 << 1),
78 ATA_SWDMA2 = ATA_SWDMA1 | (1 << 2),
79
80 ATA_SWDMA2_ONLY = (1 << 2),
81
82 ATA_MWDMA0 = (1 << 0),
83 ATA_MWDMA1 = ATA_MWDMA0 | (1 << 1),
84 ATA_MWDMA2 = ATA_MWDMA1 | (1 << 2),
85
86 ATA_MWDMA12_ONLY = (1 << 1) | (1 << 2),
87 ATA_MWDMA2_ONLY = (1 << 2),
88
76 ATA_UDMA0 = (1 << 0), 89 ATA_UDMA0 = (1 << 0),
77 ATA_UDMA1 = ATA_UDMA0 | (1 << 1), 90 ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
78 ATA_UDMA2 = ATA_UDMA1 | (1 << 2), 91 ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 41978a557318..a67bb9075e9b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -303,6 +303,7 @@ enum {
303 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ 303 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */
304 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ 304 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
305 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ 305 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */
306 ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */
306}; 307};
307 308
308enum hsm_task_states { 309enum hsm_task_states {
diff --git a/include/linux/sched.h b/include/linux/sched.h
index bd6a0320a770..f4e324ed2e44 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -904,6 +904,7 @@ struct sched_entity {
904 904
905 u64 exec_start; 905 u64 exec_start;
906 u64 sum_exec_runtime; 906 u64 sum_exec_runtime;
907 u64 prev_sum_exec_runtime;
907 u64 wait_start_fair; 908 u64 wait_start_fair;
908 u64 sleep_start_fair; 909 u64 sleep_start_fair;
909 910
diff --git a/kernel/sched.c b/kernel/sched.c
index 9fe473a190de..b533d6db78aa 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1587,6 +1587,7 @@ static void __sched_fork(struct task_struct *p)
1587 p->se.wait_start_fair = 0; 1587 p->se.wait_start_fair = 0;
1588 p->se.exec_start = 0; 1588 p->se.exec_start = 0;
1589 p->se.sum_exec_runtime = 0; 1589 p->se.sum_exec_runtime = 0;
1590 p->se.prev_sum_exec_runtime = 0;
1590 p->se.delta_exec = 0; 1591 p->se.delta_exec = 0;
1591 p->se.delta_fair_run = 0; 1592 p->se.delta_fair_run = 0;
1592 p->se.delta_fair_sleep = 0; 1593 p->se.delta_fair_sleep = 0;
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index ee3771850aaf..ce39282d9c0d 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -354,7 +354,7 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr)
354 delta_fair = calc_delta_fair(delta_exec, lw); 354 delta_fair = calc_delta_fair(delta_exec, lw);
355 delta_mine = calc_delta_mine(delta_exec, curr->load.weight, lw); 355 delta_mine = calc_delta_mine(delta_exec, curr->load.weight, lw);
356 356
357 if (cfs_rq->sleeper_bonus > sysctl_sched_latency) { 357 if (cfs_rq->sleeper_bonus > sysctl_sched_min_granularity) {
358 delta = min((u64)delta_mine, cfs_rq->sleeper_bonus); 358 delta = min((u64)delta_mine, cfs_rq->sleeper_bonus);
359 delta = min(delta, (unsigned long)( 359 delta = min(delta, (unsigned long)(
360 (long)sysctl_sched_runtime_limit - curr->wait_runtime)); 360 (long)sysctl_sched_runtime_limit - curr->wait_runtime));
@@ -489,6 +489,9 @@ update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se)
489{ 489{
490 unsigned long delta_fair; 490 unsigned long delta_fair;
491 491
492 if (unlikely(!se->wait_start_fair))
493 return;
494
492 delta_fair = (unsigned long)min((u64)(2*sysctl_sched_runtime_limit), 495 delta_fair = (unsigned long)min((u64)(2*sysctl_sched_runtime_limit),
493 (u64)(cfs_rq->fair_clock - se->wait_start_fair)); 496 (u64)(cfs_rq->fair_clock - se->wait_start_fair));
494 497
@@ -668,7 +671,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
668/* 671/*
669 * Preempt the current task with a newly woken task if needed: 672 * Preempt the current task with a newly woken task if needed:
670 */ 673 */
671static void 674static int
672__check_preempt_curr_fair(struct cfs_rq *cfs_rq, struct sched_entity *se, 675__check_preempt_curr_fair(struct cfs_rq *cfs_rq, struct sched_entity *se,
673 struct sched_entity *curr, unsigned long granularity) 676 struct sched_entity *curr, unsigned long granularity)
674{ 677{
@@ -679,8 +682,11 @@ __check_preempt_curr_fair(struct cfs_rq *cfs_rq, struct sched_entity *se,
679 * preempt the current task unless the best task has 682 * preempt the current task unless the best task has
680 * a larger than sched_granularity fairness advantage: 683 * a larger than sched_granularity fairness advantage:
681 */ 684 */
682 if (__delta > niced_granularity(curr, granularity)) 685 if (__delta > niced_granularity(curr, granularity)) {
683 resched_task(rq_of(cfs_rq)->curr); 686 resched_task(rq_of(cfs_rq)->curr);
687 return 1;
688 }
689 return 0;
684} 690}
685 691
686static inline void 692static inline void
@@ -725,6 +731,7 @@ static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev)
725 731
726static void entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) 732static void entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
727{ 733{
734 unsigned long gran, ideal_runtime, delta_exec;
728 struct sched_entity *next; 735 struct sched_entity *next;
729 736
730 /* 737 /*
@@ -741,8 +748,22 @@ static void entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
741 if (next == curr) 748 if (next == curr)
742 return; 749 return;
743 750
744 __check_preempt_curr_fair(cfs_rq, next, curr, 751 gran = sched_granularity(cfs_rq);
745 sched_granularity(cfs_rq)); 752 ideal_runtime = niced_granularity(curr,
753 max(sysctl_sched_latency / cfs_rq->nr_running,
754 (unsigned long)sysctl_sched_min_granularity));
755 /*
756 * If we executed more than what the latency constraint suggests,
757 * reduce the rescheduling granularity. This way the total latency
758 * of how much a task is not scheduled converges to
759 * sysctl_sched_latency:
760 */
761 delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
762 if (delta_exec > ideal_runtime)
763 gran = 0;
764
765 if (__check_preempt_curr_fair(cfs_rq, next, curr, gran))
766 curr->prev_sum_exec_runtime = curr->sum_exec_runtime;
746} 767}
747 768
748/************************************************** 769/**************************************************
@@ -1076,31 +1097,34 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr)
1076static void task_new_fair(struct rq *rq, struct task_struct *p) 1097static void task_new_fair(struct rq *rq, struct task_struct *p)
1077{ 1098{
1078 struct cfs_rq *cfs_rq = task_cfs_rq(p); 1099 struct cfs_rq *cfs_rq = task_cfs_rq(p);
1079 struct sched_entity *se = &p->se; 1100 struct sched_entity *se = &p->se, *curr = cfs_rq_curr(cfs_rq);
1080 1101
1081 sched_info_queued(p); 1102 sched_info_queued(p);
1082 1103
1104 update_curr(cfs_rq);
1083 update_stats_enqueue(cfs_rq, se); 1105 update_stats_enqueue(cfs_rq, se);
1084 /* 1106 /*
1085 * Child runs first: we let it run before the parent 1107 * Child runs first: we let it run before the parent
1086 * until it reschedules once. We set up the key so that 1108 * until it reschedules once. We set up the key so that
1087 * it will preempt the parent: 1109 * it will preempt the parent:
1088 */ 1110 */
1089 p->se.fair_key = current->se.fair_key - 1111 se->fair_key = curr->fair_key -
1090 niced_granularity(&rq->curr->se, sched_granularity(cfs_rq)) - 1; 1112 niced_granularity(curr, sched_granularity(cfs_rq)) - 1;
1091 /* 1113 /*
1092 * The first wait is dominated by the child-runs-first logic, 1114 * The first wait is dominated by the child-runs-first logic,
1093 * so do not credit it with that waiting time yet: 1115 * so do not credit it with that waiting time yet:
1094 */ 1116 */
1095 if (sysctl_sched_features & SCHED_FEAT_SKIP_INITIAL) 1117 if (sysctl_sched_features & SCHED_FEAT_SKIP_INITIAL)
1096 p->se.wait_start_fair = 0; 1118 se->wait_start_fair = 0;
1097 1119
1098 /* 1120 /*
1099 * The statistical average of wait_runtime is about 1121 * The statistical average of wait_runtime is about
1100 * -granularity/2, so initialize the task with that: 1122 * -granularity/2, so initialize the task with that:
1101 */ 1123 */
1102 if (sysctl_sched_features & SCHED_FEAT_START_DEBIT) 1124 if (sysctl_sched_features & SCHED_FEAT_START_DEBIT) {
1103 p->se.wait_runtime = -(sched_granularity(cfs_rq) / 2); 1125 se->wait_runtime = -(sched_granularity(cfs_rq) / 2);
1126 schedstat_add(cfs_rq, wait_runtime, se->wait_runtime);
1127 }
1104 1128
1105 __enqueue_entity(cfs_rq, se); 1129 __enqueue_entity(cfs_rq, se);
1106} 1130}