Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6293825pxb; Mon, 8 Nov 2021 06:24:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwp3n2Ub1NkYoNxXNLzuSlAmPQD6zJizZgrxLkrpDY5EoCFSMMQZNDRGrcUYgDvO5mP862M X-Received: by 2002:a17:907:96a6:: with SMTP id hd38mr242044ejc.47.1636381451268; Mon, 08 Nov 2021 06:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636381451; cv=none; d=google.com; s=arc-20160816; b=qK9U9PEorW8+y79a9TDuUq3Tn05cSnPJwrQUZY6m9IPWlDe04yZoqgryA6PDhXJQBB LwH8dIIjca2HTazZh6wcsLgr5b0eiyki1aZlVSh/I7YCS1ddGLTo5loqAInHY1MM10Ig N1doKtj9LMI7Uk/djB6OaHe06L+ggmHhhSmbAy6qb21rcFi+H2EcoLaD9xyiREurlrR7 GCrWOyf42Ps1U2xcar9AJ9CqeoiYI1j8I8N/Mpv1ePKP7bmK5okJA+WyIrGZ5cBY9JmE biL107Fq2hYsemws6BoS4PJw08xyj/NMOWVE6unGB0Uutfq2S0bkNFXbdYm/hkb4/elL QX7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:wdcironportexception:ironport-sdr:ironport-sdr :dkim-signature; bh=aAsCQTUq5SMjGeZdETqAt+zWSXHzIli9yKya8LdhWTs=; b=S7gYw3r+M9xBpyea63754MsUE2ETW4oV/Dix1ds5N/bi4PHCfT8Jmr20+guOxBOU3A W5JLgfx0QV8IE/zygwGib6l4Ao3V4eyfZQlkhl5A2dEOa6knzoVs5pSZoBnX2VpJp2Wv EkRF6fndQ6A9+eKrunV6agnU7hDyI6iJ3zpaq/VWAfdKsm3twaBCtM6WezJ+TAA8x6As fUuzPmgj0QTflqLVbdCyuNxv3d/dFOAFzW7BVZ9WMSRAvOU1cAJW8bUEe+8HUb8YJRMp zvUibHQyH2k8uqbXXO7MUzxyVscAt2xGBtKIJFda3J3x2BbKbyi2kh3F9XP5KbnyhYcV bWKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=CC3BYbzn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si30938365edn.511.2021.11.08.06.23.48; Mon, 08 Nov 2021 06:24:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=CC3BYbzn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237634AbhKHMLf (ORCPT + 99 others); Mon, 8 Nov 2021 07:11:35 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:18555 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239397AbhKHML1 (ORCPT ); Mon, 8 Nov 2021 07:11:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1636373324; x=1667909324; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=UgIeZhHhFCvWkz7a2C4s/pc1I+RA/IV4MdJK1v7cpyo=; b=CC3BYbznMZVClTnKHFLBgHiWwl3wH2qwNmDQGIfba6Xhh6YW/W+pr0iB 3To/03IE4Dchce5F0+EL8YghSWe+AXaA015+jFzcOhUq6GTkURvN5dja/ 2Vmi3BkMBAu1aKEtZpK0yKR4zEau2HkW9N0wXRosWoXrpNdR25/UB9h2S voWu9kjUpXwc5Y8MNswcAOXk7MaTVOZdcoithHgrhloGimkcw94fqWdek 6Jn5KW6j/IiwAuyBBgLY3P9lbsHJIJzuUp4QrQ5E0yXyN0l8iuwhiM+gm BovB44/2N0xhVKR5QSR6biRJj7K/h8MqHgP2TQJV4AXk/v/DkZsIjg2s/ g==; X-IronPort-AV: E=Sophos;i="5.87,218,1631548800"; d="scan'208";a="186004981" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Nov 2021 20:08:44 +0800 IronPort-SDR: OSnO3e4Di7GTuCxTFQs0R0ZF+aWXP8ZtQgr40N8UbkV+YbLgwPG+mVjfkPTKCkVLR8N2Wv8hBe FLzLrhV8eRLVgV/H74V54Df03wevdHe378DgI4hGrRN84ni+qFcCZFTIQwSMsUQe2lpghbIPre 7uMmuY2HJkFcXjLOAydPQYjgfEQNEH2qjkFxs0etkV8a3NW040NBaKY38Z9rCp8q6VHNk7dpjh mY5oZ9rR8ccrzNAaZ6FuSI7Yg7pfCNdaoiutZdcXjVMxqjhwVxrqCFXIWf6InEDUl68YfGJDPS K4aYvkfj+1lJt7Y8b+YK/TJY Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2021 03:43:57 -0800 IronPort-SDR: FMwohQDm909k9GAVDcLncd0NHveJjNrD2kiB7t2wfqC5sYwwGfgQvZj/6o3Ge1jHZqWlguP/Bk y8IrVulXrUu6KN2dzTKtgeWYXyq/UpQsn1gRGO3yqLoCHxz+ffS63VR9/CHm5GNCP0SAnn05Wu LxtHkgvHY/ex9HpxFmkS0VMOdzqNe9UzGRw7ARyZdc7KiiQ4wJ6RZdZbxnAPHidT1OoJXelFF/ PuwOT21YDE1MJQm53mvGQyG1YjNtTHNotN2RhDI9k5ODsfIG6NfYE4IzecoFrOZSi/kaAM025X Vu0= WDCIronportException: Internal Received: from c8jqy33.ad.shared (HELO BXYGM33.ad.shared) ([10.225.32.157]) by uls-op-cesaip01.wdc.com with ESMTP; 08 Nov 2021 04:08:40 -0800 From: Avri Altman To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Adrian Hunter , Avri Altman Subject: [PATCH 2/2] scsi: ufs: Return a bsg request immediatley if eh-in-progress Date: Mon, 8 Nov 2021 14:08:04 +0200 Message-Id: <20211108120804.10405-3-avri.altman@wdc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211108120804.10405-1-avri.altman@wdc.com> References: <20211108120804.10405-1-avri.altman@wdc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ufs-bsg is attempting to access the device from user-space, and it is unaware of the internal driver flows, specifically if error handling is currently ongoing. Fixes: 5e0a86eed846 (scsi: ufs: Add API to execute raw upiu commands) Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3869bb57769b..828061c05909 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6830,6 +6830,9 @@ int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba, enum utp_ocs ocs_value; u8 tm_f = be32_to_cpu(req_upiu->header.dword_1) >> 16 & MASK_TM_FUNC; + if (!ufshcd_is_user_access_allowed(hba)) + return -EBUSY; + switch (msgcode) { case UPIU_TRANSACTION_NOP_OUT: cmd_type = DEV_CMD_TYPE_NOP; -- 2.17.1