Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp245312lqh; Wed, 27 Mar 2024 23:59:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXt98LRLmIZd/lxkIhdVs3nSlO10H9kPQGPws8tO/j6FGehwPoAceuzf0N/5kagAvbLae9Ko4U9ylLVaGj4T6pISKRuHcNThb+ttISMA== X-Google-Smtp-Source: AGHT+IEVoXfPrGSnDmdAi0lQlbdrED5fzkU1zo7edFh7w0QNkWtbzEgH2QnV28glrTzD54QEE5xe X-Received: by 2002:a25:4406:0:b0:dc3:7041:b81b with SMTP id r6-20020a254406000000b00dc37041b81bmr2178631yba.36.1711609194573; Wed, 27 Mar 2024 23:59:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711609194; cv=pass; d=google.com; s=arc-20160816; b=Q88dzOSg2cSm0aM90r8nJiYbm1ipJihl1Ws4i33oZJtOYkSTKYrRNqBd6HQajP7uwS +wIMKwJiiEeryeho39tDLRAn1dwaR1wkQgKsjZrzzlNTJhsL3aQQ+JKLpalTWsLCPcMy x+1yoY6Le6D/IuNV+fwjjJ4MzMIDtFVG0edWyi6wrD69WPEvzirBZZYHfEd5126AYUjI qeZPf/SLVz0yrZ1+A+3zJi53fAJQtbV7ewQge7+4LtEGw/Px4uTgTWZJxVbv/jsY6JcM uah31k2dcj2VLd5E4SV6B6J/cYjmKVdYqnyeEWfSc87IZ9bpf73YGLyqGZzyl4Y53vgX xoVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :cc:references:to:subject; bh=NuQrLPFqY6Et+rP/R9eNVnPWNFieZFCybJcqOQKsCFg=; fh=eCNV3NUKkW6MRPlwsXglLtbBRYmcHjCYjDhuKHPkuzQ=; b=JuKYlqrqFMOUZ2IV8VlEJXwVbOhFTJsLeJGlNkGrCZCgLKHv+aLTEj8Lz4IzVcfh2e cdBvkX0+O8NmvIE0kupr5MNjMOAOdbQqODeieThz2xheBv9t1d+rlI+8Jm4P15Zb/Bv7 nSH17VDyieoYVhbLue9aEAkR/fiyXJ9mBHFT13DQfFlYlK0XhZhA7HQ3eAJ9WyKK1o5Z +KLY25TxVGJqoJDXPOwibKdWJiXftwstE5CmM7yub8ij7GzUW9dbZli/928Tl6IYXUZC TsC7sU52gtbUHKAJfgLGxPHDm/BRQDcCDcMaIi3mTgnGfHVL7qJ6gnjcROhFBJ41S32G rp2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-122483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122483-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f32-20020a635120000000b005dbec9c2919si824794pgb.379.2024.03.27.23.59.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 23:59:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-122483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122483-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1782528EEF4 for ; Thu, 28 Mar 2024 06:59:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2391550277; Thu, 28 Mar 2024 06:59:47 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30541225CF; Thu, 28 Mar 2024 06:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711609186; cv=none; b=kC74k4sV22l/7pEpNNDZX0BKO038tXSy1L0H/DZqUD2/dgUQ/eHUFeqTYBL2UcDxwLQT2T/hb3ryVMqAL9GviDOrqHPPkpY6f1itREu/1IC00zVTA6uGfjwWHmRBcf5mOwbhGOs3KAjuBpb7m/3FtOUMRRNoU7IXb1q4cZ6x0g8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711609186; c=relaxed/simple; bh=8EOC3gIs1H1Fv4kQsmqyl1qx9sszyhnJYRFryGPcoAM=; h=Subject:To:References:CC:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=qBnPq3yPaa7reVfHfZiilQmXEfbt1VuT4P0CkvP3AUj+bWcbCoSsOkLiQ9zGxKbF0wSJ06n9D4qv2dv3GdWXldtHCSJ7rBgYBwjpoNm5zdum7AiTkfau5HYLdzbJxVbEg3RzyIVHDOHSrq1gU9FdQuqTzfcuGq8H0gge2vWzHbI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4V4vX92ZmrzPpZt; Thu, 28 Mar 2024 14:58:49 +0800 (CST) Received: from kwepemi500008.china.huawei.com (unknown [7.221.188.139]) by mail.maildlp.com (Postfix) with ESMTPS id 8C1B01400CD; Thu, 28 Mar 2024 14:59:41 +0800 (CST) Received: from [10.67.120.126] (10.67.120.126) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 28 Mar 2024 14:59:40 +0800 Subject: Re: [PATCH v2] scsi: libsas: Allocation SMP request is aligned to ARCH_DMA_MINALIGN To: Christoph Hellwig , John Garry References: <20240326124358.2466259-1-liyihang9@huawei.com> <5b5b9392-7fd2-4c87-8e41-5e54adf20003@kernel.org> <0ba9914d-7060-498a-beac-2b19770e1963@oracle.com> CC: Damien Le Moal , , , , , , , , , , From: Yihang Li Message-ID: <75df3e2d-10c3-5370-3cd8-fe2fb0ff2acc@huawei.com> Date: Thu, 28 Mar 2024 14:59:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500008.china.huawei.com (7.221.188.139) On 2024/3/28 14:35, Christoph Hellwig wrote: > On Tue, Mar 26, 2024 at 01:32:09PM +0000, John Garry wrote: >>>> + u8 *p; >>>> + >>>> + size = ALIGN(size, ARCH_DMA_MINALIGN); >> >> >> If this is a hisi_sas requirement, then why use ARCH_DMA_MINALIGN and not >> 16B as minimum alignment? >> >> Or are we really talking about an arch requirement? > > One thing is that we should never allocate unaligned memory for > anything DMA mapped, or data will be corrupted by non-coherent DMA. > So ARCH_DMA_MINALIGN needs to be here. If specific hardware has > further requirements we'll need to communicated it through a field > or op vector. Got it. Looks like it's still going to be aligned to ARCH_DMA_MINALIGN. Thanks, Yihang > > > . >