aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/ec.c17
-rw-r--r--drivers/acpi/pci_irq.c98
-rw-r--r--drivers/acpi/processor_core.c16
-rw-r--r--drivers/acpi/utilities/utobject.c2
-rw-r--r--drivers/acpi/video.c2
-rw-r--r--drivers/atm/firestream.c4
-rw-r--r--drivers/atm/fore200e.c4
-rw-r--r--drivers/atm/idt77252.c12
-rw-r--r--drivers/block/viodasd.c3
-rw-r--r--drivers/bluetooth/hci_usb.c3
-rw-r--r--drivers/i2c/busses/i2c-amd756.c2
-rw-r--r--drivers/i2c/chips/Makefile7
-rw-r--r--drivers/i2c/i2c-core.c6
-rw-r--r--drivers/isdn/i4l/isdn_common.c4
-rw-r--r--drivers/isdn/i4l/isdn_v110.c2
-rw-r--r--drivers/macintosh/via-pmu-backlight.c5
-rw-r--r--drivers/macintosh/via-pmu.c2
-rw-r--r--drivers/net/Kconfig20
-rw-r--r--drivers/net/ac3200.c7
-rw-r--r--drivers/net/apne.c7
-rw-r--r--drivers/net/appletalk/ltpc.c3
-rw-r--r--drivers/net/arcnet/capmode.c6
-rw-r--r--drivers/net/atarilance.c5
-rw-r--r--drivers/net/e100.c29
-rw-r--r--drivers/net/enc28j60.c3
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c2
-rw-r--r--drivers/net/mv643xx_eth.c1
-rw-r--r--drivers/net/pcmcia/axnet_cs.c2
-rw-r--r--drivers/net/phy/Kconfig1
-rw-r--r--drivers/net/phy/davicom.c17
-rw-r--r--drivers/net/pppol2tp.c69
-rw-r--r--drivers/net/s2io.c2
-rw-r--r--drivers/net/tulip/de2104x.c3
-rw-r--r--drivers/net/wan/sbni.c2
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c5
-rw-r--r--drivers/pnp/quirks.c100
38 files changed, 316 insertions, 163 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index caf873c14bfb..e7e197e3a4ff 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -129,6 +129,7 @@ static struct acpi_ec {
129 struct mutex lock; 129 struct mutex lock;
130 wait_queue_head_t wait; 130 wait_queue_head_t wait;
131 struct list_head list; 131 struct list_head list;
132 atomic_t irq_count;
132 u8 handlers_installed; 133 u8 handlers_installed;
133} *boot_ec, *first_ec; 134} *boot_ec, *first_ec;
134 135
@@ -181,6 +182,8 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
181{ 182{
182 int ret = 0; 183 int ret = 0;
183 184
185 atomic_set(&ec->irq_count, 0);
186
184 if (unlikely(event == ACPI_EC_EVENT_OBF_1 && 187 if (unlikely(event == ACPI_EC_EVENT_OBF_1 &&
185 test_bit(EC_FLAGS_NO_OBF1_GPE, &ec->flags))) 188 test_bit(EC_FLAGS_NO_OBF1_GPE, &ec->flags)))
186 force_poll = 1; 189 force_poll = 1;
@@ -227,6 +230,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
227 while (time_before(jiffies, delay)) { 230 while (time_before(jiffies, delay)) {
228 if (acpi_ec_check_status(ec, event)) 231 if (acpi_ec_check_status(ec, event))
229 goto end; 232 goto end;
233 msleep(5);
230 } 234 }
231 } 235 }
232 pr_err(PREFIX "acpi_ec_wait timeout," 236 pr_err(PREFIX "acpi_ec_wait timeout,"
@@ -529,6 +533,13 @@ static u32 acpi_ec_gpe_handler(void *data)
529 struct acpi_ec *ec = data; 533 struct acpi_ec *ec = data;
530 534
531 pr_debug(PREFIX "~~~> interrupt\n"); 535 pr_debug(PREFIX "~~~> interrupt\n");
536 atomic_inc(&ec->irq_count);
537 if (atomic_read(&ec->irq_count) > 5) {
538 pr_err(PREFIX "GPE storm detected, disabling EC GPE\n");
539 acpi_disable_gpe(NULL, ec->gpe, ACPI_ISR);
540 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
541 return ACPI_INTERRUPT_HANDLED;
542 }
532 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags); 543 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
533 if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) 544 if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags))
534 wake_up(&ec->wait); 545 wake_up(&ec->wait);
@@ -943,11 +954,7 @@ int __init acpi_ec_ecdt_probe(void)
943 boot_ec->command_addr = ecdt_ptr->control.address; 954 boot_ec->command_addr = ecdt_ptr->control.address;
944 boot_ec->data_addr = ecdt_ptr->data.address; 955 boot_ec->data_addr = ecdt_ptr->data.address;
945 boot_ec->gpe = ecdt_ptr->gpe; 956 boot_ec->gpe = ecdt_ptr->gpe;
946 if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id, 957 boot_ec->handle = ACPI_ROOT_OBJECT;
947 &boot_ec->handle))) {
948 pr_info("Failed to locate handle for boot EC\n");
949 boot_ec->handle = ACPI_ROOT_OBJECT;
950 }
951 } else { 958 } else {
952 /* This workaround is needed only on some broken machines, 959 /* This workaround is needed only on some broken machines,
953 * which require early EC, but fail to provide ECDT */ 960 * which require early EC, but fail to provide ECDT */
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 7f19859580c7..7af414a3c63e 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -25,6 +25,7 @@
25 */ 25 */
26 26
27 27
28#include <linux/dmi.h>
28#include <linux/kernel.h> 29#include <linux/kernel.h>
29#include <linux/module.h> 30#include <linux/module.h>
30#include <linux/init.h> 31#include <linux/init.h>
@@ -76,6 +77,101 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
76 return NULL; 77 return NULL;
77} 78}
78 79
80/* http://bugzilla.kernel.org/show_bug.cgi?id=4773 */
81static struct dmi_system_id medion_md9580[] = {
82 {
83 .ident = "Medion MD9580-F laptop",
84 .matches = {
85 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
86 DMI_MATCH(DMI_PRODUCT_NAME, "A555"),
87 },
88 },
89 { }
90};
91
92/* http://bugzilla.kernel.org/show_bug.cgi?id=5044 */
93static struct dmi_system_id dell_optiplex[] = {
94 {
95 .ident = "Dell Optiplex GX1",
96 .matches = {
97 DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
98 DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX1 600S+"),
99 },
100 },
101 { }
102};
103
104/* http://bugzilla.kernel.org/show_bug.cgi?id=10138 */
105static struct dmi_system_id hp_t5710[] = {
106 {
107 .ident = "HP t5710",
108 .matches = {
109 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
110 DMI_MATCH(DMI_PRODUCT_NAME, "hp t5000 series"),
111 DMI_MATCH(DMI_BOARD_NAME, "098Ch"),
112 },
113 },
114 { }
115};
116
117struct prt_quirk {
118 struct dmi_system_id *system;
119 unsigned int segment;
120 unsigned int bus;
121 unsigned int device;
122 unsigned char pin;
123 char *source; /* according to BIOS */
124 char *actual_source;
125};
126
127/*
128 * These systems have incorrect _PRT entries. The BIOS claims the PCI
129 * interrupt at the listed segment/bus/device/pin is connected to the first
130 * link device, but it is actually connected to the second.
131 */
132static struct prt_quirk prt_quirks[] = {
133 { medion_md9580, 0, 0, 9, 'A',
134 "\\_SB_.PCI0.ISA.LNKA",
135 "\\_SB_.PCI0.ISA.LNKB"},
136 { dell_optiplex, 0, 0, 0xd, 'A',
137 "\\_SB_.LNKB",
138 "\\_SB_.LNKA"},
139 { hp_t5710, 0, 0, 1, 'A',
140 "\\_SB_.PCI0.LNK1",
141 "\\_SB_.PCI0.LNK3"},
142};
143
144static void
145do_prt_fixups(struct acpi_prt_entry *entry, struct acpi_pci_routing_table *prt)
146{
147 int i;
148 struct prt_quirk *quirk;
149
150 for (i = 0; i < ARRAY_SIZE(prt_quirks); i++) {
151 quirk = &prt_quirks[i];
152
153 /* All current quirks involve link devices, not GSIs */
154 if (!prt->source)
155 continue;
156
157 if (dmi_check_system(quirk->system) &&
158 entry->id.segment == quirk->segment &&
159 entry->id.bus == quirk->bus &&
160 entry->id.device == quirk->device &&
161 entry->pin + 'A' == quirk->pin &&
162 !strcmp(prt->source, quirk->source) &&
163 strlen(prt->source) >= strlen(quirk->actual_source)) {
164 printk(KERN_WARNING PREFIX "firmware reports "
165 "%04x:%02x:%02x[%c] connected to %s; "
166 "changing to %s\n",
167 entry->id.segment, entry->id.bus,
168 entry->id.device, 'A' + entry->pin,
169 prt->source, quirk->actual_source);
170 strcpy(prt->source, quirk->actual_source);
171 }
172 }
173}
174
79static int 175static int
80acpi_pci_irq_add_entry(acpi_handle handle, 176acpi_pci_irq_add_entry(acpi_handle handle,
81 int segment, int bus, struct acpi_pci_routing_table *prt) 177 int segment, int bus, struct acpi_pci_routing_table *prt)
@@ -96,6 +192,8 @@ acpi_pci_irq_add_entry(acpi_handle handle,
96 entry->id.function = prt->address & 0xFFFF; 192 entry->id.function = prt->address & 0xFFFF;
97 entry->pin = prt->pin; 193 entry->pin = prt->pin;
98 194
195 do_prt_fixups(entry, prt);
196
99 /* 197 /*
100 * Type 1: Dynamic 198 * Type 1: Dynamic
101 * --------------- 199 * ---------------
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index a3cc8a98255c..d9316ab66347 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -840,17 +840,19 @@ static int is_processor_present(acpi_handle handle)
840 840
841 841
842 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 842 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
843 /*
844 * if a processor object does not have an _STA object,
845 * OSPM assumes that the processor is present.
846 */
847 if (status == AE_NOT_FOUND)
848 return 1;
849 843
850 if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT)) 844 if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT))
851 return 1; 845 return 1;
852 846
853 ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present")); 847 /*
848 * _STA is mandatory for a processor that supports hot plug
849 */
850 if (status == AE_NOT_FOUND)
851 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
852 "Processor does not support hot plug\n"));
853 else
854 ACPI_EXCEPTION((AE_INFO, status,
855 "Processor Device is not present"));
854 return 0; 856 return 0;
855} 857}
856 858
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 76ee766c84f9..e08b3fa6639f 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -432,7 +432,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
432 * element -- which is legal) 432 * element -- which is legal)
433 */ 433 */
434 if (!internal_object) { 434 if (!internal_object) {
435 *obj_length = 0; 435 *obj_length = sizeof(union acpi_object);
436 return_ACPI_STATUS(AE_OK); 436 return_ACPI_STATUS(AE_OK);
437 } 437 }
438 438
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 12cce69b5441..ace958cb3894 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -713,7 +713,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
713 713
714 kfree(obj); 714 kfree(obj);
715 715
716 if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){ 716 if (device->cap._BCL && device->cap._BCM && max_level > 0) {
717 int result; 717 int result;
718 static int count = 0; 718 static int count = 0;
719 char *name; 719 char *name;
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index c662d686154a..47c57a4294b7 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -331,8 +331,8 @@ module_param(fs_keystream, int, 0);
331#define FS_DEBUG_QSIZE 0x00001000 331#define FS_DEBUG_QSIZE 0x00001000
332 332
333 333
334#define func_enter() fs_dprintk (FS_DEBUG_FLOW, "fs: enter %s\n", __FUNCTION__) 334#define func_enter() fs_dprintk(FS_DEBUG_FLOW, "fs: enter %s\n", __func__)
335#define func_exit() fs_dprintk (FS_DEBUG_FLOW, "fs: exit %s\n", __FUNCTION__) 335#define func_exit() fs_dprintk(FS_DEBUG_FLOW, "fs: exit %s\n", __func__)
336 336
337 337
338static struct fs_dev *fs_boards = NULL; 338static struct fs_dev *fs_boards = NULL;
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index f97e050338f0..9427a61f62b0 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -95,8 +95,8 @@
95#if 1 95#if 1
96#define ASSERT(expr) if (!(expr)) { \ 96#define ASSERT(expr) if (!(expr)) { \
97 printk(FORE200E "assertion failed! %s[%d]: %s\n", \ 97 printk(FORE200E "assertion failed! %s[%d]: %s\n", \
98 __FUNCTION__, __LINE__, #expr); \ 98 __func__, __LINE__, #expr); \
99 panic(FORE200E "%s", __FUNCTION__); \ 99 panic(FORE200E "%s", __func__); \
100 } 100 }
101#else 101#else
102#define ASSERT(expr) do {} while (0) 102#define ASSERT(expr) do {} while (0)
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index eee54c0cde68..b967919fb7e2 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -555,7 +555,7 @@ idt77252_tx_dump(struct idt77252_dev *card)
555 struct vc_map *vc; 555 struct vc_map *vc;
556 int i; 556 int i;
557 557
558 printk("%s\n", __FUNCTION__); 558 printk("%s\n", __func__);
559 for (i = 0; i < card->tct_size; i++) { 559 for (i = 0; i < card->tct_size; i++) {
560 vc = card->vcs[i]; 560 vc = card->vcs[i];
561 if (!vc) 561 if (!vc)
@@ -1035,7 +1035,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
1035 skb = sb_pool_skb(card, le32_to_cpu(rsqe->word_2)); 1035 skb = sb_pool_skb(card, le32_to_cpu(rsqe->word_2));
1036 if (skb == NULL) { 1036 if (skb == NULL) {
1037 printk("%s: NULL skb in %s, rsqe: %08x %08x %08x %08x\n", 1037 printk("%s: NULL skb in %s, rsqe: %08x %08x %08x %08x\n",
1038 card->name, __FUNCTION__, 1038 card->name, __func__,
1039 le32_to_cpu(rsqe->word_1), le32_to_cpu(rsqe->word_2), 1039 le32_to_cpu(rsqe->word_1), le32_to_cpu(rsqe->word_2),
1040 le32_to_cpu(rsqe->word_3), le32_to_cpu(rsqe->word_4)); 1040 le32_to_cpu(rsqe->word_3), le32_to_cpu(rsqe->word_4));
1041 return; 1041 return;
@@ -1873,7 +1873,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1873 return; 1873 return;
1874 1874
1875 if (sb_pool_add(card, skb, queue)) { 1875 if (sb_pool_add(card, skb, queue)) {
1876 printk("%s: SB POOL full\n", __FUNCTION__); 1876 printk("%s: SB POOL full\n", __func__);
1877 goto outfree; 1877 goto outfree;
1878 } 1878 }
1879 1879
@@ -1883,7 +1883,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1883 IDT77252_PRV_PADDR(skb) = paddr; 1883 IDT77252_PRV_PADDR(skb) = paddr;
1884 1884
1885 if (push_rx_skb(card, skb, queue)) { 1885 if (push_rx_skb(card, skb, queue)) {
1886 printk("%s: FB QUEUE full\n", __FUNCTION__); 1886 printk("%s: FB QUEUE full\n", __func__);
1887 goto outunmap; 1887 goto outunmap;
1888 } 1888 }
1889 } 1889 }
@@ -3821,12 +3821,12 @@ static int __init idt77252_init(void)
3821{ 3821{
3822 struct sk_buff *skb; 3822 struct sk_buff *skb;
3823 3823
3824 printk("%s: at %p\n", __FUNCTION__, idt77252_init); 3824 printk("%s: at %p\n", __func__, idt77252_init);
3825 3825
3826 if (sizeof(skb->cb) < sizeof(struct atm_skb_data) + 3826 if (sizeof(skb->cb) < sizeof(struct atm_skb_data) +
3827 sizeof(struct idt77252_skb_prv)) { 3827 sizeof(struct idt77252_skb_prv)) {
3828 printk(KERN_ERR "%s: skb->cb is too small (%lu < %lu)\n", 3828 printk(KERN_ERR "%s: skb->cb is too small (%lu < %lu)\n",
3829 __FUNCTION__, (unsigned long) sizeof(skb->cb), 3829 __func__, (unsigned long) sizeof(skb->cb),
3830 (unsigned long) sizeof(struct atm_skb_data) + 3830 (unsigned long) sizeof(struct atm_skb_data) +
3831 sizeof(struct idt77252_skb_prv)); 3831 sizeof(struct idt77252_skb_prv));
3832 return -EIO; 3832 return -EIO;
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index 9e61fca46117..41ca721d2523 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -528,8 +528,7 @@ static int block_event_to_scatterlist(const struct vioblocklpevent *bevent,
528 numsg = VIOMAXBLOCKDMA; 528 numsg = VIOMAXBLOCKDMA;
529 529
530 *total_len = 0; 530 *total_len = 0;
531 memset(sg, 0, sizeof(sg[0]) * VIOMAXBLOCKDMA); 531 sg_init_table(sg, VIOMAXBLOCKDMA);
532
533 for (i = 0; (i < numsg) && (rw_data->dma_info[i].len > 0); ++i) { 532 for (i = 0; (i < numsg) && (rw_data->dma_info[i].len > 0); ++i) {
534 sg_dma_address(&sg[i]) = rw_data->dma_info[i].token; 533 sg_dma_address(&sg[i]) = rw_data->dma_info[i].token;
535 sg_dma_len(&sg[i]) = rw_data->dma_info[i].len; 534 sg_dma_len(&sg[i]) = rw_data->dma_info[i].len;
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index f16c94cbf488..8b884f87d8b7 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -149,6 +149,9 @@ static struct usb_device_id blacklist_ids[] = {
149 { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC }, 149 { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },
150 { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC }, 150 { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC },
151 151
152 /* CONWISE Technology based adapters with buggy SCO support */
153 { USB_DEVICE(0x0e5e, 0x6622), .driver_info = HCI_BROKEN_ISOC },
154
152 /* Belkin F8T012 and F8T013 devices */ 155 /* Belkin F8T012 and F8T013 devices */
153 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, 156 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
154 { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, 157 { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
index 573abe440842..2fa43183d375 100644
--- a/drivers/i2c/busses/i2c-amd756.c
+++ b/drivers/i2c/busses/i2c-amd756.c
@@ -335,7 +335,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
335 u8 temp; 335 u8 temp;
336 336
337 /* driver_data might come from user-space, so check it */ 337 /* driver_data might come from user-space, so check it */
338 if (id->driver_data > ARRAY_SIZE(chipname)) 338 if (id->driver_data >= ARRAY_SIZE(chipname))
339 return -EINVAL; 339 return -EINVAL;
340 340
341 if (amd756_ioport) { 341 if (amd756_ioport) {
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 501f00cea782..e47aca0ca5ae 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -1,6 +1,13 @@
1# 1#
2# Makefile for miscellaneous I2C chip drivers. 2# Makefile for miscellaneous I2C chip drivers.
3# 3#
4# Think twice before you add a new driver to this directory.
5# Device drivers are better grouped according to the functionality they
6# implement rather than to the bus they are connected to. In particular:
7# * Hardware monitoring chip drivers go to drivers/hwmon
8# * RTC chip drivers go to drivers/rtc
9# * I/O expander drivers go to drivers/gpio
10#
4 11
5obj-$(CONFIG_DS1682) += ds1682.o 12obj-$(CONFIG_DS1682) += ds1682.o
6obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o 13obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 96da22e9a5a4..fd84b2a36338 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -90,12 +90,16 @@ static int i2c_device_probe(struct device *dev)
90{ 90{
91 struct i2c_client *client = to_i2c_client(dev); 91 struct i2c_client *client = to_i2c_client(dev);
92 struct i2c_driver *driver = to_i2c_driver(dev->driver); 92 struct i2c_driver *driver = to_i2c_driver(dev->driver);
93 int status;
93 94
94 if (!driver->probe) 95 if (!driver->probe)
95 return -ENODEV; 96 return -ENODEV;
96 client->driver = driver; 97 client->driver = driver;
97 dev_dbg(dev, "probe\n"); 98 dev_dbg(dev, "probe\n");
98 return driver->probe(client); 99 status = driver->probe(client);
100 if (status)
101 client->driver = NULL;
102 return status;
99} 103}
100 104
101static int i2c_device_remove(struct device *dev) 105static int i2c_device_remove(struct device *dev)
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 9cef6fcf587b..d4ad6992f776 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -981,13 +981,13 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack)
981} 981}
982 982
983 983
984static __inline int 984static inline int
985isdn_minor2drv(int minor) 985isdn_minor2drv(int minor)
986{ 986{
987 return (dev->drvmap[minor]); 987 return (dev->drvmap[minor]);
988} 988}
989 989
990static __inline int 990static inline int
991isdn_minor2chan(int minor) 991isdn_minor2chan(int minor)
992{ 992{
993 return (dev->chanmap[minor]); 993 return (dev->chanmap[minor]);
diff --git a/drivers/isdn/i4l/isdn_v110.c b/drivers/isdn/i4l/isdn_v110.c
index 5484d3c38a57..c5d02b6aafab 100644
--- a/drivers/isdn/i4l/isdn_v110.c
+++ b/drivers/isdn/i4l/isdn_v110.c
@@ -62,7 +62,7 @@ static unsigned char V110_OffMatrix_38400[] =
62 * and to 67452301 when keylen = 2. This is necessary because ordering on 62 * and to 67452301 when keylen = 2. This is necessary because ordering on
63 * the isdn line is the other way. 63 * the isdn line is the other way.
64 */ 64 */
65static __inline unsigned char 65static inline unsigned char
66FlipBits(unsigned char c, int keylen) 66FlipBits(unsigned char c, int keylen)
67{ 67{
68 unsigned char b = c; 68 unsigned char b = c;
diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c
index 741a2e3f4fc6..a348bb0791d3 100644
--- a/drivers/macintosh/via-pmu-backlight.c
+++ b/drivers/macintosh/via-pmu-backlight.c
@@ -17,7 +17,7 @@
17 17
18static struct backlight_ops pmu_backlight_data; 18static struct backlight_ops pmu_backlight_data;
19static DEFINE_SPINLOCK(pmu_backlight_lock); 19static DEFINE_SPINLOCK(pmu_backlight_lock);
20static int sleeping; 20static int sleeping, uses_pmu_bl;
21static u8 bl_curve[FB_BACKLIGHT_LEVELS]; 21static u8 bl_curve[FB_BACKLIGHT_LEVELS];
22 22
23static void pmu_backlight_init_curve(u8 off, u8 min, u8 max) 23static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
@@ -128,7 +128,7 @@ void pmu_backlight_set_sleep(int sleep)
128 128
129 spin_lock_irqsave(&pmu_backlight_lock, flags); 129 spin_lock_irqsave(&pmu_backlight_lock, flags);
130 sleeping = sleep; 130 sleeping = sleep;
131 if (pmac_backlight) { 131 if (pmac_backlight && uses_pmu_bl) {
132 if (sleep) { 132 if (sleep) {
133 struct adb_request req; 133 struct adb_request req;
134 134
@@ -166,6 +166,7 @@ void __init pmu_backlight_init()
166 printk(KERN_ERR "PMU Backlight registration failed\n"); 166 printk(KERN_ERR "PMU Backlight registration failed\n");
167 return; 167 return;
168 } 168 }
169 uses_pmu_bl = 1;
169 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 170 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
170 pmu_backlight_init_curve(0x7F, 0x46, 0x0E); 171 pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
171 172
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index ebec663d5d37..d6365a9f0637 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2528,7 +2528,7 @@ EXPORT_SYMBOL(pmu_wait_complete);
2528EXPORT_SYMBOL(pmu_suspend); 2528EXPORT_SYMBOL(pmu_suspend);
2529EXPORT_SYMBOL(pmu_resume); 2529EXPORT_SYMBOL(pmu_resume);
2530EXPORT_SYMBOL(pmu_unlock); 2530EXPORT_SYMBOL(pmu_unlock);
2531#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32) 2531#if defined(CONFIG_PPC32)
2532EXPORT_SYMBOL(pmu_enable_irled); 2532EXPORT_SYMBOL(pmu_enable_irled);
2533EXPORT_SYMBOL(pmu_battery_count); 2533EXPORT_SYMBOL(pmu_battery_count);
2534EXPORT_SYMBOL(pmu_batteries); 2534EXPORT_SYMBOL(pmu_batteries);
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index a0f0e605d630..fe7b5ec09708 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2366,15 +2366,15 @@ config GELIC_NET
2366 module will be called ps3_gelic. 2366 module will be called ps3_gelic.
2367 2367
2368config GELIC_WIRELESS 2368config GELIC_WIRELESS
2369 bool "PS3 Wireless support" 2369 bool "PS3 Wireless support"
2370 depends on GELIC_NET 2370 depends on GELIC_NET
2371 select WIRELESS_EXT 2371 select WIRELESS_EXT
2372 help 2372 help
2373 This option adds the support for the wireless feature of PS3. 2373 This option adds the support for the wireless feature of PS3.
2374 If you have the wireless-less model of PS3 or have no plan to 2374 If you have the wireless-less model of PS3 or have no plan to
2375 use wireless feature, disabling this option saves memory. As 2375 use wireless feature, disabling this option saves memory. As
2376 the driver automatically distinguishes the models, you can 2376 the driver automatically distinguishes the models, you can
2377 safely enable this option even if you have a wireless-less model. 2377 safely enable this option even if you have a wireless-less model.
2378 2378
2379config GIANFAR 2379config GIANFAR
2380 tristate "Gianfar Ethernet" 2380 tristate "Gianfar Ethernet"
@@ -2519,7 +2519,7 @@ config CHELSIO_T3
2519 2519
2520config EHEA 2520config EHEA
2521 tristate "eHEA Ethernet support" 2521 tristate "eHEA Ethernet support"
2522 depends on IBMEBUS && INET 2522 depends on IBMEBUS && INET && SPARSEMEM
2523 select INET_LRO 2523 select INET_LRO
2524 ---help--- 2524 ---help---
2525 This driver supports the IBM pSeries eHEA ethernet adapter. 2525 This driver supports the IBM pSeries eHEA ethernet adapter.
diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c
index 5136d94923aa..b1448637107f 100644
--- a/drivers/net/ac3200.c
+++ b/drivers/net/ac3200.c
@@ -369,7 +369,7 @@ MODULE_PARM_DESC(mem, "Memory base address(es)");
369MODULE_DESCRIPTION("Ansel AC3200 EISA ethernet driver"); 369MODULE_DESCRIPTION("Ansel AC3200 EISA ethernet driver");
370MODULE_LICENSE("GPL"); 370MODULE_LICENSE("GPL");
371 371
372int __init init_module(void) 372static int __init ac3200_module_init(void)
373{ 373{
374 struct net_device *dev; 374 struct net_device *dev;
375 int this_dev, found = 0; 375 int this_dev, found = 0;
@@ -404,8 +404,7 @@ static void cleanup_card(struct net_device *dev)
404 iounmap(ei_status.mem); 404 iounmap(ei_status.mem);
405} 405}
406 406
407void __exit 407static void __exit ac3200_module_exit(void)
408cleanup_module(void)
409{ 408{
410 int this_dev; 409 int this_dev;
411 410
@@ -418,4 +417,6 @@ cleanup_module(void)
418 } 417 }
419 } 418 }
420} 419}
420module_init(ac3200_module_init);
421module_exit(ac3200_module_exit);
421#endif /* MODULE */ 422#endif /* MODULE */
diff --git a/drivers/net/apne.c b/drivers/net/apne.c
index c12cbdf368b1..47a8275d3962 100644
--- a/drivers/net/apne.c
+++ b/drivers/net/apne.c
@@ -569,7 +569,7 @@ static irqreturn_t apne_interrupt(int irq, void *dev_id)
569#ifdef MODULE 569#ifdef MODULE
570static struct net_device *apne_dev; 570static struct net_device *apne_dev;
571 571
572int __init init_module(void) 572static int __init apne_module_init(void)
573{ 573{
574 apne_dev = apne_probe(-1); 574 apne_dev = apne_probe(-1);
575 if (IS_ERR(apne_dev)) 575 if (IS_ERR(apne_dev))
@@ -577,7 +577,7 @@ int __init init_module(void)
577 return 0; 577 return 0;
578} 578}
579 579
580void __exit cleanup_module(void) 580static void __exit apne_module_exit(void)
581{ 581{
582 unregister_netdev(apne_dev); 582 unregister_netdev(apne_dev);
583 583
@@ -591,7 +591,8 @@ void __exit cleanup_module(void)
591 591
592 free_netdev(apne_dev); 592 free_netdev(apne_dev);
593} 593}
594 594module_init(apne_module_init);
595module_exit(apne_module_exit);
595#endif 596#endif
596 597
597static int init_pcmcia(void) 598static int init_pcmcia(void)
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 6ab2c2d4d673..fef5560bc7a2 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -1252,7 +1252,7 @@ module_param(irq, int, 0);
1252module_param(dma, int, 0); 1252module_param(dma, int, 0);
1253 1253
1254 1254
1255int __init init_module(void) 1255static int __init ltpc_module_init(void)
1256{ 1256{
1257 if(io == 0) 1257 if(io == 0)
1258 printk(KERN_NOTICE 1258 printk(KERN_NOTICE
@@ -1263,6 +1263,7 @@ int __init init_module(void)
1263 return PTR_ERR(dev_ltpc); 1263 return PTR_ERR(dev_ltpc);
1264 return 0; 1264 return 0;
1265} 1265}
1266module_init(ltpc_module_init);
1266#endif 1267#endif
1267 1268
1268static void __exit ltpc_cleanup(void) 1269static void __exit ltpc_cleanup(void)
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index cc4610db6395..02cb8f1c1148 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -80,17 +80,19 @@ void arcnet_cap_init(void)
80 80
81#ifdef MODULE 81#ifdef MODULE
82 82
83int __init init_module(void) 83static int __init capmode_module_init(void)
84{ 84{
85 printk(VERSION); 85 printk(VERSION);
86 arcnet_cap_init(); 86 arcnet_cap_init();
87 return 0; 87 return 0;
88} 88}
89 89
90void cleanup_module(void) 90static void __exit capmode_module_exit(void)
91{ 91{
92 arcnet_unregister_proto(&capmode_proto); 92 arcnet_unregister_proto(&capmode_proto);
93} 93}
94module_init(capmode_module_init);
95module_exit(capmode_module_exit);
94 96
95MODULE_LICENSE("GPL"); 97MODULE_LICENSE("GPL");
96#endif /* MODULE */ 98#endif /* MODULE */
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index b74dbeef8050..13c293b286de 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -336,8 +336,6 @@ struct lance_addr {
336 336
337/***************************** Prototypes *****************************/ 337/***************************** Prototypes *****************************/
338 338
339static int addr_accessible( volatile void *regp, int wordflag, int
340 writeflag );
341static unsigned long lance_probe1( struct net_device *dev, struct lance_addr 339static unsigned long lance_probe1( struct net_device *dev, struct lance_addr
342 *init_rec ); 340 *init_rec );
343static int lance_open( struct net_device *dev ); 341static int lance_open( struct net_device *dev );
@@ -406,7 +404,8 @@ struct net_device * __init atarilance_probe(int unit)
406 404
407/* Derived from hwreg_present() in atari/config.c: */ 405/* Derived from hwreg_present() in atari/config.c: */
408 406
409static int __init addr_accessible( volatile void *regp, int wordflag, int writeflag ) 407static noinline int __init addr_accessible(volatile void *regp, int wordflag,
408 int writeflag)
410{ 409{
411 int ret; 410 int ret;
412 long flags; 411 long flags;
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 36ba6dc96acc..cdf3090a1885 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2782,16 +2782,13 @@ static void __devexit e100_remove(struct pci_dev *pdev)
2782 } 2782 }
2783} 2783}
2784 2784
2785#ifdef CONFIG_PM
2786static int e100_suspend(struct pci_dev *pdev, pm_message_t state) 2785static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2787{ 2786{
2788 struct net_device *netdev = pci_get_drvdata(pdev); 2787 struct net_device *netdev = pci_get_drvdata(pdev);
2789 struct nic *nic = netdev_priv(netdev); 2788 struct nic *nic = netdev_priv(netdev);
2790 2789
2791 if (netif_running(netdev)) 2790 if (netif_running(netdev))
2792 napi_disable(&nic->napi); 2791 e100_down(nic);
2793 del_timer_sync(&nic->watchdog);
2794 netif_carrier_off(nic->netdev);
2795 netif_device_detach(netdev); 2792 netif_device_detach(netdev);
2796 2793
2797 pci_save_state(pdev); 2794 pci_save_state(pdev);
@@ -2804,14 +2801,13 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2804 pci_enable_wake(pdev, PCI_D3cold, 0); 2801 pci_enable_wake(pdev, PCI_D3cold, 0);
2805 } 2802 }
2806 2803
2807 free_irq(pdev->irq, netdev);
2808
2809 pci_disable_device(pdev); 2804 pci_disable_device(pdev);
2810 pci_set_power_state(pdev, PCI_D3hot); 2805 pci_set_power_state(pdev, PCI_D3hot);
2811 2806
2812 return 0; 2807 return 0;
2813} 2808}
2814 2809
2810#ifdef CONFIG_PM
2815static int e100_resume(struct pci_dev *pdev) 2811static int e100_resume(struct pci_dev *pdev)
2816{ 2812{
2817 struct net_device *netdev = pci_get_drvdata(pdev); 2813 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -2832,26 +2828,7 @@ static int e100_resume(struct pci_dev *pdev)
2832 2828
2833static void e100_shutdown(struct pci_dev *pdev) 2829static void e100_shutdown(struct pci_dev *pdev)
2834{ 2830{
2835 struct net_device *netdev = pci_get_drvdata(pdev); 2831 e100_suspend(pdev, PMSG_SUSPEND);
2836 struct nic *nic = netdev_priv(netdev);
2837
2838 if (netif_running(netdev))
2839 napi_disable(&nic->napi);
2840 del_timer_sync(&nic->watchdog);
2841 netif_carrier_off(nic->netdev);
2842
2843 if ((nic->flags & wol_magic) | e100_asf(nic)) {
2844 pci_enable_wake(pdev, PCI_D3hot, 1);
2845 pci_enable_wake(pdev, PCI_D3cold, 1);
2846 } else {
2847 pci_enable_wake(pdev, PCI_D3hot, 0);
2848 pci_enable_wake(pdev, PCI_D3cold, 0);
2849 }
2850
2851 free_irq(pdev->irq, netdev);
2852
2853 pci_disable_device(pdev);
2854 pci_set_power_state(pdev, PCI_D3hot);
2855} 2832}
2856 2833
2857/* ------------------ PCI Error Recovery infrastructure -------------- */ 2834/* ------------------ PCI Error Recovery infrastructure -------------- */
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
index 0809a6a5a286..46a90e9ec563 100644
--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -900,7 +900,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
900 if (RSV_GETBIT(rxstat, RSV_LENCHECKERR)) 900 if (RSV_GETBIT(rxstat, RSV_LENCHECKERR))
901 ndev->stats.rx_frame_errors++; 901 ndev->stats.rx_frame_errors++;
902 } else { 902 } else {
903 skb = dev_alloc_skb(len); 903 skb = dev_alloc_skb(len + NET_IP_ALIGN);
904 if (!skb) { 904 if (!skb) {
905 if (netif_msg_rx_err(priv)) 905 if (netif_msg_rx_err(priv))
906 dev_err(&ndev->dev, 906 dev_err(&ndev->dev,
@@ -908,6 +908,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
908 ndev->stats.rx_dropped++; 908 ndev->stats.rx_dropped++;
909 } else { 909 } else {
910 skb->dev = ndev; 910 skb->dev = ndev;
911 skb_reserve(skb, NET_IP_ALIGN);
911 /* copy the packet from the receive buffer */ 912 /* copy the packet from the receive buffer */
912 enc28j60_mem_read(priv, priv->next_pk_ptr + sizeof(rsv), 913 enc28j60_mem_read(priv, priv->next_pk_ptr + sizeof(rsv),
913 len, skb_put(skb, len)); 914 len, skb_put(skb, len));
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 23d0a4afe0e1..c2095ce531c9 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2133,7 +2133,7 @@ static void ixgbe_watchdog(unsigned long data)
2133 (link_speed == IXGBE_LINK_SPEED_10GB_FULL ? 2133 (link_speed == IXGBE_LINK_SPEED_10GB_FULL ?
2134 "10 Gbps" : 2134 "10 Gbps" :
2135 (link_speed == IXGBE_LINK_SPEED_1GB_FULL ? 2135 (link_speed == IXGBE_LINK_SPEED_1GB_FULL ?
2136 "1 Gpbs" : "unknown speed")), 2136 "1 Gbps" : "unknown speed")),
2137 ((FLOW_RX && FLOW_TX) ? "RX/TX" : 2137 ((FLOW_RX && FLOW_TX) ? "RX/TX" :
2138 (FLOW_RX ? "RX" : 2138 (FLOW_RX ? "RX" :
2139 (FLOW_TX ? "TX" : "None")))); 2139 (FLOW_TX ? "TX" : "None"))));
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index b528ce77c406..771139e283af 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -2104,6 +2104,7 @@ MODULE_LICENSE("GPL");
2104MODULE_AUTHOR( "Rabeeh Khoury, Assaf Hoffman, Matthew Dharm, Manish Lachwani" 2104MODULE_AUTHOR( "Rabeeh Khoury, Assaf Hoffman, Matthew Dharm, Manish Lachwani"
2105 " and Dale Farnsworth"); 2105 " and Dale Farnsworth");
2106MODULE_DESCRIPTION("Ethernet driver for Marvell MV643XX"); 2106MODULE_DESCRIPTION("Ethernet driver for Marvell MV643XX");
2107MODULE_ALIAS("platform:mv643xx_eth");
2107 2108
2108/* 2109/*
2109 * The second part is the low level driver of the gigE ethernet ports. 2110 * The second part is the low level driver of the gigE ethernet ports.
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index e8a63e483a2b..ce95c5d168fe 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -1268,7 +1268,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1268 } 1268 }
1269 } 1269 }
1270 1270
1271 if (interrupts && ei_debug) 1271 if (interrupts && ei_debug > 3)
1272 { 1272 {
1273 handled = 1; 1273 handled = 1;
1274 if (nr_serviced >= MAX_SERVICE) 1274 if (nr_serviced >= MAX_SERVICE)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f4ca0591231d..3ac8529bb92c 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -67,6 +67,7 @@ config REALTEK_PHY
67 67
68config FIXED_PHY 68config FIXED_PHY
69 bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" 69 bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
70 depends on PHYLIB=y
70 ---help--- 71 ---help---
71 Adds the platform "fixed" MDIO Bus to cover the boards that use 72 Adds the platform "fixed" MDIO Bus to cover the boards that use
72 PHYs that are not connected to the real MDIO bus. 73 PHYs that are not connected to the real MDIO bus.
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 7ed632db00d7..d926168bc780 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -37,6 +37,7 @@
37 37
38#define MII_DM9161_SCR 0x10 38#define MII_DM9161_SCR 0x10
39#define MII_DM9161_SCR_INIT 0x0610 39#define MII_DM9161_SCR_INIT 0x0610
40#define MII_DM9161_SCR_RMII 0x0100
40 41
41/* DM9161 Interrupt Register */ 42/* DM9161 Interrupt Register */
42#define MII_DM9161_INTR 0x15 43#define MII_DM9161_INTR 0x15
@@ -103,7 +104,7 @@ static int dm9161_config_aneg(struct phy_device *phydev)
103 104
104static int dm9161_config_init(struct phy_device *phydev) 105static int dm9161_config_init(struct phy_device *phydev)
105{ 106{
106 int err; 107 int err, temp;
107 108
108 /* Isolate the PHY */ 109 /* Isolate the PHY */
109 err = phy_write(phydev, MII_BMCR, BMCR_ISOLATE); 110 err = phy_write(phydev, MII_BMCR, BMCR_ISOLATE);
@@ -111,9 +112,19 @@ static int dm9161_config_init(struct phy_device *phydev)
111 if (err < 0) 112 if (err < 0)
112 return err; 113 return err;
113 114
114 /* Do not bypass the scrambler/descrambler */ 115 switch (phydev->interface) {
115 err = phy_write(phydev, MII_DM9161_SCR, MII_DM9161_SCR_INIT); 116 case PHY_INTERFACE_MODE_MII:
117 temp = MII_DM9161_SCR_INIT;
118 break;
119 case PHY_INTERFACE_MODE_RMII:
120 temp = MII_DM9161_SCR_INIT | MII_DM9161_SCR_RMII;
121 break;
122 default:
123 return -EINVAL;
124 }
116 125
126 /* Do not bypass the scrambler/descrambler */
127 err = phy_write(phydev, MII_DM9161_SCR, temp);
117 if (err < 0) 128 if (err < 0)
118 return err; 129 return err;
119 130
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index 86e5dba079fe..3d10ca050b79 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -302,14 +302,14 @@ pppol2tp_session_find(struct pppol2tp_tunnel *tunnel, u16 session_id)
302 struct pppol2tp_session *session; 302 struct pppol2tp_session *session;
303 struct hlist_node *walk; 303 struct hlist_node *walk;
304 304
305 read_lock(&tunnel->hlist_lock); 305 read_lock_bh(&tunnel->hlist_lock);
306 hlist_for_each_entry(session, walk, session_list, hlist) { 306 hlist_for_each_entry(session, walk, session_list, hlist) {
307 if (session->tunnel_addr.s_session == session_id) { 307 if (session->tunnel_addr.s_session == session_id) {
308 read_unlock(&tunnel->hlist_lock); 308 read_unlock_bh(&tunnel->hlist_lock);
309 return session; 309 return session;
310 } 310 }
311 } 311 }
312 read_unlock(&tunnel->hlist_lock); 312 read_unlock_bh(&tunnel->hlist_lock);
313 313
314 return NULL; 314 return NULL;
315} 315}
@@ -320,14 +320,14 @@ static struct pppol2tp_tunnel *pppol2tp_tunnel_find(u16 tunnel_id)
320{ 320{
321 struct pppol2tp_tunnel *tunnel = NULL; 321 struct pppol2tp_tunnel *tunnel = NULL;
322 322
323 read_lock(&pppol2tp_tunnel_list_lock); 323 read_lock_bh(&pppol2tp_tunnel_list_lock);
324 list_for_each_entry(tunnel, &pppol2tp_tunnel_list, list) { 324 list_for_each_entry(tunnel, &pppol2tp_tunnel_list, list) {
325 if (tunnel->stats.tunnel_id == tunnel_id) { 325 if (tunnel->stats.tunnel_id == tunnel_id) {
326 read_unlock(&pppol2tp_tunnel_list_lock); 326 read_unlock_bh(&pppol2tp_tunnel_list_lock);
327 return tunnel; 327 return tunnel;
328 } 328 }
329 } 329 }
330 read_unlock(&pppol2tp_tunnel_list_lock); 330 read_unlock_bh(&pppol2tp_tunnel_list_lock);
331 331
332 return NULL; 332 return NULL;
333} 333}
@@ -342,10 +342,11 @@ static struct pppol2tp_tunnel *pppol2tp_tunnel_find(u16 tunnel_id)
342static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_buff *skb) 342static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_buff *skb)
343{ 343{
344 struct sk_buff *skbp; 344 struct sk_buff *skbp;
345 struct sk_buff *tmp;
345 u16 ns = PPPOL2TP_SKB_CB(skb)->ns; 346 u16 ns = PPPOL2TP_SKB_CB(skb)->ns;
346 347
347 spin_lock(&session->reorder_q.lock); 348 spin_lock_bh(&session->reorder_q.lock);
348 skb_queue_walk(&session->reorder_q, skbp) { 349 skb_queue_walk_safe(&session->reorder_q, skbp, tmp) {
349 if (PPPOL2TP_SKB_CB(skbp)->ns > ns) { 350 if (PPPOL2TP_SKB_CB(skbp)->ns > ns) {
350 __skb_insert(skb, skbp->prev, skbp, &session->reorder_q); 351 __skb_insert(skb, skbp->prev, skbp, &session->reorder_q);
351 PRINTK(session->debug, PPPOL2TP_MSG_SEQ, KERN_DEBUG, 352 PRINTK(session->debug, PPPOL2TP_MSG_SEQ, KERN_DEBUG,
@@ -360,7 +361,7 @@ static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_
360 __skb_queue_tail(&session->reorder_q, skb); 361 __skb_queue_tail(&session->reorder_q, skb);
361 362
362out: 363out:
363 spin_unlock(&session->reorder_q.lock); 364 spin_unlock_bh(&session->reorder_q.lock);
364} 365}
365 366
366/* Dequeue a single skb. 367/* Dequeue a single skb.
@@ -371,10 +372,9 @@ static void pppol2tp_recv_dequeue_skb(struct pppol2tp_session *session, struct s
371 int length = PPPOL2TP_SKB_CB(skb)->length; 372 int length = PPPOL2TP_SKB_CB(skb)->length;
372 struct sock *session_sock = NULL; 373 struct sock *session_sock = NULL;
373 374
374 /* We're about to requeue the skb, so unlink it and return resources 375 /* We're about to requeue the skb, so return resources
375 * to its current owner (a socket receive buffer). 376 * to its current owner (a socket receive buffer).
376 */ 377 */
377 skb_unlink(skb, &session->reorder_q);
378 skb_orphan(skb); 378 skb_orphan(skb);
379 379
380 tunnel->stats.rx_packets++; 380 tunnel->stats.rx_packets++;
@@ -442,7 +442,7 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
442 * expect to send up next, dequeue it and any other 442 * expect to send up next, dequeue it and any other
443 * in-sequence packets behind it. 443 * in-sequence packets behind it.
444 */ 444 */
445 spin_lock(&session->reorder_q.lock); 445 spin_lock_bh(&session->reorder_q.lock);
446 skb_queue_walk_safe(&session->reorder_q, skb, tmp) { 446 skb_queue_walk_safe(&session->reorder_q, skb, tmp) {
447 if (time_after(jiffies, PPPOL2TP_SKB_CB(skb)->expires)) { 447 if (time_after(jiffies, PPPOL2TP_SKB_CB(skb)->expires)) {
448 session->stats.rx_seq_discards++; 448 session->stats.rx_seq_discards++;
@@ -470,13 +470,18 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
470 goto out; 470 goto out;
471 } 471 }
472 } 472 }
473 spin_unlock(&session->reorder_q.lock); 473 __skb_unlink(skb, &session->reorder_q);
474
475 /* Process the skb. We release the queue lock while we
476 * do so to let other contexts process the queue.
477 */
478 spin_unlock_bh(&session->reorder_q.lock);
474 pppol2tp_recv_dequeue_skb(session, skb); 479 pppol2tp_recv_dequeue_skb(session, skb);
475 spin_lock(&session->reorder_q.lock); 480 spin_lock_bh(&session->reorder_q.lock);
476 } 481 }
477 482
478out: 483out:
479 spin_unlock(&session->reorder_q.lock); 484 spin_unlock_bh(&session->reorder_q.lock);
480} 485}
481 486
482/* Internal receive frame. Do the real work of receiving an L2TP data frame 487/* Internal receive frame. Do the real work of receiving an L2TP data frame
@@ -1059,7 +1064,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
1059 1064
1060 /* Get routing info from the tunnel socket */ 1065 /* Get routing info from the tunnel socket */
1061 dst_release(skb->dst); 1066 dst_release(skb->dst);
1062 skb->dst = sk_dst_get(sk_tun); 1067 skb->dst = dst_clone(__sk_dst_get(sk_tun));
1063 skb_orphan(skb); 1068 skb_orphan(skb);
1064 skb->sk = sk_tun; 1069 skb->sk = sk_tun;
1065 1070
@@ -1107,7 +1112,7 @@ static void pppol2tp_tunnel_closeall(struct pppol2tp_tunnel *tunnel)
1107 PRINTK(tunnel->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO, 1112 PRINTK(tunnel->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO,
1108 "%s: closing all sessions...\n", tunnel->name); 1113 "%s: closing all sessions...\n", tunnel->name);
1109 1114
1110 write_lock(&tunnel->hlist_lock); 1115 write_lock_bh(&tunnel->hlist_lock);
1111 for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) { 1116 for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) {
1112again: 1117again:
1113 hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) { 1118 hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) {
@@ -1129,7 +1134,7 @@ again:
1129 * disappear as we're jumping between locks. 1134 * disappear as we're jumping between locks.
1130 */ 1135 */
1131 sock_hold(sk); 1136 sock_hold(sk);
1132 write_unlock(&tunnel->hlist_lock); 1137 write_unlock_bh(&tunnel->hlist_lock);
1133 lock_sock(sk); 1138 lock_sock(sk);
1134 1139
1135 if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { 1140 if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) {
@@ -1154,11 +1159,11 @@ again:
1154 * list so we are guaranteed to make forward 1159 * list so we are guaranteed to make forward
1155 * progress. 1160 * progress.
1156 */ 1161 */
1157 write_lock(&tunnel->hlist_lock); 1162 write_lock_bh(&tunnel->hlist_lock);
1158 goto again; 1163 goto again;
1159 } 1164 }
1160 } 1165 }
1161 write_unlock(&tunnel->hlist_lock); 1166 write_unlock_bh(&tunnel->hlist_lock);
1162} 1167}
1163 1168
1164/* Really kill the tunnel. 1169/* Really kill the tunnel.
@@ -1167,9 +1172,9 @@ again:
1167static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel) 1172static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel)
1168{ 1173{
1169 /* Remove from socket list */ 1174 /* Remove from socket list */
1170 write_lock(&pppol2tp_tunnel_list_lock); 1175 write_lock_bh(&pppol2tp_tunnel_list_lock);
1171 list_del_init(&tunnel->list); 1176 list_del_init(&tunnel->list);
1172 write_unlock(&pppol2tp_tunnel_list_lock); 1177 write_unlock_bh(&pppol2tp_tunnel_list_lock);
1173 1178
1174 atomic_dec(&pppol2tp_tunnel_count); 1179 atomic_dec(&pppol2tp_tunnel_count);
1175 kfree(tunnel); 1180 kfree(tunnel);
@@ -1245,9 +1250,9 @@ static void pppol2tp_session_destruct(struct sock *sk)
1245 /* Delete the session socket from the 1250 /* Delete the session socket from the
1246 * hash 1251 * hash
1247 */ 1252 */
1248 write_lock(&tunnel->hlist_lock); 1253 write_lock_bh(&tunnel->hlist_lock);
1249 hlist_del_init(&session->hlist); 1254 hlist_del_init(&session->hlist);
1250 write_unlock(&tunnel->hlist_lock); 1255 write_unlock_bh(&tunnel->hlist_lock);
1251 1256
1252 atomic_dec(&pppol2tp_session_count); 1257 atomic_dec(&pppol2tp_session_count);
1253 } 1258 }
@@ -1392,9 +1397,9 @@ static struct sock *pppol2tp_prepare_tunnel_socket(int fd, u16 tunnel_id,
1392 1397
1393 /* Add tunnel to our list */ 1398 /* Add tunnel to our list */
1394 INIT_LIST_HEAD(&tunnel->list); 1399 INIT_LIST_HEAD(&tunnel->list);
1395 write_lock(&pppol2tp_tunnel_list_lock); 1400 write_lock_bh(&pppol2tp_tunnel_list_lock);
1396 list_add(&tunnel->list, &pppol2tp_tunnel_list); 1401 list_add(&tunnel->list, &pppol2tp_tunnel_list);
1397 write_unlock(&pppol2tp_tunnel_list_lock); 1402 write_unlock_bh(&pppol2tp_tunnel_list_lock);
1398 atomic_inc(&pppol2tp_tunnel_count); 1403 atomic_inc(&pppol2tp_tunnel_count);
1399 1404
1400 /* Bump the reference count. The tunnel context is deleted 1405 /* Bump the reference count. The tunnel context is deleted
@@ -1599,11 +1604,11 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
1599 sk->sk_user_data = session; 1604 sk->sk_user_data = session;
1600 1605
1601 /* Add session to the tunnel's hash list */ 1606 /* Add session to the tunnel's hash list */
1602 write_lock(&tunnel->hlist_lock); 1607 write_lock_bh(&tunnel->hlist_lock);
1603 hlist_add_head(&session->hlist, 1608 hlist_add_head(&session->hlist,
1604 pppol2tp_session_id_hash(tunnel, 1609 pppol2tp_session_id_hash(tunnel,
1605 session->tunnel_addr.s_session)); 1610 session->tunnel_addr.s_session));
1606 write_unlock(&tunnel->hlist_lock); 1611 write_unlock_bh(&tunnel->hlist_lock);
1607 1612
1608 atomic_inc(&pppol2tp_session_count); 1613 atomic_inc(&pppol2tp_session_count);
1609 1614
@@ -2205,7 +2210,7 @@ static struct pppol2tp_session *next_session(struct pppol2tp_tunnel *tunnel, str
2205 int next = 0; 2210 int next = 0;
2206 int i; 2211 int i;
2207 2212
2208 read_lock(&tunnel->hlist_lock); 2213 read_lock_bh(&tunnel->hlist_lock);
2209 for (i = 0; i < PPPOL2TP_HASH_SIZE; i++) { 2214 for (i = 0; i < PPPOL2TP_HASH_SIZE; i++) {
2210 hlist_for_each_entry(session, walk, &tunnel->session_hlist[i], hlist) { 2215 hlist_for_each_entry(session, walk, &tunnel->session_hlist[i], hlist) {
2211 if (curr == NULL) { 2216 if (curr == NULL) {
@@ -2223,7 +2228,7 @@ static struct pppol2tp_session *next_session(struct pppol2tp_tunnel *tunnel, str
2223 } 2228 }
2224 } 2229 }
2225out: 2230out:
2226 read_unlock(&tunnel->hlist_lock); 2231 read_unlock_bh(&tunnel->hlist_lock);
2227 if (!found) 2232 if (!found)
2228 session = NULL; 2233 session = NULL;
2229 2234
@@ -2234,13 +2239,13 @@ static struct pppol2tp_tunnel *next_tunnel(struct pppol2tp_tunnel *curr)
2234{ 2239{
2235 struct pppol2tp_tunnel *tunnel = NULL; 2240 struct pppol2tp_tunnel *tunnel = NULL;
2236 2241
2237 read_lock(&pppol2tp_tunnel_list_lock); 2242 read_lock_bh(&pppol2tp_tunnel_list_lock);
2238 if (list_is_last(&curr->list, &pppol2tp_tunnel_list)) { 2243 if (list_is_last(&curr->list, &pppol2tp_tunnel_list)) {
2239 goto out; 2244 goto out;
2240 } 2245 }
2241 tunnel = list_entry(curr->list.next, struct pppol2tp_tunnel, list); 2246 tunnel = list_entry(curr->list.next, struct pppol2tp_tunnel, list);
2242out: 2247out:
2243 read_unlock(&pppol2tp_tunnel_list_lock); 2248 read_unlock_bh(&pppol2tp_tunnel_list_lock);
2244 2249
2245 return tunnel; 2250 return tunnel;
2246} 2251}
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 6179a0a2032c..c72787adeba3 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -1088,7 +1088,7 @@ static int s2io_print_pci_mode(struct s2io_nic *nic)
1088 * '-1' on failure 1088 * '-1' on failure
1089 */ 1089 */
1090 1090
1091int init_tti(struct s2io_nic *nic, int link) 1091static int init_tti(struct s2io_nic *nic, int link)
1092{ 1092{
1093 struct XENA_dev_config __iomem *bar0 = nic->bar0; 1093 struct XENA_dev_config __iomem *bar0 = nic->bar0;
1094 register u64 val64 = 0; 1094 register u64 val64 = 0;
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 77d9dd7ea34f..567c62757e9d 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -910,7 +910,8 @@ static void de_set_media (struct de_private *de)
910 unsigned media = de->media_type; 910 unsigned media = de->media_type;
911 u32 macmode = dr32(MacMode); 911 u32 macmode = dr32(MacMode);
912 912
913 BUG_ON(de_is_running(de)); 913 if (de_is_running(de))
914 printk(KERN_WARNING "%s: chip is running while changing media!\n", de->dev->name);
914 915
915 if (de->de21040) 916 if (de->de21040)
916 dw32(CSR11, FULL_DUPLEX_MAGIC); 917 dw32(CSR11, FULL_DUPLEX_MAGIC);
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 15d5c58e57bc..e59255a155a9 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -751,7 +751,7 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
751} 751}
752 752
753 753
754static __inline void 754static inline void
755send_complete( struct net_local *nl ) 755send_complete( struct net_local *nl )
756{ 756{
757#ifdef CONFIG_SBNI_MULTILINE 757#ifdef CONFIG_SBNI_MULTILINE
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index bdc6a1cc2103..f0ef7081bdeb 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -578,7 +578,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
578 goto done; 578 goto done;
579 } 579 }
580 if (respcmd != CMD_RET(curcmd) && 580 if (respcmd != CMD_RET(curcmd) &&
581 respcmd != CMD_802_11_ASSOCIATE && curcmd != CMD_RET_802_11_ASSOCIATE) { 581 respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
582 lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd); 582 lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd);
583 spin_unlock_irqrestore(&priv->driver_lock, flags); 583 spin_unlock_irqrestore(&priv->driver_lock, flags);
584 ret = -1; 584 ret = -1;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index e808db98f2f5..93ea212fedd5 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2302,9 +2302,9 @@ static void rt61pci_configure_filter(struct ieee80211_hw *hw,
2302 * Apply some rules to the filters: 2302 * Apply some rules to the filters:
2303 * - Some filters imply different filters to be set. 2303 * - Some filters imply different filters to be set.
2304 * - Some things we can't filter out at all. 2304 * - Some things we can't filter out at all.
2305 * - Multicast filter seems to kill broadcast traffic so never use it.
2305 */ 2306 */
2306 if (mc_count) 2307 *total_flags |= FIF_ALLMULTI;
2307 *total_flags |= FIF_ALLMULTI;
2308 if (*total_flags & FIF_OTHER_BSS || 2308 if (*total_flags & FIF_OTHER_BSS ||
2309 *total_flags & FIF_PROMISC_IN_BSS) 2309 *total_flags & FIF_PROMISC_IN_BSS)
2310 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; 2310 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4fac2d414d84..8103d41a1543 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1869,9 +1869,9 @@ static void rt73usb_configure_filter(struct ieee80211_hw *hw,
1869 * Apply some rules to the filters: 1869 * Apply some rules to the filters:
1870 * - Some filters imply different filters to be set. 1870 * - Some filters imply different filters to be set.
1871 * - Some things we can't filter out at all. 1871 * - Some things we can't filter out at all.
1872 * - Multicast filter seems to kill broadcast traffic so never use it.
1872 */ 1873 */
1873 if (mc_count) 1874 *total_flags |= FIF_ALLMULTI;
1874 *total_flags |= FIF_ALLMULTI;
1875 if (*total_flags & FIF_OTHER_BSS || 1875 if (*total_flags & FIF_OTHER_BSS ||
1876 *total_flags & FIF_PROMISC_IN_BSS) 1876 *total_flags & FIF_PROMISC_IN_BSS)
1877 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; 1877 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
@@ -2098,6 +2098,7 @@ static struct usb_device_id rt73usb_device_table[] = {
2098 /* D-Link */ 2098 /* D-Link */
2099 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, 2099 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) },
2100 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, 2100 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) },
2101 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) },
2101 /* Gemtek */ 2102 /* Gemtek */
2102 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, 2103 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) },
2103 /* Gigabyte */ 2104 /* Gigabyte */
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 4065139753b6..37993206ae5d 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -17,7 +17,6 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/pnp.h> 18#include <linux/pnp.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/dmi.h>
21#include <linux/kallsyms.h> 20#include <linux/kallsyms.h>
22#include "base.h" 21#include "base.h"
23 22
@@ -109,42 +108,73 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
109 "pnp: SB audio device quirk - increasing port range\n"); 108 "pnp: SB audio device quirk - increasing port range\n");
110} 109}
111 110
112static void quirk_supermicro_h8dce_system(struct pnp_dev *dev) 111
112#include <linux/pci.h>
113
114static void quirk_system_pci_resources(struct pnp_dev *dev)
113{ 115{
114 int i; 116 struct pci_dev *pdev = NULL;
115 static struct dmi_system_id supermicro_h8dce[] = { 117 resource_size_t pnp_start, pnp_end, pci_start, pci_end;
116 { 118 int i, j;
117 .ident = "Supermicro H8DCE",
118 .matches = {
119 DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"),
120 DMI_MATCH(DMI_PRODUCT_NAME, "H8DCE"),
121 },
122 },
123 { }
124 };
125
126 if (!dmi_check_system(supermicro_h8dce))
127 return;
128 119
129 /* 120 /*
130 * On the Supermicro H8DCE, there's a system device with resources 121 * Some BIOSes have PNP motherboard devices with resources that
131 * that overlap BAR 6 of the built-in SATA PCI adapter. If the PNP 122 * partially overlap PCI BARs. The PNP system driver claims these
132 * system device claims them, the sata_nv driver won't be able to. 123 * motherboard resources, which prevents the normal PCI driver from
133 * More details at: 124 * requesting them later.
134 * https://bugzilla.redhat.com/show_bug.cgi?id=280641 125 *
135 * https://bugzilla.redhat.com/show_bug.cgi?id=313491 126 * This patch disables the PNP resources that conflict with PCI BARs
136 * http://lkml.org/lkml/2008/1/9/449 127 * so they won't be claimed by the PNP system driver.
137 * http://thread.gmane.org/gmane.linux.acpi.devel/27312
138 */ 128 */
139 for (i = 0; i < PNP_MAX_MEM; i++) { 129 for_each_pci_dev(pdev) {
140 if (pnp_mem_valid(dev, i) && pnp_mem_len(dev, i) && 130 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
141 (pnp_mem_start(dev, i) & 0xdfef0000) == 0xdfef0000) { 131 if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM) ||
142 dev_warn(&dev->dev, "disabling 0x%llx-0x%llx to prevent" 132 pci_resource_len(pdev, i) == 0)
143 " conflict with sata_nv PCI device\n", 133 continue;
144 (unsigned long long) pnp_mem_start(dev, i), 134
145 (unsigned long long) (pnp_mem_start(dev, i) + 135 pci_start = pci_resource_start(pdev, i);
146 pnp_mem_len(dev, i) - 1)); 136 pci_end = pci_resource_end(pdev, i);
147 pnp_mem_flags(dev, i) = 0; 137 for (j = 0; j < PNP_MAX_MEM; j++) {
138 if (!pnp_mem_valid(dev, j) ||
139 pnp_mem_len(dev, j) == 0)
140 continue;
141
142 pnp_start = pnp_mem_start(dev, j);
143 pnp_end = pnp_mem_end(dev, j);
144
145 /*
146 * If the PNP region doesn't overlap the PCI
147 * region at all, there's no problem.
148 */
149 if (pnp_end < pci_start || pnp_start > pci_end)
150 continue;
151
152 /*
153 * If the PNP region completely encloses (or is
154 * at least as large as) the PCI region, that's
155 * also OK. For example, this happens when the
156 * PNP device describes a bridge with PCI
157 * behind it.
158 */
159 if (pnp_start <= pci_start &&
160 pnp_end >= pci_end)
161 continue;
162
163 /*
164 * Otherwise, the PNP region overlaps *part* of
165 * the PCI region, and that might prevent a PCI
166 * driver from requesting its resources.
167 */
168 dev_warn(&dev->dev, "mem resource "
169 "(0x%llx-0x%llx) overlaps %s BAR %d "
170 "(0x%llx-0x%llx), disabling\n",
171 (unsigned long long) pnp_start,
172 (unsigned long long) pnp_end,
173 pci_name(pdev), i,
174 (unsigned long long) pci_start,
175 (unsigned long long) pci_end);
176 pnp_mem_flags(dev, j) = 0;
177 }
148 } 178 }
149 } 179 }
150} 180}
@@ -169,8 +199,8 @@ static struct pnp_fixup pnp_fixups[] = {
169 {"CTL0043", quirk_sb16audio_resources}, 199 {"CTL0043", quirk_sb16audio_resources},
170 {"CTL0044", quirk_sb16audio_resources}, 200 {"CTL0044", quirk_sb16audio_resources},
171 {"CTL0045", quirk_sb16audio_resources}, 201 {"CTL0045", quirk_sb16audio_resources},
172 {"PNP0c01", quirk_supermicro_h8dce_system}, 202 {"PNP0c01", quirk_system_pci_resources},
173 {"PNP0c02", quirk_supermicro_h8dce_system}, 203 {"PNP0c02", quirk_system_pci_resources},
174 {""} 204 {""}
175}; 205};
176 206