linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Chuck Ebbert <cebbert@redhat.com>,
	Domenico Andreoli <cavokz@gmail.com>,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Robert Reif <reif@earthlink.net>,
	"David S. Miller" <davem@davemloft.net>
Subject: [patch 06/37] sparc: sunzilog uart order
Date: Tue, 13 May 2008 13:11:45 -0700	[thread overview]
Message-ID: <20080513201145.GG31167@suse.de> (raw)
In-Reply-To: <20080513201053.GA31167@suse.de>

[-- Attachment #1: sparc-sunzilog-uart-order.patch --]
[-- Type: text/plain, Size: 3774 bytes --]

2.6.25-stable review patch.  If anyone has any objections, please let us
know.

------------------
From: Robert Reif <reif@earthlink.net>

[ Upstream commit: 227739bf4c110bbd02d0c0f13b272c32de406e4c ]

I have a sparcstation 20 clone with a lot of on board serial ports.
The serial core code assumes that uarts are assigned contiguously
and that may not be the case when there are multiple zs devices
present.  This patch insures that uart chips are placed in front of
keyboard/mouse chips in the port table.

ffd37420: ttyS0 at MMIO 0xf1100000 (irq = 44) is a zs (ESCC)
Console: ttyS0 (SunZilog zs0)
console [ttyS0] enabled
ffd37420: ttyS1 at MMIO 0xf1100004 (irq = 44) is a zs (ESCC)
ffd37500: Keyboard at MMIO 0xf1000000 (irq = 44) is a zs
ffd37500: Mouse at MMIO 0xf1000004 (irq = 44) is a zs
ffd3c5c0: ttyS2 at MMIO 0xf1100008 (irq = 44) is a zs (ESCC)
ffd3c5c0: ttyS3 at MMIO 0xf110000c (irq = 44) is a zs (ESCC)
ffd3c6a0: ttyS4 at MMIO 0xf1100010 (irq = 44) is a zs (ESCC)
ffd3c6a0: ttyS5 at MMIO 0xf1100014 (irq = 44) is a zs (ESCC)
ffd3c780: ttyS6 at MMIO 0xf1100018 (irq = 44) is a zs (ESCC)
ffd3c780: ttyS7 at MMIO 0xf110001c (irq = 44) is a zs (ESCC)

Signed-off-by: Robert Reif <reif@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/serial/sunzilog.c |   30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1015,6 +1015,7 @@ static struct uart_ops sunzilog_pops = {
 	.verify_port	=	sunzilog_verify_port,
 };
 
+static int uart_chip_count;
 static struct uart_sunzilog_port *sunzilog_port_table;
 static struct zilog_layout __iomem **sunzilog_chip_regs;
 
@@ -1350,16 +1351,22 @@ static int zilog_irq = -1;
 
 static int __devinit zs_probe(struct of_device *op, const struct of_device_id *match)
 {
-	static int inst;
+	static int kbm_inst, uart_inst;
+	int inst;
 	struct uart_sunzilog_port *up;
 	struct zilog_layout __iomem *rp;
-	int keyboard_mouse;
+	int keyboard_mouse = 0;
 	int err;
 
-	keyboard_mouse = 0;
 	if (of_find_property(op->node, "keyboard", NULL))
 		keyboard_mouse = 1;
 
+	/* uarts must come before keyboards/mice */
+	if (keyboard_mouse)
+		inst = uart_chip_count + kbm_inst;
+	else
+		inst = uart_inst;
+
 	sunzilog_chip_regs[inst] = of_ioremap(&op->resource[0], 0,
 					      sizeof(struct zilog_layout),
 					      "zs");
@@ -1427,6 +1434,7 @@ static int __devinit zs_probe(struct of_
 				   rp, sizeof(struct zilog_layout));
 			return err;
 		}
+		uart_inst++;
 	} else {
 		printk(KERN_INFO "%s: Keyboard at MMIO 0x%llx (irq = %d) "
 		       "is a %s\n",
@@ -1438,12 +1446,11 @@ static int __devinit zs_probe(struct of_
 		       op->dev.bus_id,
 		       (unsigned long long) up[1].port.mapbase,
 		       op->irqs[0], sunzilog_type(&up[1].port));
+		kbm_inst++;
 	}
 
 	dev_set_drvdata(&op->dev, &up[0]);
 
-	inst++;
-
 	return 0;
 }
 
@@ -1491,28 +1498,25 @@ static struct of_platform_driver zs_driv
 static int __init sunzilog_init(void)
 {
 	struct device_node *dp;
-	int err, uart_count;
-	int num_keybms;
+	int err;
+	int num_keybms = 0;
 	int num_sunzilog = 0;
 
-	num_keybms = 0;
 	for_each_node_by_name(dp, "zs") {
 		num_sunzilog++;
 		if (of_find_property(dp, "keyboard", NULL))
 			num_keybms++;
 	}
 
-	uart_count = 0;
 	if (num_sunzilog) {
-		int uart_count;
-
 		err = sunzilog_alloc_tables(num_sunzilog);
 		if (err)
 			goto out;
 
-		uart_count = (num_sunzilog * 2) - (2 * num_keybms);
+		uart_chip_count = num_sunzilog - num_keybms;
 
-		err = sunserial_register_minors(&sunzilog_reg, uart_count);
+		err = sunserial_register_minors(&sunzilog_reg,
+						uart_chip_count * 2);
 		if (err)
 			goto out_free_tables;
 	}

-- 

  parent reply	other threads:[~2008-05-13 20:14 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080513200453.064446337@mini.kroah.org>
2008-05-13 20:10 ` [patch 00/37] 2.6.25.4 -stable review Greg KH
2008-05-13 20:11   ` [patch 01/37] V4L/DVB (7473): PATCH for various Dibcom based devices Greg KH
2008-05-14  1:27     ` Michael Krufky
2008-05-14  2:03       ` Greg KH
2008-05-14  2:34         ` Michael Krufky
2008-05-14  2:59           ` Greg KH
2008-05-13 20:11   ` [patch 02/37] vt: fix canonical input in UTF-8 mode Greg KH
2008-05-13 20:11   ` [patch 03/37] serial: access after NULL check in uart_flush_buffer() Greg KH
2008-05-13 20:11   ` [patch 04/37] OHCI: fix regression upon awakening from hibernation Greg KH
2008-05-13 20:11   ` [patch 05/37] XFRM: AUDIT: Fix flowlabel text format ambibuity Greg KH
2008-05-13 20:11   ` Greg KH [this message]
2008-05-13 20:11   ` [patch 07/37] sparc: Fix SA_ONSTACK signal handling Greg KH
2008-05-13 20:11   ` [patch 08/37] sparc: Fix fork/clone/vfork system call restart Greg KH
2008-05-13 20:11   ` [patch 09/37] sparc64: Stop creating dummy root PCI host controller devices Greg KH
2008-05-13 20:11   ` [patch 10/37] sparc64: Fix wedged irq regression Greg KH
2008-05-13 20:11   ` [patch 11/37] SPARC64: Fix args to 64-bit sys_semctl() via sys_ipc() Greg KH
2008-05-13 20:11   ` [patch 12/37] serial: Fix sparc driver name strings Greg KH
2008-05-13 20:12   ` [patch 13/37] sch_htb: remove from event queue in htb_parent_to_leaf() Greg KH
2008-05-13 20:12   ` [patch 14/37] macvlan: Fix memleak on device removal/crash on module removal Greg KH
2008-05-13 20:12   ` [patch 15/37] ipvs: fix oops in backup for fwmark conn templates Greg KH
2008-05-13 20:12   ` [patch 16/37] dccp: return -EINVAL on invalid feature length Greg KH
2008-05-13 20:12   ` [patch 17/37] can: Fix can_send() handling on dev_queue_xmit() failures Greg KH
2008-05-13 20:12   ` [patch 18/37] x86: use defconfigs from x86/configs/* Greg KH
2008-05-13 20:12   ` [patch 19/37] nf_conntrack: padding breaks conntrack hash on ARM Greg KH
2008-05-13 20:12   ` [patch 20/37] {nfnetlink, ip, ip6}_queue: fix skb_over_panic when enlarging packets Greg KH
2008-05-13 23:45     ` Arnaud Ebalard
2008-05-13 22:06       ` Greg KH
2008-05-14 16:45         ` Gustavo Guillermo Perez
2008-05-14 17:08           ` Patrick McHardy
2008-05-13 20:12   ` [patch 21/37] ata_piix: verify SIDPR access before enabling it Greg KH
2008-05-13 20:12   ` [patch 22/37] x86: sysfs cpu?/topology is empty in 2.6.25 (32-bit Intel system) Greg KH
2008-05-15 18:06     ` Vaidyanathan Srinivasan
2008-05-15 20:07       ` Greg KH
2008-05-13 20:12   ` [patch 23/37] i2c-piix4: Blacklist two mainboards Greg KH
2008-05-14 19:52     ` Hardware designt to prevent Damages... [WAS: [patch 23/37] i2c-piix4: Blacklist two mainboards] Michelle Konzack
2008-05-15 17:57       ` linux-os (Dick Johnson)
2008-05-16  9:55         ` Michelle Konzack
2008-05-15 18:49       ` Jean Delvare
2008-05-16 15:22         ` Michelle Konzack
2008-05-13 20:12   ` [patch 24/37] sparc: Fix ptrace() detach Greg KH
2008-05-13 20:12   ` [patch 25/37] sparc: Fix mremap address range validation Greg KH
2008-05-13 20:28     ` Linus Torvalds
2008-05-13 20:37       ` Greg KH
2008-05-14  1:04         ` David Miller
2008-05-14  1:03       ` David Miller
2008-05-13 20:12   ` [patch 26/37] sparc: Fix debugger syscall restart interactions Greg KH
2008-05-13 20:12   ` [patch 27/37] sparc32: Dont twiddle PT_DTRACE in exec Greg KH
2008-05-13 20:12   ` [patch 28/37] USB: airprime: unlock mutex instead of trying to lock it again Greg KH
2008-05-13 20:12   ` [patch 29/37] r8169: fix past rtl_chip_info array size for unknown chipsets Greg KH
2008-05-13 20:12   ` [patch 30/37] r8169: fix oops in r8169_get_mac_version Greg KH
2008-05-13 20:12   ` [patch 31/37] SCSI: qla1280: Fix queue depth problem Greg KH
2008-05-13 20:12   ` [patch 32/37] SCSI: libiscsi regression in 2.6.25: fix nop timer handling Greg KH
2008-05-13 20:12   ` [patch 33/37] SCSI: libiscsi regression in 2.6.25: fix setting of recv timer Greg KH
2008-05-13 20:12   ` [patch 34/37] SCSI: aha152x: Fix oops on module removal Greg KH
2008-05-13 20:12   ` [patch 35/37] SCSI: aha152x: fix init suspiciously returned 1, it should follow 0/-E convention Greg KH
2008-05-13 20:12   ` [patch 36/37] rtc: rtc_time_to_tm: use unsigned arithmetic Greg KH
2008-05-13 20:12   ` [patch 37/37] md: fix raid5 repair operations 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=20080513201145.GG31167@suse.de \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=cavokz@gmail.com \
    --cc=cebbert@redhat.com \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkrufky@linuxtv.org \
    --cc=rdunlap@xenotime.net \
    --cc=reif@earthlink.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=zwane@arm.linux.org.uk \
    /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).