From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B4CDC433F5 for ; Mon, 6 Dec 2021 00:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zjpwOtg4UXAjXDrQbC0Mxa+w8u4Nlxx2+NUPnXROEzg=; b=msVmRSfRVHPn61 xOsqMslILFRZNTvhjLQMObKGLn09dSrpcwUdAOl2INSGI9lBebQzFO5mp+Y5pAMH8rfZGitGt83mt 1W1leWF9g4HkqctZK0fltGRrmGKCIhtGm30N+GOviJeBajhlLVHKkSDinKbrKxzwD3WVm36e5tcP3 +jltU4DbhGpJ/cggaLcY1N8kUxOtv7IagGSmXndkQUfaKo232Z2/BqPuPKubz3nCyGpMO6gkMxTgW ZJ6ezGRGG1CMR/ess7h6wjAKdER+GN1WNzzFzwDz7ExhkHgtyoStudKgeSIOPZ7hRmi1/tRUA0iNo 1X58+kAMU+jc2T2z256Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mu1cV-002DNf-Vi; Mon, 06 Dec 2021 00:12:40 +0000 Received: from gate.crashing.org ([63.228.1.57]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mu1cR-002DMv-EZ for linux-arm-kernel@lists.infradead.org; Mon, 06 Dec 2021 00:12:37 +0000 Received: from ip6-localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 1B608gtt022162; Sun, 5 Dec 2021 18:08:44 -0600 Message-ID: <07472b315d6adecb874f29128e9b5fe3eadad590.camel@kernel.crashing.org> Subject: Re: [PATCH 2/3] usb: aspeed-vhub: support remote wakeup feature From: Benjamin Herrenschmidt To: Neal Liu , Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Cai Huoqing , Tao Ren , Julia Lawall , kernel test robot , Sasha Levin , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" Cc: BMC-SW Date: Mon, 06 Dec 2021 11:08:42 +1100 In-Reply-To: References: <20211126110954.2677627-1-neal_liu@aspeedtech.com> <20211126110954.2677627-3-neal_liu@aspeedtech.com> <279c42970790787e928ed017149e300835085235.camel@kernel.crashing.org> <5d234a400a89f64ad183020b93b68f478f1addc7.camel@kernel.crashing.org> User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211205_161235_677167_9BC77967 X-CRM114-Status: GOOD ( 16.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 2021-12-02 at 03:03 +0000, Neal Liu wrote: > > > Let's me describe more details for our hardware behavior and hope you > understand. > > HUB00[3]: MANUAL_REMOTE_WAKEUP > HUB00[4]: AUTO_REMOTE_WAKEUP > > Set HUB00[3] implies USB device will do remote wakeup if any write > command to vhub register. > Set HUB00[4] implies USB device will do remote wakeup. It can only be > set in suspend state. > > For current design, d->wakeup_en only controls whether HUB00[4] can > be set through usb_gadget_ops.wakeup(). > If some applications (take KVM as example) want to wakeup host by > sending a packet, it won't go through sb_gadget_ops.wakeup(). > We enable HUB00[3] to fix this problem. It won't override above > mentioned behavior. > If host has enabled the USB_DEVICE_REMOTE_WAKEUP feature, it has 2 > ways to wakeup host. > 1. set srp 1 (/sys/device/platform/xxxxxxxxx/udc/xxxxxx/srp) > 2. emulated device has activity > If host has disabled the USB_DEVICE_REMOTE_WAKEUP feature, these 2 > ways still cannot wakeup host even if USB bus is in resume state. > Thanks So what you are saying is that currently, the various gadgets aren't calling usb_gadget_wakeup() ? Ie. it should be a gadget policy to decide when to wake-up I suppose, but it's true that nothing in the core nor the existing gadgets seem to handle that. I think what you propose is a band-aid. The real problem is that the gadget drivers should trigger wakeups (or the core should do so on activity). That said, for now, I don't object to adding that "auto" bit, but I would prefer if that behaviour was use configurable. Cheers, Ben. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel