@@ -2841,21 +2841,6 @@ static void nvme_reset_work(struct work_struct *work)
2841
2841
nvme_start_admin_queue (& dev -> ctrl );
2842
2842
}
2843
2843
2844
- dma_set_min_align_mask (dev -> dev , NVME_CTRL_PAGE_SIZE - 1 );
2845
-
2846
- /*
2847
- * Limit the max command size to prevent iod->sg allocations going
2848
- * over a single page.
2849
- */
2850
- dev -> ctrl .max_hw_sectors = min_t (u32 ,
2851
- NVME_MAX_KB_SZ << 1 , dma_max_mapping_size (dev -> dev ) >> 9 );
2852
- dev -> ctrl .max_segments = NVME_MAX_SEGS ;
2853
-
2854
- /*
2855
- * Don't limit the IOMMU merged segment size.
2856
- */
2857
- dma_set_max_seg_size (dev -> dev , 0xffffffff );
2858
-
2859
2844
mutex_unlock (& dev -> shutdown_lock );
2860
2845
2861
2846
/*
@@ -2869,12 +2854,6 @@ static void nvme_reset_work(struct work_struct *work)
2869
2854
goto out ;
2870
2855
}
2871
2856
2872
- /*
2873
- * We do not support an SGL for metadata (yet), so we are limited to a
2874
- * single integrity segment for the separate metadata pointer.
2875
- */
2876
- dev -> ctrl .max_integrity_segments = 1 ;
2877
-
2878
2857
result = nvme_init_ctrl_finish (& dev -> ctrl , was_suspend );
2879
2858
if (result )
2880
2859
goto out ;
@@ -3133,6 +3112,23 @@ static struct nvme_dev *nvme_pci_alloc_dev(struct pci_dev *pdev,
3133
3112
quirks );
3134
3113
if (ret )
3135
3114
goto out_put_device ;
3115
+
3116
+ dma_set_min_align_mask (& pdev -> dev , NVME_CTRL_PAGE_SIZE - 1 );
3117
+ dma_set_max_seg_size (& pdev -> dev , 0xffffffff );
3118
+
3119
+ /*
3120
+ * Limit the max command size to prevent iod->sg allocations going
3121
+ * over a single page.
3122
+ */
3123
+ dev -> ctrl .max_hw_sectors = min_t (u32 ,
3124
+ NVME_MAX_KB_SZ << 1 , dma_max_mapping_size (& pdev -> dev ) >> 9 );
3125
+ dev -> ctrl .max_segments = NVME_MAX_SEGS ;
3126
+
3127
+ /*
3128
+ * There is no support for SGLs for metadata (yet), so we are limited to
3129
+ * a single integrity segment for the separate metadata pointer.
3130
+ */
3131
+ dev -> ctrl .max_integrity_segments = 1 ;
3136
3132
return dev ;
3137
3133
3138
3134
out_put_device :
0 commit comments