Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146039pxv; Fri, 9 Jul 2021 19:28:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo3JtxjnqTp4jhJ2U7TQ1hn9Hvsa4Ljjuu49vdbmFip5V5ujb6ax9/KFAAf0jabzL2uTZf X-Received: by 2002:a50:ed14:: with SMTP id j20mr45028792eds.271.1625884128050; Fri, 09 Jul 2021 19:28:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884128; cv=none; d=google.com; s=arc-20160816; b=UDoIrq/SKeZIVaWKuOiP92ugqKoGPbfdapiw/jeVpE3/N1VQc/vwqf5H7pOPaaNgE8 qJkkjpcA4GDguRJ4WPsxuyFOeLJAOMDS6Qnv15nf4Oxii4mvLhwxVhoKBhC/HwZpuU8j p3u7oJALiygjF9gCzmzpxIMlCWSCyn2zrmoRKkAkW+s9FJTstLLbMy/kgHtePEyMyKbR t19cC8U41sBMDe8cIuC8BJvNAQSFrv/L3WZbc3hVHf93FGR8xtQIe29jjO4ksHhbDT6t HzFFiwNfNUjjnyCV3jX30UnvJhgmf3dIgNtNt9P63QUoKrM7HwE9H6mdKijpMp4Fws75 q8Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9ZMQgDWSR0wogCCPvspBVNJt2ow9bm+W8xntIBEvjwQ=; b=uPlea/WMRsCFAsVBOoxKjRUmY2c6BMmMYWLXRVRWerZnSOkm9wQT+FSx/4XHF21pTk ORynaA+3Nl0gXb2+vNjCVc3bvvBMOu0vt5jdaju9JXqTgte7qfTTfCpAmbNCp5PY2Vv/ hX6SQmdIAejEpL00k7EmZqN2A9rJxPd56Q0jRQiNyDtBWjDFGpFR83M0/lYmNkzhm5z7 JsKnJqb7zrlCGqL2sZC1g88b8b97QuMUFIMhceoQAMRPdh/zsc+VrU9P8WWQDfKb1AoJ fwr6MPLf3JnY1L012hA++/A3vNw2l5+KDdLGzqUnX22es5xAqZc9uIB/tPGWM2d4BRbT BhZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IhIX3fSd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qa7si8445785ejc.191.2021.07.09.19.28.24; Fri, 09 Jul 2021 19:28:48 -0700 (PDT) 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=pass header.i=@kernel.org header.s=k20201202 header.b=IhIX3fSd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234105AbhGJCaR (ORCPT + 99 others); Fri, 9 Jul 2021 22:30:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233644AbhGJC1e (ORCPT ); Fri, 9 Jul 2021 22:27:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A05D26140F; Sat, 10 Jul 2021 02:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883875; bh=XTrAhiCQBgv6zHFyOrAJmGwSLDcsHJ+tJxlfFIqk2VA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IhIX3fSdAJmLY8SPSl7/8LnpZi3OYxrhtUQhdEV3ovpPsxqsi7Fv6KuPkxH6cKitM 8WPulN08yfxzC8lgPOO9tMbleleDYMQ9gYaIqnZN/Xs5TNyJkweZQC85QELunrsuX6 x18c+grq0ByyDKJbnR2ZHO85Qg03HCLo4chxZ8EM2TKhO00xmt+V5Nn0pOJzKcOryo mTIdR0VxHQuD8YZQR4AsVIvgYfew8lYDT/A1p+GmCQzKjVTvLcd7N1PsR4b0/XsBTo t4Yr3giDYdtt8mITFGl0j4vSTiMTzkSV2LWIowNd0uc57FTJwEtb7MiTipD1qZJ9nK RgzylUlLd3lYg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: ching Huang , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 05/93] scsi: arcmsr: Fix the wrong CDB payload report to IOP Date: Fri, 9 Jul 2021 22:22:59 -0400 Message-Id: <20210710022428.3169839-5-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: ching Huang [ Upstream commit 5b8644968d2ca85abb785e83efec36934974b0c2 ] This patch fixes the wrong CDB payload report to IOP. Link: https://lore.kernel.org/r/d2c97df3c817595c6faf582839316209022f70da.camel@areca.com.tw Signed-off-by: ching Huang Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/arcmsr/arcmsr_hba.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index e4fdb473b990..4838f790dac7 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1928,8 +1928,12 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr if (ccb->arc_cdb_size <= 0x300) arc_cdb_size = (ccb->arc_cdb_size - 1) >> 6 | 1; - else - arc_cdb_size = (((ccb->arc_cdb_size + 0xff) >> 8) + 2) << 1 | 1; + else { + arc_cdb_size = ((ccb->arc_cdb_size + 0xff) >> 8) + 2; + if (arc_cdb_size > 0xF) + arc_cdb_size = 0xF; + arc_cdb_size = (arc_cdb_size << 1) | 1; + } ccb_post_stamp = (ccb->smid | arc_cdb_size); writel(0, &pmu->inbound_queueport_high); writel(ccb_post_stamp, &pmu->inbound_queueport_low); -- 2.30.2