From patchwork Thu Sep 20 11:28:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 771E0174F for ; Thu, 20 Sep 2018 11:28:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 636752D0A8 for ; Thu, 20 Sep 2018 11:28:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54EDB2D0A2; Thu, 20 Sep 2018 11:28:51 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 EC65A2D0A2 for ; Thu, 20 Sep 2018 11:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbeITRLw (ORCPT ); Thu, 20 Sep 2018 13:11:52 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50948 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRLw (ORCPT ); Thu, 20 Sep 2018 13:11:52 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8a-0004SQ-MZ; Thu, 20 Sep 2018 14:28:49 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:29 +0300 Message-Id: <20180920112842.27198-2-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 01/14] backport: fix compilation with IPV6 not set Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho At least in some older kernel versions (e.g. 3.10), the tcp.h header file is not implicitly included from other headers if CONFIG_IPV6 is not set, so we need to include it in backport-4.4.c. Also, there is an IPv6 structure that is used, so we should ifdef it away when IPv6 is not enabled. Signed-off-by: Luca Coelho --- backport/compat/backport-4.4.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backport/compat/backport-4.4.c b/backport/compat/backport-4.4.c index 1c11a2064e53..7966e94928e7 100644 --- a/backport/compat/backport-4.4.c +++ b/backport/compat/backport-4.4.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -95,9 +96,14 @@ void tso_build_hdr(struct sk_buff *skb, char *hdr, struct tso_t *tso, iph->tot_len = htons(size + hdr_len - mac_hdr_len); tso->ip_id++; } else { +#ifdef CONFIG_IPV6 struct ipv6hdr *iph = (void *)(hdr + mac_hdr_len); iph->payload_len = htons(size + tcp_hdrlen(skb)); +#else /* CONFIG_IPV6 */ + /* tso->ipv6 should never be set if IPV6 is not enabeld */ + WARN_ON(1); +#endif /* CONFIG_IPV6 */ } tcph = (struct tcphdr *)(hdr + skb_transport_offset(skb)); put_unaligned_be32(tso->tcp_seq, &tcph->seq); From patchwork Thu Sep 20 11:28:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F9021508 for ; Thu, 20 Sep 2018 11:28:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F32D32D09B for ; Thu, 20 Sep 2018 11:28:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7BF32D0A8; Thu, 20 Sep 2018 11:28:51 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 A07192D09B for ; Thu, 20 Sep 2018 11:28:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731100AbeITRLx (ORCPT ); Thu, 20 Sep 2018 13:11:53 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50954 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727986AbeITRLw (ORCPT ); Thu, 20 Sep 2018 13:11:52 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8b-0004SQ-AS; Thu, 20 Sep 2018 14:28:49 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Shahar S Matityahu , Luca Coelho Date: Thu, 20 Sep 2018 14:28:30 +0300 Message-Id: <20180920112842.27198-3-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 02/14] backports: add wait_event_killable_timeout backport support Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shahar S Matityahu Allow using wait_event_killable_timeout function in kernel older then 4.13 Signed-off-by: Shahar S Matityahu Signed-off-by: Luca Coelho --- backport/backport-include/linux/wait.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backport/backport-include/linux/wait.h b/backport/backport-include/linux/wait.h index c4b1114e05ed..15a674cfe019 100644 --- a/backport/backport-include/linux/wait.h +++ b/backport/backport-include/linux/wait.h @@ -78,6 +78,21 @@ wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout) #if LINUX_VERSION_IS_LESS(4,13,0) #define wait_queue_entry_t wait_queue_t + +#define wait_event_killable_timeout(wq_head, condition, timeout) \ +({ \ + long __ret = timeout; \ + might_sleep(); \ + if (!___wait_cond_timeout(condition)) \ + __ret = __wait_event_killable_timeout(wq_head, \ + condition, timeout); \ + __ret; \ +}) + +#define __wait_event_killable_timeout(wq_head, condition, timeout) \ + ___wait_event(wq_head, ___wait_cond_timeout(condition), \ + TASK_KILLABLE, 0, timeout, \ + __ret = schedule_timeout(__ret)) #endif #endif /* __BACKPORT_LINUX_WAIT_H */ From patchwork Thu Sep 20 11:28:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 884D5157B for ; Thu, 20 Sep 2018 11:28:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 772B92D09B for ; Thu, 20 Sep 2018 11:28:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BBB62D0A8; Thu, 20 Sep 2018 11:28:52 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 1B30B2D09B for ; Thu, 20 Sep 2018 11:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731343AbeITRLx (ORCPT ); Thu, 20 Sep 2018 13:11:53 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50960 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRLx (ORCPT ); Thu, 20 Sep 2018 13:11:53 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8b-0004SQ-TS; Thu, 20 Sep 2018 14:28:50 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:31 +0300 Message-Id: <20180920112842.27198-4-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 03/14] backport: introduce match_string() for kernels < 4.6 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho This function was introduced in v4.6 and now the iwlwifi driver uses it. Add the function for kernels older than v4.6. Signed-off-by: Luca Coelho --- backport/backport-include/linux/string.h | 4 ++++ backport/compat/backport-4.6.c | 26 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/backport/backport-include/linux/string.h b/backport/backport-include/linux/string.h index b85d9c73dc27..df93bf79a691 100644 --- a/backport/backport-include/linux/string.h +++ b/backport/backport-include/linux/string.h @@ -29,4 +29,8 @@ void memzero_explicit(void *s, size_t count); ssize_t strscpy(char *dest, const char *src, size_t count); #endif +#if LINUX_VERSION_IS_LESS(4,6,0) +int match_string(const char * const *array, size_t n, const char *string); +#endif /* LINUX_VERSION_IS_LESS(4,5,0) */ + #endif /* __BACKPORT_LINUX_STRING_H */ diff --git a/backport/compat/backport-4.6.c b/backport/compat/backport-4.6.c index 54ff669df192..8d0ecf56526d 100644 --- a/backport/compat/backport-4.6.c +++ b/backport/compat/backport-4.6.c @@ -75,3 +75,29 @@ int kstrtobool_from_user(const char __user *s, size_t count, bool *res) return kstrtobool(buf, res); } EXPORT_SYMBOL_GPL(kstrtobool_from_user); + +/** + * match_string - matches given string in an array + * @array: array of strings + * @n: number of strings in the array or -1 for NULL terminated arrays + * @string: string to match with + * + * Return: + * index of a @string in the @array if matches, or %-EINVAL otherwise. + */ +int match_string(const char * const *array, size_t n, const char *string) +{ + int index; + const char *item; + + for (index = 0; index < n; index++) { + item = array[index]; + if (!item) + break; + if (!strcmp(item, string)) + return index; + } + + return -EINVAL; +} +EXPORT_SYMBOL(match_string); From patchwork Thu Sep 20 11:28:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E69E1508 for ; Thu, 20 Sep 2018 11:28:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DD0A2D09B for ; Thu, 20 Sep 2018 11:28:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 122DD2D0A8; Thu, 20 Sep 2018 11:28:53 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 B7C562D09B for ; Thu, 20 Sep 2018 11:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731552AbeITRLy (ORCPT ); Thu, 20 Sep 2018 13:11:54 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50966 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727986AbeITRLy (ORCPT ); Thu, 20 Sep 2018 13:11:54 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8c-0004SQ-GD; Thu, 20 Sep 2018 14:28:50 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:32 +0300 Message-Id: <20180920112842.27198-5-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 04/14] backport: add patch to ignore iwlwifi removal on < 3.14 kernels Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho The iwlwifi driver has a workaround for some PCI bugs that require it to be removed and reinserted. Unfortunately, this doesn'w work on kernels < 3.14, so ignore the actual work function in that case and print out a message instead. Signed-off-by: Luca Coelho --- patches/iwlwifi-pci-device-removal.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 patches/iwlwifi-pci-device-removal.patch diff --git a/patches/iwlwifi-pci-device-removal.patch b/patches/iwlwifi-pci-device-removal.patch new file mode 100644 index 000000000000..c72cd09f4634 --- /dev/null +++ b/patches/iwlwifi-pci-device-removal.patch @@ -0,0 +1,24 @@ +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +index 7229991ae70d..d77d0aa3bf7b 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +@@ -1946,6 +1946,11 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk) + struct iwl_trans_pcie_removal *removal = + container_of(wk, struct iwl_trans_pcie_removal, work); + struct pci_dev *pdev = removal->pdev; ++#if LINUX_VERSION_IS_LESS(3,14,0) ++ dev_err(&rescan->pdev->dev, ++ "Device disconnected - can't rescan on old kernels.\n"); ++ pci_dev_put(pdev); ++#else + char *prop[] = {"EVENT=INACCESSIBLE", NULL}; + + dev_err(&pdev->dev, "Device gone - attempting removal\n"); +@@ -1957,6 +1962,7 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk) + + kfree(removal); + module_put(THIS_MODULE); ++#endif /* LINUX_VERSION_IS_LESS(3,14,0) */ + } + + static bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, From patchwork Thu Sep 20 11:28:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC2481508 for ; Thu, 20 Sep 2018 11:28:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB0182D09B for ; Thu, 20 Sep 2018 11:28:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF9552D0A8; Thu, 20 Sep 2018 11:28:53 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 8892D2D09B for ; Thu, 20 Sep 2018 11:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731580AbeITRLz (ORCPT ); Thu, 20 Sep 2018 13:11:55 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50974 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRLy (ORCPT ); Thu, 20 Sep 2018 13:11:54 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8d-0004SQ-4S; Thu, 20 Sep 2018 14:28:51 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:33 +0300 Message-Id: <20180920112842.27198-6-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 05/14] backport: convert tree section names to ascii Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho For some reason, sometimes when the git logs contain non-ascii characters, we get some conversion errors. This only happens if one of the strings we use is explicitly unicode, otherwise everything is fine. The only string we use that is of unicode type is the tree names that comes from the configuration sections. To avoid issues, convert the strings we get from the config file into ascii before using it. Signed-off-by: Luca Coelho --- devel/git-tracker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devel/git-tracker.py b/devel/git-tracker.py index 1789ad975154..d51f59ba6507 100755 --- a/devel/git-tracker.py +++ b/devel/git-tracker.py @@ -190,6 +190,8 @@ if __name__ == '__main__': backport_rev = git.rev_parse(tree=source_dir) for tree in trees: + # make sure tree is ascii to prevent conversion problems + tree = str(tree) input = config.get(tree, 'input') output = config.get(tree, 'output') defconfig = None From patchwork Thu Sep 20 11:28:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2B5C157B for ; Thu, 20 Sep 2018 11:28:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 920872D09B for ; Thu, 20 Sep 2018 11:28:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 868A22D0A8; Thu, 20 Sep 2018 11:28:54 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 363BE2D09B for ; Thu, 20 Sep 2018 11:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731684AbeITRLz (ORCPT ); Thu, 20 Sep 2018 13:11:55 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50980 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727986AbeITRLz (ORCPT ); Thu, 20 Sep 2018 13:11:55 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8d-0004SQ-QC; Thu, 20 Sep 2018 14:28:52 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:34 +0300 Message-Id: <20180920112842.27198-7-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 06/14] backport: add rhashtable-types.h Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho This was introduced in 4.18 and is needed by rhashtable.h, that we copy. So copy it as well. Signed-off-by: Luca Coelho --- backport/compat/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig index ed3a58725d69..be07a1898f38 100644 --- a/backport/compat/Kconfig +++ b/backport/compat/Kconfig @@ -130,6 +130,7 @@ config BPAUTO_RHASHTABLE # not very nice - but better than always having it default y if BACKPORTED_MAC80211 #h-file linux/rhashtable.h + #h-file linux/rhashtable-types.h #c-file lib/rhashtable.c config BPAUTO_BUCKET_LOCKS From patchwork Thu Sep 20 11:28:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607527 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F910174F for ; Thu, 20 Sep 2018 11:28:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F67B2D09B for ; Thu, 20 Sep 2018 11:28:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03EEB2D0A8; Thu, 20 Sep 2018 11:28:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 B6AE32D09B for ; Thu, 20 Sep 2018 11:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732080AbeITRL4 (ORCPT ); Thu, 20 Sep 2018 13:11:56 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50986 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRL4 (ORCPT ); Thu, 20 Sep 2018 13:11:56 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8e-0004SQ-Eo; Thu, 20 Sep 2018 14:28:52 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:35 +0300 Message-Id: <20180920112842.27198-8-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 07/14] backport: remove duplicate leds.h inclusion from backport-4.5.c Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho We were including leds.h twice in backport-4.5.c and one of them was very early, which caused inclusion conflicts at least with < 3.16 kernels. Signed-off-by: Luca Coelho --- backport/compat/backport-4.5.c | 1 - 1 file changed, 1 deletion(-) diff --git a/backport/compat/backport-4.5.c b/backport/compat/backport-4.5.c index 69751d515234..13764dc76cd4 100644 --- a/backport/compat/backport-4.5.c +++ b/backport/compat/backport-4.5.c @@ -8,7 +8,6 @@ * published by the Free Software Foundation. */ -#include #include #include #include From patchwork Thu Sep 20 11:28:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB4081508 for ; Thu, 20 Sep 2018 11:28:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA2562D09B for ; Thu, 20 Sep 2018 11:28:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE81C2D0A8; Thu, 20 Sep 2018 11:28:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 7239F2D09B for ; Thu, 20 Sep 2018 11:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732173AbeITRL4 (ORCPT ); Thu, 20 Sep 2018 13:11:56 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50992 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727986AbeITRL4 (ORCPT ); Thu, 20 Sep 2018 13:11:56 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8f-0004SQ-1X; Thu, 20 Sep 2018 14:28:53 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:36 +0300 Message-Id: <20180920112842.27198-9-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 08/14] backport: prevent unused subclass variable warning in < 3.18 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho In kernels earlier than 3.18, the raw_spin_lock defininition when CONFIG_DEBUG_LOCK_ALLOC is not enabled, was dropping one of the parameters, which caused a few "unused variable" warnings at places where this argument was only used in the call to raw_spin_lock_nested(). Take the latest definition which evaluates the argument to avoid compiler warnings. Signed-off-by: Luca Coelho --- backport/backport-include/linux/spinlock.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backport/backport-include/linux/spinlock.h b/backport/backport-include/linux/spinlock.h index 07daa358e25d..a46f6e33b241 100644 --- a/backport/backport-include/linux/spinlock.h +++ b/backport/backport-include/linux/spinlock.h @@ -2,6 +2,21 @@ #define __BACKPORT_SPINLOCK_H #include_next +#if LINUX_VERSION_IS_LESS(3,18,0) +#ifndef CONFIG_DEBUG_LOCK_ALLOC +#undef raw_spin_lock_nested +/* + * Always evaluate the 'subclass' argument to avoid that the compiler + * warns about set-but-not-used variables when building with + * CONFIG_DEBUG_LOCK_ALLOC=n and with W=1. + */ +# define raw_spin_lock_nested(lock, subclass) \ + _raw_spin_lock(((void)(subclass), (lock))) +# define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) +#endif +#endif /* LINUX_VERSION_IS_LESS(3,18,0) */ + + #if LINUX_VERSION_IS_LESS(4,16,0) int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, size_t max_size, unsigned int cpu_mult, From patchwork Thu Sep 20 11:28:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66E6E174F for ; Thu, 20 Sep 2018 11:28:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56DDC2D09B for ; Thu, 20 Sep 2018 11:28:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B44B2D0A8; Thu, 20 Sep 2018 11:28:56 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 E9E722D09B for ; Thu, 20 Sep 2018 11:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727986AbeITRL5 (ORCPT ); Thu, 20 Sep 2018 13:11:57 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50998 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRL5 (ORCPT ); Thu, 20 Sep 2018 13:11:57 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8f-0004SQ-Mm; Thu, 20 Sep 2018 14:28:54 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:37 +0300 Message-Id: <20180920112842.27198-10-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 09/14] backport: make ktime_get_boottime_seconds() non-inline Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho With kernels < 3.17, we need to include hrtimer.h to get ktime_divns() for the ktime_get_boottime_seconds() backport. But we can't just include htrtimer.h in the backport timekeeping.h because we run into some cyclical inclusions that cause problems. To solve that make ktime_get_boottime_seconds() non-inline and add it to a new backport-4.18.c file. Signed-off-by: Luca Coelho --- backport/backport-include/linux/timekeeping.h | 5 +---- backport/compat/Makefile | 1 + backport/compat/backport-4.18.c | 11 +++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 backport/compat/backport-4.18.c diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h index 73ce9f1797ed..aebb00ca366b 100644 --- a/backport/backport-include/linux/timekeeping.h +++ b/backport/backport-include/linux/timekeeping.h @@ -25,10 +25,7 @@ static inline u64 ktime_get_boot_ns(void) #endif /* < 3.17 */ #if LINUX_VERSION_IS_LESS(4,18,0) -static inline time64_t ktime_get_boottime_seconds(void) -{ - return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC); -} +extern time64_t ktime_get_boottime_seconds(void); #endif /* < 4.18 */ #if LINUX_VERSION_IS_LESS(3,19,0) diff --git a/backport/compat/Makefile b/backport/compat/Makefile index 12c4121ff7e1..f5b1886e2d8e 100644 --- a/backport/compat/Makefile +++ b/backport/compat/Makefile @@ -37,6 +37,7 @@ compat-$(CPTCFG_KERNEL_4_7) += backport-4.7.o compat-$(CPTCFG_KERNEL_4_8) += backport-4.8.o compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o compat-$(CPTCFG_KERNEL_4_12) += backport-4.12.o +compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o diff --git a/backport/compat/backport-4.18.c b/backport/compat/backport-4.18.c new file mode 100644 index 000000000000..c47fabe5a7a1 --- /dev/null +++ b/backport/compat/backport-4.18.c @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2018 Intel Corporation + */ + +#include + +time64_t ktime_get_boottime_seconds(void) +{ + return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC); +} +EXPORT_SYMBOL_GPL(ktime_get_boottime_seconds); From patchwork Thu Sep 20 11:28:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53428157B for ; Thu, 20 Sep 2018 11:29:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A6A2D0AA for ; Thu, 20 Sep 2018 11:29:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 383152D0C0; Thu, 20 Sep 2018 11:29:04 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 CF2A92D0AA for ; Thu, 20 Sep 2018 11:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732442AbeITRMF (ORCPT ); Thu, 20 Sep 2018 13:12:05 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:51032 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732412AbeITRMF (ORCPT ); Thu, 20 Sep 2018 13:12:05 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8g-0004SQ-Ar; Thu, 20 Sep 2018 14:28:54 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:38 +0300 Message-Id: <20180920112842.27198-11-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 10/14] backport: update u64_stats_init() to a new version in kernels < 4.2 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho The u64_stats_init() macro was turned into a static inline function in v4.2 to prevent warnings that happen when its argument is not used elsewhere. Since we started hitting these warnings, undefine the macro and define the static inline to prevent them. Signed-off-by: Luca Coelho --- backport/backport-include/linux/netdevice.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index 8723f8c58e84..44319331fce8 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -263,6 +263,16 @@ netdev_features_t passthru_features_check(struct sk_buff *skb, netdev_features_t features); #endif /* LINUX_VERSION_IS_LESS(4,1,0) */ +#if LINUX_VERSION_IS_LESS(4,2,0) +#undef u64_stats_init +static inline void u64_stats_init(struct u64_stats_sync *syncp) +{ +#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) + seqcount_init(&syncp->seq); +#endif +} +#endif /* LINUX_VERSION_IS_LESS(4,2,0) */ + #ifndef netdev_alloc_pcpu_stats #define netdev_alloc_pcpu_stats(type) \ ({ \ From patchwork Thu Sep 20 11:28:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0968A1508 for ; Thu, 20 Sep 2018 11:29:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED0BE2D0AA for ; Thu, 20 Sep 2018 11:29:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1A1B2D0C0; Thu, 20 Sep 2018 11:29:05 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 9489C2D0AA for ; Thu, 20 Sep 2018 11:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732441AbeITRMH (ORCPT ); Thu, 20 Sep 2018 13:12:07 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:51040 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRMH (ORCPT ); Thu, 20 Sep 2018 13:12:07 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8h-0004SQ-3l; Thu, 20 Sep 2018 14:28:55 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Johannes Berg , Luca Coelho Date: Thu, 20 Sep 2018 14:28:39 +0300 Message-Id: <20180920112842.27198-12-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 11/14] backports: improve skb->xmit_more handling Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Berg Replace the existing skb->xmit_more semantic patch rule with a more generic one that uses a helper inline function. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho --- backport/backport-include/linux/skbuff.h | 9 +++++++++ patches/0059-skb_xmit_more/skb_no_xmit_more.cocci | 10 +++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h index 034206b6649d..61133c4277cc 100644 --- a/backport/backport-include/linux/skbuff.h +++ b/backport/backport-include/linux/skbuff.h @@ -200,6 +200,15 @@ static inline struct sk_buff *__pskb_copy_fclone(struct sk_buff *skb, struct sk_buff *skb_clone_sk(struct sk_buff *skb); #endif +static inline bool skb_xmit_more(struct sk_buff *skb) +{ +#if LINUX_VERSION_IS_LESS(3,18,0) + return false; +#else + return skb->xmit_more; +#endif +} + #if LINUX_VERSION_IS_LESS(3,19,0) /** * __dev_alloc_pages - allocate page for network Rx diff --git a/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci b/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci index ab20c833af40..bf7f22e267a3 100644 --- a/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci +++ b/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci @@ -1,9 +1,5 @@ -@r1@ +@@ struct sk_buff *skb; -expression E1; @@ - if (E1 -+#if LINUX_VERSION_IS_GEQ(3,18,0) - || !skb->xmit_more -+#endif /* if LINUX_VERSION_IS_GEQ(3,18,0) */ - ) {...} +-skb->xmit_more ++skb_xmit_more(skb) From patchwork Thu Sep 20 11:28:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13B71157B for ; Thu, 20 Sep 2018 11:29:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03EE02D0AA for ; Thu, 20 Sep 2018 11:29:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECD402D0C0; Thu, 20 Sep 2018 11:29:07 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 A4D632D0AA for ; Thu, 20 Sep 2018 11:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732374AbeITRMJ (ORCPT ); Thu, 20 Sep 2018 13:12:09 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:51048 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRMJ (ORCPT ); Thu, 20 Sep 2018 13:12:09 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8h-0004SQ-NV; Thu, 20 Sep 2018 14:28:57 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:40 +0300 Message-Id: <20180920112842.27198-13-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 12/14] backport: update lib-rhashtable.c Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho The bucket_table_alloc() function was reworked, so update the patch accordingly. It's much simpler now, if !GFP_KERNEL, we just fail (like we used to). This is not a problem because we only use this function with GFP_KERNEL anyway. Signed-off-by: Luca Coelho --- patches/lib-rhashtable.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 patches/lib-rhashtable.patch diff --git a/patches/lib-rhashtable.patch b/patches/lib-rhashtable.patch new file mode 100644 index 000000000000..a538d0c83fc7 --- /dev/null +++ b/patches/lib-rhashtable.patch @@ -0,0 +1,14 @@ +diff --git a/compat/lib-rhashtable.c b/compat/lib-rhashtable.c +index 30526afa8343..bee37f2682dd 100644 +--- a/compat/lib-rhashtable.c ++++ b/compat/lib-rhashtable.c +@@ -173,7 +173,8 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht, + int i; + + size = sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]); +- tbl = kvzalloc(size, gfp); ++ if (gfp == GFP_KERNEL) ++ tbl = vzalloc(size); + + size = nbuckets; + From patchwork Thu Sep 20 11:28:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03135157B for ; Thu, 20 Sep 2018 11:29:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7B612D0AA for ; Thu, 20 Sep 2018 11:29:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC0202D0C0; Thu, 20 Sep 2018 11:29:09 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 906AB2D0AA for ; Thu, 20 Sep 2018 11:29:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732247AbeITRML (ORCPT ); Thu, 20 Sep 2018 13:12:11 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:51052 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRML (ORCPT ); Thu, 20 Sep 2018 13:12:11 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8j-0004SQ-Ec; Thu, 20 Sep 2018 14:28:57 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:41 +0300 Message-Id: <20180920112842.27198-14-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 13/14] backport: convert int led activate op to void when needed Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho In kernel v4.19-rc1, the activate op in struct led_trigger, changed from void to int. To solve this, add a semantic patch to insert a wrapper function that returns void and calls the function that returns int. Signed-off-by: Luca Coelho --- patches/led_activate.cocci | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 patches/led_activate.cocci diff --git a/patches/led_activate.cocci b/patches/led_activate.cocci new file mode 100644 index 000000000000..df8211d29462 --- /dev/null +++ b/patches/led_activate.cocci @@ -0,0 +1,24 @@ +@act@ +identifier activate_fn, p; +identifier m =~ "rx_led|tx_led|assoc_led|radio_led|tpt_led"; +fresh identifier activate_fn_wrap = "bp_" ## activate_fn; +@@ +<... ++#if LINUX_VERSION_IS_GEQ(4,19,0) +p->m.activate = activate_fn; ++#else ++p->m.activate = activate_fn_wrap; ++#endif +...> + +@@ +identifier act.activate_fn; +identifier act.activate_fn_wrap; +@@ +int activate_fn(...) {...} ++#if LINUX_VERSION_IS_LESS(4,19,0) ++static void activate_fn_wrap(struct led_classdev *led_cdev) ++{ ++ activate_fn(led_cdev); ++} ++#endif From patchwork Thu Sep 20 11:28:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E9BA157B for ; Thu, 20 Sep 2018 11:29:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EC5E2D0AA for ; Thu, 20 Sep 2018 11:29:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 135482D0C0; Thu, 20 Sep 2018 11:29:02 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 B4C552D0AA for ; Thu, 20 Sep 2018 11:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732302AbeITRMD (ORCPT ); Thu, 20 Sep 2018 13:12:03 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:51024 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRMD (ORCPT ); Thu, 20 Sep 2018 13:12:03 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8k-0004SQ-3l; Thu, 20 Sep 2018 14:28:58 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:42 +0300 Message-Id: <20180920112842.27198-15-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 14/14] backports: add __alloc_bucket_spinlocks() for < 4.19 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho Signed-off-by: Luca Coelho --- backport/backport-include/linux/spinlock.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/backport/backport-include/linux/spinlock.h b/backport/backport-include/linux/spinlock.h index a46f6e33b241..b27f91716ca7 100644 --- a/backport/backport-include/linux/spinlock.h +++ b/backport/backport-include/linux/spinlock.h @@ -25,4 +25,21 @@ int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, void free_bucket_spinlocks(spinlock_t *locks); #endif /* LINUX_VERSION_IS_LESS(4,16,0) */ +#if LINUX_VERSION_IS_LESS(4,19,0) +int __alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, + size_t max_size, unsigned int cpu_mult, + gfp_t gfp, const char *name, + struct lock_class_key *key); + +#define alloc_bucket_spinlocks(locks, lock_mask, max_size, cpu_mult, gfp) \ + ({ \ + static struct lock_class_key key; \ + int ret; \ + \ + ret = __alloc_bucket_spinlocks(locks, lock_mask, max_size, \ + cpu_mult, gfp, #locks, &key); \ + ret; \ + }) +#endif /* LINUX_VERSION_IS_LESS(4,19,0) */ + #endif /* __BACKPORT_SPINLOCK_H */