From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36EA1C3ABA9 for ; Fri, 2 May 2025 07:03:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35DB26B0088; Fri, 2 May 2025 03:03:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30D576B0089; Fri, 2 May 2025 03:03:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D5FF6B008A; Fri, 2 May 2025 03:03:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id F3BE86B0088 for ; Fri, 2 May 2025 03:03:00 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E41A316077E for ; Fri, 2 May 2025 07:03:02 +0000 (UTC) X-FDA: 83397075804.26.6EC0273 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf15.hostedemail.com (Postfix) with ESMTP id 38045A000B for ; Fri, 2 May 2025 07:03:01 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=o1P8mEo9; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf15.hostedemail.com: domain of gregkh@linuxfoundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1746169381; a=rsa-sha256; cv=none; b=6cAikIfEYuChC/Uk1B+sh6+5mWcf4kgn6Gu4BizIyx4eiMh3t8/8wYHAFzQCdkBrUk2Gf+ 1+XvQOXuJlHQj5+cEB90/JdGTr9Uzh34gPpK21fIp8CkWQQLO6bUF01ylVdaEXMzP6fN3Q XWyKztMgaTYK4TGQ5yezP6y99H2Ocuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1746169381; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=H9Fer44mCNu4UjwlrBwztRIRC+E7O0/1jL+qwChJKyU=; b=m6c41rIAqFULD9pBodlhwcLSamH+6uT+izx+EHc2VGqrCF0Zcv7DNQOBps/ev2c48laeub S8gweSKvdw66UOtOTvAuGCZgYmt6w+m/Uv5ppiZyrMiJeRlipH/64WWdCHxae/hSGD4rVu +XTx8gX2KWLFD+lq+cAwzQEFSPwddxc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=o1P8mEo9; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf15.hostedemail.com: domain of gregkh@linuxfoundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9B0DFA4B849; Fri, 2 May 2025 06:57:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB224C4CEE4; Fri, 2 May 2025 07:02:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746169380; bh=imq2Al4rJh9ulHm/zPY/w2S9+0BvBdWhHs5zM/0Klik=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o1P8mEo9sseKF/ocFZoKXCtI6pbHoRRiap+qnfhjBiMUUGzzXBnWs4P/3mtTfymQv IA1AsW7D/AYNvxBQ3IMOjxyytuARUzALB391EDKilw7U9cwJUrbV+oJZOfUO7bUpC3 yZXtYoc3p7tw3RZfA+nXH3jbrZqHjLR+JRhrXRu4= Date: Fri, 2 May 2025 09:02:57 +0200 From: Greg KH To: Christoph Hellwig Cc: Jens Axboe , "Martin K. Petersen" , "Juergen E. Fischer" , Alan Stern , Andrew Morton , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-mm@kvack.org Subject: Re: [PATCH 4/7] usb-storage: reject probe of device one non-DMA HCDs when using highmem Message-ID: <2025050258-afraid-outweigh-e36c@gregkh> References: <20250502064930.2981820-1-hch@lst.de> <20250502064930.2981820-5-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250502064930.2981820-5-hch@lst.de> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 38045A000B X-Stat-Signature: 8qaejbigyx45xrd6ksdrd1k6ei6wu6of X-Rspam-User: X-HE-Tag: 1746169381-654582 X-HE-Meta: U2FsdGVkX1+Ho9gcSym1w0Va7/ojQHGtBgU1xmkQaOQZcYoi+SCRDDeWp3nwrxGwNVO6lbfjb0UrB9af7I79IAZEmifP+CqIMhpeBsB/apHKESTJTdLauf1KwHq7CdTTT+IoMJnKdX20wa7oG1it72JW+a6ufxRciM6ZAGFQORfy66a2/3Ii50jkQyA9GWguckHu4bFSVKHmXMir2xVhyyEO1Dwk9HEGyc80JnTvVGZ7G/vC1Er4m4KF+fhnvc+mGo376zT6lpNKI/ecnEuCbVVFGbpDH7Ln7QP6BamQOAWosn5+e0sdGpyYYBEilMOXiebN2mlqc4ygzqF7Gv+XV3G8NuHhEYOIrKwjUdnPtwKo8+zjQFIs75OR8C49iGFq0JlzvdvziAkwgK8KPWU+8NHnoc2SEtvec5Cp0qmyap85zWokyAtksWN7zf/UPC2p5U8+hHxGz3+RXYLzDPvOjPfdYG8MsuyUmZVrycP6npZDV51lQbFED7i/FgMWWb70By1ySOraQDcojpb/QnabVQ2u/TdRnGu05bH93S6w4fsKO1pTTBnTrI4WdN3XgcSkdMRW9/8gqCjVBY+gZ3OthQSJgk1ImdhRVW7tRYRvFp2fLQTE4Qt8W/doTLxEUIDnk4K2ur6SraFuZIaSx83pT2+WxbRpKdVi88zTrZSTfs4rif2e7Xlq+Eofp6Mapg4b0s+R7UeseUVcjmguHYHaERTHBMccBe8ebRuVyqIMRAtTuGH2ixj4tZpgkn3ZrixO1KRKfZcc/m38JEkc/cHNHc/zLIBbzzMM2aIbPjA42EMOePX2YU+JOjhxuIfzbv6SM7htwzpy8sL/8tc8036iQwrKVi0l2RAecLTsm37HvJNTROhBemn/x3vqBASAPTQumxvnh0W2OE/rjph+xdbKJBPe0uISWK8PRLwZe1OSJdwdStwOcGNXIJpQyWlq6jKvbzELqaVPYyRiy4/gGrz 7KxsLPKo 2LTpWqW3x5TZnF62NoerbVbQeOkW5XtCjYSawnryG1CpA7qH2jF9Ci+9atKbAyxrfWxR/0hOf1E6SwbGhz7zvtkIRG5NypehpGZRdNpGMZPThRrIYml1RNgBnHxJrua+uPwmp6bVvv3srCGl0EEuqOV6bUkfbndidRL5vbhb9flEc66TVG5uaj5ZMg7otLBcpJW645QYFvRMVY7P1yWdW4rU52COM7C2UmxHfVQ6RBDRWPSSnUXpEiDKyl8+J9T7jGsC4ukwvyv24EYcrtMy0oHu74Rqj0CBuAN2jhsrnXPJqcXbhXLiN1WHZGq1WdTFAQh/u2f3bjjSQWdtFAH9Ed2o+iyOQnulSPemtdG6tEdgAQnwcbTCB29SYh9bmB8h0uO01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, May 02, 2025 at 07:49:21AM +0100, Christoph Hellwig wrote: > usb-storage is the last user of the block layer bounce buffering now, > and only uses it for HCDs that do not support DMA on highmem configs. > > Remove this support and fail the probe so that the block layer bounce > buffering can go away. > > Signed-off-by: Christoph Hellwig > --- > drivers/usb/storage/usb.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c > index d36f3b6992bb..49bbfe4610d5 100644 > --- a/drivers/usb/storage/usb.c > +++ b/drivers/usb/storage/usb.c > @@ -1057,12 +1057,15 @@ int usb_stor_probe1(struct us_data **pus, > > /* > * Some USB host controllers can't do DMA; they have to use PIO. > - * For such controllers we need to make sure the block layer sets > - * up bounce buffers in addressable memory. > + * We can't support these controllers on highmem systems as the > + * usb-storage code lacks the code to kmap or bounce buffer. > */ > - if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) || > - bus_to_hcd(us->pusb_dev->bus)->localmem_pool) > - host->no_highmem = true; > + if (IS_ENABLED(CONFIG_HIGHMEM) && > + (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) || > + bus_to_hcd(us->pusb_dev->bus)->localmem_pool)) { > + dev_warn(&intf->dev, "USB Mass Storage device not support on this HCD\n"); > + goto release; > + } > > /* Get the unusual_devs entries and the descriptors */ > result = get_device_info(us, id, unusual_dev); > @@ -1081,6 +1084,7 @@ int usb_stor_probe1(struct us_data **pus, > > BadDevice: > usb_stor_dbg(us, "storage_probe() failed\n"); > +release: > release_everything(us); > return result; > } Hopefully this pushes people to use UAS devices instead :) Should be interesting to see the fall-out to see if there are actual systems out there like this still. Acked-by: Greg Kroah-Hartman