Commit afd96668d8491f762e35c16ce65781da820a67fa
Committed by
Mauro Carvalho Chehab
1 parent
9832d765f8
Exists in
master
and in
7 other branches
V4L/DVB (10987): cx23885: fix crash on non-netup cards
The new support for the CX23885_BOARD_NETUP_DUAL_DVBS2_CI board broke the existing boards. Interrupts for the netup part were enabled and handled without testing whether the current board actually had a netup -> instant and fatal crash. I've added tests to do this only for the CX23885_BOARD_NETUP_DUAL_DVBS2_CI board. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Showing 2 changed files with 13 additions and 3 deletions Side-by-side Diff
drivers/media/video/cx23885/cx23885-core.c
... | ... | @@ -1699,7 +1699,8 @@ |
1699 | 1699 | PCI_MSK_GPIO1); |
1700 | 1700 | } |
1701 | 1701 | |
1702 | - if ((pci_status & PCI_MSK_GPIO0) || (pci_status & PCI_MSK_GPIO1)) | |
1702 | + if (cx23885_boards[dev->board].cimax > 0 && | |
1703 | + ((pci_status & PCI_MSK_GPIO0) || (pci_status & PCI_MSK_GPIO1))) | |
1703 | 1704 | /* handled += cx23885_irq_gpio(dev, pci_status); */ |
1704 | 1705 | handled += netup_ci_slot_status(dev, pci_status); |
1705 | 1706 | |
... | ... | @@ -1775,7 +1776,12 @@ |
1775 | 1776 | } |
1776 | 1777 | |
1777 | 1778 | pci_set_drvdata(pci_dev, dev); |
1778 | - cx_set(PCI_INT_MSK, 0x01800000); /* for NetUP */ | |
1779 | + | |
1780 | + switch (dev->board) { | |
1781 | + case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: | |
1782 | + cx_set(PCI_INT_MSK, 0x01800000); /* for NetUP */ | |
1783 | + break; | |
1784 | + } | |
1779 | 1785 | |
1780 | 1786 | return 0; |
1781 | 1787 |
drivers/media/video/cx23885/cx23885-dvb.c
... | ... | @@ -778,7 +778,11 @@ |
778 | 778 | if (fe0->dvb.frontend) |
779 | 779 | videobuf_dvb_unregister_bus(&port->frontends); |
780 | 780 | |
781 | - netup_ci_exit(port); | |
781 | + switch (port->dev->board) { | |
782 | + case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: | |
783 | + netup_ci_exit(port); | |
784 | + break; | |
785 | + } | |
782 | 786 | |
783 | 787 | return 0; |
784 | 788 | } |