aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mwave
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2007-02-20 16:57:57 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-20 20:10:14 -0500
commitae6b95d4d86565a4f267359852f7fbe000b6e0e7 (patch)
tree4cc89deec81a209924a9089673ebc9d748474327 /drivers/char/mwave
parent91e4ee381d23ef67196a03924485aeceb32d6753 (diff)
[PATCH] mwave: interesting flags savings
Flags from spin_lock_irqsave() are saved into global variable and restored from it. My gut feeling this is very racy. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mwave')
-rw-r--r--drivers/char/mwave/3780i.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/char/mwave/3780i.c b/drivers/char/mwave/3780i.c
index 4e4865e90e50..492dbfb2efd6 100644
--- a/drivers/char/mwave/3780i.c
+++ b/drivers/char/mwave/3780i.c
@@ -63,8 +63,6 @@
63#include "3780i.h" 63#include "3780i.h"
64 64
65static DEFINE_SPINLOCK(dsp_lock); 65static DEFINE_SPINLOCK(dsp_lock);
66static unsigned long flags;
67
68 66
69static void PaceMsaAccess(unsigned short usDspBaseIO) 67static void PaceMsaAccess(unsigned short usDspBaseIO)
70{ 68{
@@ -76,6 +74,7 @@ static void PaceMsaAccess(unsigned short usDspBaseIO)
76unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO, 74unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO,
77 unsigned long ulMsaAddr) 75 unsigned long ulMsaAddr)
78{ 76{
77 unsigned long flags;
79 unsigned short val; 78 unsigned short val;
80 79
81 PRINTK_3(TRACE_3780I, 80 PRINTK_3(TRACE_3780I,
@@ -96,6 +95,7 @@ unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO,
96void dsp3780I_WriteMsaCfg(unsigned short usDspBaseIO, 95void dsp3780I_WriteMsaCfg(unsigned short usDspBaseIO,
97 unsigned long ulMsaAddr, unsigned short usValue) 96 unsigned long ulMsaAddr, unsigned short usValue)
98{ 97{
98 unsigned long flags;
99 99
100 PRINTK_4(TRACE_3780I, 100 PRINTK_4(TRACE_3780I,
101 "3780i::dsp3780i_WriteMsaCfg entry usDspBaseIO %x ulMsaAddr %lx usValue %x\n", 101 "3780i::dsp3780i_WriteMsaCfg entry usDspBaseIO %x ulMsaAddr %lx usValue %x\n",
@@ -175,6 +175,7 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
175 unsigned short *pIrqMap, 175 unsigned short *pIrqMap,
176 unsigned short *pDmaMap) 176 unsigned short *pDmaMap)
177{ 177{
178 unsigned long flags;
178 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 179 unsigned short usDspBaseIO = pSettings->usDspBaseIO;
179 int i; 180 int i;
180 DSP_UART_CFG_1 rUartCfg1; 181 DSP_UART_CFG_1 rUartCfg1;
@@ -354,6 +355,7 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
354 355
355int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings) 356int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings)
356{ 357{
358 unsigned long flags;
357 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 359 unsigned short usDspBaseIO = pSettings->usDspBaseIO;
358 DSP_ISA_SLAVE_CONTROL rSlaveControl; 360 DSP_ISA_SLAVE_CONTROL rSlaveControl;
359 361
@@ -383,6 +385,7 @@ int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings)
383 385
384int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings) 386int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings)
385{ 387{
388 unsigned long flags;
386 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 389 unsigned short usDspBaseIO = pSettings->usDspBaseIO;
387 DSP_BOOT_DOMAIN rBootDomain; 390 DSP_BOOT_DOMAIN rBootDomain;
388 DSP_HBRIDGE_CONTROL rHBridgeControl; 391 DSP_HBRIDGE_CONTROL rHBridgeControl;
@@ -427,6 +430,7 @@ int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings)
427 430
428int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings) 431int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
429{ 432{
433 unsigned long flags;
430 unsigned short usDspBaseIO = pSettings->usDspBaseIO; 434 unsigned short usDspBaseIO = pSettings->usDspBaseIO;
431 DSP_BOOT_DOMAIN rBootDomain; 435 DSP_BOOT_DOMAIN rBootDomain;
432 DSP_HBRIDGE_CONTROL rHBridgeControl; 436 DSP_HBRIDGE_CONTROL rHBridgeControl;
@@ -473,6 +477,7 @@ int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
473int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer, 477int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
474 unsigned uCount, unsigned long ulDSPAddr) 478 unsigned uCount, unsigned long ulDSPAddr)
475{ 479{
480 unsigned long flags;
476 unsigned short __user *pusBuffer = pvBuffer; 481 unsigned short __user *pusBuffer = pvBuffer;
477 unsigned short val; 482 unsigned short val;
478 483
@@ -514,6 +519,7 @@ int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
514 void __user *pvBuffer, unsigned uCount, 519 void __user *pvBuffer, unsigned uCount,
515 unsigned long ulDSPAddr) 520 unsigned long ulDSPAddr)
516{ 521{
522 unsigned long flags;
517 unsigned short __user *pusBuffer = pvBuffer; 523 unsigned short __user *pusBuffer = pvBuffer;
518 unsigned short val; 524 unsigned short val;
519 525
@@ -555,6 +561,7 @@ int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
555int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer, 561int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
556 unsigned uCount, unsigned long ulDSPAddr) 562 unsigned uCount, unsigned long ulDSPAddr)
557{ 563{
564 unsigned long flags;
558 unsigned short __user *pusBuffer = pvBuffer; 565 unsigned short __user *pusBuffer = pvBuffer;
559 566
560 567
@@ -596,6 +603,7 @@ int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
596int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer, 603int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
597 unsigned uCount, unsigned long ulDSPAddr) 604 unsigned uCount, unsigned long ulDSPAddr)
598{ 605{
606 unsigned long flags;
599 unsigned short __user *pusBuffer = pvBuffer; 607 unsigned short __user *pusBuffer = pvBuffer;
600 608
601 PRINTK_5(TRACE_3780I, 609 PRINTK_5(TRACE_3780I,
@@ -643,6 +651,7 @@ int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
643int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer, 651int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
644 unsigned uCount, unsigned long ulDSPAddr) 652 unsigned uCount, unsigned long ulDSPAddr)
645{ 653{
654 unsigned long flags;
646 unsigned short __user *pusBuffer = pvBuffer; 655 unsigned short __user *pusBuffer = pvBuffer;
647 656
648 PRINTK_5(TRACE_3780I, 657 PRINTK_5(TRACE_3780I,
@@ -691,6 +700,7 @@ int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
691int dsp3780I_GetIPCSource(unsigned short usDspBaseIO, 700int dsp3780I_GetIPCSource(unsigned short usDspBaseIO,
692 unsigned short *pusIPCSource) 701 unsigned short *pusIPCSource)
693{ 702{
703 unsigned long flags;
694 DSP_HBRIDGE_CONTROL rHBridgeControl; 704 DSP_HBRIDGE_CONTROL rHBridgeControl;
695 unsigned short temp; 705 unsigned short temp;
696 706