Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1496813imu; Wed, 16 Jan 2019 21:25:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7b2zG6jV/d9B4nF6BKLGV8g4/qxjRm4q00kQfdJY6xYfUXH9DpAZkAy9fkHtf6WFJkCg29 X-Received: by 2002:a17:902:142:: with SMTP id 60mr13976308plb.330.1547702738443; Wed, 16 Jan 2019 21:25:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547702738; cv=none; d=google.com; s=arc-20160816; b=0lSCO/tv7r3iFZwAqpXr1Ftsk/RzMCPqT2F8Id9eRkGaT5KaWa72XeXwIzLnq6Wk15 wfkAsCCDcLmVFpJSZ/NlyQ9/P61qiRb8oD+z/tG+RlUDQpokRvd6fSgtLvMkR0CvfdrL +pyL1HdVwgnaSPLDwj6gp0dJn5bkQG+Bs9vUTt7I5nEc5HzQccLcEcTat3r+ZFFAxojq JBRbI4aSyEpb79DiRbgaX/1wvCYyTCluvmjDYY0fl1BhuO+J21ROXaK/5yA5/A0gymOh jaOGSZRJxI35S+hZhML8tUaDDO10mkP5bBvjEcjX2aXwwEF6nx6LiUhsRG8TqHlM40xa +yFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+0LKnHhEAo1Zg5SyA+dBZ+txrenPWIeLyQvrzPfqWUI=; b=SfNy1Q7PXWG8LXAEt4nHRadrY3vo0+RAHE3SDt9LFfHHyn0wSt6zsAUMdHNUpUgf4B L85sYQkbSp/YOZtzCOQud6ch2AzhVbWt1yh7412TN0ijHlEgpPSoEst1ZwHfY2B0wbkQ /9UYY2SfSQg6cpmEw6Sq0zok3nBWXdv6HyujlGIwpM7OvFUCFb3jBudj21igX4Ysokxv Sc1jJd+vb338s2h/nvHDoFX6XBxQQ0ZXXHcyXNlV/IQtubnvNpeTlqFIPWEEV5SoUwii Yb2B3r4y/kXTTz0kfj/8v9JjVrccb7VpMMRe2aa4VkMp8YiJHDBPwfiuXGrehCzQy2Ex GMmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EZw8P00p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si557981pgh.469.2019.01.16.21.25.21; Wed, 16 Jan 2019 21:25:38 -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=pass header.i=@linaro.org header.s=google header.b=EZw8P00p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405061AbfAPPtT (ORCPT + 99 others); Wed, 16 Jan 2019 10:49:19 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:35783 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405040AbfAPPtS (ORCPT ); Wed, 16 Jan 2019 10:49:18 -0500 Received: by mail-vs1-f67.google.com with SMTP id e7so4202761vsc.2 for ; Wed, 16 Jan 2019 07:49:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+0LKnHhEAo1Zg5SyA+dBZ+txrenPWIeLyQvrzPfqWUI=; b=EZw8P00px9kBeqe/8GFdu+UQBh7+Z0kbo7UrXB9JBsirPlAvWLtxtrcM+iM0Fvvjon LwYes8BWmNVildhrob8KdHcd3Lpp4iZ8kc9iJMpAEqz2h+Dh78IgUYHUNUhZyoAkzLB+ tkOaqSmMdXMmHp8G7Mp0ug54FMytzYdLnM1CY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+0LKnHhEAo1Zg5SyA+dBZ+txrenPWIeLyQvrzPfqWUI=; b=EsXFdEf+TMMx7FSpkWRp+BMozNb0+Js0dVywLgeeEubO5e7u2j2qkyetbxJEbiSAtA DdelE56RmaMBZf4S2Aom8pJPa8URQu9ryvGSKkBb8m7p+KyNs9QncK4aGi1bnORSV3Hp 2qi0qk5oYtejrOGzwtagzF/AfDvhQpVy1ski87F004VWKqxMnakc6L0xhVSxuFYXcbRR jRTMUYY1L3JiQQLkHBDfFE/+B5t3yakxza74elrQ/NORBJ+w/XB7R2AeaWVDDOVr31y7 rl3IksUhmfRD83hV+W29rdjkbub6fjG9tUM19dUm9uSP4uLNV89nOulD9+El8UxNH5WD yo4A== X-Gm-Message-State: AJcUukdHxTI4vEr9CYCnxl579FojCvU/aBM9yc9DJJ00LLydNA+cKLO7 8Rv0Gg9SRYmRXlMwvk9qj+DxxgwKvz8jKHPHDVHw9Q== X-Received: by 2002:a67:74c2:: with SMTP id p185mr4203543vsc.34.1547653756405; Wed, 16 Jan 2019 07:49:16 -0800 (PST) MIME-Version: 1.0 References: <20190116113723.15668-1-ulf.hansson@linaro.org> <20190116154311.GP5544@atomide.com> In-Reply-To: <20190116154311.GP5544@atomide.com> From: Ulf Hansson Date: Wed, 16 Jan 2019 16:48:40 +0100 Message-ID: Subject: Re: [PATCH V2] wlcore: sdio: Fixup power on/off sequence To: Tony Lindgren , Kalle Valo Cc: Eyal Reizer , linux-wireless@vger.kernel.org, Ricardo Salveti , Kishon Vijay Abraham I , Anders Roxell , John Stultz , Jan Kiszka , Linux Kernel Mailing List , linux-omap Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Jan 2019 at 16:43, Tony Lindgren wrote: > > * Ulf Hansson [190116 11:37]: > > During "wlan-up", we are programming the FW into the WiFi-chip. However, > > re-programming the FW doesn't work, unless a power cycle of the WiFi-chip > > is made in-between the programmings. > > > > To conform to this requirement and to fix the regression in a simple way, > > let's start by allowing that the SDIO card (WiFi-chip) may stay powered on > > (runtime resumed) when wl12xx_sdio_power_off() returns. The intent with the > > current code is to treat this scenario as an error, but unfortunate this > > doesn't work as expected, so let's fix this. > > > > The other part is to guarantee that a power cycle of the SDIO card has been > > completed when wl12xx_sdio_power_on() returns, as to allow the FW > > programming to succeed. However, relying solely on runtime PM to deal with > > this isn't sufficient. For example, userspace may prevent runtime suspend > > via sysfs for the device that represents the SDIO card, leading to that the > > mmc core also keeps it powered on. For this reason, let's instead do a > > brute force power cycle in wl12xx_sdio_power_on(). > > > > Fixes: 728a9dc61f13 ("wlcore: sdio: Fix flakey SDIO runtime PM handling") > > Signed-off-by: Ulf Hansson > > --- > > > > Changes in v2: > > - Keep the SDIO host claimed when calling mmc_hw_reset(). > > - Add a fixes tag. > > This v2 version works for me as tested with: > > # while [ 1 ]; do ifconfig wlan0 down; ifconfig wlan0 up; done > [ 181.364990] wlcore: down > [ 182.116424] wlcore: firmware booted (Rev 6.3.10.0.141) > [ 182.151641] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready > [ 182.166778] wlcore: down > [ 182.773132] wlcore: firmware booted (Rev 6.3.10.0.141) > [ 182.811096] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready > ... > > Thanks for fixing this issue properly, and feel free to add: > > Tested-by: Tony Lindgren Thanks for testing, great news! Before queuing this as fix, let's also see what the Hikey folkz thinks of this. I have pinged Anders and he is currently running a test suite. Kalle, can you please tag this for stable as well? Kind regards Uffe