android_kernel_xiaomi_sm8350/drivers
David Gibson 5826cade43 [PATCH] ibmveth: Fix index increment calculation
On Thu, Oct 12, 2006 at 06:22:14PM +1000, David Gibson wrote:
> Your recent ibmveth commit, 751ae21c6c
> ("fix int rollover panic"), causes a rapid oops on my test machine
> (POWER5 LPAR).
>
> I've bisected it down to that commit, but am still investigating the
> cause of the crash itself.

Found the problem, I believe: an object lesson in the need for great
caution using ++.

[...]
@@ -213,6 +213,7 @@ static void ibmveth_replenish_buffer_poo
 		}

 		free_index = pool->consumer_index++ % pool->size;
+		pool->consumer_index = free_index;
 		index = pool->free_map[free_index];

 		ibmveth_assert(index != IBM_VETH_INVALID_MAP);

Since the ++ is used as post-increment, the increment is not included
in free_index, and so the added line effectively reverts the
increment.  The produced_index side has an analagous bug.

The following change corrects this:

The recent commit 751ae21c6c introduced
a bug in the producer/consumer index calculation in the ibmveth driver
- incautious use of the post-increment ++ operator resulted in an
increment being immediately reverted.  This patch corrects the logic.

Without this patch, the driver oopses almost immediately after
activation on at least some machines.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-10-21 14:34:21 -04:00
..
acorn
acpi [PATCH] acpi memory hotplug: remove strange add_memory fail message 2006-10-20 10:26:38 -07:00
amba
ata
atm
base driver core: kmalloc() failure check in driver_probe_device 2006-10-18 12:49:56 -07:00
block aoe: fix sysfs_create_file warnings 2006-10-18 12:53:51 -07:00
bluetooth [Bluetooth] Add missing entry for Nokia DTL-4 PCMCIA card 2006-10-20 01:15:04 -07:00
cdrom
char [PATCH] ipmi: fix return codes in failure case 2006-10-20 10:26:44 -07:00
clocksource
connector
cpufreq
crypto
dio
dma
edac
eisa
fc4
firmware [PATCH] firmware/dcdbas: add size check in smi_data_write 2006-10-20 10:26:44 -07:00
hwmon hwmon: Fix debug messages in w83781d 2006-10-18 13:03:09 -07:00
i2c hwmon: Let w83781d and lm78 load again 2006-10-18 13:03:09 -07:00
ide [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
ieee1394
infiniband IB/mthca: Use mmiowb after doorbell ring 2006-10-16 20:22:35 -07:00
input Merge master.kernel.org:/home/rmk/linux-2.6-arm 2006-10-17 14:46:31 -07:00
isdn [PATCH] drivers/isdn: ioremap balanced with iounmap 2006-10-20 10:26:43 -07:00
leds [PATCH] drivers/led: handle sysfs errors 2006-10-17 08:18:46 -07:00
macintosh
mca
md [PATCH] separate bdi congestion functions from queue congestion functions 2006-10-20 10:26:35 -07:00
media
message [PATCH] I2O: handle a few sysfs errors 2006-10-17 08:18:46 -07:00
mfd
misc [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
mmc
mtd
net [PATCH] ibmveth: Fix index increment calculation 2006-10-21 14:34:21 -04:00
nubus
oprofile
parisc
parport
pci [PATCH] Fix up rpaphp driver for pci hotplug header move 2006-10-20 17:56:39 -07:00
pcmcia
pnp Fix DMA resource allocation in ACPIPnP 2006-10-18 11:36:11 -07:00
rapidio
rtc [PATCH] rtc: fix printk of 64-bit res on 32-bit platform 2006-10-17 08:18:47 -07:00
s390 [S390] dasd: clean up timer. 2006-10-18 18:30:53 +02:00
sbus [SPARC] {bbc_,}envctrl: Use call_usermodehelper(). 2006-10-17 19:28:52 -07:00
scsi [PATCH] irq updates: make eata_pio compile 2006-10-20 10:26:38 -07:00
serial [PATCH] Kconfig serial typos 2006-10-20 10:26:36 -07:00
sh
sn [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
spi
tc
telephony [ixj] Add pci dev table for module auto loading. 2006-10-18 08:45:30 -04:00
usb [PATCH] fix PXA2xx UDC compilation error 2006-10-20 17:56:39 -07:00
video [valkyriefb] Ifdef for when CONFIG_NVRAM isn't enabled. 2006-10-18 08:53:37 -04:00
w1 [PATCH] w1 kconfig fix 2006-10-17 08:18:44 -07:00
zorro
Kconfig [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
Makefile