From patchwork Fri Jul 7 06:53:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13304479 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 CC6321FB7 for ; Fri, 7 Jul 2023 06:53:58 +0000 (UTC) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 180CD1FDB for ; Thu, 6 Jul 2023 23:53:53 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f96d680399so2157011e87.0 for ; Thu, 06 Jul 2023 23:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688712831; x=1691304831; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=je3l1UGSXl3qbNk8Y0jwMEy8+l5L27PFDjg5qrG9/VM=; b=OlmknxXpH0FpY4ZDFqL4X7a4ktDxUvlKBybAH2assHjilZkF0Ohr5mcW1awAYieTtn Uu043FkOEkIJvbXUh3YUbf4Mtu3xbh02q3sXocl2245ioES9IO2UKJ1oZW0CcAAGLlgV fRuAcYZ7ou4yoJUWYpqw+cLvhug+aBZzeD+xdO5AI+U8NN3Vwd3HAdL3UN1WNBSV8gcp hJJByFlqSqwVHGDH9uty6mKeheZKEhYVDafoiMa4uox/9yUfEjLZhqf+1OvDCCm1mUAq GuTDpET0dr2eWV0wnqixBR+O9WduDZoXR1joMuCyzz+2WPrUK4e4VAxRST8qhueLZj/V YIlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688712831; x=1691304831; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=je3l1UGSXl3qbNk8Y0jwMEy8+l5L27PFDjg5qrG9/VM=; b=Ua0dPXxryw5RZcd+lT/OCyeg0nJS2U2iDH9QVXVj6OIa4YEiAIk0hAxd/fvrZIV5Aj vc+ddJSsOPSeLs4dibebvhluXKTvi3/5Mjvfr6lqSGF97HwaXgBXVlsUE8rKms5iLrst alKXmRfZSZmAi3ZyrgLkefAC8dnjGBhKvhKEvmsdZfOieXjdIoKQPcyhnX+aJqFlCWF1 NOm6CvLi3v17Yd4KgXbMSAJYrPwXzJSPqNbD68ZwRIMqggvUoQCGhJeBAYRMlklFR4lG 9xSaXRgwZTpBxQj6ksp3VS71uFjQHc9Ef9z/AjTXn5ygbBJ6HOVCHEFzgBzr+lNcxsWI ITXg== X-Gm-Message-State: ABy/qLYsaF574pvKaSCMF36AA6iS8I2O9v8FRk9oDeAvXqniB/WTgutH ZMkSsxjQYooilGpBvDfMOUQ= X-Google-Smtp-Source: APBJJlFWeXBGagh4fLzcU7Cue0vPz8agr+CvVj1bBSq48hgce233y9prLE6813udH1l35DWMCmcOEg== X-Received: by 2002:a19:3819:0:b0:4f8:631b:bf77 with SMTP id f25-20020a193819000000b004f8631bbf77mr3785907lfa.22.1688712830733; Thu, 06 Jul 2023 23:53:50 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id er23-20020a05651248d700b004fba6f38f87sm558121lfb.24.2023.07.06.23.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 23:53:50 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Florian Fainelli , netdev@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH net.git] net: bgmac: postpone turning IRQs off to avoid SoC hangs Date: Fri, 7 Jul 2023 08:53:25 +0200 Message-Id: <20230707065325.11765-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Rafał Miłecki Turning IRQs off is done by accessing Ethernet controller registers. That can't be done until device's clock is enabled. It results in a SoC hang otherwise. This bug remained unnoticed for years as most bootloaders keep all Ethernet interfaces turned on. It seems to only affect a niche SoC family BCM47189. It has two Ethernet controllers but CFE bootloader uses only the first one. Fixes: 34322615cbaa ("net: bgmac: Mask interrupts during probe") Signed-off-by: Rafał Miłecki Reviewed-by: Michal Kubiak --- drivers/net/ethernet/broadcom/bgmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 1761df8fb7f9..10c7c232cc4e 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c @@ -1492,8 +1492,6 @@ int bgmac_enet_probe(struct bgmac *bgmac) bgmac->in_init = true; - bgmac_chip_intrs_off(bgmac); - net_dev->irq = bgmac->irq; SET_NETDEV_DEV(net_dev, bgmac->dev); dev_set_drvdata(bgmac->dev, bgmac); @@ -1511,6 +1509,8 @@ int bgmac_enet_probe(struct bgmac *bgmac) */ bgmac_clk_enable(bgmac, 0); + bgmac_chip_intrs_off(bgmac); + /* This seems to be fixing IRQ by assigning OOB #6 to the core */ if (!(bgmac->feature_flags & BGMAC_FEAT_IDM_MASK)) { if (bgmac->feature_flags & BGMAC_FEAT_IRQ_ID_OOB_6)