From: kernel test robot <lkp@intel.com>
To: Anant Thazhemadam <anant.thazhemadam@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: kbuild-all@lists.01.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 05/15] usb: misc: emi26: update to use usb_control_msg_send()
Date: Mon, 30 Nov 2020 13:37:02 +0800 [thread overview]
Message-ID: <202011301341.OpQJ5zR4-lkp@intel.com> (raw)
In-Reply-To: <20201130012847.2579463-1-anant.thazhemadam@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 13104 bytes --]
Hi Anant,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on balbi-usb/testing/next peter.chen-usb/ci-for-usb-next v5.10-rc6 next-20201127]
[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/Anant-Thazhemadam/drivers-usb-misc-update-to-use-usb_control_msg_-send-recv/20201130-093816
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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/bd85eb79b555200026380c4f93e83c4a667564e5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Anant-Thazhemadam/drivers-usb-misc-update-to-use-usb_control_msg_-send-recv/20201130-093816
git checkout bd85eb79b555200026380c4f93e83c4a667564e5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
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/usb/misc/emi26.c: In function 'emi26_load_firmware':
>> drivers/usb/misc/emi26.c:201:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
201 | }
| ^
vim +201 drivers/usb/misc/emi26.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 60
^1da177e4c3f415 Linus Torvalds 2005-04-16 61 static int emi26_load_firmware (struct usb_device *dev)
^1da177e4c3f415 Linus Torvalds 2005-04-16 62 {
ae93a55bf948753 David Woodhouse 2008-05-30 63 const struct firmware *loader_fw = NULL;
ae93a55bf948753 David Woodhouse 2008-05-30 64 const struct firmware *bitstream_fw = NULL;
ae93a55bf948753 David Woodhouse 2008-05-30 65 const struct firmware *firmware_fw = NULL;
ae93a55bf948753 David Woodhouse 2008-05-30 66 const struct ihex_binrec *rec;
b412284b9698456 Greg Kroah-Hartman 2012-04-20 67 int err = -ENOMEM;
^1da177e4c3f415 Linus Torvalds 2005-04-16 68 int i;
^1da177e4c3f415 Linus Torvalds 2005-04-16 69 __u32 addr; /* Address to write */
bd85eb79b555200 Anant Thazhemadam 2020-11-30 70 __u8 buf[FW_LOAD_SIZE];
^1da177e4c3f415 Linus Torvalds 2005-04-16 71
ae93a55bf948753 David Woodhouse 2008-05-30 72 err = request_ihex_firmware(&loader_fw, "emi26/loader.fw", &dev->dev);
ae93a55bf948753 David Woodhouse 2008-05-30 73 if (err)
ae93a55bf948753 David Woodhouse 2008-05-30 74 goto nofw;
ae93a55bf948753 David Woodhouse 2008-05-30 75
ae93a55bf948753 David Woodhouse 2008-05-30 76 err = request_ihex_firmware(&bitstream_fw, "emi26/bitstream.fw",
ae93a55bf948753 David Woodhouse 2008-05-30 77 &dev->dev);
ae93a55bf948753 David Woodhouse 2008-05-30 78 if (err)
ae93a55bf948753 David Woodhouse 2008-05-30 79 goto nofw;
ae93a55bf948753 David Woodhouse 2008-05-30 80
ae93a55bf948753 David Woodhouse 2008-05-30 81 err = request_ihex_firmware(&firmware_fw, "emi26/firmware.fw",
ae93a55bf948753 David Woodhouse 2008-05-30 82 &dev->dev);
ae93a55bf948753 David Woodhouse 2008-05-30 83 if (err) {
ae93a55bf948753 David Woodhouse 2008-05-30 84 nofw:
fd3f1917e345d85 Greg Kroah-Hartman 2008-08-14 85 dev_err(&dev->dev, "%s - request_firmware() failed\n",
fd3f1917e345d85 Greg Kroah-Hartman 2008-08-14 86 __func__);
ae93a55bf948753 David Woodhouse 2008-05-30 87 goto wraperr;
ae93a55bf948753 David Woodhouse 2008-05-30 88 }
ae93a55bf948753 David Woodhouse 2008-05-30 89
^1da177e4c3f415 Linus Torvalds 2005-04-16 90 /* Assert reset (stop the CPU in the EMI) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 91 err = emi26_set_reset(dev,1);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 92 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 93 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 94
ae93a55bf948753 David Woodhouse 2008-05-30 95 rec = (const struct ihex_binrec *)loader_fw->data;
^1da177e4c3f415 Linus Torvalds 2005-04-16 96 /* 1. We need to put the loader for the FPGA into the EZ-USB */
ae93a55bf948753 David Woodhouse 2008-05-30 97 while (rec) {
ae93a55bf948753 David Woodhouse 2008-05-30 98 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 99 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 100 ANCHOR_LOAD_INTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 101 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 102 goto wraperr;
ae93a55bf948753 David Woodhouse 2008-05-30 103 rec = ihex_next_binrec(rec);
^1da177e4c3f415 Linus Torvalds 2005-04-16 104 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 105
^1da177e4c3f415 Linus Torvalds 2005-04-16 106 /* De-assert reset (let the CPU run) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 107 err = emi26_set_reset(dev,0);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 108 if (err < 0)
cf4cf0bb89cbff9 Oliver Neukum 2007-10-25 109 goto wraperr;
16c23f7d88cbcce Monty 2006-05-09 110 msleep(250); /* let device settle */
^1da177e4c3f415 Linus Torvalds 2005-04-16 111
^1da177e4c3f415 Linus Torvalds 2005-04-16 112 /* 2. We upload the FPGA firmware into the EMI
^1da177e4c3f415 Linus Torvalds 2005-04-16 113 * Note: collect up to 1023 (yes!) bytes and send them with
^1da177e4c3f415 Linus Torvalds 2005-04-16 114 * a single request. This is _much_ faster! */
ae93a55bf948753 David Woodhouse 2008-05-30 115 rec = (const struct ihex_binrec *)bitstream_fw->data;
^1da177e4c3f415 Linus Torvalds 2005-04-16 116 do {
^1da177e4c3f415 Linus Torvalds 2005-04-16 117 i = 0;
ae93a55bf948753 David Woodhouse 2008-05-30 118 addr = be32_to_cpu(rec->addr);
^1da177e4c3f415 Linus Torvalds 2005-04-16 119
^1da177e4c3f415 Linus Torvalds 2005-04-16 120 /* intel hex records are terminated with type 0 element */
ae93a55bf948753 David Woodhouse 2008-05-30 121 while (rec && (i + be16_to_cpu(rec->len) < FW_LOAD_SIZE)) {
bd85eb79b555200 Anant Thazhemadam 2020-11-30 122 memcpy(&buf[i], rec->data, be16_to_cpu(rec->len));
ae93a55bf948753 David Woodhouse 2008-05-30 123 i += be16_to_cpu(rec->len);
ae93a55bf948753 David Woodhouse 2008-05-30 124 rec = ihex_next_binrec(rec);
^1da177e4c3f415 Linus Torvalds 2005-04-16 125 }
bd85eb79b555200 Anant Thazhemadam 2020-11-30 126 err = emi26_writememory(dev, addr, &buf, i, ANCHOR_LOAD_FPGA);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 127 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 128 goto wraperr;
327d74f6b65ddc8 Marcin Slusarz 2009-01-04 129 } while (rec);
^1da177e4c3f415 Linus Torvalds 2005-04-16 130
^1da177e4c3f415 Linus Torvalds 2005-04-16 131 /* Assert reset (stop the CPU in the EMI) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 132 err = emi26_set_reset(dev,1);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 133 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 134 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 135
^1da177e4c3f415 Linus Torvalds 2005-04-16 136 /* 3. We need to put the loader for the firmware into the EZ-USB (again...) */
ae93a55bf948753 David Woodhouse 2008-05-30 137 for (rec = (const struct ihex_binrec *)loader_fw->data;
ae93a55bf948753 David Woodhouse 2008-05-30 138 rec; rec = ihex_next_binrec(rec)) {
ae93a55bf948753 David Woodhouse 2008-05-30 139 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 140 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 141 ANCHOR_LOAD_INTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 142 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 143 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 144 }
16c23f7d88cbcce Monty 2006-05-09 145 msleep(250); /* let device settle */
^1da177e4c3f415 Linus Torvalds 2005-04-16 146
^1da177e4c3f415 Linus Torvalds 2005-04-16 147 /* De-assert reset (let the CPU run) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 148 err = emi26_set_reset(dev,0);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 149 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 150 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 151
^1da177e4c3f415 Linus Torvalds 2005-04-16 152 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */
ae93a55bf948753 David Woodhouse 2008-05-30 153
ae93a55bf948753 David Woodhouse 2008-05-30 154 for (rec = (const struct ihex_binrec *)firmware_fw->data;
ae93a55bf948753 David Woodhouse 2008-05-30 155 rec; rec = ihex_next_binrec(rec)) {
ae93a55bf948753 David Woodhouse 2008-05-30 156 if (!INTERNAL_RAM(be32_to_cpu(rec->addr))) {
ae93a55bf948753 David Woodhouse 2008-05-30 157 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 158 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 159 ANCHOR_LOAD_EXTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 160 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 161 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 162 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 163 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 164
^1da177e4c3f415 Linus Torvalds 2005-04-16 165 /* Assert reset (stop the CPU in the EMI) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 166 err = emi26_set_reset(dev,1);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 167 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 168 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 169
ae93a55bf948753 David Woodhouse 2008-05-30 170 for (rec = (const struct ihex_binrec *)firmware_fw->data;
ae93a55bf948753 David Woodhouse 2008-05-30 171 rec; rec = ihex_next_binrec(rec)) {
ae93a55bf948753 David Woodhouse 2008-05-30 172 if (INTERNAL_RAM(be32_to_cpu(rec->addr))) {
ae93a55bf948753 David Woodhouse 2008-05-30 173 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 174 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 175 ANCHOR_LOAD_INTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 176 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 177 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 178 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 179 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 180
^1da177e4c3f415 Linus Torvalds 2005-04-16 181 /* De-assert reset (let the CPU run) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 182 err = emi26_set_reset(dev,0);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 183 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 184 goto wraperr;
16c23f7d88cbcce Monty 2006-05-09 185 msleep(250); /* let device settle */
^1da177e4c3f415 Linus Torvalds 2005-04-16 186
^1da177e4c3f415 Linus Torvalds 2005-04-16 187 /* return 1 to fail the driver inialization
^1da177e4c3f415 Linus Torvalds 2005-04-16 188 * and give real driver change to load */
^1da177e4c3f415 Linus Torvalds 2005-04-16 189 err = 1;
^1da177e4c3f415 Linus Torvalds 2005-04-16 190
^1da177e4c3f415 Linus Torvalds 2005-04-16 191 wraperr:
b412284b9698456 Greg Kroah-Hartman 2012-04-20 192 if (err < 0)
b412284b9698456 Greg Kroah-Hartman 2012-04-20 193 dev_err(&dev->dev,"%s - error loading firmware: error = %d\n",
b412284b9698456 Greg Kroah-Hartman 2012-04-20 194 __func__, err);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 195
ae93a55bf948753 David Woodhouse 2008-05-30 196 release_firmware(loader_fw);
ae93a55bf948753 David Woodhouse 2008-05-30 197 release_firmware(bitstream_fw);
ae93a55bf948753 David Woodhouse 2008-05-30 198 release_firmware(firmware_fw);
ae93a55bf948753 David Woodhouse 2008-05-30 199
^1da177e4c3f415 Linus Torvalds 2005-04-16 200 return err;
^1da177e4c3f415 Linus Torvalds 2005-04-16 @201 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 202
---
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: 58894 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 05/15] usb: misc: emi26: update to use usb_control_msg_send()
Date: Mon, 30 Nov 2020 13:37:02 +0800 [thread overview]
Message-ID: <202011301341.OpQJ5zR4-lkp@intel.com> (raw)
In-Reply-To: <20201130012847.2579463-1-anant.thazhemadam@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 13289 bytes --]
Hi Anant,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on balbi-usb/testing/next peter.chen-usb/ci-for-usb-next v5.10-rc6 next-20201127]
[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/Anant-Thazhemadam/drivers-usb-misc-update-to-use-usb_control_msg_-send-recv/20201130-093816
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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/bd85eb79b555200026380c4f93e83c4a667564e5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Anant-Thazhemadam/drivers-usb-misc-update-to-use-usb_control_msg_-send-recv/20201130-093816
git checkout bd85eb79b555200026380c4f93e83c4a667564e5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
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/usb/misc/emi26.c: In function 'emi26_load_firmware':
>> drivers/usb/misc/emi26.c:201:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
201 | }
| ^
vim +201 drivers/usb/misc/emi26.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 60
^1da177e4c3f415 Linus Torvalds 2005-04-16 61 static int emi26_load_firmware (struct usb_device *dev)
^1da177e4c3f415 Linus Torvalds 2005-04-16 62 {
ae93a55bf948753 David Woodhouse 2008-05-30 63 const struct firmware *loader_fw = NULL;
ae93a55bf948753 David Woodhouse 2008-05-30 64 const struct firmware *bitstream_fw = NULL;
ae93a55bf948753 David Woodhouse 2008-05-30 65 const struct firmware *firmware_fw = NULL;
ae93a55bf948753 David Woodhouse 2008-05-30 66 const struct ihex_binrec *rec;
b412284b9698456 Greg Kroah-Hartman 2012-04-20 67 int err = -ENOMEM;
^1da177e4c3f415 Linus Torvalds 2005-04-16 68 int i;
^1da177e4c3f415 Linus Torvalds 2005-04-16 69 __u32 addr; /* Address to write */
bd85eb79b555200 Anant Thazhemadam 2020-11-30 70 __u8 buf[FW_LOAD_SIZE];
^1da177e4c3f415 Linus Torvalds 2005-04-16 71
ae93a55bf948753 David Woodhouse 2008-05-30 72 err = request_ihex_firmware(&loader_fw, "emi26/loader.fw", &dev->dev);
ae93a55bf948753 David Woodhouse 2008-05-30 73 if (err)
ae93a55bf948753 David Woodhouse 2008-05-30 74 goto nofw;
ae93a55bf948753 David Woodhouse 2008-05-30 75
ae93a55bf948753 David Woodhouse 2008-05-30 76 err = request_ihex_firmware(&bitstream_fw, "emi26/bitstream.fw",
ae93a55bf948753 David Woodhouse 2008-05-30 77 &dev->dev);
ae93a55bf948753 David Woodhouse 2008-05-30 78 if (err)
ae93a55bf948753 David Woodhouse 2008-05-30 79 goto nofw;
ae93a55bf948753 David Woodhouse 2008-05-30 80
ae93a55bf948753 David Woodhouse 2008-05-30 81 err = request_ihex_firmware(&firmware_fw, "emi26/firmware.fw",
ae93a55bf948753 David Woodhouse 2008-05-30 82 &dev->dev);
ae93a55bf948753 David Woodhouse 2008-05-30 83 if (err) {
ae93a55bf948753 David Woodhouse 2008-05-30 84 nofw:
fd3f1917e345d85 Greg Kroah-Hartman 2008-08-14 85 dev_err(&dev->dev, "%s - request_firmware() failed\n",
fd3f1917e345d85 Greg Kroah-Hartman 2008-08-14 86 __func__);
ae93a55bf948753 David Woodhouse 2008-05-30 87 goto wraperr;
ae93a55bf948753 David Woodhouse 2008-05-30 88 }
ae93a55bf948753 David Woodhouse 2008-05-30 89
^1da177e4c3f415 Linus Torvalds 2005-04-16 90 /* Assert reset (stop the CPU in the EMI) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 91 err = emi26_set_reset(dev,1);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 92 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 93 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 94
ae93a55bf948753 David Woodhouse 2008-05-30 95 rec = (const struct ihex_binrec *)loader_fw->data;
^1da177e4c3f415 Linus Torvalds 2005-04-16 96 /* 1. We need to put the loader for the FPGA into the EZ-USB */
ae93a55bf948753 David Woodhouse 2008-05-30 97 while (rec) {
ae93a55bf948753 David Woodhouse 2008-05-30 98 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 99 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 100 ANCHOR_LOAD_INTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 101 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 102 goto wraperr;
ae93a55bf948753 David Woodhouse 2008-05-30 103 rec = ihex_next_binrec(rec);
^1da177e4c3f415 Linus Torvalds 2005-04-16 104 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 105
^1da177e4c3f415 Linus Torvalds 2005-04-16 106 /* De-assert reset (let the CPU run) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 107 err = emi26_set_reset(dev,0);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 108 if (err < 0)
cf4cf0bb89cbff9 Oliver Neukum 2007-10-25 109 goto wraperr;
16c23f7d88cbcce Monty 2006-05-09 110 msleep(250); /* let device settle */
^1da177e4c3f415 Linus Torvalds 2005-04-16 111
^1da177e4c3f415 Linus Torvalds 2005-04-16 112 /* 2. We upload the FPGA firmware into the EMI
^1da177e4c3f415 Linus Torvalds 2005-04-16 113 * Note: collect up to 1023 (yes!) bytes and send them with
^1da177e4c3f415 Linus Torvalds 2005-04-16 114 * a single request. This is _much_ faster! */
ae93a55bf948753 David Woodhouse 2008-05-30 115 rec = (const struct ihex_binrec *)bitstream_fw->data;
^1da177e4c3f415 Linus Torvalds 2005-04-16 116 do {
^1da177e4c3f415 Linus Torvalds 2005-04-16 117 i = 0;
ae93a55bf948753 David Woodhouse 2008-05-30 118 addr = be32_to_cpu(rec->addr);
^1da177e4c3f415 Linus Torvalds 2005-04-16 119
^1da177e4c3f415 Linus Torvalds 2005-04-16 120 /* intel hex records are terminated with type 0 element */
ae93a55bf948753 David Woodhouse 2008-05-30 121 while (rec && (i + be16_to_cpu(rec->len) < FW_LOAD_SIZE)) {
bd85eb79b555200 Anant Thazhemadam 2020-11-30 122 memcpy(&buf[i], rec->data, be16_to_cpu(rec->len));
ae93a55bf948753 David Woodhouse 2008-05-30 123 i += be16_to_cpu(rec->len);
ae93a55bf948753 David Woodhouse 2008-05-30 124 rec = ihex_next_binrec(rec);
^1da177e4c3f415 Linus Torvalds 2005-04-16 125 }
bd85eb79b555200 Anant Thazhemadam 2020-11-30 126 err = emi26_writememory(dev, addr, &buf, i, ANCHOR_LOAD_FPGA);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 127 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 128 goto wraperr;
327d74f6b65ddc8 Marcin Slusarz 2009-01-04 129 } while (rec);
^1da177e4c3f415 Linus Torvalds 2005-04-16 130
^1da177e4c3f415 Linus Torvalds 2005-04-16 131 /* Assert reset (stop the CPU in the EMI) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 132 err = emi26_set_reset(dev,1);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 133 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 134 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 135
^1da177e4c3f415 Linus Torvalds 2005-04-16 136 /* 3. We need to put the loader for the firmware into the EZ-USB (again...) */
ae93a55bf948753 David Woodhouse 2008-05-30 137 for (rec = (const struct ihex_binrec *)loader_fw->data;
ae93a55bf948753 David Woodhouse 2008-05-30 138 rec; rec = ihex_next_binrec(rec)) {
ae93a55bf948753 David Woodhouse 2008-05-30 139 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 140 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 141 ANCHOR_LOAD_INTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 142 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 143 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 144 }
16c23f7d88cbcce Monty 2006-05-09 145 msleep(250); /* let device settle */
^1da177e4c3f415 Linus Torvalds 2005-04-16 146
^1da177e4c3f415 Linus Torvalds 2005-04-16 147 /* De-assert reset (let the CPU run) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 148 err = emi26_set_reset(dev,0);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 149 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 150 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 151
^1da177e4c3f415 Linus Torvalds 2005-04-16 152 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */
ae93a55bf948753 David Woodhouse 2008-05-30 153
ae93a55bf948753 David Woodhouse 2008-05-30 154 for (rec = (const struct ihex_binrec *)firmware_fw->data;
ae93a55bf948753 David Woodhouse 2008-05-30 155 rec; rec = ihex_next_binrec(rec)) {
ae93a55bf948753 David Woodhouse 2008-05-30 156 if (!INTERNAL_RAM(be32_to_cpu(rec->addr))) {
ae93a55bf948753 David Woodhouse 2008-05-30 157 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 158 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 159 ANCHOR_LOAD_EXTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 160 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 161 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 162 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 163 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 164
^1da177e4c3f415 Linus Torvalds 2005-04-16 165 /* Assert reset (stop the CPU in the EMI) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 166 err = emi26_set_reset(dev,1);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 167 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 168 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 169
ae93a55bf948753 David Woodhouse 2008-05-30 170 for (rec = (const struct ihex_binrec *)firmware_fw->data;
ae93a55bf948753 David Woodhouse 2008-05-30 171 rec; rec = ihex_next_binrec(rec)) {
ae93a55bf948753 David Woodhouse 2008-05-30 172 if (INTERNAL_RAM(be32_to_cpu(rec->addr))) {
ae93a55bf948753 David Woodhouse 2008-05-30 173 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
ae93a55bf948753 David Woodhouse 2008-05-30 174 rec->data, be16_to_cpu(rec->len),
ae93a55bf948753 David Woodhouse 2008-05-30 175 ANCHOR_LOAD_INTERNAL);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 176 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 177 goto wraperr;
^1da177e4c3f415 Linus Torvalds 2005-04-16 178 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 179 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 180
^1da177e4c3f415 Linus Torvalds 2005-04-16 181 /* De-assert reset (let the CPU run) */
^1da177e4c3f415 Linus Torvalds 2005-04-16 182 err = emi26_set_reset(dev,0);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 183 if (err < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 184 goto wraperr;
16c23f7d88cbcce Monty 2006-05-09 185 msleep(250); /* let device settle */
^1da177e4c3f415 Linus Torvalds 2005-04-16 186
^1da177e4c3f415 Linus Torvalds 2005-04-16 187 /* return 1 to fail the driver inialization
^1da177e4c3f415 Linus Torvalds 2005-04-16 188 * and give real driver change to load */
^1da177e4c3f415 Linus Torvalds 2005-04-16 189 err = 1;
^1da177e4c3f415 Linus Torvalds 2005-04-16 190
^1da177e4c3f415 Linus Torvalds 2005-04-16 191 wraperr:
b412284b9698456 Greg Kroah-Hartman 2012-04-20 192 if (err < 0)
b412284b9698456 Greg Kroah-Hartman 2012-04-20 193 dev_err(&dev->dev,"%s - error loading firmware: error = %d\n",
b412284b9698456 Greg Kroah-Hartman 2012-04-20 194 __func__, err);
b412284b9698456 Greg Kroah-Hartman 2012-04-20 195
ae93a55bf948753 David Woodhouse 2008-05-30 196 release_firmware(loader_fw);
ae93a55bf948753 David Woodhouse 2008-05-30 197 release_firmware(bitstream_fw);
ae93a55bf948753 David Woodhouse 2008-05-30 198 release_firmware(firmware_fw);
ae93a55bf948753 David Woodhouse 2008-05-30 199
^1da177e4c3f415 Linus Torvalds 2005-04-16 200 return err;
^1da177e4c3f415 Linus Torvalds 2005-04-16 @201 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 202
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 58894 bytes --]
next prev parent reply other threads:[~2020-11-30 5:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 1:18 [PATCH v2 00/15] drivers: usb: misc: update to use usb_control_msg_{send|recv}() Anant Thazhemadam
2020-11-30 1:18 ` Anant Thazhemadam
2020-11-30 1:18 ` Anant Thazhemadam
2020-11-30 1:23 ` [PATCH v2 01/15] usb: misc: appledisplay: update to use the usb_control_msg_{send|recv}() API Anant Thazhemadam
2020-11-30 1:26 ` [PATCH v2 02/15] usb: misc: cypress_cy7c63: update to use usb_control_msg_recv() Anant Thazhemadam
2020-11-30 1:27 ` [PATCH v2 03/15] usb: misc: cytherm: " Anant Thazhemadam
2020-11-30 1:28 ` [PATCH v2 04/15] usb: misc: ehset: update to use the usb_control_msg_{send|recv}() API Anant Thazhemadam
2020-11-30 1:28 ` Anant Thazhemadam
2020-11-30 1:28 ` Anant Thazhemadam
2020-11-30 1:28 ` [PATCH v2 05/15] usb: misc: emi26: update to use usb_control_msg_send() Anant Thazhemadam
2020-11-30 5:37 ` kernel test robot [this message]
2020-11-30 5:37 ` kernel test robot
2020-12-04 14:41 ` Johan Hovold
2021-01-07 14:13 ` Anant Thazhemadam
2021-01-08 9:20 ` Johan Hovold
2020-11-30 1:29 ` [PATCH v2 06/15] usb: misc: emi62: " Anant Thazhemadam
2020-11-30 3:54 ` kernel test robot
2020-11-30 3:54 ` kernel test robot
2020-12-04 14:43 ` Johan Hovold
2020-11-30 1:29 ` [PATCH v2 07/15] usb: misc: ezusb: " Anant Thazhemadam
2020-11-30 1:30 ` [PATCH v2 08/15] usb: misc: idmouse: " Anant Thazhemadam
2020-12-04 14:46 ` Johan Hovold
2021-01-07 14:06 ` Anant Thazhemadam
2020-11-30 1:31 ` [PATCH v2 09/15] usb: misc: iowarrior: update to use the usb_control_msg_{send|recv}() API Anant Thazhemadam
2020-11-30 1:31 ` [PATCH v2 10/15] usb: misc: isight_firmware: update to use usb_control_msg_send() Anant Thazhemadam
2020-11-30 1:32 ` [PATCH v2 11/15] usb: misc: ldusb: " Anant Thazhemadam
2020-11-30 1:32 ` [PATCH v2 12/15] usb: misc: lvstest: update to use the usb_control_msg_{send|recv}() API Anant Thazhemadam
2020-11-30 1:33 ` [PATCH v2 13/15] usb: misc: trancevibrator: update to use usb_control_msg_send() Anant Thazhemadam
2020-11-30 1:33 ` [PATCH v2 14/15] usb: misc: usbsevseg: " Anant Thazhemadam
2020-11-30 1:34 ` [PATCH v2 15/15] usb: misc: usbtest: update to use the usb_control_msg_{send|recv}() API Anant Thazhemadam
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=202011301341.OpQJ5zR4-lkp@intel.com \
--to=lkp@intel.com \
--cc=anant.thazhemadam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.