aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ntb_netdev.c2
-rw-r--r--drivers/ntb/ntb_hw.c19
-rw-r--r--drivers/ntb/ntb_hw.h2
-rw-r--r--drivers/ntb/ntb_transport.c19
-rw-r--r--include/linux/ntb.h14
5 files changed, 28 insertions, 28 deletions
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 14570b28d528..63aa9d9e34c5 100644
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -377,7 +377,7 @@ static void ntb_netdev_remove(struct pci_dev *pdev)
377{ 377{
378 struct net_device *ndev; 378 struct net_device *ndev;
379 struct ntb_netdev *dev; 379 struct ntb_netdev *dev;
380 bool found = false; 380 bool found = false;
381 381
382 list_for_each_entry(dev, &dev_list, list) { 382 list_for_each_entry(dev, &dev_list, list) {
383 if (dev->pdev == pdev) { 383 if (dev->pdev == pdev) {
diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c
index 0e8ae70fd918..eba1ed58471d 100644
--- a/drivers/ntb/ntb_hw.c
+++ b/drivers/ntb/ntb_hw.c
@@ -91,7 +91,7 @@ static struct dentry *debugfs_dir;
91/* Translate memory window 0,1 to BAR 2,4 */ 91/* Translate memory window 0,1 to BAR 2,4 */
92#define MW_TO_BAR(mw) (mw * NTB_MAX_NUM_MW + 2) 92#define MW_TO_BAR(mw) (mw * NTB_MAX_NUM_MW + 2)
93 93
94static DEFINE_PCI_DEVICE_TABLE(ntb_pci_tbl) = { 94static const struct pci_device_id ntb_pci_tbl[] = {
95 {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_BWD)}, 95 {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_BWD)},
96 {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_JSF)}, 96 {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_JSF)},
97 {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_SNB)}, 97 {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_SNB)},
@@ -120,7 +120,8 @@ MODULE_DEVICE_TABLE(pci, ntb_pci_tbl);
120 * RETURNS: An appropriate -ERRNO error value on error, or zero for success. 120 * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
121 */ 121 */
122int ntb_register_event_callback(struct ntb_device *ndev, 122int ntb_register_event_callback(struct ntb_device *ndev,
123 void (*func)(void *handle, enum ntb_hw_event event)) 123 void (*func)(void *handle,
124 enum ntb_hw_event event))
124{ 125{
125 if (ndev->event_cb) 126 if (ndev->event_cb)
126 return -EINVAL; 127 return -EINVAL;
@@ -715,9 +716,9 @@ static int ntb_xeon_setup(struct ntb_device *ndev)
715 SNB_PBAR4LMT_OFFSET); 716 SNB_PBAR4LMT_OFFSET);
716 /* HW errata on the Limit registers. They can only be 717 /* HW errata on the Limit registers. They can only be
717 * written when the base register is 4GB aligned and 718 * written when the base register is 4GB aligned and
718 * < 32bit. This should already be the case based on the 719 * < 32bit. This should already be the case based on
719 * driver defaults, but write the Limit registers first 720 * the driver defaults, but write the Limit registers
720 * just in case. 721 * first just in case.
721 */ 722 */
722 } else { 723 } else {
723 ndev->limits.max_mw = SNB_MAX_MW; 724 ndev->limits.max_mw = SNB_MAX_MW;
@@ -739,9 +740,9 @@ static int ntb_xeon_setup(struct ntb_device *ndev)
739 writeq(0, ndev->reg_base + SNB_PBAR4LMT_OFFSET); 740 writeq(0, ndev->reg_base + SNB_PBAR4LMT_OFFSET);
740 /* HW errata on the Limit registers. They can only be 741 /* HW errata on the Limit registers. They can only be
741 * written when the base register is 4GB aligned and 742 * written when the base register is 4GB aligned and
742 * < 32bit. This should already be the case based on the 743 * < 32bit. This should already be the case based on
743 * driver defaults, but write the Limit registers first 744 * the driver defaults, but write the Limit registers
744 * just in case. 745 * first just in case.
745 */ 746 */
746 } 747 }
747 748
@@ -803,7 +804,7 @@ static int ntb_xeon_setup(struct ntb_device *ndev)
803 ndev->conn_type = NTB_CONN_RP; 804 ndev->conn_type = NTB_CONN_RP;
804 805
805 if (xeon_errata_workaround) { 806 if (xeon_errata_workaround) {
806 dev_err(&ndev->pdev->dev, 807 dev_err(&ndev->pdev->dev,
807 "NTB-RP disabled due to hardware errata. To disregard this warning and potentially lock-up the system, add the parameter 'xeon_errata_workaround=0'.\n"); 808 "NTB-RP disabled due to hardware errata. To disregard this warning and potentially lock-up the system, add the parameter 'xeon_errata_workaround=0'.\n");
808 return -EINVAL; 809 return -EINVAL;
809 } 810 }
diff --git a/drivers/ntb/ntb_hw.h b/drivers/ntb/ntb_hw.h
index d1960ffb4bbc..923a0fbb0eb8 100644
--- a/drivers/ntb/ntb_hw.h
+++ b/drivers/ntb/ntb_hw.h
@@ -231,7 +231,7 @@ int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx,
231 int db_num)); 231 int db_num));
232void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx); 232void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx);
233int ntb_register_event_callback(struct ntb_device *ndev, 233int ntb_register_event_callback(struct ntb_device *ndev,
234 void (*event_cb_func) (void *handle, 234 void (*event_cb_func)(void *handle,
235 enum ntb_hw_event event)); 235 enum ntb_hw_event event));
236void ntb_unregister_event_callback(struct ntb_device *ndev); 236void ntb_unregister_event_callback(struct ntb_device *ndev);
237int ntb_get_max_spads(struct ntb_device *ndev); 237int ntb_get_max_spads(struct ntb_device *ndev);
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 042fb3dd354f..9dd63b822025 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -106,8 +106,8 @@ struct ntb_transport_qp {
106 struct ntb_rx_info __iomem *rx_info; 106 struct ntb_rx_info __iomem *rx_info;
107 struct ntb_rx_info *remote_rx_info; 107 struct ntb_rx_info *remote_rx_info;
108 108
109 void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, 109 void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data,
110 void *data, int len); 110 void *data, int len);
111 struct list_head tx_free_q; 111 struct list_head tx_free_q;
112 spinlock_t ntb_tx_free_q_lock; 112 spinlock_t ntb_tx_free_q_lock;
113 void __iomem *tx_mw; 113 void __iomem *tx_mw;
@@ -116,8 +116,8 @@ struct ntb_transport_qp {
116 unsigned int tx_max_entry; 116 unsigned int tx_max_entry;
117 unsigned int tx_max_frame; 117 unsigned int tx_max_frame;
118 118
119 void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, 119 void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data,
120 void *data, int len); 120 void *data, int len);
121 struct list_head rx_pend_q; 121 struct list_head rx_pend_q;
122 struct list_head rx_free_q; 122 struct list_head rx_free_q;
123 spinlock_t ntb_rx_pend_q_lock; 123 spinlock_t ntb_rx_pend_q_lock;
@@ -128,7 +128,7 @@ struct ntb_transport_qp {
128 unsigned int rx_max_frame; 128 unsigned int rx_max_frame;
129 dma_cookie_t last_cookie; 129 dma_cookie_t last_cookie;
130 130
131 void (*event_handler) (void *data, int status); 131 void (*event_handler)(void *data, int status);
132 struct delayed_work link_work; 132 struct delayed_work link_work;
133 struct work_struct link_cleanup; 133 struct work_struct link_cleanup;
134 134
@@ -479,7 +479,7 @@ static void ntb_list_add(spinlock_t *lock, struct list_head *entry,
479} 479}
480 480
481static struct ntb_queue_entry *ntb_list_rm(spinlock_t *lock, 481static struct ntb_queue_entry *ntb_list_rm(spinlock_t *lock,
482 struct list_head *list) 482 struct list_head *list)
483{ 483{
484 struct ntb_queue_entry *entry; 484 struct ntb_queue_entry *entry;
485 unsigned long flags; 485 unsigned long flags;
@@ -838,7 +838,7 @@ static void ntb_qp_link_work(struct work_struct *work)
838} 838}
839 839
840static int ntb_transport_init_queue(struct ntb_transport *nt, 840static int ntb_transport_init_queue(struct ntb_transport *nt,
841 unsigned int qp_num) 841 unsigned int qp_num)
842{ 842{
843 struct ntb_transport_qp *qp; 843 struct ntb_transport_qp *qp;
844 unsigned int num_qps_mw, tx_size; 844 unsigned int num_qps_mw, tx_size;
@@ -1054,7 +1054,7 @@ static void ntb_async_rx(struct ntb_queue_entry *entry, void *offset,
1054 if (!chan) 1054 if (!chan)
1055 goto err; 1055 goto err;
1056 1056
1057 if (len < copy_bytes) 1057 if (len < copy_bytes)
1058 goto err_wait; 1058 goto err_wait;
1059 1059
1060 device = chan->device; 1060 device = chan->device;
@@ -1189,8 +1189,7 @@ out:
1189 return 0; 1189 return 0;
1190 1190
1191err: 1191err:
1192 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, 1192 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, &qp->rx_pend_q);
1193 &qp->rx_pend_q);
1194 /* Ensure that the data is fully copied out before clearing the flag */ 1193 /* Ensure that the data is fully copied out before clearing the flag */
1195 wmb(); 1194 wmb();
1196 hdr->flags = 0; 1195 hdr->flags = 0;
diff --git a/include/linux/ntb.h b/include/linux/ntb.h
index cbc792cd745e..9ac1a62fc6f5 100644
--- a/include/linux/ntb.h
+++ b/include/linux/ntb.h
@@ -50,8 +50,8 @@ struct ntb_transport_qp;
50 50
51struct ntb_client { 51struct ntb_client {
52 struct device_driver driver; 52 struct device_driver driver;
53 int (*probe) (struct pci_dev *pdev); 53 int (*probe)(struct pci_dev *pdev);
54 void (*remove) (struct pci_dev *pdev); 54 void (*remove)(struct pci_dev *pdev);
55}; 55};
56 56
57enum { 57enum {
@@ -65,11 +65,11 @@ int ntb_register_client_dev(char *device_name);
65void ntb_unregister_client_dev(char *device_name); 65void ntb_unregister_client_dev(char *device_name);
66 66
67struct ntb_queue_handlers { 67struct ntb_queue_handlers {
68 void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, 68 void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data,
69 void *data, int len); 69 void *data, int len);
70 void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, 70 void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data,
71 void *data, int len); 71 void *data, int len);
72 void (*event_handler) (void *data, int status); 72 void (*event_handler)(void *data, int status);
73}; 73};
74 74
75unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); 75unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp);