* [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response
@ 2024-11-12 7:55 Stanislaw Gruszka
2024-11-12 7:55 ` [PATCH v4 2/3] usb: misc: ljca: set small runtime autosuspend delay Stanislaw Gruszka
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Stanislaw Gruszka @ 2024-11-12 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, Wentong Wu, Sakari Ailus, Hans de Goede
Do not mark interface as ready to suspend when we are still waiting
for response messages from the device.
Fixes: acd6199f195d ("usb: Add support for Intel LJCA device")
Cc: stable@vger.kernel.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com> # ThinkPad X1 Yoga Gen 8, ov2740
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
---
v3 -> v4: no change in this patch
v2 -> v3: add A-b tag from Sakari
v1 -> v2: fix handing error of usb_autopm_get_interface(),
add R-b, T-b tags from Hans
drivers/usb/misc/usb-ljca.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c
index 01ceafc4ab78..8056c65e4548 100644
--- a/drivers/usb/misc/usb-ljca.c
+++ b/drivers/usb/misc/usb-ljca.c
@@ -332,14 +332,11 @@ static int ljca_send(struct ljca_adapter *adap, u8 type, u8 cmd,
ret = usb_bulk_msg(adap->usb_dev, adap->tx_pipe, header,
msg_len, &transferred, LJCA_WRITE_TIMEOUT_MS);
-
- usb_autopm_put_interface(adap->intf);
-
if (ret < 0)
- goto out;
+ goto out_put;
if (transferred != msg_len) {
ret = -EIO;
- goto out;
+ goto out_put;
}
if (ack) {
@@ -347,11 +344,14 @@ static int ljca_send(struct ljca_adapter *adap, u8 type, u8 cmd,
timeout);
if (!ret) {
ret = -ETIMEDOUT;
- goto out;
+ goto out_put;
}
}
ret = adap->actual_length;
+out_put:
+ usb_autopm_put_interface(adap->intf);
+
out:
spin_lock_irqsave(&adap->lock, flags);
adap->ex_buf = NULL;
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v4 2/3] usb: misc: ljca: set small runtime autosuspend delay 2024-11-12 7:55 [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Stanislaw Gruszka @ 2024-11-12 7:55 ` Stanislaw Gruszka 2024-11-12 7:55 ` [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute Stanislaw Gruszka 2024-11-12 10:13 ` [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Hans de Goede 2 siblings, 0 replies; 7+ messages in thread From: Stanislaw Gruszka @ 2024-11-12 7:55 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: linux-usb, Wentong Wu, Sakari Ailus, Hans de Goede On some Lenovo platforms, the patch works around 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 Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com> # ThinkPad X1 Yoga Gen 8, ov2740 Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> --- v3 -> v4: no change in this patch v2 -> v3: add A-b tag from Sakari v1 -> v2: add R-b, T-b tags from Hans drivers/usb/misc/usb-ljca.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c index 8056c65e4548..d9c21f783055 100644 --- a/drivers/usb/misc/usb-ljca.c +++ b/drivers/usb/misc/usb-ljca.c @@ -811,6 +811,14 @@ static int ljca_probe(struct usb_interface *interface, if (ret) goto err_free; + /* + * This works around problems with ov2740 initialization on some + * Lenovo platforms. The autosuspend delay, has to be smaller than + * the delay after setting the reset_gpio line in ov2740_resume(). + * Otherwise the sensor randomly fails to initialize. + */ + pm_runtime_set_autosuspend_delay(&usb_dev->dev, 10); + usb_enable_autosuspend(usb_dev); return 0; -- 2.34.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute 2024-11-12 7:55 [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Stanislaw Gruszka 2024-11-12 7:55 ` [PATCH v4 2/3] usb: misc: ljca: set small runtime autosuspend delay Stanislaw Gruszka @ 2024-11-12 7:55 ` Stanislaw Gruszka 2024-11-12 8:06 ` Greg Kroah-Hartman 2024-11-12 13:05 ` kernel test robot 2024-11-12 10:13 ` [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Hans de Goede 2 siblings, 2 replies; 7+ messages in thread From: Stanislaw Gruszka @ 2024-11-12 7:55 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: linux-usb, Wentong Wu, Sakari Ailus, Hans de Goede For diagnostics purpose read firmware version during probe and add sysfs attribute to make that information available. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> --- v3->v4: use sysfs attribute to provide firmware version, drop tags from Hans since the code changed v2->v3: use dev_dbg() for printing the firmware version v1->v2: fix 80-chars line wrap .../ABI/testing/sysfs-bus-usb-devices-ljca | 9 ++++ drivers/usb/misc/usb-ljca.c | 53 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-usb-devices-ljca diff --git a/Documentation/ABI/testing/sysfs-bus-usb-devices-ljca b/Documentation/ABI/testing/sysfs-bus-usb-devices-ljca new file mode 100644 index 000000000000..f5eb38bf99a8 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-usb-devices-ljca @@ -0,0 +1,9 @@ +What: /sys/bus/usb/devices/.../ljca_version +Date: November 2024 +KernelVersion: 6.13 +Contact: Sakari Ailus <sakari.ailus@linux.intel.com> +Description: + Provides the firmware version of LJCA device. + The format is Major.Minor.Patch.Build, where + Major, Minor, Patch, and Build are decimal numbers. + For example: 1.0.0.256 diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c index d9c21f783055..4b5bd5b27b2a 100644 --- a/drivers/usb/misc/usb-ljca.c +++ b/drivers/usb/misc/usb-ljca.c @@ -43,6 +43,7 @@ enum ljca_client_type { /* MNG client commands */ enum ljca_mng_cmd { + LJCA_MNG_GET_VERSION = 1, LJCA_MNG_RESET = 2, LJCA_MNG_ENUM_GPIO = 4, LJCA_MNG_ENUM_I2C = 5, @@ -68,6 +69,13 @@ struct ljca_msg { u8 data[] __counted_by(len); } __packed; +struct ljca_fw_version { + u8 major; + u8 minor; + __le16 patch; + __le16 build; +} __packed; + struct ljca_i2c_ctr_info { u8 id; u8 capacity; @@ -152,8 +160,10 @@ struct ljca_adapter { struct mutex mutex; struct list_head client_list; + struct ljca_fw_version fw_version; bool disconnect; + bool fw_version_valid; u32 reset_id; }; @@ -740,6 +750,24 @@ static int ljca_enumerate_clients(struct ljca_adapter *adap) return ret; } +static void ljca_read_fw_version(struct ljca_adapter *adap) +{ + struct ljca_fw_version version; + int ret; + + ret = ljca_send(adap, LJCA_CLIENT_MNG, LJCA_MNG_GET_VERSION, NULL, 0, + (u8 *)&version, sizeof(version), true, + LJCA_WRITE_ACK_TIMEOUT_MS); + + if (ret != sizeof(version)) { + dev_err(adap->dev, "Get version failed, ret: %d\n", ret); + return; + } + + adap->fw_version = version; + adap->fw_version_valid = true; +} + static int ljca_probe(struct usb_interface *interface, const struct usb_device_id *id) { @@ -811,6 +839,8 @@ static int ljca_probe(struct usb_interface *interface, if (ret) goto err_free; + ljca_read_fw_version(adap); + /* * This works around problems with ov2740 initialization on some * Lenovo platforms. The autosuspend delay, has to be smaller than @@ -874,6 +904,28 @@ static int ljca_resume(struct usb_interface *interface) return usb_submit_urb(adap->rx_urb, GFP_KERNEL); } +static ssize_t ljca_version_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct usb_interface *intf = to_usb_interface(dev); + struct ljca_adapter *adap = usb_get_intfdata(intf); + struct ljca_fw_version ver = adap->fw_version; + + if (!adap->fw_version_valid) + return -ENODATA; + + return sysfs_emit(buf, "%d.%d.%d.%d\n", ver.major, ver.minor, + le16_to_cpu(ver.patch), le16_to_cpu(ver.build)); +} + +static DEVICE_ATTR_RO(ljca_version); + +static struct attribute *ljca_attrs[] = { + &dev_attr_ljca_version.attr, +}; + +ATTRIBUTE_GROUPS(ljca); + static const struct usb_device_id ljca_table[] = { { USB_DEVICE(0x8086, 0x0b63) }, { /* sentinel */ } @@ -888,6 +940,7 @@ static struct usb_driver ljca_driver = { .suspend = ljca_suspend, .resume = ljca_resume, .supports_autosuspend = 1, + .dev_groups = ljca_groups, }; module_usb_driver(ljca_driver); -- 2.34.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute 2024-11-12 7:55 ` [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute Stanislaw Gruszka @ 2024-11-12 8:06 ` Greg Kroah-Hartman 2024-11-12 13:05 ` kernel test robot 1 sibling, 0 replies; 7+ messages in thread From: Greg Kroah-Hartman @ 2024-11-12 8:06 UTC (permalink / raw) To: Stanislaw Gruszka; +Cc: linux-usb, Wentong Wu, Sakari Ailus, Hans de Goede On Tue, Nov 12, 2024 at 08:55:14AM +0100, Stanislaw Gruszka wrote: > For diagnostics purpose read firmware version during probe and add > sysfs attribute to make that information available. > > Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> > --- > v3->v4: use sysfs attribute to provide firmware version, > drop tags from Hans since the code changed > v2->v3: use dev_dbg() for printing the firmware version > v1->v2: fix 80-chars line wrap > > .../ABI/testing/sysfs-bus-usb-devices-ljca | 9 ++++ > drivers/usb/misc/usb-ljca.c | 53 +++++++++++++++++++ > 2 files changed, 62 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-bus-usb-devices-ljca > > diff --git a/Documentation/ABI/testing/sysfs-bus-usb-devices-ljca b/Documentation/ABI/testing/sysfs-bus-usb-devices-ljca > new file mode 100644 > index 000000000000..f5eb38bf99a8 > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-bus-usb-devices-ljca > @@ -0,0 +1,9 @@ > +What: /sys/bus/usb/devices/.../ljca_version > +Date: November 2024 > +KernelVersion: 6.13 > +Contact: Sakari Ailus <sakari.ailus@linux.intel.com> > +Description: > + Provides the firmware version of LJCA device. > + The format is Major.Minor.Patch.Build, where > + Major, Minor, Patch, and Build are decimal numbers. > + For example: 1.0.0.256 > diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c > index d9c21f783055..4b5bd5b27b2a 100644 > --- a/drivers/usb/misc/usb-ljca.c > +++ b/drivers/usb/misc/usb-ljca.c > @@ -43,6 +43,7 @@ enum ljca_client_type { > > /* MNG client commands */ > enum ljca_mng_cmd { > + LJCA_MNG_GET_VERSION = 1, > LJCA_MNG_RESET = 2, > LJCA_MNG_ENUM_GPIO = 4, > LJCA_MNG_ENUM_I2C = 5, > @@ -68,6 +69,13 @@ struct ljca_msg { > u8 data[] __counted_by(len); > } __packed; > > +struct ljca_fw_version { > + u8 major; > + u8 minor; > + __le16 patch; > + __le16 build; > +} __packed; > + > struct ljca_i2c_ctr_info { > u8 id; > u8 capacity; > @@ -152,8 +160,10 @@ struct ljca_adapter { > struct mutex mutex; > > struct list_head client_list; > + struct ljca_fw_version fw_version; > > bool disconnect; > + bool fw_version_valid; > > u32 reset_id; > }; > @@ -740,6 +750,24 @@ static int ljca_enumerate_clients(struct ljca_adapter *adap) > return ret; > } > > +static void ljca_read_fw_version(struct ljca_adapter *adap) > +{ > + struct ljca_fw_version version; > + int ret; > + > + ret = ljca_send(adap, LJCA_CLIENT_MNG, LJCA_MNG_GET_VERSION, NULL, 0, > + (u8 *)&version, sizeof(version), true, > + LJCA_WRITE_ACK_TIMEOUT_MS); > + > + if (ret != sizeof(version)) { > + dev_err(adap->dev, "Get version failed, ret: %d\n", ret); > + return; > + } > + > + adap->fw_version = version; > + adap->fw_version_valid = true; > +} > + > static int ljca_probe(struct usb_interface *interface, > const struct usb_device_id *id) > { > @@ -811,6 +839,8 @@ static int ljca_probe(struct usb_interface *interface, > if (ret) > goto err_free; > > + ljca_read_fw_version(adap); > + > /* > * This works around problems with ov2740 initialization on some > * Lenovo platforms. The autosuspend delay, has to be smaller than > @@ -874,6 +904,28 @@ static int ljca_resume(struct usb_interface *interface) > return usb_submit_urb(adap->rx_urb, GFP_KERNEL); > } > > +static ssize_t ljca_version_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + struct usb_interface *intf = to_usb_interface(dev); > + struct ljca_adapter *adap = usb_get_intfdata(intf); > + struct ljca_fw_version ver = adap->fw_version; > + > + if (!adap->fw_version_valid) > + return -ENODATA; Why are you showing this sysfs attribute if there is no firmware version? Please only create the file if it is possible to read a valid value from it. thanks, greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute 2024-11-12 7:55 ` [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute Stanislaw Gruszka 2024-11-12 8:06 ` Greg Kroah-Hartman @ 2024-11-12 13:05 ` kernel test robot 1 sibling, 0 replies; 7+ messages in thread From: kernel test robot @ 2024-11-12 13:05 UTC (permalink / raw) To: Stanislaw Gruszka, Greg Kroah-Hartman Cc: oe-kbuild-all, linux-usb, Wentong Wu, Sakari Ailus, Hans de Goede Hi Stanislaw, kernel test robot noticed the following build warnings: [auto build test WARNING on usb/usb-testing] [also build test WARNING on usb/usb-next usb/usb-linus westeri-thunderbolt/next linus/master v6.12-rc7 next-20241112] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Stanislaw-Gruszka/usb-misc-ljca-set-small-runtime-autosuspend-delay/20241112-155844 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing patch link: https://lore.kernel.org/r/20241112075514.680712-3-stanislaw.gruszka%40linux.intel.com patch subject: [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20241112/202411122028.tylKQSQx-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241112/202411122028.tylKQSQx-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202411122028.tylKQSQx-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/usb/misc/usb-ljca.c:169: warning: Function parameter or struct member 'fw_version' not described in 'ljca_adapter' >> drivers/usb/misc/usb-ljca.c:169: warning: Function parameter or struct member 'fw_version_valid' not described in 'ljca_adapter' vim +169 drivers/usb/misc/usb-ljca.c acd6199f195d6de Wentong Wu 2023-10-09 114 acd6199f195d6de Wentong Wu 2023-10-09 115 /** acd6199f195d6de Wentong Wu 2023-10-09 116 * struct ljca_adapter - represent a ljca adapter acd6199f195d6de Wentong Wu 2023-10-09 117 * acd6199f195d6de Wentong Wu 2023-10-09 118 * @intf: the usb interface for this ljca adapter acd6199f195d6de Wentong Wu 2023-10-09 119 * @usb_dev: the usb device for this ljca adapter acd6199f195d6de Wentong Wu 2023-10-09 120 * @dev: the specific device info of the usb interface acd6199f195d6de Wentong Wu 2023-10-09 121 * @rx_pipe: bulk in pipe for receive data from firmware acd6199f195d6de Wentong Wu 2023-10-09 122 * @tx_pipe: bulk out pipe for send data to firmware acd6199f195d6de Wentong Wu 2023-10-09 123 * @rx_urb: urb used for the bulk in pipe acd6199f195d6de Wentong Wu 2023-10-09 124 * @rx_buf: buffer used to receive command response and event acd6199f195d6de Wentong Wu 2023-10-09 125 * @rx_len: length of rx buffer acd6199f195d6de Wentong Wu 2023-10-09 126 * @ex_buf: external buffer to save command response acd6199f195d6de Wentong Wu 2023-10-09 127 * @ex_buf_len: length of external buffer acd6199f195d6de Wentong Wu 2023-10-09 128 * @actual_length: actual length of data copied to external buffer acd6199f195d6de Wentong Wu 2023-10-09 129 * @tx_buf: buffer used to download command to firmware acd6199f195d6de Wentong Wu 2023-10-09 130 * @tx_buf_len: length of tx buffer acd6199f195d6de Wentong Wu 2023-10-09 131 * @lock: spinlock to protect tx_buf and ex_buf acd6199f195d6de Wentong Wu 2023-10-09 132 * @cmd_completion: completion object as the command receives ack acd6199f195d6de Wentong Wu 2023-10-09 133 * @mutex: mutex to avoid command download concurrently acd6199f195d6de Wentong Wu 2023-10-09 134 * @client_list: client device list acd6199f195d6de Wentong Wu 2023-10-09 135 * @disconnect: usb disconnect ongoing or not acd6199f195d6de Wentong Wu 2023-10-09 136 * @reset_id: used to reset firmware acd6199f195d6de Wentong Wu 2023-10-09 137 */ acd6199f195d6de Wentong Wu 2023-10-09 138 struct ljca_adapter { acd6199f195d6de Wentong Wu 2023-10-09 139 struct usb_interface *intf; acd6199f195d6de Wentong Wu 2023-10-09 140 struct usb_device *usb_dev; acd6199f195d6de Wentong Wu 2023-10-09 141 struct device *dev; acd6199f195d6de Wentong Wu 2023-10-09 142 acd6199f195d6de Wentong Wu 2023-10-09 143 unsigned int rx_pipe; acd6199f195d6de Wentong Wu 2023-10-09 144 unsigned int tx_pipe; acd6199f195d6de Wentong Wu 2023-10-09 145 acd6199f195d6de Wentong Wu 2023-10-09 146 struct urb *rx_urb; acd6199f195d6de Wentong Wu 2023-10-09 147 void *rx_buf; acd6199f195d6de Wentong Wu 2023-10-09 148 unsigned int rx_len; acd6199f195d6de Wentong Wu 2023-10-09 149 acd6199f195d6de Wentong Wu 2023-10-09 150 u8 *ex_buf; acd6199f195d6de Wentong Wu 2023-10-09 151 u8 ex_buf_len; acd6199f195d6de Wentong Wu 2023-10-09 152 u8 actual_length; acd6199f195d6de Wentong Wu 2023-10-09 153 acd6199f195d6de Wentong Wu 2023-10-09 154 void *tx_buf; acd6199f195d6de Wentong Wu 2023-10-09 155 u8 tx_buf_len; acd6199f195d6de Wentong Wu 2023-10-09 156 acd6199f195d6de Wentong Wu 2023-10-09 157 spinlock_t lock; acd6199f195d6de Wentong Wu 2023-10-09 158 acd6199f195d6de Wentong Wu 2023-10-09 159 struct completion cmd_completion; acd6199f195d6de Wentong Wu 2023-10-09 160 struct mutex mutex; acd6199f195d6de Wentong Wu 2023-10-09 161 acd6199f195d6de Wentong Wu 2023-10-09 162 struct list_head client_list; 1368856f90435bb Stanislaw Gruszka 2024-11-12 163 struct ljca_fw_version fw_version; acd6199f195d6de Wentong Wu 2023-10-09 164 acd6199f195d6de Wentong Wu 2023-10-09 165 bool disconnect; 1368856f90435bb Stanislaw Gruszka 2024-11-12 166 bool fw_version_valid; acd6199f195d6de Wentong Wu 2023-10-09 167 acd6199f195d6de Wentong Wu 2023-10-09 168 u32 reset_id; acd6199f195d6de Wentong Wu 2023-10-09 @169 }; acd6199f195d6de Wentong Wu 2023-10-09 170 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response 2024-11-12 7:55 [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Stanislaw Gruszka 2024-11-12 7:55 ` [PATCH v4 2/3] usb: misc: ljca: set small runtime autosuspend delay Stanislaw Gruszka 2024-11-12 7:55 ` [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute Stanislaw Gruszka @ 2024-11-12 10:13 ` Hans de Goede 2024-11-12 10:33 ` Greg Kroah-Hartman 2 siblings, 1 reply; 7+ messages in thread From: Hans de Goede @ 2024-11-12 10:13 UTC (permalink / raw) To: Stanislaw Gruszka, Greg Kroah-Hartman; +Cc: linux-usb, Wentong Wu, Sakari Ailus Greg, This patch 1/3 + patch 2/3 together fix an issue causing the camera to not work on quite a few ThinkPad models. Can you maybe pick up patch 1/3 + patch 2/3 already, while Stanislaw works on fixing 3/3 ? Regards, Hans On 12-Nov-24 8:55 AM, Stanislaw Gruszka wrote: > Do not mark interface as ready to suspend when we are still waiting > for response messages from the device. > > Fixes: acd6199f195d ("usb: Add support for Intel LJCA device") > Cc: stable@vger.kernel.org > Reviewed-by: Hans de Goede <hdegoede@redhat.com> > Tested-by: Hans de Goede <hdegoede@redhat.com> # ThinkPad X1 Yoga Gen 8, ov2740 > Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> > --- > v3 -> v4: no change in this patch > v2 -> v3: add A-b tag from Sakari > v1 -> v2: fix handing error of usb_autopm_get_interface(), > add R-b, T-b tags from Hans > > drivers/usb/misc/usb-ljca.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c > index 01ceafc4ab78..8056c65e4548 100644 > --- a/drivers/usb/misc/usb-ljca.c > +++ b/drivers/usb/misc/usb-ljca.c > @@ -332,14 +332,11 @@ static int ljca_send(struct ljca_adapter *adap, u8 type, u8 cmd, > > ret = usb_bulk_msg(adap->usb_dev, adap->tx_pipe, header, > msg_len, &transferred, LJCA_WRITE_TIMEOUT_MS); > - > - usb_autopm_put_interface(adap->intf); > - > if (ret < 0) > - goto out; > + goto out_put; > if (transferred != msg_len) { > ret = -EIO; > - goto out; > + goto out_put; > } > > if (ack) { > @@ -347,11 +344,14 @@ static int ljca_send(struct ljca_adapter *adap, u8 type, u8 cmd, > timeout); > if (!ret) { > ret = -ETIMEDOUT; > - goto out; > + goto out_put; > } > } > ret = adap->actual_length; > > +out_put: > + usb_autopm_put_interface(adap->intf); > + > out: > spin_lock_irqsave(&adap->lock, flags); > adap->ex_buf = NULL; ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response 2024-11-12 10:13 ` [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Hans de Goede @ 2024-11-12 10:33 ` Greg Kroah-Hartman 0 siblings, 0 replies; 7+ messages in thread From: Greg Kroah-Hartman @ 2024-11-12 10:33 UTC (permalink / raw) To: Hans de Goede; +Cc: Stanislaw Gruszka, linux-usb, Wentong Wu, Sakari Ailus On Tue, Nov 12, 2024 at 11:13:55AM +0100, Hans de Goede wrote: > Greg, > > This patch 1/3 + patch 2/3 together fix an issue causing the camera to not > work on quite a few ThinkPad models. > > Can you maybe pick up patch 1/3 + patch 2/3 already, while > Stanislaw works on fixing 3/3 ? Yes, I'll do that later today, good idea. Mixing new feaures and bug fixes shouldn't be in the same patch series, again, Intel developers should know better if this were to actually pass their internal review process (which seems to keep being ignored here...) thanks, greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-12 13:06 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-11-12 7:55 [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Stanislaw Gruszka 2024-11-12 7:55 ` [PATCH v4 2/3] usb: misc: ljca: set small runtime autosuspend delay Stanislaw Gruszka 2024-11-12 7:55 ` [PATCH v4 3/3] usb: misc: ljca: add firmware version sysfs attribute Stanislaw Gruszka 2024-11-12 8:06 ` Greg Kroah-Hartman 2024-11-12 13:05 ` kernel test robot 2024-11-12 10:13 ` [PATCH v4 1/3] usb: misc: ljca: move usb_autopm_put_interface() after wait for response Hans de Goede 2024-11-12 10:33 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox