[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY4PR04MB37512529D146054814111270E76F0@CY4PR04MB3751.namprd04.prod.outlook.com>
Date: Tue, 30 Jun 2020 01:05:12 +0000
From: Damien Le Moal <Damien.LeMoal@....com>
To: Simon Arlott <simon@...iron.net>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Jonathan Corbet <corbet@....net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH] scsi: sd: stop SSD (non-rotational) disks before reboot
On 2020/06/29 3:23, Simon Arlott wrote:
> On 19/06/2020 00:31, Damien Le Moal wrote:
>> On 2020/06/18 21:26, Simon Arlott wrote:
>>> I haven't verified it, but the BIOS leaves the power off for several
>>> seconds which should be long enough for the HDDs to spin down.
>>>
>>> I'm less concerned about those suddenly losing power but it would be
>>> nice to have a stop command sent to them too.
>>
>> OK. So maybe the patch should be as simple as changing SYSTEM_RESTART state to
>> SYSTEM_POWER_OFF if reboot=p is set, no ? Since that is consistent with the fact
>> that reboot=p will cause power to go off, exactly the same as a regular
>> shutdown, it seems cleaner and safer to use SYSTEM_POWER_OFF for the entire
>> system, not just scsi disks.
>
> That could be a bit misleading because the power isn't going to stay
> off. Some of the network drivers have specific WOL behaviour changes
> for a power off.
The point is that the power goes off, same as for a SYSTEM_POWER_OFF shutdown.
It do not think it matters how long it will be off before your BIOS restarts the
laptop power. And actually enabling the NICs WOL function would I think actually
be a very good thing: if the PSU power cycling fails, the machine can still be
remotely woken-up as configured by the user.
> Power cycling the PSU is not something that every BIOS will do, so it's
> not that simple. It could be a module parameter but I'd be concerned
> that some other code will assuming the system should be powered off and
> all of my reboots will become power off events.
Or define a SYSTEM_RESTART_P that essentially does what SYSTEM_POWER_OFF does +
the addition of telling the BIOS to restart the PSU, if the machines supports
it. What happens if one does a reboot=p on a machine that does not support it ?
Does this become a shutdown, or does it become a normal reset ?
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists