Skip to content

Commit 7a912d0

Browse files
committed
Merge tag 'spi-v6.16-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull more spi updates from Mark Brown: "A small set of updates that came in during the merge window, we've got: - Some small fixes for the Broadcom and spi-pci1xxxx drivers - A change to the QPIC SNAND driver to flag that the error correction features are less useful than people might be expecting - A new device ID for the SOPHGO SG2042 - The addition of Yang Shen as a Huawei maintainer" * tag 'spi-v6.16-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-qpic-snand: document the limited bit error reporting capability spi: bcm63xx-hsspi: fix shared reset spi: bcm63xx-spi: fix shared reset MAINTAINERS: Update HiSilicon SFC driver maintainer MAINTAINERS: Update HiSilicon SPI Controller driver maintainer spi: dt-bindings: spi-sg2044-nor: Add SOPHGO SG2042 spi: spi-pci1xxxx: Fix Probe failure with Dual SPI instance with INTx interrupts
2 parents d7582bb + 57cf46c commit 7a912d0

File tree

6 files changed

+58
-19
lines changed

6 files changed

+58
-19
lines changed

Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ allOf:
1414

1515
properties:
1616
compatible:
17-
const: sophgo,sg2044-spifmc-nor
17+
oneOf:
18+
- const: sophgo,sg2044-spifmc-nor
19+
- items:
20+
- enum:
21+
- sophgo,sg2042-spifmc-nor
22+
- const: sophgo,sg2044-spifmc-nor
1823

1924
reg:
2025
maxItems: 1

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10966,7 +10966,7 @@ F: drivers/crypto/hisilicon/sec2/sec_crypto.h
1096610966
F: drivers/crypto/hisilicon/sec2/sec_main.c
1096710967

1096810968
HISILICON SPI Controller DRIVER FOR KUNPENG SOCS
10969-
M: Jay Fang <f.fangjian@huawei.com>
10969+
M: Yang Shen <shenyang39@huawei.com>
1097010970
1097110971
S: Maintained
1097210972
W: http://www.hisilicon.com
@@ -10992,7 +10992,7 @@ S: Maintained
1099210992
F: drivers/crypto/hisilicon/trng/trng.c
1099310993

1099410994
HISILICON V3XX SPI NOR FLASH Controller Driver
10995-
M: Jay Fang <f.fangjian@huawei.com>
10995+
M: Yang Shen <shenyang39@huawei.com>
1099610996
S: Maintained
1099710997
W: http://www.hisilicon.com
1099810998
F: drivers/spi/spi-hisi-sfc-v3xx.c

drivers/spi/spi-bcm63xx-hsspi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
745745
if (IS_ERR(clk))
746746
return PTR_ERR(clk);
747747

748-
reset = devm_reset_control_get_optional_exclusive(dev, NULL);
748+
reset = devm_reset_control_get_optional_shared(dev, NULL);
749749
if (IS_ERR(reset))
750750
return PTR_ERR(reset);
751751

drivers/spi/spi-bcm63xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
523523
return PTR_ERR(clk);
524524
}
525525

526-
reset = devm_reset_control_get_optional_exclusive(dev, NULL);
526+
reset = devm_reset_control_get_optional_shared(dev, NULL);
527527
if (IS_ERR(reset))
528528
return PTR_ERR(reset);
529529

drivers/spi/spi-pci1xxxx.c

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,17 @@ static irqreturn_t pci1xxxx_spi_isr(int irq, void *dev)
685685
return pci1xxxx_spi_isr_io(irq, dev);
686686
}
687687

688+
static irqreturn_t pci1xxxx_spi_shared_isr(int irq, void *dev)
689+
{
690+
struct pci1xxxx_spi *par = dev;
691+
u8 i = 0;
692+
693+
for (i = 0; i < par->total_hw_instances; i++)
694+
pci1xxxx_spi_isr(irq, par->spi_int[i]);
695+
696+
return IRQ_HANDLED;
697+
}
698+
688699
static bool pci1xxxx_spi_can_dma(struct spi_controller *host,
689700
struct spi_device *spi,
690701
struct spi_transfer *xfer)
@@ -702,6 +713,7 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id *
702713
struct device *dev = &pdev->dev;
703714
struct pci1xxxx_spi *spi_bus;
704715
struct spi_controller *spi_host;
716+
int num_vector = 0;
705717
u32 regval;
706718
int ret;
707719

