Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1209037ybl; Fri, 10 Jan 2020 14:09:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxngzvhHZUZTShsQv1q/NlyBC+xxjo8c91+aZyk/MbPSww8XVeRvjrnR27k+Ss8Cve0E0gv X-Received: by 2002:a9d:67ce:: with SMTP id c14mr4315550otn.106.1578694153001; Fri, 10 Jan 2020 14:09:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578694152; cv=none; d=google.com; s=arc-20160816; b=rxonK2+2nDRXW+4Dw68tWwKqBYyaSGp63HXsf57jaE4Ok/g5FiaEfbLvHwESE8hohv kklM0mfAr0Z0f2soUKBRCNgVE9pDnwmhl3DjqA8PATesoIvWEd6la88iQXbwJPEEdUeF NpjEPd7ZcZ8e6Ip5eQq5VKtQii17NuJ5ExYM6Y1aN0nXJbgHwNR1hN0iBB9yoacwNV1Z 4q1i+Bh9aIsCyP5vah4KhtlOH+KBYicYVsmmVwsiYBR0eXQ4TbqSc7G0WV3K8pkIixQv mZO7yhlHT1JcS8FAEfcSqCGGLURD64MzY1tETwxBda4knBfK541DeZ82D4yONEzFCeeP /3PQ== 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=ueIAxuwE1NrUjrVJsYu2PJWCZzJduGj9FbSfPr3jwpk=; b=Hq1ywdixZ/WaHdnjF4qdOXwJO9MS44XtXun6rjcrl27bwmht5MzoqEc+QsPC6n20Ys dKj2jmy0Q7nj7oRQvzLxw2y5lBpb32wUGlOwq5eu5OEdVR/8GpAeJtu42gjU7lgdkL5H d4GN1EYZCtkPVHaimBswyqLUZIW98OCNw7K5EFQagUjW93BpHE74yawfLEvi+DQtXwUs lkRDqqIWPfH1490vaTN96j45TWhb8vLni1TCSx+Jzu/HEI52+z1UhipFiSfqRVepz+lv ElPQIOE0lrj9605S1RARrGcBI++HxSFXJGCr1wz/MuSyMAiXHSg07FPTvH95HLrtC2jM Gl5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Tr+YU/ux"; 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 w1si1874874oia.169.2020.01.10.14.09.01; Fri, 10 Jan 2020 14:09:12 -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="Tr+YU/ux"; 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 S1728414AbgAJWHe (ORCPT + 99 others); Fri, 10 Jan 2020 17:07:34 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:41064 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728387AbgAJWHd (ORCPT ); Fri, 10 Jan 2020 17:07:33 -0500 Received: by mail-lj1-f195.google.com with SMTP id h23so3665324ljc.8; Fri, 10 Jan 2020 14:07:32 -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=ueIAxuwE1NrUjrVJsYu2PJWCZzJduGj9FbSfPr3jwpk=; b=Tr+YU/uxs+T+sEeXOIt2e5jvdiaiE0Nr4HuPRsUPSol46828WaEPO57aToaLRmoCvf K8ik/Qp+6W7Wjj81DSS0ThiuOCuvlnbGuIa0QL1uQ6P0fkixm71v8tYukqH50QLrZvPN 5twT9iBxovm/eyjlo7xjLoWYvii0sar3tq6YhRGkxSk0p9zIrS36DQD8y5GJcXMfHOBe xjIPKdqZUt2DtBkB5aLzIH9d+GWcQnPn5eMyZa6EJtAM5nA9ZNuKcfnNOdk2Pgd1oThL bEHgA70Ty4110yQPcp4+YTVUW4ggQdN6xGhTI/uhXbBzMKIKc/s/R9znGTuGDSQDAPQ0 krRQ== 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=ueIAxuwE1NrUjrVJsYu2PJWCZzJduGj9FbSfPr3jwpk=; b=mr+TO0ZL4YESIf1Y2P4l/u+fIPSAhhEoQ3Q8tx1n2U+20bZLEDgIa02p+hAJcf8SLI MJgMNDpSBfa9JxDHcmFFCLKDAtL/ItfhmSvs2eZFZagluPk2iFWYIigKJSF63sZbHKsR /fmebpKjzJdMqp31s6QwRTHRvXB7LnnXAJGIiNuRS2I6zC/bJuMjeMjMNtKJ+UNJwxDN f/ds2voub/8j3HlLedJwjZlvU9wuYI992bRpjme9S4FllDtr0J4aEfEIuf72H5uURxRN 2DAdhhTCy7QhGYekE3bqVZa52oARpcPt36QB9B/9AdkKIfTdbWVzqjlKDQFoASRCxphG ZnvA== X-Gm-Message-State: APjAAAWgUxfosBXFlpIIkdyD1XHbmHZN2cSbCtN0KZntEtNEqyTazAle c1nnbxtcHlFTNvI3xjUzLRfvQ0HQ X-Received: by 2002:a2e:9a04:: with SMTP id o4mr4100501lji.214.1578694051389; Fri, 10 Jan 2020 14:07:31 -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 o69sm1701360lff.14.2020.01.10.14.07.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2020 14:07:30 -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: Sat, 11 Jan 2020 01:07:30 +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 10.01.2020 07:50, Sameer Pujar пишет: > > On 1/9/2020 7:27 PM, Dmitry Osipenko wrote: >> External email: Use caution opening links or attachments >> >> >> 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. > > OK. I will send this as part of the complete series. Thank you. > Thanks! Please feel free to add me to the CC list, I'll take a look at the patches.