Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp307903rbb; Sat, 24 Feb 2024 01:09:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWRDe7T115yFvbEKSOzKmiVhCVXDxml7psOQgLc0c9gTUFDPSnA8MbHdeXqI+YBJ5Jf5jPJZG6JxpIojcas25542ts4N+WeGZcuLI/CeA== X-Google-Smtp-Source: AGHT+IFIDqPoHOmFcj+Hsbl7LXaI8dAFf+vYOMCQNoLVty1J2tPivA4vSg1u7Aek+M53NKiTG0hw X-Received: by 2002:a17:903:2443:b0:1dc:16:9000 with SMTP id l3-20020a170903244300b001dc00169000mr2571302pls.16.1708765759303; Sat, 24 Feb 2024 01:09:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708765759; cv=pass; d=google.com; s=arc-20160816; b=d4/LGCMZurUpK0pPszJRr/wK4QhwQkCLzU179qgkoGud9cmz4OsktNBZ2Z/bwnC+xl Nrj/T8Vd0Vel59iBl0NMTef6SVW4T95FxRuRVQYR9Vx8rAZFiwzPL8mCXW2ThiHi7SLN ynW7/6ogmFgWn9ENbfyJdE2k1EKez+v35wiC6E3Gvl82z4cterW1rIN6Ri7+oQBIN546 flnwp80Oqs1Ty3+8abSvQGZtWYYUKfD7tESbB4Su7OcDdxvGBbuoMDH7JmqIRvFe6r0r 7XrizikHYevyvE6tqUJ2M/oP6pF16S0okXNapxLze50zmJO7+Fg7Bfa2k0wb6QGRA4UE PGqQ== 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:from:references:cc:to:subject:dkim-signature; bh=He0fBSHHPtIHZTRjcYmDZndFACrI+q2AezJo3cfp+yQ=; fh=SddzLF+lEl9vCQ92zZGLqKPNwL7kDhQ23ICysy2HvRI=; b=iIY0K1SbuOqXRehp3J1jeutGCq/YPa+orzv2twh5RBKvPokBTK5fnYtFAEgOsSYo5S s4pPhGpRNk83J8iRvbhYG68PjR+eNp27MqeaRLufCjN94FCj0z8mw0QeFw2SWPnlyl+a N0Zcp0rWxtx9kU2NST3UvilOyBDH18UwTh1fIB7X9Zv8ciKbAH7cDCPsk6XlClxrKkOv NMTOlQcBNx2m3/PO3aexhR0rdxXcVifRLLim1gVO05fuze/yofdw5dXvHwhfdIkqxYxJ vWiLuYV2bpGAAjDdG3p1jeEfb3IfTV03CtG6l8e8PxGSps+cO54OK1iY+TJsUdGhk1jv Y+LQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="ax7/KRhK"; 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-79532-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79532-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x6-20020a170902ec8600b001dc4bba386esi568042plg.229.2024.02.24.01.09.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 01:09:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79532-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="ax7/KRhK"; 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-79532-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79532-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 05D1528338F for ; Sat, 24 Feb 2024 09:09:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3207318EB0; Sat, 24 Feb 2024 09:09:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ax7/KRhK" Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 9E72F1400B; Sat, 24 Feb 2024 09:09:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708765747; cv=none; b=RdxsKLX8KTh5Gdu8YNkNsI4ot92AESnBI7gwjiD2PzSSNO7bA8Q7Y9uRk0zQWXFDDpJTUYThsotuPMXx57LzW7HJe535G29tPn2kcJxSNya6k5DmxKzypq0eCvsofXCiZgRpOCs6E80qwZOBAsOXIvz8OGkgFA0mvVL2U/fzLK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708765747; c=relaxed/simple; bh=Q1oMbEw0NLdRkWu0F9h/Gc9Oz5SC4qKZQNvZFGmheI4=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=Bi4MChQEMEPTPwVMh44NQTKoJZshIsUpCRh9cVDMMLJMxDIAKW1PYCb6hWiHXreAVRMibdyEbzK/beCzZ7OnZoMOqDjN2W86Twf9pgYeC0r49pZ0EzjSsFBLUDkksmvEAX4QyOzZRPUl94ks9k84DkTT/AuDa452zyBiaWiYb/w= 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=ax7/KRhK; arc=none smtp.client-ip=209.85.167.43 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-f43.google.com with SMTP id 2adb3069b0e04-512be9194b7so1322840e87.1; Sat, 24 Feb 2024 01:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708765744; x=1709370544; darn=vger.kernel.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=He0fBSHHPtIHZTRjcYmDZndFACrI+q2AezJo3cfp+yQ=; b=ax7/KRhKL3JgVJSwwIHubvQJ9Z65+f/O1lQFyxK+LYyol0UGNHayOCgcBgFKI8i0At qoUcF2OldmBRU7dTHhNHKfoJqnaWPT68x2Up6ydfHYx+tFQRvrT5Roa5Q2el/3bhA0Vv 1bruFcpj1bbu5RhM0rSXuulOQVqF7dH1AULv/I50iBrnKxj5wdmtISP2jw0KogbnxkXI iLBkcMlREsXLM8BTsSdA7/z0FLVidI+3LyKJXGTytAS5ltFslnBBVfmlPy1Cl41vFfF3 t0KgWr1Ja92GvcxT3us7WlT+9QZrso/pl2eujBvI3qxT8Qq94qutIJDGxtdm/ppVnr8c sOUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708765744; x=1709370544; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=He0fBSHHPtIHZTRjcYmDZndFACrI+q2AezJo3cfp+yQ=; b=ezT/HyB7G7N2OLvDnOE3JhGUHH7PQQpjF6MFH5+OvBJJqeORuUJTXzKjW3UiSkEkiY ey6cc6wnAXaZyzmzSqdj4O3m3QNo5oVmAGAaW6WFynrVJhnUEhB+azuYTPXGq59pPDAk KIqcLssZGhUZf8P5xodlnjsH4tDwviBFonX8vY91mRV61Stg6rB3nKSCy51I5f/DM1gu wE9FyDSHl6h2lKToNKAtcxhmHkTdlA9mwGVDy9Xn36I0li6Hw0ekL6Gu2LlcI1kHB/UE 6dlaNZRHChG79wQLFfN9yLw2UFBwSjx/xUKOBw800qq9kqXnsCeT7gY6yspFiWsdBXOE daPA== X-Forwarded-Encrypted: i=1; AJvYcCV0k75IB8Y2GEjXpg8wiHl+Jh08VmJtLSBG4e+woAxOVh97wpGXY1RaoKnhyWu0sCKSiIE8zym2Y3JworlsZOnzSKp4i78M2zlnux89jZ7t2jwRoktHGjetXX8S0ZU5YsuuTiysnW3tRYObivYxESAklpNPgxJ2lmWTAjnwRGhUXO1J4g== X-Gm-Message-State: AOJu0YweNdF4qQy0c6robwjRQi0zqE1f34qypayen4DvpgK5yQ5VEO6q V+A5B7oJ67oCmsd64T6KtnWn48WrpriBUNdm1XHcQkl6uTpulny1 X-Received: by 2002:a19:f710:0:b0:512:bd51:a0ea with SMTP id z16-20020a19f710000000b00512bd51a0eamr1115299lfe.9.1708765743390; Sat, 24 Feb 2024 01:09:03 -0800 (PST) Received: from [192.168.1.105] ([178.176.74.19]) by smtp.gmail.com with ESMTPSA id t30-20020a195f1e000000b005118e37462asm144768lfb.89.2024.02.24.01.09.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Feb 2024 01:09:02 -0800 (PST) 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> From: Sergei Shtylyov Message-ID: Date: Sat, 24 Feb 2024 12:08:58 +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: <20240223-j7200-usb-suspend-v3-4-b41c9893a130@bootlin.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 2/23/24 7:05 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*... > + return 0; > +} > + > +static int cdns_ti_resume(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_resume(dev); > + else Here as well... > + return 0; > +} > + > static const struct dev_pm_ops cdns_ti_pm_ops = { > RUNTIME_PM_OPS(NULL, cdns_ti_runtime_resume, NULL) > + SYSTEM_SLEEP_PM_OPS(cdns_ti_suspend, cdns_ti_resume) > }; > > static const struct of_device_id cdns_ti_of_match[] = { MBR, Sergey