Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp97841lqs; Thu, 13 Jun 2024 05:11:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzQTqwyUf23TWjq28Xdl46OBDoVUUtZzoh5uhERh1bJZyyXvLsJPuy3kE14fF0Fz1IFdH5441a8MSot0L9mkM5Z4iFcIL1ADU2sRrF4Q== X-Google-Smtp-Source: AGHT+IHK6LDIM4hqEcN0X/4NcYkCzgjjosVQOQalfpHcSwcmG6rEogEaT7w2v+leeD3XJafOoXoI X-Received: by 2002:a05:6a20:2586:b0:1af:f50f:cbe5 with SMTP id adf61e73a8af0-1b8befda6e4mr4244850637.8.1718280710615; Thu, 13 Jun 2024 05:11:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718280710; cv=pass; d=google.com; s=arc-20160816; b=fse3/cWpptE2Mlkoyg4q+KtxqOvQrES11BMHjvGkCS5HDlKU67g3V+eqNN7x3ZuMNo nDHKp9knmheRyiIozPj/QBd0TRXq+iCpW9a8ddUGp9g+xZGgcX/mhTO+FZ9GEMlUsAWL KhLFG6UYBLIzki1ByKkSnggK/enDQHMzTkNroQ6ADcE4IPIxE3vUtkXjAynZlE9O+WLn AT796/5Hq0ThrCfqiQP3i1tTqgxP2ephYU2AlQklq7ZGBMFAD0L2vR3bsM4RIroLWT4y 2BoZY0Wk4FEnS+n3HKX8GGlF3TehBbp6YLxS7aJhKDfLKx9gAdZX6b0Sf8B7O65yXNeT Q/Gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Nk/PNuEosluR5OxyGRPxKqFcoUp4l1g0JxXBqb0kHWI=; fh=+UwI3DaA1yWrSDYKq6Dki/8bReq7BCJap5UkX3y6fJU=; b=x8w4/a7YdGuhDy/Y/+juiOeu6/SnkiQam2n8a2FAYpYJsjMdbjpbTGR9UwYQAETUil A4gTaXlktmJOcVAU3mnwzqlgxwox6KTMVKkW89o/ac1C4xnqH98DpbOtwbT3C5VRqDRe gp8CyiKwxIn6DrDdZty7Usc9XpONKYhu41yGLC5GVJxvUGELYu/a/Fh0LgwZXdCNG6ee 3E1LKk6LNxvPdvAUPWvrNgoXBLtEUrSr6Umr12IDREjkuKThLKPUqPL5v3tpV2pprxSn HEHuTt1gGHRUVETjObmtuosETt8TMlhf6edDZ4yGJtHdnX2yVV0soggk8nPT3FM5UmQC ALng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpoQb+W8; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213147-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee65ceac9si1153502a12.794.2024.06.13.05.11.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 05:11:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213147-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpoQb+W8; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213147-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 36A83B25D1B for ; Thu, 13 Jun 2024 11:58:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44023143C7B; Thu, 13 Jun 2024 11:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XpoQb+W8" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 D728A14386B for ; Thu, 13 Jun 2024 11:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279522; cv=none; b=cKS1ox/fmccQsqacuw3w40PQDxLuP8Fbroq5uBqNuLKAVp4IOgGOmReG7Tlt79oxMyN8muHE3CiDfIxxcJy5jx+r7Gw1j6pSgdHW/Mh6Ye23FPJ6Ue3ZMMXxTii8hpQ0GyysphPHlkDS0MDGO920mNyLU3Vc1fGmlult52Jft9g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279522; c=relaxed/simple; bh=LEMNOlqSbWvihp9TAFV3gKhrUTokJXgkBSjze5msUo8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IIVGtwnQO+sP5v20WKNCbQOFXNlCuu2DQXr+GCxNm748cwREjY9YFN/aUvokBKGUmyQcPxeACamMSWwaJ9YUyBNYrtZBz9Yhg/pAG7CY7FjEQ3K/FXiuNpSL8Sfmb1Km1/D6soQx8NFnIuWLFkwBoqn1zgOMjZlh0DG6SlNL66Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XpoQb+W8; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42108856c33so12710775e9.1 for ; Thu, 13 Jun 2024 04:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718279519; x=1718884319; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Nk/PNuEosluR5OxyGRPxKqFcoUp4l1g0JxXBqb0kHWI=; b=XpoQb+W8h2Un24UzsJaLoUqKPbqeuW6FbN2uoMLsxdZ04Sa4j3wcz0QbCusdvSuwA+ E3E+q12rugwhBYJolYYi8oABfNwFlINwKytZaSz4HevKFZWIPlMxEX+xjf8BuJWCHTqV lIENPk0osf9P157xPp4M2UoUDXNWBeMyx/MdgW1RsrBCOyS1IISIJQnLd/slGxC4dRFR M+W4zjpC0tQX9z8aV+YrJA9Jlx5Oc2x9VNuKY7IjxKBCwm3Bl8WQkSEPTyHBepIb74yZ UQNQoqzEJOg9n8lBMskefvZMtmlUzhHN3Q/UFTT27mUGbF1XfOXOBKeSJ263evf52UG9 Oi0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718279519; x=1718884319; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Nk/PNuEosluR5OxyGRPxKqFcoUp4l1g0JxXBqb0kHWI=; b=sIUv2bZTmH1JK0fWl2JCfrKO0nYJWLvYJuM4GMzaPDCyLwsz9BwLo5sEHYQb4WNx8I +ImmqHrvKGp9+ntMpDElVGbr5/9p7UikfPHmUALef630I93t4WcFmkwI7Os+JNgLPA2e aizzHZNSNQkW03DaE3ZnT2g5JbQ7MujO4vAu+9zglr8GVrVEWo9J0Lcnzi8VstiNMEgL FwLkOZc17RK+RTQWgQq9wCqJwgKjik3ci83hzDpwcZAbQLH8jvQd/JdadLDFmp/1zyuF dmtiQWv/GzfGF4xlyyGxZb5cof2PezegR1qfRh8y8eq/htDoH8lZtX06/GCp6jHwm/LU w4tg== X-Forwarded-Encrypted: i=1; AJvYcCW8W3WLevVcaz3JiZGnZpOMVRBd7x4xA5Zvh+iG2yqUrB2QL089klxUbdfE9kMcu5KMPReQjvnicuJXsY1QQ4MSTnsZbLMuI2rWkVfS X-Gm-Message-State: AOJu0Yxd1v9u5cbwoKcyVZWVwP7Exyu0+Kejis+5eu1Fz2KVvroK6lNX 9Dm6socUdt4L6mT6gd3eNjfYlrfGBMH/f/dHBFwU3sOISIzcwCqChy94S33HlZw= X-Received: by 2002:a05:600c:310a:b0:421:81b1:7f45 with SMTP id 5b1f17b1804b1-422b6fc5a34mr21225265e9.12.1718279519186; Thu, 13 Jun 2024 04:51:59 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:51ae:6dd8:7a33:3fb4? ([2a05:6e02:1041:c10:51ae:6dd8:7a33:3fb4]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-422870e96f9sm59813375e9.26.2024.06.13.04.51.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jun 2024 04:51:58 -0700 (PDT) Message-ID: Date: Thu, 13 Jun 2024 13:51:57 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] driver core: Add timeout for device shutdown To: Greg KH , Soumya Khasnis Cc: rafael@kernel.org, linux-kernel@vger.kernel.org, festevam@denx.de, lee@kernel.org, benjamin.bara@skidata.com, dmitry.osipenko@collabora.com, ldmldm05@gmail.com, srinavasa.nagaraju@sony.com, Madhusudan.Bobbili@sony.com, shingo.takeuchi@sony.com, keita.aihara@sony.com, masaya.takahashi@sony.com References: <20240613083226.GA8191@sony.com> <2024061326-moonlit-protozoan-61f8@gregkh> Content-Language: en-US From: Daniel Lezcano In-Reply-To: <2024061326-moonlit-protozoan-61f8@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 13/06/2024 10:43, Greg KH wrote: > On Thu, Jun 13, 2024 at 08:32:26AM +0000, Soumya Khasnis wrote: >> The device shutdown callbacks invoked during shutdown/reboot >> are prone to errors depending on the device state or mishandling >> by one or more driver. In order to prevent a device hang in such >> scenarios, we bail out after a timeout while dumping a meaningful >> call trace of the shutdown callback to kernel logs, which blocks >> the shutdown or reboot process. > > Again, this is not a "device shutdown" timeout, it is a "the whole > system has not shutdown this fast" timeout. > > And in looking at my system, it doesn't shutdown in 10 seconds as it is > madly flushing a ton of stuff out to the disks, and they are slow > beasts. So your 10 second default would cause me data loss on my > workstation, not good! Thanks for pointing this out. It is exactly what I was worried about ... [ ... ] > Isn't this just a bug in your drivers? Why not fix them? Or if you > really have to have 10 seconds to shut down, use a watchdog timer that > you trigger from userspace and stop petting once you want to shut down. > Then, if it expires it will reset the machine, all of your policy > decisions would have been done in userspace, no need to get the kernel > involved at all. +1 -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog