Hi Stephen,

hdparm doesn't "know" what kind of device it is talking to,
so it first tries "IDENTIFY" (which works only for hard disks)
and then if that fails it tries "PACKET_IDENTIFY" (which works
only for ATAPI devices).

In the case of an optical drive (ATAPI), that means the first
command will be rejected.  In this case, the IDE driver logs
an error to klogd.. questionable behaviour (since it can lead
to a D.O.S. attack..).

I don't think the kernel should be logging errors for commands
that are issued to it via the HDIO_DRIVE_CMD ioctl.
Of couse, I have only myself to blame for that, since I wrote
the code that's logging those errors!  (oops!)

I *could* enhance hdparm to look at /proc/ide/*/media before
issuing the command, but the /proc/ide/* directory is not likely
to exist much longer -- slated for removal from the kernel.

So.. not much to do, other than ignore the syslog.

Cheers
--
Mark Lord
Real-Time Remedies Inc.
[EMAIL PROTECTED]

Stephen Gran wrote:
Mark,

What's your opinion about this?  I can in fact reproduce it, and I
basically understand why it's happening, but what to do?

It seems to me that during the hdparm query, the kernel notices a seek
error (I'm guessing - haven't looked up what 0xec is) and reports the
seek error.  hdparm is correct for doing the tests, and the kernel isn't
wrong for reporting it, I don't think, but getting scary messages in
syslog every time you look at drive parameters isn't right either.

Hmm.


------------------------------------------------------------------------

Subject:
Bug#328595: IDE error when running 'hdparm -I /dev/cdrom'
From:
Thomas Halva Labella <[EMAIL PROTECTED]>
Date:
Fri, 16 Sep 2005 12:09:04 +0200
To:
Debian Bug Tracking System <[EMAIL PROTECTED]>

To:
Debian Bug Tracking System <[EMAIL PROTECTED]>


Package: hdparm
Version: 6.1-5
Severity: normal

When I run 'hdparm -I /dev/cdrom', the following appears in the system
log:

Sep 16 11:56:57 localhost kernel: hdc: drive_cmd: status=0x51 { DriveReady 
SeekComplete Error }
Sep 16 11:56:57 localhost kernel: hdc: drive_cmd: error=0x04 { AbortedCommand }
Sep 16 11:56:57 localhost kernel: ide: failed opcode was: 0xec

The output seems correct though:

/dev/cdrom:

ATAPI CD-ROM, with removable media
        Model Number:       _NEC DVD+/-RW ND-6500A
        Serial Number:
        Firmware Revision:  2.58
Standards:
        Likely used CD-ROM ATAPI-1
Configuration:
        DRQ response: 3ms.
        Packet size: 12 bytes
Capabilities:
        LBA, IORDY(cannot be disabled)
        DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns

I am using original Linux Kernel 2.6.13.1, patched with ACPI 20050902,
but the problem appeared also with Debian kernel pakage 2.6.12

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'proposed-updates'), (400, 'unstable'), 
(200, 'stable'), (1, 'sarge-unsupported')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13.1-amd64
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages hdparm depends on:
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  lsb-base                      3.0-5      Linux Standard Base 3.0 init scrip

hdparm recommends no packages.

-- no debconf information






--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to