From: Stephane Grosjean <s.grosjean@peak-system.com>
To: Wolfgang Grandegger <wg@grandegger.com>,
Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
linux-can Mailing List <linux-can@vger.kernel.org>
Subject: Re: [PATCH v3] can/sja1000: add support for PEAK-System PCMCIA card
Date: Wed, 15 Feb 2012 12:52:38 +0100 [thread overview]
Message-ID: <4F3B9C86.8030105@peak-system.com> (raw)
In-Reply-To: <4F3B58D1.1040804@grandegger.com>
Le 15/02/2012 08:03, Wolfgang Grandegger a écrit :
> Hi Oliver,
>
> we start paving common code to partially cure pcmcia related problems,
> that's exactly what I do not like.
I think it's much more than a pcmcia related problem: IMHO, I think it's
right in some common code to do some 'basic' checks on returned values,
especially when these are returned from custom callbacks and these
values are so critical. For me, it's like one has to check the kmalloc()
return value, for example. But I admit this could not be the right(TM)
way of doing things in the Kernel.
>> An alternative would be to replace the 'break' statements above with
>>
>> return IRQ_NONE;
>>
>> like
>>
>> /* check for absent controller due to hw unplug */
>> if (status == 0xFF&& !sja1000_probe_chip(dev))
>> return IRQ_NONE;
>>
>> Don't know if this is 'good style' - but the while statement allows it ;-)
>>
>>> Moreover, regarding to this patch, should the peak_pcmcia custom isr always
>>> test for the card presence? I mean, this costs at least 2xtwo ioread8 for each
>>> hw irq!
>>
>> I think the earlier we know the better.
Ok, so I keep testing the presence of the card in the peak_pcmcia driver.
If I may ask something else: didn't find any "linux-pcmcia" mailing list
(or something like that) in vger majordomo lists. Does someone know if
there is such a list? By default, which ml should be posted the
peak_pcmcia.c too?
>> But indeed both drivers (PEAK/EMS PCMCIA) do no need priv->pre_irq ...
Hmmm... I don't know what is the real goal of these pre_irq() and
post_iqr() callbacks but I imagine that, for example, the "pre_irq()"
could acquire a lock while the post_irq() would release it... So, I
would prefer to call the post_irq() anytime (that is, no direct "return
IRQ_xxx" but a 'break' or a 'goto'). Does it make sense?
>> So if we add the 'return IRQ_NONE' to the above patch the private check for
>> present hardware becomes obsolete as the private ISRs terminate properly when
>> they get an IRQ_NONE.
>>
>> Right?
I would also have say that before, but I checked that IRQ_NONE may be
processed as spurious, so I don't even know, for the moment. LDD3
chapter 10 also says:
> Interrupt handlers should return a value indicating whether there was
> actually an
> interrupt to handle. If the handler found that its device did, indeed,
> need attention, it
> should return IRQ_HANDLED; otherwise the return value should be IRQ_NONE.
So, what does this "need attention" stands for? Since the device is
unplugged, we could say that it didn't need any attention anymore...
But, on the other hand, the ems_pcmcia driver does return IRQ_HANDLED
when its private check fails to detect the card and it has been
approved, so, where is the truth? Near the perfection? ;-)
Stéphane
--
PEAK-System Technik GmbH, Otto-Roehm-Strasse 69, D-64293 Darmstadt
Geschaeftsleitung: A.Gach/U.Wilhelm,St.Nr.:007/241/13586 FA Darmstadt
HRB-9183 Darmstadt, Ust.IdNr.:DE 202220078, WEE-Reg.-Nr.: DE39305391
Tel.+49 (0)6151-817320 / Fax:+49 (0)6151-817329, info@peak-system.com
next prev parent reply other threads:[~2012-02-15 11:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-06 15:56 [PATCH v3] can/sja1000: add support for PEAK-System PCMCIA card Stephane Grosjean
2012-02-13 9:14 ` Marc Kleine-Budde
2012-02-13 10:01 ` Stephane Grosjean
2012-02-13 10:14 ` Wolfgang Grandegger
2012-02-13 10:41 ` Oliver Hartkopp
2012-02-13 11:02 ` Wolfgang Grandegger
2012-02-13 11:06 ` Marc Kleine-Budde
2012-02-13 11:08 ` Wolfgang Grandegger
2012-02-13 19:55 ` Oliver Hartkopp
2012-02-13 20:23 ` Wolfgang Grandegger
2012-02-14 9:14 ` Stephane Grosjean
2012-02-14 9:30 ` Wolfgang Grandegger
2012-02-14 9:59 ` Oliver Hartkopp
2012-02-14 10:16 ` Stephane Grosjean
2012-02-14 16:41 ` Oliver Hartkopp
2012-02-15 7:03 ` Wolfgang Grandegger
2012-02-15 8:05 ` Oliver Hartkopp
2012-02-15 8:37 ` Wolfgang Grandegger
2012-02-15 19:32 ` Oliver Hartkopp
2012-02-15 11:52 ` Stephane Grosjean [this message]
2012-02-15 15:06 ` Wolfgang Grandegger
2012-02-15 16:00 ` Stephane Grosjean
2012-02-15 19:46 ` Oliver Hartkopp
2012-02-13 10:46 ` Stephane Grosjean
2012-02-13 10:56 ` Wolfgang Grandegger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F3B9C86.8030105@peak-system.com \
--to=s.grosjean@peak-system.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=socketcan@hartkopp.net \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.