diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-19 23:29:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-19 23:29:15 -0500 |
commit | 9eb127cc04c4005c8c0708ce92146d91da862b42 (patch) | |
tree | bebab2c136110edf32d6cf32f898871df9fbb0e6 /drivers/net/ethernet | |
parent | e32795503de02da4e7e74a5e039cc268f6a0ecfb (diff) | |
parent | 152a2a8b5e1d4cbe91a7c66f1028db15164a3766 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
1) Really fix tuntap SKB use after free bug, from Eric Dumazet.
2) Adjust SKB data pointer to point past the transport header before
calling icmpv6_notify() so that the headers are in the state which
that function expects. From Duan Jiong.
3) Fix ambiguities in the new tuntap multi-queue APIs. From Jason
Wang.
4) mISDN needs to use del_timer_sync(), from Konstantin Khlebnikov.
5) Don't destroy mutex after freeing up device private in mac802154,
fix also from Konstantin Khlebnikov.
6) Fix INET request socket leak in TCP and DCCP, from Christoph Paasch.
7) SCTP HMAC kconfig rework, from Neil Horman.
8) Fix SCTP jprobes function signature, otherwise things explode, from
Daniel Borkmann.
9) Fix typo in ipv6-offload Makefile variable reference, from Simon
Arlott.
10) Don't fail USBNET open just because remote wakeup isn't supported,
from Oliver Neukum.
11) be2net driver bug fixes from Sathya Perla.
12) SOLOS PCI ATM driver bug fixes from Nathan Williams and David
Woodhouse.
13) Fix MTU changing regression in 8139cp driver, from John Greene.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (45 commits)
solos-pci: ensure all TX packets are aligned to 4 bytes
solos-pci: add firmware upgrade support for new models
solos-pci: remove superfluous debug output
solos-pci: add GPIO support for newer versions on Geos board
8139cp: Prevent dev_close/cp_interrupt race on MTU change
net: qmi_wwan: add ZTE MF880
drivers/net: Use of_match_ptr() macro in smsc911x.c
drivers/net: Use of_match_ptr() macro in smc91x.c
ipv6: addrconf.c: remove unnecessary "if"
bridge: Correctly encode addresses when dumping mdb entries
bridge: Do not unregister all PF_BRIDGE rtnl operations
use generic usbnet_manage_power()
usbnet: generic manage_power()
usbnet: handle PM failure gracefully
ksz884x: fix receive polling race condition
qlcnic: update driver version
qlcnic: fix unused variable warnings
net: fec: forbid FEC_PTP on SoCs that do not support
be2net: fix wrong frag_idx reported by RX CQ
be2net: fix be_close() to ensure all events are ack'ed
...
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 59 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/Kconfig | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/micrel/ksz884x.c | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/realtek/8139cp.c | 18 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smc91x.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac.h | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 | ||||
-rw-r--r-- | drivers/net/ethernet/ti/cpts.c | 2 |
16 files changed, 98 insertions, 61 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index abf26c7c1d19..3bc1912afba9 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -616,7 +616,7 @@ static inline bool be_error(struct be_adapter *adapter) | |||
616 | return adapter->eeh_error || adapter->hw_error || adapter->fw_timeout; | 616 | return adapter->eeh_error || adapter->hw_error || adapter->fw_timeout; |
617 | } | 617 | } |
618 | 618 | ||
619 | static inline bool be_crit_error(struct be_adapter *adapter) | 619 | static inline bool be_hw_error(struct be_adapter *adapter) |
620 | { | 620 | { |
621 | return adapter->eeh_error || adapter->hw_error; | 621 | return adapter->eeh_error || adapter->hw_error; |
622 | } | 622 | } |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index f2875aa47661..8a250c38fb82 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -298,7 +298,12 @@ void be_async_mcc_enable(struct be_adapter *adapter) | |||
298 | 298 | ||
299 | void be_async_mcc_disable(struct be_adapter *adapter) | 299 | void be_async_mcc_disable(struct be_adapter *adapter) |
300 | { | 300 | { |
301 | spin_lock_bh(&adapter->mcc_cq_lock); | ||
302 | |||
301 | adapter->mcc_obj.rearm_cq = false; | 303 | adapter->mcc_obj.rearm_cq = false; |
304 | be_cq_notify(adapter, adapter->mcc_obj.cq.id, false, 0); | ||
305 | |||
306 | spin_unlock_bh(&adapter->mcc_cq_lock); | ||
302 | } | 307 | } |
303 | 308 | ||
304 | int be_process_mcc(struct be_adapter *adapter) | 309 | int be_process_mcc(struct be_adapter *adapter) |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index f95612b907ae..9dca22be8125 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1689,15 +1689,41 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo) | |||
1689 | struct be_queue_info *rxq = &rxo->q; | 1689 | struct be_queue_info *rxq = &rxo->q; |
1690 | struct be_queue_info *rx_cq = &rxo->cq; | 1690 | struct be_queue_info *rx_cq = &rxo->cq; |
1691 | struct be_rx_compl_info *rxcp; | 1691 | struct be_rx_compl_info *rxcp; |
1692 | struct be_adapter *adapter = rxo->adapter; | ||
1693 | int flush_wait = 0; | ||
1692 | u16 tail; | 1694 | u16 tail; |
1693 | 1695 | ||
1694 | /* First cleanup pending rx completions */ | 1696 | /* Consume pending rx completions. |
1695 | while ((rxcp = be_rx_compl_get(rxo)) != NULL) { | 1697 | * Wait for the flush completion (identified by zero num_rcvd) |
1696 | be_rx_compl_discard(rxo, rxcp); | 1698 | * to arrive. Notify CQ even when there are no more CQ entries |
1697 | be_cq_notify(rxo->adapter, rx_cq->id, false, 1); | 1699 | * for HW to flush partially coalesced CQ entries. |
1700 | * In Lancer, there is no need to wait for flush compl. | ||
1701 | */ | ||
1702 | for (;;) { | ||
1703 | rxcp = be_rx_compl_get(rxo); | ||
1704 | if (rxcp == NULL) { | ||
1705 | if (lancer_chip(adapter)) | ||
1706 | break; | ||
1707 | |||
1708 | if (flush_wait++ > 10 || be_hw_error(adapter)) { | ||
1709 | dev_warn(&adapter->pdev->dev, | ||
1710 | "did not receive flush compl\n"); | ||
1711 | break; | ||
1712 | } | ||
1713 | be_cq_notify(adapter, rx_cq->id, true, 0); | ||
1714 | mdelay(1); | ||
1715 | } else { | ||
1716 | be_rx_compl_discard(rxo, rxcp); | ||
1717 | be_cq_notify(adapter, rx_cq->id, true, 1); | ||
1718 | if (rxcp->num_rcvd == 0) | ||
1719 | break; | ||
1720 | } | ||
1698 | } | 1721 | } |
1699 | 1722 | ||
1700 | /* Then free posted rx buffer that were not used */ | 1723 | /* After cleanup, leave the CQ in unarmed state */ |
1724 | be_cq_notify(adapter, rx_cq->id, false, 0); | ||
1725 | |||
1726 | /* Then free posted rx buffers that were not used */ | ||
1701 | tail = (rxq->head + rxq->len - atomic_read(&rxq->used)) % rxq->len; | 1727 | tail = (rxq->head + rxq->len - atomic_read(&rxq->used)) % rxq->len; |
1702 | for (; atomic_read(&rxq->used) > 0; index_inc(&tail, rxq->len)) { | 1728 | for (; atomic_read(&rxq->used) > 0; index_inc(&tail, rxq->len)) { |
1703 | page_info = get_rx_page_info(rxo, tail); | 1729 | page_info = get_rx_page_info(rxo, tail); |
@@ -2157,7 +2183,7 @@ void be_detect_error(struct be_adapter *adapter) | |||
2157 | u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0; | 2183 | u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0; |
2158 | u32 i; | 2184 | u32 i; |
2159 | 2185 | ||
2160 | if (be_crit_error(adapter)) | 2186 | if (be_hw_error(adapter)) |
2161 | return; | 2187 | return; |
2162 | 2188 | ||
2163 | if (lancer_chip(adapter)) { | 2189 | if (lancer_chip(adapter)) { |
@@ -2398,13 +2424,22 @@ static int be_close(struct net_device *netdev) | |||
2398 | 2424 | ||
2399 | be_roce_dev_close(adapter); | 2425 | be_roce_dev_close(adapter); |
2400 | 2426 | ||
2401 | be_async_mcc_disable(adapter); | ||
2402 | |||
2403 | if (!lancer_chip(adapter)) | 2427 | if (!lancer_chip(adapter)) |
2404 | be_intr_set(adapter, false); | 2428 | be_intr_set(adapter, false); |
2405 | 2429 | ||
2406 | for_all_evt_queues(adapter, eqo, i) { | 2430 | for_all_evt_queues(adapter, eqo, i) |
2407 | napi_disable(&eqo->napi); | 2431 | napi_disable(&eqo->napi); |
2432 | |||
2433 | be_async_mcc_disable(adapter); | ||
2434 | |||
2435 | /* Wait for all pending tx completions to arrive so that | ||
2436 | * all tx skbs are freed. | ||
2437 | */ | ||
2438 | be_tx_compl_clean(adapter); | ||
2439 | |||
2440 | be_rx_qs_destroy(adapter); | ||
2441 | |||
2442 | for_all_evt_queues(adapter, eqo, i) { | ||
2408 | if (msix_enabled(adapter)) | 2443 | if (msix_enabled(adapter)) |
2409 | synchronize_irq(be_msix_vec_get(adapter, eqo)); | 2444 | synchronize_irq(be_msix_vec_get(adapter, eqo)); |
2410 | else | 2445 | else |
@@ -2414,12 +2449,6 @@ static int be_close(struct net_device *netdev) | |||
2414 | 2449 | ||
2415 | be_irq_unregister(adapter); | 2450 | be_irq_unregister(adapter); |
2416 | 2451 | ||
2417 | /* Wait for all pending tx completions to arrive so that | ||
2418 | * all tx skbs are freed. | ||
2419 | */ | ||
2420 | be_tx_compl_clean(adapter); | ||
2421 | |||
2422 | be_rx_qs_destroy(adapter); | ||
2423 | return 0; | 2452 | return 0; |
2424 | } | 2453 | } |
2425 | 2454 | ||
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig index 5ba6e1cbd346..ec490d741fc0 100644 --- a/drivers/net/ethernet/freescale/Kconfig +++ b/drivers/net/ethernet/freescale/Kconfig | |||
@@ -94,9 +94,8 @@ config GIANFAR | |||
94 | 94 | ||
95 | config FEC_PTP | 95 | config FEC_PTP |
96 | bool "PTP Hardware Clock (PHC)" | 96 | bool "PTP Hardware Clock (PHC)" |
97 | depends on FEC && ARCH_MXC | 97 | depends on FEC && ARCH_MXC && !SOC_IMX25 && !SOC_IMX27 && !SOC_IMX35 && !SOC_IMX5 |
98 | select PTP_1588_CLOCK | 98 | select PTP_1588_CLOCK |
99 | default y if SOC_IMX6Q | ||
100 | --help--- | 99 | --help--- |
101 | Say Y here if you want to use PTP Hardware Clock (PHC) in the | 100 | Say Y here if you want to use PTP Hardware Clock (PHC) in the |
102 | driver. Only the basic clock operations have been implemented. | 101 | driver. Only the basic clock operations have been implemented. |
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index 83f0ea929d3d..8ebc352bcbe6 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c | |||
@@ -4761,7 +4761,7 @@ static void transmit_cleanup(struct dev_info *hw_priv, int normal) | |||
4761 | struct ksz_dma_buf *dma_buf; | 4761 | struct ksz_dma_buf *dma_buf; |
4762 | struct net_device *dev = NULL; | 4762 | struct net_device *dev = NULL; |
4763 | 4763 | ||
4764 | spin_lock(&hw_priv->hwlock); | 4764 | spin_lock_irq(&hw_priv->hwlock); |
4765 | last = info->last; | 4765 | last = info->last; |
4766 | 4766 | ||
4767 | while (info->avail < info->alloc) { | 4767 | while (info->avail < info->alloc) { |
@@ -4795,7 +4795,7 @@ static void transmit_cleanup(struct dev_info *hw_priv, int normal) | |||
4795 | info->avail++; | 4795 | info->avail++; |
4796 | } | 4796 | } |
4797 | info->last = last; | 4797 | info->last = last; |
4798 | spin_unlock(&hw_priv->hwlock); | 4798 | spin_unlock_irq(&hw_priv->hwlock); |
4799 | 4799 | ||
4800 | /* Notify the network subsystem that the packet has been sent. */ | 4800 | /* Notify the network subsystem that the packet has been sent. */ |
4801 | if (dev) | 4801 | if (dev) |
@@ -5259,11 +5259,15 @@ static irqreturn_t netdev_intr(int irq, void *dev_id) | |||
5259 | struct dev_info *hw_priv = priv->adapter; | 5259 | struct dev_info *hw_priv = priv->adapter; |
5260 | struct ksz_hw *hw = &hw_priv->hw; | 5260 | struct ksz_hw *hw = &hw_priv->hw; |
5261 | 5261 | ||
5262 | spin_lock(&hw_priv->hwlock); | ||
5263 | |||
5262 | hw_read_intr(hw, &int_enable); | 5264 | hw_read_intr(hw, &int_enable); |
5263 | 5265 | ||
5264 | /* Not our interrupt! */ | 5266 | /* Not our interrupt! */ |
5265 | if (!int_enable) | 5267 | if (!int_enable) { |
5268 | spin_unlock(&hw_priv->hwlock); | ||
5266 | return IRQ_NONE; | 5269 | return IRQ_NONE; |
5270 | } | ||
5267 | 5271 | ||
5268 | do { | 5272 | do { |
5269 | hw_ack_intr(hw, int_enable); | 5273 | hw_ack_intr(hw, int_enable); |
@@ -5310,6 +5314,8 @@ static irqreturn_t netdev_intr(int irq, void *dev_id) | |||
5310 | 5314 | ||
5311 | hw_ena_intr(hw); | 5315 | hw_ena_intr(hw); |
5312 | 5316 | ||
5317 | spin_unlock(&hw_priv->hwlock); | ||
5318 | |||
5313 | return IRQ_HANDLED; | 5319 | return IRQ_HANDLED; |
5314 | } | 5320 | } |
5315 | 5321 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index 537902479689..bc7ec64e9c7a 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -36,8 +36,8 @@ | |||
36 | 36 | ||
37 | #define _QLCNIC_LINUX_MAJOR 5 | 37 | #define _QLCNIC_LINUX_MAJOR 5 |
38 | #define _QLCNIC_LINUX_MINOR 0 | 38 | #define _QLCNIC_LINUX_MINOR 0 |
39 | #define _QLCNIC_LINUX_SUBVERSION 29 | 39 | #define _QLCNIC_LINUX_SUBVERSION 30 |
40 | #define QLCNIC_LINUX_VERSIONID "5.0.29" | 40 | #define QLCNIC_LINUX_VERSIONID "5.0.30" |
41 | #define QLCNIC_DRV_IDC_VER 0x01 | 41 | #define QLCNIC_DRV_IDC_VER 0x01 |
42 | #define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ | 42 | #define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ |
43 | (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION)) | 43 | (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION)) |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c index 58f094ca052e..b14b8f0787ea 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | |||
@@ -134,7 +134,7 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter) | |||
134 | __le32 *tmp_buf; | 134 | __le32 *tmp_buf; |
135 | struct qlcnic_cmd_args cmd; | 135 | struct qlcnic_cmd_args cmd; |
136 | struct qlcnic_hardware_context *ahw; | 136 | struct qlcnic_hardware_context *ahw; |
137 | struct qlcnic_dump_template_hdr *tmpl_hdr, *tmp_tmpl; | 137 | struct qlcnic_dump_template_hdr *tmpl_hdr; |
138 | dma_addr_t tmp_addr_t = 0; | 138 | dma_addr_t tmp_addr_t = 0; |
139 | 139 | ||
140 | ahw = adapter->ahw; | 140 | ahw = adapter->ahw; |
@@ -150,6 +150,8 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter) | |||
150 | } | 150 | } |
151 | temp_size = cmd.rsp.arg2; | 151 | temp_size = cmd.rsp.arg2; |
152 | version = cmd.rsp.arg3; | 152 | version = cmd.rsp.arg3; |
153 | dev_info(&adapter->pdev->dev, | ||
154 | "minidump template version = 0x%x", version); | ||
153 | if (!temp_size) | 155 | if (!temp_size) |
154 | return -EIO; | 156 | return -EIO; |
155 | 157 | ||
@@ -174,7 +176,6 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter) | |||
174 | err = -EIO; | 176 | err = -EIO; |
175 | goto error; | 177 | goto error; |
176 | } | 178 | } |
177 | tmp_tmpl = tmp_addr; | ||
178 | ahw->fw_dump.tmpl_hdr = vzalloc(temp_size); | 179 | ahw->fw_dump.tmpl_hdr = vzalloc(temp_size); |
179 | if (!ahw->fw_dump.tmpl_hdr) { | 180 | if (!ahw->fw_dump.tmpl_hdr) { |
180 | err = -EIO; | 181 | err = -EIO; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index fc48e000f35f..7a6d5ebe4e0f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |||
@@ -365,7 +365,7 @@ static int | |||
365 | qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter, | 365 | qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter, |
366 | struct cmd_desc_type0 *cmd_desc_arr, int nr_desc) | 366 | struct cmd_desc_type0 *cmd_desc_arr, int nr_desc) |
367 | { | 367 | { |
368 | u32 i, producer, consumer; | 368 | u32 i, producer; |
369 | struct qlcnic_cmd_buffer *pbuf; | 369 | struct qlcnic_cmd_buffer *pbuf; |
370 | struct cmd_desc_type0 *cmd_desc; | 370 | struct cmd_desc_type0 *cmd_desc; |
371 | struct qlcnic_host_tx_ring *tx_ring; | 371 | struct qlcnic_host_tx_ring *tx_ring; |
@@ -379,7 +379,6 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter, | |||
379 | __netif_tx_lock_bh(tx_ring->txq); | 379 | __netif_tx_lock_bh(tx_ring->txq); |
380 | 380 | ||
381 | producer = tx_ring->producer; | 381 | producer = tx_ring->producer; |
382 | consumer = tx_ring->sw_consumer; | ||
383 | 382 | ||
384 | if (nr_desc >= qlcnic_tx_avail(tx_ring)) { | 383 | if (nr_desc >= qlcnic_tx_avail(tx_ring)) { |
385 | netif_tx_stop_queue(tx_ring->txq); | 384 | netif_tx_stop_queue(tx_ring->txq); |
@@ -402,7 +401,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter, | |||
402 | pbuf->frag_count = 0; | 401 | pbuf->frag_count = 0; |
403 | 402 | ||
404 | memcpy(&tx_ring->desc_head[producer], | 403 | memcpy(&tx_ring->desc_head[producer], |
405 | &cmd_desc_arr[i], sizeof(struct cmd_desc_type0)); | 404 | cmd_desc, sizeof(struct cmd_desc_type0)); |
406 | 405 | ||
407 | producer = get_next_index(producer, tx_ring->num_desc); | 406 | producer = get_next_index(producer, tx_ring->num_desc); |
408 | i++; | 407 | i++; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index a7554d9aab0c..d833f5927891 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -445,13 +445,10 @@ static int | |||
445 | qlcnic_set_function_modes(struct qlcnic_adapter *adapter) | 445 | qlcnic_set_function_modes(struct qlcnic_adapter *adapter) |
446 | { | 446 | { |
447 | u8 id; | 447 | u8 id; |
448 | u32 ref_count; | ||
449 | int i, ret = 1; | 448 | int i, ret = 1; |
450 | u32 data = QLCNIC_MGMT_FUNC; | 449 | u32 data = QLCNIC_MGMT_FUNC; |
451 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 450 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
452 | 451 | ||
453 | /* If other drivers are not in use set their privilege level */ | ||
454 | ref_count = QLCRD32(adapter, QLCNIC_CRB_DRV_ACTIVE); | ||
455 | ret = qlcnic_api_lock(adapter); | 452 | ret = qlcnic_api_lock(adapter); |
456 | if (ret) | 453 | if (ret) |
457 | goto err_lock; | 454 | goto err_lock; |
@@ -531,11 +528,9 @@ static int qlcnic_setup_pci_map(struct pci_dev *pdev, | |||
531 | { | 528 | { |
532 | u32 offset; | 529 | u32 offset; |
533 | void __iomem *mem_ptr0 = NULL; | 530 | void __iomem *mem_ptr0 = NULL; |
534 | resource_size_t mem_base; | ||
535 | unsigned long mem_len, pci_len0 = 0, bar0_len; | 531 | unsigned long mem_len, pci_len0 = 0, bar0_len; |
536 | 532 | ||
537 | /* remap phys address */ | 533 | /* remap phys address */ |
538 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ | ||
539 | mem_len = pci_resource_len(pdev, 0); | 534 | mem_len = pci_resource_len(pdev, 0); |
540 | 535 | ||
541 | qlcnic_get_bar_length(pdev->device, &bar0_len); | 536 | qlcnic_get_bar_length(pdev->device, &bar0_len); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c index 12ff29270745..0b8d8625834c 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | |||
@@ -197,7 +197,7 @@ static u32 qlcnic_dump_ctrl(struct qlcnic_adapter *adapter, | |||
197 | int i, k, timeout = 0; | 197 | int i, k, timeout = 0; |
198 | void __iomem *base = adapter->ahw->pci_base0; | 198 | void __iomem *base = adapter->ahw->pci_base0; |
199 | u32 addr, data; | 199 | u32 addr, data; |
200 | u8 opcode, no_ops; | 200 | u8 no_ops; |
201 | struct __ctrl *ctr = &entry->region.ctrl; | 201 | struct __ctrl *ctr = &entry->region.ctrl; |
202 | struct qlcnic_dump_template_hdr *t_hdr = adapter->ahw->fw_dump.tmpl_hdr; | 202 | struct qlcnic_dump_template_hdr *t_hdr = adapter->ahw->fw_dump.tmpl_hdr; |
203 | 203 | ||
@@ -206,7 +206,6 @@ static u32 qlcnic_dump_ctrl(struct qlcnic_adapter *adapter, | |||
206 | 206 | ||
207 | for (i = 0; i < no_ops; i++) { | 207 | for (i = 0; i < no_ops; i++) { |
208 | k = 0; | 208 | k = 0; |
209 | opcode = 0; | ||
210 | for (k = 0; k < 8; k++) { | 209 | for (k = 0; k < 8; k++) { |
211 | if (!(ctr->opcode & (1 << k))) | 210 | if (!(ctr->opcode & (1 << k))) |
212 | continue; | 211 | continue; |
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index cb6fc5a743ca..5ac93323a40c 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -577,28 +577,30 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance) | |||
577 | { | 577 | { |
578 | struct net_device *dev = dev_instance; | 578 | struct net_device *dev = dev_instance; |
579 | struct cp_private *cp; | 579 | struct cp_private *cp; |
580 | int handled = 0; | ||
580 | u16 status; | 581 | u16 status; |
581 | 582 | ||
582 | if (unlikely(dev == NULL)) | 583 | if (unlikely(dev == NULL)) |
583 | return IRQ_NONE; | 584 | return IRQ_NONE; |
584 | cp = netdev_priv(dev); | 585 | cp = netdev_priv(dev); |
585 | 586 | ||
587 | spin_lock(&cp->lock); | ||
588 | |||
586 | status = cpr16(IntrStatus); | 589 | status = cpr16(IntrStatus); |
587 | if (!status || (status == 0xFFFF)) | 590 | if (!status || (status == 0xFFFF)) |
588 | return IRQ_NONE; | 591 | goto out_unlock; |
592 | |||
593 | handled = 1; | ||
589 | 594 | ||
590 | netif_dbg(cp, intr, dev, "intr, status %04x cmd %02x cpcmd %04x\n", | 595 | netif_dbg(cp, intr, dev, "intr, status %04x cmd %02x cpcmd %04x\n", |
591 | status, cpr8(Cmd), cpr16(CpCmd)); | 596 | status, cpr8(Cmd), cpr16(CpCmd)); |
592 | 597 | ||
593 | cpw16(IntrStatus, status & ~cp_rx_intr_mask); | 598 | cpw16(IntrStatus, status & ~cp_rx_intr_mask); |
594 | 599 | ||
595 | spin_lock(&cp->lock); | ||
596 | |||
597 | /* close possible race's with dev_close */ | 600 | /* close possible race's with dev_close */ |
598 | if (unlikely(!netif_running(dev))) { | 601 | if (unlikely(!netif_running(dev))) { |
599 | cpw16(IntrMask, 0); | 602 | cpw16(IntrMask, 0); |
600 | spin_unlock(&cp->lock); | 603 | goto out_unlock; |
601 | return IRQ_HANDLED; | ||
602 | } | 604 | } |
603 | 605 | ||
604 | if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) | 606 | if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) |
@@ -612,7 +614,6 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance) | |||
612 | if (status & LinkChg) | 614 | if (status & LinkChg) |
613 | mii_check_media(&cp->mii_if, netif_msg_link(cp), false); | 615 | mii_check_media(&cp->mii_if, netif_msg_link(cp), false); |
614 | 616 | ||
615 | spin_unlock(&cp->lock); | ||
616 | 617 | ||
617 | if (status & PciErr) { | 618 | if (status & PciErr) { |
618 | u16 pci_status; | 619 | u16 pci_status; |
@@ -625,7 +626,10 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance) | |||
625 | /* TODO: reset hardware */ | 626 | /* TODO: reset hardware */ |
626 | } | 627 | } |
627 | 628 | ||
628 | return IRQ_HANDLED; | 629 | out_unlock: |
630 | spin_unlock(&cp->lock); | ||
631 | |||
632 | return IRQ_RETVAL(handled); | ||
629 | } | 633 | } |
630 | 634 | ||
631 | #ifdef CONFIG_NET_POLL_CONTROLLER | 635 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 022b45bc14ff..a670d23d9340 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c | |||
@@ -2386,8 +2386,6 @@ static const struct of_device_id smc91x_match[] = { | |||
2386 | {}, | 2386 | {}, |
2387 | }; | 2387 | }; |
2388 | MODULE_DEVICE_TABLE(of, smc91x_match); | 2388 | MODULE_DEVICE_TABLE(of, smc91x_match); |
2389 | #else | ||
2390 | #define smc91x_match NULL | ||
2391 | #endif | 2389 | #endif |
2392 | 2390 | ||
2393 | static struct dev_pm_ops smc_drv_pm_ops = { | 2391 | static struct dev_pm_ops smc_drv_pm_ops = { |
@@ -2402,7 +2400,7 @@ static struct platform_driver smc_driver = { | |||
2402 | .name = CARDNAME, | 2400 | .name = CARDNAME, |
2403 | .owner = THIS_MODULE, | 2401 | .owner = THIS_MODULE, |
2404 | .pm = &smc_drv_pm_ops, | 2402 | .pm = &smc_drv_pm_ops, |
2405 | .of_match_table = smc91x_match, | 2403 | .of_match_table = of_match_ptr(smc91x_match), |
2406 | }, | 2404 | }, |
2407 | }; | 2405 | }; |
2408 | 2406 | ||
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index 4616bf27d515..e112877d15d3 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c | |||
@@ -2575,11 +2575,13 @@ static const struct dev_pm_ops smsc911x_pm_ops = { | |||
2575 | #define SMSC911X_PM_OPS NULL | 2575 | #define SMSC911X_PM_OPS NULL |
2576 | #endif | 2576 | #endif |
2577 | 2577 | ||
2578 | #ifdef CONFIG_OF | ||
2578 | static const struct of_device_id smsc911x_dt_ids[] = { | 2579 | static const struct of_device_id smsc911x_dt_ids[] = { |
2579 | { .compatible = "smsc,lan9115", }, | 2580 | { .compatible = "smsc,lan9115", }, |
2580 | { /* sentinel */ } | 2581 | { /* sentinel */ } |
2581 | }; | 2582 | }; |
2582 | MODULE_DEVICE_TABLE(of, smsc911x_dt_ids); | 2583 | MODULE_DEVICE_TABLE(of, smsc911x_dt_ids); |
2584 | #endif | ||
2583 | 2585 | ||
2584 | static struct platform_driver smsc911x_driver = { | 2586 | static struct platform_driver smsc911x_driver = { |
2585 | .probe = smsc911x_drv_probe, | 2587 | .probe = smsc911x_drv_probe, |
@@ -2588,7 +2590,7 @@ static struct platform_driver smsc911x_driver = { | |||
2588 | .name = SMSC_CHIPNAME, | 2590 | .name = SMSC_CHIPNAME, |
2589 | .owner = THIS_MODULE, | 2591 | .owner = THIS_MODULE, |
2590 | .pm = SMSC911X_PM_OPS, | 2592 | .pm = SMSC911X_PM_OPS, |
2591 | .of_match_table = smsc911x_dt_ids, | 2593 | .of_match_table = of_match_ptr(smsc911x_dt_ids), |
2592 | }, | 2594 | }, |
2593 | }; | 2595 | }; |
2594 | 2596 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 023a4fb4efa5..b05df8983be5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h | |||
@@ -127,14 +127,14 @@ static inline int stmmac_register_platform(void) | |||
127 | } | 127 | } |
128 | static inline void stmmac_unregister_platform(void) | 128 | static inline void stmmac_unregister_platform(void) |
129 | { | 129 | { |
130 | platform_driver_register(&stmmac_pltfr_driver); | 130 | platform_driver_unregister(&stmmac_pltfr_driver); |
131 | } | 131 | } |
132 | #else | 132 | #else |
133 | static inline int stmmac_register_platform(void) | 133 | static inline int stmmac_register_platform(void) |
134 | { | 134 | { |
135 | pr_debug("stmmac: do not register the platf driver\n"); | 135 | pr_debug("stmmac: do not register the platf driver\n"); |
136 | 136 | ||
137 | return -EINVAL; | 137 | return 0; |
138 | } | 138 | } |
139 | static inline void stmmac_unregister_platform(void) | 139 | static inline void stmmac_unregister_platform(void) |
140 | { | 140 | { |
@@ -162,7 +162,7 @@ static inline int stmmac_register_pci(void) | |||
162 | { | 162 | { |
163 | pr_debug("stmmac: do not register the PCI driver\n"); | 163 | pr_debug("stmmac: do not register the PCI driver\n"); |
164 | 164 | ||
165 | return -EINVAL; | 165 | return 0; |
166 | } | 166 | } |
167 | static inline void stmmac_unregister_pci(void) | 167 | static inline void stmmac_unregister_pci(void) |
168 | { | 168 | { |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 542edbcd92c7..f07c0612abf6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -2194,18 +2194,20 @@ int stmmac_restore(struct net_device *ndev) | |||
2194 | */ | 2194 | */ |
2195 | static int __init stmmac_init(void) | 2195 | static int __init stmmac_init(void) |
2196 | { | 2196 | { |
2197 | int err_plt = 0; | 2197 | int ret; |
2198 | int err_pci = 0; | ||
2199 | |||
2200 | err_plt = stmmac_register_platform(); | ||
2201 | err_pci = stmmac_register_pci(); | ||
2202 | |||
2203 | if ((err_pci) && (err_plt)) { | ||
2204 | pr_err("stmmac: driver registration failed\n"); | ||
2205 | return -EINVAL; | ||
2206 | } | ||
2207 | 2198 | ||
2199 | ret = stmmac_register_platform(); | ||
2200 | if (ret) | ||
2201 | goto err; | ||
2202 | ret = stmmac_register_pci(); | ||
2203 | if (ret) | ||
2204 | goto err_pci; | ||
2208 | return 0; | 2205 | return 0; |
2206 | err_pci: | ||
2207 | stmmac_unregister_platform(); | ||
2208 | err: | ||
2209 | pr_err("stmmac: driver registration failed\n"); | ||
2210 | return ret; | ||
2209 | } | 2211 | } |
2210 | 2212 | ||
2211 | static void __exit stmmac_exit(void) | 2213 | static void __exit stmmac_exit(void) |
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index 337766738eca..5e62c1aeeffb 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c | |||
@@ -27,8 +27,6 @@ | |||
27 | #include <linux/uaccess.h> | 27 | #include <linux/uaccess.h> |
28 | #include <linux/workqueue.h> | 28 | #include <linux/workqueue.h> |
29 | 29 | ||
30 | #include <plat/clock.h> | ||
31 | |||
32 | #include "cpts.h" | 30 | #include "cpts.h" |
33 | 31 | ||
34 | #ifdef CONFIG_TI_CPTS | 32 | #ifdef CONFIG_TI_CPTS |