Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chaohai Chen <wdhh6@aliyun.com>,
	john.g.garry@oracle.com, yanaijie@huawei.com,
	James.Bottomley@hansenpartnership.com,
	martin.petersen@oracle.com
Cc: oe-kbuild-all@lists.linux.dev, dlemoal@kernel.org,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: libsas: Add error handling in the sas_register_phys()
Date: Sat, 6 Dec 2025 12:32:59 +0800	[thread overview]
Message-ID: <202512061205.azqGXDZt-lkp@intel.com> (raw)
In-Reply-To: <20251205080252.1020028-1-wdhh6@aliyun.com>

Hi Chaohai,

kernel test robot noticed the following build errors:

[auto build test ERROR on jejb-scsi/for-next]
[also build test ERROR on mkp-scsi/for-next linus/master v6.18 next-20251205]
[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/Chaohai-Chen/scsi-libsas-Add-error-handling-in-the-sas_register_phys/20251205-174712
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
patch link:    https://lore.kernel.org/r/20251205080252.1020028-1-wdhh6%40aliyun.com
patch subject: [PATCH] scsi: libsas: Add error handling in the sas_register_phys()
config: parisc-randconfig-002-20251206 (https://download.01.org/0day-ci/archive/20251206/202512061205.azqGXDZt-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251206/202512061205.azqGXDZt-lkp@intel.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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512061205.azqGXDZt-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/scsi/libsas/sas_phy.c: In function 'sas_register_phys':
>> drivers/scsi/libsas/sas_phy.c:165:30: error: passing argument 1 of 'sas_phy_free' from incompatible pointer type [-Wincompatible-pointer-types]
     165 |                 sas_phy_free(phy);
         |                              ^~~
         |                              |
         |                              struct asd_sas_phy *
   In file included from drivers/scsi/libsas/sas_internal.h:14,
                    from drivers/scsi/libsas/sas_phy.c:9:
   include/scsi/scsi_transport_sas.h:192:26: note: expected 'struct sas_phy *' but argument is of type 'struct asd_sas_phy *'
     192 | extern void sas_phy_free(struct sas_phy *);
         |                          ^~~~~~~~~~~~~~~~


vim +/sas_phy_free +165 drivers/scsi/libsas/sas_phy.c

   115	
   116	int sas_register_phys(struct sas_ha_struct *sas_ha)
   117	{
   118		int i;
   119		int ret = 0;
   120	
   121		/* Now register the phys. */
   122		for (i = 0; i < sas_ha->num_phys; i++) {
   123			struct asd_sas_phy *phy = sas_ha->sas_phy[i];
   124	
   125			phy->error = 0;
   126			atomic_set(&phy->event_nr, 0);
   127			INIT_LIST_HEAD(&phy->port_phy_el);
   128	
   129			phy->port = NULL;
   130			phy->ha = sas_ha;
   131			spin_lock_init(&phy->frame_rcvd_lock);
   132			spin_lock_init(&phy->sas_prim_lock);
   133			phy->frame_rcvd_size = 0;
   134	
   135			phy->phy = sas_phy_alloc(&sas_ha->shost->shost_gendev, i);
   136			if (!phy->phy) {
   137				ret = -ENOMEM;
   138				goto fail;
   139			}
   140	
   141			phy->phy->identify.initiator_port_protocols =
   142				phy->iproto;
   143			phy->phy->identify.target_port_protocols = phy->tproto;
   144			phy->phy->identify.sas_address = SAS_ADDR(sas_ha->sas_addr);
   145			phy->phy->identify.phy_identifier = i;
   146			phy->phy->minimum_linkrate_hw = SAS_LINK_RATE_UNKNOWN;
   147			phy->phy->maximum_linkrate_hw = SAS_LINK_RATE_UNKNOWN;
   148			phy->phy->minimum_linkrate = SAS_LINK_RATE_UNKNOWN;
   149			phy->phy->maximum_linkrate = SAS_LINK_RATE_UNKNOWN;
   150			phy->phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN;
   151	
   152			ret = sas_phy_add(phy->phy);
   153			if (ret) {
   154				sas_phy_free(phy->phy);
   155				goto fail;
   156			}
   157		}
   158	
   159		return 0;
   160	fail:
   161		for (i--; i >= 0; i--) {
   162			struct asd_sas_phy *phy = sas_ha->sas_phy[i];
   163	
   164			sas_phy_delete(phy->phy);
 > 165			sas_phy_free(phy);
   166		}
   167		return ret;
   168	}
   169	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2025-12-06  4:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05  8:02 [PATCH] scsi: libsas: Add error handling in the sas_register_phys() Chaohai Chen
2025-12-05  8:27 ` Damien Le Moal
2025-12-05  9:52 ` Jason Yan
2025-12-06  4:32 ` kernel test robot [this message]
2025-12-06  7:39 ` kernel test robot

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=202512061205.azqGXDZt-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=dlemoal@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=wdhh6@aliyun.com \
    --cc=yanaijie@huawei.com \
    /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