Skip to content

Commit

Permalink
Merge tag 'ntb-4.20' of git://github.com/jonmason/ntb
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Nov 4, 2018
2 parents 71e5602 + a662315 commit 04578e8
Show file tree
Hide file tree
Showing 6 changed files with 429 additions and 110 deletions.
30 changes: 4 additions & 26 deletions drivers/net/ntb_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ static unsigned int tx_start = 10;
static unsigned int tx_stop = 5;

struct ntb_netdev {
struct list_head list;
struct pci_dev *pdev;
struct net_device *ndev;
struct ntb_transport_qp *qp;
Expand All @@ -81,8 +80,6 @@ struct ntb_netdev {
#define NTB_TX_TIMEOUT_MS 1000
#define NTB_RXQ_SIZE 100

static LIST_HEAD(dev_list);

static void ntb_netdev_event_handler(void *data, int link_is_up)
{
struct net_device *ndev = data;
Expand Down Expand Up @@ -236,7 +233,7 @@ static void ntb_netdev_tx_timer(struct timer_list *t)
struct net_device *ndev = dev->ndev;

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

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

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

static void ntb_netdev_remove(struct device *client_dev)
{
struct ntb_dev *ntb;
struct net_device *ndev;
struct pci_dev *pdev;
struct ntb_netdev *dev;
bool found = false;

ntb = dev_ntb(client_dev->parent);
pdev = ntb->pdev;

list_for_each_entry(dev, &dev_list, list) {
if (dev->pdev == pdev) {
found = true;
break;
}
}
if (!found)
return;

list_del(&dev->list);

ndev = dev->ndev;
struct net_device *ndev = dev_get_drvdata(client_dev);
struct ntb_netdev *dev = netdev_priv(ndev);

unregister_netdev(ndev);
ntb_transport_free_queue(dev->qp);
Expand Down
5 changes: 2 additions & 3 deletions drivers/ntb/hw/idt/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config NTB_IDT
tristate "IDT PCIe-switch Non-Transparent Bridge support"
depends on PCI
select HWMON
help
This driver supports NTB of cappable IDT PCIe-switches.

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

If unsure, say N.

Loading

0 comments on commit 04578e8

Please sign in to comment.