All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Are linux network drivers really affected by this?
From: andrea.glorioso @ 2003-01-10 11:12 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List
In-Reply-To: <1042199207.28469.49.camel@irongate.swansea.linux.org.uk>

>>>>> "ac" == Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

    ac> Most of  them will pad with zero.  We have a couple of drivers
    ac> that already pad with something along  the lines of "NetBSD is
    ac> a cool OS too.."

Let's talk about subliminal messages, then. :)

How sensible would it be to have a runtime or  compile time option for
choosing between zero padding and  random values padding?  I think the
variable length of the  padding could cause some performance problems,
but I'm no kernel hacker nor cryptography expert.

    ac> The -ac tree should have the problem fixed for all the drivers
    ac> I know have the problem or may do.

Great.

bye,

andrea
--
Andrea Glorioso                   andrea.glorioso@binary-only.com
Binary Only                           http://www.binary-only.com/
Via A. Zanolini, 7/b                  Tel:     +39-348.921.43.79
40126 Bologna                         Fax:     +39-051-930.31.133

^ permalink raw reply

* Re: 2.4.20 stability issues
From: Russell Coker @ 2003-01-10 11:04 UTC (permalink / raw)
  To: Brian May; +Cc: selinux
In-Reply-To: <20030110092425.GD9359@snoopy.apana.org.au>

On Fri, 10 Jan 2003 10:24, Brian May wrote:
> Interesting; maybe it is one of my patches.
>
> (it has happened before, a bug for instance in the ACL patch would crash
> the computer even when just fscking the filesystem).
>
> Although 4 days may not be long enough to reproduce the bug, not
> sure on this.

I also have another machine that is running the same kernel but is not running 
flawlessly (however it is running a known-buggy kernel module which has 
caused the same problem in previous kernels as are occuring in the latest 
one).

I am running a Desktop test machine (a SE play machine on the LAN at work) 
which has 23 days of uptime on light load with the same kernel.

Also I have some live production servers running the same LSM patch but with 
the OpenWall option selected.  They are mail servers with 250,000 accounts 
per server for a total of 1M accounts across four servers.  Apart from some 
disk-IO performance issues they are running perfectly.

> It was also sometime last year that my Thinkpad totally died (after
> random crashes), and needed a new motherboard, I am keeping my fingers
> crossed that it isn't the same problem.

Maybe that's the issue.

Why don't you put that kernel on snoopy?  The only thing that stopped me 
putting all the latest kernels on ivanova was being on a different continent 
to it...

-- 
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply

* Re: Linux 2.4.21pre3-ac2
From: Alan Cox @ 2003-01-10 12:00 UTC (permalink / raw)
  To: Ralf Hildebrandt; +Cc: Linux Kernel Mailing List
In-Reply-To: <20030110094504.GM25979@charite.de>

On Fri, 2003-01-10 at 09:45, Ralf Hildebrandt wrote:
> I got an oops with that kernel on two different machines:

Can you build the kernel with the patch to mm/shmem.c reverted and
see if that fixes your crash ?


^ permalink raw reply

* Re: Linux 2.4.21pre3-ac2
From: Ralf Hildebrandt @ 2003-01-10 11:15 UTC (permalink / raw)
  To: Linux Kernel Mailing List
In-Reply-To: <1042200029.28469.55.camel@irongate.swansea.linux.org.uk>

* Alan Cox <alan@lxorguk.ukuu.org.uk>:
> On Fri, 2003-01-10 at 09:45, Ralf Hildebrandt wrote:
> > I got an oops with that kernel on two different machines:
> 
> Can you build the kernel with the patch to mm/shmem.c reverted and
> see if that fixes your crash ?

Well, yes. Should I remove all changes to "mm/shmem.c" that are done
from the ac2 patch?

-- 
Ralf Hildebrandt (Im Auftrag des Referat V a)   Ralf.Hildebrandt@charite.de
Charite Campus Mitte                            Tel.  +49 (0)30-450 570-155
Referat V a - Kommunikationsnetze -             Fax.  +49 (0)30-450 570-916
Why you can't find your system administrators:
On the roof of the building, contemplating which users to throw off. 


^ permalink raw reply

* Re: Problem in IDE Disks cache handling in kernel 2.4.XX
From: Andre Hedrick @ 2003-01-10 11:14 UTC (permalink / raw)
  To: Alan Cox; +Cc: fverscheure, Linux Kernel Mailing List, Marcelo Tosatti
In-Reply-To: <1042198670.28469.45.camel@irongate.swansea.linux.org.uk>

On 10 Jan 2003, Alan Cox wrote:

> On Fri, 2003-01-10 at 09:54, Francis Verscheure wrote:
> > In fact for ATA/ATAPI 5 cfs_enable_2  has no meaning.  The fields to test are 
> > write cache bits in command_set_1 and cfs_enable_1.
> > And in both cases the FLUSH CACHE command ALWAYS EXISTS !
> > The test of cfs_enable_2 must only be used for ATA/ATAPI 6 drives to use 
> > FLUSH CACHE or FLUSH CACHE EXT in case of 48 bit addressing mode.
> 
> Thanks for the report. I need to go reread the spec before I can
> definitively comemnt on this.

I had started to work out a ruleset from ATA-3 forward based on the
capablities supported/enabled/supported_enabled ...

But it it is not clear how to even hand 2 or 3 bits in word 93, I have
little hope with out huge amounts of help to classify a rule set for at
least 48-bits of supported against another 48-bits of enabled, traversing
ATA-3,4,5,6,7 major releases, and about 15 minor revisions.

> > And it seems to me that when an IDE drive has a cache enabled wcache must be 
> > initialized to say so ? Or you have to do a STANDY or SLEEP before APM 
> > suspend or power off to be sure that the cache has been written to the disk.
> 
> Technically - no. In the real world its a very very good idea

They default wcache enabled.

bdflush,sync,spin,flushcache,check_error,(OMG's),STANDY/SLEEP

OMG:

The drive does random and automatic flush caches, if an error happens it
does not report. *sigh*  When APM hits it with a flush and pray the error
is from this flush, but it does not matter ... the kernel does not have
the paths to deal this issue ... so bye bye data!  Now it if the current
flush is not the owner of the error OMFG is suggested.

OMFG:

Since there is not a mechanism to assist the drive, and the drive can not
help it self ... you can expect a device lockup and fatal operations.

Stuff people really do not want to know.

> > I had a look at patch 2.4.21pre3 and the code looks the same.
> > 
> > And by the way how are powered off the IDE drives ?
> > Because a FLUSH CACHE or STANDY or SLEEP is MANDATORY before powering off the 
> > drive with cache enabled or you will enjoy lost data
> 
> IDE disagrees with itself over this but when we get a controlled power
> off we do this. The same ATA5/ATA6 problem may well be present there
> too. I will review both

Not true, the firmware knows to commit the data to platter.
If it was true you would be screaming long ago.

> Any specific opinion Andre ?

A dirty trick used to date is to pop the STANDY or SLEEP, and depend on
the drive to deal with the double dirty flush error.  If the FLUSH CACHE
was not valid, the drive would spin back up from STANDY, but not from
SLEEP, this could be a problem.  However SLEEP issued by the driver only
happens at shutdown unless it has been changed.  In the shutdown process,
each partition unmount was flushed and also once extra when the usage
count was set to zero.  Worst case was 2 flush min.

So it is a pig in a poke ...

Cheers,

Andre Hedrick
LAD Storage Consulting Group


^ permalink raw reply

* Re: Another idea for simplifying locking in kernel/module.c
From: Adam J. Richter @ 2003-01-10 11:16 UTC (permalink / raw)
  To: maxk; +Cc: linux-kernel, rusty

I wrote:
>On Thu, 09 Jan 2003, Max Krasnyansky wrote:
>>We have to be able to call try_module_get() from interrupt context.

>	Where?  Why?  Please show me one or more examples.

	Come to think of it, I don't think you even have to answer
that question.  You should be able to use my try_module_get() from
interrupt context.  It never blocks.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

^ permalink raw reply

* Re: detecting hyperthreading in linux 2.4.19
From: Mikael Pettersson @ 2003-01-10 11:19 UTC (permalink / raw)
  To: Dave Jones; +Cc: jamesclv, Jason Lunz, linux-kernel
In-Reply-To: <20030110110547.GC29190@codemonkey.org.uk>

Dave Jones writes:
 > On Fri, Jan 10, 2003 at 08:05:07AM +0100, Mikael Pettersson wrote:
 > 
 >  > If the kernel has sched_setaffinity() or some other way of binding a process
 >  > to a given CPU (as numbered by the kernel, which may or may not be related
 >  > to any physical CPU numbers), then this will do it: execute CPUID on each
 >  > CPU and check the initial APIC ID field. If you find one that's non-zero,
 >  > then HT is enabled.
 > 
 > That's a horrible way of reimplementing /dev/cpu/x/cpuid  8-)

True. I forgot about that interface since I personally never configure or use it.

So this answers the original question. Just access /dev/cpu/$CPU/cpuid
for all (accessible) values of $CPU.

^ permalink raw reply

* Re: Linux 2.4.21pre3-ac2
From: Ralf Hildebrandt @ 2003-01-10 11:21 UTC (permalink / raw)
  To: Linux Kernel Mailing List
In-Reply-To: <1042200029.28469.55.camel@irongate.swansea.linux.org.uk>

* Alan Cox <alan@lxorguk.ukuu.org.uk>:
> On Fri, 2003-01-10 at 09:45, Ralf Hildebrandt wrote:
> > I got an oops with that kernel on two different machines:
> 
> Can you build the kernel with the patch to mm/shmem.c reverted and
> see if that fixes your crash ?

I'm building as we speak.

-- 
Ralf Hildebrandt (Im Auftrag des Referat V a)   Ralf.Hildebrandt@charite.de
Charite Campus Mitte                            Tel.  +49 (0)30-450 570-155
Referat V a - Kommunikationsnetze -             Fax.  +49 (0)30-450 570-916
It's mathematical: (uNsTable - NT) = usable.


^ permalink raw reply

* Re: Intel P6 vs P7 system call performance
From: Gabriel Paubert @ 2003-01-10 11:30 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Jamie Lokier, Ulrich Drepper, davej, linux-kernel
In-Reply-To: <Pine.LNX.4.44.0212241126020.1219-100000@home.transmeta.com>




On Tue, 24 Dec 2002, Linus Torvalds wrote:

[That's old, I know. I'm slowly catching up on my email backlog after
almost 3 weeks away]

>
> Ok, one final optimization.
>
> We have traditionally held ES/DS constant at __KERNEL_DS in the kernel,
> and we've used that to avoid saving unnecessary segment registers over
> context switches etc.
>
> I realized that there is really no reason to use __KERNEL_DS for this, and
> that as far as the kernel is concerned, the only thing that matters is
> that it's a flat 32-bit segment. So we might as well make the kernel
> always load ES/DS with __USER_DS instead, which has the advantage that we
> can avoid one set of segment loads for the "sysenter/sysexit" case.
>
> (We still need to load ES/DS at entry to the kernel, since we cannot rely
> on user space not trying to do strange things. But once we load them with
> __USER_DS, we at least don't need to restore them on return to user mode
> any more, since "sysenter" only works in a flat 32-bit user mode anyway
> (*)).

We cannot rely either on userspace not setting NT bit in eflags. While
it won't cause an oops since the only instruction which ever depends on
it, iret, has a handler (which needs to be patched, see below),
I'm absolutely not convinced that all code paths are "NT safe" ;-)

For example, set NT and then execute sysenter with garbage in %eax, the
kernel will try to return (-ENOSYS) with iret and kill the task. As long
as it only allows a task to kill itself, it's not a big deal. But NT is
not cleared across task switches unless I miss something, and that looks
very dangerous.

It's so complex that I'm not sure that clearing NT in __switch_to is
sufficient, but clearing it in every sysenter path will make clock cycles
accountants scream (the only way is through popfl).

>
> This doesn't matter much for a P4 (surprisingly, a P4 does very well
> indeed on segment loads), but it does make a difference on PIII-class
> CPU's.
>
> This makes a PIII do a "getpid()" system call in something like 160
> cycles (a P4 is at 430 cycles, oh well).
>
> Ingo, would you mind taking a look at the patch, to see if you see any
> paths where we don't follow the new segment register rules. It looks like
> swsuspend isn't properly saving and restoring segment register contents.
> so that will need double-checking (it wasn't correct before either, so
> this doesn't make it any worse, at least).

I'm no Ingo, unfortunately, but you'll need at least the following patch
(the second hunk is only a typo fix) to the iret exception recovery code,
which used push and pops to get the smallest possible code size.

That's a minimal patch, let me know if you prefer to have a single copy of
the exception handler for all instances of RESTORE_ALL.

===== entry.S 1.49 vs edited =====
--- 1.49/arch/i386/kernel/entry.S	Sat Jan  4 19:06:07 2003
+++ edited/entry.S	Fri Jan 10 02:12:00 2003
@@ -126,10 +126,9 @@
 	addl $4, %esp;	\
 1:	iret;		\
 .section .fixup,"ax";   \
-2:	pushl %ss;	\
-	popl %ds;	\
-	pushl %ss;	\
-	popl %es;	\
+2:	movl $(__USER_DS), %edx; \
+	movl %edx, %ds; \
+	movl %edx, %es; \
 	pushl $11;	\
 	call do_exit;	\
 .previous;		\
@@ -225,7 +224,7 @@
 	movl TI_FLAGS(%ebx), %ecx	# need_resched set ?
 	testb $_TIF_NEED_RESCHED, %cl
 	jz restore_all
-	testl $IF_MASK,EFLAGS(%esp)     # interrupts off (execption path) ?
+	testl $IF_MASK,EFLAGS(%esp)     # interrupts off (exception path) ?
 	jz restore_all
 	movl $PREEMPT_ACTIVE,TI_PRE_COUNT(%ebx)
 	sti


	Regards,
	Gabriel.


^ permalink raw reply

* spin_locks without smp.
From: Maciej Soltysiak @ 2003-01-10 11:42 UTC (permalink / raw)
  To: linux-kernel

Hi,

while browsing through the network drivers about the etherleak issue i
found that some drivers have:

#ifdef CONFIG_SMP
	spin_lock_irqsave(...)
#endif

and some just:

	spin_lock_irqsave(...)

or similar.
Which version should be practiced? i thought spinlocks are irrelevant
without SMP so we should use #ifdef to shorten the execution path.

Regards,
Maciej Soltysiak


^ permalink raw reply

* Re: spin_locks without smp.
From: William Lee Irwin III @ 2003-01-10 11:45 UTC (permalink / raw)
  To: Maciej Soltysiak; +Cc: linux-kernel
In-Reply-To: <Pine.LNX.4.51.0301101238560.6124@dns.toxicfilms.tv>

On Fri, Jan 10, 2003 at 12:42:34PM +0100, Maciej Soltysiak wrote:
> while browsing through the network drivers about the etherleak issue i
> found that some drivers have:
> #ifdef CONFIG_SMP
> 	spin_lock_irqsave(...)
> #endif
> and some just:
> 	spin_lock_irqsave(...)
> or similar.
> Which version should be practiced? i thought spinlocks are irrelevant
> without SMP so we should use #ifdef to shorten the execution path.

Buggy on preempt. Remove the #ifdef


Bill

^ permalink raw reply

* [PATCH] SG_IO ioctl in block layer against lk 2.5.55
From: Douglas Gilbert @ 2003-01-10 11:37 UTC (permalink / raw)
  To: linux-scsi; +Cc: axboe

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

The attachment modifies the SG_IO ioctl that is in
the block layer to:
   - convey the SCSI status value back via the sg_io_hdr
     structure
   - in the event of CHECK CONDITION, convey the sense
     buffer back via the sg_io_hdr structure
   - set "output" fields in sg_io_hdr structure to sane
     values
   - modify the errno behaviour to be more like the
     SCSI generic driver's SG_IO ioctl

This patch was presented around lk 2.5.51 but fell between
the cracks. The only modification is to take account of
the changes to scsi/scsi_lib.c since then.

Doug Gilbert

[-- Attachment #2: blk_sgio_2555.diff --]
[-- Type: text/plain, Size: 3670 bytes --]

--- linux/drivers/block/scsi_ioctl.c	2002-11-29 09:27:35.000000000 +1100
+++ linux/drivers/block/scsi_ioctl.c2551sgio2	2002-12-14 23:18:46.000000000 +1100
@@ -40,6 +40,11 @@
 
 #define BLK_DEFAULT_TIMEOUT	(60 * HZ)
 
+/* defined in ../scsi/scsi.h  ... should it be included? */
+#ifndef SCSI_SENSE_BUFFERSIZE
+#define SCSI_SENSE_BUFFERSIZE 64
+#endif
+
 int blk_do_rq(request_queue_t *q, struct block_device *bdev, struct request *rq)
 {
 	DECLARE_COMPLETION(wait);
@@ -126,11 +131,11 @@
 		 struct sg_io_hdr *uptr)
 {
 	unsigned long uaddr, start_time;
-	int err, reading, writing, nr_sectors;
+	int reading, writing, nr_sectors;
 	struct sg_io_hdr hdr;
 	struct request *rq;
 	struct bio *bio;
-	char sense[24];
+	char sense[SCSI_SENSE_BUFFERSIZE];
 	void *buffer;
 
 	if (!access_ok(VERIFY_WRITE, uptr, sizeof(*uptr)))
@@ -265,26 +270,36 @@
 
 	start_time = jiffies;
 
-	/*
-	 * return -EIO if we didn't transfer all data, caller can look at
-	 * residual count to find out how much did succeed
+	/* ignore return value. All information is passed back to caller
+	 * (if he doesn't check that is his problem).
+	 * N.B. a non-zero SCSI status is _not_ necessarily an error.
 	 */
-	err = blk_do_rq(q, bdev, rq);
-	if (rq->data_len > 0)
-		err = -EIO;
+	blk_do_rq(q, bdev, rq);
 	
 	if (bio) {
 		bio_unmap_user(bio, reading);
 		bio_put(bio);
 	}
 
-	hdr.status = rq->errors;
+	/* write to all output members */
+	hdr.status = rq->errors;	
+	hdr.masked_status = (hdr.status >> 1) & 0x1f;
+	hdr.msg_status = 0;
+	hdr.host_status = 0;
+	hdr.driver_status = 0;
+	hdr.info = 0;
+	if (hdr.masked_status || hdr.host_status || hdr.driver_status)
+		hdr.info |= SG_INFO_CHECK;
 	hdr.resid = rq->data_len;
 	hdr.duration = (jiffies - start_time) * (1000 / HZ);
+	hdr.sb_len_wr = 0;
 
 	if (rq->sense_len && hdr.sbp) {
-		if (!copy_to_user(hdr.sbp,rq->sense, rq->sense_len))
-			hdr.sb_len_wr = rq->sense_len;
+		int len = (hdr.mx_sb_len < rq->sense_len) ? 
+				hdr.mx_sb_len : rq->sense_len;
+
+		if (!copy_to_user(hdr.sbp, rq->sense, len))
+			hdr.sb_len_wr = len;
 	}
 
 	blk_put_request(rq);
@@ -297,8 +312,9 @@
 
 		kfree(buffer);
 	}
-
-	return err;
+	/* may not have succeeded, but output values written to control
+	 * structure (struct sg_io_hdr).  */
+	return 0;
 }
 
 #define FORMAT_UNIT_TIMEOUT		(2 * 60 * 60 * HZ)
--- linux/drivers/scsi/scsi_lib.c	2002-12-10 17:38:29.000000000 +1100
+++ linux/drivers/scsi/scsi_lib.c2551sgio	2002-12-14 23:08:25.000000000 +1100
@@ -495,6 +495,7 @@
 	int this_count = SCpnt->bufflen >> 9;
 	request_queue_t *q = SCpnt->device->request_queue;
 	struct request *req = SCpnt->request;
+	int clear_errors = 1;
 
 	/*
 	 * We must do one of several things here:
@@ -528,10 +529,22 @@
 		kfree(SCpnt->buffer);
 	}
 
-	if (blk_pc_request(req)) {
-		req->errors = result & 0xff;
-		if (!result)
+	if (blk_pc_request(req)) { /* SG_IO ioctl from block level */
+		req->errors = (driver_byte(result) & DRIVER_SENSE) ?
+			      (CHECK_CONDITION << 1) : (result & 0xff);
+		if (!result) 
 			req->data_len -= SCpnt->bufflen;
+		else {
+			clear_errors = 0;
+			if (SCpnt->sense_buffer[0] & 0x70) {
+				int len = 8 + SCpnt->sense_buffer[7];
+
+				if (len > SCSI_SENSE_BUFFERSIZE)
+					len = SCSI_SENSE_BUFFERSIZE;
+				memcpy(req->sense, SCpnt->sense_buffer,  len);
+				req->sense_len = len;
+			}
+		}
 	}
 
 	/*
@@ -552,7 +565,8 @@
 					      req->nr_sectors, good_sectors));
 		SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n ", SCpnt->use_sg));
 
-		req->errors = 0;
+		if (clear_errors)
+			req->errors = 0;
 		/*
 		 * If multiple sectors are requested in one buffer, then
 		 * they will have been finished off by the first command.

^ permalink raw reply

* 2.5.55 - ide-scsi hw lockup
From: Lukas Hejtmanek @ 2003-01-10 11:48 UTC (permalink / raw)
  To: linux-kernel

Hello,

as of 2.5.55, ide-scsi still lockups my system during boot.

I have: (ide=reverse is applied)
PDC20265: chipset revision 2
PDC20265: not 100% native mode: will probe irqs later
PDC20265: (U)DMA Burst Bit ENABLED Primary PCI Mode Secondary PCI Mode.
    ide0: BM-DMA at 0x7800-0x7807, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0x7808-0x780f, BIOS settings: hdc:DMA, hdd:pio
hda: ST380021A, ATA DISK drive
ide0 at 0x9000-0x9007,0x8802 on irq 10
hdc: IBM-DTLA-307045, ATA DISK drive
ide1 at 0x8400-0x8407,0x8002 on irq 10
VP_IDE: IDE controller at PCI slot 00:04.1
VP_IDE: chipset revision 16
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686a (rev 22) IDE UDMA66 controller on pci00:04.1
    ide2: BM-DMA at 0xd800-0xd807, BIOS settings: hde:DMA, hdf:pio
    ide3: BM-DMA at 0xd808-0xd80f, BIOS settings: hdg:DMA, hdh:pio
hde: DVD-ROM DDU1621, ATAPI CD/DVD-ROM drive
hde: DMA disabled
ide2 at 0x1f0-0x1f7,0x3f6 on irq 14
hdg: CD-W512EB, ATAPI CD/DVD-ROM drive
hdg: DMA disabled


If I tell hdg=ide-scsi then at ide-scsi initialization IDE LED lights and
nothing but hw reset helps.

If I physically swap hdg and hde then hde=ide-scsi works ok. 

Without ide-scsi cdrecord dev=/dev/hdg works perfectly. However readcd and 
cdrdao is not ready for the atapi yet.

System is Asus A7V motherboard with AMD Thunderbird 1.2GHz.


With kernel 2.4.20 is all ok, so it should not be a hw bug.

Why it reports DMA disabled?

my .config
#
# IDE chipset support/bugfixes
#
# CONFIG_BLK_DEV_CMD640 is not set
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_GENERIC=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDE_TCQ is not set
CONFIG_BLK_DEV_OFFBOARD=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_IDEDMA_PCI_WIP=y
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
CONFIG_BLK_DEV_ADMA=y
CONFIG_BLK_DEV_PDC202XX_OLD=y
CONFIG_BLK_DEV_VIA82CXXX=y
CONFIG_IDEDMA_AUTO=y
# CONFIG_IDEDMA_IVB is not set
CONFIG_BLK_DEV_PDC202XX=y
CONFIG_BLK_DEV_IDE_MODES=y

-- 
Lukáš Hejtmánek

^ permalink raw reply

* Re: spin_locks without smp.
From: William Lee Irwin III @ 2003-01-10 11:48 UTC (permalink / raw)
  To: Maciej Soltysiak, linux-kernel
In-Reply-To: <20030110114546.GN23814@holomorphy.com>

On Fri, Jan 10, 2003 at 12:42:34PM +0100, Maciej Soltysiak wrote:
>> while browsing through the network drivers about the etherleak issue i
>> found that some drivers have:
>> #ifdef CONFIG_SMP
>> 	spin_lock_irqsave(...)
>> #endif
>> and some just:
>> 	spin_lock_irqsave(...)
>> or similar.
>> Which version should be practiced? i thought spinlocks are irrelevant
>> without SMP so we should use #ifdef to shorten the execution path.

On Fri, Jan 10, 2003 at 03:45:46AM -0800, William Lee Irwin III wrote:
> Buggy on preempt. Remove the #ifdef

Actually the only extant example of this is in eexpress.c


Bill

^ permalink raw reply

* Unable to boot kernel-2.5.50 to kernel-2.5.55
From: Ole Jacob Hagen @ 2003-01-10 11:49 UTC (permalink / raw)
  To: linux-kernel

Hi.

This might be wrong mailinglist, but I don't know else
to to.

I am having a Dell Optiplex GX240, 512 MB RAM, ATI
RAGE 128. I am using Gentoo GNU/Linux. 

I have installed module-init-tools-0.9.7. 
I have difficulties in booting development kernels.
I am using GRUB as boot-loader, and can choose between
different kernel-2.4 series and kernel-2.5.  

I am passing root=/dev/hda3 to all kernels. 

My screen turns black and the computer reboots, when I
try to boot a development kernel. 
I havent't applied Rusty's patch for PCI and USB,
because I thought it was for kernel-2.5.50. Is it
necessary? 

I'm using pretty much the same config-file in
kernel-2.5 as in kernel-2.4. I have tried to disable
all framebuffer support, but nothing happened. 

Should I try another version of GRUB?

How should the config-file for kernel-2.5.5x look
like? 

I am trying out development kernels, because I like
being in bleeding edge, when it comes to computers. 
Have to challenge myself...:-)

Cheers, 

Ole J. 
 


______________________________________________________
Få den nye Yahoo! Messenger på http://no.messenger.yahoo.com/
Nye ikoner og bakgrunner, webkamera med superkvalitet og dobbelt så morsom

^ permalink raw reply

* Re: [Asterisk] DTMF noise
From: Roy Sigurd Karlsbakk @ 2003-01-10 12:03 UTC (permalink / raw)
  To: Wolfgang Fritz, linux-kernel
In-Reply-To: <3E1D79CB.5010503@gmx.net>

> My simple patch added a relative energy comparision of the DTMF tones
> and a simple plausibiltity check (DTMF is only accepted if there is
> exactly one DTNF pair and no/low signal level on the other DTMF
> frequencies. That worked with my (very limited) tests.

I'm not sure if we're at the source of the problem. I mean - it should be 
possible to set a minimum length as well, so just touching a key won't be 
accepted. I beleive this'll remove most of the falsly detected dtmf signals 
as well, as noone really holds the same tone for a long time while speaking

roy
-- 
Roy Sigurd Karlsbakk, Datavaktmester
ProntoTV AS - http://www.pronto.tv/
Tel: +47 9801 3356

Computers are like air conditioners.
They stop working when you open Windows.


^ permalink raw reply

* Re: ymfpci, big-endian, and spdif out
From: Takashi Iwai @ 2003-01-10 11:57 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: Jaroslav Kysela, alsa-devel@lists.sourceforge.net
In-Reply-To: <20030110065545.GC393@kalmia.hozed.org>

At Fri, 10 Jan 2003 00:55:45 -0600,
Troy Benjegerdes wrote:
> 
> > 
> > > On Tue, Jan 07, 2003 at 05:02:53PM +0100, Takashi Iwai wrote:
> > > > At Thu, 2 Jan 2003 22:22:34 -0600,
> > > > Troy Benjegerdes wrote:
> > > > > 
> > > > > I have a mac G4 (running debian testing), a ymfpci card (MaxiSound
> > > > > Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with
> 
> > 
> > There were a few bad assumtions in the spdif code. Could you try the 
> > latest CVS code of ac3dec (or attached patch)?
> 
> Okay, I've dumped some printk's in core/pcm_memory.c, and found that the
> following error:
> 
> hozer@narn ac3dec$ ./ac3dec -C ~/testac3/THX.ac3
> Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2'
> ALSA lib pcm_hw.c:297:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS
> failed: Cannot allocate memory
> PCM hw_params failed: Cannot allocate memory
> Output open failed
> 
> results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting
> called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.
 
oh, you found a bug :)  it was introduced due to my last change to pcm
pre-allocator.  now fixed on cvs.

thanks for your report!


Takashi


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply

* [PATCH]Re: spin_locks without smp.
From: Maciej Soltysiak @ 2003-01-10 12:09 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-kernel
In-Reply-To: <20030110114855.GO23814@holomorphy.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1506 bytes --]

> On Fri, Jan 10, 2003 at 03:45:46AM -0800, William Lee Irwin III wrote:
> > Buggy on preempt. Remove the #ifdef
Yes sir. :)

Is that okay?

Maciej


--- linux/drivers/net/eexpress.c	2002-11-29 00:53:13.000000000 +0100
+++ linux.new/drivers/net/eexpress.c	2003-01-10 13:08:24.000000000 +0100
@@ -600,9 +600,7 @@
 static void eexp_timeout(struct net_device *dev)
 {
 	struct net_local *lp = (struct net_local *)dev->priv;
-#ifdef CONFIG_SMP
 	unsigned long flags;
-#endif
 	int status;

 	disable_irq(dev->irq);
@@ -612,9 +610,7 @@
 	 *	lets make it work first..
 	 */

