mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-28 02:43:57 +00:00
580.94.13
This commit is contained in:
@@ -36,6 +36,19 @@
|
||||
#define NV_MAX_ISR_DELAY_MS (NV_MAX_ISR_DELAY_US / 1000)
|
||||
#define NV_NSECS_TO_JIFFIES(nsec) ((nsec) * HZ / 1000000000)
|
||||
|
||||
/*
|
||||
* in_hardirq() was added in v5.11-rc1 (2020-12-15) to replace in_irq().
|
||||
* Fall back to in_irq() for older kernels that don't have in_hardirq().
|
||||
*/
|
||||
static inline NvBool nv_in_hardirq(void)
|
||||
{
|
||||
#if defined(in_hardirq)
|
||||
return in_hardirq();
|
||||
#else
|
||||
return in_irq();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(NV_KTIME_GET_RAW_TS64_PRESENT)
|
||||
static inline void ktime_get_raw_ts64(struct timespec64 *ts64)
|
||||
{
|
||||
@@ -82,7 +95,7 @@ static inline NV_STATUS nv_sleep_us(unsigned int us)
|
||||
ktime_get_raw_ts64(&tm1);
|
||||
#endif
|
||||
|
||||
if (in_irq() && (us > NV_MAX_ISR_DELAY_US))
|
||||
if (nv_in_hardirq() && (us > NV_MAX_ISR_DELAY_US))
|
||||
return NV_ERR_GENERIC;
|
||||
|
||||
mdelay_safe_msec = us / 1000;
|
||||
@@ -127,7 +140,7 @@ static inline NV_STATUS nv_sleep_ms(unsigned int ms)
|
||||
tm_start = tm_aux;
|
||||
#endif
|
||||
|
||||
if (in_irq() && (ms > NV_MAX_ISR_DELAY_MS))
|
||||
if (nv_in_hardirq() && (ms > NV_MAX_ISR_DELAY_MS))
|
||||
{
|
||||
return NV_ERR_GENERIC;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user