Re: [PATCH] media: rtl28xxu: add type-detection instrumentation

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

 



Hi,

I used dev_dbg instead of dev_info and got:
drivers/media/usb/dvb-usb-v2/rtl28xxu.c:648
[dvb_usb_rtl28xxu]rtl28xxu_identify_state =_ "failed=%d\012"
drivers/media/usb/dvb-usb-v2/rtl28xxu.c:640
[dvb_usb_rtl28xxu]rtl28xxu_identify_state =_ "chip_id=%u\012"
drivers/media/usb/dvb-usb-v2/rtl28xxu.c:630
[dvb_usb_rtl28xxu]rtl28xxu_identify_state =_ "%s - ret2 = %d\012"
drivers/media/usb/dvb-usb-v2/rtl28xxu.c:627
[dvb_usb_rtl28xxu]rtl28xxu_identify_state =_ "%s - ret1 = %d\012"
drivers/media/usb/dvb-usb-v2/rtl28xxu.c:620
[dvb_usb_rtl28xxu]rtl28xxu_identify_state =_ "\012"

dev_info does not show up with dmesg or dynamic debug. Should the
kernel use the CXD2837ER driver and not the mxl5005s driver like it
does with this patch.

On Sun, May 30, 2021 at 9:02 PM Johan Hovold <johan@xxxxxxxxxx> wrote:
>
> [ Please avoid top-posting; instead reply in-line as I do below. ]
>
> On Sun, May 30, 2021 at 06:57:12PM +0300, Eero Lehtinen wrote:
> > cat /sys/kernel/debug/dynamic_debug/control | grep rtl28xxu.c
>
> > drivers/media/usb/dvb-usb-v2/rtl28xxu.c:640
> > [dvb_usb_rtl28xxu]rtl28xxu_identify_state =_ "chip_id=%u\012"
>
> The dev_info() added by the instrumentation patch (included again below)
> should show up in dmesg if you applied it and rebuilt and installed the
> driver correctly.
>
> You can enable dynamic debugging as well to determine if the chip type
> is detected differently (with and without the zero-length control
> transfer patch), for example:
>
>         echo module dvb_usb_rtl28xxu +p > /sys/kernel/debug/dynamic_debug/control
>
> but it won't log the return value from the i2c read in question.
>
> > On Sun, May 30, 2021 at 4:54 PM Johan Hovold <johan@xxxxxxxxxx> wrote:
> > >
> > > On Sun, May 30, 2021 at 03:23:36PM +0300, Eero Lehtinen wrote:
> > > > Hi,
> > > >
> > > > I tested Johans latest patch and my dvb-t stick can find the channel
> > > > list but not to tune to them. It uses the mxl5005s driver again with
> > > > repeating mxl5005s I2C write failed messages:
> > > >
> > > > [   23.276076] mxl5005s I2C reset failed
>
> > > It was just an instrumentation patch to gather more information. Can you
> > > post the logs from when probing/using the device with that patch in
> > > place?
> > >
> > > Specifically, look for the "rtl28xxu_identify_state" entries, but please
> > > include the full log in case there are more hints in there.
> > >
> > > Also, please keep me and Alan on CC (along with the list) so that we get
> > > your replies directly. The list can be a bit slow at forwarding at
> > > times.
>
> 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
>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> ---
>  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