From owner-dev-commits-src-main@freebsd.org Thu Jan 21 19:30:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B7674DD8D1; Thu, 21 Jan 2021 19:30:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DMCD432ylz4nSt; Thu, 21 Jan 2021 19:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD6DA11A70; Thu, 21 Jan 2021 19:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10LJUgu4068819; Thu, 21 Jan 2021 19:30:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10LJUg2o068818; Thu, 21 Jan 2021 19:30:42 GMT (envelope-from git) Date: Thu, 21 Jan 2021 19:30:42 GMT Message-Id: <202101211930.10LJUg2o068818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: aa37baf3d7cf - main - Define PNP info after defining driver modules MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa37baf3d7cf51da92fd367476182802e71838ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2021 19:30:45 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aa37baf3d7cf51da92fd367476182802e71838ae commit aa37baf3d7cf51da92fd367476182802e71838ae Author: Mark Johnston AuthorDate: 2021-01-21 19:30:18 +0000 Commit: Mark Johnston CommitDate: 2021-01-21 19:30:18 +0000 Define PNP info after defining driver modules PNP info definitions currently have an unfortunate requirement in that they must follow the associated module definition in the module metadata linker set. Otherwise devmatch can segfault while processing the linker hints file since kldxref maintains the order in the linker set. A number of drivers violate this requirement. In some cases this can cause devmatch(8) to segfault when processing the linker hints file. Work around the problem for now simply by adjusting the drivers. Reviewed by: imp MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28260 --- sys/arm/ti/am335x/am335x_dmtpps.c | 2 +- sys/arm/ti/am335x/am335x_ehrpwm.c | 2 +- sys/dev/gpio/gpioiic.c | 8 ++++++-- sys/dev/gpio/gpiopps.c | 2 +- sys/dev/gpio/gpioths.c | 6 ++++-- sys/dev/iicbus/ads111x.c | 4 +++- sys/dev/iicbus/mux/iic_gpiomux.c | 8 ++++++-- sys/dev/iicbus/mux/ltc430x.c | 4 +--- sys/dev/iicbus/mux/pca9547.c | 2 +- sys/dev/ow/owc_gpiobus.c | 6 ++++-- sys/dev/pwm/pwmc.c | 6 +++--- 11 files changed, 31 insertions(+), 19 deletions(-) diff --git a/sys/arm/ti/am335x/am335x_dmtpps.c b/sys/arm/ti/am335x/am335x_dmtpps.c index 24d83f248eef..414800fd011e 100644 --- a/sys/arm/ti/am335x/am335x_dmtpps.c +++ b/sys/arm/ti/am335x/am335x_dmtpps.c @@ -96,7 +96,6 @@ static struct ofw_compat_data compat_data[] = { {"ti,am335x-timer-1ms", 1}, {NULL, 0}, }; -SIMPLEBUS_PNP_INFO(compat_data); /* * A table relating pad names to the hardware timer number they can be mux'd to. @@ -618,4 +617,5 @@ static driver_t dmtpps_driver = { static devclass_t dmtpps_devclass; DRIVER_MODULE(am335x_dmtpps, simplebus, dmtpps_driver, dmtpps_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); MODULE_DEPEND(am335x_dmtpps, ti_sysc, 1, 1, 1); diff --git a/sys/arm/ti/am335x/am335x_ehrpwm.c b/sys/arm/ti/am335x/am335x_ehrpwm.c index 619fdae2bcdb..6fd709d120e6 100644 --- a/sys/arm/ti/am335x/am335x_ehrpwm.c +++ b/sys/arm/ti/am335x/am335x_ehrpwm.c @@ -199,7 +199,6 @@ static struct ofw_compat_data compat_data[] = { {"ti,am33xx-ehrpwm", true}, {NULL, false}, }; -SIMPLEBUS_PNP_INFO(compat_data); static void am335x_ehrpwm_cfg_duty(struct am335x_ehrpwm_softc *sc, u_int chan, u_int duty) @@ -713,6 +712,7 @@ static driver_t am335x_ehrpwm_driver = { static devclass_t am335x_ehrpwm_devclass; DRIVER_MODULE(am335x_ehrpwm, am335x_pwmss, am335x_ehrpwm_driver, am335x_ehrpwm_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); MODULE_VERSION(am335x_ehrpwm, 1); MODULE_DEPEND(am335x_ehrpwm, am335x_pwmss, 1, 1, 1); MODULE_DEPEND(am335x_ehrpwm, pwmbus, 1, 1, 1); diff --git a/sys/dev/gpio/gpioiic.c b/sys/dev/gpio/gpioiic.c index 6d62a6d04d95..f387252098e2 100644 --- a/sys/dev/gpio/gpioiic.c +++ b/sys/dev/gpio/gpioiic.c @@ -65,8 +65,6 @@ static struct ofw_compat_data compat_data[] = { {"gpioiic", true}, /* Deprecated old freebsd compat string */ {NULL, false} }; -OFWBUS_PNP_INFO(compat_data); -SIMPLEBUS_PNP_INFO(compat_data); static phandle_t gpioiic_get_node(device_t bus, device_t dev) @@ -370,7 +368,13 @@ static driver_t gpioiic_driver = { }; DRIVER_MODULE(gpioiic, gpiobus, gpioiic_driver, gpioiic_devclass, 0, 0); +#ifdef FDT +OFWBUS_PNP_INFO(compat_data); +#endif DRIVER_MODULE(gpioiic, simplebus, gpioiic_driver, gpioiic_devclass, 0, 0); +#ifdef FDT +SIMPLEBUS_PNP_INFO(compat_data); +#endif DRIVER_MODULE(iicbb, gpioiic, iicbb_driver, iicbb_devclass, 0, 0); MODULE_DEPEND(gpioiic, iicbb, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER); MODULE_DEPEND(gpioiic, gpiobus, 1, 1, 1); diff --git a/sys/dev/gpio/gpiopps.c b/sys/dev/gpio/gpiopps.c index 8a6f1a6a3f6b..ea2644088c5d 100644 --- a/sys/dev/gpio/gpiopps.c +++ b/sys/dev/gpio/gpiopps.c @@ -47,7 +47,6 @@ static struct ofw_compat_data compat_data[] = { {"pps-gpio", 1}, {NULL, 0} }; -SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ static devclass_t pps_devclass; @@ -291,5 +290,6 @@ static driver_t pps_fdt_driver = { }; DRIVER_MODULE(gpiopps, simplebus, pps_fdt_driver, pps_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ diff --git a/sys/dev/gpio/gpioths.c b/sys/dev/gpio/gpioths.c index c08d772ddb9b..97831db881ae 100644 --- a/sys/dev/gpio/gpioths.c +++ b/sys/dev/gpio/gpioths.c @@ -72,8 +72,6 @@ static struct ofw_compat_data compat_data[] = { {"dht11", true}, {NULL, false} }; -OFWBUS_PNP_INFO(compat_data); -SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ #define PIN_IDX 0 /* Use the first/only configured pin. */ @@ -411,7 +409,11 @@ DEFINE_CLASS_0(gpioths, gpioths_driver, gpioths_methods, sizeof(struct gpioths_s #ifdef FDT DRIVER_MODULE(gpioths, simplebus, gpioths_driver, gpioths_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); #endif DRIVER_MODULE(gpioths, gpiobus, gpioths_driver, gpioths_devclass, 0, 0); +#ifdef FDT +OFWBUS_PNP_INFO(compat_data); +#endif MODULE_DEPEND(gpioths, gpiobus, 1, 1, 1); diff --git a/sys/dev/iicbus/ads111x.c b/sys/dev/iicbus/ads111x.c index 5d7057d99b91..0464de1800c0 100644 --- a/sys/dev/iicbus/ads111x.c +++ b/sys/dev/iicbus/ads111x.c @@ -152,7 +152,6 @@ static struct ofw_compat_data compat_data[] = { {"ti,ads1115", (uintptr_t)&ads111x_chip_infos[5]}, {NULL, (uintptr_t)NULL}, }; -IICBUS_FDT_PNP_INFO(compat_data); #endif struct ads111x_softc { @@ -609,5 +608,8 @@ static driver_t ads111x_driver = { static devclass_t ads111x_devclass; DRIVER_MODULE(ads111x, iicbus, ads111x_driver, ads111x_devclass, NULL, NULL); +#ifdef FDT +IICBUS_FDT_PNP_INFO(compat_data); +#endif MODULE_VERSION(ads111x, 1); MODULE_DEPEND(ads111x, iicbus, 1, 1, 1); diff --git a/sys/dev/iicbus/mux/iic_gpiomux.c b/sys/dev/iicbus/mux/iic_gpiomux.c index 8e064d84619d..9d34d21c6572 100644 --- a/sys/dev/iicbus/mux/iic_gpiomux.c +++ b/sys/dev/iicbus/mux/iic_gpiomux.c @@ -58,8 +58,6 @@ static struct ofw_compat_data compat_data[] = { {"i2c-mux-gpio", true}, {NULL, false} }; -OFWBUS_PNP_INFO(compat_data); -SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ #include @@ -255,7 +253,13 @@ static devclass_t gpiomux_devclass; DEFINE_CLASS_1(iic_gpiomux, iic_gpiomux_driver, gpiomux_methods, sizeof(struct gpiomux_softc), iicmux_driver); DRIVER_MODULE(iic_gpiomux, simplebus, iic_gpiomux_driver, gpiomux_devclass, 0, 0); +#ifdef FDT +SIMPLEBUS_PNP_INFO(compat_data); +#endif DRIVER_MODULE(iic_gpiomux, ofw_simplebus, iic_gpiomux_driver, gpiomux_devclass, 0, 0); +#ifdef FDT +OFWBUS_PNP_INFO(compat_data); +#endif #ifdef FDT DRIVER_MODULE(ofw_iicbus, iic_gpiomux, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); diff --git a/sys/dev/iicbus/mux/ltc430x.c b/sys/dev/iicbus/mux/ltc430x.c index fab791ed3174..77f1fafe6fe1 100644 --- a/sys/dev/iicbus/mux/ltc430x.c +++ b/sys/dev/iicbus/mux/ltc430x.c @@ -63,7 +63,6 @@ static struct ofw_compat_data compat_data[] = { {"lltc,ltc4306", CHIP_LTC4306}, {NULL, CHIP_NONE} }; -IICBUS_FDT_PNP_INFO(compat_data); #endif #include @@ -246,8 +245,8 @@ static devclass_t ltc430x_devclass; DEFINE_CLASS_1(ltc430x, ltc430x_driver, ltc430x_methods, sizeof(struct ltc430x_softc), iicmux_driver); DRIVER_MODULE(ltc430x, iicbus, ltc430x_driver, ltc430x_devclass, 0, 0); - #ifdef FDT +IICBUS_FDT_PNP_INFO(compat_data); DRIVER_MODULE(ofw_iicbus, ltc430x, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); #else DRIVER_MODULE(iicbus, ltc430x, iicbus_driver, iicbus_devclass, 0, 0); @@ -255,4 +254,3 @@ DRIVER_MODULE(iicbus, ltc430x, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(ltc430x, iicmux, 1, 1, 1); MODULE_DEPEND(ltc430x, iicbus, 1, 1, 1); - diff --git a/sys/dev/iicbus/mux/pca9547.c b/sys/dev/iicbus/mux/pca9547.c index ac57f26dbb04..2bdc6cb2e867 100644 --- a/sys/dev/iicbus/mux/pca9547.c +++ b/sys/dev/iicbus/mux/pca9547.c @@ -50,7 +50,6 @@ static struct ofw_compat_data compat_data[] = { {"nxp,pca9547", 1}, {NULL, 0} }; -IICBUS_FDT_PNP_INFO(compat_data); #include @@ -155,6 +154,7 @@ static devclass_t pca9547_devclass; DEFINE_CLASS_1(iicmux, pca9547_driver, pca9547_methods, sizeof(struct pca9547_softc), iicmux_driver); DRIVER_MODULE(pca_iicmux, iicbus, pca9547_driver, pca9547_devclass, 0, 0); +IICBUS_FDT_PNP_INFO(compat_data); DRIVER_MODULE(iicbus, iicmux, iicbus_driver, iicbus_devclass, 0, 0); DRIVER_MODULE(ofw_iicbus, iicmux, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); diff --git a/sys/dev/ow/owc_gpiobus.c b/sys/dev/ow/owc_gpiobus.c index 4b8b2ab6f99e..8ed73e10862b 100644 --- a/sys/dev/ow/owc_gpiobus.c +++ b/sys/dev/ow/owc_gpiobus.c @@ -49,8 +49,6 @@ static struct ofw_compat_data compat_data[] = { {"w1-gpio", true}, {NULL, false} }; -OFWBUS_PNP_INFO(compat_data); -SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ #define OW_PIN 0 @@ -394,9 +392,13 @@ static driver_t owc_gpiobus_driver = { #ifdef FDT DRIVER_MODULE(owc_gpiobus, simplebus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); #endif DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); +#ifdef FDT +OFWBUS_PNP_INFO(compat_data); +#endif MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); MODULE_VERSION(owc_gpiobus, 1); diff --git a/sys/dev/pwm/pwmc.c b/sys/dev/pwm/pwmc.c index c49d1e894488..b39460edc9c9 100644 --- a/sys/dev/pwm/pwmc.c +++ b/sys/dev/pwm/pwmc.c @@ -52,9 +52,6 @@ static struct ofw_compat_data compat_data[] = { {"freebsd,pwmc", true}, {NULL, false}, }; - -PWMBUS_FDT_PNP_INFO(compat_data); - #endif struct pwmc_softc { @@ -206,5 +203,8 @@ static driver_t pwmc_driver = { static devclass_t pwmc_devclass; DRIVER_MODULE(pwmc, pwmbus, pwmc_driver, pwmc_devclass, 0, 0); +#ifdef FDT +PWMBUS_FDT_PNP_INFO(compat_data); +#endif MODULE_DEPEND(pwmc, pwmbus, 1, 1, 1); MODULE_VERSION(pwmc, 1);