linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problems with eject and pktcdvd
@ 2006-01-15 12:35 Damian Pietras
  2006-01-15 17:53 ` Phillip Susi
  0 siblings, 1 reply; 16+ messages in thread
From: Damian Pietras @ 2006-01-15 12:35 UTC (permalink / raw)
  To: linux-kernel

Recently I bought a NEC ND-4551A CD/DVD writer. It works OK with one
exception. When I have a packet device associated with the drive, there
are problems with ejecting discs.

Here is an example:

1. Insert a CD-R/DVD/CD-RW (whatever)
2. mount /media/cdrom0
3. umount /media/cdrom0

Now the eject button doesn't work, when I issue the eject command I get:

hda: irq timeout: status=0xd0 { Busy }
ide: failed opcode was: unknown
hda: DMA disabled
hda: ATAPI reset complete

After few seconds eject ends with no result. Second eject command works.

There are no problems without the packet device association (turned
off/on with pktsetup using /etc/init.d/udftools).

My system if Ubuntu 5.10
The kernel is:
Linux amd 2.6.15-mm3 #1 PREEMPT Sun Jan 15 12:31:14 CET 2006 i686
GNU/Linux
But it works the same way with 2.6.15.

Part of my dmesg related to IDE:

VP_IDE: IDE controller at PCI slot 0000:00:11.1
ACPI: PCI Interrupt 0000:00:11.1[A] -> Link [LNKA] -> GSI 10 (level, low)
 -> IRQ 10
PCI: Via IRQ fixup for 0000:00:11.1, from 255 to 10
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt8233a (rev 00) IDE UDMA133 controller on pci0000:00:11.1
    ide0: BM-DMA at 0xdc00-0xdc07, BIOS settings: hda:DMA, hdb:pio
    ide1: BM-DMA at 0xdc08-0xdc0f, BIOS settings: hdc:pio, hdd:pio
Probing IDE interface ide0...
hda: _NEC DVD_RW ND-4551A, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: ATAPI 48X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
Probing IDE interface ide1...
Probing IDE interface ide1...

-- 
Damian Pietras

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

* Re: Problems with eject and pktcdvd
  2006-01-15 12:35 Problems with eject and pktcdvd Damian Pietras
@ 2006-01-15 17:53 ` Phillip Susi
  2006-01-15 18:50   ` Damian Pietras
  0 siblings, 1 reply; 16+ messages in thread
From: Phillip Susi @ 2006-01-15 17:53 UTC (permalink / raw)
  To: Damian Pietras; +Cc: linux-kernel

I am currently working on improving the udftools package in ubuntu to 
make it actually usable.  In its current state it is only suitable for 
experimentation.  See the thread titled "[PATCH] pktcdvd & udf bugfixes" 
on this mailing list for more information.

Eject works fine for me though so I'm not sure what the problem is.  You 
might want to try using the stock 2.6.12 breezy kernel on your breezy 
install, instead of your home built 2.6.15-mm kernel.  I'm running the 
stock 2.6.15 kernel on my dapper install and eject works just fine once 
unmounted.

If you feel like building the package and testing it, it's up on REVU 
right now at http://revu.tauware.de/details.py?upid=1433

That contains a few bug fixes discussed in the other thread I refered 
you to.  I am still trying to get the package integrated with hal so 
it's all plug and play automagic, but running into some trouble there.

Damian Pietras wrote:
> Recently I bought a NEC ND-4551A CD/DVD writer. It works OK with one
> exception. When I have a packet device associated with the drive, there
> are problems with ejecting discs.
> 
> Here is an example:
> 
> 1. Insert a CD-R/DVD/CD-RW (whatever)
> 2. mount /media/cdrom0
> 3. umount /media/cdrom0
> 
> Now the eject button doesn't work, when I issue the eject command I get:
> 
> hda: irq timeout: status=0xd0 { Busy }
> ide: failed opcode was: unknown
> hda: DMA disabled
> hda: ATAPI reset complete
> 
> After few seconds eject ends with no result. Second eject command works.
> 
> There are no problems without the packet device association (turned
> off/on with pktsetup using /etc/init.d/udftools).
> 
> My system if Ubuntu 5.10
> The kernel is:
> Linux amd 2.6.15-mm3 #1 PREEMPT Sun Jan 15 12:31:14 CET 2006 i686
> GNU/Linux
> But it works the same way with 2.6.15.
> 
> Part of my dmesg related to IDE:
> 
> VP_IDE: IDE controller at PCI slot 0000:00:11.1
> ACPI: PCI Interrupt 0000:00:11.1[A] -> Link [LNKA] -> GSI 10 (level, low)
>  -> IRQ 10
> PCI: Via IRQ fixup for 0000:00:11.1, from 255 to 10
> VP_IDE: chipset revision 6
> VP_IDE: not 100% native mode: will probe irqs later
> VP_IDE: VIA vt8233a (rev 00) IDE UDMA133 controller on pci0000:00:11.1
>     ide0: BM-DMA at 0xdc00-0xdc07, BIOS settings: hda:DMA, hdb:pio
>     ide1: BM-DMA at 0xdc08-0xdc0f, BIOS settings: hdc:pio, hdd:pio
> Probing IDE interface ide0...
> hda: _NEC DVD_RW ND-4551A, ATAPI CD/DVD-ROM drive
> ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
> hda: ATAPI 48X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache, UDMA(33)
> Uniform CD-ROM driver Revision: 3.20
> Probing IDE interface ide1...
> Probing IDE interface ide1...
> 


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

* Re: Problems with eject and pktcdvd
  2006-01-15 17:53 ` Phillip Susi
