summaryrefslogtreecommitdiff
path: root/drivers/scsi
AgeCommit message (Collapse)Author
2025-01-10scsi: scsi_error: Add kernel-doc for exported functionsRandy Dunlap
Convert scsi_report_bus_reset() and scsi_report_device_reset() to kernel-doc since they are exported. This allows them to be part of the driver-api/scsi.rst docbook. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20241212205217.597844-2-rdunlap@infradead.org CC: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> CC: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-10block: add a queue_limits_commit_update_frozen helperChristoph Hellwig
Add a helper that freezes the queue, updates the queue limits and unfreezes the queue and convert all open coded versions of that to the new helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20250110054726.1499538-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-01-09scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS requestXiang Zhang
The ISCSI_UEVENT_GET_HOST_STATS request is already handled in iscsi_get_host_stats(). This fix ensures that redundant responses are skipped in iscsi_if_rx(). - On success: send reply and stats from iscsi_get_host_stats() within if_recv_msg(). - On error: fall through. Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com> Link: https://lore.kernel.org/r/20250107022432.65390-1-hawkxiang.cpp@gmail.com Reviewed-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-09scsi: core: Fix command pass through retry regressionMike Christie
scsi_check_passthrough() is always called, but it doesn't check for if a command completed successfully. As a result, if a command was successful and the caller used SCMD_FAILURE_RESULT_ANY to indicate what failures it wanted to retry, we will end up retrying the command. This will cause delays during device discovery because of the command being sent multiple times. For some USB devices it can also cause the wrong device size to be used. This patch adds a check for if the command was successful. If it is we return immediately instead of trying to match a failure. Fixes: 994724e6b3f0 ("scsi: core: Allow passthrough to request midlayer retries") Reported-by: Kris Karas <bugs-a21@moonlit-rail.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219652 Signed-off-by: Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20250107010220.7215-1-michael.christie@oracle.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-06block: simplify tag allocation policy selectionChristoph Hellwig
Use a plain BLK_MQ_F_* flag to select the round robin tag selection instead of overlaying an enum with just two possible values into the flags space. Doing so allows adding a BLK_MQ_F_MAX sentinel for simplified overflow checking in the messy debugfs helpers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/r/20250106083531.799976-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-01-03driver core: Constify API device_find_child() and adapt for various usagesZijun Hu
Constify the following API: struct device *device_find_child(struct device *dev, void *data, int (*match)(struct device *dev, void *data)); To : struct device *device_find_child(struct device *dev, const void *data, device_match_t match); typedef int (*device_match_t)(struct device *dev, const void *data); with the following reasons: - Protect caller's match data @*data which is for comparison and lookup and the API does not actually need to modify @*data. - Make the API's parameters (@match)() and @data have the same type as all of other device finding APIs (bus|class|driver)_find_device(). - All kinds of existing device match functions can be directly taken as the API's argument, they were exported by driver core. Constify the API and adapt for various existing usages. BTW, various subsystem changes are squashed into this commit to meet 'git bisect' requirement, and this commit has the minimal and simplest changes to complement squashing shortcoming, and that may bring extra code improvement. Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Uwe Kleine-König <ukleinek@kernel.org> # for drivers/pwm Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20241224-const_dfc_done-v5-4-6623037414d4@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-01-02scsi: fnic: Increment driver versionKaran Tilak Kumar
Increment driver version to 1.8.0.0 Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Tested-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-16-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add support to handle port channel RSCNKaran Tilak Kumar
Add support to handle port channel RSCN. Port channel RSCN is a Cisco vendor specific RSCN event. It is applicable only to Cisco UCS fabrics. If there's a change in the port channel configuration, an RCSN is sent to fnic. This is used to serially reset the scsi initiator fnics so that there's no all paths down scenario. The affected fnics are added to a list that are reset with a small time gap between them. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-15-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Code cleanupKaran Tilak Kumar
Replace existing host structure with fnic host. Add headers from scsi to support new functionality. Remove unused code and declarations. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-14-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add stats and related functionalityKaran Tilak Kumar
Add statistics and related functionality for FDLS. Add supporting functions to display stats. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-13-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Modify fnic interfaces to use FDLSKaran Tilak Kumar
Modify fnic driver interfaces to use FDLS and supporting functions. Refactor code in fnic_probe and fnic_remove. Get fnic from shost_priv. Add error handling in stats processing functions. Modify some print statements. Add support to do module unload cleanup. Use placeholder functions/modify function declarations to not break compilation. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-12-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Modify IO path to use FDLSKaran Tilak Kumar
Modify IO path to use FDLS. Add helper functions to process IOs. Remove unused template functions. Clean up obsolete code. Refactor old function definitions. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202410210147.fQp7tYeb-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Reviewed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-11-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add functionality in fnic to support FDLSKaran Tilak Kumar
Add interfaces in fnic to use FDLS services. Modify link up and link down functionality to use FDLS. Replace existing interfaces to handle new functionality provided by FDLS. Modify data types of some data members to handle new functionality. Add processing of tports and handling of tports. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202409292037.ZYWZwIK6-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-10-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add and integrate support for FIPKaran Tilak Kumar
Add and integrate support for FCoE Initialization (protocol) FIP. This protocol will be exercised on Cisco UCS rack servers. Add support to specifically print FIP related debug messages. Replace existing definitions to handle new data structures. Clean up old and obsolete definitions. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202409291955.FcMZfNSt-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202412081904.pXwdx15J-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-9-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add and integrate support for FDMIKaran Tilak Kumar
Add support for Fabric-Device Management Interface (FDMI) by introducing PCI device IDs for Cisco Hardware. Introduce a module parameter to enable/disable FDMI support. Integrate support for FDMI. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202406110734.p2v8dq9v-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-8-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add Cisco hardware model namesKaran Tilak Kumar
Add model IDs for Cisco VIC. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-7-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add support for unsolicited requests and responsesKaran Tilak Kumar
Add support for unsolicited requests and responses. Add support to accept and reject frames. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202409291705.MugERX98-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-6-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add support for target based solicited requests and responsesKaran Tilak Kumar
Add support for target based solicited requests and responses. Add support for tport definitions and processing. Add support for restarting the IT nexus. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202406120146.xchlZbqX-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202412081427.SlsFIJY4-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-5-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add support for fabric based solicited requests and responsesKaran Tilak Kumar
Add fdls_disc.c to support fabric based solicited requests and responses. Clean up obsolete code but keep the function template so as to not break compilation. Remove duplicate definitions from header files. Modify definitions of data members. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202406112309.8GiDUvIM-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202406120201.VakI9Dly-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202412080837.2JU0r2Ny-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-4-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Add headers and definitions for FDLSKaran Tilak Kumar
Add headers and definitions for FDLS (Fabric Discovery and Login Services). Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-3-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: fnic: Replace shost_printk() with dev_info()/dev_err()Karan Tilak Kumar
Sending host information to shost_printk() prior to host initialization in fnic is unnecessary. Replace shost_printk() and a printk() prior to this initialization with dev_info() and dev_err() accordingly. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-2-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: scsi_debug: Skip host/bus reset settle delayBart Van Assche
Skip the reset settle delay during error handling since the scsi_debug driver doesn't need this delay. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241216184852.2626339-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02Merge patch series "scsi: Constify 'struct bin_attribute'"Martin K. Petersen
Thomas Weißschuh <linux@weissschuh.net> says: The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-0-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: qla4xxx: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-11-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: qla2xxx: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-10-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: qedi: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-9-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: qedf: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-8-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: ipr: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-7-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-6-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: ibmvfc: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-5-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: esas2r: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-4-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: arcmsr: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-3-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: 3w-sas: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-2-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: core: Constify 'struct bin_attribute'Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-1-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02Merge patch series "Update lpfc to revision 14.4.0.7"Martin K. Petersen
Justin Tee <justintee8345@gmail.com> says: Update lpfc to revision 14.4.0.7 This patch set contains fixes related to smatch, clean up of obsolete code and global spinlocks, changes to ADISC and LS_RJT handling, and support for large fw object reads used in proprietary applications. The patches were cut against Martin's 6.14/scsi-queue tree. Link: https://lore.kernel.org/r/20241212233309.71356-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Copyright updates for 14.4.0.7 patchesJustin Tee
Update copyrights to 2024 for files modified in the 14.4.0.7 patch set. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-11-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Update lpfc version to 14.4.0.7Justin Tee
Update lpfc version to 14.4.0.7 Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-10-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Add support for large fw object application layer readsJustin Tee
Current lpfc bsg implementation allows a maximum fw read object size of 30KB. Implementation and support for read object mailbox commands for fw objects larger than 30KB are now required for proprietary applications. Thus, update the lpfc_sli_config_emb0_subsys structure and its associated submission and completion paths to accommodate for an alternative form of read object command that supports large fw objects. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Update definition of firmware configuration mbox cmdsJustin Tee
There are unused fields in mailbox commands that query for firmware configuration information. As such, update the struct definitions by correcting the name of certain fields and removing the unused fields. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Change lpfc_nodelist save_flags member into a bitmaskJustin Tee
In attempt to reduce the amount of unnecessary ndlp->lock acquisitions in the lpfc driver, change save_flags into an unsigned long bitmask and use clear_bit/test_bit bitwise atomic APIs instead of reliance on ndlp->lock for synchronization. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Add handling for LS_RJT reason explanation authentication requiredJustin Tee
When a LS_RJT is received with reason explanation authentication required, current driver logic is to retry the PLOGI up to 48 times. In the worse case scenario, 48 retries can take longer than dev_loss_tmo and if there is an RSCN received indicating an authentication requirement change, the driver may miss processing it. Fix by adding logic to specifically handle reason explanation authentication required and set the max retry count to 8 times. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Modify handling of ADISC based on ndlp state and RPI registrationJustin Tee
In lpfc_check_adisc, remove the requirement that the ndlp object must have been RPI registered. Whether or not the ndlp is RPI registered is unrelated to verifying that the received ADISC is intended for that ndlp rport object. After ADISC receipt, there's no need to put the ndlp state into NPR. Let the cmpl routines from the actions taken earlier in ADISC handling set the proper ndlp state. Also, refactor when a RESUME_RPI mailbox command should be sent. It should only be sent if the RPI registered flag is set. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Delete NLP_TARGET_REMOVE flag due to obsolete usageJustin Tee
Remove the NLP_TARGET_REMOVE flag as its usage is obsolete. The current framework is to rely on the lpfc_dev_loss_tmo_callbk from upper layer to notify final ndlp kref release. There's no need to specifically set NLP_EVT_DEVICE_RM when a LOGO completes. The dev_loss_tmo_callbk is responsible for the final kref put. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Restrict the REG_FCFI MAM field to FCoE adapters onlyJustin Tee
Qualify setting the REG_FCFI MAM field to FCoE adapters only by keying off HBA_FCOE_MODE phba->hba_flag. The field is not applicable to FC adapters. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: lpfc: Redefine incorrect type in lpfc_create_device_data()Justin Tee
Fix smatch warning by redefining local variable memory_flags from int to gfp_t. lpfc_scsi.c: warning: incorrect type in argument 2 (different base types) lpfc_scsi.c: expected restricted gfp_t [usertype] gfp_mask lpfc_scsi.c: got int memory_flags Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241212233309.71356-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: myrb: Remove dead codeAriel Otilibili
* reported by Coverity ID 1602240 * ldev_info is always true, therefore the branch statement is never called. Fixes: 081ff398c56c ("scsi: myrb: Add Mylex RAID controller (block interface)") Cc: Hannes Reinecke <hare@kernel.org> Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@eurecom.fr> Link: https://lore.kernel.org/r/20241213225852.62741-2-ariel.otilibili-anieli@eurecom.fr Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1Paul Menzel
Currently, the code does: if (x == 0) { x &= ~0x3; x |= 0x1; } Zeroing bits 0 and 1 of a variable that is 0 is not necessary. So directly set the variable to 1. Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Fixes: f92363d12359 ("[SCSI] mpt3sas: add new driver supporting 12GB SAS") Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Link: https://lore.kernel.org/r/20241212221817.78940-2-pmenzel@molgen.mpg.de Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: mpt3sas: Add details to EEDPTagMode error messagePaul Menzel
Linux 5.15 logs the error below mpt3sas_cm0: overriding NVDATA EEDPTagMode setting on a Dell PowerEdge T440 with the card below. 5e:00.0 Serial Attached SCSI controller [0107]: Broadcom / LSI SAS3008 PCI-Express Fusion-MPT SAS-3 [1000:0097] (rev 02) It’s not clear to a user what this error is about. As a first step to improve this, add the values to the error message. Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Link: https://lore.kernel.org/r/20241212221817.78940-1-pmenzel@molgen.mpg.de Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: esp: Fix variable typoSiddharth Menon
Renamed ESP_CONGIG4_TEST to ESP_CONFIG4_TEST Signed-off-by: Siddharth Menon <simeddon@gmail.com> Link: https://lore.kernel.org/r/20241210040202.11112-1-simeddon@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-01-02scsi: isci: Remove unused isci_remote_device_reset_complete()Dr. David Alan Gilbert
isci_remote_device_reset_complete() last use was removed in 2012 by commit 14aaa9f0a318 ("isci: Redesign device suspension, abort, cleanup.") Remove it. It was the last user of sci_remote_device_reset_complete(). Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Link: https://lore.kernel.org/r/20241223180218.50426-1-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>