From patchwork Thu Nov 29 22:30:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 10705457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A6F51057 for ; Thu, 29 Nov 2018 22:30:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BDD72FB48 for ; Thu, 29 Nov 2018 22:30:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 608732FB57; Thu, 29 Nov 2018 22:30:20 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E51632FB53 for ; Thu, 29 Nov 2018 22:30:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbeK3JhV (ORCPT ); Fri, 30 Nov 2018 04:37:21 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37410 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbeK3JhU (ORCPT ); Fri, 30 Nov 2018 04:37:20 -0500 Received: by mail-wr1-f67.google.com with SMTP id j10so3465479wru.4 for ; Thu, 29 Nov 2018 14:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=jhxu5l9PQoc/IxsPNHRolK020u4/JxBHLQXcs88Bgv0=; b=oyREmhn82V6qqugBtGIXH5CZP5K/cMUSYS49pJMchPh5gPtyP+PGaeG5eafOVRdIaT T1EfmCpaj1AWQOANCAA6/aKSEB/rQJQXt/XkWAx4kxxA0sOAIjqXHvh0FYEK36dullLa M6k4vU3A6zFLd4+6gLOXvvhVqLcXAZJmgA+Q9m5mhlILOuHFh815FNH/L9J4K8hHomsA w+Rvr1bYDH53L5oXSFLHemqV+W4OWMsL+KMVWcjf3mLfj+IPzQuHJnwsrGC4hf/HcFne Ti4kTCgbR5v6pVYwv5Am2dH8+p300wUhsloaCZe6fkSkSr2eXddIUuVu11fsxzM3iXhh vWdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=jhxu5l9PQoc/IxsPNHRolK020u4/JxBHLQXcs88Bgv0=; b=CCZGMnMdkdZM3BufZpkRp8OmdDxnh0hEKU29+uv09z8E+0eZ7QWLz+1H8EZonGe6ey Sj/ZFsNBtXRCDk9qxwDRdbqeMrDTmwvc/2wTNtatFF6b10EA6Hd8xcjvjWHw62oWWfd7 F3pF1SJmOZrWyIidNgJqbU9WNBZgKTpwe4kKgWXcsuISLSwVD88TPGWydbjdM7Ah7l4F k8ia8g+unPxMlV+iQHKPB525OEe1fE3p5DRvzkyaNQcwWkLqz0RUxxgWxJB2qzrxEqbo N83kUi8t48iEqMuS0fYroT63biHzSYIzBo4rjHRWnywh7UpTwzeI8hiU7DbUtd78iAWK pCXQ== X-Gm-Message-State: AA+aEWaakCdBf4ojOC7H0mUZigC3OBXiWxvIS0hNbeakEThBJYjYHoWL 14M13fqXRUD5cXeJ60OE68RFdaVr X-Google-Smtp-Source: AFSGD/UWAU+0Ic02fIvcbwbXA0tr1ZwVbsx/L+1ekTyP8kNk4NdI40N56/74hCM0JQr8Hl5OiW2zmw== X-Received: by 2002:adf:ffca:: with SMTP id x10mr3046147wrs.289.1543530616946; Thu, 29 Nov 2018 14:30:16 -0800 (PST) Received: from [192.168.43.227] (92.40.249.58.threembb.co.uk. [92.40.249.58]) by smtp.gmail.com with ESMTPSA id h131sm5525852wmd.17.2018.11.29.14.30.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 14:30:16 -0800 (PST) From: Malcolm Priestley Subject: [PATCH 3/4] media: lmedm04: Move interrupt buffer to priv buffer. To: Linux Media Mailing List Message-ID: Date: Thu, 29 Nov 2018 22:30:15 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Interrupt is always present throught life time of there is no dma element move this buffer to private area of driver. Signed-off-by: Malcolm Priestley --- drivers/media/usb/dvb-usb-v2/lmedm04.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c index 8fb53b83c914..7b1aaed259db 100644 --- a/drivers/media/usb/dvb-usb-v2/lmedm04.c +++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c @@ -134,7 +134,7 @@ struct lme2510_state { u8 stream_on; u8 pid_size; u8 pid_off; - void *buffer; + u8 int_buffer[128]; struct urb *lme_urb; u8 usb_buffer[64]; /* Frontend original calls */ @@ -408,20 +408,14 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap) if (lme_int->lme_urb == NULL) return -ENOMEM; - lme_int->buffer = usb_alloc_coherent(d->udev, 128, GFP_ATOMIC, - &lme_int->lme_urb->transfer_dma); - - if (lme_int->buffer == NULL) - return -ENOMEM; - usb_fill_int_urb(lme_int->lme_urb, - d->udev, - usb_rcvintpipe(d->udev, 0xa), - lme_int->buffer, - 128, - lme2510_int_response, - adap, - 8); + d->udev, + usb_rcvintpipe(d->udev, 0xa), + lme_int->int_buffer, + sizeof(lme_int->int_buffer), + lme2510_int_response, + adap, + 8); /* Quirk of pipe reporting PIPE_BULK but behaves as interrupt */ ep = usb_pipe_endpoint(d->udev, lme_int->lme_urb->pipe); @@ -1245,11 +1239,9 @@ static void lme2510_exit(struct dvb_usb_device *d) lme2510_kill_urb(&adap->stream); } - if (st->lme_urb != NULL) { + if (st->lme_urb) { usb_kill_urb(st->lme_urb); usb_free_urb(st->lme_urb); - usb_free_coherent(d->udev, 128, st->buffer, - st->lme_urb->transfer_dma); info("Interrupt Service Stopped"); } }