HID: logitech-dj: add new lightspeed receiver id
Subsystems (7)
Sasha Levin
maintainerPATCH 1/7 HID: logitech-dj: add new lightspeed receiver id
From: Lucas Zampieri <[email protected]>
[ Upstream commit 25666e8ccd952627899b09b68f7c9b68cfeaf028 ]
As of logitech lightspeed receiver fw version 04.02.B0009, HIDPP_PARAM_DEVICE_INFO is being reported as 0x11.
With patch "HID: logitech-dj: add support for the new lightspeed receiver iteration", the mouse starts to error out with:
logitech-djreceiver: unusable device of type UNKNOWN (0x011) connected on slot 1
and becomes unusable.
This has been noticed on a Logitech G Pro X Superlight fw MPM 25.01.B0018.
--- drivers/hid/hid-logitech-dj.c | 1 + 1 file changed, 1 insertion(+)
drivers/hid/hid-logitech-dj.c +1 -0
@@ -1000,6 +1000,7 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev, workitem.reports_supported |=STD_KEYBOARD ;break ;case 0x0f : +case 0x11 : device_type ="eQUAD Lightspeed 1.2" ;logi_hidpp_dev_conn_notif_equad (hdev, hidpp_report, &workitem); workitem.reports_supported |=STD_KEYBOARD ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 2/7 xfrm: fix tunnel model fragmentation behavior
From: Lina Wang <[email protected]>
[ Upstream commit 4ff2980b6bd2aa6b4ded3ce3b7c0ccfab29980af ]
in tunnel mode, if outer interface(ipv4) is less, it is easily to let inner IPV6 mtu be less than 1280. If so, a Packet Too Big ICMPV6 message is received. When send again, packets are fragmentized with 1280, they are still rejected with ICMPV6(Packet Too Big) by xfrmi_xmit2().
According to RFC4213 Section3.2.2:
if (IPv4 path MTU - 20) is less than 1280
if packet is larger than 1280 bytes
Send ICMPv6 "packet too big" with MTU=1280 Drop packet
else
Encapsulate but do not set the Don't Fragment flag in the IPv4 header. The resulting IPv4 packet might be fragmented by the IPv4 layer on the encapsulator or by some router along the IPv4 path.
endif
else
if packet is larger than (IPv4 path MTU - 20)
Send ICMPv6 "packet too big" with
MTU = (IPv4 path MTU - 20).
Drop packet.
else
Encapsulate and set the Don't Fragment flag in the IPv4 header.
endif
endif
Packets should be fragmentized with ipv4 outer interface, so change it.
After it is fragemtized with ipv4, there will be double fragmenation. No.48 & No.51 are ipv6 fragment packets, No.48 is double fragmentized, then tunneled with IPv4(No.49& No.50), which obey spec. And received peer cannot decrypt it rightly.
48 2002::10 2002::11 1296(length) IPv6 fragment (off=0 more=y ident=0xa20da5bc nxt=50) 49 0x0000 (0) 2002::10 2002::11 1304 IPv6 fragment (off=0 more=y ident=0x7448042c nxt=44) 50 0x0000 (0) 2002::10 2002::11 200 ESP (SPI=0x00035000) 51 2002::10 2002::11 180 Echo (ping) request 52 0x56dc 2002::10 2002::11 248 IPv6 fragment (off=1232 more=n ident=0xa20da5bc nxt=50)
xfrm6_noneed_fragment has fixed above issues. Finally, it acted like below:
1 0x6206 192.168.1.138 192.168.1.1 1316 Fragmented IP protocol (proto=Encap Security Payload 50, off=0, ID=6206) [Reassembled in #2] 2 0x6206 2002::10 2002::11 88 IPv6 fragment (off=0 more=y ident=0x1f440778 nxt=50) 3 0x0000 2002::10 2002::11 248 ICMPv6 Echo (ping) request
--- net/ipv6/xfrm6_output.c | 16 ++++++++++++++++ net/xfrm/xfrm_interface.c | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-)
net/ipv6/xfrm6_output.c +16 -0
@@ -140,6 +140,19 @@ static int __xfrm6_output_finish(struct net *net, struct sock *sk, struct sk_bufreturn __xfrm6_output_state_finish (x, sk, skb); } +static int xfrm6_noneed_fragment (struct sk_buff *skb) +{ +struct frag_hdr *fh; +u8 prevhdr =ipv6_hdr (skb)->nexthdr; + +if (prevhdr !=NEXTHDR_FRAGMENT ) +return 0 ; + fh = (struct frag_hdr *)(skb->data +sizeof (struct ipv6hdr )); +if (fh->nexthdr ==NEXTHDR_ESP || fh->nexthdr ==NEXTHDR_AUTH ) +return 1 ; +return 0 ; +} +static int __xfrm6_output (struct net *net,struct sock *sk,struct sk_buff *skb) {struct dst_entry *dst =skb_dst (skb);
@@ -168,6 +181,9 @@ static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)xfrm6_local_rxpmtu (skb, mtu);kfree_skb (skb);return -EMSGSIZE ; + }else if (toobig &&xfrm6_noneed_fragment (skb)) { + skb->ignore_df =1 ; + goto skip_frag; }else if (!skb->ignore_df && toobig && skb->sk) {xfrm_local_error (skb, mtu);kfree_skb (skb);
net/xfrm/xfrm_interface.c +4 -1
@@ -300,7 +300,10 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)if (mtu <IPV6_MIN_MTU ) mtu =IPV6_MIN_MTU ; -icmpv6_ndo_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu); +if (skb->len >1280 ) +icmpv6_ndo_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu); +else + goto xmit; }else {if (!(ip_hdr (skb)->frag_off &htons (IP_DF ))) goto xmit;
Signature · 7 lines
2.34.1 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Sasha Levin
maintainerPATCH 3/7 virtio_console: break out of buf poll on remove
In reply to Sasha LevinFrom: "Michael S. Tsirkin" <[email protected]>
[ Upstream commit 0e7174b9d5877130fec41fb4a16e0c2ee4958d44 ]
A common pattern for device reset is currently:vdev->config->reset(vdev);
.. cleanup ..
reset prevents new interrupts from arriving and waits for interrupt handlers to finish.
However if - as is common - the handler queues a work request which is flushed during the cleanup stage, we have code adding buffers / trying to get buffers while device is reset. Not good.
This was reproduced by running
modprobe virtio_console
modprobe -r virtio_console
in a loop.
Fix this up by calling virtio_break_device + flush before reset.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1786239
--- drivers/char/virtio_console.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/char/virtio_console.c +7 -0
@@ -1961,6 +1961,13 @@ static void virtcons_remove(struct virtio_device *vdev)list_del (&portdev->list);spin_unlock_irq (&pdrvdata_lock); +/* Device is going away, exit any polling for buffers */ +virtio_break_device (vdev); +if (use_multiport (portdev)) +flush_work (&portdev->control_work); +else +flush_work (&portdev->config_work); +/* Disable interrupts for vqs */ vdev->config->reset (vdev);/* Finish up work that's lined up */
Signature · 6 lines
2.34.1 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Sasha Levin
maintainerPATCH 4/7 Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
In reply to Sasha LevinFrom: Kai Lueke <[email protected]>
[ Upstream commit a3d9001b4e287fc043e5539d03d71a32ab114bcb ]
This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 because ID 0 was meant to be used for configuring the policy/state without matching for a specific interface (e.g., Cilium is affected, see
https://github.com/cilium/cilium/pull/18789 and
https://github.com/cilium/cilium/pull/19019).
--- net/xfrm/xfrm_user.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-)
net/xfrm/xfrm_user.c +3 -18
@@ -621,13 +621,8 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,xfrm_smark_init (attrs, &x->props.smark); -if (attrs[XFRMA_IF_ID ]) { +if (attrs[XFRMA_IF_ID ]) x->if_id =nla_get_u32 (attrs[XFRMA_IF_ID ]); -if (!x->if_id) { - err = -EINVAL ; - goto error; - } - } err =__xfrm_init_state (x, false, attrs[XFRMA_OFFLOAD_DEV ]);if (err)
@@ -1333,13 +1328,8 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, mark =xfrm_mark_get (attrs, &m); -if (attrs[XFRMA_IF_ID ]) { +if (attrs[XFRMA_IF_ID ]) if_id =nla_get_u32 (attrs[XFRMA_IF_ID ]); -if (!if_id) { - err = -EINVAL ; - goto out_noput; - } - }if (p->info.seq) { x =xfrm_find_acq_byseq (net, mark, p->info.seq);
@@ -1641,13 +1631,8 @@ static struct xfrm_policy *xfrm_policy_construct(struct net *net, struct xfrm_usxfrm_mark_get (attrs, &xp->mark); -if (attrs[XFRMA_IF_ID ]) { +if (attrs[XFRMA_IF_ID ]) xp->if_id =nla_get_u32 (attrs[XFRMA_IF_ID ]); -if (!xp->if_id) { - err = -EINVAL ; - goto error; - } - }return xp; error:
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 5/7 ethernet: sun: Free the coherent when failing in probing
In reply to Sasha LevinFrom: Zheyu Ma <[email protected]>
[ Upstream commit bb77bd31c281f70ec77c9c4f584950a779e05cf8 ]
When the driver fails to register net device, it should free the DMA region first, and then do other cleanup.
--- drivers/net/ethernet/sun/sunhme.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/sun/sunhme.c +5 -1
@@ -3164,7 +3164,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,if (err) {printk (KERN_ERR "happymeal(PCI): Cannot register net device, " "aborting.\n" ); - goto err_out_iounmap; + goto err_out_free_coherent; }pci_set_drvdata (pdev, hp);
@@ -3197,6 +3197,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,return 0 ; +err_out_free_coherent: +dma_free_coherent (hp->dma_dev,PAGE_SIZE , + hp->happy_block, hp->hblock_dvma); + err_out_iounmap:iounmap (hp->gregs);
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 6/7 spi: Fix invalid sgs value
In reply to Sasha LevinFrom: Biju Das <[email protected]>
[ Upstream commit 1a4e53d2fc4f68aa654ad96d13ad042e1a8e8a7d ]
max_seg_size is unsigned int and it can have a value up to 2^32 (for eg:-RZ_DMAC driver sets dma_set_max_seg_size as U32_MAX) When this value is used in min_t() as an integer type, it becomes -1 and the value of sgs becomes 0.
Fix this issue by replacing the 'int' data type with 'unsigned int' in min_t().
--- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi.c +2 -2
@@ -844,10 +844,10 @@ int spi_map_buf(struct spi_controller *ctlr, struct device *dev,int i, ret;if (vmalloced_buf || kmap_buf) { - desc_len =min_t (int, max_seg_size,PAGE_SIZE ); + desc_len = min_t(unsigned int, max_seg_size, PAGE_SIZE); sgs =DIV_ROUND_UP (len +offset_in_page (buf), desc_len); }else if (virt_addr_valid (buf)) { - desc_len =min_t (int, max_seg_size, ctlr->max_dma_len); + desc_len = min_t(unsigned int, max_seg_size, ctlr->max_dma_len); sgs =DIV_ROUND_UP (len, desc_len); }else {return -EINVAL ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 7/7 net:mcf8390: Use platform_get_irq() to get the interrupt
In reply to Sasha LevinFrom: "Minghao Chi (CGEL ZTE)" <[email protected]>
[ Upstream commit 2a760554dcba450d3ad61b32375b50ed6d59a87c ]
It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting.
platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier.
It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required.
--- drivers/net/ethernet/8390/mcf8390.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/8390/mcf8390.c +5 -5
@@ -406,12 +406,12 @@ static int mcf8390_init(struct net_device *dev)static int mcf8390_probe (struct platform_device *pdev) {struct net_device *dev; -struct resource *mem, *irq; +struct resource *mem;resource_size_t msize; -int ret; +int ret, irq; - irq =platform_get_resource (pdev,IORESOURCE_IRQ ,0 ); -if (irq ==NULL ) { + irq =platform_get_irq (pdev,0 ); +if (irq <0 ) {dev_err (&pdev->dev,"no IRQ specified?\n" );return -ENXIO ; }
@@ -434,7 +434,7 @@ static int mcf8390_probe(struct platform_device *pdev)SET_NETDEV_DEV (dev, &pdev->dev);platform_set_drvdata (pdev, dev); - dev->irq = irq->start; + dev->irq = irq; dev->base_addr = mem->start; ret =mcf8390_init (dev);
Signature · 1 line
2.34.1