Received: by 10.223.185.116 with SMTP id b49csp821280wrg; Sat, 10 Feb 2018 21:10:25 -0800 (PST) X-Google-Smtp-Source: AH8x224ga+e7LFhOM93yF5P469betEiQbK3ex7DVoqfQ3/ZLBaGBmnAOYu8Ibj9rs4LVwFtQZJUJ X-Received: by 2002:a17:902:47c2:: with SMTP id d2-v6mr7302967plh.222.1518325825082; Sat, 10 Feb 2018 21:10:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518325825; cv=none; d=google.com; s=arc-20160816; b=jgKyaRQ8lzvYKnBBIsRsI4H+AlujMB315A5qo3SmkRR9SI6Cp9IqO5Yn7TWNC3Qdgq kJ8f6rEePOXC2eqYgfy+BDBk49sf8RdjWcLLpTK8vExj/UINhTeILnHI+TmngtSCFrUm Y/y7TLNFMIyB/PzhYiQeZ6Oi2Ia0nl7pW7Tof0EClHALeoXxmOMBPJhPBGAcbQ2jzvI5 3U0l4wsrpE3YAJ8ig178UWK1uvqxO+cCsSNV9fkubLr6/+BLKvm88UexlHF+6489PIlK 7oSP0hc/p20FgdZCJuOrLD+mFE+DiZ/Vlu1r+wnXDkqAatJg83HFKRJgRrr/2ysAhafB azVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=eqlMCkyiY3xP9m48/TZGEB2Zuxm/lH9JKHfUHEURiJA=; b=0Za/WjcXIJAc6w54RI1apgnZUGecFLok1/6utb+l6wWquKVRgNgndkDlsoOx+T2CIA 5AXMlQWIAOAPYUJ5cKxgTsSdsg/vnSx+6rQD32Y/g7KYqETjgJxRJWjR5Vgjaa1/CUp9 0gSLjRm4xFPylpupLGt/Ym7NE3foRe35GZxV4P4/0qq4DgAwPa2RkWwoj+b4N18aQfZb EXfTbFo19ln8CdvsaNd1zkP8AwvqsLvRdinGf/W+3kwkgJQ3+qFgrJIk+DFHdrgKp3J7 oEtLUbQ0u1x1Coc5xl5Lg0VnkEds1oGn6BJU/Kr7M+TRkGNlpH7eC+anAq/3dnA+x3cq Zpjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4-v6si1928724plb.114.2018.02.10.21.10.11; Sat, 10 Feb 2018 21:10:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753892AbeBKFHe (ORCPT + 99 others); Sun, 11 Feb 2018 00:07:34 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41475 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbeBKEdm (ORCPT ); Sat, 10 Feb 2018 23:33:42 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ekjKe-0002hD-H3; Sun, 11 Feb 2018 04:33:40 +0000 Received: from ben by deadeye with local (Exim 4.90) (envelope-from ) id 1ekjKX-0004U0-Rn; Sun, 11 Feb 2018 04:33:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Bartlomiej Zolnierkiewicz" , "Ladislav Michl" , "Bernie Thompson" Date: Sun, 11 Feb 2018 04:20:06 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 32/79] video: udlfb: Fix read EDID timeout In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.99-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Ladislav Michl commit c98769475575c8a585f5b3952f4b5f90266f699b upstream. While usb_control_msg function expects timeout in miliseconds, a value of HZ is used. Replace it with USB_CTRL_GET_TIMEOUT and also fix error message which looks like: udlfb: Read EDID byte 78 failed err ffffff92 as error is either negative errno or number of bytes transferred use %d format specifier. Returned EDID is in second byte, so return error when less than two bytes are received. Fixes: 18dffdf8913a ("staging: udlfb: enhance EDID and mode handling support") Signed-off-by: Ladislav Michl Cc: Bernie Thompson Signed-off-by: Bartlomiej Zolnierkiewicz [bwh: Backported to 3.2: adjust filename] Signed-off-by: Ben Hutchings --- drivers/video/udlfb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -765,11 +765,11 @@ static int dlfb_get_edid(struct dlfb_dat for (i = 0; i < len; i++) { ret = usb_control_msg(dev->udev, - usb_rcvctrlpipe(dev->udev, 0), (0x02), - (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2, - HZ); - if (ret < 1) { - pr_err("Read EDID byte %d failed err %x\n", i, ret); + usb_rcvctrlpipe(dev->udev, 0), 0x02, + (0x80 | (0x02 << 5)), i << 8, 0xA1, + rbuf, 2, USB_CTRL_GET_TIMEOUT); + if (ret < 2) { + pr_err("Read EDID byte %d failed: %d\n", i, ret); i--; break; }