misc: bcm-vk: only support ttyVK if CONFIG_TTY is set
Subsystems (2)
Scott Branden
maintainerPATCH v4 1/1 misc: bcm-vk: only support ttyVK if CONFIG_TTY is set
Correct compile issue if CONFIG_TTY is not set by only adding ttyVK devices if CONFIG_BCM_VK_TTY is set.
---
Changes since v3:
- Kconfig cleanups below as per Greg's comments
- changed if BCM_VK to depends on BCM_VK
- removed default y in CONFIG_BCM_VK_TTY
- expanded decription of CONFIG_BCM_VK_TTY Changes since v2:
- add CONFIG_BCM_VK_TTY
- add function and stub for bcm_vk_tty_set_irq_enabled Changes since v1:
- add function stubs rather than compiling out code
--- drivers/misc/bcm-vk/Kconfig | 12 +++++++++ drivers/misc/bcm-vk/Makefile | 4 +-- drivers/misc/bcm-vk/bcm_vk.h | 42 +++++++++++++++++++++++++++++--- drivers/misc/bcm-vk/bcm_vk_dev.c | 5 ++-- drivers/misc/bcm-vk/bcm_vk_tty.c | 6 +++++ 5 files changed, 61 insertions(+), 8 deletions(-)
drivers/misc/bcm-vk/Kconfig +12 -0
@@ -15,3 +15,15 @@ config BCM_VK accelerators via /dev/bcm-vk.N devices. If unsure, say N. + +config BCM_VK_TTY + bool "Enable tty ports on a Broadcom VK Accelerator device" + depends on TTY + depends on BCM_VK + help + Select this option to enable tty support to allow console + access to Broadcom VK Accelerator cards from host. + + Device node will in the form /dev/bcm-vk.x_ttyVKy where: + x is the instance of the VK card + y is the tty device number on the VK card.
drivers/misc/bcm-vk/Makefile +2 -2
@@ -7,6 +7,6 @@ obj-$(CONFIG_BCM_VK) += bcm_vk.o bcm_vk-objs := \ bcm_vk_dev.o \ bcm_vk_msg.o \ - bcm_vk_sg.o \ - bcm_vk_tty.o + bcm_vk_sg.o +bcm_vk-$(CONFIG_BCM_VK_TTY) += bcm_vk_tty.o
drivers/misc/bcm-vk/bcm_vk.h +39 -3
70 lines not on this page · raw message
drivers/misc/bcm-vk/bcm_vk_dev.c +2 -3
@@ -1396,7 +1396,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pdev->irq + vk->num_irqs, vk->num_irqs + 1); goto err_irq; } - vk->tty[i].irq_enabled = true; +bcm_vk_tty_set_irq_enabled (vk, i); } id =ida_simple_get (&bcm_vk_ida,0 ,0 ,GFP_KERNEL );
@@ -1580,8 +1580,7 @@ static void bcm_vk_remove(struct pci_dev *pdev)cancel_work_sync (&vk->wq_work);destroy_workqueue (vk->wq_thread); -cancel_work_sync (&vk->tty_wq_work); -destroy_workqueue (vk->tty_wq_thread); +bcm_vk_tty_wq_exit (vk);for (i =0 ; i <MAX_BAR ; i++) {if (vk->bar[i])
drivers/misc/bcm-vk/bcm_vk_tty.c +6 -0
@@ -331,3 +331,9 @@ void bcm_vk_tty_terminate_tty_user(struct bcm_vk *vk)kill_pid (find_vpid (vktty->pid),SIGKILL ,1 ); } } + +void bcm_vk_tty_wq_exit (struct bcm_vk *vk) +{ +cancel_work_sync (&vk->tty_wq_work); +destroy_workqueue (vk->tty_wq_thread); +}
Signature · 1 line
2.17.1
Quoted 5 lines · Scott Branden
Correct compile issue if
CONFIG_TTYis not set by only adding ttyVK devices ifCONFIG_BCM_VK_TTYis set.Reported-by Randy Dunlap <[email protected]>Signed-off-by Scott Branden <[email protected]>
Thanks.
Quoted 19 lines
---
Changes since v3:
-Kconfigcleanups below as per Greg's comments
- changed ifBCM_VKto depends onBCM_VK
- removed default y inCONFIG_BCM_VK_TTY
- expanded decription ofCONFIG_BCM_VK_TTYChanges since v2:
- addCONFIG_BCM_VK_TTY
- add function and stub forbcm_vk_tty_set_irq_enabledChanges since v1:
- add function stubs rather than compiling out code--- drivers/misc/bcm-vk/Kconfig | 12 +++++++++ drivers/misc/bcm-vk/Makefile | 4 +-- drivers/misc/bcm-vk/bcm_vk.h | 42 +++++++++++++++++++++++++++++--- drivers/misc/bcm-vk/bcm_vk_dev.c | 5 ++-- drivers/misc/bcm-vk/bcm_vk_tty.c | 6 +++++ 5 files changed, 61 insertions(+), 8 deletions(-)
Signature · 1 line
~Randy
Arnd Bergmann
Acked-byQuoted 9 lines · Randy Dunlap
Quoted 5 lines · Scott Branden
Correct compile issue if
CONFIG_TTYis not set by only adding ttyVK devices ifCONFIG_BCM_VK_TTYis set.Reported-by Randy Dunlap <[email protected]>Signed-off-by Scott Branden <[email protected]>
Passes my randconfig builds as well and looks reasonable