Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1748117pxb; Fri, 22 Oct 2021 06:59:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5aEJzFMbrYrLKggRFCGR6RbBrZNNGBn0vOmi/kN3fgqzSdvXlw4QCVtVyJG1Vajmnie/L X-Received: by 2002:a17:90a:8b01:: with SMTP id y1mr23473pjn.225.1634911165864; Fri, 22 Oct 2021 06:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634911165; cv=none; d=google.com; s=arc-20160816; b=vv6V8/VhkXB17XR1KSFZl0J7Ru4vEARH0IVhCLjnEQkUpRrrq8CzBEXxdaxsJb4Qlu vU5q27fBt9TnGUs9JwPbqduT7HmMFM0qZSa/f2HSRJ614rvXnoz6SJXSIIHzdWaAh9Pp wECw1OEX8hdEPS8qiFlatyhIDSn2oZadGjmZNsazc1wSoaUKt6bnTpDHHzGfIKP8r8xi hZWhsfvGkClcbq6HXs+l/VTF03I7Vd+KvDvU2CJ9HiTQEzNLukqjCA7BZq1IXmz8k8L0 J6EGUGvuw+/Ge5fy4NOlTXryNIDfSYpT00W2zbqTfxGuPIIhKvlFifdguOR/AAIr6oLo Pzqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=N2LgKJHjAxWATzIP8s9Chgsauqr0Jq39ANiFQNTNdvA=; b=nhjnApoJd/y3xmRWMAYyWikmpsrPOIQvsODWQfmgGTuljjflj3GiN3nsirGrqSbuFx ZcoW526cA2l8rLUQNSHTYimTTeNhLcqZf8m2zLx45e2UeJ8uK437ydLngKuMosNwHSjj DGdN1QjkngcoQAjjOv5SsHUNDA373CHRc5Wd7v3FWsKQaZ9aEjNDSS9VOa2ZeNJgUnCX hRdBgmt4FReZ92MqSkpl/Q8i7svvolMPqXa3zh43/iCZom8BLHYzf/Q9YGAyQlpgrUEY LPsT5ef2LQiNBcLGYL8s9Q3gUJivUNFL9XsjkLwMG+tbFIL8kY8WYKixIjMN1pR94CyY NeHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=atHm7dWY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ep3si15471616pjb.8.2021.10.22.06.59.12; Fri, 22 Oct 2021 06:59:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=atHm7dWY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233102AbhJVOAE (ORCPT + 99 others); Fri, 22 Oct 2021 10:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233082AbhJVN7i (ORCPT ); Fri, 22 Oct 2021 09:59:38 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FDFDC061224; Fri, 22 Oct 2021 06:57:21 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id y12so1476121eda.4; Fri, 22 Oct 2021 06:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N2LgKJHjAxWATzIP8s9Chgsauqr0Jq39ANiFQNTNdvA=; b=atHm7dWYDFc+xMMI0nEXnjBKGmTe3Mhj3j44gptKPmL3yZSmcfPhGBE64YsimpDkRj 3JNapsquzvEaRN4rlLZm/e3gAK6PuH4inkVvuQzMmWJD4Fw6FTtWQPCXkgqDCuh7EULb yNTTsoQRo9uDej/o2MZxfOP65jPJvwE94CFsaqfNuZNaXjAjM/EmrMyiG4Xju744vWFB MF6JOygy44c4b8O8vYFaLC36mbgBaHx84E22kFUgJLaYtkfz/IR1K5WkWIspkHAhxZrf ER3rtRGr7XHV0NpNgjyePT0QzWIZ2EsAHQ7higGfSHKW8azFx28d7dx9gfAmHjBCNF4f aSGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N2LgKJHjAxWATzIP8s9Chgsauqr0Jq39ANiFQNTNdvA=; b=ZMzIZWuHq8dylZDyJQL0nkdIu3LzEe9anQzZDUefznPDs6C2WvVkHUP4nUAy6gPVr9 bd/FUyxPhKdOsyRFlAJRCesh5tHbYHIQY4MbHyr3uKhMUqnnDch5lqSdtbMsPnOlKwUN N9D2jxQReN/p+84V9cGDG4Zu/99SF/lzqEfDADXPsu8nL5kOcJl5V7AaMMgwfMEG7u6t rRhoU8XxpbfAjcYbIC5A5PhTlqODCsYCawshXeanh2MMLcl0JXhFkFuKkcvx6jy/J8Kj 2yWy3Xo0qgZinWemmU1QuPhwQ6gYyjb4F0VzVliyGltML2hV69QxU105aMxGRpbqc6jR x2mg== X-Gm-Message-State: AOAM530mKf3C1OszVnLru0OzkCgv8pmJytzeOoVXspmmCk3VjNJDW/ln t4VPhm0RNaqmWC4DscYWzBQe52tnvfsMBV7hJG0= X-Received: by 2002:a17:906:2887:: with SMTP id o7mr15492300ejd.425.1634911039873; Fri, 22 Oct 2021 06:57:19 -0700 (PDT) MIME-Version: 1.0 References: <20211021174223.43310-1-kernel@esmil.dk> <20211021174223.43310-10-kernel@esmil.dk> In-Reply-To: From: Andy Shevchenko Date: Fri, 22 Oct 2021 16:56:24 +0300 Message-ID: Subject: Re: [PATCH v2 09/16] reset: starfive-jh7100: Add StarFive JH7100 reset driver To: Emil Renner Berthing Cc: linux-riscv , devicetree , linux-clk , "open list:GPIO SUBSYSTEM" , "open list:SERIAL DRIVERS" , Palmer Dabbelt , Paul Walmsley , Rob Herring , Michael Turquette , Stephen Boyd , Thomas Gleixner , Marc Zyngier , Philipp Zabel , Linus Walleij , Greg Kroah-Hartman , Daniel Lezcano , Andy Shevchenko , Jiri Slaby , Maximilian Luz , Sagar Kadam , Drew Fustini , Geert Uytterhoeven , Michael Zhu , Fu Wei , Anup Patel , Atish Patra , Matteo Croce , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 22, 2021 at 4:50 PM Emil Renner Berthing wrote: > On Fri, 22 Oct 2021 at 15:39, Andy Shevchenko wrote: > > On Fri, Oct 22, 2021 at 4:35 PM Emil Renner Berthing wrote: > > > On Fri, 22 Oct 2021 at 14:56, Andy Shevchenko wrote: > > > > On Thu, Oct 21, 2021 at 8:43 PM Emil Renner Berthing wrote: ... > > > > Can you convert this to simple > > > > > > > > if (assert) > > > > ret = readl_... > > > > else > > > > ret = readl_... > > > > > > > > below? > > > > > > I don't see how that would work. We're using the done value in in the > > > readl_poll_timeout. Maybe you can be a bit more explicit. > > > > Supply done either == mask or == ^mask. Try it. > > So you want this? > if (assert) > ret = readl_poll_timeout_atomic(reg_status, value, (value & mask) == > done, 0, 1000); > else > ret = readl_poll_timeout_atomic(reg_status, value, (value & mask) == > ^done, 0, 1000); > > The compiler might be clever enough, but I'd worry the long body of > the readl_poll_timeout_atomic macro is inline twice. Rather than just > flipping the bit in `done`. You have a point, although it would be nice to have confirmation of either. -- With Best Regards, Andy Shevchenko