This is the 5.4.152 stable release

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmFhjaYACgkQONu9yGCS
 aT50PhAAlxiyrbSItvgY16vQahz1nNguwYs9emwfa/UklMlTMLMj4BEA8Egb5JQb
 SmhlRap5zzkzok1yTIAp+Acj+E0ErgmMFnaDFiiodndJuE5tOtCnlbT7uenh7+Hv
 IbNdOr+/69WyTEh0abERiFtB+8WNh6f1MmOG07f72STSGr5CYLBoskRV0kZScGdy
 qNZ3pBGqsDzc10mzIZefNg5sZLhH9lSsrisqbyT/PV6TxiGSv0oeFnPdezXx4e/X
 NbSYTYLFj/VHlHjXcxO3l9LNAHpv5fXHSCLpLbKkmjdOmDq/ZKjpRjnYxg5lTqN+
 /VwpKcw7z6+VU/6IwnD3b/3RCW+Hxfh4084/ZNH+V5N9L+NL8ctaD14cpoo3czYG
 nXF+jXS8ds59g9yJbUX9eLYv4AMk5qYPNNb3JuD5xYhDVdUd7MN3cYuMmsnzsfiE
 pDYDDS40KBZ8r+DpEKkE5XaaBjctpFSbmLQIQzv9wfw9gTB0FQvqYNdcaxt2gTYh
 JaImFI99hK+AGN/LY4xGwBUj+yMnmZ2UBczjx8bJgcb5U9/ZJQwdpzyggT+3ySeq
 dtwd3vMKCuHa4zdjWXAGEpK2+nbnHQ8REHjkUxt3hYmjVxMgw/awexwxv8ckN67o
 Hjmvsp5ZUABzzpDcSs8p0Luv49QhyHhgRq+Jb+U+5u4F41IjnGY=
 =JKO/
 -----END PGP SIGNATURE-----

Merge 5.4.152 into android11-5.4-lts

Changes in 5.4.152
	net: mdio: introduce a shutdown method to mdio device drivers
	xen-netback: correct success/error reporting for the SKB-with-fraglist case
	sparc64: fix pci_iounmap() when CONFIG_PCI is not set
	ext2: fix sleeping in atomic bugs on error
	scsi: sd: Free scsi_disk device via put_device()
	usb: testusb: Fix for showing the connection speed
	usb: dwc2: check return value after calling platform_get_resource()
	selftests: be sure to make khdr before other targets
	selftests:kvm: fix get_warnings_count() ignoring fscanf() return warn
	scsi: ses: Retry failed Send/Receive Diagnostic commands
	tools/vm/page-types: remove dependency on opt_file for idle page tracking
	KVM: do not shrink halt_poll_ns below grow_start
	kvm: x86: Add AMD PMU MSRs to msrs_to_save_all[]
	perf/x86: Reset destroy callback on event init failure
	silence nfscache allocation warnings with kvzalloc
	libata: Add ATA_HORKAGE_NO_NCQ_ON_ATI for Samsung 860 and 870 SSD.
	Linux 5.4.152

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3a22857237d5a489f777d611132ff030b7c0fa13
This commit is contained in:
Greg Kroah-Hartman 2021-10-09 14:57:08 +02:00
commit 17eb597c8b
19 changed files with 113 additions and 37 deletions

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 151
SUBLEVEL = 152
EXTRAVERSION =
NAME = Kleptomaniac Octopus

View File

@ -19,8 +19,10 @@ void ioport_unmap(void __iomem *addr)
EXPORT_SYMBOL(ioport_map);
EXPORT_SYMBOL(ioport_unmap);
#ifdef CONFIG_PCI
void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
{
/* nothing to do */
}
EXPORT_SYMBOL(pci_iounmap);
#endif

View File

@ -2108,6 +2108,7 @@ static int x86_pmu_event_init(struct perf_event *event)
if (err) {
if (event->destroy)
event->destroy(event);
event->destroy = NULL;
}
if (READ_ONCE(x86_pmu.attr_rdpmc) &&

View File

@ -1239,6 +1239,13 @@ static const u32 msrs_to_save_all[] = {
MSR_ARCH_PERFMON_EVENTSEL0 + 12, MSR_ARCH_PERFMON_EVENTSEL0 + 13,
MSR_ARCH_PERFMON_EVENTSEL0 + 14, MSR_ARCH_PERFMON_EVENTSEL0 + 15,
MSR_ARCH_PERFMON_EVENTSEL0 + 16, MSR_ARCH_PERFMON_EVENTSEL0 + 17,
MSR_K7_EVNTSEL0, MSR_K7_EVNTSEL1, MSR_K7_EVNTSEL2, MSR_K7_EVNTSEL3,
MSR_K7_PERFCTR0, MSR_K7_PERFCTR1, MSR_K7_PERFCTR2, MSR_K7_PERFCTR3,
MSR_F15H_PERF_CTL0, MSR_F15H_PERF_CTL1, MSR_F15H_PERF_CTL2,
MSR_F15H_PERF_CTL3, MSR_F15H_PERF_CTL4, MSR_F15H_PERF_CTL5,
MSR_F15H_PERF_CTR0, MSR_F15H_PERF_CTR1, MSR_F15H_PERF_CTR2,
MSR_F15H_PERF_CTR3, MSR_F15H_PERF_CTR4, MSR_F15H_PERF_CTR5,
};
static u32 msrs_to_save[ARRAY_SIZE(msrs_to_save_all)];

View File

@ -2252,6 +2252,25 @@ static void ata_dev_config_ncq_prio(struct ata_device *dev)
}
static bool ata_dev_check_adapter(struct ata_device *dev,
unsigned short vendor_id)
{
struct pci_dev *pcidev = NULL;
struct device *parent_dev = NULL;
for (parent_dev = dev->tdev.parent; parent_dev != NULL;
parent_dev = parent_dev->parent) {
if (dev_is_pci(parent_dev)) {
pcidev = to_pci_dev(parent_dev);
if (pcidev->vendor == vendor_id)
return true;
break;
}
}
return false;
}
static int ata_dev_config_ncq(struct ata_device *dev,
char *desc, size_t desc_sz)
{
@ -2268,6 +2287,13 @@ static int ata_dev_config_ncq(struct ata_device *dev,
snprintf(desc, desc_sz, "NCQ (not used)");
return 0;
}
if (dev->horkage & ATA_HORKAGE_NO_NCQ_ON_ATI &&
ata_dev_check_adapter(dev, PCI_VENDOR_ID_ATI)) {
snprintf(desc, desc_sz, "NCQ (not used)");
return 0;
}
if (ap->flags & ATA_FLAG_NCQ) {
hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE);
dev->flags |= ATA_DFLAG_NCQ;
@ -4557,9 +4583,11 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "Samsung SSD 850*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, },
{ "Samsung SSD 860*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, },
ATA_HORKAGE_ZERO_AFTER_TRIM |
ATA_HORKAGE_NO_NCQ_ON_ATI, },
{ "Samsung SSD 870*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, },
ATA_HORKAGE_ZERO_AFTER_TRIM |
ATA_HORKAGE_NO_NCQ_ON_ATI, },
{ "FCCT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, },
@ -6916,6 +6944,8 @@ static int __init ata_parse_force_one(char **cur,
{ "ncq", .horkage_off = ATA_HORKAGE_NONCQ },
{ "noncqtrim", .horkage_on = ATA_HORKAGE_NO_NCQ_TRIM },
{ "ncqtrim", .horkage_off = ATA_HORKAGE_NO_NCQ_TRIM },
{ "noncqati", .horkage_on = ATA_HORKAGE_NO_NCQ_ON_ATI },
{ "ncqati", .horkage_off = ATA_HORKAGE_NO_NCQ_ON_ATI },
{ "dump_id", .horkage_on = ATA_HORKAGE_DUMP_ID },
{ "pio0", .xfer_mask = 1 << (ATA_SHIFT_PIO + 0) },
{ "pio1", .xfer_mask = 1 << (ATA_SHIFT_PIO + 1) },

View File

@ -180,6 +180,16 @@ static int mdio_remove(struct device *dev)
return 0;
}
static void mdio_shutdown(struct device *dev)
{
struct mdio_device *mdiodev = to_mdio_device(dev);
struct device_driver *drv = mdiodev->dev.driver;
struct mdio_driver *mdiodrv = to_mdio_driver(drv);
if (mdiodrv->shutdown)
mdiodrv->shutdown(mdiodev);
}
/**
* mdio_driver_register - register an mdio_driver with the MDIO layer
* @new_driver: new mdio_driver to register
@ -194,6 +204,7 @@ int mdio_driver_register(struct mdio_driver *drv)
mdiodrv->driver.bus = &mdio_bus_type;
mdiodrv->driver.probe = mdio_probe;
mdiodrv->driver.remove = mdio_remove;
mdiodrv->driver.shutdown = mdio_shutdown;
retval = driver_register(&mdiodrv->driver);
if (retval) {

View File

@ -492,7 +492,7 @@ check_frags:
* the header's copy failed, and they are
* sharing a slot, send an error
*/
if (i == 0 && sharedslot)
if (i == 0 && !first_shinfo && sharedslot)
xenvif_idx_release(queue, pending_idx,
XEN_NETIF_RSP_ERROR);
else

View File

@ -3354,15 +3354,16 @@ static int sd_probe(struct device *dev)
}
device_initialize(&sdkp->dev);
sdkp->dev.parent = dev;
sdkp->dev.parent = get_device(dev);
sdkp->dev.class = &sd_disk_class;
dev_set_name(&sdkp->dev, "%s", dev_name(dev));
error = device_add(&sdkp->dev);
if (error)
goto out_free_index;
if (error) {
put_device(&sdkp->dev);
goto out;
}
get_device(dev);
dev_set_drvdata(dev, sdkp);
gd->major = sd_major((index & 0xf0) >> 4);

View File

@ -87,9 +87,16 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
0
};
unsigned char recv_page_code;
unsigned int retries = SES_RETRIES;
struct scsi_sense_hdr sshdr;
do {
ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
&sshdr, SES_TIMEOUT, 1, NULL);
} while (ret > 0 && --retries && scsi_sense_valid(&sshdr) &&
(sshdr.sense_key == NOT_READY ||
(sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29)));
ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
NULL, SES_TIMEOUT, SES_RETRIES, NULL);
if (unlikely(ret))
return ret;
@ -121,9 +128,16 @@ static int ses_send_diag(struct scsi_device *sdev, int page_code,
bufflen & 0xff,
0
};
struct scsi_sense_hdr sshdr;
unsigned int retries = SES_RETRIES;
do {
result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, buf, bufflen,
&sshdr, SES_TIMEOUT, 1, NULL);
} while (result > 0 && --retries && scsi_sense_valid(&sshdr) &&
(sshdr.sense_key == NOT_READY ||
(sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29)));
result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, buf, bufflen,
NULL, SES_TIMEOUT, SES_RETRIES, NULL);
if (result)
sdev_printk(KERN_ERR, sdev, "SEND DIAGNOSTIC result: %8x\n",
result);

View File

@ -5074,6 +5074,10 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
hcd->has_tt = 1;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
retval = -EINVAL;
goto error1;
}
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);

View File

@ -48,10 +48,9 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
struct ext2_sb_info *sbi = EXT2_SB(sb);
if (block_group >= sbi->s_groups_count) {
ext2_error (sb, "ext2_get_group_desc",
"block_group >= groups_count - "
"block_group = %d, groups_count = %lu",
block_group, sbi->s_groups_count);
WARN(1, "block_group >= groups_count - "
"block_group = %d, groups_count = %lu",
block_group, sbi->s_groups_count);
return NULL;
}
@ -59,10 +58,9 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
group_desc = block_group >> EXT2_DESC_PER_BLOCK_BITS(sb);
offset = block_group & (EXT2_DESC_PER_BLOCK(sb) - 1);
if (!sbi->s_group_desc[group_desc]) {
ext2_error (sb, "ext2_get_group_desc",
"Group descriptor not loaded - "
"block_group = %d, group_desc = %lu, desc = %lu",
block_group, group_desc, offset);
WARN(1, "Group descriptor not loaded - "
"block_group = %d, group_desc = %lu, desc = %lu",
block_group, group_desc, offset);
return NULL;
}

View File

@ -173,14 +173,10 @@ int nfsd_reply_cache_init(struct nfsd_net *nn)
if (status)
goto out_nomem;
nn->drc_hashtbl = kcalloc(hashsize,
sizeof(*nn->drc_hashtbl), GFP_KERNEL);
if (!nn->drc_hashtbl) {
nn->drc_hashtbl = vzalloc(array_size(hashsize,
sizeof(*nn->drc_hashtbl)));
if (!nn->drc_hashtbl)
goto out_shrinker;
}
nn->drc_hashtbl = kvzalloc(array_size(hashsize,
sizeof(*nn->drc_hashtbl)), GFP_KERNEL);
if (!nn->drc_hashtbl)
goto out_shrinker;
for (i = 0; i < hashsize; i++) {
INIT_LIST_HEAD(&nn->drc_hashtbl[i].lru_head);

View File

@ -423,6 +423,7 @@ enum {
ATA_HORKAGE_NOTRIM = (1 << 24), /* don't use TRIM */
ATA_HORKAGE_MAX_SEC_1024 = (1 << 25), /* Limit max sects to 1024 */
ATA_HORKAGE_MAX_TRIM_128M = (1 << 26), /* Limit max trim size to 128M */
ATA_HORKAGE_NO_NCQ_ON_ATI = (1 << 27), /* Disable NCQ on ATI chipset */
/* DMA mask for user DMA control: User visible values; DO NOT
renumber */

View File

@ -64,6 +64,9 @@ struct mdio_driver {
/* Clears up any memory if needed */
void (*remove)(struct mdio_device *mdiodev);
/* Quiesces the device on system shutdown, turns off interrupts etc */
void (*shutdown)(struct mdio_device *mdiodev);
};
#define to_mdio_driver(d) \
container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)

View File

@ -82,7 +82,8 @@ int get_warnings_count(void)
FILE *f;
f = popen("dmesg | grep \"WARNING:\" | wc -l", "r");
fscanf(f, "%d", &warnings);
if (fscanf(f, "%d", &warnings) < 1)
warnings = 0;
fclose(f);
return warnings;

View File

@ -48,6 +48,7 @@ ARCH ?= $(SUBARCH)
# When local build is done, headers are installed in the default
# INSTALL_HDR_PATH usr/include.
.PHONY: khdr
.NOTPARALLEL:
khdr:
ifndef KSFT_KHDR_INSTALL_DONE
ifeq (1,$(DEFAULT_INSTALL_HDR_PATH))

View File

@ -265,12 +265,6 @@ nomem:
}
entry->ifnum = ifnum;
/* FIXME update USBDEVFS_CONNECTINFO so it tells about high speed etc */
fprintf(stderr, "%s speed\t%s\t%u\n",
speed(entry->speed), entry->name, entry->ifnum);
entry->next = testdevs;
testdevs = entry;
return 0;
@ -299,6 +293,14 @@ static void *handle_testdev (void *arg)
return 0;
}
status = ioctl(fd, USBDEVFS_GET_SPEED, NULL);
if (status < 0)
fprintf(stderr, "USBDEVFS_GET_SPEED failed %d\n", status);
else
dev->speed = status;
fprintf(stderr, "%s speed\t%s\t%u\n",
speed(dev->speed), dev->name, dev->ifnum);
restart:
for (i = 0; i < TEST_CASES; i++) {
if (dev->test != -1 && dev->test != i)

View File

@ -1329,7 +1329,7 @@ int main(int argc, char *argv[])
if (opt_list && opt_list_mapcnt)
kpagecount_fd = checked_open(PROC_KPAGECOUNT, O_RDONLY);
if (opt_mark_idle && opt_file)
if (opt_mark_idle)
page_idle_fd = checked_open(SYS_KERNEL_MM_PAGE_IDLE, O_RDWR);
if (opt_list && opt_pid)

View File

@ -2470,15 +2470,19 @@ out:
static void shrink_halt_poll_ns(struct kvm_vcpu *vcpu)
{
unsigned int old, val, shrink;
unsigned int old, val, shrink, grow_start;
old = val = vcpu->halt_poll_ns;
shrink = READ_ONCE(halt_poll_ns_shrink);
grow_start = READ_ONCE(halt_poll_ns_grow_start);
if (shrink == 0)
val = 0;
else
val /= shrink;
if (val < grow_start)
val = 0;
vcpu->halt_poll_ns = val;
trace_kvm_halt_poll_ns_shrink(vcpu->vcpu_id, val, old);
}