Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1217266rbb; Mon, 26 Feb 2024 02:30:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWEERemEVkJQ3RzGbIJmLvRWIpRABDfHONw+2tUHxEKCNo88DXoaUR0UCzTzykY86vGVRI77frhE2J4d7xPdBZxisx3PqLGxMnDg4+RUg== X-Google-Smtp-Source: AGHT+IE+5nusJoJLILbV1MRGGSFOkJaXaL7AX3XnXr89x9A+lZ4+KAVN5W98diQMcOqFZZnDNCBZ X-Received: by 2002:aa7:c0cf:0:b0:565:ef7a:15b2 with SMTP id j15-20020aa7c0cf000000b00565ef7a15b2mr1497291edp.9.1708943401223; Mon, 26 Feb 2024 02:30:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708943401; cv=pass; d=google.com; s=arc-20160816; b=XzR6Ydm9n+ehTZ1CsHeYhtpAJs6wtAF73djCFO0MyxvMq89ZXmCqiuHIDqpS7TGNf2 RGjgDNAzRy2QoCEKV4A9uBFxFjcfy+bPsYPI2vojtNbq6DZa83nHWN7wnJyytyfKhEP1 6dlNO753xcnW5tpIWN/56dBCnn/JmnyV3SvRNB6x1CaNe6FWpSJ/t/in5Nm7D/QbqpfO Xa/vd/Z90RPIvbhHRk6hN9ahYpqb7kdKKRRiSbb7PxN4nkdGkoGqv05x5lNva5bgcSS5 pkjrWxRgE10xY54leoI89DuXrvEMhOMEd6J5t8wiGESrzdBZPzOxVP0IcRkPuN2fHb+F wDjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:cc:subject:from:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=LpmeEW2KPcAcnRm7IcTOCA1adY+H9eQbBF8a76zUX6A=; fh=9/uPw6MLQQ4fIvZov8GWrp8uQ/ybwX5iKb7t/5O1SZw=; b=IgsJGRm5MUpnr5mI1oJvTUbjJ+DdGly+RFk3DBkSahE5/0FTNBDoPDYPbfFLl9rekl RTRwQ9F4slXOvQDFMZRHhP7n8+vzfja7f9sOK6UNIUUMG6qAxSqd73EgWyQak/4DiT31 O9QITGamcscawow9PtcB2u5VG4BmCJeKh2EsEU7jOlgTgNUdPzjxo9aQrZAA2GNd8N71 vTjaUBJCD1Hvob3sYnhcMgGaXWfyoJwJ2ShKDCxOXjK3GqrNikHqo1zzT1sbgieivUSE om196QNSxE8TCR/IDcgqdEkVBQhxTI2c3GxR9DhYSO3I75sZKBSmn5yom5yGBpejp/TE U/iA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=oeLVSXrQ; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-81139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q20-20020a50cc94000000b005640b40a448si1865769edi.657.2024.02.26.02.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:30:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=oeLVSXrQ; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-81139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0CB431F28395 for ; Mon, 26 Feb 2024 10:29:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FAEE5DF2F; Mon, 26 Feb 2024 10:13:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="oeLVSXrQ" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B95F95D90F; Mon, 26 Feb 2024 10:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708942428; cv=none; b=TdwlDiuGJv+stVs8NKPi8pZx9v8T0AsPQ5/w6p6kEP+pmyX0kI+Ci5xLtkhVtsj92meSFf+YyXtkrLvWHTYb88BCTEp5fQZvhMLsWZVwpfNyNjEdrAlUZ3BFTnqwD5hVXynAJg8iAUKgD+4jY4VsWlwk/Effmpnu3Zm6JMwd0Uk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708942428; c=relaxed/simple; bh=B3YjOE5PYheV7HjsnV+dA52LtrK2wRs5zzXZdAO4pdg=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=F4AWDHTd5OxFxe94I7yTzhFVj1HP0hric0idBKAXBL3nrgFjEOd1zL+UmGs78jGSOOYWdSeQIDJlmcWz5q+oXEM99pdTXXvwGGG+IrBaMcu0TMPORhUc1wyFEFor8rUFmeKAxfxy/Q5Ptu5LIOCIEGhpZNJ9QkDz0+z7PqruV9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=oeLVSXrQ; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 927CDFF80A; Mon, 26 Feb 2024 10:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708942418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LpmeEW2KPcAcnRm7IcTOCA1adY+H9eQbBF8a76zUX6A=; b=oeLVSXrQr6IIzClrt1tDu/K6oB8jB3gPpSrBVvhAw2j/KeY9Hx5gNwc/9oiM2b4C+VjOgC hv3cbSLvBTO8qLMhNd+CYQUjf26yK5wic4Q/FpJbUi66lNVR5/Lc9gFW3OLKCJAKKYGgTx uTQ4Q+33Wg5WY8xGJ7E8qYy6xTHVgS7gbmfRFmUtpUFhMswU0Cex+tAu2CTGaEfh8vCRZo nJbuk0HrQirievwIPJRntrdd7GuLa/WzdXRm4srSNLymiga5lsGP/dDFk8lQOqUkY3nOqF Ur+42OQ45ic6IG32xDfH0H6m0bPti8gyXwvLvs9CBC25fZxnjjTfk49xiABOrg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 26 Feb 2024 11:13:36 +0100 Message-Id: From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH v3 4/8] usb: cdns3-ti: support reset-on-resume behavior Cc: "Thomas Petazzoni" , =?utf-8?q?Gr=C3=A9gory_Clement?= , "Kevin Hilman" , "Alan Stern" , , , , To: "Sergei Shtylyov" , "Greg Kroah-Hartman" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Roger Quadros" , "Peter Chen" , "Pawel Laszczak" , "Nishanth Menon" , "Vignesh Raghavendra" , "Tero Kristo" X-Mailer: aerc 0.15.2 References: <20240223-j7200-usb-suspend-v3-0-b41c9893a130@bootlin.com> <20240223-j7200-usb-suspend-v3-4-b41c9893a130@bootlin.com> In-Reply-To: X-GND-Sasl: theo.lebrun@bootlin.com Hello Sergey, On Sat Feb 24, 2024 at 10:08 AM CET, Sergei Shtylyov wrote: > On 2/23/24 7:05 PM, Th=C3=A9o 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. > >=20 > > No compatible exploits this functionality, just yet. > >=20 > > Signed-off-by: Th=C3=A9o Lebrun > > --- > > drivers/usb/cdns3/cdns3-ti.c | 27 +++++++++++++++++++++++++++ > > 1 file changed, 27 insertions(+) > >=20 > > 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 *d= ev) > > return 0; > > } > > =20 > > +static int cdns_ti_suspend(struct device *dev) > > +{ > > + struct cdns_ti *data =3D 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 adding behavior below the if-statement without seeing that it won't apply to both cases. If you do believe it would make the code better I'll happily change it for the next revision, I do not mind. Thanks for the review Sergey! -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com