aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-12-12hwmon: (lm85) Fix overflows seen when writing voltage limit attributesGuenter Roeck1-1/+2
Writes into voltage limit attributes can overflow due to an unbound multiplication. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-12hwmon: (lm87) Fix overflow seen when writing voltage limit attributesGuenter Roeck1-1/+1
Writes into voltage limit attributes can overflow due to an unbound multiplication. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-12hwmon: (nct7802) Fix overflows seen when writing into limit attributesGuenter Roeck1-3/+5
Fix overflows seen when writing voltage and temperature limit attributes. The value passed to DIV_ROUND_CLOSEST() needs to be clamped, and the value parameter passed to nct7802_write_fan_min() is an unsigned long. Also, writing values larger than 2700000 into a fan limit attribute results in writing 0 into the chip's limit registers. The exact behavior when writing this value is unspecified. For consistency, report a limit of 1350000 if the chip register reads 0. This may be wrong, and the chip behavior should be verified with the actual chip, but it is better than reporting a value of 0 (which, when written, results in writing a value of 0x1fff into the chip register). Fixes: 3434f3783580 ("hwmon: Driver for Nuvoton NCT7802Y") Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (adt7470) Fix overflows seen when writing into limit attributesGuenter Roeck1-3/+3
Fix overflows seen when writing large values into various temperature limit attributes. The input value passed to DIV_ROUND_CLOSEST() needs to be clamped to avoid such overflows. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (adt7462) Fix overflows seen when writing into limit attributesGuenter Roeck1-6/+6
Fix overflows seen when writing large values into temperature limit, voltage limit, and pwm hysteresis attributes. The input parameter to DIV_ROUND_CLOSEST() needs to be clamped to avoid such overflows. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (adm1026) Fix overflows seen when writing into limit attributesGuenter Roeck1-9/+17
Fix overflows seen when writing large values into voltage limit, temperature limit, temperature offset, and DAC attributes. Overflows are seen due to unbound multiplications and additions. While at it, change the low temperature limit to -128 degrees C, since this is the minimum temperature accepted by the chip. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (adm1025) Fix overflows seen when writing voltage limitsGuenter Roeck1-1/+1
Writes into voltage limit attributes can overflow due to an unbound multiplication. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (via-cputemp) Convert to hotplug state machineSebastian Andrzej Siewior1-46/+17
Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. When the hotplug state is unregistered the cleanup function is called for each cpu. So both cpu loops in init() and exit() are not longer required. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09devicetree: hwmon: Add documentation for TMP108 driver.John Muir1-0/+14
Simple hwmon binding documentation. Signed-off-by: John Muir <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: Add Texas Instruments TMP108 temperature sensor driver.John Muir4-0/+517
Add support for the TI TMP108 temperature sensor with some device configuration parameters. Signed-off-by: John Muir <[email protected]> [groeck: Initialize of_match_table] Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Simplify sysfs attribute name allocationGuenter Roeck1-8/+9
Allocating the sysfs attribute name only if needed and only with the required minimum length looks optimal, but does not take the additional overhead for both devm_ data structures and the allocation header itself into account. This also results in unnecessary memory fragmentation. Move the sysfs name string into struct hwmon_device_attribute and give it a sufficient length to reduce this overhead. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Rename groups parameter in API to extra_groupsGuenter Roeck3-19/+19
The 'groups' parameter of hwmon_device_register_with_info() and devm_hwmon_device_register_with_info() is only necessary if extra non-standard attributes need to be provided. Rename the parameter to extra_groups and clarify the documentation. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Explain why at least two attribute groups are allocatedGuenter Roeck1-1/+1
A list of sysfs attribute groups is NULL-terminated, so we always need to allocate data for at least two groups (the dynamically generated group plus the NULL pointer). Add a comment to explain the situation. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Make is_visible callback truly mandatoryGuenter Roeck1-3/+3
The is_visible callback provides the sysfs attribute mode and is thus truly mandatory as documented. Check it once at registration and remove other checks for its existence. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Deprecate hwmon_device_register()Guenter Roeck3-20/+19
Inform the user that hwmon_device_register() is deprecated, and suggest conversion to the newest API. Also remove hwmon_device_register() from the kernel API documentation. Note that hwmon_device_register() is not marked as __deprecated() since doing so might result in build errors. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Clarify use of chip attributesGuenter Roeck2-4/+8
Describing chip attributes as "attributes which apply to the entire chip" is confusing. Rephrase to "attributes which are not bound to a specific input or output". Also rename hwmon_chip_attr_templates[] to hwmon_chip_attrs[] to indicate that the respective strings strings are not templates but actual attribute names. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Add support for string attributes to new APIGuenter Roeck2-4/+48
The new API is so far only suited for data attributes and does not work well for string attributes, specifically for the 'label' attributes. Provide a separate callback function for those. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (core) Clarify when read and write callbacks are mandatoryGuenter Roeck1-4/+2
The callback descrption in hwmon.h was misleading and stated that read and write callbacks would be optional. More accurate is is that the callbacks are mandatory if readable / writeable attributes are present. Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (lm90) Mention support for TI TMP451 in Kconfig descriptionTobias Klauser1-2/+2
The lm90 driver also supports the Texas Instruments TMP451 sensor chip. Since the Kconfig description for the driver includes a list of all compatible chips, mention the TI TMP451 there as well. Signed-off-by: Tobias Klauser <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (coretemp) Simplify package managementThomas Gleixner1-82/+38
Keeping track of the per package platform devices requires an extra object, which is held in a linked list. The maximum number of packages is known at init() time. So the extra object and linked list management can be replaced by an array of platform device pointers in which the per package devices pointers can be stored. Lookup becomes a simple array lookup instead of a list walk. The mutex protecting the list can be removed as well because the array is only accessed from cpu hotplug callbacks which are already serialized. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (coretemp) Use proper error codes in cpu online callbackThomas Gleixner1-19/+5
The cpu online callback returns success unconditionally even when the device has no support, micro code mismatches or device allocation fails. Only if CPU_HOTPLUG is disabled, the init function checks whether the device list is empty and removes the driver. This does not make sense. If CPU HOTPLUG is enabled then there is no point to keep the driver around when it failed to initialize on the already online cpus. The chance that not yet online CPUs will provide a functional interface later is very close to zero. Add proper error return codes, so the setup of the cpu hotplug states fails when the device cannot be initialized and remove all the magic cruft. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (coretemp) Convert to hotplug state machineThomas Gleixner1-57/+29
Install the callbacks via the state machine. Setup and teardown are handled by the hotplug core. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Cc: [email protected] Cc: Fenghua Yu <[email protected]> Cc: Jean Delvare <[email protected]> Cc: [email protected] Cc: Guenter Roeck <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (coretemp) Avoid redundant lookupsThomas Gleixner1-13/+6
No point in looking up the same thing over and over. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (coretemp) Simplify sibling managementThomas Gleixner1-56/+37
The coretemp driver provides a sysfs interface per physical core. If hyperthreading is enabled and one of the siblings goes offline the sysfs interface is removed and then immeditately created again for the sibling. The only difference of them is the target cpu for the rdmsr_on_cpu() in the sysfs show functions. It's way simpler to keep a cpumask of cpus which are active in a package and only remove the interface when the last sibling goes offline. Otherwise just move the target cpu for the sysfs show functions to the still online sibling. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (coretemp) Fixup target cpu for package when cpu is offlinedThomas Gleixner1-7/+24
When a CPU is offlined nothing checks whether it is the target CPU for the package temperature sysfs interface. As a consequence all future readouts of the package temperature return crap: 90000 which is Tjmax of that package. Check whether the outgoing CPU is the target for the package and assign it to some other still online CPU in the package. Protect the change against the rdmsr_on_cpu() in show_crit_alarm(). Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (smsc47m192) Fix overflows seen when writing into limit attributesGuenter Roeck1-2/+3
Module test reports overflows when writing into temperature and voltage limit attributes temp1_min: Suspected overflow: [127000 vs. 0] temp1_max: Suspected overflow: [127000 vs. 0] temp1_offset: Suspected overflow: [127000 vs. 0] temp2_min: Suspected overflow: [127000 vs. 0] temp2_max: Suspected overflow: [127000 vs. 0] temp2_offset: Suspected overflow: [127000 vs. 0] temp3_min: Suspected overflow: [127000 vs. 0] temp3_max: Suspected overflow: [127000 vs. 0] temp3_offset: Suspected overflow: [127000 vs. 0] in0_min: Suspected overflow: [3320 vs. 0] in0_max: Suspected overflow: [3320 vs. 0] in4_min: Suspected overflow: [15938 vs. 0] in4_max: Suspected overflow: [15938 vs. 0] in6_min: Suspected overflow: [1992 vs. 0] in6_max: Suspected overflow: [1992 vs. 0] in7_min: Suspected overflow: [2391 vs. 0] in7_max: Suspected overflow: [2391 vs. 0] The problem is caused by conversions from unsigned long to long and from long to int. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (ds620) Fix overflows seen when writing temperature limitsGuenter Roeck1-1/+1
Module test reports: temp1_max: Suspected overflow: [160000 vs. 0] temp1_min: Suspected overflow: [160000 vs. 0] This is seen because the values passed when writing temperature limits are unbound. Reviewed-by: Jean Delvare <[email protected]> Fixes: 6099469805c2 ("hwmon: Support for Dallas Semiconductor DS620") Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (adm9240) Fix overflows seen when writing into limit attributesGuenter Roeck1-3/+6
Module test reports: in0_min: Suspected overflow: [3320 vs. 0] in0_max: Suspected overflow: [3320 vs. 0] in4_min: Suspected overflow: [15938 vs. 0] in4_max: Suspected overflow: [15938 vs. 0] temp1_max: Suspected overflow: [127000 vs. 0] temp1_max_hyst: Suspected overflow: [127000 vs. 0] aout_output: Suspected overflow: [1250 vs. 0] Code analysis reveals that the overflows are caused by conversions from unsigned long to long to int, combined with multiplications on passed values. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (adt7411) update to new hwmon registration APIMichael Walle1-121/+180
This is also a preparation for to support more properties like min, max and alarm. Signed-off-by: Michael Walle <[email protected]> [groeck: Minor alignment changes] Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (via-cputemp) Remove pointless CPU check on each CPUThomas Gleixner1-15/+1
The check loop for the cpu type is pointless as we already have a cpu model match before that. The only thing which is not covered by that check would be a smp system with two different cores. Not likely to happen. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (mcp3021) add devicetree supportClemens Gruber1-12/+36
Support setting the reference voltage from the device tree. Signed-off-by: Clemens Gruber <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (mcp3021) replace S_IRUGO with 0444Clemens Gruber1-1/+1
Replace S_IRUGO with the better readable 0444. This fixes a checkpatch warning. Signed-off-by: Clemens Gruber <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (mcp3021) add devicetree bindings documentationClemens Gruber1-0/+21
Document the devicetree bindings for the Microchip MCP3021/3221. Signed-off-by: Clemens Gruber <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (lm87) Use hwmon to create the sysfs groupsJason Gunthorpe1-84/+50
This is the expected thing for a hwmon driver to do, this changes the sysfs paths from, say: /sys/bus/i2c/devices/0-002c/temp1_input to: /sys/bus/i2c/devices/0-002c/hwmon/hwmon0/temp1_input Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (adm1275) Enable adm1278 VOUT samplingYi Li1-4/+16
The adm1278 can optionally monitor the VOUT pin. This functionality is not enabled at reset, so PMON_CONFIG needs to be modified in order to enable it. Signed-off-by: Yi Li <[email protected]> Signed-off-by: Joel Stanley <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: Add tc654 driverChris Packham5-0/+559
Add support for the tc654 and tc655 fan controllers from Microchip. http://ww1.microchip.com/downloads/en/DeviceDoc/20001734C.pdf Signed-off-by: Chris Packham <[email protected]> Acked-by: Rob Herring <[email protected]> [groeck: Fixed continuation line alignments] Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (amc6821) sign extension temperatureJared Bents1-2/+2
Converts the unsigned temperature values from the i2c read to be sign extended as defined in the datasheet so that negative temperatures are properly read. Fixes: 28e6274d8fa67 ("hwmon: (amc6821) Avoid forward declaration") Signed-off-by: Jared Bents <[email protected]> Signed-off-by: Matt Weber <[email protected]> [groeck: Dropped unnecessary continuation line] Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (scpi) Fix module autoloadJavier Martinez Canillas1-0/+1
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias $ After this patch: $ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias alias: of:N*T*Carm,scpi-sensorsC* alias: of:N*T*Carm,scpi-sensors Signed-off-by: Javier Martinez Canillas <[email protected]> Fixes: ea98b29a05e9c ("hwmon: Support sensors exported via ARM SCP interface") Signed-off-by: Guenter Roeck <[email protected]>
2016-11-27Linux 4.9-rc7Linus Torvalds1-1/+1
2016-11-27Merge git://git.infradead.org/intel-iommuLinus Torvalds4-12/+34
Pull IOMMU fixes from David Woodhouse: "Two minor fixes. The first fixes the assignment of SR-IOV virtual functions to the correct IOMMU unit, and the second fixes the excessively large (and physically contiguous) PASID tables used with SVM" * git://git.infradead.org/intel-iommu: iommu/vt-d: Fix PASID table allocation iommu/vt-d: Fix IOMMU lookup for SR-IOV Virtual Functions
2016-11-27Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linusLinus Torvalds5-9/+29
Pull MIPS fixes from Ralf Baechle: "Another round of MIPS fixes for 4.9: - Fix unreadable output in __do_page_fault due to the KERN_CONT patchset - Correctly handle MIPS R6 fixes to the c0_wired register" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: mm: Fix output of __do_page_fault MIPS: Mask out limit field when calculating wired entry count
2016-11-26Merge branch 'for-linus' of ↵Linus Torvalds1-1/+2
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs splice fix from Al Viro. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix default_file_splice_read()
2016-11-26fix default_file_splice_read()Al Viro1-1/+2
Botched calculation of number of pages. As the result, we were dropping pieces when doing splice to pipe from e.g. 9p. Reported-by: Alexei Starovoitov <[email protected]> Tested-by: Alexei Starovoitov <[email protected]> Signed-off-by: Al Viro <[email protected]>
2016-11-26Merge branch 'i2c/for-current' of ↵Linus Torvalds1-39/+25
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Here is a revert and two bugfixes for the I2C designware driver. Please note that we are still hunting down a regression for the i2c-octeon driver. While there is a fix pending, we have unclear feedback from the testers currently. An rc8 would be quite helpful for this case" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: Revert "i2c: designware: do not disable adapter after transfer" i2c: designware: fix rx fifo depth tracking i2c: designware: report short transfers
2016-11-26Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-armLinus Torvalds47-131/+208
Pull ARM fix from Russell King: "This resolves the ksyms issues by reverting the commit which introduced the breakage" There was what I consider to be a better fix, but it's late in the rc game, so I'll take the revert. * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm: Revert "arm: move exports to definitions"
2016-11-26Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds35-60/+101
Pull networking fixes from David Miller: 1) Fix leak in fsl/fman driver, from Dan Carpenter. 2) Call flow dissector initcall earlier than any networking driver can register and start to use it, from Eric Dumazet. 3) Some dup header fixes from Geliang Tang. 4) TIPC link monitoring compat fix from Jon Paul Maloy. 5) Link changes require EEE re-negotiation in bcm_sf2 driver, from Florian Fainelli. 6) Fix bogus handle ID passed into tfilter_notify_chain(), from Roman Mashak. 7) Fix dump size calculation in rtnl_calcit(), from Zhang Shengju. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits) tipc: resolve connection flow control compatibility problem mvpp2: use correct size for memset net/mlx5: drop duplicate header delay.h net: ieee802154: drop duplicate header delay.h ibmvnic: drop duplicate header seq_file.h fsl/fman: fix a leak in tgec_free() net: ethtool: don't require CAP_NET_ADMIN for ETHTOOL_GLINKSETTINGS tipc: improve sanity check for received domain records tipc: fix compatibility bug in link monitoring net: ethernet: mvneta: Remove IFF_UNICAST_FLT which is not implemented dwc_eth_qos: drop duplicate headers net sched filters: fix filter handle ID in tfilter_notify_chain() net: dsa: bcm_sf2: Ensure we re-negotiate EEE during after link change bnxt: do not busy-poll when link is down udplite: call proper backlog handlers ipv6: bump genid when the IFA_F_TENTATIVE flag is clear net/mlx4_en: Free netdev resources under state lock net: revert "net: l2tp: Treat NET_XMIT_CN as success in l2tp_eth_dev_xmit" rtnetlink: fix the wrong minimal dump size getting from rtnl_calcit() bnxt_en: Fix a VXLAN vs GENEVE issue ...
2016-11-26Merge branch 'libnvdimm-fixes' of ↵Linus Torvalds2-3/+5
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm fixes from Dan Williams: - Fix a crash that occurs at driver initialization if the memory region is already busy (request_mem_region() fails). - Fix a vma validation check that mistakenly allows a private device- dax mapping to be established. Device-dax explicitly forbids private mappings so it can guarantee a given fault granularity and backing memory type. Both of these fixes have soaked in -next and are tagged for -stable. * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: device-dax: fail all private mapping attempts device-dax: check devm_nsio_enable() return value
2016-11-26Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvmLinus Torvalds5-29/+28
Pull KVM fixes from Radim Krčmář: "Four fixes for bugs found by syzkaller on x86, all for stable" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: check for pic and ioapic presence before use KVM: x86: fix out-of-bounds accesses of rtc_eoi map KVM: x86: drop error recovery in em_jmp_far and em_ret_far KVM: x86: fix out-of-bounds access in lapic
2016-11-26Merge tag 'powerpc-4.9-6' of ↵Linus Torvalds9-12/+64
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: "Fixes marked for stable: - Set missing wakeup bit in LPCR on POWER9 - Fix the early OPAL console wrappers - Fixup kernel read only mapping Fixes for code merged this cycle: - Fix missing CRCs, add more asm-prototypes.h declarations" * tag 'powerpc-4.9-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm: Fixup kernel read only mapping powerpc/boot: Fix the early OPAL console wrappers powerpc: Fix missing CRCs, add more asm-prototypes.h declarations powerpc: Set missing wakeup bit in LPCR on POWER9
2016-11-25tipc: resolve connection flow control compatibility problemJon Paul Maloy1-1/+1
In commit 10724cc7bb78 ("tipc: redesign connection-level flow control") we replaced the previous message based flow control with one based on 1k blocks. In order to ensure backwards compatibility the mechanism falls back to using message as base unit when it senses that the peer doesn't support the new algorithm. The default flow control window, i.e., how many units can be sent before the sender blocks and waits for an acknowledge (aka advertisement) is 512. This was tested against the previous version, which uses an acknowledge frequency of on ack per 256 received message, and found to work fine. However, we missed the fact that versions older than Linux 3.15 use an acknowledge frequency of 512, which is exactly the limit where a 4.6+ sender will stop and wait for acknowledge. This would also work fine if it weren't for the fact that if the first sent message on a 4.6+ server side is an empty SYNACK, this one is also is counted as a sent message, while it is not counted as a received message on a legacy 3.15-receiver. This leads to the sender always being one step ahead of the receiver, a scenario causing the sender to block after 512 sent messages, while the receiver only has registered 511 read messages. Hence, the legacy receiver is not trigged to send an acknowledge, with a permanently blocked sender as result. We solve this deadlock by simply allowing the sender to send one more message before it blocks, i.e., by a making minimal change to the condition used for determining connection congestion. Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>