netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Asmaa Mnebhi <asmaa@nvidia.com>
Cc: David Thompson <davthompson@nvidia.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>
Subject: Re: [PATCH net-next v3] Add Mellanox BlueField Gigabit Ethernet driver
Date: Wed, 18 Nov 2020 16:55:51 +0100	[thread overview]
Message-ID: <20201118155551.GD1800835@lunn.ch> (raw)
In-Reply-To: <CH2PR12MB3895318D3802419175BA42C3D7E10@CH2PR12MB3895.namprd12.prod.outlook.com>

> Yes mlxbf_gige_mdio_handle_phy_interrupt is used to check whether
> the interrupt is coming from GPIO12 (which is set in HW as the PHY
> INT_N pin). There is one HW interrupt line (here defined as
> MLXBF_GIGE_PHY_INT_N) shared among all the GPIOs and other
> components (like I2C).

So this is the key thing here. You have an interrupt controller, where
as the PHY subsystem wants a plain interrupt. Give the PHY subsystem a
plain interrupt, and it will do all the calls to configure the PHY,
enable interrupts in the PHY etc.

There is nothing stopping you have an interrupt controller inside an
Ethernet driver, or any other sort of driver. Take for example:

https://elixir.bootlin.com/linux/v5.10-rc4/source/drivers/net/dsa/mv88e6xxx/chip.c#L127

The Marvell Ethernet switches also have an interrupt
controller. Actually they have two nested controllers. This code
registers an irq domain with the linux core, so that the individual
interrupt sources can be used as just plain old Linux interrupts. The
irqdomain is responsible to masking and unmasking interrupts, in the
interrupt controller.

The end user of these interrupts, then just request them in the usual
way:

https://elixir.bootlin.com/linux/v5.10-rc4/source/drivers/net/dsa/mv88e6xxx/global1_atu.c#L419

So in your case, map the PHY interrupt in this domain, and pass it to
the PHY subsystem.

    Andrew

      reply	other threads:[~2020-11-18 15:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 23:14 [PATCH net-next v3] Add Mellanox BlueField Gigabit Ethernet driver David Thompson
2020-11-18  3:09 ` Andrew Lunn
2020-11-18 14:52   ` Asmaa Mnebhi
2020-11-18 15:55     ` Andrew Lunn [this message]

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=20201118155551.GD1800835@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=asmaa@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=davthompson@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.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).