From patchwork Wed Dec 16 12:26:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1417103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CwvXV3fxKz9sRf; Wed, 16 Dec 2020 23:27:37 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kpVu2-0000Xa-Hd; Wed, 16 Dec 2020 12:27:34 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kpVty-0000Wo-NN for kernel-team@lists.ubuntu.com; Wed, 16 Dec 2020 12:27:30 +0000 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kpVty-0007BL-G9 for kernel-team@lists.ubuntu.com; Wed, 16 Dec 2020 12:27:30 +0000 Received: by mail-ed1-f71.google.com with SMTP id r16so11658530eds.13 for ; Wed, 16 Dec 2020 04:27:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Aa1ZzePibhBTa013u6vzEiZR8TIiA3sabC6tsapGh54=; b=ukRhACP6qxnyly13BoH37BYeK3e/QxbfU5k/4vVcMXUJ41h0z1Vtua5uNqi9Pw4OJ6 0ThRnGOUgGwcu6gyPMP3HGtsySN6aivwQBQGgnuo7MNlHXDwOYhGZv7kYzCA2cNkW6bA VtsKIigQ/2tA95KmszunhQoKkjbYkmUZEZ7A0FTDehEpyqVtnZS4rmPwQGmyRbIYp416 /cDYwKyy09akWArdGZzE1QGFKHjVGfDWorl+eAXcNn3JIRy0wToN0uWi5RZgMjJCDwxp CNj6emTm3NqMAYxZmX7lXuud/R4pbaVNs0J+XOi4+/KFzd7If3xHG0EXqut7jTTdcWzT Uh/g== X-Gm-Message-State: AOAM533MbBqphH7k+H+Oq6KauStTnLQptEg8q/wgmXyG1PCl7W3f6jHC GRvkOVjIcA0TOQah5RTW5YTUkoRhJdmlQhwUipQCSmDdfkxWS6BaXBxXinRQNHrJfY+V4qQ9iSf aBWwB9ghAPNJAUQ16oVsj89tptxFVNn/37qv1LlCq4Q== X-Received: by 2002:a05:6402:1696:: with SMTP id a22mr34002311edv.385.1608121650075; Wed, 16 Dec 2020 04:27:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7xKcqBXequf4NhNbheQBaY5V0hHDM6ByWPQp4n607xhk64/sptQxmiVBRyuBmsxXJFCl6pg== X-Received: by 2002:a05:6402:1696:: with SMTP id a22mr34002302edv.385.1608121649846; Wed, 16 Dec 2020 04:27:29 -0800 (PST) Received: from gollum.fritz.box ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id x4sm21484960edr.40.2020.12.16.04.27.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 04:27:29 -0800 (PST) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][G/raspi][F/raspi][PATCH] net: lan78xx: Ack pending PHY ints when resetting Date: Wed, 16 Dec 2020 13:26:57 +0100 Message-Id: <20201216122657.63965-1-juergh@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Phil Elwell BugLink: https://bugs.launchpad.net/bugs/1890487 lan78xx_link_reset explicitly clears the MAC's view of the PHY's IRQ status. In doing so it potentially leaves the PHY with a pending interrupt that will never be acknowledged, at which point no further interrupts will be generated. Avoid the problem by acknowledging any pending PHY interrupt after clearing the MAC's status bit. See: https://github.com/raspberrypi/linux/issues/2937 Signed-off-by: Phil Elwell (cherry picked from commit 44c11fa2063f00994cbce6708097f521f0b2c493 rpi-5.4.y) Signed-off-by: Juerg Haefliger Acked-by: Kleber Sacilotto de Souza Acked-by: Kelsey Skunberg --- drivers/net/usb/lan78xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index ad93e7f28dde..dcd68781e730 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1181,6 +1181,9 @@ static int lan78xx_link_reset(struct lan78xx_net *dev) if (unlikely(ret < 0)) return -EIO; + /* Acknowledge any pending PHY interrupt, lest it be the last */ + phy_read(phydev, LAN88XX_INT_STS); + phy_read_status(phydev); if (!phydev->link && dev->link_on) {