Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2399957rdg; Mon, 16 Oct 2023 03:23:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHY5n9Bsfmzp/CzQvO2VUF0i2fUwDHhRhCX9VUQkrty/YIP2NyHw4pKhTZM0wz5i5keerb3 X-Received: by 2002:a05:6a20:4417:b0:174:32c:dc03 with SMTP id ce23-20020a056a20441700b00174032cdc03mr10596027pzb.3.1697451806494; Mon, 16 Oct 2023 03:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697451806; cv=none; d=google.com; s=arc-20160816; b=cMUQVxKGCHKK30ZtQV1ZGd/lFCiR7W5dPFMjcb5AP6Gc311n3ZL+r5tmZwdt1AdUYX k4PFH7mBKr8THCzfXsOslw/meEhqGjt2TOjsI0SFPVWsBPupMQ+d9xdy1gmVGya35vJu fmJO6Y1n7toZr/9mlyQXBebTsYe2k/ACNQkKOprTvKElGaZI6lbHZcEz9OHRb17GoKqa Y1JUg9vScRNg4bv9Zvj16QZ5uqchnGtxtxg91RE42u9q3waVKUuc5zhpW3pMkR6edNTb wctZeS8dfQQseRtM4aeBFcqhEYq0B7s6TIOkUvkJ/V4GHkhSzviradwA9venOA92k+eT Y8MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xfJWdslS3Yal/mqU3hhH87VKZdvRShl/Pe/cybkKHWg=; fh=4w3Pqs5x2lCMSSUPACK3dMuO7uUmsmglpPHc5D/SCqY=; b=MbHsWjxqMIj1Km4oX7x/EAHP4nwN6QDqk+3h5OTqR+x8k0SfWY+VEi2xy6QZqVQLYE Zdej5jHUKenVf5x/WXHgbKTOfL0sVCk801ZT40bc8GixDYJ/YBZgM2vJ8Mzf8LB1IjKu IixdeifuszPW7SPCH4OS4wLZpNSohrjBdFiHKYhy3xm5YeJOzDSliWs7+eZzNj8yaRmb 1YiSXnlsvy4yawWSWQQB5j7cD9yoj67aRLMHdHTT5DVz+3PBgNQlpaYM8qn3qvY5Ywxq ohX9h5toJb/jYGruL4bzc0kQhqIrLUfP0UyZ7wrG2NDA5iPgXNSKlngrohcqs2Ue2hBt Dm2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TmcEhI90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id f4-20020a635544000000b005859f850b2csi10103430pgm.38.2023.10.16.03.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TmcEhI90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4365580D2908; Mon, 16 Oct 2023 03:23:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232447AbjJPKXC (ORCPT + 99 others); Mon, 16 Oct 2023 06:23:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232495AbjJPKXA (ORCPT ); Mon, 16 Oct 2023 06:23:00 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3537CEE; Mon, 16 Oct 2023 03:22:59 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9b1ebc80d0aso672913366b.0; Mon, 16 Oct 2023 03:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697451777; x=1698056577; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xfJWdslS3Yal/mqU3hhH87VKZdvRShl/Pe/cybkKHWg=; b=TmcEhI906+Az0MSXct6z8ZR0aZPeGZfNxbs4iJARuzoErFLIpLJ9XLYHMDZ6XvhYD0 PBCSK/MAFUqHfmJWVnlSDGkNyM0St+6S95Bh/AsHJVd0FQaENIghm5zP4M1CmSc7XMZn 19Jp1Tob/ZQUkaF1nuwJiMXQlT2czT0+hmL5qWhX9dgjzAup77i+BK8OsZfi7UDI1wf7 9iTSYrUsD+ugvqBLblEQBUHJ95/RU412QaQdJaawB9tkSCPoOSvtRJhkGzA2xY7xW876 /T4QCJKN7wbXHL3KOpGPeuZA+FkhiBt2+DRKGAcIdCd7lN3JnAYSMRxZvhPDShfbJWZi 6YJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697451777; x=1698056577; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xfJWdslS3Yal/mqU3hhH87VKZdvRShl/Pe/cybkKHWg=; b=LKQNn9iqE/9d2YYTzsKmj39EnTfKAdK8Sj/ereNEGOhBKJRL5B48ajEoiSczF0NRlr 6sm/Pt5eD8yMzAzzxKRPEO1LKT0bZHrNO+Apg+rMbN63xXS42lUCjT3skRLAg0CVrzmu UmKKpE3X4DolnBHfVUTTPwcQlOgyYaJtTGgBboSbSVLuPfRp3fxaoxsBHEQomUJYMGxU TI3ixmkzhm4IcSQ44rZKJME6vN5w/0D1Ql3x0rvGeFWf4JXe9Y2aJKldHYfDP1VUQfDf KexZSlR5PS1etwU1VnZC+ppkO3HDlx2QJ2SedMPEeRAsufHRJ2OLkHRHxLANH6EUqaHo 0Uqg== X-Gm-Message-State: AOJu0Yx83xByEi2Zg28gXQS87DCkoVb+Yhs3IvWYUtiraYXmVUBjEsjJ wo/NQhnzYjEr1lVZflKc0LE= X-Received: by 2002:a17:907:7ba1:b0:9c4:4b20:44b2 with SMTP id ne33-20020a1709077ba100b009c44b2044b2mr1761032ejc.23.1697451777533; Mon, 16 Oct 2023 03:22:57 -0700 (PDT) Received: from skbuf ([188.26.57.160]) by smtp.gmail.com with ESMTPSA id og41-20020a1709071de900b009adce1c97ccsm3701040ejc.53.2023.10.16.03.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:22:57 -0700 (PDT) Date: Mon, 16 Oct 2023 13:22:54 +0300 From: Vladimir Oltean To: Oleksij Rempel Cc: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: Re: [PATCH net-next v3 7/7] net: dsa: microchip: do not shut down the switch if WoL is active Message-ID: <20231016102254.f7u7vrk52siqoihd@skbuf> References: <20231013122405.3745475-1-o.rempel@pengutronix.de> <20231013122405.3745475-8-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231013122405.3745475-8-o.rempel@pengutronix.de> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 03:23:24 -0700 (PDT) On Fri, Oct 13, 2023 at 02:24:05PM +0200, Oleksij Rempel wrote: > For Wake on Lan we should not reconfigure, reset or power down the > switch on shut down sequence. > > Signed-off-by: Oleksij Rempel > --- > drivers/net/dsa/microchip/ksz9477_i2c.c | 3 +++ > drivers/net/dsa/microchip/ksz_common.c | 18 ++++++++++++++++++ > drivers/net/dsa/microchip/ksz_common.h | 2 ++ > drivers/net/dsa/microchip/ksz_spi.c | 3 +++ > 4 files changed, 26 insertions(+) > > diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c b/drivers/net/dsa/microchip/ksz9477_i2c.c > index 2710afad4f3a..fe818742051c 100644 > --- a/drivers/net/dsa/microchip/ksz9477_i2c.c > +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c > @@ -66,6 +66,9 @@ static void ksz9477_i2c_shutdown(struct i2c_client *i2c) > if (!dev) > return; > > + if (ksz_wol_is_active(dev)) > + return; > + > if (dev->dev_ops->reset) > dev->dev_ops->reset(dev); The rest of the code used to read: dsa_switch_shutdown(dev->ds); i2c_set_clientdata(i2c, NULL); } and that part is non-optional. Please only skip the dev->dev_ops->reset() call if ksz_wol_is_active(). > static void ksz_set_xmii(struct ksz_device *dev, int port, > phy_interface_t interface) > { > diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h > index 80679f38ee12..84b1eed8cd2a 100644 > --- a/drivers/net/dsa/microchip/ksz_common.h > +++ b/drivers/net/dsa/microchip/ksz_common.h > @@ -397,6 +397,8 @@ bool ksz_get_gbit(struct ksz_device *dev, int port); > phy_interface_t ksz_get_xmii(struct ksz_device *dev, int port, bool gbit); > extern const struct ksz_chip_data ksz_switch_chips[]; > > +bool ksz_wol_is_active(struct ksz_device *dev); > + > /* Common register access functions */ > static inline struct regmap *ksz_regmap_8(struct ksz_device *dev) > { > diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c > index 279338451621..c5d9c3d86ddb 100644 > --- a/drivers/net/dsa/microchip/ksz_spi.c > +++ b/drivers/net/dsa/microchip/ksz_spi.c > @@ -114,6 +114,9 @@ static void ksz_spi_shutdown(struct spi_device *spi) > if (!dev) > return; > > + if (ksz_wol_is_active(dev)) > + return; > + > if (dev->dev_ops->reset) > dev->dev_ops->reset(dev); Same here. Maybe introducing a common ksz_switch_shutdown() would be appropriate.