From patchwork Sat May 5 16:09:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10382209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A064060353 for ; Sat, 5 May 2018 16:09:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91FA028C0A for ; Sat, 5 May 2018 16:09:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 869AF28FEB; Sat, 5 May 2018 16:09:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5211728DDE for ; Sat, 5 May 2018 16:09:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 713EC6B0269; Sat, 5 May 2018 12:09:54 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6C4AA6B026A; Sat, 5 May 2018 12:09:54 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DDE66B026B; Sat, 5 May 2018 12:09:54 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 1C1D96B0269 for ; Sat, 5 May 2018 12:09:54 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id z1so3765586pfh.3 for ; Sat, 05 May 2018 09:09:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:sender; bh=2Yf7a+mj/tGt0/1rDVUiDy/basB9bxCg8A+5f3jMDWQ=; b=eTekqXBV7bXGn5mIIddmjkkya8eYPnQa7zXwwXvg7/E5Dfk3wC8ZuvFNgXttemztxd qnj/jXtlFtQSD6QQoX0oB3GXuSyqkGw8Pwp6Qo11/ufQqDabb6kErFs92LU8gLgmpYuG HnoPPzOupTu34guzqTfOXpNyaZezZqR1cpgb3dxHiPxhRg07ytqYw5XDoaIWNOadvsAy 1bLv5RUl5kCJFXLrDyv4GkjCoE9SXmJTW3qgZVVNouV+xP1DSG6fWfbmX2VjW3kusAVN S4nz4XJu3vflR/02IbcjpKq4HubNMu/gemMb7DPPxyXfHRiUCOtXpGkpUw9RoDy64IfQ m6/Q== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 64.30.133.232 is neither permitted nor denied by best guess record for domain of mchehab@smtp.s-opensource.com) smtp.mailfrom=mchehab@smtp.s-opensource.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: ALQs6tCkGZ0bJ8ieXLCOy/DZyn47Z8f3CBfRd/GXirc9xcsI5hzZkK7b hhAflKqDgHUl2mv1BM+9ttW6sztExzvS/b0xfUNtkh+zUq4U/HlaCSuVCIMpacCRgj8pauQOuV6 7uyG/a7LszQKeOk8dkdkthGwvxLJgI0nRhSy9At3s544vwlHWfzPVb8hvjj6WWMk= X-Received: by 2002:a17:902:624:: with SMTP id 33-v6mr32152833plg.361.1525536593755; Sat, 05 May 2018 09:09:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp/CW88h0HaUFLiXrEjz303ZIKdSW0KBXDnXsVLKCKnfr9+2eqe08uovtpkZA6+3mw7Nyy3 X-Received: by 2002:a17:902:624:: with SMTP id 33-v6mr32152789plg.361.1525536592532; Sat, 05 May 2018 09:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525536592; cv=none; d=google.com; s=arc-20160816; b=K+JGgo0nUygzX1l1BJWyGT3ReUCjxM7VUgvOwJyWWXHn1yN97jmVO0aYqdZV2mD5SM QtouK9C4cHjuOT/SbnT7Rx4Jssg4X70zfBvm8g1c7RoD1Es1w7R4jdlSRDPGC/J4ytph L+PIIPgpAbwiJAyeW+G50Pecf7m/fl7ardoPt+h0L9v1h3vneiZlN3G9lq2ocfAQ0sIk ELl5rmhuKOFx5XG7gwDPPuIBtnLG3LmNfwc8YgcpUdjpSfw4hZfQJEqVgjT26n4BElKZ ZnuFhoI2Nz2teqyQ90iHkEuan+zVUPk2Mx59hO3xaoJS/X4vTY6ru7U5GvN5/0wlWq8J zjOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2Yf7a+mj/tGt0/1rDVUiDy/basB9bxCg8A+5f3jMDWQ=; b=Nz/nFfjVap5T2p90Hvz55R743VV9aEqTpZ6zfw4SsPyiwmJilh6/yOKAPwYGLsmF4Q rYyROPsCVv9eCw28SQap/t6pUmsPmoVNUb5QbE+s8fezF9sfK2LJOIeACCzhOgebAXCC 5h94jcEyQ6wcL7rf4lbu/qtxXiiwXvYCkVQVPSdF25D1V83J4GPfQDtdpNlHSliTjf5y 9egKWT7sG36uB24iA2Ksjj6xm3+rFtnhdMDvaDJKkAQro5X0ALvWXshz/2G2KNJDFv4V ZauDnc8wkGKJpG94KcxVRly5Jun8wDycxOjE/1rZsY3CTc2OMaWXeh4DaNLt5TrnMpN5 JE7w== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 64.30.133.232 is neither permitted nor denied by best guess record for domain of mchehab@smtp.s-opensource.com) smtp.mailfrom=mchehab@smtp.s-opensource.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from osg.samsung.com (osg.samsung.com. [64.30.133.232]) by mx.google.com with ESMTP id z15-v6si15179128pgs.308.2018.05.05.09.09.52 for ; Sat, 05 May 2018 09:09:52 -0700 (PDT) Received-SPF: neutral (google.com: 64.30.133.232 is neither permitted nor denied by best guess record for domain of mchehab@smtp.s-opensource.com) client-ip=64.30.133.232; Authentication-Results: mx.google.com; spf=neutral (google.com: 64.30.133.232 is neither permitted nor denied by best guess record for domain of mchehab@smtp.s-opensource.com) smtp.mailfrom=mchehab@smtp.s-opensource.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 6B01C2122C; Sat, 5 May 2018 09:09:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IADQpn1NNBan; Sat, 5 May 2018 09:09:50 -0700 (PDT) Received: from smtp.s-opensource.com (unknown [177.159.250.117]) by osg.samsung.com (Postfix) with ESMTPSA id 0F54E2121C; Sat, 5 May 2018 09:09:50 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.90_1) (envelope-from ) id 1fEzkp-0009Hk-Ft; Sat, 05 May 2018 12:09:47 -0400 From: Mauro Carvalho Chehab To: Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Markus Elfring , Hans Verkuil , Tomoki Sekiyama , "Luis R. Rodriguez" , linux-mm@kvack.org Subject: [PATCH 1/2] media: siano: don't use GFP_DMA Date: Sat, 5 May 2018 12:09:45 -0400 Message-Id: X-Mailer: git-send-email 2.17.0 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: X-Virus-Scanned: ClamAV using ClamSMTP I can't think on a single reason why this driver would be using GFP_DMA. The typical usage is as an USB driver. Any DMA restrictions should be handled inside the HCI driver, if any. Cc: "Luis R. Rodriguez" Cc: linux-mm@kvack.org Signed-off-by: Mauro Carvalho Chehab --- drivers/media/common/siano/smscoreapi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 1c93258a2d47..a5f0db0810d4 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c @@ -697,7 +697,7 @@ int smscore_register_device(struct smsdevice_params_t *params, buffer = dma_alloc_coherent(params->device, dev->common_buffer_size, &dev->common_buffer_phys, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!buffer) { smscore_unregister_device(dev); return -ENOMEM; @@ -792,7 +792,7 @@ static int smscore_init_ir(struct smscore_device_t *coredev) else { buffer = kmalloc(sizeof(struct sms_msg_data2) + SMS_DMA_ALIGNMENT, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (buffer) { struct sms_msg_data2 *msg = (struct sms_msg_data2 *) @@ -933,7 +933,7 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev, } /* PAGE_SIZE buffer shall be enough and dma aligned */ - msg = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA); + msg = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -1168,7 +1168,7 @@ static int smscore_load_firmware_from_file(struct smscore_device_t *coredev, } pr_debug("read fw %s, buffer size=0x%zx\n", fw_filename, fw->size); fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware), - SMS_ALLOC_ALIGNMENT), GFP_KERNEL | GFP_DMA); + SMS_ALLOC_ALIGNMENT), GFP_KERNEL); if (!fw_buf) { pr_err("failed to allocate firmware buffer\n"); rc = -ENOMEM; @@ -1260,7 +1260,7 @@ EXPORT_SYMBOL_GPL(smscore_unregister_device); static int smscore_detect_mode(struct smscore_device_t *coredev) { void *buffer = kmalloc(sizeof(struct sms_msg_hdr) + SMS_DMA_ALIGNMENT, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); struct sms_msg_hdr *msg = (struct sms_msg_hdr *) SMS_ALIGN_ADDRESS(buffer); int rc; @@ -1309,7 +1309,7 @@ static int smscore_init_device(struct smscore_device_t *coredev, int mode) int rc = 0; buffer = kmalloc(sizeof(struct sms_msg_data) + - SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); + SMS_DMA_ALIGNMENT, GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -1398,7 +1398,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) coredev->device_flags &= ~SMS_DEVICE_NOT_READY; buffer = kmalloc(sizeof(struct sms_msg_data) + - SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); + SMS_DMA_ALIGNMENT, GFP_KERNEL); if (buffer) { struct sms_msg_data *msg = (struct sms_msg_data *) SMS_ALIGN_ADDRESS(buffer); @@ -1971,7 +1971,7 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num, total_len = sizeof(struct sms_msg_hdr) + (sizeof(u32) * 6); buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -2043,7 +2043,7 @@ int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num, (3 * sizeof(u32)); /* keep it 3 ! */ buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -2091,7 +2091,7 @@ int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num, total_len = sizeof(struct sms_msg_hdr) + (2 * sizeof(u32)); buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT, - GFP_KERNEL | GFP_DMA); + GFP_KERNEL); if (!buffer) return -ENOMEM;