mbox series

[net-next,v2,0/7] net: sfp: improve high power module implementation

Message ID Y1K17UtfFopACIi2@shell.armlinux.org.uk (mailing list archive)
Headers show
Series net: sfp: improve high power module implementation | expand

Message

Russell King (Oracle) Oct. 21, 2022, 3:08 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 25, 2022, 4:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 21 Oct 2022 16:08:29 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,1/7] dt-bindings: net: sff,sfp: update binding
    https://git.kernel.org/netdev/net-next/c/a272bcb9e5ef
  - [net-next,2/7] net: sfp: check firmware provided max power
    https://git.kernel.org/netdev/net-next/c/02eaf5a79100
  - [net-next,3/7] net: sfp: ignore power level 2 prior to SFF-8472 Rev 10.2
    https://git.kernel.org/netdev/net-next/c/18cc659e95ab
  - [net-next,4/7] net: sfp: ignore power level 3 prior to SFF-8472 Rev 11.4
    https://git.kernel.org/netdev/net-next/c/f8810ca75829
  - [net-next,5/7] net: sfp: provide a definition for the power level select bit
    https://git.kernel.org/netdev/net-next/c/398900498485
  - [net-next,6/7] net: sfp: add sfp_modify_u8() helper
    https://git.kernel.org/netdev/net-next/c/a3c536fc7580
  - [net-next,7/7] net: sfp: get rid of DM7052 hack when enabling high power
    https://git.kernel.org/netdev/net-next/c/bd1432f68ddc

You are awesome, thank you!