public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Who uses hdx=bswap or hdx=swapdata?
@ 2002-01-03 22:11 Manfred Spraul
  2002-01-03 22:17 ` Cort Dougan
  2002-01-03 22:32 ` Alan Cox
  0 siblings, 2 replies; 14+ messages in thread
From: Manfred Spraul @ 2002-01-03 22:11 UTC (permalink / raw)
  To: linux-kernel

Is the hdx=bswap or hdx=swapdata option actually in use?
When is it needed?
The current implementation can cause data corruptions on SMP with PIO 
transfers:
It modifies the source buffer during disk writes, and these temporary
modifications (within the irq handler) are visible with mmap on SMP.

Is it possible to remove the option entirely, or should it be fixed?

--
    Manfred


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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-03 22:11 Who uses hdx=bswap or hdx=swapdata? Manfred Spraul
@ 2002-01-03 22:17 ` Cort Dougan
  2002-01-03 22:32 ` Alan Cox
  1 sibling, 0 replies; 14+ messages in thread
From: Cort Dougan @ 2002-01-03 22:17 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel

It used to be necessary on the IBM 830 CDROM but I think those have fallen
into disrepair and have undergone many changes.  The 830's likely need that
still but probably can't boot for other reasons now, though.

} Is the hdx=bswap or hdx=swapdata option actually in use?
} When is it needed?
} The current implementation can cause data corruptions on SMP with PIO 
} transfers:
} It modifies the source buffer during disk writes, and these temporary
} modifications (within the irq handler) are visible with mmap on SMP.
} 
} Is it possible to remove the option entirely, or should it be fixed?
} 
} --
}     Manfred
} 
} -
} To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
} the body of a message to majordomo@vger.kernel.org
} More majordomo info at  http://vger.kernel.org/majordomo-info.html
} Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-03 22:11 Who uses hdx=bswap or hdx=swapdata? Manfred Spraul
  2002-01-03 22:17 ` Cort Dougan
@ 2002-01-03 22:32 ` Alan Cox
  2002-01-03 22:41   ` Russell King
  2002-01-04  9:09   ` Geert Uytterhoeven
  1 sibling, 2 replies; 14+ messages in thread
From: Alan Cox @ 2002-01-03 22:32 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel

> Is the hdx=bswap or hdx=swapdata option actually in use?
> When is it needed?

Certain M68K machines

> The current implementation can cause data corruptions on SMP with PIO 
> transfers:
> 
> Is it possible to remove the option entirely, or should it be fixed?

Show me an SMP Atari ST 8)


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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-03 22:32 ` Alan Cox
@ 2002-01-03 22:41   ` Russell King
  2002-01-04  9:09   ` Geert Uytterhoeven
  1 sibling, 0 replies; 14+ messages in thread
From: Russell King @ 2002-01-03 22:41 UTC (permalink / raw)
  To: Alan Cox; +Cc: Manfred Spraul, linux-kernel

On Thu, Jan 03, 2002 at 10:32:39PM +0000, Alan Cox wrote:
> > Is the hdx=bswap or hdx=swapdata option actually in use?
> > When is it needed?
> 
> Certain M68K machines

Is this parameter actually used on these machines, or do we rely on
the code in atapi_{input,output}_bytes:

#if defined(CONFIG_ATARI) || defined(CONFIG_Q40)
        if (MACH_IS_ATARI || MACH_IS_Q40) {
                /* Atari has a byte-swapped IDE interface */
                insw_swapw(IDE_DATA_REG, buffer, bytecount / 2);
                return;
        }
#endif /* CONFIG_ATARI */

and:

#if defined(CONFIG_ATARI) || defined(CONFIG_Q40)
        if (MACH_IS_ATARI || MACH_IS_Q40) {
                /* Atari has a byte-swapped IDE interface */
                outsw_swapw(IDE_DATA_REG, buffer, bytecount / 2);
                return;
        }
#endif /* CONFIG_ATARI */

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-03 22:32 ` Alan Cox
  2002-01-03 22:41   ` Russell King
@ 2002-01-04  9:09   ` Geert Uytterhoeven
  2002-01-04  9:31     ` Chris Lawrence
  2002-01-04 10:37     ` Alan Cox
  1 sibling, 2 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2002-01-04  9:09 UTC (permalink / raw)
  To: Alan Cox; +Cc: Manfred Spraul, Linux Kernel Development, Linux/m68k

On Thu, 3 Jan 2002, Alan Cox wrote:
> > Is the hdx=bswap or hdx=swapdata option actually in use?
> > When is it needed?
> 
> Certain M68K machines
> 
> > The current implementation can cause data corruptions on SMP with PIO 
> > transfers:
> > 
> > Is it possible to remove the option entirely, or should it be fixed?
> 
> Show me an SMP Atari ST 8)

IIRC it's used to access non-Atari IDE disks on Atari (which has a byte-swapped
IDE interface) and vice-versa.

So yes, you can use it on SMP machines, to access disks that were used before
on Atari.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04  9:09   ` Geert Uytterhoeven
@ 2002-01-04  9:31     ` Chris Lawrence
  2002-01-04 10:37     ` Alan Cox
  1 sibling, 0 replies; 14+ messages in thread
From: Chris Lawrence @ 2002-01-04  9:31 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alan Cox, Manfred Spraul, Linux Kernel Development, Linux/m68k

On Jan 04, Geert Uytterhoeven wrote:
> On Thu, 3 Jan 2002, Alan Cox wrote:
> > > Is the hdx=bswap or hdx=swapdata option actually in use?
> > > When is it needed?
> > 
> > Certain M68K machines
> > 
> > > The current implementation can cause data corruptions on SMP with PIO 
> > > transfers:
> > > 
> > > Is it possible to remove the option entirely, or should it be fixed?
> > 
> > Show me an SMP Atari ST 8)
> 
> IIRC it's used to access non-Atari IDE disks on Atari (which has a byte-swapped
> IDE interface) and vice-versa.
> 
> So yes, you can use it on SMP machines, to access disks that were used before
> on Atari.

The byteswapping flags are also used by people hacking TiVos; the
non-MIPS models have byte-swapped IDE interfaces, and so the bswap
flag is needed to mount a TiVo disk on a PC.


Chris
-- 
Chris Lawrence <cnlawren@olemiss.edu> - http://www.lordsutch.com/chris/

Instructor and Ph.D. Candidate, Political Science, Univ. of Mississippi
208 Deupree Hall - 662-915-5765

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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04  9:09   ` Geert Uytterhoeven
  2002-01-04  9:31     ` Chris Lawrence
@ 2002-01-04 10:37     ` Alan Cox
  2002-01-04 10:56       ` Geert Uytterhoeven
  2002-01-12 22:40       ` Manfred Spraul
  1 sibling, 2 replies; 14+ messages in thread
From: Alan Cox @ 2002-01-04 10:37 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alan Cox, Manfred Spraul, Linux Kernel Development, Linux/m68k

> IIRC it's used to access non-Atari IDE disks on Atari (which has a byte-swapped
> IDE interface) and vice-versa.
> 
> So yes, you can use it on SMP machines, to access disks that were used before
> on Atari.

For 2.5 would it perhaps be cleaner if we had a bswapping loop device. Sort
of very bad crypto mode ?

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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04 10:37     ` Alan Cox
@ 2002-01-04 10:56       ` Geert Uytterhoeven
  2002-01-04 17:15         ` Michael Schmitz
  2002-01-12 22:40       ` Manfred Spraul
  1 sibling, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2002-01-04 10:56 UTC (permalink / raw)
  To: Alan Cox; +Cc: Manfred Spraul, Linux Kernel Development, Linux/m68k

On Fri, 4 Jan 2002, Alan Cox wrote:
> > IIRC it's used to access non-Atari IDE disks on Atari (which has a byte-swapped
> > IDE interface) and vice-versa.
> > 
> > So yes, you can use it on SMP machines, to access disks that were used before
> > on Atari.
> 
> For 2.5 would it perhaps be cleaner if we had a bswapping loop device. Sort
> of very bad crypto mode ?

Don't mention crypto, or Atari will come after us with the DMCA sword, claiming
they deliberately implemented access control? ;-)

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04 10:56       ` Geert Uytterhoeven
@ 2002-01-04 17:15         ` Michael Schmitz
  2002-01-04 17:20           ` Geert Uytterhoeven
  2002-01-04 18:43           ` Bernd Eckenfels
  0 siblings, 2 replies; 14+ messages in thread
From: Michael Schmitz @ 2002-01-04 17:15 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alan Cox, Manfred Spraul, Linux Kernel Development, Linux/m68k

> > For 2.5 would it perhaps be cleaner if we had a bswapping loop device. Sort
> > of very bad crypto mode ?
>
> Don't mention crypto, or Atari will come after us with the DMCA sword, claiming
> they deliberately implemented access control? ;-)

Caution - I recall that on some m68k boxes we had to further byteswap
specific parts of the identify data or they wouldn't make sense. The IDE
driver will still have to be aware of these exceptions. I can't recall the
particulars anymore - Geert?

Since hdx=swapdata only works on disks replacing this with a byteswapping
loop device sounds fine (loopback being used for anything
kernel-internally now :-)

	Michael


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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04 17:15         ` Michael Schmitz
@ 2002-01-04 17:20           ` Geert Uytterhoeven
  2002-01-04 22:51             ` Richard Zidlicky
  2002-01-04 18:43           ` Bernd Eckenfels
  1 sibling, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2002-01-04 17:20 UTC (permalink / raw)
  To: Michael Schmitz
  Cc: Alan Cox, Manfred Spraul, Linux Kernel Development, Linux/m68k

On Fri, 4 Jan 2002, Michael Schmitz wrote:
> > > For 2.5 would it perhaps be cleaner if we had a bswapping loop device. Sort
> > > of very bad crypto mode ?
> >
> > Don't mention crypto, or Atari will come after us with the DMCA sword, claiming
> > they deliberately implemented access control? ;-)
> 
> Caution - I recall that on some m68k boxes we had to further byteswap
> specific parts of the identify data or they wouldn't make sense. The IDE
> driver will still have to be aware of these exceptions. I can't recall the
> particulars anymore - Geert?

That's the drive identification. It indeed shouldn't be swapped once again when
accessing a `non-native' IDE disk.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04 17:15         ` Michael Schmitz
  2002-01-04 17:20           ` Geert Uytterhoeven
@ 2002-01-04 18:43           ` Bernd Eckenfels
  1 sibling, 0 replies; 14+ messages in thread
From: Bernd Eckenfels @ 2002-01-04 18:43 UTC (permalink / raw)
  To: linux-kernel

In article <Pine.LNX.4.33.0201041751360.5790-100000@opal.biophys.uni-duesseldorf.de> you wrote:

> Since hdx=swapdata only works on disks replacing this with a byteswapping
> loop device sounds fine (loopback being used for anything
> kernel-internally now :-)

It does not make sense to swap all data in data blocks, because:
tid eo son tameks neest  owspaa lld ta anid ta albcosk

Greetings
Bernd

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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04 17:20           ` Geert Uytterhoeven
@ 2002-01-04 22:51             ` Richard Zidlicky
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Zidlicky @ 2002-01-04 22:51 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Schmitz, Alan Cox, Manfred Spraul,
	Linux Kernel Development, Linux/m68k

