Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2327019rwb; Sun, 4 Sep 2022 13:26:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR5AO5KPexcWp6vVnZ3FUO9NA+VuP8EHWlU3XZkOBE0YZEtyFQnv6J5YCNbgiILpqHbVpmEW X-Received: by 2002:a50:9e84:0:b0:44d:fb0c:fd6a with SMTP id a4-20020a509e84000000b0044dfb0cfd6amr4890168edf.261.1662323219408; Sun, 04 Sep 2022 13:26:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662323219; cv=none; d=google.com; s=arc-20160816; b=A4nKvfBLR1FuVsGMR1CKRKluQCJUjna8JTZ5HU8w0MyJBE6H/VG6E8dQIoi4xyh9Oy IgcfZklo2gewSumlLTkVRgvGpal1EG/ZX3PtP4ZvRKJ/QTwdrNzp3gQrBJ0o6DCzY/dz aB/2p+PiCaqRLX1vkfFuoh5cA1PvKcNUEUZdM3Gqu58Vm0guXxUiur0x8OyPmR2R07VF dKpNPiigobXPC+yYmbaYqTyAwU5f4r9exI3mnH43XS14MPcus862MQqzW7JtKiYHfuwt 2RF35NOLOazv16fvq6m2UHMLksgazcHPFVk85t2DGpE9BD4aSlIYsfa9NAbz2utKGWcc qqsg== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=jWamZ/9gypabYLUYbJwb8JKBbQpwEuFrn8NJCAVScWg=; b=alc4sdrle/E78rDBh/71X3NE60evfwDFthDhKHNT8im3Z8Ygo1N6CwPzP6PjUcEvQF MRZdoTU5IDV4CgpTORQn3uYj+Gr7RqOez7DyfVg+TvwsfNvyLV8RZpyAXFChWzA09+8j 0nZkJdC9+suOkiaw/dtxBld8aSbiSM4Ih2cg3GLC9LJbH6iZibUWItI/CXu1uLs85QjG AYWAqpFXCdoqrT9Lwk5/9KLhw/p9dsm5m7TLyt1BVW/ojfG4HUnKKBSWB74Up/u+aEWj +sC1m6GIHCLQOXD8i/wYSUrElPwqML0GRUreKfyJXQzM86kp8vuEfAcgMoL2/r1+4gp5 CAKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@schinagl.nl header.s=7of9 header.b=hs+TzS6k; dkim=pass header.i=@schinagl.nl header.s=7of9 header.b=mIg9xaTq; 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=REJECT dis=NONE) header.from=schinagl.nl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he31-20020a1709073d9f00b0073c12a7e89csi8487055ejc.563.2022.09.04.13.26.32; Sun, 04 Sep 2022 13:26:59 -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=@schinagl.nl header.s=7of9 header.b=hs+TzS6k; dkim=pass header.i=@schinagl.nl header.s=7of9 header.b=mIg9xaTq; 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=REJECT dis=NONE) header.from=schinagl.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234955AbiIDT7g (ORCPT + 99 others); Sun, 4 Sep 2022 15:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbiIDT7d (ORCPT ); Sun, 4 Sep 2022 15:59:33 -0400 Received: from 7of9.schinagl.nl (7of9.connected.by.freedominter.net [185.238.129.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DDE4B7D3 for ; Sun, 4 Sep 2022 12:59:29 -0700 (PDT) Received: from localhost (7of9.are-b.org [127.0.0.1]) by 7of9.schinagl.nl (Postfix) with ESMTP id AF740186CE17; Sun, 4 Sep 2022 21:59:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=schinagl.nl; s=7of9; t=1662321566; bh=iwMZ7uzxvYMKIoxrcd+Q6G1OEy+h53dtjR3hmBS2kP8=; h=From:To:Cc:Subject:Date; b=hs+TzS6knz+ZfzCEDOuHCpgkscEHGi10Kh79UdvWwytCNBrH3YgTrEluWwppJ4HHP hibfUHQKfFn9DhxIsLlB5nxpP2igMhXxxiIN/WUQhNA6MRTld/3mhUlY1U4j0ffTG9 uIRbde9nGwGyJwWZyn+36B9MXJm6q4dxYU3omcq4= X-Virus-Scanned: amavisd-new at schinagl.nl Received: from 7of9.schinagl.nl ([127.0.0.1]) by localhost (7of9.schinagl.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iO484-TzXJdC; Sun, 4 Sep 2022 21:59:25 +0200 (CEST) Received: from valexia.are-b.org (unknown [10.2.11.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by 7of9.schinagl.nl (Postfix) with ESMTPSA id 55B23186CE12; Sun, 4 Sep 2022 21:59:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=schinagl.nl; s=7of9; t=1662321565; bh=iwMZ7uzxvYMKIoxrcd+Q6G1OEy+h53dtjR3hmBS2kP8=; h=From:To:Cc:Subject:Date; b=mIg9xaTq9XCocTN5xuqITIOnLJB6JWD+1YQVmgjQgIGRYiRYqvR+yzWR8YRGujp/A fz/b2LvW+3NCMP6thJs3A1XqfdZY6Y9K7ADUutvEWPoxlvVTfKX8uB+P8ZGQPWwLXT LnoN0au0gOJpT7A7cgSQeRl/cv+tHa5KsppKLdy8= From: Olliver Schinagl To: linux-kernel@vger.kernel.org Cc: Olliver Schinagl , Matt Wagantall , Thierry Reding , Andrew Morton , Robert Elliott , Arnd Bergmann , Will Deacon , Olliver Schinagl Subject: [PATCH] iopoll: Introduce ioreadX_poll_timeout[_atomic] Date: Sun, 4 Sep 2022 21:59:20 +0200 Message-Id: <20220904195920.1763240-1-oliver@schinagl.nl> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 While the readX_poll_timeout[_atomic] macro's are great, we are actually encouraged to use ioreadX where possible (LDDv3 C9) [0]. This patch introduces macro's for our ioreadX friends. [0]: https://www.oreilly.com/library/view/linux-device-drivers/0596005903/ch09.html Signed-off-by: Olliver Schinagl --- include/linux/iopoll.h | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index 2c8860e406bd..0e1dbd8057f4 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -188,4 +188,76 @@ #define readq_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ readx_poll_timeout_atomic(readq_relaxed, addr, val, cond, delay_us, timeout_us) +#define ioread8_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread8, addr, val, cond, delay_us, timeout_us) + +#define ioread8be_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread8be, addr, val, cond, delay_us, timeout_us) + +#define ioread8_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread8_rep, addr, val, cond, delay_us, timeout_us) + +#define ioread8_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread8, addr, val, cond, delay_us, timeout_us) + +#define ioread8be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread8be, addr, val, cond, delay_us, timeout_us) + +#define ioread8_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread8_rep, addr, val, cond, delay_us, timeout_us) + +#define ioread16_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread16, addr, val, cond, delay_us, timeout_us) + +#define ioread16be_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread16be, addr, val, cond, delay_us, timeout_us) + +#define ioread16_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread16_rep, addr, val, cond, delay_us, timeout_us) + +#define ioread16_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread16, addr, val, cond, delay_us, timeout_us) + +#define ioread16_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread16_rep, addr, val, cond, delay_us, timeout_us) + +#define ioread16be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread16be, addr, val, cond, delay_us, timeout_us) + +#define ioread32_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread32, addr, val, cond, delay_us, timeout_us) + +#define ioread32be_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread32be, addr, val, cond, delay_us, timeout_us) + +#define ioread32_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread32_rep, addr, val, cond, delay_us, timeout_us) + +#define ioread32_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread32, addr, val, cond, delay_us, timeout_us) + +#define ioread32be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread32be, addr, val, cond, delay_us, timeout_us) + +#define ioread32_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread32_rep, addr, val, cond, delay_us, timeout_us) + +#define ioread64_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread64, addr, val, cond, delay_us, timeout_us) + +#define ioread64be_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioreab64be, addr, val, cond, delay_us, timeout_us) + +#define ioread64_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout(ioread64_rep, addr, val, cond, delay_us, timeout_us) + +#define ioread64_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread64, addr, val, cond, delay_us, timeout_us) + +#define ioread64be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioreab64be, addr, val, cond, delay_us, timeout_us) + +#define ioread64_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ + readx_poll_timeout_atomic(ioread64_rep, addr, val, cond, delay_us, timeout_us) + #endif /* _LINUX_IOPOLL_H */ -- 2.37.2