Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp465264pxy; Fri, 30 Apr 2021 09:03:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc3AMlOG3H2LNbxOKIM9Xyzu/gPnT9Wx3xkld4/t9Dc/a1QPon4MuHj0EQi+fHwBEOmFgy X-Received: by 2002:a62:d108:0:b029:25d:497e:2dfd with SMTP id z8-20020a62d1080000b029025d497e2dfdmr5641824pfg.29.1619798608465; Fri, 30 Apr 2021 09:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619798608; cv=none; d=google.com; s=arc-20160816; b=eEYK9287ouFYltBqVy/i7dMKcFye7h1OdxWyKarzE6dBS9wpe2JqP9QSeiuwSGCTSp ihQiZ6LwxLmjbw4L358o8AIuTSJ6na4e/grEUDJQzfT1i87FCMIt1vhDFWk6PWv+kZDU aGKD1atAlCMSrywN8f9kIdTNzMcRQcKpm77KuObZJqHTNPMQUuvbYb63na7Lkz8B1ACi ntmHxtuLjQvHarxhNRRM8ctHqujbQyT545FlEsPw1hsMxR1YGtZMuizDvF/GJynOpHj9 DvbPUDRCwaItjbZo4YxIJyxDMcFs2Nxmut31m1ZOarbBp/y1A3ljok9NMQFLjUhsuhtk hb2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=T5lkASPPxhJg172ppkZBtJ4gBjbigrHyx+1Fnjt/29I=; b=rwlXF8YP2SI/hSJeM//m6TeElWQRGdfL/n1OT/+2+FVKEru7RRmS0jCtgeUAdyuVGn 8gnOo99VotzuXwScVVw2qUdMIEewoZVYH251N2MSUQxfY6OemoKSr6nx26x1tlZ3dVhp 7BIGkKs8GELZaplyNvWfgKMdsiY56EMiTA2uAP8FZ9dem6myKpueo3uFs5hgfX2lj0z4 t43FdT/23GKjkHxOvOQddvKI7p1+mPkQtgS0W9L2hWgOcShgrHiNcsy4HxQKPF6zusqK Feb9WnSrG/tGgZSD4Du0ictG7r86S14s66VaauM1+hBW8/caV9yIHBJB/+yNCd+/5nrz AOeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="bHJU/iKz"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si3720452pgg.313.2021.04.30.09.03.12; Fri, 30 Apr 2021 09:03:28 -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=@walle.cc header.s=mail2016061301 header.b="bHJU/iKz"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbhD3QCm (ORCPT + 99 others); Fri, 30 Apr 2021 12:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbhD3QCl (ORCPT ); Fri, 30 Apr 2021 12:02:41 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0C1AC06174A; Fri, 30 Apr 2021 09:01:51 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 67BF622172; Fri, 30 Apr 2021 18:01:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1619798509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T5lkASPPxhJg172ppkZBtJ4gBjbigrHyx+1Fnjt/29I=; b=bHJU/iKzqKLs3plvE0cJlNnSl4NNjJaHz2q+Bd1JReZdDt24CkSrk6z1pCMMyFyMnU3lp/ eT1eJIRnhvh8HDtdaUao3P2R6X0sPmELryw0yx+zheUBkFQxX3vLYHIWKy1h+5CkFGnd3S DWRt6cgwfBO6L4WtqWLjQoU/B6Nph0M= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 30 Apr 2021 18:01:49 +0200 From: Michael Walle To: Mark Brown Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Subject: Re: [PATCH 1/2] regmap: add regmap_might_sleep() In-Reply-To: <20210430151908.GC5981@sirena.org.uk> References: <20210430130645.31562-1-michael@walle.cc> <20210430151908.GC5981@sirena.org.uk> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-04-30 17:19, schrieb Mark Brown: > On Fri, Apr 30, 2021 at 03:06:44PM +0200, Michael Walle wrote: > >> Sometimes a driver needs to know if the underlying regmap could sleep. >> For example, consider the gpio-regmap driver which needs to fill the >> gpiochip->can_sleep property. > > Whatever is creating the regmap really ought to know what device it's > dealing with... But creating and using the regmap are two seperate things, no? Consider the gpio-sl28cpld. It will just use whatever regmap the parent has created. How would it know what type of regmap it is? >> It might be possible to pass this information via the >> gpio_regmap_config, but this has the following drawbacks. First, that >> property is redundant and both places might contratict each other. And >> secondly, the driver might not even know the type of the regmap >> because >> it just gets an opaque pointer by querying the device tree. > > If it's a generic GPIO driver from a code correctness point of view > it's > always got a risk of sleeping... I can't follow you here. -michael