File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -367,14 +367,19 @@ int ivpu_boot(struct ivpu_device *vdev)
367367 return 0 ;
368368}
369369
370- int ivpu_shutdown (struct ivpu_device * vdev )
370+ void ivpu_prepare_for_reset (struct ivpu_device * vdev )
371371{
372- int ret ;
373-
374372 ivpu_hw_irq_disable (vdev );
375373 disable_irq (vdev -> irq );
376374 ivpu_ipc_disable (vdev );
377375 ivpu_mmu_disable (vdev );
376+ }
377+
378+ int ivpu_shutdown (struct ivpu_device * vdev )
379+ {
380+ int ret ;
381+
382+ ivpu_prepare_for_reset (vdev );
378383
379384 ret = ivpu_hw_power_down (vdev );
380385 if (ret )
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ void ivpu_file_priv_put(struct ivpu_file_priv **link);
151151
152152int ivpu_boot (struct ivpu_device * vdev );
153153int ivpu_shutdown (struct ivpu_device * vdev );
154+ void ivpu_prepare_for_reset (struct ivpu_device * vdev );
154155
155156static inline u8 ivpu_revision (struct ivpu_device * vdev )
156157{
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ struct ivpu_hw_ops {
1313 int (* power_up )(struct ivpu_device * vdev );
1414 int (* boot_fw )(struct ivpu_device * vdev );
1515 int (* power_down )(struct ivpu_device * vdev );
16+ int (* reset )(struct ivpu_device * vdev );
1617 bool (* is_idle )(struct ivpu_device * vdev );
1718 void (* wdt_disable )(struct ivpu_device * vdev );
1819 void (* diagnose_failure )(struct ivpu_device * vdev );
@@ -91,6 +92,13 @@ static inline int ivpu_hw_power_down(struct ivpu_device *vdev)
9192 return vdev -> hw -> ops -> power_down (vdev );
9293};
9394
95+ static inline int ivpu_hw_reset (struct ivpu_device * vdev )
96+ {
97+ ivpu_dbg (vdev , PM , "HW reset\n" );
98+
99+ return vdev -> hw -> ops -> reset (vdev );
100+ };
101+
94102static inline void ivpu_hw_wdt_disable (struct ivpu_device * vdev )
95103{
96104 vdev -> hw -> ops -> wdt_disable (vdev );
Original file line number Diff line number Diff line change @@ -1029,6 +1029,7 @@ const struct ivpu_hw_ops ivpu_hw_37xx_ops = {
10291029 .power_up = ivpu_hw_37xx_power_up ,
10301030 .is_idle = ivpu_hw_37xx_is_idle ,
10311031 .power_down = ivpu_hw_37xx_power_down ,
1032+ .reset = ivpu_hw_37xx_reset ,
10321033 .boot_fw = ivpu_hw_37xx_boot_fw ,
10331034 .wdt_disable = ivpu_hw_37xx_wdt_disable ,
10341035 .diagnose_failure = ivpu_hw_37xx_diagnose_failure ,
Original file line number Diff line number Diff line change @@ -1179,6 +1179,7 @@ const struct ivpu_hw_ops ivpu_hw_40xx_ops = {
11791179 .power_up = ivpu_hw_40xx_power_up ,
11801180 .is_idle = ivpu_hw_40xx_is_idle ,
11811181 .power_down = ivpu_hw_40xx_power_down ,
1182+ .reset = ivpu_hw_40xx_reset ,
11821183 .boot_fw = ivpu_hw_40xx_boot_fw ,
11831184 .wdt_disable = ivpu_hw_40xx_wdt_disable ,
11841185 .diagnose_failure = ivpu_hw_40xx_diagnose_failure ,
Original file line number Diff line number Diff line change @@ -261,7 +261,8 @@ void ivpu_pm_reset_prepare_cb(struct pci_dev *pdev)
261261 ivpu_dbg (vdev , PM , "Pre-reset..\n" );
262262 atomic_inc (& vdev -> pm -> reset_counter );
263263 atomic_set (& vdev -> pm -> in_reset , 1 );
264- ivpu_shutdown (vdev );
264+ ivpu_prepare_for_reset (vdev );
265+ ivpu_hw_reset (vdev );
265266 ivpu_pm_prepare_cold_boot (vdev );
266267 ivpu_jobs_abort_all (vdev );
267268 ivpu_dbg (vdev , PM , "Pre-reset done.\n" );
You can’t perform that action at this time.
0 commit comments