Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2364274pxb; Sun, 24 Apr 2022 12:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtPR8ZQfFgFNYtMRjpHnyDqYVdOGBT19uOIvhR7B24nFuZbnYnZYMmle1QTPL78yqbx9Ie X-Received: by 2002:a17:907:9490:b0:6f0:26f3:5bcb with SMTP id dm16-20020a170907949000b006f026f35bcbmr13057919ejc.12.1650828244988; Sun, 24 Apr 2022 12:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650828244; cv=none; d=google.com; s=arc-20160816; b=QKCFHtr0PSexSEMJ297AklAD3cArKs1JF941tlhOyXnj/SaziS1Wmud8DvQqlNW6GT eSgoRKTCVaas/c7AqhEQQsuXFuKbOp3XRA4R6N63qxMzDixE9rb+z55OImARQwrhKeR6 v55vILmQ1USLEBO17TL+2Eusvo7NMyEGqudtiR7r8g+tOHFQJawjBqysZOA37Ko17Eb7 s5EwdansGVfas+SioKM70v+xtid+/PHvfHT9xu9n3mm8j0N48kR1RkHzup4XIAk23D78 OtxUjN2WYSkIkB/kKFot9WUCUz52tKvd32O1iWTxBRjrTdOFyO9cE50oCqulDl3T1WX2 E8IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding:subject :cc:to:from:message-id:date:dkim-signature; bh=DPNto3RCybjogKfr456o+QEcokurj06jetoOd1VBs74=; b=uUav71GnvkucfGCcJ/BSsLCKX0ks+x/zsKDREqXe/8X9Y0DilRW3UQXyCIE1xQVBGQ yS6/aP6tDL7kMN+QZ6dvKVG0j9TZrNWtwKWlzu35WRCGF8dRk/RLDz4XPkVdRbjOftHR Tl/OgNtNX5Tj5eg/jSylifxCiSfUqpI9lEvDJU6KePNC6CKlnL9SCkpBOYBXzMCFxqHK JM/cvSTC4+t1zB80T/bJrxQTd0pJaCaGlYMLVHqzrQuCldrDWfCN8xPDysG3T7ih0Y8E 7kpQ3IcSNiBWbu4yj9pkbI5w/4zQ1Or8PEB0yeqzKLEnJrrrq7HFvvMc5Nfs3iKY7/Oa CYmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nathanrossi.com header.s=google header.b=Kb28HEvQ; 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=nathanrossi.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a170906538600b006f000860e56si9934593ejo.93.2022.04.24.12.23.34; Sun, 24 Apr 2022 12:24: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=@nathanrossi.com header.s=google header.b=Kb28HEvQ; 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=nathanrossi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232616AbiDXPjf (ORCPT + 99 others); Sun, 24 Apr 2022 11:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240742AbiDXPfB (ORCPT ); Sun, 24 Apr 2022 11:35:01 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 750C2171C03 for ; Sun, 24 Apr 2022 08:32:00 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id n18so21713184plg.5 for ; Sun, 24 Apr 2022 08:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; h=date:message-id:from:to:cc:subject:content-transfer-encoding :mime-version; bh=DPNto3RCybjogKfr456o+QEcokurj06jetoOd1VBs74=; b=Kb28HEvQESzMvIBoLcX56XxVgEM+RnJHXrpj37528afTgp5M3XHE4/G5VHSKlDTP1a SYUo447iH71nX8OvnfTf28m2Hielc6+e3XygAR4dUxK3AThrSpYR8XRn25b1cSL1znrf 1PFEQRjw1lxEWr9moRYYsItBgY69ADMrm6JN7axZ2Tdp4degAxJGGA6G39LBVcGcLvqW Ul+ZiA6guY7o7v13drb7yIuaZEOzpPbgc2y8aQDe+17KuEwzEUztgzKhLUPl1hT95BUw vNEymW4QNodpWQnSrx6tEFi9ZvWwmD4quTO3Y0TgngJPWWSdMIPCDxJrl2htOzyZMxZf 03zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:from:to:cc:subject :content-transfer-encoding:mime-version; bh=DPNto3RCybjogKfr456o+QEcokurj06jetoOd1VBs74=; b=kInSK4ptLUeUmbOlL0ZA+xSGcfYS49vwqBRFkR0P/VTDZXo0vv1JI+fF/3kyK0rQbN sIdFK54MSfz/Nm9yrcKoMg2QLutEfL31dwus7Iu188uMl0M3A37+S/o41AKnk/k0tB/Q rKIkH0VR6tqvB+Kt6iP5j5RTOCFD/is3FL4pvNw9wPlnimoiaHvBYK+/aJfLZFuOvATf fSuKF8tF60yG6zmbBtj98yEuZBNApArLTZcElxEt1Qv44wsSkhtGzh3q/0bJ1h+pQGfM 3v8Zm19UpqAailMw8OkbKlkdTcg2iDtMr4CTFiMXkRcHWmv1SRuBESGbXBxmg8luLJwH LQ1w== X-Gm-Message-State: AOAM530m5zZMjdNm0njt69J01YZ8bfLv8Q8XQqrwDQ/CsD5yvw/jXtce eqN7cCEqRkmx3+b5ucSoDSddyw== X-Received: by 2002:a17:90a:db45:b0:1d9:29d0:4c6e with SMTP id u5-20020a17090adb4500b001d929d04c6emr9037581pjx.46.1650814320015; Sun, 24 Apr 2022 08:32:00 -0700 (PDT) Received: from [127.0.1.1] (117-20-68-98.751444.bne.nbn.aussiebb.net. [117.20.68.98]) by smtp.gmail.com with UTF8SMTPSA id u25-20020aa78399000000b00505f75651e7sm8374307pfm.158.2022.04.24.08.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 08:31:59 -0700 (PDT) Date: Sun, 24 Apr 2022 15:31:43 +0000 Message-Id: <20220424153143.323338-1-nathan@nathanrossi.com> From: Nathan Rossi To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nathan Rossi , Marek Behun , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Paolo Abeni Subject: [PATCH v2] net: dsa: mv88e6xxx: Fix port_hidden_wait to account for port_base_addr Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 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: ea89098ef9a5 ("net: dsa: mv88x6xxx: mv88e6390 errata") Signed-off-by: Nathan Rossi --- Changes in v2: - Add fixes --- 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 b49d05f0e1..7a9f9ff6de 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.2