crypto: qat - when stopping all devices make fure VF are stopped first
authorTadeusz Struk <tadeusz.struk@intel.com>
Tue, 20 Oct 2015 19:50:03 +0000 (12:50 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 17 Nov 2015 13:58:02 +0000 (21:58 +0800)
When stopping all devices make sure VFs are stopped before the
corresponding PF.
VFs will always be after PF so just need to loop back.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_ctl_drv.c

index 03856ad280b9349d650a0d06723a9f9da31e7c75..bd8dfa114c15a021a3bb964c61b49124abe5f152 100644 (file)
@@ -278,7 +278,7 @@ static int adf_ctl_stop_devices(uint32_t id)
        struct list_head *itr, *head = adf_devmgr_get_head();
        int ret = 0;
 
-       list_for_each(itr, head) {
+       list_for_each_prev(itr, head) {
                struct adf_accel_dev *accel_dev =
                                list_entry(itr, struct adf_accel_dev, list);
                if (id == accel_dev->accel_id || id == ADF_CFG_ALL_DEVICES) {