Article View: linux.kernel.netdev
Article #1004Re: [PATCH net-next] tg3: normalize inherited M3000 register byte order
From: Andrew Lunn
Date: Fri, 09 Oct 2026 01:13
Date: Fri, 09 Oct 2026 01:13
41 lines
7329 bytes
7329 bytes
On Fri, Oct 09, 2026 at 12:04:03AM +0200, Magnus Lindholm wrote:
> M3000 firmware can leave BCM5718 vendor registers byte-swapped while
> standard PCI fields retain normal byte order. Match the Fujitsu 10cf:165a
> subsystem, IKKAKU model and swapped revision/product signature before
> restoring host control; reject failed PCI accesses or register readbacks.
>
> Keep this in probe so failures can abort initialization; SPARC firmware
> enumeration skips PCI_FIXUP_EARLY. Normal rebinds and other platforms
> retain their existing path.
>
> Use tg3.h's MISC_HOST_CTRL_BYTE_SWAP and TG3PCI_GEN2_PRODID_ASICREV;
> the inherited state was observed on M3000 hardware.
>
> Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
> +/* M3000 firmware can leave the on-board BCM5718 registers byte-swapped. */
> +static bool tg3_is_m3000(struct pci_dev *pdev)
> +{
> + struct device_node *root;
> + const char *model;
> + bool match;
> +
> + if (pdev->vendor != PCI_VENDOR_ID_BROADCOM ||
> + pdev->device != TG3PCI_DEVICE_TIGON3_5718 ||
> + pdev->subsystem_vendor != 0x10cf ||
> + pdev->subsystem_device != 0x165a)
> + return false;
> +
> + root = of_find_node_by_path("/");
> + match = !of_property_read_string(root, "model", &model) &&
> + !strcmp(model, "IKKAKU");
The DT Maintainers generally don't like this.
Is there a legitimate reason you would want the bytes are swapped?
Can you not just probe the registers, and if they are swapped undo it?
Does it really need to be conditional on the machine?
Andrew
Technical Details
Message-ID:
<038bffb2-e40d-44bb-b7ce-53e9de32e50d@lunn.ch>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer04.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343380-linux-kernel-netdev=dewy.ruReferences:
<20261008220433.965791-1-linmag7@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer04.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343380-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next] tg3: normalize inherited M3000 register byte order Date: Fri, 9 Oct 2026 03:13:12 +0200 Organization: Usenet Network Message-ID: <038bffb2-e40d-44bb-b7ce-53e9de32e50d@lunn.ch> References: <20261008220433.965791-1-linmag7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1008921"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:aMzk2ki5KhMPjUo2ankZKM6wTkE= sha256:c43wq4+pVqGqWE9t+wO1dVNM2A0B2GLFohpACrLDYlk= sha1:g0SChXHeCKk4jLpXrsPBBJev5sA= sha256:WBjgVTedMR8PO+5JcZolyoA8EURRNmKMBN1hKxMEOq4= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id B3F2610F586; Fri, 9 Oct 2026 04:13:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -0.75 X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L0mFXoeg9jGZ; Fri, 9 Oct 2026 04:13:32 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-343380-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id A717E10F580; Fri, 9 Oct 2026 04:13:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id B1A4238066; Fri, 9 Oct 2026 01:13:25 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58BF3305695; Fri, 9 Oct 2026 01:13:23 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="oChc2+sH" X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F77D2E738B; Fri, 9 Oct 2026 01:13:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791508403; cv=none; b=W2LfpjzrRu3aEZriKRSd85oMRSOp0kOP6K5ArCb/oKEALfNayh2Phi+IiCGrXJIHNyauXlxvp8gLbeagoClg5o3/0L1tlqQCeuXNpzMYLL5JWuPqsJv3TF6IagLipgeIkfPrXBLthP158Wz5HoHr8CFPqUnr0hcFNgAZGH46IxQ= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791508403; c=relaxed/simple; bh=r9anZZ9RVSXqBbTuq+fpzVX2SmzUPjuecPmKS9s7dWo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uygEDQOjuMZUVJ2hdYxe1FRqUObOTvsUiOmg537z4AP3ObS4wILdSRv9Lhu/22+JXSraItrW30BnYw7uVFXim1CYTEt/4bIHCBhAhwndoHHUILbYWzhtc3+/pcieVQ6EXAr74nUB1LfKXOwOhfAyUNq9zLX4fWmW9uTK0I7wrqw= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=oChc2+sH; arc=none smtp.client-ip=156.67.10.101 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=/FGRBMXMbhN2koUceaUJ7F1sDiwsDaXu8C6c3BEK1xk=; b=oChc2+sHr4SjEX6L+QNaUyi/sB exrUl3UdyvAIDx0wvrn7SUqVwFfe/R1X6dMdFbDrvrRP+zvgpgobLIzwIpjcH/rvkvjDdU2T3kr2N gTFXSTMyo7qSiCmcm7ao8l2J5n7aPvIV8VpTLQkmh+EupQx9TEfOZ8C71xBBcSJL4W78=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xEzAe-009i9m-BC; Fri, 09 Oct 2026 03:13:12 +0200 X-Cc: pavan.chebbi@broadcom.com, mchan@broadcom.com, andrew+netdev@lunn.ch, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-In-Reply-To: <20261008220433.965791-1-linmag7@gmail.com> X-Received-Bytes: 7123