From patchwork Tue Oct 20 01:11:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Valentine X-Patchwork-Id: 36428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-px0-f139.google.com (mail-px0-f139.google.com [209.85.216.139]) by ozlabs.org (Postfix) with ESMTP id CA0BDB7B75 for ; Tue, 20 Oct 2009 12:11:36 +1100 (EST) Received: by pxi3 with SMTP id 3so1146868pxi.29 for ; Mon, 19 Oct 2009 18:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received:received-spf:received:received :message-id:date:subject:from:to:cc:reply-to:user-agent:mime-version :content-type:content-transfer-encoding:x-priority:importance :x-antiabuse:x-antiabuse:x-antiabuse:x-antiabuse:x-antiabuse :x-source:x-source-args:x-source-dir:sender:precedence:x-google-loop :mailing-list:list-id:list-post:list-help:list-unsubscribe :x-beenthere-env:x-beenthere; bh=O9NBcXy0W4tZXux19pAKcaAZgOCh+GwROs5vBWsGYiQ=; b=xo7LX/GRVp/vf1qqfH34ns2azuXxIMmMlCB1V1cbZ0Yx8nT7Zm+vhj8x29/EJiPPuo Pm34MMWUhQQyk05faQNnoe2YduUt6LsJ2PlQ2qVVE4zq+99RHH3Hx26cDnEBYE5hj06l C11kmqIzkpBl7fE6iwTslMfA8hpcn5Ao7BKiI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results :message-id:date:subject:from:to:cc:reply-to:user-agent:mime-version :content-type:content-transfer-encoding:x-priority:importance :x-antiabuse:x-source:x-source-args:x-source-dir:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; b=bHfOLUr0cosnOiAdQe64+nThQ4BIdr2oHH35fjk+xwu63XXAM5GRZIiepXrVQJ/MkC 4V3/Yx3Bnau1tRD0bWuCBDO2Ew0FNyoEomB25a5y+9fx8Yd/9Ds5/t4KgPhB95DLXt9H A14wGbdGNKqmNPdtEeYoQ057IOmehdsL74v2g= Received: by 10.142.5.25 with SMTP id 25mr112664wfe.12.1256001092584; Mon, 19 Oct 2009 18:11:32 -0700 (PDT) Received: by 10.106.99.27 with SMTP id w27gr2979prb.0; Mon, 19 Oct 2009 18:11:32 -0700 (PDT) X-Sender: svalentine@concentris-systems.com X-Apparently-To: rtc-linux@googlegroups.com Received: by 10.143.20.39 with SMTP id x39mr707478wfi.27.1256001091532; Mon, 19 Oct 2009 18:11:31 -0700 (PDT) Received: by 10.143.20.39 with SMTP id x39mr707477wfi.27.1256001091513; Mon, 19 Oct 2009 18:11:31 -0700 (PDT) Received: from biz49.inmotionhosting.com (biz49.inmotionhosting.com [74.124.203.185]) by gmr-mx.google.com with ESMTP id 18si850025pzk.13.2009.10.19.18.11.31; Mon, 19 Oct 2009 18:11:31 -0700 (PDT) Received-SPF: neutral (google.com: 74.124.203.185 is neither permitted nor denied by best guess record for domain of svalentine@concentris-systems.com) client-ip=74.124.203.185; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 74.124.203.185 is neither permitted nor denied by best guess record for domain of svalentine@concentris-systems.com) smtp.mail=svalentine@concentris-systems.com Received: from localhost ([127.0.0.1] helo=www.concentris-systems.com) by biz49.inmotionhosting.com with esmtpa (Exim 4.69) (envelope-from ) id 1N03Fz-0001vA-2P; Mon, 19 Oct 2009 18:11:23 -0700 Received: from 167.216.14.194 ([167.216.14.194]) (SquirrelMail authenticated user svalentine@concentris-systems.com) by www.concentris-systems.com with HTTP; Mon, 19 Oct 2009 15:11:23 -1000 (HST) Message-ID: <36176.167.216.14.194.1256001083.squirrel@www.concentris-systems.com> Date: Mon, 19 Oct 2009 15:11:23 -1000 (HST) Subject: [rtc-linux] [PATCH] RTC: v3020 driver bugfix From: "Scott Valentine" To: rtc-linux@googlegroups.com Cc: a.zummo@towertech.it, raph@8d.com, linux-kernel@vger.kernel.org Reply-To: rtc-linux@googlegroups.com User-Agent: SquirrelMail/1.4.13 Mime-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - biz49.inmotionhosting.com X-AntiAbuse: Original Domain - googlegroups.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - concentris-systems.com X-Source: X-Source-Args: X-Source-Dir: Sender: rtc-linux@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rtc-linux@googlegroups.com; contact rtc-linux+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rtc-linux@googlegroups.com X-BeenThere: rtc-linux@googlegroups.com v3020 read_bit always returns 0 when left_shift > 7 The v3020 read_bit function's return type is (unsigned char). The code returns a value masked by (1 << left_shift) that is casted to the return type. If left_shift is larger than 7, the cast will always result in a 0 return value. The problem was discovered with left_shift = 16, and the included patch corrects the problem. The bug was introduced in the last (Apr 3 2009) commit of the file, kernel versions 2.6.30 and later. Scott Valentine Concentris Systems LLC Manoa Innovation Center, Suite #238 2800 Woodlawn Drive Honolulu, HI 96822 http://www.Concentris-Systems.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. -~----------~----~----~----~------~----~------~--~--- diff -uNr a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c --- a/drivers/rtc/rtc-v3020.c 2009-10-15 14:41:50.000000000 -1000 +++ b/drivers/rtc/rtc-v3020.c 2009-10-19 14:06:27.000000000 -1000 @@ -96,7 +96,7 @@ static unsigned char v3020_mmio_read_bit(struct v3020 *chip) { - return readl(chip->ioaddress) & (1 << chip->leftshift); + return ((readl(chip->ioaddress) & (1 << chip->leftshift)) != 0); } static struct v3020_chip_ops v3020_mmio_ops = {