Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1337462rwl; Thu, 10 Aug 2023 09:39:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFu+vDe71iT7zoF9J1TqXgLfWbOtYJGBrJQaoIIcf+wgaqUhaZ6HxGDY9Pu1jFqDV7lSH7l X-Received: by 2002:a05:6808:151f:b0:3a7:1e86:e83f with SMTP id u31-20020a056808151f00b003a71e86e83fmr4030231oiw.51.1691685562783; Thu, 10 Aug 2023 09:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691685562; cv=none; d=google.com; s=arc-20160816; b=eigp+7Fx0r4GVVVQIVAuzpQzbIokSmWg3b3U1ArxR1JreKOpUJ/DJ7j1ZJXyT1O5g0 x7cvq0nhaBiyZ8dalE2JlofQx13dcFh96E5EAYkRryJ6Wa7AIlHcUVfL0XmeXs33hyy4 z7Bo2UKsm5mxzO7OOs/wBTskHr6U/QVVlVPKGeaXztHURS6Kn2t7tVvulgn5cLmsPIrQ hA+ThJb7GoEqhBfrqLXRs0QoV8q8oqf/dAn3jlf6zTB64JYVboeKEFpJhGb+cVf/JmYY D77u+T3QTkylS+KUskIJZ1FY0gGx/pUCHmPZy9NIqa6z4Ccau4ySwb7yjWhmJFyHt4Hl 7y5g== 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; bh=VCZDKcrN7U/P+Anq9yQVNpn+JdxdexZg1qYQl1SMyL8=; fh=j/1OJ/bcBNVUo7OV9c6EGYwjYba7yxMLNeRPuOJBLLs=; b=hV2idpLkhlnzQi1cJzac5djETi9io63IxnNtcxDun5u8WoqRIFw6288DLqKkW3ZI5U +pDoaoJ5jaL7SJs5C4kUzYERJLKKN+apQN6rrfYc+kCWDzD40sIMvXEJMiJPFgJIp705 JdgtfII8e9dzSuK8Jne56TNpH6v/1FAAhI+Uv6YsQFy1nH4kFSi3GCV8RUmd4D5sFw9+ Zi9CToLcdkq717V7T26RniVV9bWQ9zilyRyHc6Jc6PWxtTV9Q1sm2YJNBzb7te6phabT UoEc0QR1AdUo6q+CdRRk7kU6iTbOad9e8m9hSbZysaUVc8JA+iWV42gLCP1uchD/2Cn7 6Kxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg26-20020a056a02011a00b00563ee182af8si1782361pgb.455.2023.08.10.09.39.09; Thu, 10 Aug 2023 09:39:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236321AbjHJQAw (ORCPT + 99 others); Thu, 10 Aug 2023 12:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234714AbjHJQAo (ORCPT ); Thu, 10 Aug 2023 12:00:44 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF2CE53; Thu, 10 Aug 2023 09:00:43 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 63D92622F56E; Thu, 10 Aug 2023 18:00:42 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HGDQ1P6SpJc5; Thu, 10 Aug 2023 18:00:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id EC415622F592; Thu, 10 Aug 2023 18:00:41 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5wGKZt-JMm6Y; Thu, 10 Aug 2023 18:00:41 +0200 (CEST) Received: from foxxylove.corp.sigma-star.at (unknown [82.150.214.1]) by lithops.sigma-star.at (Postfix) with ESMTPSA id 9000E622F56E; Thu, 10 Aug 2023 18:00:41 +0200 (CEST) From: Richard Weinberger To: linux-mtd@lists.infradead.org Cc: Christoph Hellwig , Stephan Wurm , Richard Weinberger , Miquel Raynal , Vignesh Raghavendra , Oliver Neukum , Ali Akcaagac , Jamie Lenehan , "James E.J. Bottomley" , "Martin K. Petersen" , Ezequiel Garcia , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 3/7] scsi: dc395x: Switch to kmap_sg Date: Thu, 10 Aug 2023 18:00:14 +0200 Message-Id: <20230810160019.16977-4-richard@nod.at> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230810160019.16977-1-richard@nod.at> References: <20230810160019.16977-1-richard@nod.at> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,T_SPF_PERMERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch to our new helper from scatterlist lib. No functional change, the mapped region is still used in atomic context. Maybe local_irq_save() can be dropped, but I don't know this driver well enough. Signed-off-by: Richard Weinberger --- drivers/scsi/dc395x.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index c8e86f8a631eb..4a4e7a35328b9 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -2122,7 +2122,7 @@ static void data_in_phase0(struct AdapterCtlBlk *ac= b, struct ScsiReqBlk *srb, local_irq_save(flags); /* Assumption: it's inside one page as it's at most 4 bytes and I just assume it's on a 4-byte boundary */ - base =3D scsi_kmap_atomic_sg(scsi_sglist(srb->cmd), + base =3D kmap_sg(scsi_sglist(srb->cmd), srb->sg_count, &offset, &len); virt =3D base + offset; =20 @@ -2165,7 +2165,7 @@ static void data_in_phase0(struct AdapterCtlBlk *ac= b, struct ScsiReqBlk *srb, DC395x_write8(acb, TRM_S1040_SCSI_CONFIG2, 0); } =20 - scsi_kunmap_atomic_sg(base); + kunmap_sg(base); local_irq_restore(flags); } /*printk(" %08x", *(u32*)(bus_to_virt (addr))); */ @@ -2339,7 +2339,7 @@ static void data_io_transfer(struct AdapterCtlBlk *= acb, =20 local_irq_save(flags); /* Again, max 4 bytes */ - base =3D scsi_kmap_atomic_sg(scsi_sglist(srb->cmd), + base =3D kmap_sg(scsi_sglist(srb->cmd), srb->sg_count, &offset, &len); virt =3D base + offset; =20 @@ -2354,7 +2354,7 @@ static void data_io_transfer(struct AdapterCtlBlk *= acb, sg_subtract_one(srb); } =20 - scsi_kunmap_atomic_sg(base); + kunmap_sg(base); local_irq_restore(flags); } if (srb->dcb->sync_period & WIDE_SYNC) { @@ -3290,7 +3290,7 @@ static void srb_done(struct AdapterCtlBlk *acb, str= uct DeviceCtlBlk *dcb, size_t offset =3D 0, len =3D sizeof(struct ScsiInqData); =20 local_irq_save(flags); - base =3D scsi_kmap_atomic_sg(sg, scsi_sg_count(cmd), &offset, &len); + base =3D kmap_sg(sg, scsi_sg_count(cmd), &offset, &len); ptr =3D (struct ScsiInqData *)(base + offset); =20 if (!ckc_only && get_host_byte(cmd) =3D=3D DID_OK @@ -3308,7 +3308,7 @@ static void srb_done(struct AdapterCtlBlk *acb, str= uct DeviceCtlBlk *dcb, } } =20 - scsi_kunmap_atomic_sg(base); + kunmap_sg(base); local_irq_restore(flags); } =20 --=20 2.35.3