From patchwork Sat Apr 25 11:03:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1276794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=fmtndGht; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 498SqJ40T0z9sRY for ; Sat, 25 Apr 2020 21:04:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 844B181CAA; Sat, 25 Apr 2020 13:04:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="fmtndGht"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 21F5C81C91; Sat, 25 Apr 2020 13:04:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) (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 F263881C75 for ; Sat, 25 Apr 2020 13:04:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pj1-x1043.google.com with SMTP id fu13so4392615pjb.5 for ; Sat, 25 Apr 2020 04:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aUlll32zfX7ITjPFpHp0Q7B45yE/EkgzuSyxmyuDIG4=; b=fmtndGht98VRcHXWfF7QCXr8TOI6odhZW0oC7i08FSJt2dqYWAbD+9uBPaTKmAWQJ1 B6PPyoqFXlaxP58ix+lIIHVTxLiknpqdTcrLNtCdiUoEPLk8vp9N1E7fdGe3eAqFaIfM /vB3WJCNbg/kSCp114wdfWcdkHBKi3hKo70f0= 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; bh=aUlll32zfX7ITjPFpHp0Q7B45yE/EkgzuSyxmyuDIG4=; b=Sny4yZA2fB5vUVGWVujGRDEN0NtGuvNj7rL5Uh83HazqMjm02RiihJ+qcoRMg5oHEL eeEKN7+uJUnQaqZHBenpTlJpWcQ/sSa7aROSxMTvGAgcedjSqoJov1c055VULr/YnNSk ezVx2hh9jw1FWh7xBM4yNOUYBlFJpFVIx1YORwUt1MxFqMGbTXQBb2YesWzCbFHtxSxT nJl3YjEJuMLkbno2vOm9/4rvsc3l7MPpvWvLqh9vijWdYj6l5cnSzt3fNpQImBbufFIr WF+adplzarjItp/R+Bpl+8oQ5/KTChoYkmfTG57T1JPALU05bitS25dLMqT/SivObDkl yipg== X-Gm-Message-State: AGi0PuZc3aHu7nRkCHyonOX5tixZGcdApeEgbHXnfxSIH5i+0lr3+QLz rm7Hi5vuHYz/ejCSGBLzOlYNow== X-Google-Smtp-Source: APiQypK51i0FDxqCDDImRWZd6WKpeuk4qW8Un2LudQff+b/SR5//SIA1eFSEHxYIRnXdROiUXpP5qQ== X-Received: by 2002:a17:902:347:: with SMTP id 65mr13880569pld.21.1587812655032; Sat, 25 Apr 2020 04:04:15 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:1d46:fa69:c34:93dc]) by smtp.gmail.com with ESMTPSA id v94sm6922831pjb.39.2020.04.25.04.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Apr 2020 04:04:14 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: patrick@blueri.se, sunil@amarulasolutions.com, u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , Tom Rini Subject: [PATCH 2/8] iopoll: Add readl_poll_sleep_timeout Date: Sat, 25 Apr 2020 16:33:48 +0530 Message-Id: <20200425110354.12381-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200425110354.12381-1-jagan@amarulasolutions.com> References: <20200425110354.12381-1-jagan@amarulasolutions.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Add readl poll API with sleep and timeout support. Cc: Tom Rini Signed-off-by: Jagan Teki --- include/linux/iopoll.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index 0bbd757939..e087f23271 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -42,6 +42,9 @@ (cond) ? 0 : -ETIMEDOUT; \ }) +#define readl_poll_sleep_timeout(addr, val, cond, sleep_us, timeout_us) \ + readx_poll_timeout(readl, addr, val, cond, sleep_us, timeout_us) + #define readb_poll_timeout(addr, val, cond, timeout_us) \ readx_poll_timeout(readb, addr, val, cond, false, timeout_us)