All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: nbd@nbd.name
Cc: linux-wireless@vger.kernel.org, rosenp@gmail.com, sgruszka@redhat.com
Subject: [RFC 4/4] mt76: usb: introduce disable_usb_sg parameter
Date: Tue, 15 Jan 2019 13:33:45 +0100	[thread overview]
Message-ID: <99a03acbc5ba45920b3ec08083d2533c1e114baf.1547549771.git.lorenzo.bianconi@redhat.com> (raw)
In-Reply-To: <cover.1547549771.git.lorenzo.bianconi@redhat.com>

Add disable_usb_sg module parameter to disable scatter-gather on demand

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 drivers/net/wireless/mediatek/mt76/usb.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index 491b17756ccd..0b056f04630f 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -22,6 +22,10 @@
 #define MT_VEND_REQ_MAX_RETRY	10
 #define MT_VEND_REQ_TOUT_MS	300
 
+static bool disable_usb_sg;
+module_param_named(disable_usb_sg, disable_usb_sg, bool, 0644);
+MODULE_PARM_DESC(disable_usb_sg, "Disable usb scatter-gather support");
+
 /* should be called with usb_ctrl_mtx locked */
 static int __mt76u_vendor_request(struct mt76_dev *dev, u8 req,
 				  u8 req_type, u16 val, u16 offset,
@@ -246,7 +250,7 @@ static bool mt76u_check_sg(struct mt76_dev *dev)
 	struct usb_interface *intf = to_usb_interface(dev->dev);
 	struct usb_device *udev = interface_to_usbdev(intf);
 
-	return (udev->bus->sg_tablesize > 0 &&
+	return (!disable_usb_sg && udev->bus->sg_tablesize > 0 &&
 		(udev->bus->no_sg_constraint ||
 		 udev->speed == USB_SPEED_WIRELESS));
 }
-- 
2.20.1


  parent reply	other threads:[~2019-01-15 12:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 12:33 [RFC 0/4] do not use sg if not properly supported by usb controller Lorenzo Bianconi
2019-01-15 12:33 ` [RFC 1/4] mt76: usb: move mt76u_check_sg in usb.c Lorenzo Bianconi
2019-01-15 12:33 ` [RFC 2/4] mt76: usb: do not use sg buffer for fw upload Lorenzo Bianconi
2019-01-15 12:33 ` [RFC 3/4] mt76: usb: use a linear buffer for tx/rx datapath if sg is not supported Lorenzo Bianconi
2019-01-15 12:33 ` Lorenzo Bianconi [this message]
2019-01-15 15:35 ` [RFC 0/4] do not use sg if not properly supported by usb controller Stanislaw Gruszka
2019-01-15 15:47   ` Lorenzo Bianconi
2019-01-16 11:19     ` Stanislaw Gruszka
2019-01-16 11:44       ` Lorenzo Bianconi
2019-01-16 12:21         ` Stanislaw Gruszka
2019-01-16 13:40           ` Lorenzo Bianconi
2019-01-16 14:39             ` Stanislaw Gruszka
2019-01-16 17:16               ` Lorenzo Bianconi
2019-01-16 17:40     ` Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99a03acbc5ba45920b3ec08083d2533c1e114baf.1547549771.git.lorenzo.bianconi@redhat.com \
    --to=lorenzo.bianconi@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=rosenp@gmail.com \
    --cc=sgruszka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.