diff --git a/drivers/gpu/nvgpu/volt/volt_dev.c b/drivers/gpu/nvgpu/volt/volt_dev.c index 5d98cde46..750588280 100644 --- a/drivers/gpu/nvgpu/volt/volt_dev.c +++ b/drivers/gpu/nvgpu/volt/volt_dev.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "gp106/bios_gp106.h" @@ -391,7 +392,7 @@ static u32 volt_get_volt_devices_table(struct gk20a *g, goto done; } - memcpy(&header, volt_device_table_ptr, + nvgpu_memcpy((u8 *)&header, volt_device_table_ptr, sizeof(struct vbios_voltage_device_table_1x_header)); /* Read in the entries. */ @@ -399,7 +400,7 @@ static u32 volt_get_volt_devices_table(struct gk20a *g, entry_offset = (volt_device_table_ptr + header.header_size + (entry_idx * header.table_entry_size)); - memcpy(&entry, entry_offset, + nvgpu_memcpy((u8 *)&entry, entry_offset, sizeof(struct vbios_voltage_device_table_1x_entry)); if (entry.type == NV_VBIOS_VOLTAGE_DEVICE_1X_ENTRY_TYPE_PSV) { diff --git a/drivers/gpu/nvgpu/volt/volt_policy.c b/drivers/gpu/nvgpu/volt/volt_policy.c index cb5e3d620..692b3dbbf 100644 --- a/drivers/gpu/nvgpu/volt/volt_policy.c +++ b/drivers/gpu/nvgpu/volt/volt_policy.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "gp106/bios_gp106.h" #include "ctrl/ctrlvolt.h" @@ -295,7 +296,7 @@ static int volt_get_volt_policy_table(struct gk20a *g, goto done; } - memcpy(&header, voltage_policy_table_ptr, + nvgpu_memcpy((u8 *)&header, voltage_policy_table_ptr, sizeof(struct vbios_voltage_policy_table_1x_header)); /* Set Voltage Policy Table Index for Perf Core VF Sequence client. */ @@ -307,7 +308,7 @@ static int volt_get_volt_policy_table(struct gk20a *g, entry_offset = (voltage_policy_table_ptr + header.header_size + i * header.table_entry_size); - memcpy(&entry, entry_offset, + nvgpu_memcpy((u8 *)&entry, entry_offset, sizeof(struct vbios_voltage_policy_table_1x_entry)); memset(&policy_type_data, 0x0, sizeof(policy_type_data)); diff --git a/drivers/gpu/nvgpu/volt/volt_rail.c b/drivers/gpu/nvgpu/volt/volt_rail.c index 77470112c..c81572de1 100644 --- a/drivers/gpu/nvgpu/volt/volt_rail.c +++ b/drivers/gpu/nvgpu/volt/volt_rail.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "gp106/bios_gp106.h" #include "ctrl/ctrlvolt.h" @@ -284,7 +285,7 @@ static int volt_get_volt_rail_table(struct gk20a *g, goto done; } - memcpy(&header, volt_rail_table_ptr, + nvgpu_memcpy((u8 *)&header, volt_rail_table_ptr, sizeof(struct vbios_voltage_rail_table_1x_header)); pvolt_rail_metadata->volt_domain_hal = (u8)header.volt_domain_hal; @@ -295,7 +296,7 @@ static int volt_get_volt_rail_table(struct gk20a *g, memset(&rail_type_data, 0x0, sizeof(rail_type_data)); - memcpy(&entry, entry_ptr, + nvgpu_memcpy((u8 *)&entry, entry_ptr, sizeof(struct vbios_voltage_rail_table_1x_entry)); volt_domain = volt_rail_vbios_volt_domain_convert_to_internal(g,