Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7098002imu; Mon, 21 Jan 2019 23:52:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN66dME+tDaxrCjXCCv1m/1jZpIFDW6BPAYjgqIRl7YwY87QhQ3xK98Eej0xaSF0fkJi57Qb X-Received: by 2002:a17:902:bd4a:: with SMTP id b10mr33344429plx.232.1548143536527; Mon, 21 Jan 2019 23:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548143536; cv=none; d=google.com; s=arc-20160816; b=Jf29Rt0lulzsYPnv0lsgdZsY8UboOVcCe86YRF7AxkwtxDLxB6b1N5p1mQ6CP6CmOV 53Yrow5ydt6lS9rfFJQkthQGbggOi4dc13ZuXcJ+GsiJwOIoKSuwglnVel4TO/nxsD4l JdMcrH2ArK/dmAdbKPLgpGHg3cSYWeOWDbmcuYzJ6U+Z98uVmADIbC9k+/8ouOfOlzwI N1VVKyY8q7D2KB0Y/s7CTK+lQURslyWzd5dcAUtZ1siqIvY11vqkXmGJtfbk9M2+pbnQ MhCIAQJqGgZXm1mM69RkJfIJs9WWwmnlUpkEyfOaK4fXZiYZhY9ux0dwAUWbzNtaS2sX EPjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DUICae31W7z5x97xX54CFol4IPkQrRIiS38gD816A8w=; b=uO4aKVzLtgRuQJoKC27LlqpdwdlhKm2cEGchOMnkOSPqo6yVyZjrg6J1DUkaGUGS+X B3mKvvcP/faZbZ8SVX66+6bqHPpyU95VWvWNX451v9zOQjFF0gYJ29cQ1HVgDlN8IM6W MbmrX2DGbhqTJxpCDmxzxR6zuLfRJCvBjbeCVm2oJayRO6ecD7hJF1uebPaQh3q8Ra5z col6c/g65BTVpA85CXWyC5ymJI7E3tuTypM+qR9uA0MzT35DIgRRjeePxdetarDB4EvZ mF2JNitvWmDPdTVwa9UkjJJvhFbTIHQ37UTUTTDrcTAPmspNSIVq7KmZyjYsCOLDkEPp iyYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ixnChyjj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si15100043pgn.57.2019.01.21.23.52.01; Mon, 21 Jan 2019 23:52:16 -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=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ixnChyjj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbfAVHu5 (ORCPT + 99 others); Tue, 22 Jan 2019 02:50:57 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:40636 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727219AbfAVHu5 (ORCPT ); Tue, 22 Jan 2019 02:50:57 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0M7d7bE182911; Tue, 22 Jan 2019 07:48:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=DUICae31W7z5x97xX54CFol4IPkQrRIiS38gD816A8w=; b=ixnChyjjWKA1hhYO4ebIJ9fO6f7E47VGWCwOs4p1JdOCL5RbAGh6Om9mElHDdjzAkHV3 gB8owMiQULQMZMfFAU8XvUKCnmC6f+ZSkt8iqsWtopTZx0RU++r4bZwws6sgD1CDA2TZ J32DPhLIOk1oYT60WzYNC88LeUdT9f0ecOwHaftCLe+ikfRX0y925GOEJP2BzzqfQ6u1 tJsF5015QuEyf4VkiRdA+Eh+srOMb+s/m171JnerkxK4Io9c6kG12d+k5pYAD7lQePE3 cJepHlyT8sovNLw8aQqW/zth6w8coHiPR1+UF4NyYGwHxg1M3eF7lo84C/mFJ2XzZVUJ Gw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2q3vhrhtqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Jan 2019 07:48:42 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0M7mgk4032150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Jan 2019 07:48:42 GMT Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x0M7me1K004012; Tue, 22 Jan 2019 07:48:41 GMT Received: from kadam (/197.157.34.164) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Jan 2019 23:48:40 -0800 Date: Tue, 22 Jan 2019 10:48:16 +0300 From: Dan Carpenter To: Ching Huang Cc: martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, colin.king@canonical.com Subject: Re: [PATCH 2/3] scsi: arcmsr: Fix suspend/resume of ACB_ADAPTER_TYPE_B part 2 Message-ID: <20190122074816.GC11828@kadam> References: <1547696703.4339.21.camel@Centos6.3-64> <20190117070227.GM4504@kadam> <1547714827.5079.19.camel@Centos6.3-64> <20190117091646.GA11828@kadam> <1547718748.5079.34.camel@Centos6.3-64> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547718748.5079.34.camel@Centos6.3-64> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9143 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=799 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901220064 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 05:52:28PM +0800, Ching Huang wrote: > On Thu, 2019-01-17 at 12:16 +0300, Dan Carpenter wrote: > > On Thu, Jan 17, 2019 at 04:47:07PM +0800, Ching Huang wrote: > > > On Thu, 2019-01-17 at 10:59 +0300, Dan Carpenter wrote: > > > > On Thu, Jan 17, 2019 at 11:45:03AM +0800, Ching Huang wrote: > > > > > >From Ching Huang > > > > > > > > > > Fix suspend/resume of ACB_ADAPTER_TYPE_B part 2. > > > > > > > > > > > > > What does this look like from a user perspective? Does it fail every > > > > time or does it only fail sometimes? > > > > > > > > What's the bug exactly? > > > > > > > > There is no Fixes tag... > > > >From user's perspective, hibernate/resume are OK. > > > But following IO may cause 'isr get an illegal ccb command' in > > > log/messages sometime. > > > > > > > > > > You will need to resend with that information included in the commit > > message. > OK. I will resend this patch later. > > > > > > > Signed-off-by: Ching Huang > > > > > --- > > > > > > > > > > diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h > > > > > index a94c513..b98c632 100755 > > > > > --- a/drivers/scsi/arcmsr/arcmsr.h > > > > > +++ b/drivers/scsi/arcmsr/arcmsr.h > > > > > @@ -508,9 +508,9 @@ struct MessageUnit_A > > > > > struct MessageUnit_B > > > > > { > > > > > uint32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; > > > > > - uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; > > > > > + volatile uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; > > > > > > > > There is a well known rule of thumb that when someone uses "volatile" > > > > in the kernel it means there is a locking problem... Is this __iomem or > > > > something? > > > The done_qbuffer was a command completion queue, it was an area written > > > by IO processor and read by device driver. So, ... > > > > I'm not totally positive I understand this sentence. I can find a bunch > > of places which read from this buffer, but I haven't immediately found > > which place writes to it. Can you give me a function name that I should > > read? > Well, we allocate memory for struct MessageUnit_B in > arcmsr_alloc_ccb_pool(), by assign to acb->dma_coherent_handle2. > Then we tell IO controller its DMA address in arcmsr_iop_confirm(). > When a command was completed, controller's firmware program will write a > completion ccb in done_qbuffer through DMA. So, you can't see any driver > funtion write to it. DMA memory doesn't need to be marked as volatile. regards, dan carpenter