lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFrsMxyD5ASGmsQ8658eBR0vHOSUqJ4axuSpAXuue6d5Uw@mail.gmail.com>
Date: Fri, 17 Oct 2025 11:11:05 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Bean Huo <huobean@...il.com>
Cc: kernel test robot <lkp@...el.com>, avri.altman@....com, avri.altman@...disk.com, 
	bvanassche@....org, alim.akhtar@...sung.com, jejb@...ux.ibm.com, 
	martin.petersen@...cle.com, can.guo@....qualcomm.com, beanhuo@...ron.com, 
	jens.wiklander@...aro.org, oe-kbuild-all@...ts.linux.dev, 
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 3/3] scsi: ufs: core: Add OP-TEE based RPMB driver for
 UFS devices

On Fri, 10 Oct 2025 at 10:19, Bean Huo <huobean@...il.com> wrote:
>
>
> since the patch "rpmb: move rpmb_frame struct and constants to common header"
> has been queued in mmc git tree, I didn't add it patch in scsi tree for this
> version:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git/commit/?h=next
>
>
> do I need to add this queued patch for scsi tree as well?

I have just sent the patch to Linus to get included in rc2. Sorry, I
failed to send it for rc1.

That said, if you re-spin a version of the series that is based on rc2
on Monday that should work, I think.

Kind regards
Uffe

>
>
> Kind regards,
> Bean
>
>
> On Fri, 2025-10-10 at 05:36 +0800, kernel test robot wrote:
> > Hi Bean,
> >
> > kernel test robot noticed the following build errors:
> >
> > [auto build test ERROR on v6.17]
> > [also build test ERROR on next-20251009]
> > [cannot apply to mkp-scsi/for-next jejb-scsi/for-next char-misc/char-misc-
> > testing char-misc/char-misc-next char-misc/char-misc-linus linus/master]
> > [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#_base_tree_information]
> >
> > url:
> > https://github.com/intel-lab-lkp/linux/commits/Bean-Huo/scsi-ufs-core-Convert-string-descriptor-format-macros-to-enum/20251009-204745
> > base:   v6.17
> > patch link:
> > https://lore.kernel.org/r/20251008201920.89575-4-beanhuo%40iokpp.de
> > patch subject: [PATCH v4 3/3] scsi: ufs: core: Add OP-TEE based RPMB driver
> > for UFS devices
> > config: sh-randconfig-002-20251010
> > (https://download.01.org/0day-ci/archive/20251010/202510100521.pnAPqTFK-lkp@in
> > tel.com/config)
> > compiler: sh4-linux-gcc (GCC) 15.1.0
> > reproduce (this is a W=1 build):
> > (https://download.01.org/0day-ci/archive/20251010/202510100521.pnAPqTFK-lkp@in
> > tel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version
> > of
> > the same patch/commit), kindly add following tags
> > > Reported-by: kernel test robot <lkp@...el.com>
> > > Closes:
> > > https://lore.kernel.org/oe-kbuild-all/202510100521.pnAPqTFK-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> >    In file included from include/linux/byteorder/big_endian.h:5,
> >                     from arch/sh/include/uapi/asm/byteorder.h:8,
> >                     from arch/sh/include/asm/bitops.h:10,
> >                     from include/linux/bitops.h:67,
> >                     from include/linux/log2.h:12,
> >                     from include/asm-generic/div64.h:55,
> >                     from ./arch/sh/include/generated/asm/div64.h:1,
> >                     from include/linux/math.h:6,
> >                     from include/linux/math64.h:6,
> >                     from include/linux/time.h:6,
> >                     from include/linux/stat.h:19,
> >                     from include/linux/module.h:13,
> >                     from drivers/ufs/core/ufs-rpmb.c:13:
> >    drivers/ufs/core/ufs-rpmb.c: In function 'ufs_rpmb_route_frames':
> >    drivers/ufs/core/ufs-rpmb.c:72:39: error: invalid use of undefined type
> > 'struct rpmb_frame'
> >       72 |         req_type = be16_to_cpu(frm_out->req_resp);
> >          |                                       ^~
> >    include/uapi/linux/byteorder/big_endian.h:43:51: note: in definition of
> > macro '__be16_to_cpu'
> >       43 | #define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
> >          |                                                   ^
> >    drivers/ufs/core/ufs-rpmb.c:72:20: note: in expansion of macro
> > 'be16_to_cpu'
> >       72 |         req_type = be16_to_cpu(frm_out->req_resp);
> >          |                    ^~~~~~~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:75:14: error: 'RPMB_PROGRAM_KEY' undeclared
> > (first use in this function)
> >       75 |         case RPMB_PROGRAM_KEY:
> >          |              ^~~~~~~~~~~~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:75:14: note: each undeclared identifier is
> > reported only once for each function it appears in
> >    drivers/ufs/core/ufs-rpmb.c:76:39: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       76 |                 if (req_len != sizeof(struct rpmb_frame) ||
> > resp_len != sizeof(struct rpmb_frame))
> >          |                                       ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:76:80: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       76 |                 if (req_len != sizeof(struct rpmb_frame) ||
> > resp_len != sizeof(struct rpmb_frame))
> >
> > |
> >    ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:79:14: error: 'RPMB_GET_WRITE_COUNTER'
> > undeclared (first use in this function)
> >       79 |         case RPMB_GET_WRITE_COUNTER:
> >          |              ^~~~~~~~~~~~~~~~~~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:80:39: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       80 |                 if (req_len != sizeof(struct rpmb_frame) ||
> > resp_len != sizeof(struct rpmb_frame))
> >          |                                       ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:80:80: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       80 |                 if (req_len != sizeof(struct rpmb_frame) ||
> > resp_len != sizeof(struct rpmb_frame))
> >
> > |
> >    ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:84:14: error: 'RPMB_WRITE_DATA' undeclared
> > (first use in this function)
> >       84 |         case RPMB_WRITE_DATA:
> >          |              ^~~~~~~~~~~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:85:38: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       85 |                 if (req_len % sizeof(struct rpmb_frame) || resp_len
> > != sizeof(struct rpmb_frame))
> >          |                                      ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:85:79: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       85 |                 if (req_len % sizeof(struct rpmb_frame) || resp_len
> > != sizeof(struct rpmb_frame))
> >
> > |
> >   ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:88:14: error: 'RPMB_READ_DATA' undeclared
> > (first use in this function); did you mean 'D_REAL_DATA'?
> >       88 |         case RPMB_READ_DATA:
> >          |              ^~~~~~~~~~~~~~
> >          |              D_REAL_DATA
> >    drivers/ufs/core/ufs-rpmb.c:89:39: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       89 |                 if (req_len != sizeof(struct rpmb_frame) ||
> > resp_len % sizeof(struct rpmb_frame))
> >          |                                       ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:89:79: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >       89 |                 if (req_len != sizeof(struct rpmb_frame) ||
> > resp_len % sizeof(struct rpmb_frame))
> >
> > |
> >   ^~~~~~
> >    drivers/ufs/core/ufs-rpmb.c:109:43: error: invalid application of 'sizeof'
> > to incomplete type 'struct rpmb_frame'
> >      109 |                 memset(frm_resp, 0, sizeof(*frm_resp));
> >          |                                           ^
> >    drivers/ufs/core/ufs-rpmb.c:110:25: error: invalid use of undefined type
> > 'struct rpmb_frame'
> >      110 |                 frm_resp->req_resp = cpu_to_be16(RPMB_RESULT_READ);
> >          |                         ^~
> >    drivers/ufs/core/ufs-rpmb.c:110:50: error: 'RPMB_RESULT_READ' undeclared
> > (first use in this function)
> >      110 |                 frm_resp->req_resp = cpu_to_be16(RPMB_RESULT_READ);
> >          |                                                  ^~~~~~~~~~~~~~~~
> >    include/uapi/linux/byteorder/big_endian.h:42:51: note: in definition of
> > macro '__cpu_to_be16'
> >       42 | #define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
> >          |                                                   ^
> >    drivers/ufs/core/ufs-rpmb.c:110:38: note: in expansion of macro
> > 'cpu_to_be16'
> >      110 |                 frm_resp->req_resp = cpu_to_be16(RPMB_RESULT_READ);
> >          |                                      ^~~~~~~~~~~
> >    drivers/ufs/core/ufs-rpmb.c: At top level:
> > > > drivers/ufs/core/ufs-rpmb.c:135:5: error: redefinition of 'ufs_rpmb_probe'
> >      135 | int ufs_rpmb_probe(struct ufs_hba *hba)
> >          |     ^~~~~~~~~~~~~~
> >    In file included from drivers/ufs/core/ufs-rpmb.c:22:
> >    drivers/ufs/core/ufshcd-priv.h:424:19: note: previous definition of
> > 'ufs_rpmb_probe' with type 'int(struct ufs_hba *)'
> >      424 | static inline int ufs_rpmb_probe(struct ufs_hba *hba)
> >          |                   ^~~~~~~~~~~~~~
> > > > drivers/ufs/core/ufs-rpmb.c:229:6: error: redefinition of
> > > > 'ufs_rpmb_remove'
> >      229 | void ufs_rpmb_remove(struct ufs_hba *hba)
> >          |      ^~~~~~~~~~~~~~~
> >    drivers/ufs/core/ufshcd-priv.h:428:20: note: previous definition of
> > 'ufs_rpmb_remove' with type 'void(struct ufs_hba *)'
> >      428 | static inline void ufs_rpmb_remove(struct ufs_hba *hba)
> >          |                    ^~~~~~~~~~~~~~~
> >
> >
> > vim +/ufs_rpmb_probe +135 drivers/ufs/core/ufs-rpmb.c
> >
> >    133
> >    134  /* UFS RPMB device registration */
> >  > 135  int ufs_rpmb_probe(struct ufs_hba *hba)
> >    136  {
> >    137          struct ufs_rpmb_dev *ufs_rpmb, *it, *tmp;
> >    138          struct rpmb_dev *rdev;
> >    139          u8 cid[16] = { };
> >    140          int region;
> >    141          u8 *sn;
> >    142          u32 cap;
> >    143          int ret;
> >    144
> >    145          if (!hba->ufs_rpmb_wlun || hba->dev_info.b_advanced_rpmb_en) {
> >    146                  dev_info(hba->dev, "Skip OP-TEE RPMB registration\n");
> >    147                  return -ENODEV;
> >    148          }
> >    149
> >    150          /* Get the UNICODE serial number data */
> >    151          sn = hba->dev_info.serial_number;
> >    152          if (!sn) {
> >    153                  dev_err(hba->dev, "Serial number not available\n");
> >    154                  return -EINVAL;
> >    155          }
> >    156
> >    157          INIT_LIST_HEAD(&hba->rpmbs);
> >    158
> >    159          /* Copy serial number into device ID (max 15 chars + NUL). */
> >    160          strscpy(cid, sn);
> >    161
> >    162          struct rpmb_descr descr = {
> >    163                  .type = RPMB_TYPE_UFS,
> >    164                  .route_frames = ufs_rpmb_route_frames,
> >    165                  .dev_id_len = sizeof(cid),
> >    166                  .reliable_wr_count = hba->dev_info.rpmb_io_size,
> >    167          };
> >    168
> >    169          for (region = 0; region < ARRAY_SIZE(hba-
> > >dev_info.rpmb_region_size); region++) {
> >    170                  cap = hba->dev_info.rpmb_region_size[region];
> >    171                  if (!cap)
> >    172                          continue;
> >    173
> >    174                  ufs_rpmb = devm_kzalloc(hba->dev, sizeof(*ufs_rpmb),
> > GFP_KERNEL);
> >    175                  if (!ufs_rpmb) {
> >    176                          ret = -ENOMEM;
> >    177                          goto err_out;
> >    178                  }
> >    179
> >    180                  ufs_rpmb->hba = hba;
> >    181                  ufs_rpmb->dev.parent = &hba->ufs_rpmb_wlun-
> > >sdev_gendev;
> >    182                  ufs_rpmb->dev.bus = &ufs_rpmb_bus_type;
> >    183                  ufs_rpmb->dev.release = ufs_rpmb_device_release;
> >    184                  dev_set_name(&ufs_rpmb->dev, "ufs_rpmb%d", region);
> >    185
> >    186                  /* Set driver data BEFORE device_register */
> >    187                  dev_set_drvdata(&ufs_rpmb->dev, ufs_rpmb);
> >    188
> >    189                  ret = device_register(&ufs_rpmb->dev);
> >    190                  if (ret) {
> >    191                          dev_err(hba->dev, "Failed to register UFS RPMB
> > device %d\n", region);
> >    192                          put_device(&ufs_rpmb->dev);
> >    193                          goto err_out;
> >    194                  }
> >    195
> >    196                  /* Make CID unique for this region by appending region
> > numbe */
> >    197                  cid[sizeof(cid) - 1] = region;
> >    198                  descr.dev_id = cid;
> >    199                  descr.capacity = cap;
> >    200
> >    201                  /* Register RPMB device */
> >    202                  rdev = rpmb_dev_register(&ufs_rpmb->dev, &descr);
> >    203                  if (IS_ERR(rdev)) {
> >    204                          dev_err(hba->dev, "Failed to register UFS RPMB
> > device.\n");
> >    205                          device_unregister(&ufs_rpmb->dev);
> >    206                          ret = PTR_ERR(rdev);
> >    207                          goto err_out;
> >    208                  }
> >    209
> >    210                  ufs_rpmb->rdev = rdev;
> >    211                  ufs_rpmb->region_id = region;
> >    212
> >    213                  list_add_tail(&ufs_rpmb->node, &hba->rpmbs);
> >    214
> >    215                  dev_info(hba->dev, "UFS RPMB region %d registered
> > (capacity=%u)\n", region, cap);
> >    216          }
> >    217
> >    218          return 0;
> >    219  err_out:
> >    220          list_for_each_entry_safe(it, tmp, &hba->rpmbs, node) {
> >    221                  list_del(&it->node);
> >    222                  device_unregister(&it->dev);
> >    223          }
> >    224
> >    225          return ret;
> >    226  }
> >    227
> >    228  /* UFS RPMB remove handler */
> >  > 229  void ufs_rpmb_remove(struct ufs_hba *hba)
> >    230  {
> >    231          struct ufs_rpmb_dev *ufs_rpmb, *tmp;
> >    232
> >    233          if (list_empty(&hba->rpmbs))
> >    234                  return;
> >    235
> >    236          /* Remove all registered RPMB devices */
> >    237          list_for_each_entry_safe(ufs_rpmb, tmp, &hba->rpmbs, node) {
> >    238                  dev_info(hba->dev, "Removing UFS RPMB region %d\n",
> > ufs_rpmb->region_id);
> >    239                  /* Remove from list first */
> >    240                  list_del(&ufs_rpmb->node);
> >    241                  /* Unregister device */
> >    242                  device_unregister(&ufs_rpmb->dev);
> >    243          }
> >    244
> >    245          dev_info(hba->dev, "All UFS RPMB devices unregistered\n");
> >    246  }
> >    247
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