Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6944233rwn; Tue, 13 Sep 2022 11:13:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR48AFupWOHc6CxbXS6JNaV2LbaskNX2/DgSNfS/8OyA0PTm+AFiZvAksZU1BMMDx+yKOfQx X-Received: by 2002:a17:907:2d0d:b0:77c:d528:70b8 with SMTP id gs13-20020a1709072d0d00b0077cd52870b8mr8411221ejc.681.1663092817448; Tue, 13 Sep 2022 11:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663092817; cv=none; d=google.com; s=arc-20160816; b=W54EAD2Vj3gLBV+rwbDWxOefk/U33/xTcqvQ5us7PYyGC2D5oHmLKQ0whnZCfDBqkI 3wydEQDzUizqJlp3A8b0iVHYvaBLL/Vz6BQNnubhv4p9L8EgnrfSX17wnkB7YRrSuk+b CqpMBxMMROsSBnumBOMAWU/TkNnMVlT00r8JmLe4VHa+uH7f2gVHLi9nB8BGnbdstdv8 TjIWqekyLmsVW3r45WP9XZMPkfSo6mUGFEmD7eulIHEvDqNf7omAZmseHmTLf1Iei870 J3fNP+qzy4IndHdkQdDGwlSUoCWGYYG0nIBiGgVSCE8VtKcskAA5/Y3Rn/WW5akAoflL MHvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CAUHAKvsliDqt6Bith7BoZVpURh1bCvkOtmvTYLFN94=; b=CHcARkQ8LzvPFB6DKnLfDtjS7hEg0dtQ9WbUnYG2/wrdQMUw2CvGeNuUAqGUGUgvMR 03UaSyRgCehRKDn+LkKZHVZZh4zwXYp1nXpWgUWdtbNT3PHArNHNm2vNrf//bqNb3lrh AOFY5MKKW4T/u8AUOYHbW7+xglmk0/GgqTqW5HB8Zp7K+3vkjBbxEb1PH4RDzpxiqsN5 Qs2A2Yw/BIcK9xkKUn+8quisI8blwiUnZbah4t6rzMngrNqkjGIJUUmC5A8p/8W17ifr ggcFoITN9GGruBurTXB+0DidytDJLocGMLf29IMsVPeCeo/xoAVtpyUFXDL8wm9maA2S bYxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GEgSCNg5; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a056402278e00b00447e8ccf579si11109035ede.568.2022.09.13.11.13.12; Tue, 13 Sep 2022 11:13:37 -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=@gmail.com header.s=20210112 header.b=GEgSCNg5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232562AbiIMRx2 (ORCPT + 99 others); Tue, 13 Sep 2022 13:53:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232816AbiIMRwl (ORCPT ); Tue, 13 Sep 2022 13:52:41 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93BB371720 for ; Tue, 13 Sep 2022 09:52:24 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id e187so12481119ybh.10 for ; Tue, 13 Sep 2022 09:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=CAUHAKvsliDqt6Bith7BoZVpURh1bCvkOtmvTYLFN94=; b=GEgSCNg5HmYJ4ERFLxTXHVSrDewcSpNo6KSQQtQd4onLJNSCMdYM0UgxwjfCxZSqjl ZMLTaEGWcQFtF+qiAH0g8YpfD5lStrL3EJ28Qy2KuTx3ipLWZ1/CVx92UI8GHlS86yfW CoYE+eZhVkClgNGW9t5dXws31eOi/5RQCIY6ZdCqw6OdoogqVsZ7du9r4EdBu+e+Yvhx CfBfmWZHeF9W+oeCgpNL6xNwu62QOsfm6CA6MH4ZrbmQkZsZjigM85CMF/Vgl7o43MRP IyWBn9JsLuCRJFDHqlEbyGMp6uq+LtI4qIsswrb1FoYi/cWD+ZUiCT7rq3IWGvQQyugD ZH5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=CAUHAKvsliDqt6Bith7BoZVpURh1bCvkOtmvTYLFN94=; b=tR+9sjqz5thNIe7aiF35g0Av2izhkxrZAtMKAgwk7su3XXwq2+0SzAPPfowaCiINxD Lvpiv2r0Mq9DwsX2sVqfqMbH+aqNKj6h+kWsGl1Zlg7zOs2pDepoKvvgsfjCqFMmid4m jEkBc6PEh0D7VriddpBYgUFj/XP0agvM84x1gWJfHrzO/o0pinwwIc1258Kl+LTJy6lU RH43Jn4b51xnjR1uJRh/vYtZopU11CkPihsfK0LCPV94NUxICvBAQcPDo5dnbTs6e/dw k4ktx1a4Q9qFRx/R1C0y8iGCMF9s/DL7cHPv0JEtr0ZXiM8C8VXbCEpkEHCIFiythHRc jhmQ== X-Gm-Message-State: ACgBeo2cg3w51FazbtAbm9oU8Gqv9fRUfI9YClvplqYN7B7maajwIfNg G5EzKrO1xKPykBM+c112eYbLBZjy19/cLZAM9r++do0yMZ0= X-Received: by 2002:a25:230d:0:b0:6a9:1d4d:6594 with SMTP id j13-20020a25230d000000b006a91d4d6594mr28014766ybj.616.1663087943592; Tue, 13 Sep 2022 09:52:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nam Cao Date: Tue, 13 Sep 2022 18:52:12 +0200 Message-ID: Subject: Re: [PATCH v3 1/2] staging: vt6655: remove unnecessary volatile qualifier To: Greg KH Cc: forest@alittletooquiet.net, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Sun, Sep 11, 2022 at 9:25 AM Greg KH wrote: > > On Sun, Sep 11, 2022 at 09:12:44AM +0200, Nam Cao wrote: > > On Fri, Sep 9, 2022 at 8:03 PM Greg KH wrote: > > > > > > On Fri, Sep 09, 2022 at 02:17:55PM +0200, Nam Cao wrote: > > > > Remove volatile qualifier for the member rd0 of struct vnt_rx_desc, > > > > because there is no reason it must be volatile. > > > > > > > > Signed-off-by: Nam Cao > > > > --- > > > > drivers/staging/vt6655/desc.h | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h > > > > index 17a40c53b8ff..3f0f287b1693 100644 > > > > --- a/drivers/staging/vt6655/desc.h > > > > +++ b/drivers/staging/vt6655/desc.h > > > > @@ -182,7 +182,7 @@ struct vnt_rdes1 { > > > > > > > > /* Rx descriptor*/ > > > > struct vnt_rx_desc { > > > > - volatile struct vnt_rdes0 rd0; > > > > + struct vnt_rdes0 rd0; > > > > > > You can not just remove this without describing _WHY_ it is ok to do so. > > > > > > Have you properly determined why it is, or is not, ok to use volatile > > > here? > > > > I did not carefully look at the volatile usage here. After looking at it > > again, using volatile is actually valid: the structure resides on coherent > > memory. > > Are you sure? That's a very odd thing for a driver to need. Looks like > they are allocating some dma memory and then pointing structures on top > of that memory. Why would you need to have "volatile" markings on a > structure definition for that? These structures are the ring buffer descriptors, which are dma-mapped and their values may be changed by the hardware. For example, the field "owner" of struct vnt_rdes0 is set to OWNED_BY_NIC by CPU, and then set to OWNED_BY_HOST by hardware when new data arrives (at least that's why I can guess based on the codes). So I think volatile is needed. Please let me know if you think I'm wrong, because I have just recently educated myself on DMA mapping. Best regards, Nam