floating point problem

2001-07-05 Thread mdaljeet

In Linux PPC, the MSR[FP] bit (that is floating point available bit) is off
(atleast for non-SMP).

Due to this, whenever some floating point instruction is executed in 'user
mode', it leads to a exception 'FPUnavailable'. The exception handler for
this exception apart from setting the MSR[FP] bit, also sets the MSR[FE0]
and MSR[FE1] bits. These bits basically enables the floating point
exceptions so that if there are some floating point exception conditions
encountered while exeuting a floating point instruction, an appropriate
exception is raised.
But whenever some floating point instruction is executed in 'kernel mode',
'FPUnavailabe' exception handler code does not set the 'MSR[FE0] and
MSR[FE1]' bits.

The result is that when we execute a piece of code that executes floating
point instructions with some large values, we get 'floating point
exceptions for overflow etc' but we get some rounded off values when we
execute the same piece of code in a kernel module. We made a modification
in the head.S file and commented out the setting of 'MSR[FE0] and MSR[FE1]'
bits in the 'FPUnavailable' exception handler for user mode. Due to this we
are getting correct results i.e. rounded off values.

Problem is that we want to get the good results without changing the
kernel. Either by having the user mode application to interact with some
special module which can set the MSR[FP] bit before we execute the floating
point instruction or by some other trick.Is there any solution apart
from changing the kernel?

thanks,
Daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



floating point problem

2001-07-05 Thread mdaljeet

In Linux PPC, the MSR[FP] bit (that is floating point available bit) is off
(atleast for non-SMP).

Due to this, whenever some floating point instruction is executed in 'user
mode', it leads to a exception 'FPUnavailable'. The exception handler for
this exception apart from setting the MSR[FP] bit, also sets the MSR[FE0]
and MSR[FE1] bits. These bits basically enables the floating point
exceptions so that if there are some floating point exception conditions
encountered while exeuting a floating point instruction, an appropriate
exception is raised.
But whenever some floating point instruction is executed in 'kernel mode',
'FPUnavailabe' exception handler code does not set the 'MSR[FE0] and
MSR[FE1]' bits.

The result is that when we execute a piece of code that executes floating
point instructions with some large values, we get 'floating point
exceptions for overflow etc' but we get some rounded off values when we
execute the same piece of code in a kernel module. We made a modification
in the head.S file and commented out the setting of 'MSR[FE0] and MSR[FE1]'
bits in the 'FPUnavailable' exception handler for user mode. Due to this we
are getting correct results i.e. rounded off values.

Problem is that we want to get the good results without changing the
kernel. Either by having the user mode application to interact with some
special module which can set the MSR[FP] bit before we execute the floating
point instruction or by some other trick.Is there any solution apart
from changing the kernel?

thanks,
Daljeet.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



virt_to_bus and virt_to_phys on Apple G4 target

2001-07-02 Thread mdaljeet

I am running linux 2.4.2 on Apple G4 machine. I think the 'PCI bus
addresses' and 'physical addresses' are same on this architecture. I
expected the two be different but according to asm/io.h 'virt_to_bus(addr)
= virt_to_phys(addr) + PCI_DRAM_OFFSET'. I printed the value of
'PCI_DRAM_OFFSET' and that come out to be zero. Is this correct?

If I somehow get the physical address of a user space buffer in a module
and take this as a PCI bus address, will I be able to do DMA properly?

thanks,
Daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: mmap

2001-07-02 Thread mdaljeet

I use the 'map_user_kiobuf' and 'lock_kiovec' kernel routines in a module
for 'user space memory'. After that if I pass the
'(iobuf->maplist[0])-mem_map) <<  PAGE_SHIFT)' to the hardware for DMA
operations and it works fine for Intel platforms. Now how can I use the
'iobuf' struct obtained after lock_kiovec operation to get a PCI bus
address that I can pass to hardware for DMA operations on my Apple
machine.?

thanks,
Daljeet.


|+--->
||  Gerd Knorr   |
|||
||   |
||  05/15/01 |
||  01:03 PM |
||  Please   |
||  respond to   |
||  Gerd Knorr   |
||   |
|+--->
  >---|
  |   |
  |   To: [EMAIL PROTECTED]|
  |   cc: (bcc: Daljeet Maini/India/IBM)  |
  |   Subject: Re: mmap   |
  >---|








[EMAIL PROTECTED] wrote:
>  I am doing the following:
>
> malloc some memory is user space
> pass its pointer to some kernel module
> in the kernel module...do a pci_alloc_consistent so that i get a
memory
> region for PCI DMA operations

Wrong approach, you can use kiobufs if you want DMA to the malloc()ed
userspace memory:

 * lock down the user memory using map_user_kiobuf() + lock_kiovec()
   (see linux/iobuf.h).
 * translate the iobuf->maplist into a scatterlist [1]
 * feed pci_map_sg() with the scatterlist to get DMA addresses.
   you can pass to the hardware.

And the reverse to free everything when you are done of course.

  Gerd

[1] IMHO it would be more useful if iobufs would use a scatterlist
instead of an struct page* array.


--
Gerd Knorr <[EMAIL PROTECTED]>  --  SuSE Labs, Außenstelle Berlin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/




Re: mmap

2001-07-02 Thread mdaljeet

I use the 'map_user_kiobuf' and 'lock_kiovec' kernel routines in a module
for 'user space memory'. After that if I pass the
'(iobuf-maplist[0])-mem_map)   PAGE_SHIFT)' to the hardware for DMA
operations and it works fine for Intel platforms. Now how can I use the
'iobuf' struct obtained after lock_kiovec operation to get a PCI bus
address that I can pass to hardware for DMA operations on my Apple
machine.?

thanks,
Daljeet.


|+---
||  Gerd Knorr   |
||  kraxel@bytes|
||  ex.org  |
||   |
||  05/15/01 |
||  01:03 PM |
||  Please   |
||  respond to   |
||  Gerd Knorr   |
||   |
|+---
  ---|
  |   |
  |   To: [EMAIL PROTECTED]|
  |   cc: (bcc: Daljeet Maini/India/IBM)  |
  |   Subject: Re: mmap   |
  ---|








[EMAIL PROTECTED] wrote:
  I am doing the following:

 malloc some memory is user space
 pass its pointer to some kernel module
 in the kernel module...do a pci_alloc_consistent so that i get a
memory
 region for PCI DMA operations

Wrong approach, you can use kiobufs if you want DMA to the malloc()ed
userspace memory:

 * lock down the user memory using map_user_kiobuf() + lock_kiovec()
   (see linux/iobuf.h).
 * translate the iobuf-maplist into a scatterlist [1]
 * feed pci_map_sg() with the scatterlist to get DMA addresses.
   you can pass to the hardware.

And the reverse to free everything when you are done of course.

  Gerd

[1] IMHO it would be more useful if iobufs would use a scatterlist
instead of an struct page* array.


--
Gerd Knorr [EMAIL PROTECTED]  --  SuSE Labs, Außenstelle Berlin
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/




virt_to_bus and virt_to_phys on Apple G4 target

2001-07-02 Thread mdaljeet

I am running linux 2.4.2 on Apple G4 machine. I think the 'PCI bus
addresses' and 'physical addresses' are same on this architecture. I
expected the two be different but according to asm/io.h 'virt_to_bus(addr)
= virt_to_phys(addr) + PCI_DRAM_OFFSET'. I printed the value of
'PCI_DRAM_OFFSET' and that come out to be zero. Is this correct?

If I somehow get the physical address of a user space buffer in a module
and take this as a PCI bus address, will I be able to do DMA properly?

thanks,
Daljeet.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



interrupt problem....

2001-06-26 Thread mdaljeet

I am experiencing a strange problem.
I am doing a continuous DMA for long hours using a card on my system. In my
code I enable interrupts and clear the interrupts in the interrupt handler
which is called on completion of every DMA cycle. Now, the program works
fine for say 16-20 hours but I think when the debug files'(where i put some
debug information for each DMA cycle + system log files etc) size becomes
too large, card stops generating interrupts.

1. There is a bit in card that tells that DMA is complete
2. There is a bit in card that tells card to generate interrupt when DMA is
complete
3. If we clear the above two bits, the interrupt handling is complete

Now, DMA is getting complete as the bits specified in the point 1 and 2 are
getting set. I have added a 'printk' in the interrupt handler to see
whether the card is generating interrupts or not. Card stops generating
interrupt. Even if I delete all the debug files and start my program again,
same thing happens. After I reboot the system and run my program, the card
starts working properly with same code.

I have noted following things:

a) If I delete all the system log files and restrict the size of my debug
file, the code runs fine for more than 48 hours. Basically I stop the
program after having a 48 hour run.
b) If the system log files has large size and I do not delete them before
starting my program, the card stops generating interrupts after 16-20 hours
of run.

Any pointers to the problem..

Regards,
Daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



interrupt problem....

2001-06-26 Thread mdaljeet

I am experiencing a strange problem.
I am doing a continuous DMA for long hours using a card on my system. In my
code I enable interrupts and clear the interrupts in the interrupt handler
which is called on completion of every DMA cycle. Now, the program works
fine for say 16-20 hours but I think when the debug files'(where i put some
debug information for each DMA cycle + system log files etc) size becomes
too large, card stops generating interrupts.

1. There is a bit in card that tells that DMA is complete
2. There is a bit in card that tells card to generate interrupt when DMA is
complete
3. If we clear the above two bits, the interrupt handling is complete

Now, DMA is getting complete as the bits specified in the point 1 and 2 are
getting set. I have added a 'printk' in the interrupt handler to see
whether the card is generating interrupts or not. Card stops generating
interrupt. Even if I delete all the debug files and start my program again,
same thing happens. After I reboot the system and run my program, the card
starts working properly with same code.

I have noted following things:

a) If I delete all the system log files and restrict the size of my debug
file, the code runs fine for more than 48 hours. Basically I stop the
program after having a 48 hour run.
b) If the system log files has large size and I do not delete them before
starting my program, the card stops generating interrupts after 16-20 hours
of run.

Any pointers to the problem..

Regards,
Daljeet.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



harddisk support

2001-06-20 Thread mdaljeet

Hi,

I do not know whether I should ask this question on this mailing list, but
it definitely has to do either with the kernel confiuration or kernel
support.

In the '/dev' tree, the device file entries for SCSI harddisks ranges from
'/dev/sda' to '/dev/sdp'. If I attach 17 scsi harddisks to a system, the
17th harddisk is shown  as '/dev/sdq' in '/proc/partitions' but there is no
entry in the '/dev' tree. If I try to access '/dev/sdq' either through
fdisk or through   any other simple C programs, it gives error saying, can
not open device '/dev/sdq'.

How can I access more than 16 harddisks?

Regards,
Daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



harddisk support

2001-06-20 Thread mdaljeet

Hi,

I do not know whether I should ask this question on this mailing list, but
it definitely has to do either with the kernel confiuration or kernel
support.

In the '/dev' tree, the device file entries for SCSI harddisks ranges from
'/dev/sda' to '/dev/sdp'. If I attach 17 scsi harddisks to a system, the
17th harddisk is shown  as '/dev/sdq' in '/proc/partitions' but there is no
entry in the '/dev' tree. If I try to access '/dev/sdq' either through
fdisk or through   any other simple C programs, it gives error saying, can
not open device '/dev/sdq'.

How can I access more than 16 harddisks?

Regards,
Daljeet.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: pte_page

2001-05-31 Thread mdaljeet

I am doing a DMA from a card to system memory. The system memory "physical
address" is '0x104000'. I am doing this on x86 with kernel version 2.4.2.
Can this address be the address of a user space buffer?

Regards,
Daljeet.


|+--->
||  Ingo Molnar  |
||  <[EMAIL PROTECTED]|
||  u>   |
||   |
||  05/30/01 |
||  11:09 PM |
||  Please   |
||  respond to   |
||  mingo|
||   |
|+--->
  >|
  ||
  |   To: Pete Wyckoff <[EMAIL PROTECTED]>|
  |   cc: Daljeet Maini/India/IBM@IBMIN,   |
  |   [EMAIL PROTECTED] |
  |   Subject: Re: pte_page|
  >|






On Wed, 30 May 2001, Pete Wyckoff wrote:

> > __pa(page_address(pte_page(pte))) is the address you want. [or
> > pte_val(*pte) & (PAGE_SIZE-1) on x86 but this is platform-dependent.]
>
> Does this work on x86 non-kmapped highmem user pages too?  (i.e. is
> page->virtual valid for every potential user page.)

you are right, the highmem-compatible solution is to use page-mem_map as
the physical page index.

 Ingo




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: pte_page

2001-05-31 Thread mdaljeet

I am doing a DMA from a card to system memory. The system memory physical
address is '0x104000'. I am doing this on x86 with kernel version 2.4.2.
Can this address be the address of a user space buffer?

Regards,
Daljeet.


|+---
||  Ingo Molnar  |
||  [EMAIL PROTECTED]|
||  u   |
||   |
||  05/30/01 |
||  11:09 PM |
||  Please   |
||  respond to   |
||  mingo|
||   |
|+---
  |
  ||
  |   To: Pete Wyckoff [EMAIL PROTECTED]|
  |   cc: Daljeet Maini/India/IBM@IBMIN,   |
  |   [EMAIL PROTECTED] |
  |   Subject: Re: pte_page|
  |






On Wed, 30 May 2001, Pete Wyckoff wrote:

  __pa(page_address(pte_page(pte))) is the address you want. [or
  pte_val(*pte)  (PAGE_SIZE-1) on x86 but this is platform-dependent.]

 Does this work on x86 non-kmapped highmem user pages too?  (i.e. is
 page-virtual valid for every potential user page.)

you are right, the highmem-compatible solution is to use page-mem_map as
the physical page index.

 Ingo




-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



pte_page

2001-05-30 Thread mdaljeet

I use the 'pgt_offset', 'pmd_offset', 'pte_offset' and 'pte_page' inside a
module to get the physical address of a user space virtual address. The
physical address returned by 'pte_page' is not page aligned whereas the
virtual address was page aligned. Can somebody tell me the reason?

Also, can i use these functions to get the physical address of a kernel
virtual address using init_mm?

regards,
Daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



pte_page

2001-05-30 Thread mdaljeet

I use the 'pgt_offset', 'pmd_offset', 'pte_offset' and 'pte_page' inside a
module to get the physical address of a user space virtual address. The
physical address returned by 'pte_page' is not page aligned whereas the
virtual address was page aligned. Can somebody tell me the reason?

Also, can i use these functions to get the physical address of a kernel
virtual address using init_mm?

regards,
Daljeet.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



query regarding 'map_user_kiobuf'

2001-05-29 Thread mdaljeet

I am using linux kernel version 2.4.2 on Intel PC.

I have been trying my luck for over a week regarding usage of
'map_user_kiobuf' for doing a DMA into a memory area that belongs to user
space.

Actually my requirement is that I want to do DMA into a user space memory
area. What I have done through suggestions is that allocate memory in user
space. I pass user space buffer address to a kernel module.
Inside the kernel module, I use 'map_user_kiobuf' passing user space buffer
address to it.

After using the 'map_user_kiobuf', I observed the followiing:

1. 'kiobuf->maplist[0]->virtual' contains a different virtual address than
the user space buffer address
2. But these two addresses are mapped as when i write something using the
address 'kiobuf->maplist[0]->virtual' inside the kernel, I see the same
data in the user space buffer in my application.
3. I use the 'virt_to_phys' operation to the virtual address
'kiobuf->maplist[0]->virtual' to get the physical address.
4. I use this physical address for DMA operations.

Now, using this information I do a DMA from card to system memory. What I
have noticed is that DMA happens somewhere else in the system memory. I am
not able to execute most of the commands (ls, chmod, cat, clear etc) after
my user program exits.

Am I doing the steps 3 and 4 above right?

Regards,
Daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



query regarding 'map_user_kiobuf'

2001-05-29 Thread mdaljeet

I am using linux kernel version 2.4.2 on Intel PC.

I have been trying my luck for over a week regarding usage of
'map_user_kiobuf' for doing a DMA into a memory area that belongs to user
space.

Actually my requirement is that I want to do DMA into a user space memory
area. What I have done through suggestions is that allocate memory in user
space. I pass user space buffer address to a kernel module.
Inside the kernel module, I use 'map_user_kiobuf' passing user space buffer
address to it.

After using the 'map_user_kiobuf', I observed the followiing:

1. 'kiobuf-maplist[0]-virtual' contains a different virtual address than
the user space buffer address
2. But these two addresses are mapped as when i write something using the
address 'kiobuf-maplist[0]-virtual' inside the kernel, I see the same
data in the user space buffer in my application.
3. I use the 'virt_to_phys' operation to the virtual address
'kiobuf-maplist[0]-virtual' to get the physical address.
4. I use this physical address for DMA operations.

Now, using this information I do a DMA from card to system memory. What I
have noticed is that DMA happens somewhere else in the system memory. I am
not able to execute most of the commands (ls, chmod, cat, clear etc) after
my user program exits.

Am I doing the steps 3 and 4 above right?

Regards,
Daljeet.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



bindprocessor

2001-05-17 Thread mdaljeet

How can I bind a user space process to a particular processor in  a SMP
environment?

thanks,
Daljeet Maini


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



bindprocessor

2001-05-17 Thread mdaljeet

How can I bind a user space process to a particular processor in  a SMP
environment?

thanks,
Daljeet Maini


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



CONFIG_APUS

2001-05-16 Thread mdaljeet

When is the 'CONFIG_APUS' flag used ?

Daljeet Maini
IBM Global Services Ltd. - Bangalore
Ph. No. - 5267117 Extn 2954


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



CONFIG_APUS

2001-05-16 Thread mdaljeet

When is the 'CONFIG_APUS' flag used ?

Daljeet Maini
IBM Global Services Ltd. - Bangalore
Ph. No. - 5267117 Extn 2954


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: mmap

2001-05-15 Thread mdaljeet

When I malloc the memory in user space, the memory may be discontinuous for
large chunks of memory say 16k or 32k. Does the 'kiobuf' interface take
care of this or it assumes it to be continuous?

regards,
Daljeet Maini
IBM Global Services Ltd. - Bangalore
Ph. No. - 5267117 Extn 2954


|+--->
||  Gerd Knorr   |
|||
||   |
||  05/15/01 |
||  01:03 PM |
||  Please   |
||  respond to   |
||  Gerd Knorr   |
||   |
|+--->
  >|
  ||
  |   To: [EMAIL PROTECTED] |
  |   cc: (bcc: Daljeet Maini/India/IBM)   |
  |   Subject: Re: mmap|
  >|








[EMAIL PROTECTED] wrote:
>  I am doing the following:
>
> malloc some memory is user space
> pass its pointer to some kernel module
> in the kernel module...do a pci_alloc_consistent so that i get a
memory
> region for PCI DMA operations

Wrong approach, you can use kiobufs if you want DMA to the malloc()ed
userspace memory:

 * lock down the user memory using map_user_kiobuf() + lock_kiovec()
   (see linux/iobuf.h).
 * translate the iobuf->maplist into a scatterlist [1]
 * feed pci_map_sg() with the scatterlist to get DMA addresses.
   you can pass to the hardware.

And the reverse to free everything when you are done of course.

  Gerd

[1] IMHO it would be more useful if iobufs would use a scatterlist
instead of an struct page* array.


--
Gerd Knorr <[EMAIL PROTECTED]>  --  SuSE Labs, Außenstelle Berlin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/




mmap

2001-05-15 Thread mdaljeet

I am doing the following:

   malloc some memory is user space
   pass its pointer to some kernel module
   in the kernel module...do a pci_alloc_consistent so that i get a memory
   region for PCI DMA operations

now the problem is that i want to remap the address range pointed by the
user space pointer to the memory region allocated by the
'pci_alloc_consistent' inside the module. I think this is possible..need
some hints

thanks,
Daljeet Maini
IBM Global Services Ltd. - Bangalore
Ph. No. - 5267117 Extn 2954


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



mmap

2001-05-15 Thread mdaljeet

I am doing the following:

   malloc some memory is user space
   pass its pointer to some kernel module
   in the kernel module...do a pci_alloc_consistent so that i get a memory
   region for PCI DMA operations

now the problem is that i want to remap the address range pointed by the
user space pointer to the memory region allocated by the
'pci_alloc_consistent' inside the module. I think this is possible..need
some hints

thanks,
Daljeet Maini
IBM Global Services Ltd. - Bangalore
Ph. No. - 5267117 Extn 2954


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: mmap

2001-05-15 Thread mdaljeet

When I malloc the memory in user space, the memory may be discontinuous for
large chunks of memory say 16k or 32k. Does the 'kiobuf' interface take
care of this or it assumes it to be continuous?

regards,
Daljeet Maini
IBM Global Services Ltd. - Bangalore
Ph. No. - 5267117 Extn 2954


|+---
||  Gerd Knorr   |
||  kraxel@bytes|
||  ex.org  |
||   |
||  05/15/01 |
||  01:03 PM |
||  Please   |
||  respond to   |
||  Gerd Knorr   |
||   |
|+---
  |
  ||
  |   To: [EMAIL PROTECTED] |
  |   cc: (bcc: Daljeet Maini/India/IBM)   |
  |   Subject: Re: mmap|
  |








[EMAIL PROTECTED] wrote:
  I am doing the following:

 malloc some memory is user space
 pass its pointer to some kernel module
 in the kernel module...do a pci_alloc_consistent so that i get a
memory
 region for PCI DMA operations

Wrong approach, you can use kiobufs if you want DMA to the malloc()ed
userspace memory:

 * lock down the user memory using map_user_kiobuf() + lock_kiovec()
   (see linux/iobuf.h).
 * translate the iobuf-maplist into a scatterlist [1]
 * feed pci_map_sg() with the scatterlist to get DMA addresses.
   you can pass to the hardware.

And the reverse to free everything when you are done of course.

  Gerd

[1] IMHO it would be more useful if iobufs would use a scatterlist
instead of an struct page* array.


--
Gerd Knorr [EMAIL PROTECTED]  --  SuSE Labs, Außenstelle Berlin
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/




dma error

2001-05-12 Thread mdaljeet

Hi,

Was there any change in the PCI initialization code between versions
2.4.0-test8 and 2.4.2.?

I am working on a card and for the same register settings of the card, DMA
from host memory to card memory is successfull for the 2.4.0-test8 but on
2.4.2 kernel, the data transfer is successfull but data gets corrupted.

However the DMA from card memory to system memory is succesull on both the
versions of kernel.

I am not on mailing list. So reply to my id as listed in CC.

Thanks,
Daljeet Maini


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



dma error

2001-05-12 Thread mdaljeet

Hi,

Was there any change in the PCI initialization code between versions
2.4.0-test8 and 2.4.2.?

I am working on a card and for the same register settings of the card, DMA
from host memory to card memory is successfull for the 2.4.0-test8 but on
2.4.2 kernel, the data transfer is successfull but data gets corrupted.

However the DMA from card memory to system memory is succesull on both the
versions of kernel.

I am not on mailing list. So reply to my id as listed in CC.

Thanks,
Daljeet Maini


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



2.4.0-test8 compilation problem on netfinity

2001-04-17 Thread mdaljeet

Hi,

If I compile the 2.4.0-test8 kernel on uniprocessor intel machine with SMP
support, I get no compilation problems. But when I compile on a 'netfinity'
machine with 3 intel processors with SMP support, the telnet session in
which I do this gets hung during 'make bzImage'. Though the 'bzImage' still
gets created but when I try to boot the netfinity with that image, the
system crashes and I get the following kernel messages:

Calibrating delay loop... 1795 Bogo MIPS
Stack at about c1e1bfbc
OK.
CPU1: Intel Pentium III (Cascades) stepping 04
CPU has booted.
Booting processor 2/6 eip 2000
Setting warm reset code and vector
1.
2.
3.
asserting INIT.
Waiting for send to finish...
Deasserting INIT.
Waiting for send to finish...
+#startup loops: 2
Sending STARTUP #1.
After APIC write.
Startup point 1.
Waiting for send to finish...
+Sending STARTUP #2.
After apic_write
(the above line was the last thing written to the screen, it was then froze
at this point for at least 5 min.)

Has anybody faced this problem before? If anybody has booted the 2.4.x with
SMP support on the netfinity multi-processor machienes, kindly tell me the
way.

Regards,
Daljeet Maini


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



2.4.0-test8 compilation problem on netfinity

2001-04-17 Thread mdaljeet

Hi,

If I compile the 2.4.0-test8 kernel on uniprocessor intel machine with SMP
support, I get no compilation problems. But when I compile on a 'netfinity'
machine with 3 intel processors with SMP support, the telnet session in
which I do this gets hung during 'make bzImage'. Though the 'bzImage' still
gets created but when I try to boot the netfinity with that image, the
system crashes and I get the following kernel messages:

Calibrating delay loop... 1795 Bogo MIPS
Stack at about c1e1bfbc
OK.
CPU1: Intel Pentium III (Cascades) stepping 04
CPU has booted.
Booting processor 2/6 eip 2000
Setting warm reset code and vector
1.
2.
3.
asserting INIT.
Waiting for send to finish...
Deasserting INIT.
Waiting for send to finish...
+#startup loops: 2
Sending STARTUP #1.
After APIC write.
Startup point 1.
Waiting for send to finish...
+Sending STARTUP #2.
After apic_write
(the above line was the last thing written to the screen, it was then froze
at this point for at least 5 min.)

Has anybody faced this problem before? If anybody has booted the 2.4.x with
SMP support on the netfinity multi-processor machienes, kindly tell me the
way.

Regards,
Daljeet Maini


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



system call handling

2000-11-01 Thread mdaljeet

Hi,

By looking into the structure of GDT as used by linux kernel(file
include/asm/desc.c, kernel ver 2.4), it appears as if linux kernel does not
use the "call gate descriptors" for system call handling. Is this correct?

If it is correct then how does the system calls are handled by the kernel
(basically how does the control gets transferred to kernel)? Does the CS of
linux kernel handles the system calls? what are the advantages of using
this scheme?

otherwise can anyone give pointers in the kernel source where i can look
into?

Thanks,
daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



freeing memory

2000-10-22 Thread mdaljeet

hi,

i am allocating some 1000 bytes of memory as folows

f_malloc()
{
 .
 for (i=1 to 10)
 {
 size = 1000;
 pAddr[i] = (unsigned long) kmalloc(size, GFP_DMA | GFP_BUFFER);
 }
 ...
}

and freeing the allocated memory as follows

f_free()
{
 .
 for (i=1 to 10)
 {
 kfree(pAddr[i]);
 }
}

pAddr is defined as 'unsigned long pAddr[10]'

But when f_free executes i ran into problems and computer hangs.
What can be the problem?

regards,
daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



freeing memory

2000-10-22 Thread mdaljeet

hi,

i am allocating some 1000 bytes of memory as folows

f_malloc()
{
 .
 for (i=1 to 10)
 {
 size = 1000;
 pAddr[i] = (unsigned long) kmalloc(size, GFP_DMA | GFP_BUFFER);
 }
 ...
}

