From 05179409be464c5d2676dfb1ce0b3c57c6a6f700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 28 Jun 2018 13:51:00 +0200 Subject: [PATCH] fec: adapt to lx_kit/lx_emul update --- repos/dde_linux/patches/fec_tv64.patch | 28 +++++++++++++++++++ repos/dde_linux/ports/dde_linux.hash | 2 +- repos/dde_linux/ports/dde_linux.port | 1 + repos/dde_linux/src/drivers/nic/fec/dummy.c | 6 ---- .../dde_linux/src/drivers/nic/fec/lx_emul.cc | 7 +++-- repos/dde_linux/src/drivers/nic/fec/lx_emul.h | 12 +++++++- 6 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 repos/dde_linux/patches/fec_tv64.patch diff --git a/repos/dde_linux/patches/fec_tv64.patch b/repos/dde_linux/patches/fec_tv64.patch new file mode 100644 index 0000000000..3decced6c1 --- /dev/null +++ b/repos/dde_linux/patches/fec_tv64.patch @@ -0,0 +1,28 @@ +diff --git a/include/net/sock.h b/include/net/sock.h +index 14d3c07..818a1d1 100644 +--- a/include/net/sock.h ++++ b/include/net/sock.h +@@ -2148,8 +2148,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) + */ + if (sock_flag(sk, SOCK_RCVTSTAMP) || + (sk->sk_tsflags & SOF_TIMESTAMPING_RX_SOFTWARE) || +- (kt.tv64 && sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE) || +- (hwtstamps->hwtstamp.tv64 && ++ (kt && sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE) || ++ (hwtstamps->hwtstamp && + (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE))) + __sock_recv_timestamp(msg, sk, skb); + else +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index b2df375..02c065f 100644 +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -4212,7 +4212,7 @@ EXPORT_SYMBOL(skb_try_coalesce); + */ + void skb_scrub_packet(struct sk_buff *skb, bool xnet) + { +- skb->tstamp.tv64 = 0; ++ skb->tstamp = 0; + skb->pkt_type = PACKET_HOST; + skb->skb_iif = 0; + skb->ignore_df = 0; diff --git a/repos/dde_linux/ports/dde_linux.hash b/repos/dde_linux/ports/dde_linux.hash index 0a8a0eeb7e..04aafbd871 100644 --- a/repos/dde_linux/ports/dde_linux.hash +++ b/repos/dde_linux/ports/dde_linux.hash @@ -1 +1 @@ -e124b91dec837347bbc7af31ac7eb488ab8c171b +55b39b5a0abadfe7027a5128d9d439d586d7a830 diff --git a/repos/dde_linux/ports/dde_linux.port b/repos/dde_linux/ports/dde_linux.port index 35cd41affb..8c1d317d52 100644 --- a/repos/dde_linux/ports/dde_linux.port +++ b/repos/dde_linux/ports/dde_linux.port @@ -203,5 +203,6 @@ PATCH_OPT(patches/intel_fb_backlight.patch) := -p1 -d$(SRC_DIR_INTEL_FB) # Freescale NIC PATCH_OPT(patches/fec_skbuff_cast.patch) := -p1 -d$(SRC_DIR_FEC) PATCH_OPT(patches/fec_tx_bounce_dma.patch) := -p1 -d$(SRC_DIR_FEC) +PATCH_OPT(patches/fec_tv64.patch) := -p1 -d$(SRC_DIR_FEC) # vi: set ft=make : diff --git a/repos/dde_linux/src/drivers/nic/fec/dummy.c b/repos/dde_linux/src/drivers/nic/fec/dummy.c index 05d3a03d1b..d0a1aee5aa 100644 --- a/repos/dde_linux/src/drivers/nic/fec/dummy.c +++ b/repos/dde_linux/src/drivers/nic/fec/dummy.c @@ -193,12 +193,6 @@ int regulator_disable(struct regulator *r) return -1; } -resource_size_t resource_size(const struct resource *res) -{ - TRACE_AND_STOP; - return -1; -} - bool page_is_pfmemalloc(struct page *page) { TRACE_AND_STOP; diff --git a/repos/dde_linux/src/drivers/nic/fec/lx_emul.cc b/repos/dde_linux/src/drivers/nic/fec/lx_emul.cc index 8f8d6b9e94..5184b70b77 100644 --- a/repos/dde_linux/src/drivers/nic/fec/lx_emul.cc +++ b/repos/dde_linux/src/drivers/nic/fec/lx_emul.cc @@ -728,9 +728,9 @@ void reinit_completion(struct completion *work) } -static void _completion_timeout(unsigned long t) +static void _completion_timeout(struct timer_list *t) { - Lx::Task *task = (Lx::Task *)t; + Lx::Task *task = (Lx::Task *)t->data; task->unblock(); } @@ -742,7 +742,8 @@ long __wait_completion(struct completion *work, unsigned long timeout) unsigned long j = timeout ? jiffies + timeout : 0; if (timeout) { - setup_timer(&t, _completion_timeout, (unsigned long)Lx::scheduler().current()); + timer_setup(&t, _completion_timeout, 0u); + t.data = (unsigned long) Lx::scheduler().current(); mod_timer(&t, j); } diff --git a/repos/dde_linux/src/drivers/nic/fec/lx_emul.h b/repos/dde_linux/src/drivers/nic/fec/lx_emul.h index 23ab82de67..c376188eba 100644 --- a/repos/dde_linux/src/drivers/nic/fec/lx_emul.h +++ b/repos/dde_linux/src/drivers/nic/fec/lx_emul.h @@ -109,6 +109,10 @@ size_t iov_iter_count(struct iov_iter *i); #include #include #include + +#define from_timer(var, callback_timer, timer_fieldname) \ + container_of(callback_timer, typeof(*var), timer_fieldname) + #include #include #include @@ -119,6 +123,12 @@ size_t iov_iter_count(struct iov_iter *i); #include #include #include + +enum { + __GFP_COLD = 0x00000100u, + __GFP_REPEAT = 0x00000400u, +}; + #include #include #include @@ -192,7 +202,7 @@ static inline s64 timespec64_to_ns(const struct timespec64 *ts) return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; } -#define ktime_to_ns(kt) ((kt).tv64) +#define ktime_to_ns(kt) ((kt)) ktime_t ns_to_ktime(u64 ns);