Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
* linux-next: manual merge of the tty tree with the net-next tree
@ 2021-04-06  8:48 Stephen Rothwell
  2021-04-06  9:11 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2021-04-06  8:48 UTC (permalink / raw)
  To: Greg KH, David Miller, Networking
  Cc: Greg Kroah-Hartman, Jiri Slaby, Jiri Slaby,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Zheng Yongjun


[-- Attachment #1: Type: text/plain, Size: 3075 bytes --]

Hi all,

Today's linux-next merge of the tty tree got a conflict in:

  net/nfc/nci/uart.c

between commit:

  d3295869c40c ("net: nfc: Fix spelling errors in net/nfc module")

from the net-next tree and commit:

  c2a5a45c0276 ("net: nfc: nci: drop nci_uart_ops::recv_buf")

from the tty tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/nfc/nci/uart.c
index 6af5752cde09,9958b37d8f9d..000000000000
--- a/net/nfc/nci/uart.c
+++ b/net/nfc/nci/uart.c
@@@ -229,6 -229,72 +229,72 @@@ static void nci_uart_tty_wakeup(struct 
  	nci_uart_tx_wakeup(nu);
  }
  
+ /* -- Default recv_buf handler --
+  *
+  * This handler supposes that NCI frames are sent over UART link without any
+  * framing. It reads NCI header, retrieve the packet size and once all packet
+  * bytes are received it passes it to nci_uart driver for processing.
+  */
+ static int nci_uart_default_recv_buf(struct nci_uart *nu, const u8 *data,
+ 				     int count)
+ {
+ 	int chunk_len;
+ 
+ 	if (!nu->ndev) {
+ 		nfc_err(nu->tty->dev,
+ 			"receive data from tty but no NCI dev is attached yet, drop buffer\n");
+ 		return 0;
+ 	}
+ 
+ 	/* Decode all incoming data in packets
+ 	 * and enqueue then for processing.
+ 	 */
+ 	while (count > 0) {
+ 		/* If this is the first data of a packet, allocate a buffer */
+ 		if (!nu->rx_skb) {
+ 			nu->rx_packet_len = -1;
+ 			nu->rx_skb = nci_skb_alloc(nu->ndev,
+ 						   NCI_MAX_PACKET_SIZE,
+ 						   GFP_ATOMIC);
+ 			if (!nu->rx_skb)
+ 				return -ENOMEM;
+ 		}
+ 
+ 		/* Eat byte after byte till full packet header is received */
+ 		if (nu->rx_skb->len < NCI_CTRL_HDR_SIZE) {
+ 			skb_put_u8(nu->rx_skb, *data++);
+ 			--count;
+ 			continue;
+ 		}
+ 
+ 		/* Header was received but packet len was not read */
+ 		if (nu->rx_packet_len < 0)
+ 			nu->rx_packet_len = NCI_CTRL_HDR_SIZE +
+ 				nci_plen(nu->rx_skb->data);
+ 
+ 		/* Compute how many bytes are missing and how many bytes can
+ 		 * be consumed.
+ 		 */
+ 		chunk_len = nu->rx_packet_len - nu->rx_skb->len;
+ 		if (count < chunk_len)
+ 			chunk_len = count;
+ 		skb_put_data(nu->rx_skb, data, chunk_len);
+ 		data += chunk_len;
+ 		count -= chunk_len;
+ 
 -		/* Chcek if packet is fully received */
++		/* Check if packet is fully received */
+ 		if (nu->rx_packet_len == nu->rx_skb->len) {
+ 			/* Pass RX packet to driver */
+ 			if (nu->ops.recv(nu, nu->rx_skb) != 0)
+ 				nfc_err(nu->tty->dev, "corrupted RX packet\n");
+ 			/* Next packet will be a new one */
+ 			nu->rx_skb = NULL;
+ 		}
+ 	}
+ 
+ 	return 0;
+ }
+ 
  /* nci_uart_tty_receive()
   *
   *     Called by tty low level driver when receive data is

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the tty tree with the net-next tree
  2021-04-06  8:48 linux-next: manual merge of the tty tree with the net-next tree Stephen Rothwell
@ 2021-04-06  9:11 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-04-06  9:11 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: David Miller, Networking, Jiri Slaby, Jiri Slaby,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Zheng Yongjun

On Tue, Apr 06, 2021 at 06:48:14PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the tty tree got a conflict in:
> 
>   net/nfc/nci/uart.c
> 
> between commit:
> 
>   d3295869c40c ("net: nfc: Fix spelling errors in net/nfc module")
> 
> from the net-next tree and commit:
> 
>   c2a5a45c0276 ("net: nfc: nci: drop nci_uart_ops::recv_buf")
> 
> from the tty tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Change looks correct to me, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* linux-next: manual merge of the tty tree with the net-next tree
@ 2012-03-09  6:02 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2012-03-09  6:02 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-next, linux-kernel, Joe Perches, David Miller, netdev, Jiri Slaby


[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]

Hi Greg,

Today's linux-next merge of the tty tree got a conflict in
drivers/isdn/gigaset/interface.c between commit 5bd49735db39 ("gigaset:
Use semicolons to terminate statements") from the net-next tree and
commit 2f16669d322e ("TTY: remove re-assignments to tty_driver members")
from the tty tree.

I fixed it up (see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/isdn/gigaset/interface.c
index b826dac,8f8814a..0000000
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@@ -679,9 -593,8 +593,8 @@@ void gigaset_if_initdriver(struct gigas
  	if (tty == NULL)
  		goto enomem;
  
- 	tty->magic =		TTY_DRIVER_MAGIC;
 -	tty->type =		TTY_DRIVER_TYPE_SERIAL,
 -	tty->subtype =		SERIAL_TYPE_NORMAL,
 +	tty->type =		TTY_DRIVER_TYPE_SERIAL;
 +	tty->subtype =		SERIAL_TYPE_NORMAL;
  	tty->flags =		TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
  
  	tty->driver_name =	procname;

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06  8:48 linux-next: manual merge of the tty tree with the net-next tree Stephen Rothwell
2021-04-06  9:11 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2012-03-09  6:02 Stephen Rothwell

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git