From: Stephen M. Cameron Date: Thu, 27 May 2010 20:13:53 +0000 (-0500) Subject: [SCSI] hpsa: check that simple mode is supported X-Git-Tag: firefly_0821_release~9833^2~1305^2~259 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cda7612d4b96d51324c6fc4d5e47d629da6cb500;p=firefly-linux-kernel-4.4.55.git [SCSI] hpsa: check that simple mode is supported before trying to enter simple mode transport method. Signed-off-by: Stephen M. Cameron Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 4d4ecca399ae..57d038045adc 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -3413,6 +3413,11 @@ static inline void hpsa_p600_dma_prefetch_quirk(struct ctlr_info *h) static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h) { int i; + u32 trans_support; + + trans_support = readl(&(h->cfgtable->TransportSupport)); + if (!(trans_support & SIMPLE_MODE)) + return -ENOTSUPP; h->max_commands = readl(&(h->cfgtable->CmdsOutMax)); /* Update the field, and then ring the doorbell */