| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
During system bring up we may not have a properly functioning ipmi
interface. This prevents skiboot completing the boot process as it
waits for certain bt messages to complete before continuing.
This patch alters the bt message timeouts to ensure messages timeout
in the case of a non-responsive bt interface.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
When deciding if a BT message has timed out we should first check for
a message response. This will ensure that messages will not time out
if there was a delay calling the pollers.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
The caller usually has it and it avoids additional mftb() which
can be expensive.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[stewart@linux.vnet.ibm.com: fix run-timer unit test]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Cc: Alistair Popple <alistair@popple.id.au>
Acked-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
We will soon expose the dequeue message function which deletes
previously queued messages from the message queue. It could help catch
a few bugs by doing some extra checks.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix trivial typos
'messasge' -> 'message'
'resposne' -> 'response'
'intialized' -> 'initialized'
One of them, is in the log message.
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for the HW SerIRQ deserializer of the P8 LPC
bridge which is properly wired up on Naples. It also adds support
for detecting and reporting LPC error interrupts on all P8s.
On most platforms (Rhesus is the exception here due to the way it
lets Linux handle the UART interrupts directly), we modify the
device-tree to properly represent the LPC controller as a cascaded
interrupt-controller and the "interrupts" property of LPC devices
to contain the actual LPC interrupt number for the device.
We add a mechanism for drivers to register specific LPC interrupts,
and a "workaround" for pre-Naples P8 which platforms can use to call
all of them for when the external FPGA based deserializer is used.
There's also a callback on LPC resets which isn't used yet, we need
a bit more work on the general LPC error handling, but it can be
done a separate patches.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
bt_msg_del() calls ipmi_cmd_done() to free the message and process any
error callbacks. However it should drop the lock prior to calling
ipmi_cmd_done() as some error callbacks may try to queue ipmi messages
leading to a dead lock.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
bt_get_resp() uses the sequence number to locate the outstanding
message by searching the queue with list_for_each(...). The check to
see if a message was found in the queue is:
if (!bt_msg || (bt_msg->seq != seq))
However this check is incorrect. list_for_each(...) does not set
bt_msg to NULL at the end of the loop, nor does it set it to the last
element in the list. Rather it ends up pointing at an offset from the
list_head. Therefore bt_msg is never equal to NULL and the first half
of this condition is always false.
However the second condition is almost always true as sequence numbers
are constantly increasing and unlikely to match whatever bt_msg->seq
ends up pointing to, but in rare circumstances it is possible for
bt_msg->seq to equal seq and hence the overall expression can evaluate
to false.
This leads to bt_msg being used as a valid message pointer even though
it points to an incorrect address, typically causing a xstop due to an
invalid address access when ipmi_cmd_done(...) attempts to call the
callbacks.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The bt layer used to cache the value of B_BUSY in the state machine,
assuming that once B_BUSY was cleared by the BMC that it would never
be set by the BMC again unless a message was sent to the bt interface.
This was mostly true for the AMI firmware except when the BMC reboots
which causes B_BUSY to be set. There may also be additional
circumstances which set B_BUSY. Therefore the bt layer must check
B_BUSY is clear before sending a message making the B_BUSY state
superfluous.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|/
|
|
|
|
|
|
|
| |
It's not too useful to print the command without the netfn, so add
this into the BT_ERR macro.
Reported by: Nick Bofferding <bofferdn@us.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
his primarily checks whether the caller already holds the corresponding
locks to avoid re-entrancy in some of the deep error path such as when
XSCOM itself triggers an error log. It will be extended in the case of
LPC to also handle known HW error states.
We use them to avoid queuing/polling in the BT driver and to discard
characters in the UART driver.
Note: This will not normally involve a loss of log to the UART as the
UART driver is also protected by the console suspend mechanism. So
this is a safety mechanism only.
This fixes issues where the generation of error logs inside the LPC or
XSCOM drivers could cause a re-entrancy (via the BT interface)
causing deadlocks. Now, the error logs IPMI messages will be queued up
and delivered later on the next poll handler.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a bug (most likely on the bmc) that causes some bt messages to be
ignored. The message data is still in the bt fifo and the message read
pointers still appear to be valid so we can attempt a resend by just
setting the appropriate status flag.
A single retry seems to fix the problem most of the time, however this
should be regarded as a temporary fix. If unlucky we could encounter
the same bug resetting the flag so the message could still get
dropped.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
| |
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that skiboot supports more IPMI functionality we are queuing more
than 5 messages at a time. For example in the astbmc platform.init()
adds 6 messages to the queue.
Shifting to ten ensures current systems boot without dropping messages,
and should give us some breathing room.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
| |
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
bt_get_resp() should return with the bt lock held. Under very rare
error conditions bt_get_resp() would drop the lock before
returning.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the error messages in the bt layer don't report enough
information to assist with debugging. This patch standardises the
information reported when the bt layer encounters an error such as a
timeout.
It also fixes a problem where expired messages would produce a
spurious warning about an incorrect netfn.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the SMS_ATN bit is processed by the bt interrupt
handler. This means that on systems without a functional bmc interrupt
(such as during early bring up) an SMS_ATN will not be noticed,
including the watchdog pre-timeout which results in the wdt expiring.
This patch moves the check for SMS_ATN into the main bt polling loop,
ensuring it is processed even without functional bmc interrupts. It
also cleans up the logic in bt_poll() to make it clearer and reduce
the number of lpc register reads.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the bt interface sets the SMS_ATN flag, we perform a Get Message
Flags to determine what messages are available.
The only message type currently processed is the Event Message Buffer,
which provides SEL messages for indicating OEM specific events such as
graceful system shutdown and PNOR access requested. These events will be
handled by the IPMI layer in skiboot.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
By default new ipmi messages are added to the end of the transmission
queue. However sometimes it is necessary to add messages to the start
of the queue. This patch adds a new ipmi function that adds messages
to the start of the transmission queue.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
| |
... which I'm trying to deprecate
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
| |
Add a call to bt_init_interface() in bt_reset_interface(). This
ensures that interrupts are re-enabled after a bt interface reset.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some tools (eg. ipmitool) that use the Linux ipmi stack send
potentially invalid commands to probe functionality. Currently skiboot
prints an error to the console whenever this happens resulting in
excessive noise when using the Linux ipmi stack.
This patch just removes and/or lowers the logging level of these
errors.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial timeout scheme started a message timeout when it was added
to the queue rather than when transmission was started. To avoid
timing out messages that just got stuck behind a couple of slow ones
we should instead just check that the active message has not timed
out.
This patch ensures timeout values are only checked for the currently
active message.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds some locking to the polling of the bt
hardware/state. Prior to having proper interrupts and events working
this was not so critical as we would only ever have one call to
bt_poll running at a time. However functioning interrupts mean we can
have multiple calls to bt_poll so we need to add some locking to ensure
consistency between the state machine and the hardware.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The bt interface relies on a fairly simple state machine to send
messages to the bmc. Messages are added to a queue for sending and
something calls the state machine to start sending messages, usually
via opal_poll_events. However under some circumstances this doesn't
happen so we need to crank the state machine to start start sending
messages.
This patch adds a call to bt_poll to make sure we start sending a
message which should ensure the bmc generates an irq once the message
is sent to continue processing.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
| |
This patch adds two opal calls (opal_ipmi_send and opal_ipmi_recv)
to allow an operating system to send and receive arbitrary ipmi
messages to the BMC.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The bits in the control register are mostly write-1-to-clear, so
the rmw sequences in bt_setmask() and bt_clearmask() don't work.
Additionally, H_BUSY is weird as it's a write-1-to-toggle, so let's
write a "safe" function that sets it to the desired state based on
its previous state. (We can optimize that further later).
Also enable interrupt operations.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
| |
This patch adds message timeouts to the bt layer. When a response to a
message is not recieved within a given time we call the error callback
with a completion code indicating a timeout.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
| |
This patch ensures that the number of outstanding messages in the bt
interface queue can not grow unchecked. If adding a message to the
queue causes it to exceed the maximum size we remove the oldest
message from the queue.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
| |
This patch adds validation of the ipmi cmd and netfn numbers returned
by the bmc. It also ensures the sequence number is correct by
searching the outstanding message queue for the corresponding sequence
number.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we were doing synchronous messaging and cranking the bt
state machine from within OPAL. This was not ideal as it could
potentially take control away from the OS for long periods of
time if the BMC is busy. This patch solves the problem using the
opal_poll api to do asynchronous messaging.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial implementation of the ipmi stack was still tightly coupled
with the backend (in this case bt). This patch refactors the ipmi code
to use a generic backend device.
The core ipmi messaging functionality and the implementation of
specific commands has also been split into different files.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The original implementation of the bt and ipmi layers required the bt,
ipmi and message data to be allocated separately. This is sub-optimal
as it could cause excessive memory fragmentation. This patch fixes the
problem by adding a function to the bt layer to allocate space for
both the required data and bt/ipmi message.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
| |
It seems that when we commited the IPMI/BT driver we updated the
device tree compatible property for the iBT interface. Unfortunately
Palmetto still requires a DT fixup for this node and somewhere along
the way there was a typo.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This patch adds a basic IPMI layer to the sapphire core and support
for a BT IPMI interface as found on the Aspeed BMC of the Palmetto
platform
[ Changed the compatible property -- BenH ]
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|