mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
This is the 5.4.163 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmGnMQwACgkQONu9yGCS aT4bCA/+Lu9sU1kFVOwYb3zpaUpCAp9np5aqFL8Lyhq1I9YWy+Nw9olTXKyASilX XQbX6LzUJSjwWrVzf7NKIBBzKlo0tUGNfVXfSWTgpy++k7sD+Vbd4Zr4fLZHfESS +ea54xjaH60vljbS2v8TcesVkdbuybWAMd7mlLCcEWuRAmmZWZGcl7OPj7BD7y5S GlTzI3MCjlmQJtHWRsBtrv4wCgxb4rXkhLPo4oYwe3B3L3Qbft1yfF+zu4LP4cO1 2Ey4GW0GzeCffl0736uhlHGdT9ENJWzjjgKbbUBdYGFQj42I9i+1q1M0K8XpRuF1 ubBUTu/scZGJxjKjZ5NAVGD3Lw1M799Vxcmc3uFtCZWz6H6DOGmkcndMxDzenKIF tTAGwiMCHVBG6v/Tj94BLLhKZZf8x3dmVJBw4nV/ziM8BOuEvV4n+FOQ4YYVhOoo runcMMAihQZC2anRdVYuCumLqwkwK41/jbYcQcx+U32zOGImmGj4tGgpKfj9B+6o vp+XYtbYA8kyGl4a4Yk9twZAQViXTQEUoEPtn5l+C0qSye18r0A/hZJNmEicWXWM w6MzrVfwIaYqKzN/C+Qi5qtEIou05zB3quQ2FtXCb2lyT9+OmG4Lb5efRaTk0yxi vbNUBfajlj6QpfDW+02vFgGrMqqwW3VTDd4oE9Oy4H86iI7Iz44= =9jIx -----END PGP SIGNATURE----- Merge 5.4.163 into android11-5.4-lts Changes in 5.4.163 USB: serial: option: add Telit LE910S1 0x9200 composition USB: serial: option: add Fibocom FM101-GL variants usb: dwc2: gadget: Fix ISOC flow for elapsed frames usb: dwc2: hcd_queue: Fix use of floating point literal net: nexthop: fix null pointer dereference when IPv6 is not enabled usb: typec: fusb302: Fix masking of comparator and bc_lvl interrupts usb: hub: Fix usb enumeration issue due to address0 race usb: hub: Fix locking issues with address0_mutex binder: fix test regression due to sender_euid change ALSA: ctxfi: Fix out-of-range access media: cec: copy sequence field for the reply Revert "parisc: Fix backtrace to always include init funtion names" HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts staging/fbtft: Fix backlight staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect() xen: don't continue xenstore initialization in case of errors xen: detect uninitialized xenbus in xenbus_init KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB tracing/uprobe: Fix uprobe_perf_open probes iteration tracing: Fix pid filtering when triggers are attached mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB mdio: aspeed: Fix "Link is Down" issue PCI: aardvark: Deduplicate code in advk_pcie_rd_conf() PCI: aardvark: Wait for endpoint to be ready before training link PCI: aardvark: Fix big endian support PCI: aardvark: Train link immediately after enabling training PCI: aardvark: Improve link training PCI: aardvark: Issue PERST via GPIO PCI: aardvark: Replace custom macros by standard linux/pci_regs.h macros PCI: aardvark: Don't touch PCIe registers if no card connected PCI: aardvark: Fix compilation on s390 PCI: aardvark: Move PCIe reset card code to advk_pcie_train_link() PCI: aardvark: Update comment about disabling link training PCI: pci-bridge-emul: Fix array overruns, improve safety PCI: aardvark: Configure PCIe resources from 'ranges' DT property PCI: aardvark: Fix PCIe Max Payload Size setting PCI: aardvark: Implement re-issuing config requests on CRS response PCI: aardvark: Simplify initialization of rootcap on virtual bridge PCI: aardvark: Fix link training PCI: aardvark: Fix support for bus mastering and PCI_COMMAND on emulated bridge PCI: aardvark: Set PCI Bridge Class Code to PCI Bridge PCI: aardvark: Fix support for PCI_BRIDGE_CTL_BUS_RESET on emulated bridge pinctrl: armada-37xx: Correct PWM pins definitions arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function proc/vmcore: fix clearing user buffer by properly using clear_user() netfilter: ipvs: Fix reuse connection if RS weight is 0 ARM: dts: BCM5301X: Fix I2C controller interrupt ARM: dts: BCM5301X: Add interrupt properties to GPIO node ASoC: qdsp6: q6routing: Conditionally reset FrontEnd Mixer ASoC: topology: Add missing rwsem around snd_ctl_remove() calls net: ieee802154: handle iftypes as u32 firmware: arm_scmi: pm: Propagate return value to caller NFSv42: Don't fail clone() unless the OP_CLONE operation failed ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE scsi: mpt3sas: Fix kernel panic during drive powercycle test drm/vc4: fix error code in vc4_create_object() iavf: Prevent changing static ITR values if adaptive moderation is on ipv6: fix typos in __ip6_finish_output() nfp: checking parameter process for rx-usecs/tx-usecs is invalid net: ipv6: add fib6_nh_release_dsts stub net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group scsi: core: sysfs: Fix setting device state to SDEV_RUNNING net/smc: Ensure the active closing peer first closes clcsock nvmet-tcp: fix incomplete data digest send net/ncsi : Add payload to be 32-bit aligned to fix dropped packets PM: hibernate: use correct mode for swsusp_close() tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows nvmet: use IOCB_NOWAIT only if the filesystem supports it igb: fix netpoll exit with traffic MIPS: use 3-level pgtable for 64KB page size on MIPS_VA_BITS_48 net: vlan: fix underflow for the real_dev refcnt net/smc: Don't call clcsock shutdown twice when smc shutdown net: hns3: fix VF RSS failed problem after PF enable multi-TCs net: mscc: ocelot: don't downgrade timestamping RX filters in SIOCSHWTSTAMP net: mscc: ocelot: correctly report the timestamping RX filters in ethtool f2fs: set SBI_NEED_FSCK flag when inconsistent node block found smb3: do not error on fsync when readonly vhost/vsock: fix incorrect used length reported to the guest tracing: Check pid filtering when creating events s390/mm: validate VMA in PGSTE manipulation functions shm: extend forced shm destroy to support objects from several IPC nses NFC: add NCI_UNREG flag to eliminate the race fuse: release pipe buf after last use xen: sync include/xen/interface/io/ring.h with Xen's newest version xen/blkfront: read response from backend only once xen/blkfront: don't take local copy of a request from the ring page xen/blkfront: don't trust the backend response data blindly xen/netfront: read response from backend only once xen/netfront: don't read data from request on the ring page xen/netfront: disentangle tx_skb_freelist xen/netfront: don't trust the backend response data blindly tty: hvc: replace BUG_ON() with negative return value Linux 5.4.163 Signed-off-by: Greg Kroah-Hartman <[email protected]> Change-Id: I792fae41111b4dc8f0b16d525c05d506de9b7f62
This commit is contained in:
commit
c2531fc2c9
84 changed files with 1462 additions and 615 deletions
|
|
@ -80,6 +80,7 @@ enum blkif_state {
|
|||
BLKIF_STATE_DISCONNECTED,
|
||||
BLKIF_STATE_CONNECTED,
|
||||
BLKIF_STATE_SUSPENDED,
|
||||
BLKIF_STATE_ERROR,
|
||||
};
|
||||
|
||||
struct grant {
|
||||
|
|
@ -89,6 +90,7 @@ struct grant {
|
|||
};
|
||||
|
||||
enum blk_req_status {
|
||||
REQ_PROCESSING,
|
||||
REQ_WAITING,
|
||||
REQ_DONE,
|
||||
REQ_ERROR,
|
||||
|
|
@ -533,10 +535,10 @@ static unsigned long blkif_ring_get_request(struct blkfront_ring_info *rinfo,
|
|||
|
||||
id = get_id_from_freelist(rinfo);
|
||||
rinfo->shadow[id].request = req;
|
||||
rinfo->shadow[id].status = REQ_WAITING;
|
||||
rinfo->shadow[id].status = REQ_PROCESSING;
|
||||
rinfo->shadow[id].associated_id = NO_ASSOCIATED_ID;
|
||||
|
||||
(*ring_req)->u.rw.id = id;
|
||||
rinfo->shadow[id].req.u.rw.id = id;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
|
@ -544,11 +546,12 @@ static unsigned long blkif_ring_get_request(struct blkfront_ring_info *rinfo,
|
|||
static int blkif_queue_discard_req(struct request *req, struct blkfront_ring_info *rinfo)
|
||||
{
|
||||
struct blkfront_info *info = rinfo->dev_info;
|
||||
struct blkif_request *ring_req;
|
||||
struct blkif_request *ring_req, *final_ring_req;
|
||||
unsigned long id;
|
||||
|
||||
/* Fill out a communications ring structure. */
|
||||
id = blkif_ring_get_request(rinfo, req, &ring_req);
|
||||
id = blkif_ring_get_request(rinfo, req, &final_ring_req);
|
||||
ring_req = &rinfo->shadow[id].req;
|
||||
|
||||
ring_req->operation = BLKIF_OP_DISCARD;
|
||||
ring_req->u.discard.nr_sectors = blk_rq_sectors(req);
|
||||
|
|
@ -559,8 +562,9 @@ static int blkif_queue_discard_req(struct request *req, struct blkfront_ring_inf
|
|||
else
|
||||
ring_req->u.discard.flag = 0;
|
||||
|
||||
/* Keep a private copy so we can reissue requests when recovering. */
|
||||
rinfo->shadow[id].req = *ring_req;
|
||||
/* Copy the request to the ring page. */
|
||||
*final_ring_req = *ring_req;
|
||||
rinfo->shadow[id].status = REQ_WAITING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -693,6 +697,7 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri
|
|||
{
|
||||
struct blkfront_info *info = rinfo->dev_info;
|
||||
struct blkif_request *ring_req, *extra_ring_req = NULL;
|
||||
struct blkif_request *final_ring_req, *final_extra_ring_req = NULL;
|
||||
unsigned long id, extra_id = NO_ASSOCIATED_ID;
|
||||
bool require_extra_req = false;
|
||||
int i;
|
||||
|
|
@ -737,7 +742,8 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri
|
|||
}
|
||||
|
||||
/* Fill out a communications ring structure. */
|
||||
id = blkif_ring_get_request(rinfo, req, &ring_req);
|
||||
id = blkif_ring_get_request(rinfo, req, &final_ring_req);
|
||||
ring_req = &rinfo->shadow[id].req;
|
||||
|
||||
num_sg = blk_rq_map_sg(req->q, req, rinfo->shadow[id].sg);
|
||||
num_grant = 0;
|
||||
|
|
@ -788,7 +794,9 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri
|
|||
ring_req->u.rw.nr_segments = num_grant;
|
||||
if (unlikely(require_extra_req)) {
|
||||
extra_id = blkif_ring_get_request(rinfo, req,
|
||||
&extra_ring_req);
|
||||
&final_extra_ring_req);
|
||||
extra_ring_req = &rinfo->shadow[extra_id].req;
|
||||
|
||||
/*
|
||||
* Only the first request contains the scatter-gather
|
||||
* list.
|
||||
|
|
@ -830,10 +838,13 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri
|
|||
if (setup.segments)
|
||||
kunmap_atomic(setup.segments);
|
||||
|
||||
/* Keep a private copy so we can reissue requests when recovering. */
|
||||
rinfo->shadow[id].req = *ring_req;
|
||||
if (unlikely(require_extra_req))
|
||||
rinfo->shadow[extra_id].req = *extra_ring_req;
|
||||
/* Copy request(s) to the ring page. */
|
||||
*final_ring_req = *ring_req;
|
||||
rinfo->shadow[id].status = REQ_WAITING;
|
||||
if (unlikely(require_extra_req)) {
|
||||
*final_extra_ring_req = *extra_ring_req;
|
||||
rinfo->shadow[extra_id].status = REQ_WAITING;
|
||||
}
|
||||
|
||||
if (new_persistent_gnts)
|
||||
gnttab_free_grant_references(setup.gref_head);
|
||||
|
|
@ -1407,8 +1418,8 @@ static enum blk_req_status blkif_rsp_to_req_status(int rsp)
|
|||
static int blkif_get_final_status(enum blk_req_status s1,
|
||||
enum blk_req_status s2)
|
||||
{
|
||||
BUG_ON(s1 == REQ_WAITING);
|
||||
BUG_ON(s2 == REQ_WAITING);
|
||||
BUG_ON(s1 < REQ_DONE);
|
||||
BUG_ON(s2 < REQ_DONE);
|
||||
|
||||
if (s1 == REQ_ERROR || s2 == REQ_ERROR)
|
||||
return BLKIF_RSP_ERROR;
|
||||
|
|
@ -1441,7 +1452,7 @@ static bool blkif_completion(unsigned long *id,
|
|||
s->status = blkif_rsp_to_req_status(bret->status);
|
||||
|
||||
/* Wait the second response if not yet here. */
|
||||
if (s2->status == REQ_WAITING)
|
||||
if (s2->status < REQ_DONE)
|
||||
return false;
|
||||
|
||||
bret->status = blkif_get_final_status(s->status,
|
||||
|
|
@ -1549,7 +1560,7 @@ static bool blkif_completion(unsigned long *id,
|
|||
static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
struct request *req;
|
||||
struct blkif_response *bret;
|
||||
struct blkif_response bret;
|
||||
RING_IDX i, rp;
|
||||
unsigned long flags;
|
||||
struct blkfront_ring_info *rinfo = (struct blkfront_ring_info *)dev_id;
|
||||
|
|
@ -1560,54 +1571,76 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
|||
|
||||
spin_lock_irqsave(&rinfo->ring_lock, flags);
|
||||
again:
|
||||
rp = rinfo->ring.sring->rsp_prod;
|
||||
rmb(); /* Ensure we see queued responses up to 'rp'. */
|
||||
rp = READ_ONCE(rinfo->ring.sring->rsp_prod);
|
||||
virt_rmb(); /* Ensure we see queued responses up to 'rp'. */
|
||||
if (RING_RESPONSE_PROD_OVERFLOW(&rinfo->ring, rp)) {
|
||||
pr_alert("%s: illegal number of responses %u\n",
|
||||
info->gd->disk_name, rp - rinfo->ring.rsp_cons);
|
||||
goto err;
|
||||
}
|
||||
|
||||
for (i = rinfo->ring.rsp_cons; i != rp; i++) {
|
||||
unsigned long id;
|
||||
unsigned int op;
|
||||
|
||||
RING_COPY_RESPONSE(&rinfo->ring, i, &bret);
|
||||
id = bret.id;
|
||||
|
||||
bret = RING_GET_RESPONSE(&rinfo->ring, i);
|
||||
id = bret->id;
|
||||
/*
|
||||
* The backend has messed up and given us an id that we would
|
||||
* never have given to it (we stamp it up to BLK_RING_SIZE -
|
||||
* look in get_id_from_freelist.
|
||||
*/
|
||||
if (id >= BLK_RING_SIZE(info)) {
|
||||
WARN(1, "%s: response to %s has incorrect id (%ld)\n",
|
||||
info->gd->disk_name, op_name(bret->operation), id);
|
||||
/* We can't safely get the 'struct request' as
|
||||
* the id is busted. */
|
||||
continue;
|
||||
pr_alert("%s: response has incorrect id (%ld)\n",
|
||||
info->gd->disk_name, id);
|
||||
goto err;
|
||||
}
|
||||
if (rinfo->shadow[id].status != REQ_WAITING) {
|
||||
pr_alert("%s: response references no pending request\n",
|
||||
info->gd->disk_name);
|
||||
goto err;
|
||||
}
|
||||
|
||||
rinfo->shadow[id].status = REQ_PROCESSING;
|
||||
req = rinfo->shadow[id].request;
|
||||
|
||||
if (bret->operation != BLKIF_OP_DISCARD) {
|
||||
op = rinfo->shadow[id].req.operation;
|
||||
if (op == BLKIF_OP_INDIRECT)
|
||||
op = rinfo->shadow[id].req.u.indirect.indirect_op;
|
||||
if (bret.operation != op) {
|
||||
pr_alert("%s: response has wrong operation (%u instead of %u)\n",
|
||||
info->gd->disk_name, bret.operation, op);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (bret.operation != BLKIF_OP_DISCARD) {
|
||||
/*
|
||||
* We may need to wait for an extra response if the
|
||||
* I/O request is split in 2
|
||||
*/
|
||||
if (!blkif_completion(&id, rinfo, bret))
|
||||
if (!blkif_completion(&id, rinfo, &bret))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (add_id_to_freelist(rinfo, id)) {
|
||||
WARN(1, "%s: response to %s (id %ld) couldn't be recycled!\n",
|
||||
info->gd->disk_name, op_name(bret->operation), id);
|
||||
info->gd->disk_name, op_name(bret.operation), id);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bret->status == BLKIF_RSP_OKAY)
|
||||
if (bret.status == BLKIF_RSP_OKAY)
|
||||
blkif_req(req)->error = BLK_STS_OK;
|
||||
else
|
||||
blkif_req(req)->error = BLK_STS_IOERR;
|
||||
|
||||
switch (bret->operation) {
|
||||
switch (bret.operation) {
|
||||
case BLKIF_OP_DISCARD:
|
||||
if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
|
||||
if (unlikely(bret.status == BLKIF_RSP_EOPNOTSUPP)) {
|
||||
struct request_queue *rq = info->rq;
|
||||
printk(KERN_WARNING "blkfront: %s: %s op failed\n",
|
||||
info->gd->disk_name, op_name(bret->operation));
|
||||
|
||||
pr_warn_ratelimited("blkfront: %s: %s op failed\n",
|
||||
info->gd->disk_name, op_name(bret.operation));
|
||||
blkif_req(req)->error = BLK_STS_NOTSUPP;
|
||||
info->feature_discard = 0;
|
||||
info->feature_secdiscard = 0;
|
||||
|
|
@ -1617,15 +1650,15 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
|||
break;
|
||||
case BLKIF_OP_FLUSH_DISKCACHE:
|
||||
case BLKIF_OP_WRITE_BARRIER:
|
||||
if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
|
||||
printk(KERN_WARNING "blkfront: %s: %s op failed\n",
|
||||
info->gd->disk_name, op_name(bret->operation));
|
||||
if (unlikely(bret.status == BLKIF_RSP_EOPNOTSUPP)) {
|
||||
pr_warn_ratelimited("blkfront: %s: %s op failed\n",
|
||||
info->gd->disk_name, op_name(bret.operation));
|
||||
blkif_req(req)->error = BLK_STS_NOTSUPP;
|
||||
}
|
||||
if (unlikely(bret->status == BLKIF_RSP_ERROR &&
|
||||
if (unlikely(bret.status == BLKIF_RSP_ERROR &&
|
||||
rinfo->shadow[id].req.u.rw.nr_segments == 0)) {
|
||||
printk(KERN_WARNING "blkfront: %s: empty %s op failed\n",
|
||||
info->gd->disk_name, op_name(bret->operation));
|
||||
pr_warn_ratelimited("blkfront: %s: empty %s op failed\n",
|
||||
info->gd->disk_name, op_name(bret.operation));
|
||||
blkif_req(req)->error = BLK_STS_NOTSUPP;
|
||||
}
|
||||
if (unlikely(blkif_req(req)->error)) {
|
||||
|
|
@ -1638,9 +1671,10 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
|||
/* fall through */
|
||||
case BLKIF_OP_READ:
|
||||
case BLKIF_OP_WRITE:
|
||||
if (unlikely(bret->status != BLKIF_RSP_OKAY))
|
||||
dev_dbg(&info->xbdev->dev, "Bad return from blkdev data "
|
||||
"request: %x\n", bret->status);
|
||||
if (unlikely(bret.status != BLKIF_RSP_OKAY))
|
||||
dev_dbg_ratelimited(&info->xbdev->dev,
|
||||
"Bad return from blkdev data request: %#x\n",
|
||||
bret.status);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1665,6 +1699,14 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
|||
spin_unlock_irqrestore(&rinfo->ring_lock, flags);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
||||
err:
|
||||
info->connected = BLKIF_STATE_ERROR;
|
||||
|
||||
spin_unlock_irqrestore(&rinfo->ring_lock, flags);
|
||||
|
||||
pr_alert("%s disabled for further use\n", info->gd->disk_name);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue