android_kernel_motorola_sm6225/drivers/fpga
Anatolij Gustschin e4c04fd441 fpga: altera-cvp: fix probing for multiple FPGAs on the bus
[ Upstream commit 30522a951f9d02f261d0697c35cb42205b1fae17 ]

Currently registering CvP managers works only for first probed CvP
device, for all other devices it is refused due to duplicated chkcfg
sysfs entry:

fpga_manager fpga3: Altera CvP FPGA Manager @0000:0c:00.0 registered
sysfs: cannot create duplicate filename '/bus/pci/drivers/altera-cvp/chkcfg'
CPU: 0 PID: 3808 Comm: bash Tainted: G           O      4.19.0-custom+ #5
Call Trace:
  dump_stack+0x46/0x5b
  sysfs_warn_dup+0x53/0x60
  sysfs_add_file_mode_ns+0x16d/0x180
  sysfs_create_file_ns+0x51/0x60
  altera_cvp_probe+0x16f/0x2a0 [altera_cvp]
  local_pci_probe+0x3f/0xa0
  ? pci_match_device+0xb1/0xf0
  pci_device_probe+0x116/0x170
  really_probe+0x21b/0x2c0
  driver_probe_device+0x4b/0xe0
  bind_store+0xcb/0x130
  kernfs_fop_write+0xfd/0x180
  __vfs_write+0x21/0x150
  ? selinux_file_permission+0xdc/0x130
  vfs_write+0xa8/0x1a0
  ? find_vma+0xd/0x60
  ksys_write+0x3d/0x90
  do_syscall_64+0x44/0xf0
  entry_SYSCALL_64_after_hwframe+0x44/0xa9
  ...
 altera-cvp 0000:0c:00.0: Can't create sysfs chkcfg file
 fpga_manager fpga3: fpga_mgr_unregister Altera CvP FPGA Manager @0000:0c:00.0

Move chkcfg creation to module init as suggested by Alan.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-01-26 09:32:36 +01:00
..
altera-cvp.c fpga: altera-cvp: fix probing for multiple FPGAs on the bus 2019-01-26 09:32:36 +01:00
altera-fpga2sdram.c fpga: use SPDX 2018-05-25 18:23:56 +02:00
altera-freeze-bridge.c fpga: use SPDX 2018-05-25 18:23:56 +02:00
altera-hps2fpga.c fpga: use SPDX 2018-05-25 18:23:56 +02:00
altera-pr-ip-core-plat.c fpga: use SPDX 2018-05-25 18:23:56 +02:00
altera-pr-ip-core.c fpga: use SPDX 2018-05-25 18:23:56 +02:00
altera-ps-spi.c fpga: manager: change api, don't use drvdata 2018-05-25 18:23:55 +02:00
dfl-afu-dma-region.c fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support 2018-07-15 13:55:47 +02:00
dfl-afu-main.c fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support 2018-07-15 13:55:47 +02:00
dfl-afu-region.c fpga: dfl: afu: add afu sub feature support 2018-07-15 13:55:47 +02:00
dfl-afu.h fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support 2018-07-15 13:55:47 +02:00
dfl-fme-br.c fpga: dfl: add fpga bridge platform driver for FME 2018-07-15 13:55:46 +02:00
dfl-fme-main.c fpga: dfl: fme: add partial reconfiguration sub feature support 2018-07-15 13:55:46 +02:00
dfl-fme-mgr.c fpga: dfl: fme-mgr: add compat_id support 2018-07-15 13:55:46 +02:00
dfl-fme-pr.c fpga: dfl: fme: fix return value check in in pr_mgmt_init() 2018-09-12 09:31:00 +02:00
dfl-fme-pr.h fpga: dfl: fme: add partial reconfiguration sub feature support 2018-07-15 13:55:46 +02:00
dfl-fme-region.c fpga: do not access region struct after fpga_region_unregister 2018-09-30 08:49:55 -07:00
dfl-fme.h fpga: dfl: fme: add partial reconfiguration sub feature support 2018-07-15 13:55:46 +02:00
dfl-pci.c fpga: dfl-pci: add enumeration for feature devices 2018-07-15 13:55:45 +02:00
dfl.c fpga: dfl: add dfl_fpga_check_port_id function. 2018-07-15 13:55:45 +02:00
dfl.h fpga: dfl: add dfl_fpga_check_port_id function. 2018-07-15 13:55:45 +02:00
fpga-bridge.c fpga: bridge: fix obvious function documentation error 2018-09-30 08:49:55 -07:00
fpga-mgr.c fpga: mgr: add status for fpga-manager 2018-07-15 13:55:44 +02:00
fpga-region.c fpga: region: add compat_id support 2018-07-15 13:55:44 +02:00
ice40-spi.c fpga: manager: change api, don't use drvdata 2018-05-25 18:23:55 +02:00
Kconfig fpga: dfl: add FPGA Accelerated Function Unit driver basic framework 2018-07-15 13:55:46 +02:00
machxo2-spi.c fpga: manager: change api, don't use drvdata 2018-05-25 18:23:55 +02:00
Makefile fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support 2018-07-15 13:55:47 +02:00
of-fpga-region.c fpga: do not access region struct after fpga_region_unregister 2018-09-30 08:49:55 -07:00
socfpga-a10.c fpga: use SPDX 2018-05-25 18:23:56 +02:00
socfpga.c fpga: use SPDX 2018-05-25 18:23:56 +02:00
ts73xx-fpga.c fpga: manager: change api, don't use drvdata 2018-05-25 18:23:55 +02:00
xilinx-pr-decoupler.c fpga: bridge: change api, don't use drvdata 2018-05-25 18:23:55 +02:00
xilinx-spi.c fpga: manager: change api, don't use drvdata 2018-05-25 18:23:55 +02:00
zynq-fpga.c fpga: manager: change api, don't use drvdata 2018-05-25 18:23:55 +02:00