[dahdi-commits] dahdi/linux.git branch "master" updated.
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Nov 26 11:00:20 CST 2013
branch "master" has been updated
via c0d52a04cb5c07e239ad03a374ac193dce722977 (commit)
via 1cf7d9b08c892404791b25eff6a743af2a660428 (commit)
from 3a0905b1ec0b55edd2f46485759985001a16852d (commit)
Summary of changes:
drivers/dahdi/wcaxx-base.c | 42 +++++++++++++++++++++------------------
drivers/dahdi/wctdm24xxp/base.c | 31 +++--------------------------
2 files changed, 26 insertions(+), 47 deletions(-)
- Log -----------------------------------------------------------------
commit c0d52a04cb5c07e239ad03a374ac193dce722977
Author: Shaun Ruffell <sruffell at digium.com>
Date: Tue Nov 26 10:41:44 2013 -0600
wctdm24xxp: Remove assigned callback.
For the spans exported by the wctdm24xxp, the channels are not going to change
after they are already registered.
This eliminates a problem when analog spans are unassigned/reassigned and the
not_ready goes negative, thereby causing many warnings in the kernel.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 20e417d..5e35fde 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -4384,32 +4384,6 @@ wctdm_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype)
return wctdm_wait_for_ready(wc);
}
-/*
- * wctdm24xxp_assigned - Called when span is assigned.
- * @span: The span that is now assigned.
- *
- * This function is called by the core of DAHDI after the span number and
- * channel numbers have been assigned.
- *
- */
-static void wctdm24xxp_assigned(struct dahdi_span *span)
-{
- struct dahdi_span *s;
- struct dahdi_device *ddev = span->parent;
- struct wctdm *wc = NULL;
-
- list_for_each_entry(s, &ddev->spans, device_node) {
- wc = (container_of(s, struct wctdm_span, span))->wc;
- if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &s->flags))
- return;
- }
-
- if (wc) {
- WARN_ON(0 == wc->not_ready);
- --wc->not_ready;
- }
-}
-
static const struct dahdi_span_ops wctdm24xxp_analog_span_ops = {
.owner = THIS_MODULE,
.hooksig = wctdm_hooksig,
@@ -4419,7 +4393,6 @@ static const struct dahdi_span_ops wctdm24xxp_analog_span_ops = {
.watchdog = wctdm_watchdog,
.chanconfig = wctdm_chanconfig,
.dacs = wctdm_dacs,
- .assigned = wctdm24xxp_assigned,
#ifdef VPM_SUPPORT
.enable_hw_preechocan = wctdm_enable_hw_preechocan,
.disable_hw_preechocan = wctdm_disable_hw_preechocan,
@@ -4438,7 +4411,6 @@ static const struct dahdi_span_ops wctdm24xxp_digital_span_ops = {
.spanconfig = b400m_spanconfig,
.chanconfig = b400m_chanconfig,
.dacs = wctdm_dacs,
- .assigned = wctdm24xxp_assigned,
#ifdef VPM_SUPPORT
.enable_hw_preechocan = wctdm_enable_hw_preechocan,
.disable_hw_preechocan = wctdm_disable_hw_preechocan,
@@ -5951,6 +5923,9 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return -1;
}
+ WARN_ON(wc->not_ready <= 0);
+ --wc->not_ready;
+
dev_info(&wc->vb.pdev->dev,
"Found a %s: %s (%d BRI spans, %d analog %s)\n",
(is_hx8(wc)) ? "Hybrid card" : "Wildcard TDM",
commit 1cf7d9b08c892404791b25eff6a743af2a660428
Author: Shaun Ruffell <sruffell at digium.com>
Date: Mon Nov 25 11:38:11 2013 -0600
wcaxx: Use startup/shutdown callbacks to protect access to channel registers.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
diff --git a/drivers/dahdi/wcaxx-base.c b/drivers/dahdi/wcaxx-base.c
index 46db079..97bd00b 100644
--- a/drivers/dahdi/wcaxx-base.c
+++ b/drivers/dahdi/wcaxx-base.c
@@ -33,6 +33,7 @@
#include <linux/moduleparam.h>
#include <linux/firmware.h>
#include <linux/crc32.h>
+#include <linux/interrupt.h>
#include <stdbool.h>
@@ -1986,8 +1987,7 @@ static void wcaxx_handle_receive(struct wcxb *xb, void *_frame)
wc->module_poll_time = wc->framecount + MODULE_POLL_TIME_MS;
}
- /* TODO: This protection needs to be thought about. */
- if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &wc->span.flags))
+ if (!test_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags))
return;
for (j = 0; j < DAHDI_CHUNKSIZE; j++) {
@@ -2012,8 +2012,7 @@ static void wcaxx_handle_transmit(struct wcxb *xb, void *_frame)
wcxb_spi_handle_interrupt(wc->master);
- /* TODO: This protection needs to be thought about. */
- if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &wc->span.flags))
+ if (!test_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags))
return;
_dahdi_transmit(&wc->span);
@@ -3384,36 +3383,41 @@ wcaxx_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype)
}
/*
- * wcaxx_assigned - Called when span is assigned.
- * @span: The span that is now assigned.
- *
- * This function is called by the core of DAHDI after the span number and
- * channel numbers have been assigned.
+ * wcaxx_span_shutdown - Called when span is unassigned or shutdown.
+ * @span: The span that is shutdown
*
*/
-static void wcaxx_assigned(struct dahdi_span *span)
+static int wcaxx_span_shutdown(struct dahdi_span *span)
{
- struct dahdi_span *s;
- struct dahdi_device *ddev = span->parent;
- struct wcaxx *wc = NULL;
+ struct wcaxx *wc = container_of(span, struct wcaxx, span);
+ clear_bit(DAHDI_FLAGBIT_RUNNING, &span->flags);
+ synchronize_irq(wc->xb.pdev->irq);
+ return 0;
+}
- list_for_each_entry(s, &ddev->spans, device_node) {
- wc = container_of(s, struct wcaxx, span);
- if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &s->flags))
- return;
- }
+/*
+ * wcaxx_span_startup - Called when span is unassigned or shutdown.
+ * @span: The span that is shutdown
+ *
+ */
+static int wcaxx_span_startup(struct file *file, struct dahdi_span *span)
+{
+ set_bit(DAHDI_FLAGBIT_RUNNING, &span->flags);
+ return 0;
}
+
static const struct dahdi_span_ops wcaxx_span_ops = {
.owner = THIS_MODULE,
.hooksig = wcaxx_hooksig,
+ .shutdown = wcaxx_span_shutdown,
+ .startup = wcaxx_span_startup,
.open = wcaxx_open,
.close = wcaxx_close,
.ioctl = wcaxx_ioctl,
.watchdog = wcaxx_watchdog,
.chanconfig = wcaxx_chanconfig,
.dacs = wcaxx_dacs,
- .assigned = wcaxx_assigned,
#ifdef VPM_SUPPORT
.echocan_create = wcaxx_echocan_create,
.echocan_name = wcaxx_echocan_name,
-----------------------------------------------------------------------
--
dahdi/linux.git
More information about the dahdi-commits
mailing list