All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
@ 2007-03-29 11:59 Denis Peter
  2007-03-29 13:23 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Denis Peter @ 2007-03-29 11:59 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang,

At 12:33 29.03.2007, you wrote:
>Dear Denis,
>
>in message <OF61C9A6C9.C4DFEC4B-ONC12572AD.002E7D48@mpl.loc> you wrote:
>> 
>> Fix bugs in cmd_ide.c and scsi_cmd.c.
>
>I tried to apply this patch but IO cannot because it has been mangled
>by your mailer - it wraps long lines.

I'm sorry, here the patch with correct mailer settings (hopefully)

with best regards,
Denis
   
Fix bugs in cmd_ide.c and scsi_cmd.c.

These bugs prevented to read/write more than one block from/to IDE drives, 
and didn't allow to use "diskboot" and "scsiboot" to boot from another 
device than device 0.

Signed-off-by: Denis Peter <d.peter@mpl.ch>

 common/cmd_ide.c  |    9 ++++++---
 common/cmd_scsi.c |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 2e185cc..ba984c3 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -423,7 +423,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                }
                part = simple_strtoul(++ep, NULL, 16);
        }
-       if (get_partition_info (ide_dev_desc, part, &info)) {
+       if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
+               printf ("error reading partinfo\n");
                SHOW_BOOT_PROGRESS (-1);
                return 1;
        }
@@ -1233,8 +1234,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 
 /* ------------------------------------------------------------------------- */
 
-ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
 {
+       ulong *buffer = (ulong *)vbuffer;
        ulong n = 0;
        unsigned char c;
        unsigned char pwrsave=0; /* power save */
@@ -1353,8 +1355,9 @@ IDE_READ_E:
 /* ------------------------------------------------------------------------- */
 
 
-ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
 {
+       ulong *buffer = (ulong *)vbuffer;
        ulong n = 0;
        unsigned char c;
 #ifdef CONFIG_LBA48
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index da36ed9..00b84fa 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -248,7 +248,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                }
                part = simple_strtoul(++ep, NULL, 16);
        }
-       if (get_partition_info (scsi_dev_desc, part, &info)) {
+       if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
                printf("error reading partinfo\n");
                return 1;
        }

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
  2007-03-29 11:59 [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c Denis Peter
@ 2007-03-29 13:23 ` Wolfgang Denk
  2007-04-02 11:43   ` Denis Peter
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2007-03-29 13:23 UTC (permalink / raw)
  To: u-boot

In message <OF29AD783D.748F78C9-ONC12572AD.0041E8F8@mpl.loc> you wrote:
>
> I'm sorry, here the patch with correct mailer settings (hopefully)

Doesn't work for me either:

-> git am -3 -i -u /tmp/patch
Commit Body is:
--------------------------
Fix bugs in cmd_ide.c and cmd_scsi.c

These bugs prevented to read/write more than one block from/to IDE drives,
and didn't allow to use "diskboot" and "scsiboot" to boot from another
device than device 0.

Signed-off-by: Denis Peter <d.peter@mpl.ch>

 common/cmd_ide.c  |    9 ++++++---
 common/cmd_scsi.c |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
--------------------------
Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y

Applying 'Fix bugs in cmd_ide.c and cmd_scsi.c'

error: patch failed: common/cmd_ide.c:423
error: common/cmd_ide.c: patch does not apply
error: patch failed: common/cmd_scsi.c:248
error: common/cmd_scsi.c: patch does not apply
Using index info to reconstruct a base tree...
error: patch failed: common/cmd_ide.c:423
error: common/cmd_ide.c: patch does not apply
error: patch failed: common/cmd_scsi.c:248
error: common/cmd_scsi.c: patch does not apply
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.
Patch failed at 0001.
When you have resolved this problem run "git-am -i -3 --resolved".
If you would prefer to skip this patch, instead run "git-am -i -3 --skip".


Same when I try to apply your patch manually:

-> patch -p1 --dry-run </tmp/patch 
patching file common/cmd_ide.c
Hunk #1 FAILED at 423.
Hunk #2 FAILED at 1234.
Hunk #3 FAILED at 1355.
3 out of 3 hunks FAILED -- saving rejects to file common/cmd_ide.c.rej
patching file common/cmd_scsi.c
Hunk #1 FAILED at 248.
1 out of 1 hunk FAILED -- saving rejects to file common/cmd_scsi.c.rej


Ah, I think you have also white space corrupted, i. e. spaces instead
of tabs.

FIX YOUR MAILER!!!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Brain: an apparatus with which we think we think.    - Ambrose Bierce

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
  2007-03-29 13:23 ` Wolfgang Denk
@ 2007-04-02 11:43   ` Denis Peter
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Peter @ 2007-04-02 11:43 UTC (permalink / raw)
  To: u-boot

On Thursday 29 March 2007 15:23, you wrote:
> In message <OF29AD783D.748F78C9-ONC12572AD.0041E8F8@mpl.loc> you wrote:
>
> Doesn't work for me either:
> ...<snip>...
I'm sorry again. Changed my environment and tested the patch twice.

With best regards,

Denis

Fix bugs in cmd_ide.c and cmd_scsi.c

These bugs prevented to read/write more than one block from/to IDE drives,
and didn't allow to use "diskboot" and "scsiboot" to boot from another
device than device 0.

 common/cmd_ide.c  |    9 ++++++---
 common/cmd_scsi.c |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 2e185cc..3bce1eb 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -423,7 +423,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (ide_dev_desc, part, &info)) {
+	if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
+		puts ("error reading partinfo\n");
 		SHOW_BOOT_PROGRESS (-1);
 		return 1;
 	}
