Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4968966iog; Wed, 22 Jun 2022 09:15:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ssuJ584Q1t/k75tFBnErHPBLK8/qkLRj/xfSsfm93/QcmYE8Dgm/I59M4ReLF3CctLx06a X-Received: by 2002:a05:6a00:14c4:b0:525:524e:e423 with SMTP id w4-20020a056a0014c400b00525524ee423mr389565pfu.72.1655914506971; Wed, 22 Jun 2022 09:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655914506; cv=none; d=google.com; s=arc-20160816; b=f8FhEfHv0VsJNkXcfWugepGRi7uAdrxJv1EXaEj6PeCFWy9uZ8DOeEG8oT6i+YppmV WzZGRxjBWxOYh2BB6Bzh3peh2ETVAnCCgor0/XuleWhB+nJ74shqZiTaZztRhZEW81/g 2mo1AlzTTD94pWsInjimSkSIhIXQZPOqDdv3FFT3bfBD9ZV5/opkqPT3b6Wm44bZ6Sfd rUk94FAkKoQB4zYCz+sfFsmex7ESCDtyrrUAhxqJVPuwfZ61mkJU2VI+5TmfI+TbcFkE Z/jcPH0+bozy3ngLR0w2CqMb9qfATJzB+fB3FhQnkXKAdgja5otj2Ibckfviq5NdjUGl yjuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jFC4cNY5zbSDfSvr3npwCt7dDz8aPPm7c4kPd4eEXSg=; b=tJAWPqK6OsL3nRYi3ixpcKWbU9vCJPN0dlaMmQGveEpR+f81QRG3OHk73cGRE3Tno8 1u8W+613pQL4FLr4rtzM4Yg5yaOum1H0MDmUR+URu0MlET1Dvf7SxzqegbB4eJZy6z9L j7s03t8UDrVceBm36i3arNK3sSCc92sNwJmMZiz3WF5flV6Y4yW9SNs+HX74lIdlkkIk fKg02VmUzi1ctbRRPikCz6LN6qEI40VdIc8S6BfWn11FpCjKXtAQncXVazrmCTSHf1Sn o8MbDVet3kYnjuoyP8kVOj59NU5jnWzm8FFL1I0klpEdY4rOoSjPuf8qcqiFxupj5+hQ ITZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hz2QEETv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a63934b000000b003fcd3d1b031si14945716pgm.562.2022.06.22.09.14.53; Wed, 22 Jun 2022 09:15:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hz2QEETv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1358961AbiFVQGV (ORCPT + 99 others); Wed, 22 Jun 2022 12:06:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358896AbiFVQF7 (ORCPT ); Wed, 22 Jun 2022 12:05:59 -0400 Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62CDE26AD3 for ; Wed, 22 Jun 2022 09:05:58 -0700 (PDT) Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-101dc639636so13226897fac.6 for ; Wed, 22 Jun 2022 09:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jFC4cNY5zbSDfSvr3npwCt7dDz8aPPm7c4kPd4eEXSg=; b=hz2QEETvDhkY1QrtCHM4s9S3m9NTKLfkyFbY7FmOeH3Q6ljfbCZSbf65HK/JlCAxzm dX7TbzMcMIe45t8f7RoMCPXBQQZLkEF3cAn+YOaBu0ZNQgj8kseMxeIDqwHG+oSyI1UT 9zKmwtu0fs49pXC3QeBLIKy/hWg7yhEgDspRPwKlqC2LjrMQQLiBdTjFTuwLh8KUBbLd LWGmp7oVfDDKozt9/gvJgBCTNhdH4JLGZaKSRHqlAp8uSjCVU8lYGs0hAyiXE17J1UCF xBJl8/m4ZQI5XEBMosq0aBzF6BUoAqrL6uo5s1FDqvMatzL9d80pn8F6ng1HaKwiZio1 DBVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jFC4cNY5zbSDfSvr3npwCt7dDz8aPPm7c4kPd4eEXSg=; b=zsALirre0H9bFb2JDyYmu1qen3m/cPn5UmUZr00XndLuRJvd6F5FgFPVqaaUpsrA4h MsrQ7j/aicfjm4AZW6R9afsl5rxAFuW2OOcKyhO75D/AdzvvALIVb/DOLfYz2whtT1ly 9DimsZZ9ivXkM8S5L0eYVmSE7IoMqlTfC2C8N0A8aVEV5FQwknAJ5eJM4/2F4S+UDf1u cpYJBT6jjzMZ32W9/Skxfx+62kwY9HQtw0V8PT3AOvPE84GTK2rGLZh43TyPRXoA4WWW xBtikdc0LT2CphU1oWq/et3PgdpCFDR+jQbiCjThIji/2o+IJ1fzX2hN9REQrBOJB755 a7Ow== X-Gm-Message-State: AJIora8cYBKCJ2phjYDFMmsuGG4Lu3RE/CAwgwmFTbE05XBq0vyPdjX/ oRLjhfT/nQ1lGqBP/P9l3jkJQmMbFfse2vdWBf4= X-Received: by 2002:a05:6870:f2a7:b0:f1:7205:d130 with SMTP id u39-20020a056870f2a700b000f17205d130mr2507573oap.146.1655913957677; Wed, 22 Jun 2022 09:05:57 -0700 (PDT) MIME-Version: 1.0 References: <20220620134758.1286480-2-aisheng.dong@nxp.com> In-Reply-To: From: Dong Aisheng Date: Thu, 23 Jun 2022 00:05:46 +0800 Message-ID: Subject: Re: [PATCH RFC 1/2] regmap: add option to disable debugfs To: Mark Brown Cc: Aisheng Dong , "linux-kernel@vger.kernel.org" , "l.stach@pengutronix.de" , Peng Fan , "shawnguo@kernel.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 22, 2022 at 8:36 PM Mark Brown wrote: > > On Wed, Jun 22, 2022 at 06:12:49PM +0800, Dong Aisheng wrote: > > > NOTE: i didn't fix _regmap_write() as i.MX controls regmap write well in driver > > with power enabled first, so don't have issues in reality. > > I can't tell what you think the problem is with _regmap_write()? > Because from what I see, _regmap_write() seems still can write to HW register even with cache_only mode set theoretically. > > It can be fixed in a separate patch later if needed. > > You may check if it's as your expected solution. > > > For syscon, I still have no idea how to fix it if I can't disable it. > > > > diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c > > index 2eaffd3224c9..da1702fd57cc 100644 > > --- a/drivers/base/regmap/regcache.c > > +++ b/drivers/base/regmap/regcache.c > > @@ -495,7 +495,7 @@ EXPORT_SYMBOL_GPL(regcache_drop_region); > > void regcache_cache_only(struct regmap *map, bool enable) > > { > > map->lock(map->lock_arg); > > - WARN_ON(map->cache_bypass && enable); > > +// WARN_ON(map->cache_bypass && enable); > > map->cache_only = enable; > > trace_regmap_cache_only(map, enable); > > map->unlock(map->lock_arg); > > What is the purpose of this change? Why would the combination of cache > only and bypass modes work be a good idea, and how should things behave > in that case? > Because without this change, there will be a kernel dump caused by WARN_ON when drivers call regcache_cache_only(map, true) after power is off. There's no cache used in the imx blkctl driver. So map->cache_bypass is default to true. I did this by following your previous suggestion as follows: "You don't actually need to have a cache to use cache only mode, if there are no cached registers then you'll just get -EBUSY on any access to the registers but that's hopefully fine since at the minute things will just fall over anyway. You shouldn't even need to flag registers as volatile if there's no cache since it's not really relevant without a cache." Am I misunderstanding your suggestions? Regards Aisheng