diff mbox series

[net] net: phy: Document phydev::dev_flags bits allocation

Message ID 20210526184617.3105012-1-f.fainelli@gmail.com (mailing list archive)
State Accepted
Commit 62f3415db237b8d2aa9a804ff84ce2efa87df179
Delegated to: Netdev Maintainers
Headers show
Series [net] net: phy: Document phydev::dev_flags bits allocation | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 490 this patch: 490
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 406 this patch: 406
netdev/header_inline success Link

Commit Message

Florian Fainelli May 26, 2021, 6:46 p.m. UTC
Document the phydev::dev_flags bit allocation to allow bits 15:0 to
define PHY driver specific behavior, bits 23:16 to be reserved for now,
and bits 31:24 to hold generic PHY driver flags.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 include/linux/phy.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andrew Lunn May 26, 2021, 6:53 p.m. UTC | #1
On Wed, May 26, 2021 at 11:46:17AM -0700, Florian Fainelli wrote:
> Document the phydev::dev_flags bit allocation to allow bits 15:0 to
> define PHY driver specific behavior, bits 23:16 to be reserved for now,
> and bits 31:24 to hold generic PHY driver flags.

Hi Florian

This is good as far as it goes. But do we want to give a hint that if
the MAC driver sets bits in [15:0] it should first verify the PHY has
the ID which is expected?

    Andrew
Russell King (Oracle) May 26, 2021, 6:59 p.m. UTC | #2
On Wed, May 26, 2021 at 11:46:17AM -0700, Florian Fainelli wrote:
> Document the phydev::dev_flags bit allocation to allow bits 15:0 to
> define PHY driver specific behavior, bits 23:16 to be reserved for now,
> and bits 31:24 to hold generic PHY driver flags.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Yay!

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Russell King (Oracle) May 26, 2021, 7:01 p.m. UTC | #3
On Wed, May 26, 2021 at 08:53:41PM +0200, Andrew Lunn wrote:
> On Wed, May 26, 2021 at 11:46:17AM -0700, Florian Fainelli wrote:
> > Document the phydev::dev_flags bit allocation to allow bits 15:0 to
> > define PHY driver specific behavior, bits 23:16 to be reserved for now,
> > and bits 31:24 to hold generic PHY driver flags.
> 
> This is good as far as it goes. But do we want to give a hint that if
> the MAC driver sets bits in [15:0] it should first verify the PHY has
> the ID which is expected?

Hi Andrew,

I think we probably need a helper for that - while we can match
phydev->phy_id, that only works for C22 PHYs. Matching the C45
IDs is much more painful. So, I think a helper would be good,
even if initially it just checks the C22 ID.

Thoughts?
patchwork-bot+netdevbpf@kernel.org May 26, 2021, 8:30 p.m. UTC | #4
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 26 May 2021 11:46:17 -0700 you wrote:
> Document the phydev::dev_flags bit allocation to allow bits 15:0 to
> define PHY driver specific behavior, bits 23:16 to be reserved for now,
> and bits 31:24 to hold generic PHY driver flags.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  include/linux/phy.h | 5 +++++
>  1 file changed, 5 insertions(+)

Here is the summary with links:
  - [net] net: phy: Document phydev::dev_flags bits allocation
    https://git.kernel.org/netdev/net/c/62f3415db237

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 60d2b26026a2..852743f07e3e 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -496,6 +496,11 @@  struct macsec_ops;
  * @mac_managed_pm: Set true if MAC driver takes of suspending/resuming PHY
  * @state: State of the PHY for management purposes
  * @dev_flags: Device-specific flags used by the PHY driver.
+ *		Bits [15:0] are free to use by the PHY driver to communicate
+ *			    driver specific behavior.
+ *		Bits [23:16] are currently reserved for future use.
+ *		Bits [31:24] are reserved for defining generic
+ *			     PHY driver behavior.
  * @irq: IRQ number of the PHY's interrupt (-1 if none)
  * @phy_timer: The timer for handling the state machine
  * @phylink: Pointer to phylink instance for this PHY