Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95C44C6FD1D for ; Mon, 20 Mar 2023 07:57:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbjCTH5t (ORCPT ); Mon, 20 Mar 2023 03:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbjCTH5q (ORCPT ); Mon, 20 Mar 2023 03:57:46 -0400 Received: from xry111.site (xry111.site [89.208.246.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DD6410259 for ; Mon, 20 Mar 2023 00:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1679299064; bh=VxC0eBySV+UHVLpViRTKZxFwXRZN0yKf8KjRsWMjWtk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=mEjFeEAqrHkFNaxJiE9kTo1ygzZrIo8+6qyTMrFlHNzL2bj1xhDZcUhNhpnXu81fQ EwXVBkXxniX89j6AmwW6+0atUm8duHG92ZH+UaILg5Vy6fDxS6YFBUEueCMegimsiF kNkQHuE9fHrsfutle3QxGBoqmmEbOe4wtaCncwjA= Received: from [IPv6:240e:358:11f7:6300:dc73:854d:832e:4] (unknown [IPv6:240e:358:11f7:6300:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 97A0B66128; Mon, 20 Mar 2023 03:57:32 -0400 (EDT) Message-ID: Subject: Re: [PATCH V4] LoongArch: Make WriteCombine configurable for ioremap() From: Xi Ruoyao To: Huacai Chen , Huacai Chen Cc: loongarch@lists.linux.dev, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Date: Mon, 20 Mar 2023 15:57:24 +0800 In-Reply-To: <20230316064142.1802468-1-chenhuacai@loongson.cn> References: <20230316064142.1802468-1-chenhuacai@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2023-03-16 at 14:41 +0800, Huacai Chen wrote: > LoongArch maintains cache coherency in hardware, but when paired with > LS7A chipsets the WUC attribute (Weak-ordered UnCached, which is similar > to WriteCombine) is out of the scope of cache coherency machanism for > PCIe devices (this is a PCIe protocol violation, which may be fixed in > newer chipsets). >=20 > This means WUC can only used for write-only memory regions now, so this > option is disabled by default, making WUC silently fallback to SUC for > ioremap(). You can enable this option if the kernel is ensured to run on > hardware without this bug. >=20 > Kernel parameter writecombine=3Don/off can be used to override the Kconfi= g > option. >=20 > Suggested-by: WANG Xuerui > Reviewed-by: WANG Xuerui > Signed-off-by: Huacai Chen LGTM. I still prefer an automatic way, but anyway we can implement it later after a bug-free LS7A successor is launched. Should we Cc: stable@vger.kernel.org and make a PR for 6.3 as well? To me it's a "bug fix" and needed for stable releases, but I'm not sure. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University