On Fri, Nov 27, 2020 at 02:55:47AM +0000, Peter Chen wrote:
> On 20-11-26 19:09:36, Greg Kroah-Hartman wrote:
> > From: "taehyun.cho" <taehyun.cho(a)samsung.com>
> >
> > Setup the descriptors for SuperSpeed Plus for f_fs. This allows the
> > gadget to work properly without crashing at SuperSpeed rates.
> >
> > Cc: Felipe Balbi <balbi(a)kernel.org>
> > Cc: Peter Chen <peter.chen(a)nxp.com>
> > Cc: stable <stable(a)vger.kernel.org>
> > Signed-off-by: taehyun.cho <taehyun.cho(a)samsung.com>
> > Signed-off-by: Will McVicker <willmcvicker(a)google.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
> > ---
> > drivers/usb/gadget/function/f_fs.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
> > index 046f770a76da..a34a7c96a1ab 100644
> > --- a/drivers/usb/gadget/function/f_fs.c
> > +++ b/drivers/usb/gadget/function/f_fs.c
> > @@ -1327,6 +1327,7 @@ static long ffs_epfile_ioctl(struct file *file, unsigned code,
> > struct usb_endpoint_descriptor *desc;
> >
> > switch (epfile->ffs->gadget->speed) {
> > + case USB_SPEED_SUPER_PLUS:
> > case USB_SPEED_SUPER:
> > desc_idx = 2;
> > break;
> > @@ -3222,6 +3223,10 @@ static int _ffs_func_bind(struct usb_configuration *c,
> > func->function.os_desc_n =
> > c->cdev->use_os_string ? ffs->interfaces_count : 0;
> >
> > + if (likely(super)) {
>
> Why likely is used? Currently, there are still lots of HS devices on market
> or on the development.
It looks to be a cut/paste of the other tests above, all of which say
"likely" which we all know is not true at all. I'll leave this now, and
add a patch that removes them all as this is NOT a function where it
should be used at all.
thanks for the review.
greg k-h
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 2194bc7c39610be7cabe7456c5f63a570604f015 Mon Sep 17 00:00:00 2001
From: Rajat Jain <rajatja(a)google.com>
Date: Mon, 6 Jul 2020 16:32:40 -0700
Subject: [PATCH] PCI: Add device even if driver attach failed
device_attach() returning failure indicates a driver error while trying to
probe the device. In such a scenario, the PCI device should still be added
in the system and be visible to the user.
When device_attach() fails, merely warn about it and keep the PCI device in
the system.
This partially reverts ab1a187bba5c ("PCI: Check device_attach() return
value always").
Link: https://lore.kernel.org/r/20200706233240.3245512-1-rajatja@google.com
Signed-off-by: Rajat Jain <rajatja(a)google.com>
Signed-off-by: Bjorn Helgaas <bhelgaas(a)google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: stable(a)vger.kernel.org # v4.6+
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 8e40b3e6da77..3cef835b375f 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -322,12 +322,8 @@ void pci_bus_add_device(struct pci_dev *dev)
dev->match_driver = true;
retval = device_attach(&dev->dev);
- if (retval < 0 && retval != -EPROBE_DEFER) {
+ if (retval < 0 && retval != -EPROBE_DEFER)
pci_warn(dev, "device attach failed (%d)\n", retval);
- pci_proc_detach_device(dev);
- pci_remove_sysfs_dev_files(dev);
- return;
- }
pci_dev_assign_added(dev, true);
}
Hi Greg
Can you add
commit 35425bafc772ee189e3c3790d7c672b80ba65909
Author: Biwen Li <biwen.li(a)nxp.com>
Date: Tue Sep 15 15:32:09 2020 +0800
rtc: pcf2127: fix a bug when not specify interrupts property
to the 5.9 stable queue? It fixes
commit 27006416be16b7887fb94b3b445f32453defb3f1
Author: Alexandre Belloni <alexandre.belloni(a)bootlin.com>
Date: Wed Aug 12 10:51:14 2020 +0200
rtc: pcf2127: fix alarm handling
which is only in 5.9.
Thanks,
Rasmus
Hi,
Please backport "wireless: Use linux/stddef.h instead of stddef.h" to
kernel 4.14, 4.19 and 5.4.
This is upstream commit id 1b9ae0c92925ac40489be526d67d0010d0724ce0
https://git.kernel.org/linus/1b9ae0c92925ac40489be526d67d0010d0724ce0
commit 1b9ae0c92925ac40489be526d67d0010d0724ce0
Author: Hauke Mehrtens <hauke(a)hauke-m.de>
Date: Thu May 21 22:14:22 2020 +0200
wireless: Use linux/stddef.h instead of stddef.h
This patch fixes a build problem in broken build environments which was
introduced with 6989310f5d43 ("wireless: Use offsetof instead of custom
macro.") which was backported to the listed kernel versions.
When the include path is fully correct you should not hit this problem,
but I got it because of some bug in by build system and also someone
else reported a similar problem to me and requested this backport.
Hauke
Centralize handling of interrupts from the userspace APIC
in kvm_cpu_has_extint and kvm_cpu_get_extint, since
userspace APIC interrupts are handled more or less the
same as ExtINTs are with split irqchip. This removes
duplicated code from kvm_cpu_has_injectable_intr and
kvm_cpu_has_interrupt, and makes the code more similar
between kvm_cpu_has_{extint,interrupt} on one side
and kvm_cpu_get_{extint,interrupt} on the other.
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
arch/x86/kvm/irq.c | 85 ++++++++++++++++++--------------------------
arch/x86/kvm/lapic.c | 2 +-
2 files changed, 35 insertions(+), 52 deletions(-)
diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c
index 99d118ffc67d..e2d49a506e7f 100644
--- a/arch/x86/kvm/irq.c
+++ b/arch/x86/kvm/irq.c
@@ -42,15 +42,27 @@ static int pending_userspace_extint(struct kvm_vcpu *v)
*/
static int kvm_cpu_has_extint(struct kvm_vcpu *v)
{
- u8 accept = kvm_apic_accept_pic_intr(v);
+ /*
+ * FIXME: interrupt.injected represents an interrupt that it's
+ * side-effects have already been applied (e.g. bit from IRR
+ * already moved to ISR). Therefore, it is incorrect to rely
+ * on interrupt.injected to know if there is a pending
+ * interrupt in the user-mode LAPIC.
+ * This leads to nVMX/nSVM not be able to distinguish
+ * if it should exit from L2 to L1 on EXTERNAL_INTERRUPT on
+ * pending interrupt or should re-inject an injected
+ * interrupt.
+ */
+ if (!lapic_in_kernel(v))
+ return v->arch.interrupt.injected;
- if (accept) {
- if (irqchip_split(v->kvm))
- return pending_userspace_extint(v);
- else
- return v->kvm->arch.vpic->output;
- } else
+ if (!kvm_apic_accept_pic_intr(v))
return 0;
+
+ if (irqchip_split(v->kvm))
+ return pending_userspace_extint(v);
+ else
+ return v->kvm->arch.vpic->output;
}
/*
@@ -61,20 +73,6 @@ static int kvm_cpu_has_extint(struct kvm_vcpu *v)
*/
int kvm_cpu_has_injectable_intr(struct kvm_vcpu *v)
{
- /*
- * FIXME: interrupt.injected represents an interrupt that it's
- * side-effects have already been applied (e.g. bit from IRR
- * already moved to ISR). Therefore, it is incorrect to rely
- * on interrupt.injected to know if there is a pending
- * interrupt in the user-mode LAPIC.
- * This leads to nVMX/nSVM not be able to distinguish
- * if it should exit from L2 to L1 on EXTERNAL_INTERRUPT on
- * pending interrupt or should re-inject an injected
- * interrupt.
- */
- if (!lapic_in_kernel(v))
- return v->arch.interrupt.injected;
-
if (kvm_cpu_has_extint(v))
return 1;
@@ -91,20 +89,6 @@ EXPORT_SYMBOL_GPL(kvm_cpu_has_injectable_intr);
*/
int kvm_cpu_has_interrupt(struct kvm_vcpu *v)
{
- /*
- * FIXME: interrupt.injected represents an interrupt that it's
- * side-effects have already been applied (e.g. bit from IRR
- * already moved to ISR). Therefore, it is incorrect to rely
- * on interrupt.injected to know if there is a pending
- * interrupt in the user-mode LAPIC.
- * This leads to nVMX/nSVM not be able to distinguish
- * if it should exit from L2 to L1 on EXTERNAL_INTERRUPT on
- * pending interrupt or should re-inject an injected
- * interrupt.
- */
- if (!lapic_in_kernel(v))
- return v->arch.interrupt.injected;
-
if (kvm_cpu_has_extint(v))
return 1;
@@ -118,16 +102,21 @@ EXPORT_SYMBOL_GPL(kvm_cpu_has_interrupt);
*/
static int kvm_cpu_get_extint(struct kvm_vcpu *v)
{
- if (kvm_cpu_has_extint(v)) {
- if (irqchip_split(v->kvm)) {
- int vector = v->arch.pending_external_vector;
-
- v->arch.pending_external_vector = -1;
- return vector;
- } else
- return kvm_pic_read_irq(v->kvm); /* PIC */
- } else
+ if (!kvm_cpu_has_extint(v)) {
+ WARN_ON(!lapic_in_kernel(v));
return -1;
+ }
+
+ if (!lapic_in_kernel(v))
+ return v->arch.interrupt.nr;
+
+ if (irqchip_split(v->kvm)) {
+ int vector = v->arch.pending_external_vector;
+
+ v->arch.pending_external_vector = -1;
+ return vector;
+ } else
+ return kvm_pic_read_irq(v->kvm); /* PIC */
}
/*
@@ -135,13 +124,7 @@ static int kvm_cpu_get_extint(struct kvm_vcpu *v)
*/
int kvm_cpu_get_interrupt(struct kvm_vcpu *v)
{
- int vector;
-
- if (!lapic_in_kernel(v))
- return v->arch.interrupt.nr;
-
- vector = kvm_cpu_get_extint(v);
-
+ int vector = kvm_cpu_get_extint(v);
if (vector != -1)
return vector; /* PIC */
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 105e7859d1f2..bb5ff761d5e2 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2465,7 +2465,7 @@ int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu)
struct kvm_lapic *apic = vcpu->arch.apic;
u32 ppr;
- if (!kvm_apic_hw_enabled(apic))
+ if (!kvm_apic_present(vcpu))
return -1;
__apic_update_ppr(apic, &ppr);
--
2.28.0
Hi Greg, Sasha,
These two were missing in 4.4-stable. Please apply to your queue.
80e46cf22ba0 ("btrfs: tree-checker: Enhance chunk checker to validate chunk profile")
6bf9e4bd6a27 ("btrfs: inode: Verify inode mode to avoid NULL pointer dereference")
--
Regards
Sudip