Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3587081pxu; Mon, 30 Nov 2020 06:22:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJy71rNbNTmmcZmqte70NikFVlBWIFBj1gOVU9yx2NomtH1wYTbWyCzZ2HTx+YJCAYM2KaPu X-Received: by 2002:a17:906:4881:: with SMTP id v1mr20141722ejq.465.1606746126121; Mon, 30 Nov 2020 06:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606746126; cv=none; d=google.com; s=arc-20160816; b=ifW+gDLyW2VTfHsxB8jR28CLVPCaqOh0q0vSlPtdlVQ/oVnLTFpdNNjOJWfd+UWQqS MVVqTS3+Idf1Xzud7Hdd1jJEULB4oDO82i2gX9LM3F+v52r8VTOwA4Y2xMP/uC0/gF/g 8BZ2ZiWGhYTTTTU12ZSQzMJWQ5wODp6GD73cR9PoWmvscxj/Z+ypuy7i8QM79akvbxZx kjIJWw0Lwu+mkYTWjV+NzlpqWyHV0NOEcDA9tczwo1kntbhKXlEbuiPJJTC9PiPFpEhb rL7OJ7KRzUdC/rlMvaZY5/YbYsQDh8tLiFvt09JbBnEZlLc4Mp7Aq+17PtYhXNSryET+ uTfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id:cc:date:in-reply-to :from:subject:mime-version; bh=Bb3mvjPi9ulB8NX17QHm/MV5Nrxh10EsIYO0ZmslowI=; b=CsclA6ntkrZBTmWi3/gZkrGW103tkLeD3fdASIa6GeZ33yFZCT8lyEMUKC8WqV1qCu tYd+w+Y3hWDT2URrRYdY8Q/EKX039zVeeHCnj8tBMr1qcLIKFftAo2CG24PKfC/6jxBQ sdgG8csDTjYMJvK22WOHNGg39aIp0YbUlxx+KgibyC5AQB+WOM1KT6nZTGtHy+YbHymM l4xzSZZzI9z3fU8JQqxknW1E1QzqJ1dJG6Bobb7sl7gpXOfo7+Vi4R/QzaXZT0v/wGGK bq4NVLgSC86jqRcWerucTd9kDJnQCG+uGVFIH6qAwUXxiOHXq+shgZnHSajzIEblXMYB ZD0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si11081115edv.588.2020.11.30.06.21.43; Mon, 30 Nov 2020 06:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbgK3OR6 (ORCPT + 99 others); Mon, 30 Nov 2020 09:17:58 -0500 Received: from mail.msweet.org ([173.255.209.91]:56382 "EHLO mail.msweet.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbgK3OR6 (ORCPT ); Mon, 30 Nov 2020 09:17:58 -0500 Received: from mbp16.lan (unknown [143.131.4.103]) by mail.msweet.org (Postfix) with ESMTPSA id 0392780691; Mon, 30 Nov 2020 14:17:16 +0000 (UTC) Content-Type: multipart/signed; boundary="Apple-Mail=_6107053A-E9BC-4591-A376-26450E530539"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [PATCH] Fix default q_len for usb_f_printer gadget driver From: Michael Sweet In-Reply-To: <20201030223419.3780-1-msweet@msweet.org> Date: Mon, 30 Nov 2020 09:17:15 -0500 Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: References: <20201030223419.3780-1-msweet@msweet.org> To: Felipe Balbi X-Mailer: Apple Mail (2.3608.120.23.2.4) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_6107053A-E9BC-4591-A376-26450E530539 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, I submitted this a month ago, and aside from Peter Chen's "reviewed by" = response I haven't heard anything nor seen it get merged. I know you = are all really busy and I don't want to be a pest - is there something = else I need to do to advance this patch? Thanks! > On Oct 30, 2020, at 6:34 PM, Michael R Sweet = wrote: >=20 > The usb_f_printer gadget driver uses a default q_len value of *0* = which prevents > any IO from occurring. Moreover, once the driver is instantiated it = is > impossible to change the q_len value. >=20 > The following patch uses a default q_len value of 10 which matches the = legacy > g_printer gadget driver. This minimizes the possibility that you end = up with a > non-working printer gadget. It is still possible to set the q_len to = a > different value using the configfs path of the same name. >=20 > Signed-off-by: Michael R Sweet > --- > drivers/usb/gadget/function/f_printer.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/drivers/usb/gadget/function/f_printer.c = b/drivers/usb/gadget/function/f_printer.c > index 9c7ed2539ff7..4f3161005e4f 100644 > --- a/drivers/usb/gadget/function/f_printer.c > +++ b/drivers/usb/gadget/function/f_printer.c > @@ -50,6 +50,8 @@ > #define GET_PORT_STATUS 1 > #define SOFT_RESET 2 >=20 > +#define DEFAULT_Q_LEN 10 /* same as legacy g_printer = gadget */ > + > static int major, minors; > static struct class *usb_gadget_class; > static DEFINE_IDA(printer_ida); > @@ -1317,6 +1319,9 @@ static struct usb_function_instance = *gprinter_alloc_inst(void) > opts->func_inst.free_func_inst =3D gprinter_free_inst; > ret =3D &opts->func_inst; >=20 > + /* Make sure q_len is initialized, otherwise the bound device = can't support read/write! */ > + opts->q_len =3D DEFAULT_Q_LEN; > + > mutex_lock(&printer_ida_lock); >=20 > if (ida_is_empty(&printer_ida)) { > -- > 2.17.1 >=20 ________________________ Michael Sweet --Apple-Mail=_6107053A-E9BC-4591-A376-26450E530539 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIzBAEBCgAdFiEEkIbDzcZsP1Y8+PQFvmfHXsgfMkQFAl/E/usACgkQvmfHXsgf MkQ+gBAAvktf6PWS+GR7rs/cKwwAi4kVZ5A3VeZdhgg5OOmc07p0QUz08zLl6iOq ejY1tcikCxaHnLyW20dDewWalIBiFkzY3NW+0AebASaj/awdDTec29TsctXss/yJ 7NUoWwBR2QoHpjMT1FIkrrnxH4mb2QACq4FI3T5ReCsdVutq7ed6sDFs7nJ4/ki6 0Q0QmNzET2ifwOXFdNhCJf1XrtOZdOo/fcViGr9j8eeNaPmxCLsm8CjzdGzBvtgw kYBu6RqbUINgfPhz2ZthXZrJMuS3gSRQ8L+YWB6hdvmqx3mQH3xXSgZAH9CpaBTy MvK3JM7Ip38bz8zvTLZEYGZMG7LLS56IpECNn0Ttf4f+uzIX001jWqaDHm4Ks/Lg LFC1kSygooa+Yd9Lb83fiBXsAUOwQtyicjeeQX+mEhUKfwIxo2tV7Gt9gmRD1GMJ iy10OqXqTJtOa/4DcaXCOka//oAQPZByCZ0no9EIeUkzXXj8r88s6rcDbjbpUBah pmhCwcNsEyGmj3Gdlu4CAP2duMuLWKZnMatAWToqPCRf3pPxDwBIFjaIGVv7XEbM iLFm6sOxCA9ksQbN0JCU2ub4Ux1ZSsigL/QdWyn7wglUUXdbGbUlKr9rS9Dkf3Ig ZphO/EeVM1TSCWcqQxXv1uWkNamM7DJbOJJ0ct9yEmZF119CF+A= =B/l8 -----END PGP SIGNATURE----- --Apple-Mail=_6107053A-E9BC-4591-A376-26450E530539--