New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[µTVM] Avoid listing links when probing serial ports #7265
Conversation
SerialTransport.open() probes automatically the device name based upon a grep regex if a device name is not provided. The code expects to find only a single device. Currently when it probes for the available serial ports it includes in the list the device names that are also symbolic links. Since _find_openocd_serial_port() always returns a serial number for a given serial port (not the device name path) the available device names are always probed when the openocd flash runner is used. It's not uncommon that device drivers create symbolic links for certain kinds of serial devices, specially those that provide a serial port plus an additional endpoint to program the device attached, like a ST-Link interface, etc. As a consequence the current code fails to select the correct device name when symbolic links exist and the openocd flash runner is used. That commit changes the probe behavior to avoid listing symbolic links when probing the device name for the target serial port. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
@areusch Could you please review? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gromero thanks, I was trying to remember why I would have done this and I believe it was from when I was trying to use docker containers in place of the Reference VMs. I don't believe include_links is necessary now.
@tmoreau89 can you merge?
SerialTransport.open() probes automatically the device name based upon a grep regex if a device name is not provided. The code expects to find only a single device. Currently when it probes for the available serial ports it includes in the list the device names that are also symbolic links. Since _find_openocd_serial_port() always returns a serial number for a given serial port (not the device name path) the available device names are always probed when the openocd flash runner is used. It's not uncommon that device drivers create symbolic links for certain kinds of serial devices, specially those that provide a serial port plus an additional endpoint to program the device attached, like a ST-Link interface, etc. As a consequence the current code fails to select the correct device name when symbolic links exist and the openocd flash runner is used. That commit changes the probe behavior to avoid listing symbolic links when probing the device name for the target serial port. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
SerialTransport.open() probes automatically the device name based upon a grep regex if a device name is not provided. The code expects to find only a single device. Currently when it probes for the available serial ports it includes in the list the device names that are also symbolic links. Since _find_openocd_serial_port() always returns a serial number for a given serial port (not the device name path) the available device names are always probed when the openocd flash runner is used. It's not uncommon that device drivers create symbolic links for certain kinds of serial devices, specially those that provide a serial port plus an additional endpoint to program the device attached, like a ST-Link interface, etc. As a consequence the current code fails to select the correct device name when symbolic links exist and the openocd flash runner is used. That commit changes the probe behavior to avoid listing symbolic links when probing the device name for the target serial port. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
SerialTransport.open() probes automatically the device name based upon a grep regex if a device name is not provided. The code expects to find only a single device. Currently when it probes for the available serial ports it includes in the list the device names that are also symbolic links. Since _find_openocd_serial_port() always returns a serial number for a given serial port (not the device name path) the available device names are always probed when the openocd flash runner is used. It's not uncommon that device drivers create symbolic links for certain kinds of serial devices, specially those that provide a serial port plus an additional endpoint to program the device attached, like a ST-Link interface, etc. As a consequence the current code fails to select the correct device name when symbolic links exist and the openocd flash runner is used. That commit changes the probe behavior to avoid listing symbolic links when probing the device name for the target serial port. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
SerialTransport.open() probes automatically the device name based upon a grep regex if a device name is not provided. The code expects to find only a single device. Currently when it probes for the available serial ports it includes in the list the device names that are also symbolic links. Since _find_openocd_serial_port() always returns a serial number for a given serial port (not the device name path) the available device names are always probed when the openocd flash runner is used. It's not uncommon that device drivers create symbolic links for certain kinds of serial devices, specially those that provide a serial port plus an additional endpoint to program the device attached, like a ST-Link interface, etc. As a consequence the current code fails to select the correct device name when symbolic links exist and the openocd flash runner is used. That commit changes the probe behavior to avoid listing symbolic links when probing the device name for the target serial port. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
SerialTransport.open() probes automatically the device name based upon a grep regex if a device name is not provided. The code expects to find only a single device. Currently when it probes for the available serial ports it includes in the list the device names that are also symbolic links. Since _find_openocd_serial_port() always returns a serial number for a given serial port (not the device name path) the available device names are always probed when the openocd flash runner is used. It's not uncommon that device drivers create symbolic links for certain kinds of serial devices, specially those that provide a serial port plus an additional endpoint to program the device attached, like a ST-Link interface, etc. As a consequence the current code fails to select the correct device name when symbolic links exist and the openocd flash runner is used. That commit changes the probe behavior to avoid listing symbolic links when probing the device name for the target serial port. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
SerialTransport.open() probes automatically the device name based upon a
grep regex if a device name is not provided. The code expects to find only
a single device. Currently when it probes for the available serial ports it
includes in the list the device names that are also symbolic links.
Since _find_openocd_serial_port() always returns a serial number for a
given serial port (not the device name path) the available device names
are always probed when the openocd flash runner is used.
It's not uncommon that device drivers create symbolic links for certain
kinds of serial devices, specially those that provide a serial port plus
an additional endpoint to program the device attached, like a ST-Link
interface, etc.
As a consequence the current code fails to select the correct device name
when symbolic links exist and the openocd flash runner is used.
That commit changes the probe behavior to avoid listing symbolic links when
probing the device name for the target serial port.
Without that change the following error happens:
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.