--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
-@@ -694,7 +694,6 @@ static void xcan_err_interrupt(struct ne
+@@ -598,7 +598,6 @@ static void xcan_err_interrupt(struct ne
if (isr & XCAN_IXR_RXOFLW_MASK) {
stats->rx_over_errors++;
stats->rx_errors++;
+++ /dev/null
-From 2f4f0f338cf453bfcdbcf089e177c16f35f023c8 Mon Sep 17 00:00:00 2001
-From: Anssi Hannula <anssi.hannula@bitwise.fi>
-Date: Mon, 26 Feb 2018 14:39:59 +0200
-Subject: can: xilinx_can: fix incorrect clear of non-processed interrupts
-
-From: Anssi Hannula <anssi.hannula@bitwise.fi>
-
-commit 2f4f0f338cf453bfcdbcf089e177c16f35f023c8 upstream.
-
-xcan_interrupt() clears ERROR|RXOFLV|BSOFF|ARBLST interrupts if any of
-them is asserted. This does not take into account that some of them
-could have been asserted between interrupt status read and interrupt
-clear, therefore clearing them without handling them.
-
-Fix the code to only clear those interrupts that it knows are asserted
-and therefore going to be processed in xcan_err_interrupt().
-
-Fixes: b1201e44f50b ("can: xilinx CAN controller support")
-Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
-Cc: Michal Simek <michal.simek@xilinx.com>
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- drivers/net/can/xilinx_can.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
---- a/drivers/net/can/xilinx_can.c
-+++ b/drivers/net/can/xilinx_can.c
-@@ -939,6 +939,7 @@ static irqreturn_t xcan_interrupt(int ir
- struct net_device *ndev = (struct net_device *)dev_id;
- struct xcan_priv *priv = netdev_priv(ndev);
- u32 isr, ier;
-+ u32 isr_errors;
-
- /* Get the interrupt status from Xilinx CAN */
- isr = priv->read_reg(priv, XCAN_ISR_OFFSET);
-@@ -957,11 +958,10 @@ static irqreturn_t xcan_interrupt(int ir
- xcan_tx_interrupt(ndev, isr);
-
- /* Check for the type of error interrupt and Processing it */
-- if (isr & (XCAN_IXR_ERROR_MASK | XCAN_IXR_RXOFLW_MASK |
-- XCAN_IXR_BSOFF_MASK | XCAN_IXR_ARBLST_MASK)) {
-- priv->write_reg(priv, XCAN_ICR_OFFSET, (XCAN_IXR_ERROR_MASK |
-- XCAN_IXR_RXOFLW_MASK | XCAN_IXR_BSOFF_MASK |
-- XCAN_IXR_ARBLST_MASK));
-+ isr_errors = isr & (XCAN_IXR_ERROR_MASK | XCAN_IXR_RXOFLW_MASK |
-+ XCAN_IXR_BSOFF_MASK | XCAN_IXR_ARBLST_MASK);
-+ if (isr_errors) {
-+ priv->write_reg(priv, XCAN_ICR_OFFSET, isr_errors);
- xcan_err_interrupt(ndev, isr);
- }
-
+++ /dev/null
-From 877e0b75947e2c7acf5624331bb17ceb093c98ae Mon Sep 17 00:00:00 2001
-From: Anssi Hannula <anssi.hannula@bitwise.fi>
-Date: Wed, 8 Feb 2017 13:13:40 +0200
-Subject: can: xilinx_can: fix recovery from error states not being propagated
-
-From: Anssi Hannula <anssi.hannula@bitwise.fi>
-
-commit 877e0b75947e2c7acf5624331bb17ceb093c98ae upstream.
-
-The xilinx_can driver contains no mechanism for propagating recovery
-from CAN_STATE_ERROR_WARNING and CAN_STATE_ERROR_PASSIVE.
-
-Add such a mechanism by factoring the handling of
-XCAN_STATE_ERROR_PASSIVE and XCAN_STATE_ERROR_WARNING out of
-xcan_err_interrupt and checking for recovery after RX and TX if the
-interface is in one of those states.
-
-Tested with the integrated CAN on Zynq-7000 SoC.
-
-Fixes: b1201e44f50b ("can: xilinx CAN controller support")
-Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- drivers/net/can/xilinx_can.c | 155 +++++++++++++++++++++++++++++++++++--------
- 1 file changed, 127 insertions(+), 28 deletions(-)
-
---- a/drivers/net/can/xilinx_can.c
-+++ b/drivers/net/can/xilinx_can.c
-@@ -2,6 +2,7 @@
- *
- * Copyright (C) 2012 - 2014 Xilinx, Inc.
- * Copyright (C) 2009 PetaLogix. All rights reserved.
-+ * Copyright (C) 2017 Sandvik Mining and Construction Oy
- *
- * Description:
- * This driver is developed for Axi CAN IP and for Zynq CANPS Controller.
-@@ -528,6 +529,123 @@ static int xcan_rx(struct net_device *nd
- }
-
- /**
-+ * xcan_current_error_state - Get current error state from HW
-+ * @ndev: Pointer to net_device structure
-+ *
-+ * Checks the current CAN error state from the HW. Note that this
-+ * only checks for ERROR_PASSIVE and ERROR_WARNING.
-+ *
-+ * Return:
-+ * ERROR_PASSIVE or ERROR_WARNING if either is active, ERROR_ACTIVE
-+ * otherwise.
-+ */
-+static enum can_state xcan_current_error_state(struct net_device *ndev)
-+{
-+ struct xcan_priv *priv = netdev_priv(ndev);
-+ u32 status = priv->read_reg(priv, XCAN_SR_OFFSET);
-+
-+ if ((status & XCAN_SR_ESTAT_MASK) == XCAN_SR_ESTAT_MASK)
-+ return CAN_STATE_ERROR_PASSIVE;
-+ else if (status & XCAN_SR_ERRWRN_MASK)
-+ return CAN_STATE_ERROR_WARNING;
-+ else
-+ return CAN_STATE_ERROR_ACTIVE;
-+}
-+
-+/**
-+ * xcan_set_error_state - Set new CAN error state
-+ * @ndev: Pointer to net_device structure
-+ * @new_state: The new CAN state to be set
-+ * @cf: Error frame to be populated or NULL
-+ *
-+ * Set new CAN error state for the device, updating statistics and
-+ * populating the error frame if given.
-+ */
-+static void xcan_set_error_state(struct net_device *ndev,
-+ enum can_state new_state,
-+ struct can_frame *cf)
-+{
-+ struct xcan_priv *priv = netdev_priv(ndev);
-+ u32 ecr = priv->read_reg(priv, XCAN_ECR_OFFSET);
-+ u32 txerr = ecr & XCAN_ECR_TEC_MASK;
-+ u32 rxerr = (ecr & XCAN_ECR_REC_MASK) >> XCAN_ESR_REC_SHIFT;
-+
-+ priv->can.state = new_state;
-+
-+ if (cf) {
-+ cf->can_id |= CAN_ERR_CRTL;
-+ cf->data[6] = txerr;
-+ cf->data[7] = rxerr;
-+ }
-+
-+ switch (new_state) {
-+ case CAN_STATE_ERROR_PASSIVE:
-+ priv->can.can_stats.error_passive++;
-+ if (cf)
-+ cf->data[1] = (rxerr > 127) ?
-+ CAN_ERR_CRTL_RX_PASSIVE :
-+ CAN_ERR_CRTL_TX_PASSIVE;
-+ break;
-+ case CAN_STATE_ERROR_WARNING:
-+ priv->can.can_stats.error_warning++;
-+ if (cf)
-+ cf->data[1] |= (txerr > rxerr) ?
-+ CAN_ERR_CRTL_TX_WARNING :
-+ CAN_ERR_CRTL_RX_WARNING;
-+ break;
-+ case CAN_STATE_ERROR_ACTIVE:
-+ if (cf)
-+ cf->data[1] |= CAN_ERR_CRTL_ACTIVE;
-+ break;
-+ default:
-+ /* non-ERROR states are handled elsewhere */
-+ WARN_ON(1);
-+ break;
-+ }
-+}
-+
-+/**
-+ * xcan_update_error_state_after_rxtx - Update CAN error state after RX/TX
-+ * @ndev: Pointer to net_device structure
-+ *
-+ * If the device is in a ERROR-WARNING or ERROR-PASSIVE state, check if
-+ * the performed RX/TX has caused it to drop to a lesser state and set
-+ * the interface state accordingly.
-+ */
-+static void xcan_update_error_state_after_rxtx(struct net_device *ndev)
-+{
-+ struct xcan_priv *priv = netdev_priv(ndev);
-+ enum can_state old_state = priv->can.state;
-+ enum can_state new_state;
-+
-+ /* changing error state due to successful frame RX/TX can only
-+ * occur from these states
-+ */
-+ if (old_state != CAN_STATE_ERROR_WARNING &&
-+ old_state != CAN_STATE_ERROR_PASSIVE)
-+ return;
-+
-+ new_state = xcan_current_error_state(ndev);
-+
-+ if (new_state != old_state) {
-+ struct sk_buff *skb;
-+ struct can_frame *cf;
-+
-+ skb = alloc_can_err_skb(ndev, &cf);
-+
-+ xcan_set_error_state(ndev, new_state, skb ? cf : NULL);
-+
-+ if (skb) {
-+ struct net_device_stats *stats = &ndev->stats;
-+
-+ stats->rx_packets++;
-+ stats->rx_bytes += cf->can_dlc;
-+ netif_rx(skb);
-+ }
-+ }
-+}
-+
-+/**
- * xcan_err_interrupt - error frame Isr
- * @ndev: net_device pointer
- * @isr: interrupt status register value
-@@ -542,16 +660,12 @@ static void xcan_err_interrupt(struct ne
- struct net_device_stats *stats = &ndev->stats;
- struct can_frame *cf;
- struct sk_buff *skb;
-- u32 err_status, status, txerr = 0, rxerr = 0;
-+ u32 err_status;
-
- skb = alloc_can_err_skb(ndev, &cf);
-
- err_status = priv->read_reg(priv, XCAN_ESR_OFFSET);
- priv->write_reg(priv, XCAN_ESR_OFFSET, err_status);
-- txerr = priv->read_reg(priv, XCAN_ECR_OFFSET) & XCAN_ECR_TEC_MASK;
-- rxerr = ((priv->read_reg(priv, XCAN_ECR_OFFSET) &
-- XCAN_ECR_REC_MASK) >> XCAN_ESR_REC_SHIFT);
-- status = priv->read_reg(priv, XCAN_SR_OFFSET);
-
- if (isr & XCAN_IXR_BSOFF_MASK) {
- priv->can.state = CAN_STATE_BUS_OFF;
-@@ -561,28 +675,10 @@ static void xcan_err_interrupt(struct ne
- can_bus_off(ndev);
- if (skb)
- cf->can_id |= CAN_ERR_BUSOFF;
-- } else if ((status & XCAN_SR_ESTAT_MASK) == XCAN_SR_ESTAT_MASK) {
-- priv->can.state = CAN_STATE_ERROR_PASSIVE;
-- priv->can.can_stats.error_passive++;
-- if (skb) {
-- cf->can_id |= CAN_ERR_CRTL;
-- cf->data[1] = (rxerr > 127) ?
-- CAN_ERR_CRTL_RX_PASSIVE :
-- CAN_ERR_CRTL_TX_PASSIVE;
-- cf->data[6] = txerr;
-- cf->data[7] = rxerr;
-- }
-- } else if (status & XCAN_SR_ERRWRN_MASK) {
-- priv->can.state = CAN_STATE_ERROR_WARNING;
-- priv->can.can_stats.error_warning++;
-- if (skb) {
-- cf->can_id |= CAN_ERR_CRTL;
-- cf->data[1] |= (txerr > rxerr) ?
-- CAN_ERR_CRTL_TX_WARNING :
-- CAN_ERR_CRTL_RX_WARNING;
-- cf->data[6] = txerr;
-- cf->data[7] = rxerr;
-- }
-+ } else {
-+ enum can_state new_state = xcan_current_error_state(ndev);
-+
-+ xcan_set_error_state(ndev, new_state, skb ? cf : NULL);
- }
-
- /* Check for Arbitration lost interrupt */
-@@ -715,8 +811,10 @@ static int xcan_rx_poll(struct napi_stru
- isr = priv->read_reg(priv, XCAN_ISR_OFFSET);
- }
-
-- if (work_done)
-+ if (work_done) {
- can_led_event(ndev, CAN_LED_EVENT_RX);
-+ xcan_update_error_state_after_rxtx(ndev);
-+ }
-
- if (work_done < quota) {
- napi_complete(napi);
-@@ -747,6 +845,7 @@ static void xcan_tx_interrupt(struct net
- isr = priv->read_reg(priv, XCAN_ISR_OFFSET);
- }
- can_led_event(ndev, CAN_LED_EVENT_TX);
-+ xcan_update_error_state_after_rxtx(ndev);
- netif_wake_queue(ndev);
- }
-
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
-@@ -103,7 +103,7 @@ enum xcan_reg {
+@@ -102,7 +102,7 @@ enum xcan_reg {
#define XCAN_INTR_ALL (XCAN_IXR_TXOK_MASK | XCAN_IXR_BSOFF_MASK |\
XCAN_IXR_WKUP_MASK | XCAN_IXR_SLP_MASK | \
XCAN_IXR_RXNEMP_MASK | XCAN_IXR_ERROR_MASK | \
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- drivers/net/can/xilinx_can.c | 139 ++++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 123 insertions(+), 16 deletions(-)
+ drivers/net/can/xilinx_can.c | 79 ++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 67 insertions(+), 12 deletions(-)
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
-@@ -26,8 +26,10 @@
+@@ -25,8 +25,10 @@
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/of.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/can/dev.h>
-@@ -118,6 +120,7 @@ enum xcan_reg {
+@@ -117,6 +119,7 @@ enum xcan_reg {
/**
* struct xcan_priv - This definition define CAN driver instance
* @can: CAN private data structure.
* @tx_head: Tx CAN packets ready to send on the queue
* @tx_tail: Tx CAN packets successfully sended on the queue
* @tx_max: Maximum number packets the driver can send
-@@ -132,6 +135,7 @@ enum xcan_reg {
+@@ -131,6 +134,7 @@ enum xcan_reg {
*/
struct xcan_priv {
struct can_priv can;
unsigned int tx_head;
unsigned int tx_tail;
unsigned int tx_max;
-@@ -159,6 +163,11 @@ static const struct can_bittiming_const
+@@ -158,6 +162,11 @@ static const struct can_bittiming_const
.brp_inc = 1,
};
/**
* xcan_write_reg_le - Write a value to the device register little endian
* @priv: Driver private data structure
-@@ -238,6 +247,10 @@ static int set_reset_mode(struct net_dev
+@@ -237,6 +246,10 @@ static int set_reset_mode(struct net_dev
usleep_range(500, 10000);
}
return 0;
}
-@@ -392,6 +405,7 @@ static int xcan_start_xmit(struct sk_buf
+@@ -391,6 +404,7 @@ static int xcan_start_xmit(struct sk_buf
struct net_device_stats *stats = &ndev->stats;
struct can_frame *cf = (struct can_frame *)skb->data;
u32 id, dlc, data[2] = {0, 0};
if (can_dropped_invalid_skb(ndev, skb))
return NETDEV_TX_OK;
-@@ -439,6 +453,9 @@ static int xcan_start_xmit(struct sk_buf
+@@ -438,6 +452,9 @@ static int xcan_start_xmit(struct sk_buf
data[1] = be32_to_cpup((__be32 *)(cf->data + 4));
can_put_echo_skb(skb, ndev, priv->tx_head % priv->tx_max);
priv->tx_head++;
/* Write the Frame to Xilinx CAN TX FIFO */
-@@ -454,10 +471,16 @@ static int xcan_start_xmit(struct sk_buf
+@@ -453,10 +470,16 @@ static int xcan_start_xmit(struct sk_buf
stats->tx_bytes += cf->can_dlc;
}
return NETDEV_TX_OK;
}
-@@ -833,19 +856,71 @@ static void xcan_tx_interrupt(struct net
- {
- struct xcan_priv *priv = netdev_priv(ndev);
- struct net_device_stats *stats = &ndev->stats;
-+ unsigned int frames_in_fifo;
-+ int frames_sent = 1; /* TXOK => at least 1 frame was sent */
-+ unsigned long flags;
-+ int retries = 0;
-+
-+ /* Synchronize with xmit as we need to know the exact number
-+ * of frames in the FIFO to stay in sync due to the TXFEMP
-+ * handling.
-+ * This also prevents a race between netif_wake_queue() and
-+ * netif_stop_queue().
-+ */
-+ spin_lock_irqsave(&priv->tx_lock, flags);
-+
-+ frames_in_fifo = priv->tx_head - priv->tx_tail;
-
-- while ((priv->tx_head - priv->tx_tail > 0) &&
-- (isr & XCAN_IXR_TXOK_MASK)) {
-+ if (WARN_ON_ONCE(frames_in_fifo == 0)) {
-+ /* clear TXOK anyway to avoid getting back here */
- priv->write_reg(priv, XCAN_ICR_OFFSET, XCAN_IXR_TXOK_MASK);
-+ spin_unlock_irqrestore(&priv->tx_lock, flags);
-+ return;
-+ }
-+
-+ /* Check if 2 frames were sent (TXOK only means that at least 1
-+ * frame was sent).
-+ */
-+ if (frames_in_fifo > 1) {
-+ WARN_ON(frames_in_fifo > priv->tx_max);
-+
-+ /* Synchronize TXOK and isr so that after the loop:
-+ * (1) isr variable is up-to-date at least up to TXOK clear
-+ * time. This avoids us clearing a TXOK of a second frame
-+ * but not noticing that the FIFO is now empty and thus
-+ * marking only a single frame as sent.
-+ * (2) No TXOK is left. Having one could mean leaving a
-+ * stray TXOK as we might process the associated frame
-+ * via TXFEMP handling as we read TXFEMP *after* TXOK
-+ * clear to satisfy (1).
-+ */
-+ while ((isr & XCAN_IXR_TXOK_MASK) && !WARN_ON(++retries == 100)) {
-+ priv->write_reg(priv, XCAN_ICR_OFFSET, XCAN_IXR_TXOK_MASK);
-+ isr = priv->read_reg(priv, XCAN_ISR_OFFSET);
-+ }
-+
-+ if (isr & XCAN_IXR_TXFEMP_MASK) {
-+ /* nothing in FIFO anymore */
-+ frames_sent = frames_in_fifo;
-+ }
-+ } else {
-+ /* single frame in fifo, just clear TXOK */
-+ priv->write_reg(priv, XCAN_ICR_OFFSET, XCAN_IXR_TXOK_MASK);
-+ }
-+
-+ while (frames_sent--) {
- can_get_echo_skb(ndev, priv->tx_tail %
- priv->tx_max);
- priv->tx_tail++;
- stats->tx_packets++;
-- isr = priv->read_reg(priv, XCAN_ISR_OFFSET);
- }
-+
-+ netif_wake_queue(ndev);
-+
-+ spin_unlock_irqrestore(&priv->tx_lock, flags);
-+
- can_led_event(ndev, CAN_LED_EVENT_TX);
- xcan_update_error_state_after_rxtx(ndev);
-- netif_wake_queue(ndev);
- }
-
- /**
-@@ -1122,6 +1197,18 @@ static int __maybe_unused xcan_resume(st
+@@ -1023,6 +1046,18 @@ static int __maybe_unused xcan_resume(st
static SIMPLE_DEV_PM_OPS(xcan_dev_pm_ops, xcan_suspend, xcan_resume);
/**
* xcan_probe - Platform registration call
* @pdev: Handle to the platform device structure
-@@ -1136,8 +1223,10 @@ static int xcan_probe(struct platform_de
+@@ -1037,8 +1072,10 @@ static int xcan_probe(struct platform_de
struct resource *res; /* IO mem resources */
struct net_device *ndev;
struct xcan_priv *priv;
/* Get the virtual base address for the device */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-@@ -1147,7 +1236,8 @@ static int xcan_probe(struct platform_de
+@@ -1048,7 +1085,8 @@ static int xcan_probe(struct platform_de
goto err;
}
if (ret < 0)
goto err;
-@@ -1155,6 +1245,30 @@ static int xcan_probe(struct platform_de
+@@ -1056,6 +1094,30 @@ static int xcan_probe(struct platform_de
if (ret < 0)
goto err;
/* Create a CAN device instance */
ndev = alloc_candev(sizeof(struct xcan_priv), tx_max);
if (!ndev)
-@@ -1169,6 +1283,7 @@ static int xcan_probe(struct platform_de
+@@ -1070,6 +1132,7 @@ static int xcan_probe(struct platform_de
CAN_CTRLMODE_BERR_REPORTING;
priv->reg_base = addr;
priv->tx_max = tx_max;
/* Get IRQ for the device */
ndev->irq = platform_get_irq(pdev, 0);
-@@ -1236,9 +1351,9 @@ static int xcan_probe(struct platform_de
+@@ -1137,9 +1200,9 @@ static int xcan_probe(struct platform_de
devm_can_led_init(ndev);
clk_disable_unprepare(priv->bus_clk);
clk_disable_unprepare(priv->can_clk);
return 0;
-@@ -1274,14 +1389,6 @@ static int xcan_remove(struct platform_d
+@@ -1175,14 +1238,6 @@ static int xcan_remove(struct platform_d
return 0;
}
usb-core-handle-hub-c_port_over_current-condition.patch
usb-gadget-f_fs-only-return-delayed-status-when-len-is-0.patch
can-xilinx_can-fix-rx-loop-if-rxnemp-is-asserted-without-rxok.patch
-can-xilinx_can-fix-recovery-from-error-states-not-being-propagated.patch
can-xilinx_can-fix-device-dropping-off-bus-on-rx-overrun.patch
can-xilinx_can-keep-only-1-2-frames-in-tx-fifo-to-fix-tx-accounting.patch
-can-xilinx_can-fix-incorrect-clear-of-non-processed-interrupts.patch
can-xilinx_can-fix-rx-overflow-interrupt-not-being-enabled.patch
arm-fix-put_user-for-gcc-8.patch
+turn-off-wattribute-alias.patch
--- /dev/null
+From arnd@arndb.de Fri Jul 27 11:18:04 2018
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 26 Jul 2018 10:13:22 +0200
+Subject: turn off -Wattribute-alias
+To: stable@vger.kernel.org
+Cc: gregkh@linuxfoundation.org, Arnd Bergmann <arnd@arndb.de>, Michal Marek <mmarek@suse.com>, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
+Message-ID: <20180726081358.3829157-1-arnd@arndb.de>
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+Starting with gcc-8.1, we get a warning about all system call definitions,
+which use an alias between functions with incompatible prototypes, e.g.:
+
+In file included from ../mm/process_vm_access.c:19:
+../include/linux/syscalls.h:211:18: warning: 'sys_process_vm_readv' alias between functions of incompatible types 'long int(pid_t, const struct iovec *, long unsigned int, const struct iovec *, long unsigned int, long unsigned int)' {aka 'long int(int, const struct iovec *, long unsigned int, const struct iovec *, long unsigned int, long unsigned int)'} and 'long int(long int, long int, long int, long int, long int, long int)' [-Wattribute-alias]
+ asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
+ ^~~
+../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
+ __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
+ ^~~~~~~~~~~~~~~~~
+../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
+ #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
+ ^~~~~~~~~~~~~~~
+../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
+ SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,
+ ^~~~~~~~~~~~~~~
+../include/linux/syscalls.h:215:18: note: aliased declaration here
+ asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
+ ^~~
+../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
+ __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
+ ^~~~~~~~~~~~~~~~~
+../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
+ #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
+ ^~~~~~~~~~~~~~~
+../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
+ SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,
+
+This is really noisy and does not indicate a real problem. In the latest
+mainline kernel, this was addressed by commit bee20031772a ("disable
+-Wattribute-alias warning for SYSCALL_DEFINEx()"), which seems too invasive
+to backport.
+
+This takes a much simpler approach and just disables the warning across the
+kernel.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -613,6 +613,7 @@ KBUILD_CFLAGS += $(call cc-disable-warni
+ KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
+ KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
+ KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
++KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
+ KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+ KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
+