android_kernel_xiaomi_sm7250/drivers
Jiri Kosina e0c0978699 ataflop: remove buggy/commented-out IRQ disable from do_fd_request()
There is a nice gem in drivers/block/ataflop.c::do_fd_request()

      void do_fd_request(struct request_queue * q)
      {
              unsigned long flags;

              DPRINT(("do_fd_request for pid %d\n",current->pid));
              while( fdc_busy ) sleep_on( &fdc_wait );
              fdc_busy = 1;
              stdma_lock(floppy_irq, NULL);

              atari_disable_irq( IRQ_MFP_FDC );
              local_save_flags(flags);        /* The request function is called with ints
              local_irq_disable();             * disabled... so must save the IPL for later */
              redo_fd_request();
              local_irq_restore(flags);
              atari_enable_irq( IRQ_MFP_FDC );
      }

If you look at the code long enough, you will notioce that the
local_irq_disable() call is actually commented out. This has been
introduced back in 2002 in [1], but as you can see, the same bug has been
there even before, with the sti() call being commented out in the very
same way :)

I am not familiar with the code myself at all, but I guess that the whole
stuff can just be removed. Why do we need save_flags/restore_flags at all,
without actually disabling the local IRQs afterwards? The
redo_fd_request() doesn't seem to do anything that would mess with flags
inconsistently.

[1] http://lkml.org/lkml/2002/12/27/58

Jens:
That does look odd. The comment is correct that the function is entered
with interrupts disabled (and the queue lock held). So I'd say your
patch looks fine, the whole save/restore business looks meaningless.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>
2009-11-09 09:40:57 +01:00
..
accessibility
acpi Merge branch 'misc' into release 2009-10-15 00:47:13 -04:00
amba
ata pata_cs5535: fix comment header typo 2009-11-09 09:40:55 +01:00
atm
auxdisplay
base PM: Remove some debug messages producing too much noise 2009-11-03 11:18:18 +01:00
block ataflop: remove buggy/commented-out IRQ disable from do_fd_request() 2009-11-09 09:40:57 +01:00
bluetooth
cdrom
char tree-wide: fix a very frequent spelling mistake 2009-11-09 09:40:54 +01:00
clocksource
connector
cpufreq
cpuidle tree-wide: fix typos "aquire" -> "acquire", "cumsumed" -> "consumed" 2009-11-09 09:40:57 +01:00
crypto
dca
dio
dma
edac amd64_edac: fix CECCs reporting 2009-11-04 14:04:06 +01:00
eisa
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2009-10-14 15:36:19 -07:00
firmware
gpio twl4030-gpio: remove __devexit markings from remove func 2009-10-29 07:39:30 -07:00
gpu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel 2009-11-04 07:05:43 -08:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2009-10-13 10:10:33 -07:00
hwmon Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2009-10-29 08:14:58 -07:00
i2c i2c-mpc: Do not generate STOP after read. 2009-11-02 23:28:47 +00:00
ide Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6 2009-10-29 09:22:34 -07:00
idle
ieee1394
ieee802154
infiniband tree-wide: fix typos "aquire" -> "acquire", "cumsumed" -> "consumed" 2009-11-09 09:40:57 +01:00
input Input: gpio-keys - use IRQF_SHARED 2009-11-02 22:12:37 -08:00
isdn Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
leds
lguest
macintosh powerpc/pmac: Fix issues with sleep on some powerbooks 2009-10-14 16:58:35 +11:00
mca
md tree-wide: fix a very frequent spelling mistake 2009-11-09 09:40:54 +01:00
media tree-wide: fix typos "aquire" -> "acquire", "cumsumed" -> "consumed" 2009-11-09 09:40:57 +01:00
memstick
message
mfd mfd: Do not dereference null pointer in twl4030 error path 2009-10-27 00:20:33 +01:00
misc sgi-gru: decrapfiy options_write() function 2009-11-05 10:48:30 -08:00
mmc omap_hsmmc: add missing probe handler hook 2009-10-29 07:39:25 -07:00
mtd Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
net tree-wide: fix typos "aquire" -> "acquire", "cumsumed" -> "consumed" 2009-11-09 09:40:57 +01:00
nubus
of of: Remove nested function 2009-10-15 09:58:27 -06:00
oprofile
parisc
parport
pci Revert "PCI: get larger bridge ranges when space is available" 2009-10-27 09:39:18 -07:00
pcmcia PM / yenta: Split resume into early and late parts (rev. 4) 2009-11-03 10:54:58 +01:00
platform Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
pnp
power
pps
ps3
rapidio
regulator
rtc fix my email address. 2009-11-09 09:40:54 +01:00
s390 Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2009-10-31 12:14:56 -07:00
sbus
scsi tree-wide: fix typos "selct" + "slect" -> "select" 2009-11-09 09:40:56 +01:00
serial Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-03 07:44:01 -08:00
sfi
sh
sn
spi
ssb
staging Staging: fix wireless drivers depends 2009-10-30 14:47:44 -07:00
tc
telephony
thermal
uio
usb USB: fsl_udc_core: Fix kernel oops on module removal 2009-10-30 14:57:33 -07:00
uwb tree-wide: fix a very frequent spelling mistake 2009-11-09 09:40:54 +01:00
video add __init/__exit macros to omap video drivers 2009-11-09 09:40:55 +01:00
virtio virtio: order used ring after used index read 2009-10-29 08:50:37 +10:30
vlynq
w1
watchdog fix my email address. 2009-11-09 09:40:54 +01:00
xen
zorro
Kconfig Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
Makefile