diff mbox series

[v4,31/31] elx: efct: Tie into kernel Kconfig and build process

Message ID 20201012225147.54404-32-james.smart@broadcom.com
State New
Headers show
Series [v4,01/31] elx: libefc_sli: SLI-4 register offsets and field definitions | expand

Commit Message

James Smart Oct. 12, 2020, 10:51 p.m. UTC
This final patch ties the efct driver into the kernel Kconfig
and build linkages in the drivers/scsi directory.

Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com>
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/Kconfig  | 2 ++
 drivers/scsi/Makefile | 1 +
 2 files changed, 3 insertions(+)

Comments

kernel test robot Oct. 13, 2020, 1:10 a.m. UTC | #1
Hi James,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next linus/master v5.9 next-20201012]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/James-Smart/efct-Broadcom-Emulex-FC-Target-driver/20201013-065423
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/72c2c89c37a70b6f2c3e50cd971b758182f6190f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review James-Smart/efct-Broadcom-Emulex-FC-Target-driver/20201013-065423
        git checkout 72c2c89c37a70b6f2c3e50cd971b758182f6190f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/pci.h:37,
                    from drivers/scsi/elx/libefc_sli/sli4.h:15,
                    from drivers/scsi/elx/libefc_sli/sli4.c:11:
   drivers/scsi/elx/libefc_sli/sli4.c: In function 'sli_bmbx_command':
>> drivers/scsi/elx/libefc_sli/sli4.c:2941:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

    2941 |    (void *)sli4->bmbx.phys,
         |    ^
   include/linux/dev_printk.h:100:33: note: in definition of macro 'dev_crit'
     100 |  _dev_crit(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                 ^~~~~~~~~~~
   drivers/scsi/elx/libefc_sli/sli4.c:2940:3: note: in expansion of macro 'efc_log_crit'
    2940 |   efc_log_crit(sli4, "bootstrap mailbox write fail phys=%p reg=%#x\n",
         |   ^~~~~~~~~~~~

vim +2941 drivers/scsi/elx/libefc_sli/sli4.c

d7de2565f5680e James Smart 2020-10-12  2923  
d7de2565f5680e James Smart 2020-10-12  2924  int
d7de2565f5680e James Smart 2020-10-12  2925  sli_bmbx_command(struct sli4 *sli4)
d7de2565f5680e James Smart 2020-10-12  2926  {
d7de2565f5680e James Smart 2020-10-12  2927  	void *cqe = (u8 *)sli4->bmbx.virt + SLI4_BMBX_SIZE;
d7de2565f5680e James Smart 2020-10-12  2928  
d7de2565f5680e James Smart 2020-10-12  2929  	if (sli_fw_error_status(sli4) > 0) {
d7de2565f5680e James Smart 2020-10-12  2930  		efc_log_crit(sli4, "Chip is in an error state -Mailbox command rejected");
d7de2565f5680e James Smart 2020-10-12  2931  		efc_log_crit(sli4, " status=%#x error1=%#x error2=%#x\n",
d7de2565f5680e James Smart 2020-10-12  2932  			sli_reg_read_status(sli4),
d7de2565f5680e James Smart 2020-10-12  2933  			sli_reg_read_err1(sli4),
d7de2565f5680e James Smart 2020-10-12  2934  			sli_reg_read_err2(sli4));
d7de2565f5680e James Smart 2020-10-12  2935  		return EFC_FAIL;
d7de2565f5680e James Smart 2020-10-12  2936  	}
d7de2565f5680e James Smart 2020-10-12  2937  
d7de2565f5680e James Smart 2020-10-12  2938  	/* Submit a command to the bootstrap mailbox and check the status */
d7de2565f5680e James Smart 2020-10-12  2939  	if (sli_bmbx_write(sli4)) {
d7de2565f5680e James Smart 2020-10-12  2940  		efc_log_crit(sli4, "bootstrap mailbox write fail phys=%p reg=%#x\n",
d7de2565f5680e James Smart 2020-10-12 @2941  			(void *)sli4->bmbx.phys,
d7de2565f5680e James Smart 2020-10-12  2942  			readl(sli4->reg[0] + SLI4_BMBX_REG));
d7de2565f5680e James Smart 2020-10-12  2943  		return EFC_FAIL;
d7de2565f5680e James Smart 2020-10-12  2944  	}
d7de2565f5680e James Smart 2020-10-12  2945  
d7de2565f5680e James Smart 2020-10-12  2946  	/* check completion queue entry status */
d7de2565f5680e James Smart 2020-10-12  2947  	if (le32_to_cpu(((struct sli4_mcqe *)cqe)->dw3_flags) &
d7de2565f5680e James Smart 2020-10-12  2948  	    SLI4_MCQE_VALID) {
d7de2565f5680e James Smart 2020-10-12  2949  		return sli_cqe_mq(sli4, cqe);
d7de2565f5680e James Smart 2020-10-12  2950  	}
d7de2565f5680e James Smart 2020-10-12  2951  	efc_log_crit(sli4, "invalid or wrong type\n");
d7de2565f5680e James Smart 2020-10-12  2952  	return EFC_FAIL;
d7de2565f5680e James Smart 2020-10-12  2953  }
d7de2565f5680e James Smart 2020-10-12  2954  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Oct. 13, 2020, 1:30 a.m. UTC | #2
Hi James,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next linus/master v5.9 next-20201012]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/James-Smart/efct-Broadcom-Emulex-FC-Target-driver/20201013-065423
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/72c2c89c37a70b6f2c3e50cd971b758182f6190f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review James-Smart/efct-Broadcom-Emulex-FC-Target-driver/20201013-065423
        git checkout 72c2c89c37a70b6f2c3e50cd971b758182f6190f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/scsi/elx/libefc_sli/sli4.c: In function 'sli_cmd_common_write_object':
>> drivers/scsi/elx/libefc_sli/sli4.c:3830:2: warning: 'strncpy' specified bound 104 equals destination size [-Wstringop-truncation]
    3830 |  strncpy(wr_obj->object_name, object_name, sizeof(wr_obj->object_name));
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/elx/libefc_sli/sli4.c: In function 'sli_cmd_common_read_object':
   drivers/scsi/elx/libefc_sli/sli4.c:3882:2: warning: 'strncpy' specified bound 104 equals destination size [-Wstringop-truncation]
    3882 |  strncpy(rd_obj->object_name, object_name, sizeof(rd_obj->object_name));
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/strncpy +3830 drivers/scsi/elx/libefc_sli/sli4.c

d7de2565f5680e2 James Smart 2020-10-12  3801  
d7de2565f5680e2 James Smart 2020-10-12  3802  int
d7de2565f5680e2 James Smart 2020-10-12  3803  sli_cmd_common_write_object(struct sli4 *sli4, void *buf, u16 noc,
d7de2565f5680e2 James Smart 2020-10-12  3804  			    u16 eof, u32 desired_write_length,
d7de2565f5680e2 James Smart 2020-10-12  3805  			    u32 offset, char *object_name,
d7de2565f5680e2 James Smart 2020-10-12  3806  			    struct efc_dma *dma)
d7de2565f5680e2 James Smart 2020-10-12  3807  {
d7de2565f5680e2 James Smart 2020-10-12  3808  	struct sli4_rqst_cmn_write_object *wr_obj = NULL;
d7de2565f5680e2 James Smart 2020-10-12  3809  	struct sli4_bde *bde;
d7de2565f5680e2 James Smart 2020-10-12  3810  	u32 dwflags = 0;
d7de2565f5680e2 James Smart 2020-10-12  3811  
d7de2565f5680e2 James Smart 2020-10-12  3812  	wr_obj = sli_config_cmd_init(sli4, buf,
d7de2565f5680e2 James Smart 2020-10-12  3813  			SLI4_RQST_CMDSZ(cmn_write_object) + sizeof(*bde), NULL);
d7de2565f5680e2 James Smart 2020-10-12  3814  	if (!wr_obj)
d7de2565f5680e2 James Smart 2020-10-12  3815  		return EFC_FAIL;
d7de2565f5680e2 James Smart 2020-10-12  3816  
d7de2565f5680e2 James Smart 2020-10-12  3817  	sli_cmd_fill_hdr(&wr_obj->hdr, SLI4_CMN_WRITE_OBJECT,
d7de2565f5680e2 James Smart 2020-10-12  3818  		SLI4_SUBSYSTEM_COMMON, CMD_V0,
d7de2565f5680e2 James Smart 2020-10-12  3819  		SLI4_RQST_PYLD_LEN_VAR(cmn_write_object, sizeof(*bde)));
d7de2565f5680e2 James Smart 2020-10-12  3820  
d7de2565f5680e2 James Smart 2020-10-12  3821  	if (noc)
d7de2565f5680e2 James Smart 2020-10-12  3822  		dwflags |= SLI4_RQ_DES_WRITE_LEN_NOC;
d7de2565f5680e2 James Smart 2020-10-12  3823  	if (eof)
d7de2565f5680e2 James Smart 2020-10-12  3824  		dwflags |= SLI4_RQ_DES_WRITE_LEN_EOF;
d7de2565f5680e2 James Smart 2020-10-12  3825  	dwflags |= (desired_write_length & SLI4_RQ_DES_WRITE_LEN);
d7de2565f5680e2 James Smart 2020-10-12  3826  
d7de2565f5680e2 James Smart 2020-10-12  3827  	wr_obj->desired_write_len_dword = cpu_to_le32(dwflags);
d7de2565f5680e2 James Smart 2020-10-12  3828  
d7de2565f5680e2 James Smart 2020-10-12  3829  	wr_obj->write_offset = cpu_to_le32(offset);
d7de2565f5680e2 James Smart 2020-10-12 @3830  	strncpy(wr_obj->object_name, object_name, sizeof(wr_obj->object_name));
d7de2565f5680e2 James Smart 2020-10-12  3831  	wr_obj->host_buffer_descriptor_count = cpu_to_le32(1);
d7de2565f5680e2 James Smart 2020-10-12  3832  
d7de2565f5680e2 James Smart 2020-10-12  3833  	bde = (struct sli4_bde *)wr_obj->host_buffer_descriptor;
d7de2565f5680e2 James Smart 2020-10-12  3834  
d7de2565f5680e2 James Smart 2020-10-12  3835  	/* Setup to transfer xfer_size bytes to device */
d7de2565f5680e2 James Smart 2020-10-12  3836  	bde->bde_type_buflen =
d7de2565f5680e2 James Smart 2020-10-12  3837  		cpu_to_le32((SLI4_BDE_TYPE_VAL(64)) |
d7de2565f5680e2 James Smart 2020-10-12  3838  			    (desired_write_length & SLI4_BDE_LEN_MASK));
d7de2565f5680e2 James Smart 2020-10-12  3839  	bde->u.data.low = cpu_to_le32(lower_32_bits(dma->phys));
d7de2565f5680e2 James Smart 2020-10-12  3840  	bde->u.data.high = cpu_to_le32(upper_32_bits(dma->phys));
d7de2565f5680e2 James Smart 2020-10-12  3841  
d7de2565f5680e2 James Smart 2020-10-12  3842  	return EFC_SUCCESS;
d7de2565f5680e2 James Smart 2020-10-12  3843  }
d7de2565f5680e2 James Smart 2020-10-12  3844  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Hannes Reinecke Oct. 20, 2020, 7:06 a.m. UTC | #3
On 10/13/20 12:51 AM, James Smart wrote:
> This final patch ties the efct driver into the kernel Kconfig

> and build linkages in the drivers/scsi directory.

> 

> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com>

> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com>

> Signed-off-by: James Smart <james.smart@broadcom.com>

> ---

>   drivers/scsi/Kconfig  | 2 ++

>   drivers/scsi/Makefile | 1 +

>   2 files changed, 3 insertions(+)

> 

> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig

> index 701b61ec76ee..f2d47bf55f97 100644

> --- a/drivers/scsi/Kconfig

> +++ b/drivers/scsi/Kconfig

> @@ -1170,6 +1170,8 @@ config SCSI_LPFC_DEBUG_FS

>   	  This makes debugging information from the lpfc driver

>   	  available via the debugfs filesystem.

>   

> +source "drivers/scsi/elx/Kconfig"

> +

>   config SCSI_SIM710

>   	tristate "Simple 53c710 SCSI support (Compaq, NCR machines)"

>   	depends on EISA && SCSI

> diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile

> index c00e3dd57990..844db573283c 100644

> --- a/drivers/scsi/Makefile

> +++ b/drivers/scsi/Makefile

> @@ -86,6 +86,7 @@ obj-$(CONFIG_SCSI_QLOGIC_1280)	+= qla1280.o

>   obj-$(CONFIG_SCSI_QLA_FC)	+= qla2xxx/

>   obj-$(CONFIG_SCSI_QLA_ISCSI)	+= libiscsi.o qla4xxx/

>   obj-$(CONFIG_SCSI_LPFC)		+= lpfc/

> +obj-$(CONFIG_SCSI_EFCT)		+= elx/

>   obj-$(CONFIG_SCSI_BFA_FC)	+= bfa/

>   obj-$(CONFIG_SCSI_CHELSIO_FCOE)	+= csiostor/

>   obj-$(CONFIG_SCSI_DMX3191D)	+= dmx3191d.o

> 

Reviewed-by: Hannes Reinecke <hare@suse.de>


Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
diff mbox series

Patch

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 701b61ec76ee..f2d47bf55f97 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1170,6 +1170,8 @@  config SCSI_LPFC_DEBUG_FS
 	  This makes debugging information from the lpfc driver
 	  available via the debugfs filesystem.
 
+source "drivers/scsi/elx/Kconfig"
+
 config SCSI_SIM710
 	tristate "Simple 53c710 SCSI support (Compaq, NCR machines)"
 	depends on EISA && SCSI
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index c00e3dd57990..844db573283c 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -86,6 +86,7 @@  obj-$(CONFIG_SCSI_QLOGIC_1280)	+= qla1280.o
 obj-$(CONFIG_SCSI_QLA_FC)	+= qla2xxx/
 obj-$(CONFIG_SCSI_QLA_ISCSI)	+= libiscsi.o qla4xxx/
 obj-$(CONFIG_SCSI_LPFC)		+= lpfc/
+obj-$(CONFIG_SCSI_EFCT)		+= elx/
 obj-$(CONFIG_SCSI_BFA_FC)	+= bfa/
 obj-$(CONFIG_SCSI_CHELSIO_FCOE)	+= csiostor/
 obj-$(CONFIG_SCSI_DMX3191D)	+= dmx3191d.o