60
60
* @is_supported: Checks if we can support ICM on this controller
61
61
* @get_mode: Read and return the ICM firmware mode (optional)
62
62
* @get_route: Find a route string for given switch
63
+ * @save_devices: Ask ICM to save devices to ACL when suspending (optional)
63
64
* @driver_ready: Send driver ready message to ICM
64
65
* @device_connected: Handle device connected ICM message
65
66
* @device_disconnected: Handle device disconnected ICM message
@@ -76,6 +77,7 @@ struct icm {
76
77
bool (* is_supported )(struct tb * tb );
77
78
int (* get_mode )(struct tb * tb );
78
79
int (* get_route )(struct tb * tb , u8 link , u8 depth , u64 * route );
80
+ void (* save_devices )(struct tb * tb );
79
81
int (* driver_ready )(struct tb * tb ,
80
82
enum tb_security_level * security_level ,
81
83
size_t * nboot_acl );
@@ -258,6 +260,11 @@ static int icm_fr_get_route(struct tb *tb, u8 link, u8 depth, u64 *route)
258
260
return ret ;
259
261
}
260
262
263
+ static void icm_fr_save_devices (struct tb * tb )
264
+ {
265
+ nhi_mailbox_cmd (tb -> nhi , NHI_MAILBOX_SAVE_DEVS , 0 );
266
+ }
267
+
261
268
static int
262
269
icm_fr_driver_ready (struct tb * tb , enum tb_security_level * security_level ,
263
270
size_t * nboot_acl )
@@ -1665,13 +1672,12 @@ static int icm_driver_ready(struct tb *tb)
1665
1672
1666
1673
static int icm_suspend (struct tb * tb )
1667
1674
{
1668
- int ret ;
1675
+ struct icm * icm = tb_priv ( tb ) ;
1669
1676
1670
- ret = nhi_mailbox_cmd (tb -> nhi , NHI_MAILBOX_SAVE_DEVS , 0 );
1671
- if (ret )
1672
- tb_info (tb , "Ignoring mailbox command error (%d) in %s\n" ,
1673
- ret , __func__ );
1677
+ if (icm -> save_devices )
1678
+ icm -> save_devices (tb );
1674
1679
1680
+ nhi_mailbox_cmd (tb -> nhi , NHI_MAILBOX_DRV_UNLOADS , 0 );
1675
1681
return 0 ;
1676
1682
}
1677
1683
@@ -1879,6 +1885,7 @@ struct tb *icm_probe(struct tb_nhi *nhi)
1879
1885
case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI :
1880
1886
icm -> is_supported = icm_fr_is_supported ;
1881
1887
icm -> get_route = icm_fr_get_route ;
1888
+ icm -> save_devices = icm_fr_save_devices ;
1882
1889
icm -> driver_ready = icm_fr_driver_ready ;
1883
1890
icm -> device_connected = icm_fr_device_connected ;
1884
1891
icm -> device_disconnected = icm_fr_device_disconnected ;
@@ -1896,6 +1903,7 @@ struct tb *icm_probe(struct tb_nhi *nhi)
1896
1903
icm -> is_supported = icm_ar_is_supported ;
1897
1904
icm -> get_mode = icm_ar_get_mode ;
1898
1905
icm -> get_route = icm_ar_get_route ;
1906
+ icm -> save_devices = icm_fr_save_devices ;
1899
1907
icm -> driver_ready = icm_ar_driver_ready ;
1900
1908
icm -> device_connected = icm_fr_device_connected ;
1901
1909
icm -> device_disconnected = icm_fr_device_disconnected ;
0 commit comments