From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB5EF352031 for ; Mon, 13 Jul 2026 14:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.210.171 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783954800; cv=pass; b=Ocd0j/lMiVst8maq4H2ADGXjxLV2xf0FxNA85jMC6k/dD2nKdRP3xvJAH0yOSUYxX53ZM7XUsiP//gocT75emcG1LpfRDGEykF8ZnwTxH/9S+jt4cDz/31000XYPTOpB5HrBITRHwu488u8GBWZvfzVAfatxMHvceMRLaifac1E= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783954800; c=relaxed/simple; bh=lWQl+VufSXM7g9eE3mxqPdqkH2AsnKinxaF4b/PoERQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=d5MqKDbKV+7pUYdzh4J3o2UwgZiyERfaLUih7Vfo7JhZA0il8RvCIugs5gutXgSdLNaLAsRUDMnIkpWHKlKE51g1uaI1SV9CWgh/pAACrqcH7H0FEM9J912pGcnxX9cTZOsqzfWGxJ5Np5wlMwjqQtQUTFQJSC5lpscyW4X4jmI= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=sI3mwDIU; arc=pass smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sI3mwDIU" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-84536ecfc5bso3520534b3a.2 for ; Mon, 13 Jul 2026 07:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783954799; cv=none; d=google.com; s=arc-20260327; b=XbJ9QbgftuMdSFVvqvcEeZg0V3hwDM5UwNmG2QfrZi7BGF1/8JFaijj5866lPULq+6 G6gWYLF3BZeDTek6vxrM8pCi5mKui9SRauImqfEuY6w9bv5vXfIwZgCy3sxlj8+toUnK HuPXYdqWCi5JAnyEp3aMeGg9wwWsvAVoc+7UVGzBhYjHxaiOgjaaRF0d2wwk7p+eiOSU j4R95rmO8UmYT0dxlxxTWHIIlDusSX9SSKTxJQ70wRxPyKe3HU33s1j1MHSJgq3zwxQn Luup7IICgbMiOLBz6q4gRVs9W7KOT0+i8mUzvzz8EVzqD9piQnIZw9CkY869SykuRW5W ZHEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=PZspWnWvlYF8zd4FVwuRbdjg+TDtQGuY0jbAAJc1SzU=; fh=3eGlEx6hFUXJTEpBXrjGIMq7XHAMe33zQbTlDdS9p0Q=; b=NSkeviBlMxw10/SQahKbL8fUquc4dQ37LO/Zvf3FSdhaC5MtZU15SirgzwjepvzI0X GaPnZHg85UooABpsXd+k++mSLaqW9VYDV3HoBz6E0fKK1sa1D6DmMhQ7+9cN3MEsT2f4 R4d6/a1/NblxTuKi9CGLpprfrpqaoPLlYlsnwJUQQuMZAkGFgUYgHNEa3c7QBKqRHIwe h9q1+PDJRsGfrdbh6Ojzq1i1N3c+Htlgzs03tZ9mGFTs9knhPJTvK7DkbKnhBbgLKKuS c129yvlHGeEn5C3Sh7AFftTUalUtTQXjbfC+8SRNDHaJHK+gswKlxGimCBwEaJj+/5fI 5Z9A==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783954799; x=1784559599; darn=vger.kernel.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PZspWnWvlYF8zd4FVwuRbdjg+TDtQGuY0jbAAJc1SzU=; b=sI3mwDIU/wrR2uZ5BAr0Yu5mCb4GbojhyHRlA1lbIpmLbnw06H6x8Q4X5wbc0xixMN 3gFKJmnUProIMvN39uCbqsEBM/pmGHKl9OGmShkbKMe7FTP455u/BtghKe9I3+eBlDcB +uZshoyQQWogxNlWYK+mXNR7M7NNoJbvHYk06hpRNC0z+s0L0etqILAwGZ8+gu6Sfs9a DV66HMcwc6KlK+kQe11ZHZGDiXc8wO4vDzKy/LTsnGMK0j3JfFlIaV3Fs/PVMTjbef4c KtawGQEpvXmynDtlFi3DVOsR+ZqVfe0uYjyTBBdHNfB8G+3SKRVhudwZaDzPkfd/kfrh taRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783954799; x=1784559599; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=PZspWnWvlYF8zd4FVwuRbdjg+TDtQGuY0jbAAJc1SzU=; b=EOe2CYVtKr1EzHPSDDpFdF64LXFMgwNV5Hv7iE78R2KfnHW1olf3C8ZxM1yjRbWlei Z8+1/sRnsoqah3NuhTmN/DvhHm2ga7BCs9C1AVGX1OORl/5N5CCnlVn0KpBSKbuJjYlK GQM38+IO8RtCS7HOSA0z5x4fFLilhNFQZti0CTNT9WhctvAViVZzzyrQ2fs3EoZyYtvc 1dIP8iWutANzVuRBxb7w+1J9R/otdfpNs+agHkHz0DlnNjz9kevZ+5jlzPpEEjQiTYgy /RUxcbN6990Yk9eEb9+VWqR2gS0+w/HrxGhLSVFc0QGWOywOoEen75tSQpFKPlVwJiN0 gpRA== X-Forwarded-Encrypted: i=1; AHgh+RqxUVmLxBYi/BqXn1vUbCj5FeCuHWy4tm4boii39eRz/mxwuZzwkzlnESCwpc353xPKW9ZiukbQgeZKjKs=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1ZmR1q8Fiavrrai4a15R3hMOfTnCuFiEm2C5UAK/JD5a42Rlj zmpETUC0+5vd1IepvKDvY+X8PxxB9BaVivCuJQG5XbiDdjY4v20++OYhTyx9CBAT02mCoqnE+j8 2YkEk//i5RqtHXIyOwXeChfsPvlVdIDw= X-Gm-Gg: AfdE7ckoWno2jnivUhT0B7I+DIcvBBYHUh3e7FS1mrFIcytFeBtLwHhtpSxI+g/uizs Hhng1k/IjtM4WAgU9usOZp1uCVQI17iFSgUR6f2V4II3Fj8tkHGzK5oQOvQZ7bK1x9jurf1zy4y hP0TjDLMiq6XfTh+BFHlIfZTD+cqbr2lgJc5asPNj+5obBEJwJOJvTFHhLUY56Fz2hRmGTboMgV mB66fGTCF0hvlig97wfBH2IUTvvrnxJMDCgXsTg2KosCn8HUz1xU0yHAhFvkwuGt/H02rVyKF4D r2aZqxQEZDE+fTXDM5HoRCnOki1gZYMJU4w54/PpjZMl192GPYm1yTZirerxGA== X-Received: by 2002:a05:6a00:3388:b0:848:420a:9cd5 with SMTP id d2e1a72fcca58-8488974a28amr9373881b3a.53.1783954799006; Mon, 13 Jul 2026 07:59:59 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260713073059.47914-1-phucduc.bui@gmail.com> <24ce60c7-5539-4fba-8bf3-3a10875c3b75@sirena.org.uk> <687d81be-566c-481a-9ece-08526c33ff91@sirena.org.uk> In-Reply-To: <687d81be-566c-481a-9ece-08526c33ff91@sirena.org.uk> From: Bui Duc Phuc Date: Mon, 13 Jul 2026 21:59:46 +0700 X-Gm-Features: AVVi8CeTQufDThILyDlUHXLqCf3pEyPE7cxq1t1oJy6MsuzwDd-aR7X1ENHF8tA Message-ID: Subject: Re: [PATCH] regcache: disable cache_only before rewriting paging registers To: Mark Brown Cc: Greg Kroah-Hartman , rafael@kernel.org, Danilo Krummrich , linux-kernel@vger.kernel.org, driver-core@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Hi Mark, Thanks for the clarification. > > Yes, calling regcache_sync() with the cache enabled is not particularly > sensible - it basically exists to put all the changes made while a > device was in cache only mode (including due to suspend which is the > main case for that) onto the device. That was actually my understanding as well. Initially, I was considering a patch that would make it unnecessary to explicitly call regcache_cache_only(map, true) again when regcache_sync() fails. The idea was roughly: 1. check cache_only at the beginning of regcache_sync(), and if it is already true, emit a warning and return immediately; 2. if regcache_sync() fails, automatically restore cache_only = true before returning. However, after reviewing the existing users of regcache_sync(), I found that there are several drivers that call regcache_sync() without first calling regcache_cache_only(map, false). That made me think such a change could break existing users, so I decided not to pursue that approach. If the intended usage is indeed that regcache_cache_only(map, false) should always be set before regcache_sync() is ever used, then I'm happy to revisit this approach and also prepare follow-up patches for the drivers that don't currently follow that pattern. I'd appreciate your thoughts on whether that would be the right direction. Best regards, Phuc