From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 30B3FC10F14 for ; Thu, 10 Oct 2019 08:59:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A63D21920 for ; Thu, 10 Oct 2019 08:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697973; bh=ttfL22i8VOJxOo90cM3zwNu7cL+4VRkRFVC1uGUgjM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=D2C9oySgqVLWl/pOn14bbhAiKAwFhOgXEQs3C+svDIn1jDkkXnVn9UZ+WRk+SRO5v uES6WiD7vZQ4iFlsctEX19UMNudrrVP13rRiknjjlG7ut53mHAo+Ht0t5c998Z4Obe Lc/F/9E8fGrnzCEdSg5dcVcHsc1n162z3fCM9yUQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388894AbfJJIoO (ORCPT ); Thu, 10 Oct 2019 04:44:14 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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