Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1607934iof; Tue, 7 Jun 2022 08:33:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz64dsX9jgVXgbTCgJYXx701nTivnzqN3Ihkwn0PanlHIawRJnPNPsGzwnNlpnmKABvMGC7 X-Received: by 2002:a17:907:8688:b0:707:926e:ea44 with SMTP id qa8-20020a170907868800b00707926eea44mr27861350ejc.547.1654616012866; Tue, 07 Jun 2022 08:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654616012; cv=none; d=google.com; s=arc-20160816; b=LCxYbrXVYj4qrHLCmELecNeNjCVO64Au/exCHS7AOlZ5pY6uQG6SLXPYEzwWSJL0lx KnXmHWMx9RMz6xp2tfEJDCr000mrKaKnM1nirRBw6qqZVF5VXCcnRn63QgG0lPJMVxaV PJzykOLu1OTmN+ub/EKvvCIQxrzQnKjRnE/TIMfVFGHZ1feBRwnHU/Uv8CLk5BiVjKNx Jouio4eLNkB8wIF0DtgEysBKPrgFuahHO+UeQHNIC+Q8Foj0Xe3zwF2kqROURJWEiSNg JNOaIsDnjQuW6WuvGToxMG8BYD0o1GXzXJ5nNI6qe/NcOftuVe0KYO9F6Tbb8gF9AKvA Gndw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fPpKe80ctcThH5fl1xZ8sANftXGkfw6/Zbevf2vwn4E=; b=EG0CsMALp//eU/Gdm5Gv9LFXiKKAzKX6pvLNH9SqaIXzYzokimwSKecMuQdl9Il+Yl yYLhAORLZ/gOxoStcTu0veKhCyRW57UW5WPvNePHB/Ct1rnzcKZTy2vYnchB1CH+dXGa s1VksKcFDx0kbK/eZRyD4B13nINNlsrqCwat/RdnX4zV32jg9vG/d6YxbfQO81xPurYW UpqgeMnzL4tt7AvAYb3VnKvhPHwdG0sz7NXadWMV8MbKdLWl2/I0727YKpO8DRNOyR48 1ZmKvy269wCYBeji7sg7IqZh5L7mGHRXfFJndKZZLtTec3n8s70nqshwubaIrEs3e96B TKCQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr12-20020a170907720c00b006fea9b7120bsi770624ejc.763.2022.06.07.08.33.05; Tue, 07 Jun 2022 08:33:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243398AbiFGNWO (ORCPT + 99 others); Tue, 7 Jun 2022 09:22:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244565AbiFGNWL (ORCPT ); Tue, 7 Jun 2022 09:22:11 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 8163E273 for ; Tue, 7 Jun 2022 06:22:09 -0700 (PDT) Received: (qmail 402115 invoked by uid 1000); 7 Jun 2022 09:22:08 -0400 Date: Tue, 7 Jun 2022 09:22:08 -0400 From: Alan Stern To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Cc: Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: host: ohci-at91: add support to enter suspend using SMC Message-ID: References: <20220606141802.165252-1-clement.leger@bootlin.com> <20220607090759.3fc0b003@fixe.home> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220607090759.3fc0b003@fixe.home> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, Jun 07, 2022 at 09:07:59AM +0200, Cl?ment L?ger wrote: > Le Mon, 6 Jun 2022 14:12:52 -0400, > Alan Stern a ?crit : > > > On Mon, Jun 06, 2022 at 04:18:02PM +0200, Cl?ment L?ger wrote: > > > When Linux is running under OP-TEE, the SFR is set as secured and thus > > > the AT91_OHCIICR_USB_SUSPEND register isn't accessible. Add a SMC to > > > do the appropriate call to suspend the controller. > > > The SMC id is fetched from the device-tree property > > > "microchip,suspend-smc-id". if present, then the syscon regmap is not > > > used to enter suspend and a SMC is issued. > > > > > > Signed-off-by: Cl?ment L?ger > > > --- > > > > Acked-by: Alan Stern > > > > However, this is a little weird... You've written > > usb_hcd_at91_probe() so that the SMC is detected in preference to the > > regmap, but then you wrote ohci_at91_port_suspend() so that the regmap > > is used in preference to the SMC. It's not wrong, but it is confusing > > to read. > > > > Do you want to rewrite the patch to make the two routines agree on which > > mechanism to use by default? > > > > Alan Stern > > Hi Alan, > > I'll rewrite that ! I did it in this specific order in the probe to > allow overloading the device-tree with a SMC ID without removing the > syscon property. This way, the regmap stays the default if no > "microchip,suspend-smc-id" property is provided. > > Does it sounds good to you ? Sure. Just make ohci_at91_port_suspend() try to use the SMC first, and then use the regmap only if the SMC ID hasn't been set. Alan Stern