Guest User

kernel-6.19_mod

a guest
Mar 5th, 2026
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.22 KB | None | 0 0
  1. diff --git a/kernel/common/inc/nv-memdbg.h b/kernel/common/inc/nv-memdbg.h
  2. index c618ead..8212d44 100644
  3. --- a/kernel/common/inc/nv-memdbg.h
  4. +++ b/kernel/common/inc/nv-memdbg.h
  5. @@ -28,8 +28,9 @@ void nv_memdbg_exit(void);
  6.  
  7. #else
  8.  
  9. -#define NV_MEMDBG_ADD(ptr, size)
  10. -#define NV_MEMDBG_REMOVE(ptr, size)
  11. +// NB: Using while(0) to avoid -Wempty-body warnings
  12. +#define NV_MEMDBG_ADD(ptr, size) while(0)
  13. +#define NV_MEMDBG_REMOVE(ptr, size) while(0)
  14.  
  15. #endif /* NV_MEM_LOGGER */
  16.  
  17. diff --git a/kernel/conftest.sh b/kernel/conftest.sh
  18. index 1106ea5..fe2a7b9 100755
  19. --- a/kernel/conftest.sh
  20. +++ b/kernel/conftest.sh
  21. @@ -256,6 +256,11 @@ build_cflags() {
  22. CFLAGS="$CFLAGS -mfentry -DCC_USING_FENTRY"
  23. fi
  24. fi
  25. +
  26. + # Rel. commit "Kbuild: enable -fms-extensions" (Rasmus Villemoes, 20 Oct 2025)
  27. + # Enable the flags since the Linux headers use those extensions in some structs
  28. + # See https://www.phoronix.com/news/Linux-6.19-Patch-Would-MS-Ext
  29. + CFLAGS="$CFLAGS -fms-extensions"
  30. }
  31.  
  32. CONFTEST_PREAMBLE="#include \"conftest/headers.h\"
  33. diff --git a/kernel/nvidia-drm/nvidia-drm-crtc.c b/kernel/nvidia-drm/nvidia-drm-crtc.c
  34. index 6d5478e..9253bd5 100644
  35. --- a/kernel/nvidia-drm/nvidia-drm-crtc.c
  36. +++ b/kernel/nvidia-drm/nvidia-drm-crtc.c
  37. @@ -151,7 +151,7 @@ static int nv_drm_plane_atomic_check(struct drm_plane *plane,
  38. goto done;
  39. }
  40.  
  41. - nv_drm_for_each_crtc_in_state(plane_state->state, crtc, crtc_state, i) {
  42. + for_each_new_crtc_in_state(plane_state->state, crtc, crtc_state, i) {
  43. struct nv_drm_crtc_state *nv_crtc_state = to_nv_crtc_state(crtc_state);
  44. struct NvKmsKapiHeadRequestedConfig *head_req_config =
  45. &nv_crtc_state->req_config;
  46. @@ -368,8 +368,8 @@ static int nv_drm_crtc_atomic_check(struct drm_crtc *crtc,
  47.  
  48. req_config->flags.displaysChanged = NV_TRUE;
  49.  
  50. - nv_drm_for_each_connector_in_state(crtc_state->state,
  51. - connector, connector_state, j) {
  52. + for_each_new_connector_in_state(crtc_state->state,
  53. + connector, connector_state, j) {
  54. if (connector_state->crtc != crtc) {
  55. continue;
  56. }
  57. diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
  58. index 2bcf29c..6e8d258 100644
  59. --- a/kernel/nvidia-drm/nvidia-drm-drv.c
  60. +++ b/kernel/nvidia-drm/nvidia-drm-drv.c
  61. @@ -540,13 +540,13 @@ void nv_drm_master_drop(struct drm_device *dev, struct drm_file *file_priv)
  62.  
  63. drm_modeset_lock_all(dev);
  64.  
  65. - if ((err = nv_drm_atomic_helper_disable_all(
  66. + if ((err = drm_atomic_helper_disable_all(
  67. dev,
  68. dev->mode_config.acquire_ctx)) != 0) {
  69.  
  70. NV_DRM_DEV_LOG_ERR(
  71. nv_dev,
  72. - "nv_drm_atomic_helper_disable_all failed with error code %d !",
  73. + "drm_atomic_helper_disable_all failed with error code %d !",
  74. err);
  75. }
  76.  
  77. diff --git a/kernel/nvidia-drm/nvidia-drm-helper.c b/kernel/nvidia-drm/nvidia-drm-helper.c
  78. index 8b89afe..e6ab0e6 100644
  79. --- a/kernel/nvidia-drm/nvidia-drm-helper.c
  80. +++ b/kernel/nvidia-drm/nvidia-drm-helper.c
  81. @@ -62,141 +62,4 @@ static void __nv_drm_framebuffer_put(struct drm_framebuffer *fb)
  82.  
  83. }
  84.  
  85. -/*
  86. - * drm_atomic_helper_disable_all() has been added by commit
  87. - * 1494276000db789c6d2acd85747be4707051c801, which is Signed-off-by:
  88. - * Thierry Reding <[email protected]>
  89. - * Daniel Vetter <[email protected]>
  90. - *
  91. - * drm_atomic_helper_disable_all() is copied from
  92. - * linux/drivers/gpu/drm/drm_atomic_helper.c and modified to use
  93. - * nv_drm_for_each_crtc instead of drm_for_each_crtc to loop over all crtcs,
  94. - * use nv_drm_for_each_*_in_state instead of for_each_connector_in_state to loop
  95. - * over all modeset object states, and use drm_atomic_state_free() if
  96. - * drm_atomic_state_put() is not available.
  97. - *
  98. - * drm_atomic_helper_disable_all() is copied from
  99. - * linux/drivers/gpu/drm/drm_atomic_helper.c @
  100. - * 49d70aeaeca8f62b72b7712ecd1e29619a445866, which has the following
  101. - * copyright and license information:
  102. - *
  103. - * Copyright (C) 2014 Red Hat
  104. - * Copyright (C) 2014 Intel Corp.
  105. - *
  106. - * Permission is hereby granted, free of charge, to any person obtaining a
  107. - * copy of this software and associated documentation files (the "Software"),
  108. - * to deal in the Software without restriction, including without limitation
  109. - * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  110. - * and/or sell copies of the Software, and to permit persons to whom the
  111. - * Software is furnished to do so, subject to the following conditions:
  112. - *
  113. - * The above copyright notice and this permission notice shall be included in
  114. - * all copies or substantial portions of the Software.
  115. - *
  116. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  117. - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  118. - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  119. - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  120. - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  121. - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  122. - * OTHER DEALINGS IN THE SOFTWARE.
  123. - *
  124. - * Authors:
  125. - * Rob Clark <[email protected]>
  126. - * Daniel Vetter <[email protected]>
  127. - */
  128. -int nv_drm_atomic_helper_disable_all(struct drm_device *dev,
  129. - struct drm_modeset_acquire_ctx *ctx)
  130. -{
  131. - struct drm_atomic_state *state;
  132. - struct drm_connector_state *conn_state;
  133. - struct drm_connector *conn;
  134. - struct drm_plane_state *plane_state;
  135. - struct drm_plane *plane;
  136. - struct drm_crtc_state *crtc_state;
  137. - struct drm_crtc *crtc;
  138. - unsigned plane_mask = 0;
  139. - int ret, i;
  140. -
  141. - state = drm_atomic_state_alloc(dev);
  142. - if (!state)
  143. - return -ENOMEM;
  144. -
  145. - state->acquire_ctx = ctx;
  146. -
  147. - nv_drm_for_each_crtc(crtc, dev) {
  148. - crtc_state = drm_atomic_get_crtc_state(state, crtc);
  149. - if (IS_ERR(crtc_state)) {
  150. - ret = PTR_ERR(crtc_state);
  151. - goto free;
  152. - }
  153. -
  154. - crtc_state->active = false;
  155. -
  156. - ret = drm_atomic_set_mode_prop_for_crtc(crtc_state, NULL);
  157. - if (ret < 0)
  158. - goto free;
  159. -
  160. - ret = drm_atomic_add_affected_planes(state, crtc);
  161. - if (ret < 0)
  162. - goto free;
  163. -
  164. - ret = drm_atomic_add_affected_connectors(state, crtc);
  165. - if (ret < 0)
  166. - goto free;
  167. - }
  168. -
  169. - nv_drm_for_each_connector_in_state(state, conn, conn_state, i) {
  170. - ret = drm_atomic_set_crtc_for_connector(conn_state, NULL);
  171. - if (ret < 0)
  172. - goto free;
  173. - }
  174. -
  175. - nv_drm_for_each_plane_in_state(state, plane, plane_state, i) {
  176. - ret = drm_atomic_set_crtc_for_plane(plane_state, NULL);
  177. - if (ret < 0)
  178. - goto free;
  179. -
  180. - drm_atomic_set_fb_for_plane(plane_state, NULL);
  181. - plane_mask |= BIT(drm_plane_index(plane));
  182. - plane->old_fb = plane->fb;
  183. - }
  184. -
  185. - ret = drm_atomic_commit(state);
  186. -free:
  187. - if (plane_mask) {
  188. - drm_for_each_plane_mask(plane, dev, plane_mask) {
  189. - if (ret == 0) {
  190. - plane->fb = NULL;
  191. - plane->crtc = NULL;
  192. -
  193. - WARN_ON(plane->state->fb);
  194. - WARN_ON(plane->state->crtc);
  195. -
  196. - if (plane->old_fb)
  197. - __nv_drm_framebuffer_put(plane->old_fb);
  198. - }
  199. - plane->old_fb = NULL;
  200. - }
  201. - }
  202. -
  203. -#if defined(NV_DRM_ATOMIC_STATE_REF_COUNTING_PRESENT)
  204. - drm_atomic_state_put(state);
  205. -#else
  206. - if (ret != 0) {
  207. - drm_atomic_state_free(state);
  208. - } else {
  209. - /*
  210. - * In case of success, drm_atomic_commit() takes care to cleanup and
  211. - * free @state.
  212. - *
  213. - * Comment placed above drm_atomic_commit() says: The caller must not
  214. - * free or in any other way access @state. If the function fails then
  215. - * the caller must clean up @state itself.
  216. - */
  217. - }
  218. -#endif
  219. - return ret;
  220. -}
  221. -
  222. #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
  223. diff --git a/kernel/nvidia-drm/nvidia-drm-helper.h b/kernel/nvidia-drm/nvidia-drm-helper.h
  224. index 831737d..0fce7b2 100644
  225. --- a/kernel/nvidia-drm/nvidia-drm-helper.h
  226. +++ b/kernel/nvidia-drm/nvidia-drm-helper.h
  227. @@ -156,127 +156,6 @@ nv_drm_prime_pages_to_sg(struct drm_device *dev,
  228. #include <drm/drm_atomic.h>
  229. #include <drm/drm_atomic_helper.h>
  230.  
  231. -int nv_drm_atomic_helper_disable_all(struct drm_device *dev,
  232. - struct drm_modeset_acquire_ctx *ctx);
  233. -
  234. -/*
  235. - * for_each_connector_in_state(), for_each_crtc_in_state() and
  236. - * for_each_plane_in_state() were added by kernel commit
  237. - * df63b9994eaf942afcdb946d27a28661d7dfbf2a which was Signed-off-by:
  238. - * Ander Conselvan de Oliveira <[email protected]>
  239. - * Daniel Vetter <[email protected]>
  240. - *
  241. - * for_each_connector_in_state(), for_each_crtc_in_state() and
  242. - * for_each_plane_in_state() were copied from
  243. - * include/drm/drm_atomic.h @
  244. - * 21a01abbe32a3cbeb903378a24e504bfd9fe0648
  245. - * which has the following copyright and license information:
  246. - *
  247. - * Copyright (C) 2014 Red Hat
  248. - * Copyright (C) 2014 Intel Corp.
  249. - *
  250. - * Permission is hereby granted, free of charge, to any person obtaining a
  251. - * copy of this software and associated documentation files (the "Software"),
  252. - * to deal in the Software without restriction, including without limitation
  253. - * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  254. - * and/or sell copies of the Software, and to permit persons to whom the
  255. - * Software is furnished to do so, subject to the following conditions:
  256. - *
  257. - * The above copyright notice and this permission notice shall be included in
  258. - * all copies or substantial portions of the Software.
  259. - *
  260. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  261. - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  262. - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  263. - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  264. - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  265. - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  266. - * OTHER DEALINGS IN THE SOFTWARE.
  267. - *
  268. - * Authors:
  269. - * Rob Clark <[email protected]>
  270. - * Daniel Vetter <[email protected]>
  271. - */
  272. -
  273. -/**
  274. - * nv_drm_for_each_connector_in_state - iterate over all connectors in an
  275. - * atomic update
  276. - * @__state: &struct drm_atomic_state pointer
  277. - * @connector: &struct drm_connector iteration cursor
  278. - * @connector_state: &struct drm_connector_state iteration cursor
  279. - * @__i: int iteration cursor, for macro-internal use
  280. - *
  281. - * This iterates over all connectors in an atomic update. Note that before the
  282. - * software state is committed (by calling drm_atomic_helper_swap_state(), this
  283. - * points to the new state, while afterwards it points to the old state. Due to
  284. - * this tricky confusion this macro is deprecated.
  285. - */
  286. -#if !defined(for_each_connector_in_state)
  287. -#define nv_drm_for_each_connector_in_state(__state, \
  288. - connector, connector_state, __i) \
  289. - for ((__i) = 0; \
  290. - (__i) < (__state)->num_connector && \
  291. - ((connector) = (__state)->connectors[__i].ptr, \
  292. - (connector_state) = (__state)->connectors[__i].state, 1); \
  293. - (__i)++) \
  294. - for_each_if (connector)
  295. -#else
  296. -#define nv_drm_for_each_connector_in_state(__state, \
  297. - connector, connector_state, __i) \
  298. - for_each_connector_in_state(__state, connector, connector_state, __i)
  299. -#endif
  300. -
  301. -
  302. -/**
  303. - * nv_drm_for_each_crtc_in_state - iterate over all CRTCs in an atomic update
  304. - * @__state: &struct drm_atomic_state pointer
  305. - * @crtc: &struct drm_crtc iteration cursor
  306. - * @crtc_state: &struct drm_crtc_state iteration cursor
  307. - * @__i: int iteration cursor, for macro-internal use
  308. - *
  309. - * This iterates over all CRTCs in an atomic update. Note that before the
  310. - * software state is committed (by calling drm_atomic_helper_swap_state(), this
  311. - * points to the new state, while afterwards it points to the old state. Due to
  312. - * this tricky confusion this macro is deprecated.
  313. - */
  314. -#if !defined(for_each_crtc_in_state)
  315. -#define nv_drm_for_each_crtc_in_state(__state, crtc, crtc_state, __i) \
  316. - for ((__i) = 0; \
  317. - (__i) < (__state)->dev->mode_config.num_crtc && \
  318. - ((crtc) = (__state)->crtcs[__i].ptr, \
  319. - (crtc_state) = (__state)->crtcs[__i].state, 1); \
  320. - (__i)++) \
  321. - for_each_if (crtc_state)
  322. -#else
  323. -#define nv_drm_for_each_crtc_in_state(__state, crtc, crtc_state, __i) \
  324. - for_each_crtc_in_state(__state, crtc, crtc_state, __i)
  325. -#endif
  326. -
  327. -/**
  328. - * nv_drm_for_each_plane_in_state - iterate over all planes in an atomic update
  329. - * @__state: &struct drm_atomic_state pointer
  330. - * @plane: &struct drm_plane iteration cursor
  331. - * @plane_state: &struct drm_plane_state iteration cursor
  332. - * @__i: int iteration cursor, for macro-internal use
  333. - *
  334. - * This iterates over all planes in an atomic update. Note that before the
  335. - * software state is committed (by calling drm_atomic_helper_swap_state(), this
  336. - * points to the new state, while afterwards it points to the old state. Due to
  337. - * this tricky confusion this macro is deprecated.
  338. - */
  339. -#if !defined(for_each_plane_in_state)
  340. -#define nv_drm_for_each_plane_in_state(__state, plane, plane_state, __i) \
  341. - for ((__i) = 0; \
  342. - (__i) < (__state)->dev->mode_config.num_total_plane && \
  343. - ((plane) = (__state)->planes[__i].ptr, \
  344. - (plane_state) = (__state)->planes[__i].state, 1); \
  345. - (__i)++) \
  346. - for_each_if (plane_state)
  347. -#else
  348. -#define nv_drm_for_each_plane_in_state(__state, plane, plane_state, __i) \
  349. - for_each_plane_in_state(__state, plane, plane_state, __i)
  350. -#endif
  351. -
  352. static inline struct drm_crtc *nv_drm_crtc_find(struct drm_device *dev,
  353. uint32_t id)
  354. {
  355. diff --git a/kernel/nvidia-drm/nvidia-drm-modeset.c b/kernel/nvidia-drm/nvidia-drm-modeset.c
  356. index 3a57e8e..5bbcd4a 100644
  357. --- a/kernel/nvidia-drm/nvidia-drm-modeset.c
  358. +++ b/kernel/nvidia-drm/nvidia-drm-modeset.c
  359. @@ -112,20 +112,13 @@ nv_drm_atomic_apply_modeset_config(struct drm_device *dev,
  360. struct NvKmsKapiRequestedModeSetConfig *requested_config =
  361. &(to_nv_atomic_state(state)->config);
  362. struct drm_crtc *crtc;
  363. - struct drm_crtc_state *crtc_state;
  364. + struct drm_crtc_state *old_crtc_state, *new_crtc_state;
  365. int i;
  366.  
  367. memset(requested_config, 0, sizeof(*requested_config));
  368.  
  369. /* Loop over affected crtcs and construct NvKmsKapiRequestedModeSetConfig */
  370. - nv_drm_for_each_crtc_in_state(state, crtc, crtc_state, i) {
  371. - /*
  372. - * When commiting a state, the new state is already stored in
  373. - * crtc->state. When checking a proposed state, the proposed state is
  374. - * stored in crtc_state.
  375. - */
  376. - struct drm_crtc_state *new_crtc_state =
  377. - commit ? crtc->state : crtc_state;
  378. + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
  379. struct nv_drm_crtc *nv_crtc = to_nv_crtc(crtc);
  380.  
  381. requested_config->headRequestedConfig[nv_crtc->head] =
  382. @@ -134,7 +127,6 @@ nv_drm_atomic_apply_modeset_config(struct drm_device *dev,
  383. requested_config->headsMask |= 1 << nv_crtc->head;
  384.  
  385. if (commit) {
  386. - struct drm_crtc_state *old_crtc_state = crtc_state;
  387. struct nv_drm_crtc_state *nv_new_crtc_state =
  388. to_nv_crtc_state(new_crtc_state);
  389.  
  390. @@ -220,7 +212,7 @@ int nv_drm_atomic_commit(struct drm_device *dev,
  391.  
  392. int i;
  393. struct drm_crtc *crtc = NULL;
  394. - struct drm_crtc_state *crtc_state = NULL;
  395. + struct drm_crtc_state *new_crtc_state = NULL;
  396. struct nv_drm_device *nv_dev = to_nv_device(dev);
  397.  
  398. /*
  399. @@ -230,7 +222,7 @@ int nv_drm_atomic_commit(struct drm_device *dev,
  400. * updates to complete.
  401. */
  402. if (nonblock) {
  403. - nv_drm_for_each_crtc_in_state(state, crtc, crtc_state, i) {
  404. + for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
  405. struct nv_drm_crtc *nv_crtc = to_nv_crtc(crtc);
  406.  
  407. /*
  408. @@ -303,7 +295,7 @@ int nv_drm_atomic_commit(struct drm_device *dev,
  409. }
  410.  
  411. if (ret == 0 && !nonblock) {
  412. - nv_drm_for_each_crtc_in_state(state, crtc, crtc_state, i) {
  413. + for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
  414. struct nv_drm_crtc *nv_crtc = to_nv_crtc(crtc);
  415.  
  416. /*
  417. diff --git a/kernel/nvidia-drm/nvidia-drm-priv.h b/kernel/nvidia-drm/nvidia-drm-priv.h
  418. index 4f1a0e7..953c2eb 100644
  419. --- a/kernel/nvidia-drm/nvidia-drm-priv.h
  420. +++ b/kernel/nvidia-drm/nvidia-drm-priv.h
  421. @@ -39,6 +39,9 @@
  422. #include <drm/drm_gem.h>
  423. #endif
  424.  
  425. +// Rel. commit "drm/mm: replace drm_print.h include with a forward declaration" (Jani Nikula, 29 Oct 2025)
  426. +#include <drm/drm_print.h>
  427. +
  428. #include "nvidia-drm-os-interface.h"
  429.  
  430. #include "nvkms-kapi.h"
  431. diff --git a/kernel/nvidia/nv-dma.c b/kernel/nvidia/nv-dma.c
  432. index a06c12c..c30f8cc 100644
  433. --- a/kernel/nvidia/nv-dma.c
  434. +++ b/kernel/nvidia/nv-dma.c
  435. @@ -13,6 +13,7 @@
  436.  
  437. #include "os-interface.h"
  438. #include "nv-linux.h"
  439. +#include <linux/version.h>
  440.  
  441. NV_STATUS nv_create_dma_map_scatterlist (nv_dma_map_t *dma_map);
  442. void nv_destroy_dma_map_scatterlist(nv_dma_map_t *dma_map);
  443. @@ -619,7 +620,13 @@ static NvBool nv_dma_is_map_resource_implemented
  444. #endif
  445. }
  446.  
  447. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
  448. + // Rel. commit "dma-mapping: remove unused mapping resource callbacks" (Leon Romanovsky, 15 Oct 2025)
  449. + // https://lore.kernel.org/all/[email protected]/
  450. + return (ops->map_phys != NULL);
  451. +#else
  452. return (ops->map_resource != NULL);
  453. +#endif
  454. #else
  455. return NV_FALSE;
  456. #endif
  457. diff --git a/kernel/nvidia/os-interface.c b/kernel/nvidia/os-interface.c
  458. --- a/kernel/nvidia/os-interface.c
  459. +++ b/kernel/nvidia/os-interface.c
  460. @@ -17,6 +17,8 @@
  461. #include "nv-time.h"
  462. #include "nv-gpu-numa.h"
  463.  
  464. +#include <linux/hardirq.h>
  465. +
  466. #define MAX_ERROR_STRING 512
  467. static char nv_error_string[MAX_ERROR_STRING];
  468. nv_spinlock_t nv_error_string_lock;
  469. @@ -193,7 +195,7 @@ BOOL NV_API_CALL os_semaphore_may_sleep(
  470.  
  471. BOOL NV_API_CALL os_is_isr(void)
  472. {
  473. - return (in_irq());
  474. + return (in_hardirq());
  475. }
  476.  
  477. // return TRUE if the caller is the super-user
  478. @@ -510,7 +512,7 @@ NV_STATUS NV_API_CALL os_delay_us(NvU32
  479. nv_gettimeofday(&tm1);
  480. #endif
  481.  
  482. - if (in_irq() && (MicroSeconds > NV_MAX_ISR_DELAY_US))
  483. + if (in_hardirq() && (MicroSeconds > NV_MAX_ISR_DELAY_US))
  484. return NV_ERR_GENERIC;
  485.  
  486. mdelay_safe_msec = MicroSeconds / 1000;
  487. @@ -555,7 +557,7 @@ NV_STATUS NV_API_CALL os_delay(NvU32 Mil
  488. tm_start = tm_aux;
  489. #endif
  490.  
  491. - if (in_irq() && (MilliSeconds > NV_MAX_ISR_DELAY_MS))
  492. + if (in_hardirq() && (MilliSeconds > NV_MAX_ISR_DELAY_MS))
  493. return NV_ERR_GENERIC;
  494.  
  495. if (!NV_MAY_SLEEP())
  496. diff --git a/kernel/nvidia/nvlink_linux.c b/kernel/nvidia/nvlink_linux.c
  497. --- a/kernel/nvidia/nvlink_linux.c
  498. +++ b/kernel/nvidia/nvlink_linux.c
  499. @@ -30,6 +30,7 @@
  500. #include "nv-linux.h"
  501. #include "nv-procfs.h"
  502. #include "nv-time.h"
  503. +#include <linux/hardirq.h>
  504.  
  505. #define MAX_ERROR_STRING 512
  506.  
  507. @@ -570,7 +571,7 @@ void NVLINK_API_CALL nvlink_sleep(unsign
  508.  
  509. nv_gettimeofday(&tm_aux);
  510.  
  511. - if (in_irq() && (ms > NV_MAX_ISR_DELAY_MS))
  512. + if (in_hardirq() && (ms > NV_MAX_ISR_DELAY_MS))
  513. {
  514. return;
  515. }
  516.  
Add Comment
Please, Sign In to add comment