Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7744834ybi; Mon, 22 Jul 2019 19:52:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyD3d4WY6oSjsyJsf2PulQ9zxYkho+YVsDQFHV3EghDeZySArJmcfmWbgo0gG7nvYPgUveR X-Received: by 2002:a63:1765:: with SMTP id 37mr5381715pgx.447.1563850354693; Mon, 22 Jul 2019 19:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563850354; cv=none; d=google.com; s=arc-20160816; b=q1Q0FFhg9zUzmTdSld2qRY1uQ5Z2RYVK9VsvU6yx5m6ckiO3ZvvHOfcmmivv8Aes3+ sZ8qFHB9nTvGx1W8itNrl5EoyRlD8abdfA2RTZnT1wdTDOxGYGKu1BVEMVgqvLnWBUBI zdI3geTUv0RPtKLeKIeF6uvd6N9MCGZp+m6+Pepmx5eNw5VAZnrvttNHTjVCIGkWteyx 4XYXo2TqNsbXjd0varezK5kmwvlEXoLsFUhst5g9dDCLRuIZTa1ze6cGCuRlEwIhcsw0 ZVy1i0iXY7cbR7G8JYRfyH1+eCGK+Pm845SyZ+tno0UfKceACzY6SaGjQLwC60m6DtE7 hyJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ATbFy1aIdbWHFM03S3oai17NaO/neBJFfQYViTxrNMs=; b=Npoywlf0hlegQqZpiJnUiIgs1myS4nxnKkE+HypcqmgqSEIYwLfWzWG0eepZ9l3ilc YWerA8xPt8sf+e7CZBCeODrB5p431ugXGN4sB3kAJvkBuYMaigBA6/lEHgJVUZXoqpa+ q9IBvPMIAbQWqfG8qMAz9pANwPy70uagG7JaEbgpY8c0eMKJlALw3LYCv93s0SqYdehw bkQn7NOyep6avm7JRHui/leUb/yPDXob3/KobHlsycSbL6lk5Tkp/KtsOMdh5JUa+N1I 8GVdRMXvLxvWGhc/ExPbk5MpFPybcMUI/qOj5uvGrYlTJxmq/nobdBpzZkY2Igz/tB0p acbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fLXr6gDQ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si41710074pgj.54.2019.07.22.19.52.19; Mon, 22 Jul 2019 19:52:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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=@chromium.org header.s=google header.b=fLXr6gDQ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732271AbfGVTlg (ORCPT + 99 others); Mon, 22 Jul 2019 15:41:36 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35603 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732270AbfGVTlc (ORCPT ); Mon, 22 Jul 2019 15:41:32 -0400 Received: by mail-pg1-f196.google.com with SMTP id s1so11839233pgr.2 for ; Mon, 22 Jul 2019 12:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ATbFy1aIdbWHFM03S3oai17NaO/neBJFfQYViTxrNMs=; b=fLXr6gDQl11kx/gfLPu/pKAYQ3oWpeGmz6q8QFeSzDdvzyBV3Jixq5ya13oHO5dqfo Nt5xcerqY4a9O3JWvuPb94Tyrayne1SI5T6+UGeut3CsFAKBfhZw9yU7Q5/RHukXvoYY cqcqRPZNeTl+YDf2PzrHdCfdrC3TgIUq6fJSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ATbFy1aIdbWHFM03S3oai17NaO/neBJFfQYViTxrNMs=; b=fQDprq/XpPJZxoOkbB+cttbV2yMF9S2JXlwgchNGvORqA1dyMfu4jcd+qQZrZvBbWl vkKLedjCkKE3agPRPctKS1+bwud0figoi7K9ITRWW/kSQ2dd6KOWsdB1osA6NtdXFZhe l4aCQKxUlrRG9XCPxPxeeoVdgUrmX96+ceiVDiV2DTJ0GxcL6Obk+vjM/pjvZvB1gDd3 9eFbazIeRkvi4+d3nhMIiAjp8jq5hV0euujkslLGJf8cFcfkK0xA21FDJYY3xcS/RNli CDPnLRuynFG88DbpWhLXj5F0nMwllqlW84Wv+JxK1t0Js+kI51BVCs+GvprbOA7MA/Hw lUvQ== X-Gm-Message-State: APjAAAU90JIGlMoakFOiucQ63ND9ivywU20giTpuxyKB9PiOANz+iYS8 g8LDUFnDzrhilKVTMoHhGJyMag== X-Received: by 2002:a17:90a:ba93:: with SMTP id t19mr77532204pjr.139.1563824491627; Mon, 22 Jul 2019 12:41:31 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id z4sm29838803pgp.80.2019.07.22.12.41.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 12:41:31 -0700 (PDT) From: Douglas Anderson To: Ulf Hansson , Kalle Valo , Adrian Hunter Cc: Ganapathi Bhat , linux-wireless@vger.kernel.org, Andreas Fenkart , Brian Norris , Amitkumar Karwar , linux-rockchip@lists.infradead.org, Wolfram Sang , Nishant Sarmukadam , netdev@vger.kernel.org, Avri Altman , linux-mmc@vger.kernel.org, davem@davemloft.net, Xinming Hu , Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] mwifiex: Make use of the new sdio_trigger_replug() API to reset Date: Mon, 22 Jul 2019 12:39:39 -0700 Message-Id: <20190722193939.125578-3-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog In-Reply-To: <20190722193939.125578-1-dianders@chromium.org> References: <20190722193939.125578-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As described in the patch ("mmc: core: Add sdio_trigger_replug() API"), the current mwifiex_sdio_card_reset() is broken in the cases where we're running Bluetooth on a second SDIO func on the same card as WiFi. The problem goes away if we just use the sdio_trigger_replug() API call. NOTE: Even though with this new solution there is less of a reason to do our work from a workqueue (the unplug / plug mechanism we're using is possible for a human to perform at any time so the stack is supposed to handle it without it needing to be called from a special context), we still need a workqueue because the Marvell reset function could called from a context where sleeping is invalid and thus we can't claim the host. One example is Marvell's wakeup_timer_fn(). Cc: Andreas Fenkart Cc: Brian Norris Fixes: b4336a282db8 ("mwifiex: sdio: reset adapter using mmc_hw_reset") Signed-off-by: Douglas Anderson Reviewed-by: Brian Norris --- Changes in v2: - Removed clear_bit() calls and old comment (Brian Norris). - Explicit CC of Andreas Fenkart. - Explicit CC of Brian Norris. - Add "Fixes" pointing at the commit Brian talked about. - Add Brian's Reviewed-by tag. drivers/net/wireless/marvell/mwifiex/sdio.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index 24c041dad9f6..7ec5068f6ffd 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -2218,24 +2218,10 @@ static void mwifiex_sdio_card_reset_work(struct mwifiex_adapter *adapter) { struct sdio_mmc_card *card = adapter->card; struct sdio_func *func = card->func; - int ret; - - mwifiex_shutdown_sw(adapter); - /* power cycle the adapter */ sdio_claim_host(func); - mmc_hw_reset(func->card->host); + sdio_trigger_replug(func); sdio_release_host(func); - - /* Previous save_adapter won't be valid after this. We will cancel - * pending work requests. - */ - clear_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP, &card->work_flags); - clear_bit(MWIFIEX_IFACE_WORK_CARD_RESET, &card->work_flags); - - ret = mwifiex_reinit_sw(adapter); - if (ret) - dev_err(&func->dev, "reinit failed: %d\n", ret); } /* This function read/write firmware */ -- 2.22.0.657.g960e92d24f-goog