Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1143672pxv; Fri, 9 Jul 2021 19:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcI4PB3WituQT2McNWuJ3XZkUZGfuo7mB9tSlHQAsHii9y8YeP+P0DZ5m4EbeyCrnB/U5M X-Received: by 2002:a50:fd13:: with SMTP id i19mr31203026eds.266.1625883806196; Fri, 09 Jul 2021 19:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883806; cv=none; d=google.com; s=arc-20160816; b=QJ6RX//uCYpcP4y8oNH/KgRJsUJ/GHQKbZuF20exnmCT7/DmGZLy43XbB2pN9kBn2M ZV7aT2MzuHKEzX6HhhcyDUebMlSqPBD7yTdwjvw8VQ4+jNTpNSkVuefykNSkBoBi4+cR u9bOrETIaAv/c0BgkeI4wrhlJFSQFrKqasmnv2jSJ1sRyEMLjQD6FpamXGBqsk3EqfyQ SiL5djGx3OHnatkk3egIV80almMnq+3S6Bl8NOg5ur9WbnnH/LMtw6o3pk50aNfWJ2li dE3y4Xg1qUpqB+HcSTTJHUGz9oxOUJE0+c7WbCbe7BJrRLNO4EPKQYwJ7rz9o0Kc1ECy 00Vw== 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=4WHM2JUDIvOdHnZlKS2p+QJ03NGE/0UAbdpl/6Q5dUg=; b=FCCs7cbgZ3QwcJHdElMwzQMBQGfkbl7AMt7zl51M1MY94k8arYEuLPayCm4GmjYaMd 6QmAbp//88B/PwlzhawwHNcRwtoq1iHNXkf04d4tHcU5eGlTO9TEwuFKyWWmUsv87PQx nFaIzFcZMafGqSUmTUKMAEZm316IWcR8bpTQZpzSevaZzQzajrZBC/wKWg+9PeAabytA kzIQGe6k3wwP49OyvmaC2ZQFwcvKe5qAffsEvnv5DyYBI+e3NzNbhbXDqygXjM6lCMI9 pSwOGzFQCpHyq6Qmon7tyraykaL+DTm6tTuNBu/R5vnR4+YJMK5OeO82bAIAfKUN72Rz dn1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kSN68q9a; 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 jz26si8972523ejc.709.2021.07.09.19.23.03; Fri, 09 Jul 2021 19:23:26 -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=kSN68q9a; 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 S231966AbhGJCYu (ORCPT + 99 others); Fri, 9 Jul 2021 22:24:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:41524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231682AbhGJCYr (ORCPT ); Fri, 9 Jul 2021 22:24:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADBDC613E1; Sat, 10 Jul 2021 02:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883723; bh=IYoubfj/OlkMZZB5SY71eKlG6nEiNmDXtp7ZUMa6i/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kSN68q9aJfosiipUly22QxG1u/NBe8yWJ1T/1usJ64h+iPtDMxUzNkQ8RdKmsXz7w kJoctkEEn8HB0phnEqxZ4ZNv2z5Rc6bpT8nCY09Dy2VP5TnGpfT4qdrY0tdpluHrGl BP6daETZeMEc0ng23sth0ZTUewAVFjpgnS8EDszoS1okMeu2Hg4JPqAfkiUM+HipbU lNGxKHtrEsNFFd+/wo0bXH57b5qBWffUwcNg99YXIPRBOMFdTqXwHtWmI1XG7+vqs8 Y4Ut7tH0E8/zmRonPQmb42TLW/y7Bo8evV1p7gPtYkJzX7gs3+crOdOeN9Nvp5Xg3i w1fOkk725p60g== 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.12 005/104] scsi: arcmsr: Fix the wrong CDB payload report to IOP Date: Fri, 9 Jul 2021 22:20:17 -0400 Message-Id: <20210710022156.3168825-5-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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 4b79661275c9..930972cda38c 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1923,8 +1923,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