summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic
Commit message (Collapse)AuthorAgeFilesLines
...
* | misc: mic: Add data structures for the VOP driverSudeep Dutt2016-02-101-0/+170
| | | | | | | | | | | | | | | | | | | | | | This patch adds VOP driver data structures used in subsequent patches. These data structures are refactored from similar data structures used in the virtio parts of previous MIC host and card drivers. Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: MIC VOP BusSudeep Dutt2016-02-104-0/+361
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Virtio Over PCIe (VOP) bus abstracts the low level hardware details like interrupts and mapping remote memory so that the same VOP driver can work without changes with different MIC host or card drivers as long as the hardware bus operations are implemented. The VOP driver registers itself on the VOP bus. The base PCIe drivers implement the bus ops and register VOP devices on the bus, resulting in the VOP driver being probed with the VOP devices. This allows the VOP functionality to be shared between multiple generations of Intel MIC products. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: Remove MIC X100 card virtio functionalitySudeep Dutt2016-02-104-719/+1Star
| | | | | | | | | | | | | | | | | | | | | | This patch deletes the virtio functionality from the MIC X100 card driver. A subsequent patch will re-enable this functionality by consolidating the hardware independent logic in a new Virtio over PCIe (VOP) driver. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: Remove MIC X100 host virtio functionalitySudeep Dutt2016-02-109-1464/+4Star
| | | | | | | | | | | | | | | | | | | | | | This patch deletes the virtio functionality from the MIC X100 host driver. A subsequent patch will re-enable this functionality by consolidating the hardware independent logic in a new Virtio over PCIe (VOP) driver. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: use common error pathSudip Mukherjee2016-02-081-6/+7
| | | | | | | | | | | | | | | | | | | | | | Instead of calling release_firmware() on every error and then jumping lets have a common release_firmware() in the error path. This patch also fixes a memory leak where we missed release_firmware() if mic_x100_load_command_line() fails. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: return error directlySudip Mukherjee2016-02-081-2/+2
| | | | | | | | | | | | | | | | | | Instead of jumping to a label and then returning from there lets return directly. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: return error properlySudip Mukherjee2016-02-081-1/+6
| | | | | | | | | | | | | | | | | | | | | | If request_firmware() succeeds then rc becomes 0. After that if the test for strcmp() fails then we were jumping to label done: and returning rc. But rc being 0 we returned success whereas we have failed here and we were supposed to return an error. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: remove unneeded debug messageSudip Mukherjee2016-02-081-6/+5Star
| | | | | | | | | | | | | | | | | | >From the error path we are printing an error message with dev_err(). No need to print almost same message with dev_dbg(). Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | mic_virtio: fix a timeout loopDan Carpenter2016-02-081-1/+1
| | | | | | | | | | | | | | | | | | After the loop we test "if (!retry)" to see if we timedout. The problem is "retry--" is a post-op so retry will be -1 at the end of the loop. I have fixed this by changing it to a pre-op instead. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: Fix crash when MIC reset is invoked in RESET_FAILED stateAshutosh Dixit2016-02-082-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following crash seen when MIC reset is invoked in RESET_FAILED state due to device_del being called a second time on an already deleted device: [<ffffffff813b2295>] device_del+0x45/0x1d0 [<ffffffff813b243e>] device_unregister+0x1e/0x60 [<ffffffffa040f1c2>] scif_unregister_device+0x12/0x20 [scif_bus] [<ffffffffa042f75a>] cosm_stop+0xaa/0xe0 [mic_cosm] [<ffffffffa042f844>] cosm_reset_trigger_work+0x14/0x20 [mic_cosm] The fix consists in realizing that because cosm_reset changes the state to MIC_RESETTING, cosm_stop needs the previous state, before it changed to MIC_RESETTING, to decide whether a hw_ops->stop had previously been issued. This is now provided in a new cosm_device member cdev->prev_state. Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic: fix incorrect use of error codes in SCIF DMA driverEric Biggers2016-02-081-9/+5Star
| | | | | | | | | | | | | | | | | | The error code passed to ERR_PTR() always should be negated. Also, the return value of scif_add_mmu_notifier() was never checked. Signed-off-by: Eric Biggers <ebiggers3@gmail.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic/scif: use list_next_entry instead of list_entry_nextGeliang Tang2016-02-081-16/+11Star
| | | | | | | | | | | | | | | | | | list_next_entry has been defined in list.h, so I replace list_entry_next with it. Signed-off-by: Geliang Tang <geliangtang@163.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | misc: mic/scif: fix wrap around testsDan Carpenter2016-02-081-3/+4
|/ | | | | | | | | | Signed integer overflow is undefined. Also I added a check for "(offset < 0)" in scif_unregister() because that makes it match the other conditions and because I didn't want to subtract a negative. Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* virtio: make find_vqs() checkpatch.pl-friendlyStefan Hajnoczi2016-01-121-1/+1
| | | | | | | | | | | | | | | | | | | checkpatch.pl wants arrays of strings declared as follows: static const char * const names[] = { "vq-1", "vq-2", "vq-3" }; Currently the find_vqs() function takes a const char *names[] argument so passing checkpatch.pl's const char * const names[] results in a compiler error due to losing the second const. This patch adjusts the find_vqs() prototype and updates all virtio transports. This makes it possible for virtio_balloon.c, virtio_input.c, virtgpu_kms.c, and virtio_rpmsg_bus.c to use the checkpatch.pl-friendly type. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
* misc: mic/scif: fix error code in scif_create_remote_lookup()Dan Carpenter2015-10-181-2/+6
| | | | | | | | | We should be returning -ENOMEM here instead of success. Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic/scif: re-take a lock on error pathDan Carpenter2015-10-181-0/+1
| | | | | | | | | | The caller expects that we take this lock again before returning otherwise it you get double unlocks and races. Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: fix memory leakSudip Mukherjee2015-10-181-1/+18
| | | | | | | | | | | | In scif_node_connect() we were returning if the initialization of p2p_ji fails. But at that time p2p_ij has already been initialized and resources allocated for it. And since p2p_ij is not added to the list till now so we will have a leak. Lets deinitialize and release the resources connected to p2p_ij. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: replace kfree with put_deviceGeliang Tang2015-10-183-3/+3
| | | | | | | | Handle a failed device_register(), replace kfree() with put_device(), which will call cosm/mbus/scif_release_dev(). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Fix randconfig build errorAshutosh Dixit2015-10-181-0/+1
| | | | | | | | | | Fixes randconfig build error reported at http://www.spinics.net/lists/kernel/msg2092346.html Reported-by: Jim Davis <jim.epost@gmail.com> Reviewed-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Fix SCIF build failure with IOMMU_SUPPORT disabledSudeep Dutt2015-10-051-1/+1
| | | | | | | | | | | SCIF depends on IOVA which requires IOMMU_SUPPORT to be enabled. The long term fix is to move IOVA from drivers/iommu to lib/ but this current patch should fix the reported issue. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF RMA nodeqp and minor miscellaneous changesSudeep Dutt2015-10-0414-40/+516
| | | | | | | | | | | | | | | | | | | This patch adds the SCIF kernel node QP control messages required to enable SCIF RMAs. Examples of such node QP control messages include registration, unregistration, remote memory allocation requests, remote memory unmap and SCIF remote fence requests. The patch also updates the SCIF driver with minor changes required to enable SCIF RMAs by adding the new files to the build, initializing RMA specific information during SCIF endpoint creation, reserving SCIF DMA channels, initializing SCIF RMA specific global data structures, adding the IOCTL hooks required for SCIF RMAs and updating RMA specific debugfs hooks. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF fenceSudeep Dutt2015-10-041-0/+771
| | | | | | | | | | | | | | | | | | | This patch implements the fence APIs required to synchronize DMAs. SCIF provides an interface to return a "mark" for all DMAs programmed at the instant the API was called. Users can then "wait" on the mark provided previously by blocking inside the kernel. Upon receipt of a DMA completion interrupt the waiting thread is woken up. There is also an interface to signal DMA completion by polling for a location to be updated via a "signal" cookie to avoid the interrupt overhead in the mark/wait interface. SCIF allows programming fences on both the local and the remote node for both the mark/wait or the fence signal APIs. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF DMA and CPU copy interfaceSudeep Dutt2015-10-041-0/+1979
| | | | | | | | | | | | | | | | | | | SCIF allows users to read from or write to registered remote memory via CPU copies or DMA. The API verifies that both local and remote windows are valid before initiating the CPU or DMA transfers. SCIF has optimized algorithms for handling byte aligned as well as cache line aligned DMA engines. A registration cache is maintained to avoid the overhead of pinning pages repeatedly if buffers are reused. The registration cache is invalidated upon receipt of MMU notifier callbacks. SCIF windows are destroyed and the pages are unpinned only once all prior DMAs initiated using that window are drained. Users can request synchronous DMA operations as well as tail byte ordering if required. CPU copies are always performed synchronously. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF remote memory map/unmap interfaceSudeep Dutt2015-10-041-0/+699
| | | | | | | | | | | | | | | | | | | This patch implements the SCIF mmap/munmap interface. A similar capability is provided to kernel clients via the scif_get_pages()/scif_put_pages() APIs. The SCIF mmap interface queries to check if a window is valid and then remaps the local virtual address to the remote physical pages. These mappings are subsequently destroyed upon receipt of the VMA close operation or scif_get_pages(). This functionality allows SCIF users to directly access remote memory without any driver interaction once the mappings are created thereby providing bare-metal PCIe latency. These mappings are zapped to avoid RMA accesses from user space, if a Coprocessor is reset. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF RMA list operationsSudeep Dutt2015-10-042-0/+348
| | | | | | | | | | | | | | This patch adds the implementation for operations performed on the list of SCIF windows. Examples of such operations includes adding the windows to the list of registered (or cached) windows, querying the list of self or remote windows and unregistering windows. The query operation is used by SCIF APIs which initiate DMAs, CPU copies or fences to ensure that a window remains valid during a transfer. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF memory registration and unregistrationSudeep Dutt2015-10-041-0/+1770
| | | | | | | | | | | | | | | | | | This patch implements the SCIF APIs required to pin and unpin pages. SCIF registration locks down the pages. It then sends a remote window allocation request to the peer. Once the peer has allocated memory, the local SCIF endpoint copies the pinned page information to the peer and notifies the peer once the copy has complete. The peer upon receipt of the registration notification adds the new remote window to its list. At this point the window page information is available on both self and remote nodes so that they can start performing SCIF DMAs, CPU copies and fences. The unregistration API tears down the registration at both self and remote nodes. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF RMA header fileSudeep Dutt2015-10-041-0/+464
| | | | | | | | | | | | | | | | This patch adds the internal data structures required to perform SCIF RMAs. The data structures required to maintain per SCIF endpoint, RMA information are contained in scif_endpt_rma_info. scif_pinned_pages describes a set of SCIF pinned pages maintained locally. The scif_window is a data structure which contains all the fields required to describe a SCIF registered window on self and remote nodes. It contains an offset which is used as a key to perform SCIF DMAs and CPU copies between self and remote registered windows. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Update MIC host daemon with COSM changesAshutosh Dixit2015-10-043-5/+12
| | | | | | | | | | | | This patch updates the MIC host daemon to work with corresponding changes in COSM. Other MIC daemon fixes, cleanups and enhancements as are also rolled into this patch. Changes to MIC sysfs ABI which go into effect with this patch are also documented. Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Remove COSM functionality from the MIC card driverAshutosh Dixit2015-10-044-104/+21Star
| | | | | | | | | | | | | | Since card side COSM functionality, to trigger MIC device shutdowns and communicate shutdown status to the host, is now moved into a separate COSM client driver, this patch removes this functionality from the base MIC card driver. The mic_bus driver is also updated to use the device index provided by COSM rather than maintain its own device index. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Remove COSM functionality from the MIC host driverAshutosh Dixit2015-10-0413-1145/+204Star
| | | | | | | | | | | | | | Since COSM functionality is now moved into a separate COSM driver drivers, this patch removes this functionality from the base MIC host driver. The MIC host driver now implements cosm_hw_ops and registers a COSM device which allows the COSM driver to trigger boot/shutdown/reset of the MIC devices via the cosm_hw_ops. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: COSM client driverAshutosh Dixit2015-10-042-0/+282
| | | | | | | | | | | | | | | | The COSM client driver running on the MIC cards is implemented as a kernel mode SCIF client. It responds to a "shutdown" message from the host by triggering a card shutdown and also communicates the shutdown or reboot status back the host. It is also responsible for syncing the card time to that of the host. Because SCIF messaging cannot be used in a panic context, the COSM client driver also periodically sends a heartbeat SCIF message to the host thereby enabling the host to detect card crashes. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: COSM SCIF serverAshutosh Dixit2015-10-041-0/+405
| | | | | | | | | | | | | | | | | | | The COSM driver communicates with the MIC cards over SCIF. A SCIF "server" listens for incoming connections from "client" MIC cards as they boot. After the connection is accepted a separate work item is scheduled for each MIC card. This work item normally stays blocked in scif_poll but wakes up to process messages from the card. The SCIF connection between the host and card COSM components is used to (a) send the command to shut down the card (b) receive shutdown status back from the card upon completion of shutdown (c) receive periodic heartbeat messages to detect card crashes (d) send host time to the card to enable the card to sync its time to the host. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Coprocessor State Management (COSM) driverAshutosh Dixit2015-10-045-0/+1084
| | | | | | | | | | | | | | | | | | | | | | The COSM driver allows boot, shutdown and reset of Intel MIC devices via sysfs. This functionality was previously present in the Intel MIC host driver but has now been taken out into a separate driver so that it can be shared between multiple generations of Intel MIC products. The sysfs kernel ABI used by the COSM driver is the same as that defined originally for the MIC host driver in Documentation/ABI/testing/sysfs-class-mic.txt. The COSM driver also contains support for dumping the MIC card log_buf and doing a "force reset" for the card via debugfs. The OSPM support present in the MIC host driver has now largely been moved to user space and only a small required OSPM functionality is now present in the driver. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: MIC COSM busAshutosh Dixit2015-10-044-2/+296
| | | | | | | | | | | | | | | | The MIC COSM bus allows the co-processor state management (COSM) functionality to be shared between multiple generations of Intel MIC products. The COSM driver registers itself on the COSM bus. The base PCIe drivers implement the bus ops and register COSM devices on the bus, resulting in the COSM driver being probed with the COSM devices. COSM bus ops, e.g. start, stop, ready, reset, therefore abstract out common functionality from its specific implementation for individual generations of MIC products. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Add support for kernel mode SCIF clientsAshutosh Dixit2015-10-047-221/+197Star
| | | | | | | | | | | | | | | Add support for registration/de-registration of kernel mode SCIF clients. SCIF clients are probed with new and existing SCIF peer devices. Similarly the client remove method is called when SCIF peer devices are removed. Changes to SCIF peer device framework necessitated by supporting kernel mode SCIF clients are also included in this patch. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF pollAshutosh Dixit2015-10-044-1/+190
| | | | | | | | | | | | | SCIF poll allows both user and kernel mode clients to wait on events on a SCIF endpoint. These events include availability of space or data in the SCIF ring buffer, availability of connection requests on a listening endpoint and completion of connections when using async connects. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: scif bug fix for vmalloc_to_page crashSudeep Dutt2015-07-231-10/+5Star
| | | | | | | | | | | | | | | | | | | | v4.2-rc1 enabled huge page support for ioremap(..). Calling vmalloc_to_page after v4.2-rc1 results in the crash shown below on the host upon booting X100 coprocessors: BUG: unable to handle kernel paging request at ffffc47c00000000 IP: [<ffffffff811a2c0c>] vmalloc_to_page+0x6c/0xb0 This patch fixes this crash by obtaining the fake struct page pointer which is required to be passed into dma_map_sg(..) by calling pfn_to_page(..) instead of vmalloc_to_page(..). Link: https://lkml.org/lkml/2015/7/18/110 Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Suggested-by: Toshi Kani <toshi.kani@hp.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Fix reported static checker warningSudeep Dutt2015-06-131-4/+0Star
| | | | | | | | | | Delete unnecessary prints resulting in an "spdev could be null" warning from a static checker in scif_peer_remove(..). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Fix randconfig build error by including errno.hSudeep Dutt2015-06-131-0/+1
| | | | | | | | | This issue was reported @ https://lkml.org/lkml/2015/6/9/731 Reported-by: Jim Davis <jim.epost@gmail.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: MIC card driver specific changes to enable SCIFSudeep Dutt2015-05-245-6/+201
| | | | | | | | | | | MIC card driver specific changes to enable SCIF. This patch implements the SCIF hardware bus operations and registers a SCIF device on the SCIF hardware bus. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: MIC host driver specific changes to enable SCIFSudeep Dutt2015-05-2410-24/+292
| | | | | | | | | | | MIC host driver specific changes to enable SCIF. This patch implements the SCIF hardware bus operations and registers a SCIF device on the SCIF hardware bus. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF messaging and node enumeration APIsSudeep Dutt2015-05-246-1/+583
| | | | | | | | | | | | | | | | SCIF messaging APIs which allow sending messages between the SCIF endpoints via a byte stream based ring buffer which has been optimized to avoid reads across PCIe. The SCIF messaging APIs are typically used for short < 1024 byte messages for best performance while the RDMA APIs which will be submitted in a future patch series is recommended for larger transfers. The node enumeration API enables a user to query for the number of nodes online in the SCIF network and their node ids. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF connections APIs i.e. accept and connectNikhil Rao2015-05-247-1/+852
| | | | | | | | | | | | | | | | | | | | | SCIF connection APIs which establish a SCIF connection between a pair of SCIF endpoints. A SCIF connection consists of a dedicated queue-pair between the endpoints. Client messages are sent over the queue-pair whereas the signaling associated with the message is multiplexed over the node queue-pair. Similarly other control messages such as exposing registered memory are also sent over the node queue-pair. The SCIF endpoints must be in connected state to exchange messages, register memory, map remote memory and trigger DMA transfers. SCIF connections can be set up asynchronously or synchronously. Thanks to Johnnie S Peters for authoring parts of this patch during early bring up of the SCIF driver. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF open close bind and listen APIsSudeep Dutt2015-05-2410-1/+933
| | | | | | | | | | | SCIF character device file operations and kernel APIs for opening and closing a user and kernel mode SCIF endpoint. This patch also enables binding to a SCIF port and listening for incoming SCIF connections. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF node queue pair setup managementSudeep Dutt2015-05-243-0/+1621
| | | | | | | | | | | | | SCIF node queue pair setup creates the SCIF driver kernel mode private node queue pairs between all the nodes to enable internal control message communication once SCIF gets probed by the SCIF hardware bus. Peer to peer communication between MIC Coprocessor nodes is supported. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF module initializationSudeep Dutt2015-05-244-0/+841
| | | | | | | | | | | | SCIF module initialization, DMA mapping, ioremap wrapper APIs and debugfs hooks. SCIF gets probed by the SCIF hardware bus if SCIF devices were registered by base drivers. A MISC device is registered to provide the SCIF character device interface. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: Common MIC header file changes in preparation for SCIFSudeep Dutt2015-05-241-0/+3
| | | | | | | | | Update mic_bootparam and define the maximum number of DMA channels Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF Peer BusSudeep Dutt2015-05-242-0/+189
| | | | | | | | | | | | | The SCIF peer bus is used to register and unregister SCIF peer devices internally by the SCIF driver to signify the addition and removal of peer nodes respectively from the SCIF network. This simplifies remote node handling within SCIF and will also be used to support device probe/remove for SCIF client drivers (e.g. netdev over SCIF) Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF Hardware BusSudeep Dutt2015-05-245-1/+358
| | | | | | | | | | | | | | The SCIF hardware bus abstracts the low level hardware driver details like interrupts and mapping remote memory so that the same SCIF driver can work without any changes with the MIC host or card driver as long as the hardware bus operations are implemented. The SCIF hardware device is registered by the host and card drivers on the SCIF hardware bus resulting in probing the SCIF driver. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: mic: SCIF ring buffer infrastructureSudeep Dutt2015-05-242-0/+348
| | | | | | | | | | | | | | | | | | | SCIF ring buffer is a single producer, single consumer byte stream ring buffer optimized for avoiding reads across the PCIe bus while adding the required barriers and hardware workarounds for the MIC Coprocessor. The ring buffer is used to implement a receive queue for SCIF driver messaging between two nodes and for byte stream messaging between SCIF endpoints. The existing in-kernel ring buffer was not reused since it has not been designed for our use across the PCIe bus where each node runs an independent OS. Each SCIF node has a receive queue for every other SCIF node, and each connected endpoint has a receive queue for messages from its peer. This pair of receive queues is referred to as a SCIF queue pair. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>