Date: Sat, 21 Oct 2006 15:14:42 +0000 (UTC) From: redchrom@gmail.com To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/104652: add non-completed suspend/resume support for the bfe driver Message-ID: <20061021151442.5F3E92E0C07@death.ispvds.com> Resent-Message-ID: <200610211520.k9LFKD4Y077863@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 104652 >Category: kern >Synopsis: add non-completed suspend/resume support for the bfe driver >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 21 15:20:13 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Stepan Zastupov (RedChrom) >Release: FreeBSD 7.0-CURRENT i386 >Organization: ISPSystem >Environment: System: FreeBSD stepan.ispsystem.net 7.0-CURRENT FreeBSD 7.0-CURRENT #5: Fri Oct 20 11:51:51 IRKST 2006 root@stepan.ispsystem.net:/usr/obj/usr/src/sys/LILITH i386 >Description: bfe driver dosen't support suspend/resume device methods and system with loaded bfe driver don't want to resume. I've added some basic functions to the driver, but it dosen't help. Linux driver just detach a device on suspend and attach on resume - on FreeBSD only detaching success. Normal FreeBSD routines like stoping and reseting on suspend/resume dosen't help. As I see in Linux network cards usually dosen't dettach/attach on syspend/resume but with this driver does, so maybe we should play with it? Here is my dmesg: Copyright (c) 1992-2006 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 7.0-CURRENT #5: Fri Oct 20 11:51:51 IRKST 2006 root@stepan.ispsystem.net:/usr/obj/usr/src/sys/LILITH ACPI APIC Table: <HP 099C > Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Celeron(R) M processor 1.50GHz (1496.26-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x6d8 Stepping = 8 Features=0xafe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE> AMD Features=0x100000<NX> real memory = 528285696 (503 MB) avail memory = 507305984 (483 MB) ioapic0: Changing APIC ID to 1 ioapic0 <Version 2.0> irqs 0-23 on motherboard kbd1 at kbdmux0 ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) acpi0: <HP 099C> on motherboard acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi0: Power Button (fixed) Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 acpi_ec0: <Embedded Controller: GPE 0x10> port 0x62,0x66 on acpi0 cpu0: <ACPI CPU> on acpi0 acpi_throttle0: <ACPI CPU Throttling> on cpu0 pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0 pci0: <ACPI PCI bus> on pcib0 vgapci0: <VGA-compatible display> port 0x7000-0x7007 mem 0xd0400000-0xd047ffff,0xc0000000-0xcfffffff,0xd0480000-0xd04bffff irq 16 at device 2.0 on pci0 agp0: <Intel 82915GM (915GM GMCH) SVGA controller> on vgapci0 agp0: detected 7932k stolen memory agp0: aperture size is 256M vgapci1: <VGA-compatible display> mem 0xd0500000-0xd057ffff at device 2.1 on pci0 uhci0: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A> port 0x2000-0x201f irq 23 at device 29.0 on pci0 uhci0: [GIANT-LOCKED] usb0: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A> on uhci0 usb0: USB revision 1.0 uhub0: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb0 uhub0: 2 ports with 2 removable, self powered uhci1: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-B> port 0x2020-0x203f irq 17 at device 29.1 on pci0 uhci1: [GIANT-LOCKED] usb1: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-B> on uhci1 usb1: USB revision 1.0 uhub1: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb1 uhub1: 2 ports with 2 removable, self powered uhci2: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-C> port 0x2040-0x205f irq 18 at device 29.2 on pci0 uhci2: [GIANT-LOCKED] usb2: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-C> on uhci2 usb2: USB revision 1.0 uhub2: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb2 uhub2: 2 ports with 2 removable, self powered uhci3: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-D> port 0x2060-0x207f irq 19 at device 29.3 on pci0 uhci3: [GIANT-LOCKED] usb3: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-D> on uhci3 usb3: USB revision 1.0 uhub3: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb3 uhub3: 2 ports with 2 removable, self powered ehci0: <Intel 82801FB (ICH6) USB 2.0 controller> mem 0xd0580000-0xd05803ff irq 23 at device 29.7 on pci0 ehci0: [GIANT-LOCKED] usb4: EHCI version 1.0 usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3 usb4: <Intel 82801FB (ICH6) USB 2.0 controller> on ehci0 usb4: USB revision 2.0 uhub4: <Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb4 uhub4: 8 ports with 8 removable, self powered pcib1: <ACPI PCI-PCI bridge> at device 30.0 on pci0 pci2: <ACPI PCI bus> on pcib1 cbb0: <TI6411 PCI-CardBus Bridge> mem 0xd0000000-0xd0000fff irq 18 at device 6.0 on pci2 cardbus0: <CardBus bus> on cbb0 pccard0: <16-bit PCCard bus> on cbb0 pci2: <serial bus, FireWire> at device 6.2 (no driver attached) pci2: <network, ethernet> at device 14.0 (no driver attached) pcm0: <Intel ICH6 (82801FB)> port 0x2100-0x21ff,0x2200-0x223f mem 0xd0581000-0xd05811ff,0xd0582000-0xd05820ff irq 21 at device 30.2 on pci0 pcm0: <Analog Devices AD1981B AC97 Codec> pci0: <simple comms, generic modem> at device 30.3 (no driver attached) isab0: <PCI-ISA bridge> at device 31.0 on pci0 isa0: <ISA bus> on isab0 atapci0: <Intel ICH6 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x2580-0x258f irq 16 at device 31.1 on pci0 ata0: <ATA channel 0> on atapci0 ata1: <ATA channel 1> on atapci0 battery0: <ACPI Control Method Battery> on acpi0 battery1: <ACPI Control Method Battery> on acpi0 acpi_acad0: <AC Adapter> on acpi0 acpi_button0: <Sleep Button> on acpi0 acpi_lid0: <Control Method Lid Switch> on acpi0 acpi_tz0: <Thermal Zone> on acpi0 acpi_tz1: <Thermal Zone> on acpi0 acpi_tz2: <Thermal Zone> on acpi0 acpi_tz3: <Thermal Zone> on acpi0 atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0 atkbd0: <AT Keyboard> irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: <PS/2 Mouse> irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model IntelliMouse, device ID 3 pmtimer0 on isa0 orm0: <ISA Option ROM> at iomem 0xc0000-0xcffff pnpid ORM0000 on isa0 sc0: <System console> at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 1496260038 Hz quality 800 Timecounters tick every 1.000 msec ad0: 38154MB <FUJITSU MHV2040AH 00830096> at ata0-master UDMA100 acd0: DVDR <MATSHITAUJ-840D/1.02> at ata0-slave PIO4 Trying to mount root from ufs:/dev/ad0s1a WARNING: / was not properly dismounted WARNING: /usr was not properly dismounted WARNING: /var was not properly dismounted cd0 at ata0 bus 0 target 1 lun 0 cd0: <MATSHITA UJ-840D 1.02> Removable CD-ROM SCSI-0 device cd0: 16.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present WARNING: attempt to net_add_domain(bluetooth) after domainfinalize() drm0: <Intel i915GM> on vgapci0 info: [drm] AGP at 0xd0400000 0MB info: [drm] Initialized i915 1.5.0 20060119 bfe0: <Broadcom BCM4401-B0 Fast Ethernet> mem 0xd000e000-0xd000ffff irq 16 at device 14.0 on pci2 miibus0: <MII bus> on bfe0 bmtphy0: <BCM4401 10/100baseTX PHY> on miibus0 bmtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto bfe0: Ethernet address: 00:15:60:c2:06:2f bfe0: link state changed to DOWN bfe0: link state changed to UP >How-To-Repeat: Load bfe driver if not presented in kernel and try to suspend (acpiconf -s 3) system. >Fix: --- if_bfe.c.orig Sat Oct 21 23:04:16 2006 +++ if_bfe.c Sat Oct 21 23:07:23 2006 @@ -97,6 +97,8 @@ static void bfe_stop (struct bfe_softc *); static void bfe_watchdog (struct ifnet *); static void bfe_shutdown (device_t); +static int bfe_suspend (device_t); +static int bfe_resume (device_t); static void bfe_tick (void *); static void bfe_txeof (struct bfe_softc *); static void bfe_rxeof (struct bfe_softc *); @@ -136,6 +138,8 @@ DEVMETHOD(device_attach, bfe_attach), DEVMETHOD(device_detach, bfe_detach), DEVMETHOD(device_shutdown, bfe_shutdown), + DEVMETHOD(device_suspend, bfe_suspend), + DEVMETHOD(device_resume, bfe_resume), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -441,7 +445,7 @@ KASSERT(mtx_initialized(&sc->bfe_mtx), ("bfe mutex not initialized")); BFE_LOCK(sc); - + ifp = sc->bfe_ifp; if (device_is_attached(dev)) { @@ -477,6 +481,22 @@ BFE_UNLOCK(sc); return; +} + +static int +bfe_suspend(device_t dev) +{ + bfe_detach(dev); + + return (0); +} + +static int +bfe_resume(device_t dev) +{ + bfe_attach(dev); + + return (0); } static int >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061021151442.5F3E92E0C07>