Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp964405pxy; Thu, 22 Apr 2021 18:49:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUJCh4DJTCzfInHei77/OTIqF0WnAmgM/IR3mpEXU8vjZEsTdfVNzgbN1mxvI80FimeZNw X-Received: by 2002:a05:6402:2216:: with SMTP id cq22mr1557315edb.265.1619142558108; Thu, 22 Apr 2021 18:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619142558; cv=none; d=google.com; s=arc-20160816; b=dR6mTeGYvsI9HhdMIlbYXBTH6U0yVr8V9Uwtf5iOUo7HEcXVPzl5Eh+GtdbDF/dfaW gwz+qv5fJr2ECjlftHDoIl8mZOZ8YXC1WoiDtuO8IVuFYJL+2IXqC97HJwU10m+8FRvv JO0jkSn6BjUZ93j2H0+IVrdO0Ri0nn0+ZBMbxijPzoep35M9sXOsyvA6kJrEQGb5rDSL 26TJBmuwcEmWYwghRsJ/TJf/Nz7urWQphYnGgO/uSnADLXbgRRZHpumdRcLDt+AWl7Ho UwugAccbL3gpBN7Xn660jRvw2MfhBELEovqemP+PzhasXpRJONCyBXPHf8ceGGgislxy fX5w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CIfIzGZkRa2NlAensBq+Zlw+3TjmXuG3tgcd/3/lGKI=; b=jU2sHhWjSokZiINiaiWUiC4ZfUXM6u4uoVRwT0U8CyKKA++tetja33ZkoCIZ/tvVgb QeG1sGgtjkd4s8Dxa31kAqwmFtOXsoCf9pS0KCcOAm+3GKscY2kMFCP6/mF51DBZMWDD DI4yblrIBZHAoPbslOG2MhiejZrHrcGT7CePtQinmYOFRdkap5/F0HrgMyEcWMg1r05s nX0e1nOTGqr2zC3OtuxfiGIo4wADnzzbI9txmKjBWeif08Zybr+3n2kDR4tcNBhAaak/ 8RY3hslmUJrGBRMi6A/+VYiyGMmk//yrYN2cA/JXcZ/gc9pLZ1G6EP9Mbh5eDZRuZ799 /d+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="JlzwpJ/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si4612425edd.340.2021.04.22.18.48.54; Thu, 22 Apr 2021 18:49:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="JlzwpJ/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240151AbhDWBsc (ORCPT + 99 others); Thu, 22 Apr 2021 21:48:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235569AbhDWBsa (ORCPT ); Thu, 22 Apr 2021 21:48:30 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79961C06174A; Thu, 22 Apr 2021 18:47:54 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id mh2so50046224ejb.8; Thu, 22 Apr 2021 18:47:54 -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=CIfIzGZkRa2NlAensBq+Zlw+3TjmXuG3tgcd/3/lGKI=; b=JlzwpJ/Euj/7X4ge1iIjjqTYcQtDI/+3MVVk07wfdtsaFUA3jY7YWGwy2mVYl2Bjm3 DbiHAwpYXEYGqU95IImGCYvc0P2zkXhZea62Dqzrpkb0xdPpM/7o8aO95qv3tT0xxNiN APg1dLzLFj/mmwgFwpWr6sdvnBMnZLuRzLLExj/4BPVCB9oJW7Azh30uSPtCLNkCi9c/ M7A9DuULoLyPTtsbhNHRkRQBP3iiibweQoVnqjpWbaZRgKbd5RtjDa+9wPCzqOkVxptX NxQQCRRLI21dihb0nXfVqfwDeLnKLo1jTSKhusiHnunDTZJG7t9wvWBwTSjNaTKGGOUW RApQ== 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=CIfIzGZkRa2NlAensBq+Zlw+3TjmXuG3tgcd/3/lGKI=; b=rc26KG8yc5mDkAACRLMH3EXNPe96vPjO39I+XqKrS89M6ak4YoSf74w0EAd53zz1dk RFNThvHpnTwqozOyn2kRYmtfl3CiWQhT6qFQOmrI1YFQiYrTi13hhCJb01ULZXzixOgU H5em50Xbxm5YZnKFHGhFBlDTXS7kZbll3f/Fx8A/nC/QqqCZn9ElozMFhkdhKoNiWxCV 0VK2g91TRADY4CthR1V6EiNJQMurQP8qk1xVRl505UPaJ4B6qG+SUiyaw6rWa7j0Ud37 bLqUCFEia8cGnYS6P56sF2n3DVeqMwPuTySHR92s8QIbslcSEvNLwSpqJnwoM1LON3T5 Kzkg== X-Gm-Message-State: AOAM532a7GOzbOPFRL/FFSz1vD1+edWTqlI0kzSAPvy2GzYcZ3YItmW5 94lnRUhPuSgg8FXj3qRF5Hg= X-Received: by 2002:a17:906:138c:: with SMTP id f12mr1611358ejc.180.1619142473184; Thu, 22 Apr 2021 18:47:53 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id t4sm3408635edd.6.2021.04.22.18.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 18:47:52 -0700 (PDT) From: Ansuel Smith To: Florian Fainelli Cc: Ansuel Smith , Andrew Lunn , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/14] drivers: net: dsa: qca8k: handle error with set_page Date: Fri, 23 Apr 2021 03:47:27 +0200 Message-Id: <20210423014741.11858-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210423014741.11858-1-ansuelsmth@gmail.com> References: <20210423014741.11858-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Better handle function qca8k_set_page. The original code requires a deleay of 5us and set the current page only if the bus write has not failed. Signed-off-by: Ansuel Smith --- drivers/net/dsa/qca8k.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index cdaf9f85a2cb..a6d35b825c0e 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -133,9 +133,12 @@ qca8k_set_page(struct mii_bus *bus, u16 page) if (page == qca8k_current_page) return; - if (bus->write(bus, 0x18, 0, page) < 0) + if (bus->write(bus, 0x18, 0, page)) { dev_err_ratelimited(&bus->dev, "failed to set qca8k page\n"); + return; + } + qca8k_current_page = page; } -- 2.30.2