Re: Registering IRQ for MT7530 internal PHYs

2021-01-18 Thread Landen Chao
Hi Qingfang, On Wed, 2021-01-06 at 16:54 +0800, DENG Qingfang wrote: > Hi Andrew, > > On Wed, Dec 30, 2020 at 11:23 PM Andrew Lunn wrote: > > > > On Wed, Dec 30, 2020 at 09:42:09AM +, Marc Zyngier wrote: > > > > +static irqreturn_t > > > > +mt7530_irq(int irq, void *data) > > > > +{ > > > >

Re: Registering IRQ for MT7530 internal PHYs

2021-01-06 Thread DENG Qingfang
Hi Andrew, On Wed, Dec 30, 2020 at 11:23 PM Andrew Lunn wrote: > > On Wed, Dec 30, 2020 at 09:42:09AM +, Marc Zyngier wrote: > > > +static irqreturn_t > > > +mt7530_irq(int irq, void *data) > > > +{ > > > + struct mt7530_priv *priv = data; > > > + bool handled = false; > > > + int phy;

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Heiner Kallweit
On 30.12.2020 17:15, Florian Fainelli wrote: > > > On 12/30/2020 1:12 AM, Heiner Kallweit wrote: >> On 30.12.2020 10:07, DENG Qingfang wrote: >>> Hi Heiner, >>> Thanks for your reply. >>> >>> On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit >>> wrote: I don't think that's the best option.

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Florian Fainelli
On 12/30/2020 7:16 AM, Andrew Lunn wrote: >> 2. Allocated ds->slave_mii_bus before calling ds->ops->setup, because >> we cannot call dsa_slave_mii_bus_init which is private. >> >> Any better ideas? > > Do what mv88e6xxx does, allocate the MDIO bus inside the switch > driver. Yes, exactly, or

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Florian Fainelli
On 12/30/2020 1:12 AM, Heiner Kallweit wrote: > On 30.12.2020 10:07, DENG Qingfang wrote: >> Hi Heiner, >> Thanks for your reply. >> >> On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit wrote: >>> I don't think that's the best option. >> >> I'm well aware of that. >> >>> You may want to add a

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 09:42:09AM +, Marc Zyngier wrote: > > +static irqreturn_t > > +mt7530_irq(int irq, void *data) > > +{ > > + struct mt7530_priv *priv = data; > > + bool handled = false; > > + int phy; > > + u32 val; > > + > > + val = mt7530_read(priv, MT7530_SYS_INT_STS); > >

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Andrew Lunn
> 2. Allocated ds->slave_mii_bus before calling ds->ops->setup, because > we cannot call dsa_slave_mii_bus_init which is private. > > Any better ideas? Do what mv88e6xxx does, allocate the MDIO bus inside the switch driver. Andrew

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Andrew Lunn
> > +static void mt7530_irq_bus_lock(struct irq_data *d) > > +{ > > + struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); > > + > > + mutex_lock(>reg_mutex); > > Are you always guaranteed to be in a thread context? I guess that > is the case, given that you request a threaded interrupt,

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Marc Zyngier
Hi Qingfang, On 2020-12-30 04:22, DENG Qingfang wrote: Hi, I added MT7530 IRQ support and registered its internal PHYs to IRQ. It works but my patch used two hacks. 1. Removed phy_drv_supports_irq check, because config_intr and handle_interrupt are not set for Generic PHY. 2. Allocated

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Heiner Kallweit
On 30.12.2020 10:07, DENG Qingfang wrote: > Hi Heiner, > Thanks for your reply. > > On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit wrote: >> I don't think that's the best option. > > I'm well aware of that. > >> You may want to add a PHY driver for your chip. Supposedly it >> supports at

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread DENG Qingfang
Hi Heiner, Thanks for your reply. On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit wrote: > I don't think that's the best option. I'm well aware of that. > You may want to add a PHY driver for your chip. Supposedly it > supports at least PHY suspend/resume. You can use the RTL8366RB > PHY

Re: Registering IRQ for MT7530 internal PHYs

2020-12-29 Thread Heiner Kallweit
On 30.12.2020 05:22, DENG Qingfang wrote: > Hi, > > I added MT7530 IRQ support and registered its internal PHYs to IRQ. > It works but my patch used two hacks. > > 1. Removed phy_drv_supports_irq check, because config_intr and > handle_interrupt are not set for Generic PHY. > I don't think

Registering IRQ for MT7530 internal PHYs

2020-12-29 Thread DENG Qingfang
Hi, I added MT7530 IRQ support and registered its internal PHYs to IRQ. It works but my patch used two hacks. 1. Removed phy_drv_supports_irq check, because config_intr and handle_interrupt are not set for Generic PHY. 2. Allocated ds->slave_mii_bus before calling ds->ops->setup, because we