From: Andrew Lunn <andrew@lunn.ch>
To: Woojung.Huh@microchip.com
Cc: f.fainelli@gmail.com, netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] net: phy: Support for non-HW interrupt devices
Date: Fri, 8 Jan 2016 16:51:11 +0100 [thread overview]
Message-ID: <20160108155111.GF4389@lunn.ch> (raw)
In-Reply-To: <9235D6609DB808459E95D78E17F2E43D4049389F@CHN-SV-EXMX02.mchp-main.com>
> As you may already know, USB Interrupt Pipe is not actual interrupt and
> USB driver is beyond USB Host driver which deals with HW interrupt directly over
> request_irq(). So even we can put some code in USB Host driver to interface with
> PHYLIB, it is more likely adding another USB stack to handle this pseudo interrupt.
> I don't think it's good approach to solve this problem.
You don't need any code in the USB irq handler.
I'm not too familiar with USB networking, but looking at usbnet.c, it
looks like intr_complete() gets called when there is a USB Interrupt
Pipe event. That calls into the drivers status() method.
In this status method, you need to trigger a Linux interrupt. By that,
i mean you need to call handle_nested_irq().
What i found useful was looking at how drivers/gpio/gpip-pca953x.c
works. That is an i2c GPIO expander, which supports GPIO
interrupts. When the device indicates an interrupt event, you need to
read an i2c register on the device to see which GPIO line has
triggered it, and then call handle_nestd_irq() for the corresponding
interrupt.
Humm, in fact, take a look at drivers/gpio/gpio-dln2.c It is a USB
GPIO expander, with interrupt support.
Andrew
next prev parent reply other threads:[~2016-01-08 15:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-07 23:14 [PATCH] net: phy: Support for non-HW interrupt devices Woojung.Huh
2016-01-08 0:42 ` Andrew Lunn
2016-01-08 2:08 ` Florian Fainelli
2016-01-08 3:25 ` Woojung.Huh
2016-01-08 15:51 ` Andrew Lunn [this message]
2016-01-08 15:58 ` Woojung.Huh
2016-01-08 19:24 ` Andrew Lunn
2016-01-08 20:27 ` Florian Fainelli
2016-01-08 20:30 ` Woojung.Huh
2016-01-08 21:36 ` Andrew Lunn
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=20160108155111.GF4389@lunn.ch \
--to=andrew@lunn.ch \
--cc=Woojung.Huh@microchip.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--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).