Skip to content

Commit 04578e8

Browse files
committed
Merge tag 'ntb-4.20' of git://github.com/jonmason/ntb
Pull NTB updates from Jon Mason: "Fairly minor changes and bug fixes: NTB IDT thermal changes and hook into hwmon, ntb_netdev clean-up of private struct, and a few bug fixes" * tag 'ntb-4.20' of git://github.com/jonmason/ntb: ntb: idt: Alter the driver info comments ntb: idt: Discard temperature sensor IRQ handler ntb: idt: Add basic hwmon sysfs interface ntb: idt: Alter temperature read method ntb_netdev: Simplify remove with client device drvdata NTB: transport: Try harder to alloc an aligned MW buffer ntb: ntb_transport: Mark expected switch fall-throughs ntb: idt: Set PCIe bus address to BARLIMITx NTB: ntb_hw_idt: replace IS_ERR_OR_NULL with regular NULL checks ntb: intel: fix return value for ndev_vec_mask() ntb_netdev: fix sleep time mismatch
2 parents 71e5602 + a662315 commit 04578e8

File tree

6 files changed

+429
-110
lines changed

6 files changed

+429
-110
lines changed

drivers/net/ntb_netdev.c

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ static unsigned int tx_start = 10;
7171
static unsigned int tx_stop = 5;
7272

7373
struct ntb_netdev {
74-
struct list_head list;
7574
struct pci_dev *pdev;
7675
struct net_device *ndev;
7776
struct ntb_transport_qp *qp;
@@ -81,8 +80,6 @@ struct ntb_netdev {
8180
#define NTB_TX_TIMEOUT_MS 1000
8281
#define NTB_RXQ_SIZE 100
8382

84-
static LIST_HEAD(dev_list);
85-
8683
static void ntb_netdev_event_handler(void *data, int link_is_up)
8784
{
8885
struct net_device *ndev = data;
@@ -236,7 +233,7 @@ static void ntb_netdev_tx_timer(struct timer_list *t)
236233
struct net_device *ndev = dev->ndev;
237234

238235
if (ntb_transport_tx_free_entry(dev->qp) < tx_stop) {
239-
mod_timer(&dev->tx_timer, jiffies + msecs_to_jiffies(tx_time));
236+
mod_timer(&dev->tx_timer, jiffies + usecs_to_jiffies(tx_time));
240237
} else {
241238
/* Make sure anybody stopping the queue after this sees the new
242239
* value of ntb_transport_tx_free_entry()
@@ -452,7 +449,7 @@ static int ntb_netdev_probe(struct device *client_dev)
452449
if (rc)
453450
goto err1;
454451

455-
list_add(&dev->list, &dev_list);
452+
dev_set_drvdata(client_dev, ndev);
456453
dev_info(&pdev->dev, "%s created\n", ndev->name);
457454
return 0;
458455

@@ -465,27 +462,8 @@ static int ntb_netdev_probe(struct device *client_dev)
465462

466463
static void ntb_netdev_remove(struct device *client_dev)
467464
{
468-
struct ntb_dev *ntb;
469-
struct net_device *ndev;
470-
struct pci_dev *pdev;
471-
struct ntb_netdev *dev;
472-
bool found = false;
473-
474-
ntb = dev_ntb(client_dev->parent);
475-
pdev = ntb->pdev;
476-
477-
list_for_each_entry(dev, &dev_list, list) {
478-
if (dev->pdev == pdev) {
479-
found = true;
480-
break;
481-
}
482-
}
483-
if (!found)
484-
return;
485-
486-
list_del(&dev->list);
487-
488-
ndev = dev->ndev;
465+
struct net_device *ndev = dev_get_drvdata(client_dev);
466+
struct ntb_netdev *dev = netdev_priv(ndev);
489467

490468
unregister_netdev(ndev);
491469
ntb_transport_free_queue(dev->qp);

drivers/ntb/hw/idt/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config NTB_IDT
22
tristate "IDT PCIe-switch Non-Transparent Bridge support"
33
depends on PCI
4+
select HWMON
45
help
56
This driver supports NTB of cappable IDT PCIe-switches.
67

@@ -23,9 +24,7 @@ config NTB_IDT
2324
BAR settings of peer NT-functions, the BAR setups can't be done over
2425
kernel PCI fixups. That's why the alternative pre-initialization
2526
techniques like BIOS using SMBus interface or EEPROM should be
26-
utilized. Additionally if one needs to have temperature sensor
27-
information printed to system log, the corresponding registers must
28-
be initialized within BIOS/EEPROM as well.
27+
utilized.
2928

3029
If unsure, say N.
3130

0 commit comments

Comments
 (0)