diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-15 14:05:20 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-15 14:05:20 -0700 |
| commit | 8cd954e9929a6cd5e42f25d91ce1e3e0a6365084 (patch) | |
| tree | 3fe03302ae2b5d2dd87d55e7771eeb4af48f2fd6 /tty.current | |
| parent | 25cc1b6cfc1a7af9fdf8ab54c0f6fad37897d9e7 (diff) | |
| download | patches-8cd954e9929a6cd5e42f25d91ce1e3e0a6365084.tar.gz | |
a bunch of bugfixes
Diffstat (limited to 'tty.current')
| -rw-r--r-- | tty.current/tty-take-a-256-byte-padding-into-account-when-buffering-below-sub-page-units.patch | 48 | ||||
| -rw-r--r-- | tty.current/uartlite-fix-build-on-sparc.patch | 58 |
2 files changed, 106 insertions, 0 deletions
diff --git a/tty.current/tty-take-a-256-byte-padding-into-account-when-buffering-below-sub-page-units.patch b/tty.current/tty-take-a-256-byte-padding-into-account-when-buffering-below-sub-page-units.patch new file mode 100644 index 00000000000000..04cb658c97bb46 --- /dev/null +++ b/tty.current/tty-take-a-256-byte-padding-into-account-when-buffering-below-sub-page-units.patch @@ -0,0 +1,48 @@ +From mel@csn.ul.ie Mon Mar 15 13:30:48 2010 +From: Mel Gorman <mel@csn.ul.ie> +Date: Tue, 2 Mar 2010 22:24:19 +0000 +Subject: tty: Take a 256 byte padding into account when buffering below sub-page units +To: Greg KH <gregkh@suse.de> +Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-kernel@vger.kernel.org +Message-ID: <20100302222419.GE11355@csn.ul.ie> +Content-Disposition: inline + +The TTY layer takes some care to ensure that only sub-page allocations +are made with interrupts disabled. It does this by setting a goal of +"TTY_BUFFER_PAGE" to allocate. Unfortunately, while TTY_BUFFER_PAGE takes the +size of tty_buffer into account, it fails to account that tty_buffer_find() +rounds the buffer size out to the next 256 byte boundary before adding on +the size of the tty_buffer. + +This patch adjusts the TTY_BUFFER_PAGE calculation to take into account the +size of the tty_buffer and the padding. Once applied, tty_buffer_alloc() +should not require high-order allocations. + +Signed-off-by: Mel Gorman <mel@csn.ul.ie> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + include/linux/tty.h | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/include/linux/tty.h ++++ b/include/linux/tty.h +@@ -70,12 +70,13 @@ struct tty_buffer { + + /* + * We default to dicing tty buffer allocations to this many characters +- * in order to avoid multiple page allocations. We assume tty_buffer itself +- * is under 256 bytes. See tty_buffer_find for the allocation logic this +- * must match ++ * in order to avoid multiple page allocations. We know the size of ++ * tty_buffer itself but it must also be taken into account that the ++ * the buffer is 256 byte aligned. See tty_buffer_find for the allocation ++ * logic this must match + */ + +-#define TTY_BUFFER_PAGE ((PAGE_SIZE - 256) / 2) ++#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF) + + + struct tty_bufhead { diff --git a/tty.current/uartlite-fix-build-on-sparc.patch b/tty.current/uartlite-fix-build-on-sparc.patch new file mode 100644 index 00000000000000..6bd2aca0d944fb --- /dev/null +++ b/tty.current/uartlite-fix-build-on-sparc.patch @@ -0,0 +1,58 @@ +From davem@davemloft.net Mon Mar 15 13:34:52 2010 +From: David Miller <davem@davemloft.net> +Date: Wed, 03 Mar 2010 02:50:26 -0800 (PST) +Subject: uartlite: Fix build on sparc. +To: linux-kernel@vger.kernel.org +Cc: grant.likely@secretlab.ca +Message-ID: <20100303.025026.243831910.davem@davemloft.net> + +We can get this driver enabled via MFD_TIMBERDALE which only +requires GPIO to be on. + +But the of_address_to_resource() function is only present on +powerpc and microblaze, so we have to conditionalize the +CONFIG_OF probing bits on that. + +Signed-off-by: David S. Miller <davem@davemloft.net> +Acked-by: Grant Likely <grant.likely@secretlab.ca> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/uartlite.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/serial/uartlite.c ++++ b/drivers/serial/uartlite.c +@@ -19,7 +19,7 @@ + #include <linux/interrupt.h> + #include <linux/init.h> + #include <asm/io.h> +-#if defined(CONFIG_OF) ++#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE)) + #include <linux/of.h> + #include <linux/of_device.h> + #include <linux/of_platform.h> +@@ -581,7 +581,7 @@ static struct platform_driver ulite_plat + /* --------------------------------------------------------------------- + * OF bus bindings + */ +-#if defined(CONFIG_OF) ++#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE)) + static int __devinit + ulite_of_probe(struct of_device *op, const struct of_device_id *match) + { +@@ -631,11 +631,11 @@ static inline void __exit ulite_of_unreg + { + of_unregister_platform_driver(&ulite_of_driver); + } +-#else /* CONFIG_OF */ +-/* CONFIG_OF not enabled; do nothing helpers */ ++#else /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */ ++/* Appropriate config not enabled; do nothing helpers */ + static inline int __init ulite_of_register(void) { return 0; } + static inline void __exit ulite_of_unregister(void) { } +-#endif /* CONFIG_OF */ ++#endif /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */ + + /* --------------------------------------------------------------------- + * Module setup/teardown |
