From nobody Wed Feb 14 22:52:41 2024 X-Original-To: dev-commits-src-main@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 4TZtkf0pJTz53xNY; Wed, 14 Feb 2024 22:52:42 +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 4TZtkd5tdnz4FDM; Wed, 14 Feb 2024 22:52:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707951161; 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=8cvhIOjOc22FHUKNgZGDgT58OQ+Al+ZW0iwmr68Qb0A=; b=UstA99eVtY6EvdCbeFVZowBa1aXvsE5nrmRF8pGnZilwOickjkDOirR5Tiu/EblSavWJjf 18wOwXV4fyffuIlvlyA4HgliIPyrNfhA40FtVlql86x9vtayqjmrE5Vhk67r5ECeWgR2lv 7QvG2qXAHJHudNORF71EIKoMTUiBIYbo0+Sz3E3WD1fE9BtdC+3LJygUrxG8HjRvq/Rm22 CYL6hIGcZS+klVGeuxo7HwUG7QTjISKtLEGuUNowZ6OyOrnSyEcXXyP60z8rexaJNcocnv 4t+c658DaLrY4LqGbIIWq+Q5jgdDpIiifDWJcBxHEerdk60SADeh3dZ3+CcsFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707951161; a=rsa-sha256; cv=none; b=rO/iNFIYTe6vT20QNPAd4A3+OZHX7tGYLIT5DaUwVE04Tr8ho8WEK3RNlDIsE0jhTVzEoj efJuNwBPz1tk4HugVmgUddqpufQQ6JK+jhOtqhXj5r41gtYep6toTBPw4yGQAwEXIEYmIl ekB4XMCPlliR2MV/9moZO8Qnf/b9B6iJKV1yszLNwbkTGCeGZZ0IHDtKyHxrZvnqGl6bZs I51gaWNRzmAvvzZBevyMJuIGld1q2LUFJZlBv+rJTBTcCMMW7V67JjmCKl62teZ2G6Sj+a YCUlvQ4cHRc65hNCL1op6HZ2ftGzrCQVazlbsGHps95QKJLV3ZKbQtRyqKLEGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707951161; 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=8cvhIOjOc22FHUKNgZGDgT58OQ+Al+ZW0iwmr68Qb0A=; b=AMnoXKEottF58ths1K5OITzTtTfQGBM4s8KRejfTr0T+hsi2pRXObh0d4ioTFxwvuWurbk fMelGBOWVI0orV4VS3b+W/wu5ik3pB7cZpkMfcbOcz5A23n4lpSnUelzhfAY1dUGBVjAc7 95pfJqL6slYKbpkclVq3TR1VepbW5Z5omop03EpU0JFVRlFU4TvTChegt4erDjpHzvzw6b Z0e94Rvf/LR1/05fzxTLvGeEtRifqUu356cSfU4HHQEelXTg8Ig0H+ynU3iD7qTaqMoXws RF98KXCo0NUBUxZMRdvYH/0+IjlbQdUFFvwliD9uOan3T2wDItPnSyT9My3hWw== 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 4TZtkd4hlZzH7w; Wed, 14 Feb 2024 22:52:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41EMqfPq086226; Wed, 14 Feb 2024 22:52:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41EMqfNj086223; Wed, 14 Feb 2024 22:52:41 GMT (envelope-from git) Date: Wed, 14 Feb 2024 22:52:41 GMT Message-Id: <202402142252.41EMqfNj086223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 51f8ac224f3b - main - pci_host_generic: Include the bridge's device name in rman descriptions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51f8ac224f3b87555ea17c7e7c4015a2a2b8b191 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=51f8ac224f3b87555ea17c7e7c4015a2a2b8b191 commit 51f8ac224f3b87555ea17c7e7c4015a2a2b8b191 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-02-14 22:07:32 +0000 pci_host_generic: Include the bridge's device name in rman descriptions The rman description strings now match those used in the PCI-PCI bridge driver. Using more specific names removes ambiguity in devinfo -u output on systems with multiple host to PCI bridges. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43890 --- sys/dev/pci/pci_host_generic.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 43b6d26e9217..02ca010a14d7 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -83,6 +83,7 @@ pci_host_generic_core_attach(device_t dev) uint64_t phys_base; uint64_t pci_base; uint64_t size; + char buf[64]; int domain, error; int rid, tuple; @@ -135,13 +136,19 @@ pci_host_generic_core_attach(device_t dev) sc->has_pmem = false; sc->pmem_rman.rm_type = RMAN_ARRAY; - sc->pmem_rman.rm_descr = "PCIe Prefetch Memory"; + snprintf(buf, sizeof(buf), "%s prefetch window", + device_get_nameunit(dev)); + sc->pmem_rman.rm_descr = strdup(buf, M_DEVBUF); sc->mem_rman.rm_type = RMAN_ARRAY; - sc->mem_rman.rm_descr = "PCIe Memory"; + snprintf(buf, sizeof(buf), "%s memory window", + device_get_nameunit(dev)); + sc->mem_rman.rm_descr = strdup(buf, M_DEVBUF); sc->io_rman.rm_type = RMAN_ARRAY; - sc->io_rman.rm_descr = "PCIe IO window"; + snprintf(buf, sizeof(buf), "%s I/O port window", + device_get_nameunit(dev)); + sc->io_rman.rm_descr = strdup(buf, M_DEVBUF); /* Initialize rman and allocate memory regions */ error = rman_init(&sc->pmem_rman); @@ -201,6 +208,9 @@ err_io_rman: err_mem_rman: rman_fini(&sc->pmem_rman); err_pmem_rman: + free(__DECONST(char *, sc->io_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->mem_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->pmem_rman.rm_descr), M_DEVBUF); if (sc->res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); err_resource: @@ -223,6 +233,9 @@ pci_host_generic_core_detach(device_t dev) rman_fini(&sc->io_rman); rman_fini(&sc->mem_rman); rman_fini(&sc->pmem_rman); + free(__DECONST(char *, sc->io_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->mem_rman.rm_descr), M_DEVBUF); + free(__DECONST(char *, sc->pmem_rman.rm_descr), M_DEVBUF); if (sc->res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); bus_dma_tag_destroy(sc->dmat);