From: "BALBIR SINGH" <balbir.singh@wipro.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: Balbir Singh <balbir_soni@yahoo.com>, linux-kernel@vger.kernel.org
Subject: Re: Patch: Fix serial module use count (2.4.16 _and_ 2.5)
Date: Fri, 30 Nov 2001 09:55:49 +0530 [thread overview]
Message-ID: <3C070A4D.7000708@wipro.com> (raw)
In-Reply-To: <20011129160637.50471.qmail@web13606.mail.yahoo.com> <20011129161756.D6214@flint.arm.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]
Russell King wrote:
>On Thu, Nov 29, 2001 at 08:06:37AM -0800, Balbir Singh wrote:
>
>>Let me make it clearer to you,
>>
>>lets say I call rs_open() on /dev/ttyS0 and if it
>>fails then I should not call rs_close() after a failed
>>rs_open().
>>
>
>You don't call rs_open. The tty layer does that for you. The tty layer
>also cleans up on close by calling the driver specific close function.
>
>Yes I agree with you that it might not, but that is a 2.5 kernel issue,
>not a 2.4 "lets do a massive change" issue. The tty layer is complex
>and messy, and we shouldn't go around randomly changing it in 2.4.
>
>>Lets see what happens with your approach
>>
>>1. I call rs_open(), it fails, ref_count set to 1
>>
>
>Ok, so you're poking around in kernel code calling kernel functions that
>were previously declared static and not visible to anything but the tty
>layer. That immediately makes your example invalid because you're not
>following the rules that the tty layers lays down for opening tty devices.
>
What I mean by I call rs_open() is that the person who writes the tty layer
should not call close() after open() fails, I cannot directly invoke rs_open()
and rs_close(), I KNOW that.
If I were to define an API like rs_open(), I would expect the person who
uses these API (rs_*) in our case the tty layer, to call rs_close()
only if rs_open() is successfull. I do not want to leave a dependency
that rs_close() SHOULD BE called even if rs_open() failed.
As you say this fix works for 2.4, Since we are into 2.5, I hope
that it will be fixed in a better manner in 2.5. I have some suggestions,
ideas for the serial driver in 2.5, are u willing to discuss them?
Balbir
>
>--
>Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
> http://www.arm.linux.org.uk/personal/aboutme.html
>
>-
>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/
>
[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 855 bytes --]
-------------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
----------------------------------------------------------------------------------------------------------------------
next prev parent reply other threads:[~2001-11-30 4:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-29 16:06 Patch: Fix serial module use count (2.4.16 _and_ 2.5) Balbir Singh
2001-11-29 16:17 ` Russell King
2001-11-30 4:25 ` BALBIR SINGH [this message]
2001-11-30 9:36 ` Russell King
2001-11-30 22:19 ` Mike Fedyk
2001-11-30 23:06 ` Russell King
2001-12-01 0:20 ` Mike Fedyk
2001-11-29 18:03 ` Jeff Randall
2001-11-29 18:12 ` Russell King
2001-11-29 18:44 ` Jeff Randall
2001-11-29 19:05 ` James Simmons
2001-11-30 10:44 ` Maciej W. Rozycki
2001-11-30 10:56 ` Russell King
2001-11-30 12:11 ` Maciej W. Rozycki
-- strict thread matches above, loose matches on Subject: below --
2001-11-29 13:10 Russell King
2001-11-29 13:48 ` BALBIR SINGH
2001-11-29 15:37 ` Russell King
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=3C070A4D.7000708@wipro.com \
--to=balbir.singh@wipro.com \
--cc=balbir_soni@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/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