Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* Question regarding kernel?
@ 2019-11-15  7:40 Strahinja Mitrovic
  2019-11-16  9:35 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Strahinja Mitrovic @ 2019-11-15  7:40 UTC (permalink / raw)
  To: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 616 bytes --]

Hi,
I'm a new subscriber, and i have a question regarding the uart driver and
kernel.
How does uart driver reset the counter of input serial line interrupts?

I'm currently using ioct with TIOCGICOUNT on linux for retrieving counts of
input serial line interrupts.

The counts are written to the serial_icounter_struct.

Most data fields are 32-bit integers.

What happens if a number of counts for a certain input line is greater then
32-bit integer value?

Does a system refresh counter on daily basis automatically?

Is there a way to reset a counter so that starts again from 0?
Best Regards,
Strahinja Mitrovic

[-- Attachment #1.2: Type: text/html, Size: 3670 bytes --]

<div dir="ltr"><h1 class="gmail-grid--cell gmail-fs-headline1 gmail-fl1 gmail-ow-break-word gmail-mb8" style="margin:0px 0px 8px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:1.3;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;color:rgb(36,39,41);font-size:2.07692rem"><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-weight:normal">Hi,</span></h1><div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-weight:normal">I&#39;m a new subscriber, and i have a question regarding the uart driver and kernel.</span></div><h1 class="gmail-grid--cell gmail-fs-headline1 gmail-fl1 gmail-ow-break-word gmail-mb8" style="margin:0px 0px 8px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:1.3;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;vertical-align:baseline;box-sizing:inherit;color:rgb(36,39,41);font-size:2.07692rem"><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small">How does uart driver reset the counter of input serial line interrupts?</span><br></h1><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41)">I&#39;m currently using ioct with TIOCGICOUNT on linux for retrieving counts of input serial line interrupts.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41)">The counts are written to the serial_icounter_struct.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41)">Most data fields are 32-bit integers.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41)">What happens if a number of counts for a certain input line is greater then 32-bit integer value?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41)">Does a system refresh counter on daily basis automatically?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(36,39,41)">Is there a way to reset a counter so that starts again from 0?</p></div><div>Best Regards,</div><div>Strahinja Mitrovic</div></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question regarding kernel?
  2019-11-15  7:40 Question regarding kernel? Strahinja Mitrovic
@ 2019-11-16  9:35 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-11-16  9:35 UTC (permalink / raw)
  To: Strahinja Mitrovic; +Cc: kernelnewbies

On Fri, Nov 15, 2019 at 08:40:41AM +0100, Strahinja Mitrovic wrote:
> Hi,
> I'm a new subscriber, and i have a question regarding the uart driver and
> kernel.
> How does uart driver reset the counter of input serial line interrupts?

It does not.

> I'm currently using ioct with TIOCGICOUNT on linux for retrieving counts of
> input serial line interrupts.
> 
> The counts are written to the serial_icounter_struct.
> 
> Most data fields are 32-bit integers.
> 
> What happens if a number of counts for a certain input line is greater then
> 32-bit integer value?

Then it will roll-over.

> Does a system refresh counter on daily basis automatically?

I do not understand the question.  These values are tracked by the
individual tty/serial driver for the chip being referenced.  When
userspace asks for the values, they are sent.  You have to ask the
driver for them in order to be able to see them, but they are kept up to
date internally to the kernel while the port is active.

> Is there a way to reset a counter so that starts again from 0?

Why would you want to reset one of these values?  They are to be read,
not modified.  What are you doing with them in userspace to have any of
them actually cause you to do something different based on them?

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15  7:40 Question regarding kernel? Strahinja Mitrovic
2019-11-16  9:35 ` Greg KH

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git