linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ide-cd: debug log enhancements
@ 2008-09-29  6:29 Borislav Petkov
  2008-09-29  6:29 ` [PATCH 1/3] " Borislav Petkov
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Borislav Petkov @ 2008-09-29  6:29 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-kernel, linux-ide, Borislav Petkov

Hi Bart,

here are some trivial enhancements to ide-cd which resulted from the debugging
sessions lately.

 drivers/ide/ide-cd.c |   44 ++++++++++++++++++++++++++------------------
 1 files changed, 26 insertions(+), 18 deletions(-)

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

* [PATCH 1/3] ide-cd: debug log enhancements
  2008-09-29  6:29 [PATCH 0/3] ide-cd: debug log enhancements Borislav Petkov
@ 2008-09-29  6:29 ` Borislav Petkov
  2008-10-03 17:15   ` Bartlomiej Zolnierkiewicz
  2008-09-29  6:29 ` [PATCH 2/3] ide-cd: small drive type print fix Borislav Petkov
  2008-09-29  6:29 ` [PATCH 3/3] ide-cd: shorten ide_cd_request_sense_fixup's param list Borislav Petkov
  2 siblings, 1 reply; 9+ messages in thread
From: Borislav Petkov @ 2008-09-29  6:29 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-kernel, linux-ide, Borislav Petkov

Add some more verbosity to key function calls in ide-cd debug code. While at it,
delete a superfluous comment.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-cd.c |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 474bb1d..9ffce7f 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -340,8 +340,8 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 	}
 
 	ide_debug_log(IDE_DBG_RQ, "%s: stat: 0x%x, good_stat: 0x%x, "
-		      "rq->cmd_type: 0x%x, err: 0x%x\n", __func__, stat,
-		      good_stat, rq->cmd_type, err);
+		      "rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x, err: 0x%x\n",
+		      __func__, stat, good_stat, rq->cmd[0], rq->cmd_type, err);
 
 	if (blk_sense_request(rq)) {
 		/*
@@ -849,7 +849,8 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq)
 static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq)
 {
 
-	ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);
+	ide_debug_log(IDE_DBG_FUNC, "Call %s, rq->cmd[0]: 0x%x\n",
+		      __func__, rq->cmd[0]);
 
 	/*
 	 * Some of the trailing request sense fields are optional,
@@ -876,7 +877,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
 	if (!sense)
 		sense = &local_sense;
 
-	ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x, "
+	ide_debug_log(IDE_DBG_PC, "Call %s, cmd[0]: 0x%x, write: 0x%x, "
 		      "timeout: %d, cmd_flags: 0x%x\n", __func__, cmd[0], write,
 		      timeout, cmd_flags);
 
@@ -1177,8 +1178,9 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq)
 	unsigned short sectors_per_frame =
 		queue_hardsect_size(drive->queue) >> SECTOR_BITS;
 
-	ide_debug_log(IDE_DBG_RQ, "Call %s, write: 0x%x, secs_per_frame: %u\n",
-		      __func__, write, sectors_per_frame);
+	ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x, "
+		      "secs_per_frame: %u\n",
+		      __func__, rq->cmd[0], write, sectors_per_frame);
 
 	if (write) {
 		/* disk has become write protected */
@@ -1221,7 +1223,8 @@ static ide_startstop_t cdrom_do_newpc_cont(ide_drive_t *drive)
 static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
 {
 
-	ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd_type: 0x%x\n", __func__,
+	ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, "
+		      "rq->cmd_type: 0x%x\n", __func__, rq->cmd[0],
 		      rq->cmd_type);
 
 	if (blk_pc_request(rq))
@@ -1257,9 +1260,6 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
 	}
 }
 
-/*
- * cdrom driver request routine.
- */
 static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
 					sector_t block)
 {
@@ -1267,8 +1267,10 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
 	ide_handler_t *fn;
 	int xferlen;
 
-	ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd_type: 0x%x, block: %llu\n",
-		      __func__, rq->cmd_type, (unsigned long long)block);
+	ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, "
+		      "rq->cmd_type: 0x%x, block: %llu\n",
+		      __func__, rq->cmd[0], rq->cmd_type,
+		      (unsigned long long)block);
 
 	if (blk_fs_request(rq)) {
 		if (drive->atapi_flags & IDE_AFLAG_SEEKING) {
@@ -1412,6 +1414,10 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
 
 	*capacity = 1 + be32_to_cpu(capbuf.lba);
 	*sectors_per_frame = blocklen >> SECTOR_BITS;
+
+	ide_debug_log(IDE_DBG_PROBE, "%s: cap: %lu, sectors_per_frame: %lu\n",
+		      __func__, *capacity, *sectors_per_frame);
+
 	return 0;
 }
 
@@ -1643,6 +1649,9 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
 		maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]);
 	}
 
+	ide_debug_log(IDE_DBG_PROBE, "%s: curspeed: %u, maxspeed: %u\n",
+		      __func__, curspeed, maxspeed);
+
 	cd->current_speed = (curspeed + (176/2)) / 176;
 	cd->max_speed = (maxspeed + (176/2)) / 176;
 }
-- 
1.5.5.4


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

* [PATCH 2/3] ide-cd: small drive type print fix
  2008-09-29  6:29 [PATCH 0/3] ide-cd: debug log enhancements Borislav Petkov
  2008-09-29  6:29 ` [PATCH 1/3] " Borislav Petkov
