linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* netup_unidvb CI problem
@ 2016-05-28  9:47 Saso Slavicic
  2016-05-28 15:34 ` Saso Slavicic
  0 siblings, 1 reply; 2+ messages in thread
From: Saso Slavicic @ 2016-05-28  9:47 UTC (permalink / raw)
  To: linux-media

Hi,

I have a problem with CI slots on NetUP Dual DVB Universal CI card.  Running
kernel-ml 4.4 on Centos 7 produces the following error:

[765846.415719] netup_unidvb 0000:11:00.0: DVB init done, num=1
[765846.415721] dvb_ca_en50221_init
[765846.415804] DVB: register adapter0/ca0 @ minor: 24 (0x18)
[765846.415893] netup_unidvb 0000:11:00.0: netup_unidvb_ci_register(): CI
adapter 0 init done
[765846.415895] dvb_ca_en50221_thread
[765846.415901] dvb_ca_en50221_init
[765846.416081] DVB: register adapter1/ca0 @ minor: 25 (0x19)
[765846.417708] netup_unidvb 0000:11:00.0: netup_unidvb_ci_register(): CI
adapter 1 init done
[765846.417710] dvb_ca_en50221_thread
[765846.417719] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): starting
DMA0
[765846.417727] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): DMA0
buffer virt/phys 0xffff880073f00000/0x73f00000 size 192512
[765847.417870] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): starting
DMA1
[765847.417878] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): DMA1
buffer virt/phys 0xffff880073f2f000/0x73f2f000 size 192512
[765848.418819] netup_unidvb:netup_unidvb_dma_enable:190: netup_unidvb
0000:11:00.0: netup_unidvb_dma_enable(): DMA0 enable 0
[765848.418827] netup_unidvb:netup_unidvb_dma_enable:190: netup_unidvb
0000:11:00.0: netup_unidvb_dma_enable(): DMA1 enable 0
[765848.418831] netup_unidvb 0000:11:00.0: netup_unidvb: device has been
initialized
[765851.415671] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
[765851.415682] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
[765851.415691] netup_unidvb:netup_unidvb_ci_slot_reset:100: netup_unidvb
0000:11:00.0: netup_unidvb_ci_slot_reset(): CAM_CTRLSTAT_READ_SET=0x1a1a
[765851.415695] netup_unidvb:netup_unidvb_ci_slot_reset:105: netup_unidvb
0000:11:00.0: netup_unidvb_ci_slot_reset(): waiting for reset
[765851.416651] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a0e
[765851.416662] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a0e
[765851.416671] netup_unidvb:netup_unidvb_ci_slot_reset:100: netup_unidvb
0000:11:00.0: netup_unidvb_ci_slot_reset(): CAM_CTRLSTAT_READ_SET=0x1a0e
[765851.416675] netup_unidvb:netup_unidvb_ci_slot_reset:105: netup_unidvb
0000:11:00.0: netup_unidvb_ci_slot_reset(): waiting for reset
[765851.536622] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a8a
[765851.536631] netup_unidvb:netup_unidvb_ci_read_attribute_mem:153:
netup_unidvb 0000:11:00.0: netup_unidvb_ci_read_attribute_mem(): addr=0x0
val=0x4
[765851.536636] netup_unidvb:netup_unidvb_ci_read_attribute_mem:153:
netup_unidvb 0000:11:00.0: netup_unidvb_ci_read_attribute_mem(): addr=0x2
val=0x0
[765851.536638] TUPLE type:0x4 length:0
[765851.536642] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a8a
[765851.536645] dvb_ca adapter 1: Invalid PC card inserted :(
[765851.636603] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a8a
[765851.736601] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a8a
[765851.836599] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a8a
[765851.936590] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a8a
[765852.036583] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a8a
[765852.136611] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
[765852.210627] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
[765852.210635] netup_unidvb:netup_unidvb_ci_read_attribute_mem:153:
netup_unidvb 0000:11:00.0: netup_unidvb_ci_read_attribute_mem(): addr=0x0
val=0x1d
[765852.210640] netup_unidvb:netup_unidvb_ci_read_attribute_mem:153:
netup_unidvb 0000:11:00.0: netup_unidvb_ci_read_attribute_mem(): addr=0x2
val=0x0
[765852.210641] TUPLE type:0x1d length:0
[765852.210646] netup_unidvb:netup_unidvb_ci_read_attribute_mem:153:
netup_unidvb 0000:11:00.0: netup_unidvb_ci_read_attribute_mem(): addr=0x4
val=0x0
[765852.210650] netup_unidvb:netup_unidvb_ci_read_attribute_mem:153:
netup_unidvb 0000:11:00.0: netup_unidvb_ci_read_attribute_mem(): addr=0x6
val=0x0
[765852.210651] TUPLE type:0x0 length:0
[765852.210655] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
[765852.210658] dvb_ca adapter 0: Invalid PC card inserted :(
[765852.236601] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
[765852.310604] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
[765852.336609] netup_unidvb:netup_unidvb_poll_ci_slot_status:132:
netup_unidvb 0000:11:00.0: netup_unidvb_poll_ci_slot_status():
CAM_CTRLSTAT_READ_SET=0x1a1a
....

See how reading the first tuple from the first slot produces type = 0x4 and
length = 0x0. The first tuple from the second CI slots although produces
correct type 0x1d, the length is again 0 and the second tuple is all zeroes.

The same card, with the same CI modules detects modules correctly with the
Centos 3.10 kernel and netup driver from 2014.

[  242.051500] netup_unidvb 0000:11:00.0: netup_unidvb_ci_register(): CI
adapter 0 init done
[  242.051828] netup_unidvb 0000:11:00.0: netup_unidvb_ci_register(): CI
adapter 1 init done
[  242.051836] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): starting
DMA0
[  242.051946] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): DMA0
buffer virt/phys 0xffff8800b0600000/0xb0600000 size 192512
[  243.053415] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): starting
DMA1
[  243.053520] netup_unidvb 0000:11:00.0: netup_unidvb_dma_init(): DMA1
buffer virt/phys 0xffff8800b0640000/0xb0640000 size 192512
[  244.055276] netup_unidvb 0000:11:00.0: netup_unidvb: device has been
initialized
[  247.586204] dvb_ca adapter 1: DVB CAM detected and initialised
successfully
[  247.855427] dvb_ca adapter 0: DVB CAM detected and initialised
successfully

I have compared the drivers and I don't spot any obvious differences between
the 4.4 kernel driver and the netup 2014 driver.
The CI tuple reading seems like a simple operation of reading the correct
memory address...why would this fail? Other than the CI modules, the card
seems to be working with 4.4 kernel.
Is there some other debugging I could check, outside the netup module?

Regards,
Saso Slavicic


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: netup_unidvb CI problem
  2016-05-28  9:47 netup_unidvb CI problem Saso Slavicic
@ 2016-05-28 15:34 ` Saso Slavicic
  0 siblings, 0 replies; 2+ messages in thread
From: Saso Slavicic @ 2016-05-28 15:34 UTC (permalink / raw)
  To: linux-media

Another bug in the driver.
According to Netup 2014 drivers, the attributes should be read from _config
not _io

--- drivers/media/pci/netup_unidvb/netup_unidvb_ci.c.orig	2016-05-28
17:16:07.073608043 +0200
+++ drivers/media/pci/netup_unidvb/netup_unidvb_ci.c	2016-05-28
17:16:33.970418997 +0200
@@ -147,7 +147,7 @@
 {
 	struct netup_ci_state *state = en50221->data;
 	struct netup_unidvb_dev *dev = state->dev;
-	u8 val = *((u8 __force *)state->membase8_io + addr);
+	u8 val = *((u8 __force *)state->membase8_config + addr);
 
 	dev_dbg(&dev->pci_dev->dev,
 		"%s(): addr=0x%x val=0x%x\n", __func__, addr, val);
@@ -162,7 +162,7 @@
 
 	dev_dbg(&dev->pci_dev->dev,
 		"%s(): addr=0x%x data=0x%x\n", __func__, addr, data);
-	*((u8 __force *)state->membase8_io + addr) = data;
+	*((u8 __force *)state->membase8_config + addr) = data;
 	return 0;
 }


# rmmod netup_unidvb
# insmod netup-unidvb-vanilla.ko
# dmesg | grep dvb_ca
[ 3997.014209] dvb_ca adapter 1: Invalid PC card inserted :(
[ 3997.691264] dvb_ca adapter 0: Invalid PC card inserted :(
# rmmod netup-unidvb
# insmod netup-unidvb-patched.ko
# dmesg | grep dvb_ca
[ 4030.205352] dvb_ca adapter 1: DVB CAM detected and initialised
successfully
[ 4030.476391] dvb_ca adapter 0: DVB CAM detected and initialised
successfully

Cheers,
Saso Slavicic


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-28 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28  9:47 netup_unidvb CI problem Saso Slavicic
2016-05-28 15:34 ` Saso Slavicic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).