Skip to contentSkip to conversation

New: 3w-{9,x}xxx don't work on big-endian MIPS

Bug 25192 [email protected] 1 participant 18 messages Dec 18, 2010 – May 4, 2012 SCSI

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=25192

Summary: 3w-{9,x}xxx don't work on big-endian MIPS
Product: SCSI Drivers
Version: 2.5
Kernel Version: 2.6.37
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Other
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Regression: No

Created an attachment (id=40762)
--> (https://bugzilla.kernel.org/attachment.cgi?id=40762)
3ware-8006: lspci, dmesg, /proc/io{mem,ports}

Using the linux-mips tree,

commit 1c334766ddc8ae7b12f3a12e0d06fe3895c5a5a7

Author: Ralf Baechle <[email protected]>
Date:   Wed Dec 1 17:33:17 2010 +0000

I've been trying to use either a 3ware 8006 (3w-xxxx driver) or 3ware 9500s (3w-9xxx driver) in my Broadcom BCM91250a big-endian MIPS system.

I see commits 75913d9bb8328c4eca54cad39a5fb665b48383eb which added big-endian support.

Please tell me what I can do to help debug this.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#1 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #1 from Matt Turner <[email protected]> 2010-12-18 23:57:01 --- Created an attachment (id=40772)
--> (https://bugzilla.kernel.org/attachment.cgi?id=40772)
3ware-9500s: lspci, dmesg, /proc/io{mem,ports}

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#2 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

Adam Radford <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Adam Radford <[email protected]> 2010-12-19 01:47:31 --- The byte swap macros were never added to 3w-xxxx.

Can you re-post 3w-9xxx lspci,dmesg, /proc/io{mem,port} attachment?

The attachment doesn't actually contain what you reported it to.

-Adam

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#3 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

Matt Turner <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

  Attachment #40772|0                           |1

is obsolete| |

--- Comment #3 from Matt Turner <[email protected]> 2010-12-19 02:34:28 --- Created an attachment (id=40782)
--> (https://bugzilla.kernel.org/attachment.cgi?id=40782)
3ware-9500s: lspci, dmesg, /proc/io{mem,ports}

Whoops. Sorry about that. Reattached.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#4 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #4 from Adam Radford <[email protected]> 2010-12-19 06:54:48 --- Matt,

What slot do you have the card in, 32-bit or 64-bit? Can you try the other size slot? I.E. 32->64 or 64->32.

This driver and card is known to work on ppc32 Linux and ppc64 Linux. I did the big-endian driver changes and tested on my Apple G3 (32-bit) and G5 (64-bit).

Are you local to Silicon Valley?

-Adam

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#5 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #5 from Matt Turner <[email protected]> 2010-12-19 07:02:43 --- (In reply to comment #4)

Quoted 2 lines

What slot do you have the card in, 32-bit or 64-bit? Can you try the other size slot? I.E. 32->64 or 64->32.

It's in a 64-bit slot, and the edge of the 32-bit slots is too thick for the card to fit, so no-can-do.

Quoted 1 line

Are you local to Silicon Valley?

No. :(

I'll cover twa_probe() with printks and report back tomorrow.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#6 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #6 from Adam Radford <[email protected]> 2010-12-19 17:49:10 --- No need to add prints to twa_probe().

In twa_poll_response(), just add this printk() and report the results:

response_queue.value = readl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));

printk(KERN_WARNING "3w-9xxx: response_queue.value = 0x%x, request_id = 0x%x\n", response_queue.value, request_id);

response_request_id = TW_RESID_OUT(response_queue.response_id);

if (request_id != response_request_id) {
        TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1e, "Found unexpected request id
while polling for response");
        goto out;
}

We call twa_empty_response_queue() before this to junk garbage responses in the reigsters on power-up, so if we don't see anything even remotely close to the correct response in response_queue.value, that will tell us a lot.

-Adam

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#7 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #7 from [email protected] 2010-12-19 18:04:31 --- 64-bit PCI slots on the Sibyte evaluation boards are implemented using a Hypertransport-to-PCI bridge. Hypertransport however uses a separate port address space from the native 32-bit PCI slots that port x on 32-bit PCI is different from port x on the Hypertransport. Memory mapped I/O is not affected by the issue.

The in/out functions don't know which of the busses / port address spaces they're operating on so they're always using the first bus that is the 32-bit PCI bus. Note that the new style API with iomap() / ioreadX() / iowriteX() is not affected by this problem.

Would that explain the bug?

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#8 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #8 from Adam Radford <[email protected]> 2010-12-19 19:16:23 --- Ralf,

The 3w-9xxx driver is currently calling ioremap(), then using readl()/writel() calls for memory mapped I/O.

Are you suggesting we need to call iomap() and ioread32/iowrite32() for MIPS to work?

-Adam

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#9 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #9 from [email protected] 2010-12-19 20:41:10 --- No.

The issue I mentioned only exists for ioports, those little critters accessed with inX / outX instructions on x86. readl / writel etc. are working ok afair.

And again it's only this multi-bus scenario that is affected.

Ralf

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#10 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #10 from Matt Turner <[email protected]> 2010-12-19 21:30:30 --- Created an attachment (id=40932)
--> (https://bugzilla.kernel.org/attachment.cgi?id=40932)
9500s debugging

Doesn't look bizarre to me.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#11 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #11 from Matt Turner <[email protected]> 2010-12-20 03:42:51 --- I tried in booting the system in little-endian mode, and it crashes in the same way. The added printk statements print exactly what they print when in big-endian mode.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#12 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #12 from Adam Radford <[email protected]> 2010-12-20 17:05:52 --- Matt,

You can prevent the crash from happening by commenting out or removing this line:

printk(KERN_WARNING "3w-9xxx: scsi%d: Firmware %s, BIOS %s, Ports: %d.\n",

        host->host_no,
        (char *)twa_get_param(tw_dev, 0, TW_VERSION_TABLE,
        TW_PARAM_FWVER, TW_PARAM_FWVER_LENGTH),
        (char *)twa_get_param(tw_dev, 1, TW_VERSION_TABLE,
        TW_PARAM_BIOSVER, TW_PARAM_BIOSVER_LENGTH),
        le32_to_cpu(*(int *)twa_get_param(tw_dev, 2, TW_INFORMATION_TABLE,
        TW_PARAM_PORTCOUNT, TW_PARAM_PORTCOUNT_LENGTH)));

I was a little over-zealous in assuming the controller would be responding here, or you would have already hung the system in POST.

At this point, since your card won't work in little-endian mode, I am guessing:

1. Your card is bad, which you could test by trying another 9500-S card.
2. The PCI slot you are trying is somehow incompatible with the 3ware hardware.

-Adam

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#13 lore raw

[Bug 25192] 3w-{9,x}xxx don't work on big-endian MIPS

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #13 from Matt Turner <[email protected]> 2010-12-22 19:27:47 --- I've confirmed that the card works in an AMD64 system (with a few unknown opcode messages in dmesg, but I suppose that's nothing particularly strange).

Ralf, do you have any ideas about why it wouldn't work with this board?

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#14 lore raw

[Bug 25192] PCI doesn't work on BCM91250A MIPS board

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

Matt Turner <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|3w-{9,x}xxx don't work on   |PCI doesn't work on
                   |big-endian MIPS             |BCM91250A MIPS board

--- Comment #14 from Matt Turner <[email protected]> 2011-03-03 19:48:59 ---
http://www.cyrius.com/debian/bcm91250a/hardware.html lists hardware that is confirmed working with the bcm91250a.

When I received it, it had installed a Silicon Image card, which I've confirmed doesn't work, much in the same way everything else doesn't work with recent kernels. I can only imagine that it used to work, since it was installed.

At the time, I think the system had 2.6.18 on it, so I guess I'll confirm that .18 works and then try to bisect.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#15 lore raw

[Bug 25192] PCI doesn't work on BCM91250A MIPS board

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #15 from Matt Turner <[email protected]> 2011-06-05 05:19:48 --- Created an attachment (id=60822)
--> (https://bugzilla.kernel.org/attachment.cgi?id=60822)
9500S debugging - 1GB RAM

Adam,

This board has a strange memory layout, which screws with PCI cards if you have more than 1GB of RAM, so the attached file is the debugging statement you requested with only 1GB of RAM installed (I had 2GB installed before). (In big-endian mode this time)

As you can see, there's no catastrophic null pointer dereference. Perhaps this is useful? Let me know, thanks.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#16 lore raw

[Bug 25192] PCI doesn't work on BCM91250A MIPS board

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

--- Comment #16 from Matt Turner <[email protected]> 2011-06-05 05:24:44 --- I should have added that with 1GB of RAM, a 32-bit sata_sil card, 32-bit aic7xxx scsi card, and a 64-bit tg3 ethernet card work. With 2GB RAM, only the 64-bit tg3 ethernet card works.

The 3Ware 9500S is the only card I've tried that's failed with 1GB of RAM.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#17 lore raw

[Bug 25192] PCI doesn't work on BCM91250A MIPS board

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=25192

Matt Turner <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |WILL_NOT_FIX

--- Comment #17 from Matt Turner <[email protected]> 2012-05-04 00:07:27 --- I gave up on the 3Ware 9500S and got a 64-bit PCI silicon image SATA controller that works fine.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.