From patchwork Sun May 23 15:54:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 446827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72FE2C4707A for ; Sun, 23 May 2021 15:54:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F59861104 for ; Sun, 23 May 2021 15:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231835AbhEWPzw (ORCPT ); Sun, 23 May 2021 11:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231867AbhEWPzq (ORCPT ); Sun, 23 May 2021 11:55:46 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7EDCC06138D; Sun, 23 May 2021 08:54:18 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id x188so18790390pfd.7; Sun, 23 May 2021 08:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pjK887Xz+X6T4Y2ff7RSvF+2TexghUl3NiM9BTxoguo=; b=l0FSlSawwB7/tYE5V52wWz5qvPUgro517N2wtmlblVZC2MFXtTrbkc2XatdXrLXf0Q Ho1NYYzRxRleiVHXprCGX2gExXm6PoGHUYZ7xUvFqT4ftlhRjOlZpAyPb7mls7BCNegJ yBfSvVhStZzSxNB4TULh28g7dkYQrWTTuHZb3fwXO0QChEshxA6UFuSLxpOUEzbIJEQN bMlGAdknhblnFv7r3wg+M44R6Vuxsbu3pYNuFkr/5EHqxCy/Zuu5puMeIzPkyMh9sag3 S9U7F+mdRjLKAgQJzRQiVk6jLfx56N2hs/VfEJBRzxhxlHB2lJ87je7FB0CB9JfjokNT +vNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pjK887Xz+X6T4Y2ff7RSvF+2TexghUl3NiM9BTxoguo=; b=a2RF1nn+KnNNhJ4Se3cowWE5Q0RFTgxSmSX+/0w8+FnUPzgEM3flpzwEtBfiz/h4EZ rJBc7mE2NOGj6dR7fN6CbHoysr0vB19AM8oS7Xg86wooP/ZMIyCrzXnC4zaJO1Z8TqbG 5jBP9Yp6TlM0XH7mqmaFpvOXOOa78YZB4KXkTqE3SgTD/cPqw+m588GYlqMOVCE0MzZc VSfblcHFqfbvqUQ5sMkI0vn0Wq59/+2rBv4BWAs1suhfRy8eskZVK0xX4b+atU2hPLyi jJd3WvEjY0PqYpT+5pihrUmOxl7E4ZoiRibbt/TlBiL7RrNMnuH5PI6837R97rYmKiyK A6OQ== X-Gm-Message-State: AOAM530k4R0HhM5FVOE05ln+LqVW7HjgiX37Nxk5IKlGJLWnmDc3+mwB lkNvg67ZlsES3Xyofzq3FBfcZItKQfivQw== X-Google-Smtp-Source: ABdhPJz/DCWT8ejE2r2GpiDFwAoIe6DMNVejMgqfWn85sjaOAIqvDq+a+/0eyJnV8dCvqdrJ/SOeNg== X-Received: by 2002:a62:4e03:0:b029:2e7:46b3:3a82 with SMTP id c3-20020a624e030000b02902e746b33a82mr6419738pfb.53.1621785257364; Sun, 23 May 2021 08:54:17 -0700 (PDT) Received: from localhost.localdomain (99-44-17-11.lightspeed.irvnca.sbcglobal.net. [99.44.17.11]) by smtp.gmail.com with ESMTPSA id t133sm10022765pgb.0.2021.05.23.08.54.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 May 2021 08:54:16 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 1/2] net: r6040: Use logical or for MDIO operations Date: Sun, 23 May 2021 08:54:10 -0700 Message-Id: <20210523155411.11185-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210523155411.11185-1-f.fainelli@gmail.com> References: <20210523155411.11185-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This is not a functional change, but we should be using a logical or to assign the bits we will be writing to the MDIO read and write registers. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/rdc/r6040.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c index 7c74318620b1..aff68e2cb700 100644 --- a/drivers/net/ethernet/rdc/r6040.c +++ b/drivers/net/ethernet/rdc/r6040.c @@ -200,7 +200,7 @@ static int r6040_phy_read(void __iomem *ioaddr, int phy_addr, int reg) int limit = MAC_DEF_TIMEOUT; u16 cmd; - iowrite16(MDIO_READ + reg + (phy_addr << 8), ioaddr + MMDIO); + iowrite16(MDIO_READ | reg | (phy_addr << 8), ioaddr + MMDIO); /* Wait for the read bit to be cleared */ while (limit--) { cmd = ioread16(ioaddr + MMDIO); @@ -224,7 +224,7 @@ static int r6040_phy_write(void __iomem *ioaddr, iowrite16(val, ioaddr + MMWD); /* Write the command to the MDIO bus */ - iowrite16(MDIO_WRITE + reg + (phy_addr << 8), ioaddr + MMDIO); + iowrite16(MDIO_WRITE | reg | (phy_addr << 8), ioaddr + MMDIO); /* Wait for the write bit to be cleared */ while (limit--) { cmd = ioread16(ioaddr + MMDIO); From patchwork Sun May 23 15:54:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 446388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE0ECC47081 for ; Sun, 23 May 2021 15:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2E3661132 for ; Sun, 23 May 2021 15:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbhEWPz6 (ORCPT ); Sun, 23 May 2021 11:55:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbhEWPzq (ORCPT ); Sun, 23 May 2021 11:55:46 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65AACC061574; Sun, 23 May 2021 08:54:19 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id n6-20020a17090ac686b029015d2f7aeea8so9864533pjt.1; Sun, 23 May 2021 08:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NPLKamZ9/ZYlfg2IVe2bQUIYpT9APx67IKzrgt/lV2A=; b=liATBOiCjESotZSb4t4K4t9nOKJOmJFueVrKjGOxVnIXGjIy+PcuGJXy8SC5zuAYqh GgjNrz9HuzfSJTA4jlm7qcyPbVxvsNzubnnIvneuEYxAGKsvvvbHc98015hAXcOmUXqO khWk7KxRmjVsAx+DJkPqzcn6RsOTH647/wFQ9xi3uePtD2IIlG3a1OQNOrhQFFo5TeMh wDpT7p4lNbTh++7gfdA2MS46TxpDL4FWYKdFLAfMLWKWsJbekQ/VvfbWkPxn31rTc8ai zEJERsB2Phqug7acSHSVgcIDirh6VpySn8V1qKRV2uzboKDFidZyY/geIMxeFjiTQugP CU5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NPLKamZ9/ZYlfg2IVe2bQUIYpT9APx67IKzrgt/lV2A=; b=AqoA0K2bxoOh0vdAtD5/oKGKxzFkucTRWwD1SOcl0FlM88AO36z+Tw7nYddu5z7dDg yOVW0h3o3edNqshHQxwlAGOsh5yIsAqUad30NjrY8tXs5JprYFu9OX/toxHcVAg7lZCU F3MhPuMzm6DU8T+XJ9Nc2DkW02Ik6osSFl+aB55ZXyE+TdSbMWy0gk7MK8H3+sie5k/0 is+0sLSfvrXUVMACahENbLPkpwhquH84lzKZjn1IcNNMp58ZKf36sXUI4hVwQiIxYj4Z kvk/O0Y6uXREEh0RzaL/o1FsZRlEiwnRl++VREoF2PjrHcBD9MI9x9I6StuhBvYlS4Vr GedA== X-Gm-Message-State: AOAM530fZNTQXR2/C/pilUzb/EtV086uppw73v+ZWgA0aq7zqvtYhTc5 M9y2I9TSBGljg6pNgA+D0YHN15bL1RK4KQ== X-Google-Smtp-Source: ABdhPJyoSn20xeqh6TG4kDQomaSBX8JWRXARTrNd7jYWQBUrkDx2+OK+DAN9wHzxKJICaxJOuBkOng== X-Received: by 2002:a17:90a:7a89:: with SMTP id q9mr20447684pjf.0.1621785258616; Sun, 23 May 2021 08:54:18 -0700 (PDT) Received: from localhost.localdomain (99-44-17-11.lightspeed.irvnca.sbcglobal.net. [99.44.17.11]) by smtp.gmail.com with ESMTPSA id t133sm10022765pgb.0.2021.05.23.08.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 May 2021 08:54:18 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 2/2] net: r6040: Use ETH_FCS_LEN Date: Sun, 23 May 2021 08:54:11 -0700 Message-Id: <20210523155411.11185-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210523155411.11185-1-f.fainelli@gmail.com> References: <20210523155411.11185-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Instead of the open coded constant 4. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/rdc/r6040.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c index aff68e2cb700..ef78c2424668 100644 --- a/drivers/net/ethernet/rdc/r6040.c +++ b/drivers/net/ethernet/rdc/r6040.c @@ -544,7 +544,7 @@ static int r6040_rx(struct net_device *dev, int limit) skb_ptr->dev = priv->dev; /* Do not count the CRC */ - skb_put(skb_ptr, descptr->len - 4); + skb_put(skb_ptr, descptr->len - ETH_FCS_LEN); dma_unmap_single(&priv->pdev->dev, le32_to_cpu(descptr->buf), MAX_BUF_SIZE, DMA_FROM_DEVICE); skb_ptr->protocol = eth_type_trans(skb_ptr, priv->dev); @@ -552,7 +552,7 @@ static int r6040_rx(struct net_device *dev, int limit) /* Send to upper layer */ netif_receive_skb(skb_ptr); dev->stats.rx_packets++; - dev->stats.rx_bytes += descptr->len - 4; + dev->stats.rx_bytes += descptr->len - ETH_FCS_LEN; /* put new skb into descriptor */ descptr->skb_ptr = new_skb;