Re: [PATCH] ipwireless: driver for 3G PC Card



Hi!

+static irqreturn_t ipwireless_handle_v1_interrupt(int irq,
+ struct ipw_hardware *hw)
+{
+ unsigned short irqn;
+ unsigned short ack;
+
+ irqn = inw(hw->base_port + IOIR);
+
+ /* Check if card is present */
+ if (irqn == (unsigned short) 0xFFFF) {
+ if (++hw->bad_interrupt_count >= 100) {
+ /*
+ * It is necessary to disable the interrupt at this
+ * point, or the kernel hangs, interrupting repeatedly
+ * forever.
+ */
+ hw->irq = irq;
+ hw->removed = 1;
+ disable_irq_nosync(irq);
+ printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME
+ ": Mr. Fluffy is not happy!\n");
+ }
+ return IRQ_HANDLED;

Not sure how this is supposed to work. If you assume unshared
interrupts, it should be possible to return something and make core
care.

If you are assuming shared interrupts, either you should disable on
first 0xFFFF (are you sure cast is needed, btw?), or not at all,
because it could be the other device sedning you 100 of those...

...so which one is it?

Shared. It'll check if device has interrupt pending, else exit.

can you remove bad_interrupt_count? It seems very random in presence
of shared interrupt.

+static int config_ipwireless(struct ipw_dev *ipw)
+{
+ struct pcmcia_device *link = ipw->link;
+ int ret;
+ config_info_t conf;
+ tuple_t tuple;
+ unsigned short buf[64];
+ cisparse_t parse;
+ unsigned short cor_value;
+ win_req_t reqAM;
+ win_req_t reqCM;

Hiding structs BehindTypedefsIsEvil.

Unfortunatelly PCMCIA subsystem is full of these and all drivers use them.
I'll stay consistent for now.

Sorry if they were not yours.

Updated patch v4 will follow.

Thanks!
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH 2.6.16] Shared interrupts sometimes lost
    ... possibly masked by another register) to make the IRQ line. ... shared interrupts. ... The loop isn't really necessary if you are sure that unserviced ...
    (Linux-Kernel)
  • Re: hard lock using combination of devices
    ... Quoting vda: ... > While shared interrupts can in theory work right, ... Interrupt sharing needs to work on modern hardware and needs to ...
    (Linux-Kernel)
  • Shared interrupts XScale
    ... I'm going to move to shared interrupts. ... Touch MDD, PC-CARD MDD, SD-CARD MDD, VMINI, ect etc etc - all use ... implemented in the MDD (Model Driver) and not in the PDD ...
    (microsoft.public.windowsce.platbuilder)
  • Re: [PATCH] ipwireless: driver for 3G PC Card
    ... If you are assuming shared interrupts, ... because it could be the other device sedning you 100 of those... ... Hiding structs BehindTypedefsIsEvil. ...
    (Linux-Kernel)
  • Re: 2.6.6-mm5
    ... >> the FPU registers that is interrupt safe. ... > interrupts are not a problem. ... mean that the drivers that care can't build for pre PentiumIII ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)