@ 2008-09-29  6:29 ` Borislav Petkov
  2008-10-03 17:18   ` Bartlomiej Zolnierkiewicz
  2008-09-29  6:29 ` [PATCH 3/3] ide-cd: shorten ide_cd_request_sense_fixup's param list Borislav Petkov
  2 siblings, 1 reply; 9+ messages in thread
From: Borislav Petkov @ 2008-09-29  6:29 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-kernel, linux-ide, Borislav Petkov

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-cd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 9ffce7f..e41b94d 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1784,7 +1784,7 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
 	if ((cdi->mask & CDC_DVD_R) == 0 || (cdi->mask & CDC_DVD_RAM) == 0)
 		printk(KERN_CONT " DVD%s%s",
 				 (cdi->mask & CDC_DVD_R) ? "" : "-R",
-				 (cdi->mask & CDC_DVD_RAM) ? "" : "-RAM");
+				 (cdi->mask & CDC_DVD_RAM) ? "" : "/RAM");
 
 	if ((cdi->mask & CDC_CD_R) == 0 || (cdi->mask & CDC_CD_RW) == 0)
 		printk(KERN_CONT " CD%s%s",
-- 
1.5.5.4


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

* [PATCH 3/3] ide-cd: shorten ide_cd_request_sense_fixup's param list
  2008-09-29  6:29 [PATCH 0/3] ide-cd: debug log enhancements Borislav Petkov
  2008-09-29  6:29 ` [PATCH 1/3] " Borislav Petkov
  2008-09-29  6:29 ` [PATCH 2/3] ide-cd: small drive type print fix Borislav Petkov
@ 2008-09-29  6:29 ` Borislav Petkov
  2008-10-03 17:29   ` Bartlomiej Zolnierkiewicz
  2 siblings, 1 reply; 9+ messages in thread
From: Borislav Petkov @ 2008-09-29  6:29 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-kernel, linux-ide, Borislav Petkov

... since HWGROUP(drive)->rq points to the same rq as in the irq handler. While
at it, remove stale comment.

There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-cd.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index e41b94d..bf92cd6 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -843,12 +843,11 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq)
 	rq->q->prep_rq_fn(rq->q, rq);
 }
 
-/*
- * All other packet commands.
- */
-static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq)
+static void ide_cd_request_sense_fixup(ide_drive_t *drive)
 {
 
+	struct request *rq = HWGROUP(drive)->rq;
+
 	ide_debug_log(IDE_DBG_FUNC, "Call %s, rq->cmd[0]: 0x%x\n",
 		      __func__, rq->cmd[0]);
 
@@ -1021,7 +1020,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
 			cdrom_end_request(drive, uptodate);
 			return ide_stopped;
 		} else if (!blk_pc_request(rq)) {
-			ide_cd_request_sense_fixup(drive, rq);
+			ide_cd_request_sense_fixup(drive);
 			/* complain if we still have data left to transfer */
 			uptodate = rq->data_len ? 0 : 1;
 		}
-- 
1.5.5.4


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

* Re: [PATCH 1/3] ide-cd: debug log enhancements
  2008-09-29  6:29 ` [PATCH 1/3] " Borislav Petkov
@ 2008-10-03 17:15   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-10-03 17:15 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-kernel, linux-ide, Borislav Petkov

On Monday 29 September 2008, Borislav Petkov wrote:
> Add some more verbosity to key function calls in ide-cd debug code. While at it,
> delete a superfluous comment.
> 
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

applied

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

* Re: [PATCH 2/3] ide-cd: small drive type print fix
  2008-09-29  6:29 ` [PATCH 2/3] ide-cd: small drive type print fix Borislav Petkov
@ 2008-10-03 17:18   ` Bartlomiej Zolnierkiewicz
  2008-10-04  8:28     ` Borislav Petkov
  0 siblings, 1 reply; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-10-03 17:18 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-kernel, linux-ide, Borislav Petkov

On Monday 29 September 2008, Borislav Petkov wrote:
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

applied (though I fail to see "an added value" of this change)

> ---
>  drivers/ide/ide-cd.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> index 9ffce7f..e41b94d 100644
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -1784,7 +1784,7 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
>  	if ((cdi->mask & CDC_DVD_R) == 0 || (cdi->mask & CDC_DVD_RAM) == 0)
>  		printk(KERN_CONT " DVD%s%s",
>  				 (cdi->mask & CDC_DVD_R) ? "" : "-R",
> -				 (cdi->mask & CDC_DVD_RAM) ? "" : "-RAM");
> +				 (cdi->mask & CDC_DVD_RAM) ? "" : "/RAM");
>  
>  	if ((cdi->mask & CDC_CD_R) == 0 || (cdi->mask & CDC_CD_RW) == 0)
>  		printk(KERN_CONT " CD%s%s",

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

* Re: [PATCH 3/3] ide-cd: shorten ide_cd_request_sense_fixup's param list
  2008-09-29  6:29 ` [PATCH 3/3] ide-cd: shorten ide_cd_request_sense_fixup's param list Borislav Petkov
