58
58
#include <linux/platform_device.h> /* For platform_driver framework */
59
59
#include <linux/pci.h> /* For pci functions */
60
60
#include <linux/ioport.h> /* For io-port access */
61
- #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */
62
61
#include <linux/uaccess.h> /* For copy_to_user/put_user/... */
63
62
#include <linux/io.h> /* For inb/outb/... */
64
63
#include <linux/platform_data/itco_wdt.h>
@@ -102,8 +101,6 @@ struct iTCO_wdt_private {
102
101
* or memory-mapped PMC register bit 4 (TCO version 3).
103
102
*/
104
103
unsigned long __iomem * gcs_pmc ;
105
- /* the lock for io operations */
106
- spinlock_t io_lock ;
107
104
/* the PCI-device */
108
105
struct pci_dev * pci_dev ;
109
106
/* whether or not the watchdog has been suspended */
@@ -286,13 +283,10 @@ static int iTCO_wdt_start(struct watchdog_device *wd_dev)
286
283
struct iTCO_wdt_private * p = watchdog_get_drvdata (wd_dev );
287
284
unsigned int val ;
288
285
289
- spin_lock (& p -> io_lock );
290
-
291
286
iTCO_vendor_pre_start (p -> smi_res , wd_dev -> timeout );
292
287
293
288
/* disable chipset's NO_REBOOT bit */
294
289
if (p -> update_no_reboot_bit (p -> no_reboot_priv , false)) {
295
- spin_unlock (& p -> io_lock );
296
290
dev_err (wd_dev -> parent , "failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS\n" );
297
291
return - EIO ;
298
292
}
@@ -309,7 +303,6 @@ static int iTCO_wdt_start(struct watchdog_device *wd_dev)
309
303
val &= 0xf7ff ;
310
304
outw (val , TCO1_CNT (p ));
311
305
val = inw (TCO1_CNT (p ));
312
- spin_unlock (& p -> io_lock );
313
306
314
307
if (val & 0x0800 )
315
308
return -1 ;
@@ -321,8 +314,6 @@ static int iTCO_wdt_stop(struct watchdog_device *wd_dev)
321
314
struct iTCO_wdt_private * p = watchdog_get_drvdata (wd_dev );
322
315
unsigned int val ;
323
316
324
- spin_lock (& p -> io_lock );
325
-
326
317
iTCO_vendor_pre_stop (p -> smi_res );
327
318
328
319
/* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */
@@ -334,8 +325,6 @@ static int iTCO_wdt_stop(struct watchdog_device *wd_dev)
334
325
/* Set the NO_REBOOT bit to prevent later reboots, just for sure */
335
326
p -> update_no_reboot_bit (p -> no_reboot_priv , true);
336
327
337
- spin_unlock (& p -> io_lock );
338
-
339
328
if ((val & 0x0800 ) == 0 )
340
329
return -1 ;
341
330
return 0 ;
@@ -345,8 +334,6 @@ static int iTCO_wdt_ping(struct watchdog_device *wd_dev)
345
334
{
346
335
struct iTCO_wdt_private * p = watchdog_get_drvdata (wd_dev );
347
336
348
- spin_lock (& p -> io_lock );
349
-
350
337
/* Reload the timer by writing to the TCO Timer Counter register */
351
338
if (p -> iTCO_version >= 2 ) {
352
339
outw (0x01 , TCO_RLD (p ));
@@ -358,7 +345,6 @@ static int iTCO_wdt_ping(struct watchdog_device *wd_dev)
358
345
outb (0x01 , TCO_RLD (p ));
359
346
}
360
347
361
- spin_unlock (& p -> io_lock );
362
348
return 0 ;
363
349
}
364
350
@@ -385,24 +371,20 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t)
385
371
386
372
/* Write new heartbeat to watchdog */
387
373
if (p -> iTCO_version >= 2 ) {
388
- spin_lock (& p -> io_lock );
389
374
val16 = inw (TCOv2_TMR (p ));
390
375
val16 &= 0xfc00 ;
391
376
val16 |= tmrval ;
392
377
outw (val16 , TCOv2_TMR (p ));
393
378
val16 = inw (TCOv2_TMR (p ));
394
- spin_unlock (& p -> io_lock );
395
379
396
380
if ((val16 & 0x3ff ) != tmrval )
397
381
return - EINVAL ;
398
382
} else if (p -> iTCO_version == 1 ) {
399
- spin_lock (& p -> io_lock );
400
383
val8 = inb (TCOv1_TMR (p ));
401
384
val8 &= 0xc0 ;
402
385
val8 |= (tmrval & 0xff );
403
386
outb (val8 , TCOv1_TMR (p ));
404
387
val8 = inb (TCOv1_TMR (p ));
405
- spin_unlock (& p -> io_lock );
406
388
407
389
if ((val8 & 0x3f ) != tmrval )
408
390
return - EINVAL ;
@@ -421,19 +403,15 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev)
421
403
422
404
/* read the TCO Timer */
423
405
if (p -> iTCO_version >= 2 ) {
424
- spin_lock (& p -> io_lock );
425
406
val16 = inw (TCO_RLD (p ));
426
407
val16 &= 0x3ff ;
427
- spin_unlock (& p -> io_lock );
428
408
429
409
time_left = ticks_to_seconds (p , val16 );
430
410
} else if (p -> iTCO_version == 1 ) {
431
- spin_lock (& p -> io_lock );
432
411
val8 = inb (TCO_RLD (p ));
433
412
val8 &= 0x3f ;
434
413
if (!(inw (TCO1_STS (p )) & 0x0008 ))
435
414
val8 += (inb (TCOv1_TMR (p )) & 0x3f );
436
- spin_unlock (& p -> io_lock );
437
415
438
416
time_left = ticks_to_seconds (p , val8 );
439
417
}
@@ -493,8 +471,6 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
493
471
if (!p )
494
472
return - ENOMEM ;
495
473
496
- spin_lock_init (& p -> io_lock );
497
-
498
474
p -> tco_res = platform_get_resource (pdev , IORESOURCE_IO , ICH_RES_IO_TCO );
499
475
if (!p -> tco_res )
500
476
return - ENODEV ;
0 commit comments