public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Conexant 2388x: check for kthread_run
@ 2007-07-18 18:56 Cyrill Gorcunov
  2007-07-18 19:25 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Cyrill Gorcunov @ 2007-07-18 18:56 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, Mauro Carvalho Chehab, Mauro Carvalho Chehab

This patch adds checking of kthread_run return code.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
Probably we could just ignore a such situation (we do
check for core->kthread value before trying to stop the
thread) but we have to leave a footmark in kernel
messages anyway I guess. Comments?

 drivers/media/video/cx88/cx88-video.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 98fa354..2e05450 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1881,8 +1881,15 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	mutex_unlock(&core->lock);
 
 	/* start tvaudio thread */
-	if (core->tuner_type != TUNER_ABSENT)
+	if (core->tuner_type != TUNER_ABSENT) {
 		core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio");
+		if (IS_ERR(core->kthread)) {
+			err = PTR_ERR(core->kthread);
+			printk(KERN_ERR "Failed to create cx88 audio thread, err=%d\n",
+			       err);
+			goto fail_unreg;
+		}
+	}
 	return 0;
 
 fail_unreg:

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Conexant 2388x: check for kthread_run
  2007-07-18 18:56 [PATCH] Conexant 2388x: check for kthread_run Cyrill Gorcunov
@ 2007-07-18 19:25 ` Mauro Carvalho Chehab
  2007-07-19 14:32   ` Cyrill Gorcunov
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2007-07-18 19:25 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: LKML, Andrew Morton, Mauro Carvalho Chehab

Hi Cyrill,

Em Qua, 2007-07-18 às 22:56 +0400, Cyrill Gorcunov escreveu:
> This patch adds checking of kthread_run return code.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
> Probably we could just ignore a such situation (we do
> check for core->kthread value before trying to stop the
> thread) but we have to leave a footmark in kernel
> messages anyway I guess. Comments?

> +		if (IS_ERR(core->kthread)) {
> +			err = PTR_ERR(core->kthread);
> +			printk(KERN_ERR "Failed to create cx88 audio thread, err=%d\n",
> +			       err);
> +			goto fail_unreg;

I would just remove the goto from your patch. 

It is safe not starting the kernel thread, but keeping the driver
initializing.

The drawback of not having the thread is not changing to stereo on some
situations and not detecting audio standard changes (some countries may
have more than one audio standard when you changing from VHF to UHF or
on Cable TV).

-- 
Cheers,
Mauro


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Conexant 2388x: check for kthread_run
  2007-07-18 19:25 ` Mauro Carvalho Chehab
@ 2007-07-19 14:32   ` Cyrill Gorcunov
  0 siblings, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2007-07-19 14:32 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Andrew Morton, LKML

[Mauro Carvalho Chehab - Wed, Jul 18, 2007 at 04:25:38PM -0300]
| Hi Cyrill,
| 
| Em Qua, 2007-07-18 ??s 22:56 +0400, Cyrill Gorcunov escreveu:
| > This patch adds checking of kthread_run return code.
| > 
| > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| > ---
| > Probably we could just ignore a such situation (we do
| > check for core->kthread value before trying to stop the
| > thread) but we have to leave a footmark in kernel
| > messages anyway I guess. Comments?
| 
| > +		if (IS_ERR(core->kthread)) {
| > +			err = PTR_ERR(core->kthread);
| > +			printk(KERN_ERR "Failed to create cx88 audio thread, err=%d\n",
| > +			       err);
| > +			goto fail_unreg;
| 
| I would just remove the goto from your patch. 
| 
| It is safe not starting the kernel thread, but keeping the driver
| initializing.
| 
| The drawback of not having the thread is not changing to stereo on some
| situations and not detecting audio standard changes (some countries may
| have more than one audio standard when you changing from VHF to UHF or
| on Cable TV).
| 
| -- 
| Cheers,
| Mauro
| 

Hi Mauro,
thanks for the answer. Well, here is updated version.

---
From: Cyrill Gorcunov <gorcunov@gmail.com>
Subject: [PATCH] Conexant 2388x: check for kthread_run

The patch adds checking of kthread_run return code
and issues a message if it fails.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

 drivers/media/video/cx88/cx88-video.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 98fa354..06b233a 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1881,8 +1881,14 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	mutex_unlock(&core->lock);
 
 	/* start tvaudio thread */
-	if (core->tuner_type != TUNER_ABSENT)
+	if (core->tuner_type != TUNER_ABSENT) {
 		core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio");
+		if (IS_ERR(core->kthread)) {
+			err = PTR_ERR(core->kthread);
+			printk(KERN_ERR "Failed to create cx88 audio thread, err=%d\n",
+			       err);
+		}
+	}
 	return 0;
 
 fail_unreg:

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-19 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18 18:56 [PATCH] Conexant 2388x: check for kthread_run Cyrill Gorcunov
2007-07-18 19:25 ` Mauro Carvalho Chehab
2007-07-19 14:32   ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox