summaryrefslogtreecommitdiff
path: root/drivers/scsi/isci/port_config.c
AgeCommit message (Collapse)Author
2021-03-18scsi: isci: port_config: Fix a bunch of doc-rot and demote abusesLee Jones
Fixes the following W=1 kernel build warning(s): drivers/scsi/isci/port_config.c:76: warning: Cannot understand * drivers/scsi/isci/port_config.c:105: warning: Cannot understand * drivers/scsi/isci/port_config.c:148: warning: Cannot understand * drivers/scsi/isci/port_config.c:376: warning: Cannot understand * drivers/scsi/isci/port_config.c:607: warning: Function parameter or member 'ihost' not described in 'sci_apc_agent_link_up' drivers/scsi/isci/port_config.c:607: warning: Function parameter or member 'port_agent' not described in 'sci_apc_agent_link_up' drivers/scsi/isci/port_config.c:607: warning: Function parameter or member 'iport' not described in 'sci_apc_agent_link_up' drivers/scsi/isci/port_config.c:607: warning: Function parameter or member 'iphy' not described in 'sci_apc_agent_link_up' drivers/scsi/isci/port_config.c:607: warning: Excess function parameter 'scic' description in 'sci_apc_agent_link_up' drivers/scsi/isci/port_config.c:607: warning: Excess function parameter 'sci_port' description in 'sci_apc_agent_link_up' drivers/scsi/isci/port_config.c:607: warning: Excess function parameter 'sci_phy' description in 'sci_apc_agent_link_up' drivers/scsi/isci/port_config.c:623: warning: Cannot understand * drivers/scsi/isci/port_config.c:701: warning: Cannot understand * Link: https://lore.kernel.org/r/20210317091230.2912389-26-lee.jones@linaro.org Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-10-24scsi: isci: Spelling s/configruation/configuration/Geert Uytterhoeven
Fix misspelling of "configuration". Link: https://lore.kernel.org/r/20191024152543.30310-1-geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-04-20scsi: isci: Fix infinite loop in while loopColin Ian King
In the case when the phy_mask is bitwise anded with the phy_index bit is zero the continue statement currently jumps to the next iteration of the while loop and phy_index is never actually incremented, potentially causing an infinite loop if phy_index is less than SCI_MAX_PHS. Fix this by turning the while loop into a for loop. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-10-27scsi: isci: Convert timers to use timer_setup()Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Intel SCU Linux support <intel-linux-scu@intel.com> Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
2014-03-10[SCSI] isci: fix reset timeout handlingDan Williams
Remove an erroneous BUG_ON() in the case of a hard reset timeout. The reset timeout handler puts the port into the "awaiting link-up" state. The timeout causes the device to be disconnected and we need to be in the awaiting link-up state to re-connect the port. The BUG_ON() made the incorrect assumption that resets never timeout and we always complete the reset in the "resetting" state. Testing this patch also uncovered that libata continues to attempt to reset the port long after the driver has torn down the context. Once the driver has committed to abandoning the link it must indicate to libata that recovery ends by returning -ENODEV from ->lldd_I_T_nexus_reset(). Cc: <stable@vger.kernel.org> Acked-by: Lukasz Dorau <lukasz.dorau@intel.com> Reported-by: David Milburn <dmilburn@redhat.com> Reported-by: Xun Ni <xun.ni@intel.com> Tested-by: Xun Ni <xun.ni@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-08-26[SCSI] isci: Fix a infinite loop.Xinghai Yu
It seems the "phy_index++;" have been placed in wrong place, without it the while circle up will do a infinite loop. Signed-off-by: Xinghai Yu <yuxinghai@cn.fujitsu.com> Acked-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-17isci: fix 'link-up' events occur after 'start-complete'Dan Williams
The call to wait_for_start() is meant to ensure that all links have been given a chance to come up before letting the kernel proceed with probing. However, the implementation is not correctly syncing with the port configuration agent. In the MPC case the ports are hard-coded, in the APC case we need to wait for the port-configuration to form ports from the started phys. Towards that end increase the timeout for the APC agent to form ports, and delay start complete until all phys are out of link-training. Cc: <stable@vger.kernel.org> Cc: Richard Boyd <richard.g.boyd@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2012-01-16[SCSI] isci: fix io failures while wide port links are coming upMarcin Tomczak
When the first phy of a wide port comes up, don't report the port ready yet, always wait for 250 miliseconds then config the port with all phys added to the port. So that we can avoid reporting wide port device too early to kernel, which caused the first IOs (report luns, inquirys) failed due to not all the phys are configured into its port. Changes also made that the phys in a wide port don't need to go through half second wait time for consuming power. Signed-off-by: Marcin Tomczak <marcin.tomczak@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-01-16[SCSI] isci: allow more time for wide port targetsMarcin Tomczak
When hot insert the wide port device through the mini-sas port, the first IOs (Report Luns or Inquiry) may fail due to the device trying to open to a SCU phy that is still in suspended state. This IO failure causes the wide port device stuck in UPDATING_PORT_WIDTH state. Signed-off-by: Marcin Tomczak <marcin.tomczak@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-02[SCSI] isci: fix missed unlock in apc_agent_timeout()Jeff Skirvin
Needed to jump to scic_lock unlock. Also spotted by coccicheck. Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com> Cc: <stable@kernel.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-03isci: kill 'get/set' macrosDan Williams
Most of these simple dereference macros are longer than their open coded equivalent. Deleting enum sci_controller_mode is thrown in for good measure. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: retire scic_sds_ and scic_ prefixesDan Williams
The distinction between scic_sds_ scic_ and sci_ are no longer relevant so just unify the prefixes on sci_. The distinction between isci_ and sci_ is historically significant, and useful for comparing the old 'core' to the current Linux driver. 'sci_' represents the former core as well as the routines that are closer to the hardware and protocol than their 'isci_' brethren. sci == sas controller interface. Also unwind the 'sds1' out of the parameter structs. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify isci_host and scic_sds_controllerDan Williams
Remove the distinction between these two implementations and unify on isci_host (local instances named ihost). Hmmm, we had two 'oem_parameters' instances, one was unused... nice. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify isci_port and scic_sds_portDan Williams
Remove the distinction between these two implementations and unify on isci_port (local instances named iport). The duplicate '->owning_port' and '->isci_port' in both isci_phy and isci_remote_device will be fixed in a later patch... this is just the straightforward rename/unification. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify isci_phy and scic_sds_phyDan Williams
They are one in the same object so remove the distinction. The near duplicate fields (owning_port, and isci_port) will be cleaned up after the scic_sds_port isci_port unification. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: state machine cleanupEdmund Nadolski
This cleans up several areas of the state machine mechanism: o Rename sci_base_state_machine_change_state to sci_change_state o Remove sci_base_state_machine_get_state function o Rename 'state_machine' struct member to 'sm' in client structs o Shorten the name of request states o Shorten state machine state names as follows: SCI_BASE_CONTROLLER_STATE_xxx to SCIC_xxx SCI_BASE_PHY_STATE_xxx to SCI_PHY_xxx SCIC_SDS_PHY_STARTING_SUBSTATE_xxx to SCI_PHY_SUB_xxx SCI_BASE_PORT_STATE_xxx to SCI_PORT_xxx and SCIC_SDS_PORT_READY_SUBSTATE_xxx to SCI_PORT_SUB_xxx SCI_BASE_REMOTE_DEVICE_STATE_xxx to SCI_DEV_xxx SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_STP_DEV_xxx SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_SMP_DEV_xxx SCIC_SDS_REMOTE_NODE_CONTEXT_xxx_STATE to SCI_RNC_xxx Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove isci_timer interfaceEdmund Nadolski
Delete code which is no longer used. Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: convert port config agent timer to sci_timerEdmund Nadolski
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> [squashed collateral cleanups] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: clarify phy to port lookupsDan Williams
While cleaning up the driver it is very tempting to convert scic_sds_get_* macros to their open coded equivalent. They are all just pointer dereferences *except* scic_sds_phy_get_port() which returns NULL if the phy is assigned to the dummy port. Clarify this by renaming it to phy_get_non_dummy_port(). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: uplevel port infrastructureDan Williams
* Move port configuration agent implementation * Merge core/scic_sds_port.[ch] into port.[ch] Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>