History

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

Linus Torvalds committed 12 years ago

Commit 02c1be32 parents 8ac19f0 3cc5ba12 files · +17 −3Browse files

Unified · Split

2 files
  1. MAINTAINERS +2 −1
  2. drivers/ntb/ntb_transport.c +15 −2
MAINTAINERS+2−1
@@ -6424,7 +6424,8 @@ F: Documentation/scsi/NinjaSCSI.txt · 6423 unmodified lines
64246424 F: drivers/scsi/nsp32*
64256425
64266426 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>
64286429 S: Supported
64296430 W: https://github.com/jonmason/ntb/wiki
64306431 T: git git://github.com/jonmason/ntb.git
drivers/ntb/ntb_transport.c+15−2
@@ -510,7 +510,7 @@ static void ntb_transport_setup_qp_mw(struct ntb_transport *nt, · 509 unmodified lines
510510
511511 WARN_ON(nt->mw[mw_num].virt_addr == NULL);
512512
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)
514514 num_qps_mw = nt->max_qps / mw_max + 1;
515515 else
516516 num_qps_mw = nt->max_qps / mw_max;
@@ -576,6 +576,19 @@ static int ntb_set_mw(struct ntb_transport *nt, int num_mw, unsigned int size) · 59 unmodified lines
576576 return -ENOMEM;
577577 }
578578
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);
589+ return -ENOMEM;
590+ }
591+
579592 /* Notify HW the memory location of the receive buffer */
580593 ntb_set_mw_addr(nt->ndev, num_mw, mw->dma_addr);
581594
@@ -856,7 +869,7 @@ static int ntb_transport_init_queue(struct ntb_transport *nt, · 274 unmodified lines
856869 qp->client_ready = NTB_LINK_DOWN;
857870 qp->event_handler = NULL;
858871
859− if (nt->max_qps % mw_max && mw_num < nt->max_qps % mw_max)
872+ if (nt->max_qps % mw_max && mw_num + 1 < nt->max_qps / mw_max)
860873 num_qps_mw = nt->max_qps / mw_max + 1;
861874 else
862875 num_qps_mw = nt->max_qps / mw_max;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t