linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Greg KH <greg@kroah.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the tty tree with the tty.current tree
Date: Fri, 19 Apr 2024 14:19:47 +1000	[thread overview]
Message-ID: <20240419141947.4bc16fa4@canb.auug.org.au> (raw)

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

Hi all,

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

  drivers/tty/serial/serial_core.c

between commit:

  9cf7ea2eeb74 ("serial: core: Clearing the circular buffer before NULLifying it")

from the tty.current tree and commits:

  1788cf6a91d9 ("tty: serial: switch from circ_buf to kfifo")
  abcd8632f26b ("serial: core: Extract uart_alloc_xmit_buf() and uart_free_xmit_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 drivers/tty/serial/serial_core.c
index c476d884356d,b9d631037ff6..000000000000
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@@ -285,6 -273,53 +273,54 @@@ static int uart_alloc_xmit_buf(struct t
  		free_page(page);
  	}
  
+ 	return 0;
+ }
+ 
+ static void uart_free_xmit_buf(struct tty_port *port)
+ {
+ 	struct uart_state *state = container_of(port, struct uart_state, port);
+ 	struct uart_port *uport;
+ 	unsigned long flags;
+ 	char *xmit_buf;
+ 
+ 	/*
+ 	 * Do not free() the transmit buffer page under the port lock since
+ 	 * this can create various circular locking scenarios. For instance,
+ 	 * console driver may need to allocate/free a debug object, which
+ 	 * can end up in printk() recursion.
+ 	 */
+ 	uport = uart_port_lock(state, flags);
++	kfifo_reset(&state->port.xmit_fifo);
+ 	xmit_buf = port->xmit_buf;
+ 	port->xmit_buf = NULL;
+ 	INIT_KFIFO(port->xmit_fifo);
+ 	uart_port_unlock(uport, flags);
+ 
+ 	free_page((unsigned long)xmit_buf);
+ }
+ 
+ /*
+  * Startup the port.  This will be called once per open.  All calls
+  * will be serialised by the per-port mutex.
+  */
+ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
+ 			     bool init_hw)
+ {
+ 	struct uart_port *uport = uart_port_check(state);
+ 	int retval;
+ 
+ 	if (uport->type == PORT_UNKNOWN)
+ 		return 1;
+ 
+ 	/*
+ 	 * Make sure the device is in D0 state.
+ 	 */
+ 	uart_change_pm(state, UART_PM_STATE_ON);
+ 
+ 	retval = uart_alloc_xmit_buf(&state->port);
+ 	if (retval)
+ 		return retval;
+ 
  	retval = uport->ops->startup(uport);
  	if (retval == 0) {
  		if (uart_console(uport) && uport->cons->cflag) {

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

             reply	other threads:[~2024-04-19  4:19 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  4:19 Stephen Rothwell [this message]
2024-04-19  6:09 ` linux-next: manual merge of the tty tree with the tty.current tree Greg KH
2024-04-23 11:24 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2024-04-11  3:57 Stephen Rothwell
2024-04-11  4:17 ` Stephen Rothwell
2024-04-11  4:38   ` Greg KH
2024-04-11 10:40   ` Andy Shevchenko
2023-10-04  1:55 Stephen Rothwell
2023-10-04  2:14 ` Stephen Rothwell
2023-10-04  6:38   ` Greg KH
2023-10-16  8:20     ` Greg KH
2020-09-17  6:09 Stephen Rothwell
2020-09-17  6:34 ` Greg KH
2019-12-18  0:49 Stephen Rothwell
2019-12-18  7:05 ` Greg KH
2017-08-02  4:26 Stephen Rothwell
2017-08-04  1:02 ` Greg KH
2017-08-14 22:17 ` Greg KH
2017-03-20  2:28 Stephen Rothwell
2017-03-20  9:21 ` Dmitry Vyukov
2017-03-20  9:26   ` Dmitry Vyukov
2017-03-29  5:51     ` Greg KH
2017-03-30  3:46     ` Michael Neuling
2017-03-30 12:17       ` Dmitry Vyukov
2016-02-08  2:16 Stephen Rothwell
2016-02-08  2:21 ` Greg KH
2016-02-08  2:53   ` Peter Hurley
2016-04-01  0:23   ` Peter Hurley
2016-04-01  3:49     ` Greg KH
2015-05-25  8:19 Stephen Rothwell
2015-05-25 16:28 ` Greg KH
2015-05-26 11:08   ` Dave Martin
2014-11-26  7:12 Stephen Rothwell
2014-11-26 19:51 ` Greg KH
2014-11-10  4:49 Stephen Rothwell
2014-11-10  5:08 ` Greg KH
2013-01-17  2:07 Stephen Rothwell
2013-01-18  1:27 ` Greg KH
2012-04-19  4:59 Stephen Rothwell
2012-04-19 20:07 ` Greg KH
2012-04-23 16:40 ` Greg KH
2011-11-18  3:30 Stephen Rothwell
2011-11-18  8:41 ` Jiri Slaby
2011-11-18 16:18 ` Greg KH
2011-11-27  4:08 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240419141947.4bc16fa4@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=greg@kroah.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).