summaryrefslogtreecommitdiffstats
path: root/drivers/misc
Commit message (Collapse)AuthorAgeFilesLines
...
| * habanalabs: silence an uninitialized variable warningDan Carpenter2022-02-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Smatch warns that: drivers/misc/habanalabs/common/command_buffer.c:471 hl_cb_ioctl() error: uninitialized symbol 'device_va'. Which is true, but harmless. Anyway, it's easy to silence this by adding a error check. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: remove duplicate printOded Gabbay2022-02-281-6/+1
| | | | | | | | | | | | | | We print detailed messages inside the internal ioctl functions. No need to print a generic message at the end, it doesn't add any information. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: prevent false heartbeat failure during soft-resetTomer Tayar2022-02-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The heartbeat thread is active during soft-reset, and it tries to send messages to CPU-CP core. Within the soft-reset, in the time window in which the device is marked as disabled, any CPU-CP command is "silently" skipped and a success value it returned. However, in addition to the return value, the heartbeat function also checks the F/W result, but because no command is sent in this time window, the result variable won't hold the expected value and we will have a false heartbeat failure. To avoid it, modify the "silent" skip to be done only in hard-reset. The CPU-CP should be able to handle messages during soft-reset. In addition to the heartbeat problem, this should also solve other issues in other flows that send messages during soft-reset and use the F/W result as it w/o being aware to the reset. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: fix race between wait and irqOded Gabbay2022-02-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | There is a race in the user interrupts code, where between checking the target value and adding the new pend to the list, there is a chance the interrupt happened. In that case, no one will complete the node, and we will get a timeout on it. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: fix user interrupt wait when timeout is 0Oded Gabbay2022-02-281-4/+6
| | | | | | | | | | | | | | | | | | When timeout is 0, we need to return the busy status in case the target value wasn't reached upon entry to the ioctl. Also return the correct timestamp. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: reject host map with mmu disabledOded Gabbay2022-02-281-19/+11
| | | | | | | | | | | | | | This is not something we can do a workaround. It is clearly an error and we should notify the user that it is an error. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: expose number of user interruptsOded Gabbay2022-02-281-2/+2
| | | | | | | | | | | | | | | | Currently we only expose to the user the ID of the first available user interrupt. To make user interrupts allocation truly dynamic, we need to also expose the number of user interrupts. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: update to latest f/w specsOded Gabbay2022-02-281-0/+5
| | | | | | | | | | | | Copy the latest versions of the f/w specs files. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: add missing error check in sysfs max_power_showTomer Tayar2022-02-283-3/+5
| | | | | | | | | | | | | | | | Add a missing error check in the sysfs show function for max_power. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: fix soft reset flow in case of failureDani Liberman2022-02-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | In case of soft reset failure, hard reset should be initiated, but reset flags were not set to enable it, which caused another soft reset followed by another failure. Updated reset flags to enable hard reset flow in case of soft reset failure. Signed-off-by: Dani Liberman <dliberman@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: add missing error check in sysfs clk_freq_mhz_showTomer Tayar2022-02-281-0/+4
| | | | | | | | | | | | | | | | | | Add a missing error check in the sysfs show functions for clk_max_freq_mhz and clk_cur_freq_mhz_show. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: avoid copying pll data if pll_info_get failsTomer Tayar2022-02-281-2/+4
| | | | | | | | | | | | | | | | | | If reading PLL info from F/W fails, the PLL info is not set in the "result" variable, and hence shouldn't be copied to the caller's array. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: don't free phys_pg_pack inside lockOded Gabbay2022-02-282-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Freeing phys_pg_pack includes calling to scrubbing functions of the device's memory, taking locks and possibly even calling reset. This is not something that should be done while holding a device-wide spinlock. Therefore, save the relevant objects on a local linked-list and after releasing the spinlock, traverse that list and free the phys_pg_pack objects. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: duplicate HOP table props to MMU propsOhad Sharabi2022-02-282-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support several device MMU blocks with different architectures (e.g. different HOP table size) we need to move to per-MMU properties rather than keeping those properties as ASIC properties. Refactoring the code to use "per-MMU proprties" is a major effort. To start making the transition towards this goal but still support taking the properties from ASIC properties (for code that currently uses them) this patch copies some of the properties to the "per-MMU" properties and later, when implementing the per-MMU properties, we would be able to delete the MMU props from the ASIC props. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: there is no kernel TDR in future ASICsOded Gabbay2022-02-281-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In future ASICs, there is no kernel TDR for new workloads that are submitted directly from user-space to the device. Therefore, the driver can NEVER know that a workload has timed-out. So, when the user asks us to wait for interrupt on the workload's completion, and the wait has timed-out, it doesn't mean the workload has timed-out. It only means the wait has timed-out, which is NOT an error from driver's perspective. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: sysfs support for fw os versionRajaravi Krishna Katta2022-02-282-0/+12
| | | | | | | | | | | | | | | | | | Adds new sysfs entry to display firmware os version /sys/class/habanalabs/hl<n>/fw_os_ver Signed-off-by: Rajaravi Krishna Katta <rkatta@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: use common wrapper for MMU cache invalidationOded Gabbay2022-02-282-6/+5
| | | | | | | | | | | | | | | | | | We have a common function that wraps the call to the MMU cache invalidation function, which is ASIC-specific. The wrapper checks the return value and prints error if necessary. For consistency, try to use the wrapper when possible. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: remove power9 workaround for dma supportOded Gabbay2022-02-284-25/+3
| | | | | | | | | | | | We don't need this workaround anymore. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: add vrm version to sysfsOded Gabbay2022-02-286-26/+77
| | | | | | | | | | | | | | infineon version is only applicable to GOYA and GAUDI. For later ASICs, we display the Voltage Regulator Monitor f/w version. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: rename dev_attr_grp to dev_clk_attr_grpOded Gabbay2022-02-284-12/+9
| | | | | | | | | | | | | | | | In this attribute group we are only adding clocks. This is in preparation for adding a device specific attribute group which is not related to clocks. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: remove asic callback set_pll_profile()Oded Gabbay2022-02-285-9/+7
| | | | | | | | | | | | | | | | Setting PLL profile is the same for all ASICs, except for GOYA. However, because this function is never called from common code, there is no need to have an asic-specific callback function. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: move more f/w functions to firmware_if.cOded Gabbay2022-02-285-158/+141
| | | | | | | | | | | | | | For better maintainability, try to concentrate all the common functions that communicate with the f/w in firmware_if.c Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: remove hwmgr.cOded Gabbay2022-02-286-54/+46
| | | | | | | | | | | | | | The two remaining functions in this file belong to firmware_if.c, as they communicate with the firmware. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: get clk is common functionOded Gabbay2022-02-285-18/+15
| | | | | | | | | | | | | | | | | | | | | | Retrieving the clock from the f/w is done exactly the same in ALL our ASICs. Therefore, no real justification for doing it as an ASIC-specific function. The only thing is we need to check if we are running on simulator, which doesn't require ASIC-specific callback. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: sysfs functions should be in sysfs.cOded Gabbay2022-02-284-76/+71
| | | | | | | | | | | | | | | | | | Move common sysfs store/show functions to sysfs.c file for consistency. This is part of a patch-set to remove hwmgr.c Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: make some MMU functions commonOhad Sharabi2022-02-283-37/+72
| | | | | | | | | | | | | | | | | | Some MMU functions can be used by different versions of our MMUs, so move them to be common. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: remove ASIC functions of clock gatingOded Gabbay2022-02-285-142/+5
| | | | | | | | | | | | | | | | Now that clock gating is permanently disabled in GAUDI, no need for the ASIC functions of setting and disabling clock gating, as this was a unique scenario in GAUDI. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs/gaudi: disable CGM permanentlyOded Gabbay2022-02-285-203/+65
| | | | | | | | | | | | | | | | Due to the need of SynapseAI to configure all TPC engines from a single QMAN, the driver must disable CGM and never allow the user to enable it. Otherwise, the configuration of the TPC engines will fail. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: fix possible memory leak in MMU DR finiOhad Sharabi2022-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | This patch fixes what seems to be copy paste error. We will have a memory leak if the host-resident shadow is NULL (which will likely happen as the DR and HR are not dependent). Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * habanalabs: check the return value of hl_cs_poll_fences()Tomer Tayar2022-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | As part of handling of the multi-CS wait ioctl, hl_cs_poll_fences() is called in a "while (true)" loop. This function can fail, but the checking of its return value was missed. Add this check and exit the loop in case of a failure. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
| * mei: do not overwrite state on hw startAlexander Usyskin2022-02-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the hardware start sequence, do not overwrite the driver state and do not proceed with the initialization sequence if the state was changed while the driver was waiting for the start interrupt. This can happen if the driver's removal/stop procedure was triggered from the parent level while the driver is waiting for the start interrupt. This may lead to stray the reset work or the timer after driver were removed. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20220215080438.264876-4-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * mei: me: fix reset policy on read error in interruptAlexander Usyskin2022-02-251-6/+8
| | | | | | | | | | | | | | | | | | | | | | Avoid link reset in DISABLED and POWERING_DOWN state if read error is occurred - let shutdown flow finish. In any state exit interrupt handler if read error occurred. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20220215080438.264876-3-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * mei: me: avoid link reset on shutdownAlexander Usyskin2022-02-252-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Avoid lingering reset thread on driver shutdown. If the firmware is down during a shutdown flow do not initiate the link reset, simply disconnect all clients and let shutdown flow finish Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20220215080438.264876-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * mei: me: disable driver on the ign firmwareAlexander Usyskin2022-02-252-11/+13
| | | | | | | | | | | | | | | | | | | | | | Add a quirk to disable MEI interface on Intel PCH Ignition (IGN) as the IGN firmware doesn't support the protocol. Cc: <stable@vger.kernel.org> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20220215080438.264876-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * misc: rtsx: rts522a rts5228 rts5261 support Runtime PMRicky WU2022-02-254-5/+98
| | | | | | | | | | | | | | | | | | | | | | | | rts522a, rts5228, rts5261 add extra init flow for rtd3 add more power_down setting for avoid being woken up by plugging or unplugging card when system in S3 Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Ricky Wu <ricky_wu@realtek.com> Link: https://lore.kernel.org/r/dace32f573a445908fec0a10482c394c@realtek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * lkdtm/fortify: Swap memcpy() for strncpy()Kees Cook2022-02-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The memcpy() runtime defenses are still not landed, so test with strncpy() for now. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reported-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20220216202548.2093883-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * misc: rtsx: conditionally build rtsx_pm_power_saving()Tom Rix2022-02-251-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On s390 allyesconfig, there is this build error rtsx_pcr.c:1084:13: error: 'rtsx_pm_power_saving' defined but not used 1084 | static void rtsx_pm_power_saving(struct rtsx_pcr *pcr) | ^~~~~~~~~~~~~~~~~~~~ rtsx_pm_power_saving() is only used by rtsx_pci_runtime_idle() which is conditional on CONFIG_PM. So conditionally build rtsx_pm_power_saving() and the similar rtsx_comm_pm_power_saving() and rtsx_enable_aspm(). Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20220213171907.2786442-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * ocxl: Make use of the helper macro LIST_HEAD()Cai Huoqing2022-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code. Acked-by: Frederic Barrat <fbarrat@linux.ibm.com> Acked-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev> Link: https://lore.kernel.org/r/20220209032421.37725-1-cai.huoqing@linux.dev Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * misc: sgi-gru: Don't cast parameter in bit operationsAndy Shevchenko2022-02-251-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While in this particular case (*) it would not be an issue, the pattern itself is bad and error prone in case somebody blindly copies to their code. Don't cast parameter to unsigned long pointer in the bit operations. Note, new compilers might warn on this line for potential outbound access. *) it seems a dead code, so remove it all for good Fixes: 13d19498b044 ("GRU Driver: driver internal header files") Acked-by: Dimitri Sivanich <sivanich@hpe.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220214153958.9721-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * VMCI: Fix some error handling paths in vmci_guest_probe_device()Christophe JAILLET2022-02-251-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The 'err_remove_vmci_dev_g' error label is not at the right place. This could lead to un-released resource. There is also a missing label. If pci_alloc_irq_vectors() fails, the previous vmci_event_subscribe() call must be undone. Acked-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/959218ce3b135197946d85cd9453551cd04fa5da.1645734041.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * VMCI: No need to clear memory after a dma_alloc_coherent() callChristophe JAILLET2022-02-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | dma_alloc_coherent() already clear the allocated memory, there is no need to explicitly call memset(). This saves a few cycles and a few lines of code. Acked-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/3e8c0bfaa77500e22d6c90f249da1c53dbae716e.1645734041.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * VMCI: Fix the description of vmci_check_host_caps()Christophe JAILLET2022-02-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | vmci_check_host_caps() doesn't return a bool but an int. Fix the description accordingly. Fixes: 782f24453536 ("VMCI: fix error handling path when registering guest driver") Acked-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/c181bec88aab1145d3868d61b7e52d53923f8206.1645734041.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Merge 5.17-rc4 into char-misc-nextGreg Kroah-Hartman2022-02-142-1/+11
| |\ | | | | | | | | | | | | | | | We need the char/misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | VMCI: dma dg: add support for DMA datagrams receiveJorgen Hansen2022-02-081-24/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the DMA based receive operation instead of the ioread8_rep based datagram receive when DMA datagrams are supported. In the receive operation, configure the header to point to the page aligned VMCI_MAX_DG_SIZE part of the receive buffer using s/g configuration for the header. This ensures that the existing dispatch routine can be used with little modification. Initiate the receive by writing the lower 32 bit of the buffer to the VMCI_DATA_IN_LOW_ADDR register, and wait for the busy flag to be changed by the device using a wait queue. The existing dispatch routine for received datagrams is reused for the DMA datagrams with a few modifications: - the receive buffer is always the maximum size for DMA datagrams (IO ports would try with a shorter buffer first to reduce overhead of the ioread8_rep operation). - for DMA datagrams, datagrams are provided contiguous in the buffer as opposed to IO port datagrams, where they can start on any page boundary Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-9-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | VMCI: dma dg: add support for DMA datagrams sendsJorgen Hansen2022-02-081-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use DMA based send operation from the transmit buffer instead of the iowrite8_rep based datagram send when DMA datagrams are supported. The outgoing datagram is sent as inline data in the VMCI transmit buffer. Once the header has been configured, the send is initiated by writing the lower 32 bit of the buffer base address to the VMCI_DATA_OUT_LOW_ADDR register. Only then will the device process the header and the datagram itself. Following that, the driver busy waits (it isn't possible to sleep on the send path) for the header busy flag to change - indicating that the send is complete. Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-8-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | VMCI: dma dg: allocate send and receive buffers for DMA datagramsJorgen Hansen2022-02-081-9/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If DMA datagrams are used, allocate send and receive buffers in coherent DMA memory. This is done in preparation for the send and receive datagram operations, where the buffers are used for the exchange of data between driver and device. Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-7-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | VMCI: dma dg: register dummy IRQ handlers for DMA datagramsJorgen Hansen2022-02-081-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register dummy interrupt handlers for DMA datagrams in preparation for DMA datagram receive operations. Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-6-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | VMCI: dma dg: set OS page sizeJorgen Hansen2022-02-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Tell the device the page size used by the OS. Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-5-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | VMCI: dma dg: detect DMA datagram capabilityJorgen Hansen2022-02-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect the VMCI DMA datagram capability, and if present, ack it to the device. Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-4-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | VMCI: dma dg: add MMIO access to registersJorgen Hansen2022-02-081-19/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect the support for MMIO access through examination of the length of the region requested in BAR1. If it is 256KB, the VMCI device supports MMIO access to registers. If MMIO access is supported, map the area of the region used for MMIO access (64KB size at offset 128KB). Add wrapper functions for accessing 32 bit register accesses through either MMIO or IO ports based on device configuration. Sending and receiving datagrams through iowrite8_rep/ioread8_rep is left unchanged for now, and will be addressed in a later change. Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-3-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>