@ 2006-01-15 18:50   ` Damian Pietras
  2006-01-15 19:17     ` Phillip Susi
  0 siblings, 1 reply; 16+ messages in thread
From: Damian Pietras @ 2006-01-15 18:50 UTC (permalink / raw)
  To: Phillip Susi; +Cc: linux-kernel

On Sun, Jan 15, 2006 at 12:53:25PM -0500, Phillip Susi wrote:
> I am currently working on improving the udftools package in ubuntu to 
> make it actually usable.  In its current state it is only suitable for 
> experimentation.  See the thread titled "[PATCH] pktcdvd & udf bugfixes" 
> on this mailing list for more information.
> 
> Eject works fine for me though so I'm not sure what the problem is.  You 
> might want to try using the stock 2.6.12 breezy kernel on your breezy 
> install, instead of your home built 2.6.15-mm kernel.  I'm running the 
> stock 2.6.15 kernel on my dapper install and eject works just fine once 
> unmounted.

Neither Ubuntu kernel nor this patch fixes the problem.

>
> If you feel like building the package and testing it, it's up on REVU
> right now at http://revu.tauware.de/details.py?upid=1433

This is just updated udftools package? I don't think it's a userspace
problem. It happens also for CD-Rs with iso9660 filesystem.

-- 
Damian Pietras

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

* Re: Problems with eject and pktcdvd
  2006-01-15 18:50   ` Damian Pietras
@ 2006-01-15 19:17     ` Phillip Susi
  2006-01-15 20:47       ` Peter Osterlund
  0 siblings, 1 reply; 16+ messages in thread
From: Phillip Susi @ 2006-01-15 19:17 UTC (permalink / raw)
  To: Damian Pietras; +Cc: linux-kernel

Damian Pietras wrote:
> On Sun, Jan 15, 2006 at 12:53:25PM -0500, Phillip Susi wrote:
> 
> Neither Ubuntu kernel nor this patch fixes the problem.
> 
> 

You might want to try it under dapper then.  If you still have that 
problem, then it's got to be busted hardware.  You might try updating 
the firmware in the drive.

> 
> This is just updated udftools package? I don't think it's a userspace
> problem. It happens also for CD-Rs with iso9660 filesystem.
> 

Right, I just mentioned that because there are a number of fixes that 
are required to make udftools actually 'usable' which you might be 
interested in.  I also need beta testers :)


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

* Re: Problems with eject and pktcdvd
  2006-01-15 19:17     ` Phillip Susi
@ 2006-01-15 20:47       ` Peter Osterlund
  2006-01-15 21:04         ` Damian Pietras
                           ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Peter Osterlund @ 2006-01-15 20:47 UTC (permalink / raw)
  To: Phillip Susi; +Cc: Damian Pietras, linux-kernel

Phillip Susi <psusi@cfl.rr.com> writes:

> Damian Pietras wrote:
> > On Sun, Jan 15, 2006 at 12:53:25PM -0500, Phillip Susi wrote:
> > Neither Ubuntu kernel nor this patch fixes the problem.
> >
> 
> You might want to try it under dapper then.  If you still have that
> problem, then it's got to be busted hardware.  You might try updating
> the firmware in the drive.

The irq timeout problem might be broken hardware/firmware, but there
is a problem with drive locking and the pktcdvd driver.

If you do

	pktsetup 0 /dev/hdc
	mount /dev/hdc /mnt/tmp
	umount /mnt/tmp

the door will be left in a locked state. (It gets unlocked when you
run "pktsetup -d 0" though.) However, if you do:

	pktsetup 0 /dev/hdc
	mount /dev/pktcdvd/0 /mnt/tmp
	umount /mnt/tmp

the door will be properly unlocked.

The problem is that the cdrom driver locks the door the first time the
device is opened in blocking mode, but doesn't unlock it again until
the open count goes down to zero. The pktcdvd driver tries to work
around that, but it can't do it in the first example because the
mount/umount commands do not involve the pktcdvd driver at all.

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

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

* Re: Problems with eject and pktcdvd
  2006-01-15 20:47       ` Peter Osterlund
@ 2006-01-15 21:04         ` Damian Pietras
  2006-01-15 21:18           ` Jan Engelhardt
  2006-02-05 19:13           ` Peter Osterlund
  2006-01-15 22:23         ` Phillip Susi
  2006-01-15 22:55         ` Nix
  2 siblings, 2 replies; 16+ messages in thread
From: Damian Pietras @ 2006-01-15 21:04 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Phillip Susi, linux-kernel

On Sun, Jan 15, 2006 at 09:47:40PM +0100, Peter Osterlund wrote:
> Phillip Susi <psusi@cfl.rr.com> writes:
> 
> > Damian Pietras wrote:
> > > On Sun, Jan 15, 2006 at 12:53:25PM -0500, Phillip Susi wrote:
> > > Neither Ubuntu kernel nor this patch fixes the problem.
> > >
> > 
> > You might want to try it under dapper then.  If you still have that
> > problem, then it's got to be busted hardware.  You might try updating
> > the firmware in the drive.
> 
> The irq timeout problem might be broken hardware/firmware, but there
> is a problem with drive locking and the pktcdvd driver.
> 
> If you do
> 
> 	pktsetup 0 /dev/hdc
> 	mount /dev/hdc /mnt/tmp
> 	umount /mnt/tmp
> 
> the door will be left in a locked state. (It gets unlocked when you
> run "pktsetup -d 0" though.) However, if you do:
> 
> 	pktsetup 0 /dev/hdc
> 	mount /dev/pktcdvd/0 /mnt/tmp
> 	umount /mnt/tmp

Thanks!

It works this way without any irq timeout. Unfortunately I can't use it
as a workaround, because CD-R media must be mounted with '-o ro' or I
get 'pktcdvd: Wrong disc profile (9)', so I can't just put it in fstab
and use 'mount /media/cdrom' for both CD-R and RW discs.

This is very new model and I hope they will release new firmware soon.

-- 
Damian Pietras

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

* Re: Problems with eject and pktcdvd
  2006-01-15 21:04         ` Damian Pietras
@ 2006-01-15 21:18           ` Jan Engelhardt
  2006-01-15 21:34             ` Peter Osterlund
  2006-02-05 19:13           ` Peter Osterlund
  1 sibling, 1 reply; 16+ messages in thread
From: Jan Engelhardt @ 2006-01-15 21:18 UTC (permalink / raw)
  To: Damian Pietras; +Cc: Peter Osterlund, Phillip Susi, linux-kernel


>> 	pktsetup 0 /dev/hdc
>> 	mount /dev/pktcdvd/0 /mnt/tmp
>> 	umount /mnt/tmp

A question BTW; I do not seem to need pktcdvd for DVD+RWs,
I can just mount them after mkfs'ing /dev/hdc - what's up with that?



Jan Engelhardt
-- 

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

* Re: Problems with eject and pktcdvd
  2006-01-15 21:18           ` Jan Engelhardt
@ 2006-01-15 21:34             ` Peter Osterlund
  0 siblings, 0 replies; 16+ messages in thread
From: Peter Osterlund @ 2006-01-15 21:34 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Damian Pietras, Phillip Susi, linux-kernel

Jan Engelhardt <jengelh@linux01.gwdg.de> writes:

> >> 	pktsetup 0 /dev/hdc
> >> 	mount /dev/pktcdvd/0 /mnt/tmp
> >> 	umount /mnt/tmp
> 
> A question BTW; I do not seem to need pktcdvd for DVD+RWs,
> I can just mount them after mkfs'ing /dev/hdc - what's up with that?

Basically, if you don't use the packet writing driver, the DVD drive
firmware will do similar work on its own, because the hardware can
only write 32KB blocks. The firmware is often slower than the pktcdvd
driver, because the firmware doesn't have as much memory available as
the kernel to reorder I/O operations for improved throughput.

See also Documentation/cdrom/packet-writing.txt:

Packet writing for DVD+RW media
-------------------------------

According to the DVD+RW specification, a drive supporting DVD+RW discs
shall implement "true random writes with 2KB granularity", which means
that it should be possible to put any filesystem with a block size >=
2KB on such a disc. For example, it should be possible to do:

	# dvd+rw-format /dev/hdc   (only needed if the disc has never
	                            been formatted)
	# mkudffs /dev/hdc
	# mount /dev/hdc /cdrom -t udf -o rw,noatime

However, some drives don't follow the specification and expect the
host to perform aligned writes at 32KB boundaries. Other drives do
follow the specification, but suffer bad performance problems if the
writes are not 32KB aligned.

Both problems can be solved by using the pktcdvd driver, which always
generates aligned writes.

	# dvd+rw-format /dev/hdc
	# pktsetup dev_name /dev/hdc
	# mkudffs /dev/pktcdvd/dev_name
	# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

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

* Re: Problems with eject and pktcdvd
  2006-01-15 20:47       ` Peter Osterlund
  2006-01-15 21:04         ` Damian Pietras
@ 2006-01-15 22:23         ` Phillip Susi
  2006-01-15 22:55         ` Nix
  2 siblings, 0 replies; 16+ messages in thread
From: Phillip Susi @ 2006-01-15 22:23 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Damian Pietras, linux-kernel

So mounting opens it in blocking  mode, causing it to lock, but pktcdvd 
does not open it in blocking mode, so it doesn't get locked until the 
mount?  Why does the cdrom driver differentiate between the two?  
Shouldn't it simply be locked when in use, no matter how it is used?  
And shouldn't pktcdvd explicitly unlock the drive when the pktcdvd 
device isn't open?  For that matter, why is mount opening the cdrom in 
blocking mode?  Shouldn't the filesystem be sending down async bios?

Peter Osterlund wrote:

>If you do
>
>	pktsetup 0 /dev/hdc
>	mount /dev/hdc /mnt/tmp
>	umount /mnt/tmp
>
>the door will be left in a locked state. (It gets unlocked when you
>run "pktsetup -d 0" though.) However, if you do:
>
>	pktsetup 0 /dev/hdc
>	mount /dev/pktcdvd/0 /mnt/tmp
>	umount /mnt/tmp
>
>the door will be properly unlocked.
>
>The problem is that the cdrom driver locks the door the first time the
>device is opened in blocking mode, but doesn't unlock it again until
>the open count goes down to zero. The pktcdvd driver tries to work
>around that, but it can't do it in the first example because the
>mount/umount commands do not involve the pktcdvd driver at all.
>
>  
>


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

* Re: Problems with eject and pktcdvd
  2006-01-15 20:47       ` Peter Osterlund
  2006-01-15 21:04         ` Damian Pietras
  2006-01-15 22:23         ` Phillip Susi
@ 2006-01-15 22:55         ` Nix
  2 siblings, 0 replies; 16+ messages in thread
From: Nix @ 2006-01-15 22:55 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Phillip Susi, Damian Pietras, linux-kernel

On 15 Jan 2006, Peter Osterlund murmured:
> If you do
> 
> 	pktsetup 0 /dev/hdc
> 	mount /dev/hdc /mnt/tmp
> 	umount /mnt/tmp

> the door will be left in a locked state.

This is indeed what I see.

> 	pktsetup 0 /dev/hdc
> 	mount /dev/pktcdvd/0 /mnt/tmp
> 	umount /mnt/tmp
> 
> the door will be properly unlocked.

... and this.

... and my assumption that I couldn't mount non-packetwritten CDs via
the /dev/pktcdvd/0 device is entirely erroneous. So it all works after
all, as long as I never use the non-packetwritten device.

Oh *good*. Thank you for this: this was my last real thing that worked
better in 2.4 than in 2.6 :)))

> The problem is that the cdrom driver locks the door the first time the
> device is opened in blocking mode, but doesn't unlock it again until
> the open count goes down to zero. The pktcdvd driver tries to work
> around that, but it can't do it in the first example because the
> mount/umount commands do not involve the pktcdvd driver at all.

Yeah, well, it's obvious once you've explained it ;)

-- 
`Logic and human nature don't seem to mix very well,
 unfortunately.' --- Velvet Wood

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

* Re: Problems with eject and pktcdvd
  2006-01-15 21:04         ` Damian Pietras
  2006-01-15 21:18           ` Jan Engelhardt
@ 2006-02-05 19:13           ` Peter Osterlund
  2006-02-05 21:07             ` Damian Pietras
  1 sibling, 1 reply; 16+ messages in thread
From: Peter Osterlund @ 2006-02-05 19:13 UTC (permalink / raw)
  To: Damian Pietras; +Cc: Phillip Susi, linux-kernel

Damian Pietras <daper@daper.net> writes:

> On Sun, Jan 15, 2006 at 09:47:40PM +0100, Peter Osterlund wrote:
> > 
> > The irq timeout problem might be broken hardware/firmware, but there
> > is a problem with drive locking and the pktcdvd driver.
> > 
> > If you do
> > 
> > 	pktsetup 0 /dev/hdc
> > 	mount /dev/hdc /mnt/tmp
> > 	umount /mnt/tmp
> > 
> > the door will be left in a locked state. (It gets unlocked when you
> > run "pktsetup -d 0" though.) However, if you do:
> > 
> > 	pktsetup 0 /dev/hdc
> > 	mount /dev/pktcdvd/0 /mnt/tmp
> > 	umount /mnt/tmp
> 
> Thanks!
> 
> It works this way without any irq timeout. Unfortunately I can't use it
> as a workaround, because CD-R media must be mounted with '-o ro' or I
> get 'pktcdvd: Wrong disc profile (9)', so I can't just put it in fstab
> and use 'mount /media/cdrom' for both CD-R and RW discs.

Please try this patch.


Allow non-writable media to be mounted.

Signed-off-by: Peter Osterlund <petero2@telia.com>
---

 drivers/block/pktcdvd.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 3445386..04117a7 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1896,7 +1896,7 @@ static int pkt_open_write(struct pktcdvd
 
 	if ((ret = pkt_probe_settings(pd))) {
 		DPRINTK("pktcdvd: %s failed probe\n", pd->name);
-		return -EIO;
+		return -EROFS;
 	}
 
 	if ((ret = pkt_set_write_settings(pd))) {
@@ -2054,10 +2054,9 @@ static int pkt_open(struct inode *inode,
 			goto out_dec;
 		}
 	} else {
-		if (pkt_open_dev(pd, file->f_mode & FMODE_WRITE)) {
-			ret = -EIO;
+		ret = pkt_open_dev(pd, file->f_mode & FMODE_WRITE);
+		if (ret)
 			goto out_dec;
-		}
 		/*
 		 * needed here as well, since ext2 (among others) may change
 		 * the blocksize at mount time

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

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

* Re: Problems with eject and pktcdvd
  2006-02-05 19:13           ` Peter Osterlund
@ 2006-02-05 21:07             ` Damian Pietras
  2006-02-05 22:44               ` Peter Osterlund
  0 siblings, 1 reply; 16+ messages in thread
From: Damian Pietras @ 2006-02-05 21:07 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Phillip Susi, linux-kernel

On Sun, Feb 05, 2006 at 08:13:28PM +0100, Peter Osterlund wrote:
> Damian Pietras <daper@daper.net> writes:
> 
> > On Sun, Jan 15, 2006 at 09:47:40PM +0100, Peter Osterlund wrote:
> > > 
> > > The irq timeout problem might be broken hardware/firmware, but there
> > > is a problem with drive locking and the pktcdvd driver.
> > > 
> > > If you do
> > > 
> > > 	pktsetup 0 /dev/hdc
> > > 	mount /dev/hdc /mnt/tmp
> > > 	umount /mnt/tmp
> > > 
> > > the door will be left in a locked state. (It gets unlocked when you
> > > run "pktsetup -d 0" though.) However, if you do:
> > > 
> > > 	pktsetup 0 /dev/hdc
> > > 	mount /dev/pktcdvd/0 /mnt/tmp
> > > 	umount /mnt/tmp
> > 
> > Thanks!
> > 
> > It works this way without any irq timeout. Unfortunately I can't use it
> > as a workaround, because CD-R media must be mounted with '-o ro' or I
> > get 'pktcdvd: Wrong disc profile (9)', so I can't just put it in fstab
> > and use 'mount /media/cdrom' for both CD-R and RW discs.
> 
> Please try this patch.

Now I can mount CD-R, CD-RW, DVD+RW using pktcdvd.

Something strange happend when I copied files to DVD+RW und used eject.
After some time eject exitet, but the disc was stil in the burner, I was
allowed to open it by pressing the eject button, but then:

hda: media error (bad sector): status=0x51 { DriveReady SeekComplete Error }
hda: media error (bad sector): error=0x34 { AbortedCommand LastFailedSense=0x03
}
ide: failed opcode was: unknown
end_request: I/O error, dev hda, sector 4546112
end_request: I/O error, dev hda, sector 4546116
end_request: I/O error, dev hda, sector 4546124
end_request: I/O error, dev hda, sector 4546132
end_request: I/O error, dev hda, sector 4546140
end_request: I/O error, dev hda, sector 4546148
end_request: I/O error, dev hda, sector 4546156
end_request: I/O error, dev hda, sector 4546164
end_request: I/O error, dev hda, sector 4546172
Buffer I/O error on device pktcdvd0, logical block 1136528
lost page write due to I/O error on pktcdvd0

And also many messages like this:
pktcdvd: Unknown ioctl for pktcdvd0 (5326)

I have no more free time to test if the disc is OK, but I think it is,
since it's new and was written only few times.
Writing to CD-RW and umounting it gave no errors.


When inserting CD-R I get:
pktcdvd: Wrong disc profile (9)
pktcdvd: pktcdvd0 failed probe

but everything works OK.

-- 
Damian Pietras

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

* Re: Problems with eject and pktcdvd
  2006-02-05 21:07             ` Damian Pietras
@ 2006-02-05 22:44               ` Peter Osterlund
  2006-02-06 20:15                 ` Damian Pietras
  0 siblings, 1 reply; 16+ messages in thread
From: Peter Osterlund @ 2006-02-05 22:44 UTC (permalink / raw)
  To: Damian Pietras; +Cc: Phillip Susi, linux-kernel

Damian Pietras <daper@daper.net> writes:

> Now I can mount CD-R, CD-RW, DVD+RW using pktcdvd.
> 
> Something strange happend when I copied files to DVD+RW und used eject.
> After some time eject exitet, but the disc was stil in the burner, I was
> allowed to open it by pressing the eject button, but then:
> 
> hda: media error (bad sector): status=0x51 { DriveReady SeekComplete Error }
> hda: media error (bad sector): error=0x34 { AbortedCommand LastFailedSense=0x03

Thanks for testing. Please try this patch: It makes sure not to unlock
the door if the disc is in use.

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index f92d22f..a43f68d 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2436,7 +2436,8 @@ static int pkt_ioctl(struct block_device
 		 * The door gets locked when the device is opened, so we
 		 * have to unlock it or else the eject command fails.
 		 */
-		pkt_lock_door(pd, 0);
+		if (pd->refcnt == 1)
+			pkt_lock_door(pd, 0);
 		return blkdev_ioctl(pd->bdev, file, cmd, arg);
 
 	default:

> And also many messages like this:
> pktcdvd: Unknown ioctl for pktcdvd0 (5326)
> 
> When inserting CD-R I get:
> pktcdvd: Wrong disc profile (9)
> pktcdvd: pktcdvd0 failed probe
> 
> but everything works OK.

Yes, those messages are quite useless except for debugging. I'll make
them go away.

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

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

* Re: Problems with eject and pktcdvd
  2006-02-05 22:44               ` Peter Osterlund
@ 2006-02-06 20:15                 ` Damian Pietras
  2006-02-11 11:21                   ` Peter Osterlund
  0 siblings, 1 reply; 16+ messages in thread
From: Damian Pietras @ 2006-02-06 20:15 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Phillip Susi, linux-kernel

