linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition
       [not found] <20191026132110.4026-1-sashal@kernel.org>
@ 2019-10-26 13:20 ` Sasha Levin
  2020-09-07  9:36   ` Kristian Evensen
  2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 25/33] net: usb: sr9800: fix uninitialized local variable Sasha Levin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Sasha Levin @ 2019-10-26 13:20 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Daniele Palmas, Bjørn Mork, Jakub Kicinski, Sasha Levin,
	netdev, linux-usb

From: Daniele Palmas <dnlplm@gmail.com>

[ Upstream commit e0ae2c578d3909e60e9448207f5d83f785f1129f ]

This patch adds support for Telit FN980 0x1050 composition

0x1050: tty, adb, rmnet, tty, tty, tty, tty

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index e406a05e79dcd..57e9166b4bff3 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1252,6 +1252,7 @@ static const struct usb_device_id products[] = {
 	{QMI_FIXED_INTF(0x2357, 0x0201, 4)},	/* TP-LINK HSUPA Modem MA180 */
 	{QMI_FIXED_INTF(0x2357, 0x9000, 4)},	/* TP-LINK MA260 */
 	{QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)},	/* Telit LE922A */
+	{QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)},	/* Telit FN980 */
 	{QMI_FIXED_INTF(0x1bc7, 0x1100, 3)},	/* Telit ME910 */
 	{QMI_FIXED_INTF(0x1bc7, 0x1101, 3)},	/* Telit ME910 dual modem */
 	{QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},	/* Telit LE920 */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 4.14 25/33] net: usb: sr9800: fix uninitialized local variable
       [not found] <20191026132110.4026-1-sashal@kernel.org>
  2019-10-26 13:20 ` [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition Sasha Levin
@ 2019-10-26 13:21 ` Sasha Levin
  2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 28/33] usb: hso: obey DMA rules in tiocmget Sasha Levin
  2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 30/33] net: usb: lan78xx: Connect PHY before registering MAC Sasha Levin
  3 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2019-10-26 13:21 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Valentin Vidic, syzbot+f1842130bbcfb335bac1, David S . Miller,
	Sasha Levin, linux-usb, netdev

From: Valentin Vidic <vvidic@valentin-vidic.from.hr>

[ Upstream commit 77b6d09f4ae66d42cd63b121af67780ae3d1a5e9 ]

Make sure res does not contain random value if the call to
sr_read_cmd fails for some reason.

Reported-by: syzbot+f1842130bbcfb335bac1@syzkaller.appspotmail.com
Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/sr9800.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c
index 35f39f23d8814..8f8c9ede88c26 100644
--- a/drivers/net/usb/sr9800.c
+++ b/drivers/net/usb/sr9800.c
@@ -336,7 +336,7 @@ static void sr_set_multicast(struct net_device *net)
 static int sr_mdio_read(struct net_device *net, int phy_id, int loc)
 {
 	struct usbnet *dev = netdev_priv(net);
-	__le16 res;
+	__le16 res = 0;
 
 	mutex_lock(&dev->phy_mutex);
 	sr_set_sw_mii(dev);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 4.14 28/33] usb: hso: obey DMA rules in tiocmget
       [not found] <20191026132110.4026-1-sashal@kernel.org>
  2019-10-26 13:20 ` [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition Sasha Levin
  2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 25/33] net: usb: sr9800: fix uninitialized local variable Sasha Levin
@ 2019-10-26 13:21 ` Sasha Levin
  2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 30/33] net: usb: lan78xx: Connect PHY before registering MAC Sasha Levin
  3 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2019-10-26 13:21 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Oliver Neukum, David S . Miller, Sasha Levin, linux-usb, netdev

From: Oliver Neukum <oneukum@suse.com>

[ Upstream commit af0de1303c4e8f44fadd7b4c593f09f22324b04f ]

The serial state information must not be embedded into another
data structure, as this interferes with cache handling for DMA
on architectures without cache coherence..
That would result in data corruption on some architectures
Allocating it separately.

v2: fix syntax error

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/hso.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 6597d1f8d68c3..be16af4870570 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -201,7 +201,7 @@ struct hso_tiocmget {
 	int    intr_completed;
 	struct usb_endpoint_descriptor *endp;
 	struct urb *urb;
-	struct hso_serial_state_notification serial_state_notification;
+	struct hso_serial_state_notification *serial_state_notification;
 	u16    prev_UART_state_bitmap;
 	struct uart_icount icount;
 };
@@ -1445,7 +1445,7 @@ static int tiocmget_submit_urb(struct hso_serial *serial,
 			 usb_rcvintpipe(usb,
 					tiocmget->endp->
 					bEndpointAddress & 0x7F),
-			 &tiocmget->serial_state_notification,
+			 tiocmget->serial_state_notification,
 			 sizeof(struct hso_serial_state_notification),
 			 tiocmget_intr_callback, serial,
 			 tiocmget->endp->bInterval);
@@ -1492,7 +1492,7 @@ static void tiocmget_intr_callback(struct urb *urb)
 	/* wIndex should be the USB interface number of the port to which the
 	 * notification applies, which should always be the Modem port.
 	 */
-	serial_state_notification = &tiocmget->serial_state_notification;
+	serial_state_notification = tiocmget->serial_state_notification;
 	if (serial_state_notification->bmRequestType != BM_REQUEST_TYPE ||
 	    serial_state_notification->bNotification != B_NOTIFICATION ||
 	    le16_to_cpu(serial_state_notification->wValue) != W_VALUE ||
@@ -2578,6 +2578,8 @@ static void hso_free_tiomget(struct hso_serial *serial)
 		usb_free_urb(tiocmget->urb);
 		tiocmget->urb = NULL;
 		serial->tiocmget = NULL;
+		kfree(tiocmget->serial_state_notification);
+		tiocmget->serial_state_notification = NULL;
 		kfree(tiocmget);
 	}
 }
@@ -2628,10 +2630,13 @@ static struct hso_device *hso_create_bulk_serial_device(
 		num_urbs = 2;
 		serial->tiocmget = kzalloc(sizeof(struct hso_tiocmget),
 					   GFP_KERNEL);
+		serial->tiocmget->serial_state_notification
+			= kzalloc(sizeof(struct hso_serial_state_notification),
+					   GFP_KERNEL);
 		/* it isn't going to break our heart if serial->tiocmget
 		 *  allocation fails don't bother checking this.
 		 */
-		if (serial->tiocmget) {
+		if (serial->tiocmget && serial->tiocmget->serial_state_notification) {
 			tiocmget = serial->tiocmget;
 			tiocmget->endp = hso_get_ep(interface,
 						    USB_ENDPOINT_XFER_INT,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 4.14 30/33] net: usb: lan78xx: Connect PHY before registering MAC
       [not found] <20191026132110.4026-1-sashal@kernel.org>
                   ` (2 preceding siblings ...)
  2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 28/33] usb: hso: obey DMA rules in tiocmget Sasha Levin
@ 2019-10-26 13:21 ` Sasha Levin
  3 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2019-10-26 13:21 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Andrew Lunn, Daniel Wagner, David S . Miller, Sasha Levin, netdev,
	linux-usb

From: Andrew Lunn <andrew@lunn.ch>

[ Upstream commit 38b4fe320119859c11b1dc06f6b4987a16344fa1 ]

As soon as the netdev is registers, the kernel can start using the
interface. If the driver connects the MAC to the PHY after the netdev
is registered, there is a race condition where the interface can be
opened without having the PHY connected.

Change the order to close this race condition.

Fixes: 92571a1aae40 ("lan78xx: Connect phy early")
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/lan78xx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 24b994c68bccd..78a12d7b96e86 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -3642,10 +3642,14 @@ static int lan78xx_probe(struct usb_interface *intf,
 	/* driver requires remote-wakeup capability during autosuspend. */
 	intf->needs_remote_wakeup = 1;
 
+	ret = lan78xx_phy_init(dev);
+	if (ret < 0)
+		goto out4;
+
 	ret = register_netdev(netdev);
 	if (ret != 0) {
 		netif_err(dev, probe, netdev, "couldn't register the device\n");
-		goto out4;
+		goto out5;
 	}
 
 	usb_set_intfdata(intf, dev);
@@ -3658,14 +3662,10 @@ static int lan78xx_probe(struct usb_interface *intf,
 	pm_runtime_set_autosuspend_delay(&udev->dev,
 					 DEFAULT_AUTOSUSPEND_DELAY);
 
-	ret = lan78xx_phy_init(dev);
-	if (ret < 0)
-		goto out5;
-
 	return 0;
 
 out5:
-	unregister_netdev(netdev);
+	phy_disconnect(netdev->phydev);
 out4:
 	usb_free_urb(dev->urb_intr);
 out3:
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition
  2019-10-26 13:20 ` [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition Sasha Levin
@ 2020-09-07  9:36   ` Kristian Evensen
  2020-09-07 18:15     ` Sasha Levin
  0 siblings, 1 reply; 8+ messages in thread
From: Kristian Evensen @ 2020-09-07  9:36 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Daniele Palmas, Bjørn Mork,
	Jakub Kicinski, Network Development, linux-usb

Hi,

On Sat, Oct 26, 2019 at 3:27 PM Sasha Levin <sashal@kernel.org> wrote:
>
> From: Daniele Palmas <dnlplm@gmail.com>
>
> [ Upstream commit e0ae2c578d3909e60e9448207f5d83f785f1129f ]
>
> This patch adds support for Telit FN980 0x1050 composition
>
> 0x1050: tty, adb, rmnet, tty, tty, tty, tty
>
> Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
> Acked-by: Bjørn Mork <bjorn@mork.no>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  drivers/net/usb/qmi_wwan.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
> index e406a05e79dcd..57e9166b4bff3 100644
> --- a/drivers/net/usb/qmi_wwan.c
> +++ b/drivers/net/usb/qmi_wwan.c
> @@ -1252,6 +1252,7 @@ static const struct usb_device_id products[] = {
>         {QMI_FIXED_INTF(0x2357, 0x0201, 4)},    /* TP-LINK HSUPA Modem MA180 */
>         {QMI_FIXED_INTF(0x2357, 0x9000, 4)},    /* TP-LINK MA260 */
>         {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */
> +       {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */
>         {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)},    /* Telit ME910 */
>         {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)},    /* Telit ME910 dual modem */
>         {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},    /* Telit LE920 */
> --
> 2.20.1
>

When testing the FN980 with kernel 4.14, I noticed that the qmi device
was not there. Checking the git log, I see that this patch was never
applied. The patch applies fine, so I guess it was just missed
somewhere. If it could be added to the next 4.14 release, it would be
much appreciated.

BR,
Kristian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition
  2020-09-07  9:36   ` Kristian Evensen
@ 2020-09-07 18:15     ` Sasha Levin
  2020-09-08  0:33       ` Lars Melin
  0 siblings, 1 reply; 8+ messages in thread
From: Sasha Levin @ 2020-09-07 18:15 UTC (permalink / raw)
  To: Kristian Evensen
  Cc: linux-kernel, stable, Daniele Palmas, Bjørn Mork,
	Jakub Kicinski, Network Development, linux-usb

On Mon, Sep 07, 2020 at 11:36:37AM +0200, Kristian Evensen wrote:
>Hi,
>
>On Sat, Oct 26, 2019 at 3:27 PM Sasha Levin <sashal@kernel.org> wrote:
>>
>> From: Daniele Palmas <dnlplm@gmail.com>
>>
>> [ Upstream commit e0ae2c578d3909e60e9448207f5d83f785f1129f ]
>>
>> This patch adds support for Telit FN980 0x1050 composition
>>
>> 0x1050: tty, adb, rmnet, tty, tty, tty, tty
>>
>> Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
>> Acked-by: Bjørn Mork <bjorn@mork.no>
>> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>> ---
>>  drivers/net/usb/qmi_wwan.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
>> index e406a05e79dcd..57e9166b4bff3 100644
>> --- a/drivers/net/usb/qmi_wwan.c
>> +++ b/drivers/net/usb/qmi_wwan.c
>> @@ -1252,6 +1252,7 @@ static const struct usb_device_id products[] = {
>>         {QMI_FIXED_INTF(0x2357, 0x0201, 4)},    /* TP-LINK HSUPA Modem MA180 */
>>         {QMI_FIXED_INTF(0x2357, 0x9000, 4)},    /* TP-LINK MA260 */
>>         {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */
>> +       {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */
>>         {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)},    /* Telit ME910 */
>>         {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)},    /* Telit ME910 dual modem */
>>         {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},    /* Telit LE920 */
>> --
>> 2.20.1
>>
>
>When testing the FN980 with kernel 4.14, I noticed that the qmi device
>was not there. Checking the git log, I see that this patch was never
>applied. The patch applies fine, so I guess it was just missed
>somewhere. If it could be added to the next 4.14 release, it would be
>much appreciated.

Interesting, yes - I'm not sure why it's missing. I'll queue it up.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition
  2020-09-07 18:15     ` Sasha Levin
@ 2020-09-08  0:33       ` Lars Melin
  2020-09-08 12:12         ` Sasha Levin
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Melin @ 2020-09-08  0:33 UTC (permalink / raw)
  To: Sasha Levin, Kristian Evensen
  Cc: linux-kernel, stable, Daniele Palmas, Bjørn Mork,
	Jakub Kicinski, Network Development, linux-usb

On 9/8/2020 01:15, Sasha Levin wrote:
> On Mon, Sep 07, 2020 at 11:36:37AM +0200, Kristian Evensen wrote:
// snip

>> When testing the FN980 with kernel 4.14, I noticed that the qmi device
>> was not there. Checking the git log, I see that this patch was never
>> applied. The patch applies fine, so I guess it was just missed
>> somewhere. If it could be added to the next 4.14 release, it would be
>> much appreciated.
> 
> Interesting, yes - I'm not sure why it's missing. I'll queue it up.
> 

The patch is missing from all 4.x LTS kernels, not only 4.14


br
Lars

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition
  2020-09-08  0:33       ` Lars Melin
@ 2020-09-08 12:12         ` Sasha Levin
  0 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2020-09-08 12:12 UTC (permalink / raw)
  To: Lars Melin
  Cc: Kristian Evensen, linux-kernel, stable, Daniele Palmas,
	Bjørn Mork, Jakub Kicinski, Network Development, linux-usb

On Tue, Sep 08, 2020 at 07:33:21AM +0700, Lars Melin wrote:
>On 9/8/2020 01:15, Sasha Levin wrote:
>>On Mon, Sep 07, 2020 at 11:36:37AM +0200, Kristian Evensen wrote:
>// snip
>
>>>When testing the FN980 with kernel 4.14, I noticed that the qmi device
>>>was not there. Checking the git log, I see that this patch was never
>>>applied. The patch applies fine, so I guess it was just missed
>>>somewhere. If it could be added to the next 4.14 release, it would be
>>>much appreciated.
>>
>>Interesting, yes - I'm not sure why it's missing. I'll queue it up.
>>
>
>The patch is missing from all 4.x LTS kernels, not only 4.14

Right, it's queued up for all the trees.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-08 16:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20191026132110.4026-1-sashal@kernel.org>
2019-10-26 13:20 ` [PATCH AUTOSEL 4.14 17/33] net: usb: qmi_wwan: add Telit 0x1050 composition Sasha Levin
2020-09-07  9:36   ` Kristian Evensen
2020-09-07 18:15     ` Sasha Levin
2020-09-08  0:33       ` Lars Melin
2020-09-08 12:12         ` Sasha Levin
2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 25/33] net: usb: sr9800: fix uninitialized local variable Sasha Levin
2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 28/33] usb: hso: obey DMA rules in tiocmget Sasha Levin
2019-10-26 13:21 ` [PATCH AUTOSEL 4.14 30/33] net: usb: lan78xx: Connect PHY before registering MAC Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).