Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp238060lqh; Wed, 27 Mar 2024 23:35:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVf/TaLkj6VFVo4Jz3kl43Wvx0dfzT+VmuA1M5VRI8RCfAxqjkaIoNdbkmWlMagyQK9E003pFAzmQJ8yu+Mr6y6VIl0xB5p77mH/HKq8w== X-Google-Smtp-Source: AGHT+IGyOAlG4b6C9kTbYzlBAcN9jhVTyUv+YSHW7dZVvQF+Ttg1/wbEssmjMof79thTaLzo6LRw X-Received: by 2002:a05:6102:3970:b0:476:cf52:e1b7 with SMTP id ho16-20020a056102397000b00476cf52e1b7mr1419865vsb.28.1711607732024; Wed, 27 Mar 2024 23:35:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711607732; cv=pass; d=google.com; s=arc-20160816; b=tCdIGVodc6HeSw8fId5naaY0kLurkbQ2AGIwbwPz1ds7WHSc7RszudeTdF9Nfgo3iD NWZ+CaD6phCX2Vqp+0+fB2qWs6opCgY4ao6T0jQmUHdqk25FprhcWvqZiTriwhhiPc/q X3wHg0Fv5ybqsnFMZS+ASCXASvv+evMk0q5olx9Z/ifU+bpnG2xFhFIwlYcLMcnau2zP e7MVtz9mg3x+xaPjb1881OkaFw3q8gZNwkdGv4F6aiBvUlGJ18wiiQT6qUvtftIJf6Y/ N2sESx13vS1sNVEnM9SIgmL2Dv8JNLrolqGABdRRkMb1HXbHN6EWhnsvebdaRunsiFyb DUZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=I9oAmld5QX0jZjclvixZH9ygB8dtXnOdM00iyF+Eodw=; fh=OPewF8xx7Ek4IvAxpU7boy1U3smsd/rJ9bx1205krL0=; b=hVhjv23c8LLz8C70UMOxt3G1AAHVEqr++M2Kasc9WzN4x8DWV1iwJIKCFUgm5skba9 4NC+yOyhr+R5jbALUbKoA71JCNKilWPJrqXEa+ebb/9XxXXCm9V5MrJRCwtqlx3iNkk9 wATtEAdfb+CBtevVvI5nbsYYu5j87Kfqc/becst4GNlqb3aSUCIUUOEnLhhhMRdpMRnv cObbEL765W8z5jQ7R97Y3KPZZruycNnjtCeEuQ1VfIf/Ufha5+YbUeaBK76/jqLNUBJ5 9aTOHpn5Tdz6ayG6kizkegXwZzysuW1JBVEdWZzbkPFN7I9zRasjiNkj+CiPRQam/eQp VQTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=QKIaoq0D; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-122465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122465-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vw25-20020a05620a565900b0078a2add7b88si790339qkn.166.2024.03.27.23.35.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 23:35:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=QKIaoq0D; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-122465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122465-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BB3401C24EE2 for ; Thu, 28 Mar 2024 06:35:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B553D22EF3; Thu, 28 Mar 2024 06:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="QKIaoq0D" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5256A21101; Thu, 28 Mar 2024 06:35:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711607723; cv=none; b=uak1Q4SGO5ajNI6rthQmMX8GSr5W3LO7qllRW/KtZQvboyjz4WPLuYyr/saMyyVuGAK583C7CUR9jhYNWh15Ga8ecJ9ut78j8Ay3gCm1EGavpVO7X+M5kzHlrzT+HxyRDWMl/CqsbOu24Me0Re6D0e+OS4oN17ZS5pQap8di1Zw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711607723; c=relaxed/simple; bh=6G1sdm/Mzhb5jcW0q/QmO6HkpDa6kSYLU5wqvdfM+eQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TNZjLY3xFcb84340ZdstCKliKqxajCQaFwLE3C8udrtN8fJ7Te4YEbt/DZTU8dzAWB6nn0ZDXzAgM7fHyF4kRg/esZr1/VE5yCpJgxlB9DOK/HXT81dzmjbAtoh6jrQKXbSbLJWamT85CaiYovJ1QArvbqw9RYRPTHPf8TwppTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=QKIaoq0D; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=I9oAmld5QX0jZjclvixZH9ygB8dtXnOdM00iyF+Eodw=; b=QKIaoq0DQM+pMcoJ/ZomQC2wsI MZGE6pmn+xwMSGaMd+ZwrZSJUaS0OfpMfUcBBeH3XLR8sWDQKEfq6FY0RTqQj++RCbZ38NS8l5HkH /8XXc1hnnqUlZZ3LlhcyTkAa5F0BDeKWMehMdLxaW7CBKUD+uLRPP347yLsrLoWI19Mn19gh2R8SB zusQ08tkaJWKM+MlCBOAYFjoasGv5m3vuojsOm1PtHoTE/Y6qmtdpm+SiLsARAeJtW/sp4bNX5dnF rad8JJNdfLJ986enlo3SSrznxH0HLEz+Q0k47QHfTcFvbuR4NQnKM5qR7sktcyd9fNa9XX10c1Ltj +GfmwykA==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpjM7-0000000CjXP-3YqS; Thu, 28 Mar 2024 06:35:19 +0000 Date: Wed, 27 Mar 2024 23:35:19 -0700 From: Christoph Hellwig To: John Garry Cc: Damien Le Moal , Yihang Li , yanaijie@huawei.com, jejb@linux.ibm.com, martin.petersen@oracle.com, chenxiang66@hisilicon.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, prime.zeng@huawei.com, yangxingui@huawei.com Subject: Re: [PATCH v2] scsi: libsas: Allocation SMP request is aligned to ARCH_DMA_MINALIGN Message-ID: References: <20240326124358.2466259-1-liyihang9@huawei.com> <5b5b9392-7fd2-4c87-8e41-5e54adf20003@kernel.org> <0ba9914d-7060-498a-beac-2b19770e1963@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ba9914d-7060-498a-beac-2b19770e1963@oracle.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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.