accel/habanalabs: fix debugfs files permissions

[ Upstream commit 0b105a2a72 ]

debugfs files are created with permissions that don't align
with the access requirements.

Signed-off-by: Avri Kehat <akehat@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Avri Kehat 2024-01-16 17:54:36 +02:00 committed by Greg Kroah-Hartman
parent 0b9f748da2
commit 533893c2e0

View File

@ -1645,19 +1645,19 @@ static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_ent
&hl_data64b_fops); &hl_data64b_fops);
debugfs_create_file("set_power_state", debugfs_create_file("set_power_state",
0200, 0644,
root, root,
dev_entry, dev_entry,
&hl_power_fops); &hl_power_fops);
debugfs_create_file("device", debugfs_create_file("device",
0200, 0644,
root, root,
dev_entry, dev_entry,
&hl_device_fops); &hl_device_fops);
debugfs_create_file("clk_gate", debugfs_create_file("clk_gate",
0200, 0644,
root, root,
dev_entry, dev_entry,
&hl_clk_gate_fops); &hl_clk_gate_fops);
@ -1669,13 +1669,13 @@ static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_ent
&hl_stop_on_err_fops); &hl_stop_on_err_fops);
debugfs_create_file("dump_security_violations", debugfs_create_file("dump_security_violations",
0644, 0400,
root, root,
dev_entry, dev_entry,
&hl_security_violations_fops); &hl_security_violations_fops);
debugfs_create_file("dump_razwi_events", debugfs_create_file("dump_razwi_events",
0644, 0400,
root, root,
dev_entry, dev_entry,
&hl_razwi_check_fops); &hl_razwi_check_fops);
@ -1708,7 +1708,7 @@ static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_ent
&hdev->reset_info.skip_reset_on_timeout); &hdev->reset_info.skip_reset_on_timeout);
debugfs_create_file("state_dump", debugfs_create_file("state_dump",
0600, 0644,
root, root,
dev_entry, dev_entry,
&hl_state_dump_fops); &hl_state_dump_fops);
@ -1726,7 +1726,7 @@ static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_ent
for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) {
debugfs_create_file(hl_debugfs_list[i].name, debugfs_create_file(hl_debugfs_list[i].name,
0444, 0644,
root, root,
entry, entry,
&hl_debugfs_fops); &hl_debugfs_fops);