Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f91c75d6
Commit
f91c75d6
authored
Mar 11, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branches 'spi/topic/doc', 'spi/topic/dw' and 'spi/topic/flash' into spi-next
parents
6beb9fec
ee7683a3
2f6fdefb
49023d2e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
19 deletions
+21
-19
drivers/spi/spi-dw-mid.c
drivers/spi/spi-dw-mid.c
+2
-2
drivers/spi/spi-dw-mmio.c
drivers/spi/spi-dw-mmio.c
+0
-5
drivers/spi/spi.c
drivers/spi/spi.c
+17
-12
include/linux/spi/spi.h
include/linux/spi/spi.h
+2
-0
No files found.
drivers/spi/spi-dw-mid.c
View file @
f91c75d6
...
...
@@ -89,10 +89,10 @@ static void mid_spi_dma_exit(struct dw_spi *dws)
if
(
!
dws
->
dma_inited
)
return
;
dmaengine_terminate_
all
(
dws
->
txchan
);
dmaengine_terminate_
sync
(
dws
->
txchan
);
dma_release_channel
(
dws
->
txchan
);
dmaengine_terminate_
all
(
dws
->
rxchan
);
dmaengine_terminate_
sync
(
dws
->
rxchan
);
dma_release_channel
(
dws
->
rxchan
);
}
...
...
drivers/spi/spi-dw-mmio.c
View file @
f91c75d6
...
...
@@ -47,11 +47,6 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
/* Get basic io resource and map it */
mem
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
mem
)
{
dev_err
(
&
pdev
->
dev
,
"no mem resource?
\n
"
);
return
-
EINVAL
;
}
dws
->
regs
=
devm_ioremap_resource
(
&
pdev
->
dev
,
mem
);
if
(
IS_ERR
(
dws
->
regs
))
{
dev_err
(
&
pdev
->
dev
,
"SPI region map failed
\n
"
);
...
...
drivers/spi/spi.c
View file @
f91c75d6
...
...
@@ -1047,6 +1047,7 @@ EXPORT_SYMBOL_GPL(spi_finalize_current_transfer);
* __spi_pump_messages - function which processes spi message queue
* @master: master to process queue for
* @in_kthread: true if we are in the context of the message pump thread
* @bus_locked: true if the bus mutex is held when calling this function
*
* This function checks if there is any spi message in the queue that
* needs processing and if so call out to the driver to initialize hardware
...
...
@@ -1056,7 +1057,8 @@ EXPORT_SYMBOL_GPL(spi_finalize_current_transfer);
* inside spi_sync(); the queue extraction handling at the top of the
* function should deal with this safely.
*/
static
void
__spi_pump_messages
(
struct
spi_master
*
master
,
bool
in_kthread
)
static
void
__spi_pump_messages
(
struct
spi_master
*
master
,
bool
in_kthread
,
bool
bus_locked
)
{
unsigned
long
flags
;
bool
was_busy
=
false
;
...
...
@@ -1152,7 +1154,9 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
}
}
mutex_lock
(
&
master
->
bus_lock_mutex
);
if
(
!
bus_locked
)
mutex_lock
(
&
master
->
bus_lock_mutex
);
trace_spi_message_start
(
master
->
cur_msg
);
if
(
master
->
prepare_message
)
{
...
...
@@ -1162,8 +1166,7 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
"failed to prepare message: %d
\n
"
,
ret
);
master
->
cur_msg
->
status
=
ret
;
spi_finalize_current_message
(
master
);
mutex_unlock
(
&
master
->
bus_lock_mutex
);
return
;
goto
out
;
}
master
->
cur_msg_prepared
=
true
;
}
...
...
@@ -1172,21 +1175,23 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
if
(
ret
)
{
master
->
cur_msg
->
status
=
ret
;
spi_finalize_current_message
(
master
);
mutex_unlock
(
&
master
->
bus_lock_mutex
);
return
;
goto
out
;
}
ret
=
master
->
transfer_one_message
(
master
,
master
->
cur_msg
);
if
(
ret
)
{
dev_err
(
&
master
->
dev
,
"failed to transfer one message from queue
\n
"
);
mutex_unlock
(
&
master
->
bus_lock_mutex
);
return
;
goto
out
;
}
mutex_unlock
(
&
master
->
bus_lock_mutex
);
out:
if
(
!
bus_locked
)
mutex_unlock
(
&
master
->
bus_lock_mutex
);
/* Prod the scheduler in case transfer_one() was busy waiting */
cond_resched
();
if
(
!
ret
)
cond_resched
();
}
/**
...
...
@@ -1198,7 +1203,7 @@ static void spi_pump_messages(struct kthread_work *work)
struct
spi_master
*
master
=
container_of
(
work
,
struct
spi_master
,
pump_messages
);
__spi_pump_messages
(
master
,
true
);
__spi_pump_messages
(
master
,
true
,
false
);
}
static
int
spi_init_queue
(
struct
spi_master
*
master
)
...
...
@@ -2479,7 +2484,7 @@ static int __spi_sync(struct spi_device *spi, struct spi_message *message,
spi_sync_immediate
);
SPI_STATISTICS_INCREMENT_FIELD
(
&
spi
->
statistics
,
spi_sync_immediate
);
__spi_pump_messages
(
master
,
false
);
__spi_pump_messages
(
master
,
false
,
bus_locked
);
}
wait_for_completion
(
&
done
);
...
...
include/linux/spi/spi.h
View file @
f91c75d6
...
...
@@ -304,6 +304,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
* @min_speed_hz: Lowest supported transfer speed
* @max_speed_hz: Highest supported transfer speed
* @flags: other constraints relevant to this driver
* @max_transfer_size: function that returns the max transfer size for
* a &spi_device; may be %NULL, so the default %SIZE_MAX will be used.
* @bus_lock_spinlock: spinlock for SPI bus locking
* @bus_lock_mutex: mutex for SPI bus locking
* @bus_lock_flag: indicates that the SPI bus is locked for exclusive use
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment