Linux-Development-Sys Digest #815, Volume #7      Mon, 1 May 00 16:13:15 EDT

Contents:
  Re: Locking user space buffers. (Bill Waddington)
  Re: cli() & sti()... (Bill Waddington)
  Re: Struct size and allocate problem! need help. (Geoff Johnson)
  Cannot compile fs/super.c in linux-2.3.99-pre7-1 (Christian 
=?iso-8859-1?Q?J=F6nsson?=)
  Where do I submit a kernel patch? ("Mr. Oogie Boogie")
  Re: DMA in Linux device drivers (Tomas Whitlock)
  DMA in Linux device drivers (Tomas Whitlock)
  Re: Read combining on memory-mapped I/O? (Tomas Whitlock)
  Re: Where do I submit a kernel patch? (Matthew Palmer)
  Re: cli() & sti()... (Kaz Kylheku)
  Re: Have new parallel port - but it's PCI!! (Mario Klebsch)
  SCSI error messages (Chetan Ahuja)
  Re: cli() & sti()... (Bill Waddington)
  Re: SMBIOS and Linux 2.2.x ([EMAIL PROTECTED])
  Re: cli() & sti()... (Bill Waddington)

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

From: Bill Waddington <[EMAIL PROTECTED]>
Subject: Re: Locking user space buffers.
Date: Sun, 30 Apr 2000 23:34:17 GMT

In article <[EMAIL PROTECTED]>,
  liran <[EMAIL PROTECTED]> wrote:
> Hi,
> I need to lock user space buffer in the kernel to avoid
> double buffering.
> is it possible?
> where can I read about it.
>
> Thanks Liran.
>
Hello,

Take a look at the kiobuf stuff in 2.3.x.  drivers/char/raw.c is an
example of how to use kiobufs to map and pin user buffers.  I think
there is also a patch available for 2.2.x.

Bill

--
Bill Waddington
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: Bill Waddington <[EMAIL PROTECTED]>
Subject: Re: cli() & sti()...
Date: Sun, 30 Apr 2000 23:55:45 GMT

