Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3084367rwe; Mon, 29 Aug 2022 05:41:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR5WKrFY47Ij3yvckAMicfGumyLhyi9jrSZOxEn2pQBHNrnG+u2A3yQ+nriw+f+yWxSVw3GK X-Received: by 2002:a17:902:e844:b0:174:79c4:9449 with SMTP id t4-20020a170902e84400b0017479c49449mr9909495plg.66.1661776871223; Mon, 29 Aug 2022 05:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661776871; cv=none; d=google.com; s=arc-20160816; b=zf4w21Wc6xpQHUbJaugT9ukLiQf4P51miVQ1Vrst2S69XeItMZwxe9rXdnJE9JCGPN pCoG+Mh3IM92PGAXCiWGSesf46rVIxLbPJIeFHyv0KMaQjis7g5iPVnfw6Kvnjvulgg/ K0jeJYuaTRr3UkjKzNa9QovmMIBpqL+x9Ku6xuwf3QbKYSOxkZD7dudcookmbxNx+zlN 1ZP3XBsvHsecOaQ2m5haFBOD3Pr6u3YQN1PPQfqKddejZysIDB9baubzjalUSrmJLP3d h8p5ZGf1xll+djGcFJN6CVqlUGpdGCl1642nyRLMWBmJXsptwi8RbqTb1QPz+pCjsIxK I6Sg== 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=VIwzDmE/w9OCDWaP4oa7bWtL168xKnBKg1gFZYZJllQ=; b=jW+1RrzrETNdbCcZuKMjjy5H6gnQUyA1xT54/qdOZ34dxhyawqPRupUOuvn3Ysofl+ jCd3xrkaeuFbZqBXgQYvHmEzxYzUhoWSedy1WmOiyiZNBxcNuXn73xyZKbuOekYjxi/g Uzks36WWUK8RmZZIY/OByQTaj5zp+NgraKi/jB/UJZwKs1Pc/skUT47OjRs7d9f0mrbd OgE7Vq5qSlwvfoqLQq51ud71RfnrcYPCOBPTm08XEpUqUltb2uKTWZepCkIT7JT30Je3 A/LaMRIK5pG2qkl/JpsW2cQ5l84Ugf0ixtLZpwnlIVd0QG4I0kYYrixHICYMOdM27/Or 3vPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nTBB6ZBk; 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 w64-20020a638243000000b00429a15b4d01si4126557pgd.814.2022.08.29.05.41.00; Mon, 29 Aug 2022 05:41:11 -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=nTBB6ZBk; 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 S233036AbiH2Lqj (ORCPT + 99 others); Mon, 29 Aug 2022 07:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233020AbiH2LqO (ORCPT ); Mon, 29 Aug 2022 07:46:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D54E2786C1; Mon, 29 Aug 2022 04:29:31 -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 7B1016120A; Mon, 29 Aug 2022 11:10:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85D34C433C1; Mon, 29 Aug 2022 11:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771400; bh=MfO06DdabSfW+lcqbBBnnNJSNAzT1VCcU04W7Qi6R48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nTBB6ZBkOqS+hdNlJas2k4F+UrTNEt5Zn66r2TVaZq9MFiVPHtviv0gHIFgndeSD4 0ilFfppNILjYxBDglBDWkcvr8Wn7DnQ5K/15Pb2MCIciw8sp84RrF7DjL3chSH7DHk uK223cmIwg27wcNxJ7SKrbFu8SQwstDvFkjwMCSU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shannon Nelson , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 63/86] ionic: fix up issues with handling EAGAIN on FW cmds Date: Mon, 29 Aug 2022 12:59:29 +0200 Message-Id: <20220829105759.132113363@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105756.500128871@linuxfoundation.org> References: <20220829105756.500128871@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Shannon Nelson [ Upstream commit 0fc4dd452d6c14828eed6369155c75c0ac15bab3 ] In looping on FW update tests we occasionally see the FW_ACTIVATE_STATUS command fail while it is in its EAGAIN loop waiting for the FW activate step to finsh inside the FW. The firmware is complaining that the done bit is set when a new dev_cmd is going to be processed. Doing a clean on the cmd registers and doorbell before exiting the wait-for-done and cleaning the done bit before the sleep prevents this from occurring. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Signed-off-by: Shannon Nelson Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index e14869a2e24a5..f60ffef33e0ce 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -378,8 +378,8 @@ int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds) ionic_opcode_to_str(opcode), opcode, ionic_error_to_str(err), err); - msleep(1000); iowrite32(0, &idev->dev_cmd_regs->done); + msleep(1000); iowrite32(1, &idev->dev_cmd_regs->doorbell); goto try_again; } @@ -392,6 +392,8 @@ int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds) return ionic_error_to_errno(err); } + ionic_dev_cmd_clean(ionic); + return 0; } -- 2.35.1