Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…rnel into R

This is the 4.14.250 stable release

Signed-off-by: K A R T H I K <[email protected]>
  • Loading branch information
karthik558 committed Oct 9, 2021
2 parents 25f13e2 + ed99bf0 commit 13eb4f7
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 249
SUBLEVEL = 250
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
2 changes: 2 additions & 0 deletions arch/sparc/lib/iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 32 additions & 2 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,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)
{
Expand All @@ -2292,6 +2311,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 - 1);
dev->flags |= ATA_DFLAG_NCQ;
Expand Down Expand Up @@ -4565,9 +4591,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, },

Expand Down Expand Up @@ -6860,6 +6888,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) },
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/phy/mdio_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,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
Expand All @@ -160,6 +170,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) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/xen-netback/netback.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static int xenvif_tx_check_gop(struct xenvif_queue *queue,
* 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
Expand Down
9 changes: 5 additions & 4 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3366,15 +3366,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);

get_device(&sdkp->dev); /* prevent release before async_schedule */
Expand Down
22 changes: 18 additions & 4 deletions drivers/scsi/ses.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,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;

Expand Down Expand Up @@ -137,9 +144,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);
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/dwc2/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5229,6 +5229,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);

Expand Down
14 changes: 6 additions & 8 deletions fs/ext2/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,19 @@ 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;
}

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;
}

Expand Down
1 change: 1 addition & 0 deletions include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,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 */
Expand Down
3 changes: 3 additions & 0 deletions include/linux/mdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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)
Expand Down
13 changes: 6 additions & 7 deletions include/linux/timerqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ struct timerqueue_node {
};

struct timerqueue_head {
struct rb_root head;
struct timerqueue_node *next;
struct rb_root_cached rb_root;
};


Expand All @@ -29,13 +28,14 @@ extern struct timerqueue_node *timerqueue_iterate_next(
*
* @head: head of timerqueue
*
* Returns a pointer to the timer node that has the
* earliest expiration time.
* Returns a pointer to the timer node that has the earliest expiration time.
*/
static inline
struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
{
return head->next;
struct rb_node *leftmost = rb_first_cached(&head->rb_root);

return rb_entry(leftmost, struct timerqueue_node, node);
}

static inline void timerqueue_init(struct timerqueue_node *node)
Expand All @@ -45,7 +45,6 @@ static inline void timerqueue_init(struct timerqueue_node *node)

static inline void timerqueue_init_head(struct timerqueue_head *head)
{
head->head = RB_ROOT;
head->next = NULL;
head->rb_root = RB_ROOT_CACHED;
}
#endif /* _LINUX_TIMERQUEUE_H */
30 changes: 12 additions & 18 deletions lib/timerqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,28 @@
*/
bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node)
{
struct rb_node **p = &head->head.rb_node;
struct rb_node **p = &head->rb_root.rb_root.rb_node;
struct rb_node *parent = NULL;
struct timerqueue_node *ptr;
struct timerqueue_node *ptr;
bool leftmost = true;

/* Make sure we don't add nodes that are already added */
WARN_ON_ONCE(!RB_EMPTY_NODE(&node->node));

while (*p) {
parent = *p;
ptr = rb_entry(parent, struct timerqueue_node, node);
if (node->expires < ptr->expires)
if (node->expires < ptr->expires) {
p = &(*p)->rb_left;
else
} else {
p = &(*p)->rb_right;
leftmost = false;
}
}
rb_link_node(&node->node, parent, p);
rb_insert_color(&node->node, &head->head);
rb_insert_color_cached(&node->node, &head->rb_root, leftmost);

if (!head->next || node->expires < head->next->expires) {
head->next = node;
return true;
}
return false;
return leftmost;
}
EXPORT_SYMBOL_GPL(timerqueue_add);

Expand All @@ -76,15 +75,10 @@ bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node)
{
WARN_ON_ONCE(RB_EMPTY_NODE(&node->node));

/* update next pointer */
if (head->next == node) {
struct rb_node *rbn = rb_next(&node->node);

head->next = rb_entry_safe(rbn, struct timerqueue_node, node);
}
rb_erase(&node->node, &head->head);
rb_erase_cached(&node->node, &head->rb_root);
RB_CLEAR_NODE(&node->node);
return head->next != NULL;

return !RB_EMPTY_ROOT(&head->rb_root.rb_root);
}
EXPORT_SYMBOL_GPL(timerqueue_del);

Expand Down
14 changes: 8 additions & 6 deletions tools/usb/testusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,6 @@ static int find_testdev(const char *name, const struct stat *sb, int flag)
}

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;
Expand Down Expand Up @@ -312,6 +306,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)
Expand Down

0 comments on commit 13eb4f7

Please sign in to comment.