-#ifdef CONFIG_SMP
 	spin_lock_irqsave(&lp->lock, flags);
-#endif

 	status = scb_status(dev);
 	unstick_cu(dev);
@@ -628,9 +624,7 @@
 		outb(0,dev->base_addr+SIGNAL_CA);
 	}
 	netif_wake_queue(dev);
-#ifdef CONFIG_SMP
 	spin_unlock_irqrestore(&lp->lock, flags);
-#endif
 }

 /*
@@ -640,9 +634,7 @@
 static int eexp_xmit(struct sk_buff *buf, struct net_device *dev)
 {
 	struct net_local *lp = (struct net_local *)dev->priv;
-#ifdef CONFIG_SMP
 	unsigned long flags;
-#endif

 #if NET_DEBUG > 6
 	printk(KERN_DEBUG "%s: eexp_xmit()\n", dev->name);
@@ -655,9 +647,7 @@
 	 *	lets make it work first..
 	 */

-#ifdef CONFIG_SMP
 	spin_lock_irqsave(&lp->lock, flags);
-#endif

 	{
 		unsigned short length = (ETH_ZLEN < buf->len) ? buf->len :
@@ -669,9 +659,7 @@
 	        eexp_hw_tx_pio(dev,data,length);
 	}
 	dev_kfree_skb(buf);
-#ifdef CONFIG_SMP
 	spin_unlock_irqrestore(&lp->lock, flags);
-#endif
 	enable_irq(dev->irq);
 	return 0;
 }

[-- Attachment #2: Type: TEXT/plain, Size: 1434 bytes --]

--- linux/drivers/net/eexpress.c	2002-11-29 00:53:13.000000000 +0100
+++ linux.new/drivers/net/eexpress.c	2003-01-10 13:08:24.000000000 +0100
@@ -600,9 +600,7 @@
 static void eexp_timeout(struct net_device *dev)
 {
 	struct net_local *lp = (struct net_local *)dev->priv;
-#ifdef CONFIG_SMP
 	unsigned long flags;
-#endif
 	int status;
 	
 	disable_irq(dev->irq);
@@ -612,9 +610,7 @@
 	 *	lets make it work first..
 	 */
 	 
-#ifdef CONFIG_SMP
 	spin_lock_irqsave(&lp->lock, flags);
-#endif
 
 	status = scb_status(dev);
 	unstick_cu(dev);
@@ -628,9 +624,7 @@
 		outb(0,dev->base_addr+SIGNAL_CA);
 	}
 	netif_wake_queue(dev);	
-#ifdef CONFIG_SMP
 	spin_unlock_irqrestore(&lp->lock, flags);
-#endif
 }
 
 /*
@@ -640,9 +634,7 @@
 static int eexp_xmit(struct sk_buff *buf, struct net_device *dev)
 {
 	struct net_local *lp = (struct net_local *)dev->priv;
-#ifdef CONFIG_SMP
 	unsigned long flags;
-#endif
 
 #if NET_DEBUG > 6
 	printk(KERN_DEBUG "%s: eexp_xmit()\n", dev->name);
@@ -655,9 +647,7 @@
 	 *	lets make it work first..
 	 */
 	 
-#ifdef CONFIG_SMP
 	spin_lock_irqsave(&lp->lock, flags);
-#endif
   
 	{
 		unsigned short length = (ETH_ZLEN < buf->len) ? buf->len :
@@ -669,9 +659,7 @@
 	        eexp_hw_tx_pio(dev,data,length);
 	}
 	dev_kfree_skb(buf);
-#ifdef CONFIG_SMP
 	spin_unlock_irqrestore(&lp->lock, flags);
-#endif
 	enable_irq(dev->irq);
 	return 0;
 }

^ permalink raw reply

* [2.5 patch] remove kernel 2.0 and 2.2 code from drivers/net/wan/lmc/*
From: Adrian Bunk @ 2003-01-10 12:10 UTC (permalink / raw)
  To: asj, linux-net; +Cc: linux-kernel

The patch below removes obsolete #if'd code for kernel 2.0 and 2.2 from
drivers/net/wan/lmc/* (this includes the expansion of some #define's 
that were definded differently for different kernel versions).

cu
Adrian


--- linux-2.5.55/drivers/net/wan/lmc/lmc_ver.h	2003-01-10 12:25:28.000000000 +0100
+++ /dev/null	2003-01-09 00:39:47.000000000 +0100
@@ -1,123 +0,0 @@
-#ifndef _IF_LMC_LINUXVER_
-#define _IF_LMC_LINUXVER_
-
- /*
-  * Copyright (c) 1997-2000 LAN Media Corporation (LMC)
-  * All rights reserved.  www.lanmedia.com
-  *
-  * This code is written by:
-  * Andrew Stanley-Jones (asj@cban.com)
-  * Rob Braun (bbraun@vix.com),
-  * Michael Graff (explorer@vix.com) and
-  * Matt Thomas (matt@3am-software.com).
-  *
-  * This software may be used and distributed according to the terms
-  * of the GNU General Public License version 2, incorporated herein by reference.
-  */
-
- /*
-  * This file defines and controls all linux version
-  * differences.
-  *
-  * This is being done to keep 1 central location where all linux
-  * version differences can be kept and maintained.  as this code was
-  * found version issues where pepered throughout the source code and
-  * made the souce code not only hard to read but version problems hard
-  * to track down.  If I'm overiding a function/etc with something in
-  * this file it will be prefixed by "LMC_" which will mean look
-  * here for the version dependant change that's been done.
-  *
-  */
-
-#if LINUX_VERSION_CODE < 0x20363
-#define net_device device
-#endif
-
-#if LINUX_VERSION_CODE < 0x20363
-#define LMC_XMITTER_BUSY(x) (x)->tbusy = 1
-#define LMC_XMITTER_FREE(x) (x)->tbusy = 0
-#define LMC_XMITTER_INIT(x) (x)->tbusy = 0
-#else
-#define LMC_XMITTER_BUSY(x) netif_stop_queue(x)
-#define LMC_XMITTER_FREE(x) netif_wake_queue(x)
-#define LMC_XMITTER_INIT(x) netif_start_queue(x)
-
-#endif
-
-
-#if LINUX_VERSION_CODE < 0x20100
-//typedef unsigned int u_int32_t;
-
-#define  LMC_SETUP_20_DEV {\
-                             int indx; \
-                             for (indx = 0; indx < DEV_NUMBUFFS; indx++) \
-                                skb_queue_head_init (&dev->buffs[indx]); \
-                          } \
-                          dev->family = AF_INET; \
-                          dev->pa_addr = 0; \
-                          dev->pa_brdaddr = 0; \
-                          dev->pa_mask = 0xFCFFFFFF; \
-                          dev->pa_alen = 4;		/* IP addr.  sizeof(u32) */
-
-#else
-
-#define LMC_SETUP_20_DEV
-
-#endif
-
-
-#if LINUX_VERSION_CODE < 0x20155 /* basically 2.2 plus */
-
-#define LMC_DEV_KFREE_SKB(skb) dev_kfree_skb((skb), FREE_WRITE)
-#define LMC_PCI_PRESENT() pcibios_present()
-
-#else /* Mostly 2.0 kernels */
-
-#define LMC_DEV_KFREE_SKB(skb) dev_kfree_skb(skb)
-#define LMC_PCI_PRESENT() pci_present()
-
-#endif
-
-#if LINUX_VERSION_CODE < 0x20200
-#else
-
-#endif
-
-#if LINUX_VERSION_CODE < 0x20100
-#define LMC_SKB_FREE(skb, val) (skb->free = val)
-#else
-#define LMC_SKB_FREE(skb, val)
-#endif
-
-
-#if (LINUX_VERSION_CODE >= 0x20200)
-
-#define LMC_SPIN_FLAGS                unsigned long flags;
-#define LMC_SPIN_LOCK_INIT(x)         spin_lock_init(&(x)->lmc_lock);
-#define LMC_SPIN_UNLOCK(x)            ((x)->lmc_lock = SPIN_LOCK_UNLOCKED)
-#define LMC_SPIN_LOCK_IRQSAVE(x)      spin_lock_irqsave (&(x)->lmc_lock, flags);
-#define LMC_SPIN_UNLOCK_IRQRESTORE(x) spin_unlock_irqrestore (&(x)->lmc_lock, flags);
-#else
-#define LMC_SPIN_FLAGS
-#define LMC_SPIN_LOCK_INIT(x)
-#define LMC_SPIN_UNLOCK(x)
-#define LMC_SPIN_LOCK_IRQSAVE(x)
-#define LMC_SPIN_UNLOCK_IRQRESTORE(x)
-#endif
-
-
-#if LINUX_VERSION_CODE >= 0x20100
-#define LMC_COPY_FROM_USER(x, y, z) if(copy_from_user ((x), (y), (z))) return -EFAULT
-#define LMC_COPY_TO_USER(x, y, z) if(copy_to_user ((x), (y), (z))) return -EFAULT
-#else
-#define LMC_COPY_FROM_USER(x, y, z) if(verify_area(VERIFY_READ, (y), (z))) \
-			               return -EFAULT; \
-                                    memcpy_fromfs ((x), (y), (z))
-
-#define LMC_COPY_TO_USER(x, y, z)   if(verify_area(VERIFY_WRITE, (x), (z))) \
-	                               return -EFAULT; \
-                                    memcpy_tofs ((x), (y), (z))
-#endif
-
-
-#endif
--- linux-2.5.55/drivers/net/wan/lmc/lmc_var.h.old	2003-01-10 11:48:33.000000000 +0100
+++ linux-2.5.55/drivers/net/wan/lmc/lmc_var.h	2003-01-10 11:49:14.000000000 +0100
@@ -48,9 +48,6 @@
 #define u_int16_t	u16
 #define u_int8_t	u8
 #define tulip_uint32_t	u32
-#if LINUX_VERSION_CODE < 0x20155
-#define u_int32_t	u32
-#endif
 
 #define LMC_REG_RANGE 0x80
 
@@ -410,9 +407,7 @@
         u32                     last_int;
         u32                     num_int;
 
-#if LINUX_VERSION_CODE >= 0x20200
 	spinlock_t              lmc_lock;
-#endif
         u_int16_t               if_type;       /* PPP or NET */
         struct ppp_device       *pd;
 
@@ -550,10 +545,6 @@
 #define LMC_CRC_LEN_16 2  /* 16-bit CRC */
 #define LMC_CRC_LEN_32 4
 
-#if LINUX_VERSION_CODE < 0x20100
-#define test_and_set_bit(val, addr) set_bit(val, addr)
-#endif
-
 #ifdef LMC_HDLC
 /* definition of an hdlc header. */
 struct hdlc_hdr
--- linux-2.5.55/drivers/net/wan/lmc/lmc_media.c.old	2003-01-10 11:49:50.000000000 +0100
+++ linux-2.5.55/drivers/net/wan/lmc/lmc_media.c	2003-01-10 12:26:54.000000000 +0100
@@ -1,6 +1,5 @@
 /* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */
 
-#include <linux/version.h>
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -11,9 +10,6 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
-#if LINUX_VERSION_CODE < 0x20155
-#include <linux/bios32.h>
-#endif
 #include <linux/in.h>
 #include <linux/if_arp.h>
 #include <linux/netdevice.h>
@@ -28,11 +24,8 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 
-#if LINUX_VERSION_CODE >= 0x20200
 #include <asm/uaccess.h>
-#endif
 
-#include "lmc_ver.h"
 #include "lmc.h"
 #include "lmc_var.h"
 #include "lmc_ioctl.h"
--- linux-2.5.55/drivers/net/wan/lmc/lmc_debug.c.old	2003-01-10 12:29:02.000000000 +0100
+++ linux-2.5.55/drivers/net/wan/lmc/lmc_debug.c	2003-01-10 12:26:27.000000000 +0100
@@ -2,9 +2,7 @@
 #include <linux/types.h>
 #include <linux/netdevice.h>
 #include <linux/interrupt.h>
-#include <linux/version.h>
 
-#include "lmc_ver.h"
 #include "lmc_debug.h"
 
 /*
--- linux-2.5.55/drivers/net/wan/lmc/lmc_proto.c.old	2003-01-10 12:28:52.000000000 +0100
+++ linux-2.5.55/drivers/net/wan/lmc/lmc_proto.c	2003-01-10 12:27:04.000000000 +0100
@@ -19,7 +19,6 @@
   * Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards.
   */
 
-#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/timer.h>
@@ -46,7 +45,6 @@
 #include <asm/dma.h>
 #include <asm/smp.h>
 
-#include "lmc_ver.h"
 #include "lmc.h"
 #include "lmc_var.h"
 #include "lmc_debug.h"
@@ -66,14 +64,6 @@
 #define SPPP_attach(d)	(void)0
 #define SPPP_do_ioctl(d,i,c)	-EOPNOTSUPP
 #else
-#if LINUX_VERSION_CODE < 0x20363
-#define SPPP_attach(x)	sppp_attach((struct ppp_device *)(x)->lmc_device)
-#define SPPP_detach(x)	sppp_detach((x)->lmc_device)
-#define SPPP_open(x)	sppp_open((x)->lmc_device)
-#define SPPP_reopen(x)	sppp_reopen((x)->lmc_device)
-#define SPPP_close(x)	sppp_close((x)->lmc_device)
-#define SPPP_do_ioctl(x, y, z)	sppp_do_ioctl((x)->lmc_device, (y), (z))
-#else
 #define SPPP_attach(x)	sppp_attach((x)->pd)
 #define SPPP_detach(x)	sppp_detach((x)->pd->dev)
 #define SPPP_open(x)	sppp_open((x)->pd->dev)
@@ -81,7 +71,6 @@
 #define SPPP_close(x)	sppp_close((x)->pd->dev)
 #define SPPP_do_ioctl(x, y, z)	sppp_do_ioctl((x)->pd->dev, (y), (z))
 #endif
-#endif
 
 // init
 void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/
@@ -89,15 +78,12 @@
     lmc_trace(sc->lmc_device, "lmc_proto_init in");
     switch(sc->if_type){
     case LMC_PPP:
-        
-#if LINUX_VERSION_CODE >= 0x20363
         sc->pd = kmalloc(sizeof(struct ppp_device), GFP_KERNEL);
 	if (!sc->pd) {
 		printk("lmc_proto_init(): kmalloc failure!\n");
 		return;
 	}
         sc->pd->dev = sc->lmc_device;
-#endif
         sc->if_ptr = sc->pd;
         break;
     case LMC_RAW:
--- linux-2.5.55/drivers/net/wan/lmc/lmc_main.c.old	2003-01-10 11:52:23.000000000 +0100
+++ linux-2.5.55/drivers/net/wan/lmc/lmc_main.c	2003-01-10 12:58:53.000000000 +0100
@@ -11,7 +11,7 @@
   * With Help By:
   * David Boggs
   * Ron Crane
-  * Allan Cox
+  * Alan Cox
   *
   * This software may be used and distributed according to the terms
   * of the GNU General Public License version 2, incorporated herein by reference.
@@ -38,7 +38,6 @@
 
 /* $Id: lmc_main.c,v 1.36 2000/04/11 05:25:25 asj Exp $ */
 
-#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/string.h>
@@ -51,9 +50,6 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/init.h>
-#if LINUX_VERSION_CODE < 0x20155
-#include <linux/bios32.h>
-#endif
 #include <linux/in.h>
 #include <linux/if_arp.h>
 #include <linux/netdevice.h>
@@ -67,12 +63,8 @@
 #include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/dma.h>
-#if LINUX_VERSION_CODE >= 0x20200
 #include <asm/uaccess.h>
 //#include <asm/spinlock.h>
-#else				/* 2.0 kernel */
-#define ARPHRD_HDLC 513
-#endif
 
 #define DRIVER_MAJOR_VERSION     1
 #define DRIVER_MINOR_VERSION    34
@@ -80,7 +72,6 @@
 
 #define DRIVER_VERSION  ((DRIVER_MAJOR_VERSION << 8) + DRIVER_MINOR_VERSION)
 
-#include "lmc_ver.h"
 #include "lmc.h"
 #include "lmc_var.h"
 #include "lmc_ioctl.h"
@@ -127,10 +118,8 @@
 static int lmc_init(struct net_device * const);
 static void lmc_reset(lmc_softc_t * const sc);
 static void lmc_dec_reset(lmc_softc_t * const sc);
-#if LINUX_VERSION_CODE >= 0x20363
 static void lmc_driver_timeout(struct net_device *dev);
 int lmc_setup(void);
-#endif
 
 
 /*
@@ -165,7 +154,8 @@
          * To date internally, just copy this out to the user.
          */
     case LMCIOCGINFO: /*fold01*/
-        LMC_COPY_TO_USER(ifr->ifr_data, &sc->ictl, sizeof (lmc_ctl_t));
+        if (copy_to_user(ifr->ifr_data, &sc->ictl, sizeof (lmc_ctl_t)))
+            return -EFAULT;
         ret = 0;
         break;
 
@@ -181,7 +171,8 @@
             break;
         }
 
-        LMC_COPY_FROM_USER(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t));
+        if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)))
+            return -EFAULT;
 
         sc->lmc_media->set_status (sc, &ctl);
 
@@ -211,7 +202,8 @@
 		break;
 	    }
 
-	    LMC_COPY_FROM_USER(&new_type, ifr->ifr_data, sizeof(u_int16_t));
+	    if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t)))
+                return -EFAULT;
 
             
 	    if (new_type == old_type)
@@ -248,8 +240,9 @@
 
         sc->lmc_xinfo.Magic1 = 0xDEADBEEF;
 
-        LMC_COPY_TO_USER(ifr->ifr_data, &sc->lmc_xinfo,
-                         sizeof (struct lmc_xinfo));
+        if (copy_to_user(ifr->ifr_data, &sc->lmc_xinfo,
+                         sizeof (struct lmc_xinfo)))
+            return -EFAULT;
         ret = 0;
 
         break;
@@ -279,8 +272,9 @@
                 regVal & T1FRAMER_SEF_MASK;
         }
 
-        LMC_COPY_TO_USER(ifr->ifr_data, &sc->stats,
-                         sizeof (struct lmc_statistics));
+        if (copy_to_user(ifr->ifr_data, &sc->stats,
+                         sizeof (struct lmc_statistics)))
+            return -EFAULT;
 
         ret = 0;
         break;
@@ -310,7 +304,8 @@
             break;
         }
 
-        LMC_COPY_FROM_USER(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t));
+        if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)))
+            return -EFAULT;
         sc->lmc_media->set_circuit_type(sc, ctl.circuit_type);
         sc->ictl.circuit_type = ctl.circuit_type;
         ret = 0;
@@ -335,8 +330,10 @@
 
 #ifdef DEBUG
     case LMCIOCDUMPEVENTLOG:
-        LMC_COPY_TO_USER(ifr->ifr_data, &lmcEventLogIndex, sizeof (u32));
-        LMC_COPY_TO_USER(ifr->ifr_data + sizeof (u32), lmcEventLogBuf, sizeof (lmcEventLogBuf));
+        if (copy_to_user(ifr->ifr_data, &lmcEventLogIndex, sizeof (u32)))
+            return -EFAULT;
+        if (copy_to_user(ifr->ifr_data + sizeof (u32), lmcEventLogBuf, sizeof (lmcEventLogBuf)))
+            return -EFAULT;
 
         ret = 0;
         break;
@@ -359,9 +356,10 @@
             /*
              * Stop the xwitter whlie we restart the hardware
              */
-            LMC_XMITTER_BUSY(dev);
+            netif_stop_queue(dev);
 
-            LMC_COPY_FROM_USER(&xc, ifr->ifr_data, sizeof (struct lmc_xilinx_control));
+            if (copy_from_user(&xc, ifr->ifr_data, sizeof (struct lmc_xilinx_control)))
+                return -EFAULT;
             switch(xc.command){
             case lmc_xilinx_reset: /*fold02*/
                 {
@@ -620,7 +618,7 @@
                 break;
             }
 
-            LMC_XMITTER_FREE(dev);
+            netif_wake_queue(dev);
             sc->lmc_txfull = 0;
 
         }
@@ -646,7 +644,7 @@
     lmc_softc_t *sc;
     int link_status;
     u_int32_t ticks;
-    LMC_SPIN_FLAGS;
+    unsigned long flags;
 
     sc = dev->priv;
 
@@ -836,11 +834,7 @@
      * Allocate our own device structure
      */
 
-#if LINUX_VERSION_CODE < 0x20363
-    dev = kmalloc (sizeof (struct ppp_device)+8, GFP_KERNEL);
-#else
     dev = kmalloc (sizeof (struct net_device)+8, GFP_KERNEL);
