From patchwork Mon Dec 4 14:11:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael McElroy X-Patchwork-Id: 10090415 Return-Path: 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 10C2D60329 for ; Mon, 4 Dec 2017 14:12:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F097129262 for ; Mon, 4 Dec 2017 14:12:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF51829265; Mon, 4 Dec 2017 14:12:01 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 D91AE29275 for ; Mon, 4 Dec 2017 14:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753093AbdLDOLc (ORCPT ); Mon, 4 Dec 2017 09:11:32 -0500 Received: from mail-ua0-f193.google.com ([209.85.217.193]:42960 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752924AbdLDOLc (ORCPT ); Mon, 4 Dec 2017 09:11:32 -0500 Received: by mail-ua0-f193.google.com with SMTP id p33so12507060uag.9 for ; Mon, 04 Dec 2017 06:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=W7zajSOIqN43pF9JG5gW6cbLFtrB/ePwz+3VmxgtQHM=; b=CZTuft2mQm6zUF3qRlU5uN+r5nmFkITvmWra8B3j4lJphdJynSb3jxIty+3fcaS4ve pYM2lJy3tiJgnHURNq25RHnvpmAylwWNK+J47Lwt+pegh8a9aVvBKNTWnPkn7zcjtv9A YWaGz8Itx6Ul87zCLIOe7Ik+zEAJoBvg9cbb7wPGTit23QC+uYb0BHXmTjv4i/ZJlu3L ZENDG15Blkma+cIWbu0EAwRkD6jEsQZNIQFC2u1BqZxMOUGVLnZ1uwn3zmCLT+m8q6kI H5cu2SxHIMlRGBX7bLJPUTgoTQmIN1JCwUpELt6JzraQA9W87aIeKkimvQ7yR9n8z3Xe wiZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=W7zajSOIqN43pF9JG5gW6cbLFtrB/ePwz+3VmxgtQHM=; b=Is1B7ZhtfQQBLbi+pUSAKBhkLGNQ86vZPMhAY9bqQkd+6LJ9/BYsVUtAPPSeOqe6K8 2LojqFA2dfyeY46MGrhe+3rDVY5c4PYW4ouuZEELlb62VfSTdGgA0ObHeJ01FXxGq3eC zI9WZqKzYFFuMIsuRzYPX9ISnkA6uqcMB46QMdrLvvzJSEuWJUU0LfQt3dbOH+UXjcly qitfWjmpO5+WY27/giC6Hw3JvXfIdu5NPDNWyd1E3vFOgCUgcwXiculKx9X7V2hXy0Xd peWJacvu8l1hrCZqO7pxwVaNRlAxSVuted/R2YYYBssB0ZVMDzMgpDu254Mm6DiIx5a6 MXdg== X-Gm-Message-State: AJaThX4ySxIBnwLvfOA1V6hQt17JIw4q0+QWWnyVs4Ibe/mv4HOaARwJ o48OKbcFboNy+WQA049FfKIlX5cbOU3Qd92wvMMjgg== X-Google-Smtp-Source: AGs4zMbhBW48arp2Es4TCS82IoIzV5lnnT+E2JnnBu/62Av66Z4MOdvoPnkhSQcDc7XcTIkNuPcYOHTHMLvpZkB1ESI= X-Received: by 10.176.21.230 with SMTP id j35mr10423077uae.113.1512396690778; Mon, 04 Dec 2017 06:11:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.110.5 with HTTP; Mon, 4 Dec 2017 06:11:30 -0800 (PST) From: Michael McElroy Date: Mon, 4 Dec 2017 09:11:30 -0500 Message-ID: Subject: Compile error with Linux-3.4 To: backports@vger.kernel.org Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I have been following the thread on the genl-const.cocci parse error. I had the same problem and found the information very helpful. I had been killing the gentree build because I thought it was hung applying SmPL patch 0079-netdev-destructor.cocci. On my system, a 4 processor Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz machine, that patch takes about an hour and 20 minutes with the system at 100% for about an hour. After reading your discussion, I stopped killing it and it ran successfully. I am backporting to 3.4 and ran into a couple of other problems. There were 2 problems building the output against a 3.4 kernel. I wasn't sure that my kernel was the problem, so I built against the 3.4 branch of linux-stable. The first problem was caused by commit 8cdd85766293018fea01512959320a05269e97b4. Author: Johannes Berg Date: Fri Oct 13 10:48:42 2017 +0200 backports: add netdev_upper_dev_link() extack argument But make it optional (using magic.h) to let this still work on kernels that didn't change the argument. Signed-off-by: Johannes Berg In file included from /home/mike/linux-backport/compat/compat-3.8.c:18: /home/mike/linux-backport/backport-include/linux/netdevice.h:341: error: implicit declaration of function 'netdev_upper_dev_link' /home/mike/linux-backport/backport-include/linux/netdevice.h: In function '_bp_netdev_upper_dev_ +#if LINUX_VERSION_IS_LESS(4,14,0) +static inline int _bp_netdev_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev) +{ + return netdev_upper_dev_link(dev, upper_dev); +} +#define netdev_upper_dev_link3(dev, upper, extack) \ + netdev_upper_dev_link(dev, upper) +#define netdev_upper_dev_link2(dev, upper) \ + netdev_upper_dev_link(dev, upper) +#define netdev_upper_dev_link(...) \ + macro_dispatcher(netdev_upper_dev_link, __VA_ARGS__)(__VA_ARGS__) +#endif + I tried building against various kernels and didn't find netdev_upper_dev_link' defined until 3, so anything less that that probably has this error. I didn't know exactly what to use here so I just did an #if 0 around that section and resolved the problem for me. The second problem is in commit 2ebca7b7d087be04e25b1fc50cf08137d423af3d. Author: Luca Coelho Date: Tue Apr 19 22:13:11 2016 +0300 backport: add pm_runtime_active() implementation for < 3.9 kernels The pm_runtime_active() helper function was introduced in kernel 3.9. In order to use it in earlier kernels, we need to add its implementation to the backports. Signed-off-by: Luca Coelho [add LINUX_BACKPORT() protection] Signed-off-by: Hauke Mehrtens /home/mike/linux-backport/backport-include/linux/pm_runtime.h: In function 'backport_pm_runtime_active': /home/mike/linux-backport/backport-include/linux/pm_runtime.h:10: error: 'struct dev_pm_info' has no member named 'runtime_status' /home/mike/linux-backport/backport-include/linux/pm_runtime.h:11: error: 'struct dev_pm_info' has no member named 'disable_depth' make[6]: *** [/home/mike/linux-backport/compat/backport-4.8.o] Error 1 In linux/pm.h, those members addition to the struct are controlled by CONFIG_PM_RUNTIME, not CONFIG_PM. I changed pm_runtime.h to use CONFIG_PM_RUNTIME and that resolved the problem. Thanks for this amazing product, Mike McElroy --- To unsubscribe from this list: send the line "unsubscribe backports" in diff --git a/backport/backport-include/linux/pm_runtime.h b/backport/backport-include/linu new file mode 100644 index 0000000..16d2a80 --- /dev/null +++ b/backport/backport-include/linux/pm_runtime.h @@ -0,0 +1,19 @@ +#ifndef __BACKPORT_PM_RUNTIME_H +#define __BACKPORT_PM_RUNTIME_H +#include_next + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#define pm_runtime_active LINUX_BACKPORT(pm_runtime_active) +#ifdef CONFIG_PM +static inline bool pm_runtime_active(struct device *dev) +{ + return dev->power.runtime_status == RPM_ACTIVE + || dev->power.disable_depth; +} +#else +static inline bool pm_runtime_active(struct device *dev) { return true; } +#endif /* CONFIG_PM */ + +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */ + +#endif /* __BACKPORT_PM_RUNTIME_H */