[From nobody Thu Jun 25 05:54:41 2020
Received: from mail-he1eur01on0066.outbound.protection.outlook.com
 ([104.47.0.66] helo=EUR01-HE1-obe.outbound.protection.outlook.com)
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1fRZcQ-0005wx-1A
 for openwrt-devel@lists.openwrt.org; Sat, 09 Jun 2018 08:53:10 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=darbyshire-bryant.me.uk; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xKiwmIAySjyB+3bMHbAwfs+XKOZNZB2CQpfaol88/hM=;
 b=pesocmPvN4Hjk1l2y141sYVVXYoJCXnwYEGIBYvlndXjCUApq33eCWuj4wfcmHA5OVLcVv+mSyakIH8zZXX20sMHTbvkzqfXbo3ISDM5QwCRcQ7UimePblWeuOM05Nk/YEqbV338GEkS35xx5OKnvbZrC/sO8PZLdg9H0gHCllk=
Authentication-Results: spf=none (sender IP is )
 smtp.mailfrom=kevin@darbyshire-bryant.me.uk; 
Received: from Kevins-MBP.lan.darbyshire-bryant.me.uk (151.224.33.36) by
 DB6PR07MB4248.eurprd07.prod.outlook.com (2603:10a6:6:51::21) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.863.6; Sat, 9 Jun 2018 08:52:50 +0000
From: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
To: openwrt-devel@lists.openwrt.org
Cc: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
Subject: [PATCH] kernel: bump 4.9 to 4.9.107
Date: Sat,  9 Jun 2018 09:52:45 +0100
Message-Id: &lt;20180609085245.37798-1-ldir@darbyshire-bryant.me.uk&gt;
X-Mailer: git-send-email 2.15.1 (Apple Git-101)
MIME-Version: 1.0
Content-Type: text/plain
X-Originating-IP: [151.224.33.36]
X-ClientProxiedBy: LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:9::14) To DB6PR07MB4248.eurprd07.prod.outlook.com
 (2603:10a6:6:51::21)
X-MS-PublicTrafficType: Email
X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0;
 RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020);
 SRVR:DB6PR07MB4248; 
X-Microsoft-Exchange-Diagnostics: 1; DB6PR07MB4248;
 3:6yFW2Vx+clgr2z6XtS2hG7lD1tRZFnc7AQ0rqT/ZAd2SkEXQ6EFkNDiDqcAZJaLrisHSQsjiQ3SzUNjlXa6gna6bS/kYK4YBnKvUZv2aHtVskL6GXhVZfW7X66K8lVoJDWDbGT98K0MdQRAT1uCvSJI3DkfCGj+PvbANBMDwVT7r+QKIQKZyoavPNWlSR1dxGM0J4YD7bl6Dhy3YVg5o7bNUlH87qNfZcBfmsJDbYYh8Wi99/iIBMxDfA7lw2LyW;
 25:NjJ5UPhOIZCTdYkZdC8PYmFNtnYLe5Z7bJE/l+CjgRgVvNPbtIDGHzD8oz7IQ3iUN0xaWRFFwSOseiNU/tvtrcarfzCg6FzvVFpnKqB5XkCNOEDA+95Fs0lAuCqNbheXSRKR/4TvMeDmfKx8nDFEsAECRzy6da+V+A0OZ84WGul8+eSfe3Q62OSi1epMCZNT9vvtawD39Jky4O8aUIOOKigFlBOgrFzwInNJom8a3/bslumRX83LTuomGHzfqPTKdGaI2Y+3NbPg0KSX03FaMksVxnOnk1sIST8KxcHc7Wj+IucsVdsE9RGyFuZd4cSEwsxjwFuXumPiR68nbCIpPA==;
 31:wNopW8OXRLPpC5Sgwo55tdYtcFkbQR5RSzmlNrfpmFJmriguYfS5IX60pb6ZFkuZloKxUGL3H0hKgi0dVJZY7sp3pVEg0EED5QHpfIRXc2ZLarEBprwUHukrWFYAGYdV1gmGsGJ//iu382W7SszfbrPwxC5oO1CNB6VIbGr661WMN+GOT0eh/ucyS6aRUTKh8dVvZUQkR/o355zONftxlmElApqvluieJBAufMcSkQM=
X-MS-TrafficTypeDiagnostic: DB6PR07MB4248:
X-Microsoft-Antispam-PRVS: &lt;DB6PR07MB4248E182585315CA78003EFEA57A0@DB6PR07MB4248.eurprd07.prod.outlook.com&gt;
X-Exchange-Antispam-Report-Test: UriScan:;
X-MS-Exchange-SenderADCheck: 1
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
 RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(2016111802025)(20161123562045)(6072148)(6043046)(201708071742011)(7699016);
 SRVR:DB6PR07MB4248; BCL:0; PCL:0; RULEID:; SRVR:DB6PR07MB4248; 
X-Microsoft-Exchange-Diagnostics: 1; DB6PR07MB4248;
 4:Yvn2jLBcLzkxgWHiEgkOW3VvNmvD3MZt+T+v9y83YoaKkKOPcSX4GzSqv8PAEoRH0cEJMIjCxM7Z7GklcKX+M/hfX1LyW5dGWoreXwLSBNMIrQ98DCWsSsWuRGiis+FTBdZh7ZaArOQQ99ywxqprqTuEYe+ZLR0xzgP9OK4ZhPViD4dfDhuA1ziXLTeWd8Pi5jNPHU059HEzvFRLrIvUX+GcRfye/xT8vGjLSO5GtI+CH7taiRupVG2e62nvFfOuqTRr24JLW00FsIqwfpvF9g==
X-Forefront-PRVS: 06989017E3
X-Forefront-Antispam-Report: SFV:NSPM;
 SFS:(10009020)(39380400002)(346002)(396003)(39830400003)(376002)(366004)(189003)(199004)(50944005)(50226002)(50466002)(305945005)(48376002)(1857600001)(478600001)(25786009)(8936002)(6916009)(956004)(966005)(26005)(16586007)(4326008)(386003)(186003)(476003)(2616005)(316002)(1076002)(36756003)(3846002)(16526019)(6116002)(59450400001)(68736007)(47776003)(97736004)(66066001)(7736002)(81166006)(107886003)(105586002)(8676002)(81156014)(486006)(106356001)(6306002)(5660300001)(2906002)(51416003)(7696005)(53936002)(6486002)(74482002)(6666003)(52116002)(2351001)(2361001)(19627235001);
 DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR07MB4248;
 H:Kevins-MBP.lan.darbyshire-bryant.me.uk; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; MX:1; A:1; 
Received-SPF: None (protection.outlook.com: darbyshire-bryant.me.uk does not
 designate permitted sender hosts)
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR07MB4248;
 23:dXonWRtEt9kSelBlaJNKAh/3QqHqW3WYd8fze/bat?=
 =?us-ascii?Q?mGQU2rNJXEa8sgVVRvO0aAsJUEF+Zzkc3TEKJVcg4rq4jwxpQfD47Q9WGVZW?=
 =?us-ascii?Q?kexz6W6ZMTQRLySu9hDroVD4LKlR9Rdf4gf8Knt0dSsoDej88Wh9phHLEhI9?=
 =?us-ascii?Q?QeIKW2edXII4SabHkTiYTrzBcOe51rUopjtaU4/WBGC+QKp+6p8I5ReSmSBU?=
 =?us-ascii?Q?pQjs1F4/BqJPlf4GXICAROR9ONZgLcNM6hZ0VtKyfbldOANXZwHiphqUhTFE?=
 =?us-ascii?Q?5+7FRndVy096U09iumGXP1/zVsiNqgkgNezyWBRzcz3yEzDtYcc9MiVTSz+N?=
 =?us-ascii?Q?86hDjg61RiWgbZ8yfnxLU3bN4ChqC1dFnlDH07adNK8OpdNCmE08VqwDX7nK?=
 =?us-ascii?Q?DaLCdPcjMmq3qvixnwvzI1YteQu0HWa7lFVBm7g1arsk28GgSXNqBl5UTt2U?=
 =?us-ascii?Q?xeve4WiF/PmULdcHflKt79LzfMErzaauNE04QPik9Zdd5O2bwg7avPZIrn0r?=
 =?us-ascii?Q?vPEVMPpfdmzT7USbRancmNPbgP2gQk41vtyMWWSzlWvCfknAgqtdQRTtezJU?=
 =?us-ascii?Q?n0fnvRZtmIFOHLJzzSIKYiq38QwKA93lIZNQhaEmhZrgqstptPRi9ZZe7rwL?=
 =?us-ascii?Q?GpomOwTEhXqLakCkykQOEuO702wNSZKBIA3GbcLlfHSRpvi63ta5zHltEBBI?=
 =?us-ascii?Q?bG1YODB+9XGeXM6uK5wVjS3h217NI0RkW8p26ZkhUn/f0ihP/awArkl+/9DW?=
 =?us-ascii?Q?62+zKAxu7g7u5kPrvOsorYmNxWEOewtsl98Q+rKnyu+nNrbCvHQKlnDVB2ri?=
 =?us-ascii?Q?zVS/kKVx/cuOUdmZFid1oXrWRsLZ6aALABrAoohdl0qDhG6LP5Mo54uymGKD?=
 =?us-ascii?Q?7rkmhKFLgFZZIhxlFt5dNp8U3ZAaOaJj1MwDh6c/IkjVo2qCZzWbpYr+LGYE?=
 =?us-ascii?Q?XQaE9HvcOSLchG0uV8zx2UKAo/c9f2jNei1gHds9FwSrr95a6dc8Pf12m3jo?=
 =?us-ascii?Q?HKA45GQxKGmTfvQ2X3tTcmnlDsFx4G4UVd7RjOLy0HOFipUfCP9WVIbfvmpU?=
 =?us-ascii?Q?uArITMo1vwAehBX+Rk6tm/3wBKRnnbwm4xoKZOLYpVwXBz1yAYkP70y6rwh/?=
 =?us-ascii?Q?fKbtRbWNK0ygwqeY+20b6/Xh6Bs0Po8P03Jga8JcBomKxjhEae3vvzF6bdHV?=
 =?us-ascii?Q?57CmG4GJ1M6CYCgiAo/QGgzb2i6W+IztGsDp8XvG1ovVPwVN1esn2+a+mP1W?=
 =?us-ascii?Q?ZZYwhhKIp34lu/TBzka5l2rVe3FrxdvY6FerB2r4xS6Tdi7fWoFyWihwA+Gs?=
 =?us-ascii?Q?SbWAl2w2OCmsRMhXOP7+8k=3D?=
X-Microsoft-Antispam-Message-Info: cxVMLXybQHR2U2O8rBfDyEJ9kQOpreAEggBVbRXhOCgFPRxMp9/BOLTp4ASJVOtJL3P3lBWy5nvJ7r6nv+6UW6WdNw2Oftl1toApI12V8ydU2XNua1+d6cfxn+C69h5x5QTx7KQ5sKPoWKmKw0QajNRjGTHcy08A93YVlFsI3aJve8F0IQVAuFWVBEfnyt6h
X-Microsoft-Exchange-Diagnostics: 1; DB6PR07MB4248;
 6:bycpGB+fV7rqJic9Q9KrRTefQaecCtfo4GVUAeQDyKypk9hRS/y0TE6VaxyrVRUEss10IwkMxl3JZCN3xHVwXOCMUhCEOqm0Ju3j9gkVYxVr/eWpFjLqE72y4oy2now6MjjHFL+XqMMhS/Zd2Wmise/dh9PgDzMoofaF8N9C4PDYtc9z3Mz0L4/YUeZljO0lNVrVD49DmVeWOXdmINlZUB8L4EOZe2sVQLiDADYTI1BgWv2e5olaWjILtW0a0szwpunBE8z54Sz4bG0UpcZ+tqBkwNBsbvgloRmtf/j1nZ02YSE9N6EgbA5pd02Fffa97GXFc8wpgChPc2qtZUfokw9fBm+f4+tx4bJG4b7PprXB8mxEAEOnDXnGYXloii+0DOC20Hi/tuRCdkQDIs7xgKx/WNGnv5KZoecsSRikMWAq8qzUc84Yf8ZCUjSXEHqqQMP4A/ovxbrXblhK2wXwFw==;
 5:ymUIU0NBOAN+y9tKS3NTsHObUnK17ggkYLsRL9aciD3T6eemhM85EPlYe8dwSZLSeQgHp673Td7uzmKyHiGagcR/FzeBdtR5CclAn22wbIFpWrZcJwVNTEuBwWinWCF8jK7lw2M/Xqrs2m7AhJolvcf6XQdQo65Sq392pmpREV4=;
 24:TfT0IOsgvteMrzX3x+rReDVDbU4inoSvhvo2V2FfWBawrtfSNSlZIgtIg4KBJBLNvdv6R9z34kgxNZVKOKmf/WiibfODetTAm95Yq8KZ72w=
SpamDiagnosticOutput: 1:99
SpamDiagnosticMetadata: NSPM
X-Microsoft-Exchange-Diagnostics: 1; DB6PR07MB4248;
 7:7alEGK7rz42Z3vkpqWb9hdeNJ9/KcJO3Yw69gVnOK7P2qyS1xK7IDFvHPPHfVzge9zsY9HxdAyV7noB4vyGmtwYq+BS7DuLXU58JCdMeJ0KnyN0gu6PdEbu48wLJHjoUeiZ1jenri+ehNUWqvPvmFYhEDMCdxX2M+Yq74QT3V/q/9/w3Uu3dLnm5Uf6qvTI26RMOQ/y6WoTTf0EHLHT3wC8EUpRoDsaBSTp7kpu1ozkMwGb8Xkgk7iwFfwaTxT8+
X-MS-Office365-Filtering-Correlation-Id: df85bec6-dc6d-466f-d3c2-08d5cde6616f
X-OriginatorOrg: darbyshire-bryant.me.uk
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2018 08:52:50.2763 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: df85bec6-dc6d-466f-d3c2-08d5cde6616f
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 9151708b-c553-406f-8e56-694f435154a4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR07MB4248
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20180609_015306_885570_80C37F38 
X-CRM114-Status: GOOD (  11.22  )
X-Spam-Score: -0.1 (/)
X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary:
 Content analysis details:   (-0.1 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [104.47.0.66 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid

Refresh patches.

Compile-tested for: ar71xx
Run-tested on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
---
 include/kernel-version.mk                          |   4 +-
 .../patches-4.9/910-unaligned_access_hacks.patch   |   2 +-
 ..._pl011-Don-t-use-DT-aliases-for-numbering.patch |   2 +-
 .../950-0195-amba_pl011-Round-input-clock-up.patch |   4 +-
 .../pending-4.9/890-uart_optional_sysrq.patch      |   2 +-
 .../sunxi/patches-4.9/0052-stmmac-form-4-12.patch  | 344 ++++++++++-----------
 6 files changed, 168 insertions(+), 190 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 6c220f3f2a..f43344ab84 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,12 +4,12 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .121
-LINUX_VERSION-4.9 = .106
+LINUX_VERSION-4.9 = .107
 LINUX_VERSION-4.14 = .48
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.121 = 44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
-LINUX_KERNEL_HASH-4.9.106 = 2d409bb29588ea9a61bae006255ee97a675ded364c87a9ff43f687c5271bbe3c
+LINUX_KERNEL_HASH-4.9.107 = 3ce7f40ecee096cda1d51eb2cada105a39abe8da7b968ef85f52be961f22cad3
 LINUX_KERNEL_HASH-4.14.48 = 80a0608f611fe7a5c54556402cdc2880a21301e1c4e1b19d4c1db82ad2bf22b9
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
index 4c59876b82..1815ccb1d3 100644
--- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
@@ -795,7 +795,7 @@
  
 --- a/net/ipv4/tcp_input.c
 +++ b/net/ipv4/tcp_input.c
-@@ -3894,14 +3894,16 @@ static bool tcp_parse_aligned_timestamp(
+@@ -3896,14 +3896,16 @@ static bool tcp_parse_aligned_timestamp(
  {
  	const __be32 *ptr = (const __be32 *)(th + 1);
  
diff --git a/target/linux/brcm2708/patches-4.9/950-0087-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch b/target/linux/brcm2708/patches-4.9/950-0087-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
index 07944df1e0..2710ed63d7 100644
--- a/target/linux/brcm2708/patches-4.9/950-0087-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
+++ b/target/linux/brcm2708/patches-4.9/950-0087-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
@@ -14,7 +14,7 @@ use the same logic.
 
 --- a/drivers/tty/serial/amba-pl011.c
 +++ b/drivers/tty/serial/amba-pl011.c
-@@ -2446,7 +2446,12 @@ static int pl011_setup_port(struct devic
+@@ -2501,7 +2501,12 @@ static int pl011_setup_port(struct devic
  	if (IS_ERR(base))
  		return PTR_ERR(base);
  
diff --git a/target/linux/brcm2708/patches-4.9/950-0195-amba_pl011-Round-input-clock-up.patch b/target/linux/brcm2708/patches-4.9/950-0195-amba_pl011-Round-input-clock-up.patch
index 11293c360e..b981be02ac 100644
--- a/target/linux/brcm2708/patches-4.9/950-0195-amba_pl011-Round-input-clock-up.patch
+++ b/target/linux/brcm2708/patches-4.9/950-0195-amba_pl011-Round-input-clock-up.patch
@@ -68,7 +68,7 @@ Signed-off-by: Phil Elwell &lt;phil@raspberrypi.org&gt;
  
  	if (uap-&gt;vendor-&gt;fixed_options) {
  		baud = uap-&gt;fixed_baud;
-@@ -2377,6 +2394,7 @@ static struct uart_driver amba_reg = {
+@@ -2432,6 +2449,7 @@ static struct uart_driver amba_reg = {
  	.cons			= AMBA_CONSOLE,
  };
  
@@ -76,7 +76,7 @@ Signed-off-by: Phil Elwell &lt;phil@raspberrypi.org&gt;
  static int pl011_probe_dt_alias(int index, struct device *dev)
  {
  	struct device_node *np;
-@@ -2408,6 +2426,7 @@ static int pl011_probe_dt_alias(int inde
+@@ -2463,6 +2481,7 @@ static int pl011_probe_dt_alias(int inde
  
  	return ret;
  }
diff --git a/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch b/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch
index 6cb745ee33..b317070e52 100644
--- a/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch
+++ b/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
  {
 --- a/lib/Kconfig.debug
 +++ b/lib/Kconfig.debug
-@@ -396,6 +396,11 @@ config MAGIC_SYSRQ_DEFAULT_ENABLE
+@@ -410,6 +410,11 @@ config MAGIC_SYSRQ_DEFAULT_ENABLE
  	  This may be set to 1 or 0 to enable or disable them all, or
  	  to a bitmask as described in Documentation/sysrq.txt.
  
diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
index 1ed1294694..a1b018186f 100644
--- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
+++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
@@ -3095,7 +3095,7 @@
  
  	if (priv-&gt;hw-&gt;mode-&gt;set_16kib_bfsize)
  		bfsize = priv-&gt;hw-&gt;mode-&gt;set_16kib_bfsize(dev-&gt;mtu);
-@@ -1033,257 +1234,516 @@ static int init_dma_desc_rings(struct ne
+@@ -1033,235 +1234,409 @@ static int init_dma_desc_rings(struct ne
  
  	priv-&gt;dma_buf_sz = bfsize;
  
@@ -3351,10 +3351,17 @@
 -						 priv-&gt;tx_skbuff_dma[i].buf,
 -						 priv-&gt;tx_skbuff_dma[i].len,
 -						 DMA_TO_DEVICE);
+-		}
 +	for (i = 0; i &lt; DMA_TX_SIZE; i++)
 +		stmmac_free_tx_buffer(priv, queue, i);
 +}
-+
+ 
+-		if (priv-&gt;tx_skbuff[i]) {
+-			dev_kfree_skb_any(priv-&gt;tx_skbuff[i]);
+-			priv-&gt;tx_skbuff[i] = NULL;
+-			priv-&gt;tx_skbuff_dma[i].buf = 0;
+-			priv-&gt;tx_skbuff_dma[i].map_as_page = false;
+-		}
 +/**
 + * free_dma_rx_desc_resources - free RX dma desc resources
 + * @priv: private structure
@@ -3383,10 +3390,11 @@
 +
 +		kfree(rx_q-&gt;rx_skbuff_dma);
 +		kfree(rx_q-&gt;rx_skbuff);
-+	}
-+}
-+
-+/**
+ 	}
+ }
+ 
+ /**
+- * alloc_dma_desc_resources - alloc TX/RX resources.
 + * free_dma_tx_desc_resources - free TX dma desc resources
 + * @priv: private structure
 + */
@@ -3419,36 +3427,90 @@
 +
 +/**
 + * alloc_dma_rx_desc_resources - alloc RX resources.
-+ * @priv: private structure
-+ * Description: according to which descriptor can be used (extend or basic)
-+ * this function allocates the resources for TX and RX paths. In case of
-+ * reception, for example, it pre-allocated the RX socket buffer in order to
-+ * allow zero-copy mechanism.
-+ */
+  * @priv: private structure
+  * Description: according to which descriptor can be used (extend or basic)
+  * this function allocates the resources for TX and RX paths. In case of
+  * reception, for example, it pre-allocated the RX socket buffer in order to
+  * allow zero-copy mechanism.
+  */
+-static int alloc_dma_desc_resources(struct stmmac_priv *priv)
 +static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv)
-+{
+ {
 +	u32 rx_count = priv-&gt;plat-&gt;rx_queues_to_use;
-+	int ret = -ENOMEM;
+ 	int ret = -ENOMEM;
 +	u32 queue;
-+
+ 
+-	priv-&gt;rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t),
+-					    GFP_KERNEL);
+-	if (!priv-&gt;rx_skbuff_dma)
+-		return -ENOMEM;
 +	/* RX queues buffers and DMA */
 +	for (queue = 0; queue &lt; rx_count; queue++) {
 +		struct stmmac_rx_queue *rx_q = &amp;priv-&gt;rx_queue[queue];
-+
+ 
+-	priv-&gt;rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *),
+-					GFP_KERNEL);
+-	if (!priv-&gt;rx_skbuff)
+-		goto err_rx_skbuff;
+-
+-	priv-&gt;tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE,
+-					    sizeof(*priv-&gt;tx_skbuff_dma),
+-					    GFP_KERNEL);
+-	if (!priv-&gt;tx_skbuff_dma)
+-		goto err_tx_skbuff_dma;
+-
+-	priv-&gt;tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *),
+-					GFP_KERNEL);
+-	if (!priv-&gt;tx_skbuff)
+-		goto err_tx_skbuff;
+-
+-	if (priv-&gt;extend_desc) {
+-		priv-&gt;dma_erx = dma_zalloc_coherent(priv-&gt;device, DMA_RX_SIZE *
+-						    sizeof(struct
+-							   dma_extended_desc),
+-						    &amp;priv-&gt;dma_rx_phy,
+-						    GFP_KERNEL);
+-		if (!priv-&gt;dma_erx)
+-			goto err_dma;
 +		rx_q-&gt;queue_index = queue;
 +		rx_q-&gt;priv_data = priv;
-+
+ 
+-		priv-&gt;dma_etx = dma_zalloc_coherent(priv-&gt;device, DMA_TX_SIZE *
+-						    sizeof(struct
+-							   dma_extended_desc),
+-						    &amp;priv-&gt;dma_tx_phy,
 +		rx_q-&gt;rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE,
 +						    sizeof(dma_addr_t),
-+						    GFP_KERNEL);
+ 						    GFP_KERNEL);
+-		if (!priv-&gt;dma_etx) {
+-			dma_free_coherent(priv-&gt;device, DMA_RX_SIZE *
+-					  sizeof(struct dma_extended_desc),
+-					  priv-&gt;dma_erx, priv-&gt;dma_rx_phy);
+-			goto err_dma;
+-		}
+-	} else {
+-		priv-&gt;dma_rx = dma_zalloc_coherent(priv-&gt;device, DMA_RX_SIZE *
+-						   sizeof(struct dma_desc),
+-						   &amp;priv-&gt;dma_rx_phy,
+-						   GFP_KERNEL);
+-		if (!priv-&gt;dma_rx)
+-			goto err_dma;
 +		if (!rx_q-&gt;rx_skbuff_dma)
 +			return -ENOMEM;
-+
+ 
+-		priv-&gt;dma_tx = dma_zalloc_coherent(priv-&gt;device, DMA_TX_SIZE *
+-						   sizeof(struct dma_desc),
+-						   &amp;priv-&gt;dma_tx_phy,
+-						   GFP_KERNEL);
+-		if (!priv-&gt;dma_tx) {
+-			dma_free_coherent(priv-&gt;device, DMA_RX_SIZE *
+-					  sizeof(struct dma_desc),
+-					  priv-&gt;dma_rx, priv-&gt;dma_rx_phy);
 +		rx_q-&gt;rx_skbuff = kmalloc_array(DMA_RX_SIZE,
 +						sizeof(struct sk_buff *),
 +						GFP_KERNEL);
 +		if (!rx_q-&gt;rx_skbuff)
-+			goto err_dma;
+ 			goto err_dma;
 +
 +		if (priv-&gt;extend_desc) {
 +			rx_q-&gt;dma_erx = dma_zalloc_coherent(priv-&gt;device,
@@ -3469,12 +3531,19 @@
 +							   GFP_KERNEL);
 +			if (!rx_q-&gt;dma_rx)
 +				goto err_dma;
-+		}
-+	}
-+
-+	return 0;
-+
-+err_dma:
+ 		}
+ 	}
+ 
+ 	return 0;
+ 
+ err_dma:
+-	kfree(priv-&gt;tx_skbuff);
+-err_tx_skbuff:
+-	kfree(priv-&gt;tx_skbuff_dma);
+-err_tx_skbuff_dma:
+-	kfree(priv-&gt;rx_skbuff);
+-err_rx_skbuff:
+-	kfree(priv-&gt;rx_skbuff_dma);
 +	free_dma_rx_desc_resources(priv);
 +
 +	return ret;
@@ -3531,7 +3600,7 @@
 +							   GFP_KERNEL);
 +			if (!tx_q-&gt;dma_tx)
 +				goto err_dma_buffers;
- 		}
++		}
 +	}
 +
 +	return 0;
@@ -3560,126 +3629,85 @@
 +
 +	ret = alloc_dma_tx_desc_resources(priv);
 +
-+	return ret;
-+}
-+
+ 	return ret;
+ }
+ 
 +/**
 + * free_dma_desc_resources - free dma desc resources
 + * @priv: private structure
 + */
-+static void free_dma_desc_resources(struct stmmac_priv *priv)
-+{
+ static void free_dma_desc_resources(struct stmmac_priv *priv)
+ {
+-	/* Release the DMA TX/RX socket buffers */
+-	dma_free_rx_skbufs(priv);
+-	dma_free_tx_skbufs(priv);
+-
+-	/* Free DMA regions of consistent memory previously allocated */
+-	if (!priv-&gt;extend_desc) {
+-		dma_free_coherent(priv-&gt;device,
+-				  DMA_TX_SIZE * sizeof(struct dma_desc),
+-				  priv-&gt;dma_tx, priv-&gt;dma_tx_phy);
+-		dma_free_coherent(priv-&gt;device,
+-				  DMA_RX_SIZE * sizeof(struct dma_desc),
+-				  priv-&gt;dma_rx, priv-&gt;dma_rx_phy);
+-	} else {
+-		dma_free_coherent(priv-&gt;device, DMA_TX_SIZE *
+-				  sizeof(struct dma_extended_desc),
+-				  priv-&gt;dma_etx, priv-&gt;dma_tx_phy);
+-		dma_free_coherent(priv-&gt;device, DMA_RX_SIZE *
+-				  sizeof(struct dma_extended_desc),
+-				  priv-&gt;dma_erx, priv-&gt;dma_rx_phy);
+-	}
+-	kfree(priv-&gt;rx_skbuff_dma);
+-	kfree(priv-&gt;rx_skbuff);
+-	kfree(priv-&gt;tx_skbuff_dma);
+-	kfree(priv-&gt;tx_skbuff);
 +	/* Release the DMA RX socket buffers */
 +	free_dma_rx_desc_resources(priv);
 +
 +	/* Release the DMA TX socket buffers */
 +	free_dma_tx_desc_resources(priv);
-+}
-+
-+/**
-+ *  stmmac_mac_enable_rx_queues - Enable MAC rx queues
-+ *  @priv: driver private structure
-+ *  Description: It is used for enabling the rx queues in the MAC
-+ */
-+static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
-+{
+ }
+ 
+ /**
+@@ -1271,19 +1646,104 @@ static void free_dma_desc_resources(stru
+  */
+ static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
+ {
+-	int rx_count = priv-&gt;dma_cap.number_rx_queues;
+-	int queue = 0;
 +	u32 rx_queues_count = priv-&gt;plat-&gt;rx_queues_to_use;
 +	int queue;
 +	u8 mode;
  
--		if (priv-&gt;tx_skbuff[i]) {
--			dev_kfree_skb_any(priv-&gt;tx_skbuff[i]);
--			priv-&gt;tx_skbuff[i] = NULL;
--			priv-&gt;tx_skbuff_dma[i].buf = 0;
--			priv-&gt;tx_skbuff_dma[i].map_as_page = false;
--		}
+-	/* If GMAC does not have multiple queues, then this is not necessary*/
+-	if (rx_count == 1)
+-		return;
 +	for (queue = 0; queue &lt; rx_queues_count; queue++) {
 +		mode = priv-&gt;plat-&gt;rx_queues_cfg[queue].mode_to_use;
 +		priv-&gt;hw-&gt;mac-&gt;rx_queue_enable(priv-&gt;hw, mode, queue);
- 	}
- }
++	}
++}
  
- /**
-- * alloc_dma_desc_resources - alloc TX/RX resources.
-- * @priv: private structure
-- * Description: according to which descriptor can be used (extend or basic)
-- * this function allocates the resources for TX and RX paths. In case of
-- * reception, for example, it pre-allocated the RX socket buffer in order to
-- * allow zero-copy mechanism.
+-	/**
+-	 *  If the core is synthesized with multiple rx queues / multiple
+-	 *  dma channels, then rx queues will be disabled by default.
+-	 *  For now only rx queue 0 is enabled.
+-	 */
+-	priv-&gt;hw-&gt;mac-&gt;rx_queue_enable(priv-&gt;hw, queue);
++/**
 + * stmmac_start_rx_dma - start RX DMA channel
 + * @priv: driver private structure
 + * @chan: RX channel index
 + * Description:
 + * This starts a RX DMA channel
-  */
--static int alloc_dma_desc_resources(struct stmmac_priv *priv)
++ */
 +static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan)
- {
--	int ret = -ENOMEM;
--
--	priv-&gt;rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t),
--					    GFP_KERNEL);
--	if (!priv-&gt;rx_skbuff_dma)
--		return -ENOMEM;
--
--	priv-&gt;rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *),
--					GFP_KERNEL);
--	if (!priv-&gt;rx_skbuff)
--		goto err_rx_skbuff;
--
--	priv-&gt;tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE,
--					    sizeof(*priv-&gt;tx_skbuff_dma),
--					    GFP_KERNEL);
--	if (!priv-&gt;tx_skbuff_dma)
--		goto err_tx_skbuff_dma;
--
--	priv-&gt;tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *),
--					GFP_KERNEL);
--	if (!priv-&gt;tx_skbuff)
--		goto err_tx_skbuff;
--
--	if (priv-&gt;extend_desc) {
--		priv-&gt;dma_erx = dma_zalloc_coherent(priv-&gt;device, DMA_RX_SIZE *
--						    sizeof(struct
--							   dma_extended_desc),
--						    &amp;priv-&gt;dma_rx_phy,
--						    GFP_KERNEL);
--		if (!priv-&gt;dma_erx)
--			goto err_dma;
--
--		priv-&gt;dma_etx = dma_zalloc_coherent(priv-&gt;device, DMA_TX_SIZE *
--						    sizeof(struct
--							   dma_extended_desc),
--						    &amp;priv-&gt;dma_tx_phy,
--						    GFP_KERNEL);
--		if (!priv-&gt;dma_etx) {
--			dma_free_coherent(priv-&gt;device, DMA_RX_SIZE *
--					  sizeof(struct dma_extended_desc),
--					  priv-&gt;dma_erx, priv-&gt;dma_rx_phy);
--			goto err_dma;
--		}
--	} else {
--		priv-&gt;dma_rx = dma_zalloc_coherent(priv-&gt;device, DMA_RX_SIZE *
--						   sizeof(struct dma_desc),
--						   &amp;priv-&gt;dma_rx_phy,
--						   GFP_KERNEL);
--		if (!priv-&gt;dma_rx)
--			goto err_dma;
++{
 +	netdev_dbg(priv-&gt;dev, &quot;DMA RX processes started in channel %d\n&quot;, chan);
 +	priv-&gt;hw-&gt;dma-&gt;start_rx(priv-&gt;ioaddr, chan);
 +}
- 
--		priv-&gt;dma_tx = dma_zalloc_coherent(priv-&gt;device, DMA_TX_SIZE *
--						   sizeof(struct dma_desc),
--						   &amp;priv-&gt;dma_tx_phy,
--						   GFP_KERNEL);
--		if (!priv-&gt;dma_tx) {
--			dma_free_coherent(priv-&gt;device, DMA_RX_SIZE *
--					  sizeof(struct dma_desc),
--					  priv-&gt;dma_rx, priv-&gt;dma_rx_phy);
--			goto err_dma;
--		}
--	}
++
 +/**
 + * stmmac_start_tx_dma - start TX DMA channel
 + * @priv: driver private structure
@@ -3692,8 +3720,7 @@
 +	netdev_dbg(priv-&gt;dev, &quot;DMA TX processes started in channel %d\n&quot;, chan);
 +	priv-&gt;hw-&gt;dma-&gt;start_tx(priv-&gt;ioaddr, chan);
 +}
- 
--	return 0;
++
 +/**
 + * stmmac_stop_rx_dma - stop RX DMA channel
 + * @priv: driver private structure
@@ -3706,16 +3733,7 @@
 +	netdev_dbg(priv-&gt;dev, &quot;DMA RX processes stopped in channel %d\n&quot;, chan);
 +	priv-&gt;hw-&gt;dma-&gt;stop_rx(priv-&gt;ioaddr, chan);
 +}
- 
--err_dma:
--	kfree(priv-&gt;tx_skbuff);
--err_tx_skbuff:
--	kfree(priv-&gt;tx_skbuff_dma);
--err_tx_skbuff_dma:
--	kfree(priv-&gt;rx_skbuff);
--err_rx_skbuff:
--	kfree(priv-&gt;rx_skbuff_dma);
--	return ret;
++
 +/**
 + * stmmac_stop_tx_dma - stop TX DMA channel
 + * @priv: driver private structure
@@ -3727,9 +3745,8 @@
 +{
 +	netdev_dbg(priv-&gt;dev, &quot;DMA TX processes stopped in channel %d\n&quot;, chan);
 +	priv-&gt;hw-&gt;dma-&gt;stop_tx(priv-&gt;ioaddr, chan);
- }
- 
--static void free_dma_desc_resources(struct stmmac_priv *priv)
++}
++
 +/**
 + * stmmac_start_all_dma - start all RX and TX DMA channels
 + * @priv: driver private structure
@@ -3737,31 +3754,7 @@
 + * This starts all the RX and TX DMA channels
 + */
 +static void stmmac_start_all_dma(struct stmmac_priv *priv)
- {
--	/* Release the DMA TX/RX socket buffers */
--	dma_free_rx_skbufs(priv);
--	dma_free_tx_skbufs(priv);
--
--	/* Free DMA regions of consistent memory previously allocated */
--	if (!priv-&gt;extend_desc) {
--		dma_free_coherent(priv-&gt;device,
--				  DMA_TX_SIZE * sizeof(struct dma_desc),
--				  priv-&gt;dma_tx, priv-&gt;dma_tx_phy);
--		dma_free_coherent(priv-&gt;device,
--				  DMA_RX_SIZE * sizeof(struct dma_desc),
--				  priv-&gt;dma_rx, priv-&gt;dma_rx_phy);
--	} else {
--		dma_free_coherent(priv-&gt;device, DMA_TX_SIZE *
--				  sizeof(struct dma_extended_desc),
--				  priv-&gt;dma_etx, priv-&gt;dma_tx_phy);
--		dma_free_coherent(priv-&gt;device, DMA_RX_SIZE *
--				  sizeof(struct dma_extended_desc),
--				  priv-&gt;dma_erx, priv-&gt;dma_rx_phy);
--	}
--	kfree(priv-&gt;rx_skbuff_dma);
--	kfree(priv-&gt;rx_skbuff);
--	kfree(priv-&gt;tx_skbuff_dma);
--	kfree(priv-&gt;tx_skbuff);
++{
 +	u32 rx_channels_count = priv-&gt;plat-&gt;rx_queues_to_use;
 +	u32 tx_channels_count = priv-&gt;plat-&gt;tx_queues_to_use;
 +	u32 chan = 0;
@@ -3771,38 +3764,23 @@
 +
 +	for (chan = 0; chan &lt; tx_channels_count; chan++)
 +		stmmac_start_tx_dma(priv, chan);
- }
- 
- /**
-- *  stmmac_mac_enable_rx_queues - Enable MAC rx queues
-- *  @priv: driver private structure
-- *  Description: It is used for enabling the rx queues in the MAC
++}
++
++/**
 + * stmmac_stop_all_dma - stop all RX and TX DMA channels
 + * @priv: driver private structure
 + * Description:
 + * This stops the RX and TX DMA channels
-  */
--static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
++ */
 +static void stmmac_stop_all_dma(struct stmmac_priv *priv)
- {
--	int rx_count = priv-&gt;dma_cap.number_rx_queues;
--	int queue = 0;
++{
 +	u32 rx_channels_count = priv-&gt;plat-&gt;rx_queues_to_use;
 +	u32 tx_channels_count = priv-&gt;plat-&gt;tx_queues_to_use;
 +	u32 chan = 0;
- 
--	/* If GMAC does not have multiple queues, then this is not necessary*/
--	if (rx_count == 1)
--		return;
++
 +	for (chan = 0; chan &lt; rx_channels_count; chan++)
 +		stmmac_stop_rx_dma(priv, chan);
- 
--	/**
--	 *  If the core is synthesized with multiple rx queues / multiple
--	 *  dma channels, then rx queues will be disabled by default.
--	 *  For now only rx queue 0 is enabled.
--	 */
--	priv-&gt;hw-&gt;mac-&gt;rx_queue_enable(priv-&gt;hw, queue);
++
 +	for (chan = 0; chan &lt; tx_channels_count; chan++)
 +		stmmac_stop_tx_dma(priv, chan);
  }
-- 
2.15.1 (Apple Git-101)


]