Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp236180ybl; Thu, 9 Jan 2020 20:51:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxj+bS721R5s2LYNAwY2nyKiUCjNviX7lU5V5ueRxGqdVviWo8ho8KMMVl5pGVkS/BNjEc6 X-Received: by 2002:aca:ac0d:: with SMTP id v13mr768405oie.160.1578631910954; Thu, 09 Jan 2020 20:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578631910; cv=none; d=google.com; s=arc-20160816; b=p6SWgCJP7q/9fAccWgdqUlRmk3IOuA/nY6KcKFBCzcCTRpDzcF7QQ4yMCc9SaTedGd XCtqlpq4u33vAmZmbvBzEVdEz1kv7LQA6DrR1tG+Bc2XgcvcDmi9BrQi4ctBUHPJGj5V U7ob4olnDU6mlaX9vMmO5ynoSuaynr71JTdUkrjUI1r7eSZjUImK+O4EPpVmEvdBM496 D1JrPam6KJ6wBpTYjLE0fNREjQ0Y9PSkZ1HYd2Pt8rmKP73hSWb8rXJqxST8gAd4IRKf T2yYQTSjby+JgXly/d85USFDcsC4ITVbqbOT6XSjOsVBsLBMzKhTISrst/dtoIoNMnkI BW/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LY4ub5S3YLyUMHW9VwtXF4qLAIdLW7v5zkvc2e4WsWo=; b=tDnlHdxuhmA7OwqLVYaIAxY0fNYtf9ywFznrc4krZY0CQwFCYJ0lIoxS8671KmIiq4 nvMU9pxXLxwUf/3I0JW2GpoTTn/MXMHUeXwAaaPpnLmaIkZlUQMldDAlFp/fOE8di055 g5Qj0rXR9wIbud4tr+PuxLYdpzQJG4y8Y2XQ0ACdiH5W0pWsXf2uiMZ+5xRU25QNJtaT TeRFJwCXG5EyzqTjDhXHUWgGx6tMAF3f+ZLNgVuZ/4x/5eioiHfX2MBrsY38RvcZNnX4 pcCEGn7d/GAvPoSFkuYqyq3fZ//9Sfk3xiY2oyHb3kMh/CB4M19ph7w7V27LfEW4DjzQ T1Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=KtXwcD6m; 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=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si426142oic.62.2020.01.09.20.51.09; Thu, 09 Jan 2020 20:51:50 -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=@nvidia.com header.s=n1 header.b=KtXwcD6m; 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=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731366AbgAJEuN (ORCPT + 99 others); Thu, 9 Jan 2020 23:50:13 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:11322 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731344AbgAJEuM (ORCPT ); Thu, 9 Jan 2020 23:50:12 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 09 Jan 2020 20:49:54 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 09 Jan 2020 20:50:12 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 09 Jan 2020 20:50:12 -0800 Received: from [10.24.44.157] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 10 Jan 2020 04:50:09 +0000 Subject: Re: [PATCH v3] regmap: add iopoll-like atomic polling macro To: Dmitry Osipenko , CC: , , References: <1578546590-24737-1-git-send-email-spujar@nvidia.com> From: Sameer Pujar Message-ID: Date: Fri, 10 Jan 2020 10:20:05 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-GB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1578631794; bh=LY4ub5S3YLyUMHW9VwtXF4qLAIdLW7v5zkvc2e4WsWo=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Transfer-Encoding: Content-Language; b=KtXwcD6m6Q1VZ7ZAu+bNuGyMK5a4FXr0cVyJODK85m1UG12DNg50tgV1j7H71q+EP VaKoPeRiasO8ZAq3YC3cQ2IDLkRtkkoeA+qlKtIc9dg4aABv1IDbDrMGmDIiWAYr02 B8/r/XAjRH49mmbYFJAv53ga1BcYg9v52l6QbaZ+MxhT1WShFCBJxumlM0wvVbcdJB mtptRrgRaB3PNcmsSq34JiM9CqFLFgUGW/Hjw7rw3FQEsC1F0vHomhif7XfRmvEv3m 1dc8yMcHbQBRNIVZJ9hY6C60BloumdsFkfmf5NIHlwZLRDVfnTgFOLrc1k0D/OAwyG 8GsjPFUnQCR4g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> 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 =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>> 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' macr= o. >>>> >>>> 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) the= n >>>> 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.