From patchwork Thu Jan 25 08:50:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 766228 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD5541B954 for ; Thu, 25 Jan 2024 08:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706172628; cv=none; b=VrRLorGWVAASHXl5n0u9KIrj5L2GCZlHVT8j1kiQELrVtNrB/XYU6bMH0Ud2AUQnBx0Q9ygKtYdlEqEW7Yw3P2Py07Jkm9b8JkGcioLmqua0c70Xdc+HO4kTZgPkJALn5yres0dK29qgyO+cx6LOlv357LtotEGKQkVIQOHvdhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706172628; c=relaxed/simple; bh=EH+77AGVJlszAEz96TBhp+qKRmGjcsF5K96WCfJ8o8I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=gmsf9kpEPCH18NngOofXYoZqL1sldmE9DhM4lQtE3zorkUGoGzycLAS/JUz+e42GWGEYfc8IzHmLcGGH3leeJy/oOhzOBtOAKrg75ZS0swpTElvk45X9+sAlLjYbjQgFRp9U4WSgDrifLd8Zgm/aNUOd7QGPSXs04W5O+iZaBsw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=M7k6wnvA; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="M7k6wnvA" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-50e7ddd999bso7283657e87.1 for ; Thu, 25 Jan 2024 00:50:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706172624; x=1706777424; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=9nzIZ26hgws2/hotMw7rC6A6aDLu0kuLVowyhBFtTbQ=; b=M7k6wnvAPH8H2FZTR0S0qE1xM49BOh2/xL5+jjzcRufqlzb9pZ7If9Kw6SECA3VvzU /bp9r0+D0xIS+UEEM21K4auvqHADzAmXJ/FHHbIB0ZHyv+tKeskARgDmwC6Jm3cAiFgm ofnYXVfjbMlX9tM+ECfeUEWm1Ce5sQgOetTa4ia7RiCTcoZxOlOa+c6iQUTSnOdW9dON a/O36/5ISThtaZF9/NFKxD5qm+yQl2Vj1yj3NOcOzWlyBqCYNWg7FfVvJsdxl2CyXsUg Es2+Yfalzg6WTWYdbQbzxxnzelvBq713ib6kBhGoKRyPcqUw2mVdoM3+cOuK1CtmKKbp Jr6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706172624; x=1706777424; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9nzIZ26hgws2/hotMw7rC6A6aDLu0kuLVowyhBFtTbQ=; b=RUIp3XGh4pUgmtSQvgCy12vYi/92aHZ+kYlhTZiFfsAcvA0isQA+s+DdaoxToe+UJN mUCfothW137qM4Qme/woaeeRcbHWZGH8hsjYD8P6WBZg4uONAXxzrIWZQh55yI1xw/UF AuuOx7ThmGGUDL9z3FkBNnoceqQNy2E5qAfXtQ/ze9iENYFdCpB0bnSH5QGCSrHTgVJN msooj9TZhxVxV9Nr/JpcoaN0ZQy8ytABjFrwn85SiqaFpCTYXVvF4jlHcz11S7v1VfB9 bzvY5VFHoDZ+Tj9v5XGJytBAv4j/DSXV47lbQZIp7NtzXMd9Rde0F/IAmZluUzidIsx+ PuqA== X-Gm-Message-State: AOJu0Yw46cwgfBKzJwAGiuK7nMSO1GWM+YE2THtatUsIVcA6h+41a2lN 9z0gkXfyIoAhqO1v9U+vlXT5qFNLZ+QeZeWQlPlGzAguluibHYe3+wDMQKHnSrHluq/AGR42Kwm V X-Google-Smtp-Source: AGHT+IHJWD3jYEqjozXgzWqcokqJicSTE9IHnA8mciO79pYDUDuyeYTZkSPRMPQqEFQzjJkNW8gzTg== X-Received: by 2002:a19:8c1e:0:b0:50e:7a04:2229 with SMTP id o30-20020a198c1e000000b0050e7a042229mr356615lfd.25.1706172624565; Thu, 25 Jan 2024 00:50:24 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id a6-20020a194f46000000b00510189e1581sm201522lfk.249.2024.01.25.00.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 00:50:24 -0800 (PST) From: Linus Walleij Date: Thu, 25 Jan 2024 09:50:23 +0100 Subject: [PATCH] mmc: core Drop BLK_BOUNCE_HIGH Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240125-mmc-no-blk-bounce-high-v1-1-d0f92a30e085@linaro.org> X-B4-Tracking: v=1; b=H4sIAM4gsmUC/x3MQQqAIBBA0avErBswEbKuEi3KJh1KDaUIorsnL d/i/wcyJaYMffVAooszx1DQ1BUYNwVLyEsxSCGVaKRC7w2GiPO+4RzPYAgdW4eLVqR1p00rWij xkWjl+x8P4/t+a5/YAGgAAAA= To: Arnd Bergmann , Christoph Hellwig , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 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 --- drivers/mmc/core/queue.c | 2 -- 1 file changed, 2 deletions(-) --- base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d change-id: 20240124-mmc-no-blk-bounce-high-d84e8898c707 Best regards, diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index a0a2412f62a7..316415588a77 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -351,8 +351,6 @@ static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card) if (mmc_can_erase(card)) mmc_queue_setup_discard(mq->queue, card); - if (!mmc_dev(host)->dma_mask || !*mmc_dev(host)->dma_mask) - blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_HIGH); blk_queue_max_hw_sectors(mq->queue, min(host->max_blk_count, host->max_req_size / 512)); if (host->can_dma_map_merge)