Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1419691

Re: [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus refcount

From Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus refcount
Date 2016-06-10 22:00 +0200
Message-ID <rIAKZ-Mx-13@gated-at.bofh.it> (permalink)
References <rHWkx-7lM-1@gated-at.bofh.it> <rHWkx-7lM-9@gated-at.bofh.it> <rHY30-7L-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

Andrew Lunn <andrew@lunn.ch> writes:

> On Wed, Jun 08, 2016 at 08:44:52PM -0400, Vivien Didelot wrote:
>> The MDIO device probe and remove functions are respectively incrementing
>> and decrementing the bus refcount themselves. Since these bus level
>> actions are out of the device scope, remove them.
>
> I agree with the patch. But have you checked the mdio layer is doing
> the right thing? If not, we should fix that first.

So I added some printing after incrementing/decrementing the refcount in
get_device/put_device to track &ps->bus->dev, which name is "0.1".

Regardless having this patch or not, the refcount of the 0.1 mii_bus
device is 5 before loading the mv88e6xxx module on vf610-zii-dev-rev-b.

Below is a portion of dmesg:

    [    8.921647] get_device: 400d1000.etherne refcount: 4
    [    8.926225] get_device: 0.1 refcount: 2
    [    8.929561] get_device: mdio-mux refcount: 5
    [    8.934076] get_device: 0.1 refcount: 3
    [    8.937446] get_device: 0.1 refcount: 4
    [    8.940792] put_device: 0.1 refcount: 3
    [    8.944181] libphy: mdio_mux: probed
    [    8.947885] mdio_bus 0.1:00: mdio_device_register
    [    8.952649] get_device: 0.1:00 refcount: 2
    [    8.956283] get_device: 0.1 refcount: 4
    [    8.959838] get_device: 0.1:00 refcount: 3
    [    8.963991] get_device: 0.1:00 refcount: 4
    [    8.967598] put_device: 0.1:00 refcount: 3
    [    8.971298] get_device: 0.2 refcount: 2
    [    8.974687] get_device: mdio-mux refcount: 7

So it seems like of_ is managing the bus refcount on events such as a
new child node (0.1:00).

Thanks,

        Vivien

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/8] net: dsa: mv88e6xxx: misc probe improvements Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
  [PATCH net-next 6/8] net: dsa: mv88e6xxx: add chip detection helper Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
  [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus refcount Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
    Re: [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus  refcount Andrew Lunn <andrew@lunn.ch> - 2016-06-09 04:40 +0200
      Re: [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus refcount Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-10 22:00 +0200
        Re: [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus  refcount Andrew Lunn <andrew@lunn.ch> - 2016-06-10 22:10 +0200
  [PATCH net-next 2/8] net: dsa: mv88e6xxx: remove redundant assignments Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
    Re: [PATCH net-next 2/8] net: dsa: mv88e6xxx: remove redundant  assignments Andrew Lunn <andrew@lunn.ch> - 2016-06-09 04:40 +0200
  [PATCH net-next 5/8] net: dsa: mv88e6xxx: add switch register helpers Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
    Re: [PATCH net-next 5/8] net: dsa: mv88e6xxx: add switch register  helpers Andrew Lunn <andrew@lunn.ch> - 2016-06-09 04:40 +0200
      Re: [PATCH net-next 5/8] net: dsa: mv88e6xxx: add switch register helpers Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 15:00 +0200
  [PATCH net-next 3/8] net: dsa: mv88e6xxx: use already declared variables Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
    Re: [PATCH net-next 3/8] net: dsa: mv88e6xxx: use already declared  variables Andrew Lunn <andrew@lunn.ch> - 2016-06-09 04:40 +0200
  [PATCH net-next 8/8] net: dsa: mv88e6xxx: fail on mismatching probe Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
    Re: [PATCH net-next 8/8] net: dsa: mv88e6xxx: fail on mismatching  probe Andrew Lunn <andrew@lunn.ch> - 2016-06-09 04:30 +0200
      Re: [PATCH net-next 8/8] net: dsa: mv88e6xxx: fail on mismatching probe Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-10 22:40 +0200
  [PATCH net-next 7/8] net: dsa: mv88e6xxx: explicit compatible devices Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
    Re: [PATCH net-next 7/8] net: dsa: mv88e6xxx: explicit compatible  devices Andrew Lunn <andrew@lunn.ch> - 2016-06-09 04:20 +0200
      Re: [PATCH net-next 7/8] net: dsa: mv88e6xxx: explicit compatible devices Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-10 22:30 +0200
  [PATCH net-next 1/8] net: dsa: mv88e6xxx: fix style issues Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-09 02:50 +0200
    Re: [PATCH net-next 1/8] net: dsa: mv88e6xxx: fix style issues Andrew Lunn <andrew@lunn.ch> - 2016-06-09 04:30 +0200

csiph-web