-#endif
     if (dev == NULL){
         printk (KERN_ERR "lmc: kmalloc for device failed\n");
         return NULL;
@@ -909,10 +903,8 @@
     dev->get_stats = lmc_get_stats;
     dev->do_ioctl = lmc_ioctl;
     dev->set_config = lmc_set_config;
-#if LINUX_VERSION_CODE >= 0x20363
     dev->tx_timeout = lmc_driver_timeout;
     dev->watchdog_timeo = (HZ); /* 1 second */
-#endif
     
     /*
      * Why were we changing this???
@@ -923,8 +915,6 @@
 
     spin_lock_init(&sc->lmc_lock);
 
-    LMC_SETUP_20_DEV;
-
     printk ("%s: detected at %lx, irq %d\n", dev->name, ioaddr, dev->irq);
 
     if (register_netdev (dev) != 0) {
@@ -1048,7 +1038,7 @@
      * PCI bus, we are in trouble.
      */
 
-    if (!LMC_PCI_PRESENT()) {
+    if (!pci_present()) {
 /*        printk ("%s: We really want a pci bios!\n", dev->name);*/
         return -1;
     }
@@ -1124,11 +1114,7 @@
     if (cards_found < 1)
         return -1;
 
-#if LINUX_VERSION_CODE >= 0x20200
     return foundaddr;
-#else
-    return 0;
-#endif
 }
 
 /* After this is called, packets can be sent.
@@ -1199,11 +1185,7 @@
     dev->do_ioctl = lmc_ioctl;
 
 
-    LMC_XMITTER_INIT(dev);
-    
-#if LINUX_VERSION_CODE < 0x20363
-    dev->start = 1;
-#endif
+    netif_start_queue(dev);
     
     sc->stats.tx_tbusy0++ ;
 
@@ -1277,7 +1259,7 @@
 
     //dev->flags |= IFF_RUNNING;
     
-    LMC_XMITTER_FREE(dev);
+    netif_wake_queue(dev);
 
     sc->lmc_txfull = 0;
     sc->stats.tx_tbusy0++ ;
@@ -1327,7 +1309,7 @@
     
     /* Don't let anything else go on right now */
     //    dev->start = 0;
-    LMC_XMITTER_BUSY(dev);
+    netif_stop_queue(dev);
     sc->stats.tx_tbusy1++ ;
 
     /* stop interrupts */
@@ -1360,23 +1342,20 @@
         sc->lmc_rxring[i].length = 0;
         sc->lmc_rxring[i].buffer1 = 0xDEADBEEF;
         if (skb != NULL)
-        {
-            LMC_SKB_FREE(skb, 1);
-            LMC_DEV_KFREE_SKB (skb);
-        }
+            dev_kfree_skb(skb);
         sc->lmc_rxq[i] = NULL;
     }
 
     for (i = 0; i < LMC_TXDESCS; i++)
     {
         if (sc->lmc_txq[i] != NULL)
-            LMC_DEV_KFREE_SKB (sc->lmc_txq[i]);
+            dev_kfree_skb(sc->lmc_txq[i]);
         sc->lmc_txq[i] = NULL;
     }
 
     lmc_led_off (sc, LMC_MII16_LED_ALL);
 
-    LMC_XMITTER_FREE(dev);
+    netif_wake_queue(dev);
     sc->stats.tx_tbusy0++ ;
 
     lmc_trace(dev, "lmc_ifdown out");
@@ -1493,14 +1472,12 @@
                 }
                 else {
                     
-#if LINUX_VERSION_CODE >= 0x20200
                     sc->stats.tx_bytes += sc->lmc_txring[i].length & 0x7ff;
-#endif
                     
                     sc->stats.tx_packets++;
                 }
                 
-                //                LMC_DEV_KFREE_SKB (sc->lmc_txq[i]);
+                //                dev_kfree_skb(sc->lmc_txq[i]);
                 dev_kfree_skb_irq(sc->lmc_txq[i]);
                 sc->lmc_txq[i] = 0;
 
@@ -1515,20 +1492,14 @@
             }
             LMC_EVENT_LOG(LMC_EVENT_TBUSY0, n_compl, 0);
             sc->lmc_txfull = 0;
-            LMC_XMITTER_FREE(dev);
+            netif_wake_queue(dev);
             sc->stats.tx_tbusy0++ ;
-#if LINUX_VERSION_CODE < 0x20363
-            mark_bh (NET_BH);	/* Tell Linux to give me more packets */
-#endif
 
 
 #ifdef DEBUG
             sc->stats.dirtyTx = badtx;
             sc->stats.lmc_next_tx = sc->lmc_next_tx;
             sc->stats.lmc_txfull = sc->lmc_txfull;
-#if LINUX_VERSION_CODE < 0x20363
-            sc->stats.tbusy = dev->tbusy;
-#endif
 #endif
             sc->lmc_taint_tx = badtx;
 
@@ -1588,7 +1559,7 @@
     u32 flag;
     int entry;
     int ret = 0;
-    LMC_SPIN_FLAGS;
+    unsigned long flags;
 
     lmc_trace(dev, "lmc_start_xmit in");
 
@@ -1596,60 +1567,6 @@
 
     spin_lock_irqsave(&sc->lmc_lock, flags);
 
-    /*
-     * If the transmitter is busy
-     * this must be the 5 second polling
-     * from the kernel which called us.
-     * Poke the chip and try to get it running
-     *
-     */
-#if LINUX_VERSION_CODE < 0x20363
-    if(dev->tbusy != 0){
-        u32 csr6;
-
-        printk("%s: Xmitter busy|\n", dev->name);
-
-	sc->stats.tx_tbusy_calls++ ;
-        if (jiffies - dev->trans_start < TX_TIMEOUT) {
-            ret = 1;
-            goto lmc_start_xmit_bug_out;
-        }
-
-        /*
-         * Chip seems to have locked up
-         * Reset it
-         * This whips out all our decriptor
-         * table and starts from scartch
-         */
-
-        LMC_EVENT_LOG(LMC_EVENT_XMTPRCTMO,
-                      LMC_CSR_READ (sc, csr_status),
-                      sc->stats.tx_ProcTimeout);
-
-        lmc_running_reset (dev);
-
-        LMC_EVENT_LOG(LMC_EVENT_RESET1, LMC_CSR_READ (sc, csr_status), 0);
-        LMC_EVENT_LOG(LMC_EVENT_RESET2,
-                      lmc_mii_readreg (sc, 0, 16),
-                      lmc_mii_readreg (sc, 0, 17));
-
-        /* restart the tx processes */
-        csr6 = LMC_CSR_READ (sc, csr_command);
-        LMC_CSR_WRITE (sc, csr_command, csr6 | 0x0002);
-        LMC_CSR_WRITE (sc, csr_command, csr6 | 0x2002);
-
-        /* immediate transmit */
-        LMC_CSR_WRITE (sc, csr_txpoll, 0);
-
-        sc->stats.tx_errors++;
-        sc->stats.tx_ProcTimeout++;	/* -baz */
-
-        dev->trans_start = jiffies;
-
-        ret = 1;
-        goto lmc_start_xmit_bug_out;
-    }
-#endif
     /* normal path, tbusy known to be zero */
 
     entry = sc->lmc_next_tx % LMC_TXDESCS;
@@ -1665,26 +1582,26 @@
     {
         /* Do not interrupt on completion of this packet */
         flag = 0x60000000;
-        LMC_XMITTER_FREE(dev);
+        netif_wake_queue(dev);
     }
     else if (sc->lmc_next_tx - sc->lmc_taint_tx == LMC_TXDESCS / 2)
     {
         /* This generates an interrupt on completion of this packet */
         flag = 0xe0000000;
-        LMC_XMITTER_FREE(dev);
+        netif_wake_queue(dev);
     }
     else if (sc->lmc_next_tx - sc->lmc_taint_tx < LMC_TXDESCS - 1)
     {
         /* Do not interrupt on completion of this packet */
         flag = 0x60000000;
-        LMC_XMITTER_FREE(dev);
+        netif_wake_queue(dev);
     }
     else
     {
         /* This generates an interrupt on completion of this packet */
         flag = 0xe0000000;
         sc->lmc_txfull = 1;
-        LMC_XMITTER_BUSY(dev);
+        netif_stop_queue(dev);
     }
 #else
     flag = LMC_TDES_INTERRUPT_ON_COMPLETION;
@@ -1692,7 +1609,7 @@
     if (sc->lmc_next_tx - sc->lmc_taint_tx >= LMC_TXDESCS - 1)
     {				/* ring full, go busy */
         sc->lmc_txfull = 1;
-        LMC_XMITTER_BUSY(dev);
+        netif_stop_queue(dev);
         sc->stats.tx_tbusy1++ ;
         LMC_EVENT_LOG(LMC_EVENT_TBUSY1, entry, 0);
     }
@@ -1722,10 +1639,6 @@
 
     dev->trans_start = jiffies;
 
-#if LINUX_VERSION_CODE < 0x20363
-lmc_start_xmit_bug_out:
-#endif
-
     spin_unlock_irqrestore(&sc->lmc_lock, flags);
 
     lmc_trace(dev, "lmc_start_xmit_out");
