summaryrefslogtreecommitdiffstats
path: root/drivers/misc
Commit message (Collapse)AuthorAgeFilesLines
* habanalabs/gaudi: replace hl_poll_timeout with while loopDafna Hirschfeld2022-07-121-12/+11
| | | | | | | | | | in gaudi_scrub_device_mem, replace call to hl_poll_timeout with a while loop to avoid using dummy variables. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: communicate supported page sizes to userOhad Sharabi2022-07-125-19/+6
| | | | | | | | | | | | Because in future ASICs the driver will allow the user to set the page size we need to make sure this data is propagated in all APIs. In addition, since this is already an ASIC property we no longer need ASIC function for it. 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 dead code from free_device_memory()Tomer Tayar2022-07-121-28/+22
| | | | | | | | | | free_device_memory() ends with if and else, each has a return statement, followed by another return statement that can never be reached. Restructure the function and remove this dead code. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: enable error interrupt on ARB WDTOded Gabbay2022-07-121-0/+1
| | | | | | | We want to receive an error interrupt in case the watchdog timer expires on arbitration event in the queues. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: page size can only be a power of 2Ohad Sharabi2022-07-124-7/+2
| | | | | | | | We dropped support for page sizes that are not power of 2. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: refactor dma asic-specific functionsOhad Sharabi2022-07-128-152/+162
| | | | | | | | | | | | | | | | This is a pre-requisite patch for adding tracepoints to the DMA memory operations (allocation/free) in the driver. The main purpose is to be able to cross data with the map operations and determine whether memory violation occurred, for example free DMA allocation before unmapping it from device memory. To achieve this the DMA alloc/free code flows were refactored so that a single DMA tracepoint will catch many flows. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: remove unused enumOded Gabbay2022-07-121-22/+9
| | | | | | Also beautify code by preferring single line wherever possible. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: mask constant value before castOded Gabbay2022-07-121-4/+4
| | | | | | | This fixes a sparse warning of "cast truncates bits from constant value" Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: use correct type in assignmentOded Gabbay2022-07-121-1/+1
| | | | | | | packets are defined as LE so we need to convert before assigning values to them. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: fix function name in commentOded Gabbay2022-07-121-1/+1
| | | | | | function name in comment didn't match actual function name. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/goya: move dma direction enum to uapi fileOded Gabbay2022-07-122-26/+14
| | | | | | | | The values in this enum are not used by h/w but are a contract between userspace and the kernel driver so they must be defined in the uapi file. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: set default value for memory_scrubDafna Hirschfeld2022-07-121-0/+3
| | | | | | | | Set a default value for memory scrubbing Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: move call to scrub_device_mem after ctx_finiDafna Hirschfeld2022-07-122-5/+14
| | | | | | | | | | | In future ASICs, it would be possible to have a non-idle device when context is released. We thus need to postpone the scrubbing. Postpone it to hpriv release if reset is not executed or to device late init if reset is executed. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: use memory_scrub_val from debugfsDafna Hirschfeld2022-07-121-3/+2
| | | | | | | | | In the callback scrub_device_mem, use 'memory_scrub_val' from debugfs for the scrubbing value. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: don't send addr and size to scrub_device_mem cbDafna Hirschfeld2022-07-125-38/+36
| | | | | | | | | | We use scrub_device_mem only to scrub the entire SRAM and entire DRAM. Therefore there is no need to send addr and size args to the callback. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: don't do memory scrubbing when unmappingDafna Hirschfeld2022-07-121-30/+6
| | | | | | | | | | | There is no need to do memory scrub when unmapping anymore as it is an overhead as long as we have a single user at any given time. Remove that code and change return value of free_phys_pg_pack to void Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: print if firmware is secured during loadOfir Bitton2022-07-121-1/+2
| | | | | | | | | | For easier debug, it is desirable to have a simple way to know whether the device is secured or not, hence we dump this indication during boot. Signed-off-by: Ofir Bitton <obitton@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: fix a race condition causing DMAR errorYuri Nudelman2022-07-125-16/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a rare race condition in CB completion mechanism, that can occur under a very high pressure of command submissions. The preconditions for this to happen are: 1. There should be enough command submissions for the pre-allocated patched CB pool to run out of commands. At this stage we start allocating new patched CBs as they arrive. 2. CB size has to be exactly (128*n + 104)B for some n, i.e. 24B below a cache line end. The flow: 1. Two command buffers being completed on different streams, at the same time. Denote those CB1 and CB2. 2. Each command buffer is injected with two messages, 16B each - one for a HBW update of the completion queue, another to raise interrupt. 3. Assume CB1 updated the completion queue and raise the interrupt. 4. Assume CB2 updated the completion queue but did not raise the interrupt yet. 5. The host receives the interrupt. It goes over the completion queue and sees two completions - CB1 and CB2. Release them both. 6. CB2 performs the last command. The problem is that the last command is split between 2 cache lines. So to read the last 8B of the last command, it has to access the host again. Problem is - CB2 is already released. This causes a DMAR error. The solution to this problem is simply to make sure the last two commands in the CB are always in the same cache line, using NOP padding. Signed-off-by: Yuri Nudelman <ynudelman@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: fix warning: var might be used uninitializedKoby Elbaz2022-07-121-1/+1
| | | | | | | | | | | kernel test robot: "warning: variable 'index' is used uninitialized whenever 'if' condition is false" Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Koby Elbaz <kelbaz@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: move memory_scrub_val to hdev structDafna Hirschfeld2022-07-122-4/+4
| | | | | | | | | | move the field memory_scrub_val from struct hl_dbg_device_entry to struct hl_device. This is because we want to use this field also if debugfs is off. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: fix comment styleOded Gabbay2022-07-121-1/+1
| | | | | | function name should not be preceded with @ Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: use kvcalloc when possibleOded Gabbay2022-07-121-3/+2
| | | | | | kvcalloc is same as kvmalloc_array with GFP_ZERO. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: print pointer with correct modifierOded Gabbay2022-07-121-2/+2
| | | | | | Use %p instead of %llx for printing pointers. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: check fence pointer before useOded Gabbay2022-07-121-1/+1
| | | | | | fence pointer can be NULL in this path, as shown by an earlier check. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: add critical indication in sram eccran shalit2022-07-121-1/+2
| | | | | | | | | | Multiple SRAM SERR events are treated as critical events, and host should be notified about it. Thus, adding is_critical indication as part of SRAM ECC failure packet. Signed-off-by: ran shalit <rshalit@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: notify user process on device unavailableTal Cohen2022-07-121-1/+4
| | | | | | | | | | | When a device error occurs, user process would like to get some indication on the error by reading some device HW info. If the device is unavailable, user process can't perform any HW device reading. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: remove unused get_dma_desc_list_sizeOded Gabbay2022-07-123-5/+0
| | | | | | | | This asic callback function is not called anymore from the common code. The asic-specific function itself is called but from within the asic-specific code. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: fix NULL dereference on cs timeoutYuri Nudelman2022-07-121-2/+2
| | | | | | | | Device descriptor is accessed before an assignment Signed-off-by: Yuri Nudelman <ynudelman@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: fix shift out of boundsOfir Bitton2022-07-121-7/+9
| | | | | | | | | When validating NIC queues, queue offset calculation must be performed only for NIC queues. Signed-off-by: Ofir Bitton <obitton@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: add validity check for cq counter offsetfarah kassabri2022-07-121-1/+8
| | | | | | | | | Driver performs no validity check for the user cq counter offset used in both wait_for_interrupt and register_for_timestamp APIs. Signed-off-by: farah kassabri <fkassabri@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: fix incorrect MME offset calculationKoby Elbaz2022-07-121-3/+8
| | | | | | | | | | | | | | | | | | Once FW raised an event following a MME2 QMAN error, the driver should have gone to the corresponding status registers, trying to gather more info on the error, yet it was accidentally accessing MME1 QMAN address space. Generally, we have x4 MMEs, while 0 & 2 are marked MASTER, and 1 & 3 are marked SLAVE. The former can be addressed, yet addressing the latter is considered an access violation, and will result in a hung system, which is what unintentionally happened above. Note that this cannot happen in a secured system, since these registers are protected with range registers. Signed-off-by: Koby Elbaz <kelbaz@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: avoid unnecessary error printDani Liberman2022-07-121-1/+8
| | | | | | | | | | | | When sending a packet to FW right after it made reset, we will get packet timeout. Since it is expected behavior, we don't need to print an error in such case. Hence, when driver is in hard reset it will avoid from printing error messages about packet timeout. Signed-off-by: Dani Liberman <dliberman@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: send an event notification when CS timeout occursTal Cohen2022-07-121-9/+17
| | | | | | | | | | | The Driver needs to inform the User process whenever one of its CS is timed out. The Driver shall recognize the CS timeout and shall send an eventfd notification, towards user space, whenever a timeout is expired on a CS. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: send device reset notificationTal Cohen2022-07-121-3/+10
| | | | | | | | | | | | Device reset event, indicates that the device shall be reset - after a short delay. In such case, the driver sends a notification towards the User process. This allows the User process to be able to take several debug actions for system diagnostic purposes. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: invoke device reset from one code blockTal Cohen2022-07-121-9/+16
| | | | | | | | | | | | | | In order to prepare the driver code for device reset event notification, change the event handler function flow to call device reset from one code block. In addition, the commit fixes an issue that reset was performed w/o checking the 'hard_reset_on_fw_event' state and w/o setting the HL_DRV_RESET_DELAY flag. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: expose undefined opcode status via info ioctlTal Cohen2022-07-121-0/+25
| | | | | | | | | The info ioctl retrieves information on the last undefined opcode occurred. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: collect undefined opcode error infoTal Cohen2022-07-124-30/+132
| | | | | | | | | | | | | | when an undefined opcode error occurres, the driver collects the relevant information from the Qman and stores it inside the hdev data structure. An event fd indication is sent towards the user space. Note: another commit shall be followed which will add support to read the error info by an ioctl. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: fix race between hl_get_compute_ctx() and hl_ctx_put()Tomer Tayar2022-07-124-25/+47
| | | | | | | | | | | | | | | | | | | | | | | hl_get_compute_ctx() is used to get the pointer to the compute context from the hpriv object. The function is called in code paths that are not necessarily initiated by user, so it is possible that a context release process will happen in parallel. This can lead to a race condition in which hl_get_compute_ctx() retrieves the context pointer, and just before it increments the context refcount, the context object is released and a freed memory is accessed. To avoid this race, add a mutex to protect the context pointer in hpriv. With this lock, hl_get_compute_ctx() will be able to detect if the context has been released or is about to be released. struct hl_ctx_mgr has a mutex for contexts IDR with a similar "ctx_lock" name, so rename it to just "lock" to avoid a confusion with the new lock. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: keep a record of completed CS outcomesYuri Nudelman2022-07-123-12/+147
| | | | | | | | | | | | | | | | | | | | Often, the user is not interested in the completion timestamp of all command submissions. A common situation is, for example, when the user submits a burst of, possibly, several thousands of commands, then request the completion timestamp of only couple of specific key commands from all the burst. The problem is that currently, the outcome of the early commands may be lost, due to a large amount of later commands, that the user does not really care about. This patch creates a separate store with the outcomes of commands the user has mark explicitly as interested in. This store does not mix the marked commands with the unmarked ones, hence the data there will survive for much longer. Signed-off-by: Yuri Nudelman <ynudelman@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: fix comment to reflect current codeOded Gabbay2022-07-121-2/+8
| | | | | | | | | | | Due to code changes in the past few years, the original comment of how parser->user_cb_size is checked was not correct anymore. Fix it to reflect current code and add more explanation as the code is more complex now. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: change the write flag name of error info structsTal Cohen2022-07-124-12/+12
| | | | | | | | | positive flags naming will make more clear code while adding more 'error info' structures Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs/gaudi: move tpc assert raise into internal funcTal Cohen2022-07-121-15/+12
| | | | | | | | | raising the tpc assert event in an internal function will make the code cleaner as we are going to be adding more events Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: add terminating NULL to attrs arraysDafna Hirschfeld2022-07-123-0/+5
| | | | | | | | | | Arrays of struct attribute are expected to be NULL terminated. This is required by API methods such as device_add_groups. This fixes a crash when loading the driver for Goya device. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: Fix kernel-docJiapeng Chong2022-07-121-2/+2
| | | | | | | | | | | | | | | | Fix the following W=1 kernel warnings: drivers/misc/habanalabs/common/mmu/mmu_v1.c:425: warning: expecting prototype for hl_mmu_fini(). Prototype was for hl_mmu_v1_fini() instead. drivers/misc/habanalabs/common/mmu/mmu_v1.c:449: warning: expecting prototype for hl_mmu_ctx_init(). Prototype was for hl_mmu_v1_ctx_init() instead. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: Fix kernel-docJiapeng Chong2022-07-121-1/+1
| | | | | | | | | | | | Fix the following W=1 kernel warnings: drivers/misc/habanalabs/common/pci/pci.c:454: warning: expecting prototype for hl_fw_fini(). Prototype was for hl_pci_fini() instead. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* habanalabs: fix double unlock on error in map_device_va()Dan Carpenter2022-07-121-4/+2
| | | | | | | | | | If hl_mmu_prefetch_cache_range() fails then this code calls mutex_unlock(&ctx->mmu_lock) when it's no longer holding the mutex. Fixes: 9e495e24003e ("habanalabs: do MMU prefetch as deferred work") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* Merge 5.19-rc6 into char-misc-nextGreg Kroah-Hartman2022-07-112-22/+31
|\ | | | | | | | | | | We need the misc driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * misc: rtsx_usb: set return value in rsp_buf alloc err pathShuah Khan2022-07-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set return value in rsp_buf alloc error path before going to error handling. drivers/misc/cardreader/rtsx_usb.c:639:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!ucr->rsp_buf) ^~~~~~~~~~~~~ drivers/misc/cardreader/rtsx_usb.c:678:9: note: uninitialized use occurs here return ret; ^~~ drivers/misc/cardreader/rtsx_usb.c:639:2: note: remove the 'if' if its condition is always false if (!ucr->rsp_buf) ^~~~~~~~~~~~~~~~~~ drivers/misc/cardreader/rtsx_usb.c:622:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 Fixes: 3776c7855985 ("misc: rtsx_usb: use separate command and response buffers") Reported-by: kernel test robot <lkp@intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kernel.org/r/20220701165352.15687-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * misc: rtsx_usb: use separate command and response buffersShuah Khan2022-07-011-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | rtsx_usb uses same buffer for command and response. There could be a potential conflict using the same buffer for both especially if retries and timeouts are involved. Use separate command and response buffers to avoid conflicts. Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Cc: stable <stable@kernel.org> Link: https://lore.kernel.org/r/07e3721804ff07aaab9ef5b39a5691d0718b9ade.1656642167.git.skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * misc: rtsx_usb: fix use of dma mapped buffer for usb bulk transferShuah Khan2022-07-011-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rtsx_usb driver allocates coherent dma buffer for urb transfers. This buffer is passed to usb_bulk_msg() and usb core tries to map already mapped buffer running into a dma mapping error. xhci_hcd 0000:01:00.0: rejecting DMA map of vmalloc memory WARNING: CPU: 1 PID: 279 at include/linux/dma-mapping.h:326 usb_ hcd_map_urb_for_dma+0x7d6/0x820 ... xhci_map_urb_for_dma+0x291/0x4e0 usb_hcd_submit_urb+0x199/0x12b0 ... usb_submit_urb+0x3b8/0x9e0 usb_start_wait_urb+0xe3/0x2d0 usb_bulk_msg+0x115/0x240 rtsx_usb_transfer_data+0x185/0x1a8 [rtsx_usb] rtsx_usb_send_cmd+0xbb/0x123 [rtsx_usb] rtsx_usb_write_register+0x12c/0x143 [rtsx_usb] rtsx_usb_probe+0x226/0x4b2 [rtsx_usb] Fix it to use kmalloc() to get DMA-able memory region instead. Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Cc: stable <stable@kernel.org> Link: https://lore.kernel.org/r/667d627d502e1ba9ff4f9b94966df3299d2d3c0d.1656642167.git.skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>