[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6175fe49-f3e2-bfcb-2b97-b58763f1cf0e@opensource.wdc.com>
Date: Mon, 23 May 2022 16:33:05 +0900
From: Damien Le Moal <damien.lemoal@...nsource.wdc.com>
To: John Garry <john.garry@...wei.com>, joro@...tes.org,
will@...nel.org, jejb@...ux.ibm.com, martin.petersen@...cle.com,
hch@....de, m.szyprowski@...sung.com, robin.murphy@....com
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-ide@...r.kernel.org, iommu@...ts.linux-foundation.org,
linux-scsi@...r.kernel.org, liyihang6@...ilicon.com,
chenxiang66@...ilicon.com, thunder.leizhen@...wei.com
Subject: Re: [PATCH 3/4] scsi: core: Cap shost max_sectors according to DMA
optimum mapping limits
On 2022/05/23 15:53, John Garry wrote:
> On 21/05/2022 00:30, Damien Le Moal wrote:
>>> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
>>> index f69b77cbf538..a3ae6345473b 100644
>>> --- a/drivers/scsi/hosts.c
>>> +++ b/drivers/scsi/hosts.c
>>> @@ -225,6 +225,11 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
>>> shost->cmd_per_lun = min_t(int, shost->cmd_per_lun,
>>> shost->can_queue);
>>>
>
> Hi Damien,
>
>>> + if (dma_dev->dma_mask) {
>>> + shost->max_sectors = min_t(unsigned int, shost->max_sectors,
>>> + dma_opt_mapping_size(dma_dev) >> SECTOR_SHIFT);
>>> + }
>> Nit: you could drop the curly brackets here.
>
> Some people prefer this style - multi-line statements have curly
> brackets, while single-line statements conform to the official coding
> style (and don't use brackets).
OK.
>
> I'll just stick with what we have unless there is a consensus to change.
>
> Thanks,
> John
>
>>
>>> +
>>> error = scsi_init_sense_cache(shost);
>>> if (error)
>>> goto fail;
>
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists