summaryrefslogtreecommitdiff
path: root/drivers/staging/sxg/sxg.h
diff options
context:
space:
mode:
authorMithlesh Thukral <mithlesh@linsyssoft.com>2009-01-19 20:24:30 +0530
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-03 14:53:10 -0700
commit6a2946baa97337ad17c967ee8ec0bbfef491af30 (patch)
tree83f75c032c18f0fce25f831ab1a6704daba71e4d /drivers/staging/sxg/sxg.h
parentd9d578bff771229c017582d746259ac282ee01e2 (diff)
Staging: sxg: Locking related changes. Fix locking levels
* Fix locking related issues like taking locks at right level. * Convert some variables to atomic, to prevent taking them while incrementing or decrementing them. Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com> Signed-off-by: Christopher Harrer <charrer@alacritech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sxg/sxg.h')
-rw-r--r--drivers/staging/sxg/sxg.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/sxg/sxg.h b/drivers/staging/sxg/sxg.h
index 2d0ad1977ccc..4d983414b5fd 100644
--- a/drivers/staging/sxg/sxg.h
+++ b/drivers/staging/sxg/sxg.h
@@ -290,7 +290,7 @@ struct sxg_stats {
struct list_entry *_ple; \
if ((_pAdapt->FreeSglBufferCount < SXG_MIN_SGL_BUFFERS) && \
(_pAdapt->AllSglBufferCount < SXG_MAX_SGL_BUFFERS) && \
- (_pAdapt->AllocationsPending == 0)) { \
+ (atomic_read(&_pAdapt->pending_allocations) == 0)) { \
sxg_allocate_buffer_memory(_pAdapt, \
(sizeof(struct sxg_scatter_gather) + SXG_SGL_BUF_SIZE),\
SXG_BUFFER_TYPE_SGL); \
@@ -670,6 +670,9 @@ struct adapter_t {
ushort FreeRcvBlockCount; /* # of free rcv descriptor blocks */
ushort AllRcvBlockCount; /* Number of total receive blocks */
ushort ReceiveBufferSize; /* SXG_RCV_DATA/JUMBO_BUFFER_SIZE only */
+ /* Converted this to a atomic variable
+ u32 AllocationsPending; */
+ atomic_t pending_allocations;
u32 AllocationsPending; /* Receive allocation pending */
u32 RcvBuffersOnCard; /* SXG_DATA_BUFFERS owned by card */
/* SGL buffers */