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 599F9EB64D9 for ; Mon, 10 Jul 2023 14:01:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4B41C865D7; Mon, 10 Jul 2023 16:01:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="t7EZRaEK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C47A08466A; Mon, 10 Jul 2023 16:01:12 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 92821865D7 for ; Mon, 10 Jul 2023 16:01:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B250960FE3; Mon, 10 Jul 2023 14:01:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 025CAC433C7; Mon, 10 Jul 2023 14:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688997668; bh=BftRvE8dnUXljbMHYYAT2GgQBOk91DEske0uH5m47IA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t7EZRaEKL5eb0bW9CedVS8+xMdz1q0YWy5ih1VLphoreRqIOXHsARKgtVzhdXvrLH O/KMyD4xJjG6c4zX5IxrkFCZy4QDYwhm5EglLiMyKxUA/OeaelBa5JdJ9I5jSnFdvN /Ct6C5asoi89sDUjUZkWnPkgFQ/N+XkJ9NHbLLU8vJpid00e1ba7Ag+Us2B9oeBtFq jgvvXhEK6/QBa84yY0S+S4Sfeq6nHe5Hhnv17urLHVqrjHjisuuiMh1aOvh3XCX4e9 /j3NVW9CS5+kQXdApaDOEeoKBwWhoAHZBQGb5eUHNTwCgqMiEcOOPn0QeuLOEGDbyp C4614rG/TYtOw== Received: by pali.im (Postfix) id BE2A97AB; Mon, 10 Jul 2023 16:01:04 +0200 (CEST) Date: Mon, 10 Jul 2023 16:01:04 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Simon Glass Cc: U-Boot Mailing List Subject: Re: [PATCH 2/6] nokia_rx51: Correct tstc() implementation Message-ID: <20230710140104.ubx35dxnzmrqbth2@pali> References: <20230617104956.1402370-1-sjg@chromium.org> <20230617104956.1402370-3-sjg@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230617104956.1402370-3-sjg@chromium.org> User-Agent: NeoMutt/20180716 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.8 at phobos.denx.de X-Virus-Status: Clean On Saturday 17 June 2023 11:49:49 Simon Glass wrote: > This returns false even when there are keys in the buffer. This is not truth. After scanning HW buffer it returns the correct information if some key is in SW buffer, even when function did not read anything from HW buffer. So, NAK. > Fix it. > > Signed-off-by: Simon Glass > --- > > board/nokia/rx51/rx51.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c > index 238b9637badd..138f5a811eb6 100644 > --- a/board/nokia/rx51/rx51.c > +++ b/board/nokia/rx51/rx51.c > @@ -668,6 +668,9 @@ static int rx51_kp_tstc(struct udevice *dev) > u8 intr; > u8 mods; > > + if ((KEYBUF_SIZE + keybuf_tail - keybuf_head) % KEYBUF_SIZE) > + return 1; > + > /* localy lock twl4030 i2c bus */ > if (test_and_set_bit(0, &twl_i2c_lock)) > return 0; > -- > 2.41.0.162.gfafddb0af9-goog >