Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp2398088rdb; Thu, 17 Aug 2023 22:11:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbbAPrs2VLW0K/ONTe3zr3hqLUxJB9mwRL8g6rLY69bbd3g30fiRZY144t6ogDuIbRQXzU X-Received: by 2002:a17:907:2c57:b0:99b:ea9d:61c9 with SMTP id hf23-20020a1709072c5700b0099bea9d61c9mr906614ejc.57.1692335484943; Thu, 17 Aug 2023 22:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692335484; cv=none; d=google.com; s=arc-20160816; b=nNd1dczwo/PFkxQ3FjLQOxeQ0BohBcInhvBABbQiko/IUtVQCF6Hksw0P2PCDpxCI3 eotnZGDtYqOefZCOSJ9C8BtSv6/jxArOgkOqozu9T5Lqd4fD2LbBudzlGHU82fsvKP39 wSjca+Re2JN6SO5zAdDArVzgKF0lhsFNIaxVe4u9Mc2UrKlXhUcmeml405Oczp9dYUfN TYJoopn4wpshpE6tY6E73ADBFrGUlYglFJMOuEGmWKTX2q8bg266EPHnTOcCPhM0inEE heR07Ukuebj8v7eSoS/+sd6LC+ckGLVhihFuJaiY+49Z/oa+4Rl29DC5byQXHC39hjYO Gugg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=QUDeEdK71CYHlo73i+y41vn6JAu4hKRVWnte545nN88=; fh=KycCRtD6ZI5Neq9gvlkWxh3tgB8+UrHclD8XFxygydU=; b=Tw5WC0uCY2MC7WIFPVKK3LGDyxKJBEVa7hvTaFwQQaspiveNM0FS/nwuKJI6TD18q/ RP0G4fG3rNeBKfqcSzeSs2WcIp7vCKkvfIuummbXzfNootZeJz4KKH4wSt/bKwITHHDm 4OG16Qw1lE5a1sCuMm13OMAhCVIEYw9N3ObiXzdALe1F6IZOYpDHibvdQQnFmlp02n6H od6RQST72XLggRyb5b+cdQ02YqR8sdoZbSu0uJQY7nqjaSrayxVBKtfI2VnVI35/03KQ vWVt0xPMemf+AdEZODJmgbp14iWUwQ5nmWzRwVqelyEygSGufNiw5vOJ3pHl1ihz1QFq d6eQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a1709062dca00b00997c25decfcsi765583eji.187.2023.08.17.22.10.59; Thu, 17 Aug 2023 22:11:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350390AbjHQLmD (ORCPT + 99 others); Thu, 17 Aug 2023 07:42:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350389AbjHQLlo (ORCPT ); Thu, 17 Aug 2023 07: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 75B4510C0; Thu, 17 Aug 2023 04:41:42 -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 09F066395C; Thu, 17 Aug 2023 11:41:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA2ABC433C7; Thu, 17 Aug 2023 11:41:39 +0000 (UTC) Message-ID: <5f4a78e7-91dc-4d82-c46f-866f3492b674@xs4all.nl> Date: Thu, 17 Aug 2023 13:41:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] media: vb2: frame_vector.c: replace WARN_ONCE with a comment Content-Language: en-US, nl From: Hans Verkuil To: Linux Media Mailing List Cc: Marek Szyprowski , Tomasz Figa , Linux Kernel , Jan Kara , David Hildenbrand , Linus Torvalds References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 17/08/2023 12:41, Hans Verkuil wrote: > The WARN_ONCE was issued also in cases that had nothing to do with VM_IO > (e.g. if the start address was just a random value and uaccess fails with > -EFAULT). > > There are no reports of WARN_ONCE being issued for actual VM_IO cases, so > just drop it and instead add a note to the comment before the function. > > Signed-off-by: Hans Verkuil I forgot to add: Reported-by: Yikebaer Aizezi > --- > diff --git a/drivers/media/common/videobuf2/frame_vector.c b/drivers/media/common/videobuf2/frame_vector.c > index 0f430ddc1f67..fd87747be9b1 100644 > --- a/drivers/media/common/videobuf2/frame_vector.c > +++ b/drivers/media/common/videobuf2/frame_vector.c > @@ -31,6 +31,10 @@ > * different type underlying the specified range of virtual addresses. > * When the function isn't able to map a single page, it returns error. > * > + * Note that get_vaddr_frames() cannot follow VM_IO mappings. It used > + * to be able to do that, but that could (racily) return non-refcounted > + * pfns. > + * > * This function takes care of grabbing mmap_lock as necessary. > */ > int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write, > @@ -59,8 +63,6 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write, > if (likely(ret > 0)) > return ret; > > - /* This used to (racily) return non-refcounted pfns. Let people know */ > - WARN_ONCE(1, "get_vaddr_frames() cannot follow VM_IO mapping"); > vec->nr_frames = 0; > return ret ? ret : -EFAULT; > } >