From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794590200; b=tYh07FMzyF3tVvxCRCyLZuzoy9x7/3CN8Vh8RU6wZ79YflrdhK+1M6GKWqhBB4fXPnly aRR5lbfJwQxy0EqN76eH/uMziNWhsk9zSklEHnGDixKT7jsuMAxzn/i2pz+gNSMFLqUbV lZBH8+ZsyyQh0iGN4Y30NXU+yvVJbV1BxBaDZKiMKQSafoFb3OxUqJtccJ470JqJi4gLk RTw3M73diquD9hxcZzg5n9TBrMAg5kC1kHQTmK4yElQWr1a5wlBFsel+G77F0TAQ26vNt T1DqnR4xApyqP/kdfX9QbhkfIX38iPbRCbjx75VefJFqPiFoP9qb9RXzbBVxQu3GIJg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794590200; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=DSJyPgkVlezox3kFPA44nnme4N1Z5ZkHey8Ippo/DwQ=; b=exvuBAoCQZ5pTNK5ewaR645URrReaQ0pVjvxWNYiHIfGLFhHUSOSCShLaUDIc2SeU9YA +C0WIZSGTJqGuIx+YCL66C+hA6AyYLituyMX+aJg2hnCoX1j4XJGjKHNr+hHKceRrz0zY MCpGgx8fSozwkoRo8Qhpj8BJb23APTkUP20KPP9lYEJUOOvomwKs7BpO+ah6Nc/gfTGQY ajToUJ2HICiEoIWROjaLhPmSWTe6ZRXD05gVk6Fs5hnkWsQgTq/TNor5s4uTISeNzqknF +3U9txSd7YR3c19PlqrQAuBBADZyKyZ1a/D6Whjv2GAi5AwhIG3CiSxqXrceMRWQJPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=JJv7aAXD; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1137606B370; Fri, 13 Nov 2026 17:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=JJv7aAXD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74EA91F000C4; Fri, 13 Nov 2026 17:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794590199; bh=DSJyPgkVlezox3kFPA44nnme4N1Z5ZkHey8Ippo/DwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JJv7aAXDD95U03T9UjI3qH+w6dX2q83J2n9UkoZhSzlNmDfxzrzsUMDI2mKbqPUjU Oa8nL4MEmqiGcWqZKccD6thojJzWmKDEbDiPa5Hjmboq+4CrGisC0eDaCJBhHlMzbE DV+X9m2wmtne4C/bWe9z8w2rpy1WXeLYYOBCRdgk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Imre Kaloz , "Martin K. Petersen (Oracle)" , Sasha Levin Subject: [PATCH 6.18 205/686] scsi: aic7xxx: Use default settings on the SGI O2 onboard controllers Date: Fri, 13 Nov 2026 10:45:38 -0500 Message-ID: <20261113153827.988941087@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261113153820.902362109@linuxfoundation.org> References: <20261113153820.902362109@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Imre Kaloz [ Upstream commit 696bdfc58975fbc70d2e2347a74e0b562e7e2494 ] The SGI O2 firmware runs its onboard aic7880s without the Adaptec BIOS, so scratch RAM holds no settings. The left over BIOS path reads uninitialised bytes, and bad parity panics the boot. Use the defaults there with host ID 0. ahc_init() keeps the default host ID ahc_pci_config() chose, 7 on other PCI controllers, so only the O2 changes. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Imre Kaloz Link: https://patch.msgid.link/20261026131432.26065-1-kaloz@kernel.org Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin --- drivers/scsi/aic7xxx/aic7xxx_core.c | 8 ++++++-- drivers/scsi/aic7xxx/aic7xxx_pci.c | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index a396f048a031e..d747d0b72a13a 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -5266,9 +5266,13 @@ ahc_init(struct ahc_softc *ahc) /* * Assume we have a board at this stage and it has been reset. + * PCI controllers keep the host ID ahc_pci_config() chose. */ - if ((ahc->flags & AHC_USEDEFAULTS) != 0) - ahc->our_id = ahc->our_id_b = 7; + if ((ahc->flags & AHC_USEDEFAULTS) != 0) { + if ((ahc->chip & AHC_PCI) == 0) + ahc->our_id = 7; + ahc->our_id_b = 7; + } /* * Default to allowing initiator operations. diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c index 2d4c85426dc3e..5a04c7d55e4b5 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c @@ -701,6 +701,21 @@ ahc_find_pci_device(ahc_dev_softc_t pci) return (NULL); } +/* + * The SGI O2 firmware runs its onboard controllers, in slots 1 and 2 of the + * root bus, without the Adaptec BIOS and at host ID 0. It leaves no settings + * in scratch RAM, which may still hold power-on contents with bad parity. + */ +static bool +ahc_pci_sgi_o2_onboard(struct ahc_softc *ahc) +{ + int slot = ahc_get_pci_slot(ahc->dev_softc); + + return IS_ENABLED(CONFIG_SGI_IP32) && + ahc_get_pci_bus(ahc->dev_softc) == 0 && + (slot == 1 || slot == 2); +} + int ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) { @@ -782,6 +797,9 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) ahc->bus_intr = ahc_pci_intr; ahc->bus_chip_init = ahc_pci_chip_init; + if (ahc_pci_sgi_o2_onboard(ahc)) + ahc->flags |= AHC_NO_BIOS_INIT; + /* Remember how the card was setup in case there is no SEEPROM */ if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) { ahc_pause(ahc); @@ -898,7 +916,7 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry) * Assume only one connector and always turn * on termination. */ - our_id = 0x07; + our_id = ahc_pci_sgi_o2_onboard(ahc) ? 0 : 0x07; sxfrctl1 = STPWEN; } ahc_outb(ahc, SCSICONF, our_id|ENSPCHK|RESET_SCSI); -- 2.53.0