From patchwork Thu Oct 13 08:53:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDAA3C43219 for ; Thu, 13 Oct 2022 08:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiJMIx6 (ORCPT ); Thu, 13 Oct 2022 04:53:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbiJMIxz (ORCPT ); Thu, 13 Oct 2022 04:53:55 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B80015DB20 for ; Thu, 13 Oct 2022 01:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KaqsC1UJdP6R2hYZy1HKfj9PL4LSoZTGmp0mCmN0I6c=; b=aJ+h0BzQOt0DVpShgGccyA2KT/ lHLf+SwXgHFShwAf30H9u7FniLohtTVrrRT6f/O9jSKTG3nx60KdIzE0mzcUrKJrPedraZai1XS1d mvnmJK+zazYp6bWS5hap5CRCwf0ERmXNxzfAGBonP+a8ozSu87Iarum3Sml36wbblRkk=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityS-00CO7a-81 for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:52 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 1/8] headers: backport napi add functions Date: Thu, 13 Oct 2022 10:53:44 +0200 Message-Id: <20221013085351.14516-1-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Deal with the removed weight argument Signed-off-by: Felix Fietkau --- backport/backport-include/linux/netdevice.h | 38 ++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index 9b3291bb7188..c0c6a97945b1 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -23,27 +23,27 @@ static inline bool backport_napi_complete(struct napi_struct *n) #define napi_complete LINUX_BACKPORT(napi_complete) #endif /* < 4.10 */ -#if LINUX_VERSION_IS_LESS(4,5,0) -#define netif_tx_napi_add LINUX_BACKPORT(netif_tx_napi_add) -/** - * netif_tx_napi_add - initialize a napi context - * @dev: network device - * @napi: napi context - * @poll: polling function - * @weight: default weight - * - * This variant of netif_napi_add() should be used from drivers using NAPI - * to exclusively poll a TX queue. - * This will avoid we add it into napi_hash[], thus polluting this hash table. - */ -static inline void netif_tx_napi_add(struct net_device *dev, - struct napi_struct *napi, - int (*poll)(struct napi_struct *, int), - int weight) +#if LINUX_VERSION_IS_LESS(6,1,0) +static inline void backport_netif_napi_add(struct net_device *dev, + struct napi_struct *napi, + int (*poll)(struct napi_struct *, int)) +{ + netif_napi_add(dev, napi, poll, NAPI_POLL_WEIGHT); +} +#define netif_napi_add LINUX_BACKPORT(netif_napi_add) + +static inline void backport_netif_napi_add_tx(struct net_device *dev, + struct napi_struct *napi, + int (*poll)(struct napi_struct *, int)) { - netif_napi_add(dev, napi, poll, weight); +#if LINUX_VERSION_IS_LESS(4,5,0) + netif_napi_add(dev, napi, poll); +#else + netif_tx_napi_add(dev, napi, poll, NAPI_POLL_WEIGHT); +#endif } -#endif /* < 4.5 */ +#define netif_napi_add_tx LINUX_BACKPORT(netif_napi_add_tx) +#endif /* < 6.1 */ #ifndef NETIF_F_CSUM_MASK #define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM From patchwork Thu Oct 13 08:53:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 134A8C4332F for ; Thu, 13 Oct 2022 08:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbiJMIx4 (ORCPT ); Thu, 13 Oct 2022 04:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbiJMIxz (ORCPT ); Thu, 13 Oct 2022 04:53:55 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD6915FDB8 for ; Thu, 13 Oct 2022 01:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Oa4X7/VfqsqAsZYlMQgJhdHTonwIOcFEtAd6UHMlgUk=; b=Pr0Flw64unSoQhnvgdepyvVIiZ X+J27nOoWmkCM2S4S+ITv6h7Wc+9MIL3UukGQ/FbHwoEL/RdEyvZipPPz3sr+0geiKbZoCXrXa/mv C86gJwtGBUuTHF7mQEGuJFGupIe71pIxqRZIfwRZcQIMSMQKSMVZRPvYFIIUxsNrjti8=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityS-00CO7a-EF for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:52 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 2/8] headers: backport usb_maxpacket api change Date: Thu, 13 Oct 2022 10:53:45 +0200 Message-Id: <20221013085351.14516-2-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221013085351.14516-1-nbd@nbd.name> References: <20221013085351.14516-1-nbd@nbd.name> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org The third argument was removed Signed-off-by: Felix Fietkau --- backport/backport-include/linux/usb.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backport/backport-include/linux/usb.h diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h new file mode 100644 index 000000000000..844cdcc7d55e --- /dev/null +++ b/backport/backport-include/linux/usb.h @@ -0,0 +1,14 @@ +#ifndef __BACKPORT_LINUX_USB_H +#define __BACKPORT_LINUX_USB_H +#include_next +#include + +#if LINUX_VERSION_IS_LESS(5,19,0) +static inline u16 backport_usb_maxpacket(struct usb_device *udev, int pipe) +{ + return usb_maxpacket(udev, pipe, usb_pipeout(pipe)); +} +#define usb_maxpacket LINUX_BACKPORT(usb_maxpacket) +#endif /* <5.19 */ + +#endif From patchwork Thu Oct 13 08:53:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C5FCC433FE for ; Thu, 13 Oct 2022 08:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbiJMIx5 (ORCPT ); Thu, 13 Oct 2022 04:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbiJMIxz (ORCPT ); Thu, 13 Oct 2022 04:53:55 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EF4616EB49 for ; Thu, 13 Oct 2022 01:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qdneihZ2agBkYvk0f+ILa6ho04CtK/F48q5fIYw05DI=; b=mRaO06HfP3Fy0iAyK4enR3g0fi DPZBSi3e7kKRUWUYFGTh5tjJIxF1G8/L1Sm5zzWRB2fMWU9qaIJqZp72AVs8Ky7iymbzYCIiuY8T5 aqm2Uux8wTK+wKXZml9XpLSJzKqCWrTtRm9dI1pUT+AGuXupNPJvNdHBtKwkiYwsB7S4=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityS-00CO7a-Jp for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:52 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 3/8] headers: add txq_trans_cond_update Date: Thu, 13 Oct 2022 10:53:46 +0200 Message-Id: <20221013085351.14516-3-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221013085351.14516-1-nbd@nbd.name> References: <20221013085351.14516-1-nbd@nbd.name> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Signed-off-by: Felix Fietkau --- backport/backport-include/linux/netdevice.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index c0c6a97945b1..1d2ac66b403b 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -254,6 +254,17 @@ struct net_device_path_ctx { }; #endif /* NET_DEVICE_PATH_STACK_MAX */ +#if LINUX_VERSION_IS_LESS(5,17,0) +static inline void backport_txq_trans_cond_update(struct netdev_queue *txq) +{ + unsigned long now = jiffies; + + if (READ_ONCE(txq->trans_start) != now) + WRITE_ONCE(txq->trans_start, now); +} +#define txq_trans_cond_update LINUX_BACKPORT(txq_trans_cond_update) +#endif /* < 5.17 */ + #if LINUX_VERSION_IS_LESS(5,18,0) static inline int LINUX_BACKPORT(netif_rx)(struct sk_buff *skb) { From patchwork Thu Oct 13 08:53:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005756 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DBBFC43217 for ; Thu, 13 Oct 2022 08:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbiJMIx6 (ORCPT ); Thu, 13 Oct 2022 04:53:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiJMIxz (ORCPT ); Thu, 13 Oct 2022 04:53:55 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA7D16EB4A for ; Thu, 13 Oct 2022 01:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=RpcK/q7kvXHnZ79IPpPIx24zBcawHO4zMYVbq4G6A6I=; b=XLuNTAbJuM0exhgy5kAuWnD79e Qo1mLQgBzLmK+fPdRxsS+OWZSS1lD0xk1gX3n3PCTlXeMgA+ipyovRuuUGGJsL/NoOkCDW/+o+h7a +ltmSbwqzrtEvC3npKBC135E+8OuYycM0o1ESzFW7rzsfRdNOiG/hFe+6XU4QEjEHWJg=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityS-00CO7a-P7 for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:52 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 4/8] headers: add __vstring and __assign_vstr Date: Thu, 13 Oct 2022 10:53:47 +0200 Message-Id: <20221013085351.14516-4-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221013085351.14516-1-nbd@nbd.name> References: <20221013085351.14516-1-nbd@nbd.name> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Used within tracepoints on a few drivers Signed-off-by: Felix Fietkau --- backport/backport-include/trace/trace_events.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 backport/backport-include/trace/trace_events.h diff --git a/backport/backport-include/trace/trace_events.h b/backport/backport-include/trace/trace_events.h new file mode 100644 index 000000000000..fd6a4f3c343d --- /dev/null +++ b/backport/backport-include/trace/trace_events.h @@ -0,0 +1,16 @@ +#include + +#if LINUX_VERSION_IS_LESS(6,0,0) +#undef VSTRING_MSG_MAX +#define VSTRING_MSG_MAX 512 + +#undef __vstring +#define __vstring(msg, fmt, va) __dynamic_array(char, msg, VSTRING_MSG_MAX) + +#undef __assign_vstr +#define __assign_vstr(msg, fmt, va) \ + WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), VSTRING_MSG_MAX, \ + fmt, *va) >= VSTRING_MSG_MAX) +#endif /* <6.0 */ + +#include_next From patchwork Thu Oct 13 08:53:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005760 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63010C4167E for ; Thu, 13 Oct 2022 08:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229769AbiJMIx7 (ORCPT ); Thu, 13 Oct 2022 04:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbiJMIx4 (ORCPT ); Thu, 13 Oct 2022 04:53:56 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D77216EB52 for ; Thu, 13 Oct 2022 01:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3WGQuQk78TaSsloBVJavkw4wDC8zsf8vp0TXUpvZQI4=; b=NySazZ98Rz9bp0+9Ec4oi7q/dY cipDSBvXLxVFNgYDkk/FaW0YCLs3EcnMElJXjFnWDPAD/OTrucNhraqkBmq09rzIIEEJrnYr/QSxT bxb2lCRe+MqWHVkv8eb9Ngk4i22JUb8diAanuWrMw7goCDsgQP7jhDFk8OpBq8s4fD5E=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityS-00CO7a-V9 for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:53 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 5/8] headers: backport mmc_sw_reset and mmc_hw_reset API changes Date: Thu, 13 Oct 2022 10:53:48 +0200 Message-Id: <20221013085351.14516-5-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221013085351.14516-1-nbd@nbd.name> References: <20221013085351.14516-1-nbd@nbd.name> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Signed-off-by: Felix Fietkau --- backport/backport-include/linux/mmc/core.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 backport/backport-include/linux/mmc/core.h diff --git a/backport/backport-include/linux/mmc/core.h b/backport/backport-include/linux/mmc/core.h new file mode 100644 index 000000000000..525994c27e06 --- /dev/null +++ b/backport/backport-include/linux/mmc/core.h @@ -0,0 +1,22 @@ +#ifndef __BACKPORT_LINUX_MMC_CORE_H +#define __BACKPORT_LINUX_MMC_CORE_H + +#include_next +#include_next +#include + +#if LINUX_VERSION_IS_LESS(5,19,0) +static inline int backport_mmc_sw_reset(struct mmc_card *card) +{ + return mmc_sw_reset(card->host); +} +#define mmc_sw_reset LINUX_BACKPORT(mmc_sw_reset) + +static inline int backport_mmc_hw_reset(struct mmc_card *card) +{ + return mmc_hw_reset(card->host); +} +#define mmc_hw_reset LINUX_BACKPORT(mmc_hw_reset) +#endif /* <5.19 */ + +#endif From patchwork Thu Oct 13 08:53:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C979C4321E for ; Thu, 13 Oct 2022 08:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229516AbiJMIx7 (ORCPT ); Thu, 13 Oct 2022 04:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbiJMIx4 (ORCPT ); Thu, 13 Oct 2022 04:53:56 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D73215FD82 for ; Thu, 13 Oct 2022 01:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=u7mysV/d1il4LuCgj4M44OEoRWIgqcQCjr8HdvPmXbo=; b=qSbmaWyuRUhcQXPDiz/guRKFsz d8eouVwndOHtOe6bV5pYHFMDrVosz929JCF3byfQtGyp0YR1w+NmSJUYe+AzLwfwlaENHfmOAJasj 75MoGhHIVM4jJov40Jsoc+7L6EPy5FrS3iiSUKyGglWcc9qHP+nBKm0wbr/0i8/dmfYM=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityT-00CO7a-4T for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:53 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 6/8] headers: add DEFINE_SIMPLE_DEV_PM_OPS Date: Thu, 13 Oct 2022 10:53:49 +0200 Message-Id: <20221013085351.14516-6-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221013085351.14516-1-nbd@nbd.name> References: <20221013085351.14516-1-nbd@nbd.name> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Signed-off-by: Felix Fietkau --- backport/backport-include/linux/pm.h | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h index 926b0bf15c8e..24d760fab33c 100644 --- a/backport/backport-include/linux/pm.h +++ b/backport/backport-include/linux/pm.h @@ -14,4 +14,34 @@ #define PMSG_IS_AUTO(msg) (((msg).event & PM_EVENT_AUTO) != 0) #endif +#ifndef DEFINE_SIMPLE_DEV_PM_OPS + +#define pm_sleep_ptr(_ptr) (IS_ENABLED(CONFIG_PM_SLEEP) ? (_ptr) : NULL) + +#define SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ + .suspend = pm_sleep_ptr(suspend_fn), \ + .resume = pm_sleep_ptr(resume_fn), \ + .freeze = pm_sleep_ptr(suspend_fn), \ + .thaw = pm_sleep_ptr(resume_fn), \ + .poweroff = pm_sleep_ptr(suspend_fn), \ + .restore = pm_sleep_ptr(resume_fn), + +#define RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ + .runtime_suspend = suspend_fn, \ + .runtime_resume = resume_fn, \ + .runtime_idle = idle_fn, + +#define _DEFINE_DEV_PM_OPS(name, \ + suspend_fn, resume_fn, \ + runtime_suspend_fn, runtime_resume_fn, idle_fn) \ +const struct dev_pm_ops name = { \ + SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ + RUNTIME_PM_OPS(runtime_suspend_fn, runtime_resume_fn, idle_fn) \ +} + +#define DEFINE_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ + _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL) + +#endif + #endif /* __BACKPORT_PM_H */ From patchwork Thu Oct 13 08:53:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E542C4332F for ; Thu, 13 Oct 2022 08:54:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbiJMIyA (ORCPT ); Thu, 13 Oct 2022 04:54:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbiJMIx5 (ORCPT ); Thu, 13 Oct 2022 04:53:57 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520E916EB5A for ; Thu, 13 Oct 2022 01:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=++chvALTAUMuOjOCEJXNSIsPCl5oQ146XTSIUhluO38=; b=rkqXZAH+QUz1jZy5BGrlN3pjtC 8zykArSM3GzktnHmlynOfGuOQvOeNyf8z44cfrIGWuJbEPgYvhpTuYZgjANvMJ3MKzU9cdiUg2fKP uoA5Z1zxGE4dgBqsGZLjs7j0ITtoA/4EMslp3nkT075heI9s0W5Iwwrx6Osx7o009TTE=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityT-00CO7a-AY for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:53 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 7/8] headers: backport device_get_mac_address api change Date: Thu, 13 Oct 2022 10:53:50 +0200 Message-Id: <20221013085351.14516-7-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221013085351.14516-1-nbd@nbd.name> References: <20221013085351.14516-1-nbd@nbd.name> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Signed-off-by: Felix Fietkau --- backport/backport-include/linux/etherdevice.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h index f6fa51f3829c..51a7d6d73f7e 100644 --- a/backport/backport-include/linux/etherdevice.h +++ b/backport/backport-include/linux/etherdevice.h @@ -2,6 +2,7 @@ #define _BACKPORT_LINUX_ETHERDEVICE_H #include_next #include +#include #if LINUX_VERSION_IS_LESS(4,11,0) @@ -52,4 +53,15 @@ static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr) } #endif /* LINUX_VERSION_IS_LESS(5,15,0) */ +#if LINUX_VERSION_IS_LESS(5,16,0) +static inline int backport_device_get_mac_address(struct device *dev, char *addr) +{ + if (!device_get_mac_address(dev, addr, ETH_ALEN)) + return -ENOENT; + + return 0; +} +#define device_get_mac_address LINUX_BACKPORT(device_get_mac_address) +#endif /* LINUX_VERSION_IS_LESS(5,16,0) */ + #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */ From patchwork Thu Oct 13 08:53:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 13005758 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15635C4167B for ; Thu, 13 Oct 2022 08:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbiJMIx7 (ORCPT ); Thu, 13 Oct 2022 04:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbiJMIx5 (ORCPT ); Thu, 13 Oct 2022 04:53:57 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F0BE16EB5C for ; Thu, 13 Oct 2022 01:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/6fwFqVTKTQUDdTTIa//A3YNABtTKyq5AxEVQAK8mPs=; b=irEs0xJbyJwbgPdk6U41w5IEw8 YHKrw2vpIUL58WpQ3/yzRWqG/EXf8v3zEllSXaPixxujbAue/3Y/KpAHOZRPhCmhdUjWhEz8iofwi ePosNrxrw4lxkFH48BzgNpTJdrsb6w8ns5lYi10rTtB7GGZKIrIXTTab7QfzBPiIGZ4w=; Received: from p200300daa7301d0028e1e1004b08c350.dip0.t-ipconnect.de ([2003:da:a730:1d00:28e1:e100:4b08:c350] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oityT-00CO7a-GX for backports@vger.kernel.org; Thu, 13 Oct 2022 10:53:53 +0200 From: Felix Fietkau To: backports@vger.kernel.org Subject: [PATCH 8/8] headers: add skb_tcp_all_headers Date: Thu, 13 Oct 2022 10:53:51 +0200 Message-Id: <20221013085351.14516-8-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221013085351.14516-1-nbd@nbd.name> References: <20221013085351.14516-1-nbd@nbd.name> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Signed-off-by: Felix Fietkau --- backport/backport-include/linux/tcp.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backport/backport-include/linux/tcp.h diff --git a/backport/backport-include/linux/tcp.h b/backport/backport-include/linux/tcp.h new file mode 100644 index 000000000000..2483cbebf66c --- /dev/null +++ b/backport/backport-include/linux/tcp.h @@ -0,0 +1,14 @@ +#ifndef __BACKPORT_LINUX_TCP_H +#define __BACKPORT_LINUX_TCP_H + +#include_next +#include + +#if LINUX_VERSION_IS_LESS(6,0,0) +static inline int skb_tcp_all_headers(const struct sk_buff *skb) +{ + return skb_transport_offset(skb) + tcp_hdrlen(skb); +} +#endif + +#endif