From: "Peter E. Berger" <[email protected]>
I found that when using newer Edgeport devices such as the EP/416,
idle ports are regularly bounced (disconnected and then reconnected).
I discussed this with the manufacturer (Digi International) and learned
that some newer Edgeport devices now ship from the factory running
firmware that requires periodic heartbeat messages from the driver, so
I enclose a proposed patch which implements their suggested mechanism
(which works both with old and new Edgeport devices).
While developing my heartbeat patch, I discovered that the firmware
download code was not working properly, so I include a second proposed
patch to fix this.
I welcome any comments or suggestions.
Thanks.
--Peter
Changes since v3 [1]
Addressing Johan's review comments. Thanks Johan!
Note: For v4 I've switched the order of the two patches, since the "Add
heartbeat..." patch now uses the firmware version number (in deciding
whether to schedule heartbeats for a particular device), which is decoded
in the "Fix Edgeport firmware download..." patch.
* Patch 1: "USB: io_ti: Fix Edgeport firmware download code"
* Remove wrap_request_firmware() and its three invocations,
and reorganize the code to instead call request_firmware() in
edge_startup(); pass the image to download_fw() and
build_i2c_fw_hdr(); and release it on return from download_fw().
* Drop __ from types in patched code.
* Return err and skip else clause after call to request_firmware().
* Drop all references to BuildNumber and OperationalBuildNumber,
since they are not used.
* Drop use of CamelCase in patched code (except in references to
struct ti_i2c_firmware_rec from io_usbvend.h).
* Add firmware version decoding and track it in a new "fw_version"
field in edgeport_serial.
* Patch 2: "USB: io_ti: Add heartbeat to keep idle Edgeport ports from
disconnecting"
* Rename "heartbeat_task" to "heartbeat_work".
* Rename EP_HEARTBEAT_SECS to FW_HEARTBEAT_SECS and expand comment.
* Increase FW_HEARTBEAT_SECS from 15 to 40 seconds. (Digi Tech Support
originally suggested 15 seconds; 40 works on the several Edgeports
I've tested; I have a question pending with Digi Tech Support asking
if this will be valid for all Edgeports).
* Rename heartbeat() to edge_heartbeat_work().
* Allocate "rom_desc" via kmalloc in edge_heartbeat_work().
* Remove dev_dbg() in edge_heartbeat_work().
* Use serial->serial->interface->dev for messages affected by the
patch.
* Add braces to if-block in edge_heartbeat_work() for readability.
* Use FW_HEARTBEAT_SECS * HZ throughout.
* Move cancel_delayed_work_sync() call to edge_release() rather than
edge_port_remove().
* Remove dev_dbg() messages from edge_suspend() and edge_resume().
* Add newlines in edge_suspend() and edge_resume().
* Add FW_HEARTBEAT_VERSION_CUTOFF, set to version 4.80, and schedule
heartbeats only for devices using newer firmware versions.
[1]: v3: http://marc.info/?l=linux-usb&m=143166661617305&w=2
Peter E. Berger (2):
USB: io_ti: Fix Edgeport firmware download code
USB: io_ti: Add heartbeat to keep idle Edgeport ports from
disconnecting
drivers/usb/serial/io_ti.c | 180 ++++++++++++++++++++++++++++++++-------------
1 file changed, 129 insertions(+), 51 deletions(-)
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html