All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Love <brad@nextdimension.cc>
To: Michael Ira Krufky <mkrufky@linuxtv.org>
Cc: linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH 7/9] lgdt3306a: Set fe ops.release to NULL if probed
Date: Thu, 4 Jan 2018 19:37:17 -0600	[thread overview]
Message-ID: <1c01e895-534c-0a97-4463-dd6f0179e0f6@nextdimension.cc> (raw)
In-Reply-To: <CAOcJUbxdODb2_txnrKgEa23-tq4AQzV4eGiDQuvXYNpofcvzAw@mail.gmail.com>



On 2018-01-04 18:19, Michael Ira Krufky wrote:
> On Thu, Jan 4, 2018 at 7:04 PM, Brad Love <brad@nextdimension.cc> wrote:
>> If release is part of frontend ops then it is called in the
>> course of dvb_frontend_detach. The process also decrements
>> the module usage count. The problem is if the lgdt3306a
>> driver is reached via i2c_new_device, then when it is
>> eventually destroyed remove is called, which further
>> decrements the module usage count to negative. After this
>> occurs the driver is in a bad state and no longer works.
>> Also fixed by NULLing out the release callback is a double
>> kfree of state, which introduces arbitrary oopses/GPF.
>> This problem is only currently reachable via the em28xx driver.
>>
>> On disconnect of Hauppauge SoloHD before:
>>
>> lsmod | grep lgdt3306a
>> lgdt3306a              28672  -1
>> i2c_mux                16384  1 lgdt3306a
>>
>> On disconnect of Hauppauge SoloHD after:
>>
>> lsmod | grep lgdt3306a
>> lgdt3306a              28672  0
>> i2c_mux                16384  1 lgdt3306a
>>
>> Signed-off-by: Brad Love <brad@nextdimension.cc>
>> ---
>>  drivers/media/dvb-frontends/lgdt3306a.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
> Brad,
>
> We won't be able to apply this one.  The symptom that you're trying to
> fix is indicative of some other problem, probably in the em28xx
> driver.  NULL'ing the release callback is not the right thing to do.
>
> -Mike Krufky

Hey Mike,

Redacting this patch to deal with individually. I will separately send
to the list an example of another bridge driver which exhibits the same
issue, when using the lgdt3306a driver similarly. I don't think this is
solely an em28xx issue. I will also send a patch fixing only the double
free, as that seems to be most important.

Cheers,

Brad





>> diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c
>> index 6356815..d2477ed 100644
>> --- a/drivers/media/dvb-frontends/lgdt3306a.c
>> +++ b/drivers/media/dvb-frontends/lgdt3306a.c
>> @@ -2177,6 +2177,7 @@ static int lgdt3306a_probe(struct i2c_client *client,
>>
>>         i2c_set_clientdata(client, fe->demodulator_priv);
>>         state = fe->demodulator_priv;
>> +       state->frontend.ops.release = NULL;
>>
>>         /* create mux i2c adapter for tuner */
>>         state->muxc = i2c_mux_alloc(client->adapter, &client->dev,
>> --
>> 2.7.4
>>

  reply	other threads:[~2018-01-05  1:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05  0:04 [PATCH 0/9] Hauppauge em28xx/lgdt3306a soloHD/DualHD support Brad Love
2018-01-05  0:04 ` [PATCH 1/9] em28xx: Hauppauge DualHD second tuner functionality Brad Love
2018-01-05  0:21   ` Michael Ira Krufky
2018-01-05  0:04 ` [PATCH 2/9] em28xx: Bulk transfer implementation fix Brad Love
2018-01-05  0:22   ` Michael Ira Krufky
2018-01-05 14:20     ` Devin Heitmueller
2018-01-05 15:21       ` Brad Love
2018-01-30 19:56       ` Brad Love
2018-01-30 12:07   ` Mauro Carvalho Chehab
2018-01-30 19:33     ` Brad Love
2018-02-01 22:04   ` [PATCH v2 " Brad Love
2018-01-05  0:04 ` [PATCH 3/9] em28xx: USB bulk packet size fix Brad Love
2018-01-05  0:23   ` Michael Ira Krufky
2018-01-05  0:04 ` [PATCH 4/9] em28xx: Increase max em28xx boards to max dvb adapters Brad Love
2018-01-05  0:23   ` Michael Ira Krufky
2018-01-05  0:04 ` [PATCH 5/9] em28xx: Add Hauppauge SoloHD/DualHD bulk models Brad Love
2018-01-05  0:24   ` Michael Ira Krufky
2018-01-05  0:04 ` [PATCH 6/9] em28xx: Enable Hauppauge SoloHD rebranded 292e SE Brad Love
2018-01-05  0:24   ` Michael Ira Krufky
2018-01-05  0:04 ` [PATCH 7/9] lgdt3306a: Set fe ops.release to NULL if probed Brad Love
2018-01-05  0:19   ` Michael Ira Krufky
2018-01-05  1:37     ` Brad Love [this message]
2018-01-09  5:17     ` Matthias Schwarzott
2018-01-09 13:00       ` Michael Ira Krufky
2018-01-05  0:04 ` [PATCH 8/9] lgdt3306a: QAM streaming improvement Brad Love
2018-01-05  0:26   ` Michael Ira Krufky
2018-01-05  1:34     ` Brad Love
2018-01-05  1:30   ` [PATCH v2 " Brad Love
2018-01-05 11:57     ` Michael Ira Krufky
2018-01-05  0:04 ` [PATCH 9/9] lgdt3306a: Add QAM AUTO support Brad Love
2018-01-05  0:27   ` Michael Ira Krufky
2018-02-12 20:52   ` [PATCH v2 " Brad Love

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=1c01e895-534c-0a97-4463-dd6f0179e0f6@nextdimension.cc \
    --to=brad@nextdimension.cc \
    --cc=linux-media@vger.kernel.org \
    --cc=mkrufky@linuxtv.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.