@@ -1811,7 +1724,6 @@
         if(skb == 0x0){
             nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2);
             if (nsb) {
-                LMC_SKB_FREE(nsb, 1);
                 sc->lmc_rxq[i] = nsb;
                 nsb->dev = dev;
                 sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail);
@@ -1855,7 +1767,6 @@
              */
             nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2);
             if (nsb) {
-                LMC_SKB_FREE(nsb, 1);
                 sc->lmc_rxq[i] = nsb;
                 nsb->dev = dev;
                 sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail);
@@ -1944,7 +1855,7 @@
 static struct net_device_stats *lmc_get_stats (struct net_device *dev) /*fold00*/
 {
     lmc_softc_t *sc;
-    LMC_SPIN_FLAGS;
+    unsigned long flags;
 
     lmc_trace(dev, "lmc_get_stats in");
 
@@ -2144,7 +2055,6 @@
         }
 
         skb->dev = sc->lmc_device;
-        LMC_SKB_FREE(skb, 1);
 
         /* owned by 21140 */
         sc->lmc_rxring[i].status = 0x80000000;
@@ -2363,11 +2273,10 @@
     lmc_trace(sc->lmc_device, "lmc_initcsrs out");
 }
 
-#if LINUX_VERSION_CODE >= 0x20363
 static void lmc_driver_timeout(struct net_device *dev) { /*fold00*/
     lmc_softc_t *sc;
     u32 csr6;
-    LMC_SPIN_FLAGS;
+    unsigned long flags;
 
     lmc_trace(dev, "lmc_driver_timeout in");
 
@@ -2426,4 +2335,3 @@
    return lmc_probe(NULL);
 }
 
-#endif


^ permalink raw reply

* Re: Are linux network drivers really affected by this?
From: Denis Vlasenko @ 2003-01-10 12:11 UTC (permalink / raw)
  To: andrea.glorioso, Alan Cox; +Cc: Linux Kernel Mailing List
In-Reply-To: <8765sx2r8u.fsf@topo.binary-only.priv>

On 10 January 2003 13:12, andrea.glorioso@binary-only.com wrote:
> >>>>> "ac" == Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
>
>     ac> Most of  them will pad with zero.  We have a couple of
> drivers ac> that already pad with something along  the lines of
> "NetBSD is ac> a cool OS too.."
>
> Let's talk about subliminal messages, then. :)
>
> How sensible would it be to have a runtime or  compile time option
> for choosing between zero padding and  random values padding?  I
> think the variable length of the  padding could cause some
> performance problems, but I'm no kernel hacker nor cryptography
> expert.

Too much work for zero gain
--
vda

^ permalink raw reply

* Re: Another idea for simplifying locking in kernel/module.c
From: Adam J. Richter @ 2003-01-10 12:18 UTC (permalink / raw)
  To: rusty; +Cc: davem, linux-kernel

Rusty Russell wrote:
>In message <200301100910.BAA31409@adam.yggdrasil.com> you write:
>> Rusty Russell wrote:
>> >In message <200301070219.SAA12905@adam.yggdrasil.com> you write:
>> >> 	Here is a way to replace all of the specialized "stop CPU"
>> >> locking code in kernel/module.c with an rw_semaphore by using
>> >> down_read_trylock in try_module_get() and down_write when beginning to
>> >> unload the module.
>> 
>> >And now you can't modularize netfilter modules.
>> 
>> 	Why not?  Last time you went looking in the networking code
>> for an example of something that had to increment a module reference
>> in a context where blocking was not allowed you ended up conceding
>> that you example was incorrect.

>No, you're thinking of the IPv4 stack.  I didn't use netfilter as an
>example, because that opens me to "well, FIX NETFILTER then!".  If it
>were the only case, it's probably arguable.

>The problems with netfilter modules are exactly why I started looking
>at module locking over two years ago.

>> 	I just booted my gateway machine to a kernel using my
>> aforemetioned patch and various netfilter modules.  I've surfed the
>> web, FTP'ed file and run irc through it.  It seems to be okay.

>Sure!  That's because the netfilter modules use a horrific hack, by
>keeping their own "usage" counts and then spinning (potentially
>forever) on unload until it hits zero.
[...]

	Although I suspect that this could be fixed so that the
spinning is guanteed not to be forever, it happens that my
module_put(), which is the same as your module_put() is non-blocking
(as is my try_module_get(), by the way).  So I don't see what the
problem is.  You should still be able to call try_module_get and
module_put from an interrupt context.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

	

^ permalink raw reply

* Re: Oops with usb-mass-storage
From: Denis Vlasenko @ 2003-01-10 12:09 UTC (permalink / raw)
  To: Chrissie, mdharm-usb, linux-kernel, sjr, eyesee, anti,
	thomas.hechelhammer
In-Reply-To: <Pine.LNX.4.50.0301091702070.958-100000@balearen.x-tra-designs>

On 9 January 2003 18:50, Chrissie wrote:
> Now, i get the following output in dmesg after switching the camera
> on: hub.c: connect-debounce failed, port 2 disabled
> hub.c: new USB device 00:07.2-2, assigned address 2
> scsi1 : SCSI emulation for USB Mass Storage devices
>   Vendor:           Model:                   Rev:
>   Type:   Direct-Access                      ANSI SCSI revision: 02
> WARNING: USB Mass Storage data integrity not assured
> USB Mass Storage device found at 2
>
> Looks quite good, i think.
>
> chrissie@balearen:~$ cat /proc/scsi/scsi
> Attached devices:
> Host: scsi0 Channel: 00 Id: 00 Lun: 00
>   Vendor: LITEON   Model: CD-ROM LTN301    Rev: ML35
>   Type:   CD-ROM                           ANSI SCSI revision: 02
> Host: scsi0 Channel: 00 Id: 01 Lun: 00
>   Vendor:          Model: CD-R/RW RW7120A  Rev: 1.10
>   Type:   CD-ROM                           ANSI SCSI revision: 02
> Host: scsi1 Channel: 00 Id: 00 Lun: 00
>   Vendor: DSC      Model: Card Reader      Rev:  .
>   Type:   Direct-Access                    ANSI SCSI revision: 02
>
> The device now seems to be recogniced, and the usb-storage-to-scsi
> seems to work as well.
>
> I was very happy so far. But when i enter the following:
>
> root@balearen:~# mount /dev/sda1 /mnt -t vfat
>
> i get an kernel oops after following additional output to the console

An oops? This is *the* first oops, please decode and post it to USB folks.
Subsequent oopses are of much less help...
--
vda

^ permalink raw reply

* Re: UnitedLinux violating GPL?
From: Adrian Bunk @ 2003-01-10 12:19 UTC (permalink / raw)
  To: Horst von Brand; +Cc: Jeff Garzik, linux-kernel
In-Reply-To: <200301101055.h0AAtLoe007296@eeyore.valparaiso.cl>

On Fri, Jan 10, 2003 at 11:55:21AM +0100, Horst von Brand wrote:

>...
> they aren't in violation. Sure, having a look at the non-official patches
> they apply would be nice, but not mandated by GPL.

[ disclaimer: the UnitedLinux issue in the subject is already resolved ]

This is wrong. Section 3 of the GPL says that you have to accompany the
binaries either with the complete source code (and this includes all
patches you have applied) or with a "written offer, valid for at least
three years, to give any third party for a charge no more than your cost
of physically performing source distribution, a complete
machine-readable copy of the corresponding source code".

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply

* [LARTC] HTB rate 0kbit
From: Thomas Jalsovsky @ 2003-01-10 12:12 UTC (permalink / raw)
  To: lartc


Hello,

	I would like to achieve this:
HTB qdisc with many classes. One class shouldn't have guaranteed
bandwidth, only ceil bandwidth -> if there is available bandwidth, the
this class can use it, but if everybody uses the whole bandwidth it should
get any bandwidth.
	I tryed this with HTB to set rate to 0 and ceil to the max value
(rate 0kbit ceil 1920kbit) - unfortunately I got error message :(

	Is it possible to have this configuration?

	Thanks in advance,
		Thomas
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply

* Re: UnitedLinux violating GPL?
From: Nicholas Berry @ 2003-01-10 12:25 UTC (permalink / raw)
  To: cort; +Cc: linux-kernel



>>> Cort Dougan <cort@fsmlabs.com> 01/09/03 07:36PM >>>
> If people starting doing that what would be have to argue about?

Lets see:

Calling Linux GNU/Linux
Calling Hurd Linux/Hurd
Calling my mother a computer illiterate bimbo.
BK.

That should do for now.

Nik

} Why don't you _read_ the GPL instead of making wrong statements?



^ permalink raw reply


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.