CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: snj Date: Mon Sep 4 06:10:30 UTC 2017 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdafg.c hdafg_dd.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1492): sys/dev/hdaudio/hdafg.c: revision 1.13 (s,hdaudio,pci/hdaudio,) sys/dev/hdaudio/hdafg_dd.c: revision 1.2 (s,hdaudio,pci/hdaudio,) put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG. this silences a frequent and largely useless series of messages in my dmesg. ok jmcneill. To generate a diff of this commit: cvs rdiff -u -r1.21.2.1 -r1.21.2.2 src/sys/dev/pci/hdaudio/hdafg.c cvs rdiff -u -r1.2 -r1.2.14.1 src/sys/dev/pci/hdaudio/hdafg_dd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: snj Date: Mon Sep 4 06:10:30 UTC 2017 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdafg.c hdafg_dd.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1492): sys/dev/hdaudio/hdafg.c: revision 1.13 (s,hdaudio,pci/hdaudio,) sys/dev/hdaudio/hdafg_dd.c: revision 1.2 (s,hdaudio,pci/hdaudio,) put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG. this silences a frequent and largely useless series of messages in my dmesg. ok jmcneill. To generate a diff of this commit: cvs rdiff -u -r1.21.2.1 -r1.21.2.2 src/sys/dev/pci/hdaudio/hdafg.c cvs rdiff -u -r1.2 -r1.2.14.1 src/sys/dev/pci/hdaudio/hdafg_dd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/hdaudio/hdafg.c diff -u src/sys/dev/pci/hdaudio/hdafg.c:1.21.2.1 src/sys/dev/pci/hdaudio/hdafg.c:1.21.2.2 --- src/sys/dev/pci/hdaudio/hdafg.c:1.21.2.1 Fri Sep 4 15:07:08 2015 +++ src/sys/dev/pci/hdaudio/hdafg.c Mon Sep 4 06:10:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: hdafg.c,v 1.21.2.1 2015/09/04 15:07:08 martin Exp $ */ +/* $NetBSD: hdafg.c,v 1.21.2.2 2017/09/04 06:10:30 snj Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd@@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21.2.1 2015/09/04 15:07:08 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21.2.2 2017/09/04 06:10:30 snj Exp $"); #include #include @@ -874,15 +874,19 @@ hdafg_assoc_dump_dd(struct hdafg_softc * res = (*cmd)(sc->sc_codec, as->as_pins[pin], CORB_GET_HDMI_ELD_DATA, i); if (!(res & COP_ELD_VALID)) { +#ifdef HDAFG_HDMI_DEBUG hda_error(sc, "bad ELD size (%u/%u)\n", i, elddatalen); +#endif break; } elddata[i] = COP_ELD_DATA(res); } if (hdafg_dd_parse_info(elddata, elddatalen, ) != 0) { +#ifdef HDAFG_HDMI_DEBUG hda_error(sc, "failed to parse ELD data\n"); +#endif return; } @@ -4260,7 +4264,9 @@ hdafg_unsol(device_t self, uint8_t tag) switch (tag) { case HDAUDIO_UNSOLTAG_EVENT_DD: +#ifdef HDAFG_HDMI_DEBUG hda_print(sc, "unsol: display device hotplug\n"); +#endif for (i = 0; i < sc->sc_nassocs; i++) { if (as[i].as_displaydev == false) continue; @@ -4272,7 +4278,9 @@ hdafg_unsol(device_t self, uint8_t tag) } break; default: +#ifdef HDAFG_HDMI_DEBUG hda_print(sc, "unsol: tag=%u\n", tag); +#endif break; } Index: src/sys/dev/pci/hdaudio/hdafg_dd.c diff -u src/sys/dev/pci/hdaudio/hdafg_dd.c:1.2 src/sys/dev/pci/hdaudio/hdafg_dd.c:1.2.14.1 --- src/sys/dev/pci/hdaudio/hdafg_dd.c:1.2 Wed Aug 29 18:52:31 2012 +++ src/sys/dev/pci/hdaudio/hdafg_dd.c Mon Sep 4 06:10:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: hdafg_dd.c,v 1.2 2012/08/29 18:52:31 dholland Exp $ */ +/* $NetBSD: hdafg_dd.c,v 1.2.14.1 2017/09/04 06:10:30 snj Exp $ */ /* * Copyright (c) 2011 Jared D. McNeill @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2 2012/08/29 18:52:31 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2.14.1 2017/09/04 06:10:30 snj Exp $"); #include #include @@ -51,12 +51,16 @@ hdafg_dd_parse_info(uint8_t *data, size_ struct eld_baseline_block *block = >eld; unsigned int i; +#ifdef HDAFG_HDMI_DEBUG printf("hdafg_dd_parse_info: datalen=%u\n", (unsigned int)datalen); +#endif memset(hdi, 0, sizeof(*hdi)); if (datalen < sizeof(block->header)) { +#ifdef HDAFG_HDMI_DEBUG printf(" no room for header\n"); +#endif return EINVAL; } @@ -66,7 +70,9 @@ hdafg_dd_parse_info(uint8_t *data, size_ if (datalen < block->header.baseline_eld_len * 4 || datalen < sizeof(*block) - sizeof(block->header)) { +#ifdef HDAFG_HDMI_DEBUG printf(" ack!\n"); +#endif return EINVAL; } @@ -77,7 +83,9 @@ hdafg_dd_parse_info(uint8_t *data, size_ datalen -= sizeof(*block) - sizeof(block->header); if (datalen < ELD_MNL(block)) { +#ifdef HDAFG_HDMI_DEBUG printf(" MNL=%u\n", ELD_MNL(block)); +#endif return EINVAL; } @@ -86,10 +94,12 @@ hdafg_dd_parse_info(uint8_t *data, size_ datalen -= ELD_MNL(block); if (datalen != ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) { +#ifdef HDAFG_HDMI_DEBUG printf(" datalen %u sadcount %u sizeof sad %u\n", (unsigned int)datalen, ELD_SAD_COUNT(block), (unsigned int)sizeof(hdi->sad[0])); +#endif return EINVAL; } hdi->nsad = ELD_SAD_COUNT(block); @@ -99,7 +109,9 @@ hdafg_dd_parse_info(uint8_t *data, size_ datalen -= sizeof(hdi->sad[i]); } +#ifdef HDAFG_HDMI_DEBUG printf("datalen = %u\n", (unsigned int)datalen); +#endif KASSERT(datalen == 0); return 0;
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: snj Date: Fri May 12 04:59:12 UTC 2017 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdaudio_pci.c Log Message: Pull up following revision(s) (requested by khorben in ticket #1369): sys/dev/pci/hdaudio/hdaudio_pci.c: patch based on revision 1.6 of sys/dev/pci/hdaudio_pci.c Always allow hdaudio(4) to suspend Sometimes hdaudio(4) can fail to attach, but the device remains in the tree. Even though the PMF registration is performed, it is explicitly de-registered in the code path for errors - therefore preventing suspending later. This patch makes sure PMF registration is performed accordingly upon errors as well. No objection on tech-kern@. Tested on a Lenovo ThinkPad T440s (amd64). To generate a diff of this commit: cvs rdiff -u -r1.12.4.2 -r1.12.4.3 src/sys/dev/pci/hdaudio/hdaudio_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/hdaudio/hdaudio_pci.c diff -u src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12.4.2 src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12.4.3 --- src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12.4.2 Fri Jul 17 04:44:41 2015 +++ src/sys/dev/pci/hdaudio/hdaudio_pci.c Fri May 12 04:59:12 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio_pci.c,v 1.12.4.2 2015/07/17 04:44:41 snj Exp $ */ +/* $NetBSD: hdaudio_pci.c,v 1.12.4.3 2017/05/12 04:59:12 snj Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd@@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.12.4.2 2015/07/17 04:44:41 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.12.4.3 2017/05/12 04:59:12 snj Exp $"); #include #include @@ -156,9 +156,6 @@ hdaudio_pci_attach(device_t parent, devi } aprint_normal_dev(self, "interrupting at %s\n", intrstr); - if (!pmf_device_register(self, NULL, hdaudio_pci_resume)) - aprint_error_dev(self, "couldn't establish power handler\n"); - hdaudio_pci_reinit(sc); /* Attach bus-independent HD audio layer */ @@ -172,8 +169,11 @@ hdaudio_pci_attach(device_t parent, devi csr = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG); csr &= ~(PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_BACKTOBACK_ENABLE); pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG, csr); - pmf_device_deregister(self); + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish power handler\n"); } + else if (!pmf_device_register(self, NULL, hdaudio_pci_resume)) + aprint_error_dev(self, "couldn't establish power handler\n"); } static int
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: snj Date: Fri May 12 04:59:12 UTC 2017 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdaudio_pci.c Log Message: Pull up following revision(s) (requested by khorben in ticket #1369): sys/dev/pci/hdaudio/hdaudio_pci.c: patch based on revision 1.6 of sys/dev/pci/hdaudio_pci.c Always allow hdaudio(4) to suspend Sometimes hdaudio(4) can fail to attach, but the device remains in the tree. Even though the PMF registration is performed, it is explicitly de-registered in the code path for errors - therefore preventing suspending later. This patch makes sure PMF registration is performed accordingly upon errors as well. No objection on tech-kern@. Tested on a Lenovo ThinkPad T440s (amd64). To generate a diff of this commit: cvs rdiff -u -r1.12.4.2 -r1.12.4.3 src/sys/dev/pci/hdaudio/hdaudio_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: riz Date: Wed Nov 4 20:55:48 UTC 2015 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdaudio.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #898): sys/dev/pci/hdaudio/hdaudio.c: revision 1.2 Initialize dma.dma_sizereg to avoid copying uninitialized data later. This field is not actually used here -- not clear it should be in the hdaudio_dma structure at all. Noted by Coverity, CID 979553. To generate a diff of this commit: cvs rdiff -u -r1.22.2.1 -r1.22.2.2 src/sys/dev/pci/hdaudio/hdaudio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/hdaudio/hdaudio.c diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.22.2.1 src/sys/dev/pci/hdaudio/hdaudio.c:1.22.2.2 --- src/sys/dev/pci/hdaudio/hdaudio.c:1.22.2.1 Fri Sep 4 15:07:08 2015 +++ src/sys/dev/pci/hdaudio/hdaudio.c Wed Nov 4 20:55:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio.c,v 1.22.2.1 2015/09/04 15:07:08 martin Exp $ */ +/* $NetBSD: hdaudio.c,v 1.22.2.2 2015/11/04 20:55:48 riz Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd@@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.22.2.1 2015/09/04 15:07:08 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.22.2.2 2015/11/04 20:55:48 riz Exp $"); #include #include @@ -1027,6 +1027,7 @@ hdaudio_stream_establish(struct hdaudio_ int i, err; dma.dma_size = sizeof(struct hdaudio_bdl_entry) * HDAUDIO_BDL_MAX; + dma.dma_sizereg = 0; err = hdaudio_dma_alloc(sc, , BUS_DMA_COHERENT | BUS_DMA_NOCACHE); if (err) return NULL;
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: martin Date: Fri Sep 4 15:07:08 UTC 2015 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdafg.c hdaudio.c hdaudiovar.h Log Message: Pull up following revision(s) (requested by tsutsui in ticket #963): sys/dev/pci/hdaudio/hdafg.c: revision 1.26 sys/dev/pci/hdaudio/hdaudiovar.h: revision 1.10 sys/dev/pci/hdaudio/hdaudio.c: revision 1.25 Fix locking against myself problem: hdaudio_intr() -> mutex_enter(>sc_corb_mtx); hdaudio_rirb_dequeue() -> hdaudio_rirb_unsol() -> hdafg_unsol() -> hdafg_assoc_dump_dd() -> hdaudio_command() -> mutex_enter(>sc_corb_mtx); Should that be done differently? To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.2.1 src/sys/dev/pci/hdaudio/hdafg.c cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/dev/pci/hdaudio/hdaudio.c cvs rdiff -u -r1.9 -r1.9.30.1 src/sys/dev/pci/hdaudio/hdaudiovar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/hdaudio/hdafg.c diff -u src/sys/dev/pci/hdaudio/hdafg.c:1.21 src/sys/dev/pci/hdaudio/hdafg.c:1.21.2.1 --- src/sys/dev/pci/hdaudio/hdafg.c:1.21 Fri May 23 13:57:04 2014 +++ src/sys/dev/pci/hdaudio/hdafg.c Fri Sep 4 15:07:08 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: hdafg.c,v 1.21 2014/05/23 13:57:04 msaitoh Exp $ */ +/* $NetBSD: hdafg.c,v 1.21.2.1 2015/09/04 15:07:08 martin Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd@@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21 2014/05/23 13:57:04 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21.2.1 2015/09/04 15:07:08 martin Exp $"); #include #include @@ -834,21 +834,24 @@ hdafg_assoc_type_string(struct hdaudio_a } static void -hdafg_assoc_dump_dd(struct hdafg_softc *sc, struct hdaudio_assoc *as, int pin) +hdafg_assoc_dump_dd(struct hdafg_softc *sc, struct hdaudio_assoc *as, int pin, + int lock) { struct hdafg_dd_info hdi; struct hdaudio_widget *w; uint8_t elddata[256]; unsigned int elddatalen = 0, i; uint32_t res; + uint32_t (*cmd)(struct hdaudio_codec *, int, uint32_t, uint32_t) = + lock ? hdaudio_command : hdaudio_command_unlocked; w = hdafg_widget_lookup(sc, as->as_pins[pin]); if (w->w_pin.cap & COP_PINCAP_TRIGGER_REQD) { - hdaudio_command(sc->sc_codec, as->as_pins[pin], + (*cmd)(sc->sc_codec, as->as_pins[pin], CORB_SET_PIN_SENSE, 0); } - res = hdaudio_command(sc->sc_codec, as->as_pins[pin], + res = (*cmd)(sc->sc_codec, as->as_pins[pin], CORB_GET_PIN_SENSE, 0); #ifdef HDAFG_HDMI_DEBUG @@ -862,13 +865,13 @@ hdafg_assoc_dump_dd(struct hdafg_softc * if ((res & (COP_GET_PIN_SENSE_PRESENSE_DETECT|COP_GET_PIN_SENSE_ELD_VALID)) == (COP_GET_PIN_SENSE_PRESENSE_DETECT|COP_GET_PIN_SENSE_ELD_VALID)) { - res = hdaudio_command(sc->sc_codec, as->as_pins[pin], + res = (*cmd)(sc->sc_codec, as->as_pins[pin], CORB_GET_HDMI_DIP_SIZE, COP_DIP_ELD_SIZE); elddatalen = COP_DIP_BUFFER_SIZE(res); if (elddatalen == 0) elddatalen = sizeof(elddata); /* paranoid */ for (i = 0; i < elddatalen; i++) { - res = hdaudio_command(sc->sc_codec, as->as_pins[pin], + res = (*cmd)(sc->sc_codec, as->as_pins[pin], CORB_GET_HDMI_ELD_DATA, i); if (!(res & COP_ELD_VALID)) { hda_error(sc, "bad ELD size (%u/%u)\n", @@ -1087,7 +1090,7 @@ hdafg_assoc_dump(struct hdafg_softc *sc) for (j = 0; j < HDAUDIO_MAXPINS; j++) { if (as[i].as_pins[j] == 0) continue; -hdafg_assoc_dump_dd(sc, [i], j); +hdafg_assoc_dump_dd(sc, [i], j, 1); } } } @@ -4264,7 +4267,7 @@ hdafg_unsol(device_t self, uint8_t tag) for (j = 0; j < HDAUDIO_MAXPINS; j++) { if (as[i].as_pins[j] == 0) continue; -hdafg_assoc_dump_dd(sc, [i], j); +hdafg_assoc_dump_dd(sc, [i], j, 0); } } break; Index: src/sys/dev/pci/hdaudio/hdaudio.c diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.22 src/sys/dev/pci/hdaudio/hdaudio.c:1.22.2.1 --- src/sys/dev/pci/hdaudio/hdaudio.c:1.22 Fri Jul 25 08:10:38 2014 +++ src/sys/dev/pci/hdaudio/hdaudio.c Fri Sep 4 15:07:08 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio.c,v 1.22 2014/07/25 08:10:38 dholland Exp $ */ +/* $NetBSD: hdaudio.c,v 1.22.2.1 2015/09/04 15:07:08 martin Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.22 2014/07/25 08:10:38 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.22.2.1 2015/09/04 15:07:08 martin Exp $"); #include #include @@ -326,15 +326,25 @@ uint32_t hdaudio_command(struct hdaudio_codec *co, int nid, uint32_t control, uint32_t param) { + uint32_t result; + struct hdaudio_softc *sc = co->co_host; +
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: martin Date: Fri Sep 4 15:07:08 UTC 2015 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdafg.c hdaudio.c hdaudiovar.h Log Message: Pull up following revision(s) (requested by tsutsui in ticket #963): sys/dev/pci/hdaudio/hdafg.c: revision 1.26 sys/dev/pci/hdaudio/hdaudiovar.h: revision 1.10 sys/dev/pci/hdaudio/hdaudio.c: revision 1.25 Fix locking against myself problem: hdaudio_intr() -> mutex_enter(>sc_corb_mtx); hdaudio_rirb_dequeue() -> hdaudio_rirb_unsol() -> hdafg_unsol() -> hdafg_assoc_dump_dd() -> hdaudio_command() -> mutex_enter(>sc_corb_mtx); Should that be done differently? To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.2.1 src/sys/dev/pci/hdaudio/hdafg.c cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/dev/pci/hdaudio/hdaudio.c cvs rdiff -u -r1.9 -r1.9.30.1 src/sys/dev/pci/hdaudio/hdaudiovar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: snj Date: Fri Jul 17 04:44:42 UTC 2015 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdaudio_pci.c Log Message: Apply patch (requested by nonaka in ticket #881): Deregister pmf hook when attach failed. To generate a diff of this commit: cvs rdiff -u -r1.12.4.1 -r1.12.4.2 src/sys/dev/pci/hdaudio/hdaudio_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/hdaudio/hdaudio_pci.c diff -u src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12.4.1 src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12.4.2 --- src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12.4.1 Thu Oct 30 10:36:52 2014 +++ src/sys/dev/pci/hdaudio/hdaudio_pci.c Fri Jul 17 04:44:41 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio_pci.c,v 1.12.4.1 2014/10/30 10:36:52 martin Exp $ */ +/* $NetBSD: hdaudio_pci.c,v 1.12.4.2 2015/07/17 04:44:41 snj Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: hdaudio_pci.c,v 1.12.4.1 2014/10/30 10:36:52 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: hdaudio_pci.c,v 1.12.4.2 2015/07/17 04:44:41 snj Exp $); #include sys/types.h #include sys/param.h @@ -172,6 +172,7 @@ hdaudio_pci_attach(device_t parent, devi csr = pci_conf_read(sc-sc_pc, sc-sc_tag, PCI_COMMAND_STATUS_REG); csr = ~(PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_BACKTOBACK_ENABLE); pci_conf_write(sc-sc_pc, sc-sc_tag, PCI_COMMAND_STATUS_REG, csr); + pmf_device_deregister(self); } }
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: snj Date: Fri Jul 17 04:44:42 UTC 2015 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdaudio_pci.c Log Message: Apply patch (requested by nonaka in ticket #881): Deregister pmf hook when attach failed. To generate a diff of this commit: cvs rdiff -u -r1.12.4.1 -r1.12.4.2 src/sys/dev/pci/hdaudio/hdaudio_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: martin Date: Thu Oct 30 10:36:52 UTC 2014 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdaudio_pci.c Log Message: Pull up following revision(s) (requested by nonaka in ticket #162): sys/dev/pci/hdaudio/hdaudio_pci.c: revision 1.13 disestalish interrupt and unmap register when attach failed. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.12.4.1 src/sys/dev/pci/hdaudio/hdaudio_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/hdaudio/hdaudio_pci.c diff -u src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12 src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12.4.1 --- src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.12 Sat Mar 29 19:28:25 2014 +++ src/sys/dev/pci/hdaudio/hdaudio_pci.c Thu Oct 30 10:36:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio_pci.c,v 1.12 2014/03/29 19:28:25 christos Exp $ */ +/* $NetBSD: hdaudio_pci.c,v 1.12.4.1 2014/10/30 10:36:52 martin Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: hdaudio_pci.c,v 1.12 2014/03/29 19:28:25 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: hdaudio_pci.c,v 1.12.4.1 2014/10/30 10:36:52 martin Exp $); #include sys/types.h #include sys/param.h @@ -162,7 +162,17 @@ hdaudio_pci_attach(device_t parent, devi hdaudio_pci_reinit(sc); /* Attach bus-independent HD audio layer */ - hdaudio_attach(self, sc-sc_hdaudio); + if (hdaudio_attach(self, sc-sc_hdaudio)) { + pci_intr_disestablish(sc-sc_pc, sc-sc_ih); + sc-sc_ih = NULL; + bus_space_unmap(sc-sc_hdaudio.sc_memt, +sc-sc_hdaudio.sc_memh, +sc-sc_hdaudio.sc_memsize); + sc-sc_hdaudio.sc_memvalid = false; + csr = pci_conf_read(sc-sc_pc, sc-sc_tag, PCI_COMMAND_STATUS_REG); + csr = ~(PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_BACKTOBACK_ENABLE); + pci_conf_write(sc-sc_pc, sc-sc_tag, PCI_COMMAND_STATUS_REG, csr); + } } static int
CVS commit: [netbsd-7] src/sys/dev/pci/hdaudio
Module Name:src Committed By: martin Date: Thu Oct 30 10:36:52 UTC 2014 Modified Files: src/sys/dev/pci/hdaudio [netbsd-7]: hdaudio_pci.c Log Message: Pull up following revision(s) (requested by nonaka in ticket #162): sys/dev/pci/hdaudio/hdaudio_pci.c: revision 1.13 disestalish interrupt and unmap register when attach failed. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.12.4.1 src/sys/dev/pci/hdaudio/hdaudio_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.