From: "Matti Linnanvuori" <mattilinn@gmail.com>
To: "Krzysztof Halasa" <khc@pm.waw.pl>
Cc: jgarzik@pobox.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1.2.26] wan: new driver retina
Date: Tue, 3 Jun 2008 15:08:32 +0300 [thread overview]
Message-ID: <ca0148c30806030508g23bf0f52r2ac847fcc7cb7cbe@mail.gmail.com> (raw)
In-Reply-To: <m3lk1rhio4.fsf@maximus.localdomain>
2008/5/30 Krzysztof Halasa <khc@pm.waw.pl>:
> "Matti Linnanvuori" <mattilinn@gmail.com> writes:
>
>> I would not like to change a legacy driver much.
>
> But this is a new driver, right? I guess the SIOCDEVPRIVATEs will go
> at some point so the change can't be really avoided.
I posted retina-1.2.29.patch that does not have SIOCDEVPRIVATEs at
http://groups.google.com/group/pcidriver/files.
>>>> +static int fepci_char_open(struct inode *inode, struct file *filp)
>>>> +{
>>>> + unsigned int minor = MINOR(inode->i_rdev);
>>>> + if (unlikely(minor >= find_cnt || card_privates[minor].pci_dev == NULL))
>>>> + return -ENXIO;
>>>> + filp->f_op = &fepci_char_fops;
>>>> + if (unlikely(!try_module_get(THIS_MODULE)))
>>>> + return -EBUSY;
>>>
>>> That won't work race-free, use owner field.
>>
>> You mean the f_op assignment? I have removed that.
>
> Actually I meant try_module_get() from within the driver, for example
> your module may get unloaded while in this function, before this
> try_module_get(), and that would be fatal. If you set the owner field
> the reference count will be incremented by the caller first.
I added the owner field setting to the above mentioned patch.
prev parent reply other threads:[~2008-06-03 12:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-28 10:42 [PATCH v1.2.26] wan: new driver retina Matti Linnanvuori
2008-05-28 12:30 ` Krzysztof Halasa
2008-05-30 12:52 ` Matti Linnanvuori
2008-05-30 16:15 ` Krzysztof Halasa
2008-06-01 5:59 ` Matti Linnanvuori
2008-06-03 12:08 ` Matti Linnanvuori [this message]
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=ca0148c30806030508g23bf0f52r2ac847fcc7cb7cbe@mail.gmail.com \
--to=mattilinn@gmail.com \
--cc=jgarzik@pobox.com \
--cc=khc@pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).