All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: JiangJianJun <jiangjianjun3@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH v4 8/9] scsi: scsi_error: Add a general LUN based error handler
Date: Sun, 14 Sep 2025 19:59:09 +0800	[thread overview]
Message-ID: <202509141933.GikctXJJ-lkp@intel.com> (raw)
In-Reply-To: <20250914104145.2239901-9-jiangjianjun3@huawei.com>

Hi JiangJianJun,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on jejb-scsi/for-next]
[also build test WARNING on mkp-scsi/for-next linus/master v6.17-rc5 next-20250912]
[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/JiangJianJun/scsi-scsi_error-Define-framework-for-LUN-based-error-handle/20250914-181340
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
patch link:    https://lore.kernel.org/r/20250914104145.2239901-9-jiangjianjun3%40huawei.com
patch subject: [RFC PATCH v4 8/9] scsi: scsi_error: Add a general LUN based error handler
config: arc-randconfig-002-20250914 (https://download.01.org/0day-ci/archive/20250914/202509141933.GikctXJJ-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250914/202509141933.GikctXJJ-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/202509141933.GikctXJJ-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/scsi/scsi_error.c: In function 'sdev_eh_work':
>> drivers/scsi/scsi_error.c:2770:20: warning: unused variable 'shost' [-Wunused-variable]
    2770 |  struct Scsi_Host *shost = sdev->host;
         |                    ^~~~~


vim +/shost +2770 drivers/scsi/scsi_error.c

  2753	
  2754	/*
  2755	 * error handle strategy based on LUN, following steps
  2756	 * is applied to recovery error commands in list:
  2757	 *    check sense data
  2758	 *    send start unit
  2759	 *    reset lun
  2760	 * if there are still error commands, it would fallback to
  2761	 * host based error handler for further recovery.
  2762	 */
  2763	static void sdev_eh_work(struct work_struct *work)
  2764	{
  2765		unsigned long flags;
  2766		struct scsi_lun_eh *luneh =
  2767				container_of(work, struct scsi_lun_eh, eh_handle_work);
  2768		struct scsi_device *sdev = luneh->sdev;
  2769		struct scsi_device_eh *eh = sdev->eh;
> 2770		struct Scsi_Host *shost = sdev->host;
  2771		struct scsi_cmnd *scmd, *next;
  2772		LIST_HEAD(eh_work_q);
  2773		LIST_HEAD(eh_done_q);
  2774	
  2775		spin_lock_irqsave(&luneh->eh_lock, flags);
  2776		list_splice_init(&luneh->eh_cmd_q, &eh_work_q);
  2777		spin_unlock_irqrestore(&luneh->eh_lock, flags);
  2778	
  2779		if (scsi_sdev_eh(sdev, &eh_work_q, &eh_done_q))
  2780			goto out_flush_done;
  2781	
  2782		if (!luneh->fallback) {
  2783			list_for_each_entry_safe(scmd, next, &eh_work_q, eh_entry)
  2784				scsi_eh_finish_cmd(scmd, &eh_done_q);
  2785	
  2786			sdev_printk(KERN_INFO, sdev,
  2787				"%s:luneh: Device offlined - not ready after error recovery\n",
  2788				current->comm);
  2789	
  2790			mutex_lock(&sdev->state_mutex);
  2791			scsi_device_set_state(sdev, SDEV_OFFLINE);
  2792			mutex_unlock(&sdev->state_mutex);
  2793	
  2794			goto out_flush_done;
  2795		}
  2796	
  2797		/*
  2798		 * fallback to host based error handler
  2799		 */
  2800		SCSI_LOG_ERROR_RECOVERY(2, sdev_printk(KERN_INFO, sdev,
  2801			"%s:luneh fallback to further recovery\n", current->comm));
  2802		list_for_each_entry_safe(scmd, next, &eh_work_q, eh_entry) {
  2803			list_del_init(&scmd->eh_entry);
  2804			scsi_eh_scmd_add_shost(scmd);
  2805		}
  2806	
  2807		eh->get_sense_done = 1;
  2808		eh->stu_done = 1;
  2809		eh->reset_done = 1;
  2810	
  2811	out_flush_done:
  2812		scsi_eh_flush_done_q(&eh_done_q);
  2813		spin_lock_irqsave(&luneh->eh_lock, flags);
  2814		luneh->eh_num = 0;
  2815		spin_unlock_irqrestore(&luneh->eh_lock, flags);
  2816	}
  2817	static void sdev_eh_add_cmnd(struct scsi_cmnd *scmd)
  2818	{
  2819		unsigned long flags;
  2820		struct scsi_lun_eh *luneh;
  2821		struct scsi_device *sdev = scmd->device;
  2822	
  2823		luneh = scsi_eh_device_priv(sdev->eh);
  2824	
  2825		spin_lock_irqsave(&luneh->eh_lock, flags);
  2826		list_add_tail(&scmd->eh_entry, &luneh->eh_cmd_q);
  2827		luneh->eh_num++;
  2828		spin_unlock_irqrestore(&luneh->eh_lock, flags);
  2829	}
  2830	static bool sdev_eh_is_busy(struct scsi_device *sdev)
  2831	{
  2832		int ret = 0;
  2833		unsigned long flags;
  2834		struct scsi_lun_eh *luneh;
  2835	
  2836		if (!sdev->eh)
  2837			return false;
  2838	
  2839		luneh = scsi_eh_device_priv(sdev->eh);
  2840	
  2841		spin_lock_irqsave(&luneh->eh_lock, flags);
  2842		ret = luneh->eh_num;
  2843		spin_unlock_irqrestore(&luneh->eh_lock, flags);
  2844	
  2845		return ret != 0;
  2846	}
  2847	static void sdev_eh_wakeup(struct scsi_device *sdev)
  2848	{
  2849		unsigned long flags;
  2850		unsigned int nr_error;
  2851		unsigned int nr_busy;
  2852		struct scsi_lun_eh *luneh;
  2853	
  2854		luneh = scsi_eh_device_priv(sdev->eh);
  2855	
  2856		spin_lock_irqsave(&luneh->eh_lock, flags);
  2857		nr_error = luneh->eh_num;
  2858		spin_unlock_irqrestore(&luneh->eh_lock, flags);
  2859	
  2860		nr_busy = scsi_device_busy(sdev);
  2861	
  2862		if (!nr_error || nr_busy != nr_error) {
  2863			SCSI_LOG_ERROR_RECOVERY(5, sdev_printk(KERN_INFO, sdev,
  2864				"%s:luneh: do not wake up, busy/error: %d/%d\n",
  2865				current->comm, nr_busy, nr_error));
  2866			return;
  2867		}
  2868	
  2869		SCSI_LOG_ERROR_RECOVERY(2, sdev_printk(KERN_INFO, sdev,
  2870			"%s:luneh: waking up, busy/error: %d/%d\n",
  2871			current->comm, nr_busy, nr_error));
  2872	
  2873		schedule_work(&luneh->eh_handle_work);
  2874	}
  2875	

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

  reply	other threads:[~2025-09-14 12:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-16 11:24 [PATCH 00/14] scsi: scsi_error: Introduce new error handle mechanism JiangJianJun
2025-08-16 11:24 ` [PATCH 01/14] scsi: scsi_error: Define framework for LUN/target based error handle JiangJianJun
2025-08-16 11:24 ` [PATCH 02/14] scsi: scsi_error: Move complete variable eh_action from shost to sdevice JiangJianJun
2025-08-16 11:24 ` [PATCH 03/14] scsi: scsi_error: Check if to do reset in scsi_try_xxx_reset JiangJianJun
2025-08-16 11:24 ` [PATCH 04/14] scsi: scsi_error: Add helper scsi_eh_sdev_stu to do START_UNIT JiangJianJun
2025-08-16 11:24 ` [PATCH 05/14] scsi: scsi_error: Add helper scsi_eh_sdev_reset to do lun reset JiangJianJun
2025-08-16 11:24 ` [PATCH 06/14] scsi: scsi_error: Add flags to mark error handle steps has done JiangJianJun
2025-08-16 11:24 ` [PATCH 07/14] scsi: scsi_error: Add helper to handle scsi device's error command list JiangJianJun
2025-08-16 11:24 ` [PATCH 08/14] scsi: scsi_error: Add a general LUN based error handler JiangJianJun
2025-08-17  9:18   ` Markus Elfring
2025-08-16 11:24 ` [PATCH 09/14] scsi: core: increase/decrease target_busy if set " JiangJianJun
2025-08-16 11:24 ` [PATCH 10/14] scsi: scsi_error: Add helper to handle scsi target's error command list JiangJianJun
2025-08-16 23:19   ` kernel test robot
2025-08-17  2:46     ` JiangJianJun
2025-08-16 11:24 ` [PATCH 11/14] scsi: scsi_error: Add a general target based error handler JiangJianJun
2025-08-16 11:24 ` [PATCH 12/14] scsi: scsi_debug: Add params for configuring the " JiangJianJun
2025-08-16 11:24 ` [PATCH 13/14] scsi: virtio_scsi: enable LUN based error handlers JiangJianJun
2025-08-16 11:24 ` [PATCH 14/14] scsi: iscsi_tcp: enable LUN-based and target-based " JiangJianJun
2025-08-17  8:46 ` [PATCH 00/14] scsi: scsi_error: Introduce new error handle mechanism JiangJianJun
2025-08-20 12:36 ` Hannes Reinecke
2025-09-02  5:56   ` JiangJianJun
2025-09-02  6:37     ` Hannes Reinecke
2025-09-14 10:41   ` [RFC PATCH v4 0/9] " JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 1/9] scsi: scsi_error: Define framework for LUN based error handle JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 2/9] scsi: scsi_error: Move complete variable eh_action from shost to sdevice JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 3/9] scsi: scsi_error: Check if to do reset in scsi_try_xxx_reset JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 4/9] scsi: scsi_error: Add helper scsi_eh_sdev_stu to do START_UNIT JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 5/9] scsi: scsi_error: Add helper scsi_eh_sdev_reset to do lun reset JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 6/9] scsi: scsi_error: Add flags to mark error handle steps has done JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 7/9] scsi: scsi_error: Add helper to handle scsi device's error command list JiangJianJun
2025-09-14 10:41     ` [RFC PATCH v4 8/9] scsi: scsi_error: Add a general LUN based error handler JiangJianJun
2025-09-14 11:59       ` kernel test robot [this message]
2025-09-14 10:41     ` [RFC PATCH v4 9/9] scsi: scsi_debug: Add params for configuring the " JiangJianJun
2025-08-22  7:39 ` [PATCH 00/14] scsi: scsi_error: Introduce new error handle mechanism Damien Le Moal
2025-09-02  5:30   ` JiangJianJun
2025-09-02  5:08     ` Damien Le Moal
2025-09-02  6:03       ` JiangJianJun
2025-09-02  5:30         ` Damien Le Moal

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=202509141933.GikctXJJ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jiangjianjun3@huawei.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.