summaryrefslogtreecommitdiffstats
path: root/libflash
Commit message (Collapse)AuthorAgeFilesLines
* test-ipmi-hiomap: Add read-one-byte testVasant Hegde2019-04-091-0/+40
| | | | | | | | | | | | Add test case to read: - 1 byte - 1 block and 1 byte data Cc: Andrew Jeffery <andrew@aj.id.au> Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Fix lpc-read-successVasant Hegde2019-04-091-1/+3
| | | | | | | | Cc: Andrew Jeffery <andrew@aj.id.au> Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add write-one-byte testVasant Hegde2019-04-091-0/+38
| | | | | | | | | | | | Add test case to write: - 1 byte - 1 block and 1 byte data Cc: Andrew Jeffery <andrew@aj.id.au> Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Assert if size is zeroVasant Hegde2019-04-091-1/+2
| | | | | | | | Cc: Andrew Jeffery <andrew@aj.id.au> Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* libflash/ipmi-hiomap: Fix blocks count issueVasant Hegde2019-04-091-3/+18
| | | | | | | | | | | | | | | | | | | | | | | We convert data size to block count and pass block count to BMC. If data size is not block aligned then we endup sending block count less than actual data. BMC will write partial data to flash memory. Sample log : [ 594.388458416,7] HIOMAP: Marked flash dirty at 0x42010 for 8 [ 594.398756487,7] HIOMAP: Flushed writes [ 594.409596439,7] HIOMAP: Marked flash dirty at 0x42018 for 3970 [ 594.419897507,7] HIOMAP: Flushed writes In this case HIOMAP sent data with block count=0 and hence BMC didn't flush data to flash. Lets fix this issue by adjusting block count before sending it to BMC. Cc: Andrew Jeffery <andrew@aj.id.au> Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* libffs: Fix string truncation gcc warning.Michal Suchanek2019-03-201-1/+1
| | | | | | | | Use memcpy as other libffs functions do. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add erase-one-block-twice testAndrew Jeffery2019-02-241-0/+61
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add write-one-block-twice testAndrew Jeffery2019-02-241-0/+65
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add read-one-block-twice testAndrew Jeffery2019-02-241-0/+33
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add protocol-recovery-get-flash-info-failure testAndrew Jeffery2019-02-241-0/+195
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add protocol-recovery-failure-get-info testAndrew Jeffery2019-02-241-0/+191
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add protocol-recovery-failure-ack testAndrew Jeffery2019-02-241-0/+170
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add erase-malformed testsAndrew Jeffery2019-02-241-0/+92
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add flush-malformed testsAndrew Jeffery2019-02-241-0/+95
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add mark-dirty-malformed testsAndrew Jeffery2019-02-241-0/+101
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add create-write-window-malformed testsAndrew Jeffery2019-02-241-0/+95
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add create-read-window-malformed testsAndrew Jeffery2019-02-241-0/+95
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add get-flash-info-malformed testsAndrew Jeffery2019-02-241-0/+64
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add get-info-malformed testsAndrew Jeffery2019-02-241-0/+64
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add ack-malformed testsAndrew Jeffery2019-02-241-0/+60
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add erase-error testAndrew Jeffery2019-02-241-0/+41
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add ack-error testAndrew Jeffery2019-02-241-0/+7
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add flush-error testAndrew Jeffery2019-02-241-0/+42
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add mark-dirty-error testAndrew Jeffery2019-02-241-0/+45
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add create-write-window-error testAndrew Jeffery2019-02-241-0/+42
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add create-read-window-error testAndrew Jeffery2019-02-241-0/+42
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add get-flash-info-error testAndrew Jeffery2019-02-241-0/+30
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add get-info-error testAndrew Jeffery2019-02-241-0/+29
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add get-flash-info testAndrew Jeffery2019-02-241-0/+46
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add action-error testAndrew Jeffery2019-02-241-0/+30
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add bad-sequence testAndrew Jeffery2019-02-241-0/+31
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add event-during-eraseAndrew Jeffery2019-02-241-0/+37
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add event-before-erase testAndrew Jeffery2019-02-241-0/+18
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add erase-two-blocks testAndrew Jeffery2019-02-241-0/+64
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add erase-one-block testAndrew Jeffery2019-02-241-0/+54
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add event-during-write testAndrew Jeffery2019-02-241-0/+41
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add event-before-write testAndrew Jeffery2019-02-241-0/+15
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add write-two-blocks testAndrew Jeffery2019-02-241-0/+118
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add write-one-block testAndrew Jeffery2019-02-241-0/+92
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add event-during-read testAndrew Jeffery2019-02-241-0/+41
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add event-before-readAndrew Jeffery2019-02-241-0/+30
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add read-two-blocks testAndrew Jeffery2019-02-241-7/+98
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add read-one-block testAndrew Jeffery2019-02-241-3/+68
| | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Add protocol-persistent-error testAndrew Jeffery2019-02-241-0/+33
| | | | | | | | Cc: stable Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* libflash/ipmi-hiomap: Enforce message size for empty responseAndrew Jeffery2019-02-241-0/+6
| | | | | | | | | | The protocol defines the response to the associated messages as empty except for the command ID and sequence fields. If the BMC is returning extra data consider the message malformed. Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* libflash/ipmi-hiomap: Remove unused close handlingAndrew Jeffery2019-02-241-5/+0
| | | | | | | | | | | | Issuing a HIOMAP_C_CLOSE is not required by the protocol specification, rather a close can be implicit in a subsequent CREATE_{READ,WRITE}_WINDOW request. The implicit close provides an opportunity to reduce LPC traffic and the implementation takes up that optimisation, so remove the case from the IPMI callback handler. Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* libflash/ipmi-hiomap: Overhaul event handlingAndrew Jeffery2019-02-242-64/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reworking the event handling was inspired by a bug report by Vasant where the host would get wedged on multiple flash access attempts in the face of a persistent error state on the BMC-side. The cause of this bug was the early-exit based on ctx->update, which erronously assumed that all events had been completely handled in prior calls to ipmi_hiomap_handle_events(). This is not true if e.g. HIOMAP_E_DAEMON_READY is clear in the prior calls. Regardless, there were other correctness and efficiency problems with the handling strategy: * Ack-able event state was not restored in the face of errors in the process of re-establishing protocol state * It forced needless window restoration with respect to the context in which ipmi_hiomap_handle_events() was called. * Tests for HIOMAP_E_DAEMON_READY and HIOMAP_E_FLASH_LOST were redundant with the overhauled error handling introduced in the previous patch Fix all of the above issues and add comments to explain the event handling flow. Tests for correctness follow later in the series. Cc: stable Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* libflash/ipmi-hiomap: Overhaul error handlingAndrew Jeffery2019-02-241-107/+197
| | | | | | | | | | | | | | | | | | | | | | | | | The aim is to improve the robustness with respect to absence of the BMC-side daemon. The current error handling roughly mirrors what was done for the mailbox implementation, but there's room for improvement. Errors are split into two classes, those that affect the transport state and those that affect the window validity. From here, we push the transport state error checks right to the bottom of the stack, to ensure the link is known to be in a good state before any message is sent. Window validity tests remain as they were in the hiomap_window_move() and ipmi_hiomap_read() functions. Validity tests are not necessary in the write and erase paths as we will receive an error response from the BMC when performing a dirty or flush on an invalid window. Recovery also remains as it was, done on entry to the blocklevel callbacks. If an error state is encountered in the middle of an operation no attempt is made to recover it on the spot, instead the error is returned up the stack and the caller can choose how it wishes to respond. Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* libflash/ipmi-hiomap: Fix leak of msg in callbackAndrew Jeffery2019-02-241-0/+1
| | | | | | | Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* test-ipmi-hiomap: Print some information on early scenario_exit()Andrew Jeffery2019-02-211-1/+6
| | | | | | | | | Now we dump the index of the event that we exited on if it's not the appropriate scenario event type. Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
OpenPOWER on IntegriCloud