Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10150943ybl; Thu, 26 Dec 2019 11:47:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyfq5/4XOJYVdNKVyCs4DMPzym6TTW73f/0QLj+sM+9QnKhATsCg2XNQT+z4+9ndusIuaOP X-Received: by 2002:a9d:7b4a:: with SMTP id f10mr54856608oto.4.1577389629302; Thu, 26 Dec 2019 11:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577389629; cv=none; d=google.com; s=arc-20160816; b=udpSwTgdBBRWSiekXWkuzzThDhYdAONL4sXAYsEUWvM42Tvi2MUK3ZH1TDFvYtdAHO Nw5xUkJF88pkskfQ6D/ux2XP8VoOT7YrYaNcfKj8QnV6rnQb8FFrUGRxv8hZp3gZql0L Wl+XH3GmEgvZIt1kIIp6mO9liR16Ex1jysk9NyQU6sZuoxzdaHuKYs7J2+xGSwhw74Z/ P8fPGAFAK4XMa+vbj43Y930rWvtiupMbIo/tcay7M7FEo9ay7AEw3SjxHFX0VMo5NJpL ZwWSe/UlHxrecL9pVXbcMvzAm9sx6OEu8iv4Czcz2XN1Zbx7B2g7f4I2rNtYB4Xdz8xs wt7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=c6N9gqVx4uaNZaX1eV99Co7I/voYWZtXS8VwLXOMlwI=; b=emcgGkuAOBdxlRm7elfTEcIc8SsLImQPs1mu4zXp53H/UqYmsrtj9LTE7wymQPKT03 neSEA8aRUJnzDawKjfw/lZ/4c5yFQ9CgB4TbnaNoLZ+gIPUbrL6rJzK5IjwLK3B78TFg yPekhy6yQ1pEdCNjc96QbVtXwRfCfFYt/fQmHPHsKS5LOE85wSxLi9qg6cBRAvUQyT3h f7c3kHg6OC1RHBcOvXrvT7C3eNPsT1kfcH2xKdm1B+kXWTjTyPuA1vbgER39CPa4qvuB xsvCVK1wYQppoJPoYTolF+fSqHobefLTARl7oPuY3reFRnD6/GJdqzI9PFyjwrg1Icwi ySTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si4192188oil.96.2019.12.26.11.46.56; Thu, 26 Dec 2019 11:47:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbfLZTqQ (ORCPT + 99 others); Thu, 26 Dec 2019 14:46:16 -0500 Received: from netrider.rowland.org ([192.131.102.5]:38007 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726752AbfLZTqQ (ORCPT ); Thu, 26 Dec 2019 14:46:16 -0500 Received: (qmail 7099 invoked by uid 500); 26 Dec 2019 14:46:15 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 26 Dec 2019 14:46:15 -0500 Date: Thu, 26 Dec 2019 14:46:15 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Guenter Roeck cc: Peter Chen , Greg Kroah-Hartman , , , Michael Grzeschik , Subject: Re: [PATCH] usb: chipidea: host: Disable port power only if previously enabled In-Reply-To: <20191226155754.25451-1-linux@roeck-us.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Dec 2019, Guenter Roeck wrote: > On shutdown, ehci_power_off() is called unconditionally to power off > each port, even if it was never called to power on the port. > For chipidea, this results in a call to ehci_ci_portpower() with a request > to power off ports even if the port was never powered on. > This results in the following warning from the regulator code. That's weird -- we should always power-on every port during hub initialization. It looks like there's a bug in hub.c:hub_activate(): The line under HUB_INIT which calls hub_power_on() should call usb_hub_set_port_power() instead. In fact, the comment near the start of hub_power_on() is wrong. It says "Enable power on each port", but in fact it only enables power for ports that had been powered-on previously (i.e., the port's bit in hub->power_bits was set). Apparently this got messed up in commit ad493e5e5805 ("usb: add usb port auto power off mechanism"). Now, the chipidea driver may still need to be updated, because ehci_turn_off_all_ports() will still be called during shutdown and it will try to power-down all ports, even those which are already powered down (for example, because the port is suspended). Alan Stern