Re: [PATCH 03/10] gdth: remove gdth_{alloc,free}_ioctl
On 06/12/2018 17:50, Johannes Thumshirn wrote: > Why not calling dma_alloc_coherent() directly instead of using the > pci_alloc_consistent() wrapper? Ah should've read the whole series -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 03/10] gdth: remove gdth_{alloc,free}_ioctl
On 06/12/2018 16:57, Christoph Hellwig wrote: > Out of the three callers once insists on the scratch buffer, and the > others are fine with a new allocation. Switch those two to juse use > pci_alloc_consistent directly, and open code the scratch buffer > allocation in the remaining one. This avoids a case where we might > be doing a memory allocation under a spinlock with irqs disabled. Why not calling dma_alloc_coherent() directly instead of using the pci_alloc_consistent() wrapper? Johannes -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH -next] scsi: libfc: Remove set but not used variable 'disc'
Looks good, Reviewed-by: Johannes Thumshirn
Re: [PATCH 3/8] sg: split header, expand and correct descriptions
On 19/10/18 08:24, Douglas Gilbert wrote: > +/* Alternate style type names, "..._t" variants preferred */ > +typedef struct sg_io_hdr Sg_io_hdr; > +typedef struct sg_io_vec Sg_io_vec; > +typedef struct sg_scsi_id Sg_scsi_id; > +typedef struct sg_req_info Sg_req_info; There are no _t variants for the above, or am I missing something? -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 4/8] sg: expand request states
Looks good (but the ifdefs are creepy), Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 2/8] sg: introduce sg_log macro
On 19/10/18 08:24, Douglas Gilbert wrote: [..] > +/* > + * Kernel needs to be built with CONFIG_SCSI_LOGGING to see log messages. > + * 'depth' is a number between 1 (most severe) and 7 (most noisy, most > + * information). All messages are logged as informational (KERN_INFO). In > + * the unexpected situation where sdp is NULL the macro reverts to a pr_info > + * and ignores CONFIG_SCSI_LOGGING and always prints to the log. > + */ > +#define SG_LOG(depth, sdp, fmt, a...)\ > + do {\ > + if (IS_ERR_OR_NULL(sdp)) { \ > + pr_info("sg: sdp=NULL_or_ERR, " fmt, ##a); \ > + } else {\ > + SCSI_LOG_TIMEOUT(depth, sdev_prefix_printk( \ > + KERN_INFO, (sdp)->device, \ > + (sdp)->disk->disk_name, fmt, \ > + ##a)); \ > + } \ > + } while (0) Hi Doug, have you considered using the kernel's dynamic debug infrastructure instead? -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 1/8] sg: types and naming cleanup
On 19/10/18 08:24, Douglas Gilbert wrote: > Remove typedefs and use better type names like bool and u8 where > appropriate. Rename some variables and functions for clarity. > Adjust formatting (e.g. function definitions) to be more > consistent across the driver. Thanks a lot Doug, this is highly appreciated. I have one minor Nit if you need to resend the series, please remove the casts form void* (mostly filp->private_data). Otherwise: Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 28/28] mesh: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 27/28] ips: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 26/28] smartpqi: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 25/28] vmw_pscsi: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 24/28] snic: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 23/28] qla4xxx: fully convert to the generic DMA API
On Thu, Oct 11, 2018 at 08:49:58PM +0200, Christoph Hellwig wrote: > @@ -9026,19 +9026,13 @@ static void qla4xxx_remove_adapter(struct pci_dev > *pdev) > */ > static void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha) > { > - int retval; > - Can you zap that: At exit, the @ha's flags.enable_64bit_addressing set to indicated supported addressing method. Comment in the function description as well? It wasn't even correct with the initial submission of qla4xxx (according to git blame. Otherwise, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 22/28] qla2xxx: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 21/28] qla1280: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 20/28] qedi: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 19/28] qedf: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 17/28] nsp32: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 18/28] pm8001: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 16/28] mvsas: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 15/28] mvumi: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 14/28] mpt3sas: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 13/28] megaraid_sas: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 13/28] megaraid_sas: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 12/28] megaraid_mbox: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 10/28] fnic: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 11/28] hpsa: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 09/28] csiostor: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 08/28] be2iscsi: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 07/28] atp870u: switch to generic DMA API
On Thu, Oct 11, 2018 at 08:49:42PM +0200, Christoph Hellwig wrote: > Switch from the legacy PCI DMA API to the generic DMA API. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/atp870u.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c > index 8996d2329e11..802d15018ec0 100644 > --- a/drivers/scsi/atp870u.c > +++ b/drivers/scsi/atp870u.c > @@ -1193,7 +1193,7 @@ static void atp870u_free_tables(struct Scsi_Host *host) > for (k = 0; k < 16; k++) { > if (!atp_dev->id[j][k].prd_table) > continue; > - pci_free_consistent(atp_dev->pdev, 1024, > atp_dev->id[j][k].prd_table, atp_dev->id[j][k].prd_bus); > + dma_free_coherent(_dev->pdev->dev, 1024, > atp_dev->id[j][k].prd_table, atp_dev->id[j][k].prd_bus); > atp_dev->id[j][k].prd_table = NULL; > } > } > @@ -1205,7 +1205,7 @@ static int atp870u_init_tables(struct Scsi_Host *host) > int c,k; > for(c=0;c < 2;c++) { > for(k=0;k<16;k++) { > - atp_dev->id[c][k].prd_table = > pci_alloc_consistent(atp_dev->pdev, 1024, &(atp_dev->id[c][k].prd_bus)); > + atp_dev->id[c][k].prd_table = > dma_alloc_coherent(_dev->pdev->dev, 1024, &(atp_dev->id[c][k].prd_bus), > GFP_KERNEL); > if (!atp_dev->id[c][k].prd_table) { > printk("atp870u_init_tables fail\n"); > atp870u_free_tables(host); This looks ugly, but so does the rest, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 06/28] a100u2w: switch to generic DMA API
On Thu, Oct 11, 2018 at 08:49:41PM +0200, Christoph Hellwig wrote: > @@ -1124,7 +1124,8 @@ static int inia100_probe_one(struct pci_dev *pdev, > > /* Get total memory needed for SCB */ > sz = ORC_MAXQUEUE * sizeof(struct orc_scb); > - host->scb_virt = pci_zalloc_consistent(pdev, sz, >scb_phys); > + host->scb_virt = dma_zalloc_coherent(>dev, sz, >scb_phys, > + GFP_KERNEL); Nit: Indentation looks a bit odd here. > if (!host->scb_virt) { > printk("inia100: SCB memory allocation error\n"); > goto out_host_put; > @@ -1132,7 +1133,8 @@ static int inia100_probe_one(struct pci_dev *pdev, > > /* Get total memory needed for ESCB */ > sz = ORC_MAXQUEUE * sizeof(struct orc_extended_scb); > - host->escb_virt = pci_zalloc_consistent(pdev, sz, >escb_phys); > + host->escb_virt = dma_zalloc_coherent(>dev, sz, >escb_phys, > + GFP_KERNEL); and here. Otherwise, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 05/28] BusLogic: switch to generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 04/28] 3w-sas: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 03/28] 3w-xxx: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 02/28] 3w-9xxx: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 01/28] aic94xx: fully convert to the generic DMA API
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] megaraid_mbox: remove bogus use of pci_dma_sync_sg_* APIs
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] lpfc: remove a bogus pci_dma_sync_single_for_device call
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] lpfc: fixup crash in lpfc_els_unsol_buffer()
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] ib_srp: Remove WARN_ON in srp_terminate_io()
On Fri, Sep 21, 2018 at 02:15:05PM +0200, Hannes Reinecke wrote: > The WARN_ON() is pointless as the rport is placed in SDEV_TRANSPORT_OFFLINE > at that time, so no new commands can be submitted via srp_queuecomment() s/srp_queuecomment/srp_queuecommand/ -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH -next] scsi: libfc: remove set but not used variable 'rpriv'
Acked-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] libfc: remove unnecessary condition check
Acked-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] Simplify nvmet_init to remove extra out label
please send this patch to the correct mailing list (linux-n...@lists.infradead.org) -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] Remove extra goto label from nvmet_ns_enable
please send this patch to the correct mailing list (linux-n...@lists.infradead.org) -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] scsi: aic94xx: fix an error code in aic94xx_init()
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] sr: Avoid that opening a CD-ROM hangs with runtime power management enabled
On Fri, Aug 03, 2018 at 10:28:45AM +0200, Johannes Thumshirn wrote: > On Thu, Aug 02, 2018 at 10:44:42AM -0700, Bart Van Assche wrote: > > Surround scsi_execute() calls with scsi_autopm_get_device() and > > scsi_autopm_put_device(). Note: removing sr_mutex protection from > > the scsi_cd_get() and scsi_cd_put() calls is safe because the > > purpose of sr_mutex is to serialize cdrom_*() calls. > > > [...] > > Hi Bart, > > With this patch I still have the hang on next-20180801: Forget my last email, I didn't have Ming's 'blk-mq: fix blk_mq_tagset_busy_iter' applied. Tested-by: Johannes Thumshirn Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: next/master boot: 179 boots: 11 failed, 167 passed with 1 offline (next-20180731)
On Thu, Aug 02, 2018 at 07:15:30AM +0800, Ming Lei wrote: > I just checked my daily test log, looks this issue is reported 1st time > on next-20180731. >From the diff between next-20180727 and next-20180731 in drivers/scsi nothing really sticks out. $ PAGER= git diff --stat next-20180730..next-20180731 drivers/scsi/ drivers/scsi/3w-9xxx.c | 6 +- drivers/scsi/3w-sas.c| 3 +++ drivers/scsi/3w-.c | 2 ++ drivers/scsi/a100u2w.c | 4 ++-- drivers/scsi/atp870u.c | 16 drivers/scsi/ibmvscsi/ibmvscsi.c | 6 ++ drivers/scsi/libiscsi.c | 2 ++ drivers/scsi/lpfc/lpfc_nvmet.c | 8 +++- drivers/scsi/scsi_debug.c| 47 --- 9 files changed, 59 insertions(+), 35 deletions(-) but drivers/ata has seen some (power management) related changes: $ PAGER= git log --oneline --no-merges next-20180730..next-20180731 drivers/ata/ 11c291461b6e ata: libahci: Allow reconfigure of DEVSLP register 2dbb3ec29a6c ata: libahci: Correct setting of DEVSLP register b1a9585cc396 ata: ahci: Enable DEVSLP by default on x86 with SLP_S0 a5ec5a7bfd1f ata: ahci: Support state with min power but Partial low power state $ PAGER= git diff --stat next-20180730..next-20180731 drivers/ata/ drivers/ata/ahci.c| 38 +- drivers/ata/libahci.c | 25 - drivers/ata/libata-core.c | 1 + drivers/ata/libata-scsi.c | 1 + 4 files changed, 51 insertions(+), 14 deletions(-) I'll be looking into it. -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: next/master boot: 179 boots: 11 failed, 167 passed with 1 offline (next-20180731)
On Wed, Aug 01, 2018 at 02:50:40PM +0100, Guillaume Tucker wrote: > > Sure, although it didn't make any apparent difference, still on > next-20180731: > > https://lava.collabora.co.uk/scheduler/job/1215417 > > The .config file I used is available here, with just > CONFIG_BLK_DEV_RAM=y on top of defconfig: > > > https://people.collabora.com/~gtucker/lava/boot/debug/bzImage-85eac382fa06-blk-dev.config OK, this is a deviation from what I see here (on mkp's 4.19/scsi-queue not next though). -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: next/master boot: 179 boots: 11 failed, 167 passed with 1 offline (next-20180731)
On Wed, Aug 01, 2018 at 08:00:44PM +0800, Ming Lei wrote: > On Wed, Aug 01, 2018 at 07:52:19PM +0800, Ming Lei wrote: > > On Wed, Aug 01, 2018 at 12:24:00PM +0100, Matt Hart wrote: > > > On 1 August 2018 at 11:59, Mark Brown wrote: > > > > On Wed, Aug 01, 2018 at 06:51:09PM +0800, Ming Lei wrote: > > > > > > > >> You may have to provide some clue, such as dmesg log, boot disk, ... > > > > > > > >> I guess you don't use virtio-scsi/virtio-blk since both run at blk-mq > > > >> mode at default, even though without d5038a13eca72fb. > > > > > > > > Boot logs and so on can be found here: > > > > > > > > https://kernelci.org/boot/id/5b618c9f59b514931f96ba97/ > > > > https://kernelci.org/boot/id/5b618ca359b514904d96bac5/ > > > > https://kernelci.org/boot/id/5b618cbc59b51492e896baad/ > > > > > > > > (these are today's but the symptoms are the same.) The ramdisk is > > > > unfortunately not linked through the UI, though we don't get that far. > > > > > > And a full LAVA boot log from my lab > > > http://lava.streamtester.net/scheduler/job/138067 > > > > > > QEMU command line here: > > > http://lava.streamtester.net/scheduler/job/138067#L75 > > > > > > And a LAVA job definition, which includes the url of the ramdisk and > > > kernel: > > > http://lava.streamtester.net/scheduler/job/138067/definition#defline76 > > > > > > > Thanks for the sharing! > > > > I can reproduce this issue with above script/initrd/kernel config, and looks > > the issue disappeared after 'scsi_mod.use_blk_mq=0' is passed. > > > > Not see such issue with zero-day ktest config. > > > > Looks a bit weird, given SCSI_MQ is nothing related with ramdisk. > > Seems related with sr: > > 1) with scsi-mq > [2.808204] ata2.01: NODEV after polling detection > [2.809807] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100 > [2.827377] scsi 1:0:0:0: CD-ROMQEMU QEMU DVD-ROM 2.5+ > PQ: 0 ANSI: 5 > > 2) without scsi_mq > [5.549135] ata2.01: NODEV after polling detection > [5.554404] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100 > [5.596143] scsi 1:0:0:0: CD-ROMQEMU QEMU DVD-ROM 2.5+ > PQ: 0 ANSI: 5 > [5.637126] sr 1:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray > [5.637870] cdrom: Uniform CD-ROM driver Revision: 3.20 > [5.648940] sr 1:0:0:0: Attached scsi CD-ROM sr0 > [5.661605] sr 1:0:0:0: Attached scsi generic sg0 type 5 > > > We may need to take a look at recent SCSI change. [2.052168] ata2.01: NODEV after polling detection [2.053690] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100 [2.072269] scsi 1:0:0:0: CD-ROMQEMU QEMU DVD-ROM 2.5+ P5 [2.107220] sr 1:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray [2.107675] cdrom: Uniform CD-ROM driver Revision: 3.20 [2.111851] sr 1:0:0:0: Attached scsi CD-ROM sr0 [2.123560] sr 1:0:0:0: Attached scsi generic sg0 type 5 # cat /proc/cmdline console=ttyS0,115200 root=/dev/ram0 debug verbose $ grep SCSI_MQ .config CONFIG_SCSI_MQ_DEFAULT=y on Martin's latest 4.19/scsi-queue. -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: next/master boot: 179 boots: 11 failed, 167 passed with 1 offline (next-20180731)
On Wed, Aug 01, 2018 at 07:52:21PM +0800, Ming Lei wrote: > On Wed, Aug 01, 2018 at 12:24:00PM +0100, Matt Hart wrote: > > On 1 August 2018 at 11:59, Mark Brown wrote: > > > On Wed, Aug 01, 2018 at 06:51:09PM +0800, Ming Lei wrote: > > > > > >> You may have to provide some clue, such as dmesg log, boot disk, ... > > > > > >> I guess you don't use virtio-scsi/virtio-blk since both run at blk-mq > > >> mode at default, even though without d5038a13eca72fb. > > > > > > Boot logs and so on can be found here: > > > > > > https://kernelci.org/boot/id/5b618c9f59b514931f96ba97/ > > > https://kernelci.org/boot/id/5b618ca359b514904d96bac5/ > > > https://kernelci.org/boot/id/5b618cbc59b51492e896baad/ > > > > > > (these are today's but the symptoms are the same.) The ramdisk is > > > unfortunately not linked through the UI, though we don't get that far. > > > > And a full LAVA boot log from my lab > > http://lava.streamtester.net/scheduler/job/138067 > > > > QEMU command line here: > > http://lava.streamtester.net/scheduler/job/138067#L75 > > > > And a LAVA job definition, which includes the url of the ramdisk and kernel: > > http://lava.streamtester.net/scheduler/job/138067/definition#defline76 > > > > Thanks for the sharing! > > I can reproduce this issue with above script/initrd/kernel config, and looks > the issue disappeared after 'scsi_mod.use_blk_mq=0' is passed. > > Not see such issue with zero-day ktest config. > > Looks a bit weird, given SCSI_MQ is nothing related with ramdisk. Ahm and: qemu [...] -append "console=ttyS0,115200 root=/dev/ram0 debug verbose" $ grep CONFIG_BLK_DEV_RAM .config # CONFIG_BLK_DEV_RAM is not set Something is fishy here. -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: next/master boot: 179 boots: 11 failed, 167 passed with 1 offline (next-20180731)
On Wed, Aug 01, 2018 at 12:24:00PM +0100, Matt Hart wrote: > And a full LAVA boot log from my lab > http://lava.streamtester.net/scheduler/job/138067 > > QEMU command line here: > http://lava.streamtester.net/scheduler/job/138067#L75 > > And a LAVA job definition, which includes the url of the ramdisk and kernel: > http://lava.streamtester.net/scheduler/job/138067/definition#defline76 I grabbed your qemu cmdline and kernel config and try to reproduce it locally. Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: next/master boot: 179 boots: 11 failed, 167 passed with 1 offline (next-20180731)
On Wed, Aug 01, 2018 at 11:59:19AM +0100, Mark Brown wrote: > On Wed, Aug 01, 2018 at 06:51:09PM +0800, Ming Lei wrote: > > > You may have to provide some clue, such as dmesg log, boot disk, ... > > > I guess you don't use virtio-scsi/virtio-blk since both run at blk-mq > > mode at default, even though without d5038a13eca72fb. > > Boot logs and so on can be found here: > > https://kernelci.org/boot/id/5b618c9f59b514931f96ba97/ > https://kernelci.org/boot/id/5b618ca359b514904d96bac5/ > https://kernelci.org/boot/id/5b618cbc59b51492e896baad/ > > (these are today's but the symptoms are the same.) The ramdisk is > unfortunately not linked through the UI, though we don't get that far. Can you give us a bit more information about you test setups? Like Qemu command line, etc..? From you kernel config I see you're not using virtio (as Ming already suggested). What medium are you booting off? Thanks, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 1/6] scsi: Add ufs transport class
Hi Avri, On Wed, Aug 01, 2018 at 11:04:27AM +0300, Avri Altman wrote: [... > +#include Why do you include bsg.h here and bsg-lib.h in the scsi_transport_ufs.h? [...] > +#define to_ufs_internal(tmpl)container_of(tmpl, struct ufs_internal, > t) I'd personally prefer this to be a inline function instead of a define for type safety reasons. > + > +struct ufs_host_attrs { > + atomic_t next_port_id; > +}; > +#define to_ufs_host_attrs(x) ((struct ufs_host_attrs *)(x)->shost_data) Ditto. [...] > + > + port->id = atomic_inc_return(_host->next_port_id); Any reason you can't use an IDA for the port->id? [...] > + > + error = device_add(dev); > + > + if (error) > + return error; No blank line please. [...] > +#define dev_to_ufs_port(d) \ > + container_of((d), struct ufs_port, dev) Inline function as well, please. -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: FCOE vn2vn memory leaks in 4.14
On Fri, Jul 27, 2018 at 12:49:55AM +0200, ard wrote: > Actually already got there from my arm dump, but they are different in > backtrace. > Anyway: > root@antec:~# grep -c fc_rport_create kmemleak.txt > 44 > So 44 * 512 bytes leaked in that path. And an extra thing: "it was leaked in" > libfc and not libfcoe. > Or just like the bug report we were leaking fc_rport_priv. > But one thing I don't understand (yet) is why the fc_rport_create happens > while > we already have a port. > > Anyway, I will continue bug hunting. It's night, and the temperature has > dropped to 29.8 . So I've fixed one use-after-free and one memory leak, but the one you reported is still on the TODO list. Long story short, I can reproduce it here and I'm working on it. Thanks for your patience, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: FCOE vn2vn memory leaks in 4.14
On Fri, Jul 27, 2018 at 12:49:55AM +0200, ard wrote: > Hi, > > On Thu, Jul 26, 2018 at 05:05:37PM +0200, Johannes Thumshirn wrote: > > On Thu, Jul 26, 2018 at 04:25:24PM +0200, ard wrote: > > > The system itself is an exynos 5422 arm. It worked perfectly fine > > > with 3.10 as an Initiator, now it leaks memory the moment I > > > enable the FCoE vlan on the port. > > > > So I had a look through the commits between v3.10 and v4.14 and this > > one sticks out: > > ea0a95d7f162 ("fcoe: Use kfree_skb() instead of kfree()") > > > > While I think it is necessary to release a skb with kfree_skb() it > > still might be worth trying to revert it for a test run. > > So I had a recompile for the destop (i920) > And fortunately after 2 hours he was already collecting memory > leaks. > This makes to me at least a few unknowns more clean: > 1) usb vs pci nic doesn't matter. > (I am too lazy to send in: > https://github.com/ardje/linux/commit/93e0b1fec38859ff0fb6e24eab10778f5b3be289 > ) > 2) ARM vs X86 doesn't matter > > Anyway: here are the kmemleak and the dmesg after almost 2 hours: > https://github.com/hardkernel/linux/files/2233646/kmemleak-antec.txt > https://github.com/hardkernel/linux/files/2233648/dmesg.txt > > Also the kmemleak.txt of the x86 seems to be more verbose: > > unreferenced object 0x880196472400 (size 512): > comm "kworker/7:2", pid 120, jiffies 4301444306 (age 1225.078s) > hex dump (first 32 bytes): > b8 d7 7c 8d 01 88 ff ff 00 00 00 00 00 00 00 00 ..|. > 05 00 00 00 08 00 00 00 52 05 30 06 1e 00 00 10 R.0. > backtrace: > [] fc_rport_create+0x42/0x190 [libfc] > [] fcoe_ctlr_vn_add.isra.17+0x42/0x1d0 [libfcoe] > [] fcoe_ctlr_vn_recv+0x496/0xad0 [libfcoe] > [] fcoe_ctlr_recv_work+0x700/0xfb0 [libfcoe] > [] process_one_work+0x142/0x370 > [] worker_thread+0x62/0x3d0 > [] kthread+0x114/0x150 > [] ret_from_fork+0x35/0x40 > [] 0x > > vs: > unreferenced object 0xe07d9b00 (size 256): > comm "kworker/0:1", pid 97, jiffies 4294944354 (age 209914.188s) > hex dump (first 32 bytes): > 70 64 49 ec 00 00 00 00 07 00 00 00 08 00 00 00 pdI. > 88 40 7f 1d 24 00 00 10 88 40 7f 1d 24 00 00 20 .@..$@..$.. > backtrace: > [] fcoe_ctlr_vn_add+0x3c/0x1b4 [libfcoe] > [] fcoe_ctlr_vn_recv+0x800/0xb2c [libfcoe] > [] fcoe_ctlr_recv_work+0xb94/0x17f0 [libfcoe] > [] process_one_work+0x138/0x4bc > [] worker_thread+0x34/0x4f4 > [] kthread+0x12c/0x15c > [] ret_from_fork+0x14/0x2c > [] 0x > > Now the x86 dump leads me to: > http://lists.open-fcoe.org/pipermail/fcoe-devel/2013-May/012014.html > > Actually already got there from my arm dump, but they are different in > backtrace. > Anyway: > root@antec:~# grep -c fc_rport_create kmemleak.txt > 44 > So 44 * 512 bytes leaked in that path. And an extra thing: "it was leaked in" > libfc and not libfcoe. > Or just like the bug report we were leaking fc_rport_priv. > But one thing I don't understand (yet) is why the fc_rport_create happens > while > we already have a port. > > Anyway, I will continue bug hunting. It's night, and the temperature has > dropped to 29.8 . Just to be sure, did you revert the patch I mentioned? I'm not sure it is the one that introduced the bug, but it's definitively worth a try. Thanks, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: FCOE vn2vn memory leaks in 4.14
On Thu, Jul 26, 2018 at 04:25:24PM +0200, ard wrote: > The system itself is an exynos 5422 arm. It worked perfectly fine > with 3.10 as an Initiator, now it leaks memory the moment I > enable the FCoE vlan on the port. So I had a look through the commits between v3.10 and v4.14 and this one sticks out: ea0a95d7f162 ("fcoe: Use kfree_skb() instead of kfree()") While I think it is necessary to release a skb with kfree_skb() it still might be worth trying to revert it for a test run. Thanks, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: FCOE vn2vn memory leaks in 4.14
On Thu, Jul 26, 2018 at 04:25:24PM +0200, ard wrote: > > Anyways, can you please enable the kernel memory leak detector [1] and > > possibly even try a more up to date (like v4.18-rc6) kernel? > > > > [1] https://www.kernel.org/doc/html/v4.17/dev-tools/kmemleak.html > > The up to date kernel would be a problem. > The kmemleak log is here: > https://github.com/hardkernel/linux/files/2218589/kmemleak.txt > Sorry that github doesn't do a preview. No Problem, I can see the fcoe leaks (+ others) > > The system itself is an exynos 5422 arm. It worked perfectly fine > with 3.10 as an Initiator, now it leaks memory the moment I > enable the FCoE vlan on the port. > > > I also have a arm v5 running 3.7.1 (intel ss4000e) that works > fine as stable target. > > The arm as initiator was able to crash my D525 as target running > 4.0 on the target just by mounting btrfs. The target now runs 4.3 > and has been a stable target ever since. > > > The main issue seems to be in fcoe_ctlr.c, and that has not > really been touched except by a broomstick for generic kernel > maintenance. > > What I can do is compile a 4.14 and a 4.18 kernel for my main > initiator, a desktop that has an ssd used as bcache on FCoE > drives. That desktop is turned off however due to a heatwave. > The last known working kernel was 3.18 on that system. I will > compile a new one. I'll setup a test environment here and try to reproduce. In the meanwhile I have your report and try to narrow down the leak(s). -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: FCOE vn2vn memory leaks in 4.14
On Thu, Jul 26, 2018 at 03:02:14PM +0200, ard wrote: > Hi Guys, > > I sent this to fcoe-devel but it might be holiday season or the > mailing list is abandoned as the emails concerning fcoe are > pretty low. Yes, the list is defunct as I didn't get admin privileges passed by the old Maintainer when I took over. Anyways, can you please enable the kernel memory leak detector [1] and possibly even try a more up to date (like v4.18-rc6) kernel? [1] https://www.kernel.org/doc/html/v4.17/dev-tools/kmemleak.html Thanks a lot, Johannes > > On Mon, Jul 23, 2018 at 02:16:31PM +0200, ard wrote: > Date: Mon, 23 Jul 2018 14:16:31 +0200 > From: ard > Subject: FCOE vn2vn memory leaks in 4.14 > To: fcoe-de...@open-fcoe.org > > Hi guys, > > After an upgrade of one of my systems from 3.10 to 4.14.55, I > noticed a serious memory leak. > As this kernel is not 100% vanilla, I started the bug report > here: > https://github.com/hardkernel/linux/issues/360 > > The essence is this: > I have an FCoE interface assigned to a vlan on a nic. > These were remnants of a test I did. The FCoE was still > configured, but no targets were exported to that endpoint. > So it would see and join multicast announcements of 2 other > systems, but do nothing with it. > This was good enoug to waste about 600MB of memory in 2 or 3 > days. > Some things have changed, maybe the amount of announcements (due > to the heat I turn of systems), or really something in the > kernel. But after 1 week I really have to pro-actively reboot the > systeme in order to avoid OOM's. > I've now disabled the the FCoE vlan on the port of that system, > so it won't get any broadcasts. > No memory leaks so far. > The kmemleak is in that bug report, I won't mail it, since its > 2.5MB. > The gist seems to be: > backtrace: > [] fcoe_ctlr_vn_add+0x3c/0x1b4 [libfcoe] > [] fcoe_ctlr_vn_recv+0x800/0xb2c [libfcoe] > [] fcoe_ctlr_recv_work+0xb94/0x17f0 [libfcoe] > [] process_one_work+0x138/0x4bc > > These seem to stand out: > root@odroid5:~# grep -c fcoe_ctlr_vn_add kmemleak.txt;grep -c > fcoe_fip_vlan_recv kmemleak.txt > 1090 > 898 > > So there are 2 leaks: network skb leaks I presume and fcoe structure leaks. > Except for one system that I turn off and on once a day, all other systems are > stable running (older kernel though). > > The system I turnn of and on again also has some vn2vn problems and that's > also > a 4.14 kernel. > (steam machine with steamos kernel, fcoe not actively used, but with a bcache > on one of the targets, it probably auto registers a dependency) > This is outside the scope of this ticket though. > > The system with the memory leak is a system intended to run 24/7. > > If anyone can point me to the right place, or help me... > > Regards, > Ard van Breemen > > -- > .signature not found -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH, RESEND] Avoid that SCSI device removal through sysfs triggers a deadlock
>From my limited insight into this: Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 4/4] fcoe: hold disc_mutex when traversing rport lists
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 3/4] libfc: Add WARN_ON() when deleting rports
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 2/4] libfc: hold disc_mutex in fc_disc_stop_rports()
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 1/4] libfc: fixup lockdep annotations
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCHv2] libfc: fixup 'sleeping function called from invalid context'
Acked-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] libfc: Add lockdep annotations
Acked-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] sd_zbc: Remove an assignment from sd_zbc_setup_report_cmnd()
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH v6 7/7] scsi_io_completion convert BUGs to WARNs
On Tue, Jun 26, 2018 at 12:53:32PM +0200, Douglas Gilbert wrote: > The SCSI subsystem may not be the primary storage medium on a system, so > bringing down the system because the SCSI mid-level has an unrecoverable > error may be overkill. Think an embedded system with the rootfs on a > /dev/mmcblkp device with the only "SCSI" device being an external > USB port for a memory key (I was fighting with a 3D printer was just that > config a few days ago). Then the user plugs in the world's worst USB > key (billion of candidates). Isn't one error strategy just to report, > ignore and continue? Exactly and even if SCSI is the primary storage medium BUG_ON()s are just bad, sorry. It's always better to do error recovery then hard crashing a machine as it may be able to write out logs when doing error recovery so one actually has a chance debugging the reasons why it happened. Byte, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] qedi: Fix misleading indentation
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 6/8] mpt3sas: Fix _transport_smp_handler() error path
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 5/8] mpt3sas: Introduce struct mpt3sas_nvme_cmd
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 3/8] mpt3sas: Annotate switch/case fall-through
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 1/8] mpt3sas: Fix indentation
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 2/8] mpt3sas: Remove set-but-not-used variables
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 2/2] qla2xxx: remove irq save in qla2x00_poll()
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 2/3] scsi: be2iscsi: Add warnings for unsupported adapters
On Thu, Jun 07, 2018 at 01:54:42PM +0530, Jitendra Bhivare wrote: > From: Ketan Mukadam > > Add a warning message to indicate obsolete/unsupported > BE3 Adapter Family devices. Ahm no. The upstream Linux kernel doesn't deprecate specific hardware. -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] aacraid: remove bogus GFP_DMA32 specifies
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()
On Thu, May 24, 2018 at 03:38:51PM +0800, Jason Yan wrote: > > > On 2018/5/24 15:15, Sebastian Andrzej Siewior wrote: > > On 2018-05-24 10:58:44 [+0800], Jason Yan wrote: > > > I think it's fine to delete this irq save code. As for the "TODO" > > > comment, I think we can add: > > > > > > BUG_ON(!irqs_disabled()); > > > > > > or > > > > > > WARN_ON_ONCE(!irqs_disabled()); > > > > no, please don't do this. Please add instead > > lockdep_assert_held() > > > > on the lock in question and let lockdep to its work. Lockdep has way > > better coverage than your irqs_disabled() check which also breaks RT. > > > > lockdep_assert_held() cannot detect the irq state, it can only detect > whether we have held the lock. I think Sebastian wanted to say lockdep_assert_irqs_disabled(). Either way, please never ever use BUG_ON() (even WARN_ON() is questionable as some people actually use panic_on_oops). It causes nasty bugs at customer sites. Byte, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 07/14] scsi_transport_fc: complete requests from ->timeout
Looks good, Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 06/14] null_blk: complete requests from ->timeout
Looks good, Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 05/14] mtip32xx: complete requests from ->timeout
Looks good, Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 03/14] nvme: return BLK_EH_DONE from ->timeout
Looks good, Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 02/14] block: rename BLK_EH_NOT_HANDLED to BLK_EH_DONE
Looks good, Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH v2] scsi_transport_srp: Fix shost to rport translation
Looks good, Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] scsi_transport_sas: don't bounce highmem pages for the smp handler
On Sun, Apr 15, 2018 at 04:52:37PM +0200, Christoph Hellwig wrote: > All three instance of ->smp_handler deal with highmem backed requests > just fine. That's my conclusion as well. Looks good, Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] scsi_transport_sas: don't bounce highmem pages for the smp handler
On Fri, Apr 27, 2018 at 07:24:18AM +0200, Christoph Hellwig wrote: > Johannes, > > can you take a look at this? You are one of the few persons who cared > about SMP passthrough in the recent past. I'm sitting at the airport currently, but as soon as I'm back in the office I'll have a look. Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH] scsi_debug: replace SDEG_RES_IMMED_MASK with cmnd flag
On Thu, Apr 19, 2018 at 12:42:28AM -0400, Douglas Gilbert wrote: > This patch uses a cleaner method to convey the presence of the IMMED > cdb bit back to the generic delay code in the scsi_debug driver. The > previous method used a temporary mask over the SCSI result value > (a 32 bit integer soon to be restructured) that was not visible > outside this driver. It has still caused some confusion so a more > conventional method is now used: adding an extra flag to the > scsi_cmnd "host_scribble" area. > > Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> > --- Thanks for having a look into this. Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [VERY EARLY RFC 08/13] treewide: use set_host_byte
On Thu, Apr 19, 2018 at 09:48:56AM +1000, Finn Thain wrote: > Every hunk except the last one looks to be equivalent. Not sure why > the last one is treated differently. That's a bug I'd say. thanks for catching it. > Also, I think using two assignments instead of one is a step backwards. Is > there a better helper for this? Yes I think a set_scsi_result(cmd, 0, DID_*, 0, 0); should be way to go as Hannes said. Byte, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [VERY EARLY RFC 12/13] reewide: introduce clear_scsi_result() and convert drivers
On Thu, Apr 19, 2018 at 08:15:47AM +0200, Hannes Reinecke wrote: > On Wed, 18 Apr 2018 17:01:15 +0200 > Johannes Thumshirn <jthumsh...@suse.de> wrote: > > > Introduce clear_scsi_result() and convert drivers over to use the new > > function. > > > > [ .. ] > > Why not use 'set_scsi_result' here? > Basically everywhere the usage pattern is > > clear_scsi_result() > set_host_byte() > > so they can be collapsed into > > set_scsi_result(cmd, 0, host_byte, 0, 0) > > and this helper can be dropped. Yup, this sounds like a good idea. -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [VERY EARLY RFC 00/13] Rework SCSI results handling
On Wed, Apr 18, 2018 at 04:00:43PM +, Bart Van Assche wrote: > Thank you for having come up with this so quickly. Something I do not > like about this patch series is that several new very short helper functions > are introduced, e.g. set_scsi_result(), clear_scsi_result(), to_scsi_result() > and from_scsi_result(). If we would make scsi_result a union of a 32-bit > integer and a struct with the driver, host, msg and status bytes then we > would not need any of these new helper functions. Additionally, that approach > would allow us to eliminate the {set,get}_{driver,host,msg,status}_byte() > functions. Honestly I don't really like these mini accessor functions as well. But when using a union we loose all the benefits of the enums as drivers still can touch the compound result value. I like Hannes' idea of gettting rid of clear_scsi_result() and use set_scsi_result() for it. This way we zap one of these helpers. Actually we could even use it for all and thus could eliminate all the set_{host,driver,msg}_byte() accessors. Thanks, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
[VERY EARLY RFC 10/13] scsi: introduce set_status_byte and convert LLDDs to use it
@@ struct scsi_cmnd *c; expression E1; @@ ( -c->result |= E1; +set_status_byte(c, E1); | -c->result |= (E1); +set_status_byte(c, E1); ) Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/ata/libata-scsi.c| 20 drivers/infiniband/ulp/srp/ib_srp.c | 2 +- drivers/message/fusion/mptscsih.c| 4 ++-- drivers/s390/scsi/zfcp_fc.h | 2 +- drivers/s390/scsi/zfcp_scsi.c| 2 +- drivers/scsi/3w-9xxx.c | 3 ++- drivers/scsi/3w-sas.c| 4 +++- drivers/scsi/aacraid/aachba.c| 6 ++--- drivers/scsi/advansys.c | 7 ++ drivers/scsi/aic7xxx/aic79xx_osm.h | 2 +- drivers/scsi/aic7xxx/aic7xxx_osm.h | 2 +- drivers/scsi/atp870u.c | 7 +++--- drivers/scsi/dpt_i2o.c | 2 +- drivers/scsi/hpsa.c | 4 ++-- drivers/scsi/hptiop.c| 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- drivers/scsi/ipr.c | 6 ++--- drivers/scsi/libfc/fc_fcp.c | 2 +- drivers/scsi/libsas/sas_ata.c| 5 ++-- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/megaraid.c | 13 +++ drivers/scsi/megaraid/megaraid_mbox.c| 4 ++-- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 12 ++ drivers/scsi/mvsas/mv_sas.c | 2 +- drivers/scsi/mvumi.c | 2 +- drivers/scsi/pm8001/pm8001_sas.c | 5 ++-- drivers/scsi/pmcraid.c | 4 ++-- drivers/scsi/qla1280.c | 2 +- drivers/scsi/qla2xxx/qla_isr.c | 6 ++--- drivers/scsi/scsi_error.c| 40 drivers/scsi/smartpqi/smartpqi_init.c| 6 ++--- drivers/scsi/storvsc_drv.c | 2 +- drivers/scsi/virtio_scsi.c | 2 +- drivers/staging/rts5208/rtsx_transport.c | 4 ++-- drivers/target/loopback/tcm_loop.c | 6 ++--- drivers/usb/image/microtek.c | 5 ++-- drivers/usb/storage/datafab.c| 4 ++-- drivers/usb/storage/isd200.c | 22 +- drivers/usb/storage/jumpshot.c | 4 ++-- drivers/usb/storage/realtek_cr.c | 12 ++ drivers/usb/storage/transport.c | 17 +++--- drivers/usb/storage/uas.c| 4 ++-- drivers/usb/storage/usb.c| 2 +- include/scsi/scsi.h | 6 - include/scsi/scsi_cmnd.h | 6 + include/scsi/scsi_proto.h| 25 ++-- 46 files changed, 163 insertions(+), 140 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index cedf4b70f06f..0d6547351d85 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1550,7 +1550,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) ata_scsi_set_invalid_field(qc->dev, scmd, fp, bp); return 1; skip: - scmd->result = SAM_STAT_GOOD; + set_status_byte(scmd, SAM_STAT_GOOD); return 1; } @@ -1801,7 +1801,7 @@ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc) return 1; nothing_to_do: - scmd->result = SAM_STAT_GOOD; + set_status_byte(scmd, SAM_STAT_GOOD); return 1; } @@ -1913,7 +1913,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) return 1; nothing_to_do: - scmd->result = SAM_STAT_GOOD; + set_status_byte(scmd, SAM_STAT_GOOD); return 1; } @@ -1946,11 +1946,11 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) ((cdb[2] & 0x20) || need_sense)) ata_gen_passthru_sense(qc); else if (qc->flags & ATA_QCFLAG_SENSE_VALID) - cmd->result = SAM_STAT_CHECK_CONDITION; + set_status_byte(cmd, SAM_STAT_CHECK_CONDITION); else if (need_sense) ata_gen_ata_sense(qc); else - cmd->result = SAM_STAT_GOOD; + set_status_byte(cmd, SAM_STAT_GOOD); if (need_sense && !ap->ops->error_handler) ata_dump_status(ap->print_id, >result_tf); @@ -2131,7 +2131,7 @@ static void ata_scsi_rbuf_fill(struct ata_scsi_args *args, ata_scsi_rbuf_put(cmd, rc == 0, ); if (rc == 0) - cmd->result = SAM_STAT_GOOD; + set_status_byte(cmd, SAM_STAT_GOOD); } /** @@ -2910,14 +2910,14 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev) qc->dev->sdev->locked = 0; - qc->scsicmd->result = SAM_STAT_CHECK_CONDITION; + set_status_byte(qc->scsicmd, SAM_STAT_CHECK_CONDITION);
[VERY EARLY RFC 06/13] scsi: introduce set_scsi_result
Introduce set_scsi_result() for setting the bytes of the scsi_cmnd's result filed and flip over all users that set at least two bytes to using it. The conversion has been done using the following coccinelle spatch: @@ struct scsi_cmnd *c; expression E1, E2, E3, E4; @@ ( - c->result = E1 << 24 | E2 << 16 | E3 << 8 | E4; + set_scsi_result(c, E1, E2, E3, E4); | - c->result = E1 << 24 | E2 << 16 | E3 << 8; + set_scsi_result(c, E1, E2, E3, 0); | - c->result = E2 << 16 | E3 << 8 | E4; + set_scsi_result(c, 0, E2, E3, E4); | - c->result = E2 << 16 | E3 << 8; + set_scsi_result(c, 0, E2, E3, 0); | - c->result = (E2 << 16) | E4; + set_scsi_result(c, 0, E2, 0, E4); | - c->result = (E2 << 16) | (E4); + set_scsi_result(c, 0, E2, 0, E4); ) @@ struct scsi_cmnd *c; expression E1, E2; identifier ScsiResult; @@ -c->result = ScsiResult(E1, E2); +set_scsi_result(c, 0, E1, 0, E2); @@ identifier ScsiResult, host_code,scsi_code; @@ ( -#define ScsiResult(host_code, scsi_code) (((host_code) << 16) | scsi_code) | -#define ScsiResult(host_code, scsi_code) (((host_code) << 16) + ((scsi_code) & 0x7f)) ) Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/ata/libata-scsi.c | 8 +- drivers/infiniband/ulp/srp/ib_srp.c | 7 +- drivers/message/fusion/mptscsih.c | 6 +- drivers/scsi/3w-9xxx.c | 3 +- drivers/scsi/3w-.c | 9 +- drivers/scsi/NCR5380.c | 6 +- drivers/scsi/a100u2w.c | 2 +- drivers/scsi/aacraid/aachba.c | 200 +++- drivers/scsi/aacraid/commsup.c | 5 +- drivers/scsi/advansys.c | 26 ++-- drivers/scsi/arcmsr/arcmsr_hba.c| 5 +- drivers/scsi/arm/acornscsi.c| 3 +- drivers/scsi/arm/fas216.c | 4 +- drivers/scsi/be2iscsi/be_main.c | 2 +- drivers/scsi/bfa/bfad_im.c | 16 +-- drivers/scsi/bfa/bfad_im.h | 1 - drivers/scsi/bnx2fc/bnx2fc_io.c | 6 +- drivers/scsi/csiostor/csio_scsi.c | 4 +- drivers/scsi/cxlflash/main.c| 3 +- drivers/scsi/dc395x.c | 23 ++-- drivers/scsi/dpt_i2o.c | 4 +- drivers/scsi/esas2r/esas2r_main.c | 7 +- drivers/scsi/esp_scsi.c | 7 +- drivers/scsi/fnic/fnic_scsi.c | 22 +-- drivers/scsi/gdth.c | 17 ++- drivers/scsi/hptiop.c | 2 +- drivers/scsi/imm.c | 2 +- drivers/scsi/initio.c | 2 +- drivers/scsi/ips.c | 5 +- drivers/scsi/libfc/fc_fcp.c | 9 +- drivers/scsi/libiscsi.c | 18 ++- drivers/scsi/libsas/sas_scsi_host.c | 2 +- drivers/scsi/lpfc/lpfc_crtn.h | 1 - drivers/scsi/lpfc/lpfc_scsi.c | 51 +++ drivers/scsi/megaraid.c | 10 +- drivers/scsi/megaraid/megaraid_mbox.c | 23 ++-- drivers/scsi/megaraid/megaraid_sas_base.c | 7 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 +- drivers/scsi/mesh.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c| 14 +- drivers/scsi/mvumi.c| 6 +- drivers/scsi/ncr53c8xx.c| 24 ++-- drivers/scsi/nsp32.c| 5 +- drivers/scsi/pcmcia/nsp_cs.c| 12 +- drivers/scsi/pcmcia/sym53c500_cs.c | 4 +- drivers/scsi/ppa.c | 3 +- drivers/scsi/ps3rom.c | 3 +- drivers/scsi/qedf/qedf_io.c | 12 +- drivers/scsi/qla4xxx/ql4_isr.c | 8 +- drivers/scsi/snic/snic_scsi.c | 4 +- drivers/scsi/stex.c | 17 ++- drivers/scsi/sym53c8xx_2/sym_glue.c | 2 +- drivers/scsi/sym53c8xx_2/sym_glue.h | 2 +- drivers/scsi/vmw_pvscsi.c | 2 +- drivers/scsi/wd33c93.c | 17 ++- drivers/usb/storage/cypress_atacb.c | 5 +- include/scsi/scsi_cmnd.h| 8 ++ 57 files changed, 360 insertions(+), 322 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 89a9d4a2efc8..f34650ada9d7 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -357,7 +357,7 @@ void ata_scsi_set_sense(struct ata_device *dev, struct scsi_cmnd *cmd, if (!cmd) return; - cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + set_scsi_result(cmd, DRIVER_SENSE, 0, 0, SAM_STAT_CHECK_CONDITION); scsi_build_sense_buffer(d_sense, cmd->sense_buffer, sk, asc, ascq); }
[VERY EARLY RFC 13/13] scsi: introduce struct scsi_result
Introduce struct scsi_result. Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> Suggested-by: Bart Van Assche <bart.vanass...@wdc.com> --- block/bsg-lib.c | 8 -- block/bsg.c | 8 -- block/scsi_ioctl.c | 12 drivers/ata/libata-scsi.c | 12 +--- drivers/firewire/sbp2.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 11 drivers/message/fusion/mptfc.c | 2 +- drivers/message/fusion/mptscsih.c | 10 --- drivers/scsi/BusLogic.c | 4 +-- drivers/scsi/NCR5380.c | 2 +- drivers/scsi/aha152x.c | 2 +- drivers/scsi/bfa/bfad_im.c | 10 +++ drivers/scsi/bnx2fc/bnx2fc_io.c | 2 +- drivers/scsi/ch.c | 2 +- drivers/scsi/constants.c| 4 +-- drivers/scsi/csiostor/csio_scsi.c | 2 +- drivers/scsi/dc395x.c | 11 drivers/scsi/device_handler/scsi_dh_alua.c | 10 +-- drivers/scsi/dpt_i2o.c | 2 +- drivers/scsi/esp_scsi.c | 2 +- drivers/scsi/fnic/fnic_scsi.c | 2 +- drivers/scsi/hpsa.c | 2 +- drivers/scsi/libfc/fc_fcp.c | 2 +- drivers/scsi/libiscsi.c | 6 ++-- drivers/scsi/lpfc/lpfc_scsi.c | 19 +++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 6 ++-- drivers/scsi/mpt3sas/mpt3sas_scsih.c| 6 ++-- drivers/scsi/osst.c | 3 +- drivers/scsi/pmcraid.c | 4 +-- drivers/scsi/qedf/qedf_io.c | 8 +++--- drivers/scsi/qedi/qedi_fw.c | 2 +- drivers/scsi/qla1280.c | 4 +-- drivers/scsi/qla2xxx/qla_isr.c | 6 ++-- drivers/scsi/qla2xxx/qla_mr.c | 4 +-- drivers/scsi/qla2xxx/qla_os.c | 8 +++--- drivers/scsi/qla4xxx/ql4_os.c | 10 --- drivers/scsi/qlogicfas408.c | 2 +- drivers/scsi/scsi.c | 5 ++-- drivers/scsi/scsi_debug.c | 23 +-- drivers/scsi/scsi_debugfs.c | 2 +- drivers/scsi/scsi_error.c | 12 drivers/scsi/scsi_ioctl.c | 2 +- drivers/scsi/scsi_lib.c | 21 -- drivers/scsi/scsi_logging.c | 5 ++-- drivers/scsi/scsi_scan.c| 2 +- drivers/scsi/scsi_transport_spi.c | 2 +- drivers/scsi/sd.c | 22 +++ drivers/scsi/sd_zbc.c | 4 +-- drivers/scsi/sg.c | 10 +++ drivers/scsi/snic/snic_scsi.c | 2 +- drivers/scsi/sr.c | 4 +-- drivers/scsi/sr_ioctl.c | 2 +- drivers/scsi/st.c | 2 +- drivers/scsi/stex.c | 2 +- drivers/scsi/storvsc_drv.c | 2 +- drivers/scsi/sym53c8xx_2/sym_glue.h | 1 - drivers/scsi/ufs/ufshcd.c | 6 ++-- drivers/scsi/vmw_pvscsi.c | 3 +- drivers/scsi/xen-scsifront.c| 2 +- drivers/staging/unisys/visorhba/visorhba_main.c | 4 +-- drivers/target/target_core_pscsi.c | 12 +--- drivers/usb/image/microtek.c| 11 +--- drivers/usb/storage/cypress_atacb.c | 8 +++--- drivers/usb/storage/transport.c | 3 +- drivers/usb/storage/uas.c | 2 +- drivers/usb/storage/usb.c | 4 +-- drivers/xen/xen-scsiback.c | 6 ++-- include/scsi/scsi.h | 37 +++-- include/scsi/scsi_cmnd.h| 18 +++- include/trace/events/scsi.h | 2 +- 70 files changed, 262 insertions(+), 193 deletions(-) diff --git a/block/bsg-lib.c b/block/bsg-lib.c index fc2e5ff2c4b9..6231cf710b8d 100644 --- a/block/bsg-lib.c +++ b/block/bsg-lib.c @@ -57,14 +57,16 @@ static int bsg_transport_complete_rq(struct request *rq, struct sg_io_v4 *hdr) { struct bsg_job *job = blk_mq_rq_to_pdu(rq); int ret = 0; + struct scsi_result sres = { 0 }; /* * The assignments below don't make much sense, but are kept for * bug by bug backwards compatibility: */ - hdr->device_status = job->result & 0xff; - hdr->transport_status = host_byte(
[VERY EARLY RFC 05/13] scsi: add enum for message byte codes
Add enum for message byte codes and adopt set_msg_byte()'s signature. Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> Suggested-by: Bart Van Assche <bart.vanass...@wdc.com> --- include/scsi/scsi.h | 79 +--- include/scsi/scsi_cmnd.h | 3 +- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 2694faafaddf..f51320dfac9b 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -92,42 +92,43 @@ static inline int scsi_is_wlun(u64 lun) /* * MESSAGE CODES */ - -#define COMMAND_COMPLETE0x00 -#define EXTENDED_MESSAGE0x01 -#define EXTENDED_MODIFY_DATA_POINTER0x00 -#define EXTENDED_SDTR 0x01 -#define EXTENDED_EXTENDED_IDENTIFY 0x02/* SCSI-I only */ -#define EXTENDED_WDTR 0x03 -#define EXTENDED_PPR0x04 -#define EXTENDED_MODIFY_BIDI_DATA_PTR 0x05 -#define SAVE_POINTERS 0x02 -#define RESTORE_POINTERS0x03 -#define DISCONNECT 0x04 -#define INITIATOR_ERROR 0x05 -#define ABORT_TASK_SET 0x06 -#define MESSAGE_REJECT 0x07 -#define NOP 0x08 -#define MSG_PARITY_ERROR0x09 -#define LINKED_CMD_COMPLETE 0x0a -#define LINKED_FLG_CMD_COMPLETE 0x0b -#define TARGET_RESET0x0c -#define ABORT_TASK 0x0d -#define CLEAR_TASK_SET 0x0e -#define INITIATE_RECOVERY 0x0f/* SCSI-II only */ -#define RELEASE_RECOVERY0x10/* SCSI-II only */ -#define CLEAR_ACA 0x16 -#define LOGICAL_UNIT_RESET 0x17 -#define SIMPLE_QUEUE_TAG0x20 -#define HEAD_OF_QUEUE_TAG 0x21 -#define ORDERED_QUEUE_TAG 0x22 -#define IGNORE_WIDE_RESIDUE 0x23 -#define ACA 0x24 -#define QAS_REQUEST 0x55 - -/* Old SCSI2 names, don't use in new code */ -#define BUS_DEVICE_RESETTARGET_RESET -#define ABORT ABORT_TASK_SET +enum scsi_msg_byte { + COMMAND_COMPLETE = 0x00, + EXTENDED_MESSAGE = 0x01, + EXTENDED_MODIFY_DATA_POINTER = 0x00, + EXTENDED_SDTR = 0x01, + EXTENDED_EXTENDED_IDENTIFY = 0x02, /* SCSI-I only */ + EXTENDED_WDTR = 0x03, + EXTENDED_PPR = 0x04, + EXTENDED_MODIFY_BIDI_DATA_PTR = 0x05, + SAVE_POINTERS = 0x02, + RESTORE_POINTERS = 0x03, + DISCONNECT = 0x04, + INITIATOR_ERROR = 0x05, + ABORT_TASK_SET = 0x06, + MESSAGE_REJECT = 0x07, + NOP = 0x08, + MSG_PARITY_ERROR = 0x09, + LINKED_CMD_COMPLETE = 0x0a, + LINKED_FLG_CMD_COMPLETE = 0x0b, + TARGET_RESET = 0x0c, + ABORT_TASK = 0x0d, + CLEAR_TASK_SET = 0x0e, + INITIATE_RECOVERY = 0x0f,/* SCSI-II only */ + RELEASE_RECOVERY = 0x10, /* SCSI-II only */ + CLEAR_ACA = 0x16, + LOGICAL_UNIT_RESET = 0x17, + SIMPLE_QUEUE_TAG = 0x20, + HEAD_OF_QUEUE_TAG = 0x21, + ORDERED_QUEUE_TAG = 0x22, + IGNORE_WIDE_RESIDUE = 0x23, + ACA = 0x24, + QAS_REQUEST = 0x55, + + /* Old SCSI2 names, don't use in new code */ + BUS_DEVICE_RESET = TARGET_RESET, + ABORT = ABORT_TASK_SET, +}; /* * Host byte codes @@ -213,7 +214,11 @@ enum scsi_driver_byte { * driver_byte = set by mid-level. */ #define status_byte(result) (((result) >> 1) & 0x7f) -#define msg_byte(result)(((result) >> 8) & 0xff) +static inline enum scsi_msg_byte msg_byte(int result) +{ + return (result >> 8) & 0xff; +} + static inline enum scsi_host_byte host_byte(int result) { return (result >> 16) & 0xff; diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index da8ea89ccc0a..45d20d4a8f72 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -337,7 +337,8 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd) #define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \ for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i) -static inline void set_msg_byte(struct scsi_cmnd *cmd, char status) +static inline void set_msg_byte(struct scsi_cmnd *cmd, + enum scsi_msg_byte status) { cmd->result = (cmd->result & 0x00ff) | (status << 8); } -- 2.16.3
[VERY EARLY RFC 11/13] scsi: Change status bytes to use SAM-3 version
Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/ata/libata-scsi.c | 2 +- drivers/scsi/3w-9xxx.c| 2 +- drivers/scsi/3w-.c| 6 -- drivers/scsi/arcmsr/arcmsr_hba.c | 4 ++-- drivers/scsi/dc395x.c | 4 ++-- drivers/scsi/dpt_i2o.c| 3 ++- drivers/scsi/gdth.c | 12 ++-- drivers/scsi/megaraid.c | 10 +- drivers/scsi/megaraid/megaraid_mbox.c | 13 +++-- 9 files changed, 30 insertions(+), 26 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 0d6547351d85..96cd5c838c89 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -873,7 +873,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, qc->sg = scsi_sglist(cmd); qc->n_elem = scsi_sg_count(cmd); } else { - set_scsi_result(cmd, 0, DID_OK, 0, (QUEUE_FULL << 1)); + set_scsi_result(cmd, 0, DID_OK, 0, SAM_STAT_TASK_SET_FULL); cmd->scsi_done(cmd); } diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index ccdf7b08d117..7da983720550 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -1336,7 +1336,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) if (error == 1) { /* Ask for a host reset */ set_scsi_result(cmd, 0, DID_OK, 0, - (CHECK_CONDITION << 1)); + SAM_STAT_CHECK_CONDITION); } /* Report residual bytes for single sgl */ diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c index da3c0ff13dac..ea259daf3089 100644 --- a/drivers/scsi/3w-.c +++ b/drivers/scsi/3w-.c @@ -431,7 +431,7 @@ static int tw_decode_sense(TW_Device_Extension *tw_dev, int request_id, int fill set_scsi_result(tw_dev->srb[request_id], 0, DID_OK, 0, - (CHECK_CONDITION << 1)); + SAM_STAT_CHECK_CONDITION); return TW_ISR_DONT_RESULT; /* Special case for isr to not over-write result */ } } @@ -2163,7 +2163,9 @@ static irqreturn_t tw_interrupt(int irq, void *dev_instance) /* If error, command failed */ if (error == 1) { /* Ask for a host reset */ - set_scsi_result(tw_dev->srb[request_id], 0, DID_OK, 0, CHECK_CONDITION << 1); + set_scsi_result(tw_dev->srb[request_id], + 0, DID_OK, 0, + SAM_STAT_CHECK_CONDITION); } /* Now complete the io */ diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 426d14c0104e..bea71f085679 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1202,7 +1202,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb) struct scsi_cmnd *pcmd = ccb->pcmd; struct SENSE_DATA *sensebuffer = (struct SENSE_DATA *)pcmd->sense_buffer; - set_scsi_result(pcmd, 0, DID_OK, 0, (CHECK_CONDITION << 1)); + set_scsi_result(pcmd, 0, DID_OK, 0, SAM_STAT_CHECK_CONDITION); if (sensebuffer) { int sense_data_length = sizeof(struct SENSE_DATA) < SCSI_SENSE_BUFFERSIZE @@ -3030,7 +3030,7 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, return SCSI_MLQUEUE_HOST_BUSY; if (arcmsr_build_ccb( acb, ccb, cmd ) == FAILED) { set_scsi_result(cmd, 0, DID_ERROR, 0, - (RESERVATION_CONFLICT << 1)); + SAM_STAT_RESERVATION_CONFLICT); cmd->scsi_done(cmd); return 0; } diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index eebae800131d..89995bb09a94 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -3329,7 +3329,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, */ srb->flag &= ~AUTO_REQSENSE; srb->adapter_status = 0; - srb->target_status = CHECK_CONDITION << 1; +
[VERY EARLY RFC 03/13] scsi: add enum for host byte codes
Add enum for host byte codes and adopt set_host_byte()'s and host_byte()'s signature. Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> Suggested-by: Bart Van Assche <bart.vanass...@wdc.com> --- drivers/scsi/dc395x.c | 3 +-- drivers/scsi/megaraid.c | 6 -- drivers/scsi/scsi_error.c | 2 ++ include/scsi/scsi.h | 55 ++- include/scsi/scsi_cmnd.h | 3 ++- 5 files changed, 39 insertions(+), 30 deletions(-) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index da28f08ae185..379a1bc37576 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -173,7 +173,6 @@ #define SET_RES_TARGET(who,tgt) { who &= ~RES_TARGET; who |= (int)(tgt); } #define SET_RES_TARGET_LNX(who,tgt) { who &= ~RES_TARGET_LNX; who |= (int)(tgt) << 1; } #define SET_RES_MSG(who,msg) { who &= ~RES_ENDMSG; who |= (int)(msg) << 8; } -#define SET_RES_DID(who,did) { who &= ~RES_DID; who |= (int)(did) << 16; } #define SET_RES_DRV(who,drv) { who &= ~RES_DRV; who |= (int)(drv) << 24; } #define TAG_NONE 255 @@ -3443,7 +3442,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, srb->adapter_status = 0; srb->target_status = 0; - SET_RES_DID(cmd->result, DID_OK); + set_host_byte(cmd, DID_OK); } } diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 4d769db4435a..284bc8c4c6d5 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1473,7 +1473,8 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) "aborted cmd [%x] complete\n", scb->idx); - scb->cmd->result = (DID_ABORT << 16); + scb->cmd->result = 0; + set_host_byte(scb->cmd, DID_ABORT); list_add_tail(SCSI_LIST(scb->cmd), >completed_list); @@ -1492,7 +1493,8 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) "reset cmd [%x] complete\n", scb->idx); - scb->cmd->result = (DID_RESET << 16); + scb->cmd->result = 0; + set_host_byte(scb->cmd, DID_RESET); list_add_tail(SCSI_LIST(scb->cmd), >completed_list); diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 946039117bf4..7e80f457367e 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1699,6 +1699,8 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) /* fall through */ case DID_SOFT_ERROR: return (scmd->request->cmd_flags & REQ_FAILFAST_DRIVER); + default: + break; } if (status_byte(scmd->result) != CHECK_CONDITION) diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index eb7853c1a23b..4dfc5e11a5b2 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -132,33 +132,35 @@ static inline int scsi_is_wlun(u64 lun) /* * Host byte codes */ - -#define DID_OK 0x00 /* NO error*/ -#define DID_NO_CONNECT 0x01 /* Couldn't connect before timeout period */ -#define DID_BUS_BUSY0x02 /* BUS stayed busy through time out period */ -#define DID_TIME_OUT0x03 /* TIMED OUT for other reason */ -#define DID_BAD_TARGET 0x04 /* BAD target. */ -#define DID_ABORT 0x05 /* Told to abort for some other reason */ -#define DID_PARITY 0x06 /* Parity error*/ -#define DID_ERROR 0x07 /* Internal error */ -#define DID_RESET 0x08 /* Reset by somebody. */ -#define DID_BAD_INTR0x09 /* Got an interrupt we weren't expecting. */ -#define DID_PASSTHROUGH 0x0a /* Force command past mid-layer*/ -#define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */ -#define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ -#define DID_REQUEUE0x0d/* Requeue command (no immediate retry) also +enum scsi_host_byte { + DID_OK, /* NO error*/ + DID_NO_CONNECT, /* Couldn't connect before timeout period */ + DID_BUS_BUSY, /* BUS stayed busy through time out period */ + DID_TIME_OUT, /* TIMED OUT for other reason */ + DID_BAD_
[VERY EARLY RFC 02/13] scsi: remove Scsi_Cmnd typedef
This will make subsequent refactoring easier to handle. @rem_Scsi_Cmnd@ @@ - typedef struct scsi_cmnd Scsi_Cmnd; @fix_Scsi_Cmnd@ typedef Scsi_Cmnd; @@ -Scsi_Cmnd +struct scsi_cmnd @fix_sizeof_Scsi_Cmnd@ @@ -sizeof(Scsi_Cmnd) +sizeof(struct scsi_cmnd) Note: this patch is nowhere checkpatch clean. Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/3w-.c | 2 +- drivers/scsi/advansys.c | 2 +- drivers/scsi/aha152x.c | 71 +--- drivers/scsi/aha1740.c | 9 ++--- drivers/scsi/aha1740.h | 4 +-- drivers/scsi/gdth.c | 67 +++-- drivers/scsi/gdth.h | 10 +++--- drivers/scsi/gdth_proc.c | 2 +- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- drivers/scsi/libiscsi_tcp.c | 2 +- drivers/scsi/megaraid.c | 29 drivers/scsi/megaraid.h | 14 drivers/scsi/nsp32_debug.c | 2 +- drivers/scsi/scsi.h | 3 -- drivers/scsi/scsi_typedefs.h | 2 -- 16 files changed, 114 insertions(+), 109 deletions(-) delete mode 100644 drivers/scsi/scsi_typedefs.h diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c index 33261b690774..2a9a1326023b 100644 --- a/drivers/scsi/3w-.c +++ b/drivers/scsi/3w-.c @@ -1922,7 +1922,7 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c if (test_bit(TW_IN_RESET, _dev->flags)) return SCSI_MLQUEUE_HOST_BUSY; - /* Save done function into Scsi_Cmnd struct */ + /* Save done function into struct scsi_cmnd struct */ SCpnt->scsi_done = done; /* Queue the command and get a request id */ diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 24e57e770432..c9a52905070e 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -8466,7 +8466,7 @@ static int AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, adv_req_t *reqp) } /* - * Execute a single 'Scsi_Cmnd'. + * Execute a single 'struct scsi_cmnd'. */ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) { diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index bc0058df31c6..4d7b0e0adbf7 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -422,16 +422,16 @@ enum aha152x_state { * */ struct aha152x_hostdata { - Scsi_Cmnd *issue_SC; + struct scsi_cmnd *issue_SC; /* pending commands to issue */ - Scsi_Cmnd *current_SC; + struct scsi_cmnd *current_SC; /* current command on the bus */ - Scsi_Cmnd *disconnected_SC; + struct scsi_cmnd *disconnected_SC; /* commands that disconnected */ - Scsi_Cmnd *done_SC; + struct scsi_cmnd *done_SC; /* command that was completed */ spinlock_t lock; @@ -510,7 +510,7 @@ struct aha152x_hostdata { * */ struct aha152x_scdata { - Scsi_Cmnd *next;/* next sc in queue */ + struct scsi_cmnd *next; /* next sc in queue */ struct completion *done;/* semaphore to block on */ struct scsi_eh_save ses; }; @@ -633,7 +633,7 @@ static void aha152x_error(struct Scsi_Host *shpnt, char *msg); static void done(struct Scsi_Host *shpnt, int error); /* diagnostics */ -static void show_command(Scsi_Cmnd * ptr); +static void show_command(struct scsi_cmnd * ptr); static void show_queues(struct Scsi_Host *shpnt); static void disp_enintr(struct Scsi_Host *shpnt); @@ -642,9 +642,9 @@ static void disp_enintr(struct Scsi_Host *shpnt); * queue services: * */ -static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC) +static inline void append_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC) { - Scsi_Cmnd *end; + struct scsi_cmnd *end; SCNEXT(new_SC) = NULL; if (!*SC) @@ -656,9 +656,9 @@ static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC) } } -static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC) +static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd ** SC) { - Scsi_Cmnd *ptr; + struct scsi_cmnd *ptr; ptr = *SC; if (ptr) { @@ -668,9 +668,10 @@ static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC) return ptr; } -static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int target, int lun) +static inline struct scsi_cmnd *remove_lun_SC(struct scsi_cmnd ** SC, + int target, int lun) { - Scsi_Cmnd *ptr, *prev; + struct scsi_cmnd *ptr, *prev; for (ptr = *SC, prev = NULL; ptr && ((ptr->device->id != target) || (ptr->device->lun != lun)); @@ -689,9 +690,10 @@ static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int target, int lun) return ptr; } -static inline Scsi_Cmnd *remove_S
[VERY EARLY RFC 07/13] scsi: use set_driver_byte
@@ struct scsi_cmnd *c; expression E1, E2; @@ ( - c->result = E1 << 24 | E2; + c->result = 0; + set_driver_byte(c, E1); + c->result |= E2; | - c->result |= E1 << 24 | E2; + set_driver_byte(c, E1); + c->result |= E2; | - c->result = E1 << 24; + c->result = 0; + set_driver_byte(c, E1); | - c->result |= E1 << 24; + set_driver_byte(c, E1); ) Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/ata/libata-scsi.c | 2 +- drivers/scsi/advansys.c | 1 - drivers/scsi/aic7xxx/aic79xx_osm.c | 2 +- drivers/scsi/aic7xxx/aic7xxx_osm.c | 2 +- drivers/scsi/arcmsr/arcmsr_hba.c| 2 +- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +- drivers/scsi/mvumi.c| 5 +++-- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi_error.c | 2 +- drivers/scsi/vmw_pvscsi.c | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index f34650ada9d7..f019de473a97 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -4475,7 +4475,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd) case REQUEST_SENSE: ata_scsi_set_sense(dev, cmd, 0, 0, 0); - cmd->result = (DRIVER_SENSE << 24); + set_driver_byte(cmd, DRIVER_SENSE); break; /* if we reach this, then writeback caching is disabled, diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 0f93fe6c58b0..0e3f464e011d 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -2093,7 +2093,6 @@ do { \ #define STATUS_BYTE(byte) (byte) #define MSG_BYTE(byte) ((byte) << 8) #define HOST_BYTE(byte) ((byte) << 16) -#define DRIVER_BYTE(byte) ((byte) << 24) #define ASC_STATS(shost, counter) ASC_STATS_ADD(shost, counter, 1) #ifndef ADVANSYS_STATS diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 2588b8f84ba0..af748242cdb3 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1941,7 +1941,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, memcpy(cmd->sense_buffer, ahd_get_sense_buf(ahd, scb) + sense_offset, sense_size); - cmd->result |= (DRIVER_SENSE << 24); + set_driver_byte(cmd, DRIVER_SENSE); #ifdef AHD_DEBUG if (ahd_debug & AHD_SHOW_SENSE) { diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index c6be3aeb302b..ac204238b5c1 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -1856,7 +1856,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, if (sense_size < SCSI_SENSE_BUFFERSIZE) memset(>sense_buffer[sense_size], 0, SCSI_SENSE_BUFFERSIZE - sense_size); - cmd->result |= (DRIVER_SENSE << 24); + set_driver_byte(cmd, DRIVER_SENSE); #ifdef AHC_DEBUG if (ahc_debug & AHC_SHOW_SENSE) { int i; diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index a99d44d36e5f..9fd87860ef63 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1211,7 +1211,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb) memcpy(sensebuffer, ccb->arcmsr_cdb.SenseData, sense_data_length); sensebuffer->ErrorCode = SCSI_SENSE_CURRENT_ERRORS; sensebuffer->Valid = 1; - pcmd->result |= (DRIVER_SENSE << 24); + set_driver_byte(pcmd, DRIVER_SENSE); } } diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 9c3dec24b6bf..6861e8d1aea5 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -3309,7 +3309,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, memcpy(cmd->scmd->sense_buffer, cmd->sense, hdr->sense_len); - cmd->scmd->result |= DRIVER_SENSE << 24; + set_driver_byte(cmd->scmd, DRIVER_SENSE); } break; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 8c5757d5770a..5ffeb21872f3 1006
[VERY EARLY RFC 00/13] Rework SCSI results handling
Hey all, here's a early preview of my SCSI results rework so we can eventually discuss things next week at LSF/MM (it still has compiler errors on aic7xxx and scsi_debug). The motivation behing this is that some drivers have failed to set the scsi_cmnd::result bytes correctly in the past and this is resulting in hard to case down errors. The open points: 1) 148 files changed, treewide. That's huge. Is it worth it? 2) remove the old status byte definitions 3) add a scsi_cmnd::result == 0 wrapper 3) convert aic7xx's CAM stuff so this series compiles cleanly 4) What the heck is the SDEG_RES_IMMED_MASK stuff in scsi_debug doing 5) change scsi_execute() so we get a newish 'struct scsi_results' instead of an int 6) {to,from}_scsi_result() are odd 7) find suitable commit messages In case someone want's it in a more viewable form I've pushed the series to my kernel.org git: https://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git/log/?h=scsi-results Johannes Thumshirn (13): scsi: use host_byte() accessor scsi: remove Scsi_Cmnd typedef scsi: add enum for host byte codes scsi: add enum for driver byte codes scsi: add enum for message byte codes scsi: introduce set_scsi_result scsi: use set_driver_byte treewide: use set_host_byte scsi: use set_msg_byte scsi: introduce set_status_byte and convert LLDDs to use it scsi: Change status bytes to use SAM-3 version reewide: introduce clear_scsi_result() and convert drivers scsi: introduce struct scsi_result arch/ia64/hp/sim/simscsi.c | 6 +- block/bsg-lib.c | 8 +- block/bsg.c | 8 +- block/scsi_ioctl.c | 12 +- drivers/ata/libata-scsi.c | 54 +++--- drivers/firewire/sbp2.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 23 ++- drivers/message/fusion/mptfc.c | 8 +- drivers/message/fusion/mptsas.c | 3 +- drivers/message/fusion/mptscsih.c | 122 - drivers/message/fusion/mptspi.c | 6 +- drivers/s390/scsi/zfcp_fc.h | 2 +- drivers/s390/scsi/zfcp_scsi.c | 4 +- drivers/scsi/3w-9xxx.c | 18 +- drivers/scsi/3w-sas.c | 16 +- drivers/scsi/3w-.c | 36 ++-- drivers/scsi/53c700.c | 3 +- drivers/scsi/BusLogic.c | 24 ++- drivers/scsi/NCR5380.c | 39 +++-- drivers/scsi/a100u2w.c | 2 +- drivers/scsi/aacraid/aachba.c | 221 +--- drivers/scsi/aacraid/commsup.c | 5 +- drivers/scsi/aacraid/linit.c| 12 +- drivers/scsi/advansys.c | 58 +++ drivers/scsi/aha152x.c | 76 drivers/scsi/aha1542.c | 2 +- drivers/scsi/aha1740.c | 11 +- drivers/scsi/aha1740.h | 4 +- drivers/scsi/aic7xxx/aic79xx_osm.c | 5 +- drivers/scsi/aic7xxx/aic79xx_osm.h | 6 +- drivers/scsi/aic7xxx/aic7xxx_osm.c | 5 +- drivers/scsi/aic7xxx/aic7xxx_osm.h | 6 +- drivers/scsi/arcmsr/arcmsr_hba.c| 56 +++--- drivers/scsi/arm/acornscsi.c| 11 +- drivers/scsi/arm/fas216.c | 6 +- drivers/scsi/atp870u.c | 18 +- drivers/scsi/be2iscsi/be_main.c | 8 +- drivers/scsi/bfa/bfad_im.c | 38 ++-- drivers/scsi/bfa/bfad_im.h | 1 - drivers/scsi/bnx2fc/bnx2fc_io.c | 17 +- drivers/scsi/ch.c | 2 +- drivers/scsi/constants.c| 4 +- drivers/scsi/csiostor/csio_scsi.c | 12 +- drivers/scsi/cxlflash/main.c| 42 +++-- drivers/scsi/dc395x.c | 57 +++--- drivers/scsi/device_handler/scsi_dh_alua.c | 10 +- drivers/scsi/dpt_i2o.c | 45 +++-- drivers/scsi/esas2r/esas2r_main.c | 19 +- drivers/scsi/esp_scsi.c | 18 +- drivers/scsi/fnic/fnic_scsi.c | 48 +++-- drivers/scsi/gdth.c | 105 ++- drivers/scsi/gdth.h | 10 +- drivers/scsi/gdth_proc.c| 2 +- drivers/scsi/hpsa.c | 94 ++ drivers/scsi/hptiop.c | 27 +-- drivers/scsi/ibmvscsi/ibmvfc.c | 26 ++- drivers/scsi/ibmvscsi/ibmvscsi.c| 28 +-- drivers/scsi/imm.c | 12 +- drivers/scsi/initio.c
[VERY EARLY RFC 09/13] scsi: use set_msg_byte
@@ struct scsi_cmnd *c; expression E1, E2; @@ ( - c->result = E1 << 8 | E2; + c->result = 0; + set_msg_byte(c, E1); + c->result |= E2; | - c->result |= E1 << 8 | E2; + set_msg_byte(c, E1); + c->result |= E2; | - c->result = E1 << 8; + c->result = 0; + set_msg_byte(c, E1); | - c->result |= E1 << 8; + c->result = 0; + set_msg_byte(c, E1); | - c->result = (E1 << 8); + set_msg_byte(c, E1); | - c->result |= (E1 << 8); + set_msg_byte(c, E1); ) Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/advansys.c | 1 - drivers/scsi/hpsa.c | 4 ++-- drivers/scsi/mesh.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 846917538e2b..63c0d97d52a0 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -2091,7 +2091,6 @@ do { \ /* struct scsi_cmnd function return codes */ #define STATUS_BYTE(byte) (byte) -#define MSG_BYTE(byte) ((byte) << 8) #define ASC_STATS(shost, counter) ASC_STATS_ADD(shost, counter, 1) #ifndef ADVANSYS_STATS diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index c27d1ef7158b..0a4aa7ad4437 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -2365,7 +2365,7 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, case IOACCEL2_STATUS_SR_UNDERRUN: cmd->result = 0; set_host_byte(cmd, DID_OK); /* host byte */ - cmd->result |= (COMMAND_COMPLETE << 8); /* msg byte */ + set_msg_byte(cmd, COMMAND_COMPLETE);/* msg byte */ ioaccel2_resid = get_unaligned_le32( >error_data.resid_cnt[0]); scsi_set_resid(cmd, ioaccel2_resid); @@ -2575,7 +2575,7 @@ static void complete_scsi_command(struct CommandList *cp) cmd->result = 0; set_host_byte(cmd, DID_OK); /* host byte */ - cmd->result |= (COMMAND_COMPLETE << 8); /* msg byte */ + set_msg_byte(cmd, COMMAND_COMPLETE);/* msg byte */ if (cp->cmd_type == CMD_IOACCEL2 || cp->cmd_type == CMD_IOACCEL1) { if (dev->physical_device && dev->expose_device && diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index 97c6eb8e5ae8..fee7ada36d52 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c @@ -596,7 +596,7 @@ static void mesh_done(struct mesh_state *ms, int start_next) if (cmd) { set_scsi_result(cmd, 0, ms->stat, 0, cmd->SCp.Status); if (ms->stat == DID_OK) - cmd->result += (cmd->SCp.Message << 8); + set_msg_byte(cmd, cmd->SCp.Message); if (DEBUG_TARGET(cmd)) { printk(KERN_DEBUG "mesh_done: result = %x, data_ptr=%d, buflen=%d\n", cmd->result, ms->data_ptr, scsi_bufflen(cmd)); -- 2.16.3