Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1227987rdb; Fri, 9 Feb 2024 14:43:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWqMOeh78dT5XJgx3QZMGOgcmEwHyoR8rWOB/vBkaHpPqLzMzRBRFvWZK2FaKVNHBmtLZ7llNtiiZpj/EWcYwq3O9nw+R29K6+s+8D+OA== X-Google-Smtp-Source: AGHT+IFe63ITB5ALhqupsm/8Oj9ahfvhGsMqQu4JOzCCbT5nRX4kLksJeOVlSZ0SrSv+cg/UiM3N X-Received: by 2002:a17:902:e747:b0:1d9:93d2:5208 with SMTP id p7-20020a170902e74700b001d993d25208mr567245plf.49.1707518591633; Fri, 09 Feb 2024 14:43:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707518591; cv=pass; d=google.com; s=arc-20160816; b=YHOhQiVtb7jhkUc3AdZ1rgEogNdfiqxseSFbH4c7KkcsabUTO+wh0mGjNQbM1b7Bbs zeZICUn669qZeCt4Sus4C23t0LqgeoRz1YgWyw2dIpE8txVjYN6hlXQMU7TMZdbQOk5Z f+yCjR0KhlOxx7BVkqAyJ6omi6qRttbeOBJtwBXRpk3JN927960zGGcglPDoPYgObPf0 6L33qAGpFmWPd3ygGNu2abQCBtcyUFfD+ILOspIuS8RAimeCQBi93SJHlLWougrrkllo UGFlPcnPVEpayNlxPx88Cl8CgGy3cv4EHdQm75zixoPn7MLgysJf4ojGN7XpIwEQtpKY V1eA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g08OD95zO0evzItjiisNGkneCI2RU5eoD/nZFVxxKbk=; fh=CFGD/UpYM2NH/+WxoFLd6X/nHwlOGQsN44zV8zGzITM=; b=yJ91IeE61yWc19zr/Libpm/Hc9Tohrb2oVCDpX1MvpGEAm21EaeYAU4mNp+7eVQazQ HS66LD3oL/hl9rimUf9oAaQxdmzL4tpM42iNNu+nTNWfm9rFM312AxUsv13VJvgJNGAQ t+Z9HNM8VdhxLmBw4DF9yp6sXgxymVN0TrlY9Y4iSn9KCvHbHRiruHNQBdQWlYKkkQPD sv2MJsu7mJUBQtin0RSSANy4EEmkP9ku+P3ScauoJwG3Dg3Y59a7HQQp3F20FhLxWTvd Qp/BqWXT5IEmRWseATYjDBMUTveOA9GDJZPkSU5qLIGiFN4oEbKZowucVDE5I2X0uxNn FSjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=k5ZHtjuG; arc=pass (i=1 spf=pass spfdomain=rere.qmqm.pl dkim=pass dkdomain=rere.qmqm.pl dmarc=pass fromdomain=rere.qmqm.pl); spf=pass (google.com: domain of linux-kernel+bounces-60129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl X-Forwarded-Encrypted: i=2; AJvYcCVHYWp9pu6ngC2rY1Sm6C2MdAknLl/rUoODdwLhd+j0l6I/vBnWyD/kYKpCBM1A/UZ6nYtas9O5p67HBDNnCGvB0bFfqrWYX8gCawkbLg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u13-20020a17090341cd00b001da0c89e798si2440304ple.438.2024.02.09.14.43.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 14:43:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=k5ZHtjuG; arc=pass (i=1 spf=pass spfdomain=rere.qmqm.pl dkim=pass dkdomain=rere.qmqm.pl dmarc=pass fromdomain=rere.qmqm.pl); spf=pass (google.com: domain of linux-kernel+bounces-60129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4E7DF285163 for ; Fri, 9 Feb 2024 22:43:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 536302E40E; Fri, 9 Feb 2024 22:43:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b="k5ZHtjuG" Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CFB434CD5; Fri, 9 Feb 2024 22:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.227.64.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707518582; cv=none; b=sKjyuyMG71AnilOE99N7ApEuUK8xSSuObTxYmPXhdvQ5v64dVQ20UsvWWq/lOQOPj9xchQ2bqzIwZqU3MdT05i31Y+6XMWj/fnDP5b4e7xbZRyZHfOzkOxv11nbzuDanu7V+tkIyn9ftLcu5BKqM37wH5ZzCaARjw3+G9LnMY4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707518582; c=relaxed/simple; bh=0VrvZ7V1JHCIdSHJkSJPYRxvDvx/5ayihD+OUxA6lZQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=urF/Ot09p7hrkjOw3WFl1InUjdTubQSHPCRUHYcmyUmQp4HH0qDcSQiEFYos8u7K/HQltHJSirPXuED/sxbCq2GEHTGO3Ljc++ARQwOUGKhIPqBfnuv3Xj2ne6WRgz48L0uOGZz1NKKd895SCI300yWQvHtv4CGfgHpyZC1Vxl0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=rere.qmqm.pl; spf=pass smtp.mailfrom=rere.qmqm.pl; dkim=pass (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b=k5ZHtjuG; arc=none smtp.client-ip=91.227.64.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=rere.qmqm.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rere.qmqm.pl Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4TWpZp6CMszBR; Fri, 9 Feb 2024 23:35:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1707518115; bh=0VrvZ7V1JHCIdSHJkSJPYRxvDvx/5ayihD+OUxA6lZQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k5ZHtjuGdfiiMlGsBNgkQ+/cwOlBC1f/ZWvTDtSrGXq/un7xNh+cAWHGNkVYuStKd TKiU/Mt+RotJYBpK4wllp2Kb2MovQ0drodGCL5N7mSwQY29HR1fMbwg9gR6xX5bIIS Y9ozhVXrANTyWa5QLXXa+aN9RJRfLJIb0G+9sbPV8gP55LJ3iE3sMB9/bDYbOlTSnN PC3tTZ9bqRVFlz3wReNzKsJjnkPxEuo8XEcaj66iYYVYYAPcHzcjUSIA9e1pRhC1Sm CzfnFiJbDSXRnD8V3f7iohL6VFyag5ZHp/HoHfHRdaOVX8ETvduc+Voj3pbdeGQ46H P95Z5Q0jCvYvA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at mail Date: Fri, 9 Feb 2024 23:35:13 +0100 From: =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= To: Arnd Bergmann Cc: Linus Walleij , Christoph Hellwig , Ulf Hansson , "linux-mmc @ vger . kernel . org" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmc: core Drop BLK_BOUNCE_HIGH Message-ID: References: <20240125-mmc-no-blk-bounce-high-v1-1-d0f92a30e085@linaro.org> <8ca6a46e-551a-4400-965f-f4ad60bff072@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8ca6a46e-551a-4400-965f-f4ad60bff072@app.fastmail.com> On Thu, Jan 25, 2024 at 10:47:26AM +0100, Arnd Bergmann wrote: > On Thu, Jan 25, 2024, at 09:50, Linus Walleij wrote: > > The MMC core sets BLK_BOUNCE_HIGH for devices where dma_mask > > is unassigned. > > > > For the majority of MMC hosts this path is never taken: the > > OF core will unconditionally assign a 32-bit mask to any > > OF device, and most MMC hosts are probed from device tree, > > see drivers/of/platform.c: > > > > of_platform_device_create_pdata() > > dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); > > if (!dev->dev.dma_mask) > > dev->dev.dma_mask = &dev->dev.coherent_dma_mask; > > > > of_amba_device_create() > > dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); > > dev->dev.dma_mask = &dev->dev.coherent_dma_mask; > > > > MMC devices that are probed from ACPI or PCI will likewise > > have a proper dma_mask assigned. > > > > The only remaining devices that could have a blank dma_mask > > are platform devices instantiated from board files. > > > > These are mostly used on systems without CONFIG_HIGHMEM > > enabled which means the block layer will not bounce, and in > > the few cases where it is enabled it is not used anyway: > > for example some OMAP2 systems such as Nokia n800/n810 will > > create a platform_device and not assign a dma_mask, however > > they do not have any highmem, so no bouncing will happen > > anyway: the block core checks if max_low_pfn >= max_pfn > > and this will always be false. > > > > Should it turn out there is a platform_device with blank > > DMA mask actually using CONFIG_HIGHMEM somewhere out there > > we should set dma_mask for it, not do this trickery. > > > > Signed-off-by: Linus Walleij > > Acked-by: Arnd Bergmann > > I think it's worth mentioning the cb710 example here, which > uses a platform device as a child of a PCI device and > does not assign a DMA mask nor use DMA. > > This one will see a change in behavior, meaning that the > blockdev buffers are no longer bounced. As far as I can > tell, this is fine because the driver appears to correctly > use the sg_iter infrastructure for mapping data pages, > but it would be good to have this confirmed by > Micha? Miros?aw because this code path has probably never > been tested without BLK_BOUNCE_HIGH. Hi, this driver doesn't do DMA at all, so having DMA mask set or not it should be good as long as the CPU can read/write the buffers. Best Regards Micha? Miros?aw