Netplan replug function is incompatible with ath9k_htc module

Bug #1672740 reported by Domotz Ubuntu Core on 2017-03-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mathieu Trudel-Lapierre
nplan (Ubuntu)

Bug Description

Replugging ath9k_htc may confuse the driver and cause connection issues.

[Test case]
- Run nplan integration tests on the release
- Validate that netplan generate && netplan apply alone, without config, behave as expected (no result)
- Validate that netplan generate && netplan apply with minimal config writes /run/NetworkManager/conf.d/10-globally-managed-devices.conf
- Validate that netplan generate && netplan apply works with any existing configuation.

- Run 'netplan apply' with a valid config for an ath9k_htc device, validate the device is not replugged.

[Regression potential]
Any failure to work with existing configuration should be considered a regression. Any new failure of the test suite would be a regression.


We hit the following problem about the interaction between netplan and the ath9k_htc module, controlling the chip Atheros AR9271.

If you run the following command

    netplan --debug apply

or you use console-conf for setting the network interfaces we get the following messages :

** (generate:2261): DEBUG: Processing input file //etc/netplan/00-snapd-config.yaml..
** (generate:2261): DEBUG: eth0: setting default backend to 1
** (generate:2261): DEBUG: Generating output files..
** (generate:2261): DEBUG: NetworkManager: definition eth0 is not for us (backend 1)
DEBUG:netplan generated networkd configuration exists, restarting networkd
DEBUG:no netplan generated NM configuration exists
DEBUG:device lo operstate is unknown, not replugging
DEBUG:device eth0 operstate is up, not replugging
DEBUG:replug wlan0: unbinding 4-1:1.0 from /sys/bus/usb/drivers/ath9k_htc
DEBUG:replug wlan0: rebinding 4-1:1.0 to /sys/bus/usb/drivers/ath9k_htc

The last two row show two consecutive actions, one soon after the other: unbind and bind the usb device on usb hub.

The module ath9k_htc doesn't work fine in this situation: the wireless interface disappears.

Our problem can be fixed by using the same approach used for mac80211_hwsim e mwifiex_pcie modules.
The attached patch file fix the issue following the same pattern adopted for the following modules:

Domotz Ubuntu Core (domotz) wrote :

In Progress/High. I'm preparing a new release, so I'll include this.

I'm a little concerned about the trend of half-broken kernel drivers requiring this kind of exceptions though. Have you also filed a bug against 'linux' for the driver to get fixed?

There will also be the question on whether we can do better than replugging the devices like this, but for now we will do with an exception.

Changed in netplan:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)

Applied locally, I'll upload this shortly to 17.10, then we can work on the SRUs.

Changed in netplan:
status: In Progress → Fix Committed

nplan (0.21) artful; urgency=medium

  [ Ryan Harper ]
  * Add support for setting MTU on a device. (LP: #1668693)

  [ Mathieu Trudel-Lapierre ]
  * Don't rebind Atheros AR9271; it would confuse the driver. (LP: #1672740)
  * debian/control: Add Conflicts: against netplan; the network 'plan' daemon.
    Both ship the same /usr/sbin/netplan. (LP: #1665842)

Changed in netplan:
status: Fix Committed → Fix Released
Changed in nplan (Ubuntu):
status: New → Fix Released

What release do we need to backport this fix to?

description: updated
Domotz Ubuntu Core (domotz) wrote :

ubuntu core 16, then 16.04 release

Hello Domotz, or anyone else affected,

Accepted nplan into xenial-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at . Thank you in advance!

Changed in nplan (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Domotz Ubuntu Core (domotz) wrote :

Hi Brian,
we tested on ubuntu server 16.04. with package version 0.21~16.04.1.
It works fine.
It is not present on core snap for stable and candidate channel.
How can I know about the availability on snappy platform?


Hm, that's a good question. I'll track down the right people to update the core snap.

Added a task for snappy for the core snap to be recreated. Adding 'verification-done' tag since this fix has been tested.

tags: added: verification-done
removed: verification-needed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers