Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2767378lqz; Wed, 3 Apr 2024 08:06:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFOoxNA8OHyYziwEzcn4hS/bRGHgznStP+4CDJtYjlnt0u+jWf2ZIeSsIxoDPLIyVJ7eimhT0KxpLPqgihsP4OEA80ugSRX8TOqpqATg== X-Google-Smtp-Source: AGHT+IHCoybPQP/nJPZJ0+KGFeC0CAEuJe7kmCeRasGg613chojyU+204KYpFZE1qJRCBUprW4HW X-Received: by 2002:a67:f2d0:0:b0:478:46db:6222 with SMTP id a16-20020a67f2d0000000b0047846db6222mr14128467vsn.24.1712156769524; Wed, 03 Apr 2024 08:06:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712156769; cv=pass; d=google.com; s=arc-20160816; b=Csc3F/Xx/A54FqglfDX8v7oIsyP4PP/v500JBTePLmCQ59zVAXja0oGhftUXr5VJ1M l3Iy1V6+2xsoHqzr+sQCBhwQSv81KUBH7yRNeEt/Z0GnBuNu2bJ/R9eN0dF99A291ui/ R4j6JGrd2Jv/v3Wi0Gi0YQJSf91pgEKwMcq/Rkvxl2bcYwrwPn4+ThYwFP76UWWavJWw Q/A0rUEwkbiB/mT6AGPhod8eCFKDJ3bht5do/wuW2ZH1KkqaMOcWcYRaIOoEyP/mf6Ze KLfTzM1Z8oTLHUUNnXm3ay9DrO37bf0yqTUNnnR8vj2ArJq4Q+xEM6GZUkGJqiP19Wr/ 7oxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=4HK4/miNnJq7CYq44ZkiuwwHjBixcP9cHfRzM+l+ZEU=; fh=g5n4jK8Ps6+bl1WYsw51mpIjS3Bdi616f7AVPKEiYc4=; b=oY/4+SiFbLn6+VVXyU+o8xdH/z32At6t2AVt7pnKZYn5RqrwW2IOnnZF05KyWy2CnS ZbQQtee2mS+hDwhYM9kx/2R3lo9dsFLUZIrMOWjNwuXCGBnETmjaUvMjNwzDWpirydtg D39nkGjX7FvbmIgcD0VVqFIbyutadKn8VBu46rvB+xFw+p3/KOpi4KnpXFwMNDQ4rb8Z GARkKrY37DhHCx1HRatlD6aDgzHB+dxbyeOIW950l14O15rMKscYivnQA188lbFEyWzG wj0hvBKn86sf1qPbaCRQUVBX50H/2lLfN4d6DegioKfava0cvnuydOTbKvvKYkUGRAPn e0Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L14dHMoT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-130021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ih6-20020a0561022d0600b00476e77b67adsi2157176vsb.171.2024.04.03.08.06.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:06:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L14dHMoT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-130021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 463761C27B18 for ; Wed, 3 Apr 2024 15:02:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B231614A612; Wed, 3 Apr 2024 15:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L14dHMoT" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4630514A4E4 for ; Wed, 3 Apr 2024 15:02:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156531; cv=none; b=k7AMrQvuxzNTKaF9VrgmbcHuJLsFhb2gZiYFEwsFDh8LJgQrZsijw08I8JxZX4ciGusD2j3TlHijVwWc7raTQi448WX7zVp8o8CDOz5avm2A1j5Sd3RG19Exz6nZiPTAGgKRhLW/sIAZpxy7Hwg1j6zNFTZqxYUpcUKu4HnjAgk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156531; c=relaxed/simple; bh=ioFvbQBkOvvRJTerHaz3kt8URF8buDZfWEZ3pwNg3io=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-type; b=ntmZJWRyG5Rltw5WJkvUMuHa4PY/9+NTvop8kYWgTBqmhHt2eaRs0GQuDFNxqqKxz0WgrqPcuJKsJwRCgfLbnxlXoM1t+Fb46ERZ1md5QkTwWCGHDiXsuB+7VCJhpPB69IDXhHpbt4JJtXUx2U0ST6fVQZMR6H03cnvNY4DKKF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=L14dHMoT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712156528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4HK4/miNnJq7CYq44ZkiuwwHjBixcP9cHfRzM+l+ZEU=; b=L14dHMoTbFHhEo2emSf+DQRQAzhg61t0gAFNv3uUOItmnW9g7n48OaLSWOP7AQNEYc3Rsn 95Eq5NdfHBjhjxfpnTdEqK5FsL4rK77n0G0JAeenNm6dZRN9NpPUDOry/nc4chDuLfTT5j ld4zAAQ4L82KbyzZVo8RibxlRWF5VGM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-271-xewL20k3PRaqkTCkhOTtrw-1; Wed, 03 Apr 2024 11:02:03 -0400 X-MC-Unique: xewL20k3PRaqkTCkhOTtrw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1049A1C07F38; Wed, 3 Apr 2024 15:02:03 +0000 (UTC) Received: from jmeneghi.bos.com (unknown [10.18.25.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFFB71121306; Wed, 3 Apr 2024 15:02:02 +0000 (UTC) From: John Meneghini To: skashyap@marvell.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, guazhang@redhat.com, njavali@marvell.com Subject: [PATCH] scsi: qedf: make qedf_execute_tmf non-preemptible Date: Wed, 3 Apr 2024 11:01:55 -0400 Message-Id: <20240403150155.412954-1-jmeneghi@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Stop calling smp_processor_id from preemptible code in qedf_execute_tmf. This results in BUGON when running an RT kernel. [ 659.343280] BUG: using smp_processor_id() in preemptible [00000000] code: sg_reset/3646 [ 659.343282] caller is qedf_execute_tmf+0x8b/0x360 [qedf] Tested-by: Guangwu Zhang Cc: Saurav Kashyap Cc: Nilesh Javali Signed-off-by: John Meneghini --- drivers/scsi/qedf/qedf_io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index bf921caaf6ae..054a51713d55 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -2324,9 +2324,6 @@ static int qedf_execute_tmf(struct qedf_rport *fcport, u64 tm_lun, io_req->fcport = fcport; io_req->cmd_type = QEDF_TASK_MGMT_CMD; - /* Record which cpu this request is associated with */ - io_req->cpu = smp_processor_id(); - /* Set TM flags */ io_req->io_req_flags = QEDF_READ; io_req->data_xfer_len = 0; @@ -2349,6 +2346,9 @@ static int qedf_execute_tmf(struct qedf_rport *fcport, u64 tm_lun, spin_lock_irqsave(&fcport->rport_lock, flags); + /* Record which cpu this request is associated with */ + io_req->cpu = smp_processor_id(); + sqe_idx = qedf_get_sqe_idx(fcport); sqe = &fcport->sq[sqe_idx]; memset(sqe, 0, sizeof(struct fcoe_wqe)); -- 2.39.3