Message ID | 1471855708-10897-3-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Geert Uytterhoeven |
Headers | show
Return-Path: <linux-renesas-soc-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AECE60574 for <patchwork-linux-renesas-soc@patchwork.kernel.org>; Mon, 22 Aug 2016 08:49:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AA5128888 for <patchwork-linux-renesas-soc@patchwork.kernel.org>; Mon, 22 Aug 2016 08:49:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F39282888F; Mon, 22 Aug 2016 08:49:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 882DA28888 for <patchwork-linux-renesas-soc@patchwork.kernel.org>; Mon, 22 Aug 2016 08:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754383AbcHVIti (ORCPT <rfc822;patchwork-linux-renesas-soc@patchwork.kernel.org>); Mon, 22 Aug 2016 04:49:38 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:62275 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753123AbcHVIt3 (ORCPT <rfc822;linux-renesas-soc@vger.kernel.org>); Mon, 22 Aug 2016 04:49:29 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 22 Aug 2016 17:49:27 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id C617948432; Mon, 22 Aug 2016 17:49:27 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id AC2F61806F; Mon, 22 Aug 2016 17:49:27 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id A2D4E1800A; Mon, 22 Aug 2016 17:49:27 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id TAB16078; Mon, 22 Aug 2016 17:49:27 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="218328573" Received: from mail-sg2apc01lp0245.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.245]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 22 Aug 2016 17:49:26 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3SbBUXliWakZcyNkdtGRcZJrCAImvyaMvysrO9M+O0Y=; b=nXL8zs98v/YGGPoZUL+4hRiuZ3NZmmUwStCmvO6Koxpp079AVqDCat4O0fA4s1KXkUMFsfs3Z1x92ssTNIksLb0OETdk62ndpjtqV7X9/7m621WHEKKtPgcolaUuGUemoIPw3YyD2TZ6d4V3rALRQMjSIFD5n+8fj4dXwzDKnk8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by HKXPR06MB0550.apcprd06.prod.outlook.com (10.161.177.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Mon, 22 Aug 2016 08:49:23 +0000 From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> To: <balbi@kernel.org> CC: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>, Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Subject: [PATCH 2/4] usb: gadget: u_ether: add a flag to avoid skb_reserve() calling Date: Mon, 22 Aug 2016 17:48:26 +0900 Message-ID: <1471855708-10897-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471855708-10897-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1471855708-10897-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0026.jpnprd01.prod.outlook.com (10.164.162.8) To HKXPR06MB0550.apcprd06.prod.outlook.com (10.161.177.140) X-MS-Office365-Filtering-Correlation-Id: 32ca1312-64bf-4e62-36ee-08d3ca6937b1 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0550; 2:P9oIxrvFQ+tyIhRT7tOu33Qotcl53Lboate+xDcE9gS6Effzfz9mEIiyLgzr7gkKhxnsYu/McWf/qY9WBQBXC7AwrHHMnYtdN7MhYgdNkyg77ZcrPgFJiOxmt9AakW2Iybk9m/+jqb7CumZEfSAB+cgL2Sd+cVz3FjUM8c8EI2Xmu5eeAY386odxQYWFSrC3; 3:r4bRH1qoZNMkk63TW/nI3ieXGxbYisdF1zW7JaBRF+18+5jpqCI50fQpld/0iDG+D5l1oud5KGmMDlj1LrUHLZTMWSFJX4e1msoDmiXV8JRzjPJcR1i2+FKXnBNRxhd4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB0550; X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0550; 25:2bGL3iv8rF7fR/L6HFlkCRxk9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MUw1du+zxW1/esA+IXF0RC49g66C3HDKaAkYQRBTpAFpyq+u3ELONg5w7rWjY5VlB2pP8mujzZLpflWJOK7DdW1UAFEDbKH2zQ3XSh9tlgoEPieBCXtMuk2FLzQ6e07DjNUOAQzyRwEdKsxlLcdO1lbRVIBcwoDlXq9AGYfjGa/0Kemz4cVoqj1bL5QWj6NuQM2EyEYC3/5zJ/+l1Ou698sv9rwP8HTzpAp+KvjjK5DSq/T2EmSOyTI0tOkeMbKdmxd2AArNbFs9j6q/8zErLnFRuBCa/UgGEwU7q+xHhp+c9E9h6JK+gZmzJYQ12t7n6jm8bchWHjFDPk2WiXH3thTlHxcqf1D2RE35k96/xsh/dsYTypCGRCqwKycH9z5V9NeQ4CHPeGcmKgspqTF7U8r7Y4kM8lIJmON2z3v0nRScsLhnXE85PxXvoGRmvESbGpchVrlkiYFpGA+rJLfxtsIUoeg8Sawm X-Microsoft-Antispam-PRVS: <HKXPR06MB05507864BAA75ABCA26D8ED1B8E80@HKXPR06MB0550.apcprd06.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:HKXPR06MB0550; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB0550; X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0550; 4:gt2HjEHb3t2eibhm1g3ijr0VNbMiDHI26+PmNxT0wSOqsauCGxsDudQ/VGbMvaIVMg6NVEKNpmb8m7a3Cax1ofGvwilAs3JMxQCnyStBRI7nXbly+gmNd2gXrMcSH/INvhOqBw4gb8aF9ekZvG/P+yK2s/GyhiD9Gvog7ugGdTQzuF79NCOHMWmiLuzWI3vQSbF9zilqSPUfJRdpjFnd9yLkUin2G5xEc9l7MnMXeKkrAdEQ8iqKxET4EPGHTRC3EL/i58IvOaFgxHNSFAs/l/fRhT3Yw+foUHCyunnXJXeTFjzXZtBdKYjRU9bCCT0W/Rqvf+z7E+SfD6PCbqEKTforYl6nrqUlwybICFOk8AaQx8WGagO70Yz0gsuuFdJcL2qPDmqhAz3+FFFQrZktCg== X-Forefront-PRVS: 00429279BA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(3846002)(2906002)(92566002)(78352004)(4326007)(7736002)(305945005)(33646002)(229853001)(2351001)(77096005)(7846002)(2950100001)(106356001)(97736004)(189998001)(5003940100001)(5660300001)(105586002)(50226002)(110136002)(107886002)(81156014)(81166006)(8676002)(42186005)(76176999)(4001430100002)(19580405001)(48376002)(19580395003)(50466002)(68736007)(586003)(6116002)(50986999)(101416001)(47776003)(66066001)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB0550; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB0550; 23:YSfu5+n6aPB2eUY0p/v/lp7TzyWPUlgO6OnNx8i3T?= =?us-ascii?Q?Son11rqwnbLrJdMmPfR1oYi8rucx3Gdhi773NMrSodbYRv5iHoFBc2yNGvtR?= =?us-ascii?Q?3EKY8VTthwUvgHd60WDZ0atWv9tE4Ryelmsss4+CdMK9KM8vvJbk65x0zG2F?= =?us-ascii?Q?5nZpw4fCQBHnFHTVybAGnFAI9TozTtWkjdqDZ6E2Hlob2DvhSD4sgqXC7oYX?= =?us-ascii?Q?KHXXT2Au7I5x8kaBhXOgufnlHmXqbZyuky+WoMO6zPUMsw3ofNxxruwHqWwy?= =?us-ascii?Q?PdkLTSfGqSOE9K3XOqee2k/VLGpLN2ZyDSYojE217chrgIQtXrZUwAFtjXH8?= =?us-ascii?Q?0ocnaie2FV0DoyeFc8wPRR1jmLmR4ILoeEL6JKVI/Q64z/eDGaIbWxOQKN6y?= =?us-ascii?Q?A4aXOA5YGuNAh0DNzSEzyYkc9/yPvgKHM0Av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KDC4Gu0ezYcCvEjoQvqYr+wuIh61VFFPABDKqXFs72DwthngRmXG4WvbXexVosdVmm5Zq5Ah9elSqB03asi+9PAmBS3DMv+qTSaiodHyQya+ykwTqwyZLSWDqpiYj3PBrBosqPB0h97ulQfI8oTRwHO90LR2RlBF282GD/k3zWoPz5pfnuqhl8Pz9x9XWcBMYWzLXvkP3LFmqvH/d0GjOVvw==; 5:HOggUPeTqRwPfBGPpDtRkt1XuIHVsxm2UjwIDfd0elM2DvtAZHU/PNyr6xisTf4A6UNq+EeEL0ZMrui+JfiYKpe/6/749VK2DfqE6j05Xa5aNhh34l633CcNz8s+ZeKpfQe9BcX9R1iy6SQbKhd3rQ==; 24:KiRQwzQjh+Ujd2sdlmqA3V7RIY8TgJM6+JrR8IqiOBL4KAxu3Y/f3k6GjheiY32/YvJVDueD1+ZmEA3jFDWCv0XX97fdQn/lYQmbkDahQmY=; 7:kiY1SYbMyH1Sg88J94Zr2R8sQxXAdH5OPQ0Kx/cYxuFEOBknUam0ASRixyAdeaFkes+s037TZTPujpq2iZXCjjXUUppTt3et7+Gyz98UsKOC7UKTT6eixYluR5DH02aDpMaOma7+YdxTVLAMjuuxWtds0AUXUGI9xyNwMASuLPPLi1ivjwSCdqsiInhkFKHP9OsrMhTO8c4ce37yUcDavNimaipdzJx4OHeAv/3RNGXhiXbeWNI/4dpL5F09eXVY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0550; 20:DUgo6XPIEAsEbMcJXrvUa1ABD3l0EWjs6HOUmZABjzZtY5RjpYZ2y4yfI40mHWxHXiRxEdL50CtMEYmm/3MTSutQFgQj9Y8qgl+qTSOfL1khxGAXxDmaTR9t9jCYJaE/Zw60DnKOW3NBJ6dwZAfB/OF1+syaH7SAgHyvP9pwvtw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2016 08:49:23.8845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB0550 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: <linux-renesas-soc.vger.kernel.org> X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c index 5f562c1..3be4b93 100644 --- a/drivers/usb/gadget/function/u_ether.c +++ b/drivers/usb/gadget/function/u_ether.c @@ -82,6 +82,7 @@ struct eth_dev { #define WORK_RX_MEMORY 0 bool zlp; + bool no_skb_reserve; u8 host_mac[ETH_ALEN]; u8 dev_mac[ETH_ALEN]; }; @@ -233,7 +234,8 @@ rx_submit(struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags) * but on at least one, checksumming fails otherwise. Note: * RNDIS headers involve variable numbers of LE32 values. */ - skb_reserve(skb, NET_IP_ALIGN); + if (likely(!dev->no_skb_reserve)) + skb_reserve(skb, NET_IP_ALIGN); req->buf = skb->data; req->length = size; @@ -1063,6 +1065,7 @@ struct net_device *gether_connect(struct gether *link) if (result == 0) { dev->zlp = link->is_zlp_ok; + dev->no_skb_reserve = link->no_skb_reserve; DBG(dev, "qlen %d\n", qlen(dev->gadget, dev->qmult)); dev->header_len = link->header_len; diff --git a/drivers/usb/gadget/function/u_ether.h b/drivers/usb/gadget/function/u_ether.h index c77145b..81d94a7 100644 --- a/drivers/usb/gadget/function/u_ether.h +++ b/drivers/usb/gadget/function/u_ether.h @@ -64,6 +64,7 @@ struct gether { struct usb_ep *out_ep; bool is_zlp_ok; + bool no_skb_reserve; u16 cdc_filter;
This patch adds a flag "no_skb_reserve" in struct eth_dev. So, if a peripheral driver sets the quirk_avoids_skb_reserve flag, upper network gadget drivers (e.g. f_ncm.c) can avoid skb_reserve() calling using the flag as well. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> --- drivers/usb/gadget/function/u_ether.c | 5 ++++- drivers/usb/gadget/function/u_ether.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)