In article <[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:

[snip]


> This is neatly analogous to releasing a mutex when waiting on a
condition
> variable. (In fact I managed to wrap spinlocks and wait queues behind
> a mutex and condition variable programming interface: see
> http://users.footprints.net/~kaz/lmc.html)
>

Thanks.

This looks like what I have used in the Solaris version of the driver.
All I want to do is launch a DMA (w/end of DMA interrupt) and make sure
that the interrupt code doesn't execute before I am ready to deal with a
wakeup.

With a quick pass through 2.3.99-pre3, I don't find your LMC in the
source tree.  Is it hidden there somewhere?  If not, may I (& the rest
of us) incorporate it in my driver?

Thanks again,

Bill

--
Bill Waddington
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: Geoff Johnson <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux,comp.os.linux.development.apps,comp.unix.sco.misc,comp.unix.sco.programmer,comp.unix.unixware.misc,tw.bbs.comp.linux
Subject: Re: Struct size and allocate problem! need help.
Date: Mon, 01 May 2000 14:45:43 +1000

This works perfectly for me.
I get 10 for sizeof(struct a) and any struct "a" variable or array
element.
UnixWare geoff 5 7.1.0 i386 x86at SCO UNIX_SVR5

Try an array of structures John B wrote:
> 
> semicolon after a3 and a4
> 
> Maruthi Vinjamuri wrote:
> 
> > If you are compiling the following program on Unixware 7.1.0 or
> > later systems, then try running cc with the following option with
> > cc.
> >
> > cc -Zp1 <filename>
> >
> > p1 Selects at least one byte alignment for all structure members;
> > or,
> >           in other words, include no padding.
> >
> > So, you should see 10 as the size of struct a.
> >
> > Jaron wrote:
> >
> > > Hi,
> > >     I encounter a compiling program as below:
> > >
> > >     struct    a {
> > >         unsigned char    a1;
> > >         unsigned char    a2;
> > >         unsigned short    a3
> > >         unsigned short    a4
> > >         unsigned long    a5;
> > >     };
> > >
> > > the structure size must be 10 but use sizeof print out is 12...
> > > I know this is the alignment problem of structure ..
> > > But how to resolve it ?
> > > I need to know the compiler option like -xx ?
> > > do anyone konw about this ?

-- 

Geoff Johnson

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

From: Christian =?iso-8859-1?Q?J=F6nsson?= <[EMAIL PROTECTED]>
Crossposted-To: linux.dev.kernel
Subject: Cannot compile fs/super.c in linux-2.3.99-pre7-1
Date: Mon, 01 May 2000 09:03:17 GMT

On a Red Hat Linux 6.2/Intel system, up to date as of 2000-05-01.

I'm just trying to compile linux-2.3.99-pre6 with pre7-1 patch applied.
It fails with the following errors:

gcc -D__KERNEL__ -I/usr/src/linux-2.3.99-pre7-1/include -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing
-pipe   -march=i686   -c -o super.o super.c
super.c: In function `change_root':
super.c:1549: warning: unused variable `sb'
super.c:1567: `old_root' undeclared (first use in this function)
super.c:1567: (Each undeclared identifier is reported only once
super.c:1567: for each function it appears in.)
super.c:1585: warning: long int format, int arg (arg 2)
super.c:1540: warning: unused variable `old_root_dev'
make[2]: *** [super.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.3.99-pre7-1/fs'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.3.99-pre7-1/fs'
make: *** [_dir_fs] Error 2

Cheers,

/ChJ


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

From: "Mr. Oogie Boogie" <[EMAIL PROTECTED]>
Subject: Where do I submit a kernel patch?
Date: Mon, 01 May 2000 08:25:47 -0400

Howdy,

I'm kind of new to the Linux community but I have a kernel patch that
I'd like to submit.  Could someone tell me who I send it to and if
there is some "official" process I should follow.  My patch effects
inetdevice.h, sysctl.h, ipv4/devinet.c, ipv4/ip_forward.c,
ipv4/sysctl_net_ipv4.c, in case that matters.  Please send reply's to
rpreston at mitre.org.

Thanks for your help,
 
Ralph A. Preston
The MITRE Corporation
202 Burlington Road, MS E015
Bedford, MA 01730-1420

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

From: Tomas Whitlock <[EMAIL PROTECTED]>
Subject: Re: DMA in Linux device drivers
Date: Mon, 01 May 2000 13:29:05 +0000

Sorry, I see somebody else  has posted a message asking much the same
thing!

Will I really have to patch the kernel to get this functionality?? That
would open up several enormous cans of worms if the end user's kernel has
to be patched in order to work with the hardware....

Tomas Whitlock wrote:

> Hi
>
> I am writing a device driver, and have a couple of DMA related kernel
> 2.2.x questions:
>
> 1. Is there a way to 'pagelock' (in other words, force resident in
> physical memory) a buffer in a process' virtual memory space in the same
> way one can pagelock memory in a Windows NT driver? If so, can somebody
> please point me to the relevant header file(s) in the 2.2.x sources?
>
> 2. What is the correct function to call in order to translate a process
> virtual address into a physical address?
>
> I have looked at a couple of drivers, but when performing a DMA I/O
> transfer they first copy the data from/to the process' address space
> into/out of an intermediate kernel space buffer. They then DMA the data
> from/to the kernel space buffer. For various reasons which have nothing
> to do with performance, I can't use this approach in my driver.
>
> Thanks. Any help much appreciated, even if just to say "it can't be
> done" !
>
> Tomas


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

From: Tomas Whitlock <[EMAIL PROTECTED]>
Subject: DMA in Linux device drivers
Date: Mon, 01 May 2000 13:15:20 +0000

Hi

I am writing a device driver, and have a couple of DMA related kernel
2.2.x questions:

1. Is there a way to 'pagelock' (in other words, force resident in
physical memory) a buffer in a process' virtual memory space in the same
way one can pagelock memory in a Windows NT driver? If so, can somebody
please point me to the relevant header file(s) in the 2.2.x sources?

2. What is the correct function to call in order to translate a process
virtual address into a physical address?

I have looked at a couple of drivers, but when performing a DMA I/O
transfer they first copy the data from/to the process' address space
into/out of an intermediate kernel space buffer. They then DMA the data
from/to the kernel space buffer. For various reasons which have nothing
to do with performance, I can't use this approach in my driver.

Thanks. Any help much appreciated, even if just to say "it can't be
done" !

Tomas



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

From: Tomas Whitlock <[EMAIL PROTECTED]>
Subject: Re: Read combining on memory-mapped I/O?
Date: Mon, 01 May 2000 13:54:35 +0000

Hi David

I think the bottleneck preventing you reaching 18 MB/s is the chipset
implementation on most PCs.

In every PC chipset I know of, CPU initiated PCI reads never burst. You will
find that you can probably get figures like 60 MB/s when writing to a decent
video card, but 10 MB/s or less when reading. I guess the CPU simply waits (or
is made to wait) for the requested 32 bit datum before the next PCI read can be
issued.

I don't know of any performance enabling bits you can set in these chipsets to
enable read prefetching or combining. I think if you want 18MB/s or more, you
will have to use DMA.

Tomas



Juergen Fischer wrote:

> x-no-archive: yes
>
> "David Ellsworth" <[EMAIL PROTECTED]> wrote:
>
> > I have an ATI All-in-Wonder Pro and I want to capture a raw, full-framed
> > NTSC video stream. The problem is, the stream goes at just under 18
> > Mbytes/sec, and reading from video memory seems to be limited to ~8
> > Mbytes/sec.
> >
> > There doesn't seem to be any MTRR "read combining" mode, so I tried setting
> > the window of video memory I'm using for video capture
> > (0xE7000000-0xE7FFFFFF) to "write through". This *did* allow me to capture
> > the stream with no drop-outs, but there are two problems:
>
> you got 18mb/s after setting cachemode of vram adressspace to write
> thru ? can you really read vram at 18mb/s ?
>
> what about DMA ?


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

From: [EMAIL PROTECTED] (Matthew Palmer)
Subject: Re: Where do I submit a kernel patch?
Reply-To: [EMAIL PROTECTED]
Date: 1 May 2000 23:00:43 +1000

[posted and mailed]

Mr. Oogie Boogie is of the opinion:
>I'm kind of new to the Linux community but I have a kernel patch that
>I'd like to submit.  Could someone tell me who I send it to and if
>there is some "official" process I should follow.  My patch effects
>inetdevice.h, sysctl.h, ipv4/devinet.c, ipv4/ip_forward.c,
>ipv4/sysctl_net_ipv4.c, in case that matters.  Please send reply's to
>rpreston at mitre.org.

Check MAINTAINERS in the source root directory.  That'll give you the
maintainer for the bit of code you've patched.  It also gives you hints as
to why it won't be acepted first time, every time.


-- 
=======================================================================
#include <disclaimer.h>
Matthew Palmer
[EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: cli() & sti()...
Reply-To: [EMAIL PROTECTED]
Date: Mon, 01 May 2000 16:02:53 GMT

On Sun, 30 Apr 2000 23:55:45 GMT, Bill Waddington
<[EMAIL PROTECTED]> wrote:
>In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] wrote:
>
>[snip]
>
>
>> This is neatly analogous to releasing a mutex when waiting on a
>condition
>> variable. (In fact I managed to wrap spinlocks and wait queues behind
>> a mutex and condition variable programming interface: see
>> http://users.footprints.net/~kaz/lmc.html)
>>
>
>Thanks.
>
>This looks like what I have used in the Solaris version of the driver.

Yes, I heard that similar abstractions are used in the Solaris kernel.

>All I want to do is launch a DMA (w/end of DMA interrupt) and make sure
>that the interrupt code doesn't execute before I am ready to deal with a
>wakeup.
>
>With a quick pass through 2.3.99-pre3, I don't find your LMC in the
>source tree.  Is it hidden there somewhere?  If not, may I (& the rest

It's not; nobody has approached me about incorporating this little library into
the kernel. 

>of us) incorporate it in my driver?

Absolutely. I'd appreciate a success or failure report along with any patches,
if you would not be too inconvenienced. ;)

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED] (Mario Klebsch)
Crossposted-To: comp.os.linux.hardware
Subject: Re: Have new parallel port - but it's PCI!!
Date: Mon, 1 May 2000 13:12:43 +0200

Chris Rankin <au.zipworld.com@{no.spam}rankinc> writes:
>This is the output from lspci:

>00:0e.0 Class 0783: Syba Tech Ltd Multi-IO Card (rev 92) (prog-if 15)
>        Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop-
>ParErr- Stepping- SERR- FastB2B-
>        Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
><TAbort- <MAbort- >SERR- <PERR-
>        Interrupt: pin A routed to IRQ 9
>        Region 0: I/O ports at f800

>I have tried to configure this port as LPT2 by setting the IRQ to 9 and
>the IO to 0x278 in modules.conf.

I am not an expert on this topic, but why are you using 0x278 as
IO-Address?

>        Interrupt: pin A routed to IRQ 9
>        Region 0: I/O ports at f800
                                ^^^^

It seems prety obvious, the I/O-ports are located at 0xf800. Since you
have tried to use 0xf800, my guess would be, that the port layout is
different that for a single parallel port. It seems to be a multi I/O
card. So you probably have some other ports there, too. They cannot
all occupy the I/O address 0xf800.

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]

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

From: Chetan Ahuja <[EMAIL PROTECTED]>
Subject: SCSI error messages
Date: 1 May 2000 17:12:28 GMT

 Hi,
   I posted the following message last week.. no responses yet. There
   was one emailed response asking me for kernel version and SCSI
   version ( can't the SCSI version be uniquely determined from kernel
   version). I did give the kernel version in the previous post (it's
   2.2.14 maybe modified by mandrake but no trace of that at least in
   the scsi  directory in the sources that came with that
   distribution). And  here's the RCSid from the scsi.c   file from
   the sources
   static const char RCSid[] = "$Header: \
   /vger/u4/cvs/linux/drivers/scsi/scsi.c,v 1.38 1997/01/19 23:07 \
   :18 davem Exp $";
   
   Also scsi generic driver version seems to be 2.1.34 (from
   scsi-generic.txt from the Documentation)

   OK here's the real question as posted earlier:

   ------------------- 
   I am getting the following error messages once in a while on the
   console. Although the system seems to be working just fine.
   
   ncr53c875-0: SCSI parity error detected: SCR1=64 DBC=1e000000
   SSTAT1=e
   ncr53c875-0: resetting, command processing suspended for 2 seconds
   ncr53c875-0: enabling clock multiplier
   ncr53c875-0: Downloading SCSI SCRIPTS.
   ncr53c875-0: command processing resumed

    What could this mean...?
    
   The controller is a Symbios card with the 53c875 chipset. There
   are two devices on it. a Seagate  Cheetah ST15150N drive and
   a Panasonic CDR drive. The kernel is the stock kernel that came
   with Mandrake 7.0 ( kernel-2.2.14-15 ).
     
           The output of /proc/scsi/scsi is as follows:

   Vendor: SEAGATE  Model: ST15150N         Rev: 0017
   Type:   Direct-Access                    ANSI SCSI revision: 02
   Host: scsi0 Channel: 00 Id: 02 Lun: 00
   Vendor: MATSHITA Model: CD-R   CW-7503   Rev: 1.06
   Type:   CD-ROM                           ANSI SCSI revision: 02
            

       Another piece of info that might be relevant here is that the
   controller card is sharing the IRQ with an on-board PCI sound chip.
   It's a CMI 8338 sharing IRQ 9 with the SCSI card... Could that be
   causing this. If yes, can I change the IRQ used by the SCSI card by
   passing arguements to the scsi driver at startup or something. I
   haven't been able to find  IRQ setting in the BIOS for the sound chip.

   Or is  this due to bad disk blocks?? Or something to do with the
   controller/cable/driver. What kind of diagnostics can I run to get
   further details??? I have not used SCSI devices with linux much and
   am not conversant with the situation... Any help will be highly
   appreciated... 

     Thanks
     Chetan
     
   








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

From: Bill Waddington <[EMAIL PROTECTED]>
Subject: Re: cli() & sti()...
Date: Mon, 01 May 2000 17:36:15 GMT

In article <[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:
> On Sun, 30 Apr 2000 23:55:45 GMT, Bill Waddington
> <[EMAIL PROTECTED]> wrote:
> >In article <[EMAIL PROTECTED]>,
> >  [EMAIL PROTECTED] wrote:
> >
> >[snip]
> >
> >
> >> This is neatly analogous to releasing a mutex when waiting on a
> >condition
> >> variable. (In fact I managed to wrap spinlocks and wait queues
behind
> >> a mutex and condition variable programming interface: see
> >> http://users.footprints.net/~kaz/lmc.html)
> >>
> >
> >Thanks.
> >
> >This looks like what I have used in the Solaris version of the
driver.
>
> Yes, I heard that similar abstractions are used in the Solaris kernel.
>
> >All I want to do is launch a DMA (w/end of DMA interrupt) and make
sure
> >that the interrupt code doesn't execute before I am ready to deal
with a
> >wakeup.
> >
> >With a quick pass through 2.3.99-pre3, I don't find your LMC in the
> >source tree.  Is it hidden there somewhere?  If not, may I (& the
rest
>
> It's not; nobody has approached me about incorporating this little
library into
> the kernel.
>
> >of us) incorporate it in my driver?
>
> Absolutely. I'd appreciate a success or failure report along with any
patches,
> if you would not be too inconvenienced. ;)
>

Thanks,

I will definitely report back.  Unfortunately, I don't have easy access
to an SMP box at this time, so the immediate effort is to get things
running on a UP box.   Obviously not the best test case.

Forgive me, but I have futher questions.  When I did the original port
from 2.2.12 to 2.3.99-pre3, I noticed a change in the way wait_queues
were initialized and used.  Does your lmc code sing w/2.3.99, or do I
need to make some
mods in the cv part of things?

Sorry for the endless questions. You have been very generous with your
time.

Yours,
Bill

--
Bill Waddington
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED]
Subject: Re: SMBIOS and Linux 2.2.x
Date: Mon, 01 May 2000 17:46:57 GMT

In article <8eg081$1tkf$[EMAIL PROTECTED]>,
  "Harold" <[EMAIL PROTECTED]> wrote:
> Yes, of course. I am doing the same thing
> now.

And? How did you do it?


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: Bill Waddington <[EMAIL PROTECTED]>
Subject: Re: cli() & sti()...
Date: Mon, 01 May 2000 19:41:32 GMT

In article <[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:
> On Sun, 30 Apr 2000 23:55:45 GMT, Bill Waddington
> <[EMAIL PROTECTED]> wrote:
> >In article <[EMAIL PROTECTED]>,
> >  [EMAIL PROTECTED] wrote:
> >
> >[snip]
> >
> >
> >> This is neatly analogous to releasing a mutex when waiting on a
> >condition
> >> variable. (In fact I managed to wrap spinlocks and wait queues
behind
> >> a mutex and condition variable programming interface: see
> >> http://users.footprints.net/~kaz/lmc.html)
> >>
> >
> >Thanks.
> >
> >This looks like what I have used in the Solaris version of the
driver.
>
> Yes, I heard that similar abstractions are used in the Solaris kernel.
>
> >All I want to do is launch a DMA (w/end of DMA interrupt) and make
sure
> >that the interrupt code doesn't execute before I am ready to deal
with a
> >wakeup.
> >
> >With a quick pass through 2.3.99-pre3, I don't find your LMC in the
> >source tree.  Is it hidden there somewhere?  If not, may I (& the
rest
>
> It's not; nobody has approached me about incorporating this little
library into
> the kernel.
>
> >of us) incorporate it in my driver?
>
> Absolutely. I'd appreciate a success or failure report along with any
patches,
> if you would not be too inconvenienced. ;)
>

Hello,

I think I have answered my own question - it will take some minor mods
to play with 2.3.99. Sched.c seems to have the necessary bits and
pieces.  I will press on with the experiment.  Please advise if you
think I am on the wrong track, and again, sorry for all the questions.

Bill

(maybe I need my own NG:  comp.os.linux.bill's.dumb.questions)


--
Bill Waddington
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Sent via Deja.com http://www.deja.com/
Before you buy.

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


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to