accel/ivpu: Update to -next 2023-10-20
cover accel/ivpu: Update to -next 2023-10-20
Random changes across the driver.
Karol Wachowski (1):
accel/ivpu: Read clock rate only if device is up
Krystian Pradzynski (3):
accel/ivpu: Use ratelimited warn and err in IPC/JSM accel/ivpu: Fix verbose version of REG_POLL macros accel/ivpu: Print IPC type string instead of number
Stanislaw Gruszka (2):
accel/ivpu: Do no initialize parameters on power up accel/ivpu/37xx: Remove support for FPGA and simics
drivers/accel/ivpu/ivpu_drv.c | 18 ++++++- drivers/accel/ivpu/ivpu_hw_37xx.c | 63 ++++------------------ drivers/accel/ivpu/ivpu_hw_40xx.c | 8 +-- drivers/accel/ivpu/ivpu_hw_reg_io.h | 32 ++++++----- drivers/accel/ivpu/ivpu_ipc.c | 34 ++++++------ drivers/accel/ivpu/ivpu_jsm_msg.c | 82 ++++++++++++++++++++++++++--- drivers/accel/ivpu/ivpu_jsm_msg.h | 2 + drivers/accel/ivpu/ivpu_mmu.c | 47 ++++++++++------- drivers/accel/ivpu/ivpu_pm.c | 13 +++++ drivers/accel/ivpu/ivpu_pm.h | 1 + 10 files changed, 189 insertions(+), 111 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/6 accel/ivpu: Use ratelimited warn and err in IPC/JSM
From: Krystian Pradzynski <[email protected]>
Quite often during test corner cases IPC, JSM functions can flood dmesg with warn or err messages. With that lost dmesg history. Change warn, err to ratelimited versions in IPC, JSM to suppress dmesg spam occurrence during fail test scenarios.
--- drivers/accel/ivpu/ivpu_ipc.c | 29 ++++++++++++++++------------- drivers/accel/ivpu/ivpu_jsm_msg.c | 18 ++++++++++-------- 2 files changed, 26 insertions(+), 21 deletions(-)
drivers/accel/ivpu/ivpu_ipc.c +16 -13
@@ -79,8 +79,8 @@ ivpu_ipc_tx_prepare(struct ivpu_device *vdev, struct ivpu_ipc_consumer *cons, tx_buf_vpu_addr =gen_pool_alloc (ipc->mm_tx,sizeof (*tx_buf));if (!tx_buf_vpu_addr) { -ivpu_err (vdev,"Failed to reserve IPC buffer, size %ld\n" , -sizeof (*tx_buf)); +ivpu_err_ratelimited (vdev,"Failed to reserve IPC buffer, size %ld\n" , +sizeof (*tx_buf));return -ENOMEM ; }
@@ -93,12 +93,12 @@ ivpu_ipc_tx_prepare(struct ivpu_device *vdev, struct ivpu_ipc_consumer *cons, jsm_vpu_addr = tx_buf_vpu_addr + offsetof(struct ivpu_ipc_tx_buf , jsm);if (tx_buf->ipc.status !=IVPU_IPC_HDR_FREE ) -ivpu_warn (vdev,"IPC message vpu:0x%x not released by firmware\n" , - tx_buf_vpu_addr); +ivpu_warn_ratelimited (vdev,"IPC message vpu:0x%x not released by firmware\n" , + tx_buf_vpu_addr);if (tx_buf->jsm.status !=VPU_JSM_MSG_FREE ) -ivpu_warn (vdev,"JSM message vpu:0x%x not released by firmware\n" , - jsm_vpu_addr); +ivpu_warn_ratelimited (vdev,"JSM message vpu:0x%x not released by firmware\n" , + jsm_vpu_addr);memset (tx_buf,0 ,sizeof (*tx_buf)); tx_buf->ipc.data_addr = jsm_vpu_addr;
@@ -266,18 +266,19 @@ ivpu_ipc_send_receive_internal(struct ivpu_device *vdev, struct vpu_jsm_msg *req ret =ivpu_ipc_send (vdev, &cons, req);if (ret) { -ivpu_warn (vdev,"IPC send failed: %d\n" , ret); +ivpu_warn_ratelimited (vdev,"IPC send failed: %d\n" , ret); goto consumer_del; } ret =ivpu_ipc_receive (vdev, &cons,NULL , resp, timeout_ms);if (ret) { -ivpu_warn (vdev,"IPC receive failed: type 0x%x, ret %d\n" , req->type, ret); +ivpu_warn_ratelimited (vdev,"IPC receive failed: type 0x%x, ret %d\n" , + req->type, ret); goto consumer_del; }if (resp->type != expected_resp_type) { -ivpu_warn (vdev,"Invalid JSM response type: 0x%x\n" , resp->type); +ivpu_warn_ratelimited (vdev,"Invalid JSM response type: 0x%x\n" , resp->type); ret = -EBADE ; }
@@ -375,13 +376,13 @@ int ivpu_ipc_irq_handler(struct ivpu_device *vdev)while (ivpu_hw_reg_ipc_rx_count_get (vdev)) { vpu_addr =ivpu_hw_reg_ipc_rx_addr_get (vdev);if (vpu_addr ==REG_IO_ERROR ) { -ivpu_err (vdev,"Failed to read IPC rx addr register\n" ); +ivpu_err_ratelimited (vdev,"Failed to read IPC rx addr register\n" );return -EIO ; } ipc_hdr =ivpu_to_cpu_addr (ipc->mem_rx, vpu_addr);if (!ipc_hdr) { -ivpu_warn (vdev,"IPC msg 0x%x out of range\n" , vpu_addr); +ivpu_warn_ratelimited (vdev,"IPC msg 0x%x out of range\n" , vpu_addr);continue ; }ivpu_ipc_msg_dump (vdev,"RX" , ipc_hdr, vpu_addr);
@@ -390,7 +391,8 @@ int ivpu_ipc_irq_handler(struct ivpu_device *vdev)if (ipc_hdr->channel !=IVPU_IPC_CHAN_BOOT_MSG ) { jsm_msg =ivpu_to_cpu_addr (ipc->mem_rx, ipc_hdr->data_addr);if (!jsm_msg) { -ivpu_warn (vdev,"JSM msg 0x%x out of range\n" , ipc_hdr->data_addr); +ivpu_warn_ratelimited (vdev,"JSM msg 0x%x out of range\n" , + ipc_hdr->data_addr);ivpu_ipc_rx_mark_free (vdev, ipc_hdr,NULL );continue ; }
@@ -398,7 +400,8 @@ int ivpu_ipc_irq_handler(struct ivpu_device *vdev) }if (atomic_read (&ipc->rx_msg_count) >IPC_MAX_RX_MSG ) { -ivpu_warn (vdev,"IPC RX msg dropped, msg count %d\n" ,IPC_MAX_RX_MSG ); +ivpu_warn_ratelimited (vdev,"IPC RX msg dropped, msg count %d\n" , +IPC_MAX_RX_MSG );ivpu_ipc_rx_mark_free (vdev, ipc_hdr, jsm_msg);continue ; }
drivers/accel/ivpu/ivpu_jsm_msg.c +10 -8
@@ -22,7 +22,7 @@ int ivpu_jsm_register_db(struct ivpu_device *vdev, u32 ctx_id, u32 db_id, ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_REGISTER_DB_DONE , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) { -ivpu_err (vdev,"Failed to register doorbell %d: %d\n" , db_id, ret); +ivpu_err_ratelimited (vdev,"Failed to register doorbell %d: %d\n" , db_id, ret);return ret; }
@@ -42,7 +42,7 @@ int ivpu_jsm_unregister_db(struct ivpu_device *vdev, u32 db_id) ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_UNREGISTER_DB_DONE , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) { -ivpu_warn (vdev,"Failed to unregister doorbell %d: %d\n" , db_id, ret); +ivpu_warn_ratelimited (vdev,"Failed to unregister doorbell %d: %d\n" , db_id, ret);return ret; }
@@ -65,7 +65,8 @@ int ivpu_jsm_get_heartbeat(struct ivpu_device *vdev, u32 engine, u64 *heartbeat) ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_QUERY_ENGINE_HB_DONE , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) { -ivpu_err (vdev,"Failed to get heartbeat from engine %d: %d\n" , engine, ret); +ivpu_err_ratelimited (vdev,"Failed to get heartbeat from engine %d: %d\n" , + engine, ret);return ret; }
@@ -87,7 +88,7 @@ int ivpu_jsm_reset_engine(struct ivpu_device *vdev, u32 engine) ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_ENGINE_RESET_DONE , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) -ivpu_err (vdev,"Failed to reset engine %d: %d\n" , engine, ret); +ivpu_err_ratelimited (vdev,"Failed to reset engine %d: %d\n" , engine, ret);return ret; }
@@ -107,7 +108,7 @@ int ivpu_jsm_preempt_engine(struct ivpu_device *vdev, u32 engine, u32 preempt_id ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_ENGINE_PREEMPT_DONE , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) -ivpu_err (vdev,"Failed to preempt engine %d: %d\n" , engine, ret); +ivpu_err_ratelimited (vdev,"Failed to preempt engine %d: %d\n" , engine, ret);return ret; }
@@ -123,7 +124,8 @@ int ivpu_jsm_dyndbg_control(struct ivpu_device *vdev, char *command, size_t size ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_DYNDBG_CONTROL_RSP , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) -ivpu_warn (vdev,"Failed to send command \"%s\": ret %d\n" , command, ret); +ivpu_warn_ratelimited (vdev,"Failed to send command \"%s\": ret %d\n" , + command, ret);return ret; }
@@ -138,7 +140,7 @@ int ivpu_jsm_trace_get_capability(struct ivpu_device *vdev, u32 *trace_destinati ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_TRACE_GET_CAPABILITY_RSP , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) { -ivpu_warn (vdev,"Failed to get trace capability: %d\n" , ret); +ivpu_warn_ratelimited (vdev,"Failed to get trace capability: %d\n" , ret);return ret; }
@@ -162,7 +164,7 @@ int ivpu_jsm_trace_set_config(struct ivpu_device *vdev, u32 trace_level, u32 tra ret =ivpu_ipc_send_receive (vdev, &req,VPU_JSM_MSG_TRACE_SET_CONFIG_RSP , &resp,VPU_IPC_CHAN_ASYNC_CMD , vdev->timeout.jsm);if (ret) -ivpu_warn (vdev,"Failed to set config: %d\n" , ret); +ivpu_warn_ratelimited (vdev,"Failed to set config: %d\n" , ret);return ret; }
Signature · 1 line
2.25.1
Re: [PATCH 1/6] accel/ivpu: Use ratelimited warn and err in IPC/JSM
Quoted 10 lines · Stanislaw Gruszka
From: Krystian Pradzynski <[email protected]>
Quite often during test corner cases IPC, JSM functions can flood dmesg with warn or err messages. With that lost dmesg history. Change warn, err to ratelimited versions in IPC, JSM to suppress dmesg spam occurrence during fail test scenarios.
Signed-off-by Krystian Pradzynski <[email protected]>Reviewed-by Stanislaw Gruszka <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>
PATCH 2/6 accel/ivpu: Fix verbose version of REG_POLL macros
In reply to Stanislaw GruszkaFrom: Krystian Pradzynski <[email protected]>
Remove two out of four _POLL macros. For two remained _POLL macros add message about polling register start and finish.
Additionally avoid inconsequence when using REGV_WR/RD macros in MMU code - passing raw register offset instead of register name.
--- drivers/accel/ivpu/ivpu_hw_reg_io.h | 32 ++++++++++++-------- drivers/accel/ivpu/ivpu_mmu.c | 47 +++++++++++++++++------------ 2 files changed, 48 insertions(+), 31 deletions(-)
drivers/accel/ivpu/ivpu_hw_reg_io.h +20 -12
@@ -47,22 +47,30 @@#define REG_TEST_FLD_NUM (REG ,FLD , num, val) \ ((num) == FIELD_GET(REG##_##FLD##_MASK, val)) -#define REGB_POLL (reg, var, cond, timeout_us) \ - read_poll_timeout(REGB_RD32_SILENT, var, cond, REG_POLL_SLEEP_US, timeout_us, false, reg) - -#define REGV_POLL (reg, var, cond, timeout_us) \ - read_poll_timeout(REGV_RD32_SILENT, var, cond, REG_POLL_SLEEP_US, timeout_us, false, reg) -#define REGB_POLL_FLD (reg, fld, val, timeout_us) \ ({ \ u32 var; \ - REGB_POLL(reg, var, (FIELD_GET(reg##_##fld##_MASK, var) == (val)), timeout_us); \ + int r; \ + ivpu_dbg(vdev, REG, "%s : %s (0x%08x) Polling field %s started (expected 0x%x)\n", \ + __func__, #reg, reg, #fld, val); \ + r = read_poll_timeout(REGB_RD32_SILENT, var, (FIELD_GET(reg##_##fld##_MASK, var) == (val)),\ + REG_POLL_SLEEP_US, timeout_us, false, (reg)); \ + ivpu_dbg(vdev, REG, "%s : %s (0x%08x) Polling field %s %s (reg val 0x%08x)\n", \ + __func__, #reg, reg, #fld, r ? "ETIMEDOUT" : "OK", var); \ + r; \ })#define REGV_POLL_FLD (reg, fld, val, timeout_us) \ ({ \ u32 var; \ - REGV_POLL(reg, var, (FIELD_GET(reg##_##fld##_MASK, var) == (val)), timeout_us); \ + int r; \ + ivpu_dbg(vdev, REG, "%s : %s (0x%08x) Polling field %s started (expected 0x%x)\n", \ + __func__, #reg, reg, #fld, val); \ + r = read_poll_timeout(REGV_RD32_SILENT, var, (FIELD_GET(reg##_##fld##_MASK, var) == (val)),\ + REG_POLL_SLEEP_US, timeout_us, false, (reg)); \ + ivpu_dbg(vdev, REG, "%s : %s (0x%08x) Polling field %s %s (reg val 0x%08x)\n", \ + __func__, #reg, reg, #fld, r ? "ETIMEDOUT" : "OK", var); \ + r; \ }) static inline u32
@@ -71,7 +79,7 @@ ivpu_hw_reg_rd32(struct ivpu_device *vdev, void __iomem *base, u32 reg, {u32 val =readl (base + reg); -ivpu_dbg (vdev,REG ,"%s RD: %s (0x%08x) => 0x%08x\n" , func, name, reg, val); +ivpu_dbg (vdev,REG ,"%s : %s (0x%08x) RD: 0x%08x\n" , func, name, reg, val);return val; }
@@ -81,7 +89,7 @@ ivpu_hw_reg_rd64(struct ivpu_device *vdev, void __iomem *base, u32 reg, {u64 val =readq (base + reg); -ivpu_dbg (vdev,REG ,"%s RD: %s (0x%08x) => 0x%016llx\n" , func, name, reg, val); +ivpu_dbg (vdev,REG ,"%s : %s (0x%08x) RD: 0x%016llx\n" , func, name, reg, val);return val; }
@@ -89,7 +97,7 @@ static inline void ivpu_hw_reg_wr32(struct ivpu_device *vdev, void __iomem *base, u32 reg, u32 val, const char *name, const char *func) { - ivpu_dbg(vdev, REG, "%s WR: %s (0x%08x) <= 0x%08x\n", func, name, reg, val); + ivpu_dbg(vdev, REG, "%s : %s (0x%08x) WR: 0x%08x\n", func, name, reg, val);writel (val, base + reg); }
@@ -97,7 +105,7 @@ static inline void ivpu_hw_reg_wr64(struct ivpu_device *vdev, void __iomem *base, u32 reg, u64 val, const char *name, const char *func) { - ivpu_dbg(vdev, REG, "%s WR: %s (0x%08x) <= 0x%016llx\n", func, name, reg, val); + ivpu_dbg(vdev, REG, "%s : %s (0x%08x) WR: 0x%016llx\n", func, name, reg, val);writeq (val, base + reg); }
drivers/accel/ivpu/ivpu_mmu.c +28 -19
121 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH 2/6] accel/ivpu: Fix verbose version of REG_POLL macros
Quoted 3 lines · Stanislaw Gruszka
From: Krystian Pradzynski <[email protected]>
Remove two out of four
_POLLmacros. For two remained_POLL
remained -> remaining
Quoted 8 lines
macros add message about polling register start and finish.
Additionally avoid inconsequence when using REGV_WR/RD macros in MMU code - passing raw register offset instead of register name.
Signed-off-by Krystian Pradzynski <[email protected]>Reviewed-by Stanislaw Gruszka <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>
PATCH 3/6 accel/ivpu: Read clock rate only if device is up
In reply to Stanislaw GruszkaFrom: Karol Wachowski <[email protected]>
Do not unnecessarily wake up device to read clock rate. Return 0 as clk_rate if device is suspended.
--- drivers/accel/ivpu/ivpu_drv.c | 18 +++++++++++++++++- drivers/accel/ivpu/ivpu_pm.c | 13 +++++++++++++ drivers/accel/ivpu/ivpu_pm.h | 1 + 3 files changed, 31 insertions(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_drv.c +17 -1
@@ -131,6 +131,22 @@ static int ivpu_get_capabilities(struct ivpu_device *vdev, struct drm_ivpu_paramreturn 0 ; } +static int ivpu_get_core_clock_rate (struct ivpu_device *vdev,u64 *clk_rate) +{ +int ret; + + ret =ivpu_rpm_get_if_active (vdev); +if (ret <0 ) +return ret; + + *clk_rate = ret ?ivpu_hw_reg_pll_freq_get (vdev) :0 ; + +if (ret) +ivpu_rpm_put (vdev); + +return 0 ; +} +static int ivpu_get_param_ioctl (struct drm_device *dev,void *data,struct drm_file *file) {struct ivpu_file_priv *file_priv = file->driver_priv;
@@ -154,7 +170,7 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f args->value = vdev->platform;break ;case DRM_IVPU_PARAM_CORE_CLOCK_RATE : - args->value =ivpu_hw_reg_pll_freq_get (vdev); + ret =ivpu_get_core_clock_rate (vdev, &args->value);break ;case DRM_IVPU_PARAM_NUM_CONTEXTS : args->value =ivpu_get_context_count (vdev);
drivers/accel/ivpu/ivpu_pm.c +13 -0
@@ -246,6 +246,19 @@ int ivpu_rpm_get(struct ivpu_device *vdev)return ret; } +int ivpu_rpm_get_if_active (struct ivpu_device *vdev) +{ +int ret; + +ivpu_dbg (vdev,RPM ,"rpm_get_if_active count %d\n" , +atomic_read (&vdev->drm.dev->power.usage_count)); + + ret =pm_runtime_get_if_active (vdev->drm.dev, false); +drm_WARN_ON (&vdev->drm, ret <0 ); + +return ret; +} +void ivpu_rpm_put (struct ivpu_device *vdev) {pm_runtime_mark_last_busy (vdev->drm.dev);
drivers/accel/ivpu/ivpu_pm.h +1 -0
@@ -33,6 +33,7 @@ void ivpu_pm_reset_prepare_cb(struct pci_dev *pdev);void ivpu_pm_reset_done_cb (struct pci_dev *pdev);int __must_check ivpu_rpm_get (struct ivpu_device *vdev); +int __must_check ivpu_rpm_get_if_active (struct ivpu_device *vdev);void ivpu_rpm_put (struct ivpu_device *vdev);void ivpu_pm_schedule_recovery (struct ivpu_device *vdev);
Signature · 1 line
2.25.1
Re: [PATCH 3/6] accel/ivpu: Read clock rate only if device is up
Quoted 8 lines · Stanislaw Gruszka
From: Karol Wachowski <[email protected]>
Do not unnecessarily wake up device to read clock rate. Return 0 as
clk_rateif device is suspended.Signed-off-by Karol Wachowski <[email protected]>Reviewed-by Stanislaw Gruszka <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>
PATCH 4/6 accel/ivpu: Print IPC type string instead of number
In reply to Stanislaw GruszkaFrom: Krystian Pradzynski <[email protected]>
Introduce ivpu_jsm_msg_type_to_str() helper to print type of IPC message. This will make reading logs and debugging IPC issues easier.
--- drivers/accel/ivpu/ivpu_ipc.c | 9 +++-- drivers/accel/ivpu/ivpu_jsm_msg.c | 64 +++++++++++++++++++++++++++++++ drivers/accel/ivpu/ivpu_jsm_msg.h | 2 + 3 files changed, 71 insertions(+), 4 deletions(-)
drivers/accel/ivpu/ivpu_ipc.c +5 -4
@@ -45,8 +45,9 @@ static void ivpu_jsm_msg_dump(struct ivpu_device *vdev, char *c,u32 *payload = (u32 *)&jsm_msg->payload;ivpu_dbg (vdev,JSM , -"%s: vpu:0x%08x (type:0x%x, status:0x%x, id: 0x%x, result: 0x%x, payload:0x%x 0x%x 0x%x 0x%x 0x%x)\n" , - c, vpu_addr, jsm_msg->type, jsm_msg->status, jsm_msg->request_id, jsm_msg->result, +"%s: vpu:0x%08x (type:%s, status:0x%x, id: 0x%x, result: 0x%x, payload:0x%x 0x%x 0x%x 0x%x 0x%x)\n" , + c, vpu_addr,ivpu_jsm_msg_type_to_str (jsm_msg->type), + jsm_msg->status, jsm_msg->request_id, jsm_msg->result, payload[0 ], payload[1 ], payload[2 ], payload[3 ], payload[4 ]); }
@@ -272,8 +273,8 @@ ivpu_ipc_send_receive_internal(struct ivpu_device *vdev, struct vpu_jsm_msg *req ret =ivpu_ipc_receive (vdev, &cons,NULL , resp, timeout_ms);if (ret) { -ivpu_warn_ratelimited (vdev,"IPC receive failed: type 0x%x, ret %d\n" , - req->type, ret); +ivpu_warn_ratelimited (vdev,"IPC receive failed: type %s, ret %d\n" , +ivpu_jsm_msg_type_to_str (req->type), ret); goto consumer_del; }
drivers/accel/ivpu/ivpu_jsm_msg.c +64 -0
70 lines not on this page · raw message
drivers/accel/ivpu/ivpu_jsm_msg.h +2 -0
@@ -8,6 +8,8 @@#include "vpu_jsm_api.h" +const char *ivpu_jsm_msg_type_to_str (enum vpu_ipc_msg_type type); +int ivpu_jsm_register_db (struct ivpu_device *vdev,u32 ctx_id,u32 db_id,u64 jobq_base,u32 jobq_size);int ivpu_jsm_unregister_db (struct ivpu_device *vdev,u32 db_id);
Signature · 1 line
2.25.1
Re: [PATCH 4/6] accel/ivpu: Print IPC type string instead of number
Quoted 10 lines · Stanislaw Gruszka
From: Krystian Pradzynski <[email protected]>
Introduce
ivpu_jsm_msg_type_to_str()helper to print type of IPC message. This will make reading logs and debugging IPC issues easier.Co-developed-by Maciej Falkowski <[email protected]>Signed-off-by Maciej Falkowski <[email protected]>Signed-off-by Krystian Pradzynski <[email protected]>Reviewed-by Stanislaw Gruszka <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>
PATCH 5/6 accel/ivpu: Do no initialize parameters on power up
In reply to Stanislaw GruszkaInitialize HW specific parameters only once. We do not have to do this on every power_up (performed during initialization and on resume). Move corresponding code to ->init_info()
--- drivers/accel/ivpu/ivpu_hw_37xx.c | 8 ++++---- drivers/accel/ivpu/ivpu_hw_40xx.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/accel/ivpu/ivpu_hw_37xx.c +4 -4
@@ -632,6 +632,10 @@ static int ivpu_hw_37xx_info_init(struct ivpu_device *vdev)ivpu_hw_init_range (&hw->ranges.shave,0x180000000 ,SZ_2G );ivpu_hw_init_range (&hw->ranges.dma,0x200000000 ,SZ_8G ); +ivpu_hw_read_platform (vdev); +ivpu_hw_wa_init (vdev); +ivpu_hw_timeouts_init (vdev); +return 0 ; }
@@ -688,10 +692,6 @@ static int ivpu_hw_37xx_power_up(struct ivpu_device *vdev) {int ret; -ivpu_hw_read_platform (vdev); -ivpu_hw_wa_init (vdev); -ivpu_hw_timeouts_init (vdev); - ret =ivpu_hw_37xx_reset (vdev);if (ret)ivpu_warn (vdev,"Failed to reset HW: %d\n" , ret);
drivers/accel/ivpu/ivpu_hw_40xx.c +4 -4
@@ -722,6 +722,10 @@ static int ivpu_hw_40xx_info_init(struct ivpu_device *vdev)ivpu_hw_init_range (&vdev->hw->ranges.shave,0x80000000 +SZ_256M ,SZ_2G -SZ_256M );ivpu_hw_init_range (&vdev->hw->ranges.dma,0x200000000 ,SZ_8G ); +ivpu_hw_read_platform (vdev); +ivpu_hw_wa_init (vdev); +ivpu_hw_timeouts_init (vdev); +return 0 ; }
@@ -813,10 +817,6 @@ static int ivpu_hw_40xx_power_up(struct ivpu_device *vdev)return ret; } -ivpu_hw_read_platform (vdev); -ivpu_hw_wa_init (vdev); -ivpu_hw_timeouts_init (vdev); - ret =ivpu_hw_40xx_d0i3_disable (vdev);if (ret)ivpu_warn (vdev,"Failed to disable D0I3: %d\n" , ret);
Signature · 1 line
2.25.1
Re: [PATCH 5/6] accel/ivpu: Do no initialize parameters on power up
"Do not" in $SUBJECT
Quoted 3 lines · Stanislaw Gruszka
Initialize HW specific parameters only once. We do not have to do this on every
power_up(performed during initialization and on resume). Move corresponding code to ->init_info()
->info_init()
Quoted 1 line
Signed-off-by Stanislaw Gruszka <[email protected]>
PATCH 6/6 accel/ivpu/37xx: Remove support for FPGA and simics
In reply to Stanislaw GruszkaWe do not run 37xx VPU on non-silicon platforms any longer. Remove deprecated code to make it cleaner.
--- drivers/accel/ivpu/ivpu_hw_37xx.c | 57 +++++-------------------------- 1 file changed, 8 insertions(+), 49 deletions(-)
drivers/accel/ivpu/ivpu_hw_37xx.c +8 -49
@@ -68,37 +68,9 @@ (REG_FLD(VPU_37XX_HOST_SS_FW_SOC_IRQ_EN, MSS_MBI)) | \ (REG_FLD(VPU_37XX_HOST_SS_FW_SOC_IRQ_EN, MSS_MBI_CMX))) -static char *ivpu_platform_to_str (u32 platform) -{ -switch (platform) { -case IVPU_PLATFORM_SILICON : -return "IVPU_PLATFORM_SILICON" ; -case IVPU_PLATFORM_SIMICS : -return "IVPU_PLATFORM_SIMICS" ; -case IVPU_PLATFORM_FPGA : -return "IVPU_PLATFORM_FPGA" ; -default : -return "Invalid platform" ; - } -} - -static void ivpu_hw_read_platform (struct ivpu_device *vdev) -{ -u32 gen_ctrl =REGV_RD32 (VPU_37XX_HOST_SS_GEN_CTRL ); -u32 platform =REG_GET_FLD (VPU_37XX_HOST_SS_GEN_CTRL ,PS , gen_ctrl); - -if (platform ==IVPU_PLATFORM_SIMICS || platform ==IVPU_PLATFORM_FPGA ) - vdev->platform = platform; -else - vdev->platform =IVPU_PLATFORM_SILICON ; - -ivpu_dbg (vdev,MISC ,"Platform type: %s (%d)\n" , -ivpu_platform_to_str (vdev->platform), vdev->platform); -} -static void ivpu_hw_wa_init (struct ivpu_device *vdev) { - vdev->wa.punit_disabled =ivpu_is_fpga (vdev); + vdev->wa.punit_disabled = false; vdev->wa.clear_runtime_mem = false; vdev->wa.d3hot_after_power_off = true;
@@ -113,19 +85,11 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)static void ivpu_hw_timeouts_init (struct ivpu_device *vdev) { -if (ivpu_is_simics (vdev) ||ivpu_is_fpga (vdev)) { - vdev->timeout.boot =100000 ; - vdev->timeout.jsm =50000 ; - vdev->timeout.tdr =2000000 ; - vdev->timeout.reschedule_suspend =1000 ; - vdev->timeout.autosuspend =-1 ; - }else { - vdev->timeout.boot =1000 ; - vdev->timeout.jsm =500 ; - vdev->timeout.tdr =2000 ; - vdev->timeout.reschedule_suspend =10 ; - vdev->timeout.autosuspend =10 ; - } + vdev->timeout.boot =1000 ; + vdev->timeout.jsm =500 ; + vdev->timeout.tdr =2000 ; + vdev->timeout.reschedule_suspend =10 ; + vdev->timeout.autosuspend =10 ; }static int ivpu_pll_wait_for_cmd_send (struct ivpu_device *vdev)
@@ -220,8 +184,7 @@ static int ivpu_pll_drive(struct ivpu_device *vdev, bool enable)int ret;if (IVPU_WA (punit_disabled)) { -ivpu_dbg (vdev,PM ,"Skipping PLL request on %s\n" , -ivpu_platform_to_str (vdev->platform)); +ivpu_dbg (vdev,PM ,"Skipping PLL request\n" );return 0 ; }
@@ -484,10 +447,6 @@ static void ivpu_boot_pwr_island_drive(struct ivpu_device *vdev, bool enable)static int ivpu_boot_wait_for_pwr_island_status (struct ivpu_device *vdev,u32 exp_val) { -/* FPGA model (UPF) is not power aware, skipped Power Island polling */ -if (ivpu_is_fpga (vdev)) -return 0 ; -return REGV_POLL_FLD (VPU_37XX_HOST_SS_AON_PWR_ISLAND_STATUS0 ,MSS_CPU , exp_val,PWR_ISLAND_STATUS_TIMEOUT_US ); }
@@ -632,7 +591,7 @@ static int ivpu_hw_37xx_info_init(struct ivpu_device *vdev)ivpu_hw_init_range (&hw->ranges.shave,0x180000000 ,SZ_2G );ivpu_hw_init_range (&hw->ranges.dma,0x200000000 ,SZ_8G ); -ivpu_hw_read_platform (vdev); + vdev->platform =IVPU_PLATFORM_SILICON ;ivpu_hw_wa_init (vdev);ivpu_hw_timeouts_init (vdev);
Signature · 1 line
2.25.1
Re: [PATCH 6/6] accel/ivpu/37xx: Remove support for FPGA and simics
Quoted 4 lines · Stanislaw Gruszka
We do not run 37xx VPU on non-silicon platforms any longer. Remove deprecated code to make it cleaner.
Signed-off-by Stanislaw Gruszka <[email protected]>
Jeffrey Hugo <[email protected]>
Quoted 5 lines · Stanislaw Gruszka
Random changes across the driver.
Karol Wachowski (1):
accel/ivpu: Read clock rate only if device is up
Quoted 8 lines
Krystian Pradzynski (3):
accel/ivpu: Use ratelimited warn and err in IPC/JSM accel/ivpu: Fix verbose version ofREG_POLLmacros accel/ivpu: Print IPC type string instead of numberStanislaw Gruszka (2):
accel/ivpu: Do no initialize parameters on power up accel/ivpu/37xx: Remove support for FPGA and simics
Fixed typos pointed by Jeffrey and applied to drm-misc-next
Thanks
Stanislaw