Linux Media Controller development
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: "Maximilian Böhm" <maximilian.boehm@elbmurf.de>
Cc: paskripkin@gmail.com, hverkuil-cisco@xs4all.nl,
	sashal@kernel.org, linux-media@vger.kernel.org,
	Brad Love <brad@nextdimension.cc>
Subject: Re: Kernel hangs after DVB patch from July 2021 with Hauppauge WinTV dualHD
Date: Sat, 18 Dec 2021 10:15:19 +0100	[thread overview]
Message-ID: <20211218101519.756c027d@coco.lan> (raw)
In-Reply-To: <6a72a37b-e972-187d-0322-16336e12bdc5@elbmurf.de>

Em Sat, 18 Dec 2021 02:09:46 +0100
Maximilian Böhm <maximilian.boehm@elbmurf.de> escreveu:

> Hello Paul and the other people involved,
> 
> I’m a user of a Hauppauge WinTV dualHD DVB-T2 USB card and experiencing a bug since Linux 5.15.3 of which kernel bisecting brought me to a commit by you from Juli 29: "media: em28xx: add missing em28xx_close_extension".


So, basically this changeset: 2c98b8a3458d ("media: em28xx: add missing em28xx_close_extension")

> My problem: This TV stick doesn’t work for me after a wake up from a system standby, so I have to use the little helper tool usbreset to reset its USB connection.

What such patch should be doing is to ensure that the drivers will
do the right thing when the device is removed (or unbound).

It shouldn't have been called during suspend/resume. While this bug
should be fixed, the issue with suspend/resume callbacks also seem
to require additional work.

Now, I dunno what a "usbreset" tool would be doing, but I'm assuming
that it will be doing a unbind/bind sequence.

> But if I try this after Linux 5.15.3, I get a severe kernel error in dmesg, system hangs and I’m unable to proper reboot or shutdown. I have reported this on the kernel Bugzilla, including a dmesg log: https://bugzilla.kernel.org/show_bug.cgi?id=215241

Such patch should actually be fixing a use-after-free on disconnect.

Anyway, could you please try the enclosed patch?

> I hope you have an idea about how to stop this problem from occurring and I‘m willing to help testing a fix.
> Another thinkable fix would be to directly fix this TV stick’s standby-wake-up problem but I’m not savvy enough to determine if this would be the better option than to fix this hanging issue.

Yeah, that would be the best. Unfortunately, right now, I don't have 
any dual DVB-T em28xx-based board to test.

Thanks,
Mauro

[PATCH] media: em28xx: close exension first at dev_next

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index b451ce3cb169..08f34a8aab5e 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -4148,13 +4148,12 @@ static void em28xx_usb_disconnect(struct usb_interface *intf)
 
        flush_request_modules(dev);
 
-       em28xx_close_extension(dev);
-
        if (dev->dev_next) {
                em28xx_close_extension(dev->dev_next);
                em28xx_release_resources(dev->dev_next);
        }
 
+       em28xx_close_extension(dev);
        em28xx_release_resources(dev);
 
        if (dev->dev_next) {


  reply	other threads:[~2021-12-18  9:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18  1:09 Kernel hangs after DVB patch from July 2021 with Hauppauge WinTV dualHD Maximilian Böhm
2021-12-18  9:15 ` Mauro Carvalho Chehab [this message]
2021-12-18 14:23   ` Pavel Skripkin
2021-12-18 22:50     ` Maximilian Böhm
2021-12-20 14:39       ` Pavel Skripkin
2022-01-04 17:22         ` Maximilian Böhm
2022-01-04 17:31           ` Pavel Skripkin
2022-01-04 17:58             ` Maximilian Böhm
2022-01-06 11:54               ` Pavel Skripkin
2022-01-06 11:57                 ` Pavel Skripkin
2022-01-20 19:29                   ` Maximilian Böhm
2022-01-20 19:37                     ` [PATCH] Revert "media: em28xx: add missing em28xx_close_extension" Pavel Skripkin
2022-01-21 18:30                       ` Maximilian Böhm
2022-01-20 19:42                     ` Kernel hangs after DVB patch from July 2021 with Hauppauge WinTV dualHD Pavel Skripkin
2022-02-17 11:14                     ` Hans Verkuil
2022-02-18  0:16                       ` Maximilian Böhm
2022-02-18  7:58                         ` Hans Verkuil
2021-12-18 20:33   ` Robert Schlabbach
2021-12-18 20:51     ` Pavel Skripkin
2021-12-18 23:19   ` Maximilian Böhm

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=20211218101519.756c027d@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=brad@nextdimension.cc \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=maximilian.boehm@elbmurf.de \
    --cc=paskripkin@gmail.com \
    --cc=sashal@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox