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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19703C43334 for ; Wed, 22 Jun 2022 16:27:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358840AbiFVQ1R (ORCPT ); Wed, 22 Jun 2022 12:27:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350478AbiFVQ1Q (ORCPT ); Wed, 22 Jun 2022 12:27:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BE83F8BA for ; Wed, 22 Jun 2022 09:27:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1D00061913 for ; Wed, 22 Jun 2022 16:27:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03AF3C34114; Wed, 22 Jun 2022 16:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655915234; bh=DyYH6uhmU3zMb9mouFy6uFvKCKUdXZL2QKDEo9cMQ6Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D1pF3q3OV1E0qnjTJ39Cl/qlC0tc/6MJhpW6XeIjEae7qHLfIa0e3Aa/7bMOGpCqG 4xeEkGNo/pbhXtd3hSkfusVcHkz/rvZ3Yu7JrKRu7VTi6acVHfLArDjxvBvMKB7mrN i40OfSFaH+I2uBbnLxAFaY0lctI5NlrTPzJPyA/31yoZoRNL8oBNZm9UTq+8iQBG/Q yVH5Px98afK1GYtsKBPwUQDYSkP3niBeTx94pkOkVy9S2LRQfW/hwrtmzW4JRPZays 7ONpB2vSJsddTDbkH8jxB/+SnRCRg7C65sZjjxNORWIDfEfFp0+gPleY/yKkD2+kHs kfvsYi9f9hdFA== Date: Wed, 22 Jun 2022 17:27:09 +0100 From: Mark Brown To: Dong Aisheng Cc: Aisheng Dong , "linux-kernel@vger.kernel.org" , "l.stach@pengutronix.de" , Peng Fan , "shawnguo@kernel.org" Subject: Re: [PATCH RFC 1/2] regmap: add option to disable debugfs Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VcQDeV43aI8PD0Ko" Content-Disposition: inline In-Reply-To: X-Cookie: Truckers welcome. Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VcQDeV43aI8PD0Ko Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 23, 2022 at 12:05:46AM +0800, Dong Aisheng wrote: > 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. Ah, I see - we don't enforce cache_only if bypass is enabled somehow, but we will complain if you try to enable both at the same time so I'm not sure that's an issue? > > > - WARN_ON(map->cache_bypass && enable); > > > +// WARN_ON(map->cache_bypass && enable); > > 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. cache_bypass is only going to be true if something enabled bypass, why would a device that doesn't use a cache enable bypass? It does get turned on transiently by things like patching but those only make sense if the device can be accessed so caceh_only shouldn't be on then. --VcQDeV43aI8PD0Ko Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmKzQtwACgkQJNaLcl1U h9BB7Qf/QfSoUpqy0MvH/JvWmZwOVLno2deYkhInVLyqUuLwPvh/GT/q6VOMiho9 FIykZbViiNKvegquav32trRYCkfIDc1qN3p00y1iXudZs5fQ/AWcxy47yAcOjOvN CWye/H2quJTdKC+lNc6VVjR6u2FuRtUHfB9okNnYzqrDbeWutUHgDL8WA+kan9X1 JrtOTtr5iP9Ps+KjYI/uZY5F5Gi5yu8zXN9BBsq/CzVjugC4JFe63SWnTOCfQFeG fYxI9BZpE3ikkXPhlkzsuf1keuaRs4CqjNj9vY8Y8TstMl7UTecLNqs7/SzdCFyD la5/sOJ+CQMDpPeZGgd02VtTFKmE9w== =u7Zw -----END PGP SIGNATURE----- --VcQDeV43aI8PD0Ko--