Re: fixed a bug of adma in rhel4u5 with HDS7250SASUN500G.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Hancock wrote:
Kuan Luo wrote:

hi robert,
    I have fixed a bug in rhel4u5 2.6.9-55 when running adma mode
with HDS7250SASUN500G.
    Could you check this code and if no problem,  then help me to
submit to the newest kernel.


It seems like a reasonable change - I'm sure you guys would know better than I whether it's the right thing to do. The patch got newline wrapped and whitespace damaged, however. Can you repost (even as attachment) so people can try it out?

Robert,

Here is Kuan's patch as an attachment.

David



for 2.6.9-55
diff -Nupr a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
--- a/drivers/ata/sata_nv.c    2008-01-14 14:37:32.000000000 +0800
+++ b/drivers/ata/sata_nv.c    2008-01-14 14:37:21.000000000 +0800
@@ -802,7 +802,7 @@ static irqreturn_t nv_adma_interrupt(int
                 ata_port_printk(ap, KERN_ERR, "CPB
error, stat=0x%x\n", status);
                 have_global_err = 1;
             }
-            if ((status & NV_ADMA_STAT_DONE) ||
have_global_err) {
+            if ((status & (NV_ADMA_STAT_CMD_COMPLETE |
NV_ADMA_STAT_DONE)) || have_global_err) {
                 /** Check CPBs for completed commands */
if(ata_tag_valid(ap->active_tag))
@@ -814,6 +814,7 @@ static irqreturn_t nv_adma_interrupt(int
                     u32 active = ap->sactive;
                     while( (pos = ffs(active)) ) {
                         pos--;
+                        if ((notifier_clears[i]
& (1 << pos)) || have_global_err)
                         nv_adma_check_cpb(ap,
pos, have_global_err ||
                             (notifier_error
& (1 << pos)) );
                         active &= ~(1 << pos );

for 2.6.24-rc7

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index ed5dc7c..6bffd39 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -1010,8 +1010,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void
*dev_instance)
                 continue;
             }
- if (status & (NV_ADMA_STAT_DONE |
-                      NV_ADMA_STAT_CPBERR)) {
+            if (status & (NV_ADMA_STAT_DONE |
NV_ADMA_STAT_CMD_COMPLETE | NV_ADMA_STAT_CPBERR)) {
                 u32 check_commands;
                 int pos, error = 0;
@@ -1023,8 +1022,8 @@ static irqreturn_t nv_adma_interrupt(int irq, void
*dev_instance)
                 /** Check CPBs for completed commands */
                 while ((pos = ffs(check_commands)) &&
!error) {
                     pos--;
-                    error = nv_adma_check_cpb(ap,
pos,
-                        notifier_error & (1 <<
pos));
+                    if ((notifier_clears[i] & (1 <<
pos)) || (status & NV_ADMA_STAT_CPBERR))
+                        error =
nv_adma_check_cpb(ap, pos, notifier_error & (1 << pos));
                     check_commands &= ~(1 << pos);
                 }
             }
----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- linux-2.6/drivers/ata/sata_nv.c.completed
+++ linux-2.6/drivers/ata/sata_nv.c
@@ -1011,7 +1011,8 @@ static irqreturn_t nv_adma_interrupt(int
 			}
 
 			if (status & (NV_ADMA_STAT_DONE |
-				      NV_ADMA_STAT_CPBERR)) {
+				      NV_ADMA_STAT_CPBERR |
+				      NV_ADMA_STAT_CMD_COMPLETE)) {
 				u32 check_commands;
 				int pos, error = 0;
 
@@ -1023,8 +1024,8 @@ static irqreturn_t nv_adma_interrupt(int
 				/** Check CPBs for completed commands */
 				while ((pos = ffs(check_commands)) && !error) {
 					pos--;
-					error = nv_adma_check_cpb(ap, pos,
-						notifier_error & (1 << pos));
+					if ((notifier_clears[i] & (1 << pos)) || (status & NV_ADMA_STAT_CPBERR))
+						error = nv_adma_check_cpb(ap, pos, notifier_error & (1 << pos));
 					check_commands &= ~(1 << pos);
 				}
 			}

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux