Commit a754f416 authored by Federico Vaga's avatar Federico Vaga

kernel: do not cleanup what should be already cleaned up

On spec driver remove, do not clean-up VIC stuff. The VIC should be cleaned
by the mezzanine driver when it release all its handlers (see patch a628fa3).
Just leave a reminder for driver developer when something goes wrong.

Moreove, we do not need to user sver_irq_exit() any more. If the mezzanine
driver is properly written it will clear all its interrupts, and thanks to
patch a628fa3 we can safely assume that everything was cleared.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 2b9ee79d
......@@ -368,8 +368,6 @@ static int svec_remove(struct device *pdev, unsigned int ndev)
clear_bit(SVEC_FLAG_FMCS_REGISTERED, &svec->flags);
}
svec_irq_exit(svec);
svec_unmap_window(svec, MAP_CR_CSR);
svec_unmap_window(svec, MAP_REG);
svec_remove_sysfs_files(svec);
......@@ -653,8 +651,6 @@ int svec_reconfigure(struct svec_dev *svec)
if (svec->map[MAP_REG])
svec_unmap_window(svec, MAP_REG);
svec_irq_exit(svec);
error = svec_setup_csr(svec);
if (error)
return error;
......
......@@ -274,6 +274,12 @@ void svec_fmc_destroy(struct svec_dev *svec)
return;
fmc_device_unregister_n(svec->fmcs, svec->fmcs_n);
WARN(test_bit(SVEC_FLAG_IRQS_REQUESTED, &svec->flags) || svec->vic,
"A Mezzanine driver didn't release all its IRQ handlers (VIC %p, FLAG 0x%x)\n",
svec->vic, svec->flags);
memset(svec->fmcs, 0, sizeof(struct fmc_devices *) * SVEC_N_SLOTS);
if(svec->verbose)
dev_info(svec->dev, "%d fmc devices unregistered\n", svec->fmcs_n);
......
......@@ -119,13 +119,3 @@ int svec_irq_free(struct fmc_device *fmc)
return 0;
}
/* cleanup function, disables VME master interrupt when the driver is unloaded */
void svec_irq_exit(struct svec_dev *svec)
{
if (!test_bit(SVEC_FLAG_IRQS_REQUESTED, &svec->flags))
return;
vme_free_irq(svec->current_vector);
memset(svec->fmc_handlers, 0, sizeof(svec->fmc_handlers));
}
......@@ -33,10 +33,7 @@ static int svec_fw_cmd_reset (struct svec_dev * card)
{
int err = 0;
if (test_bit (SVEC_FLAG_FMCS_REGISTERED, &card->flags))
{
svec_fmc_destroy (card);
svec_irq_exit (card);
}
if (!card->map[MAP_CR_CSR])
err = svec_map_window (card, MAP_CR_CSR);
......
......@@ -156,7 +156,6 @@ int svec_irq_request(struct fmc_device *fmc, irq_handler_t handler, char *name,
int flags);
void svec_irq_ack(struct fmc_device *fmc);
int svec_irq_free(struct fmc_device *fmc);
void svec_irq_exit(struct svec_dev *svec);
#endif /* __SVEC_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment