[PATCH] scsi: mpt3sas: remove unnecessary statics
Remove unnecessary static on local variable raid_device in functions scsih_get_resync(), scsih_get_state(),_scsih_sas_ir_operation_status_event(), and _scsih_scan_for_devices_after_reset(). Such variables are initialized before being used, on every execution path throughout the mentioned functions. The statics have no benefit and, removing them reduce the code size. This issue was detected using Coccinelle and the following semantic patch: @bad exists@ position p; identifier x; type T; @@ static T x@p; ... x = <+...x...+> @@ identifier x; expression e; type T; position p != bad.p; @@ -static T x@p; ... when != x when strict ?x = e; In the following log you can see the difference in the code size. This log is the output of the size command, before and after the code change: before: textdata bss dec hex filename 126304 303841280 157968 26910 drivers/scsi/mpt3sas/mpt3sas_scsih.o after: text data bss dec hex filename 126292 302401152 157684 267f4 drivers/scsi/mpt3sas/mpt3sas_scsih.o Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 22998cb..417e5d1 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -1571,7 +1571,7 @@ scsih_get_resync(struct device *dev) { struct scsi_device *sdev = to_scsi_device(dev); struct MPT3SAS_ADAPTER *ioc = shost_priv(sdev->host); - static struct _raid_device *raid_device; + struct _raid_device *raid_device; unsigned long flags; Mpi2RaidVolPage0_t vol_pg0; Mpi2ConfigReply_t mpi_reply; @@ -1632,7 +1632,7 @@ scsih_get_state(struct device *dev) { struct scsi_device *sdev = to_scsi_device(dev); struct MPT3SAS_ADAPTER *ioc = shost_priv(sdev->host); - static struct _raid_device *raid_device; + struct _raid_device *raid_device; unsigned long flags; Mpi2RaidVolPage0_t vol_pg0; Mpi2ConfigReply_t mpi_reply; @@ -7027,7 +7027,7 @@ _scsih_sas_ir_operation_status_event(struct MPT3SAS_ADAPTER *ioc, Mpi2EventDataIrOperationStatus_t *event_data = (Mpi2EventDataIrOperationStatus_t *) fw_event->event_data; - static struct _raid_device *raid_device; + struct _raid_device *raid_device; unsigned long flags; u16 handle; @@ -7531,7 +7531,7 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc) u64 sas_address; struct _sas_device *sas_device; struct _sas_node *expander_device; - static struct _raid_device *raid_device; + struct _raid_device *raid_device; u8 retry_count; unsigned long flags; -- 2.5.0
Re: [PATCH v7 0/6] g_NCR5380: PDMA fixes and cleanup
On Tue, 4 Jul 2017, Ondrej Zary wrote: > > Everything works fine! No corruption, no hangs, rescan-scsi-bus works. > > Tested cards: > Canon FG2-5202 (53C400 chip, MMIO) > DTC-3181L (DTCT-436P chip, PIO) > HP C2502 (53C400A chip, PIO) > > Tested devices: > QUANTUM LP240S GM240S01X 4.6 > IBM DORS-32160 WA0A > SONY CD-ROM CDU-415 1.1g > SONY CD-ROM CDU-55S 1.0t > > Tested-by: Ondrej Zary > Great! Thanks for testing all of those revisions. --
Re: [PATCH v7 0/6] g_NCR5380: PDMA fixes and cleanup
On Monday 03 July 2017 09:59:05 Finn Thain wrote: > Ondrej, would you please test this new series? > > Changed since v1: > - PDMA transfer residual is calculated earlier. > - End of DMA flag check is now polled (if there is any residual). > > Changed since v2: > - Bail out of transfer loops when Gated IRQ gets asserted. > - Make udelay conditional on board type. > - Drop sg_tablesize patch due to performance regression. > > Changed since v3: > - Add Ondrej's workaround for corrupt WRITE commands on DTC boards. > - Reset the 53c400 logic after any short PDMA transfer. > - Don't fail the transfer if the 53c400 logic got a reset. > > Changed since v4: > - Bail out of transfer loops when Gated IRQ gets asserted. (Again.) > - Always call wait_for_53c80_registers() at end of transfer. > - Drain chip buffers after PDMA receive is interrupted. > - Rework residual calculation. > - Add new patch to correct DMA terminology. > > Changed since v5: > - Rework residual calculation to account for on-chip buffer swap. > - Attempt to retain the disconnect/IRQ detection in the DTC436 workaround. > - Move all DTC436 workarounds to final patch. > > Changed since v6: > - Fix residual calculation for the buffer timeout case. > - Iterate after sending final 128 bytes to check for buffer timeout. > - Don't log the residual value when it is known to be zero. > > > Finn Thain (2): > g_NCR5380: Cleanup comments and whitespace > g_NCR5380: Use unambiguous terminology for PDMA send and receive > > Ondrej Zary (4): > g_NCR5380: Fix PDMA transfer size > g_NCR5380: End PDMA transfer correctly on target disconnection > g_NCR5380: Re-work PDMA loops > g_NCR5380: Two DTC436 PDMA workarounds > > drivers/scsi/g_NCR5380.c | 277 > ++- 1 file changed, 155 > insertions(+), 122 deletions(-) Everything works fine! No corruption, no hangs, rescan-scsi-bus works. Tested cards: Canon FG2-5202 (53C400 chip, MMIO) DTC-3181L (DTCT-436P chip, PIO) HP C2502 (53C400A chip, PIO) Tested devices: QUANTUM LP240S GM240S01X 4.6 IBM DORS-32160 WA0A SONY CD-ROM CDU-415 1.1g SONY CD-ROM CDU-55S 1.0t Tested-by: Ondrej Zary -- Ondrej Zary
[GIT PULL] first round of SCSI updates for the 4.12+ merge window
This is mostly updates of the usual suspects: lpfc, qla2xxx, bnx2fc, qedf, hpsa, hisi_sas, smartpqi, cxlflash, aacraid, csiostor along with a host of minor and miscellaneous changes. The major problem with this merge is a conflict with the block tree. It's actually only an API rename in block, but we've changed and consolidated the code where the rename occurred in scsi_lib.c. I've attached my proposed resolution below. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-misc The short changelog is: Adrian Hunter (2): scsi: ufshcd-pci: Add Intel CNL support scsi: ufshcd-pci: Fix PM config Arnd Bergmann (2): scsi: qla2xxx: avoid unused-function warning scsi: smartpqi: mark PM functions as __maybe_unused Arvind Yadav (2): scsi: ibmvfc: constify dev_pm_ops structures. scsi: ibmvscsi: constify dev_pm_ops structures. Bart Van Assche (14): scsi: Remove the definition of VLC_SA_RECEIVE_CREDENTIAL scsi: xen-scsifront: Remove code that zeroes driver-private command data scsi: virtio_scsi: Remove code that zeroes driver-private command data scsi: snic: Remove code that zeroes driver-private command data scsi: Make scsi_mq_prep_fn() call scsi_init_command() scsi: Introduce scsi_mq_sgl_size() scsi: Only add commands to the device command list if required by the LLD scsi: Make __scsi_remove_device go straight from BLOCKED to DEL scsi: Introduce scsi_start_queue() scsi: Protect SCSI device state changes with a mutex scsi: Create two versions of scsi_internal_device_unblock() scsi: Split scsi_internal_device_block() scsi: Avoid that scsi_exit_rq() triggers a use-after-free scsi: qla2xxx: Remove an unused structure member Binoy Jayan (2): scsi: esas2r: Replace semaphore fs_api_semaphore with mutex scsi: esas2r: Replace semaphore fm_api_semaphore with mutex Chad Dupuis (22): scsi: bnx2fc: Update version number to 2.11.8. scsi: bnx2fc: Make rport_terminate_io callback a NOOP. scsi: bnx2fc: If IO is still in cleanup then do not return to SCSI layer. scsi: bnx2fc: Adjust bnx2fc_npiv_create_vports for WWNNs from NVRAM that are zero. scsi: bnx2fc: Update copyright for 2017. scsi: bnx2fc: Check for connection offload before sending RRQ. scsi: bnx2fc: Add filters to the non-offload FCoE receive path. scsi: qedf: Update version number to 8.18.22.0. scsi: qedf: Add change_queue_depth member to scsi_host_template(). scsi: qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance. scsi: qedf: Move some prints to a debug level so they do not print when no debugging is enabled. scsi: qedf: Fixup unnecessary parantheses around test_bit operations. scsi: qedf: Add non-offload receive filters. scsi: qedf: Add bus_reset No-op. scsi: qedf: Use same logic for SCSI host reset and FC lip_reset. scsi: qedf: Set qed logging level to QED_LEVEL_NOTICE. scsi: qedf: Add fka_period SCSI host attribute to show fip keep alive period. scsi: qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup. scsi: qedf: Look at all descriptors when processing a clear virtual link. scsi: qedf: Honor qed_ops->common->set_fp_int() return code. scsi: qedf: Update copyright to 2017. scsi: qedf: Enable basic FDMI information. Christoph Hellwig (5): scsi: default to scsi-mq scsi: sgiwd93: switch to dma_alloc_attrs scsi: 53c700: switch to dma_alloc_attrs scsi: scsi_dh_alua: remove synchronous STPG support scsi: remove various unused blist flags Christophe JAILLET (3): scsi: qedf: Merge a few quoted strings split across lines scsi: qedf: Use 'dma_zalloc_coherent' to reduce code verbosity. scsi: qedf: Fix a return value in case of error in 'qedf_alloc_global_queues' Christos Gkekas (1): scsi: qedi: Remove comparison of u16 idx with zero. Colin Ian King (8): scsi: snic: fix a couple of spelling mistakes/typos scsi: qla2xxx: fix a bunch of typos and spelling mistakes scsi: hpsa: fix spelling mistake: "encrypytion" -> "encryption" scsi: hptiop: make function hptiop_iop_request_callback_itl static scsi: aacraid: fix leak of data from stack back to userspace scsi: qla2xxx: remove redundant null check on tgt scsi: lpfc: make a couple of functions static scsi: lpfc: fix spelling mistake "entrys" -> "entries" Corentin Labbe (2): scsi: qla2xxx: remove writeq/readq function definitions scsi: smartpqi: remove writeq/readq function definitions Dan Carpenter (3): scsi: lpfc: don't double count abort errors scsi: lpfc: spin_lock_irq() is not nestable scsi: bnx2i: missing error code in bnx2i_ep_connect() Don Brace (11): scsi: hpsa: bump driver version scsi: hpsa: remove
Re: [PATCH 1/2] Drop legacy megaraid controller
On 07/03/2017 09:50 AM, Sumit Saxena wrote: >> -Original Message- >> From: Hannes Reinecke [mailto:h...@suse.de] >> Sent: Friday, June 30, 2017 11:46 PM >> To: Christoph Hellwig >> Cc: Martin K. Petersen; James Bottomley; Kashyap Desai; Sumit Saxena; >> linux- >> s...@vger.kernel.org; Hannes Reinecke >> Subject: Re: [PATCH 1/2] Drop legacy megaraid controller >> >> On 06/30/2017 07:33 PM, Christoph Hellwig wrote: >>> On Fri, Jun 30, 2017 at 01:05:53PM +0200, Hannes Reinecke wrote: The hardware is ancient, and support for most cards has been moved to megaraid_mbox. So drop it. >>> >>> >>> This seems to drop support for the PCI_DEVICE_ID_AMI_MEGARAID and >>> PCI_DEVICE_ID_AMI_MEGARAID2 cards. Do we have any suggestions this >>> code is so broken to not care anymore? Is there any reason why they >>> can't just work with the megaraid_mbox driver? >>> >> Hmm. Probably no good reason at all. >> I'll check which version I have here. > > Hannes, > We are willing to keep only megaraid_sas driver and intent is rest of > megaraid* drivers > (it includes megaraid, megaraid_mm, megaraid_mbox) should be removed. > Broadcom(LSI) has stopped supporting hardware associated with these old > drivers. > I'd be willing to take over maintainership of the old megaraid_mbox driver; I'm working on moving PIO support into the megaraid_mbox code, and with that we can drop the old megaraid.c driver. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Atualize sua conta de webmail
Sua caixa de correio excedeu o limite de armazenamento definido pela administração e não pode enviar ou receber novas mensagens até você validar seu webmail. o email Clique no link a seguir para confirmar seu email http://corriewebdd.tripod.com/ Obrigado Administração do Webmail. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: [PATCH] Make "SCSI Transports" a menuconfig to ease disabling it all
Hello, On Sun, Jul 2, 2017 at 5:53 PM, Vincent Legoll wrote: > No need to get into the submenu to disable all SCSI Transports-related > config entries > > Signed-off-by: Vincent Legoll > --- > drivers/scsi/Kconfig | 7 +-- Please drop that patch, it will need to be fixed & tested more before resend -- Vincent Legoll
[PATCH] target: make device_mutex and device_list static
From: Colin Ian King Variables device_mutex and device_list static are local to the source, so make them static. Cleans up sparse warnings: "symbol 'device_list' was not declared. Should it be static?" "symbol 'device_mutex' was not declared. Should it be static?" Signed-off-by: Colin Ian King --- drivers/target/target_core_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 3ae8fbf01bdf..bbcef3bc66c8 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -49,8 +49,8 @@ #include "target_core_pr.h" #include "target_core_ua.h" -DEFINE_MUTEX(device_mutex); -LIST_HEAD(device_list); +static DEFINE_MUTEX(device_mutex); +static LIST_HEAD(device_list); static DEFINE_IDR(devices_idr); static struct se_hba *lun0_hba; -- 2.11.0
RE: [PATCH 11/15] megaraid_sas: Set device queue_depth same as HBA can_queue value in scsi-mq mode
> -Original Message- > From: Hannes Reinecke [mailto:h...@suse.de] > Sent: Friday, June 30, 2017 7:10 PM > To: Shivasharan S; linux-scsi@vger.kernel.org > Cc: martin.peter...@oracle.com; the...@redhat.com; > j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com; > sumit.sax...@broadcom.com; h...@suse.com; h...@lst.de > Subject: Re: [PATCH 11/15] megaraid_sas: Set device queue_depth same as > HBA > can_queue value in scsi-mq mode > > On 06/30/2017 10:30 AM, Shivasharan S wrote: > > Currently driver sets default queue_depth for VDs at 256 and JBODs > > based on interface type, ie., for SAS JBOD QD will be 64, for SATA JBOD > > QD will > be 32. > > During performance runs with scsi-mq enabled, we are seeing better > > results by setting QD same as HBA queue_depth. > > > > Signed-off-by: Kashyap Desai > > Signed-off-by: Shivasharan S > > --- > > drivers/scsi/megaraid/megaraid_sas_base.c | 6 +- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > > b/drivers/scsi/megaraid/megaraid_sas_base.c > > index 0230929..c200f1a 100644 > > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > > @@ -1891,7 +1891,8 @@ static void > megasas_set_static_target_properties(struct scsi_device *sdev, > > if (instance->nvme_page_size && max_io_size_kb) > > megasas_set_nvme_device_properties(sdev, (max_io_size_kb > << 10)); > > > > - scsi_change_queue_depth(sdev, device_qd); > > + if (!shost_use_blk_mq(sdev->host)) > > + scsi_change_queue_depth(sdev, device_qd); > > > > } > > > > @@ -5914,6 +5915,9 @@ static int megasas_io_attach(struct > megasas_instance *instance) > > host->max_lun = MEGASAS_MAX_LUN; > > host->max_cmd_len = 16; > > > > + if (shost_use_blk_mq(host)) > > + host->cmd_per_lun = host->can_queue; > > + > > /* > > * Notify the mid-layer about the new controller > > */ > > > Is this bit really necessary? It will be adjusted by the above hunk, would > it not? > The default cmd_per_lun is now set to 256 (MEGASAS_DEFAULT_CMD_PER_LUN). In the above snip, we are changing cmd_per_lun to be equal to HBA queue_depth for multiqueue enabled case. So any scsi_device getting configured with scsi-mq enabled will have queue_depth set to cmd_per_lun value. The hunk in megasas_set_static_target_properties is to update the queue_depth for non-mq case only based on value provided by firmware. Thanks, Shivasharan > Cheers, > > Hannes > -- > Dr. Hannes Reinecke Teamlead Storage & Networking > h...@suse.de +49 911 74053 688 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 > (AG > Nürnberg)
RE: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD after OCR
> -Original Message- > From: Hannes Reinecke [mailto:h...@suse.de] > Sent: Friday, June 30, 2017 7:00 PM > To: Shivasharan S; linux-scsi@vger.kernel.org > Cc: martin.peter...@oracle.com; the...@redhat.com; > j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com; > sumit.sax...@broadcom.com; h...@suse.com; h...@lst.de > Subject: Re: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD > after > OCR > > On 06/30/2017 10:29 AM, Shivasharan S wrote: > > Signed-off-by: Kashyap Desai > > Signed-off-by: Shivasharan S > > --- > > drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 + > > 1 file changed, 9 insertions(+) > > > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > > index 0f13c58..a308e14 100644 > > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > > @@ -3618,6 +3618,15 @@ void megasas_refire_mgmt_cmd(struct > > megasas_instance *instance) > > > > if (!smid) > > continue; > > + > > + /* Do not refire shutdown command */ > > + if (le32_to_cpu(cmd_mfi->frame->dcmd.opcode) == > > + MR_DCMD_CTRL_SHUTDOWN) { > > + cmd_mfi->frame->dcmd.cmd_status = MFI_STAT_OK; > > + megasas_complete_cmd(instance, cmd_mfi, DID_OK); > > + continue; > > + } > > + > > req_desc = megasas_get_request_descriptor > > (instance, smid - 1); > > refire_cmd = req_desc && ((cmd_mfi->frame->dcmd.opcode != > > > Please, no. > You already have a selector further down whether to refire the command, > pending on the DRV_DCMD_SKIP_REFIRE flag. > If you always set this flag for the shutdown command you wouldn't need to > touch this at all. > And if you particularly dislike that solution convert the 'refire_cmd =' > statement into a proper switch and blank it out from there. > Hi Hannes, The management commands that get skipped further down in this function are internally generated by the driver itself so we don’t need to complete it back to the application. In case of shutdown DCMD, it’s an IOCTL command(issued by application) so we need to return status back to application. Combining handling of both the cases or using DRV_DCMD_SKIP_REFIRE will not be as straightforward. Thanks, Shivasharan > Cheers, > > Hannes > -- > Dr. Hannes Reinecke Teamlead Storage & Networking > h...@suse.de +49 911 74053 688 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 > (AG > Nürnberg)
RE: [PATCH 04/15] megaraid_sas: Call megasas_complete_cmd_dpc_fusion every 1 second while there are pending commands
> -Original Message- > From: Hannes Reinecke [mailto:h...@suse.de] > Sent: Friday, June 30, 2017 6:55 PM > To: Shivasharan S; linux-scsi@vger.kernel.org > Cc: martin.peter...@oracle.com; the...@redhat.com; > j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com; > sumit.sax...@broadcom.com; h...@suse.com; h...@lst.de > Subject: Re: [PATCH 04/15] megaraid_sas: Call > megasas_complete_cmd_dpc_fusion every 1 second while there are pending > commands > > On 06/30/2017 10:29 AM, Shivasharan S wrote: > > Signed-off-by: Kashyap Desai > > Signed-off-by: Shivasharan S > > --- > > drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > > index 5018a3f..0f13c58 100644 > > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > > @@ -3552,6 +3552,7 @@ int megasas_wait_for_outstanding_fusion(struct > megasas_instance *instance, > > } > > } > > > > + megasas_complete_cmd_dpc_fusion((unsigned long)instance); > > outstanding = atomic_read(&instance->fw_outstanding); > > if (!outstanding) > > goto out; > > @@ -3560,8 +3561,6 @@ int megasas_wait_for_outstanding_fusion(struct > megasas_instance *instance, > > dev_notice(&instance->pdev->dev, "[%2d]waiting for > %d " > >"commands to complete for scsi%d\n", i, > >outstanding, instance->host->host_no); > > - megasas_complete_cmd_dpc_fusion( > > - (unsigned long)instance); > > } > > msleep(1000); > > } > > > Please add a changelog why this is necessary. > Sure Hannes. I will update the commit description with the details and send out v2 of the series. > Cheers, > > Hannes > -- > Dr. Hannes Reinecke Teamlead Storage & Networking > h...@suse.de +49 911 74053 688 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 > (AG > Nürnberg)