Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2207529ybl; Thu, 9 Jan 2020 08:39:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzmYbKtH2kqT9VaUhmIGkROCDt/I1eFin4tekjCRrE7Z30+qUZI/gYlJFjAUIPnj4dgIhn3 X-Received: by 2002:a54:4595:: with SMTP id z21mr3854118oib.136.1578587959470; Thu, 09 Jan 2020 08:39:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578587959; cv=none; d=google.com; s=arc-20160816; b=kAvNP1NNakx44ZuQEPI1SdnxAcBHuNF/QcnQP+INVzqUWEFmwQxjsHgZnLSQ67Z2eE 1TSIUUe6+QNzu27Y4LWhuywdaSfY42LE7q4TOGBa1JVpI6sELSVYVFThYYxnhSthK57a cnRdSqI42HbhVhcYxDIB4v3GOw1QgDyfHdIGyqGF8rull21eyVJPPGxqBVyYFkwO+W5j uJ41/ZcHseKd1o3ppO6jsFMmYWC6O1zuc4t7Vq1BMDVqq28c38T7hNascQrvmec9wg/S ixcq38FEipr3/AZU6gVQ9nzmO/vHXJLmyykHOgHK0QApzqyskSb1AF0FKW/p9zV+QkLa HwIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=vUi7NLIocyRS0PK7xQpa9ihsunHfDM+yNh2KLJqObqI=; b=k4RuYBfa0xYeiFKoCv8RtsKi2wGh16Zla6u2lS3762A8YGFnwTGFPJxV8Se6G46M0b 7cKlYOhYgAa3rq4ScjZ9Fo86hjcOyosR2pFVoMJcTxCGzOpL0o+RDYw+ym3bLufVeY70 5QR9b+VvoifW3Yg7wGHDmGm78AUO6mpje3oaFSdV+saUWMG9GHGRk+cWpn7f4x0PU7KB uA85nok631HAhdjwKJ1Pg57dMcMbhOK6nyVAiVudfCQeXnKwoAbIL4UNlD3dR2j3c3h+ 57G+fW0s3MZ3J9/rekaF4ewE0nYb93L8bzwgel5Nzj8giwNg6f4dLqOqiu/xc8pYILNo jxYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nDwhVNeP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id g26si4362310otj.32.2020.01.09.08.39.07; Thu, 09 Jan 2020 08:39:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nDwhVNeP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1731315AbgAIN55 (ORCPT + 99 others); Thu, 9 Jan 2020 08:57:57 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:32776 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730710AbgAIN55 (ORCPT ); Thu, 9 Jan 2020 08:57:57 -0500 Received: by mail-lj1-f196.google.com with SMTP id y6so7391180lji.0; Thu, 09 Jan 2020 05:57:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vUi7NLIocyRS0PK7xQpa9ihsunHfDM+yNh2KLJqObqI=; b=nDwhVNeP3UOSw+2v0nu7GGg4CgMANqRgm6uiVpxHe4YFpSL/D3u/953I1H3RPvqWFo 50x3r+OnyLiqAjJ5UVqdgMckc5qZiEOKt2EXCYUgLbNWIuJ3TEtyxizHaW07msb0GNkv kU4JRew7hMG4sC1YcM+dfAgSpoRKe0FnA8/4uiDS5mJ0bSspJ6GLbl4/HRMmCkn7NCg0 pvZQxvJkLgSVqM+R3gTh7NX41xxe8Gj1kSdwgw+3b9LzOe4XHfOTDKckv8/jJAmZebh8 fHNLMsQp+cW/OBbwyn+5AHfkzSTng//2yA9MawCrhAQ8jtLUswy3O9mJE6jZspGfJX// TEZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vUi7NLIocyRS0PK7xQpa9ihsunHfDM+yNh2KLJqObqI=; b=bsdME4YxQj6uP6XH+21wxnP7BjoKzGp5jc44oHPU3s4EXslw6SpmEbE37QxV2BLEQS Vw3P0LNBVT7jTCKPifBW5vlEtmeHc/NrcXQl7pqMLWh9oNPuAhbLi5X6Hki5iMUiEuY8 jdlNOhbX16pU1WWva314KTrP8ibN8WGrYzHfLKY1iGxe1F+I30ZOZv4qzN9CSajupuUe 03eCoerboWHL+pMdFNxek607W5BHza3In9O+BfRrQDd6vtllSGC+rAo2AFTGhOILj9uL xygW59livIjUIDCVeZtlLwH52x7gqQ1uOffLKeAIp+mqFTpBJjmlQVRDutsbTDgClYXH 6CfQ== X-Gm-Message-State: APjAAAVVuUeIl2EpH205FvqHK0P31xhTHQiFLZlE5i39oFwaSVbgubhz gYIDUhru7PgJ40sPj7VLRevk5Irp X-Received: by 2002:a2e:8916:: with SMTP id d22mr6713631lji.19.1578578275109; Thu, 09 Jan 2020 05:57:55 -0800 (PST) Received: from [192.168.2.145] (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.googlemail.com with ESMTPSA id m189sm3148058lfd.92.2020.01.09.05.57.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jan 2020 05:57:54 -0800 (PST) Subject: Re: [PATCH v3] regmap: add iopoll-like atomic polling macro To: Sameer Pujar , broonie@kernel.org Cc: jonathanh@nvidia.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org References: <1578546590-24737-1-git-send-email-spujar@nvidia.com> From: Dmitry Osipenko Message-ID: Date: Thu, 9 Jan 2020 16:57:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 09.01.2020 10:24, Sameer Pujar пишет: > > On 1/9/2020 11:30 AM, Dmitry Osipenko wrote: >> External email: Use caution opening links or attachments >> >> >> 09.01.2020 08:09, Sameer Pujar пишет: >>> This patch adds a macro 'regmap_read_poll_timeout_atomic' that works >>> similar to 'readx_poll_timeout_atomic' defined in linux/iopoll.h; This >>> is atomic version of already available 'regmap_read_poll_timeout' macro. >>> >>> It should be noted that above atomic macro cannot be used by all >>> regmaps. >>> If the regmap is set up for atomic use (flat or no cache and MMIO) then >>> only it can use. >>> >>> Signed-off-by: Sameer Pujar >>> --- >> Could you please explain what is the targeted use-case here? > > I was trying to use regmap_read_poll_timeout() to poll for status change > of a register. This resulted in "BUG: scheduling while atomic". The > callback function, in which I was trying to use the macro, runs in > atomic context. Hence new atomic macro is added. I was checking ALSA > playback/capture and trigger() callback had to monitor some register > status. > > In general, the new macro can be used in atomic callbacks where regmap > interface is used and polling is required. > You should send a full patchset because it may turn out that the patch which makes use of the new feature isn't correct or maybe the new feature isn't really needed. If there was a previous discussion about the need for this change, then you should provide a link to that discussion. Please note that usually changes without a real use-case in kernel are not getting picked up or they are getting removed later on if nobody makes use of them, so I assume this is a kind of an RFC patch for now.