@@ -300,8 +300,8 @@ mpt_is_discovery_complete(MPT_ADAPTER *ioc)
300
300
if (!hdr .ExtPageLength )
301
301
goto out ;
302
302
303
- buffer = pci_alloc_consistent ( ioc -> pcidev , hdr .ExtPageLength * 4 ,
304
- & dma_handle );
303
+ buffer = dma_alloc_coherent ( & ioc -> pcidev -> dev , hdr .ExtPageLength * 4 ,
304
+ & dma_handle , GFP_KERNEL );
305
305
if (!buffer )
306
306
goto out ;
307
307
@@ -4966,7 +4966,8 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
4966
4966
4967
4967
if (hdr .PageLength > 0 ) {
4968
4968
data_sz = hdr .PageLength * 4 ;
4969
- ppage0_alloc = pci_alloc_consistent (ioc -> pcidev , data_sz , & page0_dma );
4969
+ ppage0_alloc = dma_alloc_coherent (& ioc -> pcidev -> dev , data_sz ,
4970
+ & page0_dma , GFP_KERNEL );
4970
4971
rc = - ENOMEM ;
4971
4972
if (ppage0_alloc ) {
4972
4973
memset ((u8 * )ppage0_alloc , 0 , data_sz );
@@ -5013,7 +5014,8 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
5013
5014
5014
5015
data_sz = hdr .PageLength * 4 ;
5015
5016
rc = - ENOMEM ;
5016
- ppage1_alloc = pci_alloc_consistent (ioc -> pcidev , data_sz , & page1_dma );
5017
+ ppage1_alloc = dma_alloc_coherent (& ioc -> pcidev -> dev , data_sz ,
5018
+ & page1_dma , GFP_KERNEL );
5017
5019
if (ppage1_alloc ) {
5018
5020
memset ((u8 * )ppage1_alloc , 0 , data_sz );
5019
5021
cfg .physAddr = page1_dma ;
@@ -5315,7 +5317,8 @@ GetIoUnitPage2(MPT_ADAPTER *ioc)
5315
5317
/* Read the config page */
5316
5318
data_sz = hdr .PageLength * 4 ;
5317
5319
rc = - ENOMEM ;
5318
- ppage_alloc = pci_alloc_consistent (ioc -> pcidev , data_sz , & page_dma );
5320
+ ppage_alloc = dma_alloc_coherent (& ioc -> pcidev -> dev , data_sz ,
5321
+ & page_dma , GFP_KERNEL );
5319
5322
if (ppage_alloc ) {
5320
5323
memset ((u8 * )ppage_alloc , 0 , data_sz );
5321
5324
cfg .physAddr = page_dma ;
@@ -5401,7 +5404,9 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
5401
5404
return - EFAULT ;
5402
5405
5403
5406
if (header .PageLength > 0 ) {
5404
- pbuf = pci_alloc_consistent (ioc -> pcidev , header .PageLength * 4 , & buf_dma );
5407
+ pbuf = dma_alloc_coherent (& ioc -> pcidev -> dev ,
5408
+ header .PageLength * 4 , & buf_dma ,
5409
+ GFP_KERNEL );
5405
5410
if (pbuf ) {
5406
5411
cfg .action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT ;
5407
5412
cfg .physAddr = buf_dma ;
@@ -5481,7 +5486,9 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
5481
5486
if (header .PageLength > 0 ) {
5482
5487
/* Allocate memory and read SCSI Port Page 2
5483
5488
*/
5484
- pbuf = pci_alloc_consistent (ioc -> pcidev , header .PageLength * 4 , & buf_dma );
5489
+ pbuf = dma_alloc_coherent (& ioc -> pcidev -> dev ,
5490
+ header .PageLength * 4 , & buf_dma ,
5491
+ GFP_KERNEL );
5485
5492
if (pbuf ) {
5486
5493
cfg .action = MPI_CONFIG_ACTION_PAGE_READ_NVRAM ;
5487
5494
cfg .physAddr = buf_dma ;
@@ -5664,8 +5671,8 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
5664
5671
if (!hdr .PageLength )
5665
5672
goto out ;
5666
5673
5667
- buffer = pci_alloc_consistent ( ioc -> pcidev , hdr .PageLength * 4 ,
5668
- & dma_handle );
5674
+ buffer = dma_alloc_coherent ( & ioc -> pcidev -> dev , hdr .PageLength * 4 ,
5675
+ & dma_handle , GFP_KERNEL );
5669
5676
5670
5677
if (!buffer )
5671
5678
goto out ;
@@ -5757,8 +5764,8 @@ mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num,
5757
5764
goto out ;
5758
5765
}
5759
5766
5760
- buffer = pci_alloc_consistent ( ioc -> pcidev , hdr .PageLength * 4 ,
5761
- & dma_handle );
5767
+ buffer = dma_alloc_coherent ( & ioc -> pcidev -> dev , hdr .PageLength * 4 ,
5768
+ & dma_handle , GFP_KERNEL );
5762
5769
5763
5770
if (!buffer ) {
5764
5771
rc = - ENOMEM ;
@@ -5824,8 +5831,8 @@ mpt_raid_phys_disk_get_num_paths(MPT_ADAPTER *ioc, u8 phys_disk_num)
5824
5831
goto out ;
5825
5832
}
5826
5833
5827
- buffer = pci_alloc_consistent ( ioc -> pcidev , hdr .PageLength * 4 ,
5828
- & dma_handle );
5834
+ buffer = dma_alloc_coherent ( & ioc -> pcidev -> dev , hdr .PageLength * 4 ,
5835
+ & dma_handle , GFP_KERNEL );
5829
5836
5830
5837
if (!buffer ) {
5831
5838
rc = 0 ;
@@ -5896,8 +5903,8 @@ mpt_raid_phys_disk_pg1(MPT_ADAPTER *ioc, u8 phys_disk_num,
5896
5903
goto out ;
5897
5904
}
5898
5905
5899
- buffer = pci_alloc_consistent ( ioc -> pcidev , hdr .PageLength * 4 ,
5900
- & dma_handle );
5906
+ buffer = dma_alloc_coherent ( & ioc -> pcidev -> dev , hdr .PageLength * 4 ,
5907
+ & dma_handle , GFP_KERNEL );
5901
5908
5902
5909
if (!buffer ) {
5903
5910
rc = - ENOMEM ;
@@ -5991,7 +5998,8 @@ mpt_findImVolumes(MPT_ADAPTER *ioc)
5991
5998
return - EFAULT ;
5992
5999
5993
6000
iocpage2sz = header .PageLength * 4 ;
5994
- pIoc2 = pci_alloc_consistent (ioc -> pcidev , iocpage2sz , & ioc2_dma );
6001
+ pIoc2 = dma_alloc_coherent (& ioc -> pcidev -> dev , iocpage2sz , & ioc2_dma ,
6002
+ GFP_KERNEL );
5995
6003
if (!pIoc2 )
5996
6004
return - ENOMEM ;
5997
6005
@@ -6058,7 +6066,8 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc)
6058
6066
/* Read Header good, alloc memory
6059
6067
*/
6060
6068
iocpage3sz = header .PageLength * 4 ;
6061
- pIoc3 = pci_alloc_consistent (ioc -> pcidev , iocpage3sz , & ioc3_dma );
6069
+ pIoc3 = dma_alloc_coherent (& ioc -> pcidev -> dev , iocpage3sz , & ioc3_dma ,
6070
+ GFP_KERNEL );
6062
6071
if (!pIoc3 )
6063
6072
return 0 ;
6064
6073
@@ -6109,7 +6118,8 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc)
6109
6118
6110
6119
if ( (pIoc4 = ioc -> spi_data .pIocPg4 ) == NULL ) {
6111
6120
iocpage4sz = (header .PageLength + 4 ) * 4 ; /* Allow 4 additional SEP's */
6112
- pIoc4 = pci_alloc_consistent (ioc -> pcidev , iocpage4sz , & ioc4_dma );
6121
+ pIoc4 = dma_alloc_coherent (& ioc -> pcidev -> dev , iocpage4sz ,
6122
+ & ioc4_dma , GFP_KERNEL );
6113
6123
if (!pIoc4 )
6114
6124
return ;
6115
6125
ioc -> alloc_total += iocpage4sz ;
@@ -6165,7 +6175,8 @@ mpt_read_ioc_pg_1(MPT_ADAPTER *ioc)
6165
6175
/* Read Header good, alloc memory
6166
6176
*/
6167
6177
iocpage1sz = header .PageLength * 4 ;
6168
- pIoc1 = pci_alloc_consistent (ioc -> pcidev , iocpage1sz , & ioc1_dma );
6178
+ pIoc1 = dma_alloc_coherent (& ioc -> pcidev -> dev , iocpage1sz , & ioc1_dma ,
6179
+ GFP_KERNEL );
6169
6180
if (!pIoc1 )
6170
6181
return ;
6171
6182
@@ -6245,7 +6256,8 @@ mpt_get_manufacturing_pg_0(MPT_ADAPTER *ioc)
6245
6256
goto out ;
6246
6257
6247
6258
cfg .action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT ;
6248
- pbuf = pci_alloc_consistent (ioc -> pcidev , hdr .PageLength * 4 , & buf_dma );
6259
+ pbuf = dma_alloc_coherent (& ioc -> pcidev -> dev , hdr .PageLength * 4 ,
6260
+ & buf_dma , GFP_KERNEL );
6249
6261
if (!pbuf )
6250
6262
goto out ;
6251
6263
0 commit comments