[linux-dvb] af9005/mt2060 module unload failure

Michael Krufky mkrufky at linuxtv.org
Thu Jun 14 22:52:49 CEST 2007

Luca Olivetti wrote:
> En/na Michael Krufky ha escrit:
>> Luca Olivetti wrote:
>>> En/na Trent Piepho ha escrit:
>>>> On Thu, 14 Jun 2007, Luca Olivetti wrote:
>>>>> En/na Michael Krufky ha escrit:
>>>>>>> Why dont you just use dvb_frontend_detach?
>>>>>> I retract that comment...
>>>>>> The dvb-usb framework does this itself inside dvb-usb-dvb.c , inside
>>>>>> dvb_usb_adapter_frontend_exit
>>>>>> ... You should not have to do the symbol_put inside af9005-fe.c
>>>>>>   If you remove that code, does it fix the issue?
>>>>> Well, I'm doing the attach myself to attach the tuner to the frontend
>>>>> the first time it is opened, so if I remove the code there will be at
>>>>> least one reference to the mt2060 (or qt1010, depending on the model) so
>>>>> it cannot be unloaded.
>>>> The tuner gets attached once when you call dvb_attach() from
>>>> af9005_fe_init.  It will get detached once when dvb_frontend_detach() is
>>>> called.  Everything balanced.
>>> but dvb_frontent_detach doesnt' know anynthing about the tuner (since 
>>> it's in the frontend private data), so if I don't do the put_symbol 
>>> myself in af9005_fe_release (as I do the dvb_attach myself in 
>>> af9005_fe_init) there will be a dangling reference count, yes?
>>> Bye
>> Luca,
>> You are incorrect -- dvb_frontend_detach has access to the entire "struct
>> dvb_frontend *fe" , and dvb-core will call fe->ops.tuner_ops.release function
>> itself and dvb_frontend_detach will handle the module detachment.
> Yes, but my tuner is in fe->demodulator_priv->tuner (probably a bad 
> design, mind me, but that's was the best I could come up with at the time).
> Bye


OK, I dont want to say anything more until I can give this code a thorough
review.  I'll get back to you as soon as I can -- hopefully it will be within 2


More information about the linux-dvb mailing list