File tree Expand file tree Collapse file tree 6 files changed +21
-4
lines changed Expand file tree Collapse file tree 6 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -367,14 +367,19 @@ int ivpu_boot(struct ivpu_device *vdev)
367
367
return 0 ;
368
368
}
369
369
370
- int ivpu_shutdown (struct ivpu_device * vdev )
370
+ void ivpu_prepare_for_reset (struct ivpu_device * vdev )
371
371
{
372
- int ret ;
373
-
374
372
ivpu_hw_irq_disable (vdev );
375
373
disable_irq (vdev -> irq );
376
374
ivpu_ipc_disable (vdev );
377
375
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 );
378
383
379
384
ret = ivpu_hw_power_down (vdev );
380
385
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);
151
151
152
152
int ivpu_boot (struct ivpu_device * vdev );
153
153
int ivpu_shutdown (struct ivpu_device * vdev );
154
+ void ivpu_prepare_for_reset (struct ivpu_device * vdev );
154
155
155
156
static inline u8 ivpu_revision (struct ivpu_device * vdev )
156
157
{
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ struct ivpu_hw_ops {
13
13
int (* power_up )(struct ivpu_device * vdev );
14
14
int (* boot_fw )(struct ivpu_device * vdev );
15
15
int (* power_down )(struct ivpu_device * vdev );
16
+ int (* reset )(struct ivpu_device * vdev );
16
17
bool (* is_idle )(struct ivpu_device * vdev );
17
18
void (* wdt_disable )(struct ivpu_device * vdev );
18
19
void (* diagnose_failure )(struct ivpu_device * vdev );
@@ -91,6 +92,13 @@ static inline int ivpu_hw_power_down(struct ivpu_device *vdev)
91
92
return vdev -> hw -> ops -> power_down (vdev );
92
93
};
93
94
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
+
94
102
static inline void ivpu_hw_wdt_disable (struct ivpu_device * vdev )
95
103
{
96
104
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 = {
1029
1029
.power_up = ivpu_hw_37xx_power_up ,
1030
1030
.is_idle = ivpu_hw_37xx_is_idle ,
1031
1031
.power_down = ivpu_hw_37xx_power_down ,
1032
+ .reset = ivpu_hw_37xx_reset ,
1032
1033
.boot_fw = ivpu_hw_37xx_boot_fw ,
1033
1034
.wdt_disable = ivpu_hw_37xx_wdt_disable ,
1034
1035
.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 = {
1179
1179
.power_up = ivpu_hw_40xx_power_up ,
1180
1180
.is_idle = ivpu_hw_40xx_is_idle ,
1181
1181
.power_down = ivpu_hw_40xx_power_down ,
1182
+ .reset = ivpu_hw_40xx_reset ,
1182
1183
.boot_fw = ivpu_hw_40xx_boot_fw ,
1183
1184
.wdt_disable = ivpu_hw_40xx_wdt_disable ,
1184
1185
.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)
261
261
ivpu_dbg (vdev , PM , "Pre-reset..\n" );
262
262
atomic_inc (& vdev -> pm -> reset_counter );
263
263
atomic_set (& vdev -> pm -> in_reset , 1 );
264
- ivpu_shutdown (vdev );
264
+ ivpu_prepare_for_reset (vdev );
265
+ ivpu_hw_reset (vdev );
265
266
ivpu_pm_prepare_cold_boot (vdev );
266
267
ivpu_jobs_abort_all (vdev );
267
268
ivpu_dbg (vdev , PM , "Pre-reset done.\n" );
You can’t perform that action at this time.
0 commit comments