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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 223AAC5321E for ; Fri, 23 Aug 2024 21:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=x6yyPOjZiqt8OBw3MWeKPxceSdJUt3buN6TZjEitZlA=; b=OVobT6/m75ORL1kZDsXpmmsT+S ldZlEyFCW0glRPljO4JuvMPHlimSXu9gG6eUK0sCtGub+RkCtq7CF5XTw90H7Xr6hLIX6PBcZcYxf 1cmVNVwzmXw6cFltcGyVZNY3HEWO0IMUEwqdHO/SJrFmCd8QemitvMksxJXQ07mTgxGq6Wqvm5Y+Y xS7eU22d9hAol+zQLOsh3R3k2NoO2X1C9cQ03oi1BcDlCjA2IY41SChUH/JELCfNhZHHRX7EuEP9g lJbQyuSEoZps6o5b0cdg6i0hJ1nwjy6Y8exlMz3/dY8lakuARa4EkirjXjUL9z390qX6QBag+Vvm5 AXjX0YFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shbqd-00000000iN7-29dg; Fri, 23 Aug 2024 21:29:31 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shbps-00000000iAf-1jFJ for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 21:28:45 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2021537a8e6so21888955ad.2 for ; Fri, 23 Aug 2024 14:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724448523; x=1725053323; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=x6yyPOjZiqt8OBw3MWeKPxceSdJUt3buN6TZjEitZlA=; b=UQDCYHCd8vT9BByNm9krl8nQCAEuZKTDmFIX7XBDZj5DAx3bLZN4JHSb3JotHK+qHb US+O4MLwn+ReDP+Zl9wlPZsGtMeOoIZawoCr3FZzuJe9hGixFYHNW75tIS7WeqSmaMLC IOQI+Mzdb2WIy4K8tiEPr1tETaXZP1Pzmc628= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724448523; x=1725053323; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=x6yyPOjZiqt8OBw3MWeKPxceSdJUt3buN6TZjEitZlA=; b=KUIpBzbwl1MHoVcvU4sk6KaV/LS1RelJppObaUIuxS21oCzpIUM6/mHwhFcV8y1v7Y ghWy+HKJT43/71ZOLdnKpfxl5lbwKERT9St8EMF7sd6MFjLAzpJM6yiOlYBrA+VzzK6i JVj3gZulya0CxfCqDQ2bs1vCV9mo2t//lNRDh+1M5+Gol85c44wtHaY0nMmkYuuvdM/8 BigKyVgCaz49P1liwwBd13/Vv7CQkht1rkAjPTpGlQy2KKZtryIBAOaOB12Bd/jh5yiW pIVc7mU5p4AmIa/jwlPghgz+vGZnxmbmoKAhlDG+vJtZdfGjcthNeNchmoegzFDP1dPb tAwQ== X-Forwarded-Encrypted: i=1; AJvYcCWOIGK80X8ip7cJSnzrAh6sKSkr0+JPrdcuU8emVPAq/t5CcD/5kJd0xY9z54XFYIJ7E/xhj5UlvD6Gkzcpy+H/@lists.infradead.org X-Gm-Message-State: AOJu0Yy1092ZaQzCJceGGXC402qGqfYFEEfqYUnmLpU7+dy08+9iT0Iz LPybg+0UnX+xJgsqQh7K4YarfqCO80AmMPl0zKzHYlY8e6M3ImhmY4GgXnpGlw== X-Google-Smtp-Source: AGHT+IEyiELvUQ08sRXKAsH1w4lS8Mpljm5W6KidIpNO/oUI/CTnm9GKW1kRt4ARb+bsEYqhFyMDeQ== X-Received: by 2002:a17:903:1c6:b0:202:100f:7b9b with SMTP id d9443c01a7336-2039e4ca62amr43391485ad.35.1724448522990; Fri, 23 Aug 2024 14:28:42 -0700 (PDT) Received: from localhost ([2a00:79e0:2e14:7:9d43:7af7:9970:8219]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-20385594057sm32605055ad.119.2024.08.23.14.28.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Aug 2024 14:28:42 -0700 (PDT) Date: Fri, 23 Aug 2024 14:28:40 -0700 From: Brian Norris To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Jon Lin , broonie@kernel.org, heiko@sntech.de, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, shengfei Xu Subject: Re: [PATCH v3 5/6] spi: rockchip: Suspend and resume the bus during NOIRQ_SYSTEM_SLEEP_PM ops Message-ID: References: <20220216014028.8123-1-jon.lin@rock-chips.com> <20220216014028.8123-6-jon.lin@rock-chips.com> <20220621154218.sau54jeij4bunf56@core> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220621154218.sau54jeij4bunf56@core> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_142844_459495_D8EFCDF1 X-CRM114-Status: GOOD ( 20.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 21, 2022 at 05:42:18PM +0200, Ondřej Jirman wrote: > On Wed, Feb 16, 2022 at 09:40:27AM +0800, Jon Lin wrote: > > From: shengfei Xu > > > > the wakeup interrupt handler which is guaranteed not to run while > > @resume noirq() is being executed. the patch can help to avoid the > > wakeup source try to access spi when the spi is in suspend mode. > > This patch causes oops on suspend every single time, because it tries to disable > already disabled clocks (one disable in runtime PM suspend, and other one in > system suspend). It also fails to properly handle errors from clk_prepare_enable > in rockchip_spi_resume, potentially causing even more clock enable/disable > imballance issues. > > Please send a revert and figure out a better fix for the original issue. Did anyone ever resolve this? I still see this issue on 6.10.6. IIUC, we can actually do a partial revert -- we *should* be using pm_runtime_force_{suspend,resume}() (so that we coordinate clk-disable, etc. with the runtime PM state), but we also want to run in the noirq phase. If I don't see anyone else's solution or input, I'll plan on submitting a partial revert, which seems to test out OK for me. Brian P.S. One can work around this problem by disabling runtime PM for the controllers: for i in /sys/bus/platform/drivers/rockchip-spi/*/power/control; do echo on >$i done But obviously that's not ideal.