and freeing the allocated memory as follows

f_free()
{
 .
 for (i=1 to 10)
 {
 kfree(pAddr[i]);
 }
}

pAddr is defined as 'unsigned long pAddr[10]'

But when f_free executes i ran into problems and computer hangs.
What can be the problem?

regards,
daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



MAP_NR

2000-10-19 Thread mdaljeet

can anyone tell the subsitute for MAP_NR in version 2.4?
or is MAP_NR still there?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



MAP_NR

2000-10-19 Thread mdaljeet

can anyone tell the subsitute for MAP_NR in version 2.4?
or is MAP_NR still there?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



effect of pci_unregister_driver

2000-10-16 Thread mdaljeet

Hi,

If I have two identical network cards on my machine and I unregister the
driver of one
of them (say eth0) using the call "pci_unregister_driver(pdev->driver)"
where pdev is
the 'pci_dev' structure for eth0, does the device 'eth1' i.e. the other one
gets effected by
this.

Regards,
daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



mapping user space buffer to kernel address space

2000-10-13 Thread mdaljeet

Hi,

I have a user buffer and i want to map it to kernel address space
can anyone tell how to do this like in AIX we have xmattach

thanks
daljeet



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



mapping user space buffer to kernel address space

2000-10-13 Thread mdaljeet

Hi,

I have a user buffer and i want to map it to kernel address space
can anyone tell how to do this like in AIX we have xmattach

thanks
daljeet



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: File System issue

2000-10-11 Thread mdaljeet


>I find out that doing the following command:

>cp toto titi/toto

>where toto is a file and titi is a directory do >not change the date stamp
of
>`titi'.

i checked this out with 2.4-0test9.
timestmap of directory is getting modified. you must be using very old
kernel


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



executing a user space function in kernel module

2000-10-11 Thread mdaljeet

Hi,


struct t{
  int (*x)(int);
}fstruct;

main()
{
.
.
fstruct.x = f;
./*write fstruct to a device file*/
.
}

int f(int i)
{
printf("got %d\n",i);
return i;
}


i pass this structure to kernel module by writting to device file.
the write function of module is like

..
..
char *kbuf;
struct t *fstruct;
kbuf = kmalloc(count*sizeof(char), GFP_KERNEL);
copy_from_user((void*)kbuf,(void*)buf,count);
if( (filp->f_flags & O_ACCMODE)== O_WRONLY)
fstruct = (struct t*)kbuf;
printk("calling from kernel:%d\n",(fstruct->x)(8));
...

Now, is there any problem in executing a user space function in a kernel
module
by just passing a function pointer to the module

In Linux, is it possible to execute a function in kernel which is a part of
user application
and hence a part of user address space??

Thanks,
daljeet



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



executing a user space function in kernel module

2000-10-11 Thread mdaljeet

Hi,


struct t{
  int (*x)(int);
}fstruct;

main()
{
.
.
fstruct.x = f;
./*write fstruct to a device file*/
.
}

int f(int i)
{
printf("got %d\n",i);
return i;
}


i pass this structure to kernel module by writting to device file.
the write function of module is like

..
..
char *kbuf;
struct t *fstruct;
kbuf = kmalloc(count*sizeof(char), GFP_KERNEL);
copy_from_user((void*)kbuf,(void*)buf,count);
if( (filp-f_flags  O_ACCMODE)== O_WRONLY)
fstruct = (struct t*)kbuf;
printk("calling from kernel:%d\n",(fstruct-x)(8));
...

Now, is there any problem in executing a user space function in a kernel
module
by just passing a function pointer to the module

In Linux, is it possible to execute a function in kernel which is a part of
user application
and hence a part of user address space??

Thanks,
daljeet



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: File System issue

2000-10-11 Thread mdaljeet


I find out that doing the following command:

cp toto titi/toto

where toto is a file and titi is a directory do not change the date stamp
of
`titi'.

i checked this out with 2.4-0test9.
timestmap of directory is getting modified. you must be using very old
kernel


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/