Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 780c7e45 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge 3.18.108 into android-3.18



Changes in 3.18.108
	ext4: set h_journal if there is a failure starting a reserved handle
	ext4: add validity checks for bitmap block numbers
	ext4: fix bitmap position validation
	usbip: usbip_host: fix to hold parent lock for device_attach() calls
	usbip: vhci_hcd: Fix usb device and sockfd leaks
	USB: serial: ftdi_sio: use jtag quirk for Arrow USB Blaster
	USB: serial: cp210x: add ID for NI USB serial console
	usb: core: Add quirk for HP v222w 16GB Mini
	USB: Increment wakeup count on remote wakeup.
	ALSA: usb-audio: Skip broken EU on Dell dock USB-audio
	virtio: add ability to iterate over vqs
	virtio_console: free buffers after reset
	tty: n_gsm: Fix long delays with control frame timeouts in ADM mode
	tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set
	tty: Use __GFP_NOFAIL for tty_ldisc_get()
	ALSA: core: Report audio_tstamp in snd_pcm_sync_ptr
	ALSA: seq: oss: Fix unbalanced use lock for synth MIDI device
	mtd: cfi: cmdset_0001: Do not allow read/write to suspend erase block.
	mtd: cfi: cmdset_0001: Workaround Micron Erase suspend bug.
	mtd: cfi: cmdset_0002: Do not allow read/write to suspend erase block.
	kobject: don't use WARN for registration failures
	scsi: sd: Defer spinning up drive while SANITIZE is in progress
	ASoC: fsl_esai: Fix divisor calculation failure at lower ratio
	libceph: validate con->state at the top of try_write()
	Revert "perf tests: Decompress kernel module before objdump"
	Linux 3.18.108

Change-Id: I01b4fd3e7f96b7dc7be625ffcdb5be9f14444787
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parents bb08153d 6d05aadb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 107
SUBLEVEL = 108
EXTRAVERSION =
NAME = Diseased Newt

+24 −25
Original line number Diff line number Diff line
@@ -1398,7 +1398,6 @@ static int add_port(struct ports_device *portdev, u32 id)
{
	char debugfs_name[16];
	struct port *port;
	struct port_buffer *buf;
	dev_t devt;
	unsigned int nr_added_bufs;
	int err;
@@ -1509,8 +1508,6 @@ static int add_port(struct ports_device *portdev, u32 id)
	return 0;

free_inbufs:
	while ((buf = virtqueue_detach_unused_buf(port->in_vq)))
		free_buf(buf, true);
free_device:
	device_destroy(pdrvdata.class, port->dev->devt);
free_cdev:
@@ -1535,34 +1532,14 @@ static void remove_port(struct kref *kref)

static void remove_port_data(struct port *port)
{
	struct port_buffer *buf;

	spin_lock_irq(&port->inbuf_lock);
	/* Remove unused data this port might have received. */
	discard_port_data(port);
	spin_unlock_irq(&port->inbuf_lock);

	/* Remove buffers we queued up for the Host to send us data in. */
	do {
		spin_lock_irq(&port->inbuf_lock);
		buf = virtqueue_detach_unused_buf(port->in_vq);
		spin_unlock_irq(&port->inbuf_lock);
		if (buf)
			free_buf(buf, true);
	} while (buf);

	spin_lock_irq(&port->outvq_lock);
	reclaim_consumed_buffers(port);
	spin_unlock_irq(&port->outvq_lock);

	/* Free pending buffers from the out-queue. */
	do {
		spin_lock_irq(&port->outvq_lock);
		buf = virtqueue_detach_unused_buf(port->out_vq);
		spin_unlock_irq(&port->outvq_lock);
		if (buf)
			free_buf(buf, true);
	} while (buf);
}

/*
@@ -1783,13 +1760,24 @@ static void control_work_handler(struct work_struct *work)
	spin_unlock(&portdev->c_ivq_lock);
}

static void flush_bufs(struct virtqueue *vq, bool can_sleep)
{
	struct port_buffer *buf;
	unsigned int len;

	while ((buf = virtqueue_get_buf(vq, &len)))
		free_buf(buf, can_sleep);
}

static void out_intr(struct virtqueue *vq)
{
	struct port *port;

	port = find_port_by_vq(vq->vdev->priv, vq);
	if (!port)
	if (!port) {
		flush_bufs(vq, false);
		return;
	}

	wake_up_interruptible(&port->waitqueue);
}
@@ -1800,8 +1788,10 @@ static void in_intr(struct virtqueue *vq)
	unsigned long flags;

	port = find_port_by_vq(vq->vdev->priv, vq);
	if (!port)
	if (!port) {
		flush_bufs(vq, false);
		return;
	}

	spin_lock_irqsave(&port->inbuf_lock, flags);
	port->inbuf = get_inbuf(port);
@@ -1976,6 +1966,15 @@ static const struct file_operations portdev_fops = {

static void remove_vqs(struct ports_device *portdev)
{
	struct virtqueue *vq;

	virtio_device_for_each_vq(portdev->vdev, vq) {
		struct port_buffer *buf;

		flush_bufs(vq, true);
		while ((buf = virtqueue_detach_unused_buf(vq)))
			free_buf(buf, true);
	}
	portdev->vdev->config->del_vqs(portdev->vdev);
	kfree(portdev->in_vqs);
	kfree(portdev->out_vqs);
+28 −5
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
#define I82802AB	0x00ad
#define I82802AC	0x00ac
#define PF38F4476	0x881c
#define M28F00AP30	0x8963
/* STMicroelectronics chips */
#define M50LPW080       0x002F
#define M50FLW080A	0x0080
@@ -375,6 +376,17 @@ static void cfi_fixup_major_minor(struct cfi_private *cfi,
		extp->MinorVersion = '1';
}

static int cfi_is_micron_28F00AP30(struct cfi_private *cfi, struct flchip *chip)
{
	/*
	 * Micron(was Numonyx) 1Gbit bottom boot are buggy w.r.t
	 * Erase Supend for their small Erase Blocks(0x8000)
	 */
	if (cfi->mfr == CFI_MFR_INTEL && cfi->id == M28F00AP30)
		return 1;
	return 0;
}

static inline struct cfi_pri_intelext *
read_pri_intelext(struct map_info *map, __u16 adr)
{
@@ -825,21 +837,30 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
		     (mode == FL_WRITING && (cfip->SuspendCmdSupport & 1))))
			goto sleep;

		/* Do not allow suspend iff read/write to EB address */
		if ((adr & chip->in_progress_block_mask) ==
		    chip->in_progress_block_addr)
			goto sleep;

		/* do not suspend small EBs, buggy Micron Chips */
		if (cfi_is_micron_28F00AP30(cfi, chip) &&
		    (chip->in_progress_block_mask == ~(0x8000-1)))
			goto sleep;

		/* Erase suspend */
		map_write(map, CMD(0xB0), adr);
		map_write(map, CMD(0xB0), chip->in_progress_block_addr);

		/* If the flash has finished erasing, then 'erase suspend'
		 * appears to make some (28F320) flash devices switch to
		 * 'read' mode.  Make sure that we switch to 'read status'
		 * mode so we get the right data. --rmk
		 */
		map_write(map, CMD(0x70), adr);
		map_write(map, CMD(0x70), chip->in_progress_block_addr);
		chip->oldstate = FL_ERASING;
		chip->state = FL_ERASE_SUSPENDING;
		chip->erase_suspended = 1;
		for (;;) {
			status = map_read(map, adr);
			status = map_read(map, chip->in_progress_block_addr);
			if (map_word_andequal(map, status, status_OK, status_OK))
			        break;

@@ -1035,8 +1056,8 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
		   sending the 0x70 (Read Status) command to an erasing
		   chip and expecting it to be ignored, that's what we
		   do. */
		map_write(map, CMD(0xd0), adr);
		map_write(map, CMD(0x70), adr);
		map_write(map, CMD(0xd0), chip->in_progress_block_addr);
		map_write(map, CMD(0x70), chip->in_progress_block_addr);
		chip->oldstate = FL_READY;
		chip->state = FL_ERASING;
		break;
@@ -1927,6 +1948,8 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
	map_write(map, CMD(0xD0), adr);
	chip->state = FL_ERASING;
	chip->erase_suspended = 0;
	chip->in_progress_block_addr = adr;
	chip->in_progress_block_mask = ~(len - 1);

	ret = INVAL_CACHE_AND_WAIT(map, chip, adr,
				   adr, len,
+6 −3
Original line number Diff line number Diff line
@@ -814,9 +814,10 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
		    (mode == FL_WRITING && (cfip->EraseSuspend & 0x2))))
			goto sleep;

		/* We could check to see if we're trying to access the sector
		 * that is currently being erased. However, no user will try
		 * anything like that so we just wait for the timeout. */
		/* Do not allow suspend iff read/write to EB address */
		if ((adr & chip->in_progress_block_mask) ==
		    chip->in_progress_block_addr)
			goto sleep;

		/* Erase suspend */
		/* It's harmless to issue the Erase-Suspend and Erase-Resume
@@ -2265,6 +2266,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
	chip->state = FL_ERASING;
	chip->erase_suspended = 0;
	chip->in_progress_block_addr = adr;
	chip->in_progress_block_mask = ~(map->size - 1);

	INVALIDATE_CACHE_UDELAY(map, chip,
				adr, map->size,
@@ -2354,6 +2356,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
	chip->state = FL_ERASING;
	chip->erase_suspended = 0;
	chip->in_progress_block_addr = adr;
	chip->in_progress_block_mask = ~(len - 1);

	INVALIDATE_CACHE_UDELAY(map, chip,
				adr, len,
+2 −0
Original line number Diff line number Diff line
@@ -1848,6 +1848,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
				break;	/* standby */
			if (sshdr.asc == 4 && sshdr.ascq == 0xc)
				break;	/* unavailable */
			if (sshdr.asc == 4 && sshdr.ascq == 0x1b)
				break;	/* sanitize in progress */
			/*
			 * Issue command to spin up drive when not ready
			 */
Loading