* SUMMARY: [linux-lvm] pvcreate -- ERROR "Success"
From: Tru64 User @ 2002-12-12 10:43 UTC (permalink / raw)
To: linux-lvm
In-Reply-To: <20021211202224.79940.qmail@web40906.mail.yahoo.com>
I found out the problem, I believe.
pvcreate was not able to handle the physical volume
size (1.1 Tb --Promise Technology Raid5 BOX =7x200Gb
ATA drives), thus the weird ERROR --"Success" message.
I chunked up the RAID5 array into 2 partitions, 500Gb
and 600Gb each, and pvcreate worked like a charm.
When i delete the partitions and remake one large
partition (sdb1 alone) of [First cylinder (1-145891,
default 1):] 1.1Tb, it can't handle!
Should this be sent to the lvm-bugs group? Not sure
about rules in this mailing list, this was my first
post.
_Thanks
Richard Mollel
--- Tru64 User <tru64user@yahoo.com> wrote:
> Firsttimer, trying to take advantage of LVM on
> Linux.
> I have used it on AIX, so i have the concept.
>
> I have a RAID Array (1.1Tb) SCSI-ATA drive (sdb)
> that
> i was trying to create a volume out of (pvcreate).
>
> However, it gives me an ERROR "Success" message.
> I initially had it formatted with with reiserfs, but
> then wiped it clean, and erased partition table as
> described in howtos (dd /dev/zero....). Debug also
> posted below.
> Any leads to get this working?
> Exact error below. Thnks in advance.
>
> ******************
> chinook@/home/moll# pvcreate /dev/sdb
> Password:
> pvcreate -- ERROR "Success" getting size of physical
> volume "/dev/sdb"
>
>
> pvcreate [-d|--debug] [-f[f]|--force [--force]]
> [-h|--help] [-y|--yes]
> [-v|--verbose] [--version] PhysicalVolume
> [PhysicalVolume...]
>
> chinook@/home/moll$
>
> **********BEGIN_Debug*****************
>
> Script started on Wed Dec 11 15:17:09 2002
> cerebus@/home/mollel$ s pvcreate --debug /dev/sdb
> <1> lvm_get_iop_version -- CALLED
> <22> lvm_check_special -- CALLED
> <22> lvm_check_special -- LEAVING
> <1> lvm_get_iop_version -- AFTER ioctl ret: 0
> <1> lvm_get_iop_version -- LEAVING with ret: 10
> <1> lvm_lock -- CALLED
> <22> lvm_check_special -- CALLED
> <22> lvm_check_special -- LEAVING
> <1> lvm_lock -- LEAVING with ret: 0
> <1> pv_check_name -- CALLED with "/dev/sdb"
> <22> lvm_check_chars -- CALLED with name: "/dev/sdb"
> <22> lvm_check_chars -- LEAVING with ret: 0
> <22> lvm_check_dev -- CALLED
> <333> lvm_check_partitioned_dev -- CALLED
> <4444> lvm_get_device_type called
> <4444> lvm_get_device_type leaving with 1
> <333> lvm_check_partitioned_dev -- LEAVING with ret:
> TRUE
> <22> lvm_check_dev -- LEAVING with ret: 1
> <1> pv_check_name -- LEAVING with ret: 0
> <1> pv_get_size -- CALLED with /dev/sdb and
> 0xbfffdfa0
> <22> lvm_dir_cache -- CALLED
> <333> lvm_add_dir_cache -- CALLED with /dev/sda
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 1
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/sda1
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 1
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/sdb
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 1
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda1
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda2
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda5
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda6
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda7
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda8
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda9
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: ADDED
> <333> lvm_add_dir_cache -- CALLED with /dev/hda9
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 0
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> lvm_add_dir_cache -- LEAVING with ret: NOT
> ADDED
> <22> lvm_dir_cache -- LEAVING with ret: 11
> <22> lvm_dir_cache_find -- CALLED with /dev/sdb
> <333> pv_check_name -- CALLED with "/dev/sdb"
> <4444> lvm_check_chars -- CALLED with name:
> "/dev/sdb"
> <4444> lvm_check_chars -- LEAVING with ret: 0
> <4444> lvm_check_dev -- CALLED
> <55555> lvm_check_partitioned_dev -- CALLED
> <666666> lvm_get_device_type called
> <666666> lvm_get_device_type leaving with 1
> <55555> lvm_check_partitioned_dev -- LEAVING with
> ret:
> TRUE
> <4444> lvm_check_dev -- LEAVING with ret: 1
> <333> pv_check_name -- LEAVING with ret: 0
> <333> lvm_dir_cache -- CALLED
> <333> lvm_dir_cache -- LEAVING with ret: 11
> <22> lvm_dir_cache_find -- LEAVING with entry: 2
> <22> lvm_check_partitioned_dev -- CALLED
> <333> lvm_get_device_type called
> <333> lvm_get_device_type leaving with 1
> <22> lvm_check_partitioned_dev -- LEAVING with ret:
> TRUE
>
=== message truncated ===
=====
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
^ permalink raw reply
* [LARTC] devik's apologize
From: devik @ 2002-12-12 10:43 UTC (permalink / raw)
To: lartc
Hi All,
I'd like to apologize that I forwarded copy of my yesterday
mail to the list. Probably I haven't understood author right
- I still don't know ...
In any case there was too many emotions on my side and it is
not good (I should work less and sleep more). No flames please.
devik
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply
* Re: QoS using HTB and SFQ ...
From: Jordi Bruguera @ 2002-12-12 10:46 UTC (permalink / raw)
To: Raymond Leach; +Cc: Netfilter Mailing List
In-Reply-To: <1039684623.4085.47.camel@rayw.knowledgefactory.co.za>
On 12 Dec 2002, Raymond Leach wrote:
Hi.
To use HTB you have to apply the patches from <devik>
downloadable from:
http://luxik.cdi.cz/~devik/qos/htb/
I've made several tests with them with successful results.
regards,
> Hi
>
> Does anyone have any experience (good or bad) with using htb and sfq to
> do QoS using 2.4.20 kernels?
>
> I compiled the kernel, installed the image, but tc tells me that htb is
> an unknown qdisc. I checked that I did select htb in the QoS section.
>
> Any ideas?
>
> Ray
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ( Raymond Leach )
> ) Knowledge Factory (
> ( )
> ) Tel: +27 11 445 8100 (
> ( Fax: +27 11 445 8101 )
> ) (
> ( http://www.knowledgefactory.co.za/ )
> ) http://www.saptg.co.za/ (
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> o o
> o o
> .--. .--.
> | o_o| |o_o |
> | \_:| |:_/ |
> / / \\ // \ \
> ( | |) (| | )
> /`\_ _/'\ /'\_ _/`\
> \___)=(___/ \___)=(___/
>
+------------------------------------------------+
! Jordi Bruguera i Cortada jordi@grn.es !
! Cap Tècnic !
! GRN Serveis Telemàtics, SL Tel. +34 972 230000 !
+------------------------------------------------+
^ permalink raw reply
* linux source tree customized under sde cross tools..
From: atul srivastava @ 2002-12-12 10:46 UTC (permalink / raw)
To: linux-mips
Hello,
does anybody using linux source tree customized for
sde-gcc(algorithnmics) cross compilation environment..
earlier i was using mips-linux-* toolset but due to
some definite reasons now my cross tools are sde-*
I am consistently facing some certain compiling problems
with sde-gcc flags and asembler options..
Best Regards,
Ashish
>
^ permalink raw reply
* Re: [LARTC] HTB and theory
From: Stef Coene @ 2002-12-12 10:49 UTC (permalink / raw)
To: lartc
In-Reply-To: <marc-lartc-103945416224487@msgid-missing>
On Thursday 12 December 2002 09:36, Abraham van der Merwe wrote:
> Hi Stef!
> I think your explanation of "rate of class" in your FAQ is wrong. it
> caught me as well, but from devik's faq page
> (http://luxik.cdi.cz/~devik/qos/htb/htbfaq.htm):
>
> ------------< snip <------< snip <------< snip <------------
> What if sum of child rates is greater than parent rate ?
>
> Then interesting things can happen. Total rate delivered by children can be
> higher that parent's rate (thus its rate is not respected). However when
> sum of actual child rates are under parent's rate then borrowing will occur
> like in regular case.
>
> ------------< snip <------< snip <------< snip <------------
>
> Thus, if sum (rate of childs) > parent rate, then the parent rate is _not
> respected_.
:)
Devik is right, I'm wrong. Do you know why I was convinced that my rule was
OK? Because I always followed my own rules :)
I did some small tests :
ceil rate
1 200 200
\- 10 200 100
\- 100 200 100
\- 101 200 100
\- 20 200 100
Traffic in 100, 101 and 20 : each gets 67 (33%)
Parent rate (10) is not respected otherwise 10 should share 50% with
20.
Traffic in 100 and 20 : each gets 100 (50%)
If you respect "sum (rate of childs) = parent rate" it works like expected :
ceil rate
1 200 200
\- 10 200 100
\- 100 200 50
\- 101 200 50
\- 20 200 100
Traffic in 100, 101 and 20 : 20 gets 100 (50%), 101 50 (25%) and 101 50 (25%).
Traffic in 100 and 20 : each gets 100 (50%)
Conclusion : if you want to know how traffic will be shaped, you have to
follow some basic rules.
I will update docum.org tonight.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply
* Re: QoS using HTB and SFQ ...
From: Andrea Rossato @ 2002-12-12 10:58 UTC (permalink / raw)
To: netfilter
In-Reply-To: <1039684623.4085.47.camel@rayw.knowledgefactory.co.za>
you need a patch for iproute2/tc or a patched tc binary, both
distributed with htb3.
here you'll find patch or binary:
http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz
my experience with htb is very positive: i'm shaping a poor adsl
connection (128/256). with heavy loads (220kbit download with a 120kbit
upload) latency dropped from 3000ms to 300ms!
andrea
Raymond Leach wrote:
> Hi
>
> Does anyone have any experience (good or bad) with using htb and sfq to
> do QoS using 2.4.20 kernels?
>
> I compiled the kernel, installed the image, but tc tells me that htb is
> an unknown qdisc. I checked that I did select htb in the QoS section.
>
> Any ideas?
>
> Ray
^ permalink raw reply
* using 2 TB in real life
From: Anders Henke @ 2002-12-12 11:12 UTC (permalink / raw)
To: linux-kernel
I've just added a 1.9 TB array to one of my servers (running 2.4.20,
the device is an 12bay-IFT IDE-to-Fibre-RAID connected via a
Qlogic 2300 HBA):
Disk /dev/sdb: 255 heads, 63 sectors, 247422 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 247422 1987417183+ 83 Linux
[...]
Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
SCSI device sdb: -320126976 512-byte hdwr sectors (-163904 MB)
sdb: sdb1
Another array (1.2 TB) gives almost the same effect:
Disk /dev/sdb: 255 heads, 63 sectors, 157450 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 157450 1264717093+ 83 Linux
[...]
Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
SCSI device sdb: -1765523456 512-byte hdwr sectors (195564 MB)
sdb: sdb1
These issues arise when using arrays larger than around 0.5 T;
nevertheless, these devices do work fine with both xfs or ext3,
it's "just" a cosmetical issue. However, this negative
values make one feel like Linux isn't truely capable of using up to
2 TB of disk devices and so this should be resolved.
To me it seems that sd.c doesn't know how to calculate the
correct values for such beasts - any ideas?
Regards
Anders
--
http://sysiphus.de/
^ permalink raw reply
* Re: Is this going to be true ?
From: Henning P. Schmiedehausen @ 2002-12-12 11:12 UTC (permalink / raw)
To: linux-kernel
In-Reply-To: <yw1xvg1zfspi.fsf@tophat.e.kth.se>
mru@users.sourceforge.net (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=) writes:
>> comparing unices and Windoze, is the question "What is an operating
>> system"? Is the kernel the OS? Are the libraries part of it as well?
>IMHO, the operating system is whatever is reached through system
>calls, i.e traps. MS seems to define it as whatever they bundle on
>the CD.
99,95+% of the computer users base out there tend to differ. This
makes your point rather moot :-) (To me, the "OS" consists at least of
the kernel, c standard library/ies with their support files and enough
infrastructure to start programs without having to hard code them on a
kernel boot line or in code. Which is at least /sbin/init and might
even contain a simple user command shell).
This definition could fit on a floppy, though. Might even fit on an
720k diskette. :-) Kernel + /sbin/init + busybox is IMHO an OS.
If you define "OS" at the syscall layer you end up with what we
started. Two threads printing 1 0 1 0 1 0 on your screen.
Regards
henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH hps@intermeta.de
Am Schwabachgrund 22 Fon.: 09131 / 50654-0 info@intermeta.de
D-91054 Buckenhof Fax.: 09131 / 50654-20
^ permalink raw reply
* RE : QoS using HTB and SFQ ...
From: Franck @ 2002-12-12 11:06 UTC (permalink / raw)
To: 'Netfilter Mailing List'
In-Reply-To: <1039684623.4085.47.camel@rayw.knowledgefactory.co.za>
> -----Original Message-----
> From: netfilter-admin@lists.netfilter.org
> [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of
> Raymond Leach
> Sent: Thursday, December 12, 2002 10:17 AM
> To: Netfilter Mailing List
> Subject: QoS using HTB and SFQ ...
>
>
> Hi
>
> Does anyone have any experience (good or bad) with using htb
> and sfq to
> do QoS using 2.4.20 kernels?
>
> I compiled the kernel, installed the image, but tc tells me
> that htb is
> an unknown qdisc.
You'll also need a patched tc in order to use HTB. You can find the
patch for tc at http://luxik.cdi.cz/~devik/qos/htb/
^ permalink raw reply
* Iptables - disable statefull inspection?
From: Jan Kaastrup @ 2002-12-12 11:12 UTC (permalink / raw)
To: netfilter-devel
[-- Attachment #1: Type: text/plain, Size: 578 bytes --]
Hi
I am working with IT-security, and we are testing Peoples security.
The problem is, we have an automatic scanner, which sends a lot of
SYN_SENT packets.
I want to disable the connections in ip_conntrack, because it completely
kills the CPU because ip_conntrack reach Maximum connection.
I could use another firewall, but I do really like Iptables.
I am very sure there must be a way to disable connection tracking and
still use Iptables for other services?
Med venlig hilsen / Best Regards
Jan Kaastrup
System Administrator
jka@protego.dk
Mobil: 29 91 25 15
PROTEGO
[-- Attachment #2: Type: text/html, Size: 6044 bytes --]
^ permalink raw reply
* [PATCH 2.5.51] NFSv4 cleanups [1/many]
From: Trond Myklebust @ 2002-12-12 11:13 UTC (permalink / raw)
To: Linus Torvalds; +Cc: NFS maillist
- Move the encoding/decoding of the actual COMPOUND XDR header out of
encode_compound()/decode_compound().
- Make each NFSv4 operation 'decode_' routine also take care of
decoding its own header, and checking it for correctness.
Also allows us to get rid of the 'nfserr' parameter...
Cheers,
Trond
diff -u --recursive --new-file linux-2.5.49-00-nfsv4_xdr1/fs/nfs/nfs4proc.c linux-2.5.49-01-nfsv4_xdr2/fs/nfs/nfs4proc.c
--- linux-2.5.49-00-nfsv4_xdr1/fs/nfs/nfs4proc.c 2002-11-18 11:53:14.000000000 -0500
+++ linux-2.5.49-01-nfsv4_xdr2/fs/nfs/nfs4proc.c 2002-11-22 22:16:55.000000000 -0500
@@ -648,7 +648,7 @@
{
int status;
struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+ .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
.rpc_argp = cp,
.rpc_resp = cp,
.rpc_cred = cred,
@@ -1112,7 +1112,7 @@
nfs4_setup_remove(cp, name, &up->cinfo);
nfs4_setup_getattr(cp, &up->attrs, bmres);
- msg->rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND];
+ msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND];
msg->rpc_argp = cp;
msg->rpc_resp = cp;
return 0;
@@ -1373,7 +1373,7 @@
struct rpc_task *task = &data->task;
struct nfs4_compound *cp = &data->u.v4.compound;
struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+ .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
.rpc_argp = cp,
.rpc_resp = cp,
.rpc_cred = data->cred,
@@ -1417,7 +1417,7 @@
struct rpc_task *task = &data->task;
struct nfs4_compound *cp = &data->u.v4.compound;
struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+ .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
.rpc_argp = cp,
.rpc_resp = cp,
.rpc_cred = data->cred,
@@ -1468,7 +1468,7 @@
struct rpc_task *task = &data->task;
struct nfs4_compound *cp = &data->u.v4.compound;
struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+ .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
.rpc_argp = cp,
.rpc_resp = cp,
.rpc_cred = data->cred,
@@ -1523,7 +1523,7 @@
struct rpc_task *task;
struct nfs4_compound *cp;
struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+ .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
};
rp = (struct renew_desc *) kmalloc(sizeof(*rp), GFP_KERNEL);
diff -u --recursive --new-file linux-2.5.49-00-nfsv4_xdr1/fs/nfs/nfs4xdr.c linux-2.5.49-01-nfsv4_xdr2/fs/nfs/nfs4xdr.c
--- linux-2.5.49-00-nfsv4_xdr1/fs/nfs/nfs4xdr.c 2002-11-22 22:16:34.000000000 -0500
+++ linux-2.5.49-01-nfsv4_xdr2/fs/nfs/nfs4xdr.c 2002-11-22 22:16:55.000000000 -0500
@@ -83,6 +83,13 @@
{ 0, NFNON },
};
+struct compound_hdr {
+ int32_t status;
+ uint32_t nops;
+ uint32_t taglen;
+ char * tag;
+};
+
/*
* START OF "GENERIC" ENCODE ROUTINES.
* These may look a little ugly since they are imported from a "generic"
@@ -118,6 +125,20 @@
return p + tmp;
}
+static int
+encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
+{
+ uint32_t *p;
+
+ dprintk("encode_compound: tag=%.*s\n", (int)hdr->taglen, hdr->tag);
+ RESERVE_SPACE(12+XDR_QUADLEN(hdr->taglen));
+ WRITE32(hdr->taglen);
+ WRITEMEM(hdr->tag, hdr->taglen);
+ WRITE32(NFS4_MINOR_VERSION);
+ WRITE32(hdr->nops);
+ return 0;
+}
+
/*
* FIXME: The following dummy entries will be replaced once the userland
* upcall gets in...
@@ -696,16 +717,14 @@
static int
encode_compound(struct xdr_stream *xdr, struct nfs4_compound *cp, struct rpc_rqst *req)
{
+ struct compound_hdr hdr = {
+ .taglen = cp->taglen,
+ .tag = cp->tag,
+ .nops = cp->req_nops,
+ };
int i, status = 0;
- uint32_t *p;
- dprintk("encode_compound: tag=%.*s\n", (int)cp->taglen, cp->tag);
-
- RESERVE_SPACE(12 + cp->taglen);
- WRITE32(cp->taglen);
- WRITEMEM(cp->tag, cp->taglen);
- WRITE32(NFS4_MINOR_VERSION);
- WRITE32(cp->req_nops);
+ encode_compound_hdr(xdr, &hdr);
for (i = 0; i < cp->req_nops; i++) {
switch (cp->ops[i].opnum) {
@@ -849,8 +868,8 @@
p = xdr_inline_decode(xdr, nbytes); \
if (!p) { \
printk(KERN_WARNING "%s: reply buffer overflowed in line %d.", \
- __FUNCTION__, __LINE__); \
- return -EIO; \
+ __FUNCTION__, __LINE__); \
+ return -EIO; \
} \
} while (0)
@@ -877,6 +896,44 @@
}
static int
+decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
+{
+ uint32_t *p;
+
+ READ_BUF(8);
+ READ32(hdr->status);
+ READ32(hdr->taglen);
+
+ READ_BUF(hdr->taglen + 4);
+ hdr->tag = (char *)p;
+ p += XDR_QUADLEN(hdr->taglen);
+ READ32(hdr->nops);
+ return 0;
+}
+
+static int
+decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
+{
+ uint32_t *p;
+ uint32_t opnum;
+ int32_t nfserr;
+
+ READ_BUF(8);
+ READ32(opnum);
+ if (opnum != expected) {
+ printk(KERN_NOTICE
+ "nfs4_decode_op_hdr: Server returned operation"
+ " %d but we issued a request for %d\n",
+ opnum, expected);
+ return -EIO;
+ }
+ READ32(nfserr);
+ if (nfserr != NFS_OK)
+ return -nfs_stat_to_errno(nfserr);
+ return 0;
+}
+
+static int
decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
{
uint32_t *p;
@@ -889,68 +946,71 @@
}
static int
-decode_access(struct xdr_stream *xdr, int nfserr, struct nfs4_access *access)
+decode_access(struct xdr_stream *xdr, struct nfs4_access *access)
{
uint32_t *p;
uint32_t supp, acc;
+ int status;
- if (!nfserr) {
- READ_BUF(8);
- READ32(supp);
- READ32(acc);
-
- if ((supp & ~access->ac_req_access) || (acc & ~supp)) {
- printk(KERN_NOTICE "NFS: server returned bad bits in access call!\n");
- return -EIO;
- }
- *access->ac_resp_supported = supp;
- *access->ac_resp_access = acc;
+ status = decode_op_hdr(xdr, OP_ACCESS);
+ if (status)
+ return status;
+ READ_BUF(8);
+ READ32(supp);
+ READ32(acc);
+ if ((supp & ~access->ac_req_access) || (acc & ~supp)) {
+ printk(KERN_NOTICE "NFS: server returned bad bits in access call!\n");
+ return -EIO;
}
+ *access->ac_resp_supported = supp;
+ *access->ac_resp_access = acc;
return 0;
}
static int
-decode_close(struct xdr_stream *xdr, int nfserr, struct nfs4_close *close)
+decode_close(struct xdr_stream *xdr, struct nfs4_close *close)
{
uint32_t *p;
+ int status;
- if (!nfserr) {
- READ_BUF(sizeof(nfs4_stateid));
- COPYMEM(close->cl_stateid, sizeof(nfs4_stateid));
- }
+ status = decode_op_hdr(xdr, OP_CLOSE);
+ if (status)
+ return status;
+ READ_BUF(sizeof(nfs4_stateid));
+ COPYMEM(close->cl_stateid, sizeof(nfs4_stateid));
return 0;
}
static int
-decode_commit(struct xdr_stream *xdr, int nfserr, struct nfs4_commit *commit)
+decode_commit(struct xdr_stream *xdr, struct nfs4_commit *commit)
{
uint32_t *p;
+ int status;
- if (!nfserr) {
- READ_BUF(8);
- COPYMEM(commit->co_verifier->verifier, 8);
- }
+ status = decode_op_hdr(xdr, OP_COMMIT);
+ if (status)
+ return status;
+ READ_BUF(8);
+ COPYMEM(commit->co_verifier->verifier, 8);
return 0;
}
static int
-decode_create(struct xdr_stream *xdr, int nfserr, struct nfs4_create *create)
+decode_create(struct xdr_stream *xdr, struct nfs4_create *create)
{
uint32_t *p;
uint32_t bmlen;
int status;
- if (!nfserr) {
- if ((status = decode_change_info(xdr, create->cr_cinfo)))
- goto out;
- READ_BUF(4);
- READ32(bmlen);
- if (bmlen > 2)
- goto xdr_error;
- READ_BUF(bmlen << 2);
- }
-
- DECODE_TAIL;
+ status = decode_op_hdr(xdr, OP_CREATE);
+ if (status)
+ return status;
+ if ((status = decode_change_info(xdr, create->cr_cinfo)))
+ return status;
+ READ_BUF(4);
+ READ32(bmlen);
+ READ_BUF(bmlen << 2);
+ return 0;
}
extern uint32_t nfs4_fattr_bitmap[2];
@@ -959,25 +1019,24 @@
extern uint32_t nfs4_pathconf_bitmap[2];
static int
-decode_getattr(struct xdr_stream *xdr, int nfserr, struct nfs4_getattr *getattr)
+decode_getattr(struct xdr_stream *xdr, struct nfs4_getattr *getattr)
{
- struct nfs_fattr *nfp = getattr->gt_attrs;
+ struct nfs_fattr *nfp = getattr->gt_attrs;
struct nfs_fsstat *fsstat = getattr->gt_fsstat;
struct nfs_fsinfo *fsinfo = getattr->gt_fsinfo;
struct nfs_pathconf *pathconf = getattr->gt_pathconf;
+ uint32_t attrlen, dummy32, bmlen,
+ bmval0 = 0,
+ bmval1 = 0,
+ len = 0;
uint32_t *p;
- uint32_t bmlen;
- uint32_t bmval0 = 0;
- uint32_t bmval1 = 0;
- uint32_t attrlen;
- uint32_t dummy32;
- uint32_t len = 0;
unsigned int type;
int fmode = 0;
int status;
- if (nfserr)
- goto success;
+ status = decode_op_hdr(xdr, OP_GETATTR);
+ if (status)
+ return status;
READ_BUF(4);
READ32(bmlen);
@@ -1208,265 +1267,361 @@
if (len != attrlen)
goto xdr_error;
-success:
DECODE_TAIL;
}
static int
-decode_getfh(struct xdr_stream *xdr, int nfserr, struct nfs4_getfh *getfh)
+decode_getfh(struct xdr_stream *xdr, struct nfs4_getfh *getfh)
{
struct nfs_fh *fh = getfh->gf_fhandle;
uint32_t *p;
uint32_t len;
int status;
+ status = decode_op_hdr(xdr, OP_GETFH);
+ if (status)
+ return status;
/* Zero handle first to allow comparisons */
memset(fh, 0, sizeof(*fh));
-
- if (!nfserr) {
- READ_BUF(4);
- READ32(len);
- if (len > NFS_MAXFHSIZE)
- goto xdr_error;
- fh->size = len;
- READ_BUF(len);
- COPYMEM(fh->data, len);
- }
- DECODE_TAIL;
+ READ_BUF(4);
+ READ32(len);
+ if (len > NFS_MAXFHSIZE)
+ return -EIO;
+ fh->size = len;
+ READ_BUF(len);
+ COPYMEM(fh->data, len);
+ return 0;
}
static int
-decode_link(struct xdr_stream *xdr, int nfserr, struct nfs4_link *link)
+decode_link(struct xdr_stream *xdr, struct nfs4_link *link)
{
- int status = 0;
+ int status;
- if (!nfserr)
- status = decode_change_info(xdr, link->ln_cinfo);
- return status;
+ status = decode_op_hdr(xdr, OP_LINK);
+ if (status)
+ return status;
+ return decode_change_info(xdr, link->ln_cinfo);
}
static int
-decode_open(struct xdr_stream *xdr, int nfserr, struct nfs4_open *open)
+decode_lookup(struct xdr_stream *xdr)
+{
+ return decode_op_hdr(xdr, OP_LOOKUP);
+}
+
+static int
+decode_open(struct xdr_stream *xdr, struct nfs4_open *open)
{
uint32_t *p;
uint32_t bmlen, delegation_type;
int status;
- if (!nfserr) {
- READ_BUF(sizeof(nfs4_stateid));
- COPYMEM(open->op_stateid, sizeof(nfs4_stateid));
+ status = decode_op_hdr(xdr, OP_OPEN);
+ if (status)
+ return status;
+ READ_BUF(sizeof(nfs4_stateid));
+ COPYMEM(open->op_stateid, sizeof(nfs4_stateid));
- decode_change_info(xdr, open->op_cinfo);
+ decode_change_info(xdr, open->op_cinfo);
- READ_BUF(8);
- READ32(*open->op_rflags);
- READ32(bmlen);
- if (bmlen > 10)
- goto xdr_error;
+ READ_BUF(8);
+ READ32(*open->op_rflags);
+ READ32(bmlen);
+ if (bmlen > 10)
+ goto xdr_error;
- READ_BUF((bmlen << 2) + 4);
- p += bmlen;
- READ32(delegation_type);
- if (delegation_type != NFS4_OPEN_DELEGATE_NONE)
- goto xdr_error;
- }
+ READ_BUF((bmlen << 2) + 4);
+ p += bmlen;
+ READ32(delegation_type);
+ if (delegation_type != NFS4_OPEN_DELEGATE_NONE)
+ goto xdr_error;
DECODE_TAIL;
}
static int
-decode_open_confirm(struct xdr_stream *xdr, int nfserr, struct nfs4_open_confirm *open_confirm)
+decode_open_confirm(struct xdr_stream *xdr, struct nfs4_open_confirm *open_confirm)
{
uint32_t *p;
+ int status;
- if (!nfserr) {
- READ_BUF(sizeof(nfs4_stateid));
- COPYMEM(open_confirm->oc_stateid, sizeof(nfs4_stateid));
- }
+ status = decode_op_hdr(xdr, OP_OPEN_CONFIRM);
+ if (status)
+ return status;
+ READ_BUF(sizeof(nfs4_stateid));
+ COPYMEM(open_confirm->oc_stateid, sizeof(nfs4_stateid));
return 0;
}
static int
-decode_read(struct xdr_stream *xdr, int nfserr, struct nfs4_read *read)
+decode_putfh(struct xdr_stream *xdr)
{
- uint32_t throwaway;
+ return decode_op_hdr(xdr, OP_PUTFH);
+}
+
+static int
+decode_putrootfh(struct xdr_stream *xdr)
+{
+ return decode_op_hdr(xdr, OP_PUTROOTFH);
+}
+
+static int
+decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_read *read)
+{
+ struct iovec *iov = req->rq_rvec;
uint32_t *p;
+ uint32_t count, eof, recvd, hdrlen;
int status;
- if (!nfserr) {
- READ_BUF(8);
- if (read->rd_eof)
- READ32(*read->rd_eof);
- else
- READ32(throwaway);
- READ32(*read->rd_bytes_read);
- if (*read->rd_bytes_read > read->rd_length)
- goto xdr_error;
- }
-
- DECODE_TAIL;
+ status = decode_op_hdr(xdr, OP_READ);
+ if (status)
+ return status;
+ READ_BUF(8);
+ READ32(eof);
+ READ32(count);
+ hdrlen = (u8 *) p - (u8 *) iov->iov_base;
+ if (iov->iov_len < hdrlen) {
+ printk(KERN_WARNING "NFS: READ reply header overflowed:"
+ "length %u > %Zu\n", hdrlen, iov->iov_len);
+ return -errno_NFSERR_IO;
+ } else if (iov->iov_len != hdrlen) {
+ dprintk("NFS: READ header is short. iovec will be shifted.\n");
+ xdr_shift_buf(&req->rq_rcv_buf, iov->iov_len - hdrlen);
+ }
+ recvd = req->rq_received - hdrlen;
+ if (count > recvd) {
+ printk(KERN_WARNING "NFS: server cheating in read reply: "
+ "count %u > recvd %u\n", count, recvd);
+ count = recvd;
+ eof = 0;
+ }
+ if (read->rd_eof)
+ *read->rd_eof = eof;
+ *read->rd_bytes_read = count;
+ return 0;
}
static int
-decode_readdir(struct xdr_stream *xdr, int nfserr, struct rpc_rqst *req, struct nfs4_readdir *readdir)
+decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_readdir *readdir)
{
struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
struct page *page = *rcvbuf->pages;
- unsigned int pglen = rcvbuf->page_len;
- uint32_t *end, *entry, *p;
- uint32_t len, attrlen, word;
- int i;
+ struct iovec *iov = rcvbuf->head;
+ unsigned int nr, pglen = rcvbuf->page_len;
+ uint32_t *end, *entry, *p;
+ uint32_t len, attrlen, word;
+ int i, hdrlen, recvd, status;
- if (!nfserr) {
- READ_BUF(8);
- COPYMEM(readdir->rd_resp_verifier, 8);
+ status = decode_op_hdr(xdr, OP_READDIR);
+ if (status)
+ return status;
+ READ_BUF(8);
+ COPYMEM(readdir->rd_resp_verifier, 8);
- BUG_ON(pglen > PAGE_CACHE_SIZE);
- p = (uint32_t *) kmap(page);
- end = (uint32_t *) ((char *)p + pglen + readdir->rd_pgbase);
-
- while (*p++) {
- entry = p - 1;
- if (p + 3 > end)
- goto short_pkt;
- p += 2; /* cookie */
- len = ntohl(*p++); /* filename length */
- if (len > NFS4_MAXNAMLEN) {
- printk(KERN_WARNING "NFS: giant filename in readdir (len 0x%x)\n", len);
- goto err_unmap;
- }
+ hdrlen = (char *) p - (char *) iov->iov_base;
+ if (iov->iov_len < hdrlen) {
+ printk(KERN_WARNING "NFS: READDIR reply header overflowed:"
+ "length %d > %Zu\n", hdrlen, iov->iov_len);
+ return -EIO;
+ } else if (iov->iov_len != hdrlen) {
+ dprintk("NFS: READDIR header is short. iovec will be shifted.\n");
+ xdr_shift_buf(rcvbuf, iov->iov_len - hdrlen);
+ }
+ recvd = req->rq_received - hdrlen;
+ if (pglen > recvd)
+ pglen = recvd;
+
+ BUG_ON(pglen + readdir->rd_pgbase > PAGE_CACHE_SIZE);
+ p = (uint32_t *) kmap(page);
+ end = (uint32_t *) ((char *)p + pglen + readdir->rd_pgbase);
+ entry = p;
+ for (nr = 0; *p++; nr++) {
+ if (p + 3 > end)
+ goto short_pkt;
+ p += 2; /* cookie */
+ len = ntohl(*p++); /* filename length */
+ if (len > NFS4_MAXNAMLEN) {
+ printk(KERN_WARNING "NFS: giant filename in readdir (len 0x%x)\n", len);
+ goto err_unmap;
+ }
- p += XDR_QUADLEN(len);
- if (p + 1 > end)
- goto short_pkt;
- len = ntohl(*p++); /* bitmap length */
- if (len > 10) {
- printk(KERN_WARNING "NFS: giant bitmap in readdir (len 0x%x)\n", len);
- goto err_unmap;
- }
- if (p + len + 1 > end)
- goto short_pkt;
- attrlen = 0;
- for (i = 0; i < len; i++) {
- word = ntohl(*p++);
- if (!word)
- continue;
- else if (i == 0 && word == FATTR4_WORD0_FILEID) {
- attrlen = 8;
- continue;
- }
- printk(KERN_WARNING "NFS: unexpected bitmap word in readdir (0x%x)\n", word);
- goto err_unmap;
- }
- if (ntohl(*p++) != attrlen) {
- printk(KERN_WARNING "NFS: unexpected attrlen in readdir\n");
- goto err_unmap;
+ p += XDR_QUADLEN(len);
+ if (p + 1 > end)
+ goto short_pkt;
+ len = ntohl(*p++); /* bitmap length */
+ if (len > 10) {
+ printk(KERN_WARNING "NFS: giant bitmap in readdir (len 0x%x)\n", len);
+ goto err_unmap;
+ }
+ if (p + len + 1 > end)
+ goto short_pkt;
+ attrlen = 0;
+ for (i = 0; i < len; i++) {
+ word = ntohl(*p++);
+ if (!word)
+ continue;
+ else if (i == 0 && word == FATTR4_WORD0_FILEID) {
+ attrlen = 8;
+ continue;
}
- p += XDR_QUADLEN(attrlen);
- if (p + 1 > end)
- goto short_pkt;
+ printk(KERN_WARNING "NFS: unexpected bitmap word in readdir (0x%x)\n", word);
+ goto err_unmap;
}
- kunmap(page);
- }
-
+ if (ntohl(*p++) != attrlen) {
+ printk(KERN_WARNING "NFS: unexpected attrlen in readdir\n");
+ goto err_unmap;
+ }
+ p += XDR_QUADLEN(attrlen);
+ if (p + 1 > end)
+ goto short_pkt;
+ }
+ if (!nr && (entry[0] != 0 || entry[1] == 0))
+ goto short_pkt;
+out:
+ kunmap(page);
return 0;
short_pkt:
- printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
- /* truncate listing */
- kunmap(page);
entry[0] = entry[1] = 0;
- return 0;
+ /* truncate listing ? */
+ if (!nr) {
+ printk(KERN_NOTICE "NFS: readdir reply truncated!\n");
+ entry[1] = 1;
+ }
+ goto out;
err_unmap:
kunmap(page);
return -errno_NFSERR_IO;
}
static int
-decode_readlink(struct xdr_stream *xdr, int nfserr, struct rpc_rqst *req, struct nfs4_readlink *readlink)
+decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_readlink *readlink)
{
struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
+ struct iovec *iov = rcvbuf->head;
uint32_t *strlen;
- uint32_t len;
+ unsigned int hdrlen, len;
char *string;
+ int status;
- if (!nfserr) {
- /*
- * The XDR encode routine has set things up so that
- * the link text will be copied directly into the
- * buffer. We just have to do overflow-checking,
- * and and null-terminate the text (the VFS expects
- * null-termination).
- */
- strlen = (uint32_t *) kmap(rcvbuf->pages[0]);
- len = ntohl(*strlen);
- if (len > PAGE_CACHE_SIZE - 5) {
- printk(KERN_WARNING "nfs: server returned giant symlink!\n");
- kunmap(rcvbuf->pages[0]);
- return -EIO;
- }
- *strlen = len;
-
- string = (char *)(strlen + 1);
- string[len] = '\0';
+ status = decode_op_hdr(xdr, OP_READLINK);
+ if (status)
+ return status;
+
+ hdrlen = (char *) xdr->p - (char *) iov->iov_base;
+ if (iov->iov_len > hdrlen) {
+ dprintk("NFS: READLINK header is short. iovec will be shifted.\n");
+ xdr_shift_buf(rcvbuf, iov->iov_len - hdrlen);
+
+ }
+ /*
+ * The XDR encode routine has set things up so that
+ * the link text will be copied directly into the
+ * buffer. We just have to do overflow-checking,
+ * and and null-terminate the text (the VFS expects
+ * null-termination).
+ */
+ strlen = (uint32_t *) kmap(rcvbuf->pages[0]);
+ len = ntohl(*strlen);
+ if (len > PAGE_CACHE_SIZE - 5) {
+ printk(KERN_WARNING "nfs: server returned giant symlink!\n");
kunmap(rcvbuf->pages[0]);
+ return -EIO;
}
+ *strlen = len;
+
+ string = (char *)(strlen + 1);
+ string[len] = '\0';
+ kunmap(rcvbuf->pages[0]);
return 0;
}
static int
-decode_remove(struct xdr_stream *xdr, int nfserr, struct nfs4_remove *remove)
+decode_restorefh(struct xdr_stream *xdr)
+{
+ return decode_op_hdr(xdr, OP_RESTOREFH);
+}
+
+static int
+decode_remove(struct xdr_stream *xdr, struct nfs4_remove *remove)
{
int status;
- status = 0;
- if (!nfserr)
- status = decode_change_info(xdr, remove->rm_cinfo);
+ status = decode_op_hdr(xdr, OP_REMOVE);
+ if (status)
+ goto out;
+ status = decode_change_info(xdr, remove->rm_cinfo);
+out:
return status;
}
static int
-decode_rename(struct xdr_stream *xdr, int nfserr, struct nfs4_rename *rename)
+decode_rename(struct xdr_stream *xdr, struct nfs4_rename *rename)
{
- int status = 0;
+ int status;
- if (!nfserr) {
- if ((status = decode_change_info(xdr, rename->rn_src_cinfo)))
- goto out;
- if ((status = decode_change_info(xdr, rename->rn_dst_cinfo)))
- goto out;
- }
+ status = decode_op_hdr(xdr, OP_RENAME);
+ if (status)
+ goto out;
+ if ((status = decode_change_info(xdr, rename->rn_src_cinfo)))
+ goto out;
+ if ((status = decode_change_info(xdr, rename->rn_dst_cinfo)))
+ goto out;
out:
return status;
}
static int
+decode_renew(struct xdr_stream *xdr)
+{
+ return decode_op_hdr(xdr, OP_RENEW);
+}
+
+static int
+decode_savefh(struct xdr_stream *xdr)
+{
+ return decode_op_hdr(xdr, OP_SAVEFH);
+}
+
+static int
decode_setattr(struct xdr_stream *xdr)
{
uint32_t *p;
- uint32_t bmlen;
+ uint32_t bmlen;
int status;
-
- READ_BUF(4);
- READ32(bmlen);
- if (bmlen > 10)
- goto xdr_error;
- READ_BUF(bmlen << 2);
- DECODE_TAIL;
+
+ status = decode_op_hdr(xdr, OP_SETATTR);
+ if (status)
+ return status;
+ READ_BUF(4);
+ READ32(bmlen);
+ READ_BUF(bmlen << 2);
+ return 0;
}
static int
-decode_setclientid(struct xdr_stream *xdr, int nfserr, struct nfs4_setclientid *setclientid)
+decode_setclientid(struct xdr_stream *xdr, struct nfs4_setclientid *setclientid)
{
uint32_t *p;
+ uint32_t opnum;
+ int32_t nfserr;
- if (!nfserr) {
+ READ_BUF(8);
+ READ32(opnum);
+ if (opnum != OP_SETCLIENTID) {
+ printk(KERN_NOTICE
+ "nfs4_decode_setclientid: Server returned operation"
+ " %d\n", opnum);
+ return -EIO;
+ }
+ READ32(nfserr);
+ if (nfserr == NFS_OK) {
READ_BUF(8 + sizeof(nfs4_verifier));
READ64(setclientid->sc_state->cl_clientid);
COPYMEM(setclientid->sc_state->cl_confirm, sizeof(nfs4_verifier));
- }
- else if (nfserr == NFSERR_CLID_INUSE) {
+ } else if (nfserr == NFSERR_CLID_INUSE) {
uint32_t len;
/* skip netid string */
@@ -1478,156 +1633,146 @@
READ_BUF(4);
READ32(len);
READ_BUF(len);
- }
+ return -EEXIST;
+ } else
+ return -nfs_stat_to_errno(nfserr);
return 0;
}
static int
-decode_write(struct xdr_stream *xdr, int nfserr, struct nfs4_write *write)
+decode_setclientid_confirm(struct xdr_stream *xdr)
+{
+ return decode_op_hdr(xdr, OP_SETCLIENTID_CONFIRM);
+}
+
+static int
+decode_write(struct xdr_stream *xdr, struct nfs4_write *write)
{
uint32_t *p;
int status;
- if (!nfserr) {
- READ_BUF(16);
- READ32(*write->wr_bytes_written);
- if (*write->wr_bytes_written > write->wr_len)
- goto xdr_error;
- READ32(write->wr_verf->committed);
- COPYMEM(write->wr_verf->verifier, 8);
- }
+ status = decode_op_hdr(xdr, OP_WRITE);
+ if (status)
+ return status;
- DECODE_TAIL;
+ READ_BUF(16);
+ READ32(*write->wr_bytes_written);
+ if (*write->wr_bytes_written > write->wr_len)
+ return -EIO;
+ READ32(write->wr_verf->committed);
+ COPYMEM(write->wr_verf->verifier, 8);
+ return 0;
}
/* FIXME: this sucks */
static int
decode_compound(struct xdr_stream *xdr, struct nfs4_compound *cp, struct rpc_rqst *req)
{
- uint32_t *p;
- uint32_t taglen;
- uint32_t opnum, nfserr;
+ struct compound_hdr hdr;
+ struct nfs4_op *op;
int status;
- READ_BUF(8);
- READ32(cp->toplevel_status);
- READ32(taglen);
+ status = decode_compound_hdr(xdr, &hdr);
+ if (status)
+ goto out;
+
+ cp->toplevel_status = hdr.status;
/*
* We need this if our zero-copy I/O is going to work. Rumor has
* it that the spec will soon mandate it...
*/
- if (taglen != cp->taglen)
+ if (hdr.taglen != cp->taglen)
dprintk("nfs4: non-conforming server returns tag length mismatch!\n");
- READ_BUF(taglen + 4);
- p += XDR_QUADLEN(taglen);
- READ32(cp->resp_nops);
- if (cp->resp_nops > cp->req_nops) {
+ cp->resp_nops = hdr.nops;
+ if (hdr.nops > cp->req_nops) {
dprintk("nfs4: resp_nops > req_nops!\n");
goto xdr_error;
}
- for (cp->nops = 0; cp->nops < cp->resp_nops; cp->nops++) {
- READ_BUF(8);
- READ32(opnum);
- if (opnum != cp->ops[cp->nops].opnum) {
- dprintk("nfs4: operation mismatch!\n");
- goto xdr_error;
- }
- READ32(nfserr);
- if (cp->nops == cp->resp_nops - 1) {
- if (nfserr != cp->toplevel_status) {
- dprintk("nfs4: status mismatch!\n");
- goto xdr_error;
- }
- }
- else if (nfserr) {
- dprintk("nfs4: intermediate status nonzero!\n");
- goto xdr_error;
- }
- cp->ops[cp->nops].nfserr = nfserr;
-
- switch (opnum) {
+ op = &cp->ops[0];
+ for (cp->nops = 0; cp->nops < cp->resp_nops; cp->nops++, op++) {
+ switch (op->opnum) {
case OP_ACCESS:
- status = decode_access(xdr, nfserr, &cp->ops[cp->nops].u.access);
+ status = decode_access(xdr, &op->u.access);
break;
case OP_CLOSE:
- status = decode_close(xdr, nfserr, &cp->ops[cp->nops].u.close);
+ status = decode_close(xdr, &op->u.close);
break;
case OP_COMMIT:
- status = decode_commit(xdr, nfserr, &cp->ops[cp->nops].u.commit);
+ status = decode_commit(xdr, &op->u.commit);
break;
case OP_CREATE:
- status = decode_create(xdr, nfserr, &cp->ops[cp->nops].u.create);
+ status = decode_create(xdr, &op->u.create);
break;
case OP_GETATTR:
- status = decode_getattr(xdr, nfserr, &cp->ops[cp->nops].u.getattr);
+ status = decode_getattr(xdr, &op->u.getattr);
break;
case OP_GETFH:
- status = decode_getfh(xdr, nfserr, &cp->ops[cp->nops].u.getfh);
+ status = decode_getfh(xdr, &op->u.getfh);
break;
case OP_LINK:
- status = decode_link(xdr, nfserr, &cp->ops[cp->nops].u.link);
+ status = decode_link(xdr, &op->u.link);
break;
case OP_LOOKUP:
- status = 0;
+ status = decode_lookup(xdr);
break;
case OP_OPEN:
- status = decode_open(xdr, nfserr, &cp->ops[cp->nops].u.open);
+ status = decode_open(xdr, &op->u.open);
break;
case OP_OPEN_CONFIRM:
- status = decode_open_confirm(xdr, nfserr, &cp->ops[cp->nops].u.open_confirm);
+ status = decode_open_confirm(xdr, &op->u.open_confirm);
break;
case OP_PUTFH:
- status = 0;
+ status = decode_putfh(xdr);
break;
case OP_PUTROOTFH:
- status = 0;
+ status = decode_putrootfh(xdr);
break;
case OP_READ:
- status = decode_read(xdr, nfserr, &cp->ops[cp->nops].u.read);
+ status = decode_read(xdr, req, &op->u.read);
break;
case OP_READDIR:
- status = decode_readdir(xdr, nfserr, req, &cp->ops[cp->nops].u.readdir);
+ status = decode_readdir(xdr, req, &op->u.readdir);
break;
case OP_READLINK:
- status = decode_readlink(xdr, nfserr, req, &cp->ops[cp->nops].u.readlink);
+ status = decode_readlink(xdr, req, &op->u.readlink);
break;
case OP_RESTOREFH:
- status = 0;
+ status = decode_restorefh(xdr);
break;
case OP_REMOVE:
- status = decode_remove(xdr, nfserr, &cp->ops[cp->nops].u.remove);
+ status = decode_remove(xdr, &op->u.remove);
break;
case OP_RENAME:
- status = decode_rename(xdr, nfserr, &cp->ops[cp->nops].u.rename);
+ status = decode_rename(xdr, &op->u.rename);
break;
case OP_RENEW:
- status = 0;
+ status = decode_renew(xdr);
break;
case OP_SAVEFH:
- status = 0;
+ status = decode_savefh(xdr);
break;
case OP_SETATTR:
status = decode_setattr(xdr);
break;
case OP_SETCLIENTID:
- status = decode_setclientid(xdr, nfserr, &cp->ops[cp->nops].u.setclientid);
+ status = decode_setclientid(xdr, &op->u.setclientid);
break;
case OP_SETCLIENTID_CONFIRM:
- status = 0;
+ status = decode_setclientid_confirm(xdr);
break;
case OP_WRITE:
- status = decode_write(xdr, nfserr, &cp->ops[cp->nops].u.write);
+ status = decode_write(xdr, &op->u.write);
break;
default:
BUG();
return -EIO;
}
if (status)
- goto xdr_error;
+ break;
}
DECODE_TAIL;
@@ -1700,15 +1845,15 @@
#endif
#define PROC(proc, argtype, restype) \
-[NFSPROC4_##proc] = { \
- .p_proc = NFSPROC4_##proc, \
+[NFSPROC4_CLNT_##proc] = { \
+ .p_proc = NFSPROC4_COMPOUND, \
.p_encode = (kxdrproc_t) nfs4_xdr_##argtype, \
.p_decode = (kxdrproc_t) nfs4_xdr_##restype, \
.p_bufsiz = MAX(NFS4_##argtype##_sz,NFS4_##restype##_sz) << 2, \
}
struct rpc_procinfo nfs4_procedures[] = {
- PROC(COMPOUND, enc_compound, dec_compound)
+ PROC(COMPOUND, enc_compound, dec_compound),
};
struct rpc_version nfs_version4 = {
diff -u --recursive --new-file linux-2.5.49-00-nfsv4_xdr1/include/linux/nfs4.h linux-2.5.49-01-nfsv4_xdr2/include/linux/nfs4.h
--- linux-2.5.49-00-nfsv4_xdr1/include/linux/nfs4.h 2002-10-08 18:42:48.000000000 -0400
+++ linux-2.5.49-01-nfsv4_xdr2/include/linux/nfs4.h 2002-11-22 22:16:55.000000000 -0500
@@ -196,6 +196,16 @@
#define NFS4_MINOR_VERSION 0
#define NFS4_DEBUG 1
+#ifdef __KERNEL__
+
+/* Index of predefined Linux client operations */
+
+enum {
+ NFSPROC4_CLNT_NULL = 0, /* Unused */
+ NFSPROC4_CLNT_COMPOUND, /* Soon to be unused */
+};
+
+#endif
#endif
/*
diff -u --recursive --new-file linux-2.5.49-00-nfsv4_xdr1/include/linux/nfs_xdr.h linux-2.5.49-01-nfsv4_xdr2/include/linux/nfs_xdr.h
--- linux-2.5.49-00-nfsv4_xdr1/include/linux/nfs_xdr.h 2002-11-18 11:53:14.000000000 -0500
+++ linux-2.5.49-01-nfsv4_xdr2/include/linux/nfs_xdr.h 2002-11-22 22:16:55.000000000 -0500
@@ -488,7 +488,6 @@
struct nfs4_op {
u32 opnum;
- u32 nfserr;
union {
struct nfs4_access access;
struct nfs4_close close;
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply
* Re: watch exception only for kseg0 addresses..?
From: Maciej W. Rozycki @ 2002-12-12 11:15 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Ralf Baechle, linux-mips
In-Reply-To: <20021211180135.GB14768@nevyn.them.org>
On Wed, 11 Dec 2002, Daniel Jacobowitz wrote:
> > The watchpoints would always be interfaced the same way, regardless of
> > the underlying implementation, of course. For the IWatch/DWatch, I'd
> > assign their numbers somehow (e.g. IWatch is watchpoint #0 and DWatch is
> > #1, following the sequence used for their CP0 register numbers). A user
> > such as GDB would have to determine the capabilities of all watchpoints as
> > I described and would discover that watchpoint #0 only accepts instruction
> > fetch events and watchpoint #1 only accepts data read/write ones.
> >
> > This way we can accept an arbitrary underlying implementation.
>
> This is what I don't like. Setting each individual watchpoint to
> determine their capabilities, when the kernel could just _report_ said
> capabilities. It's a difference in philosophy I suppose. I also have
I'm not much fond of the idea of putting such things into the kernel,
especially as this means either storing additional, rarely used data in
the kernel or querying it each time a relevant ptrace() call happens.
Essentially the kernel needs to perform the same steps that a user program
would do, except it doesn't know what the results will be used for.
Then, what do you expect to be queried by the kernel? You certainly want
the number of watchpoints, and the AND-mask, the OR-mask and the event
trigger capabilities for each of them. The latter implies both which
events are supported and which events imply (or exclude?) others. This is
a lot of data, hard to express abstractly, possibly only partially needed
by different programs. Why shouldn't each program be able to query
whatever it is interested in?
Besides, it's more kernel code and you probably know that a bug in the
kernel is less forgiving than one in the userland.
> some concerns about making the probing indistinguishable from setting a
I consider it a strength of the interface -- this way watchpoints behave
exactly as probed by user software. Anyway why do you need these
activities to be distinguishable? When you are writing a program, you
certainly know what your code is meant to do. You may comment it if
unobvious.
> watchpoint; if MIPS37 or MPIS256 has a substantially different
> watchpoint layout, we'll have to give it a whole new set of ptrace ops,
> which defeats the point of abstracting it.
What can you expect to be added? New events are trivial -- they are
added to the "access" member. Old software ignores them (modulo bugs) as
it doesn't try to blindly activate them. What remains is an address and a
mask. They're generic, generic enough, not to be processor-specific, be
it MIPS or anything else -- how can they change? They can only extend and
if they don't fit in 64 bits anymore, we need a new interface anyway. We
may bump the version number then (but we'll need a new Linux port first).
> If we write up decent documentation for what a userspace implementation
> has to do to probe the current implementations, I guess I'm satisfied.
s/has/may/ -- otherwise I can't see a problem here.
Maciej
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply
* Re: [LARTC] HTB and theory
From: Abraham van der Merwe @ 2002-12-12 11:19 UTC (permalink / raw)
To: lartc
In-Reply-To: <marc-lartc-103945416224487@msgid-missing>
[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]
Hi Stef!
> I did some small tests :
[snip]
> Conclusion : if you want to know how traffic will be shaped, you have to
> follow some basic rules.
> I will update docum.org tonight.
You're right. I did some tests this weekend as well and realised that you
have to stick with the basics. The problem was that it was not so clear to
me how HTB behaves when the child's rates/ceil exceed the parent's.
Some other questions I'd like to ask you while I'm at it:
1) if you have:
1:1
/ \
/ \
1:2 1:3
/ \ / \
/ \ / \
1:4 1:5 1:6 1:7
If
1:2 = prio 1
1:3 = prio 2
1:4 = prio 10
1:5 = prio 11
1:6 = prio 5
1:7 = prio 6
Is 1:4, 1:5 evaluated first or 1:6, 1:7? Iow, does HTB start at the root
node, prioritize its children and, subprioritize their children, etc. or
is only the leaf nodes' priorities important (i.e. 1:6, 1:7, 1:4, 1:5)
2) if a class is evaluated and there is some bandwidth available to borrow,
is the first non-congested child given all bandwidth that is available and
then the next is given the rest and so on or is each child given a quantum
of bandwidth, then if there is some bandwidth left, a second round and so on?
--
Regards
Abraham
History repeats itself. That's one thing wrong with history.
___________________________________________________
Abraham vd Merwe [ZR1BBQ] - Frogfoot Networks
P.O. Box 3472, Matieland, Stellenbosch, 7602
Cell: +27 82 565 4451 Http: http://www.frogfoot.net/
Email: abz@frogfoot.net
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply
* Re: Completely discharging LION batteries
From: Jochen Reinwand @ 2002-12-12 11:22 UTC (permalink / raw)
To: Frank Mehnert, acpi-devel-pyega4qmqnRoyOMFzWx49A
In-Reply-To: <E18MAH1-0000WG-00-Hkr6DilkjYZTIIw02KIYYwp9XTrnmqkB@public.gmane.org>
> > > I'm using Linux 2.4.20 together with the acpi patches
> > > 20021205-2.4.20 on a
> > > Thinkpad T20. If I use two batteries (the builtin and a
> > > second in the Ultra-
> > > Bay), the second battery first gets discharged _completely_
> > > and after that the internal battery is used.
> >
> > That's normal, but yes it is not the smartest idea to do.
>
> What I'm wondering about is that in the Windows 2000 Help of
> the Thinkpad Laptop, IBM advises that it is better to discharge
> the battery sometimes completely to refresh the full capacity
> at least partly. That advise is completely the opposite of what
> I've seen. But it could be an mistake in their documentation or
> they could target NiMH batteries.
Interesting informations about Li-ion batteries can be found at
http://www.buchmann.ca/. It seems to be not available at the moment. But here
are a few tips from the page:
- Charge the Li-ion often, except before a long storage. Avoid repeated deep
discharges.
- Keep the Li-ion battery cool. Prevent storage in a hot car. Never freeze a
battery.
- If your laptop is capable of running without a battery and fixed power is
used most of the time, remove the battery and store it in a cool place.
- Avoid purchasing spare Li-ion batteries for later use. Observe manufacturing
date when purchasing. Do not buy old stock, even if sold at clearance
prices.
But there is also a note on the site that a deep discharge cannot bring back I
higher full charge level. On this list I once found the tip that it should
work. I tried it and my battery was again able to charge to full capacity.
btw: DO NEVER COMPLETELY DISCHARGE A LI-ION! Normal electronic devices can not
discharge a Li-ion completely. So it should be ok to discharge until the
device powers of. There is still enough power in the battery to lit a lamp
for a long time. But that would discharge it definitively to low!
Jochen
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
^ permalink raw reply
* Re: 2.4.20-ac2 and i810 drm
From: Arjan van de Ven @ 2002-12-12 11:29 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: Dave Airlie, linux-kernel, alan
In-Reply-To: <1039681967.1450.0.camel@laptop.fenrus.com>
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
On Thu, 2002-12-12 at 09:32, Arjan van de Ven wrote:
> On Thu, 2002-12-12 at 04:54, Dave Airlie wrote:
> >
> > I've been running 2.4.20-rc4 up to now with DRM enabled for my i810
> > chipset and XFree86 4.2 from RH 7.3.
> >
> > When I run my OpenGL application (internal app) under 2.4.20-ac2 with the
> > same .config when I ctrl-c the application the machine hangs hard.
> >
> > It is the only application running on the X server so the X server
> > restarts when I exit the app.. under 2.4.20-rc4 this works fine...
>
> I just got an updated source for the i810 DRM and will port it to -ac2;
> lots of i810 bugfixes
eh woops, i830 updates
patch is attached
[-- Attachment #2: linux-2.4.20-drm43.patch --]
[-- Type: text/x-patch, Size: 53176 bytes --]
diff -urN linux-2.4.20/drivers/char/drm.org/drm_dma.h linux-2.4.20/drivers/char/drm/drm_dma.h
--- linux-2.4.20/drivers/char/drm.org/drm_dma.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/drm_dma.h 2002-12-12 12:27:37.000000000 +0100
@@ -539,6 +539,10 @@
#if __HAVE_VBL_IRQ
init_waitqueue_head(&dev->vbl_queue);
+
+ spin_lock_init( &dev->vbl_lock );
+
+ INIT_LIST_HEAD( &dev->vbl_sigs.head );
#endif
/* Before installing handler */
@@ -609,7 +613,8 @@
drm_device_t *dev = priv->dev;
drm_wait_vblank_t vblwait;
struct timeval now;
- int ret;
+ int ret = 0;
+ unsigned int flags;
if (!dev->irq)
return -EINVAL;
@@ -617,15 +622,45 @@
DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
sizeof(vblwait) );
- if ( vblwait.type == _DRM_VBLANK_RELATIVE ) {
- vblwait.sequence += atomic_read( &dev->vbl_received );
+ switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
+ case _DRM_VBLANK_RELATIVE:
+ vblwait.request.sequence += atomic_read( &dev->vbl_received );
+ case _DRM_VBLANK_ABSOLUTE:
+ break;
+ default:
+ return -EINVAL;
}
- ret = DRM(vblank_wait)( dev, &vblwait.sequence );
+ flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
+
+ if ( flags & _DRM_VBLANK_SIGNAL ) {
+ unsigned long irqflags;
+ drm_vbl_sig_t *vbl_sig = kmalloc( sizeof( drm_vbl_sig_t ), GFP_KERNEL );
+
+ if ( !vbl_sig )
+ return -ENOMEM;
+
+ memset( (void *)vbl_sig, 0, sizeof(*vbl_sig) );
- do_gettimeofday( &now );
- vblwait.tval_sec = now.tv_sec;
- vblwait.tval_usec = now.tv_usec;
+ vbl_sig->sequence = vblwait.request.sequence;
+ vbl_sig->info.si_signo = vblwait.request.signal;
+ vbl_sig->task = current;
+
+ vblwait.reply.sequence = atomic_read( &dev->vbl_received );
+
+ /* Hook signal entry into list */
+ spin_lock_irqsave( &dev->vbl_lock, irqflags );
+
+ list_add_tail( (struct list_head *) vbl_sig, &dev->vbl_sigs.head );
+
+ spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+ } else {
+ ret = DRM(vblank_wait)( dev, &vblwait.request.sequence );
+
+ do_gettimeofday( &now );
+ vblwait.reply.tval_sec = now.tv_sec;
+ vblwait.reply.tval_usec = now.tv_usec;
+ }
DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
sizeof(vblwait) );
@@ -633,6 +668,33 @@
return ret;
}
+void DRM(vbl_send_signals)( drm_device_t *dev )
+{
+ struct list_head *entry, *tmp;
+ drm_vbl_sig_t *vbl_sig;
+ unsigned int vbl_seq = atomic_read( &dev->vbl_received );
+ unsigned long flags;
+
+ spin_lock_irqsave( &dev->vbl_lock, flags );
+
+ list_for_each_safe( entry, tmp, &dev->vbl_sigs.head ) {
+
+ vbl_sig = (drm_vbl_sig_t *) entry;
+
+ if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
+
+ vbl_sig->info.si_code = atomic_read( &dev->vbl_received );
+ send_sig_info( vbl_sig->info.si_signo, &vbl_sig->info, vbl_sig->task );
+
+ list_del( entry );
+
+ kfree( entry );
+ }
+ }
+
+ spin_unlock_irqrestore( &dev->vbl_lock, flags );
+}
+
#endif /* __HAVE_VBL_IRQ */
#else
diff -urN linux-2.4.20/drivers/char/drm.org/drm_drv.h linux-2.4.20/drivers/char/drm/drm_drv.h
--- linux-2.4.20/drivers/char/drm.org/drm_drv.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/drm_drv.h 2002-12-12 12:27:37.000000000 +0100
@@ -765,8 +765,8 @@
* Begin inline drm_release
*/
- DRM_DEBUG( "pid = %d, device = 0x%x, open_count = %d\n",
- current->pid, dev->device, dev->open_count );
+ DRM_DEBUG( "pid = %d, device = 0x%lx, open_count = %d\n",
+ current->pid, (long)dev->device, dev->open_count );
if ( dev->lock.hw_lock &&
_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) &&
@@ -891,8 +891,9 @@
atomic_inc( &dev->counts[_DRM_STAT_IOCTLS] );
++priv->ioctl_count;
- DRM_DEBUG( "pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%x, auth=%d\n",
- current->pid, cmd, nr, dev->device, priv->authenticated );
+ DRM_DEBUG( "pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
+ current->pid, cmd, nr, (long)dev->device,
+ priv->authenticated );
if ( nr >= DRIVER_IOCTL_COUNT ) {
retcode = -EINVAL;
diff -urN linux-2.4.20/drivers/char/drm.org/drm_fops.h linux-2.4.20/drivers/char/drm/drm_fops.h
--- linux-2.4.20/drivers/char/drm.org/drm_fops.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/drm_fops.h 2002-12-12 12:27:37.000000000 +0100
@@ -94,8 +94,8 @@
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
- DRM_DEBUG("pid = %d, device = 0x%x, open_count = %d\n",
- current->pid, dev->device, dev->open_count);
+ DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
+ current->pid, (long)dev->device, dev->open_count);
return 0;
}
@@ -105,7 +105,7 @@
drm_device_t *dev = priv->dev;
int retcode;
- DRM_DEBUG("fd = %d, device = 0x%x\n", fd, dev->device);
+ DRM_DEBUG("fd = %d, device = 0x%lx\n", fd, (long)dev->device);
retcode = fasync_helper(fd, filp, on, &dev->buf_async);
if (retcode < 0) return retcode;
return 0;
diff -urN linux-2.4.20/drivers/char/drm.org/drm.h linux-2.4.20/drivers/char/drm/drm.h
--- linux-2.4.20/drivers/char/drm.org/drm.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/drm.h 2002-12-12 12:27:37.000000000 +0100
@@ -354,17 +354,30 @@
} drm_irq_busid_t;
typedef enum {
- _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
- _DRM_VBLANK_RELATIVE = 0x1 /* Wait for given number of vblanks */
+ _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
+ _DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */
+ _DRM_VBLANK_SIGNAL = 0x80000000 /* Send signal instead of blocking */
} drm_vblank_seq_type_t;
-typedef struct drm_radeon_vbl_wait {
+#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
+
+struct drm_wait_vblank_request {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ unsigned long signal;
+};
+
+struct drm_wait_vblank_reply {
drm_vblank_seq_type_t type;
unsigned int sequence;
long tval_sec;
long tval_usec;
-} drm_wait_vblank_t;
+};
+typedef union drm_wait_vblank {
+ struct drm_wait_vblank_request request;
+ struct drm_wait_vblank_reply reply;
+} drm_wait_vblank_t;
typedef struct drm_agp_mode {
unsigned long mode;
diff -urN linux-2.4.20/drivers/char/drm.org/drm_ioctl.h linux-2.4.20/drivers/char/drm/drm_ioctl.h
--- linux-2.4.20/drivers/char/drm.org/drm_ioctl.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/drm_ioctl.h 2002-12-12 12:27:37.000000000 +0100
@@ -111,7 +111,7 @@
do {
struct pci_dev *pci_dev;
- int b, d, f;
+ int domain, b, d, f;
char *p;
for(p = dev->unique; p && *p && *p != ':'; p++);
@@ -123,6 +123,27 @@
f = (int)simple_strtoul(p+1, &p, 10);
if (*p) break;
+ domain = b >> 8;
+ b &= 0xff;
+
+#ifdef __alpha__
+ /*
+ * Find the hose the device is on (the domain number is the
+ * hose index) and offset the bus by the root bus of that
+ * hose.
+ */
+ for(pci_dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,NULL);
+ pci_dev;
+ pci_dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,pci_dev)) {
+ struct pci_controller *hose = pci_dev->sysdata;
+
+ if (hose->index == domain) {
+ b += hose->bus->number;
+ break;
+ }
+ }
+#endif
+
pci_dev = pci_find_slot(b, PCI_DEVFN(d,f));
if (pci_dev) {
dev->pdev = pci_dev;
diff -urN linux-2.4.20/drivers/char/drm.org/drmP.h linux-2.4.20/drivers/char/drm/drmP.h
--- linux-2.4.20/drivers/char/drm.org/drmP.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/drmP.h 2002-12-12 12:27:37.000000000 +0100
@@ -72,10 +72,7 @@
#include <asm/pgalloc.h>
#include "drm.h"
-/* page_to_bus for earlier kernels, not optimal in all cases */
-#ifndef page_to_bus
-#define page_to_bus(page) ((unsigned int)(virt_to_bus(page_address(page))))
-#endif
+#include "drm_os_linux.h"
/* DRM template customization defaults
*/
@@ -210,6 +207,7 @@
(unsigned long)(n),sizeof(*(ptr))))
#endif /* i386 & alpha */
#endif
+#define __REALLY_HAVE_SG (__HAVE_SG)
/* Begin the DRM...
*/
@@ -617,6 +615,17 @@
drm_map_t *map;
} drm_map_list_t;
+#if __HAVE_VBL_IRQ
+
+typedef struct drm_vbl_sig {
+ struct list_head head;
+ unsigned int sequence;
+ struct siginfo info;
+ struct task_struct *task;
+} drm_vbl_sig_t;
+
+#endif
+
typedef struct drm_device {
const char *name; /* Simple driver name */
char *unique; /* Unique identifier: e.g., busid */
@@ -679,6 +688,8 @@
#if __HAVE_VBL_IRQ
wait_queue_head_t vbl_queue;
atomic_t vbl_received;
+ spinlock_t vbl_lock;
+ drm_vbl_sig_t vbl_sigs;
#endif
cycles_t ctx_start;
cycles_t lck_start;
@@ -915,6 +926,7 @@
extern int DRM(wait_vblank)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
+extern void DRM(vbl_send_signals)( drm_device_t *dev );
#endif
#if __HAVE_DMA_IRQ_BH
extern void DRM(dma_immediate_bh)( void *dev );
diff -urN linux-2.4.20/drivers/char/drm.org/drm_proc.h linux-2.4.20/drivers/char/drm/drm_proc.h
--- linux-2.4.20/drivers/char/drm.org/drm_proc.h 2002-11-29 00:53:12.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/drm_proc.h 2002-12-12 12:27:37.000000000 +0100
@@ -147,10 +147,10 @@
*eof = 0;
if (dev->unique) {
- DRM_PROC_PRINT("%s 0x%x %s\n",
- dev->name, dev->device, dev->unique);
+ DRM_PROC_PRINT("%s 0x%lx %s\n",
+ dev->name, (long)dev->device, dev->unique);
} else {
- DRM_PROC_PRINT("%s 0x%x\n", dev->name, dev->device);
+ DRM_PROC_PRINT("%s 0x%lx\n", dev->name, (long)dev->device);
}
if (len > request + offset) return request;
diff -urN linux-2.4.20/drivers/char/drm.org/gamma_dma.c linux-2.4.20/drivers/char/drm/gamma_dma.c
--- linux-2.4.20/drivers/char/drm.org/gamma_dma.c 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/gamma_dma.c 2002-12-12 12:27:37.000000000 +0100
@@ -521,11 +521,11 @@
}
}
if (retcode) {
- DRM_ERROR("ctx%d w%d p%d c%d i%d l%d %d/%d\n",
+ DRM_ERROR("ctx%d w%d p%d c%ld i%d l%d %d/%d\n",
d->context,
last_buf->waiting,
last_buf->pending,
- DRM_WAITCOUNT(dev, d->context),
+ (long)DRM_WAITCOUNT(dev, d->context),
last_buf->idx,
last_buf->list,
last_buf->pid,
@@ -591,7 +591,7 @@
drm_buf_t *buf;
int i;
struct list_head *list;
- unsigned int *pgt;
+ unsigned long *pgt;
DRM_DEBUG( "%s\n", __FUNCTION__ );
diff -urN linux-2.4.20/drivers/char/drm.org/i830_dma.c linux-2.4.20/drivers/char/drm/i830_dma.c
--- linux-2.4.20/drivers/char/drm.org/i830_dma.c 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/i830_dma.c 2002-12-12 12:27:37.000000000 +0100
@@ -38,6 +38,7 @@
#include "i830_drm.h"
#include "i830_drv.h"
#include <linux/interrupt.h> /* For task queue support */
+#include <linux/pagemap.h> /* For FASTCALL on unlock_page() */
#include <linux/delay.h>
#define DO_MUNMAP(m, a, l) do_munmap(m, a, l, 1)
@@ -49,7 +50,6 @@
#define I830_BUF_UNMAPPED 0
#define I830_BUF_MAPPED 1
-#define RING_LOCALS unsigned int outring, ringmask; volatile char *virt;
@@ -63,33 +63,6 @@
-#define I830_VERBOSE 0
-
-#define BEGIN_LP_RING(n) do { \
- if (I830_VERBOSE) \
- printk("BEGIN_LP_RING(%d) in %s\n", \
- n, __FUNCTION__); \
- if (dev_priv->ring.space < n*4) \
- i830_wait_ring(dev, n*4); \
- dev_priv->ring.space -= n*4; \
- outring = dev_priv->ring.tail; \
- ringmask = dev_priv->ring.tail_mask; \
- virt = dev_priv->ring.virtual_start; \
-} while (0)
-
-#define ADVANCE_LP_RING() do { \
- if (I830_VERBOSE) printk("ADVANCE_LP_RING %x\n", outring); \
- dev_priv->ring.tail = outring; \
- I830_WRITE(LP_RING + RING_TAIL, outring); \
-} while(0)
-
-#define OUT_RING(n) do { \
- if (I830_VERBOSE) printk(" OUT_RING %x\n", (int)(n)); \
- *(volatile unsigned int *)(virt + outring) = n; \
- outring += 4; \
- outring &= ringmask; \
-} while (0)
-
static inline void i830_print_status_page(drm_device_t *dev)
{
drm_device_dma_t *dma = dev->dma;
@@ -248,7 +221,7 @@
buf = i830_freelist_get(dev);
if (!buf) {
retcode = -ENOMEM;
- DRM_ERROR("retcode=%d\n", retcode);
+ DRM_DEBUG("retcode=%d\n", retcode);
return retcode;
}
@@ -282,12 +255,21 @@
dev_priv->ring.Size);
}
if(dev_priv->hw_status_page != 0UL) {
- pci_free_consistent(dev->pdev, PAGE_SIZE,
+ pci_free_consistent(dev->pdev, PAGE_SIZE,
(void *)dev_priv->hw_status_page,
dev_priv->dma_status_page);
/* Need to rewrite hardware status page */
I830_WRITE(0x02080, 0x1ffff000);
}
+
+ /* Disable interrupts here because after dev_private
+ * is freed, it's too late.
+ */
+ if (dev->irq) {
+ I830_WRITE16( I830REG_INT_MASK_R, 0xffff );
+ I830_WRITE16( I830REG_INT_ENABLE_R, 0x0 );
+ }
+
DRM(free)(dev->dev_private, sizeof(drm_i830_private_t),
DRM_MEM_DRIVER);
dev->dev_private = NULL;
@@ -301,7 +283,7 @@
return 0;
}
-static int i830_wait_ring(drm_device_t *dev, int n)
+int i830_wait_ring(drm_device_t *dev, int n, const char *caller)
{
drm_i830_private_t *dev_priv = dev->dev_private;
drm_i830_ring_buffer_t *ring = &(dev_priv->ring);
@@ -327,6 +309,7 @@
goto out_wait_ring;
}
udelay(1);
+ dev_priv->sarea_priv->perf_boxes |= I830_BOX_WAIT;
}
out_wait_ring:
@@ -342,6 +325,9 @@
ring->tail = I830_READ(LP_RING + RING_TAIL) & TAIL_ADDR;
ring->space = ring->head - (ring->tail+8);
if (ring->space < 0) ring->space += ring->Size;
+
+ if (ring->head == ring->tail)
+ dev_priv->sarea_priv->perf_boxes |= I830_BOX_RING_EMPTY;
}
static int i830_freelist_init(drm_device_t *dev, drm_i830_private_t *dev_priv)
@@ -456,6 +442,8 @@
dev_priv->back_pitch = init->back_pitch;
dev_priv->depth_pitch = init->depth_pitch;
+ dev_priv->do_boxes = 0;
+ dev_priv->use_mi_batchbuffer_start = 0;
/* Program Hardware Status Page */
dev_priv->hw_status_page =
@@ -531,11 +519,7 @@
unsigned int tmp;
RING_LOCALS;
- BEGIN_LP_RING( I830_CTX_SETUP_SIZE + 2 );
-
- OUT_RING( GFX_OP_STIPPLE );
- OUT_RING( 0 );
-
+ BEGIN_LP_RING( I830_CTX_SETUP_SIZE + 4 );
for ( i = 0 ; i < I830_CTXREG_BLENDCOLR0 ; i++ ) {
tmp = code[i];
@@ -573,38 +557,44 @@
ADVANCE_LP_RING();
}
-static void i830EmitTexVerified( drm_device_t *dev,
- volatile unsigned int *code )
+static void i830EmitTexVerified( drm_device_t *dev, unsigned int *code )
{
drm_i830_private_t *dev_priv = dev->dev_private;
int i, j = 0;
unsigned int tmp;
RING_LOCALS;
- BEGIN_LP_RING( I830_TEX_SETUP_SIZE );
-
- OUT_RING( GFX_OP_MAP_INFO );
- OUT_RING( code[I830_TEXREG_MI1] );
- OUT_RING( code[I830_TEXREG_MI2] );
- OUT_RING( code[I830_TEXREG_MI3] );
- OUT_RING( code[I830_TEXREG_MI4] );
- OUT_RING( code[I830_TEXREG_MI5] );
-
- for ( i = 6 ; i < I830_TEX_SETUP_SIZE ; i++ ) {
- tmp = code[i];
- OUT_RING( tmp );
- j++;
- }
+ if (code[I830_TEXREG_MI0] == GFX_OP_MAP_INFO ||
+ (code[I830_TEXREG_MI0] & ~(0xf*LOAD_TEXTURE_MAP0)) ==
+ (STATE3D_LOAD_STATE_IMMEDIATE_2|4)) {
+
+ BEGIN_LP_RING( I830_TEX_SETUP_SIZE );
+
+ OUT_RING( code[I830_TEXREG_MI0] ); /* TM0LI */
+ OUT_RING( code[I830_TEXREG_MI1] ); /* TM0S0 */
+ OUT_RING( code[I830_TEXREG_MI2] ); /* TM0S1 */
+ OUT_RING( code[I830_TEXREG_MI3] ); /* TM0S2 */
+ OUT_RING( code[I830_TEXREG_MI4] ); /* TM0S3 */
+ OUT_RING( code[I830_TEXREG_MI5] ); /* TM0S4 */
+
+ for ( i = 6 ; i < I830_TEX_SETUP_SIZE ; i++ ) {
+ tmp = code[i];
+ OUT_RING( tmp );
+ j++;
+ }
- if (j & 1)
- OUT_RING( 0 );
+ if (j & 1)
+ OUT_RING( 0 );
- ADVANCE_LP_RING();
+ ADVANCE_LP_RING();
+ }
+ else
+ printk("rejected packet %x\n", code[0]);
}
static void i830EmitTexBlendVerified( drm_device_t *dev,
- volatile unsigned int *code,
- volatile unsigned int num)
+ unsigned int *code,
+ unsigned int num)
{
drm_i830_private_t *dev_priv = dev->dev_private;
int i, j = 0;
@@ -614,7 +604,7 @@
if (!num)
return;
- BEGIN_LP_RING( num );
+ BEGIN_LP_RING( num + 1 );
for ( i = 0 ; i < num ; i++ ) {
tmp = code[i];
@@ -637,6 +627,8 @@
int i;
RING_LOCALS;
+ return; /* Is this right ? -- Arjan */
+
BEGIN_LP_RING( 258 );
if(is_shared == 1) {
@@ -650,42 +642,41 @@
OUT_RING(palette[i]);
}
OUT_RING(0);
+ /* KW: WHERE IS THE ADVANCE_LP_RING? This is effectively a noop!
+ */
}
/* Need to do some additional checking when setting the dest buffer.
*/
static void i830EmitDestVerified( drm_device_t *dev,
- volatile unsigned int *code )
+ unsigned int *code )
{
drm_i830_private_t *dev_priv = dev->dev_private;
unsigned int tmp;
RING_LOCALS;
- BEGIN_LP_RING( I830_DEST_SETUP_SIZE + 6 );
+ BEGIN_LP_RING( I830_DEST_SETUP_SIZE + 10 );
+
tmp = code[I830_DESTREG_CBUFADDR];
- if (tmp == dev_priv->front_di1) {
- /* Don't use fence when front buffer rendering */
- OUT_RING( CMD_OP_DESTBUFFER_INFO );
- OUT_RING( BUF_3D_ID_COLOR_BACK |
- BUF_3D_PITCH(dev_priv->back_pitch * dev_priv->cpp) );
- OUT_RING( tmp );
+ if (tmp == dev_priv->front_di1 || tmp == dev_priv->back_di1) {
+ if (((int)outring) & 8) {
+ OUT_RING(0);
+ OUT_RING(0);
+ }
OUT_RING( CMD_OP_DESTBUFFER_INFO );
- OUT_RING( BUF_3D_ID_DEPTH |
- BUF_3D_PITCH(dev_priv->depth_pitch * dev_priv->cpp));
- OUT_RING( dev_priv->zi1 );
- } else if(tmp == dev_priv->back_di1) {
- OUT_RING( CMD_OP_DESTBUFFER_INFO );
OUT_RING( BUF_3D_ID_COLOR_BACK |
BUF_3D_PITCH(dev_priv->back_pitch * dev_priv->cpp) |
BUF_3D_USE_FENCE);
OUT_RING( tmp );
+ OUT_RING( 0 );
OUT_RING( CMD_OP_DESTBUFFER_INFO );
OUT_RING( BUF_3D_ID_DEPTH | BUF_3D_USE_FENCE |
BUF_3D_PITCH(dev_priv->depth_pitch * dev_priv->cpp));
OUT_RING( dev_priv->zi1 );
+ OUT_RING( 0 );
} else {
DRM_ERROR("bad di1 %x (allow %x or %x)\n",
tmp, dev_priv->front_di1, dev_priv->back_di1);
@@ -713,21 +704,35 @@
OUT_RING( 0 );
}
- OUT_RING( code[I830_DESTREG_SENABLE] );
-
OUT_RING( GFX_OP_SCISSOR_RECT );
OUT_RING( code[I830_DESTREG_SR1] );
OUT_RING( code[I830_DESTREG_SR2] );
+ OUT_RING( 0 );
ADVANCE_LP_RING();
}
+static void i830EmitStippleVerified( drm_device_t *dev,
+ unsigned int *code )
+{
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ RING_LOCALS;
+
+ BEGIN_LP_RING( 2 );
+ OUT_RING( GFX_OP_STIPPLE );
+ OUT_RING( code[1] );
+ ADVANCE_LP_RING();
+}
+
+
static void i830EmitState( drm_device_t *dev )
{
drm_i830_private_t *dev_priv = dev->dev_private;
drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv;
unsigned int dirty = sarea_priv->dirty;
+ DRM_DEBUG("%s %x\n", __FUNCTION__, dirty);
+
if (dirty & I830_UPLOAD_BUFFERS) {
i830EmitDestVerified( dev, sarea_priv->BufferState );
sarea_priv->dirty &= ~I830_UPLOAD_BUFFERS;
@@ -761,17 +766,154 @@
}
if (dirty & I830_UPLOAD_TEX_PALETTE_SHARED) {
- i830EmitTexPalette(dev, sarea_priv->Palette[0], 0, 1);
+ i830EmitTexPalette(dev, sarea_priv->Palette[0], 0, 1);
+ } else {
+ if (dirty & I830_UPLOAD_TEX_PALETTE_N(0)) {
+ i830EmitTexPalette(dev, sarea_priv->Palette[0], 0, 0);
+ sarea_priv->dirty &= ~I830_UPLOAD_TEX_PALETTE_N(0);
+ }
+ if (dirty & I830_UPLOAD_TEX_PALETTE_N(1)) {
+ i830EmitTexPalette(dev, sarea_priv->Palette[1], 1, 0);
+ sarea_priv->dirty &= ~I830_UPLOAD_TEX_PALETTE_N(1);
+ }
+
+ /* 1.3:
+ */
+#if 0
+ if (dirty & I830_UPLOAD_TEX_PALETTE_N(2)) {
+ i830EmitTexPalette(dev, sarea_priv->Palette2[0], 0, 0);
+ sarea_priv->dirty &= ~I830_UPLOAD_TEX_PALETTE_N(2);
+ }
+ if (dirty & I830_UPLOAD_TEX_PALETTE_N(3)) {
+ i830EmitTexPalette(dev, sarea_priv->Palette2[1], 1, 0);
+ sarea_priv->dirty &= ~I830_UPLOAD_TEX_PALETTE_N(2);
+ }
+#endif
+ }
+
+ /* 1.3:
+ */
+ if (dirty & I830_UPLOAD_STIPPLE) {
+ i830EmitStippleVerified( dev,
+ sarea_priv->StippleState);
+ sarea_priv->dirty &= ~I830_UPLOAD_STIPPLE;
+ }
+
+ if (dirty & I830_UPLOAD_TEX2) {
+ i830EmitTexVerified( dev, sarea_priv->TexState2 );
+ sarea_priv->dirty &= ~I830_UPLOAD_TEX2;
+ }
+
+ if (dirty & I830_UPLOAD_TEX3) {
+ i830EmitTexVerified( dev, sarea_priv->TexState3 );
+ sarea_priv->dirty &= ~I830_UPLOAD_TEX3;
+ }
+
+
+ if (dirty & I830_UPLOAD_TEXBLEND2) {
+ i830EmitTexBlendVerified(
+ dev,
+ sarea_priv->TexBlendState2,
+ sarea_priv->TexBlendStateWordsUsed2);
+
+ sarea_priv->dirty &= ~I830_UPLOAD_TEXBLEND2;
+ }
+
+ if (dirty & I830_UPLOAD_TEXBLEND3) {
+ i830EmitTexBlendVerified(
+ dev,
+ sarea_priv->TexBlendState3,
+ sarea_priv->TexBlendStateWordsUsed3);
+ sarea_priv->dirty &= ~I830_UPLOAD_TEXBLEND3;
+ }
+}
+
+/* ================================================================
+ * Performance monitoring functions
+ */
+
+static void i830_fill_box( drm_device_t *dev,
+ int x, int y, int w, int h,
+ int r, int g, int b )
+{
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ u32 color;
+ unsigned int BR13, CMD;
+ RING_LOCALS;
+
+ BR13 = (0xF0 << 16) | (dev_priv->pitch * dev_priv->cpp) | (1<<24);
+ CMD = XY_COLOR_BLT_CMD;
+ x += dev_priv->sarea_priv->boxes[0].x1;
+ y += dev_priv->sarea_priv->boxes[0].y1;
+
+ if (dev_priv->cpp == 4) {
+ BR13 |= (1<<25);
+ CMD |= (XY_COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB);
+ color = (((0xff) << 24) | (r << 16) | (g << 8) | b);
} else {
- if (dirty & I830_UPLOAD_TEX_PALETTE_N(0)) {
- i830EmitTexPalette(dev, sarea_priv->Palette[0], 0, 0);
- sarea_priv->dirty &= ~I830_UPLOAD_TEX_PALETTE_N(0);
- }
- if (dirty & I830_UPLOAD_TEX_PALETTE_N(1)) {
- i830EmitTexPalette(dev, sarea_priv->Palette[1], 1, 0);
- sarea_priv->dirty &= ~I830_UPLOAD_TEX_PALETTE_N(1);
- }
+ color = (((r & 0xf8) << 8) |
+ ((g & 0xfc) << 3) |
+ ((b & 0xf8) >> 3));
}
+
+ BEGIN_LP_RING( 6 );
+ OUT_RING( CMD );
+ OUT_RING( BR13 );
+ OUT_RING( (y << 16) | x );
+ OUT_RING( ((y+h) << 16) | (x+w) );
+
+ if ( dev_priv->current_page == 1 ) {
+ OUT_RING( dev_priv->front_offset );
+ } else {
+ OUT_RING( dev_priv->back_offset );
+ }
+
+ OUT_RING( color );
+ ADVANCE_LP_RING();
+}
+
+static void i830_cp_performance_boxes( drm_device_t *dev )
+{
+ drm_i830_private_t *dev_priv = dev->dev_private;
+
+ /* Purple box for page flipping
+ */
+ if ( dev_priv->sarea_priv->perf_boxes & I830_BOX_FLIP )
+ i830_fill_box( dev, 4, 4, 8, 8, 255, 0, 255 );
+
+ /* Red box if we have to wait for idle at any point
+ */
+ if ( dev_priv->sarea_priv->perf_boxes & I830_BOX_WAIT )
+ i830_fill_box( dev, 16, 4, 8, 8, 255, 0, 0 );
+
+ /* Blue box: lost context?
+ */
+ if ( dev_priv->sarea_priv->perf_boxes & I830_BOX_LOST_CONTEXT )
+ i830_fill_box( dev, 28, 4, 8, 8, 0, 0, 255 );
+
+ /* Yellow box for texture swaps
+ */
+ if ( dev_priv->sarea_priv->perf_boxes & I830_BOX_TEXTURE_LOAD )
+ i830_fill_box( dev, 40, 4, 8, 8, 255, 255, 0 );
+
+ /* Green box if hardware never idles (as far as we can tell)
+ */
+ if ( !(dev_priv->sarea_priv->perf_boxes & I830_BOX_RING_EMPTY) )
+ i830_fill_box( dev, 64, 4, 8, 8, 0, 255, 0 );
+
+
+ /* Draw bars indicating number of buffers allocated
+ * (not a great measure, easily confused)
+ */
+ if (dev_priv->dma_used) {
+ int bar = dev_priv->dma_used / 10240;
+ if (bar > 100) bar = 100;
+ if (bar < 1) bar = 1;
+ i830_fill_box( dev, 4, 16, bar, 4, 196, 128, 128 );
+ dev_priv->dma_used = 0;
+ }
+
+ dev_priv->sarea_priv->perf_boxes = 0;
}
static void i830_dma_dispatch_clear( drm_device_t *dev, int flags,
@@ -789,6 +931,15 @@
unsigned int BR13, CMD, D_CMD;
RING_LOCALS;
+
+ if ( dev_priv->current_page == 1 ) {
+ unsigned int tmp = flags;
+
+ flags &= ~(I830_FRONT | I830_BACK);
+ if ( tmp & I830_FRONT ) flags |= I830_BACK;
+ if ( tmp & I830_BACK ) flags |= I830_FRONT;
+ }
+
i830_kernel_lost_context(dev);
switch(cpp) {
@@ -868,13 +1019,17 @@
drm_clip_rect_t *pbox = sarea_priv->boxes;
int pitch = dev_priv->pitch;
int cpp = dev_priv->cpp;
- int ofs = dev_priv->back_offset;
int i;
unsigned int CMD, BR13;
RING_LOCALS;
DRM_DEBUG("swapbuffers\n");
+ i830_kernel_lost_context(dev);
+
+ if (dev_priv->do_boxes)
+ i830_cp_performance_boxes( dev );
+
switch(cpp) {
case 2:
BR13 = (pitch * cpp) | (0xCC << 16) | (1<<24);
@@ -891,7 +1046,6 @@
break;
}
- i830_kernel_lost_context(dev);
if (nbox > I830_NR_SAREA_CLIPRECTS)
nbox = I830_NR_SAREA_CLIPRECTS;
@@ -911,23 +1065,72 @@
BEGIN_LP_RING( 8 );
OUT_RING( CMD );
OUT_RING( BR13 );
+ OUT_RING( (pbox->y1 << 16) | pbox->x1 );
+ OUT_RING( (pbox->y2 << 16) | pbox->x2 );
- OUT_RING( (pbox->y1 << 16) |
- pbox->x1 );
- OUT_RING( (pbox->y2 << 16) |
- pbox->x2 );
-
- OUT_RING( dev_priv->front_offset );
- OUT_RING( (pbox->y1 << 16) |
- pbox->x1 );
+ if (dev_priv->current_page == 0)
+ OUT_RING( dev_priv->front_offset );
+ else
+ OUT_RING( dev_priv->back_offset );
+ OUT_RING( (pbox->y1 << 16) | pbox->x1 );
OUT_RING( BR13 & 0xffff );
- OUT_RING( ofs );
+
+ if (dev_priv->current_page == 0)
+ OUT_RING( dev_priv->back_offset );
+ else
+ OUT_RING( dev_priv->front_offset );
ADVANCE_LP_RING();
}
}
+static void i830_dma_dispatch_flip( drm_device_t *dev )
+{
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ RING_LOCALS;
+
+ DRM_DEBUG( "%s: page=%d pfCurrentPage=%d\n",
+ __FUNCTION__,
+ dev_priv->current_page,
+ dev_priv->sarea_priv->pf_current_page);
+
+ i830_kernel_lost_context(dev);
+
+ if (dev_priv->do_boxes) {
+ dev_priv->sarea_priv->perf_boxes |= I830_BOX_FLIP;
+ i830_cp_performance_boxes( dev );
+ }
+
+
+ BEGIN_LP_RING( 2 );
+ OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE );
+ OUT_RING( 0 );
+ ADVANCE_LP_RING();
+
+ BEGIN_LP_RING( 6 );
+ OUT_RING( CMD_OP_DISPLAYBUFFER_INFO | ASYNC_FLIP );
+ OUT_RING( 0 );
+ if ( dev_priv->current_page == 0 ) {
+ OUT_RING( dev_priv->back_offset );
+ dev_priv->current_page = 1;
+ } else {
+ OUT_RING( dev_priv->front_offset );
+ dev_priv->current_page = 0;
+ }
+ OUT_RING(0);
+ ADVANCE_LP_RING();
+
+
+ BEGIN_LP_RING( 2 );
+ OUT_RING( MI_WAIT_FOR_EVENT |
+ MI_WAIT_FOR_PLANE_A_FLIP );
+ OUT_RING( 0 );
+ ADVANCE_LP_RING();
+
+
+ dev_priv->sarea_priv->pf_current_page = dev_priv->current_page;
+}
static void i830_dma_dispatch_vertex(drm_device_t *dev,
drm_buf_t *buf,
@@ -980,8 +1183,10 @@
sarea_priv->vertex_prim |
((used/4)-2));
- vp[used/4] = MI_BATCH_BUFFER_END;
- used += 4;
+ if (dev_priv->use_mi_batchbuffer_start) {
+ vp[used/4] = MI_BATCH_BUFFER_END;
+ used += 4;
+ }
if (used & 4) {
vp[used/4] = 0;
@@ -1004,11 +1209,21 @@
ADVANCE_LP_RING();
}
- BEGIN_LP_RING(2);
- OUT_RING( MI_BATCH_BUFFER_START | (2<<6) );
- OUT_RING( start | MI_BATCH_NON_SECURE );
- ADVANCE_LP_RING();
-
+ if (dev_priv->use_mi_batchbuffer_start) {
+ BEGIN_LP_RING(2);
+ OUT_RING( MI_BATCH_BUFFER_START | (2<<6) );
+ OUT_RING( start | MI_BATCH_NON_SECURE );
+ ADVANCE_LP_RING();
+ }
+ else {
+ BEGIN_LP_RING(4);
+ OUT_RING( MI_BATCH_BUFFER );
+ OUT_RING( start | MI_BATCH_NON_SECURE );
+ OUT_RING( start + used - 4 );
+ OUT_RING( 0 );
+ ADVANCE_LP_RING();
+ }
+
} while (++i < nbox);
}
@@ -1046,7 +1261,7 @@
OUT_RING( 0 );
ADVANCE_LP_RING();
- i830_wait_ring( dev, dev_priv->ring.Size - 8 );
+ i830_wait_ring( dev, dev_priv->ring.Size - 8, __FUNCTION__ );
}
static int i830_flush_queue(drm_device_t *dev)
@@ -1063,7 +1278,7 @@
OUT_RING( 0 );
ADVANCE_LP_RING();
- i830_wait_ring( dev, dev_priv->ring.Size - 8 );
+ i830_wait_ring( dev, dev_priv->ring.Size - 8, __FUNCTION__ );
for (i = 0; i < dma->buf_count; i++) {
drm_buf_t *buf = dma->buflist[ i ];
@@ -1203,6 +1418,53 @@
return 0;
}
+
+
+/* Not sure why this isn't set all the time:
+ */
+static void i830_do_init_pageflip( drm_device_t *dev )
+{
+ drm_i830_private_t *dev_priv = dev->dev_private;
+
+ DRM_DEBUG("%s\n", __FUNCTION__);
+ dev_priv->page_flipping = 1;
+ dev_priv->current_page = 0;
+ dev_priv->sarea_priv->pf_current_page = dev_priv->current_page;
+}
+
+int i830_do_cleanup_pageflip( drm_device_t *dev )
+{
+ drm_i830_private_t *dev_priv = dev->dev_private;
+
+ DRM_DEBUG("%s\n", __FUNCTION__);
+ if (dev_priv->current_page != 0)
+ i830_dma_dispatch_flip( dev );
+
+ dev_priv->page_flipping = 0;
+ return 0;
+}
+
+int i830_flip_bufs(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i830_private_t *dev_priv = dev->dev_private;
+
+ DRM_DEBUG("%s\n", __FUNCTION__);
+
+ if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+ DRM_ERROR("i830_flip_buf called without lock held\n");
+ return -EINVAL;
+ }
+
+ if (!dev_priv->page_flipping)
+ i830_do_init_pageflip( dev );
+
+ i830_dma_dispatch_flip( dev );
+ return 0;
+}
+
int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
@@ -1266,3 +1528,66 @@
{
return 0;
}
+
+
+
+int i830_getparam( struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg )
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ drm_i830_getparam_t param;
+ int value;
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return -EINVAL;
+ }
+
+ if (copy_from_user(¶m, (drm_i830_getparam_t *)arg, sizeof(param) ))
+ return -EFAULT;
+
+ switch( param.param ) {
+ case I830_PARAM_IRQ_ACTIVE:
+ value = dev->irq ? 1 : 0;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if ( copy_to_user( param.value, &value, sizeof(int) ) ) {
+ DRM_ERROR( "copy_to_user\n" );
+ return -EFAULT;
+ }
+
+ return 0;
+}
+
+
+int i830_setparam( struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg )
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ drm_i830_setparam_t param;
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return -EINVAL;
+ }
+
+ if (copy_from_user(¶m, (drm_i830_setparam_t *)arg, sizeof(param) ))
+ return -EFAULT;
+
+ switch( param.param ) {
+ case I830_SETPARAM_USE_MI_BATCHBUFFER_START:
+ dev_priv->use_mi_batchbuffer_start = param.value;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
diff -urN linux-2.4.20/drivers/char/drm.org/i830_drm.h linux-2.4.20/drivers/char/drm/i830_drm.h
--- linux-2.4.20/drivers/char/drm.org/i830_drm.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/i830_drm.h 2002-12-12 12:27:37.000000000 +0100
@@ -3,6 +3,9 @@
/* WARNING: These defines must be the same as what the Xserver uses.
* if you change them, you must change the defines in the Xserver.
+ *
+ * KW: Actually, you can't ever change them because doing so would
+ * break backwards compatibility.
*/
#ifndef _I830_DEFINES_
@@ -18,14 +21,12 @@
#define I830_NR_TEX_REGIONS 64
#define I830_LOG_MIN_TEX_REGION_SIZE 16
-/* if defining I830_ENABLE_4_TEXTURES, do it in i830_3d_reg.h, too */
-#if !defined(I830_ENABLE_4_TEXTURES)
+/* KW: These aren't correct but someone set them to two and then
+ * released the module. Now we can't change them as doing so would
+ * break backwards compatibility.
+ */
#define I830_TEXTURE_COUNT 2
-#define I830_TEXBLEND_COUNT 2 /* always same as TEXTURE_COUNT? */
-#else /* defined(I830_ENABLE_4_TEXTURES) */
-#define I830_TEXTURE_COUNT 4
-#define I830_TEXBLEND_COUNT 4 /* always same as TEXTURE_COUNT? */
-#endif /* I830_ENABLE_4_TEXTURES */
+#define I830_TEXBLEND_COUNT I830_TEXTURE_COUNT
#define I830_TEXBLEND_SIZE 12 /* (4 args + op) * 2 + COLOR_FACTOR */
@@ -57,6 +58,7 @@
#define I830_UPLOAD_TEXBLEND_MASK 0xf00000
#define I830_UPLOAD_TEX_PALETTE_N(n) (0x1000000 << (n))
#define I830_UPLOAD_TEX_PALETTE_SHARED 0x4000000
+#define I830_UPLOAD_STIPPLE 0x8000000
/* Indices into buf.Setup where various bits of state are mirrored per
* context and per buffer. These can be fired at the card as a unit,
@@ -73,7 +75,6 @@
*/
#define I830_DESTREG_CBUFADDR 0
-/* Invarient */
#define I830_DESTREG_DBUFADDR 1
#define I830_DESTREG_DV0 2
#define I830_DESTREG_DV1 3
@@ -109,6 +110,13 @@
#define I830_CTXREG_MCSB1 16
#define I830_CTX_SETUP_SIZE 17
+/* 1.3: Stipple state
+ */
+#define I830_STPREG_ST0 0
+#define I830_STPREG_ST1 1
+#define I830_STP_SETUP_SIZE 2
+
+
/* Texture state (per tex unit)
*/
@@ -124,6 +132,18 @@
#define I830_TEXREG_MCS 9 /* GFX_OP_MAP_COORD_SETS */
#define I830_TEX_SETUP_SIZE 10
+#define I830_TEXREG_TM0LI 0 /* load immediate 2 texture map n */
+#define I830_TEXREG_TM0S0 1
+#define I830_TEXREG_TM0S1 2
+#define I830_TEXREG_TM0S2 3
+#define I830_TEXREG_TM0S3 4
+#define I830_TEXREG_TM0S4 5
+#define I830_TEXREG_NOP0 6 /* noop */
+#define I830_TEXREG_NOP1 7 /* noop */
+#define I830_TEXREG_NOP2 8 /* noop */
+#define __I830_TEXREG_MCS 9 /* GFX_OP_MAP_COORD_SETS -- shared */
+#define __I830_TEX_SETUP_SIZE 10
+
#define I830_FRONT 0x1
#define I830_BACK 0x2
#define I830_DEPTH 0x4
@@ -199,8 +219,35 @@
int ctxOwner; /* last context to upload state */
int vertex_prim;
+
+ int pf_enabled; /* is pageflipping allowed? */
+ int pf_active;
+ int pf_current_page; /* which buffer is being displayed? */
+
+ int perf_boxes; /* performance boxes to be displayed */
+
+ /* Here's the state for texunits 2,3:
+ */
+ unsigned int TexState2[I830_TEX_SETUP_SIZE];
+ unsigned int TexBlendState2[I830_TEXBLEND_SIZE];
+ unsigned int TexBlendStateWordsUsed2;
+
+ unsigned int TexState3[I830_TEX_SETUP_SIZE];
+ unsigned int TexBlendState3[I830_TEXBLEND_SIZE];
+ unsigned int TexBlendStateWordsUsed3;
+
+ unsigned int StippleState[I830_STP_SETUP_SIZE];
} drm_i830_sarea_t;
+/* Flags for perf_boxes
+ */
+#define I830_BOX_RING_EMPTY 0x1 /* populated by kernel */
+#define I830_BOX_FLIP 0x2 /* populated by kernel */
+#define I830_BOX_WAIT 0x4 /* populated by kernel & client */
+#define I830_BOX_TEXTURE_LOAD 0x8 /* populated by kernel */
+#define I830_BOX_LOST_CONTEXT 0x10 /* populated by client */
+
+
/* I830 specific ioctls
* The device specific ioctl range is 0x40 to 0x79.
*/
@@ -213,6 +260,11 @@
#define DRM_IOCTL_I830_SWAP DRM_IO ( 0x46)
#define DRM_IOCTL_I830_COPY DRM_IOW( 0x47, drm_i830_copy_t)
#define DRM_IOCTL_I830_DOCOPY DRM_IO ( 0x48)
+#define DRM_IOCTL_I830_FLIP DRM_IO ( 0x49)
+#define DRM_IOCTL_I830_IRQ_EMIT DRM_IOWR(0x4a, drm_i830_irq_emit_t)
+#define DRM_IOCTL_I830_IRQ_WAIT DRM_IOW( 0x4b, drm_i830_irq_wait_t)
+#define DRM_IOCTL_I830_GETPARAM DRM_IOWR(0x4c, drm_i830_getparam_t)
+#define DRM_IOCTL_I830_SETPARAM DRM_IOWR(0x4d, drm_i830_setparam_t)
typedef struct _drm_i830_clear {
int clear_color;
@@ -248,4 +300,36 @@
int granted;
} drm_i830_dma_t;
+
+/* 1.3: Userspace can request & wait on irq's:
+ */
+typedef struct drm_i830_irq_emit {
+ int *irq_seq;
+} drm_i830_irq_emit_t;
+
+typedef struct drm_i830_irq_wait {
+ int irq_seq;
+} drm_i830_irq_wait_t;
+
+
+/* 1.3: New ioctl to query kernel params:
+ */
+#define I830_PARAM_IRQ_ACTIVE 1
+
+typedef struct drm_i830_getparam {
+ int param;
+ int *value;
+} drm_i830_getparam_t;
+
+
+/* 1.3: New ioctl to set kernel params:
+ */
+#define I830_SETPARAM_USE_MI_BATCHBUFFER_START 1
+
+typedef struct drm_i830_setparam {
+ int param;
+ int value;
+} drm_i830_setparam_t;
+
+
#endif /* _I830_DRM_H_ */
diff -urN linux-2.4.20/drivers/char/drm.org/i830_drv.h linux-2.4.20/drivers/char/drm/i830_drv.h
--- linux-2.4.20/drivers/char/drm.org/i830_drv.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/i830_drv.h 2002-12-12 12:27:37.000000000 +0100
@@ -78,6 +78,19 @@
int back_pitch;
int depth_pitch;
unsigned int cpp;
+
+ int do_boxes;
+ int dma_used;
+
+ int current_page;
+ int page_flipping;
+
+ wait_queue_head_t irq_queue;
+ atomic_t irq_received;
+ atomic_t irq_emitted;
+
+ int use_mi_batchbuffer_start;
+
} drm_i830_private_t;
/* i830_dma.c */
@@ -108,6 +121,23 @@
extern int i830_clear_bufs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
+extern int i830_flip_bufs(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+
+extern int i830_getparam( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg );
+
+extern int i830_setparam( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg );
+
+/* i830_irq.c */
+extern int i830_irq_emit( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg );
+extern int i830_irq_wait( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg );
+extern int i830_wait_irq(drm_device_t *dev, int irq_nr);
+extern int i830_emit_irq(drm_device_t *dev);
+
#define I830_BASE(reg) ((unsigned long) \
dev_priv->mmio_map->handle)
@@ -119,12 +149,53 @@
#define I830_READ16(reg) I830_DEREF16(reg)
#define I830_WRITE16(reg,val) do { I830_DEREF16(reg) = val; } while (0)
+
+
+#define I830_VERBOSE 0
+
+#define RING_LOCALS unsigned int outring, ringmask, outcount; \
+ volatile char *virt;
+
+#define BEGIN_LP_RING(n) do { \
+ if (I830_VERBOSE) \
+ printk("BEGIN_LP_RING(%d) in %s\n", \
+ n, __FUNCTION__); \
+ if (dev_priv->ring.space < n*4) \
+ i830_wait_ring(dev, n*4, __FUNCTION__); \
+ outcount = 0; \
+ outring = dev_priv->ring.tail; \
+ ringmask = dev_priv->ring.tail_mask; \
+ virt = dev_priv->ring.virtual_start; \
+} while (0)
+
+
+#define OUT_RING(n) do { \
+ if (I830_VERBOSE) printk(" OUT_RING %x\n", (int)(n)); \
+ *(volatile unsigned int *)(virt + outring) = n; \
+ outcount++; \
+ outring += 4; \
+ outring &= ringmask; \
+} while (0)
+
+#define ADVANCE_LP_RING() do { \
+ if (I830_VERBOSE) printk("ADVANCE_LP_RING %x\n", outring); \
+ dev_priv->ring.tail = outring; \
+ dev_priv->ring.space -= outcount * 4; \
+ I830_WRITE(LP_RING + RING_TAIL, outring); \
+} while(0)
+
+extern int i830_wait_ring(drm_device_t *dev, int n, const char *caller);
+
+
#define GFX_OP_USER_INTERRUPT ((0<<29)|(2<<23))
#define GFX_OP_BREAKPOINT_INTERRUPT ((0<<29)|(1<<23))
#define CMD_REPORT_HEAD (7<<23)
#define CMD_STORE_DWORD_IDX ((0x21<<23) | 0x1)
#define CMD_OP_BATCH_BUFFER ((0x0<<29)|(0x30<<23)|0x1)
+#define STATE3D_LOAD_STATE_IMMEDIATE_2 ((0x3<<29)|(0x1d<<24)|(0x03<<16))
+#define LOAD_TEXTURE_MAP0 (1<<11)
+
#define INST_PARSER_CLIENT 0x00000000
#define INST_OP_FLUSH 0x02000000
#define INST_FLUSH_MAP_CACHE 0x00000001
@@ -140,6 +211,9 @@
#define I830REG_INT_MASK_R 0x020a8
#define I830REG_INT_ENABLE_R 0x020a0
+#define I830_IRQ_RESERVED ((1<<13)|(3<<2))
+
+
#define LP_RING 0x2030
#define HP_RING 0x2040
#define RING_TAIL 0x00
@@ -182,6 +256,9 @@
#define CMD_OP_DESTBUFFER_INFO ((0x3<<29)|(0x1d<<24)|(0x8e<<16)|1)
+#define CMD_OP_DISPLAYBUFFER_INFO ((0x0<<29)|(0x14<<23)|2)
+#define ASYNC_FLIP (1<<22)
+
#define CMD_3D (0x3<<29)
#define STATE3D_CONST_BLEND_COLOR_CMD (CMD_3D|(0x1d<<24)|(0x88<<16))
#define STATE3D_MAP_COORD_SETBIND_CMD (CMD_3D|(0x1d<<24)|(0x02<<16))
@@ -213,6 +290,11 @@
#define MI_BATCH_BUFFER_END (0xA<<23)
#define MI_BATCH_NON_SECURE (1)
+#define MI_WAIT_FOR_EVENT ((0x3<<23))
+#define MI_WAIT_FOR_PLANE_A_FLIP (1<<2)
+#define MI_WAIT_FOR_PLANE_A_SCANLINES (1<<1)
+
+#define MI_LOAD_SCAN_LINES_INCL ((0x12<<23))
#endif
diff -urN linux-2.4.20/drivers/char/drm.org/i830.h linux-2.4.20/drivers/char/drm/i830.h
--- linux-2.4.20/drivers/char/drm.org/i830.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/i830.h 2002-12-12 12:27:37.000000000 +0100
@@ -45,22 +45,37 @@
#define DRIVER_NAME "i830"
#define DRIVER_DESC "Intel 830M"
-#define DRIVER_DATE "20020828"
+#define DRIVER_DATE "20021108"
+/* Interface history:
+ *
+ * 1.1: Original.
+ * 1.2: ?
+ * 1.3: New irq emit/wait ioctls.
+ * New pageflip ioctl.
+ * New getparam ioctl.
+ * State for texunits 3&4 in sarea.
+ * New (alternative) layout for texture state.
+ */
#define DRIVER_MAJOR 1
-#define DRIVER_MINOR 2
-#define DRIVER_PATCHLEVEL 1
+#define DRIVER_MINOR 3
+#define DRIVER_PATCHLEVEL 2
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_I830_INIT)] = { i830_dma_init, 1, 1 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I830_VERTEX)] = { i830_dma_vertex, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I830_CLEAR)] = { i830_clear_bufs, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I830_FLUSH)] = { i830_flush_ioctl, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I830_GETAGE)] = { i830_getage, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_VERTEX)] = { i830_dma_vertex, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_CLEAR)] = { i830_clear_bufs, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_FLUSH)] = { i830_flush_ioctl, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_GETAGE)] = { i830_getage, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I830_GETBUF)] = { i830_getbuf, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I830_SWAP)] = { i830_swap_bufs, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I830_COPY)] = { i830_copybuf, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I830_DOCOPY)] = { i830_docopy, 1, 0 },
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_SWAP)] = { i830_swap_bufs, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_COPY)] = { i830_copybuf, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_DOCOPY)] = { i830_docopy, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_FLIP)] = { i830_flip_bufs, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_IRQ_EMIT)] = { i830_irq_emit, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_IRQ_WAIT)] = { i830_irq_wait, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
@@ -87,10 +102,49 @@
i830_dma_quiescent( dev ); \
} while (0)
-/* Don't need an irq any more. The template code will make sure that
- * a noop stub is generated for compatibility.
+
+/* Driver will work either way: IRQ's save cpu time when waiting for
+ * the card, but are subject to subtle interactions between bios,
+ * hardware and the driver.
+ */
+#define USE_IRQS 0
+
+
+#if USE_IRQS
+#define __HAVE_DMA_IRQ 1
+#define __HAVE_SHARED_IRQ 1
+
+#define DRIVER_PREINSTALL() do { \
+ drm_i830_private_t *dev_priv = \
+ (drm_i830_private_t *)dev->dev_private; \
+ \
+ I830_WRITE16( I830REG_HWSTAM, 0xffff ); \
+ I830_WRITE16( I830REG_INT_MASK_R, 0x0 ); \
+ I830_WRITE16( I830REG_INT_ENABLE_R, 0x0 ); \
+} while (0)
+
+
+#define DRIVER_POSTINSTALL() do { \
+ drm_i830_private_t *dev_priv = \
+ (drm_i830_private_t *)dev->dev_private; \
+ I830_WRITE16( I830REG_INT_ENABLE_R, 0x2 ); \
+ atomic_set(&dev_priv->irq_received, 0); \
+ atomic_set(&dev_priv->irq_emitted, 0); \
+ init_waitqueue_head(&dev_priv->irq_queue); \
+} while (0)
+
+
+/* This gets called too late to be useful: dev_priv has already been
+ * freed.
*/
-#define __HAVE_DMA_IRQ 0
+#define DRIVER_UNINSTALL() do { \
+} while (0)
+
+#else
+#define __HAVE_DMA_IRQ 0
+#endif
+
+
/* Buffer customization:
*/
diff -urN linux-2.4.20/drivers/char/drm.org/i830_irq.c linux-2.4.20/drivers/char/drm/i830_irq.c
--- linux-2.4.20/drivers/char/drm.org/i830_irq.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/i830_irq.c 2002-12-12 12:27:37.000000000 +0100
@@ -0,0 +1,178 @@
+/* i830_dma.c -- DMA support for the I830 -*- linux-c -*-
+ *
+ * Copyright 2002 Tungsten Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+
+#include "i830.h"
+#include "drmP.h"
+#include "drm.h"
+#include "i830_drm.h"
+#include "i830_drv.h"
+#include <linux/interrupt.h> /* For task queue support */
+#include <linux/delay.h>
+
+
+void DRM(dma_service)(int irq, void *device, struct pt_regs *regs)
+{
+ drm_device_t *dev = (drm_device_t *)device;
+ drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
+ u16 temp;
+
+ temp = I830_READ16(I830REG_INT_IDENTITY_R);
+ printk("%s: %x\n", __FUNCTION__, temp);
+
+ if(temp == 0)
+ return;
+
+ I830_WRITE16(I830REG_INT_IDENTITY_R, temp);
+
+ if (temp & 2) {
+ atomic_inc(&dev_priv->irq_received);
+ wake_up_interruptible(&dev_priv->irq_queue);
+ }
+}
+
+
+int i830_emit_irq(drm_device_t *dev)
+{
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ RING_LOCALS;
+
+ DRM_DEBUG("%s\n", __FUNCTION__);
+
+ atomic_inc(&dev_priv->irq_emitted);
+
+ BEGIN_LP_RING(2);
+ OUT_RING( 0 );
+ OUT_RING( GFX_OP_USER_INTERRUPT );
+ ADVANCE_LP_RING();
+
+ return atomic_read(&dev_priv->irq_emitted);
+}
+
+
+int i830_wait_irq(drm_device_t *dev, int irq_nr)
+{
+ drm_i830_private_t *dev_priv =
+ (drm_i830_private_t *)dev->dev_private;
+ DECLARE_WAITQUEUE(entry, current);
+ unsigned long end = jiffies + HZ*3;
+ int ret = 0;
+
+ DRM_DEBUG("%s\n", __FUNCTION__);
+
+ if (atomic_read(&dev_priv->irq_received) >= irq_nr)
+ return 0;
+
+ dev_priv->sarea_priv->perf_boxes |= I830_BOX_WAIT;
+
+ add_wait_queue(&dev_priv->irq_queue, &entry);
+
+ for (;;) {
+ current->state = TASK_INTERRUPTIBLE;
+ if (atomic_read(&dev_priv->irq_received) >= irq_nr)
+ break;
+ if (time_after(jiffies, end)) {
+ DRM_ERROR("timeout iir %x imr %x ier %x hwstam %x\n",
+ I830_READ16( I830REG_INT_IDENTITY_R ),
+ I830_READ16( I830REG_INT_MASK_R ),
+ I830_READ16( I830REG_INT_ENABLE_R ),
+ I830_READ16( I830REG_HWSTAM ));
+
+ ret = -EBUSY; /* Lockup? Missed irq? */
+ break;
+ }
+ schedule_timeout(HZ*3);
+ if (signal_pending(current)) {
+ ret = -EINTR;
+ break;
+ }
+ }
+
+ current->state = TASK_RUNNING;
+ remove_wait_queue(&dev_priv->irq_queue, &entry);
+ return ret;
+}
+
+
+/* Needs the lock as it touches the ring.
+ */
+int i830_irq_emit( struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg )
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ drm_i830_irq_emit_t emit;
+ int result;
+
+ if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+ DRM_ERROR("i830_irq_emit called without lock held\n");
+ return -EINVAL;
+ }
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return -EINVAL;
+ }
+
+ if (copy_from_user( &emit, (drm_i830_irq_emit_t *)arg, sizeof(emit) ))
+ return -EFAULT;
+
+ result = i830_emit_irq( dev );
+
+ if ( copy_to_user( emit.irq_seq, &result, sizeof(int) ) ) {
+ DRM_ERROR( "copy_to_user\n" );
+ return -EFAULT;
+ }
+
+ return 0;
+}
+
+
+/* Doesn't need the hardware lock.
+ */
+int i830_irq_wait( struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg )
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i830_private_t *dev_priv = dev->dev_private;
+ drm_i830_irq_wait_t irqwait;
+
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return -EINVAL;
+ }
+
+ if (copy_from_user( &irqwait, (drm_i830_irq_wait_t *)arg,
+ sizeof(irqwait) ))
+ return -EFAULT;
+
+ return i830_wait_irq( dev, irqwait.irq_seq );
+}
+
diff -urN linux-2.4.20/drivers/char/drm.org/Makefile linux-2.4.20/drivers/char/drm/Makefile
--- linux-2.4.20/drivers/char/drm.org/Makefile 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/Makefile 2002-12-12 12:27:37.000000000 +0100
@@ -10,7 +10,7 @@
r128-objs := r128_drv.o r128_cce.o r128_state.o
mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o
i810-objs := i810_drv.o i810_dma.o
-i830-objs := i830_drv.o i830_dma.o
+i830-objs := i830_drv.o i830_dma.o i830_irq.o
radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o
ffb-objs := ffb_drv.o ffb_context.o
diff -urN linux-2.4.20/drivers/char/drm.org/r128_drv.h linux-2.4.20/drivers/char/drm/r128_drv.h
--- linux-2.4.20/drivers/char/drm.org/r128_drv.h 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/r128_drv.h 2002-12-12 12:27:37.000000000 +0100
@@ -438,6 +438,7 @@
return -EBUSY; \
} \
__ring_space_done: ; \
+ break; \
} while (0)
#define VB_AGE_TEST_WITH_RETURN( dev_priv ) \
diff -urN linux-2.4.20/drivers/char/drm.org/radeon_irq.c linux-2.4.20/drivers/char/drm/radeon_irq.c
--- linux-2.4.20/drivers/char/drm.org/radeon_irq.c 2002-12-12 12:26:53.000000000 +0100
+++ linux-2.4.20/drivers/char/drm/radeon_irq.c 2002-12-12 12:27:37.000000000 +0100
@@ -71,13 +71,12 @@
wake_up_interruptible( &dev_priv->swi_queue );
}
-#if __HAVE_VBL_IRQ
/* VBLANK interrupt */
if (stat & RADEON_CRTC_VBLANK_STAT) {
atomic_inc(&dev->vbl_received);
wake_up_interruptible(&dev->vbl_queue);
+ DRM(vbl_send_signals)(dev);
}
-#endif
/* Acknowledge all the bits in GEN_INT_STATUS -- seem to get
* more than we asked for...
@@ -139,7 +138,6 @@
}
-#if __HAVE_VBL_IRQ
int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
{
drm_radeon_private_t *dev_priv =
@@ -162,13 +160,12 @@
*/
DRM_WAIT_ON( ret, dev->vbl_queue, 3*HZ,
( ( ( cur_vblank = atomic_read(&dev->vbl_received ) )
- + ~*sequence + 1 ) <= (1<<23) ) );
+ - ~*sequence + 1 ) <= (1<<23) ) );
*sequence = cur_vblank;
return ret;
}
-#endif
/* Needs the lock as it touches the ring.
^ permalink raw reply
* Re: File still being accessed?
From: Alex Riesen @ 2002-12-12 11:37 UTC (permalink / raw)
To: mdew; +Cc: linux-kernel, chuchelo
In-Reply-To: <1039690223.463.11.camel@nirvana>
mdew, Thu, Dec 12, 2002 11:50:19 +0100:
> > > Under Linux 2.5.51 Ive noticed that Downloader4X (Getright-type for
> > > linux) http://www.krasu.ru/soft/chuchelo/
> > >
> > > when trying to resume a file, It thinks the file is still being
> > > accessed, however under 2.4, it has no such problem. Is this a bug in
> > > 2.5.x still? any patches available that could help?
> > which d4x version, what _exactly_ the message states?
> > -alex
> I've tried both D4X GTK2 (2.4.0-rc1) based and GTK1.2.x (1.3.0) based, same results.
>
> I add a download, let it partially download, then press
> "Continue/Restart Downloads"
>
> -> Retry 1 ...
> -> Trying to connect...
> -> Socket was opened!
> -> Trying to create a file
> + File was created!
> !! File is already opened by another download!
> !! Downloading was failed...
The problem is advisory file locking. I'll try to debug
it later, but something changed in how
fcntl(fd, F_SETLK,{...,F_WRLCK,...}) works. It return an
error now. Or maybe d4x just fails to unlock it, it doesn't
check if unlock failed.
The program doesn't show the real value of errno, just
handles EINVAL and ENOLCK, so exact analisys is not possible
apart something bad happened ("is already opened").
The EINTR case, for instance, would cause similar behaviour.
I suppose d4x just incorrectly uses it, but cannot say anything
for sure.
The maintainer is notified.
-alex
^ permalink raw reply
* Re: PATCH: Four function buttons on DELL Latitude X200
From: James H. Cloos Jr. @ 2002-12-12 11:48 UTC (permalink / raw)
To: Vojtech Pavlik; +Cc: Pavel Machek, H. Peter Anvin, linux-kernel
In-Reply-To: <20021212094334.A1403@ucw.cz>
>>>>> "Vojtech" == Vojtech Pavlik <vojtech@suse.cz> writes:
Vojtech> The real question is, when we have these 16-bit (or more bit)
Vojtech> keycodes, how do we export them to the userspace? In cooked
Vojtech> mode, there is no problem, we can extend the keymaps. But
Vojtech> both medium raw and raw modes are pretty much limited in the
Vojtech> number of keys they can carry. See 2.5 keyboard.c for the
Vojtech> current imperfect solution.
Vojtech> IMHO applications which now use raw mode should instead
Vojtech> switch to using the event devices in /dev/input ...
In reference to this, until X is updated to do so, I'm curious about
the changes in the multi-media keys on this i8100 between 2.4 and 2.5.
In 2.4, X sees these as the keycodes (in Xmodmap syntax):
! the four keys at the top
keycode 129 = XF86AudioPlay XF86AudioPause
keycode 130 = XF86AudioStop
keycode 131 = XF86AudioPrev
keycode 132 = XF86AudioNext
! the volume and mute keys;
! order is unknown because in 2.4 the smm system
! catches the keys before X or the kernel can.
keycode 137 = F27
keycode 138 = F28
keycode 139 = F29
! this happens when three keys are hit together
! it was causing my wm to open its menu, so I
! added the below line to force 135 to be ignored.
keycode 135 = XF86Launch0
In 2.5, those (as warned) change radically:
! the four keys at the top
keycode NONE = XF86AudioPlay XF86AudioPause
keycode 162 = XF86AudioStop
keycode NONE = XF86AudioPrev
keycode 114 = XF86AudioNext
! the volume and mute keys;
keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
It is cool that the volume keys become accessible, and no longer need
to be run through the i8k kernel module. But the loss of the play and
prev buttons is curious. Is there a way around that?
-JimC
^ permalink raw reply
* Re: PATCH: Four function buttons on DELL Latitude X200
From: Vojtech Pavlik @ 2002-12-12 11:51 UTC (permalink / raw)
To: James H. Cloos Jr.
Cc: Vojtech Pavlik, Pavel Machek, H. Peter Anvin, linux-kernel
In-Reply-To: <m3fzt35uh7.fsf@lugabout.jhcloos.org>
On Thu, Dec 12, 2002 at 06:48:04AM -0500, James H. Cloos Jr. wrote:
> >>>>> "Vojtech" == Vojtech Pavlik <vojtech@suse.cz> writes:
>
> Vojtech> The real question is, when we have these 16-bit (or more bit)
> Vojtech> keycodes, how do we export them to the userspace? In cooked
> Vojtech> mode, there is no problem, we can extend the keymaps. But
> Vojtech> both medium raw and raw modes are pretty much limited in the
> Vojtech> number of keys they can carry. See 2.5 keyboard.c for the
> Vojtech> current imperfect solution.
>
> Vojtech> IMHO applications which now use raw mode should instead
> Vojtech> switch to using the event devices in /dev/input ...
>
> In reference to this, until X is updated to do so, I'm curious about
> the changes in the multi-media keys on this i8100 between 2.4 and 2.5.
>
> In 2.4, X sees these as the keycodes (in Xmodmap syntax):
>
> ! the four keys at the top
> keycode 129 = XF86AudioPlay XF86AudioPause
> keycode 130 = XF86AudioStop
> keycode 131 = XF86AudioPrev
> keycode 132 = XF86AudioNext
>
> ! the volume and mute keys;
> ! order is unknown because in 2.4 the smm system
> ! catches the keys before X or the kernel can.
> keycode 137 = F27
> keycode 138 = F28
> keycode 139 = F29
>
> ! this happens when three keys are hit together
> ! it was causing my wm to open its menu, so I
> ! added the below line to force 135 to be ignored.
> keycode 135 = XF86Launch0
>
>
> In 2.5, those (as warned) change radically:
>
> ! the four keys at the top
> keycode NONE = XF86AudioPlay XF86AudioPause
> keycode 162 = XF86AudioStop
> keycode NONE = XF86AudioPrev
> keycode 114 = XF86AudioNext
> ! the volume and mute keys;
> keycode 160 = XF86AudioMute
> keycode 174 = XF86AudioLowerVolume
> keycode 176 = XF86AudioRaiseVolume
>
> It is cool that the volume keys become accessible, and no longer need
> to be run through the i8k kernel module. But the loss of the play and
> prev buttons is curious. Is there a way around that?
Do they by any chance produce a kernel warning when pressed?
--
Vojtech Pavlik
SuSE Labs
^ permalink raw reply
* Inserting rules is extremly slow :((
From: nedco @ 2002-12-12 11:46 UTC (permalink / raw)
To: netfilter
Hi,
How to insert fast about 20000 rules in iptables.
If some document will be help , please let me know :)
Thanks a lot
Nedco
^ permalink raw reply
* IPtables Problem
From: Amit Kumar Gupta @ 2002-12-12 11:52 UTC (permalink / raw)
To: netfilter
[-- Attachment #1.1: Type: text/plain, Size: 141 bytes --]
Hi List,
Can somebody tell me what are all possible ways using IPTables to detect
malicious activities?
Thanks & Regards,
Amit
[-- Attachment #1.2: Type: text/html, Size: 3649 bytes --]
[-- Attachment #2: Wipro_Disclaimer.txt --]
[-- Type: text/plain, Size: 514 bytes --]
**************************Disclaimer************************************************
Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by the individual
or entity to which it is addressed. You are notified that any use, copying
or dissemination of the information contained in the E-MAIL in any manner
whatsoever is strictly prohibited.
***************************************************************************************
^ permalink raw reply
* Re: 2.5.51 ide module problem (fwd)
From: Alan Cox @ 2002-12-12 12:38 UTC (permalink / raw)
To: Rusty Russell; +Cc: Jeff Chua, Adam J. Richter, Linux Kernel Mailing List
In-Reply-To: <20021212094909.67D3D2C0F7@lists.samba.org>
On Thu, 2002-12-12 at 09:48, Rusty Russell wrote:
> And you will continue to. There really is a loop, which means neither
> module can be loaded (ide_dump_status is in ide.ko, and ide-io.ko wants
> it, however ide.ko uses lots of things in ide-io.ko). However, this
> patch will stop depmod from crashing.
>
> Ask the IDE people,
The module changes basically left me unable to do any further 2.5.5x
work at an acceptable rate. My time is now allocated to other projects
until January. At that point hopefully the module stuff will be usable
again, parameters will work etc and I can go back to work on 2.5.
Rusty is right that the ide stuff has dependancy loops right now. His
new module stuff shouldn't have crashed but the fundamental work to be
done is in the IDE layer. There are also some locking problems to
address before modular IDE becomes useful.
Alan
^ permalink raw reply
* Re: using 2 TB in real life
From: Mike Black @ 2002-12-12 12:03 UTC (permalink / raw)
To: Anders Henke, linux-kernel
In-Reply-To: <20021212111237.GA12143@schlund.de>
Looks like it's already handled in 2.5.
Here's a patch for 2.4:
http://www.gelato.unsw.edu.au/patches-index.html
----- Original Message -----
From: "Anders Henke" <anders.henke@sysiphus.de>
To: <linux-kernel@vger.kernel.org>
Sent: Thursday, December 12, 2002 6:12 AM
Subject: using 2 TB in real life
> I've just added a 1.9 TB array to one of my servers (running 2.4.20,
> the device is an 12bay-IFT IDE-to-Fibre-RAID connected via a
> Qlogic 2300 HBA):
>
> Disk /dev/sdb: 255 heads, 63 sectors, 247422 cylinders
> Units = cylinders of 16065 * 512 bytes
>
> Device Boot Start End Blocks Id System
> /dev/sdb1 1 247422 1987417183+ 83 Linux
> [...]
> Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
> SCSI device sdb: -320126976 512-byte hdwr sectors (-163904 MB)
> sdb: sdb1
>
>
> Another array (1.2 TB) gives almost the same effect:
> Disk /dev/sdb: 255 heads, 63 sectors, 157450 cylinders
> Units = cylinders of 16065 * 512 bytes
>
> Device Boot Start End Blocks Id System
> /dev/sdb1 1 157450 1264717093+ 83 Linux
> [...]
> Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
> SCSI device sdb: -1765523456 512-byte hdwr sectors (195564 MB)
> sdb: sdb1
>
> These issues arise when using arrays larger than around 0.5 T;
> nevertheless, these devices do work fine with both xfs or ext3,
> it's "just" a cosmetical issue. However, this negative
> values make one feel like Linux isn't truely capable of using up to
> 2 TB of disk devices and so this should be resolved.
> To me it seems that sd.c doesn't know how to calculate the
> correct values for such beasts - any ideas?
>
>
> Regards
>
> Anders
> --
> http://sysiphus.de/
> -
> 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
* Re: linux source tree customized under sde cross tools..
From: Hartvig Ekner @ 2002-12-12 11:56 UTC (permalink / raw)
To: atulsrivastava9; +Cc: linux-mips
In-Reply-To: <20021212104626.6013.qmail@webmail36.rediffmail.com>
If you use the sde cross environment (x86 RPMs) provided on our latest
RedHat 7.3/MIPS release, it works just fine. Can be found at:
ftp.mips.com:/pub/linux/mips/installation/redhat7.3/01.00
/Hartvig
atul srivastava writes:
>
> Hello,
>
> does anybody using linux source tree customized for
> sde-gcc(algorithnmics) cross compilation environment..
>
> earlier i was using mips-linux-* toolset but due to
> some definite reasons now my cross tools are sde-*
> I am consistently facing some certain compiling problems
> with sde-gcc flags and asembler options..
>
> Best Regards,
> Ashish
^ permalink raw reply
* Re: "bio too big" error
From: Joe Thornber @ 2002-12-12 12:08 UTC (permalink / raw)
To: Wil Reichert; +Cc: linux-kernel
In-Reply-To: <1039572597.459.82.camel@darwin>
On Tue, Dec 10, 2002 at 09:17:45PM -0500, Wil Reichert wrote:
> Hi,
>
> I'm getting a "bio too big" error with 2.5.50. I've got a 330G lvm2
> partition formatted with ext3 using the -T largefile4 parameter.
> Everything seems ok at first, but any sort of access will die very
> unhappily with said error messsage after about 10 seconds of operation
> or so. The only google search results are the patch submission. Eeek.
Could you try the patchset below please ? (you may need to knock out
patch 5 until we get to the bottom of that particular bug).
http://people.sistina.com/~thornber/patches/2.5-stable/2.5.51/2.5.51-dm-2.tar.bz2
- Joe
^ permalink raw reply
* Re: i4l dtmf errors
From: Matti Aarnio @ 2002-12-12 12:10 UTC (permalink / raw)
To: Roy Sigurd Karlsbakk, Kernel mailing list
In-Reply-To: <200212121145.26108.roy@karlsbakk.net>
This is possibly more of linux-isdn@vger.kernel.org list thing,
than linux-kernel per se.
On Thu, Dec 12, 2002 at 11:45:26AM +0100, Roy Sigurd Karlsbakk wrote:
> hi
>
> it seems isdn4linux detects DTMF tones from normal speach. This is rather
> annoying when using i4l for voice with Asterisk.org. This is tested on all
> recent kernels
>
> see thread "[MGCP] Asterisk/D-Link phones generates ugly DTMF tones!!!" at
> http://www.marko.net/asterisk/archives/ for more info.
Quick reading of drivers/isdn/isdn_audio.c(*) shows that it does use
fixed-point Görtzel (Goertzel in english) algorithm for detecting
tones, but it does _not_ do comparison of received overall signal
power vs. detected DTMF tone powers.
When there is signal power outside the DTMF channels, signal should
not be detected. Also, DTMF tone powers should be roughly equal,
and exactly two tones should be present for valid detection.
http://www.numerix-dsp.com/goertzel.html
Adding those power tests should be fairly trivial, but I leave it
to Somebody Else...
(*) kernel version I looked upon was 2.4.16-0.11custom -- some RH kernel
> roy
> --
> Roy Sigurd Karlsbakk, Datavaktmester
> ProntoTV AS - http://www.pronto.tv/
> Tel: +47 9801 3356
/Matti Aarnio
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.