LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
@ 2007-11-13 16:43 Sebastian Kemper
  2007-11-13 21:22 ` Alan Cox
  0 siblings, 1 reply; 18+ messages in thread
From: Sebastian Kemper @ 2007-11-13 16:43 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

Hi all,

while trying to limit the speed of DVD drives during DVD playback I've
come under the impression that GPCMD_SET_STREAMING via SG_IO doesn't yet
work with libata/PATA (AMD/NVIDIA PATA support). I tested on an NForce2
board (all IDE, no SATA) and kernel 2.6.22.12. When I use the "old" ATA
kernel driver my drive slows down, with libata it doesn't. Is this a
known issue or has this slipped by unnoticed?

I tried with mplayer dvd:// -dvd-device /dev/sr0 -dvd-speed BTW . I get
no errors in syslog/dmesg. Also mplayer doesn't report a problem (so
ioctl(fd, SG_IO, &sghdr) doesn't have a return < 0).

Regards
Sebastian

[-- Attachment #2: libata-dmesg.out --]
[-- Type: text/plain, Size: 15466 bytes --]

ghMem    229376 ->   262128
early_node_map[1] active PFN ranges
    0:        0 ->   262128
On node 0 totalpages: 262128
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 1760 pages used for memmap
  Normal zone: 223520 pages, LIFO batch:31
  HighMem zone: 255 pages used for memmap
  HighMem zone: 32497 pages, LIFO batch:7
DMI 2.2 present.
ACPI: RSDP 000F6FA0, 0014 (r0 Nvidia)
ACPI: RSDT 3FFF3000, 002C (r1 Nvidia AWRDACPI 42302E31 AWRD        0)
ACPI: FACP 3FFF3040, 0074 (r1 Nvidia AWRDACPI 42302E31 AWRD        0)
ACPI: DSDT 3FFF30C0, 478E (r1 NVIDIA AWRDACPI     1000 MSFT  100000E)
ACPI: FACS 3FFF0000, 0040
ACPI: APIC 3FFF7880, 006E (r1 Nvidia AWRDACPI 42302E31 AWRD        0)
Nvidia board detected. Ignoring ACPI timer override.
If you got timer trouble try acpi_use_timer_override
ACPI: PM-Timer IO Port: 0x4008
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
Processor #0 6:8 APIC version 16
ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 2, version 17, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: BIOS IRQ0 pin2 override ignored.
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 14 high edge)
ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 15 high edge)
ACPI: IRQ9 used by override.
ACPI: IRQ14 used by override.
ACPI: IRQ15 used by override.
Enabling APIC mode:  Flat.  Using 1 I/O APICs
Using ACPI (MADT) for SMP configuration information
Allocating PCI resources starting at 50000000 (gap: 40000000:bec00000)
Built 1 zonelists.  Total pages: 260081
Kernel command line: BOOT_IMAGE=Gentoo ro root=802 radeonfb.default_dynclk=1 radeonfb.monitor_layout=TMDS,NONE snd-ac97-codec.power_save=1 loop.max_loop=2 acpi_os_name="Microsoft Windows NT" acpi_osi="Windows 2001"
ACPI: Added _OSI(Windows 2001)
mapped APIC to ffffd000 (fee00000)
mapped IOAPIC to ffffc000 (fec00000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 16384 bytes)
Detected 1670.455 MHz processor.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1035792k/1048512k available (2049k kernel code, 12076k reserved, 683k data, 160k init, 131008k highmem)
virtual kernel memory layout:
    fixmap  : 0xfffab000 - 0xfffff000   ( 336 kB)
    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
    vmalloc : 0xf8800000 - 0xff7fe000   ( 111 MB)
    lowmem  : 0xc0000000 - 0xf8000000   ( 896 MB)
      .init : 0xc03ae000 - 0xc03d6000   ( 160 kB)
      .data : 0xc0300633 - 0xc03ab264   ( 683 kB)
      .text : 0xc0100000 - 0xc0300633   (2049 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 3342.82 BogoMIPS (lpj=16714141)
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 0383fbff c1cbfbff 00000000 00000000 00000000 00000000 00000000
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
CPU: After all inits, caps: 0383fbff c1cbfbff 00000000 00000420 00000000 00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
Compat vDSO mapped to ffffe000.
CPU: AMD Sempron(tm)   2400+ stepping 01
Checking 'hlt' instruction... OK.
ACPI: Core revision 20070126
ACPI: Overriding _OS definition to 'Microsoft Windows NT'
ENABLING IO-APIC IRQs
..TIMER: vector=0x31 apic1=0 pin1=0 apic2=-1 pin2=-1
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: Using configuration type 1
Setting up standard PCI resources
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Probing PCI hardware (bus 00)
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.HUB0._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGPB._PRT]
ACPI: PCI Interrupt Link [LNK1] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK2] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK3] (IRQs 3 4 5 6 7 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LNK4] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNK5] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LUBA] (IRQs *3 4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LUBB] (IRQs 3 4 5 6 *7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LMAC] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LAPU] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LACI] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LMCI] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LSMB] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LUB2] (IRQs 3 4 *5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LFIR] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [L3CM] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LIDE] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [APC1] (IRQs *16), disabled.
ACPI: PCI Interrupt Link [APC2] (IRQs *17), disabled.
ACPI: PCI Interrupt Link [APC3] (IRQs *18)
ACPI: PCI Interrupt Link [APC4] (IRQs *19)
ACPI: PCI Interrupt Link [APC5] (IRQs *16), disabled.
ACPI: PCI Interrupt Link [APCF] (IRQs 20 21 22) *0
ACPI: PCI Interrupt Link [APCG] (IRQs 20 21 22) *0
ACPI: PCI Interrupt Link [APCH] (IRQs 20 21 22) *0
ACPI: PCI Interrupt Link [APCI] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCJ] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCK] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCS] (IRQs *23)
ACPI: PCI Interrupt Link [APCL] (IRQs 20 21 22) *0
ACPI: PCI Interrupt Link [APCM] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [AP3C] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCZ] (IRQs 20 21 22) *0, disabled.
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp: PnP ACPI: found 10 devices
ACPI: ACPI bus type pnp unregistered
SCSI subsystem initialized
libata version 2.21 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
pnp: 00:00: ioport range 0x4000-0x407f has been reserved
pnp: 00:00: ioport range 0x4080-0x40ff has been reserved
pnp: 00:00: ioport range 0x4400-0x447f has been reserved
pnp: 00:00: ioport range 0x4480-0x44ff has been reserved
pnp: 00:00: ioport range 0x4200-0x427f has been reserved
pnp: 00:00: ioport range 0x4280-0x42ff has been reserved
pnp: 00:01: ioport range 0x5000-0x503f has been reserved
pnp: 00:01: ioport range 0x5100-0x513f has been reserved
pnp: 00:02: iomem range 0xd5800-0xd7fff has been reserved
pnp: 00:02: iomem range 0xf0000-0xf7fff could not be reserved
pnp: 00:02: iomem range 0xf8000-0xfbfff could not be reserved
pnp: 00:02: iomem range 0xfc000-0xfffff could not be reserved
Time: tsc clocksource has been installed.
PCI: Bridge: 0000:00:08.0
  IO window: c000-cfff
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1e.0
  IO window: d000-dfff
  MEM window: e4000000-e5ffffff
  PREFETCH window: d0000000-dfffffff
PCI: Setting latency timer of device 0000:00:08.0 to 64
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
highmem bounce pool size: 64 pages
io scheduler noop registered
io scheduler cfq registered (default)
Boot video device is 0000:02:00.0
ACPI: PCI Interrupt Link [APC4] enabled at IRQ 19
ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [APC4] -> GSI 19 (level, high) -> IRQ 16
radeonfb: Found Intel x86 BIOS ROM Image
radeonfb: Retrieved PLL infos from BIOS
radeonfb: Reference=27.00 MHz (RefDiv=12) Memory=240.00 Mhz, System=166.00 MHz
radeonfb: PLL min 20000 max 40000
radeonfb: Monitor 1 type DFP found
radeonfb: EDID probed
radeonfb: Monitor 2 type no found
Switched to high resolution mode on CPU 0
radeonfb: Dynamic Clock Power Management enabled
Console: switching to colour frame buffer device 160x64
radeonfb (0000:02:00.0): ATI Radeon Y` 
input: Power Button (FF) as /class/input/input0
ACPI: Power Button (FF) [PWRF]
input: Power Button (CM) as /class/input/input1
ACPI: Power Button (CM) [PWRB]
input: Sleep Button (CM) as /class/input/input2
ACPI: Sleep Button (CM) [SLPB]
ACPI: Thermal Zone [THRM] (37 C)
Real Time Clock Driver v1.12ac
loop: module loaded
forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.60.
ACPI: PCI Interrupt Link [APCH] enabled at IRQ 22
ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [APCH] -> GSI 22 (level, high) -> IRQ 17
PCI: Setting latency timer of device 0000:00:04.0 to 64
eth0: forcedeth.c: subsystem: 01297:0531 bound to 0000:00:04.0
pata_amd 0000:00:09.0: version 0.3.8
PCI: Setting latency timer of device 0000:00:09.0 to 64
scsi0 : pata_amd
scsi1 : pata_amd
ata1: PATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x0001f000 irq 14
ata2: PATA max UDMA/133 cmd 0x00010170 ctl 0x00010376 bmdma 0x0001f008 irq 15
ata1.00: ATA-7: SAMSUNG SP2014N, VC100-33, max UDMA/133
ata1.00: 390721968 sectors, multi 16: LBA48 
ata1.00: configured for UDMA/133
ata2.00: ATAPI: Optiarc DVD RW AD-7170A, 1.04, max UDMA/66
ata2.01: ATAPI: LITE-ON DVD SOHD-16P9SV, F$02, max UDMA/33
ata2.00: configured for UDMA/66
ata2.01: configured for UDMA/33
scsi 0:0:0:0: Direct-Access     ATA      SAMSUNG SP2014N  VC10 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 390721968 512-byte hardware sectors (200050 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:0:0: [sda] 390721968 512-byte hardware sectors (200050 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 >
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: CD-ROM            Optiarc  DVD RW AD-7170A  1.04 PQ: 0 ANSI: 5
sr0: scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 1:0:0:0: Attached scsi CD-ROM sr0
sr 1:0:0:0: Attached scsi generic sg1 type 5
scsi 1:0:1:0: CD-ROM            LITE-ON  DVD SOHD-16P9SV  F$02 PQ: 0 ANSI: 5
sr1: scsi3-mmc drive: 4x/48x cd/rw xa/form2 cdda tray
sr 1:0:1:0: Attached scsi CD-ROM sr1
sr 1:0:1:0: Attached scsi generic sg2 type 5
ACPI: PCI Interrupt Link [APCL] enabled at IRQ 21
ACPI: PCI Interrupt 0000:00:02.2[C] -> Link [APCL] -> GSI 21 (level, high) -> IRQ 18
PCI: Setting latency timer of device 0000:00:02.2 to 64
ehci_hcd 0000:00:02.2: EHCI Host Controller
ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:02.2: debug port 1
PCI: cache line size of 64 is not supported by device 0000:00:02.2
ehci_hcd 0000:00:02.2: irq 18, io mem 0xe6000000
ehci_hcd 0000:00:02.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 6 ports detected
ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
ACPI: PCI Interrupt Link [APCF] enabled at IRQ 20
ACPI: PCI Interrupt 0000:00:02.0[A] -> Link [APCF] -> GSI 20 (level, high) -> IRQ 19
PCI: Setting latency timer of device 0000:00:02.0 to 64
ohci_hcd 0000:00:02.0: OHCI Host Controller
ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:02.0: irq 19, io mem 0xe6003000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
ACPI: PCI Interrupt Link [APCG] enabled at IRQ 22
ACPI: PCI Interrupt 0000:00:02.1[B] -> Link [APCG] -> GSI 22 (level, high) -> IRQ 17
PCI: Setting latency timer of device 0000:00:02.1 to 64
ohci_hcd 0000:00:02.1: OHCI Host Controller
ohci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 3
ohci_hcd 0000:00:02.1: irq 17, io mem 0xe6004000
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 3 ports detected
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
usb 2-1: new low speed USB device using ohci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
usb 2-2: new low speed USB device using ohci_hcd and address 3
usb 2-2: configuration #1 chosen from 1 choice
usb 3-2: new full speed USB device using ohci_hcd and address 2
usb 3-2: configuration #1 chosen from 1 choice
input: Logitech USB-PS/2 Optical Mouse as /class/input/input3
input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:02.0-1
input: Logitech HID compliant keyboard as /class/input/input4
input: USB HID v1.10 Keyboard [Logitech HID compliant keyboard] on usb-0000:00:02.0-2
input: Logitech HID compliant keyboard as /class/input/input5
input: USB HID v1.10 Device [Logitech HID compliant keyboard] on usb-0000:00:02.0-2
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.14 (Thu May 31 09:03:25 2007 UTC).
ACPI: PCI Interrupt Link [APC3] enabled at IRQ 18
ACPI: PCI Interrupt 0000:01:06.0[A] -> Link [APC3] -> GSI 18 (level, high) -> IRQ 20
ALSA device list:
  #0: M Audio Audiophile 24/96 at 0xc000, irq 20
TCP cubic registered
NET: Registered protocol family 1
Using IPI Shortcut mode
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 160k freed
EXT3 FS on sda2, internal journal
lirc_dev: IR Remote Control driver registered, at major 61 
lirc_serial: auto-detected active low receiver
lirc_dev: lirc_register_plugin: sample_rate: 0
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda3, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda5, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda7, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Adding 979924k swap on /dev/sda6.  Priority:-1 extents:1 across:979924k
kjournald starting.  Commit interval 5 seconds
EXT3 FS on dm-0, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (8191 buckets, 65528 max)

[-- Attachment #3: ver_linux.out --]
[-- Type: text/plain, Size: 920 bytes --]

If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.
 
Linux section-eight 2.6.22.12 #2 Tue Nov 13 17:05:58 CET 2007 i686 AMD Sempron(tm) 2400+ AuthenticAMD GNU/Linux
 
Gnu C                  4.1.2
Gnu make               3.81
binutils               Binutils
util-linux             2.12r
mount                  2.12r
module-init-tools      3.2.2
e2fsprogs              1.40.2
Linux C Library        2.6.1
Dynamic linker (ldd)   2.6.1
Procps                 3.2.7
Net-tools              1.60
Kbd                    1.13
Sh-utils               6.9
udev                   115
Modules Loaded         ipt_LOG xt_state xt_tcpudp xt_pkttype ipt_REJECT xt_multiport xt_conntrack iptable_mangle nf_conntrack_ipv4 nf_conntrack iptable_filter ip_tables x_tables sha256 serpent cbc blkcipher cryptomgr crypto_algapi dm_crypt lirc_serial lirc_dev

[-- Attachment #4: kernel-libata.config --]
[-- Type: text/plain, Size: 5734 bytes --]

CONFIG_X86_32=y
CONFIG_GENERIC_TIME=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_X86=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_QUICKLIST=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_DMI=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_SYSCTL=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_KMOD=y
CONFIG_BLOCK=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_CFQ=y
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_X86_PC=y
CONFIG_MK7=y
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_X86_POPAD_OK=y
CONFIG_X86_GOOD_APIC=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
CONFIG_X86_USE_3DNOW=y
CONFIG_X86_TSC=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_MODEL=4
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_X86_UP_APIC=y
CONFIG_X86_UP_IOAPIC=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_MCE=y
CONFIG_VM86=y
CONFIG_HIGHMEM4G=y
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_HIGHMEM=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_SPARSEMEM_STATIC=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_ZONE_DMA_FLAG=1
CONFIG_NR_QUICK=1
CONFIG_MTRR=y
CONFIG_HZ_100=y
CONFIG_HZ=100
CONFIG_PHYSICAL_START=0x100000
CONFIG_PHYSICAL_ALIGN=0x100000
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_PM=y
CONFIG_ACPI=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_BLACKLIST_YEAR=0
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y
CONFIG_X86_PM_TIMER=y
CONFIG_PCI=y
CONFIG_PCI_GODIRECT=y
CONFIG_PCI_DIRECT=y
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_ISA_DMA_API=y
CONFIG_BINFMT_ELF=y
CONFIG_NET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_FIB_HASH=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_NETFILTER=y
CONFIG_NF_CONNTRACK_ENABLED=m
CONFIG_NF_CONNTRACK=m
CONFIG_NETFILTER_XTABLES=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
CONFIG_NETFILTER_XT_MATCH_STATE=m
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_TARGET_LOG=m
CONFIG_IP_NF_MANGLE=m
CONFIG_BT=m
CONFIG_BT_L2CAP=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_HCIUSB=m
CONFIG_PNP=y
CONFIG_PNPACPI=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_WAIT_SCAN=m
CONFIG_ATA=y
CONFIG_ATA_ACPI=y
CONFIG_PATA_AMD=y
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_CRYPT=m
CONFIG_NETDEVICES=y
CONFIG_NET_ETHERNET=y
CONFIG_NET_PCI=y
CONFIG_FORCEDETH=y
CONFIG_INPUT=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1280
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1024
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ATKBD=y
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_LIBPS2=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_RTC=y
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_ALGOBIT=y
CONFIG_FB=y
CONFIG_FB_DDC=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_RADEON=y
CONFIG_FB_RADEON_I2C=y
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_MPU401_UART=y
CONFIG_SND_AC97_CODEC=y
CONFIG_SND_ICE1712=y
CONFIG_SND_AC97_POWER_SAVE=y
CONFIG_AC97_BUS=y
CONFIG_HID=y
CONFIG_USB_HID=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_DEVICEFS=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_STORAGE=m
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_PL2303=m
CONFIG_EXT3_FS=y
CONFIG_JBD=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_DNOTIFY=y
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y
CONFIG_FAT_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=850
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15"
CONFIG_PROC_FS=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_RAMFS=y
CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=m
CONFIG_NLS_DEFAULT="iso8859-15"
CONFIG_NLS_CODEPAGE_850=m
CONFIG_NLS_ISO8859_15=m
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_EARLY_PRINTK=y
CONFIG_X86_FIND_SMP_CONFIG=y
CONFIG_X86_MPPARSE=y
CONFIG_DOUBLEFAULT=y
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=m
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_BITREVERSE=y
CONFIG_CRC32=y
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_X86_BIOS_REBOOT=y
CONFIG_KTIME_SCALAR=y

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-13 16:43 libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Sebastian Kemper
@ 2007-11-13 21:22 ` Alan Cox
  2007-11-13 23:28   ` Sebastian Kemper
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Cox @ 2007-11-13 21:22 UTC (permalink / raw)
  To: Sebastian Kemper; +Cc: linux-kernel

> while trying to limit the speed of DVD drives during DVD playback I've
> come under the impression that GPCMD_SET_STREAMING via SG_IO doesn't yet
> work with libata/PATA (AMD/NVIDIA PATA support). I tested on an NForce2
> board (all IDE, no SATA) and kernel 2.6.22.12. When I use the "old" ATA
> kernel driver my drive slows down, with libata it doesn't. Is this a
> known issue or has this slipped by unnoticed?

It isn't a known issue, and it suprises me as SG_IO basically passes
commands through to the drive. We don't support speed change via xfermode
setting but GPCMD_SET_STREAMING sohuld behave.

> 
> I tried with mplayer dvd:// -dvd-device /dev/sr0 -dvd-speed BTW . I get
> no errors in syslog/dmesg. Also mplayer doesn't report a problem (so
> ioctl(fd, SG_IO, &sghdr) doesn't have a return < 0).

Do you have a simple code example that shows the problem ?

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-13 21:22 ` Alan Cox
@ 2007-11-13 23:28   ` Sebastian Kemper
  2007-11-14 12:11     ` Sebastian Kemper
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Sebastian Kemper @ 2007-11-13 23:28 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Hi Alan!

On Tue, Nov 13, 2007 at 09:22:30PM +0000, Alan Cox wrote:
> It isn't a known issue, and it suprises me as SG_IO basically passes
> commands through to the drive. We don't support speed change via xfermode
> setting but GPCMD_SET_STREAMING sohuld behave.
> 
> Do you have a simple code example that shows the problem ?

http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_dvd.c?view=markup

See dvd_set_speed(). The drive I'm using is an Optiarc DVD RW AD-7170A.
With the "old" ATA driver dvd_set_speed() works, with libata it doesn't.

Regards
Sebastian

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-13 23:28   ` Sebastian Kemper
@ 2007-11-14 12:11     ` Sebastian Kemper
  2007-11-14 15:09     ` Mark Lord
  2007-11-14 16:26     ` libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Mark Lord
  2 siblings, 0 replies; 18+ messages in thread
From: Sebastian Kemper @ 2007-11-14 12:11 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

On Wed, Nov 14, 2007 at 12:28:59AM +0100, Sebastian Kemper wrote:
> http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_dvd.c?view=markup
> 
> See dvd_set_speed(). The drive I'm using is an Optiarc DVD RW AD-7170A.
> With the "old" ATA driver dvd_set_speed() works, with libata it doesn't.

Hello Alan,

in the meantime I tried the kernels 2.6.23.1 as well as 2.6.24-rc2. Both
show the same behaviour when using libata with AMD/NVIDIA PATA support:
GPCMD_SET_STREAMING via SG_IO doesn't have any effect. With these two
kernels I didn't try the "old" ATA driver - but I assume it would've
worked out (changing your system from ATA to libata and vice versa
turned out to be quite time consuming ;)).

Regards
Sebastian

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-13 23:28   ` Sebastian Kemper
  2007-11-14 12:11     ` Sebastian Kemper
@ 2007-11-14 15:09     ` Mark Lord
  2007-11-14 15:38       ` Sebastian Kemper
  2007-11-14 16:26     ` libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Mark Lord
  2 siblings, 1 reply; 18+ messages in thread
From: Mark Lord @ 2007-11-14 15:09 UTC (permalink / raw)
  To: Sebastian Kemper; +Cc: Alan Cox, linux-kernel

Sebastian Kemper wrote:
> Hi Alan!
> 
> On Tue, Nov 13, 2007 at 09:22:30PM +0000, Alan Cox wrote:
>> It isn't a known issue, and it suprises me as SG_IO basically passes
>> commands through to the drive. We don't support speed change via xfermode
>> setting but GPCMD_SET_STREAMING sohuld behave.
>>
>> Do you have a simple code example that shows the problem ?
> 
> http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_dvd.c?view=markup
> 
> See dvd_set_speed(). The drive I'm using is an Optiarc DVD RW AD-7170A.
> With the "old" ATA driver dvd_set_speed() works, with libata it doesn't.
..

I think the problem here might be that libata doesn't actually support SG_IO
for ATAPI drives prior to 2.6.24 (ugh).

Try it with a 2.6.24-rc* kernel from kernel.org, or back-patch the ATA_16
SG_IO support into your older kernel.

Cheers

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 15:09     ` Mark Lord
@ 2007-11-14 15:38       ` Sebastian Kemper
  2007-11-14 16:00         ` Mark Lord
  0 siblings, 1 reply; 18+ messages in thread
From: Sebastian Kemper @ 2007-11-14 15:38 UTC (permalink / raw)
  To: Mark Lord; +Cc: linux-kernel, Alan Cox

On Wed, Nov 14, 2007 at 10:09:22AM -0500, Mark Lord wrote:
> I think the problem here might be that libata doesn't actually support 
> SG_IO
> for ATAPI drives prior to 2.6.24 (ugh).
>
> Try it with a 2.6.24-rc* kernel from kernel.org, or back-patch the ATA_16
> SG_IO support into your older kernel.

Hi Mark,

I already tried 2.6.24-rc2 and it didn't work, see my last reply:
http://marc.info/?l=linux-kernel&m=119504244805467&w=2

Regards
Sebastian

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 15:38       ` Sebastian Kemper
@ 2007-11-14 16:00         ` Mark Lord
  2007-11-14 17:44           ` [PATCH] libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs Mark Lord
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Lord @ 2007-11-14 16:00 UTC (permalink / raw)
  To: Sebastian Kemper; +Cc: Mark Lord, linux-kernel, Alan Cox

Sebastian Kemper wrote:
> On Wed, Nov 14, 2007 at 10:09:22AM -0500, Mark Lord wrote:
>> I think the problem here might be that libata doesn't actually support 
>> SG_IO
>> for ATAPI drives prior to 2.6.24 (ugh).
>>
>> Try it with a 2.6.24-rc* kernel from kernel.org, or back-patch the ATA_16
>> SG_IO support into your older kernel.
> 
> Hi Mark,
> 
> I already tried 2.6.24-rc2 and it didn't work, see my last reply:
> http://marc.info/?l=linux-kernel&m=119504244805467&w=2
..
Yeah, I'm a bit drowsy this morning -- the set speed command
doesn't use ATA_16, so it should work with any kernel.

I'll try it here soon-ish, since I need to update "hdparm -E" for libata anyway.

Cheers

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-13 23:28   ` Sebastian Kemper
  2007-11-14 12:11     ` Sebastian Kemper
  2007-11-14 15:09     ` Mark Lord
@ 2007-11-14 16:26     ` Mark Lord
  2007-11-14 16:41       ` Mark Lord
  2007-11-14 17:16       ` Sebastian Kemper
  2 siblings, 2 replies; 18+ messages in thread
From: Mark Lord @ 2007-11-14 16:26 UTC (permalink / raw)
  To: Sebastian Kemper; +Cc: Alan Cox, linux-kernel

Sebastian Kemper wrote:
> Hi Alan!
> 
> On Tue, Nov 13, 2007 at 09:22:30PM +0000, Alan Cox wrote:
>> It isn't a known issue, and it suprises me as SG_IO basically passes
>> commands through to the drive. We don't support speed change via xfermode
>> setting but GPCMD_SET_STREAMING sohuld behave.
>>
>> Do you have a simple code example that shows the problem ?
> 
> http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_dvd.c?view=markup
..

That code is riddled with bugs, by the way.
It fails to close/clean-up on just about every exit path.
But apart from that, it does appear to issue the command.

Another way to the same thing is with "hdparm -E",
which contrary to my earlier posting actually does
seem to work already with libata.

> See dvd_set_speed(). The drive I'm using is an Optiarc DVD RW AD-7170A.
> With the "old" ATA driver dvd_set_speed() works, with libata it doesn't.
..

Can you define "doesn't work" for me?
How can I test this to see if it works one way or another ?

The command issue (ioctl) is not returning -1.


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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 16:26     ` libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Mark Lord
@ 2007-11-14 16:41       ` Mark Lord
  2007-11-14 17:11         ` Sebastian Kemper
  2007-11-14 17:16       ` Sebastian Kemper
  1 sibling, 1 reply; 18+ messages in thread
From: Mark Lord @ 2007-11-14 16:41 UTC (permalink / raw)
  To: Mark Lord; +Cc: Sebastian Kemper, Alan Cox, linux-kernel

Mark Lord wrote:
> Sebastian Kemper wrote:
>> Hi Alan!
>>
>> On Tue, Nov 13, 2007 at 09:22:30PM +0000, Alan Cox wrote:
>>> It isn't a known issue, and it suprises me as SG_IO basically passes
>>> commands through to the drive. We don't support speed change via 
>>> xfermode
>>> setting but GPCMD_SET_STREAMING sohuld behave.
>>>
>>> Do you have a simple code example that shows the problem ?
>>
>> http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_dvd.c?view=markup
> ..
> 
> That code is riddled with bugs, by the way.
> It fails to close/clean-up on just about every exit path.
> But apart from that, it does appear to issue the command.
> 
> Another way to the same thing is with "hdparm -E",
> which contrary to my earlier posting actually does
> seem to work already with libata.
> 
>> See dvd_set_speed(). The drive I'm using is an Optiarc DVD RW AD-7170A.
>> With the "old" ATA driver dvd_set_speed() works, with libata it doesn't.
> ..
> 
> Can you define "doesn't work" for me?
> How can I test this to see if it works one way or another ?
> 
> The command issue (ioctl) is not returning -1.
..

Ahh.. got it.  The host_status returned (not checked by that code) was 7,
which means "host error".

In this case, that's because the cmd_len is (16), which is too large for ATAPI.
It needs to be changed to (12) instead.

So this line:  sghdr.cmd_len = 12;
The code (apart from totally mishandling any kinds of errors) works after that.

-ml

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 16:41       ` Mark Lord
@ 2007-11-14 17:11         ` Sebastian Kemper
  2007-11-14 17:21           ` Mark Lord
  0 siblings, 1 reply; 18+ messages in thread
From: Sebastian Kemper @ 2007-11-14 17:11 UTC (permalink / raw)
  To: Mark Lord; +Cc: Alan Cox, linux-kernel

Hi Mark!

On Wed, Nov 14, 2007 at 11:41:37AM -0500, Mark Lord wrote:
> Ahh.. got it.  The host_status returned (not checked by that code) was 7,
> which means "host error".
>
> In this case, that's because the cmd_len is (16), which is too large for 
> ATAPI.
> It needs to be changed to (12) instead.

I don't understand. You seem to use a cmd_len of 16 in hdparm yourself.
And why does it work with the "old" ATA driver and not with libata if
16 is too large for ATAPI in general?

> The code (apart from totally mishandling any kinds of errors) works after 
> that.

Greetings
Sebastian

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 16:26     ` libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Mark Lord
  2007-11-14 16:41       ` Mark Lord
@ 2007-11-14 17:16       ` Sebastian Kemper
  2007-11-14 17:49         ` Mark Lord
  1 sibling, 1 reply; 18+ messages in thread
From: Sebastian Kemper @ 2007-11-14 17:16 UTC (permalink / raw)
  To: Mark Lord; +Cc: Alan Cox, linux-kernel

On Wed, Nov 14, 2007 at 11:26:06AM -0500, Mark Lord wrote:
> Another way to the same thing is with "hdparm -E",
> which contrary to my earlier posting actually does
> seem to work already with libata.

Hi!

There are DVD-ROM drives that don't react to hdparm -E but do react to
SET_STREAMING, for instance some NEC drives.

Regards
Sebastian

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 17:11         ` Sebastian Kemper
@ 2007-11-14 17:21           ` Mark Lord
  2007-11-15 20:55             ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Lord @ 2007-11-14 17:21 UTC (permalink / raw)
  To: Sebastian Kemper; +Cc: Alan Cox, linux-kernel

Sebastian Kemper wrote:
> Hi Mark!
> 
> On Wed, Nov 14, 2007 at 11:41:37AM -0500, Mark Lord wrote:
>> Ahh.. got it.  The host_status returned (not checked by that code) was 7,
>> which means "host error".
>>
>> In this case, that's because the cmd_len is (16), which is too large for 
>> ATAPI.
>> It needs to be changed to (12) instead.
> 
> I don't understand. You seem to use a cmd_len of 16 in hdparm yourself.
..

Really?  Where?


> And why does it work with the "old" ATA driver and not with libata if
> 16 is too large for ATAPI in general?
..

Now that *is* the question.
And the answer appears to be that ide-cd.c ignores the passed-in cmd_len,
and replaces it with:

   cmd_len = COMMAND_SIZE(rq->cmd[0]);

That's a SCSI macro to calculate the correct cmd_len based on the SCSI opcode,
which is very appropriate here.   We should do that too (we don't) in libata.

But not exactly as IDE does it -- that's actually a bug:  the code needs to also
check that the new cmd_len is no larger than the original, or we'll get an Oops.

I'll cook up a patch for that shortly and try it before posting it here.

-ml

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

* [PATCH] libata-scsi:  be tolerant of 12-byte ATAPI commands in 16-byte CDBs
  2007-11-14 16:00         ` Mark Lord
@ 2007-11-14 17:44           ` Mark Lord
  2007-11-14 17:50             ` Alan Cox
  2007-11-15  2:26             ` Tejun Heo
  0 siblings, 2 replies; 18+ messages in thread
From: Mark Lord @ 2007-11-14 17:44 UTC (permalink / raw)
  To: Tejun Heo, IDE/ATA development list, Sebastian Kemper
  Cc: Jeff Garzik, Alan Cox, Linux Kernel

Sebastian Kemper reported that issuing CD/DVD commands under libata
is not fully compatible with ide-scsi.  In particular, the GPCMD_SET_STREAMING
was being rejected at the host level in some instances.

The reason is that libata-scsi insists upon the cmd_len field exactly matching
the SCSI opcode being issued, whereas ide-scsi tolerates 12-byte commands
contained within a 16-byte (cmd_len) CDB.

There doesn't seem to be a good reason for us to not be compatible there,
so here is a patch to fix libata-scsi to permit SCSI opcodes so long as
they fit within whatever size CDB is provided.

Signed-off-by: Mark Lord <mlord@pobox.com>
---

Patch is against 2.6.24-rc2-git4.
Sebastian, could you please re-test with this patch
and let us know that it works for you (or not).

--- old/drivers/ata/libata-scsi.c	2007-11-13 23:25:15.000000000 -0500
+++ linux/drivers/ata/libata-scsi.c	2007-11-14 12:32:16.000000000 -0500
@@ -2869,7 +2869,8 @@
 		xlat_func = NULL;
 		if (likely((scsi_op != ATA_16) || !atapi_passthru16)) {
 			/* relay SCSI command to ATAPI device */
-			if (unlikely(scmd->cmd_len > dev->cdb_len))
+			int len = COMMAND_SIZE(scsi_op);
+			if (unlikely(len > scmd->cmd_len || len > dev->cdb_len))
 				goto bad_cdb_len;
 
 			xlat_func = atapi_xlat;

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 17:16       ` Sebastian Kemper
@ 2007-11-14 17:49         ` Mark Lord
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Lord @ 2007-11-14 17:49 UTC (permalink / raw)
  To: Sebastian Kemper; +Cc: Alan Cox, linux-kernel

Sebastian Kemper wrote:
> On Wed, Nov 14, 2007 at 11:26:06AM -0500, Mark Lord wrote:
>> Another way to the same thing is with "hdparm -E",
>> which contrary to my earlier posting actually does
>> seem to work already with libata.
> 
> Hi!
> 
> There are DVD-ROM drives that don't react to hdparm -E but do react to
> SET_STREAMING, for instance some NEC drives.
..

Mmm.. that's possible.  The NEC drive I have here works with either.

I wonder if an update to sr_select_speed() (inside the SCSI code) is needed?
It currently uses GPCMD_SET_SPEED, with no fallback to GPCMD_SET_STREAMING.

Or I suppose this is best left to userspace.
I may change hdparm to try both opcodes.

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

* Re: [PATCH] libata-scsi:  be tolerant of 12-byte ATAPI commands in 16-byte CDBs
  2007-11-14 17:44           ` [PATCH] libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs Mark Lord
@ 2007-11-14 17:50             ` Alan Cox
  2007-11-15  2:26             ` Tejun Heo
  1 sibling, 0 replies; 18+ messages in thread
From: Alan Cox @ 2007-11-14 17:50 UTC (permalink / raw)
  To: Mark Lord
  Cc: Tejun Heo, IDE/ATA development list, Sebastian Kemper,
	Jeff Garzik, Alan Cox, Linux Kernel

On Wed, Nov 14, 2007 at 12:44:23PM -0500, Mark Lord wrote:
> Sebastian Kemper reported that issuing CD/DVD commands under libata
> is not fully compatible with ide-scsi.  In particular, the 
> GPCMD_SET_STREAMING
> was being rejected at the host level in some instances.
> 
> The reason is that libata-scsi insists upon the cmd_len field exactly 
> matching
> the SCSI opcode being issued, whereas ide-scsi tolerates 12-byte commands
> contained within a 16-byte (cmd_len) CDB.
> 
> There doesn't seem to be a good reason for us to not be compatible there,
> so here is a patch to fix libata-scsi to permit SCSI opcodes so long as
> they fit within whatever size CDB is provided.
> 
> Signed-off-by: Mark Lord <mlord@pobox.com>

Acked-by: Alan Cox <alan@redhat.com>


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

* Re: [PATCH] libata-scsi:  be tolerant of 12-byte ATAPI commands in 16-byte CDBs
  2007-11-14 17:44           ` [PATCH] libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs Mark Lord
  2007-11-14 17:50             ` Alan Cox
@ 2007-11-15  2:26             ` Tejun Heo
  1 sibling, 0 replies; 18+ messages in thread
From: Tejun Heo @ 2007-11-15  2:26 UTC (permalink / raw)
  To: Mark Lord
  Cc: IDE/ATA development list, Sebastian Kemper, Jeff Garzik,
	Alan Cox, Linux Kernel

Mark Lord wrote:
> Sebastian Kemper reported that issuing CD/DVD commands under libata
> is not fully compatible with ide-scsi.  In particular, the
> GPCMD_SET_STREAMING
> was being rejected at the host level in some instances.
> 
> The reason is that libata-scsi insists upon the cmd_len field exactly
> matching
> the SCSI opcode being issued, whereas ide-scsi tolerates 12-byte commands
> contained within a 16-byte (cmd_len) CDB.
> 
> There doesn't seem to be a good reason for us to not be compatible there,
> so here is a patch to fix libata-scsi to permit SCSI opcodes so long as
> they fit within whatever size CDB is provided.
> 
> Signed-off-by: Mark Lord <mlord@pobox.com>

applied to #tj-upstream-fixes.

-- 
tejun

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-14 17:21           ` Mark Lord
@ 2007-11-15 20:55             ` Bartlomiej Zolnierkiewicz
  2007-11-15 20:59               ` Mark Lord
  0 siblings, 1 reply; 18+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-11-15 20:55 UTC (permalink / raw)
  To: Mark Lord; +Cc: Sebastian Kemper, Alan Cox, linux-kernel


Hi,

On Wednesday 14 November 2007, Mark Lord wrote:
> Sebastian Kemper wrote:
> > Hi Mark!
> > 
> > On Wed, Nov 14, 2007 at 11:41:37AM -0500, Mark Lord wrote:
> >> Ahh.. got it.  The host_status returned (not checked by that code) was 7,
> >> which means "host error".
> >>
> >> In this case, that's because the cmd_len is (16), which is too large for 
> >> ATAPI.
> >> It needs to be changed to (12) instead.
> > 
> > I don't understand. You seem to use a cmd_len of 16 in hdparm yourself.
> ..
> 
> Really?  Where?
> 
> 
> > And why does it work with the "old" ATA driver and not with libata if
> > 16 is too large for ATAPI in general?
> ..
> 
> Now that *is* the question.
> And the answer appears to be that ide-cd.c ignores the passed-in cmd_len,
> and replaces it with:
> 
>    cmd_len = COMMAND_SIZE(rq->cmd[0]);
> 
> That's a SCSI macro to calculate the correct cmd_len based on the SCSI opcode,
> which is very appropriate here.   We should do that too (we don't) in libata.
> 
> But not exactly as IDE does it -- that's actually a bug:  the code needs to also
> check that the new cmd_len is no larger than the original, or we'll get an Oops.
> 
> I'll cook up a patch for that shortly and try it before posting it here.

Could you please also fix ide-cd while at it?

Thanks,
Bart

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

* Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
  2007-11-15 20:55             ` Bartlomiej Zolnierkiewicz
@ 2007-11-15 20:59               ` Mark Lord
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Lord @ 2007-11-15 20:59 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Sebastian Kemper, Alan Cox, linux-kernel

Bartlomiej Zolnierkiewicz wrote:
> Hi,
> 
> On Wednesday 14 November 2007, Mark Lord wrote:
>> Sebastian Kemper wrote:
>>> Hi Mark!
>>>
>>> On Wed, Nov 14, 2007 at 11:41:37AM -0500, Mark Lord wrote:
>>>> Ahh.. got it.  The host_status returned (not checked by that code) was 7,
>>>> which means "host error".
>>>>
>>>> In this case, that's because the cmd_len is (16), which is too large for 
>>>> ATAPI.
>>>> It needs to be changed to (12) instead.
>>> I don't understand. You seem to use a cmd_len of 16 in hdparm yourself.
>> ..
>>
>> Really?  Where?
>>
>>
>>> And why does it work with the "old" ATA driver and not with libata if
>>> 16 is too large for ATAPI in general?
>> ..
>>
>> Now that *is* the question.
>> And the answer appears to be that ide-cd.c ignores the passed-in cmd_len,
>> and replaces it with:
>>
>>    cmd_len = COMMAND_SIZE(rq->cmd[0]);
>>
>> That's a SCSI macro to calculate the correct cmd_len based on the SCSI opcode,
>> which is very appropriate here.   We should do that too (we don't) in libata.
>>
>> But not exactly as IDE does it -- that's actually a bug:  the code needs to also
>> check that the new cmd_len is no larger than the original, or we'll get an Oops.
>>
>> I'll cook up a patch for that shortly and try it before posting it here.
> 
> Could you please also fix ide-cd while at it?
..

ide-cd already does the COMMAND_SIZE() thingie, so that fix is not needed.

The only bug there is that it doesn't check for the possibility
of a 16-byte opcode being issued with only a 12-byte CDB underneath.
In practice, this doesn't seem to hurt anything.

I'm no longer familiar enough with the code there to reliably fix it.

Cheers

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

end of thread, other threads:[~2007-11-15 20:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-13 16:43 libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Sebastian Kemper
2007-11-13 21:22 ` Alan Cox
2007-11-13 23:28   ` Sebastian Kemper
2007-11-14 12:11     ` Sebastian Kemper
2007-11-14 15:09     ` Mark Lord
2007-11-14 15:38       ` Sebastian Kemper
2007-11-14 16:00         ` Mark Lord
2007-11-14 17:44           ` [PATCH] libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs Mark Lord
2007-11-14 17:50             ` Alan Cox
2007-11-15  2:26             ` Tejun Heo
2007-11-14 16:26     ` libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Mark Lord
2007-11-14 16:41       ` Mark Lord
2007-11-14 17:11         ` Sebastian Kemper
2007-11-14 17:21           ` Mark Lord
2007-11-15 20:55             ` Bartlomiej Zolnierkiewicz
2007-11-15 20:59               ` Mark Lord
2007-11-14 17:16       ` Sebastian Kemper
2007-11-14 17:49         ` Mark Lord

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