Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32750C433F5 for ; Tue, 11 Jan 2022 18:06:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 90DD583106; Tue, 11 Jan 2022 19:06:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=fastree3d.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=fastree3d-com.20210112.gappssmtp.com header.i=@fastree3d-com.20210112.gappssmtp.com header.b="ECg8XylK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 40C6681E3E; Tue, 11 Jan 2022 19:06:04 +0100 (CET) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE03E83081 for ; Tue, 11 Jan 2022 19:06:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=fastree3d.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=adrian.fiergolski@fastree3d.com Received: by mail-lf1-x12a.google.com with SMTP id k21so59353695lfu.0 for ; Tue, 11 Jan 2022 10:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastree3d-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wc2eViU9KREa8dcwmQ+tjQRO7cOmbqJddGKLUACRZN0=; b=ECg8XylKCn4IZcls3pPXlAt6dmgVe3wY3GZWZKShkRbfROgeztAH/6Y7an6bmXxzYd m2HoTq3uyK/+/9aUxULCuT6KHgSPNAXQscVZL0jPOcJV8AqbJT2J/apNttGdMdzWc5kS TWn228bizYIZ8Ptbdf3CZaSes4OOf4wx6FI541JEdvPmqCaikfFYBpwuGdDCGhIEhsL+ hFG6TNLs5kax3+BRzJQjD+dbEWrKSg6z+a6z5f/pQehimf6Bw03FUcjJhU+1hib3PIQR hJPrNkTxWaJHv3DNmpIHQ5KYQDDMtRfdZc3t/j+C5hyAybaNO5Ah+aShOGSiuUxFdt2D xHew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wc2eViU9KREa8dcwmQ+tjQRO7cOmbqJddGKLUACRZN0=; b=I1tdipub5SL4y1p9wUjVwQbRH0/6u6+rq6iiLTZ9wXDGGTigl+HJSdooHV1Q4gHH6c GmRYoJnO6dbWsEKgF6LvSXDi3xS9M0iJWics1qCDXFL5fFDVXo/rFi/O0Ok30pC8Fz4R nT0wGxnEmWZzl3gowYet/ClcUfhjcNfpzt7KfE3BRV9KWoZm2JwA1zE7UZhD81lp/YDL vtG0RSA6tFXsje0TLARVgRmZDC3DPc2lmeLWwyWZGAoOirUmIvaoNjL1/x4J8xuPmB+m is7GsUmOvvfl4/Z33oiA4Ll/Ozl0GymyY0b/ieYZqIcK7kw88ey0zTqPxnj6DXHfwkNs 3usw== X-Gm-Message-State: AOAM531DUUXj7OV0GmbNDvJYGrfUhYa8Dn4RkcRFGmoqZ9lf+LkhpiZX AZnP1oVfdJLmp5oBp43+CGNHhBxLMIFQ X-Google-Smtp-Source: ABdhPJyqe+OLG2MSgbHVgY/4ko+V7OngHcWlPCp/yFVeTUkKWPwgyIlBTihebf9p7xV+Rky5ZUFQ/A== X-Received: by 2002:a2e:a230:: with SMTP id i16mr3623260ljm.80.1641924360076; Tue, 11 Jan 2022 10:06:00 -0800 (PST) Received: from adrian-laptop.home (83.5.239.21.ipv4.supernova.orange.pl. [83.5.239.21]) by smtp.gmail.com with ESMTPSA id w7sm1406820lfd.36.2022.01.11.10.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 10:05:59 -0800 (PST) From: Adrian Fiergolski To: u-boot@lists.denx.de Cc: marek.behun@nic.cz, tmshlvck@gmail.com, jbd@cryptotronix.com, Adrian Fiergolski Subject: [PATCH v2 2/3] misc: atsha204a: add delay after sending the message Date: Tue, 11 Jan 2022 19:05:30 +0100 Message-Id: <20220111180531.168596-3-adrian.fiergolski@fastree3d.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220111180531.168596-1-adrian.fiergolski@fastree3d.com> References: <20220111180531.168596-1-adrian.fiergolski@fastree3d.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Once request is sent, and before receiving a response, the delay is required. This patch fixes missing delay for before first response try. Signed-off-by: Adrian Fiergolski --- drivers/misc/atsha204a-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/atsha204a-i2c.c b/drivers/misc/atsha204a-i2c.c index 9d069fb33c..d264477927 100644 --- a/drivers/misc/atsha204a-i2c.c +++ b/drivers/misc/atsha204a-i2c.c @@ -280,6 +280,7 @@ static int atsha204a_transaction(struct udevice *dev, struct atsha204a_req *req, } do { + udelay(ATSHA204A_EXECTIME); res = atsha204a_recv_resp(dev, resp); if (!res || res == -EMSGSIZE || res == -EBADMSG) break; @@ -287,7 +288,6 @@ static int atsha204a_transaction(struct udevice *dev, struct atsha204a_req *req, debug("ATSHA204A transaction polling for response " "(timeout = %d)\n", timeout); - udelay(ATSHA204A_EXECTIME); timeout -= ATSHA204A_EXECTIME; } while (timeout > 0); -- 2.34.1