@@ -1233,8 +1234,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 
 /* ------------------------------------------------------------------------- */
 
-ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
 {
+	ulong *buffer = (ulong *) vbuffer;
 	ulong n = 0;
 	unsigned char c;
 	unsigned char pwrsave=0; /* power save */
@@ -1353,8 +1355,9 @@ IDE_READ_E:
 /* ------------------------------------------------------------------------- */
 
 
-ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
 {
+	ulong *buffer = (ulong *) vbuffer;
 	ulong n = 0;
 	unsigned char c;
 #ifdef CONFIG_LBA48
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index da36ed9..00b84fa 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -248,7 +248,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (scsi_dev_desc, part, &info)) {
+	if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
 		printf("error reading partinfo\n");
 		return 1;
 	}

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
  2007-03-29  8:27 Denis Peter
@ 2007-03-29 10:33 ` Wolfgang Denk
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2007-03-29 10:33 UTC (permalink / raw)
  To: u-boot

Dear Denis,

in message <OF61C9A6C9.C4DFEC4B-ONC12572AD.002E7D48@mpl.loc> you wrote:
> 
> Fix bugs in cmd_ide.c and scsi_cmd.c.

I tried to apply this patch but IO cannot because it has been mangled
by your mailer - it wraps long lines.

See for example ...

> @@ -423,7 +423,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int 
> argc, char *argv[])

Here.

> @@ -1233,8 +1234,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)
> 
>   /* 
> ------------------------------------------------------------------------- */

And here...

... and who knos where else.

Please resend after making sure your mailer does not do such things.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
We fight only when there is no other choice. We prefer  the  ways  of
peaceful contact.
	-- Kirk, "Spectre of the Gun", stardate 4385.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
@ 2007-03-29  8:27 Denis Peter
  2007-03-29 10:33 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Denis Peter @ 2007-03-29  8:27 UTC (permalink / raw)
  To: u-boot

Hello,

At 11:23 28.03.2007, you wrote:
>Hi all,
> >
>...<snip>...
> > -ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
> > +ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
> >  {
> > +     ulong *buffer = (ulong *)vbuffer;
> >       ulong n = 0;
> >       unsigned char c;
> >       unsigned char pwrsave=0; /* power save */
>
>it seems to me, that the ide_write function will also need this fix.

yes, this one has slipped my attention, thank you for pointing this out.
Below the modified patch.

With best regards,

Denis

Fix bugs in cmd_ide.c and scsi_cmd.c.

These bugs prevented to read/write more than one block from/to IDE drives,
and didn't allow to use "diskboot" and "scsiboot" to boot from another
device than device 0.

Signed-off-by: Denis Peter <d.peter@mpl.ch>

  common/cmd_ide.c  |    9 ++++++---
  common/cmd_scsi.c |    2 +-
  2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 2e185cc..ba984c3 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -423,7 +423,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[])
                 }
                 part = simple_strtoul(++ep, NULL, 16);
         }
-       if (get_partition_info (ide_dev_desc, part, &info)) {
+       if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
+               printf ("error reading partinfo\n");
                 SHOW_BOOT_PROGRESS (-1);
                 return 1;
         }
@@ -1233,8 +1234,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)

  /* 
------------------------------------------------------------------------- */

-ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
  {
+       ulong *buffer = (ulong *)vbuffer;
         ulong n = 0;
         unsigned char c;
         unsigned char pwrsave=0; /* power save */
@@ -1353,8 +1355,9 @@ IDE_READ_E:
  /* 
------------------------------------------------------------------------- */


-ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
  {
+       ulong *buffer = (ulong *)vbuffer;
         ulong n = 0;
         unsigned char c;
  #ifdef CONFIG_LBA48
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index da36ed9..00b84fa 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -248,7 +248,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[])
                 }
                 part = simple_strtoul(++ep, NULL, 16);
         }
-       if (get_partition_info (scsi_dev_desc, part, &info)) {
+       if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
                 printf("error reading partinfo\n");
                 return 1;
         }

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
  2007-03-27 14:23 Denis Peter
@ 2007-03-28  9:23 ` Michael Tasche
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Tasche @ 2007-03-28  9:23 UTC (permalink / raw)
  To: u-boot

Hi all,

Denis Peter schrieb:
> Fix bugs in diskboot, scsiboot and ide_read
> 
> Fix bug introduced by "Fix get_partition_info() parameter error in all
> other calls" from 2005-03-04 in cmd_ide.c and cmd_scsi.c, which prevented
> to use diskboot or scsiboot form another device than 0.
> Fix bug introduced by "Use "void*" not "unsigned long *" for block dev
> read_write pointers" introduced on 2007-02-20, which prevented to read
> more than one block form IDE.
> 
> Signed-off-by: Denis Peter <d.peter@mpl.ch>
> 
> ---
> commit 4816c887ff56b0cc16b142f6fda921683989300e
> tree 10339e77b60290529bd0da693af86eca58cac083
> parent 44ba464b99001f8bd1c456a1e9d59726252f707a
> author Denis Peter <d.peter@mpl.ch> Tue, 27 Mar 2007 16:09:52 +0000
> committer Denis Peter <d.peter@mpl.ch> Tue, 27 Mar 2007 16:09:52 +0000
> 
>  common/cmd_ide.c  |    6 ++++--
>  common/cmd_scsi.c |    2 +-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/common/cmd_ide.c b/common/cmd_ide.c
> index 2e185cc..5a1cb45 100644
> --- a/common/cmd_ide.c
> +++ b/common/cmd_ide.c
> @@ -423,7 +423,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>  		}
>  		part = simple_strtoul(++ep, NULL, 16);
>  	}
> -	if (get_partition_info (ide_dev_desc, part, &info)) {
> +	if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
> +		printf ("error reading partinfo\n");
>  		SHOW_BOOT_PROGRESS (-1);
>  		return 1;
>  	}
> @@ -1233,8 +1234,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)
>  
>  /* ------------------------------------------------------------------------- */
>  

