All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: linux-usb@vger.kernel.org, Wentong Wu <wentong.wu@intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH 2/3] usb: misc: ljca: set small runtime autosuspend delay
Date: Tue, 5 Nov 2024 15:42:11 +0100	[thread overview]
Message-ID: <Zyouw7LTmIB1hB5B@linux.intel.com> (raw)
In-Reply-To: <c669e2fd-5c6e-4f8d-bee3-1af4abb8b61a@redhat.com>

On Mon, Nov 04, 2024 at 02:50:31PM +0100, Hans de Goede wrote:
> Hi,
> 
> On 4-Nov-24 9:50 AM, Stanislaw Gruszka wrote:
> > On some Lenovo platforms, the patch workarounds problems with ov2740
> > sensor initialization, which manifest themself like below:
> > 
> > [    4.540476] ov2740 i2c-INT3474:01: error -EIO: failed to find sensor
> > [    4.542066] ov2740 i2c-INT3474:01: probe with driver ov2740 failed with error -5
> > 
> > or
> > 
> > [    7.742633] ov2740 i2c-INT3474:01: chip id mismatch: 2740 != 0
> > [    7.742638] ov2740 i2c-INT3474:01: error -ENXIO: failed to find sensor
> > 
> > and also by random failures of video stream start.
> > 
> > Issue can be reproduced by this script:
> > 
> > n=0
> > k=0
> > while [ $n -lt 50 ] ; do
> > 	sudo modprobe -r ov2740
> > 	sleep `expr $RANDOM % 5`
> > 	sudo modprobe ov2740
> > 	if media-ctl -p  | grep -q ov2740 ; then
> > 		let k++
> > 	fi
> > 	let n++
> > done
> > echo Success rate $k/$n
> > 
> > Without the patch, success rate is approximately 15 or 50 tries.
> > With the patch it does not fail.
> > 
> > This problem is some hardware or firmware malfunction, that can not be
> > easy debug and fix. While setting small autosuspend delay is not perfect
> > workaround as user can configure it to any value, it will prevent
> > the failures by default.
> > 
> > Additionally setting small autosuspend delay should have positive effect
> > on power consumption as for most ljca workloads device is used for just
> > a few milliseconds flowed by long periods of at least 100ms of inactivity
> > (usually more).
> > 
> > Fixes: acd6199f195d ("usb: Add support for Intel LJCA device")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> 
> Thank you so much for looking into this and fixing it!
> 
> Patch looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> I have also given this a test run on a "ThinkPad X1 Yoga Gen 8" and
> everything there works at least as well as before:
> 
> Tested-by: Hans de Goede <hdegoede@redhat.com> # ThinkPad X1 Yoga Gen 8, ov2740
> 
> Regards,
> 
> Hans
> 
> p.s.
> 
> I take it from the commit message that you have no clear idea what exactly is
> happening in the failure case ?

Yes, that's correct. We have only some suspicions, but none of them
was confirmed.

Regards
Stanislaw

  reply	other threads:[~2024-11-05 14:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04  8:50 [PATCH 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Stanislaw Gruszka
2024-11-04  8:50 ` [PATCH 2/3] usb: misc: ljca: set small runtime autosuspend delay Stanislaw Gruszka
2024-11-04 13:50   ` Hans de Goede
2024-11-05 14:42     ` Stanislaw Gruszka [this message]
2024-11-04 15:13   ` Sakari Ailus
2024-11-05  6:41     ` Stanislaw Gruszka
2024-11-04  8:50 ` [PATCH 3/3] usb: misc: ljca: print firmware version Stanislaw Gruszka
2024-11-04 13:51   ` Hans de Goede
2024-11-04 22:32   ` Sakari Ailus
2024-11-04 13:39 ` [PATCH 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Hans de Goede
2024-11-04 14:37   ` Stanislaw Gruszka

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=Zyouw7LTmIB1hB5B@linux.intel.com \
    --to=stanislaw.gruszka@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=wentong.wu@intel.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 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.