On Fri, Jan 04, 2002 at 06:20:11PM +0100, Geert Uytterhoeven wrote:
> On Fri, 4 Jan 2002, Michael Schmitz wrote:
> > > > For 2.5 would it perhaps be cleaner if we had a bswapping loop device. Sort
> > > > of very bad crypto mode ?
> > >
> > > Don't mention crypto, or Atari will come after us with the DMCA sword, claiming
> > > they deliberately implemented access control? ;-)
> > 
> > Caution - I recall that on some m68k boxes we had to further byteswap
> > specific parts of the identify data or they wouldn't make sense. The IDE
> > driver will still have to be aware of these exceptions. I can't recall the
> > particulars anymore - Geert?
> 
> That's the drive identification. It indeed shouldn't be swapped once again when
> accessing a `non-native' IDE disk.

sometimes it should, eg some of the ioctls that read data via special
commands from the drive that could also use byteswapping - ide-smart 
comes to my mind.

Btw the Q40 has also byteswapped IDE bus like the atari.

We already have atapi_{input|output}_bytes bytes that does the
swapping, and m68k has {ins|outs}[wl]_swapw. Perhaps one of this 
could be reused to do the bswap?

Bye
Richard

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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-04 10:37     ` Alan Cox
  2002-01-04 10:56       ` Geert Uytterhoeven
@ 2002-01-12 22:40       ` Manfred Spraul
  2002-01-13 11:19         ` Geert Uytterhoeven
  1 sibling, 1 reply; 14+ messages in thread
From: Manfred Spraul @ 2002-01-12 22:40 UTC (permalink / raw)
  To: Alan Cox; +Cc: Geert Uytterhoeven, Linux Kernel Development, Linux/m68k

Alan Cox wrote:
> 
> > IIRC it's used to access non-Atari IDE disks on Atari (which has a byte-swapped
> > IDE interface) and vice-versa.
> >
> > So yes, you can use it on SMP machines, to access disks that were used before
> > on Atari.
> 
> For 2.5 would it perhaps be cleaner if we had a bswapping loop device. Sort
> of very bad crypto mode ?

I tried to implement that, but hdx=bswap operates on drives, and loop on
partitions. Do you have another idea? It probably has to wait until the
partition code is further cleaned up.

--
	Manfred

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

* Re: Who uses hdx=bswap or hdx=swapdata?
  2002-01-12 22:40       ` Manfred Spraul
@ 2002-01-13 11:19         ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2002-01-13 11:19 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: Alan Cox, Linux Kernel Development, Linux/m68k

On Sat, 12 Jan 2002, Manfred Spraul wrote:
> Alan Cox wrote:
> > > IIRC it's used to access non-Atari IDE disks on Atari (which has a byte-swapped
> > > IDE interface) and vice-versa.
> > >
> > > So yes, you can use it on SMP machines, to access disks that were used before
> > > on Atari.
> > 
> > For 2.5 would it perhaps be cleaner if we had a bswapping loop device. Sort
> > of very bad crypto mode ?
> 
> I tried to implement that, but hdx=bswap operates on drives, and loop on
> partitions. Do you have another idea? It probably has to wait until the
> partition code is further cleaned up.

And if you use e.g. /dev/hda as loop parameter instead of /dev/hdaX?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds



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

end of thread, other threads:[~2002-01-13 11:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-03 22:11 Who uses hdx=bswap or hdx=swapdata? Manfred Spraul
2002-01-03 22:17 ` Cort Dougan
2002-01-03 22:32 ` Alan Cox
2002-01-03 22:41   ` Russell King
2002-01-04  9:09   ` Geert Uytterhoeven
2002-01-04  9:31     ` Chris Lawrence
2002-01-04 10:37     ` Alan Cox
2002-01-04 10:56       ` Geert Uytterhoeven
2002-01-04 17:15         ` Michael Schmitz
2002-01-04 17:20           ` Geert Uytterhoeven
2002-01-04 22:51             ` Richard Zidlicky
2002-01-04 18:43           ` Bernd Eckenfels
2002-01-12 22:40       ` Manfred Spraul
2002-01-13 11:19         ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox