aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-03-27 06:56:01 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2013-04-30 14:30:16 -0400
commit67672134aaafd520a61dda448a662336e8fde236 (patch)
tree874ff8c53e6b89451619be290bce259b99f407fb /drivers/firewire
parentde97cb64a959fe5ccf828b02d3a78de9f9defb67 (diff)
firewire: ohci: Improve bus reset error messages
Many of the error messages possible from bus_reset_work() do not contain enough information to distinguish which error condition occurred nor enough information to evaluate the error afterwards. Differentiate all error conditions in bus_reset_work(); add additional information to make error diagnosis possible. [Stefan R: fixed self-ID endian conversion] Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/ohci.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 925a2a6fe68f..c64b4801adaa 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -1911,7 +1911,7 @@ static void bus_reset_work(struct work_struct *work)
1911 1911
1912 reg = reg_read(ohci, OHCI1394_SelfIDCount); 1912 reg = reg_read(ohci, OHCI1394_SelfIDCount);
1913 if (reg & OHCI1394_SelfIDCount_selfIDError) { 1913 if (reg & OHCI1394_SelfIDCount_selfIDError) {
1914 ohci_notice(ohci, "inconsistent self IDs\n"); 1914 ohci_notice(ohci, "self ID receive error\n");
1915 return; 1915 return;
1916 } 1916 }
1917 /* 1917 /*
@@ -1923,7 +1923,7 @@ static void bus_reset_work(struct work_struct *work)
1923 self_id_count = (reg >> 3) & 0xff; 1923 self_id_count = (reg >> 3) & 0xff;
1924 1924
1925 if (self_id_count > 252) { 1925 if (self_id_count > 252) {
1926 ohci_notice(ohci, "inconsistent self IDs\n"); 1926 ohci_notice(ohci, "bad selfIDSize (%08x)\n", reg);
1927 return; 1927 return;
1928 } 1928 }
1929 1929
@@ -1931,7 +1931,10 @@ static void bus_reset_work(struct work_struct *work)
1931 rmb(); 1931 rmb();
1932 1932
1933 for (i = 1, j = 0; j < self_id_count; i += 2, j++) { 1933 for (i = 1, j = 0; j < self_id_count; i += 2, j++) {
1934 if (ohci->self_id_cpu[i] != ~ohci->self_id_cpu[i + 1]) { 1934 u32 id = cond_le32_to_cpu(ohci->self_id_cpu[i]);
1935 u32 id2 = cond_le32_to_cpu(ohci->self_id_cpu[i + 1]);
1936
1937 if (id != ~id2) {
1935 /* 1938 /*
1936 * If the invalid data looks like a cycle start packet, 1939 * If the invalid data looks like a cycle start packet,
1937 * it's likely to be the result of the cycle master 1940 * it's likely to be the result of the cycle master
@@ -1939,19 +1942,17 @@ static void bus_reset_work(struct work_struct *work)
1939 * so far are valid and should be processed so that the 1942 * so far are valid and should be processed so that the
1940 * bus manager can then correct the gap count. 1943 * bus manager can then correct the gap count.
1941 */ 1944 */
1942 if (cond_le32_to_cpu(ohci->self_id_cpu[i]) 1945 if (id == 0xffff008f) {
1943 == 0xffff008f) { 1946 ohci_notice(ohci, "ignoring spurious self IDs\n");
1944 ohci_notice(ohci,
1945 "ignoring spurious self IDs\n");
1946 self_id_count = j; 1947 self_id_count = j;
1947 break; 1948 break;
1948 } else {
1949 ohci_notice(ohci, "inconsistent self IDs\n");
1950 return;
1951 } 1949 }
1950
1951 ohci_notice(ohci, "bad self ID %d/%d (%08x != ~%08x)\n",
1952 j, self_id_count, id, id2);
1953 return;
1952 } 1954 }
1953 ohci->self_id_buffer[j] = 1955 ohci->self_id_buffer[j] = id;
1954 cond_le32_to_cpu(ohci->self_id_cpu[i]);
1955 } 1956 }
1956 1957
1957 if (ohci->quirks & QUIRK_TI_SLLZ059) { 1958 if (ohci->quirks & QUIRK_TI_SLLZ059) {
@@ -1964,7 +1965,7 @@ static void bus_reset_work(struct work_struct *work)
1964 } 1965 }
1965 1966
1966 if (self_id_count == 0) { 1967 if (self_id_count == 0) {
1967 ohci_notice(ohci, "inconsistent self IDs\n"); 1968 ohci_notice(ohci, "no self IDs\n");
1968 return; 1969 return;
1969 } 1970 }
1970 rmb(); 1971 rmb();