Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3991094pxb; Tue, 25 Jan 2022 00:51:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/oLMqzfO86Piv6OXdMfCbDke8OjlK8N0gLpVVjE/TAl3iZylMOVhD35i+JTQgrFxogiUy X-Received: by 2002:a05:6402:b4c:: with SMTP id bx12mr19605944edb.363.1643100704498; Tue, 25 Jan 2022 00:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643100704; cv=none; d=google.com; s=arc-20160816; b=zo31ap+tJz76wq8WkFrvtrBghjsf39mSCT9LqZ+FA4Bu7NK2Y8JIR4E4PYkFYUYOH7 6qU0xH1rvVN97MBJnhC4C8wSKTmyKW69+vqUBLPJSyyMBQJsZ+8Qf/sRX3HN5rHz1kA0 iriVA+e8daQ5vT+xr4huBaqm1tl3tbjY0RLr86ESWOosqs7vQ6Ol3ziM05tpMueMC4L0 +798f9vwREyDuu1lKevXdcRPaWlz74iZWsFGv1vMl+4M9v1LNYC9+4vvO3ARyfBHEf3B /hYcmGnNis1YnkznhbQu0lPHxXaiBsyAH1VMwruBIzEz1XuRUV4u6BeFdRQOBsVOnjeU LK6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=f3FP9JgWyYmi4QIyCsuY6OM/tB0o/BLBpsR5IrUz/XM=; b=aKOxCT/LCydmHGjAwSSiERDVXwUNyoPQN09EJb+2uL4LDvziBWWmuagJZmSL8X+tNC nBk0LGGmZPWP9tuNK/yXJli/GsMaQNhXxwsaujAJ4yZS+3CaRc6G+tB5WVoePhqY0cec 0JDqLFDvHuAlDDI3P+wqwdjY4xBW7hCGWcynbZmSKFrnLqx2MFme88yQqLTI0vVX+e+H Onf77+nzU/LF14qK8y+3jkmzaiLadKQUfUaj7jaAPtK2XsM7neVvMoFe2hseZtAmV65s uSVMT94vhtPWf11tnVSfTMnfzXxj+wHSR/KHcEVtWUJupQbuMiZcxqbtRJuZcLRds0Pk mi0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P6PZX545; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si6906876edb.485.2022.01.25.00.51.10; Tue, 25 Jan 2022 00:51:44 -0800 (PST) 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=@chromium.org header.s=google header.b=P6PZX545; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1323722AbiAYD3W (ORCPT + 99 others); Mon, 24 Jan 2022 22:29:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1320978AbiAYDPV (ORCPT ); Mon, 24 Jan 2022 22:15:21 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00DB2C09F4AD for ; Mon, 24 Jan 2022 15:50:27 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id nn16-20020a17090b38d000b001b56b2bce31so792845pjb.3 for ; Mon, 24 Jan 2022 15:50:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=f3FP9JgWyYmi4QIyCsuY6OM/tB0o/BLBpsR5IrUz/XM=; b=P6PZX545ZUXpKkI678L+NQiT/pwRlfuKiPGT6M4cRgojnr/GAKIC95JwtYam64Y+yQ OqW5IvveUzxAgJlsKddsX+F99m3idv4bXSmhIeeibBHb3wbMZO1bBBW6rGD3hJnLdK5G 6oCEvOKWiZrXTy7CHAcS8jpMhRffv8g8ApHCk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=f3FP9JgWyYmi4QIyCsuY6OM/tB0o/BLBpsR5IrUz/XM=; b=CRrwFnp2epxUEdq10bEIylYpDhu5WT1CaQu9t3gU6xmzPNQFyD7cjinxzuSjgNy66E MmZUapUOtVALKfeE9eupuG5lzCHt587CU8+keXLAek2Mc2E/94RrQTVnZcIb4krdjKC1 wzNlwc6RZnLetoqJ/lcIipwh4WJYdp4Hgjt1xxYN93I4eOxMpVDqWoh8nU4OBjj0qh09 szgKY+YgCrZ2wOP6W8KBetR3yEDHd5/mzX9YLfoo/Ihy+TtK96VC6S/slsSTfxflB2si NrVcwa9OZXrpL+rnUTdER+2knn2zodSTpVDGWna7f7Xv35g/wZ6fDldbe6K8Fx6zZhpq n+sA== X-Gm-Message-State: AOAM533BxMnCXUu+rw67qyfsLgfwcqAhFtIlRq6xnhN28LL6/oVVjdBo 01LgCKSug7cWCtINjbMZsL+e5A== X-Received: by 2002:a17:902:e84b:b0:14b:4aa7:6198 with SMTP id t11-20020a170902e84b00b0014b4aa76198mr7924549plg.10.1643068226511; Mon, 24 Jan 2022 15:50:26 -0800 (PST) Received: from google.com ([2620:15c:202:201:e56e:5d31:a06d:e6ae]) by smtp.gmail.com with ESMTPSA id g22sm17650183pfj.99.2022.01.24.15.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 15:50:25 -0800 (PST) Date: Mon, 24 Jan 2022 15:50:23 -0800 From: Brian Norris To: Mark Brown Cc: Peng Fan , "rafael@kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , "S.j. Wang" Subject: regmap: mmio: lack of runtime_pm support for debugfs Message-ID: References: <1587620791-5279-1-git-send-email-peng.fan@nxp.com> <20200423104000.GD4808@sirena.org.uk> <20200423112244.GH4808@sirena.org.uk> <20200424103004.GB5850@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200424103004.GB5850@sirena.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [[ Retitling from '[PATCH] regmap: mmio: prepare/unprepare clk only when read/write' ]] Hi, Sorry to bring up an old thread, but it appears there's an unresolved problem in here that I'm also hitting: On Fri, Apr 24, 2020 at 11:30:04AM +0100, Mark Brown wrote: > On Fri, Apr 24, 2020 at 01:27:29AM +0000, Peng Fan wrote: > > > If we not pass clk to regmap, accessing regmap registers will hang system with > > Debugfs enabled. > > If you're not using a cache then that'll be a problem, however there is > a flag runtime_pm in the regmap config which when set should cause the > device to be runtime PM enabled when it's accessed so if you do your > clock management in runtime PM it should still get enabled. I *think* > that interacts OK with being in an atomic context but I can't say I've > verified. The only 'runtime_pm' flag I'm finding for regmap is for regmap_irq_chip -- there isn't anything useful for other kinds of regmaps (like MMIO). If this seems like an expected/useful feature, I'll look at adding it to the generic 'struct regmap_config' / drivers/base/regmap/regmap.c. This could be tricky in theory given the atomic context requirements, but in reality, I think it would still be OK: this feature would really be useful _only_ for otherwise-unregulated contexts, like debugfs access (where we can sleep). For all non-debugfs accesses, we expect to already be RPM_ACTIVE, because the driver should already be managing runtime PM. Brian