aboutsummaryrefslogtreecommitdiffstats
path: root/runlist_procfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'runlist_procfs.c')
-rw-r--r--runlist_procfs.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/runlist_procfs.c b/runlist_procfs.c
index 0087d90..f569c77 100644
--- a/runlist_procfs.c
+++ b/runlist_procfs.c
@@ -207,6 +207,33 @@ struct file_operations preempt_tsg_file_ops = {
207 .llseek = default_llseek, 207 .llseek = default_llseek,
208}; 208};
209 209
210
211ssize_t resubmit_runlist_file_write(struct file *f, const char __user *buffer,
212 size_t count, loff_t *off) {
213 uint32_t target_runlist;
214 // Passing 0 as the base to kstrtou32 indicates autodetect hex/octal/dec
215 int err = kstrtou32_from_user(buffer, count, 0, &target_runlist);
216 struct nvdebug_state *g = &g_nvdebug_state[file2gpuidx(f)];
217 if (err)
218 return err;
219
220 // Verify valid runlist (in terms of absolute maximums)
221 if (g->chip_id < NV_CHIP_ID_TURING && target_runlist > MAX_RUNLISTS_GF100)
222 return -ERANGE;
223 else if (g->chip_id < NV_CHIP_ID_AMPERE && target_runlist > MAX_RUNLISTS_TU102)
224 return -ERANGE;
225
226 if ((err = resubmit_runlist(g, target_runlist)))
227 return err;
228
229 return count;
230}
231
232struct file_operations resubmit_runlist_file_ops = {
233 .write = resubmit_runlist_file_write,
234 .llseek = default_llseek,
235};
236
210ssize_t disable_channel_file_write(struct file *f, const char __user *buffer, 237ssize_t disable_channel_file_write(struct file *f, const char __user *buffer,
211 size_t count, loff_t *off) { 238 size_t count, loff_t *off) {
212 uint32_t target_channel; 239 uint32_t target_channel;