@@ -749,9 +761,9 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id *
749761
if (!spi_bus->reg_base)
750762
return -EINVAL;
751763

752-
ret = pci_alloc_irq_vectors(pdev, hw_inst_cnt, hw_inst_cnt,
753-
PCI_IRQ_ALL_TYPES);
754-
if (ret < 0) {
764+
num_vector = pci_alloc_irq_vectors(pdev, 1, hw_inst_cnt,
765+
PCI_IRQ_ALL_TYPES);
766+
if (num_vector < 0) {
755767
dev_err(&pdev->dev, "Error allocating MSI vectors\n");
756768
return ret;
757769
}
@@ -765,9 +777,15 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id *
765777
SPI_MST_EVENT_MASK_REG_OFFSET(spi_sub_ptr->hw_inst));
766778
spi_sub_ptr->irq = pci_irq_vector(pdev, 0);
767779

768-
ret = devm_request_irq(&pdev->dev, spi_sub_ptr->irq,
769-
pci1xxxx_spi_isr, PCI1XXXX_IRQ_FLAGS,
770-
pci_name(pdev), spi_sub_ptr);
780+
if (num_vector >= hw_inst_cnt)
781+
ret = devm_request_irq(&pdev->dev, spi_sub_ptr->irq,
782+
pci1xxxx_spi_isr, PCI1XXXX_IRQ_FLAGS,
783+
pci_name(pdev), spi_sub_ptr);
784+
else
785+
ret = devm_request_irq(&pdev->dev, spi_sub_ptr->irq,
786+
pci1xxxx_spi_shared_isr,
787+
PCI1XXXX_IRQ_FLAGS | IRQF_SHARED,
788+
pci_name(pdev), spi_bus);
771789
if (ret < 0) {
772790
dev_err(&pdev->dev, "Unable to request irq : %d",
773791
spi_sub_ptr->irq);
@@ -798,14 +816,16 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id *
798816
regval &= ~SPI_INTR;
799817
writel(regval, spi_bus->reg_base +
800818
SPI_MST_EVENT_MASK_REG_OFFSET(spi_sub_ptr->hw_inst));
801-
spi_sub_ptr->irq = pci_irq_vector(pdev, iter);
802-
ret = devm_request_irq(&pdev->dev, spi_sub_ptr->irq,
803-
pci1xxxx_spi_isr, PCI1XXXX_IRQ_FLAGS,
804-
pci_name(pdev), spi_sub_ptr);
805-
if (ret < 0) {
806-
dev_err(&pdev->dev, "Unable to request irq : %d",
807-
spi_sub_ptr->irq);
808-
return -ENODEV;
819+
if (num_vector >= hw_inst_cnt) {
820+
spi_sub_ptr->irq = pci_irq_vector(pdev, iter);
821+
ret = devm_request_irq(&pdev->dev, spi_sub_ptr->irq,
822+
pci1xxxx_spi_isr, PCI1XXXX_IRQ_FLAGS,
823+
pci_name(pdev), spi_sub_ptr);
824+
if (ret < 0) {
825+
dev_err(&pdev->dev, "Unable to request irq : %d",
826+
spi_sub_ptr->irq);
827+
return -ENODEV;
828+
}
809829
}
810830
}
811831

drivers/spi/spi-qpic-snand.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,20 @@ static int qcom_spi_check_error(struct qcom_nand_controller *snandc)
639639
unsigned int stat;
640640

641641
stat = buffer & BS_CORRECTABLE_ERR_MSK;
642+
643+
/*
644+
* The exact number of the corrected bits is
645+
* unknown because the hardware only reports the
646+
* number of the corrected bytes.
647+
*
648+
* Since we have no better solution at the moment,
649+
* report that value as the number of bit errors
650+
* despite that it is inaccurate in most cases.
651+
*/
652+
if (stat && stat != ecc_cfg->strength)
653+
dev_warn_once(snandc->dev,
654+
"Warning: due to hw limitation, the reported number of the corrected bits may be inaccurate\n");
655+
642656
snandc->qspi->ecc_stats.corrected += stat;
643657
max_bitflips = max(max_bitflips, stat);
644658
}

0 commit comments

Comments
 (0)