Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2078105ybp; Thu, 10 Oct 2019 01:47:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuNciarSxI+oLXfxp8pAhZo8QdhRQRoPlZRS8HBKQAWmts4zi7Bj6lUsdvnGQl9cuieIDn X-Received: by 2002:a05:6402:150f:: with SMTP id f15mr7229115edw.240.1570697265851; Thu, 10 Oct 2019 01:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697265; cv=none; d=google.com; s=arc-20160816; b=C1e0glbQxIOLeHWT/tAKxleA1jvsU/whP6V6IGpgEvacZK2ohldEwbs6k4sULKF7OS ph0ZadZK85fgESL3qe3CF1eBIcPfbJYnY2QQfsFMPvCb9FrsgOhZsB2uvazM1G5Abtkj 5yWreJ7U5u+E4c7ZGIo94JCEBPpl4AKh/+MS+sbaBdiY3qo3lyefAlblSVBcibLAfKvu EsQGPpatwWiGh9SHEGYhzpEspEKCDMeY7IWKTbi9qHhDaGeb2G4RLYTukDuzZVJOeMYX BWPf+/MXk2sAIvofKcT6dpzAlxzX3GfEaMHddksXtODXrXiFQ/wSLKBnot8pVKlyNm5h q6sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e4A21DkjuPLWBxrqtiMnJX5mnBGU2IFSGcqOsW5VUck=; b=twJpLcCDhaXPLg7f6vwHBzbUtxgTeJlq7CaX5rnJTi7YxFEasDdbAO0Lst1U37/aKn OfIyAk3Rr58LJBvnp5KGtju5ndz/XYUppWp4UU+q8CD4+8lgqz5qDDChpKWzEHNSzU9U owA45b2xwQqNx2aciH9ZCbjJV0mnmndCVVH3FqBTBIXLBQx+CKi+9XFQva/3/bNG3T/q euL+LYr19kvLbVazohBKvgd5rS8S3dKsPh734Eycs3KpeLopuTNoHtln+2Ue9sQRrQt6 CW8Hil3wA554+zUo0SDavKgyQFE/3x68ECnxJeHMoqCGDNhHf2vcJqbOQ1Zma7RuELmc /Nqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jHfdPqfi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nl6si2664350ejb.207.2019.10.10.01.47.22; Thu, 10 Oct 2019 01:47:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jHfdPqfi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387593AbfJJIoQ (ORCPT + 99 others); Thu, 10 Oct 2019 04:44:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:49336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388225AbfJJIoO (ORCPT ); Thu, 10 Oct 2019 04:44:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2AEC0218AC; Thu, 10 Oct 2019 08:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697053; bh=ttfL22i8VOJxOo90cM3zwNu7cL+4VRkRFVC1uGUgjM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jHfdPqfi58tG63I6BsYI6bV9pmRqBH12GxbBcmNeaO3kpIFCh5UrcD2huSl+3AVbd AByTSUKEg5pLZwdYwqkVa3Rk5C8LOgIAOXzUcAb93+rws38EvGHeBa71qY+zReYA5k +nfZx777XRSYi3mNBYvyEN6YcpyxlAEvDYST5FHM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Vasut , Andrew Lunn , "David S. Miller" , Florian Fainelli , George McCollister , Tristram Ha , Vivien Didelot , Woojung Huh , Sasha Levin Subject: [PATCH 5.3 130/148] net: dsa: microchip: Always set regmap stride to 1 Date: Thu, 10 Oct 2019 10:36:31 +0200 Message-Id: <20191010083620.254162893@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Vasut [ Upstream commit a3aa6e65beebf3780026753ebf39db19f4c92990 ] The regmap stride is set to 1 for regmap describing 8bit registers already. However, for 16/32/64bit registers, the stride is 2/4/8 respectively. This is not correct, as the switch protocol supports unaligned register reads and writes and the KSZ87xx even uses such unaligned register accesses to read e.g. MIB counter. This patch fixes MIB counter access on KSZ87xx. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: David S. Miller Cc: Florian Fainelli Cc: George McCollister Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Fixes: 46558d601cb6 ("net: dsa: microchip: Initial SPI regmap support") Fixes: 255b59ad0db2 ("net: dsa: microchip: Factor out regmap config generation into common header") Reviewed-by: George McCollister Tested-by: George McCollister Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/microchip/ksz_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 72ec250b95408..823f544add0a3 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -130,7 +130,7 @@ static inline void ksz_pwrite32(struct ksz_device *dev, int port, int offset, { \ .name = #width, \ .val_bits = (width), \ - .reg_stride = (width) / 8, \ + .reg_stride = 1, \ .reg_bits = (regbits) + (regalign), \ .pad_bits = (regpad), \ .max_register = BIT(regbits) - 1, \ -- 2.20.1