From nobody@FreeBSD.org  Thu Jun 14 11:03:34 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4176E106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Jun 2012 11:03:34 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [69.147.83.34])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DC828FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Jun 2012 11:03:34 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q5EB3X6c091939
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Jun 2012 11:03:33 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q5EB3XZW091938;
	Thu, 14 Jun 2012 11:03:33 GMT
	(envelope-from nobody)
Message-Id: <201206141103.q5EB3XZW091938@red.freebsd.org>
Date: Thu, 14 Jun 2012 11:03:33 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [alc] does not properly reinitialize when resuming
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         169064
>Category:       kern
>Synopsis:       [alc] does not properly reinitialize when resuming
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 14 11:10:01 UTC 2012
>Closed-Date:    
>Last-Modified:  Sun Feb 03 22:30:38 UTC 2013
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
n/a
>Environment:
FreeBSD tamara.local 10.0-CURRENT FreeBSD 10.0-CURRENT #5 r237013M: Wed Jun 13 17:22:50 PDT 2012     root@tamara.local:/usr/obj/usr/src/sys/NETBOOK  i386
>Description:
I had my netbook connected to the LAN at work, suspended the laptop, brought it home, and noticed that the routes were still screwed up. When I looked at the ifconfig output I noticed that it was still referencing the address it was assigned at work; example (after I resumed with the cable disconnected:

$ ifconfig alc0
alc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=c3198<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MCAST,WOL_MAGIC,VLAN_HWTSO,LINKSTATE>
        ether 20:cf:30:09:4d:92
        inet 192.168.20.70 netmask 0xffffff00 broadcast 192.168.20.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (none)
        status: no carrier

Doing some digging through /var/log/messages, it appears that the interface was DOWNed, but it wasn't brought back UP:

Jun 13 10:17:08 akai-ntbk kernel: alc0: link state changed to UP
Jun 13 10:17:11 akai-ntbk dhclient: New Hostname (alc0):
Jun 13 10:17:11 akai-ntbk dhclient: New IP Address (alc0): 137.69.152.65
Jun 13 10:17:11 akai-ntbk dhclient: New Subnet Mask (alc0): 255.255.255.0
Jun 13 10:17:11 akai-ntbk dhclient: New Broadcast Address (alc0): 137.69.152.255
Jun 13 10:17:11 akai-ntbk dhclient: New Routers (alc0): 137.69.152.1
# ...
Jun 13 19:45:21 tamara kernel: alc0: link state changed to DOWN
Jun 13 19:45:21 tamara kernel: wakeup from sleeping state (slept 00:00:04)
Jun 13 19:45:21 tamara kernel: battery0: battery initialization start
Jun 13 19:45:21 tamara kernel: battery0: battery initialization done, tried 1 times
Jun 13 19:45:21 tamara kernel: uhub0: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus4
Jun 13 19:45:21 tamara kernel: acpi_acad0: unknown notify 0x81
Jun 13 19:45:21 tamara kernel: uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
Jun 13 19:45:21 tamara kernel: uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
Jun 13 19:45:21 tamara kernel: uhub3: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
Jun 13 19:45:21 tamara kernel: uhub4: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
Jun 13 19:45:21 tamara kernel: uhub1: 2 ports with 2 removable, self powered
Jun 13 19:45:21 tamara kernel: uhub2: 2 ports with 2 removable, self powered
Jun 13 19:45:21 tamara kernel: uhub3: 2 ports with 2 removable, self powered
Jun 13 19:45:21 tamara kernel: uhub4: 2 ports with 2 removable, self powered
Jun 13 19:45:21 tamara acpi: resumed at 20120613 19:45:21
Jun 13 19:45:21 tamara kernel: alc0: link state changed to UP
Jun 13 19:45:23 tamara kernel: uhub0: 8 ports with 8 removable, self powered
Jun 13 19:45:25 tamara kernel: ugen4.2: <Azurewave> at usbus4
Jun 13 19:45:25 tamara root: Unknown USB device: vendor 0x13d3 product 0x5702 bus uhub0
Jun 13 19:45:25 tamara root: Unknown USB device: vendor 0x13d3 product 0x5702 bus uhub0
Jun 13 19:45:28 tamara kernel: acpi_button0: sleep button pressed
Jun 13 19:45:28 tamara acpi: suspend at 20120613 19:45:28
Jun 13 19:45:32 tamara kernel: uhub1: at usbus0, port 1, addr 1 (disconnected)
Jun 13 22:06:40 tamara kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jun 13 22:06:40 tamara kernel: uhub3: at usbus2, port 1, addr 1 (disconnected)
Jun 13 22:06:40 tamara kernel: uhub4: at usbus3, port 1, addr 1 (disconnected)
Jun 13 22:06:40 tamara kernel: uhub0: at usbus4, port 1, addr 1 (disconnected)
Jun 13 22:06:40 tamara kernel: ugen4.2: <Azurewave> at usbus4 (disconnected)
Jun 13 22:06:40 tamara kernel: ath0: ath_chan_set: unable to reset channel 11 (2462 MHz, flags 0x480), hal status 3
Jun 13 22:06:40 tamara kernel: alc0: link state changed to DOWN

alc0@pci0:1:0:0:        class=0x020000 card=0x838a1043 chip=0x10621969 rev=0xc0 hdr=0x00
    vendor     = 'Atheros Communications'
    device     = 'AR8132 Fast Ethernet'
    class      = network
    subclass   = ethernet

This might be a regression as a kernel I had last month (05/25/2012 to be exact) did the right thing with if_alc IIRC (I cannot recall exactly whether or not it was a UP kernel). The current kernel is SMP enabled.
>How-To-Repeat:
1. Connect a device to a wired network with an alc interface; ensure it grabs an address via DHCP.
2. Suspend the device.
3. Unplug the ethernet cable.
4. Resume the device.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
