linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: em28xx: kernel oops in em28xx_tuner_callback() when watching digital TV
Date: Mon, 08 Apr 2013 19:01:00 +0200	[thread overview]
Message-ID: <5162F7CC.6010904@googlemail.com> (raw)
In-Reply-To: <201304081038.54531.hverkuil@xs4all.nl>

Am 08.04.2013 10:38, schrieb Hans Verkuil:
> On Mon April 8 2013 00:02:15 Frank Schäfer wrote:
>>
>> In em28xx_start_streaming() and also em28xx_stop_streaming() we do
>>
>>      struct em28xx *dev = dvb->adapter.priv;
>>
>> which I would say should be the culprit.
>> Are you sure that dvb->adapter.priv needs to be assigned to i2c_bus
>> instead of dev ?
>> Anyway, I modified both functions to obtain the right pointer to dev,
>> but this caused another oops.
>> I also tested without changing dvb->adapter.priv: oops :-/
> Can you try this patch? I did miss the adapter.priv change, so I've added that.
> I also noticed that I converted fe->dvb->priv as well, which is not correct.
>
> So I'm hoping that this will do the trick.
>
> Regards,
>
> 	Hans
>
> diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
> index 42a6a26..1f1f56f 100644
> --- a/drivers/media/usb/em28xx/em28xx-dvb.c
> +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
> @@ -178,7 +178,8 @@ static inline int em28xx_dvb_urb_data_copy(struct em28xx *dev, struct urb *urb)
>  static int em28xx_start_streaming(struct em28xx_dvb *dvb)
>  {
>  	int rc;
> -	struct em28xx *dev = dvb->adapter.priv;
> +	struct em28xx_i2c_bus *i2c_bus = dvb->adapter.priv;
> +	struct em28xx *dev = i2c_bus->dev;
>  	int dvb_max_packet_size, packet_multiplier, dvb_alt;
>  
>  	if (dev->dvb_xfer_bulk) {
> @@ -217,7 +218,8 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb)
>  
>  static int em28xx_stop_streaming(struct em28xx_dvb *dvb)
>  {
> -	struct em28xx *dev = dvb->adapter.priv;
> +	struct em28xx_i2c_bus *i2c_bus = dvb->adapter.priv;
> +	struct em28xx *dev = i2c_bus->dev;
>  
>  	em28xx_stop_urbs(dev);
>  
> @@ -839,7 +841,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
>  	if (dvb->fe[1])
>  		dvb->fe[1]->ops.ts_bus_ctrl = em28xx_dvb_bus_ctrl;
>  
> -	dvb->adapter.priv = dev;
> +	dvb->adapter.priv = &dev->i2c_bus[dev->def_i2c_bus];
>  
>  	/* register frontend */
>  	result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]);

This one does the trick, thanks !

Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>

Regards,
Frank


      reply	other threads:[~2013-04-08 16:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 16:11 em28xx: kernel oops in em28xx_tuner_callback() when watching digital TV Frank Schäfer
2013-04-06  6:35 ` Hans Verkuil
2013-04-06  6:38 ` Hans Verkuil
2013-04-07 22:02   ` Frank Schäfer
2013-04-08  8:38     ` Hans Verkuil
2013-04-08 17:01       ` Frank Schäfer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5162F7CC.6010904@googlemail.com \
    --to=fschaefer.oss@googlemail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).