Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6667455rwp; Tue, 18 Jul 2023 04:13:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlH8sepkqV4ZCwCgbbkxgITNNs6WoIhVBQz51FtcIbHpMKwwEOMOPR64/qNRarY2ecGq3lPr X-Received: by 2002:a50:fb96:0:b0:51d:f3a6:5eef with SMTP id e22-20020a50fb96000000b0051df3a65eefmr2126448edq.36.1689678833536; Tue, 18 Jul 2023 04:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689678833; cv=none; d=google.com; s=arc-20160816; b=ONKl32DLMsS6O1Kj1TlPJczzb4rkG4o9Zq/1FIoExON34D0Axb3hyTwga7R1r23D+I RxrO5q2bSNgIZPzRWwQa6tKwETKzt/wzGFn0Fa5O8IBSJg7FDy9g+DAXbwcFuHf8AKC4 gUIPnHD9jJnWCZm7Zqo5cugTqZaf6ikLSPchr13O76RRv4b9OY7WIoVEf+ApK6yy5h52 Spnl8dQu9Eo6OID3Qk/UpttCeqAjyiEMjyDnqTqwZA9Dw9fD+hL665S9iF5gCHrZyOPr HaTaMsxQMrJN3sTXgJ13+n7AV7ougFkTdMYLvjuQUISRF4s2ZTth5fkJ6VA5wwwoYvgM 5YpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OUjUdujOU6xee9ci8vr4sbSWtz6K7GK3lKu01CccESI=; fh=hY15HEPv0roFHxYbB6TZjZ66Dg9xQo1l6RYxQeTm4Xg=; b=ewVRXTsFsmHFp3N+CLZpVPqYO5uSaQ2Hdkicez5UpAPGn4obCU8uTDO7eFNC6lAfX9 vmqiECHvfo5FqRSYgA16Dojx6mYUaxsXA3irOV42w8o0EcKIMUM6ILVL4qbMIn3ICUaK B9bpMx7EJGafezbmiukWRJJdC2vNugX/wVXdMpqEFqCr7jTf0QOabqdtyYDlUrgORWfa hHHYtLvM1p4P9lXOE7c2CAIfd4L12Juhc5tHxH+YqTD7c+mAzhDrqzbvLgUuKOmGpVJn 2I6y7bnY2hZdxBpE6amlG0DGR7LV2Y7+GgMU4bPwPePbtm7/sOd8csTVn8RwSYyMy9Ri /ZPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s3ikNNxk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lj21-20020a170906f9d500b0099014bccfc9si997906ejb.142.2023.07.18.04.13.29; Tue, 18 Jul 2023 04:13:53 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s3ikNNxk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbjGRKlq (ORCPT + 99 others); Tue, 18 Jul 2023 06:41:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbjGRKlo (ORCPT ); Tue, 18 Jul 2023 06:41:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73540F0 for ; Tue, 18 Jul 2023 03:41:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 117E86150F for ; Tue, 18 Jul 2023 10:41:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20A67C433C8; Tue, 18 Jul 2023 10:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689676902; bh=OUjUdujOU6xee9ci8vr4sbSWtz6K7GK3lKu01CccESI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s3ikNNxkzZVm7sBvTch39A392lKdsF/MtLcWBHZrDSjcVZ+SryKeypemdThHWZ+6T YlBh1j2T4dcMNoC+ECE/Fuq4UojR2o2lChd6E8f+hQLFOgF8NDA8p9Uoyp2Uc/9VEg 5pCOqd9GXoOGyyRanr8JMFAqGkbvRn9Ru7nhv33E/iaHALHu26Wp7GYcjoDQkwtJLp rTmvuGXAymnL2SRA/3PuA30frH6/MCdmLx82NbedDQPKQbW4kidrmDxvtCkGo5pTJk AbB5BqYgyWSe+Cegf7tqkirsUWrAL8gt8bHZsttVgWQM71+UTPPpdGq8JFPTJBnhh7 iirU7dVHOAjMw== Date: Tue, 18 Jul 2023 11:41:38 +0100 From: Conor Dooley To: Jisheng Zhang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] riscv: enable DMA_BOUNCE_UNALIGNED_KMALLOC for !dma_coherent Message-ID: <20230718-regulator-hardened-919cb8f4e562@spud> References: <20230716165147.1897-1-jszhang@kernel.org> <20230716165147.1897-3-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WaDhwX/tojNUxqXP" Content-Disposition: inline In-Reply-To: <20230716165147.1897-3-jszhang@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --WaDhwX/tojNUxqXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 12:51:47AM +0800, Jisheng Zhang wrote: > With the DMA bouncing of unaligned kmalloc() buffers now in place, > enable it for riscv when RISCV_DMA_NONCOHERENT=3Dy to allow the > kmalloc-{8,16,32,96} caches. Since RV32 doesn't enable SWIOTLB > yet, and I didn't see any dma noncoherent RV32 platforms in the > mainline, so skip RV32 now by only enabling > DMA_BOUNCE_UNALIGNED_KMALLOC if SWIOTLB is available. Once we see > such requirement on RV32, we can enable it then. >=20 > NOTE: we didn't force to create the swiotlb buffer even when the > end of RAM is within the 32-bit physical address range. That's to > say: > For RV64 with > 4GB memory, the feature is enabled. > For RV64 with <=3D 4GB memory, the feature isn't enabled by default. We > rely on users to pass "swiotlb=3Dmmnn,force" where mmnn is the Number of > I/O TLB slabs, see kernel-parameters.txt for details. >=20 > Tested on Sipeed Lichee Pi 4A with 8GB DDR and Sipeed M1S BL808 Dock > board. >=20 > Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Thanks, Conor. --WaDhwX/tojNUxqXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZLZsYgAKCRB4tDGHoIJi 0h6dAQCo44pYvI6nANHuLGtYjW6avnzLGuUsYn5qdzK431TdSwEAvpmfuiQjAx+6 2Y1b6+zCOekk56K2qaOXzuHSDGzw/gg= =Px5H -----END PGP SIGNATURE----- --WaDhwX/tojNUxqXP--