Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ntb-3.17' of git://github.com/jonmason/ntb

Pull ntb driver bugfixes from Jon Mason:
"NTB driver fixes for queue spread and buffer alignment. Also, update
to MAINTAINERS to reflect new e-mail address"

* tag 'ntb-3.17' of git://github.com/jonmason/ntb:
ntb: Add alignment check to meet hardware requirement
MAINTAINERS: update NTB info
NTB: correct the spread of queues over mw's

+17 -3
+2 -1
MAINTAINERS
··· 6424 6424 F: drivers/scsi/nsp32* 6425 6425 6426 6426 NTB DRIVER 6427 - M: Jon Mason <jon.mason@intel.com> 6427 + M: Jon Mason <jdmason@kudzu.us> 6428 + M: Dave Jiang <dave.jiang@intel.com> 6428 6429 S: Supported 6429 6430 W: https://github.com/jonmason/ntb/wiki 6430 6431 T: git git://github.com/jonmason/ntb.git
+15 -2
drivers/ntb/ntb_transport.c
··· 510 510 511 511 WARN_ON(nt->mw[mw_num].virt_addr == NULL); 512 512 513 - if (nt->max_qps % mw_max && mw_num < nt->max_qps % mw_max) 513 + if (nt->max_qps % mw_max && mw_num + 1 < nt->max_qps / mw_max) 514 514 num_qps_mw = nt->max_qps / mw_max + 1; 515 515 else 516 516 num_qps_mw = nt->max_qps / mw_max; ··· 573 573 mw->size = 0; 574 574 dev_err(&pdev->dev, "Unable to allocate MW buffer of size %d\n", 575 575 (int) mw->size); 576 + return -ENOMEM; 577 + } 578 + 579 + /* 580 + * we must ensure that the memory address allocated is BAR size 581 + * aligned in order for the XLAT register to take the value. This 582 + * is a requirement of the hardware. It is recommended to setup CMA 583 + * for BAR sizes equal or greater than 4MB. 584 + */ 585 + if (!IS_ALIGNED(mw->dma_addr, mw->size)) { 586 + dev_err(&pdev->dev, "DMA memory %pad not aligned to BAR size\n", 587 + &mw->dma_addr); 588 + ntb_free_mw(nt, num_mw); 576 589 return -ENOMEM; 577 590 } 578 591 ··· 869 856 qp->client_ready = NTB_LINK_DOWN; 870 857 qp->event_handler = NULL; 871 858 872 - if (nt->max_qps % mw_max && mw_num < nt->max_qps % mw_max) 859 + if (nt->max_qps % mw_max && mw_num + 1 < nt->max_qps / mw_max) 873 860 num_qps_mw = nt->max_qps / mw_max + 1; 874 861 else 875 862 num_qps_mw = nt->max_qps / mw_max;