On Sun, Feb 05, 2006 at 11:44:46PM +0100, Peter Osterlund wrote:
> Damian Pietras <daper@daper.net> writes:
> 
> > Now I can mount CD-R, CD-RW, DVD+RW using pktcdvd.
> > 
> > Something strange happend when I copied files to DVD+RW und used eject.
> > After some time eject exitet, but the disc was stil in the burner, I was
> > allowed to open it by pressing the eject button, but then:
> > 
> > hda: media error (bad sector): status=0x51 { DriveReady SeekComplete Error }
> > hda: media error (bad sector): error=0x34 { AbortedCommand LastFailedSense=0x03
> 
> Thanks for testing. Please try this patch: It makes sure not to unlock
> the door if the disc is in use.

It still allows to eject the disc while `umount /media/cdrom0` is
waiting to finish.

-- 
Damian Pietras

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

* Re: Problems with eject and pktcdvd
  2006-02-06 20:15                 ` Damian Pietras
@ 2006-02-11 11:21                   ` Peter Osterlund
  2006-02-12 10:34                     ` Damian Pietras
  0 siblings, 1 reply; 16+ messages in thread
From: Peter Osterlund @ 2006-02-11 11:21 UTC (permalink / raw)
  To: Damian Pietras; +Cc: Phillip Susi, linux-kernel

Damian Pietras <daper@daper.net> writes:

> On Sun, Feb 05, 2006 at 11:44:46PM +0100, Peter Osterlund wrote:
> > Damian Pietras <daper@daper.net> writes:
> > 
> > > Now I can mount CD-R, CD-RW, DVD+RW using pktcdvd.
> > > 
> > > Something strange happend when I copied files to DVD+RW und used eject.
> > > After some time eject exitet, but the disc was stil in the burner, I was
> > > allowed to open it by pressing the eject button, but then:
> > > 
> > > hda: media error (bad sector): status=0x51 { DriveReady SeekComplete Error }
> > > hda: media error (bad sector): error=0x34 { AbortedCommand LastFailedSense=0x03
> > 
> > Thanks for testing. Please try this patch: It makes sure not to unlock
> > the door if the disc is in use.
> 
> It still allows to eject the disc while `umount /media/cdrom0` is
> waiting to finish.

That patch was accidentally created on top of another patch which I
haven't posted yet, so it didn't apply cleanly. Can you please try
again with the patch below and 2.6.16-rc2-git10 or later?

If that still doesn't work as expected, how did you eject the disc?
With the button or with the eject command? If it was the eject
command, please run eject with strace and send the output to me.


pktcdvd: Don't unlock the door if the disc is in use

Signed-off-by: Peter Osterlund <petero2@telia.com>
---

 drivers/block/pktcdvd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index d747f28..d794f2b 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2436,7 +2436,8 @@ static int pkt_ioctl(struct inode *inode
 		 * The door gets locked when the device is opened, so we
 		 * have to unlock it or else the eject command fails.
 		 */
-		pkt_lock_door(pd, 0);
+		if (pd->refcnt == 1)
+			pkt_lock_door(pd, 0);
 		return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);
 
 	default:

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

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

* Re: Problems with eject and pktcdvd
  2006-02-11 11:21                   ` Peter Osterlund
@ 2006-02-12 10:34                     ` Damian Pietras
  0 siblings, 0 replies; 16+ messages in thread
From: Damian Pietras @ 2006-02-12 10:34 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Phillip Susi, linux-kernel

On Sat, Feb 11, 2006 at 12:21:04PM +0100, Peter Osterlund wrote:
> That patch was accidentally created on top of another patch which I
> haven't posted yet, so it didn't apply cleanly. Can you please try
> again with the patch below and 2.6.16-rc2-git10 or later?

Now it works properly, thanks.

-- 
Damian Pietras

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

end of thread, other threads:[~2006-02-12 10:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-15 12:35 Problems with eject and pktcdvd Damian Pietras
2006-01-15 17:53 ` Phillip Susi
2006-01-15 18:50   ` Damian Pietras
2006-01-15 19:17     ` Phillip Susi
2006-01-15 20:47       ` Peter Osterlund
2006-01-15 21:04         ` Damian Pietras
2006-01-15 21:18           ` Jan Engelhardt
2006-01-15 21:34             ` Peter Osterlund
2006-02-05 19:13           ` Peter Osterlund
2006-02-05 21:07             ` Damian Pietras
2006-02-05 22:44               ` Peter Osterlund
2006-02-06 20:15                 ` Damian Pietras
2006-02-11 11:21                   ` Peter Osterlund
2006-02-12 10:34                     ` Damian Pietras
2006-01-15 22:23         ` Phillip Susi
2006-01-15 22:55         ` Nix

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).