From nobody Fri May 10 02:17:14 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 4VbCFR0dKjz5KZ56; Fri, 10 May 2024 02:17:15 +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 4VbCFQ752Bz4Rtw; Fri, 10 May 2024 02:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715307435; 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=iz1+OgaO8Q9o94QdyIYHjg4MpQNG/uneEBC8nbk/TRY=; b=XvjE77Icu6rvOKmw8w8jXgMcOUE3G30/yjR9UOrLV4dJWKKwIpXsmjyTe0ar+uUn+CAJDi VEY6/vU3rM8lG8Fa5Ktc1TSNrtwzlsXqMAk/3zMO2lByeyJbSeskInvPYnfAv+7xV9CtOE 5hFmnT5A7QAERNN3heQYRtl+8SWFvbTGx+xI7uvKCrE+1CngzzEbpBCnAtiOAm+G7j6vJv gX/eLa7cw8VtszrRHMrbdxicMfIY8DPhFod7pkUrsQU5D/YB5jzwUtcaqTrOaA4ucqJT6C qUFecN3Tnh25LJnkQbi5eUKgnXXnNADJXbvGzfeHa+AjYZWU9oqXHgLupmtr8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715307435; a=rsa-sha256; cv=none; b=qyCu+EUF2Ys/lq5QFv6WHysy2lv6jeiZUXoJ2BDngbGGrehpxMzUC0NSWaUKsiVJqHrjEb gVvtcj16Bx8MmEi9tnUYBUSbfUNsBAGyzObyksZqHOo8zN3Ibw7Ckbcfd+NSvjbhG29t4b d+g/UJywgoS/Wkn8lN3YtlknFh2v/OtlTxki+80gc3p2hU+7uPw/ZOXGt7IrEAhu4Q9mBl pU2hLNv6Y9jR3YcznNdw2gNsmEc0060tdtLR+OI2A++7ZYTWjtN3wLpHc/vh3xvLfLYBx9 r57MHGdawdqCriVXzhhDgIbJ8lq17g67bgMZBGS/K/1nT9viELWhtcKSfUn3TQ== 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=1715307435; 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=iz1+OgaO8Q9o94QdyIYHjg4MpQNG/uneEBC8nbk/TRY=; b=NoxMexuTXjEx3l/y1jdk0pvylzGyqNZBmD0ifo1EdcRCvynFtNOAk7kiO8ChW86lXFcE1j CKh7iJCwFhk6tJyCGLdAGyNAaSvloO4y2qtH4LQ7J5xfZf1t+SwWwkZ36FIWHc3sE9dX1s OQVp5gT0ooXLLAy8z9IY2cIqio4NtgpOt9hqPVkFIWJVIt94khT1BbvX35PaP8XPQePIch n5EOc5umgxjMSqO+QQSqpHX0NSkTxOPpegoyGWVfmbNQ7kQCYCdcUh0El/YyI4cRxGO0xP aFD8W3QPfiH8/cztjXjQ2o/tc0xJ8Hb5KikSHQ+n6AsMsmUFirdnCeT9Vdt5Kg== 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 4VbCFQ6Z7rzJNc; Fri, 10 May 2024 02:17:14 +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 44A2HEG8051911; Fri, 10 May 2024 02:17:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A2HEJv051908; Fri, 10 May 2024 02:17:14 GMT (envelope-from git) Date: Fri, 10 May 2024 02:17:14 GMT Message-Id: <202405100217.44A2HEJv051908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c733dc7a6f86 - main - ahc(4): Default to memory mapped IO 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c733dc7a6f866eeae0ac7762e6f1dee22e24c4d3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c733dc7a6f866eeae0ac7762e6f1dee22e24c4d3 commit c733dc7a6f866eeae0ac7762e6f1dee22e24c4d3 Author: HP van Braam AuthorDate: 2024-05-10 02:13:03 +0000 Commit: Warner Losh CommitDate: 2024-05-10 02:15:08 +0000 ahc(4): Default to memory mapped IO When this driver was written it made sense to make this default to off, but these days almost all BIOSses will do the right thing. Furthermore non-mmio communication only works on Intel architectures. So lets default to allowing mmio, but not change the semantics of the AHC_ALLOW_MEMIO flag to not break existing installs. Also document the already existing hint.ahc..allow_memio. Signed-off-by: HP van Braam Reviewed by: imp (small style tweak) Pull Request: https://github.com/freebsd/freebsd-src/pull/1219 --- share/man/man4/ahc.4 | 13 +++++++++---- sys/dev/aic7xxx/ahc_pci.c | 12 ++++++------ sys/powerpc/conf/GENERIC | 1 - sys/powerpc/conf/GENERIC64 | 1 - sys/powerpc/conf/GENERIC64LE | 1 - 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/share/man/man4/ahc.4 b/share/man/man4/ahc.4 index 7d5e092089bb..582b34fe2071 100644 --- a/share/man/man4/ahc.4 +++ b/share/man/man4/ahc.4 @@ -131,7 +131,7 @@ target on multiple SCSI IDs. .Pp To allow PCI adapters to use memory mapped I/O if enabled: .Pp -.Cd options AHC_ALLOW_MEMIO +.Cd options AHC_ALLOW_MEMIO=(0 -- disabled, 1 -- enabled) .Bd -ragged -offset indent Memory mapped I/O is more efficient than the alternative, programmed I/O. Most PCI BIOSes will map devices so that either technique for communicating @@ -141,12 +141,13 @@ the chip for memory mapped I/O. The typical symptom of this problem is a system hang if memory mapped I/O is attempted. .Pp Most modern motherboards perform the initialization correctly and work fine -with this option enabled. +with this option enabled and it is the default. This option can also be +dynamically configued through a device hint documented below. .Ed .Pp To statically configure one or more controllers to assume the target role: .Pp -.Cd options AHC_TMODE_ENABLE +.Cd options AHC_TMODE_ENABLE= .Bd -ragged -offset indent The value assigned to this option should be a bitmap of all units where target mode is desired. For example, a value of 0x25, would enable target mode on @@ -163,7 +164,11 @@ The following options are switchable by setting values in They are: .Bl -tag -width indent .It Va hint.ahc. Ns Ar N Ns Va .tmode_enable -A hint to define whether the SCSI target mode is enabled (0 -- disabled, 1 -- enabled). +A hint to define whether the SCSI target mode is enabled, defaults to disabled +(0 -- disabled, 1 -- enabled). +.It Va hint.ahc. Ns Ar N Ns Va .allow_memio +A hint to define whether memory mapped io is enabled or disabled for this +adapter, defaults to enabled (0 -- disabled, 1 -- enabled). .El .Ed .Sh HARDWARE diff --git a/sys/dev/aic7xxx/ahc_pci.c b/sys/dev/aic7xxx/ahc_pci.c index 1f9cd33f9e00..8109a6714814 100644 --- a/sys/dev/aic7xxx/ahc_pci.c +++ b/sys/dev/aic7xxx/ahc_pci.c @@ -138,7 +138,7 @@ ahc_pci_map_registers(struct ahc_softc *ahc) struct resource *regs; int regs_type; int regs_id; - int allow_memio; + int allow_memio = 1; regs = NULL; regs_type = 0; @@ -150,14 +150,14 @@ ahc_pci_map_registers(struct ahc_softc *ahc) "allow_memio", &allow_memio) != 0) { if (bootverbose) device_printf(ahc->dev_softc, "Defaulting to MEMIO "); -#ifdef AHC_ALLOW_MEMIO - if (bootverbose) - printf("on\n"); - allow_memio = 1; -#else +#if defined(AHC_ALLOW_MEMIO) && (AHC_ALLOW_MEMIO == 0) if (bootverbose) printf("off\n"); allow_memio = 0; +#else + if (bootverbose) + printf("on\n"); + allow_memio = 1; #endif } diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index 6083b4d2baca..dedaa931f4ef 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -119,7 +119,6 @@ device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahc # AHA2940 and onboard AIC7xxx devices -options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mpt # LSI-Logic MPT-Fusion diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 26b308a4e06e..2a5e3d377ab8 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -137,7 +137,6 @@ device nvd # expose NVMe namespaces as disks, depends on nvme # SCSI Controllers device aacraid # Adaptec by PMC RAID device ahc # AHA2940 and onboard AIC7xxx devices -options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 84c27690211d..63e10df90200 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -133,7 +133,6 @@ device nvd # expose NVMe namespaces as disks, depends on nvme # SCSI Controllers device aacraid # Adaptec by PMC RAID device ahc # AHA2940 and onboard AIC7xxx devices -options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s