@ 2008-10-03 17:29   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-10-03 17:29 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-kernel, linux-ide, Borislav Petkov

On Monday 29 September 2008, Borislav Petkov wrote:
> ... since HWGROUP(drive)->rq points to the same rq as in the irq handler. While

Since we already have obtained rq pointer why not pass it to the helper
function instead of having the helper function waste cycles on it?

Moreover it results in slightly bigger code...

> at it, remove stale comment.

I applied this part only.

> There should be no functionality change resulting from this patch.
> 
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
> ---
>  drivers/ide/ide-cd.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> index e41b94d..bf92cd6 100644
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -843,12 +843,11 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq)
>  	rq->q->prep_rq_fn(rq->q, rq);
>  }
>  
> -/*
> - * All other packet commands.
> - */
> -static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq)
> +static void ide_cd_request_sense_fixup(ide_drive_t *drive)
>  {
>  
> +	struct request *rq = HWGROUP(drive)->rq;
> +
>  	ide_debug_log(IDE_DBG_FUNC, "Call %s, rq->cmd[0]: 0x%x\n",
>  		      __func__, rq->cmd[0]);
>  
> @@ -1021,7 +1020,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
>  			cdrom_end_request(drive, uptodate);
>  			return ide_stopped;
>  		} else if (!blk_pc_request(rq)) {
> -			ide_cd_request_sense_fixup(drive, rq);
> +			ide_cd_request_sense_fixup(drive);
>  			/* complain if we still have data left to transfer */
>  			uptodate = rq->data_len ? 0 : 1;
>  		}

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

* Re: [PATCH 2/3] ide-cd: small drive type print fix
  2008-10-03 17:18   ` Bartlomiej Zolnierkiewicz
@ 2008-10-04  8:28     ` Borislav Petkov
  2008-10-05 15:54       ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 9+ messages in thread
From: Borislav Petkov @ 2008-10-04  8:28 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-ide

On Fri, Oct 03, 2008 at 07:18:15PM +0200, Bartlomiej Zolnierkiewicz wrote:
> On Monday 29 September 2008, Borislav Petkov wrote:
> > Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
> 
> applied (though I fail to see "an added value" of this change)

It simply makes the format consistent with the lines below: CD-R/RW - which is
the more common way of enumerating supported media you find in different specs
than DVD-R-RAM, don't you think?

> > ---
> >  drivers/ide/ide-cd.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> > index 9ffce7f..e41b94d 100644
> > --- a/drivers/ide/ide-cd.c
> > +++ b/drivers/ide/ide-cd.c
> > @@ -1784,7 +1784,7 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
> >  	if ((cdi->mask & CDC_DVD_R) == 0 || (cdi->mask & CDC_DVD_RAM) == 0)
> >  		printk(KERN_CONT " DVD%s%s",
> >  				 (cdi->mask & CDC_DVD_R) ? "" : "-R",
> > -				 (cdi->mask & CDC_DVD_RAM) ? "" : "-RAM");
> > +				 (cdi->mask & CDC_DVD_RAM) ? "" : "/RAM");
> >  
> >  	if ((cdi->mask & CDC_CD_R) == 0 || (cdi->mask & CDC_CD_RW) == 0)
> >  		printk(KERN_CONT " CD%s%s",

-- 
Regards/Gruss,
    Boris.

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

* Re: [PATCH 2/3] ide-cd: small drive type print fix
  2008-10-04  8:28     ` Borislav Petkov
@ 2008-10-05 15:54       ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-10-05 15:54 UTC (permalink / raw)
  To: petkovbb; +Cc: linux-kernel, linux-ide

On Saturday 04 October 2008, Borislav Petkov wrote:
> On Fri, Oct 03, 2008 at 07:18:15PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Monday 29 September 2008, Borislav Petkov wrote:
> > > Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
> > 
> > applied (though I fail to see "an added value" of this change)
> 
> It simply makes the format consistent with the lines below: CD-R/RW - which is
> the more common way of enumerating supported media you find in different specs
> than DVD-R-RAM, don't you think?

Indeed, thanks for explaining it.

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

end of thread, other threads:[~2008-10-05 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-29  6:29 [PATCH 0/3] ide-cd: debug log enhancements Borislav Petkov
2008-09-29  6:29 ` [PATCH 1/3] " Borislav Petkov
2008-10-03 17:15   ` Bartlomiej Zolnierkiewicz
2008-09-29  6:29 ` [PATCH 2/3] ide-cd: small drive type print fix Borislav Petkov
2008-10-03 17:18   ` Bartlomiej Zolnierkiewicz
2008-10-04  8:28     ` Borislav Petkov
2008-10-05 15:54       ` Bartlomiej Zolnierkiewicz
2008-09-29  6:29 ` [PATCH 3/3] ide-cd: shorten ide_cd_request_sense_fixup's param list Borislav Petkov
2008-10-03 17:29   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).