From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ACA6C433ED for ; Fri, 30 Apr 2021 16:01:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DF02613F4 for ; Fri, 30 Apr 2021 16:01:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbhD3QCl (ORCPT ); Fri, 30 Apr 2021 12:02:41 -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-gpio@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