Date: Sun, 01 Apr 2001 01:01:42 +0900 From: WATANABE Kiyoshi <aab10490@pop16.odn.ne.jp> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: kern/26255: [patch] CS4281 driver, fixed power mode problem. Message-ID: <3AC645B6.BD29D9BA@pop16.odn.ne.jp>
next in thread | raw e-mail | index | archive | help
>Number: 26255 >Category: kern >Synopsis: [patch] CS4281 driver, fixed power mode problem. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Mar 31 13:50:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: WATANABE Kiyoshi <aab10490@pop16.odn.ne.jp> >Release: FreeBSD 4.3-RC1 i386 >Organization: japan >Environment: FreeBSD 4.3-RC1 i386 Celeron 700Mhz. i810 mother board. CS4281 on board. >Description: [patch] CS4281 driver, fixed power mode problem. >How-To-Repeat: When boot, cs4281_pci_attach() fails if the power state is not in D0. ( not always ) >Fix: --- cs4281.c-1.4 Sat Mar 24 23:10:27 2001 +++ cs4281.c Sat Mar 31 19:37:16 2001 @@ -767,8 +767,6 @@ data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); pci_write_config(dev, PCIR_COMMAND, data, 2); - data = pci_read_config(dev, PCIR_COMMAND, 2); - #if __FreeBSD_version > 500000 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { /* Reset the power state. */ @@ -776,6 +774,18 @@ "-- setting to D0\n", pci_get_powerstate(dev)); pci_set_powerstate(dev, PCI_POWERSTATE_D0); + } +#else + +#define CS4281PCI_PMCS_OFFSET (CS4281PCI_PMCS - 0x300) + + data = pci_read_config(dev, CS4281PCI_PMCS_OFFSET, 4); + if (data & CS4281PCI_PMCS_PS_MASK) { + /* Reset the power state. */ + device_printf(dev, "chip is in D%d power mode " + "-- setting to D0\n", data & CS4281PCI_PMCS_PS_MASK); + pci_write_config(dev, CS4281PCI_PMCS_OFFSET, + data & ~CS4281PCI_PMCS_PS_MASK, 4); } #endif sc->regid = PCIR_MAPS; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AC645B6.BD29D9BA>