aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Stezenbach <js@linuxtv.org>2005-07-07 20:57:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:57 -0400
commit7d87bc39b98e0bf927acd14611976f710bd9a783 (patch)
treeb4a2a12140474d1ed59f4265d6e3e9e4ad8cfbae /drivers
parentc9090ebb247999354f80d45d45b3d5a804a94f7f (diff)
[PATCH] dvb: ttpci: fix bug in timeout handling
Fix bug in timeout handling. Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index 7d2bdd791c9e..aa1efce6cb31 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -352,11 +352,11 @@ static int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
352 352
353 start = jiffies; 353 start = jiffies;
354 while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) { 354 while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) {
355 msleep(1);
356 if (time_after(jiffies, start + ARM_WAIT_FREE)) { 355 if (time_after(jiffies, start + ARM_WAIT_FREE)) {
357 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND idle\n", __FUNCTION__); 356 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND idle\n", __FUNCTION__);
358 return -ETIMEDOUT; 357 return -ETIMEDOUT;
359 } 358 }
359 msleep(1);
360 } 360 }
361 361
362 wdebi(av7110, DEBINOSWAP, COM_IF_LOCK, 0xffff, 2); 362 wdebi(av7110, DEBINOSWAP, COM_IF_LOCK, 0xffff, 2);
@@ -364,11 +364,11 @@ static int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
364#ifndef _NOHANDSHAKE 364#ifndef _NOHANDSHAKE
365 start = jiffies; 365 start = jiffies;
366 while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) { 366 while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) {
367 msleep(1);
368 if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { 367 if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
369 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); 368 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
370 return -ETIMEDOUT; 369 return -ETIMEDOUT;
371 } 370 }
371 msleep(1);
372 } 372 }
373#endif 373#endif
374 374
@@ -433,7 +433,6 @@ static int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
433#ifdef COM_DEBUG 433#ifdef COM_DEBUG
434 start = jiffies; 434 start = jiffies;
435 while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) { 435 while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) {
436 msleep(1);
437 if (time_after(jiffies, start + ARM_WAIT_FREE)) { 436 if (time_after(jiffies, start + ARM_WAIT_FREE)) {
438 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND %d to complete\n", 437 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND %d to complete\n",
439 __FUNCTION__, 438 __FUNCTION__,
@@ -441,6 +440,7 @@ static int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
441 ); 440 );
442 return -ETIMEDOUT; 441 return -ETIMEDOUT;
443 } 442 }
443 msleep(1);
444 } 444 }
445 445
446 stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2); 446 stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
@@ -554,25 +554,25 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
554 554
555 start = jiffies; 555 start = jiffies;
556 while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2)) { 556 while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2)) {
557#ifdef _NOHANDSHAKE
558 msleep(1);
559#endif
560 if (time_after(jiffies, start + ARM_WAIT_FREE)) { 557 if (time_after(jiffies, start + ARM_WAIT_FREE)) {
561 printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__); 558 printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
562 up(&av7110->dcomlock); 559 up(&av7110->dcomlock);
563 return -ETIMEDOUT; 560 return -ETIMEDOUT;
564 } 561 }
562#ifdef _NOHANDSHAKE
563 msleep(1);
564#endif
565 } 565 }
566 566
567#ifndef _NOHANDSHAKE 567#ifndef _NOHANDSHAKE
568 start = jiffies; 568 start = jiffies;
569 while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) { 569 while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) {
570 msleep(1);
571 if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { 570 if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
572 printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); 571 printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
573 up(&av7110->dcomlock); 572 up(&av7110->dcomlock);
574 return -ETIMEDOUT; 573 return -ETIMEDOUT;
575 } 574 }
575 msleep(1);
576 } 576 }
577#endif 577#endif
578 578
@@ -712,13 +712,13 @@ static int FlushText(struct av7110 *av7110)
712 return -ERESTARTSYS; 712 return -ERESTARTSYS;
713 start = jiffies; 713 start = jiffies;
714 while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) { 714 while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) {
715 msleep(1);
716 if (time_after(jiffies, start + ARM_WAIT_OSD)) { 715 if (time_after(jiffies, start + ARM_WAIT_OSD)) {
717 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for BUFF1_BASE == 0\n", 716 printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for BUFF1_BASE == 0\n",
718 __FUNCTION__); 717 __FUNCTION__);
719 up(&av7110->dcomlock); 718 up(&av7110->dcomlock);
720 return -ETIMEDOUT; 719 return -ETIMEDOUT;
721 } 720 }
721 msleep(1);
722 } 722 }
723 up(&av7110->dcomlock); 723 up(&av7110->dcomlock);
724 return 0; 724 return 0;
@@ -736,24 +736,24 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
736 736
737 start = jiffies; 737 start = jiffies;
738 while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) { 738 while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) {
739 msleep(1);
740 if (time_after(jiffies, start + ARM_WAIT_OSD)) { 739 if (time_after(jiffies, start + ARM_WAIT_OSD)) {
741 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for BUFF1_BASE == 0\n", 740 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for BUFF1_BASE == 0\n",
742 __FUNCTION__); 741 __FUNCTION__);
743 up(&av7110->dcomlock); 742 up(&av7110->dcomlock);
744 return -ETIMEDOUT; 743 return -ETIMEDOUT;
745 } 744 }
745 msleep(1);
746 } 746 }
747#ifndef _NOHANDSHAKE 747#ifndef _NOHANDSHAKE
748 start = jiffies; 748 start = jiffies;
749 while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2)) { 749 while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2)) {
750 msleep(1);
751 if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { 750 if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
752 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for HANDSHAKE_REG\n", 751 printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for HANDSHAKE_REG\n",
753 __FUNCTION__); 752 __FUNCTION__);
754 up(&av7110->dcomlock); 753 up(&av7110->dcomlock);
755 return -ETIMEDOUT; 754 return -ETIMEDOUT;
756 } 755 }
756 msleep(1);
757 } 757 }
758#endif 758#endif
759 for (i = 0; i < length / 2; i++) 759 for (i = 0; i < length / 2; i++)