Commit Graph

33 Commits

Author SHA1 Message Date
Shaun Ruffell
a209d1b433 wcte12xp: Use interruptible waits to decrease impact on load average.
The wcte12xp does all the checking for alarm in a user space workqueue.
Most of this time is spent sleeping waiting for reads from the framer to
complete.  Tasks in uninterruptible sleeps are added to running tasks
for the purposes of calculating load average. This change makes the
sleeps interruptible so as to not affect the load average as much.

For example, the following command will load and configure the driver and
then print the load average every 10 seconds.

]# modprobe wcte12xp && dahdi_cfg && ((x=12)); while [[ $x -gt 0 ]]; do cat
/proc/loadavg; sleep 10; let x=$x-1; done

With this change:
0.29 0.10 0.02 1/101 29945
0.24 0.10 0.02 1/101 29967
0.20 0.09 0.02 1/101 30019
0.17 0.09 0.02 1/101 30041
0.15 0.09 0.02 1/101 30062
0.12 0.08 0.02 1/101 30085
0.10 0.08 0.02 1/101 30107
0.09 0.08 0.02 1/101 30129
0.07 0.08 0.02 1/101 30151
0.14 0.09 0.02 1/101 30173
0.12 0.09 0.02 1/101 30195
0.10 0.08 0.02 1/101 30217
(and I've seen it get down to 0.0)

Before this change:
0.57 0.22 0.07 1/101 31920
0.48 0.21 0.07 1/101 31942
0.48 0.22 0.07 1/101 31964
0.48 0.23 0.08 1/101 31986
0.41 0.22 0.07 1/101 32008
0.42 0.23 0.08 1/101 32030
0.43 0.24 0.08 1/101 32054
0.45 0.25 0.09 1/101 32076
0.45 0.25 0.09 1/101 32098
0.46 0.26 0.10 1/101 32120
0.47 0.27 0.10 1/101 32172
0.39 0.26 0.10 1/101 32194

(closes issue #18142)
Reported by: foxfire
Tested by: foxfire

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9512

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9683 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:31:35 +00:00
Shaun Ruffell
a9d55bb3d7 dahdi: Prevent unloadable module on failed open.
If chan->span->ops->open() fails then the reference count of the module
implementing the board driver will not be decremented.  The result is a
module that would always be "in use" and unloadable.

This change makes sure to release that reference when open failed.

(closes issue #18422)
Reported by: avarvit

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Angelos Varvitsiotis <avarvit@admin.grnet.gr>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9510

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9682 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:31:26 +00:00
Tzafrir Cohen
c23a4dcab1 live_dahdi: fix usage of xpp.conf
Link live/usr/share/dahdi/xpp.conf from live/etc/dahdi/xpp.conf in
'config'. This makes the 'live' xpp.conf used rather than the global
xpp.conf .

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9508

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9681 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:31:18 +00:00
Tzafrir Cohen
abd2c1c21e xpd_pri: Remove pointless hooksig span op
If the span reports that it supports hooksig, DAHDI may fail to use RBS.
So remove a call to that stub function.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9506

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9680 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:31:11 +00:00
Tzafrir Cohen
3ae68b9ca6 xpd_pri: ignore DAHDI_VMWI and DAHDIVMWI_CONFIG
This fixes an annoying, though harmless issue: if Asterisk decides to send
voicemail messages to a channel (CAS, configured as FXS), We can't do
anything useful with them. So ignore them to avoid scary-looking messages
(from report_bad_ioctl()).

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9505

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9679 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:31:03 +00:00
Shaun Ruffell
740312ea26 wctdm24xxp, wcte12xp: Close a few potential resource assignment leaks.
There were some routes through the failure paths in __voicebus_init() where a
registered memory region was not subsequently released.  This change closes
those paths.

The result would be on subsequent loads of the driver after hitting the
failure condition you would see "IO Registers are in use by another module."
in dmesg.

request_mem_region/release_mem_region should most likely be converted to
devm_request_region and devm_release_region introduced in 2.6.20
(commit 9ac7849e35f705830f7b016ff272b0ff1f7ff759) which was introduced for
reasons just such as this.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9503

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9678 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:30:55 +00:00
Shaun Ruffell
88d8b68370 live_dahdi: only check for TOOLS_DIR when used
Only check that TOOLD_DIR is valid when it is actually needed (configure,
install, config). This allows not checking for it with *load on a
rsync-ed copy.

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9479

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9677 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:30:47 +00:00
Shaun Ruffell
26fdcdb51a Remove mutex emulation
Using semaphores as mutexes was removed from the kernel in 4882720b267b.
Just use straight semaphores now.  'DECLARE_MUTEX()' -> 'DEFINE_SEMAPHORE()'
and 'init_MUTEX()' -> 'sema_init()'.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
LKML-Reference: <20100907125057.562399240@linutronix.de>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9464

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9676 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:30:39 +00:00
Shaun Ruffell
aeb716625a wctdm24xxp: Detect FXS modules based on the 3210 SLIC.
Fixes a regression introduced in revision 5916 where FXS modules based
on the 3210 were not properly detected.

(closes issue #18184)
Reported by: bsexton
Patches:
      dahdi-fxo-detect.diff uploaded by bsexton (license 1133)

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9456

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9675 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:30:25 +00:00
Shaun Ruffell
c43fe554a9 wctdm24xxp: Leave FXO (DAA) always in full-wave ring detect mode.
In zaptel commit 4096 [1], all the debouncing of ring signals were moved
into software as opposed to using the ring validation circuit in DAA.
That commit failed to remove the initial check and set of the ring
validation circuit.

[1] http://svn.digium.com/view/zaptel?view=revision&revision=4096

(closes issue #16894)
Reported by: rde42

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9441

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9674 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:30:13 +00:00
Shaun Ruffell
ad83ff1f21 dahdi: '-o' -> '--no-same-owner' in drivers/dahdi/firmware/Makefile
It appears that in Centos 4, the version of tar doesn't like the -o
flag, but will honor the --no-same-owner flag.

(closes issue #16063)
Reported by: tzafrir

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9434

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9673 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:30:03 +00:00
Shaun Ruffell
ccc84c7095 wcte12xp, wctdm24xxp: Do not rely on polling main memory.
The voicebus library by default configures the PCI interface to poll the
descriptor ring for available buffers.  There are some platforms like
the Intel SG3420P motherboard where this does not appear to be
sufficient.  Writing to the transmit demand poll register resolves this
problem on these troublesome platforms. DAHDI-700 DAHDI-702.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9397

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9672 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:29:56 +00:00
Shaun Ruffell
81abcab4d4 wct4xxp: Drop usage of 'volatile' qualifier.
The registers on the device are already accessed with readl/writel and
the readchunk and writechunk are mapped into coherent DMA region.  The
contents of those buffers should not be changing in the middle of any
transmit/receive prep call.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9400

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9671 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:29:48 +00:00
Shaun Ruffell
e38cbd0869 dahdi: Make CONFIG_DAHDI_PPP off by default.
Before CONFIG_DAHDI_PPP can be on by default, some more work needs to be
done to ensure that the ppp_generic module is not always loaded and
that all channels do not carry around all the PPP members unnecessarily.

(issue #17990)

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kevin P. Fleming <kpfleming@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9392

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9670 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:29:40 +00:00
Shaun Ruffell
cfd46b51a2 dahdi: Fix for when PPP support is compiled as a kernel module.
When compiling dahdi-linux I expect ppp support to be compiled in even if the
kernel config has PPP configured as a module.

(closes issue #17990)
Reported by: jkroon
Patches:
      dahdi-config-ppp.diff uploaded by jkroon (license 714)

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9328

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9669 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:29:32 +00:00
Shaun Ruffell
ef8c38ad70 vpmadt032: Remove potential endless waits when resetting.
It is possible to softlock if the board stops delivering interrupts in
the middle of a reset.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9332

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9668 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:29:25 +00:00
Shaun Ruffell
9c5548919e vpmadt032: Honor the CONFIG_DAHDI_NO_ECHOCAN_DISABLE flag.
Setting this configuration option would not have had any impact when a
hardware echo canceler was in use.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9432

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9667 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:29:17 +00:00
Shaun Ruffell
dce9c6e0c4 xpp: Fixes init error for PRI devices with < 4 ports
Fixes a regression singce r8873: if pri_protocol is not explicitly set
(in /etc/dahdi/xpp.conf) and the device has (licences for) less than 4
"PRI" (E1/T1) ports, the initialization script will attempt to read from
a non-existing SysFS file, and bail out, resulting in a the device
failing to initialize.

For those non-existing ports we can just skip that part of the
initialization. So we just skip it.

Work around: explicitly set pri_protocol to E1 or T1, as needed.

Xorcom Rev: 8047. Ticket: 1334.

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9430

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9666 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:29:09 +00:00
Kinsey Moore
102d709038 dahdi: Anonymous member in dahdi_echocan_events union.
Make explicit what part of the union is being accessed.

(closes issue #15908)
Reported by: ys
Patches:
      dahdi-dahdi_echocan_events.diff uploaded by ys (license 281)

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9421

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9665 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:28:59 +00:00
Kinsey Moore
053c70fc47 dahdi: Fix 'void *' pointer arithmetic warnings.
(closes issue #15927)
Reported by: Max Khon
Patches:
      dahdi_echocan2.diff uploaded by Max Khon (license 884)
      void2.diff uploaded by Max Khon (license 884)

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9420

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9664 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:28:50 +00:00
Shaun Ruffell
b1837a9633 wctdm24xxp: Add optional FXO digital loopback if DEBUG is defined.
This module parameter will allow patgen/pattest to be used only on FXO
ports. *ALL* FXO ports will be placed in digital loopback mode when
set.

The current intent is for this to be removed as an optional module
parameter when there is a channel by channel representation in sysfs.
Otherwise, a new IOCTL would have to be defined and a tool written in
order to support this. DAHDI-696.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9391

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9663 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:28:42 +00:00
Shaun Ruffell
43ebb99002 dahdi: Be more tolerant of surprise removal of channels.
Enable DAHDI to detect if an operation on a file handle refers to a
channel that may have been unregistered. This can occur, for example,
when a board driver is hot-swapped out in a live system.

This patch ensures that file->private_data is always properly set for
any open channel, and it's set back to NULL when a channel is
unregistered.  This way file->private_data can be used to check whether
it's valid to perform an operation on the channel.  (NOTE:  There is
still a race condition here if the driver was unbound on one processor
during the window of time between when file->private_data was checked
and the system call finishes).

Also, since DAHDI should only return -ENODEV on read or write when there
was a surprise device removal on a running system this sleep can prevent
the system from becoming unresponsive if the userspace application does
not check for the -ENODEV error and constantly tries to call read with
elevated privileges.

(issue #17669)
Reported by: tzafrir
Tested by: sruffell

Review: https://reviewboard.asterisk.org/r/905/

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9353

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9662 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:28:28 +00:00
Shaun Ruffell
e119bbed46 wcte12xp, wctdm24xxp: Add call to 'pci_set_mwi' on initialization.
I have yet to personally come across a system where this actually
changes the observable behavior, but it certainly seems like the sane
thing to do and I would rather not let this float around as a patch when
I can just merge it in.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9326

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9661 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:28:21 +00:00
Shaun Ruffell
dd61a7c70f wcte12xp, wctdm24xxp: Remove redundant vb_enable_io_access.
These three bits are already set by 'pci_enable_device' and
'pci_set_master' calls.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9325

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9660 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:28:13 +00:00
Shaun Ruffell
b77bc833bc dahdi-base: All channels for a span are now unconfigured on shutdown
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9317

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9659 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:28:05 +00:00
Shaun Ruffell
2bd36973c3 dahdi_dummy: #include <linux/slab.h> for kzalloc and friends.
Fix the same issue as in r8550 for dahdi_dummy.c

(closes issue #17959)
Reported by: glen201

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9307

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9658 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:27:57 +00:00
Shaun Ruffell
6e12364fc4 wcte11xp, wcte12xp: Fix a long-standing issue with shutdown
Upon shutdown, both drivers would attempt to power down external
interfaces, but never attempted to bring them back up when the span was
restarted.  Removing that code allows the driver to work properly until
a better solution can be found.

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9316

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9657 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:27:49 +00:00
Shaun Ruffell
957841819b README: Remove references to dahdi_dummy.
Since dahdi_dummy is no longer required remove the references from
README.

(issue #17959)
Reported by: glen201

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9308

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9656 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:27:40 +00:00
Shaun Ruffell
b8beda0f5c dahdi: Fix compilation error when CONFIG_DAHDI_NET is defined.
Kernel interface for network devices changed. This is the patch from issue
plus a few trivial checkpatch.pl formatting changes (minus the >80 column
warnings).

(closes issue #17857)
Reported by: msink
Patches:
      dahdi_net-v2.patch uploaded by msink (license 1103)

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9247

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9655 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:27:32 +00:00
Shaun Ruffell
64533f9b18 wct4xxp: Update span-local struct with timing info
dahdi_tool was incorrectly reporting all spans to be in local timing
mode. This is because the driver tracks which span it's timing syncs to,
within the card local struct "wc". We have to manually go through and
copy timing updates to the span local structs because this is what
dahdi_tool actually reads.

dahdi-526

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9312

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9654 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:27:24 +00:00
Shaun Ruffell
6725b44af7 Turning on merge tracking.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9653 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 05:23:14 +00:00
Shaun Ruffell
ed089da04b Creating 2.4 branch.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9652 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-21 04:44:02 +00:00
Shaun Ruffell
bf3fe05dfb wct4xxp: Moving the transmit short detection behind debug module param.
This needs some more testing before it's on by default.  If the card is
otherwise functioning, these messages may be confusing to the user.  If
the card is not functioning, the driver can be reloaded with debug to
check for this condition.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9205 a0bf4364-ded3-4de4-8d8a-66a801d63aff
branched-2.4
2010-08-27 21:59:27 +00:00