Merge ~jocave/netplan/+git/netplan:dont-rebind-mwifiex into ~netplan-developers/netplan/+git/netplan-lp:master

Proposed by Jonathan Cave
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: ~jocave/netplan/+git/netplan:dont-rebind-mwifiex
Merge into: ~netplan-developers/netplan/+git/netplan-lp:master
Diff against target: 20 lines (+6/-1)
1 file modified
src/netplan (+6/-1)
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+307531@code.launchpad.net

Description of the change

We have found the mwifiex_pcie driver does not handle unbind/bind actions well. This manifested as frequent kernel panics when console-conf used netplan to configure interfaces on Ubuntu Core images.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

I'm fine with applying this patch, but note that mac80211_hwsim is a bit special: it genuinely doesn't even advertise rebinding, but it's also just being used for testing so it doesn't matter much.

OTOH mwifiex_pcie actually controls real hardware, and with that "netplan apply" would stop working for renames. Obviously you do call netplan apply (otherwise you wouldn't run into the crash), so I figure you do want it to actually apply.

Can you please file a bug against the kernel with the logs and traces so that this gets fixed properly eventually?

I also have an inline comment, see below.

Revision history for this message
Martin Pitt (pitti) :
5de3398... by Jonathan Cave

Keep individual driver checks and debug messages

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for the cleanup! I'll pull that into the package and xenial-updates backport. The latter will take a bit, so I take it in the meantime you want to land this in the snappy overlay PPA.

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

Merged into trunk (squashed the three commits into one).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/netplan b/src/netplan
2index bdef802..e90720f 100755
3--- a/src/netplan
4+++ b/src/netplan
5@@ -103,9 +103,14 @@ def replug(device): # pragma: nocover (covered in autopkgtest)
6 try:
7 # we must resolve symlinks here as the device dir will be gone after unbind
8 driver = os.path.realpath(os.path.join(devdir, 'device', 'driver'))
9- if os.path.basename(driver) == 'mac80211_hwsim':
10+ driver_name = os.path.basename(driver)
11+ if driver_name == 'mac80211_hwsim':
12 logging.debug('replug %s: mac80211_hwsim does not support rebinding, ignoring', device)
13 return False
14+ # workaround for https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1630285
15+ if driver_name == 'mwifiex_pcie':
16+ logging.debug('replug %s: mwifiex_pcie crashes on rebinding, ignoring', device)
17+ return False
18 logging.debug('replug %s: unbinding %s from %s', device, devname, driver)
19 with open(os.path.join(driver, 'unbind'), 'w') as f:
20 f.write(devname)

Subscribers

People subscribed via source and target branches