diff options
| author | Mark Brown <[email protected]> | 2015-10-12 18:09:27 +0100 | 
|---|---|---|
| committer | Mark Brown <[email protected]> | 2015-10-12 18:09:27 +0100 | 
| commit | 79828b4fa835f73cdaf4bffa48696abdcbea9d02 (patch) | |
| tree | 5e0fa7156acb75ba603022bc807df8f2fedb97a8 /drivers/tty/tty_buffer.c | |
| parent | 721b51fcf91898299d96f4b72cb9434cda29dce6 (diff) | |
| parent | 8c1a9d6323abf0fb1e5dad96cf3f1c783505ea5a (diff) | |
Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-fix-rt5645
Diffstat (limited to 'drivers/tty/tty_buffer.c')
| -rw-r--r-- | drivers/tty/tty_buffer.c | 12 | 
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 4cf263d7dffc..5a3fa8913880 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -291,12 +291,11 @@ static int __tty_buffer_request_room(struct tty_port *port, size_t size,  			n->flags = flags;  			buf->tail = n;  			b->commit = b->used; -			/* paired w/ barrier in flush_to_ldisc(); ensures the +			/* paired w/ acquire in flush_to_ldisc(); ensures the  			 * latest commit value can be read before the head is  			 * advanced to the next buffer  			 */ -			smp_wmb(); -			b->next = n; +			smp_store_release(&b->next, n);  		} else if (change)  			size = 0;  		else @@ -445,7 +444,6 @@ receive_buf(struct tty_struct *tty, struct tty_buffer *head, int count)  		if (count)  			disc->ops->receive_buf(tty, p, f, count);  	} -	head->read += count;  	return count;  } @@ -488,12 +486,11 @@ static void flush_to_ldisc(struct work_struct *work)  		if (atomic_read(&buf->priority))  			break; -		next = head->next; -		/* paired w/ barrier in __tty_buffer_request_room(); +		/* paired w/ release in __tty_buffer_request_room();  		 * ensures commit value read is not stale if the head  		 * is advancing to the next buffer  		 */ -		smp_rmb(); +		next = smp_load_acquire(&head->next);  		count = head->commit - head->read;  		if (!count) {  			if (next == NULL) { @@ -508,6 +505,7 @@ static void flush_to_ldisc(struct work_struct *work)  		count = receive_buf(tty, head, count);  		if (!count)  			break; +		head->read += count;  	}  	mutex_unlock(&buf->lock);  |