From patchwork Sat Dec 23 18:16:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 182989 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1808010dyi; Sat, 23 Dec 2023 10:17:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPw5ehiN3ZLemGCqK9r4fR6F3E7tzw7PrAVmKr4T7H/4ZUjiv/fXgfhas1+hbr6h/0+oSy X-Received: by 2002:a05:600c:2a8d:b0:405:1c19:b747 with SMTP id x13-20020a05600c2a8d00b004051c19b747mr1565557wmd.15.1703355433620; Sat, 23 Dec 2023 10:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703355433; cv=none; d=google.com; s=arc-20160816; b=ExZ2TbKJ/OMmHrHUS2FAOjq/rLNrSVZXC9jdVsNiHWRtVm/07mvwLJzz3da6rALOyP 7EFEOaswm1G7xRoDXQ/QgCDBZtLrlri1PG1Ul46WTiFBEaqqSYe8N5e8tU0WMPtUzMXZ 5M8tzv0naOT9qHdIkb4ReP2DIdZSpqIULxJd5ZKqrVDQBw20O8qCcniJylbdtxEjgHQq TiUiVk1PXWA6pE9EMOWr7+f5OS/tPe9P27gDJQwvRGy5rkBOUWlY4t4LPQ3C0AMxJx94 oxKGDZczOVg4YiTjAeiKT6eD0xMvM1bUJH+Yy6o1+N20158hEWaXDMocqDlSaelOlR4X sKew== ARC-Message-Signature: i=1; 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:user-agent:date:cc:to:from :subject:message-id:dkim-signature:dkim-signature; bh=RlgDmWrhoJmdhDpeMUomMpfPknVtGvfiyyG4Aq21Ois=; fh=bF6hBOtsqZ0IG+YnlrEaFQ/qkylncIJARoC6oO9o4Qw=; b=vsASsyBIVZlQcbt4x6A0fIjquDNdNZbZnfT8daj4DQIbOMDbFHgEcRqfVqI41v4JM8 KPhd4JcoksG8frnW0vwQ+r2Sdt2y/IvgfMeG+qYKwRCrYfLYtRLG03i2GFqD1UB9V2sB ldu5hFGZlSxUZhKKvlXEH0V/GmTuu39/iJOKMyiThAtc27mgFrrZuRO+Bhvj/E0j5hbC Qx12Xu1VF5I6dVOmx2JI5pXzOCyhEmMRYxmcrse3CEFVw6cRfRqh77Oc3Oasd0azsGP6 bVGZhHpPyLAJFpAol1nq47Xm0VCB/R5Xa3Xywc2CgX6m/2rWMsaUTxJKPy2U2Ub3ZGzA uGug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=WXXRUbIZ; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=WXXRUbIZ; spf=pass (google.com: domain of linux-kernel+bounces-10532-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10532-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j16-20020a170906535000b00a1c936d2773si3065850ejo.800.2023.12.23.10.17.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 10:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10532-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=WXXRUbIZ; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=WXXRUbIZ; spf=pass (google.com: domain of linux-kernel+bounces-10532-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10532-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3F7861F21F3D for ; Sat, 23 Dec 2023 18:17:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E08CE13FF4; Sat, 23 Dec 2023 18:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="WXXRUbIZ"; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="WXXRUbIZ" X-Original-To: linux-kernel@vger.kernel.org Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [96.44.175.130]) (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 1759812E47; Sat, 23 Dec 2023 18:16:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=HansenPartnership.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=HansenPartnership.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1703355412; bh=/rADMDxldZcxvEJb9SiQ4SNFYDlRD3i/SqPgSM0FTas=; h=Message-ID:Subject:From:To:Date:From; b=WXXRUbIZLT1ZV31OWX6yHHg3SvDPlCug2WQvNojgK7B6DRnTUGHnRe/c7tmHtJzxB ShrK2uCiyXcZL5FGcoPpdukweHBJFLblJ6BnI5usTlBOyMhMDZ7rA9OospWCo5HMQy e3Jr+XFcryMmVbGpYmG4H36iqgb7OmRO5wDxQVLU= Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 2AE3A1286197; Sat, 23 Dec 2023 13:16:52 -0500 (EST) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavis, port 10024) with ESMTP id k9YNN6b6E4tx; Sat, 23 Dec 2023 13:16:52 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1703355412; bh=/rADMDxldZcxvEJb9SiQ4SNFYDlRD3i/SqPgSM0FTas=; h=Message-ID:Subject:From:To:Date:From; b=WXXRUbIZLT1ZV31OWX6yHHg3SvDPlCug2WQvNojgK7B6DRnTUGHnRe/c7tmHtJzxB ShrK2uCiyXcZL5FGcoPpdukweHBJFLblJ6BnI5usTlBOyMhMDZ7rA9OospWCo5HMQy e3Jr+XFcryMmVbGpYmG4H36iqgb7OmRO5wDxQVLU= Received: from lingrow.int.hansenpartnership.com (unknown [IPv6:2601:5c4:4302:c21::a774]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 776A112860E8; Sat, 23 Dec 2023 13:16:51 -0500 (EST) Message-ID: <03b579bec43c7bcdeb4eed7ded859c92f4035461.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 6.7-rc6 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Sat, 23 Dec 2023 13:16:49 -0500 User-Agent: Evolution 3.42.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786097627339267476 X-GMAIL-MSGID: 1786097627339267476 Four small fixes, three in drivers with the core one adding a batch indicator (for drivers which use it) to the error handler. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Alexander Atanasov (1): scsi: core: Always send batch on reset or error handling command Can Guo (1): scsi: ufs: core: Let the sq_lock protect sq_tail_slot access ChanWoo Lee (1): scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify() Wei Yongjun (1): scsi: bnx2fc: Fix skb double free in bnx2fc_rcv() And the diffstat: drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 9 +++------ drivers/scsi/scsi_error.c | 2 ++ drivers/ufs/core/ufshcd.c | 3 ++- drivers/ufs/host/ufs-qcom.c | 6 ++++-- 4 files changed, 11 insertions(+), 9 deletions(-) With full diff below. James diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 05ddbb9bb7d8..451a58e0fd96 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -429,7 +429,6 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev, struct fcoe_ctlr *ctlr; struct fcoe_rcv_info *fr; struct fcoe_percpu_s *bg; - struct sk_buff *tmp_skb; interface = container_of(ptype, struct bnx2fc_interface, fcoe_packet_type); @@ -441,11 +440,9 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev, goto err; } - tmp_skb = skb_share_check(skb, GFP_ATOMIC); - if (!tmp_skb) - goto err; - - skb = tmp_skb; + skb = skb_share_check(skb, GFP_ATOMIC); + if (!skb) + return -1; if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) { printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n"); diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index c67cdcdc3ba8..1223d34c04da 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1152,6 +1152,7 @@ static enum scsi_disposition scsi_send_eh_cmnd(struct scsi_cmnd *scmd, scsi_log_send(scmd); scmd->submitter = SUBMITTED_BY_SCSI_ERROR_HANDLER; + scmd->flags |= SCMD_LAST; /* * Lock sdev->state_mutex to avoid that scsi_device_quiesce() can @@ -2459,6 +2460,7 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) scsi_init_command(dev, scmd); scmd->submitter = SUBMITTED_BY_SCSI_RESET_IOCTL; + scmd->flags |= SCMD_LAST; memset(&scmd->sdb, 0, sizeof(scmd->sdb)); scmd->cmd_len = 0; diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index bce0d2a9a7f3..16d76325039a 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -2274,9 +2274,10 @@ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag, if (is_mcq_enabled(hba)) { int utrd_size = sizeof(struct utp_transfer_req_desc); struct utp_transfer_req_desc *src = lrbp->utr_descriptor_ptr; - struct utp_transfer_req_desc *dest = hwq->sqe_base_addr + hwq->sq_tail_slot; + struct utp_transfer_req_desc *dest; spin_lock(&hwq->sq_lock); + dest = hwq->sqe_base_addr + hwq->sq_tail_slot; memcpy(dest, src, utrd_size); ufshcd_inc_sq_tail(hwq); spin_unlock(&hwq->sq_lock); diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 96cb8b5b4e66..17e24270477d 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -1516,9 +1516,11 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, err = ufs_qcom_clk_scale_up_pre_change(hba); else err = ufs_qcom_clk_scale_down_pre_change(hba); - if (err) - ufshcd_uic_hibern8_exit(hba); + if (err) { + ufshcd_uic_hibern8_exit(hba); + return err; + } } else { if (scale_up) err = ufs_qcom_clk_scale_up_post_change(hba);