From patchwork Thu Dec 7 15:45:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121047 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8690877qgn; Thu, 7 Dec 2017 10:16:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMbbRCNYLsZTI9yEDVfi2ymeT0hlmMBAqtrK3PtdhNiH7g28lGqnkNn/ojet0Yy8dyvT+4PX X-Received: by 10.84.172.195 with SMTP id n61mr26442631plb.321.1512670618775; Thu, 07 Dec 2017 10:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512670618; cv=none; d=google.com; s=arc-20160816; b=Y/GvkuTfDfj4zID65+R4hSA9N7LN3S1DVf3uBmVwjLx30H/h1aTkJxlrP9iyjdLtH4 3rhhqGR3a0MZBnLx4b0xOh5T78LoXJ5ZaZdnmL4N0TxUok6VoS4XVW91zOH/92crsk// 1CgFNkplpKaBPrJHKw5xXZNCcmwM96GnlIcCc1DmLgLuZ0HR9Wdogi1tKdG4sahhU/O6 GX736ZXea3bdShIJlTEud+zBy0Fuigzf1TX1O3jG1I/io1h/h2ROp1A+AGLB0LlElXcZ fZ6St9ONOH/m2OZ7BRJ8N+yxjltsb4SrhYGZONp4wLCz0gGU8MqxTlbty2zv56tWzGrU Mn8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=McDgx3Fj8NCf7y9jkaxbloEV+JEwG28gsqPkBdOiRH8=; b=BaMsLhE+PQkbeq7uZdwBnqpJ2A9eN+KFFrQy1dQzXpm5swAGbzA5tS9zaJJq/sAdHT 4Lv99kxbetTIwbdL1X7JzzVdPoC2vDHUYslZ122Fxi5Brj7ZT7firUGmnFQsVa3wHbXa iqPNhzSJ4uiuSG0ci3Mfu8Z1nOv1D5hO8PoLFEobhaL8MP789cQLVThNj8ENtVOcIKjn 8y5EkOqW8xWNDlkXEmpfS1iG10PAxLfznRmhMUIzb/nRdAPjX+2XhJUXX+wyn0gU1hlC H0IbyHIGDTfK/Hs9rbE5fIhY0VDMZXgX8LHMII9U1tyPZPeuA8Hx4H/TNz7TKmXiXAWF pPKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=ivliP6jt; dkim=fail header.i=@verizon.com header.s=corp header.b=edtfm+7h; dkim=fail header.i=@verizon.com header.s=corp header.b=YPu9TpLK; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p33si4098642pld.453.2017.12.07.10.16.58; Thu, 07 Dec 2017 10:16:58 -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; dkim=fail header.i=@verizon.com header.s=corp header.b=ivliP6jt; dkim=fail header.i=@verizon.com header.s=corp header.b=edtfm+7h; dkim=fail header.i=@verizon.com header.s=corp header.b=YPu9TpLK; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754829AbdLGSQJ (ORCPT + 14 others); Thu, 7 Dec 2017 13:16:09 -0500 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:1026 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755161AbdLGPqc (ORCPT ); Thu, 7 Dec 2017 10:46:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512661592; x=1544197592; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p9FyQAjJJmFn2Vlutys3R2chTxJy88IcUZsTdDKAY0c=; b=ivliP6jtWAe7/PNXbP8ffUDrh2XgGjV/weFTaJFC5yjxa4babbmYa1lv KeJFw3nUglCiq7rsQteX4zheBudyhsgcJ9hD1+Vaj0ZTqK07PTpR0UysV pDZvP8CoLYBZC1Zep9izXCrvZ9SwrlG6NyKNH6VtTP1F3Tx88/5Xerkqt 8=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe02.verizonbusiness.com with ESMTP; 07 Dec 2017 15:46:29 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Dec 2017 15:45:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512661536; x=1544197536; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p9FyQAjJJmFn2Vlutys3R2chTxJy88IcUZsTdDKAY0c=; b=edtfm+7ht/ELoUnhHh2jhkeK8w0aju3ZyH3TJ0y8mg6L/ofIcOjGV/RH J2ITxdUKKlskZg69CKEf6p1YV1m3Eiihpz0y5iOCrs5j3bQqEM3c4WWMg I+A2ZsJCSuCgO/O4g/vVcqp0AFiHyjn4/m5yOwOiFjPX2yywL7afRElxK 4=; Received: from endeavour.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.163]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Dec 2017 10:45:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512661536; x=1544197536; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=p9FyQAjJJmFn2Vlutys3R2chTxJy88IcUZsTdDKAY0c=; b=YPu9TpLKVWLc7O0nNiE2paaIhuNOcV559jcM+Y0bF5ZkSJJV+AHabsLj 70hFrtUu+k1yUtHtvvNPnL7ztWEGduP5mDIeeva3pIxP0vJC0+W8yCMIn gII0mzAEdzdRfFkW/2BtYo74BCvh6NYeaxo7t/65R/pWvsJJ+KFZh90hT Q=; From: alexander.levin@verizon.com Cc: Arnd Bergmann , "Martin K . Petersen" , alexander.levin@verizon.com X-Host: endeavour.tdc.vzwcorp.com Received: from ohtwi1exh001.uswin.ad.vzwcorp.com ([10.144.218.43]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 07 Dec 2017 15:45:35 +0000 Received: from OHTWI1EXO910.uswin.ad.vzwcorp.com (10.144.218.210) by OHTWI1EXH001.uswin.ad.vzwcorp.com (10.144.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 7 Dec 2017 10:45:35 -0500 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by OHTWI1EXO910.uswin.ad.vzwcorp.com (10.144.218.210) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 7 Dec 2017 10:45:35 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 7 Dec 2017 09:45:34 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Thu, 7 Dec 2017 09:45:34 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 009/135] scsi: aacraid: use timespec64 instead of timeval Thread-Topic: [PATCH AUTOSEL for 4.14 009/135] scsi: aacraid: use timespec64 instead of timeval Thread-Index: AQHTb3JpizIKU2QQWEyjhK0G31mDUA== Date: Thu, 7 Dec 2017 15:45:31 +0000 Message-ID: <20171207154513.4154-9-alexander.levin@verizon.com> References: <20171207154513.4154-1-alexander.levin@verizon.com> In-Reply-To: <20171207154513.4154-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 820f188659122602ab217dd80cfa32b3ac0c55c0 ] aacraid passes the current time to the firmware in one of two ways, either as year/month/day/... or as 32-bit unsigned seconds. The first one is broken on 32-bit architectures as it cannot go past year 2038. Using timespec64 here makes it behave properly on both 32-bit and 64-bit architectures, and avoids relying on signed integer overflow to pass times into the second interface. The interface used in aac_send_hosttime() however is still problematic in year 2106 when 32-bit seconds overflow. Hopefully we don't have to worry about aacraid by that time. Signed-off-by: Arnd Bergmann Reviewed-by: Dave Carroll Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/aacraid/commsup.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.11.0 diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index dfe8e70f8d99..525a652dab48 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -2383,19 +2383,19 @@ fib_free_out: goto out; } -int aac_send_safw_hostttime(struct aac_dev *dev, struct timeval *now) +int aac_send_safw_hostttime(struct aac_dev *dev, struct timespec64 *now) { struct tm cur_tm; char wellness_str[] = "TD\010\0\0\0\0\0\0\0\0\0DW\0\0ZZ"; u32 datasize = sizeof(wellness_str); - unsigned long local_time; + time64_t local_time; int ret = -ENODEV; if (!dev->sa_firmware) goto out; - local_time = (u32)(now->tv_sec - (sys_tz.tz_minuteswest * 60)); - time_to_tm(local_time, 0, &cur_tm); + local_time = (now->tv_sec - (sys_tz.tz_minuteswest * 60)); + time64_to_tm(local_time, 0, &cur_tm); cur_tm.tm_mon += 1; cur_tm.tm_year += 1900; wellness_str[8] = bin2bcd(cur_tm.tm_hour); @@ -2412,7 +2412,7 @@ out: return ret; } -int aac_send_hosttime(struct aac_dev *dev, struct timeval *now) +int aac_send_hosttime(struct aac_dev *dev, struct timespec64 *now) { int ret = -ENOMEM; struct fib *fibptr; @@ -2424,7 +2424,7 @@ int aac_send_hosttime(struct aac_dev *dev, struct timeval *now) aac_fib_init(fibptr); info = (__le32 *)fib_data(fibptr); - *info = cpu_to_le32(now->tv_sec); + *info = cpu_to_le32(now->tv_sec); /* overflow in y2106 */ ret = aac_fib_send(SendHostTime, fibptr, sizeof(*info), FsaNormal, 1, 1, NULL, NULL); @@ -2496,7 +2496,7 @@ int aac_command_thread(void *data) } if (!time_before(next_check_jiffies,next_jiffies) && ((difference = next_jiffies - jiffies) <= 0)) { - struct timeval now; + struct timespec64 now; int ret; /* Don't even try to talk to adapter if its sick */ @@ -2506,15 +2506,15 @@ int aac_command_thread(void *data) next_check_jiffies = jiffies + ((long)(unsigned)check_interval) * HZ; - do_gettimeofday(&now); + ktime_get_real_ts64(&now); /* Synchronize our watches */ - if (((1000000 - (1000000 / HZ)) > now.tv_usec) - && (now.tv_usec > (1000000 / HZ))) - difference = (((1000000 - now.tv_usec) * HZ) - + 500000) / 1000000; + if (((NSEC_PER_SEC - (NSEC_PER_SEC / HZ)) > now.tv_nsec) + && (now.tv_nsec > (NSEC_PER_SEC / HZ))) + difference = (((NSEC_PER_SEC - now.tv_nsec) * HZ) + + NSEC_PER_SEC / 2) / NSEC_PER_SEC; else { - if (now.tv_usec > 500000) + if (now.tv_nsec > NSEC_PER_SEC / 2) ++now.tv_sec; if (dev->sa_firmware) From patchwork Thu Dec 7 15:45:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121038 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8659588qgn; Thu, 7 Dec 2017 09:49:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMaWlCUIovK5UcRX5SBmbke0ufeVCkHu/YKI6cT5Ua1kqguXekiRvX+Qxm4wbLpnK859ySrr X-Received: by 10.99.152.25 with SMTP id q25mr12804625pgd.245.1512668997832; Thu, 07 Dec 2017 09:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512668997; cv=none; d=google.com; s=arc-20160816; b=wH6JtxpynKU6yp8AP/yPR/7kQSvpaFFiqpR/tyAkwE2drhmpNKOZ21T3WyPY237AeF da65YwR8DvpTZYZyuvuJvnNDb0tWcpE6urM1NffO2UP7B78l8qxsPBd3G7RFN+RDd8it 4Gl9usfAD1V7qOfopFfcqLBMPVl0bs5N95wbRzWn1C8DZG6/XQ+M2HG3dzDlpceN1z4c KeifYfemhR799aZGh8jYa3ygVBnBoE0Di/h45S9PfO6t5YbPnQOkpBmYcrfZPV5fo9vc 69LS1Cq9LStyHRewZ2/B2x2Dpcddnm+WX7tfBX2sESDX7y1/C3pqj4KDA5VpgNgYmuFV l3UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=4E9y9DhxJon5GvzsvvKoYh0eeO6U32HFF0BPwhTn2Wk=; b=0FK1bpUqfWyaC1G6AcHiMODZdX8oelblyY+z8I/tY62055QrTHgpGK8RUn4SU/vvc9 niwdkB2kMYeaYqtGJNjg9yZ4PFCabWDYIjS0IIBQZDuhvZMOfIIniulvArxpGKm4twbL b1X7waVViBNDtA2SlJF3GvqfTFTrHo00CzyjYCCxCGiexXGJUmfMRr41TiStP4du0llA J0hEIQry9j0198h+U9mKelbWbBOdmrhmH9SeOQG9vf/KxMeEd5qWTsWscHWZFz90P940 Z7EThO/8y8/Glvc58gw1nJGHnk74PCegj3PRg0C7xr7f0IgvtlVQR7JE38hWNVKWK6S4 fMrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=Dv6RldIG; dkim=fail header.i=@verizon.com header.s=corp header.b=Q5sXXjv1; dkim=fail header.i=@verizon.com header.s=corp header.b=q7uhaCbq; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r26si4460523pfk.249.2017.12.07.09.49.57; Thu, 07 Dec 2017 09:49:57 -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; dkim=fail header.i=@verizon.com header.s=corp header.b=Dv6RldIG; dkim=fail header.i=@verizon.com header.s=corp header.b=Q5sXXjv1; dkim=fail header.i=@verizon.com header.s=corp header.b=q7uhaCbq; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753991AbdLGRty (ORCPT + 14 others); Thu, 7 Dec 2017 12:49:54 -0500 Received: from fldsmtpe03.verizon.com ([140.108.26.142]:60696 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755956AbdLGPtH (ORCPT ); Thu, 7 Dec 2017 10:49:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512661747; x=1544197747; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8Fj5PulWRVKzM9pjXpLSpM2S4liCi+Ed/LncQM2e+mM=; b=Dv6RldIGM5WXbcYVKMQHoc+QSiMj428cif9Ft0EFpkTDY2V/787rsRMc Cn/V0xWZn0SZiimevGIBMa16o0ZLbG1onsDKOXRU4+njGr1huiPEUKbjm UfOCWOuhVDE8BxJnW4Yqh3i3Afnm8UPApIdCyXBDSGumHqxcla43Wj13S I=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by fldsmtpe03.verizon.com with ESMTP; 07 Dec 2017 15:48:34 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Dec 2017 15:48:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512661694; x=1544197694; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8Fj5PulWRVKzM9pjXpLSpM2S4liCi+Ed/LncQM2e+mM=; b=Q5sXXjv18Iy0tW7fWSwfhZt5Wvx0JtDhkXWW4AVaL8IrsPCCmO4h83bx 3UDdtEkvVvD3pgjndeAz1gJ86QO88OUlhAgvxyDpBfKQUDldlKFGHuKW/ l+F47WkBaDdKmQwjcmFld/IigkgEOnYgC99aR1Khvn16hv2wNzkVD3Hry 8=; Received: from surveyor.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.83]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Dec 2017 10:48:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512661690; x=1544197690; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=8Fj5PulWRVKzM9pjXpLSpM2S4liCi+Ed/LncQM2e+mM=; b=q7uhaCbqdeUbmK3qIhYLQIdKb4l305xfwyvf5rFE/5AZjPAor9qdcRjE cLxCSAVIGT4JjmVMlYai7h2716vhlbeEZ3pau7Z6HBogQQPlTQ2NaVLi6 uff+08OlaNWrImgujJOmqX5fZMI2mfY3qefO15ID3B99ymet7NGxAFosj M=; From: alexander.levin@verizon.com Cc: Marek Szyprowski , Mark Brown , alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 07 Dec 2017 15:48:09 +0000 Received: from OHTWI1EXO912.uswin.ad.vzwcorp.com (10.144.218.211) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 7 Dec 2017 10:48:10 -0500 Received: from OMZP1LUMXCA15.uswin.ad.vzwcorp.com (144.8.22.190) by OHTWI1EXO912.uswin.ad.vzwcorp.com (10.144.218.211) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 7 Dec 2017 10:48:09 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA15.uswin.ad.vzwcorp.com (144.8.22.190) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 7 Dec 2017 09:48:08 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Thu, 7 Dec 2017 09:48:08 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 111/135] ASoC: samsung: i2s: disable secondary DAI until it gets fixed Thread-Topic: [PATCH AUTOSEL for 4.14 111/135] ASoC: samsung: i2s: disable secondary DAI until it gets fixed Thread-Index: AQHTb3J5warIqjAQ60SV7Mc/0WbpJA== Date: Thu, 7 Dec 2017 15:45:57 +0000 Message-ID: <20171207154513.4154-111-alexander.levin@verizon.com> References: <20171207154513.4154-1-alexander.levin@verizon.com> In-Reply-To: <20171207154513.4154-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski [ Upstream commit 064970a0aae978073a859aaf0793bfe14762d4f3 ] Secondary DAI in Exynos I2S driver is not used by any of the currently supported boards and it causes problems due to some limitations in the ASoC code. Disable it until it gets proper support both by board-specific and ASoC core code. Also disable IDMA support, which relies on secondary DAI presence. This patch fixes following kernel warning: samsung-i2s 3830000.i2s: ASoC: Failed to create component debugfs directory samsung-i2s 3830000.i2s: ASoC: Failed to create component debugfs directory ------------[ cut here ]------------ WARNING: CPU: 3 PID: 82 at fs/proc/generic.c:330 proc_register+0xec/0x10c proc_dir_entry 'sub0/prealloc' already registered Modules linked in: CPU: 3 PID: 82 Comm: kworker/3:1 Not tainted 4.14.0-rc5-next-20171017 #3089 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) Workqueue: events deferred_probe_work_func [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x90/0xc8) [] (dump_stack) from [] (__warn+0xd4/0x100) [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48) [] (warn_slowpath_fmt) from [] (proc_register+0xec/0x10c) [] (proc_register) from [] (proc_create_data+0x84/0xc8) [] (proc_create_data) from [] (snd_info_register+0x64/0xcc) [] (snd_info_register) from [] (snd_pcm_lib_preallocate_pages1+0x78/0x1a0) [] (snd_pcm_lib_preallocate_pages1) from [] (dmaengine_pcm_new+0xa0/0x1ec) [] (dmaengine_pcm_new) from [] (snd_soc_platform_drv_pcm_new+0x1c/0x28) [] (snd_soc_platform_drv_pcm_new) from [] (soc_new_pcm+0x2f4/0x4f4) [] (soc_new_pcm) from [] (snd_soc_register_card+0xc4c/0xdc4) [] (snd_soc_register_card) from [] (devm_snd_soc_register_card+0x34/0x70) [] (devm_snd_soc_register_card) from [] (asoc_simple_card_probe+0x230/0x47c) [] (asoc_simple_card_probe) from [] (platform_drv_probe+0x50/0xb0) [] (platform_drv_probe) from [] (driver_probe_device+0x2a0/0x46c) [] (driver_probe_device) from [] (bus_for_each_drv+0x44/0x8c) [] (bus_for_each_drv) from [] (__device_attach+0xa0/0x134) [] (__device_attach) from [] (bus_probe_device+0x88/0x90) [] (bus_probe_device) from [] (deferred_probe_work_func+0x3c/0x168) [] (deferred_probe_work_func) from [] (process_one_work+0x188/0x41c) [] (process_one_work) from [] (process_scheduled_works+0x28/0x38) [] (process_scheduled_works) from [] (worker_thread+0x210/0x4dc) [] (worker_thread) from [] (kthread+0x128/0x164) [] (kthread) from [] (ret_from_fork+0x14/0x2c) ---[ end trace bad8db6ee771d094 ]-- Signed-off-by: Marek Szyprowski Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/samsung/i2s.c | 1 + 1 file changed, 1 insertion(+) -- 2.11.0 diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 10a4da06c0a1..7738fbe75d91 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1285,6 +1285,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) } } } + quirks &= ~(QUIRK_SEC_DAI | QUIRK_SUPPORTS_IDMA); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pri_dai->addr = devm_ioremap_resource(&pdev->dev, res);