Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3237567imu; Fri, 18 Jan 2019 07:07:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7wYnpi5kcQleCCiejXnIMAZ3+wAIwkAnBhGs1aghFAixlrM5bTa/607hHymvJXTjZQs8Kv X-Received: by 2002:a62:d885:: with SMTP id e127mr19602335pfg.197.1547824077581; Fri, 18 Jan 2019 07:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547824077; cv=none; d=google.com; s=arc-20160816; b=hHX+M8Q9GaOfAuNhej89QVlxe04mHtRncy+7tvQ0RlA81OCZcd6W49lYN/yHG4oVlF Kcv6MbBBDqfFx2L4QmdUFGhUCOK/8VYr5OgkDlabY6xbLAghWe2z0ERIzAK+8G/ONNpd BJoXB0qhT1kxUE41CVpSi/B6Kbx3+qEML8PjS13mL7Va1K//EaHYmY55RoM802n30HuP g0O3VyOJjvUH92iKRm5jy4cB4KGT5CH6/kNEecu/+iVgUkwC9bkiCMvVKD1TMALLG2Mp R3RCA2U7sAdEtZX4xX+/VleleHnHaPVnrGX1FcYtkK1nijg0qPo6r9f5O0vTf7s/ihRc 9+eg== 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=m+JIDFKXyEotGis6+4coVIxtbcNzy1N6Mp6UKUpr4gY=; b=oKHydUeap2iN8ga1YU/gax6hV1eh691JqnrQzvvVQSeLc7rg6fWpXxL8uzWShblCnL PU1R0qHbTUnOJTd0JNIDirMo+xzwK67tma9ILS0All3UJCqB38uriYCHuRl/fAiAd1Qh uVF45qwjfBmjLRlg7AAA3nuJcdm/iZu3U5JjrmYeHBrnkaiCcWuCednYgm7VFQ/RzYg7 tzFHc7+PNGL7TDZvzI0gQSVC1wFgtk1qxzj5IeQSgrPtYatCCzoUkq5GOSnVX4Fjq2kV bujFqeLRk17A6Esd8M83a5SQzCZPeXI2GeKURF3wjNC9fP1fRO0YCB+QSxSHLTpQPlwV Du0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jwk7Y2mz; 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 p12si4831928pgj.56.2019.01.18.07.07.38; Fri, 18 Jan 2019 07:07:57 -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=Jwk7Y2mz; 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 S1727777AbfARPFi (ORCPT + 99 others); Fri, 18 Jan 2019 10:05:38 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:42766 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbfARPFi (ORCPT ); Fri, 18 Jan 2019 10:05:38 -0500 Received: by mail-yb1-f194.google.com with SMTP id q145so4442350ybq.9 for ; Fri, 18 Jan 2019 07:05:37 -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=m+JIDFKXyEotGis6+4coVIxtbcNzy1N6Mp6UKUpr4gY=; b=Jwk7Y2mzgYm0CH3bkavaHIHrFrH8VDS6o45o03ukqIRRk2xztttSIOD5MkDqOaFgJT THGuBRgJYvgZCHpwQ3fmJQ1pETpbx4n0dlfqvz9zxX0Uw4ZadlBAYeEmOSfyYZC4KoIL vmGIvYHbPUmDmGCpts8tgzAUQYfI978Ox3Qr0= 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=m+JIDFKXyEotGis6+4coVIxtbcNzy1N6Mp6UKUpr4gY=; b=rNQYG2mnQV8uSsQOFg5EoE29Avar2EoUUk1bfT/PDApi8kgMlcerEtDeV6+xW+sfq5 9NTq4LnIRq5O1DTIwFR2B6v48911du9kBmwZWOVpTUVf1To+gfSxnkj3C/de7pj8hQbw C7SHdyde11O82csPo8H+Ou5RFQU6LbYAjgAWf0b6YhDtK2GPTxdmoBqutipVm9gSm9TB JyYD5WjyJ6m/QkfvShK7XWEtqoBfYimIUl6ZDUZRdViCheDFZSS41WgXQocNGyTZJ7/V YHqcnDavc2fpwUTutEf8wpj2XvW6YCU2LPGyLrxPkUb7+AatxtbKfkFg28h8vVlmqYkn rgQA== X-Gm-Message-State: AJcUukfumGmA3FOCUD7SWj60HrtgFP+ncmh6oIBtlfooTguRXEyC6hW6 DLPVxKwCRctoipUhoIK52+P80S/lS2wVGOQaE6eJzw== X-Received: by 2002:a25:7008:: with SMTP id l8mr6621103ybc.270.1547823936592; Fri, 18 Jan 2019 07:05:36 -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: Anders Roxell Date: Fri, 18 Jan 2019 16:05:25 +0100 Message-ID: Subject: Re: [PATCH V2] wlcore: sdio: Fixup power on/off sequence To: Tony Lindgren Cc: Ulf Hansson , Kalle Valo , Eyal Reizer , linux-wireless@vger.kernel.org, Ricardo Salveti , Kishon Vijay Abraham I , John Stultz , Jan Kiszka , Linux Kernel Mailing List , linux-omap@vger.kernel.org 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 Tested-by: Anders Roxell I tested it on a hikey-6220, and it worked. Cheers, Anders