openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Igor Kononenko <i.kononenko@yadro.com>,
	Jens Axboe <axboe@kernel.dk>, Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Igor Kononenko <i.kononenko@yadro.com>,
	openbmc@lists.ozlabs.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	kbuild-all@lists.01.org
Subject: Re: [PATCH 5/6] FMS: Add the SCSI Get Configuration command.
Date: Sun, 27 Jun 2021 12:42:57 +0800	[thread overview]
Message-ID: <202106271216.SEjCCKSb-lkp@intel.com> (raw)
In-Reply-To: <20210626211820.107310-6-i.kononenko@yadro.com>

[-- Attachment #1: Type: text/plain, Size: 9125 bytes --]

Hi Igor,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next linus/master balbi-usb/testing/next v5.13-rc7 next-20210625]
[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/Igor-Kononenko/usb-gadget-mass-storage-Improve-the-signature-of-SCSI-handler-function/20210627-061851
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: i386-randconfig-s002-20210627 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/db2ec6f1e52293817f380a4875e01c36a4195c19
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Igor-Kononenko/usb-gadget-mass-storage-Improve-the-signature-of-SCSI-handler-function/20210627-061851
        git checkout db2ec6f1e52293817f380a4875e01c36a4195c19
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/usb/gadget/function/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/usb/gadget/function/f_mass_storage.c:1988:57: sparse: sparse: restricted __be16 degrades to integer
>> drivers/usb/gadget/function/f_mass_storage.c:2060:30: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] data_len @@     got restricted __be32 [usertype] @@
   drivers/usb/gadget/function/f_mass_storage.c:2060:30: sparse:     expected unsigned int [usertype] data_len
   drivers/usb/gadget/function/f_mass_storage.c:2060:30: sparse:     got restricted __be32 [usertype]
>> drivers/usb/gadget/function/f_mass_storage.c:2062:17: sparse: sparse: cast from restricted __be16
>> drivers/usb/gadget/function/f_mass_storage.c:2061:34: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] curr_profile @@     got restricted __be16 [usertype] @@
   drivers/usb/gadget/function/f_mass_storage.c:2061:34: sparse:     expected unsigned short [usertype] curr_profile
   drivers/usb/gadget/function/f_mass_storage.c:2061:34: sparse:     got restricted __be16 [usertype]
   drivers/usb/gadget/function/f_mass_storage.c:2231:11: sparse: sparse: Initializer entry defined twice
   drivers/usb/gadget/function/f_mass_storage.c:2231:11: sparse:   also defined here
   drivers/usb/gadget/function/f_mass_storage.c:2233:11: sparse: sparse: Initializer entry defined twice
   drivers/usb/gadget/function/f_mass_storage.c:2233:11: sparse:   also defined here
   drivers/usb/gadget/function/f_mass_storage.c:2235:11: sparse: sparse: Initializer entry defined twice
   drivers/usb/gadget/function/f_mass_storage.c:2235:11: sparse:   also defined here
   drivers/usb/gadget/function/f_mass_storage.c:2259:11: sparse: sparse: Initializer entry defined twice
   drivers/usb/gadget/function/f_mass_storage.c:2259:11: sparse:   also defined here
   drivers/usb/gadget/function/f_mass_storage.c:2261:11: sparse: sparse: Initializer entry defined twice
   drivers/usb/gadget/function/f_mass_storage.c:2261:11: sparse:   also defined here
   drivers/usb/gadget/function/f_mass_storage.c:2263:11: sparse: sparse: Initializer entry defined twice
   drivers/usb/gadget/function/f_mass_storage.c:2263:11: sparse:   also defined here
   drivers/usb/gadget/function/f_mass_storage.c:2265:11: sparse: sparse: Initializer entry defined twice
   drivers/usb/gadget/function/f_mass_storage.c:2265:11: sparse:   also defined here
   drivers/usb/gadget/function/f_mass_storage.c: note: in included file (through include/linux/rcuwait.h, include/linux/percpu-rwsem.h, include/linux/fs.h, ...):
   include/linux/sched/signal.h:285:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   include/linux/sched/signal.h:285:28: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:285:28: sparse:     got struct spinlock [noderef] __rcu *
   include/linux/sched/signal.h:287:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   include/linux/sched/signal.h:287:30: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:287:30: sparse:     got struct spinlock [noderef] __rcu *

vim +1988 drivers/usb/gadget/function/f_mass_storage.c

  1969	
  1970	/* Adjust current profile which depended on an inserted medium */
  1971	static inline void cdf_populate_profile_list(struct fsg_common *common,
  1972						     struct cdr_features **feature)
  1973	{
  1974		__be16 current_media_type = cdr_guess_medium_type(common);
  1975		struct mmc_profile *profiles =
  1976			(*feature)->feature.profile_list.profiles;
  1977		int i;
  1978	
  1979		/* copy profile list to the response buffer */
  1980		memcpy(profiles, cdf_supported_profiles,
  1981		       sizeof(cdf_supported_profiles));
  1982		for (i = 0; i < CDF_PROFILES_COUNT; ++i) {
  1983			/*
  1984			 * Reset the current profile bit,
  1985			 * because it might be set from the previous one
  1986			 */
  1987			profiles[i].current_p = 0;
> 1988			if (be16_to_cpu(profiles[i].profile) == current_media_type) {
  1989				DBG(common, "Fill current profile: curr=(%04Xh)\n",
  1990				    be16_to_cpu(profiles[i].profile));
  1991				profiles[i].current_p = 1;
  1992			}
  1993		}
  1994	}
  1995	
  1996	static int do_get_configuration(struct fsg_common *common,
  1997					struct fsg_buffhd *bh)
  1998	{
  1999		struct fsg_lun *curlun = common->curlun;
  2000		int i;
  2001		struct cdb_get_configuration *cdb =
  2002			(struct cdb_get_configuration *)common->cmnd;
  2003		size_t buffer_size = sizeof(struct feature_header);
  2004		size_t generic_desc_size = sizeof(struct cdb_ft_generic);
  2005		struct feature_header *ret_header = (struct feature_header *)bh->buf;
  2006		u8 *ret_data = ((u8 *)ret_header) + buffer_size;
  2007	
  2008		LDBG(curlun, "Requesting features from 0x%04X, with RT flag 0x%02X\n",
  2009		     be16_to_cpu(cdb->sfn), cdb->rt);
  2010	
  2011		if (!common->curlun || !common->curlun->cdrom)
  2012			return -EINVAL;
  2013	
  2014		/* Go over *all* features, and copy them according to RT value */
  2015		for (i = 0; i < ARRAY_SIZE(features_table); ++i) {
  2016			struct cdb_ft_generic *generic =
  2017				(struct cdb_ft_generic *)&features_table[i];
  2018			struct cdr_features *feature = &features_table[i];
  2019	
  2020			if (feature->populate != NULL)
  2021				feature->populate(common, &feature);
  2022	
  2023			// a) RT is 0x00 and feature's code >= SFN
  2024			// b) RT is 0x01, feature's code >= SFN and feature has 'current' bit set
  2025			// c) RT is 0x02 and feature's code == SFN
  2026	
  2027			if (be16_to_cpu(generic->code) >= be16_to_cpu(cdb->sfn)) {
  2028				if ((cdb->rt == CDR_CFG_RT_FULL) ||
  2029				    (cdb->rt == CDR_CFG_RT_CURRENT &&
  2030				     generic->vpc.cur) ||
  2031				    (cdb->rt == CDR_CFG_RT_SPECIFIED_SFN &&
  2032				     be16_to_cpu(generic->code) ==
  2033					     be16_to_cpu(cdb->sfn))) {
  2034					LDBG(curlun, "Copying feature 0x%04X\n",
  2035					     be16_to_cpu(generic->code));
  2036	
  2037					memset(ret_data, 0,
  2038					       (generic->length + generic_desc_size));
  2039					/* Copy feature */
  2040					memcpy(ret_data, feature,
  2041					       (generic->length + generic_desc_size));
  2042					buffer_size +=
  2043						(generic->length + generic_desc_size);
  2044					ret_data +=
  2045						(generic->length + generic_desc_size);
  2046	
  2047					/* Break the loop if RT is CDR_CFG_RT_SPECIFIED_SFN */
  2048					if (cdb->rt == CDR_CFG_RT_SPECIFIED_SFN) {
  2049						LDBG(curlun,
  2050						     "Got the feature we wanted (0x%04X), breaking the loop\n",
  2051						     be16_to_cpu(cdb->sfn));
  2052						break;
  2053					}
  2054				}
  2055			}
  2056		}
  2057	
  2058		memset(ret_header, 0, sizeof(struct feature_header));
  2059		/* Header */
> 2060		ret_header->data_len = cpu_to_be32(buffer_size - generic_desc_size);
> 2061		ret_header->curr_profile =
> 2062			cpu_to_be16(cdr_guess_medium_type(common));
  2063	
  2064		dump_msg(common, "feature header", (u8 *)ret_header,
  2065			 sizeof(struct feature_header));
  2066	
  2067		dump_msg(common, "features table", (u8 *)bh->buf, buffer_size);
  2068	
  2069		common->data_size_to_handle = buffer_size;
  2070		return 0;
  2071	}
  2072	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47122 bytes --]

  parent reply	other threads:[~2021-06-27  4:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-26 21:18 [PATCH 0/6] USB-gadget: mass-storage: Support DVD-like images Igor Kononenko
2021-06-26 21:18 ` [PATCH 1/6] usb:gadget:mass-storage: Improve the signature of SCSI handler function Igor Kononenko
2021-06-27 14:18   ` Alan Stern
2021-06-27 15:32     ` i.kononenko
2021-06-27 16:39       ` Alan Stern
2021-06-26 21:18 ` [PATCH 2/6] usb:gadget:mass-storage: refactoring the SCSI command handling Igor Kononenko
2021-06-26 23:29   ` kernel test robot
2021-06-27 14:23   ` Alan Stern
2021-06-27 17:14     ` i.kononenko
2021-06-28  1:06       ` Alan Stern
2021-06-28 10:38         ` i.kononenko
2021-06-26 21:18 ` [PATCH 3/6] fms: Add TOC/PMA/ATIP DVD-ROM capabilities Igor Kononenko
2021-06-27 14:29   ` Alan Stern
2021-06-27 18:45     ` i.kononenko
2021-06-28 14:31       ` Alan Stern
2021-06-26 21:18 ` [PATCH 4/6] fms: Support the DVD/BD images size over 2.1Gb Igor Kononenko
2021-06-26 21:18 ` [PATCH 5/6] FMS: Add the SCSI Get Configuration command Igor Kononenko
2021-06-27  0:44   ` kernel test robot
2021-06-27  4:42   ` kernel test robot [this message]
2021-06-28  9:53   ` Christoph Hellwig
2021-06-28 10:34     ` i.kononenko
2021-06-26 21:18 ` [PATCH 6/6] FMS: Add SCSI Read Disc Information command Igor Kononenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202106271216.SEjCCKSb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=i.kononenko@yadro.com \
    --cc=jejb@linux.ibm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).