> -ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
> +ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
>  {
> +	ulong *buffer = (ulong *)vbuffer;
>  	ulong n = 0;
>  	unsigned char c;
>  	unsigned char pwrsave=0; /* power save */

it seems to me, that the ide_write function will also need this fix.


> diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
> index da36ed9..00b84fa 100644
> --- a/common/cmd_scsi.c
> +++ b/common/cmd_scsi.c
> @@ -248,7 +248,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>  		}
>  		part = simple_strtoul(++ep, NULL, 16);
>  	}
> -	if (get_partition_info (scsi_dev_desc, part, &info)) {
> +	if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
>  		printf("error reading partinfo\n");
>  		return 1;
>  	}
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 

Regards
Michael
-- 
                            _/_/_/_/   Michael Tasche
                           _/_/_/_/   Dipl.-Ing.
                          _/_/_/_/

      _/_/_/   _/_/_/_/_/_/_/      esd electronic system design gmbh
    _/   _/  _/             _/    Vahrenwalder Str. 207
   _/   _/    _/_/_/   _/   _/   D-30165 Hannover
   _/             _/  _/   _/   Phone: +49-511-37298-0
    _/_/_/_/_/_/_/   _/_/_/    Fax:   +49-511-37298-68

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
@ 2007-03-27 14:23 Denis Peter
  2007-03-28  9:23 ` Michael Tasche
  0 siblings, 1 reply; 7+ messages in thread
From: Denis Peter @ 2007-03-27 14:23 UTC (permalink / raw)
  To: u-boot

Fix bugs in diskboot, scsiboot and ide_read

Fix bug introduced by "Fix get_partition_info() parameter error in all
other calls" from 2005-03-04 in cmd_ide.c and cmd_scsi.c, which prevented
to use diskboot or scsiboot form another device than 0.
Fix bug introduced by "Use "void*" not "unsigned long *" for block dev
read_write pointers" introduced on 2007-02-20, which prevented to read
more than one block form IDE.

Signed-off-by: Denis Peter <d.peter@mpl.ch>

---
commit 4816c887ff56b0cc16b142f6fda921683989300e
tree 10339e77b60290529bd0da693af86eca58cac083
parent 44ba464b99001f8bd1c456a1e9d59726252f707a
author Denis Peter <d.peter@mpl.ch> Tue, 27 Mar 2007 16:09:52 +0000
committer Denis Peter <d.peter@mpl.ch> Tue, 27 Mar 2007 16:09:52 +0000

 common/cmd_ide.c  |    6 ++++--
 common/cmd_scsi.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 2e185cc..5a1cb45 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -423,7 +423,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (ide_dev_desc, part, &info)) {
+	if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
+		printf ("error reading partinfo\n");
 		SHOW_BOOT_PROGRESS (-1);
 		return 1;
 	}
@@ -1233,8 +1234,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 
 /* ------------------------------------------------------------------------- */
 
-ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
 {
+	ulong *buffer = (ulong *)vbuffer;
 	ulong n = 0;
 	unsigned char c;
 	unsigned char pwrsave=0; /* power save */
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index da36ed9..00b84fa 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -248,7 +248,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (scsi_dev_desc, part, &info)) {
+	if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
 		printf("error reading partinfo\n");
 		return 1;
 	}

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-04-02 11:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-29 11:59 [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c Denis Peter
2007-03-29 13:23 ` Wolfgang Denk
2007-04-02 11:43   ` Denis Peter
  -- strict thread matches above, loose matches on Subject: below --
2007-03-29  8:27 Denis Peter
2007-03-29 10:33 ` Wolfgang Denk
2007-03-27 14:23 Denis Peter
2007-03-28  9:23 ` Michael Tasche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.