Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2042977rbb; Tue, 27 Feb 2024 08:56:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtQBzCD6on4dzG2pb+g1QIYjzMnkKOSoibofi71y38zVHUP/9sViz8mbIFNBYGg1hTkgvv1Lr9tadX4pUzgq/RSpwnLlauQWlCnHfrnw== X-Google-Smtp-Source: AGHT+IEnkrH2ZiRg9MQEERJhVYzFLA6L0K8Zo0dIStqVv2+iCQidFkIZgjIeXccqTaoFAOslQYLC X-Received: by 2002:a05:6830:2aa4:b0:6e4:8a5a:8fea with SMTP id s36-20020a0568302aa400b006e48a5a8feamr11604271otu.36.1709052982376; Tue, 27 Feb 2024 08:56:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709052982; cv=pass; d=google.com; s=arc-20160816; b=nWjVv5x9RsI2EWOU3/iK63aH18W8OHLMsykXEvvH0BFMrcn/7Op/8gcGpvYPh8eBo4 sfhPgB2jePFAn7AZQxwIv92xzHdWiRixuZ10XB8h1NK4yBrXWgFRDZpGThmASm8Z4pQM BPmU/WIpL/dk7pvGjsSyaLg6O3GpR4i838YV6P1yjpiPAnGHeRfmArQJJr5G5HszbZDx e7lUtCLR1dOa+AtNE10XA7/PBguW0ZnOkdezEbSvhje++08pwM/hI/QEo8/P+u8gzzZF z90Mqh7Oqt/h8Aj2toeQzSjhTuI9HH5M+L/wMoKUztY3YYaSmp683WzJ+P7iWPmEuISH 2mLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:references:cc:to:subject:from:dkim-signature; bh=pAD8RHKxb4G97R9G/dSDm2p0nboqUuatq3J8Tyt7hHw=; fh=cUeriXKyKOHimXYMdGy3OACiykYmeqfTArJp277d3qY=; b=sdWd47sUTFIbf6m7qJF3ie8kEyciZiKg6b3gG2RH0/Gbew3N2Oet39DaUwho7bNXj3 PY7hMdM1FR5KUQIDpcXWXW8oRqy/9JyT/F826EqtrbeQT3sjeUy01DeS0JVc8FxxnZhq 7FrKQ3XPoO9m3scHSfjluSyuzUOo2uIHnTGZxLonMD7Yib4Qcqe7bdGAvk8F6n546iRt zgfqDzoKw3boVArTnFhRwGrR6xE688H7dTDFo2tcTwHBe9zrl9Qahk7Cg4HSw0fXWS0P ESOs+ZiLxTEwNrra0aEa8DUpRlgMAwA0p/f8rGupHMRKfEvG4ic1g0tIPScbnyCfegjc Wpog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PALDXWLI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-83598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m9-20020a056a00080900b006e4f49b8204si5860876pfk.335.2024.02.27.08.56.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 08:56:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83598-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=@gmail.com header.s=20230601 header.b=PALDXWLI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-83598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 58ABFB2FF14 for ; Tue, 27 Feb 2024 16:28:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B66331487FF; Tue, 27 Feb 2024 16:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PALDXWLI" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 28942145321; Tue, 27 Feb 2024 16:27:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709051279; cv=none; b=ITURFkYBmI3AdTjsQljs8r7U4sf0Z34blO9nr4qfH96aepwW8WPt6d9wPfkBIX3nsydCgrrvHsGsYAG7hxQzi1UEmoixu4KZS4Yv1fPOR6BPBNjRUyXzbPwMPAuFn5a21/xYTruMav2v0CK25R9xEQ5A6rmDpg68oH9CGv3hIh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709051279; c=relaxed/simple; bh=YktS9dxlM50RHOnP7vVul3eD1UdiPaSXTO3fwBv+RJg=; h=From:Subject:To:Cc:References:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=uGc/MglIYMKBcZfD9MwKdWpdp9CNs27xVCGTaCsW4FLD0Az0Gd557el3bKgmlUqrFjGxqwxYBNpxCX8MRkQG80r5VxN+iDBQVXnzdI7/yklqm8BhoIl8zUX6yQrDHs5WxIlHufmZOnVXuH3Erx3R9FjKsOZtWJhQmXqT2YRZB6k= ARC-Authentication-Results:i=1; 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=PALDXWLI; arc=none smtp.client-ip=209.85.167.49 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 Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-512f5484a37so4138754e87.3; Tue, 27 Feb 2024 08:27:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709051276; x=1709656076; darn=vger.kernel.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:cc:to:subject:from:from:to:cc :subject:date:message-id:reply-to; bh=pAD8RHKxb4G97R9G/dSDm2p0nboqUuatq3J8Tyt7hHw=; b=PALDXWLIETybPoknflqESM5QvOpIpGLxCr3cBGDtPy2BkJapPLqxdUm7BJep6oDxkI Awl+uY9X1T1TQl/mSPaKotoTgxBnGnVgZ0/l9jvCt7/u9AzjUp4UprLgIq/yZNYIjNul ZZJFa45fxrJoTy6+z1fovd3ltn6AKnATmVtHoEmAHbO7crxK0kl9gpSMHU+RpXpTFjzK J4p8amYiec9Idoew74mmwmNBZDGk9zRdGsUnTTJG/a8lJyh8jvmCAAY6eW270O3MfoDj QpBaq2LfM6+5kIm2wpA/PKYNlPTGgGs1Vduf2P67tuGITlJbzG/j3YLW6+dpklSXrO/h gMjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709051276; x=1709656076; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:cc:to:subject:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pAD8RHKxb4G97R9G/dSDm2p0nboqUuatq3J8Tyt7hHw=; b=duDVZ95sHaijtatfduZMJSgg7mLUsL53yOMobd9xfb7qcQeRLGsytGHirUqmHd3tEl jtSHs32H99DET1/GKj1nN9jyQdIGT7hIgwHSRk5V9NSn588+iGj2LHusVKoQ05UklTBl jZmOdZ8+/dJv/K53Rpez6lWSWVxLy/yKtU75JJNOSsp4F2iGiA8pmeNQ2lD/yVBnn1TO sPtjl67yMC2h+PHlkvHbmPOidLA1oHHS8YIX3SaAc1PiqjNwLbKOv+tQb22i5dpDyBjt 84gfzdkhzkHOOGrfBvWws6N5c8OAnD0UeYoOLFsKOXGxPrv2ObcALrFedrzL2fpIi7BX zH3Q== X-Forwarded-Encrypted: i=1; AJvYcCVJIa3drgi/vXKANhdOhA022m8fLwLx4VyB7adNauGKKm/8Q6cDI2H8EO89ZHwv62WdsFAZPpGBvsj1GseyJ/VSMld5F6mCszWWlhfwF85g1NVfPMNU3bpwzCEKw/Vl1yRuj49YLA5RVD5XsMMbimNkMevfnNm98aa1utaZS53eDuWfgg== X-Gm-Message-State: AOJu0YzYois/TsvxG5dFPj3jTBCXzaMnV39IEg3qzjS2xvtrc+BRUnUI q49ksPNDOZjTQOD/rjHMCFgOfmCtYwGH7p/MLElQ3c8kc9jl1vHK X-Received: by 2002:a05:6512:1317:b0:512:f59e:f425 with SMTP id x23-20020a056512131700b00512f59ef425mr7507569lfu.10.1709051276022; Tue, 27 Feb 2024 08:27:56 -0800 (PST) Received: from [192.168.1.105] ([178.176.72.204]) by smtp.gmail.com with ESMTPSA id v15-20020a056512096f00b005129994f013sm1236235lft.184.2024.02.27.08.27.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 08:27:55 -0800 (PST) From: Sergei Shtylyov Subject: Re: [PATCH v3 4/8] usb: cdns3-ti: support reset-on-resume behavior To: =?UTF-8?Q?Th=c3=a9o_Lebrun?= , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: Thomas Petazzoni , =?UTF-8?Q?Gr=c3=a9gory_Clement?= , Kevin Hilman , Alan Stern , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240223-j7200-usb-suspend-v3-0-b41c9893a130@bootlin.com> <20240223-j7200-usb-suspend-v3-4-b41c9893a130@bootlin.com> Message-ID: <20c29fee-691d-686c-83c9-578e15b5ba79@gmail.com> Date: Tue, 27 Feb 2024 19:27:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 2/26/24 1:13 PM, Théo Lebrun wrote: [...] >>> Add match data support, with one boolean to indicate whether the >>> hardware resets after a system-wide suspend. If hardware resets, we >>> force execute ->runtime_resume() at system-wide resume to run the >>> hardware init sequence. >>> >>> No compatible exploits this functionality, just yet. >>> >>> Signed-off-by: Théo Lebrun >>> --- >>> drivers/usb/cdns3/cdns3-ti.c | 27 +++++++++++++++++++++++++++ >>> 1 file changed, 27 insertions(+) >>> >>> diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c >>> index 4c8a557e6a6f..f76327566798 100644 >>> --- a/drivers/usb/cdns3/cdns3-ti.c >>> +++ b/drivers/usb/cdns3/cdns3-ti.c >> [...] >>> @@ -220,8 +226,29 @@ static int cdns_ti_runtime_resume(struct device *dev) >>> return 0; >>> } >>> >>> +static int cdns_ti_suspend(struct device *dev) >>> +{ >>> + struct cdns_ti *data = dev_get_drvdata(dev); >>> + >>> + if (data->match_data && data->match_data->reset_on_resume) >>> + return pm_runtime_force_suspend(dev); >>> + else >> >> Pointless *else* after *return*... > > Indeed! I used this form explicitely as it reads nicely: "if reset on > reset, force suspend, else do nothing". It also prevents the error of s/reset/resume/ here? :-) > adding behavior below the if-statement without seeing that it won't > apply to both cases. You were going to add stuff after the final *return*? :-) > If you do believe it would make the code better I'll happily change it > for the next revision, I do not mind. Up to you! This is a thing people usually complain about when reviewing patches. I even thought checkpatch.pl would complain as well, but it didn't... :-) > Thanks for the review Sergey! > > -- > Théo Lebrun, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com MBR, Swrgey