From nobody Fri Feb 24 17:23:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNcDk2dK9z3tkBk; Fri, 24 Feb 2023 17:23:34 +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 4PNcDk2D1Qz3FrL; Fri, 24 Feb 2023 17:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677259414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=22XpkrOMyfZSabHEeOZzrMvQc1ZhL3z815FCo0tFJ7A=; b=p1j3ApmbHbqQpMy+MLJmHOhnf8+iyU9CjhMZEulhpOKq1XrEyAzR3hak8CijRHD1czk0+f Rl+Xlu0sT/qeL3YV+xqplIxHwk1DRfP2+MwY/fKZ2wWGHCABhyv7npC25P7JeABsrCIDvM xejlouWUlNkFEesiTY7qRkcOKUu/f6VarBHkvpNvdOCGMSnb5PknMeh23rdDFxm7UpsIYZ yXsvVC47xb+UAFUT6pjl+e20Z39LHdX8E0hMqTbNDtFr+h5DB9gSPTCCgMpOGwPhvVLy6D UfytVIhJy1daxQDsFrJ1DsdyGZVb218WTS8xDZ6GbgWzBNp9D0F7g2TxQ3NPYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677259414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=22XpkrOMyfZSabHEeOZzrMvQc1ZhL3z815FCo0tFJ7A=; b=AtQhlfjAFWVd6fnwx6sPaWHRDvHPqIeosL/6zvTFeJhwvWn4XGgyRiK+Ob7DcuamdvA9mw Jkfc8+ntrLcMS90N7KUI3p5WzumUCRKqhftpNrfDgbNlDyFGoO4iqh01B+5laRoWmeBzQu LGlCXXX3/m48nHZG8nY2l3G2PUTRNzFo1Mek0VgvL+TzdZKZPkxFD7PU7omktcOfNS8GAB 1p3nN53D3zFFPYC9WYqK8Y01NZxQCWKQmvneHfZ+yjGZXRk8QuZplFDx+BrAH7kc4sUv6N 49Wuu1zsNGPWFgODPw2oSb7qyn1+ZHJxKCrQxpAuQspNcJKmhWRsdhW39eERlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677259414; a=rsa-sha256; cv=none; b=a3yuaA/Ba8P3E2r5AVAq/nE8FrA7N1nSbfYVhMOWb7DpKLWR1wm739h43sXKnEvVgHK22i q0BdyYCTHzh6CHOq9+kMTPd7nyMabCK6K5doTTDMoQL8LfFoKUWGQUcFpCr2MxlyZyu4fM /JQpnCNT2lwcD5f48+koZHrH0gbLXqh9jlvJhi2H8sOl+jomJxSyQzcKzP9FQngr1wgyWh 2x0iBpIzmPIs/MQcxzcnHtbfUosAOtxQt0051y3dvBH0Do/n0APlpzn6KzQkBc1iYHbA3z L9QdZ7Gw5Fw7r63JOPf1QjulgObOy1qy0Xh+pF99H0A8YRKr5hsglHgl4HJj3g== 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 4PNcDk1GCPzX8L; Fri, 24 Feb 2023 17:23:34 +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 31OHNYef092658; Fri, 24 Feb 2023 17:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OHNY0m092657; Fri, 24 Feb 2023 17:23:34 GMT (envelope-from git) Date: Fri, 24 Feb 2023 17:23:34 GMT Message-Id: <202302241723.31OHNY0m092657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 9873b1716970 - main - bcm_dma: attach at an earlier bus pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9873b171697033f9f19608d98bcd1c16cacb92af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9873b171697033f9f19608d98bcd1c16cacb92af commit 9873b171697033f9f19608d98bcd1c16cacb92af Author: Mark Millard AuthorDate: 2023-02-17 20:30:35 +0000 Commit: Mitchell Horne CommitDate: 2023-02-24 17:20:40 +0000 bcm_dma: attach at an earlier bus pass The sdhci_bcm driver attach routine relies on bcm_dma already being attached, in order to allocate a DMA channel. However, both drivers attached at the default pass so this is not guaranteed. Newer RPI firmware exposes this assumption, and the result is a NULL-dereference in bcm_dma_allocate(). To fix this, use BUS_PASS_SUPPORTDEV for bcm_dma. PR: 268835 Reviewed by: mhorne MFC after: 1 week --- sys/arm/broadcom/bcm2835/bcm2835_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c b/sys/arm/broadcom/bcm2835/bcm2835_dma.c index 5f9ecb0b7981..49a3938282a2 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c @@ -764,5 +764,6 @@ static driver_t bcm_dma_driver = { sizeof(struct bcm_dma_softc), }; -DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0); +EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0, + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(bcm_dma, 1);