From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8180C433F5 for ; Tue, 28 Sep 2021 13:28:08 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38D8B611CB for ; Tue, 28 Sep 2021 13:28:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 38D8B611CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3DC58831ED; Tue, 28 Sep 2021 15:28:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WFEVe7E8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BCB30831EE; Tue, 28 Sep 2021 15:28:03 +0200 (CEST) Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8A0E3831ED for ; Tue, 28 Sep 2021 15:27:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-oi1-x22f.google.com with SMTP id x124so29914885oix.9 for ; Tue, 28 Sep 2021 06:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yMBCOeWVrTIkLIx54UghjR2XcoeF2Udgy8OIwV/N9S8=; b=WFEVe7E8PfQeDieqiQBP+rv0nxvVE2DxoP2l5bQbbLfZUc313HmkjBI1/yBC7D+qLr il3UPKA/K3CEwXnXdug9y0Wc+hceHqtZG1XCWvPiYYQquaLK0E+lmgJrlyWrm/YPzf3c eTx6oR2o4K4ktnC1lxsJXZbD3DcH7CqAENAKr0Y5p7uvi78ciSUicyd2IsEfe3fuQskW GF4mjjKtbqcjsxuro+pX5J76ADsjV/okmsqSae4zBEER84Xt8DB2UJ1Exjrs6jpi8lte +K0G0rKePGRULY9ksgJ0LIRITzcRBDTDbdloXNLSZnaml7wZrdzUcovfsjgntq7Iku7y nX7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yMBCOeWVrTIkLIx54UghjR2XcoeF2Udgy8OIwV/N9S8=; b=1XJ6p+3txu2ddZTqGpHdiDBx5vJh8WsLYZdh5xBlTVSIKT06c9Y/h7mxITr3e+eUVn oag51pga6toQUBPU8jJf9AVups/p5jOesXkFNUaVVVwYxO6AK/beOfb54Qy/c4F9fok9 d3SB2DnV8PKSRu8i0FOlVMpollzC6uLtK5ghgsl1/ORCnHEmyHMw1WwU3OtParfhDQQw uKLkadyUU79+rCj5gvyvI/6Lu1moWgoPbGq2CM6KqdPf221hQkGFVUg/N+fV6P4nfRNV 5r0bhG5+bwQcLH9IZI52RMxwqCvXg5lX4cWnrrbB+Lk2lPZM136UtgL2BN7vV+A/DcfR AqhQ== X-Gm-Message-State: AOAM533hUMHIJU+ymo+6yEhRfvkec3/WlBNFFn1y2uY7MGg4Eq2bvksT s0heiuJvy2/KgGpaowQc5j9WRV1kp2GPVo9yfcc= X-Google-Smtp-Source: ABdhPJwFXIzH0mkHZlVNbDo1l8t3fiF/AkXkkl1c0Lz9aryVfAuf8qMivYDTS851+xJCeJU7jLXBIqOFv438FDATmhA= X-Received: by 2002:a05:6808:c4:: with SMTP id t4mr3539438oic.22.1632835676289; Tue, 28 Sep 2021 06:27:56 -0700 (PDT) MIME-Version: 1.0 References: <20210918114956.1064294-1-vladimir.oltean@nxp.com> <20210918114956.1064294-2-vladimir.oltean@nxp.com> In-Reply-To: <20210918114956.1064294-2-vladimir.oltean@nxp.com> From: Ramon Fried Date: Tue, 28 Sep 2021 16:27:45 +0300 Message-ID: Subject: Re: [PATCH 1/2] net: dsa: pass CPU port fixed PHY to .port_disable To: Vladimir Oltean Cc: U-Boot Mailing List , Joe Hershberger , Tim Harvey , Michael Walle Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Sat, Sep 18, 2021 at 2:50 PM Vladimir Oltean wrote: > > While adding the logic for DSA to register a fixed-link PHY for the CPU > port, I forgot to pass it to the .port_disable method too, just > .port_enable. > > Bug had no impact for felix_switch.c, due to the phy argument not being > used, but ksz9477.c does use it => NULL pointer dereference. > > Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches") > Signed-off-by: Vladimir Oltean > --- > net/dsa-uclass.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/dsa-uclass.c b/net/dsa-uclass.c > index 9b8ae1e82b92..d1c6c78acd6c 100644 > --- a/net/dsa-uclass.c > +++ b/net/dsa-uclass.c > @@ -100,7 +100,7 @@ static void dsa_port_stop(struct udevice *pdev) > > port_pdata = dev_get_parent_plat(pdev); > ops->port_disable(dev, port_pdata->index, port_pdata->phy); > - ops->port_disable(dev, priv->cpu_port, NULL); > + ops->port_disable(dev, priv->cpu_port, priv->cpu_port_fixed_phy); > } > > eth_get_ops(master)->stop(master); > -- > 2.25.1 > Reviewed-by: Ramon Fried