From nobody Mon Sep 11 09:50:39 2023 X-Original-To: bugs@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 4RkhmJ1h45z4slkN for ; Mon, 11 Sep 2023 09:50:40 +0000 (UTC) (envelope-from bugzilla-noreply@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 4RkhmJ0f8bz4Whr for ; Mon, 11 Sep 2023 09:50:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694425840; a=rsa-sha256; cv=none; b=hXrUwbKQfnOb4pjg5q2ZhJMgpe+W9iZiONxm7LDTJx1ZfoNtVTzgnerCtuVX4GMXCmjHwo mOGuH4LxiMpkZ63hiOgja7WPhb4LNe6OaYSgf7MbnJQA2HX54oR8SwQWyVk2F/Ua9THfcd fuEiSo4qnHUpgUG+BCVM0bLFVi7hU4kz+vT9qlvnumTm9bOvd7eGFmgVhQwIHU2jAeYRX4 6yzaPiH0WtC2npMkvHBN4lWkyI1EoJb9y4NU7vGctif9bKpNTKTz9c7Pa2SyW2Z3IKjFs2 6GV2lroEmWV+44s51o8HtoT3o61FFfqOyUV1fbXuHfhTM9m1cdURHSuz2psXJg== 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=1694425840; 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: in-reply-to:in-reply-to:references:references; bh=n8NYYuS4NDjIdV01lSbvZnLM89F0FwNNpYSy1b/9NlM=; b=dsHoSsoAZtt/qvsfLFd1RCMaRr4L33x414Y8WWnEIAXTn92cEwNVEo4Yz9EsulmVaGFbeq 0LKJN3qwJ+vNq3xWwSfuwecJnogZWpzxxgoKDX6zRYbDnluCycj2QFLJaODxa9q1nuwILr b+5TI/R9I6hmgeiG3piNt0lHRsA52/9sdxi6ezdJ+AdCj2N//2WZVy5vy9ocBqwJcrTG1y XS35WvEjLiX19XjSyIC7NgoKACzs39Ulcs5+Ux8oBlfKlxnDG8HAmlSj+b4Jp+bsfePKbI fTr72J8b/5FGDplOiCefwYmz8WRGXGRnpIzEebfIyG0V5MDQ6+OfMqCYsaI29w== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4RkhmH6p1bzkyC for ; Mon, 11 Sep 2023 09:50:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38B9odJW045161 for ; Mon, 11 Sep 2023 09:50:39 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38B9od9B045160 for bugs@FreeBSD.org; Mon, 11 Sep 2023 09:50:39 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 273263] isp(4): 32Gbit Qlogic cards do not work Date: Mon, 11 Sep 2023 09:50:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: Joerg.Pulz@frm2.tum.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273263 --- Comment #5 from Joerg Pulz --- I kind of solved this or at least found a solution how to work around this issue. Also I know now why this all happened at all. Some background: The 27xx and 28xx based controllers feature two firmware images in flash, a primary and a secondary one. While the 27xx based controllers still share some amount of information bet= ween both firmware images (e.g. NVRAM, NVMe parameters, ...) the 28xx based controllers even have separate areas for those. In penguin land the driver knows and handles this correctly as firmware loa= ding there is somewhat different compared to ours. We just send a MBOX command the get the controller do some magic stuff to l= oad the firmware from flash without ever thinking about primary/secondary firmw= are images. This is working quite well if either - primary/secondary firmware versions in flash are equal or=20 - the primary firmware image is set as active. The penguin driver is very different in this area as it checks for valid primary/secondary firmware images and detects which one is the active one. Firmware loading is done by reading the active firmware directly from flash= and writing it into the controllers RAM. Depending on the active firmware the correct NVRAM (and other) areas are used too. With all this in mind, back to the original PR: Arne Steinkamm kindly provided two controllers out of a random system to me. The first one had RISC firmware 8.8.231 in the primary and no firmware at a= ll in the secondary flash area (verified with the vendors firmware flash utili= ty). This controller was detected and initialized without problems. The second controller was shown with firmware 9.8.2 in UEFI but our driver reported 8.8.231 and initialization failed - as reported here. After looking at this controller with the vendors firmware flash utility (t= ried the EFI and the Linux one) it turns out that there was firmware 8.8.231 in = the primary and 9.8.2 in the secondary area. The secondary area was marked acti= ve. Both Lenovo branded controllers where sold in this state, so it seems one c= an't trust that newly sold controllers are working out of the box. I got the most recent firmware update package from Marvell/QLogic only to f= ind out that the Lenovo branded controllers can't be flashed with this one. Luckily I was able to find a Lenovo firmware update package for Windows that contained the firmware as a separate file usable with the vendors EFI and L= inux flash utility. This was exactly the RISC firmware version 9.8.2 that already was in the second controllers secondary firmware area. After flashing the card, it showed RISC firmware version 9.8.2 in the prima= ry area and the primary area activated. Starting FreeBSD the driver reported firmware 9.8.2 and initialization was successful. Only for testing I flashed the firmware again what resulted in both firmware regions containing the same version but the secondary area active. In this state the driver again reported firmware 9.8.2 and initialization w= as successful. For verification I took the first controller with no secondary firmware at = all and flashed this one resulting in primary firmware 8.8.231 secondary firmwa= re 9.8.2 and secondary firmware active. In this state I instantly got the same initialization error like with the second card before and reported here. After flashing this controller a second time (primary and secondary at vers= ion 9.8.2 with primary active) everything was fine and working again. As a side note: I found no way to change the active firmware image without flashing (neither the EFI nor the Linux flash utility provides an option for this). This puts the whole concept of two firmware images in question. I provided all this with the required firmware and flash utility files with some documentation to Arne Steinkamm. With those he was able to get another machine with previously failing controllers to work correctly. Final advise for isp(4) with 27xx and 28xx based controllers: To work around the shortcomings of handling primary/secondary firmware imag= es correctly, one has to make sure that either: 1. the primary firmware is active or 2. the primary and secondary firmware contain the same version, regardless which one is active. This alone makes the controllers work but the second option is problematic = with 28xx based ones where NVRAM and so on is specific to the activated firmware. So to be on the really safe side, either use option one or make sure primary and secondary firmware are the same and primary is active for the time bein= g. One can use either the Marvell/QLogic EFI (preferred) or Linux utility to verify or achieve this. If firmware flashing is required, one could try to = use the vendors native firmware or has to use specific firmware from his hardwa= re vendor (e.g. Lenovo, Dell, ...). This whole situation should be documented in the BUGS section of the isp(4) manpage for all supported FreeBSD versions (at least CURRENT, 14-STABLE and 13-STABLE) that support at least 27xx based controllers. --=20 You are receiving this mail because: You are the assignee for the bug.=