25
25
#include "nvme.h"
26
26
#include "fabrics.h"
27
27
#include <linux/nvme-auth.h>
28
- #include <linux/nvme-keyring.h>
29
28
30
29
#define CREATE_TRACE_POINTS
31
30
#include "trace.h"
@@ -483,6 +482,7 @@ EXPORT_SYMBOL_GPL(nvme_cancel_tagset);
483
482
484
483
void nvme_cancel_admin_tagset (struct nvme_ctrl * ctrl )
485
484
{
485
+ nvme_stop_keep_alive (ctrl );
486
486
if (ctrl -> admin_tagset ) {
487
487
blk_mq_tagset_busy_iter (ctrl -> admin_tagset ,
488
488
nvme_cancel_request , ctrl );
@@ -3200,6 +3200,8 @@ int nvme_init_ctrl_finish(struct nvme_ctrl *ctrl, bool was_suspended)
3200
3200
clear_bit (NVME_CTRL_DIRTY_CAPABILITY , & ctrl -> flags );
3201
3201
ctrl -> identified = true;
3202
3202
3203
+ nvme_start_keep_alive (ctrl );
3204
+
3203
3205
return 0 ;
3204
3206
}
3205
3207
EXPORT_SYMBOL_GPL (nvme_init_ctrl_finish );
@@ -4074,8 +4076,21 @@ static void nvme_get_fw_slot_info(struct nvme_ctrl *ctrl)
4074
4076
return ;
4075
4077
4076
4078
if (nvme_get_log (ctrl , NVME_NSID_ALL , NVME_LOG_FW_SLOT , 0 , NVME_CSI_NVM ,
4077
- log , sizeof (* log ), 0 ))
4079
+ log , sizeof (* log ), 0 )) {
4078
4080
dev_warn (ctrl -> device , "Get FW SLOT INFO log error\n" );
4081
+ goto out_free_log ;
4082
+ }
4083
+
4084
+ if (log -> afi & 0x70 || !(log -> afi & 0x7 )) {
4085
+ dev_info (ctrl -> device ,
4086
+ "Firmware is activated after next Controller Level Reset\n" );
4087
+ goto out_free_log ;
4088
+ }
4089
+
4090
+ memcpy (ctrl -> subsys -> firmware_rev , & log -> frs [(log -> afi & 0x7 ) - 1 ],
4091
+ sizeof (ctrl -> subsys -> firmware_rev ));
4092
+
4093
+ out_free_log :
4079
4094
kfree (log );
4080
4095
}
4081
4096
@@ -4333,7 +4348,6 @@ void nvme_stop_ctrl(struct nvme_ctrl *ctrl)
4333
4348
{
4334
4349
nvme_mpath_stop (ctrl );
4335
4350
nvme_auth_stop (ctrl );
4336
- nvme_stop_keep_alive (ctrl );
4337
4351
nvme_stop_failfast_work (ctrl );
4338
4352
flush_work (& ctrl -> async_event_work );
4339
4353
cancel_work_sync (& ctrl -> fw_act_work );
@@ -4344,8 +4358,6 @@ EXPORT_SYMBOL_GPL(nvme_stop_ctrl);
4344
4358
4345
4359
void nvme_start_ctrl (struct nvme_ctrl * ctrl )
4346
4360
{
4347
- nvme_start_keep_alive (ctrl );
4348
-
4349
4361
nvme_enable_aen (ctrl );
4350
4362
4351
4363
/*
@@ -4724,16 +4736,11 @@ static int __init nvme_core_init(void)
4724
4736
result = PTR_ERR (nvme_ns_chr_class );
4725
4737
goto unregister_generic_ns ;
4726
4738
}
4727
- result = nvme_keyring_init ();
4728
- if (result )
4729
- goto destroy_ns_chr ;
4730
4739
result = nvme_init_auth ();
4731
4740
if (result )
4732
- goto keyring_exit ;
4741
+ goto destroy_ns_chr ;
4733
4742
return 0 ;
4734
4743
4735
- keyring_exit :
4736
- nvme_keyring_exit ();
4737
4744
destroy_ns_chr :
4738
4745
class_destroy (nvme_ns_chr_class );
4739
4746
unregister_generic_ns :
@@ -4757,7 +4764,6 @@ static int __init nvme_core_init(void)
4757
4764
static void __exit nvme_core_exit (void )
4758
4765
{
4759
4766
nvme_exit_auth ();
4760
- nvme_keyring_exit ();
4761
4767
class_destroy (nvme_ns_chr_class );
4762
4768
class_destroy (nvme_subsys_class );
4763
4769
class_destroy (nvme_class );
0 commit comments