aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/events/evmisc.c8
-rw-r--r--drivers/acpi/events/evregion.c15
-rw-r--r--drivers/acpi/events/evxface.c6
-rw-r--r--drivers/acpi/executer/excreate.c5
-rw-r--r--drivers/acpi/executer/exsystem.c30
-rw-r--r--drivers/acpi/executer/exutils.c104
-rw-r--r--drivers/acpi/hardware/hwsleep.c5
-rw-r--r--drivers/acpi/ibm_acpi.c19
-rw-r--r--drivers/acpi/namespace/nseval.c11
-rw-r--r--drivers/acpi/namespace/nsinit.c7
-rw-r--r--drivers/acpi/namespace/nsxfeval.c11
-rw-r--r--drivers/acpi/processor_idle.c38
-rw-r--r--drivers/acpi/tables.c57
-rw-r--r--drivers/ata/Kconfig2
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/ata/libata-eh.c8
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c3
-rw-r--r--drivers/ata/sata_inic162x.c4
-rw-r--r--drivers/ata/sata_sil24.c1
-rw-r--r--drivers/char/lcd.c5
-rw-r--r--drivers/char/tty_io.c5
-rw-r--r--drivers/char/vt.c21
-rw-r--r--drivers/char/vt_ioctl.c2
-rw-r--r--drivers/char/watchdog/machzwd.c24
-rw-r--r--drivers/dma/dmaengine.c18
-rw-r--r--drivers/hwmon/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-amd8111.c3
-rw-r--r--drivers/i2c/busses/i2c-i801.c25
-rw-r--r--drivers/i2c/chips/ds1374.c4
-rw-r--r--drivers/ide/Kconfig48
-rw-r--r--drivers/ide/Makefile1
-rw-r--r--drivers/ide/arm/icside.c13
-rw-r--r--drivers/ide/ide-dma.c2
-rw-r--r--drivers/ide/ide.c4
-rw-r--r--drivers/ide/mips/au1xxx-ide.c3
-rw-r--r--drivers/ide/pci/Makefile1
-rw-r--r--drivers/ide/pci/cmd64x.c45
-rw-r--r--drivers/ide/pci/jmicron.c29
-rw-r--r--drivers/ide/pci/scc_pata.c (renamed from drivers/ide/ppc/scc_pata.c)0
-rw-r--r--drivers/ide/setup-pci.c5
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.c5
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c8
-rw-r--r--drivers/infiniband/hw/ipath/ipath_fs.c16
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c4
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c4
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c4
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c6
-rw-r--r--drivers/kvm/kvm_main.c4
-rw-r--r--drivers/kvm/mmu.c52
-rw-r--r--drivers/kvm/vmx.c8
-rw-r--r--drivers/md/linear.c2
-rw-r--r--drivers/net/Kconfig25
-rw-r--r--drivers/net/cxgb3/common.h15
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c90
-rw-r--r--drivers/net/cxgb3/regs.h22
-rw-r--r--drivers/net/cxgb3/t3_hw.c15
-rw-r--r--drivers/net/cxgb3/xgmac.c133
-rw-r--r--drivers/net/irda/irda-usb.c2
-rw-r--r--drivers/net/mv643xx_eth.c14
-rw-r--r--drivers/net/myri10ge/myri10ge.c22
-rw-r--r--drivers/net/pci-skeleton.c4
-rw-r--r--drivers/net/saa9730.c177
-rw-r--r--drivers/net/skge.c110
-rw-r--r--drivers/net/skge.h6
-rw-r--r--drivers/net/ucc_geth.c3
-rw-r--r--drivers/pnp/manager.c6
-rw-r--r--drivers/s390/cio/qdio.c26
-rw-r--r--drivers/s390/crypto/ap_bus.c30
-rw-r--r--drivers/s390/crypto/ap_bus.h1
-rw-r--r--drivers/s390/crypto/zcrypt_api.c12
-rw-r--r--drivers/serial/sh-sci.c11
-rw-r--r--drivers/spi/at25.c2
-rw-r--r--drivers/spi/atmel_spi.c2
-rw-r--r--drivers/spi/spi_bitbang.c26
-rw-r--r--drivers/spi/spi_s3c24xx.c2
-rw-r--r--drivers/usb/class/usblp.c6
-rw-r--r--drivers/usb/misc/berry_charge.c2
-rw-r--r--drivers/usb/net/dm9601.c8
-rw-r--r--drivers/usb/serial/airprime.c4
-rw-r--r--drivers/usb/serial/mos7720.c1
-rw-r--r--drivers/usb/serial/option.c15
-rw-r--r--drivers/usb/serial/usb-serial.c11
-rw-r--r--drivers/usb/storage/unusual_devs.h10
-rw-r--r--drivers/video/Kconfig6
-rw-r--r--drivers/video/s3fb.c3
-rw-r--r--drivers/video/savage/savagefb_driver.c18
-rw-r--r--drivers/video/sstfb.c1
87 files changed, 993 insertions, 556 deletions
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 3a799b9b5df5..cae786ca8600 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -196,11 +196,15 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
196 notify_info->notify.value = (u16) notify_value; 196 notify_info->notify.value = (u16) notify_value;
197 notify_info->notify.handler_obj = handler_obj; 197 notify_info->notify.handler_obj = handler_obj;
198 198
199 acpi_ex_relinquish_interpreter(); 199 acpi_ex_exit_interpreter();
200 200
201 acpi_ev_notify_dispatch(notify_info); 201 acpi_ev_notify_dispatch(notify_info);
202 202
203 acpi_ex_reacquire_interpreter(); 203 status = acpi_ex_enter_interpreter();
204 if (ACPI_FAILURE(status)) {
205 return_ACPI_STATUS(status);
206 }
207
204 } 208 }
205 209
206 if (!handler_obj) { 210 if (!handler_obj) {
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index e99f0c435a47..96b0e8431748 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -291,6 +291,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
291 u32 bit_width, acpi_integer * value) 291 u32 bit_width, acpi_integer * value)
292{ 292{
293 acpi_status status; 293 acpi_status status;
294 acpi_status status2;
294 acpi_adr_space_handler handler; 295 acpi_adr_space_handler handler;
295 acpi_adr_space_setup region_setup; 296 acpi_adr_space_setup region_setup;
296 union acpi_operand_object *handler_desc; 297 union acpi_operand_object *handler_desc;
@@ -344,7 +345,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
344 * setup will potentially execute control methods 345 * setup will potentially execute control methods
345 * (e.g., _REG method for this region) 346 * (e.g., _REG method for this region)
346 */ 347 */
347 acpi_ex_relinquish_interpreter(); 348 acpi_ex_exit_interpreter();
348 349
349 status = region_setup(region_obj, ACPI_REGION_ACTIVATE, 350 status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
350 handler_desc->address_space.context, 351 handler_desc->address_space.context,
@@ -352,7 +353,10 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
352 353
353 /* Re-enter the interpreter */ 354 /* Re-enter the interpreter */
354 355
355 acpi_ex_reacquire_interpreter(); 356 status2 = acpi_ex_enter_interpreter();
357 if (ACPI_FAILURE(status2)) {
358 return_ACPI_STATUS(status2);
359 }
356 360
357 /* Check for failure of the Region Setup */ 361 /* Check for failure of the Region Setup */
358 362
@@ -405,7 +409,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
405 * exit the interpreter because the handler *might* block -- we don't 409 * exit the interpreter because the handler *might* block -- we don't
406 * know what it will do, so we can't hold the lock on the intepreter. 410 * know what it will do, so we can't hold the lock on the intepreter.
407 */ 411 */
408 acpi_ex_relinquish_interpreter(); 412 acpi_ex_exit_interpreter();
409 } 413 }
410 414
411 /* Call the handler */ 415 /* Call the handler */
@@ -426,7 +430,10 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
426 * We just returned from a non-default handler, we must re-enter the 430 * We just returned from a non-default handler, we must re-enter the
427 * interpreter 431 * interpreter
428 */ 432 */
429 acpi_ex_reacquire_interpreter(); 433 status2 = acpi_ex_enter_interpreter();
434 if (ACPI_FAILURE(status2)) {
435 return_ACPI_STATUS(status2);
436 }
430 } 437 }
431 438
432 return_ACPI_STATUS(status); 439 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index 685a103a3587..a3379bafa676 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -768,9 +768,11 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
768 return (AE_BAD_PARAMETER); 768 return (AE_BAD_PARAMETER);
769 } 769 }
770 770
771 /* Must lock interpreter to prevent race conditions */ 771 status = acpi_ex_enter_interpreter();
772 if (ACPI_FAILURE(status)) {
773 return (status);
774 }
772 775
773 acpi_ex_enter_interpreter();
774 status = acpi_ev_acquire_global_lock(timeout); 776 status = acpi_ev_acquire_global_lock(timeout);
775 acpi_ex_exit_interpreter(); 777 acpi_ex_exit_interpreter();
776 778
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index 7c38528a7e83..ae97812681a3 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -583,7 +583,10 @@ acpi_ex_create_method(u8 * aml_start,
583 * Get the sync_level. If method is serialized, a mutex will be 583 * Get the sync_level. If method is serialized, a mutex will be
584 * created for this method when it is parsed. 584 * created for this method when it is parsed.
585 */ 585 */
586 if (method_flags & AML_METHOD_SERIALIZED) { 586 if (acpi_gbl_all_methods_serialized) {
587 obj_desc->method.sync_level = 0;
588 obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
589 } else if (method_flags & AML_METHOD_SERIALIZED) {
587 /* 590 /*
588 * ACPI 1.0: sync_level = 0 591 * ACPI 1.0: sync_level = 0
589 * ACPI 2.0: sync_level = sync_level in method declaration 592 * ACPI 2.0: sync_level = sync_level in method declaration
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 9460baff3032..b2edf620ba89 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -66,6 +66,7 @@ ACPI_MODULE_NAME("exsystem")
66acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) 66acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
67{ 67{
68 acpi_status status; 68 acpi_status status;
69 acpi_status status2;
69 70
70 ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); 71 ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
71 72
@@ -78,7 +79,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
78 79
79 /* We must wait, so unlock the interpreter */ 80 /* We must wait, so unlock the interpreter */
80 81
81 acpi_ex_relinquish_interpreter(); 82 acpi_ex_exit_interpreter();
82 83
83 status = acpi_os_wait_semaphore(semaphore, 1, timeout); 84 status = acpi_os_wait_semaphore(semaphore, 1, timeout);
84 85
@@ -88,7 +89,13 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
88 89
89 /* Reacquire the interpreter */ 90 /* Reacquire the interpreter */
90 91
91 acpi_ex_reacquire_interpreter(); 92 status2 = acpi_ex_enter_interpreter();
93 if (ACPI_FAILURE(status2)) {
94
95 /* Report fatal error, could not acquire interpreter */
96
97 return_ACPI_STATUS(status2);
98 }
92 } 99 }
93 100
94 return_ACPI_STATUS(status); 101 return_ACPI_STATUS(status);
@@ -112,6 +119,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
112acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) 119acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
113{ 120{
114 acpi_status status; 121 acpi_status status;
122 acpi_status status2;
115 123
116 ACPI_FUNCTION_TRACE(ex_system_wait_mutex); 124 ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
117 125
@@ -124,7 +132,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
124 132
125 /* We must wait, so unlock the interpreter */ 133 /* We must wait, so unlock the interpreter */
126 134
127 acpi_ex_relinquish_interpreter(); 135 acpi_ex_exit_interpreter();
128 136
129 status = acpi_os_acquire_mutex(mutex, timeout); 137 status = acpi_os_acquire_mutex(mutex, timeout);
130 138
@@ -134,7 +142,13 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
134 142
135 /* Reacquire the interpreter */ 143 /* Reacquire the interpreter */
136 144
137 acpi_ex_reacquire_interpreter(); 145 status2 = acpi_ex_enter_interpreter();
146 if (ACPI_FAILURE(status2)) {
147
148 /* Report fatal error, could not acquire interpreter */
149
150 return_ACPI_STATUS(status2);
151 }
138 } 152 }
139 153
140 return_ACPI_STATUS(status); 154 return_ACPI_STATUS(status);
@@ -195,18 +209,20 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
195 209
196acpi_status acpi_ex_system_do_suspend(acpi_integer how_long) 210acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
197{ 211{
212 acpi_status status;
213
198 ACPI_FUNCTION_ENTRY(); 214 ACPI_FUNCTION_ENTRY();
199 215
200 /* Since this thread will sleep, we must release the interpreter */ 216 /* Since this thread will sleep, we must release the interpreter */
201 217
202 acpi_ex_relinquish_interpreter(); 218 acpi_ex_exit_interpreter();
203 219
204 acpi_os_sleep(how_long); 220 acpi_os_sleep(how_long);
205 221
206 /* And now we must get the interpreter again */ 222 /* And now we must get the interpreter again */
207 223
208 acpi_ex_reacquire_interpreter(); 224 status = acpi_ex_enter_interpreter();
209 return (AE_OK); 225 return (status);
210} 226}
211 227
212/******************************************************************************* 228/*******************************************************************************
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 6b0aeccbb69b..aea461f3a48c 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -76,15 +76,14 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base);
76 * 76 *
77 * PARAMETERS: None 77 * PARAMETERS: None
78 * 78 *
79 * RETURN: None 79 * RETURN: Status
80 * 80 *
81 * DESCRIPTION: Enter the interpreter execution region. Failure to enter 81 * DESCRIPTION: Enter the interpreter execution region. Failure to enter
82 * the interpreter region is a fatal system error. Used in 82 * the interpreter region is a fatal system error
83 * conjunction with exit_interpreter.
84 * 83 *
85 ******************************************************************************/ 84 ******************************************************************************/
86 85
87void acpi_ex_enter_interpreter(void) 86acpi_status acpi_ex_enter_interpreter(void)
88{ 87{
89 acpi_status status; 88 acpi_status status;
90 89
@@ -92,42 +91,10 @@ void acpi_ex_enter_interpreter(void)
92 91
93 status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); 92 status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
94 if (ACPI_FAILURE(status)) { 93 if (ACPI_FAILURE(status)) {
95 ACPI_ERROR((AE_INFO, 94 ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex"));
96 "Could not acquire AML Interpreter mutex"));
97 } 95 }
98 96
99 return_VOID; 97 return_ACPI_STATUS(status);
100}
101
102/*******************************************************************************
103 *
104 * FUNCTION: acpi_ex_reacquire_interpreter
105 *
106 * PARAMETERS: None
107 *
108 * RETURN: None
109 *
110 * DESCRIPTION: Reacquire the interpreter execution region from within the
111 * interpreter code. Failure to enter the interpreter region is a
112 * fatal system error. Used in conjuction with
113 * relinquish_interpreter
114 *
115 ******************************************************************************/
116
117void acpi_ex_reacquire_interpreter(void)
118{
119 ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
120
121 /*
122 * If the global serialized flag is set, do not release the interpreter,
123 * since it was not actually released by acpi_ex_relinquish_interpreter.
124 * This forces the interpreter to be single threaded.
125 */
126 if (!acpi_gbl_all_methods_serialized) {
127 acpi_ex_enter_interpreter();
128 }
129
130 return_VOID;
131} 98}
132 99
133/******************************************************************************* 100/*******************************************************************************
@@ -138,9 +105,17 @@ void acpi_ex_reacquire_interpreter(void)
138 * 105 *
139 * RETURN: None 106 * RETURN: None
140 * 107 *
141 * DESCRIPTION: Exit the interpreter execution region. This is the top level 108 * DESCRIPTION: Exit the interpreter execution region
142 * routine used to exit the interpreter when all processing has 109 *
143 * been completed. 110 * Cases where the interpreter is unlocked:
111 * 1) Completion of the execution of a control method
112 * 2) Method blocked on a Sleep() AML opcode
113 * 3) Method blocked on an Acquire() AML opcode
114 * 4) Method blocked on a Wait() AML opcode
115 * 5) Method blocked to acquire the global lock
116 * 6) Method blocked to execute a serialized control method that is
117 * already executing
118 * 7) About to invoke a user-installed opregion handler
144 * 119 *
145 ******************************************************************************/ 120 ******************************************************************************/
146 121
@@ -152,46 +127,7 @@ void acpi_ex_exit_interpreter(void)
152 127
153 status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); 128 status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
154 if (ACPI_FAILURE(status)) { 129 if (ACPI_FAILURE(status)) {
155 ACPI_ERROR((AE_INFO, 130 ACPI_ERROR((AE_INFO, "Could not release interpreter mutex"));
156 "Could not release AML Interpreter mutex"));
157 }
158
159 return_VOID;
160}
161
162/*******************************************************************************
163 *
164 * FUNCTION: acpi_ex_relinquish_interpreter
165 *
166 * PARAMETERS: None
167 *
168 * RETURN: None
169 *
170 * DESCRIPTION: Exit the interpreter execution region, from within the
171 * interpreter - before attempting an operation that will possibly
172 * block the running thread.
173 *
174 * Cases where the interpreter is unlocked internally
175 * 1) Method to be blocked on a Sleep() AML opcode
176 * 2) Method to be blocked on an Acquire() AML opcode
177 * 3) Method to be blocked on a Wait() AML opcode
178 * 4) Method to be blocked to acquire the global lock
179 * 5) Method to be blocked waiting to execute a serialized control method
180 * that is currently executing
181 * 6) About to invoke a user-installed opregion handler
182 *
183 ******************************************************************************/
184
185void acpi_ex_relinquish_interpreter(void)
186{
187 ACPI_FUNCTION_TRACE(ex_relinquish_interpreter);
188
189 /*
190 * If the global serialized flag is set, do not release the interpreter.
191 * This forces the interpreter to be single threaded.
192 */
193 if (!acpi_gbl_all_methods_serialized) {
194 acpi_ex_exit_interpreter();
195 } 131 }
196 132
197 return_VOID; 133 return_VOID;
@@ -205,8 +141,8 @@ void acpi_ex_relinquish_interpreter(void)
205 * 141 *
206 * RETURN: none 142 * RETURN: none
207 * 143 *
208 * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is 144 * DESCRIPTION: Truncate a number to 32-bits if the currently executing method
209 * 32-bit, as determined by the revision of the DSDT. 145 * belongs to a 32-bit ACPI table.
210 * 146 *
211 ******************************************************************************/ 147 ******************************************************************************/
212 148
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index 8fa93125fd4c..c84b1faba28c 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -300,6 +300,11 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
300 /* 300 /*
301 * 2) Enable all wakeup GPEs 301 * 2) Enable all wakeup GPEs
302 */ 302 */
303 status = acpi_hw_disable_all_gpes();
304 if (ACPI_FAILURE(status)) {
305 return_ACPI_STATUS(status);
306 }
307
303 acpi_gbl_system_awake_and_running = FALSE; 308 acpi_gbl_system_awake_and_running = FALSE;
304 309
305 status = acpi_hw_enable_all_wakeup_gpes(); 310 status = acpi_hw_enable_all_wakeup_gpes();
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 36901362fd24..dc1096608f43 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -2507,7 +2507,7 @@ static int __init setup_notify(struct ibm_struct *ibm)
2507 ret = acpi_bus_get_device(*ibm->handle, &ibm->device); 2507 ret = acpi_bus_get_device(*ibm->handle, &ibm->device);
2508 if (ret < 0) { 2508 if (ret < 0) {
2509 printk(IBM_ERR "%s device not present\n", ibm->name); 2509 printk(IBM_ERR "%s device not present\n", ibm->name);
2510 return 0; 2510 return -ENODEV;
2511 } 2511 }
2512 2512
2513 acpi_driver_data(ibm->device) = ibm; 2513 acpi_driver_data(ibm->device) = ibm;
@@ -2516,8 +2516,13 @@ static int __init setup_notify(struct ibm_struct *ibm)
2516 status = acpi_install_notify_handler(*ibm->handle, ibm->type, 2516 status = acpi_install_notify_handler(*ibm->handle, ibm->type,
2517 dispatch_notify, ibm); 2517 dispatch_notify, ibm);
2518 if (ACPI_FAILURE(status)) { 2518 if (ACPI_FAILURE(status)) {
2519 printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n", 2519 if (status == AE_ALREADY_EXISTS) {
2520 ibm->name, status); 2520 printk(IBM_NOTICE "another device driver is already handling %s events\n",
2521 ibm->name);
2522 } else {
2523 printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n",
2524 ibm->name, status);
2525 }
2521 return -ENODEV; 2526 return -ENODEV;
2522 } 2527 }
2523 ibm->notify_installed = 1; 2528 ibm->notify_installed = 1;
@@ -2553,6 +2558,8 @@ static int __init register_driver(struct ibm_struct *ibm)
2553 return ret; 2558 return ret;
2554} 2559}
2555 2560
2561static void ibm_exit(struct ibm_struct *ibm);
2562
2556static int __init ibm_init(struct ibm_struct *ibm) 2563static int __init ibm_init(struct ibm_struct *ibm)
2557{ 2564{
2558 int ret; 2565 int ret;
@@ -2594,6 +2601,12 @@ static int __init ibm_init(struct ibm_struct *ibm)
2594 2601
2595 if (ibm->notify) { 2602 if (ibm->notify) {
2596 ret = setup_notify(ibm); 2603 ret = setup_notify(ibm);
2604 if (ret == -ENODEV) {
2605 printk(IBM_NOTICE "disabling subdriver %s\n",
2606 ibm->name);
2607 ibm_exit(ibm);
2608 return 0;
2609 }
2597 if (ret < 0) 2610 if (ret < 0)
2598 return ret; 2611 return ret;
2599 } 2612 }
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c
index aa6370c67ec1..26fd0dd6953d 100644
--- a/drivers/acpi/namespace/nseval.c
+++ b/drivers/acpi/namespace/nseval.c
@@ -154,7 +154,11 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
154 * Execute the method via the interpreter. The interpreter is locked 154 * Execute the method via the interpreter. The interpreter is locked
155 * here before calling into the AML parser 155 * here before calling into the AML parser
156 */ 156 */
157 acpi_ex_enter_interpreter(); 157 status = acpi_ex_enter_interpreter();
158 if (ACPI_FAILURE(status)) {
159 return_ACPI_STATUS(status);
160 }
161
158 status = acpi_ps_execute_method(info); 162 status = acpi_ps_execute_method(info);
159 acpi_ex_exit_interpreter(); 163 acpi_ex_exit_interpreter();
160 } else { 164 } else {
@@ -178,7 +182,10 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
178 * resolution, we must lock it because we could access an opregion. 182 * resolution, we must lock it because we could access an opregion.
179 * The opregion access code assumes that the interpreter is locked. 183 * The opregion access code assumes that the interpreter is locked.
180 */ 184 */
181 acpi_ex_enter_interpreter(); 185 status = acpi_ex_enter_interpreter();
186 if (ACPI_FAILURE(status)) {
187 return_ACPI_STATUS(status);
188 }
182 189
183 /* Function has a strange interface */ 190 /* Function has a strange interface */
184 191
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c
index 33db2241044e..c4ab615f77fe 100644
--- a/drivers/acpi/namespace/nsinit.c
+++ b/drivers/acpi/namespace/nsinit.c
@@ -214,7 +214,7 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
214 u32 level, void *context, void **return_value) 214 u32 level, void *context, void **return_value)
215{ 215{
216 acpi_object_type type; 216 acpi_object_type type;
217 acpi_status status = AE_OK; 217 acpi_status status;
218 struct acpi_init_walk_info *info = 218 struct acpi_init_walk_info *info =
219 (struct acpi_init_walk_info *)context; 219 (struct acpi_init_walk_info *)context;
220 struct acpi_namespace_node *node = 220 struct acpi_namespace_node *node =
@@ -268,7 +268,10 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
268 /* 268 /*
269 * Must lock the interpreter before executing AML code 269 * Must lock the interpreter before executing AML code
270 */ 270 */
271 acpi_ex_enter_interpreter(); 271 status = acpi_ex_enter_interpreter();
272 if (ACPI_FAILURE(status)) {
273 return (status);
274 }
272 275
273 /* 276 /*
274 * Each of these types can contain executable AML code within the 277 * Each of these types can contain executable AML code within the
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index 7ac6ace50059..8904d0fae6a2 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -170,6 +170,7 @@ acpi_evaluate_object(acpi_handle handle,
170 struct acpi_buffer *return_buffer) 170 struct acpi_buffer *return_buffer)
171{ 171{
172 acpi_status status; 172 acpi_status status;
173 acpi_status status2;
173 struct acpi_evaluate_info *info; 174 struct acpi_evaluate_info *info;
174 acpi_size buffer_space_needed; 175 acpi_size buffer_space_needed;
175 u32 i; 176 u32 i;
@@ -328,12 +329,14 @@ acpi_evaluate_object(acpi_handle handle,
328 * Delete the internal return object. NOTE: Interpreter must be 329 * Delete the internal return object. NOTE: Interpreter must be
329 * locked to avoid race condition. 330 * locked to avoid race condition.
330 */ 331 */
331 acpi_ex_enter_interpreter(); 332 status2 = acpi_ex_enter_interpreter();
333 if (ACPI_SUCCESS(status2)) {
332 334
333 /* Remove one reference on the return object (should delete it) */ 335 /* Remove one reference on the return object (should delete it) */
334 336
335 acpi_ut_remove_reference(info->return_object); 337 acpi_ut_remove_reference(info->return_object);
336 acpi_ex_exit_interpreter(); 338 acpi_ex_exit_interpreter();
339 }
337 } 340 }
338 341
339 cleanup: 342 cleanup:
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 60773005b8af..562124ed785e 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -89,6 +89,12 @@ module_param(nocst, uint, 0000);
89static unsigned int bm_history __read_mostly = 89static unsigned int bm_history __read_mostly =
90 (HZ >= 800 ? 0xFFFFFFFF : ((1U << (HZ / 25)) - 1)); 90 (HZ >= 800 ? 0xFFFFFFFF : ((1U << (HZ / 25)) - 1));
91module_param(bm_history, uint, 0644); 91module_param(bm_history, uint, 0644);
92
93static unsigned use_ipi = 2;
94module_param(use_ipi, uint, 0644);
95MODULE_PARM_DESC(use_ipi, "IPI (vs. LAPIC) irqs for not waking up from C2/C3"
96 " machines. 0=apic, 1=ipi, 2=auto\n");
97
92/* -------------------------------------------------------------------------- 98/* --------------------------------------------------------------------------
93 Power Management 99 Power Management
94 -------------------------------------------------------------------------- */ 100 -------------------------------------------------------------------------- */
@@ -260,9 +266,8 @@ static void acpi_cstate_enter(struct acpi_processor_cx *cstate)
260 266
261/* 267/*
262 * Some BIOS implementations switch to C3 in the published C2 state. 268 * Some BIOS implementations switch to C3 in the published C2 state.
263 * This seems to be a common problem on AMD boxen, but other vendors 269 * This seems to be a common problem on AMD boxen and Intel Dothan/Banias
264 * are affected too. We pick the most conservative approach: we assume 270 * Pentium M machines.
265 * that the local APIC stops in both C2 and C3.
266 */ 271 */
267static void acpi_timer_check_state(int state, struct acpi_processor *pr, 272static void acpi_timer_check_state(int state, struct acpi_processor *pr,
268 struct acpi_processor_cx *cx) 273 struct acpi_processor_cx *cx)
@@ -276,8 +281,17 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
276 if (pwr->timer_broadcast_on_state < state) 281 if (pwr->timer_broadcast_on_state < state)
277 return; 282 return;
278 283
279 if (cx->type >= ACPI_STATE_C2) 284 if (cx->type >= ACPI_STATE_C2) {
280 pr->power.timer_broadcast_on_state = state; 285 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
286 pr->power.timer_broadcast_on_state = state;
287 else if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
288 boot_cpu_data.x86 == 6) &&
289 (boot_cpu_data.x86_model == 13 ||
290 boot_cpu_data.x86_model == 9))
291 {
292 pr->power.timer_broadcast_on_state = state;
293 }
294 }
281} 295}
282 296
283static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) 297static void acpi_propagate_timer_broadcast(struct acpi_processor *pr)
@@ -292,10 +306,16 @@ static void acpi_propagate_timer_broadcast(struct acpi_processor *pr)
292#else 306#else
293 cpumask_t mask = cpumask_of_cpu(pr->id); 307 cpumask_t mask = cpumask_of_cpu(pr->id);
294 308
295 if (pr->power.timer_broadcast_on_state < INT_MAX) 309 if (use_ipi == 0)
296 on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1); 310 on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1);
297 else 311 else if (use_ipi == 1)
298 on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1); 312 on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1);
313 else {
314 if (pr->power.timer_broadcast_on_state < INT_MAX)
315 on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1);
316 else
317 on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1);
318 }
299#endif 319#endif
300} 320}
301 321
@@ -1013,13 +1033,13 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
1013 1033
1014 case ACPI_STATE_C2: 1034 case ACPI_STATE_C2:
1015 acpi_processor_power_verify_c2(cx); 1035 acpi_processor_power_verify_c2(cx);
1016 if (cx->valid) 1036 if (cx->valid && use_ipi != 0 && use_ipi != 1)
1017 acpi_timer_check_state(i, pr, cx); 1037 acpi_timer_check_state(i, pr, cx);
1018 break; 1038 break;
1019 1039
1020 case ACPI_STATE_C3: 1040 case ACPI_STATE_C3:
1021 acpi_processor_power_verify_c3(pr, cx); 1041 acpi_processor_power_verify_c3(pr, cx);
1022 if (cx->valid) 1042 if (cx->valid && use_ipi != 0 && use_ipi != 1)
1023 acpi_timer_check_state(i, pr, cx); 1043 acpi_timer_check_state(i, pr, cx);
1024 break; 1044 break;
1025 } 1045 }
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 849e2c361804..96792a6cc164 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -42,7 +42,9 @@ static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
42 42
43static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; 43static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata;
44 44
45void acpi_table_print_madt_entry(struct acpi_subtable_header * header) 45static int acpi_apic_instance __initdata = 2;
46
47void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
46{ 48{
47 if (!header) 49 if (!header)
48 return; 50 return;
@@ -183,8 +185,10 @@ acpi_table_parse_entries(char *id,
183 if (!handler) 185 if (!handler)
184 return -EINVAL; 186 return -EINVAL;
185 187
186 /* Locate the table (if exists). There should only be one. */ 188 if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
187 acpi_get_table(id, 0, &table_header); 189 acpi_get_table(id, acpi_apic_instance, &table_header);
190 else
191 acpi_get_table(id, 0, &table_header);
188 192
189 if (!table_header) { 193 if (!table_header) {
190 printk(KERN_WARNING PREFIX "%4.4s not present\n", id); 194 printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
@@ -237,10 +241,15 @@ acpi_table_parse_madt(enum acpi_madt_type id,
237int __init acpi_table_parse(char *id, acpi_table_handler handler) 241int __init acpi_table_parse(char *id, acpi_table_handler handler)
238{ 242{
239 struct acpi_table_header *table = NULL; 243 struct acpi_table_header *table = NULL;
244
240 if (!handler) 245 if (!handler)
241 return -EINVAL; 246 return -EINVAL;
242 247
243 acpi_get_table(id, 0, &table); 248 if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
249 acpi_get_table(id, acpi_apic_instance, &table);
250 else
251 acpi_get_table(id, 0, &table);
252
244 if (table) { 253 if (table) {
245 handler(table); 254 handler(table);
246 return 0; 255 return 0;
@@ -248,6 +257,31 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
248 return 1; 257 return 1;
249} 258}
250 259
260/*
261 * The BIOS is supposed to supply a single APIC/MADT,
262 * but some report two. Provide a knob to use either.
263 * (don't you wish instance 0 and 1 were not the same?)
264 */
265static void __init check_multiple_madt(void)
266{
267 struct acpi_table_header *table = NULL;
268
269 acpi_get_table(ACPI_SIG_MADT, 2, &table);
270 if (table) {
271 printk(KERN_WARNING PREFIX
272 "BIOS bug: multiple APIC/MADT found,"
273 " using %d\n", acpi_apic_instance);
274 printk(KERN_WARNING PREFIX
275 "If \"acpi_apic_instance=%d\" works better, "
276 "notify linux-acpi@vger.kernel.org\n",
277 acpi_apic_instance ? 0 : 2);
278
279 } else
280 acpi_apic_instance = 0;
281
282 return;
283}
284
251/* 285/*
252 * acpi_table_init() 286 * acpi_table_init()
253 * 287 *
@@ -257,9 +291,22 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
257 * result: sdt_entry[] is initialized 291 * result: sdt_entry[] is initialized
258 */ 292 */
259 293
260
261int __init acpi_table_init(void) 294int __init acpi_table_init(void)
262{ 295{
263 acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); 296 acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
297 check_multiple_madt();
298 return 0;
299}
300
301static int __init acpi_parse_apic_instance(char *str)
302{
303
304 acpi_apic_instance = simple_strtoul(str, NULL, 0);
305
306 printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n",
307 acpi_apic_instance);
308
264 return 0; 309 return 0;
265} 310}
311
312early_param("acpi_apic_instance", acpi_parse_apic_instance);
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index d16b5b0c8b76..7bdbe5a914d0 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -564,7 +564,7 @@ config PATA_IXP4XX_CF
564 564
565config PATA_SCC 565config PATA_SCC
566 tristate "Toshiba's Cell Reference Set IDE support" 566 tristate "Toshiba's Cell Reference Set IDE support"
567 depends on PCI && PPC_IBM_CELL_BLADE 567 depends on PCI && PPC_CELLEB
568 help 568 help
569 This option enables support for the built-in IDE controller on 569 This option enables support for the built-in IDE controller on
570 Toshiba Cell Reference Board. 570 Toshiba Cell Reference Board.
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3c1f8830ac8b..bf327d473ce9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -826,7 +826,7 @@ static u64 ata_id_n_sectors(const u16 *id)
826/** 826/**
827 * ata_id_to_dma_mode - Identify DMA mode from id block 827 * ata_id_to_dma_mode - Identify DMA mode from id block
828 * @dev: device to identify 828 * @dev: device to identify
829 * @mode: mode to assume if we cannot tell 829 * @unknown: mode to assume if we cannot tell
830 * 830 *
831 * Set up the timing values for the device based upon the identify 831 * Set up the timing values for the device based upon the identify
832 * reported values for the DMA mode. This function is used by drivers 832 * reported values for the DMA mode. This function is used by drivers
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7349c3dbf774..361953a50203 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1625,8 +1625,14 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1625 rc = prereset(ap); 1625 rc = prereset(ap);
1626 if (rc) { 1626 if (rc) {
1627 if (rc == -ENOENT) { 1627 if (rc == -ENOENT) {
1628 ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n"); 1628 ata_port_printk(ap, KERN_DEBUG,
1629 "port disabled. ignoring.\n");
1629 ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; 1630 ap->eh_context.i.action &= ~ATA_EH_RESET_MASK;
1631
1632 for (i = 0; i < ATA_MAX_DEVICES; i++)
1633 classes[i] = ATA_DEV_NONE;
1634
1635 rc = 0;
1630 } else 1636 } else
1631 ata_port_printk(ap, KERN_ERR, 1637 ata_port_printk(ap, KERN_ERR,
1632 "prereset failed (errno=%d)\n", rc); 1638 "prereset failed (errno=%d)\n", rc);
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 9a0523b5c947..c6f0e1927551 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -193,7 +193,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
193 193
194 irq = platform_get_irq(pdev, 0); 194 irq = platform_get_irq(pdev, 0);
195 if (irq) 195 if (irq)
196 set_irq_type(irq, IRQT_HIGH); 196 set_irq_type(irq, IRQT_RISING);
197 197
198 /* Setup expansion bus chip selects */ 198 /* Setup expansion bus chip selects */
199 *data->cs0_cfg = data->cs0_bits; 199 *data->cs0_cfg = data->cs0_bits;
@@ -232,7 +232,6 @@ static __devexit int ixp4xx_pata_remove(struct platform_device *dev)
232 struct ata_host *host = platform_get_drvdata(dev); 232 struct ata_host *host = platform_get_drvdata(dev);
233 233
234 ata_host_detach(host); 234 ata_host_detach(host);
235 platform_set_drvdata(dev, NULL);
236 235
237 return 0; 236 return 0;
238} 237}
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 3193a603d1a1..1e21688bfcf2 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -672,10 +672,6 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
672 if (rc) 672 if (rc)
673 return rc; 673 return rc;
674 674
675 rc = pci_request_regions(pdev, DRV_NAME);
676 if (rc)
677 return rc;
678
679 rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); 675 rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME);
680 if (rc) 676 if (rc)
681 return rc; 677 return rc;
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 75d961599651..5614df8c1ce2 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -346,6 +346,7 @@ static const struct pci_device_id sil24_pci_tbl[] = {
346 { PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 }, 346 { PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 },
347 { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 }, 347 { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 },
348 { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 }, 348 { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 },
349 { PCI_VDEVICE(CMD, 0x0242), BID_SIL3132 },
349 { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 }, 350 { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 },
350 { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 }, 351 { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 },
351 352
diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c
index 5f4fdcf7c96e..1f0962616ee5 100644
--- a/drivers/char/lcd.c
+++ b/drivers/char/lcd.c
@@ -11,9 +11,6 @@
11 * March 2001: Ported from 2.0.34 by Liam Davies 11 * March 2001: Ported from 2.0.34 by Liam Davies
12 * 12 *
13 */ 13 */
14
15#define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */
16
17#include <linux/types.h> 14#include <linux/types.h>
18#include <linux/errno.h> 15#include <linux/errno.h>
19#include <linux/miscdevice.h> 16#include <linux/miscdevice.h>
@@ -32,8 +29,6 @@
32 29
33#include "lcd.h" 30#include "lcd.h"
34 31
35static DEFINE_SPINLOCK(lcd_lock);
36
37static int lcd_ioctl(struct inode *inode, struct file *file, 32static int lcd_ioctl(struct inode *inode, struct file *file,
38 unsigned int cmd, unsigned long arg); 33 unsigned int cmd, unsigned long arg);
39 34
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index e45326856680..7a32df594907 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1376,6 +1376,8 @@ static void do_tty_hangup(struct work_struct *work)
1376 read_unlock(&tasklist_lock); 1376 read_unlock(&tasklist_lock);
1377 1377
1378 tty->flags = 0; 1378 tty->flags = 0;
1379 put_pid(tty->session);
1380 put_pid(tty->pgrp);
1379 tty->session = NULL; 1381 tty->session = NULL;
1380 tty->pgrp = NULL; 1382 tty->pgrp = NULL;
1381 tty->ctrl_status = 0; 1383 tty->ctrl_status = 0;
@@ -3841,6 +3843,9 @@ static struct pid *__proc_set_tty(struct task_struct *tsk, struct tty_struct *tt
3841{ 3843{
3842 struct pid *old_pgrp; 3844 struct pid *old_pgrp;
3843 if (tty) { 3845 if (tty) {
3846 /* We should not have a session or pgrp to here but.... */
3847 put_pid(tty->session);
3848 put_pid(tty->pgrp);
3844 tty->session = get_pid(task_session(tsk)); 3849 tty->session = get_pid(task_session(tsk));
3845 tty->pgrp = get_pid(task_pgrp(tsk)); 3850 tty->pgrp = get_pid(task_pgrp(tsk));
3846 } 3851 }
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index c3f8e383933b..1bbb45b937fd 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -724,6 +724,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
724 return -ENOMEM; 724 return -ENOMEM;
725 memset(vc, 0, sizeof(*vc)); 725 memset(vc, 0, sizeof(*vc));
726 vc_cons[currcons].d = vc; 726 vc_cons[currcons].d = vc;
727 INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
727 visual_init(vc, currcons, 1); 728 visual_init(vc, currcons, 1);
728 if (!*vc->vc_uni_pagedir_loc) 729 if (!*vc->vc_uni_pagedir_loc)
729 con_set_default_unimap(vc); 730 con_set_default_unimap(vc);
@@ -2185,10 +2186,28 @@ static void console_callback(struct work_struct *ignored)
2185 release_console_sem(); 2186 release_console_sem();
2186} 2187}
2187 2188
2188void set_console(int nr) 2189int set_console(int nr)
2189{ 2190{
2191 struct vc_data *vc = vc_cons[fg_console].d;
2192
2193 if (!vc_cons_allocated(nr) || vt_dont_switch ||
2194 (vc->vt_mode.mode == VT_AUTO && vc->vc_mode == KD_GRAPHICS)) {
2195
2196 /*
2197 * Console switch will fail in console_callback() or
2198 * change_console() so there is no point scheduling
2199 * the callback
2200 *
2201 * Existing set_console() users don't check the return
2202 * value so this shouldn't break anything
2203 */
2204 return -EINVAL;
2205 }
2206
2190 want_console = nr; 2207 want_console = nr;
2191 schedule_console_callback(); 2208 schedule_console_callback();
2209
2210 return 0;
2192} 2211}
2193 2212
2194struct tty_driver *console_driver; 2213struct tty_driver *console_driver;
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 3a5d301e783b..1fa2da8f4fbe 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -34,7 +34,7 @@
34#include <linux/kbd_diacr.h> 34#include <linux/kbd_diacr.h>
35#include <linux/selection.h> 35#include <linux/selection.h>
36 36
37static char vt_dont_switch; 37char vt_dont_switch;
38extern struct tty_driver *console_driver; 38extern struct tty_driver *console_driver;
39 39
40#define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) 40#define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count)
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
index 81fb3dec180f..76c7fa37fa6c 100644
--- a/drivers/char/watchdog/machzwd.c
+++ b/drivers/char/watchdog/machzwd.c
@@ -314,21 +314,21 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
314{ 314{
315 void __user *argp = (void __user *)arg; 315 void __user *argp = (void __user *)arg;
316 int __user *p = argp; 316 int __user *p = argp;
317 switch(cmd){ 317 switch (cmd) {
318 case WDIOC_GETSUPPORT: 318 case WDIOC_GETSUPPORT:
319 if (copy_to_user(argp, &zf_info, sizeof(zf_info))) 319 if (copy_to_user(argp, &zf_info, sizeof(zf_info)))
320 return -EFAULT; 320 return -EFAULT;
321 break; 321 break;
322 322
323 case WDIOC_GETSTATUS: 323 case WDIOC_GETSTATUS:
324 return put_user(0, p); 324 return put_user(0, p);
325 325
326 case WDIOC_KEEPALIVE: 326 case WDIOC_KEEPALIVE:
327 zf_ping(NULL); 327 zf_ping(0);
328 break; 328 break;
329 329
330 default: 330 default:
331 return -ENOTTY; 331 return -ENOTTY;
332 } 332 }
333 333
334 return 0; 334 return 0;
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 15278044295c..322ee2984e3d 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -176,6 +176,7 @@ void dma_chan_cleanup(struct kref *kref)
176 chan->client = NULL; 176 chan->client = NULL;
177 kref_put(&chan->device->refcount, dma_async_device_cleanup); 177 kref_put(&chan->device->refcount, dma_async_device_cleanup);
178} 178}
179EXPORT_SYMBOL(dma_chan_cleanup);
179 180
180static void dma_chan_free_rcu(struct rcu_head *rcu) 181static void dma_chan_free_rcu(struct rcu_head *rcu)
181{ 182{
@@ -261,6 +262,7 @@ struct dma_client *dma_async_client_register(dma_event_callback event_callback)
261 262
262 return client; 263 return client;
263} 264}
265EXPORT_SYMBOL(dma_async_client_register);
264 266
265/** 267/**
266 * dma_async_client_unregister - unregister a client and free the &dma_client 268 * dma_async_client_unregister - unregister a client and free the &dma_client
@@ -287,6 +289,7 @@ void dma_async_client_unregister(struct dma_client *client)
287 kfree(client); 289 kfree(client);
288 dma_chans_rebalance(); 290 dma_chans_rebalance();
289} 291}
292EXPORT_SYMBOL(dma_async_client_unregister);
290 293
291/** 294/**
292 * dma_async_client_chan_request - request DMA channels 295 * dma_async_client_chan_request - request DMA channels
@@ -304,6 +307,7 @@ void dma_async_client_chan_request(struct dma_client *client,
304 client->chans_desired = number; 307 client->chans_desired = number;
305 dma_chans_rebalance(); 308 dma_chans_rebalance();
306} 309}
310EXPORT_SYMBOL(dma_async_client_chan_request);
307 311
308/** 312/**
309 * dma_async_device_register - registers DMA devices found 313 * dma_async_device_register - registers DMA devices found
@@ -346,6 +350,7 @@ int dma_async_device_register(struct dma_device *device)
346 350
347 return 0; 351 return 0;
348} 352}
353EXPORT_SYMBOL(dma_async_device_register);
349 354
350/** 355/**
351 * dma_async_device_cleanup - function called when all references are released 356 * dma_async_device_cleanup - function called when all references are released
@@ -390,23 +395,12 @@ void dma_async_device_unregister(struct dma_device *device)
390 kref_put(&device->refcount, dma_async_device_cleanup); 395 kref_put(&device->refcount, dma_async_device_cleanup);
391 wait_for_completion(&device->done); 396 wait_for_completion(&device->done);
392} 397}
398EXPORT_SYMBOL(dma_async_device_unregister);
393 399
394static int __init dma_bus_init(void) 400static int __init dma_bus_init(void)
395{ 401{
396 mutex_init(&dma_list_mutex); 402 mutex_init(&dma_list_mutex);
397 return class_register(&dma_devclass); 403 return class_register(&dma_devclass);
398} 404}
399
400subsys_initcall(dma_bus_init); 405subsys_initcall(dma_bus_init);
401 406
402EXPORT_SYMBOL(dma_async_client_register);
403EXPORT_SYMBOL(dma_async_client_unregister);
404EXPORT_SYMBOL(dma_async_client_chan_request);
405EXPORT_SYMBOL(dma_async_memcpy_buf_to_buf);
406EXPORT_SYMBOL(dma_async_memcpy_buf_to_pg);
407EXPORT_SYMBOL(dma_async_memcpy_pg_to_pg);
408EXPORT_SYMBOL(dma_async_memcpy_complete);
409EXPORT_SYMBOL(dma_async_memcpy_issue_pending);
410EXPORT_SYMBOL(dma_async_device_register);
411EXPORT_SYMBOL(dma_async_device_unregister);
412EXPORT_SYMBOL(dma_chan_cleanup);
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index c3d4856fb618..6d105a1d41b1 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -527,6 +527,7 @@ config SENSORS_W83792D
527config SENSORS_W83793 527config SENSORS_W83793
528 tristate "Winbond W83793" 528 tristate "Winbond W83793"
529 depends on HWMON && I2C && EXPERIMENTAL 529 depends on HWMON && I2C && EXPERIMENTAL
530 select HWMON_VID
530 help 531 help
531 If you say yes here you get support for the Winbond W83793 532 If you say yes here you get support for the Winbond W83793
532 hardware monitoring chip. 533 hardware monitoring chip.
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
index e15f9e37716a..0c70f8293341 100644
--- a/drivers/i2c/busses/i2c-amd8111.c
+++ b/drivers/i2c/busses/i2c-amd8111.c
@@ -254,7 +254,8 @@ static s32 amd8111_access(struct i2c_adapter * adap, u16 addr,
254 break; 254 break;
255 255
256 case I2C_SMBUS_BLOCK_PROC_CALL: 256 case I2C_SMBUS_BLOCK_PROC_CALL:
257 len = min_t(u8, data->block[0], 31); 257 len = min_t(u8, data->block[0],
258 I2C_SMBUS_BLOCK_MAX - 1);
258 amd_ec_write(smbus, AMD_SMB_CMD, command); 259 amd_ec_write(smbus, AMD_SMB_CMD, command);
259 amd_ec_write(smbus, AMD_SMB_BCNT, len); 260 amd_ec_write(smbus, AMD_SMB_BCNT, len);
260 for (i = 0; i < len; i++) 261 for (i = 0; i < len; i++)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 6569a36985bd..a320e7d82c1f 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -97,6 +97,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
97 int command, int hwpec); 97 int command, int hwpec);
98 98
99static unsigned long i801_smba; 99static unsigned long i801_smba;
100static unsigned char i801_original_hstcfg;
100static struct pci_driver i801_driver; 101static struct pci_driver i801_driver;
101static struct pci_dev *I801_dev; 102static struct pci_dev *I801_dev;
102static int isich4; 103static int isich4;
@@ -510,6 +511,7 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id
510 } 511 }
511 512
512 pci_read_config_byte(I801_dev, SMBHSTCFG, &temp); 513 pci_read_config_byte(I801_dev, SMBHSTCFG, &temp);
514 i801_original_hstcfg = temp;
513 temp &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ 515 temp &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */
514 if (!(temp & SMBHSTCFG_HST_EN)) { 516 if (!(temp & SMBHSTCFG_HST_EN)) {
515 dev_info(&dev->dev, "Enabling SMBus device\n"); 517 dev_info(&dev->dev, "Enabling SMBus device\n");
@@ -543,6 +545,7 @@ exit:
543static void __devexit i801_remove(struct pci_dev *dev) 545static void __devexit i801_remove(struct pci_dev *dev)
544{ 546{
545 i2c_del_adapter(&i801_adapter); 547 i2c_del_adapter(&i801_adapter);
548 pci_write_config_byte(I801_dev, SMBHSTCFG, i801_original_hstcfg);
546 pci_release_region(dev, SMBBAR); 549 pci_release_region(dev, SMBBAR);
547 /* 550 /*
548 * do not call pci_disable_device(dev) since it can cause hard hangs on 551 * do not call pci_disable_device(dev) since it can cause hard hangs on
@@ -550,11 +553,33 @@ static void __devexit i801_remove(struct pci_dev *dev)
550 */ 553 */
551} 554}
552 555
556#ifdef CONFIG_PM
557static int i801_suspend(struct pci_dev *dev, pm_message_t mesg)
558{
559 pci_save_state(dev);
560 pci_write_config_byte(dev, SMBHSTCFG, i801_original_hstcfg);
561 pci_set_power_state(dev, pci_choose_state(dev, mesg));
562 return 0;
563}
564
565static int i801_resume(struct pci_dev *dev)
566{
567 pci_set_power_state(dev, PCI_D0);
568 pci_restore_state(dev);
569 return pci_enable_device(dev);
570}
571#else
572#define i801_suspend NULL
573#define i801_resume NULL
574#endif
575
553static struct pci_driver i801_driver = { 576static struct pci_driver i801_driver = {
554 .name = "i801_smbus", 577 .name = "i801_smbus",
555 .id_table = i801_ids, 578 .id_table = i801_ids,
556 .probe = i801_probe, 579 .probe = i801_probe,
557 .remove = __devexit_p(i801_remove), 580 .remove = __devexit_p(i801_remove),
581 .suspend = i801_suspend,
582 .resume = i801_resume,
558}; 583};
559 584
560static int __init i2c_i801_init(void) 585static int __init i2c_i801_init(void)
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c
index 15edf40828b4..8a2ff0c114d9 100644
--- a/drivers/i2c/chips/ds1374.c
+++ b/drivers/i2c/chips/ds1374.c
@@ -207,6 +207,10 @@ static int ds1374_probe(struct i2c_adapter *adap, int addr, int kind)
207 client->driver = &ds1374_driver; 207 client->driver = &ds1374_driver;
208 208
209 ds1374_workqueue = create_singlethread_workqueue("ds1374"); 209 ds1374_workqueue = create_singlethread_workqueue("ds1374");
210 if (!ds1374_workqueue) {
211 kfree(client);
212 return -ENOMEM; /* most expected reason */
213 }
210 214
211 if ((rc = i2c_attach_client(client)) != 0) { 215 if ((rc = i2c_attach_client(client)) != 0) {
212 kfree(client); 216 kfree(client);
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 3f76987d818a..8f1fd017679b 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -434,24 +434,8 @@ config BLK_DEV_IDEDMA_FORCED
434 434
435 Generally say N here. 435 Generally say N here.
436 436
437config IDEDMA_PCI_AUTO
438 bool "Use PCI DMA by default when available"
439 ---help---
440 Prior to kernel version 2.1.112, Linux used to automatically use
441 DMA for IDE drives and chipsets which support it. Due to concerns
442 about a couple of cases where buggy hardware may have caused damage,
443 the default is now to NOT use DMA automatically. To revert to the
444 previous behaviour, say Y to this question.
445
446 If you suspect your hardware is at all flakey, say N here.
447 Do NOT email the IDE kernel people regarding this issue!
448
449 It is normally safe to answer Y to this question unless your
450 motherboard uses a VIA VP2 chipset, in which case you should say N.
451
452config IDEDMA_ONLYDISK 437config IDEDMA_ONLYDISK
453 bool "Enable DMA only for disks " 438 bool "Enable DMA only for disks "
454 depends on IDEDMA_PCI_AUTO
455 help 439 help
456 This is used if you know your ATAPI Devices are going to fail DMA 440 This is used if you know your ATAPI Devices are going to fail DMA
457 Transfers. 441 Transfers.
@@ -769,6 +753,14 @@ config BLK_DEV_TC86C001
769 help 753 help
770 This driver adds support for Toshiba TC86C001 GOKU-S chip. 754 This driver adds support for Toshiba TC86C001 GOKU-S chip.
771 755
756config BLK_DEV_CELLEB
757 tristate "Toshiba's Cell Reference Set IDE support"
758 depends on PPC_CELLEB
759 help
760 This driver provides support for the built-in IDE controller on
761 Toshiba Cell Reference Board.
762 If unsure, say Y.
763
772endif 764endif
773 765
774config BLK_DEV_IDE_PMAC 766config BLK_DEV_IDE_PMAC
@@ -800,14 +792,6 @@ config BLK_DEV_IDEDMA_PMAC
800 to transfer data to and from memory. Saying Y is safe and improves 792 to transfer data to and from memory. Saying Y is safe and improves
801 performance. 793 performance.
802 794
803config BLK_DEV_IDE_CELLEB
804 bool "Toshiba's Cell Reference Set IDE support"
805 depends on PPC_CELLEB && IDE=y
806 help
807 This driver provides support for the built-in IDE controller on
808 Toshiba Cell Reference Board.
809 If unsure, say Y.
810
811config BLK_DEV_IDE_SWARM 795config BLK_DEV_IDE_SWARM
812 tristate "IDE for Sibyte evaluation boards" 796 tristate "IDE for Sibyte evaluation boards"
813 depends on SIBYTE_SB1xxx_SOC 797 depends on SIBYTE_SB1xxx_SOC
@@ -851,19 +835,6 @@ config BLK_DEV_IDEDMA_ICS
851 Say Y here if you want to add DMA (Direct Memory Access) support to 835 Say Y here if you want to add DMA (Direct Memory Access) support to
852 the ICS IDE driver. 836 the ICS IDE driver.
853 837
854config IDEDMA_ICS_AUTO
855 bool "Use ICS DMA by default"
856 depends on BLK_DEV_IDEDMA_ICS
857 help
858 Prior to kernel version 2.1.112, Linux used to automatically use
859 DMA for IDE drives and chipsets which support it. Due to concerns
860 about a couple of cases where buggy hardware may have caused damage,
861 the default is now to NOT use DMA automatically. To revert to the
862 previous behaviour, say Y to this question.
863
864 If you suspect your hardware is at all flakey, say N here.
865 Do NOT email the IDE kernel people regarding this issue!
866
867config BLK_DEV_IDE_RAPIDE 838config BLK_DEV_IDE_RAPIDE
868 tristate "RapIDE interface support" 839 tristate "RapIDE interface support"
869 depends on ARM && ARCH_ACORN 840 depends on ARM && ARCH_ACORN
@@ -1086,9 +1057,6 @@ config IDEDMA_IVB
1086 1057
1087 It is normally safe to answer Y; however, the default is N. 1058 It is normally safe to answer Y; however, the default is N.
1088 1059
1089config IDEDMA_AUTO
1090 def_bool IDEDMA_PCI_AUTO || IDEDMA_ICS_AUTO
1091
1092endif 1060endif
1093 1061
1094config BLK_DEV_HD_ONLY 1062config BLK_DEV_HD_ONLY
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile
index 28feedfbd21d..d9f029e8ff74 100644
--- a/drivers/ide/Makefile
+++ b/drivers/ide/Makefile
@@ -37,7 +37,6 @@ ide-core-$(CONFIG_BLK_DEV_Q40IDE) += legacy/q40ide.o
37# built-in only drivers from ppc/ 37# built-in only drivers from ppc/
38ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ppc/mpc8xx.o 38ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ppc/mpc8xx.o
39ide-core-$(CONFIG_BLK_DEV_IDE_PMAC) += ppc/pmac.o 39ide-core-$(CONFIG_BLK_DEV_IDE_PMAC) += ppc/pmac.o
40ide-core-$(CONFIG_BLK_DEV_IDE_CELLEB) += ppc/scc_pata.o
41 40
42# built-in only drivers from h8300/ 41# built-in only drivers from h8300/
43ide-core-$(CONFIG_H8300) += h8300/ide-h8300.o 42ide-core-$(CONFIG_H8300) += h8300/ide-h8300.o
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 40e5c66b81ce..e2953fc1fafb 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -196,11 +196,6 @@ static void icside_maskproc(ide_drive_t *drive, int mask)
196} 196}
197 197
198#ifdef CONFIG_BLK_DEV_IDEDMA_ICS 198#ifdef CONFIG_BLK_DEV_IDEDMA_ICS
199
200#ifndef CONFIG_IDEDMA_ICS_AUTO
201#warning CONFIG_IDEDMA_ICS_AUTO=n support is obsolete, and will be removed soon.
202#endif
203
204/* 199/*
205 * SG-DMA support. 200 * SG-DMA support.
206 * 201 *
@@ -474,12 +469,6 @@ static int icside_dma_lostirq(ide_drive_t *drive)
474 469
475static void icside_dma_init(ide_hwif_t *hwif) 470static void icside_dma_init(ide_hwif_t *hwif)
476{ 471{
477 int autodma = 0;
478
479#ifdef CONFIG_IDEDMA_ICS_AUTO
480 autodma = 1;
481#endif
482
483 printk(" %s: SG-DMA", hwif->name); 472 printk(" %s: SG-DMA", hwif->name);
484 473
485 hwif->atapi_dma = 1; 474 hwif->atapi_dma = 1;
@@ -489,7 +478,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
489 hwif->dmatable_cpu = NULL; 478 hwif->dmatable_cpu = NULL;
490 hwif->dmatable_dma = 0; 479 hwif->dmatable_dma = 0;
491 hwif->speedproc = icside_set_speed; 480 hwif->speedproc = icside_set_speed;
492 hwif->autodma = autodma; 481 hwif->autodma = 1;
493 482
494 hwif->ide_dma_check = icside_dma_check; 483 hwif->ide_dma_check = icside_dma_check;
495 hwif->dma_host_off = icside_dma_host_off; 484 hwif->dma_host_off = icside_dma_host_off;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 08e7cd043bcc..fd213088b06b 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -767,7 +767,7 @@ int ide_set_dma(ide_drive_t *drive)
767 switch(rc) { 767 switch(rc) {
768 case -1: /* DMA needs to be disabled */ 768 case -1: /* DMA needs to be disabled */
769 hwif->dma_off_quietly(drive); 769 hwif->dma_off_quietly(drive);
770 return 0; 770 return -1;
771 case 0: /* DMA needs to be enabled */ 771 case 0: /* DMA needs to be enabled */
772 return hwif->ide_dma_on(drive); 772 return hwif->ide_dma_on(drive);
773 case 1: /* DMA setting cannot be changed */ 773 case 1: /* DMA setting cannot be changed */
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index dfbd74458522..695610f0e3e4 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -177,11 +177,7 @@ DECLARE_MUTEX(ide_cfg_sem);
177static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ 177static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
178#endif 178#endif
179 179
180#ifdef CONFIG_IDEDMA_AUTO
181int noautodma = 0; 180int noautodma = 0;
182#else
183int noautodma = 1;
184#endif
185 181
186EXPORT_SYMBOL(noautodma); 182EXPORT_SYMBOL(noautodma);
187 183
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index b2dc028dc8ca..d54d9fe92a7d 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -639,6 +639,7 @@ static int au_ide_probe(struct device *dev)
639 _auide_hwif *ahwif = &auide_hwif; 639 _auide_hwif *ahwif = &auide_hwif;
640 ide_hwif_t *hwif; 640 ide_hwif_t *hwif;
641 struct resource *res; 641 struct resource *res;
642 hw_regs_t *hw;
642 int ret = 0; 643 int ret = 0;
643 644
644#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 645#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
@@ -681,7 +682,7 @@ static int au_ide_probe(struct device *dev)
681 /* FIXME: This might possibly break PCMCIA IDE devices */ 682 /* FIXME: This might possibly break PCMCIA IDE devices */
682 683
683 hwif = &ide_hwifs[pdev->id]; 684 hwif = &ide_hwifs[pdev->id];
684 hw_regs_t *hw = &hwif->hw; 685 hw = &hwif->hw;
685 hwif->irq = hw->irq = ahwif->irq; 686 hwif->irq = hw->irq = ahwif->irq;
686 hwif->chipset = ide_au1xxx; 687 hwif->chipset = ide_au1xxx;
687 688
diff --git a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile
index 6591ff4753cb..95d1ea8f1f14 100644
--- a/drivers/ide/pci/Makefile
+++ b/drivers/ide/pci/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o
3obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o 3obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o
4obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o 4obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o
5obj-$(CONFIG_BLK_DEV_ATIIXP) += atiixp.o 5obj-$(CONFIG_BLK_DEV_ATIIXP) += atiixp.o
6obj-$(CONFIG_BLK_DEV_CELLEB) += scc_pata.o
6obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o 7obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o
7obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o 8obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o
8obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o 9obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index b0d4825c56a9..561197f7b5bb 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -1,6 +1,6 @@
1/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 1/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16
2 * 2 *
3 * linux/drivers/ide/pci/cmd64x.c Version 1.41 Feb 3, 2007 3 * linux/drivers/ide/pci/cmd64x.c Version 1.42 Feb 8, 2007
4 * 4 *
5 * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. 5 * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
6 * Note, this driver is not used at all on other systems because 6 * Note, this driver is not used at all on other systems because
@@ -189,6 +189,11 @@ static int cmd64x_get_info (char *buffer, char **addr, off_t offset, int count)
189 189
190#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ 190#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */
191 191
192static u8 quantize_timing(int timing, int quant)
193{
194 return (timing + quant - 1) / quant;
195}
196
192/* 197/*
193 * This routine writes the prepared setup/active/recovery counts 198 * This routine writes the prepared setup/active/recovery counts
194 * for a drive into the cmd646 chipset registers to active them. 199 * for a drive into the cmd646 chipset registers to active them.
@@ -268,47 +273,37 @@ static void program_drive_counts (ide_drive_t *drive, int setup_count, int activ
268 */ 273 */
269static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) 274static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted)
270{ 275{
271 int setup_time, active_time, recovery_time; 276 int setup_time, active_time, cycle_time;
272 int clock_time, pio_mode, cycle_time; 277 u8 cycle_count, setup_count, active_count, recovery_count;
273 u8 recovery_count2, cycle_count; 278 u8 pio_mode;
274 int setup_count, active_count, recovery_count; 279 int clock_time = 1000 / system_bus_clock();
275 int bus_speed = system_bus_clock(); 280 ide_pio_data_t pio;
276 ide_pio_data_t d;
277 281
278 pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &d); 282 pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &pio);
279 cycle_time = d.cycle_time; 283 cycle_time = pio.cycle_time;
280 284
281 /*
282 * I copied all this complicated stuff from cmd640.c and made a few
283 * minor changes. For now I am just going to pray that it is correct.
284 */
285 setup_time = ide_pio_timings[pio_mode].setup_time; 285 setup_time = ide_pio_timings[pio_mode].setup_time;
286 active_time = ide_pio_timings[pio_mode].active_time; 286 active_time = ide_pio_timings[pio_mode].active_time;
287 recovery_time = cycle_time - (setup_time + active_time);
288 clock_time = 1000 / bus_speed;
289 cycle_count = (cycle_time + clock_time - 1) / clock_time;
290
291 setup_count = (setup_time + clock_time - 1) / clock_time;
292 287
293 active_count = (active_time + clock_time - 1) / clock_time; 288 setup_count = quantize_timing( setup_time, clock_time);
289 cycle_count = quantize_timing( cycle_time, clock_time);
290 active_count = quantize_timing(active_time, clock_time);
294 291
295 recovery_count = (recovery_time + clock_time - 1) / clock_time; 292 recovery_count = cycle_count - active_count;
296 recovery_count2 = cycle_count - (setup_count + active_count); 293 /* program_drive_counts() takes care of zero recovery cycles */
297 if (recovery_count2 > recovery_count)
298 recovery_count = recovery_count2;
299 if (recovery_count > 16) { 294 if (recovery_count > 16) {
300 active_count += recovery_count - 16; 295 active_count += recovery_count - 16;
301 recovery_count = 16; 296 recovery_count = 16;
302 } 297 }
303 if (active_count > 16) 298 if (active_count > 16)
304 active_count = 16; /* maximum allowed by cmd646 */ 299 active_count = 16; /* maximum allowed by cmd64x */
305 300
306 program_drive_counts (drive, setup_count, active_count, recovery_count); 301 program_drive_counts (drive, setup_count, active_count, recovery_count);
307 302
308 cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " 303 cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, "
309 "clocks=%d/%d/%d\n", 304 "clocks=%d/%d/%d\n",
310 drive->name, mode_wanted, pio_mode, cycle_time, 305 drive->name, mode_wanted, pio_mode, cycle_time,
311 d.overridden ? " (overriding vendor mode)" : "", 306 pio.overridden ? " (overriding vendor mode)" : "",
312 setup_count, active_count, recovery_count); 307 setup_count, active_count, recovery_count);
313 308
314 return pio_mode; 309 return pio_mode;
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 53f25500c22b..be4fc96c29e0 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -240,12 +240,31 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi
240 return 0; 240 return 0;
241} 241}
242 242
243/* If libata is configured, jmicron PCI quirk will configure it such
244 * that the SATA ports are in AHCI function while the PATA ports are
245 * in a separate IDE function. In such cases, match device class and
246 * attach only to IDE. If libata isn't configured, keep the old
247 * behavior for backward compatibility.
248 */
249#if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE)
250#define JMB_CLASS PCI_CLASS_STORAGE_IDE << 8
251#define JMB_CLASS_MASK 0xffff00
252#else
253#define JMB_CLASS 0
254#define JMB_CLASS_MASK 0
255#endif
256
243static struct pci_device_id jmicron_pci_tbl[] = { 257static struct pci_device_id jmicron_pci_tbl[] = {
244 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 258 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,
245 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 259 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 0},
246 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 260 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,
247 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 261 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 1},
248 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 262 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,
263 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 2},
264 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,
265 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 3},
266 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,
267 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 4},
249 { 0, }, 268 { 0, },
250}; 269};
251 270
diff --git a/drivers/ide/ppc/scc_pata.c b/drivers/ide/pci/scc_pata.c
index f84bf791f72e..f84bf791f72e 100644
--- a/drivers/ide/ppc/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index a52c80fe7d3e..118fb3205ca8 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -505,11 +505,6 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi
505 } 505 }
506 } 506 }
507} 507}
508
509#ifndef CONFIG_IDEDMA_PCI_AUTO
510#warning CONFIG_IDEDMA_PCI_AUTO=n support is obsolete, and will be removed soon.
511#endif
512
513#endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/ 508#endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/
514 509
515/** 510/**
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index f2774ae906bf..24e0df04f7db 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -545,11 +545,14 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr,
545 php = to_iwch_pd(pd); 545 php = to_iwch_pd(pd);
546 if (mr_rereg_mask & IB_MR_REREG_ACCESS) 546 if (mr_rereg_mask & IB_MR_REREG_ACCESS)
547 mh.attr.perms = iwch_ib_to_tpt_access(acc); 547 mh.attr.perms = iwch_ib_to_tpt_access(acc);
548 if (mr_rereg_mask & IB_MR_REREG_TRANS) 548 if (mr_rereg_mask & IB_MR_REREG_TRANS) {
549 ret = build_phys_page_list(buffer_list, num_phys_buf, 549 ret = build_phys_page_list(buffer_list, num_phys_buf,
550 iova_start, 550 iova_start,
551 &total_size, &npages, 551 &total_size, &npages,
552 &shift, &page_list); 552 &shift, &page_list);
553 if (ret)
554 return ret;
555 }
553 556
554 ret = iwch_reregister_mem(rhp, php, &mh, shift, page_list, npages); 557 ret = iwch_reregister_mem(rhp, php, &mh, shift, page_list, npages);
555 kfree(page_list); 558 kfree(page_list);
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 20f36bf8b2b6..f284be1c9166 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -66,7 +66,9 @@
66static void queue_comp_task(struct ehca_cq *__cq); 66static void queue_comp_task(struct ehca_cq *__cq);
67 67
68static struct ehca_comp_pool* pool; 68static struct ehca_comp_pool* pool;
69#ifdef CONFIG_HOTPLUG_CPU
69static struct notifier_block comp_pool_callback_nb; 70static struct notifier_block comp_pool_callback_nb;
71#endif
70 72
71static inline void comp_event_callback(struct ehca_cq *cq) 73static inline void comp_event_callback(struct ehca_cq *cq)
72{ 74{
@@ -733,6 +735,7 @@ static void take_over_work(struct ehca_comp_pool *pool,
733 735
734} 736}
735 737
738#ifdef CONFIG_HOTPLUG_CPU
736static int comp_pool_callback(struct notifier_block *nfb, 739static int comp_pool_callback(struct notifier_block *nfb,
737 unsigned long action, 740 unsigned long action,
738 void *hcpu) 741 void *hcpu)
@@ -775,6 +778,7 @@ static int comp_pool_callback(struct notifier_block *nfb,
775 778
776 return NOTIFY_OK; 779 return NOTIFY_OK;
777} 780}
781#endif
778 782
779int ehca_create_comp_pool(void) 783int ehca_create_comp_pool(void)
780{ 784{
@@ -805,9 +809,11 @@ int ehca_create_comp_pool(void)
805 } 809 }
806 } 810 }
807 811
812#ifdef CONFIG_HOTPLUG_CPU
808 comp_pool_callback_nb.notifier_call = comp_pool_callback; 813 comp_pool_callback_nb.notifier_call = comp_pool_callback;
809 comp_pool_callback_nb.priority =0; 814 comp_pool_callback_nb.priority =0;
810 register_cpu_notifier(&comp_pool_callback_nb); 815 register_cpu_notifier(&comp_pool_callback_nb);
816#endif
811 817
812 printk(KERN_INFO "eHCA scaling code enabled\n"); 818 printk(KERN_INFO "eHCA scaling code enabled\n");
813 819
@@ -821,7 +827,9 @@ void ehca_destroy_comp_pool(void)
821 if (!ehca_scaling_code) 827 if (!ehca_scaling_code)
822 return; 828 return;
823 829
830#ifdef CONFIG_HOTPLUG_CPU
824 unregister_cpu_notifier(&comp_pool_callback_nb); 831 unregister_cpu_notifier(&comp_pool_callback_nb);
832#endif
825 833
826 for (i = 0; i < NR_CPUS; i++) { 834 for (i = 0; i < NR_CPUS; i++) {
827 if (cpu_online(i)) 835 if (cpu_online(i))
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index 5b40a846ff95..ed55979bfd34 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -451,12 +451,18 @@ bail:
451 return ret; 451 return ret;
452} 452}
453 453
454static void remove_file(struct dentry *parent, char *name) 454static int remove_file(struct dentry *parent, char *name)
455{ 455{
456 struct dentry *tmp; 456 struct dentry *tmp;
457 int ret;
457 458
458 tmp = lookup_one_len(name, parent, strlen(name)); 459 tmp = lookup_one_len(name, parent, strlen(name));
459 460
461 if (IS_ERR(tmp)) {
462 ret = PTR_ERR(tmp);
463 goto bail;
464 }
465
460 spin_lock(&dcache_lock); 466 spin_lock(&dcache_lock);
461 spin_lock(&tmp->d_lock); 467 spin_lock(&tmp->d_lock);
462 if (!(d_unhashed(tmp) && tmp->d_inode)) { 468 if (!(d_unhashed(tmp) && tmp->d_inode)) {
@@ -469,6 +475,14 @@ static void remove_file(struct dentry *parent, char *name)
469 spin_unlock(&tmp->d_lock); 475 spin_unlock(&tmp->d_lock);
470 spin_unlock(&dcache_lock); 476 spin_unlock(&dcache_lock);
471 } 477 }
478
479 ret = 0;
480bail:
481 /*
482 * We don't expect clients to care about the return value, but
483 * it's there if they need it.
484 */
485 return ret;
472} 486}
473 487
474static int remove_device_files(struct super_block *sb, 488static int remove_device_files(struct super_block *sb,
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 3484e8ba24a4..e70492db74f6 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -452,7 +452,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
452 skb->len, tx->mtu); 452 skb->len, tx->mtu);
453 ++priv->stats.tx_dropped; 453 ++priv->stats.tx_dropped;
454 ++priv->stats.tx_errors; 454 ++priv->stats.tx_errors;
455 ipoib_cm_skb_too_long(dev, skb, tx->mtu - INFINIBAND_ALEN); 455 ipoib_cm_skb_too_long(dev, skb, tx->mtu - IPOIB_ENCAP_LEN);
456 return; 456 return;
457 } 457 }
458 458
@@ -1095,7 +1095,7 @@ static void ipoib_cm_stale_task(struct work_struct *work)
1095 /* List if sorted by LRU, start from tail, 1095 /* List if sorted by LRU, start from tail,
1096 * stop when we see a recently used entry */ 1096 * stop when we see a recently used entry */
1097 p = list_entry(priv->cm.passive_ids.prev, typeof(*p), list); 1097 p = list_entry(priv->cm.passive_ids.prev, typeof(*p), list);
1098 if (time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT)) 1098 if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT))
1099 break; 1099 break;
1100 list_del_init(&p->list); 1100 list_del_init(&p->list);
1101 spin_unlock_irqrestore(&priv->lock, flags); 1101 spin_unlock_irqrestore(&priv->lock, flags);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index f2aa923ddbea..ba0ee5cf2ad7 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -328,9 +328,9 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
328 struct ipoib_tx_buf *tx_req; 328 struct ipoib_tx_buf *tx_req;
329 u64 addr; 329 u64 addr;
330 330
331 if (unlikely(skb->len > priv->mcast_mtu + INFINIBAND_ALEN)) { 331 if (unlikely(skb->len > priv->mcast_mtu + IPOIB_ENCAP_LEN)) {
332 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", 332 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
333 skb->len, priv->mcast_mtu + INFINIBAND_ALEN); 333 skb->len, priv->mcast_mtu + IPOIB_ENCAP_LEN);
334 ++priv->stats.tx_dropped; 334 ++priv->stats.tx_dropped;
335 ++priv->stats.tx_errors; 335 ++priv->stats.tx_errors;
336 ipoib_cm_skb_too_long(dev, skb, priv->mcast_mtu); 336 ipoib_cm_skb_too_long(dev, skb, priv->mcast_mtu);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index f9dbc6f68145..0741c6d1337c 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -380,7 +380,7 @@ static void path_rec_completion(int status,
380 struct net_device *dev = path->dev; 380 struct net_device *dev = path->dev;
381 struct ipoib_dev_priv *priv = netdev_priv(dev); 381 struct ipoib_dev_priv *priv = netdev_priv(dev);
382 struct ipoib_ah *ah = NULL; 382 struct ipoib_ah *ah = NULL;
383 struct ipoib_neigh *neigh; 383 struct ipoib_neigh *neigh, *tn;
384 struct sk_buff_head skqueue; 384 struct sk_buff_head skqueue;
385 struct sk_buff *skb; 385 struct sk_buff *skb;
386 unsigned long flags; 386 unsigned long flags;
@@ -418,7 +418,7 @@ static void path_rec_completion(int status,
418 while ((skb = __skb_dequeue(&path->queue))) 418 while ((skb = __skb_dequeue(&path->queue)))
419 __skb_queue_tail(&skqueue, skb); 419 __skb_queue_tail(&skqueue, skb);
420 420
421 list_for_each_entry(neigh, &path->neigh_list, list) { 421 list_for_each_entry_safe(neigh, tn, &path->neigh_list, list) {
422 kref_get(&path->ah->ref); 422 kref_get(&path->ah->ref);
423 neigh->ah = path->ah; 423 neigh->ah = path->ah;
424 memcpy(&neigh->dgid.raw, &path->pathrec.dgid.raw, 424 memcpy(&neigh->dgid.raw, &path->pathrec.dgid.raw,
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 56c87a81bb67..54fbead4de01 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -644,6 +644,9 @@ static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
644 struct ipoib_dev_priv *priv = netdev_priv(dev); 644 struct ipoib_dev_priv *priv = netdev_priv(dev);
645 int ret = 0; 645 int ret = 0;
646 646
647 if (test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags))
648 ib_sa_free_multicast(mcast->mc);
649
647 if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) { 650 if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) {
648 ipoib_dbg_mcast(priv, "leaving MGID " IPOIB_GID_FMT "\n", 651 ipoib_dbg_mcast(priv, "leaving MGID " IPOIB_GID_FMT "\n",
649 IPOIB_GID_ARG(mcast->mcmember.mgid)); 652 IPOIB_GID_ARG(mcast->mcmember.mgid));
@@ -655,9 +658,6 @@ static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
655 ipoib_warn(priv, "ipoib_mcast_detach failed (result = %d)\n", ret); 658 ipoib_warn(priv, "ipoib_mcast_detach failed (result = %d)\n", ret);
656 } 659 }
657 660
658 if (test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags))
659 ib_sa_free_multicast(mcast->mc);
660
661 return 0; 661 return 0;
662} 662}
663 663
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index a163bca38973..dc7a8c78cbf9 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2464,7 +2464,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
2464 2464
2465 r = kvm_arch_ops->hardware_setup(); 2465 r = kvm_arch_ops->hardware_setup();
2466 if (r < 0) 2466 if (r < 0)
2467 return r; 2467 goto out;
2468 2468
2469 on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1); 2469 on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1);
2470 r = register_cpu_notifier(&kvm_cpu_notifier); 2470 r = register_cpu_notifier(&kvm_cpu_notifier);
@@ -2500,6 +2500,8 @@ out_free_2:
2500out_free_1: 2500out_free_1:
2501 on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1); 2501 on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1);
2502 kvm_arch_ops->hardware_unsetup(); 2502 kvm_arch_ops->hardware_unsetup();
2503out:
2504 kvm_arch_ops = NULL;
2503 return r; 2505 return r;
2504} 2506}
2505 2507
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index a1a93368f314..e85b4c7c36f7 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -131,7 +131,7 @@ static int dbg = 1;
131 (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1)) 131 (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1))
132 132
133 133
134#define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & PAGE_MASK) 134#define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & ~(u64)(PAGE_SIZE-1))
135#define PT64_DIR_BASE_ADDR_MASK \ 135#define PT64_DIR_BASE_ADDR_MASK \
136 (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1)) 136 (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1))
137 137
@@ -406,8 +406,8 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn)
406 spte = desc->shadow_ptes[0]; 406 spte = desc->shadow_ptes[0];
407 } 407 }
408 BUG_ON(!spte); 408 BUG_ON(!spte);
409 BUG_ON((*spte & PT64_BASE_ADDR_MASK) != 409 BUG_ON((*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT
410 page_to_pfn(page) << PAGE_SHIFT); 410 != page_to_pfn(page));
411 BUG_ON(!(*spte & PT_PRESENT_MASK)); 411 BUG_ON(!(*spte & PT_PRESENT_MASK));
412 BUG_ON(!(*spte & PT_WRITABLE_MASK)); 412 BUG_ON(!(*spte & PT_WRITABLE_MASK));
413 rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); 413 rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte);
@@ -1093,22 +1093,40 @@ out:
1093 return r; 1093 return r;
1094} 1094}
1095 1095
1096static void mmu_pre_write_zap_pte(struct kvm_vcpu *vcpu,
1097 struct kvm_mmu_page *page,
1098 u64 *spte)
1099{
1100 u64 pte;
1101 struct kvm_mmu_page *child;
1102
1103 pte = *spte;
1104 if (is_present_pte(pte)) {
1105 if (page->role.level == PT_PAGE_TABLE_LEVEL)
1106 rmap_remove(vcpu, spte);
1107 else {
1108 child = page_header(pte & PT64_BASE_ADDR_MASK);
1109 mmu_page_remove_parent_pte(vcpu, child, spte);
1110 }
1111 }
1112 *spte = 0;
1113}
1114
1096void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) 1115void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes)
1097{ 1116{
1098 gfn_t gfn = gpa >> PAGE_SHIFT; 1117 gfn_t gfn = gpa >> PAGE_SHIFT;
1099 struct kvm_mmu_page *page; 1118 struct kvm_mmu_page *page;
1100 struct kvm_mmu_page *child;
1101 struct hlist_node *node, *n; 1119 struct hlist_node *node, *n;
1102 struct hlist_head *bucket; 1120 struct hlist_head *bucket;
1103 unsigned index; 1121 unsigned index;
1104 u64 *spte; 1122 u64 *spte;
1105 u64 pte;
1106 unsigned offset = offset_in_page(gpa); 1123 unsigned offset = offset_in_page(gpa);
1107 unsigned pte_size; 1124 unsigned pte_size;
1108 unsigned page_offset; 1125 unsigned page_offset;
1109 unsigned misaligned; 1126 unsigned misaligned;
1110 int level; 1127 int level;
1111 int flooded = 0; 1128 int flooded = 0;
1129 int npte;
1112 1130
1113 pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes); 1131 pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes);
1114 if (gfn == vcpu->last_pt_write_gfn) { 1132 if (gfn == vcpu->last_pt_write_gfn) {
@@ -1144,22 +1162,26 @@ void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes)
1144 } 1162 }
1145 page_offset = offset; 1163 page_offset = offset;
1146 level = page->role.level; 1164 level = page->role.level;
1165 npte = 1;
1147 if (page->role.glevels == PT32_ROOT_LEVEL) { 1166 if (page->role.glevels == PT32_ROOT_LEVEL) {
1148 page_offset <<= 1; /* 32->64 */ 1167 page_offset <<= 1; /* 32->64 */
1168 /*
1169 * A 32-bit pde maps 4MB while the shadow pdes map
1170 * only 2MB. So we need to double the offset again
1171 * and zap two pdes instead of one.
1172 */
1173 if (level == PT32_ROOT_LEVEL) {
1174 page_offset <<= 1;
1175 npte = 2;
1176 }
1149 page_offset &= ~PAGE_MASK; 1177 page_offset &= ~PAGE_MASK;
1150 } 1178 }
1151 spte = __va(page->page_hpa); 1179 spte = __va(page->page_hpa);
1152 spte += page_offset / sizeof(*spte); 1180 spte += page_offset / sizeof(*spte);
1153 pte = *spte; 1181 while (npte--) {
1154 if (is_present_pte(pte)) { 1182 mmu_pre_write_zap_pte(vcpu, page, spte);
1155 if (level == PT_PAGE_TABLE_LEVEL) 1183 ++spte;
1156 rmap_remove(vcpu, spte);
1157 else {
1158 child = page_header(pte & PT64_BASE_ADDR_MASK);
1159 mmu_page_remove_parent_pte(vcpu, child, spte);
1160 }
1161 } 1184 }
1162 *spte = 0;
1163 } 1185 }
1164} 1186}
1165 1187
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index c07178e61122..bfa0ce42ea92 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -371,10 +371,10 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
371 data = vmcs_read32(GUEST_SYSENTER_CS); 371 data = vmcs_read32(GUEST_SYSENTER_CS);
372 break; 372 break;
373 case MSR_IA32_SYSENTER_EIP: 373 case MSR_IA32_SYSENTER_EIP:
374 data = vmcs_read32(GUEST_SYSENTER_EIP); 374 data = vmcs_readl(GUEST_SYSENTER_EIP);
375 break; 375 break;
376 case MSR_IA32_SYSENTER_ESP: 376 case MSR_IA32_SYSENTER_ESP:
377 data = vmcs_read32(GUEST_SYSENTER_ESP); 377 data = vmcs_readl(GUEST_SYSENTER_ESP);
378 break; 378 break;
379 default: 379 default:
380 msr = find_msr_entry(vcpu, msr_index); 380 msr = find_msr_entry(vcpu, msr_index);
@@ -412,10 +412,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
412 vmcs_write32(GUEST_SYSENTER_CS, data); 412 vmcs_write32(GUEST_SYSENTER_CS, data);
413 break; 413 break;
414 case MSR_IA32_SYSENTER_EIP: 414 case MSR_IA32_SYSENTER_EIP:
415 vmcs_write32(GUEST_SYSENTER_EIP, data); 415 vmcs_writel(GUEST_SYSENTER_EIP, data);
416 break; 416 break;
417 case MSR_IA32_SYSENTER_ESP: 417 case MSR_IA32_SYSENTER_ESP:
418 vmcs_write32(GUEST_SYSENTER_ESP, data); 418 vmcs_writel(GUEST_SYSENTER_ESP, data);
419 break; 419 break;
420 case MSR_IA32_TIME_STAMP_COUNTER: 420 case MSR_IA32_TIME_STAMP_COUNTER:
421 guest_write_tsc(data); 421 guest_write_tsc(data);
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index c625ddb8833d..d5ecd2d53046 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -188,7 +188,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
188 for (i=0; i < cnt-1 ; i++) { 188 for (i=0; i < cnt-1 ; i++) {
189 sector_t sz = 0; 189 sector_t sz = 0;
190 int j; 190 int j;
191 for (j=i; i<cnt-1 && sz < min_spacing ; j++) 191 for (j = i; j < cnt - 1 && sz < min_spacing; j++)
192 sz += conf->disks[j].size; 192 sz += conf->disks[j].size;
193 if (sz >= min_spacing && sz < conf->hash_spacing) 193 if (sz >= min_spacing && sz < conf->hash_spacing)
194 conf->hash_spacing = sz; 194 conf->hash_spacing = sz;
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 5ff0922e628c..c3f9f599f134 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2372,22 +2372,23 @@ config CHELSIO_T1_NAPI
2372 when the driver is receiving lots of packets from the card. 2372 when the driver is receiving lots of packets from the card.
2373 2373
2374config CHELSIO_T3 2374config CHELSIO_T3
2375 tristate "Chelsio Communications T3 10Gb Ethernet support" 2375 tristate "Chelsio Communications T3 10Gb Ethernet support"
2376 depends on PCI 2376 depends on PCI
2377 help 2377 select FW_LOADER
2378 This driver supports Chelsio T3-based gigabit and 10Gb Ethernet 2378 help
2379 adapters. 2379 This driver supports Chelsio T3-based gigabit and 10Gb Ethernet
2380 adapters.
2380 2381
2381 For general information about Chelsio and our products, visit 2382 For general information about Chelsio and our products, visit
2382 our website at <http://www.chelsio.com>. 2383 our website at <http://www.chelsio.com>.
2383 2384
2384 For customer support, please visit our customer support page at 2385 For customer support, please visit our customer support page at
2385 <http://www.chelsio.com/support.htm>. 2386 <http://www.chelsio.com/support.htm>.
2386 2387
2387 Please send feedback to <linux-bugs@chelsio.com>. 2388 Please send feedback to <linux-bugs@chelsio.com>.
2388 2389
2389 To compile this driver as a module, choose M here: the module 2390 To compile this driver as a module, choose M here: the module
2390 will be called cxgb3. 2391 will be called cxgb3.
2391 2392
2392config EHEA 2393config EHEA
2393 tristate "eHEA Ethernet support" 2394 tristate "eHEA Ethernet support"
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index e23deeb7d06d..85e5543cfb57 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -260,6 +260,10 @@ struct mac_stats {
260 unsigned long serdes_signal_loss; 260 unsigned long serdes_signal_loss;
261 unsigned long xaui_pcs_ctc_err; 261 unsigned long xaui_pcs_ctc_err;
262 unsigned long xaui_pcs_align_change; 262 unsigned long xaui_pcs_align_change;
263
264 unsigned long num_toggled; /* # times toggled TxEn due to stuck TX */
265 unsigned long num_resets; /* # times reset due to stuck TX */
266
263}; 267};
264 268
265struct tp_mib_stats { 269struct tp_mib_stats {
@@ -400,6 +404,12 @@ struct adapter_params {
400 unsigned int rev; /* chip revision */ 404 unsigned int rev; /* chip revision */
401}; 405};
402 406
407enum { /* chip revisions */
408 T3_REV_A = 0,
409 T3_REV_B = 2,
410 T3_REV_B2 = 3,
411};
412
403struct trace_params { 413struct trace_params {
404 u32 sip; 414 u32 sip;
405 u32 sip_mask; 415 u32 sip_mask;
@@ -465,6 +475,10 @@ struct cmac {
465 struct adapter *adapter; 475 struct adapter *adapter;
466 unsigned int offset; 476 unsigned int offset;
467 unsigned int nucast; /* # of address filters for unicast MACs */ 477 unsigned int nucast; /* # of address filters for unicast MACs */
478 unsigned int tcnt;
479 unsigned int xcnt;
480 unsigned int toggle_cnt;
481 unsigned int txen;
468 struct mac_stats stats; 482 struct mac_stats stats;
469}; 483};
470 484
@@ -666,6 +680,7 @@ int t3_mac_set_address(struct cmac *mac, unsigned int idx, u8 addr[6]);
666int t3_mac_set_num_ucast(struct cmac *mac, int n); 680int t3_mac_set_num_ucast(struct cmac *mac, int n);
667const struct mac_stats *t3_mac_update_stats(struct cmac *mac); 681const struct mac_stats *t3_mac_update_stats(struct cmac *mac);
668int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc); 682int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc);
683int t3b2_mac_watchdog_task(struct cmac *mac);
669 684
670void t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode); 685void t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode);
671int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, 686int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters,
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 7ff834e45d6b..d55383610559 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -42,6 +42,7 @@
42#include <linux/workqueue.h> 42#include <linux/workqueue.h>
43#include <linux/proc_fs.h> 43#include <linux/proc_fs.h>
44#include <linux/rtnetlink.h> 44#include <linux/rtnetlink.h>
45#include <linux/firmware.h>
45#include <asm/uaccess.h> 46#include <asm/uaccess.h>
46 47
47#include "common.h" 48#include "common.h"
@@ -707,6 +708,28 @@ static void bind_qsets(struct adapter *adap)
707 } 708 }
708} 709}
709 710
711#define FW_FNAME "t3fw-%d.%d.bin"
712
713static int upgrade_fw(struct adapter *adap)
714{
715 int ret;
716 char buf[64];
717 const struct firmware *fw;
718 struct device *dev = &adap->pdev->dev;
719
720 snprintf(buf, sizeof(buf), FW_FNAME, FW_VERSION_MAJOR,
721 FW_VERSION_MINOR);
722 ret = request_firmware(&fw, buf, dev);
723 if (ret < 0) {
724 dev_err(dev, "could not upgrade firmware: unable to load %s\n",
725 buf);
726 return ret;
727 }
728 ret = t3_load_fw(adap, fw->data, fw->size);
729 release_firmware(fw);
730 return ret;
731}
732
710/** 733/**
711 * cxgb_up - enable the adapter 734 * cxgb_up - enable the adapter
712 * @adapter: adapter being enabled 735 * @adapter: adapter being enabled
@@ -723,6 +746,8 @@ static int cxgb_up(struct adapter *adap)
723 746
724 if (!(adap->flags & FULL_INIT_DONE)) { 747 if (!(adap->flags & FULL_INIT_DONE)) {
725 err = t3_check_fw_version(adap); 748 err = t3_check_fw_version(adap);
749 if (err == -EINVAL)
750 err = upgrade_fw(adap);
726 if (err) 751 if (err)
727 goto out; 752 goto out;
728 753
@@ -1031,7 +1056,11 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
1031 "VLANinsertions ", 1056 "VLANinsertions ",
1032 "TxCsumOffload ", 1057 "TxCsumOffload ",
1033 "RxCsumGood ", 1058 "RxCsumGood ",
1034 "RxDrops " 1059 "RxDrops ",
1060
1061 "CheckTXEnToggled ",
1062 "CheckResets ",
1063
1035}; 1064};
1036 1065
1037static int get_stats_count(struct net_device *dev) 1066static int get_stats_count(struct net_device *dev)
@@ -1145,6 +1174,9 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
1145 *data++ = collect_sge_port_stats(adapter, pi, SGE_PSTAT_TX_CSUM); 1174 *data++ = collect_sge_port_stats(adapter, pi, SGE_PSTAT_TX_CSUM);
1146 *data++ = collect_sge_port_stats(adapter, pi, SGE_PSTAT_RX_CSUM_GOOD); 1175 *data++ = collect_sge_port_stats(adapter, pi, SGE_PSTAT_RX_CSUM_GOOD);
1147 *data++ = s->rx_cong_drops; 1176 *data++ = s->rx_cong_drops;
1177
1178 *data++ = s->num_toggled;
1179 *data++ = s->num_resets;
1148} 1180}
1149 1181
1150static inline void reg_block_dump(struct adapter *ap, void *buf, 1182static inline void reg_block_dump(struct adapter *ap, void *buf,
@@ -1362,23 +1394,27 @@ static int set_rx_csum(struct net_device *dev, u32 data)
1362 1394
1363static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e) 1395static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1364{ 1396{
1365 struct adapter *adapter = dev->priv; 1397 const struct adapter *adapter = dev->priv;
1398 const struct port_info *pi = netdev_priv(dev);
1399 const struct qset_params *q = &adapter->params.sge.qset[pi->first_qset];
1366 1400
1367 e->rx_max_pending = MAX_RX_BUFFERS; 1401 e->rx_max_pending = MAX_RX_BUFFERS;
1368 e->rx_mini_max_pending = 0; 1402 e->rx_mini_max_pending = 0;
1369 e->rx_jumbo_max_pending = MAX_RX_JUMBO_BUFFERS; 1403 e->rx_jumbo_max_pending = MAX_RX_JUMBO_BUFFERS;
1370 e->tx_max_pending = MAX_TXQ_ENTRIES; 1404 e->tx_max_pending = MAX_TXQ_ENTRIES;
1371 1405
1372 e->rx_pending = adapter->params.sge.qset[0].fl_size; 1406 e->rx_pending = q->fl_size;
1373 e->rx_mini_pending = adapter->params.sge.qset[0].rspq_size; 1407 e->rx_mini_pending = q->rspq_size;
1374 e->rx_jumbo_pending = adapter->params.sge.qset[0].jumbo_size; 1408 e->rx_jumbo_pending = q->jumbo_size;
1375 e->tx_pending = adapter->params.sge.qset[0].txq_size[0]; 1409 e->tx_pending = q->txq_size[0];
1376} 1410}
1377 1411
1378static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e) 1412static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1379{ 1413{
1380 int i; 1414 int i;
1415 struct qset_params *q;
1381 struct adapter *adapter = dev->priv; 1416 struct adapter *adapter = dev->priv;
1417 const struct port_info *pi = netdev_priv(dev);
1382 1418
1383 if (e->rx_pending > MAX_RX_BUFFERS || 1419 if (e->rx_pending > MAX_RX_BUFFERS ||
1384 e->rx_jumbo_pending > MAX_RX_JUMBO_BUFFERS || 1420 e->rx_jumbo_pending > MAX_RX_JUMBO_BUFFERS ||
@@ -1393,9 +1429,8 @@ static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1393 if (adapter->flags & FULL_INIT_DONE) 1429 if (adapter->flags & FULL_INIT_DONE)
1394 return -EBUSY; 1430 return -EBUSY;
1395 1431
1396 for (i = 0; i < SGE_QSETS; ++i) { 1432 q = &adapter->params.sge.qset[pi->first_qset];
1397 struct qset_params *q = &adapter->params.sge.qset[i]; 1433 for (i = 0; i < pi->nqsets; ++i, ++q) {
1398
1399 q->rspq_size = e->rx_mini_pending; 1434 q->rspq_size = e->rx_mini_pending;
1400 q->fl_size = e->rx_pending; 1435 q->fl_size = e->rx_pending;
1401 q->jumbo_size = e->rx_jumbo_pending; 1436 q->jumbo_size = e->rx_jumbo_pending;
@@ -2067,6 +2102,40 @@ static void check_link_status(struct adapter *adapter)
2067 } 2102 }
2068} 2103}
2069 2104
2105static void check_t3b2_mac(struct adapter *adapter)
2106{
2107 int i;
2108
2109 rtnl_lock(); /* synchronize with ifdown */
2110 for_each_port(adapter, i) {
2111 struct net_device *dev = adapter->port[i];
2112 struct port_info *p = netdev_priv(dev);
2113 int status;
2114
2115 if (!netif_running(dev))
2116 continue;
2117
2118 status = 0;
2119 if (netif_running(dev))
2120 status = t3b2_mac_watchdog_task(&p->mac);
2121 if (status == 1)
2122 p->mac.stats.num_toggled++;
2123 else if (status == 2) {
2124 struct cmac *mac = &p->mac;
2125
2126 t3_mac_set_mtu(mac, dev->mtu);
2127 t3_mac_set_address(mac, 0, dev->dev_addr);
2128 cxgb_set_rxmode(dev);
2129 t3_link_start(&p->phy, mac, &p->link_config);
2130 t3_mac_enable(mac, MAC_DIRECTION_RX | MAC_DIRECTION_TX);
2131 t3_port_intr_enable(adapter, p->port_id);
2132 p->mac.stats.num_resets++;
2133 }
2134 }
2135 rtnl_unlock();
2136}
2137
2138
2070static void t3_adap_check_task(struct work_struct *work) 2139static void t3_adap_check_task(struct work_struct *work)
2071{ 2140{
2072 struct adapter *adapter = container_of(work, struct adapter, 2141 struct adapter *adapter = container_of(work, struct adapter,
@@ -2087,6 +2156,9 @@ static void t3_adap_check_task(struct work_struct *work)
2087 adapter->check_task_cnt = 0; 2156 adapter->check_task_cnt = 0;
2088 } 2157 }
2089 2158
2159 if (p->rev == T3_REV_B2)
2160 check_t3b2_mac(adapter);
2161
2090 /* Schedule the next check update if any port is active. */ 2162 /* Schedule the next check update if any port is active. */
2091 spin_lock(&adapter->work_lock); 2163 spin_lock(&adapter->work_lock);
2092 if (adapter->open_device_map & PORT_MASK) 2164 if (adapter->open_device_map & PORT_MASK)
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index b56c5f52bcdc..b38629a244d0 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1206,6 +1206,14 @@
1206 1206
1207#define A_TP_RX_TRC_KEY0 0x120 1207#define A_TP_RX_TRC_KEY0 0x120
1208 1208
1209#define A_TP_TX_DROP_CNT_CH0 0x12d
1210
1211#define S_TXDROPCNTCH0RCVD 0
1212#define M_TXDROPCNTCH0RCVD 0xffff
1213#define V_TXDROPCNTCH0RCVD(x) ((x) << S_TXDROPCNTCH0RCVD)
1214#define G_TXDROPCNTCH0RCVD(x) (((x) >> S_TXDROPCNTCH0RCVD) & \
1215 M_TXDROPCNTCH0RCVD)
1216
1209#define A_ULPRX_CTL 0x500 1217#define A_ULPRX_CTL 0x500
1210 1218
1211#define S_ROUND_ROBIN 4 1219#define S_ROUND_ROBIN 4
@@ -1834,6 +1842,8 @@
1834#define V_TXPAUSEEN(x) ((x) << S_TXPAUSEEN) 1842#define V_TXPAUSEEN(x) ((x) << S_TXPAUSEEN)
1835#define F_TXPAUSEEN V_TXPAUSEEN(1U) 1843#define F_TXPAUSEEN V_TXPAUSEEN(1U)
1836 1844
1845#define A_XGM_TX_PAUSE_QUANTA 0x808
1846
1837#define A_XGM_RX_CTRL 0x80c 1847#define A_XGM_RX_CTRL 0x80c
1838 1848
1839#define S_RXEN 0 1849#define S_RXEN 0
@@ -1920,6 +1930,11 @@
1920 1930
1921#define A_XGM_TXFIFO_CFG 0x888 1931#define A_XGM_TXFIFO_CFG 0x888
1922 1932
1933#define S_TXIPG 13
1934#define M_TXIPG 0xff
1935#define V_TXIPG(x) ((x) << S_TXIPG)
1936#define G_TXIPG(x) (((x) >> S_TXIPG) & M_TXIPG)
1937
1923#define S_TXFIFOTHRESH 4 1938#define S_TXFIFOTHRESH 4
1924#define M_TXFIFOTHRESH 0x1ff 1939#define M_TXFIFOTHRESH 0x1ff
1925 1940
@@ -2190,6 +2205,13 @@
2190 2205
2191#define A_XGM_RX_MAX_PKT_SIZE_ERR_CNT 0x9a4 2206#define A_XGM_RX_MAX_PKT_SIZE_ERR_CNT 0x9a4
2192 2207
2208#define A_XGM_TX_SPI4_SOP_EOP_CNT 0x9a8
2209
2210#define S_TXSPI4SOPCNT 16
2211#define M_TXSPI4SOPCNT 0xffff
2212#define V_TXSPI4SOPCNT(x) ((x) << S_TXSPI4SOPCNT)
2213#define G_TXSPI4SOPCNT(x) (((x) >> S_TXSPI4SOPCNT) & M_TXSPI4SOPCNT)
2214
2193#define A_XGM_RX_SPI4_SOP_EOP_CNT 0x9ac 2215#define A_XGM_RX_SPI4_SOP_EOP_CNT 0x9ac
2194 2216
2195#define XGMAC0_1_BASE_ADDR 0xa00 2217#define XGMAC0_1_BASE_ADDR 0xa00
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index eaa7a2e89a30..791ed6dc1943 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -681,7 +681,8 @@ enum {
681 SF_ERASE_SECTOR = 0xd8, /* erase sector */ 681 SF_ERASE_SECTOR = 0xd8, /* erase sector */
682 682
683 FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */ 683 FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */
684 FW_VERS_ADDR = 0x77ffc /* flash address holding FW version */ 684 FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */
685 FW_MIN_SIZE = 8 /* at least version and csum */
685}; 686};
686 687
687/** 688/**
@@ -935,7 +936,7 @@ int t3_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size)
935 const u32 *p = (const u32 *)fw_data; 936 const u32 *p = (const u32 *)fw_data;
936 int ret, addr, fw_sector = FW_FLASH_BOOT_ADDR >> 16; 937 int ret, addr, fw_sector = FW_FLASH_BOOT_ADDR >> 16;
937 938
938 if (size & 3) 939 if ((size & 3) || size < FW_MIN_SIZE)
939 return -EINVAL; 940 return -EINVAL;
940 if (size > FW_VERS_ADDR + 8 - FW_FLASH_BOOT_ADDR) 941 if (size > FW_VERS_ADDR + 8 - FW_FLASH_BOOT_ADDR)
941 return -EFBIG; 942 return -EFBIG;
@@ -3243,15 +3244,17 @@ void early_hw_init(struct adapter *adapter, const struct adapter_info *ai)
3243} 3244}
3244 3245
3245/* 3246/*
3246 * Reset the adapter. PCIe cards lose their config space during reset, PCI-X 3247 * Reset the adapter.
3248 * Older PCIe cards lose their config space during reset, PCI-X
3247 * ones don't. 3249 * ones don't.
3248 */ 3250 */
3249int t3_reset_adapter(struct adapter *adapter) 3251int t3_reset_adapter(struct adapter *adapter)
3250{ 3252{
3251 int i; 3253 int i, save_and_restore_pcie =
3254 adapter->params.rev < T3_REV_B2 && is_pcie(adapter);
3252 uint16_t devid = 0; 3255 uint16_t devid = 0;
3253 3256
3254 if (is_pcie(adapter)) 3257 if (save_and_restore_pcie)
3255 pci_save_state(adapter->pdev); 3258 pci_save_state(adapter->pdev);
3256 t3_write_reg(adapter, A_PL_RST, F_CRSTWRM | F_CRSTWRMMODE); 3259 t3_write_reg(adapter, A_PL_RST, F_CRSTWRM | F_CRSTWRMMODE);
3257 3260
@@ -3269,7 +3272,7 @@ int t3_reset_adapter(struct adapter *adapter)
3269 if (devid != 0x1425) 3272 if (devid != 0x1425)
3270 return -1; 3273 return -1;
3271 3274
3272 if (is_pcie(adapter)) 3275 if (save_and_restore_pcie)
3273 pci_restore_state(adapter->pdev); 3276 pci_restore_state(adapter->pdev);
3274 return 0; 3277 return 0;
3275} 3278}
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index 907a272ae32d..2b42c13ba8e0 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -124,9 +124,6 @@ int t3_mac_reset(struct cmac *mac)
124 xaui_serdes_reset(mac); 124 xaui_serdes_reset(mac);
125 } 125 }
126 126
127 if (adap->params.rev > 0)
128 t3_write_reg(adap, A_XGM_PAUSE_TIMER + oft, 0xf000);
129
130 val = F_MAC_RESET_; 127 val = F_MAC_RESET_;
131 if (is_10G(adap)) 128 if (is_10G(adap))
132 val |= F_PCS_RESET_; 129 val |= F_PCS_RESET_;
@@ -145,6 +142,58 @@ int t3_mac_reset(struct cmac *mac)
145 return 0; 142 return 0;
146} 143}
147 144
145int t3b2_mac_reset(struct cmac *mac)
146{
147 struct adapter *adap = mac->adapter;
148 unsigned int oft = mac->offset;
149 u32 val;
150
151 if (!macidx(mac))
152 t3_set_reg_field(adap, A_MPS_CFG, F_PORT0ACTIVE, 0);
153 else
154 t3_set_reg_field(adap, A_MPS_CFG, F_PORT1ACTIVE, 0);
155
156 t3_write_reg(adap, A_XGM_RESET_CTRL + oft, F_MAC_RESET_);
157 t3_read_reg(adap, A_XGM_RESET_CTRL + oft); /* flush */
158
159 msleep(10);
160
161 /* Check for xgm Rx fifo empty */
162 if (t3_wait_op_done(adap, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT + oft,
163 0x80000000, 1, 5, 2)) {
164 CH_ERR(adap, "MAC %d Rx fifo drain failed\n",
165 macidx(mac));
166 return -1;
167 }
168
169 t3_write_reg(adap, A_XGM_RESET_CTRL + oft, 0);
170 t3_read_reg(adap, A_XGM_RESET_CTRL + oft); /* flush */
171
172 val = F_MAC_RESET_;
173 if (is_10G(adap))
174 val |= F_PCS_RESET_;
175 else if (uses_xaui(adap))
176 val |= F_PCS_RESET_ | F_XG2G_RESET_;
177 else
178 val |= F_RGMII_RESET_ | F_XG2G_RESET_;
179 t3_write_reg(adap, A_XGM_RESET_CTRL + oft, val);
180 t3_read_reg(adap, A_XGM_RESET_CTRL + oft); /* flush */
181 if ((val & F_PCS_RESET_) && adap->params.rev) {
182 msleep(1);
183 t3b_pcs_reset(mac);
184 }
185 t3_write_reg(adap, A_XGM_RX_CFG + oft,
186 F_DISPAUSEFRAMES | F_EN1536BFRAMES |
187 F_RMFCS | F_ENJUMBO | F_ENHASHMCAST);
188
189 if (!macidx(mac))
190 t3_set_reg_field(adap, A_MPS_CFG, 0, F_PORT0ACTIVE);
191 else
192 t3_set_reg_field(adap, A_MPS_CFG, 0, F_PORT1ACTIVE);
193
194 return 0;
195}
196
148/* 197/*
149 * Set the exact match register 'idx' to recognize the given Ethernet address. 198 * Set the exact match register 'idx' to recognize the given Ethernet address.
150 */ 199 */
@@ -251,9 +300,11 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
251 * Adjust the PAUSE frame watermarks. We always set the LWM, and the 300 * Adjust the PAUSE frame watermarks. We always set the LWM, and the
252 * HWM only if flow-control is enabled. 301 * HWM only if flow-control is enabled.
253 */ 302 */
254 hwm = max(MAC_RXFIFO_SIZE - 3 * mtu, MAC_RXFIFO_SIZE / 2U); 303 hwm = max_t(unsigned int, MAC_RXFIFO_SIZE - 3 * mtu,
255 hwm = min(hwm, 3 * MAC_RXFIFO_SIZE / 4 + 1024); 304 MAC_RXFIFO_SIZE * 38 / 100);
256 lwm = hwm - 1024; 305 hwm = min(hwm, MAC_RXFIFO_SIZE - 8192);
306 lwm = min(3 * (int)mtu, MAC_RXFIFO_SIZE / 4);
307
257 v = t3_read_reg(adap, A_XGM_RXFIFO_CFG + mac->offset); 308 v = t3_read_reg(adap, A_XGM_RXFIFO_CFG + mac->offset);
258 v &= ~V_RXFIFOPAUSELWM(M_RXFIFOPAUSELWM); 309 v &= ~V_RXFIFOPAUSELWM(M_RXFIFOPAUSELWM);
259 v |= V_RXFIFOPAUSELWM(lwm / 8); 310 v |= V_RXFIFOPAUSELWM(lwm / 8);
@@ -270,7 +321,15 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
270 thres = mtu > thres ? (mtu - thres + 7) / 8 : 0; 321 thres = mtu > thres ? (mtu - thres + 7) / 8 : 0;
271 thres = max(thres, 8U); /* need at least 8 */ 322 thres = max(thres, 8U); /* need at least 8 */
272 t3_set_reg_field(adap, A_XGM_TXFIFO_CFG + mac->offset, 323 t3_set_reg_field(adap, A_XGM_TXFIFO_CFG + mac->offset,
273 V_TXFIFOTHRESH(M_TXFIFOTHRESH), V_TXFIFOTHRESH(thres)); 324 V_TXFIFOTHRESH(M_TXFIFOTHRESH) | V_TXIPG(M_TXIPG),
325 V_TXFIFOTHRESH(thres) | V_TXIPG(1));
326
327 if (adap->params.rev > 0)
328 t3_write_reg(adap, A_XGM_PAUSE_TIMER + mac->offset,
329 (hwm - lwm) * 4 / 8);
330 t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac->offset,
331 MAC_RXFIFO_SIZE * 4 * 8 / 512);
332
274 return 0; 333 return 0;
275} 334}
276 335
@@ -298,12 +357,6 @@ int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc)
298 V_PORTSPEED(M_PORTSPEED), val); 357 V_PORTSPEED(M_PORTSPEED), val);
299 } 358 }
300 359
301 val = t3_read_reg(adap, A_XGM_RXFIFO_CFG + oft);
302 val &= ~V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM);
303 if (fc & PAUSE_TX)
304 val |= V_RXFIFOPAUSEHWM(G_RXFIFOPAUSELWM(val) + 128); /* +1KB */
305 t3_write_reg(adap, A_XGM_RXFIFO_CFG + oft, val);
306
307 t3_set_reg_field(adap, A_XGM_TX_CFG + oft, F_TXPAUSEEN, 360 t3_set_reg_field(adap, A_XGM_TX_CFG + oft, F_TXPAUSEEN,
308 (fc & PAUSE_RX) ? F_TXPAUSEEN : 0); 361 (fc & PAUSE_RX) ? F_TXPAUSEEN : 0);
309 return 0; 362 return 0;
@@ -318,9 +371,17 @@ int t3_mac_enable(struct cmac *mac, int which)
318 if (which & MAC_DIRECTION_TX) { 371 if (which & MAC_DIRECTION_TX) {
319 t3_write_reg(adap, A_XGM_TX_CTRL + oft, F_TXEN); 372 t3_write_reg(adap, A_XGM_TX_CTRL + oft, F_TXEN);
320 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CFG_CH0 + idx); 373 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CFG_CH0 + idx);
321 t3_write_reg(adap, A_TP_PIO_DATA, 0xbf000001); 374 t3_write_reg(adap, A_TP_PIO_DATA, 0xc0ede401);
322 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_MODE); 375 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_MODE);
323 t3_set_reg_field(adap, A_TP_PIO_DATA, 1 << idx, 1 << idx); 376 t3_set_reg_field(adap, A_TP_PIO_DATA, 1 << idx, 1 << idx);
377
378 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CNT_CH0 + idx);
379 mac->tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap,
380 A_TP_PIO_DATA)));
381 mac->xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
382 A_XGM_TX_SPI4_SOP_EOP_CNT)));
383 mac->txen = F_TXEN;
384 mac->toggle_cnt = 0;
324 } 385 }
325 if (which & MAC_DIRECTION_RX) 386 if (which & MAC_DIRECTION_RX)
326 t3_write_reg(adap, A_XGM_RX_CTRL + oft, F_RXEN); 387 t3_write_reg(adap, A_XGM_RX_CTRL + oft, F_RXEN);
@@ -337,13 +398,50 @@ int t3_mac_disable(struct cmac *mac, int which)
337 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CFG_CH0 + idx); 398 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CFG_CH0 + idx);
338 t3_write_reg(adap, A_TP_PIO_DATA, 0xc000001f); 399 t3_write_reg(adap, A_TP_PIO_DATA, 0xc000001f);
339 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_MODE); 400 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_MODE);
340 t3_set_reg_field(adap, A_TP_PIO_DATA, 1 << idx, 0); 401 t3_set_reg_field(adap, A_TP_PIO_DATA, 1 << idx, 1 << idx);
402 mac->txen = 0;
341 } 403 }
342 if (which & MAC_DIRECTION_RX) 404 if (which & MAC_DIRECTION_RX)
343 t3_write_reg(adap, A_XGM_RX_CTRL + mac->offset, 0); 405 t3_write_reg(adap, A_XGM_RX_CTRL + mac->offset, 0);
344 return 0; 406 return 0;
345} 407}
346 408
409int t3b2_mac_watchdog_task(struct cmac *mac)
410{
411 struct adapter *adap = mac->adapter;
412 unsigned int tcnt, xcnt;
413 int status;
414
415 t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CNT_CH0 + macidx(mac));
416 tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap, A_TP_PIO_DATA)));
417 xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
418 A_XGM_TX_SPI4_SOP_EOP_CNT +
419 mac->offset)));
420
421 if (tcnt != mac->tcnt && xcnt == 0 && mac->xcnt == 0) {
422 if (mac->toggle_cnt > 4) {
423 t3b2_mac_reset(mac);
424 mac->toggle_cnt = 0;
425 status = 2;
426 } else {
427 t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
428 t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset);
429 t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset,
430 mac->txen);
431 t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset);
432 mac->toggle_cnt++;
433 status = 1;
434 }
435 } else {
436 mac->toggle_cnt = 0;
437 status = 0;
438 }
439 mac->tcnt = tcnt;
440 mac->xcnt = xcnt;
441
442 return status;
443}
444
347/* 445/*
348 * This function is called periodically to accumulate the current values of the 446 * This function is called periodically to accumulate the current values of the
349 * RMON counters into the port statistics. Since the packet counters are only 447 * RMON counters into the port statistics. Since the packet counters are only
@@ -375,6 +473,11 @@ const struct mac_stats *t3_mac_update_stats(struct cmac *mac)
375 RMON_UPDATE(mac, rx_too_long, RX_OVERSIZE_FRAMES); 473 RMON_UPDATE(mac, rx_too_long, RX_OVERSIZE_FRAMES);
376 mac->stats.rx_too_long += RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT); 474 mac->stats.rx_too_long += RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT);
377 475
476 v = RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT);
477 if (mac->adapter->params.rev == T3_REV_B2)
478 v &= 0x7fffffff;
479 mac->stats.rx_too_long += v;
480
378 RMON_UPDATE(mac, rx_frames_64, RX_64B_FRAMES); 481 RMON_UPDATE(mac, rx_frames_64, RX_64B_FRAMES);
379 RMON_UPDATE(mac, rx_frames_65_127, RX_65_127B_FRAMES); 482 RMON_UPDATE(mac, rx_frames_65_127, RX_65_127B_FRAMES);
380 RMON_UPDATE(mac, rx_frames_128_255, RX_128_255B_FRAMES); 483 RMON_UPDATE(mac, rx_frames_128_255, RX_128_255B_FRAMES);
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 340ee99652eb..1d510bdc9b84 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1057,6 +1057,8 @@ static int stir421x_fw_upload(struct irda_usb_cb *self,
1057 1057
1058 if (ret < 0) 1058 if (ret < 0)
1059 break; 1059 break;
1060
1061 mdelay(10);
1060 } 1062 }
1061 1063
1062 kfree(patch_block); 1064 kfree(patch_block);
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 1ee27c360a4b..c9f55bc57edb 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1516,9 +1516,23 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
1516 return 0; 1516 return 0;
1517} 1517}
1518 1518
1519static void mv643xx_eth_shutdown(struct platform_device *pdev)
1520{
1521 struct net_device *dev = platform_get_drvdata(pdev);
1522 struct mv643xx_private *mp = netdev_priv(dev);
1523 unsigned int port_num = mp->port_num;
1524
1525 /* Mask all interrupts on ethernet port */
1526 mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), 0);
1527 mv_read (MV643XX_ETH_INTERRUPT_MASK_REG(port_num));
1528
1529 eth_port_reset(port_num);
1530}
1531
1519static struct platform_driver mv643xx_eth_driver = { 1532static struct platform_driver mv643xx_eth_driver = {
1520 .probe = mv643xx_eth_probe, 1533 .probe = mv643xx_eth_probe,
1521 .remove = mv643xx_eth_remove, 1534 .remove = mv643xx_eth_remove,
1535 .shutdown = mv643xx_eth_shutdown,
1522 .driver = { 1536 .driver = {
1523 .name = MV643XX_ETH_NAME, 1537 .name = MV643XX_ETH_NAME,
1524 }, 1538 },
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index ac02b3b60f92..b05b20ef8c0a 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -71,7 +71,7 @@
71#include "myri10ge_mcp.h" 71#include "myri10ge_mcp.h"
72#include "myri10ge_mcp_gen_header.h" 72#include "myri10ge_mcp_gen_header.h"
73 73
74#define MYRI10GE_VERSION_STR "1.2.0" 74#define MYRI10GE_VERSION_STR "1.3.0-1.226"
75 75
76MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 76MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
77MODULE_AUTHOR("Maintainer: help@myri.com"); 77MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -234,7 +234,7 @@ static int myri10ge_msi = 1; /* enable msi by default */
234module_param(myri10ge_msi, int, S_IRUGO | S_IWUSR); 234module_param(myri10ge_msi, int, S_IRUGO | S_IWUSR);
235MODULE_PARM_DESC(myri10ge_msi, "Enable Message Signalled Interrupts\n"); 235MODULE_PARM_DESC(myri10ge_msi, "Enable Message Signalled Interrupts\n");
236 236
237static int myri10ge_intr_coal_delay = 25; 237static int myri10ge_intr_coal_delay = 75;
238module_param(myri10ge_intr_coal_delay, int, S_IRUGO); 238module_param(myri10ge_intr_coal_delay, int, S_IRUGO);
239MODULE_PARM_DESC(myri10ge_intr_coal_delay, "Interrupt coalescing delay\n"); 239MODULE_PARM_DESC(myri10ge_intr_coal_delay, "Interrupt coalescing delay\n");
240 240
@@ -279,7 +279,7 @@ static int myri10ge_fill_thresh = 256;
279module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR); 279module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR);
280MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n"); 280MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n");
281 281
282static int myri10ge_wcfifo = 1; 282static int myri10ge_wcfifo = 0;
283module_param(myri10ge_wcfifo, int, S_IRUGO); 283module_param(myri10ge_wcfifo, int, S_IRUGO);
284MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled\n"); 284MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled\n");
285 285
@@ -905,6 +905,14 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
905 (rx->page_offset + bytes <= MYRI10GE_ALLOC_SIZE)) { 905 (rx->page_offset + bytes <= MYRI10GE_ALLOC_SIZE)) {
906 /* we can use part of previous page */ 906 /* we can use part of previous page */
907 get_page(rx->page); 907 get_page(rx->page);
908#if MYRI10GE_ALLOC_SIZE > 4096
909 /* Firmware cannot cross 4K boundary.. */
910 if ((rx->page_offset >> 12) !=
911 ((rx->page_offset + bytes - 1) >> 12)) {
912 rx->page_offset =
913 (rx->page_offset + bytes) & ~4095;
914 }
915#endif
908 } else { 916 } else {
909 /* we need a new page */ 917 /* we need a new page */
910 page = 918 page =
@@ -2483,6 +2491,8 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
2483 2491
2484#define PCI_DEVICE_ID_INTEL_E5000_PCIE23 0x25f7 2492#define PCI_DEVICE_ID_INTEL_E5000_PCIE23 0x25f7
2485#define PCI_DEVICE_ID_INTEL_E5000_PCIE47 0x25fa 2493#define PCI_DEVICE_ID_INTEL_E5000_PCIE47 0x25fa
2494#define PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_FIRST 0x140
2495#define PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_LAST 0x142
2486 2496
2487static void myri10ge_select_firmware(struct myri10ge_priv *mgp) 2497static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
2488{ 2498{
@@ -2514,6 +2524,12 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
2514 ((bridge->vendor == PCI_VENDOR_ID_SERVERWORKS 2524 ((bridge->vendor == PCI_VENDOR_ID_SERVERWORKS
2515 && bridge->device == 2525 && bridge->device ==
2516 PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE) 2526 PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE)
2527 /* ServerWorks HT2100 */
2528 || (bridge->vendor == PCI_VENDOR_ID_SERVERWORKS
2529 && bridge->device >=
2530 PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_FIRST
2531 && bridge->device <=
2532 PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_LAST)
2517 /* All Intel E5000 PCIE ports */ 2533 /* All Intel E5000 PCIE ports */
2518 || (bridge->vendor == PCI_VENDOR_ID_INTEL 2534 || (bridge->vendor == PCI_VENDOR_ID_INTEL
2519 && bridge->device >= 2535 && bridge->device >=
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 00ca0fdb837b..6ca4e4fa6b88 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -710,8 +710,8 @@ match:
710 tp->chipset, 710 tp->chipset,
711 rtl_chip_info[tp->chipset].name); 711 rtl_chip_info[tp->chipset].name);
712 712
713 i = register_netdev (dev); 713 rc = register_netdev (dev);
714 if (i) 714 if (rc)
715 goto err_out_unmap; 715 goto err_out_unmap;
716 716
717 DPRINTK ("EXIT, returning 0\n"); 717 DPRINTK ("EXIT, returning 0\n");
diff --git a/drivers/net/saa9730.c b/drivers/net/saa9730.c
index b269513cde45..143958f1ef0a 100644
--- a/drivers/net/saa9730.c
+++ b/drivers/net/saa9730.c
@@ -64,37 +64,37 @@ static unsigned int pci_irq_line;
64 64
65static void evm_saa9730_enable_lan_int(struct lan_saa9730_private *lp) 65static void evm_saa9730_enable_lan_int(struct lan_saa9730_private *lp)
66{ 66{
67 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT, 67 writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT,
68 &lp->evm_saa9730_regs->InterruptBlock1); 68 &lp->evm_saa9730_regs->InterruptBlock1);
69 outl(readl(&lp->evm_saa9730_regs->InterruptStatus1) | EVM_LAN_INT, 69 writel(readl(&lp->evm_saa9730_regs->InterruptStatus1) | EVM_LAN_INT,
70 &lp->evm_saa9730_regs->InterruptStatus1); 70 &lp->evm_saa9730_regs->InterruptStatus1);
71 outl(readl(&lp->evm_saa9730_regs->InterruptEnable1) | EVM_LAN_INT | 71 writel(readl(&lp->evm_saa9730_regs->InterruptEnable1) | EVM_LAN_INT |
72 EVM_MASTER_EN, &lp->evm_saa9730_regs->InterruptEnable1); 72 EVM_MASTER_EN, &lp->evm_saa9730_regs->InterruptEnable1);
73} 73}
74 74
75static void evm_saa9730_disable_lan_int(struct lan_saa9730_private *lp) 75static void evm_saa9730_disable_lan_int(struct lan_saa9730_private *lp)
76{ 76{
77 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT, 77 writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT,
78 &lp->evm_saa9730_regs->InterruptBlock1); 78 &lp->evm_saa9730_regs->InterruptBlock1);
79 outl(readl(&lp->evm_saa9730_regs->InterruptEnable1) & ~EVM_LAN_INT, 79 writel(readl(&lp->evm_saa9730_regs->InterruptEnable1) & ~EVM_LAN_INT,
80 &lp->evm_saa9730_regs->InterruptEnable1); 80 &lp->evm_saa9730_regs->InterruptEnable1);
81} 81}
82 82
83static void evm_saa9730_clear_lan_int(struct lan_saa9730_private *lp) 83static void evm_saa9730_clear_lan_int(struct lan_saa9730_private *lp)
84{ 84{
85 outl(EVM_LAN_INT, &lp->evm_saa9730_regs->InterruptStatus1); 85 writel(EVM_LAN_INT, &lp->evm_saa9730_regs->InterruptStatus1);
86} 86}
87 87
88static void evm_saa9730_block_lan_int(struct lan_saa9730_private *lp) 88static void evm_saa9730_block_lan_int(struct lan_saa9730_private *lp)
89{ 89{
90 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT, 90 writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT,
91 &lp->evm_saa9730_regs->InterruptBlock1); 91 &lp->evm_saa9730_regs->InterruptBlock1);
92} 92}
93 93
94static void evm_saa9730_unblock_lan_int(struct lan_saa9730_private *lp) 94static void evm_saa9730_unblock_lan_int(struct lan_saa9730_private *lp)
95{ 95{
96 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT, 96 writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT,
97 &lp->evm_saa9730_regs->InterruptBlock1); 97 &lp->evm_saa9730_regs->InterruptBlock1);
98} 98}
99 99
100static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp) 100static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp)
@@ -147,7 +147,7 @@ static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp)
147 printk("lp->lan_saa9730_regs->RxStatus = %x\n", 147 printk("lp->lan_saa9730_regs->RxStatus = %x\n",
148 readl(&lp->lan_saa9730_regs->RxStatus)); 148 readl(&lp->lan_saa9730_regs->RxStatus));
149 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) { 149 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) {
150 outl(i, &lp->lan_saa9730_regs->CamAddress); 150 writel(i, &lp->lan_saa9730_regs->CamAddress);
151 printk("lp->lan_saa9730_regs->CamData = %x\n", 151 printk("lp->lan_saa9730_regs->CamData = %x\n",
152 readl(&lp->lan_saa9730_regs->CamData)); 152 readl(&lp->lan_saa9730_regs->CamData));
153 } 153 }
@@ -288,28 +288,27 @@ static int lan_saa9730_allocate_buffers(struct pci_dev *pdev,
288 * Set rx buffer A and rx buffer B to point to the first two buffer 288 * Set rx buffer A and rx buffer B to point to the first two buffer
289 * spaces. 289 * spaces.
290 */ 290 */
291 outl(lp->dma_addr + rxoffset, 291 writel(lp->dma_addr + rxoffset, &lp->lan_saa9730_regs->RxBuffA);
292 &lp->lan_saa9730_regs->RxBuffA); 292 writel(lp->dma_addr + rxoffset +
293 outl(lp->dma_addr + rxoffset + 293 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_RCV_Q_SIZE,
294 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_RCV_Q_SIZE, 294 &lp->lan_saa9730_regs->RxBuffB);
295 &lp->lan_saa9730_regs->RxBuffB);
296 295
297 /* 296 /*
298 * Set txm_buf_a and txm_buf_b to point to the first two buffer 297 * Set txm_buf_a and txm_buf_b to point to the first two buffer
299 * space 298 * space
300 */ 299 */
301 outl(lp->dma_addr + txoffset, 300 writel(lp->dma_addr + txoffset,
302 &lp->lan_saa9730_regs->TxBuffA); 301 &lp->lan_saa9730_regs->TxBuffA);
303 outl(lp->dma_addr + txoffset + 302 writel(lp->dma_addr + txoffset +
304 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_TXM_Q_SIZE, 303 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_TXM_Q_SIZE,
305 &lp->lan_saa9730_regs->TxBuffB); 304 &lp->lan_saa9730_regs->TxBuffB);
306 305
307 /* Set packet number */ 306 /* Set packet number */
308 outl((lp->DmaRcvPackets << PK_COUNT_RX_A_SHF) | 307 writel((lp->DmaRcvPackets << PK_COUNT_RX_A_SHF) |
309 (lp->DmaRcvPackets << PK_COUNT_RX_B_SHF) | 308 (lp->DmaRcvPackets << PK_COUNT_RX_B_SHF) |
310 (lp->DmaTxmPackets << PK_COUNT_TX_A_SHF) | 309 (lp->DmaTxmPackets << PK_COUNT_TX_A_SHF) |
311 (lp->DmaTxmPackets << PK_COUNT_TX_B_SHF), 310 (lp->DmaTxmPackets << PK_COUNT_TX_B_SHF),
312 &lp->lan_saa9730_regs->PacketCount); 311 &lp->lan_saa9730_regs->PacketCount);
313 312
314 return 0; 313 return 0;
315 314
@@ -326,10 +325,10 @@ static int lan_saa9730_cam_load(struct lan_saa9730_private *lp)
326 325
327 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) { 326 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) {
328 /* First set address to where data is written */ 327 /* First set address to where data is written */
329 outl(i, &lp->lan_saa9730_regs->CamAddress); 328 writel(i, &lp->lan_saa9730_regs->CamAddress);
330 outl((NetworkAddress[0] << 24) | (NetworkAddress[1] << 16) 329 writel((NetworkAddress[0] << 24) | (NetworkAddress[1] << 16) |
331 | (NetworkAddress[2] << 8) | NetworkAddress[3], 330 (NetworkAddress[2] << 8) | NetworkAddress[3],
332 &lp->lan_saa9730_regs->CamData); 331 &lp->lan_saa9730_regs->CamData);
333 NetworkAddress += 4; 332 NetworkAddress += 4;
334 } 333 }
335 return 0; 334 return 0;
@@ -365,8 +364,8 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
365 } 364 }
366 365
367 /* Now set the control and address register. */ 366 /* Now set the control and address register. */
368 outl(MD_CA_BUSY | PHY_STATUS | PHY_ADDRESS << MD_CA_PHY_SHF, 367 writel(MD_CA_BUSY | PHY_STATUS | PHY_ADDRESS << MD_CA_PHY_SHF,
369 &lp->lan_saa9730_regs->StationMgmtCtl); 368 &lp->lan_saa9730_regs->StationMgmtCtl);
370 369
371 /* check link status, spin here till station is not busy */ 370 /* check link status, spin here till station is not busy */
372 i = 0; 371 i = 0;
@@ -391,23 +390,23 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
391 /* Link is down, reset the PHY first. */ 390 /* Link is down, reset the PHY first. */
392 391
393 /* set PHY address = 'CONTROL' */ 392 /* set PHY address = 'CONTROL' */
394 outl(PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | PHY_CONTROL, 393 writel(PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | PHY_CONTROL,
395 &lp->lan_saa9730_regs->StationMgmtCtl); 394 &lp->lan_saa9730_regs->StationMgmtCtl);
396 395
397 /* Wait for 1 ms. */ 396 /* Wait for 1 ms. */
398 mdelay(1); 397 mdelay(1);
399 398
400 /* set 'CONTROL' = force reset and renegotiate */ 399 /* set 'CONTROL' = force reset and renegotiate */
401 outl(PHY_CONTROL_RESET | PHY_CONTROL_AUTO_NEG | 400 writel(PHY_CONTROL_RESET | PHY_CONTROL_AUTO_NEG |
402 PHY_CONTROL_RESTART_AUTO_NEG, 401 PHY_CONTROL_RESTART_AUTO_NEG,
403 &lp->lan_saa9730_regs->StationMgmtData); 402 &lp->lan_saa9730_regs->StationMgmtData);
404 403
405 /* Wait for 50 ms. */ 404 /* Wait for 50 ms. */
406 mdelay(50); 405 mdelay(50);
407 406
408 /* set 'BUSY' to start operation */ 407 /* set 'BUSY' to start operation */
409 outl(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | 408 writel(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR |
410 PHY_CONTROL, &lp->lan_saa9730_regs->StationMgmtCtl); 409 PHY_CONTROL, &lp->lan_saa9730_regs->StationMgmtCtl);
411 410
412 /* await completion */ 411 /* await completion */
413 i = 0; 412 i = 0;
@@ -427,9 +426,9 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
427 426
428 for (l = 0; l < 2; l++) { 427 for (l = 0; l < 2; l++) {
429 /* set PHY address = 'STATUS' */ 428 /* set PHY address = 'STATUS' */
430 outl(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | 429 writel(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF |
431 PHY_STATUS, 430 PHY_STATUS,
432 &lp->lan_saa9730_regs->StationMgmtCtl); 431 &lp->lan_saa9730_regs->StationMgmtCtl);
433 432
434 /* await completion */ 433 /* await completion */
435 i = 0; 434 i = 0;
@@ -462,35 +461,35 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
462static int lan_saa9730_control_init(struct lan_saa9730_private *lp) 461static int lan_saa9730_control_init(struct lan_saa9730_private *lp)
463{ 462{
464 /* Initialize DMA control register. */ 463 /* Initialize DMA control register. */
465 outl((LANMB_ANY << DMA_CTL_MAX_XFER_SHF) | 464 writel((LANMB_ANY << DMA_CTL_MAX_XFER_SHF) |
466 (LANEND_LITTLE << DMA_CTL_ENDIAN_SHF) | 465 (LANEND_LITTLE << DMA_CTL_ENDIAN_SHF) |
467 (LAN_SAA9730_RCV_Q_INT_THRESHOLD << DMA_CTL_RX_INT_COUNT_SHF) 466 (LAN_SAA9730_RCV_Q_INT_THRESHOLD << DMA_CTL_RX_INT_COUNT_SHF)
468 | DMA_CTL_RX_INT_TO_EN | DMA_CTL_RX_INT_EN | 467 | DMA_CTL_RX_INT_TO_EN | DMA_CTL_RX_INT_EN |
469 DMA_CTL_MAC_RX_INT_EN | DMA_CTL_MAC_TX_INT_EN, 468 DMA_CTL_MAC_RX_INT_EN | DMA_CTL_MAC_TX_INT_EN,
470 &lp->lan_saa9730_regs->LanDmaCtl); 469 &lp->lan_saa9730_regs->LanDmaCtl);
471 470
472 /* Initial MAC control register. */ 471 /* Initial MAC control register. */
473 outl((MACCM_MII << MAC_CONTROL_CONN_SHF) | MAC_CONTROL_FULL_DUP, 472 writel((MACCM_MII << MAC_CONTROL_CONN_SHF) | MAC_CONTROL_FULL_DUP,
474 &lp->lan_saa9730_regs->MacCtl); 473 &lp->lan_saa9730_regs->MacCtl);
475 474
476 /* Initialize CAM control register. */ 475 /* Initialize CAM control register. */
477 outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_BROAD_ACC, 476 writel(CAM_CONTROL_COMP_EN | CAM_CONTROL_BROAD_ACC,
478 &lp->lan_saa9730_regs->CamCtl); 477 &lp->lan_saa9730_regs->CamCtl);
479 478
480 /* 479 /*
481 * Initialize CAM enable register, only turn on first entry, should 480 * Initialize CAM enable register, only turn on first entry, should
482 * contain own addr. 481 * contain own addr.
483 */ 482 */
484 outl(0x0001, &lp->lan_saa9730_regs->CamEnable); 483 writel(0x0001, &lp->lan_saa9730_regs->CamEnable);
485 484
486 /* Initialize Tx control register */ 485 /* Initialize Tx control register */
487 outl(TX_CTL_EN_COMP, &lp->lan_saa9730_regs->TxCtl); 486 writel(TX_CTL_EN_COMP, &lp->lan_saa9730_regs->TxCtl);
488 487
489 /* Initialize Rcv control register */ 488 /* Initialize Rcv control register */
490 outl(RX_CTL_STRIP_CRC, &lp->lan_saa9730_regs->RxCtl); 489 writel(RX_CTL_STRIP_CRC, &lp->lan_saa9730_regs->RxCtl);
491 490
492 /* Reset DMA engine */ 491 /* Reset DMA engine */
493 outl(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest); 492 writel(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest);
494 493
495 return 0; 494 return 0;
496} 495}
@@ -500,14 +499,14 @@ static int lan_saa9730_stop(struct lan_saa9730_private *lp)
500 int i; 499 int i;
501 500
502 /* Stop DMA first */ 501 /* Stop DMA first */
503 outl(readl(&lp->lan_saa9730_regs->LanDmaCtl) & 502 writel(readl(&lp->lan_saa9730_regs->LanDmaCtl) &
504 ~(DMA_CTL_EN_TX_DMA | DMA_CTL_EN_RX_DMA), 503 ~(DMA_CTL_EN_TX_DMA | DMA_CTL_EN_RX_DMA),
505 &lp->lan_saa9730_regs->LanDmaCtl); 504 &lp->lan_saa9730_regs->LanDmaCtl);
506 505
507 /* Set the SW Reset bits in DMA and MAC control registers */ 506 /* Set the SW Reset bits in DMA and MAC control registers */
508 outl(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest); 507 writel(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest);
509 outl(readl(&lp->lan_saa9730_regs->MacCtl) | MAC_CONTROL_RESET, 508 writel(readl(&lp->lan_saa9730_regs->MacCtl) | MAC_CONTROL_RESET,
510 &lp->lan_saa9730_regs->MacCtl); 509 &lp->lan_saa9730_regs->MacCtl);
511 510
512 /* 511 /*
513 * Wait for MAC reset to have finished. The reset bit is auto cleared 512 * Wait for MAC reset to have finished. The reset bit is auto cleared
@@ -532,8 +531,8 @@ static int lan_saa9730_dma_init(struct lan_saa9730_private *lp)
532 /* Stop lan controller. */ 531 /* Stop lan controller. */
533 lan_saa9730_stop(lp); 532 lan_saa9730_stop(lp);
534 533
535 outl(LAN_SAA9730_DEFAULT_TIME_OUT_CNT, 534 writel(LAN_SAA9730_DEFAULT_TIME_OUT_CNT,
536 &lp->lan_saa9730_regs->Timeout); 535 &lp->lan_saa9730_regs->Timeout);
537 536
538 return 0; 537 return 0;
539} 538}
@@ -552,19 +551,19 @@ static int lan_saa9730_start(struct lan_saa9730_private *lp)
552 lp->PendingTxmPacketIndex = 0; 551 lp->PendingTxmPacketIndex = 0;
553 lp->PendingTxmBufferIndex = 0; 552 lp->PendingTxmBufferIndex = 0;
554 553
555 outl(readl(&lp->lan_saa9730_regs->LanDmaCtl) | DMA_CTL_EN_TX_DMA | 554 writel(readl(&lp->lan_saa9730_regs->LanDmaCtl) | DMA_CTL_EN_TX_DMA |
556 DMA_CTL_EN_RX_DMA, &lp->lan_saa9730_regs->LanDmaCtl); 555 DMA_CTL_EN_RX_DMA, &lp->lan_saa9730_regs->LanDmaCtl);
557 556
558 /* For Tx, turn on MAC then DMA */ 557 /* For Tx, turn on MAC then DMA */
559 outl(readl(&lp->lan_saa9730_regs->TxCtl) | TX_CTL_TX_EN, 558 writel(readl(&lp->lan_saa9730_regs->TxCtl) | TX_CTL_TX_EN,
560 &lp->lan_saa9730_regs->TxCtl); 559 &lp->lan_saa9730_regs->TxCtl);
561 560
562 /* For Rx, turn on DMA then MAC */ 561 /* For Rx, turn on DMA then MAC */
563 outl(readl(&lp->lan_saa9730_regs->RxCtl) | RX_CTL_RX_EN, 562 writel(readl(&lp->lan_saa9730_regs->RxCtl) | RX_CTL_RX_EN,
564 &lp->lan_saa9730_regs->RxCtl); 563 &lp->lan_saa9730_regs->RxCtl);
565 564
566 /* Set Ok2Use to let hardware own the buffers. */ 565 /* Set Ok2Use to let hardware own the buffers. */
567 outl(OK2USE_RX_A | OK2USE_RX_B, &lp->lan_saa9730_regs->Ok2Use); 566 writel(OK2USE_RX_A | OK2USE_RX_B, &lp->lan_saa9730_regs->Ok2Use);
568 567
569 return 0; 568 return 0;
570} 569}
@@ -587,7 +586,7 @@ static int lan_saa9730_tx(struct net_device *dev)
587 printk("lan_saa9730_tx interrupt\n"); 586 printk("lan_saa9730_tx interrupt\n");
588 587
589 /* Clear interrupt. */ 588 /* Clear interrupt. */
590 outl(DMA_STATUS_MAC_TX_INT, &lp->lan_saa9730_regs->DmaStatus); 589 writel(DMA_STATUS_MAC_TX_INT, &lp->lan_saa9730_regs->DmaStatus);
591 590
592 while (1) { 591 while (1) {
593 pPacket = lp->TxmBuffer[lp->PendingTxmBufferIndex] 592 pPacket = lp->TxmBuffer[lp->PendingTxmBufferIndex]
@@ -660,8 +659,8 @@ static int lan_saa9730_rx(struct net_device *dev)
660 printk("lan_saa9730_rx interrupt\n"); 659 printk("lan_saa9730_rx interrupt\n");
661 660
662 /* Clear receive interrupts. */ 661 /* Clear receive interrupts. */
663 outl(DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT | 662 writel(DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT |
664 DMA_STATUS_RX_TO_INT, &lp->lan_saa9730_regs->DmaStatus); 663 DMA_STATUS_RX_TO_INT, &lp->lan_saa9730_regs->DmaStatus);
665 664
666 /* Address next packet */ 665 /* Address next packet */
667 BufferIndex = lp->NextRcvBufferIndex; 666 BufferIndex = lp->NextRcvBufferIndex;
@@ -725,8 +724,8 @@ static int lan_saa9730_rx(struct net_device *dev)
725 *pPacket = cpu_to_le32(RXSF_READY << RX_STAT_CTL_OWNER_SHF); 724 *pPacket = cpu_to_le32(RXSF_READY << RX_STAT_CTL_OWNER_SHF);
726 725
727 /* Make sure A or B is available to hardware as appropriate. */ 726 /* Make sure A or B is available to hardware as appropriate. */
728 outl(BufferIndex ? OK2USE_RX_B : OK2USE_RX_A, 727 writel(BufferIndex ? OK2USE_RX_B : OK2USE_RX_A,
729 &lp->lan_saa9730_regs->Ok2Use); 728 &lp->lan_saa9730_regs->Ok2Use);
730 729
731 /* Go to next packet in sequence. */ 730 /* Go to next packet in sequence. */
732 lp->NextRcvPacketIndex++; 731 lp->NextRcvPacketIndex++;
@@ -844,8 +843,8 @@ static int lan_saa9730_write(struct lan_saa9730_private *lp,
844 (len << TX_STAT_CTL_LENGTH_SHF)); 843 (len << TX_STAT_CTL_LENGTH_SHF));
845 844
846 /* Make sure A or B is available to hardware as appropriate. */ 845 /* Make sure A or B is available to hardware as appropriate. */
847 outl(BufferIndex ? OK2USE_TX_B : OK2USE_TX_A, 846 writel(BufferIndex ? OK2USE_TX_B : OK2USE_TX_A,
848 &lp->lan_saa9730_regs->Ok2Use); 847 &lp->lan_saa9730_regs->Ok2Use);
849 848
850 return 0; 849 return 0;
851} 850}
@@ -938,15 +937,15 @@ static void lan_saa9730_set_multicast(struct net_device *dev)
938 937
939 if (dev->flags & IFF_PROMISC) { 938 if (dev->flags & IFF_PROMISC) {
940 /* accept all packets */ 939 /* accept all packets */
941 outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_STATION_ACC | 940 writel(CAM_CONTROL_COMP_EN | CAM_CONTROL_STATION_ACC |
942 CAM_CONTROL_GROUP_ACC | CAM_CONTROL_BROAD_ACC, 941 CAM_CONTROL_GROUP_ACC | CAM_CONTROL_BROAD_ACC,
943 &lp->lan_saa9730_regs->CamCtl); 942 &lp->lan_saa9730_regs->CamCtl);
944 } else { 943 } else {
945 if (dev->flags & IFF_ALLMULTI) { 944 if (dev->flags & IFF_ALLMULTI) {
946 /* accept all multicast packets */ 945 /* accept all multicast packets */
947 outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_GROUP_ACC | 946 writel(CAM_CONTROL_COMP_EN | CAM_CONTROL_GROUP_ACC |
948 CAM_CONTROL_BROAD_ACC, 947 CAM_CONTROL_BROAD_ACC,
949 &lp->lan_saa9730_regs->CamCtl); 948 &lp->lan_saa9730_regs->CamCtl);
950 } else { 949 } else {
951 /* 950 /*
952 * Will handle the multicast stuff later. -carstenl 951 * Will handle the multicast stuff later. -carstenl
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8fecf1b817f7..39c6677dff5e 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -105,7 +105,8 @@ static const int txqaddr[] = { Q_XA1, Q_XA2 };
105static const int rxqaddr[] = { Q_R1, Q_R2 }; 105static const int rxqaddr[] = { Q_R1, Q_R2 };
106static const u32 rxirqmask[] = { IS_R1_F, IS_R2_F }; 106static const u32 rxirqmask[] = { IS_R1_F, IS_R2_F };
107static const u32 txirqmask[] = { IS_XA1_F, IS_XA2_F }; 107static const u32 txirqmask[] = { IS_XA1_F, IS_XA2_F };
108static const u32 irqmask[] = { IS_R1_F|IS_XA1_F, IS_R2_F|IS_XA2_F }; 108static const u32 napimask[] = { IS_R1_F|IS_XA1_F, IS_R2_F|IS_XA2_F };
109static const u32 portmask[] = { IS_PORT_1, IS_PORT_2 };
109 110
110static int skge_get_regs_len(struct net_device *dev) 111static int skge_get_regs_len(struct net_device *dev)
111{ 112{
@@ -671,7 +672,7 @@ static void skge_led(struct skge_port *skge, enum led_mode mode)
671 struct skge_hw *hw = skge->hw; 672 struct skge_hw *hw = skge->hw;
672 int port = skge->port; 673 int port = skge->port;
673 674
674 mutex_lock(&hw->phy_mutex); 675 spin_lock_bh(&hw->phy_lock);
675 if (hw->chip_id == CHIP_ID_GENESIS) { 676 if (hw->chip_id == CHIP_ID_GENESIS) {
676 switch (mode) { 677 switch (mode) {
677 case LED_MODE_OFF: 678 case LED_MODE_OFF:
@@ -742,7 +743,7 @@ static void skge_led(struct skge_port *skge, enum led_mode mode)
742 PHY_M_LED_MO_RX(MO_LED_ON)); 743 PHY_M_LED_MO_RX(MO_LED_ON));
743 } 744 }
744 } 745 }
745 mutex_unlock(&hw->phy_mutex); 746 spin_unlock_bh(&hw->phy_lock);
746} 747}
747 748
748/* blink LED's for finding board */ 749/* blink LED's for finding board */
@@ -1316,7 +1317,7 @@ static void xm_phy_init(struct skge_port *skge)
1316 xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl); 1317 xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl);
1317 1318
1318 /* Poll PHY for status changes */ 1319 /* Poll PHY for status changes */
1319 schedule_delayed_work(&skge->link_thread, LINK_HZ); 1320 mod_timer(&skge->link_timer, jiffies + LINK_HZ);
1320} 1321}
1321 1322
1322static void xm_check_link(struct net_device *dev) 1323static void xm_check_link(struct net_device *dev)
@@ -1391,10 +1392,9 @@ static void xm_check_link(struct net_device *dev)
1391 * Since internal PHY is wired to a level triggered pin, can't 1392 * Since internal PHY is wired to a level triggered pin, can't
1392 * get an interrupt when carrier is detected. 1393 * get an interrupt when carrier is detected.
1393 */ 1394 */
1394static void xm_link_timer(struct work_struct *work) 1395static void xm_link_timer(unsigned long arg)
1395{ 1396{
1396 struct skge_port *skge = 1397 struct skge_port *skge = (struct skge_port *) arg;
1397 container_of(work, struct skge_port, link_thread.work);
1398 struct net_device *dev = skge->netdev; 1398 struct net_device *dev = skge->netdev;
1399 struct skge_hw *hw = skge->hw; 1399 struct skge_hw *hw = skge->hw;
1400 int port = skge->port; 1400 int port = skge->port;
@@ -1414,13 +1414,13 @@ static void xm_link_timer(struct work_struct *work)
1414 goto nochange; 1414 goto nochange;
1415 } 1415 }
1416 1416
1417 mutex_lock(&hw->phy_mutex); 1417 spin_lock(&hw->phy_lock);
1418 xm_check_link(dev); 1418 xm_check_link(dev);
1419 mutex_unlock(&hw->phy_mutex); 1419 spin_unlock(&hw->phy_lock);
1420 1420
1421nochange: 1421nochange:
1422 if (netif_running(dev)) 1422 if (netif_running(dev))
1423 schedule_delayed_work(&skge->link_thread, LINK_HZ); 1423 mod_timer(&skge->link_timer, jiffies + LINK_HZ);
1424} 1424}
1425 1425
1426static void genesis_mac_init(struct skge_hw *hw, int port) 1426static void genesis_mac_init(struct skge_hw *hw, int port)
@@ -2323,7 +2323,7 @@ static void skge_phy_reset(struct skge_port *skge)
2323 netif_stop_queue(skge->netdev); 2323 netif_stop_queue(skge->netdev);
2324 netif_carrier_off(skge->netdev); 2324 netif_carrier_off(skge->netdev);
2325 2325
2326 mutex_lock(&hw->phy_mutex); 2326 spin_lock_bh(&hw->phy_lock);
2327 if (hw->chip_id == CHIP_ID_GENESIS) { 2327 if (hw->chip_id == CHIP_ID_GENESIS) {
2328 genesis_reset(hw, port); 2328 genesis_reset(hw, port);
2329 genesis_mac_init(hw, port); 2329 genesis_mac_init(hw, port);
@@ -2331,7 +2331,7 @@ static void skge_phy_reset(struct skge_port *skge)
2331 yukon_reset(hw, port); 2331 yukon_reset(hw, port);
2332 yukon_init(hw, port); 2332 yukon_init(hw, port);
2333 } 2333 }
2334 mutex_unlock(&hw->phy_mutex); 2334 spin_unlock_bh(&hw->phy_lock);
2335 2335
2336 dev->set_multicast_list(dev); 2336 dev->set_multicast_list(dev);
2337} 2337}
@@ -2354,12 +2354,12 @@ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2354 /* fallthru */ 2354 /* fallthru */
2355 case SIOCGMIIREG: { 2355 case SIOCGMIIREG: {
2356 u16 val = 0; 2356 u16 val = 0;
2357 mutex_lock(&hw->phy_mutex); 2357 spin_lock_bh(&hw->phy_lock);
2358 if (hw->chip_id == CHIP_ID_GENESIS) 2358 if (hw->chip_id == CHIP_ID_GENESIS)
2359 err = __xm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val); 2359 err = __xm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val);
2360 else 2360 else
2361 err = __gm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val); 2361 err = __gm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val);
2362 mutex_unlock(&hw->phy_mutex); 2362 spin_unlock_bh(&hw->phy_lock);
2363 data->val_out = val; 2363 data->val_out = val;
2364 break; 2364 break;
2365 } 2365 }
@@ -2368,14 +2368,14 @@ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2368 if (!capable(CAP_NET_ADMIN)) 2368 if (!capable(CAP_NET_ADMIN))
2369 return -EPERM; 2369 return -EPERM;
2370 2370
2371 mutex_lock(&hw->phy_mutex); 2371 spin_lock_bh(&hw->phy_lock);
2372 if (hw->chip_id == CHIP_ID_GENESIS) 2372 if (hw->chip_id == CHIP_ID_GENESIS)
2373 err = xm_phy_write(hw, skge->port, data->reg_num & 0x1f, 2373 err = xm_phy_write(hw, skge->port, data->reg_num & 0x1f,
2374 data->val_in); 2374 data->val_in);
2375 else 2375 else
2376 err = gm_phy_write(hw, skge->port, data->reg_num & 0x1f, 2376 err = gm_phy_write(hw, skge->port, data->reg_num & 0x1f,
2377 data->val_in); 2377 data->val_in);
2378 mutex_unlock(&hw->phy_mutex); 2378 spin_unlock_bh(&hw->phy_lock);
2379 break; 2379 break;
2380 } 2380 }
2381 return err; 2381 return err;
@@ -2481,12 +2481,12 @@ static int skge_up(struct net_device *dev)
2481 goto free_rx_ring; 2481 goto free_rx_ring;
2482 2482
2483 /* Initialize MAC */ 2483 /* Initialize MAC */
2484 mutex_lock(&hw->phy_mutex); 2484 spin_lock_bh(&hw->phy_lock);
2485 if (hw->chip_id == CHIP_ID_GENESIS) 2485 if (hw->chip_id == CHIP_ID_GENESIS)
2486 genesis_mac_init(hw, port); 2486 genesis_mac_init(hw, port);
2487 else 2487 else
2488 yukon_mac_init(hw, port); 2488 yukon_mac_init(hw, port);
2489 mutex_unlock(&hw->phy_mutex); 2489 spin_unlock_bh(&hw->phy_lock);
2490 2490
2491 /* Configure RAMbuffers */ 2491 /* Configure RAMbuffers */
2492 chunk = hw->ram_size / ((hw->ports + 1)*2); 2492 chunk = hw->ram_size / ((hw->ports + 1)*2);
@@ -2504,6 +2504,11 @@ static int skge_up(struct net_device *dev)
2504 skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); 2504 skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_START | CSR_IRQ_CL_F);
2505 skge_led(skge, LED_MODE_ON); 2505 skge_led(skge, LED_MODE_ON);
2506 2506
2507 spin_lock_irq(&hw->hw_lock);
2508 hw->intr_mask |= portmask[port];
2509 skge_write32(hw, B0_IMSK, hw->intr_mask);
2510 spin_unlock_irq(&hw->hw_lock);
2511
2507 netif_poll_enable(dev); 2512 netif_poll_enable(dev);
2508 return 0; 2513 return 0;
2509 2514
@@ -2531,7 +2536,14 @@ static int skge_down(struct net_device *dev)
2531 2536
2532 netif_stop_queue(dev); 2537 netif_stop_queue(dev);
2533 if (hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC) 2538 if (hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC)
2534 cancel_delayed_work(&skge->link_thread); 2539 del_timer_sync(&skge->link_timer);
2540
2541 netif_poll_disable(dev);
2542
2543 spin_lock_irq(&hw->hw_lock);
2544 hw->intr_mask &= ~portmask[port];
2545 skge_write32(hw, B0_IMSK, hw->intr_mask);
2546 spin_unlock_irq(&hw->hw_lock);
2535 2547
2536 skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF); 2548 skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF);
2537 if (hw->chip_id == CHIP_ID_GENESIS) 2549 if (hw->chip_id == CHIP_ID_GENESIS)
@@ -2575,8 +2587,10 @@ static int skge_down(struct net_device *dev)
2575 2587
2576 skge_led(skge, LED_MODE_OFF); 2588 skge_led(skge, LED_MODE_OFF);
2577 2589
2578 netif_poll_disable(dev); 2590 netif_tx_lock_bh(dev);
2579 skge_tx_clean(dev); 2591 skge_tx_clean(dev);
2592 netif_tx_unlock_bh(dev);
2593
2580 skge_rx_clean(skge); 2594 skge_rx_clean(skge);
2581 2595
2582 kfree(skge->rx_ring.start); 2596 kfree(skge->rx_ring.start);
@@ -2721,7 +2735,6 @@ static void skge_tx_clean(struct net_device *dev)
2721 struct skge_port *skge = netdev_priv(dev); 2735 struct skge_port *skge = netdev_priv(dev);
2722 struct skge_element *e; 2736 struct skge_element *e;
2723 2737
2724 netif_tx_lock_bh(dev);
2725 for (e = skge->tx_ring.to_clean; e != skge->tx_ring.to_use; e = e->next) { 2738 for (e = skge->tx_ring.to_clean; e != skge->tx_ring.to_use; e = e->next) {
2726 struct skge_tx_desc *td = e->desc; 2739 struct skge_tx_desc *td = e->desc;
2727 skge_tx_free(skge, e, td->control); 2740 skge_tx_free(skge, e, td->control);
@@ -2730,7 +2743,6 @@ static void skge_tx_clean(struct net_device *dev)
2730 2743
2731 skge->tx_ring.to_clean = e; 2744 skge->tx_ring.to_clean = e;
2732 netif_wake_queue(dev); 2745 netif_wake_queue(dev);
2733 netif_tx_unlock_bh(dev);
2734} 2746}
2735 2747
2736static void skge_tx_timeout(struct net_device *dev) 2748static void skge_tx_timeout(struct net_device *dev)
@@ -3049,7 +3061,7 @@ static int skge_poll(struct net_device *dev, int *budget)
3049 3061
3050 spin_lock_irqsave(&hw->hw_lock, flags); 3062 spin_lock_irqsave(&hw->hw_lock, flags);
3051 __netif_rx_complete(dev); 3063 __netif_rx_complete(dev);
3052 hw->intr_mask |= irqmask[skge->port]; 3064 hw->intr_mask |= napimask[skge->port];
3053 skge_write32(hw, B0_IMSK, hw->intr_mask); 3065 skge_write32(hw, B0_IMSK, hw->intr_mask);
3054 skge_read32(hw, B0_IMSK); 3066 skge_read32(hw, B0_IMSK);
3055 spin_unlock_irqrestore(&hw->hw_lock, flags); 3067 spin_unlock_irqrestore(&hw->hw_lock, flags);
@@ -3160,28 +3172,29 @@ static void skge_error_irq(struct skge_hw *hw)
3160} 3172}
3161 3173
3162/* 3174/*
3163 * Interrupt from PHY are handled in work queue 3175 * Interrupt from PHY are handled in tasklet (softirq)
3164 * because accessing phy registers requires spin wait which might 3176 * because accessing phy registers requires spin wait which might
3165 * cause excess interrupt latency. 3177 * cause excess interrupt latency.
3166 */ 3178 */
3167static void skge_extirq(struct work_struct *work) 3179static void skge_extirq(unsigned long arg)
3168{ 3180{
3169 struct skge_hw *hw = container_of(work, struct skge_hw, phy_work); 3181 struct skge_hw *hw = (struct skge_hw *) arg;
3170 int port; 3182 int port;
3171 3183
3172 mutex_lock(&hw->phy_mutex);
3173 for (port = 0; port < hw->ports; port++) { 3184 for (port = 0; port < hw->ports; port++) {
3174 struct net_device *dev = hw->dev[port]; 3185 struct net_device *dev = hw->dev[port];
3175 struct skge_port *skge = netdev_priv(dev);
3176 3186
3177 if (netif_running(dev)) { 3187 if (netif_running(dev)) {
3188 struct skge_port *skge = netdev_priv(dev);
3189
3190 spin_lock(&hw->phy_lock);
3178 if (hw->chip_id != CHIP_ID_GENESIS) 3191 if (hw->chip_id != CHIP_ID_GENESIS)
3179 yukon_phy_intr(skge); 3192 yukon_phy_intr(skge);
3180 else if (hw->phy_type == SK_PHY_BCOM) 3193 else if (hw->phy_type == SK_PHY_BCOM)
3181 bcom_phy_intr(skge); 3194 bcom_phy_intr(skge);
3195 spin_unlock(&hw->phy_lock);
3182 } 3196 }
3183 } 3197 }
3184 mutex_unlock(&hw->phy_mutex);
3185 3198
3186 spin_lock_irq(&hw->hw_lock); 3199 spin_lock_irq(&hw->hw_lock);
3187 hw->intr_mask |= IS_EXT_REG; 3200 hw->intr_mask |= IS_EXT_REG;
@@ -3206,7 +3219,7 @@ static irqreturn_t skge_intr(int irq, void *dev_id)
3206 status &= hw->intr_mask; 3219 status &= hw->intr_mask;
3207 if (status & IS_EXT_REG) { 3220 if (status & IS_EXT_REG) {
3208 hw->intr_mask &= ~IS_EXT_REG; 3221 hw->intr_mask &= ~IS_EXT_REG;
3209 schedule_work(&hw->phy_work); 3222 tasklet_schedule(&hw->phy_task);
3210 } 3223 }
3211 3224
3212 if (status & (IS_XA1_F|IS_R1_F)) { 3225 if (status & (IS_XA1_F|IS_R1_F)) {
@@ -3282,23 +3295,28 @@ static int skge_set_mac_address(struct net_device *dev, void *p)
3282 3295
3283 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 3296 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
3284 3297
3285 /* disable Rx */ 3298 if (!netif_running(dev)) {
3286 ctrl = gma_read16(hw, port, GM_GP_CTRL); 3299 memcpy_toio(hw->regs + B2_MAC_1 + port*8, dev->dev_addr, ETH_ALEN);
3287 gma_write16(hw, port, GM_GP_CTRL, ctrl & ~GM_GPCR_RX_ENA); 3300 memcpy_toio(hw->regs + B2_MAC_2 + port*8, dev->dev_addr, ETH_ALEN);
3301 } else {
3302 /* disable Rx */
3303 spin_lock_bh(&hw->phy_lock);
3304 ctrl = gma_read16(hw, port, GM_GP_CTRL);
3305 gma_write16(hw, port, GM_GP_CTRL, ctrl & ~GM_GPCR_RX_ENA);
3288 3306
3289 memcpy_toio(hw->regs + B2_MAC_1 + port*8, dev->dev_addr, ETH_ALEN); 3307 memcpy_toio(hw->regs + B2_MAC_1 + port*8, dev->dev_addr, ETH_ALEN);
3290 memcpy_toio(hw->regs + B2_MAC_2 + port*8, dev->dev_addr, ETH_ALEN); 3308 memcpy_toio(hw->regs + B2_MAC_2 + port*8, dev->dev_addr, ETH_ALEN);
3291 3309
3292 if (netif_running(dev)) {
3293 if (hw->chip_id == CHIP_ID_GENESIS) 3310 if (hw->chip_id == CHIP_ID_GENESIS)
3294 xm_outaddr(hw, port, XM_SA, dev->dev_addr); 3311 xm_outaddr(hw, port, XM_SA, dev->dev_addr);
3295 else { 3312 else {
3296 gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); 3313 gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr);
3297 gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); 3314 gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr);
3298 } 3315 }
3299 }
3300 3316
3301 gma_write16(hw, port, GM_GP_CTRL, ctrl); 3317 gma_write16(hw, port, GM_GP_CTRL, ctrl);
3318 spin_unlock_bh(&hw->phy_lock);
3319 }
3302 3320
3303 return 0; 3321 return 0;
3304} 3322}
@@ -3413,10 +3431,9 @@ static int skge_reset(struct skge_hw *hw)
3413 else 3431 else
3414 hw->ram_size = t8 * 4096; 3432 hw->ram_size = t8 * 4096;
3415 3433
3416 hw->intr_mask = IS_HW_ERR | IS_PORT_1; 3434 hw->intr_mask = IS_HW_ERR;
3417 if (hw->ports > 1)
3418 hw->intr_mask |= IS_PORT_2;
3419 3435
3436 /* Use PHY IRQ for all but fiber based Genesis board */
3420 if (!(hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC)) 3437 if (!(hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC))
3421 hw->intr_mask |= IS_EXT_REG; 3438 hw->intr_mask |= IS_EXT_REG;
3422 3439
@@ -3484,14 +3501,12 @@ static int skge_reset(struct skge_hw *hw)
3484 3501
3485 skge_write32(hw, B0_IMSK, hw->intr_mask); 3502 skge_write32(hw, B0_IMSK, hw->intr_mask);
3486 3503
3487 mutex_lock(&hw->phy_mutex);
3488 for (i = 0; i < hw->ports; i++) { 3504 for (i = 0; i < hw->ports; i++) {
3489 if (hw->chip_id == CHIP_ID_GENESIS) 3505 if (hw->chip_id == CHIP_ID_GENESIS)
3490 genesis_reset(hw, i); 3506 genesis_reset(hw, i);
3491 else 3507 else
3492 yukon_reset(hw, i); 3508 yukon_reset(hw, i);
3493 } 3509 }
3494 mutex_unlock(&hw->phy_mutex);
3495 3510
3496 return 0; 3511 return 0;
3497} 3512}
@@ -3539,6 +3554,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
3539 skge->netdev = dev; 3554 skge->netdev = dev;
3540 skge->hw = hw; 3555 skge->hw = hw;
3541 skge->msg_enable = netif_msg_init(debug, default_msg); 3556 skge->msg_enable = netif_msg_init(debug, default_msg);
3557
3542 skge->tx_ring.count = DEFAULT_TX_RING_SIZE; 3558 skge->tx_ring.count = DEFAULT_TX_RING_SIZE;
3543 skge->rx_ring.count = DEFAULT_RX_RING_SIZE; 3559 skge->rx_ring.count = DEFAULT_RX_RING_SIZE;
3544 3560
@@ -3555,7 +3571,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
3555 skge->port = port; 3571 skge->port = port;
3556 3572
3557 /* Only used for Genesis XMAC */ 3573 /* Only used for Genesis XMAC */
3558 INIT_DELAYED_WORK(&skge->link_thread, xm_link_timer); 3574 setup_timer(&skge->link_timer, xm_link_timer, (unsigned long) skge);
3559 3575
3560 if (hw->chip_id != CHIP_ID_GENESIS) { 3576 if (hw->chip_id != CHIP_ID_GENESIS) {
3561 dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; 3577 dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
@@ -3637,9 +3653,9 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3637 } 3653 }
3638 3654
3639 hw->pdev = pdev; 3655 hw->pdev = pdev;
3640 mutex_init(&hw->phy_mutex);
3641 INIT_WORK(&hw->phy_work, skge_extirq);
3642 spin_lock_init(&hw->hw_lock); 3656 spin_lock_init(&hw->hw_lock);
3657 spin_lock_init(&hw->phy_lock);
3658 tasklet_init(&hw->phy_task, &skge_extirq, (unsigned long) hw);
3643 3659
3644 hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); 3660 hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000);
3645 if (!hw->regs) { 3661 if (!hw->regs) {
@@ -3725,6 +3741,8 @@ static void __devexit skge_remove(struct pci_dev *pdev)
3725 dev0 = hw->dev[0]; 3741 dev0 = hw->dev[0];
3726 unregister_netdev(dev0); 3742 unregister_netdev(dev0);
3727 3743
3744 tasklet_disable(&hw->phy_task);
3745
3728 spin_lock_irq(&hw->hw_lock); 3746 spin_lock_irq(&hw->hw_lock);
3729 hw->intr_mask = 0; 3747 hw->intr_mask = 0;
3730 skge_write32(hw, B0_IMSK, 0); 3748 skge_write32(hw, B0_IMSK, 0);
diff --git a/drivers/net/skge.h b/drivers/net/skge.h
index e9354dfa7e9a..86467ae74d45 100644
--- a/drivers/net/skge.h
+++ b/drivers/net/skge.h
@@ -2424,8 +2424,8 @@ struct skge_hw {
2424 u32 ram_size; 2424 u32 ram_size;
2425 u32 ram_offset; 2425 u32 ram_offset;
2426 u16 phy_addr; 2426 u16 phy_addr;
2427 struct work_struct phy_work; 2427 spinlock_t phy_lock;
2428 struct mutex phy_mutex; 2428 struct tasklet_struct phy_task;
2429}; 2429};
2430 2430
2431enum pause_control { 2431enum pause_control {
@@ -2457,7 +2457,7 @@ struct skge_port {
2457 2457
2458 struct net_device_stats net_stats; 2458 struct net_device_stats net_stats;
2459 2459
2460 struct delayed_work link_thread; 2460 struct timer_list link_timer;
2461 enum pause_control flow_control; 2461 enum pause_control flow_control;
2462 enum pause_status flow_status; 2462 enum pause_status flow_status;
2463 u8 rx_csum; 2463 u8 rx_csum;
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index dab88b958d6e..639e1e6913bf 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3607,7 +3607,6 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
3607 if (bd == ugeth->confBd[txQ]) { 3607 if (bd == ugeth->confBd[txQ]) {
3608 if (!netif_queue_stopped(dev)) 3608 if (!netif_queue_stopped(dev))
3609 netif_stop_queue(dev); 3609 netif_stop_queue(dev);
3610 return NETDEV_TX_BUSY;
3611 } 3610 }
3612 3611
3613 ugeth->txBd[txQ] = bd; 3612 ugeth->txBd[txQ] = bd;
@@ -3623,7 +3622,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
3623 3622
3624 spin_unlock_irq(&ugeth->lock); 3623 spin_unlock_irq(&ugeth->lock);
3625 3624
3626 return NETDEV_TX_OK; 3625 return 0;
3627} 3626}
3628 3627
3629static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit) 3628static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit)
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index 5026b345cb30..57e6ab1004d0 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -451,7 +451,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
451 return -EINVAL; 451 return -EINVAL;
452 452
453 if(!pnp_can_configure(dev)) { 453 if(!pnp_can_configure(dev)) {
454 pnp_info("Device %s does not support resource configuration.", dev->dev.bus_id); 454 pnp_dbg("Device %s does not support resource configuration.", dev->dev.bus_id);
455 return -ENODEV; 455 return -ENODEV;
456 } 456 }
457 457
@@ -482,7 +482,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
482int pnp_start_dev(struct pnp_dev *dev) 482int pnp_start_dev(struct pnp_dev *dev)
483{ 483{
484 if (!pnp_can_write(dev)) { 484 if (!pnp_can_write(dev)) {
485 pnp_info("Device %s does not support activation.", dev->dev.bus_id); 485 pnp_dbg("Device %s does not support activation.", dev->dev.bus_id);
486 return -EINVAL; 486 return -EINVAL;
487 } 487 }
488 488
@@ -506,7 +506,7 @@ int pnp_start_dev(struct pnp_dev *dev)
506int pnp_stop_dev(struct pnp_dev *dev) 506int pnp_stop_dev(struct pnp_dev *dev)
507{ 507{
508 if (!pnp_can_disable(dev)) { 508 if (!pnp_can_disable(dev)) {
509 pnp_info("Device %s does not support disabling.", dev->dev.bus_id); 509 pnp_dbg("Device %s does not support disabling.", dev->dev.bus_id);
510 return -EINVAL; 510 return -EINVAL;
511 } 511 }
512 if (dev->protocol->disable(dev)<0) { 512 if (dev->protocol->disable(dev)<0) {
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 5b1e3ff26c0b..05fac0733f3d 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -210,9 +210,11 @@ again:
210 goto again; 210 goto again;
211 } 211 }
212 if (rc < 0) { 212 if (rc < 0) {
213 QDIO_DBF_TEXT3(1,trace,"sqberr"); 213 QDIO_DBF_TEXT3(1,trace,"sqberr");
214 sprintf(dbf_text,"%2x,%2x,%d,%d",tmp_cnt,*cnt,ccq,q_no); 214 sprintf(dbf_text,"%2x,%2x",tmp_cnt,*cnt);
215 QDIO_DBF_TEXT3(1,trace,dbf_text); 215 QDIO_DBF_TEXT3(1,trace,dbf_text);
216 sprintf(dbf_text,"%d,%d",ccq,q_no);
217 QDIO_DBF_TEXT3(1,trace,dbf_text);
216 q->handler(q->cdev,QDIO_STATUS_ACTIVATE_CHECK_CONDITION| 218 q->handler(q->cdev,QDIO_STATUS_ACTIVATE_CHECK_CONDITION|
217 QDIO_STATUS_LOOK_FOR_ERROR, 219 QDIO_STATUS_LOOK_FOR_ERROR,
218 0, 0, 0, -1, -1, q->int_parm); 220 0, 0, 0, -1, -1, q->int_parm);
@@ -1250,7 +1252,6 @@ qdio_is_inbound_q_done(struct qdio_q *q)
1250 if (!no_used) { 1252 if (!no_used) {
1251 QDIO_DBF_TEXT4(0,trace,"inqisdnA"); 1253 QDIO_DBF_TEXT4(0,trace,"inqisdnA");
1252 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); 1254 QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
1253 QDIO_DBF_TEXT4(0,trace,dbf_text);
1254 return 1; 1255 return 1;
1255 } 1256 }
1256 if (irq->is_qebsm) { 1257 if (irq->is_qebsm) {
@@ -3371,10 +3372,15 @@ qdio_do_qdio_fill_input(struct qdio_q *q, unsigned int qidx,
3371 unsigned int count, struct qdio_buffer *buffers) 3372 unsigned int count, struct qdio_buffer *buffers)
3372{ 3373{
3373 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; 3374 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr;
3375 int tmp = 0;
3376
3374 qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); 3377 qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1);
3375 if (irq->is_qebsm) { 3378 if (irq->is_qebsm) {
3376 while (count) 3379 while (count) {
3377 set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count); 3380 tmp = set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count);
3381 if (!tmp)
3382 return;
3383 }
3378 return; 3384 return;
3379 } 3385 }
3380 for (;;) { 3386 for (;;) {
@@ -3390,11 +3396,15 @@ qdio_do_qdio_fill_output(struct qdio_q *q, unsigned int qidx,
3390 unsigned int count, struct qdio_buffer *buffers) 3396 unsigned int count, struct qdio_buffer *buffers)
3391{ 3397{
3392 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; 3398 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr;
3399 int tmp = 0;
3393 3400
3394 qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); 3401 qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1);
3395 if (irq->is_qebsm) { 3402 if (irq->is_qebsm) {
3396 while (count) 3403 while (count) {
3397 set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count); 3404 tmp = set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count);
3405 if (!tmp)
3406 return;
3407 }
3398 return; 3408 return;
3399 } 3409 }
3400 3410
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index c7d1355237b6..181b51772b1b 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -65,6 +65,8 @@ module_param_named(poll_thread, ap_thread_flag, int, 0000);
65MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 1 (on)."); 65MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 1 (on).");
66 66
67static struct device *ap_root_device = NULL; 67static struct device *ap_root_device = NULL;
68static DEFINE_SPINLOCK(ap_device_lock);
69static LIST_HEAD(ap_device_list);
68 70
69/** 71/**
70 * Workqueue & timer for bus rescan. 72 * Workqueue & timer for bus rescan.
@@ -457,6 +459,9 @@ static int ap_device_probe(struct device *dev)
457 int rc; 459 int rc;
458 460
459 ap_dev->drv = ap_drv; 461 ap_dev->drv = ap_drv;
462 spin_lock_bh(&ap_device_lock);
463 list_add(&ap_dev->list, &ap_device_list);
464 spin_unlock_bh(&ap_device_lock);
460 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; 465 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
461 return rc; 466 return rc;
462} 467}
@@ -497,6 +502,9 @@ static int ap_device_remove(struct device *dev)
497 ap_flush_queue(ap_dev); 502 ap_flush_queue(ap_dev);
498 if (ap_drv->remove) 503 if (ap_drv->remove)
499 ap_drv->remove(ap_dev); 504 ap_drv->remove(ap_dev);
505 spin_lock_bh(&ap_device_lock);
506 list_del_init(&ap_dev->list);
507 spin_unlock_bh(&ap_device_lock);
500 return 0; 508 return 0;
501} 509}
502 510
@@ -772,6 +780,7 @@ static void ap_scan_bus(struct work_struct *unused)
772 spin_lock_init(&ap_dev->lock); 780 spin_lock_init(&ap_dev->lock);
773 INIT_LIST_HEAD(&ap_dev->pendingq); 781 INIT_LIST_HEAD(&ap_dev->pendingq);
774 INIT_LIST_HEAD(&ap_dev->requestq); 782 INIT_LIST_HEAD(&ap_dev->requestq);
783 INIT_LIST_HEAD(&ap_dev->list);
775 if (device_type == 0) 784 if (device_type == 0)
776 ap_probe_device_type(ap_dev); 785 ap_probe_device_type(ap_dev);
777 else 786 else
@@ -1033,14 +1042,13 @@ static void ap_poll_timeout(unsigned long unused)
1033 * polling until bit 2^0 of the control flags is not set. If bit 2^1 1042 * polling until bit 2^0 of the control flags is not set. If bit 2^1
1034 * of the control flags has been set arm the poll timer. 1043 * of the control flags has been set arm the poll timer.
1035 */ 1044 */
1036static int __ap_poll_all(struct device *dev, void *data) 1045static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags)
1037{ 1046{
1038 struct ap_device *ap_dev = to_ap_dev(dev);
1039 int rc; 1047 int rc;
1040 1048
1041 spin_lock(&ap_dev->lock); 1049 spin_lock(&ap_dev->lock);
1042 if (!ap_dev->unregistered) { 1050 if (!ap_dev->unregistered) {
1043 rc = ap_poll_queue(to_ap_dev(dev), (unsigned long *) data); 1051 rc = ap_poll_queue(ap_dev, flags);
1044 if (rc) 1052 if (rc)
1045 ap_dev->unregistered = 1; 1053 ap_dev->unregistered = 1;
1046 } else 1054 } else
@@ -1054,10 +1062,15 @@ static int __ap_poll_all(struct device *dev, void *data)
1054static void ap_poll_all(unsigned long dummy) 1062static void ap_poll_all(unsigned long dummy)
1055{ 1063{
1056 unsigned long flags; 1064 unsigned long flags;
1065 struct ap_device *ap_dev;
1057 1066
1058 do { 1067 do {
1059 flags = 0; 1068 flags = 0;
1060 bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all); 1069 spin_lock(&ap_device_lock);
1070 list_for_each_entry(ap_dev, &ap_device_list, list) {
1071 __ap_poll_all(ap_dev, &flags);
1072 }
1073 spin_unlock(&ap_device_lock);
1061 } while (flags & 1); 1074 } while (flags & 1);
1062 if (flags & 2) 1075 if (flags & 2)
1063 ap_schedule_poll_timer(); 1076 ap_schedule_poll_timer();
@@ -1075,6 +1088,7 @@ static int ap_poll_thread(void *data)
1075 DECLARE_WAITQUEUE(wait, current); 1088 DECLARE_WAITQUEUE(wait, current);
1076 unsigned long flags; 1089 unsigned long flags;
1077 int requests; 1090 int requests;
1091 struct ap_device *ap_dev;
1078 1092
1079 set_user_nice(current, 19); 1093 set_user_nice(current, 19);
1080 while (1) { 1094 while (1) {
@@ -1092,10 +1106,12 @@ static int ap_poll_thread(void *data)
1092 set_current_state(TASK_RUNNING); 1106 set_current_state(TASK_RUNNING);
1093 remove_wait_queue(&ap_poll_wait, &wait); 1107 remove_wait_queue(&ap_poll_wait, &wait);
1094 1108
1095 local_bh_disable();
1096 flags = 0; 1109 flags = 0;
1097 bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all); 1110 spin_lock_bh(&ap_device_lock);
1098 local_bh_enable(); 1111 list_for_each_entry(ap_dev, &ap_device_list, list) {
1112 __ap_poll_all(ap_dev, &flags);
1113 }
1114 spin_unlock_bh(&ap_device_lock);
1099 } 1115 }
1100 set_current_state(TASK_RUNNING); 1116 set_current_state(TASK_RUNNING);
1101 remove_wait_queue(&ap_poll_wait, &wait); 1117 remove_wait_queue(&ap_poll_wait, &wait);
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h
index 83b69c01cd6e..008559ea742b 100644
--- a/drivers/s390/crypto/ap_bus.h
+++ b/drivers/s390/crypto/ap_bus.h
@@ -106,6 +106,7 @@ struct ap_device {
106 struct device device; 106 struct device device;
107 struct ap_driver *drv; /* Pointer to AP device driver. */ 107 struct ap_driver *drv; /* Pointer to AP device driver. */
108 spinlock_t lock; /* Per device lock. */ 108 spinlock_t lock; /* Per device lock. */
109 struct list_head list; /* private list of all AP devices. */
109 110
110 ap_qid_t qid; /* AP queue id. */ 111 ap_qid_t qid; /* AP queue id. */
111 int queue_depth; /* AP queue depth.*/ 112 int queue_depth; /* AP queue depth.*/
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index 99761391f340..e3625a47a596 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -298,14 +298,14 @@ static long zcrypt_rsa_modexpo(struct ica_rsa_modexpo *mex)
298 get_device(&zdev->ap_dev->device); 298 get_device(&zdev->ap_dev->device);
299 zdev->request_count++; 299 zdev->request_count++;
300 __zcrypt_decrease_preference(zdev); 300 __zcrypt_decrease_preference(zdev);
301 spin_unlock_bh(&zcrypt_device_lock);
302 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { 301 if (try_module_get(zdev->ap_dev->drv->driver.owner)) {
302 spin_unlock_bh(&zcrypt_device_lock);
303 rc = zdev->ops->rsa_modexpo(zdev, mex); 303 rc = zdev->ops->rsa_modexpo(zdev, mex);
304 spin_lock_bh(&zcrypt_device_lock);
304 module_put(zdev->ap_dev->drv->driver.owner); 305 module_put(zdev->ap_dev->drv->driver.owner);
305 } 306 }
306 else 307 else
307 rc = -EAGAIN; 308 rc = -EAGAIN;
308 spin_lock_bh(&zcrypt_device_lock);
309 zdev->request_count--; 309 zdev->request_count--;
310 __zcrypt_increase_preference(zdev); 310 __zcrypt_increase_preference(zdev);
311 put_device(&zdev->ap_dev->device); 311 put_device(&zdev->ap_dev->device);
@@ -373,14 +373,14 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt)
373 get_device(&zdev->ap_dev->device); 373 get_device(&zdev->ap_dev->device);
374 zdev->request_count++; 374 zdev->request_count++;
375 __zcrypt_decrease_preference(zdev); 375 __zcrypt_decrease_preference(zdev);
376 spin_unlock_bh(&zcrypt_device_lock);
377 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { 376 if (try_module_get(zdev->ap_dev->drv->driver.owner)) {
377 spin_unlock_bh(&zcrypt_device_lock);
378 rc = zdev->ops->rsa_modexpo_crt(zdev, crt); 378 rc = zdev->ops->rsa_modexpo_crt(zdev, crt);
379 spin_lock_bh(&zcrypt_device_lock);
379 module_put(zdev->ap_dev->drv->driver.owner); 380 module_put(zdev->ap_dev->drv->driver.owner);
380 } 381 }
381 else 382 else
382 rc = -EAGAIN; 383 rc = -EAGAIN;
383 spin_lock_bh(&zcrypt_device_lock);
384 zdev->request_count--; 384 zdev->request_count--;
385 __zcrypt_increase_preference(zdev); 385 __zcrypt_increase_preference(zdev);
386 put_device(&zdev->ap_dev->device); 386 put_device(&zdev->ap_dev->device);
@@ -408,14 +408,14 @@ static long zcrypt_send_cprb(struct ica_xcRB *xcRB)
408 get_device(&zdev->ap_dev->device); 408 get_device(&zdev->ap_dev->device);
409 zdev->request_count++; 409 zdev->request_count++;
410 __zcrypt_decrease_preference(zdev); 410 __zcrypt_decrease_preference(zdev);
411 spin_unlock_bh(&zcrypt_device_lock);
412 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { 411 if (try_module_get(zdev->ap_dev->drv->driver.owner)) {
412 spin_unlock_bh(&zcrypt_device_lock);
413 rc = zdev->ops->send_cprb(zdev, xcRB); 413 rc = zdev->ops->send_cprb(zdev, xcRB);
414 spin_lock_bh(&zcrypt_device_lock);
414 module_put(zdev->ap_dev->drv->driver.owner); 415 module_put(zdev->ap_dev->drv->driver.owner);
415 } 416 }
416 else 417 else
417 rc = -EAGAIN; 418 rc = -EAGAIN;
418 spin_lock_bh(&zcrypt_device_lock);
419 zdev->request_count--; 419 zdev->request_count--;
420 __zcrypt_increase_preference(zdev); 420 __zcrypt_increase_preference(zdev);
421 put_device(&zdev->ap_dev->device); 421 put_device(&zdev->ap_dev->device);
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index c53b69610a51..46c40bbc4bc6 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -17,6 +17,9 @@
17 * License. See the file "COPYING" in the main directory of this archive 17 * License. See the file "COPYING" in the main directory of this archive
18 * for more details. 18 * for more details.
19 */ 19 */
20#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
21#define SUPPORT_SYSRQ
22#endif
20 23
21#undef DEBUG 24#undef DEBUG
22 25
@@ -49,11 +52,6 @@
49#endif 52#endif
50 53
51#include <asm/sci.h> 54#include <asm/sci.h>
52
53#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
54#define SUPPORT_SYSRQ
55#endif
56
57#include "sh-sci.h" 55#include "sh-sci.h"
58 56
59struct sci_port { 57struct sci_port {
@@ -645,6 +643,9 @@ static inline int sci_handle_breaks(struct uart_port *port)
645 struct tty_struct *tty = port->info->tty; 643 struct tty_struct *tty = port->info->tty;
646 struct sci_port *s = &sci_ports[port->line]; 644 struct sci_port *s = &sci_ports[port->line];
647 645
646 if (uart_handle_break(port))
647 return 0;
648
648 if (!s->break_flag && status & SCxSR_BRK(port)) { 649 if (!s->break_flag && status & SCxSR_BRK(port)) {
649#if defined(CONFIG_CPU_SH3) 650#if defined(CONFIG_CPU_SH3)
650 /* Debounce break */ 651 /* Debounce break */
diff --git a/drivers/spi/at25.c b/drivers/spi/at25.c
index 48e4f48e779f..8efa07e8b8c2 100644
--- a/drivers/spi/at25.c
+++ b/drivers/spi/at25.c
@@ -291,7 +291,7 @@ static int at25_probe(struct spi_device *spi)
291 */ 291 */
292 sr = spi_w8r8(spi, AT25_RDSR); 292 sr = spi_w8r8(spi, AT25_RDSR);
293 if (sr < 0 || sr & AT25_SR_nRDY) { 293 if (sr < 0 || sr & AT25_SR_nRDY) {
294 dev_dbg(&at25->spi->dev, "rdsr --> %d (%02x)\n", sr, sr); 294 dev_dbg(&spi->dev, "rdsr --> %d (%02x)\n", sr, sr);
295 err = -ENXIO; 295 err = -ENXIO;
296 goto fail; 296 goto fail;
297 } 297 }
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 6fa260d1a9be..66e7bc985797 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -425,7 +425,7 @@ static int atmel_spi_setup(struct spi_device *spi)
425 if (ret) 425 if (ret)
426 return ret; 426 return ret;
427 spi->controller_state = (void *)npcs_pin; 427 spi->controller_state = (void *)npcs_pin;
428 gpio_direction_output(npcs_pin); 428 gpio_direction_output(npcs_pin, !(spi->mode & SPI_CS_HIGH));
429 } 429 }
430 430
431 dev_dbg(&spi->dev, 431 dev_dbg(&spi->dev,
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index 24a330d82395..88425e1af4d3 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -302,10 +302,6 @@ static void bitbang_work(struct work_struct *work)
302 setup_transfer = NULL; 302 setup_transfer = NULL;
303 303
304 list_for_each_entry (t, &m->transfers, transfer_list) { 304 list_for_each_entry (t, &m->transfers, transfer_list) {
305 if (bitbang->shutdown) {
306 status = -ESHUTDOWN;
307 break;
308 }
309 305
310 /* override or restore speed and wordsize */ 306 /* override or restore speed and wordsize */
311 if (t->speed_hz || t->bits_per_word) { 307 if (t->speed_hz || t->bits_per_word) {
@@ -410,8 +406,6 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m)
410 m->status = -EINPROGRESS; 406 m->status = -EINPROGRESS;
411 407
412 bitbang = spi_master_get_devdata(spi->master); 408 bitbang = spi_master_get_devdata(spi->master);
413 if (bitbang->shutdown)
414 return -ESHUTDOWN;
415 409
416 spin_lock_irqsave(&bitbang->lock, flags); 410 spin_lock_irqsave(&bitbang->lock, flags);
417 if (!spi->max_speed_hz) 411 if (!spi->max_speed_hz)
@@ -507,28 +501,12 @@ EXPORT_SYMBOL_GPL(spi_bitbang_start);
507 */ 501 */
508int spi_bitbang_stop(struct spi_bitbang *bitbang) 502int spi_bitbang_stop(struct spi_bitbang *bitbang)
509{ 503{
510 unsigned limit = 500; 504 spi_unregister_master(bitbang->master);
511
512 spin_lock_irq(&bitbang->lock);
513 bitbang->shutdown = 0;
514 while (!list_empty(&bitbang->queue) && limit--) {
515 spin_unlock_irq(&bitbang->lock);
516 505
517 dev_dbg(bitbang->master->cdev.dev, "wait for queue\n"); 506 WARN_ON(!list_empty(&bitbang->queue));
518 msleep(10);
519
520 spin_lock_irq(&bitbang->lock);
521 }
522 spin_unlock_irq(&bitbang->lock);
523 if (!list_empty(&bitbang->queue)) {
524 dev_err(bitbang->master->cdev.dev, "queue didn't empty\n");
525 return -EBUSY;
526 }
527 507
528 destroy_workqueue(bitbang->workqueue); 508 destroy_workqueue(bitbang->workqueue);
529 509
530 spi_unregister_master(bitbang->master);
531
532 return 0; 510 return 0;
533} 511}
534EXPORT_SYMBOL_GPL(spi_bitbang_stop); 512EXPORT_SYMBOL_GPL(spi_bitbang_stop);
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 651379c51ae6..220abce63e4a 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -41,7 +41,7 @@ struct s3c24xx_spi {
41 int len; 41 int len;
42 int count; 42 int count;
43 43
44 int (*set_cs)(struct s3c2410_spi_info *spi, 44 void (*set_cs)(struct s3c2410_spi_info *spi,
45 int cs, int pol); 45 int cs, int pol);
46 46
47 /* data buffers */ 47 /* data buffers */
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 63e50a1f1396..6584cf00f7f3 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -202,6 +202,7 @@ struct quirk_printer_struct {
202 202
203#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */ 203#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */
204#define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */ 204#define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
205#define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific Class or SubClass */
205 206
206static const struct quirk_printer_struct quirk_printers[] = { 207static const struct quirk_printer_struct quirk_printers[] = {
207 { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */ 208 { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
@@ -218,6 +219,7 @@ static const struct quirk_printer_struct quirk_printers[] = {
218 { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */ 219 { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
219 { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ 220 { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
220 { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */ 221 { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */
222 { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */
221 { 0, 0 } 223 { 0, 0 }
222}; 224};
223 225
@@ -1048,7 +1050,8 @@ static int usblp_select_alts(struct usblp *usblp)
1048 ifd = &if_alt->altsetting[i]; 1050 ifd = &if_alt->altsetting[i];
1049 1051
1050 if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1) 1052 if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1)
1051 continue; 1053 if (!(usblp->quirks & USBLP_QUIRK_BAD_CLASS))
1054 continue;
1052 1055
1053 if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL || 1056 if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL ||
1054 ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL) 1057 ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL)
@@ -1232,6 +1235,7 @@ static struct usb_device_id usblp_ids [] = {
1232 { USB_INTERFACE_INFO(7, 1, 1) }, 1235 { USB_INTERFACE_INFO(7, 1, 1) },
1233 { USB_INTERFACE_INFO(7, 1, 2) }, 1236 { USB_INTERFACE_INFO(7, 1, 2) },
1234 { USB_INTERFACE_INFO(7, 1, 3) }, 1237 { USB_INTERFACE_INFO(7, 1, 3) },
1238 { USB_DEVICE(0x04b8, 0x0202) }, /* Seiko Epson Receipt Printer M129C */
1235 { } /* Terminating entry */ 1239 { } /* Terminating entry */
1236}; 1240};
1237 1241
diff --git a/drivers/usb/misc/berry_charge.c b/drivers/usb/misc/berry_charge.c
index 60893c6c8221..b15f2fd8dab4 100644
--- a/drivers/usb/misc/berry_charge.c
+++ b/drivers/usb/misc/berry_charge.c
@@ -69,7 +69,7 @@ static int magic_charge(struct usb_device *udev)
69 return retval; 69 return retval;
70 } 70 }
71 71
72 dbg(&udev->dev, "Sending first magic command\n"); 72 dbg(&udev->dev, "Sending second magic command\n");
73 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 73 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
74 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100); 74 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100);
75 if (retval != 0) { 75 if (retval != 0) {
diff --git a/drivers/usb/net/dm9601.c b/drivers/usb/net/dm9601.c
index c0bc52be5e10..5130cc7eb314 100644
--- a/drivers/usb/net/dm9601.c
+++ b/drivers/usb/net/dm9601.c
@@ -578,6 +578,14 @@ static const struct usb_device_id products[] = {
578 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */ 578 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */
579 .driver_info = (unsigned long)&dm9601_info, 579 .driver_info = (unsigned long)&dm9601_info,
580 }, 580 },
581 {
582 USB_DEVICE(0x0a46, 0x6688), /* ZT6688 USB NIC */
583 .driver_info = (unsigned long)&dm9601_info,
584 },
585 {
586 USB_DEVICE(0x0a46, 0x0268), /* ShanTou ST268 USB NIC */
587 .driver_info = (unsigned long)&dm9601_info,
588 },
581 {}, // END 589 {}, // END
582}; 590};
583 591
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index 310a8b5f5906..7538c64a5097 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -18,10 +18,6 @@
18 18
19static struct usb_device_id id_table [] = { 19static struct usb_device_id id_table [] = {
20 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ 20 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
21 { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
22 { USB_DEVICE(0x1410, 0x1130) }, /* Novatel Wireless S720 CDMA/EV-DO */
23 { USB_DEVICE(0x1410, 0x2110) }, /* Novatel Wireless U720 CDMA/EV-DO */
24 { USB_DEVICE(0x1410, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */
25 { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */ 21 { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */
26 { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ 22 { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */
27 { }, 23 { },
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 2d588fb82573..19bf403f9db2 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1628,6 +1628,7 @@ static struct usb_serial_driver moschip7720_2port_driver = {
1628 .chars_in_buffer = mos7720_chars_in_buffer, 1628 .chars_in_buffer = mos7720_chars_in_buffer,
1629 .break_ctl = mos7720_break, 1629 .break_ctl = mos7720_break,
1630 .read_bulk_callback = mos7720_bulk_in_callback, 1630 .read_bulk_callback = mos7720_bulk_in_callback,
1631 .read_int_callback = mos7720_interrupt_callback,
1631}; 1632};
1632 1633
1633static int __init moschip7720_init(void) 1634static int __init moschip7720_init(void)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index db92a7fb1f7c..e178e6f40319 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -109,7 +109,6 @@ static int option_send_setup(struct usb_serial_port *port);
109#define HUAWEI_PRODUCT_E220 0x1003 109#define HUAWEI_PRODUCT_E220 0x1003
110 110
111#define NOVATELWIRELESS_VENDOR_ID 0x1410 111#define NOVATELWIRELESS_VENDOR_ID 0x1410
112#define NOVATELWIRELESS_PRODUCT_U740 0x1400
113 112
114#define ANYDATA_VENDOR_ID 0x16d5 113#define ANYDATA_VENDOR_ID 0x16d5
115#define ANYDATA_PRODUCT_ID 0x6501 114#define ANYDATA_PRODUCT_ID 0x6501
@@ -152,7 +151,19 @@ static struct usb_device_id option_ids[] = {
152 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, 151 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
153 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 152 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
154 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 153 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
155 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 154 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */
155 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */
156 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */
157 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1130) }, /* Novatel Merlin S720 */
158 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1400) }, /* Novatel U730 */
159 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */
160 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */
161 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */
162 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel XU870 */
163 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */
164 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */
165 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */
166 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */
156 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, 167 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
157 { } /* Terminating entry */ 168 { } /* Terminating entry */
158}; 169};
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 8511352251f3..7639022cdf84 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -138,6 +138,11 @@ static void destroy_serial(struct kref *kref)
138 138
139 dbg("%s - %s", __FUNCTION__, serial->type->description); 139 dbg("%s - %s", __FUNCTION__, serial->type->description);
140 140
141 serial->type->shutdown(serial);
142
143 /* return the minor range that this device had */
144 return_serial(serial);
145
141 for (i = 0; i < serial->num_ports; ++i) 146 for (i = 0; i < serial->num_ports; ++i)
142 serial->port[i]->open_count = 0; 147 serial->port[i]->open_count = 0;
143 148
@@ -148,12 +153,6 @@ static void destroy_serial(struct kref *kref)
148 serial->port[i] = NULL; 153 serial->port[i] = NULL;
149 } 154 }
150 155
151 if (serial->type->shutdown)
152 serial->type->shutdown(serial);
153
154 /* return the minor range that this device had */
155 return_serial(serial);
156
157 /* If this is a "fake" port, we have to clean it up here, as it will 156 /* If this is a "fake" port, we have to clean it up here, as it will
158 * not get cleaned up in port_release() as it was never registered with 157 * not get cleaned up in port_release() as it was never registered with
159 * the driver core */ 158 * the driver core */
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 2dd31e3f5107..e13637dfb642 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1411,6 +1411,16 @@ UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001,
1411 US_SC_DEVICE, US_PR_DEVICE, NULL, 1411 US_SC_DEVICE, US_PR_DEVICE, NULL,
1412 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), 1412 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
1413 1413
1414/*
1415 * Patch by Pete Zaitcev <zaitcev@redhat.com>
1416 * Report by Mark Patton. Red Hat bz#208928.
1417 */
1418UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0001,
1419 "Motorola",
1420 "RAZR V3i",
1421 US_SC_DEVICE, US_PR_DEVICE, NULL,
1422 US_FL_FIX_CAPACITY),
1423
1414/* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */ 1424/* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */
1415UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, 1425UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
1416 "MPIO", 1426 "MPIO",
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 7f5a59836818..e4f0dd00ae85 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1320,7 +1320,7 @@ config FB_AU1100
1320 1320
1321config FB_AU1200 1321config FB_AU1200
1322 bool "Au1200 LCD Driver" 1322 bool "Au1200 LCD Driver"
1323 depends on FB && MIPS && SOC_AU1200 1323 depends on (FB = y) && MIPS && SOC_AU1200
1324 select FB_CFB_FILLRECT 1324 select FB_CFB_FILLRECT
1325 select FB_CFB_COPYAREA 1325 select FB_CFB_COPYAREA
1326 select FB_CFB_IMAGEBLIT 1326 select FB_CFB_IMAGEBLIT
@@ -1470,7 +1470,7 @@ config FB_G364
1470 1470
1471config FB_68328 1471config FB_68328
1472 bool "Motorola 68328 native frame buffer support" 1472 bool "Motorola 68328 native frame buffer support"
1473 depends on FB && (M68328 || M68EZ328 || M68VZ328) 1473 depends on (FB = y) && (M68328 || M68EZ328 || M68VZ328)
1474 select FB_CFB_FILLRECT 1474 select FB_CFB_FILLRECT
1475 select FB_CFB_COPYAREA 1475 select FB_CFB_COPYAREA
1476 select FB_CFB_IMAGEBLIT 1476 select FB_CFB_IMAGEBLIT
@@ -1616,7 +1616,7 @@ config FB_IBM_GXT4500
1616 1616
1617config FB_PS3 1617config FB_PS3
1618 bool "PS3 GPU framebuffer driver" 1618 bool "PS3 GPU framebuffer driver"
1619 depends on FB && PS3_PS3AV 1619 depends on (FB = y) && PS3_PS3AV
1620 select FB_CFB_FILLRECT 1620 select FB_CFB_FILLRECT
1621 select FB_CFB_COPYAREA 1621 select FB_CFB_COPYAREA
1622 select FB_CFB_IMAGEBLIT 1622 select FB_CFB_IMAGEBLIT
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 98919a6975f0..3091b20124b4 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -1000,11 +1000,12 @@ err_enable_device:
1000static void __devexit s3_pci_remove(struct pci_dev *dev) 1000static void __devexit s3_pci_remove(struct pci_dev *dev)
1001{ 1001{
1002 struct fb_info *info = pci_get_drvdata(dev); 1002 struct fb_info *info = pci_get_drvdata(dev);
1003 struct s3fb_info *par = info->par;
1004 1003
1005 if (info) { 1004 if (info) {
1006 1005
1007#ifdef CONFIG_MTRR 1006#ifdef CONFIG_MTRR
1007 struct s3fb_info *par = info->par;
1008
1008 if (par->mtrr_reg >= 0) { 1009 if (par->mtrr_reg >= 0) {
1009 mtrr_del(par->mtrr_reg, 0, 0); 1010 mtrr_del(par->mtrr_reg, 0, 0);
1010 par->mtrr_reg = -1; 1011 par->mtrr_reg = -1;
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 4afa30522fdb..0166ec2ccf32 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -384,6 +384,19 @@ SavageSetup2DEngine(struct savagefb_par *par)
384 BCI_SEND(0); 384 BCI_SEND(0);
385 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); 385 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
386 BCI_SEND(GlobalBitmapDescriptor); 386 BCI_SEND(GlobalBitmapDescriptor);
387
388 /*
389 * I don't know why, sending this twice fixes the intial black screen,
390 * prevents X from crashing at least in Toshiba laptops with SavageIX.
391 * --Tony
392 */
393 par->bci_ptr = 0;
394 par->SavageWaitFifo(par, 4);
395
396 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD1);
397 BCI_SEND(0);
398 BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
399 BCI_SEND(GlobalBitmapDescriptor);
387} 400}
388 401
389static void savagefb_set_clip(struct fb_info *info) 402static void savagefb_set_clip(struct fb_info *info)
@@ -496,7 +509,7 @@ static int common_calc_clock(long freq, int min_m, int min_n1, int max_n1,
496#ifdef SAVAGEFB_DEBUG 509#ifdef SAVAGEFB_DEBUG
497/* This function is used to debug, it prints out the contents of s3 regs */ 510/* This function is used to debug, it prints out the contents of s3 regs */
498 511
499static void SavagePrintRegs(void) 512static void SavagePrintRegs(struct savagefb_par *par)
500{ 513{
501 unsigned char i; 514 unsigned char i;
502 int vgaCRIndex = 0x3d4; 515 int vgaCRIndex = 0x3d4;
@@ -1525,7 +1538,7 @@ static int savagefb_set_par(struct fb_info *info)
1525 savagefb_set_fix(info); 1538 savagefb_set_fix(info);
1526 savagefb_set_clip(info); 1539 savagefb_set_clip(info);
1527 1540
1528 SavagePrintRegs(); 1541 SavagePrintRegs(par);
1529 return 0; 1542 return 0;
1530} 1543}
1531 1544
@@ -2155,7 +2168,6 @@ static int __devinit savagefb_probe(struct pci_dev* dev,
2155 int video_len; 2168 int video_len;
2156 2169
2157 DBG("savagefb_probe"); 2170 DBG("savagefb_probe");
2158 SavagePrintRegs();
2159 2171
2160 info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev); 2172 info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev);
2161 if (!info) 2173 if (!info)
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index 59cd1e750f30..62fa5500361d 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -257,6 +257,7 @@ static void __sst_dac_write(u8 __iomem *vbase, u8 reg, u8 val)
257 r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val); 257 r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val);
258 reg &= 0x07; 258 reg &= 0x07;
259 __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val); 259 __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val);
260 __sst_wait_idle(vbase);
260} 261}
261 262
262/* indexed access to ti/att dacs */ 263/* indexed access to ti/att dacs */