devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
	devicetree@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh+dt@kernel.org>
Subject: [PATCH net-next v2 0/7] net: sfp: improve high power module implementation
Date: Fri, 21 Oct 2022 16:08:29 +0100	[thread overview]
Message-ID: <Y1K17UtfFopACIi2@shell.armlinux.org.uk> (raw)

Hi,

This series aims to improve the power level switching between standard
level 1 and the higher power levels.

The first patch updates the DT binding documentation to include the
minimum and default of 1W, which is the base level that every SFP cage
must support. Hence, it makes sense to document this in the binding.

The second patch enforces a minimum of 1W when parsing the firmware
description, and optimises the code for that case; there's no need to
check for SFF8472 compliance since we will not need to touch the
A2h registers.

Patch 3 validates that the module supports SFF-8472 rev 10.2 before
checking for power level 2 - rev 10.2 is where support for power
levels was introduced, so if the module doesn't support this revision,
it doesn't support power levels. Setting the power level 2 declaration
bit is likely to be spurious.

Patch 4 does the same for power level 3, except this was introduced in
SFF-8472 rev 11.9. The revision code was never updated, so we use the
rev 11.4 to signify this.

Patch 5 cleans up the code - rather than using BIT(0), we now use a
properly named value for the power level select bit.

Patch 6 introduces a read-modify-write helper.

Patch 7 gets rid of the DM7052 hack (which sets a power level
declaration bit but is not compatible with SFF-8472 rev 10.2, and
the module does not implement the A2h I2C address.)

Series tested with my DM7052.

v2: update sff.sfp.yaml with Rob's feedback

 Documentation/devicetree/bindings/net/sff,sfp.yaml |  3 +-
 drivers/net/phy/sfp.c                              | 85 +++++++++++-----------
 include/linux/sfp.h                                |  2 +
 3 files changed, 48 insertions(+), 42 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

             reply	other threads:[~2022-10-21 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 15:08 Russell King (Oracle) [this message]
2022-10-21 15:09 ` [PATCH net-next 1/7] dt-bindings: net: sff,sfp: update binding Russell King (Oracle)
2022-10-21 22:11   ` Rob Herring
2022-10-21 15:09 ` [PATCH net-next 2/7] net: sfp: check firmware provided max power Russell King (Oracle)
2022-10-21 15:09 ` [PATCH net-next 3/7] net: sfp: ignore power level 2 prior to SFF-8472 Rev 10.2 Russell King (Oracle)
2022-10-21 15:09 ` [PATCH net-next 4/7] net: sfp: ignore power level 3 prior to SFF-8472 Rev 11.4 Russell King (Oracle)
2022-10-21 15:09 ` [PATCH net-next 5/7] net: sfp: provide a definition for the power level select bit Russell King (Oracle)
2022-10-21 15:10 ` [PATCH net-next 6/7] net: sfp: add sfp_modify_u8() helper Russell King (Oracle)
2022-10-21 15:10 ` [PATCH net-next 7/7] net: sfp: get rid of DM7052 hack when enabling high power Russell King (Oracle)
2022-10-25  4:20 ` [PATCH net-next v2 0/7] net: sfp: improve high power module implementation patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1K17UtfFopACIi2@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).