Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>,
	"Heiko Stübner" <heiko@sntech.de>
Cc: Lee Jones <lee@kernel.org>, Mark Brown <broonie@kernel.org>,
	Urja <urja@urja.dev>,
	linux-rockchip@lists.infradead.org, linux-spi@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel@collabora.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v1 1/1] mfd: rk8xx: Fix shutdown handler
Date: Thu, 1 Aug 2024 21:05:03 +0300	[thread overview]
Message-ID: <20c5ee69-3510-4c15-aa40-6d61c64d8ef1@collabora.com> (raw)
In-Reply-To: <wad5fdqxwoq2wy35wbhwk5jinpgyz6xmxnt5aqddci777qctsd@qay2lr2ubkws>

On 8/1/24 20:52, Sebastian Reichel wrote:
> Hi,
> 
> On Thu, Aug 01, 2024 at 07:41:44PM GMT, Heiko Stübner wrote:
>> Am Donnerstag, 1. August 2024, 17:31:33 CEST schrieb Dmitry Osipenko:
>>> On 7/30/24 21:05, Sebastian Reichel wrote:
>>>> +	/*
>>>> +	 * Currently the Rockchip SPI driver always sleeps when doing SPI
>>>> +	 * transfers. This is not allowed in the SYS_OFF_MODE_POWER_OFF
>>>> +	 * handler, so we are using the prepare handler as a workaround.
>>>> +	 * This should be removed once the Rockchip SPI driver has been
>>>> +	 * adapted.
>>>> +	 */
>>>> +	if (is_spi)
>>>> +		pwr_off_mode = SYS_OFF_MODE_POWER_OFF_PREPARE;
>>>
>>> This prevents the syscore_shutdown() step from execution. Is it better
>>> than not powering off?
>>>
>>> I'd rather skip registration of the power-off handlers in a case of SPI :)
>>
>> Or blasphemous thought, we could live with the warning-splash for a bit.
>>
>> From Sebastian's log I assume the WARNING comes from the
>> wait_for_completion() in spi_transfer_wait(), and I guess the transfer
>> with the poweroff command itself will already have happened then?
>>
>> So the device is most likely still powered off in that case?
>> Not sure how much of "bad taste" that thought is though ;-)
> 
> Yes, as far as I could see it works fine (the splash from the commit
> message is from exactly this solution running on RK3588 EVB1 and the
> board was powered off properly as far as I can tell). But it felt a
> bit strange to knowingly introduce an error splash in a fix intended
> for being backported to the stable trees, so I switched to the current
> version before sending.

Can you add a busy-wait to the SPI driver TX func for the case where
it's invoked with a disabled interrupts? That could be a better
workaround, silencing the warning and keeping power-off working properly.

-- 
Best regards,
Dmitry


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

      reply	other threads:[~2024-08-01 18:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 18:05 [PATCH v1 1/1] mfd: rk8xx: Fix shutdown handler Sebastian Reichel
2024-07-30 19:07 ` Urja
2024-07-31 19:43 ` Heiko Stübner
2024-08-01 13:18 ` Lee Jones
2024-08-01 15:22   ` Sebastian Reichel
2024-08-03 15:39     ` Dragan Simic
2025-03-20 10:10     ` SPI transfers in atomic context [Was: Re: [PATCH v1 1/1] mfd: rk8xx: Fix shutdown handler] Uwe Kleine-König
2025-03-20 11:23       ` Mark Brown
2025-03-28  5:27       ` Dmitry Osipenko
2024-08-01 15:31 ` [PATCH v1 1/1] mfd: rk8xx: Fix shutdown handler Dmitry Osipenko
2024-08-01 17:41   ` Heiko Stübner
2024-08-01 17:52     ` Sebastian Reichel
2024-08-01 18:05       ` Dmitry Osipenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20c5ee69-3510-4c15-aa40-6d61c64d8ef1@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=kernel@collabora.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=stable@vger.kernel.org \
    --cc=urja@urja.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox