Re: USB: core: WARN if pipe direction != setup packet direction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 29, 2021 at 03:58:31PM -0400, Alan Stern wrote:
> Please don't top-post.  And for the third time, please CC your emails 
> to the mailing list.  If you don't, I will stop replying.
> 
> On Sat, May 29, 2021 at 10:41:51PM +0300, Eero wrote:
> > Hi,
> > 
> > The dvb-t stick works when I did that. Thank you.
> > 
> > BR, Eero
> > 
> > On Sat, 29 May 2021 15:21:36 -0400
> > > 
> > > Does the same problem occur if you don't apply Johan's rtl28xxu patch 
> > > and you revert commit 5cc59c418fde from 5.13.rc3-next?
> > > 
> > > Alan Stern
> 
> Johan, it appears that your patch making an empty I2C read actually 
> transfer one byte somehow causes a problem for this dvb-t stick.
> 
> Below is a copy of the original problem report.  Any ideas?

I'd start with verifying that the type is still detected correctly so
that the driver uses the right implementation (i.e. for rtl2831u instead
of rtl2832u or vice versa).

If that isn't the problem, it could be the 1-byte read request itself
that throws the firmware off and causes later accesses to fail even if
that seems a bit far-fetched.

> The patch removed the warning, but the usb dvb-t stick does not work
> because of looping messages in dmesg:
> [  418.485387] mxl5005s I2C write failed
> [  418.658410] mxl5005s I2C write failed
 
Eero, could you try the below patch on top of linux-next (i.e. without
the zero-length request patch) and send us the logs?

Johan


>From eda5deca4cbdebe21718bb13f76b8eed0673f9be Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@xxxxxxxxxx>
Date: Mon, 24 May 2021 10:55:19 +0200
Subject: [PATCH] media: rtl28xxu: add type-detection instrumentation

---
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 97ed17a141bb..21e565603108 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -612,8 +612,10 @@ static int rtl28xxu_read_config(struct dvb_usb_device *d)
 static int rtl28xxu_identify_state(struct dvb_usb_device *d, const char **name)
 {
 	struct rtl28xxu_dev *dev = d_to_priv(d);
+	u8 buf[1];
 	int ret;
 	struct rtl28xxu_req req_demod_i2c = {0x0020, CMD_I2C_DA_RD, 0, NULL};
+	struct rtl28xxu_req req_demod_i2c2 = {0x0020, CMD_I2C_DA_RD, 1, buf};
 
 	dev_dbg(&d->intf->dev, "\n");
 
@@ -622,6 +624,11 @@ static int rtl28xxu_identify_state(struct dvb_usb_device *d, const char **name)
 	 * by old RTL2831U.
 	 */
 	ret = rtl28xxu_ctrl_msg(d, &req_demod_i2c);
+	dev_info(&d->intf->dev, "%s - ret1 = %d\n", __func__, ret);
+
+	ret = rtl28xxu_ctrl_msg(d, &req_demod_i2c2);
+	dev_info(&d->intf->dev, "%s - ret2 = %d\n", __func__, ret);
+
 	if (ret == -EPIPE) {
 		dev->chip_id = CHIP_ID_RTL2831U;
 	} else if (ret == 0) {
-- 
2.31.1




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux