Re: Kernel 5.2.8 - au0828 - Tuner Is Busy
Hi Nathan, On 16/08/2019 13.18, Nathan Royce wrote: > Right up front, I must say I do NOT have a Hauppauge tuner. I think > it's like maybe Mygica/Geniatech: > Bus 002 Device 004: ID 05e1:0400 Syntek Semiconductor Co., Ltd > > Whenever I update my kernel, I edit the > ./drivers/media/usb/au0828/au0828-cards.c file adding an entry for my > 0x400 device. > I've been doing it for years and it's been working fine... until now... > > * > Aug 16 12:07:20 computerName kernel: usb 2-2.3: Tuner is busy. Error -19 > <...18 more repeated entries...> > Aug 16 12:07:20 computerName kernel: usb 2-2.3: Tuner is busy. Error -19 > Aug 16 12:07:10 computerName tvheadend[3276]: main: Log started > * > "w_scan" behaves the same way. > > * I don't have a "woodbury", but I have a Hauppauge 950Q sitting around and tested it on latest mainline kernel. w_scan is ok and streaming is fine. There's no unexpected errors. The 950Q uses the same au0828 bridge and au8522 demod as woodbury, but a different tuner. Your problem wouldn't appear to be a general au0828 issue. You might have to check out git bisect. That will be the quickest way to get to the bottom, if you've got points A and B, and are building/running your own kernel. Cheers, Brad > $ modprobe au0828 > Aug 16 12:52:52 computerName kernel: videodev: Linux video capture > interface: v2.00 > Aug 16 12:52:52 computerName kernel: au0828: au0828_init() Debugging is > enabled > Aug 16 12:52:52 computerName kernel: au0828: au0828 driver loaded > Aug 16 12:52:52 computerName kernel: au0828: au0828_usb_probe() vendor > id 0x5e1 device id 0x400 ifnum:0 > Aug 16 12:52:52 computerName kernel: au0828: au0828_gpio_setup() > Aug 16 12:52:52 computerName kernel: au0828: au0828_i2c_register() > Aug 16 12:52:52 computerName kernel: au0828: i2c bus registered > Aug 16 12:52:52 computerName kernel: au0828: au0828_card_setup() > Aug 16 12:52:52 computerName kernel: tveeprom: Encountered bad packet > header [20]. Corrupt or not a Hauppauge eeprom. > Aug 16 12:52:52 computerName kernel: au0828: hauppauge_eeprom: > warning: unknown hauppauge model #0 > Aug 16 12:52:52 computerName kernel: au0828: hauppauge_eeprom: > hauppauge eeprom: model=0 > Aug 16 12:52:52 computerName kernel: au0828: au0828_analog_register > called for intf#0! > Aug 16 12:52:52 computerName kernel: au0828: au0828_dvb_register() > Aug 16 12:52:52 computerName kernel: au8522 7-0047: creating new instance > Aug 16 12:52:52 computerName kernel: tda18271 7-0060: creating new instance > Aug 16 12:52:52 computerName kernel: tda18271: TDA18271HD/C2 detected @ 7-0060 > Aug 16 12:52:53 computerName kernel: au0828: dvb_register() > Aug 16 12:52:53 computerName kernel: dvbdev: DVB: registering new > adapter (au0828) > Aug 16 12:52:53 computerName kernel: usb 2-2.3: DVB: registering > adapter 0 frontend 0 (Auvitek AU8522 QAM/8VSB Frontend)... > Aug 16 12:52:53 computerName kernel: dvbdev: dvb_create_media_entity: > media entity 'Auvitek AU8522 QAM/8VSB Frontend' registered. > Aug 16 12:52:53 computerName kernel: dvbdev: dvb_create_media_entity: > media entity 'dvb-demux' registered. > Aug 16 12:52:53 computerName kernel: au0828: Registered device AU0828 > [Hauppauge Woodbury] > Aug 16 12:52:53 computerName kernel: usbcore: registered new interface > driver au0828 > * > The "eeprom" thing has never been an issue with regard to my tuner > working. It still worked in spite of it. > > It's odd because: > * > $ lsmod | grep au0828 > au0828 86016 0 > tveeprom 28672 1 au0828 > dvb_core 176128 1 au0828 > v4l2_common20480 1 au0828 > videobuf2_vmalloc 20480 2 dvb_core,au0828 > videobuf2_v4l2 28672 1 au0828 > videobuf2_common 61440 3 videobuf2_v4l2,dvb_core,au0828 > videodev 253952 4 > v4l2_common,videobuf2_v4l2,videobuf2_common,au0828 > rc_core61440 1 au0828 > media 61440 6 > videodev,snd_usb_audio,videobuf2_v4l2,dvb_core,videobuf2_common,au0828 > > $ ls -la /dev/dvb/adapter0/ > total 0 > drwxr-xr-x 2 root root 120 Aug 16 12:01 . > drwxr-xr-x 3 root root 60 Aug 16 12:01 .. > crw-rw+ 1 root video 212, 4 Aug 16 12:01 demux0 > crw-rw+ 1 root video 212, 5 Aug 16 12:01 dvr0 > crw-rw+ 1 root video 212, 3 Aug 16 12:01 frontend0 > crw-rw+ 1 root video 212, 7 Aug 16 12:01 net0 > * > > The previous kernel version I was on that worked was 5.1.15. > I just reverted back to the previous version and it's working again. > I don't know what broke and where, between the versions. > > I saw https://lkml.org/lkml/2019/1/21/1020 but this is back in January > so I don't know if something was more recently applied to au0828 that > makes use of the API. > "lsof" didn't show anything related to "/dev/dvb" being used. > > Oh neat! Someone posted a neat git feature which I tried and I get: > * > $ git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset > %s
Re: [PATCH v3] media: si2168: Refactor command setup code
Hi Marc, Replying inline. On 04/07/2019 05.33, Marc Gonzalez wrote: > Refactor the command setup code, and let the compiler determine > the size of each command. > > Reviewed-by: Jonathan Neuschäfer > Signed-off-by: Marc Gonzalez > --- > Changes from v1: > - Use a real function to populate struct si2168_cmd *cmd, and a trivial > macro wrapping it (macro because sizeof). > Changes from v2: > - Fix header mess > - Add Jonathan's tag > --- > drivers/media/dvb-frontends/si2168.c | 146 +-- > 1 file changed, 45 insertions(+), 101 deletions(-) > > diff --git a/drivers/media/dvb-frontends/si2168.c > b/drivers/media/dvb-frontends/si2168.c > index c64b360ce6b5..5e81e076369c 100644 > --- a/drivers/media/dvb-frontends/si2168.c > +++ b/drivers/media/dvb-frontends/si2168.c > @@ -12,6 +12,16 @@ > > static const struct dvb_frontend_ops si2168_ops; > > +static void cmd_setup(struct si2168_cmd *cmd, char *args, int wlen, int rlen) > +{ > + memcpy(cmd->args, args, wlen); > + cmd->wlen = wlen; > + cmd->rlen = rlen; > +} > + struct si2168_cmd.args is u8, not char. I also think const should apply to the pointer. > +#define CMD_SETUP(cmd, args, rlen) \ > + cmd_setup(cmd, args, sizeof(args) - 1, rlen) > + This is only a valid helper if args is a null terminated string. It just so happens that every instance in this driver is, but that could be a silent pitfall if someone used a u8 array with this macro. Otherwise I'm ok with the refactoring. Regards, Brad > /* execute firmware command */ > static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd > *cmd) > { > @@ -84,15 +94,13 @@ static int si2168_ts_bus_ctrl(struct dvb_frontend *fe, > int acquire) > dev_dbg(>dev, "%s acquire: %d\n", __func__, acquire); > > /* set TS_MODE property */ > - memcpy(cmd.args, "\x14\x00\x01\x10\x10\x00", 6); > + CMD_SETUP(, "\x14\x00\x01\x10\x10\x00", 4); > if (acquire) > cmd.args[4] |= dev->ts_mode; > else > cmd.args[4] |= SI2168_TS_TRISTATE; > if (dev->ts_clock_gapped) > cmd.args[4] |= 0x40; > - cmd.wlen = 6; > - cmd.rlen = 4; > ret = si2168_cmd_execute(client, ); > > return ret; > @@ -116,19 +124,13 @@ static int si2168_read_status(struct dvb_frontend *fe, > enum fe_status *status) > > switch (c->delivery_system) { > case SYS_DVBT: > - memcpy(cmd.args, "\xa0\x01", 2); > - cmd.wlen = 2; > - cmd.rlen = 13; > + CMD_SETUP(, "\xa0\x01", 13); > break; > case SYS_DVBC_ANNEX_A: > - memcpy(cmd.args, "\x90\x01", 2); > - cmd.wlen = 2; > - cmd.rlen = 9; > + CMD_SETUP(, "\x90\x01", 9); > break; > case SYS_DVBT2: > - memcpy(cmd.args, "\x50\x01", 2); > - cmd.wlen = 2; > - cmd.rlen = 14; > + CMD_SETUP(, "\x50\x01", 14); > break; > default: > ret = -EINVAL; > @@ -165,9 +167,7 @@ static int si2168_read_status(struct dvb_frontend *fe, > enum fe_status *status) > > /* BER */ > if (*status & FE_HAS_VITERBI) { > - memcpy(cmd.args, "\x82\x00", 2); > - cmd.wlen = 2; > - cmd.rlen = 3; > + CMD_SETUP(, "\x82\x00", 3); > ret = si2168_cmd_execute(client, ); > if (ret) > goto err; > @@ -198,9 +198,7 @@ static int si2168_read_status(struct dvb_frontend *fe, > enum fe_status *status) > > /* UCB */ > if (*status & FE_HAS_SYNC) { > - memcpy(cmd.args, "\x84\x01", 2); > - cmd.wlen = 2; > - cmd.rlen = 3; > + CMD_SETUP(, "\x84\x01", 3); > ret = si2168_cmd_execute(client, ); > if (ret) > goto err; > @@ -286,22 +284,18 @@ static int si2168_set_frontend(struct dvb_frontend *fe) > goto err; > } > > - memcpy(cmd.args, "\x88\x02\x02\x02\x02", 5); > - cmd.wlen = 5; > - cmd.rlen = 5; > + CMD_SETUP(, "\x88\x02\x02\x02\x02", 5); > ret = si2168_cmd_execute(client, ); > if (ret) > goto err; > > /* that has no big effect */ > if (c->delivery_system == SYS_DVBT) > - memcpy(cmd.args, "\x89\x21\x06\x11\xff\x98", 6); > + CMD_SETUP(, "\x89\x21\x06\x11\xff\x98", 3); > else if (c->delivery_system == SYS_DVBC_ANNEX_A) > - memcpy(cmd.args, "\x89\x21\x06\x11\x89\xf0", 6); > + CMD_SETUP(, "\x89\x21\x06\x11\x89\xf0", 3); > else if (c->delivery_system == SYS_DVBT2) > - memcpy(cmd.args, "\x89\x21\x06\x11\x89\x20", 6); > - cmd.wlen = 6; > - cmd.rlen = 3; > + CMD_SETUP(, "\x89\x21\x06\x11\x89\x20", 3); > ret = si2168_cmd_execute(client, ); > if (ret) > goto err; > @@ -318,103
Re: [PATCH] media: lgdt3306a: fix lgdt3306a_search()'s return type
Acked-by: Brad Love <b...@nextdimension.cc> On 2018-04-24 08:19, Luc Van Oostenryck wrote: > The method dvb_frontend_ops::search() is defined as > returning an 'enum dvbfe_search', but the implementation in this > driver returns an 'int'. > > Fix this by returning 'enum dvbfe_search' in this driver too. > > Signed-off-by: Luc Van Oostenryck <luc.vanoostenr...@gmail.com> > --- > drivers/media/dvb-frontends/lgdt3306a.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/dvb-frontends/lgdt3306a.c > b/drivers/media/dvb-frontends/lgdt3306a.c > index 7eb4e1469..32de82447 100644 > --- a/drivers/media/dvb-frontends/lgdt3306a.c > +++ b/drivers/media/dvb-frontends/lgdt3306a.c > @@ -1784,7 +1784,7 @@ static int lgdt3306a_get_tune_settings(struct > dvb_frontend *fe, > return 0; > } > > -static int lgdt3306a_search(struct dvb_frontend *fe) > +static enum dvbfe_search lgdt3306a_search(struct dvb_frontend *fe) > { > enum fe_status status = 0; > int ret;
Re: [PATCH] media: lgdt3306a: fix lgdt3306a_search()'s return type
Acked-by: Brad Love On 2018-04-24 08:19, Luc Van Oostenryck wrote: > The method dvb_frontend_ops::search() is defined as > returning an 'enum dvbfe_search', but the implementation in this > driver returns an 'int'. > > Fix this by returning 'enum dvbfe_search' in this driver too. > > Signed-off-by: Luc Van Oostenryck > --- > drivers/media/dvb-frontends/lgdt3306a.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/dvb-frontends/lgdt3306a.c > b/drivers/media/dvb-frontends/lgdt3306a.c > index 7eb4e1469..32de82447 100644 > --- a/drivers/media/dvb-frontends/lgdt3306a.c > +++ b/drivers/media/dvb-frontends/lgdt3306a.c > @@ -1784,7 +1784,7 @@ static int lgdt3306a_get_tune_settings(struct > dvb_frontend *fe, > return 0; > } > > -static int lgdt3306a_search(struct dvb_frontend *fe) > +static enum dvbfe_search lgdt3306a_search(struct dvb_frontend *fe) > { > enum fe_status status = 0; > int ret;