From: <Arun.Ramadoss@microchip.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<ceggers@arri.de>, <pabeni@redhat.com>
Cc: <olteanv@gmail.com>, <UNGLinuxDriver@microchip.com>,
<vivien.didelot@gmail.com>, <andrew@lunn.ch>,
<linux@armlinux.org.uk>, <Tristram.Ha@microchip.com>,
<f.fainelli@gmail.com>, <kuba@kernel.org>, <edumazet@google.com>,
<Woojung.Huh@microchip.com>, <davem@davemloft.net>
Subject: Re: [Patch net] net: dsa: microchip: remove IRQF_TRIGGER_FALLING in request_threaded_irq
Date: Fri, 16 Dec 2022 04:07:20 +0000 [thread overview]
Message-ID: <8142b2b482f11b03b6c5e4e977c649f0e9fb4ef1.camel@microchip.com> (raw)
In-Reply-To: <2280237.ElGaqSPkdT@n95hx1g2>
Hi Christian,
On Thu, 2022-12-15 at 14:50 +0100, Christian Eggers wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> Hi Paolo,
>
> On Thursday, 15 December 2022, 12:29:22 CET, Paolo Abeni wrote:
> > On Tue, 2022-12-13 at 15:44 +0530, Arun Ramadoss wrote:
> > > KSZ swithes used interrupts for detecting the phy link up and
> > > down.
> > > During registering the interrupt handler, it used
> > > IRQF_TRIGGER_FALLING
> > > flag. But this flag has to be retrieved from device tree instead
> > > of hard
> > > coding in the driver,
> >
> > Out of sheer ignorance, why?
>
> As far as I know, some IRQF_ flags should be set through the firmware
> (e.g. device tree) instead hard coding them into the driver. On my
> platform, I have to use IRQF_TRIGGER_LOW instead of
> IRQF_TRIGGER_FALLING.
> If the value is hard coded into the driver, the value from the driver
> will have precedence.
>
> See also: https://stackoverflow.com/a/40051191
>
> > > so removing the flag.
> >
> > It looks like the device tree currently lack such item, so this is
> > effecivelly breaking phy linkup/linkdown?
>
> What is "the" device tree. Do you mean the device tree for your
> specific
> board, or the example under
> Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml?
> The latter doesn't mention the irq at all.
>
> BTW: In my kernel log I get the following messages:
>
> > ksz9477-switch 0-005f: configuring for fixed/rmii link mode
> > ksz9477-switch 0-005f lan0 (uninitialized): PHY [dsa-0.0:00] driver
> > [Microchip KSZ9477] (irq=POLL)
> > ksz9477-switch 0-005f: Link is Up - 100Mbps/Full - flow control off
> > ksz9477-switch 0-005f lan1 (uninitialized): PHY [dsa-0.0:01] driver
> > [Microchip KSZ9477] (irq=POLL)
>
> Should I see something different than "irq=POLL" when an
> irq line is provided in the device tree?
If the device tree is provided *interrupt controller and interrupt
cells*, the kernel message should print the irq number like (irq=67)
instead of POLL. (67 is random number).
Following is the device tree snippet,
ksz9563: switch@0 {
compatible = "microchip,ksz9563";
reg = <0>;
spi-max-frequency = <44000000>;
interrupt-parent = <&pioB>;
interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
#interrupt-cells = <2>;
resetb-gpios = <&pioD 18 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&pinctrl_spi_ksz_rst>;
status = "okay";
....
}
>
> regards
> Christian
>
>
>
next prev parent reply other threads:[~2022-12-16 4:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 10:14 [Patch net] net: dsa: microchip: remove IRQF_TRIGGER_FALLING in request_threaded_irq Arun Ramadoss
2022-12-15 11:29 ` Paolo Abeni
2022-12-15 13:50 ` Christian Eggers
2022-12-16 4:07 ` Arun.Ramadoss [this message]
2022-12-20 1:30 ` 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=8142b2b482f11b03b6c5e4e977c649f0e9fb4ef1.camel@microchip.com \
--to=arun.ramadoss@microchip.com \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=ceggers@arri.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.com \
/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