Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp11167926ybl; Fri, 27 Dec 2019 08:56:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxz5KP1cPOYX7Dr8csBrSHmPDzmDi5EPP+h+uBfUd3LNGDBt+3jOcEs34y+KvWLUKEYJDvD X-Received: by 2002:a9d:6d06:: with SMTP id o6mr58321856otp.239.1577465805670; Fri, 27 Dec 2019 08:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577465805; cv=none; d=google.com; s=arc-20160816; b=BRn2J+0Bu9FgcUFebcAOwxgdEkcGT6zKY+LeJDhPmEbpTQ1tUb1bDwbP26/EuZwGlJ eSf9PmuWcdkOoh9Mj0scsCbZ9v489IwF0Cp1ogWbXQU4c1WXn0eE2E4LUAc2z+oD0Bq9 jJvLEakSJwOKF23yD+FIOvYyixWb+KzpHnDrXDjfuN40eGy1y7Lc5GGJPUuVVGIFdu3g yQIRry6f4JT5WEyGSNXdgYy3/V7+B/R1Hp53tBMbDLOJuwW0Sy6ci/huP4rNLWd5S+dH Kwu+R3IryLLRBRYcpzUatJDVUBs7+1RyFDRI0ZF1hoa0FVCPvHjWSbTZtXU2sMv01bNn zB3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4nsIk431IJE2Vk4G5K7I24soUyvvlcDR7eoVO3tZXDI=; b=v9+DvhiqVFxVYRvsBy/eBIAxQoxdEQnqEThNClwrymHUy1VQpOYFY92jRGC4Woc0M5 EJzaHscbA/mdEuYGjOYU16+/lXWrM9iiP7wZoynRUboerBiwWZkujTrdmqn9I+5fYYdG 4CC2ZgWO96cEeijCzR4GThJLce7U3rs94VlqxO3RHvQCqVhun/KK5oLsuYAd89MF0mxl Dm0Bx53G1Ua3vpRkaTlWe5pOxYRiWqMnYvZzmM8vh/GxEgUdWtl8ab3HXpPrYhWajyEo 9hOfaeySzjQ65IyPQDJPVTRicF6hAotWhDMNK7tFqfjcfgdJIh4zOsyz9qT+Tssr2vY6 K+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WhCmF3lf; 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 i10si18772287otk.195.2019.12.27.08.56.34; Fri, 27 Dec 2019 08:56:45 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WhCmF3lf; 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 S1727011AbfL0Qzr (ORCPT + 99 others); Fri, 27 Dec 2019 11:55:47 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39083 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfL0Qzq (ORCPT ); Fri, 27 Dec 2019 11:55:46 -0500 Received: by mail-pf1-f195.google.com with SMTP id q10so14969297pfs.6; Fri, 27 Dec 2019 08:55:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4nsIk431IJE2Vk4G5K7I24soUyvvlcDR7eoVO3tZXDI=; b=WhCmF3lfXiFeaDgdh8Zc4no994MMyy7RRNjNO3kp4sQAtoEC8jvl4bViEffarZPS8Q OyGs55rjGjxyd98MBtFtV3PT+fNXmJS1V6Decc/gOiUrMGsGss+QjIRRV239f0cilRg5 tj/DC2EocfQvI9tfDYIzou/z6PgqvIBnysYOA1FQmgiB+eT6uWITC0O9qtgXynTQKyhy tSinIq4wBl4o0ntM7G2w7AFfH98LNAd67r5jUx29l8zoFUSrgrK+32dhYpVg9YXAHGW0 /4a0TrPFLvwK4TE7mAJmdwglD3EpKpZ/qaV836dbxYAX1JlbvMQtwo4gTCFC2rJL1+Rc PS5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=4nsIk431IJE2Vk4G5K7I24soUyvvlcDR7eoVO3tZXDI=; b=ZMVN+j6RZcdlIOQ9N9iK5nrvQj9Ig5UHOFJmqUxyjXILLW3rAKfMfEigftq6jnQf9K pFG5xqAfUm5zGS0/2jW2YjAYNr09kjekF7xHwxaX0xVm0mLVMdUvlvCpfXX29YR7DGk2 5wJSQzgw4SfP+fxfu/dTFLQmJ4Dm3f4ZYtO7Dj1GBU1h2VSV0PWu5wOWUW3io3ZxMAs+ pD7OEPfHkVbHVPWupOhxUwSWlDyg4VfjwuhlGP4OzOI85Ey1AQSadJb7gTLTQqgO+laR iKLsaXTKITYjGPdqOjvRoxYO7J3LTyhaDGOlCct931dprbcWa/+dZQChQEZETdF5f/Fj iH+g== X-Gm-Message-State: APjAAAXF17Iw8rBisfugdELBoa6rU/hahu4cbAVhXB6BL53TEONDiJ2W bRAgPi5vFqZUZier3i6t9D0= X-Received: by 2002:aa7:86d4:: with SMTP id h20mr51240296pfo.232.1577465745925; Fri, 27 Dec 2019 08:55:45 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id i23sm20166129pfo.11.2019.12.27.08.55.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Dec 2019 08:55:45 -0800 (PST) Date: Fri, 27 Dec 2019 08:55:43 -0800 From: Guenter Roeck To: Alan Stern Cc: Peter Chen , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Grzeschik , stable@vger.kernel.org Subject: Re: [PATCH] usb: chipidea: host: Disable port power only if previously enabled Message-ID: <20191227165543.GA15950@roeck-us.net> References: <20191226155754.25451-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 26, 2019 at 02:46:15PM -0500, Alan Stern wrote: > 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. > That is what I would have assumed, but test code shows that it doesn't happen. > 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 usb_hub_set_port_power() operates on a port of the hub. hub_activate() operates on the hub itself, or at least I think it does. I don't know how to convert the calls. Also, there are more calls to hub_power_on() in the same function. Can you provide more details on what to do, or even better a patch for me to test ? Thanks, Guenter > 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 >