← Back to team overview

kernel-packages team mailing list archive

[Bug 254731] Re: Network on PCMCIA Network card not restored after suspend/sleep

 

waldschrat, this bug was reported a while ago and there hasn't been any
activity in it recently. We were wondering if this is still an issue? If
so, could you please confirm this issue exists with the latest
development release of Ubuntu? ISO images are available from
http://cdimage.ubuntu.com/daily-live/current/ . If the issue remains,
could you please run the following command from a Terminal
(Applications->Accessories->Terminal), as it will automatically gather
and attach updated debug information to this report:

apport-collect -p linux REPLACE-WITH-BUG-NUMBER

If reproducible, could you please provide the information following
https://wiki.ubuntu.com/DebuggingKernelSuspend ?

If reproducible, could you also please test the latest upstream kernel available (not the daily folder) following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.3.13-rc7

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

Once testing of the upstream kernel is complete, please mark this bug's
Status as Confirmed. Please let us know your results. Thank you for your
understanding.

** Package changed: acpid (Ubuntu) => linux (Ubuntu)

** Changed in: linux (Ubuntu)
   Importance: Undecided => Medium

** Changed in: linux (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/254731

Title:
  Network on PCMCIA Network card not restored after suspend/sleep

Status in “linux” package in Ubuntu:
  Incomplete

Bug description:
  Binary package hint: acpid

  Hello

  I am using Ubuntu 8.04.1

  At first: This bug might be related to the following bugs:
  - #[152533]
  - #[108441]

  - I am using a Compaq Evo N620 laptop computer, with a Realtek Semiconductor RTL8180L pcmcia wlan card.
  - I do not use Network Manager (it is not even installed).
  - I am using wpa_supplicant in roaming mode to connect to my wpa_psk encrypted home network.

  The bug:
  When resuming from (acpid 1.0.4-5ubuntu9) suspend, the wlan connection is not restored.

  The solution:
  Lets have look at the file where acpid shuts down the network interfaces:

  original `/etc/acpi/suspend.d/55-down-interfaces.sh`
  {{{
  #!/bin/sh

  pccardctl eject

  # Get rid of any currently running dhclients
  killall dhclient dhclient3 2>/dev/null

  # Find the currently running network interfaces...
  INTERFACES=`/sbin/ifconfig | awk '/^[^ ]+/ {print $1}'`

  # And shut them down
  for x in $INTERFACES; do
      ifdown $x;
      ifconfig $x down;
  done
  }}}

  As you can see, the pcmcia cards are ejected before checking, witch
  interfaces are configured. After resuming, the script
  `/etc/acpi/resume.d/62-ifup.sh` only restores those connections, that
  were checked to be configured.

  That explains why pcmcia network devices are not set up when resuming from suspend.
  We can fix that easily by moving
  {{{
  pccardctl eject
  }}}
  to the end of the file.

  Now imagine the case, that our pcmcia card is configured, then we
  suspend the machine, pull out the pcmcia card and then turn the
  machine on again. We certainly dont want `acpid` to run `ifup` for the
  ejected interface.

  original `/etc/acpi/resume.d/62-ifup.sh`
  {{{
  #!/bin/sh

  # Bring up the interfaces (this should probably be left up to some policy
  # manager, but at the moment we just bring back whatever we ifdowned)

  for x in $INTERFACES; do
      ifup $x &
  done
  }}}

  Hence we have to check, witch interfaces are still available when
  resuming:

  patched version of `/etc/acpi/resume.d/62-ifup.sh`
  {{{
  #!/bin/sh

  # Bring up the interfaces (this should probably be left up to some policy
  # manager, but at the moment we just bring back whatever we ifdowned)

  # Find all interfaces which are currently available
  AVAILABLEINTERFACES=`/sbin/ifconfig -a | awk '/^[^ ]+/ {print $1}'`

  for x in $INTERFACES; do
      for y in $AVAILABLEINTERFACES; do
          if [ $x = $y ]; then
              ifup $x &
          fi
      done
  done
  }}}

  Having done this, pcmcia network devices '''not using wpa_supplicant
  in roaming mode''' should be set up correctly when resuming from
  suspend.

  Now to the problem with wpa_supplicant.
  If wpa_supplicant runs in roaming mode, meaning the `/etc/network/interfaces` looks like
  {{{
  auto lo
  iface lo inet loopback

  auto wlan0
  iface wlan0 inet manual
          wpa-driver wext
          wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
  }}}
  then the wpa_supplicant is started in background by `ifup`.

  On the other hand, if you shout down the interface using `ifdown` (as
  `/etc/acpi/suspend.d/55-down-interfaces.sh` does), the wpa_supplicant
  process is not beeing terminated automatically. If you then try to set
  up the network interface again using `ifup` (as
  `/etc/acpi/resume.d/62-ifup.sh` does), the `wpa_supplicant` is not
  started correctly. (This might be a bug of `wpa_supplicant` or
  `ifupdown`, but it is easy to implement a work around here.)

  Fortunately the `wpa_supplicant` brings a script called `/etc/init.d
  /wpa-ifupdown` to terminate any wpa_supplicant process that was
  started by `ifupdown`, so we just have to invoke that script in
  `/etc/acpi/suspend.d/55-down-interfaces.sh` before running `ifdown` on
  all active interfaces.

  patched version of `/etc/acpi/suspend.d/55-down-interfaces.sh`
  {{{
  #!/bin/sh

  # Get rid of any currently running dhclients
  killall dhclient dhclient3 2>/dev/null

  # Find the currently running network interfaces...
  INTERFACES=`/sbin/ifconfig | awk '/^[^ ]+/ {print $1}'`

  # Shut down anything, that runs via wpa_supplicant
  if [ -x /etc/init.d/wpa-ifupdown ]; then
          /etc/init.d/wpa-ifupdown stop
  fi

  # And shut them down
  for x in $INTERFACES; do
      ifdown $x;
      ifconfig $x down;
  done

  pccardctl eject
  }}}

  I have applied these changes to my system and now it runs perfectly.

  I hope I could help any one out there.

  Regards,
  Holger Stephan

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/254731/+subscriptions