Bug 147583 - [puc] [patch] sys/dev/puc/pucdata.c: incorrect clock value for Oxford OX16PCI954
Summary: [puc] [patch] sys/dev/puc/pucdata.c: incorrect clock value for Oxford OX16PCI954
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: John Baldwin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-06 22:20 UTC by Craig Leres
Modified: 2011-06-08 22:23 UTC (History)
0 users

See Also:


Attachments
pciconf-lv-patched.log (6.66 KB, text/plain)
2011-04-29 21:53 UTC, Craig Leres
no flags Details
pciconf-lv.log (6.66 KB, text/plain)
2011-04-29 21:53 UTC, Craig Leres
no flags Details
LBLSMPIPV6 (12.67 KB, text/plain)
2011-04-29 21:53 UTC, Craig Leres
no flags Details
messages.txt (18.53 KB, text/plain)
2011-04-29 21:53 UTC, Craig Leres
no flags Details
devinfo.txt (14.56 KB, text/plain)
2011-05-02 18:43 UTC, Craig Leres
no flags Details
kgdb.txt (2.28 KB, text/plain)
2011-05-03 00:51 UTC, Craig Leres
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Leres freebsd_committer freebsd_triage 2010-06-06 22:20:03 UTC
	The SIIG Quartet Serial 850 4 serial port PCI card
	(JJ-P04011-S6) uses the Oxford Semiconductor OX16PCI954.
	The kernel IDs it correctly (see attached file dmesg.txt)
	however the ports do not work.

Fix: This is a multi-part message in MIME format.
 --------------070007060506000901040208
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
	I found a post with the identical symptoms:

	    http://forums.freebsd.org/showthread.php?t=5133

	It's a slightly different version of the card (vendor
	0x1415/device 0x950a) but the same chip is used and the
	supplied fix works.

	The attached patch corrects the clock for both SIIG 4 port
	cards.

	I bet the other SIIG card that uses the OX16PCI954 (vendor
	0x1415/device 0x9511) probably needs this change but I don't
	have one so I can't test this.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwMD6AACgkQWxlAhAje3JvK2wCfYcQNWY6C3l7bjLwg5d7N4JNE
gNwAoJA6gzUegyZfMxxMX2CbUARrRXG4
=gmrw
-----END PGP SIGNATURE-----

--------------070007060506000901040208
Content-Type: text/plain;
 name="dmesg.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="dmesg.txt"

puc0: <Oxford Semiconductor OX16PCI954 UARTs> port 0x4020-0x403f,0x4000-0x401f mem 0xd0301000-0xd0301fff,0xd0300000-0xd0300fff irq 20 at device 0.0 on pci17
puc0: [FILTER]
uart0: <16950 or compatible> on puc0
uart0: [FILTER]
uart1: <16950 or compatible> on puc0
uart1: [FILTER]
uart2: <16950 or compatible> on puc0
uart2: [FILTER]
uart3: <16950 or compatible> on puc0
uart3: [FILTER]


--------------070007060506000901040208
Content-Type: text/plain;
 name="patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch.txt"



--------------070007060506000901040208
Content-Type: application/octet-stream;
 name="dmesg.txt.sig"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="dmesg.txt.sig"

iEYEABECAAYFAkwMD6AACgkQWxlAhAje3JvNTQCfUBcoX9FQR9Yzs2OWFMiet+WSNn0An0xn
0h6d/XN5415BFpnDAwMcxzyU
--------------070007060506000901040208
Content-Type: application/octet-stream;
 name="patch.txt.sig"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="patch.txt.sig"

iEYEABECAAYFAkwMD6AACgkQWxlAhAje3JttsQCfWvR6mbg6zxmi7HimH2uR/pdYkisAn0nN
8Q3vQKIAaQD4hiK7I3AzNyds
--------------070007060506000901040208----NNrATPKLKe5PTUTXUORlV61dd8OYa1wBUMFeNdhQE5PxuiCQ
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- pucdata.c.virgin	2010-06-06 14:05:46.000000000 -0700
+++ pucdata.c	2010-06-06 14:08:43.000000000 -0700
@@ -633,13 +633,13 @@
 
 	{   0x1415, 0x9501, 0xffff, 0,
 	    "Oxford Semiconductor OX16PCI954 UARTs",
-	    DEFAULT_RCLK,
+	    DEFAULT_RCLK * 10,
 	    PUC_PORT_4S, 0x10, 0, 8,
 	},
 
 	{   0x1415, 0x950a, 0xffff, 0,
 	    "Oxford Semiconductor OX16PCI954 UARTs",
-	    DEFAULT_RCLK,
+	    DEFAULT_RCLK * 10,
 	    PUC_PORT_4S, 0x10, 0, 8,
 	},
 
How-To-Repeat: 	pciconf -l shows:

	    puc0@pci0:17:0:0:       class=0x070006 card=0x2052131f
chip=0x95011415 rev=0x00 hdr=0x00

	(vendor 0x1415/device 0x9501)
Comment 1 John Baldwin freebsd_committer freebsd_triage 2011-04-28 20:29:09 UTC
Please try this patch and see if it allows your device to work:

Index: pucdata.c
===================================================================
--- pucdata.c	(revision 221182)
+++ pucdata.c	(working copy)
@@ -638,6 +638,13 @@ const struct puc_cfg puc_pci_devices[] = {
  	    PUC_PORT_4S, 0x10, 0, 8,
  	},

+	/* PR: kern/147583 */
+	{   0x1415, 0x9501, 0x131f, 0x2052,
+	    "SIIG Quartet Serial 850",
+	    DEFAULT_RCLK * 10,
+	    PUC_PORT_4S, 0x10, 0, 8,
+	},
+
  	{   0x1415, 0x9501, 0xffff, 0,
  	    "Oxford Semiconductor OX16PCI954 UARTs",
  	    DEFAULT_RCLK,

-- 
John Baldwin
Comment 2 Craig Leres freebsd_committer freebsd_triage 2011-04-29 21:53:05 UTC
On 04/28/11 12:29, John Baldwin wrote:
> Please try this patch and see if it allows your device to work:

Hum... I was running 7.2-RELEASE last summer when I posted the PR. Since
then I've switched to 8.2-RELEASE and stopped using the cards. My kernel
was built from 8-RELENG yesterday.

Today I dusted off one of the cards and I installed it but the driver
does not create any /dev entries with or without the patch. It does id
the card

I've attached pciconf -lv output from kernels with and without the patch
along with my kernel config and messages from one of the bootups with
the patch applied. Hopefully it's obvious what I'm doing wrong.

		Craig
Comment 3 John Baldwin freebsd_committer freebsd_triage 2011-05-02 15:27:24 UTC
On Friday, April 29, 2011 4:53:05 pm Craig Leres wrote:
> On 04/28/11 12:29, John Baldwin wrote:
> > Please try this patch and see if it allows your device to work:
> 
> Hum... I was running 7.2-RELEASE last summer when I posted the PR. Since
> then I've switched to 8.2-RELEASE and stopped using the cards. My kernel
> was built from 8-RELENG yesterday.
> 
> Today I dusted off one of the cards and I installed it but the driver
> does not create any /dev entries with or without the patch. It does id
> the card
> 
> I've attached pciconf -lv output from kernels with and without the patch
> along with my kernel config and messages from one of the bootups with
> the patch applied. Hopefully it's obvious what I'm doing wrong.

Hmm, what does 'devinfo -rv' show?

-- 
John Baldwin
Comment 4 Craig Leres freebsd_committer freebsd_triage 2011-05-02 18:43:30 UTC
> Hmm, what does 'devinfo -rv' show?

Attached.

After booting I can see cuau0 and cuau1 (motherboard serials) and one
ttyU0 (FTDI serial) but no puc ports.

		Craig
Comment 5 John Baldwin freebsd_committer freebsd_triage 2011-05-02 19:16:48 UTC
On Monday, May 02, 2011 1:43:30 pm Craig Leres wrote:
> 
> > Hmm, what does 'devinfo -rv' show?
> 
> Attached.
> 
> After booting I can see cuau0 and cuau1 (motherboard serials) and one
> ttyU0 (FTDI serial) but no puc ports.

Hmmmm.  Can you download my gdb scripts from www.freebsd.org/~jhb/gdb/ into a 
directory, and then do this:

# cd /path/to/gdb/scripts
# kgdb      (as root)
...
(kgdb) source gdb6
(kgdb) devinfo
.. (will list all devices in system, look for puc0, I will use mfi0
    in my example here)
     pcib2 0xffffff00034e5d00 (0xffffff0003517080)
      pci2 0xffffff0003502300 (0x0)
       mfi0 0xffffff00034e7600 (0xffffff00034f9c00)
        mfip0 0xffffff00034e5400 (0x0)
        mfid0 0xffffff0003354e00 (0xffffff0003adf140)
... (the value after the parens is the 'softc' pointer)
(kgdb) set $sc = (struct puc_softc *)0xffffff00034f9c00
(kgdb) p *$sc

I mostly care about the output from the last command if you could provide 
that.  It's odd that puc isn't adding any child devices.

-- 
John Baldwin
Comment 6 Craig Leres freebsd_committer freebsd_triage 2011-05-03 00:51:58 UTC
> Hmmmm.  Can you download my gdb scripts from www.freebsd.org/~jhb/gdb/ into a 
> directory, and then do this:

I had to tweak the scrips a bit (machine_arch doesn't exist) but I've
attached the output.

		Craig
Comment 7 John Baldwin freebsd_committer freebsd_triage 2011-05-03 13:17:35 UTC
On Monday, May 02, 2011 7:51:58 pm Craig Leres wrote:
> 
> > Hmmmm.  Can you download my gdb scripts from www.freebsd.org/~jhb/gdb/ 
into a 
> > directory, and then do this:
> 
> I had to tweak the scrips a bit (machine_arch doesn't exist) but I've
> attached the output.

Hmm, ok.  I suspect that this code is what is failing in puc_bfe_attach():

	/* Probe and attach our children. */
	for (idx = 0; idx < sc->sc_nports; idx++) {
		port = &sc->sc_port[idx];
		if (port->p_dev == NULL)
			continue;
		error = device_probe_and_attach(port->p_dev);
		if (error) {
			device_delete_child(dev, port->p_dev);
			port->p_dev = NULL;
		}
	}

Can you add some printfs to that to verify that that is failing and what error 
it is returning?  Might need to add some more printfs to figure out why uart 
is failing to probe as well in the uart driver.

-- 
John Baldwin
Comment 8 Craig Leres freebsd_committer freebsd_triage 2011-05-10 01:48:34 UTC
On 05/03/11 05:17, John Baldwin wrote:
> Can you add some printfs to that to verify that that is failing
> and what error it is returning?  Might need to add some more
> printfs to figure out why uart is failing to probe as well in the
> uart driver.

I started to add printf's to puc.c but decided it was time to get gdb
over serial working again. By the time I got that set up, the puc ports
were working.

Anyway, I can now verify that the patch you sent me (PR: kern/147583) works:

    puc0: <SIIG Quartet Serial 850> port 0x3020-0x303f,0x3000-0x301f mem
0xd0205000-0xd0205fff,0xd0204000-0xd0204fff irq 20 at device 0.0 on pci17

I connected it to one of the motherboard ports using a crossover cable
and was able to send characters in both directions.

		Craig
Comment 9 dfilter service freebsd_committer freebsd_triage 2011-05-10 13:40:53 UTC
Author: jhb
Date: Tue May 10 12:40:35 2011
New Revision: 221731
URL: http://svn.freebsd.org/changeset/base/221731

Log:
  Add an entry for the SIIG Quartet Serial 850 which uses an Oxford
  chip with a non-default clock.
  
  PR:		kern/147583
  MFC after:	1 week

Modified:
  head/sys/dev/puc/pucdata.c

Modified: head/sys/dev/puc/pucdata.c
==============================================================================
--- head/sys/dev/puc/pucdata.c	Tue May 10 11:14:40 2011	(r221730)
+++ head/sys/dev/puc/pucdata.c	Tue May 10 12:40:35 2011	(r221731)
@@ -638,6 +638,12 @@ const struct puc_cfg puc_pci_devices[] =
 	    PUC_PORT_4S, 0x10, 0, 8,
 	},
 
+	{   0x1415, 0x9501, 0x131f, 0x2052,
+	    "SIIG Quartet Serial 850",
+	    DEFAULT_RCLK * 10,
+	    PUC_PORT_4S, 0x10, 0, 8,
+	},
+
 	{   0x1415, 0x9501, 0x14db, 0x2150,
 	    "Kuroutoshikou SERIAL4P-LPPCI2",
 	    DEFAULT_RCLK * 10,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 10 John Baldwin freebsd_committer freebsd_triage 2011-05-10 13:41:35 UTC
State Changed
From-To: open->patched

Fix committed to HEAD. 


Comment 11 John Baldwin freebsd_committer freebsd_triage 2011-05-10 13:41:35 UTC
Responsible Changed
From-To: freebsd-bugs->jhb

Fix committed to HEAD.
Comment 12 John Baldwin freebsd_committer freebsd_triage 2011-06-08 22:23:39 UTC
State Changed
From-To: patched->closed

Fix merged to 8.