Re: [PATCH 1/1] net: fec: fix miss init spinlock
From: David Miller <davem@davemloft.net>
Date: 2013-02-21 18:03:20
From: Jim Baxter <redacted> Date: Thu, 21 Feb 2013 17:59:23 +0000 (UTC)
Fabio Estevam <festevam <at> gmail.com> writes:quoted
On Thu, Feb 21, 2013 at 2:07 PM, Jim Baxter <jim_baxter <at> mentor.com> wrote:quoted
Is the general issue in this driver that the fec_probe function: request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); is called before fec_ptp_init() and fec_enet_init() have been called so that there is a chance the fec_enet_interrupt can occur before the hardware anddataquoted
quoted
structures are fully setup?The scenario you described is fixed by the patch that Frank proposed at: http://patchwork.ozlabs.org/patch/222164/That is a good patch that will stop interrupts occurring before request_irq is called. What about the problem of fec_enet_interrupt calling fec_ptp_start_cyclecounter before fec_ptp_init has been called? Should fec_enet_init and fec_ptp_init be setup before the request_irq is called?
This is a reocurring theme, and there is only one answer. All software state MUCH be completely, and fully, initialized before request_irq() is invoked. There is no other valid way to proceed in this area.