Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4490587rdh; Wed, 29 Nov 2023 03:03:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHljQvIFgXmQyAiWNPf8Ym/fYiMlP/mmNBNnJGZYJiVwcTyIYN8ozZ03jm6dgr508Q+TnmI X-Received: by 2002:a17:902:e842:b0:1cf:9e9f:fdde with SMTP id t2-20020a170902e84200b001cf9e9ffddemr21529310plg.46.1701255819916; Wed, 29 Nov 2023 03:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701255819; cv=none; d=google.com; s=arc-20160816; b=jcdPwuymzJzH0C8aKAA8LHBFaFzD9y2a9zxrGpLH0gtuO4D86cTbRq7TdRl9F9JlQH Aye/VovqMbBP+JscW30R6cKg8zG9hjynNRryTyfUaDA34i4nIVyCUX4rCq2Z67rsHOAs to7XcahHDik+d0DY9ftS8+xBisX4RRFHthpgEvBrSTfzFJWOmiCWHCjHzozNw6ZmPUJT z9tT7ACOG2Lw9/8qBbDuVOTBZ3BACC6CHL7rzQ6HNPk381wuw5nt70Xgq1wCvJcvlA+1 lrvUA97YeLeoBkhTf0lWg0naQOjrZ5ohO2d0U2Xb8JHZX9L25AJWMPeRfkY3QJ7UN1p/ eKNg== 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:subject:cc:to:from:date:message-id:dkim-signature; bh=QMxehpC8EcuIJbWBwswqF2Dwh3OOypWDdlXDrbz4QBI=; fh=floi/2IuV1Qum9ifTQSOvf7MUhMRHRs0awnS5YABf+A=; b=rBRiugCHvnj7f3gGrNZJsxXm8821t2RS24ycUuUcu4DiKXwZktBFoJTGGlGlmTU8Re YlbMbPwwYOvCrBSyESmREtvtNdaA+AviGADnp7n5K0HrRZDafLVwMPDrNGzrovn6PTKH ujq5tiv1RcokILej1AJO/FoS1oZXj1Wgnkv6688lYoSHoodbSt3O21QG2lbAdSV21c/F ZfqiM+Dh/Hd/mVz8ZPUiqA6GQuFt9sdAeGc54EhkgIVPhH6vmyKWRMIBA6xPQl73UUXh GsK4OsVnsNT7wNR5F4PpruQ9yHtYXuZu1zUe5TFJMk34m+ZcXh8kiIy0N0GAufhtEUWZ /KpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZYOly5dI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q8-20020a170902dac800b001cff62f4575si3751061plx.370.2023.11.29.03.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:03:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZYOly5dI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id C7131805C3FE; Wed, 29 Nov 2023 03:03:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbjK2LDQ (ORCPT + 99 others); Wed, 29 Nov 2023 06:03:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbjK2LDO (ORCPT ); Wed, 29 Nov 2023 06:03:14 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6136D1735; Wed, 29 Nov 2023 03:03:19 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40b54261442so3080915e9.1; Wed, 29 Nov 2023 03:03:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701255798; x=1701860598; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=QMxehpC8EcuIJbWBwswqF2Dwh3OOypWDdlXDrbz4QBI=; b=ZYOly5dITMyhdDJw6OKwXl1f1bC/wMorfz0vUf+7sOvzhIaJ8hqueQt/k66AAKtk/x 67yqO7bOZOQPJvYwSDRJjlsepLGRV51oFdTCwtWxlZykTj4Y3wo3WCEkXM0xKboAGbP6 uAnF0R9HdDj8YId2VCjO6byAtNRmnez4N3OpaTtyxTvwdcUqEoz+KeydeOJXzAr630/K tiT7+VXQqO0cN1i5w/U4HeZfY7pwXTkr3h8yzpB3YLyILh8HDhEWw1OS4Ky6lOjmpGf9 4eulIRU/O1tRNYyP4xQdTLSpwGrlAUKcdpIGYcgo1O/rBjBhbto04pSVp63nN5ntAvj5 nUHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701255798; x=1701860598; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QMxehpC8EcuIJbWBwswqF2Dwh3OOypWDdlXDrbz4QBI=; b=IVWOS9jrXNi9RXxI9lSCVv9Z3Wdk2k6aUiWMz+3N/H4afD9XvDwBsch/Ie5tl2ax0x x88x8LISfH8JrelERYRHw3CGe2Mi3XPpmug7lx86CtSH/P73oldhOLwrmHgF0RTaDcEJ orvpvvxClqJMAbqAXjCOLiwXN2OamlJJGsmFc1vrYfUede0lLNy+MSCjqKI3RW2Y+kw9 PeI3PaKsNz6y0usQxOPiVQt8+Ru+6bFEq+UC6hsfTjJPt+7831cbsP1dl1UHNBFD2qBd OYj30EW6GKj8xTYpOMHazH1fXDcjIBrWdhTGqoiUbd/INLUi2SivxpnbEm9e/QZXNLDB To5Q== X-Gm-Message-State: AOJu0YwXQqUL1rfLhFIA+Fo1qy7Jtn70NN7BpbdK+CqNSxN2B0lK9iUR 4xVR+L/voMn4aZyt3/3FtO9n4lJng5I= X-Received: by 2002:a05:600c:5118:b0:3f6:9634:c8d6 with SMTP id o24-20020a05600c511800b003f69634c8d6mr13234227wms.18.1701255797411; Wed, 29 Nov 2023 03:03:17 -0800 (PST) Received: from Ansuel-xps. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id q17-20020a05600c46d100b0040836519dd9sm1816416wmo.25.2023.11.29.03.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:03:17 -0800 (PST) Message-ID: <65671a75.050a0220.53874.4dd1@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 29 Nov 2023 12:03:14 +0100 From: Christian Marangi To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [net-next PATCH 02/14] net: phy: at803x: move disable WOL for 8031 from probe to config References: <20231129021219.20914-1-ansuelsmth@gmail.com> <20231129021219.20914-3-ansuelsmth@gmail.com> <65670622.050a0220.4c0d0.3ee9@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 03:03:37 -0800 (PST) On Wed, Nov 29, 2023 at 10:45:11AM +0000, Russell King (Oracle) wrote: > On Wed, Nov 29, 2023 at 10:36:31AM +0100, Christian Marangi wrote: > > On Wed, Nov 29, 2023 at 09:24:32AM +0000, Russell King (Oracle) wrote: > > > On Wed, Nov 29, 2023 at 03:12:07AM +0100, Christian Marangi wrote: > > > > Probe should be used only for DT parsing and allocate required priv, it > > > > shouldn't touch regs, there is config_init for that. > > > > > > I'm not sure where you get that idea from. PHY driver probe() functions > > > are permitted to access registers to do any setup that they wish to. > > > > > > config_init() is to configure the PHY for use with the network > > > interface. > > > > > > I think this patch is just noise rather than a cleanup. > > > > > > > I got it from here [1] > > > > Also on every other driver probe was always used for allocation and > > parsing so why deviates from this pattern here? > > Untrue. > > bcm54140_enable_monitoring() is called from bcm54140_probe_once() > which in turn is called from bcm54140_probe(). > > dp83869_probe() calls dp83869_config_init(), rightly or wrongly. > > lxt973_probe() fixes up the BMCR. > > mv3310_probe() configures power-down modes, modifying registers. > > mt7988_phy_probe() calls mt7988_phy_fix_leds_polarities() which > modifies registers. > > lan8814_probe() calls lan8814_ptp_init() which does a whole load of > register writes. > > lan88xx_probe() configures LEDs via register writes. > > yt8521_probe() configures clocks via register modification. > > I'm afraid this means your comment is demonstrably false. > Don't want to start a discussion and thanks a lot for pointing this out. This is really to talk about this and not contradict you. Yes it's not true, and I was wrong but still I watch other driver outside PHY and normally probe should not do that kind of stuff. (even the comments describing the use in phy.h doesn't say that it should be used for configuring the PHY only once on discovery) Watching some of the thing, I feel all of this is done in probe as it's not called again on software reset (as it will call config_init again). This looks like there is a missing feature here and maybe a chance to improve this? Wonder if adding an additional OP would be beneficial to this? Was thinking to something like .config_once ? And add some comments that it's called only on PHY discovery? It would be put right after the probe call in phy_core. > > Also I think it was wrong from the start as on reset I think WoL is > > not disabled again. (probe is not called) > > On hardware reset, the 1588 register will re-enable the WoL pin, but > that needs a hardware reset of the PHY to happen after probe() is > called. > > However, phy_probe() will only assert the reset signal _if_ an error > occured during probing, not if probing was successful. So, a successful > probe of this driver will not cause a hardware reset. > > Also, hardware reset is optional. Do you know whether the platforms > that use the separate WoL pin which this 1588 register controls also > wire the reset signal such that it can be controlled by Linux? > Probably not. > > So, this register write will not be cleared by a hardware reset after > a successful probe. > I just checked Datasheet, on HW reset it's enabled again and on SW reset value is retained. So yes it must stay in probe as it will cause side effect if WoL get enabled after... Really hope the config_once thing is OK since it will make things much cleaner. -- Ansuel