All of lore.kernel.org
 help / color / mirror / Atom feed
* how to perform i2c transaction with disabled irq?
@ 2020-04-30 11:11 Tomek The Messenger
  2020-04-30 11:20 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Tomek The Messenger @ 2020-04-30 11:11 UTC (permalink / raw)
  To: kernelnewbies


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

Hi
If I don't have disabled irqs I can use API i2c_smbus_write_byte in order
to perform i2c transaction.
But how to make i2c transaction if I have disabled irq? Is any built-in
function which lets such operation, where there is some polling implemented?
The background is that I do i2c transaction in restart handler (some i2c
transaction to hot swap controller) in order to reset board.  And linux
before entering restart handler list disable interrupts. There is a
function to enable back interrupts but in company in which I am working
engineers reviewed it and said "it is not allowed, restart must be
performed when interrupts are disabled".

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

[-- 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] 3+ messages in thread

* Re: how to perform i2c transaction with disabled irq?
  2020-04-30 11:11 how to perform i2c transaction with disabled irq? Tomek The Messenger
@ 2020-04-30 11:20 ` Greg KH
  2020-04-30 14:13   ` Tomek The Messenger
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-04-30 11:20 UTC (permalink / raw)
  To: Tomek The Messenger; +Cc: kernelnewbies

On Thu, Apr 30, 2020 at 01:11:06PM +0200, Tomek The Messenger wrote:
> Hi
> If I don't have disabled irqs I can use API i2c_smbus_write_byte in order
> to perform i2c transaction.
> But how to make i2c transaction if I have disabled irq? Is any built-in
> function which lets such operation, where there is some polling implemented?
> The background is that I do i2c transaction in restart handler (some i2c
> transaction to hot swap controller) in order to reset board.  And linux
> before entering restart handler list disable interrupts. There is a
> function to enable back interrupts but in company in which I am working
> engineers reviewed it and said "it is not allowed, restart must be
> performed when interrupts are disabled".

Ask the engineers how you are supposed to use an interrupt driven device
with interrupts disabled.

good luck!

greg k-h

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

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

* Re: how to perform i2c transaction with disabled irq?
  2020-04-30 11:20 ` Greg KH
@ 2020-04-30 14:13   ` Tomek The Messenger
  0 siblings, 0 replies; 3+ messages in thread
From: Tomek The Messenger @ 2020-04-30 14:13 UTC (permalink / raw)
  To: Greg KH; +Cc: kernelnewbies


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

They are afraid that some peripheral device will report interrupt and after
board reset the peripheral device will be in some transient state if
handling of interrupt from peripheral device will be somewhere in the
middle interrupted by board reset. However in this case this is probably
uboot task to initialize peripheral devices from the beginning, switch them
and release from reset. Or another way is to shutdown peripheral devices
before reset, disable interrupts in their internal registers - at least
when /sbin/reboot is executed we see that before reset shutdown procedure
is running.

On Thu, Apr 30, 2020 at 1:20 PM Greg KH <greg@kroah.com> wrote:

> On Thu, Apr 30, 2020 at 01:11:06PM +0200, Tomek The Messenger wrote:
> > Hi
> > If I don't have disabled irqs I can use API i2c_smbus_write_byte in order
> > to perform i2c transaction.
> > But how to make i2c transaction if I have disabled irq? Is any built-in
> > function which lets such operation, where there is some polling
> implemented?
> > The background is that I do i2c transaction in restart handler (some i2c
> > transaction to hot swap controller) in order to reset board.  And linux
> > before entering restart handler list disable interrupts. There is a
> > function to enable back interrupts but in company in which I am working
> > engineers reviewed it and said "it is not allowed, restart must be
> > performed when interrupts are disabled".
>
> Ask the engineers how you are supposed to use an interrupt driven device
> with interrupts disabled.
>
> good luck!
>
> greg k-h
>

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

[-- 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] 3+ messages in thread

end of thread, other threads:[~2020-04-30 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-30 11:11 how to perform i2c transaction with disabled irq? Tomek The Messenger
2020-04-30 11:20 ` Greg KH
2020-04-30 14:13   ` Tomek The Messenger

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.