Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3284498imu; Fri, 18 Jan 2019 07:51:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN6EXeF/43e+MqB1cxrgoK4adxFFELExst2LrwfQyUPJEpj+Lz5mE6YNZ7/H4ARRh1SBtfd2 X-Received: by 2002:a63:8742:: with SMTP id i63mr18007110pge.298.1547826697828; Fri, 18 Jan 2019 07:51:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547826697; cv=none; d=google.com; s=arc-20160816; b=SbtvSid9v9932zwtBX5Q12Uw9lBQY/JgXxFBIx5Lfj669K1fip85dj1v5BTuk/mr3A RqQObKCpbTnRuNgBsJnUyWaYSsrRdahMgMhsq1608Dqq8r3IP9Mp+8GHFL5AuBkXUvQS n3zkQM8ZjhlwnWBB6UKs1tkCOG/W/X6WCK032D3mvD6wAFLvQNvACnnm/ddX37hS+jr0 3CD+RTxX7TCTmLWOStiKuFEgu5SnT9funPh25twTS1IyswzZyioBIBJw7+LcX5MtkJBX EMtUubqlcj33soHOBPhiV+hZevnXu14O00EZxt4TZncb0bsjw6ZW62IJpQihLf4I85pL /nSw== 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; bh=CD96uWmROKUFzbdSXe5V7Fv17KN+GB/PL+MHX099nxk=; b=0BEG6RofquWbO7Hu3otXlPPHjwUn+2Ge1m3NXvC2iKl3WFkc1/4TZFwgcHSiuRC9Gu EILisaQVV6hhnT+AXMkOayaX1HHENlzzYwtPiYJWxS25z3Ibk+ljWsSfw8nOuPzVH9kG R4lj+1gP0+JYIxAi5NxYHcsoajgOBqT6iqQzKThZbgueHNCrw7hxCdmlhirz4L5w1Eof UaxtdaEG7EI/ujdByAcoM90Dtei6A7A+d4Wlur47Osngq/SQwCX3UZF6C+CZDaX8sMfe DJQDMiYT2T4PMfXfNbw+j87RAkIhO4/3MF39j1BvOwJTMVQ2ZccenozOPF8jvB4+Xo2E YSaA== 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 bc3si4693120plb.130.2019.01.18.07.51.19; Fri, 18 Jan 2019 07:51:37 -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 S1727795AbfARPtj (ORCPT + 99 others); Fri, 18 Jan 2019 10:49:39 -0500 Received: from muru.com ([72.249.23.125]:34218 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbfARPtj (ORCPT ); Fri, 18 Jan 2019 10:49:39 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 10E758120; Fri, 18 Jan 2019 15:49:44 +0000 (UTC) Date: Fri, 18 Jan 2019 07:49:34 -0800 From: Tony Lindgren To: Kalle Valo Cc: Anders Roxell , Ulf Hansson , 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 Subject: Re: [PATCH V2] wlcore: sdio: Fixup power on/off sequence Message-ID: <20190118154934.GW5544@atomide.com> References: <20190116113723.15668-1-ulf.hansson@linaro.org> <20190116154311.GP5544@atomide.com> <877ef2ou3p.fsf@kamboji.qca.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877ef2ou3p.fsf@kamboji.qca.qualcomm.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kalle Valo [190118 15:37]: > Anders Roxell writes: > > > 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. > > So what's the conclusion, can I take this patch? I see that this didn't > help with Jan but as Tony and Anders provided positive test results I'm > inclined to take this now and Jan's problem can be fixed with another > patch. Do everyone agree? Sounds good to me, seems like there is another separate issue lurking around somewhere. Regards, Tony