Skip to content

Commit 1735715

Browse files
committed
Merge tag 'ntb-5.15' of git://github.com/jonmason/ntb
Pull NTB updates from Jon Mason: "Bug fixes and clean-ups for Linux v5.15" * tag 'ntb-5.15' of git://github.com/jonmason/ntb: NTB: switch from 'pci_' to 'dma_' API ntb: ntb_pingpong: remove redundant initialization of variables msg_data and spad_data NTB: perf: Fix an error code in perf_setup_inbuf() NTB: Fix an error code in ntb_msit_probe() ntb: intel: remove invalid email address in header comment
2 parents 21f577b + 38de3af commit 1735715

File tree

7 files changed

+11
-38
lines changed

7 files changed

+11
-38
lines changed

drivers/ntb/hw/amd/ntb_hw_amd.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,22 +1176,14 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev,
11761176

11771177
pci_set_master(pdev);
11781178

1179-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
1179+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
11801180
if (rc) {
1181-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
1181+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
11821182
if (rc)
11831183
goto err_dma_mask;
11841184
dev_warn(&pdev->dev, "Cannot DMA highmem\n");
11851185
}
11861186

1187-
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
1188-
if (rc) {
1189-
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
1190-
if (rc)
1191-
goto err_dma_mask;
1192-
dev_warn(&pdev->dev, "Cannot DMA consistent highmem\n");
1193-
}
1194-
11951187
ndev->self_mmio = pci_iomap(pdev, 0, 0);
11961188
if (!ndev->self_mmio) {
11971189
rc = -EIO;

drivers/ntb/hw/idt/ntb_hw_idt.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,26 +2640,15 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
26402640
int ret;
26412641

26422642
/* Initialize the bit mask of PCI/NTB DMA */
2643-
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
2643+
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
26442644
if (ret != 0) {
2645-
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
2645+
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
26462646
if (ret != 0) {
26472647
dev_err(&pdev->dev, "Failed to set DMA bit mask\n");
26482648
return ret;
26492649
}
26502650
dev_warn(&pdev->dev, "Cannot set DMA highmem bit mask\n");
26512651
}
2652-
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
2653-
if (ret != 0) {
2654-
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
2655-
if (ret != 0) {
2656-
dev_err(&pdev->dev,
2657-
"Failed to set consistent DMA bit mask\n");
2658-
return ret;
2659-
}
2660-
dev_warn(&pdev->dev,
2661-
"Cannot set consistent DMA highmem bit mask\n");
2662-
}
26632652

26642653
/*
26652654
* Enable the device advanced error reporting. It's not critical to

drivers/ntb/hw/intel/ntb_hw_gen1.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,22 +1771,14 @@ static int intel_ntb_init_pci(struct intel_ntb_dev *ndev, struct pci_dev *pdev)
17711771

17721772
pci_set_master(pdev);
17731773

1774-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
1774+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
17751775
if (rc) {
1776-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
1776+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
17771777
if (rc)
17781778
goto err_dma_mask;
17791779
dev_warn(&pdev->dev, "Cannot DMA highmem\n");
17801780
}
17811781

1782-
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
1783-
if (rc) {
1784-
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
1785-
if (rc)
1786-
goto err_dma_mask;
1787-
dev_warn(&pdev->dev, "Cannot DMA consistent highmem\n");
1788-
}
1789-
17901782
ndev->self_mmio = pci_iomap(pdev, 0, 0);
17911783
if (!ndev->self_mmio) {
17921784
rc = -EIO;

drivers/ntb/hw/intel/ntb_hw_intel.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4444
*
4545
* Intel PCIe NTB Linux driver
46-
*
47-
* Contact Information:
48-
* Jon Mason <[email protected]>
4946
*/
5047

5148
#ifndef NTB_HW_INTEL_H

drivers/ntb/test/ntb_msi_test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,10 @@ static int ntb_msit_probe(struct ntb_client *client, struct ntb_dev *ntb)
369369
if (ret)
370370
goto remove_dbgfs;
371371

372-
if (!nm->isr_ctx)
372+
if (!nm->isr_ctx) {
373+
ret = -ENOMEM;
373374
goto remove_dbgfs;
375+
}
374376

375377
ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO);
376378

drivers/ntb/test/ntb_perf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ static int perf_setup_inbuf(struct perf_peer *peer)
598598
return -ENOMEM;
599599
}
600600
if (!IS_ALIGNED(peer->inbuf_xlat, xlat_align)) {
601+
ret = -EINVAL;
601602
dev_err(&perf->ntb->dev, "Unaligned inbuf allocated\n");
602603
goto err_free_inbuf;
603604
}

drivers/ntb/test/ntb_pingpong.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static void pp_ping(struct pp_ctx *pp)
187187

188188
static void pp_pong(struct pp_ctx *pp)
189189
{
190-
u32 msg_data = -1, spad_data = -1;
190+
u32 msg_data, spad_data;
191191
int pidx = 0;
192192

193193
/* Read pong data */

0 commit comments

Comments
 (0)