f_phonet: avoid pskb_pull(), fix OOPS with CONFIG_HIGHMEM
Subsystems (3)
PATCH 1/1 f_phonet: avoid pskb_pull(), fix OOPS with CONFIG_HIGHMEM
In reply to a message not in the archiveThis is similar to what we already do in cdc-phonet.c in the same situation. pskb_pull() refuses to work with HIGHMEM, even if it is known that the socket buffer is entirely in "low" memory.
--- drivers/usb/gadget/f_phonet.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-)
drivers/usb/gadget/f_phonet.c +10 -5
@@ -346,14 +346,19 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)if (unlikely (!skb))break ; -skb_add_rx_frag (skb,skb_shinfo (skb)->nr_frags, page,0 , - req->actual); - page =NULL ; -if (req->actual < req->length) {/* Last fragment */ +if (skb->len ==0 ) {/* First fragment */ skb->protocol =htons (ETH_P_PHONET );skb_reset_mac_header (skb); -pskb_pull (skb,1 ); +/* Can't use pskb_pull() on page in IRQ */ +memcpy (skb_put (skb,1 ),page_address (page),1 ); + } + +skb_add_rx_frag (skb,skb_shinfo (skb)->nr_frags, page, + skb->len ==0 , req->actual); + page =NULL ; + +if (req->actual < req->length) {/* Last fragment */ skb->dev = dev; dev->stats.rx_packets++; dev->stats.rx_bytes += skb->len;
Signature · 1 line
1.7.1
From: Rémi Denis-Courmont <[email protected]>
Date: Wed, 23 Feb 2011 14:51:33 +0200
Quoted 5 lines
This is similar to what we already do in
cdc-phonet.cin the same situation.pskb_pull()refuses to work with HIGHMEM, even if it is known that the socket buffer is entirely in "low" memory.Signed-off-by Rémi Denis-Courmont <[email protected]>
Applied, thanks.
Quoted 10 lines · you
From: Rémi Denis-Courmont <[email protected]>
Date: Wed, 23 Feb 2011 14:51:33 +0200Quoted 5 lines
This is similar to what we already do in
cdc-phonet.cin the same situation.pskb_pull()refuses to work with HIGHMEM, even if it is known that the socket buffer is entirely in "low" memory.Signed-off-by Rémi Denis-Courmont <[email protected]>Applied, thanks.
Hmm, this is already somewhere in linux-usb, from what I understood (I suppose git-merge does not care much).
Signature · 6 lines
Rémi Denis-Courmont http://www.remlab.net/ -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
From: "Rémi Denis-Courmont" <[email protected]>
Date: Tue, 1 Mar 2011 09:34:30 +0200
Quoted 8 lines · you
Quoted 7 lines
From: Rémi Denis-Courmont <[email protected]>
Date: Wed, 23 Feb 2011 14:51:33 +0200Quoted 4 lines
This is similar to what we already do in
cdc-phonet.cin the same situation.pskb_pull()refuses to work with HIGHMEM, even if it is known that the socket buffer is entirely in "low" memory.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Rémi Denis-Courmont <[email protected]>Applied, thanks.
Hmm, this is already somewhere in linux-usb, from what I understood (I suppose git-merge does not care much).
Yeah, it'll work itself out without any problems.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html