Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2962109pxb; Mon, 17 Jan 2022 09:04:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFQT0jJ4Fu+4114aQ6FERHvqSa2guFjFhb9cZt82WMG2vy57GWrqB+GtW/oitV+jfO6l1o X-Received: by 2002:a17:90a:348c:: with SMTP id p12mr35173818pjb.90.1642439055762; Mon, 17 Jan 2022 09:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642439055; cv=none; d=google.com; s=arc-20160816; b=p0vopuIRjxpwjwfAK3ssh5cEqoAS/ia6Lo3kpQD3gR2ndqVTirgmDncxWEEIMVt9uJ 92zbZyu77NXxilZrGsjLhkLNkr3MPXqsbIZnFOBk+MogpftPWo961YlCbqugI0jDrOTl Xz7NF9jh/zlAgU0ES1dCnI/q24KfIqi8QUuYWdSvnX2W1XI+qoefG5IeXDOroK/Kc5TN ez9gzIOt+j1/okp8/rkBCrmqakLsWnUpMDE2hmE3QYrHWw82mOnlDLUEi+zSawxF9F08 X+6mlBmrxoZIHpE4U4kVgH9tU1LZnOjhRZJT+LmikUJgzJ0Ye0MmnpLzuTUxoKHaftNW Ba9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=rB+44sljG+wZbwUrcPx1DS5jUunU5Nl+b4n4SdFVjeQ=; b=zOcj3J8v5tnZaxTR1uNeUg2iLaU5a2HUKj2ISFlsfZDmjvUMF9cRG50JUnqfIEMpio XjrlkMXAqD14AL+SJ9MXe65F1NQ9t99Fj7RQdxQ2Oyjsgk6zkgp09OJFcdCxcfDrhbkF xS6RVg1BQeHPz41xGG9JMprgy+F4VDvsvbonDzjbYPEoMeKNhWHAjzU58h0oV7u4IWyK LnMuBrqDREGqt5V4IoxLRhDbpJ3OM/MxGfZ0D/LW1eAVSQZ7F+Ryu9XFwvhH530UCBKg 7SN5W2hHLCQxKmX6Ly0xx8BAJqZm+OQpW69dtwIEoNMU/IFVAgCTWwIaebQHrtKZMjV6 Lvpg== ARC-Authentication-Results: i=1; mx.google.com; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si15962381plg.150.2022.01.17.09.04.02; Mon, 17 Jan 2022 09:04:15 -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; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235702AbiAQJ2h (ORCPT + 99 others); Mon, 17 Jan 2022 04:28:37 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4414 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233366AbiAQJ2f (ORCPT ); Mon, 17 Jan 2022 04:28:35 -0500 Received: from fraeml744-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Jcmj71Jybz67jS1; Mon, 17 Jan 2022 17:25:31 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml744-chm.china.huawei.com (10.206.15.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 17 Jan 2022 10:28:33 +0100 Received: from [10.47.83.126] (10.47.83.126) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 17 Jan 2022 09:28:32 +0000 Subject: Re: [PATCH] scsi: hisi_sas: Remove useless DMA-32 fallback configuration To: Christophe JAILLET , "James E.J. Bottomley" , "Martin K. Petersen" CC: , , References: <1bf2d3660178b0e6f172e5208bc0bd68d31d9268.1642237482.git.christophe.jaillet@wanadoo.fr> From: John Garry Message-ID: Date: Mon, 17 Jan 2022 09:28:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <1bf2d3660178b0e6f172e5208bc0bd68d31d9268.1642237482.git.christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.83.126] X-ClientProxiedBy: lhreml713-chm.china.huawei.com (10.201.108.64) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/01/2022 09:05, Christophe JAILLET wrote: > As stated in [1], dma_set_mask() with a 64-bit mask never fails if > dev->dma_mask is non-NULL. > So, if it fails, the 32 bits case will also fail for the same reason. > > Simplify code and remove some dead code accordingly. > > [1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t > > Signed-off-by: Christophe JAILLET Great, you got both callsites: Acked-by: John Garry > --- > drivers/scsi/hisi_sas/hisi_sas_main.c | 3 --- > drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 -- > 2 files changed, 5 deletions(-) > > diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c > index a05ec7aece5a..2f53a2ee024a 100644 > --- a/drivers/scsi/hisi_sas/hisi_sas_main.c > +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c > @@ -2666,9 +2666,6 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev, > goto err_out; > > error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); > - if (error) > - error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); > - > if (error) { > dev_err(dev, "No usable DMA addressing method\n"); > goto err_out; > diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c > index a45ef9a5e12e..a01a3a7b706b 100644 > --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c > +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c > @@ -4695,8 +4695,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) > goto err_out; > > rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); > - if (rc) > - rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); > if (rc) { > dev_err(dev, "No usable DMA addressing method\n"); > rc = -ENODEV; >