Bugzilla – Attachment 728075 Details for
Bug 1043231
Kernel build failed at armv7hl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
0017-spi-expose-master-transfer-size-limitation.patch
0017-spi-expose-master-transfer-size-limitation.patch (text/plain), 2.00 KB, created by
Matwey Kornilov
on 2017-06-07 19:37:50 UTC
(
hide
)
Description:
0017-spi-expose-master-transfer-size-limitation.patch
Filename:
MIME Type:
Creator:
Matwey Kornilov
Created:
2017-06-07 19:37:50 UTC
Size:
2.00 KB
patch
obsolete
>From d8bc7d596514a9e63404cf6e6caa39f605e792df Mon Sep 17 00:00:00 2001 >From: Michal Suchanek <hramrach@gmail.com> >Date: Wed, 2 Dec 2015 10:38:21 +0000 >Subject: [PATCH 17/19] spi: expose master transfer size limitation. > >On some SPI controllers it is not feasible to transfer arbitrary amount >of data at once. > >When the limit on transfer size is a few kilobytes at least it makes >sense to use the SPI hardware rather than reverting to gpio driver. > >The protocol drivers need a way to check that they do not sent overly >long messages, though. > >Signed-off-by: Michal Suchanek <hramrach@gmail.com> >Signed-off-by: Mark Brown <broonie@kernel.org> >Git-commit: 4acad4aae10d1fa79a075b38b5c73772c44f576c >Patch-mainline: v4.5-rc1 >Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> >--- > include/linux/spi/spi.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h >index cce80e6dc7d1..3eebc6c235fb 100644 >--- a/include/linux/spi/spi.h >+++ b/include/linux/spi/spi.h >@@ -425,6 +425,12 @@ struct spi_master { > #define SPI_MASTER_MUST_RX BIT(3) /* requires rx */ > #define SPI_MASTER_MUST_TX BIT(4) /* requires tx */ > >+ /* >+ * on some hardware transfer size may be constrained >+ * the limit may depend on device transfer settings >+ */ >+ size_t (*max_transfer_size)(struct spi_device *spi); >+ > /* lock and mutex for SPI bus locking */ > spinlock_t bus_lock_spinlock; > struct mutex bus_lock_mutex; >@@ -832,6 +838,15 @@ extern int spi_async(struct spi_device *spi, struct spi_message *message); > extern int spi_async_locked(struct spi_device *spi, > struct spi_message *message); > >+static inline size_t >+spi_max_transfer_size(struct spi_device *spi) >+{ >+ struct spi_master *master = spi->master; >+ if (!master->max_transfer_size) >+ return SIZE_MAX; >+ return master->max_transfer_size(spi); >+} >+ > /*---------------------------------------------------------------------------*/ > > /* All these synchronous SPI transfer routines are utilities layered >-- >2.12.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 1043231
:
728059
|
728060
|
728061
|
728062
|
728063
|
728064
|
728065
|
728066
|
728067
|
728068
|
728069
|
728070
|
728071
|
728072
|
728073
|
728074
| 728075 |
728076
|
728077
|
728521
|
728695
|
728770