Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1699139iob; Thu, 5 May 2022 06:44:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyb2FS3bDJyKODViosIKNXBU/pNTKhj367AIidDYPFNmEhqSZ/ff868HDt1cENcqY7wLI8 X-Received: by 2002:a05:6402:4392:b0:427:da50:d833 with SMTP id o18-20020a056402439200b00427da50d833mr17859376edc.97.1651758244729; Thu, 05 May 2022 06:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651758244; cv=none; d=google.com; s=arc-20160816; b=HO7IaJBP1tOrn/hap+UxmLlWsQXXa7P6ZOO7LtjdfV/3HDCjIQBwJo5VnF3Hy8pal1 QeuwbuQ65fEIZ8Y3wgHBdnZ9FS068gOrmEBGleAAjYN5OMm50mvPUTlii5deE8N30bBu kOffBCLa/tQxV+C+2ce13yK7Q06bbz5oUHtZNQ9q0IWxAR6gqCZecr260/6RojVE5lva gM/Ovu4IMWtTNc81nw1waPU4N3ZyxiLRSFQnd/NbEva8S3yxACHDZnILmlWNPExuMLPn euU4smYCrg8defgzViuAAN1TcFwW6YTcKuY/hDbJaf8BDKsZUjbcB2OyXdY+Zd08ZcSF J2GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1Q9s+SU3q6QXs1PUse9qA54NPb22cj+GlwEIxCYIft4=; b=f7k3cGiouHPz0DCD5mgo0WcLGPaUKZc32fn8167q8ovSyiKYh0vp8IAQgmOCVWvxr8 nEwAys4lfbd2Cn0FhmuZkGnduCemIa4ZLjqD27DP12FI+d4quGnlvRmQ/LIon4FXuV6Z +5vn41/SE8XxHFB0RAUAHfVJjKlOGQtBR3anaiQ4TMvMy+UTbsy8MKwE9XPSB+bgiOKI 4HRLy3RQjn9ekETh3a9ihmT5dNoj0CFdsss/aXTkgmQZtqahgO5KapBB2Njlpl1bbzaO fmjwp6Eh0B5DdyYr54cc8rDXUIhSCLRR57NY2RNBo3ELo0kiRkEIuHCQNsQKfriKJlZ1 4t2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ahujtau4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a05640240d600b00427cde38699si2509420edb.11.2022.05.05.06.43.40; Thu, 05 May 2022 06:44:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ahujtau4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357197AbiEDRT0 (ORCPT + 99 others); Wed, 4 May 2022 13:19:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356336AbiEDRFJ (ORCPT ); Wed, 4 May 2022 13:05:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F5F49CB5; Wed, 4 May 2022 09:54:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F59F61851; Wed, 4 May 2022 16:54:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67646C385A4; Wed, 4 May 2022 16:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683243; bh=6Elx0oXf8pbyDQpAEzwHlIxpEwN9MDAQQX+4yMGajzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ahujtau4eGqwY4RstcM8t2EWBKbK7Dq0UMw+El0k4bCD4vPgE1RNtSzgUqcor81bz ogIjROdaPkcGrtfIKsTjxbPkSRRCoBoQr1ATDpjjJ24vV4hf2Gsga8a5wNTCn9qrv2 ShQi1BvofGeOQP2QfSmdXg4gvDRrNCEUZCF47NIY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Rossi , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Andrew Lunn , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 108/177] net: dsa: mv88e6xxx: Fix port_hidden_wait to account for port_base_addr Date: Wed, 4 May 2022 18:45:01 +0200 Message-Id: <20220504153102.903485924@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Rossi [ Upstream commit 24cbdb910bb62b5be3865275e5682be1a7708c0f ] The other port_hidden functions rely on the port_read/port_write functions to access the hidden control port. These functions apply the offset for port_base_addr where applicable. Update port_hidden_wait to use the port_wait_bit so that port_base_addr offsets are accounted for when waiting for the busy bit to change. Without the offset the port_hidden_wait function would timeout on devices that have a non-zero port_base_addr (e.g. MV88E6141), however devices that have a zero port_base_addr would operate correctly (e.g. MV88E6390). Fixes: 609070133aff ("net: dsa: mv88e6xxx: update code operating on hidden registers") Signed-off-by: Nathan Rossi Reviewed-by: Marek BehĂșn Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220425070454.348584-1-nathan@nathanrossi.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/dsa/mv88e6xxx/port_hidden.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/port_hidden.c b/drivers/net/dsa/mv88e6xxx/port_hidden.c index b49d05f0e117..7a9f9ff6dedf 100644 --- a/drivers/net/dsa/mv88e6xxx/port_hidden.c +++ b/drivers/net/dsa/mv88e6xxx/port_hidden.c @@ -40,8 +40,9 @@ int mv88e6xxx_port_hidden_wait(struct mv88e6xxx_chip *chip) { int bit = __bf_shf(MV88E6XXX_PORT_RESERVED_1A_BUSY); - return mv88e6xxx_wait_bit(chip, MV88E6XXX_PORT_RESERVED_1A_CTRL_PORT, - MV88E6XXX_PORT_RESERVED_1A, bit, 0); + return mv88e6xxx_port_wait_bit(chip, + MV88E6XXX_PORT_RESERVED_1A_CTRL_PORT, + MV88E6XXX_PORT_RESERVED_1A, bit, 0); } int mv88e6xxx_port_hidden_read(struct mv88e6xxx_chip *chip, int block, int port, -- 2.35.1