From patchwork Tue Dec 4 22:43:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alex.theissen@me.com X-Patchwork-Id: 10712697 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 5399F109C for ; Tue, 4 Dec 2018 22:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 365B52BC2F for ; Tue, 4 Dec 2018 22:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 260212BEDB; Tue, 4 Dec 2018 22:55:30 +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 B681D2BC2F for ; Tue, 4 Dec 2018 22:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725925AbeLDWz2 (ORCPT ); Tue, 4 Dec 2018 17:55:28 -0500 Received: from st43p00im-zteg10072001.me.com ([17.58.63.167]:17422 "EHLO st43p00im-zteg10072001.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbeLDWz2 (ORCPT ); Tue, 4 Dec 2018 17:55:28 -0500 X-Greylist: delayed 306 seconds by postgrey-1.27 at vger.kernel.org; Tue, 04 Dec 2018 17:55:28 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1543963823; bh=rbZDsLeVdmz0ymGG1zgwRiBen1ARCowDOBb0W1UzqB8=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=QqvTGYV3rcndgV06u/9HkGqFtvta4Wwh+I3XDrKpUJ8Wc9RTTkDXuGw/Z92owSTgG QdpPbtntsuX253ZqTeDFxefuFv+aubp02b/+L2dqevbeuuYUxF8dA5VzDQp19qDUTs D5nBwB74Zun+YNxYypI48LlVQT/VncWOgfwRgg5i1d53/KggacHBtywq3YnzgKrR8c OVA87LxgTPg7iEMEeGf5UdfGmOMB/5SCadLDM6rgnYI0/FknJClH6So+CwXmuUWsXK htTMSbUD0PybCF6fVOHdSkyaDXyVHPkMW6Vl3QXAd+c/N9oOaaPFR1EG7XtG7YxkPR 2og0kN/AdUU2g== Received: from alex-ubuntu.fritz.box (p4FE1EC73.dip0.t-ipconnect.de [79.225.236.115]) by st43p00im-zteg10072001.me.com (Postfix) with ESMTPSA id A0B8DC402A5; Tue, 4 Dec 2018 22:50:22 +0000 (UTC) From: alex.theissen@me.com To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Mattias Jacobsson <2pi@mok.nu>, Alexander Theissen Subject: [PATCH 1/3] usb: appledisplay: Add 27" Apple Cinema Display Date: Tue, 4 Dec 2018 23:43:35 +0100 Message-Id: <20181204224337.29122-2-alex.theissen@me.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181204224337.29122-1-alex.theissen@me.com> References: <20181204224337.29122-1-alex.theissen@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-04_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=995 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1812040195 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexander Theissen Add another Apple Cinema Display to the list of supported displays. Signed-off-by: Alexander Theissen --- drivers/usb/misc/appledisplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 85b48c6ddc7e..39ca31b4de46 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -51,6 +51,7 @@ static const struct usb_device_id appledisplay_table[] = { { APPLEDISPLAY_DEVICE(0x921c) }, { APPLEDISPLAY_DEVICE(0x921d) }, { APPLEDISPLAY_DEVICE(0x9222) }, + { APPLEDISPLAY_DEVICE(0x9226) }, { APPLEDISPLAY_DEVICE(0x9236) }, /* Terminating entry */ From patchwork Tue Dec 4 22:43:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alex.theissen@me.com X-Patchwork-Id: 10712701 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 27D6B13BF for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19A932B363 for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E30D2C61C; Tue, 4 Dec 2018 23:00:30 +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 B71392B363 for ; Tue, 4 Dec 2018 23:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbeLDXA2 (ORCPT ); Tue, 4 Dec 2018 18:00:28 -0500 Received: from st43p00im-zteg10072001.me.com ([17.58.63.167]:59265 "EHLO st43p00im-zteg10072001.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbeLDXA2 (ORCPT ); Tue, 4 Dec 2018 18:00:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1543963824; bh=1ds0l+1TaxK6S0mxD/CF3L9+GqybxzeMaDqM4zdAQfM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=EUq2YsY9yugMlt87y6XJ0jWRgNrAQZUQ2QhkPC0P+sjg7/JWaG6vJi0RishvijHnQ jRtagyPlP7pR0cVF0Bo/zGXL7lQmDXtKQJwOIOWBVvglboqRry/5BTQpxuKG5z8Vdi xujk0GLl0ezFDBmslnmdnD8IlkgCO/Q3p3jPqnybkzzQGg838kQyjWoVKJt1lF9iiW VPdskbDG2eVHu4PrTpcJcNjh/FQfx6TpGXG3DK2a//KCXXJZqtli+7knrtfEUXwa7t rPn9VIxfFwSXcp0Drv1k2gUcmczBIkzYJqafjbNc1EL89f4JgW1154Uc4WqC3OI7W3 Ki8suAmXAVqlw== Received: from alex-ubuntu.fritz.box (p4FE1EC73.dip0.t-ipconnect.de [79.225.236.115]) by st43p00im-zteg10072001.me.com (Postfix) with ESMTPSA id DB9AFC400E6; Tue, 4 Dec 2018 22:50:23 +0000 (UTC) From: alex.theissen@me.com To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Mattias Jacobsson <2pi@mok.nu>, Alexander Theissen Subject: [PATCH 2/3] usb: appledisplay: Set urb transfer_flags to URB_NO_TRANSFER_DMA_MAP Date: Tue, 4 Dec 2018 23:43:36 +0100 Message-Id: <20181204224337.29122-3-alex.theissen@me.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181204224337.29122-1-alex.theissen@me.com> References: <20181204224337.29122-1-alex.theissen@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-04_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=771 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1812040196 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexander Theissen The driver does allocate a DMA address with usb_alloc_coherent but did not set the appropriate flag to signal that transfer_dma is set to a valid value. Signed-off-by: Alexander Theissen --- drivers/usb/misc/appledisplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 39ca31b4de46..2f3c4769238d 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -261,6 +261,7 @@ static int appledisplay_probe(struct usb_interface *iface, usb_rcvintpipe(udev, int_in_endpointAddr), pdata->urbdata, ACD_URB_BUFFER_LEN, appledisplay_complete, pdata, 1); + pdata->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; if (usb_submit_urb(pdata->urb, GFP_KERNEL)) { retval = -EIO; dev_err(&iface->dev, "Submitting URB failed\n"); From patchwork Tue Dec 4 22:43:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alex.theissen@me.com X-Patchwork-Id: 10712703 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 A16D117D5 for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9120F2B363 for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 855FF2C61C; Tue, 4 Dec 2018 23:00:30 +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 330EF2C60C for ; Tue, 4 Dec 2018 23:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbeLDXA3 (ORCPT ); Tue, 4 Dec 2018 18:00:29 -0500 Received: from st43p00im-zteg10072001.me.com ([17.58.63.167]:59272 "EHLO st43p00im-zteg10072001.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbeLDXA3 (ORCPT ); Tue, 4 Dec 2018 18:00:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1543963831; bh=6Jma3Wq8QmdfwdoZvgt7l4LjkpaiTO7UTHTx8bE6Jzw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=dEFTZbebOn9Qt83xa5vFjpcZj0fmURoJ5RzQP+A3i/neo6cgkE3AZe4tvbEUPIuTu aG3TBNSplnsCjYN5fAeURbrA7ejk5JqN92S3xXmRdbji/i/MgZLhw5d2WfY12JGnda Rzpl7IUOWNWUjJrt2Yt+D28qDwrlkDxmnVjy8PlSpQ6W35ifEfps84lkIqXYU2Ww3T 5F3cGg1tD9JKCHIvEuLoZHWSvm9+4r3x4yKp2LBvJV/KcYs2JCUU56qrXX6O2ATJ32 Xpv+WdhkK7Y3Ui7Y3Z9RmootbtTAYbJhjDnhtkUYyVAlLCfMQx2rEBgRSdFL0h2507 5XCikBgMuakpg== Received: from alex-ubuntu.fritz.box (p4FE1EC73.dip0.t-ipconnect.de [79.225.236.115]) by st43p00im-zteg10072001.me.com (Postfix) with ESMTPSA id B9DABC40129; Tue, 4 Dec 2018 22:50:30 +0000 (UTC) From: alex.theissen@me.com To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Mattias Jacobsson <2pi@mok.nu>, Alexander Theissen Subject: [PATCH 3/3] usb: appledisplay: Remove unnecessary spinlock Date: Tue, 4 Dec 2018 23:43:37 +0100 Message-Id: <20181204224337.29122-4-alex.theissen@me.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181204224337.29122-1-alex.theissen@me.com> References: <20181204224337.29122-1-alex.theissen@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-04_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=795 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1812040196 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexander Theissen The spinlock was inside the urb completion function which is only called once per display and is then resubmitted from this function. There was no other place where this lock was used. Signed-off-by: Alexander Theissen --- drivers/usb/misc/appledisplay.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 2f3c4769238d..ac92725458b5 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -69,7 +69,6 @@ struct appledisplay { struct delayed_work work; int button_pressed; - spinlock_t lock; struct mutex sysfslock; /* concurrent read and write */ }; @@ -79,7 +78,6 @@ static void appledisplay_complete(struct urb *urb) { struct appledisplay *pdata = urb->context; struct device *dev = &pdata->udev->dev; - unsigned long flags; int status = urb->status; int retval; @@ -105,8 +103,6 @@ static void appledisplay_complete(struct urb *urb) goto exit; } - spin_lock_irqsave(&pdata->lock, flags); - switch(pdata->urbdata[1]) { case ACD_BTN_BRIGHT_UP: case ACD_BTN_BRIGHT_DOWN: @@ -119,8 +115,6 @@ static void appledisplay_complete(struct urb *urb) break; } - spin_unlock_irqrestore(&pdata->lock, flags); - exit: retval = usb_submit_urb(pdata->urb, GFP_ATOMIC); if (retval) { @@ -229,7 +223,6 @@ static int appledisplay_probe(struct usb_interface *iface, pdata->udev = udev; - spin_lock_init(&pdata->lock); INIT_DELAYED_WORK(&pdata->work, appledisplay_work); mutex_init(&pdata->sysfslock);