Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6584646rwp; Tue, 18 Jul 2023 02:46:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlGwH1sRFvMRy4YMpjn4mBex37t9anw/omhKK94F5TgNgMpSLeEucxpg8QJQlIV2IqqxMly1 X-Received: by 2002:a17:90a:ae09:b0:263:4157:66de with SMTP id t9-20020a17090aae0900b00263415766demr9153027pjq.42.1689673612066; Tue, 18 Jul 2023 02:46:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689673612; cv=pass; d=google.com; s=arc-20160816; b=XCzZC5SSE8YnHTFTK0Lw2vVa6fhLtZRpdZ71Qo6128KSWB8HsJQUTNUIhGhP/KgRCz 6KPbgtCAugIa52KkTj7wjsjRaqV2EH3ZlD8bW4yaub9YdAXTMkFo+ziSkT+JhLyCVnyE pnuAbAumzRSOUN/BcT4U6I5E9GpWww1Yb1aeq58f+og30GjnQo73CGvYINod+kVc/6hA kwIRyYCkFDBGGAPnJfhax9IN20cnsdV3ZscC04kBiQssOgGC0S9CFHyI3Vq3PJNYAjo7 uzTz1t49/yog2N9coh0y0owSkVfOIPKsGFceyzyINGDCLUBkEjHRdjEQixkMIDLfoU6T 0ihg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=WUe1b4S0uxlwZ5d3lOzfuxr1mcvOmnmxba5lpfAu/SI=; fh=x4o0bvQTYpMHu/Kws+1Pl+Ng5IG5nUGlb/h2IuTHTjw=; b=ld9DcPogf88Xz15F1iDczVodg+Iz+a9ruw1NNl8FnrpaPu1dr2ugb/BDcHUktM6HVQ 3xEQeZncpFLaTm3wgsikSD6dSvTo3Z/XxzxCcYKgivIjfdVGx3M9fFbIe5XaX/B04bf1 kRwI9jDVEHmgqmSKa+gnrsu2hleVfvO9vh2OUOp7AZPRFs50UK+baL35Pz5bELDfQo3d WtqxrWvYX/fszlhV/zxj/ACjdh7Vmy7jPStGoP2VV/lmqVftszDO7NHYCUtyuh7j0Gqe BDMDdrulsRNbj6aNIx1lmzIEnh2vD7m8WFixzwIoM2jGDZMbU9u1yjYAag7EyTAgglKe CT6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b="Tm/nJX+W"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mq2-20020a17090b380200b0025bcf85bda2si1478269pjb.7.2023.07.18.02.46.35; Tue, 18 Jul 2023 02:46:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b="Tm/nJX+W"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231180AbjGRJTW (ORCPT + 99 others); Tue, 18 Jul 2023 05:19:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232496AbjGRJSe (ORCPT ); Tue, 18 Jul 2023 05:18:34 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2075.outbound.protection.outlook.com [40.107.8.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29A7F172A; Tue, 18 Jul 2023 02:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ESJJR3QOtY2KdKXoI4aFs98eKheoPd/E5qE0idIRXdlX2UgjefPofuryn0paEd9EFAtppzdw34/n/xk6UzeXyPp7za+ZGwZPzL3v1MkJy6CUDE+8ZEIGc2l37fZwf/kFUt9XWSPKDCu6J8oxdNPGO0OLC92dEEs3hQxmb5pYElj11k9/PlLC+dj15Wnjr74XucLkb+whstDD4VOCRojXAANkJWTXT9eyOVCc/V9dUJe6Ab4+51e57B6HIadMbMrNysViFXgn/GxE9ncnpjRKEzXgntDUmQrEX0q4R4IskOwXKGd3Cxo09lKdWrxQ5GjK2BtOxDfJBM5QJECVAwdZlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WUe1b4S0uxlwZ5d3lOzfuxr1mcvOmnmxba5lpfAu/SI=; b=FWgzz0FrbzHl93GQmIoCbUoMl6sb9SOc32DlKcmtftQOOhspFGheg/YGgwZgHtTaZWp2iy910jCSM6fLNR3yVnyT1fyka7AwCXf14LlaORcTAyhg3dOqjd4EQog5TPuV90vGLimQlB8jANaTyMIc3V4MXnDGR38eYskrfR62MxpE5/bZD4yhPEmOAKHChxSbRjP8pc83nih7bTzhincDBiaEzsIUFoghxTfL3sZx5U0gKbYcaKeiCnKTuWW9DuBrc+jjG5o+gRfl4XoLqZ6ta5CKRlE8oBMklcz+lmp3K68YtgOuurdcMlG0R2uOgSjxAkQ6QbDYCTyczY6Bv/a1pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WUe1b4S0uxlwZ5d3lOzfuxr1mcvOmnmxba5lpfAu/SI=; b=Tm/nJX+WiPXaP+QylaOZtNWnk1LOM1em6738drYTNo9XnoXx9bZzCF90dk3xaNMMbG2LdjaxBfFgTmmQ9lOaDP/rjEazOJ8wANDqsxg3PTM4M53IkQH7xrltHzibVOIOridhCZ3Zg3mr33VPKstEmL+A+emNGK5Ot3Wa0lJIS2a+rhydPBtYb0mtI2b0FeeimrRpsDBXMUXEaYF2iuWmK/1KwKEEJeGp/zBpRt6VInemQ5mRlXThWuWp2QlsaNfdVwHc8VW5+0Zra6HN+SVzCj2VVa9dUQIf2uuQf4kSB0QLMwZo16V4aZdu7jX/Guh9h+10JYiUKY0foc0YWKktXw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB7104.eurprd04.prod.outlook.com (2603:10a6:800:126::9) by AM8PR04MB7764.eurprd04.prod.outlook.com (2603:10a6:20b:244::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul 2023 09:18:29 +0000 Received: from VI1PR04MB7104.eurprd04.prod.outlook.com ([fe80::7ef4:97ef:66d5:f5b3]) by VI1PR04MB7104.eurprd04.prod.outlook.com ([fe80::7ef4:97ef:66d5:f5b3%2]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023 09:18:29 +0000 Message-ID: <525bc794-b797-9a53-7f59-debcfca9edd8@suse.com> Date: Tue, 18 Jul 2023 11:18:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2] usb: xhci: tegra: Add shutdown callback for Tegra XUSB Content-Language: en-US To: Haotien Hsu , Mathias Nyman , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wayne Chang , JC Kuo , WK Tsai , Henry Lin References: <20230718091425.307589-1-haotienh@nvidia.com> From: Oliver Neukum In-Reply-To: <20230718091425.307589-1-haotienh@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::20) To VI1PR04MB7104.eurprd04.prod.outlook.com (2603:10a6:800:126::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB7104:EE_|AM8PR04MB7764:EE_ X-MS-Office365-Filtering-Correlation-Id: a1010adc-bc6d-4c3a-0753-08db876ff2c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fdI3Fwjij+hCXhXJnVf6DN6P4AnjCkY8bqZ2nPpRGoGRqXiLGHMm/nn4i1fV+U5nvLYsFhlfOsanI6evLs4/5u0cd8CXyADPS4X+Uod2+zF/kXMF0/42h/jreJnikTNXPw9TRAWFVWndFQsAMJgfn6OoGdMIwmgU1qL371Z3VO1w7Xn5tnpofPpirQja10sVr3tYr/H+fgTIPWLsBBqkMzGU3QAtv4dn2UjcLDaKK+o2wlSKO+3QD/lOcHbDiEQLqN9+VhN5m/hyE7ETglJrcsAN3wAb4tyJEElcSav9uCiue9TVxJp78nC1CEnIll1sGbAeQ0vwb4dTpTxoYJzq1VsiYtWR09ExHgrxg3U9n6D18o/7ILjFHEzgCFboZt1vA1iTlITaXhZnWMdMsLhq+RQH9A3RJr/z/E7+OP97fPMRlk/qI3fn1oYPqiIhPg6DoS+pn5OEuNUq89WWTkv4HCq/oLhKcNCHCHFtLr7NldvB9fWbxnpZQOay9DIw1GqWXOa6v7+RR95JiB1lAqPO23cndWLyqySBXUqnRrkZZU8o28Be75BXy5O+qzuYROvWi5XgV5FTr7kCXiPVf8qb1ptg+6rwQqxA6lpmFSk7nuW/7lXCp4Nju1UpBBZxOzMg/zfCxy0U8t5EbGKuxhLIGw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB7104.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(366004)(136003)(396003)(451199021)(6486002)(53546011)(6506007)(36756003)(86362001)(2616005)(83380400001)(31696002)(38100700002)(186003)(6512007)(54906003)(8676002)(8936002)(2906002)(41300700001)(478600001)(4326008)(316002)(7416002)(66476007)(5660300002)(66946007)(66556008)(31686004)(6666004)(110136005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZklYSU1JNlpxR3FHd2VTbDl1bFhLUGFqT2w4UWcwYzRLYkY5QTNKZ2o5Slow?= =?utf-8?B?OTZzSDV0T1NlTkR6UWgzSkUxS3JuRWNNeithRzVod21rZG9pbkkwdXVUWXoz?= =?utf-8?B?ekhNOHlDYStjT1NlUnkzUk5ETEtkZTJJeGZObDFBT1JNa0JlMzlDdDBVNlNO?= =?utf-8?B?YkdGblVNVXlmcS9vSlZKTFdZbC9Ba0RpaVRReTlVUXpMcHZoczF4MWpTdFdF?= =?utf-8?B?bmFUcGczYmxWOGVkVzBEMzFzV21CT2FsVFZmUUNJZmoyc1ptWHFLVnIwUEkx?= =?utf-8?B?eGNaU1h6dWpEVnAva2gwckQxVTlmZllKYndCOVludnlqdVFLOG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aVl0cWkvRGo1T2dvbDRCTHRpdGRYK3lMdzE2U2p1Si84dnprKy8z?= =?utf-8?Q?DSywGBd0E4Ji1YUIJEQXcSM=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1010adc-bc6d-4c3a-0753-08db876ff2c2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB7104.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:18:28.8661 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /3U4iBQXIl0/QMY4v0K0syKto5C8jYBvMdLsNQYV6jU4TlG4YEtJF6S3YYLu85PDnfy551WGNQnl40XJ2gXzPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7764 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.07.23 11:14, Haotien Hsu wrote: > From: Henry Lin > > If memory accesses by the Tegra XUSB controller are translated through > the SMMU (System MMU), the hardware may continue accessing memory even > after the SMMU translations have been disabled during the shutdown > process and this can in turn cause unpredictable crashes. > Fix this by adding a shutdown implementation that ensures the hardware > is turned off during system reboot or shutdown. > > Signed-off-by: Henry Lin > Signed-off-by: Haotien Hsu > Acked-by: Thierry Reding > > --- > V1 -> V2: Resend for the typo in the mailing list > --- > drivers/usb/host/xhci-tegra.c | 28 +++++++++++++++++++++------- > 1 file changed, 21 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c > index a56cc81b9404..6ef2eac9835d 100644 > --- a/drivers/usb/host/xhci-tegra.c > +++ b/drivers/usb/host/xhci-tegra.c > @@ -1925,6 +1925,15 @@ static int tegra_xusb_probe(struct platform_device *pdev) > return err; > } > > +static void tegra_xusb_disable(struct tegra_xusb *tegra) > +{ > + tegra_xusb_powergate_partitions(tegra); > + tegra_xusb_powerdomain_remove(tegra->dev, tegra); > + tegra_xusb_phy_disable(tegra); > + tegra_xusb_clk_disable(tegra); > + regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies); > +} > + > static int tegra_xusb_remove(struct platform_device *pdev) > { > struct tegra_xusb *tegra = platform_get_drvdata(pdev); > @@ -1947,18 +1956,22 @@ static int tegra_xusb_remove(struct platform_device *pdev) > > pm_runtime_put(&pdev->dev); > > - tegra_xusb_powergate_partitions(tegra); > - > - tegra_xusb_powerdomain_remove(&pdev->dev, tegra); > - > - tegra_xusb_phy_disable(tegra); > - tegra_xusb_clk_disable(tegra); > - regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies); > + tegra_xusb_disable(tegra); > tegra_xusb_padctl_put(tegra->padctl); > > return 0; > } > > +static void tegra_xusb_shutdown(struct platform_device *pdev) > +{ > + struct tegra_xusb *tegra = platform_get_drvdata(pdev); > + > + pm_runtime_get_sync(&pdev->dev); Where is this balanced? Regards Oliver