Messages in this thread Patch in this message | | | From | Christophe JAILLET <> | Subject | [PATCH 2/2] scsi: mptsas: switch from 'pci_' to 'dma_' API in 'mptsas_exp_repmanufacture_info()' | Date | Sun, 13 Jun 2021 12:26:53 +0200 |
| |
The wrappers in include/linux/pci-dma-compat.h should go away.
The only caller of 'mptsas_exp_repmanufacture_info()' is 'mptsas_probe_one_phy()'. This function already calls 'sas_end_device_alloc()' or 'sas_expander_alloc()'. They both already use GFP_KERNEL.
As no spin_lock is held at this point, it is safe to also use GFP_KERNEL here.
While at it, also fix an ugly alignment issue in this function.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/message/fusion/mptsas.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 1c898322316a..c6af453c7874 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -2896,7 +2896,8 @@ mptsas_exp_repmanufacture_info(MPT_ADAPTER *ioc, sz = sizeof(struct rep_manu_request) + sizeof(struct rep_manu_reply); - data_out = pci_alloc_consistent(ioc->pcidev, sz, &data_out_dma); + data_out = dma_alloc_coherent(&ioc->pcidev->dev, sz, &data_out_dma, + GFP_KERNEL); if (!data_out) { printk(KERN_ERR "Memory allocation failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -2935,7 +2936,7 @@ mptsas_exp_repmanufacture_info(MPT_ADAPTER *ioc, flagsLength = flagsLength << MPI_SGE_FLAGS_SHIFT; flagsLength |= sizeof(struct rep_manu_reply); ioc->add_sge(psge, flagsLength, data_out_dma + - sizeof(struct rep_manu_request)); + sizeof(struct rep_manu_request)); INITIALIZE_MGMT_STATUS(ioc->sas_mgmt.status) mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf); @@ -2987,7 +2988,8 @@ mptsas_exp_repmanufacture_info(MPT_ADAPTER *ioc, } out_free: if (data_out_dma) - pci_free_consistent(ioc->pcidev, sz, data_out, data_out_dma); + dma_free_coherent(&ioc->pcidev->dev, sz, data_out, + data_out_dma); put_mf: if (mf) mpt_free_msg_frame(ioc, mf); -- 2.30.2
| |