From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13412 invoked by alias); 4 Sep 2007 14:35:50 -0000 Received: (qmail 13385 invoked by uid 22791); 4 Sep 2007 14:35:49 -0000 X-Spam-Status: No, hits=-2.2 required=5.0 tests=BAYES_00,DK_POLICY_SIGNSOME,FORGED_RCVD_HELO,SPF_HELO_PASS,SPF_PASS,SUBJ_HAS_UNIQ_ID,TW_DR X-Spam-Check-By: sourceware.org Received: from pfinc.lightlink.com (HELO mail.pfinc.com) (205.232.89.202) by sourceware.org (qpsmtpd/0.31) with SMTP; Tue, 04 Sep 2007 14:35:41 +0000 Received: from PF_Domain-Message_Server by mail.pfinc.com with Novell_GroupWise; Tue, 04 Sep 2007 10:35:39 -0400 Message-Id: X-Mailer: Novell GroupWise 5.5.5 Date: Tue, 04 Sep 2007 14:35:00 -0000 From: "Stephen Finney" To: Cc: Subject: proposed patch for bugzilla bug 1000281 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_B592232B.5C3D6D58" X-Virus-Checked: Checked by ClamAV on sourceware.org Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2007-09/txt/msg00005.txt.bz2 This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=_B592232B.5C3D6D58 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 79 Gary, Here is my proposed patch for the cs8900a infinite loop bug. Stephen --=_B592232B.5C3D6D58 Content-Type: text/plain Content-Disposition: attachment; filename="cs8900a_infinite_loop.patch" Content-length: 2181 Index: devs/eth/cl/cs8900a/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/eth/cl/cs8900a/current/ChangeLog,v retrieving revision 1.13 diff -u -5 -p -r1.13 ChangeLog --- devs/eth/cl/cs8900a/current/ChangeLog 23 Nov 2005 21:26:50 -0000 1.13 +++ devs/eth/cl/cs8900a/current/ChangeLog 4 Sep 2007 13:26:21 -0000 @@ -1,5 +1,10 @@ +2007-09-04 Stephen Finney + + * add timeout to potential infinite loop in cs8900a_send per + bugzilla report 1000281 + 2005-11-10 Laurent Gonzalez * include/cs8900a.h: * src/if_cs8900a.c: Added a priority field in cpd that makes interrupt priority configurable Index: devs/eth/cl/cs8900a/current/src/if_cs8900a.c =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/eth/cl/cs8900a/current/src/if_cs8900a.c,v retrieving revision 1.13 diff -u -5 -p -r1.13 if_cs8900a.c --- devs/eth/cl/cs8900a/current/src/if_cs8900a.c 23 Nov 2005 21:26:50 -0000 1.13 +++ devs/eth/cl/cs8900a/current/src/if_cs8900a.c 4 Sep 2007 13:15:39 -0000 @@ -503,13 +503,26 @@ cs8900a_send(struct eth_drv_sc *sc, stru // Start only when all data sent to chip HAL_WRITE_UINT16(cpd->base+CS8900A_TxCMD, PP_TxCmd_TxStart_Full); HAL_WRITE_UINT16(cpd->base+CS8900A_TxLEN, total_len); // Wait for controller ready signal - do { - stat = get_reg(base, PP_BusStat); - } while (!(stat & PP_BusStat_TxRDY)); + { + // add timeout per cs8900a bugzilla report 1000281 */ + int timeout = 1000; + + do { + stat = get_reg(base, PP_BusStat); + if( stat & PP_BusStat_TxBid ) + diag_printf( "cs8900a_send: Bid error!\n" ); + } while (!(stat & PP_BusStat_TxRDY) && --timeout); + + if( !timeout ) { + // we might as well just return, since if we write the data it will + // just get thrown away + return; + } + } // Put data into buffer for (i = 0; i < sg_len; i++) { data = (cyg_uint8 *)sg_list[i].buf; len = sg_list[i].len; --=_B592232B.5C3D6D58--