Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1495983rdb; Sat, 3 Feb 2024 08:28:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHArYppRvYB3fxuMRBwXdh3bXECEgVxE5up6IVUkuO0VkvGWsUac9euoTLqjle0tAcDue1K X-Received: by 2002:a05:6512:3fa:b0:511:37d7:afe8 with SMTP id n26-20020a05651203fa00b0051137d7afe8mr2628507lfq.1.1706977710879; Sat, 03 Feb 2024 08:28:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706977710; cv=pass; d=google.com; s=arc-20160816; b=Zx7ckqDF6Fxd3I+k2OjCe5A6z9YbPe6wl59hMHU6oTk6sN3ALRSitSJBJMsUdl94Tj yY9Ay/JiTVaiehIfHrtQm9cyADDGtkz1Jx0FNy1kAh6Dl6TDV2OvB/8KkTa0rniJhHM8 Z0dtDDYf9moSK/32Wa/OdiQ52FbJV9OMMhHpxSbaMi3xfeYpPCDQv4Ev8hERlpOF9kVn jtzstval1fRAb4nJwTimd3NOzhhUjifuofFIiwTpxajXHTacjCbgeZOP6SNwh77+mmbF /iB6ULazCxF4AgcXv+t4dfu9bKP29ZD24Y/88yg5ahODBiwwXb9trT0pmoFTp8kpTs2e JviA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:subject:cc:to:from :date:message-id:dkim-signature; bh=GS/BDC9cqJY3NsuxlNWLdJ/c0yhbHpkPVMKk/bSeWvA=; fh=YcrflM0B8tdUPj7FZU3gm43DNEozxwyJ2IT4fg1aU7U=; b=huy54bfoXnCyKKyvhzOm7eAh/FmRJX6RgMWFzFnn+gwi2TaqlP9mRfxXb2YhdoDRmr 6yk/pqdaYCLh+fwqwmtIh9A8u8Nqea5pmC1El2pl5M+aPwBGlU7v8Jz4KaIL5nXHx3mM Bt19wSou67pe2N9pPl/L+5WknAxsUSk0hHS72Rksm3YMvrr7Dl+fmMpv11pLg65D7ZcO +A+LT6pYEVyM06tO//THLZ51MMg94Sh79mEUOa0HeWq+lYWgd0S2S7nw3z2f365T0fk1 pcDsFNMijQULWss0KeO3wFVwsRXSEkLE+UyggUcWHvEy+kTECXZc/z5j0+Y9McvuE5hR i8Hg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nYR9cA9V; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCUYvDObbEP90PRtflts5qOfS7DjpewNLUp9TLV/J/THVbJXkBfHsSsIsL/3VZ/B9QdntqKlHhYHzavdUNyBm6bcNPB9ejP9NzdPfBZSog== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f9-20020a170906048900b00a35fa6ca2e0si1972371eja.312.2024.02.03.08.28.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 08:28:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nYR9cA9V; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6F8E31F22068 for ; Sat, 3 Feb 2024 16:28:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E85C05F855; Sat, 3 Feb 2024 16:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nYR9cA9V" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F0D75F843; Sat, 3 Feb 2024 16:28:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706977691; cv=none; b=WeXEsYf4Ra970IKWm7Y9PD8WM3rETap3i4rGY7CZfKBy4rCDp3Mk4klwRacoR8RQZgPpjpopKESfkCyWkQJSgk0/06NozcEnh/KDlCJtjFkZPjmGVFKOq8QfJIOyRacXy6gDyL6c8h5XZtK1R3sLZj5qw3W3scjG/t0Zt8XWDdo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706977691; c=relaxed/simple; bh=6V+6hanOVQqDNQ9px+eX1cNnxoJnRfwrdgS3FDJGxQs=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cTsaEdsP5bR93qU1MbFtTUwqEdD6eDsYTkAquOWIYMaJTJSfovKzXgeyDIX98wiYi0HPHWtJa0gzpl7OTVfqfxjy8uSp2oOlQitmJ0CLyCLQiwW3/KG1zoupGM2rbLYyr/3mMyZBwgHf5UoA9BvexJxW953cgbshh0Hrkg6P380= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nYR9cA9V; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40fc65783aeso14597505e9.2; Sat, 03 Feb 2024 08:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706977687; x=1707582487; 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=GS/BDC9cqJY3NsuxlNWLdJ/c0yhbHpkPVMKk/bSeWvA=; b=nYR9cA9VW41te+JyUScvY72qkk4L66WhtoAmoy2BfaBx19/A9Fn70UOMpV1G1Zzj+7 PQ9Unu+HHjQxAfOp5Y/Qjt53JkzB/D13cuU1mEvZUCdCZBHCQhGLFxgUTOez+rrQhFqE 6t1EtHkBMg6Y6qA5UuHnyNqkRGtO4cX3QpJfEvfVCbM+7SL1yqnlDauL7B1smYtL4UpE gz4ASu050HSgRTbhx/JJGNYX1zfpEUvhMlyV7dwuacA/uva6djBz0wDse1NCQLEPD1MX U7k7Q0K/U577Zv2X1hS6NEDfBBZLbnvdJXQUqowA0Fq7KyZT/ycwAlhhbnOgUuEtlPUh XVqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706977687; x=1707582487; 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=GS/BDC9cqJY3NsuxlNWLdJ/c0yhbHpkPVMKk/bSeWvA=; b=aUxd7BuMQX4K0AoGBSHVU/jcO7nAu9BnSn5OuyQGnp8EL6rTqr1GVK+pWkwToIF4HQ RvrWmXRKn+PrKhyv8Vfqp1CFmCtRl2RzyI6v6dfRUplVdp1wvOCj6uZIMFO6kr7Hf9c0 OA+THYqBwxtSpmGLh3sMbz3AbbWCF4RZ/NwlW1VOdrhjQiBQT8cxa5pcujIQgvI1Cqq1 vZ2+6whQU48UCTHLkRMVFRHs4rPN6nrSx1nEtUAlMM/GSZGzyTOskNBl0xYz/cOwxRbB kRkFLvDrrPpQQJySkx+FkuJ91h2rtGtYr23J/IRyt/QxCiBjjkpqpbPoTDBvY9YHUDg9 6jSg== X-Gm-Message-State: AOJu0YzJkRb+ObVp+f+XPQqGaojNaft63XI4p0J7icQj/eDfw64olKTF OSuWvjeEeBhE25gxFwdFm229v9IJy0Bezm2k0AaorPDKbKZESdi9 X-Received: by 2002:a05:600c:3583:b0:40f:20e:bf71 with SMTP id p3-20020a05600c358300b0040f020ebf71mr1339216wmq.5.1706977687368; Sat, 03 Feb 2024 08:28:07 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUDMefEEkz4sDh5F3KKg8tLo1bHdknErdzPlp3ZSApUFvoUMRZ0qL0RLovls/Zu2HjjIpB6P415JUyCkBUGrLeiD9Ztth0+a7nlfCMGEopXBnTW3YMltNr8J0HabfGtXNPARxRARxK2i29Ek8MtCayJxqL/7HbXKYLpGjuQrRNOKWhmM0lNeV3qGnoA4YqkqM4VWYHJHsJMdFGFjVicHZLmOAFSEnuhBMpa8xtzvh/L+n+EdaMhXvDKs6L6EQev10hh4JlV9LAEs/Um7TVBqY6y1pEPwvemY5ESC/9DlSG5hWtv/PWMoU3cAecmszWcyyQLIWeJ0U/BSnKqMEL1ydBwDKYffewRY1jyYdIhxpuot6kYZUhxjCRChZH2v26rhG6pqreuioaJXqSW0uErea7+RCGcpxkDlGvrOWkjlPWYiPQh2xN7CNRYVB8ljBLoUdN5hiPr93fDo2sXTWNE7yBAO/ZrBZY/pLieT5meAUL+JsB9FcQ+EsUN0KIoxWV2MvNRZfrWxcxjSIlXKj6FXgjLgdHz68wGQ1NjUo3ZRk/jhbNekzUF6IeQDKneIuVRVX59fw== Received: from Ansuel-xps. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id m9-20020a7bcb89000000b0040e813f1f31sm3315328wmi.25.2024.02.03.08.28.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 08:28:07 -0800 (PST) Message-ID: <65be6997.7b0a0220.3acf.de81@mx.google.com> X-Google-Original-Message-ID: Date: Sat, 3 Feb 2024 17:28:03 +0100 From: Christian Marangi To: Andrew Lunn Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Heiner Kallweit , Russell King , Frank Rowand , Robert Marko , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [net-next PATCH v5 7/9] net: phy: qcom: add support for QCA807x PHY Family References: <20240201151747.7524-1-ansuelsmth@gmail.com> <20240201151747.7524-8-ansuelsmth@gmail.com> <65bd29f9.050a0220.a175d.3d5f@mx.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Feb 03, 2024 at 05:25:23PM +0100, Andrew Lunn wrote: > On Fri, Feb 02, 2024 at 06:44:22PM +0100, Christian Marangi wrote: > > On Fri, Feb 02, 2024 at 02:35:11AM +0100, Andrew Lunn wrote: > > > > +static int qca807x_read_fiber_status(struct phy_device *phydev) > > > > +{ > > > > + int ss, err, lpa, old_link = phydev->link; > > > > + > > > > + /* Update the link, but return if there was an error */ > > > > + err = genphy_update_link(phydev); > > > > + if (err) > > > > + return err; > > > > + > > > > + /* why bother the PHY if nothing can have changed */ > > > > + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link) > > > > + return 0; > > > > + > > > > + phydev->speed = SPEED_UNKNOWN; > > > > + phydev->duplex = DUPLEX_UNKNOWN; > > > > + phydev->pause = 0; > > > > + phydev->asym_pause = 0; > > > > + > > > > + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) { > > > > + lpa = phy_read(phydev, MII_LPA); > > > > + if (lpa < 0) > > > > + return lpa; > > > > + > > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, > > > > + phydev->lp_advertising, lpa & LPA_LPACK); > > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, > > > > + phydev->lp_advertising, lpa & LPA_1000XFULL); > > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT, > > > > + phydev->lp_advertising, lpa & LPA_1000XPAUSE); > > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, > > > > + phydev->lp_advertising, > > > > + lpa & LPA_1000XPAUSE_ASYM); > > > > + > > > > + phy_resolve_aneg_linkmode(phydev); > > > > + } > > > > > > This looks a lot like genphy_c37_read_status(). Can it be used? > > > > > > > Yes but I had to expand genphy_c37_read_status. Hope it will be OK. > > You can expand it, but please keep to what is defined within 802.3. We > don't want any vendor extensions in this common code. Vendor things > should be kept in the vendor driver. So you can call > genphy_c37_read_status() and then do any vendor specific fixups > needed. > Sure the expansion is just adding a bool signal if the link has changed or not (to make it possible to exit early and skip the additional vendor call...) I didn't add anything to the c37 function ifself. Anyway of from this, the revision is ready, just need to understand if Rob is ok with absolute or relative address for PHYs in the PHY package node. -- Ansuel