wctdm24xxp, wcte12xp: Add voicebus_quiesce function.

voicebus_quiesce is like voicebus_stop, except that it doesn't wait for any
information to come back from the card. This prevents kexec from blocking
waiting for information from a potentially dead card.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Michael Spiceland <mspiceland@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9880 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2011-04-04 16:24:54 +00:00
parent 7b97611ef2
commit 58c1168185
4 changed files with 25 additions and 4 deletions

View File

@ -1154,6 +1154,26 @@ void voicebus_stop(struct voicebus *vb)
}
EXPORT_SYMBOL(voicebus_stop);
/**
* voicebus_quiesce - Halt the voicebus interface.
* @vb: The voicebus structure to quiet
*
* This ensures that the device is not engaged in any DMA transactions or
* interrupting. It does not grab any locks since it may be called by a dying
* kernel.
*/
void voicebus_quiesce(struct voicebus *vb)
{
if (!vb)
return;
/* Reset the device */
__vb_disable_interrupts(vb);
__vb_setctl(vb, 0x0000, 0x1);
__vb_getctl(vb, 0x0000);
}
EXPORT_SYMBOL(voicebus_quiesce);
/*!
* \brief Prepare the interface for module unload.
*

View File

@ -177,6 +177,7 @@ int __voicebus_init(struct voicebus *vb, const char *board_name,
void voicebus_release(struct voicebus *vb);
int voicebus_start(struct voicebus *vb);
void voicebus_stop(struct voicebus *vb);
void voicebus_quiesce(struct voicebus *vb);
int voicebus_transmit(struct voicebus *vb, struct vbb *vbb);
int voicebus_set_minlatency(struct voicebus *vb, unsigned int milliseconds);
int voicebus_current_latency(struct voicebus *vb);

View File

@ -4896,7 +4896,7 @@ static DEFINE_PCI_DEVICE_TABLE(wctdm_pci_tbl) = {
static void wctdm_shutdown(struct pci_dev *pdev)
{
struct wctdm *wc = pci_get_drvdata(pdev);
voicebus_stop(&wc->vb);
voicebus_quiesce(&wc->vb);
}
#endif

View File

@ -2369,11 +2369,11 @@ static DEFINE_PCI_DEVICE_TABLE(te12xp_pci_tbl) = {
{ 0 }
};
#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2, 6, 12)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
static void te12xp_shutdown(struct pci_dev *pdev)
{
struct t1 *wc = pci_get_drvdata(pdev);
voicebus_stop(&wc->vb);
voicebus_quiesce(&wc->vb);
}
#endif
@ -2383,7 +2383,7 @@ static struct pci_driver te12xp_driver = {
.name = "wcte12xp",
.probe = te12xp_init_one,
.remove = __devexit_p(te12xp_remove_one),
#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2, 6, 12)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
.shutdown = te12xp_shutdown,
#endif
.id_table = te12xp_pci_tbl,