net: qca_spi: Fix alignment issues in rx path
authorStefan Wahren <stefan.wahren@i2se.com>
Tue, 9 May 2017 13:40:38 +0000 (15:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:47:54 +0000 (19:47 +0200)
[ Upstream commit 8d66c30b12ed3cb533696dea8b9a9eadd5da426a ]

The qca_spi driver causes alignment issues on ARM devices.
So fix this by using netdev_alloc_skb_ip_align().

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/qualcomm/qca_spi.c

index 6e2add97947128804668a9cdb08bac22f1b888d2..8bbb55f319092fa622b762785a92862d160cef79 100644 (file)
@@ -296,8 +296,9 @@ qcaspi_receive(struct qcaspi *qca)
 
        /* Allocate rx SKB if we don't have one available. */
        if (!qca->rx_skb) {
-               qca->rx_skb = netdev_alloc_skb(net_dev,
-                                              net_dev->mtu + VLAN_ETH_HLEN);
+               qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,
+                                                       net_dev->mtu +
+                                                       VLAN_ETH_HLEN);
                if (!qca->rx_skb) {
                        netdev_dbg(net_dev, "out of RX resources\n");
                        qca->stats.out_of_mem++;
@@ -377,7 +378,7 @@ qcaspi_receive(struct qcaspi *qca)
                                        qca->rx_skb, qca->rx_skb->dev);
                                qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
                                netif_rx_ni(qca->rx_skb);
-                               qca->rx_skb = netdev_alloc_skb(net_dev,
+                               qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,
                                        net_dev->mtu + VLAN_ETH_HLEN);
                                if (!qca->rx_skb) {
                                        netdev_dbg(net_dev, "out of RX resources\n");
@@ -759,7 +760,8 @@ qcaspi_netdev_init(struct net_device *dev)
        if (!qca->rx_buffer)
                return -ENOBUFS;
 
-       qca->rx_skb = netdev_alloc_skb(dev, qca->net_dev->mtu + VLAN_ETH_HLEN);
+       qca->rx_skb = netdev_alloc_skb_ip_align(dev, qca->net_dev->mtu +
+                                               VLAN_ETH_HLEN);
        if (!qca->rx_skb) {
                kfree(qca->rx_buffer);
                netdev_info(qca->net_dev, "Failed to allocate RX sk_buff.\n");