All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: Ching Huang <ching2048@areca.com.tw>,
	Christoph Hellwig <hch@infradead.org>
Cc: jbottomley@parallels.com, dan.carpenter@oracle.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 16/17] arcmsr: support new adapter ARC12x4 series
Date: Thu, 11 Sep 2014 16:21:39 +0200	[thread overview]
Message-ID: <5411AFF3.5090708@redhat.com> (raw)
In-Reply-To: <1410407950.4753.18.camel@Centos6.3-64>

On 09/11/2014 05:59 AM, Ching Huang wrote:
> On Wed, 2014-09-10 at 11:58 +0200, Tomas Henzl wrote:
>> On 09/09/2014 06:30 PM, Christoph Hellwig wrote:
>>> Ching,
>>>
>>> do you have a chance to address Thomas second concern below?  As
>>> far as I can tell (Thomas, please correct me) that's the last
>>> outstanding concern, and I'd really like to merge the arcmsr updates
>>> for the Linux 3.18 merge window.
>> Correct, still awaiting a response.
> Christoph, Tomas,
>
> Sorry for the late reply.
>
> I think I misunderstand Tomas' meaning.
> The spin lock in arcmsr_hbaD_polling_ccbdone() is necessary to protect doneq_index and have to be modified as following.

OK, so you are going to repost 16/17 ? If so, please describe all changes you'll do, in that new post.

>
> static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock *acb,
> 				struct CommandControlBlock *poll_ccb)
> {
> 	bool error;
> 	uint32_t poll_ccb_done = 0, poll_count = 0, flag_ccb, ccb_cdb_phy;
> 	int rtn, doneq_index, index_stripped, outbound_write_pointer, toggle;
> 	unsigned long flags;
> 	struct ARCMSR_CDB *arcmsr_cdb;
> 	struct CommandControlBlock *pCCB;
> 	struct MessageUnit_D *pmu = acb->pmuD;
>
> polling_hbaD_ccb_retry:
> 	poll_count++;
> 	while (1) {
> 		spin_lock_irqsave(&acb->doneq_lock, flags);
> 		outbound_write_pointer = pmu->done_qbuffer[0].addressLow + 1;
> 		doneq_index = pmu->doneq_index;
> 		if ((outbound_write_pointer & 0xFFF) == (doneq_index & 0xFFF)) {
> 			spin_unlock_irqrestore(&acb->doneq_lock, flags);
> 			if (poll_ccb_done) {
> 				rtn = SUCCESS;
> 				break;
> 			} else {
> 				msleep(25);
> 				if (poll_count > 40) {
> 					rtn = FAILED;
> 					break;
> 				}
> 				goto polling_hbaD_ccb_retry;
> 			}
> 		}
> 		toggle = doneq_index & 0x4000;
> 		index_stripped = (doneq_index & 0xFFF) + 1;
> 		index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE;
> 		pmu->doneq_index = index_stripped ? (index_stripped | toggle) :
> 			((index_stripped + 1) | (toggle ^ 0x4000));
> 		spin_unlock_irqrestore(&acb->doneq_lock, flags);
> 		doneq_index = pmu->doneq_index;
> 		flag_ccb = pmu->done_qbuffer[doneq_index & 0xFFF].addressLow;
> 		ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0);
> 		arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset +
> 			ccb_cdb_phy);
> 		pCCB = container_of(arcmsr_cdb, struct CommandControlBlock,
> 			arcmsr_cdb);
> 		poll_ccb_done |= (pCCB == poll_ccb) ? 1 : 0;
> 		if ((pCCB->acb != acb) ||
> 			(pCCB->startdone != ARCMSR_CCB_START)) {
> 			if (pCCB->startdone == ARCMSR_CCB_ABORTED) {
> 				pr_notice("arcmsr%d: scsi id = %d "
> 					"lun = %d ccb = '0x%p' poll command "
> 					"abort successfully\n"
> 					, acb->host->host_no
> 					, pCCB->pcmd->device->id
> 					, (u32)pCCB->pcmd->device->lun
> 					, pCCB);
> 				pCCB->pcmd->result = DID_ABORT << 16;
> 				arcmsr_ccb_complete(pCCB);
> 				continue;
> 			}
> 			pr_notice("arcmsr%d: polling an illegal "
> 				"ccb command done ccb = '0x%p' "
> 				"ccboutstandingcount = %d\n"
> 				, acb->host->host_no
> 				, pCCB
> 				, atomic_read(&acb->ccboutstandingcount));
> 			continue;
> 		}
> 		error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE1)
> 			? true : false;
> 		arcmsr_report_ccb_state(acb, pCCB, error);
> 	}
> 	return rtn;
> }
>
>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2014-09-11 14:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19  7:25 [PATCH v3 16/17] arcmsr: support new adapter ARC12x4 series Ching Huang
2014-08-27 14:00 ` Tomas Henzl
2014-08-28 15:46   ` Ching Huang
2014-08-28 12:49     ` Tomas Henzl
2014-09-09 16:30       ` Christoph Hellwig
2014-09-10  9:58         ` Tomas Henzl
2014-09-11  3:59           ` Ching Huang
2014-09-11 14:21             ` Tomas Henzl [this message]
2014-09-12  3:31               ` Ching Huang
2014-09-15 13:23           ` Tomas Henzl
2014-09-15 17:05             ` Christoph Hellwig
2014-09-16  2:42               ` Ching Huang
2014-09-16 22:40                 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5411AFF3.5090708@redhat.com \
    --to=thenzl@redhat.com \
    --cc=ching2048@areca.com.tw \
    --cc=dan.carpenter@oracle.com \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.