Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4149549imw; Tue, 19 Jul 2022 00:11:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcDOyRLdbuCrh/OYBZ6jJI3zxhctH4EQNQwSltpupfrsFKhgULklPl9BQj31ydwTsuzs1R X-Received: by 2002:a05:6402:2742:b0:43a:bd75:5e82 with SMTP id z2-20020a056402274200b0043abd755e82mr41043274edd.274.1658214705153; Tue, 19 Jul 2022 00:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658214705; cv=none; d=google.com; s=arc-20160816; b=vsiOC/A3KSCSf1hhT3HFZLxYi8nBRTSRHWm9ZpNROfdSVaDuPFRXV8ZjGqlZqGSizf nqrKPDF/qF3NPtGyRm/hUZ0n/u9DGpD6kzMhhE6gASmZCP0zc7nKU77+tOB+xCQWY6eb L/09F1rnIxReMZS9F7+lR54nKg1NMzn4Djv4/TFiLTp9r3Wb54fcLeL+cT9yK2QxM7TA kRNSihyoV/Cou5PxhOqJfvs9yaDpMAMP732ontkHJC2x9ZQhiqxH6u7NyX6fov9nCqoh 7PpOXnw1Qm0uDUDPBKH3SaGQhxzieQZu2uH4xtMxpmB8Kyw/S1tNeSj3wDUdh5qJAPKI B8Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=+XP9UCk5hBKkCHEsb6wmiFt4mhD6vWh3L/oOpLeiP2k=; b=cmU16i3BZyTCKbMHdVDu1VV9mR4fsYPojUSP+659awIy4mlnIt4wmYFEKgAs4VXNVT CJ7n3useL3OeDKS6BgBpjqeg9tgIK84hJBmsYtocQSt9SxnK73IaQYKeTlL+8QbTkm3v FOIYZPLnLnqYnba2bWXhnieNH9++I54XmETNwct6ahnfzvQP7gjE3e1NMuxp0HdBWveX su6sZuAFsI02uuOwUT9KzWCf5KKwr2M5QjadPNm+gf2uzkbvb1npcJk14cqaa15QHCre z3txJpzIrVwpnv0Q0Myfm+rYA8b5VqRDHzTykFjgN1CZkRLZxktFr3Q5xU2tpSutMUDE A6og== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq28-20020a1709073f1c00b0072ed047f2e6si21647619ejc.583.2022.07.19.00.11.18; Tue, 19 Jul 2022 00:11:45 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235061AbiGSHFg (ORCPT + 99 others); Tue, 19 Jul 2022 03:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234012AbiGSHFe (ORCPT ); Tue, 19 Jul 2022 03:05:34 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AA1922B3E; Tue, 19 Jul 2022 00:05:34 -0700 (PDT) Received: from fraeml740-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Ln8sG1gt7z67QNP; Tue, 19 Jul 2022 15:02:10 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml740-chm.china.huawei.com (10.206.15.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 19 Jul 2022 09:05:32 +0200 Received: from [10.126.173.247] (10.126.173.247) 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.2375.24; Tue, 19 Jul 2022 08:05:31 +0100 Message-ID: Date: Tue, 19 Jul 2022 08:05:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v6 4/6] scsi: sd: Allow max_sectors be capped at DMA optimal size limit To: Damien Le Moal , , , , , , , CC: , , , , , References: <1657797329-98541-1-git-send-email-john.garry@huawei.com> <1657797329-98541-5-git-send-email-john.garry@huawei.com> <6725df4f-4e27-3320-8b7b-22ba15a07866@opensource.wdc.com> From: John Garry In-Reply-To: <6725df4f-4e27-3320-8b7b-22ba15a07866@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.126.173.247] X-ClientProxiedBy: lhreml716-chm.china.huawei.com (10.201.108.67) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 On 18/07/2022 11:47, Damien Le Moal wrote: >> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c >> index a1a2ac09066f..3eaee1f7aaca 100644 >> --- a/drivers/scsi/sd.c >> +++ b/drivers/scsi/sd.c >> @@ -3296,6 +3296,8 @@ static int sd_revalidate_disk(struct gendisk *disk) >> (sector_t)BLK_DEF_MAX_SECTORS); >> } Hi Damien, >> >> + rw_max = min_not_zero(rw_max, sdp->host->opt_sectors); >> + > Adding a comment explaining what the cap is would be nice. > Christoph has now applied this (thanks, BTW), so would you like me to follow up with a patch on top with a comment? Thanks, John