From patchwork Sun Jan 5 12:21:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 216744 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8782DC33C99 for ; Sun, 5 Jan 2020 12:22:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49362217F4 for ; Sun, 5 Jan 2020 12:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578226978; bh=OGXgsGDlwpdWuGBpEYpGlHDlCkOw+rP9Fx37Op5a4a8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CtaVTb+GohiMrlZRR6Hhk2fCfrVrxwt8Vji7IhG0qt66iVOKqVup0Yu6mLKI2m4sk PjEtCrL4q6fAYeDDwAhlj9kf+QtQBVDHDGnZ9TKFBX+bqCr8rkda7Y8bgqCdTzJIlN pq/b7l6RDF7Lc2AWlVGTaQNQsxZDAFiBnGcsA0Dk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbgAEMW5 (ORCPT ); Sun, 5 Jan 2020 07:22:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:47360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbgAEMW5 (ORCPT ); Sun, 5 Jan 2020 07:22:57 -0500 Received: from new-host-5.station (net-2-42-61-77.cust.vodafonedsl.it [2.42.61.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6A1AE215A4; Sun, 5 Jan 2020 12:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578226976; bh=OGXgsGDlwpdWuGBpEYpGlHDlCkOw+rP9Fx37Op5a4a8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rNuxG7qvaiSHcVxkGGyRfN/A31pilz2xwSQC6ub28nNn153RJuRRmymwQFq9dh7ez TIEm5Udm4tYe2GvDSJr2ByxtEEOWvdRckA0RucYerbERAVQQ7m46z9GK8mZ5/uNyMI PoZ/FhL3ftVIRJQUrGuUt2k1H94Z1DL75hK33kAo= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, Sean.Wang@mediatek.com Subject: [PATCH v2 12/18] mt76: mt76u: resume all rx queue in mt76u_resume_rx Date: Sun, 5 Jan 2020 13:21:50 +0100 Message-Id: X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Resume all possible rx queues after suspend. This is a preliminary patch to support mt7663u devices Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/usb.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index f80380c674a1..d85268c6df70 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -680,13 +680,24 @@ EXPORT_SYMBOL_GPL(mt76u_stop_rx); int mt76u_resume_rx(struct mt76_dev *dev) { - struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN]; - int i; + struct mt76_queue *q; + int i, j, err; - for (i = 0; i < q->ndesc; i++) - usb_unpoison_urb(q->entry[i].urb); + for (i = 0; i < __MT_RXQ_MAX; i++) { + q = &dev->q_rx[i]; - return mt76u_submit_rx_buffers(dev, MT_RXQ_MAIN); + if (!q->ndesc) + continue; + + for (j = 0; j < q->ndesc; j++) + usb_unpoison_urb(q->entry[j].urb); + + err = mt76u_submit_rx_buffers(dev, i); + if (err < 0) + return err; + } + + return 0; } EXPORT_SYMBOL_GPL(mt76u_resume_rx);