aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lz4 (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2014-07-08defxx: Discard DMA maps on buffer deallocationMaciej W. Rozycki1-1/+6
Prearranged receive DMA bounce buffer mappings are not released in the card reboot/shutdown path. That does not affect frame reception, but probably explains the random segmentation fault I observed the other day on interface shutdown. Card is rebooted as required by the spec in the process of ring fault recovery when a PC Trace signal has been received. This change fixes the problem in an obvious manner. Reported-by: Robert Coerver <Robert.Coerver@ll.mit.edu> Tested-by: Robert Coerver <Robert.Coerver@ll.mit.edu> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08defxx: Correct the receive DMA map sizeMaciej W. Rozycki1-3/+3
Receive DMA maps are oversized, they include EISA legacy 128-byte alignment padding in size calculation whereas this padding is never used for data. Worse yet, if the skb's data area has been realigned indeed, then data beyond the end of the buffer will be synchronised from the receive DMA bounce buffer, possibly corrupting data structures residing in memory beyond the actual end of this data buffer. Therefore switch to using PI_RCV_DATA_K_SIZE_MAX rather than NEW_SKB_SIZE in DMA mapping, the value the former macro expands to is written to the receive ring DMA descriptor of the PDQ DMA chip and determines the maximum amount of data PDQ will ever transfer to the corresponding data buffer, including all headers and padding. Reported-by: Robert Coerver <Robert.Coerver@ll.mit.edu> Tested-by: Robert Coerver <Robert.Coerver@ll.mit.edu> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net: sctp: Use pointers (not array indexes) to access sctp_cmd_seq_t.cmds[].David Laight1-12/+14
Using pointers into sctp_cmd_seq_t.cmds[] lets the compiler generate much better code. Use the last entry first to optimise the overflow check. Signed-off-by: David Laight <david.laight@aculab.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net: sctp: Optimise the way 'sctp_arg_t' values are initialised.David Laight1-3/+5
Even if memset() is inlined (as on x86) using it to zero the union generates a memory word write of zero, followed by a write of the smaller field, and then a read of the word. As well as being a lot of instructions the sequence is unlikely to be optimised by the store-load forward hardware so will be slow. Instead allocate a field of the union that is the same size as the entire union and write a zero value to it. The compiler will then generate the required value in a register. Zeroing the union shouldn't be necessary, but this patch series isn't intended to have a behavioural change. Signed-off-by: David Laight <david.laight@aculab.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net: sctp: Inline the functions from command.cDavid Laight3-73/+24
sctp_init_cmd_seq() and sctp_next_cmd() are only called from one place. The call sequence for sctp_add_cmd_sf() is likely to be longer than the inlined code. With sctp_add_cmd_sf() inlined the compiler can optimise repeated calls. Signed-off-by: David Laight <david.laight@aculab.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08appletalk: fix a coccinella warning in net/appletalk/ddp.cwangweidong1-1/+1
This warning is introduced by commit 7b30600cc6 ("appletalk: fix checkpatch error with indent"), So fix it. Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net: filter: move load_pointer() into filter.hZi Shen Lim2-12/+16
load_pointer() is already a static inline function. Let's move it into filter.h so BPF JIT implementations can reuse this function. Since we're exporting this function, let's also rename it to bpf_load_pointer() for clarity. Signed-off-by: Zi Shen Lim <zlim.lnx@gmail.com> Reviewed-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08declance: Fix 64-bit compilation warningsMaciej W. Rozycki1-6/+6
This fixes compiler warnings: drivers/net/ethernet/amd/declance.c: In function 'lance_init_ring': drivers/net/ethernet/amd/declance.c:478: warning: format '%8.8x' expects type 'unsigned int', but argument 3 has type 'long unsigned int' drivers/net/ethernet/amd/declance.c:487: warning: format '%8.8x' expects type 'unsigned int', but argument 3 has type 'long unsigned int' drivers/net/ethernet/amd/declance.c:503: warning: cast from pointer to integer of different size drivers/net/ethernet/amd/declance.c:520: warning: cast from pointer to integer of different size in 64-bit compilation. Where the value printed is an offset (whose range will always fit) the cast uses a 32-bit type, otherwise, where it is a host memory address, the pointer is output directly with %p. Also the remaining `0x' prefix is dropped for consistency across these messages. Tested with both 32-bit and 64-bit compilation, as well as at the run time (with the debug messages affected enabled). Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Fix NULL pointer dereference on incomplete hsr_newlink() params.Arvid Brodin1-2/+6
If none of the slave interfaces are specified, struct nlattr *data[] may be NULL. Make sure to check for that. While I'm at it, fix the horrible error messages displayed when only one of the slave interfaces isn't specified. Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Better frame dispatchArvid Brodin11-586/+656
This patch removes the separate paths for frames coming from the outside, and frames sent from the HSR device, and instead makes all frames go through hsr_forward_skb() in hsr_forward.c. This greatly improves code readability and also opens up the possibility for future support of the HSR Interlink device that is the basis for HSR RedBoxes and HSR QuadBoxes, as well as VLAN compatibility. Other improvements: * A reduction in the number of times an skb is copied on machines without HAVE_EFFICIENT_UNALIGNED_ACCESS, which improves throughput somewhat. * Headers are now created using the standard eth_header(), and using the standard hard_header_len. * Each HSR slave now gets its own private skb, so slave-specific fields can be correctly set. Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Added SET_NETDEV_DEVTYPE and features |= NETIF_F_NETNS_LOCAL to dev_setup.Arvid Brodin1-3/+11
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Implemented .ndo_fix_features (better device features handling).Arvid Brodin2-8/+49
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Use list_head (and rcu) instead of array for slave devices.Arvid Brodin9-405/+438
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Move slave init to hsr_slave.c.Arvid Brodin6-164/+205
Also try to prevent some possible slave dereference race conditions. This is finalized in the next patch, which abandons the slave array in favour of a list_head list and list RCU. Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Operstate handling cleanup.Arvid Brodin3-22/+30
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Move to per-hsr device prune timer.Arvid Brodin5-27/+15
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Switch from dev_add_pack() to netdev_rx_handler_register()Arvid Brodin6-247/+283
Also move the frame receive handler to hsr_slave.c. Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08net/hsr: Better variable names and update of contact info.Arvid Brodin8-305/+304
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08r8152: increase the tx timeouthayeswang1-1/+1
When the system is too busy to complete the urb, the tx timout function would be called. This causes the other tx urbs would be killed, too. Increase the tx timeout to avoid it. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08ipconfig: add static to local variableFabian Frederick1-1/+1
ic_dev_xid is only used in ipconfig.c Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: netdev@vger.kernel.org Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07amd-xgbe: Base AXI DMA cache settings on device treeLendacky, Thomas3-18/+37
The default cache operations for ARM64 were changed during 3.15. To use coherent operations a "dma-coherent" device tree property is required. If that property is not present in the device tree node then the non-coherent operations are assigned for the device. Add support to the amd-xgbe driver to assign the AXI DMA cache settings based on whether the "dma-coherent" property is present in the device node. If present, use settings that work with the caches. If not present, use settings that do not look at the caches. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07amd-xgbe: Performance enhancementsLendacky, Thomas4-78/+100
This patch provides some general performance enhancements for the driver: - Modify the default coalescing settings (reduce usec, increase frames) - Change the AXI burst length to 256 bytes (default was 16 bytes which was smaller than a cache line) - Change the AXI cache settings to write-back/write-allocate which allocate cache entries for received packets during the DMA since the packet will be processed soon afterwards - Combine ioread/iowrite when disabling both the Tx and Rx interrupts - Change to processing the Tx/Rx channels in pairs - Only recycle the Rx descriptors when a threshold of dirty descriptors is reached Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07amd-xgbe: Call netif_napi_del on ndo_stop operationLendacky, Thomas1-3/+6
Currently the napi context is added using netif_napi_add each time the ndo_open operation is called. However, there is not a corresponding netif_napi_del call during the ndo_stop operation. If the device ndo_open operation was called more than once an infinite loop occurs during module unload. Add a call to netif_napi_del during the ndo_stop operation. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07amd-xgbe: Clear the proper MTL interrupt registerLendacky, Thomas1-1/+1
When initializing the MTL interrupts the interrupt status register is written to instead of the interrupt enable register. Since no MTL interrupts are being enabled and the default state is for MTL interrupts to be disabled this did not cause a problem, but needs to be fixed to target the correct register. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07amd-xgbe: Fix debugfs compatibility change with kstrtouintLendacky, Thomas1-2/+2
The initial change from sscanf to kstrtouint broke backward compatbility by using a base of "0" in the kstrtouint call. This allowed for entering decimal, hexadecimal or octal as input where previously the sscanf always interpreted the input as hexadecimal. Additionally, -EIO was returned on error prior to this change and now it is whatever the error value that is returned by kstrtouint. Change the base value of the kstrtouint from 0 to 16 and return -EIO on error. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Reported-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: arcnet: Remove "#define bool int"Rasmus Villemoes1-7/+3
The header file include/linux/arcdevice.h #defines bool to int, if bool is not already #defined. However, the files which use that header file seem to rely on that #define (unconditionally) being in effect: the prototypes for the functions arcrimi_reset, com20020_reset, com90io_reset, com90xx_reset (whose addresses are assigned to the hw.reset member of struct arcnet_local) use int explicitly. Moreover, that #define is an accident waiting to happen (scenario: inclusion of arcdevice.h followed by inclusion of some header which declares function prototypes using bool). Also, #include <linux/types.h> must appear before #include <linux/arcdevice.h> (the compiler wouldn't like "typedef _Bool int"). Since none of the files using arcdevice.h declare variables of type "bool", the patch is actually quite simple, unlike the commit message. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07enic: fix return values in enic_set_coalesceGovindarajulu Varadarajan2-17/+12
enic_set_coalesce() has two problems. * It should return -EINVAL and not -EOPNOTSUPP for invalid coalesce values. * In case of MSIX, enic_set_coalesce return error after applying requested coalescing setting partially. We should either apply all the setting requeste and return success or apply non and return error. * This patch also simplifies the algo. This was introduced by '7c2ce6e60f703 enic: Add support for adaptive interrupt coalescing' These changes were suggested by Ben Hutchings here http://www.spinics.net/lists/netdev/msg283972.html Also change enic driver version. Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07bonding: remove no longer relevant vlan warningsJiri Pirko1-7/+0
These warnings are no longer relevant. Even when last slave is removed, there is a valid address assigned to bond (random). The correct functionality of vlans is ensured by maintaining unicast list in vlan_sync_address(). Suggested-by: Jay Vosburgh <jay.vosburgh@canonical.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: add new authorAlexander Aring1-0/+1
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: add sleep cycle timingAlexander Aring1-1/+6
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: add timing for channel switchAlexander Aring1-1/+7
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: rework reset to trx_off state changeAlexander Aring1-1/+15
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: rework state change and start/stopAlexander Aring1-59/+67
This patch removes the current synchron state change function and add a new function for a state assert. Change the start and stop callbacks to use this new synchron state change behaviour. It's a wrapper around the async state change function. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: rework irq_pol settingAlexander Aring1-5/+2
This patch rework the irq_pol register setting for rising and falling interrupt settings only. The default behaviour should be rising flag. Also use IRQ_TYPE_* defines instead of IRQF_* defines. There is no functionality change but irq_get_trigger_type returns IRQ_TYPE_* defines. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: move RX_SAFE_MODE setting to hw_initAlexander Aring1-5/+4
There is no need to set this bit in start callback which could be called more than once. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: rework transmit and receive handlingAlexander Aring1-268/+571
This patch is a complete reimplementation of transmit and receive handling for the at86rf230 driver. It solves also six bugs: First: The RX_SAFE_MODE is enabled and the transceiver doesn't leave the receive state while the framebuffer isn't read by a CMD_FB command. This is useful to read out the frame and don't get into another receive or transmit state, otherwise the frame would be overwritten. The current driver do twice CMD_FB calls, the first one leaves this protection. Second: Sometimes the CRC calculation is correct and the length field is greater 127. The current mac802154 layer and filter of a at86rf2xx doesn't check on this and the kernel crashes. In this case the frame is corrupted, we send the whole receive buffer to the next layer which can be useful for sniffing. Thrid: There is a undocumented race condition. When we are go into the RX_AACK_ON state the transceiver could be changed into RX_AACK_BUSY state. This is a normal behaviour. In this case the transceiver received a SHR while assert wasn't finished. Fourth: It also handle some more "correct" state changes. In aret mode the transceiver need to go to TX_ON before the transceiver go into RX_AACK_ON. Fifth: The programming model [0] describes also a error handling in ARET mode if the trac status is different than zero. This is patch adds support for handling this. Sixth: In receive handling the transceiver should also get the trac status according [0]. The driver could use the trac status as error statistic handling, but the driver doesn't use this currently. There is maybe some timing behaviour or the read of this register change some transceiver states. In addition the irqworker is removed. Instead we do async spi calls and no scheduling is involved anymore. The transmit function is also asynchron but with a wait_for_completion handling. The mac802154 layer doesn't support asynchron transmit handling right now. The state change behaviour is now changes, before it was: 1. assert while(!STATE_TRANSITION_IN_PROGRESS) 2. state change 3. assert while(!STATE_TRANSITION_IN_PROGRESS) 4. assert once(wanted state != current state) Sometimes a unexcepted state change occurs when 4. assert was violated. The new state change behaviour is: 1. assert while(!STATE_TRANSITION_IN_PROGRESS) 2. state change 3. wait state change timing according datasheet 4. assert once(wanted state != current state) This behaviour is described in the at86rf231 software programming model [0]. The state change documentation in this programming guide should also valid for at86rf212 and at86rf233 chips. The transceiver don't do a FORCE_TX_ON while we want to transmit a PDU. The new behaviour is a TX_ON and wait a receiving time (tFrame + tPAck). If we are still in RX_AACK_BUSY then we transmit a FORCE_TX_ON as timeout handling. The different is that FORCE_TX_ON aborts receiving and TX_ON waits if RX_AACK_BUSY is finished. This should decrease the drop rate of packets. [0] http://www.atmel.com/Images/AVR2022_swpm231-2.0.zip Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: add support for at86rf23x desenseAlexander Aring1-4/+18
To set the CCA_ED_THRES register the calculation for at86rf23x is different than for at86rf212. This patch adds a new callback for this calculation in chip data struct. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: remove is212 and add driver dataAlexander Aring1-23/+36
This patch adds a new at86rf2xx_chip_data structure which holds device specific attributes. Instead of runtime decisions "if (is212())" we set callbacks/attributes while device detection. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: rework detect device handlingAlexander Aring1-107/+76
This patch drops the current lowlevel spi calls for the detect device function instead we handle this via regmap. Also put the detection of in a seperate function and set all device specific attributes while detection. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07at86rf230: add regmap supportAlexander Aring2-105/+168
This patch adds regmap support for the at86rf230 driver and drop the lowlevel spi access functions and use the regmap access functions. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07mac802154: at86rf230: add hw flags and merge opsAlexander Aring3-58/+102
This patch adds new mac802154 hw flags for transmit power, csma and listen before transmit (lbt). These flags indicates that the transceiver supports these features. If the flags are set and the driver doesn't implement the necessary functions, then ieee802154_register_device returns -ENOSYS "Function not implemented". This patch merges also all at86rf230 operations into one operations structure and set the right hw flags for the at86rf230 transceivers. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers()Russell King1-6/+9
fec_enet_alloc_buffers() assumes that kmalloc() will never fail, which is an invalid assumption. Fix this by implementing a common error cleanup path, and use it to also clean up after failed bounce buffer allocation. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: ensure fec_enet_free_buffers() properly cleans the ringsRussell King1-1/+6
Ensure that we do not double-free any allocations, and that any transmit skbuffs are properly freed when we clean up the rings. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: clean up transmit descriptor setupRussell King1-15/+18
Avoid writing any state until we're certain we can proceed with the transmission: this avoids writing mapping error address values to the descriptors, or setting the skbuff pointer until we have successfully mapped the skb. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: make rx skb handling more robustRussell King1-6/+11
Allocate, and then map the receive skb before writing any data to the ring descriptor or storing the skb. When freeing the receive ring entries, unmap and free the skb, and then clear the stored skb pointer. This means we have ring data and skb pointer in one of two states: either both fully setup, or nothing setup. This simplifies the cleanup, as we can use just the skb pointer to indicate whether the descriptor is setup, and thus avoids potentially calling dma_unmap_single() on a DMA error value. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: remove useless fep->openedRussell King2-6/+0
napi_disable() waits until the NAPI processing has completed, and then prevents any further polls. At this point, the driver then clears fep->opened. The NAPI poll function uses this to stop processing in the receive path. Hence, it will never see this variable cleared, because the NAPI poll has to complete before it will be cleared. Therefore, this variable serves no purpose, so let's remove it. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: stop the phy before shutting down the MACRussell King1-1/+4
When the network interface goes down, stop the phy to prevent further link up status changes before taking the MAC or netif sections down. This prevents further reception of link up events which could potentially call fec_restart(). Since phy_stop() takes the mutex which adjust_link() runs under, we also ensure that adjust_link() will not already be processing a link up event. We also need to do this when suspending as well - we don't want a mis-timed phy state change to restart the MAC after we have stopped it for suspend, and thus need to restart the phy when resuming. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: ensure that a disconnected phy isn't configuredRussell King1-0/+4
When we disconnect from a phy, we should forget our pointer to it so we don't accidentally try to configure it. We handle a NULL phy pointer correctly in most places, except fec_enet_set_pauseparam(). Fix this too. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: remove checking for NULL phy_dev in fec_enet_close()Russell King1-4/+2
fep->phy_dev can not be NULL here for two reasons: - fec_enet_open() will have successfully connected the phy, or will have failed. - fec_enet_open() will have called phy_start(fep->phy_dev), which unconditionally dereferences this pointer. If it were to be NULL here, then fec_enet_open() will have already oopsed. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: fec: use netif_tx_disable() rather than netif_stop_queue()Russell King1-2/+2
We use netif_stop_queue() in several places where we want to ensure that the start_xmit function is not running. netif_stop_queue() is not sufficient to achieve that - it merely sets a flag to indicate that the transmit queue(s) should not be run. netif_tx_disable() gives this guarantee, since it takes the transmit queue lock while marking the queue stopped. This will wait for the transmit function to complete before returning. Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>