This signaling command is useful for any connection parameter change
procedure, thus it is important to allow access to it from outside this
translation unit.
Signed-off-by: Felipe F. Tonello
---
include/net/bluetooth/l2cap.h | 3 +++
net/bluetooth/l2cap_core.c| 31
h the store_hint set is sent to user-space so an application
can store the connection parameters for persistence reasons.
Signed-off-by: Felipe F. Tonello
---
include/net/bluetooth/bluetooth.h | 8 +++
net/bluetooth/l2cap_sock.c| 110 ++
2 files changed
user-space API
* Added refactor function
Felipe F. Tonello (4):
Bluetooth: L2CAP: Refactor L2CAP_CONN_PARAM_UPDATE_REQ into a function
Bluetooth: L2CAP: Add handler for Connection Parameter Update Response
Bluetooth: L2CAP: Add BT_LE_CONN_PARAM socket option
Bluetooth: Handle Slave Connection
ction parameters
accordingly. If the request was rejected, we don't do anything.
Signed-off-by: Felipe F. Tonello
---
include/net/bluetooth/l2cap.h | 2 ++
net/bluetooth/l2cap_core.c| 47 +++
2 files changed, 49 insertions(+)
diff --git a/i
f the slave device wishes to
persist with these parameters, it should use the L2CAP connection
parameters upade request upon a completed connection.
Signed-off-by: Felipe F. Tonello
---
net/bluetooth/mgmt.c | 53
1 file changed, 53 insertions(+)
Patch #1 removes a unnecessary and confusing parameter from alloc_ep_req().
Also, this series updates f_hid function to use alloc/free_ep_req() instead of
allocating/freeing requests directly.
Felipe F. Tonello (3):
usb: gadget: remove useless parameter in alloc_ep_req()
usb: gadget: f_hid
Use gadget's framework allocation function instead of directly calling
usb_ep_alloc_request().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/driver
: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c| 2 +-
drivers/usb/gadget/function/f_loopback.c | 6 ++
drivers/usb/gadget/function/f_midi.c | 2 +-
drivers/usb/gadget/function/f_sourcesink.c | 6 ++
drivers/usb/gadget/u_f.c | 7 +++
drivers/usb
We should always use free_ep_req() when allocating requests with
alloc_ep_req().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/drivers/usb/gadget
wMaxPacketSize.
Felipe F. Tonello (10):
usb: gadget: fix usb_ep_align_maybe endianness and new usb_ep_align
usb: gadget: change len to size_t on alloc_ep_req()
usb: gadget: align buffer size when allocating for OUT endpoint
usb: gadget: f_midi: remove alignment code for OUT endpoint
usb: gadget
512 is the value used by wMaxPacketSize, as specified by the USB Spec. This
makes sure this driver uses, by default, the most optimal value for IN and OUT
endpoint requests.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 2 +-
drivers/usb/gadget/legacy/gmidi.c
The new version of alloc_ep_req() already aligns the buffer size to
wMaxPacketSize on OUT endpoints.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers
useful to be used by USB requests
allocator functions.
Signed-off-by: Felipe F. Tonello
---
include/linux/usb/gadget.h | 17 ++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 612dbdfa388e..3cc93237ff98
Length of buffers should be of type size_t whenever possible. Altough
recommended, this change has no real practical change, unless a driver has a
uses a huge or negative buffer size - it might help find these bugs.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/u_f.c | 2 +-
drivers
The default_length parameter of alloc_ep_req was not really necessary
and gadget drivers would almost always create an inline function to pass
the same value to len and default_len.
So this patch also removes duplicate code from few drivers.
Signed-off-by: Felipe F. Tonello
---
drivers/usb
We should always use free_ep_req() when allocating requests with
alloc_ep_req().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/drivers/usb/gadget
This refactor results in a cleaner state machine code and promotes
consistency, readability, and maintanability of this driver.
This refactor state machine was well tested and it is currently running in
production code and devices.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget
Using usb_ep_align() makes sure that the buffer size for OUT endpoints is
always aligned with wMaxPacketSize (512 usually). This makes sure
that no buffer has the wrong size, which can cause nasty bugs.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/u_f.c | 3 +++
drivers/usb/gadget
This change makes sure that the ALSA buffers are cleaned if an endpoint
becomes disabled.
Before this change, if the internal ALSA buffer did overflow, the MIDI
function would stop sending MIDI to the host.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 27
Use gadget's framework allocation function instead of directly calling
usb_ep_alloc_request().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/driver
useful to be used by USB requests
allocator functions.
Signed-off-by: Felipe F. Tonello
---
include/linux/usb/gadget.h | 17 ++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 612dbdfa388e..3cc93237ff98
Using usb_ep_align() makes sure that the buffer size for OUT endpoints is
always aligned with wMaxPacketSize (512 usually). This makes sure
that no buffer has the wrong size, which can cause nasty bugs.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/u_f.c | 3 +++
drivers/usb/gadget
The new version of alloc_ep_req() already aligns the buffer size to
wMaxPacketSize on OUT endpoints.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers
This refactor results in a cleaner state machine code and promotes
consistency, readability, and maintanability of this driver.
This refactor state machine was well tested and it is currently running in
production code and devices.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget
This change makes sure that the ALSA buffers are cleaned if an endpoint
becomes disabled.
Before this change, if the internal ALSA buffer did overflow, the MIDI
function would stop sending MIDI to the host.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 27
The default_length parameter of alloc_ep_req was not really necessary
and gadget drivers would almost always create an inline function to pass
the same value to len and default_len.
So this patch also removes duplicate code from few drivers.
Signed-off-by: Felipe F. Tonello
---
drivers/usb
* Added documentation to alloc_ep_req and free_ep_req
* Improved commit message on patch 7
Changes from v1:
* Added patches 1, 2, 7, 8 ,9.
* Patch 3 removes max_t() for buffer alignment with wMaxPacketSize
Felipe F. Tonello (9):
usb: gadget: fix usb_ep_align_maybe endianness and new
Use gadget's framework allocation function instead of directly calling
usb_ep_alloc_request().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/driver
We should always use free_ep_req() when allocating requests with
alloc_ep_req().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/drivers/usb/gadget
512 is the value used by wMaxPacketSize, as specified by the USB Spec. This
makes sure this driver uses, by default, the most optimal value for IN and OUT
endpoint requests.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 2 +-
drivers/usb/gadget/legacy/gmidi.c
The new version of alloc_ep_req() already aligns the buffer size to
wMaxPacketSize on OUT endpoints.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers
Using usb_ep_align() makes sure that the buffer size for OUT endpoints is
always aligned with wMaxPacketSize (512 usually). This makes sure
that no buffer has the wrong size, which can cause nasty bugs.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/u_f.c | 3 +++
1 file changed, 3
This parameter was not really necessary and gadget drivers would almost always
create an inline function to pass the same value to len and default_len.
So this patch also removes duplicate code from few drivers.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c
512 is the value used by wMaxPacketSize, as specified by the USB Spec. This
makes sure this driver uses, by default, the most optimal value for IN and OUT
endpoint requests.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 2 +-
drivers/usb/gadget/legacy/gmidi.c
This change makes sure that the ALSA buffers are cleaned if an endpoint
becomes disabled.
Before this change, if the internal ALSA buffer did overflow, the MIDI
function would stop sending MIDI to the host.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 27
This refactor results in a cleaner state machine code and promotes
consistency, readability, and maintanability of this driver.
This refactor state machine was well tested and it is currently running in
production code and devices.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget
-explanatory.
Changes from v1:
* Added patches 1, 2, 7, 8 ,9.
* Patch 3 removes max_t() for buffer alignment with wMaxPacketSize
Felipe F. Tonello (9):
usb: gadget: fix usb_ep_align_maybe endianness and new usb_ep_align
usb: gadget: align buffer size when allocating for OUT endpoint
usb: gadget
This parameter was not really necessary and gadget drivers would almost always
create an inline function to pass the same value to len and default_len.
So this patch also removes duplicate code from few drivers.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c
We should always use free_ep_req() when allocating requests with
alloc_ep_req().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/drivers/usb/gadget
Use gadget's framework allocation function instead of directly calling
usb_ep_alloc_request().
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_hid.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/function/f_hid.c
b/driver
useful to be used by USB requests
allocator functions.
Signed-off-by: Felipe F. Tonello
---
include/linux/usb/gadget.h | 17 ++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 612dbdfa388e..b8fa6901b881
USB spec specifies wMaxPacketSize to be little endian (as other properties),
so when using this variable in the driver we should convert to the current
CPU endianness if necessary.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 2 +-
1 file changed, 1 insertion
512 is the value used by wMaxPacketSize, as specified by the USB Spec. This
makes sure this driver uses, by default, the most optimal value for IN and OUT
endpoint requests.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 2 +-
drivers/usb/gadget/legacy/gmidi.c
This refactor results in a cleaner state machine code and promotes
consistency, readability, and maintanability of this driver.
This refactor state machine was well tested and it is currently running in
production code and devices.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget
This change makes sure that the ALSA buffers are cleaned if an endpoint
becomes disabled.
Before this change, if the internal ALSA buffer did overflow, the MIDI
function would stop sending MIDI to the host.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 27
ation, which is nice to have.
Felipe F. Tonello (4):
usb: gadget: f_midi: fixed endianness when using wMaxPacketSize
usb: gadget: f_midi: defaults buflen sizes to 512
usb: gadget: f_midi: refactor state machine
usb: gadget: f_midi: drop substreams when disabling endpoint
drivers/usb/gadget/fun
and replacing it with
wMaxPacketSize of the appropriate endpoint where needed.
Signed-off-by: Felipe F. Tonello
---
v2:
- Removed buflen
- use le16_to_cpu() in order to avoid endianess issues
drivers/usb/gadget/function/f_midi.c | 14 ++
drivers/usb/gadget/function/u_midi.h | 1
]
HOST: [PING]
DEVICE: [NAK]
HOST: [PING]
DEVICE: [NAK]
...
HOST: [PING]
DEVICE: [NAK]
This patch fixes this problem by setting the minimum usb_request's buffer size
for the OUT endpoint as its wMaxPacketSize.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.
necessary. In this case it
is used a spinlock since f_midi_transmit is also called by usb_request->complete
callback in interrupt context.
Cc: # v4.5+
Fixes: e1e3d7ec5da3 ("usb: gadget: f_midi: pre-allocate IN requests")
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/
This refactor results in a cleaner state machine code and as a result fixed a
bug when packaging a USB-MIDI packet right after a non-conformant MIDI byte
stream.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 204 ++-
1 file changed
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_midi.c
index 9a9e6112e224..5c7f5c780fda 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b
flags. The default values are what the gadget used to use
for backward compatibility.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/legacy/gmidi.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/legacy/gmidi.c
b/drivers/usb/gadget
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 77 +++-
1 file changed, 40 insertions(+), 37 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_midi.c
index 8475e3dc82d4..9a9e6112e224
Also it performs better then previous implementation that
allocated a usb_request for every new transmit made.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/us
Patches are pretty much self-described.
Patch 1 is revised from comments.
Patch 2 is a bug fix.
Felipe F. Tonello (5):
usb: gadget: f_midi: refactor state machine
usb: gadget: f_midi: added spinlock on transmit function
usb: gadget: gmidi: remove bus powered requirement on bmAttributes
Signed-off-by: Felipe F. Tonello
---
Documentation/devicetree/bindings/sound/fsl-asoc-card.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
index
add cs4271 and cs42727 support for fsl-asoc-card
Signed-off-by: Felipe F. Tonello
---
Documentation/devicetree/bindings/sound/fsl-asoc-card.txt | 9 +
sound/soc/fsl/Kconfig | 4 ++--
sound/soc/fsl/fsl-asoc-card.c | 7
add cs4271 and cs42727 support for fsl-asoc-card
Signed-off-by: Felipe F. Tonello
---
.../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 ++
sound/soc/fsl/Kconfig | 4 +-
sound/soc/fsl/fsl-asoc-card.c | 7
3 files
This is the initial imx-cs427x device-tree-only machine driver working with
fsl_ssi driver. More features can be added on top of it later.
Signed-off-by: Felipe F. Tonello
---
.../devicetree/bindings/sound/imx-audio-cs427x.txt | 47 +
sound/soc/fsl/Kconfig
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_midi.c
index bbff20697f76..b7d3f5a10bf0 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b
This ensures that at any point on the function if a goto to setup_fail is
made, it will unlock the mutex.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b
Also it performs better then previous implementation that
allocated a usb_request for every new transmit made.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_m
This refactor results in a cleaner state machine code and as a result fixed a
bug when packaging a MIDI-USB packet right after a non-conformant MIDI byte
stream.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 204 ++-
1 file changed
Patch 1:
The main improvement is the refactor of the state machine MIDI parser.
It is better to read and handles states properly, even weird ones.
Patch 3:
Fix a race condition.
Patches 3-4:
Miscelaneous fixes.
Felipe F. Tonello (4):
usb: gadget: f_midi: refactor state machine
usb
This refactor results in a cleaner state machine code and as a result fixed a
bug when packaging a MIDI-USB packet right after a non-conformant MIDI byte
stream.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 205 +--
1 file changed
g a wrong MIDI-USB request.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 243 ---
1 file changed, 141 insertions(+), 102 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_midi.c
in
Also it performs better then previous implementation that
allocated a usb_request for every new transmit made.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_m
ndpoints only when setting up MIDIStreaming interface
Felipe F. Tonello (3):
usb: gadget: f_midi: set altsettings only for MIDIStreaming interface
usb: gadget: f_midi: fail if set_alt fails to allocate requests
usb: gadget: f_midi: pre-allocate IN requests
drivers/usb/gadget/function/
better multiple MIDI Gadget ports, always
processing the last processed MIDI substream if the last USB request wasn't
enought to handle the whole stream.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 166 +++
drivers/usb/gadget/l
This ensures that the midi function will only work if the proper number of
IN and OUT requrests are allocated. Otherwise the function will work with less
requests then what the user wants.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 3 ++-
1 file changed, 2
This avoids duplication of USB requests for OUT endpoint and
re-enabling endpoints.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget
This makes sure f_midi doesn't try to enqueue data when the IN endpoint is
disabled, ie, USB cable is disconnected.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_m
nts only when setting up MIDIStreaming interface
Felipe F. Tonello (7):
usb: gadget: f_midi: Transmit data only when IN ep is enabled
usb: gadget: f_midi: remove duplicated code
usb: gadget: define free_ep_req as universal function
usb: gadget: f_midi: fix leak on failed to enqueue out reque
This patch fixes a memory leak that occurs when an endpoint fails to enqueue
the request. If that happens the complete function will never be called, thus
never freeing the request.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 1 +
1 file changed, 1 insertion
Remove unnecessary headers and variables.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/legacy/gmidi.c | 8
1 file changed, 8 deletions(-)
diff --git a/drivers/usb/gadget/legacy/gmidi.c
b/drivers/usb/gadget/legacy/gmidi.c
index 8a18348..be8e91d 100644
--- a/drivers/usb
This function is shared between gadget functions, so this avoid unnecessary
duplicated code and potentially avoid memory leaks.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 6 --
drivers/usb/gadget/function/f_sourcesink.c | 6 --
drivers/usb/gadget
This avoids duplication of USB requests for OUT endpoint and
re-enabling endpoints.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget
better multiple MIDI Gadget ports, always
processing the last processed MIDI substream if the last USB request wasn't
enought to handle the whole stream.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 174 +++
drivers/usb/gadget/l
This code is duplicated from f_midi_start_ep(midi, f, midi->out_ep).
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 19 ---
1 file changed, 19 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_mid
_hardware_enqueue() didn't check for errors when using
add_td_to_list() which can fail if dma_pool_alloc fails, thus
causing a kernel panic when lastnode->ptr is NULL.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/chipidea/udc.c | 19 ++-
1 file changed, 14 insertio
This makes sure f_midi doesn't try to enqueue data when the IN endpoint is
disabled, ie, USB cable is disconnected.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/fun
This function is shared between gadget functions, so this avoid unnecessary
duplicated code and potentially avoid memory leaks.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 6 --
drivers/usb/gadget/function/f_sourcesink.c | 6 --
drivers/usb/gadget
.
changes in v4:
- pre-alocation of in requests.
- more code clean up
- fix memory leak on out requests
- configure endpoints only when setting up MIDIStreaming interface
Felipe F. Tonello (7):
usb: gadget: f_midi: Transmit data only when IN ep is enabled
usb: gadget: f_midi: remove duplicated
This patch fixes a memory leak that occurs when an endpoint fails to enqueue
the request. If that happens the complete function will never be called, thus
never freeing the request.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 1 +
1 file changed, 1 insertion
This code is duplicated from f_midi_start_ep(midi, f, midi->out_ep).
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 20
1 file changed, 20 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_mid
better multiple MIDI Gadget ports, always
processing the last processed MIDI substream if the last USB request wasn't
enought to handle the whole stream.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 173 +++
drivers/usb/gadget/l
This avoids duplication of USB requests for OUT endpoint and
re-enabling endpoints.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_midi.c
Remove unnecessary headers and variables.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/legacy/gmidi.c | 10 --
1 file changed, 10 deletions(-)
diff --git a/drivers/usb/gadget/legacy/gmidi.c
b/drivers/usb/gadget/legacy/gmidi.c
index da19c48..055390b 100644
--- a/drivers/usb
This makes sure f_midi doesn't try to enqueue data when the IN endpoint is
disabled, ie, USB cable is disconnected.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/fun
This code is duplicated from f_midi_start_ep(midi, f, midi->out_ep).
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 20
1 file changed, 20 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_mid
req->actual == req->length means that there is no data left to enqueue,
so free the request.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drive
This fix a memory leak that will occur in this case.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_midi.c
index 93212ca
Here is the third version of this patch set. It includes memory leakage bug
fix, improvements and code cleanups.
Felipe F. Tonello (4):
usb: gadget: f_midi: free usb request when done
usb: gadget: f_midi: free request when usb_ep_queue fails
usb: gadget: f_midi: Transmit data only when IN
req->actual == req->length means that there is no data left to enqueue,
so free the request.
Signed-off-by: Felipe F. Tonello
---
Changes in v2:
* Re enqueue not fully completed requests, instead of read ALSA buffers.
drivers/usb/gadget/function/f_midi.c | 10 ++
1 file chan
If CONFIG_PM or CONFIG_PM_SLEEP is not set, driver will not compile
properly.
Signed-off-by: Felipe F. Tonello
---
Changes for v2:
* removed unnecessary #ifdef CONFIG_PM_SLEEP.
drivers/usb/chipidea/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb
req->actual == req->length means that there is no data left to enqueue,
so free the request.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drive
If CONFIG_PM or CONFIG_PM_SLEEP is not set, driver will not compile
properly.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/chipidea/core.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 3ad48e1
This fix a memory leak that will occur in this case.
Signed-off-by: Felipe F. Tonello
---
drivers/usb/gadget/function/f_midi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_midi.c
b/drivers/usb/gadget/function/f_midi.c
index e92aff5
necessary so the NMEA
data is not corrupted.
* iflags: added IGNCR: Ignore carriage return on input.
* oflags: removed ONLCR: (XSI) Map NL to CR-NL on output.
Signed-off-by: Felipe F. Tonello
---
drivers/tty/serial/Kconfig | 9 ++
drivers/tty/serial/Makefile | 1 +
drivers/tty
From: "Felipe F. Tonello"
Make sure user-space will receive the touch end event even if the device
driver suspends while touchscreen is still active (with fingers touching it).
Signed-off-by: Felipe F. Tonello
---
drivers/input/touchscreen/egalax_ts.c | 5 +
1 file changed, 5
1 - 100 of 119 matches
Mail list logo