generate a single How to generate a single interrupt on a floppy device

From: John Que (qwejohn_at_gmail.com)
Date: 07/28/05

  • Next message: Jon Smirl: "Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace"
    Date:	Thu, 28 Jul 2005 08:44:34 -0400
    To: linux-kernel@vger.kernel.org
    
    

    Hello,

    I want ,for tracing and debugging purposes, to be able to generate a single
    interrupt on a device which (unlike the timer or ide devices, for example) does
    not get interrupts very frequently.

    Looking at the output of /proc/interrupts (and look at IRQ 6 of the
    floppy) shows
    that the floppy device interrupt counter is not incremented during time if you
    are not constatntly working with it.

    So a good candidate for generating a single interrupt can be a floppy.

    Is there a way to generate a single interrupt on a floppy device?

    I had tried the following:

    I mount the floppy;
    I see that during the time, sometimes after running ls on a floppy
    2 interrupts are generated; and sometimes after ls on a floppy
    no interrupts are generated. The same is with
    creating a file/reading a file: sometimes there
    are interrupts and sometimes there are no interrupts.

    So I wrote the following little program:

    #define BUFFER_SIZE 2048

    char buffer[BUFFER_SIZE] __attribute__((aligned(4096)));

    int main()
            {

            int fd;
            int bytes_read;
            int i;
            fd = open("/dev/fd0",O_DIRECT);

            void* data;

            if (fd < 0 )
              printf("could not open device\n");

           else

            printf("device opened\n");

                    {
                    bytes_read = read(fd,buffer,512);

                    //fseek(fd,SEEK_CUR,1);
                    printf("bytes_read = %d\n",bytes_read);
                    }

            close(fd);
            }

    Each time I ran it I got course :
    device opened
    bytes_read = 512

    But running this program again and again ***DOES NOT*** increase the
    number of interrupt on the floppy device IRQ (6).

    Any ideas?

    Which user space code I should write / Which operation should I do so that each
    time I will do it,(again and again) it will generate an interrupt on the
    floppy IRQ (6) ?

    (BTW I build this program by gcc -D_GNU_SOURCE floppy.c)

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


  • Next message: Jon Smirl: "Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace"

    Relevant Pages

    • 3.4 & VAIO Cardbus/USB/SCSI?
      ... floppy is on sd0, connected by a USB. ... From dmesg, it seems the scsi_cb ... destination (floppy), at the same time..... ... >: couldn't map interrupt ...
      (comp.unix.bsd.openbsd.misc)
    • Re: OS/2 and floppy disk drives
      ... things can happen if you bios shuffles around interrupts and resources. ... the cable just means the driver wouldn'T find a floppy. ... Drivers that as far as the MB knows, ... I have a network card that fails if it shares an interrupt and works fine without sharing an interrupt so I have to use a specific PCI slot here for it to work. ...
      (comp.os.os2.misc)
    • [patch, -rc5-mm2] lock validator: drivers/block/floppy.c fixes
      ... The lock validator triggered a number of bugs in the floppy driver, ... resources from interrupt context. ... IRQ and DMA allocation/freeing. ...
      (Linux-Kernel)
    • (no subject)
      ... interrupt on a device which ... that the floppy device interrupt counter is not incremented during time if you ... number of interrupt on the floppy device IRQ. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] 3c59x: read current link status from phy
      ... there is only one interrupt that for data transmission (both Tx ... The MII registers are not ... Universitaet Heidelberg, INF 368, D-69120 Heidelberg, GERMANY ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)