History log of /linux-master/drivers/scsi/isci/port_config.c
Revision Date Author Comments
# 29faa5ce 17-Mar-2021 Lee Jones <lee.jones@linaro.org>

scsi: isci: port_config: Fix a bunch of doc-rot and demote abuses

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>


# d44c897c 24-Oct-2019 Geert Uytterhoeven <geert+renesas@glider.be>

scsi: isci: Spelling s/configruation/configuration/

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>


# 4bc83b3f 20-Apr-2018 Colin Ian King <colin.king@canonical.com>

scsi: isci: Fix infinite loop in while loop

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>


# b0a2dc66 02-Sep-2017 Kees Cook <keescook@chromium.org>

scsi: isci: Convert timers to use timer_setup()

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>


# ddfadd77 06-Feb-2014 Dan Williams <dan.j.williams@intel.com>

[SCSI] isci: fix reset timeout handling

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>


# 80aebef7 16-Jul-2013 Xinghai Yu <yuxinghai@cn.fujitsu.com>

[SCSI] isci: Fix a infinite loop.

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>


# 50a92d93 29-Feb-2012 Dan Williams <dan.j.williams@intel.com>

isci: fix 'link-up' events occur after 'start-complete'

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>


# be778341 04-Jan-2012 Marcin Tomczak <marcin.tomczak@intel.com>

[SCSI] isci: fix io failures while wide port links are coming up

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>


# 472d4d2c 04-Jan-2012 Marcin Tomczak <marcin.tomczak@intel.com>

[SCSI] isci: allow more time for wide port targets

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>


# 983d3fdd 28-Sep-2011 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

[SCSI] isci: fix missed unlock in apc_agent_timeout()

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>


# 34a99158 01-Jul-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill 'get/set' macros

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>


# 89a7301f 30-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: retire scic_sds_ and scic_ prefixes

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>


# d9dcb4ba 30-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_host and scic_sds_controller

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>


# ffe191c9 29-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_port and scic_sds_port

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>


# 85280955 28-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_phy and scic_sds_phy

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>


# e301370a 01-Jun-2011 Edmund Nadolski <edmund.nadolski@intel.com>

isci: state machine cleanup

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>


# 8db02da5 18-May-2011 Edmund Nadolski <edmund.nadolski@intel.com>

isci: remove isci_timer interface

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>


# ac0eeb4f 19-May-2011 Edmund Nadolski <edmund.nadolski@intel.com>

isci: convert port config agent timer to sci_timer

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
[squashed collateral cleanups]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 4f20ef4f 12-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: clarify phy to port lookups

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>


# e2f8db50 10-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: uplevel port infrastructure

* 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>