From patchwork Sun Feb 11 22:46:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 871826 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="Rvw5lqIy"; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NONb+Bnr"; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zfkWh35qbz9t3F for ; Mon, 12 Feb 2018 09:49:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:References:In-Reply-To:Message-Id:Date:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s69NowgQI9YdL1TMTIxIepvBbEjT7QEsB6ag4iXwNNg=; b=Rvw5lqIyCUwy+55Hm8Rbh9XyKX eTFPK8xGoTiGnHnhTQCTlGVQnacDDgIcMyT1v9vd6kEAbaXI5VxR4uRrN4qRLA1DrxFdPaa3zLYjW 2331iUaStPlIvIp3IVUZHlak05kuU/PgEjLjwjK87cy7jq7E4o83B3HQmq+J3W2qyuWMJcid+h2m6 KbpJ2Y2kFrGEFStN7dgvI0L9pQNloH+5fbaauiAzku9gU50nT92VPk6ZOFUEJfNAGUuyBWDykEDBP taVFxEQLNvchyRPsUgYFhUrsQr5ymhQQepuWKpTH/B4heNIJmU2e5M3Jo7GVCbrJYxypOfyGawpRE y+xCGAgA==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1el0R4-0002N0-9I for incoming@patchwork.ozlabs.org; Sun, 11 Feb 2018 22:49:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s69NowgQI9YdL1TMTIxIepvBbEjT7QEsB6ag4iXwNNg=; b=NONb+Bnrj6iofu QszQnDm5Nl2FL2+C0htQ19dYv9borxhlYD32zRlk9LdWLKd+wl1Dl85gqwSsC/VFTK/ToG3vj+F63 UHnXYNNNLhlybBKl/KsKjjqcD6bpuP0nuU+8Hu8LCHLe2mM3creFo0CfQlwupBg/7v10VhFYBs3gq WWDCYD0mcqtKYWnja3c1wFG3ipaUXOd/oyUl0/epfFtwtoKccXWvU2mmIfQbGyMV/1S/AjUtgIKxb 0WTb8iRl1rrN30DhLUgTRmZoFnl4uWTOJgZJWQlCOSWV+0ctuFourTsTI7LjiHAqgg51NWM4/K/pV 5t8UfMG+RcCNMdj0qEVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1el0Pz-0001Bq-Qu; Sun, 11 Feb 2018 22:48:19 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1el0Oo-0007Fu-Ig for lede-dev@lists.infradead.org; Sun, 11 Feb 2018 22:47:09 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 116E340FB0; Sun, 11 Feb 2018 23:46:47 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id b3n2oxdxHfAj; Sun, 11 Feb 2018 23:46:46 +0100 (CET) From: Hauke Mehrtens To: lede-dev@lists.infradead.org, kaloz@openwrt.org Date: Sun, 11 Feb 2018 23:46:17 +0100 Message-Id: <20180211224618.8410-10-hauke@hauke-m.de> In-Reply-To: <20180211224618.8410-1-hauke@hauke-m.de> References: <20180211224618.8410-1-hauke@hauke-m.de> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.215 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH v3 09/10] mwlwifi: fix compile problem with kernel 4.14 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , tomek_n@o2.pl, luci@createc.ro MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org vfs_write() is not exported on kernel 4.14 any more and kernel_write() should be used instead. Signed-off-by: Hauke Mehrtens --- .../mwlwifi/patches/001-remove-vfs_write.patch | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 package/kernel/mwlwifi/patches/001-remove-vfs_write.patch diff --git a/package/kernel/mwlwifi/patches/001-remove-vfs_write.patch b/package/kernel/mwlwifi/patches/001-remove-vfs_write.patch new file mode 100644 index 0000000000..9703d1d688 --- /dev/null +++ b/package/kernel/mwlwifi/patches/001-remove-vfs_write.patch @@ -0,0 +1,92 @@ +--- a/debugfs.c ++++ b/debugfs.c +@@ -279,7 +279,6 @@ static void core_dump_file(u8 *valbuf, u + u32 append, u32 totallen, bool textmode) + { + struct file *filp_core = NULL; +- mm_segment_t oldfs; + char file_name[40]; + u8 *buf = kmalloc(length * 3, GFP_KERNEL); + u8 *data_p = buf; +@@ -292,9 +291,6 @@ static void core_dump_file(u8 *valbuf, u + sprintf(file_name, "/dev/shm/coredump-%x-%x", + region, (region + totallen)); + +- oldfs = get_fs(); +- set_fs(KERNEL_DS); +- + if (append) + filp_core = filp_open(file_name, O_RDWR | O_APPEND, 0); + else +@@ -317,15 +313,15 @@ static void core_dump_file(u8 *valbuf, u + } + data_p = buf + j; + data_p += sprintf(data_p, "\n"); +- vfs_write(filp_core, buf, strlen(buf), +- &filp_core->f_pos); ++ kernel_write(filp_core, buf, strlen(buf), ++ &filp_core->f_pos); + } else +- vfs_write(filp_core, valbuf, length, &filp_core->f_pos); ++ kernel_write(filp_core, valbuf, length, ++ &filp_core->f_pos); + + filp_close(filp_core, current->files); + } + +- set_fs(oldfs); + kfree(buf); + } + +@@ -1338,7 +1334,6 @@ static ssize_t mwl_debugfs_ba_hist_read( + u8 bmap0flag, nobaflag; + char buff[500], file_location[20]; + struct file *filp_bahisto; +- mm_segment_t oldfs; + u8 *data_p = buff; + ssize_t ret; + +@@ -1354,13 +1349,10 @@ static ssize_t mwl_debugfs_ba_hist_read( + memset(file_location, 0, sizeof(file_location)); + sprintf(file_location, "/tmp/ba_histo-%d", priv->ba_aid); + +- oldfs = get_fs(); +- set_fs(KERNEL_DS); + filp_bahisto = filp_open(file_location, + O_RDWR | O_CREAT | O_TRUNC, 0); + + if (IS_ERR(filp_bahisto)) { +- set_fs(oldfs); + ret = -EIO; + goto err; + } +@@ -1401,8 +1393,8 @@ static ssize_t mwl_debugfs_ba_hist_read( + + /* Buffer is full. Write to file and reset buf */ + if ((strlen(buff) + 36) >= 500) { +- vfs_write(filp_bahisto, buff, strlen(buff), +- &filp_bahisto->f_pos); ++ kernel_write(filp_bahisto, buff, strlen(buff), ++ &filp_bahisto->f_pos); + mdelay(2); + memset(buff, 0, sizeof(buff)); + data_p = buff; +@@ -1426,8 +1418,8 @@ static ssize_t mwl_debugfs_ba_hist_read( + data_p += sprintf(data_p, "%8d\n", nobaflag); + } + +- vfs_write(filp_bahisto, buff, strlen(buff), +- &filp_bahisto->f_pos); ++ kernel_write(filp_bahisto, buff, strlen(buff), ++ &filp_bahisto->f_pos); + len += scnprintf(p + len, size - len, + "hole: %d, expect: %d, bmap0: %d, noba: %d\n", + baholecnt, baexpcnt, bmap0cnt, nobacnt); +@@ -1440,7 +1432,6 @@ static ssize_t mwl_debugfs_ba_hist_read( + priv->ba_aid); + + filp_close(filp_bahisto, current->files); +- set_fs(oldfs); + + ret = simple_read_from_buffer(ubuf, count, ppos, p, len); +